]> git.ipfire.org Git - thirdparty/bash.git/blobdiff - subst.h
Bash-4.4 patch 4
[thirdparty/bash.git] / subst.h
diff --git a/subst.h b/subst.h
index 7628939aac86037cc649468d3fe77394679ae8e9..a2a8294ed1516b8767b4ee881934c82bbec1b9fa 100644 (file)
--- a/subst.h
+++ b/subst.h
@@ -1,6 +1,6 @@
 /* subst.h -- Names of externally visible functions in subst.c. */
 
-/* Copyright (C) 1993-2009 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2015 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
    decide whether to retain the backslash.  Q_KEEP_BACKSLASH means
    to unconditionally retain the backslash.  Q_PATQUOTE means that we're
    expanding a pattern ${var%#[#%]pattern} in an expansion surrounded
-   by double quotes. */
-#define Q_DOUBLE_QUOTES  0x01
-#define Q_HERE_DOCUMENT  0x02
-#define Q_KEEP_BACKSLASH 0x04
-#define Q_PATQUOTE      0x08
-#define Q_QUOTED        0x10
-#define Q_ADDEDQUOTES   0x20
-#define Q_QUOTEDNULL    0x40
+   by double quotes. Q_DOLBRACE means we are expanding a ${...} word, so
+   backslashes should also escape { and } and be removed. */
+#define Q_DOUBLE_QUOTES  0x001
+#define Q_HERE_DOCUMENT  0x002
+#define Q_KEEP_BACKSLASH 0x004
+#define Q_PATQUOTE      0x008
+#define Q_QUOTED        0x010
+#define Q_ADDEDQUOTES   0x020
+#define Q_QUOTEDNULL    0x040
+#define Q_DOLBRACE      0x080
+#define Q_ARITH                 0x100  /* expanding string for arithmetic evaluation */
+#define Q_ARRAYSUB      0x200  /* expanding indexed array subscript */
 
 /* Flag values controlling how assignment statements are treated. */
-#define ASS_APPEND     0x01
-#define ASS_MKLOCAL    0x02
-#define ASS_MKASSOC    0x04
+#define ASS_APPEND     0x0001
+#define ASS_MKLOCAL    0x0002
+#define ASS_MKASSOC    0x0004
+#define ASS_MKGLOBAL   0x0008  /* force global assignment */
+#define ASS_NAMEREF    0x0010  /* assigning to nameref variable */
+#define ASS_FORCE      0x0020  /* force assignment even to readonly variable */
 
 /* Flags for the string extraction functions. */
-#define SX_NOALLOC     0x01    /* just skip; don't return substring */
-#define SX_VARNAME     0x02    /* variable name; for string_extract () */
-#define SX_REQMATCH    0x04    /* closing/matching delimiter required */
-#define SX_COMMAND     0x08    /* extracting a shell script/command */
-#define SX_NOCTLESC    0x10    /* don't honor CTLESC quoting */
-#define SX_NOESCCTLNUL 0x20    /* don't let CTLESC quote CTLNUL */
-#define SX_NOLONGJMP   0x40    /* don't longjmp on fatal error */
-#define SX_ARITHSUB    0x80    /* extracting $(( ... )) (currently unused) */
+#define SX_NOALLOC     0x0001  /* just skip; don't return substring */
+#define SX_VARNAME     0x0002  /* variable name; for string_extract () */
+#define SX_REQMATCH    0x0004  /* closing/matching delimiter required */
+#define SX_COMMAND     0x0008  /* extracting a shell script/command */
+#define SX_NOCTLESC    0x0010  /* don't honor CTLESC quoting */
+#define SX_NOESCCTLNUL 0x0020  /* don't let CTLESC quote CTLNUL */
+#define SX_NOLONGJMP   0x0040  /* don't longjmp on fatal error */
+#define SX_ARITHSUB    0x0080  /* extracting $(( ... )) (currently unused) */
+#define SX_POSIXEXP    0x0100  /* extracting new Posix pattern removal expansions in extract_dollar_brace_string */
+#define SX_WORD                0x0200  /* extracting word in ${param op word} */
+#define SX_COMPLETE    0x0400  /* extracting word for completion */
+#define SX_STRIPDQ     0x0800  /* strip double quotes when extracting double-quoted string */
 
 /* Remove backslashes which are quoting backquotes from STRING.  Modifies
    STRING, and returns a pointer to it. */
@@ -76,7 +87,7 @@ extern char *extract_arithmetic_subst __P((char *, int *));
 /* Extract the <( or >( construct in STRING, and return a new string.
    Start extracting at (SINDEX) as if we had just seen "<(".
    Make (SINDEX) get the position just after the matching ")". */
