|
BB2 C port
API reference: Blitz libraries in C and the shared code
|
Data Structures | |
| struct | regstructure |
Functions | |
| void | _isregistryopen (void) |
| void | _lockregistry (void) |
| void | _unlockregistry (void) |
| void | _setregistrybaselibrary (void) |
| void | _existsregistrylibrary (void) |
| void | _getlibraryvalue (void) |
| void | _getregistryvariable (void) |
| void | _setregistryvariable (void) |
| void | _setregistryvariable2 (void) |
| void | _changeregistryvariable (void) |
| void | _newregistrylibrary (void) |
| void | _newregistrylibrary2 (void) |
| void | _parseregistrylibrary (void) |
| void | _nextparseitem (void) |
| void | _changeregistryaccess (void) |
| void | _deleteregistrylibrary (void) |
| void | _deleteregistryvariable (void) |
| void | _numregistrylibraryvariables (void) |
| void | _saveregistrylibrary (void) |
| void | _loadregistrylibrary (void) |
| void | _getregistrystringvariable (void) |
| void | _setregistryboolvariable (void) |
| void | _parseitemname (void) |
| void | _parseitemvalue (void) |
| void | _getregistryboolvariable (void) |
| void | _setregistryintvariable (void) |
| void | _getregistryintvariable (void) |
| void | _deleteregistrylibraryvariables (void) |
| void | _setlibraryvalue (void) |
| void | _setregistryvariableindex (void) |
| void | _renameregistryvariable (void) |
| void | _savelibraryvariables (void) |
| void | _renameregistrylibrary (void) |
| void | _insertnewregistrylibrary (void) |
| void | _insertnewregistrylibrary2 (void) |
| void | _getstructurevariables (void) |
| void | _freestructurevariables (void) |
| void | _loadlibraryvariables (void) |
| void | riregistrylib_libinit (void) |
| void | riregistrylib_libfinit (void) |
| static ULONG | regjsr (WORD off, ULONG a0, ULONG d0, ULONG d1, ULONG d2, ULONG a1, ULONG a2, ULONG a3, ULONG a4) |
| static ULONG | calllib (WORD off, ULONG d0, ULONG d1, ULONG d2, ULONG a1, ULONG a2, ULONG a3, ULONG a4) |
| static ULONG | retstring (const UBYTE *s) |
| static ULONG | returnstring (void) |
| static void | libinit_c (void) |
| init: opens registry.library (any version). | |
| static void | libfinit_c (void) |
| finit: unlocks every structure still locked, closes the library. | |
| static ULONG | isregistryopen_c (void) |
| IsRegistryOpen: whether registry.library is open. | |
| static ULONG | lockregistry_c (ULONG mode) |
| LockRegistry AccessMode: locks the registry, the structure becomes current. | |
| static void | unlockregistry_c (void) |
| UnlockRegistry: unlocks the current structure and pops it. | |
| static ULONG | setregistrybaselibrary_c (ULONG name) |
| SetRegistryBaseLibrary LibraryName: SetRegistryBaseLibrary (-42). | |
| static ULONG | existsregistrylibrary_c (ULONG name) |
| ExistsRegistryLibrary LibraryName: ExistsLibrary (-48). | |
| static ULONG | getstring (WORD off, ULONG name, const ULONG *lens) |
| static ULONG | getlibraryvalue_c (ULONG name, const ULONG *lens) |
| GetLibraryValue$(LibraryName): the library's value as a string. | |
| static ULONG | getregistrystringvariable_c (ULONG name, const ULONG *lens) |
| GetRegistryStringVariable(VariableName): a string variable's value. | |
| static ULONG | getregistryvariable_c (ULONG name) |
| GetRegistryVariable(VariableName): GetRegistryVariable (-60). | |
| static ULONG | doset (ULONG type, ULONG name, ULONG value, ULONG size) |
| static ULONG | setregistryintvariable_c (ULONG name, ULONG v) |
| SetRegistryIntVariable VariableName,#: sets an integer variable (type 4). | |
| static ULONG | setregistryboolvariable_c (ULONG name, BB_BOOL v) |
| SetRegistryBoolVariable VariableName,True/False: sets a boolean variable (type 3). | |
| static ULONG | setregistryvariable_c (ULONG name, ULONG v, const ULONG *lens) |
| SetRegistryVariable VariableName,Value$: sets a string variable (type 1). | |
| static ULONG | setregistryvariable2_c (ULONG name, ULONG v, ULONG size) |
| SetRegistryVariable VariableName,Address,ByteSize: sets a data variable (type 2). | |
| static ULONG | changeregistryvariable_c (ULONG name, ULONG v, ULONG type, ULONG size) |
| ChangeRegistryVariable VariableName,Data,Type,ByteSize: ChangeRegistryVariable (-72). | |
| static ULONG | newregistrylibrary2_c (ULONG name, ULONG v, ULONG file) |
| NewRegistryLibrary LibraryName,LibraryValue,VariableFilename: NewRegistryLibrary (-78). | |
| static ULONG | newregistrylibrary_c (ULONG name, ULONG v) |
| NewRegistryLibrary LibraryName,LibraryValue: as above with no variable file (a3 = 0). | |
| static ULONG | nextparseitem_c (void) |
| SaveRegistryLibrary LibraryName,FileName: SaveRegistryLibrary (-126). | |
| static ULONG | changeregistryaccess_c (void) |
| ChangeRegistryAccess: ChangeRegistryAccess (-102), to read access. | |
| static ULONG | getregistryintvariable_c (ULONG name) |
| GetRegistryIntVariable(VariableName) / GetRegistryBoolVariable(VariableName). | |
| static ULONG | setregistryvariableindex_c (ULONG name, ULONG v, ULONG type, ULONG size, ULONG index) |
| SetRegistryVariableIndex VariableName,Data,Type,ByteSize,Index: SetRegistryVariableIndex (-150). | |
| static ULONG | insertnewregistrylibrary2_c (ULONG name, ULONG v, ULONG before, ULONG file) |
| InsertNewRegistryLibrary LibraryName,LibraryValue,InsertBefore,VariableFilename. | |
| static ULONG | insertnewregistrylibrary_c (ULONG name, ULONG v, ULONG before) |
| InsertNewRegistryLibrary LibraryName,LibraryValue,InsertBefore: as above, no file (a3 = 0). | |
| static ULONG | parseitemname_c (void) |
| ParseItemName$: the name of the last parsed item (the structure's +14). | |
| static ULONG | parseitemvalue_c (void) |
| ParseItemValue$: the string value of the last parsed item. | |
Variables | |
| struct { | |
| ULONG structs [16] | |
| UWORD curstruct | |
| ULONG regstruct | |
| struct Library * regbase | |
| } | st |
| static ULONG | call_a3a4 [2] |
| #define CALL | ( | off, | |
| d0, | |||
| d1, | |||
| d2, | |||
| a1, | |||
| a2 ) |
| #define CORRECTA3 | ( | lens | ) |
| #define LG BL_LONG |
| #define LVO_ChangeRegistryAccess (-102) |
| #define LVO_ChangeRegistryVariable (-72) |
| #define LVO_DeleteRegistryLibrary (-108) |
| #define LVO_DeleteRegistryLibraryVariables (-138) |
| #define LVO_DeleteRegistryVariable (-114) |
| #define LVO_ExistsLibrary (-48) |
| #define LVO_FreeStructureVariables (-192) |
| #define LVO_GetLibraryValue (-54) |
| #define LVO_GetRegistryVariable (-60) |
| #define LVO_GetStructureVariables (-186) |
| #define LVO_InsertNewRegistryLibrary (-180) |
| #define LVO_LoadLibraryVariables (-198) |
| #define LVO_LoadRegistryLibrary (-132) |
| #define LVO_LockRegistry (-30) |
| #define LVO_NewRegistryLibrary (-78) |
| #define LVO_NextParseItem (-96) |
| #define LVO_NumRegistryLibraryVariables (-120) |
| #define LVO_ParseRegistryLibrary (-84) |
| #define LVO_RenameRegistryLibrary (-174) |
| #define LVO_RenameRegistryVariable (-156) |
| #define LVO_SaveLibraryVariables (-162) |
| #define LVO_SaveRegistryLibrary (-126) |
| #define LVO_SetLibraryValue (-144) |
| #define LVO_SetRegistryBaseLibrary (-42) |
| #define LVO_SetRegistryVariable (-66) |
| #define LVO_SetRegistryVariableIndex (-150) |
| #define LVO_UnlockRegistry (-36) |
| #define NAME2CALL | ( | f, | |
| off ) |
ParseRegistryLibrary LibraryName: ParseRegistryLibrary (-84).
DeleteRegistryLibrary LibraryName: DeleteRegistryLibrary (-108).
DeleteRegistryVariable VariableName: DeleteRegistryVariable (-114).
NumRegistryLibraryVariables VariableName: NumRegistryLibraryVariables (-120).
DeleteRegistryLibraryVariables LibraryName: DeleteRegistryLibraryVariables (-138).
| #define NAMECALL | ( | f, | |
| off ) |
| #define S BL_STRING |
| #define SLOT | ( | ) |
| #define VAR_BOOLEAN 3 |
| #define VAR_DATA 2 |
| #define VAR_INTEGER 4 |
| #define VAR_STRING 1 |
| void _changeregistryaccess | ( | void | ) |
| void _changeregistryvariable | ( | void | ) |
| void _deleteregistrylibrary | ( | void | ) |
| void _deleteregistrylibraryvariables | ( | void | ) |
| void _deleteregistryvariable | ( | void | ) |
| void _existsregistrylibrary | ( | void | ) |
| void _freestructurevariables | ( | void | ) |
| void _getlibraryvalue | ( | void | ) |
| void _getregistryboolvariable | ( | void | ) |
| void _getregistryintvariable | ( | void | ) |
| void _getregistrystringvariable | ( | void | ) |
| void _getregistryvariable | ( | void | ) |
| void _getstructurevariables | ( | void | ) |
| void _insertnewregistrylibrary | ( | void | ) |
| void _insertnewregistrylibrary2 | ( | void | ) |
| void _isregistryopen | ( | void | ) |
| void _loadlibraryvariables | ( | void | ) |
| void _loadregistrylibrary | ( | void | ) |
| void _lockregistry | ( | void | ) |
| void _newregistrylibrary | ( | void | ) |
| void _newregistrylibrary2 | ( | void | ) |
| void _nextparseitem | ( | void | ) |
| void _numregistrylibraryvariables | ( | void | ) |
| void _parseitemname | ( | void | ) |
| void _parseitemvalue | ( | void | ) |
| void _parseregistrylibrary | ( | void | ) |
| void _renameregistrylibrary | ( | void | ) |
| void _renameregistryvariable | ( | void | ) |
| void _savelibraryvariables | ( | void | ) |
| void _saveregistrylibrary | ( | void | ) |
| void _setlibraryvalue | ( | void | ) |
| void _setregistrybaselibrary | ( | void | ) |
| void _setregistryboolvariable | ( | void | ) |
| void _setregistryintvariable | ( | void | ) |
| void _setregistryvariable | ( | void | ) |
| void _setregistryvariable2 | ( | void | ) |
| void _setregistryvariableindex | ( | void | ) |
| void _unlockregistry | ( | void | ) |
|
static |
|
static |
ChangeRegistryAccess: ChangeRegistryAccess (-102), to read access.
|
static |
|
static |
|
static |
ExistsRegistryLibrary LibraryName: ExistsLibrary (-48).
| name | d0: the library name (a1, d0 = 0 for the call) |
|
static |
GetLibraryValue$(LibraryName): the library's value as a string.
GetLibraryValue (-54); the result is the structure's value at +24 if its type (+18) is 1 (a string), else "". The result goes where the argument was (a3 back by its length + 1). Without a structure "" (fixed, #780: the original reads the type and value at 18/24 of address 0). a3 ends on the string's 0 (fixed, #783).
| name | d0: the library name |
| lens | a2: the argument stack (lens[-1] = the length of name) |
|
static |
GetRegistryIntVariable(VariableName) / GetRegistryBoolVariable(VariableName).
GetRegistryVariable (-60); if its result (the type, a word) is 3 (boolean) or 4 (integer), the structure's value at +24, else 0.
| name | d0: the variable name |
|
static |
GetRegistryStringVariable(VariableName): a string variable's value.
GetRegistryVariable (-60), then as GetLibraryValue$: the structure's value if it is a string, else "" (also without a structure, fixed #780; a3 on the 0, fixed #783).
| name | d0: the variable name |
| lens | a2: the argument stack (lens[-1] = the length of name) |
|
static |
GetRegistryVariable(VariableName): GetRegistryVariable (-60).
| name | d0: the variable name (a1, d0 = 0 for the call) |
|
static |
|
static |
InsertNewRegistryLibrary LibraryName,LibraryValue,InsertBefore,VariableFilename.
InsertNewRegistryLibrary (-180): a1 = the name, a2 = the value, a3 = the variable file name, a4 = the library to insert before. DIFF: a3/a4 are restored after the call (the original leaves them set - the program's string pointer and locals).
| name | d0: the library name |
| v | d1: the library value |
| before | d2: the name to insert before |
| file | d3: the variable file name |
|
static |
|
static |
IsRegistryOpen: whether registry.library is open.
|
static |
finit: unlocks every structure still locked, closes the library.
UnlockRegistry on structs[curstruct] ... structs[4] (those not 0, with d0 = the index, a1 = the stack), then CloseLibrary. Fixed (#779): the original leaves regstruct and the base set; both are cleared, regstruct also without the library.
|
static |
init: opens registry.library (any version).
Without it IsRegistryOpen is 0 and every command returns 0.
|
static |
LockRegistry AccessMode: locks the registry, the structure becomes current.
LockRegistry (-30, d0 = the mode); the result is pushed on the structure stack and is the current structure - also 0 (the following calls then do nothing, UnlockRegistry still pops it: no defect). With 15 structures on the stack (it is full) nothing is called or pushed and the result is 0 (fixed, #781: the original writes the 16th over curstruct and regstruct).
| mode | d0: the access mode |
|
static |
NewRegistryLibrary LibraryName,LibraryValue,VariableFilename: NewRegistryLibrary (-78).
a1 = the name, a2 = the value, a3 = the variable file name. DIFF: a3/a4 are restored after the call (the original leaves the file name in a3).
|
static |
|
static |
SaveRegistryLibrary LibraryName,FileName: SaveRegistryLibrary (-126).
LoadRegistryLibrary LibraryName,FileName: LoadRegistryLibrary (-132).
SetLibraryValue LibraryName,Value: SetLibraryValue (-144).
RenameRegistryVariable VariableName,NewVariableName: RenameRegistryVariable (-156).
SaveLibraryVariables LibraryName,Filename: SaveLibraryVariables (-162).
RenameRegistryLibrary LibraryName,NewLibraryName: RenameRegistryLibrary (-174).
GetStructureVariables Description,Structure: GetStructureVariables (-186).
FreeStructureVariables Description,Structure: FreeStructureVariables (-192).
LoadLibraryVariables LibraryName,Filename: LoadLibraryVariables (-198).
NextParseItem: NextParseItem (-96), the next item of a parse.
|
static |
ParseItemName$: the name of the last parsed item (the structure's +14).
a3 ends on the 0 (fixed, #783: the original left it behind the 0).
|
static |
ParseItemValue$: the string value of the last parsed item.
The structure's value at +24 if its type is 1 (a string), else "". a3 ends on the 0 (fixed, #783: the original left it behind the 0).
|
static |
|
static |
|
static |
| void riregistrylib_libfinit | ( | void | ) |
| void riregistrylib_libinit | ( | void | ) |
|
static |
SetRegistryBaseLibrary LibraryName: SetRegistryBaseLibrary (-42).
| name | d0: the library name (also in d0 for the call, a1) |
|
static |
SetRegistryBoolVariable VariableName,True/False: sets a boolean variable (type 3).
SetRegistryVariable (-66) with the size 4 (fixed, #782: the original passes the caller's d2, the command has no third argument).
|
static |
SetRegistryIntVariable VariableName,#: sets an integer variable (type 4).
SetRegistryVariable (-66) with the size 4 (fixed, #782: the original passes the caller's d2, the command has no third argument).
|
static |
|
static |
SetRegistryVariable VariableName,Value$: sets a string variable (type 1).
SetRegistryVariable (-66) with the size the length of Value$ (fixed, #782: the original passes the caller's d2, this form has no third argument).
| name | d0: the variable name (a1) |
| v | d1: the string (a2) |
| lens | a2: the argument stack (lens[-1] the length of name, lens[-2] that of the string) |
|
static |
SetRegistryVariableIndex VariableName,Data,Type,ByteSize,Index: SetRegistryVariableIndex (-150).
| name | d0: the variable name (a1) |
| v | d1: the data (a2) |
| type | d2: the type (d0 for the call) |
| size | d3: the byte size (d1 for the call) |
| index | d4: the index (d2 for the call) |
|
static |
UnlockRegistry: unlocks the current structure and pops it.
UnlockRegistry (-36) on the current structure (nothing without one), then the stack slot is cleared and the structure below becomes current. Nothing without a pushed lock (fixed, #781: the original goes below the stack, into the end of its token table).
|
static |
| UWORD curstruct |
| struct Library* regbase |
| ULONG regstruct |
| struct { ... } st |
| ULONG structs[16] |