squareball  0.2.0.53-dd5b
A general-purpose library for C99
sb-strfuncs.h
Go to the documentation of this file.
1 /*
2  * squareball: A general-purpose library for C99.
3  * Copyright (C) 2014-2018 Rafael G. Martins <rafael@rafaelmartins.eng.br>
4  *
5  * This program can be distributed under the terms of the BSD License.
6  * See the file LICENSE.
7  */
8 
9 #ifndef _SQUAREBALL_STRFUNCS_H
10 #define _SQUAREBALL_STRFUNCS_H
11 
12 #include <stdarg.h>
13 #include <stdbool.h>
14 #include <stdarg.h>
15 
29 char* sb_strdup(const char *s);
30 
38 char* sb_strndup(const char *s, size_t n);
39 
48 char* sb_strdup_vprintf(const char *format, va_list ap);
49 
58 char* sb_strdup_printf(const char *format, ...);
59 
68 bool sb_str_starts_with(const char *str, const char *prefix);
69 
78 bool sb_str_ends_with(const char *str, const char *suffix);
79 
87 char* sb_str_lstrip(char *str);
88 
97 char* sb_str_rstrip(char *str);
98 
107 char* sb_str_strip(char *str);
108 
121 char** sb_str_split(const char *str, char c, size_t max_pieces);
122 
132 char* sb_str_replace(const char *str, const char search, const char *replace);
133 
144 char* sb_str_find(const char *str, char c);
145 
155 bool sb_str_to_bool(const char *str);
156 
163 void sb_strv_free(char **strv);
164 
173 char* sb_strv_join(char **strv, const char *separator);
174 
182 size_t sb_strv_length(char **strv);
183 
186 #endif /* _SQUAREBALL_STRFUNCS_H */
char * sb_str_find(const char *str, char c)
char * sb_str_strip(char *str)
char * sb_strdup_printf(const char *format,...)
bool sb_str_to_bool(const char *str)
char ** sb_str_split(const char *str, char c, size_t max_pieces)
bool sb_str_starts_with(const char *str, const char *prefix)
bool sb_str_ends_with(const char *str, const char *suffix)
char * sb_str_replace(const char *str, const char search, const char *replace)
char * sb_strdup(const char *s)
char * sb_strndup(const char *s, size_t n)
void sb_strv_free(char **strv)
char * sb_strdup_vprintf(const char *format, va_list ap)
char * sb_str_lstrip(char *str)
char * sb_strv_join(char **strv, const char *separator)
size_t sb_strv_length(char **strv)
char * sb_str_rstrip(char *str)