|
| 1 | +## Copyright (C) 2023 John Donoghue |
| 2 | +## |
| 3 | +## This program is free software; you can redistribute it and/or |
| 4 | +## modify it under the terms of the GNU General Public License as |
| 5 | +## published by the Free Software Foundation; either version 3 of the |
| 6 | +## License, or (at your option) any later version. |
| 7 | +## |
| 8 | +## This program is distributed in the hope that it will be useful, but |
| 9 | +## WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 | +## General Public License for more details. |
| 12 | +## |
| 13 | +## You should have received a copy of the GNU General Public License |
| 14 | +## along with this program; if not, see |
| 15 | +## <http:##www.gnu.org/licenses/>. |
| 16 | + |
| 17 | +## -*- texinfo -*- |
| 18 | +## @deftypefn {} {} __unload_arduino__ () |
| 19 | +## Undocumented internal function of arduino package. |
| 20 | +## @end deftypefn |
| 21 | + |
| 22 | +## PKG_DEL: __unload_arduino__ () |
| 23 | + |
| 24 | +function __unload_arduino__ () |
| 25 | + if exist ("isfolder") == 0 |
| 26 | + if (isdir (fullfile (fileparts (mfilename ("fullpath")), "sensors"))) |
| 27 | + rmpath (fullfile (fileparts (mfilename ("fullpath")), "sensors")); |
| 28 | + endif |
| 29 | + else |
| 30 | + if (isfolder (fullfile (fileparts (mfilename ("fullpath")), "sensors"))) |
| 31 | + rmpath (fullfile (fileparts (mfilename ("fullpath")), "sensors")); |
| 32 | + endif |
| 33 | + endif |
| 34 | + |
| 35 | + # on package unload, attempt to unload docs |
| 36 | + try |
| 37 | + pkg_dir = fileparts (fullfile (mfilename ("fullpath"))); |
| 38 | + doc_file = fullfile (pkg_dir, "doc", "arduino.qch"); |
| 39 | + if exist(doc_file, "file") |
| 40 | + if exist("__event_manager_unregister_documentation__") |
| 41 | + __event_manager_unregister_documentation__ (doc_file); |
| 42 | + elseif exist("__event_manager_unregister_doc__") |
| 43 | + __event_manager_unregister_doc__ (doc_file); |
| 44 | + endif |
| 45 | + endif |
| 46 | + catch |
| 47 | + # do nothing |
| 48 | + end_try_catch |
| 49 | +endfunction |
0 commit comments