#include "dir_list.h"#include "cmdln.h"#include <stdlib.h>#include <stdio.h>#include <assert.h>#include <string.h>#include <errno.h>#include <sys/param.h>#include <sys/stat.h>#include <time.h>Go to the source code of this file.
Data Structures | |
| struct | dir_list_item |
| struct | dir_list_s |
Macros | |
| #define | FILE_HEADER_DESC_STRING "# WD directory list file" |
| #define | FILE_HEADER_VER_STRING "# File format: version 1" |
| #define | USE_FAVOURITES_FILE_STR "USE_FAVOURITES" |
| #define | TIME_FORMAT_STRING "%Y/%m/%d %H:%M:%S" |
| #define | TIME_SSCAN_STRING "%04u/%02u/%02u %02u:%02u:%02u" |
| #define | TIME_STRING_BUFFER_SIZE (30U) |
| #define | ANSI_COLOUR_RED "\x1b[31m" |
| #define | ANSI_COLOUR_GREEN "\x1b[32m" |
| #define | ANSI_COLOUR_GREY "\x1b[37;2m" |
| #define | ANSI_COLOUR_RESET "\x1b[0m" |
| #define | MIN_DIR_SIZE 100 |
| #define | DLI_SIZE (sizeof( struct dir_list_item )) |
| #define | CYGDRIVE_PREFIX "/cygdrive/" |
Functions | |
| int | add_dir (dir_list_t p_list, const char *const p_dir, const char *const p_name, const time_t p_t_added, const time_t p_t_accessed, const wd_entity_t p_type) |
| dir_list_t | new_dir_list (void) |
| Create a new directory list structure. More... | |
| dir_list_t | load_dir_list (const config_container_t *const p_config, const char *const p_fn) |
| Load a set of bookmarks from the specified file. More... | |
| int | bookmark_in_list (dir_list_t p_list, const char *const p_name) |
| int | remove_dir_by_index (dir_list_t p_list, const size_t p_dir) |
| int | remove_dir (dir_list_t p_list, const char *const p_dir) |
| int | dir_in_list (dir_list_t p_list, const char *const p_dir) |
| char * | format_dir (wd_dir_format_t p_fmt, char *p_dir) |
| int | dump_dir_if_exists (const dir_list_t p_list, const char *const p_dir) |
| int | dump_dir_with_name (const dir_list_t p_list, const char *const p_name) |
| void | list_dirs (const dir_list_t p_list) |
| int | determine_if_term_is_ansi () |
| void | dump_dir_list (const dir_list_t p_list) |
| int | save_dir_list (const dir_list_t p_list, const char *p_fn) |
| #define ANSI_COLOUR_GREEN "\x1b[32m" |
Definition at line 33 of file dir_list.c.
| #define ANSI_COLOUR_GREY "\x1b[37;2m" |
Definition at line 34 of file dir_list.c.
| #define ANSI_COLOUR_RED "\x1b[31m" |
Definition at line 32 of file dir_list.c.
| #define ANSI_COLOUR_RESET "\x1b[0m" |
Definition at line 35 of file dir_list.c.
| #define CYGDRIVE_PREFIX "/cygdrive/" |
Definition at line 472 of file dir_list.c.
| #define DLI_SIZE (sizeof( struct dir_list_item )) |
Definition at line 62 of file dir_list.c.
| #define FILE_HEADER_DESC_STRING "# WD directory list file" |
Definition at line 23 of file dir_list.c.
| #define FILE_HEADER_VER_STRING "# File format: version 1" |
Definition at line 24 of file dir_list.c.
| #define MIN_DIR_SIZE 100 |
Definition at line 46 of file dir_list.c.
| #define TIME_FORMAT_STRING "%Y/%m/%d %H:%M:%S" |
Definition at line 28 of file dir_list.c.
| #define TIME_SSCAN_STRING "%04u/%02u/%02u %02u:%02u:%02u" |
Definition at line 29 of file dir_list.c.
| #define TIME_STRING_BUFFER_SIZE (30U) |
Definition at line 30 of file dir_list.c.
| #define USE_FAVOURITES_FILE_STR "USE_FAVOURITES" |
Definition at line 26 of file dir_list.c.
| int add_dir | ( | dir_list_t | p_list, |
| const char *const | p_dir, | ||
| const char *const | p_name, | ||
| const time_t | p_t_added, | ||
| const time_t | p_t_accessed, | ||
| const wd_entity_t | p_type | ||
| ) |
Definition at line 96 of file dir_list.c.
| int bookmark_in_list | ( | dir_list_t | p_list, |
| const char *const | p_name | ||
| ) |
Definition at line 399 of file dir_list.c.
| int determine_if_term_is_ansi | ( | ) |
Definition at line 689 of file dir_list.c.
| int dir_in_list | ( | dir_list_t | p_list, |
| const char *const | p_dir | ||
| ) |
Definition at line 467 of file dir_list.c.
| int dump_dir_if_exists | ( | const dir_list_t | p_list, |
| const char *const | p_dir | ||
| ) |
Definition at line 547 of file dir_list.c.
| void dump_dir_list | ( | const dir_list_t | p_list | ) |
Definition at line 734 of file dir_list.c.
| int dump_dir_with_name | ( | const dir_list_t | p_list, |
| const char *const | p_name | ||
| ) |
Definition at line 580 of file dir_list.c.
| char* format_dir | ( | wd_dir_format_t | p_fmt, |
| char * | p_dir | ||
| ) |
Definition at line 474 of file dir_list.c.
| void list_dirs | ( | const dir_list_t | p_list | ) |
Definition at line 635 of file dir_list.c.
| dir_list_t load_dir_list | ( | const config_container_t *const | p_config, |
| const char *const | p_fn | ||
| ) |
Load a set of bookmarks from the specified file.
Note that in the case where invalid data is found in the file or a problem is encountered while reading from the file, the function will return a list of the bookmarks it was able to successfully read
| [in] | p_config | Configuration options to associate with the dir list |
| [in] | p_fn | The filename to load the bookmarks from |
Definition at line 213 of file dir_list.c.
| dir_list_t new_dir_list | ( | void | ) |
Create a new directory list structure.
Allocates the required memory and initialises the structure members
Definition at line 156 of file dir_list.c.
| int remove_dir | ( | dir_list_t | p_list, |
| const char *const | p_dir | ||
| ) |
Definition at line 455 of file dir_list.c.
| int remove_dir_by_index | ( | dir_list_t | p_list, |
| const size_t | p_dir | ||
| ) |
Definition at line 437 of file dir_list.c.
| int save_dir_list | ( | const dir_list_t | p_list, |
| const char * | p_fn | ||
| ) |
Definition at line 822 of file dir_list.c.
1.8.5