diff lib/lib.h @ 694:786841fdb1e0

Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style. The actual code should be the same afterward, this is just cosmetic refactoring.
author Rob Landley <rob@landley.net>
date Tue, 13 Nov 2012 17:14:08 -0600
parents 2b957eaa00c7
children 078138791b5c
line wrap: on
line diff
--- a/lib/lib.h	Tue Nov 13 16:13:45 2012 -0600
+++ b/lib/lib.h	Tue Nov 13 17:14:08 2012 -0600
@@ -1,4 +1,3 @@
-/* vi: set ts=4 :*/
 /* lib.h - header file for lib directory
  *
  * Copyright 2006 Rob Landley <rob@landley.net>
@@ -21,18 +20,18 @@
 // is always next pointer, so next = (mytype *)&struct.
 
 struct string_list {
-	struct string_list *next;
-	char str[0];
+  struct string_list *next;
+  char str[0];
 };
 
 struct arg_list {
-	struct arg_list *next;
-	char *arg;
+  struct arg_list *next;
+  char *arg;
 };
 
 struct double_list {
-	struct double_list *next, *prev;
-	char *data;
+  struct double_list *next, *prev;
+  char *data;
 };
 
 void llist_traverse(void *list, void (*using)(void *data));
@@ -63,12 +62,12 @@
 #define DIRTREE_ABORTVAL ((struct dirtree *)1)
 
 struct dirtree {
-	struct dirtree *next, *parent, *child;
-	long extra; // place for user to store their stuff (can be pointer)
-	struct stat st;
-	char *symlink;
-	int data;  // dirfd for directory, linklen for symlink, -1 = comeagain
-	char name[];
+  struct dirtree *next, *parent, *child;
+  long extra; // place for user to store their stuff (can be pointer)
+  struct stat st;
+  char *symlink;
+  int data;  // dirfd for directory, linklen for symlink, -1 = comeagain
+  char name[];
 };
 
 struct dirtree *dirtree_add_node(int dirfd, char *name, int symfollow);
@@ -76,9 +75,9 @@
 int dirtree_notdotdot(struct dirtree *catch);
 int dirtree_parentfd(struct dirtree *node);
 struct dirtree *handle_callback(struct dirtree *new,
-	int (*callback)(struct dirtree *node));
+  int (*callback)(struct dirtree *node));
 void dirtree_recurse(struct dirtree *node,
-	int (*callback)(struct dirtree *node), int symfollow);
+  int (*callback)(struct dirtree *node), int symfollow);
 struct dirtree *dirtree_read(char *path, int (*callback)(struct dirtree *node));
 
 // lib.c
@@ -133,7 +132,7 @@
 off_t fdlength(int fd);
 char *xreadlink(char *name);
 void loopfiles_rw(char **argv, int flags, int permissions, int failok,
-	void (*function)(int fd, char *name));
+  void (*function)(int fd, char *name));
 void loopfiles(char **argv, void (*function)(int fd, char *name));
 char *get_rawline(int fd, long *plen, char end);
 char *get_line(int fd);
@@ -150,12 +149,12 @@
 
 // getmountlist.c
 struct mtab_list {
-	struct mtab_list *next;
-	struct stat stat;
-	struct statvfs statvfs;
-	char *dir;
-	char *device;
-	char type[0];
+  struct mtab_list *next;
+  struct stat stat;
+  struct statvfs statvfs;
+  char *dir;
+  char *device;
+  char type[0];
 };
 
 struct mtab_list *getmountlist(int die);