rpm  5.4.15
rpmfi-py.c
Go to the documentation of this file.
1 
5 #include "system-py.h"
6 
7 #include <rpmio.h>
8 #include <rpmcb.h> /* XXX fnpyKey */
9 #include <rpmtypes.h>
10 #include <rpmtag.h>
11 
12 #include "header-py.h"
13 #include "rpmfi-py.h"
14 
15 #include "debug.h"
16 
17 /*@access rpmfi @*/
18 
19 #if Py_TPFLAGS_HAVE_ITER
20 static PyObject *
22  /*@*/
23 {
24  Py_INCREF(s);
25  return (PyObject *)s;
26 }
27 #endif
28 
29 /* forward ref */
30 static PyObject * rpmfi_Digest(rpmfiObject * s)
31  /*@*/;
32 
33 /*@null@*/
34 static PyObject *
36  /*@globals _Py_NoneStruct @*/
37  /*@modifies s, _Py_NoneStruct @*/
38 {
39  PyObject * result = NULL;
40 
41  /* Reset loop indices on 1st entry. */
42  if (!s->active) {
43  s->fi = rpmfiInit(s->fi, 0);
44  s->active = 1;
45  }
46 
47  /* If more to do, return the file tuple. */
48  if (rpmfiNext(s->fi) >= 0) {
49  const char * FN = rpmfiFN(s->fi);
50  int FSize = rpmfiFSize(s->fi);
51  int FMode = rpmfiFMode(s->fi);
52  int FMtime = rpmfiFMtime(s->fi);
53  int FFlags = rpmfiFFlags(s->fi);
54  int FRdev = rpmfiFRdev(s->fi);
55  int FInode = rpmfiFInode(s->fi);
56  int FNlink = rpmfiFNlink(s->fi);
57  int FState = rpmfiFState(s->fi);
58  int VFlags = rpmfiVFlags(s->fi);
59  const char * FUser = rpmfiFUser(s->fi);
60  const char * FGroup = rpmfiFGroup(s->fi);
61 
62  result = PyTuple_New(13);
63  if (FN == NULL) {
64  Py_INCREF(Py_None);
65  PyTuple_SET_ITEM(result, 0, Py_None);
66  } else
67  PyTuple_SET_ITEM(result, 0, Py_BuildValue("s", FN));
68  PyTuple_SET_ITEM(result, 1, PyInt_FromLong(FSize));
69  PyTuple_SET_ITEM(result, 2, PyInt_FromLong(FMode));
70  PyTuple_SET_ITEM(result, 3, PyInt_FromLong(FMtime));
71  PyTuple_SET_ITEM(result, 4, PyInt_FromLong(FFlags));
72  PyTuple_SET_ITEM(result, 5, PyInt_FromLong(FRdev));
73  PyTuple_SET_ITEM(result, 6, PyInt_FromLong(FInode));
74  PyTuple_SET_ITEM(result, 7, PyInt_FromLong(FNlink));
75  PyTuple_SET_ITEM(result, 8, PyInt_FromLong(FState));
76  PyTuple_SET_ITEM(result, 9, PyInt_FromLong(VFlags));
77  if (FUser == NULL) {
78  Py_INCREF(Py_None);
79  PyTuple_SET_ITEM(result, 10, Py_None);
80  } else
81  PyTuple_SET_ITEM(result, 10, Py_BuildValue("s", FUser));
82  if (FGroup == NULL) {
83  Py_INCREF(Py_None);
84  PyTuple_SET_ITEM(result, 11, Py_None);
85  } else
86  PyTuple_SET_ITEM(result, 11, Py_BuildValue("s", FGroup));
87  PyTuple_SET_ITEM(result, 12, rpmfi_Digest(s));
88  } else
89  s->active = 0;
90 
91  return result;
92 }
93 
98 
99 static PyObject *
101  /*@globals _Py_NoneStruct @*/
102  /*@modifies s, _Py_NoneStruct @*/
103 {
104  PyObject * result = NULL;
105 
106  result = rpmfi_iternext(s);
107 
108  if (result == NULL) {
109  Py_RETURN_NONE;
110  }
111 
112  return result;
113 }
114 
115 #ifdef NOTYET
116 /*@null@*/
117 static PyObject *
118 rpmfi_NextD(rpmfiObject * s)
119  /*@*/
120 {
121  Py_RETURN_NONE;
122 }
123 
124 /*@null@*/
125 static PyObject *
126 rpmfi_InitD(rpmfiObject * s)
127  /*@*/
128 {
129  Py_RETURN_NONE;
130 }
131 #endif
132 
133 /*@null@*/
134 static PyObject *
135 rpmfi_Debug(/*@unused@*/ rpmfiObject * s, PyObject * args,
136  PyObject * kwds)
137  /*@globals _Py_NoneStruct @*/
138  /*@modifies _Py_NoneStruct @*/
139 {
140  char * kwlist[] = {"debugLevel", NULL};
141 
142  if (!PyArg_ParseTupleAndKeywords(args, kwds, "i", kwlist, &_rpmfi_debug))
143  return NULL;
144 
145  Py_RETURN_NONE;
146 }
147 
148 /*@null@*/
149 static PyObject *
151  /*@*/
152 {
153  return Py_BuildValue("i", rpmfiFC(s->fi));
154 }
155 
156 /*@null@*/
157 static PyObject *
159  /*@*/
160 {
161  return Py_BuildValue("i", rpmfiFX(s->fi));
162 }
163 
164 /*@null@*/
165 static PyObject *
167  /*@*/
168 {
169  return Py_BuildValue("i", rpmfiDC(s->fi));
170 }
171 
172 /*@null@*/
173 static PyObject *
175  /*@*/
176 {
177  return Py_BuildValue("i", rpmfiDX(s->fi));
178 }
179 
180 /*@null@*/
181 static PyObject *
183  /*@*/
184 {
185  return Py_BuildValue("s", xstrdup(rpmfiBN(s->fi)));
186 }
187 
188 /*@null@*/
189 static PyObject *
191  /*@*/
192 {
193  return Py_BuildValue("s", xstrdup(rpmfiDN(s->fi)));
194 }
195 
196 /*@null@*/
197 static PyObject *
199  /*@modifies s @*/
200 {
201  return Py_BuildValue("s", xstrdup(rpmfiFN(s->fi)));
202 }
203 
204 /*@null@*/
205 static PyObject *
207  /*@*/
208 {
209  return Py_BuildValue("i", rpmfiFFlags(s->fi));
210 }
211 
212 /*@null@*/
213 static PyObject *
215  /*@*/
216 {
217  return Py_BuildValue("i", rpmfiVFlags(s->fi));
218 }
219 
220 /*@null@*/
221 static PyObject *
223  /*@*/
224 {
225  return Py_BuildValue("i", rpmfiFMode(s->fi));
226 }
227 
228 /*@null@*/
229 static PyObject *
231  /*@*/
232 {
233  return Py_BuildValue("i", rpmfiFState(s->fi));
234 }
235 
236 /*@null@*/
237 static PyObject *
239  /*@*/
240 {
241  int dalgo = 0;
242  size_t dlen = 0;
243  const unsigned char * digest;
244  const char * fdigest;
245  char * t;
246  size_t i;
247 
248  digest = rpmfiDigest(s->fi, &dalgo, &dlen);
249  if (digest == NULL || dlen == 0) {
250  Py_RETURN_NONE;
251  }
252  fdigest = t = memset(alloca(dlen), 0, dlen);
253  for (i = 0; i < dlen; i++, t += 2)
254  sprintf(t, "%02x", digest[i]);
255  *t = '\0';
256  return Py_BuildValue("s", xstrdup(fdigest));
257 }
258 
259 /*@null@*/
260 static PyObject *
262  /*@*/
263 {
264  return Py_BuildValue("s", xstrdup(rpmfiFLink(s->fi)));
265 }
266 
267 /*@null@*/
268 static PyObject *
270  /*@*/
271 {
272  return Py_BuildValue("i", rpmfiFSize(s->fi));
273 }
274 
275 /*@null@*/
276 static PyObject *
278  /*@*/
279 {
280  return Py_BuildValue("i", rpmfiFRdev(s->fi));
281 }
282 
283 /*@null@*/
284 static PyObject *
286  /*@*/
287 {
288  return Py_BuildValue("i", rpmfiFMtime(s->fi));
289 }
290 
291 /*@null@*/
292 static PyObject *
294  /*@*/
295 {
296  return Py_BuildValue("s", xstrdup(rpmfiFUser(s->fi)));
297 }
298 
299 /*@null@*/
300 static PyObject *
302  /*@*/
303 {
304  return Py_BuildValue("s", xstrdup(rpmfiFGroup(s->fi)));
305 }
306 
307 /*@null@*/
308 static PyObject *
310  /*@*/
311 {
312  return Py_BuildValue("i", rpmfiFColor(s->fi));
313 }
314 
315 /*@null@*/
316 static PyObject *
318  /*@*/
319 {
320  const char * FClass;
321 
322  if ((FClass = rpmfiFClass(s->fi)) == NULL)
323  FClass = "";
324  return Py_BuildValue("s", xstrdup(FClass));
325 }
326 
329 /*@-fullinitblock@*/
330 /*@unchecked@*/ /*@observer@*/
331 static struct PyMethodDef rpmfi_methods[] = {
332  {"Debug", (PyCFunction)rpmfi_Debug, METH_VARARGS|METH_KEYWORDS,
333  NULL},
334  {"FC", (PyCFunction)rpmfi_FC, METH_NOARGS,
335  NULL},
336  {"FX", (PyCFunction)rpmfi_FX, METH_NOARGS,
337  NULL},
338  {"DC", (PyCFunction)rpmfi_DC, METH_NOARGS,
339  NULL},
340  {"DX", (PyCFunction)rpmfi_DX, METH_NOARGS,
341  NULL},
342  {"BN", (PyCFunction)rpmfi_BN, METH_NOARGS,
343  NULL},
344  {"DN", (PyCFunction)rpmfi_DN, METH_NOARGS,
345  NULL},
346  {"FN", (PyCFunction)rpmfi_FN, METH_NOARGS,
347  NULL},
348  {"FFlags", (PyCFunction)rpmfi_FFlags, METH_NOARGS,
349  NULL},
350  {"VFlags", (PyCFunction)rpmfi_VFlags, METH_NOARGS,
351  NULL},
352  {"FMode", (PyCFunction)rpmfi_FMode, METH_NOARGS,
353  NULL},
354  {"FState", (PyCFunction)rpmfi_FState, METH_NOARGS,
355  NULL},
356  {"MD5", (PyCFunction)rpmfi_Digest, METH_NOARGS,
357  NULL},
358  {"Digest", (PyCFunction)rpmfi_Digest, METH_NOARGS,
359  NULL},
360  {"FLink", (PyCFunction)rpmfi_FLink, METH_NOARGS,
361  NULL},
362  {"FSize", (PyCFunction)rpmfi_FSize, METH_NOARGS,
363  NULL},
364  {"FRdev", (PyCFunction)rpmfi_FRdev, METH_NOARGS,
365  NULL},
366  {"FMtime", (PyCFunction)rpmfi_FMtime, METH_NOARGS,
367  NULL},
368  {"FUser", (PyCFunction)rpmfi_FUser, METH_NOARGS,
369  NULL},
370  {"FGroup", (PyCFunction)rpmfi_FGroup, METH_NOARGS,
371  NULL},
372  {"FColor", (PyCFunction)rpmfi_FColor, METH_NOARGS,
373  NULL},
374  {"FClass", (PyCFunction)rpmfi_FClass, METH_NOARGS,
375  NULL},
376  {"next", (PyCFunction)rpmfi_Next, METH_NOARGS,
377 "fi.next() -> (FN, FSize, FMode, FMtime, FFlags, FRdev, FInode, FNlink, FState, VFlags, FUser, FGroup, Digest))\n\
378 - Retrieve next file info tuple.\n" },
379 #ifdef NOTYET
380  {"NextD", (PyCFunction)rpmfi_NextD, METH_NOARGS,
381  NULL},
382  {"InitD", (PyCFunction)rpmfi_InitD, METH_NOARGS,
383  NULL},
384 #endif
385  {NULL, NULL} /* sentinel */
386 };
387 /*@=fullinitblock@*/
388 
389 /* ---------- */
390 
391 static void
392 rpmfi_dealloc(/*@only@*/ /*@null@*/ rpmfiObject * s)
393  /*@modifies s @*/
394 {
395  if (s) {
396  s->fi = rpmfiFree(s->fi);
397  PyObject_Del(s);
398  }
399 }
400 
401 static int
402 rpmfi_print(rpmfiObject * s, FILE * fp, /*@unused@*/ int flags)
403  /*@globals fileSystem @*/
404  /*@modifies s, fp, fileSystem @*/
405 {
406  if (!(s && s->fi))
407  return -1;
408 
409  s->fi = rpmfiInit(s->fi, 0);
410  while (rpmfiNext(s->fi) >= 0)
411  fprintf(fp, "%s\n", rpmfiFN(s->fi));
412  return 0;
413 }
414 
415 static int
417  /*@*/
418 {
419  return rpmfiFC(s->fi);
420 }
421 
422 /*@null@*/
423 static PyObject *
425  /*@modifies s @*/
426 {
427  int ix;
428 
429  if (!PyInt_Check(key)) {
430  PyErr_SetString(PyExc_TypeError, "integer expected");
431  return NULL;
432  }
433 
434  ix = (int) PyInt_AsLong(key);
435  rpmfiSetFX(s->fi, ix);
436  return Py_BuildValue("s", xstrdup(rpmfiFN(s->fi)));
437 }
438 
439 /*@unchecked@*/ /*@observer@*/
440 static PyMappingMethods rpmfi_as_mapping = {
441  (lenfunc) rpmfi_length, /* mp_length */
442  (binaryfunc) rpmfi_subscript, /* mp_subscript */
443  (objobjargproc)0, /* mp_ass_subscript */
444 };
445 
448 static int rpmfi_init(rpmfiObject * s, PyObject *args, PyObject *kwds)
449  /*@globals rpmGlobalMacroContext @*/
450  /*@modifies s, rpmGlobalMacroContext @*/
451 {
452  hdrObject * ho = NULL;
453  PyObject * to = NULL;
454  rpmts ts = NULL; /* XXX FIXME: fiFromHeader should be a ts method. */
455  int tagN = RPMTAG_BASENAMES;
456  int flags = 0;
457  char * kwlist[] = {"header", "tag", "flags", NULL};
458 
459 if (_rpmfi_debug < 0)
460 fprintf(stderr, "*** rpmfi_init(%p,%p,%p)\n", s, args, kwds);
461 
462  if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!|Oi:rpmfi_init", kwlist,
463  &hdr_Type, &ho, &to, &flags))
464  return -1;
465 
466  if (to != NULL) {
467  tagN = tagNumFromPyObject(to);
468  if (tagN == -1) {
469  PyErr_SetString(PyExc_KeyError, "unknown header tag");
470  return -1;
471  }
472  }
473  s->fi = rpmfiNew(ts, hdrGetHeader(ho), tagN, flags);
474  s->active = 0;
475 
476  return 0;
477 }
478 
481 static void rpmfi_free(/*@only@*/ rpmfiObject * s)
482  /*@modifies s @*/
483 {
484 if (_rpmfi_debug)
485 fprintf(stderr, "%p -- fi %p\n", s, s->fi);
486  s->fi = rpmfiFree(s->fi);
487 
488  PyObject_Del((PyObject *)s);
489 }
490 
493 static PyObject * rpmfi_alloc(PyTypeObject * subtype, int nitems)
494  /*@*/
495 {
496  PyObject * s = PyType_GenericAlloc(subtype, nitems);
497 
498 if (_rpmfi_debug < 0)
499 fprintf(stderr, "*** rpmfi_alloc(%p,%d) ret %p\n", subtype, nitems, s);
500  return s;
501 }
502 
505 /*@null@*/
506 static PyObject * rpmfi_new(PyTypeObject * subtype, PyObject *args, PyObject *kwds)
507  /*@globals rpmGlobalMacroContext @*/
508  /*@modifies rpmGlobalMacroContext @*/
509 {
510  rpmfiObject * s = (void *) PyObject_New(rpmfiObject, subtype);
511 
512  /* Perform additional initialization. */
513  if (rpmfi_init(s, args, kwds) < 0) {
514  rpmfi_free(s);
515  return NULL;
516  }
517 
518 if (_rpmfi_debug)
519 fprintf(stderr, "%p ++ fi %p\n", s, s->fi);
520 
521  return (PyObject *)s;
522 }
523 
526 /*@unchecked@*/ /*@observer@*/
527 static char rpmfi_doc[] =
528 "";
529 
530 /*@-fullinitblock@*/
531 PyTypeObject rpmfi_Type = {
532  PyVarObject_HEAD_INIT(&PyType_Type, 0)
533  "rpm.fi", /* tp_name */
534  sizeof(rpmfiObject), /* tp_basicsize */
535  0, /* tp_itemsize */
536  /* methods */
537  (destructor) rpmfi_dealloc, /* tp_dealloc */
538  (printfunc) rpmfi_print, /* tp_print */
539  (getattrfunc)0, /* tp_getattr */
540  (setattrfunc)0, /* tp_setattr */
541  (cmpfunc)0, /* tp_compare */
542  (reprfunc)0, /* tp_repr */
543  0, /* tp_as_number */
544  0, /* tp_as_sequence */
545  &rpmfi_as_mapping, /* tp_as_mapping */
546  (hashfunc)0, /* tp_hash */
547  (ternaryfunc)0, /* tp_call */
548  (reprfunc)0, /* tp_str */
549  PyObject_GenericGetAttr, /* tp_getattro */
550  PyObject_GenericSetAttr, /* tp_setattro */
551  0, /* tp_as_buffer */
552  Py_TPFLAGS_DEFAULT, /* tp_flags */
553  rpmfi_doc, /* tp_doc */
554 #if Py_TPFLAGS_HAVE_ITER
555  0, /* tp_traverse */
556  0, /* tp_clear */
557  0, /* tp_richcompare */
558  0, /* tp_weaklistoffset */
559  (getiterfunc) rpmfi_iter, /* tp_iter */
560  (iternextfunc) rpmfi_iternext, /* tp_iternext */
561  rpmfi_methods, /* tp_methods */
562  0, /* tp_members */
563  0, /* tp_getset */
564  0, /* tp_base */
565  0, /* tp_dict */
566  0, /* tp_descr_get */
567  0, /* tp_descr_set */
568  0, /* tp_dictoffset */
569  (initproc) rpmfi_init, /* tp_init */
570  (allocfunc) rpmfi_alloc, /* tp_alloc */
571  (newfunc) rpmfi_new, /* tp_new */
572  (freefunc) rpmfi_free, /* tp_free */
573  0, /* tp_is_gc */
574 #endif
575 };
576 /*@=fullinitblock@*/
577 
578 /* ---------- */
579 
581 {
582  return s->fi;
583 }
584 
585 rpmfiObject *
587 {
588  rpmfiObject *s = PyObject_New(rpmfiObject, &rpmfi_Type);
589 
590  if (s == NULL)
591  return NULL;
592  s->fi = fi;
593  s->active = 0;
594  return s;
595 }
596 
597 rpmfiObject *
598 hdr_fiFromHeader(PyObject * s, PyObject * args, PyObject * kwds)
599 {
600  hdrObject * ho = (hdrObject *)s;
601  PyObject * to = NULL;
602  rpmts ts = NULL; /* XXX FIXME: fiFromHeader should be a ts method. */
603  rpmTag tagN = RPMTAG_BASENAMES;
604  int flags = 0;
605  char * kwlist[] = {"tag", "flags", NULL};
606 
607  if (!PyArg_ParseTupleAndKeywords(args, kwds, "|Oi:fiFromHeader", kwlist,
608  &to, &flags))
609  return NULL;
610 
611  if (to != NULL) {
612  tagN = tagNumFromPyObject(to);
613  if (tagN == (rpmTag)-1) {
614  PyErr_SetString(PyExc_KeyError, "unknown header tag");
615  return NULL;
616  }
617  }
618  return rpmfi_Wrap( rpmfiNew(ts, hdrGetHeader(ho), tagN, flags) );
619 }
rpmTag tagNumFromPyObject(PyObject *item)
Definition: header-py.c:362
rpmuint32_t rpmfiFFlags(rpmfi fi)
Return current file flags from file info set.
Definition: rpmfi.c:217
rpmfiObject * hdr_fiFromHeader(PyObject *s, PyObject *args, PyObject *kwds)
Definition: rpmfi-py.c:598
int rpmfiDX(rpmfi fi)
Return current directory index from file info set.
Definition: rpmfi.c:120
static PyObject * rpmfi_VFlags(rpmfiObject *s)
Definition: rpmfi-py.c:214
rpmuint32_t rpmfiVFlags(rpmfi fi)
Return current file verify flags from file info set.
Definition: rpmfi.c:241
const char bson_timestamp_t * ts
Definition: bson.h:1004
static PyObject * rpmfi_FUser(rpmfiObject *s)
Definition: rpmfi-py.c:293
rpmuint32_t rpmfiFNlink(rpmfi fi)
Return (calculated) current file nlink count from file info set.
Definition: rpmfi.c:427
static PyObject * rpmfi_iter(rpmfiObject *s)
Definition: rpmfi-py.c:21
static int rpmfi_print(rpmfiObject *s, FILE *fp, int flags)
Definition: rpmfi-py.c:402
char * xstrdup(const char *str)
Definition: rpmmalloc.c:321
static PyObject * rpmfi_FFlags(rpmfiObject *s)
Definition: rpmfi-py.c:206
static PyObject * rpmfi_Digest(rpmfiObject *s)
Definition: rpmfi-py.c:238
static void rpmfi_dealloc(rpmfiObject *s)
Definition: rpmfi-py.c:392
static int rpmfi_init(rpmfiObject *s, PyObject *args, PyObject *kwds)
Definition: rpmfi-py.c:448
int rpmfiSetFX(rpmfi fi, int fx)
Set current file index in file info set.
Definition: rpmfi.c:108
static PyObject * rpmfi_DX(rpmfiObject *s)
Definition: rpmfi-py.c:174
static PyObject * rpmfi_FC(rpmfiObject *s)
Definition: rpmfi-py.c:150
rpmuint16_t rpmfiFRdev(rpmfi fi)
Return current file rdev from file info set.
Definition: rpmfi.c:339
static PyObject * rpmfi_Next(rpmfiObject *s)
Definition: rpmfi-py.c:100
static PyObject * rpmfi_FState(rpmfiObject *s)
Definition: rpmfi-py.c:230
rpmfi rpmfiFree(rpmfi fi)
Destroy a file info set.
const char * rpmfiFN(rpmfi fi)
Return current file name from file info set.
Definition: rpmfi.c:163
static PyObject * rpmfi_subscript(rpmfiObject *s, PyObject *key)
Definition: rpmfi-py.c:424
const char * rpmfiFUser(rpmfi fi)
Return current file owner from file info set.
Definition: rpmfi.c:458
const char * rpmfiFGroup(rpmfi fi)
Return current file group from file info set.
Definition: rpmfi.c:470
rpmfi rpmfiNew(const void *_ts, Header h, rpmTag tagN, int flags)
Create and load a file info set.
Definition: rpmfi.c:1403
rpmuint32_t rpmfiFColor(rpmfi fi)
Return current file color bits from file info set.
Definition: rpmfi.c:371
const char * rpmfiBN(rpmfi fi)
Return current base name from file info set.
Definition: rpmfi.c:141
static PyObject * rpmfi_DC(rpmfiObject *s)
Definition: rpmfi-py.c:166
int rpmfiFC(rpmfi fi)
Return file count from file info set.
Definition: rpmfi.c:87
rpmuint32_t rpmfiFSize(rpmfi fi)
Return current file size from file info set.
Definition: rpmfi.c:328
char * alloca()
Header hdrGetHeader(hdrObject *s)
Definition: header-py.c:685
static PyMappingMethods rpmfi_as_mapping
Definition: rpmfi-py.c:440
static PyObject * rpmfi_FX(rpmfiObject *s)
Definition: rpmfi-py.c:158
static char rpmfi_doc[]
Definition: rpmfi-py.c:527
static PyObject * rpmfi_BN(rpmfiObject *s)
Definition: rpmfi-py.c:182
static PyObject * rpmfi_FSize(rpmfiObject *s)
Definition: rpmfi-py.c:269
const char * rpmfiDN(rpmfi fi)
Return current directory name from file info set.
Definition: rpmfi.c:152
struct rpmfi_s * rpmfi
File info tag sets from a header, so that a header can be discarded early.
Definition: rpmfi.h:83
rpmuint16_t rpmfiFMode(rpmfi fi)
Return current file mode from file info set.
Definition: rpmfi.c:265
static PyObject * rpmfi_FRdev(rpmfiObject *s)
Definition: rpmfi-py.c:277
rpmfi fiFromFi(rpmfiObject *s)
Definition: rpmfi-py.c:580
rpmuint32_t rpmfiFMtime(rpmfi fi)
Return current file modify time from file info set.
Definition: rpmfi.c:447
static PyObject * rpmfi_iternext(rpmfiObject *s)
Definition: rpmfi-py.c:35
PyTypeObject hdr_Type
Definition: header-py.c:633
struct rpmfiObject_s rpmfiObject
static struct PyMethodDef rpmfi_methods[]
Definition: rpmfi-py.c:331
static PyObject * rpmfi_FColor(rpmfiObject *s)
Definition: rpmfi-py.c:309
const char const bson int mongo_write_concern int flags
Definition: mongo.h:485
static void rpmfi_free(rpmfiObject *s)
Definition: rpmfi-py.c:481
static int rpmfi_length(rpmfiObject *s)
Definition: rpmfi-py.c:416
static PyObject * rpmfi_Debug(rpmfiObject *s, PyObject *args, PyObject *kwds)
Definition: rpmfi-py.c:135
PyTypeObject rpmfi_Type
Definition: rpmfi-py.c:531
int rpmfiNext(rpmfi fi)
Return next file iterator index.
Definition: rpmfi.c:526
int rpmfiDC(rpmfi fi)
Return directory count from file info set.
Definition: rpmfi.c:92
rpmfi rpmfiInit(rpmfi fi, int fx)
Initialize file iterator index.
Definition: rpmfi.c:548
const char const int i
Definition: bson.h:778
const char * rpmfiFClass(rpmfi fi)
Return current file class from file info set.
Definition: rpmfi.c:383
rpmfi fi
Definition: rpmfi-py.h:20
const char const bson * key
Definition: mongo.h:717
static PyObject * rpmfi_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)
Definition: rpmfi-py.c:506
const char * rpmfiFLink(rpmfi fi)
Return current file linkto (i.e.
Definition: rpmfi.c:317
static PyObject * rpmfi_FLink(rpmfiObject *s)
Definition: rpmfi-py.c:261
struct rpmts_s * rpmts
The RPM Transaction Set.
Definition: rpmtypes.h:14
rpmfi fi
Definition: filetriggers.h:15
rpmfileState rpmfiFState(rpmfi fi)
Return current file state from file info set.
Definition: rpmfi.c:276
static PyObject * rpmfi_FMode(rpmfiObject *s)
Definition: rpmfi-py.c:222
rpmfiObject * rpmfi_Wrap(rpmfi fi)
Definition: rpmfi-py.c:586
const unsigned char * rpmfiDigest(rpmfi fi, int *algop, size_t *lenp)
Return current file (binary) digest from file info set.
Definition: rpmfi.c:300
static PyObject * rpmfi_DN(rpmfiObject *s)
Definition: rpmfi-py.c:190
static PyObject * rpmfi_FClass(rpmfiObject *s)
Definition: rpmfi-py.c:317
rpmuint32_t rpmfiFInode(rpmfi fi)
Return current file inode from file info set.
Definition: rpmfi.c:350
enum rpmTag_e rpmTag
Definition: rpmtag.h:470
int _rpmfi_debug
Definition: rpmfi.c:67
static PyObject * rpmfi_FMtime(rpmfiObject *s)
Definition: rpmfi-py.c:285
int rpmfiFX(rpmfi fi)
Return current file index from file info set.
Definition: rpmfi.c:103
static PyObject * rpmfi_FN(rpmfiObject *s)
Definition: rpmfi-py.c:198
static PyObject * rpmfi_FGroup(rpmfiObject *s)
Definition: rpmfi-py.c:301
static PyObject * rpmfi_alloc(PyTypeObject *subtype, int nitems)
Definition: rpmfi-py.c:493
static int nitems
Definition: rpmcache.c:81