diff --git a/server/commands/client_commands.c b/server/commands/client_commands.c index bbbdc2e..15086d7 100644 --- a/server/commands/client_commands.c +++ b/server/commands/client_commands.c @@ -1,5 +1,5 @@ -/* \file server/commands/client_commands.c - * Defines handlers for general client commands. +/** \file server/commands/client_commands.c + * Implements handlers for general client commands. * * This contains definitions for all the functions which clients can run. * The functions here are to be called only from parse.c's interpreter. @@ -33,7 +33,7 @@ #include "input.h" -/*************************************************************** +/** * Debugging only.. prints out a list of arguments it receives */ int @@ -48,18 +48,18 @@ test_func_func(Client *c, int argc, char **argv) return 0; } -/*************************************************************** +/** * The client must say "hello" before doing anything else. * - * It returns a string of info about the server to the client + * It sends back a string of info about the server to the client. * * Usage: hello + * + * \todo Give \em real info about the server/lcd */ int hello_func(Client *c, int argc, char **argv) { - /* TODO: Give *real* info about the server/lcd...*/ - if (argc > 1) { sock_send_error(c->sock, "extra parameters ignored\n"); } @@ -77,10 +77,10 @@ hello_func(Client *c, int argc, char **argv) return 0; } -/***************************************************************************** +/** * The client should say "bye" before disconnecting * - * The function does not respond to the client: it simply cuts connection + * The function does not respond to the client: it simply cuts connection. * * Usage: bye */ @@ -96,10 +96,10 @@ bye_func(Client *c, int argc, char **argv) return 0; } -/*************************************************** - * sets info about the client, such as its name +/** + * Sets info about the client, such as its name * - * Usage: client_set -name + * Usage: client_set -name \ */ int client_set_func(Client *c, int argc, char **argv) @@ -152,11 +152,11 @@ client_set_func(Client *c, int argc, char **argv) return 0; } -/****************************************************************** +/** * Tells the server the client would like to accept keypresses * of a particular type * - * Usage: client_add_key [-exclusively|-shared] {}+ + * Usage: client_add_key [-exclusively|-shared] {\}+ */ int client_add_key_func(Client *c, int argc, char **argv) @@ -195,11 +195,11 @@ client_add_key_func(Client *c, int argc, char **argv) return 0; } -/********************************************************************* +/** * Tells the server the client would NOT like to accept keypresses * of a particular type * - * Usage: client_del_key {}+ + * Usage: client_del_key {\}+ */ int client_del_key_func(Client *c, int argc, char **argv) @@ -222,7 +222,7 @@ client_del_key_func(Client *c, int argc, char **argv) return 0; } -/*************************************************************************** +/** * Toggles the backlight, if enabled. * * Usage: backlight {on|off|toggle|blink|flash} @@ -268,8 +268,8 @@ backlight_func(Client *c, int argc, char **argv) } -/**************************************************************************** - * info_func +/** + * Sends back information about the loaded drivers. * * Usage: info */ diff --git a/server/commands/client_commands.h b/server/commands/client_commands.h index 4b016ad..482bbb8 100644 --- a/server/commands/client_commands.h +++ b/server/commands/client_commands.h @@ -1,6 +1,4 @@ -/* \file server/commands/client_commands.h - * Declares handlers for general client commands. - */ +/** \file server/commands/client_commands.h */ /* This file is part of LCDd, the lcdproc server. * diff --git a/server/commands/command_list.c b/server/commands/command_list.c index b4f7bc5..20b1b70 100644 --- a/server/commands/command_list.c +++ b/server/commands/command_list.c @@ -1,11 +1,8 @@ -/* \file server/commands/command_list.c - * Defines the dispatcher for handlers dealing with the client commands. +/** \file server/commands/command_list.c + * Implements the dispatcher for handlers dealing with the client commands. * * This contains definitions for all the functions which clients can run. * The functions here are to be called only from parse.c's interpreter. - * - * The client's available function set is defined here, as is the syntax - * for each command. <-- TODO ! */ /* This file is part of LCDd, the lcdproc server. @@ -56,7 +53,11 @@ static client_function commands[] = { { NULL, NULL}, }; - +/** + * Looks up a function for a command sent by the client. + * \param cmd Command to look up as string. + * \return Pointer to the implementing function. + */ CommandFunc get_command_function(char *cmd) { int i; diff --git a/server/commands/command_list.h b/server/commands/command_list.h index 3f98970..db4f82d 100644 --- a/server/commands/command_list.h +++ b/server/commands/command_list.h @@ -1,4 +1,4 @@ -/* \file server/commands/command_list.h +/** \file server/commands/command_list.h * Declares client command dispatcher function. */ @@ -15,16 +15,16 @@ #include "../client.h" -/* - The function list for clients is stored in a table, and the items each - point to a function to call, defined below. +/** + * The function list for clients is stored in a table, and the items each + * point to a function to call, defined below. */ - typedef int (*CommandFunc) (Client *c, int argc, char **argv); +/** Defines an entry in the command table */ typedef struct client_function { - char *keyword; - CommandFunc function; + char *keyword; /**< Command string in the protocol */ + CommandFunc function; /**< Pointer to the associated function */ } client_function; diff --git a/server/commands/menu_commands.c b/server/commands/menu_commands.c index 2474a8b..2a7fa1d 100644 --- a/server/commands/menu_commands.c +++ b/server/commands/menu_commands.c @@ -1,5 +1,5 @@ -/* \file server/commands/menu_commands.c - * Defines handlers for client commands concerning menus. +/** \file server/commands/menu_commands.c + * Implements handlers for client commands concerning menus. * * This contains definitions for all the functions which clients can run. * The functions here are to be called only from parse.c's interpreter. @@ -63,14 +63,14 @@ static char *argv2string(int argc, char **argv) } -/************************************************************************* - * menu_add_item_func +/** + * Adds an item to a menu. * - * Adds an item to a menu - * - * Usage: menu_add_item [] + * Usage: menu_add_item \ \ \ [\] + * * You should use "" as id for the client's main menu. This menu will be * created automatically when you add an item to it the first time. + * * You (currently?) cannot create a menu in the main level yourself. * The names you use for items should be unique for your client. * The text is the visible text for the item. @@ -220,12 +220,11 @@ menu_add_item_func(Client *c, int argc, char **argv) return 0; } -/************************************************************************* - * menu_del_item_func - * +/** * Deletes an item from a menu * - * Usage: menu_del_item + * Usage: menu_del_item \ \ + * * The given item in the given menu will be deleted. If you have deleted all * the items from your client menu, that menu will automatically be removed. */ @@ -285,89 +284,89 @@ menu_del_item_func(Client *c, int argc, char **argv) return 0; } -/************************************************************************** - * menu_set_item_func - * Sets the info about a menu item +/** + * Sets the info about a menu item. * * For example, text displayed, value, etc... * - * Usage: menu_set_item {