diff options
| author | Vicent Marti <tanoku@gmail.com> | 2011-07-04 11:43:34 +0200 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2011-07-05 02:04:03 +0200 |
| commit | f79026b4912bcd2336667f4c1663c06e233f0b32 (patch) | |
| tree | 645b776032e924b587fad986aa3f3dc08c98d4c5 /src/config_file.c | |
| parent | 678e9e045becdc5d75f2ce2259ed01c3531ee181 (diff) | |
| download | libgit2-f79026b4912bcd2336667f4c1663c06e233f0b32.tar.gz | |
fileops: Cleanup
Cleaned up the structure of the whole OS-abstraction layer.
fileops.c now contains a set of utility methods for file management used
by the library. These are abstractions on top of the original POSIX
calls.
There's a new file called `posix.c` that contains
emulations/reimplementations of all the POSIX calls the library uses.
These are prefixed with `p_`. There's a specific posix file for each
platform (win32 and unix).
All the path-related methods have been moved from `utils.c` to `path.c`
and have their own prefix.
Diffstat (limited to 'src/config_file.c')
| -rw-r--r-- | src/config_file.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/config_file.c b/src/config_file.c index b01778739..5f8cffa14 100644 --- a/src/config_file.c +++ b/src/config_file.c @@ -89,7 +89,7 @@ typedef struct { cvar_t_list var_list; struct { - gitfo_buf buffer; + git_fbuffer buffer; char *read_ptr; int line_number; int eof; @@ -278,7 +278,7 @@ static int config_open(git_config_file *cfg) int error; diskfile_backend *b = (diskfile_backend *)cfg; - error = gitfo_read_file(&b->reader.buffer, b->file_path); + error = git_futils_readbuffer(&b->reader.buffer, b->file_path); if(error < GIT_SUCCESS) goto cleanup; @@ -286,13 +286,13 @@ static int config_open(git_config_file *cfg) if (error < GIT_SUCCESS) goto cleanup; - gitfo_free_buf(&b->reader.buffer); + git_futils_freebuffer(&b->reader.buffer); return error; cleanup: cvar_list_free(&b->var_list); - gitfo_free_buf(&b->reader.buffer); + git_futils_freebuffer(&b->reader.buffer); return git__rethrow(error, "Failed to open config"); } @@ -921,7 +921,7 @@ static int config_write(diskfile_backend *cfg, cvar_t *var) const char *pre_end = NULL, *post_start = NULL; /* We need to read in our own config file */ - error = gitfo_read_file(&cfg->reader.buffer, cfg->file_path); + error = git_futils_readbuffer(&cfg->reader.buffer, cfg->file_path); if (error < GIT_SUCCESS) { return git__rethrow(error, "Failed to read existing config file %s", cfg->file_path); } @@ -1068,7 +1068,7 @@ static int config_write(diskfile_backend *cfg, cvar_t *var) else error = git_filebuf_commit(&file); - gitfo_free_buf(&cfg->reader.buffer); + git_futils_freebuffer(&cfg->reader.buffer); return error; } |
