Navit SVN

/work/compile/navit/src/navit/support/wordexp/wordexp.h

00001 #ifndef _WORDEXP_H_
00002 #define _WORDEXP_H_
00003 
00004 
00005 typedef struct {
00006         size_t  we_wordc;               /* count of words matched */
00007         char            **we_wordv;     /* pointer to list of words */
00008         size_t  we_offs;                /* slots to reserve in we_wordv */
00009                                         /* following are internals */
00010         char            *we_strings;    /* storage for wordv strings */
00011         size_t  we_nbytes;              /* size of we_strings */
00012 } wordexp_t;
00013 
00014 /*
00015  * Flags for wordexp().
00016  */
00017 #define WRDE_APPEND     0x1             /* append to previously generated */
00018 #define WRDE_DOOFFS     0x2             /* we_offs member is valid */
00019 #define WRDE_NOCMD      0x4             /* disallow command substitution */
00020 #define WRDE_REUSE      0x8             /* reuse wordexp_t */
00021 #define WRDE_SHOWERR    0x10            /* don't redirect stderr to /dev/null */
00022 #define WRDE_UNDEF      0x20            /* disallow undefined shell vars */
00023 
00024 /*
00025  * Return values from wordexp().
00026  */
00027 #define WRDE_BADCHAR    1               /* unquoted special character */
00028 #define WRDE_BADVAL     2               /* undefined variable */
00029 #define WRDE_CMDSUB     3               /* command substitution not allowed */
00030 #define WRDE_NOSPACE    4               /* no memory for result */
00031 #if (_XOPEN_SOURCE - 0) >= 4 || defined(_NETBSD_SOURCE)
00032 #define WRDE_NOSYS      5               /* obsolete, reserved */
00033 #endif
00034 #define WRDE_SYNTAX     6               /* shell syntax error */
00035 #define WRDE_ERRNO      7               /* other errors see errno */
00036 
00037 void    wordfree(wordexp_t *);
00038 int wordexp(const char * words, wordexp_t * we, int flags);
00039 
00040 
00041 #endif /* !_WORDEXP_H_ */
00042