tsigerror_python.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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_TSIGERROR_H
  15. #define __PYTHON_TSIGERROR_H 1
  16. #include <Python.h>
  17. namespace isc {
  18. namespace dns {
  19. class TSIGError;
  20. namespace python {
  21. // The s_* Class simply covers one instantiation of the object
  22. class s_TSIGError : public PyObject {
  23. public:
  24. s_TSIGError();
  25. const TSIGError* cppobj;
  26. };
  27. extern PyTypeObject tsigerror_type;
  28. bool initModulePart_TSIGError(PyObject* mod);
  29. /// This is A simple shortcut to create a python TSIGError object (in the
  30. /// form of a pointer to PyObject) with minimal exception safety.
  31. /// On success, it returns a valid pointer to PyObject with a reference
  32. /// counter of 1; if something goes wrong it throws an exception (it never
  33. /// returns a NULL pointer).
  34. /// This function is expected to be called with in a try block
  35. /// followed by necessary setup for python exception.
  36. PyObject* createTSIGErrorObject(const TSIGError& source);
  37. } // namespace python
  38. } // namespace dns
  39. } // namespace isc
  40. #endif // __PYTHON_TSIGERROR_H
  41. // Local Variables:
  42. // mode: c++
  43. // End: