diff options
Diffstat (limited to 'include/git2')
| -rw-r--r-- | include/git2/blob.h | 34 | ||||
| -rw-r--r-- | include/git2/branch.h | 6 | ||||
| -rw-r--r-- | include/git2/commit.h | 46 | ||||
| -rw-r--r-- | include/git2/common.h | 50 | ||||
| -rw-r--r-- | include/git2/config.h | 52 | ||||
| -rw-r--r-- | include/git2/errors.h | 28 | ||||
| -rw-r--r-- | include/git2/index.h | 72 | ||||
| -rw-r--r-- | include/git2/indexer.h | 6 | ||||
| -rw-r--r-- | include/git2/net.h | 24 | ||||
| -rw-r--r-- | include/git2/object.h | 28 | ||||
| -rw-r--r-- | include/git2/odb.h | 44 | ||||
| -rw-r--r-- | include/git2/odb_backend.h | 24 | ||||
| -rw-r--r-- | include/git2/oid.h | 56 | ||||
| -rw-r--r-- | include/git2/reflog.h | 28 | ||||
| -rw-r--r-- | include/git2/refs.h | 44 | ||||
| -rw-r--r-- | include/git2/refspec.h | 26 | ||||
| -rw-r--r-- | include/git2/remote.h | 30 | ||||
| -rw-r--r-- | include/git2/repository.h | 67 | ||||
| -rw-r--r-- | include/git2/revwalk.h | 42 | ||||
| -rw-r--r-- | include/git2/signature.h | 28 | ||||
| -rw-r--r-- | include/git2/status.h | 44 | ||||
| -rw-r--r-- | include/git2/tag.h | 46 | ||||
| -rw-r--r-- | include/git2/thread-utils.h | 82 | ||||
| -rw-r--r-- | include/git2/transport.h | 24 | ||||
| -rw-r--r-- | include/git2/tree.h | 38 | ||||
| -rw-r--r-- | include/git2/types.h | 46 | ||||
| -rw-r--r-- | include/git2/zlib.h | 24 |
27 files changed, 303 insertions, 736 deletions
diff --git a/include/git2/blob.h b/include/git2/blob.h index e366ce880..b2a2b034a 100644 --- a/include/git2/blob.h +++ b/include/git2/blob.h @@ -1,26 +1,8 @@ /* - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, - * as published by the Free Software Foundation. + * Copyright (C) 2009-2011 the libgit2 contributors * - * In addition to the permissions in the GNU General Public License, - * the authors give you unlimited permission to link the compiled - * version of this file into combinations with other programs, - * and to distribute those combinations without any restriction - * coming from the use of this file. (The General Public License - * restrictions do apply in other respects; for example, they cover - * modification of the file, and distribution when not linked into - * a combined executable.) - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_git_blob_h__ #define INCLUDE_git_blob_h__ @@ -45,7 +27,7 @@ GIT_BEGIN_DECL * @param blob pointer to the looked up blob * @param repo the repo to use when locating the blob. * @param id identity of the blob to locate. - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_INLINE(int) git_blob_lookup(git_blob **blob, git_repository *repo, const git_oid *id) { @@ -62,7 +44,7 @@ GIT_INLINE(int) git_blob_lookup(git_blob **blob, git_repository *repo, const git * @param repo the repo to use when locating the blob. * @param id identity of the blob to locate. * @param len the length of the short identifier - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_INLINE(int) git_blob_lookup_prefix(git_blob **blob, git_repository *repo, const git_oid *id, unsigned int len) { @@ -106,7 +88,7 @@ GIT_EXTERN(const void *) git_blob_rawcontent(git_blob *blob); * @param blob pointer to the blob * @return size on bytes */ -GIT_EXTERN(int) git_blob_rawsize(git_blob *blob); +GIT_EXTERN(size_t) git_blob_rawsize(git_blob *blob); /** * Read a file from the working folder of a repository @@ -117,7 +99,7 @@ GIT_EXTERN(int) git_blob_rawsize(git_blob *blob); * this repository cannot be bare * @param path file from which the blob will be created, * relative to the repository's working dir - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_blob_create_fromfile(git_oid *oid, git_repository *repo, const char *path); @@ -129,7 +111,7 @@ GIT_EXTERN(int) git_blob_create_fromfile(git_oid *oid, git_repository *repo, con * @param repo repository where to blob will be written * @param buffer data to be written into the blob * @param len length of the data - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_blob_create_frombuffer(git_oid *oid, git_repository *repo, const void *buffer, size_t len); diff --git a/include/git2/branch.h b/include/git2/branch.h index 456b7d1ac..5a92cf570 100644 --- a/include/git2/branch.h +++ b/include/git2/branch.h @@ -1,3 +1,9 @@ +/* + * Copyright (C) 2009-2011 the libgit2 contributors + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ #ifndef INCLUDE_branch_h__ #define INCLUDE_branch_h__ diff --git a/include/git2/commit.h b/include/git2/commit.h index 12646cf58..3c90e8007 100644 --- a/include/git2/commit.h +++ b/include/git2/commit.h @@ -1,26 +1,8 @@ /* - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, - * as published by the Free Software Foundation. - * - * In addition to the permissions in the GNU General Public License, - * the authors give you unlimited permission to link the compiled - * version of this file into combinations with other programs, - * and to distribute those combinations without any restriction - * coming from the use of this file. (The General Public License - * restrictions do apply in other respects; for example, they cover - * modification of the file, and distribution when not linked into - * a combined executable.) - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * Copyright (C) 2009-2011 the libgit2 contributors + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_git_commit_h__ #define INCLUDE_git_commit_h__ @@ -44,9 +26,9 @@ GIT_BEGIN_DECL * * @param commit pointer to the looked up commit * @param repo the repo to use when locating the commit. - * @param id identity of the commit to locate. If the object is - * an annotated tag it will be peeled back to the commit. - * @return 0 on success; error code otherwise + * @param id identity of the commit to locate. If the object is + * an annotated tag it will be peeled back to the commit. + * @return GIT_SUCCESS or an error code */ GIT_INLINE(int) git_commit_lookup(git_commit **commit, git_repository *repo, const git_oid *id) { @@ -61,10 +43,10 @@ GIT_INLINE(int) git_commit_lookup(git_commit **commit, git_repository *repo, con * * @param commit pointer to the looked up commit * @param repo the repo to use when locating the commit. - * @param id identity of the commit to locate. If the object is - * an annotated tag it will be peeled back to the commit. + * @param id identity of the commit to locate. If the object is + * an annotated tag it will be peeled back to the commit. * @param len the length of the short identifier - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_INLINE(int) git_commit_lookup_prefix(git_commit **commit, git_repository *repo, const git_oid *id, unsigned len) { @@ -153,7 +135,7 @@ GIT_EXTERN(const git_signature *) git_commit_author(git_commit *commit); * * @param tree_out pointer where to store the tree object * @param commit a previously loaded commit. - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_commit_tree(git_tree **tree_out, git_commit *commit); @@ -181,7 +163,7 @@ GIT_EXTERN(unsigned int) git_commit_parentcount(git_commit *commit); * @param parent Pointer where to store the parent commit * @param commit a previously loaded commit. * @param n the position of the parent (from 0 to `parentcount`) - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_commit_parent(git_commit **parent, git_commit *commit, unsigned int n); @@ -215,7 +197,7 @@ GIT_EXTERN(const git_oid *) git_commit_parent_oid(git_commit *commit, unsigned i * time of this commit * * @param committer Signature representing the committer and the - * commit time of this commit + * commit time of this commit * * @param message_encoding The encoding for the message in the * commit, represented with a standard encoding name. @@ -235,7 +217,7 @@ GIT_EXTERN(const git_oid *) git_commit_parent_oid(git_commit *commit, unsigned i * array may be NULL if `parent_count` is 0 (root commit). All the * given commits must be owned by the `repo`. * - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code * The created commit will be written to the Object Database and * the given reference will be updated to point to it */ diff --git a/include/git2/common.h b/include/git2/common.h index 58cb1f200..084981674 100644 --- a/include/git2/common.h +++ b/include/git2/common.h @@ -1,26 +1,8 @@ /* - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, - * as published by the Free Software Foundation. + * Copyright (C) 2009-2011 the libgit2 contributors * - * In addition to the permissions in the GNU General Public License, - * the authors give you unlimited permission to link the compiled - * version of this file into combinations with other programs, - * and to distribute those combinations without any restriction - * coming from the use of this file. (The General Public License - * restrictions do apply in other respects; for example, they cover - * modification of the file, and distribution when not linked into - * a combined executable.) - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_git_common_h__ #define INCLUDE_git_common_h__ @@ -30,20 +12,20 @@ #include <stdlib.h> #ifdef __cplusplus -# define GIT_BEGIN_DECL extern "C" { -# define GIT_END_DECL } +# define GIT_BEGIN_DECL extern "C" { +# define GIT_END_DECL } #else - /** Start declarations in C mode */ -# define GIT_BEGIN_DECL /* empty */ - /** End declarations in C mode */ -# define GIT_END_DECL /* empty */ + /** Start declarations in C mode */ +# define GIT_BEGIN_DECL /* empty */ + /** End declarations in C mode */ +# define GIT_END_DECL /* empty */ #endif /** Declare a public function exported for application use. */ -#ifdef __GNUC__ +#if __GNUC__ >= 4 # define GIT_EXTERN(type) extern \ - __attribute__((visibility("default"))) \ - type + __attribute__((visibility("default"))) \ + type #elif defined(_MSC_VER) # define GIT_EXTERN(type) __declspec(dllexport) type #else @@ -51,11 +33,11 @@ #endif /** Declare a public TLS symbol exported for application use. */ -#ifdef __GNUC__ +#if __GNUC__ >= 4 # define GIT_EXTERN_TLS(type) extern \ - __attribute__((visibility("default"))) \ - GIT_TLS \ - type + __attribute__((visibility("default"))) \ + GIT_TLS \ + type #elif defined(_MSC_VER) # define GIT_EXTERN_TLS(type) __declspec(dllexport) GIT_TLS type #else diff --git a/include/git2/config.h b/include/git2/config.h index e05d23694..74ee96bde 100644 --- a/include/git2/config.h +++ b/include/git2/config.h @@ -1,26 +1,8 @@ /* - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, - * as published by the Free Software Foundation. - * - * In addition to the permissions in the GNU General Public License, - * the authors give you unlimited permission to link the compiled - * version of this file into combinations with other programs, - * and to distribute those combinations without any restriction - * coming from the use of this file. (The General Public License - * restrictions do apply in other respects; for example, they cover - * modification of the file, and distribution when not linked into - * a combined executable.) - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * Copyright (C) 2009-2011 the libgit2 contributors + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_git_config_h__ #define INCLUDE_git_config_h__ @@ -76,7 +58,7 @@ GIT_EXTERN(int) git_config_find_global(char *global_config_path); * and opens the located file, if it exists. * * @param out Pointer to store the config instance - * @return GIT_SUCCESS on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_config_open_global(git_config **out); @@ -100,7 +82,7 @@ GIT_EXTERN(int) git_config_file__ondisk(struct git_config_file **out, const char * can do anything with it. * * @param out pointer to the new configuration - * @return GIT_SUCCESS on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_config_new(git_config **out); @@ -117,7 +99,7 @@ GIT_EXTERN(int) git_config_new(git_config **out); * @param cfg the configuration to add the file to * @param file the configuration file (backend) to add * @param priority the priority the backend should have - * @return GIT_SUCCESS on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_config_add_file(git_config *cfg, git_config_file *file, int priority); @@ -138,7 +120,7 @@ GIT_EXTERN(int) git_config_add_file(git_config *cfg, git_config_file *file, int * @param cfg the configuration to add the file to * @param path path to the configuration file (backend) to add * @param priority the priority the backend should have - * @return GIT_SUCCESS on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_config_add_file_ondisk(git_config *cfg, const char *path, int priority); @@ -153,7 +135,7 @@ GIT_EXTERN(int) git_config_add_file_ondisk(git_config *cfg, const char *path, in * * @param cfg The configuration instance to create * @param path Path to the on-disk file to open - * @return GIT_SUCCESS on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_config_open_ondisk(git_config **cfg, const char *path); @@ -170,7 +152,7 @@ GIT_EXTERN(void) git_config_free(git_config *cfg); * @param cfg where to look for the variable * @param name the variable's name * @param out pointer to the variable where the value should be stored - * @return GIT_SUCCESS on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_config_get_int(git_config *cfg, const char *name, int *out); @@ -180,7 +162,7 @@ GIT_EXTERN(int) git_config_get_int(git_config *cfg, const char *name, int *out); * @param cfg where to look for the variable * @param name the variable's name * @param out pointer to the variable where the value should be stored - * @return GIT_SUCCESS on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_config_get_long(git_config *cfg, const char *name, long int *out); @@ -193,7 +175,7 @@ GIT_EXTERN(int) git_config_get_long(git_config *cfg, const char *name, long int * @param cfg where to look for the variable * @param name the variable's name * @param out pointer to the variable where the value should be stored - * @return GIT_SUCCESS on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_config_get_bool(git_config *cfg, const char *name, int *out); @@ -206,7 +188,7 @@ GIT_EXTERN(int) git_config_get_bool(git_config *cfg, const char *name, int *out) * @param cfg where to look for the variable * @param name the variable's name * @param out pointer to the variable's value - * @return GIT_SUCCESS on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_config_get_string(git_config *cfg, const char *name, const char **out); @@ -216,7 +198,7 @@ GIT_EXTERN(int) git_config_get_string(git_config *cfg, const char *name, const c * @param cfg where to look for the variable * @param name the variable's name * @param value Integer value for the variable - * @return GIT_SUCCESS on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_config_set_int(git_config *cfg, const char *name, int value); @@ -226,7 +208,7 @@ GIT_EXTERN(int) git_config_set_int(git_config *cfg, const char *name, int value) * @param cfg where to look for the variable * @param name the variable's name * @param value Long integer value for the variable - * @return GIT_SUCCESS on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_config_set_long(git_config *cfg, const char *name, long int value); @@ -236,7 +218,7 @@ GIT_EXTERN(int) git_config_set_long(git_config *cfg, const char *name, long int * @param cfg where to look for the variable * @param name the variable's name * @param value the value to store - * @return GIT_SUCCESS on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_config_set_bool(git_config *cfg, const char *name, int value); @@ -249,7 +231,7 @@ GIT_EXTERN(int) git_config_set_bool(git_config *cfg, const char *name, int value * @param cfg where to look for the variable * @param name the variable's name * @param value the string to store. - * @return GIT_SUCCESS on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_config_set_string(git_config *cfg, const char *name, const char *value); diff --git a/include/git2/errors.h b/include/git2/errors.h index 710ac244b..5ac0d5b27 100644 --- a/include/git2/errors.h +++ b/include/git2/errors.h @@ -1,26 +1,8 @@ /* - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, - * as published by the Free Software Foundation. + * Copyright (C) 2009-2011 the libgit2 contributors * - * In addition to the permissions in the GNU General Public License, - * the authors give you unlimited permission to link the compiled - * version of this file into combinations with other programs, - * and to distribute those combinations without any restriction - * coming from the use of this file. (The General Public License - * restrictions do apply in other respects; for example, they cover - * modification of the file, and distribution when not linked into - * a combined executable.) - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_git_errors_h__ #define INCLUDE_git_errors_h__ @@ -82,7 +64,7 @@ typedef enum { GIT_EINVALIDREFNAME = -15, /** The specified reference has its data corrupted */ - GIT_EREFCORRUPTED = -16, + GIT_EREFCORRUPTED = -16, /** The specified symbolic reference is too deeply nested */ GIT_ETOONESTEDSYMREF = -17, @@ -129,7 +111,7 @@ typedef enum { /** The path pattern and string did not match */ GIT_ENOMATCH = -31, - /** The buffer is too short to satisfy the request */ + /** The buffer is too short to satisfy the request */ GIT_ESHORTBUFFER = -32, } git_error; diff --git a/include/git2/index.h b/include/git2/index.h index 18ab9b858..5e9c34d4b 100644 --- a/include/git2/index.h +++ b/include/git2/index.h @@ -1,26 +1,8 @@ /* - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, - * as published by the Free Software Foundation. - * - * In addition to the permissions in the GNU General Public License, - * the authors give you unlimited permission to link the compiled - * version of this file into combinations with other programs, - * and to distribute those combinations without any restriction - * coming from the use of this file. (The General Public License - * restrictions do apply in other respects; for example, they cover - * modification of the file, and distribution when not linked into - * a combined executable.) - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * Copyright (C) 2009-2011 the libgit2 contributors + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_git_index_h__ #define INCLUDE_git_index_h__ @@ -38,10 +20,10 @@ */ GIT_BEGIN_DECL -#define GIT_IDXENTRY_NAMEMASK (0x0fff) +#define GIT_IDXENTRY_NAMEMASK (0x0fff) #define GIT_IDXENTRY_STAGEMASK (0x3000) -#define GIT_IDXENTRY_EXTENDED (0x4000) -#define GIT_IDXENTRY_VALID (0x8000) +#define GIT_IDXENTRY_EXTENDED (0x4000) +#define GIT_IDXENTRY_VALID (0x8000) #define GIT_IDXENTRY_STAGESHIFT 12 /* @@ -51,26 +33,26 @@ GIT_BEGIN_DECL * * In-memory only flags: */ -#define GIT_IDXENTRY_UPDATE (1 << 0) -#define GIT_IDXENTRY_REMOVE (1 << 1) -#define GIT_IDXENTRY_UPTODATE (1 << 2) -#define GIT_IDXENTRY_ADDED (1 << 3) +#define GIT_IDXENTRY_UPDATE (1 << 0) +#define GIT_IDXENTRY_REMOVE (1 << 1) +#define GIT_IDXENTRY_UPTODATE (1 << 2) +#define GIT_IDXENTRY_ADDED (1 << 3) -#define GIT_IDXENTRY_HASHED (1 << 4) -#define GIT_IDXENTRY_UNHASHED (1 << 5) -#define GIT_IDXENTRY_WT_REMOVE (1 << 6) /* remove in work directory */ -#define GIT_IDXENTRY_CONFLICTED (1 << 7) +#define GIT_IDXENTRY_HASHED (1 << 4) +#define GIT_IDXENTRY_UNHASHED (1 << 5) +#define GIT_IDXENTRY_WT_REMOVE (1 << 6) /* remove in work directory */ +#define GIT_IDXENTRY_CONFLICTED (1 << 7) -#define GIT_IDXENTRY_UNPACKED (1 << 8) +#define GIT_IDXENTRY_UNPACKED (1 << 8) #define GIT_IDXENTRY_NEW_SKIP_WORKTREE (1 << 9) /* * Extended on-disk flags: */ -#define GIT_IDXENTRY_INTENT_TO_ADD (1 << 13) -#define GIT_IDXENTRY_SKIP_WORKTREE (1 << 14) +#define GIT_IDXENTRY_INTENT_TO_ADD (1 << 13) +#define GIT_IDXENTRY_SKIP_WORKTREE (1 << 14) /* GIT_IDXENTRY_EXTENDED2 is for future extension */ -#define GIT_IDXENTRY_EXTENDED2 (1 << 15) +#define GIT_IDXENTRY_EXTENDED2 (1 << 15) #define GIT_IDXENTRY_EXTENDED_FLAGS (GIT_IDXENTRY_INTENT_TO_ADD | GIT_IDXENTRY_SKIP_WORKTREE) @@ -124,7 +106,7 @@ typedef struct git_index_entry_unmerged { * * @param index the pointer for the new index * @param index_path the path to the index file in disk - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_index_open(git_index **index, const char *index_path); @@ -149,7 +131,7 @@ GIT_EXTERN(void) git_index_free(git_index *index); * by reading from the hard disk. * * @param index an existing index object - * @return 0 on success, otherwise an error code + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_index_read(git_index *index); @@ -158,7 +140,7 @@ GIT_EXTERN(int) git_index_read(git_index *index); * using an atomic file lock. * * @param index an existing index object - * @return 0 on success, otherwise an error code + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_index_write(git_index *index); @@ -190,7 +172,7 @@ GIT_EXTERN(void) git_index_uniq(git_index *index); * @param index an existing index object * @param path filename to add * @param stage stage for the entry - * @return 0 on success, otherwise an error code + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_index_add(git_index *index, const char *path, int stage); @@ -202,7 +184,7 @@ GIT_EXTERN(int) git_index_add(git_index *index, const char *path, int stage); * * @param index an existing index object * @param source_entry new entry object - * @return 0 on success, otherwise an error code + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_index_add2(git_index *index, const git_index_entry *source_entry); @@ -221,7 +203,7 @@ GIT_EXTERN(int) git_index_add2(git_index *index, const git_index_entry *source_e * @param index an existing index object * @param path filename to add * @param stage stage for the entry - * @return 0 on success, otherwise an error code + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_index_append(git_index *index, const char *path, int stage); @@ -238,7 +220,7 @@ GIT_EXTERN(int) git_index_append(git_index *index, const char *path, int stage); * * @param index an existing index object * @param source_entry new entry object - * @return 0 on success, otherwise an error code + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_index_append2(git_index *index, const git_index_entry *source_entry); @@ -247,7 +229,7 @@ GIT_EXTERN(int) git_index_append2(git_index *index, const git_index_entry *sourc * * @param index an existing index object * @param position position of the entry to remove - * @return 0 on success, otherwise an error code + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_index_remove(git_index *index, int position); diff --git a/include/git2/indexer.h b/include/git2/indexer.h index 2852d7e6f..bd9b9b6ab 100644 --- a/include/git2/indexer.h +++ b/include/git2/indexer.h @@ -1,3 +1,9 @@ +/* + * Copyright (C) 2009-2011 the libgit2 contributors + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ #ifndef _INCLUDE_git_indexer_h__ #define _INCLUDE_git_indexer_h__ diff --git a/include/git2/net.h b/include/git2/net.h index d4f475527..5fb918599 100644 --- a/include/git2/net.h +++ b/include/git2/net.h @@ -1,26 +1,8 @@ /* - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, - * as published by the Free Software Foundation. + * Copyright (C) 2009-2011 the libgit2 contributors * - * In addition to the permissions in the GNU General Public License, - * the authors give you unlimited permission to link the compiled - * version of this file into combinations with other programs, - * and to distribute those combinations without any restriction - * coming from the use of this file. (The General Public License - * restrictions do apply in other respects; for example, they cover - * modification of the file, and distribution when not linked into - * a combined executable.) - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_net_h__ #define INCLUDE_net_h__ diff --git a/include/git2/object.h b/include/git2/object.h index 07ba1a1c7..d82a71c3c 100644 --- a/include/git2/object.h +++ b/include/git2/object.h @@ -1,26 +1,8 @@ /* - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, - * as published by the Free Software Foundation. - * - * In addition to the permissions in the GNU General Public License, - * the authors give you unlimited permission to link the compiled - * version of this file into combinations with other programs, - * and to distribute those combinations without any restriction - * coming from the use of this file. (The General Public License - * restrictions do apply in other respects; for example, they cover - * modification of the file, and distribution when not linked into - * a combined executable.) - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * Copyright (C) 2009-2011 the libgit2 contributors + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_git_object_h__ #define INCLUDE_git_object_h__ @@ -87,7 +69,7 @@ GIT_EXTERN(int) git_object_lookup( * @param id a short identifier for the object * @param len the length of the short identifier * @param type the type of the object - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_object_lookup_prefix( git_object **object_out, diff --git a/include/git2/odb.h b/include/git2/odb.h index d0c369055..27837418b 100644 --- a/include/git2/odb.h +++ b/include/git2/odb.h @@ -1,26 +1,8 @@ /* - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, - * as published by the Free Software Foundation. - * - * In addition to the permissions in the GNU General Public License, - * the authors give you unlimited permission to link the compiled - * version of this file into combinations with other programs, - * and to distribute those combinations without any restriction - * coming from the use of this file. (The General Public License - * restrictions do apply in other respects; for example, they cover - * modification of the file, and distribution when not linked into - * a combined executable.) - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * Copyright (C) 2009-2011 the libgit2 contributors + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_git_odb_h__ #define INCLUDE_git_odb_h__ @@ -46,9 +28,8 @@ GIT_BEGIN_DECL * backend must be manually added using `git_odb_add_backend()` * * @param out location to store the database pointer, if opened. - * Set to NULL if the open failed. - * @return GIT_SUCCESS if the database was created; otherwise an error - * code describing why the open was not possible. + * Set to NULL if the open failed. + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_odb_new(git_odb **out); @@ -64,10 +45,9 @@ GIT_EXTERN(int) git_odb_new(git_odb **out); * contains a 'pack/' folder with the corresponding data * * @param out location to store the database pointer, if opened. - * Set to NULL if the open failed. + * Set to NULL if the open failed. * @param objects_dir path of the backends' "objects" directory. - * @return GIT_SUCCESS if the database opened; otherwise an error - * code describing why the open was not possible. + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_odb_open(git_odb **out, const char *objects_dir); @@ -110,7 +90,7 @@ GIT_EXTERN(int) git_odb_add_alternate(git_odb *odb, git_odb_backend *backend, in /** * Close an open object database. * - * @param db database pointer to close. If NULL no action is taken. + * @param db database pointer to close. If NULL no action is taken. */ GIT_EXTERN(void) git_odb_close(git_odb *db); @@ -208,7 +188,7 @@ GIT_EXTERN(int) git_odb_exists(git_odb *db, const git_oid *id); * @param data buffer with the data to storr * @param len size of the buffer * @param type type of the data to store - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_odb_write(git_oid *oid, git_odb *odb, const void *data, size_t len, git_otype type); @@ -277,7 +257,7 @@ GIT_EXTERN(int) git_odb_open_rstream(git_odb_stream **stream, git_odb *db, const * @param data data to hash * @param len size of the data * @param type of the data to hash - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_odb_hash(git_oid *id, const void *data, size_t len, git_otype type); @@ -290,7 +270,7 @@ GIT_EXTERN(int) git_odb_hash(git_oid *id, const void *data, size_t len, git_otyp * @param out oid structure the result is written into. * @param path file to read and determine object id for * @param type the type of the object that will be hashed - * @return GIT_SUCCESS if valid; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_odb_hashfile(git_oid *out, const char *path, git_otype type); diff --git a/include/git2/odb_backend.h b/include/git2/odb_backend.h index 43a1c2d21..9d0bfdd47 100644 --- a/include/git2/odb_backend.h +++ b/include/git2/odb_backend.h @@ -1,26 +1,8 @@ /* - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, - * as published by the Free Software Foundation. + * Copyright (C) 2009-2011 the libgit2 contributors * - * In addition to the permissions in the GNU General Public License, - * the authors give you unlimited permission to link the compiled - * version of this file into combinations with other programs, - * and to distribute those combinations without any restriction - * coming from the use of this file. (The General Public License - * restrictions do apply in other respects; for example, they cover - * modification of the file, and distribution when not linked into - * a combined executable.) - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_git_odb_backend_h__ #define INCLUDE_git_odb_backend_h__ diff --git a/include/git2/oid.h b/include/git2/oid.h index 8a0f134b9..f9636d1fc 100644 --- a/include/git2/oid.h +++ b/include/git2/oid.h @@ -1,26 +1,8 @@ /* - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, - * as published by the Free Software Foundation. - * - * In addition to the permissions in the GNU General Public License, - * the authors give you unlimited permission to link the compiled - * version of this file into combinations with other programs, - * and to distribute those combinations without any restriction - * coming from the use of this file. (The General Public License - * restrictions do apply in other respects; for example, they cover - * modification of the file, and distribution when not linked into - * a combined executable.) - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * Copyright (C) 2009-2011 the libgit2 contributors + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_git_oid_h__ #define INCLUDE_git_oid_h__ @@ -59,9 +41,9 @@ struct _git_oid { * * @param out oid structure the result is written into. * @param str input hex string; must be pointing at the start of - * the hex sequence and have at least the number of bytes - * needed for an oid encoded in hex (40 bytes). - * @return GIT_SUCCESS if valid; GIT_ENOTOID on failure. + * the hex sequence and have at least the number of bytes + * needed for an oid encoded in hex (40 bytes). + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_oid_fromstr(git_oid *out, const char *str); @@ -74,7 +56,7 @@ GIT_EXTERN(int) git_oid_fromstr(git_oid *out, const char *str); * @param out oid structure the result is written into. * @param str input hex string of at least size `length` * @param length length of the input string - * @return GIT_SUCCESS if valid; GIT_ENOTOID on failure. + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_oid_fromstrn(git_oid *out, const char *str, size_t length); @@ -90,10 +72,10 @@ GIT_EXTERN(void) git_oid_fromraw(git_oid *out, const unsigned char *raw); * Format a git_oid into a hex string. * * @param str output hex string; must be pointing at the start of - * the hex sequence and have at least the number of bytes - * needed for an oid encoded in hex (40 bytes). Only the - * oid digits are written; a '\\0' terminator must be added - * by the caller if it is required. + * the hex sequence and have at least the number of bytes + * needed for an oid encoded in hex (40 bytes). Only the + * oid digits are written; a '\\0' terminator must be added + * by the caller if it is required. * @param oid oid structure to format. */ GIT_EXTERN(void) git_oid_fmt(char *str, const git_oid *oid); @@ -105,10 +87,10 @@ GIT_EXTERN(void) git_oid_fmt(char *str, const git_oid *oid); * hex digitis of the oid and "..." is the remaining 38 digits. * * @param str output hex string; must be pointing at the start of - * the hex sequence and have at least the number of bytes - * needed for an oid encoded in hex (41 bytes). Only the - * oid digits are written; a '\\0' terminator must be added - * by the caller if it is required. + * the hex sequence and have at least the number of bytes + * needed for an oid encoded in hex (41 bytes). Only the + * oid digits are written; a '\\0' terminator must be added + * by the caller if it is required. * @param oid oid structure to format. */ GIT_EXTERN(void) git_oid_pathfmt(char *str, const git_oid *oid); @@ -117,8 +99,8 @@ GIT_EXTERN(void) git_oid_pathfmt(char *str, const git_oid *oid); * Format a git_oid into a newly allocated c-string. * * @param oid the oid structure to format - * @return the c-string; NULL if memory is exhausted. Caller must - * deallocate the string with free(). + * @return the c-string; NULL if memory is exhausted. Caller must + * deallocate the string with free(). */ GIT_EXTERN(char *) git_oid_allocfmt(const git_oid *oid); @@ -135,7 +117,7 @@ GIT_EXTERN(char *) git_oid_allocfmt(const git_oid *oid); * @param n the size of the out buffer. * @param oid the oid structure to format. * @return the out buffer pointer, assuming no input parameter - * errors, otherwise a pointer to an empty string. + * errors, otherwise a pointer to an empty string. */ GIT_EXTERN(char *) git_oid_to_string(char *out, size_t n, const git_oid *oid); diff --git a/include/git2/reflog.h b/include/git2/reflog.h index 53b344733..9ad42b73b 100644 --- a/include/git2/reflog.h +++ b/include/git2/reflog.h @@ -1,26 +1,8 @@ /* - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, - * as published by the Free Software Foundation. + * Copyright (C) 2009-2011 the libgit2 contributors * - * In addition to the permissions in the GNU General Public License, - * the authors give you unlimited permission to link the compiled - * version of this file into combinations with other programs, - * and to distribute those combinations without any restriction - * coming from the use of this file. (The General Public License - * restrictions do apply in other respects; for example, they cover - * modification of the file, and distribution when not linked into - * a combined executable.) - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_git_reflog_h__ #define INCLUDE_git_reflog_h__ @@ -46,7 +28,7 @@ GIT_BEGIN_DECL * * @param reflog pointer to reflog * @param ref reference to read the reflog for - * @return GIT_SUCCESS on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_reflog_read(git_reflog **reflog, git_reference *ref); @@ -64,7 +46,7 @@ GIT_EXTERN(int) git_reflog_read(git_reflog **reflog, git_reference *ref); * @param oid_old the OID the reference was pointing to * @param committer the signature of the committer * @param msg the reflog message - * @return GIT_SUCCESS on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_reflog_write(git_reference *ref, const git_oid *oid_old, const git_signature *committer, const char *msg); diff --git a/include/git2/refs.h b/include/git2/refs.h index ff2bc9d87..c319bfb3d 100644 --- a/include/git2/refs.h +++ b/include/git2/refs.h @@ -1,26 +1,8 @@ /* - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, - * as published by the Free Software Foundation. - * - * In addition to the permissions in the GNU General Public License, - * the authors give you unlimited permission to link the compiled - * version of this file into combinations with other programs, - * and to distribute those combinations without any restriction - * coming from the use of this file. (The General Public License - * restrictions do apply in other respects; for example, they cover - * modification of the file, and distribution when not linked into - * a combined executable.) - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * Copyright (C) 2009-2011 the libgit2 contributors + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_git_refs_h__ #define INCLUDE_git_refs_h__ @@ -47,7 +29,7 @@ GIT_BEGIN_DECL * @param reference_out pointer to the looked-up reference * @param repo the repository to look up the reference * @param name the long name for the reference (e.g. HEAD, ref/heads/master, refs/tags/v0.1.0, ...) - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_reference_lookup(git_reference **reference_out, git_repository *repo, const char *name); @@ -68,7 +50,7 @@ GIT_EXTERN(int) git_reference_lookup(git_reference **reference_out, git_reposito * @param name The name of the reference * @param target The target of the reference * @param force Overwrite existing references - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_reference_create_symbolic(git_reference **ref_out, git_repository *repo, const char *name, const char *target, int force); @@ -89,7 +71,7 @@ GIT_EXTERN(int) git_reference_create_symbolic(git_reference **ref_out, git_repos * @param name The name of the reference * @param id The object id pointed to by the reference. * @param force Overwrite existing references - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_reference_create_oid(git_reference **ref_out, git_repository *repo, const char *name, const git_oid *id, int force); @@ -142,7 +124,7 @@ GIT_EXTERN(const char *) git_reference_name(git_reference *ref); * * @param resolved_ref Pointer to the peeled reference * @param ref The reference - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_reference_resolve(git_reference **resolved_ref, git_reference *ref); @@ -165,7 +147,7 @@ GIT_EXTERN(git_repository *) git_reference_owner(git_reference *ref); * * @param ref The reference * @param target The new target for the reference - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_reference_set_target(git_reference *ref, const char *target); @@ -180,7 +162,7 @@ GIT_EXTERN(int) git_reference_set_target(git_reference *ref, const char *target) * * @param ref The reference * @param id The new target OID for the reference - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_reference_set_oid(git_reference *ref, const git_oid *id); @@ -222,7 +204,7 @@ GIT_EXTERN(int) git_reference_delete(git_reference *ref); * references previously loaded on the cache. * * @param repo Repository where the loose refs will be packed - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_reference_packall(git_repository *repo); @@ -245,7 +227,7 @@ GIT_EXTERN(int) git_reference_packall(git_repository *repo); * @param repo Repository where to find the refs * @param list_flags Filtering flags for the reference * listing. - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_reference_listall(git_strarray *array, git_repository *repo, unsigned int list_flags); @@ -267,7 +249,7 @@ GIT_EXTERN(int) git_reference_listall(git_strarray *array, git_repository *repo, * listing. * @param callback Function which will be called for every listed ref * @param payload Additional data to pass to the callback - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_reference_foreach(git_repository *repo, unsigned int list_flags, int (*callback)(const char *, void *), void *payload); diff --git a/include/git2/refspec.h b/include/git2/refspec.h index dd0dc5873..eccbeaa7c 100644 --- a/include/git2/refspec.h +++ b/include/git2/refspec.h @@ -1,26 +1,8 @@ /* - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, - * as published by the Free Software Foundation. + * Copyright (C) 2009-2011 the libgit2 contributors * - * In addition to the permissions in the GNU General Public License, - * the authors give you unlimited permission to link the compiled - * version of this file into combinations with other programs, - * and to distribute those combinations without any restriction - * coming from the use of this file. (The General Public License - * restrictions do apply in other respects; for example, they cover - * modification of the file, and distribution when not linked into - * a combined executable.) - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_git_refspec_h__ #define INCLUDE_git_refspec_h__ @@ -69,7 +51,7 @@ int git_refspec_src_match(const git_refspec *refspec, const char *refname); * @param outlen the size ouf the `out` buffer * @param spec the refspec * @param name the name of the reference to transform - * @preturn GIT_SUCCESS, GIT_ESHORTBUFFER or another error + * @return GIT_SUCCESS, GIT_ESHORTBUFFER or another error */ int git_refspec_transform(char *out, size_t outlen, const git_refspec *spec, const char *name); diff --git a/include/git2/remote.h b/include/git2/remote.h index 651e41075..e0be93757 100644 --- a/include/git2/remote.h +++ b/include/git2/remote.h @@ -1,26 +1,8 @@ /* - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, - * as published by the Free Software Foundation. - * - * In addition to the permissions in the GNU General Public License, - * the authors give you unlimited permission to link the compiled - * version of this file into combinations with other programs, - * and to distribute those combinations without any restriction - * coming from the use of this file. (The General Public License - * restrictions do apply in other respects; for example, they cover - * modification of the file, and distribution when not linked into - * a combined executable.) - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * Copyright (C) 2009-2011 the libgit2 contributors + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_git_remote_h__ #define INCLUDE_git_remote_h__ @@ -53,7 +35,7 @@ GIT_BEGIN_DECL * @param out pointer to the new remote object * @param repo the associtated repository * @param url the remote repository's URL - * @return GIT_SUCCESS or an error message + * @return GIT_SUCCESS or an error code */ int git_remote_new(git_remote **out, git_repository *repo, const char *url); @@ -63,7 +45,7 @@ int git_remote_new(git_remote **out, git_repository *repo, const char *url); * @param out pointer to the new remote object * @param cfg the repository's configuration * @param name the remote's name - * @return 0 on success; error value otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_remote_get(struct git_remote **out, struct git_config *cfg, const char *name); diff --git a/include/git2/repository.h b/include/git2/repository.h index 4088ff7f9..d12cfbec7 100644 --- a/include/git2/repository.h +++ b/include/git2/repository.h @@ -1,26 +1,8 @@ /* - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, - * as published by the Free Software Foundation. - * - * In addition to the permissions in the GNU General Public License, - * the authors give you unlimited permission to link the compiled - * version of this file into combinations with other programs, - * and to distribute those combinations without any restriction - * coming from the use of this file. (The General Public License - * restrictions do apply in other respects; for example, they cover - * modification of the file, and distribution when not linked into - * a combined executable.) - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * Copyright (C) 2009-2011 the libgit2 contributors + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_git_repository_h__ #define INCLUDE_git_repository_h__ @@ -59,7 +41,7 @@ GIT_BEGIN_DECL * * @param repository pointer to the repo which will be opened * @param path the path to the repository - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_repository_open(git_repository **repository, const char *path); @@ -88,7 +70,7 @@ GIT_EXTERN(int) git_repository_open(git_repository **repository, const char *pat * Equivalent to $GIT_WORK_TREE. * If NULL, the repository is assumed to be bare. * - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_repository_open2(git_repository **repository, const char *git_dir, @@ -123,7 +105,7 @@ GIT_EXTERN(int) git_repository_open2(git_repository **repository, * Equivalent to $GIT_WORK_TREE. * If NULL, the repository is assumed to be bare. * - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_repository_open3(git_repository **repository, @@ -156,7 +138,7 @@ GIT_EXTERN(int) git_repository_open3(git_repository **repository, * lookup always performs on start_path no matter start_path appears in ceiling_dirs * ceiling_dirs might be NULL (which is equivalent to an empty string) * - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_repository_discover(char *repository_path, size_t size, const char *start_path, int across_fs, const char *ceiling_dirs); @@ -184,7 +166,7 @@ GIT_EXTERN(git_odb *) git_repository_database(git_repository *repo); * * @param index Pointer where to store the index * @param repo a repository object - * @return 0 on success; error code if the index could not be opened + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_repository_index(git_index **index, git_repository *repo); @@ -214,11 +196,21 @@ GIT_EXTERN(void) git_repository_free(git_repository *repo); * at the pointed path. If false, provided path will be considered as the working * directory into which the .git directory will be created. * - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_repository_init(git_repository **repo_out, const char *path, unsigned is_bare); /** + * Retrieve and resolve the reference pointed at by HEAD. + * + * @param head_out pointer to the reference which will be retrieved + * @param repo a repository object + * + * @return 0 on success; error code otherwise + */ +GIT_EXTERN(int) git_repository_head(git_reference **head_out, git_repository *repo); + +/** * Check if a repository's HEAD is detached * * A repository's HEAD is detached when it points directly to a commit @@ -292,13 +284,10 @@ GIT_EXTERN(int) git_repository_is_bare(git_repository *repo); /** * Retrieve the relevant configuration for a repository * - * By default he returned `git_config` instance contains a single - * configuration file, the `.gitconfig' file that may be found - * inside the repository. - * - * If the `user_config_path` variable is not NULL, the given config - * file will be also included in the configuration set. On most UNIX - * systems, this file may be found on `$HOME/.gitconfig`. + * By default he returned `git_config` instance contains the two most + * common configuration files, the `config' file that may be found + * inside the repository, and the `$HOME/.gitconfig' "global" + * configuration file. * * If the `system_config_path` variable is not NULL, the given config * file will be also included in the configuration set. On most UNIX @@ -308,23 +297,21 @@ GIT_EXTERN(int) git_repository_is_bare(git_repository *repo); * order: * * - Repository configuration file - * - User configuration file + * - Global configuration file * - System configuration file * - * The method will fail if any of the passed config files cannot be - * found or accessed. + * The method will fail if any of the passed system config file found + * or accessed. * * The returned `git_config` instance is owned by the caller and must * be manually free'd once it's no longer on use. * * @param out the repository's configuration * @param repo the repository for which to get the config - * @param user_config_path Path to the user config file * @param system_config_path Path to the system-wide config file */ GIT_EXTERN(int) git_repository_config(git_config **out, git_repository *repo, - const char *user_config_path, const char *system_config_path); /** @} */ diff --git a/include/git2/revwalk.h b/include/git2/revwalk.h index b37a16c83..c84c5d301 100644 --- a/include/git2/revwalk.h +++ b/include/git2/revwalk.h @@ -1,26 +1,8 @@ /* - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, - * as published by the Free Software Foundation. - * - * In addition to the permissions in the GNU General Public License, - * the authors give you unlimited permission to link the compiled - * version of this file into combinations with other programs, - * and to distribute those combinations without any restriction - * coming from the use of this file. (The General Public License - * restrictions do apply in other respects; for example, they cover - * modification of the file, and distribution when not linked into - * a combined executable.) - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * Copyright (C) 2009-2011 the libgit2 contributors + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_git_revwalk_h__ #define INCLUDE_git_revwalk_h__ @@ -44,28 +26,28 @@ GIT_BEGIN_DECL * and subject to change at any time. * This is the default sorting for new walkers. */ -#define GIT_SORT_NONE (0) +#define GIT_SORT_NONE (0) /** * Sort the repository contents in topological order * (parents before children); this sorting mode * can be combined with time sorting. */ -#define GIT_SORT_TOPOLOGICAL (1 << 0) +#define GIT_SORT_TOPOLOGICAL (1 << 0) /** * Sort the repository contents by commit time; * this sorting mode can be combined with * topological sorting. */ -#define GIT_SORT_TIME (1 << 1) +#define GIT_SORT_TIME (1 << 1) /** * Iterate through the repository contents in reverse * order; this sorting mode can be combined with * any of the above. */ -#define GIT_SORT_REVERSE (1 << 2) +#define GIT_SORT_REVERSE (1 << 2) /** * Allocate a new revision walker to iterate through a repo. @@ -83,7 +65,7 @@ GIT_BEGIN_DECL * * @param walker pointer to the new revision walker * @param repo the repo to walk through - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_revwalk_new(git_revwalk **walker, git_repository *repo); @@ -115,7 +97,7 @@ GIT_EXTERN(void) git_revwalk_reset(git_revwalk *walker); * * @param walk the walker being used for the traversal. * @param oid the oid of the commit to start from. - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_revwalk_push(git_revwalk *walk, const git_oid *oid); @@ -131,7 +113,7 @@ GIT_EXTERN(int) git_revwalk_push(git_revwalk *walk, const git_oid *oid); * * @param walk the walker being used for the traversal. * @param oid the oid of commit that will be ignored during the traversal - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_revwalk_hide(git_revwalk *walk, const git_oid *oid); @@ -169,7 +151,7 @@ GIT_EXTERN(void) git_revwalk_sorting(git_revwalk *walk, unsigned int sort_mode); /** * Free a revision walker previously allocated. * - * @param walk traversal handle to close. If NULL nothing occurs. + * @param walk traversal handle to close. If NULL nothing occurs. */ GIT_EXTERN(void) git_revwalk_free(git_revwalk *walk); diff --git a/include/git2/signature.h b/include/git2/signature.h index f5d03ac77..228929943 100644 --- a/include/git2/signature.h +++ b/include/git2/signature.h @@ -1,26 +1,8 @@ /* - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, - * as published by the Free Software Foundation. + * Copyright (C) 2009-2011 the libgit2 contributors * - * In addition to the permissions in the GNU General Public License, - * the authors give you unlimited permission to link the compiled - * version of this file into combinations with other programs, - * and to distribute those combinations without any restriction - * coming from the use of this file. (The General Public License - * restrictions do apply in other respects; for example, they cover - * modification of the file, and distribution when not linked into - * a combined executable.) - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_git_signature_h__ #define INCLUDE_git_signature_h__ @@ -46,7 +28,7 @@ GIT_BEGIN_DECL * @param email email of the person * @param time time when the action happened * @param offset timezone offset in minutes for the time - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_signature_new(git_signature **sig_out, const char *name, const char *email, git_time_t time, int offset); @@ -57,7 +39,7 @@ GIT_EXTERN(int) git_signature_new(git_signature **sig_out, const char *name, con * @param sig_out new signature, in case of error NULL * @param name name of the person * @param email email of the person - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_signature_now(git_signature **sig_out, const char *name, const char *email); diff --git a/include/git2/status.h b/include/git2/status.h index 7946cc1f3..42b2dd197 100644 --- a/include/git2/status.h +++ b/include/git2/status.h @@ -1,26 +1,8 @@ /* - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, - * as published by the Free Software Foundation. + * Copyright (C) 2009-2011 the libgit2 contributors * - * In addition to the permissions in the GNU General Public License, - * the authors give you unlimited permission to link the compiled - * version of this file into combinations with other programs, - * and to distribute those combinations without any restriction - * coming from the use of this file. (The General Public License - * restrictions do apply in other respects; for example, they cover - * modification of the file, and distribution when not linked into - * a combined executable.) - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_git_status_h__ #define INCLUDE_git_status_h__ @@ -37,19 +19,19 @@ */ GIT_BEGIN_DECL -#define GIT_STATUS_CURRENT 0 +#define GIT_STATUS_CURRENT 0 /** Flags for index status */ -#define GIT_STATUS_INDEX_NEW (1 << 0) +#define GIT_STATUS_INDEX_NEW (1 << 0) #define GIT_STATUS_INDEX_MODIFIED (1 << 1) -#define GIT_STATUS_INDEX_DELETED (1 << 2) +#define GIT_STATUS_INDEX_DELETED (1 << 2) /** Flags for worktree status */ -#define GIT_STATUS_WT_NEW (1 << 3) -#define GIT_STATUS_WT_MODIFIED (1 << 4) -#define GIT_STATUS_WT_DELETED (1 << 5) +#define GIT_STATUS_WT_NEW (1 << 3) +#define GIT_STATUS_WT_MODIFIED (1 << 4) +#define GIT_STATUS_WT_DELETED (1 << 5) // TODO Ignored files not handled yet -#define GIT_STATUS_IGNORED (1 << 6) +#define GIT_STATUS_IGNORED (1 << 6) /** * Gather file statuses and run a callback for each one. @@ -60,7 +42,7 @@ GIT_BEGIN_DECL * * @param repo a repository object * @param callback the function to call on each file - * @return GIT_SUCCESS or the return value of the callback which did not return 0; + * @return GIT_SUCCESS or the return value of the callback which did not return GIT_SUCCESS */ GIT_EXTERN(int) git_status_foreach(git_repository *repo, int (*callback)(const char *, unsigned int, void *), void *payload); @@ -70,7 +52,9 @@ GIT_EXTERN(int) git_status_foreach(git_repository *repo, int (*callback)(const c * @param status_flags the status value * @param repo a repository object * @param path the file to retrieve status for, rooted at the repo's workdir - * @return GIT_SUCCESS + * @return GIT_EINVALIDPATH when `path` points at a folder, GIT_ENOTFOUND when + * the file doesn't exist in any of HEAD, the index or the worktree, + * GIT_SUCCESS otherwise */ GIT_EXTERN(int) git_status_file(unsigned int *status_flags, git_repository *repo, const char *path); diff --git a/include/git2/tag.h b/include/git2/tag.h index 2b10d4525..63a522882 100644 --- a/include/git2/tag.h +++ b/include/git2/tag.h @@ -1,26 +1,8 @@ /* - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, - * as published by the Free Software Foundation. - * - * In addition to the permissions in the GNU General Public License, - * the authors give you unlimited permission to link the compiled - * version of this file into combinations with other programs, - * and to distribute those combinations without any restriction - * coming from the use of this file. (The General Public License - * restrictions do apply in other respects; for example, they cover - * modification of the file, and distribution when not linked into - * a combined executable.) - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * Copyright (C) 2009-2011 the libgit2 contributors + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_git_tag_h__ #define INCLUDE_git_tag_h__ @@ -45,7 +27,7 @@ GIT_BEGIN_DECL * @param tag pointer to the looked up tag * @param repo the repo to use when locating the tag. * @param id identity of the tag to locate. - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_INLINE(int) git_tag_lookup(git_tag **tag, git_repository *repo, const git_oid *id) { @@ -62,7 +44,7 @@ GIT_INLINE(int) git_tag_lookup(git_tag **tag, git_repository *repo, const git_oi * @param repo the repo to use when locating the tag. * @param id identity of the tag to locate. * @param len the length of the short identifier - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_INLINE(int) git_tag_lookup_prefix(git_tag **tag, git_repository *repo, const git_oid *id, unsigned int len) { @@ -103,7 +85,7 @@ GIT_EXTERN(const git_oid *) git_tag_id(git_tag *tag); * * @param target pointer where to store the target * @param tag a previously loaded tag. - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_tag_target(git_object **target, git_tag *tag); @@ -170,13 +152,13 @@ GIT_EXTERN(const char *) git_tag_message(git_tag *tag); * must belong to the given `repo`. * * @param tagger Signature of the tagger for this tag, and - * of the tagging time + * of the tagging time * * @param message Full message for this tag * * @param force Overwrite existing references * - * @return 0 on success; error code otherwise. + * @return GIT_SUCCESS or an error code * A tag object is written to the ODB, and a proper reference * is written in the /refs/tags folder, pointing to it */ @@ -227,9 +209,9 @@ GIT_EXTERN(int) git_tag_create_frombuffer( * * @param force Overwrite existing references * - * @return 0 on success; error code otherwise. + * @return GIT_SUCCESS or an error code * A proper reference is written in the /refs/tags folder, - * pointing to the provided target object + * pointing to the provided target object */ GIT_EXTERN(int) git_tag_create_lightweight( git_oid *oid, @@ -246,7 +228,7 @@ GIT_EXTERN(int) git_tag_create_lightweight( * @param tag_name Name of the tag to be deleted; * this name is validated for consistency. * - * @return 0 on success; error code otherwise. + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_tag_delete( git_repository *repo, @@ -263,7 +245,7 @@ GIT_EXTERN(int) git_tag_delete( * @param tag_names Pointer to a git_strarray structure where * the tag names will be stored * @param repo Repository where to find the tags - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_tag_list( git_strarray *tag_names, @@ -285,7 +267,7 @@ GIT_EXTERN(int) git_tag_list( * the tag names will be stored * @param pattern Standard fnmatch pattern * @param repo Repository where to find the tags - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_tag_list_match( git_strarray *tag_names, diff --git a/include/git2/thread-utils.h b/include/git2/thread-utils.h index 62e6199a4..81c62d135 100644 --- a/include/git2/thread-utils.h +++ b/include/git2/thread-utils.h @@ -1,26 +1,8 @@ /* - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, - * as published by the Free Software Foundation. + * Copyright (C) 2009-2011 the libgit2 contributors * - * In addition to the permissions in the GNU General Public License, - * the authors give you unlimited permission to link the compiled - * version of this file into combinations with other programs, - * and to distribute those combinations without any restriction - * coming from the use of this file. (The General Public License - * restrictions do apply in other respects; for example, they cover - * modification of the file, and distribution when not linked into - * a combined executable.) - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_git_thread_utils_h__ #define INCLUDE_git_thread_utils_h__ @@ -28,51 +10,51 @@ /* * How TLS works is compiler+platform dependant * Sources: http://en.wikipedia.org/wiki/Thread-Specific_Storage - * http://predef.sourceforge.net/precomp.html + * http://predef.sourceforge.net/precomp.html */ #ifdef GIT_THREADS -# define GIT_HAS_TLS 1 +# define GIT_HAS_TLS 1 /* No TLS in Cygwin */ -# if defined(__CHECKER__) || defined(__CYGWIN__) -# undef GIT_HAS_TLS -# define GIT_TLS +# if defined(__CHECKER__) || defined(__CYGWIN__) +# undef GIT_HAS_TLS +# define GIT_TLS /* No TLS in Mach binaries for Mac OS X */ -# elif defined(__APPLE__) && defined(__MACH__) -# undef GIT_TLS -# define GIT_TLS +# elif defined(__APPLE__) && defined(__MACH__) +# undef GIT_TLS +# define GIT_TLS /* Normal TLS for GCC */ -# elif defined(__GNUC__) || \ - defined(__SUNPRO_C) || \ - defined(__SUNPRO_CC) || \ - defined(__xlc__) || \ - defined(__xlC__) -# define GIT_TLS __thread +# elif defined(__GNUC__) || \ + defined(__SUNPRO_C) || \ + defined(__SUNPRO_CC) || \ + defined(__xlc__) || \ + defined(__xlC__) +# define GIT_TLS __thread /* ICC may run on Windows or Linux */ -# elif defined(__INTEL_COMPILER) -# if defined(_WIN32) || defined(_WIN32_CE) -# define GIT_TLS __declspec(thread) -# else -# define GIT_TLS __thread -# endif +# elif defined(__INTEL_COMPILER) +# if defined(_WIN32) || defined(_WIN32_CE) +# define GIT_TLS __declspec(thread) +# else +# define GIT_TLS __thread +# endif /* Declspec for MSVC in Win32 */ -# elif defined(_WIN32) || \ - defined(_WIN32_CE) || \ - defined(__BORLANDC__) -# define GIT_TLS __declspec(thread) +# elif defined(_WIN32) || \ + defined(_WIN32_CE) || \ + defined(__BORLANDC__) +# define GIT_TLS __declspec(thread) /* Other platform; no TLS */ -# else -# undef GIT_HAS_TLS -# define GIT_TLS /* nothing: tls vars are thread-global */ -# endif +# else +# undef GIT_HAS_TLS +# define GIT_TLS /* nothing: tls vars are thread-global */ +# endif #else /* Disable TLS if libgit2 is not threadsafe */ -# define GIT_TLS +# define GIT_TLS #endif /* GIT_THREADS */ #endif /* INCLUDE_git_thread_utils_h__ */ diff --git a/include/git2/transport.h b/include/git2/transport.h index d19eb8a88..ddae32d40 100644 --- a/include/git2/transport.h +++ b/include/git2/transport.h @@ -1,26 +1,8 @@ /* - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, - * as published by the Free Software Foundation. + * Copyright (C) 2009-2011 the libgit2 contributors * - * In addition to the permissions in the GNU General Public License, - * the authors give you unlimited permission to link the compiled - * version of this file into combinations with other programs, - * and to distribute those combinations without any restriction - * coming from the use of this file. (The General Public License - * restrictions do apply in other respects; for example, they cover - * modification of the file, and distribution when not linked into - * a combined executable.) - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_git_transport_h__ #define INCLUDE_git_transport_h__ diff --git a/include/git2/tree.h b/include/git2/tree.h index 5656f48f3..d781ea136 100644 --- a/include/git2/tree.h +++ b/include/git2/tree.h @@ -1,26 +1,8 @@ /* - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, - * as published by the Free Software Foundation. - * - * In addition to the permissions in the GNU General Public License, - * the authors give you unlimited permission to link the compiled - * version of this file into combinations with other programs, - * and to distribute those combinations without any restriction - * coming from the use of this file. (The General Public License - * restrictions do apply in other respects; for example, they cover - * modification of the file, and distribution when not linked into - * a combined executable.) - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * Copyright (C) 2009-2011 the libgit2 contributors + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_git_tree_h__ #define INCLUDE_git_tree_h__ @@ -45,7 +27,7 @@ GIT_BEGIN_DECL * @param tree pointer to the looked up tree * @param repo the repo to use when locating the tree. * @param id identity of the tree to locate. - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_INLINE(int) git_tree_lookup(git_tree **tree, git_repository *repo, const git_oid *id) { @@ -62,7 +44,7 @@ GIT_INLINE(int) git_tree_lookup(git_tree **tree, git_repository *repo, const git * @param repo the repo to use when locating the tree. * @param id identity of the tree to locate. * @param len the length of the short identifier - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_INLINE(int) git_tree_lookup_prefix(git_tree **tree, git_repository *repo, const git_oid *id, unsigned int len) { @@ -159,7 +141,7 @@ GIT_EXTERN(git_otype) git_tree_entry_type(const git_tree_entry *entry); * @param object pointer to the converted object * @param repo repository where to lookup the pointed object * @param entry a tree entry - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_tree_entry_2object(git_object **object_out, git_repository *repo, const git_tree_entry *entry); @@ -177,7 +159,7 @@ GIT_EXTERN(int) git_tree_entry_2object(git_object **object_out, git_repository * * * @param oid Pointer where to store the written tree * @param index Index to write - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_tree_create_fromindex(git_oid *oid, git_index *index); @@ -247,7 +229,7 @@ GIT_EXTERN(const git_tree_entry *) git_treebuilder_get(git_treebuilder *bld, con * @param filename Filename of the entry * @param id SHA1 oid of the entry * @param attributes Folder attributes of the entry - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_treebuilder_insert(git_tree_entry **entry_out, git_treebuilder *bld, const char *filename, const git_oid *id, unsigned int attributes); @@ -282,7 +264,7 @@ GIT_EXTERN(void) git_treebuilder_filter(git_treebuilder *bld, int (*filter)(cons * @param oid Pointer where to store the written OID * @param repo Repository where to store the object * @param bld Tree builder to write - * @return 0 on success; error code otherwise + * @return GIT_SUCCESS or an error code */ GIT_EXTERN(int) git_treebuilder_write(git_oid *oid, git_repository *repo, git_treebuilder *bld); diff --git a/include/git2/types.h b/include/git2/types.h index b9db4e529..1df18974a 100644 --- a/include/git2/types.h +++ b/include/git2/types.h @@ -1,26 +1,8 @@ /* - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, - * as published by the Free Software Foundation. + * Copyright (C) 2009-2011 the libgit2 contributors * - * In addition to the permissions in the GNU General Public License, - * the authors give you unlimited permission to link the compiled - * version of this file into combinations with other programs, - * and to distribute those combinations without any restriction - * coming from the use of this file. (The General Public License - * restrictions do apply in other respects; for example, they cover - * modification of the file, and distribution when not linked into - * a combined executable.) - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_git_types_h__ #define INCLUDE_git_types_h__ @@ -54,7 +36,7 @@ GIT_BEGIN_DECL #if defined(_MSC_VER) typedef __int64 git_off_t; -typedef __time64_t git_time_t; +typedef __time64_t git_time_t; #elif defined(__MINGW32__) @@ -66,7 +48,7 @@ typedef __time64_t git_time_t; typedef __haiku_std_int64 git_off_t; typedef __haiku_std_int64 git_time_t; -#else /* POSIX */ +#else /* POSIX */ /* * Note: Can't use off_t since if a client program includes <sys/types.h> @@ -81,15 +63,15 @@ typedef int64_t git_time_t; /** Basic type (loose or packed) of any Git object. */ typedef enum { GIT_OBJ_ANY = -2, /**< Object can be any of the following */ - GIT_OBJ_BAD = -1, /**< Object is invalid. */ - GIT_OBJ__EXT1 = 0, /**< Reserved for future use. */ - GIT_OBJ_COMMIT = 1, /**< A commit object. */ - GIT_OBJ_TREE = 2, /**< A tree (directory listing) object. */ - GIT_OBJ_BLOB = 3, /**< A file revision object. */ - GIT_OBJ_TAG = 4, /**< An annotated tag object. */ - GIT_OBJ__EXT2 = 5, /**< Reserved for future use. */ - GIT_OBJ_OFS_DELTA = 6, /**< A delta, base is given by an offset. */ - GIT_OBJ_REF_DELTA = 7, /**< A delta, base is given by object id. */ + GIT_OBJ_BAD = -1, /**< Object is invalid. */ + GIT_OBJ__EXT1 = 0, /**< Reserved for future use. */ + GIT_OBJ_COMMIT = 1, /**< A commit object. */ + GIT_OBJ_TREE = 2, /**< A tree (directory listing) object. */ + GIT_OBJ_BLOB = 3, /**< A file revision object. */ + GIT_OBJ_TAG = 4, /**< An annotated tag object. */ + GIT_OBJ__EXT2 = 5, /**< Reserved for future use. */ + GIT_OBJ_OFS_DELTA = 6, /**< A delta, base is given by an offset. */ + GIT_OBJ_REF_DELTA = 7, /**< A delta, base is given by object id. */ } git_otype; /** An open object database handle. */ diff --git a/include/git2/zlib.h b/include/git2/zlib.h index 493566340..e3dd23f96 100644 --- a/include/git2/zlib.h +++ b/include/git2/zlib.h @@ -1,26 +1,8 @@ /* - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, - * as published by the Free Software Foundation. + * Copyright (C) 2009-2011 the libgit2 contributors * - * In addition to the permissions in the GNU General Public License, - * the authors give you unlimited permission to link the compiled - * version of this file into combinations with other programs, - * and to distribute those combinations without any restriction - * coming from the use of this file. (The General Public License - * restrictions do apply in other respects; for example, they cover - * modification of the file, and distribution when not linked into - * a combined executable.) - * - * This file is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. */ #ifndef INCLUDE_git_zlib_h__ #define INCLUDE_git_zlib_h__ |
