blob: 156e5c420aac7119736a8a4548075b4556d690c8 [file] [log] [blame]
Bertho Stultiens30855912000-06-13 04:34:41 +00001/*
2 * Utility routines' prototypes etc.
3 *
4 * Copyright 1998,2000 Bertho A. Stultiens (BS)
5 *
6 */
7
8#ifndef __WMC_UTILS_H
9#define __WMC_UTILS_H
10
11#ifndef __WMC_WMCTYPES_H
12#include "wmctypes.h"
13#endif
14
15#include <stddef.h> /* size_t */
16
17void *xmalloc(size_t);
18void *xrealloc(void *, size_t);
19char *xstrdup(const char *str);
20
21int yyerror(const char *s, ...) __attribute__((format (printf, 1, 2)));
22int xyyerror(const char *s, ...) __attribute__((format (printf, 1, 2)));
23int yywarning(const char *s, ...) __attribute__((format (printf, 1, 2)));
24void internal_error(const char *file, int line, const char *s, ...) __attribute__((format (printf, 3, 4)));
25void error(const char *s, ...) __attribute__((format (printf, 1, 2)));
26void warning(const char *s, ...) __attribute__((format (printf, 1, 2)));
27
28char *dup_basename(const char *name, const char *ext);
29
30WCHAR *xunistrdup(const WCHAR * str);
31WCHAR *unistrcpy(WCHAR *dst, const WCHAR *src);
32int unistrlen(const WCHAR *s);
33int unistricmp(const WCHAR *s1, const WCHAR *s2);
34int unistrcmp(const WCHAR *s1, const WCHAR *s2);
35
36#endif