annotate lib-src/=etags-vmslib.c @ 1811:3e4f8b1da4e9

({next,previous}-complete-history-element): New functions. Bind them to M-n/M-p and next/prior in minibuffer completion maps.
author Roland McGrath <roland@gnu.org>
date Mon, 25 Jan 1993 00:45:01 +0000
parents e2b34caa2da8
children 4df2f432697b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1 /* File name wild card expansion for VMS.
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2 This file is part of the etags program.
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3 Copyright (C) 1987 Free Software Foundation, Inc. 3 Feb 1987
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5 This program is distributed in the hope that it will be useful,
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6 but without any warranty. No author or distributor
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7 accepts responsibility to anyone for the consequences of using it
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
8 or for whether it serves any particular purpose or works at all,
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
9 unless he says so in writing.
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
10
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
11 Permission is granted to anyone to distribute verbatim copies
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
12 of this program's source code as received, in any medium, provided that
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
13 the copyright notice, the nonwarraty notice above
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14 and this permission notice are preserved,
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
15 and that the distributor grants the recipient all rights
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
16 for further redistribution as permitted by this notice,
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
17 and informs him of these rights.
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
18
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
19 Permission is granted to distribute modified versions of this
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
20 program's source code, or of portions of it, under the above
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
21 conditions, plus the conditions that all changed files carry
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
22 prominent notices stating who last changed them and that the
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
23 derived material, including anything packaged together with it and
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
24 conceptually functioning as a modification of it rather than an
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
25 application of it, is in its entirety subject to a permission
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
26 notice identical to this one.
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
27
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
28 Permission is granted to distribute this program (verbatim or
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
29 as modified) in compiled or executable form, provided verbatim
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
30 redistribution is permitted as stated above for source code, and
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
31 A. it is accompanied by the corresponding machine-readable
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
32 source code, under the above conditions, or
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
33 B. it is accompanied by a written offer, with no time limit,
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
34 to distribute the corresponding machine-readable source code,
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
35 under the above conditions, to any one, in return for reimbursement
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
36 of the cost of distribution. Verbatim redistribution of the
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
37 written offer must be permitted. Or,
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
38 C. it is distributed by someone who received only the
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
39 compiled or executable form, and is accompanied by a copy of the
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
40 written offer of source code which he received along with it.
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
41
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
42 Permission is granted to distribute this program (verbatim or as modified)
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
43 in executable form as part of a larger system provided that the source
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
44 code for this program, including any modifications used,
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
45 is also distributed or offered as stated in the preceding paragraph.
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
46
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
47 In other words, you are welcome to use, share and improve this program.
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
48 You are forbidden to forbid anyone else to use, share and improve
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
49 what you give them. Help stamp out software-hoarding! */
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
50
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
51 #include <stdio.h>
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
52 typedef char tbool;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
53
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
54 /* This is a BUG! ANY arbitrary limit is a BUG!
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
55 Won't someone please fix this? */
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
56 #define MAX_FILE_SPEC_LEN 255
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
57 typedef struct {
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
58 short curlen;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
59 char body[MAX_FILE_SPEC_LEN + 1];
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
60 } vspec;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
61 #define EOS '\0'
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
62 #define NO 0
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
63 #define YES 1
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
64 #define NULL 0
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
65
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
66 /* v1.01 nmm 19-Aug-85 gfnames - return in successive calls the
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
67 name of each file specified by all the remaining args in the command-line
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
68 expanding wild cards and
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
69 stepping over arguments when they have been processed completely
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
70 */
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
71 char*
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
72 gfnames(pac, pav, p_error)
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
73 int *pac;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
74 char **pav[];
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
75 tbool *p_error;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
76 {
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
77 static vspec filename = {MAX_FILE_SPEC_LEN, "\0"};
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
78 short fn_exp();
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
79
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
80 while (1)
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
81 if (*pac == 0)
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
82 {
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
83 *p_error = NO;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
84 return(NULL);
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
85 }
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
86 else switch(fn_exp(&filename, **pav))
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
87 {
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
88 case 1:
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
89 *p_error = NO;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
90 return(filename.body);
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
91 break;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
92 case 0:
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
93 --*pac;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
94 ++*pav;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
95 break;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
96 default:
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
97 *p_error = YES;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
98 return(filename.body);
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
99 break;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
100 }
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
101
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
102 }
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
103
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
104 /* v1.05 nmm 26-Jun-86 fn_exp - expand specification of list of file names
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
105 returning in each successive call the next filename matching the input
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
106 spec. The function expects that each in_spec passed
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
107 to it will be processed to completion; in particular, up to and
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
108 including the call following that in which the last matching name
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
109 is returned, the function ignores the value of in_spec, and will
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
110 only start processing a new spec with the following call.
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
111 If an error occurs, on return out_spec contains the value
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
112 of in_spec when the error occurred.
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
113
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
114 With each successive filename returned in out_spec, the
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
115 function's return value is one. When there are no more matching
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
116 names the function returns zero. If on the first call no file
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
117 matches in_spec, or there is any other error, -1 is returned.
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
118 */
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
119
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
120 #include <rmsdef.h>
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
121 #include <descrip.h>
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
122 #define OUTSIZE MAX_FILE_SPEC_LEN
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
123 short
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
124 fn_exp(out, in)
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
125 vspec *out;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
126 char *in;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
127 {
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
128 static long context = 0;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
129 static struct dsc$descriptor_s o;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
130 static struct dsc$descriptor_s i;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
131 static tbool pass1 = YES;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
132 long status;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
133 short retval;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
134
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
135 if (pass1)
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
136 {
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
137 pass1 = NO;
615
e2b34caa2da8 entered into RCS
Jim Blandy <jimb@redhat.com>
parents: 15
diff changeset
138 o.dsc$a_pointer = (char *) out;
15
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
139 o.dsc$w_length = (short)OUTSIZE;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
140 i.dsc$a_pointer = in;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
141 i.dsc$w_length = (short)strlen(in);
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
142 i.dsc$b_dtype = DSC$K_DTYPE_T;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
143 i.dsc$b_class = DSC$K_CLASS_S;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
144 o.dsc$b_dtype = DSC$K_DTYPE_VT;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
145 o.dsc$b_class = DSC$K_CLASS_VS;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
146 }
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
147 if ( (status = lib$find_file(&i, &o, &context, 0, 0)) == RMS$_NORMAL)
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
148 {
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
149 out->body[out->curlen] = EOS;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
150 return(1);
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
151 }
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
152 else if (status == RMS$_NMF)
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
153 retval = 0;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
154 else
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
155 {
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
156 strcpy(out->body, in);
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
157 retval = -1;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
158 }
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
159 lib$find_file_end(&context);
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
160 pass1 = YES;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
161 return(retval);
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
162 }
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
163
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
164 #ifndef OLD /* Newer versions of VMS do provide `system'. */
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
165 system(cmd)
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
166 char *cmd;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
167 {
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
168 fprintf(stderr, "system() function not implemented under VMS\n");
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
169 }
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
170 #endif
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
171
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
172 #define VERSION_DELIM ';'
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
173 char *massage_name(s)
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
174 char *s;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
175 {
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
176 char *start = s;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
177
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
178 for ( ; *s; s++)
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
179 if (*s == VERSION_DELIM)
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
180 {
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
181 *s = EOS;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
182 break;
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
183 }
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
184 else
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
185 *s = tolower(*s);
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
186 return(start);
72e5cc99eab0 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
187 }