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.common;
11 
12 
13 private static import core.stdc.config;
14 
15 //#include <time.h>
16 
17 //#if defined(_MSC_VER) && _MSC_VER < 1800
18 	//public import core.stdc.stdint;
19 //#elif !defined(__CLANG_INTTYPES_H)
20 	//#include <inttypes.h>
21 //#endif
22 
23 enum GIT_EXTERN;
24 
25 /* Declare a function's takes printf style arguments. */
26 //#if defined(__GNUC__)
27 	//#define GIT_FORMAT_PRINTF(a, b) __attribute__((format(printf, a, b)))
28 //#else
29 	//#define GIT_FORMAT_PRINTF(a, b) /* empty */
30 //#endif
31 
32 version (Cygwin) {
33 	enum GIT_WIN32 = 0;
34 } else version (Windows) {
35 	enum GIT_WIN32 = 1;
36 } else {
37 	enum GIT_WIN32 = 0;
38 }
39 
40 //#if defined(__amigaos4__)
41 	//#include <netinet/in.h>
42 //#endif
43 
44 /*
45  * @file git2/common.h
46  * @brief Git common platform definitions
47  * @defgroup git_common Git common platform definitions
48  * @ingroup Git
49  * @{
50  */
51 
52 extern (C):
53 nothrow @nogc:
54 public:
55 
56 /**
57  * The separator used in path list strings (ie like in the PATH
58  * environment variable). A semi-colon ";" is used on Windows and
59  * AmigaOS, and a colon ":" for all other systems.
60  */
61 //#if defined(GIT_WIN32) || defined(AMIGA)
62 static if (.GIT_WIN32) {
63 	enum GIT_PATH_LIST_SEPARATOR = ';';
64 } else {
65 	enum GIT_PATH_LIST_SEPARATOR = ':';
66 }
67 
68 /**
69  * The maximum length of a valid git path.
70  */
71 enum GIT_PATH_MAX = 4096;
72 
73 /**
74  * Return the version of the libgit2 library
75  * being currently used.
76  *
77  * Params:
78  *      major = Store the major version number
79  *      minor = Store the minor version number
80  *      rev = Store the revision (patch) number
81  *
82  * Returns: 0 on success or an error code on failure
83  */
84 @GIT_EXTERN
85 int git_libgit2_version(int* major, int* minor, int* rev);
86 
87 /**
88  * Return the prerelease state of the libgit2 library currently being
89  * used.  For nightly builds during active development, this will be
90  * "alpha".  Releases may have a "beta" or release candidate ("rc1",
91  * "rc2", etc) prerelease.  For a final release, this function returns
92  * null.
93  *
94  * Returns: the name of the prerelease state or null
95  */
96 @GIT_EXTERN
97 const (char)* git_libgit2_prerelease();
98 
99 /**
100  * Combinations of these values describe the features with which libgit2
101  * was compiled
102  */
103 enum git_feature_t
104 {
105 	/**
106 	 * If set, libgit2 was built thread-aware and can be safely used from multiple
107 	 * threads.
108 	 */
109 	GIT_FEATURE_THREADS = 1 << 0,
110 
111 	/**
112 	 * If set, libgit2 was built with and linked against a TLS implementation.
113 	 * Custom TLS streams may still be added by the user to support HTTPS
114 	 * regardless of this.
115 	 */
116 	GIT_FEATURE_HTTPS = 1 << 1,
117 
118 	/**
119 	 * If set, libgit2 was built with and linked against libssh2. A custom
120 	 * transport may still be added by the user to support libssh2 regardless of
121 	 * this.
122 	 */
123 	GIT_FEATURE_SSH = 1 << 2,
124 
125 	/**
126 	 * If set, libgit2 was built with support for sub-second resolution in file
127 	 * modification times.
128 	 */
129 	GIT_FEATURE_NSEC = 1 << 3,
130 }
131 
132 //Declaration name in C language
133 enum
134 {
135 	GIT_FEATURE_THREADS = .git_feature_t.GIT_FEATURE_THREADS,
136 	GIT_FEATURE_HTTPS = .git_feature_t.GIT_FEATURE_HTTPS,
137 	GIT_FEATURE_SSH = .git_feature_t.GIT_FEATURE_SSH,
138 	GIT_FEATURE_NSEC = .git_feature_t.GIT_FEATURE_NSEC,
139 }
140 
141 /**
142  * Query compile time options for libgit2.
143  *
144  * Returns: A combination of GIT_FEATURE_* values.
145  *
146  * - git_feature_t.GIT_FEATURE_THREADS
147  *   Libgit2 was compiled with thread support. Note that thread support is
148  *   still to be seen as a 'work in progress' - basic object lookups are
149  *   believed to be threadsafe, but other operations may not be.
150  *
151  * - git_feature_t.GIT_FEATURE_HTTPS
152  *   Libgit2 supports the https:// protocol. This requires the openssl
153  *   library to be found when compiling libgit2.
154  *
155  * - git_feature_t.GIT_FEATURE_SSH
156  *   Libgit2 supports the SSH protocol for network operations. This requires
157  *   the libssh2 library to be found when compiling libgit2
158  *
159  * - GIT_FEATURE_NSEC
160  *   Libgit2 supports the sub-second resolution in file modification times.
161  */
162 @GIT_EXTERN
163 int git_libgit2_features();
164 
165 /**
166  * Global library options
167  *
168  * These are used to select which global option to set or get and are
169  * used in `git_libgit2_opts()`.
170  */
171 enum git_libgit2_opt_t
172 {
173 	GIT_OPT_GET_MWINDOW_SIZE,
174 	GIT_OPT_SET_MWINDOW_SIZE,
175 	GIT_OPT_GET_MWINDOW_MAPPED_LIMIT,
176 	GIT_OPT_SET_MWINDOW_MAPPED_LIMIT,
177 	GIT_OPT_GET_SEARCH_PATH,
178 	GIT_OPT_SET_SEARCH_PATH,
179 	GIT_OPT_SET_CACHE_OBJECT_LIMIT,
180 	GIT_OPT_SET_CACHE_MAX_SIZE,
181 	GIT_OPT_ENABLE_CACHING,
182 	GIT_OPT_GET_CACHED_MEMORY,
183 	GIT_OPT_GET_TEMPLATE_PATH,
184 	GIT_OPT_SET_TEMPLATE_PATH,
185 	GIT_OPT_SET_SSL_CERT_LOCATIONS,
186 	GIT_OPT_SET_USER_AGENT,
187 	GIT_OPT_ENABLE_STRICT_OBJECT_CREATION,
188 	GIT_OPT_ENABLE_STRICT_SYMBOLIC_REF_CREATION,
189 	GIT_OPT_SET_SSL_CIPHERS,
190 	GIT_OPT_GET_USER_AGENT,
191 	GIT_OPT_ENABLE_OFS_DELTA,
192 	GIT_OPT_ENABLE_FSYNC_GITDIR,
193 	GIT_OPT_GET_WINDOWS_SHAREMODE,
194 	GIT_OPT_SET_WINDOWS_SHAREMODE,
195 	GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION,
196 	GIT_OPT_SET_ALLOCATOR,
197 	GIT_OPT_ENABLE_UNSAVED_INDEX_SAFETY,
198 	GIT_OPT_GET_PACK_MAX_OBJECTS,
199 	GIT_OPT_SET_PACK_MAX_OBJECTS,
200 	GIT_OPT_DISABLE_PACK_KEEP_FILE_CHECKS,
201 	GIT_OPT_ENABLE_HTTP_EXPECT_CONTINUE,
202 	GIT_OPT_GET_MWINDOW_FILE_LIMIT,
203 	GIT_OPT_SET_MWINDOW_FILE_LIMIT,
204 	GIT_OPT_SET_ODB_PACKED_PRIORITY,
205 	GIT_OPT_SET_ODB_LOOSE_PRIORITY,
206 	GIT_OPT_GET_EXTENSIONS,
207 	GIT_OPT_SET_EXTENSIONS,
208 	GIT_OPT_GET_OWNER_VALIDATION,
209 	GIT_OPT_SET_OWNER_VALIDATION,
210 	GIT_OPT_GET_HOMEDIR,
211 	GIT_OPT_SET_HOMEDIR,
212 }
213 
214 //Declaration name in C language
215 enum
216 {
217 	GIT_OPT_GET_MWINDOW_SIZE = .git_libgit2_opt_t.GIT_OPT_GET_MWINDOW_SIZE,
218 	GIT_OPT_SET_MWINDOW_SIZE = .git_libgit2_opt_t.GIT_OPT_SET_MWINDOW_SIZE,
219 	GIT_OPT_GET_MWINDOW_MAPPED_LIMIT = .git_libgit2_opt_t.GIT_OPT_GET_MWINDOW_MAPPED_LIMIT,
220 	GIT_OPT_SET_MWINDOW_MAPPED_LIMIT = .git_libgit2_opt_t.GIT_OPT_SET_MWINDOW_MAPPED_LIMIT,
221 	GIT_OPT_GET_SEARCH_PATH = .git_libgit2_opt_t.GIT_OPT_GET_SEARCH_PATH,
222 	GIT_OPT_SET_SEARCH_PATH = .git_libgit2_opt_t.GIT_OPT_SET_SEARCH_PATH,
223 	GIT_OPT_SET_CACHE_OBJECT_LIMIT = .git_libgit2_opt_t.GIT_OPT_SET_CACHE_OBJECT_LIMIT,
224 	GIT_OPT_SET_CACHE_MAX_SIZE = .git_libgit2_opt_t.GIT_OPT_SET_CACHE_MAX_SIZE,
225 	GIT_OPT_ENABLE_CACHING = .git_libgit2_opt_t.GIT_OPT_ENABLE_CACHING,
226 	GIT_OPT_GET_CACHED_MEMORY = .git_libgit2_opt_t.GIT_OPT_GET_CACHED_MEMORY,
227 	GIT_OPT_GET_TEMPLATE_PATH = .git_libgit2_opt_t.GIT_OPT_GET_TEMPLATE_PATH,
228 	GIT_OPT_SET_TEMPLATE_PATH = .git_libgit2_opt_t.GIT_OPT_SET_TEMPLATE_PATH,
229 	GIT_OPT_SET_SSL_CERT_LOCATIONS = .git_libgit2_opt_t.GIT_OPT_SET_SSL_CERT_LOCATIONS,
230 	GIT_OPT_SET_USER_AGENT = .git_libgit2_opt_t.GIT_OPT_SET_USER_AGENT,
231 	GIT_OPT_ENABLE_STRICT_OBJECT_CREATION = .git_libgit2_opt_t.GIT_OPT_ENABLE_STRICT_OBJECT_CREATION,
232 	GIT_OPT_ENABLE_STRICT_SYMBOLIC_REF_CREATION = .git_libgit2_opt_t.GIT_OPT_ENABLE_STRICT_SYMBOLIC_REF_CREATION,
233 	GIT_OPT_SET_SSL_CIPHERS = .git_libgit2_opt_t.GIT_OPT_SET_SSL_CIPHERS,
234 	GIT_OPT_GET_USER_AGENT = .git_libgit2_opt_t.GIT_OPT_GET_USER_AGENT,
235 	GIT_OPT_ENABLE_OFS_DELTA = .git_libgit2_opt_t.GIT_OPT_ENABLE_OFS_DELTA,
236 	GIT_OPT_ENABLE_FSYNC_GITDIR = .git_libgit2_opt_t.GIT_OPT_ENABLE_FSYNC_GITDIR,
237 	GIT_OPT_GET_WINDOWS_SHAREMODE = .git_libgit2_opt_t.GIT_OPT_GET_WINDOWS_SHAREMODE,
238 	GIT_OPT_SET_WINDOWS_SHAREMODE = .git_libgit2_opt_t.GIT_OPT_SET_WINDOWS_SHAREMODE,
239 	GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION = .git_libgit2_opt_t.GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION,
240 	GIT_OPT_SET_ALLOCATOR = .git_libgit2_opt_t.GIT_OPT_SET_ALLOCATOR,
241 	GIT_OPT_ENABLE_UNSAVED_INDEX_SAFETY = .git_libgit2_opt_t.GIT_OPT_ENABLE_UNSAVED_INDEX_SAFETY,
242 	GIT_OPT_GET_PACK_MAX_OBJECTS = .git_libgit2_opt_t.GIT_OPT_GET_PACK_MAX_OBJECTS,
243 	GIT_OPT_SET_PACK_MAX_OBJECTS = .git_libgit2_opt_t.GIT_OPT_SET_PACK_MAX_OBJECTS,
244 	GIT_OPT_DISABLE_PACK_KEEP_FILE_CHECKS = .git_libgit2_opt_t.GIT_OPT_DISABLE_PACK_KEEP_FILE_CHECKS,
245 	GIT_OPT_ENABLE_HTTP_EXPECT_CONTINUE = .git_libgit2_opt_t.GIT_OPT_ENABLE_HTTP_EXPECT_CONTINUE,
246 	GIT_OPT_GET_MWINDOW_FILE_LIMIT = .git_libgit2_opt_t.GIT_OPT_GET_MWINDOW_FILE_LIMIT,
247 	GIT_OPT_SET_MWINDOW_FILE_LIMIT = .git_libgit2_opt_t.GIT_OPT_SET_MWINDOW_FILE_LIMIT,
248 	GIT_OPT_SET_ODB_PACKED_PRIORITY = .git_libgit2_opt_t.GIT_OPT_SET_ODB_PACKED_PRIORITY,
249 	GIT_OPT_SET_ODB_LOOSE_PRIORITY = .git_libgit2_opt_t.GIT_OPT_SET_ODB_LOOSE_PRIORITY,
250 	GIT_OPT_GET_EXTENSIONS = .git_libgit2_opt_t.GIT_OPT_GET_EXTENSIONS,
251 	GIT_OPT_SET_EXTENSIONS = .git_libgit2_opt_t.GIT_OPT_SET_EXTENSIONS,
252 	GIT_OPT_GET_OWNER_VALIDATION = .git_libgit2_opt_t.GIT_OPT_GET_OWNER_VALIDATION,
253 	GIT_OPT_SET_OWNER_VALIDATION = .git_libgit2_opt_t.GIT_OPT_SET_OWNER_VALIDATION,
254 	GIT_OPT_GET_HOMEDIR = .git_libgit2_opt_t.GIT_OPT_GET_HOMEDIR,
255 	GIT_OPT_SET_HOMEDIR = .git_libgit2_opt_t.GIT_OPT_SET_HOMEDIR,
256 }
257 
258 /**
259  * Set or query a library global option
260  *
261  * Available options:
262  *
263  *	* opts(GIT_OPT_GET_MWINDOW_SIZE, size_t *):
264  *
265  *		> Get the maximum mmap window size
266  *
267  *	* opts(GIT_OPT_SET_MWINDOW_SIZE, size_t):
268  *
269  *		> Set the maximum mmap window size
270  *
271  *	* opts(GIT_OPT_GET_MWINDOW_MAPPED_LIMIT, size_t *):
272  *
273  *		> Get the maximum memory that will be mapped in total by the library
274  *
275  *	* opts(GIT_OPT_SET_MWINDOW_MAPPED_LIMIT, size_t):
276  *
277  *		> Set the maximum amount of memory that can be mapped at any time
278  *		> by the library
279  *
280  *	* opts(GIT_OPT_GET_MWINDOW_FILE_LIMIT, size_t *):
281  *
282  *		> Get the maximum number of files that will be mapped at any time by the
283  *		> library
284  *
285  *	* opts(GIT_OPT_SET_MWINDOW_FILE_LIMIT, size_t):
286  *
287  *		> Set the maximum number of files that can be mapped at any time
288  *		> by the library. The default (0) is unlimited.
289  *
290  *	* opts(GIT_OPT_GET_SEARCH_PATH, int level, git_buf *buf)
291  *
292  *		> Get the search path for a given level of config data.  "level" must
293  *		> be one of `GIT_CONFIG_LEVEL_SYSTEM`, `GIT_CONFIG_LEVEL_GLOBAL`,
294  *		> `GIT_CONFIG_LEVEL_XDG`, or `GIT_CONFIG_LEVEL_PROGRAMDATA`.
295  *		> The search path is written to the `out` buffer.
296  *
297  *	* opts(GIT_OPT_SET_SEARCH_PATH, int level, const char *path)
298  *
299  *		> Set the search path for a level of config data.  The search path
300  *		> applied to shared attributes and ignore files, too.
301  *		>
302  *		> - `path` lists directories delimited by GIT_PATH_LIST_SEPARATOR.
303  *		>   Pass null to reset to the default (generally based on environment
304  *		>   variables).  Use magic path `$PATH` to include the old value
305  *		>   of the path (if you want to prepend or append, for instance).
306  *		>
307  *		> - `level` must be `GIT_CONFIG_LEVEL_SYSTEM`,
308  *		>   `GIT_CONFIG_LEVEL_GLOBAL`, `GIT_CONFIG_LEVEL_XDG`, or
309  *		>   `GIT_CONFIG_LEVEL_PROGRAMDATA`.
310  *
311  *	* opts(GIT_OPT_SET_CACHE_OBJECT_LIMIT, git_object_t type, size_t size)
312  *
313  *		> Set the maximum data size for the given type of object to be
314  *		> considered eligible for caching in memory.  Setting to value to
315  *		> zero means that that type of object will not be cached.
316  *		> Defaults to 0 for GIT_OBJECT_BLOB (i.e. won't cache blobs) and 4k
317  *		> for GIT_OBJECT_COMMIT, GIT_OBJECT_TREE, and GIT_OBJECT_TAG.
318  *
319  *	* opts(GIT_OPT_SET_CACHE_MAX_SIZE, ssize_t max_storage_bytes)
320  *
321  *		> Set the maximum total data size that will be cached in memory
322  *		> across all repositories before libgit2 starts evicting objects
323  *		> from the cache.  This is a soft limit, in that the library might
324  *		> briefly exceed it, but will start aggressively evicting objects
325  *		> from cache when that happens.  The default cache size is 256MB.
326  *
327  *	* opts(GIT_OPT_ENABLE_CACHING, int enabled)
328  *
329  *		> Enable or disable caching completely.
330  *		>
331  *		> Because caches are repository-specific, disabling the cache
332  *		> cannot immediately clear all cached objects, but each cache will
333  *		> be cleared on the next attempt to update anything in it.
334  *
335  *	* opts(GIT_OPT_GET_CACHED_MEMORY, ssize_t *current, ssize_t *allowed)
336  *
337  *		> Get the current bytes in cache and the maximum that would be
338  *		> allowed in the cache.
339  *
340  *	* opts(GIT_OPT_GET_TEMPLATE_PATH, git_buf *out)
341  *
342  *		> Get the default template path.
343  *		> The path is written to the `out` buffer.
344  *
345  *	* opts(GIT_OPT_SET_TEMPLATE_PATH, const char *path)
346  *
347  *		> Set the default template path.
348  *		>
349  *		> - `path` directory of template.
350  *
351  *	* opts(GIT_OPT_SET_SSL_CERT_LOCATIONS, const char *file, const char *path)
352  *
353  *		> Set the SSL certificate-authority locations.
354  *		>
355  *		> - `file` is the location of a file containing several
356  *		>   certificates concatenated together.
357  *		> - `path` is the location of a directory holding several
358  *		>   certificates, one per file.
359  *		>
360  * 		> Either parameter may be `null`, but not both.
361  *
362  *	* opts(GIT_OPT_SET_USER_AGENT, const char *user_agent)
363  *
364  *		> Set the value of the User-Agent header.  This value will be
365  *		> appended to "git/1.0", for compatibility with other git clients.
366  *		>
367  *		> - `user_agent` is the value that will be delivered as the
368  *		>   User-Agent header on HTTP requests.
369  *
370  *	* opts(GIT_OPT_SET_WINDOWS_SHAREMODE, core.stdc.config.c_ulong value)
371  *
372  *		> Set the share mode used when opening files on Windows.
373  *		> For more information, see the documentation for CreateFile.
374  *		> The default is: FILE_SHARE_READ | FILE_SHARE_WRITE.  This is
375  *		> ignored and unused on non-Windows platforms.
376  *
377  *	* opts(GIT_OPT_GET_WINDOWS_SHAREMODE, core.stdc.config.c_ulong *value)
378  *
379  *		> Get the share mode used when opening files on Windows.
380  *
381  *	* opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, int enabled)
382  *
383  *		> Enable strict input validation when creating new objects
384  *		> to ensure that all inputs to the new objects are valid.  For
385  *		> example, when this is enabled, the parent(s) and tree inputs
386  *		> will be validated when creating a new commit.  This defaults
387  *		> to enabled.
388  *
389  *	* opts(GIT_OPT_ENABLE_STRICT_SYMBOLIC_REF_CREATION, int enabled)
390  *
391  *		> Validate the target of a symbolic ref when creating it.  For
392  *		> example, `foobar` is not a valid ref, therefore `foobar` is
393  *		> not a valid target for a symbolic ref by default, whereas
394  *		> `refs/heads/foobar` is.  Disabling this bypasses validation
395  *		> so that an arbitrary strings such as `foobar` can be used
396  *		> for a symbolic ref target.  This defaults to enabled.
397  *
398  *	* opts(GIT_OPT_SET_SSL_CIPHERS, const char *ciphers)
399  *
400  *		> Set the SSL ciphers use for HTTPS connections.
401  *		>
402  *		> - `ciphers` is the list of ciphers that are eanbled.
403  *
404  *	* opts(GIT_OPT_GET_USER_AGENT, git_buf *out)
405  *
406  *		> Get the value of the User-Agent header.
407  *		> The User-Agent is written to the `out` buffer.
408  *
409  *	* opts(GIT_OPT_ENABLE_OFS_DELTA, int enabled)
410  *
411  *		> Enable or disable the use of "offset deltas" when creating packfiles,
412  *		> and the negotiation of them when talking to a remote server.
413  *		> Offset deltas store a delta base location as an offset into the
414  *		> packfile from the current location, which provides a shorter encoding
415  *		> and thus smaller resultant packfiles.
416  *		> Packfiles containing offset deltas can still be read.
417  *		> This defaults to enabled.
418  *
419  *	* opts(GIT_OPT_ENABLE_FSYNC_GITDIR, int enabled)
420  *
421  *		> Enable synchronized writes of files in the gitdir using `fsync`
422  *		> (or the platform equivalent) to ensure that new object data
423  *		> is written to permanent storage, not simply cached.  This
424  *		> defaults to disabled.
425  *
426  *	 opts(GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION, int enabled)
427  *
428  *		> Enable strict verification of object hashsums when reading
429  *		> objects from disk. This may impact performance due to an
430  *		> additional checksum calculation on each object. This defaults
431  *		> to enabled.
432  *
433  *	 opts(GIT_OPT_SET_ALLOCATOR, git_allocator *allocator)
434  *
435  *		> Set the memory allocator to a different memory allocator. This
436  *		> allocator will then be used to make all memory allocations for
437  *		> libgit2 operations.  If the given `allocator` is null, then the
438  *		> system default will be restored.
439  *
440  *	 opts(GIT_OPT_ENABLE_UNSAVED_INDEX_SAFETY, int enabled)
441  *
442  *		> Ensure that there are no unsaved changes in the index before
443  *		> beginning any operation that reloads the index from disk (eg,
444  *		> checkout).  If there are unsaved changes, the instruction will
445  *		> fail.  (Using the FORCE flag to checkout will still overwrite
446  *		> these changes.)
447  *
448  *	 opts(GIT_OPT_GET_PACK_MAX_OBJECTS, size_t *out)
449  *
450  *		> Get the maximum number of objects libgit2 will allow in a pack
451  *		> file when downloading a pack file from a remote. This can be
452  *		> used to limit maximum memory usage when fetching from an untrusted
453  *		> remote.
454  *
455  *	 opts(GIT_OPT_SET_PACK_MAX_OBJECTS, size_t objects)
456  *
457  *		> Set the maximum number of objects libgit2 will allow in a pack
458  *		> file when downloading a pack file from a remote.
459  *
460  *	 opts(GIT_OPT_DISABLE_PACK_KEEP_FILE_CHECKS, int enabled)
461  *		> This will cause .keep file existence checks to be skipped when
462  *		> accessing packfiles, which can help performance with remote filesystems.
463  *
464  *	 opts(GIT_OPT_ENABLE_HTTP_EXPECT_CONTINUE, int enabled)
465  *		> When connecting to a server using NTLM or Negotiate
466  *		> authentication, use expect/continue when POSTing data.
467  *		> This option is not available on Windows.
468  *
469  *   opts(GIT_OPT_SET_ODB_PACKED_PRIORITY, int priority)
470  *      > Override the default priority of the packed ODB backend which
471  *      > is added when default backends are assigned to a repository
472  *
473  *   opts(GIT_OPT_SET_ODB_LOOSE_PRIORITY, int priority)
474  *      > Override the default priority of the loose ODB backend which
475  *      > is added when default backends are assigned to a repository
476  *
477  *   opts(GIT_OPT_GET_EXTENSIONS, git_strarray* out)
478  *      > Returns the list of git extensions that are supported.  This
479  *      > is the list of built-in extensions supported by libgit2 and
480  *      > custom extensions that have been added with
481  *      > `GIT_OPT_SET_EXTENSIONS`.  Extensions that have been negated
482  *      > will not be returned.  The returned list should be released
483  *      > with `git_strarray_dispose`.
484  *
485  *   opts(GIT_OPT_SET_EXTENSIONS, const (char)** extensions, size_t len)
486  *      > Set that the given git extensions are supported by the caller.
487  *      > Extensions supported by libgit2 may be negated by prefixing
488  *      > them with a `!`.  For example: setting extensions to
489  *      > { "!noop", "newext" } indicates that the caller does not want
490  *      > to support repositories with the `noop` extension but does want
491  *      > to support repositories with the `newext` extension.
492  *
493  *   opts(GIT_OPT_GET_OWNER_VALIDATION, int* enabled)
494  *      > Gets the owner validation setting for repository
495  *      > directories.
496  *
497  *   opts(GIT_OPT_SET_OWNER_VALIDATION, int enabled)
498  *      > Set that repository directories should be owned by the current
499  *      > user. The default is to validate ownership.
500  *
501  *   opts(GIT_OPT_GET_HOMEDIR, git_buf* out)
502  *      > Gets the current user's home directory, as it will be used
503  *      > for file lookups. The path is written to the `out` buffer.
504  *
505  *   opts(GIT_OPT_SET_HOMEDIR, const (char)* path)
506  *      > Sets the directory used as the current user's home directory,
507  *      > for file lookups.
508  *      >
509  *      > - `path` directory of home directory.
510  *
511  * Params:
512  *      option = Option key
513  *      ... = value to set the option
514  *
515  * Returns: 0 on success, <0 on failure
516  */
517 @GIT_EXTERN
518 int git_libgit2_opts(int option, ...);
519 
520 /* @} */