diff options
| author | Vicent Martà <vicent@github.com> | 2013-04-22 04:06:11 -0700 |
|---|---|---|
| committer | Vicent Martà <vicent@github.com> | 2013-04-22 04:06:11 -0700 |
| commit | f063a75882769cb6fc652de425ac16ba4b88b616 (patch) | |
| tree | 8c9f02ac9b2e46846367098d3b6328c01cac7781 /include/git2/config.h | |
| parent | bfb4facb3a5e0b650811560fc49d27247fd9d85d (diff) | |
| parent | 21ca045100337bcb2905a20a72d42721d18871f9 (diff) | |
| download | libgit2-f063a75882769cb6fc652de425ac16ba4b88b616.tar.gz | |
Merge pull request #1485 from libgit2/include-git2-sys
Create include/git2/sys and move backend APIs there
Diffstat (limited to 'include/git2/config.h')
| -rw-r--r-- | include/git2/config.h | 52 |
1 files changed, 2 insertions, 50 deletions
diff --git a/include/git2/config.h b/include/git2/config.h index 19d4cb78d..5a2f956fd 100644 --- a/include/git2/config.h +++ b/include/git2/config.h @@ -43,29 +43,6 @@ typedef struct { typedef int (*git_config_foreach_cb)(const git_config_entry *, void *); - -/** - * Generic backend that implements the interface to - * access a configuration file - */ -struct git_config_backend { - unsigned int version; - struct git_config *cfg; - - /* Open means open the file/database and parse if necessary */ - int (*open)(struct git_config_backend *, unsigned int level); - int (*get)(const struct git_config_backend *, const char *key, const git_config_entry **entry); - int (*get_multivar)(struct git_config_backend *, const char *key, const char *regexp, git_config_foreach_cb callback, void *payload); - int (*set)(struct git_config_backend *, const char *key, const char *value); - int (*set_multivar)(git_config_backend *cfg, const char *name, const char *regexp, const char *value); - int (*del)(struct git_config_backend *, const char *key); - int (*foreach)(struct git_config_backend *, const char *, git_config_foreach_cb callback, void *payload); - int (*refresh)(struct git_config_backend *); - void (*free)(struct git_config_backend *); -}; -#define GIT_CONFIG_BACKEND_VERSION 1 -#define GIT_CONFIG_BACKEND_INIT {GIT_CONFIG_BACKEND_VERSION} - typedef enum { GIT_CVAR_FALSE = 0, GIT_CVAR_TRUE = 1, @@ -154,30 +131,6 @@ GIT_EXTERN(int) git_config_open_default(git_config **out); GIT_EXTERN(int) git_config_new(git_config **out); /** - * Add a generic config file instance to an existing config - * - * Note that the configuration object will free the file - * automatically. - * - * Further queries on this config object will access each - * of the config file instances in order (instances with - * a higher priority level will be accessed first). - * - * @param cfg the configuration to add the file to - * @param file the configuration file (backend) to add - * @param level the priority level of the backend - * @param force if a config file already exists for the given - * priority level, replace it - * @return 0 on success, GIT_EEXISTS when adding more than one file - * for a given priority level (and force_replace set to 0), or error code - */ -GIT_EXTERN(int) git_config_add_backend( - git_config *cfg, - git_config_backend *file, - unsigned int level, - int force); - -/** * Add an on-disk config file instance to an existing config * * The on-disk file pointed at by `path` will be opened and @@ -192,10 +145,9 @@ GIT_EXTERN(int) git_config_add_backend( * a higher priority level will be accessed first). * * @param cfg the configuration to add the file to - * @param path path to the configuration file (backend) to add + * @param path path to the configuration file to add * @param level the priority level of the backend - * @param force if a config file already exists for the given - * priority level, replace it + * @param force replace config file at the given priority level * @return 0 on success, GIT_EEXISTS when adding more than one file * for a given priority level (and force_replace set to 0), * GIT_ENOTFOUND when the file doesn't exist or error code |
