Changeset 7c3fb9b in mainline for uspace/app/bdsh/cmds


Ignore:
Timestamp:
2018-05-17T08:29:01Z (6 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6ff23ff
Parents:
fac0ac7
git-author:
Jiri Svoboda <jiri@…> (2018-05-16 17:28:17)
git-committer:
Jiri Svoboda <jiri@…> (2018-05-17 08:29:01)
Message:

Fix block comment formatting (ccheck).

Location:
uspace/app/bdsh/cmds
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/builtin_cmds.c

    rfac0ac7 r7c3fb9b  
    2727 */
    2828
    29 /* Almost identical (for now) to mod_cmds.c , however this will not be the case
    30  * soon as builtin_t is going to grow way beyond module_t */
     29/*
     30 * Almost identical (for now) to mod_cmds.c, however this will not be the case
     31 * soon as builtin_t is going to grow way beyond module_t
     32 */
    3133
    3234#include <stdio.h>
  • uspace/app/bdsh/cmds/builtins/batch/batch.c

    rfac0ac7 r7c3fb9b  
    6666}
    6767
    68 /* Main entry point for batch, accepts an array of arguments and a
    69  * pointer to the cliuser_t structure */
     68/** Main entry point for batch, accepts an array of arguments and a
     69 * pointer to the cliuser_t structure
     70 */
    7071int cmd_batch(char **argv, cliuser_t *usr)
    7172{
  • uspace/app/bdsh/cmds/builtins/cd/cd.c

    rfac0ac7 r7c3fb9b  
    4141static const char *cmdname = "cd";
    4242
    43 /* Previous directory variables.
     43/*
     44 * Previous directory variables.
    4445 *
    4546 * Declaring them static to avoid many "== NULL" checks.
     
    101102        }
    102103
    103         /* We don't yet play nice with whitespace, a getopt implementation should
     104        /*
     105         * We don't yet play nice with whitespace, a getopt implementation should
    104106         * protect "quoted\ destination" as a single argument. Its not our job to
    105107         * look for && || or redirection as the tokenizer should have done that
    106          * (currently, it does not) */
     108         * (currently, it does not)
     109         */
    107110
    108111        if (argc > 2) {
  • uspace/app/bdsh/cmds/builtins/exit/exit.c

    rfac0ac7 r7c3fb9b  
    4444}
    4545
    46 /* Quits the program and returns the status of whatever command
    47  * came before invoking 'quit' */
     46/** Quits the program and returns the status of whatever command
     47 * came before invoking 'quit'
     48 */
    4849int cmd_exit(char *argv[], cliuser_t *usr)
    4950{
  • uspace/app/bdsh/cmds/cmds.h

    rfac0ac7 r7c3fb9b  
    7676} builtin_t;
    7777
    78 /* Declared in cmds/modules/modules.h and cmds/builtins/builtins.h
    79  * respectively */
     78/*
     79 * Declared in cmds/modules/modules.h and cmds/builtins/builtins.h
     80 * respectively
     81 */
    8082extern module_t modules[];
    8183extern builtin_t builtins[];
  • uspace/app/bdsh/cmds/mod_cmds.c

    rfac0ac7 r7c3fb9b  
    2727 */
    2828
    29 /* NOTES:
     29/*
     30 * NOTES:
    3031 * module_* functions are pretty much identical to builtin_* functions at this
    3132 * point. On the surface, it would appear that making each function dual purpose
     
    3738 *
    3839 * To keep things easy to hack, everything is separated. In reality this only adds
    39  * 6 - 8 extra functions, but keeps each function very easy to read and modify. */
     40 * 6 - 8 extra functions, but keeps each function very easy to read and modify.
     41 */
    4042
    41 /* TODO:
     43/*
     44 * TODO:
    4245 * Many of these could be unsigned, provided the modules and builtins themselves
    43  * can follow suit. Long term goal. */
     46 * can follow suit. Long term goal.
     47 */
    4448
    4549#include <stdio.h>
     
    5357extern volatile unsigned int cli_interactive;
    5458
    55 /* Checks if an entry function matching command exists in modules[], if so
    56  * its position in the array is returned */
     59/** Checks if an entry function matching command exists in modules[]
     60 *
     61 * If so, its position in the array is returned
     62 */
    5763int is_module(const char *command)
    5864{
     
    7177}
    7278
    73 /* Checks if a module is an alias (sharing an entry point with another
    74  * module). Returns 1 if so */
     79/*
     80 * Checks if a module is an alias (sharing an entry point with another
     81 * module). Returns 1 if so
     82 */
    7583int is_module_alias(const char *command)
    7684{
     
    105113
    106114
    107 /* Invokes the 'help' entry function for the module at position (int) module,
    108  * which wants an unsigned int to determine brief or extended display. */
     115/** Invokes the 'help' entry function for the module at position (int) module
     116 *
     117 * which wants an unsigned int to determine brief or extended display.
     118 */
    109119int help_module(int module, unsigned int extended)
    110120{
     
    121131}
    122132
    123 /* Invokes the module entry point modules[module], passing argv[] as an argument
    124  * stack. */
     133/** Invokes the module entry point modules[module]
     134 *
     135 * passing argv[] as an argument stack.
     136 */
    125137int run_module(int module, char *argv[], iostate_t *new_iostate)
    126138{
  • uspace/app/bdsh/cmds/modules/cat/cat.c

    rfac0ac7 r7c3fb9b  
    274274                                                break;
    275275                                        } else if (c == U_SPECIAL && offset + 2 >= (size_t)bytes) {
    276                                                 /* If an extended character is cut off due to the size of the buffer,
    277                                                    we will copy it over to the next buffer so it can be read correctly. */
     276                                                /*
     277                                                 * If an extended character is cut off due to the size of the buffer,
     278                                                 * we will copy it over to the next buffer so it can be read correctly.
     279                                                 */
    278280                                                copied_bytes = bytes - offset + 1;
    279281                                                memcpy(buff, buff + offset - 1, copied_bytes);
  • uspace/app/bdsh/cmds/modules/cp/cp.c

    rfac0ac7 r7c3fb9b  
    207207                        /* e.g. cp file_name /data/ */
    208208
    209                         /* dest is a directory,
     209                        /*
     210                         * dest is a directory,
    210211                         * append the src filename to it.
    211212                         */
     
    231232                        /* e.g. cp file_name existing_file */
    232233
    233                         /* dest already exists,
     234                        /*
     235                         * dest already exists,
    234236                         * if force is set we will try to remove it.
    235237                         * if interactive is set user input is required.
     
    298300                        if (str_cmp(src_dirname, "..") &&
    299301                            str_cmp(src_dirname, ".")) {
    300                                 /* The last component of src_path is
     302                                /*
     303                                 * The last component of src_path is
    301304                                 * not '.' or '..'
    302305                                 */
     
    314317                default:
    315318                case TYPE_NONE:
    316                         /* dest does not exists, this means the user wants
     319                        /*
     320                         * dest does not exists, this means the user wants
    317321                         * to specify the name of the destination directory
    318322                         *
     
    336340                }
    337341
    338                 /* Copy every single directory entry of src into the
     342                /*
     343                 * Copy every single directory entry of src into the
    339344                 * destination directory.
    340345                 */
  • uspace/app/bdsh/cmds/modules/ls/ls.c

    rfac0ac7 r7c3fb9b  
    2727 */
    2828
    29 /* NOTE:
     29/*
     30 * NOTE:
    3031 * This is a bit of an ugly hack, working around the absence of fstat / etc.
    31  * As more stuff is completed and exposed in libc, this will improve */
     32 * As more stuff is completed and exposed in libc, this will improve
     33 */
    3234
    3335#include <errno.h>
  • uspace/app/bdsh/cmds/modules/module_aliases.h

    rfac0ac7 r7c3fb9b  
    3030#define MODULE_ALIASES_H
    3131
    32 /* Modules that declare multiple names for themselves but use the
     32/*
     33 * Modules that declare multiple names for themselves but use the
    3334 * same entry functions are aliases. This array helps to determine if
    3435 * a module is an alias, as such it can be invoked differently.
    35  * format is alias , real_name */
     36 * format is alias , real_name
     37 */
    3638
    37 /* So far, this is only used in the help display but could be used to
     39/*
     40 * So far, this is only used in the help display but could be used to
    3841 * handle a module differently even prior to reaching its entry code.
    3942 * For instance, 'exit' could behave differently than 'quit', prior to
    40  * the entry point being reached. */
     43 * the entry point being reached.
     44 */
    4145
    4246const char *mod_aliases[] = {
  • uspace/app/bdsh/cmds/modules/modules.h

    rfac0ac7 r7c3fb9b  
    3030#define MODULES_H
    3131
    32 /* Each built in function has two files, one being an entry.h file which
     32/*
     33 * Each built in function has two files, one being an entry.h file which
    3334 * prototypes the run/help entry functions, the other being a .def file
    3435 * which fills the modules[] array according to the cmd_t structure
     
    4041 *
    4142 * NOTE: See module_ aliases.h as well, this is where aliases (commands that
    42  * share an entry point with others) are indexed */
     43 * share an entry point with others) are indexed
     44 */
    4345
    4446#include "config.h"
     
    6466#include "cmp/entry.h"
    6567
    66 /* Each .def function fills the module_t struct with the individual name, entry
     68/*
     69 * Each .def function fills the module_t struct with the individual name, entry
    6770 * point, help entry point, etc. You can use config.h to control what modules
    68  * are loaded based on what libraries exist on the system. */
     71 * are loaded based on what libraries exist on the system.
     72 */
    6973
    7074module_t modules[] = {
  • uspace/app/bdsh/cmds/modules/rm/rm.c

    rfac0ac7 r7c3fb9b  
    9595        rm->safe = 0;
    9696
    97         /* Make sure we can allocate enough memory to store
    98          * what is needed in the job structure */
     97        /*
     98         * Make sure we can allocate enough memory to store
     99         * what is needed in the job structure
     100         */
    99101        if (NULL == (rm->nwd = (char *) malloc(PATH_MAX)))
    100102                return 0;
Note: See TracChangeset for help on using the changeset viewer.