mirror of
https://frontier.innolan.net/rainlance/amiga-tz.git
synced 2026-05-06 21:28:54 +00:00
standardization
SCCS-file: ialloc.c SCCS-SID: 8.13
This commit is contained in:
committed by
Paul Eggert
parent
b795ee9192
commit
0da076a44f
37
ialloc.c
37
ialloc.c
@@ -7,42 +7,36 @@ static char elsieid[] = "%W%";
|
||||
/*LINTLIBRARY*/
|
||||
|
||||
#include "stdio.h"
|
||||
#include "string.h"
|
||||
|
||||
#ifdef __STDC__
|
||||
#define HAVEHEADS
|
||||
#define P(s) s
|
||||
#endif /* defined __STDC__ */
|
||||
|
||||
#ifdef __TURBOC__
|
||||
#define HAVEHEADS
|
||||
#define P(s) s
|
||||
#endif /* defined __TURBOC__ */
|
||||
|
||||
#ifdef HAVEHEADS
|
||||
#ifdef P
|
||||
|
||||
#include "stdlib.h"
|
||||
#include "string.h"
|
||||
|
||||
#define alloc_t size_t
|
||||
|
||||
char * icalloc(int nelem, int elsize);
|
||||
char * icatalloc(char * old, char * new);
|
||||
char * icpyalloc(char * string);
|
||||
char * imalloc(int n);
|
||||
char * irealloc(char * pointer, int size);
|
||||
void ifree(char * pointer);
|
||||
#else /* !defined P */
|
||||
|
||||
#else /* !defined HAVEHEADS */
|
||||
#define P(s) ()
|
||||
#define const
|
||||
|
||||
extern char * calloc();
|
||||
extern char * malloc();
|
||||
extern char * realloc();
|
||||
extern char * strcpy();
|
||||
|
||||
#endif /* !defined P */
|
||||
|
||||
#ifndef alloc_t
|
||||
#define alloc_t unsigned
|
||||
#endif /* !defined alloc_t */
|
||||
|
||||
#endif /* !defined HAVEHEADS */
|
||||
|
||||
#ifdef MAL
|
||||
#define NULLMAL(x) ((x) == NULL || (x) == MAL)
|
||||
#else /* !defined MAL */
|
||||
@@ -51,6 +45,13 @@ extern char * strcpy();
|
||||
|
||||
#define nonzero(n) (((n) == 0) ? 1 : (n))
|
||||
|
||||
char * icalloc P((int nelem, int elsize));
|
||||
char * icatalloc P((char * old, const char * new));
|
||||
char * icpyalloc P((const char * string));
|
||||
char * imalloc P((int n));
|
||||
char * irealloc P((char * pointer, int size));
|
||||
void ifree P((char * pointer));
|
||||
|
||||
char *
|
||||
imalloc(n)
|
||||
{
|
||||
@@ -83,8 +84,8 @@ char * pointer;
|
||||
|
||||
char *
|
||||
icatalloc(old, new)
|
||||
char * old;
|
||||
char * new;
|
||||
char * old;
|
||||
const char * new;
|
||||
{
|
||||
register char * result;
|
||||
register oldsize, newsize;
|
||||
@@ -103,7 +104,7 @@ char * new;
|
||||
|
||||
char *
|
||||
icpyalloc(string)
|
||||
char * string;
|
||||
const char * string;
|
||||
{
|
||||
return icatalloc((char *) NULL, string);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user