2 * Copyright (C) Ilari Liusvaara 2009-2010
4 * This code is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
8 #ifndef _compat__h__included__
9 #define _compat__h__included__
13 #include <sys/types.h>
15 void *xmalloc(size_t size
);
16 void warning(const char *fmt
, ...);
17 void error(const char *fmt
, ...);
18 void die(const char *fmt
, ...);
19 void die_errno(const char *fmt
, ...);
20 int prefixcmp(const char *str
, const char *prefix
);
21 FILE *xfdopen(int fd
, const char *mode
);
22 void write_or_die(int fd
, const void *buffer
, size_t size
);
23 char *xstrdup(const char *str
);
24 char *xstrndup(const char *str
, size_t n
);
35 int start_command(struct child_process
*child
);
36 int finish_command(struct child_process
*child
);