From: Wouter Wijngaards Date: Thu, 18 Jun 2009 14:28:28 +0000 (+0000) Subject: python warning suppress. X-Git-Tag: release-1.3.1~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=790fe91662bcc02fda78a5fd654a39d7988b8ddc;p=thirdparty%2Funbound.git python warning suppress. git-svn-id: file:///svn/unbound/trunk@1672 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 4890a5275..7108b98c0 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -6,6 +6,7 @@ reply has an NS in the authority but no signatures. They are turned into minimal responses with only the (secure) answer. - autoconf 2.63 for configure. + - python warnings suppress. Keep python API away from header files. 17 June 2009: Wouter - CREDITS entry for cz.nic, sponsoring a 'summer of code' that was diff --git a/pythonmod/pythonmod.c b/pythonmod/pythonmod.c index fe19bfa25..33778a669 100644 --- a/pythonmod/pythonmod.c +++ b/pythonmod/pythonmod.c @@ -44,11 +44,54 @@ #endif #include "config.h" + +#undef _POSIX_C_SOURCE +#undef _XOPEN_SOURCE +#include + #include "pythonmod/pythonmod.h" #include "util/module.h" #include "util/config_file.h" #include "pythonmod_utils.h" -#include + +/** + * Global state for the module. + */ +struct pythonmod_env { + + /** Python script filename. */ + const char* fname; + + /** Python module. */ + PyObject* module; + + /** Module init function */ + PyObject* func_init; + /** Module deinit function */ + PyObject* func_deinit; + /** Module operate function */ + PyObject* func_operate; + /** Module super_inform function */ + PyObject* func_inform; + + /** Python dictionary. */ + PyObject* dict; + + /** Module data. */ + PyObject* data; + + /** Module qstate. */ + struct module_qstate* qstate; +}; + +/** + * Per query state for the iterator module. + */ +struct pythonmod_qstate { + + /** Module per query data. */ + PyObject* data; +}; /* Generated */ #ifndef S_SPLINT_S diff --git a/pythonmod/pythonmod.h b/pythonmod/pythonmod.h index 2d1f9740f..fef806713 100644 --- a/pythonmod/pythonmod.h +++ b/pythonmod/pythonmod.h @@ -41,51 +41,6 @@ #define PYTHONMOD_H #include "util/module.h" #include "services/outbound_list.h" -#include - -struct PyObject; -#if S_SPLINT_S -typedef struct PyObject PyObject; -#endif - -/** - * Global state for the module. - */ -struct pythonmod_env { - - /** Python script filename. */ - const char* fname; - - /** Python module. */ - PyObject* module; - - /** Module init function */ - PyObject* func_init; - /** Module deinit function */ - PyObject* func_deinit; - /** Module operate function */ - PyObject* func_operate; - /** Module super_inform function */ - PyObject* func_inform; - - /** Python dictionary. */ - PyObject* dict; - - /** Module data. */ - PyObject* data; - - /** Module qstate. */ - struct module_qstate* qstate; -}; - -/** - * Per query state for the iterator module. - */ -struct pythonmod_qstate { - - /** Module per query data. */ - PyObject* data; -}; /** * Get the module function block. diff --git a/pythonmod/pythonmod_utils.c b/pythonmod/pythonmod_utils.c index 93cbb6d58..ca383b699 100644 --- a/pythonmod/pythonmod_utils.c +++ b/pythonmod/pythonmod_utils.c @@ -47,6 +47,9 @@ #include "util/data/msgreply.h" #include "util/storage/slabhash.h" #include "util/regional.h" + +#undef _POSIX_C_SOURCE +#undef _XOPEN_SOURCE #include /** Store the reply_info and query_info pair in message cache (qstate->msg_cache) */