33 Data_Get_Struct(s,
void, ptr);
60 VALUE v_tag, v_pattern;
62 rb_scan_args(argc, argv,
"20", &v_tag, &v_pattern);
65 StringValueCStr(v_pattern));
73 rb_define_method(klass,
"each",
rpmmi_each, 0);
74 rb_define_method(klass,
"next",
rpmmi_next, 0);
83 fprintf(stderr,
"==> %s(0x%lx)\n", __FUNCTION__, s);
90 return INT2FIX(
_debug = FIX2INT(v));
123 fprintf(stderr,
"==> %s(%p)\n", __FUNCTION__, mi);
130 VALUE v_ts, v_tag, v_key;
137 rb_scan_args(argc, argv,
"12", &v_ts, &v_tag, &v_key);
141 _tag = FIX2INT(v_tag);
143 _key = StringValueCStr(v_key);
148 fprintf(stderr,
"==> %s(%p[%d], 0x%lx) mi %p\n", __FUNCTION__, argv, argc, s, mi);
149 return Data_Wrap_Struct(s, 0,
rpmmi_free, mi);
157 rpmmiClass = rb_define_class(
"Mi", rb_cObject);
159 fprintf(stderr,
"==> %s() rpmmiClass 0x%lx\n", __FUNCTION__,
rpmmiClass);
160 rb_include_module(
rpmmiClass, rb_mEnumerable);
static VALUE rpmmi_next(VALUE s)
static VALUE rpmmi_pattern(int argc, VALUE *argv, VALUE s)
uint32_t rpmmiInstance(rpmmi mi)
Return header instance for current position of rpmdb iterator.
VALUE rpmrb_NewHdr(void *_h)
static VALUE rpmmi_offset_get(VALUE s)
static VALUE rpmmi_debug_get(VALUE s)
static VALUE rpmmi_each(VALUE s)
static VALUE rpmmi_count_get(VALUE s)
Ruby bindings to the RPM Transaction Set API.
rpmmi rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, const void *keyp, size_t keylen)
Return transaction database iterator.
static VALUE rpmmi_debug_set(VALUE s, VALUE v)
rpmmi rpmmiFree(rpmmi mi)
Destroy rpm database iterator.
static void initMethods(VALUE klass)
RPM Ruby bindings "RPM" module.
Header headerLink(Header h)
Reference a header instance.
int rpmmiAddPattern(rpmmi mi, rpmTag tag, rpmMireMode mode, const char *pattern)
Add pattern to iterator selector.
static void rpmmi_free(rpmmi mi)
static VALUE rpmmi_new(int argc, VALUE *argv, VALUE s)
struct rpmts_s * rpmts
The RPM Transaction Set.
Structures and prototypes used for an "rpmts" transaction set.
Header rpmmiNext(rpmmi mi)
Return next package header from iteration.
static void initProperties(VALUE klass)
VALUE rpmrb_NewMi(void *_ts, int _tag, void *_key, int _len)
Access RPM indices using Berkeley DB interface(s).
static void * rpmmi_ptr(VALUE s)
unsigned int rpmmiCount(rpmmi mi)
Return number of elements in rpm database iterator.
#define RPMDBI_PACKAGES
Pseudo-tags used by the rpmdb and rpmgi iterator API's.