afb-ditf: track daemon state
[src/app-framework-binder.git] / src / afb-ditf.h
index 7d56c60..a24eb0a 100644 (file)
  * limitations under the License.
  */
 
-#define _GNU_SOURCE
-#define NO_BINDING_VERBOSE_MACRO
+#pragma once
 
-#include <string.h>
-#include <dlfcn.h>
-#include <assert.h>
+struct afb_binding_interface_v1;
+struct afb_binding_data_v2;
 
-#include <afb/afb-binding.h>
-
-#include "afb-apis.h"
-#include "afb-svc.h"
-#include "afb-evt.h"
-#include "afb-common.h"
-#include "afb-context.h"
-#include "afb-api-so.h"
-#include "afb-xreq.h"
-#include "verbose.h"
-
-
-struct afb_binding_interface;
+enum afb_ditf_state
+{
+       Daemon_Pre_Init,
+       Daemon_Init,
+       Daemon_Run
+};
 
 struct afb_ditf
 {
-       struct afb_binding_interface interface;
-       const char *prefix;
+       int version;
+       enum afb_ditf_state state;
+       const char *api;
+       union {
+               struct afb_binding_interface_v1 *v1;
+               struct afb_binding_data_v2 *v2;
+       };
 };
 
-extern void afb_ditf_init(struct afb_ditf *ditf, const char *prefix);
-extern void afb_ditf_rename(struct afb_ditf *ditf, const char *prefix);
+extern void afb_ditf_init_v1(struct afb_ditf *ditf, const char *api, struct afb_binding_interface_v1 *itf);
+extern void afb_ditf_init_v2(struct afb_ditf *ditf, const char *api, struct afb_binding_data_v2 *data);
+extern void afb_ditf_rename(struct afb_ditf *ditf, const char *api);
+extern void afb_ditf_update_hook(struct afb_ditf *ditf);