3#if !defined(ORG_FOSSIL_SCM_FSL_CONFDB_H_INCLUDED)
4#define ORG_FOSSIL_SCM_FSL_CONFDB_H_INCLUDED
22#if defined(__cplusplus)
120 int32_t dflt,
char const * key );
125 int64_t dflt,
char const * key );
136 double dflt,
char const * key );
146 bool dflt,
char const * key );
256 char const * key,
char const * val );
273 char const * key, int32_t val );
278 char const * key, int64_t val );
288 char const * key,
double val );
297 char const * key,
bool val );
495#if defined(__cplusplus)
FSL_EXPORT bool fsl_configs_get_bool(fsl_cx *const f, char const *zCfg, bool dflt, char const *key)
The bool counterpart of fsl_configs_get_int32().
FSL_EXPORT fsl_id_t fsl_config_get_id(fsl_cx *const f, fsl_confdb_e mode, fsl_id_t dflt, char const *key)
fsl_id_t counterpart of fsl_config_get_int32().
FSL_EXPORT int fsl_config_set_double(fsl_cx *const f, fsl_confdb_e mode, char const *key, double val)
fsl_double counterpart of fsl_config_set_text().
FSL_EXPORT int fsl_config_set_id(fsl_cx *const f, fsl_confdb_e mode, char const *key, fsl_id_t val)
fsl_id_t counterpart of fsl_config_set_text().
FSL_EXPORT int fsl_config_set_text(fsl_cx *const f, fsl_confdb_e mode, char const *key, char const *val)
Sets a configuration variable in one of f's config databases, as specified by the mode parameter.
FSL_EXPORT int fsl_config_get_buffer(fsl_cx *const f, fsl_confdb_e mode, char const *key, fsl_buffer *const b)
The fsl_buffer-type counterpart of fsl_config_get_int32().
FSL_EXPORT int fsl_config_versionable_filename(fsl_cx *f, char const *key, fsl_buffer *b)
If f has an opened checkout, this replaces b's contents (re-using any existing memory) with an absolu...
FSL_EXPORT int64_t fsl_config_get_int64(fsl_cx *const f, fsl_confdb_e mode, int64_t dflt, char const *key)
int64_t counterpart of fsl_config_get_int32().
FSL_EXPORT int32_t fsl_configs_get_int32(fsl_cx *const f, char const *zCfg, int32_t dflt, char const *key)
A variant of fsl_config_get_int32() which can search through multiple config sources in an order spec...
FSL_EXPORT int64_t fsl_configs_get_int64(fsl_cx *const f, char const *zCfg, int64_t dflt, char const *key)
The int64_t counterpart of fsl_configs_get_int32().
FSL_EXPORT int fsl_config_set_blob(fsl_cx *const f, fsl_confdb_e mode, char const *key, void const *mem, fsl_int_t len)
The blob counterpart of fsl_config_set_text().
FSL_EXPORT double fsl_config_get_double(fsl_cx *const f, fsl_confdb_e mode, double dflt, char const *key)
double counterpart of fsl_config_get_int32().
FSL_EXPORT int fsl_config_unset(fsl_cx *const f, fsl_confdb_e mode, char const *key)
"Unsets" (removes) the given key from the given configuration database.
FSL_EXPORT int fsl_config_transaction_begin(fsl_cx *const f, fsl_confdb_e mode)
Begins (or recurses) a transaction on the given configuration database.
FSL_EXPORT int fsl_configs_get_buffer(fsl_cx *const f, char const *zCfg, char const *key, fsl_buffer *const b)
The buffer counterpart of fsl_configs_get_int32().
FSL_EXPORT fsl_db * fsl_config_for_role(fsl_cx *const f, fsl_confdb_e mode)
Returns a handle to the db associates with the given fsl_confdb_e value.
FSL_EXPORT int fsl_config_global_preferred_name(char **zOut)
Fetches the preferred name of the "global" db file for the current user by assigning it to *zOut.
FSL_EXPORT double fsl_configs_get_double(fsl_cx *const f, char const *zCfg, double dflt, char const *key)
The double counterpart of fsl_configs_get_int32().
fsl_confdb_e
A flag type for specifying which configuration backend a given API should be applied to.
@ FSL_CONFDB_NONE
Sentinel value.
@ FSL_CONFDB_REPO
Signfies the repository-level configuration area.
@ FSL_CONFDB_VERSIONABLE
The obligatory special case...
@ FSL_CONFDB_GLOBAL
Signfies the global-level (per system user) configuration area.
@ FSL_CONFDB_CKOUT
Signfies the checkout-level (a.k.a.
FSL_EXPORT fsl_id_t fsl_configs_get_id(fsl_cx *const f, char const *zCfg, fsl_id_t dflt, char const *key)
The fsl_id_t counterpart of fsl_configs_get_int32().
FSL_EXPORT char const * fsl_config_table_for_role(fsl_confdb_e mode)
Returns the name of the db table associated with the given mode.
FSL_EXPORT int fsl_config_set_int32(fsl_cx *const f, fsl_confdb_e mode, char const *key, int32_t val)
int32 counterpart of fsl_config_set_text().
FSL_EXPORT int fsl_config_set_bool(fsl_cx *const f, fsl_confdb_e mode, char const *key, bool val)
Boolean counterpart of fsl_config_set_text().
FSL_EXPORT char * fsl_configs_get_text(fsl_cx *const f, char const *zCfg, char const *key, fsl_size_t *len)
The C-string counterpart of fsl_configs_get_int32().
FSL_EXPORT int fsl_config_globs_load(fsl_cx *const f, fsl_list *const li, char const *key)
Populates li as a glob list from the given configuration key.
FSL_EXPORT int fsl_config_set_int64(fsl_cx *const f, fsl_confdb_e mode, char const *key, int64_t val)
int64 counterpart of fsl_config_set_text().
FSL_EXPORT int32_t fsl_config_get_int32(fsl_cx *const f, fsl_confdb_e mode, int32_t dflt, char const *key)
Returns the int32 value of a property from one of f's config dbs, as specified by the mode parameter.
FSL_EXPORT int fsl_config_transaction_end(fsl_cx *const f, fsl_confdb_e mode, bool rollback)
Pops the transaction stack pushed by fsl_config_transaction_begin().
FSL_EXPORT bool fsl_config_get_bool(fsl_cx *const f, fsl_confdb_e mode, bool dflt, char const *key)
Boolean countertpart of fsl_config_get_int32().
FSL_EXPORT char * fsl_config_get_text(fsl_cx *const f, fsl_confdb_e mode, char const *key, fsl_size_t *len)
A convenience form of fsl_config_get_buffer().
int32_t fsl_id_t
fsl_id_t is a signed integer type used to store database record IDs.
uint64_t fsl_size_t
fsl_size_t is an unsigned integer type used to denote absolute ranges and lengths.
int64_t fsl_int_t
fsl_int_t is a signed integer type used to denote "relative" ranges and lengths, or to tell a routine...
This file declares the core SCM-related public APIs.
A general-purpose buffer class, analog to Fossil's Blob class, but it is not called fsl_blob to avoid...
The main Fossil "context" type.
Generic list container type.