rpm
5.4.14
|
Go to the source code of this file.
Macros | |
#define | RPMSQL_H |
#define | rpmsqlUnlink(_sql) ((rpmsql)rpmioUnlinkPoolItem((rpmioItem)(_sql), __FUNCTION__, __FILE__, __LINE__)) |
#define | rpmsqlLink(_sql) ((rpmsql)rpmioLinkPoolItem((rpmioItem)(_sql), __FUNCTION__, __FILE__, __LINE__)) |
#define | rpmsqlFree(_sql) ((rpmsql)rpmioFreePoolItem((rpmioItem)(_sql), __FUNCTION__, __FILE__, __LINE__)) |
Typedefs | |
typedef void * | rpmvArg |
typedef struct rpmvd_s * | rpmvd |
typedef struct rpmvc_s * | rpmvc |
typedef struct rpmvt_s * | rpmvt |
typedef struct rpmsql_s * | rpmsql |
Functions | |
int | rpmsqlCmd (rpmsql sql, const char *msg, void *_db, int rc) |
Check sqlite3 return code, displaying error messages. More... | |
rpmsql | rpmsqlUnlink (rpmsql sql) |
Unreference a sql interpreter instance. More... | |
rpmsql | rpmsqlLink (rpmsql sql) |
Reference a sql interpreter instance. More... | |
rpmsql | rpmsqlFree (rpmsql sql) |
Destroy a sql interpreter. More... | |
rpmsql | rpmsqlNew (char **av, uint32_t flags) |
Create and load a sql interpreter. More... | |
const char ** | rpmsqlArgv (rpmsql sql, int *argcp) |
Return arguments from 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 |
int | _rpmvt_debug |
int | _rpmvc_debug |
rpmsql | _rpmsqlI |
volatile int | _rpmsqlSeenInterrupt |
#define rpmsqlFree | ( | _sql | ) | ((rpmsql)rpmioFreePoolItem((rpmioItem)(_sql), __FUNCTION__, __FILE__, __LINE__)) |
#define rpmsqlLink | ( | _sql | ) | ((rpmsql)rpmioLinkPoolItem((rpmioItem)(_sql), __FUNCTION__, __FILE__, __LINE__)) |
#define rpmsqlUnlink | ( | _sql | ) | ((rpmsql)rpmioUnlinkPoolItem((rpmioItem)(_sql), __FUNCTION__, __FILE__, __LINE__)) |
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.
Check sqlite3 return code, displaying error messages.
sql | sql interpreter |
msg | sql method name |
_db | sq; database handle (i.e. "sqlite3 *") |
rc | sql method return code |
Referenced by rpmsqlFini(), and rpmsqlNew().
Destroy a sql interpreter.
sql | sql interpreter |
Referenced by rpmioClean(), sql_close(), and while().
Reference a sql interpreter instance.
sql | sql interpreter |
Referenced by rpmsqlNew().
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().
Unreference a sql interpreter instance.
sql | sql interpreter |
int _rpmsql_debug |
Definition at line 43 of file rpmsql.c.
Referenced by rpmsqlGetPool(), and rpmsqlNew().
rpmsql _rpmsqlI |
Definition at line 52 of file rpmsql.c.
Referenced by _rpmsqlDebugDump(), rpmioClean(), and rpmsqlI().
int _rpmvc_debug |
Definition at line 49 of file rpmsql.c.
Referenced by rpmvcGetPool(), and rpmvcNew().
int _rpmvt_debug |
Definition at line 46 of file rpmsql.c.
Referenced by rpmvtGetPool(), and rpmvtNew().