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)  

rules.hpp File Reference
#include "parser.hpp"
#include "utils.hpp"
#include "arithmetics.hpp"
#include "typing.hpp"
#include "irods_ms_plugin.hpp"
Include dependency graph for rules.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int setLocalVarValue (char *varName, ruleExecInfo_t *rei, Res *res, char *errmsg, Region *r)
 
int readRuleSetFromFile (const char *ruleBaseName, RuleSet *ruleSet, Env *funcDesc, int *errloc, rError_t *errmsg, Region *r)
 
int readRuleSetFromLocalFile (const char *ruleBaseName, const char *fileName, RuleSet *ruleSet, Env *funcDesc, int *errloc, rError_t *errmsg, Region *r)
 
int parseAndComputeMsParamArrayToEnv (msParamArray_t *msParamArray, Env *global, ruleExecInfo_t *rei, int reiSaveFlag, rError_t *errmsg, Region *r)
 
int parseAndComputeRule (char *expr, Env *env, ruleExecInfo_t *rei, int reiSaveFlag, rError_t *errmsg, Region *r)
 
int parseAndComputeRuleNewEnv (char *expr, ruleExecInfo_t *rei, int reiSaveFlag, msParamArray_t *msParamArray, rError_t *errmsg, Region *r)
 
int parseAndComputeRuleAdapter (char *rule, msParamArray_t *msParamArray, ruleExecInfo_t *rei, int reiSaveFlag, Region *r)
 
ResparseAndComputeExpression (char *expr, Env *env, ruleExecInfo_t *rei, int reiSaveFlag, rError_t *errmsg, Region *r)
 
ResparseAndComputeExpressionAdapter (char *inAction, msParamArray_t *inMsParamArray, int retOutParams, ruleExecInfo_t *rei, int reiSaveFlag, Region *r)
 
RescomputeExpressionWithParams (const char *actionName, const char **params, int paramCount, ruleExecInfo_t *rei, int reiSaveFlag, msParamArray_t *vars, rError_t *errmsg, Region *r)
 
RescomputeNode (Node *expr, Node *reco, Env *env, ruleExecInfo_t *rei, int reiSaveFlag, rError_t *errmsg, Region *r)
 
ExprTypetypeRule (RuleDesc *ruleNode, Env *funcDesc, Hashtable *varTypes, List *typingConstraints, rError_t *errmsg, Node **errnode, Region *r)
 
ExprTypetypeRuleSet (RuleSet *ruleset, rError_t *errmsg, Node **errnode, Region *r)
 
execCmdOut_taddCmdExecOutToEnv (Env *global, Region *r)
 
void freeCmdExecOut (execCmdOut_t *ruleExecOut)
 
RuleDescgetRuleDesc (int ri)
 
int generateRuleTypes (RuleSet *inRuleSet, Hashtable *symbol_type_table, Region *r)
 
int overflow (const char *expr, int len)
 
EnvdefaultEnv (Region *r)
 

Function Documentation

◆ addCmdExecOutToEnv()

execCmdOut_t* addCmdExecOutToEnv ( Env global,
Region r 
)

◆ 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 at line 256 of file rules.cpp.

References addRErrorMsg(), buf, clearDelayed(), Cache::clearDelayed, computeNode(), convertMsParamArrayToEnv(), createFunctionNode(), env::current, deleteFromHashTable(), ERR_MSG_LEN, MAX_NAME_LEN, MAX_RULE_LEN, newEnv(), newErrorRes(), newHashTable2(), newNode(), NULL, overflow(), RE_BUFFER_OVERFLOW, region_alloc(), ruleEngineConfig, TK_STRING, and writeToTmp().

Referenced by applyRuleArgPA().

Here is the call graph for this function:

◆ computeNode()

Res* computeNode ( Node expr,
Node reco,
Env env,
ruleExecInfo_t rei,
int  reiSaveFlag,
rError_t errmsg,
Region r 
)

Definition at line 458 of file rules.cpp.

References cpEnv(), cpRes, evaluateActions(), evaluateExpression3(), getNodeType, GlobalAllRuleExecFlag, make_region(), N_ACTIONS, newErrorRes(), newHashTable2(), NULL, region_free(), RETURN, and typeNode().

Referenced by computeExpressionWithParams(), parseAndComputeExpression(), and processXMsg().

Here is the call graph for this function:

◆ defaultEnv()

Env* defaultEnv ( Region r)

Definition at line 96 of file rules.cpp.

References newEnv(), newHashTable2(), and NULL.

Referenced by parseAndComputeExpressionAdapter(), parseAndComputeRuleAdapter(), and parseAndComputeRuleNewEnv().

Here is the call graph for this function:

◆ freeCmdExecOut()

◆ generateRuleTypes()