-extern char *extract_process_subst __P((char *, char *, int *));
+extern char *extract_process_subst __P((char *, char *, int *, int));
 #endif /* PROCESS_SUBSTITUTION */
 
 /* Extract the name of the variable to bind to from the assignment string. */
@@ -94,7 +105,7 @@ extern char *string_list __P((WORD_LIST *));
 extern char *string_list_dollar_star __P((WORD_LIST *));
 
 /* Expand $@ into a single string, obeying POSIX rules. */
-extern char *string_list_dollar_at __P((WORD_LIST *, int));
+extern char *string_list_dollar_at __P((WORD_LIST *, int, int));
 
 /* Turn the positional paramters into a string, understanding quoting and
    the various subtleties of using the first character of $IFS as the
@@ -121,13 +132,13 @@ extern char *strip_trailing_ifs_whitespace __P((char *, char *, int));
    splitting on the result of expansion. */
 extern int do_assignment __P((char *));
 extern int do_assignment_no_expand __P((char *));
-extern int do_word_assignment __P((WORD_DESC *));
+extern int do_word_assignment __P((WORD_DESC *, int));
 
 /* Append SOURCE to TARGET at INDEX.  SIZE is the current amount
    of space allocated to TARGET.  SOURCE can be NULL, in which
    case nothing happens.  Gets rid of SOURCE by free ()ing it.
    Returns TARGET in case the location has changed. */
-extern char *sub_append_string __P((char *, char *, int *, int *));
+extern char *sub_append_string __P((char *, char *, int *, size_t *));
 
 /* Append the textual representation of NUMBER to TARGET.
    INDEX and SIZE are as in SUB_APPEND_STRING. */
@@ -251,7 +262,15 @@ extern WORD_DESC *command_substitute __P((char *, int));
 extern char *pat_subst __P((char *, char *, char *, int));
 
 extern int fifos_pending __P((void));
+extern int num_fifos __P((void));
 extern void unlink_fifo_list __P((void));
+extern void unlink_fifo __P((int));
+
+extern char *copy_fifo_list __P((int *));
+extern void unlink_new_fifos __P((char *, int));
+extern void close_new_fifos __P((char *, int));
+
+extern void clear_fifo_list __P((void));
 
 extern WORD_LIST *list_string_with_quotes __P((char *));
 
@@ -265,13 +284,24 @@ extern char *cond_expand_word __P((WORD_DESC *, int));
 #endif
 
 /* Flags for skip_to_delim */
-#define SD_NOJMP       0x01    /* don't longjmp on fatal error. */
-#define SD_INVERT      0x02    /* look for chars NOT in passed set */
-#define SD_NOQUOTEDELIM        0x04    /* don't let single or double quotes act as delimiters */
-#define SD_NOSKIPCMD   0x08    /* don't skip over $(, <(, or >( command/process substitution */
+#define SD_NOJMP       0x001   /* don't longjmp on fatal error. */
+#define SD_INVERT      0x002   /* look for chars NOT in passed set */
+#define SD_NOQUOTEDELIM        0x004   /* don't let single or double quotes act as delimiters */
+#define SD_NOSKIPCMD   0x008   /* don't skip over $(, <(, or >( command/process substitution; parse them as commands */
+#define SD_EXTGLOB     0x010   /* skip over extended globbing patterns if appropriate */
+#define SD_IGNOREQUOTE 0x020   /* single and double quotes are not special */
+#define SD_GLOB                0x040   /* skip over glob patterns like bracket expressions */
+#define SD_NOPROCSUB   0x080   /* don't parse process substitutions as commands */
+#define SD_COMPLETE    0x100   /* skip_to_delim during completion */
+#define SD_HISTEXP     0x200   /* skip_to_delim during history expansion */
+#define SD_ARITHEXP    0x400   /* skip_to_delim during arithmetic expansion */
 
 extern int skip_to_delim __P((char *, int, char *, int));
 
+#if defined (BANG_HISTORY)
+extern int skip_to_histexp __P((char *, int, char *, int));
+#endif
+
 #if defined (READLINE)
 extern int char_is_quoted __P((char *, int));
 extern int unclosed_pair __P((char *, int, char *));
@@ -299,4 +329,6 @@ extern unsigned char ifs_firstc;
 /* Is the first character of STRING a quoted NULL character? */
 #define QUOTED_NULL(string) ((string)[0] == CTLNUL && (string)[1] == '\0')
 
+extern void invalidate_cached_quoted_dollar_at __P((void));
+
 #endif /* !_SUBST_H_ */