diff options
| author | Cracker64 <cracker642@gmail.com> | 2011-01-31 18:12:29 (GMT) |
|---|---|---|
| committer | Cracker64 <cracker642@gmail.com> | 2011-01-31 18:12:29 (GMT) |
| commit | c1ca8bae2980fba045fbd881a18a9e75c14361aa (patch) | |
| tree | 417aa53f2b5272e3c50a32f53be149e48c53bb9a /src/misc.c | |
| parent | 3babc0586c9b8a0de12962a2cc89c93ea3c7f02f (diff) | |
| download | powder-c1ca8bae2980fba045fbd881a18a9e75c14361aa.zip powder-c1ca8bae2980fba045fbd881a18a9e75c14361aa.tar.gz | |
merge jacksonmj's and simon's changes, and made mouse coords show up in debug so it is easier to get them.
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"); |
