rpm
5.4.10
|
#include "system.h"
#include "rpm-rb.h"
#include "rpmmc-rb.h"
#include <rpmmacro.h>
#include <rpmio/argv.h>
#include "../debug.h"
Go to the source code of this file.
Macros | |
#define | _MACRO_INTERNAL |
Typedefs | |
typedef MacroContext | rpmmc |
Functions | |
static rpmmc | _rpmmc_get_mc (VALUE self) |
Returns the wrapped C structure ::MacroContext_s. More... | |
static VALUE | rpmmc_add (VALUE self, VALUE macro) |
Adds a new macro definition to the Macro Context. More... | |
static VALUE | rpmmc_del (VALUE self, VALUE macro) |
Deletes a macro definition. More... | |
static VALUE | rpmmc_list (VALUE self) |
List all macro definitions in the corresponding Macro Context. More... | |
static VALUE | rpmmc_expand (VALUE self, VALUE macro) |
Expands a macro. More... | |
static VALUE | rpmmc_load_macro_file (VALUE self, VALUE fn_v, VALUE nesting_v) |
Loads a macro file. More... | |
static VALUE | rpmmc_init_macros (VALUE self, VALUE macrofiles_v) |
Initializes a macro context from a list of files. More... | |
static void | initMethods (VALUE klass) |
static VALUE | rpmmc_debug_get (VALUE s) |
Get debugging log level. More... | |
static VALUE | rpmmc_debug_set (VALUE s, VALUE v) |
Set debugging log level. More... | |
static VALUE | rpmmc_get_global_mc (void) |
Return the global macro context. More... | |
static VALUE | rpmmc_get_cli_mc (void) |
Return the CLI macro context. More... | |
static void | initProperties (VALUE klass) |
static void | _rpmmc_free (rpmmc mc) |
VALUE | rpmmc_wrap (rpmmc mc) |
Wraps an already existing MacroContext struct in a Ruby class. More... | |
static VALUE | rpmmc_alloc (VALUE klass) |
void | Init_rpmmc (void) |
Variables | |
VALUE | rpmmcClass |
RPM::Mc macro context Ruby class. More... | |
static int | _debug = 0 |
#define _MACRO_INTERNAL |
Definition at line 9 of file rpmmc-rb.c.
typedef MacroContext rpmmc |
Definition at line 16 of file rpmmc-rb.c.
|
static |
Definition at line 314 of file rpmmc-rb.c.
References _free(), rpmCLIMacroContext, rpmFreeMacros(), and rpmGlobalMacroContext.
Referenced by rpmmc_wrap().
|
static |
Returns the wrapped C structure ::MacroContext_s.
Definition at line 28 of file rpmmc-rb.c.
Referenced by rpmmc_add(), rpmmc_del(), rpmmc_expand(), rpmmc_init_macros(), rpmmc_list(), and rpmmc_load_macro_file().
void Init_rpmmc | ( | void | ) |
Definition at line 348 of file rpmmc-rb.c.
References _debug, initMethods(), initProperties(), rpmmc_alloc(), rpmmcClass, and rpmModule.
Referenced by Init_rpm().
|
static |
Definition at line 222 of file rpmmc-rb.c.
References rpmmc_add(), rpmmc_del(), rpmmc_expand(), rpmmc_init_macros(), rpmmc_list(), and rpmmc_load_macro_file().
Referenced by Init_rpmmc().
|
static |
Definition at line 301 of file rpmmc-rb.c.
References rpmmc_debug_get(), rpmmc_debug_set(), rpmmc_get_cli_mc(), and rpmmc_get_global_mc().
Referenced by Init_rpmmc().
|
static |
Adds a new macro definition to the Macro Context.
call-seq: RPM::Mc::add(macro) -> RPM::Mc
macro | The macro definition in string form just like it would be done in a macro definition file, but minus the define stanza. |
Definition at line 48 of file rpmmc-rb.c.
References _debug, _rpmmc_get_mc(), rpm_rb_raise(), and rpmDefineMacro().
Referenced by initMethods().
|
static |
Definition at line 334 of file rpmmc-rb.c.
References _debug, rpmmc_wrap(), and xcalloc().
Referenced by Init_rpmmc().
|
static |
Get debugging log level.
call-seq: RPM::Mc::debug -> Fixnum
Definition at line 244 of file rpmmc-rb.c.
References _debug.
Referenced by initProperties().
|
static |
Set debugging log level.
call-seq: RPM::Mc.debug = LEVEL -> Fixnum
Definition at line 261 of file rpmmc-rb.c.
References _debug.
Referenced by initProperties().
|
static |
Deletes a macro definition.
call-seq: RPM::Mc::del(macro) -> RPM::Mc
macro | The macro name |
Definition at line 77 of file rpmmc-rb.c.
References _debug, _rpmmc_get_mc(), rpm_rb_raise(), and rpmUndefineMacro().
Referenced by initMethods().
|
static |
Expands a macro.
call-seq: RPM::Mc::expand(macro) -> String
macro | The macro name (with leading % sign) |
Definition at line 161 of file rpmmc-rb.c.
References _debug, _rpmmc_get_mc(), and rpmMCExpand().
Referenced by initMethods().
|
static |
Return the CLI macro context.
call-seq: RPM::Mc.cli_context -> RPM::Mc
Definition at line 294 of file rpmmc-rb.c.
References rpmCLIMacroContext, and rpmmc_wrap().
Referenced by initProperties().
|
static |
Return the global macro context.
call-seq: RPM::Mc.global_context -> RPM::Mc
Definition at line 279 of file rpmmc-rb.c.
References rpmGlobalMacroContext, and rpmmc_wrap().
Referenced by initProperties().
|
static |
Initializes a macro context from a list of files.
call-seq: RPM::Mc::init_macros(files) -> RPM::Mc
files | A list of files to add, separated by colons |
Definition at line 210 of file rpmmc-rb.c.
References _rpmmc_get_mc(), and rpmInitMacros().
Referenced by initMethods().
|
static |
List all macro definitions in the corresponding Macro Context.
call-seq: RPM::Mc::list() -> Array
Definition at line 105 of file rpmmc-rb.c.
References _debug, _rpmmc_get_mc(), argvFree(), name, and rpmGetMacroEntries().
Referenced by initMethods().
|
static |
Loads a macro file.
call-seq: RPM::Mc::load_macro_file(fn, nesting) -> RPM::Mc
fn | The path of the macro file |
nesting | Maximum recursion depth; 0 disables recursion |
Definition at line 185 of file rpmmc-rb.c.
References _rpmmc_get_mc(), rpm_rb_raise(), and rpmLoadMacroFile().
Referenced by initMethods().
VALUE rpmmc_wrap | ( | MacroContext | mc | ) |
Wraps an already existing MacroContext struct in a Ruby class.
mc | The allocated MacroContext |
Definition at line 325 of file rpmmc-rb.c.
References _debug, _rpmmc_free(), and rpmmcClass.
Referenced by rpmmc_alloc(), rpmmc_get_cli_mc(), rpmmc_get_global_mc(), and spec_get_macros().
|
static |
Definition at line 21 of file rpmmc-rb.c.
Referenced by Init_rpmmc(), rpmmc_add(), rpmmc_alloc(), rpmmc_debug_get(), rpmmc_debug_set(), rpmmc_del(), rpmmc_expand(), rpmmc_list(), and rpmmc_wrap().
VALUE rpmmcClass |
RPM::Mc macro context Ruby class.
Definition at line 18 of file rpmmc-rb.c.
Referenced by Init_rpmmc(), and rpmmc_wrap().