Deleted Added
full compact
mkoptions.c (61523) mkoptions.c (61640)
1/*
2 * Copyright (c) 1995 Peter Wemm
3 * Copyright (c) 1980, 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 23 unchanged lines hidden (view full) ---

32 * SUCH DAMAGE.
33 */
34
35#ifndef lint
36#if 0
37static char sccsid[] = "@(#)mkheaders.c 8.1 (Berkeley) 6/6/93";
38#endif
39static const char rcsid[] =
1/*
2 * Copyright (c) 1995 Peter Wemm
3 * Copyright (c) 1980, 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 23 unchanged lines hidden (view full) ---

32 * SUCH DAMAGE.
33 */
34
35#ifndef lint
36#if 0
37static char sccsid[] = "@(#)mkheaders.c 8.1 (Berkeley) 6/6/93";
38#endif
39static const char rcsid[] =
40 "$FreeBSD: head/usr.sbin/config/mkoptions.c 61523 2000-06-10 22:13:40Z peter $";
40 "$FreeBSD: head/usr.sbin/config/mkoptions.c 61640 2000-06-13 22:28:50Z peter $";
41#endif /* not lint */
42
43/*
44 * Make all the .h files for the optional entries
45 */
46
47#include <ctype.h>
48#include <err.h>

--- 8 unchanged lines hidden (view full) ---

57 int u_max;
58} users[] = {
59 { 8, 2, 512 }, /* MACHINE_I386 */
60 { 8, 2, 512 }, /* MACHINE_PC98 */
61 { 8, 2, 512 }, /* MACHINE_ALPHA */
62};
63#define NUSERS (sizeof (users) / sizeof (users[0]))
64
41#endif /* not lint */
42
43/*
44 * Make all the .h files for the optional entries
45 */
46
47#include <ctype.h>
48#include <err.h>

--- 8 unchanged lines hidden (view full) ---

57 int u_max;
58} users[] = {
59 { 8, 2, 512 }, /* MACHINE_I386 */
60 { 8, 2, 512 }, /* MACHINE_PC98 */
61 { 8, 2, 512 }, /* MACHINE_ALPHA */
62};
63#define NUSERS (sizeof (users) / sizeof (users[0]))
64
65static char *lower __P((char *));
66static void read_options __P((void));
67static void do_option __P((char *));
68static char *tooption __P((char *));
65static char *lower(char *);
66static void read_options(void);
67static void do_option(char *);
68static char *tooption(char *);
69
70void
69
70void
71options()
71options(void)
72{
73 char buf[40];
74 struct cputype *cp;
75 struct opt_list *ol;
76 struct opt *op;
77 struct users *up;
78
79 /* Fake the cpu types as options. */

--- 41 unchanged lines hidden (view full) ---

121 }
122}
123
124/*
125 * Generate an <options>.h file
126 */
127
128static void
72{
73 char buf[40];
74 struct cputype *cp;
75 struct opt_list *ol;
76 struct opt *op;
77 struct users *up;
78
79 /* Fake the cpu types as options. */

--- 41 unchanged lines hidden (view full) ---

121 }
122}
123
124/*
125 * Generate an <options>.h file
126 */
127
128static void
129do_option(name)
130 char *name;
129do_option(char *name)
131{
132 char *basefile, *file, *inw;
133 struct opt_list *ol;
134 struct opt *op, *op_head, *topp;
135 FILE *inf, *outf;
136 char *value;
137 char *oldvalue;
138 int seen;

--- 128 unchanged lines hidden (view full) ---

267 }
268 (void) fclose(outf);
269}
270
271/*
272 * Find the filename to store the option spec into.
273 */
274static char *
130{
131 char *basefile, *file, *inw;
132 struct opt_list *ol;
133 struct opt *op, *op_head, *topp;
134 FILE *inf, *outf;
135 char *value;
136 char *oldvalue;
137 int seen;

--- 128 unchanged lines hidden (view full) ---

266 }
267 (void) fclose(outf);
268}
269
270/*
271 * Find the filename to store the option spec into.
272 */
273static char *
275tooption(name)
276 char *name;
274tooption(char *name)
277{
278 static char hbuf[80];
279 char nbuf[80];
280 struct opt_list *po;
281
282 /* "cannot happen"? the otab list should be complete.. */
283 (void) strcpy(nbuf, "options.h");
284

--- 7 unchanged lines hidden (view full) ---

292 (void) strcpy(hbuf, path(nbuf));
293 return (hbuf);
294}
295
296/*
297 * read the options and options.<machine> files
298 */
299static void
275{
276 static char hbuf[80];
277 char nbuf[80];
278 struct opt_list *po;
279
280 /* "cannot happen"? the otab list should be complete.. */
281 (void) strcpy(nbuf, "options.h");
282

--- 7 unchanged lines hidden (view full) ---

290 (void) strcpy(hbuf, path(nbuf));
291 return (hbuf);
292}
293
294/*
295 * read the options and options.<machine> files
296 */
297static void
300read_options()
298read_options(void)
301{
302 FILE *fp;
303 char fname[80];
304 char *wd, *this, *val;
305 struct opt_list *po;
306 int first = 1;
307 char genopt[80];
308

--- 64 unchanged lines hidden (view full) ---

373 po->o_file = val;
374 po->o_next = otab;
375 otab = po;
376
377 goto next;
378}
379
380static char *
299{
300 FILE *fp;
301 char fname[80];
302 char *wd, *this, *val;
303 struct opt_list *po;
304 int first = 1;
305 char genopt[80];
306

--- 64 unchanged lines hidden (view full) ---

371 po->o_file = val;
372 po->o_next = otab;
373 otab = po;
374
375 goto next;
376}
377
378static char *
381lower(str)
382 register char *str;
379lower(char *str)
383{
380{
384 register char *cp = str;
381 char *cp = str;
385
386 while (*str) {
387 if (isupper(*str))
388 *str = tolower(*str);
389 str++;
390 }
391 return (cp);
392}
382
383 while (*str) {
384 if (isupper(*str))
385 *str = tolower(*str);
386 str++;
387 }
388 return (cp);
389}
393