Fortran SFF API to data I/O streams in C++
fapid_sff_wopen.cc
Go to the documentation of this file.
1 
33 #define TF_FAPID_SFF_WOPEN_CC_VERSION \
34  "TF_FAPID_SFF_WOPEN_CC V1.0 "
35 
36 #include <fapidxx/fapidsff.h>
37 #include <fapidxx/fileunit.h>
38 #include <fapidxx/helper.h>
39 #include <fapidxx/error.h>
40 #include <sffxx.h>
41 
42 using namespace fapidxx;
43 
66 int sff_wopen__(integer *lu, char *filename,
67  integer *ierr, ftnlen filename_len)
68 {
69  int retval=0;
70  *ierr=0;
71  try {
72  datrw::oanystream &os=
73  ostreammanager.open(static_cast<int>(*lu),
74  stringfromfstring(filename, filename_len));
75  }
76  catch (...) {
77  *ierr=1;
78  }
79  return(retval);
80 } // int sff_wopen__
81 
82 /* ----- END OF fapid_sff_wopen.cc ----- */
int sff_wopen__(integer *lu, char *filename, integer *ierr, ftnlen filename_len)
Open file for writing.
This is the interface usually expected by Fortran programs linking to libsff.a (prototypes) ...
Definition: error.cc:44
long int integer
Fortran integer type.
Definition: fapidsff.h:66
datrw::oanystream & open(const int &unit, const std::string &filename)
open a new file
Definition: fileunit.cc:147
exceptions and error handling macros (prototypes)
::fapidxx::OFileUnits ostreammanager
the global ostream manager
Definition: fileunit.cc:51
long int ftnlen
Fortran string size type.
Definition: fapidsff.h:70
std::string stringfromfstring(char *fstring, ftnlen slen)
create a C++ string from a Fortran string
Definition: helper.cc:51
a file unit interface to libdatrwxx (prototypes)
some helper functions (prototypes)