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)  

nre.reLib1.cpp
Go to the documentation of this file.
1 
3 #define HAS_MICROSDEF_T
4 #include "rodsConnect.h"
5 #include "reGlobals.hpp"
6 #include "reFuncDefs.hpp"
7 #include "reHelpers1.hpp"
8 #include "apiHeaderAll.h"
9 #include "parser.hpp"
10 #include "index.hpp"
11 #include "rules.hpp"
12 #include "cache.hpp"
13 #include "locks.hpp"
14 #include "functions.hpp"
15 #include "configuration.hpp"
16 #include "rsGenQuery.hpp"
17 #include "irods_log.hpp"
19 #include "irods_re_plugin.hpp"
20 #include "rsGeneralRowInsert.hpp"
21 #include "rsEndTransaction.hpp"
22 
23 
24 #ifdef MYMALLOC
25 # Within reLib1.c here, change back the redefines of malloc back to normal
26 #define malloc(x) malloc(x)
27 #define free(x) free(x)
28 #endif
29 
30 extern int GlobalAllRuleExecFlag;
31 
32 int processReturnRes( Res *res );
33 
34 
35 
36 int
37 applyRule331( char *inAction, msParamArray_t *inMsParamArray, ruleExecInfo_t *rei, int reiSaveFlag );
38 
39 int
40 applyRuleArg331( const char *action, const char *args[MAX_NUM_OF_ARGS_IN_ACTION], int argc,
41  ruleExecInfo_t *rei, int reiSaveFlag ) {
42 #ifdef DEBUG
43  writeToTmp( "entry.log", "applyRuleArg: " );
44  writeToTmp( "entry.log", action );
45  writeToTmp( "entry.log", "(pass on to applyRulePA)\n" );
46 #endif
47  msParamArray_t *inMsParamArray = NULL;
48  int i;
49 
50  i = applyRuleArgPA( action , args, argc, inMsParamArray, rei, reiSaveFlag );
51  return i;
52 }
53 
54 /* utility function */
55 int processReturnRes( Res *res ) {
56  int ret;
57  if ( res->nodeType == N_ERROR ) {
58  ret = RES_ERR_CODE( res );
59  }
60  else {
61  switch ( TYPE( res ) ) {
62  case T_INT:
63  ret = RES_INT_VAL( res );
64  break;
65  default:
66  ret = 0; /* other types */
67  break;
68  }
69  }
70 
71  return ret;
72 }
73 int computeExpression( char *inAction, msParamArray_t *inMsParamArray, ruleExecInfo_t *rei, int reiSaveFlag, char *res ) {
74 #ifdef DEBUG
75  writeToTmp( "entry.log", "computeExpression: " );
76  writeToTmp( "entry.log", inAction );
77  writeToTmp( "entry.log", "\n" );
78 #endif
79 
80  Region *r = make_region( 0, NULL );
81 
82  Res *res0 = parseAndComputeExpressionAdapter( inAction, inMsParamArray, 0, rei, reiSaveFlag, r );
83  int ret;
84  char *res1 = convertResToString( res0 );
85  snprintf( res, MAX_COND_LEN, "%s", res1 );
86  free( res1 );
87 
88  if ( getNodeType( res0 ) == N_ERROR ) {
89  ret = RES_ERR_CODE( res0 );
90  }
91  else {
92  switch ( TYPE( res0 ) ) {
93  case T_INT:
94  ret = RES_INT_VAL( res0 );
95  break;
96  case T_BOOL:
97  ret = !RES_BOOL_VAL( res0 );
98  break;
99  default:
100  ret = 0; /* other types */
101  break;
102  }
103  }
104  region_free( r );
105 
106  return ret;
107 }
108 
109 
110 /* This function computes the expression in inAction using inMsParamArray as the env.
111  * It doesn't update inMsParamArray with the new env. */
112 int
113 applyRule331( char *inAction, msParamArray_t *inMsParamArray, ruleExecInfo_t *rei, int reiSaveFlag ) {
114  return applyRuleBase( inAction, inMsParamArray, 0, rei, reiSaveFlag );
115 }
116 
117 /* This function computes the expression in inAction using inMsParamArray as the env and updates inMsParamArray with the new env. */
118 int
119 applyRuleUpdateParams( char *inAction, msParamArray_t *inMsParamArray, ruleExecInfo_t *rei, int reiSaveFlag ) {
120  return applyRuleBase( inAction, inMsParamArray, 1, rei, reiSaveFlag );
121 
122 }
123 
124 int
125 applyRuleBase( char *inAction, msParamArray_t *inMsParamArray, int updateInMsParam, ruleExecInfo_t *rei, int reiSaveFlag ) {
126 #if defined(DEBUG) || defined(RE_LOG_RULES_TMP)
127  writeToTmp( "entry.log", "applyRule: " );
128  writeToTmp( "entry.log", inAction );
129  writeToTmp( "entry.log", "\n" );
130 #endif
131  if ( GlobalREAuditFlag > 0 ) {
132  RuleEngineEventParam param;
133  param.actionName = inAction;
134  param.ruleIndex = -1;
135  reDebug( APPLY_RULE_BEGIN, -1, &param, NULL, NULL, rei );
136 
137  }
138 
139  Region *r = make_region( 0, NULL );
140  int ret;
141  Res *res;
142  if ( inAction[strlen( inAction ) - 1] == '|' ) {
143  char *inActionCopy = strdup( inAction );
144  inActionCopy[strlen( inAction ) - 1] = '\0';
145  char *action = ( char * ) malloc( sizeof( char ) * strlen( inAction ) + 3 );
146  sprintf( action, "{%s}", inActionCopy );
147  res = parseAndComputeExpressionAdapter( action, inMsParamArray, updateInMsParam, rei, reiSaveFlag, r );
148  free( action );
149  free( inActionCopy );
150  }
151  else {
152  res = parseAndComputeExpressionAdapter( inAction, inMsParamArray, updateInMsParam, rei, reiSaveFlag, r );
153  }
154  ret = processReturnRes( res );
155  region_free( r );
156  if ( GlobalREAuditFlag > 0 ) {
157  RuleEngineEventParam param;
158  param.actionName = inAction;
159  param.ruleIndex = -1;
160  reDebug( APPLY_RULE_END, -1, &param, NULL, NULL, rei );
161  }
162 
163  return ret;
164 
165 }
166 
167 
168 // devnote: this method differs from applyRuleArg in that it allows passing in a preallocated msParamArray_t
169 int applyRuleArgPA( const char *action, const char *args[MAX_NUM_OF_ARGS_IN_ACTION], int argc,
170  msParamArray_t *inMsParamArray, ruleExecInfo_t *rei, int reiSaveFlag ) {
171  int i;
172 
173  Region *r = make_region( 0, NULL );
174  rError_t errmsgBuf;
175  errmsgBuf.errMsg = NULL;
176  errmsgBuf.len = 0;
177  Res *res = computeExpressionWithParams( action, args, argc, rei, reiSaveFlag, inMsParamArray, &errmsgBuf, r );
178  i = processReturnRes( res );
179  region_free( r );
180  /* applyRule(tmpStr, inMsParamArray, rei, reiSaveFlag); */
181  if ( i < 0 ) {
182  logErrMsg( &errmsgBuf, &rei->rsComm->rError );
183  }
184  freeRErrorContent( &errmsgBuf );
185  return i;
186 
187 }
188 
189 
190 
191 
192 
203 int
204 applyAllRules( char *inAction, msParamArray_t *inMsParamArray,
205  ruleExecInfo_t *rei, int reiSaveFlag, int allRuleExecFlag ) {
206 #ifdef DEBUG
207  writeToTmp( "entry.log", "applyAllRules: " );
208  writeToTmp( "entry.log", inAction );
209  writeToTmp( "entry.log", "(set GlobalAllRuleExecFlag and forward to applyRule)\n" );
210 #endif
211 
212  /* store global flag in a temp variables */
213  int tempFlag = GlobalAllRuleExecFlag;
214  /* set global flag */
215  GlobalAllRuleExecFlag = allRuleExecFlag == 1 ? 2 : 1;
216 
217  if ( GlobalREAuditFlag > 0 ) {
218  RuleEngineEventParam param;
219  param.actionName = inAction;
220  param.ruleIndex = -1;
221  reDebug( APPLY_ALL_RULES_BEGIN, -1, &param, NULL, NULL, rei );
222  }
223 
224  int ret = applyRule( inAction, inMsParamArray, rei, reiSaveFlag );
225 
226  if ( GlobalREAuditFlag > 0 ) {
227  RuleEngineEventParam param;
228  param.actionName = inAction;
229  param.ruleIndex = -1;
230  reDebug( APPLY_ALL_RULES_END, -1, &param, NULL, NULL, rei );
231  }
232 
233  /* restore global flag */
234  GlobalAllRuleExecFlag = tempFlag;
235  return ret;
236 }
237 
238 int
239 execMyRule( char * ruleDef, msParamArray_t *inMsParamArray, const char *outParamsDesc,
240  ruleExecInfo_t *rei ) {
241 
242  return execMyRuleWithSaveFlag( ruleDef, inMsParamArray, outParamsDesc, rei, 0 );
243 }
244 void appendOutputToInput( msParamArray_t *inpParamArray, char **outParamNames, int outParamN ) {
245  int i, k, repeat = 0;
246  for ( i = 0; i < outParamN; i++ ) {
247  if ( strcmp( outParamNames[i], ALL_MS_PARAM_KW ) == 0 ) {
248  continue;
249  }
250  repeat = 0;
251  for ( k = 0; k < inpParamArray->len; k++ ) {
252  if ( inpParamArray->msParam[k]->label != NULL && strcmp( outParamNames[i], inpParamArray->msParam[k]->label ) == 0 ) {
253  repeat = 1;
254  break;
255  }
256  }
257  if ( !repeat ) {
258  addMsParam( inpParamArray, outParamNames[i], NULL, NULL, NULL );
259  }
260  }
261 
262 }
263 int extractVarNames( char **varNames, const char *outBuf ) {
264  int n = 0;
265  const char *p = outBuf;
266  const char *psrc = p;
267 
268  for ( ;; ) {
269  if ( *psrc == '%' ) {
270  varNames[n++] = strndup( p, psrc - p );
271  p = psrc + 1;
272  }
273  else if ( *psrc == '\0' ) {
274  if ( strlen( p ) != 0 ) {
275  varNames[n++] = strdup( p );
276  }
277  break;
278  }
279  psrc++;
280  }
281  return n;
282 }
283 
284 int
285 execMyRuleWithSaveFlag( char * ruleDef, msParamArray_t *inMsParamArray, const char *outParamsDesc,
286  ruleExecInfo_t *rei, int reiSaveFlag )
287 
288 {
289  int status;
290  if ( GlobalREAuditFlag ) {
291  RuleEngineEventParam param;
292  param.actionName = ruleDef;
293  param.ruleIndex = -1;
294  reDebug( EXEC_MY_RULE_BEGIN, -1, &param, NULL, NULL, rei );
295  }
296 
297 
298  char *outParamNames[MAX_PARAMS_LEN];
299  int n = extractVarNames( outParamNames, outParamsDesc );
300  appendOutputToInput( inMsParamArray, outParamNames, n );
301 
302  int i;
303  for ( i = 0; i < n; i++ ) {
304  free( outParamNames[i] );
305  }
306 
307  Region *r = make_region( 0, NULL );
308  status =
309  parseAndComputeRuleAdapter( ruleDef, inMsParamArray, rei, reiSaveFlag, r );
310  region_free( r );
311  if ( status < 0 ) {
312  rodsLog( LOG_NOTICE, "execMyRule %s Failed with status %i", ruleDef, status );
313  }
314 
315  if ( GlobalREAuditFlag ) {
316  RuleEngineEventParam param;
317  param.actionName = ruleDef;
318  param.ruleIndex = -1;
319  reDebug( EXEC_MY_RULE_END, -1, &param, NULL, NULL, rei );
320  }
321  return status;
322 }
323 
324 int
325 initRuleStruct( const char* inst_name, rsComm_t *svrComm, const char *irbSet, const char *dvmSet, const char *fnmSet ) {
326  int i;
328 
329  /*strcpy(r2,irbSet);*/
333 
334  i = readRuleStructFromFile( inst_name, irbSet );
335  if ( i < 0 ) {
336  return i;
337  }
338 
339  snprintf( r2, sizeof( r2 ), "%s", dvmSet );
342 
343  while ( strlen( r2 ) > 0 ) {
344  i = rSplitStr( r2, r1, NAME_LEN, r3, RULE_SET_DEF_LENGTH, ',' );
345  if ( i == 0 ) {
347  }
348  if ( i < 0 ) {
349  return i;
350  }
351  snprintf( r2, sizeof( r2 ), "%s", r3 );
352  }
353  snprintf( r2, sizeof( r2 ), "%s", fnmSet );
356 
357  while ( strlen( r2 ) > 0 ) {
358  i = rSplitStr( r2, r1, NAME_LEN, r3, RULE_SET_DEF_LENGTH, ',' );
359  if ( i == 0 ) {
361  }
362  if ( i < 0 ) {
363  return i;
364  }
365  snprintf( r2, sizeof( r2 ), "%s", r3 );
366  }
367 
368  /* read logging settings */
369  if ( svrComm != NULL ) { /* if this is not a process started by a client, then we used the default logging setting */
371  }
372 
373  if ( getenv( RETESTFLAG ) != NULL ) {
374  reTestFlag = atoi( getenv( RETESTFLAG ) );
375  if ( getenv( RELOOPBACKFLAG ) != NULL ) {
376  reLoopBackFlag = atoi( getenv( RELOOPBACKFLAG ) );
377  }
378  else {
379  reLoopBackFlag = 0;
380  }
381  }
382  else {
383  reTestFlag = 0;
384  reLoopBackFlag = 0;
385  }
386  if ( getenv( "GLOBALALLRULEEXECFLAG" ) != NULL ) {
388  }
389 
390  if ( getenv( GLOBALREDEBUGFLAG ) != NULL ) {
391  GlobalREDebugFlag = atoi( getenv( GLOBALREDEBUGFLAG ) );
392  }
393  if ( getenv( GLOBALREAUDITFLAG ) != NULL ) {
394  GlobalREAuditFlag = atoi( getenv( GLOBALREAUDITFLAG ) );
395  }
396  if ( GlobalREAuditFlag == 0 ) {
398  }
399 
400  initializeReDebug( svrComm );
401 
402  return 0;
403 }
404 
405 
406 int
407 readRuleSetFromDB( char *ruleBaseName, char *versionStr, RuleSet *ruleSet, ruleExecInfo_t *rei, rError_t *errmsg, Region *region ) {
408  int i, status;
409  genQueryInp_t genQueryInp;
410  genQueryOut_t *genQueryOut = NULL;
411  char condstr[MAX_NAME_LEN], condstr2[MAX_NAME_LEN];
412  sqlResult_t *r[8];
413  memset( &genQueryInp, 0, sizeof( genQueryInp ) );
414  genQueryInp.maxRows = MAX_SQL_ROWS;
415 
416  snprintf( condstr, MAX_NAME_LEN, "= '%s'", ruleBaseName );
417  addInxVal( &genQueryInp.sqlCondInp, COL_RULE_BASE_MAP_BASE_NAME, condstr );
418  snprintf( condstr2, MAX_NAME_LEN, "= '%s'", versionStr );
419  addInxVal( &genQueryInp.sqlCondInp, COL_RULE_BASE_MAP_VERSION, condstr2 );
420 
423  addInxIval( &genQueryInp.selectInp, COL_RULE_NAME, 1 );
424  addInxIval( &genQueryInp.selectInp, COL_RULE_EVENT, 1 );
425  addInxIval( &genQueryInp.selectInp, COL_RULE_CONDITION, 1 );
426  addInxIval( &genQueryInp.selectInp, COL_RULE_BODY, 1 );
427  addInxIval( &genQueryInp.selectInp, COL_RULE_RECOVERY, 1 );
428  addInxIval( &genQueryInp.selectInp, COL_RULE_ID, 1 );
429  Env *env = newEnv( newHashTable2( 100, region ), NULL, NULL, region );
430  status = rsGenQuery( rei->rsComm, &genQueryInp, &genQueryOut );
431  while ( status >= 0 && genQueryOut->rowCnt > 0 ) {
432  r[0] = getSqlResultByInx( genQueryOut, COL_RULE_BASE_MAP_BASE_NAME );
433  r[1] = getSqlResultByInx( genQueryOut, COL_RULE_NAME );
434  r[2] = getSqlResultByInx( genQueryOut, COL_RULE_EVENT );
435  r[3] = getSqlResultByInx( genQueryOut, COL_RULE_CONDITION );
436  r[4] = getSqlResultByInx( genQueryOut, COL_RULE_BODY );
437  r[5] = getSqlResultByInx( genQueryOut, COL_RULE_RECOVERY );
438  r[6] = getSqlResultByInx( genQueryOut, COL_RULE_ID );
439  for ( i = 0; i < genQueryOut->rowCnt; i++ ) {
440  char ruleStr[MAX_RULE_LEN * 4];
441  /* char *ruleBase = strdup(&r[0]->value[r[0]->len * i]);
442  char *action = strdup(&r[1]->value[r[1]->len * i]); */
443  char *ruleHead = strdup( &r[2]->value[r[2]->len * i] );
444  char *ruleCondition = strdup( &r[3]->value[r[3]->len * i] );
445  char *ruleAction = strdup( &r[4]->value[r[4]->len * i] );
446  char *ruleRecovery = strdup( &r[5]->value[r[5]->len * i] );
447  long ruleId = atol( &r[6]->value[r[6]->len * i] );
448  if ( ruleRecovery[0] == '@' ) {
449  /* rulegen */
450  if ( strcmp( ruleRecovery + 1, "DATA" ) == 0 ) {
451  snprintf( ruleStr, MAX_RULE_LEN * 4, "data %s", ruleHead );
452  }
453  else if ( strcmp( ruleRecovery + 1, "CONSTR" ) == 0 ) {
454  snprintf( ruleStr, MAX_RULE_LEN * 4, "constructor %s : %s", ruleHead, ruleAction );
455  }
456  else if ( strcmp( ruleRecovery + 1, "EXTERN" ) == 0 ) {
457  snprintf( ruleStr, MAX_RULE_LEN * 4, "%s : %s", ruleHead, ruleAction );
458  }
459  else if ( strcmp( ruleRecovery + 1, "FUNC" ) == 0 ) {
460  snprintf( ruleStr, MAX_RULE_LEN * 4, "%s = %s\n @(\"id\", \"%ld\")", ruleHead, ruleAction, ruleId );
461  }
462  else {
463  snprintf( ruleStr, MAX_RULE_LEN * 4, "%s { on %s %s @(\"id\", \"%ld\") }\n", ruleHead, ruleCondition, ruleAction, ruleId );
464  }
465  }
466  else {
467  snprintf( ruleStr, MAX_RULE_LEN * 4, "%s|%s|%s|%s", ruleHead, ruleCondition, ruleAction, ruleRecovery );
468  }
469  Pointer *p = newPointer2( ruleStr );
470  int errloc;
471  int errcode = parseRuleSet( p, ruleSet, env, &errloc, errmsg, region );
472  deletePointer( p );
473  if ( errcode < 0 ) {
474  /* deleteEnv(env, 3); */
475  freeGenQueryOut( &genQueryOut );
476  free( ruleHead ); // cppcheck - Memory leak: ruleHead
477  free( ruleCondition ); // cppcheck - Memory leak: ruleCondition
478  free( ruleAction ); // cppcheck - Memory leak: ruleAction
479  free( ruleRecovery ); // cppcheck - Memory leak: ruleRecovery
480  return errcode;
481  }
482  free( ruleHead ); // cppcheck - Memory leak: ruleHead
483  free( ruleCondition ); // cppcheck - Memory leak: ruleCondition
484  free( ruleAction ); // cppcheck - Memory leak: ruleAction
485  free( ruleRecovery ); // cppcheck - Memory leak: ruleRecovery
486  }
487  genQueryInp.continueInx = genQueryOut->continueInx;
488  freeGenQueryOut( &genQueryOut );
489  if ( genQueryInp.continueInx > 0 ) {
490  /* More to come */
491  status = rsGenQuery( rei->rsComm, &genQueryInp, &genQueryOut );
492  }
493  else {
494  break;
495  }
496  }
497 
498  clearGenQueryInp( &genQueryInp );
499  freeGenQueryOut( &genQueryOut );
500  /* deleteEnv(env, 3); */
501  return 0;
502 }
503 
504 int
505 readRuleStructFromDB( char *ruleBaseName, char *versionStr, ruleStruct_t *inRuleStrct, ruleExecInfo_t *rei ) {
506  genQueryInp_t genQueryInp;
507  genQueryOut_t *genQueryOut = NULL;
508  char condstr[MAX_NAME_LEN], condstr2[MAX_NAME_LEN];
509  sqlResult_t *r[8];
510  memset( &genQueryInp, 0, sizeof( genQueryInp ) );
511  genQueryInp.maxRows = MAX_SQL_ROWS;
512 
513  snprintf( condstr, MAX_NAME_LEN, "= '%s'", ruleBaseName );
514  addInxVal( &genQueryInp.sqlCondInp, COL_RULE_BASE_MAP_BASE_NAME, condstr );
515  snprintf( condstr2, MAX_NAME_LEN, "= '%s'", versionStr );
516  addInxVal( &genQueryInp.sqlCondInp, COL_RULE_BASE_MAP_VERSION, condstr2 );
517 
520  addInxIval( &genQueryInp.selectInp, COL_RULE_NAME, 1 );
521  addInxIval( &genQueryInp.selectInp, COL_RULE_EVENT, 1 );
522  addInxIval( &genQueryInp.selectInp, COL_RULE_CONDITION, 1 );
523  addInxIval( &genQueryInp.selectInp, COL_RULE_BODY, 1 );
524  addInxIval( &genQueryInp.selectInp, COL_RULE_RECOVERY, 1 );
525  addInxIval( &genQueryInp.selectInp, COL_RULE_ID, 1 );
526  int continueInx = 1;
527  while ( continueInx > 0 && rsGenQuery( rei->rsComm, &genQueryInp, &genQueryOut ) >= 0 && genQueryOut->rowCnt > 0 ) {
528  r[0] = getSqlResultByInx( genQueryOut, COL_RULE_BASE_MAP_BASE_NAME );
529  r[1] = getSqlResultByInx( genQueryOut, COL_RULE_NAME );
530  r[2] = getSqlResultByInx( genQueryOut, COL_RULE_EVENT );
531  r[3] = getSqlResultByInx( genQueryOut, COL_RULE_CONDITION );
532  r[4] = getSqlResultByInx( genQueryOut, COL_RULE_BODY );
533  r[5] = getSqlResultByInx( genQueryOut, COL_RULE_RECOVERY );
534  r[6] = getSqlResultByInx( genQueryOut, COL_RULE_ID );
535  for ( int i = 0; i < genQueryOut->rowCnt; i++ ) {
536  inRuleStrct->ruleBase[inRuleStrct->MaxNumOfRules] = strdup( &r[0]->value[r[0]->len * i] );
537  inRuleStrct->action[inRuleStrct->MaxNumOfRules] = strdup( &r[1]->value[r[1]->len * i] );
538  inRuleStrct->ruleHead[inRuleStrct->MaxNumOfRules] = strdup( &r[2]->value[r[2]->len * i] );
539  inRuleStrct->ruleCondition[inRuleStrct->MaxNumOfRules] = strdup( &r[3]->value[r[3]->len * i] );
540  inRuleStrct->ruleAction[inRuleStrct->MaxNumOfRules] = strdup( &r[4]->value[r[4]->len * i] );
541  inRuleStrct->ruleRecovery[inRuleStrct->MaxNumOfRules] = strdup( &r[5]->value[r[5]->len * i] );
542  inRuleStrct->ruleId[inRuleStrct->MaxNumOfRules] = atol( &r[6]->value[r[6]->len * i] );
543  inRuleStrct->MaxNumOfRules++;
544  }
545  continueInx = genQueryInp.continueInx = genQueryOut->continueInx;
546  freeGenQueryOut( &genQueryOut );
547  }
548 
549  clearGenQueryInp( &genQueryInp );
550  freeGenQueryOut( &genQueryOut );
551  return 0;
552 }
553 
554 
555 int
556 readDVMapStructFromDB( char *dvmBaseName, char *versionStr, rulevardef_t *inDvmStrct, ruleExecInfo_t *rei ) {
557  int i, l, status;
558  genQueryInp_t genQueryInp;
559  genQueryOut_t *genQueryOut = NULL;
560  char condstr[MAX_NAME_LEN], condstr2[MAX_NAME_LEN];
561  sqlResult_t *r[5];
562  memset( &genQueryInp, 0, sizeof( genQueryInp ) );
563  genQueryInp.maxRows = MAX_SQL_ROWS;
564 
565  snprintf( condstr, MAX_NAME_LEN, "= '%s'", dvmBaseName );
566  addInxVal( &genQueryInp.sqlCondInp, COL_DVM_BASE_MAP_BASE_NAME, condstr );
567  snprintf( condstr2, MAX_NAME_LEN, "= '%s'", versionStr );
568  addInxVal( &genQueryInp.sqlCondInp, COL_DVM_BASE_MAP_VERSION, condstr2 );
569 
570  addInxIval( &genQueryInp.selectInp, COL_DVM_EXT_VAR_NAME, 1 );
571  addInxIval( &genQueryInp.selectInp, COL_DVM_CONDITION, 1 );
572  addInxIval( &genQueryInp.selectInp, COL_DVM_INT_MAP_PATH, 1 );
573  addInxIval( &genQueryInp.selectInp, COL_DVM_ID, ORDER_BY );
574  l = inDvmStrct->MaxNumOfDVars;
575  status = rsGenQuery( rei->rsComm, &genQueryInp, &genQueryOut );
576  while ( status >= 0 && genQueryOut->rowCnt > 0 ) {
577  r[0] = getSqlResultByInx( genQueryOut, COL_DVM_EXT_VAR_NAME );
578  r[1] = getSqlResultByInx( genQueryOut, COL_DVM_CONDITION );
579  r[2] = getSqlResultByInx( genQueryOut, COL_DVM_INT_MAP_PATH );
580  r[3] = getSqlResultByInx( genQueryOut, COL_DVM_ID );
581  for ( i = 0; i < genQueryOut->rowCnt; i++ ) {
582  inDvmStrct->varName[l] = strdup( &r[0]->value[r[0]->len * i] );
583  inDvmStrct->action[l] = strdup( &r[1]->value[r[1]->len * i] );
584  inDvmStrct->var2CMap[l] = strdup( &r[2]->value[r[2]->len * i] );
585  inDvmStrct->varId[l] = atol( &r[3]->value[r[3]->len * i] );
586  l++;
587  }
588  genQueryInp.continueInx = genQueryOut->continueInx;
589  freeGenQueryOut( &genQueryOut );
590  if ( genQueryInp.continueInx > 0 ) {
591  /* More to come */
592  status = rsGenQuery( rei->rsComm, &genQueryInp, &genQueryOut );
593  }
594  else {
595  break;
596  }
597  }
598 
599  freeGenQueryOut( &genQueryOut );
600  clearGenQueryInp( &genQueryInp );
601  inDvmStrct->MaxNumOfDVars = l;
602  return 0;
603 }
604 
605 
606 
607 int
608 readFNMapStructFromDB( char *fnmBaseName, char *versionStr, fnmapStruct_t *inFnmStrct, ruleExecInfo_t *rei ) {
609  int i, l, status;
610  genQueryInp_t genQueryInp;
611  genQueryOut_t *genQueryOut = NULL;
612  char condstr[MAX_NAME_LEN], condstr2[MAX_NAME_LEN];
613  sqlResult_t *r[5];
614  memset( &genQueryInp, 0, sizeof( genQueryInp ) );
615  genQueryInp.maxRows = MAX_SQL_ROWS;
616 
617  snprintf( condstr, MAX_NAME_LEN, "= '%s'", fnmBaseName );
618  addInxVal( &genQueryInp.sqlCondInp, COL_FNM_BASE_MAP_BASE_NAME, condstr );
619  snprintf( condstr2, MAX_NAME_LEN, "= '%s'", versionStr );
620  addInxVal( &genQueryInp.sqlCondInp, COL_FNM_BASE_MAP_VERSION, condstr2 );
621 
622  addInxIval( &genQueryInp.selectInp, COL_FNM_EXT_FUNC_NAME, 1 );
623  addInxIval( &genQueryInp.selectInp, COL_FNM_INT_FUNC_NAME, 1 );
624  addInxIval( &genQueryInp.selectInp, COL_FNM_ID, ORDER_BY );
625 
626  l = inFnmStrct->MaxNumOfFMaps;
627  status = rsGenQuery( rei->rsComm, &genQueryInp, &genQueryOut );
628  while ( status >= 0 && genQueryOut->rowCnt > 0 ) {
629  r[0] = getSqlResultByInx( genQueryOut, COL_FNM_EXT_FUNC_NAME );
630  r[1] = getSqlResultByInx( genQueryOut, COL_FNM_INT_FUNC_NAME );
631  r[2] = getSqlResultByInx( genQueryOut, COL_FNM_ID );
632  for ( i = 0; i < genQueryOut->rowCnt; i++ ) {
633  inFnmStrct->funcName[l] = strdup( &r[0]->value[r[0]->len * i] );
634  inFnmStrct->func2CMap[l] = strdup( &r[1]->value[r[1]->len * i] );
635  inFnmStrct->fmapId[l] = atol( &r[2]->value[r[2]->len * i] );
636  l++;
637  }
638  genQueryInp.continueInx = genQueryOut->continueInx;
639  freeGenQueryOut( &genQueryOut );
640  if ( genQueryInp.continueInx > 0 ) {
641  /* More to come */
642  status = rsGenQuery( rei->rsComm, &genQueryInp, &genQueryOut );
643  }
644  else {
645  break;
646  }
647  }
648  freeGenQueryOut( &genQueryOut );
649  clearGenQueryInp( &genQueryInp );
650  inFnmStrct->MaxNumOfFMaps = l;
651  return 0;
652 }
653 
654 
655 
656 int
657 readMsrvcStructFromDB( int inStatus, msrvcStruct_t *inMsrvcStrct, ruleExecInfo_t *rei ) {
658  int i, l, status;
659  genQueryInp_t genQueryInp;
660  genQueryOut_t *genQueryOut = NULL;
661  sqlResult_t *r[10];
662  memset( &genQueryInp, 0, sizeof( genQueryInp ) );
663  genQueryInp.maxRows = MAX_SQL_ROWS;
664  char condstr[MAX_NAME_LEN];
665 
666  snprintf( condstr, MAX_NAME_LEN, "= '%i'", inStatus );
667  addInxVal( &genQueryInp.sqlCondInp, COL_MSRVC_STATUS, condstr );
668 
669  addInxIval( &genQueryInp.selectInp, COL_MSRVC_NAME, 1 );
670  addInxIval( &genQueryInp.selectInp, COL_MSRVC_MODULE_NAME, 1 );
671  addInxIval( &genQueryInp.selectInp, COL_MSRVC_SIGNATURE, 1 );
672  addInxIval( &genQueryInp.selectInp, COL_MSRVC_VERSION, 1 );
673  addInxIval( &genQueryInp.selectInp, COL_MSRVC_HOST, 1 );
674  addInxIval( &genQueryInp.selectInp, COL_MSRVC_LOCATION, 1 );
675  addInxIval( &genQueryInp.selectInp, COL_MSRVC_LANGUAGE, 1 );
676  addInxIval( &genQueryInp.selectInp, COL_MSRVC_TYPE_NAME, 1 );
677  addInxIval( &genQueryInp.selectInp, COL_MSRVC_STATUS, 1 );
678  addInxIval( &genQueryInp.selectInp, COL_MSRVC_ID, ORDER_BY );
679 
680  l = inMsrvcStrct->MaxNumOfMsrvcs;
681  status = rsGenQuery( rei->rsComm, &genQueryInp, &genQueryOut );
682  while ( status >= 0 && genQueryOut->rowCnt > 0 ) {
683  r[0] = getSqlResultByInx( genQueryOut, COL_MSRVC_MODULE_NAME );
684  r[1] = getSqlResultByInx( genQueryOut, COL_MSRVC_NAME );
685  r[2] = getSqlResultByInx( genQueryOut, COL_MSRVC_SIGNATURE );
686  r[3] = getSqlResultByInx( genQueryOut, COL_MSRVC_VERSION );
687  r[4] = getSqlResultByInx( genQueryOut, COL_MSRVC_HOST );
688  r[5] = getSqlResultByInx( genQueryOut, COL_MSRVC_LOCATION );
689  r[6] = getSqlResultByInx( genQueryOut, COL_MSRVC_LANGUAGE );
690  r[7] = getSqlResultByInx( genQueryOut, COL_MSRVC_TYPE_NAME );
691  r[8] = getSqlResultByInx( genQueryOut, COL_MSRVC_STATUS );
692  r[9] = getSqlResultByInx( genQueryOut, COL_MSRVC_ID );
693  for ( i = 0; i < genQueryOut->rowCnt; i++ ) {
694  inMsrvcStrct->moduleName[l] = strdup( &r[0]->value[r[0]->len * i] );
695  inMsrvcStrct->msrvcName[l] = strdup( &r[1]->value[r[1]->len * i] );
696  inMsrvcStrct->msrvcSignature[l] = strdup( &r[2]->value[r[2]->len * i] );
697  inMsrvcStrct->msrvcVersion[l] = strdup( &r[3]->value[r[3]->len * i] );
698  inMsrvcStrct->msrvcHost[l] = strdup( &r[4]->value[r[4]->len * i] );
699  inMsrvcStrct->msrvcLocation[l] = strdup( &r[5]->value[r[5]->len * i] );
700  inMsrvcStrct->msrvcLanguage[l] = strdup( &r[6]->value[r[6]->len * i] );
701  inMsrvcStrct->msrvcTypeName[l] = strdup( &r[7]->value[r[7]->len * i] );
702  inMsrvcStrct->msrvcStatus[l] = atol( &r[8]->value[r[8]->len * i] );
703  inMsrvcStrct->msrvcId[l] = atol( &r[9]->value[r[9]->len * i] );
704  l++;
705  }
706  genQueryInp.continueInx = genQueryOut->continueInx;
707  freeGenQueryOut( &genQueryOut );
708  if ( genQueryInp.continueInx > 0 ) {
709  /* More to come */
710  status = rsGenQuery( rei->rsComm, &genQueryInp, &genQueryOut );
711  }
712  else {
713  break;
714  }
715  }
716  freeGenQueryOut( &genQueryOut );
717  clearGenQueryInp( &genQueryInp );
718  inMsrvcStrct->MaxNumOfMsrvcs = l;
719  return 0;
720 }
721 
722 int
723 readRuleStructFromFile( const char* inst_name, const char *ruleBaseName ) {
724  return loadRuleFromCacheOrFile( inst_name, ruleBaseName );
725 }
726 
727 int
728 clearRuleStruct( ruleStruct_t *inRuleStrct ) {
729  int i;
730  for ( i = 0 ; i < inRuleStrct->MaxNumOfRules ; i++ ) {
731  if ( inRuleStrct->ruleBase[i] != NULL ) {
732  free( inRuleStrct->ruleBase[i] );
733  }
734  if ( inRuleStrct->ruleHead[i] != NULL ) {
735  free( inRuleStrct->ruleHead[i] );
736  }
737  if ( inRuleStrct->ruleCondition[i] != NULL ) {
738  free( inRuleStrct->ruleCondition[i] );
739  }
740  if ( inRuleStrct->ruleAction[i] != NULL ) {
741  free( inRuleStrct->ruleAction[i] );
742  }
743  if ( inRuleStrct->ruleRecovery[i] != NULL ) {
744  free( inRuleStrct->ruleRecovery[i] );
745  }
746 
747  }
748  inRuleStrct->MaxNumOfRules = 0;
749  if ( inRuleStrct == &coreRuleStrct ) {
751  }
752  else if ( inRuleStrct == &appRuleStrct ) {
754  }
755 
756  return 0;
757 }
758 
759 int clearDVarStruct( rulevardef_t *inRuleVarDef ) {
760  int i;
761  for ( i = 0 ; i < inRuleVarDef->MaxNumOfDVars; i++ ) {
762  if ( inRuleVarDef->varName[i] != NULL ) {
763  free( inRuleVarDef->varName[i] );
764  }
765  if ( inRuleVarDef->action[i] != NULL ) {
766  free( inRuleVarDef->action[i] );
767  }
768  if ( inRuleVarDef->var2CMap[i] != NULL ) {
769  free( inRuleVarDef->var2CMap[i] );
770  }
771  }
772  inRuleVarDef->MaxNumOfDVars = 0;
773  return 0;
774 }
775 
776 int clearFuncMapStruct( rulefmapdef_t* inRuleFuncMapDef ) {
777  int i;
778  for ( i = 0 ; i < inRuleFuncMapDef->MaxNumOfFMaps; i++ ) {
779  if ( inRuleFuncMapDef->funcName[i] != NULL ) {
780  free( inRuleFuncMapDef->funcName[i] );
781  }
782  if ( inRuleFuncMapDef->func2CMap[i] != NULL ) {
783  free( inRuleFuncMapDef->func2CMap[i] );
784  }
785  }
786  inRuleFuncMapDef->MaxNumOfFMaps = 0;
787  if ( inRuleFuncMapDef == &coreRuleFuncMapDef ) {
789  }
790  else if ( inRuleFuncMapDef == &appRuleFuncMapDef ) {
792  }
793 
794  return 0;
795 }
796 
797 
798 int
799 readDVarStructFromFile( char *dvarBaseName, rulevardef_t *inRuleVarDef ) {
800  int i = 0;
801  char l0[MAX_DVAR_LENGTH];
802  char l1[MAX_DVAR_LENGTH];
803  char l2[MAX_DVAR_LENGTH];
804  char l3[MAX_DVAR_LENGTH];
805  char dvarsFileName[MAX_NAME_LEN];
806  FILE *file;
807  char buf[MAX_DVAR_LENGTH];
808  //char *configDir;
809 
810  i = inRuleVarDef->MaxNumOfDVars;
811 
812  if ( dvarBaseName[0] == '/' || dvarBaseName[0] == '\\' ||
813  dvarBaseName[1] == ':' ) {
814  snprintf( dvarsFileName, MAX_NAME_LEN, "%s", dvarBaseName );
815  }
816  else {
817  std::string cfg_file, fn( dvarBaseName );
818  fn += ".dvm";
820  if ( !ret.ok() ) {
821  irods::log( PASS( ret ) );
822  return ret.code();
823  }
824  snprintf( dvarsFileName, sizeof( dvarsFileName ), "%s", cfg_file.c_str() );
825 
826  }
827  file = fopen( dvarsFileName, "r" );
828  if ( file == NULL ) {
830  "readDvarStructFromFile() could not open dvm file %s\n",
831  dvarsFileName );
833  }
834  buf[MAX_DVAR_LENGTH - 1] = '\0';
835  while ( fgets( buf, MAX_DVAR_LENGTH - 1, file ) != NULL ) {
836  if ( buf[strlen( buf ) - 1] == '\n' ) {
837  buf[strlen( buf ) - 1] = '\0';
838  }
839  if ( buf[0] == '#' || strlen( buf ) < 4 ) {
840  continue;
841  }
842  rSplitStr( buf, l1, MAX_DVAR_LENGTH, l0, MAX_DVAR_LENGTH, '|' );
843  inRuleVarDef->varName[i] = strdup( l1 );
844  rSplitStr( l0, l1, MAX_DVAR_LENGTH, l3, MAX_DVAR_LENGTH, '|' );
845  inRuleVarDef->action[i] = strdup( l1 );
846  rSplitStr( l3, l1, MAX_DVAR_LENGTH, l2, MAX_DVAR_LENGTH, '|' );
847  inRuleVarDef->var2CMap[i] = strdup( l1 );
848  if ( strlen( l2 ) > 0 ) {
849  inRuleVarDef->varId[i] = atoll( l2 );
850  }
851  else {
852  inRuleVarDef->varId[i] = i;
853  }
854  i++;
855  }
856  fclose( file );
857  inRuleVarDef->MaxNumOfDVars = ( long int ) i;
858  return 0;
859 }
860 
861 int
862 readFuncMapStructFromFile( char *fmapBaseName, rulefmapdef_t* inRuleFuncMapDef ) {
863  int i = 0;
864  char l0[MAX_FMAP_LENGTH];
865  char l1[MAX_FMAP_LENGTH];
866  char l2[MAX_FMAP_LENGTH];
867  /* char l3[MAX_FMAP_LENGTH];*/
868  char fmapsFileName[MAX_NAME_LEN];
869  FILE *file;
870  char buf[MAX_FMAP_LENGTH];
871  //char *configDir;
872 
873  i = inRuleFuncMapDef->MaxNumOfFMaps;
874 
875  if ( fmapBaseName[0] == '/' || fmapBaseName[0] == '\\' ||
876  fmapBaseName[1] == ':' ) {
877  snprintf( fmapsFileName, MAX_NAME_LEN, "%s", fmapBaseName );
878  }
879  else {
880  std::string cfg_file, fn( fmapBaseName );
881  fn += ".fnm";
883  if ( !ret.ok() ) {
884  irods::log( PASS( ret ) );
885  return ret.code();
886  }
887  snprintf( fmapsFileName, sizeof( fmapsFileName ), "%s", cfg_file.c_str() );
888  }
889  file = fopen( fmapsFileName, "r" );
890  if ( file == NULL ) {
892  "readFmapStructFromFile() could not open fnm file %s\n",
893  fmapsFileName );
894  return FMAP_FILE_READ_ERROR;
895  }
896  buf[MAX_FMAP_LENGTH - 1] = '\0';
897  while ( fgets( buf, MAX_FMAP_LENGTH - 1, file ) != NULL ) {
898  if ( buf[strlen( buf ) - 1] == '\n' ) {
899  buf[strlen( buf ) - 1] = '\0';
900  }
901  if ( buf[0] == '#' || strlen( buf ) < 4 ) {
902  continue;
903  }
904  rSplitStr( buf, l1, MAX_FMAP_LENGTH, l0, MAX_FMAP_LENGTH, '|' );
905  inRuleFuncMapDef->funcName[i] = strdup( l1 );
906  rSplitStr( l0, l1, MAX_FMAP_LENGTH, l2, MAX_FMAP_LENGTH, '|' );
907  inRuleFuncMapDef->func2CMap[i] = strdup( l1 );
908  if ( strlen( l2 ) > 0 ) {
909  inRuleFuncMapDef->fmapId[i] = atoll( l2 );
910  }
911  else {
912  inRuleFuncMapDef->fmapId[i] = i;
913  }
914  i++;
915  }
916  fclose( file );
917  inRuleFuncMapDef->MaxNumOfFMaps = ( long int ) i;
918  if ( inRuleFuncMapDef == &coreRuleFuncMapDef ) {
920  }
921  else if ( inRuleFuncMapDef == &appRuleFuncMapDef ) {
923  }
924  return 0;
925 }
926 
927 int
928 readMsrvcStructFromFile( char *msrvcFileName, msrvcStruct_t* inMsrvcStruct ) {
929  int i = 0;
930  char l0[MAX_RULE_LENGTH];
931  char l1[MAX_RULE_LENGTH];
932  char l2[MAX_RULE_LENGTH];
933  char mymsrvcFileName[MAX_NAME_LEN];
934  FILE *file;
935  char buf[MAX_RULE_LENGTH];
936 
937 
938  i = inMsrvcStruct->MaxNumOfMsrvcs;
939 
940  if ( msrvcFileName[0] == '/' || msrvcFileName[0] == '\\' ||
941  msrvcFileName[1] == ':' ) {
942  snprintf( mymsrvcFileName, MAX_NAME_LEN, "%s", msrvcFileName );
943  }
944  else {
945  std::string re_dir;
947  "reConfigs",
948  re_dir );
949  if ( !ret.ok() ) {
950  irods::log( PASS( ret ) );
951  return ret.code();
952  }
953 
954  snprintf( mymsrvcFileName, MAX_NAME_LEN, "%s/%s.msi", re_dir.c_str(), msrvcFileName );
955  }
956  file = fopen( mymsrvcFileName, "r" );
957  if ( file == NULL ) {
959  "readMservcStructFromFile() could not open msrvc file %s\n",
960  mymsrvcFileName );
961  return MSRVC_FILE_READ_ERROR;
962  }
963  buf[MAX_RULE_LENGTH - 1] = '\0';
964  while ( fgets( buf, MAX_RULE_LENGTH - 1, file ) != NULL ) {
965  if ( buf[strlen( buf ) - 1] == '\n' ) {
966  buf[strlen( buf ) - 1] = '\0';
967  }
968  if ( buf[0] == '#' || strlen( buf ) < 4 ) {
969  continue;
970  }
971  rSplitStr( buf, l1, MAX_RULE_LENGTH, l0, MAX_RULE_LENGTH, '|' );
972  inMsrvcStruct->moduleName[i] = strdup( l1 );
973 
974  rSplitStr( l0, l1, MAX_RULE_LENGTH, l2, MAX_RULE_LENGTH, '|' );
975  inMsrvcStruct->msrvcName[i] = strdup( l1 );
976  rSplitStr( l2, l1, MAX_RULE_LENGTH, l0, MAX_RULE_LENGTH, '|' );
977  inMsrvcStruct->msrvcSignature[i] = strdup( l1 );
978 
979  rSplitStr( l0, l1, MAX_RULE_LENGTH, l2, MAX_RULE_LENGTH, '|' );
980  inMsrvcStruct->msrvcVersion[i] = strdup( l1 );
981  rSplitStr( l2, l1, MAX_RULE_LENGTH, l0, MAX_RULE_LENGTH, '|' );
982  inMsrvcStruct->msrvcHost[i] = strdup( l1 );
983 
984  rSplitStr( l0, l1, MAX_RULE_LENGTH, l2, MAX_RULE_LENGTH, '|' );
985  inMsrvcStruct->msrvcLocation[i] = strdup( l1 );
986  rSplitStr( l2, l1, MAX_RULE_LENGTH, l0, MAX_RULE_LENGTH, '|' );
987  inMsrvcStruct->msrvcLanguage[i] = strdup( l1 );
988 
989  rSplitStr( l0, l1, MAX_RULE_LENGTH, l2, MAX_RULE_LENGTH, '|' );
990  inMsrvcStruct->msrvcTypeName[i] = strdup( l1 );
991  rSplitStr( l2, l1, MAX_RULE_LENGTH, l0, MAX_RULE_LENGTH, '|' );
992  inMsrvcStruct->msrvcStatus[i] = atol( l1 );
993  if ( strlen( l0 ) > 0 ) {
994  inMsrvcStruct->msrvcId[i] = atol( l1 );
995  }
996  else {
997  inMsrvcStruct->msrvcId[i] = ( long int ) i;
998  }
999  i++;
1000  }
1001  fclose( file );
1002  inMsrvcStruct->MaxNumOfMsrvcs = i;
1003  return 0;
1004 }
1005 
1006 int
1007 getRule( int ri, char *ruleBase, char *ruleHead, char *ruleCondition,
1008  char *ruleAction, char *ruleRecovery, int rSize ) {
1009 
1011  int rule_index = ri < CORE_RULE_INDEX_OFF ? ri : ri - CORE_RULE_INDEX_OFF;
1012  if ( rule_index >= MAX_NUM_OF_RULES ) {
1013  rodsLog( LOG_ERROR, "Failed to get rule at %d", ri );
1014  return SYS_RULE_NOT_FOUND;
1015  }
1016  rstrcpy( ruleBase , ruleStruct.ruleBase[rule_index], rSize );
1017  rstrcpy( ruleHead , ruleStruct.ruleHead[rule_index], rSize );
1018  rstrcpy( ruleCondition , ruleStruct.ruleCondition[rule_index], rSize );
1019  rstrcpy( ruleAction , ruleStruct.ruleAction[rule_index], rSize );
1020  rstrcpy( ruleRecovery , ruleStruct.ruleRecovery[rule_index], rSize );
1021  return 0;
1022 }
1023 
1024 int
1026  ruleExecInfo_t *rei ) {
1027  generalRowInsertInp_t generalRowInsertInp;
1028  char ruleIdStr[MAX_NAME_LEN];
1029  int rc1, i;
1030  int mapPriorityInt = 1;
1031  char mapPriorityStr[50];
1032  endTransactionInp_t endTransactionInp;
1033  char myTime[50];
1034 
1035  memset( &endTransactionInp, 0, sizeof( endTransactionInp_t ) );
1036  getNowStr( myTime );
1037 
1038  /* Before inserting rules and its base map, we need to first version out the base map */
1039  generalRowInsertInp.tableName = "versionRuleBase";
1040  generalRowInsertInp.arg1 = baseName;
1041  generalRowInsertInp.arg2 = myTime;
1042 
1043  rc1 = rsGeneralRowInsert( rei->rsComm, &generalRowInsertInp );
1044  if ( rc1 < 0 ) {
1045  endTransactionInp.arg0 = "rollback";
1046  rsEndTransaction( rei->rsComm, &endTransactionInp );
1047  return rc1;
1048  }
1049 
1050  for ( i = 0; i < ruleSet->len; i++ ) {
1051  RuleDesc *rd = ruleSet->rules[i];
1052  char *ruleType = NULL;
1053  Node *ruleNode = rd->node;
1054  char ruleNameStr[MAX_RULE_LEN];
1055  char ruleCondStr[MAX_RULE_LEN];
1056  char ruleActionRecoveryStr[MAX_RULE_LEN];
1057  Node *avu;
1058  int s;
1059  char *p;
1060  switch ( rd->ruleType ) {
1061  case RK_FUNC:
1062  ruleType = "@FUNC";
1063  p = ruleNameStr;
1064  s = MAX_RULE_LEN;
1065  ruleNameToString( &p, &s, 0, ruleNode->subtrees[0] );
1066  p = ruleCondStr;
1067  s = MAX_RULE_LEN;
1068  termToString( &p, &s, 0, MIN_PREC, ruleNode->subtrees[1], 0 );
1069  p = ruleActionRecoveryStr;
1070  s = MAX_RULE_LEN;
1071  termToString( &p, &s, 0, MIN_PREC, ruleNode->subtrees[2], 0 );
1072  avu = lookupAVUFromMetadata( ruleNode->subtrees[4], "id" );
1073  if ( avu != NULL ) {
1074  rstrcpy( ruleIdStr, avu->subtrees[1]->text, MAX_NAME_LEN );
1075  }
1076  else {
1077  rstrcpy( ruleIdStr, "", MAX_NAME_LEN );
1078  }
1079  break;
1080  case RK_REL:
1081  ruleType = "@REL";
1082  p = ruleNameStr;
1083  s = MAX_RULE_LEN;
1084  ruleNameToString( &p, &s, 0, ruleNode->subtrees[0] );
1085  p = ruleCondStr;
1086  s = MAX_RULE_LEN;
1087  termToString( &p, &s, 0, MIN_PREC, ruleNode->subtrees[1], 0 );
1088  p = ruleActionRecoveryStr;
1089  s = MAX_RULE_LEN;
1090  actionsToString( &p, &s, 0, ruleNode->subtrees[2], ruleNode->subtrees[3] );
1091  avu = lookupAVUFromMetadata( ruleNode->subtrees[4], "id" );
1092  if ( avu != NULL ) {
1093  rstrcpy( ruleIdStr, avu->subtrees[1]->text, MAX_NAME_LEN );
1094  }
1095  else {
1096  rstrcpy( ruleIdStr, "", MAX_NAME_LEN );
1097  }
1098  break;
1099  case RK_DATA:
1100  ruleType = "@DATA";
1101  p = ruleNameStr;
1102  s = MAX_RULE_LEN;
1103  ruleNameToString( &p, &s, 0, ruleNode->subtrees[0] );
1104  rstrcpy( ruleCondStr, "", MAX_RULE_LEN );
1105  rstrcpy( ruleActionRecoveryStr, "", MAX_RULE_LEN );
1106  rstrcpy( ruleIdStr, "", MAX_NAME_LEN );
1107  break;
1108  case RK_CONSTRUCTOR:
1109  ruleType = "@CONSTR";
1110  rstrcpy( ruleNameStr, ruleNode->subtrees[0]->text, MAX_RULE_LEN );
1111  rstrcpy( ruleCondStr, "", MAX_RULE_LEN );
1112  p = ruleActionRecoveryStr;
1113  s = MAX_RULE_LEN;
1114  typeToStringParser( &p, &s, 0, 0, ruleNode->subtrees[1] );
1115  rstrcpy( ruleIdStr, "", MAX_NAME_LEN );
1116  break;
1117  case RK_EXTERN:
1118  ruleType = "@EXTERN";
1119  rstrcpy( ruleNameStr, ruleNode->subtrees[0]->text, MAX_RULE_LEN );
1120  rstrcpy( ruleCondStr, "", MAX_RULE_LEN );
1121  p = ruleActionRecoveryStr;
1122  s = MAX_RULE_LEN;
1123  typeToStringParser( &p, &s, 0, 0, ruleNode->subtrees[1] );
1124  rstrcpy( ruleIdStr, "", MAX_NAME_LEN );
1125  break;
1126  }
1127  generalRowInsertInp.tableName = "ruleTable";
1128  generalRowInsertInp.arg1 = baseName;
1129  sprintf( mapPriorityStr, "%i", mapPriorityInt );
1130  mapPriorityInt++;
1131  generalRowInsertInp.arg2 = mapPriorityStr;
1132  generalRowInsertInp.arg3 = ruleNode->subtrees[0]->text;
1133  generalRowInsertInp.arg4 = ruleNameStr;
1134  generalRowInsertInp.arg5 = ruleCondStr;
1135  generalRowInsertInp.arg6 = ruleActionRecoveryStr;
1136  generalRowInsertInp.arg7 = ruleType;
1137  generalRowInsertInp.arg8 = ruleIdStr;
1138  generalRowInsertInp.arg9 = myTime;
1139 
1140  rc1 = rsGeneralRowInsert( rei->rsComm, &generalRowInsertInp );
1141  if ( rc1 < 0 ) {
1142  endTransactionInp.arg0 = "rollback";
1143  rsEndTransaction( rei->rsComm, &endTransactionInp );
1144  return rc1;
1145  }
1146  }
1147 
1148  endTransactionInp.arg0 = "commit";
1149  rc1 = rsEndTransaction( rei->rsComm, &endTransactionInp );
1150  return rc1;
1151 }
1152 
1153 int
1154 insertRulesIntoDB( char * baseName, ruleStruct_t *coreRuleStruct,
1155  ruleExecInfo_t *rei ) {
1156  generalRowInsertInp_t generalRowInsertInp;
1157  char ruleIdStr[MAX_NAME_LEN];
1158  int rc1, i;
1159  int mapPriorityInt = 1;
1160  char mapPriorityStr[50];
1161  endTransactionInp_t endTransactionInp;
1162  char myTime[50];
1163 
1164  memset( &endTransactionInp, 0, sizeof( endTransactionInp_t ) );
1165  getNowStr( myTime );
1166 
1167  /* Before inserting rules and its base map, we need to first version out the base map */
1168  generalRowInsertInp.tableName = "versionRuleBase";
1169  generalRowInsertInp.arg1 = baseName;
1170  generalRowInsertInp.arg2 = myTime;
1171 
1172  rc1 = rsGeneralRowInsert( rei->rsComm, &generalRowInsertInp );
1173  if ( rc1 < 0 ) {
1174  endTransactionInp.arg0 = "rollback";
1175  rsEndTransaction( rei->rsComm, &endTransactionInp );
1176  return rc1;
1177  }
1178 
1179  for ( i = 0; i < coreRuleStruct->MaxNumOfRules; i++ ) {
1180  generalRowInsertInp.tableName = "ruleTable";
1181  generalRowInsertInp.arg1 = baseName;
1182  sprintf( mapPriorityStr, "%i", mapPriorityInt );
1183  mapPriorityInt++;
1184  generalRowInsertInp.arg2 = mapPriorityStr;
1185  generalRowInsertInp.arg3 = coreRuleStruct->action[i];
1186  generalRowInsertInp.arg4 = coreRuleStruct->ruleHead[i];
1187  generalRowInsertInp.arg5 = coreRuleStruct->ruleCondition[i];
1188  generalRowInsertInp.arg6 = coreRuleStruct->ruleAction[i];
1189  generalRowInsertInp.arg7 = coreRuleStruct->ruleRecovery[i];
1190  generalRowInsertInp.arg8 = ruleIdStr;
1191  generalRowInsertInp.arg9 = myTime;
1192 
1193  rc1 = rsGeneralRowInsert( rei->rsComm, &generalRowInsertInp );
1194  if ( rc1 < 0 ) {
1195  endTransactionInp.arg0 = "rollback";
1196  rsEndTransaction( rei->rsComm, &endTransactionInp );
1197  return rc1;
1198  }
1199  }
1200 
1201  endTransactionInp.arg0 = "commit";
1202  rc1 = rsEndTransaction( rei->rsComm, &endTransactionInp );
1203  return rc1;
1204 }
1205 
1206 int
1207 insertDVMapsIntoDB( char * baseName, dvmStruct_t *coreDVMStruct,
1208  ruleExecInfo_t *rei ) {
1209  generalRowInsertInp_t generalRowInsertInp;
1210  int rc1, i;
1211  endTransactionInp_t endTransactionInp;
1212  char myTime[50];
1213 
1214  memset( &endTransactionInp, 0, sizeof( endTransactionInp_t ) );
1215  getNowStr( myTime );
1216 
1217  /* Before inserting rules and its base map, we need to first version out the base map */
1218  generalRowInsertInp.tableName = "versionDVMBase";
1219  generalRowInsertInp.arg1 = baseName;
1220  generalRowInsertInp.arg2 = myTime;
1221 
1222  rc1 = rsGeneralRowInsert( rei->rsComm, &generalRowInsertInp );
1223  if ( rc1 < 0 ) {
1224  endTransactionInp.arg0 = "rollback";
1225  rsEndTransaction( rei->rsComm, &endTransactionInp );
1226  return rc1;
1227  }
1228 
1229  for ( i = 0; i < coreDVMStruct->MaxNumOfDVars; i++ ) {
1230  generalRowInsertInp.tableName = "dvmTable";
1231  generalRowInsertInp.arg1 = baseName;
1232  generalRowInsertInp.arg2 = coreDVMStruct->varName[i];
1233  generalRowInsertInp.arg3 = coreDVMStruct->action[i];
1234  generalRowInsertInp.arg4 = coreDVMStruct->var2CMap[i];
1235  generalRowInsertInp.arg5 = myTime;
1236 
1237  rc1 = rsGeneralRowInsert( rei->rsComm, &generalRowInsertInp );
1238  if ( rc1 < 0 ) {
1239  endTransactionInp.arg0 = "rollback";
1240  rsEndTransaction( rei->rsComm, &endTransactionInp );
1241  return rc1;
1242  }
1243  }
1244 
1245  endTransactionInp.arg0 = "commit";
1246  rc1 = rsEndTransaction( rei->rsComm, &endTransactionInp );
1247  return rc1;
1248 }
1249 
1250 int
1251 insertFNMapsIntoDB( char * baseName, fnmapStruct_t *coreFNMStruct,
1252  ruleExecInfo_t *rei ) {
1253  generalRowInsertInp_t generalRowInsertInp;
1254  int rc1, i;
1255  endTransactionInp_t endTransactionInp;
1256  char myTime[50];
1257 
1258  memset( &endTransactionInp, 0, sizeof( endTransactionInp_t ) );
1259  getNowStr( myTime );
1260 
1261  /* Before inserting rules and its base map, we need to first version out the base map */
1262  generalRowInsertInp.tableName = "versionFNMBase";
1263  generalRowInsertInp.arg1 = baseName;
1264  generalRowInsertInp.arg2 = myTime;
1265 
1266  rc1 = rsGeneralRowInsert( rei->rsComm, &generalRowInsertInp );
1267  if ( rc1 < 0 ) {
1268  endTransactionInp.arg0 = "rollback";
1269  rsEndTransaction( rei->rsComm, &endTransactionInp );
1270  return rc1;
1271  }
1272 
1273  for ( i = 0; i < coreFNMStruct->MaxNumOfFMaps; i++ ) {
1274  generalRowInsertInp.tableName = "fnmTable";
1275  generalRowInsertInp.arg1 = baseName;
1276  generalRowInsertInp.arg2 = coreFNMStruct->funcName[i];
1277  generalRowInsertInp.arg3 = coreFNMStruct->func2CMap[i];
1278  generalRowInsertInp.arg4 = myTime;
1279 
1280  rc1 = rsGeneralRowInsert( rei->rsComm, &generalRowInsertInp );
1281  if ( rc1 < 0 ) {
1282  endTransactionInp.arg0 = "rollback";
1283  rsEndTransaction( rei->rsComm, &endTransactionInp );
1284  return rc1;
1285  }
1286  }
1287 
1288  endTransactionInp.arg0 = "commit";
1289  rc1 = rsEndTransaction( rei->rsComm, &endTransactionInp );
1290  return rc1;
1291 }
1292 
1293 
1294 
1295 int
1297  ruleExecInfo_t *rei ) {
1298 
1299  generalRowInsertInp_t generalRowInsertInp;
1300  int rc1, i;
1301  endTransactionInp_t endTransactionInp;
1302  char myTime[100];
1303  char myStatus[100];
1304  memset( &endTransactionInp, 0, sizeof( endTransactionInp_t ) );
1305  getNowStr( myTime );
1306 
1307  for ( i = 0; i < coreMsrvcStruct->MaxNumOfMsrvcs; i++ ) {
1308  generalRowInsertInp.tableName = "msrvcTable";
1309  generalRowInsertInp.arg1 = coreMsrvcStruct->moduleName[i];
1310  generalRowInsertInp.arg2 = coreMsrvcStruct->msrvcName[i];
1311  generalRowInsertInp.arg3 = coreMsrvcStruct->msrvcSignature[i];
1312  generalRowInsertInp.arg4 = coreMsrvcStruct->msrvcVersion[i];
1313  generalRowInsertInp.arg5 = coreMsrvcStruct->msrvcHost[i];
1314  generalRowInsertInp.arg6 = coreMsrvcStruct->msrvcLocation[i];
1315  generalRowInsertInp.arg7 = coreMsrvcStruct->msrvcLanguage[i];
1316  generalRowInsertInp.arg8 = coreMsrvcStruct->msrvcTypeName[i];
1317  snprintf( myStatus, 100, "%ld", coreMsrvcStruct->msrvcStatus[i] );
1318  generalRowInsertInp.arg9 = myStatus;
1319  generalRowInsertInp.arg10 = myTime;
1320 
1321 
1322  rc1 = rsGeneralRowInsert( rei->rsComm, &generalRowInsertInp );
1323  if ( rc1 < 0 ) {
1324  endTransactionInp.arg0 = "rollback";
1325  rsEndTransaction( rei->rsComm, &endTransactionInp );
1326  return rc1;
1327  }
1328  }
1329 
1330  endTransactionInp.arg0 = "commit";
1331  rc1 = rsEndTransaction( rei->rsComm, &endTransactionInp );
1332  return rc1;
1333 
1334 }
1335 
1336 
1337 int
1338 writeRulesIntoFile( char * inFileName, ruleStruct_t *myRuleStruct,
1339  ruleExecInfo_t* ) {
1340 
1341  int i;
1342  FILE *file;
1343  char fileName[MAX_NAME_LEN];
1344  //char *configDir;
1345 
1346  if ( inFileName[0] == '/' || inFileName[0] == '\\' ||
1347  inFileName[1] == ':' ) {
1348  snprintf( fileName, MAX_NAME_LEN, "%s", inFileName );
1349  }
1350  else {
1351  std::string cfg_file, fn( inFileName );
1352  fn += ".irb";
1353  irods::error ret = irods::get_full_path_for_config_file( fn, cfg_file );
1354  if ( !ret.ok() ) {
1355  irods::log( PASS( ret ) );
1356  return ret.code();
1357  }
1358  snprintf( fileName, sizeof( fileName ), "%s", cfg_file.c_str() );
1359 
1360  }
1361 
1362 
1363  file = fopen( fileName, "w" );
1364  if ( file == NULL ) {
1366  "writeRulesIntoFile() could not open rules file %s for writing\n",
1367  fileName );
1368  return FILE_OPEN_ERR;
1369  }
1370  for ( i = 0; i < myRuleStruct->MaxNumOfRules; i++ ) {
1371  fprintf( file, "%s|%s|%s|%s|%ld\n", myRuleStruct->ruleHead[i],
1372  myRuleStruct->ruleCondition[i],
1373  myRuleStruct->ruleAction[i],
1374  myRuleStruct->ruleRecovery[i],
1375  myRuleStruct->ruleId[i] );
1376 
1377  }
1378  fclose( file );
1379  return 0;
1380 }
1381 
1382 int
1383 writeDVMapsIntoFile( char * inFileName, dvmStruct_t *myDVMapStruct,
1384  ruleExecInfo_t* ) {
1385  int i;
1386  FILE *file;
1387  char fileName[MAX_NAME_LEN];
1388 
1389  if ( inFileName[0] == '/' || inFileName[0] == '\\' ||
1390  inFileName[1] == ':' ) {
1391  snprintf( fileName, MAX_NAME_LEN, "%s", inFileName );
1392  }
1393  else {
1394  std::string cfg_file, fn( inFileName );
1395  fn += ".dvm";
1396  irods::error ret = irods::get_full_path_for_config_file( fn, cfg_file );
1397  if ( !ret.ok() ) {
1398  irods::log( PASS( ret ) );
1399  return ret.code();
1400  }
1401  snprintf( fileName, sizeof( fileName ), "%s", cfg_file.c_str() );
1402  }
1403 
1404  file = fopen( fileName, "w" );
1405  if ( file == NULL ) {
1407  "writeDVMapsIntoFile() could not open rules file %s for writing\n",
1408  fileName );
1409  return FILE_OPEN_ERR;
1410  }
1411  for ( i = 0; i < myDVMapStruct->MaxNumOfDVars; i++ ) {
1412  fprintf( file, "%s|%s|%s|%ld\n", myDVMapStruct->varName[i],
1413  myDVMapStruct->action[i],
1414  myDVMapStruct->var2CMap[i],
1415  myDVMapStruct->varId[i] );
1416  }
1417  fclose( file );
1418  return 0;
1419 }
1420 
1421 
1422 int
1423 writeFNMapsIntoFile( char * inFileName, fnmapStruct_t *myFNMapStruct,
1424  ruleExecInfo_t* ) {
1425  int i;
1426  FILE *file;
1427  char fileName[MAX_NAME_LEN];
1428 
1429  if ( inFileName[0] == '/' || inFileName[0] == '\\' ||
1430  inFileName[1] == ':' ) {
1431  snprintf( fileName, MAX_NAME_LEN, "%s", inFileName );
1432  }
1433  else {
1434  std::string cfg_file, fn( inFileName );
1435  fn += ".fnm";
1436  irods::error ret = irods::get_full_path_for_config_file( fn, cfg_file );
1437  if ( !ret.ok() ) {
1438  irods::log( PASS( ret ) );
1439  return ret.code();
1440  }
1441  snprintf( fileName, sizeof( fileName ), "%s", cfg_file.c_str() );
1442  }
1443 
1444  file = fopen( fileName, "w" );
1445  if ( file == NULL ) {
1447  "writeFNMapsIntoFile() could not open rules file %s for writing\n",
1448  fileName );
1449  return FILE_OPEN_ERR;
1450  }
1451  for ( i = 0; i < myFNMapStruct->MaxNumOfFMaps; i++ ) {
1452  fprintf( file, "%s|%s|%ld\n", myFNMapStruct->funcName[i],
1453  myFNMapStruct->func2CMap[i],
1454  myFNMapStruct->fmapId[i] );
1455  }
1456  fclose( file );
1457  return 0;
1458 }
1459 
1460 
1461 
1462 int
1463 writeMSrvcsIntoFile( char * inFileName, msrvcStruct_t *myMsrvcStruct,
1464  ruleExecInfo_t* ) {
1465  int i;
1466  FILE *file;
1467  char fileName[MAX_NAME_LEN];
1468 
1469  if ( inFileName[0] == '/' || inFileName[0] == '\\' ||
1470  inFileName[1] == ':' ) {
1471  snprintf( fileName, MAX_NAME_LEN, "%s", inFileName );
1472  }
1473  else {
1474  std::string re_dir;
1476  "reConfigs",
1477  re_dir );
1478  if ( !ret.ok() ) {
1479  irods::log( PASS( ret ) );
1480  return ret.code();
1481  }
1482 
1483  snprintf( fileName, MAX_NAME_LEN, "%s/%s.msi", re_dir.c_str(), inFileName );
1484  }
1485 
1486  file = fopen( fileName, "w" );
1487  if ( file == NULL ) {
1489  "writeMsrvcsIntoFile() could not open microservics file %s for writing\n",
1490  fileName );
1491  return FILE_OPEN_ERR;
1492  }
1493  for ( i = 0; i < myMsrvcStruct->MaxNumOfMsrvcs; i++ ) {
1494  fprintf( file, "%s|%s|%s|%s|%s|%s|%s|%s|%ld|%ld\n",
1495  myMsrvcStruct->moduleName[i],
1496  myMsrvcStruct->msrvcName[i],
1497  myMsrvcStruct->msrvcSignature[i],
1498  myMsrvcStruct->msrvcVersion[i],
1499  myMsrvcStruct->msrvcHost[i],
1500  myMsrvcStruct->msrvcLocation[i],
1501  myMsrvcStruct->msrvcLanguage[i],
1502  myMsrvcStruct->msrvcTypeName[i],
1503  myMsrvcStruct->msrvcStatus[i],
1504  myMsrvcStruct->msrvcId[i] );
1505  }
1506  fclose( file );
1507  return 0;
1508 }
1509 
1510 int
1512  if ( GlobalREDebugFlag > 5 ) {
1513  _writeXMsg( GlobalREDebugFlag, "idbug", "PROCESS END" );
1514  }
1515  return 0;
1516 }
readRuleSetFromDB
int readRuleSetFromDB(char *ruleBaseName, char *versionStr, RuleSet *ruleSet, ruleExecInfo_t *rei, rError_t *errmsg, Region *region)
Definition: nre.reLib1.cpp:407
ruleStruct_t::ruleAction
char * ruleAction[2048]
Definition: reGlobalsExtern.hpp:97
rodsLog
void rodsLog(int level, const char *formatStr,...)
Definition: rodsLog.cpp:86
COL_DVM_BASE_MAP_VERSION
#define COL_DVM_BASE_MAP_VERSION
Definition: rodsGenQuery.h:437
ruleSet::rules
RuleDesc * rules[50000]
Definition: restructs.hpp:284
MAX_SQL_ROWS
#define MAX_SQL_ROWS
Definition: rodsGenQuery.h:16
NULL
#define NULL
Definition: rodsDef.h:70
readMsrvcStructFromDB
int readMsrvcStructFromDB(int inStatus, msrvcStruct_t *inMsrvcStrct, ruleExecInfo_t *rei)
Definition: nre.reLib1.cpp:657
msrvcStruct_t::msrvcStatus
long int msrvcStatus[2048]
Definition: reGlobalsExtern.hpp:132
readFNMapStructFromDB
int readFNMapStructFromDB(char *fnmBaseName, char *versionStr, fnmapStruct_t *inFnmStrct, ruleExecInfo_t *rei)
Definition: nre.reLib1.cpp:608
applyRuleArgPA
int applyRuleArgPA(const char *action, const char *args[20], int argc, msParamArray_t *inMsParamArray, ruleExecInfo_t *rei, int reiSaveFlag)
Definition: nre.reLib1.cpp:169
reDebug
int reDebug(RuleEngineEvent callLabel, int flag, RuleEngineEventParam *param, Node *node, Env *env, ruleExecInfo_t *rei)
Definition: nre.reHelpers1.cpp:641
COL_MSRVC_NAME
#define COL_MSRVC_NAME
Definition: rodsGenQuery.h:487
rsComm_t
Definition: rcConnect.h:145
parser.hpp
writeRulesIntoFile
int writeRulesIntoFile(char *inFileName, ruleStruct_t *myRuleStruct, ruleExecInfo_t *)
Definition: nre.reLib1.cpp:1338
irods::get_full_path_for_config_file
error get_full_path_for_config_file(const std::string &, std::string &)
Definition: irods_get_full_path_for_config_file.cpp:20
convertResToString
char * convertResToString(Res *res0)
Definition: conversion.cpp:556
rError_t::len
int len
Definition: rodsError.h:25
GlobalREAuditFlag
int GlobalREAuditFlag
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:59
readRuleStructFromFile
int readRuleStructFromFile(const char *inst_name, const char *ruleBaseName)
Definition: nre.reLib1.cpp:723
FMAP_FILE_READ_ERROR
@ FMAP_FILE_READ_ERROR
Definition: rodsErrorTable.h:673
GenQueryInp::continueInx
int continueInx
Definition: rodsGenQuery.h:28
appRuleVarDef
rulevardef_t appRuleVarDef
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:51
COL_FNM_EXT_FUNC_NAME
#define COL_FNM_EXT_FUNC_NAME
Definition: rodsGenQuery.h:449
GlobalREDebugFlag
int GlobalREDebugFlag
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:58
readRuleStructFromDB
int readRuleStructFromDB(char *ruleBaseName, char *versionStr, ruleStruct_t *inRuleStrct, ruleExecInfo_t *rei)
Definition: nre.reLib1.cpp:505
RK_FUNC
@ RK_FUNC
Definition: restructs.hpp:265
reHelpers1.hpp
msrvcStruct_t::msrvcHost
char * msrvcHost[2048]
Definition: reGlobalsExtern.hpp:128
COL_MSRVC_VERSION
#define COL_MSRVC_VERSION
Definition: rodsGenQuery.h:497
coreRuleFuncMapDef
rulefmapdef_t coreRuleFuncMapDef
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:49
index.hpp
clearIndex
void clearIndex(Hashtable **ruleIndex)
Definition: index.cpp:15
msrvcStruct_t::msrvcName
char * msrvcName[2048]
Definition: reGlobalsExtern.hpp:125
parseRuleSet
int parseRuleSet(Pointer *e, RuleSet *ruleSet, Env *funcDesc, int *errloc, rError_t *errmsg, Region *r)
Definition: parser.cpp:3179
rulefmapdef_t::MaxNumOfFMaps
int MaxNumOfFMaps
Definition: reGlobalsExtern.hpp:113
userInfo_t::userName
char userName[64]
Definition: rodsUser.h:66
rulevardef_t::varId
long int varId[2048]
Definition: reGlobalsExtern.hpp:107
irods_get_full_path_for_config_file.hpp
parseAndComputeExpressionAdapter
Res * parseAndComputeExpressionAdapter(char *inAction, msParamArray_t *inMsParamArray, int retOutParams, ruleExecInfo_t *rei, int reiSaveFlag, Region *r)
Definition: rules.cpp:613
PASS
#define PASS(prev_error_)
Definition: irods_error.hpp:118
RESC_CORE_RULE_SET
#define RESC_CORE_RULE_SET
Definition: configuration.hpp:12
execMyRuleWithSaveFlag
int execMyRuleWithSaveFlag(char *ruleDef, msParamArray_t *inMsParamArray, const char *outParamsDesc, ruleExecInfo_t *rei, int reiSaveFlag)
Definition: nre.reLib1.cpp:285
computeExpressionWithParams
Res * computeExpressionWithParams(const char *actionName, const char **params, int paramCount, ruleExecInfo_t *rei, int reiSaveFlag, msParamArray_t *vars, rError_t *errmsg, Region *r)
Definition: rules.cpp:256
locks.hpp
generalRowInsertInp_t::arg9
const char * arg9
Definition: generalRowInsert.h:16
getNodeType
#define getNodeType(x)
Definition: restructs.hpp:69
EXEC_MY_RULE_END
@ EXEC_MY_RULE_END
Definition: restructs.hpp:314
COL_MSRVC_ID
#define COL_MSRVC_ID
Definition: rodsGenQuery.h:486
env
Definition: restructs.hpp:226
clearDVarStruct
int clearDVarStruct(rulevardef_t *inRuleVarDef)
Definition: nre.reLib1.cpp:759
COL_RULE_BODY
#define COL_RULE_BODY
Definition: rodsGenQuery.h:396
GenQueryInp
Definition: rodsGenQuery.h:24
SYS_RULE_NOT_FOUND
@ SYS_RULE_NOT_FOUND
Definition: rodsErrorTable.h:202
configuration.hpp
applyRuleBase
int applyRuleBase(char *inAction, msParamArray_t *inMsParamArray, int updateInMsParam, ruleExecInfo_t *rei, int reiSaveFlag)
Definition: nre.reLib1.cpp:125
generalRowInsertInp_t::arg2
const char * arg2
Definition: generalRowInsert.h:9
appendOutputToInput
void appendOutputToInput(msParamArray_t *inpParamArray, char **outParamNames, int outParamN)
Definition: nre.reLib1.cpp:244
generalRowInsertInp_t::arg6
const char * arg6
Definition: generalRowInsert.h:13
COL_RULE_BASE_MAP_PRIORITY
#define COL_RULE_BASE_MAP_PRIORITY
Definition: rodsGenQuery.h:420
generalRowInsertInp_t::arg7
const char * arg7
Definition: generalRowInsert.h:14
RuleDesc::ruleType
RuleType ruleType
Definition: restructs.hpp:276
COL_MSRVC_LANGUAGE
#define COL_MSRVC_LANGUAGE
Definition: rodsGenQuery.h:500
pid_age.p
p
Definition: pid_age.py:13
ruleSet::len
int len
Definition: restructs.hpp:283
EXEC_MY_RULE_BEGIN
@ EXEC_MY_RULE_BEGIN
Definition: restructs.hpp:313
make_region
Region * make_region(size_t is, jmp_buf *label)
Definition: region.cpp:85
node
Definition: restructs.hpp:244
CORE_RULE_INDEX_OFF
#define CORE_RULE_INDEX_OFF
Definition: reconstants.hpp:28
readFuncMapStructFromFile
int readFuncMapStructFromFile(char *fmapBaseName, rulefmapdef_t *inRuleFuncMapDef)
Definition: nre.reLib1.cpp:862
irods::get_full_path_for_unmoved_configs
error get_full_path_for_unmoved_configs(const std::string &, std::string &)
Definition: irods_get_full_path_for_config_file.cpp:43
readICatUserLogging
int readICatUserLogging(char *userName, int *logging, rsComm_t *rsComm)
Definition: configuration.cpp:650
initializeReDebug
int initializeReDebug(rsComm_t *svrComm)
Definition: nre.reHelpers1.cpp:50
RESC_APP_FUNC_DESC_INDEX
#define RESC_APP_FUNC_DESC_INDEX
Definition: configuration.hpp:17
coreRuleVarDef
rulevardef_t coreRuleVarDef
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:48
COL_FNM_BASE_MAP_BASE_NAME
#define COL_FNM_BASE_MAP_BASE_NAME
Definition: rodsGenQuery.h:460
getNowStr
void getNowStr(char *timeStr)
Definition: rcMisc.cpp:1590
RK_DATA
@ RK_DATA
Definition: restructs.hpp:266
TYPE
#define TYPE(x)
Definition: restructs.hpp:23
typeToStringParser
void typeToStringParser(char **p, int *s, int indent, int lifted, Node *n)
Definition: parser.cpp:2143
COL_MSRVC_TYPE_NAME
#define COL_MSRVC_TYPE_NAME
Definition: rodsGenQuery.h:501
addInxVal
int addInxVal(inxValPair_t *inxValPair, int inx, const char *value)
Definition: rcMisc.cpp:921
LOG_ERROR
#define LOG_ERROR
Definition: rodsLog.h:43
pointer
Definition: parser.hpp:34
run_tests.action
action
Definition: run_tests.py:114
rodsConnect.h
appRuleFuncMapDefIndex
Hashtable * appRuleFuncMapDefIndex
Definition: index.cpp:12
ruleEngineEventParam::actionName
char * actionName
Definition: restructs.hpp:319
GenQueryInp::selectInp
inxIvalPair_t selectInp
Definition: rodsGenQuery.h:53
GenQueryInp::maxRows
int maxRows
Definition: rodsGenQuery.h:25
generalRowInsertInp_t::arg4
const char * arg4
Definition: generalRowInsert.h:11
DVARMAP_FILE_READ_ERROR
@ DVARMAP_FILE_READ_ERROR
Definition: rodsErrorTable.h:670
GLOBALREDEBUGFLAG
#define GLOBALREDEBUGFLAG
Definition: reDefines.h:28
ruleStruct_t::ruleId
long int ruleId[2048]
Definition: reGlobalsExtern.hpp:99
rSplitStr
int rSplitStr(const char *inStr, char *outStr1, size_t maxOutLen1, char *outStr2, size_t maxOutLen2, char key)
Definition: stringOpr.cpp:129
newPointer2
Pointer * newPointer2(char *buf)
Definition: parser.cpp:2435
loadRuleFromCacheOrFile
int loadRuleFromCacheOrFile(const char *inst_name, const char *irbSet)
Definition: configuration.cpp:477
MSRVC_FILE_READ_ERROR
@ MSRVC_FILE_READ_ERROR
Definition: rodsErrorTable.h:686
clearRuleStruct
int clearRuleStruct(ruleStruct_t *inRuleStrct)
Definition: nre.reLib1.cpp:728
irods_re_plugin.hpp
logErrMsg
void logErrMsg(rError_t *errmsg, rError_t *system)
Definition: utils.cpp:762
msrvcStruct_t::msrvcId
long int msrvcId[2048]
Definition: reGlobalsExtern.hpp:123
RuleExecInfo::rsComm
rsComm_t * rsComm
Definition: irods_re_structs.hpp:22
rsEndTransaction.hpp
createFuncMapDefIndex
int createFuncMapDefIndex(rulefmapdef_t *inFuncStrct1, Hashtable **ruleIndex)
Definition: index.cpp:267
RK_CONSTRUCTOR
@ RK_CONSTRUCTOR
Definition: restructs.hpp:267
node::text
char * text
Definition: restructs.hpp:252
functions.hpp
MAX_FMAP_LENGTH
#define MAX_FMAP_LENGTH
Definition: reDefines.h:21
GlobalAllRuleExecFlag
int GlobalAllRuleExecFlag
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:57
APPLY_ALL_RULES_END
@ APPLY_ALL_RULES_END
Definition: restructs.hpp:312
COL_FNM_ID
#define COL_FNM_ID
Definition: rodsGenQuery.h:446
msrvcStruct_t::MaxNumOfMsrvcs
int MaxNumOfMsrvcs
Definition: reGlobalsExtern.hpp:122
ruleStruct_t::ruleCondition
char * ruleCondition[2048]
Definition: reGlobalsExtern.hpp:96
initRuleStruct
int initRuleStruct(const char *inst_name, rsComm_t *svrComm, const char *irbSet, const char *dvmSet, const char *fnmSet)
Definition: nre.reLib1.cpp:325
extractVarNames
int extractVarNames(char **varNames, const char *outBuf)
Definition: nre.reLib1.cpp:263
RELOOPBACKFLAG
#define RELOOPBACKFLAG
Definition: reDefines.h:27
ruleStruct_t::ruleHead
char * ruleHead[2048]
Definition: reGlobalsExtern.hpp:95
newHashTable2
Hashtable * newHashTable2(int size, Region *r)
Definition: hashtable.cpp:72
rsComm_t::rError
rError_t rError
Definition: rcConnect.h:158
irods::error::code
long long code() const
Definition: irods_error.cpp:194
rError_t
Definition: rodsError.h:24
COL_DVM_CONDITION
#define COL_DVM_CONDITION
Definition: rodsGenQuery.h:427
ruleType
ruleType
Definition: restructs.hpp:263
ruleStruct_t::MaxNumOfRules
int MaxNumOfRules
Definition: reGlobalsExtern.hpp:92
ruleStruct_t::ruleBase
char * ruleBase[2048]
Definition: reGlobalsExtern.hpp:93
appRuleStrct
ruleStruct_t appRuleStrct
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:50
getSqlResultByInx
sqlResult_t * getSqlResultByInx(genQueryOut_t *genQueryOut, int attriInx)
Definition: rcMisc.cpp:1387
termToString
void termToString(char **p, int *s, int indent, int prec, Node *n, int quote)
Definition: parser.cpp:1889
reGlobals.hpp
node::subtrees
struct node ** subtrees
Definition: restructs.hpp:254
GenQueryOut::continueInx
int continueInx
Definition: rodsGenQuery.h:70
_writeXMsg
int _writeXMsg(int streamId, char *hdr, char *msg)
Definition: xmsgMS.cpp:479
writeMSrvcsIntoFile
int writeMSrvcsIntoFile(char *inFileName, msrvcStruct_t *myMsrvcStruct, ruleExecInfo_t *)
Definition: nre.reLib1.cpp:1463
generalRowInsertInp_t
Definition: generalRowInsert.h:6
rulefmapdef_t::funcName
char * funcName[2048]
Definition: reGlobalsExtern.hpp:114
readDVarStructFromFile
int readDVarStructFromFile(char *dvarBaseName, rulevardef_t *inRuleVarDef)
Definition: nre.reLib1.cpp:799
applyAllRules
int applyAllRules(char *inAction, msParamArray_t *inMsParamArray, ruleExecInfo_t *rei, int reiSaveFlag, int allRuleExecFlag)
Definition: nre.reLib1.cpp:204
MsParamArray::msParam
msParam_t ** msParam
Definition: msParam.h:87
rules.hpp
COL_MSRVC_MODULE_NAME
#define COL_MSRVC_MODULE_NAME
Definition: rodsGenQuery.h:502
generalRowInsertInp_t::arg1
const char * arg1
Definition: generalRowInsert.h:8
COL_MSRVC_SIGNATURE
#define COL_MSRVC_SIGNATURE
Definition: rodsGenQuery.h:488
endTransactionInp_t
Definition: endTransaction.h:6
getRule
int getRule(int ri, char *ruleBase, char *ruleHead, char *ruleCondition, char *ruleAction, char *ruleRecovery, int rSize)
Definition: nre.reLib1.cpp:1007
generalRowInsertInp_t::arg8
const char * arg8
Definition: generalRowInsert.h:15
GenQueryInp::sqlCondInp
inxValPair_t sqlCondInp
Definition: rodsGenQuery.h:56
rulevardef_t
Definition: reGlobalsExtern.hpp:102
insertFNMapsIntoDB
int insertFNMapsIntoDB(char *baseName, fnmapStruct_t *coreFNMStruct, ruleExecInfo_t *rei)
Definition: nre.reLib1.cpp:1251
COL_FNM_INT_FUNC_NAME
#define COL_FNM_INT_FUNC_NAME
Definition: rodsGenQuery.h:450
Cache::logging
int logging
Definition: configuration.hpp:67
MAX_NAME_LEN
#define MAX_NAME_LEN
Definition: rodsDef.h:61
MAX_NUM_OF_ARGS_IN_ACTION
#define MAX_NUM_OF_ARGS_IN_ACTION
Definition: irods_re_structs.hpp:13
COL_RULE_CONDITION
#define COL_RULE_CONDITION
Definition: rodsGenQuery.h:395
MAX_RULE_LENGTH
#define MAX_RULE_LENGTH
Definition: reDefines.h:19
addInxIval
int addInxIval(inxIvalPair_t *inxIvalPair, int inx, int value)
Definition: rcMisc.cpp:883
msrvcStruct_t::msrvcSignature
char * msrvcSignature[2048]
Definition: reGlobalsExtern.hpp:126
RK_EXTERN
@ RK_EXTERN
Definition: restructs.hpp:268
GenQueryOut
Definition: rodsGenQuery.h:67
ruleNameToString
void ruleNameToString(char **p, int *s, int indent, Node *rn)
Definition: parser.cpp:2131
actionsToString
void actionsToString(char **p, int *s, int indent, Node *na, Node *nr)
Definition: parser.cpp:2095
readMsrvcStructFromFile
int readMsrvcStructFromFile(char *msrvcFileName, msrvcStruct_t *inMsrvcStruct)
Definition: nre.reLib1.cpp:928
RESC_APP_RULE_SET
#define RESC_APP_RULE_SET
Definition: configuration.hpp:13
get_irods_version.value
dictionary value
Definition: get_irods_version.py:27
coreRuleFuncMapDefIndex
Hashtable * coreRuleFuncMapDefIndex
Definition: index.cpp:11
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
rsGeneralRowInsert
int rsGeneralRowInsert(rsComm_t *rsComm, generalRowInsertInp_t *generalRowInsertInp)
Definition: rsGeneralRowInsert.cpp:13
processReturnRes
int processReturnRes(Res *res)
Definition: nre.reLib1.cpp:55
GenQueryOut::rowCnt
int rowCnt
Definition: rodsGenQuery.h:68
ruleEngineEventParam::ruleIndex
int ruleIndex
Definition: restructs.hpp:318
irods::log
void log(const error &)
Definition: irods_log.cpp:13
MAX_NUM_OF_RULES
#define MAX_NUM_OF_RULES
Definition: reDefines.h:13
msrvcStruct_t::msrvcTypeName
char * msrvcTypeName[2048]
Definition: reGlobalsExtern.hpp:131
COL_DVM_INT_MAP_PATH
#define COL_DVM_INT_MAP_PATH
Definition: rodsGenQuery.h:428
rulefmapdef_t::fmapId
long int fmapId[2048]
Definition: reGlobalsExtern.hpp:116
reLoopBackFlag
int reLoopBackFlag
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:56
COL_DVM_BASE_MAP_BASE_NAME
#define COL_DVM_BASE_MAP_BASE_NAME
Definition: rodsGenQuery.h:438
RULE_SET_DEF_LENGTH
#define RULE_SET_DEF_LENGTH
Definition: reDefines.h:26
msrvcStruct_t::msrvcVersion
char * msrvcVersion[2048]
Definition: reGlobalsExtern.hpp:127
LOG_NOTICE
#define LOG_NOTICE
Definition: rodsLog.h:33
clearResources
int clearResources(int resources)
Definition: configuration.cpp:169
rsComm_t::clientUser
userInfo_t clientUser
Definition: rcConnect.h:153
APPLY_ALL_RULES_BEGIN
@ APPLY_ALL_RULES_BEGIN
Definition: restructs.hpp:311
region
Definition: region.h:45
T_BOOL
@ T_BOOL
Definition: restructs.hpp:163
irods::error
Definition: irods_error.hpp:23
COL_DVM_EXT_VAR_NAME
#define COL_DVM_EXT_VAR_NAME
Definition: rodsGenQuery.h:426
ruleStruct_t::ruleRecovery
char * ruleRecovery[2048]
Definition: reGlobalsExtern.hpp:98
int
typedef int((*funcPtr)())
RES_INT_VAL
#define RES_INT_VAL(x)
Definition: restructs.hpp:58
MsParamArray::len
int len
Definition: msParam.h:85
MAX_DVAR_LENGTH
#define MAX_DVAR_LENGTH
Definition: reDefines.h:20
MsParam::label
char * label
Definition: msParam.h:77
RuleDesc
Definition: restructs.hpp:272
msrvcStruct_t::moduleName
char * moduleName[2048]
Definition: reGlobalsExtern.hpp:124
rulevardef_t::MaxNumOfDVars
int MaxNumOfDVars
Definition: reGlobalsExtern.hpp:103
rsGeneralRowInsert.hpp
get_db_schema_version.l
l
Definition: get_db_schema_version.py:19
newEnv
Env * newEnv(Hashtable *current, Env *previous, Env *lower, Region *r)
Definition: restructs.cpp:281
MIN_PREC
#define MIN_PREC
Definition: reconstants.hpp:32
rsEndTransaction
int rsEndTransaction(rsComm_t *rsComm, endTransactionInp_t *endTransactionInp)
Definition: rsEndTransaction.cpp:13
RETESTFLAG
#define RETESTFLAG
Definition: reDefines.h:25
coreRuleStrct
ruleStruct_t coreRuleStrct
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:47
readDVMapStructFromDB
int readDVMapStructFromDB(char *dvmBaseName, char *versionStr, rulevardef_t *inDvmStrct, ruleExecInfo_t *rei)
Definition: nre.reLib1.cpp:556
finalizeRuleEngine
int finalizeRuleEngine()
Definition: nre.reLib1.cpp:1511
COL_RULE_ID
#define COL_RULE_ID
Definition: rodsGenQuery.h:390
clearFuncMapStruct
int clearFuncMapStruct(rulefmapdef_t *inRuleFuncMapDef)
Definition: nre.reLib1.cpp:776
execMyRule
int execMyRule(char *ruleDef, msParamArray_t *inMsParamArray, const char *outParamsDesc, ruleExecInfo_t *rei)
Definition: nre.reLib1.cpp:239
MAX_RULE_LEN
#define MAX_RULE_LEN
Definition: reconstants.hpp:9
msrvcStruct_t::msrvcLanguage
char * msrvcLanguage[2048]
Definition: reGlobalsExtern.hpp:130
apiHeaderAll.h
SqlResult
Definition: rodsGenQuery.h:61
msrvcStruct_t::msrvcLocation
char * msrvcLocation[2048]
Definition: reGlobalsExtern.hpp:129
COL_RULE_NAME
#define COL_RULE_NAME
Definition: rodsGenQuery.h:393
update_schema_ids_for_cmake.file
file
Definition: update_schema_ids_for_cmake.py:21
RuleDesc::node
Node * node
Definition: restructs.hpp:275
generalRowInsertInp_t::arg5
const char * arg5
Definition: generalRowInsert.h:12
COL_RULE_EVENT
#define COL_RULE_EVENT
Definition: rodsGenQuery.h:394
RuleExecInfo
Definition: irods_re_structs.hpp:18
deletePointer
void deletePointer(Pointer *buf)
Definition: parser.cpp:2441
MAX_COND_LEN
#define MAX_COND_LEN
Definition: reDefines.h:17
T_INT
@ T_INT
Definition: restructs.hpp:160
GLOBALREAUDITFLAG
#define GLOBALREAUDITFLAG
Definition: reDefines.h:29
APPLY_RULE_END
@ APPLY_RULE_END
Definition: restructs.hpp:310
N_ERROR
@ N_ERROR
Definition: restructs.hpp:111
rulefmapdef_t
Definition: reGlobalsExtern.hpp:112
rulevardef_t::action
char * action[2048]
Definition: reGlobalsExtern.hpp:105
writeFNMapsIntoFile
int writeFNMapsIntoFile(char *inFileName, fnmapStruct_t *myFNMapStruct, ruleExecInfo_t *)
Definition: nre.reLib1.cpp:1423
applyRuleArg331
int applyRuleArg331(const char *action, const char *args[20], int argc, ruleExecInfo_t *rei, int reiSaveFlag)
Definition: nre.reLib1.cpp:40
COL_RULE_BASE_MAP_VERSION
#define COL_RULE_BASE_MAP_VERSION
Definition: rodsGenQuery.h:413
insertDVMapsIntoDB
int insertDVMapsIntoDB(char *baseName, dvmStruct_t *coreDVMStruct, ruleExecInfo_t *rei)
Definition: nre.reLib1.cpp:1207
region_free
void region_free(Region *r)
Definition: region.cpp:146
ALL_MS_PARAM_KW
#define ALL_MS_PARAM_KW
Definition: rodsKeyWdDef.h:73
ruleEngineEventParam
Definition: restructs.hpp:317
applyRule
int applyRule(char *inAction, msParamArray_t *inMsParamArray, ruleExecInfo_t *rei, int reiSaveFlag)
Definition: irods_re_structs.cpp:65
COL_MSRVC_STATUS
#define COL_MSRVC_STATUS
Definition: rodsGenQuery.h:491
ORDER_BY
#define ORDER_BY
Definition: rodsGenQuery.h:81
ruleEngineConfig
Cache ruleEngineConfig
Definition: configuration.cpp:68
appRuleFuncMapDef
rulefmapdef_t appRuleFuncMapDef
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:52
FILE_OPEN_ERR
@ FILE_OPEN_ERR
Definition: rodsErrorTable.h:494
writeDVMapsIntoFile
int writeDVMapsIntoFile(char *inFileName, dvmStruct_t *myDVMapStruct, ruleExecInfo_t *)
Definition: nre.reLib1.cpp:1383
applyRule331
int applyRule331(char *inAction, msParamArray_t *inMsParamArray, ruleExecInfo_t *rei, int reiSaveFlag)
Definition: nre.reLib1.cpp:113
COL_RULE_RECOVERY
#define COL_RULE_RECOVERY
Definition: rodsGenQuery.h:397
generalRowInsertInp_t::tableName
const char * tableName
Definition: generalRowInsert.h:7
writeToTmp
int writeToTmp(char *fileName, char *text)
Definition: utils.cpp:681
insertRulesIntoDB
int insertRulesIntoDB(char *baseName, ruleStruct_t *coreRuleStruct, ruleExecInfo_t *rei)
Definition: nre.reLib1.cpp:1154
COL_FNM_BASE_MAP_VERSION
#define COL_FNM_BASE_MAP_VERSION
Definition: rodsGenQuery.h:459
RES_ERR_CODE
#define RES_ERR_CODE(x)
Definition: restructs.hpp:50
rsGenQuery.hpp
msrvcStruct_t
Definition: reGlobalsExtern.hpp:121
reTestFlag
int reTestFlag
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:55
rulevardef_t::varName
char * varName[2048]
Definition: reGlobalsExtern.hpp:104
coreMsrvcStruct
msrvcStruct_t coreMsrvcStruct
Definition: libirods_rule_engine_plugin-irods_rule_language.cpp:53
COL_MSRVC_HOST
#define COL_MSRVC_HOST
Definition: rodsGenQuery.h:498
insertMSrvcsIntoDB
int insertMSrvcsIntoDB(msrvcStruct_t *coreMsrvcStruct, ruleExecInfo_t *rei)
Definition: nre.reLib1.cpp:1296
ruleStruct_t
Definition: reGlobalsExtern.hpp:91
addMsParam
int addMsParam(msParamArray_t *msParamArray, const char *label, const char *packInstruct, void *inOutStruct, bytesBuf_t *inpOutBuf)
Definition: msParam.cpp:17
rulevardef_t::var2CMap
char * var2CMap[2048]
Definition: reGlobalsExtern.hpp:106
rstrcpy
char * rstrcpy(char *dest, const char *src, int maxLen)
Definition: stringOpr.cpp:51
lookupAVUFromMetadata
Node * lookupAVUFromMetadata(Node *metadata, char *a)
Definition: utils.cpp:911
applyRuleUpdateParams
int applyRuleUpdateParams(char *inAction, msParamArray_t *inMsParamArray, ruleExecInfo_t *rei, int reiSaveFlag)
Definition: nre.reLib1.cpp:119
MsParamArray
Definition: msParam.h:84
COL_DVM_ID
#define COL_DVM_ID
Definition: rodsGenQuery.h:423
freeGenQueryOut
int freeGenQueryOut(genQueryOut_t **genQueryOut)
Definition: rcMisc.cpp:1133
NAME_LEN
#define NAME_LEN
Definition: rodsDef.h:55
computeExpression
int computeExpression(char *inAction, msParamArray_t *inMsParamArray, ruleExecInfo_t *rei, int reiSaveFlag, char *res)
Definition: nre.reLib1.cpp:73
rulefmapdef_t::func2CMap
char * func2CMap[2048]
Definition: reGlobalsExtern.hpp:115
endTransactionInp_t::arg0
char * arg0
Definition: endTransaction.h:7
rError_t::errMsg
rErrMsg_t ** errMsg
Definition: rodsError.h:26
reFuncDefs.hpp
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
COL_MSRVC_LOCATION
#define COL_MSRVC_LOCATION
Definition: rodsGenQuery.h:499
buf
static char buf[64+50+1]
Definition: rsAuthRequest.cpp:21
node::nodeType
int nodeType
Definition: restructs.hpp:245
APPLY_RULE_BEGIN
@ APPLY_RULE_BEGIN
Definition: restructs.hpp:309
RES_BOOL_VAL
#define RES_BOOL_VAL(x)
Definition: restructs.hpp:59
clearGenQueryInp
void clearGenQueryInp(void *voidInp)
Definition: rcMisc.cpp:1118
generalRowInsertInp_t::arg3
const char * arg3
Definition: generalRowInsert.h:10
rsGenQuery
int rsGenQuery(rsComm_t *rsComm, genQueryInp_t *genQueryInp, genQueryOut_t **genQueryOut)
Definition: rsGenQuery.cpp:604
RESC_CORE_FUNC_DESC_INDEX
#define RESC_CORE_FUNC_DESC_INDEX
Definition: configuration.hpp:16
cache.hpp
MAX_PARAMS_LEN
#define MAX_PARAMS_LEN
Definition: reconstants.hpp:8
parseAndComputeRuleAdapter
int parseAndComputeRuleAdapter(char *rule, msParamArray_t *msParamArray, ruleExecInfo_t *rei, int reiSaveFlag, Region *r)
Definition: rules.cpp:103
irods_log.hpp
ruleStruct_t::action
char * action[2048]
Definition: reGlobalsExtern.hpp:94
freeRErrorContent
int freeRErrorContent(rError_t *myError)
Definition: rcMisc.cpp:182
insertRulesIntoDBNew
int insertRulesIntoDBNew(char *baseName, RuleSet *ruleSet, ruleExecInfo_t *rei)
Definition: nre.reLib1.cpp:1025
generalRowInsertInp_t::arg10
const char * arg10
Definition: generalRowInsert.h:17
COL_RULE_BASE_MAP_BASE_NAME
#define COL_RULE_BASE_MAP_BASE_NAME
Definition: rodsGenQuery.h:414
RK_REL
@ RK_REL
Definition: restructs.hpp:264
ruleSet
Definition: restructs.hpp:282