diff lib/lib.h @ 1321:4d898affda0c draft

Switch mtab_list to doubly linked so we can traverse in either order. Convert umount and df. Add dlist_terminate() to break lists for traversal in either direction.
author Rob Landley <rob@landley.net>
date Thu, 29 May 2014 05:22:02 -0500
parents b2cc738d3cfc
children 85f297591693
line wrap: on
line diff
--- a/lib/lib.h	Tue May 27 07:56:51 2014 -0500
+++ b/lib/lib.h	Thu May 29 05:22:02 2014 -0500
@@ -31,6 +31,7 @@
 void *dlist_pop(void *list);  // actually struct double_list **list
 void dlist_add_nomalloc(struct double_list **list, struct double_list *new);
 struct double_list *dlist_add(struct double_list **list, char *data);
+void *dlist_terminate(void *list);
 
 // args.c
 void get_optflags(void);
@@ -162,7 +163,7 @@
 
 // getmountlist.c
 struct mtab_list {
-  struct mtab_list *next;
+  struct mtab_list *next, *prev;
   struct stat stat;
   struct statvfs statvfs;
   char *dir;