File: zstd.h

package info (click to toggle)
gnutls28 3.8.12-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 82,380 kB
  • sloc: ansic: 392,233; asm: 117,804; sh: 18,758; makefile: 6,804; yacc: 1,858; python: 1,399; cpp: 1,243; perl: 995; sed: 39
file content (54 lines) | stat: -rw-r--r-- 1,540 bytes parent folder | download | duplicates (4)
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
/*
 * Copying and distribution of this file, with or without modification,
 * are permitted in any medium without royalty provided the copyright
 * notice and this notice are preserved.  This file is offered as-is,
 * without any warranty.
 */

#ifndef GNUTLS_LIB_DLWRAP_ZSTD_H_
#define GNUTLS_LIB_DLWRAP_ZSTD_H_

#include <zstd.h>

#if defined(GNUTLS_ZSTD_ENABLE_DLOPEN) && GNUTLS_ZSTD_ENABLE_DLOPEN

#define FUNC(ret, name, args, cargs)		\
  ret gnutls_zstd_func_##name args;
#define VOID_FUNC FUNC
#include "zstdfuncs.h"
#undef VOID_FUNC
#undef FUNC

#define GNUTLS_ZSTD_FUNC(name) gnutls_zstd_func_##name

#else

#define GNUTLS_ZSTD_FUNC(name) name

#endif /* GNUTLS_ZSTD_ENABLE_DLOPEN */

/* Ensure SONAME to be loaded with dlopen FLAGS, and all the necessary
 * symbols are resolved.
 *
 * Returns 0 on success; negative error code otherwise.
 *
 * Note that this function is NOT thread-safe; when calling it from
 * multi-threaded programs, protect it with a locking mechanism.
 */
int gnutls_zstd_ensure_library (const char *soname, int flags);

/* Unload library and reset symbols.
 *
 * Note that this function is NOT thread-safe; when calling it from
 * multi-threaded programs, protect it with a locking mechanism.
 */
void gnutls_zstd_unload_library (void);

/* Return 1 if the library is loaded and usable.
 *
 * Note that this function is NOT thread-safe; when calling it from
 * multi-threaded programs, protect it with a locking mechanism.
 */
unsigned gnutls_zstd_is_usable (void);

#endif /* GNUTLS_LIB_DLWRAP_ZSTD_H_ */