aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32.c
diff options
context:
space:
mode:
authorJuanma Barranquero2010-07-06 16:22:29 +0200
committerJuanma Barranquero2010-07-06 16:22:29 +0200
commitb56ceb92bf4d470af2e9172d1fcd4d85232c40a6 (patch)
tree50ab60b4715be45ed671c386c5b9336b45443539 /src/w32.c
parent7af07b967171736a35e0af8b6ecf6feb072184dc (diff)
downloademacs-b56ceb92bf4d470af2e9172d1fcd4d85232c40a6.tar.gz
emacs-b56ceb92bf4d470af2e9172d1fcd4d85232c40a6.zip
src/w32*.c: Convert function definitions to standard C.
Diffstat (limited to 'src/w32.c')
-rw-r--r--src/w32.c77
1 files changed, 34 insertions, 43 deletions
diff --git a/src/w32.c b/src/w32.c
index 0560ce4a6b8..e407959a2e6 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -148,7 +148,7 @@ extern Lisp_Object QCflowcontrol, Qhw, Qsw, QCsummary;
148typedef HRESULT (WINAPI * ShGetFolderPath_fn) 148typedef HRESULT (WINAPI * ShGetFolderPath_fn)
149 (IN HWND, IN int, IN HANDLE, IN DWORD, OUT char *); 149 (IN HWND, IN int, IN HANDLE, IN DWORD, OUT char *);
150 150
151void globals_of_w32 (); 151void globals_of_w32 (void);
152static DWORD get_rid (PSID); 152static DWORD get_rid (PSID);
153 153
154extern Lisp_Object Vw32_downcase_file_names; 154extern Lisp_Object Vw32_downcase_file_names;
@@ -308,7 +308,7 @@ typedef BOOL (WINAPI * GetSystemTimes_Proc) (
308 308
309 /* ** A utility function ** */ 309 /* ** A utility function ** */
310static BOOL 310static BOOL
311is_windows_9x () 311is_windows_9x (void)
312{ 312{
313 static BOOL s_b_ret=0; 313 static BOOL s_b_ret=0;
314 OSVERSIONINFO os_ver; 314 OSVERSIONINFO os_ver;
@@ -329,7 +329,7 @@ is_windows_9x ()
329 Returns a list of three integers if the times are provided by the OS 329 Returns a list of three integers if the times are provided by the OS
330 (NT derivatives), otherwise it returns the result of current-time. */ 330 (NT derivatives), otherwise it returns the result of current-time. */
331Lisp_Object 331Lisp_Object
332w32_get_internal_run_time () 332w32_get_internal_run_time (void)
333{ 333{
334 if (get_process_times_fn) 334 if (get_process_times_fn)
335 { 335 {
@@ -1035,13 +1035,13 @@ static struct group dflt_group =
1035}; 1035};
1036 1036
1037unsigned 1037unsigned
1038getuid () 1038getuid (void)
1039{ 1039{
1040 return dflt_passwd.pw_uid; 1040 return dflt_passwd.pw_uid;
1041} 1041}
1042 1042
1043unsigned 1043unsigned
1044geteuid () 1044geteuid (void)
1045{ 1045{
1046 /* I could imagine arguing for checking to see whether the user is 1046 /* I could imagine arguing for checking to see whether the user is
1047 in the Administrators group and returning a UID of 0 for that 1047 in the Administrators group and returning a UID of 0 for that
@@ -1050,13 +1050,13 @@ geteuid ()
1050} 1050}
1051 1051
1052unsigned 1052unsigned
1053getgid () 1053getgid (void)
1054{ 1054{
1055 return dflt_passwd.pw_gid; 1055 return dflt_passwd.pw_gid;
1056} 1056}
1057 1057
1058unsigned 1058unsigned
1059getegid () 1059getegid (void)
1060{ 1060{
1061 return getgid (); 1061 return getgid ();
1062} 1062}
@@ -1091,7 +1091,7 @@ getpwnam (char *name)
1091} 1091}
1092 1092
1093void 1093void
1094init_user_info () 1094init_user_info (void)
1095{ 1095{
1096 /* Find the user's real name by opening the process token and 1096 /* Find the user's real name by opening the process token and
1097 looking up the name associated with the user-sid in that token. 1097 looking up the name associated with the user-sid in that token.
@@ -1207,7 +1207,7 @@ init_user_info ()
1207} 1207}
1208 1208
1209int 1209int
1210random () 1210random (void)
1211{ 1211{
1212 /* rand () on NT gives us 15 random bits...hack together 30 bits. */ 1212 /* rand () on NT gives us 15 random bits...hack together 30 bits. */
1213 return ((rand () << 15) | rand ()); 1213 return ((rand () << 15) | rand ());
@@ -1225,9 +1225,7 @@ srandom (int seed)
1225 case path name components to lower case. */ 1225 case path name components to lower case. */
1226 1226
1227static void 1227static void
1228normalize_filename (fp, path_sep) 1228normalize_filename (register char *fp, char path_sep)
1229 register char *fp;
1230 char path_sep;
1231{ 1229{
1232 char sep; 1230 char sep;
1233 char *elem; 1231 char *elem;
@@ -1283,16 +1281,14 @@ normalize_filename (fp, path_sep)
1283 1281
1284/* Destructively turn backslashes into slashes. */ 1282/* Destructively turn backslashes into slashes. */
1285void 1283void
1286dostounix_filename (p) 1284dostounix_filename (register char *p)
1287 register char *p;
1288{ 1285{
1289 normalize_filename (p, '/'); 1286 normalize_filename (p, '/');
1290} 1287}
1291 1288
1292/* Destructively turn slashes into backslashes. */ 1289/* Destructively turn slashes into backslashes. */
1293void 1290void
1294unixtodos_filename (p) 1291unixtodos_filename (register char *p)
1295 register char *p;
1296{ 1292{
1297 normalize_filename (p, '\\'); 1293 normalize_filename (p, '\\');
1298} 1294}
@@ -1301,9 +1297,7 @@ unixtodos_filename (p)
1301 (From msdos.c...probably should figure out a way to share it, 1297 (From msdos.c...probably should figure out a way to share it,
1302 although this code isn't going to ever change.) */ 1298 although this code isn't going to ever change.) */
1303int 1299int
1304crlf_to_lf (n, buf) 1300crlf_to_lf (register int n, register unsigned char *buf)
1305 register int n;
1306 register unsigned char *buf;
1307{ 1301{
1308 unsigned char *np = buf; 1302 unsigned char *np = buf;
1309 unsigned char *startp = buf; 1303 unsigned char *startp = buf;
@@ -1520,9 +1514,7 @@ alarm (int seconds)
1520#define REG_ROOT "SOFTWARE\\GNU\\Emacs" 1514#define REG_ROOT "SOFTWARE\\GNU\\Emacs"
1521 1515
1522LPBYTE 1516LPBYTE
1523w32_get_resource (key, lpdwtype) 1517w32_get_resource (char *key, LPDWORD lpdwtype)
1524 char *key;
1525 LPDWORD lpdwtype;
1526{ 1518{
1527 LPBYTE lpvalue; 1519 LPBYTE lpvalue;
1528 HKEY hrootkey = NULL; 1520 HKEY hrootkey = NULL;
@@ -2691,7 +2683,7 @@ sys_creat (const char * path, int mode)
2691} 2683}
2692 2684
2693FILE * 2685FILE *
2694sys_fopen(const char * path, const char * mode) 2686sys_fopen (const char * path, const char * mode)
2695{ 2687{
2696 int fd; 2688 int fd;
2697 int oflag; 2689 int oflag;
@@ -2980,7 +2972,7 @@ static int init = 0;
2980 } while (0) 2972 } while (0)
2981 2973
2982static void 2974static void
2983initialize_utc_base () 2975initialize_utc_base (void)
2984{ 2976{
2985 /* Determine the delta between 1-Jan-1601 and 1-Jan-1970. */ 2977 /* Determine the delta between 1-Jan-1601 and 1-Jan-1970. */
2986 SYSTEMTIME st; 2978 SYSTEMTIME st;
@@ -3904,7 +3896,7 @@ BOOL WINAPI global_memory_status_ex (
3904} 3896}
3905 3897
3906Lisp_Object 3898Lisp_Object
3907list_system_processes () 3899list_system_processes (void)
3908{ 3900{
3909 struct gcpro gcpro1; 3901 struct gcpro gcpro1;
3910 Lisp_Object proclist = Qnil; 3902 Lisp_Object proclist = Qnil;
@@ -3995,8 +3987,7 @@ restore_privilege (TOKEN_PRIVILEGES *priv)
3995} 3987}
3996 3988
3997static Lisp_Object 3989static Lisp_Object
3998ltime (time_sec, time_usec) 3990ltime (long time_sec, long time_usec)
3999 long time_sec, time_usec;
4000{ 3991{
4001 return list3 (make_number ((time_sec >> 16) & 0xffff), 3992 return list3 (make_number ((time_sec >> 16) & 0xffff),
4002 make_number (time_sec & 0xffff), 3993 make_number (time_sec & 0xffff),
@@ -4006,10 +3997,9 @@ ltime (time_sec, time_usec)
4006#define U64_TO_LISP_TIME(time) ltime ((time) / 1000000L, (time) % 1000000L) 3997#define U64_TO_LISP_TIME(time) ltime ((time) / 1000000L, (time) % 1000000L)
4007 3998
4008static int 3999static int
4009process_times (h_proc, ctime, etime, stime, utime, ttime, pcpu) 4000process_times (HANDLE h_proc, Lisp_Object *ctime, Lisp_Object *etime,
4010 HANDLE h_proc; 4001 Lisp_Object *stime, Lisp_Object *utime, Lisp_Object *ttime,
4011 Lisp_Object *ctime, *etime, *stime, *utime, *ttime; 4002 double *pcpu)
4012 double *pcpu;
4013{ 4003{
4014 FILETIME ft_creation, ft_exit, ft_kernel, ft_user, ft_current; 4004 FILETIME ft_creation, ft_exit, ft_kernel, ft_user, ft_current;
4015 ULONGLONG tem1, tem2, tem3, tem; 4005 ULONGLONG tem1, tem2, tem3, tem;
@@ -4059,8 +4049,7 @@ process_times (h_proc, ctime, etime, stime, utime, ttime, pcpu)
4059} 4049}
4060 4050
4061Lisp_Object 4051Lisp_Object
4062system_process_attributes (pid) 4052system_process_attributes (Lisp_Object pid)
4063 Lisp_Object pid;
4064{ 4053{
4065 struct gcpro gcpro1, gcpro2, gcpro3; 4054 struct gcpro gcpro1, gcpro2, gcpro3;
4066 Lisp_Object attrs = Qnil; 4055 Lisp_Object attrs = Qnil;
@@ -4526,7 +4515,7 @@ int h_errno = 0;
4526 normal system codes where they overlap (non-overlapping definitions 4515 normal system codes where they overlap (non-overlapping definitions
4527 are already in <sys/socket.h> */ 4516 are already in <sys/socket.h> */
4528static void 4517static void
4529set_errno () 4518set_errno (void)
4530{ 4519{
4531 if (winsock_lib == NULL) 4520 if (winsock_lib == NULL)
4532 h_errno = EINVAL; 4521 h_errno = EINVAL;
@@ -4548,7 +4537,7 @@ set_errno ()
4548} 4537}
4549 4538
4550static void 4539static void
4551check_errno () 4540check_errno (void)
4552{ 4541{
4553 if (h_errno == 0 && winsock_lib != NULL) 4542 if (h_errno == 0 && winsock_lib != NULL)
4554 pfn_WSASetLastError (0); 4543 pfn_WSASetLastError (0);
@@ -5038,7 +5027,7 @@ sys_accept (int s, struct sockaddr * addr, int * addrlen)
5038 5027
5039int 5028int
5040sys_recvfrom (int s, char * buf, int len, int flags, 5029sys_recvfrom (int s, char * buf, int len, int flags,
5041 struct sockaddr * from, int * fromlen) 5030 struct sockaddr * from, int * fromlen)
5042{ 5031{
5043 if (winsock_lib == NULL) 5032 if (winsock_lib == NULL)
5044 { 5033 {
@@ -5733,7 +5722,7 @@ sys_write (int fd, const void * buffer, unsigned int count)
5733} 5722}
5734 5723
5735static void 5724static void
5736check_windows_init_file () 5725check_windows_init_file (void)
5737{ 5726{
5738 extern int noninteractive, inhibit_window_system; 5727 extern int noninteractive, inhibit_window_system;
5739 5728
@@ -5789,7 +5778,7 @@ check_windows_init_file ()
5789} 5778}
5790 5779
5791void 5780void
5792term_ntproc () 5781term_ntproc (void)
5793{ 5782{
5794#ifdef HAVE_SOCKETS 5783#ifdef HAVE_SOCKETS
5795 /* shutdown the socket interface if necessary */ 5784 /* shutdown the socket interface if necessary */
@@ -5800,7 +5789,7 @@ term_ntproc ()
5800} 5789}
5801 5790
5802void 5791void
5803init_ntproc () 5792init_ntproc (void)
5804{ 5793{
5805#ifdef HAVE_SOCKETS 5794#ifdef HAVE_SOCKETS
5806 /* Initialise the socket interface now if available and requested by 5795 /* Initialise the socket interface now if available and requested by
@@ -5908,7 +5897,8 @@ init_ntproc ()
5908 shutdown_handler ensures that buffers' autosave files are 5897 shutdown_handler ensures that buffers' autosave files are
5909 up to date when the user logs off, or the system shuts down. 5898 up to date when the user logs off, or the system shuts down.
5910*/ 5899*/
5911BOOL WINAPI shutdown_handler(DWORD type) 5900BOOL WINAPI
5901shutdown_handler(DWORD type)
5912{ 5902{
5913 /* Ctrl-C and Ctrl-Break are already suppressed, so don't handle them. */ 5903 /* Ctrl-C and Ctrl-Break are already suppressed, so don't handle them. */
5914 if (type == CTRL_CLOSE_EVENT /* User closes console window. */ 5904 if (type == CTRL_CLOSE_EVENT /* User closes console window. */
@@ -5929,7 +5919,7 @@ BOOL WINAPI shutdown_handler(DWORD type)
5929 initialized is non zero (see the function main in emacs.c). 5919 initialized is non zero (see the function main in emacs.c).
5930*/ 5920*/
5931void 5921void
5932globals_of_w32 () 5922globals_of_w32 (void)
5933{ 5923{
5934 HMODULE kernel32 = GetModuleHandle ("kernel32.dll"); 5924 HMODULE kernel32 = GetModuleHandle ("kernel32.dll");
5935 5925
@@ -5974,7 +5964,8 @@ globals_of_w32 ()
5974} 5964}
5975 5965
5976/* For make-serial-process */ 5966/* For make-serial-process */
5977int serial_open (char *port) 5967int
5968serial_open (char *port)
5978{ 5969{
5979 HANDLE hnd; 5970 HANDLE hnd;
5980 child_process *cp; 5971 child_process *cp;
@@ -6014,7 +6005,7 @@ int serial_open (char *port)
6014/* For serial-process-configure */ 6005/* For serial-process-configure */
6015void 6006void
6016serial_configure (struct Lisp_Process *p, 6007serial_configure (struct Lisp_Process *p,
6017 Lisp_Object contact) 6008 Lisp_Object contact)
6018{ 6009{
6019 Lisp_Object childp2 = Qnil; 6010 Lisp_Object childp2 = Qnil;
6020 Lisp_Object tem = Qnil; 6011 Lisp_Object tem = Qnil;