Commit 56287452 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

provide C prototypes

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 3368
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 2a4e84d5
......@@ -31,6 +31,7 @@
# discard f2c option (fallback)
# check variables
# creation of package not yet defined
# 14/11/2010 V1.5 provide C prototypes to stuff.f
#
# ============================================================================
#
......@@ -38,14 +39,22 @@
all: doc install
LIBS=libsff.a
TESTS=tfullwrite tservice tskipdata teststuff tfullread
install: $(LIBS) install-include
install: $(LIBS)
#----------------------------------------------------------------------
flist: Makefile $(wildcard *.f *c) README
flist: Makefile $(wildcard *.f *c *.h) README
echo $^ | tr ' ' '\n' | sort > $@
.PHONY: edit
edit: flist; vim $<
.PHONY: clean
clean:
-/bin/rm *.o *.bak *.o77 *.f2c.o flist
-/bin/rm $(TESTS) $(TESTSX)
# ============================================================================
# a variable definition to check variable settings
......@@ -66,14 +75,8 @@ FLAGS+=$(MYFLAGS)
FFLAGS += -ff2c -Wall -ffixed-line-length-none $(FLAGS)
CFLAGS += -O2 -I${SERVERINCLUDEDIR} $(FLAGS)
TESTS=tfullwrite tservice tskipdata teststuff tfullread
tests: $(TESTS)
.PHONY: tests clean
clean:
-/bin/rm *.o *.bak *.o77 *.f2c.o flist
-/bin/rm $(TESTS) $(TESTSX)
#----------------------------------------------------------------------
# documentation
doc: stuff.f
awk 'BEGIN { flagsff=0; flaglib=0; } \
......@@ -87,6 +90,21 @@ doc: stuff.f
END { print "c ---- END OF sff.doc ----" > "sff.doc" ; \
print "c ---- END OF libsff.doc ----" > "libsff.doc" ;}' $<
#----------------------------------------------------------------------
# C prototypes
$(call CHECKVAR,LOCINCLUDEDIR)
$(LOCINCLUDEDIR)/sff.h: sff.h
mkdir -vp $(dir $@)
-rm -fv $@
/bin/cp -vpd $< $@
.PHONY: install-include
install-include: $(LOCINCLUDEDIR)/sff.h
#----------------------------------------------------------------------
# library
gse20.o: gse20.f
stuff.o: stuff.f
sunfortran.o: sunfortran.c
......@@ -100,8 +118,14 @@ libsff.a: gse20.o stuff.o sunfortran.o
$(RANLIB) $@
/bin/mv -fv $@ $(LOCLIBDIR)
#----------------------------------------------------------------------
# test code
$(TESTS): %: %.o; $(CC) -o $@ $< -lsff
.PHONY: tests
tests: $(TESTS)
#======================================================================
# create package
# --------------
......
......@@ -13,4 +13,4 @@ extracted the files:
sff.doc contains the definition of the SFF
libsff.doc contains a quick reference to the routines in the library
C prototypes are provided in sff.h for C-code which links against this library.
/*
* This file was created by
* f2c -u -f -P stuff.f
*
* It contains prototypes for functions in stuff.f as are needed when linking
* C-code against libsff. Appropriate Fortran typedefs (integer, real, etc)
* must be set before including sff.h
*/
extern E_f sff_libversion__(void);
extern int sff_f2i__(integer *idata, real *fdata, integer *nsamples, real *ampfac);
extern int sff_i2f__(integer *idata, real *fdata, integer *nsamples, real *ampfac);
extern int sff_new__(integer *lu, char *filename, integer *ierr, ftnlen filename_len);
extern int sff_wopen__(integer *lu, char *filename, integer *ierr, ftnlen filename_len);
extern int sff_wopenf__(integer *lu, char *filename, char *lines, integer *nline, integer *ierr, ftnlen filename_len, ftnlen lines_len);
extern int sff_wopens__(integer *lu, char *filename, char *type__, char *cs, real *c1, real *c2, real *c3, char *date, char *time, integer *ierr, ftnlen filename_len, ftnlen type_len, ftnlen cs_len, ftnlen date_len, ftnlen time_len);
extern int sff_wopenfs__(integer *lu, char *filename, char *lines, integer *nline, char *type__, char *cs, real *c1, real *c2, real *c3, char *date, char *time, integer *ierr, ftnlen filename_len, ftnlen lines_len, ftnlen type_len, ftnlen cs_len, ftnlen date_len, ftnlen time_len);
extern int sff_ropen__(integer *lu, char *filename, real *version, char *timestamp, char *code, integer *ierr, ftnlen filename_len, ftnlen timestamp_len, ftnlen code_len);
extern int sff_ropenf__(integer *lu, char *filename, real *version, char *timestamp, char *code, integer *nline, char *lines, integer *lenmax, integer *lindim, integer *ierr, ftnlen filename_len, ftnlen timestamp_len, ftnlen code_len, ftnlen lines_len);
extern int sff_ropens__(integer *lu, char *filename, real *version, char *timestamp, char *code, char *type__, char *cs, real *c1, real *c2, real *c3, char *date, char *time, integer *ierr, ftnlen filename_len, ftnlen timestamp_len, ftnlen code_len, ftnlen type_len, ftnlen cs_len, ftnlen date_len, ftnlen time_len);
extern int sff_ropenfs__(integer *lu, char *filename, real *version, char *timestamp, char *code, integer *nline, char *lines, integer *lenmax, integer *lindim, char *type__, char *cs, real *c1, real *c2, real *c3, char *date, char *time, integer *ierr, ftnlen filename_len, ftnlen timestamp_len, ftnlen code_len, ftnlen lines_len, ftnlen type_len, ftnlen cs_len, ftnlen date_len, ftnlen time_len);
extern int sff_wtrace__(integer *lu, char *wid2line, integer *nsamp, real *fdata, integer *idata, logical *last, integer *ierr, ftnlen wid2line_len);
extern int sff_wtracef__(integer *lu, char *wid2line, integer *nsamp, real *fdata, integer *idata, logical *last, integer *nline, char *lines, integer *ierr, ftnlen wid2line_len, ftnlen lines_len);
extern int sff_wtracei__(integer *lu, char *wid2line, integer *nsamp, real *fdata, integer *idata, logical *last, char *cs, real *c1, real *c2, real *c3, integer *nstack, integer *ierr, ftnlen wid2line_len, ftnlen cs_len);
extern int sff_wtracefi__(integer *lu, char *wid2line, integer *nsamp, real *fdata, integer *idata, logical *last, integer *nline, char *lines, char *cs, real *c1, real *c2, real *c3, integer *nstack, integer *ierr, ftnlen wid2line_len, ftnlen lines_len, ftnlen cs_len);
extern int sff_rtrace__(integer *lu, real *tanf, real *dt, char *wid2line, integer *nsamp, real *fdata, integer *idata, char *code, logical *last, integer *ierr, ftnlen wid2line_len, ftnlen code_len);
extern int sff_rtracef__(integer *lu, real *tanf, real *dt, char *wid2line, integer *nsamp, real *fdata, integer *idata, char *code, logical *last, integer *nline, char *lines, integer *lindim, integer *lenmax, integer *ierr, ftnlen wid2line_len, ftnlen code_len, ftnlen lines_len);
extern int sff_rtracei__(integer *lu, real *tanf, real *dt, char *wid2line, integer *nsamp, real *fdata, integer *idata, char *code, logical *last, char *cs, real *c1, real *c2, real *c3, integer *nstack, integer *ierr, ftnlen wid2line_len, ftnlen code_len, ftnlen cs_len);
extern int sff_rtracefi__(integer *lu, real *tanf, real *dt, char *wid2line, integer *nsamp, real *fdata, integer *idata, char *code, logical *last, integer *nline, char *lines, integer *lindim, integer *lenmax, char *cs, real *c1, real *c2, real *c3, integer *nstack, integer *ierr, ftnlen wid2line_len, ftnlen code_len, ftnlen lines_len, ftnlen cs_len);
extern int sff_modwid2samprat__(char *wid2line, real *samprat, ftnlen wid2line_len);
extern int sff_modwid2samps__(char *wid2line, integer *samps, ftnlen wid2line_len);
extern int sff_modwid2date__(char *wid2line, integer *year, integer *month, integer *day, ftnlen wid2line_len);
extern int sff_modwid2time__(char *wid2line, integer *hour, integer *minute, real *second, ftnlen wid2line_len);
extern int sff_modwid2shift__(char *wid2line, real *tmin, real *tsec, ftnlen wid2line_len);
extern logical sff_timeisleapyear__(integer *year);
extern int sff_timesetdoy__(integer *doy, integer *year, integer *month, integer *day);
extern integer sff_timegetdoy__(integer *year, integer *month, integer *day);
extern int sff_timesplit__(real *tsec, integer *day, integer *hour, integer *minute, real *second);
extern int sff_timeadd__(integer *year1, integer *doy1, integer *hour1, integer *minute1, real *second1, integer *year2, integer *doy2, integer *hour2, integer *minute2, real *second2, integer *year, integer *doy, integer *hour, integer *minute, real *second);
extern int sff_quickwrite__(integer *lu, char *wid2line, integer *nsamp, integer *idata, real *ampfac, ftnlen wid2line_len);
extern int sff_quickread__(integer *lu, char *wid2line, integer *nsamp, real *tanf, real *dt, integer *idata, real *ampfac, integer *ierr, ftnlen wid2line_len);
extern int sff_wstatus__(integer *lu, char *code, ftnlen code_len);
extern int sff_rstatus__(integer *lu, real *version, char *timestamp, char *code, integer *ierr, ftnlen timestamp_len, ftnlen code_len);
extern int sff_wfree__(integer *lu, integer *nline, char *lines, ftnlen lines_len);
extern int sff_rfree__(integer *lu, integer *nline, char *lines, integer *lenmax, integer *lindim, integer *ierr, ftnlen lines_len);
extern int sff_skipfree__(integer *lu, integer *ierr);
extern int sff_wsource__(integer *lu, char *typh, char *cs, real *c1, real *c2, real *c3, char *date, char *time, ftnlen typh_len, ftnlen cs_len, ftnlen date_len, ftnlen time_len);
extern int sff_rsource__(integer *lu, char *typ, char *cs, real *c1, real *c2, real *c3, char *date, char *time, integer *ierr, ftnlen typ_len, ftnlen cs_len, ftnlen date_len, ftnlen time_len);
extern int sff_winfo__(integer *lu, char *cs, real *c1, real *c2, real *c3, integer *nstack, ftnlen cs_len);
extern int sff_rinfo__(integer *lu, char *cs, real *c1, real *c2, real *c3, integer *nstack, integer *ierr, ftnlen cs_len);
extern int sff_checksum__(integer *nsamp, integer *idata, integer *nchecksum);
extern int sff_rwdata__(integer *lu, char *wid2line, char *code, real *ampfac, integer *nsamp, integer *idata, logical *rwflag, integer *ierr, ftnlen wid2line_len, ftnlen code_len);
extern int sff_wdata__(integer *lu, char *wid2line, integer *nsamp, integer *idata, real *ampfac, char *code, ftnlen wid2line_len, ftnlen code_len);
extern int sff_rwid2__(integer *lu, char *wid2line, integer *nsamp, real *tanf, real *dt, integer *nchar, real *ampfac, char *code, integer *ierr, ftnlen wid2line_len, ftnlen code_len);
extern int sff_rdata__(integer *lu, char *wid2line, integer *nsamp, real *tanf, real *dt, integer *idata, real *ampfac, char *code, integer *ierr, ftnlen wid2line_len, ftnlen code_len);
extern int sff_rdata2__(integer *lu, integer *nsamp, integer *idata, char *cbuf, integer *nchar, integer *ierr, ftnlen cbuf_len);
extern int sff_skipdata__(integer *lu, char *code, logical *last, integer *ierr, ftnlen code_len);
extern int sff_prepwid2__(integer *nsamp, real *samprat, char *station, integer *year, integer *month, integer *day, integer *hour, integer *minute, char *comp, char *auxid, char *instyp, real *second, real *calib, real *calper, real *hang, real *vang, char *wid2line, integer *ierr, ftnlen station_len, ftnlen comp_len, ftnlen auxid_len, ftnlen instyp_len, ftnlen wid2line_len);
extern int sff_getdate__(char *wid2line, char *date, ftnlen wid2line_len, ftnlen date_len);
extern int sff_gettime__(char *wid2line, char *time, ftnlen wid2line_len, ftnlen time_len);
extern int sff_getstation__(char *wid2line, char *sta, ftnlen wid2line_len, ftnlen sta_len);
extern int sff_getchannel__(char *wid2line, char *channel, ftnlen wid2line_len, ftnlen channel_len);
extern integer sff_getn__(char *wid2line, ftnlen wid2line_len);
extern E_f sff_getdt__(char *wid2line, ftnlen wid2line_len);
extern int sff_trimlen__(char *string, integer *ntrim, ftnlen string_len);
/*:ref: idate_ 14 1 4 */
/*:ref: itime_ 14 1 4 */
/*:ref: dcomp6_ 14 6 4 13 4 4 4 124 */
/*:ref: remdif1_ 14 2 4 4 */
/*:ref: dif1_ 14 2 4 4 */
/*:ref: cmprs6_ 14 6 4 4 4 13 4 124 */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment