A database backend for XMMS2
◆ S4_MAGIC
#define S4_MAGIC ("s4db") |
◆ S4_MAGIC_LEN
◆ S4_VERSION
◆ _reread_file()
int _reread_file |
( |
s4_t * | s4 | ) |
|
◆ _start_sync()
void _start_sync |
( |
s4_t * | s4 | ) |
|
◆ _sync()
◆ s4_close()
int s4_close |
( |
s4_t * | s4 | ) |
|
Closes an open S4 database.
- Parameters
-
Referenced by CASE(), and main().
◆ s4_errno()
Returns the last error number set.
This function is thread safe, error numbers set in one thread will NOT be seen in another thread.
- Returns
- The last error number set, or S4E_NOERROR if none has been set
Referenced by CASE(), CASE(), and CASE().
◆ s4_open()
s4_t * s4_open |
( |
const char * | filename, |
|
|
const char ** | indices, |
|
|
int | open_flags ) |
Opens an S4 database.
The different flags you can pass:
S4_NEW
It will create a new file if one does not already exists. If one exists it will fail and return NULL.
S4_EXISTS
If the file does not exists it will fail and return NULL. s4_errno may be used to get more information about what went wrong.
S4_MEMORY Creates a memory-only database. It will not read any files on startup or write files on shutdown. Use this if you want a temporary database.
- Parameters
-
filename | The name of the file containing the database |
indices | An array of keys to have indices on |
open_flags | Zero or more of the flags bitwise-or'd. |
- Returns
- A pointer to an s4_t, or NULL if something went wrong.
Referenced by CASE(), CASE(), and main().
◆ s4_set_errno()
◆ s4_sync()
void s4_sync |
( |
s4_t * | s4 | ) |
|
Writes all changes to disk.
- Parameters
-
Referenced by s4_open().