Пример #1
0
int cl_print(sVMInfo* info, char* msg, ...)
{
    char* msg2;
    int n;

    va_list args;
    va_start(args, msg);
    n = vasprintf(ALLOC &msg2, msg, args);
    va_end(args);

    if(info->print_buffer) {     // this is hook of all clover output
        sBuf_append(info->print_buffer, msg2, n);
    }
    else {
        printf("%s", msg2);
        fflush(stdout);
        //write(1, msg2, strlen(msg2));
    }

    free(msg2);

    return n;
}
Пример #2
0
void sBuf_append_int(sBuf* self, int value)
{
    sBuf_append(self, &value, sizeof(int));
}
Пример #3
0
void sBuf_append_long(sBuf* self, long long value)
{
    sBuf_append(self, &value, sizeof(long long));
}
Пример #4
0
void sBuf_append_str(sBuf* self, char* str)
{
    sBuf_append(self, str, strlen(str));
}