• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ sendResponse函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: malloc_cmd

static TACommandVerdict malloc_cmd(TAThread thread,TAInputStream stream)
{
    size_t size;
    void* res;

    // Prepare
    size = readSize(&stream);

    START_TARGET_OPERATION(thread);

    // Execute
    errno = 0;    
    res = malloc(size);

    END_TARGET_OPERATION(thread);

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

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


示例17: strspn_cmd

static TACommandVerdict strspn_cmd(TAThread thread, TAInputStream stream)
{
    char* s1;
    char* s2;
    size_t res;

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

    START_TARGET_OPERATION(thread);

    // Execute
    res = strspn(s1, s2);

    END_TARGET_OPERATION(thread);

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

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


示例18: asctime_r_cmd

static TACommandVerdict asctime_r_cmd(TAThread thread,TAInputStream stream)
{
    struct tm   time;
    char      * buf ;
    char      * res ;

    // Prepare
    readTm( & stream, & time );
    buf = readString( & stream );

    // Execute
    START_TARGET_OPERATION(thread);
    res = asctime_r( & time, 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


示例19: strnlen_cmd

static TACommandVerdict strnlen_cmd(TAThread thread, TAInputStream stream)
{
    char* s;
    size_t n;
    size_t res;

    // Prepare
    s = (char*)readPointer(&stream);
    n = readSize(&stream);

    START_TARGET_OPERATION(thread);

    // Execute
    res = strnlen(s,n);

    END_TARGET_OPERATION(thread);

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

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


示例20: strrchr_cmd

static TACommandVerdict strrchr_cmd(TAThread thread, TAInputStream stream)
{
    char* s;
    int   c;
    char* res;

    // Prepare
    s = (char*)readPointer(&stream);
    c = readInt(&stream);

    START_TARGET_OPERATION(thread);

    // Execute
    res = strrchr(s, c);

    END_TARGET_OPERATION(thread);

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

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ sendResult函数代码示例发布时间:2022-05-30
下一篇:
C++ sendRequest函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap