1 /* $Id: func.c,v 1.4 2005-01-24 22:07:43 schaffner 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-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
22 static char rcsid[] = "$Id: func.c,v 1.4 2005-01-24 22:07:43 schaffner Exp $";
37 static FUNCTION * func_table = NULL;
38 static int func_size = 0;
39 static int initialized = 0;
40 static int func_params[MAX_PARAMS];
47 void func_init( FUNCTION * funtable, int size )
52 func_table = funtable;
69 int (*func_get( char * name, int * numparams ))(void)
73 for (i=0; i<func_size; i++ )
74 if (!stricmp( name, func_table[i].name ))
76 *numparams = func_table[i].nparams;
77 return func_table[i].cfunction;
83 int func_get_index( char * name )
87 for (i=0; i<func_size; i++ )
88 if (!stricmp( name, func_table[i].name ))
97 int (*func_nget( int func_number, int * numparams, char **name ))(void)
99 if (func_number < func_size )
101 *name = func_table[func_number].name;
102 *numparams = func_table[func_number].nparams;
103 return func_table[func_number].cfunction;
109 void func_set_param( int n, int value )
111 func_params[n] = value;
114 int func_get_param( int n )
116 return func_params[n];