Rizin
unix-like reverse engineering framework and cli tools
rz_spaces.h File Reference
#include "rz_util.h"
#include "rz_serialize.h"
#include <sdb.h>

Go to the source code of this file.

Classes

struct  rz_space_t
 
struct  rz_space_event_t
 
struct  rz_spaces_t
 

Macros

#define RZ_SPACES_MAX   512
 
#define rz_spaces_foreach(sp, it, s)    rz_rbtree_foreach ((sp)->spaces, (it), (s), RzSpace, rb)
 

Typedefs

typedef struct rz_space_t RzSpace
 
typedef struct rz_space_event_t RzSpaceEvent
 
typedef struct rz_spaces_t RzSpaces
 
typedef RBIter RzSpaceIter
 

Enumerations

enum  RzSpaceEventType { RZ_SPACE_EVENT_COUNT = 1 , RZ_SPACE_EVENT_RENAME , RZ_SPACE_EVENT_UNSET }
 

Functions

RZ_API RzSpacesrz_spaces_new (const char *name)
 
RZ_API bool rz_spaces_init (RzSpaces *sp, const char *name)
 
RZ_API void rz_spaces_fini (RzSpaces *sp)
 
RZ_API void rz_spaces_free (RzSpaces *sp)
 
RZ_API void rz_spaces_purge (RzSpaces *sp)
 
RZ_API RzSpacerz_spaces_get (RzSpaces *sp, const char *name)
 
RZ_API RzSpacerz_spaces_add (RzSpaces *sp, const char *name)
 
RZ_API RzSpacerz_spaces_set (RzSpaces *sp, const char *name)
 
RZ_API bool rz_spaces_unset (RzSpaces *sp, const char *name)
 
RZ_API bool rz_spaces_rename (RzSpaces *sp, const char *oname, const char *nname)
 
RZ_API int rz_spaces_count (RzSpaces *sp, const char *name)
 
RZ_API bool rz_spaces_push (RzSpaces *sp, const char *name)
 
RZ_API bool rz_spaces_pop (RzSpaces *sp)
 
static RzSpacerz_spaces_current (RzSpaces *sp)
 
static const char * rz_spaces_current_name (RzSpaces *sp)
 
static bool rz_spaces_is_empty (RzSpaces *sp)
 
RZ_API void rz_serialize_spaces_save (RZ_NONNULL Sdb *db, RZ_NONNULL RzSpaces *spaces)
 
RZ_API bool rz_serialize_spaces_load (RZ_NONNULL Sdb *db, RZ_NONNULL RzSpaces *spaces, bool load_name, RZ_NULLABLE RzSerializeResultInfo *res)
 

Macro Definition Documentation

◆ rz_spaces_foreach

#define rz_spaces_foreach (   sp,
  it,
  s 
)     rz_rbtree_foreach ((sp)->spaces, (it), (s), RzSpace, rb)

Definition at line 105 of file rz_spaces.h.

◆ RZ_SPACES_MAX

#define RZ_SPACES_MAX   512

Definition at line 4 of file rz_spaces.h.

Typedef Documentation

◆ RzSpace

typedef struct rz_space_t RzSpace

◆ RzSpaceEvent

◆ RzSpaceIter

Definition at line 104 of file rz_spaces.h.

◆ RzSpaces

typedef struct rz_spaces_t RzSpaces

Enumeration Type Documentation

◆ RzSpaceEventType

Enumerator
RZ_SPACE_EVENT_COUNT 
RZ_SPACE_EVENT_RENAME 
RZ_SPACE_EVENT_UNSET 

Definition at line 33 of file rz_spaces.h.

