Blame


1 3d89457c 2024-06-18 thomas.ad /* $OpenBSD$ */
2 3d89457c 2024-06-18 thomas.ad
3 3d89457c 2024-06-18 thomas.ad /*
4 3d89457c 2024-06-18 thomas.ad * Author: Tatu Ylonen <ylo@cs.hut.fi>
5 3d89457c 2024-06-18 thomas.ad * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
6 3d89457c 2024-06-18 thomas.ad * All rights reserved
7 3d89457c 2024-06-18 thomas.ad * Created: Mon Mar 20 22:09:17 1995 ylo
8 3d89457c 2024-06-18 thomas.ad *
9 3d89457c 2024-06-18 thomas.ad * Versions of malloc and friends that check their results, and never return
10 3d89457c 2024-06-18 thomas.ad * failure (they call fatal if they encounter an error).
11 3d89457c 2024-06-18 thomas.ad *
12 3d89457c 2024-06-18 thomas.ad * As far as I am concerned, the code I have written for this software
13 3d89457c 2024-06-18 thomas.ad * can be used freely for any purpose. Any derived versions of this
14 3d89457c 2024-06-18 thomas.ad * software must be clearly marked as such, and if the derived work is
15 3d89457c 2024-06-18 thomas.ad * incompatible with the protocol description in the RFC file, it must be
16 3d89457c 2024-06-18 thomas.ad * called by a name other than "ssh" or "Secure Shell".
17 3d89457c 2024-06-18 thomas.ad */
18 3d89457c 2024-06-18 thomas.ad
19 3d89457c 2024-06-18 thomas.ad #ifndef XWRAPPER_H
20 3d89457c 2024-06-18 thomas.ad #define XWRAPPER_H
21 3d89457c 2024-06-18 thomas.ad
22 3d89457c 2024-06-18 thomas.ad #if !defined(__bounded__)
23 3d89457c 2024-06-18 thomas.ad #define __bounded__(x, y, z)
24 3d89457c 2024-06-18 thomas.ad #endif
25 3d89457c 2024-06-18 thomas.ad
26 3d89457c 2024-06-18 thomas.ad void *xmalloc(size_t);
27 3d89457c 2024-06-18 thomas.ad void *xcalloc(size_t, size_t);
28 3d89457c 2024-06-18 thomas.ad void *xrealloc(void *, size_t);
29 3d89457c 2024-06-18 thomas.ad void *xreallocarray(void *, size_t, size_t);
30 3d89457c 2024-06-18 thomas.ad void *xrecallocarray(void *, size_t, size_t, size_t);
31 3d89457c 2024-06-18 thomas.ad char *xstrdup(const char *);
32 3d89457c 2024-06-18 thomas.ad char *xstrndup(const char *, size_t);
33 3d89457c 2024-06-18 thomas.ad int xasprintf(char **, const char *, ...)
34 3d89457c 2024-06-18 thomas.ad __attribute__((__format__ (printf, 2, 3)))
35 3d89457c 2024-06-18 thomas.ad __attribute__((__nonnull__ (2)));
36 3d89457c 2024-06-18 thomas.ad int xvasprintf(char **, const char *, va_list)
37 3d89457c 2024-06-18 thomas.ad __attribute__((__format__ (printf, 2, 0)))
38 3d89457c 2024-06-18 thomas.ad __attribute__((__nonnull__ (2)));
39 3d89457c 2024-06-18 thomas.ad int xsnprintf(char *, size_t, const char *, ...)
40 3d89457c 2024-06-18 thomas.ad __attribute__((__format__ (printf, 3, 4)))
41 3d89457c 2024-06-18 thomas.ad __attribute__((__nonnull__ (3)))
42 3d89457c 2024-06-18 thomas.ad __attribute__((__bounded__ (__string__, 1, 2)));
43 3d89457c 2024-06-18 thomas.ad int xvsnprintf(char *, size_t, const char *, va_list)
44 3d89457c 2024-06-18 thomas.ad __attribute__((__format__ (printf, 3, 0)))
45 3d89457c 2024-06-18 thomas.ad __attribute__((__nonnull__ (3)))
46 3d89457c 2024-06-18 thomas.ad __attribute__((__bounded__ (__string__, 1, 2)));
47 3d89457c 2024-06-18 thomas.ad
48 3d89457c 2024-06-18 thomas.ad #endif /* XWRAPPER_H */