rpm  5.4.10
package-rb.c
Go to the documentation of this file.
1 
7 #include "system.h"
8 #include "rpm-rb.h"
9 #include "rpmds-rb.h"
10 #include "package-rb.h"
11 
12 #define _RPMFI_INTERNAL
13 #define _RPMDS_INTERNAL
14 #include <rpmtag.h>
15 #include <rpmtypes.h>
16 #include <rpmio.h>
17 #include <rpmfi.h>
18 #include <rpmspec.h>
19 #include <rpmds.h>
20 
21 
23 
24 
34 static VALUE
35 package_get_ds(VALUE self)
36 {
37  Package pkg;
38  Data_Get_Struct(self, struct Package_s, pkg);
39 
40  /* TODO: Replace -1 with rpmdsFree */
41  return Data_Wrap_Struct(rpmdsClass, 0, 0, pkg->ds);
42 }
43 
44 
45 void
47 {
48  packageClass = rb_define_class_under(rpmModule, "Package", rb_cObject);
49 
50  rb_define_method(packageClass, "ds", &package_get_ds, 0);
51 }