]> git.mdlowis.com Git - proto/rc.git/commitdiff
general cleanup
authorMichael D. Lowis <mike.lowis@gentex.com>
Wed, 15 Mar 2017 13:06:25 +0000 (09:06 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Wed, 15 Mar 2017 13:06:25 +0000 (09:06 -0400)
builtins.c
config.h [deleted file]
rc.h
status.c

index 9c56e40b2ff497508ceff64fb43c80c3c09ed9fc..51cb36fe2defa4fd51f0ebf712ec5c3e7fb0fb1b 100644 (file)
@@ -383,7 +383,7 @@ static void printlimit(const struct Limit *limit, bool hard) {
                                lim /= suf->amount;
                                break;
                        }
-               fprint(1, RLIM_FMT, limit->name, (RLIM_CONV)lim, (suf == NULL || lim == 0) ? "" : suf->name);
+               fprint(1, "%s \t%ld%s\n", limit->name, (long)lim, (suf == NULL || lim == 0) ? "" : suf->name);
        }
 }
 
diff --git a/config.h b/config.h
deleted file mode 100644 (file)
index 746e374..0000000
--- a/config.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* The default interpreter */
-#define DEFAULTINTERP "/bin/sh"
-
-/* The default path */
-#define DEFAULTPATH "/usr/local/bin","/usr/bin","/bin","."
-
-/* Name of package */
-#define PACKAGE "rc"
-
-/* Define to 1 to encode exported environment names. */
-#define PROTECT_ENV 1
-
-/* Define to 1 to use job-control-style backgrounding. */
-#define RC_JOB 1
-
-/* Release date */
-#define RELDATE "2017-03-13"
-
-/* Version number of package */
-#define VERSION "1.7.4"
-
diff --git a/rc.h b/rc.h
index 29f51ae7e966a599a098bee12ae3eea6ad515bd5..ad9f6cb34cd5a4559786b98950c82acca220fa64 100644 (file)
--- a/rc.h
+++ b/rc.h
@@ -1,7 +1,14 @@
 #undef NDEBUG
 #define _XOPEN_SOURCE 700
 
-#include "config.h"
+/* Configuration options */
+#define DEFAULTINTERP "/bin/sh"
+#define DEFAULTPATH   "/usr/local/bin","/usr/bin","/bin","."
+#define PACKAGE       "rc"
+#define PROTECT_ENV   1
+#define RC_JOB        1
+#define RELDATE       "2017-03-13"
+#define VERSION       "1.7.4"
 
 /* C standard includes */
 #include <stdlib.h>
@@ -34,17 +41,6 @@ typedef long align_t;
 #define TRUE  true
 #define FALSE false
 
-/*
-    wait.h
-*/
-
-/* These don't exist in POSIX. */
-#define myWIFDUMPED(s) (((s) & 0x80) != 0)
-
-/*
-    jbwrap.h
-*/
-
 /* If we have POSIX sigjmp_buf and friends, use them.  If we don't, just
 use a jmp_buf.  This probably fails on a traditional SysV machine, where
 jmp_bufs don't preserve signal masks.  I'm not worrying about this till
@@ -59,18 +55,6 @@ struct Jbwrap {
        sigjmp_buf j;
 };
 
-/*
-    rlimit.h
-*/
-/* What a mess.  This file attempts to straighten everything out. */
-
-#define RLIM_CONV long
-#define RLIM_FMT "%s \t%ld%s\n"
-
-#if defined(RLIMIT_OFILE) && !defined (RLIMIT_NOFILE)
-#define RLIMIT_NOFILE RLIMIT_OFILE
-#endif
-
 struct Suffix {
        const struct Suffix *next;
        long amount;
@@ -279,12 +263,6 @@ extern Node *parse_fn(char *);
 extern void initprint(void);
 extern void rc_exit(int); /* here for odd reasons; user-defined signal handlers are kept in fn.c */
 
-/* getopt.c */
-extern int rc_getopt(int, char **, char *);
-
-extern int rc_optind, rc_opterr, rc_optopt;
-extern char *rc_optarg;
-
 /* glob.c */
 extern bool lmatch(List *, List *);
 extern List *glob(List *);
@@ -379,6 +357,7 @@ extern void fmtcat(Format *, const char *);
 extern int fprint(int fd, const char *fmt,...);
 extern char *mprint(const char *fmt,...);
 extern char *nprint(const char *fmt,...);
+extern void writeall(int, char *, size_t);
 /*
    the following macro should by rights be coded as an expression, not
    a statement, but certain compilers (notably DEC) have trouble with
@@ -421,9 +400,6 @@ extern void statprint(pid_t, int);
 extern void ssetstatus(char **);
 extern char *strstatus(int s);
 
-/* system.c or system-bsd.c */
-extern void writeall(int, char *, size_t);
-
 /* tree.c */
 extern Node *mk(int /*nodetype*/,...);
 extern Node *treecpy(Node *, void *(*)(size_t));
index aa8790c22f997d8d311b7d4f240f5abf374c2cdb..bdb9af0e38e8ea6e28ce4d12daeb04f1e371183c 100644 (file)
--- a/status.c
+++ b/status.c
@@ -3,6 +3,9 @@
 #include "rc.h"
 #include "statval.h"
 
+/* not defined by posix but useful nonetheless */
+#define myWIFDUMPED(s) (((s) & 0x80) != 0)
+
 /* status == the wait() value of the last command in the pipeline, or the last command */
 
 static int statuses[512];