]> git.proxmox.com Git - libgit2.git/blobdiff - include/git2/deprecated.h
New upstream version 1.0.0+dfsg.1
[libgit2.git] / include / git2 / deprecated.h
index 9d3a091a3e1f208adc03b4155f03760daa4e0ef2..e5e56edaeee715f38a11e6db6592568dedd4699c 100644 (file)
@@ -7,18 +7,47 @@
 #ifndef INCLUDE_git_deprecated_h__
 #define INCLUDE_git_deprecated_h__
 
+#include "attr.h"
+#include "config.h"
 #include "common.h"
+#include "blame.h"
 #include "buffer.h"
+#include "checkout.h"
+#include "cherrypick.h"
+#include "clone.h"
+#include "describe.h"
+#include "diff.h"
 #include "errors.h"
 #include "index.h"
+#include "indexer.h"
+#include "merge.h"
 #include "object.h"
+#include "proxy.h"
 #include "refs.h"
+#include "rebase.h"
+#include "remote.h"
+#include "trace.h"
+#include "repository.h"
+#include "revert.h"
+#include "stash.h"
+#include "status.h"
+#include "submodule.h"
+#include "worktree.h"
+#include "credential.h"
+#include "credential_helpers.h"
 
 /*
  * Users can avoid deprecated functions by defining `GIT_DEPRECATE_HARD`.
  */
 #ifndef GIT_DEPRECATE_HARD
 
+/*
+ * The credential structures are now opaque by default, and their
+ * definition has moved into the `sys/credential.h` header; include
+ * them here for backward compatibility.
+ */
+#include "sys/credential.h"
+
 /**
  * @file git2/deprecated.h
  * @brief libgit2 deprecated functions and values
  */
 GIT_BEGIN_DECL
 
+/** @name Deprecated Attribute Constants
+ *
+ * These enumeration values are retained for backward compatibility.
+ * The newer versions of these functions should be preferred in all
+ * new code.
+ *
+ * There is no plan to remove these backward compatibility values at
+ * this time.
+ */
+/**@{*/
+
+#define GIT_ATTR_UNSPECIFIED_T GIT_ATTR_VALUE_UNSPECIFIED
+#define GIT_ATTR_TRUE_T GIT_ATTR_VALUE_TRUE
+#define GIT_ATTR_FALSE_T GIT_ATTR_VALUE_FALSE
+#define GIT_ATTR_VALUE_T GIT_ATTR_VALUE_STRING
+
+#define GIT_ATTR_TRUE(attr) GIT_ATTR_IS_TRUE(attr)
+#define GIT_ATTR_FALSE(attr) GIT_ATTR_IS_FALSE(attr)
+#define GIT_ATTR_UNSPECIFIED(attr) GIT_ATTR_IS_UNSPECIFIED(attr)
+
+typedef git_attr_value_t git_attr_t;
+
+/**@}*/
+
+/** @name Deprecated Blob Functions
+ *
+ * These functions are retained for backward compatibility.  The newer
+ * versions of these functions should be preferred in all new code.
+ *
+ * There is no plan to remove these backward compatibility values at
+ * this time.
+ */
+/**@{*/
+
+GIT_EXTERN(int) git_blob_create_fromworkdir(git_oid *id, git_repository *repo, const char *relative_path);
+GIT_EXTERN(int) git_blob_create_fromdisk(git_oid *id, git_repository *repo, const char *path);
+GIT_EXTERN(int) git_blob_create_fromstream(
+       git_writestream **out,
+       git_repository *repo,
+       const char *hintpath);
+GIT_EXTERN(int) git_blob_create_fromstream_commit(
+       git_oid *out,
+       git_writestream *stream);
+GIT_EXTERN(int) git_blob_create_frombuffer(
+       git_oid *id, git_repository *repo, const void *buffer, size_t len);
+
+/** Deprecated in favor of @see git_blob_filter */
+GIT_EXTERN(int) git_blob_filtered_content(
+       git_buf *out,
+       git_blob *blob,
+       const char *as_path,
+       int check_for_binary_data);
+
+/**@}*/
+
 /** @name Deprecated Buffer Functions
  *
  * These functions and enumeration values are retained for backward
@@ -52,6 +136,19 @@ GIT_EXTERN(void) git_buf_free(git_buf *buffer);
 
 /**@}*/
 
