Blame include/git2/net.h

Packit ae9e2a
/*
Packit ae9e2a
 * Copyright (C) the libgit2 contributors. All rights reserved.
Packit ae9e2a
 *
Packit ae9e2a
 * This file is part of libgit2, distributed under the GNU GPL v2 with
Packit ae9e2a
 * a Linking Exception. For full terms see the included COPYING file.
Packit ae9e2a
 */
Packit ae9e2a
#ifndef INCLUDE_git_net_h__
Packit ae9e2a
#define INCLUDE_git_net_h__
Packit ae9e2a
Packit ae9e2a
#include "common.h"
Packit ae9e2a
#include "oid.h"
Packit ae9e2a
#include "types.h"
Packit ae9e2a
Packit ae9e2a
/**
Packit ae9e2a
 * @file git2/net.h
Packit ae9e2a
 * @brief Git networking declarations
Packit ae9e2a
 * @ingroup Git
Packit ae9e2a
 * @{
Packit ae9e2a
 */
Packit ae9e2a
GIT_BEGIN_DECL
Packit ae9e2a
Packit ae9e2a
#define GIT_DEFAULT_PORT "9418"
Packit ae9e2a
Packit ae9e2a
/**
Packit ae9e2a
 * Direction of the connection.
Packit ae9e2a
 *
Packit ae9e2a
 * We need this because we need to know whether we should call
Packit ae9e2a
 * git-upload-pack or git-receive-pack on the remote end when get_refs
Packit ae9e2a
 * gets called.
Packit ae9e2a
 */
Packit ae9e2a
typedef enum {
Packit ae9e2a
	GIT_DIRECTION_FETCH = 0,
Packit ae9e2a
	GIT_DIRECTION_PUSH  = 1
Packit ae9e2a
} git_direction;
Packit ae9e2a
Packit ae9e2a
/**
Packit ae9e2a
 * Description of a reference advertised by a remote server, given out
Packit ae9e2a
 * on `ls` calls.
Packit ae9e2a
 */
Packit ae9e2a
struct git_remote_head {
Packit ae9e2a
	int local; /* available locally */
Packit ae9e2a
	git_oid oid;
Packit ae9e2a
	git_oid loid;
Packit ae9e2a
	char *name;
Packit ae9e2a
	/**
Packit ae9e2a
	 * If the server send a symref mapping for this ref, this will
Packit ae9e2a
	 * point to the target.
Packit ae9e2a
	 */
Packit ae9e2a
	char *symref_target;
Packit ae9e2a
};
Packit ae9e2a
Packit ae9e2a
/**
Packit ae9e2a
 * Callback for listing the remote heads
Packit ae9e2a
 */
Packit ae9e2a
typedef int (*git_headlist_cb)(git_remote_head *rhead, void *payload);
Packit ae9e2a
Packit ae9e2a
/** @} */
Packit ae9e2a
GIT_END_DECL
Packit ae9e2a
#endif