common.h

来自「linear time-frequency toolbox」· C头文件 代码 · 共 54 行

H
54
字号
#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 + =
减小字号Ctrl + -
显示快捷键?