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

reintegrated branch libdatrwxx.su into trunk

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.
libdatrwxx supersedes libdatreadxx and libdatwritexx by combining both
in one library
Makefiles and source code are modified to correctly use libdatrwxx
a few bugfixes were applied (to su2sffxx and others)
libfapidxx is extended and libsff is extended to match libfapidxx
refract now comes with target refractx, which uses libdatrwxx


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 3499
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parents 7f614529 b670aa42
......@@ -119,7 +119,7 @@ Libraries
libgsexx: base library, depends only on common system libraries
libsffxx: depends on libgsexx, libaff, and libtime
libdatreadxx: depends on libaff, libgsexx, libtime, libsffxx
libdatrwxx: depends on libaff, libgsexx, libtime, libsffxx
When installing multiple libraries, the target 'install-include' should be
issued for all libraries first. After header files are installed, issue the
......
......@@ -70,23 +70,17 @@ C++ libraries
external dependencies: -
internal dependencies: libaff libgsexx liblibtime
checked: 16.10.2010 (tforb)
libdatreadxx
libdatrwxx
language: C++
external dependencies: -
internal dependencies: libaff libgsexx liblibtime libsffxx
internal dependencies: libaff libgsexx libtime++ libsffxx
test program dependency: libtfxx
checked: 16.10.2010 (tforb)
libdatwritexx
language: C++
external dependencies: -
internal dependencies: libaff libgsexx liblibtime libsffxx
test program dependency: libtfxx
checked: 16.10.2010 (tforb)
checked: 22.11.2010 (tforb)
libtsxx
language: C++
external dependencies: -
internal dependencies: libtfxx libgsexx libtime libseife libaff
libdatreadxx libsffxx
internal dependencies: libtfxx libgsexx libtime++ libseife libaff
libdatrwxx libsffxx
checked: 16.10.2010 (tforb)
!! comment: there are many dependencies on libtfxx which probably should not
be here
......@@ -114,7 +108,7 @@ C++ libraries
libtfxx
language: C++
external dependencies: libgsl libboost
internal dependencies: libaff libdatreadxx libgsexx liblibtime
internal dependencies: libaff libdatrwxx libgsexx liblibtime
libsffxx libtsxx
checked: 16.10.2010 (tforb)
......
......@@ -33,13 +33,13 @@ CPPFLAGS=-I$(LOCINCLUDEDIR) $(FLAGS)
mgm2sff: %: %.o
$(CXX) -o $@ $^ -I$(LOCINCLUDEDIR) \
-lsffxx -ltime++ -lgsexx -laff -ltsxx -ldatreadxx \
-lsffxx -ltime++ -lgsexx -laff -ltsxx -ldatrwxx \
-ltfxx -L$(LOCLIBDIR) $(CXXFLAGS) $(FLAGS)
/bin/cp -vpd $@ $(LOCBINDIR)
mgm2sffstat: %stat: %.o
$(CXX) -static -o $@ $^ -I$(LOCINCLUDEDIR) \
-lsffxx -ltime++ -lgsexx -laff -ltsxx -ldatreadxx \
-lsffxx -ltime++ -lgsexx -laff -ltsxx -ldatrwxx \
-ltfxx -L$(LOCLIBDIR) $(CXXFLAGS) $(FLAGS)
/bin/cp -vpd $@ $(LOCBINDIR)
......
......@@ -20,7 +20,7 @@ LIBDIRS=libaff \
libsffu \
libgsexx \
libsffxx \
libdatreadxx \
libdatrwxx \
libemod \
libfourier \
liblinearxx \
......@@ -31,6 +31,7 @@ LIBDIRS=libaff \
libts \
libtsxx \
libserialxx \
libfapidxx \
TARGETS=$(addsuffix .install,$(LIBDIRS))
INSTINCLUDE=$(addsuffix .install-include,$(LIBDIRS))
......
......@@ -4,7 +4,7 @@
#
# Copyright (c) 2004 by Thomas Forbriger (BFO Schiltach)
#
# Makefile for libdatreadxx
# Makefile for libdatrwxx
#
# ----
# This program is free software; you can redistribute it and/or modify
......@@ -22,8 +22,8 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# ----
#
# Other libraries that are required to compile libdatreadxx:
# libaff, libgsexx, libtime, libsffxx
# Other libraries that are required to compile libdatrwxx:
# libaff, libgsexx, libtime++, libsffxx
#
# REVISIONS and CHANGES
# 30/03/2004 V1.0 Thomas Forbriger
......@@ -41,7 +41,7 @@
#
all: install doxydoc
install: install-include libdatreadxx.a
install: install-include libdatrwxx.a
# ============================================================================
#
CHECKVAR=$(if $($(1)),,$(error ERROR: missing variable $(1)))
......@@ -51,16 +51,18 @@ CHECKVARS=$(foreach var,$(1),$(call CHECKVAR,$(var)))
$(call CHECKVARS,LOCINCLUDEDIR LOCLIBDIR LOCBINDIR)
$(call CHECKVARS,TF_BROWSER TF_WWWBASEDIR)
LIBHEADERS=$(wildcard *.h sff/*.h tsoft/*.h tfascii/*.h)
LIBHEADERS+=$(wildcard bonjer/*.h pdas/*.h mseed/*.h hpmo/*.h sac/*.h gse/*.h)
SUBDIRS=$(addsuffix /,sff tsoft tfascii su bonjer pdas mseed hpmo sac gse)
LIBSRC=$(wildcard *.cc sff/*.cc tsoft/*.cc tfascii/*.cc)
LIBSRC+=$(wildcard bonjer/*.cc pdas/*.cc mseed/*.cc hpmo/*.cc sac/*.cc gse/*.cc)
LIBHEADERS=$(wildcard *.h)
LIBHEADERS+=$(wildcard $(addsuffix *.h,$(SUBDIRS)))
LIBSRC=$(wildcard *.cc sff/*.cc tsoft/*.cc tfascii/*.cc su/*.cc)
LIBSRC+=$(wildcard $(addsuffix *.cc,$(SUBDIRS)))
TESTHEADERS=$(wildcard tests/*.h)
TESTSRC=$(wildcard tests/*.cc)
INCINSTALLPATH=$(LOCINCLUDEDIR)/datreadxx
INCINSTALLPATH=$(LOCINCLUDEDIR)/datrwxx
LIBINSTALLPATH=$(LOCLIBDIR)
# name of headers with comments stripped off
......@@ -89,9 +91,22 @@ CXXFLAGS+=-Wall $(FLAGS)
LDFLAGS+=-L$(LOCLIBDIR)
CPPFLAGS+=-I$(LOCINCLUDEDIR) $(FLAGS)
flist: Makefile $(wildcard *.cfg contrib/*.h) $(LIBHEADERS) $(LIBSRC) \
$(TESTSRC) README
echo $^ | tr ' ' '\n' | sort > $@
EDITFILES=Makefile README $(wildcard *.cfg contrib/*.h)
EDITALL=$(EDITFILES) $(LIBHEADERS) $(LIBSRC) $(TESTSRC) $(EDITFILES)
EDITFORMATHEADERS=$(filter $(patsubst %/,%.h,$(SUBDIRS)),$(LIBHEADERS))
EDITROOT=$(filter-out $(EDITFORMATHEADERS),$(wildcard *.cc *.h))
EDITFIRST=$(filter-out $(LIBHEADERS) $(LIBSRC) $(TESTSRC),$(EDITALL))
EDITSECOND=$(filter-out $(TESTSRC) $(EDITROOT) $(EDITFIRST),$(EDITALL))
flist: $(LIBHEADERS) $(LIBSRC) $(TESTSRC) $(EDITFILES)
echo $(filter $(EDITFIRST),$^) | tr ' ' '\n' | sort > $@
echo "----" >> $@
echo $(filter $(EDITROOT),$^) | tr ' ' '\n' | sort >> $@
echo "----" >> $@
echo $(sort $(filter $(EDITSECOND),$^)) | tr ' ' '\n' >> $@
echo "----" >> $@
echo $(filter-out $(EDITSECOND) $(EDITROOT) $(EDITFIRST),$^) \
| tr ' ' '\n' | sort >> $@
.PHONY: edit
edit: flist; vim $<
......@@ -121,7 +136,7 @@ clean: ;
-include $(patsubst %.cc,%.d,$(LIBSRC) $(TESTSRC))
libdatreadxx.a: $(patsubst %.cc,%.o,$(LIBSRC))
libdatrwxx.a: $(patsubst %.cc,%.o,$(LIBSRC))
ar rcv $@ $^
ranlib $@
/bin/mv -fv $@ $(LOCLIBDIR)
......@@ -174,13 +189,13 @@ install-include: $(INSTHEADER)
$(call CHECKVARS,TF_WWWBASEDIR TF_BROWSER)
DOXYWWWPATH=$(TF_WWWBASEDIR)/libdatreadxx
DOXYWWWPATH=$(TF_WWWBASEDIR)/libdatrwxx
.PHONY: doxyclean doxyview doxydoc doxyconf
doxyclean: ;/bin/rm -rfv $(DOXYWWWPATH)
DOXYSRC=$(LIBSRC) $(HEADERS) README
DOXYSRC=$(LIBSRC) $(LIBHEADERS) README
PWD=$(shell env pwd)
# create doxygen intermediate configuration
......@@ -205,7 +220,7 @@ doxyview: $(DOXYWWWPATH)/html/index.html
# --------------
# is delegated to Makefile.packages
# which still has to be coded
PACKAGE=libdatreadxx
PACKAGE=libdatrwxx
#ifdef TF_MAKEPKG
#include $(TF_MAKEPKG)
#endif
......@@ -215,9 +230,9 @@ PACKAGE=libdatreadxx
# ---------
sactest hpmotest mseedtest pdastest tfasciitest\
tsofttest sfftest: %: tests/%.o libdatreadxx.a
tsofttest sfftest sutest: %: tests/%.o libdatrwxx.a
$(CXX) $(FLAGS) -o $@ $< -I$(LOCINCLUDEDIR) \
-ldatreadxx -lsffxx -lgsexx -ltsxx -ltfxx -laff -ltime++ \
-ldatrwxx -lsffxx -lgsexx -ltsxx -ltfxx -laff -ltime++ \
-L$(LOCLIBDIR)
/bin/mv -fv $@ $(LOCBINDIR)
......
......@@ -35,17 +35,17 @@
*/
// include guard
#ifndef DATWRITE_ASCII_H_VERSION
#ifndef DATRW_ASCII_H_VERSION
#define DATWRITE_ASCII_H_VERSION \
"TF_ASCII_H V1.0 "
#define DATWRITE_ASCII_H_CVSID \
#define DATRW_ASCII_H_VERSION \
"DATRW_ASCII_H V1.0"
#define DATRW_ASCII_H_CVSID \
"$Id$"
namespace datwrite {
namespace datrw {
} // namespace datwrite
} // namespace datrw
#endif // DATWRITE_ASCII_H_VERSION (includeguard)
#endif // DATRW_ASCII_H_VERSION (includeguard)
/* ----- END OF ascii.h ----- */
......@@ -35,14 +35,14 @@
*/
// include guard
#ifndef DATWRITE_BINARY_H_VERSION
#ifndef DATRW_BINARY_H_VERSION
#define DATWRITE_BINARY_H_VERSION \
"DATWRITE_BINARY_H V1.0 "
#define DATWRITE_BINARY_H_CVSID \
#define DATRW_BINARY_H_VERSION \
"DATRW_BINARY_H V1.0 "
#define DATRW_BINARY_H_CVSID \
"$Id$"
namespace datwrite {
namespace datrw {
/*! \brief binary writing interface
*
......@@ -69,8 +69,8 @@ namespace datwrite {
static const char* const Mmagic;
}; // class obinarystream
} // namespace datwrite
} // namespace datrw
#endif // DATWRITE_BINARY_H_VERSION (includeguard)
#endif // DATRW_BINARY_H_VERSION (includeguard)
/* ----- END OF binary.h ----- */
......@@ -29,21 +29,31 @@
*
* REVISIONS and CHANGES
* - 30/03/2004 V1.0 Thomas Forbriger
* - 23/11/2010 V1.1 introduced static members
*
* ============================================================================
*/
// include guard
#ifndef DATREAD_BONJER_H_VERSION
#ifndef DATRW_BONJER_H_VERSION
#define DATREAD_BONJER_H_VERSION \
"DATREAD_BONJER_H V1.0 "
#define DATREAD_BONJER_H_CVSID \
#define DATRW_BONJER_H_VERSION \
"DATRW_BONJER_H V1.1"
#define DATRW_BONJER_H_CVSID \
"$Id$"
#include<datreadxx/datread.h>
#include<datrwxx/datread.h>
namespace datread {
namespace datrw {
namespace bonjer {
extern const bool isbinary;
extern const char* const streamID;
} // namespace bonjer
/*----------------------------------------------------------------------*/
/*! \brief input stream to read seismic data provided by K. Bonjer
*
......@@ -64,12 +74,13 @@ namespace datread {
virtual void skipseries() { readheader(); }
static void help(std::ostream& os=std::cout)
{ Tbase::help(os, "ibonjerstream"); }
static const std::ios_base::openmode openmode;
private:
void readheader();
}; // class ibonjerstream
} // namespace datread
} // namespace datrw
#endif // DATREAD_BONJER_H_VERSION (includeguard)
#endif // DATRW_BONJER_H_VERSION (includeguard)
/* ----- END OF bonjer.h ----- */
/*! \file bonjer.cc
/*! \file ibonjerstream.cc
* \brief read bonjers ASCII data (implementation)
*
* ----------------------------------------------------------------------------
......@@ -30,18 +30,31 @@
* REVISIONS and CHANGES
* - 30/03/2004 V1.0 Thomas Forbriger
* - 31/10/2010 V1.1 pass station value to station header field
* - 23/11/2010 V1.2 introduced static members
*
* ============================================================================
*/
#define DATREAD_BONJER_CC_VERSION \
"DATREAD_BONJER_CC V1.1"
#define DATREAD_BONJER_CC_CVSID \
#define DATRW_BONJER_CC_VERSION \
"DATRW_BONJER_CC V1.2"
#define DATRW_BONJER_CC_CVSID \
"$Id$"
#include <datreadxx/bonjer.h>
#include <datreadxx/readbonjer.h>
#include <datrwxx/bonjer.h>
#include <datrwxx/readbonjer.h>
namespace datread {
namespace datrw {
const std::ios_base::openmode ibonjerstream::openmode=std::ios_base::in;
//@{
/*! \brief Format properties
* \ingroup bonjer
*/
const bool bonjer::isbinary=false;
const char* const bonjer::streamID="bonjer";
//@}
/*----------------------------------------------------------------------*/
ibonjerstream::ibonjerstream(std::istream& is): Tbase(is, true, true, true)
{ }
......@@ -55,7 +68,7 @@ namespace datread {
double inval;
for (int i=0; i<n; ++i)
{
DATREAD_assert(is.good(),"ERROR (ibonjerstream::?series): "
DATRW_assert(is.good(),"ERROR (ibonjerstream::?series): "
"bad stream!");
is >> inval;
retval(i)=typename C::Tvalue(inval);
......@@ -93,7 +106,7 @@ namespace datread {
void ibonjerstream::readheader()
{
datread::bonjer::header hd=datread::bonjer::readheader(Mis);
datrw::bonjer::header hd=datrw::bonjer::readheader(Mis);
sff::FREE tracefree;
sff::WID2 wid2;
this->newtrace();
......@@ -114,6 +127,6 @@ namespace datread {
this->setwid2(wid2);
}
} // namespace datread
} // namespace datrw
/* ----- END OF bonjer.cc ----- */
/* ----- END OF ibonjerstream.cc ----- */
......@@ -32,16 +32,16 @@
*
* ============================================================================
*/
#define DATREAD_READBONJER_CC_VERSION \
"DATREAD_READBONJER_CC V1.0 "
#define DATREAD_READBONJER_CC_CVSID \
#define DATRW_READBONJER_CC_VERSION \
"DATRW_READBONJER_CC V1.0 "
#define DATRW_READBONJER_CC_CVSID \
"$Id$"
#include<cstdlib>
#include<sstream>
#include<datreadxx/readbonjer.h>
#include<datrwxx/readbonjer.h>
namespace datread {
namespace datrw {
/*!
* To provide a definition of the data format, we dump
......@@ -166,6 +166,6 @@ Units: CM/S**2
} // namespace bonjer
} // namespace datread
} // namespace datrw
/* ----- END OF readbonjer.cc ----- */
......@@ -34,22 +34,22 @@
*/
// include guard
#ifndef DATREAD_READBONJER_H_VERSION
#ifndef DATRW_READBONJER_H_VERSION
#define DATREAD_READBONJER_H_VERSION \
"DATREAD_READBONJER_H V1.0 "
#define DATREAD_READBONJER_H_CVSID \
#define DATRW_READBONJER_H_VERSION \
"DATRW_READBONJER_H V1.0 "
#define DATRW_READBONJER_H_CVSID \
"$Id$"
#include<aff/series.h>
#include<iostream>
#include<libtime++.h>
namespace datread {
namespace datrw {
/*! \brief all functions, classes, etc. to read K. Bonjers data format
*
* \defgroup bonjer Read file format defined by K. Bonjer
* \defgroup bonjer Reading module for: file format defined by K. Bonjer
*/
/*! \brief all functions, classes, etc. to read K. Bonjers data format
......@@ -80,8 +80,8 @@ namespace datread {
} // namespace bonjer
} // namespace datread
} // namespace datrw
#endif // DATREAD_READBONJER_H_VERSION (includeguard)
#endif // DATRW_READBONJER_H_VERSION (includeguard)
/* ----- END OF readbonjer.h ----- */
......@@ -8,7 +8,7 @@
* \date 29/06/2007
*
* a copy of libtfxx ioswap.cc (implementation)
* just to make libdatread more independent
* just to make libdatrw more independent
*
* ----
* This program is free software; you can redistribute it and/or modify
......@@ -34,19 +34,19 @@
*
* ============================================================================
*/
#define TF_DATREAD_BYTESEX_CC_VERSION \
"TF_DATREAD_BYTESEX_CC V1.1"
#define TF_DATREAD_BYTESEX_CC_CVSID \
#define DATRW_BYTESEX_CC_VERSION \
"DATRW_BYTESEX_CC V1.1"
#define DATRW_BYTESEX_CC_CVSID \
"$Id$"
#include <datreadxx/bytesex.h>
#include <datreadxx/error.h>
#include <datrwxx/bytesex.h>
#include <datrwxx/error.h>
#include <iostream>
using std::cout;
using std::endl;
namespace datread {
namespace datrw {
namespace util {
......@@ -77,7 +77,7 @@ namespace datread {
{
Ecpu_type result=cpu_unknown;
IOUnion<int> u1,u2;
DATREAD_assert((sizeof(int) == 4),
DATRW_assert((sizeof(int) == 4),
"The integer memory size on this CPU differs from the"
"required value of 4");
const int& intsize=sizeof(int);
......@@ -141,6 +141,6 @@ namespace datread {
} // namespace util
} // namespace datread
} // namespace datrw
/* ----- END OF bytesex.cc ----- */
......@@ -9,7 +9,7 @@
*
* A copy of bytesex.h from libtfxx (prototypes)
*
* just to make libdatread a bit more independent
* just to make libdatrw a bit more independent
*
* ----
* This program is free software; you can redistribute it and/or modify
......@@ -37,18 +37,18 @@
*/
// include guard
#ifndef TF_DATREAD_BYTESEX_H_VERSION
#ifndef DATRW_BYTESEX_H_VERSION
#define TF_DATREAD_BYTESEX_H_VERSION \
"TF_DATREAD_BYTESEX_H V1.1"
#define TF_DATREAD_BYTESEX_H_CVSID \
#define DATRW_BYTESEX_H_VERSION \
"DATRW_BYTESEX_H V1.1"
#define DATRW_BYTESEX_H_CVSID \
"$Id$"
// we include fstream, because all function are closely related to file I/O
// and file_magic definitely requires fstream
#include<fstream>
namespace datread {
namespace datrw {
namespace util {
......@@ -68,7 +68,7 @@ namespace datread {
* \sa group_fortranio
* \sa bytesex_h
*
* The components are collected in namespace datread::util.
* The components are collected in namespace datrw::util.
* @{
*/
......@@ -203,8 +203,8 @@ namespace datread {
} // namespace util
} // namespace datread
} // namespace datrw
#endif // TF_DATREAD_BYTESEX_H_VERSION (includeguard)
#endif // DATRW_BYTESEX_H_VERSION (includeguard)
/* ----- END OF bytesex.h ----- */
Markdown is supported
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