Mercurial > hg > toybox
comparison lib/xwrap.c @ 1235:63db77909fc8 draft
Group headers by standard (POSIX or LSB) or function (internationalization, networking). Move headers standards ignore (but which have been there >15 years) to lib/portability.h. Fold xregcomp into lib since it's posix.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sat, 29 Mar 2014 18:11:00 -0500 |
parents | 468444e5c7c5 |
children | 955169e818d0 |
comparison
equal
deleted
inserted
replaced
1234:c99c215b4604 | 1235:63db77909fc8 |
---|---|
512 if (fraction) *fraction = units*(d-l); | 512 if (fraction) *fraction = units*(d-l); |
513 } else if (fraction) *fraction = 0; | 513 } else if (fraction) *fraction = 0; |
514 | 514 |
515 return l; | 515 return l; |
516 } | 516 } |
517 | |
518 // Compile a regular expression into a regex_t | |
519 void xregcomp(regex_t *preg, char *regex, int cflags) | |
520 { | |
521 int rc = regcomp(preg, regex, cflags); | |
522 | |
523 if (rc) { | |
524 regerror(rc, preg, libbuf, sizeof(libbuf)); | |
525 error_exit("xregcomp: %s", libbuf); | |
526 } | |
527 } |