urlglob.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #ifndef __URLGLOB_H
  2. #define __URLGLOB_H
  3. /***************************************************************************
  4. * _ _ ____ _
  5. * Project ___| | | | _ \| |
  6. * / __| | | | |_) | |
  7. * | (__| |_| | _ <| |___
  8. * \___|\___/|_| \_\_____|
  9. *
  10. * Copyright (C) 1998 - 2004, 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. * $Id: urlglob.h,v 1.15 2004/03/08 12:51:33 bagder Exp $
  24. ***************************************************************************/
  25. typedef enum {
  26. UPTSet=1,
  27. UPTCharRange,
  28. UPTNumRange
  29. } URLPatternType;
  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. } CharRange;
  42. struct {
  43. int min_n, max_n;
  44. short padlength;
  45. int ptr_n;
  46. } NumRange ;
  47. } content;
  48. } URLPattern;
  49. typedef struct {
  50. char* literal[10];
  51. URLPattern pattern[9];
  52. int size;
  53. int urllen;
  54. char *glob_buffer;
  55. char beenhere;
  56. char errormsg[80]; /* error message buffer */
  57. } URLGlob;
  58. int glob_url(URLGlob**, char*, int *, FILE *);
  59. char* glob_next_url(URLGlob*);
  60. char* glob_match_url(char*, URLGlob *);
  61. void glob_cleanup(URLGlob* glob);
  62. #endif