1 /* b-yacmd.h --- yet another command 2 3 Copyright (C) 2013-2020 Thien-Thi Nguyen 4 5 This file is part of GNU RCS. 6 7 GNU RCS is free software: you can redistribute it and/or modify it 8 under the terms of the GNU General Public License as published by 9 the Free Software Foundation, either version 3 of the License, or 10 (at your option) any later version. 11 12 GNU RCS is distributed in the hope that it will be useful, 13 but WITHOUT ANY WARRANTY; without even the implied warranty 14 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15 See the GNU General Public License for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with this program. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 21 typedef int (submain_t) (const char *cmd, int argc, char **argv); 22 23 struct yacmd 24 { 25 submain_t *func; 26 const uint8_t *aka; 27 struct program *pr; 28 }; 29 30 #define YA(prog) ya_ ## prog 31 32 #define YET_ANOTHER_COMMAND(prog) \ 33 const struct yacmd YA (prog) = \ 34 { \ 35 .func = prog ## _main, \ 36 .aka = prog ## _aka, \ 37 .pr = &program \ 38 } 39 40 /* b-yacmd.h ends here */ 41