… | |
… | |
3 | * Copyright © 2005-2006 Atheme Development Group |
3 | * Copyright © 2005-2006 Atheme Development Group |
4 | * Rights to this code are as documented in doc/pod/license.pod. |
4 | * Rights to this code are as documented in doc/pod/license.pod. |
5 | * |
5 | * |
6 | * Misc tools |
6 | * Misc tools |
7 | * |
7 | * |
8 | * $Id: tools.h,v 1.4 2007/08/28 17:08:07 pippijn Exp $ |
8 | * $Id: tools.h,v 1.5 2007/08/29 08:04:32 pippijn Exp $ |
9 | */ |
9 | */ |
10 | |
10 | |
11 | #ifndef _TOOLS_H |
11 | #ifndef _TOOLS_H |
12 | #define _TOOLS_H |
12 | #define _TOOLS_H |
13 | |
13 | |
… | |
… | |
227 | |
227 | |
228 | /* tokenize.c */ |
228 | /* tokenize.c */ |
229 | E int sjtoken (char *message, char delimiter, char **parv, int limit = 256); |
229 | E int sjtoken (char *message, char delimiter, char **parv, int limit = 256); |
230 | E int tokenize (char *message, char **parv); |
230 | E int tokenize (char *message, char **parv); |
231 | |
231 | |
|
|
232 | inline int |
|
|
233 | sjtoken (char const * const message, char delimiter, char **parv, int limit = 256) |
|
|
234 | { |
|
|
235 | char *tmp = sstrdup (message); |
|
|
236 | int parc = sjtoken (tmp, delimiter, parv, limit); |
|
|
237 | free (tmp); |
|
|
238 | |
|
|
239 | return parc; |
|
|
240 | } |
|
|
241 | |
232 | /* ubase64.c */ |
242 | /* ubase64.c */ |
233 | E char const * const uinttobase64 (char *buf, uint64_t v, int64_t count); |
243 | E char const * const uinttobase64 (char *buf, uint64_t v, int64_t count); |
234 | E unsigned int base64touint (char *buf); |
244 | E unsigned int base64touint (char *buf); |
235 | |
245 | |
236 | #endif |
246 | #endif |