Mercurial > emacs
diff src/process.c @ 109144:7dceae91724c
Convert most remaining function definitions to standard C.
* buffer.c, cm.c, eval.c, keyboard.c, process.c, term.c, vm-limit.c,
* xdisp.c: Convert function definitions to standard C.
* cm.c (cmputc): Arg C is now int, not char.
* process.c (Fmake_network_process): Cast sockaddr_in* to sockaddr*.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Mon, 05 Jul 2010 12:36:06 +0200 |
parents | 2bc9a0c04c87 |
children | d0090a8b66c3 |
line wrap: on
line diff
--- a/src/process.c Mon Jul 05 12:28:27 2010 +0200 +++ b/src/process.c Mon Jul 05 12:36:06 2010 +0200 @@ -297,8 +297,8 @@ #define POLL_FOR_INPUT #endif -static Lisp_Object get_process (); -static void exec_sentinel (); +static Lisp_Object get_process (register Lisp_Object name); +static void exec_sentinel (Lisp_Object proc, Lisp_Object reason); extern int timers_run; @@ -399,8 +399,7 @@ static Lisp_Object status_convert (int); static void -update_status (p) - struct Lisp_Process *p; +update_status (struct Lisp_Process *p) { eassert (p->raw_status_new); p->status = status_convert (p->raw_status); @@ -429,11 +428,7 @@ and store them individually through the three pointers. */ static void -decode_status (l, symbol, code, coredump) - Lisp_Object l; - Lisp_Object *symbol; - int *code; - int *coredump; +decode_status (Lisp_Object l, Lisp_Object *symbol, int *code, int *coredump) { Lisp_Object tem; @@ -456,8 +451,7 @@ /* Return a string describing a process status list. */ static Lisp_Object -status_message (p) - struct Lisp_Process *p; +status_message (struct Lisp_Process *p) { Lisp_Object status = p->status; Lisp_Object symbol; @@ -519,7 +513,7 @@ is left in the variable pty_name. */ static int -allocate_pty () +allocate_pty (void) { register int c, i; int fd; @@ -593,8 +587,7 @@ #endif /* HAVE_PTYS */ static Lisp_Object -make_process (name) - Lisp_Object name; +make_process (Lisp_Object name) { register Lisp_Object val, tem, name1; register struct Lisp_Process *p; @@ -638,8 +631,7 @@ } static void -remove_process (proc) - register Lisp_Object proc; +remove_process (register Lisp_Object proc) { register Lisp_Object pair; @@ -652,8 +644,7 @@ /* Setup coding systems of PROCESS. */ void -setup_process_coding_systems (process) - Lisp_Object process; +setup_process_coding_systems (Lisp_Object process) { struct Lisp_Process *p = XPROCESS (process); int inch = p->infd; @@ -729,8 +720,7 @@ current buffer. */ static Lisp_Object -get_process (name) - register Lisp_Object name; +get_process (register Lisp_Object name) { register Lisp_Object proc, obj; if (STRINGP (name)) @@ -1161,7 +1151,7 @@ } #ifdef DATAGRAM_SOCKETS -Lisp_Object Fprocess_datagram_address (); +Lisp_Object Fprocess_datagram_address (Lisp_Object process); #endif DEFUN ("process-contact", Fprocess_contact, Sprocess_contact, @@ -1327,8 +1317,7 @@ #endif static Lisp_Object -list_processes_1 (query_only) - Lisp_Object query_only; +list_processes_1 (Lisp_Object query_only) { register Lisp_Object tail, tem; Lisp_Object proc, minspace, tem1; @@ -1579,7 +1568,7 @@ /* Starting asynchronous inferior processes. */ -static Lisp_Object start_process_unwind (); +static Lisp_Object start_process_unwind (Lisp_Object proc); DEFUN ("start-process", Fstart_process, Sstart_process, 3, MANY, 0, doc: /* Start a program in a subprocess. Return the process object for it. @@ -1814,8 +1803,7 @@ an error and the process wasn't started successfully, so we should remove it from the process list. */ static Lisp_Object -start_process_unwind (proc) - Lisp_Object proc; +start_process_unwind (Lisp_Object proc) { if (!PROCESSP (proc)) abort (); @@ -1828,8 +1816,7 @@ } static void -create_process_1 (timer) - struct atimer *timer; +create_process_1 (struct atimer *timer) { /* Nothing to do. */ } @@ -1855,10 +1842,7 @@ #endif void -create_process (process, new_argv, current_dir) - Lisp_Object process; - char **new_argv; - Lisp_Object current_dir; +create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) { int inchannel, outchannel; pid_t pid; @@ -2245,8 +2229,7 @@ } void -create_pty (process) - Lisp_Object process; +create_pty (Lisp_Object process) { int inchannel, outchannel; @@ -2333,9 +2316,7 @@ The address family of sa is not included in the result. */ static Lisp_Object -conv_sockaddr_to_lisp (sa, len) - struct sockaddr *sa; - int len; +conv_sockaddr_to_lisp (struct sockaddr *sa, int len) { Lisp_Object address; int i; @@ -2404,9 +2385,7 @@ /* Get family and required size for sockaddr structure to hold ADDRESS. */ static int -get_lisp_to_sockaddr_size (address, familyp) - Lisp_Object address; - int *familyp; +get_lisp_to_sockaddr_size (Lisp_Object address, int *familyp) { register struct Lisp_Vector *p; @@ -2451,11 +2430,7 @@ we return after zeroing *SA. */ static void -conv_lisp_to_sockaddr (family, address, sa, len) - int family; - Lisp_Object address; - struct sockaddr *sa; - int len; +conv_lisp_to_sockaddr (int family, Lisp_Object address, struct sockaddr *sa, int len) { register struct Lisp_Vector *p; register unsigned char *cp = NULL; @@ -2612,9 +2587,7 @@ */ static int -set_socket_option (s, opt, val) - int s; - Lisp_Object opt, val; +set_socket_option (int s, Lisp_Object opt, Lisp_Object val) { char *name; const struct socket_options *sopt; @@ -3701,7 +3674,7 @@ int len1 = sizeof (sa1); if (getsockname (s, (struct sockaddr *)&sa1, &len1) == 0) contact = Fplist_put (contact, QClocal, - conv_sockaddr_to_lisp (&sa1, len1)); + conv_sockaddr_to_lisp ((struct sockaddr *)&sa1, len1)); } #endif } @@ -4154,8 +4127,7 @@ /* Turn off input and output for process PROC. */ void -deactivate_process (proc) - Lisp_Object proc; +deactivate_process (Lisp_Object proc) { register int inchannel, outchannel; register struct Lisp_Process *p = XPROCESS (proc); @@ -4220,7 +4192,7 @@ to get rid of irrelevant descriptors. */ void -close_process_descs () +close_process_descs (void) { #ifndef WINDOWSNT int i; @@ -4313,9 +4285,7 @@ static int connect_counter = 0; static void -server_accept_connection (server, channel) - Lisp_Object server; - int channel; +server_accept_connection (Lisp_Object server, int channel) { Lisp_Object proc, caller, name, buffer; Lisp_Object contact, host, service; @@ -4531,8 +4501,7 @@ static int waiting_for_user_input_p; static Lisp_Object -wait_reading_process_output_unwind (data) - Lisp_Object data; +wait_reading_process_output_unwind (Lisp_Object data) { waiting_for_user_input_p = XINT (data); return Qnil; @@ -4540,7 +4509,7 @@ /* This is here so breakpoints can be put on it. */ static void -wait_reading_process_output_1 () +wait_reading_process_output_1 (void) { } @@ -4553,10 +4522,7 @@ #ifndef select static INLINE int -select_wrapper (n, rfd, wfd, xfd, tmo) - int n; - SELECT_TYPE *rfd, *wfd, *xfd; - EMACS_TIME *tmo; +select_wrapper (int n, fd_set *rfd, fd_set *wfd, fd_set *xfd, struct timeval *tmo) { return select (n, rfd, wfd, xfd, tmo); } @@ -5261,15 +5227,13 @@ /* Given a list (FUNCTION ARGS...), apply FUNCTION to the ARGS. */ static Lisp_Object -read_process_output_call (fun_and_args) - Lisp_Object fun_and_args; +read_process_output_call (Lisp_Object fun_and_args) { return apply1 (XCAR (fun_and_args), XCDR (fun_and_args)); } static Lisp_Object -read_process_output_error_handler (error) - Lisp_Object error; +read_process_output_error_handler (Lisp_Object error) { cmd_error_internal (error, "error in process filter: "); Vinhibit_quit = Qt; @@ -5290,9 +5254,7 @@ for decoding. */ static int -read_process_output (proc, channel) - Lisp_Object proc; - register int channel; +read_process_output (Lisp_Object proc, register int channel) { register int nbytes; char *chars; @@ -5618,7 +5580,7 @@ Lisp_Object process_sent_to; SIGTYPE -send_process_trap () +send_process_trap (int ignore) { SIGNAL_THREAD_CHECK (SIGPIPE); sigunblock (sigmask (SIGPIPE)); @@ -5636,11 +5598,8 @@ This function can evaluate Lisp code and can garbage collect. */ static void -send_process (proc, buf, len, object) - volatile Lisp_Object proc; - unsigned char *volatile buf; - volatile int len; - volatile Lisp_Object object; +send_process (volatile Lisp_Object proc, unsigned char *volatile buf, + volatile int len, volatile Lisp_Object object) { /* Use volatile to protect variables from being clobbered by longjmp. */ struct Lisp_Process *p = XPROCESS (proc); @@ -5927,8 +5886,7 @@ /* Return the foreground process group for the tty/pty that the process P uses. */ static int -emacs_get_tty_pgrp (p) - struct Lisp_Process *p; +emacs_get_tty_pgrp (struct Lisp_Process *p) { int gid = -1; @@ -5997,11 +5955,8 @@ their uid, for which killpg would return an EPERM error. */ static void -process_send_signal (process, signo, current_group, nomsg) - Lisp_Object process; - int signo; - Lisp_Object current_group; - int nomsg; +process_send_signal (Lisp_Object process, int signo, Lisp_Object current_group, + int nomsg) { Lisp_Object proc; register struct Lisp_Process *p; @@ -6570,8 +6525,7 @@ If `buffer' is nil, kill all processes */ void -kill_buffer_processes (buffer) - Lisp_Object buffer; +kill_buffer_processes (Lisp_Object buffer) { Lisp_Object tail, proc; @@ -6616,8 +6570,7 @@ #ifdef SIGCHLD SIGTYPE -sigchld_handler (signo) - int signo; +sigchld_handler (int signo) { int old_errno = errno; Lisp_Object proc; @@ -6758,16 +6711,14 @@ static Lisp_Object -exec_sentinel_unwind (data) - Lisp_Object data; +exec_sentinel_unwind (Lisp_Object data) { XPROCESS (XCAR (data))->sentinel = XCDR (data); return Qnil; } static Lisp_Object -exec_sentinel_error_handler (error) - Lisp_Object error; +exec_sentinel_error_handler (Lisp_Object error) { cmd_error_internal (error, "error in process sentinel: "); Vinhibit_quit = Qt; @@ -6777,8 +6728,7 @@ } static void -exec_sentinel (proc, reason) - Lisp_Object proc, reason; +exec_sentinel (Lisp_Object proc, Lisp_Object reason) { Lisp_Object sentinel, obuffer, odeactivate, okeymap; register struct Lisp_Process *p = XPROCESS (proc); @@ -6863,8 +6813,7 @@ but can be done at other times. */ static void -status_notify (deleting_process) - struct Lisp_Process *deleting_process; +status_notify (struct Lisp_Process *deleting_process) { register Lisp_Object proc, buffer; Lisp_Object tail, msg; @@ -7064,8 +7013,7 @@ /* Add DESC to the set of keyboard input descriptors. */ void -add_keyboard_wait_descriptor (desc) - int desc; +add_keyboard_wait_descriptor (int desc) { FD_SET (desc, &input_wait_mask); FD_SET (desc, &non_process_wait_mask); @@ -7076,8 +7024,7 @@ static int add_gpm_wait_descriptor_called_flag; void -add_gpm_wait_descriptor (desc) - int desc; +add_gpm_wait_descriptor (int desc) { if (! add_gpm_wait_descriptor_called_flag) FD_CLR (0, &input_wait_mask); @@ -7091,8 +7038,7 @@ /* From now on, do not expect DESC to give keyboard input. */ void -delete_keyboard_wait_descriptor (desc) - int desc; +delete_keyboard_wait_descriptor (int desc) { int fd; int lim = max_keyboard_desc; @@ -7109,8 +7055,7 @@ } void -delete_gpm_wait_descriptor (desc) - int desc; +delete_gpm_wait_descriptor (int desc) { int fd; int lim = max_gpm_desc; @@ -7130,8 +7075,7 @@ that corresponds to one of the keyboard input descriptors. */ static int -keyboard_bit_set (mask) - SELECT_TYPE *mask; +keyboard_bit_set (fd_set *mask) { int fd; @@ -7215,7 +7159,7 @@ } void -init_process () +init_process (void) { register int i; @@ -7318,7 +7262,7 @@ } void -syms_of_process () +syms_of_process (void) { Qprocessp = intern_c_string ("processp"); staticpro (&Qprocessp);