import VCD into the T
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
|
||||
enum format_item_type {
|
||||
INSTRING,
|
||||
INT, STRING, BUFFER };
|
||||
INT, ULONG, STRING, BUFFER };
|
||||
|
||||
struct format_item {
|
||||
enum format_item_type type;
|
||||
@@ -56,6 +56,7 @@ static void _event(void *p, event e)
|
||||
switch(l->f[i].type) {
|
||||
case INSTRING: PUTS(&l->o, l->f[i].s); break;
|
||||
case INT: PUTI(&l->o, e.e[l->f[i].event_arg].i); break;
|
||||
case ULONG: PUTUL(&l->o, e.e[l->f[i].event_arg].ul); break;
|
||||
case STRING: PUTS_CLEAN(&l->o, e.e[l->f[i].event_arg].s); break;
|
||||
case BUFFER:
|
||||
PUTS(&l->o, "{buffer size:");
|
||||
@@ -86,6 +87,7 @@ static int find_argument(char *name, database_event_format f,
|
||||
if (i == f.count) return 0;
|
||||
*event_arg = i;
|
||||
if (!strcmp(f.type[i], "int")) *it = INT;
|
||||
else if (!strcmp(f.type[i], "ulong")) *it = ULONG;
|
||||
else if (!strcmp(f.type[i], "string")) *it = STRING;
|
||||
else if (!strcmp(f.type[i], "buffer")) *it = BUFFER;
|
||||
else return 0;
|
||||
|
||||
@@ -29,6 +29,7 @@ static void _event(void *p, event e)
|
||||
subframe = e.e[l->subframe_arg].i;
|
||||
switch (e.e[l->data_arg].type) {
|
||||
case EVENT_INT: value = e.e[l->data_arg].i; break;
|
||||
case EVENT_ULONG: value = e.e[l->data_arg].ul; break;
|
||||
default: printf("%s:%d: unsupported type\n", __FILE__, __LINE__); abort();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user