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)  

msParam.h
Go to the documentation of this file.
1 
4 /* msParam.h - header file for msParam.c
5  */
6 
7 
8 
9 #ifndef MS_PARAM_H__
10 #define MS_PARAM_H__
11 
12 #include "rods.h"
13 #include "objInfo.h"
14 #include "dataObjCopy.h"
15 #include "structFileExtAndReg.h"
16 #include "execCmd.h"
17 #include "rodsPath.h"
18 
19 
20 /* some commonly used MS (micro service) type */
21 #define STR_MS_T "STR_PI"
22 #define INT_MS_T "INT_PI"
23 #define INT16_MS_T "INT16_PI"
24 #define CHAR_MS_T "CHAR_PI"
25 #define BUF_LEN_MS_T "BUF_LEN_PI" /* an integer indication the
26  * length of BBuf */
27 #define STREAM_MS_T "INT_PI" /* value from bindStreamToIRods.
28  * Caller should use rcStreamRead
29  * and rcStreamClose to read */
30 #define DOUBLE_MS_T "DOUBLE_PI"
31 #define FLOAT_MS_T "FLOAT_PI"
32 #define BOOL_MS_T "BOOL_PI"
33 #define DataObjInp_MS_T "DataObjInp_PI"
34 #define DataObjCloseInp_MS_T "DataObjCloseInp_PI"
35 #define DataObjCopyInp_MS_T "DataObjCopyInp_PI"
36 #define DataObjReadInp_MS_T "dataObjReadInp_PI"
37 #define DataObjWriteInp_MS_T "dataObjWriteInp_PI"
38 #define DataObjLseekInp_MS_T "fileLseekInp_PI"
39 #define DataObjLseekOut_MS_T "fileLseekOut_PI"
40 #define KeyValPair_MS_T "KeyValPair_PI"
41 #define TagStruct_MS_T "TagStruct_PI"
42 #define CollInp_MS_T "CollInpNew_PI"
43 #define ExecCmd_MS_T "ExecCmd_PI"
44 #define ExecCmdOut_MS_T "ExecCmdOut_PI"
45 #define RodsObjStat_MS_T "RodsObjStat_PI"
46 #define VaultPathPolicy_MS_T "VaultPathPolicy_PI"
47 #define StrArray_MS_T "StrArray_PI"
48 #define IntArray_MS_T "IntArray_PI"
49 #define GenQueryInp_MS_T "GenQueryInp_PI"
50 #define GenQueryOut_MS_T "GenQueryOut_PI"
51 #define XmsgTicketInfo_MS_T "XmsgTicketInfo_PI"
52 #define SendXmsgInfo_MS_T "SendXmsgInfo_PI"
53 #define GetXmsgTicketInp_MS_T "GetXmsgTicketInp_PI"
54 #define SendXmsgInp_MS_T "SendXmsgInp_PI"
55 #define RcvXmsgInp_MS_T "RcvXmsgInp_PI"
56 #define RcvXmsgOut_MS_T "RcvXmsgOut_PI"
57 #define StructFileExtAndRegInp_MS_T "StructFileExtAndRegInp_PI"
58 #define RuleSet_MS_T "RuleSet_PI"
59 #define RuleStruct_MS_T "RuleStruct_PI"
60 #define DVMapStruct_MS_T "DVMapStruct_PI"
61 #define FNMapStruct_MS_T "FNMapStruct_PI"
62 #define MsrvcStruct_MS_T "MsrvcStruct_PI"
63 #define NcOpenInp_MS_T "NcOpenInp_PI"
64 #define NcInqIdInp_MS_T "NcInqIdInp_PI"
65 #define NcInqWithIdOut_MS_T "NcInqWithIdOut_PI"
66 #define NcInqInp_MS_T "NcInqInp_PI"
67 #define NcInqOut_MS_T "NcInqOut_PI"
68 #define NcCloseInp_MS_T "NcCloseInp_PI"
69 #define NcGetVarInp_MS_T "NcGetVarInp_PI"
70 #define NcGetVarOut_MS_T "NcGetVarOut_PI"
71 #define NcInqOut_MS_T "NcInqOut_PI"
72 #define NcInqGrpsOut_MS_T "NcInqGrpsOut_PI"
73 #define Dictionary_MS_T "Dictionary_PI"
74 #define DictArray_MS_T "DictArray_PI"
75 #define GenArray_MS_T "GenArray_PI"
76 #define DataObjInfo_MS_T "DataObjInfo_PI"
77 
78 /* micro service input/output parameter */
79 typedef struct MsParam {
80  char *label;
81  char *type; /* this is the name of the packing instruction in
82  * rodsPackTable.h */
83  void *inOutStruct;
86 
87 typedef struct MsParamArray {
88  int len;
89  int oprType;
92 
93 #define MS_INP_SEP_STR "++++" /* the separator str for msInp */
94 #define MS_NULL_STR "null" /* no input */
95 typedef struct ParsedMsKeyValStr {
96  char *inpStr;
97  char *endPtr; /* end pointer */
98  char *curPtr; /* current position */
99  char *kwPtr;
100  char *valPtr;
102 
103 typedef struct ValidKeyWd {
104  int flag;
105  char *keyWd;
106 } validKeyWd_t;
107 
108 /* valid keyWd flags for dataObjInp_t */
109 
110 #define RESC_NAME_FLAG 0x1
111 #define DEST_RESC_NAME_FLAG 0x2
112 #define BACKUP_RESC_NAME_FLAG 0x4
113 #define FORCE_FLAG_FLAG 0x8
114 #define ALL_FLAG 0x10
115 #define LOCAL_PATH_FLAG 0x20
116 #define VERIFY_CHKSUM_FLAG 0x40
117 #define ADMIN_FLAG 0x80
118 #define UPDATE_REPL_FLAG 0x100
119 #define REPL_NUM_FLAG 0x200
120 #define DATA_TYPE_FLAG 0x400
121 #define CHKSUM_ALL_FLAG 0x800
122 #define FORCE_CHKSUM_FLAG 0x1000
123 #define FILE_PATH_FLAG 0x2000
124 #define CREATE_MODE_FLAG 0x4000
125 #define OPEN_FLAGS_FLAG 0x8000
126 #define COLL_FLAGS_FLAG 0x10000
127 #define DATA_SIZE_FLAGS 0x20000
128 #define NUM_THREADS_FLAG 0x40000
129 #define OPR_TYPE_FLAG 0x80000
130 #define OBJ_PATH_FLAG 0x100000
131 #define COLL_NAME_FLAG 0x200000
132 #define RMTRASH_FLAG 0x400000
133 #define ADMIN_RMTRASH_FLAG 0x800000
134 #define DEF_RESC_NAME_FLAG 0x1000000
135 #define RBUDP_TRANSFER_FLAG 0x2000000
136 #define RBUDP_SEND_RATE_FLAG 0x4000000
137 #define RBUDP_PACK_SIZE_FLAG 0x8000000
138 #define BULK_OPR_FLAG 0x10000000
139 #define UNREG_FLAG 0x20000000
140 
141 #ifdef __cplusplus
142 extern "C" {
143 #endif
144 
145 int
146 resetMsParam( msParam_t *msParam );
147 int
148 clearMsParam( msParam_t *msParam, int freeStruct );
149 int
150 addMsParam( msParamArray_t *msParamArray, const char *label,
151  const char *packInstruct, void *inOutStruct, bytesBuf_t *inpOutBuf );
152 int
153 addIntParamToArray( msParamArray_t *msParamArray, char *label, int inpInt );
154 int
155 addMsParamToArray( msParamArray_t *msParamArray, const char *label,
156  const char *type, void *inOutStruct, bytesBuf_t *inpOutBuf, int replFlag );
157 int
158 replMsParamArray( msParamArray_t *msParamArray,
159  msParamArray_t *outMsParamArray );
160 int
161 replMsParam( msParam_t *msParam, msParam_t *outMsParam );
162 int
163 replInOutStruct( void *inStruct, void **outStruct, const char *type );
164 bytesBuf_t*
165 replBytesBuf( const bytesBuf_t* in);
166 int
167 fillMsParam( msParam_t *msParam, const char *label,
168  const char *type, void *inOutStruct, bytesBuf_t *inpOutBuf );
169 msParam_t *
170 getMsParamByLabel( msParamArray_t *msParamArray, const char *label );
171 msParam_t *
172 getMsParamByType( msParamArray_t *msParamArray, const char *type );
173 int
174 rmMsParamByLabel( msParamArray_t *msParamArray, const char *label, int freeStruct );
175 int
176 trimMsParamArray( msParamArray_t *msParamArray, char *outParamDesc );
177 int
178 printMsParam( msParamArray_t *msParamArray );
179 int
180 writeMsParam( char *buf, int len, msParam_t *msParam );
181 int
182 clearMsParamArray( msParamArray_t *msParamArray, int freeStruct );
183 void
184 fillIntInMsParam( msParam_t *msParam, const int myInt );
185 void
186 fillFloatInMsParam( msParam_t *msParam, const float myFloat );
187 void
188 fillCharInMsParam( msParam_t *msParam, const char myChar );
189 void
190 fillDoubleInMsParam( msParam_t *msParam, const rodsLong_t myDouble );
191 void
192 fillStrInMsParam( msParam_t *msParam, const char *myStr );
193 void
194 fillBufLenInMsParam( msParam_t *msParam, int myInt, bytesBuf_t *bytesBuf );
195 int
196 parseMspForDataObjInp( msParam_t *inpParam, dataObjInp_t *dataObjInpCache,
197  dataObjInp_t **outDataObjInp, int writeToCache );
198 int
199 parseMspForCollInp( msParam_t *inpParam, collInp_t *collInpCache,
200  collInp_t **outCollInp, int writeToCache );
201 int
202 parseMspForCondInp( msParam_t *inpParam, keyValPair_t *condInput,
203  char *condKw );
204 int
205 parseMspForCondKw( msParam_t *inpParam, keyValPair_t *condInput );
206 int
207 parseMspForPhyPathReg( msParam_t *inpParam, keyValPair_t *condInput );
208 int
209 parseMspForPosInt( msParam_t *inpParam );
210 char *
211 parseMspForStr( msParam_t *inpParam );
212 int
213 parseMspForFloat( msParam_t *inpParam, float *floatout );
214 int
215 parseMspForDouble( msParam_t *inpParam, double *doubleout );
216 int
218  dataObjCopyInp_t *dataObjCopyInpCache, dataObjCopyInp_t **outDataObjCopyInp );
219 int
221  execCmd_t *execCmdInpCache, execCmd_t **ouExecCmdInp );
222 void
223 *getMspInOutStructByLabel( msParamArray_t *msParamArray, const char *label );
224 int
225 getStdoutInExecCmdOut( msParam_t *inpExecCmdOut, char **outStr );
226 int
227 getStderrInExecCmdOut( msParam_t *inpExecCmdOut, char **outStr );
228 int
229 initParsedMsKeyValStr( char *inpStr, parsedMsKeyValStr_t *parsedMsKeyValStr );
230 int
231 clearParsedMsKeyValStr( parsedMsKeyValStr_t *parsedMsKeyValStr );
232 int
234 int
236  char *hintForMissingKw, int validKwFlags, char **outBadKeyWd );
237 int
238 chkDataObjInpKw( char *keyWd, int validKwFlags );
239 int
240 parseMsKeyValStrForCollInp( msParam_t *inpParam, collInp_t *collInp,
241  char *hintForMissingKw, int validKwFlags, char **outBadKeyWd );
242 int
243 chkCollInpKw( char *keyWd, int validKwFlags );
244 int
245 addKeyValToMspStr( msParam_t *keyStr, msParam_t *valStr,
246  msParam_t *msKeyValStr );
247 int
248 chkStructFileExtAndRegInpKw( char *keyWd, int validKwFlags );
249 int
251  structFileExtAndRegInp_t *structFileExtAndRegInp,
252  char *hintForMissingKw, int validKwFlags, char **outBadKeyWd );
253 int
254 parseMsParamFromIRFile( msParamArray_t *inpParamArray, char *inBuf );
255 
256 #ifdef __cplusplus
257 }
258 #endif
259 #endif /* MS_PARAM_H */
fillFloatInMsParam
void fillFloatInMsParam(msParam_t *msParam, const float myFloat)
Definition: msParam.cpp:251
rmMsParamByLabel
int rmMsParamByLabel(msParamArray_t *msParamArray, const char *label, int freeStruct)
Definition: msParam.cpp:424
msParamArray_t
struct MsParamArray msParamArray_t
rodsPath.h
execCmd.h
DataObjCopyInp
Definition: dataObjCopy.h:25
parseMsKeyValStrForCollInp
int parseMsKeyValStrForCollInp(msParam_t *inpParam, collInp_t *collInp, char *hintForMissingKw, int validKwFlags, char **outBadKeyWd)
Definition: msParam.cpp:1285
getMsParamByLabel
msParam_t * getMsParamByLabel(msParamArray_t *msParamArray, const char *label)
Definition: msParam.cpp:376
parseMspForDataObjCopyInp
int parseMspForDataObjCopyInp(msParam_t *inpParam, dataObjCopyInp_t *dataObjCopyInpCache, dataObjCopyInp_t **outDataObjCopyInp)
Definition: msParam.cpp:727
CollInp
Definition: dataObjInpOut.h:157
clearParsedMsKeyValStr
int clearParsedMsKeyValStr(parsedMsKeyValStr_t *parsedMsKeyValStr)
Definition: msParam.cpp:1072
fillBufLenInMsParam
void fillBufLenInMsParam(msParam_t *msParam, int myInt, bytesBuf_t *bytesBuf)
Definition: msParam.cpp:287
ParsedMsKeyValStr
Definition: msParam.h:92
replInOutStruct
int replInOutStruct(void *inStruct, void **outStruct, const char *type)
Definition: msParam.cpp:173
StructFileExtAndRegInp
Definition: structFileExtAndReg.h:7
validKeyWd_t
struct ValidKeyWd validKeyWd_t
parseMspForStr
char * parseMspForStr(msParam_t *inpParam)
Definition: msParam.cpp:893
ValidKeyWd::flag
int flag
Definition: msParam.h:101
replBytesBuf
bytesBuf_t * replBytesBuf(const bytesBuf_t *in)
Definition: msParam.cpp:208
fillMsParam
int fillMsParam(msParam_t *msParam, const char *label, const char *type, void *inOutStruct, bytesBuf_t *inpOutBuf)
Definition: msParam.cpp:222
addKeyValToMspStr
int addKeyValToMspStr(msParam_t *keyStr, msParam_t *valStr, msParam_t *msKeyValStr)
Definition: msParam.cpp:1389
ParsedMsKeyValStr::valPtr
char * valPtr
Definition: msParam.h:97
replMsParamArray
int replMsParamArray(msParamArray_t *msParamArray, msParamArray_t *outMsParamArray)
Definition: msParam.cpp:129
MsParam::type
char * type
Definition: msParam.h:78
parseMsKeyValStrForDataObjInp
int parseMsKeyValStrForDataObjInp(msParam_t *inpParam, dataObjInp_t *dataObjInp, char *hintForMissingKw, int validKwFlags, char **outBadKeyWd)
Definition: msParam.cpp:1151
clearMsParamArray
int clearMsParamArray(msParamArray_t *msParamArray, int freeStruct)
Definition: msParam.cpp:447
msParam_t
struct MsParam msParam_t
parseMspForCondInp
int parseMspForCondInp(msParam_t *inpParam, keyValPair_t *condInput, char *condKw)
Definition: msParam.cpp:782
parseMspForCollInp
int parseMspForCollInp(msParam_t *inpParam, collInp_t *collInpCache, collInp_t **outCollInp, int writeToCache)
Definition: msParam.cpp:677
trimMsParamArray
int trimMsParamArray(msParamArray_t *msParamArray, char *outParamDesc)
Definition: msParam.cpp:511
ValidKeyWd
Definition: msParam.h:100
clearMsParam
int clearMsParam(msParam_t *msParam, int freeStruct)
Definition: msParam.cpp:468
parseMsParamFromIRFile
int parseMsParamFromIRFile(msParamArray_t *inpParamArray, char *inBuf)
Definition: msParam.cpp:1558
MsParamArray::msParam
msParam_t ** msParam
Definition: msParam.h:87
chkDataObjInpKw
int chkDataObjInpKw(char *keyWd, int validKwFlags)
Definition: msParam.cpp:1263
ParsedMsKeyValStr::inpStr
char * inpStr
Definition: msParam.h:93
getStderrInExecCmdOut
int getStderrInExecCmdOut(msParam_t *inpExecCmdOut, char **outStr)
Definition: msParam.cpp:1028
ParsedMsKeyValStr::endPtr
char * endPtr
Definition: msParam.h:94
DataObjInp
Definition: dataObjInpOut.h:65
ParsedMsKeyValStr::curPtr
char * curPtr
Definition: msParam.h:95
parseMspForFloat
int parseMspForFloat(msParam_t *inpParam, float *floatout)
Definition: msParam.cpp:913
parsedMsKeyValStr_t
struct ParsedMsKeyValStr parsedMsKeyValStr_t
parseMsKeyValStrForStructFileExtAndRegInp
int parseMsKeyValStrForStructFileExtAndRegInp(msParam_t *inpParam, structFileExtAndRegInp_t *structFileExtAndRegInp, char *hintForMissingKw, int validKwFlags, char **outBadKeyWd)
Definition: msParam.cpp:1451
MsParam
Definition: msParam.h:76
BytesBuf
Definition: rodsDef.h:197
MsParam::inpOutBuf
bytesBuf_t * inpOutBuf
Definition: msParam.h:81
ParsedMsKeyValStr::kwPtr
char * kwPtr
Definition: msParam.h:96
initParsedMsKeyValStr
int initParsedMsKeyValStr(char *inpStr, parsedMsKeyValStr_t *parsedMsKeyValStr)
Definition: msParam.cpp:1056
getStdoutInExecCmdOut
int getStdoutInExecCmdOut(msParam_t *inpExecCmdOut, char **outStr)
Definition: msParam.cpp:1000
MsParamArray::len
int len
Definition: msParam.h:85
addMsParamToArray
int addMsParamToArray(msParamArray_t *msParamArray, const char *label, const char *type, void *inOutStruct, bytesBuf_t *inpOutBuf, int replFlag)
Definition: msParam.cpp:47
MsParam::label
char * label
Definition: msParam.h:77
parseMspForExecCmdInp
int parseMspForExecCmdInp(msParam_t *inpParam, execCmd_t *execCmdInpCache, execCmd_t **ouExecCmdInp)
Definition: msParam.cpp:972
parseMspForDataObjInp
int parseMspForDataObjInp(msParam_t *inpParam, dataObjInp_t *dataObjInpCache, dataObjInp_t **outDataObjInp, int writeToCache)
Definition: msParam.cpp:597
ExecCmd
Definition: execCmd.h:10
objInfo.h
writeMsParam
int writeMsParam(char *buf, int len, msParam_t *msParam)
Definition: msParam.cpp:321
fillStrInMsParam
void fillStrInMsParam(msParam_t *msParam, const char *myStr)
Definition: msParam.cpp:278
resetMsParam
int resetMsParam(msParam_t *msParam)
Definition: msParam.cpp:491
fillCharInMsParam
void fillCharInMsParam(msParam_t *msParam, const char myChar)
Definition: msParam.cpp:269
getMspInOutStructByLabel
void * getMspInOutStructByLabel(msParamArray_t *msParamArray, const char *label)
Definition: msParam.cpp:408
getNextKeyValFromMsKeyValStr
int getNextKeyValFromMsKeyValStr(parsedMsKeyValStr_t *parsedMsKeyValStr)
Definition: msParam.cpp:1094
parseMspForPosInt
int parseMspForPosInt(msParam_t *inpParam)
Definition: msParam.cpp:861
fillDoubleInMsParam
void fillDoubleInMsParam(msParam_t *msParam, const rodsLong_t myDouble)
Definition: msParam.cpp:260
replMsParam
int replMsParam(msParam_t *msParam, msParam_t *outMsParam)
Definition: msParam.cpp:156
chkStructFileExtAndRegInpKw
int chkStructFileExtAndRegInpKw(char *keyWd, int validKwFlags)
Definition: msParam.cpp:1535
addIntParamToArray
int addIntParamToArray(msParamArray_t *msParamArray, char *label, int inpInt)
Definition: msParam.cpp:24
fillIntInMsParam
void fillIntInMsParam(msParam_t *msParam, const int myInt)
Definition: msParam.cpp:242
dataObjCopy.h
label
Definition: restructs.hpp:288
MsParam::inOutStruct
void * inOutStruct
Definition: msParam.h:80
addMsParam
int addMsParam(msParamArray_t *msParamArray, const char *label, const char *packInstruct, void *inOutStruct, bytesBuf_t *inpOutBuf)
Definition: msParam.cpp:17
MsParamArray
Definition: msParam.h:84
ValidKeyWd::keyWd
char * keyWd
Definition: msParam.h:102
KeyValPair
Definition: objInfo.h:120
getMsParamByType
msParam_t * getMsParamByType(msParamArray_t *msParamArray, const char *type)
Definition: msParam.cpp:392
printMsParam
int printMsParam(msParamArray_t *msParamArray)
Definition: msParam.cpp:298
buf
static char buf[64+50+1]
Definition: rsAuthRequest.cpp:21
paramIn
Definition: ruleAdmin.cpp:32
type
int type
Definition: filesystem.cpp:103
structFileExtAndReg.h
parseMspForCondKw
int parseMspForCondKw(msParam_t *inpParam, keyValPair_t *condInput)
Definition: msParam.cpp:807
rods.h
parseMspForPhyPathReg
int parseMspForPhyPathReg(msParam_t *inpParam, keyValPair_t *condInput)
Definition: msParam.cpp:827
rodsLong_t
long long rodsLong_t
Definition: rodsType.h:32
MsParamArray::oprType
int oprType
Definition: msParam.h:86
chkCollInpKw
int chkCollInpKw(char *keyWd, int validKwFlags)
Definition: msParam.cpp:1367
parseMspForDouble
int parseMspForDouble(msParam_t *inpParam, double *doubleout)
Definition: msParam.cpp:943