Blame


1 574ed2c3 2017-11-29 stsp /* $OpenBSD: xmalloc.h,v 1.4 2015/11/12 16:30:30 mmcc Exp $ */
2 574ed2c3 2017-11-29 stsp
3 574ed2c3 2017-11-29 stsp /*
4 574ed2c3 2017-11-29 stsp * Author: Tatu Ylonen <ylo@cs.hut.fi>
5 574ed2c3 2017-11-29 stsp * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
6 574ed2c3 2017-11-29 stsp * All rights reserved
7 574ed2c3 2017-11-29 stsp * Created: Mon Mar 20 22:09:17 1995 ylo
8 574ed2c3 2017-11-29 stsp *
9 574ed2c3 2017-11-29 stsp * Versions of malloc and friends that check their results, and never return
10 574ed2c3 2017-11-29 stsp * failure (they call fatal if they encounter an error).
11 574ed2c3 2017-11-29 stsp *
12 574ed2c3 2017-11-29 stsp * As far as I am concerned, the code I have written for this software
13 574ed2c3 2017-11-29 stsp * can be used freely for any purpose. Any derived versions of this
14 574ed2c3 2017-11-29 stsp * software must be clearly marked as such, and if the derived work is
15 574ed2c3 2017-11-29 stsp * incompatible with the protocol description in the RFC file, it must be
16 574ed2c3 2017-11-29 stsp * called by a name other than "ssh" or "Secure Shell".
17 574ed2c3 2017-11-29 stsp */
18 574ed2c3 2017-11-29 stsp
19 574ed2c3 2017-11-29 stsp #ifndef XMALLOC_H
20 574ed2c3 2017-11-29 stsp #define XMALLOC_H
21 574ed2c3 2017-11-29 stsp
22 574ed2c3 2017-11-29 stsp void *xmalloc(size_t);
23 574ed2c3 2017-11-29 stsp void *xcalloc(size_t, size_t);
24 574ed2c3 2017-11-29 stsp void *xreallocarray(void *, size_t, size_t);
25 574ed2c3 2017-11-29 stsp char *xstrdup(const char *);
26 574ed2c3 2017-11-29 stsp int xasprintf(char **, const char *, ...)
27 574ed2c3 2017-11-29 stsp __attribute__((__format__ (printf, 2, 3)))
28 574ed2c3 2017-11-29 stsp __attribute__((__nonnull__ (2)));
29 574ed2c3 2017-11-29 stsp
30 574ed2c3 2017-11-29 stsp #endif /* XMALLOC_H */