utils.h

来自「Shorthand是一个强大的脚本语言」· C头文件 代码 · 共 40 行

H
40
字号
#ifndef __utils_h
#define __utils_h
///////////////////////////////////////////////////////////////////////////////
// $Header: /shorthand/src/utils.h 6     1/09/03 7:14p Arm $
//-----------------------------------------------------------------------------
// Project: ShortHand interpreter
// Author: Andrei Remenchuk <andrei@remenchuk.com>
//-----------------------------------------------------------------------------
// utils.cpp: miscellaneous utility functions
///////////////////////////////////////////////////////////////////////////////

#include <stdarg.h>
#include "cstring.h"

#define APP_TITLE "ShortHand"

const char* get_home_dir();

unsigned int hash_code(const char* s);
void putenf(const char* name, const char* format, ...);
const char* sh_getenv(const char* name);
void safe_putenv(const char* spec);
const char* safe_getenv(const char* name, string& value);

int i_max(int a, int b);
int i_min(int a, int b);

#define xmalloc malloc
#define xrealloc realloc
#define xfree free
#define bzero(b,n) memset(b,0,n)

#ifndef WIN32
#define stricmp strcasecmp
#define strnicmp strncasecmp
#endif


#endif //__utils_h

⌨️ 快捷键说明

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