Libmacro  0.2
Libmacro is an extensible macro and hotkey library.
isignal.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 
25 #ifndef MCR_BASE_ISIGNAL_H_
26 #define MCR_BASE_ISIGNAL_H_
27 
28 #include "mcr/base/interface.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
39 typedef int (*mcr_signal_fnc)(struct mcr_Signal *signalPt);
40 
46 struct mcr_ISignal {
49  /* Signal interface */
55 };
56 
61 MCR_API void mcr_ISignal_init(struct mcr_ISignal *isigPt);
76 MCR_API void mcr_ISignal_ctor(struct mcr_ISignal *isigPt,
77  struct mcr_context *context, size_t dataSize, void *(*allocate)(),
78  void (*deallocate)(void *), mcr_data_fnc init, mcr_data_fnc deinit,
79  mcr_compare_fnc compare, mcr_copy_fnc copy, struct mcr_IDispatcher *dispPt,
80  mcr_signal_fnc sender);
86 MCR_API void mcr_ISignal_deinit(struct mcr_ISignal *isigPt);
87 
89 MCR_API struct mcr_IRegistry *mcr_ISignal_registry(struct mcr_context *ctx);
95 MCR_API size_t mcr_ISignal_id(const struct mcr_ISignal
96  *isigPt);
102 MCR_API struct mcr_ISignal *mcr_ISignal_from_id(struct mcr_context *ctx,
103  size_t id);
109 MCR_API const char *mcr_ISignal_name(struct mcr_context *ctx,
110  struct mcr_ISignal *isigPt);
116 MCR_API struct mcr_ISignal *mcr_ISignal_from_name(struct mcr_context *ctx,
117  const char *name);
118 
119 #ifdef __cplusplus
120 }
121 #endif
122 
123 #endif
struct mcr_Interface interface
Definition: isignal.h:48
int(* mcr_compare_fnc)(const void *lhsPt, const void *rhsPt)
Definition: comparison.h:53
MCR_API struct mcr_IRegistry * mcr_ISignal_registry(struct mcr_context *ctx)
MCR_API void mcr_ISignal_ctor(struct mcr_ISignal *isigPt, struct mcr_context *context, size_t dataSize, void *(*allocate)(), void(*deallocate)(void *), mcr_data_fnc init, mcr_data_fnc deinit, mcr_compare_fnc compare, mcr_copy_fnc copy, struct mcr_IDispatcher *dispPt, mcr_signal_fnc sender)
MCR_API struct mcr_ISignal * mcr_ISignal_from_name(struct mcr_context *ctx, const char *name)
int(* mcr_data_fnc)(void *dataPt)
Definition: comparison.h:39
int(* mcr_signal_fnc)(struct mcr_Signal *signalPt)
Definition: isignal.h:39
mcr_Interface
MCR_API struct mcr_ISignal * mcr_ISignal_from_id(struct mcr_context *ctx, size_t id)
int(* mcr_copy_fnc)(void *destinationPt, const void *sourcePt)
Definition: comparison.h:46
mcr_signal_fnc send
Definition: isignal.h:54
void(* deinit)(struct mcr_IDispatcher *)
Definition: idispatcher.h:96
MCR_API size_t mcr_ISignal_id(const struct mcr_ISignal *isigPt)
MCR_API void mcr_ISignal_deinit(struct mcr_ISignal *isigPt)
MCR_API void mcr_ISignal_init(struct mcr_ISignal *isigPt)
struct mcr_IDispatcher * dispatcher_pt
Definition: isignal.h:52
MCR_API const char * mcr_ISignal_name(struct mcr_context *ctx, struct mcr_ISignal *isigPt)