Index: /lang/c/AutoUpdater/trunk/AutoUpdater.c
===================================================================
--- /lang/c/AutoUpdater/trunk/AutoUpdater.c (revision 37938)
+++ /lang/c/AutoUpdater/trunk/AutoUpdater.c (revision 37945)
@@ -23,7 +23,4 @@
 #endif
 
-#define _tcsdup AUI_tcsdup
-#define _stprintf_s AUI_stprintf_s
-
 #ifdef __CYGWIN__
 
@@ -31,4 +28,6 @@
 #  define GUID_NULL AUI_GUID_NULL
 #  define IID_IDispatch AUI_IID_IDispatch
+#  define strdup AUI_strdup
+#  define wcsdup AUI_wcsdup
 
 const GUID AUI_GUID_NULL = {0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0 }};
@@ -39,4 +38,5 @@
 #    define _tcscpy wcscpy
 #    define _tcscat wcscat
+#    define _tcsdup AUI_wcsdup
 #    define _tfopen(x, y) (NULL)
 #  else
@@ -44,4 +44,5 @@
 #    define _tcscpy strcpy
 #    define _tcscat strcat
+#    define _tcsdup AUI_strdup
 #    define _tfopen fopen
 #  endif
@@ -53,11 +54,12 @@
 #define _tcscpy_s(x, y, z) _tcscpy(x, z)
 #define _tcscat_s(x, y, z) _tcscat(x, z)
