00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "xsb_config.h"
00027
00028
00029 #ifdef WIN_NT
00030 #include <direct.h>
00031 #include <io.h>
00032 #else
00033 #include <unistd.h>
00034 #endif
00035
00036 #include <fcntl.h>
00037 #include <stdio.h>
00038 #include <stdlib.h>
00039 #include <string.h>
00040 #include <sys/types.h>
00041 #include <sys/stat.h>
00042
00043 #include "wind2unix.h"
00044
00045 #include "context.h"
00046 #include "emuloop.h"
00047
00048 #ifdef HAVE_SOCKET
00049 #ifdef WIN_NT
00050 #include <windows.h>
00051 #include <winsock.h>
00052 #endif
00053 #endif
00054
00055 #include "orient_xsb.h"
00056 #include "basicdefs.h"
00057
00058 int main(int argc, char *argv[])
00059 {
00060 #ifdef MULTI_THREAD
00061 static th_context *th ;
00062 #endif
00063
00064 #ifdef HAVE_SOCKET
00065 #ifdef WIN_NT
00066 INT err;
00067 WSADATA wsaData;
00068 #ifdef SILENT_NT
00069 FILE *stream_err, *stream_out;
00070 stream_err = freopen("errorlog", "w", stderr);
00071 stream_out = freopen("outlog", "w", stdout);
00072 #endif
00073 err = WSAStartup(0x0101, &wsaData);
00074 if (err == SOCKET_ERROR) {
00075 fprintf (stdout, "WSAStartup Failed\n");
00076 return FALSE;
00077 }
00078 #endif
00079 #endif
00080
00081 #ifdef MULTI_THREAD
00082 th = malloc( sizeof( th_context ) ) ;
00083 #endif
00084
00085 xsb(CTXTc 0, argc, argv);
00086
00087 xsb(CTXTc 1, 0, 0);
00088 xsb(CTXTc 2, 0, 0);
00089 return 0;
00090 }
00091