#ifndef CACHE_H
#define CACHE_H
#include"git-compat-util.h"#include"strbuf.h"#include"hash.h"#include"advice.h"#include"gettext.h"#include"convert.h"#includeSHA1_HEADER#ifndef git_SHA_CTX
#define git_SHA_CTX SHA_CTX
#define git_SHA1_Init SHA1_Init
#define git_SHA1_Update SHA1_Update
#define git_SHA1_Final SHA1_Final
#endif
#include<zlib.h>typedefstruct git_zstream {
z_stream z;
unsignedlong avail_in;
unsignedlong avail_out;
unsignedlong total_in;
unsignedlong total_out;
unsignedchar *next_in;
unsignedchar *next_out;
} git_zstream;
voidgit_inflate_init(git_zstream *);
voidgit_inflate_init_gzip_only(git_zstream *);
voidgit_inflate_end(git_zstream *);
intgit_inflate(git_zstream *, int flush);
voidgit_deflate_init(git_zstream *, int level);
voidgit_deflate_init_gzip(git_zstream *, int level);
voidgit_deflate_init_raw(git_zstream *, int level);
voidgit_deflate_end(git_zstream *);
intgit_deflate_abort(git_zstream *);
intgit_deflate_end_gently(git_zstream *);
intgit_deflate(git_zstream *, int flush);
unsignedlonggit_deflate_bound(git_zstream *, unsignedlong);
#if defined(DT_UNKNOWN) && !defined(NO_D_TYPE_IN_DIRENT)
#define DTYPE(de) ((de)->d_type)
#else
#undef DT_UNKNOWN
#undef DT_DIR
#undef DT_REG
#undef DT_LNK
#define DT_UNKNOWN 0
#define DT_DIR 1
#define DT_REG 2
#define DT_LNK 3
#define DTYPE(de) DT_UNKNOWN
#endif
/* unknown mode (impossible combination S_IFIFO|S_IFCHR) */#define S_IFINVALID 0030000
/*
* A "directory link" is a link to another git directory.
*
* The value 0160000 is not normally a valid mode, and
* also just happens to be S_IFDIR + S_IFLNK
*
* NOTE! We *really* shouldn't depend on the S_IFxxx macros
* always having the same values everywhere. We should use
* our internal git values for these things, and then we can
* translate that to the OS-specific value. It just so
* happens that everybody shares the same bit representation
* in the UNIX world (and apparently wider too..)
*/#define S_IFGITLINK 0160000
#define S_ISGITLINK(m) (((m) & S_IFMT) == S_IFGITLINK)
/*
* Intensive research over the course of many years has shown that
* port 9418 is totally unused by anything else. Or
*
* Your search - "port 9418" - did not match any documents.
*
* as www.google.com puts it.
*
* This port has been properly assigned for git use by IANA:
* git (Assigned-9418) [I06-050728-0001].
*
* git 9418/tcp git pack transfer service
* git 9418/udp git pack transfer service
*
* with Linus Torvalds <torvalds@osdl.org> as the point of
* contact. September 2005.
*
* See http://www.iana.org/assignments/port-numbers
*/#define DEFAULT_GIT_PORT 9418
/*
* Basic data structures for the directory cache
*/#define CACHE_SIGNATURE 0x44495243 /* "DIRC" */struct cache_header {
uint32_t hdr_signature;
uint32_t hdr_version;
uint32_t hdr_entries;
};
#define INDEX_FORMAT_LB 2
#define INDEX_FORMAT_UB 4