]> code.delx.au - gnu-emacs/blobdiff - src/w32.h
Doc fixes for fclist and grep
[gnu-emacs] / src / w32.h
index e0aedcbffa21a3c01389575f0960f69614c7693c..42a1c423ce73f0bd7a65af6a3a85dfd54474dea5 100644 (file)
--- a/src/w32.h
+++ b/src/w32.h
@@ -2,14 +2,14 @@
 #define EMACS_W32_H
 
 /* Support routines for the NT version of Emacs.
-   Copyright (C) 1994, 2001-2014 Free Software Foundation, Inc.
+   Copyright (C) 1994, 2001-2016 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
 GNU Emacs is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -61,7 +61,8 @@ enum {
   STATUS_READ_IN_PROGRESS,
   STATUS_READ_FAILED,
   STATUS_READ_SUCCEEDED,
-  STATUS_READ_ACKNOWLEDGED
+  STATUS_READ_ACKNOWLEDGED,
+  STATUS_CONNECT_FAILED
 };
 
 /* This structure is used for both pipes and sockets; for
@@ -96,6 +97,8 @@ typedef struct _child_process
   /* Status of subprocess/connection and of reading its output.  For
      values, see the enumeration above.  */
   volatile int        status;
+  /* Used to store errno value of failed async 'connect' calls.  */
+  volatile int        errcode;
   /* Holds a single character read by _sys_read_ahead, when a
      subprocess has some output ready.  */
   char                chr;
@@ -122,7 +125,8 @@ extern filedesc fd_info [ MAXDESC ];
 /* fd_info flag definitions */
 #define FILE_READ               0x0001
 #define FILE_WRITE              0x0002
-#define FILE_LISTEN            0x0004
+#define FILE_LISTEN             0x0004
+#define FILE_CONNECT            0x0008
 #define FILE_BINARY             0x0010
 #define FILE_LAST_CR            0x0020
 #define FILE_AT_EOF             0x0040
@@ -171,12 +175,15 @@ extern void init_timers (void);
 
 extern int _sys_read_ahead (int fd);
 extern int _sys_wait_accept (int fd);
+extern int _sys_wait_connect (int fd);
 
-extern Lisp_Object QCloaded_from;
 extern HMODULE w32_delayed_load (Lisp_Object);
 
-extern int (WINAPI *pMultiByteToWideChar)(UINT,DWORD,LPCSTR,int,LPWSTR,int);
-extern int (WINAPI *pWideCharToMultiByte)(UINT,DWORD,LPCWSTR,int,LPSTR,int,LPCSTR,LPBOOL);
+typedef int (WINAPI *MultiByteToWideChar_Proc)(UINT,DWORD,LPCSTR,int,LPWSTR,int);
+typedef int (WINAPI *WideCharToMultiByte_Proc)(UINT,DWORD,LPCWSTR,int,LPSTR,int,LPCSTR,LPBOOL);
+extern MultiByteToWideChar_Proc pMultiByteToWideChar;
+extern WideCharToMultiByte_Proc pWideCharToMultiByte;
+extern DWORD multiByteToWideCharFlags;
 
 extern void init_environment (char **);
 extern void check_windows_init_file (void);
@@ -188,8 +195,10 @@ extern int  filename_from_ansi (const char *, char *);
 extern int  filename_to_ansi (const char *, char *);
 extern int  filename_from_utf16 (const wchar_t *, char *);
 extern int  filename_to_utf16 (const char *, wchar_t *);
+extern int  codepage_for_filenames (CPINFO *);
 extern Lisp_Object ansi_encode_filename (Lisp_Object);
 extern int  w32_copy_file (const char *, const char *, int, int, int);
+extern int  w32_accessible_directory_p (const char *, ptrdiff_t);
 
 extern BOOL init_winsock (int load_now);
 extern void srandom (int);
@@ -198,6 +207,7 @@ extern int random (void);
 extern int fchmod (int, mode_t);
 extern int sys_rename_replace (char const *, char const *, BOOL);
 extern int pipe2 (int *, int);
+extern void register_aux_fd (int);
 
 extern void set_process_dir (char *);
 extern int sys_spawnve (int, char *, char **, char **);
@@ -213,6 +223,9 @@ extern int w32_memory_info (unsigned long long *, unsigned long long *,
 /* Compare 2 UTF-8 strings in locale-dependent fashion.  */
 extern int w32_compare_strings (const char *, const char *, char *, int);
 
+/* Return a cryptographically secure seed for PRNG.  */
+extern int w32_init_random (void *, ptrdiff_t);
+
 #ifdef HAVE_GNUTLS
 #include <gnutls/gnutls.h>
 
@@ -225,4 +238,17 @@ extern ssize_t emacs_gnutls_push (gnutls_transport_ptr_t p,
                                   const void* buf, size_t sz);
 #endif /* HAVE_GNUTLS */
 
+/* Definine a function that will be loaded from a DLL.  */
+#define DEF_DLL_FN(type, func, args) static type (FAR CDECL *fn_##func) args
+
+/* Load a function from the DLL.  */
+#define LOAD_DLL_FN(lib, func)                                         \
+  do                                                                   \
+    {                                                                  \
+      fn_##func = (void *) GetProcAddress (lib, #func);                        \
+      if (!fn_##func)                                                  \
+       return false;                                                   \
+    }                                                                  \
+  while (false)
+
 #endif /* EMACS_W32_H */