00001 /* 00002 * gawkmisc.c --- miscellanious gawk routines that are OS specific. 00003 */ 00004 00005 /* 00006 * Copyright (C) 1986, 1988, 1989, 1991-2003 the Free Software Foundation, Inc. 00007 * 00008 * This file is part of GAWK, the GNU implementation of the 00009 * AWK Programming Language. 00010 * 00011 * GAWK is free software; you can redistribute it and/or modify 00012 * it under the terms of the GNU General Public License as published by 00013 * the Free Software Foundation; either version 2 of the License, or 00014 * (at your option) any later version. 00015 * 00016 * GAWK is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU General Public License 00022 * along with this program; if not, write to the Free Software 00023 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 00024 */ 00025 00026 #include "awk.h" 00027 00028 #if defined(HAVE_FCNTL_H) 00029 #include <fcntl.h> 00030 #endif 00031 00032 /* some old compilers don't grok #elif. sigh */ 00033 00034 #ifdef __EMX__ 00035 #include "pc/gawkmisc.pc" 00036 #else /* not __EMX__ */ 00037 #if defined(MSDOS) || defined(OS2) || defined(WIN32) 00038 #include "gawkmisc.pc" 00039 #else /* not MSDOS, not OS2, not WIN32 */ 00040 #if defined(VMS) 00041 #include "vms/gawkmisc.vms" 00042 #else /* not VMS */ 00043 #if defined(atarist) 00044 #include "unsupported/atari/gawkmisc.atr" 00045 #else /* not atarist */ 00046 #if defined(TANDEM) 00047 #include "tmiscc" 00048 #else /* not TANDEM */ 00049 #include "posix/gawkmisc.c" 00050 #endif /* not TANDEM */ 00051 #endif /* not atarist */ 00052 #endif /* not VMS */ 00053 #endif /* not MSDOS, not OS2, not WIN32 */ 00054 #endif /* not __EMX__ */ 00055 00056 /* xmalloc --- provide this so that other GNU library routines work */ 00057 00058 #if __STDC__ 00059 typedef void *pointer; 00060 #else 00061 typedef char *pointer; 00062 #endif 00063 00064 extern pointer xmalloc P((size_t bytes)); /* get rid of gcc warning */ 00065 00066 pointer 00067 xmalloc(size_t bytes) 00068 { 00069 pointer p; 00070 00071 emalloc(p, pointer, bytes, "xmalloc"); 00072 00073 return p; 00074 }