9 #define _MACRO_INTERNAL
62 PyObject * result = NULL;
63 const char * buildRootURL =
rpmExpand(
"%{?buildroot}", NULL);
64 if (spec != NULL && *buildRootURL)
65 result = Py_BuildValue(
"s", buildRootURL);
66 buildRootURL =
_free(buildRootURL);
75 return (spec != NULL && spec->
prep != NULL)
84 return (spec != NULL && spec->
build != NULL)
93 return (spec != NULL && spec->
install != NULL)
102 return (spec != NULL && spec->
check != NULL)
111 return (spec != NULL && spec->
clean != NULL)
120 PyObject *sourceList, *srcUrl;
124 sourceList = PyList_New(0);
132 while (source != NULL) {
134 srcUrl = Py_BuildValue(
"(sii)", fullSource, source->
num, source->
flags);
136 Py_XDECREF(sourceList);
139 PyList_Append(sourceList, srcUrl);
140 source = source->
next;
143 return PyList_AsTuple(sourceList);
159 macroDict = PyDict_New();
166 if (mc->macroTable != NULL) {
168 for (i = 0; i < mc->firstFree; i++) {
171 if ((me = mc->macroTable[i]) == NULL) {
175 macro = PyDict_New();
177 PyMapping_SetItemString(macro,
"used", PyInt_FromLong(me->used));
178 PyMapping_SetItemString(macro,
"level", PyInt_FromLong(me->level));
179 if (me->opts && *me->opts)
180 PyMapping_SetItemString(macro,
"opts", PyString_FromString(me->opts));
181 if (me->body && *me->body)
182 PyMapping_SetItemString(macro,
"body", PyString_FromString(me->body));
183 PyMapping_SetItemString(macroDict, strdup(me->name), macro);
217 PyObject_HEAD_INIT(&PyType_Type)