Imported from ../bash-2.05b.tar.gz.
[platform/upstream/bash.git] / builtins / common.h
index dbebeda..a971bcd 100644 (file)
@@ -1,6 +1,6 @@
 /* common.h -- extern declarations for functions defined in common.c. */
 
-/* Copyright (C) 1993 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2002 Free Software Foundation, Inc.
 
    This file is part of GNU Bash, the Bourne Again SHell.
 
 #define ISOPTION(s, c) (s[0] == '-' && !s[2] && s[1] == c)
 
 /* Flag values for parse_and_execute () */
-#define SEVAL_NONINT   0x01
-#define SEVAL_INTERACT 0x02
-#define SEVAL_NOHIST   0x04
+#define SEVAL_NONINT   0x001
+#define SEVAL_INTERACT 0x002
+#define SEVAL_NOHIST   0x004
+#define SEVAL_NOFREE   0x008
+
+/* Flags for describe_command, shared between type.def and command.def */
+#define CDESC_ALL              0x001   /* type -a */
+#define CDESC_SHORTDESC                0x002   /* command -V */
+#define CDESC_REUSABLE         0x004   /* command -v */
+#define CDESC_TYPE             0x008   /* type -t */
+#define CDESC_PATH_ONLY                0x010   /* type -p */
+#define CDESC_FORCE_PATH       0x020   /* type -ap or type -P */
+#define CDESC_NOFUNCS          0x040   /* type -f */
+
+/* Flags for get_job_by_name */
+#define JM_PREFIX              0x01    /* prefix of job name */
+#define JM_SUBSTRING           0x02    /* substring of job name */
+#define JM_EXACT               0x04    /* match job name exactly */
+#define JM_STOPPED             0x08    /* match stopped jobs only */
+#define JM_FIRSTMATCH          0x10    /* return first matching job */
+
+/* Flags for remember_args and value of changed_dollar_vars */
+#define ARGS_NONE              0x0
+#define ARGS_INVOC             0x01
+#define ARGS_FUNC              0x02
+#define ARGS_SETBLTIN          0x04
 
 /* Functions from common.c */
 extern void builtin_error __P((const char *, ...))  __attribute__((__format__ (printf, 1, 2)));
 extern void builtin_usage __P((void));
 extern void no_args __P((WORD_LIST *));
-extern void bad_option __P((char *));
 extern int no_options __P((WORD_LIST *));
 
+/* common error message functions */
+extern void sh_needarg __P((char *));
+extern void sh_neednumarg __P((char *));
+extern void sh_notfound __P((char *));
+extern void sh_invalidopt __P((char *));
+extern void sh_invalidoptname __P((char *));
+extern void sh_invalidid __P((char *));
+extern void sh_invalidnum __P((char *));
+extern void sh_invalidsig __P((char *));
+extern void sh_erange __P((char *, char *));
+extern void sh_badpid __P((char *));
+extern void sh_badjob __P((char *));
+extern void sh_readonly __P((const char *));
+extern void sh_nojobs __P((char *));
+extern void sh_restricted __P((char *));
+
 extern char **make_builtin_argv __P((WORD_LIST *, int *));
 extern void remember_args __P((WORD_LIST *, int));
 
-extern void push_context __P((void));
-extern void pop_context __P((void));
-extern void push_dollar_vars __P((void));
-extern void pop_dollar_vars __P((void));
-extern void dispose_saved_dollar_vars __P((void));
 extern int dollar_vars_changed __P((void));
 extern void set_dollar_vars_unchanged __P((void));
 extern void set_dollar_vars_changed __P((void));
 
-extern long get_numeric_arg __P((WORD_LIST *, int));
+extern intmax_t get_numeric_arg __P((WORD_LIST *, int));
 extern int get_exitstat __P((WORD_LIST *));
 extern int read_octal __P((char *));
 
@@ -59,6 +92,7 @@ extern char *get_working_directory __P((char *));
 extern void set_working_directory __P((char *));
 
 #if defined (JOB_CONTROL)
+extern int get_job_by_name __P((const char *, int));
 extern int get_job_spec __P((WORD_LIST *));
 #endif
 extern int display_signal_list __P((WORD_LIST *, int));
@@ -96,7 +130,7 @@ extern int shopt_listopt __P((char *, int));
 extern int set_login_shell __P((int));
 
 /* Functions from type.def */
-extern int describe_command __P((char *, int, int));
+extern int describe_command __P((char *, int));
 
 /* Functions from setattr.def */
 extern int set_or_show_attributes __P((WORD_LIST *, int, int));
@@ -106,8 +140,8 @@ extern void set_var_attribute __P((char *, int, int));
 
 /* Functions from pushd.def */
 extern char *get_dirstack_from_string __P((char *));
-extern char *get_dirstack_element __P((long, int));
-extern void set_dirstack_element __P((long, int, char *));
+extern char *get_dirstack_element __P((intmax_t, int));
+extern void set_dirstack_element __P((intmax_t, int, char *));
 extern WORD_LIST *get_directory_stack __P((void));
 
 /* Functions from evalstring.c */