rpm 5.3.7
|
#include "system.h"
#include "rpmio_internal.h"
#include <argv.h>
#include <popt.h>
#include "rpmjs.h"
#include "debug.h"
Go to the source code of this file.
Defines | |
#define | _RPMJS_OPTIONS 0 |
#define | _RPMJS_INTERNAL |
#define | F_ISSET(_flags, _FLAG) ((_flags) & RPMJS_FLAGS_##_FLAG) |
Typedefs | |
typedef void * | JSI_t |
Functions | |
static void | rpmjsFini (void *_js) |
static rpmjs | rpmjsGetPool (rpmioPool pool) |
static rpmjs | rpmjsI (void) |
rpmjs | rpmjsNew (char **av, uint32_t flags) |
Create and load a js interpreter. | |
rpmRC | rpmjsRunFile (rpmjs js, const char *fn, char *const *Iargv, const char **resultp) |
Execute js from a file. | |
rpmRC | rpmjsRun (rpmjs js, const char *str, const char **resultp) |
Execute js string. | |
Variables | |
char ** | environ |
int | _rpmjs_debug = 0 |
rpmjs | _rpmjsI = NULL |
uint32_t | _rpmjs_options = 0 |
int | _rpmjs_zeal = 2 |
struct rpmjs_s | _rpmjs |
struct poptOption | rpmjsIPoptTable [] |
rpmioPool | _rpmjsPool |
#define F_ISSET | ( | _flags, | |
_FLAG | |||
) | ((_flags) & RPMJS_FLAGS_##_FLAG) |
Definition at line 67 of file rpmjs.c.
Referenced by rpmjsNew(), and rpmjsRunFile().
static void rpmjsFini | ( | void * | _js | ) | [static] |
Definition at line 132 of file rpmjs.c.
References _rpmjs_debug, _rpmjsPool, rpmioGetPool(), rpmioNewPool(), and rpmjsFini().
Referenced by rpmjsNew().
static rpmjs rpmjsI | ( | void | ) | [static] |
Definition at line 146 of file rpmjs.c.
References _rpmjs_debug, _rpmjsI, and rpmjsNew().
Referenced by rpmjsNew(), rpmjsRun(), and rpmjsRunFile().
rpmjs rpmjsNew | ( | char ** | av, |
uint32_t | flags | ||
) |
Create and load a js interpreter.
av | js interpreter args (or NULL) |
flags | js interpreter flags ((1<<31): use global interpreter) |
Definition at line 162 of file rpmjs.c.
References _rpmjs_options, _rpmjs_zeal, F_ISSET, getenv(), rpmjsGetPool(), rpmjsI(), and rpmjsLink().
Referenced by expandMacro(), and rpmjsI().
Execute js string.
js | js interpreter (NULL uses global interpreter) |
str | js string to execute (NULL returns RPMRC_FAIL) |
*resultp | js exec result |
Definition at line 383 of file rpmjs.c.
References _rpmjs_debug, rpmjsI(), RPMRC_FAIL, and RPMRC_OK.
Referenced by expandMacro().
Execute js from a file.
js | js interpreter (NULL uses global interpreter) |
fn | js file to run (NULL returns RPMRC_FAIL) |
Iargv | js script argv |
*resultp | js exec result |
Definition at line 300 of file rpmjs.c.
References _rpmjs_debug, environ, F_ISSET, rpmjsI(), RPMRC_FAIL, and RPMRC_OK.
int _rpmjs_debug = 0 |
Definition at line 70 of file rpmjs.c.
Referenced by rpmjsFini(), rpmjsGetPool(), rpmjsI(), rpmjsRun(), and rpmjsRunFile().
uint32_t _rpmjs_options = 0 |
Definition at line 76 of file rpmjs.c.
Referenced by rpmjsNew().
int _rpmjs_zeal = 2 |
Definition at line 79 of file rpmjs.c.
Referenced by rpmjsNew().
Definition at line 73 of file rpmjs.c.
Referenced by rpmcliFini(), rpmioClean(), and rpmjsI().
Definition at line 130 of file rpmjs.c.
Referenced by rpmcliFini(), rpmioClean(), and rpmjsGetPool().
char** environ |
Referenced by main(), makeGPGSignature(), open_dso(), rpmCheckPassPhrase(), rpmjsRunFile(), rpmperlNew(), and rpmsqExecve().
struct poptOption rpmjsIPoptTable[] |
{ { "allow", 'a', POPT_BIT_SET, &_rpmjs.flags, RPMJS_FLAGS_ALLOW, N_("Allow (read-only) access to caller's environmen"), NULL }, { "nocache", 'C', POPT_BIT_SET, &_rpmjs.flags, RPMJS_FLAGS_NOCACHE, N_("Disables compiler caching via JSScript XDR serialization"), NULL }, { "loadrc", 'R', POPT_BIT_SET, &_rpmjs.flags, RPMJS_FLAGS_LOADRC, N_("Load RC file for interpreter based on script filename."), NULL }, { "nowarn", 'W', POPT_BIT_SET, &_rpmjs.flags, RPMJS_FLAGS_NOWARN, N_("Do not report warnings"), NULL }, { "norelimit", 'e', POPT_BIT_CLR, &_rpmjs.flags, RPMJS_FLAGS_RELIMIT, N_("Do not limit regexps to n^3 levels of backtracking"), NULL }, { "nojit", 'J', POPT_BIT_CLR, &_rpmjs.flags, RPMJS_FLAGS_JIT, N_("Disable nanojit"), NULL }, { "nostrict", 'S', POPT_BIT_CLR, &_rpmjs.flags, RPMJS_FLAGS_STRICT, N_("Disable Strict mode"), NULL }, { "noutf8", 'U', POPT_BIT_SET, &_rpmjs.flags, RPMJS_FLAGS_NOUTF8, N_("Disable UTF-8 C string processing"), NULL }, { "xml", 'x', POPT_BIT_SET, &_rpmjs.flags, RPMJS_FLAGS_XML, N_("Parse <!-- comments --> as E4X tokens"), NULL }, { "anonfunfix", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &_rpmjs.flags, RPMJS_FLAGS_ANONFUNFIX, N_("Parse //@line number [\"filename\"] for XUL"), NULL }, { "atline", 'A', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &_rpmjs.flags, RPMJS_FLAGS_ATLINE, N_("Parse //@line number [\"filename\"] for XUL"), NULL }, { "werror", 'w', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &_rpmjs.flags, RPMJS_FLAGS_WERROR, N_("Convert warnings to errors"), NULL }, POPT_TABLEEND }