2 * custtbl - custom interface table
4 * Copyright (C) 1999-2007 Landon Curt Noll
6 * Calc is open software; you can redistribute it and/or modify it under
7 * the terms of the version 2.1 of the GNU Lesser General Public License
8 * as published by the Free Software Foundation.
10 * Calc is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
13 * Public License for more details.
15 * A copy of version 2.1 of the GNU Lesser General Public License is
16 * distributed with calc under the filename COPYING-LGPL. You should have
17 * received a copy with calc; if not, write to Free Software Foundation, Inc.
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * @(#) $Revision: 30.2 $
21 * @(#) $Id: custtbl.c,v 30.2 2007/07/05 19:35:20 chongo Exp $
22 * @(#) $Source: /usr/local/src/bin/calc/custom/RCS/custtbl.c,v $
24 * Under source code control: 1997/03/09 02:28:54
25 * File existed as early as: 1997
27 * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
28 * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
33 #include "have_const.h"
38 * NOTE: See the file CUSTOM for instructions on how to add
47 * add your forward custom function declaractions here
49 * Declare custom functions as follows:
51 * E_FUNC VALUE c_xyz(char*, int, VALUE**);
53 * We suggest that you sort the entries below by name.
55 E_FUNC VALUE
c_argv(char*, int, VALUE
**);
56 E_FUNC VALUE
c_devnull(char*, int, VALUE
**);
57 E_FUNC VALUE
c_help(char*, int, VALUE
**);
58 E_FUNC VALUE
c_sysinfo(char*, int, VALUE
**);
59 E_FUNC VALUE
c_pzasusb8(char*, int, VALUE
**);
60 E_FUNC VALUE
c_pmodm127(char*, int, VALUE
**);
61 E_FUNC VALUE
c_register(char*, int, VALUE
**);
68 * custom interface table
70 * The order of the elements in struct custom are:
72 * { "xyz", "brief description of the xyz custom function",
73 * minimum_args, maximum_args, c_xyz },
77 * minimum_args an int >= 0
78 * maximum_args an int >= minimum_args and <= MAX_CUSTOM_ARGS
80 * Use MAX_CUSTOM_ARGS for maximum_args is the maximum number of args
81 * is potentially 'unlimited'.
83 * If the brief description cannot fit on the same line as the name
84 * without wrapping on a 80 col window, the description is probably
85 * too long and will not look nice in the show custom output.
87 CONST
struct custom cust
[] = {
93 * add your own custom functions here
95 * We suggest that you sort the entries below by name
96 * so that show custom will produce a nice sorted list.
99 { "argv", "information about its args, returns arg count",
100 0, MAX_CUSTOM_ARGS
, c_argv
},
102 { "devnull", "does nothing",
103 0, MAX_CUSTOM_ARGS
, c_devnull
},
105 { "help", "help for custom functions",
108 { "sysinfo", "return a calc #define value",
111 { "pzasusb8", "print ZVALUE as USB8",
114 { "pmodm127", "calculate q mod 2^(2^127-1)",
117 { "register", "get or set customer registers",
124 * This must be at the end of this table!!!