home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / lora299s.zip / _LDEFS.H next >
C/C++ Source or Header  |  1998-05-12  |  6KB  |  245 lines

  1.  
  2. // LoraBBS Version 2.99 Free Edition
  3. // Copyright (C) 1987-98 Marco Maccaferri
  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., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  
  19. #ifndef __LDEFS_H
  20. #define __LDEFS_H
  21.  
  22. #if defined(_MSC_VER)
  23. #undef _WINDOWS
  24. #endif
  25.  
  26. #if !defined(__LINUX__)
  27. #include <conio.h>
  28. #include <dos.h>
  29. #if defined(__BORLANDC__)
  30. #include <dirent.h>
  31. #endif
  32. #include <direct.h>
  33. #if defined(__OS2__) && defined(__BORLANDC__)
  34. #define __IN_IOCTL
  35. #endif
  36. #include <io.h>
  37. #include <process.h>
  38. #include <share.h>
  39. #include <sys\stat.h>
  40. #endif
  41.  
  42. #include <ctype.h>
  43. #include <fcntl.h>
  44. #include <malloc.h>
  45. #if defined(_MSC_VER) || defined(__LINUX__)
  46. #include <memory.h>
  47. #else
  48. #include <mem.h>
  49. #endif
  50. #if defined(__BORLANDC__) || defined(__LINUX__)
  51. #include <utime.h>
  52. #else
  53. #include <sys\utime.h>
  54. #endif
  55. #include <stdarg.h>
  56. #include <stdio.h>
  57. #include <stdlib.h>
  58. #include <string.h>
  59. #include <time.h>
  60.  
  61. #if defined(__LINUX__)
  62. #include <dirent.h>
  63. #include <sys/types.h>
  64. #include <sys/stat.h>
  65. #include <unistd.h>
  66.  
  67. #pragma pack(1)
  68. #define cprintf         printf
  69.  
  70. #define O_BINARY        0
  71. #define SH_DENYNO       0
  72. #define SH_DENYRW       0
  73.  
  74. struct dosdate_t {
  75.    unsigned char day;
  76.    unsigned char month;
  77.    unsigned int year;
  78.    unsigned char dayofweek;
  79. };
  80.  
  81. struct dostime_t {
  82.    unsigned char hour;
  83.    unsigned char minute;
  84.    unsigned char second;
  85.    unsigned char hsecond;
  86. };
  87.  
  88. void chsize (int fd, long size);
  89. void _dos_getdate (struct dosdate_t *ddate);
  90. void _dos_gettime (struct dostime_t *dtime);
  91. long filelength (int fd);
  92. FILE *_fsopen (char *name, char *mode, int shflags);
  93. int sopen (char *file, int flags, int shmode, int mode);
  94. int stricmp (char *s1, char *s2);
  95. int strnicmp (char *s1, char *s2, size_t maxlen);
  96. char *strlwr (char *s);
  97. char *strupr (char *s);
  98. long tell (int fd);
  99.  
  100. #endif
  101.  
  102. #if defined(__OS2__) && !defined(INCL_DOS)
  103. #define INCL_DOS
  104. #define INCL_DOSDEVICES
  105. #define INCL_DOSDEVIOCTL
  106. #define INCL_DOSSEMAPHORES
  107. #define INCL_DOSPROCESS
  108. #define INCL_PM
  109. #define INCL_VIO
  110. #define INCL_KBD
  111. #include <os2.h>
  112.  
  113. typedef struct {
  114.    ULONG SessionID;
  115.    ULONG ResultCode;
  116. } TERMNOTIFY, *PTERMNOTIFY;
  117.  
  118. #elif defined(__NT__)
  119. #include <windows.h>
  120. #endif
  121.  
  122. #if defined(__OS2__) || defined(__NT__)
  123. #if defined(_MSC_VER)
  124. #define DLL_EXPORT
  125. #else
  126. #define DLL_EXPORT      _export
  127. #endif
  128. #else
  129. #define DLL_EXPORT
  130. #endif
  131.  
  132. #ifndef TRUE
  133. #define TRUE            1
  134. #define FALSE           0
  135. #endif
  136.  
  137. #ifndef VOID
  138. typedef void            VOID;
  139. typedef void *          PVOID;
  140. typedef char            CHAR;
  141. typedef unsigned char   UCHAR;
  142. typedef unsigned char   BYTE;
  143. typedef char *          PSZ;
  144. typedef short           SHORT;
  145. typedef unsigned short  USHORT;
  146. typedef long            LONG;
  147. typedef unsigned long   ULONG;
  148. typedef int             INT;
  149. #endif
  150.  
  151. #define CTRLA           0x01
  152. #define CTRLB           0x02
  153. #define CTRLC           0x03
  154. #define CTRLD           0x04
  155. #define CTRLE           0x05
  156. #define CTRLF           0x06
  157. #define CTRLG           0x07
  158. #define CTRLH           0x08
  159. #define CTRLI           0x09
  160. #define CTRLJ           0x0a
  161. #define CTRLK           0x0b
  162. #define CTRLL           0x0c
  163. #define CTRLM           0x0d
  164. #define CTRLN           0x0e
  165. #define CTRLO           0x0f
  166. #define CTRLP           0x10
  167. #define CTRLQ           0x11
  168. #define CTRLR           0x12
  169. #define CTRLS           0x13
  170. #define CTRLT           0x14
  171. #define CTRLU           0x15
  172. #define CTRLV           0x16
  173. #define CTRLW           0x17
  174. #define CTRLX           0x18
  175. #define CTRLY           0x19
  176. #define CTRLZ           0x1a
  177. #define ESC             0x1b
  178. #define DEL             0x7f
  179.  
  180. #define BLACK           0
  181. #define BLUE            1
  182. #define GREEN           2
  183. #define CYAN            3
  184. #define RED             4
  185. #define MAGENTA         5
  186. #define BROWN           6
  187. #define LGREY           7
  188. #define DGREY           8
  189. #define LBLUE           9
  190. #define LGREEN          10
  191. #define LCYAN           11
  192. #define LRED            12
  193. #define LMAGENTA        13
  194. #define YELLOW          14
  195. #define WHITE           15
  196.  
  197. #define _BLACK          0
  198. #define _BLUE           16
  199. #define _GREEN          32
  200. #define _CYAN           48
  201. #define _RED            64
  202. #define _MAGENTA        80
  203. #define _BROWN          96
  204. #define _LGREY          112
  205.  
  206. #define BLINK           128
  207.  
  208. #define SOH             0x01
  209. #define ACK             0x06
  210. #define NAK             0x15
  211. #define SYN             0x16
  212. #define STX             0x02
  213. #define EOT             0x04
  214. #define ENQ             0x05
  215.  
  216. typedef struct {
  217.    USHORT Zone;
  218.    USHORT Net;
  219.    USHORT Node;
  220.    USHORT Point;
  221.    CHAR   Domain[32];
  222.    USHORT Flags;
  223. } ADDR;
  224.  
  225. USHORT DLL_EXPORT Crc16 (UCHAR Byte, USHORT Crc);
  226. ULONG  DLL_EXPORT Crc32 (UCHAR Byte, ULONG Crc);
  227. USHORT DLL_EXPORT StringCrc16 (CHAR *String, USHORT Crc);
  228. ULONG  DLL_EXPORT StringCrc32 (CHAR *String, ULONG Crc);
  229.  
  230. VOID   DLL_EXPORT Pause (LONG lHund);
  231. LONG   DLL_EXPORT TimerSet (LONG lHund);
  232. USHORT DLL_EXPORT TimeUp (LONG lEndtime);
  233.  
  234. PSZ    DLL_EXPORT AdjustPath (PSZ pszPath);
  235. USHORT DLL_EXPORT BuildPath (PSZ pszPath);
  236.  
  237. char * DLL_EXPORT strsrep (char *str, char *search, char *replace);
  238.  
  239. VOID   DLL_EXPORT RunExternal (PSZ Command, USHORT TimeLimit = 0);
  240. VOID   DLL_EXPORT SpawnExternal (PSZ Command);
  241. ULONG  DLL_EXPORT AvailableMemory (VOID);
  242.  
  243. #endif
  244.  
  245.