Changeset ba63912 in mainline for uspace/app/bdsh/cmds/modules/ls/ls.h


Ignore:
Timestamp:
2011-04-01T13:44:30Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2859445
Parents:
a30e435
Message:

Polish the 'ls' command a little bit.

  • Cstyle fixes.
  • Avoid some code duplication.
  • Call stat() only once per each printed file.
  • Print directories first, files second.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/modules/ls/ls.h

    ra30e435 rba63912  
    22#define LS_H
    33
    4 /* Various values that can be returned by ls_scope() */
    5 #define LS_BOGUS 0
    6 #define LS_FILE  1
    7 #define LS_DIR   2
    8 
    9 static void ls_scan_dir(const char *, DIR *, int);
    10 static void ls_print(const char *, const char *);
    11 
    12 /** Structure to represent a directory entry.
    13  *
    14  * Useful to keep together important informations
    15  * for sorting directory entries.
    16  */
    17 struct dir_elem_t {
    18         char * name;
    19         int isdir;
    20 };
    214
    225#endif /* LS_H */
Note: See TracChangeset for help on using the changeset viewer.