Re: [pcre-dev] Forcing study to return with something

Góra strony
Delete this message
Autor: Zoltán Herczeg
Data:  
Dla: pcre-dev
Temat: Re: [pcre-dev] Forcing study to return with something
What about PCRE_STUDY_EXTRA_NEEDED? My problem with NONULL that the study would still return NULL in case of an error (rare case, means that the regex is invalid, i.e wrong magic number). Thus, this feature could also be used for error check.

Regards,
Zoltan

Philip Hazel <ph10@???> írta:
>On Sat, 11 Aug 2012, Zoltán Herczeg wrote:>
>
> it is inconvenient for several uses cases, that study sometimes return>
> with something and sometimes not, and we need to manually allocate a>
> pcre_extra. Shall we add a flag which forces it to return with a>
> plain, empty, pcre_extra if it would return with NULL (and there was>
> no error of course)?>
>

I have no objection. Indeed, I am currently working on pcregrep (fixing>
various oddities with --include and --exclude) and its code could>
perhaps be made a bit tidier if this flag exists. What shall we call it?>
PCRE_STUDY_NEVER_NULL? PCRE_STUDY_NONULL? PCRE_STUDY_FORCE_ALLOC? Maybe>
NONULL is clearest, but I don't really mind (and maybe there's something >
better).>
>

Philip>
>

-- >
Philip Hazel