1155517Sambrisko/* $OpenBSD: xmalloc.h,v 1.16 2016/02/15 09:47:49 dtucker Exp $ */
2155517Sambrisko
3155517Sambrisko/*
4155517Sambrisko * Author: Tatu Ylonen <ylo@cs.hut.fi>
5155517Sambrisko * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
6155517Sambrisko *                    All rights reserved
7155517Sambrisko * Created: Mon Mar 20 22:09:17 1995 ylo
8155517Sambrisko *
9155517Sambrisko * Versions of malloc and friends that check their results, and never return
10155517Sambrisko * failure (they call fatal if they encounter an error).
11155517Sambrisko *
12155517Sambrisko * As far as I am concerned, the code I have written for this software
13155517Sambrisko * can be used freely for any purpose.  Any derived versions of this
14155517Sambrisko * software must be clearly marked as such, and if the derived work is
15155517Sambrisko * incompatible with the protocol description in the RFC file, it must be
16155517Sambrisko * called by a name other than "ssh" or "Secure Shell".
17155517Sambrisko */
18155517Sambrisko
19155517Sambriskovoid	 ssh_malloc_init(void);
20155517Sambriskovoid	*xmalloc(size_t);
21155517Sambriskovoid	*xcalloc(size_t, size_t);
22155517Sambriskovoid	*xreallocarray(void *, size_t, size_t);
23155517Sambriskochar	*xstrdup(const char *);
24155517Sambriskoint	 xasprintf(char **, const char *, ...)
25155517Sambrisko                __attribute__((__format__ (printf, 2, 3)))
26155517Sambrisko                __attribute__((__nonnull__ (2)));
27155517Sambrisko