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 * $Log: sys_include.h,v $ 00046 * Revision 1.1 2004/01/14 20:27:13 dwarren 00047 * XSB Prolog Profiling as command line option -p 00048 * 00049 * Revision 0.0 1998/06/02 02:20:49 crh 00050 * Initial Revision. 00051 * 00052 * ========================================================================== ** 00053 */ 00054 00055 /* -------------------------------------------------------------------------- ** 00056 * Looking for NULL. 00057 * 00058 * The core ubiqx modules (all those beginning with 'ubi_') rely on very 00059 * little from the outside world. One exception is that we need a 00060 * defintion for NULL. This has turned out to be something of a problem, 00061 * as NULL is NOT always defined in the same place on different systems. 00062 * 00063 * Ahh... standards... 00064 * 00065 * K&R 2nd Ed. (pg 102) says NULL should be in <stdio.h>. I've heard 00066 * that it is in <locale.h> on some systems. I've also seen it in 00067 * <stddef.h> and <stdlib.h>. In most cases it's defined in multiple 00068 * places. We'll try several of them. If none of these work on your 00069 * system, please send E'mail and let me know where you get your NULL! 00070 * 00071 * The purpose of the mess below, then, is simply to supply a definition 00072 * of NULL to the ubi_*.c files. Keep in mind that C compilers (all 00073 * those of which I'm aware) will allow you to define a constant on the 00074 * command line, eg.: -DNULL=((void *)0). 00075 * 00076 * Also, 99.9% of the time, NULL is zero. I have been informed of at 00077 * least one exception. 00078 * 00079 * crh; may 1998 00080 */ 00081 00082 #ifndef NULL 00083 #include <stddef.h> 00084 #endif 00085 00086 #ifndef NULL 00087 #include <stdlib.h> 00088 #endif 00089 00090 #ifndef NULL 00091 #include <stdio.h> 00092 #endif 00093 00094 #ifndef NULL 00095 #include <locale.h> 00096 #endif 00097 00098 #ifndef NULL 00099 #define NULL ((void *)0) 00100 #endif 00101 00102 /* ================================ The End ================================= */ 00103 #endif /* SYS_INCLUDE_H */