1 /* 2 * Copyright (C) the libgit2 contributors. All rights reserved. 3 * 4 * This file is part of libgit2, distributed under the GNU GPL v2 with 5 * a Linking Exception. For full terms see the included COPYING file. 6 */ 7 /** 8 * License: GPL-2.0(Linking Exception) 9 */ 10 module libgit2.deprecated_; 11 12 13 private static import libgit2.attr; 14 private static import libgit2.blame; 15 private static import libgit2.blob; 16 private static import libgit2.buffer; 17 private static import libgit2.checkout; 18 private static import libgit2.cherrypick; 19 private static import libgit2.clone; 20 private static import libgit2.config; 21 private static import libgit2.credential; 22 private static import libgit2.credential_helpers; 23 private static import libgit2.describe; 24 private static import libgit2.diff; 25 private static import libgit2.errors; 26 private static import libgit2.filter; 27 private static import libgit2.index; 28 private static import libgit2.indexer; 29 private static import libgit2.merge; 30 private static import libgit2.oid; 31 private static import libgit2.oidarray; 32 private static import libgit2.proxy; 33 private static import libgit2.rebase; 34 private static import libgit2.refs; 35 private static import libgit2.remote; 36 private static import libgit2.repository; 37 private static import libgit2.revert; 38 private static import libgit2.revparse; 39 private static import libgit2.stash; 40 private static import libgit2.status; 41 private static import libgit2.strarray; 42 private static import libgit2.submodule; 43 private static import libgit2.trace; 44 private static import libgit2.types; 45 private static import libgit2.worktree; 46 private import libgit2.common: GIT_EXTERN; 47 48 extern (C): 49 nothrow @nogc: 50 public: 51 deprecated: 52 53 /* 54 * Users can avoid deprecated functions by defining `GIT_DEPRECATE_HARD`. 55 */ 56 version (GIT_DEPRECATE_HARD) { 57 } else { 58 /* 59 * The credential structures are now opaque by default, and their 60 * definition has moved into the `sys/credential.h` header; include 61 * them here for backward compatibility. 62 */ 63 //public import import libgit2.credential; 64 65 /* 66 * @file git2/deprecated.h 67 * @brief libgit2 deprecated functions and values 68 * @ingroup Git 69 * @{ 70 */ 71 72 /* @name Deprecated Attribute Constants 73 * 74 * These enumeration values are retained for backward compatibility. 75 * The newer versions of these functions should be preferred in all 76 * new code. 77 * 78 * There is no plan to remove these backward compatibility values at 79 * this time. 80 */ 81 /*@{*/ 82 83 enum GIT_ATTR_UNSPECIFIED_T = libgit2.attr.git_attr_value_t.GIT_ATTR_VALUE_UNSPECIFIED; 84 enum GIT_ATTR_TRUE_T = libgit2.attr.git_attr_value_t.GIT_ATTR_VALUE_TRUE; 85 enum GIT_ATTR_FALSE_T = libgit2.attr.git_attr_value_t.GIT_ATTR_VALUE_FALSE; 86 enum GIT_ATTR_VALUE_T = libgit2.attr.git_attr_value_t.GIT_ATTR_VALUE_STRING; 87 88 version (none) { 89 alias GIT_ATTR_TRUE = GIT_ATTR_IS_TRUE; 90 alias GIT_ATTR_FALSE = GIT_ATTR_IS_FALSE; 91 alias GIT_ATTR_UNSPECIFIED = GIT_ATTR_IS_UNSPECIFIED; 92 } 93 94 alias git_attr_t = libgit2.attr.git_attr_value_t; 95 96 /*@}*/ 97 98 /* @name Deprecated Blob Functions and Constants 99 * 100 * These functions and enumeration values are retained for backward 101 * compatibility. The newer versions of these functions and values 102 * should be preferred in all new code. 103 * 104 * There is no plan to remove these backward compatibility values at 105 * this time. 106 */ 107 /*@{*/ 108 109 enum GIT_BLOB_FILTER_ATTTRIBUTES_FROM_HEAD = libgit2.blob.git_blob_filter_flag_t.GIT_BLOB_FILTER_ATTRIBUTES_FROM_HEAD; 110 111 @GIT_EXTERN 112 int git_blob_create_fromworkdir(libgit2.oid.git_oid* id, libgit2.types.git_repository* repo, const (char)* relative_path); 113 114 @GIT_EXTERN 115 int git_blob_create_fromdisk(libgit2.oid.git_oid* id, libgit2.types.git_repository* repo, const (char)* path); 116 117 @GIT_EXTERN 118 int git_blob_create_fromstream(libgit2.types.git_writestream** out_, libgit2.types.git_repository* repo, const (char)* hintpath); 119 120 @GIT_EXTERN 121 int git_blob_create_fromstream_commit(libgit2.oid.git_oid* out_, libgit2.types.git_writestream* stream); 122 123 @GIT_EXTERN 124 int git_blob_create_frombuffer(libgit2.oid.git_oid* id, libgit2.types.git_repository* repo, const (void)* buffer, size_t len); 125 126 /* Deprecated in favor of `git_blob_filter`. 127 * 128 * @deprecated Use git_blob_filter 129 * @see git_blob_filter 130 */ 131 @GIT_EXTERN 132 int git_blob_filtered_content(libgit2.buffer.git_buf* out_, libgit2.types.git_blob* blob, const (char)* as_path, int check_for_binary_data); 133 134 /*@}*/ 135 136 /* @name Deprecated Filter Functions 137 * 138 * These functions are retained for backward compatibility. The 139 * newer versions of these functions should be preferred in all 140 * new code. 141 * 142 * There is no plan to remove these backward compatibility values at 143 * this time. 144 */ 145 /*@{*/ 146 147 /** 148 * Deprecated in favor of `git_filter_list_stream_buffer`. 149 * 150 * @deprecated Use git_filter_list_stream_buffer 151 * @see Use git_filter_list_stream_buffer 152 */ 153 @GIT_EXTERN 154 int git_filter_list_stream_data(libgit2.filter.git_filter_list* filters, libgit2.buffer.git_buf* data, libgit2.types.git_writestream* target); 155 156 /** 157 * Deprecated in favor of `git_filter_list_apply_to_buffer`. 158 * 159 * @deprecated Use git_filter_list_apply_to_buffer 160 * @see Use git_filter_list_apply_to_buffer 161 */ 162 @GIT_EXTERN 163 int git_filter_list_apply_to_data(libgit2.buffer.git_buf* out_, libgit2.filter.git_filter_list* filters, libgit2.buffer.git_buf* in_); 164 165 /*@}*/ 166 167 /* @name Deprecated Tree Functions 168 * 169 * These functions are retained for backward compatibility. The 170 * newer versions of these functions and values should be preferred 171 * in all new code. 172 * 173 * There is no plan to remove these backward compatibility values at 174 * this time. 175 */ 176 /**@{*/ 177 178 /** 179 * Write the contents of the tree builder as a tree object. 180 * This is an alias of `git_treebuilder_write` and is preserved 181 * for backward compatibility. 182 * 183 * This function is deprecated, but there is no plan to remove this 184 * function at this time. 185 * 186 * @deprecated Use git_treebuilder_write 187 * @see git_treebuilder_write 188 */ 189 @GIT_EXTERN 190 int git_treebuilder_write_with_buffer(libgit2.oid.git_oid* oid, libgit2.types.git_treebuilder* bld, libgit2.buffer.git_buf* tree); 191 192 /*@}*/ 193 194 /* @name Deprecated Buffer Functions 195 * 196 * These functions and enumeration values are retained for backward 197 * compatibility. The newer versions of these functions should be 198 * preferred in all new code. 199 * 200 * There is no plan to remove these backward compatibility values at 201 * this time. 202 */ 203 /*@{*/ 204 205 /* 206 * Static initializer for git_buf from static buffer 207 */ 208 //#define GIT_BUF_INIT_CONST(STR,LEN) { cast(char*)(STR), 0, cast(size_t)(LEN) } 209 210 /** 211 * Resize the buffer allocation to make more space. 212 * 213 * This will attempt to grow the buffer to accommodate the target size. 214 * 215 * If the buffer refers to memory that was not allocated by libgit2 (i.e. 216 * the `asize` field is zero), then `ptr` will be replaced with a newly 217 * allocated block of data. Be careful so that memory allocated by the 218 * caller is not lost. As a special variant, if you pass `target_size` as 219 * 0 and the memory is not allocated by libgit2, this will allocate a new 220 * buffer of size `size` and copy the external data into it. 221 * 222 * Currently, this will never shrink a buffer, only expand it. 223 * 224 * If the allocation fails, this will return an error and the buffer will be 225 * marked as invalid for future operations, invaliding the contents. 226 * 227 * Params: 228 * buffer = The buffer to be resized; may or may not be allocated yet 229 * target_size = The desired available size 230 * 231 * Returns: 0 on success, -1 on allocation failure 232 */ 233 @GIT_EXTERN 234 int git_buf_grow(libgit2.buffer.git_buf* buffer, size_t target_size); 235 236 /** 237 * Set buffer to a copy of some raw data. 238 * 239 * Params: 240 * buffer = The buffer to set 241 * data = The data to copy into the buffer 242 * datalen = The length of the data to copy into the buffer 243 * 244 * Returns: 0 on success, -1 on allocation failure 245 */ 246 @GIT_EXTERN 247 int git_buf_set(libgit2.buffer.git_buf* buffer, const (void)* data, size_t datalen); 248 249 /** 250 * Check quickly if buffer looks like it contains binary data 251 * 252 * @param buf Buffer to check 253 * @return 1 if buffer looks like non-text data 254 */ 255 @GIT_EXTERN 256 int git_buf_is_binary(const (libgit2.buffer.git_buf)* buf); 257 258 /** 259 * Check quickly if buffer contains a null byte 260 * 261 * @param buf Buffer to check 262 * @return 1 if buffer contains a null byte 263 */ 264 @GIT_EXTERN 265 int git_buf_contains_nul(const (libgit2.buffer.git_buf)* buf); 266 267 /** 268 * Free the memory referred to by the git_buf. This is an alias of 269 * `git_buf_dispose` and is preserved for backward compatibility. 270 * 271 * This function is deprecated, but there is no plan to remove this 272 * function at this time. 273 * 274 * @deprecated Use git_buf_dispose 275 * @see git_buf_dispose 276 */ 277 @GIT_EXTERN 278 void git_buf_free(libgit2.buffer.git_buf* buffer); 279 280 /*@}*/ 281 282 /* @name Deprecated Commit Definitions 283 */ 284 /*@{*/ 285 286 /** 287 * Provide a commit signature during commit creation. 288 * 289 * Callers should instead define a `git_commit_create_cb` that 290 * generates a commit buffer using `git_commit_create_buffer`, sign 291 * that buffer and call `git_commit_create_with_signature`. 292 * 293 * @deprecated use a `git_commit_create_cb` instead 294 */ 295 alias git_commit_signing_cb = int function(libgit2.buffer.git_buf* signature, libgit2.buffer.git_buf* signature_field, const (char)* commit_content, void* payload); 296 297 /*@}*/ 298 299 /* @name Deprecated Config Functions and Constants 300 */ 301 /*@{*/ 302 303 enum GIT_CVAR_FALSE = libgit2.config.git_configmap_t.GIT_CONFIGMAP_FALSE; 304 enum GIT_CVAR_TRUE = libgit2.config.git_configmap_t.GIT_CONFIGMAP_TRUE; 305 enum GIT_CVAR_INT32 = libgit2.config.git_configmap_t.GIT_CONFIGMAP_INT32; 306 enum GIT_CVAR_STRING = libgit2.config.git_configmap_t.GIT_CONFIGMAP_STRING; 307 308 alias git_cvar_map = libgit2.config.git_configmap; 309 310 /*@}*/ 311 312 /* @name Deprecated Diff Functions and Constants 313 * 314 * These functions and enumeration values are retained for backward 315 * compatibility. The newer versions of these functions and values 316 * should be preferred in all new code. 317 * 318 * There is no plan to remove these backward compatibility values at 319 * this time. 320 */ 321 /*@{*/ 322 323 /** 324 * Formatting options for diff e-mail generation 325 */ 326 enum git_diff_format_email_flags_t 327 { 328 /** 329 * Normal patch, the default 330 */ 331 GIT_DIFF_FORMAT_EMAIL_NONE = 0, 332 333 /** 334 * Don't insert "[PATCH]" in the subject header 335 */ 336 GIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER = 1 << 0, 337 } 338 339 //Declaration name in C language 340 enum 341 { 342 GIT_DIFF_FORMAT_EMAIL_NONE = .git_diff_format_email_flags_t.GIT_DIFF_FORMAT_EMAIL_NONE, 343 GIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER = .git_diff_format_email_flags_t.GIT_DIFF_FORMAT_EMAIL_EXCLUDE_SUBJECT_PATCH_MARKER, 344 } 345 346 /** 347 * Options for controlling the formatting of the generated e-mail. 348 */ 349 struct git_diff_format_email_options 350 { 351 uint version_; 352 353 /** 354 * see `git_diff_format_email_flags_t` above 355 */ 356 uint flags; 357 358 /** 359 * This patch number 360 */ 361 size_t patch_no; 362 363 /** 364 * Total number of patches in this series 365 */ 366 size_t total_patches; 367 368 /** 369 * id to use for the commit 370 */ 371 const (libgit2.oid.git_oid)* id; 372 373 /** 374 * Summary of the change 375 */ 376 const (char)* summary; 377 378 /** 379 * Commit message's body 380 */ 381 const (char)* body_; 382 383 /** 384 * Author of the change 385 */ 386 const (libgit2.types.git_signature)* author; 387 } 388 389 enum GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION = 1; 390 391 pragma(inline, true) 392 pure nothrow @safe @nogc @live 393 .git_diff_format_email_options GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT() 394 395 do 396 { 397 .git_diff_format_email_options OUTPUT = 398 { 399 version_: .GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION, 400 flags: 0, 401 patch_no: 1, 402 total_patches: 1, 403 id: null, 404 summary: null, 405 body_: null, 406 author: null, 407 }; 408 409 return OUTPUT; 410 } 411 412 /** 413 * Create an e-mail ready patch from a diff. 414 * 415 * @deprecated git_email_create_from_diff 416 * @see git_email_create_from_diff 417 */ 418 @GIT_EXTERN 419 int git_diff_format_email(libgit2.buffer.git_buf* out_, libgit2.diff.git_diff* diff, const (.git_diff_format_email_options)* opts); 420 421 /** 422 * Create an e-mail ready patch for a commit. 423 * 424 * @deprecated git_email_create_from_commit 425 * @see git_email_create_from_commit 426 */ 427 @GIT_EXTERN 428 int git_diff_commit_as_email(libgit2.buffer.git_buf* out_, libgit2.types.git_repository* repo, libgit2.types.git_commit* commit, size_t patch_no, size_t total_patches, uint flags, const (libgit2.diff.git_diff_options)* diff_opts); 429 430 /** 431 * Initialize git_diff_format_email_options structure 432 * 433 * Initializes a `git_diff_format_email_options` with default values. Equivalent 434 * to creating an instance with GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT. 435 * 436 * Params: 437 * opts = The `git_blame_options` struct to initialize. 438 * version_ = The struct version; pass `GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION`. 439 * 440 * Returns: Zero on success; -1 on failure. 441 */ 442 @GIT_EXTERN 443 int git_diff_format_email_options_init(.git_diff_format_email_options* opts, uint version_); 444 445 /**@}*/ 446 447 /* @name Deprecated Error Functions and Constants 448 * 449 * These functions and enumeration values are retained for backward 450 * compatibility. The newer versions of these functions and values 451 * should be preferred in all new code. 452 * 453 * There is no plan to remove these backward compatibility values at 454 * this time. 455 */ 456 /*@{*/ 457 458 enum GITERR_NONE = libgit2.errors.git_error_t.GIT_ERROR_NONE; 459 enum GITERR_NOMEMORY = libgit2.errors.git_error_t.GIT_ERROR_NOMEMORY; 460 enum GITERR_OS = libgit2.errors.git_error_t.GIT_ERROR_OS; 461 enum GITERR_INVALID = libgit2.errors.git_error_t.GIT_ERROR_INVALID; 462 enum GITERR_REFERENCE = libgit2.errors.git_error_t.GIT_ERROR_REFERENCE; 463 enum GITERR_ZLIB = libgit2.errors.git_error_t.GIT_ERROR_ZLIB; 464 enum GITERR_REPOSITORY = libgit2.errors.git_error_t.GIT_ERROR_REPOSITORY; 465 enum GITERR_CONFIG = libgit2.errors.git_error_t.GIT_ERROR_CONFIG; 466 enum GITERR_REGEX = libgit2.errors.git_error_t.GIT_ERROR_REGEX; 467 enum GITERR_ODB = libgit2.errors.git_error_t.GIT_ERROR_ODB; 468 enum GITERR_INDEX = libgit2.errors.git_error_t.GIT_ERROR_INDEX; 469 enum GITERR_OBJECT = libgit2.errors.git_error_t.GIT_ERROR_OBJECT; 470 enum GITERR_NET = libgit2.errors.git_error_t.GIT_ERROR_NET; 471 enum GITERR_TAG = libgit2.errors.git_error_t.GIT_ERROR_TAG; 472 enum GITERR_TREE = libgit2.errors.git_error_t.GIT_ERROR_TREE; 473 enum GITERR_INDEXER = libgit2.errors.git_error_t.GIT_ERROR_INDEXER; 474 enum GITERR_SSL = libgit2.errors.git_error_t.GIT_ERROR_SSL; 475 enum GITERR_SUBMODULE = libgit2.errors.git_error_t.GIT_ERROR_SUBMODULE; 476 enum GITERR_THREAD = libgit2.errors.git_error_t.GIT_ERROR_THREAD; 477 enum GITERR_STASH = libgit2.errors.git_error_t.GIT_ERROR_STASH; 478 enum GITERR_CHECKOUT = libgit2.errors.git_error_t.GIT_ERROR_CHECKOUT; 479 enum GITERR_FETCHHEAD = libgit2.errors.git_error_t.GIT_ERROR_FETCHHEAD; 480 enum GITERR_MERGE = libgit2.errors.git_error_t.GIT_ERROR_MERGE; 481 enum GITERR_SSH = libgit2.errors.git_error_t.GIT_ERROR_SSH; 482 enum GITERR_FILTER = libgit2.errors.git_error_t.GIT_ERROR_FILTER; 483 enum GITERR_REVERT = libgit2.errors.git_error_t.GIT_ERROR_REVERT; 484 enum GITERR_CALLBACK = libgit2.errors.git_error_t.GIT_ERROR_CALLBACK; 485 enum GITERR_CHERRYPICK = libgit2.errors.git_error_t.GIT_ERROR_CHERRYPICK; 486 enum GITERR_DESCRIBE = libgit2.errors.git_error_t.GIT_ERROR_DESCRIBE; 487 enum GITERR_REBASE = libgit2.errors.git_error_t.GIT_ERROR_REBASE; 488 enum GITERR_FILESYSTEM = libgit2.errors.git_error_t.GIT_ERROR_FILESYSTEM; 489 enum GITERR_PATCH = libgit2.errors.git_error_t.GIT_ERROR_PATCH; 490 enum GITERR_WORKTREE = libgit2.errors.git_error_t.GIT_ERROR_WORKTREE; 491 enum GITERR_SHA1 = .GIT_ERROR_SHA1; 492 493 enum GIT_ERROR_SHA1 = libgit2.errors.git_error_t.GIT_ERROR_SHA; 494 495 /** 496 * Return the last `git_error` object that was generated for the 497 * current thread. This is an alias of `git_error_last` and is 498 * preserved for backward compatibility. 499 * 500 * This function is deprecated, but there is no plan to remove this 501 * function at this time. 502 * 503 * @deprecated Use git_error_last 504 * @see git_error_last 505 */ 506 @GIT_EXTERN 507 const (libgit2.errors.git_error)* giterr_last(); 508 509 /** 510 * Clear the last error. This is an alias of `git_error_last` and is 511 * preserved for backward compatibility. 512 * 513 * This function is deprecated, but there is no plan to remove this 514 * function at this time. 515 * 516 * @deprecated Use git_error_clear 517 * @see git_error_clear 518 */ 519 @GIT_EXTERN 520 void giterr_clear(); 521 522 /** 523 * Sets the error message to the given string. This is an alias of 524 * `git_error_set_str` and is preserved for backward compatibility. 525 * 526 * This function is deprecated, but there is no plan to remove this 527 * function at this time. 528 * 529 * @deprecated Use git_error_set_str 530 * @see git_error_set_str 531 */ 532 @GIT_EXTERN 533 void giterr_set_str(int error_class, const (char)* string_); 534 535 /** 536 * Indicates that an out-of-memory situation occurred. This is an alias 537 * of `git_error_set_oom` and is preserved for backward compatibility. 538 * 539 * This function is deprecated, but there is no plan to remove this 540 * function at this time. 541 * 542 * @deprecated Use git_error_set_oom 543 * @see git_error_set_oom 544 */ 545 @GIT_EXTERN 546 void giterr_set_oom(); 547 548 /*@}*/ 549 550 /* @name Deprecated Index Functions and Constants 551 * 552 * These functions and enumeration values are retained for backward 553 * compatibility. The newer versions of these values should be 554 * preferred in all new code. 555 * 556 * There is no plan to remove these backward compatibility values at 557 * this time. 558 */ 559 /*@{*/ 560 561 enum GIT_IDXENTRY_NAMEMASK = libgit2.index.GIT_INDEX_ENTRY_NAMEMASK; 562 enum GIT_IDXENTRY_STAGEMASK = libgit2.index.GIT_INDEX_ENTRY_STAGEMASK; 563 enum GIT_IDXENTRY_STAGESHIFT = libgit2.index.GIT_INDEX_ENTRY_STAGESHIFT; 564 565 /* The git_indxentry_flag_t enum */ 566 enum GIT_IDXENTRY_EXTENDED = libgit2.index.git_index_entry_flag_t.GIT_INDEX_ENTRY_EXTENDED; 567 enum GIT_IDXENTRY_VALID = libgit2.index.git_index_entry_flag_t.GIT_INDEX_ENTRY_VALID; 568 569 alias GIT_IDXENTRY_STAGE = libgit2.index.GIT_INDEX_ENTRY_STAGE; 570 alias GIT_IDXENTRY_STAGE_SET = libgit2.index.GIT_INDEX_ENTRY_STAGE_SET; 571 572 /* The git_idxentry_extended_flag_t enum */ 573 enum GIT_IDXENTRY_INTENT_TO_ADD = libgit2.index.git_index_entry_extended_flag_t.GIT_INDEX_ENTRY_INTENT_TO_ADD; 574 enum GIT_IDXENTRY_SKIP_WORKTREE = libgit2.index.git_index_entry_extended_flag_t.GIT_INDEX_ENTRY_SKIP_WORKTREE; 575 enum GIT_IDXENTRY_EXTENDED_FLAGS = libgit2.index.git_index_entry_extended_flag_t.GIT_INDEX_ENTRY_INTENT_TO_ADD | libgit2.index.git_index_entry_extended_flag_t.GIT_INDEX_ENTRY_SKIP_WORKTREE; 576 enum GIT_IDXENTRY_EXTENDED2 = 1 << 15; 577 enum GIT_IDXENTRY_UPDATE = 1 << 0; 578 enum GIT_IDXENTRY_REMOVE = 1 << 1; 579 enum GIT_IDXENTRY_UPTODATE = 1 << 2; 580 enum GIT_IDXENTRY_ADDED = 1 << 3; 581 enum GIT_IDXENTRY_HASHED = 1 << 4; 582 enum GIT_IDXENTRY_UNHASHED = 1 << 5; 583 enum GIT_IDXENTRY_WT_REMOVE = 1 << 6; 584 enum GIT_IDXENTRY_CONFLICTED = 1 << 7; 585 enum GIT_IDXENTRY_UNPACKED = 1 << 8; 586 enum GIT_IDXENTRY_NEW_SKIP_WORKTREE = 1 << 9; 587 588 /* The git_index_capability_t enum */ 589 enum GIT_INDEXCAP_IGNORE_CASE = libgit2.index.git_index_capability_t.GIT_INDEX_CAPABILITY_IGNORE_CASE; 590 enum GIT_INDEXCAP_NO_FILEMODE = libgit2.index.git_index_capability_t.GIT_INDEX_CAPABILITY_NO_FILEMODE; 591 enum GIT_INDEXCAP_NO_SYMLINKS = libgit2.index.git_index_capability_t.GIT_INDEX_CAPABILITY_NO_SYMLINKS; 592 enum GIT_INDEXCAP_FROM_OWNER = libgit2.index.git_index_capability_t.GIT_INDEX_CAPABILITY_FROM_OWNER; 593 594 @GIT_EXTERN 595 int git_index_add_frombuffer(libgit2.types.git_index* index, const (libgit2.index.git_index_entry)* entry, const (void)* buffer, size_t len); 596 597 /*@}*/ 598 599 /* @name Deprecated Object Constants 600 * 601 * These enumeration values are retained for backward compatibility. The 602 * newer versions of these values should be preferred in all new code. 603 * 604 * There is no plan to remove these backward compatibility values at 605 * this time. 606 */ 607 /*@{*/ 608 609 alias git_otype = libgit2.types.git_object_t; 610 611 enum GIT_OBJ_ANY = libgit2.types.git_object_t.GIT_OBJECT_ANY; 612 enum GIT_OBJ_BAD = libgit2.types.git_object_t.GIT_OBJECT_INVALID; 613 enum GIT_OBJ__EXT1 = 0; 614 enum GIT_OBJ_COMMIT = libgit2.types.git_object_t.GIT_OBJECT_COMMIT; 615 enum GIT_OBJ_TREE = libgit2.types.git_object_t.GIT_OBJECT_TREE; 616 enum GIT_OBJ_BLOB = libgit2.types.git_object_t.GIT_OBJECT_BLOB; 617 enum GIT_OBJ_TAG = libgit2.types.git_object_t.GIT_OBJECT_TAG; 618 enum GIT_OBJ__EXT2 = 5; 619 enum GIT_OBJ_OFS_DELTA = libgit2.types.git_object_t.GIT_OBJECT_OFS_DELTA; 620 enum GIT_OBJ_REF_DELTA = libgit2.types.git_object_t.GIT_OBJECT_REF_DELTA; 621 622 /** 623 * Get the size in bytes for the structure which 624 * acts as an in-memory representation of any given 625 * object type. 626 * 627 * For all the core types, this would the equivalent 628 * of calling `sizeof(git_commit)` if the core types 629 * were not opaque on the external API. 630 * 631 * Params: 632 * type = object type to get its size 633 * 634 * Returns: size in bytes of the object 635 */ 636 @GIT_EXTERN 637 size_t git_object__size(libgit2.types.git_object_t type); 638 639 /*@}*/ 640 641 /* @name Deprecated Remote Functions 642 * 643 * These functions are retained for backward compatibility. The newer 644 * versions of these functions should be preferred in all new code. 645 * 646 * There is no plan to remove these backward compatibility functions at 647 * this time. 648 */ 649 /*@{*/ 650 651 /** 652 * Ensure the remote name is well-formed. 653 * 654 * @deprecated Use git_remote_name_is_valid 655 * 656 * Params: 657 * remote_name = name to be checked. 658 * 659 * Returns: 1 if the reference name is acceptable; 0 if it isn't 660 */ 661 @GIT_EXTERN 662 int git_remote_is_valid_name(const (char)* remote_name); 663 664 /*@}*/ 665 666 /* @name Deprecated Reference Functions and Constants 667 * 668 * These functions and enumeration values are retained for backward 669 * compatibility. The newer versions of these values should be 670 * preferred in all new code. 671 * 672 * There is no plan to remove these backward compatibility values at 673 * this time. 674 */ 675 /*@{*/ 676 677 /* Basic type of any Git reference. */ 678 alias git_ref_t = libgit2.types.git_reference_t; 679 alias git_reference_normalize_t = libgit2.refs.git_reference_format_t; 680 681 enum GIT_REF_INVALID = libgit2.types.git_reference_t.GIT_REFERENCE_INVALID; 682 enum GIT_REF_OID = libgit2.types.git_reference_t.GIT_REFERENCE_DIRECT; 683 enum GIT_REF_SYMBOLIC = libgit2.types.git_reference_t.GIT_REFERENCE_SYMBOLIC; 684 enum GIT_REF_LISTALL = libgit2.types.git_reference_t.GIT_REFERENCE_ALL; 685 686 enum GIT_REF_FORMAT_NORMAL = libgit2.refs.git_reference_format_t.GIT_REFERENCE_FORMAT_NORMAL; 687 enum GIT_REF_FORMAT_ALLOW_ONELEVEL = libgit2.refs.git_reference_format_t.GIT_REFERENCE_FORMAT_ALLOW_ONELEVEL; 688 enum GIT_REF_FORMAT_REFSPEC_PATTERN = libgit2.refs.git_reference_format_t.GIT_REFERENCE_FORMAT_REFSPEC_PATTERN; 689 enum GIT_REF_FORMAT_REFSPEC_SHORTHAND = libgit2.refs.git_reference_format_t.GIT_REFERENCE_FORMAT_REFSPEC_SHORTHAND; 690 691 /** 692 * Ensure the reference name is well-formed. 693 * 694 * Valid reference names must follow one of two patterns: 695 * 696 * 1. Top-level names must contain only capital letters and underscores, 697 * and must begin and end with a letter. (e.g. "HEAD", "ORIG_HEAD"). 698 * 2. Names prefixed with "refs/" can be almost anything. You must avoid 699 * the characters '~', '^', ':', '\\', '?', '[', and '*', and the 700 * sequences ".." and "@{" which have special meaning to revparse. 701 * 702 * @deprecated Use git_reference_name_is_valid 703 * 704 * Params: 705 * refname = name to be checked. 706 * 707 * Returns: 1 if the reference name is acceptable; 0 if it isn't 708 */ 709 @GIT_EXTERN 710 int git_reference_is_valid_name(const (char)* refname); 711 712 @GIT_EXTERN 713 int git_tag_create_frombuffer(libgit2.oid.git_oid* oid, libgit2.types.git_repository* repo, const (char)* buffer, int force); 714 715 /*@}*/ 716 717 /* @name Deprecated Revspec Constants 718 * 719 * These enumeration values are retained for backward compatibility. 720 * The newer versions of these values should be preferred in all new 721 * code. 722 * 723 * There is no plan to remove these backward compatibility values at 724 * this time. 725 */ 726 /*@{*/ 727 728 alias git_revparse_mode_t = libgit2.revparse.git_revspec_t; 729 730 enum GIT_REVPARSE_SINGLE = libgit2.revparse.git_revspec_t.GIT_REVSPEC_SINGLE; 731 enum GIT_REVPARSE_RANGE = libgit2.revparse.git_revspec_t.GIT_REVSPEC_RANGE; 732 enum GIT_REVPARSE_MERGE_BASE = libgit2.revparse.git_revspec_t.GIT_REVSPEC_MERGE_BASE; 733 734 /*@}*/ 735 736 /* @name Deprecated Credential Types 737 * 738 * These types are retained for backward compatibility. The newer 739 * versions of these values should be preferred in all new code. 740 * 741 * There is no plan to remove these backward compatibility values at 742 * this time. 743 */ 744 /*@{*/ 745 746 alias git_cred = libgit2.credential.git_credential; 747 alias git_cred_userpass_plaintext = libgit2.credential.git_credential_userpass_plaintext; 748 alias git_cred_username = libgit2.credential.git_credential_username; 749 alias git_cred_default = libgit2.credential.git_credential_default; 750 alias git_cred_ssh_key = libgit2.credential.git_credential_ssh_key; 751 alias git_cred_ssh_interactive = libgit2.credential.git_credential_ssh_interactive; 752 alias git_cred_ssh_custom = libgit2.credential.git_credential_ssh_custom; 753 754 alias git_cred_acquire_cb = libgit2.credential.git_credential_acquire_cb; 755 alias git_cred_sign_callback = libgit2.credential.git_credential_sign_cb; 756 alias git_cred_sign_cb = libgit2.credential.git_credential_sign_cb; 757 alias git_cred_ssh_interactive_callback = libgit2.credential.git_credential_ssh_interactive_cb; 758 alias git_cred_ssh_interactive_cb = libgit2.credential.git_credential_ssh_interactive_cb; 759 760 alias git_credtype_t = libgit2.credential.git_credential_t; 761 762 alias GIT_CREDTYPE_USERPASS_PLAINTEXT = libgit2.credential.git_credential_t.GIT_CREDENTIAL_USERPASS_PLAINTEXT; 763 alias GIT_CREDTYPE_SSH_KEY = libgit2.credential.git_credential_t.GIT_CREDENTIAL_SSH_KEY; 764 alias GIT_CREDTYPE_SSH_CUSTOM = libgit2.credential.git_credential_t.GIT_CREDENTIAL_SSH_CUSTOM; 765 alias GIT_CREDTYPE_DEFAULT = libgit2.credential.git_credential_t.GIT_CREDENTIAL_DEFAULT; 766 alias GIT_CREDTYPE_SSH_INTERACTIVE = libgit2.credential.git_credential_t.GIT_CREDENTIAL_SSH_INTERACTIVE; 767 alias GIT_CREDTYPE_USERNAME = libgit2.credential.git_credential_t.GIT_CREDENTIAL_USERNAME; 768 alias GIT_CREDTYPE_SSH_MEMORY = libgit2.credential.git_credential_t.GIT_CREDENTIAL_SSH_MEMORY; 769 770 @GIT_EXTERN 771 void git_cred_free(libgit2.credential.git_credential* cred); 772 773 @GIT_EXTERN 774 int git_cred_has_username(libgit2.credential.git_credential* cred); 775 776 @GIT_EXTERN 777 const (char)* git_cred_get_username(libgit2.credential.git_credential* cred); 778 779 @GIT_EXTERN 780 int git_cred_userpass_plaintext_new(libgit2.credential.git_credential** out_, const (char)* username, const (char)* password); 781 782 @GIT_EXTERN 783 int git_cred_default_new(libgit2.credential.git_credential** out_); 784 785 @GIT_EXTERN 786 int git_cred_username_new(libgit2.credential.git_credential** out_, const (char)* username); 787 788 @GIT_EXTERN 789 int git_cred_ssh_key_new(libgit2.credential.git_credential** out_, const (char)* username, const (char)* publickey, const (char)* privatekey, const (char)* passphrase); 790 791 @GIT_EXTERN 792 int git_cred_ssh_key_memory_new(libgit2.credential.git_credential** out_, const (char)* username, const (char)* publickey, const (char)* privatekey, const (char)* passphrase); 793 794 @GIT_EXTERN 795 int git_cred_ssh_interactive_new(libgit2.credential.git_credential** out_, const (char)* username, libgit2.credential.git_credential_ssh_interactive_cb prompt_callback, void* payload); 796 797 @GIT_EXTERN 798 int git_cred_ssh_key_from_agent(libgit2.credential.git_credential** out_, const (char)* username); 799 800 @GIT_EXTERN 801 int git_cred_ssh_custom_new(libgit2.credential.git_credential** out_, const (char)* username, const (char)* publickey, size_t publickey_len, libgit2.credential.git_credential_sign_cb sign_callback, void* payload); 802 803 /* Deprecated Credential Helper Types */ 804 805 alias git_cred_userpass_payload = libgit2.credential_helpers.git_credential_userpass_payload; 806 807 @GIT_EXTERN 808 int git_cred_userpass(libgit2.credential.git_credential** out_, const (char)* url, const (char)* user_from_url, uint allowed_types, void* payload); 809 810 /*@}*/ 811 812 /* @name Deprecated Trace Callback Types 813 * 814 * These types are retained for backward compatibility. The newer 815 * versions of these values should be preferred in all new code. 816 * 817 * There is no plan to remove these backward compatibility values at 818 * this time. 819 */ 820 /*@{*/ 821 822 alias git_trace_callback = libgit2.trace.git_trace_cb; 823 824 /*@}*/ 825 826 /* @name Deprecated Object ID Types 827 * 828 * These types are retained for backward compatibility. The newer 829 * versions of these values should be preferred in all new code. 830 * 831 * There is no plan to remove these backward compatibility values at 832 * this time. 833 */ 834 /*@{*/ 835 836 version (GIT_EXPERIMENTAL_SHA256) { 837 } else { 838 enum GIT_OID_RAWSZ = libgit2.oid.GIT_OID_SHA1_SIZE; 839 enum GIT_OID_HEXSZ = libgit2.oid.GIT_OID_SHA1_HEXSIZE; 840 enum GIT_OID_HEX_ZERO = libgit2.oid.GIT_OID_SHA1_HEXZERO; 841 } 842 843 @GIT_EXTERN 844 int git_oid_iszero(const (libgit2.oid.git_oid)* id); 845 846 /*@}*/ 847 848 /** @name Deprecated OID Array Functions 849 * 850 * These types are retained for backward compatibility. The newer 851 * versions of these values should be preferred in all new code. 852 * 853 * There is no plan to remove these backward compatibility values at 854 * this time. 855 */ 856 /*@{*/ 857 858 /** 859 * Free the memory referred to by the git_oidarray. This is an alias of 860 * `git_oidarray_dispose` and is preserved for backward compatibility. 861 * 862 * This function is deprecated, but there is no plan to remove this 863 * function at this time. 864 * 865 * @deprecated Use git_oidarray_dispose 866 * @see git_oidarray_dispose 867 */ 868 @GIT_EXTERN 869 void git_oidarray_free(libgit2.oidarray.git_oidarray* array); 870 871 /*@}*/ 872 873 /* @name Deprecated Transfer Progress Types 874 * 875 * These types are retained for backward compatibility. The newer 876 * versions of these values should be preferred in all new code. 877 * 878 * There is no plan to remove these backward compatibility values at 879 * this time. 880 */ 881 /*@{*/ 882 883 /** 884 * This structure is used to provide callers information about the 885 * progress of indexing a packfile. 886 * 887 * This type is deprecated, but there is no plan to remove this 888 * type definition at this time. 889 */ 890 alias git_transfer_progress = libgit2.indexer.git_indexer_progress; 891 892 /** 893 * Type definition for progress callbacks during indexing. 894 * 895 * This type is deprecated, but there is no plan to remove this 896 * type definition at this time. 897 */ 898 alias git_transfer_progress_cb = libgit2.indexer.git_indexer_progress_cb; 899 900 /** 901 * Type definition for push transfer progress callbacks. 902 * 903 * This type is deprecated, but there is no plan to remove this 904 * type definition at this time. 905 */ 906 alias git_push_transfer_progress = libgit2.remote.git_push_transfer_progress_cb; 907 908 /** 909 * The type of a remote completion event 910 */ 911 alias git_remote_completion_type = libgit2.remote.git_remote_completion_t; 912 913 /** 914 * Callback for listing the remote heads 915 */ 916 alias git_headlist_cb = int function(libgit2.types.git_remote_head* rhead, void* payload); 917 918 /*@}*/ 919 920 /* @name Deprecated String Array Functions 921 * 922 * These types are retained for backward compatibility. The newer 923 * versions of these values should be preferred in all new code. 924 * 925 * There is no plan to remove these backward compatibility values at 926 * this time. 927 */ 928 /*@{*/ 929 930 /** 931 * Copy a string array object from source to target. 932 * 933 * This function is deprecated, but there is no plan to remove this 934 * function at this time. 935 * 936 * Params: 937 * tgt = target 938 * src = source 939 * 940 * Returns: 0 on success, < 0 on allocation failure 941 */ 942 @GIT_EXTERN 943 int git_strarray_copy(libgit2.strarray.git_strarray* tgt, const (libgit2.strarray.git_strarray)* src); 944 945 /** 946 * Free the memory referred to by the git_strarray. This is an alias of 947 * `git_strarray_dispose` and is preserved for backward compatibility. 948 * 949 * This function is deprecated, but there is no plan to remove this 950 * function at this time. 951 * 952 * @deprecated Use git_strarray_dispose 953 * @see git_strarray_dispose 954 */ 955 @GIT_EXTERN 956 void git_strarray_free(libgit2.strarray.git_strarray* array); 957 958 /*@}*/ 959 960 /* @name Deprecated Options Initialization Functions 961 * 962 * These functions are retained for backward compatibility. The newer 963 * versions of these functions should be preferred in all new code. 964 * 965 * There is no plan to remove these backward compatibility functions at 966 * this time. 967 */ 968 /*@{*/ 969 970 @GIT_EXTERN 971 int git_blame_init_options(libgit2.blame.git_blame_options* opts, uint version_); 972 973 @GIT_EXTERN 974 int git_checkout_init_options(libgit2.checkout.git_checkout_options* opts, uint version_); 975 976 @GIT_EXTERN 977 int git_cherrypick_init_options(libgit2.cherrypick.git_cherrypick_options* opts, uint version_); 978 979 @GIT_EXTERN 980 int git_clone_init_options(libgit2.clone.git_clone_options* opts, uint version_); 981 982 @GIT_EXTERN 983 int git_describe_init_options(libgit2.describe.git_describe_options* opts, uint version_); 984 985 @GIT_EXTERN 986 int git_describe_init_format_options(libgit2.describe.git_describe_format_options* opts, uint version_); 987 988 @GIT_EXTERN 989 int git_diff_init_options(libgit2.diff.git_diff_options* opts, uint version_); 990 991 @GIT_EXTERN 992 int git_diff_find_init_options(libgit2.diff.git_diff_find_options* opts, uint version_); 993 994 @GIT_EXTERN 995 int git_diff_format_email_init_options(.git_diff_format_email_options* opts, uint version_); 996 997 @GIT_EXTERN 998 int git_diff_patchid_init_options(libgit2.diff.git_diff_patchid_options* opts, uint version_); 999 1000 @GIT_EXTERN 1001 int git_fetch_init_options(libgit2.remote.git_fetch_options* opts, uint version_); 1002 1003 @GIT_EXTERN 1004 int git_indexer_init_options(libgit2.indexer.git_indexer_options* opts, uint version_); 1005 1006 @GIT_EXTERN 1007 int git_merge_init_options(libgit2.merge.git_merge_options* opts, uint version_); 1008 1009 @GIT_EXTERN 1010 int git_merge_file_init_input(libgit2.merge.git_merge_file_input* input, uint version_); 1011 1012 @GIT_EXTERN 1013 int git_merge_file_init_options(libgit2.merge.git_merge_file_options* opts, uint version_); 1014 1015 @GIT_EXTERN 1016 int git_proxy_init_options(libgit2.proxy.git_proxy_options* opts, uint version_); 1017 1018 @GIT_EXTERN 1019 int git_push_init_options(libgit2.remote.git_push_options* opts, uint version_); 1020 1021 @GIT_EXTERN 1022 int git_rebase_init_options(libgit2.rebase.git_rebase_options* opts, uint version_); 1023 1024 @GIT_EXTERN 1025 int git_remote_create_init_options(libgit2.remote.git_remote_create_options* opts, uint version_); 1026 1027 @GIT_EXTERN 1028 int git_repository_init_init_options(libgit2.repository.git_repository_init_options* opts, uint version_); 1029 1030 @GIT_EXTERN 1031 int git_revert_init_options(libgit2.revert.git_revert_options* opts, uint version_); 1032 1033 @GIT_EXTERN 1034 int git_stash_apply_init_options(libgit2.stash.git_stash_apply_options* opts, uint version_); 1035 1036 @GIT_EXTERN 1037 int git_status_init_options(libgit2.status.git_status_options* opts, uint version_); 1038 1039 @GIT_EXTERN 1040 int git_submodule_update_init_options(libgit2.submodule.git_submodule_update_options* opts, uint version_); 1041 1042 @GIT_EXTERN 1043 int git_worktree_add_init_options(libgit2.worktree.git_worktree_add_options* opts, uint version_); 1044 1045 @GIT_EXTERN 1046 int git_worktree_prune_init_options(libgit2.worktree.git_worktree_prune_options* opts, uint version_); 1047 1048 /*@}*/ 1049 1050 /* @} */ 1051 }