diff --git a/builtin.h b/builtin.h index 2c1a2d1..386797f 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 556d2e6..c831b3e 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 c5d60a8..4035716 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 9a8f33c..2e6ac11 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 69dc94b..b982fa3 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 7a226f0..0b42bb7 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 286da9c..bec9c93 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 4266a9c..1480263 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 5193894..ce87a55 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 e70386d..b851269 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 fbea36e..f1f381b 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 dd83b1c..cfed645 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 35eec3a..5bf5469 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 ad4f862..2e7edd8 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 7e0fded..3f3a414 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 f3005bb..986ce54 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 e69de29..8c5c4e6 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 cf6fc9b..a3d38bd 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 e89931e..04b091e 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 c8f4438..c92a6d1 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 b9e95fe..167fdba 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 5cb2235..0ca8cd2 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 45bbb5c..a0b0109 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 9e751d2..88d828b 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 9421c64..d1759d6 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 27c74d3..c7478b0 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 65b8201..c0f57ef 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 /**