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

Go to the source code of this file.

Macros

#define rpmjsUnlink(_js)   ((rpmjs)rpmioUnlinkPoolItem((rpmioItem)(_js), __FUNCTION__, __FILE__, __LINE__))
 
#define rpmjsLink(_js)   ((rpmjs)rpmioLinkPoolItem((rpmioItem)(_js), __FUNCTION__, __FILE__, __LINE__))
 
#define rpmjsFree(_js)   ((rpmjs)rpmioFreePoolItem((rpmioItem)(_js), __FUNCTION__, __FILE__, __LINE__))
 

Typedefs

typedef struct rpmjs_s * rpmjs
 

Functions

rpmjs rpmjsUnlink (rpmjs js)
 Unreference a js interpreter instance. More...
 
rpmjs rpmjsLink (rpmjs js)
 Reference a js interpreter instance. More...
 
rpmjs rpmjsFree (rpmjs js)
 Destroy a js interpreter. More...
 
rpmjs rpmjsNew (char **av, uint32_t flags)
 Create and load a js interpreter. More...
 
rpmRC rpmjsRunFile (rpmjs js, const char *fn, char *const *Iargv, const char **resultp)
 Execute js from a file. More...
 
rpmRC rpmjsRun (rpmjs js, const char *str, const char **resultp)
 Execute js string. More...
 

Variables

int _rpmjs_debug
 
rpmjs _rpmjsI
 
uint32_t _rpmjs_options
 
int _rpmjs_zeal
 

Macro Definition Documentation

§ rpmjsFree

#define rpmjsFree (   _js)    ((rpmjs)rpmioFreePoolItem((rpmioItem)(_js), __FUNCTION__, __FILE__, __LINE__))

Definition at line 107 of file rpmjs.h.

§ rpmjsLink

#define rpmjsLink (   _js)    ((rpmjs)rpmioLinkPoolItem((rpmioItem)(_js), __FUNCTION__, __FILE__, __LINE__))

Definition at line 95 of file rpmjs.h.

§ rpmjsUnlink

#define rpmjsUnlink (   _js)    ((rpmjs)rpmioUnlinkPoolItem((rpmioItem)(_js), __FUNCTION__, __FILE__, __LINE__))

Definition at line 84 of file rpmjs.h.

Typedef Documentation

§ rpmjs

typedef struct rpmjs_s* rpmjs

Definition at line 11 of file rpmjs.h.

Function Documentation

§ rpmjsFree()

rpmjs rpmjsFree ( rpmjs  js)

Destroy a js interpreter.

Parameters
jsjs interpreter
Returns
NULL on last dereference

Referenced by expandMacro(), psmWait(), rpmcliFini(), and rpmioClean().

§ rpmjsLink()

rpmjs rpmjsLink ( rpmjs  js)

Reference a js interpreter instance.

Parameters
jsjs interpreter
Returns
new js interpreter reference

Referenced by rpmjsNew().

§ rpmjsNew()

rpmjs rpmjsNew ( char **  av,
uint32_t  flags 
)

Create and load a js interpreter.

Parameters
avjs interpreter args (or NULL)
flagsjs interpreter flags ((1<<31): use global interpreter)
Returns
new js interpreter

Definition at line 171 of file rpmjs.c.

References _rpmjs_options, _rpmjs_zeal, DBG, errno, F_ISSET, getenv(), rpmjsGetPool(), rpmjsI(), rpmjsLink(), rpmlog(), RPMLOG_WARNING, SEEK_SET, and xstrdup().

Referenced by expandMacro(), psmWait(), and rpmjsI().

§ rpmjsRun()

rpmRC rpmjsRun ( rpmjs  js,
const char *  str,
const char **  resultp 
)

Execute js string.

Parameters
jsjs interpreter (NULL uses global interpreter)
strjs string to execute (NULL returns RPMRC_FAIL)
*resultpjs exec result
Returns
RPMRC_OK on success

Definition at line 410 of file rpmjs.c.

References DBG, rpmjsI(), RPMRC_FAIL, RPMRC_OK, and xmalloc.

Referenced by expandMacro(), and psmWait().

§ rpmjsRunFile()

rpmRC rpmjsRunFile ( rpmjs  js,
const char *  fn,
char *const *  Iargv,
const char **  resultp 
)

Execute js from a file.

Parameters
jsjs interpreter (NULL uses global interpreter)
fnjs file to run (NULL returns RPMRC_FAIL)
Iargvjs script argv
*resultpjs exec result
Returns
RPMRC_OK on success

Definition at line 317 of file rpmjs.c.

References DBG, environ, F_ISSET, rpmjsI(), RPMRC_FAIL, and RPMRC_OK.

§ rpmjsUnlink()

rpmjs rpmjsUnlink ( rpmjs  js)

Unreference a js interpreter instance.

Parameters
jsjs interpreter
Returns
NULL on last dereference

Variable Documentation

§ _rpmjs_debug

int _rpmjs_debug

Definition at line 74 of file rpmjs.c.

Referenced by rpmjsGetPool().

§ _rpmjs_options

uint32_t _rpmjs_options

Definition at line 83 of file rpmjs.c.

Referenced by rpmjsNew().

§ _rpmjs_zeal

int _rpmjs_zeal

Definition at line 86 of file rpmjs.c.

Referenced by rpmjsNew().

§ _rpmjsI

rpmjs _rpmjsI

Definition at line 80 of file rpmjs.c.

Referenced by rpmcliFini(), rpmioClean(), and rpmjsI().