nsgenbind
Loading...
Searching...
No Matches
utils.h
Go to the documentation of this file.
1/* utility helpers
2 *
3 * This file is part of nsnsgenbind.
4 * Licensed under the MIT License,
5 * http://www.opensource.org/licenses/mit-license.php
6 * Copyright 2015 Vincent Sanders <vince@netsurf-browser.org>
7 */
8
9#ifndef nsgenbind_utils_h
10#define nsgenbind_utils_h
11
18char *genb_fpath(const char *fname);
19
23FILE *genb_fopen(const char *fname, const char *mode);
24
32FILE *genb_fopen_tmp(const char *fname);
33
37int genb_fclose_tmp(FILE *filef, const char *fname);
38
39#if defined(__APPLE__) || defined(_WIN32)
40#define NEED_STRNDUP 1
41char *strndup(const char *s, size_t n);
42#endif
43
44#ifndef SLEN
45/* Calculate length of a string constant */
46#define SLEN(s) (sizeof((s)) - 1) /* -1 for '\0' */
47#endif
48
49#ifndef UNUSED
50#define UNUSED(x) ((void)(x))
51#endif
52
53#endif
FILE * genb_fopen_tmp(const char *fname)
Definition utils.c:70
char * genb_fpath(const char *fname)
Definition utils.c:21
FILE * genb_fopen(const char *fname, const char *mode)
Definition utils.c:46
int genb_fclose_tmp(FILE *filef, const char *fname)
Definition utils.c:93