tag != input_event.data.document_start.tag_directives.end;
tag ++)
{
- /* Write '{'. */
-
- if (!yaml_mapping_start_event_initialize(&output_event,
- NULL, "tag:yaml.org,2002:map", 1,
- YAML_FLOW_MAPPING_STYLE))
- goto event_error;
- if (!yaml_emitter_emit(&emitter, &output_event))
- goto emitter_error;
-
- /* Write 'handle'. */
-
- if (!yaml_scalar_event_initialize(&output_event,
- NULL, "tag:yaml.org,2002:str", "handle", -1,
- 1, 1, YAML_PLAIN_SCALAR_STYLE))
- goto event_error;
- if (!yaml_emitter_emit(&emitter, &output_event))
- goto emitter_error;
-
- /* Write the tag directive handle. */
-
- if (!yaml_scalar_event_initialize(&output_event,
- NULL, "tag:yaml.org,2002:str",
- tag->handle, -1,
- 0, 1, YAML_DOUBLE_QUOTED_SCALAR_STYLE))
- goto event_error;
- if (!yaml_emitter_emit(&emitter, &output_event))
- goto emitter_error;
-
- /* Write 'prefix'. */
-
- if (!yaml_scalar_event_initialize(&output_event,
- NULL, "tag:yaml.org,2002:str", "prefix", -1,
- 1, 1, YAML_PLAIN_SCALAR_STYLE))
- goto event_error;
- if (!yaml_emitter_emit(&emitter, &output_event))
- goto emitter_error;
-
- /* Write the tag directive prefix. */
-
- if (!yaml_scalar_event_initialize(&output_event,
- NULL, "tag:yaml.org,2002:str",
- tag->prefix, -1,
- 0, 1, YAML_DOUBLE_QUOTED_SCALAR_STYLE))
- goto event_error;
- if (!yaml_emitter_emit(&emitter, &output_event))
- goto emitter_error;
-
- /* Write '}'. */
-
- if (!yaml_mapping_end_event_initialize(&output_event))
- goto event_error;
- if (!yaml_emitter_emit(&emitter, &output_event))
- goto emitter_error;
- }
-
- /* End a block sequence. */
-
- if (!yaml_sequence_end_event_initialize(&output_event))
+ /* Write '{'. */
+
+ if (!yaml_mapping_start_event_initialize(&output_event,
+ NULL, "tag:yaml.org,2002:map", 1,
+ YAML_FLOW_MAPPING_STYLE))
+ goto event_error;
+ if (!yaml_emitter_emit(&emitter, &output_event))
+ goto emitter_error;
+
+ /* Write 'handle'. */
+
+ if (!yaml_scalar_event_initialize(&output_event,
+ NULL, "tag:yaml.org,2002:str", "handle", -1,
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
+ goto event_error;
+ if (!yaml_emitter_emit(&emitter, &output_event))
+ goto emitter_error;
+
+ /* Write the tag directive handle. */
+
+ if (!yaml_scalar_event_initialize(&output_event,
+ NULL, "tag:yaml.org,2002:str",
+ tag->handle, -1,
+ 0, 1, YAML_DOUBLE_QUOTED_SCALAR_STYLE))
+ goto event_error;
+ if (!yaml_emitter_emit(&emitter, &output_event))
+ goto emitter_error;
+
+ /* Write 'prefix'. */
+
+ if (!yaml_scalar_event_initialize(&output_event,
+ NULL, "tag:yaml.org,2002:str", "prefix", -1,
+ 1, 1, YAML_PLAIN_SCALAR_STYLE))
goto event_error;
if (!yaml_emitter_emit(&emitter, &output_event))
goto emitter_error;
+
+ /* Write the tag directive prefix. */
+
+ if (!yaml_scalar_event_initialize(&output_event,
+ NULL, "tag:yaml.org,2002:str",
+ tag->prefix, -1,
+ 0, 1, YAML_DOUBLE_QUOTED_SCALAR_STYLE))
+ goto event_error;
+ if (!yaml_emitter_emit(&emitter, &output_event))
+ goto emitter_error;
+
+ /* Write '}'. */
+
+ if (!yaml_mapping_end_event_initialize(&output_event))
+ goto event_error;
+ if (!yaml_emitter_emit(&emitter, &output_event))
+ goto emitter_error;
+ }
+
+ /* End a block sequence. */
+
+ if (!yaml_sequence_end_event_initialize(&output_event))
+ goto event_error;
+ if (!yaml_emitter_emit(&emitter, &output_event))
+ goto emitter_error;
}
/* Write 'implicit'. */
case YAML_READER_ERROR:
if (parser.problem_value != -1) {
- fprintf(stderr, "Reader error: %s: #%X at %d\n", parser.problem,
+ fprintf(stderr, "Reader error: %s: #%X at %zu\n", parser.problem,
parser.problem_value, parser.problem_offset);
}
else {
- fprintf(stderr, "Reader error: %s at %d\n", parser.problem,
+ fprintf(stderr, "Reader error: %s at %zu\n", parser.problem,
parser.problem_offset);
}
break;
case YAML_SCANNER_ERROR:
if (parser.context) {
- fprintf(stderr, "Scanner error: %s at line %d, column %d\n"
- "%s at line %d, column %d\n", parser.context,
- parser.context_mark.line, parser.context_mark.column,
- parser.problem, parser.problem_mark.line,
- parser.problem_mark.column);
+ fprintf(stderr, "Scanner error: %s at line %lu, column %lu\n"
+ "%s at line %lu, column %lu\n", parser.context,
+ parser.context_mark.line+1, parser.context_mark.column+1,
+ parser.problem, parser.problem_mark.line+1,
+ parser.problem_mark.column+1);
}
else {
- fprintf(stderr, "Scanner error: %s at line %d, column %d\n",
- parser.problem, parser.problem_mark.line,
- parser.problem_mark.column);
+ fprintf(stderr, "Scanner error: %s at line %lu, column %lu\n",
+ parser.problem, parser.problem_mark.line+1,
+ parser.problem_mark.column+1);
}
break;
case YAML_PARSER_ERROR:
if (parser.context) {
- fprintf(stderr, "Parser error: %s at line %d, column %d\n"
- "%s at line %d, column %d\n", parser.context,
- parser.context_mark.line, parser.context_mark.column,
- parser.problem, parser.problem_mark.line,
- parser.problem_mark.column);
+ fprintf(stderr, "Parser error: %s at line %lu, column %lu\n"
+ "%s at line %lu, column %lu\n", parser.context,
+ parser.context_mark.line+1, parser.context_mark.column+1,
+ parser.problem, parser.problem_mark.line+1,
+ parser.problem_mark.column+1);
}
else {
- fprintf(stderr, "Parser error: %s at line %d, column %d\n",
- parser.problem, parser.problem_mark.line,
- parser.problem_mark.column);
+ fprintf(stderr, "Parser error: %s at line %lu, column %lu\n",
+ parser.problem, parser.problem_mark.line+1,
+ parser.problem_mark.column+1);
}
break;
}
yaml_event_delete(&input_event);
- yaml_event_delete(&output_event);
yaml_parser_delete(&parser);
yaml_emitter_delete(&emitter);
}
yaml_event_delete(&input_event);
- yaml_event_delete(&output_event);
yaml_parser_delete(&parser);
yaml_emitter_delete(&emitter);
fprintf(stderr, "Memory error: Not enough memory for creating an event\n");
yaml_event_delete(&input_event);
- yaml_event_delete(&output_event);
yaml_parser_delete(&parser);
yaml_emitter_delete(&emitter);