if (g_b_init_is_windows_9x == 0)
{
g_b_init_is_windows_9x = 1;
- ZeroMemory(&os_ver, sizeof(OSVERSIONINFO));
- os_ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ ZeroMemory (&os_ver, sizeof (OSVERSIONINFO));
+ os_ver.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
if (GetVersionEx (&os_ver))
{
s_b_ret = (os_ver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS);
if (get_process_times_fn)
{
FILETIME create, exit, kernel, user;
- HANDLE proc = GetCurrentProcess();
+ HANDLE proc = GetCurrentProcess ();
if ((*get_process_times_fn) (proc, &create, &exit, &kernel, &user))
{
LARGE_INTEGER user_int, kernel_int, total;
/* ** The wrapper functions ** */
-BOOL WINAPI open_process_token (
- HANDLE ProcessHandle,
- DWORD DesiredAccess,
- PHANDLE TokenHandle)
+BOOL WINAPI
+open_process_token (HANDLE ProcessHandle,
+ DWORD DesiredAccess,
+ PHANDLE TokenHandle)
{
static OpenProcessToken_Proc s_pfn_Open_Process_Token = NULL;
HMODULE hm_advapi32 = NULL;
);
}
-BOOL WINAPI get_token_information (
- HANDLE TokenHandle,
- TOKEN_INFORMATION_CLASS TokenInformationClass,
- LPVOID TokenInformation,
- DWORD TokenInformationLength,
- PDWORD ReturnLength)
+BOOL WINAPI
+get_token_information (HANDLE TokenHandle,
+ TOKEN_INFORMATION_CLASS TokenInformationClass,
+ LPVOID TokenInformation,
+ DWORD TokenInformationLength,
+ PDWORD ReturnLength)
{
static GetTokenInformation_Proc s_pfn_Get_Token_Information = NULL;
HMODULE hm_advapi32 = NULL;
);
}
-BOOL WINAPI lookup_account_sid (
- LPCTSTR lpSystemName,
- PSID Sid,
- LPTSTR Name,
- LPDWORD cbName,
- LPTSTR DomainName,
- LPDWORD cbDomainName,
- PSID_NAME_USE peUse)
+BOOL WINAPI
+lookup_account_sid (LPCTSTR lpSystemName,
+ PSID Sid,
+ LPTSTR Name,
+ LPDWORD cbName,
+ LPTSTR DomainName,
+ LPDWORD cbDomainName,
+ PSID_NAME_USE peUse)
{
static LookupAccountSid_Proc s_pfn_Lookup_Account_Sid = NULL;
HMODULE hm_advapi32 = NULL;
);
}
-PSID_IDENTIFIER_AUTHORITY WINAPI get_sid_identifier_authority (
- PSID pSid)
+PSID_IDENTIFIER_AUTHORITY WINAPI
+get_sid_identifier_authority (PSID pSid)
{
static GetSidIdentifierAuthority_Proc s_pfn_Get_Sid_Identifier_Authority = NULL;
HMODULE hm_advapi32 = NULL;
return (s_pfn_Get_Sid_Identifier_Authority (pSid));
}
-PDWORD WINAPI get_sid_sub_authority (
- PSID pSid,
- DWORD n)
+PDWORD WINAPI
+get_sid_sub_authority (PSID pSid, DWORD n)
{
static GetSidSubAuthority_Proc s_pfn_Get_Sid_Sub_Authority = NULL;
static DWORD zero = 0U;
return (s_pfn_Get_Sid_Sub_Authority (pSid, n));
}
-PUCHAR WINAPI get_sid_sub_authority_count (
- PSID pSid)
+PUCHAR WINAPI
+get_sid_sub_authority_count (PSID pSid)
{
static GetSidSubAuthorityCount_Proc s_pfn_Get_Sid_Sub_Authority_Count = NULL;
static UCHAR zero = 0U;
return (s_pfn_Get_Sid_Sub_Authority_Count (pSid));
}
-BOOL WINAPI get_file_security (
- LPCTSTR lpFileName,
- SECURITY_INFORMATION RequestedInformation,
- PSECURITY_DESCRIPTOR pSecurityDescriptor,
- DWORD nLength,
- LPDWORD lpnLengthNeeded)
+BOOL WINAPI
+get_file_security (LPCTSTR lpFileName,
+ SECURITY_INFORMATION RequestedInformation,
+ PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ DWORD nLength,
+ LPDWORD lpnLengthNeeded)
{
static GetFileSecurity_Proc s_pfn_Get_File_Security = NULL;
HMODULE hm_advapi32 = NULL;
lpnLengthNeeded));
}
-BOOL WINAPI get_security_descriptor_owner (
- PSECURITY_DESCRIPTOR pSecurityDescriptor,
- PSID *pOwner,
- LPBOOL lpbOwnerDefaulted)
+BOOL WINAPI
+get_security_descriptor_owner (PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ PSID *pOwner,
+ LPBOOL lpbOwnerDefaulted)
{
static GetSecurityDescriptorOwner_Proc s_pfn_Get_Security_Descriptor_Owner = NULL;
HMODULE hm_advapi32 = NULL;
lpbOwnerDefaulted));
}
-BOOL WINAPI get_security_descriptor_group (
- PSECURITY_DESCRIPTOR pSecurityDescriptor,
- PSID *pGroup,
- LPBOOL lpbGroupDefaulted)
+BOOL WINAPI
+get_security_descriptor_group (PSECURITY_DESCRIPTOR pSecurityDescriptor,
+ PSID *pGroup,
+ LPBOOL lpbGroupDefaulted)
{
static GetSecurityDescriptorGroup_Proc s_pfn_Get_Security_Descriptor_Group = NULL;
HMODULE hm_advapi32 = NULL;
lpbGroupDefaulted));
}
-BOOL WINAPI is_valid_sid (
- PSID sid)
+BOOL WINAPI
+is_valid_sid (PSID sid)
{
static IsValidSid_Proc s_pfn_Is_Valid_Sid = NULL;
HMODULE hm_advapi32 = NULL;
return (s_pfn_Is_Valid_Sid (sid));
}
-BOOL WINAPI equal_sid (
- PSID sid1,
- PSID sid2)
+BOOL WINAPI
+equal_sid (PSID sid1, PSID sid2)
{
static EqualSid_Proc s_pfn_Equal_Sid = NULL;
HMODULE hm_advapi32 = NULL;
return (s_pfn_Equal_Sid (sid1, sid2));
}
-DWORD WINAPI get_length_sid (
- PSID sid)
+DWORD WINAPI
+get_length_sid (PSID sid)
{
static GetLengthSid_Proc s_pfn_Get_Length_Sid = NULL;
HMODULE hm_advapi32 = NULL;
return (s_pfn_Get_Length_Sid (sid));
}
-BOOL WINAPI copy_sid (
- DWORD destlen,
- PSID dest,
- PSID src)
+BOOL WINAPI
+copy_sid (DWORD destlen, PSID dest, PSID src)
{
static CopySid_Proc s_pfn_Copy_Sid = NULL;
HMODULE hm_advapi32 = NULL;
supported in Windows NT / 2k / XP
*/
-void WINAPI get_native_system_info (
- LPSYSTEM_INFO lpSystemInfo)
+void WINAPI
+get_native_system_info (LPSYSTEM_INFO lpSystemInfo)
{
static GetNativeSystemInfo_Proc s_pfn_Get_Native_System_Info = NULL;
if (is_windows_9x () != TRUE)
lpSystemInfo->dwNumberOfProcessors = -1;
}
-BOOL WINAPI get_system_times(
- LPFILETIME lpIdleTime,
- LPFILETIME lpKernelTime,
- LPFILETIME lpUserTime)
+BOOL WINAPI
+get_system_times (LPFILETIME lpIdleTime,
+ LPFILETIME lpKernelTime,
+ LPFILETIME lpUserTime)
{
static GetSystemTimes_Proc s_pfn_Get_System_times = NULL;
if (is_windows_9x () == TRUE)
for (p = modname; *p; p++)
if (*p == '\\') *p = '/';
- _snprintf (buf, sizeof(buf)-1, "emacs_dir=%s", modname);
+ _snprintf (buf, sizeof (buf)-1, "emacs_dir=%s", modname);
_putenv (strdup (buf));
}
/* Handle running emacs from the build directory: src/oo-spd/i386/ */
for (p = modname; *p; p++)
if (*p == '\\') *p = '/';
- _snprintf (buf, sizeof(buf)-1, "emacs_dir=%s", modname);
+ _snprintf (buf, sizeof (buf)-1, "emacs_dir=%s", modname);
_putenv (strdup (buf));
}
}
char buf1[SET_ENV_BUF_SIZE], buf2[SET_ENV_BUF_SIZE];
if (dwType == REG_EXPAND_SZ)
- ExpandEnvironmentStrings ((LPSTR) lpval, buf1, sizeof(buf1));
+ ExpandEnvironmentStrings ((LPSTR) lpval, buf1, sizeof (buf1));
else if (dwType == REG_SZ)
strcpy (buf1, lpval);
if (dwType == REG_EXPAND_SZ || dwType == REG_SZ)
{
- _snprintf (buf2, sizeof(buf2)-1, "%s=%s", env_vars[i].name,
+ _snprintf (buf2, sizeof (buf2)-1, "%s=%s", env_vars[i].name,
buf1);
_putenv (strdup (buf2));
}
involve network access, and so is extremely quick). */
/* Map drive letter to UNC if remote. */
- if ( isalpha( root_dir[0] ) && !fixed[ DRIVE_INDEX( root_dir[0] ) ] )
+ if ( isalpha (root_dir[0]) && !fixed[ DRIVE_INDEX (root_dir[0]) ] )
{
char remote_name[ 256 ];
char drive[3] = { root_dir[0], ':' };
nr.lpComment = NULL;
nr.lpProvider = NULL;
- result = WNetOpenEnum(RESOURCE_GLOBALNET, RESOURCETYPE_DISK,
- RESOURCEUSAGE_CONNECTABLE, &nr, &henum);
+ result = WNetOpenEnum (RESOURCE_GLOBALNET, RESOURCETYPE_DISK,
+ RESOURCEUSAGE_CONNECTABLE, &nr, &henum);
if (result == NO_ERROR)
return henum;
}
FILE *
-sys_fopen(const char * path, const char * mode)
+sys_fopen (const char * path, const char * mode)
{
int fd;
int oflag;
data.wid.dwStreamId = BACKUP_LINK;
data.wid.dwStreamAttributes = 0;
- data.wid.Size.LowPart = wlen * sizeof(WCHAR);
+ data.wid.Size.LowPart = wlen * sizeof (WCHAR);
data.wid.Size.HighPart = 0;
data.wid.dwStreamNameSize = 0;
if (!init)
{
- initialize_utc_base();
+ initialize_utc_base ();
init = 1;
}
char name[UNLEN+1];
DWORD name_len = sizeof (name);
char domain[1024];
- DWORD domain_len = sizeof(domain);
+ DWORD domain_len = sizeof (domain);
char *mp = NULL;
int use_dflt = 0;
int result;
}
static void
-get_file_owner_and_group (
- PSECURITY_DESCRIPTOR psd,
- const char *fname,
- struct stat *st)
+get_file_owner_and_group (PSECURITY_DESCRIPTOR psd,
+ const char *fname,
+ struct stat *st)
{
int dflt_usr = 0, dflt_grp = 0;
/* Helper wrapper functions. */
-HANDLE WINAPI create_toolhelp32_snapshot(
- DWORD Flags,
- DWORD Ignored)
+HANDLE WINAPI
+create_toolhelp32_snapshot (DWORD Flags, DWORD Ignored)
{
static CreateToolhelp32Snapshot_Proc s_pfn_Create_Toolhelp32_Snapshot = NULL;
return (s_pfn_Create_Toolhelp32_Snapshot (Flags, Ignored));
}
-BOOL WINAPI process32_first(
- HANDLE hSnapshot,
- LPPROCESSENTRY32 lppe)
+BOOL WINAPI
+process32_first (HANDLE hSnapshot, LPPROCESSENTRY32 lppe)
{
static Process32First_Proc s_pfn_Process32_First = NULL;
return (s_pfn_Process32_First (hSnapshot, lppe));
}
-BOOL WINAPI process32_next(
- HANDLE hSnapshot,
- LPPROCESSENTRY32 lppe)
+BOOL WINAPI
+process32_next (HANDLE hSnapshot, LPPROCESSENTRY32 lppe)
{
static Process32Next_Proc s_pfn_Process32_Next = NULL;
return (s_pfn_Process32_Next (hSnapshot, lppe));
}
-BOOL WINAPI open_thread_token (
- HANDLE ThreadHandle,
- DWORD DesiredAccess,
- BOOL OpenAsSelf,
- PHANDLE TokenHandle)
+BOOL WINAPI
+open_thread_token (HANDLE ThreadHandle,
+ DWORD DesiredAccess,
+ BOOL OpenAsSelf,
+ PHANDLE TokenHandle)
{
static OpenThreadToken_Proc s_pfn_Open_Thread_Token = NULL;
HMODULE hm_advapi32 = NULL;
);
}
-BOOL WINAPI impersonate_self (
- SECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
+BOOL WINAPI
+impersonate_self (SECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
{
static ImpersonateSelf_Proc s_pfn_Impersonate_Self = NULL;
HMODULE hm_advapi32 = NULL;
return s_pfn_Impersonate_Self (ImpersonationLevel);
}
-BOOL WINAPI revert_to_self (void)
+BOOL WINAPI
+revert_to_self (void)
{
static RevertToSelf_Proc s_pfn_Revert_To_Self = NULL;
HMODULE hm_advapi32 = NULL;
return s_pfn_Revert_To_Self ();
}
-BOOL WINAPI get_process_memory_info (
- HANDLE h_proc,
- PPROCESS_MEMORY_COUNTERS mem_counters,
- DWORD bufsize)
+BOOL WINAPI
+get_process_memory_info (HANDLE h_proc,
+ PPROCESS_MEMORY_COUNTERS mem_counters,
+ DWORD bufsize)
{
static GetProcessMemoryInfo_Proc s_pfn_Get_Process_Memory_Info = NULL;
HMODULE hm_psapi = NULL;
return s_pfn_Get_Process_Memory_Info (h_proc, mem_counters, bufsize);
}
-BOOL WINAPI get_process_working_set_size (
- HANDLE h_proc,
- DWORD *minrss,
- DWORD *maxrss)
+BOOL WINAPI
+get_process_working_set_size (HANDLE h_proc, DWORD *minrss, DWORD *maxrss)
{
static GetProcessWorkingSetSize_Proc
s_pfn_Get_Process_Working_Set_Size = NULL;
return s_pfn_Get_Process_Working_Set_Size (h_proc, minrss, maxrss);
}
-BOOL WINAPI global_memory_status (
- MEMORYSTATUS *buf)
+BOOL WINAPI
+global_memory_status (MEMORYSTATUS *buf)
{
static GlobalMemoryStatus_Proc s_pfn_Global_Memory_Status = NULL;
return s_pfn_Global_Memory_Status (buf);
}
-BOOL WINAPI global_memory_status_ex (
- MEMORY_STATUS_EX *buf)
+BOOL WINAPI
+global_memory_status_ex (MEMORY_STATUS_EX *buf)
{
static GlobalMemoryStatusEx_Proc s_pfn_Global_Memory_Status_Ex = NULL;
if (!h_proc
|| !get_process_times_fn
- || !(*get_process_times_fn)(h_proc, &ft_creation, &ft_exit,
- &ft_kernel, &ft_user))
+ || !(*get_process_times_fn) (h_proc, &ft_creation, &ft_exit,
+ &ft_kernel, &ft_user))
return 0;
GetSystemTimeAsFileTime (&ft_current);
if ((pfn_##fn = (void *) GetProcAddress (winsock_lib, #fn)) == NULL) \
goto fail;
- LOAD_PROC( WSAStartup );
- LOAD_PROC( WSASetLastError );
- LOAD_PROC( WSAGetLastError );
- LOAD_PROC( WSAEventSelect );
- LOAD_PROC( WSACreateEvent );
- LOAD_PROC( WSACloseEvent );
- LOAD_PROC( socket );
- LOAD_PROC( bind );
- LOAD_PROC( connect );
- LOAD_PROC( ioctlsocket );
- LOAD_PROC( recv );
- LOAD_PROC( send );
- LOAD_PROC( closesocket );
- LOAD_PROC( shutdown );
- LOAD_PROC( htons );
- LOAD_PROC( ntohs );
- LOAD_PROC( inet_addr );
- LOAD_PROC( gethostname );
- LOAD_PROC( gethostbyname );
- LOAD_PROC( getservbyname );
- LOAD_PROC( getpeername );
- LOAD_PROC( WSACleanup );
- LOAD_PROC( setsockopt );
- LOAD_PROC( listen );
- LOAD_PROC( getsockname );
- LOAD_PROC( accept );
- LOAD_PROC( recvfrom );
- LOAD_PROC( sendto );
+ LOAD_PROC (WSAStartup);
+ LOAD_PROC (WSASetLastError);
+ LOAD_PROC (WSAGetLastError);
+ LOAD_PROC (WSAEventSelect);
+ LOAD_PROC (WSACreateEvent);
+ LOAD_PROC (WSACloseEvent);
+ LOAD_PROC (socket);
+ LOAD_PROC (bind);
+ LOAD_PROC (connect);
+ LOAD_PROC (ioctlsocket);
+ LOAD_PROC (recv);
+ LOAD_PROC (send);
+ LOAD_PROC (closesocket);
+ LOAD_PROC (shutdown);
+ LOAD_PROC (htons);
+ LOAD_PROC (ntohs);
+ LOAD_PROC (inet_addr);
+ LOAD_PROC (gethostname);
+ LOAD_PROC (gethostbyname);
+ LOAD_PROC (getservbyname);
+ LOAD_PROC (getpeername);
+ LOAD_PROC (WSACleanup);
+ LOAD_PROC (setsockopt);
+ LOAD_PROC (listen);
+ LOAD_PROC (getsockname);
+ LOAD_PROC (accept);
+ LOAD_PROC (recvfrom);
+ LOAD_PROC (sendto);
#undef LOAD_PROC
/* specify version 1.1 of winsock */
};
char *
-sys_strerror(int error_no)
+sys_strerror (int error_no)
{
int i;
static char unknown_msg[40];
if (_wsa_errlist[i].errnum == error_no)
return _wsa_errlist[i].msg;
- sprintf(unknown_msg, "Unidentified error: %d", error_no);
+ sprintf (unknown_msg, "Unidentified error: %d", error_no);
return unknown_msg;
}
int socket_to_fd (SOCKET s);
int
-sys_socket(int af, int type, int protocol)
+sys_socket (int af, int type, int protocol)
{
SOCKET s;
}
struct hostent *
-sys_gethostbyname(const char * name)
+sys_gethostbyname (const char * name)
{
struct hostent * host;
}
struct servent *
-sys_getservbyname(const char * name, const char * proto)
+sys_getservbyname (const char * name, const char * proto)
{
struct servent * serv;
int
sys_recvfrom (int s, char * buf, int len, int flags,
- struct sockaddr * from, int * fromlen)
+ struct sockaddr * from, int * fromlen)
{
if (winsock_lib == NULL)
{
unsigned long nblock = 1;
int rc = pfn_ioctlsocket (SOCK_HANDLE (s), FIONBIO, &nblock);
if (rc == SOCKET_ERROR)
- set_errno();
+ set_errno ();
/* Keep track of the fact that we set this to non-blocking. */
fd_info[s].flags |= FILE_NDELAY;
return rc;
int res = pfn_recv (SOCK_HANDLE (fd), buffer, count, 0);
if (res == SOCKET_ERROR)
{
- DebPrint(("sys_read.recv failed with error %d on socket %ld\n",
- pfn_WSAGetLastError (), SOCK_HANDLE (fd)));
+ DebPrint (("sys_read.recv failed with error %d on socket %ld\n",
+ pfn_WSAGetLastError (), SOCK_HANDLE (fd)));
set_errno ();
return -1;
}
if (nchars == SOCKET_ERROR)
{
- DebPrint(("sys_write.send failed with error %d on socket %ld\n",
- pfn_WSAGetLastError (), SOCK_HANDLE (fd)));
+ DebPrint (("sys_write.send failed with error %d on socket %ld\n",
+ pfn_WSAGetLastError (), SOCK_HANDLE (fd)));
set_errno ();
}
}
shutdown_handler ensures that buffers' autosave files are
up to date when the user logs off, or the system shuts down.
*/
-BOOL WINAPI shutdown_handler(DWORD type)
+BOOL WINAPI
+shutdown_handler (DWORD type)
{
/* Ctrl-C and Ctrl-Break are already suppressed, so don't handle them. */
if (type == CTRL_CLOSE_EVENT /* User closes console window. */
console apps. This actually applies to Emacs in both console and
GUI modes, since we had to fool windows into thinking emacs is a
console application to get console mode to work. */
- SetConsoleCtrlHandler(shutdown_handler, TRUE);
+ SetConsoleCtrlHandler (shutdown_handler, TRUE);
/* "None" is the default group name on standalone workstations. */
strcpy (dflt_group_name, "None");
}
/* For make-serial-process */
-int serial_open (char *port)
+int
+serial_open (char *port)
{
HANDLE hnd;
child_process *cp;
/* For serial-process-configure */
void
-serial_configure (struct Lisp_Process *p,
- Lisp_Object contact)
+serial_configure (struct Lisp_Process *p, Lisp_Object contact)
{
Lisp_Object childp2 = Qnil;
Lisp_Object tem = Qnil;
}
}
-extern unsigned char *encode_terminal_code P_ ((struct glyph *, int,
+extern unsigned char *encode_terminal_code P_ ((struct glyph *, int,
struct coding_system *));
static void
FillConsoleOutputCharacter (cur_screen, ' ', n, dest, &r);
/* Now that the screen is clear, put the cursor at the top. */
SetConsoleCursorPosition (cur_screen, dest);
-
+
#ifdef USE_SEPARATE_SCREEN
SetConsoleActiveScreenBuffer (prev_screen);
#else
term->rif = 0; /* No window based redisplay on the console. */
term->cursor_to_hook = w32con_move_cursor;
- term->raw_cursor_to_hook = w32con_move_cursor;
- term->clear_to_end_hook = w32con_clear_to_end;
- term->clear_frame_hook = w32con_clear_frame;
+ term->raw_cursor_to_hook = w32con_move_cursor;
+ term->clear_to_end_hook = w32con_clear_to_end;
+ term->clear_frame_hook = w32con_clear_frame;
term->clear_end_of_line_hook = w32con_clear_end_of_line;
- term->ins_del_lines_hook = w32con_ins_del_lines;
- term->insert_glyphs_hook = w32con_insert_glyphs;
- term->write_glyphs_hook = w32con_write_glyphs;
- term->delete_glyphs_hook = w32con_delete_glyphs;
+ term->ins_del_lines_hook = w32con_ins_del_lines;
+ term->insert_glyphs_hook = w32con_insert_glyphs;
+ term->write_glyphs_hook = w32con_write_glyphs;
+ term->delete_glyphs_hook = w32con_delete_glyphs;
term->ring_bell_hook = w32_sys_ring_bell;
- term->reset_terminal_modes_hook = w32con_reset_terminal_modes;
+ term->reset_terminal_modes_hook = w32con_reset_terminal_modes;
term->set_terminal_modes_hook = w32con_set_terminal_modes;
- term->set_terminal_window_hook = w32con_set_terminal_window;
- term->update_begin_hook = w32con_update_begin;
+ term->set_terminal_window_hook = w32con_set_terminal_window;
+ term->update_begin_hook = w32con_update_begin;
term->update_end_hook = w32con_update_end;
term->read_socket_hook = w32_console_read_socket;
/* Respect setting of LINES and COLUMNS environment variables. */
{
- char * lines = getenv("LINES");
- char * columns = getenv("COLUMNS");
+ char * lines = getenv ("LINES");
+ char * columns = getenv ("COLUMNS");
if (lines != NULL && columns != NULL)
{
};
/* Reportedly, VS 6 does not have this in its headers. */
-#if defined(_MSC_VER) && _MSC_VER < 1300
+#if defined (_MSC_VER) && _MSC_VER < 1300
DECLARE_HANDLE(HMONITOR);
#endif
}
}
-
void x_set_scroll_bar_default_width (f)
struct frame *f;
{
wmsg.dwModifiers = w32_get_key_modifiers (wParam, lParam);
/* Get buffer size. */
size = get_composition_string_fn (context, GCS_RESULTSTR, buffer, 0);
- buffer = alloca(size);
+ buffer = alloca (size);
size = get_composition_string_fn (context, GCS_RESULTSTR,
buffer, size);
release_ime_context_fn (hwnd, context);
return DefWindowProc (hwnd, msg, wParam, lParam);
}
-
/* The most common default return code for handled messages is 0. */
return 0;
}
x_default_parameter (f, parameters, Qright_fringe, Qnil,
"rightFringe", "RightFringe", RES_TYPE_NUMBER);
-
/* Init faces before x_default_parameter is called for scroll-bar
parameters because that function calls x_set_scroll_bar_width,
which calls change_frame_size, which calls Fset_window_buffer,
/* Save clip region for later restoration. */
orig_clip = CreateRectRgn (0, 0, 0, 0);
- if (!GetClipRgn(s->hdc, orig_clip))
+ if (!GetClipRgn (s->hdc, orig_clip))
{
DeleteObject (orig_clip);
orig_clip = NULL;
return font_type == TRUETYPE_FONTTYPE ? Qiso10646_1 : Qunknown;
charset = w32_to_x_charset (w32_charset, NULL);
- return font_intern_prop (charset, strlen(charset), 1);
+ return font_intern_prop (charset, strlen (charset), 1);
}
static int
if (fnweight >= FW_NORMAL) return 100;
if (fnweight >= FW_LIGHT) return 50;
if (fnweight >= FW_EXTRALIGHT) return 40;
- if (fnweight > FW_THIN) return 20;
+ if (fnweight > FW_THIN) return 20;
return 0;
}
if (n >= 100) return FW_NORMAL;
if (n >= 50) return FW_LIGHT;
if (n >= 40) return FW_EXTRALIGHT;
- if (n >= 20) return FW_THIN;
+ if (n >= 20) return FW_THIN;
return 0;
}
int n;
{
if (n >= FW_EXTRABOLD) return intern ("black");
- if (n >= FW_BOLD) return intern ("bold");
- if (n >= FW_SEMIBOLD) return intern ("demibold");
- if (n >= FW_NORMAL) return intern ("medium");
+ if (n >= FW_BOLD) return intern ("bold");
+ if (n >= FW_SEMIBOLD) return intern ("demibold");
+ if (n >= FW_NORMAL) return intern ("medium");
return intern ("light");
}
logfont->lfPitchAndFamily = family | DEFAULT_PITCH;
}
-
/* Set pitch based on the spacing property. */
tmp = AREF (font_spec, FONT_SPACING_INDEX);
if (INTEGERP (tmp))
is written. If the buffer is not large enough to contain the name,
the function returns -1, otherwise it returns the number of bytes
written to FCNAME. */
-static int logfont_to_fcname(font, pointsize, fcname, size)
+static int
+logfont_to_fcname (font, pointsize, fcname, size)
LOGFONT* font;
int pointsize;
char *fcname;
sbrk (need_to_alloc);
}
-#if (_MSC_VER >= 1000 && _MSC_VER < 1300 && !defined(USE_CRT_DLL))
+#if (_MSC_VER >= 1000 && _MSC_VER < 1300 && !defined (USE_CRT_DLL))
/* MSVC 4.2 invokes these functions from mainCRTStartup to initialize
a heap via HeapCreate. They are normally defined by the runtime,
*part = 0;
SELECTED_FRAME ()->mouse_moved = 0;
- XSETINT(*x, movement_pos.X);
- XSETINT(*y, movement_pos.Y);
+ XSETINT (*x, movement_pos.X);
+ XSETINT (*y, movement_pos.Y);
*time = movement_time;
UNBLOCK_INPUT;
static Lisp_Object simple_dialog_show P_ ((FRAME_PTR, Lisp_Object, Lisp_Object));
#endif
-void w32_free_menu_strings P_((HWND));
+void w32_free_menu_strings P_ ((HWND));
\f
/* This is set nonzero after the user activates the menu bar, and set
Lisp_Object title, header;
char **error;
{
- int i, nb_buttons=0;
+ int i, nb_buttons = 0;
char dialog_name[6];
int menu_item_selection;
/* Frame title: 'Q' = Question, 'I' = Information.
Can also have 'E' = Error if, one day, we want
a popup for errors. */
- if (NILP(header))
+ if (NILP (header))
dialog_name[0] = 'Q';
else
dialog_name[0] = 'I';
anywhere in Emacs that uses the other specific dialog choices that
MessageBox provides. */
-static int is_simple_dialog (contents)
+static int
+is_simple_dialog (contents)
Lisp_Object contents;
{
Lisp_Object options = XCDR (contents);
return !(CONSP (options));
}
-static Lisp_Object simple_dialog_show (f, contents, header)
+static Lisp_Object
+simple_dialog_show (f, contents, header)
FRAME_PTR f;
Lisp_Object contents, header;
{
return (*name == '\0' || start + 2 == name);
}
-
/* Indicate boundary between left and right. */
static int
add_left_right_boundary (HMENU menu)
#endif /* HAVE_MENUS */
}
-void syms_of_w32menu ()
+void
+syms_of_w32menu ()
{
globals_of_w32menu ();
variable initialized is 0 and directly from main when initialized
is non zero.
*/
-void globals_of_w32menu ()
+void
+globals_of_w32menu ()
{
- /* See if Get/SetMenuItemInfo functions are available. */
+ /* See if Get/SetMenuItemInfo functions are available. */
HMODULE user32 = GetModuleHandle ("user32.dll");
get_menu_item_info = (GetMenuItemInfoA_Proc) GetProcAddress (user32, "GetMenuItemInfoA");
set_menu_item_info = (SetMenuItemInfoA_Proc) GetProcAddress (user32, "SetMenuItemInfoA");
#include <windows.h>
#ifdef __GNUC__
/* This definition is missing from mingw32 headers. */
-extern BOOL WINAPI IsValidLocale(LCID, DWORD);
+extern BOOL WINAPI IsValidLocale (LCID, DWORD);
#endif
#ifdef HAVE_LANGINFO_CODESET
child_process *cp;
DWORD id;
- for (cp = child_procs+(child_proc_count-1); cp >= child_procs; cp--)
+ for (cp = child_procs + (child_proc_count-1); cp >= child_procs; cp--)
if (!CHILD_ACTIVE (cp))
goto Initialise;
if (child_proc_count == MAX_CHILDREN)
cp = &child_procs[child_proc_count++];
Initialise:
- memset (cp, 0, sizeof(*cp));
+ memset (cp, 0, sizeof (*cp));
cp->fd = -1;
cp->pid = -1;
cp->procinfo.hProcess = NULL;
{
child_process *cp;
- for (cp = child_procs+(child_proc_count-1); cp >= child_procs; cp--)
+ for (cp = child_procs + (child_proc_count-1); cp >= child_procs; cp--)
if (CHILD_ACTIVE (cp) && pid == cp->pid)
return cp;
return NULL;
return TRUE;
EH_Fail:
- DebPrint (("create_child.CreateProcess failed: %ld\n", GetLastError()););
+ DebPrint (("create_child.CreateProcess failed: %ld\n", GetLastError ()););
return FALSE;
}
}
else
{
- for (cp = child_procs+(child_proc_count-1); cp >= child_procs; cp--)
+ for (cp = child_procs + (child_proc_count-1); cp >= child_procs; cp--)
/* some child_procs might be sockets; ignore them */
if (CHILD_ACTIVE (cp) && cp->procinfo.hProcess
&& (cp->fd < 0 || (fd_info[cp->fd].flags & FILE_AT_EOF) != 0))
escape_char = is_cygnus_app ? '"' : '\\';
}
- /* Cygwin apps needs quoting a bit more often */
+ /* Cygwin apps needs quoting a bit more often. */
if (escape_char == '"')
sepchars = "\r\n\t\f '";
count_children:
/* Add handles of child processes. */
nc = 0;
- for (cp = child_procs+(child_proc_count-1); cp >= child_procs; cp--)
+ for (cp = child_procs + (child_proc_count-1); cp >= child_procs; cp--)
/* Some child_procs might be sockets; ignore them. Also some
children may have died already, but we haven't finished reading
the process output; ignore them too. */
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)
+ (load_now)
Lisp_Object load_now;
{
int have_winsock;
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)
+ (filename)
Lisp_Object filename;
{
char longname[ MAX_PATH ];
any other symbol will be interpreted as normal.
If successful, the return value is t, otherwise nil. */)
- (process, priority)
+ (process, priority)
Lisp_Object process, priority;
{
HANDLE proc_handle = GetCurrentProcess ();
#ifdef HAVE_LANGINFO_CODESET
/* Emulation of nl_langinfo. Used in fns.c:Flocale_info. */
-char *nl_langinfo (nl_item item)
+char *
+nl_langinfo (nl_item item)
{
/* Conversion of Posix item numbers to their Windows equivalents. */
static const LCTYPE w32item[] = {
return make_number (GetThreadLocale ());
}
-DWORD int_from_hex (char * s)
+DWORD
+int_from_hex (char * s)
{
DWORD val = 0;
static char hex[] = "0123456789abcdefABCDEF";
char * p;
- while (*s && (p = strchr(hex, *s)) != NULL)
+ while (*s && (p = strchr (hex, *s)) != NULL)
{
unsigned digit = p - hex;
if (digit > 15)
function isn't given a context pointer. */
Lisp_Object Vw32_valid_locale_ids;
-BOOL CALLBACK enum_locale_fn (LPTSTR localeNum)
+BOOL CALLBACK
+enum_locale_fn (LPTSTR localeNum)
{
DWORD id = int_from_hex (localeNum);
Vw32_valid_locale_ids = Fcons (make_number (id), Vw32_valid_locale_ids);
function isn't given a context pointer. */
Lisp_Object Vw32_valid_codepages;
-BOOL CALLBACK enum_codepage_fn (LPTSTR codepageNum)
+BOOL CALLBACK
+enum_codepage_fn (LPTSTR codepageNum)
{
DWORD id = atoi (codepageNum);
Vw32_valid_codepages = Fcons (make_number (id), Vw32_valid_codepages);
}
\f
+void
syms_of_ntproc ()
{
DEFSYM (Qhigh, "high");
* (CF_UNICODETEXT), when a well-known console codepage is given, they
* apply to the console version of the clipboard data (CF_OEMTEXT),
* else they apply to the normal 8-bit text clipboard (CF_TEXT).
- *
+ *
* When pasting (getting data from the OS), the clipboard format that
* matches the {next-}selection-coding-system is retrieved. If
* Unicode is requested, but not available, 8-bit text (CF_TEXT) is
*
* Scenarios to use the facilities for customizing the selection
* coding system are:
- *
+ *
* ;; Generally use KOI8-R instead of the russian MS codepage for
* ;; the 8-bit clipboard.
* (set-selection-coding-system 'koi8-r-dos)
- *
+ *
* Or
- *
+ *
* ;; Create a special clipboard copy function that uses codepage
* ;; 1253 (Greek) to copy Greek text to a specific non-Unicode
* ;; application.
* types should be supported is also moved to Lisp, functionality
* could be expanded to CF_HTML, CF_RTF and maybe other types.
*/
-
+
#include <config.h>
#include <setjmp.h>
#include "lisp.h"
unsigned char *dst = NULL;
struct coding_system coding;
- ONTRACE (fprintf (stderr, "convert_to_handle_as_coded: %s\n",
+ ONTRACE (fprintf (stderr, "convert_to_handle_as_coded: %s\n",
SDATA (SYMBOL_NAME (coding_system))));
setup_windows_coding_system (coding_system, &coding);
- coding.dst_bytes = SBYTES(current_text) * 2;
+ coding.dst_bytes = SBYTES (current_text) * 2;
coding.destination = (unsigned char *) xmalloc (coding.dst_bytes);
encode_coding_object (&coding, current_text, 0, 0,
SCHARS (current_text), SBYTES (current_text), Qnil);
if (SetClipboardData (format, htext) == NULL)
{
- GlobalFree(htext);
+ GlobalFree (htext);
return Qnil;
}
if ((lcid_ptr = (LCID *) GlobalLock (hlocale)) == NULL)
{
- GlobalFree(hlocale);
+ GlobalFree (hlocale);
return Qnil;
}
if (SetClipboardData (CF_LOCALE, hlocale) == NULL)
{
- GlobalFree(hlocale);
+ GlobalFree (hlocale);
return Qnil;
}
automatic conversions anywhere else, so to get consistent
results, we probably don't want to rely on it here either. */
- render_locale();
+ render_locale ();
if (current_clipboard_type == CF_UNICODETEXT)
render (make_number (CF_TEXT));
&& EQ (cfg_coding_system, dos_coding_system))
return;
cfg_coding_system = dos_coding_system;
-
+
/* Set some sensible fallbacks */
cfg_codepage = ANSICP;
cfg_lcid = LOCALE_NEUTRAL;
cfg_clipboard_type = CF_TEXT;
return FALSE; /* Stop enumeration */
}
-
+
/* Is the wanted codepage the OEM codepage for this locale? */
codepage = cp_from_locale (lcid, CF_OEMTEXT);
if (codepage == cfg_codepage)
current_lcid = cfg_lcid;
current_num_nls = 0;
current_requires_encoding = 0;
-
+
BLOCK_INPUT;
/* Check for non-ASCII characters. While we are at it, count the
/* If we have something non-ASCII we may want to set a locale. We
do that directly (non-delayed), as it's just a small bit. */
if (ok)
- ok = !NILP(render_locale());
+ ok = !NILP (render_locale ());
if (ok)
{
/* If for some reason we don't have a clipboard_owner, we
just set the text format as chosen by the configuration
and than forget about the whole thing. */
- ok = !NILP(render (make_number (current_clipboard_type)));
+ ok = !NILP (render (make_number (current_clipboard_type)));
current_text = Qnil;
current_coding_system = Qnil;
}
struct coding_system coding;
Lisp_Object coding_system = Qnil;
Lisp_Object dos_coding_system;
-
+
/* `next-selection-coding-system' should override everything,
even when the locale passed by the system disagrees. The
only exception is when `next-selection-coding-system'
\(Those are literal upper-case symbol names, since that's what X expects.)
For convenience, the symbol nil is the same as `PRIMARY',
and t is the same as `SECONDARY'. */)
- (selection)
+ (selection)
Lisp_Object selection;
{
CHECK_SYMBOL (selection);
When sending or receiving text via cut_buffer, selection, and
clipboard, the text is encoded or decoded by this coding system.
The default value is the current system default encoding on 9x/Me and
-`utf-16le-dos' (Unicode) on NT/W2K/XP. */);
+`utf-16le-dos' (Unicode) on NT/W2K/XP. */);
/* The actual value is set dynamically in the dumped Emacs, see
below. */
Vselection_coding_system = Qnil;
gc->font = xgcv->font;
}
-XGCValues *XCreateGC (void * ignore, Window window, unsigned long mask,
- XGCValues *xgcv)
+XGCValues *
+XCreateGC (void * ignore, Window window, unsigned long mask,
+ XGCValues *xgcv)
{
XGCValues *gc = (XGCValues *) xmalloc (sizeof (XGCValues));
bzero (gc, sizeof (XGCValues));
void
XGetGCValues (void* ignore, XGCValues *gc,
- unsigned long mask, XGCValues *xgcv)
+ unsigned long mask, XGCValues *xgcv)
{
XChangeGC (ignore, xgcv, mask, gc);
}
{
}
-/* This is called when exiting or suspending Emacs. Exiting will make
+/* This is called when exiting or suspending Emacs. Exiting will make
the W32 windows go away, and suspending requires no action. */
static void
/* Draw strike-through. */
if (s->face->strike_through_p
- && !FONT_TEXTMETRIC(s->font).tmStruckOut)
+ && !FONT_TEXTMETRIC (s->font).tmStruckOut)
{
unsigned long h = 1;
unsigned long dy = (s->height - h) / 2;
return value;
}
-static int codepage_for_locale(LCID locale)
+static int
+codepage_for_locale (LCID locale)
{
char cp[20];
BLOCK_INPUT;
si.cbSize = sizeof (si);
si.fMask = SIF_POS | SIF_PAGE;
- GetScrollInfo(w, SB_CTL, &si);
+ GetScrollInfo (w, SB_CTL, &si);
near_bottom_p = si.nPos + si.nPage >= range;
UNBLOCK_INPUT;
if (!near_bottom_p)
temp_index = 0;
temp_buffer[temp_index++] = msg.msg.wParam;
inev.kind = MULTIMEDIA_KEY_EVENT;
- inev.code = GET_APPCOMMAND_LPARAM(msg.msg.lParam);
+ inev.code = GET_APPCOMMAND_LPARAM (msg.msg.lParam);
inev.modifiers = msg.dwModifiers;
XSETFRAME (inev.frame_or_window, f);
inev.timestamp = msg.msg.time;
selected now and last mouse movement event was
not in it. Minibuffer window will be selected
only when it is active. */
- if (WINDOWP(window)
+ if (WINDOWP (window)
&& !EQ (window, last_window)
&& !EQ (window, selected_window)
/* For click-to-focus window managers
inev.frame_or_window = window;
}
- last_window=window;
+ last_window = window;
}
if (!note_mouse_movement (f, &msg.msg))
help_echo_string = previous_help_echo_string;
rect.right = pixelwidth;
rect.bottom = pixelheight;
- AdjustWindowRect(&rect, f->output_data.w32->dwStyle,
- FRAME_EXTERNAL_MENU_BAR (f));
+ AdjustWindowRect (&rect, f->output_data.w32->dwStyle,
+ FRAME_EXTERNAL_MENU_BAR (f));
my_set_window_pos (FRAME_W32_WINDOW (f),
NULL,
/* Adjust vertical window position in order to avoid being
covered by a task bar placed at the bottom of the desktop. */
- SystemParametersInfo(SPI_GETWORKAREA, 0, &workarea_rect, 0);
- GetWindowRect(FRAME_W32_WINDOW(f), &window_rect);
+ SystemParametersInfo (SPI_GETWORKAREA, 0, &workarea_rect, 0);
+ GetWindowRect (FRAME_W32_WINDOW (f), &window_rect);
if (window_rect.bottom > workarea_rect.bottom
&& window_rect.top > workarea_rect.top)
f->top_pos = max (window_rect.top
}
dpyinfo->color_list = NULL;
if (dpyinfo->palette)
- DeleteObject(dpyinfo->palette);
+ DeleteObject (dpyinfo->palette);
}
xfree (dpyinfo->w32_id_name);
f = XFRAME (selected_frame);
context = get_frame_dc (f);
- old_font = SelectObject (context, FONT_HANDLE(font));
+ old_font = SelectObject (context, FONT_HANDLE (font));
features = otf_features (context, "GSUB");
XSETCAR (capability, features);
passed in. */
f = XFRAME (selected_frame);
context = get_frame_dc (f);
- old_font = SelectObject (context, FONT_HANDLE(font));
+ old_font = SelectObject (context, FONT_HANDLE (font));
result = ScriptShape (context, &(uniscribe_font->cache),
chars + items[i].iCharPos, nchars_in_run,
/* Cache not complete... */
f = XFRAME (selected_frame);
context = get_frame_dc (f);
- old_font = SelectObject (context, FONT_HANDLE(font));
+ old_font = SelectObject (context, FONT_HANDLE (font));
result = ScriptPlace (context, &(uniscribe_font->cache),
glyphs, nglyphs, attributes, &(items[i].a),
/* Cache incomplete... */
f = XFRAME (selected_frame);
context = get_frame_dc (f);
- old_font = SelectObject (context, FONT_HANDLE(font));
+ old_font = SelectObject (context, FONT_HANDLE (font));
result = ScriptGetGlyphABCWidth (context,
&(uniscribe_font->cache),
glyphs[j], &char_metric);
the frame. */
f = XFRAME (selected_frame);
context = get_frame_dc (f);
- old_font = SelectObject (context, FONT_HANDLE(font));
+ old_font = SelectObject (context, FONT_HANDLE (font));
result = ScriptShape (context, &(uniscribe_font->cache),
ch, len, 2, &(items[0].a),
glyphs, clusters, attrs, &nglyphs);
/* Check if font supports the otf script/language/features specified.
OTF_SPEC is in the format
(script lang [(gsub_feature ...)|nil] [(gpos_feature ...)]?) */
-int uniscribe_check_otf (font, otf_spec)
+int
+uniscribe_check_otf (font, otf_spec)
LOGFONT *font;
Lisp_Object otf_spec;
{
NULL, /* get_outline */
NULL, /* free_outline */
NULL, /* anchor_point */
- uniscribe_otf_capability, /* Defined so (font-get FONTOBJ :otf) works. */
+ uniscribe_otf_capability, /* Defined so (font-get FONTOBJ :otf) works. */
NULL, /* otf_drive - use shape instead. */
NULL, /* start_for_frame */
NULL, /* end_for_frame */
if (!UnionRect (&(lpmsg->rect), &(lpmsg->rect),
&(lpCur->w32msg.rect)))
{
- SetRectEmpty(&(lpmsg->rect));
+ SetRectEmpty (&(lpmsg->rect));
}
myfree (lpCur);
return (0);
strind = nextCharacter;
mask |= YNegative;
-
}
else
{
}
}
- /* If strind isn't at the end of the string the it's an invalid
+ /* If strind isn't at the end of the string then it's an invalid
geometry specification. */
if (*strind != '\0') return (0);