]> jfr.im git - irc/quakenet/newserv.git/blame - lib/base64.h
A4STATS: remove E style escapes and switch to createtable for indices
[irc/quakenet/newserv.git] / lib / base64.h
CommitLineData
c86edd1d
Q
1/* base64.h:
2 *
3 * Definitions of the base64 functions
4 */
5
6#ifndef __BASE64_H
7#define __BASE64_H
8
9extern 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
d8b17362 16static inline long numerictolong(const char *numeric, int numericlen)
c86edd1d
Q
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}
6c27603e 27
c86edd1d
Q
28char *longtonumeric(long param, int len);
29char *longtonumeric2(long param, int len, char *mynum);
30#endif