+void afb_context_init(struct afb_context *context, struct afb_session *session, struct afb_token *token, struct afb_cred *cred)
+{
+ init_context(context, afb_session_addref(session), token, cred);
+}
+
+void afb_context_init_validated(struct afb_context *context, struct afb_session *session, struct afb_token *token, struct afb_cred *cred)
+{
+ afb_context_init(context, session, token, cred);
+ context->validated = 1;
+}
+
+void afb_context_subinit(struct afb_context *context, struct afb_context *super)
+{
+ context->session = afb_session_addref(super->session);
+ context->flags = 0;
+ context->super = super;
+ context->api_key = NULL;
+ context->token = afb_token_addref(super->token);
+ context->credentials = afb_cred_addref(super->credentials);
+}
+
+int afb_context_connect(struct afb_context *context, const char *uuid, struct afb_token *token, struct afb_cred *cred)