blob: 694e0c56f0b67c1ae9b7a94a243aca7b8859e50c [file] [log] [blame]
Linus Torvaldsa733cb62005-06-28 14:21:02 -07001#ifndef PACK_H
2#define PACK_H
3
Linus Torvalds01247d82005-06-28 22:15:57 -07004/*
5 * The packed object type is stored in 3 bits.
6 * The type value 0 is a reserved prefix if ever there is more than 7
7 * object types, or any future format extensions.
8 */
Linus Torvaldsa733cb62005-06-28 14:21:02 -07009enum object_type {
Linus Torvalds01247d82005-06-28 22:15:57 -070010 OBJ_EXT = 0,
11 OBJ_COMMIT = 1,
12 OBJ_TREE = 2,
13 OBJ_BLOB = 3,
14 OBJ_TAG = 4,
15 /* 5/6 for future expansion */
16 OBJ_DELTA = 7,
Linus Torvaldsa733cb62005-06-28 14:21:02 -070017};
18
19/*
20 * Packed object header
21 */
22#define PACK_SIGNATURE 0x5041434b /* "PACK" */
Linus Torvalds01247d82005-06-28 22:15:57 -070023#define PACK_VERSION 2
Nicolas Pitred60fc1c2006-02-09 17:50:04 -050024#define pack_version_ok(v) ((v) == htonl(2) || (v) == htonl(3))
Linus Torvaldsa733cb62005-06-28 14:21:02 -070025struct pack_header {
26 unsigned int hdr_signature;
27 unsigned int hdr_version;
28 unsigned int hdr_entries;
29};
30
Junio C Hamanof3bf9222005-06-30 17:15:39 -070031extern int verify_pack(struct packed_git *, int);
Junio C Hamanoa49dd052006-02-15 17:34:29 -080032extern int check_reuse_pack_delta(struct packed_git *, unsigned long,
33 unsigned char *, unsigned long *,
34 enum object_type *);
Linus Torvaldsa733cb62005-06-28 14:21:02 -070035#endif