1 /* $Id: func.c,v 1.3 2004-12-19 15:21:11 btb Exp $ */
3 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
4 SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
5 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
6 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
7 IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
8 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
9 FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
10 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
11 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
12 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
16 static char rcsid[] = "$Id: func.c,v 1.3 2004-12-19 15:21:11 btb Exp $";
30 static FUNCTION * func_table = NULL;
31 static int func_size = 0;
32 static int initialized = 0;
33 static int func_params[MAX_PARAMS];
40 void func_init( FUNCTION * funtable, int size )
45 func_table = funtable;
62 int (*func_get( char * name, int * numparams ))(void)
66 for (i=0; i<func_size; i++ )
67 if (!strcmpi( name, func_table[i].name ))
69 *numparams = func_table[i].nparams;
70 return func_table[i].cfunction;
76 int func_get_index( char * name )
80 for (i=0; i<func_size; i++ )
81 if (!strcmpi( name, func_table[i].name ))
90 int (*func_nget( int func_number, int * numparams, char **name ))(void)
92 if (func_number < func_size )
94 *name = func_table[func_number].name;
95 *numparams = func_table[func_number].nparams;
96 return func_table[func_number].cfunction;
102 void func_set_param( int n, int value )
104 func_params[n] = value;
107 int func_get_param( int n )
109 return func_params[n];