38#ifndef __STUMPLESS_TARGET_SQLITE3_H
39#define __STUMPLESS_TARGET_SQLITE3_H
43#include <stumpless/config.h>
52#define STUMPLESS_DEFAULT_SQLITE3_INSERT_SQL \
53"INSERT INTO " STUMPLESS_DEFAULT_SQLITE3_TABLE_NAME_STRING " " \
54"( prival, version, timestamp, hostname, app_name, procid, msgid," \
55" structured_data, message ) " \
56"VALUES ( $prival, 1, $timestamp, $hostname, $app_name, $procid, $msgid, " \
57 "$structured_data, $message )"
72( *stumpless_sqlite3_prepare_func_t )(
const struct stumpless_entry *entry,
#define STUMPLESS_PUBLIC_FUNCTION
Marks functions that are provided for use by the library.
定义 config.h:31
Types and functions for creating and modifying entries.
void *(* stumpless_sqlite3_prepare_func_t)(const struct stumpless_entry *entry, void *data, size_t *count)
A function for generating SQLite3 prepared statements for a given entry.
定义 sqlite3.h:72
struct stumpless_target * stumpless_open_sqlite3_target_from_db(void *db)
Opens a SQLite3 target with an already-open database handle.
struct stumpless_target * stumpless_create_default_sqlite3_table(struct stumpless_target *target)
Creates a table in the target's database for use with the default SQLite3 insertion behavior.
bool stumpless_close_sqlite3_target_and_db(const struct stumpless_target *target)
Closes a SQLite3 target and its database handle.
void * stumpless_get_sqlite3_db(const struct stumpless_target *target)
Gets the SQLite3 database handle used by the target.
struct stumpless_target * stumpless_set_sqlite3_insert_sql(struct stumpless_target *target, const char *sql)
Sets the SQL statement used to insert entries into the database.
stumpless_sqlite3_prepare_func_t stumpless_get_sqlite3_prepare(const struct stumpless_target *target, void **data)
Gets the preparation function and data pointer used to prepare statements for insertion into the data...
struct stumpless_target * stumpless_set_sqlite3_prepare(struct stumpless_target *target, stumpless_sqlite3_prepare_func_t preparer, void *data)
Set the function used to prepare statements for entries to this target.
struct stumpless_target * stumpless_open_sqlite3_target_with_options(const char *name, int flags, const char *vfs)
Opens a SQLite3 target with the provided options.
struct stumpless_target * stumpless_open_sqlite3_target(const char *name)
Opens a SQLite3 target.
void stumpless_close_sqlite3_target_only(const struct stumpless_target *target)
Closes a SQLite3 target, but does not touch the database handle.
void * stumpless_sqlite3_prepare(const struct stumpless_entry *entry, void *data, size_t *count)
The default prepare function used for SQLite3 targets.
const char * stumpless_get_sqlite3_insert_sql(const struct stumpless_target *target)
Gets the SQL statement used to insert entries into the database.
A log entry.
定义 entry.h:60
A target that log entries can be sent to.
定义 target.h:140
char * name
The name of this target.
定义 target.h:157
General types and functions for working with all targets.