return;
}
- fprintf(out, "completion: count=%u full=%u full=%u unknown=%u\n",
+ fprintf(out, "completion: count=%u full=%u partial=%u unknown=%u\n",
completed->count, completed->count_full,
completed->count_partial, completed->count_unknown);
static void __ec_node_dump(FILE *out,
const struct ec_node *node, size_t indent)
{
- const char *id, *typename, *desc;
+ const char *id, *typename;
struct ec_node *child;
size_t i, n;
id = ec_node_id(node);
typename = node->type->name;
- desc = ec_node_desc(node);
-
- /* XXX enhance */
- for (i = 0; i < indent; i++) {
- if (i % 2)
- fprintf(out, " ");
- else
- fprintf(out, "|");
- }
- fprintf(out, "node %p type=%s id=%s desc=%s\n",
- node, typename, id, desc);
+ fprintf(out, "%*s" "type=%s id=%s %p\n",
+ (int)indent * 4, "", typename, id, node);
n = node->n_children;
for (i = 0; i < n; i++) {
child = node->children[i];
- __ec_node_dump(out, child, indent + 2);
+ __ec_node_dump(out, child, indent + 1);
}
}
void ec_node_dump(FILE *out, const struct ec_node *node)
{
- fprintf(out, "------------------- node dump:\n"); //XXX
+ fprintf(out, "------------------- node dump:\n");
if (node == NULL) {
fprintf(out, "node is NULL\n");
{
struct ec_parsed *child;
const struct ec_strvec *vec;
- size_t i;
- const char *id = "none", *typename = "none";
+ const char *id, *typename = "none";
+ /* node can be null when parsing is incomplete */
if (parsed->node != NULL) {
- if (parsed->node->id != NULL)
- id = parsed->node->id;
+ id = parsed->node->id;
typename = parsed->node->type->name;
}
- /* XXX enhance */
- for (i = 0; i < indent; i++) {
- if (i % 2)
- fprintf(out, " ");
- else
- fprintf(out, "|");
- }
-
- fprintf(out, "node_type=%s id=%s vec=", typename, id);
+ fprintf(out, "%*s" "type=%s id=%s vec=",
+ (int)indent * 4, "", typename, id);
vec = ec_parsed_strvec(parsed);
ec_strvec_dump(out, vec);
void ec_parsed_dump(FILE *out, const struct ec_parsed *parsed)
{
- fprintf(out, "------------------- parsed dump:\n"); //XXX
+ fprintf(out, "------------------- parsed dump:\n");
if (parsed == NULL) {
fprintf(out, "parsed is NULL, error in parse\n");