messagerenderer_python.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
  2. //
  3. // Permission to use, copy, modify, and/or distribute this software for any
  4. // purpose with or without fee is hereby granted, provided that the above
  5. // copyright notice and this permission notice appear in all copies.
  6. //
  7. // THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  8. // REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  9. // AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  10. // INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  11. // LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  12. // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  13. // PERFORMANCE OF THIS SOFTWARE.
  14. #ifndef __PYTHON_MESSAGERENDERER_H
  15. #define __PYTHON_MESSAGERENDERER_H 1
  16. #include <Python.h>
  17. #include <dns/messagerenderer.h>
  18. #include <util/buffer.h>
  19. namespace isc {
  20. namespace dns {
  21. namespace python {
  22. // The s_* Class simply covers one instantiation of the object.
  23. //
  24. // since we don't use *Buffer in the python version (but work with
  25. // the already existing bytearray type where we use these custom buffers
  26. // in C++, we need to keep track of one here.
  27. class s_MessageRenderer : public PyObject {
  28. public:
  29. s_MessageRenderer();
  30. isc::util::OutputBuffer* outputbuffer;
  31. MessageRenderer* messagerenderer;
  32. };
  33. extern PyTypeObject messagerenderer_type;
  34. bool initModulePart_MessageRenderer(PyObject* mod);
  35. } // namespace python
  36. } // namespace dns
  37. } // namespace isc
  38. #endif // __PYTHON_MESSAGERENDERER_H
  39. // Local Variables:
  40. // mode: c++
  41. // End: