#undef localtime
#include "lisp.h"
-#include "epaths.h" /* for SHELL */
+#include "epaths.h" /* for PATH_EXEC */
#include <pwd.h>
#include <grp.h>
#include <iphlpapi.h> /* should be after winsock2.h */
+#include <c-strcase.h>
+
#include "w32.h"
#include <dirent.h>
#include "w32common.h"
-#include "w32heap.h"
#include "w32select.h"
-#include "systime.h"
+#include "systime.h" /* for current_timespec, struct timespec */
#include "dispextern.h" /* for xstrcasecmp */
#include "coding.h" /* for Vlocale_coding_system */
#include "careadlinkat.h"
#include "allocator.h"
-/* For serial_configure and serial_open. */
+/* For Lisp_Process, serial_configure and serial_open. */
#include "process.h"
+#include "systty.h"
typedef HRESULT (WINAPI * ShGetFolderPath_fn)
(IN HWND, IN int, IN HANDLE, IN DWORD, OUT char *);
#include <windows.h>
#include "lisp.h"
-#include "character.h"
#include "coding.h"
-#include "disptab.h"
-#include "frame.h"
-#include "window.h"
-#include "termhooks.h"
-#include "termchar.h"
-#include "dispextern.h"
+#include "termchar.h" /* for FRAME_TTY */
#include "menu.h" /* for tty_menu_show */
#include "w32term.h"
#include "w32common.h" /* for os_subtype */
#include "w32inevt.h"
-/* from window.c */
-extern Lisp_Object Frecenter (Lisp_Object);
-
static void w32con_move_cursor (struct frame *f, int row, int col);
static void w32con_clear_to_end (struct frame *f);
static void w32con_clear_frame (struct frame *f);
{
DWORD r;
WORD char_attr;
- unsigned char *conversion_buffer;
+ LPCSTR conversion_buffer;
struct coding_system *coding;
if (len <= 0)
if (n == len)
/* This is the last run. */
coding->mode |= CODING_MODE_LAST_BLOCK;
- conversion_buffer = encode_terminal_code (string, n, coding);
+ conversion_buffer = (LPCSTR) encode_terminal_code (string, n, coding);
if (coding->produced > 0)
{
/* Set the attribute for these characters. */
register struct glyph *string, register int len,
register int face_id)
{
- unsigned char *conversion_buffer;
+ LPCSTR conversion_buffer;
struct coding_system *coding;
if (len <= 0)
they all have the same face. So this _is_ the last block. */
coding->mode |= CODING_MODE_LAST_BLOCK;
- conversion_buffer = encode_terminal_code (string, len, coding);
+ conversion_buffer = (LPCSTR) encode_terminal_code (string, len, coding);
if (coding->produced > 0)
{
DWORD filled, written;
#include "w32term.h"
#include "frame.h"
#include "window.h"
-#include "character.h"
#include "buffer.h"
-#include "intervals.h"
-#include "dispextern.h"
#include "keyboard.h"
#include "blockinput.h"
-#include "epaths.h"
-#include "charset.h"
#include "coding.h"
-#include "ccl.h"
-#include "fontset.h"
-#include "systime.h"
-#include "termhooks.h"
#include "w32common.h"
#ifdef WINDOWSNT
-#include "w32heap.h"
#include <mbstring.h>
#endif /* WINDOWSNT */
#include "w32.h"
#endif
-#include "bitmaps/gray.xbm"
-
#include <commctrl.h>
#include <commdlg.h>
#include <shellapi.h>
#include <imm.h>
#include <windowsx.h>
-#include "font.h"
-#include "w32font.h"
-
#ifndef FOF_NO_CONNECTED_ELEMENTS
#define FOF_NO_CONNECTED_ELEMENTS 0x2000
#endif
tem = XCAR (elt);
- if (lstrcmpi (SDATA (tem), colorname) == 0)
+ if (lstrcmpi (SSDATA (tem), colorname) == 0)
{
ret = Fcdr (elt);
break;
strcpy (full_name_buffer, SYSTEM_COLOR_PREFIX);
while (RegEnumValueA (colors_key, index, name_buffer, &name_size,
- NULL, NULL, color_buffer, &color_size)
+ NULL, NULL, (LPBYTE)color_buffer, &color_size)
== ERROR_SUCCESS)
{
int r, g, b;
CHECK_STRING (arg);
- if (strcmp (SDATA (arg), "black") == 0)
+ if (strcmp (SSDATA (arg), "black") == 0)
return BLACK_PIX_DEFAULT (f);
- else if (strcmp (SDATA (arg), "white") == 0)
+ else if (strcmp (SSDATA (arg), "white") == 0)
return WHITE_PIX_DEFAULT (f);
if ((FRAME_DISPLAY_INFO (f)->n_planes * FRAME_DISPLAY_INFO (f)->n_cbits) == 1)
/* w32_defined_color is responsible for coping with failures
by looking for a near-miss. */
- if (w32_defined_color (f, SDATA (arg), &cdef, true))
+ if (w32_defined_color (f, SSDATA (arg), &cdef, true))
return cdef.pixel;
/* defined_color failed; return an ultimate default. */
/* Check for no change needed in this very common case
before we do any consing. */
if (!strcmp (FRAME_DISPLAY_INFO (f)->w32_id_name,
- SDATA (f->name)))
+ SSDATA (f->name)))
return;
name = build_string (FRAME_DISPLAY_INFO (f)->w32_id_name);
}
#ifdef DBG_WM_CHARS
# define FPRINTF_WM_CHARS(ARG) fprintf ARG
#else
-# define FPRINTF_WM_CHARS(ARG) 0
+# define FPRINTF_WM_CHARS(ARG) (void)0
#endif
/* This is a heuristic only. This is supposed to track the state of the
&& console_modifiers & (RIGHT_CTRL_PRESSED | LEFT_CTRL_PRESSED))
{
type_CtrlAlt = "bB"; /* generic bindable Ctrl-Alt- modifiers */
- if (console_modifiers & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED)
+ if ((console_modifiers & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED))
== (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED))
/* double-Ctrl:
e.g. AltGr-rCtrl on some layouts (in this order!) */
type_CtrlAlt = "dD";
- else if (console_modifiers
- & (LEFT_CTRL_PRESSED | LEFT_ALT_PRESSED)
+ else if ((console_modifiers
+ & (LEFT_CTRL_PRESSED | LEFT_ALT_PRESSED))
== (LEFT_CTRL_PRESSED | LEFT_ALT_PRESSED))
type_CtrlAlt = "lL"; /* Ctrl-Alt- modifiers on the left */
else if (!NILP (Vw32_recognize_altgr)
- && (console_modifiers
- & (RIGHT_ALT_PRESSED | LEFT_CTRL_PRESSED))
+ && ((console_modifiers
+ & (RIGHT_ALT_PRESSED | LEFT_CTRL_PRESSED)))
== (RIGHT_ALT_PRESSED | LEFT_CTRL_PRESSED))
type_CtrlAlt = "gG"; /* modifiers as in AltGr */
}
else if (wmsg.dwModifiers & (alt_modifier | meta_modifier)
- || (console_modifiers
- & (LEFT_WIN_PRESSED | RIGHT_WIN_PRESSED
- | APPS_PRESSED | SCROLLLOCK_ON)))
+ || ((console_modifiers
+ & (LEFT_WIN_PRESSED | RIGHT_WIN_PRESSED
+ | APPS_PRESSED | SCROLLLOCK_ON))))
{
/* Pure Alt (or combination of Alt, Win, APPS, scrolllock. */
type_CtrlAlt = "aA";
unwind_create_frame (frame);
}
-static void
-unwind_create_frame_1 (Lisp_Object val)
-{
- inhibit_lisp_code = val;
-}
-
static void
x_default_font_parameter (struct frame *f, Lisp_Object parms)
{
CHECK_STRING (color);
- if (w32_defined_color (f, SDATA (color), &foo, false))
+ if (w32_defined_color (f, SSDATA (color), &foo, false))
return Qt;
else
return Qnil;
CHECK_STRING (color);
- if (w32_defined_color (f, SDATA (color), &foo, false))
+ if (w32_defined_color (f, SSDATA (color), &foo, false))
return list3i ((GetRValue (foo.pixel) << 8) | GetRValue (foo.pixel),
(GetGValue (foo.pixel) << 8) | GetGValue (foo.pixel),
(GetBValue (foo.pixel) << 8) | GetBValue (foo.pixel));
validate_x_resource_name ();
- dpyinfo = w32_term_init (name, (unsigned char *)0,
- SSDATA (Vx_resource_name));
+ dpyinfo = w32_term_init (name, NULL, SSDATA (Vx_resource_name));
if (dpyinfo == 0)
error ("Cannot connect to server %s", SDATA (name));
(In the Nextstep version, the last two arguments are currently ignored.) */)
(Lisp_Object display, Lisp_Object xrm_string, Lisp_Object must_succeed)
{
- unsigned char *xrm_option;
+ char *xrm_option;
struct w32_display_info *dpyinfo;
CHECK_STRING (display);
add_system_logical_colors_to_map (&Vw32_color_map);
if (! NILP (xrm_string))
- xrm_option = SDATA (xrm_string);
+ xrm_option = SSDATA (xrm_string);
else
- xrm_option = (unsigned char *) 0;
+ xrm_option = NULL;
/* Use this general default value to start with. */
/* First remove .exe suffix from invocation-name - it looks ugly. */
/* This is what opens the connection and sets x_current_display.
This also initializes many symbols, such as those used for input. */
- dpyinfo = w32_term_init (display, xrm_option,
- SSDATA (Vx_resource_name));
+ dpyinfo = w32_term_init (display, xrm_option, SSDATA (Vx_resource_name));
if (dpyinfo == 0)
{
struct frame *f;
Lisp_Object frame;
Lisp_Object name;
- long window_prompting = 0;
int width, height;
ptrdiff_t count = SPECPDL_INDEX ();
struct kboard *kb;
f->output_data.w32->dwStyle = WS_BORDER | WS_POPUP | WS_DISABLED;
f->output_data.w32->parent_desc = FRAME_DISPLAY_INFO (f)->root_window;
- window_prompting = x_figure_window_size (f, parms, true, &x_width, &x_height);
+ x_figure_window_size (f, parms, true, &x_width, &x_height);
/* No fringes on tip frame. */
f->fringe_cols = 0;
/* We modify these in-place, so make copies for safety. */
dir = Fcopy_sequence (dir);
- unixtodos_filename (SDATA (dir));
+ unixtodos_filename (SSDATA (dir));
filename = Fcopy_sequence (filename);
- unixtodos_filename (SDATA (filename));
+ unixtodos_filename (SSDATA (filename));
if (SBYTES (filename) >= MAX_UTF8_PATH)
report_file_error ("filename too long", default_filename);
if (w32_unicode_filenames)
encoded_file = ENCODE_FILE (filename);
- path = map_w32_filename (SDATA (encoded_file), NULL);
+ path = map_w32_filename (SSDATA (encoded_file), NULL);
/* The Unicode version of SHFileOperation is not supported on
Windows 9X. */
/* If a file cannot be represented in ANSI codepage, don't
let them inadvertently delete other files because some
characters are interpreted as a wildcards. */
- if (_mbspbrk (tmp_path_a, "?*"))
+ if (_mbspbrk ((unsigned char *)tmp_path_a,
+ (const unsigned char *)"?*"))
result = ERROR_FILE_NOT_FOUND;
else
{
c = Fcar (c);
if (!SYMBOLP (c))
emacs_abort ();
- vk_code = lookup_vk_code (SDATA (SYMBOL_NAME (c)));
+ vk_code = lookup_vk_code (SSDATA (SYMBOL_NAME (c)));
}
else if (INTEGERP (c))
{
char rootname[MAX_UTF8_PATH];
wchar_t rootname_w[MAX_PATH];
char rootname_a[MAX_PATH];
- char *name = SDATA (encoded);
+ char *name = SSDATA (encoded);
BOOL result;
/* find the root name of the volume if given */
event->uChar.UnicodeChar = buf[isdead - 1];
isdead = WideCharToMultiByte (cpId, 0, buf, isdead,
- ansi_code, 4, NULL, NULL);
+ (LPSTR)ansi_code, 4, NULL, NULL);
}
else
isdead = 0;
#include "lisp.h"
#include "w32term.h"
#include "frame.h"
-#include "dispextern.h"
-#include "character.h"
-#include "charset.h"
-#include "coding.h"
-#include "fontset.h"
-#include "font.h"
+#include "coding.h" /* for ENCODE_SYSTEM, DECODE_SYSTEM */
#include "w32font.h"
#ifdef WINDOWSNT
#include "w32.h"
Lisp_Object str = DECODE_SYSTEM (build_string (string));
ptrdiff_t len = SCHARS (str);
Lisp_Object obarray = check_obarray (Vobarray);
- Lisp_Object tem = oblookup (obarray, SDATA (str), len, len);
+ Lisp_Object tem = oblookup (obarray, SSDATA (str), len, len);
/* This code is similar to intern function from lread.c. */
return SYMBOLP (tem) ? tem : intern_driver (str, obarray, tem);
}
by a foundry, we accept raster fonts if the font name is found
anywhere within the full name. */
if ((logical_font->elfLogFont.lfOutPrecision == OUT_STRING_PRECIS
- && !strstr (logical_font->elfFullName,
+ && !strstr ((char *)logical_font->elfFullName,
logical_font->elfLogFont.lfFaceName))
/* Check for well known substitutions that mess things up in the
presence of Type-1 fonts of the same name. */
|| (!check_face_name (&logical_font->elfLogFont,
- logical_font->elfFullName)))
+ (char *)logical_font->elfFullName)))
return 1;
/* Make a font entity for the font. */
else if (EQ (charset, Qiso8859_1))
return ANSI_CHARSET;
else if (SYMBOLP (charset))
- return x_to_w32_charset (SDATA (SYMBOL_NAME (charset)));
+ return x_to_w32_charset (SSDATA (SYMBOL_NAME (charset)));
else
return DEFAULT_CHARSET;
}
|| !SYMBOLP (XCAR (XCDR (this_entry))))
continue;
- x_charset = SDATA (XCAR (this_entry));
+ x_charset = SSDATA (XCAR (this_entry));
w32_charset = XCAR (XCDR (this_entry));
codepage = XCDR (XCDR (this_entry));
else if (SYMBOLP (tmp))
{
strncpy (logfont->lfFaceName,
- SDATA (ENCODE_SYSTEM (SYMBOL_NAME (tmp))), LF_FACESIZE);
+ SSDATA (ENCODE_SYSTEM (SYMBOL_NAME (tmp))), LF_FACESIZE);
logfont->lfFaceName[LF_FACESIZE-1] = '\0';
}
}
if (NILP (family))
continue;
else if (SYMBOLP (family))
- name = SDATA (ENCODE_SYSTEM (SYMBOL_NAME (family)));
+ name = SSDATA (ENCODE_SYSTEM (SYMBOL_NAME (family)));
else
continue;
#include <sys/mman.h>
#include "w32common.h"
#include "w32heap.h"
-#include "lisp.h" /* for VALMASK */
+#include "lisp.h"
/* We chose to leave those declarations here. They are used only in
this file. The RtlCreateHeap is available since XP. It is located
#include "lisp.h"
#include "keyboard.h"
#include "frame.h"
-#include "dispextern.h"
-#include "window.h"
#include "blockinput.h"
-#include "termhooks.h"
-#include "termchar.h"
-#include "w32heap.h"
+#include "termchar.h" /* for Mouse_HLInfo, tty_display_info */
#include "w32term.h"
#include "w32inevt.h"
#include "lisp.h"
#include "keyboard.h"
-#include "keymap.h"
#include "frame.h"
-#include "termhooks.h"
-#include "window.h"
#include "blockinput.h"
-#include "character.h"
#include "buffer.h"
-#include "charset.h"
-#include "coding.h"
+#include "coding.h" /* for ENCODE_SYSTEM */
#include "menu.h"
/* This may include sys/types.h, and that somehow loses
#include <sys/types.h>
#endif
-#include "dispextern.h"
-
#include "w32common.h" /* for osinfo_cache */
#undef HAVE_DIALOGS /* TODO: Implement native dialogs. */
if (STRINGP (temp))
{
- char *utf8_text = SDATA (ENCODE_UTF_8 (temp));
+ char *utf8_text = SSDATA (ENCODE_UTF_8 (temp));
/* Be pessimistic about the number of characters needed.
Remember characters outside the BMP will take more than
one utf16 word, so we cannot simply use the character
length of temp. */
int utf8_len = strlen (utf8_text);
text = SAFE_ALLOCA ((utf8_len + 1) * sizeof (WCHAR));
- utf8to16 (utf8_text, utf8_len, text);
+ utf8to16 ((unsigned char *)utf8_text, utf8_len, text);
}
else
{
encoding so questions representable by the system codepage
are encoded properly. */
if (STRINGP (temp))
- text = SDATA (ENCODE_SYSTEM (temp));
+ text = SSDATA (ENCODE_SYSTEM (temp));
else
text = "";
else
utf16_string = SAFE_ALLOCA ((utf8_len + 1) * sizeof (WCHAR));
- utf8to16 (out_string, utf8_len, utf16_string);
+ utf8to16 ((unsigned char *)out_string, utf8_len, utf16_string);
return_value = unicode_append_menu (menu, fuFlags,
item != NULL ? (UINT_PTR) item
: (UINT_PTR) wv->call_data,
#include <ctype.h>
#include <io.h>
#include <fcntl.h>
+#include <unistd.h>
#include <signal.h>
#include <sys/file.h>
#include <mbstring.h>
#include "w32.h"
#include "w32common.h"
#include "w32heap.h"
-#include "systime.h"
-#include "syswait.h"
-#include "process.h"
+#include "syswait.h" /* for WNOHANG */
#include "syssignal.h"
#include "w32term.h"
-#include "dispextern.h" /* for xstrcasecmp */
#include "coding.h"
#define RVA_TO_PTR(var,section,filedata) \
return -1;
}
program = ENCODE_FILE (full);
- cmdname = SDATA (program);
+ cmdname = SSDATA (program);
}
else
{
/* We explicitly require that the command's file name be encodable
in the current ANSI codepage, because we will be invoking it via
the ANSI APIs. */
- if (_mbspbrk (cmdname_a, "?"))
+ if (_mbspbrk ((unsigned char *)cmdname_a, (const unsigned char *)"?"))
{
errno = ENOENT;
return -1;
filename = Fexpand_file_name (filename, Qnil);
/* luckily, this returns the short version of each element in the path. */
- if (w32_get_short_filename (SDATA (ENCODE_FILE (filename)),
+ if (w32_get_short_filename (SSDATA (ENCODE_FILE (filename)),
shortname, MAX_PATH) == 0)
return Qnil;
/* first expand it. */
filename = Fexpand_file_name (filename, Qnil);
- if (!w32_get_long_filename (SDATA (ENCODE_FILE (filename)), longname,
+ if (!w32_get_long_filename (SSDATA (ENCODE_FILE (filename)), longname,
MAX_UTF8_PATH))
return Qnil;
program = Fexpand_file_name (program, Qnil);
encoded_progname = ENCODE_FILE (program);
- progname = SDATA (encoded_progname);
+ progname = SSDATA (encoded_progname);
unixtodos_filename (progname);
filename_to_ansi (progname, progname_a);
/* Reject file names that cannot be encoded in the current ANSI
codepage. */
- if (_mbspbrk (progname_a, "?"))
+ if (_mbspbrk ((unsigned char *)progname_a, (const unsigned char *)"?"))
return Qunknown;
if (w32_executable_type (progname_a, &is_dos_app, &is_cygwin_app,
#include <config.h>
#include "lisp.h"
-#include "w32term.h"
+#include "w32term.h" /* for XrmDatabase, xrdb */
#include "blockinput.h"
#include <stdio.h>
return NULL;
}
-static LPBYTE
+static char *
w32_get_string_resource (const char *name, const char *class, DWORD dwexptype)
{
LPBYTE lpvalue = NULL;
/* Check if there are Windows specific defaults defined. */
return w32_get_rdb_resource (SYSTEM_DEFAULT_RESOURCES, name);
}
- return (lpvalue);
+ return (char *)lpvalue;
}
/* Retrieve the string resource specified by NAME with CLASS from
#include "lisp.h"
#include "w32common.h" /* os_subtype */
#include "w32term.h" /* for all of the w32 includes */
-#include "keyboard.h"
+#include "keyboard.h" /* for waiting_for_input */
#include "blockinput.h"
-#include "charset.h"
#include "coding.h"
-#include "composite.h"
#ifdef CYGWIN
#include <string.h>
cfg_clipboard_type = CF_TEXT;
/* Interpret the coding system symbol name */
- coding_name = SDATA (SYMBOL_NAME (cfg_coding_system));
+ coding_name = SSDATA (SYMBOL_NAME (cfg_coding_system));
/* "(.*-)?utf-16.*" -> CF_UNICODETEXT */
cp = strstr (coding_name, "utf-16");
{
int i;
- nbytes = strlen (src);
+ nbytes = strlen ((char *)src);
for (i = 0; i < nbytes; i++)
{
#include "blockinput.h"
#include "w32term.h"
-#include "systty.h"
-#include "systime.h"
-
#include <ctype.h>
#include <errno.h>
#include <sys/stat.h>
+#ifdef CYGWIN
+#include <fcntl.h> /* for O_RDWR */
+#endif
#include <imm.h>
-#include "charset.h"
-#include "character.h"
#include "coding.h"
-#include "ccl.h"
#include "frame.h"
-#include "dispextern.h"
#include "fontset.h"
#include "termhooks.h"
#include "termopts.h"
#include "termchar.h"
-#include "disptab.h"
#include "buffer.h"
#include "window.h"
#include "keyboard.h"
-#include "intervals.h"
-#include "process.h"
-#include "atimer.h"
-#include "keymap.h"
-#include "menu.h"
+#include "menu.h" /* for w32_menu_show */
#ifdef WINDOWSNT
#include "w32.h" /* for filename_from_utf16, filename_from_ansi */
-#include "w32heap.h"
#endif
#ifndef WINDOWSNT
#include "font.h"
#include "w32font.h"
+
+#if 0 /* TODO: stipple */
+#include "bitmaps/gray.xbm"
+#endif
\f
/* Fringe bitmaps. */
}
}
-static void
-set_frame_param (struct frame *f, Lisp_Object prop, Lisp_Object val)
-{
- register Lisp_Object old_alist_elt;
-
- old_alist_elt = Fassq (prop, f->param_alist);
- if (EQ (old_alist_elt, Qnil))
- fset_param_alist (f, Fcons (Fcons (prop, val), f->param_alist));
- else
- Fsetcdr (old_alist_elt, val);
-}
-
/* The main W32 event-reading loop - w32_read_socket. */
/* Record the last 100 characters stored
#include "lisp.h"
#include "w32term.h"
#include "frame.h"
-#include "dispextern.h"
-#include "character.h"
-#include "charset.h"
#include "composite.h"
-#include "fontset.h"
#include "font.h"
#include "w32font.h"
#include <config.h>
#include <signal.h>
#include <stdio.h>
+#include <windows.h>
+#include <windowsx.h>
#include "lisp.h"
-#include "keyboard.h"
#include "frame.h"
-#include "window.h"
-#include "charset.h"
-#include "fontset.h"
-#include "blockinput.h"
#include "w32term.h"
-#include "windowsx.h"
#define myalloc(cb) GlobalAllocPtr (GPTR, cb)
#define myfree(lp) GlobalFreePtr (lp)