From c1fbaecc86ab7ee1bd0fa42ea5a30f063130a9fd Mon Sep 17 00:00:00 2001
From: notaz <notasas@gmail.com>
Date: Mon, 5 Oct 2015 03:05:48 +0300
Subject: [PATCH] api for fog

---
 stdc.hlist       |  3 +++
 stdc.list        | 14 +++++++++++++-
 tools/cvt_data.c |  5 +++++
 win32.hlist      |  5 ++++-
 4 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/stdc.hlist b/stdc.hlist
index 35208a5..cbc31f7 100644
--- a/stdc.hlist
+++ b/stdc.hlist
@@ -278,6 +278,7 @@ double __cdecl sqrt(double x);
 double __cdecl pow(double x, double y);
 unsigned int __cdecl _rotl(unsigned int num, int shift);
 unsigned int __cdecl _rotr(unsigned int num, int shift);
+double __cdecl _CIpow(void);
 
 // msvcrt
 unsigned long __cdecl _beginthread (void (__cdecl *)(void *), unsigned, void*);
@@ -288,3 +289,5 @@ DECLSPEC_NORETURN void __cdecl _endthreadex (unsigned int);
 void __cdecl _lock(int locknum);
 void __cdecl _unlock(int locknum);
 size_t __cdecl strncnt(const char*, size_t);
+
+void * __cdecl _getptd(void);
diff --git a/stdc.list b/stdc.list
index 0c7db10..53d4e89 100644
--- a/stdc.list
+++ b/stdc.list
@@ -17,10 +17,17 @@ _strncmp
 _strpbrk
 _atol
 _getenv
+_isalnum
 _isalpha
+_iscntrl
 _isdigit
-_isspace
+_isgraph
+_islower
 _isprint
+_ispunct
+_isspace
+_isupper
+_isxdigit
 _tolower
 #_strncnt
 #_findenv
@@ -54,7 +61,9 @@ _fopen
 _fclose
 _setvbuf
 _fread
+__fread_nolock
 _fwrite
+__fwrite_nolock
 _fseek
 _fgetc
 _fgets
@@ -69,6 +78,7 @@ __strnicmp
 __strupr
 _sprintf
 _vsprintf
+_fprintf
 __strlwr
 __fullpath
 _toupper
@@ -117,6 +127,7 @@ __controlfp
 # __ftol - x87 state
 # __ftol2 - x87 state
 _ceil
+_floor
 _sqrt
 _pow
 __rotl
@@ -130,6 +141,7 @@ __endthreadex
 __lock
 __unlock
 __isctype
+__CIpow
 
 # not in mingw
 _memcpy_0
diff --git a/tools/cvt_data.c b/tools/cvt_data.c
index 60e6187..a00c081 100644
--- a/tools/cvt_data.c
+++ b/tools/cvt_data.c
@@ -566,6 +566,11 @@ int main(int argc, char *argv[])
         goto fin;
       }
 
+      if (IS(words[0], "public")) {
+        // skip, sym should appear in header anyway
+        continue;
+      }
+
       w = 1;
       type = parse_dx_directive(words[0]);
       if (type == DXT_UNSPEC) {
diff --git a/win32.hlist b/win32.hlist
index 4fcd705..27f6ae4 100644
--- a/win32.hlist
+++ b/win32.hlist
@@ -1836,7 +1836,9 @@ int PASCAL getpeername(SOCKET,struct sockaddr*,int*);
 int PASCAL getsockname(SOCKET,struct sockaddr*,int*);
 int PASCAL getsockopt(SOCKET,int,int,char*,int*);
 unsigned long PASCAL inet_addr(const char*);
-// char * PASCAL inet_ntoa(struct in_addr);
+// char * __stdcall inet_ntoa(struct in_addr);
+// hack: for now this will need a wrapper
+char * __stdcall inet_ntoa(int in_addr);
 int PASCAL listen(SOCKET,int);
 int PASCAL recv(SOCKET,char*,int,int);
 int PASCAL recvfrom(SOCKET,char*,int,int,struct sockaddr*,int*);
@@ -1869,6 +1871,7 @@ HANDLE PASCAL WSAAsyncGetHostByName(HWND,u_int,const char*,char*,int);
 HANDLE PASCAL WSAAsyncGetHostByAddr(HWND,u_int,const char*,int,int,char*,int);
 int PASCAL WSACancelAsyncRequest(HANDLE);
 int PASCAL WSAAsyncSelect(SOCKET,HWND,u_int,long);
+int PASCAL __WSAFDIsSet(SOCKET,fd_set*);
 
 // ole32 objbase.h
 DWORD __stdcall CoBuildVersion(void);
-- 
2.39.5