Blame include/git2/indexer.h

Packit Service 20376f
/*
Packit Service 20376f
 * Copyright (C) the libgit2 contributors. All rights reserved.
Packit Service 20376f
 *
Packit Service 20376f
 * This file is part of libgit2, distributed under the GNU GPL v2 with
Packit Service 20376f
 * a Linking Exception. For full terms see the included COPYING file.
Packit Service 20376f
 */
Packit Service 20376f
#ifndef _INCLUDE_git_indexer_h__
Packit Service 20376f
#define _INCLUDE_git_indexer_h__
Packit Service 20376f
Packit Service 20376f
#include "common.h"
Packit Service 20376f
#include "types.h"
Packit Service 20376f
#include "oid.h"
Packit Service 20376f
Packit Service 20376f
GIT_BEGIN_DECL
Packit Service 20376f
Packit Service 20376f
typedef struct git_indexer git_indexer;
Packit Service 20376f
Packit Service 20376f
/**
Packit Service 20376f
 * Create a new indexer instance
Packit Service 20376f
 *
Packit Service 20376f
 * @param out where to store the indexer instance
Packit Service 20376f
 * @param path to the directory where the packfile should be stored
Packit Service 20376f
 * @param mode permissions to use creating packfile or 0 for defaults
Packit Service 20376f
 * @param odb object database from which to read base objects when
Packit Service 20376f
 * fixing thin packs. Pass NULL if no thin pack is expected (an error
Packit Service 20376f
 * will be returned if there are bases missing)
Packit Service 20376f
 * @param progress_cb function to call with progress information
Packit Service 20376f
 * @param progress_cb_payload payload for the progress callback
Packit Service 20376f
 */
Packit Service 20376f
GIT_EXTERN(int) git_indexer_new(
Packit Service 20376f
		git_indexer **out,
Packit Service 20376f
		const char *path,
Packit Service 20376f
		unsigned int mode,
Packit Service 20376f
		git_odb *odb,
Packit Service 20376f
		git_transfer_progress_cb progress_cb,
Packit Service 20376f
		void *progress_cb_payload);
Packit Service 20376f
Packit Service 20376f
/**
Packit Service 20376f
 * Add data to the indexer
Packit Service 20376f
 *
Packit Service 20376f
 * @param idx the indexer
Packit Service 20376f
 * @param data the data to add
Packit Service 20376f
 * @param size the size of the data in bytes
Packit Service 20376f
 * @param stats stat storage
Packit Service 20376f
 */
Packit Service 20376f
GIT_EXTERN(int) git_indexer_append(git_indexer *idx, const void *data, size_t size, git_transfer_progress *stats);
Packit Service 20376f
Packit Service 20376f
/**
Packit Service 20376f
 * Finalize the pack and index
Packit Service 20376f
 *
Packit Service 20376f
 * Resolve any pending deltas and write out the index file
Packit Service 20376f
 *
Packit Service 20376f
 * @param idx the indexer
Packit Service 20376f
 */
Packit Service 20376f
GIT_EXTERN(int) git_indexer_commit(git_indexer *idx, git_transfer_progress *stats);
Packit Service 20376f
Packit Service 20376f
/**
Packit Service 20376f
 * Get the packfile's hash
Packit Service 20376f
 *
Packit Service 20376f
 * A packfile's name is derived from the sorted hashing of all object
Packit Service 20376f
 * names. This is only correct after the index has been finalized.
Packit Service 20376f
 *
Packit Service 20376f
 * @param idx the indexer instance
Packit Service 20376f
 */
Packit Service 20376f
GIT_EXTERN(const git_oid *) git_indexer_hash(const git_indexer *idx);
Packit Service 20376f
Packit Service 20376f
/**
Packit Service 20376f
 * Free the indexer and its resources
Packit Service 20376f
 *
Packit Service 20376f
 * @param idx the indexer to free
Packit Service 20376f
 */
Packit Service 20376f
GIT_EXTERN(void) git_indexer_free(git_indexer *idx);
Packit Service 20376f
Packit Service 20376f
GIT_END_DECL
Packit Service 20376f
Packit Service 20376f
#endif