Initial revision
[platform/upstream/curl.git] / src / urlglob.h
1 #ifndef __URLGLOB_H
2 #define __URLGLOB_H
3 /*****************************************************************************
4  *                                  _   _ ____  _     
5  *  Project                     ___| | | |  _ \| |    
6  *                             / __| | | | |_) | |    
7  *                            | (__| |_| |  _ <| |___ 
8  *                             \___|\___/|_| \_\_____|
9  *
10  *  The contents of this file are subject to the Mozilla Public License
11  *  Version 1.0 (the "License"); you may not use this file except in
12  *  compliance with the License. You may obtain a copy of the License at
13  *  http://www.mozilla.org/MPL/
14  *
15  *  Software distributed under the License is distributed on an "AS IS"
16  *  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
17  *  License for the specific language governing rights and limitations
18  *  under the License.
19  *
20  *  The Original Code is Curl.
21  *
22  *  The Initial Developer of the Original Code is Daniel Stenberg.
23  *
24  *  Portions created by the Initial Developer are Copyright (C) 1998.
25  *  All Rights Reserved.
26  *
27  * ------------------------------------------------------------
28  * Main author:
29  * - Daniel Stenberg <Daniel.Stenberg@haxx.nu>
30  *
31  *      http://curl.haxx.nu
32  *
33  * $Source$
34  * $Revision$
35  * $Date$
36  * $Author$
37  * $State$
38  * $Locker$
39  *
40  * ------------------------------------------------------------
41  ****************************************************************************/
42 typedef enum {UPTSet=1,UPTCharRange,UPTNumRange} URLPatternType;
43
44 typedef struct {
45   URLPatternType type;
46   union {
47     struct {
48       char **elements;
49       short size;
50       short ptr_s;
51     } Set;
52     struct {
53       char min_c, max_c;
54       char ptr_c;
55     } CharRange;
56     struct {
57       int min_n, max_n;
58       short padlength;
59       int ptr_n;
60     } NumRange ;
61   } content;
62 } URLPattern;
63
64 typedef struct {
65   char* literal[10];
66   URLPattern pattern[9];
67   int size;
68 } URLGlob;
69
70 int glob_url(URLGlob**, char*);
71 char* next_url(URLGlob*);
72 char* match_url(char*, URLGlob); 
73
74 #endif