38 static QofLogModule log_module = GNC_MOD_BACKEND;
55 sqlEscapeString (sqlEscape* b,
const char* str)
57 const char* p, *src_head;
61 ENTER (
"str = %s", str);
65 LEAVE (
"(null) args");
72 LEAVE (
"%s: already escaped", str);
78 slen = strcspn (str,
"\\\'");
81 LEAVE (
"nothing to escape");
90 p += 1 + strcspn (p,
"\\\'");
94 if (len >= b->esc_buflen)
96 b->escape = static_cast < decltype (b->escape) > (g_realloc (b->escape,
98 b->esc_buflen = len + 100;
102 src_head = (
char*) str;
103 dst_tail = b->escape;
104 p = src_head + strcspn (src_head,
"\\\'");
107 size_t cp_len = p - src_head;
109 strncpy (dst_tail, src_head, cp_len);
117 p = src_head + strcspn (src_head,
"\\\'");
121 size_t cp_len = p - src_head;
123 strncpy (dst_tail, src_head, cp_len);
128 LEAVE (
"b->escape = %s", b->escape);
134 #define INITIAL_BUFSZ 2000 139 sqlEscape* b = g_new (sqlEscape, 1);
141 b->escape = static_cast < decltype (b->escape) > (g_malloc (INITIAL_BUFSZ));
142 b->esc_buflen = INITIAL_BUFSZ;
149 sqlEscape_destroy (sqlEscape* b)
154 LEAVE (
"b is (null)");
#define ENTER(format, args...)
Print a function entry debugging message.
All type declarations for the whole Gnucash engine.
#define LEAVE(format, args...)
Print a function exit debugging message.