Esempio n. 1
0
File: util.c Progetto: GYGit/reactos
char *vstrmake (size_t *lenp, va_list ap)
{
    const char *fmt;

    fmt = va_arg (ap, const char*);
    return vstrfmtmake (lenp, fmt, ap);
}
Esempio n. 2
0
File: util.c Progetto: GYGit/reactos
void xprintf (const char *fmt, ...)
{
    va_list ap;
    size_t size;
    ssize_t written;
    char *buffer, *head;

    va_start (ap, fmt);
    buffer = vstrfmtmake (&size, fmt, ap);
    head = buffer;
    va_end (ap);
    while ((written = write (1, head, size)) != size) {
        if (written == -1)
            report (R_FATAL, "Can't write logs: %d", errno);
        head += written;
        size -= written;
    }
    free (buffer);
}
Esempio n. 3
0
void xprintf (const char *fmt, ...)
{
    va_list ap;
    size_t size;
    DWORD written;
    char *buffer, *head;

    va_start (ap, fmt);
    buffer = vstrfmtmake (&size, fmt, ap);
    head = buffer;
    va_end (ap);
    while (size) {
        if (!WriteFile( logfile, head, size, &written, NULL ))
            report (R_FATAL, "Can't write logs: %u", GetLastError());
        head += written;
        size -= written;
    }
    heap_free (buffer);
}