Imported Upstream version 7.32.0
[platform/upstream/curl.git] / src / tool_urlglob.h
similarity index 75%
rename from src/urlglob.h
rename to src/tool_urlglob.h
index a5b789e..9c08137 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __URLGLOB_H
-#define __URLGLOB_H
+#ifndef HEADER_CURL_TOOL_URLGLOB_H
+#define HEADER_CURL_TOOL_URLGLOB_H
 /***************************************************************************
  *                                  _   _ ____  _
  *  Project                     ___| | | |  _ \| |
@@ -7,7 +7,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * 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;
@@ -36,12 +38,14 @@ typedef struct {
       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;
@@ -49,9 +53,12 @@ typedef struct {
   } content;
 } URLPattern;
 
+/* the total number of globs supported */
+#define GLOB_PATTERN_NUM 9
+
 typedef struct {
-  charliteral[10];
-  URLPattern pattern[9];
+  char *literal[10];
+  URLPattern pattern[GLOB_PATTERN_NUM+1];
   size_t size;
   size_t urllen;
   char *glob_buffer;
@@ -60,8 +67,9 @@ typedef struct {
 } 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 */
+