This should not be used in most cases, as it will break compatibility with
existing mods which depend on adding a config to NM. This option is meant as a
better option than find/replace for people who do private builds of NM for
themselves and want to change the config dir.
It will also affect the path used for installing the documentation and shown in
the default menu item.
Instead of using and checking malloc'd error strings formatted with asprintf and passed through a pointer in function arguments, use a global thread-local statically allocated error buffer with functions to set and get it.
This is more efficient, less error-prone, and easier to use than the old method, especially now that NM is larger (meaning that errors are returned through multiple layers) and parts of it are re-used in other things.
* Split browser actions from nickel_extra into nickel_browser
* Improved extensibility of nickel_setting action
Instead of nickel_setting:<setting> for toggling a setting and
nickel_setting:<setting>:<bool> for setting it explicitly, use
nickel_setting:<action>:<setting>.
Instead of returning a bool from `nm_global_config_update` indicating whether
the menu items were modified, return an int indicating the current config
revision which can then be compared against one stored as a property of the
menu.
This issue was found by @jackiew1. See #56 for more details.
This fixes an issue in ee0eb7ccf7 (#47).
Menu:
* Implemented menu item updating based on config file creation/deletion/modtime.
* Fixed ordering and separators for dynamically added actions.
* Simplified separator property setting.
* Fixed issue with item ordering on every second update (it keeps track by the item index based on the original menu, which changes after we add our items, so we actually need to remove our items before we find the item to prepend our new items to).
* Note: generators can't trigger updates yet, and are only updated when the config changes.
Config:
* Split config parsing and scanning into multiple steps.
* No more memory leaks on error.
* Properly handle memory allocation errors.
* Cleaner code.
* Less chance of making mistakes when adding features in the future.
* Also made if statements easier to read.
* Refactored config state and list management into separate functions.
* Extracted parsers for each config type into separate functions.
* Cleaned up whitespace.
* Rearranged variables.
* Fixed a few memory leaks and use-after-free issues for errors in the config parser.
* Fixed use-after-free of line in config parser.
* Moved config file filtering into scandir.
See #47 for details.
* Switched to new method for nickel_extras:web_browser.
* Added support for fw versions less than 4.11.11911 for nickel_extras:web_browser action.
* Added modal, URL, and CSS options to nickel_extras:web_browser.
* Implemented menu item generators (closes#4)
* Initialized sz to -1 for nm_generator_do
* Cleaned up extra semicolon in config.c
* Fixed typo in generator size check