57 |
* A variable that receives the service pointer. Will be NULL |
* A variable that receives the service pointer. Will be NULL |
58 |
* if not found. |
* if not found. |
59 |
*/ |
*/ |
60 |
|
#ifdef __cplusplus |
61 |
|
|
62 |
#define FT_FACE_FIND_SERVICE( face, ptr, id ) \ |
#define FT_FACE_FIND_SERVICE( face, ptr, id ) \ |
63 |
FT_BEGIN_STMNT \ |
FT_BEGIN_STMNT \ |
64 |
FT_Module module = FT_MODULE( FT_FACE(face)->driver ); \ |
FT_Module module = FT_MODULE( FT_FACE(face)->driver ); \ |
65 |
/* the strange cast is to allow C++ compilation */ \ |
FT_Pointer _tmp_ = NULL; \ |
66 |
FT_Pointer* Pptr = (FT_Pointer*) &(ptr); \ |
FT_Pointer* _pptr_ = (FT_Pointer*)&(ptr); \ |
67 |
\ |
\ |
68 |
|
if ( module->clazz->get_interface ) \ |
69 |
|
_tmp_ = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \ |
70 |
|
*_pptr_ = _tmp_; \ |
71 |
|
FT_END_STMNT |
72 |
|
|
73 |
|
#else /* !C++ */ |
74 |
|
|
75 |
|
#define FT_FACE_FIND_SERVICE( face, ptr, id ) \ |
76 |
|
FT_BEGIN_STMNT \ |
77 |
|
FT_Module module = FT_MODULE( FT_FACE(face)->driver ); \ |
78 |
|
FT_Pointer _tmp_ = NULL; \ |
79 |
\ |
\ |
|
*Pptr = NULL; \ |
|
80 |
if ( module->clazz->get_interface ) \ |
if ( module->clazz->get_interface ) \ |
81 |
*Pptr = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \ |
_tmp_ = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \ |
82 |
|
ptr = _tmp_; \ |
83 |
FT_END_STMNT |
FT_END_STMNT |
84 |
|
|
85 |
|
#endif /* !C++ */ |
86 |
|
|
87 |
/* |
/* |
88 |
* @macro: |
* @macro: |
106 |
* A variable that receives the service pointer. Will be NULL |
* A variable that receives the service pointer. Will be NULL |
107 |
* if not found. |
* if not found. |
108 |
*/ |
*/ |
109 |
|
#ifdef __cplusplus |
110 |
|
|
111 |
#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \ |
#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \ |
112 |
FT_BEGIN_STMNT \ |
FT_BEGIN_STMNT \ |
113 |
FT_Module module = FT_MODULE( FT_FACE(face)->driver ); \ |
FT_Module module = FT_MODULE( FT_FACE(face)->driver ); \ |
114 |
/* the strange cast is to allow C++ compilation */ \ |
FT_Pointer _tmp_; \ |
115 |
FT_Pointer* Pptr = (FT_Pointer*) &(ptr); \ |
FT_Pointer _pptr_ = (FT_Pointer*)&(ptr); \ |
116 |
\ |
\ |
117 |
|
_tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \ |
118 |
|
*_pptr_ = _tmp_; \ |
119 |
|
FT_END_STMNT |
120 |
|
|
121 |
|
#else /* !C++ */ |
122 |
|
|
123 |
|
#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id ) \ |
124 |
|
FT_BEGIN_STMNT \ |
125 |
|
FT_Module module = FT_MODULE( FT_FACE(face)->driver ); \ |
126 |
|
FT_Pointer _tmp_; \ |
127 |
\ |
\ |
128 |
*Pptr = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \ |
_tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \ |
129 |
|
ptr = _tmp_; \ |
130 |
FT_END_STMNT |
FT_END_STMNT |
131 |
|
|
132 |
|
#endif /* !C++ */ |
133 |
|
|
134 |
/*************************************************************************/ |
/*************************************************************************/ |
135 |
/*************************************************************************/ |
/*************************************************************************/ |
227 |
* ptr :: |
* ptr :: |
228 |
* A variable receiving the service data. NULL if not available. |
* A variable receiving the service data. NULL if not available. |
229 |
*/ |
*/ |
230 |
|
#ifdef __cplusplus |
231 |
|
|
232 |
|
#define FT_FACE_LOOKUP_SERVICE( face, ptr, id ) \ |
233 |
|
FT_BEGIN_STMNT \ |
234 |
|
FT_Pointer svc; \ |
235 |
|
FT_Pointer* Pptr = (FT_Pointer*)&(ptr); \ |
236 |
|
\ |
237 |
|
\ |
238 |
|
svc = FT_FACE(face)->internal->services. service_ ## id; \ |
239 |
|
if ( svc == FT_SERVICE_UNAVAILABLE ) \ |
240 |
|
svc = NULL; \ |
241 |
|
else if ( svc == NULL ) \ |
242 |
|
{ \ |
243 |
|
FT_FACE_FIND_SERVICE( face, svc, id ); \ |
244 |
|
\ |
245 |
|
FT_FACE(face)->internal->services. service_ ## id = \ |
246 |
|
(FT_Pointer)( svc != NULL ? svc \ |
247 |
|
: FT_SERVICE_UNAVAILABLE ); \ |
248 |
|
} \ |
249 |
|
*Pptr = svc; \ |
250 |
|
FT_END_STMNT |
251 |
|
|
252 |
|
#else /* !C++ */ |
253 |
|
|
254 |
#define FT_FACE_LOOKUP_SERVICE( face, ptr, id ) \ |
#define FT_FACE_LOOKUP_SERVICE( face, ptr, id ) \ |
255 |
FT_BEGIN_STMNT \ |
FT_BEGIN_STMNT \ |
|
/* the strange cast is to allow C++ compilation */ \ |
|
|
FT_Pointer* pptr = (FT_Pointer*)&(ptr); \ |
|
256 |
FT_Pointer svc; \ |
FT_Pointer svc; \ |
257 |
\ |
\ |
258 |
\ |
\ |
267 |
(FT_Pointer)( svc != NULL ? svc \ |
(FT_Pointer)( svc != NULL ? svc \ |
268 |
: FT_SERVICE_UNAVAILABLE ); \ |
: FT_SERVICE_UNAVAILABLE ); \ |
269 |
} \ |
} \ |
270 |
*pptr = svc; \ |
ptr = svc; \ |
271 |
FT_END_STMNT |
FT_END_STMNT |
272 |
|
|
273 |
|
#endif /* !C++ */ |
274 |
|
|
275 |
/* |
/* |
276 |
* A macro used to define new service structure types. |
* A macro used to define new service structure types. |