当前位置: 首页>>代码示例>>C++>>正文


C++ sendResponse函数代码示例

本文整理汇总了C++中sendResponse函数的典型用法代码示例。如果您正苦于以下问题:C++ sendResponse函数的具体用法?C++ sendResponse怎么用?C++ sendResponse使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了sendResponse函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getpriority_cmd

static TACommandVerdict getpriority_cmd(TAThread thread,TAInputStream stream)
{
   int which;
   int who  ;
   int res  ;

   // Prepare
   which = readInt( & stream );
   who   = readInt( & stream );
   errno = 0;

   // Execute
   START_TARGET_OPERATION(thread);
   res = getpriority( which, who );
   END_TARGET_OPERATION(thread);

   // Response
   writeInt( thread, res   );
   writeInt( thread, errno );
   sendResponse( thread );

   return taDefaultVerdict;
}
开发者ID:levenkov,项目名称:olver,代码行数:23,代码来源:nice_agent.c

示例2: gzdopen_cmd

static TACommandVerdict gzdopen_cmd(TAThread thread,TAInputStream stream)
{
    char *mode;
    void* res;
    int fd;

    fd = readInt(&stream);
    mode = readString(&stream);

    START_TARGET_OPERATION(thread);

    errno=0;
    res = gzdopen(fd, mode);

    END_TARGET_OPERATION(thread);

    writeInt(thread, errno);
    writePointer(thread, res);

    sendResponse(thread);

    return taDefaultVerdict;
}
开发者ID:levenkov,项目名称:olver,代码行数:23,代码来源:compress_agent.c

示例3: gzprintf_cmd

static TACommandVerdict gzprintf_cmd(TAThread thread,TAInputStream stream)
{
    void* file;
    char* s;
    int res, errnum;

    file = readPointer(&stream);
    s = readString(&stream);

    START_TARGET_OPERATION(thread);

    res = gzprintf(file, s);

    END_TARGET_OPERATION(thread);

    writeInt(thread, errnum);
    writeInt(thread, errno);
    writeInt(thread, res);

    sendResponse(thread);

    return taDefaultVerdict;
}
开发者ID:levenkov,项目名称:olver,代码行数:23,代码来源:compress_agent.c

示例4: wcscat_cmd

static TACommandVerdict wcscat_cmd(TAThread thread,TAInputStream stream)
{
    wchar_t* ws1;
    wchar_t* ws2;
    wchar_t* res;

    // Prepare
    ws1 = (wchar_t*)readPointer(&stream);
    ws2 = (wchar_t*)readPointer(&stream);

    START_TARGET_OPERATION(thread);

    // Execute
    res = wcscat(ws1, ws2);

    END_TARGET_OPERATION(thread);

    // Response
    writePointer(thread, res);
    sendResponse(thread);

    return taDefaultVerdict;
}
开发者ID:levenkov,项目名称:olver,代码行数:23,代码来源:wstr_agent.c

示例5: gztell_cmd

static TACommandVerdict gztell_cmd(TAThread thread,TAInputStream stream)
{
    void* file;
    z_off_t res;
    int errnum;

    file = readPointer(&stream);

    START_TARGET_OPERATION(thread);

    res = gztell(file);

    END_TARGET_OPERATION(thread);

    gzerror(file, &errnum);

    writeInt(thread, errnum);
    writeLLong(thread, (long long)res);

    sendResponse(thread);

    return taDefaultVerdict;
}
开发者ID:levenkov,项目名称:olver,代码行数:23,代码来源:compress_agent.c

示例6: wcpcpy_cmd

static TACommandVerdict wcpcpy_cmd(TAThread thread,TAInputStream stream)
{
    wchar_t* dest;
    wchar_t* src;
    wchar_t* res;

    // Prepare
    dest = (wchar_t*)readPointer(&stream);
    src = (wchar_t*)readPointer(&stream);

    START_TARGET_OPERATION(thread);

    // Execute
    res = wcpcpy(dest, src);

    END_TARGET_OPERATION(thread);

    // Response
    writePointer(thread, res);
    sendResponse(thread);

    return taDefaultVerdict;
}
开发者ID:levenkov,项目名称:olver,代码行数:23,代码来源:wstr_agent.c

