File: debug.c

package info (click to toggle)
waba 1.5-3
  • links: PTS
  • area: contrib
  • in suites: woody
  • size: 1,996 kB
  • ctags: 3,231
  • sloc: ansic: 17,303; java: 4,436; sh: 2,345; makefile: 417
file content (23 lines) | stat: -rw-r--r-- 350 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "../waba.h"

#ifdef DEBUG

char* UTF2CSTR(UtfString *utf) {
    typedef char buf[255];
    static buf utf_buf[16];
    static int ix = 0;
    char *b;

    ix++; ix&=15;
    b = &utf_buf[ix][0];
    xstrncpy(b, utf->str, utf->len);
    b[utf->len]=0;
    return b;
}

#else /* !DEBUG */

/*
 * static void _dummy_(char* d, ...) {}
*/
#endif