Go to the source code of this file.
|
void | delete_list (atom_t a) |
| deletes list atom More...
|
|
atom_t | new_list (atom_t car, atom_t cdr) |
| creates a new list atom More...
|
|
atom_t | new_list_ex (atom_t car, atom_t cdr) |
| creates a new extended list atom More...
|
|
void | dump_list (atom_t a, int level) |
| dumps list atom More...
|
|
void | append (atom_t element, atom_t *first, atom_t *last) |
| appends atom to list More...
|
|
void | append_ex (atom_t element, atom_t *first, atom_t *last) |
| appends atom to extended node of a list More...
|
|
atom_t | copy_append (atom_t list, atom_t element) |
| creates a copy of list and append element to end More...
|
|
atom_t | behead (atom_t a) |
| removes the head of a list More...
|
|
int | list_length (atom_t a) |
| returns count of list elements More...
|
|
atom_t | list_copy_n (atom_t a, unsigned int n) |
| copies a list, but no more than n elents More...
|
|
atom_t | list_copy_but_last (atom_t a) |
| copies a list, but without last element More...
|
|
atom_t | get_at_list (atom_t a, int n) |
| returns element at specified position in list More...
|
|
- Parameters
-
Deletes the first node of list atom and its data. If needed deleted the next nodes.
Definition at line 72 of file lists.c.
99 #if defined DEBUG_ATOM || defined DEBUG_ATOM_LIST
100 printf(
"<ATOM> [%08x] ref-1\n",(
int)a);
102 if( --
REF(a) )
return;
- Parameters
-
car | value associated with the new list node |
cdr | next node of the list |
- Returns
- list atom
Creates a list atom with reference count 1. The reference counts of car
and cdr
are not changed.
Definition at line 125 of file lists.c.
140 #if defined DEBUG_ATOM || defined DEBUG_ATOM_LIST
143 printf(
"<ATOM> [%08x] list=[%08x]",(
int)a,(
int)car);
144 printf(
" CAR=");
dumpln(car);
147 printf(
"<ATOM> [%08x] list=[%08x %08x]\n",(
int)a,(
int)car,(
int)cdr);
157 #ifdef DEBUG_RUNTIME_ATOMS
161 dump_atom_address( a );
166 #ifdef DEBUG_COMPILETIME_ATOMS
170 dump_atom_address( a );
- Parameters
-
car | value associated with the new list node |
cdr | next node of the list |
- Returns
- list atom
Creates an extended list atom with reference count 1. The reference counts of car
and cdr
are not changed. The code should be the same as new_list() except that the extended pool is used, and the POS field is set to unbound
Definition at line 195 of file lists.c.
212 #if defined DEBUG_ATOM || defined DEBUG_ATOM_LIST
214 printf(
"<ATOMX> [%08x] list=[%08x]\n",(
int)a,(
int)car);
216 printf(
"<ATOMX> [%08x] list=[%08x %08x]\n",(
int)a,(
int)car,(
int)cdr);
226 #ifdef DEBUG_RUNTIME_ATOMS
230 dump_atom_address( a );
235 #ifdef DEBUG_COMPILETIME_ATOMS
239 dump_atom_address( a );
- Parameters
-
a | atom to dump |
level | dump level |
Dumps list atom through the current outter function.
Definition at line 259 of file lists.c.
268 #define DUMP_BUF_SIZE 4
274 #ifdef DEBUG_REF_COUNT
315 #ifdef DEBUG_REF_COUNT
339 #ifdef DEBUG_LIST_FLAGS
348 #endif // DEBUG_LIST_FLAGS
349 #ifdef DEBUG_LIST_TOKEN_FLAGS
357 #endif // DEBUG_LIST_FLAGS
- Parameters
-
element | atom to be appended |
first | first node of the list |
last | last node of the list |
Appends atom element
to the end of the list starting with atom first
and ending with atom last
. If first
and last
are empty a new list will be created. All reference counts are kept unchanged.
Definition at line 397 of file lists.c.
- Parameters
-
element | atom to be appended |
first | first node of the list |
last | last node of the list |
Appends atom element
to the end of the list starting with atom first
and ending with atom last
. If first
and last
are empty a new list will be created. All reference counts are kept unchanged. The new node is created as extended atom.
Definition at line 424 of file lists.c.
- Parameters
-
element | atom to be appended |
list | list to be copied |
Creates a copy of list
and append element
to it
Definition at line 446 of file lists.c.
- Parameters
-
- Returns
- the list without its head
Removes and deuses the head of a list and returns list's buthead. This functionality is useful for descructive iteration over a list.
Definition at line 484 of file lists.c.
- Parameters
-
- Returns
- the number of elements of list
Returns number of elements in the list.
Definition at line 501 of file lists.c.
- Parameters
-
a | list |
n | max number of elements to be copied |
- Returns
- the new copy of the list
Copies list, but no more than n
elements. New list contains same data - only CDR-s are copied.
Definition at line 527 of file lists.c.
- Parameters
-
- Returns
- the new copied list
Copies list, but without its last element. Linearly
Definition at line 562 of file lists.c.
- Parameters
-
- Returns
- element at position or last if position is -1
Returns element at specified position in the list. If position is negative returns last element in the list
Definition at line 603 of file lists.c.
int print_width_limit = -1 |
int print_depth_limit = -1 |