示例7: wcsrchr_cmd

static TACommandVerdict wcsrchr_cmd(TAThread thread,TAInputStream stream)
{
    wchar_t* ws;
    int   wc;
    wchar_t* res;

    // Prepare
    ws = (wchar_t*)readPointer(&stream);
    wc = readWChar(&stream);

    START_TARGET_OPERATION(thread);

    // Execute
    res = wcsrchr(ws, wc);

    END_TARGET_OPERATION(thread);

    // Response
    writePointer(thread, res);
    sendResponse(thread);

    return taDefaultVerdict;
}
开发者ID:levenkov,项目名称:olver,代码行数:23,代码来源:wstr_agent.c

示例8: wmemcpy_cmd

static TACommandVerdict wmemcpy_cmd(TAThread thread,TAInputStream stream)
{
    wchar_t* ws1;
    wchar_t* ws2;
    size_t n;
    wchar_t* res;
    
    // Prepare
    ws1 = readPointer(&stream);
    ws2 = readPointer(&stream);
    n = readSize(&stream);
    
    // Execute
    START_TARGET_OPERATION(thread);
    res = wmemcpy( ws1, ws2, n);
    END_TARGET_OPERATION(thread);
    
    // Response
    writePointer(thread, res);
    sendResponse(thread);
    
    return taDefaultVerdict;
}
开发者ID:levenkov,项目名称:olver,代码行数:23,代码来源:wmem_agent.c

示例9: wmemchr_cmd

static TACommandVerdict wmemchr_cmd(TAThread thread,TAInputStream stream)
{
    wchar_t* s;
    wchar_t c;
    size_t n;
    wchar_t* res;
    
    // Prepare
    s = readPointer(&stream);
    c = readWChar(&stream);
    n = readSize(&stream);
    
    // Execute
    START_TARGET_OPERATION(thread);
    res = wmemchr( s, c, n );
    END_TARGET_OPERATION(thread);
    
    // Response
    writePointer(thread,res);
    sendResponse(thread);
    
    return taDefaultVerdict;
}
开发者ID:levenkov,项目名称:olver,代码行数:23,代码来源:wmem_agent.c

示例10: ctime_r_cmd

static TACommandVerdict ctime_r_cmd(TAThread thread,TAInputStream stream)
{
    time_t   clock;
    char   * buf  ;
    char   * res  ;

    // Prepare
    clock = readLong   ( & stream );
    buf   = readString( & stream );

    // Execute
    START_TARGET_OPERATION(thread);
    res = ctime_r( & clock, buf );
    END_TARGET_OPERATION(thread);

    // Response
    writeInt( thread, res == NULL );
    if ( res != NULL ) { writeString( thread, res ); }
    writeString( thread, buf );
    sendResponse( thread );

    return taDefaultVerdict;
}
开发者ID:levenkov,项目名称:olver,代码行数:23,代码来源:conversion_agent.c

示例11: nice_cmd

static TACommandVerdict nice_cmd(TAThread thread,TAInputStream stream)
{
   int incr;
   int res ;

   // ta_debug_printf( "[%3d]", nice( 0 ) );
   // Prepare
   incr = readInt( & stream );
   errno = 0;

   // Execute
   START_TARGET_OPERATION(thread);
   res = nice( incr );
   END_TARGET_OPERATION(thread);

   // ta_debug_printf( "[%3d|%3d|%3d|%3d|%3d|%3d]\n", res, incr, getuid(), geteuid(), getgid(), getegid() );
   // Response
   writeInt( thread, res   );
   writeInt( thread, errno );
   sendResponse( thread );

   return taDefaultVerdict;
}
开发者ID:levenkov,项目名称:olver,代码行数:23,代码来源:nice_agent.c

