3 * Various things common for all utilities
11 # if !defined __GNUC__ || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
12 # define __attribute__(x)
16 #define MY_EMAIL "jack@suse.cz"
18 /* Name of current program for error reporting */
19 extern char *progname;
21 /* Finish programs being */
22 void __attribute ((noreturn)) die(int, char *, ...) __attribute__ ((__format__ (__printf__, 2, 3)));
25 void errstr(char *, ...) __attribute__ ((__format__ (__printf__, 1, 2)));
27 /* If use_syslog is called, all error reports using errstr() and die() are
28 * written to syslog instead of stderr */
31 /* malloc() with error check */
32 void *smalloc(size_t);
34 /* realloc() with error check */
35 void *srealloc(void *, size_t);
37 /* Safe strncpy - always finishes string */
38 void sstrncpy(char *, const char *, size_t);
40 /* Safe strncat - always finishes string */
41 void sstrncat(char *, const char *, size_t);
43 /* Safe version of strdup() */
44 char *sstrdup(const char *s);
46 /* Print version string */
49 #endif /* GUARD_COMMON_H */