|
|
|
@ -78,7 +78,7 @@ find_sexp (const char *name, sexp_t * start)
|
|
|
|
|
sexp_t *bfs_find_sexp(const char *str, sexp_t *sx) {
|
|
|
|
|
sexp_t *t = sx;
|
|
|
|
|
sexp_t *rt;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (sx == NULL) return NULL;
|
|
|
|
|
|
|
|
|
|
while (t != NULL) {
|
|
|
|
@ -88,7 +88,7 @@ sexp_t *bfs_find_sexp(const char *str, sexp_t *sx) {
|
|
|
|
|
return t;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
t = t->next;
|
|
|
|
|
}
|
|
|
|
@ -99,7 +99,7 @@ sexp_t *bfs_find_sexp(const char *str, sexp_t *sx) {
|
|
|
|
|
rt = bfs_find_sexp(str,t->list);
|
|
|
|
|
if (rt != NULL) return rt;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
t = t->next;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -118,7 +118,7 @@ int sexp_list_length(const sexp_t *sx) {
|
|
|
|
|
if (sx->ty == SEXP_VALUE) return 1;
|
|
|
|
|
|
|
|
|
|
t = sx->list;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (t != NULL) {
|
|
|
|
|
len++;
|
|
|
|
|
t = t->next;
|
|
|
|
@ -161,9 +161,9 @@ sexp_t *copy_sexp(const sexp_t *s) {
|
|
|
|
|
sexp_t_deallocate(s_new);
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
s_new->binlength = s->binlength;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (s->bindata == NULL) {
|
|
|
|
|
s_new->bindata = NULL;
|
|
|
|
|
} else {
|
|
|
|
@ -183,7 +183,7 @@ sexp_t *copy_sexp(const sexp_t *s) {
|
|
|
|
|
|
|
|
|
|
memcpy(s_new->bindata,s->bindata,s->binlength*sizeof(char));
|
|
|
|
|
|
|
|
|
|
/* non-binary */
|
|
|
|
|
/* non-binary */
|
|
|
|
|
} else {
|
|
|
|
|
if (s->val == NULL && (s->val_used > 0 || s->val_allocated > 0)) {
|
|
|
|
|
sexp_errno = SEXP_ERR_BADCONTENT;
|
|
|
|
@ -210,13 +210,13 @@ sexp_t *copy_sexp(const sexp_t *s) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
memcpy(s_new->val, s->val, sizeof(char)*s->val_used);
|
|
|
|
|
memcpy(s_new->val, s->val, sizeof(char)*s->val_used);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
s_new->list = copy_sexp(s->list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
s_new->next = copy_sexp(s->next);
|
|
|
|
|
|
|
|
|
|
return s_new;
|
|
|
|
|