00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef SYSDEP_H
00012 #define SYSDEP_H
00013
00014 #include "copyright.h"
00015 #include "iostream.h"
00016 #include "stdlib.h"
00017 #include "stdio.h"
00018 #include "string.h"
00019
00020
00021 extern void Abort();
00022 extern void Exit(int exitCode);
00023 extern void Delay(int seconds);
00024 extern void UDelay(unsigned int usec);
00025
00026
00027 extern void CallOnUserAbort(void (*cleanup)(int));
00028
00029
00030 extern void RandomInit(unsigned seed);
00031 extern unsigned int RandomNumber();
00032
00033
00034
00035 extern char *AllocBoundedArray(int size);
00036 extern void DeallocBoundedArray(char *p, int size);
00037
00038
00039
00040 extern bool PollFile(int fd);
00041
00042
00043
00044 extern int OpenForWrite(char *name);
00045 extern int OpenForReadWrite(char *name, bool crashOnError);
00046 extern void Read(int fd, char *buffer, int nBytes);
00047 extern int ReadPartial(int fd, char *buffer, int nBytes);
00048 extern void WriteFile(int fd, char *buffer, int nBytes);
00049 extern void Lseek(int fd, int offset, int whence);
00050 extern int Tell(int fd);
00051 extern int Close(int fd);
00052 extern bool Unlink(char *name);
00053
00054
00055
00056 extern "C" {
00057 int atoi(const char *str);
00058 double atof(const char *str);
00059 int abs(int i);
00060 void bcopy(const void *s1, void *s2, size_t n);
00061 void bzero(void *s, size_t n);
00062 }
00063
00064
00065 extern int OpenSocket();
00066 extern void CloseSocket(int sockID);
00067 extern void AssignNameToSocket(char *socketName, int sockID);
00068 extern void DeAssignNameToSocket(char *socketName);
00069 extern bool PollSocket(int sockID);
00070 extern void ReadFromSocket(int sockID, char *buffer, int packetSize);
00071 extern void SendToSocket(int sockID, char *buffer, int packetSize,char *toName);
00072
00073 #endif // SYSDEP_H