Back to index

glibc  2.9
Classes | Defines | Enumerations | Functions
wordexp.h File Reference
#include <features.h>
#include <stddef.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  wordexp_t

Defines

#define __need_size_t

Enumerations

enum  {
  WRDE_DOOFFS = (1 << 0), WRDE_APPEND = (1 << 1), WRDE_NOCMD = (1 << 2), WRDE_REUSE = (1 << 3),
  WRDE_SHOWERR = (1 << 4), WRDE_UNDEF = (1 << 5), __WRDE_FLAGS
}
enum  {
  WRDE_NOSPACE = 1, WRDE_BADCHAR, WRDE_BADVAL, WRDE_CMDSUB,
  WRDE_SYNTAX
}

Functions

int wordexp (__const char *__restrict __words, wordexp_t *__restrict __pwordexp, int __flags)
void wordfree (wordexp_t *__wordexp) __THROW

Class Documentation

struct wordexp_t

Definition at line 42 of file wordexp.h.

Class Members
size_t we_offs
size_t we_wordc
char ** we_wordv

Define Documentation

#define __need_size_t

Definition at line 23 of file wordexp.h.


Enumeration Type Documentation

anonymous enum
Enumerator:
WRDE_DOOFFS 
WRDE_APPEND 
WRDE_NOCMD 
WRDE_REUSE 
WRDE_SHOWERR 
WRDE_UNDEF 
__WRDE_FLAGS 

Definition at line 29 of file wordexp.h.

  {
    WRDE_DOOFFS = (1 << 0), /* Insert PWORDEXP->we_offs NULLs.  */
    WRDE_APPEND = (1 << 1), /* Append to results of a previous call.  */
    WRDE_NOCMD = (1 << 2),  /* Don't do command substitution.  */
    WRDE_REUSE = (1 << 3),  /* Reuse storage in PWORDEXP.  */
    WRDE_SHOWERR = (1 << 4),       /* Don't redirect stderr to /dev/null.  */
    WRDE_UNDEF = (1 << 5),  /* Error for expanding undefined variables.  */
    __WRDE_FLAGS = (WRDE_DOOFFS | WRDE_APPEND | WRDE_NOCMD |
                  WRDE_REUSE | WRDE_SHOWERR | WRDE_UNDEF)
  };
anonymous enum
Enumerator:
WRDE_NOSPACE 
WRDE_BADCHAR 
WRDE_BADVAL 
WRDE_CMDSUB 
WRDE_SYNTAX 

Definition at line 50 of file wordexp.h.

  {
#ifdef __USE_XOPEN
    WRDE_NOSYS = -1,        /* Never used since we support `wordexp'.  */
#endif
    WRDE_NOSPACE = 1,              /* Ran out of memory.  */
    WRDE_BADCHAR,           /* A metachar appears in the wrong place.  */
    WRDE_BADVAL,            /* Undefined var reference with WRDE_UNDEF.  */
    WRDE_CMDSUB,            /* Command substitution with WRDE_NOCMD.  */
    WRDE_SYNTAX                    /* Shell syntax error.  */
  };

Function Documentation

int wordexp ( __const char *__restrict  __words,
wordexp_t *__restrict  __pwordexp,
int  __flags 
)

Here is the caller graph for this function:

void wordfree ( wordexp_t __wordexp)

Definition at line 2230 of file wordexp.c.

{

  /* wordexp can set pwordexp to NULL */
  if (pwordexp && pwordexp->we_wordv)
    {
      char **wordv = pwordexp->we_wordv;

      for (wordv += pwordexp->we_offs; *wordv; ++wordv)
       free (*wordv);

      free (pwordexp->we_wordv);
      pwordexp->we_wordv = NULL;
    }
}

Here is the caller graph for this function: