2 * custom - interface for custom software and hardware interfaces
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.3 $
21 * @(#) $Id: custom.h,v 30.3 2007/07/10 17:54:03 chongo Exp $
22 * @(#) $Source: /usr/local/src/bin/calc/RCS/custom.h,v $
24 * Under source code control: 1997/03/03 04:53:08
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/
32 * Be careful what you put in this file, upper .c files include
33 * this file even when CUSTOM is not defined (ALLOW_CUSTOM is empty).
35 * Don't include anything, let the including .c file bring in:
40 * before they include this file.
42 * Keep this file down to a minimum. Don't put custom builtin funcion
47 #if !defined(CUSTOM_H)
52 * arg count definitons
54 #define MAX_CUSTOM_ARGS 100 /* maximum number of custom arguments */
60 #define CUSTOM_REG_MAX 31 /* maximum custom register number */
64 * custom function interface
67 char *name
; /* name of the custom builtin */
68 char *desc
; /* very brief description of custom builtin */
69 short minargs
; /* minimum number of arguments */
70 short maxargs
; /* maximum number of arguments */
71 VALUE (*func
)(char *name
, int argc
, VALUE
**argv
); /* custom func */
76 * external declarations
78 * These are the required interfaces. The dummy.c stubs these interfaces too.
80 E_FUNC VALUE
custom(char*, int, VALUE
**); /* master custom interface */
81 EXTERN BOOL allow_custom
; /* TRUE => custom builtins allowed */
82 E_FUNC
void showcustom(void); /* print custom functions */
83 E_FUNC
void customhelp(char *); /* direct custom help */
84 EXTERN CONST
struct custom cust
[]; /* custom interface table */
85 E_FUNC
void init_custreg(void); /* initialize custom registers */
87 #endif /* !CUSTOM_H */