rpm  5.4.15
Macros | Typedefs | Functions | Variables
rpmpython.h File Reference
#include <rpmiotypes.h>
#include <rpmio.h>
Include dependency graph for rpmpython.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define rpmpythonUnlink(_python)   ((rpmpython)rpmioUnlinkPoolItem((rpmioItem)(_python), __FUNCTION__, __FILE__, __LINE__))
 
#define rpmpythonLink(_python)   ((rpmpython)rpmioLinkPoolItem((rpmioItem)(_python), __FUNCTION__, __FILE__, __LINE__))
 
#define rpmpythonFree(_python)   ((rpmpython)rpmioFreePoolItem((rpmioItem)(_python), __FUNCTION__, __FILE__, __LINE__))
 

Typedefs

typedef struct rpmpython_s * rpmpython
 

Functions

rpmpython rpmpythonUnlink (rpmpython python)
 Unreference a python interpreter instance. More...
 
rpmpython rpmpythonLink (rpmpython python)
 Reference a python interpreter instance. More...
 
rpmpython rpmpythonFree (rpmpython python)
 Destroy a python interpreter. More...
 
rpmpython rpmpythonNew (char **av, uint32_t flags)
 Create and load a python interpreter. More...
 
rpmRC rpmpythonRunFile (rpmpython python, const char *fn, const char **resultp)
 Execute python from a file. More...
 
rpmRC rpmpythonRun (rpmpython python, const char *str, const char **resultp)
 Execute python string. More...
 

Variables

int _rpmpython_debug
 
rpmpython _rpmpythonI
 

Macro Definition Documentation

#define rpmpythonFree (   _python)    ((rpmpython)rpmioFreePoolItem((rpmioItem)(_python), __FUNCTION__, __FILE__, __LINE__))

Definition at line 65 of file rpmpython.h.

#define rpmpythonLink (   _python)    ((rpmpython)rpmioLinkPoolItem((rpmioItem)(_python), __FUNCTION__, __FILE__, __LINE__))

Definition at line 53 of file rpmpython.h.

#define rpmpythonUnlink (   _python)    ((rpmpython)rpmioUnlinkPoolItem((rpmioItem)(_python), __FUNCTION__, __FILE__, __LINE__))

Definition at line 42 of file rpmpython.h.

Typedef Documentation

typedef struct rpmpython_s* rpmpython

Definition at line 11 of file rpmpython.h.

Function Documentation

rpmpython rpmpythonFree ( rpmpython  python)

Destroy a python interpreter.

Parameters
pythonpython interpreter
Returns
NULL on last dereference

Referenced by expandMacro(), and rpmioClean().

rpmpython rpmpythonLink ( rpmpython  python)

Reference a python interpreter instance.

Parameters
pythonpython interpreter
Returns
new python interpreter reference

Referenced by rpmpythonNew().

rpmpython rpmpythonNew ( char **  av,
uint32_t  flags 
)

Create and load a python interpreter.

Parameters
avpython interpreter args (or NULL)
flagspython interpreter flags ((1<<31): use global interpreter)
Returns
new python interpreter

Definition at line 72 of file rpmpython.c.

References _free(), _rpmpython_debug, _rpmpythonI, argvCount(), rpmExpand(), rpmpythonGetPool(), rpmpythonI(), rpmpythonLink(), and rpmpythonRun().

Referenced by expandMacro(), and rpmpythonI().

rpmRC rpmpythonRun ( rpmpython  python,
const char *  str,
const char **  resultp 
)

Execute python string.

Parameters
pythonpython interpreter (NULL uses global interpreter)
strpython string to execute (NULL returns RPMRC_FAIL)
*resultppython exec result
Returns
RPMRC_OK on success

Definition at line 159 of file rpmpython.c.

References _free(), _rpmpython_debug, d, rpmpythonI(), rpmpythonSlurp(), RPMRC_FAIL, RPMRC_OK, and v.

Referenced by expandMacro(), and rpmpythonNew().

rpmRC rpmpythonRunFile ( rpmpython  python,
const char *  fn,
const char **  resultp 
)

Execute python from a file.

Parameters
pythonpython interpreter (NULL uses global interpreter)
fnpython file to run (NULL returns RPMRC_FAIL)
*resultppython exec result
Returns
RPMRC_OK on success

Definition at line 110 of file rpmpython.c.

References _rpmpython_debug, rpmpythonI(), RPMRC_FAIL, and RPMRC_OK.

rpmpython rpmpythonUnlink ( rpmpython  python)

Unreference a python interpreter instance.

Parameters
pythonpython interpreter
Returns
NULL on last dereference

Variable Documentation

int _rpmpython_debug

Definition at line 20 of file rpmpython.c.

Referenced by rpmpythonGetPool(), rpmpythonNew(), rpmpythonRun(), and rpmpythonRunFile().

rpmpython _rpmpythonI

Definition at line 23 of file rpmpython.c.

Referenced by rpmioClean(), rpmpythonI(), and rpmpythonNew().