}
+/* #define ENABLE_UTF_8_CONVERTER_TEST */
+
+#ifdef ENABLE_UTF_8_CONVERTER_TEST
+
/* Return the gap address of BUFFER. If the gap size is less than
NBYTES, enlarge the gap in advance. */
If the two arguments are Qnil, return Qnil if STRING has a
non-Unicode character. */
-Lisp_Object
+static Lisp_Object
encode_string_utf_8 (Lisp_Object string, Lisp_Object buffer,
bool nocopy, Lisp_Object handle_8_bit,
Lisp_Object handle_over_uni)
If the two arguments are Qnil, return Qnil if STRING has an invalid
sequence. */
-Lisp_Object
+static Lisp_Object
decode_string_utf_8 (Lisp_Object string, Lisp_Object buffer,
bool nocopy, Lisp_Object handle_8_bit,
Lisp_Object handle_over_uni)
return val;
}
-/* #define ENABLE_UTF_8_CONVERTER_TEST */
-
-#ifdef ENABLE_UTF_8_CONVERTER_TEST
-
/* These functions are useful for testing and benchmarking
encode_string_utf_8 and decode_string_utf_8. */
Lisp_Object, bool, bool, bool);
extern Lisp_Object code_convert_string_norecord (Lisp_Object, Lisp_Object,
bool);
-extern Lisp_Object encode_string_utf_8 (Lisp_Object, Lisp_Object, bool,
- Lisp_Object, Lisp_Object);
-extern Lisp_Object decode_string_utf_8 (Lisp_Object, Lisp_Object, bool,
- Lisp_Object, Lisp_Object);
extern Lisp_Object encode_file_name (Lisp_Object);
extern Lisp_Object decode_file_name (Lisp_Object);
extern Lisp_Object raw_text_coding_system (Lisp_Object);
static ptrdiff_t base64_decode_1 (const char *, char *, ptrdiff_t, bool,
bool, ptrdiff_t *);
-Lisp_Object base64_encode_region_1 (Lisp_Object, Lisp_Object, bool,
- bool, bool);
+static Lisp_Object base64_encode_region_1 (Lisp_Object, Lisp_Object, bool,
+ bool, bool);
-Lisp_Object base64_encode_string_1(Lisp_Object, bool,
- bool, bool);
+static Lisp_Object base64_encode_string_1 (Lisp_Object, bool,
+ bool, bool);
DEFUN ("base64-encode-region", Fbase64_encode_region, Sbase64_encode_region,
into shorter lines. */)
(Lisp_Object beg, Lisp_Object end, Lisp_Object no_line_break)
{
- return base64_encode_region_1(beg, end, NILP (no_line_break), true, false);
+ return base64_encode_region_1 (beg, end, NILP (no_line_break), true, false);
}
This produces the URL variant of base 64 encoding defined in RFC 4648. */)
(Lisp_Object beg, Lisp_Object end, Lisp_Object no_pad)
{
- return base64_encode_region_1(beg, end, false, NILP(no_pad), true);
+ return base64_encode_region_1 (beg, end, false, NILP(no_pad), true);
}
-Lisp_Object
+static Lisp_Object
base64_encode_region_1 (Lisp_Object beg, Lisp_Object end, bool line_break,
bool pad, bool base64url)
{
(Lisp_Object string, Lisp_Object no_line_break)
{
- return base64_encode_string_1(string, NILP (no_line_break), true, false);
+ return base64_encode_string_1 (string, NILP (no_line_break), true, false);
}
-DEFUN ("base64url-encode-string", Fbase64url_encode_string, Sbase64url_encode_string,
- 1, 2, 0,
+DEFUN ("base64url-encode-string", Fbase64url_encode_string,
+ Sbase64url_encode_string, 1, 2, 0,
doc: /* Base64url-encode STRING and return the result.
Optional second argument NO-PAD means do not add padding char =.
(Lisp_Object string, Lisp_Object no_pad)
{
- return base64_encode_string_1(string, false, NILP(no_pad), true);
+ return base64_encode_string_1 (string, false, NILP(no_pad), true);
}
-Lisp_Object
-base64_encode_string_1(Lisp_Object string, bool line_break,
- bool pad, bool base64url)
+static Lisp_Object
+base64_encode_string_1 (Lisp_Object string, bool line_break,
+ bool pad, bool base64url)
{
ptrdiff_t allength, length, encoded_length;
char *encoded;
{
*e++ = b64_value_to_char[value];
if (pad)
- {
- *e++ = '=';
- }
+ *e++ = '=';
break;
}