-#endif
-
-static TCHAR* AUI_tcsdup(const TCHAR* s) {
+#define _stprintf_s AUI_stprintf_s
+#endif
+
+char* AUI_strdup(const char* s) {
     size_t bytes = 0;
-    TCHAR* buf = NULL;
-    bytes = (_tcslen(s) + 1) * sizeof(TCHAR);
-    buf = (TCHAR*)calloc(bytes, 1);
+    char* buf = NULL;
+    bytes = (strlen(s) + 1);
+    buf = (char*)calloc(bytes, 1);
 	if (!buf) {
         return NULL;
@@ -67,5 +69,17 @@
 }
 
-static void /* TODO: return value */ AUI_stprintf_s(
+wchar_t* AUI_wcsdup(const wchar_t* s) {
+    size_t bytes = 0;
+    wchar_t* buf = NULL;
+    bytes = (wcslen(s) + 1) * sizeof(wchar_t);
+    buf = (wchar_t*)calloc(bytes, 1);
+	if (!buf) {
+        return NULL;
+	}
+    memcpy(buf, s, bytes);
+    return buf;
+}
+
+void /* TODO: return value */ AUI_stprintf_s(
    TCHAR *buffer,
    size_t count,
@@ -117,5 +131,5 @@
 } AUI_DownloadContext;
 
-static const char context_created_sign = '\x5a';
+const char context_created_sign = '\x5a';
 
 typedef struct AUI_Context_ {
@@ -134,8 +148,8 @@
 } AUI_Context;
 
-static const AU_Result AUI_SUCCESS = {1, 0, 0};
-static const AU_Result AUI_IO_PENDING = {0, 1, 0};
-
-static AU_Result E(AU_Error error) {
+const AU_Result AUI_SUCCESS = {1, 0, 0};
+const AU_Result AUI_IO_PENDING = {0, 1, 0};
+
+AU_Result E(AU_Error error) {
 	AU_Result result = {0, 0, 0};
 	result.error = error;
@@ -143,13 +157,13 @@
 }
 
-static int AUI_IsBadReadPointer(const void* pointer, size_t bytes) {
+int AUI_IsBadReadPointer(const void* pointer, size_t bytes) {
     return IsBadReadPtr(pointer, bytes);
 }
 
-static int AUI_IsBadWritePointer(void* pointer, size_t bytes) {
+int AUI_IsBadWritePointer(void* pointer, size_t bytes) {
     return IsBadWritePtr(pointer, bytes);
 }
 
-static AU_Result AUI_CreateTemporaryDirectory(TCHAR** result) {
+AU_Result AUI_CreateTemporaryDirectory(TCHAR** result) {
     TCHAR dir[MAX_PATH] = {0};
     TCHAR* temp_path = NULL;
@@ -180,5 +194,5 @@
 }
 
-static AU_Result AUI_Download(AUI_DownloadContext* context) {
+AU_Result AUI_Download(AUI_DownloadContext* context) {
     /* http://www.codeproject.com/KB/IP/asyncwininet.aspx */
     if (!context->url_handle && !context->url_handle_requested) {
@@ -254,5 +268,5 @@
 }
 
-static void CALLBACK AUI_InternetStatusCallback(
+void CALLBACK AUI_InternetStatusCallback(
     HINTERNET hInternet,
     DWORD_PTR dwContext,
@@ -278,5 +292,5 @@
 }
 
-static AU_Result AUI_CreateDownloadContext(AUI_DownloadContext** context_output, const TCHAR* url, const TCHAR* file_path) {
+AU_Result AUI_CreateDownloadContext(AUI_DownloadContext** context_output, const TCHAR* url, const TCHAR* file_path) {
     AUI_DownloadContext* context = NULL;
     *context_output = NULL;
@@ -330,5 +344,5 @@
 }
 
-static AU_Result AUI_DestroyDownloadContext(AUI_DownloadContext* context) {
+AU_Result AUI_DestroyDownloadContext(AUI_DownloadContext* context) {
     if (context->fp) {
         fclose(context->fp);
@@ -353,11 +367,10 @@
 }
 
-static DWORD CALLBACK AUI_WindowsUpdateThread(LPVOID context_) {
+DWORD CALLBACK AUI_WindowsUpdateThread(LPVOID context_) {
     /* AUI_UpdaterThread((AUI_Context*)context_); */
     return 0;
 }
 
-
-static AU_Result AUI_CreateContext(AUI_Context* context, AU_Option* option) {
+AU_Result AUI_CreateContext(AUI_Context* context, const AU_Option* option) {
     if (!option   ||
             !(option->url)  ||
@@ -385,5 +398,5 @@
 }
 
-static AU_Result AUI_DestroyContext(AUI_Context* context) {
+AU_Result AUI_DestroyContext(AUI_Context* context) {
     context->created_sign = 0;
 
@@ -414,5 +427,5 @@
 }
 
-static AU_Result AUI_GetInformation(AUI_Context* context, AU_Information* information) {
+AU_Result AUI_GetInformation(AUI_Context* context, AU_Information* information) {
     AU_Result r;
     memset(information, 0, sizeof(*information));
@@ -467,5 +480,5 @@
 }
 
-static AU_Result AUI_StartUpdate(AUI_Context* context) {
+AU_Result AUI_StartUpdate(AUI_Context* context) {
     if (!context->temp_dir) {
         AU_Result result = AUI_CreateTemporaryDirectory(&context->temp_dir);
@@ -477,9 +490,9 @@
 }
 
-static AU_Result AUI_Cancel(AUI_Context* context) {
+AU_Result AUI_Cancel(AUI_Context* context) {
     return AUI_SUCCESS;
 }
 
-static AU_Result AUI_ContextToInternalContext(AUI_Context** internal_context_output, const AU_Context context) {
+AU_Result AUI_ContextToInternalContext(AUI_Context** internal_context_output, const AU_Context context) {
     AUI_Context* internal_context = (AUI_Context*)context;
     *internal_context_output = 0;
@@ -522,5 +535,5 @@
     }
 
-AU_Result AU_CreateContext(AU_Context* pcontext, AU_Option* option) {
+AU_Result AU_CreateContext(AU_Context* pcontext, const AU_Option* option) {
     AU_Context context = NULL;
 	
@@ -571,5 +584,5 @@
 
 /* http://support.microsoft.com/kb/238393 */
-static HRESULT AUI_AutoWrap(WORD autoType, VARIANT *pvResult, IDispatch *pDisp,
+HRESULT AUI_AutoWrap(WORD autoType, VARIANT *pvResult, IDispatch *pDisp,
                  const OLECHAR* ptcName, size_t cArgs, VARIANT* rargs)
 {
