Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../opt/imh-pyth.../include/git2
File: indexer.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_indexer_h__
[6] Fix | Delete
#define _INCLUDE_git_indexer_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
[12] Fix | Delete
GIT_BEGIN_DECL
[13] Fix | Delete
[14] Fix | Delete
/** A git indexer object */
[15] Fix | Delete
typedef struct git_indexer git_indexer;
[16] Fix | Delete
[17] Fix | Delete
/**
[18] Fix | Delete
* This structure is used to provide callers information about the
[19] Fix | Delete
* progress of indexing a packfile, either directly or part of a
[20] Fix | Delete
* fetch or clone that downloads a packfile.
[21] Fix | Delete
*/
[22] Fix | Delete
typedef struct git_indexer_progress {
[23] Fix | Delete
/** number of objects in the packfile being indexed */
[24] Fix | Delete
unsigned int total_objects;
[25] Fix | Delete
[26] Fix | Delete
/** received objects that have been hashed */
[27] Fix | Delete
unsigned int indexed_objects;
[28] Fix | Delete
[29] Fix | Delete
/** received_objects: objects which have been downloaded */
[30] Fix | Delete
unsigned int received_objects;
[31] Fix | Delete
[32] Fix | Delete
/**
[33] Fix | Delete
* locally-available objects that have been injected in order
[34] Fix | Delete
* to fix a thin pack
[35] Fix | Delete
*/
[36] Fix | Delete
unsigned int local_objects;
[37] Fix | Delete
[38] Fix | Delete
/** number of deltas in the packfile being indexed */
[39] Fix | Delete
unsigned int total_deltas;
[40] Fix | Delete
[41] Fix | Delete
/** received deltas that have been indexed */
[42] Fix | Delete
unsigned int indexed_deltas;
[43] Fix | Delete
[44] Fix | Delete
/** size of the packfile received up to now */
[45] Fix | Delete
size_t received_bytes;
[46] Fix | Delete
} git_indexer_progress;
[47] Fix | Delete
[48] Fix | Delete
/**
[49] Fix | Delete
* Type for progress callbacks during indexing. Return a value less
[50] Fix | Delete
* than zero to cancel the indexing or download.
[51] Fix | Delete
*
[52] Fix | Delete
* @param stats Structure containing information about the state of the tran sfer
[53] Fix | Delete
* @param payload Payload provided by caller
[54] Fix | Delete
*/
[55] Fix | Delete
typedef int GIT_CALLBACK(git_indexer_progress_cb)(const git_indexer_progress *stats, void *payload);
[56] Fix | Delete
[57] Fix | Delete
/**
[58] Fix | Delete
* Options for indexer configuration
[59] Fix | Delete
*/
[60] Fix | Delete
typedef struct git_indexer_options {
[61] Fix | Delete
unsigned int version;
[62] Fix | Delete
[63] Fix | Delete
/** progress_cb function to call with progress information */
[64] Fix | Delete
git_indexer_progress_cb progress_cb;
[65] Fix | Delete
/** progress_cb_payload payload for the progress callback */
[66] Fix | Delete
void *progress_cb_payload;
[67] Fix | Delete
[68] Fix | Delete
/** Do connectivity checks for the received pack */
[69] Fix | Delete
unsigned char verify;
[70] Fix | Delete
} git_indexer_options;
[71] Fix | Delete
[72] Fix | Delete
#define GIT_INDEXER_OPTIONS_VERSION 1
[73] Fix | Delete
#define GIT_INDEXER_OPTIONS_INIT { GIT_INDEXER_OPTIONS_VERSION }
[74] Fix | Delete
[75] Fix | Delete
/**
[76] Fix | Delete
* Initializes a `git_indexer_options` with default values. Equivalent to
[77] Fix | Delete
* creating an instance with GIT_INDEXER_OPTIONS_INIT.
[78] Fix | Delete
*
[79] Fix | Delete
* @param opts the `git_indexer_options` struct to initialize.
[80] Fix | Delete
* @param version Version of struct; pass `GIT_INDEXER_OPTIONS_VERSION`
[81] Fix | Delete
* @return Zero on success; -1 on failure.
[82] Fix | Delete
*/
[83] Fix | Delete
GIT_EXTERN(int) git_indexer_options_init(
[84] Fix | Delete
git_indexer_options *opts,
[85] Fix | Delete
unsigned int version);
[86] Fix | Delete
[87] Fix | Delete
/**
[88] Fix | Delete
* Create a new indexer instance
[89] Fix | Delete
*
[90] Fix | Delete
* @param out where to store the indexer instance
[91] Fix | Delete
* @param path to the directory where the packfile should be stored
[92] Fix | Delete
* @param mode permissions to use creating packfile or 0 for defaults
[93] Fix | Delete
* @param odb object database from which to read base objects when
[94] Fix | Delete
* fixing thin packs. Pass NULL if no thin pack is expected (an error
[95] Fix | Delete
* will be returned if there are bases missing)
[96] Fix | Delete
* @param opts Optional structure containing additional options. See
[97] Fix | Delete
* `git_indexer_options` above.
[98] Fix | Delete
*/
[99] Fix | Delete
GIT_EXTERN(int) git_indexer_new(
[100] Fix | Delete
git_indexer **out,
[101] Fix | Delete
const char *path,
[102] Fix | Delete
unsigned int mode,
[103] Fix | Delete
git_odb *odb,
[104] Fix | Delete
git_indexer_options *opts);
[105] Fix | Delete
[106] Fix | Delete
/**
[107] Fix | Delete
* Add data to the indexer
[108] Fix | Delete
*
[109] Fix | Delete
* @param idx the indexer
[110] Fix | Delete
* @param data the data to add
[111] Fix | Delete
* @param size the size of the data in bytes
[112] Fix | Delete
* @param stats stat storage
[113] Fix | Delete
*/
[114] Fix | Delete
GIT_EXTERN(int) git_indexer_append(git_indexer *idx, const void *data, size_t size, git_indexer_progress *stats);
[115] Fix | Delete
[116] Fix | Delete
/**
[117] Fix | Delete
* Finalize the pack and index
[118] Fix | Delete
*
[119] Fix | Delete
* Resolve any pending deltas and write out the index file
[120] Fix | Delete
*
[121] Fix | Delete
* @param idx the indexer
[122] Fix | Delete
*/
[123] Fix | Delete
GIT_EXTERN(int) git_indexer_commit(git_indexer *idx, git_indexer_progress *stats);
[124] Fix | Delete
[125] Fix | Delete
/**
[126] Fix | Delete
* Get the packfile's hash
[127] Fix | Delete
*
[128] Fix | Delete
* A packfile's name is derived from the sorted hashing of all object
[129] Fix | Delete
* names. This is only correct after the index has been finalized.
[130] Fix | Delete
*
[131] Fix | Delete
* @param idx the indexer instance
[132] Fix | Delete
*/
[133] Fix | Delete
GIT_EXTERN(const git_oid *) git_indexer_hash(const git_indexer *idx);
[134] Fix | Delete
[135] Fix | Delete
/**
[136] Fix | Delete
* Free the indexer and its resources
[137] Fix | Delete
*
[138] Fix | Delete
* @param idx the indexer to free
[139] Fix | Delete
*/
[140] Fix | Delete
GIT_EXTERN(void) git_indexer_free(git_indexer *idx);
[141] Fix | Delete
[142] Fix | Delete
GIT_END_DECL
[143] Fix | Delete
[144] Fix | Delete
#endif
[145] Fix | Delete
[146] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function