Mike, I include below a shar file containing a MAKE.NEXT file and modified dfi.h file that allows the HDF3.10r5 libraries to be compiled on a NeXTstation using 2.1 of the NeXTstep operating system (the latest official release). The dfi.h file should work with all the other platforms also. The main changes are summarized at the top of the MAKE.NEXT file. Henry ================================================================= #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # MAKE.NEXT # dfi.h # This archive created: Mon Oct 28 13:49:02 1991 # By: Henry Greenside (hsg@cs.duke.edu) # Duke University CS Dept. export PATH; PATH=/bin:$PATH if test -f 'MAKE.NEXT' then echo shar: will not over-write existing file "'MAKE.NEXT'" else cat << \SHAR_EOF > 'MAKE.NEXT' # # $Header: /pita/work/HDF/dev/RCS/src/MAKE.NEXT,v 1.4 1991/10/24 22:38:35 dilg beta $ # # Modification of MAKE.SUN by H. S. Greenside, 10/26/91. # 1. Define MACHINE to be NeXT # 2. Removed dependencies on Fortran files, since # typical NeXT user will use C or f2c. # 3. In file dfi.h, added statements to avoid definitions of malloc # and memcpy, which conflict with definitions in stdlib.h and # in /usr/include/string.h respectively. # 4. This Makefile works correctly on a NeXtstation using version # 2.1 of NeXTstep. # # $Log: MAKE.SUN,v $ # Revision 1.4 1991/10/24 22:38:35 dilg # Removed showr24 and showr8 from utilities sections. # # Revision 1.3 1991/10/24 20:06:15 dilg # Removed hdfslice as a utility. # # Revision 1.2 1991/10/24 18:32:19 dilg # Automated machine type setting in dfi.h # # Revision 1.1 1991/10/22 17:56:10 dilg # Initial revision # # #***************************************************************************** # # All NCSA HDF source code and documentation are in the public domain. # See notice at the top of ../README.FIRST file for further conditions. # #***************************************************************************** # Makefile for a NeXTstation # Makefile for compiling HDF routines, and installing the files # produced MACHINE=NeXT # SRCDIR, INCDIR, LIBDIR and BINDIR must be set to the desired values # then, make build will compile source files make install will move # files to include, bin and lib directories make cleanup will delete # the .o files produced A make dist is also defined. This will move # source files to SRCDIR However, it is expected that make will # usually be run from SRCDIR Hence, install is provided separately # directories to install source files, include files, libraries and # utilities in Modify this line as appropriate for your system SRCDIR=. INCDIR=../include LIBDIR=../lib BINDIR=../bin # Note: hdfseq works only on SUNs with the appropriate libraries and # include files, which are invoked through pixrect files. This includes # sunview files (e.g. sunview/cms.h). Recent SUN software does not # include all of the necessary files, or they may be stored elsewhere. # If you have a SUN that includes these files, set "GLIBS = -lpixrect", # and if necessary modify the -I option to find the .h files. # Otherwise (including all non-SUNS) set "GLIBS = " GLIBS= #GLIBS = -lpixrect LIBS = libdf.a CC = cc FC = f77 AR = ar RM = /bin/rm -f RANLIB = ranlib -s DEFS = -D${MACHINE} CFLAGS = -O ${DEFS} FFLAGS = -O ARFLAGS = r LDFLAGS = HFILES= df.h dfi.h df24.h dfcomp.h dfgroup.h dfkit.h dfp.h dfr8.h \ dfufp2im.h dfutil.h dfsd.h dfan.h dfgr.h dfconvrt.h dfimcomp.h \ dfrig.h dfversio.h CFILES= df.c dfr8.c dfgroup.c dfcomp.c dfimcomp.c \ dfsd.c dfF.c dfr8F.c dfsdF.c dfkit.c dfp.c dfan.c \ dfgr.c df24.c df24F.c dfpF.c dfanF.c dfufp2im.c \ dfutil.c dfutilF.c dfversio.c FFILES= dfFf.f dfr8Ff.f dfsdFf.f dfanFf.f df24Ff.f dfpFf.f \ dfufp2imFf.f UFILES= hdfcomp.c hdftotek.c tektohdf.c hdftor8.c \ r8tohdf.c hdfls.c hdftopal.c paltohdf.c r24hdf8.c \ hdf24to8.c hdfpack.c ristosds.c COBJS= df.o dfr8.o dfsd.o dfgroup.o dfcomp.o dfimcomp.o dfkit.o \ dfp.o dfan.o dfgr.o df24.o dfufp2im.o dfutil.o dfversio.o FOBJS= dfF.o dfr8F.o dfsdF.o dfanF.o dfFf.o dfr8Ff.o dfsdFf.o dfanFf.o \ df24F.o df24Ff.o dfpFf.o dfpF.o dfufp2imFf.o dfutilF.o #OBJS= ${COBJS} ${FOBJS} OBJS= ${COBJS} UTILS= hdfls r8tohdf hdfcomp hdftotek tektohdf hdftor8 hdftopal \ paltohdf r24hdf8 hdf24to8 hdfpack ristosds all: libdf.a utils install allnostub: libnostub utils install build: libdf.a utils buildnostub: libnostub utils libdf.a: ${OBJS} -${RM} libdf.a libnostub ${AR} ${ARFLAGS} libdf.a ${OBJS} ${RANLIB} libdf.a libnostub: ${COBJS} -${RM} libdf.a libnostub ${AR} ${ARFLAGS} libdf.a ${COBJS} ${RANLIB} libdf.a touch libnostub utils: ${UTILS} df.o: df.h dfkit.h dfi.h dfF.o: df.h dfkit.h dfi.h df24.o: df.h dfkit.h dfi.h dfgr.h df24.h df24F.o: df.h dfkit.h dfi.h dfgr.h df24.h dfan.o: df.h dfkit.h dfi.h dfan.h dfanF.o: df.h dfkit.h dfi.h dfan.h dfcomp.o: df.h dfkit.h dfi.h dfcomp.h dfimcomp.h dfgr.o: df.h dfkit.h dfi.h dfgr.h dfgroup.h dfcomp.h dfgroup.o: df.h dfkit.h dfi.h dfgroup.h dfimcomp.o: df.h dfkit.h dfi.h dfimcomp.h dfkit.o: df.h dfkit.h dfi.h dfconvrt.h dfp.o: df.h dfkit.h dfi.h dfp.h dfpF.o: df.h dfkit.h dfi.h dfp.h dfr8.o: df.h dfkit.h dfi.h dfgroup.h dfcomp.h dfr8.h dfr8F.o: df.h dfkit.h dfi.h dfr8.h dfsd.o: df.h dfkit.h dfi.h dfgroup.h dfconvrt.h dfsd.h dfsdF.o: df.h dfkit.h dfi.h dfsd.h dfutil.o: df.h dfkit.h dfi.h dfutil.h dfutilF.o: df.h dfkit.h dfi.h dfutil.h dfversio.o: df.h dfkit.h dfi.h dfversio.h # this default rule is in here because the original default rule # places the c-filename behind the LDFLAGS causing the brain-damaged # ld to chock $(UTILS): df.h dfi.h ${CC} ${CFLAGS} $@.c ${LDFLAGS} ${LIBS} ${GLIBS} -o $@ # dist will move files from current directory to source directory # install will move files from current dir to bin, lib and include directories # It is expected that make will usually run in srcdir, so only install and # cleanup will be necessary #dist: $(HFILES) $(CFILES) $(FFILES) Makefile # cp $(HFILES) $(CFILES) $(FFILES) $(UFILES) Makefile $(SRCDIR) dist: $(HFILES) $(CFILES) Makefile cp $(HFILES) $(CFILES) $(UFILES) Makefile $(SRCDIR) install: -sed -e '\?\/\* &&& Replace this line with \#define MachineType &&& \*\/?c\ \#define SUN' < dfi.h > dfitemp.h mv dfitemp.h dfi.h -mkdir $(INCDIR) cp $(HFILES) $(INCDIR) -mkdir $(LIBDIR) cp $(LIBS) $(LIBDIR) ranlib $(LIBDIR)/* -mkdir $(BINDIR) cp $(UTILS) $(BINDIR) clean: -${RM} *.o cleanup: -${RM} $(OFILES) $(LIBS) $(UTILS) lint: lint -u -D$(MACHINE) $(CFILES) saber: #load -D$(MACHINE) $(CFILES) .DEFAULT:: hdfrcs src co $@ #libsrc: $(HFILES) $(CFILES) $(FFILES) libsrc: $(HFILES) $(CFILES) src: libsrc $(UFILES) SHAR_EOF fi # end of overwriting check if test -f 'dfi.h' then echo shar: will not over-write existing file "'dfi.h'" else cat << \SHAR_EOF > 'dfi.h' /* Modified to remove definiton of memcopy on NeXT machines */ /***************************************************************************** * * NCSA HDF version 3.10r5 * October 24, 1991 * * NCSA HDF Version 3.10r5 source code and documentation are in the public * domain. Specifically, we give to the public domain all rights for future * licensing of the source code, all resale rights, and all publishing rights. * * We ask, but do not require, that the following message be included in all * derived works: * * Portions developed at the National Center for Supercomputing Applications at * the University of Illinois at Urbana-Champaign. * * THE UNIVERSITY OF ILLINOIS GIVES NO WARRANTY, EXPRESSED OR IMPLIED, FOR THE * SOFTWARE AND/OR DOCUMENTATION PROVIDED, INCLUDING, WITHOUT LIMITATION, * WARRANTY OF MERCHANTABILITY AND WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE * *****************************************************************************/ #ifdef RCSID static char RcsId[] = "@(#)$Revision: 3.19 $" #endif /* $Header: /pita/work/HDF/dev/RCS/src/dfi.h,v 3.19 1991/10/24 20:46:06 dilg beta $ $Log: dfi.h,v $ * Revision 3.19 1991/10/24 20:46:06 dilg * Put malloc() back into #ifndef UNICOS. * * Revision 3.18 1991/10/23 22:08:56 dilg * Changed machine type definition line so the make can use sed to set the * machine type * * Revision 3.17 1991/10/22 17:56:10 dilg * 5 * HDF3.1r5 * * New machine types added: * * PC - IBM PC (DOS) * WIN - IBM PC (Microsoft Windows 3.0) * IBM6000 - IBM RS/6000 (AIX) * CONVEX - Convex C-2 (Unix) * * Bugs fixed in: * * scup32.f * cspck32.f * dfpFf.f * dfpF.c * dfsd.c * * New utility added: * * ristosds.c - convert raster images to sds. * * Also: * All code for the library was modified to conform to the * ANSI C standard. * * Revision 3.16 1991/06/21 11:56:26 dilg * Removed malloc() from the #ifndef UNICOS at the end of the file. * * Revision 3.15 91/05/21 12:25:57 dilg * Changed #include to #include in UNICOS section and * put #ifndef UNICOS - #endif around redefinitions of strncpy(), strcpy(), * malloc(), and memcpy() at end of file. Needed because of change to * UNICOS 6.X. * * Revision 3.14 90/10/02 14:16:49 clow * fixed error in the define of DFmovmem in the MIPSEL segment * * Revision 3.13 90/09/18 15:09:10 clow * Added MIPSEL to 'list of approved machine types' * * Revision 3.12 90/09/14 12:49:07 mfolk * *** empty log message *** * * Revision 3.11 90/08/30 14:51:59 mfolk * Add DFMT_MIPSEL 0x4441 machine type and #ifdef section for MIPSEL. * This should cover DEC3100 needs. * * Revision 3.10 90/07/31 13:30:15 mfolk * Added typedef double float64; to all machine types, so that this * dfi.h would work with fp2hdf as changed by INEL. (Mike Folk) * * Revision 3.9 90/07/16 11:25:56 clow * added #if's so that the compiler will complain if MACHINE is set wrongly. * * Revision 3.8 90/07/05 17:00:08 clow * Changed the lower value of DF_TBUF 512 * * Revision 3.7 90/06/28 09:41:26 clow * Added segment for APOLLO machines * * Revision 3.6 90/05/23 15:47:37 clow * added MACRO "DF_OPENERR" to give uniform error open checking, * especially for unbufferred I/O open * * Revision 3.5 90/05/18 11:09:12 clow * added missing #endif * * Revision 3.4 90/05/17 17:06:00 clow * added _fcd and _fcdtocp for LS FORTRAN so we don't have to go through * an extra layer of Fortran stubs * * Revision 3.4 90/05/17 16:04:14 clow * added _fcd and _fcdtocp for LS FORTRAN so we don't have to go through * an extra layer of Fortran stubs * * Revision 3.3 90/05/14 23:15:45 clow * added definition of MACRO "FCALLKEYW" * */ /*----------------------------------------------------------------------------- * File: dfi.h * Purpose: HDF internal header file * Invokes: stdio.h, sys/file.h * Contents: * Compilation parameters * Machine-dependent definitions * Flexibility definitions: i/o buffering, dynamic memory, structure i/o * Size parameters * Remarks: To port to a new system, only dfi.h and Makefile need be modified. * This file is included with user programs, but users do not see it. *---------------------------------------------------------------------------*/ #ifndef DF_MAGICK /* avoid re-inclusion */ #define DF_MAGICK "\016\003\023\001" /* ^N^C^S^A */ /*--------------------------------------------------------------------------*/ /* Compilation Parameters for Flexibility and Portability */ #define SUN /**IMPORTANT** this is now in the in the makefile */ #if !defined(SUN) && !defined(SUN386) && !defined(VMS) && !defined(ALLIANT) #if !defined(IRIS4) && !defined(MAC) && !defined(UNICOS) && !defined(MIPSEL) #if !defined(PC) && !defined(WIN3) && !defined(CONVEX) && !defined(IBM6000) #if !defined(APOLLO) if there is error on this line, the MACHINE type is defined wrong!!! #endif #endif #endif #endif /* modify this line for buffered/unbuffered i/o */ #define DF_BUFFIO /* modify this line for dynamic/static memory allocation */ #define DF_DYNAMIC /* modify this line if structures cannot be read/written as is */ #undef DF_STRUCTOK /* leave it this way - hdfsh expects it */ /* Current version number */ #define DFVERSION 3.10 /*--------------------------------------------------------------------------*/ /* MT/NT constants */ /* four MT nibbles represent int, float, double, uchar */ #define DFMT_SUN 0x1111 #define DFMT_ALLIANT 0x1111 #define DFMT_IRIS4 0x1111 #define DFMT_APOLLO 0x1111 #define DFMT_IBM6000 0x1111 #define DFMT_CONVEX 0x1111 /* only IEEE mode currently supported */ #define DFMT_UNICOS 0x3331 #define DFMT_CTSS 0x3331 #define DFMT_VAX 0x2221 #define DFMT_MIPSEL 0x4441 #define DFMT_PC 0x4444 #define DFMT_MAC 0x1111 #define DFMT_SUN386 0x1444 #define DFNT_VERSION 1 /* current version of NT info */ /* type info codes */ #define DFNT_UINT 1 #define DFNT_INT 2 #define DFNT_UCHAR 3 #define DFNT_CHAR 4 #define DFNT_FLOAT 5 #define DFNT_DOUBLE 6 /* class info codes for int */ #define DFNTI_MBO 1 /* Motorola byte order 2's compl */ #define DFNTI_VBO 2 /* Vax byte order 2's compl */ #define DFNTI_IBO 4 /* Intel byte order 2's compl */ /* class info codes for float */ #define DFNTF_IEEE 1 /* IEEE format */ #define DFNTF_VAX 2 /* Vax format */ #define DFNTF_CRAY 3 /* Cray format */ #define DFNTF_PC 4 /* PC floats - flipped IEEE */ /* class info codes for char */ #define DFNTC_BYTE 0 /* bitwise/numeric field */ #define DFNTC_ASCII 1 /* ASCII */ #define DFNTC_EBCDIC 5 /* EBCDIC */ /* array order */ #define DFO_FORTRAN 1 /* column major order */ #define DFO_C 2 /* row major order */ /*--------------------------------------------------------------------------*/ /* Machine dependencies */ #ifdef WIN3 #define PC #endif /* WIN3 */ #ifdef PC #ifdef WIN3 #ifndef GMEM_MOVEABLE /* check if windows header is already included */ #include /* include the windows headers */ #endif #endif /* WIN3 */ #ifndef O_RDONLY #include #include /* for unbuffered file I/O */ #include #include #include /* for malloc() */ #include #include /* for debugging getch() calls */ #include /* for vaious string functions */ #define L_INCR 1 #endif /* O_RDONLY */ typedef char int8; typedef unsigned char uint8; typedef int int16; typedef unsigned int uint16; typedef long int int32; typedef unsigned long int uint32; typedef float float32; typedef double float64; #ifdef WIN3 #define DFmovmem(from, to, len) _fmemmove(to, from, len) #else #define DFmovmem(from, to, len) memcpy(to, from, len) #endif /* WIN3 */ #undef DF_STRUCTOK /* structure writing will not work on PC */ #undef DF_BUFFIO /* unbuffered i/o is faster */ long longswap(); /* provided elsewhere */ /* in the next 3 lines, p is recast so right number of bytes passed */ /* ### Note that all calls modify p. Need to use temporary ptr */ #ifdef WIN3 #define UINT16READ(p, x) { x =((uint16)(*p) &255)<<8; p++; x |=(*p) &255; p++; } #else #define UINT16READ(p, x) { x = ((*p++) & 255)<<8; x |= (*p++) & 255; } #endif /* WIN3 */ #define INT16READ(p, x) { x = (*p++)<<8; x |= (*p++) & 255; } #define INT32READ(p, x) { x = ((int32)(*p++))<<24; \ x |= (((int32)(*p++)) & 255)<<16; \ x |= ((int32)((*p++) & 255))<<8; \ x |= (int32)(*p++) & 255; } #define UINT16WRITE(p, x) { *p++ = (uint8)((x>>8) & 255); \ *p++ = (uint8)(x & 255); } #define INT16WRITE(p, x) { *p++ = (uint8)((x>>8) & 255); \ *p++ = (uint8)(x & 255); } #define INT32WRITE(p, x) { *p++ = (uint8)((x>>24) & 255); \ *p++ = (uint8)((x>>16) & 255); \ *p++ = (uint8)((x>>8) & 255); \ *p++ = (uint8)(x & 255); } #ifdef WIN3 #define DF_CREAT(name, prot) _lcreat((LPSTR)name, 0) #else #define DF_CREAT(name, prot) creat(name, S_IREAD|S_IWRITE) #endif /* WIN3 */ #define DF_MT DFMT_PC #endif /*PC*/ #ifdef UNICOS #ifndef O_RDONLY #include /* for unbuffered i/o stuff */ #define L_INCR 1 #endif /*O_RDONLY*/ typedef char int8; typedef unsigned char uint8; typedef int int16; typedef unsigned int uint16; typedef int int32; typedef unsigned int uint32; typedef float float32; typedef double float64; #define DFmovmem(from, to, len) memcpy(to, from, len) #undef DF_STRUCTOK /* cannot directly read/write structures */ #define DF_CAPFNAMES /* fortran names are in all caps */ #define UINT16READ(p, x) { x = ((*p++) & 255)<<8; x |= (*p++) & 255; } #define INT16READ(p, x) { x = (*p++)<<8; x |= (*p++) & 255; } #define INT32READ(p, x) { x = (*p++)<<24; x|=((*p++) & 255)<<16; \ x|=((*p++) & 255)<<8; x|=(*p++) & 255; } #define UINT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; } #define INT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; } #define INT32WRITE(p, x) { *p++ = (x>>24) & 255; *p++ = (x>>16) & 255; \ *p++ = (x>>8) & 255; *p++ = x & 255; } #define DF_CREAT(name, prot) creat(name, prot) #define DF_MT DFMT_UNICOS #endif /*UNICOS*/ #ifdef SUN #if ! defined mc68010 && ! defined mc68020 && ! defined mc68030 #undef DF_STRUCTOK #endif #include /* for unbuffered i/o stuff */ typedef char int8; typedef unsigned char uint8; typedef short int int16; typedef unsigned short int uint16; typedef long int int32; typedef unsigned long int uint32; typedef float float32; typedef double float64; #define DFmovmem(from, to, len) memcpy(to, from, len) #ifndef DF_STRUCTOK #define UINT16READ(p, x) { x = ((*p++) & 255)<<8; x |= (*p++) & 255; } #define INT16READ(p, x) { x = (*p++)<<8; x |= (*p++) & 255; } #define INT32READ(p, x) { x = (*p++)<<24; x|=((*p++) & 255)<<16; \ x|=((*p++) & 255)<<8; x|=(*p++) & 255; } #define UINT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; } #define INT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; } #define INT32WRITE(p, x) { *p++ = (x>>24) & 255; *p++ = (x>>16) & 255; \ *p++ = (x>>8) & 255; *p++ = x & 255; } #endif /*DF_STRUCTOK*/ #define DF_CREAT(name, prot) creat(name, prot) #define DF_MT DFMT_SUN #endif /*SUN*/ #ifdef SUN386 #undef DF_STRUCTOK #include /* for unbuffered i/o stuff */ typedef char int8; typedef unsigned char uint8; typedef short int int16; typedef unsigned short int uint16; typedef long int int32; typedef unsigned long int uint32; typedef float float32; typedef double float64; #define DFmovmem(from, to, len) memcpy(to, from, len) #ifndef DF_STRUCTOK #define UINT16READ(p, x) { x = ((*p++) & 255)<<8; x |= (*p++) & 255; } #define INT16READ(p, x) { x = (*p++)<<8; x |= (*p++) & 255; } #define INT32READ(p, x) { x = (*p++)<<24; x|=((*p++) & 255)<<16; \ x|=((*p++) & 255)<<8; x|=(*p++) & 255; } #define UINT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; } #define INT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; } #define INT32WRITE(p, x) { *p++ = (x>>24) & 255; *p++ = (x>>16) & 255; \ *p++ = (x>>8) & 255; *p++ = x & 255; } #endif /*DF_STRUCTOK*/ #define DF_CREAT(name, prot) creat(name, prot) #define DF_MT DFMT_SUN386 #endif /* SUN386 */ #ifdef ALLIANT #include /* for unbuffered i/o stuff */ typedef char int8; typedef unsigned char uint8; typedef short int int16; typedef unsigned short int uint16; typedef long int int32; typedef unsigned long int uint32; typedef float float32; typedef double float64; #define DFmovmem(from, to, len) bcopy(from, to, len) #ifndef DF_STRUCTOK #define UINT16READ(p, x) { x = ((*p++) & 255)<<8; x |= (*p++) & 255; } #define INT16READ(p, x) { x = (*p++)<<8; x |= (*p++) & 255; } #define INT32READ(p, x) { x = (*p++)<<24; x|=((*p++) & 255)<<16; \ x|=((*p++) & 255)<<8; x|=(*p++) & 255; } #define UINT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; } #define INT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; } #define INT32WRITE(p, x) { *p++ = (x>>24) & 255; *p++ = (x>>16) & 255; \ *p++ = (x>>8) & 255; *p++ = x & 255; } #endif /*DF_STRUCTOK*/ #define DF_CREAT(name, prot) creat(name, prot) #define DF_MT DFMT_ALLIANT #endif /*ALLIANT*/ #ifdef CONVEX /* jwf added */ #include /* for unbuffered i/o stuff */ #include typedef char int8; typedef unsigned char uint8; typedef short int16; typedef unsigned short uint16; typedef long int32; typedef unsigned long int uint32; typedef float float32; typedef double float64; #define DFmovmem(from, to, len) bcopy(from, to, len) #undef DF_STRUCTOK #define UINT16READ(p, x) { x = ((*p++) & 255)<<8; x |= (*p++) & 255; } #define INT16READ(p, x) { x = (*p++)<<8; x |= (*p++) & 255; } #define INT32READ(p, x) { x = (*p++)<<24; x|=((*p++) & 255)<<16; \ x|=((*p++) & 255)<<8; x|=(*p++) & 255; } #define UINT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; } #define INT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; } #define INT32WRITE(p, x) { *p++ = (x>>24) & 255; *p++ = (x>>16) & 255; \ *p++ = (x>>8) & 255; *p++ = x & 255; } #define DF_CREAT(name, prot) creat(name, prot) #define DF_MT DFMT_CONVEX #endif /*CONVEX */ #ifdef IRIS4 #undef DF_STRUCTOK #include #include /* for unbuffered i/o stuff */ typedef char int8; typedef unsigned char uint8; typedef short int int16; typedef unsigned short int uint16; typedef long int int32; typedef unsigned long int uint32; typedef float float32; typedef double float64; #define DFmovmem(from, to, len) bcopy(from, to, len) #ifndef DF_STRUCTOK #define UINT16READ(p, x) { x = ((*p++) & 255)<<8; x |= (*p++) & 255; } #define INT16READ(p, x) { x = (*p++)<<8; x |= (*p++) & 255; } #define INT32READ(p, x) { x = (*p++)<<24; x|=((*p++) & 255)<<16; \ x|=((*p++) & 255)<<8; x|=(*p++) & 255; } #define UINT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; } #define INT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; } #define INT32WRITE(p, x) { *p++ = (x>>24) & 255; *p++ = (x>>16) & 255; \ *p++ = (x>>8) & 255; *p++ = x & 255; } #endif /*DF_STRUCTOK*/ #define DF_CREAT(name, prot) creat(name, prot) #define DF_MT DFMT_IRIS4 #endif /*IRIS4*/ #ifdef MIPSEL #undef DF_STRUCTOK #include #include /* for unbuffered i/o stuff */ typedef char int8; typedef unsigned char uint8; typedef short int int16; typedef unsigned short int uint16; typedef long int int32; typedef unsigned long int uint32; typedef float float32; typedef double float64; #define DFmovmem(from, to, len) memcpy(to, from, len) #ifndef DF_STRUCTOK #define UINT16READ(p, x) { x = ((*p++) & 255)<<8; x |= (*p++) & 255; } #define INT16READ(p, x) { x = (*p++)<<8; x |= (*p++) & 255; } #define INT32READ(p, x) { x = (*p++)<<24; x|=((*p++) & 255)<<16; \ x|=((*p++) & 255)<<8; x|=(*p++) & 255; } #define UINT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; } #define INT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; } #define INT32WRITE(p, x) { *p++ = (x>>24) & 255; *p++ = (x>>16) & 255; \ *p++ = (x>>8) & 255; *p++ = x & 255; } #endif /*DF_STRUCTOK*/ #define DF_CREAT(name, prot) creat(name, prot) #define DF_MT DFMT_MIPSEL #endif /*MIPSEL*/ #ifdef IBM6000 /* NOTE: IBM6000 defines are same as for SUN */ #if ! defined mc68010 && ! defined mc68020 && ! defined mc68030 #undef DF_STRUCTOK #endif #include /* for unbuffered i/o stuff */ typedef char int8; typedef unsigned char uint8; typedef short int int16; typedef unsigned short int uint16; typedef long int int32; typedef unsigned long int uint32; typedef float float32; typedef double float64; #define DFmovmem(from, to, len) memcpy(to, from, len) #ifndef DF_STRUCTOK #define UINT16READ(p, x) { x = ((*p++) & 255)<<8; x |= (*p++) & 255; } #define INT16READ(p, x) { x = (*p++)<<8; x |= (*p++) & 255; } #define INT32READ(p, x) { x = (*p++)<<24; x|=((*p++) & 255)<<16; \ x|=((*p++) & 255)<<8; x|=(*p++) & 255; } #define UINT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; } #define INT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; } #define INT32WRITE(p, x) { *p++ = (x>>24) & 255; *p++ = (x>>16) & 255; \ *p++ = (x>>8) & 255; *p++ = x & 255; } #endif /*DF_STRUCTOK*/ #define DF_CREAT(name, prot) creat(name, prot) #define DF_MT DFMT_IBM6000 #endif /*IBM6000*/ #ifdef MAC #undef DF_BUFFIO /* use unbuffered i/o */ #include /* malloc stuff for MPW 3.0 */ #include /* unbuffered IO stuff for MPW 3.0 */ #ifdef THINK_C /* for LightSpeed C */ #include #else /*THINK_C MPW, possibly others */ #include /* for unbuffered i/o stuff */ #endif /*THINK_C*/ #define DF_CAPFNAMES /* fortran names are in all caps */ #define DF_DYNAMIC /* use dynamic allocation */ typedef char int8; typedef unsigned char uint8; typedef short int int16; typedef unsigned short int uint16; typedef long int int32; typedef unsigned long int uint32; typedef float float32; typedef double float64; #ifdef THINK_C /* LightSpeed C does not have memcpy */ #define DFmovmem(from, to, len) DFImemcopy(from, to, len) #else /*THINK_C*/ #define DFmovmem(from, to, len) memcpy(to, from, len) #endif /*THINK_C*/ #define malloc(x) NewPtr((Size) (x)) /* don't use malloc on the Mac */ #define free(x) DisposPtr((Ptr) (x)) /* don't use free on the Nac */ #undef DF_STRUCTOK #define UINT16READ(p, x) { x = ((*p++) & 255)<<8; x |= (*p++) & 255; } #define INT16READ(p, x) { x = (*p++)<<8; x |= (*p++) & 255; } #define INT32READ(p, x) { x = (*p++)<<24; x|=((*p++) & 255)<<16; \ x|=((*p++) & 255)<<8; x|=(*p++) & 255; } #define UINT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; } #define INT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; } #define INT32WRITE(p, x) { *p++ = (x>>24) & 255; *p++ = (x>>16) & 255; \ *p++ = (x>>8) & 255; *p++ = x & 255; } #define DF_CREAT(name, prot) mopen(name, O_WRONLY|O_TRUNC|O_CREAT) #define DF_MT DFMT_MAC #endif /*MAC*/ #ifdef VMS /*#undef DF_BUFFIO should be buff !!!!*/ /* use only unbuff i/o - buff doesn't work! */ #ifndef DFopen /* avoid double includes */ #include "dfivms.h" #endif /*DFopen*/ #undef DF_STRUCTOK #define DF_CAPFNAMES /* fortran names are in all caps */ #include /* for unbuffered i/o stuff */ typedef char int8; typedef unsigned char uint8; typedef short int int16; typedef unsigned short int uint16; typedef long int int32; typedef unsigned long int uint32; typedef float float32; typedef double float64; #define DFmovmem(from, to, len) memcpy(to, from, len) #ifndef DF_STRUCTOK #define UINT16READ(p, x) { x = ((*p++) & 255)<<8; x |= (*p++) & 255; } #define INT16READ(p, x) { x = (*p++)<<8; x |= (*p++) & 255; } #define INT32READ(p, x) { x = (*p++)<<24; x|=((*p++) & 255)<<16; \ x|=((*p++) & 255)<<8; x|=(*p++) & 255; } #define UINT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; } #define INT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; } #define INT32WRITE(p, x) { *p++ = (x>>24) & 255; *p++ = (x>>16) & 255; \ *p++ = (x>>8) & 255; *p++ = x & 255; } #endif /*DF_STRUCTOK*/ #define DF_CREAT(name, prot) creat(name, prot) #define DF_MT DFMT_VAX #endif /*VMS*/ #ifdef APOLLO #if ! defined mc68010 && ! defined mc68020 && ! defined mc68030 #undef DF_STRUCTOK #endif #include /* for unbuffered i/o stuff */ #define int8 char #define uint8 unsigned char #define int16 short int #define uint16 unsigned short int #define int32 long int #define uint32 unsigned long int #define float32 float #define DFmovmem(from, to, len) memcpy(to, from, len) #ifndef DF_STRUCTOK #define UINT16READ(p, x) { x = ((*p++) & 255)<<8; x |= (*p++) & 255; } #define INT16READ(p, x) { x = (*p++)<<8; x |= (*p++) & 255; } #define INT32READ(p, x) { x = (*p++)<<24; x|=((*p++) & 255)<<16; \ x|=((*p++) & 255)<<8; x|=(*p++) & 255; } #define UINT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; } #define INT16WRITE(p, x) { *p++ = (x>>8) & 255; *p++ = x & 255; } #define INT32WRITE(p, x) { *p++ = (x>>24) & 255; *p++ = (x>>16) & 255; \ *p++ = (x>>8) & 255; *p++ = x & 255; } #endif /*DF_STRUCTOK*/ #define DF_CREAT(name, prot) creat(name, prot) #define DF_MT DFMT_APOLLO #endif /*APOLLO*/ /*--------------------------------------------------------------------------*/ /* Flexibility parameters */ #ifdef MAC /* MAC specific file manager calls */ # define DF_OPEN(x,y) mopen(x,y) # define DF_CLOSE(x) mclose(x) # define DF_SEEK(x,y,z) mlseek(x,y,z) # define DF_SKEND(x,y,z) mlseek(x,-1*y,z) # define DF_TELL(x) mlseek(x,0L,1) # define DF_READ(a,b,c,d) mread(d,a,b*c) # define DF_WRITE(a,b,c,d) mwrite(d,a,b*c) # define DF_FLUSH(a) /* no need to flush */ # define DF_RDACCESS 0 /* dummy */ # define DF_WRACCESS 0 /* dummy */ # define DF_OPENERR(f) ((f) == -1) #else /* !MAC */ #ifdef DF_BUFFIO /* set all calls to do buffered I/O */ #define DF_OPEN(x,y) fopen(x,y) #define DF_CLOSE(x) fclose(x) #define DF_SEEK(x,y,z) fseek(x,y,z) #define DF_SKEND(x,y,z) fseek(x,y,z) #define DF_TELL(x) ftell(x) #define DF_READ(a,b,c,d) fread(a,b,c,d) #define DF_WRITE(a,b,c,d) fwrite(a,b,c,d) #define DF_FLUSH(a) fflush(a) #define DF_OPENERR(f) (!(f)) #ifdef PC #define DF_RDACCESS "rb" #define DF_WRACCESS "rb+" #else /*PC*/ #define DF_RDACCESS "r" #define DF_WRACCESS "r+" #endif /*PC*/ #else /*DF_BUFFIO unbuffered i/o */ #ifdef PC #ifdef WIN3 #define DF_OPEN(x,y) _lopen((LPSTR)(x),(int)(y)) #define DF_CLOSE(x) _lclose((int)(x)) #define DF_SEEK(x,y,z) _llseek((int)(x),(LONG)(y),(int)(z)) #define DF_SKEND(x,y,z) _llseek((int)(x),(LONG)(-1*(y)),(int)(z)) #define DF_TELL(x) _llseek((int)(x),(LONG)0L,(int)1) #define DF_READ(a,b,c,d) _lread((int)(d),(LPSTR)(a),(WORD)((WORD)(b)*(WORD)(c))) #define DF_WRITE(a,b,c,d) _lwrite((int)(d),(LPSTR)(a),(WORD)((WORD)(b)*(WORD)(c))) #define DF_OPENERR(f) ((f) == -1) #define DF_FLUSH(a) /* no need to flush */ #define DF_RDACCESS OF_READ #define DF_WRACCESS OF_READWRITE #else #define DF_OPEN(x,y) open(x,y,S_IWRITE|S_IREAD) #define DF_CLOSE(x) close(x) #define DF_SEEK(x,y,z) lseek(x,y,z) #define DF_SKEND(x,y,z) lseek(x,-1*y,z) #define DF_TELL(x) lseek(x,0L,1) #define DF_READ(a,b,c,d) read(d,a,b*c) #define DF_WRITE(a,b,c,d) write(d,a,b*c) #define DF_OPENERR(f) ((f) == -1) #define DF_FLUSH(a) /* no need to flush */ #define DF_RDACCESS O_RDONLY | O_BINARY #define DF_WRACCESS O_RDWR | O_BINARY #endif #else #define DF_OPEN(x,y) open(x,y) #define DF_CLOSE(x) close(x) #define DF_SEEK(x,y,z) lseek(x,y,z) #define DF_SKEND(x,y,z) lseek(x,-1*y,z) #define DF_TELL(x) lseek(x,0L,1) #define DF_READ(a,b,c,d) read(d,a,b*c) #define DF_WRITE(a,b,c,d) write(d,a,b*c) #define DF_OPENERR(f) ((f) == -1) #define DF_FLUSH(a) /* no need to flush */ #define DF_RDACCESS O_RDONLY #define DF_WRACCESS O_RDWR #endif /* PC */ #endif /* DF_BUFFIO */ #endif /* !MAC */ /* if not allocating memory dynamically, need buffer for compression */ #ifndef DF_DYNAMIC #define DF_TBUF #define DF_TBUFSZ 10000 /* buffer size */ #endif /*DF_DYNAMIC*/ /* if reading/writing structures not ok, need buffer for conversion */ #ifndef DF_TBUF #ifndef DF_STRUCTOK #define DF_TBUF #define DF_TBUFSZ 512 /* buffer size can be smaller */ #endif /*DF_STRUCTOK*/ #endif /*DF_TBUF*/ /* set buffer size */ #ifdef DF_TBUF #ifndef DFMASTER extern #endif /*DFMASTER*/ char DFtbuf[DF_TBUFSZ]; #endif /*DF_TBUF*/ /* VMS str descriptor conversion macro */ #if defined(VMS) # define _fcdtocp(desc) ((char *) *((char **) &desc[4])) typedef char *_fcd; #else /* !VMS */ #if defined(UNICOS) # include #else /* !VMS && !UNICOS */ #if defined(MAC) /* with LS_FORTRAN */ # define _fcdtocp(descp) (*((char**)(descp))) typedef char** _fcd; #else /* !VMS && !UNICOS && !MAC */ # define _fcdtocp(desc) (desc) typedef char *_fcd; #endif #endif /* !VMS && !UNICOS */ #endif /* !VMS */ /* MACRO FCALLKEYW for any special fortran-C stub keyword MacIntosh MPW LS-fortran needs pascal since it can interface best with pascal functions */ #if defined(MAC) /* with LS FORTRAN */ # define FCALLKEYW pascal #else /* !MAC */ # define FCALLKEYW /*NONE*/ #endif #ifndef PC #ifndef MAC #ifndef IBM6000 #ifndef CONVEX #ifndef UNICOS char *strncpy(); char *strcpy(); char *malloc(); #ifndef NeXT char *memcpy(); #endif /* !NeXT */ #endif /* !UNICOS */ #endif /* !CONVEX */ #endif /* !IBM6000 */ #endif /* !MAC */ #endif /* !PC */ /*--------------------------------------------------------------------------*/ /* Size parameters */ #define DF_MAXDFS 32 /* How many DF's can be open at once */ #define DF_DEFAULTDDS 16 /* How many DD's a file has by default */ #define DF_MAXFNLEN 256 /* maximum length of filename parameters */ #ifndef FILE #include #endif /*FILE*/ #endif /*DF_MAGICK*/ SHAR_EOF fi # end of overwriting check # End of shell archive exit 0