home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / uccs / root.14 / udk / usr / include / glob.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-19  |  2.0 KB  |  60 lines

  1. /*
  2.  * Copyright (c) 1998 The Santa Cruz Operation, Inc.. All Rights Reserved. 
  3.  *                                                                         
  4.  *        THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF THE               
  5.  *                   SANTA CRUZ OPERATION INC.                             
  6.  *                                                                         
  7.  *   The copyright notice above does not evidence any actual or intended   
  8.  *   publication of such source code.                                      
  9.  */
  10.  
  11. #ifndef _GLOB_H
  12. #define _GLOB_H
  13. #ident    "@(#)sgs-head:common/head/glob.h    1.6"
  14.  
  15. #ifndef _SIZE_T
  16. #   define _SIZE_T
  17.     typedef unsigned int    size_t;
  18. #endif
  19.  
  20. #define GLOB_APPEND    0x0001    /* add to existing list */
  21. #define GLOB_DOOFFS    0x0002    /* reserve initial slots */
  22. #define    GLOB_ERR    0x0004    /* return early on opendir() failure */
  23. #define    GLOB_MARK    0x0008    /* append "/" on directory matches */
  24. #define    GLOB_NOCHECK    0x0010    /* unmatched pattern is single result */
  25. #define    GLOB_NOSORT    0x0020    /* don't sort the resulting strings */
  26. #define GLOB_NOESCAPE    0x0040    /* don't take \ as quote */
  27. #define GLOB_FULLMARK    0x0080    /* append "/", "@", "*", "|" like ls(1) */
  28. #define GLOB_NOCOLLATE    0x0100    /* use "C" sorting order */
  29. #define GLOB_OKAYDOT    0x0200    /* permit leading . to match specials */
  30. #define GLOB_BADRANGE    0x0400    /* accept [m-a] ranges as [ma] */
  31. #define GLOB_BKTESCAPE    0x0800    /* allow \ in []s to quote next anything */
  32. #define GLOB_EXTENDED    0x1000    /* use full ksh-style patterns */
  33.  
  34. #define GLOB_NOSYS    (-1)
  35. #define GLOB_ABORTED    (-2)
  36. #define GLOB_NOSPACE    (-3)
  37. #define GLOB_NOMATCH    (-4)
  38. #define GLOB_BADPAT    (-5)
  39.  
  40. typedef struct
  41. {
  42.     struct gl_str    *gl_str;    /* for memory management */
  43.     char        **gl_pathv;    /* list of matched pathnames */
  44.     size_t        gl_pathc;    /* length of gl_pathv[] (less 1) */
  45.     size_t        gl_offs;    /* slots to reserve in gl_pathv[] */
  46. } glob_t;
  47.  
  48. #ifdef __cplusplus
  49. extern "C" {
  50. #endif
  51.  
  52. extern int    glob(const char *, int, int (*)(const char *, int), glob_t *);
  53. extern void    globfree(glob_t *);
  54.  
  55. #ifdef __cplusplus
  56. }
  57. #endif
  58.  
  59. #endif /*_GLOB_H*/
  60.