1
0
Commit Graph

188 Commits

Author SHA1 Message Date
Patrick Gaskin
b4b86fbb37 Refactored common hook code into new NickelHook library (#64) 2020-07-27 11:11:58 -04:00
Patrick Gaskin
2cfb51ac0d Fixed minor memory regression in #62
The line was being freed before the error is set.

Fixes 6329328daf.
2020-07-21 18:33:55 -04:00
Patrick Gaskin
6329328daf Refactored error handling (#62)
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.
2020-07-21 17:47:22 -04:00
Patrick Gaskin
5a6ae2b462 Removed support for loading using LD_PRELOAD (#63)
It hasn't been used except for before the initial release, and it's more likely
to cause odd issues when parts of NM are reused by other mods.
2020-07-20 18:39:13 -04:00
Patrick Gaskin
fb080e031f Updated build instructions in README 2020-07-18 20:35:20 -04:00
Patrick Gaskin
57df60b72d Updated GitHub username 2020-07-14 16:24:19 -04:00
Patrick Gaskin
a9ad448a35 Updated tested firmware versions in docs 2020-07-08 14:40:28 -04:00
Patrick Gaskin
d530970ba6 Improved wording of documentation 2020-07-03 13:44:46 -04:00
Patrick Gaskin
13e9485e31 Fixed incorrect setting name in setting change toast (fixes #61)
This is a regression in v0.2.0 from cb2caff551.
2020-07-03 13:42:13 -04:00
Patrick Gaskin
ec8c685e1f Fixed outdated example in docs 2020-07-02 14:13:18 -04:00
Patrick Gaskin
cb2caff551 Improved extensibility of nickel_setting, split browser stuff into nickel_browser action (closes #59) (#60)
* 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>.
2020-07-02 00:25:00 -04:00
Patrick Gaskin
7019745ff7 Fixed minor formatting issue in action.c 2020-06-29 07:58:21 -04:00
Patrick Gaskin
e89eb83869 Fixed reloaded config only propagating to new menus or the first existing one (fixes #57) (#58)
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).
2020-06-26 09:26:44 -04:00
Patrick Gaskin
ea1c43b6a1 Implemented generator updates (closes #54) (#55) 2020-06-23 17:05:22 -04:00
Patrick Gaskin
40f27b37aa Updated symbol tests for 4.22.15190 2020-06-23 15:25:26 -04:00
NiLuJe
d0d169769b Hide (nearly) all symbols by default (#40)
https://github.com/geek1011/kobo-plugin-experiments/issues/9#issuecomment-642324579
2020-06-23 03:37:00 -04:00
Patrick Gaskin
ff434c9669 Fixed freeing old config after updates
This fixes a bug in ee0eb7ccf7 (#47).
2020-06-23 03:09:05 -04:00
Patrick Gaskin
ee0eb7ccf7 Implemented config file reloading and improved the config parser (closes #42) (closes #48) (#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.
2020-06-22 23:34:37 -04:00
Patrick Gaskin
9d58df7a64 Fixed use-after-free in nm_action_result_free 2020-06-21 13:30:18 -04:00
NiLuJe
991b3e702d Actually catch allocation failures in handle_list_reply
Caught by Clang's static analyzer
2020-06-21 19:03:07 +02:00
Patrick Gaskin
af95f6464b Implemented option to set values for nickel_setting:* explicitly (closes #51) (#52) 2020-06-20 15:13:45 -04:00
Patrick Gaskin
7de21b827c Switched to new method for nickel_extras:web_browser and implemented url/css options (closes #49) (#50)
* 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.
2020-06-20 15:08:12 -04:00
Patrick Gaskin
50c7374fcf Reworked menu item injection (closes #43) (#45)
Menu items are now added before the menu opens rather than when the menu is created. This gives more flexibility to implement features like #42.
2020-06-16 19:48:09 -04:00
Patrick Gaskin
1001be39aa Fixed documentation for nickel_wifi action 2020-06-16 19:38:41 -04:00
Patrick Gaskin
880f82d420 Added a link to the MobileRead thread to the README 2020-06-16 19:34:42 -04:00
Patrick Gaskin
87aafe5899 Implemented nickel_wifi action (closes #25) (#46) 2020-06-16 19:12:21 -04:00
Patrick Gaskin
7f52a8165e Implemented nickel_misc:home action (closes #39) (#44) 2020-06-15 16:12:14 -04:00
Patrick Gaskin
2b40ede252 Fixed small grammatical error in docs 2020-06-15 16:08:07 -04:00
Sherman Perry
cd8acae0bf Switched to a macro for defining the log prefix (#41) 2020-06-11 18:52:55 -04:00
Patrick Gaskin
174b6e3130 Implemented nickel_open action (closes #26) (#38) 2020-06-08 18:42:25 -04:00
Patrick Gaskin
eb7a5c5c35 Fixed Drone config for tagged commits 2020-06-01 14:31:20 -04:00
Patrick Gaskin
9dbf79c3e3 Implemented NM_UNINSTALL_CONFIGDIR build option (closes #34) (#37)
This option allows NickelMenu to be uninstalled by deleting the config dir.
2020-06-01 11:45:15 -04:00
Patrick Gaskin
980703ca94 Added Telnet toggle example 2020-05-25 19:07:08 -04:00
Patrick Gaskin
809a037396 Added Drone config for build and S3 uploads 2020-05-25 18:30:45 -04:00
Patrick Gaskin
88adf88880 Implemented skip action (closes #31) (#32) 2020-05-25 17:17:27 -04:00
Patrick Gaskin
fdc3ec4f50 Renamed chain to chain_success (breaking) (closes #33) (#36) 2020-05-25 17:15:14 -04:00
NiLuJe
ae787f1270 Implemented kfmon generator (closes #39) (#35) 2020-05-25 17:14:48 -04:00
Patrick Gaskin
a79454a274 Ignore special files during config parsing (closes #27) (#30) 2020-05-25 11:23:59 -04:00
Patrick Gaskin
1093239ba7 Cleaned up some macros 2020-05-25 07:06:04 -04:00
Patrick Gaskin
c4ab0154bc Implemented menu item generators (closes #4) (#28)
* 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
2020-05-25 06:57:59 -04:00
Patrick Gaskin
242c6ee7b5 Updated symbol tests for 4.21.15015 2020-05-19 17:44:54 -04:00
Patrick Gaskin
ffcf63dd39 Fixed default menu items 2020-05-19 13:13:48 -04:00
NiLuJe
d5621ba674 And more alphabetical order 2020-05-13 17:05:56 -04:00
NiLuJe
ec8fcd69be Minor cosmetic tweaks to the KFMon list code (#24)
* Switch to an enum for kfmon ipc errors codes.
* Also switch to a case switch in nm_kfmon_return_handler.
* Comment out the default case to have -Wswitch shout at you if you missed
one.
* Simplify pointer chasing loop.
* Explicitly mention KFMON_IPC_EAGAIN in the return_handler.
* Simplify some more.
* Make GCC happy.
* Slightly less convoluted.
* Alphabetical header order.
2020-05-13 17:05:05 -04:00
Patrick Gaskin
1968f0c959 Fixed a memory leak in cmd_output action 2020-05-13 16:39:16 -04:00
Patrick Gaskin
a32c17b8f4 Added clangd compile_flags.txt to gitignore 2020-05-13 13:18:22 -04:00
NiLuJe
fbef20c4e2 Log the exact version at init (#22) 2020-05-13 12:07:59 -04:00
Patrick Gaskin
043dfb37e6 Implemented quiet option for cmd_output (fixes #9) (#21) 2020-05-13 11:38:05 -04:00
Patrick Gaskin
bf03f9e22b Implemented conditional actions (closes #11) (#20) 2020-05-13 11:37:35 -04:00
NiLuJe
fa1f08a369 Allow whitespace in cmd_spawn/cmd_output args (fixes #16) (#19)
* Allow whitespace in cmd_spawn/cmd_output args

* Trim cmd no matter the content of the extra option field

* Don't mistake a stray colon in the actual command for a field separator

* Simplified quiet option for cmd_spawn, fixed up parsing
    * Fixed case where option could start with, but not actually be, quiet.
    * Fixed restoring the original command when no option is specified.
    * Simplified code.

* Fixed typos in comments

Co-authored-by: Patrick Gaskin <patrick@pgaskin.net>
2020-05-12 21:54:43 -04:00