rpm
5.4.14
|
#include "system.h"
#include <popt.h>
#include "rpmio_internal.h"
#include <rpmmacro.h>
#include <rpmdir.h>
#include <rpmurl.h>
#include <mire.h>
#include <rpmsql.h>
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | _RPMIOB_INTERNAL /* rpmiobSlurp */ |
#define | _RPMSQL_INTERNAL |
#define | _RPMVT_INTERNAL |
#define | _RPMVC_INTERNAL |
#define | readline(sql, p) local_getline(sql, p) |
#define | add_history(X) |
#define | read_history(X) |
#define | write_history(X) |
#define | stifle_history(X) |
#define | VTDBG(_vt, _l) if ((_vt) && (_vt)->debug) fprintf _l |
#define | VTDBGNOISY(_vt, _l) if ((_vt) && (_vt)->debug < 0) fprintf _l |
#define | VCDBG(_vc, _l) if ((_vc)->debug) fprintf _l |
#define | VCDBGNOISY(_vc, _l) if ((_vc)->debug < 0) fprintf _l |
#define | rpmsqlDebugDump(_sql) _rpmsqlDebugDump(_sql, __FUNCTION__, __FILE__, __LINE__) |
Functions | |
static void | rpmvtFini (void *_VT) |
rpmvt pool destructor. More... | |
static rpmvt | rpmvtGetPool (rpmioPool pool) |
rpmvt | rpmvtNew (void *db, void *pModule, const char *const *argv, rpmvd vd) |
static void | rpmvcFini (void *_VC) |
rpmvc pool destructor. More... | |
static rpmvc | rpmvcGetPool (rpmioPool pool) |
rpmvc | rpmvcNew (rpmvt vt, int nrows) |
static void | _rpmsqlDebugDump (rpmsql sql, const char *_func, const char *_fn, unsigned _ln) |
static rpmsql | rpmsqlI (void) |
Return the global interpreter, creating laziliy if needed. More... | |
static void | rpmsqlFini (void *_sql) |
rpmsql pool destructor. More... | |
static rpmsql | rpmsqlGetPool (rpmioPool pool) |
const char ** | rpmsqlArgv (rpmsql sql, int *argcp) |
Return arguments from a sql interpreter. More... | |
rpmsql | rpmsqlNew (char **av, uint32_t flags) |
Create and load a sql interpreter. More... | |
rpmRC | rpmsqlRun (rpmsql sql, const char *str, const char **resultp) |
Execute sql from STRING | FILE | STDIN | INTERACTIVE. More... | |
Variables | |
int | _rpmsql_debug = 0 |
int | _rpmvt_debug = 0 |
int | _rpmvc_debug = 0 |
rpmsql | _rpmsqlI = NULL |
volatile int | _rpmsqlSeenInterrupt |
rpmioPool | _rpmvtPool |
rpmioPool | _rpmvcPool |
rpmioPool | _rpmsqlPool |
#define _RPMIOB_INTERNAL /* rpmiobSlurp */ |
#define read_history | ( | X | ) |
Definition at line 36 of file rpmsql.c.
Referenced by rpmsqlRun().
#define rpmsqlDebugDump | ( | _sql | ) | _rpmsqlDebugDump(_sql, __FUNCTION__, __FILE__, __LINE__) |
#define stifle_history | ( | X | ) |
Definition at line 38 of file rpmsql.c.
Referenced by rpmsqlRun().
Definition at line 580 of file rpmsql.c.
Referenced by rpmvcFini().
Definition at line 64 of file rpmsql.c.
Referenced by rpmvtNew().
Definition at line 65 of file rpmsql.c.
Referenced by rpmvtFini().
#define write_history | ( | X | ) |
Definition at line 37 of file rpmsql.c.
Referenced by rpmsqlRun().
|
static |
Definition at line 816 of file rpmsql.c.
References _rpmsqlI, argvCount(), and fprintf().
Return arguments from a sql interpreter.
sql | sql interpreter |
*argcp | no. of arguments |
Definition at line 5230 of file rpmsql.c.
References argvCount(), and av.
rpmsql pool destructor.
Definition at line 5160 of file rpmsql.c.
References _free(), argvFree(), Fclose(), NULL, rpmiobFree(), rpmsqlCmd(), and void.
Referenced by rpmsqlGetPool().
Definition at line 5214 of file rpmsql.c.
References _rpmsql_debug, _rpmsqlPool, memset(), NULL, rpmioGetPool(), rpmioNewPool(), and rpmsqlFini().
Referenced by rpmsqlNew().
Return the global interpreter, creating laziliy if needed.
Definition at line 976 of file rpmsql.c.
References _rpmsqlI, NULL, and rpmsqlNew().
Referenced by rpmsqlNew(), and rpmsqlRun().
rpmsql rpmsqlNew | ( | char ** | av, |
uint32_t | flags | ||
) |
Create and load a sql interpreter.
av | sql interpreter args (or NULL) |
flags | sql interpreter flags |
Definition at line 5300 of file rpmsql.c.
References _free(), _rpmsql_debug, Access(), argvAppend(), argvCount(), argvPrint(), av, F_ISSET, Fclose(), fdDup(), flags, getenv(), memset(), NULL, R_OK, rpmExpand(), rpmGetPath(), rpmiobNew(), rpmsqlCmd(), rpmsqlGetPool(), rpmsqlI(), rpmsqlLink(), void, xstrdup(), and xx.
Referenced by rpmsqlI(), sql_open(), and while().
Execute sql from STRING | FILE | STDIN | INTERACTIVE.
The str argument is used to determine how it should be run: A leading '/' indicates a FILE, containing SQL commands. A "-" or "stdin" argument used STD for SQL commands. An empty "" string assumes INTERACTIVE, like STDIN but with prompts. Otherwise, the STRING argument is treated as a sql command.
sql | sql interpreter (NULL uses global interpreter) |
str | sql string to execute (NULL returns RPMRC_FAIL) |
*resultp | sql interpreter result |
Definition at line 5404 of file rpmsql.c.
References _, _free(), assert(), Fclose(), fdDup(), Fdopen(), Ferror(), Fflush(), _FD_s::flags, Fopen(), fprintf(), Fwrite(), nb, NULL, rc, read_history, rpmExpand(), rpmiobRTrim(), rpmiobStr(), RPMRC_FAIL, rpmsqlI(), stifle_history, strcmp(), void, write_history, xisspace(), and xstrdup().
Referenced by while().
rpmvc pool destructor.
Definition at line 585 of file rpmsql.c.
References NULL, VCDBGNOISY, and void.
Referenced by rpmvcGetPool().
Definition at line 601 of file rpmsql.c.
References _rpmvc_debug, _rpmvcPool, memset(), NULL, rpmioGetPool(), rpmioNewPool(), and rpmvcFini().
Referenced by rpmvcNew().
Definition at line 617 of file rpmsql.c.
References _rpmvc_debug, NULL, and rpmvcGetPool().
rpmvt pool destructor.
Definition at line 70 of file rpmsql.c.
References argvFree(), and VTDBGNOISY.
Referenced by rpmvtGetPool().
Definition at line 92 of file rpmsql.c.
References _rpmvt_debug, _rpmvtPool, memset(), NULL, rpmioGetPool(), rpmioNewPool(), and rpmvtFini().
Referenced by rpmvtNew().
Definition at line 108 of file rpmsql.c.
References _free(), _rpmvt_debug, argv, argvAppend(), argvCount(), argvSplit(), assert(), NULL, rpmExpand(), rpmvtGetPool(), void, VTDBG, and xx.
int _rpmsql_debug = 0 |
Definition at line 43 of file rpmsql.c.
Referenced by rpmsqlGetPool(), and rpmsqlNew().
Definition at line 52 of file rpmsql.c.
Referenced by _rpmsqlDebugDump(), rpmioClean(), and rpmsqlI().
rpmioPool _rpmsqlPool |
Definition at line 5212 of file rpmsql.c.
Referenced by rpmioClean(), and rpmsqlGetPool().
int _rpmvc_debug = 0 |
Definition at line 49 of file rpmsql.c.
Referenced by rpmvcGetPool(), and rpmvcNew().
rpmioPool _rpmvcPool |
Definition at line 599 of file rpmsql.c.
Referenced by rpmioClean(), and rpmvcGetPool().
int _rpmvt_debug = 0 |
Definition at line 46 of file rpmsql.c.
Referenced by rpmvtGetPool(), and rpmvtNew().
rpmioPool _rpmvtPool |
Definition at line 90 of file rpmsql.c.
Referenced by rpmioClean(), and rpmvtGetPool().