Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 285b0859 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

Restore headers

parent 3673505d
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!56Search
......@@ -32,6 +32,7 @@ bool command_add(sqlite3 *db, struct lkt_win *win, char *args[LKT_MESSAGE_ARGS_M
enum mpd_idle_flag *watch_mask_ptr);
bool command_addid(sqlite3 *db, struct lkt_win *win, char *args[LKT_MESSAGE_ARGS_MAX],
enum mpd_idle_flag *watch_mask_ptr);
bool command_del(sqlite3 *db, struct lkt_win *win, char *pos_range, enum mpd_idle_flag *watch_mask_ptr);
bool command_delid(sqlite3 *db, struct lkt_win *win, char *id, enum mpd_idle_flag *watch_mask_ptr);
bool command_clear(sqlite3 *db, enum mpd_idle_flag *watch_mask_ptr);
bool command_crop(sqlite3 *db, enum mpd_idle_flag *watch_mask_ptr);
......@@ -62,9 +63,10 @@ bool command_noidle(struct lkt_state *srv, size_t c);
/* Find commands */
enum lkt_find_action {
LKT_FND_ACT_RESPOND,
LKT_FND_ACT_ADD,
LKT_FND_ACT_INSERT,
LKT_FND_ACT_NONE = 0,
LKT_FND_ACT_RESPOND = 1,
LKT_FND_ACT_PRINT = 2,
LKT_FND_ACT_ENQUEUE = 3,
};
/* Find and send karas in the db that match the search expression */
......
......@@ -73,26 +73,19 @@ bool database_queue_toggle_pause(sqlite3 *db);
bool database_queue_play(sqlite3 *db, int pos);
bool database_queue_stop(sqlite3 *db);
typedef bool (*database_callback)(void *args, int id, int id_len, const char *sql_row);
/* A search callback to be called after each matched row */
typedef bool (*database_search_callback_t)(void *args, int id, int id_len, const char *sql_row);
/* List the content of the queue */
bool database_queue_list_from(sqlite3 *db, unsigned int count, void *args, database_callback callback);
bool database_queue_list_abs(sqlite3 *db, unsigned int from, unsigned int to, void *args, database_callback callback);
bool database_queue_list_from(sqlite3 *db, unsigned int count, void *args,
database_search_callback_t callback);
bool database_queue_list_abs(sqlite3 *db, unsigned int from, unsigned int to, void *args,
database_search_callback_t callback);
/* Search the database */
struct lkt_search_iterator {
enum lkt_search_iterator_type {
lkt_search_iterator_database,
lkt_search_iterator_queue,
lkt_search_iterator_playlist,
} type;
sqlite3_stmt *iter;
sqlite3 *db;
};
bool database_search_database_init(sqlite3 *db, const char *col_name, const char *rgx, struct lkt_search_iterator *ret);
bool database_search_plt_init(sqlite3 *db, const char *plt_name, char *col_name, char *rgx,
struct lkt_search_iterator *ret);
bool database_search_iter(struct lkt_search_iterator *item, void **ret, size_t *len);
bool database_search_init(sqlite3 *db, char *col_name, char *rgx, sqlite3_stmt **ret);
bool database_search_iter(sqlite3 *db, sqlite3_stmt *item, void *args,
database_search_callback_t callback, bool *need_free);
/* Next and prev operation on the queue. */
bool database_queue_next(sqlite3 *db, char filepath[PATH_MAX]);
......
......@@ -46,16 +46,3 @@ enum mpd_idle_flag {
MPD_IDLE_OUTPUT | MPD_IDLE_OPTIONS | MPD_IDLE_PARTITION |
MPD_IDLE_STICKER | MPD_IDLE_SUBSCRIPTION | MPD_IDLE_MESSAGE,
};
enum lkt_callback_type {
callback_database,
callback_queue,
callback_playlist,
};
struct lkt_callback {
void **args;
enum lkt_callback_type type;
int (*call)(void **args, int id, int id_len, const char *sql_row);
};
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter