⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hab-new.c

📁 MANTIS是由科罗拉多大学开发的传感器网络嵌入式操作系统。 这是mantis的0.9.5版本的源码。
💻 C
字号:
#include <stdlib.h>#include <string.h>#include <glib.h>#include "bionet-util.h"bionet_hab_t* bionet_hab_new(	char* hab_type,	char* hab_id) {    bionet_hab_t* hab;    if (hab_type == NULL)    {	g_log(BIONET_LOG_DOMAIN, G_LOG_LEVEL_WARNING, "hab-new(): NULL hab type passed in");	return NULL;    }    if (hab_id == NULL)    {	g_log(BIONET_LOG_DOMAIN, G_LOG_LEVEL_WARNING, "hab-new(): NULL hab id passed in");	return NULL;    }    hab = calloc(1, sizeof(bionet_hab_t));    if (hab == NULL)    {	g_log(BIONET_LOG_DOMAIN, G_LOG_LEVEL_ERROR, "out of memory!");	return NULL;    }    hab->id = strdup(hab_id);    if (hab->id == NULL)    {	g_log(BIONET_LOG_DOMAIN, G_LOG_LEVEL_ERROR, "out of memory!");	return NULL;    }    hab->type = strdup(hab_type);    if (hab->type == NULL)    {	g_log(BIONET_LOG_DOMAIN, G_LOG_LEVEL_ERROR, "out of memory!");	return NULL;    }    hab->nodes = NULL;    return hab;}

⌨️ 快捷键说明

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