Git init
[external/curl.git] / src / urlglob.h
1 #ifndef __URLGLOB_H
2 #define __URLGLOB_H
3 /***************************************************************************
4  *                                  _   _ ____  _
5  *  Project                     ___| | | |  _ \| |
6  *                             / __| | | | |_) | |
7  *                            | (__| |_| |  _ <| |___
8  *                             \___|\___/|_| \_\_____|
9  *
10  * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
11  *
12  * This software is licensed as described in the file COPYING, which
13  * you should have received as part of this distribution. The terms
14  * are also available at http://curl.haxx.se/docs/copyright.html.
15  *
16  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17  * copies of the Software, and permit persons to whom the Software is
18  * furnished to do so, under the terms of the COPYING file.
19  *
20  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21  * KIND, either express or implied.
22  *
23  ***************************************************************************/
24 typedef enum {
25   UPTSet=1,
26   UPTCharRange,
27   UPTNumRange
28 } URLPatternType;
29
30 typedef struct {
31   URLPatternType type;
32   union {
33     struct {
34       char **elements;
35       short size;
36       short ptr_s;
37     } Set;
38     struct {
39       char min_c, max_c;
40       char ptr_c;
41       int step;
42     } CharRange;
43     struct {
44       int min_n, max_n;
45       short padlength;
46       int ptr_n;
47       int step;
48     } NumRange ;
49   } content;
50 } URLPattern;
51
52 typedef struct {
53   char* literal[10];
54   URLPattern pattern[9];
55   size_t size;
56   size_t urllen;
57   char *glob_buffer;
58   char beenhere;
59   char errormsg[80]; /* error message buffer */
60 } URLGlob;
61
62 int glob_url(URLGlob**, char*, int *, FILE *);
63 char* glob_next_url(URLGlob*);
64 char* glob_match_url(char*, URLGlob *);
65 void glob_cleanup(URLGlob* glob);
66
67 #endif