Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:37

0001 /*
0002  * Copyright (C) the libgit2 contributors. All rights reserved.
0003  *
0004  * This file is part of libgit2, distributed under the GNU GPL v2 with
0005  * a Linking Exception. For full terms see the included COPYING file.
0006  */
0007 #ifndef INCLUDE_git_deprecated_h__
0008 #define INCLUDE_git_deprecated_h__
0009 
0010 #include "attr.h"
0011 #include "config.h"
0012 #include "common.h"
0013 #include "blame.h"
0014 #include "buffer.h"
0015 #include "checkout.h"
0016 #include "cherrypick.h"
0017 #include "clone.h"
0018 #include "describe.h"
0019 #include "diff.h"
0020 #include "errors.h"
0021 #include "filter.h"
0022 #include "index.h"
0023 #include "indexer.h"
0024 #include "merge.h"
0025 #include "object.h"
0026 #include "proxy.h"
0027 #include "refs.h"
0028 #include "rebase.h"
0029 #include "remote.h"
0030 #include "trace.h"
0031 #include "repository.h"
0032 #include "revert.h"
0033 #include "revparse.h"
0034 #include "stash.h"
0035 #include "status.h"
0036 #include "submodule.h"
0037 #include "worktree.h"
0038 #include "credential.h"
0039 #include "credential_helpers.h"
0040 
0041 /*
0042  * Users can avoid deprecated functions by defining `GIT_DEPRECATE_HARD`.
0043  */
0044 #ifndef GIT_DEPRECATE_HARD
0045 
0046 /*
0047  * The credential structures are now opaque by default, and their
0048  * definition has moved into the `sys/credential.h` header; include
0049  * them here for backward compatibility.
0050  */
0051 #include "sys/credential.h"
0052 
0053 /**
0054  * @file git2/deprecated.h
0055  * @brief libgit2 deprecated functions and values
0056  * @ingroup Git
0057  * @{
0058  */
0059 GIT_BEGIN_DECL
0060 
0061 /** @name Deprecated Attribute Constants
0062  *
0063  * These enumeration values are retained for backward compatibility.
0064  * The newer versions of these functions should be preferred in all
0065  * new code.
0066  *
0067  * There is no plan to remove these backward compatibility values at
0068  * this time.
0069  */
0070 /**@{*/
0071 
0072 #define GIT_ATTR_UNSPECIFIED_T GIT_ATTR_VALUE_UNSPECIFIED
0073 #define GIT_ATTR_TRUE_T GIT_ATTR_VALUE_TRUE
0074 #define GIT_ATTR_FALSE_T GIT_ATTR_VALUE_FALSE
0075 #define GIT_ATTR_VALUE_T GIT_ATTR_VALUE_STRING
0076 
0077 #define GIT_ATTR_TRUE(attr) GIT_ATTR_IS_TRUE(attr)
0078 #define GIT_ATTR_FALSE(attr) GIT_ATTR_IS_FALSE(attr)
0079 #define GIT_ATTR_UNSPECIFIED(attr) GIT_ATTR_IS_UNSPECIFIED(attr)
0080 
0081 typedef git_attr_value_t git_attr_t;
0082 
0083 /**@}*/
0084 
0085 /** @name Deprecated Blob Functions and Constants
0086  *
0087  * These functions and enumeration values are retained for backward
0088  * compatibility.  The newer versions of these functions and values
0089  * should be preferred in all new code.
0090  *
0091  * There is no plan to remove these backward compatibility values at
0092  * this time.
0093  */
0094 /**@{*/
0095 
0096 #define GIT_BLOB_FILTER_ATTTRIBUTES_FROM_HEAD GIT_BLOB_FILTER_ATTRIBUTES_FROM_HEAD
0097 
0098 GIT_EXTERN(int) git_blob_create_fromworkdir(git_oid *id, git_repository *repo, const char *relative_path);
0099 GIT_EXTERN(int) git_blob_create_fromdisk(git_oid *id, git_repository *repo, const char *path);
0100 GIT_EXTERN(int) git_blob_create_fromstream(
0101     git_writestream **out,
0102     git_repository *repo,
0103     const char *hintpath);
0104 GIT_EXTERN(int) git_blob_create_fromstream_commit(
0105     git_oid *out,
0106     git_writestream *stream);
0107 GIT_EXTERN(int) git_blob_create_frombuffer(
0108     git_oid *id, git_repository *repo, const void *buffer, size_t len);
0109 
0110 /** Deprecated in favor of `git_blob_filter`.
0111  *
0112  * @deprecated Use git_blob_filter
0113  * @see git_blob_filter
0114  */
0115 GIT_EXTERN(int) git_blob_filtered_content(
0116     git_buf *out,
0117     git_blob *blob,
0118     const char *as_path,
0119     int check_for_binary_data);
0120 
0121 /**@}*/
0122 
0123 /** @name Deprecated Filter Functions
0124  *
0125  * These functions are retained for backward compatibility.  The
0126  * newer versions of these functions should be preferred in all
0127  * new code.
0128  *
0129  * There is no plan to remove these backward compatibility values at
0130  * this time.
0131  */
0132 /**@{*/
0133 
0134 /** Deprecated in favor of `git_filter_list_stream_buffer`.
0135  *
0136  * @deprecated Use git_filter_list_stream_buffer
0137  * @see Use git_filter_list_stream_buffer
0138  */
0139 GIT_EXTERN(int) git_filter_list_stream_data(
0140     git_filter_list *filters,
0141     git_buf *data,
0142     git_writestream *target);
0143 
0144 /** Deprecated in favor of `git_filter_list_apply_to_buffer`.
0145  *
0146  * @deprecated Use git_filter_list_apply_to_buffer
0147  * @see Use git_filter_list_apply_to_buffer
0148  */
0149 GIT_EXTERN(int) git_filter_list_apply_to_data(
0150     git_buf *out,
0151     git_filter_list *filters,
0152     git_buf *in);
0153 
0154 /**@}*/
0155 
0156 /** @name Deprecated Tree Functions
0157  *
0158  * These functions are retained for backward compatibility.  The
0159  * newer versions of these functions and values should be preferred
0160  * in all new code.
0161  *
0162  * There is no plan to remove these backward compatibility values at
0163  * this time.
0164  */
0165 /**@{*/
0166 
0167 /**
0168  * Write the contents of the tree builder as a tree object.
0169  * This is an alias of `git_treebuilder_write` and is preserved
0170  * for backward compatibility.
0171  *
0172  * This function is deprecated, but there is no plan to remove this
0173  * function at this time.
0174  *
0175  * @deprecated Use git_treebuilder_write
0176  * @see git_treebuilder_write
0177  */
0178 GIT_EXTERN(int) git_treebuilder_write_with_buffer(
0179     git_oid *oid, git_treebuilder *bld, git_buf *tree);
0180 
0181 /**@}*/
0182 
0183 /** @name Deprecated Buffer Functions
0184  *
0185  * These functions and enumeration values are retained for backward
0186  * compatibility.  The newer versions of these functions should be
0187  * preferred in all new code.
0188  *
0189  * There is no plan to remove these backward compatibility values at
0190  * this time.
0191  */
0192 /**@{*/
0193 
0194 /**
0195  * Static initializer for git_buf from static buffer
0196  */
0197 #define GIT_BUF_INIT_CONST(STR,LEN) { (char *)(STR), 0, (size_t)(LEN) }
0198 
0199 /**
0200  * Resize the buffer allocation to make more space.
0201  *
0202  * This will attempt to grow the buffer to accommodate the target size.
0203  *
0204  * If the buffer refers to memory that was not allocated by libgit2 (i.e.
0205  * the `asize` field is zero), then `ptr` will be replaced with a newly
0206  * allocated block of data.  Be careful so that memory allocated by the
0207  * caller is not lost.  As a special variant, if you pass `target_size` as
0208  * 0 and the memory is not allocated by libgit2, this will allocate a new
0209  * buffer of size `size` and copy the external data into it.
0210  *
0211  * Currently, this will never shrink a buffer, only expand it.
0212  *
0213  * If the allocation fails, this will return an error and the buffer will be
0214  * marked as invalid for future operations, invaliding the contents.
0215  *
0216  * @param buffer The buffer to be resized; may or may not be allocated yet
0217  * @param target_size The desired available size
0218  * @return 0 on success, -1 on allocation failure
0219  */
0220 GIT_EXTERN(int) git_buf_grow(git_buf *buffer, size_t target_size);
0221 
0222 /**
0223  * Set buffer to a copy of some raw data.
0224  *
0225  * @param buffer The buffer to set
0226  * @param data The data to copy into the buffer
0227  * @param datalen The length of the data to copy into the buffer
0228  * @return 0 on success, -1 on allocation failure
0229  */
0230 GIT_EXTERN(int) git_buf_set(
0231     git_buf *buffer, const void *data, size_t datalen);
0232 
0233 /**
0234 * Check quickly if buffer looks like it contains binary data
0235 *
0236 * @param buf Buffer to check
0237 * @return 1 if buffer looks like non-text data
0238 */
0239 GIT_EXTERN(int) git_buf_is_binary(const git_buf *buf);
0240 
0241 /**
0242 * Check quickly if buffer contains a NUL byte
0243 *
0244 * @param buf Buffer to check
0245 * @return 1 if buffer contains a NUL byte
0246 */
0247 GIT_EXTERN(int) git_buf_contains_nul(const git_buf *buf);
0248 
0249 /**
0250  * Free the memory referred to by the git_buf.  This is an alias of
0251  * `git_buf_dispose` and is preserved for backward compatibility.
0252  *
0253  * This function is deprecated, but there is no plan to remove this
0254  * function at this time.
0255  *
0256  * @deprecated Use git_buf_dispose
0257  * @see git_buf_dispose
0258  */
0259 GIT_EXTERN(void) git_buf_free(git_buf *buffer);
0260 
0261 /**@}*/
0262 
0263 /** @name Deprecated Commit Definitions
0264  */
0265 /**@{*/
0266 
0267 /**
0268  * Provide a commit signature during commit creation.
0269  *
0270  * Callers should instead define a `git_commit_create_cb` that
0271  * generates a commit buffer using `git_commit_create_buffer`, sign
0272  * that buffer and call `git_commit_create_with_signature`.
0273  *
0274  * @deprecated use a `git_commit_create_cb` instead
0275  */
0276 typedef int (*git_commit_signing_cb)(
0277     git_buf *signature,
0278     git_buf *signature_field,
0279     const char *commit_content,
0280     void *payload);
0281 
0282 /**@}*/
0283 
0284 /** @name Deprecated Config Functions and Constants
0285  */
0286 /**@{*/
0287 
0288 #define GIT_CVAR_FALSE  GIT_CONFIGMAP_FALSE
0289 #define GIT_CVAR_TRUE   GIT_CONFIGMAP_TRUE
0290 #define GIT_CVAR_INT32  GIT_CONFIGMAP_INT32
0291 #define GIT_CVAR_STRING GIT_CONFIGMAP_STRING
0292 
0293 typedef git_configmap git_cvar_map;
0294 
0295 /**@}*/
0296 
0297 /** @name Deprecated Diff Functions and Constants
0298  *
0299  * These functions and enumeration values are retained for backward
0300  * compatibility.  The newer versions of these functions and values
0301  * should be preferred in all new code.
0302  *
0303  * There is no plan to remove these backward compatibility values at
0304  * this time.
0305  */
0306 /**@{*/
0307 
0308 /**
0309  * Formatting options for diff e-mail generation
0310  */
0311 typedef enum {
0312     /** Normal patch, the default */
0313     GIT_DIFF_FORMAT_EMAIL_NONE = 0,
0314 
0315     /** Don't insert "[PATCH]" in the subject header*/
0316     GIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER = (1 << 0)
0317 
0318 } git_diff_format_email_flags_t;
0319 
0320 /**
0321  * Options for controlling the formatting of the generated e-mail.
0322  */
0323 typedef struct {
0324     unsigned int version;
0325 
0326     /** see `git_diff_format_email_flags_t` above */
0327     uint32_t flags;
0328 
0329     /** This patch number */
0330     size_t patch_no;
0331 
0332     /** Total number of patches in this series */
0333     size_t total_patches;
0334 
0335     /** id to use for the commit */
0336     const git_oid *id;
0337 
0338     /** Summary of the change */
0339     const char *summary;
0340 
0341     /** Commit message's body */
0342     const char *body;
0343 
0344     /** Author of the change */
0345     const git_signature *author;
0346 } git_diff_format_email_options;
0347 
0348 #define GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION 1
0349 #define GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT {GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION, 0, 1, 1, NULL, NULL, NULL, NULL}
0350 
0351 /**
0352  * Create an e-mail ready patch from a diff.
0353  *
0354  * @deprecated git_email_create_from_diff
0355  * @see git_email_create_from_diff
0356  */
0357 GIT_EXTERN(int) git_diff_format_email(
0358     git_buf *out,
0359     git_diff *diff,
0360     const git_diff_format_email_options *opts);
0361 
0362 /**
0363  * Create an e-mail ready patch for a commit.
0364  *
0365  * @deprecated git_email_create_from_commit
0366  * @see git_email_create_from_commit
0367  */
0368 GIT_EXTERN(int) git_diff_commit_as_email(
0369     git_buf *out,
0370     git_repository *repo,
0371     git_commit *commit,
0372     size_t patch_no,
0373     size_t total_patches,
0374     uint32_t flags,
0375     const git_diff_options *diff_opts);
0376 
0377 /**
0378  * Initialize git_diff_format_email_options structure
0379  *
0380  * Initializes a `git_diff_format_email_options` with default values. Equivalent
0381  * to creating an instance with GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT.
0382  *
0383  * @param opts The `git_blame_options` struct to initialize.
0384  * @param version The struct version; pass `GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION`.
0385  * @return Zero on success; -1 on failure.
0386  */
0387 GIT_EXTERN(int) git_diff_format_email_options_init(
0388     git_diff_format_email_options *opts,
0389     unsigned int version);
0390 
0391 /**@}*/
0392 
0393 /** @name Deprecated Error Functions and Constants
0394  *
0395  * These functions and enumeration values are retained for backward
0396  * compatibility.  The newer versions of these functions and values
0397  * should be preferred in all new code.
0398  *
0399  * There is no plan to remove these backward compatibility values at
0400  * this time.
0401  */
0402 /**@{*/
0403 
0404 #define GITERR_NONE GIT_ERROR_NONE
0405 #define GITERR_NOMEMORY GIT_ERROR_NOMEMORY
0406 #define GITERR_OS GIT_ERROR_OS
0407 #define GITERR_INVALID GIT_ERROR_INVALID
0408 #define GITERR_REFERENCE GIT_ERROR_REFERENCE
0409 #define GITERR_ZLIB GIT_ERROR_ZLIB
0410 #define GITERR_REPOSITORY GIT_ERROR_REPOSITORY
0411 #define GITERR_CONFIG GIT_ERROR_CONFIG
0412 #define GITERR_REGEX GIT_ERROR_REGEX
0413 #define GITERR_ODB GIT_ERROR_ODB
0414 #define GITERR_INDEX GIT_ERROR_INDEX
0415 #define GITERR_OBJECT GIT_ERROR_OBJECT
0416 #define GITERR_NET GIT_ERROR_NET
0417 #define GITERR_TAG GIT_ERROR_TAG
0418 #define GITERR_TREE GIT_ERROR_TREE
0419 #define GITERR_INDEXER GIT_ERROR_INDEXER
0420 #define GITERR_SSL GIT_ERROR_SSL
0421 #define GITERR_SUBMODULE GIT_ERROR_SUBMODULE
0422 #define GITERR_THREAD GIT_ERROR_THREAD
0423 #define GITERR_STASH GIT_ERROR_STASH
0424 #define GITERR_CHECKOUT GIT_ERROR_CHECKOUT
0425 #define GITERR_FETCHHEAD GIT_ERROR_FETCHHEAD
0426 #define GITERR_MERGE GIT_ERROR_MERGE
0427 #define GITERR_SSH GIT_ERROR_SSH
0428 #define GITERR_FILTER GIT_ERROR_FILTER
0429 #define GITERR_REVERT GIT_ERROR_REVERT
0430 #define GITERR_CALLBACK GIT_ERROR_CALLBACK
0431 #define GITERR_CHERRYPICK GIT_ERROR_CHERRYPICK
0432 #define GITERR_DESCRIBE GIT_ERROR_DESCRIBE
0433 #define GITERR_REBASE GIT_ERROR_REBASE
0434 #define GITERR_FILESYSTEM GIT_ERROR_FILESYSTEM
0435 #define GITERR_PATCH GIT_ERROR_PATCH
0436 #define GITERR_WORKTREE GIT_ERROR_WORKTREE
0437 #define GITERR_SHA1 GIT_ERROR_SHA1
0438 
0439 #define GIT_ERROR_SHA1 GIT_ERROR_SHA
0440 
0441 /**
0442  * Return the last `git_error` object that was generated for the
0443  * current thread.  This is an alias of `git_error_last` and is
0444  * preserved for backward compatibility.
0445  *
0446  * This function is deprecated, but there is no plan to remove this
0447  * function at this time.
0448  *
0449  * @deprecated Use git_error_last
0450  * @see git_error_last
0451  */
0452 GIT_EXTERN(const git_error *) giterr_last(void);
0453 
0454 /**
0455  * Clear the last error.  This is an alias of `git_error_last` and is
0456  * preserved for backward compatibility.
0457  *
0458  * This function is deprecated, but there is no plan to remove this
0459  * function at this time.
0460  *
0461  * @deprecated Use git_error_clear
0462  * @see git_error_clear
0463  */
0464 GIT_EXTERN(void) giterr_clear(void);
0465 
0466 /**
0467  * Sets the error message to the given string.  This is an alias of
0468  * `git_error_set_str` and is preserved for backward compatibility.
0469  *
0470  * This function is deprecated, but there is no plan to remove this
0471  * function at this time.
0472  *
0473  * @deprecated Use git_error_set_str
0474  * @see git_error_set_str
0475  */
0476 GIT_EXTERN(void) giterr_set_str(int error_class, const char *string);
0477 
0478 /**
0479  * Indicates that an out-of-memory situation occurred.  This is an alias
0480  * of `git_error_set_oom` and is preserved for backward compatibility.
0481  *
0482  * This function is deprecated, but there is no plan to remove this
0483  * function at this time.
0484  *
0485  * @deprecated Use git_error_set_oom
0486  * @see git_error_set_oom
0487  */
0488 GIT_EXTERN(void) giterr_set_oom(void);
0489 
0490 /**@}*/
0491 
0492 /** @name Deprecated Index Functions and Constants
0493  *
0494  * These functions and enumeration values are retained for backward
0495  * compatibility.  The newer versions of these values should be
0496  * preferred in all new code.
0497  *
0498  * There is no plan to remove these backward compatibility values at
0499  * this time.
0500  */
0501 /**@{*/
0502 
0503 #define GIT_IDXENTRY_NAMEMASK          GIT_INDEX_ENTRY_NAMEMASK
0504 #define GIT_IDXENTRY_STAGEMASK         GIT_INDEX_ENTRY_STAGEMASK
0505 #define GIT_IDXENTRY_STAGESHIFT        GIT_INDEX_ENTRY_STAGESHIFT
0506 
0507 /* The git_indxentry_flag_t enum */
0508 #define GIT_IDXENTRY_EXTENDED          GIT_INDEX_ENTRY_EXTENDED
0509 #define GIT_IDXENTRY_VALID             GIT_INDEX_ENTRY_VALID
0510 
0511 #define GIT_IDXENTRY_STAGE(E)          GIT_INDEX_ENTRY_STAGE(E)
0512 #define GIT_IDXENTRY_STAGE_SET(E,S)    GIT_INDEX_ENTRY_STAGE_SET(E,S)
0513 
0514 /* The git_idxentry_extended_flag_t enum */
0515 #define GIT_IDXENTRY_INTENT_TO_ADD     GIT_INDEX_ENTRY_INTENT_TO_ADD
0516 #define GIT_IDXENTRY_SKIP_WORKTREE     GIT_INDEX_ENTRY_SKIP_WORKTREE
0517 #define GIT_IDXENTRY_EXTENDED_FLAGS    (GIT_INDEX_ENTRY_INTENT_TO_ADD | GIT_INDEX_ENTRY_SKIP_WORKTREE)
0518 #define GIT_IDXENTRY_EXTENDED2         (1 << 15)
0519 #define GIT_IDXENTRY_UPDATE            (1 << 0)
0520 #define GIT_IDXENTRY_REMOVE            (1 << 1)
0521 #define GIT_IDXENTRY_UPTODATE          (1 << 2)
0522 #define GIT_IDXENTRY_ADDED             (1 << 3)
0523 #define GIT_IDXENTRY_HASHED            (1 << 4)
0524 #define GIT_IDXENTRY_UNHASHED          (1 << 5)
0525 #define GIT_IDXENTRY_WT_REMOVE         (1 << 6)
0526 #define GIT_IDXENTRY_CONFLICTED        (1 << 7)
0527 #define GIT_IDXENTRY_UNPACKED          (1 << 8)
0528 #define GIT_IDXENTRY_NEW_SKIP_WORKTREE (1 << 9)
0529 
0530 /* The git_index_capability_t enum */
0531 #define GIT_INDEXCAP_IGNORE_CASE       GIT_INDEX_CAPABILITY_IGNORE_CASE
0532 #define GIT_INDEXCAP_NO_FILEMODE       GIT_INDEX_CAPABILITY_NO_FILEMODE
0533 #define GIT_INDEXCAP_NO_SYMLINKS       GIT_INDEX_CAPABILITY_NO_SYMLINKS
0534 #define GIT_INDEXCAP_FROM_OWNER        GIT_INDEX_CAPABILITY_FROM_OWNER
0535 
0536 GIT_EXTERN(int) git_index_add_frombuffer(
0537     git_index *index,
0538     const git_index_entry *entry,
0539     const void *buffer, size_t len);
0540 
0541 /**@}*/
0542 
0543 /** @name Deprecated Object Constants
0544  *
0545  * These enumeration values are retained for backward compatibility.  The
0546  * newer versions of these values should be preferred in all new code.
0547  *
0548  * There is no plan to remove these backward compatibility values at
0549  * this time.
0550  */
0551 /**@{*/
0552 
0553 #define git_otype git_object_t
0554 
0555 #define GIT_OBJ_ANY GIT_OBJECT_ANY
0556 #define GIT_OBJ_BAD GIT_OBJECT_INVALID
0557 #define GIT_OBJ__EXT1 0
0558 #define GIT_OBJ_COMMIT GIT_OBJECT_COMMIT
0559 #define GIT_OBJ_TREE GIT_OBJECT_TREE
0560 #define GIT_OBJ_BLOB GIT_OBJECT_BLOB
0561 #define GIT_OBJ_TAG GIT_OBJECT_TAG
0562 #define GIT_OBJ__EXT2 5
0563 #define GIT_OBJ_OFS_DELTA GIT_OBJECT_OFS_DELTA
0564 #define GIT_OBJ_REF_DELTA GIT_OBJECT_REF_DELTA
0565 
0566 /**
0567  * Get the size in bytes for the structure which
0568  * acts as an in-memory representation of any given
0569  * object type.
0570  *
0571  * For all the core types, this would the equivalent
0572  * of calling `sizeof(git_commit)` if the core types
0573  * were not opaque on the external API.
0574  *
0575  * @param type object type to get its size
0576  * @return size in bytes of the object
0577  */
0578 GIT_EXTERN(size_t) git_object__size(git_object_t type);
0579 
0580 /**@}*/
0581 
0582 /** @name Deprecated Remote Functions
0583  *
0584  * These functions are retained for backward compatibility.  The newer
0585  * versions of these functions should be preferred in all new code.
0586  *
0587  * There is no plan to remove these backward compatibility functions at
0588  * this time.
0589  */
0590 /**@{*/
0591 
0592 /**
0593  * Ensure the remote name is well-formed.
0594  *
0595  * @deprecated Use git_remote_name_is_valid
0596  * @param remote_name name to be checked.
0597  * @return 1 if the reference name is acceptable; 0 if it isn't
0598  */
0599 GIT_EXTERN(int) git_remote_is_valid_name(const char *remote_name);
0600 
0601 /**@}*/
0602 
0603 /** @name Deprecated Reference Functions and Constants
0604  *
0605  * These functions and enumeration values are retained for backward
0606  * compatibility.  The newer versions of these values should be
0607  * preferred in all new code.
0608  *
0609  * There is no plan to remove these backward compatibility values at
0610  * this time.
0611  */
0612 /**@{*/
0613 
0614  /** Basic type of any Git reference. */
0615 #define git_ref_t git_reference_t
0616 #define git_reference_normalize_t git_reference_format_t
0617 
0618 #define GIT_REF_INVALID GIT_REFERENCE_INVALID
0619 #define GIT_REF_OID GIT_REFERENCE_DIRECT
0620 #define GIT_REF_SYMBOLIC GIT_REFERENCE_SYMBOLIC
0621 #define GIT_REF_LISTALL GIT_REFERENCE_ALL
0622 
0623 #define GIT_REF_FORMAT_NORMAL GIT_REFERENCE_FORMAT_NORMAL
0624 #define GIT_REF_FORMAT_ALLOW_ONELEVEL GIT_REFERENCE_FORMAT_ALLOW_ONELEVEL
0625 #define GIT_REF_FORMAT_REFSPEC_PATTERN GIT_REFERENCE_FORMAT_REFSPEC_PATTERN
0626 #define GIT_REF_FORMAT_REFSPEC_SHORTHAND GIT_REFERENCE_FORMAT_REFSPEC_SHORTHAND
0627 
0628 /**
0629  * Ensure the reference name is well-formed.
0630  *
0631  * Valid reference names must follow one of two patterns:
0632  *
0633  * 1. Top-level names must contain only capital letters and underscores,
0634  *    and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD").
0635  * 2. Names prefixed with "refs/" can be almost anything.  You must avoid
0636  *    the characters '~', '^', ':', '\\', '?', '[', and '*', and the
0637  *    sequences ".." and "@{" which have special meaning to revparse.
0638  *
0639  * @deprecated Use git_reference_name_is_valid
0640  * @param refname name to be checked.
0641  * @return 1 if the reference name is acceptable; 0 if it isn't
0642  */
0643 GIT_EXTERN(int) git_reference_is_valid_name(const char *refname);
0644 
0645 GIT_EXTERN(int) git_tag_create_frombuffer(
0646     git_oid *oid,
0647     git_repository *repo,
0648     const char *buffer,
0649     int force);
0650 
0651 /**@}*/
0652 
0653 /** @name Deprecated Revspec Constants
0654  *
0655  * These enumeration values are retained for backward compatibility.
0656  * The newer versions of these values should be preferred in all new
0657  * code.
0658  *
0659  * There is no plan to remove these backward compatibility values at
0660  * this time.
0661  */
0662 /**@{*/
0663 
0664 typedef git_revspec_t git_revparse_mode_t;
0665 
0666 #define GIT_REVPARSE_SINGLE GIT_REVSPEC_SINGLE
0667 #define GIT_REVPARSE_RANGE GIT_REVSPEC_RANGE
0668 #define GIT_REVPARSE_MERGE_BASE GIT_REVSPEC_MERGE_BASE
0669 
0670 /**@}*/
0671 
0672 /** @name Deprecated Credential Types
0673  *
0674  * These types are retained for backward compatibility.  The newer
0675  * versions of these values should be preferred in all new code.
0676  *
0677  * There is no plan to remove these backward compatibility values at
0678  * this time.
0679  */
0680 /**@{*/
0681 
0682 typedef git_credential git_cred;
0683 typedef git_credential_userpass_plaintext git_cred_userpass_plaintext;
0684 typedef git_credential_username git_cred_username;
0685 typedef git_credential_default git_cred_default;
0686 typedef git_credential_ssh_key git_cred_ssh_key;
0687 typedef git_credential_ssh_interactive git_cred_ssh_interactive;
0688 typedef git_credential_ssh_custom git_cred_ssh_custom;
0689 
0690 typedef git_credential_acquire_cb git_cred_acquire_cb;
0691 typedef git_credential_sign_cb git_cred_sign_callback;
0692 typedef git_credential_sign_cb git_cred_sign_cb;
0693 typedef git_credential_ssh_interactive_cb git_cred_ssh_interactive_callback;
0694 typedef git_credential_ssh_interactive_cb git_cred_ssh_interactive_cb;
0695 
0696 #define git_credtype_t git_credential_t
0697 
0698 #define GIT_CREDTYPE_USERPASS_PLAINTEXT GIT_CREDENTIAL_USERPASS_PLAINTEXT
0699 #define GIT_CREDTYPE_SSH_KEY GIT_CREDENTIAL_SSH_KEY
0700 #define GIT_CREDTYPE_SSH_CUSTOM GIT_CREDENTIAL_SSH_CUSTOM
0701 #define GIT_CREDTYPE_DEFAULT GIT_CREDENTIAL_DEFAULT
0702 #define GIT_CREDTYPE_SSH_INTERACTIVE GIT_CREDENTIAL_SSH_INTERACTIVE
0703 #define GIT_CREDTYPE_USERNAME GIT_CREDENTIAL_USERNAME
0704 #define GIT_CREDTYPE_SSH_MEMORY GIT_CREDENTIAL_SSH_MEMORY
0705 
0706 GIT_EXTERN(void) git_cred_free(git_credential *cred);
0707 GIT_EXTERN(int) git_cred_has_username(git_credential *cred);
0708 GIT_EXTERN(const char *) git_cred_get_username(git_credential *cred);
0709 GIT_EXTERN(int) git_cred_userpass_plaintext_new(
0710     git_credential **out,
0711     const char *username,
0712     const char *password);
0713 GIT_EXTERN(int) git_cred_default_new(git_credential **out);
0714 GIT_EXTERN(int) git_cred_username_new(git_credential **out, const char *username);
0715 GIT_EXTERN(int) git_cred_ssh_key_new(
0716     git_credential **out,
0717     const char *username,
0718     const char *publickey,
0719     const char *privatekey,
0720     const char *passphrase);
0721 GIT_EXTERN(int) git_cred_ssh_key_memory_new(
0722     git_credential **out,
0723     const char *username,
0724     const char *publickey,
0725     const char *privatekey,
0726     const char *passphrase);
0727 GIT_EXTERN(int) git_cred_ssh_interactive_new(
0728     git_credential **out,
0729     const char *username,
0730     git_credential_ssh_interactive_cb prompt_callback,
0731     void *payload);
0732 GIT_EXTERN(int) git_cred_ssh_key_from_agent(
0733     git_credential **out,
0734     const char *username);
0735 GIT_EXTERN(int) git_cred_ssh_custom_new(
0736     git_credential **out,
0737     const char *username,
0738     const char *publickey,
0739     size_t publickey_len,
0740     git_credential_sign_cb sign_callback,
0741     void *payload);
0742 
0743 /* Deprecated Credential Helper Types */
0744 
0745 typedef git_credential_userpass_payload git_cred_userpass_payload;
0746 
0747 GIT_EXTERN(int) git_cred_userpass(
0748     git_credential **out,
0749     const char *url,
0750     const char *user_from_url,
0751     unsigned int allowed_types,
0752     void *payload);
0753 
0754 /**@}*/
0755 
0756 /** @name Deprecated Trace Callback Types
0757  *
0758  * These types are retained for backward compatibility.  The newer
0759  * versions of these values should be preferred in all new code.
0760  *
0761  * There is no plan to remove these backward compatibility values at
0762  * this time.
0763  */
0764 /**@{*/
0765 
0766 typedef git_trace_cb git_trace_callback;
0767 
0768 /**@}*/
0769 
0770 /** @name Deprecated Object ID Types
0771  *
0772  * These types are retained for backward compatibility.  The newer
0773  * versions of these values should be preferred in all new code.
0774  *
0775  * There is no plan to remove these backward compatibility values at
0776  * this time.
0777  */
0778 /**@{*/
0779 
0780 #ifndef GIT_EXPERIMENTAL_SHA256
0781 # define GIT_OID_RAWSZ    GIT_OID_SHA1_SIZE
0782 # define GIT_OID_HEXSZ    GIT_OID_SHA1_HEXSIZE
0783 # define GIT_OID_HEX_ZERO GIT_OID_SHA1_HEXZERO
0784 #endif
0785 
0786 GIT_EXTERN(int) git_oid_iszero(const git_oid *id);
0787 
0788 /**@}*/
0789 
0790 /** @name Deprecated OID Array Functions
0791  *
0792  * These types are retained for backward compatibility.  The newer
0793  * versions of these values should be preferred in all new code.
0794  *
0795  * There is no plan to remove these backward compatibility values at
0796  * this time.
0797  */
0798 /**@{*/
0799 
0800 /**
0801  * Free the memory referred to by the git_oidarray.  This is an alias of
0802  * `git_oidarray_dispose` and is preserved for backward compatibility.
0803  *
0804  * This function is deprecated, but there is no plan to remove this
0805  * function at this time.
0806  *
0807  * @deprecated Use git_oidarray_dispose
0808  * @see git_oidarray_dispose
0809  */
0810 GIT_EXTERN(void) git_oidarray_free(git_oidarray *array);
0811 
0812 /**@}*/
0813 
0814 /** @name Deprecated Transfer Progress Types
0815  *
0816  * These types are retained for backward compatibility.  The newer
0817  * versions of these values should be preferred in all new code.
0818  *
0819  * There is no plan to remove these backward compatibility values at
0820  * this time.
0821  */
0822 /**@{*/
0823 
0824 /**
0825  * This structure is used to provide callers information about the
0826  * progress of indexing a packfile.
0827  *
0828  * This type is deprecated, but there is no plan to remove this
0829  * type definition at this time.
0830  */
0831 typedef git_indexer_progress git_transfer_progress;
0832 
0833 /**
0834  * Type definition for progress callbacks during indexing.
0835  *
0836  * This type is deprecated, but there is no plan to remove this
0837  * type definition at this time.
0838  */
0839 typedef git_indexer_progress_cb git_transfer_progress_cb;
0840 
0841 /**
0842  * Type definition for push transfer progress callbacks.
0843  *
0844  * This type is deprecated, but there is no plan to remove this
0845  * type definition at this time.
0846  */
0847 typedef git_push_transfer_progress_cb git_push_transfer_progress;
0848 
0849  /** The type of a remote completion event */
0850 #define git_remote_completion_type git_remote_completion_t
0851 
0852 /**
0853  * Callback for listing the remote heads
0854  */
0855 typedef int GIT_CALLBACK(git_headlist_cb)(git_remote_head *rhead, void *payload);
0856 
0857 /**@}*/
0858 
0859 /** @name Deprecated String Array Functions
0860  *
0861  * These types are retained for backward compatibility.  The newer
0862  * versions of these values should be preferred in all new code.
0863  *
0864  * There is no plan to remove these backward compatibility values at
0865  * this time.
0866  */
0867 /**@{*/
0868 
0869 /**
0870  * Copy a string array object from source to target.
0871  *
0872  * This function is deprecated, but there is no plan to remove this
0873  * function at this time.
0874  *
0875  * @param tgt target
0876  * @param src source
0877  * @return 0 on success, < 0 on allocation failure
0878  */
0879 GIT_EXTERN(int) git_strarray_copy(git_strarray *tgt, const git_strarray *src);
0880 
0881 /**
0882  * Free the memory referred to by the git_strarray.  This is an alias of
0883  * `git_strarray_dispose` and is preserved for backward compatibility.
0884  *
0885  * This function is deprecated, but there is no plan to remove this
0886  * function at this time.
0887  *
0888  * @deprecated Use git_strarray_dispose
0889  * @see git_strarray_dispose
0890  */
0891 GIT_EXTERN(void) git_strarray_free(git_strarray *array);
0892 
0893 /**@}*/
0894 
0895 /** @name Deprecated Options Initialization Functions
0896  *
0897  * These functions are retained for backward compatibility.  The newer
0898  * versions of these functions should be preferred in all new code.
0899  *
0900  * There is no plan to remove these backward compatibility functions at
0901  * this time.
0902  */
0903 /**@{*/
0904 
0905 GIT_EXTERN(int) git_blame_init_options(git_blame_options *opts, unsigned int version);
0906 GIT_EXTERN(int) git_checkout_init_options(git_checkout_options *opts, unsigned int version);
0907 GIT_EXTERN(int) git_cherrypick_init_options(git_cherrypick_options *opts, unsigned int version);
0908 GIT_EXTERN(int) git_clone_init_options(git_clone_options *opts, unsigned int version);
0909 GIT_EXTERN(int) git_describe_init_options(git_describe_options *opts, unsigned int version);
0910 GIT_EXTERN(int) git_describe_init_format_options(git_describe_format_options *opts, unsigned int version);
0911 GIT_EXTERN(int) git_diff_init_options(git_diff_options *opts, unsigned int version);
0912 GIT_EXTERN(int) git_diff_find_init_options(git_diff_find_options *opts, unsigned int version);
0913 GIT_EXTERN(int) git_diff_format_email_init_options(git_diff_format_email_options *opts, unsigned int version);
0914 GIT_EXTERN(int) git_diff_patchid_init_options(git_diff_patchid_options *opts, unsigned int version);
0915 GIT_EXTERN(int) git_fetch_init_options(git_fetch_options *opts, unsigned int version);
0916 GIT_EXTERN(int) git_indexer_init_options(git_indexer_options *opts, unsigned int version);
0917 GIT_EXTERN(int) git_merge_init_options(git_merge_options *opts, unsigned int version);
0918 GIT_EXTERN(int) git_merge_file_init_input(git_merge_file_input *input, unsigned int version);
0919 GIT_EXTERN(int) git_merge_file_init_options(git_merge_file_options *opts, unsigned int version);
0920 GIT_EXTERN(int) git_proxy_init_options(git_proxy_options *opts, unsigned int version);
0921 GIT_EXTERN(int) git_push_init_options(git_push_options *opts, unsigned int version);
0922 GIT_EXTERN(int) git_rebase_init_options(git_rebase_options *opts, unsigned int version);
0923 GIT_EXTERN(int) git_remote_create_init_options(git_remote_create_options *opts, unsigned int version);
0924 GIT_EXTERN(int) git_repository_init_init_options(git_repository_init_options *opts, unsigned int version);
0925 GIT_EXTERN(int) git_revert_init_options(git_revert_options *opts, unsigned int version);
0926 GIT_EXTERN(int) git_stash_apply_init_options(git_stash_apply_options *opts, unsigned int version);
0927 GIT_EXTERN(int) git_status_init_options(git_status_options *opts, unsigned int version);
0928 GIT_EXTERN(int) git_submodule_update_init_options(git_submodule_update_options *opts, unsigned int version);
0929 GIT_EXTERN(int) git_worktree_add_init_options(git_worktree_add_options *opts, unsigned int version);
0930 GIT_EXTERN(int) git_worktree_prune_init_options(git_worktree_prune_options *opts, unsigned int version);
0931 
0932 /**@}*/
0933 
0934 /** @} */
0935 GIT_END_DECL
0936 
0937 #endif
0938 
0939 #endif