Re: [pcre-dev] EBCDIC many faces

Kezdőlap
Üzenet törlése
Szerző: Ze'ev Atlas
Dátum:  
Címzett: pcre-dev@exim.org
Tárgy: Re: [pcre-dev] EBCDIC many faces
You gave me some ideas and directions to look atthank you Ze'ev Atlas



      From: "ph10@???" <ph10@???>
wrote


I'm not sure I can help without knowing more about what kind of API you
are defining. The ovector in the standard API is provided by the user as
part of the match data block, created by calling pcre2_match_data_create.
As it contains only offsets, there shouldn't be any need to translate
it.

In the standard API the subject string is passed to pcre2_match() either
with a length or as a zero-terminated string (in which case
pcre2_match() calculates its length when it starts up). If you are
inventing some new function called, say, pcre2_translate_match() with
identical arguments to pcre2_match(), then it can find the length if
necessary, copy the subject to some new memory while translating it, and
then call pcre2_match() with the known length. The offsets returned in
the ovector should apply to either the translated subject or to the
original - as I understand it your translation doesn't alter the length.

Philip

--
Philip Hazel