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