#include <pwd.h>
#endif
-#include <ctype.h>
#include <errno.h>
#ifdef HAVE_LIBSELINUX
#include <selinux/context.h>
#endif
+#include <c-ctype.h>
+
#include "lisp.h"
#include "intervals.h"
#include "character.h"
#define IS_DRIVE(x) ((x) >= 'A' && (x) <= 'z')
#endif
#ifdef WINDOWSNT
-#define IS_DRIVE(x) isalpha ((unsigned char) (x))
+#define IS_DRIVE(x) c_isalpha (x)
#endif
/* Need to lower-case the drive letter, or else expanded
filenames will sometimes compare unequal, because
`expand-file-name' doesn't always down-case the drive letter. */
-#define DRIVE_LETTER(x) (tolower ((unsigned char) (x)))
+#define DRIVE_LETTER(x) c_tolower (x)
#endif
#include "systime.h"
r += 2;
}
- if (getdefdir (toupper ((unsigned char) *beg) - 'A' + 1, r))
+ if (getdefdir (c_toupper (*beg) - 'A' + 1, r))
{
if (!IS_DIRECTORY_SEP (res[strlen (res) - 1]))
strcat (res, "/");
#endif /* DOS_NT */
ptrdiff_t length;
Lisp_Object handler, result, handled_name;
- int multibyte;
+ bool multibyte;
Lisp_Object hdir;
CHECK_STRING (name);
if (!IS_DIRECTORY_SEP (nm[0]))
{
adir = alloca (MAXPATHLEN + 1);
- if (!getdefdir (toupper (drive) - 'A' + 1, adir))
+ if (!getdefdir (c_toupper (drive) - 'A' + 1, adir))
adir = NULL;
}
if (!adir)
adir = alloca (MAXPATHLEN + 1);
if (drive)
{
- if (!getdefdir (toupper (drive) - 'A' + 1, adir))
+ if (!getdefdir (c_toupper (drive) - 'A' + 1, adir))
newdir = "/";
}
else
char *target = NULL;
int total = 0;
int substituted = 0;
- int multibyte;
+ bool multibyte;
char *xnm;
Lisp_Object handler;
else
{
o = p;
- while (p != endp && (isalnum (*p) || *p == '_')) p++;
+ while (p != endp && (c_isalnum (*p) || *p == '_')) p++;
s = p;
}
else
{
o = p;
- while (p != endp && (isalnum (*p) || *p == '_')) p++;
+ while (p != endp && (c_isalnum (*p) || *p == '_')) p++;
s = p;
}
set_buffer_internal (XBUFFER (buffer));
adjust_markers_for_delete (BEG, BEG_BYTE, Z, Z_BYTE);
adjust_overlays_for_delete (BEG, Z - BEG);
- buffer_set_intervals (current_buffer, NULL);
+ set_buffer_intervals (current_buffer, NULL);
TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
/* Now we are safe to change the buffer's multibyteness directly. */
- BSET (current_buffer, enable_multibyte_characters, multibyte);
- BSET (current_buffer, undo_list, undo_list);
+ bset_enable_multibyte_characters (current_buffer, multibyte);
+ bset_undo_list (current_buffer, undo_list);
return Qnil;
}
buf = XBUFFER (workbuf);
delete_all_overlays (buf);
- BSET (buf, directory, BVAR (current_buffer, directory));
- BSET (buf, read_only, Qnil);
- BSET (buf, filename, Qnil);
- BSET (buf, undo_list, Qt);
+ bset_directory (buf, BVAR (current_buffer, directory));
+ bset_read_only (buf, Qnil);
+ bset_filename (buf, Qnil);
+ bset_undo_list (buf, Qt);
eassert (buf->overlays_before == NULL);
eassert (buf->overlays_after == NULL);
set_buffer_internal (buf);
Ferase_buffer ();
- BSET (buf, enable_multibyte_characters, Qnil);
+ bset_enable_multibyte_characters (buf, Qnil);
insert_1_both ((char *) read_buf, nread, nread, 0, 0, 0);
TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
unwind_data = Fcons (BVAR (current_buffer, enable_multibyte_characters),
Fcons (BVAR (current_buffer, undo_list),
Fcurrent_buffer ()));
- BSET (current_buffer, enable_multibyte_characters, Qnil);
- BSET (current_buffer, undo_list, Qt);
+ bset_enable_multibyte_characters (current_buffer, Qnil);
+ bset_undo_list (current_buffer, Qt);
record_unwind_protect (decide_coding_unwind, unwind_data);
if (inserted > 0 && ! NILP (Vset_auto_coding_function))
&& NILP (replace))
/* Visiting a file with these coding system makes the buffer
unibyte. */
- BSET (current_buffer, enable_multibyte_characters, Qnil);
+ bset_enable_multibyte_characters (current_buffer, Qnil);
}
coding.dst_multibyte = ! NILP (BVAR (current_buffer, enable_multibyte_characters));
if (!NILP (visit))
{
if (!EQ (BVAR (current_buffer, undo_list), Qt) && !nochange)
- BSET (current_buffer, undo_list, Qnil);
+ bset_undo_list (current_buffer, Qnil);
if (NILP (handler))
{
current_buffer->modtime = mtime;
current_buffer->modtime_size = st.st_size;
- BSET (current_buffer, filename, orig_filename);
+ bset_filename (current_buffer, orig_filename);
}
SAVE_MODIFF = MODIFF;
/* Save old undo list and don't record undo for decoding. */
old_undo = BVAR (current_buffer, undo_list);
- BSET (current_buffer, undo_list, Qt);
+ bset_undo_list (current_buffer, Qt);
if (NILP (replace))
{
if (NILP (visit))
{
- BSET (current_buffer, undo_list, old_undo);
+ bset_undo_list (current_buffer, old_undo);
if (CONSP (old_undo) && inserted != old_inserted)
{
/* Adjust the last undo record for the size change during
else
/* If undo_list was Qt before, keep it that way.
Otherwise start with an empty undo_list. */
- BSET (current_buffer, undo_list, EQ (old_undo, Qt) ? Qt : Qnil);
+ bset_undo_list (current_buffer, EQ (old_undo, Qt) ? Qt : Qnil);
unbind_to (count1, Qnil);
}
{
SAVE_MODIFF = MODIFF;
XSETFASTINT (BVAR (current_buffer, save_length), Z - BEG);
- BSET (current_buffer, filename, visit_file);
+ bset_filename (current_buffer, visit_file);
}
UNGCPRO;
return val;
{
SAVE_MODIFF = MODIFF;
XSETFASTINT (BVAR (current_buffer, save_length), Z - BEG);
- BSET (current_buffer, filename, visit_file);
+ bset_filename (current_buffer, visit_file);
update_mode_lines++;
}
else if (quietly)
FILE *stream = NULL;
ptrdiff_t count = SPECPDL_INDEX ();
int orig_minibuffer_auto_raise = minibuffer_auto_raise;
- int old_message_p = 0;
+ bool old_message_p = 0;
struct gcpro gcpro1, gcpro2;
if (max_specpdl_size < specpdl_size + 40)