summaryrefslogtreecommitdiff
path: root/transcode.c
AgeCommit message (Collapse)Author
2008-09-01* transcode_data.h (BYTE_LOOKUP): change to uintptr_t array.akr
(BYTE_LOOKUP_BASE): follow the type change. (BYTE_LOOKUP_INFO): ditto. (PType): ditto. (rb_transcoding): ditto. * tool/transcode-tblgen.rb: follow the type change. * transcode.c: ditto. * enc/trans/newline.trans: ditto. * enc/trans/iso2022.trans: ditto. * enc/trans/utf_16_32.trans: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-01* transcode_data.h (BYTE_LOOKUP_BASE): abstract accessor forakr
BYTE_LOOKUP. (BYTE_LOOKUP_INFO): ditto. * transcode.c (transcode_restartable0): use BYTE_LOOKUP_BASE and BYTE_LOOKUP_INFO. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-31rdoc update.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-31fix typos.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-31rdoc update.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-31* transcode.c (transcode.c): set source_encoding andakr
destination_encoding as encoding object. (ecerr_source_encoding): new method. (ecerr_destination_encoding): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-31* transcode.c (make_econv_exception): rename instance variable namesakr
for storing encoding names. (ecerr_source_encoding_name): method renamed. (ecerr_destination_encoding_name): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-31* transcode.c (econv_putback): associate encoding to the result.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-31* transcode.c (econv_insert_output): raise ArgumentError on failure.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-31* transcode.c (econv_last_error): new method.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-31* transcode.c (econv_primitive_convert): make two arguments,akr
destination_byteoffset and destination_bytesize, optional. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-31* transcode.c (make_econv_exception): error message simplified.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-30* transcode.c (econv_putback): make max argument optional.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-30* transcode.c (rb_econv_putback): putback from last byte.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-30* transcode.c (econv_putback): renamed from econv_primitive_putback.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-30* transcode.c (econv_insert_output): renamed fromakr
econv_primitive_insert_output. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-30* transcode.c (econv_primitive_errinfo): 5th element (partial_input)akr
removed from result. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-29rdoc update.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-28rdoc update.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-28* transcode.c (econv_finish): new method.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-28* transcode.c (econv_convert): new method.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-28* transcode.c (econv_primitive_convert): accept nil asakr
destination_bytesize for unlimited destination size. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-28* transcode.c (econv_primitive_convert): accept nil as input for emptyakr
input. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-28* transcode.c (sym_invalid_byte_sequence): new variable.akr
(sym_undefined_conversion): ditto. (sym_destination_buffer_full): ditto. (sym_source_buffer_empty): ditto. (sym_finished): ditto. (sym_output_followed_by_input): ditto. (sym_incomplete_input): ditto. (econv_result_to_symbol): use above variables. (Init_transcode): initialize above variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-26* transcode.c (transcode_loop): simplified.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-26* include/ruby/encoding.h (rb_econv_result_t): enumeration constant:akr
econv_incomplete_input. * io.c (finish_writeconv): check econv_incomplete_input. * transcode.c (transcode_restartable0): return econv_incomplete_input for unexpected end of source buffer. (trans_sweep): check econv_incomplete_input. (rb_trans_conv): ditto. (rb_econv_convert0): ditto. (rb_econv_convert): ditto. (transcode_loop): ditto. (make_econv_exception): change message for econv_incomplete_input. (econv_result_to_symbol): return :incomplete_input for econv_incomplete_input. (ecerr_incomplete_input): new method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18875 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-26* include/ruby/encoding.h (rb_econv_elem_t): move to transcode.cakr
(rb_econv_t): defined as an incomplete type. * transcode.c (rb_econv_elem_t): moved from encoding.h. (rb_econv_t): complete type defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-26* transcode.c (rb_econv_open): disable newline conversion for ASCIIakr
incompatible encodings. (str_transcode0): don't need disable newline conversion here. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-26* transcode.c (rb_econv_binmode): binmode is effective only once.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-25* transcode.c (str_transcode0): disable newline conversion for ASCIIakr
incompatible encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-25* transcode.c (str_transcode0): don't short cut for newline conversion.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-25* transcode.c (make_econv_exception): show readagain part for invalidakr
byte sequence exception. store the part as an instance variable. (ecerr_readagain_bytes): new method to access the readagain part. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-25* transcode.c (rb_econv_open): make last_tc NULL if there are onlyakr
additional transcoders. (econv_description): extracted from rb_econv_open_exc. (rb_econv_open_exc): use econv_description. (econv_inspect): use econv_description. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-25* transcode.c (rb_econv_open_by_transcoder_entries): initializeakr
last_error. num_trans may be zero. (rb_econv_convert0): num_trans may be zero. (rb_econv_putbackable): ditto. (rb_econv_putback): ditto. (rb_econv_convert): input_ptr and output_ptr may be NULL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-25* transcode.c (rb_econv_substr_append): fix for buffer overrun.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-25* transcode.c (rb_econv_open_exc): constified. nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24* configure.in (BUILTIN_TRANSSRCS): defined.akr
(BUILTIN_TRANSOBJS): defined. * enc/Makefile.in (BUILTIN_TRANSES): defined. * enc/make_encmake.rb (BUILTIN_TRANSES): defined. * enc/depend: don't generate rules for builtin transcoders. * common.mk (COMMONOBJS): add BUILTIN_TRANSOBJS. (enc.mk): pass BUILTIN_TRANSOBJS. (newline.c): new rule. (newline.$(OBJEXT)): new ru.e (srcs): newline.c added. * Makefile.in (BUILTIN_TRANSSRCS): defined. (BUILTIN_TRANSOBJS): defined. * transcode.c (Init_transcode): call Init_newline. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24* transcode.c (declare_transcoder): arguments order changed.akr
(rb_declare_transcoder): call declare_transcoder just once. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24* include/ruby/encoding.h (rb_econv_t): use rb_econv_option_t.akr
* transcode.c: follow the rb_econv_t change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24* io.c (rb_io_s_pipe): accept optional hash.akr
(rb_io_set_encoding): ditto. (rb_io_extract_modeenc): use rb_econv_opts to initialize ecopts. (rb_file_open_generic): ditto. (rb_file_open_internal): ditto. (io_encoding_set): new argument: opt. (argf_set_encoding): copy fptr->encs.opts to argf_ecopts. * transcode.c (rb_econv_opts): accept Qnil for initialization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24* include/ruby/encoding.h (rb_str_transcode): make 3rd argumentakr
rb_econv_option_t*. * transcode.c (transcode_loop): take rb_econv_option_t* as a argument. (str_transcode0): ditto. (str_transcode): make rb_econv_option_t and call str_transcode0 with it. (rb_str_transcode): take rb_econv_option_t*. * io.c (io_fwrite): follow the rb_str_transcode change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24* include/ruby/encoding.h (rb_econv_opts): declared.akr
* transcode.c (rb_econv_opts): defined. * io.c (rb_io_extract_modeenc): use rb_econv_opts. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24* include/ruby/encoding.h (rb_econv_option_t): defined.akr
(rb_econv_open): 3rd arg changed. (rb_econv_open_exc): ditto. * io.c (make_writeconv): use rb_econv_option_t. (make_readconv): ditto. (rb_econv_open): take rb_econv_option_t for options. (rb_econv_open_exc): ditto. (transcode_loop): use rb_econv_option_t. (econv_init): use rb_econv_option_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24* transcode.c (rb_econv_substr_append): associate dst with destinationakr
encoding when dst is created. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24* include/ruby/encoding.h (rb_str_transcode): add ecflags argument.akr
* transcode.c (econv_opts): extracted from str_transcode. (str_transcode_enc_args): extracted from str_transcode. (str_transcode0): extracted from str_transcode. (str_transcode): use econv_opts, str_transcode_enc_args, str_transcode0. (rb_str_transcode): call str_transcode0. (econv_primitive_insert_output): give the additional argument for rb_str_transcode. * io.c (make_writeconv): use invalid/undef flags. (io_fwrite): ditto. (rb_scan_open_args): give the additional argument for rb_str_transcode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24* transcode.c (str_transcode): check last hash only if 0 < argc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24* include/ruby/encoding.h (rb_econv_substr_append): renamed fromakr
rb_econv_string. (rb_econv_str_convert): declared. (rb_econv_substr_convert): declared. (rb_econv_str_append): declared. * io.c (io_fwrite): use rb_econv_str_convert instead of rb_econv_string. * transcode.c (rb_econv_substr_append): renamed from rb_econv_string. (rb_econv_str_append): new function. (rb_econv_substr_convert): ditto. (rb_econv_str_convert): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24* transcode.c (rb_econv_open): return NULL on error.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24* include/ruby/encoding.h (rb_econv_open_exc): declared.akr
* transcode.c (rb_eNoConverter): new exception. (rb_econv_open_exc): new function. (transcode_loop): use rb_econv_open_exc. * io.c (make_writeconv): use rb_econv_open_exc. (make_readconv): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23* include/ruby/encoding.h (ECONV_INVALID_MASK): defined.akr
(ECONV_INVALID_IGNORE): defined. (ECONV_INVALID_REPLACE): defined. (ECONV_UNDEF_MASK): defined. (ECONV_UNDEF_IGNORE): defined. (ECONV_UNDEF_REPLACE): defined. * transcode.c (INVALID_IGNORE): removed. (INVALID_REPLACE): removed. (UNDEF_IGNORE): removed. (UNDEF_REPLACE): removed. (rb_econv_convert0): renamed from rb_econv_convert. (rb_econv_convert): defined to call rb_econv_convert0 with replace/ignore behavior moved from transcode_loop. (transcode_loop): replace/ignore behavior removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e