diff lib/lib.h @ 20:3981c96f9285

Implement which. Add hello world to menuconfig. Wrap the various applet main functions in main.c with USE() macros so --gc-sections can strip them.
author Rob Landley <rob@landley.net>
date Fri, 03 Nov 2006 00:05:52 -0500
parents dd10785b6532
children eb46bb5626cb
line wrap: on
line diff
--- a/lib/lib.h	Thu Nov 02 19:50:02 2006 -0500
+++ b/lib/lib.h	Fri Nov 03 00:05:52 2006 -0500
@@ -4,6 +4,15 @@
  * Copyright 2006 Rob Landley <rob@landley.net>
  */
 
+// llist.c
+void llist_free(void *list, void (*freeit)(void *data));
+void *llist_pop(void *list);  // actually void **list, but the compiler's dumb
+
+struct string_list {
+	struct string_list *next;
+	char str[0];
+};
+
 // functions.c
 void verror_msg(char *msg, int err, va_list va);
 void error_msg(char *msg, ...);
@@ -25,22 +34,12 @@
 void xread(int fd, char *buf, size_t count);
 char *xgetcwd(void);
 char *xabspath(char *path);
-int is_file_type(char *path, int type);
-char *which_in_path(char *filename);
-char *find_in_path(char *path, char *filename, int type);
+struct string_list *find_in_path(char *path, char *filename);
 void utoa_to_buf(unsigned n, char *buf, unsigned buflen);
 void itoa_to_buf(int n, char *buf, unsigned buflen);
 char *utoa(unsigned n);
 char *itoa(int n);
 
-// llist.c
-void llist_free(void *list, void (*freeit)(void *data));
-
-struct string_list {
-	struct string_list *next;
-	char *str;
-};
-
 // getmountlist.c
 struct mtab_list {
 	struct mtab_list *next;