# python/rpmdb-py.c File Reference

`#include "system.h"`
`#include <rpmio.h>`
`#include <rpmcb.h>`
`#include <rpmlib.h>`
`#include "rpmdb-py.h"`
`#include "rpmmi-py.h"`
`#include "header-py.h"`
`#include "debug.h"`

Include dependency graph for rpmdb-py.c:

Go to the source code of this file.

## Functions
static int | rpmdb_length (rpmdbObject *s)
static hdrObject * | rpmdb_subscript (rpmdbObject *s, PyObject *key)
static void | rpmdb_dealloc (rpmdbObject *s)
static PyObject * | rpmdb_getattro (PyObject *o, PyObject *n)
static int | rpmdb_setattro (PyObject *o, PyObject *n, PyObject *v)
Class: Rpmdb
static rpmmiObject * | rpmdb_Match (rpmdbObject *s, PyObject *args, PyObject *kwds)
## Variables
static struct PyMethodDef | rpmdb_methods []
static PyMappingMethods | rpmdb_as_mapping
static char | rpmdb_doc []
PyTypeObject | rpmdb_Type

## Detailed Description

Definition in file rpmdb-py.c.

## Function Documentation

static void rpmdb_dealloc | ( | rpmdbObject * | s | ) | `[static]`

Definition at line 210 of file rpmdb-py.c.

References rpmdbObject_s::db, and rpmdbClose().

static PyObject* rpmdb_getattro | ( | PyObject * | o,
|  | PyObject * | n |
| ) |  |  | `[static]`

Definition at line 218 of file rpmdb-py.c.

static int rpmdb_length | ( | rpmdbObject * | s | ) | `[static]`

Definition at line 151 of file rpmdb-py.c.

References rpmdbObject_s::db, rpmdbFreeIterator(), RPMDBI_PACKAGES, rpmdbInitIterator(), and rpmdbNextIterator().

static rpmmiObject* rpmdb_Match | ( | rpmdbObject * | s,
|  | PyObject * | args,
|  | PyObject * | kwds |
| ) |  |  | `[static]`

Definition at line 112 of file rpmdb-py.c.

References rpmdbObject_s::db, RPMDBI_PACKAGES, rpmdbInitIterator(), rpmmi_Wrap(), and tagNumFromPyObject().

static int rpmdb_setattro | ( | PyObject * | o,
|  | PyObject * | n,
|  | PyObject * | v |
| ) |  |  | `[static]`

Definition at line 224 of file rpmdb-py.c.

static hdrObject* rpmdb_subscript | ( | rpmdbObject * | s,
|  | PyObject * | key |
| ) |  |  | `[static]`

Definition at line 170 of file rpmdb-py.c.

References rpmdbObject_s::db, hdr_Wrap(), headerFree(), pyrpmError, rpmdbFreeIterator(), RPMDBI_PACKAGES, rpmdbInitIterator(), and rpmdbNextIterator().

## Variable Documentation

PyMappingMethods rpmdb_as_mapping`[static]`

Initial value:

     {
            (inquiry) rpmdb_length,
            (binaryfunc) rpmdb_subscript,
            (objobjargproc)0,
    }

Definition at line 202 of file rpmdb-py.c.

char rpmdb_doc[]`[static]`

Initial value:

    ""

Definition at line 233 of file rpmdb-py.c.

struct PyMethodDef rpmdb_methods[]`[static]`

Initial value:

     {
        {"match",       (PyCFunction) rpmdb_Match,  METH_VARARGS|METH_KEYWORDS,
    "db.match([TagN, [key, [len]]]) -> mi\n\
    - Create an rpm db match iterator.\n" },
        {NULL,              NULL}
    }

Definition at line 140 of file rpmdb-py.c.