Fortran SFF API to data I/O streams in C++

◆ sff_close__()

int sff_close__ ( integer lu,
integer ierr 
)

Close SFF file.

Description from stuff.f:

c----------------------------------------------------------------------
subroutine sff_close(lu, ierr)
c
c Calling this subroutine instead of the Fortran close functions
c provides interface compatibility to libfapidxx
c
c Input:
c lu: Fortran file unit
c Output:
c ierr: error status (ok: ierr=0)
c
integer lu, ierr
c----------------------------------------------------------------------

Definition at line 69 of file fapid_sff_close.cc.

References fapidxx::IFileUnits::close(), fapidxx::OFileUnits::close(), fapidxx::IFileUnits::isopen(), fapidxx::OFileUnits::isopen(), fapidxx::istreammanager, and fapidxx::ostreammanager.

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__
bool isopen(const int &unit) const
check whether a file is opened for this file unit
Definition: fileunit.cc:103
::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
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
Here is the call graph for this function: