aboutsummaryrefslogtreecommitdiffstats
path: root/misc/python
diff options
context:
space:
mode:
Diffstat (limited to 'misc/python')
-rw-r--r--misc/python/src/base.cpp31
-rw-r--r--misc/python/src/core.cpp28
2 files changed, 24 insertions, 35 deletions
diff --git a/misc/python/src/base.cpp b/misc/python/src/base.cpp
deleted file mode 100644
index 33457fe61..000000000
--- a/misc/python/src/base.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-/*************************************************
-* Wrappers for basic Botan types *
-* (C) 2005-2006 Jack Lloyd <[email protected]> *
-*************************************************/
-
-#include <boost/python.hpp>
-using namespace boost::python;
-
-#include <botan/init.h>
-#include <botan/symkey.h>
-using namespace Botan;
-
-void export_basic_types()
- {
- class_<LibraryInitializer>("LibraryInitializer")
- .def(init< optional<std::string> >());
-
- class_<OctetString>("OctetString")
- .def(init< optional<std::string> >())
- .def("as_string", &OctetString::as_string)
- .def("length", &OctetString::length)
- .def(self ^= self);
-
- class_<SymmetricKey, bases<OctetString> >("SymmetricKey")
- .def(init< optional<std::string> >())
- .def(init< u32bit >());
-
- class_<InitializationVector, bases<OctetString> >("InitializationVector")
- .def(init< optional<std::string> >())
- .def(init< u32bit >());
- }
diff --git a/misc/python/src/core.cpp b/misc/python/src/core.cpp
index 6c8f61c1c..acb46c82e 100644
--- a/misc/python/src/core.cpp
+++ b/misc/python/src/core.cpp
@@ -1,19 +1,39 @@
/*************************************************
* Boost.Python module definition *
-* (C) 2005-2006 Jack Lloyd <[email protected]> *
+* (C) 1999-2006 The Botan Project *
*************************************************/
+#include <botan/init.h>
+#include <botan/symkey.h>
+using namespace Botan;
+
#include <boost/python.hpp>
-using namespace boost::python;
+namespace python = boost::python;
-extern void export_basic_types();
extern void export_filters();
extern void export_pipe();
extern void export_x509();
BOOST_PYTHON_MODULE(_botan)
{
- export_basic_types();
+ python::class_<LibraryInitializer>("LibraryInitializer")
+ .def(python::init< python::optional<std::string> >());
+
+ python::class_<OctetString>("OctetString")
+ .def(python::init< python::optional<std::string> >())
+ .def("as_string", &OctetString::as_string)
+ .def("length", &OctetString::length)
+ .def(python::self ^= python::self);
+
+ python::class_<SymmetricKey, python::bases<OctetString> >("SymmetricKey")
+ .def(python::init< python::optional<std::string> >())
+ .def(python::init< u32bit >());
+
+ python::class_<InitializationVector, python::bases<OctetString> >
+ ("InitializationVector")
+ .def(python::init< python::optional<std::string> >())
+ .def(python::init< u32bit >());
+
export_filters();
export_pipe();
export_x509();