1221828Sgrehan/* $OpenBSD: xmalloc.h,v 1.20 2021/04/03 06:18:41 djm Exp $ */
2221828Sgrehan
3221828Sgrehan/*
4221828Sgrehan * Author: Tatu Ylonen <ylo@cs.hut.fi>
5221828Sgrehan * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
6221828Sgrehan *                    All rights reserved
7221828Sgrehan * Created: Mon Mar 20 22:09:17 1995 ylo
8221828Sgrehan *
9221828Sgrehan * Versions of malloc and friends that check their results, and never return
10221828Sgrehan * failure (they call fatal if they encounter an error).
11221828Sgrehan *
12221828Sgrehan * As far as I am concerned, the code I have written for this software
13221828Sgrehan * can be used freely for any purpose.  Any derived versions of this
14221828Sgrehan * software must be clearly marked as such, and if the derived work is
15221828Sgrehan * incompatible with the protocol description in the RFC file, it must be
16221828Sgrehan * called by a name other than "ssh" or "Secure Shell".
17221828Sgrehan */
18221828Sgrehan
19221828Sgrehanvoid	*xmalloc(size_t);
20221828Sgrehanvoid	*xcalloc(size_t, size_t);
21221828Sgrehanvoid	*xreallocarray(void *, size_t, size_t);
22221828Sgrehanvoid	*xrecallocarray(void *, size_t, size_t, size_t);
23221828Sgrehanchar	*xstrdup(const char *);
24221828Sgrehanint	 xasprintf(char **, const char *, ...)
25221828Sgrehan    __attribute__((__format__ (printf, 2, 3))) __attribute__((__nonnull__ (2)));
26221828Sgrehanint	 xvasprintf(char **, const char *, va_list)
27221828Sgrehan    __attribute__((__nonnull__ (2)));
28221828Sgrehan