* lisp/subr.el (inhibit-null-byte-detection): Make it an obsolete alias.
* src/coding.c (setup_coding_system): Use new name.
(detect_coding): Rename null_byte_found => nul_byte_found.
(detect_coding_system): Use new name.
Rename null_byte_found => nul_byte_found.
(Fdefine_coding_system_internal): Use new name.
(syms_of_coding): Rename inhibit-null-byte-detection to
inhibit-nul-byte-detection.
* src/w16select.c (get_clipboard_data): null_char => nul_char.
* src/json.c (check_string_without_embedded_nuls): Rename from
check_string_without_embedded_nulls.
(Fjson_parse_string): Adjust accordingly.
* src/coding.h (enum define_coding_undecided_arg_index)
(enum coding_attr_index): ...null_byte... => ...nul_byte....
* lisp/info.el (info-insert-file-contents, Info-insert-dir):
* lisp/international/mule.el (define-coding-system):
* lisp/vc/vc-git.el (vc-git--call):
* doc/lispref/nonascii.texi (Lisp and Coding Systems): Use the new name.
(@pxref{Coding Systems}) used for decoding the file's contents,
including end-of-line conversion. However, if the file contains null
bytes, it is by default visited without any code conversions.
-@xref{Lisp and Coding Systems, inhibit-null-byte-detection}.
+@xref{Lisp and Coding Systems, inhibit-nul-byte-detection}.
If @var{visit} is non-@code{nil}, this function additionally marks the
buffer as unmodified and sets up various fields in the buffer so that it
@end defun
@cindex null bytes, and decoding text
-@defvar inhibit-null-byte-detection
+@defvar inhibit-nul-byte-detection
If this variable has a non-@code{nil} value, null bytes are ignored
when detecting the encoding of a region or a string. This allows the
encoding of text that contains null bytes to be correctly detected,
non-@code{nil}; or else from the defaulting mechanism (@pxref{Default
Coding Systems}). If the text output by a process contains null
bytes, Emacs by default uses @code{no-conversion} for it; see
-@ref{Lisp and Coding Systems, inhibit-null-byte-detection}, for how to
+@ref{Lisp and Coding Systems, inhibit-nul-byte-detection}, for how to
control this behavior.
@strong{Warning:} Coding systems such as @code{undecided}, which
\f
* Lisp Changes in Emacs 27.1
++++
+** inhibit-null-byte-detection is renamed to inhibit-nul-byte-detection
+
+++
** 'self-insert-command' takes the char to insert as (optional) argument.
(insert-file-contents-literally fullname visit)
(let ((inhibit-read-only t)
(coding-system-for-write 'no-conversion)
- (inhibit-null-byte-detection t) ; Index nodes include null bytes
+ (inhibit-nul-byte-detection t) ; Index nodes include null bytes
(default-directory (or (file-name-directory fullname)
default-directory)))
(or (consp decoder)
(setq decoder (list decoder)))
(apply #'call-process-region (point-min) (point-max)
(car decoder) t t nil (cdr decoder))))
- (let ((inhibit-null-byte-detection t)) ; Index nodes include null bytes
+ (let ((inhibit-nul-byte-detection t)) ; Index nodes include null bytes
(insert-file-contents fullname visit)))
;; Clear the caches of modified Info files.
;; Index nodes include null bytes. DIR
;; files should not have indices, but who
;; knows...
- (let ((inhibit-null-byte-detection t))
+ (let ((inhibit-nul-byte-detection t))
(insert-file-contents file)
(setq Info-dir-file-name file)
(push (current-buffer) buffers)
CCL program reads a character sequence and writes a byte sequence
as an encoding result.
-`:inhibit-null-byte-detection'
+`:inhibit-nul-byte-detection'
VALUE non-nil means Emacs ignore null bytes on code detection.
-See the variable `inhibit-null-byte-detection'. This attribute
+See the variable `inhibit-nul-byte-detection'. This attribute
is meaningful only when `:coding-type' is `undecided'.
`:inhibit-iso-escape-detection'
:ccl-encoder
:valids))
((eq coding-type 'undecided)
- '(:inhibit-null-byte-detection
+ '(:inhibit-nul-byte-detection
:inhibit-iso-escape-detection
:prefer-utf-8))))))
(cons :name (cons name (cons :docstring (cons (purecopy docstring)
props)))))
(setcdr (assq :plist common-attrs) props)
- (apply 'define-coding-system-internal
- name (mapcar 'cdr (append common-attrs spec-attrs)))))
+ (apply #'define-coding-system-internal
+ name (mapcar #'cdr (append common-attrs spec-attrs)))))
(defun coding-system-doc-string (coding-system)
"Return the documentation string for CODING-SYSTEM."
(make-obsolete-variable 'x-gtk-use-window-move nil "26.1")
(defvaralias 'messages-buffer-max-lines 'message-log-max)
+(define-obsolete-variable-alias 'inhibit-null-byte-detection
+ 'inhibit-nul-byte-detection "27.1")
\f
;;;; Alternate names for functions - these are not being phased out.
(defun vc-git--call (buffer command &rest args)
;; We don't need to care the arguments. If there is a file name, it
;; is always a relative one. This works also for remote
- ;; directories. We enable `inhibit-null-byte-detection', otherwise
+ ;; directories. We enable `inhibit-nul-byte-detection', otherwise
;; Tramp's eol conversion might be confused.
- (let ((inhibit-null-byte-detection t)
+ (let ((inhibit-nul-byte-detection t)
(coding-system-for-read
(or coding-system-for-read vc-git-log-output-coding-system))
(coding-system-for-write
#define GC_STRING_EXTRA (GC_STRING_OVERRUN_COOKIE_SIZE)
/* Exact bound on the number of bytes in a string, not counting the
- terminating null. A string cannot contain more bytes than
+ terminating NUL. A string cannot contain more bytes than
STRING_BYTES_BOUND, nor can it be so long that the size_t
arithmetic in allocate_string_data would overflow while it is
calculating a value to be passed to malloc. */
and make it L right away, to avoid the
potentially costly loop below. This is
important when the buffer has a long series of
- control characters, like binary nulls, and no
+ control characters, like binary NULs, and no
R2L characters at all. */
&& new_level == 0
&& !bidi_explicit_dir_char (bidi_it->ch)
}
/* The next two "else if" clauses are shortcuts for the
important special case when we have a long sequence of
- neutral or WEAK_BN characters, such as whitespace or nulls or
+ neutral or WEAK_BN characters, such as whitespace or NULs or
other control characters, on the base embedding level of the
paragraph, and that sequence goes all the way to the end of
the paragraph and follows a character whose resolved
/* Yield an upper bound on the buffer size needed to contain a C
string representing the NUM in base BASE. This includes any
- preceding '-' and the terminating null. */
+ preceding '-' and the terminating NUL. */
static ptrdiff_t
mpz_bufsize (mpz_t const num, int base)
{
/* Create a bignum by scanning NUM, with digits in BASE.
NUM must consist of an optional '-', a nonempty sequence
- of base-BASE digits, and a terminating null byte, and
+ of base-BASE digits, and a terminating NUL byte, and
the represented number must not be in fixnum range. */
Lisp_Object
default:
{
/* How many bytes are left unprocessed in the specs string?
- (Note that this excludes the trailing null byte.) */
+ (Note that this excludes the trailing NUL byte.) */
ptrdiff_t bytes_left = string_len - (tem - string);
unsigned letter;
coding->common_flags |= CODING_REQUIRE_DETECTION_MASK;
coding->spec.undecided.inhibit_nbd
= (encode_inhibit_flag
- (AREF (attrs, coding_attr_undecided_inhibit_null_byte_detection)));
+ (AREF (attrs, coding_attr_undecided_inhibit_nul_byte_detection)));
coding->spec.undecided.inhibit_ied
= (encode_inhibit_flag
(AREF (attrs, coding_attr_undecided_inhibit_iso_escape_detection)));
{
int c, i;
struct coding_detection_info detect_info;
- bool null_byte_found = 0, eight_bit_found = 0;
+ bool nul_byte_found = 0, eight_bit_found = 0;
bool inhibit_nbd = inhibit_flag (coding->spec.undecided.inhibit_nbd,
- inhibit_null_byte_detection);
+ inhibit_nul_byte_detection);
bool inhibit_ied = inhibit_flag (coding->spec.undecided.inhibit_ied,
inhibit_iso_escape_detection);
bool prefer_utf_8 = coding->spec.undecided.prefer_utf_8;
if (c & 0x80)
{
eight_bit_found = 1;
- if (null_byte_found)
+ if (nul_byte_found)
break;
}
else if (c < 0x20)
if (! (detect_info.rejected & CATEGORY_MASK_ISO_7_ELSE))
{
/* We didn't find an 8-bit code. We may
- have found a null-byte, but it's very
+ have found a NUL-byte, but it's very
rare that a binary file conforms to
ISO-2022. */
src = src_end;
}
else if (! c && !inhibit_nbd)
{
- null_byte_found = 1;
+ nul_byte_found = 1;
if (eight_bit_found)
break;
}
coding->head_ascii++;
}
- if (null_byte_found || eight_bit_found
+ if (nul_byte_found || eight_bit_found
|| coding->head_ascii < coding->src_bytes
|| detect_info.found)
{
}
else
{
- if (null_byte_found)
+ if (nul_byte_found)
{
detect_info.checked |= ~CATEGORY_MASK_UTF_16;
detect_info.rejected |= ~CATEGORY_MASK_UTF_16;
else
found = CODING_ID_NAME (this->id);
}
- else if (null_byte_found)
+ else if (nul_byte_found)
found = Qno_conversion;
else if ((detect_info.rejected & CATEGORY_MASK_ANY)
== CATEGORY_MASK_ANY)
Lisp_Object
from_unicode_buffer (const wchar_t *wstr)
{
- /* We get one of the two final null bytes for free. */
+ /* We get one of the two final NUL bytes for free. */
ptrdiff_t len = 1 + sizeof (wchar_t) * wcslen (wstr);
AUTO_STRING_WITH_LEN (str, (char *) wstr, len);
return from_unicode (str);
/* We need to make another copy (in addition to the one made by
code_convert_string_norecord) to ensure that the final string is
_doubly_ zero terminated --- that is, that the string is
- terminated by two zero bytes and one utf-16le null character.
+ terminated by two zero bytes and one utf-16le NUL character.
Because strings are already terminated with a single zero byte,
we just add one additional zero. */
str = make_uninit_string (SBYTES (*buf) + 1);
ptrdiff_t id;
struct coding_detection_info detect_info;
enum coding_category base_category;
- bool null_byte_found = 0, eight_bit_found = 0;
+ bool nul_byte_found = 0, eight_bit_found = 0;
if (NILP (coding_system))
coding_system = Qundecided;
struct coding_system *this UNINIT;
int c, i;
bool inhibit_nbd = inhibit_flag (coding.spec.undecided.inhibit_nbd,
- inhibit_null_byte_detection);
+ inhibit_nul_byte_detection);
bool inhibit_ied = inhibit_flag (coding.spec.undecided.inhibit_ied,
inhibit_iso_escape_detection);
bool prefer_utf_8 = coding.spec.undecided.prefer_utf_8;
if (c & 0x80)
{
eight_bit_found = 1;
- if (null_byte_found)
+ if (nul_byte_found)
break;
}
else if (c < 0x20)
if (! (detect_info.rejected & CATEGORY_MASK_ISO_7_ELSE))
{
/* We didn't find an 8-bit code. We may
- have found a null-byte, but it's very
+ have found a NUL-byte, but it's very
rare that a binary file confirm to
ISO-2022. */
src = src_end;
}
else if (! c && !inhibit_nbd)
{
- null_byte_found = 1;
+ nul_byte_found = 1;
if (eight_bit_found)
break;
}
coding.head_ascii++;
}
- if (null_byte_found || eight_bit_found
+ if (nul_byte_found || eight_bit_found
|| coding.head_ascii < coding.src_bytes
|| detect_info.found)
{
}
else
{
- if (null_byte_found)
+ if (nul_byte_found)
{
detect_info.checked |= ~CATEGORY_MASK_UTF_16;
detect_info.rejected |= ~CATEGORY_MASK_UTF_16;
}
if ((detect_info.rejected & CATEGORY_MASK_ANY) == CATEGORY_MASK_ANY
- || null_byte_found)
+ || nul_byte_found)
{
detect_info.found = CATEGORY_MASK_RAW_TEXT;
id = CODING_SYSTEM_ID (Qno_conversion);
{
if (detect_info.found & ~CATEGORY_MASK_UTF_16)
{
- if (null_byte_found)
+ if (nul_byte_found)
normal_eol = EOL_SEEN_LF;
else
normal_eol = detect_eol (coding.source, src_bytes,
{
if (nargs < coding_arg_undecided_max)
goto short_args;
- ASET (attrs, coding_attr_undecided_inhibit_null_byte_detection,
- args[coding_arg_undecided_inhibit_null_byte_detection]);
+ ASET (attrs, coding_attr_undecided_inhibit_nul_byte_detection,
+ args[coding_arg_undecided_inhibit_nul_byte_detection]);
ASET (attrs, coding_attr_undecided_inhibit_iso_escape_detection,
args[coding_arg_undecided_inhibit_iso_escape_detection]);
ASET (attrs, coding_attr_undecided_prefer_utf_8,
escape sequence (e.g., `latin-1') on reading by \\[universal-coding-system-argument]. */);
inhibit_iso_escape_detection = 0;
- DEFVAR_BOOL ("inhibit-null-byte-detection",
- inhibit_null_byte_detection,
- doc: /* If non-nil, Emacs ignores null bytes on code detection.
+ DEFVAR_BOOL ("inhibit-nul-byte-detection",
+ inhibit_nul_byte_detection,
+ doc: /* If non-nil, Emacs ignores NUL bytes on code detection.
By default, Emacs treats it as binary data, and does not attempt to
decode it. The effect is as if you specified `no-conversion' for
reading that text.
-Set this to non-nil when a regular text happens to include null bytes.
-Examples are Index nodes of Info files and null-byte delimited output
-from GNU Find and GNU Grep. Emacs will then ignore the null bytes and
+Set this to non-nil when a regular text happens to include NUL bytes.
+Examples are Index nodes of Info files and NUL-byte delimited output
+from GNU Find and GNU Grep. Emacs will then ignore the NUL bytes and
decode text as usual. */);
- inhibit_null_byte_detection = 0;
+ inhibit_nul_byte_detection = 0;
DEFVAR_BOOL ("disable-ascii-optimization", disable_ascii_optimization,
doc: /* If non-nil, Emacs does not optimize code decoder for ASCII files.
"automatic conversion on decoding.");
plist[15] = args[coding_arg_eol_type] = Qnil;
args[coding_arg_plist] = CALLMANY (Flist, plist);
- args[coding_arg_undecided_inhibit_null_byte_detection] = make_fixnum (0);
+ args[coding_arg_undecided_inhibit_nul_byte_detection] = make_fixnum (0);
args[coding_arg_undecided_inhibit_iso_escape_detection] = make_fixnum (0);
Fdefine_coding_system_internal (coding_arg_undecided_max, args);
enum define_coding_undecided_arg_index
{
- coding_arg_undecided_inhibit_null_byte_detection = coding_arg_max,
+ coding_arg_undecided_inhibit_nul_byte_detection = coding_arg_max,
coding_arg_undecided_inhibit_iso_escape_detection,
coding_arg_undecided_prefer_utf_8,
coding_arg_undecided_max
coding_attr_emacs_mule_full,
- coding_attr_undecided_inhibit_null_byte_detection,
+ coding_attr_undecided_inhibit_nul_byte_detection,
coding_attr_undecided_inhibit_iso_escape_detection,
coding_attr_undecided_prefer_utf_8,
struct undecided_spec
{
- /* Inhibit null byte detection. 1 means always inhibit,
+ /* Inhibit NUL byte detection. 1 means always inhibit,
-1 means do not inhibit, 0 means rely on user variable. */
int inhibit_nbd;
struct stat s;
/* An array to hold the mode string generated by filemodestring,
- including its terminating space and null byte. */
+ including its terminating space and NUL byte. */
char modes[sizeof "-rwxr-xr-x "];
char *uname = NULL, *gname = NULL;
Lisp_Object lstring; /* Lisp string to reorder, or nil */
const unsigned char *s; /* string data, or NULL if reordering buffer */
ptrdiff_t schars; /* the number of characters in the string,
- excluding the terminating null */
+ excluding the terminating NUL */
ptrdiff_t bufpos; /* buffer position of lstring, or 0 if N/A */
bool_bf from_disp_str : 1; /* True means the string comes from a
display property */
}
/* Scan the text and perform quoting with ^A (char code 1).
- ^A^A becomes ^A, ^A0 becomes a null char, and ^A_ becomes a ^_. */
+ ^A^A becomes ^A, ^A0 becomes a NUL char, and ^A_ becomes a ^_. */
from = get_doc_string_buffer + offset;
to = get_doc_string_buffer + offset;
while (from != p)
sequence.
. It accepts a pointer to the end of the format string, so the format string
- could include embedded null characters.
+ could include embedded NUL characters.
. It signals an error if the length of the formatted string is about to
overflow ptrdiff_t or size_t, to avoid producing strings longer than what
to fit and return BUFSIZE - 1; if this truncates a multibyte
sequence, store '\0' into the sequence's first byte.
Returns the number of bytes stored into BUFFER, excluding
- the terminating null byte. Output is always null-terminated.
+ the terminating NUL byte. Output is always NUL-terminated.
String arguments are passed as C strings.
Integers are passed as C integers. */
: FLT_RADIX == 16 ? 4
: -1)),
- /* Maximum number of bytes (including terminating null) generated
+ /* Maximum number of bytes (including terminating NUL) generated
by any format, if precision is no more than USEFUL_PRECISION_MAX.
On all practical hosts, %Lf is the worst case. */
SPRINTF_BUFSIZE = (sizeof "-." + (LDBL_MAX_10_EXP + 1)
MODULE_FUNCTION_BEGIN (module_nil);
if (! (0 <= length && length <= STRING_BYTES_BOUND))
overflow_error ();
- /* FIXME: AUTO_STRING_WITH_LEN requires STR to be null-terminated,
+ /* FIXME: AUTO_STRING_WITH_LEN requires STR to be NUL-terminated,
but we shouldn't require that. */
AUTO_STRING_WITH_LEN (lstr, str, length);
return lisp_to_value (env,
}
}
else if (cnv_result != 0 && d > path_utf8)
- d[-1] = '\0'; /* remove last semi-colon and null-terminate PATH */
+ d[-1] = '\0'; /* remove last semi-colon and NUL-terminate PATH */
} while (q);
path_copy = path_utf8;
#else /* MSDOS */
}
/* Put into BUF the concatenation of DIR and FILE, with an intervening
- directory separator if needed. Return a pointer to the null byte
+ directory separator if needed. Return a pointer to the NUL byte
at the end of the concatenated string. */
char *
splice_dir_file (char *buf, char const *dir, char const *file)
/* Write the name of the lock file for FNAME into LOCKNAME. Length
will be that of FNAME plus two more for the leading ".#", plus one
- for the null. */
+ for the NUL. */
#define MAKE_LOCK_NAME(lockname, fname) \
(lockname = SAFE_ALLOCA (SBYTES (fname) + 2 + 1), \
fill_in_lock_file_name (lockname, fname))
while ((cmp = filevercmp (p1, p2)) == 0)
{
- /* If the strings are identical through their first null bytes,
+ /* If the strings are identical through their first NUL bytes,
skip past identical prefixes and try again. */
ptrdiff_t size = strlen (p1) + 1;
p1 += size;
}
-/* Parse NAME (null terminated) as XLFD and store information in FONT
+/* Parse NAME (NUL terminated) as XLFD and store information in FONT
(font-spec or font-entity). Size property of FONT is set as
follows:
specified XLFD fields FONT property
return len < nbytes ? len : -1;
}
-/* Parse NAME (null terminated) and store information in FONT
+/* Parse NAME (NUL terminated) and store information in FONT
(font-spec or font-entity). NAME is supplied in either the
Fontconfig or GTK font name format. If NAME is successfully
parsed, return 0. Otherwise return -1.
#endif
-/* Parse NAME (null terminated) and store information in FONT
+/* Parse NAME (NUL terminated) and store information in FONT
(font-spec or font-entity). If NAME is successfully parsed, return
0. Otherwise return -1. */
insert ((char *) str, len);
}
-/* Insert the null-terminated string S before point. */
+/* Insert the NUL-terminated string S before point. */
void
insert_string (const char *s)
Qutf_8_unix, Qt, false, true, true);
}
-/* Create a multibyte Lisp string from the null-terminated UTF-8
+/* Create a multibyte Lisp string from the NUL-terminated UTF-8
string beginning at DATA. If the string is not a valid UTF-8
string, an unspecified string is returned. Note that all callers
below either pass only value UTF-8 strings or use this function for
}
/* Signal an error if OBJECT is not a string, or if OBJECT contains
- embedded null characters. */
+ embedded NUL characters. */
static void
-check_string_without_embedded_nulls (Lisp_Object object)
+check_string_without_embedded_nuls (Lisp_Object object)
{
CHECK_STRING (object);
CHECK_TYPE (memchr (SDATA (object), '\0', SBYTES (object)) == NULL,
{
Lisp_Object key = json_encode (HASH_KEY (h, i));
/* We can't specify the length, so the string must be
- null-terminated. */
- check_string_without_embedded_nulls (key);
+ NUL-terminated. */
+ check_string_without_embedded_nuls (key);
const char *key_str = SSDATA (key);
/* Reject duplicate keys. These are possible if the hash
table test is not `equal'. */
CHECK_SYMBOL (key_symbol);
Lisp_Object key = SYMBOL_NAME (key_symbol);
/* We can't specify the length, so the string must be
- null-terminated. */
- check_string_without_embedded_nulls (key);
+ NUL-terminated. */
+ check_string_without_embedded_nuls (key);
key_str = SSDATA (key);
/* In plists, ensure leading ":" in keys is stripped. It
will be reconstructed later in `json_to_lisp'.*/
or plists. t will be converted to the JSON true value. Vectors will
be converted to JSON arrays, whereas hashtables, alists and plists are
converted to JSON objects. Hashtable keys must be strings without
-embedded null characters and must be unique within each object. Alist
+embedded NUL characters and must be unique within each object. Alist
and plist keys must be symbols; if a key is duplicate, the first
instance is used.
Lisp_Object string = args[0];
Lisp_Object encoded = json_encode (string);
- check_string_without_embedded_nulls (encoded);
+ check_string_without_embedded_nuls (encoded);
struct json_configuration conf = {json_object_hashtable, QCnull, QCfalse};
json_parse_args (nargs - 1, args + 1, &conf, true);
force_auto_save_soon (void)
{
last_auto_save = - auto_save_interval - 1;
-
+ /* FIXME: What's the relationship between forcing auto-save and adding
+ a buffer-switch event? */
record_asynch_buffer_change ();
}
#endif
static Lisp_Object
apply_modifiers_uncached (int modifiers, char *base, int base_len, int base_len_byte)
{
- /* Since BASE could contain nulls, we can't use intern here; we have
+ /* Since BASE could contain NULs, we can't use intern here; we have
to use Fintern, which expects a genuine Lisp_String, and keeps a
reference to it. */
char new_mods[sizeof "A-C-H-M-S-s-up-down-drag-double-triple-"];
}
/* An upper bound on the number of bytes in a Lisp string, not
- counting the terminating null. This a tight enough bound to
+ counting the terminating NUL. This a tight enough bound to
prevent integer overflow errors that would otherwise occur during
string size calculations. A string cannot contain more bytes than
a fixnum can represent, nor can it be so long that C pointer
- arithmetic stops working on the string plus its terminating null.
+ arithmetic stops working on the string plus its terminating NUL.
Although the actual size limit (see STRING_BYTES_MAX in alloc.c)
may be a bit smaller than STRING_BYTES_BOUND, calculating it here
would expose alloc.c internal details that we'd rather keep
/* Define a built-in function for calling from Lisp.
`lname' should be the name to give the function in Lisp,
- as a null-terminated C string.
+ as a NUL-terminated C string.
`fnname' should be the name of the function in C.
By convention, it starts with F.
`sname' should be the name for the C constant structure
extern void dupstring (char **, char const *);
/* Make DEST a copy of STRING's data. Return a pointer to DEST's terminating
- null byte. This is like stpcpy, except the source is a Lisp string. */
+ NUL byte. This is like stpcpy, except the source is a Lisp string. */
INLINE char *
lispstpcpy (char *dest, Lisp_Object string)
: list4 (a, b, c, d))
/* Declare NAME as an auto Lisp string if possible, a GC-based one if not.
- Take its unibyte value from the null-terminated string STR,
+ Take its unibyte value from the NUL-terminated string STR,
an expression that should not have side effects.
STR's value is not necessarily copied. The resulting Lisp string
should not be modified or given text properties or made visible to
AUTO_STRING_WITH_LEN (name, str, strlen (str))
/* Declare NAME as an auto Lisp string if possible, a GC-based one if not.
- Take its unibyte value from the null-terminated string STR with length LEN.
- STR may have side effects and may contain null bytes.
+ Take its unibyte value from the NUL-terminated string STR with length LEN.
+ STR may have side effects and may contain NUL bytes.
STR's value is not necessarily copied. The resulting Lisp string
should not be modified or given text properties or made visible to
user code. */
static Lisp_Object
read_integer (Lisp_Object readcharfun, EMACS_INT radix)
{
- /* Room for sign, leading 0, other digits, trailing null byte.
+ /* Room for sign, leading 0, other digits, trailing NUL byte.
Also, room for invalid syntax diagnostic. */
size_t len = max (1 + 1 + UINTMAX_WIDTH + 1,
sizeof "integer, radix " + INT_STRLEN_BOUND (EMACS_INT));
EMACS_ATTRIBUTE_NONNULL(1);
/* Copy the content of the Lisp string VALUE to BUFFER as an utf8
- null-terminated string.
+ NUL-terminated string.
SIZE must point to the total size of the buffer. If BUFFER is
NULL or if SIZE is not big enough, write the required buffer size
to SIZE and return true.
- Note that SIZE must include the last null byte (e.g. "abc" needs
+ Note that SIZE must include the last NUL byte (e.g. "abc" needs
a buffer of size 4).
Return true if the string was successfully copied. */
else
{
tem = Fcar (external);
- if (!NILP (tem))
- state->depth = XFIXNUM (tem);
- else
- state->depth = 0;
+ state->depth = FIXNUMP (tem) ? XFIXNUM (tem) : 0;
external = Fcdr (external);
external = Fcdr (external);
char *pwd;
- /* The maximum size of a directory name, including the terminating null.
+ /* The maximum size of a directory name, including the terminating NUL.
Leave room so that the caller can append a trailing slash. */
ptrdiff_t dirsize_max = min (PTRDIFF_MAX, SIZE_MAX) - 1;
/* The maximum size of a buffer for a file name, including the
- terminating null. This is bounded by MAXPATHLEN, if available. */
+ terminating NUL. This is bounded by MAXPATHLEN, if available. */
ptrdiff_t bufsize_max = dirsize_max;
#ifdef MAXPATHLEN
bufsize_max = min (bufsize_max, MAXPATHLEN);
if (nread)
{
- /* We don't want trailing null characters. */
+ /* We don't want trailing NUL characters. */
for (p = cmdline + nread; cmdline < p && !p[-1]; p--)
continue;
else
ret = *area;
- /* Copy the string value, stopping at null or colon.
+ /* Copy the string value, stopping at NUL or colon.
Also process ^ and \ abbreviations. */
p = ptr;
r = ret;
return -1;
buf.size = BUFSIZE;
- /* Add 1 to size to ensure room for terminating null. */
+ /* Add 1 to size to ensure room for terminating NUL. */
buf.beg = xmalloc (buf.size + 1);
term = indirect ? indirect : (char *)name;
*bp1 = '\0';
/* Does this entry refer to another terminal type's entry?
- If something is found, copy it into heap and null-terminate it. */
+ If something is found, copy it into heap and NUL-terminate it. */
tc_search_point = find_capability (tc_search_point, "tc");
term = tgetst1 (tc_search_point, 0);
}
{
ptrdiff_t ptr_offset = bufp->ptr - buf;
ptrdiff_t append_end_offset = append_end - buf;
- /* Add 1 to size to ensure room for terminating null. */
+ /* Add 1 to size to ensure room for terminating NUL. */
ptrdiff_t size = bufp->size + 1;
bufp->beg = buf = xpalloc (buf, &size, 1, -1, 1);
bufp->size = size - 1;
determine how many bytes would be written, use NULL for S and
((size_t) -1) for MAXSIZE.
- This function behaves like nstrftime, except it allows null
+ This function behaves like nstrftime, except it allows NUL
bytes in FORMAT and it does not support nanoseconds. */
static size_t
emacs_nmemftime (char *s, size_t maxsize, const char *format,
{
size_t total = 0;
- /* Loop through all the null-terminated strings in the format
- argument. Normally there's just one null-terminated string, but
+ /* Loop through all the NUL-terminated strings in the format
+ argument. Normally there's just one NUL-terminated string, but
there can be arbitrarily many, concatenated together, if the
format contains '\0' bytes. nstrftime stops at the first
'\0' byte so we must invoke it separately for each such string. */
while (num && num_unexec_regions < MAX_UNEXEC_REGIONS)
{
- /* Subtract the size of trailing null bytes from filesize. It
+ /* Subtract the size of trailing NUL bytes from filesize. It
can be smaller than vmsize in segment commands. In such a
case, trailing bytes are initialized with zeros. */
for (p = ranges->address + ranges->size; p > ranges->address; p--)
/* need to know final size after '\r' chars are inserted (the
standard CF_OEMTEXT clipboard format uses CRLF line endings,
while Emacs uses just LF internally). */
- truelen = Size + 1; /* +1 for the terminating null */
+ truelen = Size + 1; /* +1 for the terminating NUL */
if (!Raw)
{
{
dosmemput (Data, Size, xbuf_addr);
- /* Terminate with a null, otherwise Windows does strange things
+ /* Terminate with a NUL, otherwise Windows does strange things
when the text size is an integral multiple of 32 bytes. */
_farpokeb (_dos_ds, xbuf_addr + Size, '\0');
}
while (Size--)
{
/* Don't allow them to put binary data into the clipboard, since
- it will cause yanked data to be truncated at the first null. */
+ it will cause yanked data to be truncated at the first NUL. */
if (*dp == '\0')
return 2;
if (*dp == '\n')
_farnspokeb (buf_offset++, *dp++);
}
- /* Terminate with a null, otherwise Windows does strange things
+ /* Terminate with a NUL, otherwise Windows does strange things
when the text size is an integral multiple of 32 bytes. */
_farnspokeb (buf_offset, '\0');
}
__dpmi_int (0x2f, ®s);
if (regs.x.ax != 0)
{
- unsigned char null_char = '\0';
+ unsigned char nul_char = '\0';
unsigned long xbuf_beg = xbuf_addr;
/* If last_clipboard_text is NULL, we don't want to slow down
the next loop by an additional test. */
register unsigned char *lcdp =
- last_clipboard_text == NULL ? &null_char : last_clipboard_text;
+ last_clipboard_text == NULL ? &nul_char : last_clipboard_text;
/* Copy data from low memory, remove CR
characters before LF if needed. */
/* Windows reportedly rounds up the size of clipboard data
(passed in SIZE) to a multiple of 32, and removes trailing
spaces from each line without updating SIZE. We therefore
- bail out when we see the first null character. */
+ bail out when we see the first NUL character. */
else if (c == '\0')
break;
}
last time set_clipboard_data was called, pretend there's no
data in the clipboard. This is so we don't pass our own text
from the clipboard (which might be troublesome if the killed
- text includes null characters). */
+ text includes NUL characters). */
if (last_clipboard_text &&
xbuf_addr - xbuf_beg == (long)(lcdp - last_clipboard_text))
dp = (unsigned char *)Data + 1;
/* If NAME identifies a symbolic link, copy into BUF the file name of
the symlink's target. Copy at most BUF_SIZE bytes, and do NOT
- null-terminate the target name, even if it fits. Return the number
+ NUL-terminate the target name, even if it fits. Return the number
of bytes copied, or -1 if NAME is not a symlink or any error was
encountered while resolving it. The file name copied into BUF is
encoded in the current ANSI codepage. */
size_t size_to_copy = buf_size;
/* According to MSDN, PrintNameLength does not include the
- terminating null character. */
+ terminating NUL character. */
lwname = alloca ((lwname_len + 1) * sizeof(WCHAR));
memcpy (lwname, lwname_src, lwname_len);
- lwname[lwname_len/sizeof(WCHAR)] = 0; /* null-terminate */
+ lwname[lwname_len/sizeof(WCHAR)] = 0; /* NUL-terminate */
filename_from_utf16 (lwname, resolved);
dostounix_filename (resolved);
lname_size = strlen (resolved) + 1;
/* Convert input strings to UTF-16. */
encoded_key = code_convert_string_norecord (lkey, Qutf_16le, 1);
memcpy (key_w, SSDATA (encoded_key), SBYTES (encoded_key));
- /* wchar_t strings need to be terminated by 2 null bytes. */
+ /* wchar_t strings need to be terminated by 2 NUL bytes. */
key_w [SBYTES (encoded_key)/2] = L'\0';
encoded_vname = code_convert_string_norecord (lname, Qutf_16le, 1);
memcpy (value_w, SSDATA (encoded_vname), SBYTES (encoded_vname));
case REG_SZ:
if (use_unicode)
{
- /* pvalue ends with 2 null bytes, but we need only one,
+ /* pvalue ends with 2 NUL bytes, but we need only one,
and AUTO_STRING_WITH_LEN will add it. */
if (pvalue[vsize - 1] == '\0')
vsize -= 2;
}
else
{
- /* Don't waste a byte on the terminating null character,
+ /* Don't waste a byte on the terminating NUL character,
since make_unibyte_string will add one anyway. */
if (pvalue[vsize - 1] == '\0')
vsize--;
{
SHFILEOPSTRUCTW file_op_w;
/* We need one more element beyond MAX_PATH because this is
- a list of file names, with the last element double-null
+ a list of file names, with the last element double-NUL
terminated. */
wchar_t tmp_path_w[MAX_PATH + 1];
/* Return the number of bytes in UTF-8 encoded string STR that
corresponds to at most LIM characters. If STR ends before LIM
characters, return the number of bytes in STR including the
- terminating null byte. */
+ terminating NUL byte. */
static int
utf8_mbslen_lim (const char *str, int lim)
{
}
/* we have to do some conjuring here to put argv and envp into the
- form CreateProcess wants... argv needs to be a space separated/null
- terminated list of parameters, and envp is a null
- separated/double-null terminated list of parameters.
+ form CreateProcess wants... argv needs to be a space separated/NUL
+ terminated list of parameters, and envp is a NUL
+ separated/double-NUL terminated list of parameters.
Additionally, zero-length args and args containing whitespace or
quote chars need to be wrapped in double quotes - for this to work,
got_full = GetLocaleInfo (XFIXNUM (lcid),
XFIXNUM (longform),
full_name, sizeof (full_name));
- /* GetLocaleInfo's return value includes the terminating null
+ /* GetLocaleInfo's return value includes the terminating NUL
character, when the returned information is a string, whereas
make_unibyte_string needs the string length without the
- terminating null. */
+ terminating NUL. */
if (got_full)
return make_unibyte_string (full_name, got_full - 1);
}
(void) ignored;
/* Don't pass our own text from the clipboard (which might be
- troublesome if the killed text includes null characters). */
+ troublesome if the killed text includes NUL characters). */
if (!NILP (current_text))
return ret;
\f
/* Display an echo area message M with a specified length of NBYTES
- bytes. The string may include null characters. If M is not a
+ bytes. The string may include NUL characters. If M is not a
string, clear out any existing message, and let the mini-buffer
text show through.
}
-/* Display a null-terminated echo area message M. If M is 0, clear
+/* Display a NUL-terminated echo area message M. If M is 0, clear
out any existing message, and let the mini-buffer text show through.
The buffer M must continue to exist until after the echo area gets
return unbind_to (count, str);
}
-/* Write a null-terminated, right justified decimal representation of
+/* Write a NUL-terminated, right justified decimal representation of
the positive integer D to BUF using a minimal field width WIDTH. */
static void
}
}
-/* Write a null-terminated, right justified decimal and "human
+/* Write a NUL-terminated, right justified decimal and "human
readable" representation of the nonnegative integer D to BUF using
a minimal field width WIDTH. D should be smaller than 999.5e24. */
produce strings from numerical values, so limit preposterously
large values of FIELD_WIDTH to avoid overrunning the buffer's
end. The size of the buffer is enough for FRAME_MESSAGE_BUF_SIZE
- bytes plus the terminating null. */
+ bytes plus the terminating NUL. */
int width = min (field_width, FRAME_MESSAGE_BUF_SIZE (f));
struct buffer *b = current_buffer;
/* Decode XLFD as iso-8859-1 into OUTPUT, and return the byte length
of the decoding result. LEN is the byte length of XLFD, or -1 if
- XLFD is NULL terminated. The caller must assure that OUTPUT is at
+ XLFD is NUL terminated. The caller must assure that OUTPUT is at
least twice (plus 1) as large as XLFD. */
static ptrdiff_t