blob: fb217a45c9032c8b3a25e99c56720b0515e2573b [file] [log] [blame]
Damien Millerd7834352006-08-05 12:39:39 +10001/* $OpenBSD: xmalloc.h,v 1.13 2006/08/03 03:34:42 deraadt Exp $ */
Ben Lindstrom05764b92002-03-05 01:53:02 +00002
Damien Millerd4a8b7e1999-10-27 13:42:43 +10003/*
Damien Miller95def091999-11-25 00:26:21 +11004 * Author: Tatu Ylonen <ylo@cs.hut.fi>
Damien Miller95def091999-11-25 00:26:21 +11005 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
6 * All rights reserved
Damien Miller95def091999-11-25 00:26:21 +11007 * Created: Mon Mar 20 22:09:17 1995 ylo
Damien Miller4af51302000-04-16 11:18:38 +10008 *
Damien Miller95def091999-11-25 00:26:21 +11009 * Versions of malloc and friends that check their results, and never return
10 * failure (they call fatal if they encounter an error).
Damien Miller4af51302000-04-16 11:18:38 +100011 *
Damien Millere4340be2000-09-16 13:29:08 +110012 * As far as I am concerned, the code I have written for this software
13 * can be used freely for any purpose. Any derived versions of this
14 * software must be clearly marked as such, and if the derived work is
15 * incompatible with the protocol description in the RFC file, it must be
16 * called by a name other than "ssh" or "Secure Shell".
Damien Miller95def091999-11-25 00:26:21 +110017 */
Damien Millerd4a8b7e1999-10-27 13:42:43 +100018
Ben Lindstrom4cc240d2001-07-04 04:46:56 +000019void *xmalloc(size_t);
Damien Miller07d86be2006-03-26 14:19:21 +110020void *xcalloc(size_t, size_t);
Damien Miller36812092006-03-26 14:22:47 +110021void *xrealloc(void *, size_t, size_t);
Ben Lindstrom4cc240d2001-07-04 04:46:56 +000022void xfree(void *);
Ben Lindstromcb72e4f2002-06-21 00:41:51 +000023char *xstrdup(const char *);
Damien Miller07d86be2006-03-26 14:19:21 +110024int xasprintf(char **, const char *, ...)
25 __attribute__((__format__ (printf, 2, 3)))
26 __attribute__((__nonnull__ (2)));