| 1 | /* melder_help.cpp |
| 2 | * |
| 3 | * Copyright (C) 1992-2018,2023 Paul Boersma |
| 4 | * |
| 5 | * This code is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or (at |
| 8 | * your option) any later version. |
| 9 | * |
| 10 | * This code is distributed in the hope that it will be useful, but |
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 13 | * See the GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | |
| 19 | #include "melder.h"cxx . . $ `<file>/melder/melder.h`/ |
| 20 | |
| 21 | static void defaultHelpcxx . . $ defaultHelp(ff00d524ab0355ec). (conststring32cxx . . $ conststring32# query) { |
| 22 | Melder_flushErrorcxx . . $ Melder_flushError(6298c93241566110). (U"Don’t know how to find help on “", query, U"”."); |
| 23 | } |
| 24 | |
| 25 | static void defaultSearchcxx . . $ defaultSearch(49f6e7a06ebc5aa8). () { |
| 26 | Melder_flushErrorcxx . . $ Melder_flushError(6298c93241566110). (U"Do not know how to search."); |
| 27 | } |
| 28 | |
| 29 | static void (*p_theHelpProccxx . . $ p_theHelpProc.) (conststring32cxx . . $ conststring32# query) = & defaultHelpcxx . . $ defaultHelp(ff00d524ab0355ec).; |
| 30 | static void (*p_theSearchProccxx . . $ p_theSearchProc.) () = & defaultSearchcxx . . $ defaultSearch(49f6e7a06ebc5aa8).; |
| 31 | |
| 32 | void Melder_helpcxx . . $ Melder_help(ff00d524ab0355ec). (conststring32cxx . . $ conststring32# query) { |
| 33 | (*p_theHelpProccxx . . $ p_theHelpProc.) (query); |
| 34 | } |
| 35 | |
| 36 | void Melder_searchcxx . . $ Melder_search(49f6e7a06ebc5aa8). () { |
| 37 | (*p_theSearchProccxx . . $ p_theSearchProc.) (); |
| 38 | } |
| 39 | |
| 40 | void Melder_setHelpProccxx . . $ Melder_setHelpProc(f441b548652834d9). (void (*p_helpProc) (conststring32cxx . . $ conststring32# query)) |
| 41 | { p_theHelpProccxx . . $ p_theHelpProc. = p_helpProc ? p_helpProc : & defaultHelpcxx . . $ defaultHelp(ff00d524ab0355ec).; } |
| 42 | |
| 43 | void Melder_setSearchProccxx . . $ Melder_setSearchProc(964b12a25712bdc3). (void (*p_searchProc) (void)) |
| 44 | { p_theSearchProccxx . . $ p_theSearchProc. = p_searchProc ? p_searchProc : & defaultSearchcxx . . $ defaultSearch(49f6e7a06ebc5aa8).; } |
| 45 | |
| 46 | /* End of file melder_help.cpp */ |