Ignore:
Timestamp:
11/06/09 01:15:56 (14 years ago)
Author:
atzm
Message:

modified indentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pymigemo/pymigemo.c

    r29 r30  
    11/* 
    22 * pymigemo.c - C/Migemo wrapper for Python 
    3  * Copyright(C) 2005, Atzm WATANABE <atzm@atzm.org> 
    4  * License: BSD-style 
     3 * Copyright(C) 2005-2009, Atzm WATANABE <atzm@atzm.org> 
    54 * 
    65 * $Id$ 
     
    87 
    98#include <Python.h> 
    10 #include "structmember.h" 
    11 #include "migemo.h" 
    12  
    13 #define PYMIGEMO_VERSION "0.1" 
     9#include <structmember.h> 
     10#include <migemo.h> 
     11#include <string.h> 
     12 
     13#define PYMIGEMO_VERSION "0.2" 
    1414 
    1515/* for dereference migemo object members */ 
    16 struct _migemo 
    17 { 
    18   int enable; 
    19   void *mtree; 
    20   int charset; 
    21   void *roma2hira; 
    22   void *hira2kata; 
    23   void *han2zen; 
    24   void *zen2han; 
    25   void *rx; 
    26   void *addword; 
    27   void *char2int; 
     16struct _migemo { 
     17    int   enable; 
     18    void *mtree; 
     19    int   charset; 
     20    void *roma2hira; 
     21    void *hira2kata; 
     22    void *han2zen; 
     23    void *zen2han; 
     24    void *rx; 
     25    void *addword; 
     26    void *char2int; 
    2827}; 
    2928 
    3029typedef struct { 
    31   PyObject_HEAD 
    32   migemo *migemo_obj; 
     30    PyObject_HEAD 
     31    migemo *migemo_obj; 
    3332} Migemo; 
    3433 
     
    3635Migemo_dealloc(Migemo *self) 
    3736{ 
    38   if (self->migemo_obj) 
    39     migemo_close(self->migemo_obj); 
    40  
    41   self->ob_type->tp_free((PyObject *)self); 
     37    if (self->migemo_obj) { 
     38        migemo_close(self->migemo_obj); 
     39    } 
     40 
     41    self->ob_type->tp_free((PyObject *)self); 
    4242} 
    4343 
     
    4545Migemo_new(PyTypeObject *type, PyObject *args, PyObject *kwds) 
    4646{ 
    47   Migemo *self; 
    48  
    49   self = (Migemo *)type->tp_alloc(type, 0); 
    50   if (self != NULL) 
    51     self->migemo_obj = NULL; 
    52  
    53   return (PyObject *)self; 
     47    Migemo *self; 
     48 
     49    self = (Migemo *)type->tp_alloc(type, 0); 
     50 
     51    if (self != NULL) { 
     52        self->migemo_obj = NULL; 
     53    } 
     54 
     55    return (PyObject *)self; 
    5456} 
    5557 
     
    5759Migemo_init(Migemo *self, PyObject *args, PyObject *kwds) 
    5860{ 
    59   migemo *migemo_obj; 
    60   char *dictionary; 
    61   static char *kwlist[] = {"dictionary", NULL}; 
    62  
    63   if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", kwlist, &dictionary)) 
    64     return -1; 
    65  
    66   if (dictionary) { 
    67     if (self->migemo_obj) 
    68       migemo_close(self->migemo_obj); 
    69  
    70     migemo_obj = migemo_open(dictionary); 
    71  
    72     if (migemo_obj) 
    73       self->migemo_obj = migemo_obj; 
    74     else 
    75       return -1; 
    76   } 
    77  
    78   return 0; 
    79 } 
    80  
    81 const char * 
    82 get_encoding(int charset) 
    83 { 
    84   const char *encoding; 
    85  
    86   switch(charset) { 
    87   case 1: 
    88     encoding = "cp932"; 
    89     break; 
    90   case 2: 
    91     encoding = "euc_jp"; 
    92     break; 
    93   case 3: 
    94     encoding = "utf8"; 
    95     break; 
    96   default: 
    97     encoding = Py_FileSystemDefaultEncoding; 
    98   } 
    99  
    100   return encoding; 
     61    migemo *migemo_obj; 
     62    char   *dictionary; 
     63 
     64    static char *kwlist[] = {"dictionary", NULL}; 
     65 
     66    if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", kwlist, &dictionary)) { 
     67        return -1; 
     68    } 
     69 
     70    if (dictionary) { 
     71        if (self->migemo_obj) { 
     72            migemo_close(self->migemo_obj); 
     73        } 
     74 
     75        migemo_obj = migemo_open(dictionary); 
     76 
     77        if (migemo_obj) { 
     78            self->migemo_obj = migemo_obj; 
     79        } 
     80        else { 
     81            return -1; 
     82        } 
     83    } 
     84 
     85    return 0; 
     86} 
     87 
     88static int 
     89get_encoding(char *encoding, size_t size, int charset) 
     90{ 
     91    char *enc; 
     92 
     93    switch(charset) { 
     94    case 1: 
     95        enc = "cp932"; 
     96        break; 
     97    case 2: 
     98        enc = "euc_jp"; 
     99        break; 
     100    case 3: 
     101        enc = "utf_8"; 
     102        break; 
     103    default: 
     104        enc = "ascii"; 
     105    } 
     106 
     107    if (strlen(enc) < size) { 
     108        strcpy(encoding, enc); 
     109        return 1; 
     110    } 
     111 
     112    return 0; 
    101113} 
    102114 
     
    104116Migemo_get_encoding(Migemo *self) 
    105117{ 
    106   return Py_BuildValue("s", get_encoding(self->migemo_obj->charset)); 
     118    char encoding[7]; 
     119 
     120    if (!get_encoding(encoding, sizeof(encoding), self->migemo_obj->charset)) { 
     121        return NULL; 
     122    } 
     123 
     124    return PyString_FromString(encoding); 
    107125} 
    108126 
     
    110128Migemo_query(Migemo *self, PyObject *args, PyObject *kwds) 
    111129{ 
    112   PyObject *result, *query_obj; 
    113   static char *kwlist[] = {"query", NULL}; 
    114  
    115   const char *query, *encoding; 
    116   unsigned char *regex; 
    117   PyObject *query_str = NULL, *regex_strobj = NULL; 
    118  
    119   if (!PyArg_ParseTupleAndKeywords(args, kwds, "O", kwlist, &query_obj)) 
    120     return NULL; 
    121  
    122   encoding = get_encoding(self->migemo_obj->charset); 
    123  
    124   if (PyUnicode_Check(query_obj)) { 
    125     query_str = PyUnicode_AsEncodedString(query_obj, encoding, "strict"); 
    126     query = PyString_AS_STRING(query_str); 
    127   } 
    128   else if (PyString_Check(query_obj)) 
    129     query = PyString_AS_STRING(query_obj); 
    130   else 
    131     return NULL; 
    132  
    133   if (query) { 
    134     regex = migemo_query(self->migemo_obj, query); 
    135  
    136     if (regex) { 
    137       regex_strobj = PyString_FromString(regex); 
    138  
    139       if (regex_strobj) 
    140         result = PyUnicode_FromEncodedObject(regex_strobj, encoding, "strict"); 
    141  
    142       migemo_release(self->migemo_obj, regex); 
    143     } 
    144   } 
    145  
    146   Py_XDECREF(regex_strobj); 
    147   Py_XDECREF(query_str); 
    148  
    149   if (!result) 
    150     return NULL; 
    151  
    152   return result; 
     130    PyObject      *result, *query_obj, *query_str = NULL, *regex_strobj = NULL; 
     131    char          *query, encoding[7]; 
     132    unsigned char *regex; 
     133 
     134    static char *kwlist[] = {"query", NULL}; 
     135 
     136    if (!PyArg_ParseTupleAndKeywords(args, kwds, "O", kwlist, &query_obj)) { 
     137        return NULL; 
     138    } 
     139 
     140    if (!get_encoding(encoding, sizeof(encoding), self->migemo_obj->charset)) { 
     141        return NULL; 
     142    } 
     143 
     144    if (PyUnicode_Check(query_obj)) { 
     145        query_str = PyUnicode_AsEncodedString(query_obj, encoding, "strict"); 
     146        query     = PyString_AS_STRING(query_str); 
     147    } 
     148    else if (PyString_Check(query_obj)) { 
     149        query = PyString_AS_STRING(query_obj); 
     150    } 
     151    else { 
     152        return NULL; 
     153    } 
     154 
     155    if (query) { 
     156        regex = migemo_query(self->migemo_obj, query); 
     157 
     158        if (regex) { 
     159            regex_strobj = PyString_FromString(regex); 
     160 
     161            if (regex_strobj) { 
     162                result = PyUnicode_FromEncodedObject(regex_strobj, encoding, "strict"); 
     163            } 
     164 
     165            migemo_release(self->migemo_obj, regex); 
     166        } 
     167    } 
     168 
     169    Py_XDECREF(regex_strobj); 
     170    Py_XDECREF(query_str); 
     171 
     172    if (!result) { 
     173        return NULL; 
     174    } 
     175 
     176    return result; 
    153177} 
    154178 
     
    156180Migemo_set_operator(Migemo *self, PyObject *args, PyObject *kwds) 
    157181{ 
    158   PyObject *result; 
    159   static char *kwlist[] = {"index", "op", NULL}; 
    160  
    161   int index; 
    162   char *op; 
     182    PyObject *result; 
     183    char     *op; 
     184    int       index; 
    163185   
    164   if (!PyArg_ParseTupleAndKeywords(args, kwds, "is", kwlist, &index, &op)) 
    165     return NULL; 
    166  
    167   if (op) 
    168     result = Py_BuildValue("i", migemo_set_operator(self->migemo_obj, index, op)); 
    169  
    170   if (!result) 
    171     return NULL; 
    172  
    173   return result; 
     186    static char *kwlist[] = {"index", "op", NULL}; 
     187 
     188    if (!PyArg_ParseTupleAndKeywords(args, kwds, "is", kwlist, &index, &op)) { 
     189        return NULL; 
     190    } 
     191 
     192    if (op) { 
     193        result = PyInt_FromLong((long)migemo_set_operator(self->migemo_obj, index, op)); 
     194    } 
     195 
     196    if (!result) { 
     197        return NULL; 
     198    } 
     199 
     200    return result; 
    174201} 
    175202 
     
    177204Migemo_get_operator(Migemo *self, PyObject *args, PyObject *kwds) 
    178205{ 
    179   PyObject *result; 
    180   static char *kwlist[] = {"index", NULL}; 
    181  
    182   int index; 
    183   const unsigned char *op; 
     206    PyObject      *result; 
     207    unsigned char *op; 
     208    int            index; 
    184209   
    185   if (!PyArg_ParseTupleAndKeywords(args, kwds, "i", kwlist, &index)) 
    186     return NULL; 
    187  
    188   op = migemo_get_operator(self->migemo_obj, index); 
    189   result = Py_BuildValue("s", op); 
    190  
    191   if (!result) 
    192     return NULL; 
    193  
    194   return result; 
     210    static char *kwlist[] = {"index", NULL}; 
     211 
     212    if (!PyArg_ParseTupleAndKeywords(args, kwds, "i", kwlist, &index)) { 
     213        return NULL; 
     214    } 
     215 
     216    if (op = migemo_get_operator(self->migemo_obj, index)) { 
     217        result = PyString_FromString(op); 
     218    } 
     219 
     220    if (!result) { 
     221        return NULL; 
     222    } 
     223 
     224    return result; 
    195225} 
    196226 
     
    198228Migemo_load(Migemo *self, PyObject *args, PyObject *kwds) 
    199229{ 
    200   PyObject *result; 
    201   static char *kwlist[] = {"dict_id", "dict_file", NULL}; 
    202  
    203   int dict_id; 
    204   const char *dict_file; 
     230    PyObject *result; 
     231    char     *dict_file; 
     232    int       dict_id; 
    205233   
    206   if (!PyArg_ParseTupleAndKeywords(args, kwds, "is", kwlist, &dict_id, &dict_file)) 
    207     return NULL; 
    208  
    209   if (dict_file) 
    210     result = Py_BuildValue("i", migemo_load(self->migemo_obj, dict_id, dict_file)); 
    211  
    212   if (!result) 
    213     return NULL; 
    214  
    215   return result; 
     234    static char *kwlist[] = {"dict_id", "dict_file", NULL}; 
     235 
     236    if (!PyArg_ParseTupleAndKeywords(args, kwds, "is", kwlist, &dict_id, &dict_file)) { 
     237        return NULL; 
     238    } 
     239 
     240    if (dict_file) { 
     241        result = PyInt_FromLong((long)migemo_load(self->migemo_obj, dict_id, dict_file)); 
     242    } 
     243 
     244    if (!result) { 
     245        return NULL; 
     246    } 
     247 
     248    return result; 
    216249} 
    217250 
     
    219252Migemo_is_enable(Migemo *self) 
    220253{ 
    221   return Py_BuildValue("i", migemo_is_enable(self->migemo_obj)); 
     254    return PyInt_FromLong((long)migemo_is_enable(self->migemo_obj)); 
    222255} 
    223256 
    224257static PyMethodDef Migemo_methods[] = { 
    225   {"query", (PyCFunction)Migemo_query, METH_KEYWORDS, 
    226    "return regex from romaji string\n\ 
     258    {"query", (PyCFunction)Migemo_query, METH_KEYWORDS, 
     259     "return regex from romaji string\n\ 
    227260\n\ 
    228261def query(query)\n\ 
     
    230263\n\ 
    231264  returns: regex string as Unicode object"}, 
    232   {"set_operator", (PyCFunction)Migemo_set_operator, METH_KEYWORDS, 
    233    "set operator string as the meta character of regex\n\ 
     265    {"set_operator", (PyCFunction)Migemo_set_operator, METH_KEYWORDS, 
     266     "set operator string as the meta character of regex\n\ 
    234267\n\ 
    235268def set_operator(index, op):\n\ 
     
    239272\n\ 
    240273  returns: boolean value"}, 
    241   {"get_operator", (PyCFunction)Migemo_get_operator, METH_KEYWORDS, 
    242    "get operator string as the meta character of regex\n\ 
     274    {"get_operator", (PyCFunction)Migemo_get_operator, METH_KEYWORDS, 
     275     "get operator string as the meta character of regex\n\ 
    243276\n\ 
    244277def get_operator(index)\n\ 
     
    247280\n\ 
    248281  returns: operator string (str)"}, 
    249   {"load", (PyCFunction)Migemo_load, METH_KEYWORDS, 
    250    "add dictionary to Migemo object\n\ 
     282    {"load", (PyCFunction)Migemo_load, METH_KEYWORDS, 
     283     "add dictionary to Migemo object\n\ 
    251284\n\ 
    252285def load(dict_id, dict_file)\n\ 
     
    256289\n\ 
    257290  returns: boolean value"}, 
    258   {"is_enable", (PyCFunction)Migemo_is_enable, METH_NOARGS, 
    259    "check internal migemo_dict\n\ 
     291    {"is_enable", (PyCFunction)Migemo_is_enable, METH_NOARGS, 
     292     "check internal migemo_dict\n\ 
    260293\n\ 
    261294def is_enable()\n\ 
    262295  returns: boolean value"}, 
    263   {"get_encoding", (PyCFunction)Migemo_get_encoding, METH_NOARGS, 
    264    "get dictionary encoding\n\ 
     296    {"get_encoding", (PyCFunction)Migemo_get_encoding, METH_NOARGS, 
     297     "get dictionary encoding\n\ 
    265298\n\ 
    266299def get_encoding()\n\ 
    267300  returns: encoding string (str)"}, 
    268   {NULL} /* Sentinel */ 
     301    {NULL} /* Sentinel */ 
    269302}; 
    270303 
    271304static PyMemberDef Migemo_members[] = { 
    272   {NULL} /* Sentinel */ 
     305    {NULL} /* Sentinel */ 
    273306}; 
    274307 
    275308static PyTypeObject MigemoType = { 
    276   PyObject_HEAD_INIT(NULL) 
    277   0,                          /*ob_size*/ 
    278   "migemo.Migemo",            /*tp_name*/ 
    279   sizeof(Migemo),             /*tp_basicsize*/ 
    280   0,                          /*tp_itemsize*/ 
    281   (destructor)Migemo_dealloc, /*tp_dealloc*/ 
    282   0,                          /*tp_print*/ 
    283   0,                          /*tp_getattr*/ 
    284   0,                          /*tp_setattr*/ 
    285   0,                          /*tp_compare*/ 
    286   0,                          /*tp_repr*/ 
    287   0,                          /*tp_as_number*/ 
    288   0,                          /*tp_as_sequence*/ 
    289   0,                          /*tp_as_mapping*/ 
    290   0,                          /*tp_hash */ 
    291   0,                          /*tp_call*/ 
    292   0,                          /*tp_str*/ 
    293   0,                          /*tp_getattro*/ 
    294   0,                          /*tp_setattro*/ 
    295   0,                          /*tp_as_buffer*/ 
    296   Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ 
    297   "Migemo wrapper object",    /* tp_doc */ 
    298   0,                          /* tp_traverse */ 
    299   0,                          /* tp_clear */ 
    300   0,                          /* tp_richcompare */ 
    301   0,                          /* tp_weaklistoffset */ 
    302   0,                          /* tp_iter */ 
    303   0,                          /* tp_iternext */ 
    304   Migemo_methods,             /* tp_methods */ 
    305   Migemo_members,             /* tp_members */ 
    306   0,                          /* tp_getset */ 
    307   0,                          /* tp_base */ 
    308   0,                          /* tp_dict */ 
    309   0,                          /* tp_descr_get */ 
    310   0,                          /* tp_descr_set */ 
    311   0,                          /* tp_dictoffset */ 
    312   (initproc)Migemo_init,      /* tp_init */ 
    313   0,                          /* tp_alloc */ 
    314   Migemo_new,                 /* tp_new */ 
     309    PyObject_HEAD_INIT(NULL) 
     310    0,                          /*ob_size*/ 
     311    "migemo.Migemo",            /*tp_name*/ 
     312    sizeof(Migemo),             /*tp_basicsize*/ 
     313    0,                          /*tp_itemsize*/ 
     314    (destructor)Migemo_dealloc, /*tp_dealloc*/ 
     315    0,                          /*tp_print*/ 
     316    0,                          /*tp_getattr*/ 
     317    0,                          /*tp_setattr*/ 
     318    0,                          /*tp_compare*/ 
     319    0,                          /*tp_repr*/ 
     320    0,                          /*tp_as_number*/ 
     321    0,                          /*tp_as_sequence*/ 
     322    0,                          /*tp_as_mapping*/ 
     323    0,                          /*tp_hash */ 
     324    0,                          /*tp_call*/ 
     325    0,                          /*tp_str*/ 
     326    0,                          /*tp_getattro*/ 
     327    0,                          /*tp_setattro*/ 
     328    0,                          /*tp_as_buffer*/ 
     329    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /*tp_flags*/ 
     330    "Migemo wrapper object",    /* tp_doc */ 
     331    0,                          /* tp_traverse */ 
     332    0,                          /* tp_clear */ 
     333    0,                          /* tp_richcompare */ 
     334    0,                          /* tp_weaklistoffset */ 
     335    0,                          /* tp_iter */ 
     336    0,                          /* tp_iternext */ 
     337    Migemo_methods,             /* tp_methods */ 
     338    Migemo_members,             /* tp_members */ 
     339    0,                          /* tp_getset */ 
     340    0,                          /* tp_base */ 
     341    0,                          /* tp_dict */ 
     342    0,                          /* tp_descr_get */ 
     343    0,                          /* tp_descr_set */ 
     344    0,                          /* tp_dictoffset */ 
     345    (initproc)Migemo_init,      /* tp_init */ 
     346    0,                          /* tp_alloc */ 
     347    Migemo_new,                 /* tp_new */ 
    315348}; 
    316349 
    317350static PyMethodDef module_methods[] = { 
    318   {NULL} /* Sentinel */ 
     351    {NULL} /* Sentinel */ 
    319352}; 
    320353 
     
    325358initmigemo(void)  
    326359{ 
    327   PyObject* m; 
    328  
    329   if (PyType_Ready(&MigemoType) < 0) 
    330     return; 
    331  
    332   m = Py_InitModule3("migemo", module_methods, "C/Migemo wrapper"); 
    333  
    334   Py_INCREF(&MigemoType); 
    335   PyModule_AddObject(m, "Migemo", (PyObject *)&MigemoType); 
    336   PyModule_AddObject(m, "PYMIGEMO_VERSION", Py_BuildValue("s", PYMIGEMO_VERSION)); 
    337  
    338   PyModule_AddObject(m, "MIGEMO_VERSION", Py_BuildValue("s", MIGEMO_VERSION)); 
    339  
    340   PyModule_AddObject(m, "DICTID_INVALID", Py_BuildValue("i", MIGEMO_DICTID_INVALID)); 
    341   PyModule_AddObject(m, "DICTID_MIGEMO", Py_BuildValue("i", MIGEMO_DICTID_MIGEMO)); 
    342   PyModule_AddObject(m, "DICTID_ROMA2HIRA", Py_BuildValue("i", MIGEMO_DICTID_ROMA2HIRA)); 
    343   PyModule_AddObject(m, "DICTID_HIRA2KATA", Py_BuildValue("i", MIGEMO_DICTID_HIRA2KATA)); 
    344   PyModule_AddObject(m, "DICTID_HAN2ZEN", Py_BuildValue("i", MIGEMO_DICTID_HAN2ZEN)); 
    345   PyModule_AddObject(m, "DICTID_ZEN2HAN", Py_BuildValue("i", MIGEMO_DICTID_ZEN2HAN)); 
    346  
    347   PyModule_AddObject(m, "OPINDEX_OR", Py_BuildValue("i", MIGEMO_OPINDEX_OR)); 
    348   PyModule_AddObject(m, "OPINDEX_NEST_IN", Py_BuildValue("i", MIGEMO_OPINDEX_NEST_IN)); 
    349   PyModule_AddObject(m, "OPINDEX_NEST_OUT", Py_BuildValue("i", MIGEMO_OPINDEX_NEST_OUT)); 
    350   PyModule_AddObject(m, "OPINDEX_SELECT_IN", Py_BuildValue("i", MIGEMO_OPINDEX_SELECT_IN)); 
    351   PyModule_AddObject(m, "OPINDEX_SELECT_OUT", Py_BuildValue("i", MIGEMO_OPINDEX_SELECT_OUT)); 
    352   PyModule_AddObject(m, "OPINDEX_NEWLINE", Py_BuildValue("i", MIGEMO_OPINDEX_NEWLINE)); 
    353 } 
     360    PyObject* m; 
     361 
     362    if (PyType_Ready(&MigemoType) < 0) 
     363        return; 
     364 
     365    m = Py_InitModule3("migemo", module_methods, "C/Migemo wrapper"); 
     366 
     367    Py_INCREF(&MigemoType); 
     368    PyModule_AddObject(m, "Migemo", (PyObject *)&MigemoType); 
     369    PyModule_AddObject(m, "PYMIGEMO_VERSION", Py_BuildValue("s", PYMIGEMO_VERSION)); 
     370 
     371    PyModule_AddObject(m, "MIGEMO_VERSION", Py_BuildValue("s", MIGEMO_VERSION)); 
     372 
     373    PyModule_AddObject(m, "DICTID_INVALID", Py_BuildValue("i", MIGEMO_DICTID_INVALID)); 
     374    PyModule_AddObject(m, "DICTID_MIGEMO", Py_BuildValue("i", MIGEMO_DICTID_MIGEMO)); 
     375    PyModule_AddObject(m, "DICTID_ROMA2HIRA", Py_BuildValue("i", MIGEMO_DICTID_ROMA2HIRA)); 
     376    PyModule_AddObject(m, "DICTID_HIRA2KATA", Py_BuildValue("i", MIGEMO_DICTID_HIRA2KATA)); 
     377    PyModule_AddObject(m, "DICTID_HAN2ZEN", Py_BuildValue("i", MIGEMO_DICTID_HAN2ZEN)); 
     378    PyModule_AddObject(m, "DICTID_ZEN2HAN", Py_BuildValue("i", MIGEMO_DICTID_ZEN2HAN)); 
     379 
     380    PyModule_AddObject(m, "OPINDEX_OR", Py_BuildValue("i", MIGEMO_OPINDEX_OR)); 
     381    PyModule_AddObject(m, "OPINDEX_NEST_IN", Py_BuildValue("i", MIGEMO_OPINDEX_NEST_IN)); 
     382    PyModule_AddObject(m, "OPINDEX_NEST_OUT", Py_BuildValue("i", MIGEMO_OPINDEX_NEST_OUT)); 
     383    PyModule_AddObject(m, "OPINDEX_SELECT_IN", Py_BuildValue("i", MIGEMO_OPINDEX_SELECT_IN)); 
     384    PyModule_AddObject(m, "OPINDEX_SELECT_OUT", Py_BuildValue("i", MIGEMO_OPINDEX_SELECT_OUT)); 
     385    PyModule_AddObject(m, "OPINDEX_NEWLINE", Py_BuildValue("i", MIGEMO_OPINDEX_NEWLINE)); 
     386} 
Note: See TracChangeset for help on using the changeset viewer.