]>
Commit | Line | Data |
---|---|---|
1 | /* base64.h: | |
2 | * | |
3 | * Definitions of the base64 functions | |
4 | */ | |
5 | ||
6 | #ifndef __BASE64_H | |
7 | #define __BASE64_H | |
8 | ||
9 | extern int numerictab[]; | |
10 | ||
11 | /* | |
12 | #define numerictolong(x,y) (donumtolong(x,y,0)) | |
13 | #define donumtolong(x,y,z) ((y)==0?(z):(donumtolong((x)+1,(y)-1,((z)<<6)+numerictab[(int)*(x)]))) | |
14 | */ | |
15 | ||
16 | static inline long numerictolong(const char *numeric, int numericlen) | |
17 | { | |
18 | long mynumeric=0; | |
19 | int i; | |
20 | ||
21 | for (i=0;i<numericlen;i++) { | |
22 | mynumeric=(mynumeric << 6)+numerictab[(int) *(numeric++)]; | |
23 | } | |
24 | ||
25 | return mynumeric; | |
26 | } | |
27 | ||
28 | char *longtonumeric(long param, int len); | |
29 | char *longtonumeric2(long param, int len, char *mynum); | |
30 | #endif |