-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathckoker.h
68 lines (57 loc) · 1.5 KB
/
ckoker.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
Author: Jeffrey E Altman <[email protected]>,
Secure Endpoints Inc., New York City.
Copyright (C) 1985, 2004, Trustees of Columbia University in the City of New
York.
*/
#ifndef CKOKER_H
#define CKOKER_H
#include <stdlib.h>
#include <string.h>
typedef unsigned int size_t;
/* Like malloc, but calls fatal() if out of memory. */
void *kmalloc(size_t size);
/* Like realloc, but calls fatal() if out of memory. */
void *krealloc(void *ptr, size_t new_size);
/* Frees memory allocated using kmalloc or krealloc. */
void kfree(void *ptr);
/* Allocates memory using kmalloc, and copies the string into that memory. */
char *kstrdup(const char *str);
#define malloc(x) kmalloc(x)
#define realloc(x,y) krealloc(x,y)
#define free(x) kfree(x)
#define strdup(x) kstrdup(x)
#ifdef NT
#ifdef __STDC__
#define stricmp _stricmp
#define putenv _putenv
#define sopen _sopen
#define strupr _strupr
#define close _close
#define stat _stat
#define fileno _fileno
#define sys_errlist _sys_errlist
#define unlink _unlink
#define write _write
#define creat _creat
#define getpid _getpid
#define utime _utime
#define mktemp _mktemp
#define strnicmp _strnicmp
#define read _read
#define open _open
#define access _access
#define wcsdup _wcsdup
#define chmod _chmod
#define fstat _fstat
#define ftime _ftime
#endif /* __STDC__ */
#define isascii __isascii
#endif /* NT */
#define NOJC
/* For OS/2 debugging... */
#ifdef __IBMC__
#ifdef __DEBUG
#endif /* __DEBUG */
#endif /* __IBMC__ */
#endif /* CKOKER_H */