Import of openhackware-0.4.1
[openhackware.git] / src / libc / include / stdlib.h
blobd0fab6cd001e71b6700dd2ac1180d75050a178d4
1 /*
2 * <stdlib.h>
4 * Open Hack'Ware BIOS: subset of POSIX stdlib definitions
5 *
6 * Copyright (c) 2004-2005 Jocelyn Mayer
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License V2
10 * as published by the Free Software Foundation
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #if !defined (__OHW_STDLIB_H__)
23 #define __OHW_STDLIB_H__
25 #define NULL ((void *)0)
27 /* size_t is declared here */
28 #include <stddef.h>
30 void *malloc (size_t size);
31 void free (void *ptr);
32 void *realloc (void *ptr, size_t size);
34 /* memset is declared here */
35 #include <string.h>
37 static inline void *calloc (size_t nmemb, size_t size)
39 void *ret;
41 ret = malloc(nmemb * size);
42 if (ret != NULL)
43 memset(ret, 0, nmemb * size);
45 return ret;
48 int mkstemp (char *template);
50 #endif /* !defined (__OHW_STDLIB_H__) */