Add header guards to the header files.

darcs-hash:20051004151139-35ec8-7af69b9d7647d145dc621f7eaea726e729cff554.gz
This commit is contained in:
James Vega 2005-10-05 01:11:39 +10:00
parent c361d8564c
commit e27664b13b
27 changed files with 191 additions and 14 deletions

View File

@ -2,6 +2,12 @@
Prototypes for functions for executing builtin functions. Prototypes for functions for executing builtin functions.
*/ */
#ifndef FISH_BUILTIN_H
#define FISH_BUILTIN_H
#include <wchar.h>
#include "util.h"
enum enum
{ {
@ -99,3 +105,5 @@ void builtin_print_help( wchar_t *cmd, string_buffer_t *b );
int builtin_set(wchar_t **argv); int builtin_set(wchar_t **argv);
int builtin_commandline(wchar_t **argv); int builtin_commandline(wchar_t **argv);
#endif

View File

@ -4,6 +4,12 @@
corresponding .c file is automatically generated by combining the corresponding .c file is automatically generated by combining the
builtin_help.hdr file with doxygen output. builtin_help.hdr file with doxygen output.
*/ */
#ifndef FISH_BUILTIN_HELP_H
#define FISH_BUILTIN_HELP_H
#include <wchar.h>
/** /**
Return the help text for the specified builtin command. Use Return the help text for the specified builtin command. Use
non-wide characters since wide characters have some issues with non-wide characters since wide characters have some issues with
@ -23,3 +29,4 @@ void builtin_help_init();
*/ */
void builtin_help_destroy(); void builtin_help_destroy();
#endif

View File

@ -2,6 +2,13 @@
Prototypes for various functions, mostly string utilities, that are used by most parts of fish. Prototypes for various functions, mostly string utilities, that are used by most parts of fish.
*/ */
#ifndef FISH_COMMON_H
#define FISH_COMMON_H
#include <wchar.h>
#include <termios.h>
#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. 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 block();
void unblock(); void unblock();
#endif
int acquire_lock_file( const char *lockfile, const int timeout, int force ); int acquire_lock_file( const char *lockfile, const int timeout, int force );

View File

@ -4,6 +4,13 @@
These functions are used for storing and retrieving tab-completion data, as well as for performing tab-completion. 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 <wchar.h>
#include "util.h"
/** Use all completions */ /** Use all completions */
#define SHARED 0 #define SHARED 0
/** Do not use file completion */ /** 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) \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 ); void complete_load( wchar_t *cmd, int reload );
#endif

9
env.h
View File

@ -2,6 +2,13 @@
Prototypes for functions for setting and getting environment variables. Prototypes for functions for setting and getting environment variables.
*/ */
#ifndef FISH_ENV_H
#define FISH_ENV_H
#include <wchar.h>
#include "util.h"
/** /**
Flag for local (to the current block) variable 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 ); void env_get_names( array_list_t *l, int flags );
#endif

View File

@ -2,8 +2,10 @@
Universal variable client library Universal variable client library
*/ */
#ifndef ENV_UNIVERSAL_HH #ifndef ENV_UNIVERSAL_H
#define ENV_UNIVERSAL_HH #define ENV_UNIVERSAL_H
#include <wchar.h>
#include "env_universal_common.h" #include "env_universal_common.h"

View File

@ -1,6 +1,9 @@
#ifndef ENV_UNIVERSAL_COMMON_HH #ifndef FISH_ENV_UNIVERSAL_COMMON_H
#define ENV_UNIVERSAL_COMMON_HH #define FISH_ENV_UNIVERSAL_COMMON_H
#include <wchar.h>
#include "util.h"
/** /**
The set command The set command

10
exec.h
View File

@ -2,6 +2,14 @@
Prototypes for functions for executing a program Prototypes for functions for executing a program
*/ */
#ifndef FISH_EXEC_H
#define FISH_EXEC_H
#include <wchar.h>
#include "proc.h"
#include "util.h"
/** /**
Initialize the exec library 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. Close writing end of IO_BUFFER type io redirection, and fully read the reading end.
*/ */
void exec_read_io_buffer( io_data_t *d ); void exec_read_io_buffer( io_data_t *d );
#endif

View File

@ -9,6 +9,13 @@
*/ */
#ifndef FISH_EXPAND_H
#define FISH_EXPAND_H
#include <wchar.h>
#include "util.h"
/** /**
Flag specifying that subshell expantion should be skipped 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 ); void expand_variable_array( const wchar_t *val, array_list_t *out );
#endif

View File

@ -5,6 +5,13 @@
parser and to some degree the builtin handling library. parser and to some degree the builtin handling library.
*/ */
#ifndef FISH_FUNCTION_H
#define FISH_FUNCTION_H
#include <wchar.h>
#include "util.h"
/** /**
Initialize function data Initialize function data
*/ */
@ -61,4 +68,4 @@ int function_exists( const wchar_t *name);
void function_get_names( array_list_t *list, void function_get_names( array_list_t *list,
int get_hidden ); int get_hidden );
#endif

View File

@ -2,6 +2,13 @@
Prototypes for functions for syntax highlighting Prototypes for functions for syntax highlighting
*/ */
#ifndef FISH_HIGHLIGHT_H
#define FISH_HIGHLIGHT_H
#include <wchar.h>
#include "util.h"
/** /**
Perform syntax highlighting for the shell commands in buff. The result is 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 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. FISH_COLOR_RED.
*/ */
int highlight_get_color( int highlight ); int highlight_get_color( int highlight );
#endif

View File

@ -2,6 +2,11 @@
Prototypes for history functions, part of the user interface. Prototypes for history functions, part of the user interface.
*/ */
#ifndef FISH_HISTORY_H
#define FISH_HISTORY_H
#include <wchar.h>
/** /**
Load history from file. Load history from file.
*/ */
@ -63,3 +68,4 @@ void history_set_mode( wchar_t *name );
*/ */
void history_sanity_check(); void history_sanity_check();
#endif

View File

@ -5,6 +5,11 @@ inputrc information for key bindings.
*/ */
#ifndef FISH_INPUT_H
#define FISH_INPUT_H
#include <wchar.h>
/** /**
Key codes for inputrc-style keyboard functions that are passed on Key codes for inputrc-style keyboard functions that are passed on
to the caller of input_read() 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 ); wchar_t input_get_code( wchar_t *name );
#endif

View File

@ -3,8 +3,10 @@
Header file for the low level input library Header file for the low level input library
*/ */
#ifndef INPUT_COMMON_HH #ifndef INPUT_COMMON_H
#define INPUT_COMMON_HH #define INPUT_COMMON_H
#include <wchar.h>
/** /**
Hopefully, the biggest value that a wchar_t can have. UCS4 is a Hopefully, the biggest value that a wchar_t can have. UCS4 is a

View File

@ -4,6 +4,11 @@
*/ */
#ifndef FISH_INTERN_H
#define FISH_INTERN_H
#include <wchar.h>
/** /**
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. 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 Free all interned strings
*/ */
void intern_free_all(); void intern_free_all();
#endif

6
kill.h
View File

@ -4,6 +4,11 @@
Works like the killring in emacs and readline. The killring is cut and paste whith a memory of previous cuts. 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 <wchar.h>
/** /**
Add a string to the top of the killring Add a string to the top of the killring
*/ */
@ -29,3 +34,4 @@ void kill_init();
*/ */
void kill_destroy(); void kill_destroy();
#endif

View File

@ -0,0 +1,4 @@
#ifndef FISH_MIMEDB_H
#define FISH_MIMEDB_H
#endif

View File

@ -1,6 +1,12 @@
/** /**
Constants for various character classifications. Each character of a command string can be classified as one of the following types. 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 <wchar.h>
enum enum
{ {
HIGHLIGHT_NORMAL, HIGHLIGHT_NORMAL,
@ -87,3 +93,4 @@ int writespace( int c );
int output_color_code( const wchar_t *val ); int output_color_code( const wchar_t *val );
#endif

View File

@ -2,6 +2,15 @@
The fish parser. The fish parser.
*/ */
#ifndef FISH_PARSER_H
#define FISH_PARSER_H
#include <wchar.h>
#include "proc.h"
#include "util.h"
#include "parser.h"
/** /**
block_t represents a block of commands. block_t represents a block of commands.
*/ */
@ -267,3 +276,4 @@ void parser_destroy();
*/ */
int parser_is_help( wchar_t *s, int min_match ); int parser_is_help( wchar_t *s, int min_match );
#endif

10
proc.h
View File

@ -8,6 +8,15 @@
*/ */
#ifndef FISH_PROC_H
#define FISH_PROC_H
#include <wchar.h>
#include <signal.h>
#include <unistd.h>
#include "util.h"
/** /**
Describes what type of IO operation an io_data_t represents Describes what type of IO operation an io_data_t represents
*/ */
@ -273,3 +282,4 @@ void proc_update_jiffies();
*/ */
void proc_sanity_check(); void proc_sanity_check();
#endif

View File

@ -6,6 +6,13 @@
features. features.
*/ */
#ifndef FISH_READER_H
#define FISH_READER_H
#include <wchar.h>
#include "util.h"
/** /**
Read commands from fd 0 until encountering EOF 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 ); void reader_replace_current_token( wchar_t *new_token );
#endif

View File

@ -2,6 +2,11 @@
Prototypes for functions for performing sanity checks on the program state Prototypes for functions for performing sanity checks on the program state
*/ */
#ifndef FISH_SANITY_H
#define FISH_SANITY_H
#include <wchar.h>
/** /**
Call this function to tell the program it is not in a sane state. 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 \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 ); void validate_pointer( const void *ptr, const wchar_t *err, int null_ok );
#endif

View File

@ -6,6 +6,11 @@
segments. segments.
*/ */
#ifndef FISH_TOKENIZER_H
#define FISH_TOKENIZER_H
#include <wchar.h>
/** /**
Token types Token types
*/ */
@ -144,3 +149,4 @@ void tok_set_pos( tokenizer *tok, int pos );
*/ */
const wchar_t *tok_get_desc( int type ); const wchar_t *tok_get_desc( int type );
#endif

7
util.h
View File

@ -2,6 +2,11 @@
Generic utilities library. Generic utilities library.
*/ */
#ifndef FISH_UTIL_H
#define FISH_UTIL_H
#include <wchar.h>
/** /**
Data structure for an automatically resizing dynamically allocated queue, 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 Get the current time in microseconds since Jan 1, 1970
*/ */
long long get_time(); long long get_time();
#endif

View File

@ -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, not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */ Cambridge, MA 02139, USA. */
#ifndef _WGETOPT_H #ifndef FISH_WGETOPT_H
#define _WGETOPT_H 1 #define FISH_WGETOPT_H
#include <wchar.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -142,4 +144,4 @@ extern int _wgetopt_internal ();
} }
#endif #endif
#endif /* _WGETOPT_H */ #endif /* FISH_WGETOPT_H */

View File

@ -7,6 +7,13 @@
*/ */
#ifndef FISH_WILDCARD_H
#define FISH_WILDCARD_H
#include <wchar.h>
#include "util.h"
/* /*
These constants are outside the 31 bit character space of USC4, These constants are outside the 31 bit character space of USC4,
thogh they may clash with WEOF. I need to use characters outside of 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 *), const wchar_t *(*desc_func)(const wchar_t *),
array_list_t *out ); array_list_t *out );
#endif

View File

@ -4,13 +4,13 @@
functions. functions.
*/ */
#ifndef WUTIL_HH #ifndef FISH_WUTIL_H
#define WUTIL_HH #define FISH_WUTIL_H
#include <sys/types.h> #include <wchar.h>
#include <dirent.h> #include <dirent.h>
#include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
#include <sys/stat.h>
/** /**