|
XMMS2
|
A database backend for XMMS2. More...
Topics | |
| Condition | |
| Functions to create and use S4 search conditions. | |
| Fetch Specifications | |
| Specifies what to fetch in a query. | |
| Lock | |
| Locks entries so only one transaction can use tham at a time. | |
| Log | |
| Logs every action so we can redo changes if something crashes. | |
| Pattern | |
| Functions to create and match glob-like patterns. | |
| Entry | |
| The in-memory database. | |
| Result | |
| Handles results returned from S4. | |
| Result Set | |
| A set of results. | |
| Source Preferences | |
| Handles source preferences. | |
| Transactions | |
| Functions dealing with transactions. | |
| UUID | |
| Functions dealing with UUID. | |
| Value | |
| The way values are represented in S4. | |
Macros | |
| #define | S4_MAGIC ("s4db") |
| #define | S4_MAGIC_LEN (4) |
| #define | S4_VERSION 1 |
Functions | |
| s4_t * | s4_open (const char *filename, const char **indices, int open_flags) |
| Opens an S4 database. | |
| int | s4_close (s4_t *s4) |
| Closes an open S4 database. | |
| void | s4_sync (s4_t *s4) |
| Writes all changes to disk. | |
| s4_errno_t | s4_errno () |
| Returns the last error number set. | |
| void | s4_set_errno (s4_errno_t err) |
| Sets errno to the given error number. | |
| int | _reread_file (s4_t *s4) |
| void | _start_sync (s4_t *s4) |
| void | _sync (s4_t *s4) |
A database backend for XMMS2.
| #define S4_MAGIC ("s4db") |
| #define S4_MAGIC_LEN (4) |
| #define S4_VERSION 1 |
| int _reread_file | ( | s4_t * | s4 | ) |
| void _start_sync | ( | s4_t * | s4 | ) |
Referenced by _log_write().
| void _sync | ( | s4_t * | s4 | ) |
Referenced by s4_commit().
| int s4_close | ( | s4_t * | s4 | ) |
| s4_errno_t s4_errno | ( | void | ) |
| 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.
| 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. |
| void s4_set_errno | ( | s4_errno_t | err | ) |
Sets errno to the given error number.
| err | The error number to set |
Referenced by _lock_exclusive(), _lock_shared(), _log_open(), _oplist_execute(), and s4_commit().