Coverage Report

Created: 2020-05-07 18:36

/proc/self/cwd/c/system.h
Line
Count
Source
1
/*
2
Copyright 2020 Google LLC
3
4
Use of this source code is governed by a BSD-style
5
license that can be found in the LICENSE file or at
6
https://developers.google.com/open-source/licenses/bsd
7
*/
8
9
#ifndef SYSTEM_H
10
#define SYSTEM_H
11
12
#if REFTABLE_IN_GITCORE
13
14
#include "git-compat-util.h"
15
#include "cache.h"
16
#include <zlib.h>
17
18
#else
19
20
#include <assert.h>
21
#include <errno.h>
22
#include <fcntl.h>
23
#include <inttypes.h>
24
#include <stdint.h>
25
#include <stdio.h>
26
#include <stdlib.h>
27
#include <string.h>
28
#include <sys/stat.h>
29
#include <sys/time.h>
30
#include <sys/types.h>
31
#include <unistd.h>
32
#include <zlib.h>
33
34
#include "compat.h"
35
36
#endif /* REFTABLE_IN_GITCORE */
37
38
5.88k
#define SHA1_ID 0x73686131
39
386
#define SHA256_ID 0x73323536
40
3.60k
#define SHA1_SIZE 20
41
385
#define SHA256_SIZE 32
42
43
typedef uint8_t byte;
44
typedef int bool;
45
46
/* This is uncompress2, which is only available in zlib as of 2017.
47
 *
48
 * TODO: in git-core, this should fallback to uncompress2 if it is available.
49
 */
50
int uncompress_return_consumed(Bytef *dest, uLongf *destLen,
51
             const Bytef *source, uLong *sourceLen);
52
int hash_size(uint32_t id);
53
54
#endif