-#ifndef __URLGLOB_H
-#define __URLGLOB_H
+#ifndef HEADER_CURL_TOOL_URLGLOB_H
+#define HEADER_CURL_TOOL_URLGLOB_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* KIND, either express or implied.
*
***************************************************************************/
+#include "tool_setup.h"
+
typedef enum {
- UPTSet=1,
+ UPTSet = 1,
UPTCharRange,
UPTNumRange
} URLPatternType;
short ptr_s;
} Set;
struct {
- char min_c, max_c;
+ char min_c;
+ char max_c;
char ptr_c;
int step;
} CharRange;
struct {
- int min_n, max_n;
+ int min_n;
+ int max_n;
short padlength;
int ptr_n;
int step;
} content;
} URLPattern;
+/* the total number of globs supported */
+#define GLOB_PATTERN_NUM 9
+
typedef struct {
- char* literal[10];
- URLPattern pattern[9];
+ char *literal[10];
+ URLPattern pattern[GLOB_PATTERN_NUM+1];
size_t size;
size_t urllen;
char *glob_buffer;
} URLGlob;
int glob_url(URLGlob**, char*, int *, FILE *);
-char* glob_next_url(URLGlob*);
-char* glob_match_url(char*, URLGlob *);
+int glob_next_url(char **, URLGlob *);
+int glob_match_url(char **, char*, URLGlob *);
void glob_cleanup(URLGlob* glob);
-#endif
+#endif /* HEADER_CURL_TOOL_URLGLOB_H */
+