Deleted Added
full compact
mkmakefile.c (61523) mkmakefile.c (61640)
1/*
2 * Copyright (c) 1993, 19801990
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

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

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

31 * SUCH DAMAGE.
32 */
33
34#ifndef lint
35#if 0
36static char sccsid[] = "@(#)mkmakefile.c 8.1 (Berkeley) 6/6/93";
37#endif
38static const char rcsid[] =
39 "$FreeBSD: head/usr.sbin/config/mkmakefile.c 61523 2000-06-10 22:13:40Z peter $";
39 "$FreeBSD: head/usr.sbin/config/mkmakefile.c 61640 2000-06-13 22:28:50Z peter $";
40#endif /* not lint */
41
42/*
43 * Build the makefile for the system, from
44 * the information in the files files and the
45 * additional files for the machine being compiled to.
46 */
47
48#include <ctype.h>
49#include <err.h>
50#include <stdio.h>
51#include <string.h>
52#include "y.tab.h"
53#include "config.h"
54#include "configvers.h"
55
56#define next_word(fp, wd) \
40#endif /* not lint */
41
42/*
43 * Build the makefile for the system, from
44 * the information in the files files and the
45 * additional files for the machine being compiled to.
46 */
47
48#include <ctype.h>
49#include <err.h>
50#include <stdio.h>
51#include <string.h>
52#include "y.tab.h"
53#include "config.h"
54#include "configvers.h"
55
56#define next_word(fp, wd) \
57 { register char *word = get_word(fp); \
57 { char *word = get_word(fp); \
58 if (word == (char *)EOF) \
59 return; \
60 else \
61 wd = word; \
62 }
63#define next_quoted_word(fp, wd) \
58 if (word == (char *)EOF) \
59 return; \
60 else \
61 wd = word; \
62 }
63#define next_quoted_word(fp, wd) \
64 { register char *word = get_quoted_word(fp); \
64 { char *word = get_quoted_word(fp); \
65 if (word == (char *)EOF) \
66 return; \
67 else \
68 wd = word; \
69 }
70
71static struct file_list *fcur;
72
65 if (word == (char *)EOF) \
66 return; \
67 else \
68 wd = word; \
69 }
70
71static struct file_list *fcur;
72
73static char *tail __P((char *));
74static void do_clean __P((FILE *));
75static void do_rules __P((FILE *));
76static void do_sfiles __P((FILE *));
77static void do_mfiles __P((FILE *));
78static void do_cfiles __P((FILE *));
79static void do_objs __P((FILE *));
80static void do_before_depend __P((FILE *));
81static int opteq __P((char *, char *));
82static void read_files __P((void));
73static char *tail(char *);
74static void do_clean(FILE *);
75static void do_rules(FILE *);
76static void do_sfiles(FILE *);
77static void do_mfiles(FILE *);
78static void do_cfiles(FILE *);
79static void do_objs(FILE *);
80static void do_before_depend(FILE *);
81static int opteq(char *, char *);
82static void read_files(void);
83
84/*
85 * Lookup a file, by name.
86 */
87static struct file_list *
83
84/*
85 * Lookup a file, by name.
86 */
87static struct file_list *
88fl_lookup(file)
89 register char *file;
88fl_lookup(char *file)
90{
89{
91 register struct file_list *fp;
90 struct file_list *fp;
92
93 for (fp = ftab ; fp != 0; fp = fp->f_next) {
94 if (eq(fp->f_fn, file))
95 return (fp);
96 }
97 return (0);
98}
99
100/*
101 * Lookup a file, by final component name.
102 */
103static struct file_list *
91
92 for (fp = ftab ; fp != 0; fp = fp->f_next) {
93 if (eq(fp->f_fn, file))
94 return (fp);
95 }
96 return (0);
97}
98
99/*
100 * Lookup a file, by final component name.
101 */
102static struct file_list *
104fltail_lookup(file)
105 register char *file;
103fltail_lookup(char *file)
106{
104{
107 register struct file_list *fp;
105 struct file_list *fp;
108
109 for (fp = ftab ; fp != 0; fp = fp->f_next) {
110 if (eq(tail(fp->f_fn), tail(file)))
111 return (fp);
112 }
113 return (0);
114}
115
116/*
117 * Make a new file list entry
118 */
119static struct file_list *
106
107 for (fp = ftab ; fp != 0; fp = fp->f_next) {
108 if (eq(tail(fp->f_fn), tail(file)))
109 return (fp);
110 }
111 return (0);
112}
113
114/*
115 * Make a new file list entry
116 */
117static struct file_list *
120new_fent()
118new_fent(void)
121{
119{
122 register struct file_list *fp;
120 struct file_list *fp;
123
124 fp = (struct file_list *) malloc(sizeof *fp);
125 bzero(fp, sizeof *fp);
126 if (fcur == 0)
127 fcur = ftab = fp;
128 else
129 fcur->f_next = fp;
130 fcur = fp;
131 return (fp);
132}
133
134/*
135 * Build the makefile from the skeleton
136 */
137void
121
122 fp = (struct file_list *) malloc(sizeof *fp);
123 bzero(fp, sizeof *fp);
124 if (fcur == 0)
125 fcur = ftab = fp;
126 else
127 fcur->f_next = fp;
128 fcur = fp;
129 return (fp);
130}
131
132/*
133 * Build the makefile from the skeleton
134 */
135void
138makefile()
136makefile(void)
139{
140 FILE *ifp, *ofp;
141 char line[BUFSIZ];
142 struct opt *op;
143 int versreq;
137{
138 FILE *ifp, *ofp;
139 char line[BUFSIZ];
140 struct opt *op;
141 int versreq;
142 char *s;
144
145 read_files();
146 snprintf(line, sizeof(line), "../../conf/Makefile.%s", machinename);
147 ifp = fopen(line, "r");
148 if (ifp == 0) {
149 snprintf(line, sizeof(line), "Makefile.%s", machinename);
150 ifp = fopen(line, "r");
151 }

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

211 fprintf(stderr,
212 "Unknown %% construct in generic makefile: %s",
213 line);
214 }
215 (void) fclose(ifp);
216 (void) fclose(ofp);
217 moveifchanged(path("Makefile.new"), path("Makefile"));
218
143
144 read_files();
145 snprintf(line, sizeof(line), "../../conf/Makefile.%s", machinename);
146 ifp = fopen(line, "r");
147 if (ifp == 0) {
148 snprintf(line, sizeof(line), "Makefile.%s", machinename);
149 ifp = fopen(line, "r");
150 }

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

210 fprintf(stderr,
211 "Unknown %% construct in generic makefile: %s",
212 line);
213 }
214 (void) fclose(ifp);
215 (void) fclose(ofp);
216 moveifchanged(path("Makefile.new"), path("Makefile"));
217
218 if (hints) {
219 ifp = fopen(hints, "r");
220 if (ifp == NULL)
221 err(1, "%s", hints);
222 } else {
223 ifp = NULL;
224 }
225 ofp = fopen(path("hints.c.new"), "w");
226 if (ofp == NULL)
227 err(1, "%s", path("hints.c.new"));
228 fprintf(ofp, "char static_hints[] = {\n");
229 if (ifp) {
230 while (fgets(line, BUFSIZ, ifp) != 0) {
231 /* zap trailing CR and/or LF */
232 while ((s = rindex(line, '\n')) != NULL)
233 *s = '\0';
234 while ((s = rindex(line, '\r')) != NULL)
235 *s = '\0';
236 /* remove # comments */
237 s = index(line, '#');
238 if (s)
239 *s = '\0';
240 /* remove any whitespace and " characters */
241 s = line;
242 while (*s) {
243 if (*s == ' ' || *s == '\t' || *s == '"') {
244 while (*s) {
245 s[0] = s[1];
246 s++;
247 }
248 /* start over */
249 s = line;
250 continue;
251 }
252 s++;
253 }
254 /* anything left? */
255 if (*line == '\0')
256 break;
257 fprintf(ofp, "\"%s\\0\"\n", line);
258 }
259 }
260 fprintf(ofp, "\"\\0\"\n};\n");
261 if (ifp)
262 fclose(ifp);
263 fclose(ofp);
264 moveifchanged(path("hints.c.new"), path("hints.c"));
265
219 printf("Don't forget to do a ``make depend''\n");
220}
221
222/*
223 * Read in the information about files used in making the system.
224 * Store it in the ftab linked list.
225 */
226static void
266 printf("Don't forget to do a ``make depend''\n");
267}
268
269/*
270 * Read in the information about files used in making the system.
271 * Store it in the ftab linked list.
272 */
273static void
227read_files()
274read_files(void)
228{
229 FILE *fp;
275{
276 FILE *fp;
230 register struct file_list *tp, *pf;
231 register struct device *dp;
277 struct file_list *tp, *pf;
278 struct device *dp;
232 struct device *save_dp;
279 struct device *save_dp;
233 register struct opt *op;
280 struct opt *op;
234 char *wd, *this, *needs, *special, *depends, *clean, *warn;
235 char fname[80];
236 int ddwarned = 0;
237 int nreqs, first = 1, configdep, isdup, std, filetype,
238 imp_rule, no_obj, needcount, before_depend, mandatory;
239
240 ftab = 0;
241 save_dp = NULL;
242 if (ident == NULL) {
243 printf("no ident line specified\n");
244 exit(1);
245 }
246 (void) snprintf(fname, sizeof fname, "../../conf/files");
247openit:
248 fp = fopen(fname, "r");
249 if (fp == 0)
250 err(1, "%s", fname);
251next:
252 /*
281 char *wd, *this, *needs, *special, *depends, *clean, *warn;
282 char fname[80];
283 int ddwarned = 0;
284 int nreqs, first = 1, configdep, isdup, std, filetype,
285 imp_rule, no_obj, needcount, before_depend, mandatory;
286
287 ftab = 0;
288 save_dp = NULL;
289 if (ident == NULL) {
290 printf("no ident line specified\n");
291 exit(1);
292 }
293 (void) snprintf(fname, sizeof fname, "../../conf/files");
294openit:
295 fp = fopen(fname, "r");
296 if (fp == 0)
297 err(1, "%s", fname);
298next:
299 /*
253 * filename [ standard | mandatory | optional | count]
300 * filename [ standard | mandatory | optional | count ]
254 * [ config-dependent ]
255 * [ dev* | profiling-routine ] [ no-obj ]
256 * [ compile-with "compile rule" [no-implicit-rule] ]
257 * [ dependency "dependency-list"] [ before-depend ]
258 * [ clean "file-list"] [ warning "text warning" ]
259 */
260 wd = get_word(fp);
261 if (wd == (char *)EOF) {

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

423 goto nextparam;
424 }
425 if (needs == 0 && nreqs == 1)
426 needs = ns(wd);
427 if (isdup)
428 goto invis;
429 for (dp = dtab; dp != 0; save_dp = dp, dp = dp->d_next)
430 if (eq(dp->d_name, wd)) {
301 * [ config-dependent ]
302 * [ dev* | profiling-routine ] [ no-obj ]
303 * [ compile-with "compile rule" [no-implicit-rule] ]
304 * [ dependency "dependency-list"] [ before-depend ]
305 * [ clean "file-list"] [ warning "text warning" ]
306 */
307 wd = get_word(fp);
308 if (wd == (char *)EOF) {

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

470 goto nextparam;
471 }
472 if (needs == 0 && nreqs == 1)
473 needs = ns(wd);
474 if (isdup)
475 goto invis;
476 for (dp = dtab; dp != 0; save_dp = dp, dp = dp->d_next)
477 if (eq(dp->d_name, wd)) {
431 if (std && dp->d_type == PSEUDO_DEVICE &&
478 if (std && dp->d_type == DEVICE &&
432 dp->d_count <= 0)
433 dp->d_count = 1;
434 goto nextparam;
435 }
436 if (mandatory) {
437 printf("%s: mandatory device \"%s\" not found\n",
438 fname, wd);
439 exit(1);
440 }
441 if (std) {
442 dp = (struct device *) malloc(sizeof *dp);
443 bzero(dp, sizeof *dp);
479 dp->d_count <= 0)
480 dp->d_count = 1;
481 goto nextparam;
482 }
483 if (mandatory) {
484 printf("%s: mandatory device \"%s\" not found\n",
485 fname, wd);
486 exit(1);
487 }
488 if (std) {
489 dp = (struct device *) malloc(sizeof *dp);
490 bzero(dp, sizeof *dp);
444 init_dev(dp);
491 dp->d_type = DEVICE;
445 dp->d_name = ns(wd);
492 dp->d_name = ns(wd);
446 dp->d_type = PSEUDO_DEVICE;
447 dp->d_count = 1;
448 save_dp->d_next = dp;
449 goto nextparam;
450 }
451 for (op = opt; op != 0; op = op->op_next)
452 if (op->op_value == 0 && opteq(op->op_name, wd)) {
453 if (nreqs == 1) {
454 free(needs);

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

512 tp->f_clean = clean;
513 tp->f_warn = warn;
514 if (pf && pf->f_type == INVISIBLE)
515 pf->f_flags |= ISDUP; /* mark as duplicate */
516 goto next;
517}
518
519static int
493 dp->d_count = 1;
494 save_dp->d_next = dp;
495 goto nextparam;
496 }
497 for (op = opt; op != 0; op = op->op_next)
498 if (op->op_value == 0 && opteq(op->op_name, wd)) {
499 if (nreqs == 1) {
500 free(needs);

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

558 tp->f_clean = clean;
559 tp->f_warn = warn;
560 if (pf && pf->f_type == INVISIBLE)
561 pf->f_flags |= ISDUP; /* mark as duplicate */
562 goto next;
563}
564
565static int
520opteq(cp, dp)
521 char *cp, *dp;
566opteq(char *cp, char *dp)
522{
523 char c, d;
524
525 for (; ; cp++, dp++) {
526 if (*cp != *dp) {
527 c = isupper(*cp) ? tolower(*cp) : *cp;
528 d = isupper(*dp) ? tolower(*dp) : *dp;
529 if (c != d)
530 return (0);
531 }
532 if (*cp == 0)
533 return (1);
534 }
535}
536
537static void
567{
568 char c, d;
569
570 for (; ; cp++, dp++) {
571 if (*cp != *dp) {
572 c = isupper(*cp) ? tolower(*cp) : *cp;
573 d = isupper(*dp) ? tolower(*dp) : *dp;
574 if (c != d)
575 return (0);
576 }
577 if (*cp == 0)
578 return (1);
579 }
580}
581
582static void
538do_before_depend(fp)
539 FILE *fp;
583do_before_depend(FILE *fp)
540{
584{
541 register struct file_list *tp;
542 register int lpos, len;
585 struct file_list *tp;
586 int lpos, len;
543
544 fputs("BEFORE_DEPEND=", fp);
545 lpos = 15;
546 for (tp = ftab; tp; tp = tp->f_next)
547 if (tp->f_flags & BEFORE_DEPEND) {
548 len = strlen(tp->f_fn);
549 if ((len = 3 + len) + lpos > 72) {
550 lpos = 8;

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

556 fprintf(fp, "$S/%s ", tp->f_fn);
557 lpos += len + 1;
558 }
559 if (lpos != 8)
560 putc('\n', fp);
561}
562
563static void
587
588 fputs("BEFORE_DEPEND=", fp);
589 lpos = 15;
590 for (tp = ftab; tp; tp = tp->f_next)
591 if (tp->f_flags & BEFORE_DEPEND) {
592 len = strlen(tp->f_fn);
593 if ((len = 3 + len) + lpos > 72) {
594 lpos = 8;

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

600 fprintf(fp, "$S/%s ", tp->f_fn);
601 lpos += len + 1;
602 }
603 if (lpos != 8)
604 putc('\n', fp);
605}
606
607static void
564do_objs(fp)
565 FILE *fp;
608do_objs(FILE *fp)
566{
609{
567 register struct file_list *tp;
568 register int lpos, len;
569 register char *cp, och, *sp;
610 struct file_list *tp;
611 int lpos, len;
612 char *cp, och, *sp;
570
571 fprintf(fp, "OBJS=");
572 lpos = 6;
573 for (tp = ftab; tp != 0; tp = tp->f_next) {
574 if (tp->f_type == INVISIBLE || tp->f_flags & NO_OBJ)
575 continue;
576 sp = tail(tp->f_fn);
577 cp = sp + (len = strlen(sp)) - 1;

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

585 lpos += len + 1;
586 *cp = och;
587 }
588 if (lpos != 8)
589 putc('\n', fp);
590}
591
592static void
613
614 fprintf(fp, "OBJS=");
615 lpos = 6;
616 for (tp = ftab; tp != 0; tp = tp->f_next) {
617 if (tp->f_type == INVISIBLE || tp->f_flags & NO_OBJ)
618 continue;
619 sp = tail(tp->f_fn);
620 cp = sp + (len = strlen(sp)) - 1;

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

628 lpos += len + 1;
629 *cp = och;
630 }
631 if (lpos != 8)
632 putc('\n', fp);
633}
634
635static void
593do_cfiles(fp)
594 FILE *fp;
636do_cfiles(FILE *fp)
595{
637{
596 register struct file_list *tp;
597 register int lpos, len;
638 struct file_list *tp;
639 int lpos, len;
598
599 fputs("CFILES=", fp);
600 lpos = 8;
601 for (tp = ftab; tp; tp = tp->f_next)
602 if (tp->f_type != INVISIBLE && tp->f_type != NODEPEND) {
603 len = strlen(tp->f_fn);
604 if (tp->f_fn[len - 1] != 'c')
605 continue;

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

614
615 lpos += len + 1;
616 }
617 if (lpos != 8)
618 putc('\n', fp);
619}
620
621static void
640
641 fputs("CFILES=", fp);
642 lpos = 8;
643 for (tp = ftab; tp; tp = tp->f_next)
644 if (tp->f_type != INVISIBLE && tp->f_type != NODEPEND) {
645 len = strlen(tp->f_fn);
646 if (tp->f_fn[len - 1] != 'c')
647 continue;

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

656
657 lpos += len + 1;
658 }
659 if (lpos != 8)
660 putc('\n', fp);
661}
662
663static void
622do_mfiles(fp)
623 FILE *fp;
664do_mfiles(FILE *fp)
624{
665{
625 register struct file_list *tp;
626 register int lpos, len;
666 struct file_list *tp;
667 int lpos, len;
627
628 fputs("MFILES=", fp);
629 lpos = 8;
630 for (tp = ftab; tp; tp = tp->f_next)
631 if (tp->f_type != INVISIBLE) {
632 len = strlen(tp->f_fn);
633 if (tp->f_fn[len - 1] != 'm' || tp->f_fn[len - 2] != '.')
634 continue;

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

639 fprintf(fp, "$S/%s ", tp->f_fn);
640 lpos += len + 1;
641 }
642 if (lpos != 8)
643 putc('\n', fp);
644}
645
646static void
668
669 fputs("MFILES=", fp);
670 lpos = 8;
671 for (tp = ftab; tp; tp = tp->f_next)
672 if (tp->f_type != INVISIBLE) {
673 len = strlen(tp->f_fn);
674 if (tp->f_fn[len - 1] != 'm' || tp->f_fn[len - 2] != '.')
675 continue;

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

680 fprintf(fp, "$S/%s ", tp->f_fn);
681 lpos += len + 1;
682 }
683 if (lpos != 8)
684 putc('\n', fp);
685}
686
687static void
647do_sfiles(fp)
648 FILE *fp;
688do_sfiles(FILE *fp)
649{
689{
650 register struct file_list *tp;
651 register int lpos, len;
690 struct file_list *tp;
691 int lpos, len;
652
653 fputs("SFILES=", fp);
654 lpos = 8;
655 for (tp = ftab; tp; tp = tp->f_next)
656 if (tp->f_type != INVISIBLE) {
657 len = strlen(tp->f_fn);
658 if (tp->f_fn[len - 1] != 'S' && tp->f_fn[len - 1] != 's')
659 continue;
660 if ((len = 3 + len) + lpos > 72) {
661 lpos = 8;
662 fputs("\\\n\t", fp);
663 }
664 fprintf(fp, "$S/%s ", tp->f_fn);
665 lpos += len + 1;
666 }
667 if (lpos != 8)
668 putc('\n', fp);
669}
670
692
693 fputs("SFILES=", fp);
694 lpos = 8;
695 for (tp = ftab; tp; tp = tp->f_next)
696 if (tp->f_type != INVISIBLE) {
697 len = strlen(tp->f_fn);
698 if (tp->f_fn[len - 1] != 'S' && tp->f_fn[len - 1] != 's')
699 continue;
700 if ((len = 3 + len) + lpos > 72) {
701 lpos = 8;
702 fputs("\\\n\t", fp);
703 }
704 fprintf(fp, "$S/%s ", tp->f_fn);
705 lpos += len + 1;
706 }
707 if (lpos != 8)
708 putc('\n', fp);
709}
710
671
672static char *
711static char *
673tail(fn)
674 char *fn;
712tail(char *fn)
675{
713{
676 register char *cp;
714 char *cp;
677
678 cp = rindex(fn, '/');
679 if (cp == 0)
680 return (fn);
681 return (cp+1);
682}
683
684/*
685 * Create the makerules for each file
686 * which is part of the system.
687 * Devices are processed with the special c2 option -i
688 * which avoids any problem areas with i/o addressing
689 * (e.g. for the VAX); assembler files are processed by as.
690 */
691static void
715
716 cp = rindex(fn, '/');
717 if (cp == 0)
718 return (fn);
719 return (cp+1);
720}
721
722/*
723 * Create the makerules for each file
724 * which is part of the system.
725 * Devices are processed with the special c2 option -i
726 * which avoids any problem areas with i/o addressing
727 * (e.g. for the VAX); assembler files are processed by as.
728 */
729static void
692do_rules(f)
693 FILE *f;
730do_rules(FILE *f)
694{
731{
695 register char *cp, *np, och, *tp;
696 register struct file_list *ftp;
732 char *cp, *np, och, *tp;
733 struct file_list *ftp;
697 char *special;
698
699 for (ftp = ftab; ftp != 0; ftp = ftp->f_next) {
700 if (ftp->f_type == INVISIBLE)
701 continue;
702 if (ftp->f_warn)
703 printf("WARNING: %s\n", ftp->f_warn);
704 cp = (np = ftp->f_fn) + strlen(ftp->f_fn) - 1;

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

750 special = cmd;
751 }
752 *cp = och;
753 fprintf(f, "\t%s\n\n", special);
754 }
755}
756
757static void
734 char *special;
735
736 for (ftp = ftab; ftp != 0; ftp = ftp->f_next) {
737 if (ftp->f_type == INVISIBLE)
738 continue;
739 if (ftp->f_warn)
740 printf("WARNING: %s\n", ftp->f_warn);
741 cp = (np = ftp->f_fn) + strlen(ftp->f_fn) - 1;

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

787 special = cmd;
788 }
789 *cp = och;
790 fprintf(f, "\t%s\n\n", special);
791 }
792}
793
794static void
758do_clean(fp)
759 FILE *fp;
795do_clean(FILE *fp)
760{
796{
761 register struct file_list *tp;
762 register int lpos, len;
797 struct file_list *tp;
798 int lpos, len;
763
764 fputs("CLEAN=", fp);
765 lpos = 7;
766 for (tp = ftab; tp; tp = tp->f_next)
767 if (tp->f_clean) {
768 len = strlen(tp->f_clean);
769 if (len + lpos > 72) {
770 lpos = 8;
771 fputs("\\\n\t", fp);
772 }
773 fprintf(fp, "%s ", tp->f_clean);
774 lpos += len + 1;
775 }
776 if (lpos != 8)
777 putc('\n', fp);
778}
779
780char *
799
800 fputs("CLEAN=", fp);
801 lpos = 7;
802 for (tp = ftab; tp; tp = tp->f_next)
803 if (tp->f_clean) {
804 len = strlen(tp->f_clean);
805 if (len + lpos > 72) {
806 lpos = 8;
807 fputs("\\\n\t", fp);
808 }
809 fprintf(fp, "%s ", tp->f_clean);
810 lpos += len + 1;
811 }
812 if (lpos != 8)
813 putc('\n', fp);
814}
815
816char *
781raisestr(str)
782 register char *str;
817raisestr(char *str)
783{
818{
784 register char *cp = str;
819 char *cp = str;
785
786 while (*str) {
787 if (islower(*str))
788 *str = toupper(*str);
789 str++;
790 }
791 return (cp);
792}
820
821 while (*str) {
822 if (islower(*str))
823 *str = toupper(*str);
824 str++;
825 }
826 return (cp);
827}