rpm  5.4.14
Macros | Functions | Variables
rpmfts-py.c File Reference
#include "system.h"
#include "structmember.h"
#include <fts.h>
#include "rpmfts-py.h"
#include <rpmiotypes.h>
#include "debug.h"
Include dependency graph for rpmfts-py.c:

Go to the source code of this file.

Macros

#define infoBit(_ix)   (1 << (((unsigned)(_ix)) & 0x1f))
 
#define RPMFTS_CLOSE   0
 
#define RPMFTS_OPEN   1
 
#define RPMFTS_OPEN_LAZY   2
 
#define CONSTANT(_v)   PyDict_SetItemString(s->md_dict, #_v, o=PyInt_FromLong(_v)); Py_XDECREF(o)
 

Functions

static const char * ftsInfoStr (int fts_info)
 
static void rpmfts_debug (const char *msg, rpmftsObject *s)
 
 if (root==NULL)
 
 rpmfts_debug ("rpmfts_state", s)
 
 switch (nactive)
 
 rpmfts_debug ("rpmfts_step", s)
 
Py_END_ALLOW_THREADS while (s->fts &&((1<< (((unsigned)(s->fts->fts_info))&0x1f))&s->ignore))
 
 if (s->fts!=NULL)
 
static PyObject * rpmfts_getattro (PyObject *o, PyObject *n)
 
static int rpmfts_setattro (PyObject *o, PyObject *n, PyObject *v)
 
static void rpmfts_free (PyObject *s)
 
static PyObject * rpmfts_alloc (PyTypeObject *type, Py_ssize_t nitems)
 
static void rpmfts_dealloc (rpmftsObject *s)
 
static int rpmfts_init (rpmftsObject *s, PyObject *args, PyObject *kwds)
 
static PyObject * rpmfts_new (PyTypeObject *type, PyObject *args, PyObject *kwds)
 
static int rpmfts_traverse (rpmftsObject *s, visitproc visit, void *arg)
 
static int rpmfts_print (rpmftsObject *s, FILE *fp, int flags)
 

Variables

static int _rpmfts_debug = 1
 
static const char * ftsInfoStrings []
 
static int
 
size_t nb
 
s compare = NULL
 
s ftsp = NULL
 
s active = 0
 
 return
 
 do
 
 else
 
return result
 
static struct PyMethodDef rpmfts_methods []
 
static PyMemberDef rpmfts_members []
 
static char rpmfts_doc []
 
PyTypeObject rpmfts_Type
 

Class: Rpmfts

s options = options
 
s ignore = ignore
 
s fts = NULL
 
return rc = 0
 
static PyObject *int xx
 
return NULL
 
char * kwlist [] = {"root", "options", "ignore", NULL}
 
return Py_None
 
static PyObject * rpmfts_Debug (rpmftsObject *s, PyObject *args, PyObject *kwds)
 
 rpmfts_debug ("rpmfts_Open", s)
 
 if (!PyArg_ParseTupleAndKeywords(args, kwds,"|sii:Open", kwlist,&root,&options,&ignore)) return NULL
 
 return (PyObject *)
 
 rpmfts_debug ("rpmfts_Children", s)
 
Py_END_ALLOW_THREADS Py_INCREF (Py_None)
 
static PyObject *return Py_BuildValue ("i", rpmfts_state(s, 0))
 
 rpmfts_debug ("rpmfts_Set", s)
 
return Py_BuildValue ("i", rc)
 

Macro Definition Documentation

#define CONSTANT (   _v)    PyDict_SetItemString(s->md_dict, #_v, o=PyInt_FromLong(_v)); Py_XDECREF(o)

Referenced by rpmfts_new().

#define infoBit (   _ix)    (1 << (((unsigned)(_ix)) & 0x1f))

Definition at line 25 of file rpmfts-py.c.

#define RPMFTS_CLOSE   0

Definition at line 54 of file rpmfts-py.c.

Referenced by rpmfts_dealloc(), and switch().

#define RPMFTS_OPEN   1

Definition at line 55 of file rpmfts-py.c.

Referenced by switch().

#define RPMFTS_OPEN_LAZY   2

Definition at line 56 of file rpmfts-py.c.

Referenced by switch().

Function Documentation

static const char* ftsInfoStr ( int  fts_info)
static

Definition at line 46 of file rpmfts-py.c.

References ftsInfoStrings.

Referenced by rpmfts_print().

if ( root  = NULL)

Definition at line 77 of file rpmfts-py.c.

if ( s->fts!  = NULL)

Definition at line 154 of file rpmfts-py.c.

References Py_INCREF().

if ( PyArg_ParseTupleAndKeywordsargs, kwds,"|sii:Open", kwlist,&root,&options,&ignore)
static PyObject* return Py_BuildValue ( "i"  ,
rpmfts_state(s, 0)   
)
return Py_BuildValue ( "i"  ,
rc   
)
Py_END_ALLOW_THREADS Py_INCREF ( Py_None  )
return ( PyObject *  )

Definition at line 215 of file rpmfts-py.c.

static PyObject* rpmfts_alloc ( PyTypeObject *  type,
Py_ssize_t  nitems 
)
static

Definition at line 373 of file rpmfts-py.c.

static void rpmfts_dealloc ( rpmftsObject s)
static
static void rpmfts_debug ( const char *  msg,
rpmftsObject s 
)
static
rpmfts_debug ( "rpmfts_state"  ,
s   
)
rpmfts_debug ( "rpmfts_step"  ,
s   
)
static PyObject* rpmfts_Debug ( rpmftsObject s,
PyObject *  args,
PyObject *  kwds 
)
static

