Go to the source code of this file.
Data Structures | |
struct | _sat_obj_dscr |
A Saturn domain Object descriptor. More... | |
struct | _sat_dir_entry |
A Saturn domain directory entry, modeled for C access. More... | |
struct | _sat_dir_node |
A Saturn doamin directory node, modeled for C access. More... | |
struct | _sat_dir_slist |
A generic string list. More... | |
Defines | |
#define | SAT_CONTEXT 0x8071b |
#define | SAT_USEROB 0x80711 |
#define | sat_dir_getreal(p, v) _sat_dir_fetchreal((p),(v),"g") |
Get real at p(ath) or default v(alue). | |
#define | sat_dir_rclreal(p, v) _sat_dir_fetchreal((p),(v),"r") |
Recall real at p(ath) or default v(alue). | |
Typedefs | |
typedef _sat_obj_dscr | SAT_OBJ_DSCR |
A Saturn domain Object descriptor. | |
typedef _sat_dir_entry | SAT_DIR_ENTRY |
A Saturn domain directory entry, modeled for C access. | |
typedef _sat_dir_node | SAT_DIR_NODE |
A Saturn doamin directory node, modeled for C access. | |
typedef _sat_dir_slist | SAT_DIR_SLIST |
A generic string list. | |
Functions | |
int | sat_skipob (int objaddr) |
int | sat_objgetdir (int objaddr) |
int | sat_dircurrent () |
int | sat_objcurdir () |
int | sat_dirhome () |
int | sat_objhome () |
int | sat_dirfindfirst (int diraddr) |
int | sat_dirfindnext (int diritem) |
int | sat_itemgetdir (int itemaddr) |
int | sat_sknameup (int itemaddr) |
int | sat_sknamedn (int objaddr) |
int | sat_objgetitem (int objptr) |
int | sat_itemgetname (int diritem, char *name) |
SAT_DIR_NODE * | _sat_find_path (char *path) |
Find the internal directory node for path "path". | |
char * | _sat_dir_path (SAT_DIR_NODE *p) |
return a string representation of the path leading to node P | |
SAT_DIR_NODE * | _sat_dir_getroot () |
PRIVATE DON'T CALL. | |
SAT_DIR_NODE * | _sat_dir_getcwd () |
PRIVATE DON'T CALL. | |
void | _sat_dir_destroy_slist (SAT_DIR_SLIST *s) |
Destroy a string list, built by sat_dir_searchobject(). Frees all associated memory. | |
void | _sat_dir_split_path (char *path, char **dir, char **base) |
Split a pathname into dir and base components. Usually not to be called directly. | |
int | _sat_dir_getprolog (SAT_OBJ_DSCR *obj) |
void | sat_dir_open () |
Open (create) the internal directory structures. Not to be called directly! | |
void | sat_dir_close () |
char * | sat_dir_curdir () |
return a string representation of the current (working) directory | |
int | sat_dir_chdir (char *path) |
Change the internal path (not calculator!) to path. | |
SAT_OBJ_DSCR * | sat_dir_getobject (char *path) |
Return a pointer to an object descriptor for object at path. | |
SAT_OBJ_DSCR * | sat_dir_rclobject (char *path) |
Similar to sat_dir_getobject, but with RCL semantics. I.e. if the object is not found in the cureent dir, the search continues up the path towards root. | |
int | sat_dir_searchobject (char *name, SAT_DIR_SLIST **path_list) |
Search for object named "name" down the whole directory tree. | |
int | sat_obj_is_real (SAT_OBJ_DSCR *obj) |
Logical inquiry function, whether an object represents a REAL. | |
double | _sat_dir_fetchreal (char *path, double defval, char *mode) |
Return the double object at path or defval if not found. | |
Variables | |
SAT_DIR_NODE * | __sat_cwd |
SAT_DIR_NODE * | __sat_root |
Definition in file satdir.h.
#define sat_dir_getreal | ( | p, | |||
v | ) | _sat_dir_fetchreal((p),(v),"g") |
#define sat_dir_rclreal | ( | p, | |||
v | ) | _sat_dir_fetchreal((p),(v),"r") |
typedef struct _sat_dir_entry SAT_DIR_ENTRY |
A Saturn domain directory entry, modeled for C access.
Directory entries are records consisting of a pointer to an Object descriptor, and a linked list pointer to all directory elements.
typedef struct _sat_dir_entry { SAT_OBJ_DSCR *sat_obj; struct _sat_dir_entry *next; } SAT_DIR_ENTRY;
typedef struct _sat_dir_node SAT_DIR_NODE |
A Saturn doamin directory node, modeled for C access.
The Saturn domain directory is modeled as a n-ary tree, which is recursively defined with three pointers. parent for climbing up the hierarchy towards root, sibling for a chained list of directories on the same level and child for the next subtree beneath the current folder.
typedef struct _sat_dir_node { char *name; truct _sat_dir_node *parent,*sibling,*child; struct _sat_dir_entry *object; } SAT_DIR_NODE;
typedef struct _sat_dir_slist SAT_DIR_SLIST |
A generic string list.
typedef struct _sat_dir_slist { char *str; struct _sat_dir_slist *next; } SAT_DIR_SLIST;
typedef struct _sat_obj_dscr SAT_OBJ_DSCR |
A Saturn domain Object descriptor.
typedef struct _sat_obj_dscr { char *name; unsigned addr; } SAT_OBJ_DSCR;
void _sat_dir_destroy_slist | ( | SAT_DIR_SLIST * | s | ) |
Destroy a string list, built by sat_dir_searchobject(). Frees all associated memory.
s | Pointer to string list |
double _sat_dir_fetchreal | ( | char * | path, | |
double | defval, | |||
char * | mode | |||
) |
Return the double object at path or defval if not found.
path | The path to the object | |
defval | A default value to be returned, if not found | |
mode | A string "g" (get) or "r" (recall), describing the fetch semantics |
SAT_DIR_NODE* _sat_dir_getcwd | ( | ) |
PRIVATE DON'T CALL.
int _sat_dir_getprolog | ( | SAT_OBJ_DSCR * | obj | ) |
SAT_DIR_NODE* _sat_dir_getroot | ( | ) |
PRIVATE DON'T CALL.
char * _sat_dir_path | ( | SAT_DIR_NODE * | p | ) |
return a string representation of the path leading to node P
void _sat_dir_split_path | ( | char * | path, | |
char ** | dir, | |||
char ** | base | |||
) |
Split a pathname into dir and base components. Usually not to be called directly.
path | A string, representing a path | |
dir | Address of pointer for the directory oart | |
base | Address of pointer of the filename part |
SAT_DIR_NODE * _sat_find_path | ( | char * | path | ) |
Find the internal directory node for path "path".
DON'T CALL EXPLICITLY
int sat_dir_chdir | ( | char * | path | ) |
Change the internal path (not calculator!) to path.
void sat_dir_close | ( | ) |
char * sat_dir_curdir | ( | ) |
return a string representation of the current (working) directory
SAT_OBJ_DSCR * sat_dir_getobject | ( | char * | path | ) |
Return a pointer to an object descriptor for object at path.
path | Path to the object |
sat_dir_open | ( | ) |
Open (create) the internal directory structures. Not to be called directly!
SAT_OBJ_DSCR * sat_dir_rclobject | ( | char * | path | ) |
Similar to sat_dir_getobject, but with RCL semantics. I.e. if the object is not found in the cureent dir, the search continues up the path towards root.
path | Path to the object |
int sat_dir_searchobject | ( | char * | name, | |
SAT_DIR_SLIST ** | res | |||
) |
Search for object named "name" down the whole directory tree.
name | The object's name | |
path_list | Address of a pointer to a string list |
int sat_dircurrent | ( | ) |
int sat_dirfindfirst | ( | int | diraddr | ) |
int sat_dirfindnext | ( | int | diritem | ) |
int sat_dirhome | ( | ) |
int sat_itemgetdir | ( | int | itemaddr | ) |
int sat_itemgetname | ( | int | diritem, | |
char * | name | |||
) |
int sat_obj_is_real | ( | SAT_OBJ_DSCR * | obj | ) |
Logical inquiry function, whether an object represents a REAL.
obj | Pointer to an Object descriptor |
int sat_objcurdir | ( | ) |
int sat_objgetdir | ( | int | objaddr | ) |
int sat_objgetitem | ( | int | objptr | ) |
int sat_objhome | ( | ) |
int sat_skipob | ( | int | objaddr | ) |
int sat_sknamedn | ( | int | objaddr | ) |
int sat_sknameup | ( | int | itemaddr | ) |