+/** @name Deprecated Config Functions and Constants
+ */
+/**@{*/
+
+#define GIT_CVAR_FALSE  GIT_CONFIGMAP_FALSE
+#define GIT_CVAR_TRUE   GIT_CONFIGMAP_TRUE
+#define GIT_CVAR_INT32  GIT_CONFIGMAP_INT32
+#define GIT_CVAR_STRING GIT_CONFIGMAP_STRING
+
+typedef git_configmap git_cvar_map;
+
+/**@}*/
+
 /** @name Deprecated Error Functions and Constants
  *
  * These functions and enumeration values are retained for backward
@@ -149,10 +246,11 @@ GIT_EXTERN(void) giterr_set_oom(void);
 
 /**@}*/
 
-/** @name Deprecated Index Constants
+/** @name Deprecated Index Functions and Constants
  *
- * These enumeration values are retained for backward compatibility.
- * The newer versions of these values should be preferred in all new code.
+ * These functions and enumeration values are retained for backward
+ * compatibility.  The newer versions of these values should be
+ * preferred in all new code.
  *
  * There is no plan to remove these backward compatibility values at
  * this time.
@@ -192,6 +290,11 @@ GIT_EXTERN(void) giterr_set_oom(void);
 #define GIT_INDEXCAP_NO_SYMLINKS       GIT_INDEX_CAPABILITY_NO_SYMLINKS
 #define GIT_INDEXCAP_FROM_OWNER        GIT_INDEX_CAPABILITY_FROM_OWNER
 
+GIT_EXTERN(int) git_index_add_frombuffer(
+       git_index *index,
+       const git_index_entry *entry,
+       const void *buffer, size_t len);
+
 /**@}*/
 
 /** @name Deprecated Object Constants
@@ -217,6 +320,20 @@ GIT_EXTERN(void) giterr_set_oom(void);
 #define GIT_OBJ_OFS_DELTA GIT_OBJECT_OFS_DELTA
 #define GIT_OBJ_REF_DELTA GIT_OBJECT_REF_DELTA
 
+/**
+ * Get the size in bytes for the structure which
+ * acts as an in-memory representation of any given
+ * object type.
+ *
+ * For all the core types, this would the equivalent
+ * of calling `sizeof(git_commit)` if the core types
+ * were not opaque on the external API.
+ *
+ * @param type object type to get its size
+ * @return size in bytes of the object
+ */
+GIT_EXTERN(size_t) git_object__size(git_object_t type);
+
 /**@}*/
 
 /** @name Deprecated Reference Constants
@@ -243,6 +360,207 @@ GIT_EXTERN(void) giterr_set_oom(void);
 #define GIT_REF_FORMAT_REFSPEC_PATTERN GIT_REFERENCE_FORMAT_REFSPEC_PATTERN
 #define GIT_REF_FORMAT_REFSPEC_SHORTHAND GIT_REFERENCE_FORMAT_REFSPEC_SHORTHAND
 
+GIT_EXTERN(int) git_tag_create_frombuffer(
+       git_oid *oid,
+       git_repository *repo,
+       const char *buffer,
+       int force);
+
+/**@}*/
+
+/** @name Deprecated Credential Types
+ *
+ * These types are retained for backward compatibility.  The newer
+ * versions of these values should be preferred in all new code.
+ *
+ * There is no plan to remove these backward compatibility values at
+ * this time.
+ */
+
+typedef git_credential git_cred;
+typedef git_credential_userpass_plaintext git_cred_userpass_plaintext;
+typedef git_credential_username git_cred_username;
+typedef git_credential_default git_cred_default;
+typedef git_credential_ssh_key git_cred_ssh_key;
+typedef git_credential_ssh_interactive git_cred_ssh_interactive;
+typedef git_credential_ssh_custom git_cred_ssh_custom;
+
+typedef git_credential_acquire_cb git_cred_acquire_cb;
+typedef git_credential_sign_cb git_cred_sign_callback;
+typedef git_credential_sign_cb git_cred_sign_cb;
+typedef git_credential_ssh_interactive_cb git_cred_ssh_interactive_callback;
+typedef git_credential_ssh_interactive_cb git_cred_ssh_interactive_cb;
+
+#define git_credtype_t git_credential_t
+
+#define GIT_CREDTYPE_USERPASS_PLAINTEXT GIT_CREDENTIAL_USERPASS_PLAINTEXT
+#define GIT_CREDTYPE_SSH_KEY GIT_CREDENTIAL_SSH_KEY
+#define GIT_CREDTYPE_SSH_CUSTOM GIT_CREDENTIAL_SSH_CUSTOM
+#define GIT_CREDTYPE_DEFAULT GIT_CREDENTIAL_DEFAULT
+#define GIT_CREDTYPE_SSH_INTERACTIVE GIT_CREDENTIAL_SSH_INTERACTIVE
+#define GIT_CREDTYPE_USERNAME GIT_CREDENTIAL_USERNAME
+#define GIT_CREDTYPE_SSH_MEMORY GIT_CREDENTIAL_SSH_MEMORY
+
+GIT_EXTERN(void) git_cred_free(git_credential *cred);
+GIT_EXTERN(int) git_cred_has_username(git_credential *cred);
+GIT_EXTERN(const char *) git_cred_get_username(git_credential *cred);
+GIT_EXTERN(int) git_cred_userpass_plaintext_new(
+       git_credential **out,
+       const char *username,
+       const char *password);
+GIT_EXTERN(int) git_cred_default_new(git_credential **out);
+GIT_EXTERN(int) git_cred_username_new(git_credential **out, const char *username);
+GIT_EXTERN(int) git_cred_ssh_key_new(
+       git_credential **out,
+       const char *username,
+       const char *publickey,
+       const char *privatekey,
+       const char *passphrase);
+GIT_EXTERN(int) git_cred_ssh_key_memory_new(
+       git_credential **out,
+       const char *username,
+       const char *publickey,
+       const char *privatekey,
+       const char *passphrase);
+GIT_EXTERN(int) git_cred_ssh_interactive_new(
+       git_credential **out,
+       const char *username,
+       git_credential_ssh_interactive_cb prompt_callback,
+       void *payload);
+GIT_EXTERN(int) git_cred_ssh_key_from_agent(
+       git_credential **out,
+       const char *username);
+GIT_EXTERN(int) git_cred_ssh_custom_new(
+       git_credential **out,
+       const char *username,
+       const char *publickey,
+       size_t publickey_len,
+       git_credential_sign_cb sign_callback,
+       void *payload);
+
+/* Deprecated Credential Helper Types */
+
+typedef git_credential_userpass_payload git_cred_userpass_payload;
+
+GIT_EXTERN(int) git_cred_userpass(
+       git_credential **out,
+       const char *url,
+       const char *user_from_url,
+       unsigned int allowed_types,
+       void *payload);
+
+/**@}*/
+
+/** @name Deprecated Trace Callback Types
+ *
+ * These types are retained for backward compatibility.  The newer
+ * versions of these values should be preferred in all new code.
+ *
+ * There is no plan to remove these backward compatibility values at
+ * this time.
+ */
+/**@{*/
+
+typedef git_trace_cb git_trace_callback;
+
+/**@}*/
+
+/** @name Deprecated Object ID Types
+ *
+ * These types are retained for backward compatibility.  The newer
+ * versions of these values should be preferred in all new code.
+ *
+ * There is no plan to remove these backward compatibility values at
+ * this time.
+ */
+/**@{*/
+
+GIT_EXTERN(int) git_oid_iszero(const git_oid *id);
+
+/**@}*/
+
+/** @name Deprecated Transfer Progress Types
+ *
+ * These types are retained for backward compatibility.  The newer
+ * versions of these values should be preferred in all new code.
+ *
+ * There is no plan to remove these backward compatibility values at
+ * this time.
+ */
+/**@{*/
+
+/**
+ * This structure is used to provide callers information about the
+ * progress of indexing a packfile.
+ *
+ * This type is deprecated, but there is no plan to remove this
+ * type definition at this time.
+ */
+typedef git_indexer_progress git_transfer_progress;
+
+/**
+ * Type definition for progress callbacks during indexing.
+ *
+ * This type is deprecated, but there is no plan to remove this
+ * type definition at this time.
+ */
+typedef git_indexer_progress_cb git_transfer_progress_cb;
+
+/**
+ * Type definition for push transfer progress callbacks.
+ *
+ * This type is deprecated, but there is no plan to remove this
+ * type definition at this time.
+ */
+typedef git_push_transfer_progress_cb git_push_transfer_progress;
+
+ /** The type of a remote completion event */
+#define git_remote_completion_type git_remote_completion_t
+
+/**
+ * Callback for listing the remote heads
+ */
+typedef int GIT_CALLBACK(git_headlist_cb)(git_remote_head *rhead, void *payload);
+
+/**@}*/
+
+/** @name Deprecated Options Initialization Functions
+ *
+ * These functions are retained for backward compatibility.  The newer
+ * versions of these functions should be preferred in all new code.
+ *
+ * There is no plan to remove these backward compatibility functions at
+ * this time.
+ */
+/**@{*/
+
+GIT_EXTERN(int) git_blame_init_options(git_blame_options *opts, unsigned int version);
+GIT_EXTERN(int) git_checkout_init_options(git_checkout_options *opts, unsigned int version);
+GIT_EXTERN(int) git_cherrypick_init_options(git_cherrypick_options *opts, unsigned int version);
+GIT_EXTERN(int) git_clone_init_options(git_clone_options *opts, unsigned int version);
+GIT_EXTERN(int) git_describe_init_options(git_describe_options *opts, unsigned int version);
+GIT_EXTERN(int) git_describe_init_format_options(git_describe_format_options *opts, unsigned int version);
+GIT_EXTERN(int) git_diff_init_options(git_diff_options *opts, unsigned int version);
+GIT_EXTERN(int) git_diff_find_init_options(git_diff_find_options *opts, unsigned int version);
+GIT_EXTERN(int) git_diff_format_email_init_options(git_diff_format_email_options *opts, unsigned int version);
+GIT_EXTERN(int) git_diff_patchid_init_options(git_diff_patchid_options *opts, unsigned int version);
+GIT_EXTERN(int) git_fetch_init_options(git_fetch_options *opts, unsigned int version);
+GIT_EXTERN(int) git_indexer_init_options(git_indexer_options *opts, unsigned int version);
+GIT_EXTERN(int) git_merge_init_options(git_merge_options *opts, unsigned int version);
+GIT_EXTERN(int) git_merge_file_init_input(git_merge_file_input *input, unsigned int version);
+GIT_EXTERN(int) git_merge_file_init_options(git_merge_file_options *opts, unsigned int version);
+GIT_EXTERN(int) git_proxy_init_options(git_proxy_options *opts, unsigned int version);
+GIT_EXTERN(int) git_push_init_options(git_push_options *opts, unsigned int version);
+GIT_EXTERN(int) git_rebase_init_options(git_rebase_options *opts, unsigned int version);
+GIT_EXTERN(int) git_remote_create_init_options(git_remote_create_options *opts, unsigned int version);
+GIT_EXTERN(int) git_repository_init_init_options(git_repository_init_options *opts, unsigned int version);
+GIT_EXTERN(int) git_revert_init_options(git_revert_options *opts, unsigned int version);
+GIT_EXTERN(int) git_stash_apply_init_options(git_stash_apply_options *opts, unsigned int version);
+GIT_EXTERN(int) git_status_init_options(git_status_options *opts, unsigned int version);
+GIT_EXTERN(int) git_submodule_update_init_options(git_submodule_update_options *opts, unsigned int version);
+GIT_EXTERN(int) git_worktree_add_init_options(git_worktree_add_options *opts, unsigned int version);
+GIT_EXTERN(int) git_worktree_prune_init_options(git_worktree_prune_options *opts, unsigned int version);
+
 /**@}*/
 
 /** @} */