2 * Copyright (C) 2001-2007 Red Hat, Inc.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 #include "libcheckisomd5.h"
23 #include "libimplantisomd5.h"
25 static PyObject * doCheckIsoMD5Sum(PyObject * s, PyObject * args);
26 static PyObject * doImplantIsoMD5Sum(PyObject * s, PyObject * args);
28 static PyMethodDef isomd5sumMethods[] = {
29 { "checkisomd5sum", (PyCFunction) doCheckIsoMD5Sum, METH_VARARGS, NULL },
30 { "implantisomd5sum", (PyCFunction) doImplantIsoMD5Sum, METH_VARARGS, NULL },
35 static PyObject * doCheckIsoMD5Sum(PyObject * s, PyObject * args) {
39 if (!PyArg_ParseTuple(args, "s", &isofile))
42 rc = mediaCheckFile(isofile, NULL, NULL);
44 return Py_BuildValue("i", rc);
47 static PyObject * doImplantIsoMD5Sum(PyObject * s, PyObject * args) {
48 char *isofile, *errstr;
49 int forceit, supported;
52 if (!PyArg_ParseTuple(args, "sii", &isofile, &supported, &forceit))
55 rc = implantISOFile(isofile, supported, forceit, 1, &errstr);
57 return Py_BuildValue("i", rc);
61 void initpyisomd5sum(void) {
64 m = Py_InitModule("pyisomd5sum", isomd5sumMethods);
65 d = PyModule_GetDict(m);