/* compiles with: gcc -o msgtst -I../include msgtst.c trp_msg.c $(pkg-config --cflags --libs glib-2.0) ../common/tr_debug.c -ltalloc -ljansson */
#include <stdio.h>
+#include <talloc.h>
+
#include <trp_internal.h>
#include <tr_debug.h>
int main(int argc, const char *argv[])
{
+ TALLOC_CTX *main_ctx=talloc_new(NULL);
FILE *f;
char *buf;
size_t buflen;
if (buflen>=MAX_MSG_LEN)
printf("Warning: file may exceed maximum message length (%d bytes).\n", MAX_MSG_LEN);
- rc=trp_parse_msg(NULL, buf, buflen, &msg);
+ rc=trp_parse_msg(main_ctx, buf, buflen, &msg);
printf("trp_parse_msg returned %d\n\n", rc);
+ talloc_report_full(main_ctx, stderr);
return 0;
}