Libmacro  0.2
Libmacro is an extensible macro and hotkey library.
signal.h
Go to the documentation of this file.
1 /* Libmacro - A multi-platform, extendable macro and hotkey C library
2  Copyright (C) 2013 Jonathan Pelletier, New Paradigm Software
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public
15  License along with this library; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
26 #ifndef MCR_BASE_SIGNAL_H_
27 #define MCR_BASE_SIGNAL_H_
28 
29 #include "mcr/base/instance.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
38 struct mcr_Signal {
40  union {
41  struct mcr_ISignal *isignal;
42  struct mcr_Instance instance;
43  struct mcr_Interface *interface;
44  };
45  /* Signal specific */
48 };
49 
54 MCR_API void mcr_Signal_init(struct mcr_Signal *signalPt);
59 MCR_API void mcr_Signal_deinit(struct mcr_Signal *signalPt);
60 
67 MCR_API int mcr_Signal_copy(struct mcr_Signal *dstPt,
68  const struct mcr_Signal *srcPt);
75 MCR_API int mcr_Signal_compare(const struct mcr_Signal *lhsSignalPt,
76  const struct mcr_Signal *rhsSignalPt);
77 
79 static MCR_INLINE void *mcr_Signal_data(struct mcr_Signal *signalPt)
80 {
81  return signalPt ? signalPt->instance.data_member.data : NULL;
82 }
83 
84 #ifdef __cplusplus
85 }
86 #endif
87 
88 #endif
MCR_API int mcr_Signal_copy(struct mcr_Signal *dstPt, const struct mcr_Signal *srcPt)
MCR_API void mcr_Signal_init(struct mcr_Signal *signalPt)
MCR_API void mcr_Signal_deinit(struct mcr_Signal *signalPt)
mcr_Instance Example and abstraction of an interface instance.
bool dispatch_flag
Definition: signal.h:47
struct mcr_DataMember data_member
Definition: instance.h:41
MCR_API int mcr_Signal_compare(const struct mcr_Signal *lhsSignalPt, const struct mcr_Signal *rhsSignalPt)