Signed-off-by: Etienne Bergeron <etienneb@google.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
switch (type) {
case NODE_ROOT:
switch (type) {
case NODE_ROOT:
- fprintf(stderr, "[error] %s: trying to create root node\n", __func__);
+ printfn_fatal(node, "trying to create root node");
case NODE_UNKNOWN:
default:
case NODE_UNKNOWN:
default:
- fprintf(stderr, "[error] %s: unknown node type %d\n", __func__,
- (int) type);
+ printfn_fatal(node, "unknown node type '%d'", (int) type);
case NODE_UNKNOWN:
default:
case NODE_UNKNOWN:
default:
- fprintf(stderr, "[error] %s: unknown node type %d\n", __func__,
- (int) parent->type);
+ printfn_fatal(node, "unknown node type '%d'", (int) parent->type);
return -EINVAL;
}
return 0;
return -EINVAL;
}
return 0;
case NODE_UNKNOWN:
default:
case NODE_UNKNOWN:
default:
- fprintf(stderr, "[error] %s: unknown node type %d\n", __func__,
- (int) parent->type);
+ printfn_fatal(node, "unknown node type %d", parent->type);
return -EINVAL;
}
return 0;
return -EINVAL;
}
return 0;
case NODE_UNKNOWN:
default:
case NODE_UNKNOWN:
default:
- fprintf(stderr, "[error] %s: unknown node type %d\n", __func__,
- (int) parent->type);
+ printfn_fatal(node, "unknown node type '%d'", (int) parent->type);
return -EINVAL;
}
return 0;
return -EINVAL;
}
return 0;
case NODE_UNKNOWN:
default:
case NODE_UNKNOWN:
default:
- fprintf(stderr, "[error] %s: unknown node type %d\n", __func__,
- (int) parent->type);
+ printfn_fatal(node, "unknown node type '%d'", (int) parent->type);
return -EINVAL;
}
return 0;
return -EINVAL;
}
return 0;
case NODE_UNKNOWN:
default:
case NODE_UNKNOWN:
default:
- fprintf(stderr, "[error] %s: unknown node type %d\n", __func__,
- (int) parent->type);
+ printfn_fatal(node, "unknown node type '%d'", (int) parent->type);
return -EINVAL;
}
return 0;
return -EINVAL;
}
return 0;
case NODE_UNKNOWN:
default:
case NODE_UNKNOWN:
default:
- fprintf(stderr, "[error] %s: unknown node type %d\n", __func__,
- (int) parent->type);
+ printfn_fatal(node, "unknown node type '%d'", (int) parent->type);
return -EINVAL;
}
return 0;
return -EINVAL;
}
return 0;
switch (node->type) {
case NODE_ROOT:
switch (node->type) {
case NODE_ROOT:
- fprintf(stderr, "[error] %s: trying to reparent root node\n", __func__);
+ printfn_fatal(node, "trying to reparent root node");
return -EINVAL;
case NODE_EVENT:
return -EINVAL;
case NODE_EVENT:
case NODE_UNKNOWN:
default:
case NODE_UNKNOWN:
default:
- fprintf(stderr, "[error] %s: unknown node type %d\n", __func__,
- (int) parent->type);
+ printfn_fatal(node, "unknown node type '%d'", (int) parent->type);
return -EINVAL;
}
return 0;
return -EINVAL;
}
return 0;
BT_HIDDEN
void yyerror(struct ctf_scanner *scanner, const char *str)
{
BT_HIDDEN
void yyerror(struct ctf_scanner *scanner, const char *str)
{
- fprintf(stderr, "error at line %d, token \"%s\": %s\n",
- yyget_lineno(scanner->scanner),
+ printfl_error(yyget_lineno(scanner->scanner),
+ "token \"%s\": %s\n",
yyget_text(scanner->scanner), str);
}
yyget_text(scanner->scanner), str);
}
#define reparent_error(scanner, str) \
do { \
#define reparent_error(scanner, str) \
do { \
- yyerror(scanner, YY_("reparent_error: " str "\n")); \
+ yyerror(scanner, YY_("reparent_error: " str)); \
ret = yylex_init_extra(scanner, &scanner->scanner);
if (ret) {
ret = yylex_init_extra(scanner, &scanner->scanner);
if (ret) {
- fprintf(stderr, "yylex_init error\n");
+ printf_fatal("yylex_init error");
goto cleanup_scanner;
}
/* Start processing new stream */
goto cleanup_scanner;
}
/* Start processing new stream */
cleanup_lexer:
ret = yylex_destroy(scanner->scanner);
if (!ret)
cleanup_lexer:
ret = yylex_destroy(scanner->scanner);
if (!ret)
- fprintf(stderr, "yylex_destroy error\n");
+ printf_fatal("yylex_destroy error");
cleanup_scanner:
free(scanner);
return NULL;
cleanup_scanner:
free(scanner);
return NULL;
ctf_ast_free(scanner->ast);
ret = yylex_destroy(scanner->scanner);
if (ret)
ctf_ast_free(scanner->ast);
ret = yylex_destroy(scanner->scanner);
if (ret)
- fprintf(stderr, "yylex_destroy error\n");
+ printf_error("yylex_destroy error");