#include <setjmp.h>
/* must include CRT headers *before* config.h */
-
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#undef signal
#undef wait
Lisp_Object Qhigh, Qlow;
#ifdef EMACSDEBUG
-void _DebPrint (const char *fmt, ...)
+void
+_DebPrint (const char *fmt, ...)
{
char buf[1024];
va_list args;
}
#endif
-typedef void (_CALLBACK_ *signal_handler)(int);
+typedef void (_CALLBACK_ *signal_handler) (int);
/* Signal handlers...SIG_DFL == 0 so this is initialized correctly. */
static signal_handler sig_handlers[NSIG];
child_process child_procs[ MAX_CHILDREN ];
child_process *dead_child = NULL;
-DWORD WINAPI reader_thread (void *arg);
+static DWORD WINAPI reader_thread (void *arg);
/* Find an unused process slot. */
child_process *
is normally blocked until woken by select() to check for input by
reading one char. When the read completes, char_avail is signaled
to wake up the select emulator and the thread blocks itself again. */
-DWORD WINAPI
+static DWORD WINAPI
reader_thread (void *arg)
{
child_process *cp;
# define IMAGE_OPTIONAL_HEADER32 IMAGE_OPTIONAL_HEADER
#endif
-void
-w32_executable_type (char * filename, int * is_dos_app, int * is_cygnus_app, int * is_gui_app)
+static void
+w32_executable_type (char * filename,
+ int * is_dos_app,
+ int * is_cygnus_app,
+ int * is_gui_app)
{
file_data executable;
char * p;
close_file_data (&executable);
}
-int
+static int
compare_env (const void *strp1, const void *strp2)
{
const char *str1 = *(const char **)strp1, *str2 = *(const char **)strp2;
return 1;
}
-void
+static void
merge_and_sort_env (char **envp1, char **envp2, char **new_envp)
{
char **optr, **nptr;
process_dir = dir;
}
-#ifdef HAVE_SOCKETS
-
/* To avoid problems with winsock implementations that work over dial-up
connections causing or requiring a connection to exist while Emacs is
running, Emacs no longer automatically loads winsock on startup if it
the winsock local hostname is returned (since this may be different from
the value of `system-name' and should supplant it), otherwise t is
returned to indicate winsock support is present. */)
- (load_now)
- Lisp_Object load_now;
+ (Lisp_Object load_now)
{
int have_winsock;
This is provided to allow dial-up socket connections to be disconnected
when no longer needed. Returns nil without unloading winsock if any
socket connections still exist. */)
- ()
+ (void)
{
return term_winsock () ? Qt : Qnil;
}
-#endif /* HAVE_SOCKETS */
-
\f
/* Some miscellaneous functions that are Windows specific, but not GUI
specific (ie. are applicable in terminal or batch mode as well). */
-/* lifted from fileio.c */
-#define CORRECT_DIR_SEPS(s) \
- do { if ('/' == DIRECTORY_SEP) dostounix_filename (s); \
- else unixtodos_filename (s); \
- } while (0)
-
DEFUN ("w32-short-file-name", Fw32_short_file_name, Sw32_short_file_name, 1, 1, 0,
doc: /* Return the short file name version (8.3) of the full path of FILENAME.
If FILENAME does not exist, return nil.
All path elements in FILENAME are converted to their short names. */)
- (filename)
- Lisp_Object filename;
+ (Lisp_Object filename)
{
char shortname[MAX_PATH];
if (GetShortPathName (SDATA (ENCODE_FILE (filename)), shortname, MAX_PATH) == 0)
return Qnil;
- CORRECT_DIR_SEPS (shortname);
+ dostounix_filename (shortname);
return build_string (shortname);
}
doc: /* Return the long file name version of the full path of FILENAME.
If FILENAME does not exist, return nil.
All path elements in FILENAME are converted to their long names. */)
- (filename)
- Lisp_Object filename;
+ (Lisp_Object filename)
{
char longname[ MAX_PATH ];
int drive_only = 0;
if (!w32_get_long_filename (SDATA (ENCODE_FILE (filename)), longname, MAX_PATH))
return Qnil;
- CORRECT_DIR_SEPS (longname);
+ dostounix_filename (longname);
/* If we were passed only a drive, make sure that a slash is not appended
for consistency with directories. Allow for drive mapping via SUBST
any other symbol will be interpreted as normal.
If successful, the return value is t, otherwise nil. */)
- (process, priority)
- Lisp_Object process, priority;
+ (Lisp_Object process, Lisp_Object priority)
{
HANDLE proc_handle = GetCurrentProcess ();
DWORD priority_class = NORMAL_PRIORITY_CLASS;
locale information is returned.
If LCID (a 16-bit number) is not a valid locale, the result is nil. */)
- (lcid, longform)
- Lisp_Object lcid, longform;
+ (Lisp_Object lcid, Lisp_Object longform)
{
int got_abbrev;
int got_full;
doc: /* Return Windows locale id for current locale setting.
This is a numerical value; use `w32-get-locale-info' to convert to a
human-readable form. */)
- ()
+ (void)
{
return make_number (GetThreadLocale ());
}
-DWORD
+static DWORD
int_from_hex (char * s)
{
DWORD val = 0;
function isn't given a context pointer. */
Lisp_Object Vw32_valid_locale_ids;
-BOOL CALLBACK
+static BOOL CALLBACK
enum_locale_fn (LPTSTR localeNum)
{
DWORD id = int_from_hex (localeNum);
doc: /* Return list of all valid Windows locale ids.
Each id is a numerical value; use `w32-get-locale-info' to convert to a
human-readable form. */)
- ()
+ (void)
{
Vw32_valid_locale_ids = Qnil;
parameter USERP is non-nil, the user default locale setting is returned.
This is a numerical value; use `w32-get-locale-info' to convert to a
human-readable form. */)
- (userp)
- Lisp_Object userp;
+ (Lisp_Object userp)
{
if (NILP (userp))
return make_number (GetSystemDefaultLCID ());
DEFUN ("w32-set-current-locale", Fw32_set_current_locale, Sw32_set_current_locale, 1, 1, 0,
doc: /* Make Windows locale LCID be the current locale setting for Emacs.
If successful, the new locale id is returned, otherwise nil. */)
- (lcid)
- Lisp_Object lcid;
+ (Lisp_Object lcid)
{
CHECK_NUMBER (lcid);
function isn't given a context pointer. */
Lisp_Object Vw32_valid_codepages;
-BOOL CALLBACK
+static BOOL CALLBACK
enum_codepage_fn (LPTSTR codepageNum)
{
DWORD id = atoi (codepageNum);
DEFUN ("w32-get-valid-codepages", Fw32_get_valid_codepages,
Sw32_get_valid_codepages, 0, 0, 0,
doc: /* Return list of all valid Windows codepages. */)
- ()
+ (void)
{
Vw32_valid_codepages = Qnil;
DEFUN ("w32-get-console-codepage", Fw32_get_console_codepage,
Sw32_get_console_codepage, 0, 0, 0,
doc: /* Return current Windows codepage for console input. */)
- ()
+ (void)
{
return make_number (GetConsoleCP ());
}
doc: /* Make Windows codepage CP be the current codepage setting for Emacs.
The codepage setting affects keyboard input and display in tty mode.
If successful, the new CP is returned, otherwise nil. */)
- (cp)
- Lisp_Object cp;
+ (Lisp_Object cp)
{
CHECK_NUMBER (cp);
DEFUN ("w32-get-console-output-codepage", Fw32_get_console_output_codepage,
Sw32_get_console_output_codepage, 0, 0, 0,
doc: /* Return current Windows codepage for console output. */)
- ()
+ (void)
{
return make_number (GetConsoleOutputCP ());
}
doc: /* Make Windows codepage CP be the current codepage setting for Emacs.
The codepage setting affects keyboard input and display in tty mode.
If successful, the new CP is returned, otherwise nil. */)
- (cp)
- Lisp_Object cp;
+ (Lisp_Object cp)
{
CHECK_NUMBER (cp);
Sw32_get_codepage_charset, 1, 1, 0,
doc: /* Return charset of codepage CP.
Returns nil if the codepage is not valid. */)
- (cp)
- Lisp_Object cp;
+ (Lisp_Object cp)
{
CHARSETINFO info;
Sw32_get_valid_keyboard_layouts, 0, 0, 0,
doc: /* Return list of Windows keyboard languages and layouts.
The return value is a list of pairs of language id and layout id. */)
- ()
+ (void)
{
int num_layouts = GetKeyboardLayoutList (0, NULL);
HKL * layouts = (HKL *) alloca (num_layouts * sizeof (HKL));
Sw32_get_keyboard_layout, 0, 0, 0,
doc: /* Return current Windows keyboard language and layout.
The return value is the cons of the language id and the layout id. */)
- ()
+ (void)
{
DWORD kl = (DWORD) GetKeyboardLayout (dwWindowsThreadId);
doc: /* Make LAYOUT be the current keyboard layout for Emacs.
The keyboard layout setting affects interpretation of keyboard input.
If successful, the new layout id is returned, otherwise nil. */)
- (layout)
- Lisp_Object layout;
+ (Lisp_Object layout)
{
DWORD kl;
\f
void
-syms_of_ntproc ()
+syms_of_ntproc (void)
{
DEFSYM (Qhigh, "high");
DEFSYM (Qlow, "low");
-#ifdef HAVE_SOCKETS
defsubr (&Sw32_has_winsock);
defsubr (&Sw32_unload_winsock);
-#endif
+
defsubr (&Sw32_short_file_name);
defsubr (&Sw32_long_file_name);
defsubr (&Sw32_set_process_priority);
staticpro (&Vw32_valid_locale_ids);
staticpro (&Vw32_valid_codepages);
}
-/* end of ntproc.c */
+/* end of w32proc.c */
-/* arch-tag: 23d3a34c-06d2-48a1-833b-ac7609aa5250
- (do not change this comment) */