From: Andre Noll Date: Wed, 12 Nov 2008 20:28:55 +0000 (+0100) Subject: Add documentation of parse_select_options(). X-Git-Tag: v0.1.0~25 X-Git-Url: http://git.tuebingen.mpg.de/?p=adu.git;a=commitdiff_plain;h=dbf089c8f66059540f0c1089a36620c5afcb19e5 Add documentation of parse_select_options(). --- diff --git a/select.c b/select.c index d5ce3e4..7d1212c 100644 --- a/select.c +++ b/select.c @@ -939,7 +939,33 @@ static int setup_format_string(char *fmt, struct format_info **fi) return parse_format_string(fmt, atoms, fi); } -/* return: < 0: error, >0: OK, == 0: help given */ +/** + * Parse a given format string. + * + * \param string The format string to parse. + * \param params gengetopt parameters. + * \param admissible_uids The array of admissible uid ranges. + * \param fi The format info to be used with format_items(). + * + * If \a string is not \p NULL, it is broken down into its components using + * \ref create_argv() and the resulting argument vector is passed together with + * \a params to gengetopt's command line parser. If --help or --detailed-help + * was specified in \a string, the corresponding help text is printed and the + * function returns zero. + * + * Otherwise, any --uid or --user options are parsed and transformed into an + * array of admissible uids which is returned via \a admissible_uids. + * + * Finally, the format string given by --format (or the default format string + * for the given select mode if no --format option was given in \a string) is + * parsed as well resulting in a format_info structure which is returned via + * \a fi. The caller uses the \a fi pointer later to format each output line. + * + * \return Negative on errors, zero if --help or --detailed-help was given, + * positive otherwise. + * + * \sa format_items(). + */ int parse_select_options(char *string, struct select_cmdline_parser_params *params, struct uid_range **admissible_uids, struct format_info **fi) {