From 8cc4198f9fabe5f10f5a773de1503d82f33a01fb Mon Sep 17 00:00:00 2001 From: paul Date: Fri, 6 May 2005 21:25:49 +0000 Subject: 2005-05-06 Paul Jakma * (general) extern and static'ification of functions in code and header. Cleanup any definitions with unspecified arguments. Add casts for callback assignments where the callback is defined, typically, as passing void *, but the function being assigned has some other pointer type defined as its argument, as gcc complains about casts from void * to X* via function arguments. Fix some old K&R style function argument definitions. Add noreturn gcc attribute to some functions, as appropriate. Add unused gcc attribute to some functions (eg ones meant to help while debugging) Add guard defines to headers which were missing them. * command.c: (install_node) add const qualifier, still doesnt shut up the warning though, because of the double pointer. (cmp_node) ditto * keychain.c: (key_str2time) Add GET_LONG_RANGE() macro, derived fromn vty.h ones to fix some of the (long) < 0 warnings. * thread.c: (various) use thread_empty (cpu_record_hash_key) should cast to uintptr_t, a stdint.h type * vty.h: Add VTY_GET_IPV4_ADDRESS and VTY_GET_IPV4_PREFIX so they removed from ospfd/ospf_vty.h * zebra.h: Move definition of ZEBRA_PORT to here, to remove dependence of lib on zebra/zserv.h --- lib/command.h | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'lib/command.h') diff --git a/lib/command.h b/lib/command.h index 6fd42fa1..5328888a 100644 --- a/lib/command.h +++ b/lib/command.h @@ -318,27 +318,27 @@ struct desc #endif /* HAVE_IPV6 */ /* Prototypes. */ -void install_node (struct cmd_node *, int (*) (struct vty *)); -void install_default (enum node_type); -void install_element (enum node_type, struct cmd_element *); -void sort_node (); +extern void install_node (struct cmd_node *, int (*) (struct vty *)); +extern void install_default (enum node_type); +extern void install_element (enum node_type, struct cmd_element *); +extern void sort_node (void); /* Concatenates argv[shift] through argv[argc-1] into a single NUL-terminated string with a space between each element (allocated using XMALLOC(MTYPE_TMP)). Returns NULL if shift >= argc. */ -char *argv_concat (const char **argv, int argc, int shift); - -vector cmd_make_strvec (const char *); -void cmd_free_strvec (vector); -vector cmd_describe_command (); -char **cmd_complete_command (); -const char *cmd_prompt (enum node_type); -int config_from_file (struct vty *, FILE *); -enum node_type node_parent (enum node_type); -int cmd_execute_command (vector, struct vty *, struct cmd_element **, int); -int cmd_execute_command_strict (vector, struct vty *, struct cmd_element **); -void config_replace_string (struct cmd_element *, char *, ...); -void cmd_init (int); +extern char *argv_concat (const char **argv, int argc, int shift); + +extern vector cmd_make_strvec (const char *); +extern void cmd_free_strvec (vector); +extern vector cmd_describe_command (vector, struct vty *, int *status); +extern char **cmd_complete_command (vector, struct vty *, int *status); +extern const char *cmd_prompt (enum node_type); +extern int config_from_file (struct vty *, FILE *); +extern enum node_type node_parent (enum node_type); +extern int cmd_execute_command (vector, struct vty *, struct cmd_element **, int); +extern int cmd_execute_command_strict (vector, struct vty *, struct cmd_element **); +extern void config_replace_string (struct cmd_element *, char *, ...); +extern void cmd_init (int); /* Export typical functions. */ extern struct cmd_element config_end_cmd; @@ -346,9 +346,9 @@ extern struct cmd_element config_exit_cmd; extern struct cmd_element config_quit_cmd; extern struct cmd_element config_help_cmd; extern struct cmd_element config_list_cmd; -char *host_config_file (); -void host_config_set (char *); - -void print_version (const char *); +extern char *host_config_file (void); +extern void host_config_set (char *); +extern void print_version (const char *); + #endif /* _ZEBRA_COMMAND_H */ -- cgit v1.2.1