BALTRAD PPC
pyppcoptions.h
Go to the documentation of this file.
1/* --------------------------------------------------------------------
2Copyright (C) 2011 Swedish Meteorological and Hydrological Institute, SMHI,
3
4This file is part of bRopo.
5
6bRopo is free software: you can redistribute it and/or modify
7it under the terms of the GNU Lesser General Public License as published by
8the Free Software Foundation, either version 3 of the License, or
9(at your option) any later version.
10
11bRopo is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU Lesser General Public License for more details.
15
16You should have received a copy of the GNU Lesser General Public License
17along with bRopo. If not, see <http://www.gnu.org/licenses/>.
18------------------------------------------------------------------------*/
25#ifndef PYPPCOPTIONS_H
26#define PYPPCOPTIONS_H
27#include "ppc_options.h"
28
32typedef struct {
33 PyObject_HEAD /*Always have to be on top*/
36
37#define PyPpcOptions_Type_NUM 0
39#define PyPpcOptions_GetNative_NUM 1
40#define PyPpcOptions_GetNative_RETURN PpcOptions_t*
41#define PyPpcOptions_GetNative_PROTO (PyPpcOptions*)
43#define PyPpcOptions_New_NUM 2
44#define PyPpcOptions_New_RETURN PyPpcOptions*
45#define PyPpcOptions_New_PROTO (PpcOptions_t*)
47#define PyPpcOptions_API_pointers 3
49#define PyPpcOptions_CAPSULE_NAME "_ppcoptions._C_API"
50
51#ifdef PYPPCOPTIONS_MODULE
53extern PyTypeObject PyPpcOptions_Type;
54
56#define PyPpcOptions_Check(op) ((op)->ob_type == &PyPpcOptions_Type)
57
60
63
64#else
66static void **PyPpcOptions_API;
67
72#define PyPpcOptions_GetNative \
73 (*(PyPpcOptions_GetNative_RETURN (*)PyPpcOptions_GetNative_PROTO) PyPpcOptions_API[PyPpcOptions_GetNative_NUM])
74
82#define PyPpcOptions_New \
83 (*(PyPpcOptions_New_RETURN (*)PyPpcOptions_New_PROTO) PyPpcOptions_API[PyPpcOptions_New_NUM])
84
88#define PyPpcOptions_Check(op) \
89 (Py_TYPE(op) == &PyPpcOptions_Type)
90
91#define PyPpcOptions_Type (*(PyTypeObject*)PyPpcOptions_API[PyPpcOptions_Type_NUM])
92
96#define import_ppcoptions() \
97 PyPpcOptions_API = (void **)PyCapsule_Import(PyPpcOptions_CAPSULE_NAME, 1);
98
99#endif
100
101#endif /* PYPPCOPTIONS_H */
Main routine for the ppc options loader This object does support #RAVE_OBJECT_CLONE.
#define PyPpcOptions_New_RETURN
return type for New
Definition pyppcoptions.h:44
#define PyPpcOptions_GetNative
Returns a pointer to the internal ppc options, remember to release the reference when done with the o...
Definition pyppcoptions.h:72
#define PyPpcOptions_GetNative_PROTO
arguments for GetNative
Definition pyppcoptions.h:41
#define PyPpcOptions_New_PROTO
arguments for New
Definition pyppcoptions.h:45
#define PyPpcOptions_New
Creates a new ppc options instance.
Definition pyppcoptions.h:82
#define PyPpcOptions_GetNative_RETURN
return type for GetNative
Definition pyppcoptions.h:40
The ppc objects class.
Definition pyppcoptions.h:32
PyObject_HEAD PpcOptions_t * options
the options
Definition pyppcoptions.h:34
The ppc class.
Definition ppc_options.c:39