source: sasview/src/sas/sascalc/simulation/geoshapespy/geoshapespymodule/geoshapespymodule.cc @ 158a0c7

Last change on this file since 158a0c7 was d85c194, checked in by Piotr Rozyczko <piotr.rozyczko@…>, 9 years ago

Remaining modules refactored

  • Property mode set to 100644
File size: 937 bytes
RevLine 
[aa639ea]1// -*- C++ -*-
2
3#include <Python.h>
4
5
6#include "exceptions.h"
7#include "bindings.h"
8#include "myutil.h"
9
10
11char pygeoshapespy_module__doc__[] = "";
12
13// Initialization function for the module (*must* be called initgeoshapespy)
14extern "C"
15void
16initgeoshapespy()
17{
18    // create the module and add the functions
19    PyObject * m = Py_InitModule4(
20        "geoshapespy", pygeoshapespy_methods,
21        pygeoshapespy_module__doc__, 0, PYTHON_API_VERSION);
22
23    // get its dictionary
24    PyObject * d = PyModule_GetDict(m);
25
26    // check for errors
27    if (PyErr_Occurred()) {
28        Py_FatalError("can't initialize module geoshapespy");
29    }
30
31    // install the module exceptions
32    pygeoshapespy_runtimeError = PyErr_NewException("geoshapespy.runtime", 0, 0);
33    PyDict_SetItemString(d, "RuntimeException", pygeoshapespy_runtimeError);
34
35        // Seed the random number generator
36        seed_rnd();
37
38    return;
39}
40
41// version
42// $Id$
43
44// End of file
Note: See TracBrowser for help on using the repository browser.