Revision: | 1.1 |
Committed: | Fri Mar 8 14:37:29 2002 UTC (22 years, 8 months ago) by tdb |
Content type: | text/plain |
Branch: | MAIN |
CVS Tags: | IHOST_1_5_3, IHOST_1_5_2, IHOST_1_5_1, IHOST_1_5, IHOST_1_0_RC1 |
Log Message: | I'm not usually up for putting third party sources in here, but in this case I'll make an exception. This is ukcprog, a set of useful C functions which the ihost plugins Pete's writing uses. It's got a pretty free license too. I've munged the Makefile around, as all it needs to do now is make the library, not install anything. The idea is to statically compile the other programs against this library, making the final binary independent of this code etc. |
# | User | Rev | Content |
---|---|---|---|
1 | tdb | 1.1 | /* e_malloc() -- error checking malloc */ |
2 | |||
3 | /* Copyright 1992 Godfrey Paul, University of Kent at Canterbury. | ||
4 | * | ||
5 | * You can do what you like with this source code as long as | ||
6 | * you don't try to make money out of it and you include an | ||
7 | * unaltered copy of this message (including the copyright). | ||
8 | */ | ||
9 | |||
10 | char ukcprog_malloc_sccsid[] = "$Id: e_malloc.c,v 1.9 1993/05/30 18:15:10 gjap Exp $ UKC"; | ||
11 | |||
12 | #ifndef __STDC__ | ||
13 | #include <sys/types.h> /* for size_t */ | ||
14 | #endif | ||
15 | |||
16 | #include <stdio.h> /* for NULL */ | ||
17 | #include <stdlib.h> | ||
18 | |||
19 | #include "ukcprog.h" | ||
20 | |||
21 | |||
22 | voidptr | ||
23 | e_malloc(size) | ||
24 | size_t size; | ||
25 | { | ||
26 | char *ptr; | ||
27 | |||
28 | if ((ptr = malloc(size)) == NULL) | ||
29 | panic("malloc failed in e_malloc"); | ||
30 | |||
31 | return ptr; | ||
32 | } |