changeset 345:10618c4c8cf2

Comment tweaks.
author Rob Landley <rob@landley.net>
date Sun, 25 Jan 2009 16:59:14 -0600
parents a0c3767f0a82
children d0bf1df83c04
files toys.h
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/toys.h	Sun Jan 25 16:34:46 2009 -0600
+++ b/toys.h	Sun Jan 25 16:59:14 2009 -0600
@@ -54,16 +54,21 @@
 void toy_init(struct toy_list *which, char *argv[]);
 void toy_exec(char *argv[]);
 
-// List of available applets
+// Flags describing applet behavior.
 
 #define TOYFLAG_USR      (1<<0)
 #define TOYFLAG_BIN      (1<<1)
 #define TOYFLAG_SBIN     (1<<2)
 #define TOYMASK_LOCATION ((1<<4)-1)
 
+// This is a shell built-in function, running in the same process context.
 #define TOYFLAG_NOFORK   (1<<4)
+
+// Start applet with a umask of 0 (saves old umask in this.old_umask)
 #define TOYFLAG_UMASK    (1<<5)
 
+// Array of available applets
+
 extern struct toy_list {
         char *name;
         void (*toy_main)(void);
@@ -71,7 +76,7 @@
         int flags;
 } toy_list[];
 
-// Global context for any applet.
+// Global context shared by all applets.
 
 extern struct toy_context {
 	struct toy_list *which;  // Which entry in toy_list is this one?
@@ -80,8 +85,8 @@
 	unsigned optflags;       // Command line option flags from get_optflags()
 	char **optargs;          // Arguments left over from get_optflags()
 	int optc;                // Count of optargs
-	int exithelp;            // Should error_exit print a usage message first?  (Option parsing.)
-	int old_umask;
+	int exithelp;            // Should error_exit print a usage message first?
+	int old_umask;           // Old umask preserved by TOYFLAG_UMASK
 } toys;
 
 // One big temporary buffer, for use by applets (not library functions).