Data Structures | |
struct | DirItem |
A C structure for creating directories. More... | |
Functions | |
SatAddr | DIRfirstEntry (SatAddr dir) |
Get the first entry in a directory. | |
SatAddr | DIRnextEntry (SatAddr entry) |
Get the next entry in a directory. | |
bool | DIRdecodeEntry (SatAddr entry, char *name, SatAddr *obj) |
Decode a directory entry. | |
int | DIRentryNameLen (SatAddr entry) |
SatAddr | DIRfindEntryByName (SatAddr dir, const char *name) |
Find a directory entry by name. | |
SatAddr | DIRfindEntryByIdnt (SatAddr dir, SatAddr idnt) |
Find a directory entry from an IDNT object. | |
SatAddr | DIRfindObByName (SatAddr dir, const char *name) |
find a directory object by name. | |
SatAddr | DIRfindObByIdnt (SatAddr dir, SatAddr idnt) |
find a directory object from an IDNT object | |
void | DIRinit (SatAddr dst) |
Create an empty directory. | |
SatAddr | makeDIR (int nibbles) |
Make an empty directory with "nibbles" nibbles of free space. | |
bool | DIRadd (SatAddr src, const char *name, SatAddr obj) |
Add an entry to a DIR. | |
DirItem * | DIRdecode (SatAddr src) |
Decode an entire directory. | |
SatAddr | DIRencode (struct DirItem *head, SatAddr dst) |
Encode an entire directory. | |
int | DIRchangeByName (SatAddr dir, const char *name, SatAddr obj) |
Overwrite the variable in a directory with an object of the same size. | |
int | DIRchangeByIdnt (SatAddr dir, SatAddr idnt, SatAddr obj) |
Same as DIRchangeByName(), but uses a global identifier object (idnt) to lookup the name. | |
int | DIRnibbles (SatAddr dir) |
Return the size in nibbles of the DIR at src. | |
SatAddr | DIRdirForEntry (SatAddr entry) |
Get the DIR object that a encloses a directory entry. | |
SatAddr | DIRparentDir (SatAddr dir) |
Get the parent of a directory. | |
SatAddr | getHOME () |
Get the Saturn address of the HOME directory. | |
SatAddr | getCWD () |
Get the Saturn address of the current directory. | |
bool | isDIR (SatAddr src) |
is the object at src a DIR? |
Add an entry to a DIR.
The DIR must have enough space for the new entry.
src | The DIR object to add to | |
name | Null-terminated string of the new entry's name | |
obj | Saturn address if the object. The object will be copied to the directory. |
Overwrite the variable in a directory with an object of the same size.
dir | Saturn address of a DIR object. | |
name | null-terminated string containing the name of the directory entry to change. | |
obj | Saturn address of the replacement object. This object must be the same size as the existing object associated with "name." |
Decode an entire directory.
src | The DIR object to decode |
Decode a directory entry.
entry | The directory entry, which is the return value from a previous call to DIRfirstEntry() or DIRnextEntry() | |
name | If non-null then the name of the directory entry will be stored here as a null-terminated string. Name must point to enough space to store the name. 256 bytes is always enough. You can also use DIRentryNameLen() to get the exact length | |
obj | If non-null, then the Saturn address of the DIR entry's object will be stored here. |
Get the DIR object that a encloses a directory entry.
entry | Saturn address of a directory entry returned by DIRfirstEntry(), DIRnextEntry(), DIRfindEntryByIdnt(), etc |
Encode an entire directory.
head | Pointer to a DirItem list that represents the items to go in the directory. | |
dst | The Saturn address where the DIR should be stored. If dst is zero (the expected case) then space is allocated for the DIR in tempOb. Otherwise dst must point to sufficient space for the DIR. |
int DIRentryNameLen | ( | SatAddr | entry | ) |
Get the number of characters in a directory entry name
entry | The directory entry, which is the return value from a previous call to DIRfirstEntry() or DIRnextEntry() |
Find a directory entry from an IDNT object.
dir | A DIR object | |
idnt | Saturn address of an IDNT object (a global identifier) |
Find a directory entry by name.
dir | A DIR object | |
name | A null-terminated string that is the name to find. |
find a directory object from an IDNT object
This is like DIRfindEntryByIdnt, except it returns the Saturn address of the object in the entry, not just the entry.
find a directory object by name.
This is like DIRfindEntryByName, except it returns the Saturn address of the object in the entry, not just the entry.
Get the first entry in a directory.
dir | Saturn address of a DIR object |
void DIRinit | ( | SatAddr | dst | ) |
Create an empty directory.
dst | Saturn address where the directory should go. |
Get the next entry in a directory.
entry | The return value from a previous call to DIRfirstEntry() or DIRnextEntry() |
int DIRnibbles | ( | SatAddr | dir | ) |
Return the size in nibbles of the DIR at src.
src | the Saturn address of a DIR object |
Get the parent of a directory.
dir | Saturn address of a DIR object |
bool isDIR | ( | SatAddr | src | ) |
is the object at src a DIR?
src | Saturn address of an object |
SatAddr makeDIR | ( | int | nibbles | ) |
Make an empty directory with "nibbles" nibbles of free space.
nibbles | the number of nibbles to allocate |