irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

rsFileClosedir.cpp
Go to the documentation of this file.
1 
3 /* This is script-generated code (for the most part). */
4 /* See fileClosedir.h for a description of this API call.*/
5 
6 #include "fileClosedir.h"
7 #include "miscServerFunct.hpp"
8 #include "rsGlobalExtern.hpp"
9 #include "rsFileClosedir.hpp"
10 
11 // =-=-=-=-=-=-=-
12 #include "irods_log.hpp"
14 
15 int
16 rsFileClosedir( rsComm_t *rsComm, fileClosedirInp_t *fileClosedirInp ) {
18  int remoteFlag;
19  int retVal;
20 
21  remoteFlag = getServerHostByFileInx( fileClosedirInp->fileInx,
22  &rodsServerHost );
23 
24  if ( remoteFlag == LOCAL_HOST ) {
25  retVal = _rsFileClosedir( rsComm, fileClosedirInp );
26  }
27  else if ( remoteFlag == REMOTE_HOST ) {
28  retVal = remoteFileClosedir( rsComm, fileClosedirInp, rodsServerHost );
29  }
30  else {
31  if ( remoteFlag < 0 ) {
32  return remoteFlag;
33  }
34  else {
36  "rsFileClosedir: resolveHost returned unrecognized value %d",
37  remoteFlag );
39  }
40  }
41 
42  /* Manually insert call-specific code here */
43 
44  freeFileDesc( fileClosedirInp->fileInx );
45 
46  return retVal;
47 }
48 
49 int
50 remoteFileClosedir( rsComm_t *rsComm, fileClosedirInp_t *fileClosedirInp,
52  int status;
53 
54  if ( rodsServerHost == NULL ) {
56  "remoteFileClosedir: Invalid rodsServerHost" );
58  }
59 
60  if ( ( status = svrToSvrConnect( rsComm, rodsServerHost ) ) < 0 ) {
61  return status;
62  }
63 
64 
65  status = rcFileClosedir( rodsServerHost->conn, fileClosedirInp );
66 
67  if ( status < 0 ) {
69  "remoteFileClosedir: rcFileClosedir failed for %d, status = %d",
70  fileClosedirInp->fileInx, status );
71  }
72 
73  return status;
74 }
75 
76 // =-=-=-=-=-=-=-
77 // local function for handling call to closedir via resource plugin
79  rsComm_t* _comm,
80  fileClosedirInp_t* _closedir_inp ) {
81  // =-=-=-=-=-=-=-
82  // call closedir via resource plugin, handle errors
85  FileDesc[_closedir_inp->fileInx].fileName,
86  FileDesc[_closedir_inp->fileInx].rescHier,
87  0, 0 ) );
88  coll_obj->directory_pointer( reinterpret_cast< DIR* >( FileDesc[_closedir_inp->fileInx].driverDep ) );
89  irods::error closedir_err = fileClosedir( _comm, coll_obj );
90 
91  if ( !closedir_err.ok() ) {
92  std::stringstream msg;
93  msg << "fileClosedir failed for [";
94  msg << FileDesc[_closedir_inp->fileInx].fileName;
95  msg << "]";
96  irods::error log_err = PASSMSG( msg.str(), closedir_err );
97  irods::log( log_err );
98  }
99 
100  return closedir_err.code();
101 
102 } // _rsFileClosedir
rodsLog
void rodsLog(int level, const char *formatStr,...)
Definition: rodsLog.cpp:86
NULL
#define NULL
Definition: rodsDef.h:70
_rsFileClosedir
int _rsFileClosedir(rsComm_t *_comm, fileClosedirInp_t *_closedir_inp)
Definition: rsFileClosedir.cpp:78
rsComm_t
Definition: rcConnect.h:145
rodsServerHost::conn
rcComm_t * conn
Definition: rodsConnect.h:64
SYS_UNRECOGNIZED_REMOTE_FLAG
@ SYS_UNRECOGNIZED_REMOTE_FLAG
Definition: rodsErrorTable.h:88
fileClosedirInp_t
Definition: fileClosedir.h:6
getServerHostByFileInx
int getServerHostByFileInx(int fileInx, rodsServerHost_t **rodsServerHost)
Definition: fileOpr.cpp:99
irods_collection_object.hpp
fileClosedirInp_t::fileInx
int fileInx
Definition: fileClosedir.h:7
REMOTE_HOST
#define REMOTE_HOST
Definition: rodsConnect.h:45
irods::collection_object_ptr
boost::shared_ptr< collection_object > collection_object_ptr
Definition: irods_collection_object.hpp:85
LOCAL_HOST
#define LOCAL_HOST
Definition: rodsConnect.h:44
fileDesc_t::driverDep
void * driverDep
Definition: fileOpr.hpp:34
PASSMSG
#define PASSMSG(message_, prev_error_)
Definition: irods_error.hpp:119
fileDesc_t::rescHier
char * rescHier
Definition: fileOpr.hpp:28
fileClosedir.h
rsGlobalExtern.hpp
irods::error::code
long long code() const
Definition: irods_error.cpp:194
rsFileClosedir
int rsFileClosedir(rsComm_t *rsComm, fileClosedirInp_t *fileClosedirInp)
Definition: rsFileClosedir.cpp:16
SYS_INVALID_SERVER_HOST
@ SYS_INVALID_SERVER_HOST
Definition: rodsErrorTable.h:89
svrToSvrConnect
int svrToSvrConnect(rsComm_t *rsComm, rodsServerHost_t *rodsServerHost)
Definition: miscServerFunct.cpp:106
freeFileDesc
int freeFileDesc(int fileInx)
Definition: fileOpr.cpp:72
irods::collection_object
Definition: irods_collection_object.hpp:14
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
rcFileClosedir
int rcFileClosedir(rcComm_t *conn, fileClosedirInp_t *fileClosedirInp)
Definition: rcFileClosedir.cpp:23
irods::log
void log(const error &)
Definition: irods_log.cpp:13
rsFileClosedir.hpp
LOG_NOTICE
#define LOG_NOTICE
Definition: rodsLog.h:33
remoteFileClosedir
int remoteFileClosedir(rsComm_t *rsComm, fileClosedirInp_t *fileClosedirInp, rodsServerHost_t *rodsServerHost)
Definition: rsFileClosedir.cpp:50
irods::error
Definition: irods_error.hpp:23
miscServerFunct.hpp
FileDesc
fileDesc_t FileDesc[1026]
Definition: irods_server_globals.cpp:28
fileClosedir
irods::error fileClosedir(rsComm_t *, irods::first_class_object_ptr)
Definition: fileDriver.cpp:392
rodsServerHost
Definition: rodsConnect.h:62
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
fileDesc_t::fileName
char * fileName
Definition: fileOpr.hpp:27
irods_log.hpp