Changeset 8e16454 in mainline for uspace/app/tmon/main.c


Ignore:
Timestamp:
2017-12-27T16:46:27Z (6 years ago)
Author:
Petr Manek <petr.manek@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f4b83cc
Parents:
59958992
git-author:
Petr Manek <petr.manek@…> (2017-12-27 16:43:34)
git-committer:
Petr Manek <petr.manek@…> (2017-12-27 16:46:27)
Message:

tmon: add in-code docs and method docstrings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tmon/main.c

    r59958992 r8e16454  
    4242#define INDENT "      "
    4343
     44/** Command which is executed by tmon. */
    4445typedef struct tmon_cmd {
     46        /** Unique name, by which the command is executed. */
    4547        const char *name;
     48        /** Description of the command, which is displayed in the usage string. */
    4649        const char *description;
     50        /** Function, which executes the command. Same as int main(int, char**). */
    4751        int (*action)(int, char **);
    4852} tmon_cmd_t;
    4953
     54/** Static array of commands supported by tmon. */
    5055static tmon_cmd_t commands[] = {
    5156        {
     
    8691};
    8792
     93/** Option shown in the usage string. */
    8894typedef struct tmon_opt {
     95        /** Long name of the option without "--" prefix. */
    8996        const char *long_name;
     97        /** Short name of the option without "-" prefix. */
    9098        char short_name;
     99        /** Description of the option displayed in the usage string. */
    91100        const char *description;
    92101} tmon_opt_t;
    93102
     103/** Static array of options displayed in the tmon usage string. */
    94104static tmon_opt_t options[] = {
    95105        {
     
    105115};
    106116
     117/** Print usage string.
     118 * @param[in] app_name Name to print in the invocation example.
     119 */
    107120static void print_usage(char *app_name)
    108121{
     
    122135}
    123136
     137/** Main tmon entry point.
     138 * @param[in] argc Number of arguments.
     139 * @param[in] argv Argument values. Must point to exactly `argc` strings.
     140 *
     141 * @return Exit code
     142 */
    124143int main(int argc, char *argv[])
    125144{
Note: See TracChangeset for help on using the changeset viewer.