1 | /* emacs edit mode for this file is -*- C++ -*- */ |
---|
2 | /* $Id: insert.m4,v 1.2 1998-04-06 10:48:37 schmidt Exp $ */ |
---|
3 | |
---|
4 | ftestSetNameOfGame( insert, `" |
---|
5 | Usage: insert [<options>] [<envSpec>] <f> <g> [<v>] |
---|
6 | inserts canonical form <g> for variable <v> in canonical form |
---|
7 | <f>. <v> defaults to main variable of <f> if not explicitely |
---|
8 | specified. |
---|
9 | "'`' ) |
---|
10 | |
---|
11 | //{{{ docu |
---|
12 | // |
---|
13 | // ftestAlgorithm.m4 - ftestAlgorithm test program. |
---|
14 | // |
---|
15 | // To create ftestAlgorithm.cc, run m4 using the ftest_util.m4 library in |
---|
16 | // the following way: |
---|
17 | // |
---|
18 | // m4 ftest_util.m4 ftestAlgorithm.m4 > ftestAlgorithm.cc |
---|
19 | // |
---|
20 | //}}} |
---|
21 | |
---|
22 | ftestPreprocInit(); |
---|
23 | |
---|
24 | ftestGlobalInit(); |
---|
25 | |
---|
26 | // |
---|
27 | // - main program. |
---|
28 | // |
---|
29 | int |
---|
30 | main ( int argc, char ** argv ) |
---|
31 | { |
---|
32 | // initialization |
---|
33 | ftestMainInit(); |
---|
34 | |
---|
35 | // declare input and output variables |
---|
36 | ftestOutVar( CanonicalForm, result ); |
---|
37 | ftestInVar( CanonicalForm, f ); |
---|
38 | ftestInVar( CanonicalForm, g ); |
---|
39 | ftestInVar( Variable, v ); |
---|
40 | |
---|
41 | // process argument list and set environment |
---|
42 | ftestGetOpts(); |
---|
43 | ftestGetEnv(); |
---|
44 | ftestGetInVar( f ); |
---|
45 | ftestGetInVar( g ); |
---|
46 | ftestGetInVar( v, f.mvar() ); |
---|
47 | |
---|
48 | // do the test! |
---|
49 | if ( ftestArgGiven( v ) ) { |
---|
50 | ftestRun( result = f( g, v ); ); |
---|
51 | } else { |
---|
52 | ftestRun( result = f( g ); ); |
---|
53 | } |
---|
54 | |
---|
55 | // print results |
---|
56 | if ( ftestArgGiven( v ) ) { |
---|
57 | ftestOutput( "f(g, v)", result ); |
---|
58 | } else { |
---|
59 | ftestOutput( "f(g)", result ); |
---|
60 | } |
---|
61 | |
---|
62 | // clean up |
---|
63 | ftestMainExit(); |
---|
64 | } |
---|