sc68 resources access.
More...
Go to the source code of this file.
sc68 resources access.
- Author
- Benjamin Gerard ben@s.nosp@m.ashi.nosp@m.pa.co.nosp@m.m
- Date
- 1998/10/07
- Id
- rsc68.h,v 2.2 2003/09/20 19:24:30 benjihan Exp
Resource handle function type.
SC68 resource file type.
Enumerator |
---|
SC68rsc_replay |
68000 external replay.
|
SC68rsc_config |
Config file.
|
SC68rsc_sample |
Sc68 sample files.
|
SC68rsc_dll |
Sc68 dynamic library.
|
const char* SC68rsc_set_share |
( |
const char * |
path | ) |
|
Set shared resource path.
The SC68rsc_set_share() function set the shared resource path. The path will be duplicate by SC68strdup(). If path is null the current path is freed.
- Parameters
-
path | New shared resource path (0 for free). |
- Returns
- new path (duplicated string).
- Return values
-
0 | error (except for freeing) |
const char* SC68rsc_set_user |
( |
const char * |
path | ) |
|
Set user resource path.
The SC68rsc_set_user() function set the user resource path. The path will be duplicate by SC68strdup(). If path is null the current path is freed.
- Parameters
-
path | New user resource path (0 for free). |
- Returns
- new path (duplicated string).
- Return values
-
0 | error (except for freeing) |
Set/Get resource handler.
The SC68rsc_set_handler() function set the current resource handler. If 0 is given as fct parameter the function does not set the handler. In all case the function returns the current handler. See below for more information about the default resource handler.
- Resource handler
- The resource handler is a function called by the SC68rsc_open() function. Some preliminary tests has already been performed. So the handler can assume that the name is not a NULL pointer and the mode is valid (either 1:reading or 2:writing). The resource handler must return an already opened istream_t or 0 in error case.
- Default resource handler
- The Default handler use a the istream_file_create() function.
- If open mode is 2 (write mode) the default handler use the user resource path.
- If open mode is 1 (read mode) the default handler tries in this order the user resource path and the shared resource path.
- Parameters
-
fct | New resource handler (0 for reading current value). |
- Returns
- previous value.
Open a resource in given mode.
The function SC68rsc_open() function opens an istream_t to access a resource.
- Parameters
-
type | Type of resource to open. |
name | Name of resource. |
mode | 1:read-access, 2:write-access. |
- Returns
- already opened istream_t stream.
- Return values
-
- See also
- SC68rsc_set_handler() for more info on resource handler.