comparison lib-src/mmencode.c @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents 9ee227acff29
children 54cc21c15cbb
comparison
equal deleted inserted replaced
69:804d1389bcd6 70:131b0175ea99
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();
25 static char basis_64[] = 26 static char basis_64[] =
26 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 27 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
27 28
28 static char index_64[128] = { 29 static char index_64[128] = {
29 -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, 30 -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
40 41
41 /* 42 /*
42 char64(c) 43 char64(c)
43 char c; 44 char c;
44 { 45 {
45 char *s = (char *) strchr(basis_64, c); 46 char *s = (char *) index(basis_64, c);
46 if (s) return(s-basis_64); 47 if (s) return(s-basis_64);
47 return(-1); 48 return(-1);
48 } 49 }
49 */ 50 */
50 51
264 hexchar(c) 265 hexchar(c)
265 char c; 266 char c;
266 { 267 {
267 char *s; 268 char *s;
268 if (islower(c)) c = toupper(c); 269 if (islower(c)) c = toupper(c);
269 s = (char *) strchr(basis_hex, c); 270 s = (char *) index(basis_hex, c);
270 if (s) return(s-basis_hex); 271 if (s) return(s-basis_hex);
271 return(-1); 272 return(-1);
272 } 273 }
273 */ 274 */
274 275