int main(int argc, const char *argv[]) { // Build a tree: // 4 // / \ // 2 5 // / \ // 1 3 // \ // 7 struct tnode* _2 = new_treenode(2); _2->left = new_treenode(1); struct tnode* _3 = new_treenode(3); _3->right = new_treenode(7); _2->right = _3; struct tnode* _4 = new_treenode(4); _4->left = _2; _4->right = new_treenode(5); struct list* path = leftmostPath(_4); info_list(path); return 0; }
void do_info(const char *const *argv) { const char *debar, *directory; if (*argv && argv[1]) { info_prepare(&argv,&debar,&directory,1); info_spew(debar,directory, argv); } else { info_prepare(&argv,&debar,&directory,2); info_list(debar,directory); } }
int do_info(const char *const *argv) { const char *debar, *dir; if (*argv && argv[1]) { info_prepare(&argv, &debar, &dir, 1); info_spew(debar, dir, argv); } else { info_prepare(&argv, &debar, &dir, 2); info_list(debar, dir); } return 0; }