Diese Bibliothek enthält spezielle Funktionen, welche nur unter Geneva zur Verfügung stehen.
• x_help | Start the Help display program. |
• x_malloc | Speicherplatz reservieren von Geneva. |
• x_mfree | Freigeben des Speicherplatz welcher mit x_malloc reserviert wurde. |
• x_mshrink | Shrink a memory block with x_malloc. |
• x_realloc | Change the size of memory allocated with x_malloc. |
• x_settings | Get or set Geneva's internal settings. |
• x_sprintf | Print data to a string. |
• x_sscanf | Read formatted data from a string. |
Querverweis: AES
Name: | »Geneva help« - Inform the Help display program of a request
for help text.
| ||||||||||
AES-Nummer: | 29061
| ||||||||||
Deklaration: | int16_t x_help( int8_t *topic, int8_t *helpfile, int16_t
sensitive );
| ||||||||||
Beschreibung: |
This function is used by a program to provide online help for its features. Geneva begins by checking to see if the help display program is already in memory. If it is not, then it is loaded from disk by way of the SHOWHELP environmental variable, as set in GEM.CNF. Once the program is in memory, it is sent a message containing the values passed in the x_help function call. The user is then either shown the help text, or an error message saying that the topic was not found. The topic parameter points to a NUL-terminated string containing the help topic to search for. If sensitive is non-zero, then the case (upper/lower) of the topic must exactly match what is stored in the help file. If, however, sensitive is zero, both the case-sensitive and case-insensitive sections of the help file are searched for the topic. filename points to a NUL-terminated string describing the path and file name of the default help file to search for the topic. If no path information is used, then the PATH environmental variable is searched (by way of shel_find) for the file. If this file is not found, or the topic is not found in the file, the user receives an error message. If filename is NULL (0L), then the topic is only searched for in GENEVA.HLP. | ||||||||||
Ergebnis: | An error code (0) is returned if either the help program could
not be loaded, or there was insufficient free memory to send the
message.
| ||||||||||
Verfügbar: | Die Funktion steht nur unter Geneva zur Verfügung.
| ||||||||||
Gruppe: | Geneva Funktionen
| ||||||||||
Querverweis: | Binding
|
C: | int16_t x_help( int8_t *topic, int8_t *helpfile, int16_t
sensitive );
| ||||||||||||||||||||||||||||||
Umsetzung: |
int16_t x_help( int8_t *topic, int8_t *helpfile, int16_t sensitive ) { int_in[0] = sensitive addr_in[0] = topic; addr_in[1] = helpfile; crys_if(29061); return ( int_out[0] ); } | ||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »memory allocation« - Speicherplatz reservieren von Geneva.
| ||||||||
AES-Nummer: | 29062
| ||||||||
Deklaration: | void x_malloc( void **addr, int32_t size );
| ||||||||
Beschreibung: |
This function allocates memory, much in the same way Malloc or malloc does. The only major difference is that it comes without the extra overhead of malloc. Since Geneva takes this memory from the same pool as the rest of its memory, it is also not as likely to cause memory fragmentation if the application allocates lots of small blocks using this call as it is when doing so with Malloc. If no memory could be allocated, the addr is set to NULL (0L). Unlike the GEMDOS Malloc function, this function does not accept the "size" -1L. | ||||||||
Ergebnis: | Die Funktion hat keinen Rückgabewert.
| ||||||||
Verfügbar: | Die Funktion steht nur unter Geneva seit Release 004 zur
Verfügung.
| ||||||||
Gruppe: | Geneva Funktionen
| ||||||||
Querverweis: | Binding
|
C: | void x_malloc( void **addr, int32_t size );
| |||||||||||||||||||||||||||
Umsetzung: |
void x_malloc( void **addr, int32_t size ) { (int32_t)int_in[0] = size; addr_in[0] = addr; crys_if(29062); return; } } | |||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »memory free« - Free memory allocated with x_malloc.
| ||||||
AES-Nummer: | 29063
| ||||||
Deklaration: | int16_t x_mfree( void *addr );
| ||||||
Beschreibung: |
| ||||||
Ergebnis: | 0 = Erfolgreich
sonst = Fehler | ||||||
Verfügbar: | Die Funktion steht nur unter Geneva seit Release 004 zur
Verfügung.
| ||||||
Gruppe: | Geneva Funktionen
| ||||||
Querverweis: | Binding
|
C: | int16_t x_mfree( void *addr );
| ||||||||||||||||||||||||
Umsetzung: |
int16_t x_mfree( void *addr ) { addr_in[0] = addr; crys_if(29063); return ( int_out[0] ); } | ||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »memory shrink« - Shrink a memory block allocated with
x_malloc.
| ||||||||
AES-Nummer: | 29064
| ||||||||
Deklaration: | int16_t x_mshrink( void *addr, int32_t newsize );
| ||||||||
Beschreibung: |
This function shrinks (decreases the size of) a block of memory previously allocated with the x_malloc function. The newsize must be less than the original size, or Failure will be returned. | ||||||||
Ergebnis: | 0 = Erfolgreich
sonst = Fehler | ||||||||
Verfügbar: | Die Funktion steht nur unter Geneva seit Release 004 zur
Verfügung.
| ||||||||
Gruppe: | Geneva Funktionen
| ||||||||
Querverweis: | Binding
|
C: | int16_t x_mshrink( void *addr, int32_t newsize );
| ||||||||||||||||||||||||||||||
Umsetzung: |
int16_t x_mshrink( void *addr, int32_t newsize ) { int_in[0-1] = newsize; /* int_in[0] MSW of the size */ /* int_in[1] LSW of the size (lower 16 bits) */ addr_in[0] = addr; crys_if(29064); return ( int_out[0] ); } | ||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »memory realloc« - Change the size of memory allocated with
x_malloc.
| ||||||||
AES-Nummer: | 29065
| ||||||||
Deklaration: | int16_t x_realloc( void **addr, int32_t newsize );
| ||||||||
Beschreibung: |
This function changes the size of a block of memory previously allocated with the x_malloc function. If newsize is greater than the block's original size, it may be necessary for Geneva to move the block to a new location. If there is insufficient free memory to increase the size of the block, the "old" block continues to reside where it was and an error code is returned. | ||||||||
Ergebnis: | 0 = Erfolgreich
sonst = Fehler | ||||||||
Verfügbar: | Die Funktion steht nur unter Geneva seit Release 004 zur
Verfügung.
| ||||||||
Gruppe: | Geneva Funktionen
| ||||||||
Querverweis: | Binding
|
C: | int16_t x_realloc( void **addr, int32_t newsize );
| ||||||||||||||||||||||||||||||
Umsetzung: |
int16_t x_realloc( void **addr, int32_t newsize ) { int_in[0-1] = newsize; /* int_in[0] MSW of the size */ /* int_in[1] LSW of the size (lower 16 bits) */ addr_in[0] = addr; crys_if(29065); return ( int_out[0] ); } | ||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Geneva settings« - Get or set Geneva's internal settings.
| ||||||||||
AES-Nummer: | 29056
| ||||||||||
Deklaration: | int16_t x_settings ( int16_t getset, int16_t length, SETTINGS
*user );
| ||||||||||
Beschreibung: |
0: Get Read length bytes (or the maximum length of the SETTINGS structure.) Setting length to a negative number will read the whole structure, though this is not recommended since future versions may expand the SETTINGS structure. Example: SETTINGS set; x_settings ( 0, sizeof(set), &set ); 1: Set Set length bytes (or the maximum length of the SETTINGS structure.) Setting length to a negative number will set the whole structure, though this is not recommended since future versions may expand the SETTINGS structure. The contents of user are not modified. Example: Temporarily disable pulldowns: SETTINGS set; x_settings ( 0, sizeof(set), &set ); /* get current */ set.pulldown = 0; x_settings ( 1, sizeof(set), &set ); /* turn off */ ... /* do some stuff here */ set.pulldown = 1; x_settings ( 1, sizeof(set), &set ); /* turn back on */ -1: Reset Reset length bytes of the settings to their default values. If length is less than zero, all of the settings will be reset. The user parameter can be NULL, since it is not used. | ||||||||||
Ergebnis: | Die Funktion liefert immer 1.
| ||||||||||
Verfügbar: | Die Funktion steht nur unter Geneva zur Verfügung.
| ||||||||||
Gruppe: | Geneva Funktionen
| ||||||||||
Querverweis: | Binding
|
C: | int16_t x_settings ( int16_t getset, int16_t length, SETTINGS
*user );
| ||||||||||||||||||||||||||||||
Umsetzung: |
int16_t x_settings ( int16_t getset, int16_t length, SETTINGS *user ) { int_in[0] = getset; int_in[1] = length; addr_in[0] = user; crys_if(29056); return ( int_out[0] ); } | ||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Geneva sprinft« - Print data to a string, with extended
formats.
| ||||||||||||||||||||||||||||||||||||||||||||||||||
AES-Nummer: | 29059
| ||||||||||||||||||||||||||||||||||||||||||||||||||
Deklaration: | void x_sprintf( int8_t *buf, int8_t *fmt, ... );
| ||||||||||||||||||||||||||||||||||||||||||||||||||
Beschreibung: |
This function acts almost identically to the sprintf function found in C programming libraries. It understands the following format specifiers:
These prefixes can be used before the string and number formats:
Example: Result: x_sprintf( str, "%04x", 0xFE ); 00FE x_sprintf( str, "%-06s", "Hi!" ); Hi!000 x_sprintf( str, "%6s", "Hi!" ); Hi! x_sprintf( str, "%b %v", 2, 0x502 ); T 5.02 x_sprintf( str, "%S %s", "a b", "c d" ); {a b} c d KEYCODE key = { 1, 0, 'X' }; x_sprintf( str, "key=%k", &key ); keyd 1 00 58 This sort of thing doesn't really belong in a GUI, but it made sense to include it, since it is used by Geneva internally, anyway. | ||||||||||||||||||||||||||||||||||||||||||||||||||
Ergebnis: | Die Funktion hat keinen Rückgabewert.
| ||||||||||||||||||||||||||||||||||||||||||||||||||
Verfügbar: | Die Funktion steht nur unter Geneva zur Verfügung.
| ||||||||||||||||||||||||||||||||||||||||||||||||||
Gruppe: | Geneva Funktionen
| ||||||||||||||||||||||||||||||||||||||||||||||||||
Querverweis: | Binding
|
C: | void x_sprintf( int8_t *buf, int8_t *fmt, ... );
| |||||||||||||||||||||||||||
Umsetzung: |
void x_sprintf( int8_t *buf, int8_t *fmt, ... ) { addr_in[0] = buf; addr_in[1] = fmt; addr_in[2] = &...; crys_if(29059); return; } | |||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Geneva sscanf« - Read formatted data from a string, with
extended formats.
| ||||||||||||||||||||||||||||||||||||||||||
AES-Nummer: | 29060
| ||||||||||||||||||||||||||||||||||||||||||
Deklaration: | void x_sscanf( int8_t *buf, int8_t *fmt, ... );
| ||||||||||||||||||||||||||||||||||||||||||
Beschreibung: |
This function acts almost identically to the sscanf function found in C programming libraries. It understands the following format specifiers:
Example: Result: int i; char str[10], str2[10], bool; KEYCODE key; x_sscanf( "FE", "%x", &i ); i = 0xFE x_sscanf( "Hi!", "%s", str ); str = "Hi!" x_sscanf( "T 5.02", "%b %v", &bool, &i ); bool = 1, i = 0x502 x_sscanf( "{a b} c", "%S %s", str, str2 ); str = "a b", str2 = "c" x_sprintf( "01 00 58", "%k", &key ); key = { 1, 0, 58 }; This sort of thing doesn't really belong in a GUI, but it made sense to include it, since it is used by Geneva internally, anyway. | ||||||||||||||||||||||||||||||||||||||||||
Ergebnis: | Die Funktion hat keinen Rückgabewert.
| ||||||||||||||||||||||||||||||||||||||||||
Verfügbar: | Die Funktion steht nur unter Geneva zur Verfügung.
| ||||||||||||||||||||||||||||||||||||||||||
Gruppe: | Geneva Funktionen
| ||||||||||||||||||||||||||||||||||||||||||
Querverweis: | Binding
|
C: | void x_sscanf( int8_t *buf, int8_t *fmt, ... );
| |||||||||||||||||||||||||||
Umsetzung: |
void x_sscanf( int8_t *buf, int8_t *fmt, ... ) { addr_in[0] = buf; addr_in[1] = fmt; addr_in[2] = &...; crys_if(29060); return; } | |||||||||||||||||||||||||||
GEM-Arrays: |
|