Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/smanonr..../opt/imh-pyth.../include/git2
File: odb.h
/*
[0] Fix | Delete
* Copyright (C) the libgit2 contributors. All rights reserved.
[1] Fix | Delete
*
[2] Fix | Delete
* This file is part of libgit2, distributed under the GNU GPL v2 with
[3] Fix | Delete
* a Linking Exception. For full terms see the included COPYING file.
[4] Fix | Delete
*/
[5] Fix | Delete
#ifndef INCLUDE_git_odb_h__
[6] Fix | Delete
#define INCLUDE_git_odb_h__
[7] Fix | Delete
[8] Fix | Delete
#include "common.h"
[9] Fix | Delete
#include "types.h"
[10] Fix | Delete
#include "oid.h"
[11] Fix | Delete
#include "oidarray.h"
[12] Fix | Delete
#include "indexer.h"
[13] Fix | Delete
[14] Fix | Delete
/**
[15] Fix | Delete
* @file git2/odb.h
[16] Fix | Delete
* @brief Git object database routines
[17] Fix | Delete
* @defgroup git_odb Git object database routines
[18] Fix | Delete
* @ingroup Git
[19] Fix | Delete
* @{
[20] Fix | Delete
*/
[21] Fix | Delete
GIT_BEGIN_DECL
[22] Fix | Delete
[23] Fix | Delete
/**
[24] Fix | Delete
* Function type for callbacks from git_odb_foreach.
[25] Fix | Delete
*/
[26] Fix | Delete
typedef int GIT_CALLBACK(git_odb_foreach_cb)(const git_oid *id, void *payload);
[27] Fix | Delete
[28] Fix | Delete
/**
[29] Fix | Delete
* Create a new object database with no backends.
[30] Fix | Delete
*
[31] Fix | Delete
* Before the ODB can be used for read/writing, a custom database
[32] Fix | Delete
* backend must be manually added using `git_odb_add_backend()`
[33] Fix | Delete
*
[34] Fix | Delete
* @param out location to store the database pointer, if opened.
[35] Fix | Delete
* Set to NULL if the open failed.
[36] Fix | Delete
* @return 0 or an error code
[37] Fix | Delete
*/
[38] Fix | Delete
GIT_EXTERN(int) git_odb_new(git_odb **out);
[39] Fix | Delete
[40] Fix | Delete
/**
[41] Fix | Delete
* Create a new object database and automatically add
[42] Fix | Delete
* the two default backends:
[43] Fix | Delete
*
[44] Fix | Delete
* - git_odb_backend_loose: read and write loose object files
[45] Fix | Delete
* from disk, assuming `objects_dir` as the Objects folder
[46] Fix | Delete
*
[47] Fix | Delete
* - git_odb_backend_pack: read objects from packfiles,
[48] Fix | Delete
* assuming `objects_dir` as the Objects folder which
[49] Fix | Delete
* contains a 'pack/' folder with the corresponding data
[50] Fix | Delete
*
[51] Fix | Delete
* @param out location to store the database pointer, if opened.
[52] Fix | Delete
* Set to NULL if the open failed.
[53] Fix | Delete
* @param objects_dir path of the backends' "objects" directory.
[54] Fix | Delete
* @return 0 or an error code
[55] Fix | Delete
*/
[56] Fix | Delete
GIT_EXTERN(int) git_odb_open(git_odb **out, const char *objects_dir);
[57] Fix | Delete
[58] Fix | Delete
/**
[59] Fix | Delete
* Add an on-disk alternate to an existing Object DB.
[60] Fix | Delete
*
[61] Fix | Delete
* Note that the added path must point to an `objects`, not
[62] Fix | Delete
* to a full repository, to use it as an alternate store.
[63] Fix | Delete
*
[64] Fix | Delete
* Alternate backends are always checked for objects *after*
[65] Fix | Delete
* all the main backends have been exhausted.
[66] Fix | Delete
*
[67] Fix | Delete
* Writing is disabled on alternate backends.
[68] Fix | Delete
*
[69] Fix | Delete
* @param odb database to add the backend to
[70] Fix | Delete
* @param path path to the objects folder for the alternate
[71] Fix | Delete
* @return 0 on success; error code otherwise
[72] Fix | Delete
*/
[73] Fix | Delete
GIT_EXTERN(int) git_odb_add_disk_alternate(git_odb *odb, const char *path);
[74] Fix | Delete
[75] Fix | Delete
/**
[76] Fix | Delete
* Close an open object database.
[77] Fix | Delete
*
[78] Fix | Delete
* @param db database pointer to close. If NULL no action is taken.
[79] Fix | Delete
*/
[80] Fix | Delete
GIT_EXTERN(void) git_odb_free(git_odb *db);
[81] Fix | Delete
[82] Fix | Delete
/**
[83] Fix | Delete
* Read an object from the database.
[84] Fix | Delete
*
[85] Fix | Delete
* This method queries all available ODB backends
[86] Fix | Delete
* trying to read the given OID.
[87] Fix | Delete
*
[88] Fix | Delete
* The returned object is reference counted and
[89] Fix | Delete
* internally cached, so it should be closed
[90] Fix | Delete
* by the user once it's no longer in use.
[91] Fix | Delete
*
[92] Fix | Delete
* @param out pointer where to store the read object
[93] Fix | Delete
* @param db database to search for the object in.
[94] Fix | Delete
* @param id identity of the object to read.
[95] Fix | Delete
* @return
[96] Fix | Delete
* - 0 if the object was read;
[97] Fix | Delete
* - GIT_ENOTFOUND if the object is not in the database.
[98] Fix | Delete
*/
[99] Fix | Delete
GIT_EXTERN(int) git_odb_read(git_odb_object **out, git_odb *db, const git_oid *id);
[100] Fix | Delete
[101] Fix | Delete
/**
[102] Fix | Delete
* Read an object from the database, given a prefix
[103] Fix | Delete
* of its identifier.
[104] Fix | Delete
*
[105] Fix | Delete
* This method queries all available ODB backends
[106] Fix | Delete
* trying to match the 'len' first hexadecimal
[107] Fix | Delete
* characters of the 'short_id'.
[108] Fix | Delete
* The remaining (GIT_OID_HEXSZ-len)*4 bits of
[109] Fix | Delete
* 'short_id' must be 0s.
[110] Fix | Delete
* 'len' must be at least GIT_OID_MINPREFIXLEN,
[111] Fix | Delete
* and the prefix must be long enough to identify
[112] Fix | Delete
* a unique object in all the backends; the
[113] Fix | Delete
* method will fail otherwise.
[114] Fix | Delete
*
[115] Fix | Delete
* The returned object is reference counted and
[116] Fix | Delete
* internally cached, so it should be closed
[117] Fix | Delete
* by the user once it's no longer in use.
[118] Fix | Delete
*
[119] Fix | Delete
* @param out pointer where to store the read object
[120] Fix | Delete
* @param db database to search for the object in.
[121] Fix | Delete
* @param short_id a prefix of the id of the object to read.
[122] Fix | Delete
* @param len the length of the prefix
[123] Fix | Delete
* @return
[124] Fix | Delete
* - 0 if the object was read;
[125] Fix | Delete
* - GIT_ENOTFOUND if the object is not in the database.
[126] Fix | Delete
* - GIT_EAMBIGUOUS if the prefix is ambiguous (several objects match the prefix)
[127] Fix | Delete
*/
[128] Fix | Delete
GIT_EXTERN(int) git_odb_read_prefix(git_odb_object **out, git_odb *db, const git_oid *short_id, size_t len);
[129] Fix | Delete
[130] Fix | Delete
/**
[131] Fix | Delete
* Read the header of an object from the database, without
[132] Fix | Delete
* reading its full contents.
[133] Fix | Delete
*
[134] Fix | Delete
* The header includes the length and the type of an object.
[135] Fix | Delete
*
[136] Fix | Delete
* Note that most backends do not support reading only the header
[137] Fix | Delete
* of an object, so the whole object will be read and then the
[138] Fix | Delete
* header will be returned.
[139] Fix | Delete
*
[140] Fix | Delete
* @param len_out pointer where to store the length
[141] Fix | Delete
* @param type_out pointer where to store the type
[142] Fix | Delete
* @param db database to search for the object in.
[143] Fix | Delete
* @param id identity of the object to read.
[144] Fix | Delete
* @return
[145] Fix | Delete
* - 0 if the object was read;
[146] Fix | Delete
* - GIT_ENOTFOUND if the object is not in the database.
[147] Fix | Delete
*/
[148] Fix | Delete
GIT_EXTERN(int) git_odb_read_header(size_t *len_out, git_object_t *type_out, git_odb *db, const git_oid *id);
[149] Fix | Delete
[150] Fix | Delete
/**
[151] Fix | Delete
* Determine if the given object can be found in the object database.
[152] Fix | Delete
*
[153] Fix | Delete
* @param db database to be searched for the given object.
[154] Fix | Delete
* @param id the object to search for.
[155] Fix | Delete
* @return
[156] Fix | Delete
* - 1, if the object was found
[157] Fix | Delete
* - 0, otherwise
[158] Fix | Delete
*/
[159] Fix | Delete
GIT_EXTERN(int) git_odb_exists(git_odb *db, const git_oid *id);
[160] Fix | Delete
[161] Fix | Delete
/**
[162] Fix | Delete
* Determine if an object can be found in the object database by an
[163] Fix | Delete
* abbreviated object ID.
[164] Fix | Delete
*
[165] Fix | Delete
* @param out The full OID of the found object if just one is found.
[166] Fix | Delete
* @param db The database to be searched for the given object.
[167] Fix | Delete
* @param short_id A prefix of the id of the object to read.
[168] Fix | Delete
* @param len The length of the prefix.
[169] Fix | Delete
* @return 0 if found, GIT_ENOTFOUND if not found, GIT_EAMBIGUOUS if multiple
[170] Fix | Delete
* matches were found, other value < 0 if there was a read error.
[171] Fix | Delete
*/
[172] Fix | Delete
GIT_EXTERN(int) git_odb_exists_prefix(
[173] Fix | Delete
git_oid *out, git_odb *db, const git_oid *short_id, size_t len);
[174] Fix | Delete
[175] Fix | Delete
/**
[176] Fix | Delete
* The information about object IDs to query in `git_odb_expand_ids`,
[177] Fix | Delete
* which will be populated upon return.
[178] Fix | Delete
*/
[179] Fix | Delete
typedef struct git_odb_expand_id {
[180] Fix | Delete
/** The object ID to expand */
[181] Fix | Delete
git_oid id;
[182] Fix | Delete
[183] Fix | Delete
/**
[184] Fix | Delete
* The length of the object ID (in nibbles, or packets of 4 bits; the
[185] Fix | Delete
* number of hex characters)
[186] Fix | Delete
* */
[187] Fix | Delete
unsigned short length;
[188] Fix | Delete
[189] Fix | Delete
/**
[190] Fix | Delete
* The (optional) type of the object to search for; leave as `0` or set
[191] Fix | Delete
* to `GIT_OBJECT_ANY` to query for any object matching the ID.
[192] Fix | Delete
*/
[193] Fix | Delete
git_object_t type;
[194] Fix | Delete
} git_odb_expand_id;
[195] Fix | Delete
[196] Fix | Delete
/**
[197] Fix | Delete
* Determine if one or more objects can be found in the object database
[198] Fix | Delete
* by their abbreviated object ID and type. The given array will be
[199] Fix | Delete
* updated in place: for each abbreviated ID that is unique in the
[200] Fix | Delete
* database, and of the given type (if specified), the full object ID,
[201] Fix | Delete
* object ID length (`GIT_OID_HEXSZ`) and type will be written back to
[202] Fix | Delete
* the array. For IDs that are not found (or are ambiguous), the
[203] Fix | Delete
* array entry will be zeroed.
[204] Fix | Delete
*
[205] Fix | Delete
* Note that since this function operates on multiple objects, the
[206] Fix | Delete
* underlying database will not be asked to be reloaded if an object is
[207] Fix | Delete
* not found (which is unlike other object database operations.)
[208] Fix | Delete
*
[209] Fix | Delete
* @param db The database to be searched for the given objects.
[210] Fix | Delete
* @param ids An array of short object IDs to search for
[211] Fix | Delete
* @param count The length of the `ids` array
[212] Fix | Delete
* @return 0 on success or an error code on failure
[213] Fix | Delete
*/
[214] Fix | Delete
GIT_EXTERN(int) git_odb_expand_ids(
[215] Fix | Delete
git_odb *db,
[216] Fix | Delete
git_odb_expand_id *ids,
[217] Fix | Delete
size_t count);
[218] Fix | Delete
[219] Fix | Delete
/**
[220] Fix | Delete
* Refresh the object database to load newly added files.
[221] Fix | Delete
*
[222] Fix | Delete
* If the object databases have changed on disk while the library
[223] Fix | Delete
* is running, this function will force a reload of the underlying
[224] Fix | Delete
* indexes.
[225] Fix | Delete
*
[226] Fix | Delete
* Use this function when you're confident that an external
[227] Fix | Delete
* application has tampered with the ODB.
[228] Fix | Delete
*
[229] Fix | Delete
* NOTE that it is not necessary to call this function at all. The
[230] Fix | Delete
* library will automatically attempt to refresh the ODB
[231] Fix | Delete
* when a lookup fails, to see if the looked up object exists
[232] Fix | Delete
* on disk but hasn't been loaded yet.
[233] Fix | Delete
*
[234] Fix | Delete
* @param db database to refresh
[235] Fix | Delete
* @return 0 on success, error code otherwise
[236] Fix | Delete
*/
[237] Fix | Delete
GIT_EXTERN(int) git_odb_refresh(struct git_odb *db);
[238] Fix | Delete
[239] Fix | Delete
/**
[240] Fix | Delete
* List all objects available in the database
[241] Fix | Delete
*
[242] Fix | Delete
* The callback will be called for each object available in the
[243] Fix | Delete
* database. Note that the objects are likely to be returned in the index
[244] Fix | Delete
* order, which would make accessing the objects in that order inefficient.
[245] Fix | Delete
* Return a non-zero value from the callback to stop looping.
[246] Fix | Delete
*
[247] Fix | Delete
* @param db database to use
[248] Fix | Delete
* @param cb the callback to call for each object
[249] Fix | Delete
* @param payload data to pass to the callback
[250] Fix | Delete
* @return 0 on success, non-zero callback return value, or error code
[251] Fix | Delete
*/
[252] Fix | Delete
GIT_EXTERN(int) git_odb_foreach(git_odb *db, git_odb_foreach_cb cb, void *payload);
[253] Fix | Delete
[254] Fix | Delete
/**
[255] Fix | Delete
* Write an object directly into the ODB
[256] Fix | Delete
*
[257] Fix | Delete
* This method writes a full object straight into the ODB.
[258] Fix | Delete
* For most cases, it is preferred to write objects through a write
[259] Fix | Delete
* stream, which is both faster and less memory intensive, specially
[260] Fix | Delete
* for big objects.
[261] Fix | Delete
*
[262] Fix | Delete
* This method is provided for compatibility with custom backends
[263] Fix | Delete
* which are not able to support streaming writes
[264] Fix | Delete
*
[265] Fix | Delete
* @param out pointer to store the OID result of the write
[266] Fix | Delete
* @param odb object database where to store the object
[267] Fix | Delete
* @param data buffer with the data to store
[268] Fix | Delete
* @param len size of the buffer
[269] Fix | Delete
* @param type type of the data to store
[270] Fix | Delete
* @return 0 or an error code
[271] Fix | Delete
*/
[272] Fix | Delete
GIT_EXTERN(int) git_odb_write(git_oid *out, git_odb *odb, const void *data, size_t len, git_object_t type);
[273] Fix | Delete
[274] Fix | Delete
/**
[275] Fix | Delete
* Open a stream to write an object into the ODB
[276] Fix | Delete
*
[277] Fix | Delete
* The type and final length of the object must be specified
[278] Fix | Delete
* when opening the stream.
[279] Fix | Delete
*
[280] Fix | Delete
* The returned stream will be of type `GIT_STREAM_WRONLY`, and it
[281] Fix | Delete
* won't be effective until `git_odb_stream_finalize_write` is called
[282] Fix | Delete
* and returns without an error
[283] Fix | Delete
*
[284] Fix | Delete
* The stream must always be freed when done with `git_odb_stream_free` or
[285] Fix | Delete
* will leak memory.
[286] Fix | Delete
*
[287] Fix | Delete
* @see git_odb_stream
[288] Fix | Delete
*
[289] Fix | Delete
* @param out pointer where to store the stream
[290] Fix | Delete
* @param db object database where the stream will write
[291] Fix | Delete
* @param size final size of the object that will be written
[292] Fix | Delete
* @param type type of the object that will be written
[293] Fix | Delete
* @return 0 if the stream was created; error code otherwise
[294] Fix | Delete
*/
[295] Fix | Delete
GIT_EXTERN(int) git_odb_open_wstream(git_odb_stream **out, git_odb *db, git_object_size_t size, git_object_t type);
[296] Fix | Delete
[297] Fix | Delete
/**
[298] Fix | Delete
* Write to an odb stream
[299] Fix | Delete
*
[300] Fix | Delete
* This method will fail if the total number of received bytes exceeds the
[301] Fix | Delete
* size declared with `git_odb_open_wstream()`
[302] Fix | Delete
*
[303] Fix | Delete
* @param stream the stream
[304] Fix | Delete
* @param buffer the data to write
[305] Fix | Delete
* @param len the buffer's length
[306] Fix | Delete
* @return 0 if the write succeeded; error code otherwise
[307] Fix | Delete
*/
[308] Fix | Delete
GIT_EXTERN(int) git_odb_stream_write(git_odb_stream *stream, const char *buffer, size_t len);
[309] Fix | Delete
[310] Fix | Delete
/**
[311] Fix | Delete
* Finish writing to an odb stream
[312] Fix | Delete
*
[313] Fix | Delete
* The object will take its final name and will be available to the
[314] Fix | Delete
* odb.
[315] Fix | Delete
*
[316] Fix | Delete
* This method will fail if the total number of received bytes
[317] Fix | Delete
* differs from the size declared with `git_odb_open_wstream()`
[318] Fix | Delete
*
[319] Fix | Delete
* @param out pointer to store the resulting object's id
[320] Fix | Delete
* @param stream the stream
[321] Fix | Delete
* @return 0 on success; an error code otherwise
[322] Fix | Delete
*/
[323] Fix | Delete
GIT_EXTERN(int) git_odb_stream_finalize_write(git_oid *out, git_odb_stream *stream);
[324] Fix | Delete
[325] Fix | Delete
/**
[326] Fix | Delete
* Read from an odb stream
[327] Fix | Delete
*
[328] Fix | Delete
* Most backends don't implement streaming reads
[329] Fix | Delete
*/
[330] Fix | Delete
GIT_EXTERN(int) git_odb_stream_read(git_odb_stream *stream, char *buffer, size_t len);
[331] Fix | Delete
[332] Fix | Delete
/**
[333] Fix | Delete
* Free an odb stream
[334] Fix | Delete
*
[335] Fix | Delete
* @param stream the stream to free
[336] Fix | Delete
*/
[337] Fix | Delete
GIT_EXTERN(void) git_odb_stream_free(git_odb_stream *stream);
[338] Fix | Delete
[339] Fix | Delete
/**
[340] Fix | Delete
* Open a stream to read an object from the ODB
[341] Fix | Delete
*
[342] Fix | Delete
* Note that most backends do *not* support streaming reads
[343] Fix | Delete
* because they store their objects as compressed/delta'ed blobs.
[344] Fix | Delete
*
[345] Fix | Delete
* It's recommended to use `git_odb_read` instead, which is
[346] Fix | Delete
* assured to work on all backends.
[347] Fix | Delete
*
[348] Fix | Delete
* The returned stream will be of type `GIT_STREAM_RDONLY` and
[349] Fix | Delete
* will have the following methods:
[350] Fix | Delete
*
[351] Fix | Delete
* - stream->read: read `n` bytes from the stream
[352] Fix | Delete
* - stream->free: free the stream
[353] Fix | Delete
*
[354] Fix | Delete
* The stream must always be free'd or will leak memory.
[355] Fix | Delete
*
[356] Fix | Delete
* @see git_odb_stream
[357] Fix | Delete
*
[358] Fix | Delete
* @param out pointer where to store the stream
[359] Fix | Delete
* @param len pointer where to store the length of the object
[360] Fix | Delete
* @param type pointer where to store the type of the object
[361] Fix | Delete
* @param db object database where the stream will read from
[362] Fix | Delete
* @param oid oid of the object the stream will read from
[363] Fix | Delete
* @return 0 if the stream was created; error code otherwise
[364] Fix | Delete
*/
[365] Fix | Delete
GIT_EXTERN(int) git_odb_open_rstream(
[366] Fix | Delete
git_odb_stream **out,
[367] Fix | Delete
size_t *len,
[368] Fix | Delete
git_object_t *type,
[369] Fix | Delete
git_odb *db,
[370] Fix | Delete
const git_oid *oid);
[371] Fix | Delete
[372] Fix | Delete
/**
[373] Fix | Delete
* Open a stream for writing a pack file to the ODB.
[374] Fix | Delete
*
[375] Fix | Delete
* If the ODB layer understands pack files, then the given
[376] Fix | Delete
* packfile will likely be streamed directly to disk (and a
[377] Fix | Delete
* corresponding index created). If the ODB layer does not
[378] Fix | Delete
* understand pack files, the objects will be stored in whatever
[379] Fix | Delete
* format the ODB layer uses.
[380] Fix | Delete
*
[381] Fix | Delete
* @see git_odb_writepack
[382] Fix | Delete
*
[383] Fix | Delete
* @param out pointer to the writepack functions
[384] Fix | Delete
* @param db object database where the stream will read from
[385] Fix | Delete
* @param progress_cb function to call with progress information.
[386] Fix | Delete
* Be aware that this is called inline with network and indexing operations,
[387] Fix | Delete
* so performance may be affected.
[388] Fix | Delete
* @param progress_payload payload for the progress callback
[389] Fix | Delete
*/
[390] Fix | Delete
GIT_EXTERN(int) git_odb_write_pack(
[391] Fix | Delete
git_odb_writepack **out,
[392] Fix | Delete
git_odb *db,
[393] Fix | Delete
git_indexer_progress_cb progress_cb,
[394] Fix | Delete
void *progress_payload);
[395] Fix | Delete
[396] Fix | Delete
/**
[397] Fix | Delete
* Determine the object-ID (sha1 hash) of a data buffer
[398] Fix | Delete
*
[399] Fix | Delete
* The resulting SHA-1 OID will be the identifier for the data
[400] Fix | Delete
* buffer as if the data buffer it were to written to the ODB.
[401] Fix | Delete
*
[402] Fix | Delete
* @param out the resulting object-ID.
[403] Fix | Delete
* @param data data to hash
[404] Fix | Delete
* @param len size of the data
[405] Fix | Delete
* @param type of the data to hash
[406] Fix | Delete
* @return 0 or an error code
[407] Fix | Delete
*/
[408] Fix | Delete
GIT_EXTERN(int) git_odb_hash(git_oid *out, const void *data, size_t len, git_object_t type);
[409] Fix | Delete
[410] Fix | Delete
/**
[411] Fix | Delete
* Read a file from disk and fill a git_oid with the object id
[412] Fix | Delete
* that the file would have if it were written to the Object
[413] Fix | Delete
* Database as an object of the given type (w/o applying filters).
[414] Fix | Delete
* Similar functionality to git.git's `git hash-object` without
[415] Fix | Delete
* the `-w` flag, however, with the --no-filters flag.
[416] Fix | Delete
* If you need filters, see git_repository_hashfile.
[417] Fix | Delete
*
[418] Fix | Delete
* @param out oid structure the result is written into.
[419] Fix | Delete
* @param path file to read and determine object id for
[420] Fix | Delete
* @param type the type of the object that will be hashed
[421] Fix | Delete
* @return 0 or an error code
[422] Fix | Delete
*/
[423] Fix | Delete
GIT_EXTERN(int) git_odb_hashfile(git_oid *out, const char *path, git_object_t type);
[424] Fix | Delete
[425] Fix | Delete
/**
[426] Fix | Delete
* Create a copy of an odb_object
[427] Fix | Delete
*
[428] Fix | Delete
* The returned copy must be manually freed with `git_odb_object_free`.
[429] Fix | Delete
* Note that because of an implementation detail, the returned copy will be
[430] Fix | Delete
* the same pointer as `source`: the object is internally refcounted, so the
[431] Fix | Delete
* copy still needs to be freed twice.
[432] Fix | Delete
*
[433] Fix | Delete
* @param dest pointer where to store the copy
[434] Fix | Delete
* @param source object to copy
[435] Fix | Delete
* @return 0 or an error code
[436] Fix | Delete
*/
[437] Fix | Delete
GIT_EXTERN(int) git_odb_object_dup(git_odb_object **dest, git_odb_object *source);
[438] Fix | Delete
[439] Fix | Delete
/**
[440] Fix | Delete
* Close an ODB object
[441] Fix | Delete
*
[442] Fix | Delete
* This method must always be called once a `git_odb_object` is no
[443] Fix | Delete
* longer needed, otherwise memory will leak.
[444] Fix | Delete
*
[445] Fix | Delete
* @param object object to close
[446] Fix | Delete
*/
[447] Fix | Delete
GIT_EXTERN(void) git_odb_object_free(git_odb_object *object);
[448] Fix | Delete
[449] Fix | Delete
/**
[450] Fix | Delete
* Return the OID of an ODB object
[451] Fix | Delete
*
[452] Fix | Delete
* This is the OID from which the object was read from
[453] Fix | Delete
*
[454] Fix | Delete
* @param object the object
[455] Fix | Delete
* @return a pointer to the OID
[456] Fix | Delete
*/
[457] Fix | Delete
GIT_EXTERN(const git_oid *) git_odb_object_id(git_odb_object *object);
[458] Fix | Delete
[459] Fix | Delete
/**
[460] Fix | Delete
* Return the data of an ODB object
[461] Fix | Delete
*
[462] Fix | Delete
* This is the uncompressed, raw data as read from the ODB,
[463] Fix | Delete
* without the leading header.
[464] Fix | Delete
*
[465] Fix | Delete
* This pointer is owned by the object and shall not be free'd.
[466] Fix | Delete
*
[467] Fix | Delete
* @param object the object
[468] Fix | Delete
* @return a pointer to the data
[469] Fix | Delete
*/
[470] Fix | Delete
GIT_EXTERN(const void *) git_odb_object_data(git_odb_object *object);
[471] Fix | Delete
[472] Fix | Delete
/**
[473] Fix | Delete
* Return the size of an ODB object
[474] Fix | Delete
*
[475] Fix | Delete
* This is the real size of the `data` buffer, not the
[476] Fix | Delete
* actual size of the object.
[477] Fix | Delete
*
[478] Fix | Delete
* @param object the object
[479] Fix | Delete
* @return the size
[480] Fix | Delete
*/
[481] Fix | Delete
GIT_EXTERN(size_t) git_odb_object_size(git_odb_object *object);
[482] Fix | Delete
[483] Fix | Delete
/**
[484] Fix | Delete
* Return the type of an ODB object
[485] Fix | Delete
*
[486] Fix | Delete
* @param object the object
[487] Fix | Delete
* @return the type
[488] Fix | Delete
*/
[489] Fix | Delete
GIT_EXTERN(git_object_t) git_odb_object_type(git_odb_object *object);
[490] Fix | Delete
[491] Fix | Delete
/**
[492] Fix | Delete
* Add a custom backend to an existing Object DB
[493] Fix | Delete
*
[494] Fix | Delete
* The backends are checked in relative ordering, based on the
[495] Fix | Delete
* value of the `priority` parameter.
[496] Fix | Delete
*
[497] Fix | Delete
* Read <sys/odb_backend.h> for more information.
[498] Fix | Delete
*
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function