RetroArch
string_list.h
Go to the documentation of this file.
1 /* Copyright (C) 2010-2018 The RetroArch team
2  *
3  * ---------------------------------------------------------------------------------------
4  * The following license statement only applies to this file (string_list.h).
5  * ---------------------------------------------------------------------------------------
6  *
7  * Permission is hereby granted, free of charge,
8  * to any person obtaining a copy of this software and associated documentation files (the "Software"),
9  * to deal in the Software without restriction, including without limitation the rights to
10  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
11  * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  */
22 
23 #ifndef __LIBRETRO_SDK_STRING_LIST_H
24 #define __LIBRETRO_SDK_STRING_LIST_H
25 
26 #include <retro_common_api.h>
27 
28 #include <boolean.h>
29 #include <stdlib.h>
30 #include <stddef.h>
31 
33 
35 {
36  bool b;
37  int i;
38  void *p;
39 };
40 
42 {
43  char *data;
45 };
46 
48 {
50  size_t size;
51  size_t cap;
52 };
53 
63 int string_list_find_elem(const struct string_list *list, const char *elem);
64 
76 bool string_list_find_elem_prefix(const struct string_list *list,
77  const char *prefix, const char *elem);
78 
88 struct string_list *string_split(const char *str, const char *delim);
89 
97 struct string_list *string_list_new(void);
98 
109 bool string_list_append(struct string_list *list, const char *elem,
110  union string_list_elem_attr attr);
111 
123 bool string_list_append_n(struct string_list *list, const char *elem,
124  unsigned length, union string_list_elem_attr attr);
125 
132 void string_list_free(struct string_list *list);
133 
144 void string_list_join_concat(char *buffer, size_t size,
145  const struct string_list *list, const char *sep);
146 
155 void string_list_set(struct string_list *list, unsigned idx,
156  const char *str);
157 
159 
160 #endif
void string_list_set(struct string_list *list, unsigned idx, const char *str)
Definition: string_list.c:171
size_t cap
Definition: string_list.h:51
#define RETRO_BEGIN_DECLS
Definition: retro_common_api.h:41
void * p
Definition: string_list.h:38
struct string_list_elem * elems
Definition: string_list.h:49
GLsizeiptr size
Definition: glext.h:6559
bool string_list_append(struct string_list *list, const char *elem, union string_list_elem_attr attr)
Definition: string_list.c:109
Definition: string_list.h:41
struct string_list * string_list_new(void)
Definition: string_list.c:82
Definition: string_list.h:34
int i
Definition: string_list.h:37
char * data
Definition: string_list.h:43
void string_list_free(struct string_list *list)
Definition: string_list.c:38
bool string_list_find_elem_prefix(const struct string_list *list, const char *prefix, const char *elem)
Definition: string_list.c:285
bool b
Definition: string_list.h:36
bool string_list_append_n(struct string_list *list, const char *elem, unsigned length, union string_list_elem_attr attr)
Definition: string_list.c:140
void string_list_join_concat(char *buffer, size_t size, const struct string_list *list, const char *sep)
Definition: string_list.c:188
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 idx
Definition: pixman-arm-neon-asm.h:96
#define RETRO_END_DECLS
Definition: retro_common_api.h:42
int string_list_find_elem(const struct string_list *list, const char *elem)
Definition: string_list.c:258
size_t size
Definition: string_list.h:50
union string_list_elem_attr attr
Definition: string_list.h:44
Definition: video4linux2.c:51
GLenum GLuint GLenum GLsizei length
Definition: glext.h:6233
const char *const str
Definition: portlistingparse.c:18
Definition: string_list.h:47
struct string_list * string_split(const char *str, const char *delim)
Definition: string_list.c:213