chiark / gitweb /
Play catchup with Apple dscl's API churn
[disorder] / lib / split.h
CommitLineData
460b9539 1#ifndef SPLIT_H
2#define SPLIT_H
3
4#define SPLIT_COMMENTS 0001 /* # starts a comment */
5#define SPLIT_QUOTES 0002 /* " and ' quote strings */
6
7char **split(const char *s,
8 int *np,
9 unsigned flags,
10 void (*error_handler)(const char *msg, void *u),
11 void *u);
12/* split @s@ up into fields. Return a null-pointer-terminated array
13 * of pointers to the fields. If @np@ is not a null pointer store the
14 * number of fields there. Calls @error_handler@ to report any
15 * errors.
16 *
17 * split() operates on UTF-8 strings.
18 */
19
20const char *quoteutf8(const char *s);
21/* quote a UTF-8 string. Might return @s@ if no quoting is required. */
22
23#endif /* SPLIT_H */
24
25/*
26Local Variables:
27c-basic-offset:2
28comment-column:40
29End:
30*/