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

📄 common_define.h

📁 文件系统源代码!!!!! 文件系统源代码
💻 H
字号:
/*** Copyright (C) 2008 Happy Fish / YuQing** FastDFS may be copied only under the terms of the GNU General* Public License V3, which may be found in the FastDFS source kit.* Please visit the FastDFS Home Page http://www.csource.org/ for more detail.**///common_define.h#ifndef _COMMON_DEFINE_H_#define _COMMON_DEFINE_H_#include <pthread.h>#ifdef WIN32#include <windows.h>#include <winsock.h>typedef UINT in_addr_t;#define FILE_SEPERATOR	"\\"#define THREAD_ENTRANCE_FUNC_DECLARE  DWORD WINAPI#define THREAD_RETURN_VALUE	 0typedef DWORD (WINAPI *ThreadEntranceFunc)(LPVOID lpThreadParameter);#else#include <unistd.h>#include <signal.h>#include <netinet/in.h>#include <arpa/inet.h>#include <sys/types.h>#include <sys/socket.h>#define FILE_SEPERATOR	"/"typedef int SOCKET;#define closesocket     close#define INVALID_SOCKET  -1#define THREAD_ENTRANCE_FUNC_DECLARE  void *typedef void *LPVOID;#define THREAD_RETURN_VALUE	 NULLtypedef void * (*ThreadEntranceFunc)(LPVOID lpThreadParameter);#endifextern int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int kind);#ifdef OS_LINUX#define PTHREAD_MUTEX_ERRORCHECK PTHREAD_MUTEX_ERRORCHECK_NP#endif#include "_os_bits.h"#ifdef OS_BITS  #if OS_BITS == 64    #define INT64_PRINTF_FORMAT   "%ld"  #else    #define INT64_PRINTF_FORMAT   "%lld"  #endif#else  #define INT64_PRINTF_FORMAT   "%lld"#endif#define USE_SENDFILE#define MAX_PATH_SIZE				256#define LOG_FILE_DIR				"logs"#define CONF_FILE_DIR				"conf"#define DEFAULT_NETWORK_TIMEOUT			30#define DEFAULT_MAX_CONNECTONS			256#define SYNC_LOG_BUFF_DEF_INTERVAL              10#define IP_ADDRESS_SIZE	16#ifndef truetypedef char  bool;#define true  1#define false 0#endif#ifndef byte#define byte char#endif#ifndef ubyte#define ubyte unsigned char#endif#define IS_UPPER_HEX(ch) ((ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'F'))#ifdef __cplusplusextern "C" {#endiftypedef void (*FreeDataFunc)(void *ptr);typedef int (*CompareFunc)(void *p1, void *p2);#ifdef WIN32#define strcasecmp	_stricmp#endif#ifdef __cplusplus}#endif#endif

⌨️ 快捷键说明

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