123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- #define PY_SSIZE_T_CLEAN
- #include <Python.h>
- #include <structmember.h>
- #include <config.h>
- #include <exceptions/exceptions.h>
- #include <dns/buffer.h>
- #include <dns/exceptions.h>
- #include <dns/name.h>
- #include <dns/messagerenderer.h>
- #include <dns/python/libdns_python_common.h>
- static PyObject* po_IscException;
- #include <dns/python/messagerenderer_python.cc>
- #include <dns/python/name_python.cc>
- #include <dns/python/rrclass_python.cc>
- #include <dns/python/rrtype_python.cc>
- #include <dns/python/rrttl_python.cc>
- #include <dns/python/rdata_python.cc>
- #include <dns/python/rrset_python.cc>
- #include <dns/python/question_python.cc>
-
- #include <dns/python/message_python.cc>
- static PyModuleDef libdns_python = {
- { PyObject_HEAD_INIT(NULL) NULL, 0, NULL},
- "libdns_python",
- "Python bindings for the classes in the isc::dns namespace.\n\n"
- "These bindings match the original C++ API as closely as possible, "
- "but are not complete. Some classes are unnecessary (InputBuffer "
- "and OutputBuffer for instance), and others may be necessary, but "
- "were not up to now.",
- -1,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
- };
- PyMODINIT_FUNC
- PyInit_libdns_python(void) {
- PyObject *mod = PyModule_Create(&libdns_python);
- if (mod == NULL) {
- return (NULL);
- }
- po_IscException = PyErr_NewException("libdns_python.IscException", NULL, NULL);
- PyModule_AddObject(mod, "IscException", po_IscException);
-
- if (!initModulePart_Name(mod)) {
- return (NULL);
- }
- if (!initModulePart_MessageRenderer(mod)) {
- return (NULL);
- }
- if (!initModulePart_RRClass(mod)) {
- return (NULL);
- }
- if (!initModulePart_RRType(mod)) {
- return (NULL);
- }
- if (!initModulePart_RRTTL(mod)) {
- return (NULL);
- }
- if (!initModulePart_Rdata(mod)) {
- return (NULL);
- }
- if (!initModulePart_RRset(mod)) {
- return (NULL);
- }
- if (!initModulePart_Question(mod)) {
- return (NULL);
- }
- if (!initModulePart_Message(mod)) {
- return (NULL);
- }
- return (mod);
- }
|