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

📄 cleanup.h

📁 Firestorm NIDS是一个性能非常高的网络入侵检测系统 (NIDS)。目前
💻 H
字号:
#ifndef __CLEANUP_HEADER_INCLUDED__#define __CLEANUP_HEADER_INCLUDED__#include <errno.h>#include <unistd.h>#include <stdlib.h>#include <stdio.h>#define EXIT_OK		0#define EXIT_ERR	1#define EXIT_DBG	2/* A cleanup callback handler */typedef void(*proc_cleanup)(int, void *);/* What to call to actually exit */typedef void(*proc_exit)(int);/* Cleanup list element */struct clean_list {	struct clean_list 	*next;	proc_cleanup		cleanup;	void			*priv;};/* Static inline functions */static inline const char *get_nerr(int num) {	return (num>=sys_nerr) ?		"[unknown error]" :		sys_errlist[num];}static inline const char *get_err(void){return get_nerr(errno);}/* Cleanup API */void cleanup_exit_func(proc_exit);void cleanup(int, const char *, ...);void cleanup_add(proc_cleanup, void *);void cleanup_final(proc_cleanup, void *);/* Cleanup helper macros */#define cperror(x) \	cleanup(EXIT_ERR, "%s(): " x "(): %s", __FUNCTION__, get_err());#endif /* __CLEANUP_HEADER_INCLUDED__ */

⌨️ 快捷键说明

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