Initial revision
[LeanCalc.git] / calc / calc / custom.h
1 /*
2  * custom - interface for custom software and hardware interfaces
3  *
4  * Copyright (C) 1999  Landon Curt Noll
5  *
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.
9  *
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.
14  *
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  * 59 Temple Place, Suite 330, Boston, MA  02111-1307, USA.
19  *
20  * @(#) $Revision$
21  * @(#) $Id$
22  * @(#) $Source$
23  *
24  * Under source code control:   1997/03/03 04:53:08
25  * File existed as early as:    1997
26  *
27  * chongo <was here> /\oo/\     http://www.isthe.com/chongo/
28  * Share and enjoy!  :-)        http://www.isthe.com/chongo/tech/comp/calc/
29  */
30
31 /*
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).
34  *
35  * Don't include anything, let the including .c file bring in:
36  *
37  *      have_const.h
38  *      value.h
39  *
40  * before they include this file.
41  *
42  * Keep this file down to a minimum.   Don't put custom builtin funcion
43  * stuff in this file!
44  */
45
46
47 #if !defined(CUSTOM_H)
48 #define CUSTOM_H
49
50
51 /*
52  * arg count definitons
53  */
54 #define MAX_CUSTOM_ARGS 100     /* maximum number of custom arguments */
55
56
57 /*
58  * custom function interface
59  */
60 struct custom {
61         char *name;             /* name of the custom builtin */
62         char *desc;             /* very brief description of custom builtin */
63         short minargs;          /* minimum number of arguments */
64         short maxargs;          /* maximum number of arguments */
65         VALUE (*func)(char *name, int argc, VALUE **argv);  /* custom func */
66 };
67
68
69 /*
70  * external declarations
71  *
72  * These are the required interfaces.  The dummy.c stubs these interfaces too.
73  */
74 extern VALUE custom(char*, int, VALUE**);       /* master custom interface */
75 extern BOOL allow_custom;               /* TRUE => custom builtins allowed */
76 extern void showcustom(void);           /* print custom functions */
77 extern void customhelp(char *);         /* direct custom help */
78 extern CONST struct custom cust[];      /* custom interface table */
79
80 #endif /* !CUSTOM_H */