diff options
| author | Simon <simon@hardwired.org.uk> | 2011-01-31 16:54:13 (GMT) |
|---|---|---|
| committer | Simon <simon@hardwired.org.uk> | 2011-01-31 16:54:13 (GMT) |
| commit | 8363a21f23152cb2273b1240b8a2627d0a46d12d (patch) | |
| tree | dcb2b3e93706eecd61dbbfc16d0325a4e8eb706f /src/misc.c | |
| parent | 61292f5355bb85b3e6e293c5c5b0a2de10d0cd2d (diff) | |
| download | powder-8363a21f23152cb2273b1240b8a2627d0a46d12d.zip powder-8363a21f23152cb2273b1240b8a2627d0a46d12d.tar.gz | |
ALL GLORY TO THE SAVASK
Diffstat (limited to 'src/misc.c')
| -rw-r--r-- | src/misc.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -1,6 +1,8 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <regex.h> +#include <sys/types.h> #include "misc.h" #include "defines.h" #include "interface.h" @@ -116,6 +118,17 @@ void save_presets(int do_update) fclose(f); } +int sregexp(const char *str, char *pattern) +{ + int result; + regex_t patternc; + if(regcomp(&patternc, pattern, 0)!=0) + return 1; + result = regexec(&patternc, str, 0, NULL, 0); + regfree(&patternc); + return result; +} + void load_presets(void) { FILE *f=fopen("powder.def", "rb"); |
