diff options
| author | Alberto Fanjul <albertofanjul@gmail.com> | 2019-06-18 08:31:31 +0200 |
|---|---|---|
| committer | Alberto Fanjul <albertofanjul@gmail.com> | 2019-07-05 14:12:04 +0200 |
| commit | 3be09b6c0295c834792d66c4d38d0e1a1c53e71c (patch) | |
| tree | a08eff7f96bce9df22198547115d909c25dddb1b /examples/common.h | |
| parent | 398412ccd3f982e2bc1de16d87bd00f27580c256 (diff) | |
| download | libgit2-3be09b6c0295c834792d66c4d38d0e1a1c53e71c.tar.gz | |
Compare buffers in diff example
Diffstat (limited to 'examples/common.h')
| -rw-r--r-- | examples/common.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/examples/common.h b/examples/common.h index c1d444e1d..204b17595 100644 --- a/examples/common.h +++ b/examples/common.h @@ -64,6 +64,14 @@ extern int lg2_tag(git_repository *repo, int argc, char **argv); extern void check_lg2(int error, const char *message, const char *extra); /** + * Read a file into a buffer + * + * @param path The path to the file that shall be read + * @return NUL-terminated buffer if the file was successfully read, NULL-pointer otherwise + */ +extern char *read_file(const char *path); + +/** * Exit the program, printing error to stderr */ extern void fatal(const char *message, const char *extra); @@ -89,7 +97,7 @@ struct args_info { /** * Check current `args` entry against `opt` string. If it matches * exactly, take the next arg as a string; if it matches as a prefix with - * an equal sign, take the remainder as a string; if value not supplied, + * an equal sign, take the remainder as a string; if value not supplied, * default value `def` will be given. otherwise return 0. */ extern int optional_str_arg( |
