This source file includes following definitions.
- pack_name_hash
#ifndef PACK_OBJECTS_H
#define PACK_OBJECTS_H
struct object_entry {
struct pack_idx_entry idx;
unsigned long size;
struct packed_git *in_pack;
off_t in_pack_offset;
struct object_entry *delta;
struct object_entry *delta_child;
struct object_entry *delta_sibling;
void *delta_data;
unsigned long delta_size;
unsigned long z_delta_size;
enum object_type type;
enum object_type in_pack_type;
uint32_t hash;
unsigned int in_pack_pos;
unsigned char in_pack_header_size;
unsigned preferred_base:1;
unsigned no_try_delta:1;
unsigned tagged:1;
unsigned filled:1;
};
struct packing_data {
struct object_entry *objects;
uint32_t nr_objects, nr_alloc;
int32_t *index;
uint32_t index_size;
};
struct object_entry *packlist_alloc(struct packing_data *pdata,
const unsigned char *sha1,
uint32_t index_pos);
struct object_entry *packlist_find(struct packing_data *pdata,
const unsigned char *sha1,
uint32_t *index_pos);
static inline uint32_t pack_name_hash(const char *name)
{
uint32_t c, hash = 0;
if (!name)
return 0;
while ((c = *name++) != 0) {
if (isspace(c))
continue;
hash = (hash >> 2) + (c << 24);
}
return hash;
}
#endif