 |
Open Broadcaster Software
Free, open source software for live streaming and recording
|
Go to the documentation of this file.
43 #define PRINTFATTR(f, a) __attribute__((__format__(__printf__, f, a)))
45 #define PRINTFATTR(f, a)
64 static inline void dstr_init(
struct dstr *dst);
65 static inline void dstr_init_move(
struct dstr *dst,
struct dstr *src);
66 static inline void dstr_init_move_array(
struct dstr *dst,
char *str);
67 static inline void dstr_init_copy(
struct dstr *dst,
const char *src);
68 static inline void dstr_init_copy_dstr(
struct dstr *dst,
69 const struct dstr *src);
72 static inline void dstr_free(
struct dstr *dst);
73 static inline void dstr_array_free(
struct dstr *array,
const size_t count);
75 static inline void dstr_move(
struct dstr *dst,
struct dstr *src);
76 static inline void dstr_move_array(
struct dstr *dst,
char *str);
79 static inline void dstr_copy_dstr(
struct dstr *dst,
const struct dstr *src);
86 static inline void dstr_resize(
struct dstr *dst,
const size_t num);
87 static inline void dstr_reserve(
struct dstr *dst,
const size_t num);
89 static inline bool dstr_is_empty(
const struct dstr *str);
91 static inline void dstr_cat(
struct dstr *dst,
const char *array);
95 static inline void dstr_cat_ch(
struct dstr *dst,
char ch);
103 const struct dstr *str);
117 const
char *val1, const
char *val2,
118 const
char *val3, const
char *val4);
120 static inline const
char *dstr_find_i(const struct
dstr *str, const
char *find);
121 static inline const
char *dstr_find(const struct
dstr *str, const
char *find);
124 const
char *replace);
126 static inline
int dstr_cmp(const struct
dstr *str1, const
char *str2);
127 static inline
int dstr_cmpi(const struct
dstr *str1, const
char *str2);
128 static inline
int dstr_ncmp(const struct
dstr *str1, const
char *str2,
130 static inline
int dstr_ncmpi(const struct
dstr *str1, const
char *str2,
138 const
size_t start, const
size_t count);
142 static inline
char dstr_end(const struct
dstr *str);
156 static inline void dstr_init(
struct dstr *dst)
163 static inline void dstr_init_move_array(
struct dstr *dst,
char *str)
166 dst->
len = (!str) ? 0 : strlen(str);
170 static inline void dstr_init_move(
struct dstr *dst,
struct dstr *src)
176 static inline void dstr_init_copy(
struct dstr *dst,
const char *str)
182 static inline void dstr_init_copy_dstr(
struct dstr *dst,
const struct dstr *src)
185 dstr_copy_dstr(dst, src);
188 static inline void dstr_free(
struct dstr *dst)
196 static inline void dstr_array_free(
struct dstr *array,
const size_t count)
199 for (i = 0; i < count; i++)
200 dstr_free(array + i);
203 static inline void dstr_move_array(
struct dstr *dst,
char *str)
207 dst->
len = (!str) ? 0 : strlen(str);
211 static inline void dstr_move(
struct dstr *dst,
struct dstr *src)
214 dstr_init_move(dst, src);
217 static inline void dstr_ensure_capacity(
struct dstr *dst,
const size_t new_size)
220 if (new_size <= dst->capacity)
224 if (new_size > new_cap)
230 static inline void dstr_copy_dstr(
struct dstr *dst,
const struct dstr *src)
236 dstr_ensure_capacity(dst, src->
len + 1);
242 static inline void dstr_reserve(
struct dstr *dst,
const size_t capacity)
244 if (capacity == 0 || capacity <= dst->len)
251 static inline void dstr_resize(
struct dstr *dst,
const size_t num)
258 dstr_ensure_capacity(dst, num + 1);
263 static inline bool dstr_is_empty(
const struct dstr *str)
273 static inline void dstr_cat(
struct dstr *dst,
const char *array)
276 if (!array || !*array)
283 static inline void dstr_cat_ch(
struct dstr *dst,
char ch)
285 dstr_ensure_capacity(dst, ++dst->
len + 1);
290 static inline const char *dstr_find_i(
const struct dstr *str,
const char *find)
295 static inline const char *dstr_find(
const struct dstr *str,
const char *find)
297 return strstr(str->
array, find);
300 static inline int dstr_cmp(
const struct dstr *str1,
const char *str2)
302 return strcmp(str1->
array, str2);
305 static inline int dstr_cmpi(
const struct dstr *str1,
const char *str2)
310 static inline int dstr_ncmp(
const struct dstr *str1,
const char *str2,
316 static inline int dstr_ncmpi(
const struct dstr *str1,
const char *str2,
322 static inline char dstr_end(
const struct dstr *str)
324 if (dstr_is_empty(str))
EXPORT void * brealloc(void *ptr, size_t size)
EXPORT int wstrcmpi_n(const wchar_t *str1, const wchar_t *str2, size_t n)
EXPORT char ** strlist_split(const char *str, char split_ch, bool include_empty)
EXPORT void dstr_init_copy_strref(struct dstr *dst, const struct strref *src)
EXPORT void strlist_free(char **strlist)
EXPORT int wstrcmp_n(const wchar_t *str1, const wchar_t *str2, size_t n)
EXPORT void dstr_ncat(struct dstr *dst, const char *array, const size_t len)
EXPORT void dstr_cat_strref(struct dstr *dst, const struct strref *str)
EXPORT wchar_t * wcsdepad(wchar_t *str)
EXPORT wchar_t * wstrstri(const wchar_t *str, const wchar_t *find)
EXPORT int astrcmpi(const char *str1, const char *str2)
EXPORT void dstr_cat_dstr(struct dstr *dst, const struct dstr *str)
EXPORT void bfree(void *ptr)
EXPORT void dstr_catf(struct dstr *dst, const char *format,...)
#define EXPORT
Definition: c99defs.h:37
EXPORT void dstr_remove(struct dstr *dst, const size_t idx, const size_t count)
EXPORT void dstr_to_lower(struct dstr *str)
EXPORT void dstr_insert_dstr(struct dstr *dst, const size_t idx, const struct dstr *str)
EXPORT void dstr_copy_strref(struct dstr *dst, const struct strref *src)
EXPORT void dstr_from_mbs(struct dstr *dst, const char *mbstr)
EXPORT void dstr_safe_printf(struct dstr *dst, const char *format, const char *val1, const char *val2, const char *val3, const char *val4)
EXPORT void dstr_left(struct dstr *dst, const struct dstr *str, const size_t pos)
EXPORT wchar_t * dstr_to_wcs(const struct dstr *str)
EXPORT void dstr_ncopy(struct dstr *dst, const char *array, const size_t len)
EXPORT char * astrstri(const char *str, const char *find)
EXPORT char * strdepad(char *str)
EXPORT void dstr_to_upper(struct dstr *str)
EXPORT char * dstr_to_mbs(const struct dstr *str)
char * array
Definition: dstr.h:37
EXPORT void dstr_vcatf(struct dstr *dst, const char *format, va_list args)
EXPORT void dstr_right(struct dstr *dst, const struct dstr *str, const size_t pos)
#define PRINTFATTR(f, a)
Definition: dstr.h:43
EXPORT void dstr_ncopy_dstr(struct dstr *dst, const struct dstr *src, const size_t len)
EXPORT void dstr_from_wcs(struct dstr *dst, const wchar_t *wstr)
EXPORT int astrcmpi_n(const char *str1, const char *str2, size_t n)
EXPORT void dstr_mid(struct dstr *dst, const struct dstr *str, const size_t start, const size_t count)
EXPORT void dstr_copy(struct dstr *dst, const char *array)
size_t len
Definition: dstr.h:38
EXPORT void dstr_insert_ch(struct dstr *dst, const size_t idx, const char ch)
EXPORT void dstr_depad(struct dstr *dst)
EXPORT void dstr_vprintf(struct dstr *dst, const char *format, va_list args)
EXPORT int wstrcmpi(const wchar_t *str1, const wchar_t *str2)
size_t capacity
Definition: dstr.h:39
EXPORT void dstr_replace(struct dstr *str, const char *find, const char *replace)
EXPORT void dstr_printf(struct dstr *dst, const char *format,...)
EXPORT void dstr_ncat_dstr(struct dstr *dst, const struct dstr *str, const size_t len)
EXPORT int astrcmp_n(const char *str1, const char *str2, size_t n)
EXPORT void dstr_insert(struct dstr *dst, const size_t idx, const char *array)