|
| static int | init_prepared_stmt_lookup (CNID_sqlite_private *db) |
| |
| static int | init_prepared_stmt_add (CNID_sqlite_private *db) |
| |
| static int | init_prepared_stmt_put (CNID_sqlite_private *db) |
| |
| static int | init_prepared_stmt_get (CNID_sqlite_private *db) |
| |
| static int | init_prepared_stmt_resolve (CNID_sqlite_private *db) |
| |
| static int | init_prepared_stmt_delete (CNID_sqlite_private *db) |
| |
| static int | init_prepared_stmt_find (CNID_sqlite_private *db) |
| |
| static int | init_prepared_stmt_getstamp (CNID_sqlite_private *db) |
| |
| static int | init_prepared_stmt (CNID_sqlite_private *db) |
| |
| static void | close_prepared_stmt (CNID_sqlite_private *db) |
| |
| static int | cnid_sqlite_execute (sqlite3 *con, const char *sql) |
| |
| int | cnid_sqlite_delete (struct _cnid_db *cdb, const cnid_t id) |
| |
| void | cnid_sqlite_close (struct _cnid_db *cdb) |
| |
| int | cnid_sqlite_update (struct _cnid_db *cdb, cnid_t id, const struct stat *st, cnid_t did, const char *name, size_t len) |
| |
| cnid_t | cnid_sqlite_lookup (struct _cnid_db *cdb, const struct stat *st, cnid_t did, const char *name, size_t len) |
| |
| cnid_t | cnid_sqlite_add (struct _cnid_db *cdb, const struct stat *st, cnid_t did, const char *name, size_t len, cnid_t hint) |
| |
| cnid_t | cnid_sqlite_get (struct _cnid_db *cdb, cnid_t did, const char *name, size_t len) |
| |
| char * | cnid_sqlite_resolve (struct _cnid_db *cdb, cnid_t *id, void *buffer, size_t len) |
| |
| int | cnid_sqlite_getstamp (struct _cnid_db *cdb, void *buffer, const size_t len) |
| |
| int | cnid_sqlite_find (struct _cnid_db *cdb, const char *name, size_t namelen, void *buffer, size_t buflen, bool *more_available) |
| | Backend implementation of cnid_find() for the sqlite backend.
|
| |
| cnid_t | cnid_sqlite_rebuild_add (struct _cnid_db *cdb, const struct stat *st, cnid_t did, const char *name, size_t len, cnid_t hint) |
| |
| int | cnid_sqlite_wipe (struct _cnid_db *cdb) |
| |
| static struct _cnid_db * | cnid_sqlite_new (struct vol *vol) |
| |
| struct _cnid_db * | cnid_sqlite_open (struct cnid_open_args *args) |
| |
| int cnid_sqlite_find |
( |
struct _cnid_db * |
cdb, |
|
|
const char * |
name, |
|
|
size_t |
namelen, |
|
|
void * |
buffer, |
|
|
size_t |
buflen, |
|
|
bool * |
more_available |
|
) |
| |
Backend implementation of cnid_find() for the sqlite backend.
Parameters are pre-validated by the libatalk/cnid/cnid.c wrapper, so cdb, name, namelen and buflen are all sane on entry. Detects truncation by binding LIMIT max_results+1 and observing whether the extra row was produced; reports it via more_available.
namelen is unused: the SQLite backend builds the LIKE pattern via asprintf("%%%s%%", name), which already requires a NUL-terminated name. The parameter is kept to satisfy the cnid_db function-pointer signature shared with the dbd / mysql backends.