X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=formats%2Fctf-text%2Ftypes%2Fsequence.c;h=4e9048949fc3f54a3481b8ce2dc6b989c7a85246;hb=764af3f43c289a0a5cd8bf6fd85d9361ae17a253;hp=a0f8260c4777dc6962513cc304de476780ed676a;hpb=1ae19169d9cb823765444d22cdb05cd2ed3f162f;p=babeltrace.git diff --git a/formats/ctf-text/types/sequence.c b/formats/ctf-text/types/sequence.c index a0f8260c..4e904894 100644 --- a/formats/ctf-text/types/sequence.c +++ b/formats/ctf-text/types/sequence.c @@ -19,19 +19,26 @@ #include #include -void ctf_text_sequence_write(struct stream_pos *ppos, struct definition *definition) +int ctf_text_sequence_write(struct stream_pos *ppos, struct definition *definition) { struct ctf_text_stream_pos *pos = ctf_text_pos(ppos); + int ret; if (!pos->dummy) { - print_pos_tabs(pos); - fprintf(pos->fp, "[\n"); + if (definition->index != 0 && definition->index != INT_MAX) + fprintf(pos->fp, ","); + if (definition->index != INT_MAX) + fprintf(pos->fp, " "); + if (pos->print_names) + fprintf(pos->fp, "%s = ", + g_quark_to_string(definition->name)); + fprintf(pos->fp, "["); pos->depth++; } - sequence_rw(ppos, definition); + ret = sequence_rw(ppos, definition); if (!pos->dummy) { pos->depth--; - print_pos_tabs(pos); - fprintf(pos->fp, "]\n"); + fprintf(pos->fp, " ]"); } + return ret; }