struct json_object *root = NULL;
struct json_object *d_perms = NULL;
struct json_object *a_perms = NULL;
+const char *preinit = NULL;
const char *init = NULL;
-const char *start = NULL;
const char *onevent = NULL;
const char *api = NULL;
const char *scope = NULL;
const char *prefix = NULL;
const char *postfix = NULL;
int priv = -1;
+int noconc = -1;
/**
* Search for a reference of type "#/a/b/c" int the
s = p ? get_session(p) : 0;
c = 1;
if (s & SESSION_CHECK) {
- printf("%s", "|AFB_SESSION_CHECK" + c);
+ printf("%s", "|AFB_SESSION_CHECK_V2" + c);
c = 0;
}
if (s & SESSION_LOA_3 & ~SESSION_LOA_2)
else
l = 0;
if (l) {
- printf("%s%d", "|AFB_SESSION_LOA_GE_" + c, l);
+ printf("%s%d_V2", "|AFB_SESSION_LOA_" + c, l);
c = 0;
}
if (s & SESSION_CLOSE) {
- printf("%s", "|AFB_SESSION_CLOSE" + c);
+ printf("%s", "|AFB_SESSION_CLOSE_V2" + c);
c = 0;
}
if (s & SESSION_RENEW) {
- printf("%s", "|AFB_SESSION_RENEW" + c);
+ printf("%s", "|AFB_SESSION_REFRESH_V2" + c);
c = 0;
}
if (c)
- printf("AFB_SESSION_NONE");
+ printf("AFB_SESSION_NONE_V2");
}
void print_verb(const char *name)
/* get some names */
getvar(&api, "#/info/x-binding-c-generator/api", NULL);
+ getvar(&preinit, "#/info/x-binding-c-generator/preinit", NULL);
getvar(&init, "#/info/x-binding-c-generator/init", NULL);
- getvar(&start, "#/info/x-binding-c-generator/start", NULL);
getvar(&onevent, "#/info/x-binding-c-generator/onevent", NULL);
getvar(&scope, "#/info/x-binding-c-generator/scope", "static");
getvar(&prefix, "#/info/x-binding-c-generator/prefix", "afb_verb_");
getvar(&postfix, "#/info/x-binding-c-generator/postfix", "_cb");
getvarbool(&priv, "#/info/x-binding-c-generator/private", 0);
+ getvarbool(&noconc, "#/info/x-binding-c-generator/noconcurrency", 0);
getvar(&api, "#/info/title", "?");
/* get the API name */
" .api = \"%s\",\n"
" .specification = _afb_description_v2_%s,\n"
" .verbs = _afb_verbs_v2_%s,\n"
+ " .preinit = %s,\n"
" .init = %s,\n"
- " .start = %s,\n"
" .onevent = %s,\n"
+ " .noconcurrency = %d\n"
"};\n"
"\n"
, priv ? "static " : ""
, api
, api
, api
+ , preinit ?: "NULL"
, init ?: "NULL"
- , start ?: "NULL"
, onevent ?: "NULL"
+ , !!noconc
);
/* clean up */