summaryrefslogtreecommitdiff
path: root/misc.c
AgeCommit message (Collapse)Author
2022-08-29misc: Properly account for escaped delimiters in `find_delm()`HEADmastermrb0nk500
2022-08-05git: Make use of `format_len()` in `dir_path_name()`mrb0nk500
2022-08-05misc: Make `dir_path_name()` actually do some error checkingmrb0nk500
2022-08-05misc: Fixed a major issue with `mkdirp()`mrb0nk500
It was basically not properly skipping over to the next forward slash. The solution was to have it get the span of the forward slashes, and checking if we hit the null terminator after trying to find the next forward slash. If we do hit the null terminator, we add the forward slash span to the cursor.
2022-08-04misc: Add a little optimization to `remove_trailing_whitespace()`mrb0nk500
This also cleans it up a bit.
2022-08-04misc: Add `remove_trailing_whitespace()`mrb0nk500
This function removes any whitespace found at the end of the supplied string. This can be useful when you have a string with whitespace throughout it, but only want the whitespace at the end removed.
2022-08-03misc: Add `vformat_len_copy()`mrb0nk500
This works the same as `vformat_len()`, except that it copies `args` into a temporary `va_list`. This can be useful when you're already using a `va_list`, and thus need to copy the list already.
2022-08-03misc: Use of `vformat_len()`, rather than doing it manually inmrb0nk500
`format_len()`
2022-08-03misc: Add `vformat_len()`mrb0nk500
This works exactly like `format_len()`, except that it uses `va_list` rather than variadic arguments.
2022-07-31misc: Add `is_dir()`, and `mkdirp()`mrb0nk500
`is_dir()` checks if the supplied path is a directory, and returns 1 if it's a directory, 0 if it isn't a directory, and -1 if it doesn't exist. `mkdirp()` works like `mkdir()` except that it also creates parent directories if needed.
2022-07-31misc: Make sure that `s` starts at the character before the delimiter inmrb0nk500
`find_delm()` Also `s` doesn't get incremented when checking if the current character is a backslash now.
2022-07-27misc: Actually return pointer to the first non-delimited character aftermrb0nk500
the end of the range in `get_str_delm_range()`
2022-07-27misc: Use `find_delm()` when finding the end of the range inmrb0nk500
`get_str_delm_range()`
2022-07-27misc: Make `find_delm()` account for escaped delimiters.mrb0nk500
2022-07-27misc: Add `find_delm()`, and `get_str_delm_range()`mrb0nk500
`find_delm()` finds the first matched delimiter of the supplied delimiter(s), and either returns the pointer to the first non-delimiter character after the match, or the match itself if `skip_delm` is true, or false respectivly. `get_str_delm_range()` finds, and returns the string in between the supplied starting, and ending delimiter(s). It also returns the pointer to the first non-delimiter character after the end of the range in `rhs`.
2022-07-27misc: Add `\r`, and `\n` to the list of whitespace thatmrb0nk500
`skip_whitespace()` can skip past.
2022-07-27misc: Use `is_empty()` instead of just checking if `*str` is NULL inmrb0nk500
`get_line()`
2022-07-27misc: Add `is_empty()`, and `skip_whitespace()`mrb0nk500
2022-07-27misc: Make `get_line()` simpler by using `strcspn()`mrb0nk500
2021-08-01Fixed a typo in `sanitized_dir_path_name()`.mrb0nk500
2021-08-01Added `sanitized_dir_path_name()`.mrb0nk500
This function is the same as `dir_path_name()`, except `name` is sanitized before being appended to `root`.
2021-08-01Fixed an infinite loop bug in `sanitized_str()`, andmrb0nk500
`sanitized_strlen()`.
2021-08-01Explicitly discard const qualifier in `find_alpha()`.mrb0nk500
This was done to get rid of a const qualifier warning.
2021-07-03Added `find_alpha()`, and `create_num_str()`.mrb0nk500
2021-06-26Include `stdarg.h` in `misc.c`.mrb0nk500
2021-06-26Added `format_len()`.mrb0nk500
2021-06-23Fixed another typo in `dir_path_num()`.mrb0nk500
2021-06-23Fixed a typo in `dir_path_num()`.mrb0nk500
2021-06-23Added `sanitize_strlen()`, and `sanitize_str()`.mrb0nk500
`sanitize_str()` creates a string with each starting space replaced by a hyphen, and with all trailing spaces, and periods removed. `sanitize_strlen()` gets the length of the sanatized version of the supplied string.
2021-06-23Added `delm_span()`.mrb0nk500
2021-06-23Added 'dir_path_num()', and `dir_path_name()`.mrb0nk500
2021-06-18Move all miscellaneous functions from `config.c` intomrb0nk500
`misc.c`.