00001 #ifndef SYS_INCLUDE_H 00002 #define SYS_INCLUDE_H 00003 /* ========================================================================== ** 00004 * sys_include.h 00005 * 00006 * Copyright (C) 1998 by Christopher R. Hertel 00007 * 00008 * Email: crh@ubiqx.mn.org 00009 * -------------------------------------------------------------------------- ** 00010 * This header provides system declarations and data types used internally 00011 * by the ubiqx modules. 00012 * -------------------------------------------------------------------------- ** 00013 * 00014 * This library is free software; you can redistribute it and/or 00015 * modify it under the terms of the GNU Library General Public 00016 * License as published by the Free Software Foundation; either 00017 * version 2 of the License, or (at your option) any later version. 00018 * 00019 * This library is distributed in the hope that it will be useful, 00020 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00021 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00022 * Library General Public License for more details. 00023 * 00024 * You should have received a copy of the GNU Library General Public 00025 * License along with this library; if not, write to the Free 00026 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00027 * 00028 * -------------------------------------------------------------------------- ** 00029 * 00030 * You may want to replace this file with your own system specific header, 00031 * or you may find that this default header has everything you need. In 00032 * most cases, I expect the latter to be the case. The ubi_* modules were 00033 * written to be as clean as possible. On purpose. There are limits, 00034 * though. Variations in compilers, and competing standards have made it 00035 * difficult to write code that just compiles. In particular, the location 00036 * of a definition of NULL seems to be less than consistant. 00037 * 00038 * This header makes a good attempt to find NULL. If you find that you 00039 * need something more on your system make sure that you keep a copy of 00040 * your version so that it won't be overwritten by updates of the ubiqx 00041 * code. 00042 * 00043 * ========================================================================== ** 00044 */ 00045 00046 /* -------------------------------------------------------------------------- ** 00047 * Looking for NULL. 00048 * 00049 * The core ubiqx modules (all those beginning with 'ubi_') rely on very 00050 * little from the outside world. One exception is that we need a 00051 * defintion for NULL. This has turned out to be something of a problem, 00052 * as NULL is NOT always defined in the same place on different systems. 00053 * 00054 * Ahh... standards... 00055 * 00056 * K&R 2nd Ed. (pg 102) says NULL should be in <stdio.h>. I've heard 00057 * that it is in <locale.h> on some systems. I've also seen it in 00058 * <stddef.h> and <stdlib.h>. In most cases it's defined in multiple 00059 * places. We'll try several of them. If none of these work on your 00060 * system, please send E'mail and let me know where you get your NULL! 00061 * 00062 * The purpose of the mess below, then, is simply to supply a definition 00063 * of NULL to the ubi_*.c files. Keep in mind that C compilers (all 00064 * those of which I'm aware) will allow you to define a constant on the 00065 * command line, eg.: -DNULL=((void *)0). 00066 * 00067 * Also, 99.9% of the time, NULL is zero. I have been informed of at 00068 * least one exception. 00069 * 00070 * crh; may 1998 00071 */ 00072 00073 #ifndef NULL 00074 #include <stddef.h> 00075 #endif 00076 00077 #ifndef NULL 00078 #include <stdlib.h> 00079 #endif 00080 00081 #ifndef NULL 00082 #include <stdio.h> 00083 #endif 00084 00085 #ifndef NULL 00086 #include <locale.h> 00087 #endif 00088 00089 #ifndef NULL 00090 #define NULL ((void *)0) 00091 #endif 00092 00093 /* ================================ The End ================================= */ 00094 #endif /* SYS_INCLUDE_H */