Added all of the MH sources, including RCS files, in
[mmh] / docs / historical / mh-6.8.5 / sbr / RCS / uprf.c,v
1 head    1.8;
2 access;
3 symbols;
4 locks; strict;
5 comment @ * @;
6
7
8 1.8
9 date    92.12.15.00.20.22;      author jromine; state Exp;
10 branches;
11 next    1.7;
12
13 1.7
14 date    92.10.26.22.56.12;      author jromine; state Exp;
15 branches;
16 next    1.6;
17
18 1.6
19 date    90.04.05.15.30.35;      author sources; state Exp;
20 branches;
21 next    1.5;
22
23 1.5
24 date    90.04.05.14.44.33;      author sources; state Exp;
25 branches;
26 next    1.4;
27
28 1.4
29 date    90.04.02.15.07.22;      author sources; state Exp;
30 branches;
31 next    1.3;
32
33 1.3
34 date    90.04.02.14.40.31;      author sources; state Exp;
35 branches;
36 next    1.2;
37
38 1.2
39 date    90.01.25.16.09.17;      author sources; state Exp;
40 branches;
41 next    1.1;
42
43 1.1
44 date    90.01.25.16.07.24;      author sources; state Exp;
45 branches;
46 next    ;
47
48
49 desc
50 @@
51
52
53 1.8
54 log
55 @endif sugar
56 @
57 text
58 @/* uprf.c - "unsigned" lexical prefix  */
59 #ifndef lint
60 static char ident[] = "@@(#)$Id: uprf.c,v 1.7 1992/10/26 22:56:12 jromine Exp jromine $";
61 #endif  /* lint */
62
63 #define TO_LOWER 040
64 #define NO_MASK  000
65 #include <ctype.h>
66
67 uprf (c1, c2)
68 register char  *c1,
69                *c2;
70 {
71     register int    c,
72                     mask;
73
74     if (c1 == 0 || c2 == 0)
75         return(0);         /* XXX */
76
77     while (c = *c2++)
78     {
79 #ifdef LOCALE
80         c &= 0xff;
81         mask = *c1 & 0xff;
82         c = (isalpha(c) && isupper(c)) ? tolower(c) : c;
83         mask = (isalpha(mask) && isupper(mask)) ? tolower(mask) : mask;
84         if (c != mask)
85 #else
86         mask = (isalpha(c) && isalpha(*c1)) ?  TO_LOWER : NO_MASK;
87         if ((c | mask) != (*c1 | mask))
88 #endif
89             return 0;
90         else
91             c1++;
92     }
93     return 1;
94 }
95 @
96
97
98 1.7
99 log
100 @LOCALE
101 @
102 text
103 @d3 2
104 a4 2
105 static char ident[] = "@@(#)$Id: uprf.c,v 1.6 1990/04/05 15:30:35 sources Exp jromine $";
106 #endif  lint
107 @
108
109
110 1.6
111 log
112 @add ID
113 @
114 text
115 @d3 1
116 a3 1
117 static char ident[] = "@@(#)$Id:$";
118 d22 7
119 d31 1
120 @
121
122
123 1.5
124 log
125 @add ID
126 @
127 text
128 @d3 1
129 a3 1
130 static char ident[] = "$Id:";
131 @
132
133
134 1.4
135 log
136 @typo
137 @
138 text
139 @d2 3
140 @
141
142
143 1.3
144 log
145 @RAND fixes
146 @
147 text
148 @d3 1
149 a3 1
150 #define TO_UPPER 040
151 d11 2
152 a12 1
153     register int    c;
154 d19 1
155 a19 1
156         mask = (isalpha(c) && isalpha(*c1)) ?  TO_UPPER : NO_MASK;
157 @
158
159
160 1.2
161 log
162 @fix null pointer bug.
163 @
164 text
165 @d3 3
166 d17 3
167 a19 1
168         if ((c | 040) != (*c1 | 040))
169 d23 1
170 a23 1
171
172 @
173
174
175 1.1
176 log
177 @Initial revision
178 @
179 text
180 @d10 3
181 @