本文整理汇总了C++中CALL函数的典型用法代码示例。如果您正苦于以下问题:C++ CALL函数的具体用法?C++ CALL怎么用?C++ CALL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CALL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: callHandlersOnCreate
void callHandlersOnCreate(){ CALL(onCreate()); }
示例2: dlNewAnimTick
dlAnimTick* dlNewAnimTick( dlAnim *anim )
{
dlNodeAnim *node;
dlAnimTickOldNode **oldNode;
dlVectorKey *vkey;
dlQuatKey *qkey;
DL_NODE_TYPE count;
CALL("%p", anim);
if(!anim)
{ RET("%p", NULL); return( NULL ); }
/* Allocate animation handler object */
dlSetAlloc( ALLOC_EVALUATOR );
dlAnimTick *animTick = (dlAnimTick*)dlCalloc( 1, sizeof(dlAnimTick) );
if(!animTick)
{ RET("%p", NULL); return( NULL ); }
/* assign animation */
animTick->anim = anim;
animTick->oldTime = 0.0f;
/* null */
animTick->oldNode = NULL;
node = anim->node;
oldNode = &animTick->oldNode;
for(; node; node = node->next)
{
*oldNode = dlCalloc( 1, sizeof(dlAnimTickOldNode) );
if(!*oldNode)
{
dlFreeAnimTick( animTick );
RET("%p", NULL);
return( NULL );
}
/* store translations to pointer array */
if(node->translation)
{
(*oldNode)->translation = dlCalloc( node->num_translation, sizeof(dlVectorKey*) );
if(!(*oldNode)->translation)
{
dlFreeAnimTick( animTick );
RET("%p", NULL);
return( NULL );
}
vkey = node->translation; count = 0;
for(; vkey; vkey = vkey->next)
(*oldNode)->translation[count++] = vkey;
}
/* store rortations to pointer array */
if(node->rotation)
{
(*oldNode)->rotation = dlCalloc( node->num_rotation, sizeof(dlQuatKey*) );
if(!(*oldNode)->rotation)
{
dlFreeAnimTick( animTick );
RET("%p", NULL);
return( NULL );
}
qkey = node->rotation; count = 0;
for(; qkey; qkey = qkey->next)
(*oldNode)->rotation[count++] = qkey;
}
/* store scalings to pointer array */
if(node->scaling)
{
(*oldNode)->scaling = dlCalloc( node->num_scaling, sizeof(dlVectorKey*) );
if(!(*oldNode)->scaling)
{
dlFreeAnimTick( animTick );
RET("%p", NULL);
return( NULL );
}
vkey = node->scaling; count = 0;
for(; vkey; vkey = vkey->next)
(*oldNode)->scaling[count++] = vkey;
}
oldNode = &(*oldNode)->next;
}
/* no animations, pointless */
if(!anim->node)
{
dlFreeAnimTick( animTick );
RET("%p", NULL);
//.........这里部分代码省略.........
示例3: videobuf_read_stream
ssize_t videobuf_read_stream(struct videobuf_queue *q,
char __user *data, size_t count, loff_t *ppos,
int vbihack, int nonblocking)
{
int rc, retval;
unsigned long flags = 0;
MAGIC_CHECK(q->int_ops->magic, MAGIC_QTYPE_OPS);
dprintk(2, "%s\n", __FUNCTION__);
mutex_lock(&q->vb_lock);
retval = -EBUSY;
if (q->streaming)
goto done;
if (!q->reading) {
retval = __videobuf_read_start(q);
if (retval < 0)
goto done;
}
retval = 0;
while (count > 0) {
/* get / wait for data */
if (NULL == q->read_buf) {
q->read_buf = list_entry(q->stream.next,
struct videobuf_buffer,
stream);
list_del(&q->read_buf->stream);
q->read_off = 0;
}
rc = videobuf_waiton(q->read_buf, nonblocking, 1);
if (rc < 0) {
if (0 == retval)
retval = rc;
break;
}
if (q->read_buf->state == VIDEOBUF_DONE) {
rc = CALL(q, copy_stream, q, data + retval, count,
retval, vbihack, nonblocking);
if (rc < 0) {
retval = rc;
break;
}
retval += rc;
count -= rc;
q->read_off += rc;
} else {
/* some error */
q->read_off = q->read_buf->size;
if (0 == retval)
retval = -EIO;
}
/* requeue buffer when done with copying */
if (q->read_off == q->read_buf->size) {
list_add_tail(&q->read_buf->stream,
&q->stream);
if (q->irqlock)
spin_lock_irqsave(q->irqlock, flags);
q->ops->buf_queue(q, q->read_buf);
if (q->irqlock)
spin_unlock_irqrestore(q->irqlock, flags);
q->read_buf = NULL;
}
if (retval < 0)
break;
}
示例4: EmLicenseDlg
// License dialog
UINT EmLicenseDlg(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param)
{
RPC *s = (RPC *)param;
NMHDR *n;
// Validate arguments
if (hWnd == NULL)
{
return 0;
}
switch (msg)
{
case WM_INITDIALOG:
EmLicenseDlgInit(hWnd, s);
break;
case WM_NOTIFY:
n = (NMHDR *)lParam;
switch (n->code)
{
case LVN_ITEMCHANGED:
switch (n->idFrom)
{
case L_LIST:
case L_STATUS:
EmLicenseDlgUpdate(hWnd, s);
break;
}
break;
}
break;
case WM_COMMAND:
switch (wParam)
{
case IDOK:
if (IsEnable(hWnd, IDOK))
{
UINT i = LvGetSelected(hWnd, L_LIST);
if (i != INFINITE)
{
char *s = LvGetStrA(hWnd, L_LIST, i, 5);
char tmp[MAX_SIZE];
Format(tmp, sizeof(tmp), _SS("LICENSE_SUPPORT_URL"), s);
ShellExecute(hWnd, "open", tmp, NULL, NULL, SW_SHOW);
Free(s);
}
}
break;
case B_OBTAIN:
ShellExecute(hWnd, "open", _SS("LICENSE_INFO_URL"), NULL, NULL, SW_SHOW);
break;
case B_ADD:
if (EmLicenseAdd(hWnd, s))
{
EmLicenseDlgRefresh(hWnd, s);
}
break;
case B_DEL:
if (IsEnable(hWnd, B_DEL))
{
UINT id = (UINT)LvGetParam(hWnd, L_LIST, LvGetSelected(hWnd, L_LIST));
if (id != 0)
{
if (MsgBox(hWnd, MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2, _UU("SM_LICENSE_DELETE_MSG")) == IDYES)
{
RPC_TEST t;
Zero(&t, sizeof(t));
t.IntValue = id;
if (CALL(hWnd, EcDelLicenseKey(s, &t)))
{
EmLicenseDlgRefresh(hWnd, s);
}
}
}
}
break;
case IDCANCEL:
Close(hWnd);
break;
}
break;
case WM_CLOSE:
EndDialog(hWnd, 0);
break;
}
LvStandardHandler(hWnd, msg, wParam, lParam, L_LIST);
//.........这里部分代码省略.........
示例5: METH
int METH(mainItf, main)(int argc, char **argv) {
return CALL(zeroItf, returnZero)();
}
示例6: EmMainDlg
// Main dialog procedure
UINT EmMainDlg(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, void *param)
{
NMHDR *n;
RPC *r = (RPC *)param;
UINT i;
char *name;
// Validate arguments
if (hWnd == NULL)
{
return 0;
}
switch (msg)
{
case WM_INITDIALOG:
EmMainInit(hWnd, r);
break;
case WM_COMMAND:
switch (wParam)
{
case IDOK:
// Edit
i = LvGetSelected(hWnd, L_LIST);
if (i != INFINITE)
{
wchar_t *tmp;
tmp = LvGetStr(hWnd, L_LIST, i, 0);
if (tmp != NULL)
{
name = CopyUniToStr(tmp);
EmAdd(hWnd, r, name);
Free(tmp);
Free(name);
}
}
break;
case B_PASSWORD:
// Admin password
Dialog(hWnd, D_EM_PASSWORD, EmPasswordDlg, r);
break;
case B_LICENSE:
// Admin password
Dialog(hWnd, D_EM_LICENSE, EmLicenseDlg, r);
break;
case B_ADD:
// Add
EmAdd(hWnd, r, NULL);
EmMainRefresh(hWnd, r);
break;
case B_DELETE:
// Delete
i = LvGetSelected(hWnd, L_LIST);
if (i != INFINITE)
{
wchar_t *tmp;
tmp = LvGetStr(hWnd, L_LIST, i, 0);
if (tmp != NULL)
{
RPC_DELETE_DEVICE t;
wchar_t msg[MAX_SIZE];
name = CopyUniToStr(tmp);
UniFormat(msg, sizeof(msg), _UU("EM_DELETE_CONFIRM"), name);
if (MsgBox(hWnd, MB_YESNO | MB_ICONEXCLAMATION | MB_DEFBUTTON2, msg) == IDYES)
{
Zero(&t, sizeof(t));
StrCpy(t.DeviceName, sizeof(t.DeviceName), name);
if (CALL(hWnd, EcDelDevice(r, &t)))
{
EmMainRefresh(hWnd, r);
}
}
Free(tmp);
Free(name);
}
}
break;
case IDCANCEL:
Close(hWnd);
break;
}
break;
case WM_TIMER:
switch (wParam)
{
case 1:
KillTimer(hWnd, 1);
EmMainRefresh(hWnd, r);
SetTimer(hWnd, 1, 1000, NULL);
break;
}
break;
//.........这里部分代码省略.........
示例7: EMExec
// Start the EtherLogger Manager
void EMExec()
{
char *host;
char *ret;
bool cancel_now = false;
TOKEN_LIST *t;
UINT port = EL_ADMIN_PORT;
InitWinUi(_UU("EM_TITLE"), _SS("DEFAULT_FONT"), _II("DEFAULT_FONT_SIZE"));
while (true)
{
ret = EmRemoteDlg();
if (ret != NULL)
{
t = ParseToken(ret, ":");
if (t->NumTokens == 1 || t->NumTokens == 2)
{
RPC *rpc = NULL;
bool ok = false;
UINT ret;
host = t->Token[0];
if (t->NumTokens == 2)
{
port = ToInt(t->Token[1]);
}
else
{
port = EL_ADMIN_PORT;
}
// Try without a password first
ret = EcConnect(host, port, "", &rpc);
RETRY:
if (ret != ERR_NO_ERROR && ret != ERR_AUTH_FAILED)
{
// Connection failed
CALL(NULL, ret);
}
else
{
if (ret == ERR_NO_ERROR)
{
// Successful connection
ok = true;
}
else
{
// Password required
char *pass = SmPassword(NULL, host);
if (pass == NULL)
{
// Cancel
cancel_now = true;
}
else
{
// Retry
ret = EcConnect(host, port, pass, &rpc);
Free(pass);
if (ret == ERR_NO_ERROR)
{
ok = true;
}
else
{
goto RETRY;
}
}
}
}
if (ok)
{
// Main screen
EMMain(rpc);
// Disconnect
EcDisconnect(rpc);
cancel_now = true;
}
FreeToken(t);
}
Free(ret);
}
else
{
cancel_now = true;
}
if (cancel_now)
{
break;
}
}
FreeWinUi();
}
示例8: begin
/* non-SSL begin() function. */
static int begin(ne_socket **sock, server_fn fn, void *ud)
{
unsigned int port;
CALL(new_spawn_server(1, fn, ud, &port));
return do_connect(sock, localhost, port);
}
示例9: main
int main(void)
{
int i = 0;
int error = 0;
int a[5] = {1, 3, 4, 5, 2};
float b[5] = {1.0, 3.0, 4.0, 5.0, 2.0};
char c[5] = {'a', 'b', 'c', 'd', '\0'};
char *strarr[5] = {"ab", "cd", "ef", "g", "h"};
char *dynamicstrarr[5] = {0};
void *p = NULL;
PCMstack *s = NULL;
CALL(PCMstackcreate (&s, 3));
//integer
printf ("integer stack:\n");
for (i = 0; i < 5; ++i)
{
CALL(PCMstackpush (s, &a[i]));
}
for (i = 0; i < 5; ++i)
{
printf ("%5d", *(int*)s->data[i]);
}
putchar('\n');
for (i = 0; i < 5; ++i)
{
printf ("%d is poped\n", *(int*)(PCMstackpop(s)));
}
if ( PCMstackisempty(s) )
{
printf ("stack is empty now!\n");
}
//float
printf ("float stack:\n");
for (i = 0; i < 5; ++i)
{
CALL(PCMstackpush (s, &b[i]));
}
for (i = 0; i < 5; ++i)
{
printf ("%5.2f", *(float*)s->data[i]);
}
putchar('\n');
for (i = 0; i < 5; ++i)
{
printf ("%.2f is poped\n", *(float*)(PCMstackpop(s)));
}
if ( PCMstackisempty(s) )
{
printf ("stack is empty now!\n");
}
//char
printf ("char stack:\n");
for (i = 0; i < 5; ++i)
{
CALL(PCMstackpush (s, &c[i]));
}
for (i = 0; i < 5; ++i)
{
printf ("%5c", *(char*)s->data[i]);
}
putchar('\n');
for (i = 0; i < 5; ++i)
{
printf ("%c is poped\n", *(char*)(PCMstackpop(s)));
}
if ( PCMstackisempty(s) )
{
printf ("stack is empty now!\n");
}
//strarray
printf ("str array stack:\n");
for (i = 0; i < 5; ++i)
{
CALL(PCMstackpush (s, strarr[i]));
}
for (i = 0; i < 5; ++i)
{
printf ("%5s", (char*)s->data[i]);
}
putchar('\n');
for (i = 0; i < 5; ++i)
//.........这里部分代码省略.........
示例10: echo_expect
static int echo_expect(ne_socket *sock, const char *line)
{
CALL(full_write(sock, line, strlen(line)));
return line_expect(sock, line);
}
示例11: fail_socks
static int fail_socks(void)
{
static const struct {
enum ne_sock_sversion version;
enum socks_failure failure;
const char *expect;
const char *username, *password;
} ts[] = {
{ NE_SOCK_SOCKSV5, fail_init_vers,
"Invalid version in proxy response", NULL, NULL },
{ NE_SOCK_SOCKSV5, fail_init_trunc,
"Could not read initial response from proxy: Connection closed",
NULL, NULL },
{ NE_SOCK_SOCKSV5, fail_init_close,
"Could not read initial response from proxy: Connection closed",
NULL, NULL },
{ NE_SOCK_SOCKSV5, fail_no_auth,
"No acceptable authentication method",
NULL, NULL },
{ NE_SOCK_SOCKSV5, fail_bogus_auth,
"Unexpected authentication method chosen",
NULL, NULL },
{ NE_SOCK_SOCKSV5, fail_auth_close,
"Could not read login reply: Connection closed",
"foo", "bar" },
{ NE_SOCK_SOCKSV5, fail_auth_denied,
"Authentication failed", "foo", "bar" }
};
unsigned n;
for (n = 0; n < sizeof(ts)/sizeof(ts[n]); n++) {
ne_socket *sock;
struct socks_server arg = {0};
int ret;
arg.version = ts[n].version;
arg.failure = ts[n].failure;
arg.expect_port = 5555;
arg.expect_addr = ne_iaddr_make(ne_iaddr_ipv4, raw_127);
arg.username = ts[n].username;
arg.password = ts[n].password;
CALL(begin_socks(&sock, &arg, echo_server, NULL));
ret = ne_sock_proxy(sock, ts[n].version, arg.expect_addr,
NULL, arg.expect_port,
ts[n].username, ts[n].password);
ONV(ret == 0,
("proxy connect #%u succeeded, expected failure '%s'", n,
ts[n].expect));
if (ret != 0 && strstr(ne_sock_error(sock), ts[n].expect) == NULL) {
t_warning("proxy connect #%u got unexpected failure '%s', wanted '%s'",
n, ne_sock_error(sock), ts[n].expect);
}
ne_iaddr_free(arg.expect_addr);
CALL(finish(sock, 0));
}
return OK;
}
示例12: callHandlersOnVisibility
void callHandlersOnVisibility(bool v){ CALL(onVisibility(v)); }
示例13: callHandlersOnResize
void callHandlersOnResize(int w, int h){ CALL(onResize(w, h)); }
示例14: callHandlersOnDestroy
void callHandlersOnDestroy(){
CALL(onDestroy());
contextDestroy();
}
示例15: _glhckRenderDefaultProjection
/* \brief builds and sends the default projection to renderer */
void _glhckRenderDefaultProjection(int width, int height)
{
CALL(1, "%d, %d", width, height);
assert(width > 0 && height > 0);
glhckRenderProjection2D(width, height, -1000.0f, 1000.0f);
}