|
| void | _initlist (void) |
| void | _addlistitem (void) |
| void | _setlistitem (void) |
| void | rilinkedlistlib_nextlistitem (void) |
| void | _getlistitem (void) |
| void | _prevlistitem (void) |
| void | _firstlistitem (void) |
| void | _lastlistitem (void) |
| void | _addfirstitem (void) |
| void | _addlastitem (void) |
| void | _dellistitem (void) |
| void | _addrlistitem (void) |
| void | _sizeoflistitem (void) |
| void | rilinkedlistlib_libinit (void) |
| void | rilinkedlistlib_libfinit (void) |
| void | listnumchk (void) |
| static ULONG | globalloc (ULONG size) |
| static void | globfree (ULONG mem, ULONG size) |
| static void | copybyte (ULONG src, ULONG dest, ULONG n) |
| static ULONG | getvarsize (ULONG var) |
| static void | c_libinit (void) |
| | init: clears the tables.
|
| static ULONG | c_libfinit (void) |
| | finit: nothing (the lists are not freed).
|
| ULONG | c_sizeoflistitem (ULONG var) |
| | SizeOfListItem(var): the size of a variable as the list commands copy it.
|
| ULONG | c_addrlistitem (ULONG list) |
| | AddrListItem(list#): the address of the current node of a list.
|
| static void | freelist (void) |
| BB_BOOL | c_initlist (ULONG list, ULONG var) |
| | InitList list#,var: start a list with one node holding a copy of var.
|
| BB_BOOL | c_addlistitem (ULONG list) |
| | AddListItem list#: a new empty node behind the current one, then the current one.
|
| BB_BOOL | c_setlistitem (ULONG list, ULONG var) |
| | SetListItem list#,var: a new copy of var for the current node.
|
| BB_BOOL | c_getlistitem (ULONG list, ULONG var) |
| | GetListItem list#,var: copy the current node's data into var.
|
| BB_BOOL | c_nextlistitem (ULONG list) |
| | NextListItem list#: make the next node the current one.
|
| BB_BOOL | c_prevlistitem (ULONG list) |
| | PrevListItem list#: make the previous node the current one.
|
| BB_BOOL | c_firstlistitem (ULONG list) |
| | FirstListItem list#: make the first node the current one.
|
| BB_BOOL | c_lastlistitem (ULONG list) |
| | LastListItem list#: make the last node the current one.
|
| BB_BOOL | c_addlastitem (ULONG list) |
| | AddLastListItem list#: a new empty node at the end (LastListItem, then AddListItem).
|
| BB_BOOL | c_addfirstitem (ULONG list) |
| | AddFirstListItem list#: a new node in front of the first one, then the current one.
|
| BB_BOOL | c_dellistitem (ULONG list) |
| | DelListItem list#: delete the current node; the next (or previous) becomes the current one.
|
| static void | listnumchk_c (ULONG list) |
| | The error check of the commands with a list number (debugger only).
|
| BB_BOOL c_addfirstitem |
( |
ULONG | list | ) |
|
AddFirstListItem list#: a new node in front of the first one, then the current one.
Fixed (#733): without a first node (no list) 0, before anything is allocated; it does not start a list (the manual: "0 indicates failure
(no list/no RAM)"; the original wrote the new node to address 0 and left the last node 0). Fixed (#724): the new node becomes the prev of the old first node (the original wrote it into that node's next: the list became a loop). Fixed (#725): the result is -1, as the manual says (the original returned list# * 4, 0 for list 0). Fixed (#726): prev, pad, data and size of the new node are cleared (the original left them as the allocation, flags 0, left them).
- Parameters
-
- Returns
- d0: BB_TRUE, BB_FALSE without a list or memory
| BB_BOOL c_dellistitem |
( |
ULONG | list | ) |
|
DelListItem list#: delete the current node; the next (or previous) becomes the current one.
It sets the last size to that of the node, which no node takes over since #735 (AddListItem stores 0). Fixed (#729): it reads the node of v0.91 and frees the copy with the node (the original read the node of v0.9: its data was the long at +8, the pad and the upper word of the data pointer, so it freed a wrong address, memlib: "Unable to Free
Memory", and the copy was lost); the only node is not deleted and keeps its copy: 0 (no defect; the original freed the "data" before it looked). Fixed (#728): deleting the first node clears the prev of the node behind it (the original cleared its next: the list ended there).
- Parameters
-
- Returns
- d0: BB_TRUE, BB_FALSE without a current node or for the only node
| BB_BOOL c_getlistitem |
( |
ULONG | list, |
|
|
ULONG | var ) |
GetListItem list#,var: copy the current node's data into var.
Fixed (#733): without a current node (no list) 0 (the original copied from the pointer at address 10). Fixed (#730): it copies the smaller of the variable's size and the node's size field, the rest of a larger variable stays as it is (the original copied as many bytes as the variable has, also what lay behind the copy).
- Parameters
-
| list | d0: list# (0-4) |
| var | d1: the variable (BL_VARPTR) |
- Returns
- d0: BB_TRUE, BB_FALSE without a list or if the node has no data
| BB_BOOL c_initlist |
( |
ULONG | list, |
|
|
ULONG | var ) |
InitList list#,var: start a list with one node holding a copy of var.
The node and the copy are memlib globalloc'ed (flags 0), the copy is made by RIAmosFuncLib's CopyByte; list# is checked by listnumchk (#732), the size as in SizeOfListItem (#736). Fixed (#731): a list that is already there is freed first, its nodes and their copies (the original overwrote the entries: they were lost until the end).
- Parameters
-
| list | d0: list# (0-4) |
| var | d1: the variable (BL_VARPTR) |
- Returns
- d0: BB_TRUE, BB_FALSE if there is no memory (the node is freed again, the list cleared)
| ULONG c_sizeoflistitem |
( |
ULONG | var | ) |
|
SizeOfListItem(var): the size of a variable as the list commands copy it.
The word in front of the variable minus 8 (getvarsize); also sets the "last size" the other commands use. No defect (#736, see the file's head): a word of less than 8 would give almost 4 GB, but no NEWTYPE variable has one; exactly 8 gives a size of 0, for which CopyByte copies nothing (since #492).
- Parameters
-
| var | d0: the variable (BL_VARPTR) |
- Returns
- d0: the size
| void listnumchk_c |
( |
ULONG | list | ) |
|
|
static |
The error check of the commands with a list number (debugger only).
Fixed (#732), not in the original (rilinkedlistlib had no error check area): list# * 4 indexes the tables of five longs without a check, so a list number outside 0..4 made the commands read and write the other tables and the data behind them (the manual: "Do NOT use list numbers
of 5 or higher!"). The release code is unchanged (an invalid argument).
Errors: "List number must be 0 to 4".
- Parameters
-