mirror of
https://github.com/siemens-mobile-hacks/libpd.git
synced 2026-11-25 23:57:45 +00:00
Add pd_free_node function
This commit is contained in:
parent
05361f271d
commit
97584bdcd1
2 changed files with 7 additions and 0 deletions
6
src/pd.c
6
src/pd.c
|
|
@ -260,6 +260,12 @@ int pd_write_file(const char *file_name, const pd_node_t **nodes) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void pd_free_node(pd_node_t *node) {
|
||||
if (node) {
|
||||
free(node);
|
||||
}
|
||||
}
|
||||
|
||||
void pd_free_nodes(pd_node_t **nodes) {
|
||||
if (nodes) {
|
||||
for (int i = 0; nodes[i] != NULL; i++) {
|
||||
|
|
|
|||
1
src/pd.h
1
src/pd.h
|
|
@ -27,6 +27,7 @@ pd_node_t *pd_alloc_integer_node(const char *group, const char *key, int value);
|
|||
pd_node_t *pd_alloc_string_node(const char *group, const char *key, const char *value);
|
||||
int pd_read_file(const char *file_name, pd_node_t ***nodes);
|
||||
int pd_write_file(const char *file_name, const pd_node_t **nodes);
|
||||
void pd_free_node(pd_node_t *node);
|
||||
void pd_free_nodes(pd_node_t **nodes);
|
||||
|
||||
int pd_get_max_group_size();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue