External ulility myrls.
More...
|
| enum | file_type {
REGULAR
, DIRECTORY
, SYMLINK
, FIFO
,
SOCKET
, EXECUTABLE
, UNKNOWN
} |
| |
|
|
static void | init (void) |
| |
|
static void | usage (int const status, char const *message) |
| |
|
static int | file_name_cmp (void const *a, void const *b) |
| |
|
static void * | xmalloc (size_t const size) |
| |
|
static void * | xrealloc (void *ptr, size_t const size) |
| |
|
static void | file_error (char const *message, char const *path) |
| |
|
static void | format_permissions (mode_t const mode, char *formatted) |
| |
|
static char * | get_owner (uid_t const uid) |
| |
|
static void | format_time (time_t const mtime, char *formatted) |
| |
|
static int | get_file_type (mode_t const st_mode) |
| |
|
static void | print_file_info (struct file_info const *file_info, int const owner_w, int const size_w) |
| |
|
static char * | read_link (char const *path, size_t expected_size) |
| |
|
static int | read_file_info (char const *path, char const *file_name, struct file_info *file_info) |
| |
|
static void | free_file_info (struct file_info *file_info, size_t const count) |
| |
|
static size_t | concat_path (char const *file_name, size_t const path_len, char *full_path) |
| |
|
static void | restore_path (char *path, size_t const path_len) |
| |
|
static void | list_dir (char *path, size_t const path_len) |
| |
|
static int | myrls (char const *path) |
| |
|
int | main (int argc, char *argv[]) |
| |
|
| static char const *const | file_type_str [] |
| |
| static struct option | long_opts [] |
| |
|
static struct user_info * | user_info_cache |
| |
|
static char | current_path [PATH_MAX] |
| |
|
static int | exit_status |
| |
◆ file_type_str
| char const* const file_type_str[] |
|
static |
Initial value:= {
[REGULAR] = "",
[DIRECTORY] = "/",
[SYMLINK] = "@",
[FIFO] = "|",
[SOCKET] = "=",
[EXECUTABLE] = "*",
[UNKNOWN] = "?"
}
◆ long_opts
| struct option long_opts[] |
|
static |
Initial value:= {
{"help", no_argument, NULL, 'h'},
{NULL, 0, NULL, 0}
}