python-module/cpplmodule.cc
/**
 * Get policy definition and corresponding function handler from memory.
 */
Get policy definition and corresponding function handler from memory.
Get policy definition and corresponding function handler from memory .
static PyObject *cpplmodule_read_policy_definition(PyObject *self, PyObject *args)
{
  PyObject *retval;
  char *policyDefinitionString, *functionHandlerLibBuf;
  int functionHandlerLibBuf_len;
  PolicyDefinition *pd;
  Binary functionHandlerLib;
  if (!PyArg_ParseTuple(args, "ss#", &policyDefinitionString, &functionHandlerLibBuf, &functionHandlerLibBuf_len)) {
    return NULL;
  }
  functionHandlerLib.read_from_mem(functionHandlerLibBuf, functionHandlerLibBuf_len * 8);
  try {
    pd = cppl_read_policy_definition(policyDefinitionString, &functionHandlerLib);
  }
  catch (std::string s) {
    return PyErr_Format(CpplError, "%s", s.c_str());
  }
  long long pd_key = (long long)pd;
  pd_list[pd_key] = pd;
  retval = Py_BuildValue("L", pd_key);
  return retval;
}
static PyObject * cpplmodule_read_policy_definition ( PyObject * self , PyObject * args ) { PyObject * retval ; char * policyDefinitionString , * functionHandlerLibBuf ; int functionHandlerLibBuf_len ; PolicyDefinition * pd ; Binary functionHandlerLib ; if ( ! PyArg_ParseTuple ( args , " " , & policyDefinitionString , & functionHandlerLibBuf , & functionHandlerLibBuf_len ) ) { return NULL ; } functionHandlerLib . read_from_mem ( functionHandlerLibBuf , functionHandlerLibBuf_len * 8 ) ; try { pd = cppl_read_policy_definition ( policyDefinitionString , & functionHandlerLib ) ; } catch ( std :: string s ) { return PyErr_Format ( CpplError , " " , s . c_str ( ) ) ; } long long pd_key = ( long long ) pd ; pd_list [ pd_key ] = pd ; retval = Py_BuildValue ( " " , pd_key ) ; return retval ; }
Get policy definition and corresponding function handler from memory.
Get policy definition and corresponding function handler from memory .