Age | Commit message (Collapse) | Author | |
---|---|---|---|
2021-06-18 | Move all miscellaneous functions from `config.c` into | mrb0nk500 | |
`misc.c`. | |||
2021-06-18 | Replace all instances of `malloc()` with `calloc()` | mrb0nk500 | |
in `config.c`. | |||
2021-06-18 | Removed unnecessary `memset()` in `read_file()`, and | mrb0nk500 | |
replaced `malloc()` with `calloc()`. | |||
2021-06-12 | Replaced all log messages with the macros from | mrb0nk500 | |
`macros.h`. This was done not only to make it smaller, and easier to read, but also to make it easier for debugging. | |||
2021-06-11 | Replace call to `malloc()` with call to `calloc()` in | mrb0nk500 | |
the config parser. Because `calloc()` zeros out the allocated space, we can remove the previous call to `memset()`. | |||
2021-06-11 | Remove unneeded call to `memset()` in `make_str()`. | mrb0nk500 | |
2021-06-11 | Change `port` from an int to a string, and move the | mrb0nk500 | |
valid port check into the config parser. | |||
2021-06-10 | Fixed a bug in `parse_config()` that was caused by not | mrb0nk500 | |
zeroing `cfg`. | |||
2021-06-10 | Added the `cleanup()`, and `cleanup_config()` | mrb0nk500 | |
functions. | |||
2021-06-10 | Added the `make_str()` function. | mrb0nk500 | |
This function automatically allocates a string that's the same size of the supplied string, and copies it to this newly allocated string, which is then returned. Since this uses `malloc()`, it must be `free()`'d after it's been used. | |||
2021-06-09 | Fixed segfault in `read_file()` that occured whenever | mrb0nk500 | |
the file couldn't be opened. Forgot about that call to `fclose()`. | |||
2021-06-08 | Treat `TYPE_BOOL` the same as `TYPE_INT`. | mrb0nk500 | |
The reason for keeping `TYPE_BOOL` is for readability. | |||
2021-06-07 | Fixed a bug with offsets being handled improperly in | mrb0nk500 | |
`set_config_opt()`. | |||
2021-06-07 | Fixed a segfault in `parse_config()`. | mrb0nk500 | |
2021-06-07 | Fixed a segfault bug in `get_line()`. | mrb0nk500 | |
2021-06-07 | Removed the casts to `long` in `parse_option_value()`. | mrb0nk500 | |
They weren't needed. | |||
2021-06-07 | Fixed a bug in one of the checks in `read_file()`. | mrb0nk500 | |
2021-06-07 | Added the `set_config_opt()` function. | mrb0nk500 | |
This function takes the offset of a given member of a config option in a `config` struct, and sets the member to the value supplied by `val`, with the type of value being determined by `type`. | |||
2021-06-06 | Added the config option value parser. | mrb0nk500 | |
This function, called `parse_option_value()`, parses the supplied `value` string, and based on the value type supplied by `opt`, sets a given member of `val` for that value type. | |||
2021-06-06 | Added a loop for finding a valid config option. | mrb0nk500 | |
I also added a call to a function that parses the value of the config option. | |||
2021-06-05 | Fixed a bug, and typo in the `strtok_r()` call in the | mrb0nk500 | |
config parser loop. | |||
2021-06-05 | Replace `find_line()` with `get_line()`. | mrb0nk500 | |
The loop body was also changed accordingly. This was done to make the config parser easier to read. | |||
2021-06-05 | Move the config option stuff into `config.h`. | mrb0nk500 | |
2021-06-05 | Added the typedefs for the config option types. | mrb0nk500 | |
2021-06-05 | Rename var to func, and change all the variables to | mrb0nk500 | |
function addresses. This is to get rid of the need for global variables. | |||
2021-06-05 | Fixed typo in config option format comment. | mrb0nk500 | |
2021-06-05 | Start adding the config options. | mrb0nk500 | |
2021-06-04 | Fixed typo in `read_file()` to do with the filesize | mrb0nk500 | |
check. | |||
2021-06-04 | Added missing buffer in `read_file()`. | mrb0nk500 | |
I forgot to add it, oof. | |||
2021-06-04 | Started work on the parser loop. | mrb0nk500 | |
2021-06-04 | Added `find_line()`. | mrb0nk500 | |
Which finds the next line in the buffer. | |||
2021-06-04 | Started work on the config file parser. | mrb0nk500 | |