[pcre-dev] API types in PCRE2 and minor documentation change…

Top Page
Delete this message
Author: Maël Hörz
Date:  
To: pcre-dev
Subject: [pcre-dev] API types in PCRE2 and minor documentation change suggestion
pcre2_get_ovector_count returns a uint32_t and callout_number is
uint32_t, but the number parameter for the following functions is
unsigned int:

pcre2_substring_copy_bynumber
pcre2_substring_get_bynumber
pcre2_substring_length_bynumber

Shouldn't that be the same types?

----

int pcre2_dfa_match(const pcre2_code *code, PCRE2_SPTR subject,
PCRE2_SIZE length, PCRE2_SIZE startoffset, uint32_t options,
pcre2_match_data *match_data, pcre2_match_context *mcontext, int
*workspace, PCRE2_SIZE wscount);


   workspace    Points to a vector of ints used as working space
   wscount      Number of elements in the vector


Are ints always enough? I am not familiar enough with the code to know
what constraints there might be that are related to match
positions/ovectors etc.

----

pcre2_pattern_info man page:
I would reorder the information a little, I got confused reading it the
first time.

Unchanged>>>>
DESCRIPTION

This function returns information about a compiled pattern. Its
arguments are:

   code                      Compiled regular expression
   what                      What information is required
   where                     Where to put the information
<<<<Unchanged


The possible what constants and the information they request is:

   /what/                    requested information


   <entry1 what value>       <entry1 info>
   <entry2 what value>       <entry2 info>
   <entry3 what value>       <entry3 info>
   .
   .
   .
   <=unchanged what/information table>


If where is NULL, the function returns the amount of memory needed for
the requested information, in bytes. The where argument must point to an
unsigned 32-bit integer (uint32_t variable), except for the following
what values:

   PCRE2_INFO_FIRSTBITMAP     const uint8_t *
   PCRE2_INFO_JITSIZE         size_t
   PCRE2_INFO_NAMETABLE       PCRE2_SPTR
   PCRE2_INFO_SIZE            size_t