@@ -164,7 +164,7 @@ int regex_load_mmap(struct mmap_area *mmap_area, struct regex_data **regex,
164
164
return -1 ;
165
165
}
166
166
167
- int regex_writef (struct regex_data * regex , FILE * fp , int do_write_precompregex )
167
+ int regex_writef (const struct regex_data * regex , FILE * fp , int do_write_precompregex )
168
168
{
169
169
int rc = 0 ;
170
170
size_t len ;
@@ -269,7 +269,7 @@ int regex_match(struct regex_data *regex, char const *subject, int partial)
269
269
* Preferably, this function would be replaced with an algorithm that computes
270
270
* the equivalence of the automatons systematically.
271
271
*/
272
- int regex_cmp (struct regex_data * regex1 , struct regex_data * regex2 )
272
+ int regex_cmp (const struct regex_data * regex1 , const struct regex_data * regex2 )
273
273
{
274
274
int rc ;
275
275
size_t len1 , len2 ;
@@ -407,7 +407,7 @@ int regex_load_mmap(struct mmap_area *mmap_area, struct regex_data **regex,
407
407
return -1 ;
408
408
}
409
409
410
- static inline pcre_extra * get_pcre_extra (struct regex_data * regex )
410
+ static inline const pcre_extra * get_pcre_extra (const struct regex_data * regex )
411
411
{
412
412
if (!regex ) return NULL ;
413
413
if (regex -> owned ) {
@@ -419,14 +419,14 @@ static inline pcre_extra *get_pcre_extra(struct regex_data *regex)
419
419
}
420
420
}
421
421
422
- int regex_writef (struct regex_data * regex , FILE * fp ,
422
+ int regex_writef (const struct regex_data * regex , FILE * fp ,
423
423
int do_write_precompregex __attribute__((unused )))
424
424
{
425
425
int rc ;
426
426
size_t len ;
427
427
uint32_t to_write ;
428
428
size_t size ;
429
- pcre_extra * sd = get_pcre_extra (regex );
429
+ const pcre_extra * sd = get_pcre_extra (regex );
430
430
431
431
/* determine the size of the pcre data in bytes */
432
432
rc = pcre_fullinfo (regex -> regex , NULL , PCRE_INFO_SIZE , & size );
@@ -510,7 +510,7 @@ int regex_match(struct regex_data *regex, char const *subject, int partial)
510
510
* Preferably, this function would be replaced with an algorithm that computes
511
511
* the equivalence of the automatons systematically.
512
512
*/
513
- int regex_cmp (struct regex_data * regex1 , struct regex_data * regex2 )
513
+ int regex_cmp (const struct regex_data * regex1 , const struct regex_data * regex2 )
514
514
{
515
515
int rc ;
516
516
size_t len1 , len2 ;
0 commit comments