Open, close and related


Functions

CSTCST_open (const int readonly, unsigned char *password)
 Open default storage.
CSTCST_open_file (const char *filename, const int readonly, unsigned char *password)
 Open local storage from file 'filename'. If file not exist then created.
int CST_create_file (const char *filename, unsigned char *password)
 Create empty local storage in file 'filename'.
int CST_save (CST *st)
void CST_free (CST *st)
int CST_last_error ()
int CST_backup (CST *st, const char *filename, unsigned char *password)

Function Documentation

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:
Error code
Possible error: CST_ERROR_LOCK,

int CST_create_file ( const char *  filename,
unsigned char *  password 
)

Create empty local storage in file 'filename'.

Only create file, not open it.

Parameters:
filename Filename of local storage
password Password for storage or NULL if password is empty (NOT USED)
Returns:
Error code
Possible error: CST_ERROR_NOT_FOUND, CST_ERROR_DBSTRUCTURE_CORRUPT

Deprecated:
This function is deprecated. Instead use CST_open_file() or CST_open().

void CST_free ( CST st  ) 

Free resources used by storage.

Parameters:
st Pointer to storage structure
Example 1. Open and close.

int CST_last_error (  ) 

Last error code. If error then return last error code.

Returns:
Last error code

CST* CST_open ( const int  readonly,
unsigned char *  password 
)

Open 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.

Libcst assumes that libglib2 has already been initialized. It is true for any Hildon or GTK+ applications, but you should call g_type_init() explicitly before any calls to CST_open() if you use minimalistic environment.

include <glib-object.h> ... g_type_init(); CST * storage = CST_open(...); ...

Parameters:
readonly If storage will be readonly (NOT USED)
password Password for storage or NULL if password is empty (NOT USED)
Returns:
NULL if error, see CST_last_error()
Possible error: 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 
)

Open local storage from file 'filename'. If file not exist then created.

Parameters:
filename Filename of local storage
readonly If storage will be readonly (NOT USED)
password Password for storage or NULL if password is empty (NOT USED)
Returns:
NULL if error, see CST_last_error()
Possible error: CST_ERROR_NOT_FOUND, CST_ERROR_DBSTRUCTURE_CORRUPT CST_ERROR_IO, CST_ERROR_NOSPC, CST_ERROR_LOCK

Example 1. Open and close.

int CST_save ( CST st  ) 

Save storage.

Parameters:
st Pointer to storage structure
Returns:
Error code
Deprecated:
This function is deprecated.
Possible error: CST_ERROR_NOT_FOUND, CST_ERROR_DBSTRUCTURE_CORRUPT

Example 1. Open and close.


Generated on Wed Mar 5 08:20:44 2008 for Certman by  doxygen 1.5.1