int generateRuleTypes ( RuleSet inRuleSet,
Hashtable symbol_type_table,
Region r 
)

Definition at line 571 of file rules.cpp.

References insertIntoHashTable(), ruleSet::len, newFuncTypeVarArg(), newSimpType(), newTVar(), RuleDesc::node, NULL, OPTION_VARARG_ONCE, region_alloc(), RULE_NODE_NUM_PARAMS, ruleSet::rules, node::subtrees, T_INT, and node::text.

Here is the call graph for this function:

◆ getRuleDesc()

◆ overflow()

int overflow ( const char *  expr,
int  len 
)

◆ parseAndComputeExpression()

◆ parseAndComputeExpressionAdapter()

Res* parseAndComputeExpressionAdapter ( char *  inAction,
msParamArray_t inMsParamArray,
int  retOutParams,
ruleExecInfo_t rei,
int  reiSaveFlag,
Region r 
)

◆ parseAndComputeMsParamArrayToEnv()

int parseAndComputeMsParamArrayToEnv ( msParamArray_t msParamArray,
Env global,
ruleExecInfo_t rei,
int  reiSaveFlag,
rError_t errmsg,
Region r 
)

Definition at line 65 of file rules.cpp.

References convertMsParamToRes(), getNodeType, MsParam::label, MsParamArray::len, MsParamArray::msParam, N_ERROR, newRes(), NULL, parseAndComputeExpression(), RES_ERR_CODE, T_STRING, T_UNSPECED, node::text, TYPE, and updateInEnv().

Referenced by parseAndComputeRuleAdapter().

Here is the call graph for this function:

◆ parseAndComputeRule()

◆ parseAndComputeRuleAdapter()

int parseAndComputeRuleAdapter ( char *  rule,
msParamArray_t msParamArray,
ruleExecInfo_t rei,
int  reiSaveFlag,
Region r 
)

◆ parseAndComputeRuleNewEnv()

int parseAndComputeRuleNewEnv ( char *  expr,
ruleExecInfo_t rei,
int  reiSaveFlag,
msParamArray_t msParamArray,
rError_t errmsg,
Region r 
)

Definition at line 161 of file rules.cpp.

References convertEnvToMsParamArray(), convertMsParamArrayToEnv(), env::current, defaultEnv(), deleteFromHashTable(), error, RuleExecInfo::msParamArray, NULL, parseAndComputeRule(), env::previous, and RE_ERROR.

Here is the call graph for this function:

◆ readRuleSetFromFile()

int readRuleSetFromFile ( const char *  ruleBaseName,
RuleSet ruleSet,
Env funcDesc,
int errloc,
rError_t errmsg,
Region r 
)

Read a set of rules from files. return 0 success otherwise error code

Definition at line 28 of file rules.cpp.

References getRuleBasePath(), MAX_NAME_LEN, and readRuleSetFromLocalFile().

Here is the call graph for this function:

◆ readRuleSetFromLocalFile()

int readRuleSetFromLocalFile ( const char *  ruleBaseName,
const char *  fileName,
RuleSet ruleSet,
Env funcDesc,
int errloc,
rError_t errmsg,
Region r 
)

Definition at line 34 of file rules.cpp.

References addRErrorMsg(), deletePointer(), terminate_irods_processes::e, ERR_MSG_LEN, update_schema_ids_for_cmake::file, getNodeType, newPointer(), NODE_EXPR_POS, NULL, parseRuleSet(), RE_TYPE_ERROR, irods.pypyodbc::restype, RULES_FILE_READ_ERROR, T_ERROR, and typeRuleSet().

Referenced by readRuleSetFromFile(), and readRuleStructAndRuleSetFromFile().

Here is the call graph for this function:

◆ setLocalVarValue()

int setLocalVarValue ( char *  varName,
ruleExecInfo_t rei,
Res res,
char *  errmsg,
Region r 
)

◆ typeRule()

ExprType* typeRule ( RuleDesc ruleNode,
Env funcDesc,
Hashtable varTypes,
List typingConstraints,
rError_t errmsg,
Node **  errnode,
Region r 
)

Definition at line 319 of file rules.cpp.

References ABSURDITY, addRErrorMsg(), node::base, buf, RuleDesc::dynamictyping, ERR_MSG_LEN, ERR_MSG_SEP, error, generateErrMsg(), getNodeType, newSimpType(), RuleDesc::node, NODE_EXPR_POS, postProcessActions(), postProcessCoercion(), RE_ERROR, RE_TYPE_ERROR, solveConstraints(), node::subtrees, T_BOOL, T_DYNAMIC, T_ERROR, T_INT, T_VAR, node::text, typeExpression3(), and typeToString().

Referenced by parseAndComputeRule(), and typeRuleSet().

Here is the call graph for this function:

◆ typeRuleSet()