GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — python/src/module.cpp at 89100353dbcd9c5f6171d66931161a07becec597 · ssam18/python Expand file tree/ Copy pathmodule.cppMore file actions 67 lines (56 loc) · 1.64 KB / Copy pathmodule.cppFile metadata and controls67 lines (56 loc) · 1.64 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 // (C) Copyright David Abrahams 2000. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // The author gratefully acknowleges the support of Dragon Systems, Inc., in // producing this work. #include <boost/python/scope.hpp> #include <boost/python/object/add_to_namespace.hpp> namespace boost { namespace python { namespace detail { BOOST_PYTHON_DECL void scope_setattr_doc(char const* name, object const& x, char const* doc) { // Use function::add_to_namespace to achieve overloading if // appropriate. scope current; objects::add_to_namespace(current, name, x, doc); } namespace { PyMethodDef initial_methods[] = { { 0, 0, 0, 0 } }; } BOOST_PYTHON_DECL PyObject* init_module(char const* name, void(*init_function)()) { #if PY_VERSION_HEX >= 0x03000000 static struct PyModuleDef moduledef = { PyModuleDef_HEAD_INIT, name, 0, /* m_doc */ -1, /* m_size */ initial_methods, 0, /* m_reload */ 0, /* m_traverse */ 0, /* m_clear */ 0, /* m_free */ }; PyObject* m = PyModule_Create(&moduledef); #else PyObject* m = Py_InitModule(const_cast<char*>(name), initial_methods); #endif if (m != 0) { // Create the current module scope object m_obj(((borrowed_reference_t*)m)); scope current_module(m_obj); handle_exception(init_function); } return m; } }}} // namespace boost::python::detail namespace boost { namespace python { namespace detail { BOOST_PYTHON_DECL PyObject* current_scope = 0; } }} |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |