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