comparison lib/lib.h @ 143:9cbb323f297f

Break out dirtree.c and let it call a function instead of returning the data.
author Rob Landley <rob@landley.net>
date Thu, 04 Oct 2007 02:04:10 -0500
parents 0901b3b2bbe9
children 1fbc50374a30
comparison
equal deleted inserted replaced
142:77be1035dbd8 143:9cbb323f297f
19 struct arg_list { 19 struct arg_list {
20 struct arg_list *next; 20 struct arg_list *next;
21 char *arg; 21 char *arg;
22 }; 22 };
23 23
24 // args.c
25 void get_optflags(void);
26
27 // dirtree.c
24 struct dirtree { 28 struct dirtree {
25 struct dirtree *next, *child, *parent; 29 struct dirtree *next, *child, *parent;
26 struct stat st; 30 struct stat st;
27 char name[]; 31 char name[];
28 }; 32 };
29 33
30 // args.c 34 struct dirtree *dirtree_add_node(char *path);
31 void get_optflags(void); 35 struct dirtree *dirtree_read(char *path, struct dirtree *parent,
36 int (*callback)(struct dirtree *node));
32 37
33 // functions.c 38 // lib.c
34 #if !defined(__UCLIBC__) && !defined(__KLIBC__) 39 #if !defined(__UCLIBC__) && !defined(__KLIBC__)
35 void strlcpy(char *dest, char *src, size_t size); 40 void strlcpy(char *dest, char *src, size_t size);
36 #endif 41 #endif
37 42
38 void verror_msg(char *msg, int err, va_list va); 43 void verror_msg(char *msg, int err, va_list va);
70 char *utoa(unsigned n); 75 char *utoa(unsigned n);
71 char *itoa(int n); 76 char *itoa(int n);
72 long atolx(char *c); 77 long atolx(char *c);
73 off_t fdlength(int fd); 78 off_t fdlength(int fd);
74 char *xreadlink(char *name); 79 char *xreadlink(char *name);
75 struct dirtree *read_dirtree_node(char *path);
76 struct dirtree *read_dirtree(char *path, struct dirtree *parent);
77 80
78 // getmountlist.c 81 // getmountlist.c
79 struct mtab_list { 82 struct mtab_list {
80 struct mtab_list *next; 83 struct mtab_list *next;
81 struct stat stat; 84 struct stat stat;