chiark / gitweb /
Concentrate knowledge about the `pcre' API in one place.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 29 Nov 2017 11:28:18 +0000 (11:28 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 29 Nov 2017 11:50:12 +0000 (11:50 +0000)
commita2e9d1472af7f3693cd7843eb3ff4d8b23423fc8
treea85f979141cef131f0d270e5420d52dafa4c7e02
parentc7e016d34b8f0429c0cd9e5366625fdf83776297
Concentrate knowledge about the `pcre' API in one place.

Introduce a new `regexp' API in the library which knows about `pcre' and
actually invokes `pcre_...' functions.  Remove this knowledge from
everywhere else.

The new API is, of course, suspiciously similar to `pcre' in many ways,
but there are some differences.

  * Sizes, lengths, and offsets, are all `size_t' now.  In particular,
    this means that the `ovector' type has changed.

  * Errors are reported differently: rather than returning a pointer to
    a static string, `regexp_compile' writes the error string into a
    caller-provided buffer.

Observant readers might notice that these changes make the interface
more similar to the `pcre2' API.  They'd be right, and this is not a
coincidence.  But for now, there's no functional change.
15 files changed:
clients/disorder.c
disobedience/disobedience.c
lib/Makefile.am
lib/configuration.c
lib/configuration.h
lib/regexp.c [new file with mode: 0644]
lib/regexp.h [new file with mode: 0644]
lib/regsub.c
lib/regsub.h
lib/trackdb.c
lib/trackdb.h
libtests/t-regsub.c
libtests/test.h
server/disorderd.c
server/server.c