From 4ff6c7ea2919afc5495b4d55144eb8d4c45fe44d Mon Sep 17 00:00:00 2001 From: Peter Verthez Date: Sat, 25 Jan 2003 15:46:35 +0000 Subject: [PATCH] Extra argument for setting encoding. --- include/gedcom.h.in | 13 +++++++++++-- t/src/gom_write.c | 4 ++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/include/gedcom.h.in b/include/gedcom.h.in index 7625ef4..83b89fc 100644 --- a/include/gedcom.h.in +++ b/include/gedcom.h.in @@ -385,6 +385,14 @@ typedef enum _ENC_LINE_END { END_LF_CR = 3 } Enc_line_end; +typedef enum _ENC_FROM { + ENC_FROM_FILE = 0, + ENC_FROM_SYS = 1, + ENC_MANUAL = 2 +} Enc_from; + +struct encoding_state; + typedef enum _DATE_INPUT { DI_FROM_STRINGS, DI_FROM_NUMBERS, @@ -540,9 +548,10 @@ int gedcom_delete_xref(const char* xrefstr); /* Writing support */ Gedcom_write_hndl gedcom_write_open(const char* filename); int gedcom_write_close(Gedcom_write_hndl hndl, int *total_conv_fails); -int gedcom_write_set_encoding(const char* charset, Encoding width, +int gedcom_write_set_encoding(Enc_from from, + const char* charset, Encoding width, Enc_bom bom); -int gedcom_write_set_line_terminator(Enc_line_end end); +int gedcom_write_set_line_terminator(Enc_from from, Enc_line_end end); int gedcom_write_record_str(Gedcom_write_hndl hndl, Gedcom_rec rec, char* xrefstr, char* val); diff --git a/t/src/gom_write.c b/t/src/gom_write.c index fd73319..c0c9199 100644 --- a/t/src/gom_write.c +++ b/t/src/gom_write.c @@ -235,8 +235,8 @@ int main(int argc, char* argv[]) gedcom_init(); setlocale(LC_ALL, ""); gedcom_set_message_handler(gedcom_message_handler); - gedcom_write_set_encoding(encoding, enc, bom); - gedcom_write_set_line_terminator(end); + gedcom_write_set_encoding(ENC_MANUAL, encoding, enc, bom); + gedcom_write_set_line_terminator(ENC_MANUAL, end); output_open(outfilename); -- 2.30.2