Example: I want to archive a SIS high priority rate struct into an archive at /home/darkalf/bruce/testArchive/data/sisTestData. (Remember that it is essential to have the directory "data" in the path. The archive routines use it as a "root" directory for determining archive file names.) -------------------------------------------------------------------------------- THE code: #include #include #include #include #include "hdfi.h" #include "sis.h" #include "level1.h" /* testing putSisHighPriorityRates */ int main(int argc, char *argv[]) { struct L1SisHighPriorityRate hpr, *pHpr; struct tm timeStruct, *pTimeStruct; uint32 secondsSince1996; int status; timeStruct.tm_year = 99; /* 1999 */ timeStruct.tm_mon = 8; /* sept. */ timeStruct.tm_mday = 24; /* the 24th */ timeStruct.tm_hour = 15; /* 3 pm */ timeStruct.tm_min = 34; timeStruct.tm_sec = 30; timeStruct.tm_isdst = 0; /* no daylight savings time */ pTimeStruct = &timeStruct; secondsSince1996 = getSecondsSince1996FromDate(pTimeStruct); hpr.Second1996 = secondsSince1996; /* the rest of the structure i'll just leave. only the time stamp */ /* is important to the archive routines... */ pHpr = &hpr; status = putSisHighPriorityRates(pHpr); printf("status = %d\n", status); return 1; } ------------------------------------------------------------------------ THE run: % setenv L1_SIS_DATA_BASE_DIRECTORY /home/darkalf/bruce/testArchive/data/sisTestData % mkdir /home/darkalf/bruce/testArchive/data/sisTestData % ls -R ${L1_SIS_DATA_BASE_DIRECTORY} /home/darkalf/bruce/testArchive/data/sisTestData: [ nothing in here yet... ] % test status = 0 % [ status = 0 means data was written normally ] % ls -R ${L1_SIS_DATA_BASE_DIRECTORY} /home/darkalf/bruce/testArchive/data/sisTestData: 1999.09/ /home/darkalf/bruce/testArchive/data/sisTestData/1999.09: 1999.09.24/ /home/darkalf/bruce/testArchive/data/sisTestData/1999.09/1999.09.24: sisTestData.1999.09.24.hp [ directories 1999.09/ and 1999.09/1999.09.24/ were created, and archive file sisTestData.1999.09.24.hp was created ] % sisTest status = 3 [ status = 3 means identical data found in archive already, nothing written ] ------------------------------------------------------------------------ THE Makefile: # where is your base directory? (ACE_WARE must be defined in your environment.) BASE_DIR = ${ACE_WARE} INCLUDE_DIR = ${BASE_DIR}/include LIBRARY_DIR = ${BASE_DIR}/lib # which compiler are you using? # setenv CC gcc (CC can be defined in your environment.) # CC = gcc (or not.) # code optimization and warnings flags FLAGS = -O2 -Wall # include files needed here are found in these directories: # # include/hdf: declarations for HDF types used throughout ACEware # include/structures: declarations for CRIS/SIS data structs # include/level1: level1 routine declarations INCLUDE_HEADER_DIRS = -I${INCLUDE_DIR}/hdf \ -I${INCLUDE_DIR}/structures \ -I${INCLUDE_DIR}/level1 INCLUDE_LIB_DIRS = -L${LIBRARY_DIR} INCLUDE_LIBRARIES = -llevel1 all: ${CC} ${FLAGS} test.c -o test \ ${INCLUDE_HEADER_DIRS} \ ${INCLUDE_LIB_DIRS} \ ${INCLUDE_LIBRARIES} clean: rm -rf *.o test -----------------------------------------------------------------------e THE make: % make gcc -O2 -Wall test.c -o test \ -I/home/idunn1/ACEware/include/hdf -I/home/idunn1/ACEware/include/structures -I/home/idunn1/ACEware/include/level1 \ -L/home/idunn1/ACEware/lib \ -llevel1 %