📄 node-new.c
字号:
#include <stdlib.h>#include <string.h>#include <glib.h>#include "bionet-util.h"bionet_node_t* bionet_node_new( char* hab_type, char* hab_id, char* node_id) { bionet_node_t* node; if (hab_type == NULL) { g_log(BIONET_LOG_DOMAIN, G_LOG_LEVEL_WARNING, "node-new(): NULL hab type passed in"); return NULL; } if (hab_id == NULL) { g_log(BIONET_LOG_DOMAIN, G_LOG_LEVEL_WARNING, "node-new(): NULL hab id passed in"); return NULL; } if (node_id == NULL) { g_log(BIONET_LOG_DOMAIN, G_LOG_LEVEL_WARNING, "node-new(): NULL node id passed in"); return NULL; } node = calloc(1, sizeof(bionet_node_t)); if (node == NULL) { g_log(BIONET_LOG_DOMAIN, G_LOG_LEVEL_ERROR, "out of memory!"); return NULL; } node->hab_id = strdup(hab_id); if (node->hab_id == NULL) { g_log(BIONET_LOG_DOMAIN, G_LOG_LEVEL_ERROR, "out of memory!"); return NULL; } node->hab_type = strdup(hab_type); if (node->hab_type == NULL) { g_log(BIONET_LOG_DOMAIN, G_LOG_LEVEL_ERROR, "out of memory!"); return NULL; } node->id = strdup(node_id); if (node->id == NULL) { g_log(BIONET_LOG_DOMAIN, G_LOG_LEVEL_ERROR, "out of memory!"); return NULL; } node->resources = NULL; return node;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -