|
@@ -35,6 +35,7 @@
|
|
|
* Description: provides blocking operations. Initially the blocking state is down (but this statement
|
|
* Description: provides blocking operations. Initially the blocking state is down (but this statement
|
|
|
* does not block). On deinitialization, waits for all corresponding use() statements
|
|
* does not block). On deinitialization, waits for all corresponding use() statements
|
|
|
* to die before dying itself.
|
|
* to die before dying itself.
|
|
|
|
|
+ * Variables: string (empty) - the up-state (false or true).
|
|
|
*
|
|
*
|
|
|
* Synopsis: blocker::up()
|
|
* Synopsis: blocker::up()
|
|
|
* Description: sets the blocking state to up.
|
|
* Description: sets the blocking state to up.
|
|
@@ -163,6 +164,18 @@ static void func_die (void *vo)
|
|
|
o->dying = 1;
|
|
o->dying = 1;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+static int func_getvar2 (void *vo, NCD_string_id_t name, NCDValMem *mem, NCDValRef *out)
|
|
|
|
|
+{
|
|
|
|
|
+ struct instance *o = vo;
|
|
|
|
|
+
|
|
|
|
|
+ if (name == NCD_STRING_EMPTY) {
|
|
|
|
|
+ *out = ncd_make_boolean(mem, o->up, o->i->params->iparams->string_index);
|
|
|
|
|
+ return 1;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return 0;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
static void updown_func_new_templ (NCDModuleInst *i, const struct NCDModuleInst_new_params *params, int up, int first_down)
|
|
static void updown_func_new_templ (NCDModuleInst *i, const struct NCDModuleInst_new_params *params, int up, int first_down)
|
|
|
{
|
|
{
|
|
|
ASSERT(!first_down || up)
|
|
ASSERT(!first_down || up)
|
|
@@ -322,6 +335,7 @@ static struct NCDModule modules[] = {
|
|
|
.type = "blocker",
|
|
.type = "blocker",
|
|
|
.func_new2 = func_new,
|
|
.func_new2 = func_new,
|
|
|
.func_die = func_die,
|
|
.func_die = func_die,
|
|
|
|
|
+ .func_getvar2 = func_getvar2,
|
|
|
.alloc_size = sizeof(struct instance)
|
|
.alloc_size = sizeof(struct instance)
|
|
|
}, {
|
|
}, {
|
|
|
.type = "blocker::up",
|
|
.type = "blocker::up",
|