#include <config.h>
#include "lisp.h"
+#include <stddef.h>
+
#include "buffer.h"
#include "elhash.h"
#include "insdel.h"
static void print_coding_system (Lisp_Object, Lisp_Object, int);
static void finalize_coding_system (void *header, int for_disksave);
+#ifdef MULE
+static const struct lrecord_description ccs_description_1[] = {
+ { XD_LISP_OBJECT, offsetof(charset_conversion_spec, from_charset), 2 },
+ { XD_END }
+};
+
+static const struct struct_description ccs_description = {
+ sizeof(charset_conversion_spec),
+ ccs_description_1
+};
+
+static const struct lrecord_description ccsd_description_1[] = {
+ XD_DYNARR_DESC(charset_conversion_spec_dynarr, &ccs_description),
+ { XD_END }
+};
+
+static const struct struct_description ccsd_description = {
+ sizeof(charset_conversion_spec_dynarr),
+ ccsd_description_1
+};
+#endif
+
+static const struct lrecord_description coding_system_description[] = {
+ { XD_LISP_OBJECT, offsetof(struct Lisp_Coding_System, name), 2 },
+ { XD_LISP_OBJECT, offsetof(struct Lisp_Coding_System, mnemonic), 3 },
+ { XD_LISP_OBJECT, offsetof(struct Lisp_Coding_System, eol_lf), 3 },
+#ifdef MULE
+ { XD_LISP_OBJECT, offsetof(struct Lisp_Coding_System, iso2022.initial_charset), 4 },
+ { XD_STRUCT_PTR, offsetof(struct Lisp_Coding_System, iso2022.input_conv), 1, &ccsd_description },
+ { XD_STRUCT_PTR, offsetof(struct Lisp_Coding_System, iso2022.output_conv), 1, &ccsd_description },
+ { XD_LISP_OBJECT, offsetof(struct Lisp_Coding_System, ccl.decode), 2 },
+#endif
+ { XD_END }
+};
+
DEFINE_LRECORD_IMPLEMENTATION ("coding-system", coding_system,
mark_coding_system, print_coding_system,
finalize_coding_system,
- 0, 0, struct Lisp_Coding_System);
+ 0, 0, coding_system_description,
+ struct Lisp_Coding_System);
static Lisp_Object
mark_coding_system (Lisp_Object obj, void (*markobj) (Lisp_Object))
decode_coding_utf8 (decoding, src, dst, n);
break;
case CODESYS_CCL:
- ccl_driver (&str->ccl, src, dst, n, 0);
+ str->ccl.last_block = str->flags & CODING_STATE_END;
+ ccl_driver (&str->ccl, src, dst, n, 0, CCL_MODE_DECODING);
break;
case CODESYS_ISO2022:
decode_coding_iso2022 (decoding, src, dst, n);
encode_coding_utf8 (encoding, src, dst, n);
break;
case CODESYS_CCL:
- ccl_driver (&str->ccl, src, dst, n, 0);
+ str->ccl.last_block = str->flags & CODING_STATE_END;
+ ccl_driver (&str->ccl, src, dst, n, 0, CCL_MODE_ENCODING);
break;
case CODESYS_ISO2022:
encode_coding_iso2022 (encoding, src, dst, n);
/************************************************************************/
void
-syms_of_mule_coding (void)
+syms_of_file_coding (void)
{
defsymbol (&Qbuffer_file_coding_system, "buffer-file-coding-system");
deferror (&Qcoding_system_error, "coding-system-error",
}
void
-lstream_type_create_mule_coding (void)
+lstream_type_create_file_coding (void)
{
LSTREAM_HAS_METHOD (decoding, reader);
LSTREAM_HAS_METHOD (decoding, writer);
}
void
-vars_of_mule_coding (void)
+vars_of_file_coding (void)
{
int i;
}
void
-complex_vars_of_mule_coding (void)
+complex_vars_of_file_coding (void)
{
staticpro (&Vcoding_system_hash_table);
Vcoding_system_hash_table =