00001
00002
00003
00004
00005
00006 #include "openCollection.h"
00007 #include "readCollection.h"
00008 #include "objMetaOpr.h"
00009 #include "rcGlobalExtern.h"
00010 #include "rsGlobalExtern.h"
00011
00012 int
00013 rsReadCollection (rsComm_t *rsComm, int *handleInxInp,
00014 collEnt_t **collEnt)
00015 {
00016 int status;
00017 collHandle_t *collHandle;
00018
00019 int handleInx = *handleInxInp;
00020
00021 if (handleInx < 0 || handleInx >= NUM_COLL_HANDLE ||
00022 CollHandle[handleInx].inuseFlag != FD_INUSE) {
00023 rodsLog (LOG_NOTICE,
00024 "rsReadCollection: handleInx %d out of range",
00025 handleInx);
00026 return (SYS_FILE_DESC_OUT_OF_RANGE);
00027 }
00028
00029 collHandle = &CollHandle[handleInx];
00030 *collEnt = (collEnt_t *) malloc (sizeof (collEnt_t));
00031
00032 status = readCollection (collHandle, *collEnt);
00033
00034 if (status < 0) {
00035 free (*collEnt);
00036 *collEnt = NULL;
00037 }
00038
00039 return status;
00040 }
00041