resource-matches.c

来自「MANTIS是由科罗拉多大学开发的传感器网络嵌入式操作系统。 这是mantis」· C语言 代码 · 共 47 行

C
47
字号
#include <string.h>#include "bionet-util.h"int bionet_resource_matches_id(const bionet_resource_t *resource, const char *id) {    if ((strcmp(id, "*") == 0) || (strcmp(id, resource->id) == 0)) {        return 1;    }     return 0;}int bionet_resource_matches_habtype_habid_nodeid_resourceid(    const bionet_resource_t *resource,    const char *hab_type,    const char *hab_id,    const char *node_id,    const char *resource_id) {    if (        (            (strcmp(hab_type, "*") == 0) ||            (strcmp(hab_type, resource->hab_type) == 0)         ) &&        (            (strcmp(hab_id, "*") == 0) ||            (strcmp(hab_id, resource->hab_id) == 0)         ) &&        (            (strcmp(node_id, "*") == 0) ||            (strcmp(node_id, resource->node_id) == 0)        ) &&        (            (strcmp(resource_id, "*") == 0) ||            (strcmp(resource_id, resource->id) == 0)        )    ) {        return 1;    }     return 0;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?