Definition at line 180 of file rpmfts-py.c.

References _rpmfts_debug, kwlist, NULL, Py_INCREF(), and Py_None.

rpmfts_debug ( "rpmfts_Open"  ,
s   
)
rpmfts_debug ( "rpmfts_Children"  ,
s   
)
rpmfts_debug ( "rpmfts_Set"  ,
s   
)
static void rpmfts_free ( PyObject *  s)
static

Definition at line 367 of file rpmfts-py.c.

static PyObject* rpmfts_getattro ( PyObject *  o,
PyObject *  n 
)
static

Definition at line 328 of file rpmfts-py.c.

References rpmfts_debug().

static int rpmfts_init ( rpmftsObject s,
PyObject *  args,
PyObject *  kwds 
)
static

Definition at line 401 of file rpmfts-py.c.

References NULL, and rpmfts_debug().

static PyObject* rpmfts_new ( PyTypeObject *  type,
PyObject *  args,
PyObject *  kwds 
)
static
static int rpmfts_print ( rpmftsObject s,
FILE *  fp,
int  flags 
)
static
static int rpmfts_setattro ( PyObject *  o,
PyObject *  n,
PyObject *  v 
)
static

Definition at line 335 of file rpmfts-py.c.

References rpmfts_debug().

static int rpmfts_traverse ( rpmftsObject s,
visitproc  visit,
void arg 
)
static

Definition at line 509 of file rpmfts-py.c.

References rpmftsObject_s::callbacks, rpmftsObject_s::md_dict, and NULL.

switch ( nactive  )
Py_END_ALLOW_THREADS while ( s->fts &&  (1<< (((unsigned)(s->fts->fts_info))&0x1f))&s->ignore)

Variable Documentation

int _rpmfts_debug = 1
static

Definition at line 23 of file rpmfts-py.c.

Referenced by rpmfts_debug(), and rpmfts_Debug().

s active = 0

Definition at line 100 of file rpmfts-py.c.

s compare = NULL

Definition at line 96 of file rpmfts-py.c.

do
Initial value:
{
Py_BEGIN_ALLOW_THREADS
s->fts = Fts_read(s->ftsp)
FTSENT * Fts_read(FTS *sp)
Return next node in the file hierarchy traversal.
Definition: fts.c:467
const char * s
Definition: poptALL.c:734

Definition at line 148 of file rpmfts-py.c.

else
Initial value:
{
xx = rpmfts_state(s, 0 )
int xx
Definition: spec.c:744
const char * s
Definition: poptALL.c:734

Definition at line 157 of file rpmfts-py.c.

Py_BEGIN_ALLOW_THREADS s fts = NULL
const char* ftsInfoStrings[]
static
Initial value:
= {
"UNKNOWN",
"D",
"DC",
"DEFAULT",
"DNR",
"DOT",
"DP",
"ERR",
"F",
"INIT",
"NS",
"NSOK",
"SL",
"SLNONE",
"W",
}

Definition at line 27 of file rpmfts-py.c.

Referenced by ftsInfoStr().

s ftsp = NULL

Definition at line 98 of file rpmfts-py.c.

Referenced by cacheWalkPathFilter(), recurseDir(), and rpmcliWalkFirst().

int ignore = ignore

Definition at line 95 of file rpmfts-py.c.

Referenced by glob().

int
static
Initial value:
{
int ac = 1
int ac
Definition: rpmgrep.c:1431

Definition at line 72 of file rpmfts-py.c.

char* kwlist[] = {"root", "options", "ignore", NULL}

Definition at line 205 of file rpmfts-py.c.

size_t nb

Definition at line 74 of file rpmfts-py.c.

return NULL

Definition at line 146 of file rpmfts-py.c.

static PyObject *int options = options

Definition at line 94 of file rpmfts-py.c.

Referenced by Fts_open(), and mireSetCOptions().

return Py_None

Definition at line 259 of file rpmfts-py.c.

rc = 0

Definition at line 133 of file rpmfts-py.c.

return result

Definition at line 163 of file rpmfts-py.c.

return

Definition at line 102 of file rpmfts-py.c.

char rpmfts_doc[]
static
Initial value:
=
""

Definition at line 537 of file rpmfts-py.c.

PyMemberDef rpmfts_members[]
static
Initial value:
= {
{"__dict__",T_OBJECT,offsetof(rpmftsObject, md_dict), READONLY,
NULL},
{"callbacks",T_OBJECT,offsetof(rpmftsObject, callbacks), 0,
"Callback dictionary per fts_info state: FTS_{D|DC|DEFAULT|DNR|DOT|DP|ERR|F|INIT|NS|NSOK|SL|SLNONE|W}"},
{"options", T_INT, offsetof(rpmftsObject, options), 0,
"Option bit(s): FTS_{COMFOLLOW|LOGICAL|NOCHDIR|NOSTAT|PHYSICAL|SEEDOT|XDEV}"},
{"ignore", T_INT, offsetof(rpmftsObject, ignore), 0,
"Ignore bit(s): (1 << info) with info one of FTS_{D|DC|DEFAULT|DNR|DOT|DP|ERR|F|INIT|NS|NSOK|SL|SLNONE|W}"},
{NULL, 0, 0, 0, NULL}
}
s ignore
Definition: rpmfts-py.c:95
s options
Definition: rpmfts-py.c:94
return NULL
Definition: poptALL.c:613

Definition at line 316 of file rpmfts-py.c.

xx
Initial value:
{
PyObject * result = NULL
pid_t result
Definition: rpmsq.c:737
return NULL
Definition: poptALL.c:613

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