void node_free (Node *node) { while (node->attrib) { node_unset (node, node->attrib->name); } free (node); }
void *cmd_att_clear (int argc, char **argv, void *data) { Node *pos = (Node *) data; if(argc!=2){ cli_outfunf("usage: %s <attribute>",argv[0]); return pos; } node_unset (pos, argv[1]); return pos; }
static int toggle_todo_cmd (int argc, char **argv, void *data) { Node *pos = (Node *) data; if (strcmp(fixnullstring(node_get(pos,"type")),"todo")) { /* bail out if not todo info set */ node_set(pos,"type","todo"); node_set(pos,"done","no"); } else { node_unset(pos,"type"); } return (int) pos; }