示例12: add

static void add(Dict* args, void* vcontext, String* txid, struct Allocator* alloc)
{
    struct Context* context = (struct Context*) vcontext;

    String* passwd = Dict_getString(args, String_CONST("password"));
    int64_t* authType = Dict_getInt(args, String_CONST("authType"));
    String* user = Dict_getString(args, String_CONST("user"));
    String* ipv6 = Dict_getString(args, String_CONST("ipv6"));
    int64_t one = 1;
    if (!authType) {
        authType = &one;
    } else if (*authType < 1 || *authType > 255) {
        sendResponse(String_CONST("Specified auth type is not supported."),
                     context->admin, txid, alloc);
        return;
    }
    int32_t ret = CryptoAuth_addUser_ipv6(passwd, *authType, user, ipv6, context->ca);

    switch (ret) {
        case 0:
            sendResponse(String_CONST("none"), context->admin, txid, alloc);
            break;
        case CryptoAuth_addUser_INVALID_AUTHTYPE:
            sendResponse(String_CONST("Specified auth type is not supported."),
                         context->admin, txid, alloc);
            break;
        case CryptoAuth_addUser_OUT_OF_SPACE:
            sendResponse(String_CONST("Out of memory to store password."),
                         context->admin, txid, alloc);
            break;
        case CryptoAuth_addUser_DUPLICATE:
            sendResponse(String_CONST("Password already added."), context->admin, txid, alloc);
            break;
        case CryptoAuth_addUser_INVALID_IP:
            sendResponse(String_CONST("Invalid IPv6 Address"), context->admin, txid, alloc);
            break;
        default:
            sendResponse(String_CONST("Unknown error."), context->admin, txid, alloc);
    }
}
开发者ID:0x20c24,项目名称:cjdns,代码行数:40,代码来源:AuthorizedPasswords.c

示例13: gmtime_cmd

static TACommandVerdict gmtime_cmd(TAThread thread,TAInputStream stream)
{
    time_t      timer;
    struct tm * res  ;

    // Prepare
    timer = readLong( & stream );
    errno = 0;

    // Execute
    START_TARGET_OPERATION(thread);
    res = gmtime( & timer );
    END_TARGET_OPERATION(thread);

    ta_debug_printf("gmtime_param: %d, res: %d", timer, res->tm_sec);

    // Response
    writeTm ( thread, res   );
    writeInt( thread, errno );
    sendResponse( thread );

    return taDefaultVerdict;
}
开发者ID:levenkov,项目名称:olver,代码行数:23,代码来源:conversion_agent.c

示例14: pthread_rwlock_init_cmd

static TACommandVerdict pthread_rwlock_init_cmd(TAThread thread, TAInputStream stream)
{
    pthread_rwlock_t* rwlock;
    pthread_rwlockattr_t* attr;
    int res;

    // Prepare
    rwlock = readPointer(&stream);
    attr = readPointer(&stream);

    START_TARGET_OPERATION(thread);

    // Execute
    res = pthread_rwlock_init(rwlock, attr);

    END_TARGET_OPERATION(thread);

    // Response
    writeInt(thread, res);
    sendResponse(thread);

    return taDefaultVerdict;
}
开发者ID:levenkov,项目名称:olver,代码行数:23,代码来源:rwlock_agent.c

示例15: strdup_cmd

static TACommandVerdict strdup_cmd(TAThread thread, TAInputStream stream)
{
    char* s1;
    char* res;

    // Prepare
    s1 = (char*)readPointer(&stream);

    START_TARGET_OPERATION(thread);

    // Execute
    errno = 0;
    res = strdup(s1);

    END_TARGET_OPERATION(thread);

    // Response
    writePointer(thread, res);
    writeInt(thread, errno);
    sendResponse(thread);

    return taDefaultVerdict;
}
开发者ID:levenkov,项目名称:olver,代码行数:23,代码来源:str_agent.c


注:本文中的sendResponse函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。