"subvertpy.wc",
[source_path(n) for n in
["wc.c", "wc_adm.c", "util.c", "editor.c"]],
- libraries=["svn_wc-1", "svn_subr-1"])
+ libraries=["svn_wc-1", "svn_subr-1"]),
+ SvnExtension(
+ "subvertpy.subr",
+ [source_path(n)
+ for n in ["util.c", "subr.c"]],
+ libraries=["svn_subr-1"]),
]
--- /dev/null
+/*
+ * Copyright © 2017 Jelmer Vernooij <jelmer@jelmer.uk>
+ * -*- coding: utf-8 -*-
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+#include <Python.h>
+#include <apr_general.h>
+#include <svn_path.h>
+#include <stdbool.h>
+#include <apr_md5.h>
+#include <apr_sha1.h>
+
+#include "util.h"
+
+static PyMethodDef subr_methods[] = {
+ { NULL }
+};
+
+static PyObject *
+moduleinit(void)
+{
+ PyObject *mod;
+
+ apr_initialize();
+
+#if PY_MAJOR_VERSION >= 3
+ static struct PyModuleDef moduledef = {
+ PyModuleDef_HEAD_INIT,
+ "subr", /* m_name */
+ "subr", /* m_doc */
+ -1, /* m_size */
+ subr_methods, /* m_methods */
+ NULL, /* m_reload */
+ NULL, /* m_traverse */
+ NULL, /* m_clear*/
+ NULL, /* m_free */
+ };
+ mod = PyModule_Create(&moduledef);
+#else
+ mod = Py_InitModule3("subr", subr_methods, "Subversion subr");
+#endif
+ if (mod == NULL)
+ return NULL;
+
+ return mod;
+}
+
+#if PY_MAJOR_VERSION >= 3
+PyMODINIT_FUNC
+PyInit_subr(void)
+{
+ return moduleinit();
+}
+#else
+PyMODINIT_FUNC
+initsubr(void)
+{
+ moduleinit();
+}
+#endif
--- /dev/null
+# Copyright (C) 2017 Jelmer Vernooij <jelmer@jelmer.uk>
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+"""Subversion subr library tests."""
+
+from unittest import SkipTest