static void print_interval (INTERVAL interval, Lisp_Object printcharfun);
/* GDB resets this to zero on W32 to disable OutputDebugString calls. */
-int print_output_debug_flag EXTERNALLY_VISIBLE = 1;
+bool print_output_debug_flag EXTERNALLY_VISIBLE = 1;
\f
/* Low level output routines for characters and strings. */
ptrdiff_t old_point = -1, start_point = -1; \
ptrdiff_t old_point_byte = -1, start_point_byte = -1; \
ptrdiff_t specpdl_count = SPECPDL_INDEX (); \
- int free_print_buffer = 0; \
+ bool free_print_buffer = 0; \
bool multibyte \
= !NILP (BVAR (current_buffer, enable_multibyte_characters)); \
Lisp_Object original
}
else
{
- int multibyte_p
+ bool multibyte_p
= !NILP (BVAR (current_buffer, enable_multibyte_characters));
setup_echo_area_for_printing (multibyte_p);
here, that's the reason we don't call printchar to do the
job. */
int i;
- int multibyte_p
+ bool multibyte_p
= !NILP (BVAR (current_buffer, enable_multibyte_characters));
setup_echo_area_for_printing (multibyte_p);
specbind (Qstandard_output, buf);
}
\f
-static void print (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag);
-static void print_preprocess (Lisp_Object obj);
-static void print_preprocess_string (INTERVAL interval, Lisp_Object arg);
-static void print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag);
+static void print (Lisp_Object, Lisp_Object, bool);
+static void print_preprocess (Lisp_Object);
+static void print_preprocess_string (INTERVAL, Lisp_Object);
+static void print_object (Lisp_Object, Lisp_Object, bool);
DEFUN ("terpri", Fterpri, Sterpri, 0, 1, 0,
doc: /* Output a newline to stream PRINTCHARFUN.
/* This function is never called. Its purpose is to prevent
print_output_debug_flag from being optimized away. */
-extern void debug_output_compilation_hack (int) EXTERNALLY_VISIBLE;
+extern void debug_output_compilation_hack (bool) EXTERNALLY_VISIBLE;
void
-debug_output_compilation_hack (int x)
+debug_output_compilation_hack (bool x)
{
print_output_debug_flag = x;
}
static char const NaN_string[] = "0.0e+NaN";
int i;
union { double d; char c[sizeof (double)]; } u_data, u_minus_zero;
- int negative = 0;
+ bool negative = 0;
u_data.d = data;
u_minus_zero.d = - 0.0;
for (i = 0; i < sizeof (double); i++)
\f
static void
-print (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag)
+print (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag)
{
new_backquote_output = 0;
}
static void
-print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag)
+print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag)
{
char buf[max (sizeof "from..to..in " + 2 * INT_STRLEN_BOUND (EMACS_INT),
max (sizeof " . #" + INT_STRLEN_BOUND (printmax_t),
ptrdiff_t size_byte;
/* 1 means we must ensure that the next character we output
cannot be taken as part of a hex character escape. */
- int need_nonhex = 0;
+ bool need_nonhex = 0;
bool multibyte = STRING_MULTIBYTE (obj);
GCPRO1 (obj);
case Lisp_Symbol:
{
- register int confusing;
- register unsigned char *p = SDATA (SYMBOL_NAME (obj));
- register unsigned char *end = p + SBYTES (SYMBOL_NAME (obj));
- register int c;
+ bool confusing;
+ unsigned char *p = SDATA (SYMBOL_NAME (obj));
+ unsigned char *end = p + SBYTES (SYMBOL_NAME (obj));
+ int c;
ptrdiff_t i, i_byte;
ptrdiff_t size_byte;
Lisp_Object name;
Lisp_Object Quser, Qgroup, Qetime, Qpcpu, Qpmem, Qtime, Qctime;
Lisp_Object QCname, QCtype;
\f
-/* Non-zero if keyboard input is on hold, zero otherwise. */
+/* True if keyboard input is on hold, zero otherwise. */
-static int kbd_is_on_hold;
+static bool kbd_is_on_hold;
/* Nonzero means don't run process sentinels. This is used
when exiting. */
-int inhibit_sentinels;
+bool inhibit_sentinels;
#ifdef subprocesses
static int process_output_delay_count;
-/* Non-zero if any process has non-nil read_output_skip. */
+/* True if any process has non-nil read_output_skip. */
-static int process_output_skip;
+static bool process_output_skip;
#else
#define process_output_delay_count 0
static void create_process (Lisp_Object, char **, Lisp_Object);
#ifdef USABLE_SIGIO
-static int keyboard_bit_set (SELECT_TYPE *);
+static bool keyboard_bit_set (SELECT_TYPE *);
#endif
static void deactivate_process (Lisp_Object);
static void status_notify (struct Lisp_Process *);
and store them individually through the three pointers. */
static void
-decode_status (Lisp_Object l, Lisp_Object *symbol, int *code, int *coredump)
+decode_status (Lisp_Object l, Lisp_Object *symbol, int *code, bool *coredump)
{
Lisp_Object tem;
{
Lisp_Object status = p->status;
Lisp_Object symbol;
- int code, coredump;
+ int code;
+ bool coredump;
Lisp_Object string, string2;
decode_status (status, &symbol, &code, &coredump);
sigset_t blocked;
/* Use volatile to protect variables from being clobbered by vfork. */
volatile int forkin, forkout;
- volatile int pty_flag = 0;
+ volatile bool pty_flag = 0;
volatile Lisp_Object lisp_pty_name = Qnil;
volatile Lisp_Object encoded_current_dir;
create_pty (Lisp_Object process)
{
int inchannel, outchannel;
- int pty_flag = 0;
+ bool pty_flag = 0;
inchannel = outchannel = -1;
Lisp_Object tem;
Lisp_Object name, buffer, host, service, address;
Lisp_Object filter, sentinel;
- int is_non_blocking_client = 0;
- int is_server = 0, backlog = 5;
+ bool is_non_blocking_client = 0;
+ bool is_server = 0;
+ int backlog = 5;
int socktype;
int family = -1;
struct ifreq *ifreq;
void *buf = NULL;
ptrdiff_t buf_size = 512;
- int s, i;
+ int s;
Lisp_Object res;
s = socket (AF_INET, SOCK_STREAM, 0);
int len = sizeof (*ifreq);
#endif
char namebuf[sizeof (ifq->ifr_name) + 1];
- i += len;
ifreq = (struct ifreq *) ((char *) ifreq + len);
if (ifq->ifr_addr.sa_family != AF_INET)
Lisp_Object res = Qnil;
Lisp_Object elt;
int s;
- int any = 0;
+ bool any = 0;
#if (! (defined SIOCGIFHWADDR && defined HAVE_STRUCT_IFREQ_IFR_HWADDR) \
&& defined HAVE_GETIFADDRS && defined LLADDR)
struct ifaddrs *ifap;
/* Accept a connection for server process SERVER on CHANNEL. */
-static int connect_counter = 0;
+static EMACS_INT connect_counter = 0;
static void
server_accept_connection (Lisp_Object server, int channel)
process. The return value is true if we read some input from
that process.
- If JUST_WAIT_PROC is non-nil, handle only output from WAIT_PROC
+ If JUST_WAIT_PROC is nonzero, handle only output from WAIT_PROC
(suspending output from other processes). A negative value
means don't run any timers either.
received input from that process before the timeout elapsed.
Otherwise, return true if we received input from any process. */
-int
+bool
wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
bool do_display,
Lisp_Object wait_for_cell,
struct Lisp_Process *wait_proc, int just_wait_proc)
{
- register int channel, nfds;
+ int channel, nfds;
SELECT_TYPE Available;
SELECT_TYPE Writeok;
- int check_write;
- int check_delay, no_avail;
+ bool check_write;
+ int check_delay;
+ bool no_avail;
int xerrno;
Lisp_Object proc;
EMACS_TIME timeout, end_time;
int wait_channel = -1;
- int got_some_input = 0;
+ bool got_some_input = 0;
ptrdiff_t count = SPECPDL_INDEX ();
FD_ZERO (&Available);
while (1)
{
- int timeout_reduced_for_timers = 0;
+ bool timeout_reduced_for_timers = 0;
/* If calling from keyboard input, do not quit
since we want to return C-g as an input character.
unsigned old_timers_run = timers_run;
struct buffer *old_buffer = current_buffer;
Lisp_Object old_window = selected_window;
- int leave = 0;
+ bool leave = 0;
if (detect_input_pending_run_timers (do_display))
{
else
#endif
{
- int buffered = 0 <= proc_buffered_char[channel];
+ bool buffered = 0 <= proc_buffered_char[channel];
if (buffered)
{
chars[carryover] = proc_buffered_char[channel];
static void
write_queue_push (struct Lisp_Process *p, Lisp_Object input_obj,
- const char *buf, ptrdiff_t len, int front)
+ const char *buf, ptrdiff_t len, bool front)
{
ptrdiff_t offset;
Lisp_Object entry, obj;
}
/* Remove the first element in the write_queue of process P, put its
- contents in OBJ, BUF and LEN, and return non-zero. If the
- write_queue is empty, return zero. */
+ contents in OBJ, BUF and LEN, and return true. If the
+ write_queue is empty, return false. */
-static int
+static bool
write_queue_pop (struct Lisp_Process *p, Lisp_Object *obj,
const char **buf, ptrdiff_t *len)
{
If CURRENT_GROUP is lambda, that means send to the process group
that currently owns the terminal, but only if it is NOT the shell itself.
- If NOMSG is zero, insert signal-announcements into process's buffers
+ If NOMSG is false, insert signal-announcements into process's buffers
right away.
If we can, we try to signal PROCESS by sending control characters
static void
process_send_signal (Lisp_Object process, int signo, Lisp_Object current_group,
- int nomsg)
+ bool nomsg)
{
Lisp_Object proc;
- register struct Lisp_Process *p;
+ struct Lisp_Process *p;
pid_t gid;
- int no_pgrp = 0;
+ bool no_pgrp = 0;
proc = get_process (process);
p = XPROCESS (proc);
/* If process has terminated, stop waiting for its output. */
if (WIFSIGNALED (status) || WIFEXITED (status))
{
- int clear_desc_flag = 0;
+ bool clear_desc_flag = 0;
p->alive = 0;
if (p->infd >= 0)
clear_desc_flag = 1;
# ifdef USABLE_SIGIO
-/* Return nonzero if *MASK has a bit set
+/* Return true if *MASK has a bit set
that corresponds to one of the keyboard input descriptors. */
-static int
+static bool
keyboard_bit_set (fd_set *mask)
{
int fd;
Return true if we received input from any process. */
-int
+bool
wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
bool do_display,
Lisp_Object wait_for_cell,
while (1)
{
- int timeout_reduced_for_timers = 0;
+ bool timeout_reduced_for_timers = 0;
SELECT_TYPE waitchannels;
int xerrno;
kbd_is_on_hold = 0;
}
-/* Return non-zero if keyboard input is on hold, zero otherwise. */
+/* Return true if keyboard input is on hold, zero otherwise. */
-int
+bool
kbd_on_hold_p (void)
{
return kbd_is_on_hold;