#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
static int
{
int32_t val;
int r;
if (ev->
type != SOL_FLOW_SIMPLE_C_TYPE_EVENT_TYPE_PROCESS_PORT_IN)
return 0;
if (r < 0)
return r;
}
#define MYTYPE_OPTIONS_SUB_API 0x1234
};
};
static bool
{
uint16_t port_idx;
char buf[256];
printf("mytype tick... send packet. ctx=%p someint=%d, somebool=%d\n",
snprintf(buf, sizeof(buf), "%d/%s",
return true;
}
static int
{
case SOL_FLOW_SIMPLE_C_TYPE_EVENT_TYPE_OPEN: {
#endif
) {
}
return -ENOMEM;
printf("simple_c_type opened ctx=%p, someint=%d, somebool=%d\n",
return 0;
}
case SOL_FLOW_SIMPLE_C_TYPE_EVENT_TYPE_CLOSE: {
printf("simple_c_type closed ctx=%p\n", ctx);
return 0;
}
case SOL_FLOW_SIMPLE_C_TYPE_EVENT_TYPE_PROCESS_PORT_IN: {
int32_t val;
printf("simple_c_type updated integer from %d to %d\n",
return 0;
}
}
else if (strcmp(ev->
port_name,
"BOOLEAN") == 0) {
bool val;
printf("simple_c_type updated boolean from %d to %d\n",
return 0;
}
}
printf(
"simple_c_type port '%s' got unexpected data!\n", ev->
port_name);
return -EINVAL;
}
case SOL_FLOW_SIMPLE_C_TYPE_EVENT_TYPE_CONNECT_PORT_IN:
printf("simple_c_type port IN '%s' id=%d conn=%d connected ctx=%p\n",
return 0;
case SOL_FLOW_SIMPLE_C_TYPE_EVENT_TYPE_DISCONNECT_PORT_IN:
printf("simple_c_type port IN '%s' id=%d conn=%d disconnected ctx=%p\n",
return 0;
case SOL_FLOW_SIMPLE_C_TYPE_EVENT_TYPE_CONNECT_PORT_OUT:
printf("simple_c_type port OUT '%s' id=%d conn=%d connected ctx=%p\n",
return 0;
case SOL_FLOW_SIMPLE_C_TYPE_EVENT_TYPE_DISCONNECT_PORT_OUT:
printf("simple_c_type port OUT '%s' id=%d conn=%d disconnected ctx=%p\n",
return 0;
}
return -EINVAL;
}
static void
{
#ifndef SOL_NO_API_VERSION
#endif
},
.someint = 12,
.somebool = true,
};
NULL);
NULL);
"timer", NULL);
"boolean/toggle", NULL);
"int/accumulator", NULL);
"console", NULL);
"console", NULL);
"console", NULL);
"booltoggle", "IN", -1);
"intacc", "INC", -1);
"isodd", "IN", -1);
"console_isodd", "IN", -1);
"mystuff", "BOOLEAN", -1);
"mystuff", "IRANGE", -1);
"console_mystuff", "IN", -1);
"debug", "IN", -1);
"debug", "IN", -1);
}
static void
{
}