#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
-#include <unistd.h>
#include <errno.h>
+#ifndef _MSC_VER
+#include <unistd.h>
+#endif
typedef enum {
MATCH_LITERAL,
MATCH_ANYCHAR,
MATCH_ANYTHING,
- MATCH_ANYTHING_END
+ MATCH_ANYTHING_END,
+ MATCH_INVALID = -1
} MatchType;
typedef struct {
compile_pattern (const gchar *pattern)
{
GSList *list;
- gint i, len;
+ size_t i, len;
PData *data;
gchar c;
- MatchType last = -1;
+ MatchType last = MATCH_INVALID;
GString *str;
gboolean free_str;
}
static gboolean
-match_string (GSList *list, const gchar *str, gint idx, gint max)
+match_string (GSList *list, const gchar *str, size_t idx, size_t max)
{
- gint len;
+ size_t len;
while (list && idx < max) {
PData *data = (PData *) list->data;
return match_string (pspec->pattern, string, 0, strlen (string));
}
+