From e27664b13b11070e561fdd313ca0a5b9950c2c46 Mon Sep 17 00:00:00 2001 From: James Vega Date: Wed, 5 Oct 2005 01:11:39 +1000 Subject: [PATCH] Add header guards to the header files. darcs-hash:20051004151139-35ec8-7af69b9d7647d145dc621f7eaea726e729cff554.gz --- builtin.h | 8 ++++++++ builtin_help.h | 7 +++++++ common.h | 9 +++++++++ complete.h | 9 +++++++++ env.h | 9 +++++++++ env_universal.h | 6 ++++-- env_universal_common.h | 7 +++++-- exec.h | 10 ++++++++++ expand.h | 8 ++++++++ function.h | 9 ++++++++- highlight.h | 9 +++++++++ history.h | 6 ++++++ input.h | 6 ++++++ input_common.h | 6 ++++-- intern.h | 7 +++++++ kill.h | 6 ++++++ mimedb.h | 4 ++++ output.h | 7 +++++++ parser.h | 10 ++++++++++ proc.h | 10 ++++++++++ reader.h | 8 ++++++++ sanity.h | 7 +++++++ tokenizer.h | 6 ++++++ util.h | 7 +++++++ wgetopt.h | 8 +++++--- wildcard.h | 8 ++++++++ wutil.h | 8 ++++---- 27 files changed, 191 insertions(+), 14 deletions(-) diff --git a/builtin.h b/builtin.h index 2c1a2d1ec..386797f50 100644 --- a/builtin.h +++ b/builtin.h @@ -2,6 +2,12 @@ Prototypes for functions for executing builtin functions. */ +#ifndef FISH_BUILTIN_H +#define FISH_BUILTIN_H + +#include + +#include "util.h" enum { @@ -99,3 +105,5 @@ void builtin_print_help( wchar_t *cmd, string_buffer_t *b ); int builtin_set(wchar_t **argv); int builtin_commandline(wchar_t **argv); + +#endif diff --git a/builtin_help.h b/builtin_help.h index 556d2e6bf..c831b3e41 100644 --- a/builtin_help.h +++ b/builtin_help.h @@ -4,6 +4,12 @@ corresponding .c file is automatically generated by combining the builtin_help.hdr file with doxygen output. */ + +#ifndef FISH_BUILTIN_HELP_H +#define FISH_BUILTIN_HELP_H + +#include + /** Return the help text for the specified builtin command. Use non-wide characters since wide characters have some issues with @@ -23,3 +29,4 @@ void builtin_help_init(); */ void builtin_help_destroy(); +#endif diff --git a/common.h b/common.h index c5d60a8a7..403571619 100644 --- a/common.h +++ b/common.h @@ -2,6 +2,13 @@ Prototypes for various functions, mostly string utilities, that are used by most parts of fish. */ +#ifndef FISH_COMMON_H +#define FISH_COMMON_H + +#include +#include + +#include "util.h" /** Under curses, tputs expects an int (*func)(char) as its last parameter, but in ncurses, tputs expects a int (*func)(int) as its last parameter. tputs_arg_t is defined to always be what tputs expects. Hopefully. @@ -247,4 +254,6 @@ wchar_t *unescape( wchar_t * in, int escape_special ); void block(); void unblock(); +#endif + int acquire_lock_file( const char *lockfile, const int timeout, int force ); diff --git a/complete.h b/complete.h index 9a8f33cea..2e6ac11d3 100644 --- a/complete.h +++ b/complete.h @@ -4,6 +4,13 @@ These functions are used for storing and retrieving tab-completion data, as well as for performing tab-completion. */ +#ifndef FISH_COMPLETE_H +#define FISH_COMPLETE_H + +#include + +#include "util.h" + /** Use all completions */ #define SHARED 0 /** Do not use file completion */ @@ -153,3 +160,5 @@ int complete_is_valid_argument( const wchar_t *str, \param reload should the commands completions be reloaded, even if they where previously loaded. (This is set to true on actual completions, so that changed completion are updated in running shells) */ void complete_load( wchar_t *cmd, int reload ); + +#endif diff --git a/env.h b/env.h index 69dc94bf6..b982fa36a 100644 --- a/env.h +++ b/env.h @@ -2,6 +2,13 @@ Prototypes for functions for setting and getting environment variables. */ +#ifndef FISH_ENV_H +#define FISH_ENV_H + +#include + +#include "util.h" + /** Flag for local (to the current block) variable */ @@ -102,3 +109,5 @@ char **env_export_arr( int recalc ); */ void env_get_names( array_list_t *l, int flags ); + +#endif diff --git a/env_universal.h b/env_universal.h index 7a226f059..0b42bb725 100644 --- a/env_universal.h +++ b/env_universal.h @@ -2,8 +2,10 @@ Universal variable client library */ -#ifndef ENV_UNIVERSAL_HH -#define ENV_UNIVERSAL_HH +#ifndef ENV_UNIVERSAL_H +#define ENV_UNIVERSAL_H + +#include #include "env_universal_common.h" diff --git a/env_universal_common.h b/env_universal_common.h index 286da9c6f..bec9c93da 100644 --- a/env_universal_common.h +++ b/env_universal_common.h @@ -1,6 +1,9 @@ -#ifndef ENV_UNIVERSAL_COMMON_HH -#define ENV_UNIVERSAL_COMMON_HH +#ifndef FISH_ENV_UNIVERSAL_COMMON_H +#define FISH_ENV_UNIVERSAL_COMMON_H +#include + +#include "util.h" /** The set command diff --git a/exec.h b/exec.h index 4266a9c8c..148026363 100644 --- a/exec.h +++ b/exec.h @@ -2,6 +2,14 @@ Prototypes for functions for executing a program */ +#ifndef FISH_EXEC_H +#define FISH_EXEC_H + +#include + +#include "proc.h" +#include "util.h" + /** Initialize the exec library */ @@ -63,3 +71,5 @@ io_data_t *exec_make_io_buffer(); Close writing end of IO_BUFFER type io redirection, and fully read the reading end. */ void exec_read_io_buffer( io_data_t *d ); + +#endif diff --git a/expand.h b/expand.h index 519389485..ce87a5545 100644 --- a/expand.h +++ b/expand.h @@ -9,6 +9,13 @@ */ +#ifndef FISH_EXPAND_H +#define FISH_EXPAND_H + +#include + +#include "util.h" + /** Flag specifying that subshell expantion should be skipped */ @@ -168,3 +175,4 @@ wchar_t *expand_backslash( wchar_t * in, int escape_special ); */ void expand_variable_array( const wchar_t *val, array_list_t *out ); +#endif diff --git a/function.h b/function.h index e70386de2..b8512696a 100644 --- a/function.h +++ b/function.h @@ -5,6 +5,13 @@ parser and to some degree the builtin handling library. */ +#ifndef FISH_FUNCTION_H +#define FISH_FUNCTION_H + +#include + +#include "util.h" + /** Initialize function data */ @@ -61,4 +68,4 @@ int function_exists( const wchar_t *name); void function_get_names( array_list_t *list, int get_hidden ); - +#endif diff --git a/highlight.h b/highlight.h index fbea36e5b..f1f381b85 100644 --- a/highlight.h +++ b/highlight.h @@ -2,6 +2,13 @@ Prototypes for functions for syntax highlighting */ +#ifndef FISH_HIGHLIGHT_H +#define FISH_HIGHLIGHT_H + +#include + +#include "util.h" + /** Perform syntax highlighting for the shell commands in buff. The result is stored in the color array as a color_code from the HIGHLIGHT_ enum @@ -37,3 +44,5 @@ void highlight_universal( wchar_t * buff, int *color, int pos, array_list_t *err FISH_COLOR_RED. */ int highlight_get_color( int highlight ); + +#endif diff --git a/history.h b/history.h index dd83b1c83..cfed645c3 100644 --- a/history.h +++ b/history.h @@ -2,6 +2,11 @@ Prototypes for history functions, part of the user interface. */ +#ifndef FISH_HISTORY_H +#define FISH_HISTORY_H + +#include + /** Load history from file. */ @@ -63,3 +68,4 @@ void history_set_mode( wchar_t *name ); */ void history_sanity_check(); +#endif diff --git a/input.h b/input.h index 35eec3a97..5bf546995 100644 --- a/input.h +++ b/input.h @@ -5,6 +5,11 @@ inputrc information for key bindings. */ +#ifndef FISH_INPUT_H +#define FISH_INPUT_H + +#include + /** Key codes for inputrc-style keyboard functions that are passed on to the caller of input_read() @@ -107,3 +112,4 @@ void input_parse_inputrc_line( wchar_t *cmd ); */ wchar_t input_get_code( wchar_t *name ); +#endif diff --git a/input_common.h b/input_common.h index ad4f862f1..2e7edd865 100644 --- a/input_common.h +++ b/input_common.h @@ -3,8 +3,10 @@ Header file for the low level input library */ -#ifndef INPUT_COMMON_HH -#define INPUT_COMMON_HH +#ifndef INPUT_COMMON_H +#define INPUT_COMMON_H + +#include /** Hopefully, the biggest value that a wchar_t can have. UCS4 is a diff --git a/intern.h b/intern.h index 7e0fdedac..3f3a4147b 100644 --- a/intern.h +++ b/intern.h @@ -4,6 +4,11 @@ */ +#ifndef FISH_INTERN_H +#define FISH_INTERN_H + +#include + /** Return an identical copy of the specified string from a pool of unique strings. If the string was not in the pool, add a copy. @@ -22,3 +27,5 @@ const wchar_t *intern_static( const wchar_t *in ); Free all interned strings */ void intern_free_all(); + +#endif diff --git a/kill.h b/kill.h index f3005bb5a..986ce5457 100644 --- a/kill.h +++ b/kill.h @@ -4,6 +4,11 @@ Works like the killring in emacs and readline. The killring is cut and paste whith a memory of previous cuts. */ +#ifndef FISH_KILL_H +#define FISH_KILL_H + +#include + /** Add a string to the top of the killring */ @@ -29,3 +34,4 @@ void kill_init(); */ void kill_destroy(); +#endif diff --git a/mimedb.h b/mimedb.h index e69de29bb..8c5c4e610 100644 --- a/mimedb.h +++ b/mimedb.h @@ -0,0 +1,4 @@ +#ifndef FISH_MIMEDB_H +#define FISH_MIMEDB_H + +#endif diff --git a/output.h b/output.h index cf6fc9b65..a3d38bdef 100644 --- a/output.h +++ b/output.h @@ -1,6 +1,12 @@ /** Constants for various character classifications. Each character of a command string can be classified as one of the following types. */ + +#ifndef FISH_OUTPUT_H +#define FISH_OUTPUT_H + +#include + enum { HIGHLIGHT_NORMAL, @@ -87,3 +93,4 @@ int writespace( int c ); int output_color_code( const wchar_t *val ); +#endif diff --git a/parser.h b/parser.h index e89931e1d..04b091e04 100644 --- a/parser.h +++ b/parser.h @@ -2,6 +2,15 @@ The fish parser. */ +#ifndef FISH_PARSER_H +#define FISH_PARSER_H + +#include + +#include "proc.h" +#include "util.h" +#include "parser.h" + /** block_t represents a block of commands. */ @@ -267,3 +276,4 @@ void parser_destroy(); */ int parser_is_help( wchar_t *s, int min_match ); +#endif diff --git a/proc.h b/proc.h index c8f443809..c92a6d10e 100644 --- a/proc.h +++ b/proc.h @@ -8,6 +8,15 @@ */ +#ifndef FISH_PROC_H +#define FISH_PROC_H + +#include +#include +#include + +#include "util.h" + /** Describes what type of IO operation an io_data_t represents */ @@ -273,3 +282,4 @@ void proc_update_jiffies(); */ void proc_sanity_check(); +#endif diff --git a/reader.h b/reader.h index b9e95fef1..167fdbabe 100644 --- a/reader.h +++ b/reader.h @@ -6,6 +6,13 @@ features. */ +#ifndef FISH_READER_H +#define FISH_READER_H + +#include + +#include "util.h" + /** Read commands from fd 0 until encountering EOF */ @@ -184,3 +191,4 @@ void reader_current_token_extent( wchar_t **a, wchar_t **b, wchar_t **pa, wchar_ */ void reader_replace_current_token( wchar_t *new_token ); +#endif diff --git a/sanity.h b/sanity.h index 5cb223532..0ca8cd2a6 100644 --- a/sanity.h +++ b/sanity.h @@ -2,6 +2,11 @@ Prototypes for functions for performing sanity checks on the program state */ +#ifndef FISH_SANITY_H +#define FISH_SANITY_H + +#include + /** Call this function to tell the program it is not in a sane state. */ @@ -20,3 +25,5 @@ int sanity_check(); \param null_ok Wheter the pointer is allowed to point to 0 */ void validate_pointer( const void *ptr, const wchar_t *err, int null_ok ); + +#endif diff --git a/tokenizer.h b/tokenizer.h index 45bbb5cd4..a0b0109ec 100644 --- a/tokenizer.h +++ b/tokenizer.h @@ -6,6 +6,11 @@ segments. */ +#ifndef FISH_TOKENIZER_H +#define FISH_TOKENIZER_H + +#include + /** Token types */ @@ -144,3 +149,4 @@ void tok_set_pos( tokenizer *tok, int pos ); */ const wchar_t *tok_get_desc( int type ); +#endif diff --git a/util.h b/util.h index 9e751d2e0..88d828bf1 100644 --- a/util.h +++ b/util.h @@ -2,6 +2,11 @@ Generic utilities library. */ +#ifndef FISH_UTIL_H +#define FISH_UTIL_H + +#include + /** Data structure for an automatically resizing dynamically allocated queue, */ @@ -466,3 +471,5 @@ void b_append( buffer_t *b, const void *d, ssize_t len ); Get the current time in microseconds since Jan 1, 1970 */ long long get_time(); + +#endif diff --git a/wgetopt.h b/wgetopt.h index 9421c64e3..d1759d6b5 100644 --- a/wgetopt.h +++ b/wgetopt.h @@ -26,8 +26,10 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef _WGETOPT_H -#define _WGETOPT_H 1 +#ifndef FISH_WGETOPT_H +#define FISH_WGETOPT_H + +#include #ifdef __cplusplus extern "C" { @@ -142,4 +144,4 @@ extern int _wgetopt_internal (); } #endif -#endif /* _WGETOPT_H */ +#endif /* FISH_WGETOPT_H */ diff --git a/wildcard.h b/wildcard.h index 27c74d3f2..c7478b0b4 100644 --- a/wildcard.h +++ b/wildcard.h @@ -7,6 +7,13 @@ */ +#ifndef FISH_WILDCARD_H +#define FISH_WILDCARD_H + +#include + +#include "util.h" + /* These constants are outside the 31 bit character space of USC4, thogh they may clash with WEOF. I need to use characters outside of @@ -78,3 +85,4 @@ int wildcard_complete( const wchar_t *str, const wchar_t *(*desc_func)(const wchar_t *), array_list_t *out ); +#endif diff --git a/wutil.h b/wutil.h index 65b82014f..c0f57ef92 100644 --- a/wutil.h +++ b/wutil.h @@ -4,13 +4,13 @@ functions. */ -#ifndef WUTIL_HH -#define WUTIL_HH +#ifndef FISH_WUTIL_H +#define FISH_WUTIL_H -#include +#include #include -#include #include +#include /**