SysTypesSolaris.h
上传用户:woshihumen
上传日期:2013-07-18
资源大小:484k
文件大小:3k
源码类别:

Email服务器

开发平台:

Visual C++

  1. /*
  2.  *  XMail by Davide Libenzi ( Intranet and Internet mail server )
  3.  *  Copyright (C) 1999,..,2004  Davide Libenzi
  4.  *
  5.  *  This program is free software; you can redistribute it and/or modify
  6.  *  it under the terms of the GNU General Public License as published by
  7.  *  the Free Software Foundation; either version 2 of the License, or
  8.  *  (at your option) any later version.
  9.  *
  10.  *  This program is distributed in the hope that it will be useful,
  11.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  *  GNU General Public License for more details.
  14.  *
  15.  *  You should have received a copy of the GNU General Public License
  16.  *  along with this program; if not, write to the Free Software
  17.  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  18.  *
  19.  *  Davide Libenzi <davidel@xmailserver.org>
  20.  *
  21.  */
  22. #ifndef _SYSTYPESSOLARIS_H
  23. #define _SYSTYPESSOLARIS_H
  24. #ifdef MACH_BIG_ENDIAN_WORDS
  25. #define BIG_ENDIAN_CPU
  26. #endif
  27. #ifdef MACH_BIG_ENDIAN_BITFIELD
  28. #define BIG_ENDIAN_BITFIELD
  29. #endif
  30. #define SYS_INFINITE_TIMEOUT    (4 * 1024 * 1024)
  31. #define SYS_DEFAULT_MAXCOUNT    (INT_MAX - 1)
  32. #define SYS_SLASH_CHAR          '/'
  33. #define SYS_SLASH_STR           "/"
  34. #define SYS_BASE_FS_STR         ""
  35. #define SYS_MAX_PATH            256
  36. #define SYS_LLU_FMT             "%llu"
  37. #define SYS_LLX_FMT             "%llX"
  38. #define SYS_INVALID_HANDLE      ((SYS_HANDLE) 0)
  39. #define SYS_INVALID_SOCKET      ((SYS_SOCKET) (-1))
  40. #define SYS_INVALID_SEMAPHORE   ((SYS_SEMAPHORE) 0)
  41. #define SYS_INVALID_MUTEX       ((SYS_MUTEX) 0)
  42. #define SYS_INVALID_EVENT       ((SYS_EVENT) 0)
  43. #define SYS_INVALID_THREAD      ((SYS_THREAD) 0)
  44. #define SYS_INVALID_NET_ADDRESS ((NET_ADDRESS) INADDR_NONE)
  45. #define SYS_THREAD_ONCE_INIT    PTHREAD_ONCE_INIT
  46. #define SysSNPrintf             snprintf
  47. #define stricmp                 strcasecmp
  48. #define strnicmp                strncasecmp
  49. #define SYS_fd_set              fd_set
  50. #define SYS_FD_ZERO             FD_ZERO
  51. #define SYS_FD_CLR              FD_CLR
  52. #define SYS_FD_SET              FD_SET
  53. #define SYS_FD_ISSET            FD_ISSET
  54. #if !defined(INADDR_NONE)
  55. #define INADDR_NONE             0xffffffff
  56. #endif
  57. typedef char SYS_INT8;
  58. typedef unsigned char SYS_UINT8;
  59. typedef short int SYS_INT16;
  60. typedef unsigned short int SYS_UINT16;
  61. typedef int SYS_INT32;
  62. typedef unsigned int SYS_UINT32;
  63. typedef long long int SYS_INT64;
  64. typedef unsigned long long int SYS_UINT64;
  65. typedef unsigned long long int SYS_LONGLONG;
  66. typedef unsigned int SYS_PTRUINT;
  67. typedef unsigned long SYS_HANDLE;
  68. typedef pthread_key_t SYS_TLSKEY;
  69. typedef pthread_once_t SYS_THREAD_ONCE;
  70. typedef int SYS_SOCKET;
  71. typedef void *SYS_SEMAPHORE;
  72. typedef void *SYS_MUTEX;
  73. typedef void *SYS_EVENT;
  74. typedef void *SYS_THREAD;
  75. typedef unsigned long NET_ADDRESS;
  76. struct SYS_INET_ADDR {
  77. struct sockaddr_in Addr;
  78. };
  79. enum SysFileTypes {
  80. ftNormal = 1,
  81. ftDirectory,
  82. ftLink,
  83. ftOther,
  84. ftMax
  85. };
  86. struct SYS_FILE_INFO {
  87. int iFileType;
  88. unsigned long ulSize;
  89. time_t tMod;
  90. };
  91. #endif