Mercurial > hg > xemacs-beta
comparison lib-src/mmencode.c @ 74:54cc21c15cbb r20-0b32
Import from CVS: tag r20-0b32
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:04:33 +0200 |
parents | 131b0175ea99 |
children | 0132846995bd |
comparison
equal
deleted
inserted
replaced
73:e2d7a37b7c8d | 74:54cc21c15cbb |
---|---|
20 #include <string.h> | 20 #include <string.h> |
21 | 21 |
22 static void | 22 static void |
23 output64chunk(int c1, int c2, int c3, int pads, FILE *outfile); | 23 output64chunk(int c1, int c2, int c3, int pads, FILE *outfile); |
24 | 24 |
25 extern char *index(); | |
26 static char basis_64[] = | 25 static char basis_64[] = |
27 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; | 26 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; |
28 | 27 |
29 static char index_64[128] = { | 28 static char index_64[128] = { |
30 -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, | 29 -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, |
41 | 40 |
42 /* | 41 /* |
43 char64(c) | 42 char64(c) |
44 char c; | 43 char c; |
45 { | 44 { |
46 char *s = (char *) index(basis_64, c); | 45 char *s = (char *) strchr(basis_64, c); |
47 if (s) return(s-basis_64); | 46 if (s) return(s-basis_64); |
48 return(-1); | 47 return(-1); |
49 } | 48 } |
50 */ | 49 */ |
51 | 50 |
265 hexchar(c) | 264 hexchar(c) |
266 char c; | 265 char c; |
267 { | 266 { |
268 char *s; | 267 char *s; |
269 if (islower(c)) c = toupper(c); | 268 if (islower(c)) c = toupper(c); |
270 s = (char *) index(basis_hex, c); | 269 s = (char *) strchr(basis_hex, c); |
271 if (s) return(s-basis_hex); | 270 if (s) return(s-basis_hex); |
272 return(-1); | 271 return(-1); |
273 } | 272 } |
274 */ | 273 */ |
275 | 274 |