Introduction
Introduction Statistics Contact Development Disclaimer Help
eregcomp.c - sbase - suckless unix tools
git clone git://git.suckless.org/sbase
Log
Files
Refs
README
LICENSE
---
eregcomp.c (469B)
---
1 #include <sys/types.h>
2
3 #include <regex.h>
4 #include <stdio.h>
5
6 #include "../util.h"
7
8 int
9 enregcomp(int status, regex_t *preg, const char *regex, int cflags)
10 {
11 char errbuf[BUFSIZ] = "";
12 int r;
13
14 if ((r = regcomp(preg, regex, cflags)) == 0)
15 return r;
16
17 regerror(r, preg, errbuf, sizeof(errbuf));
18 enprintf(status, "invalid regex: %s\n", errbuf);
19
20 return r;
21 }
22
23 int
24 eregcomp(regex_t *preg, const char *regex, int cflags)
25 {
26 return enregcomp(1, preg, regex, cflags);
27 }
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.