📄 common.h
字号:
#ifndef COMMON_H#define COMMON_H 1#if HAVE_CONFIG_H# include <config.h>#endif#include <stdio.h>#include <sys/types.h>#if STDC_HEADERS# include <stdlib.h># include <string.h>#elif HAVE_STRINGS_H# include <strings.h>#endif /*STDC_HEADERS*/#if HAVE_UNISTD_H# include <unistd.h>#endif#ifdef __cplusplus# define BEGIN_C_DECLS extern "C" {# define END_C_DECLS }#else /* !__cplusplus */# define BEGIN_C_DECLS# define END_C_DECLS#endif /* __cplusplus */#define XCALLOC(type, num) \ ((type *) xcalloc ((num), sizeof(type)))#define XMALLOC(type, num) \ ((type *) xmalloc ((num) * sizeof(type)))#define XREALLOC(type, p, num) \ ((type *) xrealloc ((p), (num) * sizeof(type)))#define XFREE(stale) do { \ if (stale) { free (stale); stale = 0; } \ } while (0)#if !HAVE_BZERO && HAVE_MEMSET# define bzero(buf, bytes) ((void) memset (buf, 0, bytes))#endifBEGIN_C_DECLSextern void *xcalloc (size_t num, size_t size);extern void *xmalloc (size_t num);extern void *xrealloc (void *p, size_t num);extern char *xstrdup (const char *string);extern char *xstrerror (int errnum);END_C_DECLS#endif /* common.h */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -