2 // GROUPS passed ptolemy-bugs
7 int dispatcher(int which,int argc,char** argv);
9 int one(int argc, char** argv);
10 int two(int argc, char** argv);
11 int three(int argc, char** argv);
14 // An InterpFuncP is a pointer to an PTcl function that takes an argc-argv
15 // argument list and returns TCL_OK or TCL_ERROR.
17 typedef int (PTcl::*InterpFuncP)(int,char**);
19 struct InterpTableEntry {
24 // Here is the function table and dispatcher function.
25 // These macros define entries for the table
28 #define ENTRY(verb) { quote(verb), &PTcl::verb }
30 static InterpTableEntry funcTable[] = {
37 int PTcl::dispatcher(int which, int argc, char** argv) {
38 return (this->*(funcTable[which].func))(argc, argv);
41 void printargs(char** argv) {
43 // cout << " " << *argv++;
48 int PTcl::one(int, char** argv) {
49 std::cout << "FAIL\n";
54 int PTcl::two(int, char** argv) {
55 std::cout << "PASS\n";
60 int PTcl::three(int, char** argv) {
61 std::cout << "FAIL\n";
66 int main (int argc, char** argv) {
68 return obj.dispatcher(1,argc,argv);