From 784c413690c71212ad9e08bb093414abd1cacc08 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Fri, 6 Aug 1999 18:01:35 +0000 Subject: zsh-3.1.6-pws-1 --- Src/zsh.h | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) (limited to 'Src/zsh.h') diff --git a/Src/zsh.h b/Src/zsh.h index d2b64b9bb..fe80a17bb 100644 --- a/Src/zsh.h +++ b/Src/zsh.h @@ -260,6 +260,7 @@ typedef struct builtin *Builtin; typedef struct nameddir *Nameddir; typedef struct module *Module; +typedef struct patprog *Patprog; typedef struct process *Process; typedef struct job *Job; typedef struct value *Value; @@ -270,7 +271,6 @@ typedef struct cmd *Cmd; typedef struct pline *Pline; typedef struct sublist *Sublist; typedef struct list *List; -typedef struct comp *Comp; typedef struct redir *Redir; typedef struct complist *Complist; typedef struct heap *Heap; @@ -906,6 +906,57 @@ struct hookdef { #define HOOKDEF(name, func, flags) { NULL, name, (Hookfn) func, flags, NULL } +/* + * Types used in pattern matching. Most of these longs could probably + * happily be ints. + */ + +#define NSUBEXP 10 +struct patprog { + long startoff; /* length before start of programme */ + long size; /* total size from start of struct */ + long mustoff; /* offset to string that must be present */ + int globflags; /* globbing flags to set at start */ + int globend; /* globbing flags set after finish */ + int flags; /* PAT_* flags */ + int patmlen; + char patstartch; +#ifdef BACKREFERENCES + unsigned char * ppStartp[NSUBEXP]; + unsigned char * ppEndp[NSUBEXP]; +}; + +/* Same as patprog, but without the backreference storage. + * Note the calling code must test PAT_BACKR to know which is + * which, since they are both passed back as a Patprog. + */ + +struct patprog_short { + long startoff; + long size; + long mustoff; + int globflags; + int globend; + int flags; + int patmlen; + char patstartch; +#endif +}; + +/* Flags used in pattern matchers (Patprog) and passed down to patcompile */ + +#define PAT_FILE 0x0001 /* Pattern is a file name */ +#define PAT_FILET 0x0002 /* Pattern is top level file, affects ~ */ +#define PAT_ANY 0x0004 /* Match anything (cheap "*") */ +#define PAT_NOANCH 0x0008 /* Not anchored at end */ +#define PAT_NOGLD 0x0010 /* Don't glob dots */ +#define PAT_PURES 0x0020 /* Pattern is a pure string: set internally */ +#define PAT_STATIC 0x0040 /* Don't copy pattern to heap as per default */ +#define PAT_SCAN 0x0080 /* Scanning, so don't try must-match test */ +#ifdef BACKREFERENCES +#define PAT_BACKR 0x0100 /* Parentheses make backreferences */ +#endif + /* node used in parameter hash table (paramtab) */ struct param { -- cgit 1.4.1