/**
* Set the component life cycle callbacks using a MACRO for improving the type safety.
*/
-#define CELIX_DMCOMPONENT_SETCALLBACKS(dmCmp, type, init, start, stop, deinit) \
+#define CELIX_DM_COMPONENT_SET_CALLBACKS(dmCmp, type, init, start, stop, deinit) \
do { \
- int (*tmp_init)(type) = (init); \
- int (*tmp_start)(type) = (start); \
- int (*tmp_stop)(type) = (stop); \
- int (*tmp_deinit)(type) = (deinit); \
- celix_dmComponent_setCallbacks((dmCmp), (celix_dm_cmp_lifecycle_fpt)tmp_init, (celix_dm_cmp_lifecycle_fpt)tmp_start, (celix_dm_cmp_lifecycle_fpt)tmp_stop, (celix_dm_cmp_lifecycle_fpt)tmp_deinit); \
+ int (*_tmp_init)(type*) = (init); \
+ int (*_tmp_start)(type*) = (start); \
+ int (*_tmp_stop)(type*) = (stop); \
+ int (*_tmp_deinit)(type*) = (deinit); \
+ celix_dmComponent_setCallbacks((dmCmp), (celix_dm_cmp_lifecycle_fpt)_tmp_init, (celix_dm_cmp_lifecycle_fpt)_tmp_start, (celix_dm_cmp_lifecycle_fpt)_tmp_stop, (celix_dm_cmp_lifecycle_fpt)_tmp_deinit); \
} while(0)
+
+ bool celix_dmComponent_isActive(celix_dm_component_t *component);
+
+ /**
+ * Returns the string value of a provided state
+ */
+ const char* celix_dmComponent_stateToString(celix_dm_component_state_t state);
+
+/**
+ * Deprecated, use CELIX_DM_COMPONENT_SET_CALLBACKS instead.
+ */
+
+#define CELIX_DMCOMPONENT_SETCALLBACKS(dmCmp, type, init, start, stop, deinit) \
+ CELIX_DM_COMPONENT_SET_CALLBACKS(dmCmp, type*, init, start, stop, deinit)
+
/**
* Create a DM Component info struct. Containing information about the component.
* Caller has ownership.