Skip to content

Commit

Permalink
disable some part of geanypy-encodings.[ch] which are not part of Gea…
Browse files Browse the repository at this point in the history
…ny's

official plugin API.
  • Loading branch information
kugel- committed Jan 4, 2016
1 parent 8c2e6f7 commit 6f5d26e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
26 changes: 17 additions & 9 deletions src/geanypy-encoding.c
@@ -1,5 +1,7 @@
#include "geanypy.h"

#if 0
/* Reenable once more of encodings.[ch] bcomes part of the plugin API */

static void
Encoding_dealloc(Encoding *self)
Expand Down Expand Up @@ -87,7 +89,7 @@ Encoding *Encoding_create_new_from_geany_encoding(GeanyEncoding *enc)
self->encoding = enc;
return self;
}

#endif

static PyObject *
Encodings_convert_to_utf8(PyObject *module, PyObject *args, PyObject *kwargs)
Expand Down Expand Up @@ -155,6 +157,8 @@ Encodings_get_charset_from_index(PyObject *module, PyObject *args, PyObject *kwa
Py_RETURN_NONE;
}

#if 0
/* Reenable once more of encodings.[ch] bcomes part of the plugin API */

static const gchar *encoding_groups[] = {
"GROUP_NONE",
Expand All @@ -165,7 +169,7 @@ static const gchar *encoding_groups[] = {
"GROUP_MIDDLE_EASTERN",
"GROUP_UNICODE"
};

#endif

static const gchar *encoding_names[] = {
"ISO_8859_1",
Expand Down Expand Up @@ -292,19 +296,23 @@ initencoding(void)
int i;
PyObject *m;

EncodingType.tp_new = PyType_GenericNew;
if (PyType_Ready(&EncodingType) < 0)
return;

m = Py_InitModule3("encoding", EncodingsModule_methods,
"Encoding conversion functions.");

Py_INCREF(&EncodingType);
PyModule_AddObject(m, "Encoding", (PyObject *) &EncodingType);

for (i = 0; i < GEANY_ENCODINGS_MAX; i++)
PyModule_AddIntConstant(m, encoding_names[i], (glong) i);
#if 0
/* Reenable once more of encodings.[ch] bcomes part of the plugin API */

for (i = 0; i < GEANY_ENCODING_GROUPS_MAX; i++)
PyModule_AddIntConstant(m, encoding_groups[i], (glong) i);

EncodingType.tp_new = PyType_GenericNew;
if (PyType_Ready(&EncodingType) < 0)
return;


Py_INCREF(&EncodingType);
PyModule_AddObject(m, "Encoding", (PyObject *) &EncodingType);
#endif
}
5 changes: 4 additions & 1 deletion src/geanypy-encoding.h
@@ -1,7 +1,8 @@
#ifndef GEANYPY_ENCODING_H__
#define GEANYPY_ENCODING_H__

PyTypeObject EncodingType;
#if 0
/* Reenable once more of encodings.[ch] bcomes part of the plugin API */

typedef struct
{
Expand All @@ -11,4 +12,6 @@ typedef struct

Encoding *Encoding_create_new_from_geany_encoding(GeanyEncoding *enc);

#endif

#endif /* GEANYPY_ENCODING_H__ */

0 comments on commit 6f5d26e

Please sign in to comment.