#if 0
static int
-detect_coding_XXX (coding, detect_info)
- struct coding_system *coding;
- struct coding_detection_info *detect_info;
+detect_coding_XXX (struct coding_system *coding,
+ struct coding_detection_info *detect_info)
{
const unsigned char *src = coding->source;
const unsigned char *src_end = coding->source + coding->src_bytes;
#if 0
static void
-decode_coding_XXXX (coding)
- struct coding_system *coding;
+decode_coding_XXXX (struct coding_system *coding)
{
const unsigned char *src = coding->source + coding->consumed;
const unsigned char *src_end = coding->source + coding->src_bytes;
Below is a template of these functions. */
#if 0
static void
-encode_coding_XXX (coding)
- struct coding_system *coding;
+encode_coding_XXX (struct coding_system *coding)
{
int multibytep = coding->dst_multibyte;
int *charbuf = coding->charbuf;
}
static void
-coding_alloc_by_making_gap (struct coding_system *coding, EMACS_INT gap_head_used, EMACS_INT bytes)
+coding_alloc_by_making_gap (struct coding_system *coding,
+ EMACS_INT gap_head_used, EMACS_INT bytes)
{
if (EQ (coding->src_object, coding->dst_object))
{
static unsigned char *
-alloc_destination (struct coding_system *coding, EMACS_INT nbytes, unsigned char *dst)
+alloc_destination (struct coding_system *coding, EMACS_INT nbytes,
+ unsigned char *dst)
{
EMACS_INT offset = dst - coding->destination;
#define UTF_8_BOM_3 0xBF
static int
-detect_coding_utf_8 (struct coding_system *coding, struct coding_detection_info *detect_info)
+detect_coding_utf_8 (struct coding_system *coding,
+ struct coding_detection_info *detect_info)
{
const unsigned char *src = coding->source, *src_base;
const unsigned char *src_end = coding->source + coding->src_bytes;
}
CODING_UTF_8_BOM (coding) = utf_without_bom;
-
-
while (1)
{
int c, c1, c2, c3, c4, c5;
static int
-detect_coding_utf_16 (struct coding_system *coding, struct coding_detection_info *detect_info)
+detect_coding_utf_16 (struct coding_system *coding,
+ struct coding_detection_info *detect_info)
{
const unsigned char *src = coding->source, *src_base = src;
const unsigned char *src_end = coding->source + coding->src_bytes;
else return 0. */
static int
-detect_coding_emacs_mule (struct coding_system *coding, struct coding_detection_info *detect_info)
+detect_coding_emacs_mule (struct coding_system *coding,
+ struct coding_detection_info *detect_info)
{
const unsigned char *src = coding->source, *src_base;
const unsigned char *src_end = coding->source + coding->src_bytes;
-1. If SRC is too short, return -2. */
int
-emacs_mule_char (struct coding_system *coding, const unsigned char *src, int *nbytes, int *nchars, int *id, struct composition_status *cmp_status)
+emacs_mule_char (struct coding_system *coding, const unsigned char *src,
+ int *nbytes, int *nchars, int *id,
+ struct composition_status *cmp_status)
{
const unsigned char *src_end = coding->source + coding->src_bytes;
const unsigned char *src_base = src;
static int
-emacs_mule_finish_composition (int *charbuf, struct composition_status *cmp_status)
+emacs_mule_finish_composition (int *charbuf,
+ struct composition_status *cmp_status)
{
int idx = - cmp_status->length;
int new_chars;
If it is, return 1, else return 0. */
static int
-detect_coding_iso_2022 (struct coding_system *coding, struct coding_detection_info *detect_info)
+detect_coding_iso_2022 (struct coding_system *coding,
+ struct coding_detection_info *detect_info)
{
const unsigned char *src = coding->source, *src_base = src;
const unsigned char *src_end = coding->source + coding->src_bytes;
Return new DST. */
unsigned char *
-encode_invocation_designation (struct charset *charset, struct coding_system *coding, unsigned char *dst, int *p_nchars)
+encode_invocation_designation (struct charset *charset,
+ struct coding_system *coding,
+ unsigned char *dst, int *p_nchars)
{
int multibytep = coding->dst_multibyte;
int produced_chars = *p_nchars;
find all the necessary designations. */
static unsigned char *
-encode_designation_at_bol (struct coding_system *coding, int *charbuf, int *charbuf_end, unsigned char *dst)
+encode_designation_at_bol (struct coding_system *coding, int *charbuf,
+ int *charbuf_end, unsigned char *dst)
{
struct charset *charset;
/* Table of charsets to be designated to each graphic register. */
CATEGORY_MASK_SJIS, else return 0. */
static int
-detect_coding_sjis (struct coding_system *coding, struct coding_detection_info *detect_info)
+detect_coding_sjis (struct coding_system *coding,
+ struct coding_detection_info *detect_info)
{
const unsigned char *src = coding->source, *src_base;
const unsigned char *src_end = coding->source + coding->src_bytes;
CATEGORY_MASK_BIG5, else return 0. */
static int
-detect_coding_big5 (struct coding_system *coding, struct coding_detection_info *detect_info)
+detect_coding_big5 (struct coding_system *coding,
+ struct coding_detection_info *detect_info)
{
const unsigned char *src = coding->source, *src_base;
const unsigned char *src_end = coding->source + coding->src_bytes;
CATEGORY_MASK_CCL, else return 0. */
static int
-detect_coding_ccl (struct coding_system *coding, struct coding_detection_info *detect_info)
+detect_coding_ccl (struct coding_system *coding,
+ struct coding_detection_info *detect_info)
{
const unsigned char *src = coding->source, *src_base;
const unsigned char *src_end = coding->source + coding->src_bytes;
is, return 1, else return 0. */
static int
-detect_coding_charset (struct coding_system *coding, struct coding_detection_info *detect_info)
+detect_coding_charset (struct coding_system *coding,
+ struct coding_detection_info *detect_info)
{
const unsigned char *src = coding->source, *src_base;
const unsigned char *src_end = coding->source + coding->src_bytes;
#define MAX_EOL_CHECK_COUNT 3
static int
-detect_eol (const unsigned char *source, EMACS_INT src_bytes, enum coding_category category)
+detect_eol (const unsigned char *source, EMACS_INT src_bytes,
+ enum coding_category category)
{
const unsigned char *src = source, *src_end = src + src_bytes;
unsigned char c;
static int
-produce_chars (struct coding_system *coding, Lisp_Object translation_table, int last_block)
+produce_chars (struct coding_system *coding, Lisp_Object translation_table,
+ int last_block)
{
unsigned char *dst = coding->destination + coding->produced;
unsigned char *dst_end = coding->destination + coding->dst_bytes;
return BUF. */
static INLINE int *
-handle_composition_annotation (EMACS_INT pos, EMACS_INT limit, struct coding_system *coding, int *buf, EMACS_INT *stop)
+handle_composition_annotation (EMACS_INT pos, EMACS_INT limit,
+ struct coding_system *coding, int *buf,
+ EMACS_INT *stop)
{
EMACS_INT start, end;
Lisp_Object prop;
property value is non-nil (limiting by LIMIT), and return BUF. */
static INLINE int *
-handle_charset_annotation (EMACS_INT pos, EMACS_INT limit, struct coding_system *coding, int *buf, EMACS_INT *stop)
+handle_charset_annotation (EMACS_INT pos, EMACS_INT limit,
+ struct coding_system *coding, int *buf,
+ EMACS_INT *stop)
{
Lisp_Object val, next;
int id;
static void
-consume_chars (struct coding_system *coding, Lisp_Object translation_table, int max_lookup)
+consume_chars (struct coding_system *coding, Lisp_Object translation_table,
+ int max_lookup)
{
int *buf = coding->charbuf;
int *buf_end = coding->charbuf + coding->charbuf_size;
}
int
-decode_coding_gap (struct coding_system *coding, EMACS_INT chars, EMACS_INT bytes)
+decode_coding_gap (struct coding_system *coding,
+ EMACS_INT chars, EMACS_INT bytes)
{
int count = SPECPDL_INDEX ();
Lisp_Object attrs;
}
int
-encode_coding_gap (struct coding_system *coding, EMACS_INT chars, EMACS_INT bytes)
+encode_coding_gap (struct coding_system *coding,
+ EMACS_INT chars, EMACS_INT bytes)
{
int count = SPECPDL_INDEX ();
*/
void
-decode_coding_object (coding, src_object, from, from_byte, to, to_byte,
- dst_object)
- struct coding_system *coding;
- Lisp_Object src_object;
- EMACS_INT from, from_byte, to, to_byte;
- Lisp_Object dst_object;
+decode_coding_object (struct coding_system *coding,
+ Lisp_Object src_object,
+ EMACS_INT from, EMACS_INT from_byte,
+ EMACS_INT to, EMACS_INT to_byte,
+ Lisp_Object dst_object)
{
int count = SPECPDL_INDEX ();
unsigned char *destination;
void
-encode_coding_object (coding, src_object, from, from_byte, to, to_byte,
- dst_object)
- struct coding_system *coding;
- Lisp_Object src_object;
- EMACS_INT from, from_byte, to, to_byte;
- Lisp_Object dst_object;
+encode_coding_object (struct coding_system *coding,
+ Lisp_Object src_object,
+ EMACS_INT from, EMACS_INT from_byte,
+ EMACS_INT to, EMACS_INT to_byte,
+ Lisp_Object dst_object)
{
int count = SPECPDL_INDEX ();
EMACS_INT chars = to - from;
detect only text-format. */
Lisp_Object
-detect_coding_system (src, src_chars, src_bytes, highest, multibytep,
- coding_system)
- const unsigned char *src;
- EMACS_INT src_chars, src_bytes;
- int highest;
- int multibytep;
- Lisp_Object coding_system;
+detect_coding_system (const unsigned char *src,
+ EMACS_INT src_chars, EMACS_INT src_bytes,
+ int highest, int multibytep,
+ Lisp_Object coding_system)
{
const unsigned char *src_end = src + src_bytes;
Lisp_Object attrs, eol_type;
Lisp_Object
-code_convert_region (Lisp_Object start, Lisp_Object end, Lisp_Object coding_system, Lisp_Object dst_object, int encodep, int norecord)
+code_convert_region (Lisp_Object start, Lisp_Object end,
+ Lisp_Object coding_system, Lisp_Object dst_object,
+ int encodep, int norecord)
{
struct coding_system coding;
EMACS_INT from, from_byte, to, to_byte;
ENCODE_FILE, thus we ignore character composition. */
Lisp_Object
-code_convert_string_norecord (Lisp_Object string, Lisp_Object coding_system, int encodep)
+code_convert_string_norecord (Lisp_Object string, Lisp_Object coding_system,
+ int encodep)
{
return code_convert_string (string, coding_system, Qt, encodep, 0, 1);
}
DEFUN ("coding-system-put", Fcoding_system_put, Scoding_system_put,
3, 3, 0,
doc: /* Change value in CODING-SYSTEM's property list PROP to VAL. */)
- (coding_system, prop, val)
+ (coding_system, prop, val)
Lisp_Object coding_system, prop, val;
{
Lisp_Object spec, attrs;
1, 1, 0,
doc: /* Return the base of CODING-SYSTEM.
Any alias or subsidiary coding system is not a base coding system. */)
- (coding_system)
+ (coding_system)
Lisp_Object coding_system;
{
Lisp_Object spec, attrs;
Any other returned value must be freed with free. This is used
only when get_current_dir_name is not defined on the system. */
char*
-get_current_dir_name ()
+get_current_dir_name (void)
{
char *buf;
char *pwd;
\f
#ifndef subprocesses
-wait_without_blocking ()
+void
+wait_without_blocking (void)
{
croak ("wait_without_blocking");
synch_process_alive = 0;
void
unrequest_sigio (void)
-{
+{
if (noninteractive)
return;
#ifndef MSDOS
void
-request_sigio ()
+request_sigio (void)
{
if (noninteractive || read_socket_hook)
return;
}
void
-unrequest_sigio ()
+unrequest_sigio (void)
{
if (noninteractive || read_socket_hook)
return;
if (!tty_out->output)
return; /* The tty is suspended. */
-
+
if (! tty_out->old_tty)
tty_out->old_tty = (struct emacs_tty *) xmalloc (sizeof (struct emacs_tty));
-
+
EMACS_GET_TTY (fileno (tty_out->input), tty_out->old_tty);
tty = *tty_out->old_tty;
means that the interrupt and quit feature must be
disabled on secondary ttys, or we would not even see the
keypress.
-
+
Note that even though emacsclient could have special code
to pass SIGINT to Emacs, we should _not_ enable
interrupt/quit keys for emacsclient frames. This means
tty.main.c_cc[VSWTCH] = CDISABLE; /* Turn off shell layering use
of C-z */
#endif /* VSWTCH */
-
+
#if defined (__mips__) || defined (HAVE_TCATTR)
#ifdef VSUSP
tty.main.c_cc[VSUSP] = CDISABLE; /* Turn off mips handling of C-z. */
tty.tchars.t_startc = '\021';
tty.tchars.t_stopc = '\023';
}
-
+
tty.lmode = LDECCTQ | LLITOUT | LPASS8 | LNOFLSH | tty_out->old_tty.lmode;
-
+
#endif /* HAVE_TCHARS */
#endif /* not HAVE_TERMIO */
if (!tty_out->output)
return; /* The tty is suspended. */
-
+
/* Go to and clear the last line of the terminal. */
cmgoto (tty_out, FrameRows (tty_out) - 1, 0);
-
+
/* Code adapted from tty_clear_end_of_line. */
if (tty_out->TS_clr_line)
{
{ /* have to do it the hard way */
int i;
tty_turn_off_insert (tty_out);
-
+
for (i = curX (tty_out); i < FrameCols (tty_out) - 1; i++)
{
fputc (' ', tty_out->output);
}
}
-
+
cmgoto (tty_out, FrameRows (tty_out) - 1, 0);
fflush (tty_out->output);
-
+
if (tty_out->terminal->reset_terminal_modes_hook)
tty_out->terminal->reset_terminal_modes_hook (tty_out->terminal);
struct addrinfo hints;
int ret;
- memset (&hints, 0, sizeof(hints));
+ memset (&hints, 0, sizeof (hints));
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_CANONNAME;
int read_alarm_should_throw;
-SIGTYPE
-select_alarm ()
+void
+select_alarm (int ignore)
{
select_alarmed = 1;
signal (SIGALRM, SIG_IGN);
#ifndef WINDOWSNT
/* Only rfds are checked. */
int
-sys_select (nfds, rfds, wfds, efds, timeout)
- int nfds;
- SELECT_TYPE *rfds, *wfds, *efds;
- EMACS_TIME *timeout;
+sys_select (int nfds,
+ SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
+ EMACS_TIME *timeout)
{
/* XXX This needs to be updated for multi-tty support. Is there
- anybody who needs to emulate select these days? */
+ anybody who needs to emulate select these days? */
int ravail = 0;
SELECT_TYPE orfds;
int timeoutval;
waiting for at least one character. */
void
-read_input_waiting ()
+read_input_waiting (void)
{
/* XXX This needs to be updated for multi-tty support. Is there
anybody who needs to emulate select these days? */
#ifndef HAVE_GETWD
char *
-getwd (pathname)
- char *pathname;
+getwd (char *pathname)
{
char *npath, *spath;
- extern char *getcwd ();
+ extern char *getcwd (char *, size_t);
BLOCK_INPUT; /* getcwd uses malloc */
spath = npath = getcwd ((char *) 0, MAXPATHLEN);
#ifndef HAVE_RENAME
-rename (from, to)
- const char *from;
- const char *to;
+int
+rename (const char *from, const char *to)
{
if (access (from, 0) == 0)
{
/* HPUX curses library references perror, but as far as we know
it won't be called. Anyway this definition will do for now. */
-perror ()
+void
+perror (void)
{
}
#endif /* HPUX and not HAVE_PERROR */
* until we are, then close the unsuccessful ones.
*/
-dup2 (oldd, newd)
- int oldd;
- int newd;
+int
+dup2 (int oldd, int newd)
{
register int fd, ret;
/* ARGSUSED */
int
-gettimeofday (tp, tzp)
- struct timeval *tp;
- struct timezone *tzp;
+gettimeofday (struct timeval *tp, struct timezone *tzp)
{
- extern long time ();
+ extern long time (long);
tp->tv_sec = time ((long *)0);
tp->tv_usec = 0;
* Make a directory.
*/
int
-mkdir (dpath, dmode)
- char *dpath;
- int dmode;
+mkdir (char *dpath, int dmode)
{
int cpid, status, fd;
struct stat statbuf;
#ifndef HAVE_RMDIR
int
-rmdir (dpath)
- char *dpath;
+rmdir (char *dpath)
{
int cpid, status, fd;
struct stat statbuf;
\f
#ifndef HAVE_STRSIGNAL
char *
-strsignal (code)
- int code;
+strsignal (int code)
{
char *signame = 0;
\f
#ifdef HAVE_TERMIOS
/* For make-serial-process */
-int serial_open (char *port)
+int
+serial_open (char *port)
{
int fd = -1;
#if !defined (HAVE_CFMAKERAW)
/* Workaround for targets which are missing cfmakeraw. */
/* Pasted from man page. */
-static void cfmakeraw (struct termios *termios_p)
+static void
+cfmakeraw (struct termios *termios_p)
{
termios_p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
termios_p->c_oflag &= ~OPOST;
#if !defined (HAVE_CFSETSPEED)
/* Workaround for targets which are missing cfsetspeed. */
-static int cfsetspeed (struct termios *termios_p, speed_t vitesse)
+static int
+cfsetspeed (struct termios *termios_p, speed_t vitesse)
{
return (cfsetispeed (termios_p, vitesse)
+ cfsetospeed (termios_p, vitesse));
/* For serial-process-configure */
void
serial_configure (struct Lisp_Process *p,
- Lisp_Object contact)
+ Lisp_Object contact)
{
Lisp_Object childp2 = Qnil;
Lisp_Object tem = Qnil;
CHECK_NUMBER (tem);
if (XINT (tem) != 7 && XINT (tem) != 8)
error (":bytesize must be nil (8), 7, or 8");
- summary[0] = XINT(tem) + '0';
+ summary[0] = XINT (tem) + '0';
#if defined (CSIZE) && defined (CS7) && defined (CS8)
attr.c_cflag &= ~CSIZE;
attr.c_cflag |= ((XINT (tem) == 7) ? CS7 : CS8);
#elif !defined (WINDOWSNT) && !defined (MSDOS)
Lisp_Object
-list_system_processes ()
+list_system_processes (void)
{
return Qnil;
}
procfn_end = fn + strlen (fn);
strcpy (procfn_end, "/stat");
fd = emacs_open (fn, O_RDONLY, 0);
- if (fd >= 0 && (nread = emacs_read (fd, procbuf, sizeof(procbuf) - 1)) > 0)
+ if (fd >= 0 && (nread = emacs_read (fd, procbuf, sizeof (procbuf) - 1)) > 0)
{
procbuf[nread] = '\0';
p = procbuf;
strcpy (procfn_end, "/psinfo");
fd = emacs_open (fn, O_RDONLY, 0);
if (fd >= 0
- && (nread = read (fd, (char*)&pinfo, sizeof(struct psinfo)) > 0))
+ && (nread = read (fd, (char*)&pinfo, sizeof (struct psinfo)) > 0))
{
attrs = Fcons (Fcons (Qppid, make_fixnum_or_float (pinfo.pr_ppid)), attrs);
attrs = Fcons (Fcons (Qpgrp, make_fixnum_or_float (pinfo.pr_pgid)), attrs);