File: infutil.h

package info (click to toggle)
refind 0.14.2-2.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,432 kB
  • sloc: ansic: 52,757; sh: 2,086; python: 592; makefile: 351; perl: 5
file content (39 lines) | stat: -rw-r--r-- 1,078 bytes parent folder | download
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
/* infutil.h -- types and macros common to blocks and codes
 * Copyright (C) 1995-1998 Mark Adler
 * For conditions of distribution and use, see copyright notice in zlib.h 
 */

/* WARNING: this file should *not* be used by applications. It is
   part of the implementation of the compression library and is
   subject to change. Applications should only use zlib.h.
 */

#ifndef _INFUTIL_H
#define _INFUTIL_H

#include "zlib.h"
// #ifdef CONFIG_ZLIB_DFLTCC
// #include "../zlib_dfltcc/dfltcc.h"
// #include <asm/page.h>
// #endif

/* memory allocation for inflation */

struct inflate_workspace {
    struct inflate_state inflate_state;
#ifdef CONFIG_ZLIB_DFLTCC
    struct dfltcc_state dfltcc_state;
    unsigned char working_window[(1 << MAX_WBITS) + PAGE_SIZE];
#else
    unsigned char working_window[(1 << MAX_WBITS)];
#endif
};

#ifdef CONFIG_ZLIB_DFLTCC
/* dfltcc_state must be doubleword aligned for DFLTCC call */
static_assert(offsetof(struct inflate_workspace, dfltcc_state) % 8 == 0);
#endif

#define WS(strm) ((struct inflate_workspace *)(strm->workspace))

#endif