MCPcopy Create free account
hub / github.com/SamuraiT/mecab-python3 / SWIG_InitializeModule

Function SWIG_InitializeModule

src/MeCab/MeCab_wrap.cpp:9389–9529  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9387
9388
9389SWIGRUNTIME void
9390SWIG_InitializeModule(void *clientdata) {
9391 size_t i;
9392 swig_module_info *module_head, *iter;
9393 int init;
9394
9395 /* check to see if the circular list has been setup, if not, set it up */
9396 if (swig_module.next==0) {
9397 /* Initialize the swig_module */
9398 swig_module.type_initial = swig_type_initial;
9399 swig_module.cast_initial = swig_cast_initial;
9400 swig_module.next = &swig_module;
9401 init = 1;
9402 } else {
9403 init = 0;
9404 }
9405
9406 /* Try and load any already created modules */
9407 module_head = SWIG_GetModule(clientdata);
9408 if (!module_head) {
9409 /* This is the first module loaded for this interpreter */
9410 /* so set the swig module into the interpreter */
9411 SWIG_SetModule(clientdata, &swig_module);
9412 } else {
9413 /* the interpreter has loaded a SWIG module, but has it loaded this one? */
9414 iter=module_head;
9415 do {
9416 if (iter==&swig_module) {
9417 /* Our module is already in the list, so there's nothing more to do. */
9418 return;
9419 }
9420 iter=iter->next;
9421 } while (iter!= module_head);
9422
9423 /* otherwise we must add our module into the list */
9424 swig_module.next = module_head->next;
9425 module_head->next = &swig_module;
9426 }
9427
9428 /* When multiple interpreters are used, a module could have already been initialized in
9429 a different interpreter, but not yet have a pointer in this interpreter.
9430 In this case, we do not want to continue adding types... everything should be
9431 set up already */
9432 if (init == 0) return;
9433
9434 /* Now work on filling in swig_module.types */
9435#ifdef SWIGRUNTIME_DEBUG
9436 printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size);
9437#endif
9438 for (i = 0; i < swig_module.size; ++i) {
9439 swig_type_info *type = 0;
9440 swig_type_info *ret;
9441 swig_cast_info *cast;
9442
9443#ifdef SWIGRUNTIME_DEBUG
9444 printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
9445#endif
9446

Callers 1

MeCab_wrap.cppFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected