summaryrefslogtreecommitdiff
path: root/src/ivybind.c
diff options
context:
space:
mode:
authorfcolin2005-07-26 08:47:24 +0000
committerfcolin2005-07-26 08:47:24 +0000
commitfb6aa032cf84f543234534cd2c24102eb730bbc4 (patch)
treee6815d6ca0e3f62274119c38f2cb2818bbdb0a01 /src/ivybind.c
parentd5fc9f417c02ebe34b8f06847c375cd246f8c832 (diff)
downloadivy-c-fb6aa032cf84f543234534cd2c24102eb730bbc4.zip
ivy-c-fb6aa032cf84f543234534cd2c24102eb730bbc4.tar.gz
ivy-c-fb6aa032cf84f543234534cd2c24102eb730bbc4.tar.bz2
ivy-c-fb6aa032cf84f543234534cd2c24102eb730bbc4.tar.xz
compile sur Windows
les fichiers getopt sont necessaires uniquement sur Windows( WIN32 ) compilateur VStudio
Diffstat (limited to 'src/ivybind.c')
-rw-r--r--src/ivybind.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/ivybind.c b/src/ivybind.c
index e859457..9cd1f58 100644
--- a/src/ivybind.c
+++ b/src/ivybind.c
@@ -22,33 +22,33 @@
#include <stdlib.h>
#include <memory.h>
-#ifndef USE_PCRE_REGEX
-#include <regex.h>
-#else
+#ifdef USE_PCRE_REGEX
#define OVECSIZE 60 /* must be multiple of 3, for regexp return */
#include <pcre.h>
+#else
+#include <regex.h>
#endif
#include "list.h"
#include "ivybind.h"
-#ifndef USE_PCRE_REGEX
- static int erroroffset;
- static char errbuf[4096];
-#else
+#ifdef USE_PCRE_REGEX
static const char *errbuf;
static int erroffset;
+#else
+ static int erroroffset;
+ static char errbuf[4096];
#endif
struct _binding {
struct _binding *next;
-#ifndef USE_PCRE_REGEX
- regex_t regexp; /* la regexp sous forme machine */
- regmatch_t match[MAX_MSG_FIELDS+1]; /* resultat du match */
-#else
+#ifdef USE_PCRE_REGEX
pcre *regexp;
pcre_extra *inspect;
int ovector[OVECSIZE];
+#else
+ regex_t regexp; /* la regexp sous forme machine */
+ regmatch_t match[MAX_MSG_FIELDS+1]; /* resultat du match */
#endif
};
@@ -92,19 +92,19 @@ IvyBinding IvyBindingCompile( const char * expression )
}
void IvyBindingGetCompileError( int *offset, const char **errmessage )
{
-#ifndef USE_PCRE_REGEX
- *offset = erroroffset;
+#ifdef USE_PCRE_REGEX
+ *offset = erroffset;
*errmessage = errbuf;
#else
- *offset = erroffset;
+ *offset = erroroffset;
*errmessage = errbuf;
#endif
}
void IvyBindingFree( IvyBinding bind )
{
#ifdef USE_PCRE_REGEX
- if (bind->inspect!=NULL) pcre_free(bind->inspect);
- pcre_free(bind->regexp);
+ if (bind->inspect!=NULL) pcre_free(bind->inspect);
+ pcre_free(bind->regexp);
#else
#endif
free ( bind );