#include "sexp.h"
Go to the source code of this file.
Defines | |
| #define | hd_sexp(s) ((s)->list) |
| #define | tl_sexp(s) ((s)->list->next) |
| #define | next_sexp(s) ((s)->next) |
| #define | reset_pcont(c) ((c)->lastPos = NULL) |
Functions | |
| sexp_t * | find_sexp (const char *name, sexp_t *start) |
| sexp_t * | bfs_find_sexp (const char *name, sexp_t *start) |
| int | sexp_list_length (const sexp_t *sx) |
| sexp_t * | copy_sexp (const sexp_t *sx) |
A set of routines for operating on s-expressions.
|
|
Return the head of a list s by reference, not copy. |
|
|
Return the element following the argument s. |
|
|
Reset the continuation c by setting the |
|
|
Return the tail of a list s by reference, not copy. |
|
||||||||||||
|
Breadth first search for s-expressions. Depth first search will find the first occurance of a string in an s-expression by basically finding the earliest occurance in the string representation of the expression itself. Breadth first search will find the first occurance of a string in relation to the structure of the expression itself (IE: the instance with the lowest depth will be found).
|
|
|
Copy an s-expression. This is a deep copy - so the resulting s-expression shares no pointers with the original. The new one can be changed without damaging the contents of the original.
|
|
||||||||||||
|
Find an atom in a sexpression data structure and return a pointer to it. Return NULL if the string doesn't occur anywhere as an atom. This is a depth-first search algorithm.
|
|
|
Given an s-expression, determine the length of the list that it encodes. A null expression has length 0. An atom has length 1. A list has length equal to the number of sexp_t elements from the list head to the end of the ->next linked list from that point.
|
1.4.6