summaryrefslogtreecommitdiff
path: root/usr.sbin/config
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/config')
-rw-r--r--usr.sbin/config/config.h92
-rw-r--r--usr.sbin/config/main.c41
2 files changed, 87 insertions, 46 deletions
diff --git a/usr.sbin/config/config.h b/usr.sbin/config/config.h
index d471475015c..75b3ed92373 100644
--- a/usr.sbin/config/config.h
+++ b/usr.sbin/config/config.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.h,v 1.30 2017/06/22 15:57:16 deraadt Exp $ */
+/* $OpenBSD: config.h,v 1.31 2021/01/26 18:23:49 deraadt Exp $ */
/* $NetBSD: config.h,v 1.30 1997/02/02 21:12:30 thorpej Exp $ */
/*
@@ -265,50 +265,52 @@ struct objects {
*/
struct hashtab;
-const char *conffile; /* source file, e.g., "GENERIC.sparc" */
-const char *last_component;
-const char *machine; /* machine type, e.g., "sparc" or "sun3" */
-const char *machinearch; /* machine arch, e.g., "sparc" or "m68k" */
-const char *srcdir; /* path to source directory (rel. to build) */
-const char *builddir; /* path to build directory */
-const char *defbuilddir; /* default build directory */
-int errors; /* counts calls to error() */
-int minmaxusers; /* minimum "maxusers" parameter */
-int defmaxusers; /* default "maxusers" parameter */
-int maxmaxusers; /* default "maxusers" parameter */
-int maxusers; /* configuration's "maxusers" parameter */
-int maxpartitions; /* configuration's "maxpartitions" parameter */
-struct nvlist *options; /* options */
-struct nvlist *defoptions; /* "defopt"'d options */
-struct nvlist *mkoptions; /* makeoptions */
-struct hashtab *devbasetab; /* devbase lookup */
-struct hashtab *devatab; /* devbase attachment lookup */
-struct hashtab *selecttab; /* selects things that are "optional foo" */
-struct hashtab *needcnttab; /* retains names marked "needs-count" */
-struct hashtab *opttab; /* table of configured options */
-struct hashtab *defopttab; /* options that have been "defopt"'d */
-struct devbase *allbases; /* list of all devbase structures */
-struct deva *alldevas; /* list of all devbase attachment structures */
-struct config *allcf; /* list of configured kernels */
-struct devi *alldevi; /* list of all instances */
-struct devi *allpseudo; /* list of all pseudo-devices */
-int ndevi; /* number of devi's (before packing) */
-int npseudo; /* number of pseudo's */
-
-struct files *allfiles; /* list of all kernel source files */
-struct objects *allobjects; /* list of all kernel object and library files */
-
-struct devi **packed; /* arrayified table for packed devi's */
-int npacked; /* size of packed table, <= ndevi */
-
-struct { /* pv[] table for config */
+extern const char *conffile; /* source file, e.g., "GENERIC.sparc" */
+extern const char *last_component;
+extern const char *machine; /* machine type, e.g., "sparc" or "sun3" */
+extern const char *machinearch; /* machine arch, e.g., "sparc" or "m68k" */
+extern const char *srcdir; /* path to source directory (rel. to build) */
+extern const char *builddir; /* path to build directory */
+extern const char *defbuilddir; /* default build directory */
+extern int errors; /* counts calls to error() */
+extern int minmaxusers; /* minimum "maxusers" parameter */
+extern int defmaxusers; /* default "maxusers" parameter */
+extern int maxmaxusers; /* default "maxusers" parameter */
+extern int maxusers; /* configuration's "maxusers" parameter */
+extern int maxpartitions; /* configuration's "maxpartitions" parameter */
+extern struct nvlist *options; /* options */
+extern struct nvlist *defoptions; /* "defopt"'d options */
+extern struct nvlist *mkoptions; /* makeoptions */
+extern struct hashtab *devbasetab; /* devbase lookup */
+extern struct hashtab *devatab; /* devbase attachment lookup */
+extern struct hashtab *selecttab; /* selects things that are "optional foo" */
+extern struct hashtab *needcnttab; /* retains names marked "needs-count" */
+extern struct hashtab *opttab; /* table of configured options */
+extern struct hashtab *defopttab; /* options that have been "defopt"'d */
+extern struct devbase *allbases; /* list of all devbase structures */
+extern struct deva *alldevas; /* list of all devbase attachment structures */
+extern struct config *allcf; /* list of configured kernels */
+extern struct devi *alldevi; /* list of all instances */
+extern struct devi *allpseudo; /* list of all pseudo-devices */
+extern int ndevi; /* number of devi's (before packing) */
+extern int npseudo; /* number of pseudo's */
+
+extern struct files *allfiles; /* list of all kernel source files */
+extern struct objects *allobjects; /* list of all kernel object and library files */
+
+extern struct devi **packed; /* arrayified table for packed devi's */
+extern int npacked; /* size of packed table, <= ndevi */
+
+struct parents { /* pv[] table for config */
short *vec;
int used;
-} parents;
-struct { /* loc[] table for config */
+};
+extern struct parents parents;
+struct locators { /* loc[] table for config */
const char **vec;
int used;
-} locators;
+};
+extern struct locators locators;
/* files.c */
void initfiles(void);
@@ -336,10 +338,10 @@ void defoption(const char *name);
int devbase_has_instances(struct devbase *, int);
int deva_has_instances(struct deva *, int);
void setupdirs(void);
-int pflag;
-char *sflag;
-char *bflag;
-char *startdir;
+extern int pflag;
+extern char *sflag;
+extern char *bflag;
+extern char *startdir;
/* mkheaders.c */
int mkheaders(void);
diff --git a/usr.sbin/config/main.c b/usr.sbin/config/main.c
index 4d6e88654ad..d00bfded2b0 100644
--- a/usr.sbin/config/main.c
+++ b/usr.sbin/config/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.61 2019/07/19 20:40:44 schwarze Exp $ */
+/* $OpenBSD: main.c,v 1.62 2021/01/26 18:23:49 deraadt Exp $ */
/* $NetBSD: main.c,v 1.22 1997/02/02 21:12:33 thorpej Exp $ */
/*
@@ -75,6 +75,45 @@ static void optiondelta(void);
int verbose;
+const char *conffile; /* source file, e.g., "GENERIC.sparc" */
+const char *last_component;
+const char *machine; /* machine type, e.g., "sparc" or "sun3" */
+const char *machinearch; /* machine arch, e.g., "sparc" or "m68k" */
+const char *srcdir; /* path to source directory (rel. to build) */
+const char *builddir; /* path to build directory */
+const char *defbuilddir; /* default build directory */
+int errors; /* counts calls to error() */
+int minmaxusers; /* minimum "maxusers" parameter */
+int defmaxusers; /* default "maxusers" parameter */
+int maxmaxusers; /* default "maxusers" parameter */
+int maxusers; /* configuration's "maxusers" parameter */
+int maxpartitions; /* configuration's "maxpartitions" parameter */
+struct nvlist *options; /* options */
+struct nvlist *defoptions; /* "defopt"'d options */
+struct nvlist *mkoptions; /* makeoptions */
+struct hashtab *devbasetab; /* devbase lookup */
+struct hashtab *devatab; /* devbase attachment lookup */
+struct hashtab *selecttab; /* selects things that are "optional foo" */
+struct hashtab *needcnttab; /* retains names marked "needs-count" */
+struct hashtab *opttab; /* table of configured options */
+struct hashtab *defopttab; /* options that have been "defopt"'d */
+struct devbase *allbases; /* list of all devbase structures */
+struct deva *alldevas; /* list of all devbase attachment structures */
+struct config *allcf; /* list of configured kernels */
+struct devi *alldevi; /* list of all instances */
+struct devi *allpseudo; /* list of all pseudo-devices */
+int ndevi; /* number of devi's (before packing) */
+int npseudo; /* number of pseudo's */
+
+struct files *allfiles; /* list of all kernel source files */
+struct objects *allobjects; /* list of all kernel object and library files */
+
+struct devi **packed; /* arrayified table for packed devi's */
+int npacked; /* size of packed table, <= ndevi */
+
+struct parents parents;
+struct locators locators;
+
__dead void
usage(void)
{