rpm
5.4.10
|
#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)->debug) fprintf _l |
#define | VTDBGNOISY(_vt, _l) if ((_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. | |
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. | |
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. | |
static void | rpmsqlFini (void *_sql) |
rpmsql pool destructor. | |
static rpmsql | rpmsqlGetPool (rpmioPool pool) |
const char ** | rpmsqlArgv (rpmsql sql, int *argcp) |
Return arguments from a sql interpreter. | |
rpmsql | rpmsqlNew (char **av, uint32_t flags) |
Create and load a sql interpreter. | |
rpmRC | rpmsqlRun (rpmsql sql, const char *str, const char **resultp) |
Execute sql from STRING | FILE | STDIN | INTERACTIVE. |
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().
#define VCDBGNOISY | ( | _vc, | |
_l | |||
) | if ((_vc)->debug < 0) fprintf _l |
Definition at line 578 of file rpmsql.c.
Referenced by rpmvcFini().
#define VTDBG | ( | _vt, | |
_l | |||
) | if ((_vt)->debug) fprintf _l |
Definition at line 64 of file rpmsql.c.
Referenced by rpmvtNew().
#define VTDBGNOISY | ( | _vt, | |
_l | |||
) | if ((_vt)->debug < 0) fprintf _l |
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 814 of file rpmsql.c.
References _rpmsqlI, and argvCount().
const char** rpmsqlArgv | ( | rpmsql | sql, |
int * | argcp | ||
) |
Return arguments from a sql interpreter.
sql | sql interpreter |
*argcp | no. of arguments |
Definition at line 5225 of file rpmsql.c.
References argvCount().
|
static |
rpmsql pool destructor.
Definition at line 5155 of file rpmsql.c.
References _free(), argvFree(), Fclose(), rpmiobFree(), and rpmsqlCmd().
Referenced by rpmsqlGetPool().
Definition at line 5209 of file rpmsql.c.
References _rpmsql_debug, _rpmsqlPool, rpmioGetPool(), rpmioNewPool(), and rpmsqlFini().
Referenced by rpmsqlNew().
|
static |
Return the global interpreter, creating laziliy if needed.
Definition at line 974 of file rpmsql.c.
References _rpmsqlI, 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 5295 of file rpmsql.c.
References _free(), _rpmsql_debug, Access(), argvAppend(), argvCount(), argvPrint(), F_ISSET, Fclose(), fdDup(), getenv(), R_OK, rpmExpand(), rpmGetPath(), rpmiobNew(), rpmsqlCmd(), rpmsqlGetPool(), rpmsqlI(), rpmsqlLink(), and xstrdup().
Referenced by expandMacro(), rpmsqlI(), and sql_open().
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 5397 of file rpmsql.c.
References _, _free(), Fclose(), fdDup(), Fdopen(), Ferror(), Fflush(), _FD_s::flags, Fopen(), Fwrite(), read_history, rpmExpand(), rpmiobRTrim(), rpmiobStr(), RPMRC_FAIL, rpmsqlI(), stifle_history, write_history, xisspace(), and xstrdup().
Referenced by expandMacro().
|
static |
rpmvc pool destructor.
Definition at line 583 of file rpmsql.c.
References VCDBGNOISY.
Referenced by rpmvcGetPool().
Definition at line 599 of file rpmsql.c.
References _rpmvc_debug, _rpmvcPool, rpmioGetPool(), rpmioNewPool(), and rpmvcFini().
Referenced by rpmvcNew().
Definition at line 615 of file rpmsql.c.
References _rpmvc_debug, and rpmvcGetPool().
|
static |
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, rpmioGetPool(), rpmioNewPool(), and rpmvtFini().
Referenced by rpmvtNew().
Definition at line 108 of file rpmsql.c.
References _free(), _rpmvt_debug, argvAppend(), argvCount(), argvSplit(), rpmExpand(), rpmvtGetPool(), and VTDBG.
int _rpmsql_debug = 0 |
Definition at line 43 of file rpmsql.c.
Referenced by rpmsqlGetPool(), and rpmsqlNew().
rpmsql _rpmsqlI = NULL |
Definition at line 52 of file rpmsql.c.
Referenced by _rpmsqlDebugDump(), rpmioClean(), and rpmsqlI().
rpmioPool _rpmsqlPool |
Definition at line 5207 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 597 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().