stand.h (39469) | stand.h (39665) |
---|---|
1/* 2 * Copyright (c) 1998 Michael Smith. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/* 2 * Copyright (c) 1998 Michael Smith. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $Id: stand.h,v 1.3 1998/09/18 22:58:00 msmith Exp $ | 26 * $Id: stand.h,v 1.4 1998/09/18 23:00:57 msmith Exp $ |
27 * From $NetBSD: stand.h,v 1.22 1997/06/26 19:17:40 drochner Exp $ 28 */ 29 30/*- 31 * Copyright (c) 1993 32 * The Regents of the University of California. All rights reserved. 33 * 34 * Redistribution and use in source and binary forms, with or without --- 26 unchanged lines hidden (view full) --- 61 * 62 * @(#)stand.h 8.1 (Berkeley) 6/11/93 63 */ 64 65#include <sys/types.h> 66#include <sys/cdefs.h> 67#include <sys/stat.h> 68 | 27 * From $NetBSD: stand.h,v 1.22 1997/06/26 19:17:40 drochner Exp $ 28 */ 29 30/*- 31 * Copyright (c) 1993 32 * The Regents of the University of California. All rights reserved. 33 * 34 * Redistribution and use in source and binary forms, with or without --- 26 unchanged lines hidden (view full) --- 61 * 62 * @(#)stand.h 8.1 (Berkeley) 6/11/93 63 */ 64 65#include <sys/types.h> 66#include <sys/cdefs.h> 67#include <sys/stat.h> 68 |
69#define CHK(fmt, args...) printf("%s(%d): " fmt "\n", __FUNCTION__, __LINE__ , ##args) 70#define PCHK(fmt, args...) {printf("%s(%d): " fmt "\n", __FUNCTION__, __LINE__ , ##args); getchar();} 71 |
|
69#ifndef NULL 70#define NULL 0 71#endif 72 73/* Avoid unwanted userlandish components */ 74#define KERNEL 75#include <sys/errno.h> 76#undef KERNEL --- 86 unchanged lines hidden (view full) --- 163#define isspace(c) ((c) == ' ' || (c) == '\t') 164#define isdigit(c) ((c) >= '0' && (c) <= '9') 165#define isxdigit(c) (isdigit(c) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F')) 166#define isascii(c) ((c) >= 0 || (c <= 0x7f)) 167#define isalpha(c) (isupper(c) || (islower(c))) 168#define toupper(c) ((c) - 'a' + 'A') 169#define tolower(c) ((c) - 'A' + 'a') 170 | 72#ifndef NULL 73#define NULL 0 74#endif 75 76/* Avoid unwanted userlandish components */ 77#define KERNEL 78#include <sys/errno.h> 79#undef KERNEL --- 86 unchanged lines hidden (view full) --- 166#define isspace(c) ((c) == ' ' || (c) == '\t') 167#define isdigit(c) ((c) >= '0' && (c) <= '9') 168#define isxdigit(c) (isdigit(c) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F')) 169#define isascii(c) ((c) >= 0 || (c <= 0x7f)) 170#define isalpha(c) (isupper(c) || (islower(c))) 171#define toupper(c) ((c) - 'a' + 'A') 172#define tolower(c) ((c) - 'A' + 'a') 173 |
171extern void setheap(void *, void *); 172extern void *malloc(size_t); 173extern void free(void *); 174extern char *sbrk(int junk); | 174/* sbrk emulation */ 175extern void setheap(void *base, void *top); 176extern char *sbrk(int incr); |
175 | 177 |
178/* Matt Dillon's zalloc/zmalloc */ 179extern void *malloc(size_t bytes); 180extern void free(void *ptr); 181/*#define free(p) {CHK("free %p", p); free(p);} */ /* use for catching guard violations */ 182extern void *calloc(size_t n1, size_t n2); 183extern void *realloc(void *ptr, size_t size); 184extern void *reallocf(void *ptr, size_t size); 185extern void mallocstats(void); 186 |
|
176/* disklabel support (undocumented, may be junk) */ 177struct disklabel; 178extern char *getdisklabel(const char *, struct disklabel *); 179extern int dkcksum(struct disklabel *); 180 181extern int printf(const char *fmt, ...); 182extern void vprintf(const char *fmt, _BSD_VA_LIST_); 183extern int sprintf(char *buf, const char *cfmt, ...); --- 117 unchanged lines hidden --- | 187/* disklabel support (undocumented, may be junk) */ 188struct disklabel; 189extern char *getdisklabel(const char *, struct disklabel *); 190extern int dkcksum(struct disklabel *); 191 192extern int printf(const char *fmt, ...); 193extern void vprintf(const char *fmt, _BSD_VA_LIST_); 194extern int sprintf(char *buf, const char *cfmt, ...); --- 117 unchanged lines hidden --- |