PyTools.c File Reference

#include <FCConfig.h>
#include "PyTools.h"
#include <stdarg.h>
#include <string.h>
#include <assert.h>
#include <compile.h>
#include <eval.h>

Go to the source code of this file.

Defines

#define MAX   2024

Functions

static void fixPdbRetval (PyObject *moddict)
PyObjectPP_Compile_Codestr (PPStringModes mode, const char *codestr)
int PP_Convert_Result (PyObject *presult, const char *resFormat, void *resTarget)
PyObjectPP_Debug_Bytecode (PyObject *codeobject, PyObject *moddict)
PyObjectPP_Debug_Codestr (PPStringModes mode, const char *codestring, PyObject *moddict)
PyObjectPP_Debug_Function (PyObject *func, PyObject *args)
void PP_Fetch_Error_Text ()
int PP_Get_Global (const char *modname, const char *varname, const char *resfmt, void *cresult)
int PP_Get_Member (PyObject *pobject, const char *attrname, const char *resfmt, void *cresult)
const char * PP_Init (const char *modname)
PyObjectPP_Load_Attribute (const char *modname, const char *attrname)
PyObjectPP_Load_Module (const char *modname)
int PP_Make_Dummy_Module (const char *modname)
int PP_Run_Bytecode (PyObject *codeobj, const char *modname, const char *resfmt, void *restarget)
int PP_Run_Codestr (PPStringModes mode, const char *code, const char *modname, const char *resfmt, void *cresult)
int PP_Run_Command_Line (const char *prompt)
int PP_Run_Function (const char *modname, const char *funcname, const char *resfmt, void *cresult, const char *argfmt,...)
int PP_Run_Known_Callable (PyObject *object, const char *resfmt, void *cresult, const char *argfmt,...)
int PP_Run_Method (PyObject *pobject, const char *method, const char *resfmt, void *cresult, const char *argfmt,...)
int PP_Set_Global (const char *modname, const char *varname, const char *valfmt,...)
int PP_Set_Member (PyObject *pobject, const char *attrname, const char *argfmt,...)

Variables

int PP_DEBUG = 0
char PP_last_error_info [MAX]
char PP_last_error_trace [MAX]
char PP_last_error_type [MAX]
PyObjectPP_last_traceback = NULL
int PP_RELOAD = 0

Define Documentation

#define MAX   2024

Definition at line 203 of file PyTools.c.


Function Documentation

static void fixPdbRetval ( PyObject moddict  )  [static]

Definition at line 584 of file PyTools.c.

Referenced by PP_Debug_Bytecode(), and PP_Debug_Codestr().

PyObject* PP_Compile_Codestr ( PPStringModes  mode,
const char *  codestr 
)

Definition at line 515 of file PyTools.c.

References PP_EXPRESSION, PP_STATEMENT, and Sketcher::start.

int PP_Convert_Result ( PyObject presult,
const char *  resFormat,
void *  resTarget 
)
PyObject* PP_Debug_Bytecode ( PyObject codeobject,
PyObject moddict 
)

Definition at line 605 of file PyTools.c.

References fixPdbRetval(), and PP_Run_Function().

Referenced by PP_Run_Bytecode().

PyObject* PP_Debug_Codestr ( PPStringModes  mode,
const char *  codestring,
PyObject moddict 
)

Definition at line 589 of file PyTools.c.

References fixPdbRetval(), PP_EXPRESSION, and PP_Run_Function().

Referenced by PP_Run_Codestr().

PyObject* PP_Debug_Function ( PyObject func,
PyObject args 
)

Definition at line 138 of file PyTools.c.

References PP_Run_Function().

Referenced by PP_Run_Function(), PP_Run_Known_Callable(), and PP_Run_Method().

void PP_Fetch_Error_Text (  ) 
int PP_Get_Global ( const char *  modname,
const char *  varname,
const char *  resfmt,
void *  cresult 
)

Definition at line 331 of file PyTools.c.

References PP_Convert_Result(), and PP_Load_Attribute().

int PP_Get_Member ( PyObject pobject,
const char *  attrname,
const char *  resfmt,
void *  cresult 
)

Definition at line 70 of file PyTools.c.

References PP_Convert_Result().

const char* PP_Init ( const char *  modname  ) 

Definition at line 375 of file PyTools.c.

Referenced by PP_Load_Attribute(), and PP_Load_Module().

PyObject* PP_Load_Attribute ( const char *  modname,
const char *  attrname 
)

Definition at line 446 of file PyTools.c.

References PP_Init(), and PP_Load_Module().

Referenced by PP_Get_Global(), and PP_Run_Function().

PyObject* PP_Load_Module ( const char *  modname  ) 
int PP_Make_Dummy_Module ( const char *  modname  ) 

Definition at line 390 of file PyTools.c.

int PP_Run_Bytecode ( PyObject codeobj,
const char *  modname,
const char *  resfmt,
void *  restarget 
)

Definition at line 533 of file PyTools.c.

References PP_Convert_Result(), PP_DEBUG, PP_Debug_Bytecode(), and PP_Load_Module().

int PP_Run_Codestr ( PPStringModes  mode,
const char *  code,
const char *  modname,
const char *  resfmt,
void *  cresult 
)
int PP_Run_Command_Line ( const char *  prompt  ) 

Definition at line 459 of file PyTools.c.

Referenced by Base::InterpreterSingleton::runCommandLine().

int PP_Run_Function ( const char *  modname,
const char *  funcname,
const char *  resfmt,
void *  cresult,
const char *  argfmt,
  ... 
)
int PP_Run_Known_Callable ( PyObject object,
const char *  resfmt,
void *  cresult,
const char *  argfmt,
  ... 
)

Definition at line 164 of file PyTools.c.

References PP_Convert_Result(), PP_DEBUG, and PP_Debug_Function().

int PP_Run_Method ( PyObject pobject,
const char *  method,
const char *  resfmt,
void *  cresult,
const char *  argfmt,
  ... 
)
int PP_Set_Global ( const char *  modname,
const char *  varname,
const char *  valfmt,
  ... 
)

Definition at line 340 of file PyTools.c.

References PP_Load_Module(), and result.

int PP_Set_Member ( PyObject pobject,
const char *  attrname,
const char *  argfmt,
  ... 
)

Definition at line 81 of file PyTools.c.

References result.


Variable Documentation

int PP_DEBUG = 0
char PP_last_error_info[MAX]

Definition at line 210 of file PyTools.c.

Referenced by PP_Fetch_Error_Text(), and Base::PyException::PyException().

Definition at line 211 of file PyTools.c.

Referenced by PP_Fetch_Error_Text(), and Base::PyException::PyException().

char PP_last_error_type[MAX]

Definition at line 209 of file PyTools.c.

Referenced by PP_Fetch_Error_Text(), and Base::PyException::PyException().

Definition at line 212 of file PyTools.c.

Referenced by PP_Fetch_Error_Text().

int PP_RELOAD = 0

Definition at line 371 of file PyTools.c.

Referenced by PP_Load_Module().


Generated on Wed Nov 23 19:01:20 2011 for FreeCAD by  doxygen 1.6.1