33  {
RzSpaceEventType
Definition: rz_spaces.h:33
@ RZ_SPACE_EVENT_COUNT
Definition: rz_spaces.h:34
@ RZ_SPACE_EVENT_RENAME
Definition: rz_spaces.h:35
@ RZ_SPACE_EVENT_UNSET
Definition: rz_spaces.h:36

Function Documentation

◆ rz_serialize_spaces_load()

RZ_API bool rz_serialize_spaces_load ( RZ_NONNULL Sdb db,
RZ_NONNULL RzSpaces spaces,
bool  load_name,
RZ_NULLABLE RzSerializeResultInfo res 
)
Parameters
load_namewhether to overwrite the name in spaces with the value from db

Definition at line 54 of file serialize_spaces.c.

54  {
55  if (load_name) {
56  char *old_name = (char *)spaces->name;
57  spaces->name = sdb_get(db, KEY_NAME, NULL);
58  if (!spaces->name) {
59  spaces->name = old_name;
60  RZ_SERIALIZE_ERR(res, "failed to get spaces name from db");
61  return false;
62  }
63  free(old_name);
64  }
65 
67 
68  Sdb *db_spaces = sdb_ns(db, KEY_SPACES, false);
69  if (!db_spaces) {
70  RZ_SERIALIZE_ERR(res, "failed to get spaces sub-namespace");
71  return false;
72  }
73  sdb_foreach(db_spaces, foreach_space_cb, spaces);
74 
75  char *stack_json_str = sdb_get(db, KEY_SPACESTACK, NULL);
76  if (!stack_json_str) {
77  RZ_SERIALIZE_ERR(res, "spacestack is missing");
78  return false;
79  }
80 
81  bool ret = true;
82  RzJson *stack_json = rz_json_parse(stack_json_str);
83  if (!stack_json) {
84  RZ_SERIALIZE_ERR(res, "failed to parse stackspace json");
85  ret = false;
86  goto beach;
87  }
88  if (stack_json->type != RZ_JSON_ARRAY) {
89  RZ_SERIALIZE_ERR(res, "stackspace json is not an array");
90  ret = false;
91  goto beach;
92  }
93  RzJson *stack_element;
94  for (stack_element = stack_json->children.first; stack_element; stack_element = stack_element->next) {
95  if (stack_element->type != RZ_JSON_STRING) {
96  RZ_SERIALIZE_ERR(res, "stackspace element is not a string");
97  ret = false;
98  goto beach;
99  }
100  RzSpace *space = rz_spaces_get(spaces, stack_element->str_value);
101  rz_list_append(spaces->spacestack, space ? space->name : "*");
102  }
103 
104  rz_spaces_pop(spaces); // current is the top stack element, pop it
105 
106 beach:
107  rz_json_free(stack_json);
108  free(stack_json_str);
109  return ret;
110 }
#define NULL
Definition: cris-opc.c:27
RZ_API void Ht_() free(HtName_(Ht) *ht)
Definition: ht_inc.c:130
const char * spaces(int count)
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
Definition: list.c:288
RZ_API Sdb * sdb_ns(Sdb *s, const char *name, int create)
Definition: ns.c:186
@ RZ_JSON_ARRAY
Definition: rz_json.h:31
@ RZ_JSON_STRING
Definition: rz_json.h:32
RZ_API RzJson * rz_json_parse(char *text)
Definition: json_parser.c:382
RZ_API void rz_json_free(RzJson *js)
Definition: json_parser.c:45
#define RZ_SERIALIZE_ERR(res,...)
Push an error to the local RzSerializeResultInfo \res RzSerializeInfoResult *.
Definition: rz_serialize.h:33
RZ_API RzSpace * rz_spaces_get(RzSpaces *sp, const char *name)
Definition: spaces.c:82
RZ_API bool rz_spaces_pop(RzSpaces *sp)
Definition: spaces.c:185
RZ_API void rz_spaces_purge(RzSpaces *sp)
Definition: spaces.c:70
RZ_API char * sdb_get(Sdb *s, const char *key, ut32 *cas)
Definition: sdb.c:290
RZ_API bool sdb_foreach(Sdb *s, SdbForeachCallback cb, void *user)
Definition: sdb.c:758
#define KEY_SPACESTACK
static bool foreach_space_cb(void *user, const char *k, const char *v)
#define KEY_SPACES
#define KEY_NAME
struct rz_json_t::@304::@307 children
const char * str_value
Definition: rz_json.h:42
struct rz_json_t * next
Definition: rz_json.h:56
RzJsonType type
Definition: rz_json.h:39
char * name
Definition: rz_spaces.h:29
Definition: sdb.h:63

References rz_json_t::children, foreach_space_cb(), free(), KEY_NAME, KEY_SPACES, KEY_SPACESTACK, rz_space_t::name, rz_json_t::next, NULL, RZ_JSON_ARRAY, rz_json_free(), rz_json_parse(), RZ_JSON_STRING, rz_list_append(), RZ_SERIALIZE_ERR, rz_spaces_get(), rz_spaces_pop(), rz_spaces_purge(), sdb_foreach(), sdb_get(), sdb_ns(), spaces(), rz_json_t::str_value, and rz_json_t::type.

Referenced by rz_serialize_analysis_meta_load(), and rz_serialize_flag_load().

◆ rz_serialize_spaces_save()

RZ_API void rz_serialize_spaces_save ( RZ_NONNULL Sdb db,
RZ_NONNULL RzSpaces spaces 
)

Definition at line 22 of file serialize_spaces.c.

22  {
23  sdb_set(db, KEY_NAME, spaces->name, 0);
24 
25  PJ *j = pj_new();
26  if (!j) {
27  return;
28  }
29  pj_a(j);
31  char *spacename;
32  rz_list_foreach (spaces->spacestack, iter, spacename) {
33  pj_s(j, spacename);
34  }
35  pj_s(j, spaces->current ? spaces->current->name : "*"); // push current manually, will be popped on load
36  pj_end(j);
37  sdb_set(db, KEY_SPACESTACK, pj_string(j), 0);
38  pj_free(j);
39 
40  Sdb *db_spaces = sdb_ns(db, KEY_SPACES, true);
41  RBIter rbiter;
42  RzSpace *space;
43  rz_rbtree_foreach (spaces->spaces, rbiter, space, RzSpace, rb) {
44  sdb_set(db_spaces, space->name, "s", 0);
45  }
46 }
RZ_API PJ * pj_new(void)
Definition: pj.c:25
RZ_API PJ * pj_end(PJ *j)
Definition: pj.c:87
RZ_API const char * pj_string(PJ *pj)
Definition: pj.c:57
RZ_API void pj_free(PJ *j)
Definition: pj.c:34
RZ_API PJ * pj_s(PJ *j, const char *k)
Definition: pj.c:197
RZ_API PJ * pj_a(PJ *j)
Definition: pj.c:81
#define rz_rbtree_foreach(root, it, data, struc, rb)
Definition: rz_rbtree.h:101
RZ_API int sdb_set(Sdb *s, const char *key, const char *val, ut32 cas)
Definition: sdb.c:611
Definition: rz_pj.h:12

References KEY_NAME, KEY_SPACES, KEY_SPACESTACK, rz_space_t::name, pj_a(), pj_end(), pj_free(), pj_new(), pj_s(), pj_string(), rz_rbtree_foreach, sdb_ns(), sdb_set(), and spaces().

Referenced by rz_serialize_analysis_meta_save(), and rz_serialize_flag_save().

◆ rz_spaces_add()

RZ_API RzSpace* rz_spaces_add ( RzSpaces sp,
const char *  name 
)

Definition at line 96 of file spaces.c.

96  {
98  if (!name || !*name || *name == '*') {
99  return NULL;
100  }
101 
103  if (s) {
104  return s;
105  }
106 
107  s = RZ_NEW0(RzSpace);
108  if (!s) {
109  return NULL;
110  }
111 
112  s->name = strdup(name);
113  if (!s->name) {
114  free(s);
115  return NULL;
116  }
117 
118  rz_rbtree_insert(&sp->spaces, s, &s->rb, space_cmp, NULL);
119  return s;
120 }
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
static RzSocket * s
Definition: rtr.c:28
#define rz_return_val_if_fail(expr, val)
Definition: rz_assert.h:108
RZ_API bool rz_rbtree_insert(RBNode **root, void *data, RBNode *node, RBComparator cmp, void *user)
Returns true if the node was inserted successfully.
Definition: rbtree.c:291
#define RZ_NEW0(x)
Definition: rz_types.h:284
RZ_API RzSpace * rz_spaces_get(RzSpaces *sp, const char *name)
Definition: spaces.c:82
static int space_cmp(const void *incoming, const RBNode *rb, void *user)
Definition: spaces.c:90
Definition: z80asm.h:102
static int sp
Definition: z80asm.c:91

References free(), NULL, RZ_NEW0, rz_rbtree_insert(), rz_return_val_if_fail, rz_spaces_get(), s, sp, space_cmp(), and strdup().

Referenced by foreach_space_cb(), rz_meta_space_handler(), and rz_spaces_set().

◆ rz_spaces_count()

RZ_API int rz_spaces_count ( RzSpaces sp,
const char *  name 
)

Definition at line 167 of file spaces.c.

167  {
169  if (!s) {
170  return 0;
171  }
172  RzSpaceEvent ev = { .data.count.space = s, .res = 0 };
173  rz_event_send(sp->event, RZ_SPACE_EVENT_COUNT, &ev);
174  return ev.res;
175 }
RZ_API void rz_event_send(RzEvent *ev, int type, void *data)
Definition: event.c:115
struct rz_space_event_t::@311::@312 count
union rz_space_event_t::@311 data

References rz_space_event_t::count, rz_space_event_t::data, rz_space_event_t::res, rz_event_send(), RZ_SPACE_EVENT_COUNT, rz_spaces_get(), s, and sp.

Referenced by rz_core_spaces_print().

◆ rz_spaces_current()

static RzSpace* rz_spaces_current ( RzSpaces sp)
inlinestatic

◆ rz_spaces_current_name()

static const char* rz_spaces_current_name ( RzSpaces sp)
inlinestatic

Definition at line 95 of file rz_spaces.h.

95  {
96  return sp->current ? sp->current->name : "*";
97 }

References sp.

Referenced by rz_core_spaces_print().

◆ rz_spaces_fini()

RZ_API void rz_spaces_fini ( RzSpaces sp)

Definition at line 59 of file spaces.c.

59  {
60  rz_list_free(sp->spacestack);
61  sp->spacestack = NULL;
63  sp->spaces = NULL;
64  rz_event_free(sp->event);
65  sp->event = NULL;
66  sp->current = NULL;
67  RZ_FREE(sp->name);
68 }
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
Definition: list.c:137
RZ_API void rz_event_free(RzEvent *ev)
Definition: event.c:37
RZ_API void rz_rbtree_free(RZ_NULLABLE RBNode *root, RBNodeFree freefn, void *user)
Definition: rbtree.c:281
#define RZ_FREE(x)
Definition: rz_types.h:369
static void space_node_free(RBNode *n, void *user)
Definition: spaces.c:54

References NULL, rz_event_free(), RZ_FREE, rz_list_free(), rz_rbtree_free(), sp, and space_node_free().

Referenced by rz_analysis_free(), rz_flag_free(), rz_flag_unset_all(), rz_spaces_free(), and rz_spaces_init().

◆ rz_spaces_free()

RZ_API void rz_spaces_free ( RzSpaces sp)

Definition at line 42 of file spaces.c.

42  {
44  free(sp);
45 }
RZ_API void rz_spaces_fini(RzSpaces *sp)
Definition: spaces.c:59

References free(), rz_spaces_fini(), and sp.

◆ rz_spaces_get()

RZ_API RzSpace* rz_spaces_get ( RzSpaces sp,
const char *  name 
)

Definition at line 82 of file spaces.c.

82  {
83  if (!name) {
84  return NULL;
85  }
86  RBNode *n = rz_rbtree_find(sp->spaces, (void *)name, name_space_cmp, NULL);
87  return n ? container_of(n, RzSpace, rb) : NULL;
88 }
int n
Definition: mipsasm.c:19
RZ_API RBNode * rz_rbtree_find(RBNode *root, void *data, RBComparator cmp, void *user)
Definition: rbtree.c:267
#define container_of(ptr, type, member)
Definition: rz_types.h:650
static int name_space_cmp(const void *incoming, const RBNode *rb, void *user)
Definition: spaces.c:77

References container_of, n, name_space_cmp(), NULL, rz_rbtree_find(), and sp.

Referenced by meta_load_cb(), rz_core_reg_set_by_role_or_name(), rz_serialize_spaces_load(), rz_spaces_add(), rz_spaces_count(), rz_spaces_pop(), rz_spaces_rename(), and spaces_unset_single().

◆ rz_spaces_init()

RZ_API bool rz_spaces_init ( RzSpaces sp,
const char *  name 
)

Definition at line 16 of file spaces.c.

16  {
17  rz_return_val_if_fail(sp && name, false);
18  sp->name = strdup(name);
19  if (!sp->name) {
20  goto fail;
21  }
22 
23  sp->spaces = NULL;
24  sp->current = NULL;
25  sp->spacestack = rz_list_new();
26  if (!sp->spacestack) {
27  goto fail;
28  }
29 
30  sp->event = rz_event_new(sp);
31  if (!sp->event) {
32  goto fail;
33  }
34 
35  return true;
36 
37 fail:
39  return false;
40 }
RZ_API RZ_OWN RzList * rz_list_new(void)
Returns a new initialized RzList pointer (free method is not initialized)
Definition: list.c:235
RZ_API RzEvent * rz_event_new(void *user)
Definition: event.c:17
#define fail(test)
Definition: tests.h:29

References fail, NULL, rz_event_new(), rz_list_new(), rz_return_val_if_fail, rz_spaces_fini(), sp, and strdup().

Referenced by new_spaces(), rz_analysis_new(), and rz_spaces_new().

◆ rz_spaces_is_empty()

static bool rz_spaces_is_empty ( RzSpaces sp)
inlinestatic

Definition at line 99 of file rz_spaces.h.

99  {
100  RBIter it = rz_rbtree_first(sp->spaces);
101  return it.len == 0;
102 }
RZ_API RBIter rz_rbtree_first(RBNode *root)
Definition: rbtree.c:340

References rz_rb_iter_t::len, rz_rbtree_first(), and sp.

◆ rz_spaces_new()

RZ_API RzSpaces* rz_spaces_new ( const char *  name)

Definition at line 7 of file spaces.c.

7  {
9  if (!sp || !rz_spaces_init(sp, name)) {
10  free(sp);
11  return NULL;
12  }
13  return sp;
14 }
RZ_API bool rz_spaces_init(RzSpaces *sp, const char *name)
Definition: spaces.c:16

References free(), NULL, RZ_NEW0, rz_spaces_init(), and sp.

◆ rz_spaces_pop()

RZ_API bool rz_spaces_pop ( RzSpaces sp)

Definition at line 185 of file spaces.c.

185  {
186  char *name = rz_list_pop(sp->spacestack);
187  if (!name) {
188  return false;
189  }
190 
192  rz_spaces_set(sp, s ? s->name : NULL);
193  return true;
194 }
RZ_API RZ_OWN void * rz_list_pop(RZ_NONNULL RzList *list)
Removes and returns the last element of the list.
Definition: list.c:376
RZ_API RzSpace * rz_spaces_set(RzSpaces *sp, const char *name)
Definition: spaces.c:122

References NULL, rz_list_pop(), rz_spaces_get(), rz_spaces_set(), s, and sp.

Referenced by rz_core_bin_apply_symbols(), and rz_serialize_spaces_load().

◆ rz_spaces_purge()

RZ_API void rz_spaces_purge ( RzSpaces sp)

Definition at line 70 of file spaces.c.

70  {
71  sp->current = NULL;
72  rz_list_purge(sp->spacestack);
74  sp->spaces = NULL;
75 }
RZ_API void rz_list_purge(RZ_NONNULL RzList *list)
Empties the list without freeing the list pointer.
Definition: list.c:120

References NULL, rz_list_purge(), rz_rbtree_free(), sp, and space_node_free().

Referenced by rz_serialize_spaces_load().

◆ rz_spaces_push()

RZ_API bool rz_spaces_push ( RzSpaces sp,
const char *  name 
)

Definition at line 177 of file spaces.c.

177  {
178  rz_return_val_if_fail(sp, false);
179 
180  rz_list_push(sp->spacestack, sp->current ? sp->current->name : "*");
182  return true;
183 }
RZ_API RZ_BORROW RzListIter * rz_list_push(RZ_NONNULL RzList *list, void *item)
Alias for rz_list_append.
Definition: list.c:60

References rz_list_push(), rz_return_val_if_fail, rz_spaces_set(), and sp.

Referenced by rz_core_bin_apply_symbols().

◆ rz_spaces_rename()

RZ_API bool rz_spaces_rename ( RzSpaces sp,
const char *  oname,
const char *  nname 
)

Definition at line 196 of file spaces.c.

196  {
197  if (!oname && !sp->current) {
198  return false;
199  }
200 
201  RzSpace *s;
202  if (oname) {
203  s = rz_spaces_get(sp, oname);
204  if (!s) {
205  return false;
206  }
207  } else {
208  s = sp->current;
209  }
210 
211  RzSpace *sn = rz_spaces_get(sp, nname);
212  if (sn) {
213  return false;
214  }
215 
216  RzSpaceEvent ev = {
217  .data.rename.oldname = s->name,
218  .data.rename.newname = nname,
219  .data.rename.space = s
220  };
221  rz_event_send(sp->event, RZ_SPACE_EVENT_RENAME, &ev);
222 
223  rz_rbtree_delete(&sp->spaces, (void *)s->name, name_space_cmp, NULL, NULL, NULL);
224  free(s->name);
225  s->name = strdup(nname);
226  rz_rbtree_insert(&sp->spaces, s, &s->rb, space_cmp, NULL);
227 
228  return true;
229 }
RZ_API bool rz_rbtree_delete(RBNode **root, void *data, RBComparator cmp, void *cmp_user, RBNodeFree freefn, void *free_user)
Returns true if a node with an equal key is deleted.
Definition: rbtree.c:263
struct rz_space_event_t::@311::@314 rename

References rz_space_event_t::data, free(), name_space_cmp(), NULL, rz_space_event_t::rename, rz_event_send(), rz_rbtree_delete(), rz_rbtree_insert(), RZ_SPACE_EVENT_RENAME, rz_spaces_get(), s, sp, space_cmp(), and strdup().

Referenced by rz_meta_space_rename_handler().

◆ rz_spaces_set()

RZ_API RzSpace* rz_spaces_set ( RzSpaces sp,
const char *  name 
)

Definition at line 122 of file spaces.c.

122  {
123  sp->current = rz_spaces_add(sp, name);
124  return sp->current;
125 }
RZ_API RzSpace * rz_spaces_add(RzSpaces *sp, const char *name)
Definition: spaces.c:96

References rz_spaces_add(), and sp.

Referenced by rz_spaces_pop(), and rz_spaces_push().

◆ rz_spaces_unset()

RZ_API bool rz_spaces_unset ( RzSpaces sp,
const char *  name 
)

Definition at line 141 of file spaces.c.

141  {
142  if (name) {
143  return spaces_unset_single(sp, name);
144  }
145 
147  if (!names) {
148  return false;
149  }
150 
151  RBIter it;
152  RzSpace *s;
153  rz_spaces_foreach(sp, it, s) {
154  rz_list_append(names, strdup(s->name));
155  }
156 
157  RzListIter *lit;
158  const char *n;
159  bool res = false;
160  rz_list_foreach (names, lit, n) {
161  res |= spaces_unset_single(sp, n);
162  }
164  return res;
165 }
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
Definition: list.c:248
void(* RzListFree)(void *ptr)
Definition: rz_list.h:11
#define rz_spaces_foreach(sp, it, s)
Definition: rz_spaces.h:105
static bool spaces_unset_single(RzSpaces *sp, const char *name)
Definition: spaces.c:127
Definition: names.h:123

References free(), n, rz_list_append(), rz_list_free(), rz_list_newf(), rz_spaces_foreach, s, sp, spaces_unset_single(), and strdup().

Referenced by rz_meta_space_remove_all_handler(), and rz_meta_space_remove_handler().