switch (type) {
case NODE_ROOT:
- fprintf(stderr, "[error] %s: trying to create root node\n", __func__);
+ printfn_fatal(node, "trying to create root node");
break;
case NODE_EVENT:
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);
break;
}
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;
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;
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;
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;
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;
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;
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:
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;
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);
}
#define reparent_error(scanner, str) \
do { \
- yyerror(scanner, YY_("reparent_error: " str "\n")); \
+ yyerror(scanner, YY_("reparent_error: " str)); \
YYERROR; \
} while (0)
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 */
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;
ctf_ast_free(scanner->ast);
ret = yylex_destroy(scanner->scanner);
if (ret)
- fprintf(stderr, "yylex_destroy error\n");
+ printf_error("yylex_destroy error");
free(scanner);
}