aboutsummaryrefslogtreecommitdiff
path: root/src/NodeSearch.c
blob: 0a362156e99ce066f05c2c5fbb87da4fdb6925a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "../include/quickmedia/NodeSearch.h"
#include <stdlib.h>

void quickmedia_node_search_param_init(QuickMediaNodeSearchParam *self) {
    self->name = NULL;
    self->value = NULL;
    self->defined = 0;
}

static void quickmedia_node_search_param_deinit(QuickMediaNodeSearchParam *self) {
    free(self->name);
    free(self->value);
    self->name = NULL;
    self->value = NULL;
}

void quickmedia_node_search_init(QuickMediaNodeSearch *self) {
    self->name = NULL;
    self->recursive = 0;
    quickmedia_node_search_param_init(&self->param);
    self->child = NULL;
}

void quickmedia_node_search_deinit(QuickMediaNodeSearch *self) {
    free(self->name);
    self->name = NULL;
    quickmedia_node_search_param_deinit(&self->param);
    
    if(self->child) {
        quickmedia_node_search_deinit(self->child);
        free(self->child);
        self->child = NULL;
    }
}