mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
fixup switch case
This commit is contained in:
parent
abdec22993
commit
e82b8bedf2
2 changed files with 28 additions and 8 deletions
|
@ -37,11 +37,24 @@ static int api_capabilities(struct api_action *h, json_t *args, json_t **resp, s
|
|||
json_name = json_string(p->name);
|
||||
|
||||
switch (p->type) {
|
||||
case PLUGIN_TYPE_NODE: json_array_append_new(json_nodes, json_name); break;
|
||||
case PLUGIN_TYPE_HOOK: json_array_append_new(json_hooks, json_name); break;
|
||||
case PLUGIN_TYPE_API: json_array_append_new(json_apis, json_name); break;
|
||||
case PLUGIN_TYPE_FORMAT: json_array_append_new(json_ios, json_name); break;
|
||||
default: json_decref(json_name);
|
||||
case PLUGIN_TYPE_NODE:
|
||||
json_array_append_new(json_nodes, json_name);
|
||||
break;
|
||||
|
||||
case PLUGIN_TYPE_HOOK:
|
||||
json_array_append_new(json_hooks, json_name);
|
||||
break;
|
||||
|
||||
case PLUGIN_TYPE_API:
|
||||
json_array_append_new(json_apis, json_name);
|
||||
break;
|
||||
|
||||
case PLUGIN_TYPE_FORMAT:
|
||||
json_array_append_new(json_ios, json_name);
|
||||
break;
|
||||
|
||||
default:
|
||||
json_decref(json_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -144,9 +144,16 @@ char * api_session_name(struct api_session *s)
|
|||
char *mode;
|
||||
|
||||
switch (s->mode) {
|
||||
case API_MODE_WS: mode = "ws"; break;
|
||||
case API_MODE_HTTP: mode = "http"; break;
|
||||
default: mode = "unknown"; break;
|
||||
case API_MODE_WS:
|
||||
mode = "ws";
|
||||
break;
|
||||
|
||||
case API_MODE_HTTP:
|
||||
mode = "http";
|
||||
break;
|
||||
|
||||
default:
|
||||
mode = "unknown";
|
||||
}
|
||||
|
||||
strcatf(&s->_name, "version=%d, mode=%s", s->version, mode);
|
||||
|
|
Loading…
Add table
Reference in a new issue