rpm  5.4.10
Data Structures | Macros | Typedefs | Functions | Variables
trb.c File Reference
#include "system.h"
#include <rpmio.h>
#include <argv.h>
#include <rpmruby.h>
#include "rpm-rb.h"
#include "rpmds-rb.h"
#include "rpmfi-rb.h"
#include "rpmhdr-rb.h"
#include "rpmmc-rb.h"
#include "rpmmi-rb.h"
#include "rpmps-rb.h"
#include "rpmte-rb.h"
#include "rpmts-rb.h"
#include <rpmcli.h>
#include "debug.h"
Include dependency graph for trb.c:

Go to the source code of this file.

Data Structures

struct  rpmrbClassTable_s
 

Macros

#define _RPMRUBY_INTERNAL
 

Typedefs

typedef struct rpmrbClassTable_srpmrbClassTable
 

Functions

static rpmRC rpmrbLoadFile (rpmruby rb, const char *pre, const char *fn)
 
static void rpmrbLoadClasses (void)
 
int main (int argc, char *argv[])
 

Variables

static int _debug = 0
 
static int _loglvl = 0
 
static int _test = 1
 
static struct rpmrbClassTable_s classTable []
 
static size_t nclassTable = sizeof(classTable) / sizeof(classTable[0])
 
static const char tscripts [] = "./tscripts/"
 
static const char * _acknack
 
static struct poptOption optionsTable []
 

Macro Definition Documentation

§ _RPMRUBY_INTERNAL

#define _RPMRUBY_INTERNAL

Definition at line 6 of file trb.c.

Typedef Documentation

§ rpmrbClassTable

Function Documentation

§ main()

int main ( int  argc,
char *  argv[] 
)

§ rpmrbLoadClasses()

static void rpmrbLoadClasses ( void  )
static

§ rpmrbLoadFile()

static rpmRC rpmrbLoadFile ( rpmruby  rb,
const char *  pre,
const char *  fn 
)
static

Definition at line 82 of file trb.c.

References _debug, _free(), rpmExpand(), and rpmrubyRun().

Referenced by main(), and rpmrbLoadClasses().

Variable Documentation

§ _acknack

const char* _acknack
static
Initial value:
= "\
def ack(cmd, expected)\n\
begin\n\
actual = eval(cmd)\n\
rescue\n\
print(\"NACK: ack(\"+cmd.to_s+\")\tcaught '\"+\"#{$!}\"+\"'\n\")\n\
return\n\
end\n\
if (actual != expected && expected != nil)\n\
print(\"NACK: ack(\"+cmd.to_s+\")\tgot '\"+actual.to_s+\"' not '\"+expected.to_s+\"'\n\")\n\
elsif ($loglvl)\n\
print(\" ack(\"+cmd.to_s+\")\tgot '\"+actual.to_s+\"'\n\")\n\
end\n\
end\n\
"

Definition at line 65 of file trb.c.

§ _debug

int _debug = 0
static

Definition at line 30 of file trb.c.

Referenced by main(), rpmrbLoadClasses(), and rpmrbLoadFile().

§ _loglvl

int _loglvl = 0
static

Definition at line 33 of file trb.c.

Referenced by main(), and rpmrbLoadClasses().

§ _test

int _test = 1
static

Definition at line 36 of file trb.c.

Referenced by main().

§ classTable

struct rpmrbClassTable_s classTable[]
static
Initial value:
= {
{ "Ps", Init_rpmps, 9 },
{ "Mc", Init_rpmmc, 8 },
{ "Te", Init_rpmte, 7 },
{ "Fi", Init_rpmfi, 6 },
{ "Ds", Init_rpmds, 5 },
{ "Hdr", Init_rpmhdr, 4 },
{ "Mi", Init_rpmmi, 3 },
{ "Ts", Init_rpmts, 2 },
{ "Rpm", Init_rpm, 1 },
}
void Init_rpmhdr(void)
Definition: rpmhdr-rb.c:249
void Init_rpmmi(void)
Definition: rpmmi-rb.c:155
void Init_rpmte(void)
Definition: rpmte-rb.c:149
void Init_rpmts(void)
Definition: rpmts-rb.c:349
void Init_rpm(void)
Defines the "RPM" Ruby module and makes it known to the Interpreter.
Definition: rpm-rb.c:38
void Init_rpmds(void)
Definition: rpmds-rb.c:261
void Init_rpmmc(void)
Definition: rpmmc-rb.c:348
void Init_rpmfi(void)
Definition: rpmfi-rb.c:370
void Init_rpmps(void)
Definition: rpmps-rb.c:178

Definition at line 46 of file trb.c.

§ nclassTable

size_t nclassTable = sizeof(classTable) / sizeof(classTable[0])
static

Definition at line 59 of file trb.c.

Referenced by rpmrbLoadClasses().

§ optionsTable

struct poptOption optionsTable[]
static
Initial value:
= {
{ "debug", 'd', POPT_ARG_VAL, &_debug, -1, NULL, NULL },
{ "test", 't', POPT_ARG_VAL, &_test, -1, NULL, NULL },
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmcliAllPoptTable, 0,
"Common options for all rpm executables:" , NULL },
POPT_AUTOHELP
POPT_TABLEEND
}
struct poptOption rpmcliAllPoptTable[]
Popt option table for options shared by all modes and executables.
Definition: poptALL.c:417
static int _debug
Definition: trb.c:30
static int _test
Definition: trb.c:36

Definition at line 159 of file trb.c.

§ tscripts

const char tscripts[] = "./tscripts/"
static

Definition at line 62 of file trb.c.