#include <stdio.h>
#include <time.h>
#include <winsock.h>
+#include "fake.h"
#include "prototypes.h"
#define MAX_ASCII 100
free(*av++);
}
-char *glob(register char *v)
+char **glob(register char *v)
{
return NULL;
}
-
int sleep(int time)
{
return time;
{
return 0;
}
-#if 0
+#if 0
int gettimeofday(struct timeval *timenow,
struct timezone *zone)
{
{
static int index = 0;
static int total = 0;
- static unsigned char buffer[4096];
+ static char buffer[4096];
if (index == total)
{
index = 0;
total = recv(s, buffer, sizeof(buffer), 0);
- if (total == INVALID_SOCKET)
+ if (total == SOCKET_ERROR)
{
total = 0;
return ERROR;
#endif
-char *fprintfSocket(int s, char *format, ...)
+const char *fprintfSocket(int s, const char *format, ...)
{
va_list argptr;
char buffer[10009];
return NULL;
}
-char *fputsSocket(char *format, int s)
+const char *fputsSocket(const char *format, int s)
{
send(s, format, strlen(format), 0);
buffer[1] = '\0';
if(SOCKET_ERROR==send(s, buffer, 1, 0)) {
- int iret=WSAGetLastError ();
+ int iret=WSAGetLastError ();
fprintf(stdout,"fputcSocket: %d\n",iret);
return 0;
}
{
int iret;
while(len) {
- if(SOCKET_ERROR==(iret=send(s, buffer, len, 0)))
+ if(SOCKET_ERROR==(iret=send(s, buffer, len, 0)))
{
- iret=WSAGetLastError ();
+ iret=WSAGetLastError ();
fprintf(stdout,"fputcSocket: %d\n",iret);
return 0;
}
if (count == 1)
{
string[i] = buffer[0];
-
+
if (i == MAX_ASCII - 3)
{
count = 0;
return NULL;
}
+#if 0
// Stubbed out here. Should be changed in Source code...
int access(const char *filename, int accessmethod)
{
return 0;
}
+#endif
#ifndef __GNUC__
#define EPOCHFILETIME (116444736000000000i64)
#define EPOCHFILETIME (116444736000000000LL)
#endif
-struct timezone {
- int tz_minuteswest; /* minutes W of Greenwich */
- int tz_dsttime; /* type of dst correction */
-};
-
-__inline int gettimeofday(struct timeval *tv, struct timezone *tz)
+int gettimeofday(struct timeval *tv, struct timezone *tz)
{
FILETIME ft;
LARGE_INTEGER li;
if (tv)
{
GetSystemTimeAsFileTime(&ft);
- //li.LowPart = ft.dwLowDateTime;
- //li.HighPart = ft.dwHighDateTime;
+ li.LowPart = ft.dwLowDateTime;
+ li.HighPart = ft.dwHighDateTime;
t = li.QuadPart; /* In 100-nanosecond intervals */
t -= EPOCHFILETIME; /* Offset to the Epoch time */
t /= 10; /* In microseconds */