chiark / gitweb /
debian: Use debhelper to generate maint scripts
[userv.git] / both.h
1 /*
2  * userv - both.h
3  * Useful very-low-level utility routines' declarations,
4  * for both client and daemon.
5  *
6  * userv is copyright Ian Jackson and other contributors.
7  * See README for full authorship information.
8  *
9  * This is free software; you can redistribute it and/or modify it
10  * under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with userv; if not, see <http://www.gnu.org/licenses/>.
21  */
22
23 #ifndef BOTH_H
24 #define BOTH_H
25
26 /* provided by both.c */
27
28 void *xmalloc(size_t s);
29 void *xrealloc(void *p, size_t s);
30 char *xstrsave(const char *s);
31
32 int working_getc(FILE *file);
33 size_t working_fread(void *ptr, size_t sz, FILE *file);
34
35 /* used by both.c, so must be present */
36
37 void syscallerror(const char *what) NONRETURNING;
38
39 #define ISCHAR(iswotsit,ch) (iswotsit((unsigned char)(ch))) /*Feh!*/
40
41 #endif