X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Ffiled%2Fpythonfd.c;h=ab15c6b9ada0a8320784f8c82d8c02f4ce02c0e1;hb=72863eb7569fa014b05e8f98aac32d773825b51c;hp=08b1736cde2ff10d8cbfd86f912ee2b00806833f;hpb=941145e810416e7a0ec0fad91c00a9b5dd92214b;p=bacula%2Fbacula diff --git a/bacula/src/filed/pythonfd.c b/bacula/src/filed/pythonfd.c index 08b1736cde..ab15c6b9ad 100644 --- a/bacula/src/filed/pythonfd.c +++ b/bacula/src/filed/pythonfd.c @@ -6,7 +6,7 @@ The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. This program is Free Software; you can redistribute it and/or - modify it under the terms of version two of the GNU General Public + modify it under the terms of version three of the GNU Affero General Public License as published by the Free Software Foundation and included in the file LICENSE. @@ -15,12 +15,12 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License + You should have received a copy of the GNU Affero General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - Bacula® is a registered trademark of John Walker. + Bacula® is a registered trademark of Kern Sibbald. The licensor of Bacula is the Free Software Foundation Europe (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich, Switzerland, email:ftf@fsfeurope.org. @@ -42,10 +42,7 @@ #undef _POSIX_C_SOURCE #include - -extern JCR *get_jcr_from_PyObject(PyObject *self); -extern PyObject *find_method(PyObject *eventsObject, PyObject *method, - const char *name); +#include /* Forward referenced functions */ static PyObject *set_job_events(PyObject *self, PyObject *arg); @@ -60,7 +57,7 @@ PyMethodDef JobMethods[] = { struct s_vars { const char *name; - char *fmt; + const char *fmt; }; /* Read-only variables */ @@ -109,21 +106,21 @@ PyObject *job_getattr(PyObject *self, char *attrname) } switch (i) { case 0: /* FD's name */ - return Py_BuildValue(getvars[i].fmt, my_name); + return Py_BuildValue((char *)getvars[i].fmt, my_name); case 1: /* level */ - return Py_BuildValue(getvars[i].fmt, job_level_to_str(jcr->JobLevel)); + return Py_BuildValue((char *)getvars[i].fmt, job_level_to_str(jcr->getJobLevel())); case 2: /* type */ - return Py_BuildValue(getvars[i].fmt, job_type_to_str(jcr->JobType)); + return Py_BuildValue((char *)getvars[i].fmt, job_type_to_str(jcr->getJobType())); case 3: /* JobId */ - return Py_BuildValue(getvars[i].fmt, jcr->JobId); + return Py_BuildValue((char *)getvars[i].fmt, jcr->JobId); case 4: /* Client */ - return Py_BuildValue(getvars[i].fmt, jcr->client_name); + return Py_BuildValue((char *)getvars[i].fmt, jcr->client_name); case 5: /* JobName */ - return Py_BuildValue(getvars[i].fmt, jcr->Job); + return Py_BuildValue((char *)getvars[i].fmt, jcr->Job); case 6: /* JobStatus */ buf[1] = 0; buf[0] = jcr->JobStatus; - return Py_BuildValue(getvars[i].fmt, buf); + return Py_BuildValue((char *)getvars[i].fmt, buf); } bsnprintf(errmsg, sizeof(errmsg), _("Attribute %s not found."), attrname); bail_out: @@ -166,7 +163,7 @@ int job_setattr(PyObject *self, char *attrname, PyObject *value) } /* Get argument value ***FIXME*** handle other formats */ if (setvars[i].fmt != NULL) { - if (!PyArg_Parse(value, setvars[i].fmt, &strval)) { + if (!PyArg_Parse(value, (char *)setvars[i].fmt, &strval)) { PyErr_SetString(PyExc_TypeError, _("Read-only attribute")); return -1; } @@ -245,7 +242,7 @@ int generate_job_event(JCR *jcr, const char *event) } bstrncpy(jcr->event, event, sizeof(jcr->event)); - result = PyObject_CallFunction(method, "O", Job); + result = PyObject_CallFunction(method, (char *)"O", Job); jcr->event[0] = 0; /* no event in progress */ if (result == NULL) { if (PyErr_Occurred()) {