Subsections
These functions are in the top level of API, since they only manipulate
database files as a whole. They hide the actual storage format details
(e.g. in Maemo SDK 1.2, file format is Berkeley DB 1).
CST* CST_open (const int readonly, unsigned char * password)
Opens default storage. If find gconf key /apps/osso/certman/filename
then open file use this value. Else open file storage.cst.
If file not exist then created.
Parameters
- readonly If storage will be readonly (NOT USED)
- password Password for storage or NULL if password is empty
(NOT USED)
Returns
- Pointer to storage descriptor. User is responsible to release it using
CST_free.
- NULL if error, get the specific error with CST_lastError()
Errors
- CST_ERROR_NOT_FOUND
- CST_ERROR_DBSTRUCTURE_CORRUPT
- CST_ERROR_IO
- CST_ERROR_NOSPC
- CST_ERROR_LOCK
CST* CST_open_file (const char * filename, const int readonly,
unsigned char * password)
Opens local storage from a specified file. If the file does not exist,
it is created.
Parameters
- filename File name of local storage
- readonly If storage will be read-only (NOT USED)
- password Password for storage access, or NULL if password
is empty (NOT USED)
Returns
- Pointer to storage descriptor. User is responsible to release it using
CST_free.
- NULL if some error occurred. Get the error code via CST_lastError().
Errors
- CST_ERROR_NOT_FOUND
- CST_ERROR_DBSTRUCTURE_CORRUPT
- CST_ERROR_IO
- CST_ERROR_NOSPC
- CST_ERROR_LOCK
- CST_ERROR_PARAM_INCORRECT
int CST_create_file (const char * filename, unsigned char
* password)
Creates a database file. WARNING: Function is deprecated.
Use CST_open_file or CST_open instead.
Parameters
- filename Filename of local storage
- password Password for storage or NULL if password is empty
(NOT USED)
Returns
Errors
- CST_ERROR_IO
- CST_ERROR_NOSPC
- CST_ERROR_LOCK
- CST_ERROR_PARAM_INCORRECT
int CST_save (CST * st)
Save storage. This function is deprecated; just free the storage
using CST_free().
Parameters
- st Pointer to storage structure
Returns
Errors
- CST_ERROR_NOT_FOUND
- CST_ERROR_DBSTRUCTURE_CORRUPT
void CST_free (CST * st)
Closes storage and frees its resources.
Parameters
- st Pointer to storage structure
int CST_last_error ()
Last error code. If error then return last error code.
Returns
int CST_backup ( CST * st, const char * filename, unsigned
char * password)
Backup local (file) storage.
Parameters
- st Pointer to storage structure
- filename Filename for backup
- password Password (NOT USED)
Returns
Errors
Elvis Pfutzenreuter
2006-02-17