File: jigdo.h

package info (click to toggle)
jigit 1.20-2
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 1,796 kB
  • ctags: 624
  • sloc: sh: 10,437; ansic: 5,866; perl: 566; makefile: 129
file content (55 lines) | stat: -rw-r--r-- 1,025 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
 * jigdo.h
 *
 * Common prototypes/macros/definitions
 *
 * Copyright (c) 2007 Steve McIntyre <steve@einval.com>
 *
 * GPL v2 - see COPYING
 */

/* Compression algorithms supported in the compressed data blocks
 * inside a template file */
#define COMP_GZIP  1
#define COMP_BZIP2 2

/* Block types within the template file */
#define BLOCK_DATA    2
#define BLOCK_IMAGE   5
#define BLOCK_MATCH   6

/* Useful types and macros */
typedef long long INT64;
typedef unsigned long long UINT64;
typedef unsigned long      UINT32;

#ifndef LLONG_MAX
#   define LLONG_MAX (INT64)INT_MAX * INT_MAX
#endif

#ifndef MIN
#define MIN(x,y)        ( ((x) < (y)) ? (x) : (y))
#endif

#define BUF_SIZE 65536

typedef enum state_
{
    STARTING,
    IN_DATA,
    IN_DESC,
    DUMP_DESC,
    DONE,
    ERROR
} e_state;

typedef struct zs_
{
    char   *data_buf;
    INT64   buf_size;
    INT64   offset_in_curr_buf;
    INT64   total_offset;
} zip_state_t;

int read_data_block(FILE *template_file, FILE *logfile, zip_state_t *zip_state);