From cd04dcae8ad7c530bffc027f20d343920c27fb50 Mon Sep 17 00:00:00 2001 From: "Luiz Fernando N. Capitulino" Date: Mon, 16 Jul 2007 21:06:33 -0300 Subject: [PATCH] libgit-thin: pygit: Kill pygit_ prefix Those symbols are internal, no need to use a prefix. Signed-off-by: Luiz Fernando N. Capitulino --- libgit-thin/pygit/pygit.c | 112 ++++++++++++++++++++++------------------------ 1 file changed, 53 insertions(+), 59 deletions(-) diff --git a/libgit-thin/pygit/pygit.c b/libgit-thin/pygit/pygit.c index 482455310b..f092d97ba2 100644 --- a/libgit-thin/pygit/pygit.c +++ b/libgit-thin/pygit/pygit.c @@ -70,21 +70,21 @@ pygit_call_commit_op(struct git_commit *commit, } static PyObject * -pygit_commit_message(GitCommitObject *self, PyObject *args) +commit_message(GitCommitObject *self, PyObject *args) { UNUSED(args); return pygit_call_commit_op(self->commit, git_commit_message); } static PyObject * -pygit_commit_raw(GitCommitObject *self, PyObject *args) +commit_raw(GitCommitObject *self, PyObject *args) { UNUSED(args); return pygit_call_commit_op(self->commit, git_commit_raw); } static PyObject * -pygit_commit_id(GitCommitObject *self, PyObject *args) +commit_id(GitCommitObject *self, PyObject *args) { int err; unsigned char sha1[GIT_SHA1_SIZE]; @@ -98,22 +98,22 @@ pygit_commit_id(GitCommitObject *self, PyObject *args) return sha1_to_pystr(sha1); } -static PyMethodDef git_commit_methods[] = { - {"message", (PyCFunction) pygit_commit_message, METH_VARARGS, NULL}, - {"id", (PyCFunction) pygit_commit_id, METH_VARARGS, NULL}, - {"buffer", (PyCFunction) pygit_commit_raw, METH_VARARGS, NULL}, +static PyMethodDef commit_methods[] = { + {"message", (PyCFunction) commit_message, METH_VARARGS, NULL}, + {"id", (PyCFunction) commit_id, METH_VARARGS, NULL}, + {"buffer", (PyCFunction) commit_raw, METH_VARARGS, NULL}, {NULL, NULL, 0, NULL} }; static void -git_commit_dealloc(GitCommitObject *self) +commit_dealloc(GitCommitObject *self) { git_commit_free(self->commit); self->ob_type->tp_free((PyObject*) self); } static int -git_commit_compare(GitCommitObject *a, GitCommitObject *b) +commit_compare(GitCommitObject *a, GitCommitObject *b) { int ret = 0; int err, a_tz, b_tz; @@ -150,11 +150,11 @@ static PyTypeObject Git_Commit_Type = { "pygit.comit", /* tp_name */ sizeof(GitCommitObject), /* tp_basicsize */ 0, /* tp_itemsize */ - (destructor)git_commit_dealloc, /* tp_dealloc */ + (destructor)commit_dealloc, /* tp_dealloc */ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ - (cmpfunc)git_commit_compare, /* tp_compare */ + (cmpfunc)commit_compare, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ @@ -173,7 +173,7 @@ static PyTypeObject Git_Commit_Type = { 0, /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ - git_commit_methods, /* tp_methods */ + commit_methods, /* tp_methods */ 0, /* tp_members */ 0, /* tp_getset */ 0, /* tp_base */ @@ -197,21 +197,21 @@ typedef struct { } GitRevListObject; static void -pygit_revlist_free(GitRevListObject *self) +revlist_free(GitRevListObject *self) { git_revlist_free(self->opt); self->opt = NULL; } static PyObject * -pygit_revlist_add_commit(GitRevListObject *self, PyObject *args, int exclude) +revlist_add_commit(GitRevListObject *self, PyObject *args, int exclude) { int err; unsigned char sha1[GIT_SHA1_SIZE]; err = pyarg_to_sha1(args, sha1); if (err) { - pygit_revlist_free(self); + revlist_free(self); return NULL; } @@ -227,19 +227,19 @@ pygit_revlist_add_commit(GitRevListObject *self, PyObject *args, int exclude) } static PyObject * -pygit_revlist_include(GitRevListObject *self, PyObject *args) +revlist_include(GitRevListObject *self, PyObject *args) { - return pygit_revlist_add_commit(self, args, 0); + return revlist_add_commit(self, args, 0); } static PyObject * -pygit_revlist_exclude(GitRevListObject *self, PyObject *args) +revlist_exclude(GitRevListObject *self, PyObject *args) { - return pygit_revlist_add_commit(self, args, 1); + return revlist_add_commit(self, args, 1); } static PyObject * -pygit_revlist_reverse(GitRevListObject *self, PyObject *args) +revlist_reverse(GitRevListObject *self, PyObject *args) { int err; @@ -253,7 +253,7 @@ pygit_revlist_reverse(GitRevListObject *self, PyObject *args) } static PyObject * -pygit_revlist_show_merges(GitRevListObject *self, PyObject *args) +revlist_show_merges(GitRevListObject *self, PyObject *args) { int err; @@ -267,7 +267,7 @@ pygit_revlist_show_merges(GitRevListObject *self, PyObject *args) } static PyObject * -pygit_revlist_max_count(GitRevListObject *self, PyObject *args) +revlist_max_count(GitRevListObject *self, PyObject *args) { int err; unsigned long count; @@ -282,31 +282,31 @@ pygit_revlist_max_count(GitRevListObject *self, PyObject *args) Py_RETURN_NONE; } -static PyMethodDef git_revlist_methods[] = { - {"include", (PyCFunction) pygit_revlist_include, METH_VARARGS, NULL}, - {"exclude", (PyCFunction) pygit_revlist_exclude, METH_VARARGS, NULL}, - {"reverse", (PyCFunction) pygit_revlist_reverse, METH_NOARGS, NULL}, - {"show_merges", (PyCFunction) pygit_revlist_show_merges, METH_NOARGS, NULL}, - {"max_count", (PyCFunction) pygit_revlist_max_count,METH_VARARGS,NULL}, +static PyMethodDef revlist_methods[] = { + {"include", (PyCFunction) revlist_include, METH_VARARGS, NULL}, + {"exclude", (PyCFunction) revlist_exclude, METH_VARARGS, NULL}, + {"reverse", (PyCFunction) revlist_reverse, METH_NOARGS, NULL}, + {"show_merges", (PyCFunction) revlist_show_merges, METH_NOARGS, NULL}, + {"max_count", (PyCFunction) revlist_max_count,METH_VARARGS,NULL}, {NULL, NULL, 0, NULL} }; static void -git_revlist_dealloc(GitRevListObject *self) +revlist_dealloc(GitRevListObject *self) { git_revlist_free(self->opt); self->ob_type->tp_free((PyObject*) self); } static PyObject * -git_revlist_iter(GitRevListObject *self) +revlist_iter(GitRevListObject *self) { Py_INCREF(self); return (PyObject *) self; } static PyObject * -git_revlist_iternext(GitRevListObject *self) +revlist_iternext(GitRevListObject *self) { int ret; GitCommitObject *m; @@ -349,7 +349,7 @@ static PyTypeObject Git_RevList_Type = { "pygit.revlist", /* tp_name */ sizeof(GitRevListObject), /* tp_basicsize */ 0, /* tp_itemsize */ - (destructor)git_revlist_dealloc, /* tp_dealloc */ + (destructor)revlist_dealloc, /* tp_dealloc */ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ @@ -370,9 +370,9 @@ static PyTypeObject Git_RevList_Type = { 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ - (getiterfunc)git_revlist_iter, /* tp_iter */ - (iternextfunc)git_revlist_iternext, /* tp_iternext */ - git_revlist_methods, /* tp_methods */ + (getiterfunc)revlist_iter, /* tp_iter */ + (iternextfunc)revlist_iternext, /* tp_iternext */ + revlist_methods, /* tp_methods */ 0, /* tp_members */ 0, /* tp_getset */ 0, /* tp_base */ @@ -418,7 +418,7 @@ repo_read_obj(PyObject *args, } static PyObject * -pygit_repo_head_commit(GitRepoObject *self, PyObject *args) +repo_head_commit(GitRepoObject *self, PyObject *args) { int err; unsigned char sha1[GIT_SHA1_SIZE]; @@ -434,21 +434,21 @@ pygit_repo_head_commit(GitRepoObject *self, PyObject *args) } static PyObject * -pygit_repo_read_commit(GitRepoObject *self, PyObject *args) +repo_read_commit(GitRepoObject *self, PyObject *args) { UNUSED(self); return repo_read_obj(args, git_repo_commit_read); } static PyObject * -pygit_repo_read_blob(GitRepoObject *self, PyObject *args) +repo_read_blob(GitRepoObject *self, PyObject *args) { UNUSED(self); return repo_read_obj(args, git_repo_blob_read); } static PyObject * -pygit_repo_lookup_commit(GitRepoObject *self, PyObject *args) +repo_lookup_commit(GitRepoObject *self, PyObject *args) { int err; GitCommitObject *m; @@ -483,7 +483,7 @@ pygit_repo_lookup_commit(GitRepoObject *self, PyObject *args) } static PyObject * -pygit_repo_translate_ref(GitRepoObject *self, PyObject *args) +repo_translate_ref(GitRepoObject *self, PyObject *args) { int err; const char *ref; @@ -502,7 +502,7 @@ pygit_repo_translate_ref(GitRepoObject *self, PyObject *args) } static PyObject * -pygit_repo_revlist(GitRepoObject *self, PyObject *args) +repo_revlist(GitRepoObject *self, PyObject *args) { int err; GitRevListObject *m; @@ -530,30 +530,24 @@ pygit_repo_revlist(GitRepoObject *self, PyObject *args) return (PyObject *) m; } -static PyMethodDef git_repo_methods[] = { - {"read_commit", (PyCFunction) pygit_repo_read_commit, - METH_VARARGS, NULL}, - {"read_blob", (PyCFunction) pygit_repo_read_blob, - METH_VARARGS, NULL}, - {"lookup_commit", (PyCFunction) pygit_repo_lookup_commit, - METH_VARARGS, NULL}, - {"head_commit", (PyCFunction) pygit_repo_head_commit, METH_NOARGS, - NULL}, - {"translate_ref", (PyCFunction) pygit_repo_translate_ref, - METH_VARARGS, NULL}, - {"revlist", (PyCFunction) pygit_repo_revlist, - METH_VARARGS, NULL}, +static PyMethodDef repo_methods[] = { + {"read_commit", (PyCFunction) repo_read_commit, METH_VARARGS, NULL}, + {"read_blob", (PyCFunction) repo_read_blob, METH_VARARGS, NULL}, + {"lookup_commit", (PyCFunction) repo_lookup_commit, METH_VARARGS,NULL}, + {"head_commit", (PyCFunction) repo_head_commit, METH_NOARGS, NULL}, + {"translate_ref", (PyCFunction) repo_translate_ref,METH_VARARGS, NULL}, + {"revlist", (PyCFunction) repo_revlist, METH_VARARGS, NULL}, {NULL, NULL, 0, NULL} }; -static PyMemberDef git_repo_members[] = { +static PyMemberDef repo_members[] = { {"path", T_OBJECT_EX, offsetof(GitRepoObject, path), 0, "repository's path"}, {NULL, 0, 0, 0, NULL} }; static void -git_repo_dealloc(GitRepoObject *self) +repo_dealloc(GitRepoObject *self) { Py_XDECREF(self->path); self->ob_type->tp_free((PyObject*) self); @@ -565,7 +559,7 @@ static PyTypeObject Git_Repo_Type = { "pygit.repo", /* tp_name */ sizeof(GitRepoObject), /* tp_basicsize */ 0, /* tp_itemsize */ - (destructor)git_repo_dealloc, /* tp_dealloc */ + (destructor)repo_dealloc, /* tp_dealloc */ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ @@ -588,8 +582,8 @@ static PyTypeObject Git_Repo_Type = { 0, /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ - git_repo_methods, /* tp_methods */ - git_repo_members, /* tp_members */ + repo_methods, /* tp_methods */ + repo_members, /* tp_members */ 0, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ -- 2.11.4.GIT