1 : /* Copyright (c) 2007 Paul Rosenfeld
2 : James Antill -- See LICENSE file for terms. */
3 : #ifndef USTR_SPLIT_H
4 : #define USTR_SPLIT_H 1
5 :
6 : #ifndef USTR_MAIN_H
7 : # error " You should include ustr-main.h before this file, or just ustr.h"
8 : #endif
9 :
10 : #define USTR_FLAG_SPLIT_DEF 0
11 : #define USTR_FLAG_SPLIT_RET_SEP (1<<0)
12 : #define USTR_FLAG_SPLIT_RET_NON (1<<1)
13 : #define USTR_FLAG_SPLIT_KEEP_CONF (1<<2)
14 :
15 : USTR_CONF_E_PROTO
16 : struct Ustr *ustr_split_buf(const struct Ustr *, size_t *,
17 : const void *, size_t, struct Ustr *, unsigned int)
18 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1, 2,3));
19 : USTR_CONF_E_PROTO
20 : struct Ustr *ustr_split(const struct Ustr *, size_t *, const struct Ustr *,
21 : struct Ustr *, unsigned int)
22 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1, 2,3));
23 : USTR_CONF_EI_PROTO
24 : struct Ustr *ustr_split_cstr(const struct Ustr *, size_t *,
25 : const char *, struct Ustr *, unsigned int)
26 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1, 2,3));
27 :
28 : USTR_CONF_E_PROTO
29 : struct Ustrp *ustrp_split_buf(struct Ustr_pool *, const struct Ustrp *,size_t *,
30 : const void *, size_t, struct Ustrp *,unsigned int)
31 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((2, 3,4));
32 : USTR_CONF_E_PROTO
33 : struct Ustrp *ustrp_split(struct Ustr_pool *, const struct Ustrp *, size_t *,
34 : const struct Ustrp *, struct Ustrp *, unsigned int)
35 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((2, 3,4));
36 : USTR_CONF_EI_PROTO
37 : struct Ustrp *ustrp_split_cstr(struct Ustr_pool *,const struct Ustrp *,size_t *,
38 : const char *, struct Ustrp *, unsigned int)
39 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((2, 3,4));
40 :
41 : USTR_CONF_E_PROTO
42 : struct Ustr *ustr_split_spn_chrs(const struct Ustr *, size_t *, const char *,
43 : size_t, struct Ustr *, unsigned int)
44 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1, 2,3));
45 : USTR_CONF_E_PROTO
46 : struct Ustr *ustr_split_spn(const struct Ustr *, size_t *, const struct Ustr *,
47 : struct Ustr *, unsigned int)
48 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1, 2,3));
49 : USTR_CONF_EI_PROTO
50 : struct Ustr *ustr_split_spn_cstr(const struct Ustr *, size_t *, const char *,
51 : struct Ustr *, unsigned int)
52 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((1, 2,3));
53 :
54 : USTR_CONF_E_PROTO
55 : struct Ustrp *ustrp_split_spn_chrs(struct Ustr_pool *, const struct Ustrp *,
56 : size_t *, const char *, size_t,
57 : struct Ustrp *, unsigned int)
58 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((2, 3,4));
59 : USTR_CONF_E_PROTO
60 : struct Ustrp *ustrp_split_spn(struct Ustr_pool *, const struct Ustrp *,size_t *,
61 : const struct Ustrp *, struct Ustrp *,
62 : unsigned int)
63 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((2, 3,4));
64 : USTR_CONF_EI_PROTO
65 : struct Ustrp *ustrp_split_spn_cstr(struct Ustr_pool *, const struct Ustrp *,
66 : size_t *, const char *, struct Ustrp *,
67 : unsigned int)
68 : USTR__COMPILE_ATTR_WARN_UNUSED_RET() USTR__COMPILE_ATTR_NONNULL_L((2, 3,4));
69 :
70 : #if USTR_CONF_INCLUDE_INTERNAL_HEADERS
71 : # include "ustr-split-internal.h"
72 : #endif
73 :
74 : #if USTR_CONF_INCLUDE_CODEONLY_HEADERS
75 : # include "ustr-split-code.h"
76 : #endif
77 :
78 : #if USTR_CONF_COMPILE_USE_INLINE
79 : USTR_CONF_II_PROTO
80 : struct Ustr *ustr_split_cstr(const struct Ustr *s1, size_t *off,
81 : const char *cstr, struct Ustr *ret,
82 : unsigned int flags)
83 84 : { return (ustr_split_buf(s1, off, cstr, strlen(cstr), ret, flags)); }
84 : USTR_CONF_II_PROTO
85 : struct Ustrp *ustrp_split_cstr(struct Ustr_pool *p, const struct Ustrp *sp1,
86 : size_t *off, const char *cstr, struct Ustrp *ret,
87 : unsigned int flgs)
88 20 : { return (ustrp_split_buf(p, sp1, off, cstr, strlen(cstr), ret, flgs)); }
89 :
90 : USTR_CONF_II_PROTO
91 : struct Ustr *ustr_split_spn_cstr(const struct Ustr *s1, size_t *off,
92 : const char *cstr, struct Ustr *ret,
93 : unsigned int flags)
94 348 : { return (ustr_split_spn_chrs(s1, off, cstr, strlen(cstr), ret, flags)); }
95 : USTR_CONF_II_PROTO
96 : struct Ustrp *ustrp_split_spn_cstr(struct Ustr_pool *p, const struct Ustrp *sp1,
97 : size_t *off, const char *cstr,
98 : struct Ustrp *ret, unsigned int flgs)
99 10 : { return (ustrp_split_spn_chrs(p, sp1, off, cstr, strlen(cstr), ret, flgs)); }
100 : #endif
101 :
102 : #endif
|