Fortran SFF API to data I/O streams in C++
fapid_sff_close.cc
Go to the documentation of this file.
1 
40 #define TF_FAPID_SFF_CLOSE_CC_VERSION \
41  "TF_FAPID_SFF_CLOSE_CC V1.2"
42 
43 #include <fapidxx/fapidsff.h>
44 #include <fapidxx/fileunit.h>
45 
46 using namespace fapidxx;
47 
69 int sff_close__(integer *lu, integer *ierr)
70 {
71  int retval=0;
72  *ierr=0;
73  try {
74  if (istreammanager.isopen(static_cast<int>(*lu)))
75  { istreammanager.close(static_cast<int>(*lu)); }
76  if (ostreammanager.isopen(static_cast<int>(*lu)))
77  { ostreammanager.close(static_cast<int>(*lu)); }
78  }
79  catch(...) {
80  *ierr=1;
81  }
82  return retval;
83 } // int sff_close__
84 
85 /* ----- END OF fapid_sff_close.cc ----- */
This is the interface usually expected by Fortran programs linking to libsff.a (prototypes) ...
Definition: error.cc:44
bool isopen(const int &unit) const
check whether a file is opened for this file unit
Definition: fileunit.cc:103
long int integer
Fortran integer type.
Definition: fapidsff.h:66
::fapidxx::OFileUnits ostreammanager
the global ostream manager
Definition: fileunit.cc:51
bool isopen(const int &unit) const
check whether a file is opened for this file unit
Definition: fileunit.cc:174
int sff_close__(integer *lu, integer *ierr)
Close SFF file.
a file unit interface to libdatrwxx (prototypes)
void close(const int &unit)
close the file associated with this file unit
Definition: fileunit.cc:162
::fapidxx::IFileUnits istreammanager
the global istream manager
Definition: fileunit.cc:48
void close(const int &unit)
close the file associated with this file unit
Definition: fileunit.cc:91