/* $Id: cps.h,v 1.1.1.1.4.1 2002/01/17 17:42:51 pwessel Exp $ * * Copyright (c) 1999-2002 by P. Wessel * See COPYING file for copying and redistribution conditions. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * Contact info: www.soest.hawaii.edu/wessel *--------------------------------------------------------------------*/ /* * Include file for CPS package * * Author: Paul Wessel, SOEST, U. of Hawaii * Version: 1.3 * Date: 01-MAR-2000 */ #define _POSIX_SOURCE 1 #include #include #include #include #include #define CPS_FLAG "%%CPS-F: " #define CPS_FLAG_WIDTH 9 #define CPS_VERSION "1.3" #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif /* We use bzip2 to compress files since it compresses * better than gzip. bzip2 is available for all platforms * from sourceware.cygnus.com * We pass the options required to send the output to stdout. * Only a fool would replace bzip2 with gzip below, and * bz2 with gz, but it can be done. */ #define COMPRESS "bzip2 -cf9" #define EXPAND "bzip2 -d" #define SUFFIX "bz2" #ifdef WIN32 /* Under Bill O/S, things are different */ #include #define DIR_DELIM '\\' /* Various Standard C items normally in unistd.h */ #define R_OK 04 #define access(path, mode) _access(path, mode) extern int _access (const char *path, int mode); #define popen(cmd, type) _popen(cmd, type) extern FILE *_popen (const char *cmd, const char *type); #define pclose(fp) _pclose(fp) extern int _pclose (FILE *fp); #define stat(path, buf) _stat(path, buf) #define STAT _stat #define IS_EXECUTABLE _S_IEXEC /* Bit set if file is executable */ #else /* Standard UNIX/LINUX platform */ #define DIR_DELIM '/' #include #define STAT stat #define IS_EXECUTABLE S_IXUSR /* Bit set if file is executable */ #endif /* Declare two non-POSIX (but ANSI-C) functions */ FILE *popen (const char *cmd, const char *type); int pclose (FILE *stream);