char basename[PATH_MAX];
unsigned int basename_len = 0;
+ if(td->custom_write) return 0; /* Does print custom type */
+
strncpy(basename, nest_name, PATH_MAX);
basename_len = strlen(basename);
char basename[PATH_MAX];
unsigned int basename_len = 0;
char get_ptr_char[2] = "";
+ char custom[PATH_MAX] = "";
strncpy(basename, nest_name, PATH_MAX);
basename_len = strlen(basename);
strcpy(get_ptr_char, "&");
}
+ if(td->custom_write) {
+ strcpy(custom, "_custom");
+ }
+
switch(td->type) {
case INT_FIXED:
case UINT_FIXED:
case STRING:
print_tabs(tabs, fd);
fprintf(fd,
- "lttng_write_string_%s(buffer, to_base, to, from, len, %s%s);\n",
- basename, obj_prefix, field_name);
+ "lttng_write%s_string_%s(buffer, to_base, to, from, len, %s%s);\n",
+ custom, basename, obj_prefix, field_name);
break;
case SEQUENCE:
print_tabs(tabs, fd);
fprintf(fd,
- "lttng_write_sequence_%s(buffer, to_base, to, from, len, %s%s%s);",
- basename, get_ptr_char, obj_prefix, field_name);
+ "lttng_write%s_sequence_%s(buffer, to_base, to, from, len, %s%s%s);",
+ custom, basename, get_ptr_char, obj_prefix, field_name);
break;
case STRUCT:
print_tabs(tabs, fd);
fprintf(fd,
- "lttng_write_struct_%s(buffer, to_base, to, from, len, %s%s%s);",
- basename, get_ptr_char, obj_prefix, field_name);
+ "lttng_write%s_struct_%s(buffer, to_base, to, from, len, %s%s%s);",
+ custom, basename, get_ptr_char, obj_prefix, field_name);
break;
case UNION:
print_tabs(tabs, fd);
fprintf(fd,
- "lttng_write_union_%s(buffer, to_base, to, from, len, %s%s%s);",
- basename, get_ptr_char, obj_prefix, field_name);
+ "lttng_write%s_union_%s(buffer, to_base, to, from, len, %s%s%s);",
+ custom, basename, get_ptr_char, obj_prefix, field_name);
break;
case ARRAY:
print_tabs(tabs, fd);
fprintf(fd,
- "lttng_write_array_%s(buffer, to_base, to, from, len, %s%s);",
- basename, obj_prefix, field_name);
+ "lttng_write%s_array_%s(buffer, to_base, to, from, len, %s%s);",
+ custom, basename, obj_prefix, field_name);
break;
case NONE:
printf("Error : type NONE unexpected\n");
char basename[PATH_MAX];
unsigned int basename_len = 0;
+ if(td->custom_write) return 0; /* Does print custom type */
+
strncpy(basename, nest_name, PATH_MAX);
basename_len = strlen(basename);
char basename[PATH_MAX];
unsigned int basename_len = 0;
+ if(td->custom_write) return 0; /* Does print custom type */
+
strncpy(basename, nest_name, PATH_MAX);
basename_len = strlen(basename);
t->fmt = NULL;
t->size = 0;
+ t->custom_write = 0;
while(1) {
token = getToken(in);
} else if(!strcmp("size",token)) {
getEqual(in);
t->size = getSize(in);
+ } else if(!strcmp("custom_write", token)) {
+ t->custom_write = 1;
}
}
}
while(1) {
token = getToken(in);
- if(strcmp("/",token) == 0 || strcmp(">",token) == 0){
- ungetToken(in);
- break;
- }
-
if(!strcmp("name",token)) {
getEqual(in);
car = seekNextChar(in);
if(car == EOF) in->error(in,"name was expected");
else if(car == '\"') name = allocAndCopy(getQuotedString(in));
else name = allocAndCopy(getName(in));
+ } else {
+ ungetToken(in);
+ break;
}
+
}
if(name == NULL) in->error(in, "Name was expected");
return name;
-
}
else if(strcmp(token,"sequence") == 0) {
t->type = SEQUENCE;
sequence_init(&(t->fields));
- //getTypeAttributes(in, t, unnamed_types, named_types);
- //getForwardslash(in);
+ getTypeAttributes(in, t, unnamed_types, named_types);
+ getForwardslash(in);
getRAnglebracket(in); //<sequence>
//getLAnglebracket(in); //<sequence size type>