gp2c-0.0.8/0000755000175000017500000000000012217042364007354 500000000000000gp2c-0.0.8/AUTHORS0000644000175000017500000000006311642144547010352 00000000000000Bill Allombert gp2c-0.0.8/INSTALL0000644000175000017500000000376312155572710010342 00000000000000Installation Note: You need the `pari.cfg' file from your PARI installation. PARI installs this file in "$prefix/lib/pari/pari.cfg" Copy or link it to this directory and run Run `./configure' . Then run `make' . Alternatively you can run `./configure --with-paricfg=.../lib/pari/pari.cfg' and `make'. You can run `make check' for an automated check, but it requires your environment being properly detected, so it may fail even if gp2c is usable. Also the installed version of PARI/GP must match the version of the source tree. The "args" check fails if the version mismatch. You can try gp2c in this directory with the script ./gp2c . You can do a "compile-and-run" with the script ./gp2c-run . You can do a "compile-and-debug" with the script ./gp2c-dbg . You can install gp2c and gp2c-run (in /usr/local/bin) by running make install as root. configure support standard configure script options, for example to install in /usr/bin use ./configure --prefix=/usr The following gp2c specific option are recognized. --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer. --with-perl Perl is needed to compile the description files, but gp2c come with a precompiled description for PARI 2.1. so you can use it without perl. Default is to use perl if it is found. You can specify the path to perl with --with-perl=PATH. --with-paricfg PARI configuration is needed to build plug-ins. gp2c itself can be compiled without it, but gp2c-run and 'make check' will not work. You must specify the path to the 'pari.cfg' file with --with-paricfg=PATH. --with-paricfg-dbg=FILE gp2c-dbg is more useful with the debugging version of PARI. You can specify the path to the 'pari.cfg' file of a debugging version with --with-paricfg-dbg=PATH while still using the optimised version with gp2c-run. gp2c-0.0.8/BUGS0000644000175000017500000000251212155572710007763 00000000000000Probably not countable. --- bittest(x:small,y:small) is wrong if y>31 --- x:small%y:small cannot use % in C because -2%3 would be wrong --- || and && are not always fully short-circuiting if second argument is a block. Things that are poorly implemented: ---------------------------------- --- Array (vector, matrix) may be disconnected in the stack. --- vector() and matrix() do not garbage collect. --- Garbage collecting should always be done after a loop. --- Code generated for "a=if(b,c,d)" constructs is ugly. --- user-defined member functions should be inlined --- local() variables are treated identically to my() variables. Thus the scope of local() variable after function call are not the same in GP and in C. Things that are not implemented: -------------------------------- --- a[b,]+=c --- issquare(4,&a[b,]) Discrepancy between gp2c and gp: -------------------------------- --- =\n= is allowed by gp, but not by gp2c. Don't cry. --- Spaces in middle of term like (a b==ab) are not allowed. Be sensible. --- gp2c does not allow functions named local() to be called. --- "error" output PARI errors, not user errors. --- gp2c is generally more lenient than gp about syntax. --- Do not catch misuse of GP 'global()' vars. --- Use of small may lead to overflow problems. --- return() can return 0 instead of nothing. gp2c-0.0.8/ChangeLog0000644000175000017500000007472612217017172011065 00000000000000gp2c (0.0.8) * Added: - support for PARI 2.6.1 - support for Iterator field in description (forpart and forcompositum) * Bugs fix: - closed variable inside loops were missed. - forstep did not support negative vector steps. - multiif did not allow block in predicates. - code for forprime did not garbage collect the stack correctly. - do not generate the same comment multiple time [#1444] * Test-suite: - Update test closure to test closed variable inside loops. - Update forstep test to test negative vector steps. - Add extra tests for PARI >=2.6: compr, forprime, iferr, multiassign, multiif, range. -- Bill Allombert Fri, 20 Sep 2013 12:07:48 +0200 gp2c (0.0.7pl5) * Added: - option -C: add range checking code. - support for 2.6 my([a,b]=v) - support for 2.6 iferr(code,E,rec,pred) * Bugs fix: - addhelp: handle newline correctly. - blocks in default values for function arguments did not work. * Test-suite: - Update test args to test blocks in default values -- Bill Allombert Mon, 06 May 2013 00:25:35 +0200 gp2c (0.0.7pl4) * Added: - support for 2.6 forprime(a,/*omitted*/,...) - support for 2.6 iferr/iferrname. * Bugs fix: - Fix option -o when input is from stdin. - clone was not fully supported. - returning a global variable could break garbage collecting. - support for pari.cfg.dbg was broken. * Test-suite: - Add test forprime to check support for forprime. - Expand initfunc to check support for clone. - Expand return to check returning a global variable. -- Bill Allombert Tue, 16 Oct 2012 19:04:32 +0200 gp2c (0.0.7pl3) * Add support for 2.6 ranges [a..b] and comprehension [a(x)|x<-a,c(x)] * Add support for 2.6 slices M[a..b,^c] * Add support for 2.6 multiif (if(x==0,a,x==1,b,default)) * Add support for 2.6 multi-assignement: [a,b]=v * Bugs fix: - Fix 'make check' breakage on non-glibc systems like OS X and Solaris introduced in the previous release. Thanks to Alessandro Languasco. - genblock() was not C89 standard compliant. - Operators like "+=" did not handle type conversion correctly. - Use of _badtype for unsupported types could crashes gp2c. * Test-suite: - Rename randomprime to randprime to be compatible with PARI 2.6. - Expand cast test to check type conversion of +=. -- Bill Allombert Mon, 07 May 2012 12:50:37 +0200 gp2c (0.0.7pl2) * Do not truncate output file if the input file does not exist. * Add support for 2.6 error messages. * configure now also looks for a pari.cfg.dbg file of a PARI debugging installation. * Bugs fix: - Allow spaces between ) and -> in (x)->x. - stack_base() was not C89 standard compliant. * Test-suite: - Change lambda test to have spaces between ) and -> once. -- Bill Allombert Tue, 21 Feb 2012 22:20:36 +0100 gp2c (0.0.7pl1) * Rename README.SVN to README.GIT. * Test-suite: - Fix 'call' test-suite to work on 32bit. -- Bill Allombert Sun, 02 Oct 2011 23:04:03 +0200 gp2c (0.0.7) * By default, support PARI 2.5 now. * Remove remains of support for PARI 2.1. * Improve scoping of local variables declared inside blocks. * Add basic support for parsing history entries (%). * Bugs fix: - Fix order of evaluation in local()/my(). - Fix support for prototype code 'm'. - Fix support for prototype code 'DP'. - Fix support for prototype code 'Dr'. - Fix value of if(0,x) in blocks. - Fix garbage collection of global variables. - Fix bug when removing dummy variables. * Test-suite: - Expand affect test to check order of evaluation in local()/my(). - Add member test to check support for member function. - Expand if test to check for value of if(0,x) in blocks. - Add extra tests for PARI >=2.5: apply, call, closure, lambda, printf and sums. - Add test cleanvar for testing dummy variables removal. -- Bill Allombert Fri, 22 Jul 2011 14:01:50 +0200 gp2c (0.0.6) * Add support for evaluating closures (need PARI >=2.4.4). * Add support for generating closures from functions. * Add support for generating wrappers for closures. * Add support for functions intnum,sumalt,forsubgroup and related (need PARI >=2.4.4). * Add support for RUNTEST to use with a cross-compiled gp. * Add support for new prototype codes 'Dr', 'Ds', and 'DP'. * Remove -p prefix from gp2c-added variable names to avoid clash. * Move to autoconf 2.67 and automake 1.11, for better or for worse. * Bugs fix: - incorrect use of gerepileupto. - gp2c did not compile Str(a,,b) correctly. - strings with embedded newlines were not well-supported. * Test-suite: - Expand upto test to check for garbage collection problem with complex numbers. - Expand args test to check compilation of Str(a,,b). -- Bill Allombert Fri, 29 Apr 2011 18:38:22 +0200 gp2c (0.0.5pl10) * Add support for new prototype code 'm'. * Add support for new GP operator '==='. * Add support for more than 8 arguments for install() in PARI 2.4.3. * Bugs fix: - gp2c failed to compile affectation to undefined vectors. * Test-suite: - expand affect test to check affectation to undefined vectors. -- Bill Allombert Tue, 26 Oct 2010 12:23:30 +0200 gp2c (0.0.5pl9) * Bugs fix: - fix a bug with the ss* prototype introduced in 0.0.5pl8. * Test-suite: - expand print test to check function using ss* prototype. * Thanks to Alessandro Languasco for testing the previous release. -- Bill Allombert Sat, 30 Jan 2010 11:13:01 +0100 gp2c (0.0.5pl8) * Lots of spelling fix to the documentation by Michael Somos. * Bugs fix: - fix crash due to bad use of internal memory allocator. - fix crash with undefined functions. - function arguments modified through pointers were not copied. * Test-suite: - expand affect test to check function arguments modified through pointers. -- Bill Allombert Sun, 28 Jun 2009 16:36:50 +0200 gp2c (0.0.5pl7) * Add preliminary support for 'W' protocode. * Discard empty rules in descriptions. * Bugs fix: - Fix problem with global(L:list) introduced in 0.0.5pl3. - Handle functions with empty prototype. - Fix problems with function returning vectors in if statements. * Test-suite: - Change print, dot and read tests to be compatible with PARI 2.4.3. - Change initfunc test to try global(L:list). - Change return test to check more if statements. -- Bill Allombert Sat, 13 Dec 2008 17:21:15 +0100 gp2c (0.0.5pl6) * Handle pari.cfg file generated by PARI 2.4.2 properly. * genblock now 'guess' that 'length' returns a small. * GP2C now report errors for spaces inside identifiers. * Rename cvsinit to autogen.sh. * Bugs fix: - Fix compilation of 32- to 63-bits integers on 64-bits systems. - Fix handling of comment at end of included files. - gp2c could try to gcopy non-GEN objects. - Fix garbage collection problem with return() introduced in 0.0.4. - Fix garbage collection problem with vectors. * Test-suite: - Expand cast test to check support for a 42-bit integer. - Expand read test to check support for comments at end of file. - Expand gerepile test to check support for non-GEN objects. - Expand return test to check for garbage collection problems. - Add upto test to check for garbage collection problem with vectors. -- Bill Allombert Tue, 18 Dec 2007 13:32:16 +0100 gp2c (0.0.5pl5) * Add initial support for 'my()' (GP 2.4 extension). * Bugs fix: - Fix handling of comments followed by newlines. - Fix support for sumdiv. * Test-suite: - Expand vector test to test comments followed by newlines. - Expand sumprod test to test whether sumdiv works. -- Bill Allombert Wed, 26 Sep 2007 13:20:07 +0200 gp2c (0.0.5pl4) * Fix Changelog (0.0.5pl3 changes were split in two). * Fix nameclash with Solaris standard headers files. * Bugs fix: - Fix garbage collection problem with if() introduced in 0.0.4. * Test-suite: - Expand if test to trigger garbage collection. -- Bill Allombert Thu, 7 Jun 2007 11:09:42 +0200 gp2c (0.0.5pl3) * No more allow type cast between incompatible types. * Synchronize parser with new GP parser. * Fix some gcc warnings introduced in the previous release. * Bugs fix: - while and until did not handle some complex expression in the condition. - code generated for matrices did not run side-effects in order. - Fix parsing of real numbers. * Test-suite: - expand while test to check more complex expressions in the conditions. - expand matrix test to check side-effects order. - add dot test to check for parsing of real numbers. -- Bill Allombert Thu, 8 Feb 2007 16:46:45 +0100 gp2c (0.0.5pl2) * Fix (harmless) misdetection of PARI versions >= 2.3 * Documentation: - Fix lots of typos. - Update the examples of generated code to be current. * Bugs fix: - Matrices built with matrix() were not typed vec. - Comments after = lead to premature end of function. - Do not generate default value for typed global variables, but generate them for non-typed local variables. * Test-suite: - Add comments to vector test to check support of comments after = - Expand moveblock test to cover blocks inside a[ ,] constructs. * Thanks to Jeffrey Stopple for testing the previous release. -- Bill Allombert Sun, 17 Sep 2006 13:34:26 +0200 gp2c (0.0.5pl1) * Bugs fix: - Fix missing copy with forvec variables. * Test-suite: - Expand forvec test to catch missing copy in forvec. -- Bill Allombert Tue, 20 Jun 2006 17:53:38 +0200 gp2c (0.0.5) * Support for PARI 2.1 and 2.2 has been removed. * Reformat ChangeLog to fit in 80 columns * Fix configure.in to work with recent autoconf. * 'make install' now install gp2c-dbg if gp2c-dbg support was configured. * Add gp2c-dbg.1 man page. * Add ./gp2c-dbg wrapper script. * Change gp2c-run and gp2c-dbg to create a .gp.run file containing the GP; commands instead of gp2c_start.gp and gp2c_gprc. * Build HTML documentation with hevea. * 'make install' now install the documentation. -- Bill Allombert Fri, 16 Jun 2006 11:49:36 +0200 gp2c (0.0.4pl5) * Fix crash on some platforms caused by missing case in gendeblock. * Fix usage of getopt on platforms where char is unsigned. -- Bill Allombert Sun, 14 May 2006 10:04:07 +0200 gp2c (0.0.4pl4) * Add table of contents to the gp2c manual. * Add documentation of the description system (doc/type.tex). * Add support for &a[b]. * Bugs fix: - Fix missing copy with code like x=vector(3);y=x;x[1]++;y * Test-suite: - Expand gerepile test to catch missing copy problems. -- Bill Allombert Sun, 19 Mar 2006 17:34:50 +0100 gp2c (0.0.4pl3) * Add support for break(n)/next(n) for constant n. * Improve small loops detections. * Fix -p option for global variables. * Descriptions: - Add _const_real description for strtor(). - Allow descriptions to match string litterals. - Change #type to only match litterals with exact same types. * Test-suite: - run with -p gp2c_ now. - change 'args' test-suite to be independant of vecsort algorithm. -- Bill Allombert Sun, 4 Dec 2005 19:59:18 +0100 gp2c (0.0.4pl2) * gp2c-run was no more accepting filename containing a /. * Vectors were not typed vec. * Handle the 'r' protocode properly. * Test-suite: - change 'vector' test-suite to be independant of print1() behaviour. -- Bill Allombert Wed, 28 Sep 2005 18:02:41 +0200 gp2c (0.0.4pl1) * Allow the description system to differentiate f(x,) from f(x). * Handle empty files correctly. * Descriptions: - Add _[_,] description for PARI 2.2 row function. * Test-suite: - Change 'print' test to test 'printp1' instead of 'printtex', due to different output in 2.2.11. -- Bill Allombert Tue, 28 Jun 2005 21:11:26 +0200 gp2c (0.0.4) * Interface changes: - Variables declared with a type do not have a default value anymore. See "Effect of types declaration on default values" in the manual. - PARI 2.1 is still supported, but will not pass the test-suite. * Bugs fix: - Fix return() of expressions implemented via block. - Fix parser to allow semi-commas in empty arguments like while(1,;). - Add support for prodeuler(). - Fix segfault on 64-bit platforms. - Allow to define functions with empty body (f(x)=;). - Allow complex expressions as default values for arguments and initial values for variable, for(w=[1,1])=local(v=[1,2]~);w*v. - New syntax local(...):type to set the default type in a local(). - Allow to redefine a function (clobber the previous definition). * Generated code clean-up: - Try to declare several variables on one line. - Do not generate strings containing embedded new lines. - Rewrite the handling of 'return' to generate nicer code. - Better support for immediate t_COL ([...]~). - Better support for negative small real constants. - Add space after comma in code generated for [] and print(). - Use gerepileall instead of gerepilemany when available. - Use NEXT_PRIME_VIADIFF when available for forprime() loops. * Build system: - Add ctags target to generate vi tags to src/Makefile. - Allow to override descriptions with the file desc/override.desc. - Add option --paricfg-dbg to configure to specify the path to the pari.cfg file of a PARI debugging installation. * Descriptions: - Add support for RPN style replacement ${} in descriptions. - Reimplement type casts in term of description (_cast). - Add descriptions for vector/matrix components (in _[_,_]). - Add _const_smallreal description for small real constants. - Add O(_^_) description of O(x^y). - Add description of cgetg (as _cgetg). - Add _const_quote description for 'x constructs. - Add _const_expr description for integers and reals. - Add _gerepileall description to use gerepileall(). - Add _cast_noarg description for default arguments. - Handle print and error through descriptions. - Add _low_stack_lim for low_stack() code. - Add _diffptr description for forprime(). - Add _forprime_next for NEXT_PRIME_VIADIFF. * Test-suite: - Fix 'initfunc' test to be compatible with PARI 2.2.10. - Expand 'vector' test to try constant vectors/matrices. - Expand 'return' test to try returning blocks. - Expand 'moveblock' test to try unary - operator. - Expand 'args' test to try user-defined functions. - Expand 'initfunc' test to try non-cloned matrices. - Expand 'if' test to test parsing of semi-commas in empty arguments. - Expand 'trunc' test to try truncating real constants. - Add 'gerepile' test to exercise garbage-collecting code generation. - Make test-suite independant of random() to avoid test failure on 64bit machines. - Expand 'args' test to try function with complex optional arguments. - Expand 'affect' test to try local variables initialised to a complex expression. - Expand 'initfunc' to test use of undeclared global variables. - Expand 'sumprod' to test prodeuler. - Add 'forvec' to check forvec support. -- Bill Allombert Sun, 15 May 2005 18:51:56 +0200 gp2c (0.0.3pl4) * Fix garbage collecting of forvec loops. * Expand documentation about types. * Add description for gerepileupto (in _gerepileupto). * Add option -o to specify output file instead of stdout. -- Bill Allombert Mon, 10 Jan 2005 16:29:53 +0100 gp2c (0.0.3pl3) * Fix 'gp2c -l'. * Add support for forvec with PARI 2.2.8. * Fix .orders with GP 2.1. * Fix compat.desc logic. -- Bill Allombert Thu, 25 Nov 2004 16:05:55 +0100 gp2c (0.0.3pl2) * PARI/GP Workshop bugfix release. * "make install" no more install useless pari21.dsc. * Store preorder in _type_preorder description instead of hard-coding it in gp2c. Create modes and types dynamically. * Fix -p option. * Fix install() handling. * Change gp2c-run convention: line starting with 'GP;' in the C file are passed to gp at startup. * Implement \r as an include directive. * Add test 'install' and 'read'. * Pass addhelp() to GP using 'GP;' convention. -- Bill Allombert Wed, 22 Sep 2004 10:29:54 +0200 gp2c (0.0.3pl1) * Fix testsuite to accomodate error() change in 2.2.8. * Rewrite README. * Description system: - Fix the parser. - Add compat.desc to support 2.2.7 and newer release. - Add support for matching C type and modes. - Add _declaration, _typedef, and _proto to pari21.desc and compat.desc. - Avoid casting lvalue (ANSI C does not allow it). * use _declaration, _typedef, and _proto to handle C types instead of hardcoding in type.h * Fix gp2c-dbg script to use GP_PATH to find GP. -- Bill Allombert Sat, 26 Jun 2004 12:30:11 +0200 gp2c (0.0.3pl0) * Rewrote the configuration system to use the description system. * Member functions are now fully supported with PARI 2.2.7. * Add support for the new 'i' prototype code. * Add support for the new interface to the 's*' prototype. * Update documentation to reflect change in the installation process and new features. -- Bill Allombert Thu, 18 Dec 2003 17:04:59 +0100 gp2c (0.0.2pl6) * Use signe() instead of gcmp0 for integers and reals. * Provide yywrap so we don't need LEXLIB anymore. * Ship lang.c in the tarball so that flex is not required to build gp2c anymore. -- Bill Allombert Thu, 30 Oct 2003 16:45:28 +0100 gp2c (0.0.2pl5) * Add error message for wrong use of operators. * Add very basic support for lists, via the 'list' type. * Fix config/modules_build to support PARI 2.2.5 interface. * 'install' arguments were not treated as raw input correctly. * gp2c is now more clever at guessing types in genblock. * Update the manual. * Make clean now clean test directory. * fix segfault on sparc introduced in 0.0.2pl4 in findfunctionerr. -- Bill Allombert Thu, 13 Feb 2003 20:26:21 +0100 gp2c (0.0.2pl4) * gp2c-dbg now handle .c files. * Fix code limiting user functions return type. * Expand 'return' test to catch negbool. * Fix bug with if(cond,,code). * Expand 'if' test to check if(cond,,code) and if(cond,code,). * Fix bug in gendeblock with if(cond,print(print)). * Expand 'moveblock' test. * Add descriptions for '^-1'. * Fix -p option with forprime. * Better error messages. * Allow cast system to use descriptions. * Add description for _toGENstr. -- Bill Allombert Tue, 7 Jan 2003 15:40:23 +0100 gp2c (0.0.2pl3) * Fix some gcc warnings. * Portability fix to lang.l (OSF/1). * Test "moveblock" was no more 64 bits clean. * Functions used before declaration generated wrong code. * Description of setunion was incorrect. Thanks Ottavio G. Rizzo. * gp2c-run now handle .c files. * Add gp2c-run.1 man page. * Add section 'Hand-editing the C file generated by gp2c' to manual. -- Bill Allombert Wed, 30 Oct 2002 16:48:54 +0100 gp2c (0.0.2pl2) * '.' was not treated as a ``smallreal''. * v[1,1] was not printed correctly by gp2C -G. * Components do type checking now. * Add 'empty' type for correct type computation. * Use is_subtype for comparisons of types. * Movecode fix from 0.0.0pl8 was incomplete. * Expand tests "affect" and "moveblock". -- Bill Allombert Sat, 31 Aug 2002 11:16:56 +0200 gp2c (0.0.2pl1) * Implement printf format with descriptions. * Add ?type and ?integer default in description. * Implement affection to line of matrix M[a,]=V * Add space in error messages. * Fix the way unused variables are handled. * Fix -p option that was broken in 0.0.2. * Fix type preorder transitivity computation. -- Bill Allombert Thu, 29 Aug 2002 11:40:56 +0200 gp2c (0.0.2) * New parser code. This one support automatic concatenation, the 2.2.4 way. * Add listcalltostack for unfolding function call. * Add concat unfolding to genformat{,arg}. * Add genstr type and cast for t_STRING GEN object. * Add description for Str. * Fix description of __ (concat) operator. * Add a new casting method. * Rewrite the way constants are handled. Fix 1.a bug. * Remove the hard-coded limit on string length. * Use const char *. * Remove the KSTART kludge. * Automatic variables now have consecutive numbers. * Fix operators priority problems with gp2c -G. * Allow empty functions and empty member functions. * Catch declarations with more than one tag. -- Bill Allombert Wed, 28 Aug 2002 15:07:01 +0200 gp2c (0.0.1pl3) * gp2c-dbg really uses GP_DBG now. * Fix a bug introduced in 0.0.0pl11 when handling description with noarg. * Expand "args" test. * 'install' was no more working, and using entries has never worked. * .sign description was incorrect. * Update manual and expand the "common problem" section. * Avoid GENtostr, because it leaks memory. * Implement write*,printtex,printp* via eval(). * For uniformity, print now output to stdout. * Thanks to Herbert Gangl for testing the previous release. -- Bill Allombert Tue, 9 Jul 2002 16:32:15 +0200 gp2c (0.0.1pl2) * gp2c -S breaks with functions with more than 8 args. * Support for simple real constants. * KB style function definition. * Correct typo in gp2c manual. * Add support for manual in HTML. * Fix a bug introduced in 0.0.0pl11 that cause variable to appear several time in gptr lists. * Add --with-paricfg flag to configure. * Better version detection. * Variables ('x) were printed as a number. * gp2c now really ignore '\r'. * typ->str cast generate invalid code. * Default for str args was not quoted correctly. * Use char * instead of void * in src/stack.c. -- Bill Allombert Sat, 29 Jun 2002 17:23:12 +0200 gp2c (0.0.1pl1) * Typo in addseqleft. * Add VCG tree debugging output. * Fix a bug introduced in 0.0.0pl12 with sum(,,if(,,)) constructs. * Add test "sumprod". * Movebloc could create loops in the tree. * gp2c.tex: RTLD_GLOBAL is already in 2.2.2. -- Bill Allombert Sun, 19 May 2002 16:41:39 +0200 gp2c (0.0.1) * Fix problem in gp2c-run when .gprc did not end by a newline. * Add gp2c-dbg script to help debugging (not installed). * Do not use snprintf for portability. * Fix some warning when compiling on 64 bits machines. * Add some more descriptions. * Remove unneeded -u flag to diff in script/dotest. * Fix some compatibility problems with old flex. * Fix SEGV caused by unspecified execution order. * Fix module-build when EXTRADLLDFLAGS use ${LIBS}. * Add BUGS and doc/gp2c.dvi to the tarball. * Remove src/lang.c and test/*/CVS from the tarball. * Make forstep test more robust. * Fix descriptions of _?=_ operators. * FUNCDSC_PATH configuration is now GNU compliant. * matrix() generate extraneous (GEN) cast. * Add missing cast gen->bell. * Fix GP path in gp2c-run. * Thanks to John Cremona for testing the previous release. -- Bill Allombert Fri, 3 May 2002 20:18:17 +0200 gp2c (0.0.0pl12) * Fix line numbers in error messages. * Implement 'fordiv' and 'sumdiv'. * Fix bugs with option -l and -f. * Make gp2c-run recognize -l, -t and -v. * Use "&&" in compile command instead of ";". * Fix some bugs in the garbage collecting code. * Add test "return". * Missing copy with member functions clgp and bnr. * Rewrite the lexical analyser with start condition. * Missing cast in the description of "variable". * Do not generate checkgal (not in pari 2.1 headers). * Add documentation, thanks to Ariel Pacetti for review and install section. * Add some missing #include. * Thanks to Olivier Ramaré for testing the previous release. -- Bill Allombert Wed, 13 Mar 2002 21:31:32 +0100 gp2c (0.0.0pl11) * Remove bnrinit description, unuseful and not PARI 2.2 compliant. * Fix a potential SEGV with undeclared variables. * Fix some printnode bugs. * Better description choice strategy. * Add arguments checking to functions. * New way to handle default arguments. * Preserve comments in output. * Add description for operators between small and real. * Fix a long-standing bug causing extra indentation. * More gerepileupto in place of gerepilemany. * Use stack.[ch] interface for memory allocation. * New option -S (strict arguments). -- Bill Allombert Tue, 19 Feb 2002 19:44:39 +0100 gp2c (0.0.0pl10) * 'x operator is now of type "var" instead of "gen". * Fix a typo in the mode of if(,,) constructs. * Fix initialization of non-GEN global vars. * Expand "if" test. * Add ";" after install commands to help copy-paste under emacs. * Thanks to Henri Cohen for testing the previous release. -- Bill Allombert Wed, 19 Dec 2001 19:53:22 +0100 gp2c (0.0.0pl9) * Add doc directory and manpage. * Add support for new "#" operator. * Add comments for non Gsmall C long. * Better support for DOS files. * Path-independent name for the init function. * Rewrite the way functions definitions are stored. * Implement 'install' as a gp2c directive. * Add a new strategy in gencast. * Add AM_MAINTAINER_MODE to configure.in. * More check in configure.in. * Allows to build without perl, or without PARI, or with debug enabled. * Copy function arguments if they are modified. * Handle absolute path to plugin in install(). * Add tests "cast" and "args", and expand "affect" and "forstep" tests. * Rewrite the way prototype codes are parsed. * Fix global vars initialization. * Make "make check" more clever when gp2c fails. -- Bill Allombert Tue, 18 Dec 2001 17:30:07 +0100 gp2c (0.0.0pl8) * Add gp2c-run script. * Fix some castings from void and to gen. * !(void) is 1 now. * Still better output for gp2c -G. * Add types vec, lg and vecsmall. * Add descriptions supporting lg, vec and vecsmall type. * Fix determination of return type of functions. * Implement user-defined member functions. * Hopefully fix a bug in moveblock(). * Add shell-style comments to description. * Avoid casting lvalues. * Affectations may need parens, like in a+b=c. * Fix description of isprime. * Add new check 'moveblock'. -- Bill Allombert Thu, 15 Nov 2001 12:30:06 +0100 gp2c (0.0.0pl7) * Correct SEGV on files without any functions definitions. * Try to cope with DOS files under unix. * 'if' constructs used as loop bounds were wrongly discarded. * 'M[k,]' induced looping in genblock. * Add new check 'matrix'. * Better output for gp2c -G . * vector and matrix now check theirs index variables. * 'f(x)=;x' is now valid, though ugly. * Output warning for meta-commands. * Output warning and default to gen for unknown functions. * Description of '!' was incomplete leading to extraneous '!!'. * Less spurious warnings. * Thanks to Ariel Pacetti for testing the previous release. -- Bill Allombert Sun, 23 Sep 2001 16:14:34 +0200 gp2c (0.0.0pl6) * Add self test, for 'make check'. * Code for tufu was wrong. * Bug in genentryuser. * Implementation of matrix(). * Gtyp to Ggen coercion. * Global vars are initialized to gzero to protect against gerepile * clone and unclone facilities. * Parser grammar clean up. * Add Gpol and Gvar type. Support for polynomial specific code. * Add Mcopy mode. * Add -p option to protect user namespace. * Rewrite the initialisation function generation code. * Fix typo in description of >>=. -- Bill Allombert Fri, 4 May 2001 13:03:21 +0200 gp2c (0.0.0pl5) * Autoconfiguration of command line to compile the modules. * Better support for '&' references. * Better cleanup of var generate by if() constructs. -- Bill Allombert Sun, 18 Mar 2001 19:38:34 +0100 gp2c (0.0.0pl4) * forstep(z=1,100,[1,3,1]) pre-implementation. * Better garbage collecting. * New option -W warning about undeclared variable. * Now error messages print the line number or the function. * New description code '@' for member function which use several time theirs arguments. * Variables added by the compiler of type `long' are named l1, l2, etc... * User vars named l1, l2, l_1, etc... are now renamed l_1, l_2, l__1, etc... * Now generate an initialization function automatically. * Better variable optimizations. * \= and \/= were absolutely buggy. * Rewrote movecode/moveblock to be safe with entangled bloc. * while(,SEQ) and until(,SEQ) now work. * Add support for clone. * for(i:small=1,x,SEQ) now work. -- Bill Allombert Thu, 15 Mar 2001 12:33:40 +0100 gp2c (0.0.0pl3) * Fix `forstep'. * Now error accept multiple parameter, as print do. * `next' now is accepted. * Add types nf,bnf,bnr,clgp,prid,ell,bell,gal to allow implementation of member functions. * Operators and member functions are now handled by descriptions. * Fix PARI version detection for 2.2 * User vars named p1, p2, p_1, etc... are now renamed p_1, p_2, p__1, etc... * 'lim' now renamed st_lim to reduce name clash. * Much less extraneous parens generated. * `&' references now work. -- Bill Allombert Sun, 4 Mar 2001 11:53:16 +0100 gp2c (0.0.0pl2) * Update scripts that were forgotten in pl1. * Fix indentation in `for' loop. * Added some provisions for better garbage collecting. -- Bill Allombert Sat, 13 Jan 2001 21:29:32 +0100 gp2c (0.0.0pl1) * Now initialization in type declaration is supported, like f(x:long=3)=local(z:mp=1.2);... * New func.desc format. * Garbage collecting before return more secure but still ugly. -- Bill Allombert Fri, 12 Jan 2001 21:29:32 +0100 gp2c (0.0.0pl0) * Initial Release. -- Bill Allombert Tue, 12 Dec 2000 17:33:32 +0100 Local variables: mode: debian-changelog End: gp2c-0.0.8/COPYING0000644000175000017500000004312711642144547010345 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. gp2c-0.0.8/configure.ac0000644000175000017500000001437412165117523011575 00000000000000dnl Process this file with autoconf to produce a configure script. AC_INIT(src/gp2c.c) AC_CONFIG_AUX_DIR(config) AM_INIT_AUTOMAKE(gp2c,0.0.8) AM_MAINTAINER_MODE dnl Be nice with packagers. AM_CONFIG_HEADER(src/config.h) dnl AC_PREFIX_PROGRAM(gp) dnl Checks for programs. AC_PROG_CC AM_PROG_LEX AC_PROG_YACC dnl look for perl AC_ARG_WITH(perl, [ --with-perl[=FILE] Perl is needed to compile the description files. But gp2c comes with precompiled descriptions for PARI 2.5, so can be used without perl. Default is to use perl if we find it. You can specify the path to perl with --with-perl=PATH.]) if test "$with_perl" = "no"; then PERL_PATH=/bin/false elif test -x "$with_perl"; then PERL_PATH="$with_perl" else AC_PATH_PROG(PERL_PATH,perl,/bin/false) fi dnl check for PARI configuration AC_ARG_WITH(paricfg, [ --with-paricfg[=FILE] Details about PARI configuration are needed to build plug-ins. Without them, gp2c itself can be compiled, but gp2c-run and 'make check' will not work. You must specify the path to the 'pari.cfg' file with --with-paricfg=PATH.]) if test "$with_paricfg" = "no" ; then PARI_CONFIG= else AC_MSG_CHECKING(for PARI configuration) if test "$with_paricfg" = "yes" || test "x$with_paricfg" = "x" ; then test -f /usr/local/lib/pari/pari.cfg && PARI_CONFIG=/usr/local/lib/pari/pari.cfg test -f /usr/lib/pari/pari.cfg && PARI_CONFIG=/usr/lib/pari/pari.cfg test -f "$srcdir/../pari.cfg" && PARI_CONFIG="$srcdir/../pari.cfg" test -f "$srcdir/pari.cfg" && PARI_CONFIG="$srcdir/pari.cfg" else test -f "$with_paricfg" && PARI_CONFIG="$with_paricfg" fi if test "x$with_paricfg" != "x" && test "x$PARI_CONFIG" = "x" ; then AC_MSG_ERROR([pari.cfg file not found. Please use --with-paricfg=PATH where PATH is the path to pari.cfg or dft.Config.in file.]) fi if test "x$PARI_CONFIG" = "x"; then AC_MSG_RESULT("not found") else AC_MSG_RESULT($PARI_CONFIG) fi fi AC_ARG_WITH(paricfg-dbg, [ --with-paricfg-dbg[=FILE] gp2c-dbg is more useful with the debugging version of PARI. You can specify the path to the 'pari.cfg' file of a debugging version with --with-paricfg-dbg=PATH while still using the optimised version with gp2c-run. ]) if test "$with_paricfg_dbg" = "no" ; then PARI_CONFIG_DBG= else AC_MSG_CHECKING([for PARI configuration (debugging)]) if test "$with_paricfg_dbg" = "yes" || test "x$with_paricfg_dbg" = "x" ; then test -f /usr/local/lib/pari/pari.cfg.dbg && PARI_CONFIG_DBG=/usr/local/lib/pari/pari.cfg.dbg test -f /usr/lib/pari/pari.cfg.dbg && PARI_CONFIG_DBG=/usr/lib/pari/pari.cfg.dbg test -f "$srcdir/../pari.cfg.dbg" && PARI_CONFIG_DBG="$srcdir/../pari.cfg.dbg" test -f "$srcdir/pari.cfg.dbg" && PARI_CONFIG_DBG="$srcdir/pari.cfg.dbg" else test -f "$with_paricfg_dbg" && PARI_CONFIG_DBG="$with_paricfg_dbg" fi if test "x$with_paricfg_dbg" != "x" && test "x$PARI_CONFIG_DBG" = "x" ; then AC_MSG_ERROR([pari.cfg[.dbg] file not found. Please use --with-paricfg-dbg=PATH where PATH is the path to pari.cfg[.dbg] or dft.Config.in file.]) fi if test "x$PARI_CONFIG_DBG" = "x"; then AC_MSG_RESULT("not found") else AC_MSG_RESULT($PARI_CONFIG_DBG) fi fi if test "x$PARI_CONFIG" != "x" ; then AC_MSG_CHECKING(for PARI version) PARI_VERSION=`$srcdir/config/pari-version $PARI_CONFIG` AC_MSG_RESULT($PARI_VERSION) AC_MSG_CHECKING(for PARI module build) PARI_MODULE_BUILD=`$srcdir/config/module-build $PARI_CONFIG` AC_MSG_RESULT($PARI_MODULE_BUILD) AC_MSG_CHECKING(for GP path) GP_PATH=`$srcdir/config/pari-conf $PARI_CONFIG bindir`/gp AC_MSG_RESULT($GP_PATH) AC_MSG_CHECKING(for PARI data directory) PARI_DATADIR=`$srcdir/config/pari-conf $PARI_CONFIG datadir` AC_MSG_RESULT($PARI_DATADIR) AC_MSG_CHECKING(for PARI description database) PARI_DESC="$PARI_DATADIR/pari.desc"; test -f "$PARI_DESC" || PARI_DESC="missing" AC_MSG_RESULT($PARI_DESC) else PARI_VERSION='2.5.x (released)' PARI_MODULE_BUILD="`pwd`/$srcdir/config/missing $PARI_CONF"; GP_PATH="gp" fi if test "x$PARI_CONFIG_DBG" != "x" ; then AC_MSG_CHECKING([for PARI module build (debugging)]) PARI_MODULE_DEBUG=`$srcdir/config/module-build $PARI_CONFIG_DBG` AC_MSG_RESULT($PARI_MODULE_DEBUG) AC_MSG_CHECKING([for GP path (debugging)]) GP_PATH_DBG=`$srcdir/config/pari-conf $PARI_CONFIG_DBG bindir`/gp AC_MSG_RESULT($GP_PATH_DBG) GP2C_DBG="gp2c-dbg" GP2C_DBG1="gp2c-dbg.1" else PARI_MODULE_DEBUG=$PARI_MODULE_BUILD GP_PATH_DBG=$GP_PATH GP2C_DBG="" GP2C_DBG1="" fi AC_DEFINE_UNQUOTED(PARI_VERSION,"$PARI_VERSION",[target PARI version]) AC_DEFINE_UNQUOTED(PARI_MODULE_BUILD,"$PARI_MODULE_BUILD",[target PARI module build]) AC_SUBST(PARI_VERSION) AC_SUBST(PARI_MODULE_BUILD) AC_SUBST(GP_PATH) AC_SUBST(PARI_DATADIR) AC_SUBST(PARI_DESC) AC_SUBST(PARI_MODULE_DEBUG) AC_SUBST(GP_PATH_DBG) AC_SUBST(GP2C_DBG) AC_SUBST(GP2C_DBG1) dnl RUNTEST AC_MSG_CHECKING([for RUNTEST (if needed)]) if test "x$RUNTEST" = "x" && test "x$PARI_CONFIG" != "x" ; then PARI_RUNTEST=`$srcdir/config/pari-conf $PARI_CONFIG RUNTEST` else PARI_RUNTEST="$RUNTEST" fi AC_MSG_RESULT($PARI_RUNTEST) AC_SUBST(PARI_RUNTEST) dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(malloc.h unistd.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_TYPE_SIZE_T AC_STRUCT_TM dnl Checks for library functions. AC_FUNC_VPRINTF AC_CHECK_FUNCS(strdup strtol getopt strcmp memccpy strrchr) dnl How to use echo ECHON=${ECHO_N-"$ac_n"} ECHOC=${ECHO_C-"$ac_c"} ECHOT=${ECHO_T-"$ac_t"} AC_SUBST(ECHON) AC_SUBST(ECHOC) AC_SUBST(ECHOT) if test "$bindir" = '${exec_prefix}/bin'; then if test "x${exec_prefix}" != xNONE; then mybindir=${exec_prefix}/bin elif test "x${prefix}" != xNONE; then mybindir=${prefix}/bin else mybindir=${ac_default_prefix}/bin fi else mybindir=$bindir fi AC_SUBST(mybindir) AC_OUTPUT([Makefile src/Makefile desc/Makefile doc/Makefile test/Makefile test2/Makefile test3/Makefile scripts/Makefile scripts/822_desc.pl scripts/runtest scripts/dotest scripts/gp2c-run scripts/gp2c-dbg doc/gp2c-run.1 doc/gp2c-dbg.1],[chmod a+x scripts/822_desc.pl scripts/runtest scripts/dotest scripts/gp2c-run scripts/gp2c-dbg]) gp2c-0.0.8/desc/0000755000175000017500000000000012217042364010272 500000000000000gp2c-0.0.8/desc/func23.dsc0000644000175000017500000016400612163255111012010 00000000000000!_ 2 0 2 ${1 code} 1 negbool 2 bool parens ${1 code} 1 bool 2 negbool parens 1 gnot G 1 gen +_ 1 0 5 ${1 code} 1 small 2 small parens ${1 code} 1 int 3 int parens copy ${1 code} 1 real 3 real parens copy ${1 code} 1 mp 3 mp parens copy ${1 code} 1 gen 3 gen parens copy -_ 2 0 5 -${parens 1 code} 1 small 2 small parens negi(${1 code}) 1 int 1 int negr(${1 code}) 1 real 1 real mpneg(${1 code}) 1 mp 1 mp gneg(${1 code}) 1 gen 1 gen 1 gneg G 1 gen Col 2 0 2 cgetg(1,t_COL) 0 1 vec gtocol(${1 code}) 1 gen 1 vec 1 gtocol DG 1 gen Euler 2 0 1 mpeuler(prec) 0 2 real prec 1 mpeuler p 2 gen prec I 2 0 1 gi 0 1 gen 1 geni 1 gen List 2 0 1 gtolist(${1 code}) 1 ?gen 1 list 1 gtolist DG 1 gen Mat 1 1 gtomat DG 1 gen Mod 2 0 6 gmodulss(${1 code}, ${2 code}) 2 small small 1 gen gmodulss(${1 code}, ${2 code}) 3 small small #small 1 gen gmodulsg(${1 code}, ${2 code}) 2 small gen 1 gen gmodulsg(${1 code}, ${2 code}) 3 small gen #small 1 gen gmodulo(${1 code}, ${2 code}) 2 gen gen 1 gen gmodulo(${1 code}, ${2 code}) 3 gen gen #small 1 gen 1 Mod0 GGD0,L, 1 gen O 0 O(_^_) 1 0 5 ggrando(${1 code}, 1) 1 gen 1 gen ggrando(gen_1, ${2 code}) 2 1 small 1 gen zeropadic(${1 code}, ${2 code}) 2 int small 1 gen ggrando(${1 code}, ${2 code}) 2 gen small 1 gen zeroser(${1 code}, ${2 code}) 2 var small 1 gen Pi 2 0 1 mppi(prec) 0 2 real prec 1 mppi p 2 gen prec Pol 2 0 1 gtopoly(${1 code}, ${2 code}) 2 gen ?var 1 pol 1 gtopoly GDn 1 gen Polrev 2 0 1 gtopolyrev(${1 code}, ${2 code}) 2 gen ?var 1 pol 1 gtopolyrev GDn 1 gen Qfb 1 1 Qfb0 GGGDGp 2 gen prec Ser 1 1 gtoser GDn 1 gen Set 2 0 2 cgetg(1,t_VEC) 0 1 vec gtoset(${1 code}) 1 gen 1 vec 1 gtoset DG 1 gen Str 2 0 1 ${1 :genstr cast} 1 gen 3 genstr copy parens 1 Str s* 1 gen Strchr 1 1 Strchr G 1 gen Strexpand 1 1 Strexpand s* 1 gen Strtex 1 1 Strtex s* 1 gen Vec 2 0 2 cgetg(1,t_VEC) 0 1 vec gtovec(${1 code}) 1 gen 1 vec 1 gtovec DG 1 gen Vecsmall 2 0 1 gtovecsmall(${1 code}) 1 gen 1 vecsmall 1 gtovecsmall DG 1 gen _! 2 0 1 mpfact(${1 code}) 1 small 1 int 1 mpfact L 1 gen _!=_ 2 0 15 ${parens 1 code} != ${parens 2 code} 2 small small 2 bool parens ${parens 1 code} != ${parens 2 code} 2 lg lg 2 bool parens cmpsi(${1 code}, ${2 code}) != 0 2 small int 2 bool parens cmpis(${1 code}, ${2 code}) != 0 2 int small 2 bool parens equalii(${1 code}, ${2 code}) 2 int int 1 negbool cmprr(${1 code}, ${2 code}) != 0 2 real real 1 bool mpcmp(${1 code}, ${2 code}) != 0 2 mp mp 2 bool parens ${parens 1 code} != ${parens 2 code} 2 typ typ 2 bool parens ${parens 1 code} != ${parens 2 :typ cast} 2 typ #str 2 bool parens ${parens 1 :typ cast} != ${parens 2 code} 2 #str typ 2 bool parens strcmp(${1 code}, ${2 code}) 2 str str 1 bool ${parens 1 code} != ${parens 2 code} 2 typ typ 2 bool parens gequalsg(${1 code}, ${2 code}) 2 small gen 1 negbool gequalgs(${1 code}, ${2 code}) 2 gen small 1 negbool gequal(${1 code}, ${2 code}) 2 gen gen 1 negbool 1 gne GG 1 gen _%=_ 1 0 6 ${1 code} = smodss(${1 code}, ${2 code}) 2 *small small 2 small parens ${1 code} = modis(${1 code}, ${2 code}) 2 *int small 2 int parens ${1 code} = modii(${1 code}, ${2 code}) 2 *int int 2 int parens ${1 code} = gmod(${1 code}, ${2 code}) 2 *pol gen 2 gen parens ${1 code} = gmodgs(${1 code}, ${2 code}) 2 *gen small 2 gen parens ${1 code} = gmod(${1 code}, ${2 code}) 2 *gen gen 2 gen parens _%_ 2 0 7 smodss(${1 code}, ${2 code}) 2 small small 1 small modsi(${1 code}, ${2 code}) 2 small int 1 int smodis(${1 code}, ${2 code}) 2 int small 1 small modii(${1 code}, ${2 code}) 2 int int 1 int gmodgs(${1 code}, ${2 code}) 2 gen small 1 gen gmodsg(${1 code}, ${2 code}) 2 small gen 1 gen gmod(${1 code}, ${2 code}) 2 gen gen 1 gen 1 gmod GG 1 gen _&&_ 1 0 1 ${parens 1 code} && ${parens 2 code} 2 bool bool 2 bool parens _' 2 0 1 deriv(${1 code},-1) 1 gen 1 gen 1 deriv GDn 1 gen _*=_ 1 0 12 ${1 code} *= ${parens 2 code} 2 *small small 2 small parens ${1 code} = mulis(${1 code}, ${2 code}) 2 *int small 2 int parens ${1 code} = mulii(${1 code}, ${2 code}) 2 *int int 2 int parens ${1 code} = mulrs(${1 code}, ${2 code}) 2 *real small 2 real parens ${1 code} = mulri(${1 code}, ${2 code}) 2 *real int 2 real parens ${1 code} = mulrr(${1 code}, ${2 code}) 2 *real real 2 real parens ${1 code} = mpmul(${1 code}, ${2 code}) 2 *mp mp 2 mp parens ${1 code} = gmulgs(${1 code}, ${2 code}) 2 *pol small 2 gen parens ${1 code} = gmul(${1 code}, ${2 code}) 2 *pol gen 2 gen parens ${1 code} = gmul(${1 code}, ${2 code}) 2 *vec gen 2 gen parens ${1 code} = gmulgs(${1 code}, ${2 code}) 2 *gen small 2 gen parens ${1 code} = gmul(${1 code}, ${2 code}) 2 *gen gen 2 gen parens _*_ 2 0 14 ${parens 1 code}*${parens 2 code} 2 small small 2 small parens mulis(${1 code}, ${2 code}) 2 int small 1 int mulsi(${1 code}, ${2 code}) 2 small int 1 int mulii(${1 code}, ${2 code}) 2 int int 1 int (${2 code}, 0)/*for side effect*/ 2 0 mp 1 small mulsr(${1 code}, ${2 code}) 2 #small real 1 real mulsr(${1 code}, ${2 code}) 2 small real 1 mp mulrs(${1 code}, ${2 code}) 2 real small 1 mp mulrr(${1 code}, ${2 code}) 2 real real 1 real mpmul(${1 code}, ${2 code}) 2 mp mp 1 mp gmulgs(${1 code}, ${2 code}) 2 gen small 1 gen gmulsg(${1 code}, ${2 code}) 2 small gen 1 gen perm_mul(${1 code}, ${2 code}) 2 vecsmall vecsmall 1 vecsmall gmul(${1 code}, ${2 code}) 2 gen gen 1 gen 1 gmul GG 1 gen _++ 1 0 8 ++${1 code} 1 *bptr 1 bptr ++${1 code} 1 *small 1 small ++${1 code} 1 *lg 1 lg ${1 code} = addis(${1 code}, 1) 1 *int 2 int parens ${1 code} = addrs(${1 code}, 1) 1 *real 2 real parens ${1 code} = mpadd(${1 code}, gen_1) 1 *mp 2 mp parens ${1 code} = gaddgs(${1 code}, 1) 1 *pol 2 pol parens ${1 code} = gaddgs(${1 code}, 1) 1 *gen 2 gen parens _+=_ 1 0 13 ${1 code} += ${parens 2 code} 2 *small small 2 small parens ${1 code} += ${parens 2 code} 2 *lg small 2 lg parens ${1 code} = addis(${1 code}, ${2 code}) 2 *int small 2 int parens ${1 code} = addii(${1 code}, ${2 code}) 2 *int int 2 int parens ${1 code} = addrs(${1 code}, ${2 code}) 2 *real small 2 real parens ${1 code} = addir(${2 code}, ${1 code}) 2 *real int 2 real parens ${1 code} = addrr(${1 code}, ${2 code}) 2 *real real 2 real parens ${1 code} = mpadd(${1 code}, ${2 code}) 2 *mp mp 2 mp parens ${1 code} = gaddgs(${1 code}, ${2 code}) 2 *pol small 2 gen parens ${1 code} = gadd(${1 code}, ${2 code}) 2 *pol gen 2 gen parens ${1 code} = gadd(${1 code}, ${2 code}) 2 *vec gen 2 gen parens ${1 code} = gaddgs(${1 code}, ${2 code}) 2 *gen small 2 gen parens ${1 code} = gadd(${1 code}, ${2 code}) 2 *gen gen 2 gen parens _+_ 2 0 16 ${parens 1 code} 2 lg 1 2 small parens ${parens 1 code} + ${parens 2 code} 2 small small 2 small parens ${parens 1 code} + ${parens 2 code} 2 lg small 2 lg parens ${parens 1 code} + ${parens 2 code} 2 small lg 2 lg parens addis(${1 code}, ${2 code}) 2 int small 1 int addsi(${1 code}, ${2 code}) 2 small int 1 int addii(${1 code}, ${2 code}) 2 int int 1 int addrs(${1 code}, ${2 code}) 2 real small 1 real addsr(${1 code}, ${2 code}) 2 small real 1 real addrr(${1 code}, ${2 code}) 2 real real 1 real mpadd(${1 code}, ${2 code}) 2 mp real 1 real mpadd(${1 code}, ${2 code}) 2 real mp 1 real mpadd(${1 code}, ${2 code}) 2 mp mp 1 mp gaddgs(${1 code}, ${2 code}) 2 gen small 1 gen gaddsg(${1 code}, ${2 code}) 2 small gen 1 gen gadd(${1 code}, ${2 code}) 2 gen gen 1 gen 1 gadd GG 1 gen _-- 1 0 8 --${1 code} 1 *bptr 1 bptr --${1 code} 1 *small 1 small --${1 code} 1 *lg 1 lg ${1 code} = subis(${1 code}, 1) 1 *int 2 int parens ${1 code} = subrs(${1 code}, 1) 1 *real 2 real parens ${1 code} = mpsub(${1 code}, gen_1) 1 *mp 2 mp parens ${1 code} = gsubgs(${1 code}, 1) 1 *pol 2 pol parens ${1 code} = gsubgs(${1 code}, 1) 1 *gen 2 gen parens _-=_ 1 0 13 ${1 code} -= ${parens 2 code} 2 *small small 2 small parens ${1 code} -= ${parens 2 code} 2 *lg small 2 lg parens ${1 code} = subis(${1 code}, ${2 code}) 2 *int small 2 int parens ${1 code} = subii(${1 code}, ${2 code}) 2 *int int 2 int parens ${1 code} = subrs(${1 code}, ${2 code}) 2 *real small 2 real parens ${1 code} = subri(${1 code}, ${2 code}) 2 *real int 2 real parens ${1 code} = subrr(${1 code}, ${2 code}) 2 *real real 2 real parens ${1 code} = mpsub(${1 code}, ${2 code}) 2 *mp mp 2 mp parens ${1 code} = gsubgs(${1 code}, ${2 code}) 2 *pol small 2 gen parens ${1 code} = gsub(${1 code}, ${2 code}) 2 *pol gen 2 gen parens ${1 code} = gsub(${1 code}, ${2 code}) 2 *vec gen 2 gen parens ${1 code} = gsubgs(${1 code}, ${2 code}) 2 *gen small 2 gen parens ${1 code} = gsub(${1 code}, ${2 code}) 2 *gen gen 2 gen parens _-_ 2 0 14 ${parens 1 code} - ${parens 2 code} 2 small small 2 small parens ${parens 1 code} - ${parens 2 code} 2 lg small 2 lg parens subis(${1 code}, ${2 code}) 2 int small 1 int subsi(${1 code}, ${2 code}) 2 small int 1 int subii(${1 code}, ${2 code}) 2 int int 1 int subrs(${1 code}, ${2 code}) 2 real small 1 real subsr(${1 code}, ${2 code}) 2 small real 1 real subrr(${1 code}, ${2 code}) 2 real real 1 real mpsub(${1 code}, ${2 code}) 2 mp real 1 real mpsub(${1 code}, ${2 code}) 2 real mp 1 real mpsub(${1 code}, ${2 code}) 2 mp mp 1 mp gsubgs(${1 code}, ${2 code}) 2 gen small 1 gen gsubsg(${1 code}, ${2 code}) 2 small gen 1 gen gsub(${1 code}, ${2 code}) 2 gen gen 1 gen 1 gsub GG 1 gen _.a1 2 0 1 gel(${1 code}, 1) 1 ell 2 gen copy 1 member_a1 G 1 gen _.a2 2 0 1 gel(${1 code}, 2) 1 ell 2 gen copy 1 member_a2 G 1 gen _.a3 2 0 1 gel(${1 code}, 3) 1 ell 2 gen copy 1 member_a3 G 1 gen _.a4 2 0 1 gel(${1 code}, 4) 1 ell 2 gen copy 1 member_a4 G 1 gen _.a6 2 0 1 gel(${1 code}, 5) 1 ell 2 gen copy 1 member_a6 G 1 gen _.area 2 0 1 gel(${1 code}, 19) 1 bell 2 gen copy 1 member_area G 1 gen _.b2 2 0 1 gel(${1 code}, 6) 1 ell 2 gen copy 1 member_b2 G 1 gen _.b4 2 0 1 gel(${1 code}, 7) 1 ell 2 gen copy 1 member_b4 G 1 gen _.b6 2 0 1 gel(${1 code}, 8) 1 ell 2 gen copy 1 member_b6 G 1 gen _.b8 2 0 1 gel(${1 code}, 9) 1 ell 2 gen copy 1 member_b8 G 1 gen _.bid 2 0 1 member_bid(${1 code}) 1 gen 1 gen 1 member_bid G 1 gen _.bnf 2 0 3 ${1 code} 1 bnf 2 bnf parens ${1 :bnf cast} 1 bnr 3 bnf copy parens member_bnf(${1 code}) 1 gen 1 bnf 1 member_bnf G 1 gen _.c4 2 0 1 gel(${1 code}, 10) 1 ell 2 gen copy 1 member_c4 G 1 gen _.c6 2 0 1 gel(${1 code}, 11) 1 ell 2 gen copy 1 member_c6 G 1 gen _.clgp 2 0 4 ${1 :clgp cast} 1 bnf 3 clgp copy parens ${1 :clgp cast} 1 bnr 3 clgp copy parens ${1 code} 1 clgp 2 clgp parens member_clgp(${1 code}) 1 gen 1 clgp 1 member_clgp G 1 gen _.codiff 1 1 member_codiff G 1 gen _.cyc 2 0 2 gel(${1 code}, 2) 1 clgp 2 gen copy member_cyc(${1 code}) 1 gen 1 gen 1 member_cyc G 1 gen _.diff 2 0 2 gmael(${1 code}, 5, 5) 1 nf 2 gen copy member_diff(${1 code}) 1 gen 1 gen 1 member_diff G 1 gen _.disc 2 0 3 gel(${1 code}, 3) 1 nf 2 int copy gel(${1 code}, 12) 1 ell 2 gen copy member_disc(${1 code}) 1 gen 1 gen 1 member_disc G 1 gen _.e 2 0 1 gel(${1 code}, 3) 1 prid 2 int copy 1 member_e G 1 gen _.eta 1 1 member_eta G 1 gen _.f 2 0 1 gel(${1 code}, 4) 1 prid 2 int copy 1 member_f G 1 gen _.fu 2 0 3 $"ray units not implemented" 1 bnr 1 void gmael(${1 code}, 8, 5) 1 bnf 2 gen copy gmael(${1 code}, 8, 5) 1 gen 2 gen copy 1 member_fu G 1 gen _.futu 1 1 member_futu G 1 gen _.gen 2 0 3 gel(${1 code}, 7) 1 gal 2 gen copy gel(${1 code}, 3) 1 clgp 2 gen copy member_gen(${1 code}) 1 gen 1 gen 1 member_gen G 1 gen _.group 2 0 1 gel(${1 code}, 6) 1 gal 2 gen copy 1 member_group G 1 gen _.index 2 0 2 gel(${1 code}, 4) 1 nf 2 int copy member_index(${1 code}) 1 gen 1 int 1 member_index G 1 gen _.j 2 0 1 gel(${1 code}, 13) 1 ell 2 gen copy 1 member_j G 1 gen _.mod 1 1 member_mod G 1 gen _.nf 2 0 2 ${1 code} 1 nf 2 nf parens member_nf(${1 code}) 1 gen 1 nf 1 member_nf G 1 gen _.no 2 0 2 gel(${1 code}, 1) 1 clgp 2 gen copy member_no(${1 code}) 1 gen 1 gen 1 member_no G 1 gen _.omega 1 1 member_omega G 1 gen _.orders 2 0 1 gel(${1 code}, 8) 1 gal 2 vecsmall copy 1 member_orders G 1 gen _.p 2 0 3 gmael(${1 code}, 2, 1) 1 gal 2 int copy gel(${1 code}, 1) 1 prid 2 int copy member_p(${1 code}) 1 gen 1 int 1 member_p G 1 gen _.pol 2 0 3 gel(${1 code}, 1) 1 gal 2 gen copy gel(${1 code}, 1) 1 nf 2 gen copyi member_pol(${1 code}) 1 gen 1 gen 1 member_pol G 1 gen _.r1 2 0 2 gmael(${1 code}, 2, 1) 1 nf 2 int copy member_r1(${1 code}) 1 gen 1 int 1 member_r1 G 1 gen _.r2 2 0 2 gmael(${1 code}, 2, 2) 1 nf 2 int copy member_r2(${1 code}) 1 gen 1 int 1 member_r2 G 1 gen _.reg 2 0 3 $"ray regulator not implemented" 1 bnr 1 void gmael(${1 code}, 8, 2) 1 bnf 2 real copy gmael(${1 code}, 8, 2) 1 gen 2 real copy 1 member_reg G 1 gen _.roots 2 0 4 gel(${1 code}, 3) 1 gal 2 gen copy gel(${1 code}, 14) 1 bell 2 gen copy gel(${1 code}, 6) 1 nf 2 gen copy member_roots(${1 code}) 1 gen 1 gen 1 member_roots G 1 gen _.sign 2 0 2 gel(${1 code}, 2) 1 nf 2 vec copy member_sign(${1 code}) 1 gen 1 vec 1 member_sign G 1 gen _.t2 2 0 1 member_t2(${1 code}) 1 gen 1 vec 1 member_t2 G 1 gen _.tate 1 1 member_tate G 1 gen _.tu 2 0 3 $"ray units not implemented" 1 bnr 1 void gmael(${1 code}, 8, 4) 1 bnf 2 gen copy gmael(${1 code}, 8, 4) 1 gen 2 gen copy 1 member_tu G 1 gen _.tufu 1 1 member_tufu G 1 gen _.w 2 0 1 gel(${1 code}, 18) 1 bell 2 gen copy 1 member_w G 1 gen _.zk 2 0 1 gel(${1 code}, 17) 1 nf 2 gen copy 1 member_zk G 1 gen _.zkst 2 0 1 gel(${1 code}, 2) 1 bnr 2 gen copy 1 member_zkst G 1 gen _/=_ 1 0 10 $"cannot divide small: use \= instead." 2 *small gen 1 void $"cannot divide int: use \= instead." 2 *int gen 1 void ${1 code} = divrr(${1 code}, ${2 code}) 2 *real real 2 real parens ${1 code} = divrs(${1 code}, ${2 code}) 2 *real small 2 real parens ${1 code} = mpdiv(${1 code}, ${2 code}) 2 *real mp 2 real parens ${1 code} = mpdiv(${1 code}, ${2 code}) 2 *mp real 2 mp parens ${1 code} = gdiv(${1 code}, ${2 code}) 2 *pol gen 2 gen parens ${1 code} = gdiv(${1 code}, ${2 code}) 2 *vec gen 2 gen parens ${1 code} = gdivgs(${1 code}, ${2 code}) 2 *gen small 2 gen parens ${1 code} = gdiv(${1 code}, ${2 code}) 2 *gen gen 2 gen parens _/_ 2 0 11 (${2 code}, 0)/*for side effect*/ 2 0 mp 1 small divsr(${1 code}, ${2 code}) 2 #small real 1 real divsr(${1 code}, ${2 code}) 2 small real 1 mp divrs(${1 code}, ${2 code}) 2 real small 1 real divrr(${1 code}, ${2 code}) 2 real real 1 real mpdiv(${1 code}, ${2 code}) 2 real mp 1 real mpdiv(${1 code}, ${2 code}) 2 mp real 1 mp ginv(${2 code}) 2 1 gen 1 gen gdivgs(${1 code}, ${2 code}) 2 gen small 1 gen gdivsg(${1 code}, ${2 code}) 2 small gen 1 gen gdiv(${1 code}, ${2 code}) 2 gen gen 1 gen 1 gdiv GG 1 gen _<<=_ 1 0 4 ${1 code} <<= ${parens 2 code} 2 *small small 2 small parens ${1 code} = shifti(${1 code}, ${2 code}) 2 *int small 2 int parens ${1 code} = mpshift(${1 code}, ${2 code}) 2 *mp small 2 mp parens ${1 code} = gshift(${1 code}, ${2 code}) 2 *gen small 2 mp parens _<<_ 2 0 3 shifti(${1 code}, ${2 code}) 2 int small 1 int mpshift(${1 code}, ${2 code}) 2 mp small 1 mp gshift(${1 code}, ${2 code}) 2 gen small 1 mp 1 gshift GL 1 gen _<=_ 2 0 12 ${parens 1 code} <= ${parens 2 code} 2 small small 2 bool parens ${parens 1 code} < ${parens 2 code} 2 small lg 2 bool parens ${parens 1 code} <= ${parens 2 code} 2 lg lg 2 bool parens cmpsi(${1 code}, ${2 code}) <= 0 2 small int 2 bool parens cmpis(${1 code}, ${2 code}) < 0 2 int lg 2 bool parens cmpis(${1 code}, ${2 code}) <= 0 2 int small 2 bool parens cmpii(${1 code}, ${2 code}) <= 0 2 int int 2 bool parens mpcmp(${1 code}, ${2 code}) <= 0 2 mp mp 2 bool parens strcmp(${1 code}, ${2 code}) <= 0 2 str str 2 bool parens gcmpsg(${1 code}, ${2 code}) <= 0 2 small gen 2 bool parens gcmpgs(${1 code}, ${2 code}) <= 0 2 gen small 2 bool parens gcmp(${1 code}, ${2 code}) <= 0 2 gen gen 2 bool parens 1 gle GG 1 gen _<_ 2 0 11 ${parens 1 code} < ${parens 2 code} 2 small small 2 bool parens ${parens 1 code} < ${parens 2 code} 2 lg lg 2 bool parens ${parens 1 code} <= ${parens 2 code} 2 lg small 2 bool parens cmpsi(${1 code}, ${2 code}) < 0 2 small int 2 bool parens cmpis(${1 code}, ${2 code}) < 0 2 int small 2 bool parens cmpii(${1 code}, ${2 code}) < 0 2 int int 2 bool parens mpcmp(${1 code}, ${2 code}) < 0 2 mp mp 2 bool parens strcmp(${1 code}, ${2 code}) < 0 2 str str 2 bool parens gcmpsg(${1 code}, ${2 code}) < 0 2 small gen 2 bool parens gcmpgs(${1 code}, ${2 code}) < 0 2 gen small 2 bool parens gcmp(${1 code}, ${2 code}) < 0 2 gen gen 2 bool parens 1 glt GG 1 gen _==_ 2 0 22 ${parens 1 code} == ${parens 2 code} 2 small small 2 bool parens ${parens 1 code} == ${parens 2 code} 2 lg lg 2 bool parens cmpsi(${1 code}, ${2 code}) == 0 2 small int 2 bool parens !signe(${1 code}) 2 mp 0 1 bool is_pm1(${1 code}) && signe(${1 code})==1 2 @int 1 2 bool parens gcmp1(${1 code}) 2 int 1 1 bool is_pm1(${1 code}) && signe(${1 code})==-1 2 @int -1 2 bool parens gcmp_1(${1 code}) 2 int -1 1 bool cmpis(${1 code}, ${2 code}) == 0 2 int small 2 bool parens equalii(${1 code}, ${2 code}) 2 int int 1 bool gcmp0(${1 code}) 2 gen 0 1 bool gcmp1(${1 code}) 2 gen 1 1 bool gcmp_1(${1 code}) 2 gen -1 1 bool cmprr(${1 code}, ${2 code}) == 0 2 real real 1 bool mpcmp(${1 code}, ${2 code}) == 0 2 mp mp 2 bool parens ${parens 1 code} == ${parens 2 code} 2 typ typ 2 bool parens ${parens 1 code} == ${parens 2 :typ cast} 2 typ #str 2 bool parens ${parens 1 :typ cast} == ${parens 2 code} 2 #str typ 2 bool parens strcmp(${1 code}, ${2 code}) 2 str str 1 negbool gequalsg(${1 code}, ${2 code}) 2 small gen 1 bool gequalgs(${1 code}, ${2 code}) 2 gen small 1 bool gequal(${1 code}, ${2 code}) 2 gen gen 1 bool 1 geq GG 1 gen _>=_ 2 0 11 ${parens 1 code} >= ${parens 2 code} 2 small small 2 bool parens ${parens 1 code} >= ${parens 2 code} 2 lg lg 2 bool parens ${parens 1 code} > ${parens 2 code} 2 lg small 2 bool parens cmpsi(${1 code}, ${2 code}) >= 0 2 small int 2 bool parens cmpis(${1 code}, ${2 code}) >= 0 2 int small 2 bool parens cmpii(${1 code}, ${2 code}) >= 0 2 int int 2 bool parens mpcmp(${1 code}, ${2 code}) >= 0 2 mp mp 2 bool parens strcmp(${1 code}, ${2 code}) >= 0 2 str str 2 bool parens gcmpsg(${1 code}, ${2 code}) >= 0 2 small gen 2 bool parens gcmpgs(${1 code}, ${2 code}) >= 0 2 gen small 2 bool parens gcmp(${1 code}, ${2 code}) >= 0 2 gen gen 2 bool parens 1 gge GG 1 gen _>>=_ 1 0 4 ${1 code} >>= ${parens 2 code} 2 *small small 2 small parens ${1 code} = shifti(${1 code}, -${parens 2 code}) 2 *int small 2 int parens ${1 code} = mpshift(${1 code}, -${parens 2 code}) 2 *mp small 2 mp parens ${1 code} = gshift(${1 code}, -${parens 2 code}) 2 *gen small 2 mp parens _>>_ 1 0 4 ${parens 1 code}>>${parens 2 code} 2 small small 2 small parens shifti(${1 code}, -${parens 2 code}) 2 int small 1 int mpshift(${1 code}, -${parens 2 code}) 2 mp small 1 mp gshift(${1 code}, -${parens 2 code}) 2 gen small 1 mp _>_ 2 0 11 ${parens 1 code} > ${parens 2 code} 2 small small 2 bool parens ${parens 1 code} > ${parens 2 code} 2 lg lg 2 bool parens ${parens 1 code} >= ${parens 2 code} 2 small lg 2 bool parens cmpsi(${1 code}, ${2 code}) > 0 2 small int 2 bool parens cmpis(${1 code}, ${2 code}) > 0 2 int small 2 bool parens cmpii(${1 code}, ${2 code}) > 0 2 int int 2 bool parens mpcmp(${1 code}, ${2 code}) > 0 2 mp mp 2 bool parens strcmp(${1 code}, ${2 code}) > 0 2 str str 2 bool parens gcmpsg(${1 code}, ${2 code}) > 0 2 small gen 2 bool parens gcmpgs(${1 code}, ${2 code}) > 0 2 gen small 2 bool parens gcmp(${1 code}, ${2 code}) > 0 2 gen gen 2 bool parens 1 ggt GG 1 gen _[_,] 1 0 3 $"Scalar has no rows" 2 mp small 1 gen rowcopy(${1 code}, ${2 code}) 2 vec small 1 vec rowcopy(${1 code}, ${2 code}) 2 gen small 1 vec _[_,_] 1 0 9 $"Scalar has no components" 2 mp small 1 gen $"Scalar has no components" 3 mp small small 1 gen ${parens 1 code}[${2 code}] 2 vecsmall small 1 small $"Vecsmall are single-dimensional" 3 vecsmall small small 1 gen gel(${1 code}, ${2 :lg cast}) 2 list small 2 gen copy gel(${1 code}, ${2 code}) 2 vec small 2 gen copy gcoeff(${1 code}, ${2 code}, ${3 code}) 3 vec small small 2 gen copy gel(${1 code}, ${2 code}) 2 gen small 2 gen copy gcoeff(${1 code}, ${2 code}, ${3 code}) 3 gen small small 2 gen copy _\/=_ 1 0 3 ${1 code} = gdivround(${1 code}, ${2 code}) 2 *int int 2 int parens ${1 code} = gdivround(${1 code}, ${2 code}) 2 *pol gen 2 gen parens ${1 code} = gdivround(${1 code}, ${2 code}) 2 *gen gen 2 gen parens _\/_ 2 0 2 gdivround(${1 code}, ${2 code}) 2 int int 1 int gdivround(${1 code}, ${2 code}) 2 gen gen 1 gen 1 gdivround GG 1 gen _\=_ 1 0 4 ${1 code} /= ${parens 2 code} 2 *small small 2 small parens ${1 code} = gdivent(${1 code}, ${2 code}) 2 *int int 2 int parens ${1 code} = gdivent(${1 code}, ${2 code}) 2 *pol gen 2 gen parens ${1 code} = gdivent(${1 code}, ${2 code}) 2 *gen gen 2 gen parens _\_ 2 0 7 ${parens 1 code}/${parens 2 code} 2 small small 2 small parens truedivis(${1 code}, ${2 code}) 2 int small 1 int gdiventsg(${1 code}, ${2 code}) 2 small int 1 int truedivii(${1 code}, ${2 code}) 2 int int 1 int gdiventgs(${1 code}, ${2 code}) 2 gen small 1 gen gdiventsg(${1 code}, ${2 code}) 2 small gen 1 gen gdivent(${1 code}, ${2 code}) 2 gen gen 1 gen 1 gdivent GG 1 gen _^_ 2 0 15 sqri(${1 code}) 2 int 2 1 int gpowgs(${1 code}, 3) 2 int 3 1 int gpowgs(${1 code}, 4) 2 int 4 1 int gpowgs(${1 code}, 5) 2 int 5 1 int ginv(${1 code}) 2 real -1 1 real ginv(${1 code}) 2 mp -1 1 mp ginv(${1 code}) 2 gen -1 1 gen gsqr(${1 code}) 2 real 2 1 real gsqr(${1 code}) 2 mp 2 1 mp gsqr(${1 code}) 2 gen 2 1 gen gpowgs(${1 code}, ${2 code}) 2 real small 1 real gpowgs(${1 code}, ${2 code}) 2 gen small 1 gen powgi(${1 code}, ${2 code}) 2 real int 1 real powgi(${1 code}, ${2 code}) 2 gen int 1 gen gpow(${1 code}, ${2 code}, prec) 2 gen gen 2 gen prec 1 gpow GGp 2 gen prec __ 1 0 4 concat(${1 code}, ${2 code}) 2 genstr genstr 1 genstr concat(${1 code}, ${2 code}) 2 genstr gen 1 genstr concat(${1 code}, ${2 code}) 2 gen genstr 1 genstr concat(${1 :genstr cast}, ${2 code}) 2 gen gen 1 genstr _avma 1 0 1 avma 0 1 pari_sp _badtype 1 0 14 typ(${1 code}) != t_INT 1 int 2 bool parens typ(${1 code}) != t_REAL 1 real 2 bool parens is_intreal(${1 code}) 1 mp 1 negbool is_matvec_t(typ(${1 code})) 1 vec 1 negbool typ(${1 code}) != t_VECSMALL 1 vecsmall 2 bool parens typ(${1 code}) != t_POL 1 pol 2 bool parens ${1 code} = checknf(${1 code}) 1 *nf 2 void parens ${1 code} = checkbnf(${1 code}) 1 *bnf 2 void parens checkbnr(${1 code}) 1 bnr 1 void checkprimeid(${1 code}) 1 prid 1 void lg(${1 code}) != 3 || typ(${parens 1 code}[2]) != t_POLMOD 1 @clgp 2 bool parens checkell(${1 code}) 1 ell 1 void checkbell(${1 code}) 1 bell 1 void ${1 code} = checkgal(${1 code}) 1 *gal 2 gal parens _call_GG 1 0 1 ${parens 1 code}(${2 code}, ${3 code}) 3 func_GG gen gen 1 gen _cast 1 0 90 0 1 void 1 bool ${1 value not} 1 #negbool 1 bool !${parens 1 code} 1 negbool 1 bool 1 small_int 1 bool 1 small 1 bool ${parens 1 code}!=1 1 lg 2 bool parens *${parens 1 code} 1 bptr 1 bool !gcmp0(${1 code}) 1 gen 1 bool signe(${1 code}) 1 real 1 bool signe(${1 code}) 1 int 1 bool signe(${1 code}) 1 mp 1 bool signe(${1 code}) 1 pol 1 bool 1 1 void 1 negbool ${1 value not} 1 #bool 1 negbool !${parens 1 code} 1 bool 1 negbool ${parens 1 code}==1 1 lg 2 negbool parens !*${parens 1 code} 1 bptr 1 negbool gcmp0(${1 code}) 1 gen 1 negbool !signe(${1 code}) 1 int 1 negbool !signe(${1 code}) 1 real 1 negbool !signe(${1 code}) 1 mp 1 negbool !signe(${1 code}) 1 pol 1 negbool 1 bool 1 small_int 1 typ 1 small_int 1 small 1 small_int 1 bool 1 small 1 typ 1 small 1 small_int 1 small *${parens 1 code} 1 bptr 1 small itos(${1 code}) 1 int 1 small ${1 value 1 sub} 1 #lg 2 small parens ${parens 1 code}-1 1 lg 2 small parens gen_0 1 void 1 int gen_m1 1 -1 1 int gen_0 1 0 1 int gen_1 1 1 1 int gen_2 1 2 1 int stoi(${1 code}) 1 bool 1 int stoi(${1 code}) 1 small 1 int 1 mp 1 int 1 gen 1 int 1 mp 1 real 1 gen 1 real 1 int 1 mp 1 real 1 mp 1 gen 1 mp ${1 1 value add} 1 #bool 2 lg parens ${parens 1 code}+1 1 bool 2 lg parens ${1 1 value add} 1 #small 2 lg parens ${parens 1 code}+1 1 small 2 lg parens 1 gen 1 vecsmall 1 nf 1 vec 1 bnf 1 vec 1 bnr 1 vec 1 ell 1 vec 1 bell 1 vec 1 clgp 1 vec 1 prid 1 vec 1 gal 1 vec 1 gen 1 vec 1 gen 1 list varn(${1 code}) 1 pol 1 var gvar(${1 code}) 1 gen 1 var pol_x[${1 code}] 1 var 1 pol 1 gen 1 pol 1 int 1 gen 1 mp 1 gen 1 vecsmall 1 gen 1 vec 1 gen 1 list 1 gen 1 pol 1 gen 1 genstr 1 gen GENtoGENstr(${1 code}) 1 gen 1 genstr strtoGENstr(${1 code}) 1 str 1 genstr GSTR(${1 code}) 1 genstr 1 str type_name(${1 code}) 1 typ 1 str ${1 str_format} 1 #str 1 typ gel(${1 code}, 7) 1 bnf 2 nf parens 1 gen 1 nf gel(${1 code}, 1) 1 bnr 2 bnf parens 1 gen 1 bnf 1 gen 1 bnr gmael(${1 code}, 8, 1) 1 bnf 2 clgp parens gel(${1 code}, 5) 1 bnr 2 clgp parens 1 gen 1 clgp 1 bell 1 ell 1 gen 1 ell 1 gen 1 bell 1 gen 1 gal 1 gen 1 prid _cgetg 1 0 2 cgetg(${1 code}, ${2 str_raw}) 2 lg #str 1 gen ${1 code} = cgetg(${2 code}, ${3 str_raw}) 3 gen lg #str 1 gen _const_expr 1 0 1 readseq(${1 code}) 1 str 1 gen _const_quote 1 0 1 fetch_user_var(${1 code}) 1 str 1 var _const_real 1 0 1 strtor(${1 code}, prec) 1 str 2 real prec _const_smallreal 1 0 4 real_0(prec) 1 0 2 real prec real_1(prec) 1 1 2 real prec real_m1(prec) 1 -1 2 real prec stor(${1 code}, prec) 1 small 2 real prec _decl_base 1 0 8 void 1 C!void 0 long 1 C!long 0 int 1 C!int 0 GEN 1 C!GEN 0 char 1 C!char* 0 byteptr 1 C!byteptr 0 pari_sp 1 C!pari_sp 0 GEN 1 C!func_GG 0 _decl_ext 1 0 2 *${1 code} 1 C!char* 0 (*${1 code})(GEN, GEN) 1 C!func_GG 0 _default_check 1 0 2 !${parens 1 code} 1 C!GEN 1 bool ${parens 1 code} == -1 1 var 1 bool _default_marker 1 0 4 NULL 1 C!GEN 0 -1 1 var 0 0 1 small 0 "" 1 str 0 _diffptr 1 0 1 diffptr 0 1 bptr _err_primes 1 0 1 pari_err(primer1) 0 1 void _err_type 1 0 1 pari_err(typeer, ${1 code}) 1 str 1 void _formatcode 1 0 5 ${1 code} 1 #small 1 void %ld 1 small 1 small ${1 str_format} 1 #str 1 void %s 1 str 1 str %Z 1 gen 1 gen _forprime_next 1 0 1 NEXT_PRIME_VIADIFF(${1 code}, ${2 code}) 2 *small *bptr 1 void _forvec_start 1 0 1 forvec_start(${1 code}, ${2 code}, &${3 code}, &${4 code}) 4 gen small &gen &func_GG 1 vec _gerepileall 1 0 2 ${2 code} = gerepilecopy(${1 code}, ${2 code}) 2 pari_sp gen 2 void parens gerepileall(${1 code}, ${nbarg 1 sub}, ${stdref 3 code}) 3 pari_sp gen ... 1 void _gerepileupto 1 0 5 gerepileuptoint(${1 code}, ${2 code}) 2 pari_sp int 1 int gerepileuptoleaf(${1 code}, ${2 code}) 2 pari_sp mp 1 mp gerepileuptoleaf(${1 code}, ${2 code}) 2 pari_sp vecsmall 1 vecsmall gerepileupto(${1 code}, ${2 code}) 2 pari_sp vec 1 vec gerepileupto(${1 code}, ${2 code}) 2 pari_sp gen 1 gen _low_stack_lim 1 0 1 low_stack(${1 code}, stack_lim(${2 code}, 1)) 2 pari_sp pari_sp 1 bool _maxprime 1 0 1 maxprime() 0 1 small _proto_code 1 0 4 n 1 var 0 L 1 C!long 0 G 1 C!GEN 0 s 1 C!char* 0 _proto_ret 1 0 4 v 1 C!void 0 i 1 C!int 0 l 1 C!long 0 1 C!GEN 0 _stack_lim 1 0 1 stack_lim(${1 code}, ${2 code}) 2 pari_sp small 1 pari_sp _toGENstr 1 0 2 strtoGENstr(${1 code}) 1 str 1 genstr GENtoGENstr(${1 code}) 1 gen 1 genstr _tovec 1 0 5 mkvec(${1 code}) 1 gen 1 vec mkvec2(${1 code}, ${2 code}) 2 gen gen 1 vec mkvec3(${1 code}, ${2 code}, ${3 code}) 3 gen gen gen 1 vec mkvec4(${1 code}, ${2 code}, ${3 code}, ${4 code}) 4 gen gen gen gen 1 vec mkvecn(${nbarg}, ${2 code}) 2 gen ... 1 vec _type_preorder 1 0 16 7 empty void bool small int mp gen 0 3 empty real mp 0 3 empty bptr small 0 4 empty bool lg small 0 4 empty bool small_int small 0 4 empty void negbool bool 0 5 empty typ str genstr gen 0 3 empty vecsmall gen 0 3 empty vec gen 0 3 empty list gen 0 5 empty bnr bnf nf vec 0 5 empty bnr bnf clgp vec 0 4 empty bell ell vec 0 3 empty prid vec 0 3 empty gal vec 0 4 empty var pol gen 0 _typedef 1 0 30 void 1 empty 0 void 1 void 0 long 1 negbool 0 long 1 bool 0 int 1 small_int 0 long 1 small 0 GEN 1 int 0 GEN 1 real 0 GEN 1 mp 0 long 1 lg 0 GEN 1 vecsmall 0 GEN 1 vec 0 GEN 1 list 0 long 1 var 0 GEN 1 pol 0 GEN 1 gen 0 GEN 1 genstr 0 char* 1 str 0 byteptr 1 bptr 0 func_GG 1 func_GG 0 pari_sp 1 pari_sp 0 long 1 typ 0 GEN 1 nf 0 GEN 1 bnf 0 GEN 1 bnr 0 GEN 1 ell 0 GEN 1 bell 0 GEN 1 clgp 0 GEN 1 prid 0 GEN 1 gal 0 _||_ 1 0 1 ${parens 1 code} || ${parens 2 code} 2 bool bool 2 bool parens _~ 2 0 2 gtrans(${1 code}) 1 vec 1 vec gtrans(${1 code}) 1 gen 1 gen 1 gtrans G 1 gen abs 2 0 5 labs(${1 code}) 1 small 1 small mpabs(${1 code}) 1 int 1 int mpabs(${1 code}) 1 real 1 real mpabs(${1 code}) 1 mp 1 mp gabs(${1 code}, prec) 1 gen 2 gen prec 1 gabs Gp 2 gen prec acos 1 1 gacos Gp 2 gen prec acosh 1 1 gach Gp 2 gen prec addhelp 1 1 addhelp Ss 1 void addprimes 1 1 addprimes DG 1 gen agm 1 1 agm GGp 2 gen prec algdep 1 1 algdep0 GLD0,L,p 2 gen prec alias 1 1 alias0 rr 1 void allocatemem 1 1 allocatemem0 D0,L, 1 void arg 1 1 garg Gp 2 gen prec asin 1 1 gasin Gp 2 gen prec asinh 1 1 gash Gp 2 gen prec atan 1 1 gatan Gp 2 gen prec atanh 1 1 gath Gp 2 gen prec bernfrac 1 1 bernfrac L 1 gen bernreal 1 1 bernreal Lp 2 gen prec bernvec 1 1 bernvec L 1 gen besselh1 1 1 hbessel1 GGp 2 gen prec besselh2 1 1 hbessel2 GGp 2 gen prec besseli 1 1 ibessel GGp 2 gen prec besselj 1 1 jbessel GGp 2 gen prec besseljh 1 1 jbesselh GGp 2 gen prec besselk 1 1 kbessel0 GGD0,L,p 2 gen prec besseln 1 1 nbessel GGp 2 gen prec bestappr 1 1 bestappr0 GGDG 1 gen bezout 1 1 vecbezout GG 1 gen bezoutres 1 1 vecbezoutres GG 1 gen bigomega 2 0 2 bigomega(${1 code}) 1 int 1 small gbigomega(${1 code}) 1 gen 1 gen 1 gbigomega G 1 gen binary 1 1 binaire G 1 gen binomial 1 1 binomial GL 1 gen bitand 2 0 2 ${parens 1 code}&${parens 2 code} 2 small small 2 small parens gbitand(${1 code}, ${2 code}) 2 gen gen 1 int 1 gbitand GG 1 gen bitneg 1 1 gbitneg GD-1,L, 1 gen bitnegimply 2 0 2 ${parens 1 code}&~${parens 2 code} 2 small small 2 small parens gbitnegimply(${1 code}, ${2 code}) 2 gen gen 1 int 1 gbitnegimply GG 1 gen bitor 2 0 2 ${parens 1 code}|${parens 2 code} 2 small small 2 small parens gbitor(${1 code}, ${2 code}) 2 gen gen 1 int 1 gbitor GG 1 gen bittest 2 0 3 (${parens 1 code}>>${parens 2 code})&1 2 small small 2 bool parens bittest(${1 code}, ${2 code}) 2 int small 1 bool gbittest(${1 code}, ${2 code}) 2 gen gen 1 gen 1 gbittest GG 1 gen bitxor 2 0 2 ${parens 1 code}^${parens 2 code} 2 small small 2 small parens gbitxor(${1 code}, ${2 code}) 2 gen gen 1 int 1 gbitxor GG 1 gen bnfcertify 1 1 certifybuchall G 1 small bnfclassunit 1 1 bnfclassunit0 GD0,L,DGp 2 gen prec bnfclgp 1 1 classgrouponly GDGp 2 gen prec bnfdecodemodule 1 1 decodemodule GG 1 gen bnfinit 2 0 6 bnfinit0(${1 code}, 0, NULL, prec) 1 gen 2 bnf prec bnfinit0(${1 code}, 0, NULL, prec) 2 gen 0 2 bnf prec bnfinit0(${1 code}, 1, NULL, prec) 2 gen 1 2 bnf prec bnfinit0(${1 code}, 2, NULL, prec) 2 gen 2 2 bnf prec bnfinit0(${1 code}, 3, NULL, prec) 2 gen 3 2 bnf prec bnfinit0(${1 code}, ${2 code}, ${3 code}, prec) 3 gen ?small ?gen 2 bnf prec 1 bnfinit0 GD0,L,DGp 2 gen prec bnfisintnorm 1 1 bnfisintnorm GG 1 gen bnfisnorm 1 1 bnfisnorm GGD1,L,p 2 gen prec bnfisprincipal 1 1 isprincipalall GGD1,L, 1 gen bnfissunit 1 1 bnfissunit GGG 1 gen bnfisunit 1 1 isunit GG 1 gen bnfmake 1 1 bnfmake Gp 2 gen prec bnfnarrow 1 1 buchnarrow G 1 gen bnfreg 1 1 regulator GDGp 2 gen prec bnfsignunit 1 1 signunits G 1 gen bnfsunit 1 1 bnfsunit GGp 2 gen prec bnfunit 1 1 buchfu G 1 gen bnrL1 1 1 bnrL1 GDGD0,L,p 2 gen prec bnrclass 1 1 bnrclass0 GGD0,L, 1 gen bnrclassno 1 1 bnrclassno GG 1 gen bnrclassnolist 1 1 bnrclassnolist GG 1 gen bnrconductor 1 1 bnrconductor GDGDGDG 1 gen bnrconductorofchar 1 1 bnrconductorofchar GG 1 gen bnrdisc 1 1 bnrdisc0 GDGDGD0,L, 1 gen bnrdisclist 1 1 bnrdisclist0 GGDG 1 gen bnrinit 2 0 1 bnrinit0(${1 code}, ${2 code}, ${3 code}) 3 gen gen ?small 1 bnr 1 bnrinit0 GGD0,L, 1 gen bnrisconductor 1 1 bnrisconductor GDGDG 1 small bnrisprincipal 1 1 bnrisprincipal GGD1,L, 1 gen bnrrootnumber 1 1 bnrrootnumber GGD0,L,p 2 gen prec bnrstark 1 1 bnrstark GDGp 2 gen prec break 1 1 break0 D1,L, 1 gen ceil 2 0 5 ${1 code} 1 small 2 small parens ${1 code} 1 int 3 int copy parens ceilr(${1 code}) 1 real 1 int mpceil(${1 code}) 1 mp 1 int gceil(${1 code}) 1 gen 1 gen 1 gceil G 1 gen centerlift 2 0 6 centerlift(${1 code}) 1 pol 1 pol centerlift(${1 code}) 1 vec 1 vec centerlift(${1 code}) 1 gen 1 gen centerlift0(${1 code}, ${2 code}) 2 pol var 1 pol centerlift0(${1 code}, ${2 code}) 2 vec var 1 vec centerlift0(${1 code}, ${2 code}) 2 gen var 1 gen 1 centerlift0 GDn 1 gen changevar 1 1 changevar GG 1 gen charpoly 1 1 charpoly0 GDnD0,L, 1 gen chinese 2 0 2 chinese1(${1 code}) 1 gen 1 gen chinese(${1 code}, ${2 code}) 2 gen gen 1 gen 1 chinese GDG 1 gen clone 1 0 8 ${1 code} 1 small 2 small parens gclone(${1 code}) 1 int 1 int gclone(${1 code}) 1 real 1 real gclone(${1 code}) 1 mp 1 mp gclone(${1 code}) 1 vecsmall 1 vecsmall gclone(${1 code}) 1 vec 1 vec gclone(${1 code}) 1 pol 1 pol gclone(${1 code}) 1 gen 1 gen component 1 1 compo GL 1 gen concat 2 0 7 concat(${1 code}, ${2 code}) 2 mp mp 1 vec concat(${1 code}, ${2 code}) 2 vec mp 1 vec concat(${1 code}, ${2 code}) 2 mp vec 1 vec concat(${1 code}, ${2 code}) 2 vec vec 1 vec concat(${1 code}, ${2 code}) 2 genstr gen 1 genstr concat(${1 code}, ${2 code}) 2 gen genstr 1 genstr concat(${1 code}, ${2 code}) 2 gen ?gen 1 gen 1 concat GDG 1 gen conj 1 1 gconj G 1 gen conjvec 1 1 conjvec Gp 2 gen prec content 1 1 content G 1 gen contfrac 1 1 contfrac0 GDGD0,L, 1 gen contfracpnqn 1 1 pnqn G 1 gen copy 1 0 8 ${1 code} 1 small 2 small parens icopy(${1 code}) 1 int 1 int gcopy(${1 code}) 1 real 1 real gcopy(${1 code}) 1 mp 1 mp gcopy(${1 code}) 1 vecsmall 1 vecsmall gcopy(${1 code}) 1 vec 1 vec gcopy(${1 code}) 1 pol 1 pol gcopy(${1 code}) 1 gen 1 gen core 1 1 core0 GD0,L, 1 gen coredisc 1 1 coredisc0 GD0,L, 1 gen cos 1 1 gcos Gp 2 gen prec cosh 1 1 gch Gp 2 gen prec cotan 1 1 gcotan Gp 2 gen prec default 2 0 10 getrealprecision() 1 "realprecision" 2 small prec setrealprecision(${2 code}, &prec) 2 "realprecision" small 2 small prec precdl 1 "seriesprecision" 1 small precdl = ${2 code} 2 "seriesprecision" small 2 small parens DEBUGLEVEL 1 "debug" 1 small DEBUGLEVEL = ${2 code} 2 "debug" small 2 small parens DEBUGMEM 1 "debugmem" 1 small DEBUGMEM = ${2 code} 2 "debugmem" small 2 small parens DEBUGFILES 1 "debugfiles" 1 small DEBUGFILES = ${2 code} 2 "debugfiles" small 2 small parens 1 default0 D"",r,D"",s,D0,L, 1 gen denominator 1 1 denom G 1 gen deriv 1 1 deriv GDn 1 gen dilog 1 1 dilog Gp 2 gen prec dirdiv 1 1 dirdiv GG 1 gen direuler 1 1 direuler0 V=GGEDG 1 gen dirmul 1 1 dirmul GG 1 gen dirzetak 1 1 dirzetak GG 1 gen divisors 2 0 1 divisors(${1 code}) 1 gen 1 vec 1 divisors G 1 gen divrem 1 1 divrem GGDn 1 gen eint1 1 1 veceint1 GDGp 2 gen prec elladd 1 1 addell GGG 1 gen ellak 1 1 akell GG 1 gen ellan 1 1 anell GL 1 gen ellap 1 1 ellap0 GGD0,L, 1 gen ellbil 1 1 bilhell GGGp 2 gen prec ellchangecurve 2 0 1 coordch(${1 code}, ${2 code}) 2 gen gen 1 ell 1 coordch GG 1 gen ellchangepoint 1 1 pointch GG 1 gen ellconvertname 1 1 ellconvertname G 1 gen elleisnum 1 1 elleisnum GLD0,L,p 2 gen prec elleta 1 1 elleta Gp 2 gen prec ellgenerators 1 1 ellgenerators G 1 gen ellglobalred 2 0 1 ellglobalred(${1 code}) 1 gen 1 gen 1 ellglobalred G 1 gen ellheight 1 1 ellheight0 GGD2,L,p 2 gen prec ellheightmatrix 1 1 mathell GGp 2 gen prec ellidentify 1 1 ellidentify G 1 gen ellinit 2 0 3 initell(${1 code}, prec) 2 gen ?0 2 bell prec smallinitell(${1 code}) 2 gen 1 1 ell ellinit0(${1 code}, ${2 code}, prec) 2 gen small 2 ell prec 1 ellinit0 GD0,L,p 2 gen prec ellisoncurve 1 1 ellisoncurve GG 1 gen ellj 1 1 jell Gp 2 gen prec elllocalred 1 1 elllocalred GG 1 gen elllseries 1 1 elllseries GGDGp 2 gen prec ellminimalmodel 1 1 ellminimalmodel GD& 1 gen ellorder 1 1 orderell GG 1 gen ellordinate 1 1 ordell GGp 2 gen prec ellpointtoz 1 1 zell GGp 2 gen prec ellpow 1 1 powell GGG 1 gen ellrootno 1 1 ellrootno GDG 1 small ellsearch 1 1 ellsearch G 1 gen ellsigma 1 1 ellsigma GGD0,L,p 2 gen prec ellsub 1 1 subell GGG 1 gen elltaniyama 1 1 elltaniyama GP 1 gen elltors 1 1 elltors0 GD0,L, 1 gen ellwp 1 1 ellwp0 GDGD0,L,pP 2 gen prec ellzeta 1 1 ellzeta GGp 2 gen prec ellztopoint 1 1 pointell GGp 2 gen prec erfc 1 1 gerfc Gp 2 gen prec error 2 0 1 pari_err(talker, "${2 format_string}"${2 format_args}) 2 ?gen ... 1 void 1 error0 s* 1 void eta 1 1 eta0 GD0,L,p 2 gen prec eulerphi 2 0 2 phi(${1 code}) 1 int 1 int gphi(${1 code}) 1 gen 1 gen 1 gphi G 1 gen eval 1 1 geval G 1 gen exp 2 0 3 mpexp(${1 code}) 1 real 1 real gexp(${1 code}, prec) 1 mp 2 mp prec gexp(${1 code}, prec) 1 gen 2 gen prec 1 gexp Gp 2 gen prec extern 1 1 extern0 s 1 gen factor 2 0 4 Z_factor(${1 code}) 2 int ?-1 1 gen factor(${1 code}) 2 gen ?-1 1 gen smallfact(${1 code}) 2 int 0 1 gen factor0(${1 code}, ${2 code}) 2 gen small 1 gen 1 factor0 GD-1,L, 1 gen factorback 1 1 factorback0 GDGDG 1 gen factorcantor 1 1 factcantor GG 1 gen factorff 1 1 factorff GGG 1 gen factorial 1 1 mpfactr Lp 2 gen prec factorint 1 1 factorint GD0,L, 1 gen factormod 1 1 factormod0 GGD0,L, 1 gen factornf 1 1 polfnf GG 1 gen factorpadic 1 1 factorpadic0 GGLD0,L, 1 gen ffinit 2 0 1 ffinit(${1 code}, ${2 code}, ${3 code}) 3 int small ?var 1 pol 1 ffinit GLDn 1 gen fibonacci 1 1 fibo L 1 gen floor 2 0 5 ${1 code} 1 small 2 small parens ${1 code} 1 int 3 int copy parens floorr(${1 code}) 1 real 1 int mpfloor(${1 code}) 1 mp 1 int gfloor(${1 code}) 1 gen 1 gen 1 gfloor G 1 gen for 1 1 forpari V=GGI 1 void fordiv 1 1 fordiv GVI 1 void forell 1 1 forell VLLI 1 void forprime 1 1 forprime V=GGI 1 void forstep 1 1 forstep V=GGGI 1 void forsubgroup 1 1 forsubgroup V=GDGI 1 void forvec 1 1 forvec V=GID0,L, 1 void frac 1 1 gfrac G 1 gen galoisexport 1 1 galoisexport GD0,L, 1 gen galoisfixedfield 2 0 1 galoisfixedfield(${1 code}, ${2 code}, ${3 code}, ${4 code}) 4 gen gen ?small ?var 1 vec 1 galoisfixedfield GGD0,L,Dn 1 gen galoisidentify 1 1 galoisidentify G 1 gen galoisinit 2 0 1 galoisinit(${1 code}, ${2 code}) 2 gen ?int 1 gal 1 galoisinit GDG 1 gen galoisisabelian 1 1 galoisisabelian GD0,L, 1 gen galoispermtopol 1 1 galoispermtopol GG 1 gen galoissubcyclo 1 1 galoissubcyclo GDGD0,L,Dn 1 gen galoissubfields 1 1 galoissubfields GD0,L,Dn 1 gen galoissubgroups 1 1 galoissubgroups G 1 gen gamma 1 1 ggamma Gp 2 gen prec gammah 1 1 ggamd Gp 2 gen prec gcd 2 0 6 cgcd(${1 code}, ${2 code}) 3 small small ?0 1 small gcdii(${1 code}, ${2 code}) 3 int int ?0 1 int ggcd(${1 code}, ${2 code}) 3 gen gen ?0 1 gen modulargcd(${1 code}, ${2 code}) 3 gen gen 1 1 gen srgcd(${1 code}, ${2 code}) 3 gen gen 2 1 gen gcd0(${1 code}, ${2 code}, ${3 code}) 3 gen ?gen ?small 1 gen 1 gcd0 GDGD0,L, 1 gen getheap 1 1 getheap 1 gen getrand 1 1 getrand 1 small getstack 1 1 getstack 1 small gettime 1 1 gettime 1 small global 0 hilbert 1 1 hil0 GGDG 1 small hyperu 1 1 hyperu GGGp 2 gen prec idealadd 1 1 idealadd GGG 1 gen idealaddtoone 1 1 idealaddtoone0 GGDG 1 gen idealappr 1 1 idealappr0 GGD0,L, 1 gen idealchinese 1 1 idealchinese GGG 1 gen idealcoprime 1 1 idealcoprime GGG 1 gen idealdiv 2 0 4 idealdiv(${1 code}, ${2 code}, ${3 code}) 4 gen gen gen ?0 1 gen idealdivexact(${1 code}, ${2 code}, ${3 code}) 4 gen gen gen 1 1 gen $"invalid flag in idealdiv" 4 gen gen gen #small 1 gen idealdiv0(${1 code}, ${2 code}, ${3 code}, ${4 code}) 4 gen gen gen small 1 gen 1 idealdiv0 GGGD0,L, 1 gen idealfactor 1 1 idealfactor GG 1 gen idealhnf 1 1 idealhnf0 GGDG 1 gen idealintersect 1 1 idealintersect GGG 1 gen idealinv 2 0 1 idealinv(${1 code}, ${2 code}) 2 gen gen 1 gen 1 idealinv GG 1 gen ideallist 1 1 ideallist0 GLD4,L, 1 gen ideallistarch 1 1 ideallistarch GGG 1 gen ideallog 1 1 zideallog GGG 1 gen idealmin 1 1 minideal GGDGp 2 gen prec idealmul 2 0 4 idealmul(${1 code}, ${2 code}, ${3 code}) 4 gen gen gen ?0 1 gen idealmulred(${1 code}, ${2 code}, ${3 code}, prec) 4 gen gen gen 1 2 gen prec $"invalid flag in idealmul" 4 gen gen gen #small 1 gen idealmul0(${1 code}, ${2 code}, ${3 code}, ${4 code}, prec) 4 gen gen gen small 2 gen prec 1 idealmul0 GGGD0,L,p 2 gen prec idealnorm 1 1 idealnorm GG 1 gen idealpow 1 1 idealpow0 GGGD0,L,p 2 gen prec idealprimedec 1 1 primedec GG 1 gen idealprincipal 1 1 principalideal GG 1 gen idealred 1 1 ideallllred GGDGp 2 gen prec idealstar 1 1 idealstar0 GGD1,L, 1 gen idealtwoelt 1 1 ideal_two_elt0 GGDG 1 gen idealval 1 1 idealval GGG 1 small ideleprincipal 1 1 principalidele GGp 2 gen prec if 0 imag 1 1 gimag G 1 gen incgam 1 1 incgam0 GGDGp 2 gen prec incgamc 1 1 incgamc GGp 2 gen prec input 1 1 input0 1 gen install 1 1 gpinstall rrD"",r,D"",s, 1 void intcirc 1 1 intcirc0 V=GGEDGp 2 gen prec intformal 1 1 integ GDn 1 gen intfouriercos 1 1 intfourcos0 V=GGGEDGp 2 gen prec intfourierexp 1 1 intfourexp0 V=GGGEDGp 2 gen prec intfouriersin 1 1 intfoursin0 V=GGGEDGp 2 gen prec intfuncinit 1 1 intfuncinit0 V=GGED0,L,D0,L,p 2 gen prec intlaplaceinv 1 1 intlaplaceinv0 V=GGEDGp 2 gen prec intmellininv 1 1 intmellininv0 V=GGEDGp 2 gen prec intmellininvshort 1 1 intmellininvshort GGGp 2 gen prec intnum 1 1 intnum0 V=GGEDGp 2 gen prec intnuminit 1 1 intnuminit GGD0,L,p 2 gen prec intnuminitgen 1 1 intnuminitgen0 VGGED0,L,D0,L,p 2 gen prec intnumromb 1 1 intnumromb0 V=GGED0,L,p 2 gen prec intnumstep 1 1 intnumstep p 2 small prec isfundamental 2 0 2 isfundamental(${1 code}) 1 int 1 bool gisfundamental(${1 code}) 1 gen 1 gen 1 gisfundamental G 1 gen ispower 2 0 2 isanypower(${1 code}, NULL) 1 int 1 small isanypower(${1 code}, &${2 code}) 2 int &int 1 small 1 ispower GDGD& 1 small isprime 2 0 4 isprime(${1 code}) 2 int ?0 1 bool plisprime(${1 code}, 0) 2 int 1 1 bool plisprime(${1 code}, 1) 2 int 2 1 gen gisprime(${1 code}, ${2 code}) 2 gen ?small 1 gen 1 gisprime GD0,L, 1 gen ispseudoprime 2 0 2 ispsp(${1 code}) 1 int 1 bool gispsp(${1 code}) 1 gen 1 gen 1 gispseudoprime GD0,L, 1 gen issquare 2 0 5 Z_issquare(${1 code}) 1 int 1 bool gissquare(${1 code}) 1 mp 1 int gissquare(${1 code}) 1 gen 1 gen Z_issquarerem(${1 code}, &${2 code}) 2 int &int 1 bool gissquarerem(${1 code}, &${2 code}) 2 gen &gen 1 gen 1 gissquarerem GD& 1 gen issquarefree 2 0 2 issquarefree(${1 code}) 1 int 1 bool gissquarefree(${1 code}) 1 gen 1 gen 1 gissquarefree G 1 gen kill 1 1 kill0 S 1 void kronecker 2 0 6 kross(${1 code}, ${2 code}) 2 small small 1 small krois(${1 code}, ${2 code}) 2 int small 1 small krosi(${1 code}, ${2 code}) 2 small int 1 small kronecker(${1 code}, ${2 code}) 2 int int 1 small gkrogs(${1 code}, ${2 code}) 2 gen small 1 gen gkronecker(${1 code}, ${2 code}) 2 gen gen 1 gen 1 gkronecker GG 1 gen lcm 2 0 3 lcmii(${1 code}, ${2 code}) 2 int int 1 int glcm0(${1 code}, NULL) 1 gen 1 gen glcm(${1 code}, ${2 code}) 2 gen gen 1 gen 1 glcm0 GDG 1 gen length 2 0 4 lg(${1 code}) 1 vecsmall 1 lg lg(${1 code}) 1 vec 1 lg lgpol(${1 code}) 1 pol 1 small glength(${1 code}) 1 gen 1 small 1 glength G 1 small lex 1 1 lexcmp GG 1 small_int lift 2 0 6 lift(${1 code}) 1 pol 1 pol lift(${1 code}) 1 vec 1 vec lift(${1 code}) 1 gen 1 gen lift0(${1 code}, ${2 code}) 2 pol var 1 pol lift0(${1 code}, ${2 code}) 2 vec var 1 vec lift0(${1 code}, ${2 code}) 2 gen var 1 gen 1 lift0 GDn 1 gen lindep 1 1 lindep0 GD0,L,p 2 gen prec listcreate 2 0 1 listcreate(${1 code}) 1 small 1 list 1 listcreate L 1 gen listinsert 2 0 1 listinsert(${1 code}, ${2 code}, ${3 code}) 3 list gen small 1 gen 1 listinsert GGL 1 gen listkill 1 1 listkill G 1 void listput 2 0 1 listput(${1 code}, ${2 code}, ${3 code}) 3 list gen small 1 gen 1 listput GGD0,L, 1 gen listsort 1 1 listsort GD0,L, 1 gen lngamma 1 1 glngamma Gp 2 gen prec log 2 0 1 glog(${1 code}, prec) 1 gen 2 gen prec 1 glog Gp 2 gen prec matadjoint 1 1 adj G 1 gen matalgtobasis 1 1 matalgtobasis GG 1 gen matbasistoalg 1 1 matbasistoalg GG 1 gen matcompanion 1 1 assmat G 1 gen matdet 2 0 4 det(${1 code}) 2 gen ?0 1 gen det2(${1 code}) 2 gen 1 1 gen $"incorrect flag in matdet" 2 gen #small 1 gen det0(${1 code}, ${2 code}) 2 gen small 1 gen 1 det0 GD0,L, 1 gen matdetint 1 1 detint G 1 gen matdiagonal 1 1 diagonal G 1 gen mateigen 1 1 eigen Gp 2 gen prec matfrobenius 1 1 matfrobenius GD0,L,Dn 1 gen mathess 1 1 hess G 1 gen mathilbert 1 1 mathilbert L 1 gen mathnf 1 1 mathnf0 GD0,L, 1 gen mathnfmod 1 1 hnfmod GG 1 gen mathnfmodid 1 1 hnfmodid GG 1 gen matid 2 0 1 matid(${1 code}) 1 small 1 vec 1 matid L 1 gen matimage 1 1 matimage0 GD0,L, 1 gen matimagecompl 1 1 imagecompl G 1 gen matindexrank 1 1 indexrank G 1 gen matintersect 1 1 intersect GG 1 gen matinverseimage 1 1 inverseimage GG 1 gen matisdiagonal 1 1 isdiagonal G 1 small matker 1 1 matker0 GD0,L, 1 gen matkerint 1 1 matkerint0 GD0,L, 1 gen matmuldiagonal 1 1 matmuldiagonal GG 1 gen matmultodiagonal 1 1 matmultodiagonal GG 1 gen matpascal 1 1 matqpascal LDG 1 gen matrank 1 1 rank G 1 small matrix 1 1 matrice GGDVDVDI 1 gen matrixqz 1 1 matrixqz0 GG 1 gen matsize 1 1 matsize G 1 gen matsnf 1 1 matsnf0 GD0,L, 1 gen matsolve 1 1 gauss GG 1 gen matsolvemod 1 1 matsolvemod0 GGGD0,L, 1 gen matsupplement 1 1 suppl G 1 gen mattranspose 1 1 gtrans G 1 gen max 2 0 10 maxss(${1 code}, ${2 code}) 2 small small 1 small gmaxsg(${1 code}, ${2 code}) 2 small int 1 int gmaxgs(${1 code}, ${2 code}) 2 int small 1 int gmax(${1 code}, ${2 code}) 2 int int 1 int gmaxsg(${1 code}, ${2 code}) 2 small mp 1 mp gmaxgs(${1 code}, ${2 code}) 2 mp small 1 mp gmax(${1 code}, ${2 code}) 2 mp mp 1 mp gmaxsg(${1 code}, ${2 code}) 2 small gen 1 gen gmaxgs(${1 code}, ${2 code}) 2 gen small 1 gen gmax(${1 code}, ${2 code}) 2 gen gen 1 gen 1 gmax GG 1 gen min 2 0 10 minss(${1 code}, ${2 code}) 2 small small 1 small gminsg(${1 code}, ${2 code}) 2 small int 1 int gmings(${1 code}, ${2 code}) 2 int small 1 int gmin(${1 code}, ${2 code}) 2 int int 1 int gminsg(${1 code}, ${2 code}) 2 small mp 1 mp gmings(${1 code}, ${2 code}) 2 mp small 1 mp gmin(${1 code}, ${2 code}) 2 mp mp 1 mp gminsg(${1 code}, ${2 code}) 2 small gen 1 gen gmings(${1 code}, ${2 code}) 2 gen small 1 gen gmin(${1 code}, ${2 code}) 2 gen gen 1 gen 1 gmin GG 1 gen minpoly 1 1 minpoly GDn 1 gen modreverse 1 1 polymodrecip G 1 gen moebius 2 0 2 mu(${1 code}) 1 int 1 small gmu(${1 code}) 1 gen 1 gen 1 gmu G 1 gen newtonpoly 1 1 newtonpoly GG 1 gen next 1 1 next0 D1,L, 1 gen nextprime 2 0 2 nextprime(${1 code}) 1 int 1 int gnextprime(${1 code}) 1 gen 1 gen 1 gnextprime G 1 gen nfalgtobasis 1 1 algtobasis GG 1 gen nfbasis 1 1 nfbasis0 GD0,L,DG 1 gen nfbasistoalg 1 1 basistoalg GG 1 gen nfdetint 1 1 nfdetint GG 1 gen nfdisc 1 1 nfdiscf0 GD0,L,DG 1 gen nfeltdiv 1 1 element_div GGG 1 gen nfeltdiveuc 1 1 nfdiveuc GGG 1 gen nfeltdivmodpr 1 1 element_divmodpr GGGG 1 gen nfeltdivrem 1 1 nfdivrem GGG 1 gen nfeltmod 1 1 nfmod GGG 1 gen nfeltmul 1 1 element_mul GGG 1 gen nfeltmulmodpr 1 1 element_mulmodpr GGGG 1 gen nfeltpow 1 1 element_pow GGG 1 gen nfeltpowmodpr 1 1 element_powmodpr GGGG 1 gen nfeltreduce 1 1 element_reduce GGG 1 gen nfeltreducemodpr 1 1 nfreducemodpr GGG 1 gen nfeltval 1 1 element_val GGG 1 small nffactor 1 1 nffactor GG 1 gen nffactormod 1 1 nffactormod GGG 1 gen nfgaloisapply 1 1 galoisapply GGG 1 gen nfgaloisconj 1 1 galoisconj0 GD0,L,DGp 2 gen prec nfhilbert 1 1 nfhilbert0 GGGDG 1 small nfhnf 1 1 nfhermite GG 1 gen nfhnfmod 1 1 nfhermitemod GGG 1 gen nfinit 2 0 9 nfinit0(${1 code}, 0, prec) 2 gen ?0 2 nf prec nfinit0(${1 code}, 1, prec) 2 gen 1 2 nf prec nfinit0(${1 code}, 2, prec) 2 gen 2 2 nf prec nfinit0(${1 code}, 3, prec) 2 gen 3 2 gen prec nfinit0(${1 code}, 4, prec) 2 gen 4 2 nf prec nfinit0(${1 code}, 5, prec) 2 gen 5 2 gen prec nfinit0(${1 code}, 6, prec) 2 gen 6 2 nf prec $"incorrect flag in nfinit" 2 gen #small 1 void nfinit0(${1 code}, ${2 code}, prec) 2 gen small 2 gen prec 1 nfinit0 GD0,L,p 2 gen prec nfisideal 1 1 isideal GG 1 small nfisincl 1 1 nfisincl GG 1 gen nfisisom 1 1 nfisisom GG 1 gen nfkermodpr 1 1 nfkermodpr GGG 1 gen nfmodprinit 1 1 nfmodprinit GG 1 gen nfnewprec 1 1 nfnewprec Gp 2 gen prec nfroots 1 1 nfroots DGG 1 gen nfrootsof1 1 1 rootsof1 G 1 gen nfsnf 1 1 nfsmith GG 1 gen nfsolvemodpr 1 1 nfsolvemodpr GGGG 1 gen nfsubfields 1 1 subfields0 GDG 1 gen norm 1 1 gnorm G 1 gen norml2 1 1 gnorml2 G 1 gen numbpart 1 1 numbpart G 1 gen numdiv 2 0 2 numbdiv(${1 code}) 1 int 1 int gnumbdiv(${1 code}) 1 gen 1 gen 1 gnumbdiv G 1 gen numerator 1 1 numer G 1 gen numtoperm 1 1 numtoperm LG 1 gen omega 2 0 2 omega(${1 code}) 1 int 1 small gomega(${1 code}) 1 gen 1 gen 1 gomega G 1 gen padicappr 1 1 padicappr GG 1 gen padicprec 1 1 padicprec GG 1 small permtonum 1 1 permtonum G 1 gen plot 1 1 plot V=GGIDGDGp 2 void prec plotbox 1 1 rectbox LGG 1 void plotclip 1 1 rectclip L 1 void plotcolor 1 1 rectcolor LL 1 void plotcopy 1 1 rectcopy_gen LLGGD0,L, 1 void plotcursor 1 1 rectcursor L 1 gen plotdraw 1 1 rectdraw_flag GD0,L, 1 void ploth 1 1 ploth V=GGIpD0,M,D0,L,\nParametric|1; Recursive|2; no_Rescale|4; no_X_axis|8; no_Y_axis|16; no_Frame|32; no_Lines|64; Points_too|128; Splines|256; no_X_ticks|512; no_Y_ticks|1024; Same_ticks|2048 2 gen prec plothraw 1 1 plothraw GGD0,L, 1 gen plothsizes 1 1 plothsizes_flag D0,L, 1 gen plotinit 1 1 initrect_gen LD0,G,D0,G,D0,L, 1 void plotkill 1 1 killrect L 1 void plotlines 1 1 rectlines LGGD0,L, 1 void plotlinetype 1 1 rectlinetype LL 1 void plotmove 1 1 rectmove LGG 1 void plotpoints 1 1 rectpoints LGG 1 void plotpointsize 1 1 rectpointsize LG 1 void plotpointtype 1 1 rectpointtype LL 1 void plotrbox 1 1 rectrbox LGG 1 void plotrecth 1 1 rectploth LV=GGIpD0,L,D0,L, 2 gen prec plotrecthraw 1 1 rectplothraw LGD0,L, 1 gen plotrline 1 1 rectrline LGG 1 void plotrmove 1 1 rectrmove LGG 1 void plotrpoint 1 1 rectrpoint LGG 1 void plotscale 1 1 rectscale LGGGG 1 void plotstring 1 1 rectstring3 LsD0,L, 1 void polcoeff 2 0 2 constant_term(${1 code}) 2 pol 0 2 gen copy polcoeff0(${1 code}, ${2 code}, ${3 code}) 3 gen small ?var 1 gen 1 polcoeff0 GLDn 1 gen polcompositum 1 1 polcompositum0 GGD0,L, 1 gen polcyclo 1 1 cyclo LDn 1 gen poldegree 2 0 3 degpol(${1 code}) 1 pol 1 small degree(${1 code}) 1 gen 1 small poldegree(${1 code}, ${2 code}) 2 gen var 1 small 1 poldegree GDn 1 small poldisc 2 0 3 discsr(${1 code}) 1 pol 1 gen poldisc0(${1 code}, -1) 1 gen 1 gen poldisc0(${1 code}, ${2 code}) 2 gen var 1 gen 1 poldisc0 GDn 1 gen poldiscreduced 1 1 reduceddiscsmith G 1 gen polgalois 1 1 polgalois Gp 2 gen prec polhensellift 1 1 polhensellift GGGL 1 gen polinterpolate 1 1 polint GDGDGD& 1 gen polisirreducible 1 1 gisirreducible G 1 gen pollead 2 0 3 leading_term(${1 code}) 1 pol 2 gen copy pollead(${1 code}, -1) 1 gen 1 gen pollead(${1 code}, ${2 code}) 2 gen var 1 gen 1 pollead GDn 1 gen pollegendre 1 1 legendre LDn 1 gen polrecip 1 1 polrecip G 1 gen polred 1 1 polred0 GD0,L,DG 1 gen polredabs 1 1 polredabs0 GD0,L, 1 gen polredord 1 1 ordred G 1 gen polresultant 1 1 polresultant0 GGDnD0,L, 1 gen polroots 1 1 roots0 GD0,L,p 2 gen prec polrootsmod 2 0 4 rootmod(${1 code}, ${2 code}) 3 pol int ?0 1 vec rootmod2(${1 code}, ${2 code}) 3 pol int 1 1 vec $"Bad flag in polrootsmod" 3 pol int #small 1 vec rootmod0(${1 code}, ${2 code}, ${3 code}) 3 pol int small 1 vec 1 rootmod0 GGD0,L, 1 gen polrootspadic 1 1 rootpadic GGL 1 gen polsturm 1 1 sturmpart GDGDG 1 small polsubcyclo 1 1 polsubcyclo LLDn 1 gen polsylvestermatrix 1 1 sylvestermatrix GG 1 gen polsym 1 1 polsym GL 1 gen poltchebi 1 1 tchebi LDn 1 gen poltschirnhaus 1 1 tschirnhaus G 1 gen polylog 1 1 polylog0 LGD0,L,p 2 gen prec polzagier 1 1 polzag LL 1 gen precision 1 1 precision0 GD0,L, 1 gen precprime 2 0 2 precprime(${1 code}) 1 int 1 int gprecprime(${1 code}) 1 gen 1 gen 1 gprecprime G 1 gen prime 1 1 prime L 1 gen primepi 2 0 1 primepi(${1 code}) 1 gen 1 int 1 primepi G 1 gen primes 1 1 primes L 1 gen print 2 0 1 pariprintf("${2 format_string}\n"${2 format_args}) 2 ?gen ... 1 void 1 print s* 1 void print1 2 0 1 pariprintf("${2 format_string}"${2 format_args}) 2 ?gen ... 1 void 1 print1 s* 1 void printp 1 1 printp s* 1 void printp1 1 1 printp1 s* 1 void printtex 1 1 printtex s* 1 void prod 1 1 produit V=GGEDG 1 gen prodeuler 1 1 prodeuler0 V=GGEp 2 gen prec prodinf 1 1 prodinf0 V=GED0,L,p 2 gen prec psdraw 1 1 postdraw_flag GD0,L, 1 void psi 1 1 gpsi Gp 2 gen prec psploth 1 1 postploth V=GGIpD0,L,D0,L, 2 gen prec psplothraw 1 1 postplothraw GGD0,L, 1 gen qfbclassno 1 1 qfbclassno0 GD0,L, 1 gen qfbcompraw 1 1 compraw GG 1 gen qfbhclassno 1 1 hclassno G 1 gen qfbnucomp 1 1 nucomp GGG 1 gen qfbnupow 1 1 nupow GG 1 gen qfbpowraw 1 1 powraw GL 1 gen qfbprimeform 1 1 primeform GGp 2 gen prec qfbred 1 1 qfbred0 GD0,L,DGDGDG 1 gen qfbsolve 1 1 qfbsolve GG 1 gen qfgaussred 1 1 sqred G 1 gen qfjacobi 1 1 jacobi Gp 2 gen prec qflll 2 0 8 lll(${1 code}, prec) 2 vec ?0 2 vec prec lllint(${1 code}) 2 vec 1 1 vec lllintpartial(${1 code}) 2 vec 2 1 vec lllkerim(${1 code}) 2 vec 4 1 vec lllkerimgen(${1 code}) 2 vec 5 1 vec lllgen(${1 code}) 2 vec 8 1 vec $"Bad flag in qflll" 2 vec #small 1 vec qflll0(${1 code}, ${2 code}, prec) 2 vec small 2 vec prec 1 qflll0 GD0,L,p 2 gen prec qflllgram 1 1 qflllgram0 GD0,L,p 2 gen prec qfminim 1 1 qfminim0 GDGDGD0,L,p 2 gen prec qfperfection 1 1 perf G 1 gen qfrep 1 1 qfrep0 GGD0,L, 1 gen qfsign 1 1 signat G 1 gen quadclassunit 1 1 quadclassunit0 GD0,L,DGp 2 gen prec quaddisc 1 1 quaddisc G 1 gen quadgen 1 1 quadgen G 1 gen quadhilbert 1 1 quadhilbert GDGp 2 gen prec quadpoly 1 1 quadpoly0 GDn 1 gen quadray 1 1 quadray GGDGp 2 gen prec quadregulator 2 0 2 regula(${1 code}, prec) 1 int 2 mp prec gregula(${1 code}, prec) 1 gen 2 gen prec 1 gregula Gp 2 gen prec quadunit 2 0 2 fundunit(${1 code}) 1 int 1 gen gfundunit(${1 code}) 1 gen 1 gen 1 gfundunit Gp 2 gen prec quit 1 1 gp_quit 1 void random 2 0 2 genrand(${1 code}) 1 ?int 1 int $"incorrect type `real' in random" 1 real 1 void 1 genrand DG 1 gen read 2 0 1 gp_read_file(${1 code}) 1 str 1 gen 1 read0 D"",s, 1 gen readvec 2 0 1 gp_readvec_file(${1 code}) 1 str 1 gen 1 gp_readvec_file D"",s, 1 gen real 1 1 greal G 1 gen removeprimes 1 1 removeprimes DG 1 gen reorder 1 1 reorder DG 1 gen return 1 1 return0 DG 1 gen rnfalgtobasis 1 1 rnfalgtobasis GG 1 gen rnfbasis 1 1 rnfbasis GG 1 gen rnfbasistoalg 1 1 rnfbasistoalg GG 1 gen rnfcharpoly 1 1 rnfcharpoly GGGDn 1 gen rnfconductor 1 1 rnfconductor GGD0,L, 1 gen rnfdedekind 1 1 rnfdedekind GGG 1 gen rnfdet 1 1 rnfdet GG 1 gen rnfdisc 1 1 rnfdiscf GG 1 gen rnfeltabstorel 1 1 rnfelementabstorel GG 1 gen rnfeltdown 1 1 rnfelementdown GG 1 gen rnfeltreltoabs 1 1 rnfelementreltoabs GG 1 gen rnfeltup 1 1 rnfelementup GG 1 gen rnfequation 1 1 rnfequation0 GGD0,L, 1 gen rnfhnfbasis 1 1 rnfhnfbasis GG 1 gen rnfidealabstorel 1 1 rnfidealabstorel GG 1 gen rnfidealdown 1 1 rnfidealdown GG 1 gen rnfidealhnf 1 1 rnfidealhermite GG 1 gen rnfidealmul 1 1 rnfidealmul GGG 1 gen rnfidealnormabs 1 1 rnfidealnormabs GG 1 gen rnfidealnormrel 1 1 rnfidealnormrel GG 1 gen rnfidealreltoabs 1 1 rnfidealreltoabs GG 1 gen rnfidealtwoelt 1 1 rnfidealtwoelement GG 1 gen rnfidealup 1 1 rnfidealup GG 1 gen rnfinit 1 1 rnfinitalg GGp 2 gen prec rnfisfree 1 1 rnfisfree GG 1 small rnfisnorm 1 1 rnfisnorm GGD0,L, 1 gen rnfisnorminit 1 1 rnfisnorminit GGD2,L, 1 gen rnfkummer 1 1 rnfkummer GDGD0,L,p 2 gen prec rnflllgram 1 1 rnflllgram GGGp 2 gen prec rnfnormgroup 1 1 rnfnormgroup GG 1 gen rnfpolred 1 1 rnfpolred GGp 2 gen prec rnfpolredabs 1 1 rnfpolredabs GGD0,L, 1 gen rnfpseudobasis 1 1 rnfpseudobasis GG 1 gen rnfsteinitz 1 1 rnfsteinitz GG 1 gen round 2 0 9 ${1 code} 1 small 2 small parens ${1 code} 1 int 3 int copy parens roundr(${1 code}) 1 real 1 int mpround(${1 code}) 1 mp 1 int grndtoi(${1 code}, &${2 code}) 2 mp &small 1 int round0(${1 code}, &${2 code}) 2 mp &int 1 int ground(${1 code}) 1 gen 1 gen grndtoi(${1 code}, &${2 code}) 2 gen &small 1 gen round0(${1 code}, &${2 code}) 2 gen &int 1 gen 1 round0 GD& 1 gen serconvol 1 1 convol GG 1 gen serlaplace 1 1 laplace G 1 gen serreverse 1 1 recip G 1 gen setintersect 2 0 1 setintersect(${1 code}, ${2 code}) 2 vec vec 1 vec 1 setintersect GG 1 gen setisset 1 1 setisset G 1 small setminus 2 0 1 setminus(${1 code}, ${2 code}) 2 vec vec 1 vec 1 setminus GG 1 gen setrand 1 1 setrand L 1 small setsearch 1 1 setsearch GGD0,L, 1 small setunion 2 0 1 setunion(${1 code}, ${2 code}) 2 vec vec 1 vec 1 setunion GG 1 gen shift 1 1 gshift GL 1 gen shiftmul 1 1 gmul2n GL 1 gen sigma 2 0 6 sumdiv(${1 code}) 2 int ?1 1 int numbdiv(${1 code}) 2 int 0 1 int gsumdiv(${1 code}) 2 gen ?1 1 gen gnumbdiv(${1 code}) 2 gen 0 1 gen sumdivk(${1 code}, ${2 code}) 2 int small 1 int gsumdivk(${1 code}, ${2 code}) 2 gen small 1 gen 1 gsumdivk GD1,L, 1 gen sign 2 0 2 signe(${1 code}) 1 mp 1 small gsigne(${1 code}) 1 gen 1 small 1 gsigne G 1 small_int simplify 1 1 simplify G 1 gen sin 1 1 gsin Gp 2 gen prec sinh 1 1 gsh Gp 2 gen prec sizebyte 1 1 taille2 G 1 small sizedigit 1 1 sizedigit G 1 small solve 1 1 zbrent0 V=GGEp 2 gen prec sqr 2 0 3 sqri(${1 code}) 1 int 1 int gsqr(${1 code}) 1 mp 1 mp gsqr(${1 code}) 1 gen 1 gen 1 gsqr G 1 gen sqrt 2 0 2 sqrtr(${1 code}) 1 real 1 gen gsqrt(${1 code}, prec) 1 gen 2 gen prec 1 gsqrt Gp 2 gen prec sqrtint 2 0 1 racine(${1 code}) 1 gen 1 int 1 racine G 1 gen sqrtn 1 1 gsqrtn GGD&p 2 gen prec subgrouplist 1 1 subgrouplist0 GDGD0,L, 1 gen subst 1 1 gsubst GnG 1 gen substpol 1 1 gsubstpol GGG 1 gen substvec 1 1 gsubstvec GGG 1 gen sum 1 1 somme V=GGEDG 1 gen sumalt 1 1 sumalt0 V=GED0,L,p 2 gen prec sumdiv 1 1 divsum GVE 1 gen suminf 1 1 suminf0 V=GEp 2 gen prec sumnum 1 1 sumnum0 V=GGEDGD0,L,p 2 gen prec sumnumalt 1 1 sumnumalt0 V=GGEDGD0,L,p 2 gen prec sumnuminit 1 1 sumnuminit GD0,L,D1,L,p 2 gen prec sumpos 1 1 sumpos0 V=GED0,L,p 2 gen prec system 1 1 system0 s 1 void tan 1 1 gtan Gp 2 gen prec tanh 1 1 gth Gp 2 gen prec taylor 1 1 tayl GnP 1 gen teichmuller 1 1 teich G 1 gen theta 1 1 theta GGp 2 gen prec thetanullk 1 1 thetanullk GLp 2 gen prec thue 1 1 thue GGDG 1 gen thueinit 1 1 thueinit GD0,L,p 2 gen prec trace 1 1 gtrace G 1 gen trap 1 1 trap0 D"",r,DIDI 1 gen truncate 2 0 9 ${1 code} 1 small 2 small parens ${1 code} 1 int 3 int copy parens truncr(${1 code}) 1 real 1 int mptrunc(${1 code}) 1 mp 1 int gcvtoi(${1 code}, &${2 code}) 2 mp &small 1 int trunc0(${1 code}, &${2 code}) 2 mp &int 1 int gtrunc(${1 code}) 1 gen 1 gen gcvtoi(${1 code}, &${2 code}) 2 gen &small 1 gen trunc0(${1 code}, &${2 code}) 2 gen &int 1 gen 1 trunc0 GD& 1 gen type 2 0 1 typ(${1 code}) 1 gen 1 typ 1 type0 G 1 gen unclone 1 0 2 (void)0 /*unclone*/ 1 small 1 void gunclone(${1 code}) 1 gen 1 void until 0 valuation 1 1 ggval GG 1 small variable 2 0 2 ${1 :var cast} 1 pol 3 var parens copy gpolvar(${1 code}) 1 gen 1 gen 1 gpolvar G 1 gen vecextract 1 1 extract0 GGDG 1 gen vecmax 1 1 vecmax G 1 gen vecmin 1 1 vecmin G 1 gen vecsort 2 0 7 sort(${1 code}) 1 vec 1 vec vecsort0(${1 code}, ${2 code}, 0) 2 vec gen 1 vec sort(${1 code}) 3 vec 0 1 vec indexsort(${1 code}) 3 vec 1 1 vec lexsort(${1 code}) 3 vec 2 1 vec vecsort0(${1 code}, NULL, ${3 code}) 3 vec small 1 vec vecsort0(${1 code}, ${2 code}, ${3 code}) 3 vec gen small 1 vec 1 vecsort0 GDGD0,L, 1 gen vector 1 1 vecteur GDVDI 1 gen vectorsmall 1 1 vecteursmall GDVDI 1 gen vectorv 1 1 vvecteur GDVDI 1 gen version 1 1 pari_version 1 gen weber 1 1 weber0 GD0,L,p 2 gen prec whatnow 2 0 1 whatnow(${1 code}, 0) 1 str 1 void 1 whatnow0 r 1 void while 0 write 1 1 write0 ss* 1 void write1 1 1 write1 ss* 1 void writebin 1 1 gpwritebin sDG 1 void writetex 1 1 writetex ss* 1 void zeta 1 1 gzeta Gp 2 gen prec zetak 1 1 gzetakall GGD0,L,p 2 gen prec zetakinit 1 1 initzeta Gp 2 gen prec zncoppersmith 1 1 zncoppersmith GGGDG 1 gen znlog 1 1 znlog GG 1 gen znorder 2 0 3 order(${1 code}) 1 gen 1 int order(${1 code}) 2 gen 1 int znorder(${1 code}, ${2 code}) 2 gen int 1 int 1 znorder GDG 1 gen znprimroot 2 0 2 gener(${1 code}) 1 int 1 gen ggener(${1 code}) 1 gen 1 gen 1 ggener G 1 gen znstar 1 1 znstar G 1 gen gp2c-0.0.8/desc/func25.dsc0000644000175000017500000020516412163255364012025 00000000000000!_ 2 0 2 ${1 code} 1 negbool 2 bool parens ${1 code} 1 bool 2 negbool parens 1 gnot G 1 gen #_ 2 0 4 lg(${1 code}) 1 vecsmall 1 lg lg(${1 code}) 1 vec 1 lg lgpol(${1 code}) 1 pol 1 small glength(${1 code}) 1 gen 1 small 1 glength G 1 small % 1 1 pari_get_hist D0,L, 1 gen +_ 1 0 5 ${1 code} 1 small 2 small parens ${1 code} 1 int 3 int parens copy ${1 code} 1 real 3 real parens copy ${1 code} 1 mp 3 mp parens copy ${1 code} 1 gen 3 gen parens copy -_ 2 0 5 -${parens 1 code} 1 small 2 small parens negi(${1 code}) 1 int 1 int negr(${1 code}) 1 real 1 real mpneg(${1 code}) 1 mp 1 mp gneg(${1 code}) 1 gen 1 gen 1 gneg G 1 gen Col 2 0 2 cgetg(1,t_COL) 0 1 vec gtocol(${1 code}) 1 gen 1 vec 1 gtocol DG 1 gen Euler 2 0 1 mpeuler(prec) 0 2 real prec 1 mpeuler p 2 gen prec I 2 0 0 1 gen_I 1 gen List 2 0 2 listcreate() 0 1 list gtolist(${1 code}) 1 gen 1 list 1 gtolist DG 1 gen Mat 1 1 gtomat DG 1 gen Mod 2 0 3 gmodulss(${1 code}, ${2 code}) 2 small small 1 gen gmodulsg(${1 code}, ${2 code}) 2 small gen 1 gen gmodulo(${1 code}, ${2 code}) 2 gen gen 1 gen 1 gmodulo GG 1 gen O 1 1 ggrando 1 gen O(_^_) 2 0 5 ggrando(${1 code}, 1) 1 gen 1 gen ggrando(gen_1, ${2 code}) 2 1 small 1 gen zeropadic(${1 code}, ${2 code}) 2 int small 1 gen ggrando(${1 code}, ${2 code}) 2 gen small 1 gen zeroser(${1 code}, ${2 code}) 2 var small 1 gen 1 ggrando GD1,L, 1 gen Pi 2 0 1 mppi(prec) 0 2 real prec 1 mppi p 2 gen prec Pol 2 0 1 gtopoly(${1 code}, ${2 code}) 2 gen ?var 1 pol 1 gtopoly GDn 1 gen Polrev 2 0 1 gtopolyrev(${1 code}, ${2 code}) 2 gen ?var 1 pol 1 gtopolyrev GDn 1 gen Qfb 1 1 Qfb0 GGGDGp 2 gen prec Ser 1 1 gtoser GDnDP 1 gen Set 2 0 2 cgetg(1,t_VEC) 0 1 vec gtoset(${1 code}) 1 gen 1 vec 1 gtoset DG 1 gen Str 2 0 1 ${1 :genstr cast} 1 gen 3 genstr copy parens 1 Str s* 1 gen Strchr 1 1 Strchr G 1 gen Strexpand 1 1 Strexpand s* 1 gen Strprintf 1 1 Strprintf ss* 1 gen Strtex 1 1 Strtex s* 1 gen Vec 2 0 2 cgetg(1,t_VEC) 0 1 vec gtovec(${1 code}) 1 gen 1 vec 1 gtovec DG 1 gen Vecrev 2 0 2 cgetg(1,t_VEC) 0 1 vec gtovecrev(${1 code}) 1 gen 1 vec 1 gtovecrev DG 1 gen Vecsmall 2 0 1 gtovecsmall(${1 code}) 1 gen 1 vecsmall 1 gtovecsmall DG 1 gen _! 2 0 1 mpfact(${1 code}) 1 small 1 int 1 mpfact L 1 gen _!=_ 2 0 17 ${parens 1 code} != ${parens 2 code} 2 small small 2 bool parens ${parens 1 code} != ${parens 2 code} 2 lg lg 2 bool parens cmpsi(${1 code}, ${2 code}) != 0 2 small int 2 bool parens cmpis(${1 code}, ${2 code}) != 0 2 int small 2 bool parens equali1(${1 code}) 2 int 1 1 negbool equalim1(${1 code}) 2 int -1 1 negbool equalii(${1 code}, ${2 code}) 2 int int 1 negbool cmprr(${1 code}, ${2 code}) != 0 2 real real 1 bool mpcmp(${1 code}, ${2 code}) != 0 2 mp mp 2 bool parens ${parens 1 code} != ${parens 2 code} 2 typ typ 2 bool parens ${parens 1 code} != ${parens 2 :typ cast} 2 typ #str 2 bool parens ${parens 1 :typ cast} != ${parens 2 code} 2 #str typ 2 bool parens strcmp(${1 code}, ${2 code}) 2 str str 1 bool ${parens 1 code} != ${parens 2 code} 2 typ typ 2 bool parens gequalsg(${1 code}, ${2 code}) 2 small gen 1 negbool gequalgs(${1 code}, ${2 code}) 2 gen small 1 negbool gequal(${1 code}, ${2 code}) 2 gen gen 1 negbool 1 gne GG 1 gen _%=_ 2 0 6 ${1 code} = smodss(${1 code}, ${2 code}) 2 *small small 2 small parens ${1 code} = modis(${1 code}, ${2 code}) 2 *int small 2 int parens ${1 code} = modii(${1 code}, ${2 code}) 2 *int int 2 int parens ${1 code} = gmod(${1 code}, ${2 code}) 2 *pol gen 2 gen parens ${1 code} = gmodgs(${1 code}, ${2 code}) 2 *gen small 2 gen parens ${1 code} = gmod(${1 code}, ${2 code}) 2 *gen gen 2 gen parens 1 gmode &G 1 gen _%_ 2 0 7 smodss(${1 code}, ${2 code}) 2 small small 1 small modsi(${1 code}, ${2 code}) 2 small int 1 int smodis(${1 code}, ${2 code}) 2 int small 1 small modii(${1 code}, ${2 code}) 2 int int 1 int gmodgs(${1 code}, ${2 code}) 2 gen small 1 gen gmodsg(${1 code}, ${2 code}) 2 small gen 1 gen gmod(${1 code}, ${2 code}) 2 gen gen 1 gen 1 gmod GG 1 gen _&&_ 2 0 1 ${parens 1 code} && ${parens 2 code} 2 bool bool 2 bool parens 1 andpari GE 1 gen _' 2 0 1 deriv(${1 code},-1) 1 gen 1 gen 1 deriv GDn 1 gen _(_) 1 0 4 closure_callgenall(${1 code}, 0) 1 gen 1 gen closure_callgen1(${1 code}, ${2 code}) 2 gen gen 1 gen closure_callgen2(${1 code}, ${2 code}, ${3 code}) 3 gen gen gen 1 gen closure_callgenall(${1 code}, ${nbarg 1 sub}, ${3 code}) 3 gen gen ... 1 gen _*=_ 2 0 12 ${1 code} *= ${parens 2 code} 2 *small small 2 small parens ${1 code} = mulis(${1 code}, ${2 code}) 2 *int small 2 int parens ${1 code} = mulii(${1 code}, ${2 code}) 2 *int int 2 int parens ${1 code} = mulrs(${1 code}, ${2 code}) 2 *real small 2 real parens ${1 code} = mulri(${1 code}, ${2 code}) 2 *real int 2 real parens ${1 code} = mulrr(${1 code}, ${2 code}) 2 *real real 2 real parens ${1 code} = mpmul(${1 code}, ${2 code}) 2 *mp mp 2 mp parens ${1 code} = gmulgs(${1 code}, ${2 code}) 2 *pol small 2 gen parens ${1 code} = gmul(${1 code}, ${2 code}) 2 *pol gen 2 gen parens ${1 code} = gmul(${1 code}, ${2 code}) 2 *vec gen 2 gen parens ${1 code} = gmulgs(${1 code}, ${2 code}) 2 *gen small 2 gen parens ${1 code} = gmul(${1 code}, ${2 code}) 2 *gen gen 2 gen parens 1 gmule &G 1 gen _*_ 2 0 14 ${parens 1 code}*${parens 2 code} 2 small small 2 small parens mulis(${1 code}, ${2 code}) 2 int small 1 int mulsi(${1 code}, ${2 code}) 2 small int 1 int mulii(${1 code}, ${2 code}) 2 int int 1 int (${2 code}, 0)/*for side effect*/ 2 0 mp 1 small mulsr(${1 code}, ${2 code}) 2 #small real 1 real mulsr(${1 code}, ${2 code}) 2 small real 1 mp mulrs(${1 code}, ${2 code}) 2 real small 1 mp mulrr(${1 code}, ${2 code}) 2 real real 1 real mpmul(${1 code}, ${2 code}) 2 mp mp 1 mp gmulgs(${1 code}, ${2 code}) 2 gen small 1 gen gmulsg(${1 code}, ${2 code}) 2 small gen 1 gen perm_mul(${1 code}, ${2 code}) 2 vecsmall vecsmall 1 vecsmall gmul(${1 code}, ${2 code}) 2 gen gen 1 gen 1 gmul GG 1 gen _++ 2 0 8 ++${1 code} 1 *bptr 1 bptr ++${1 code} 1 *small 1 small ++${1 code} 1 *lg 1 lg ${1 code} = addis(${1 code}, 1) 1 *int 2 int parens ${1 code} = addrs(${1 code}, 1) 1 *real 2 real parens ${1 code} = mpadd(${1 code}, gen_1) 1 *mp 2 mp parens ${1 code} = gaddgs(${1 code}, 1) 1 *pol 2 pol parens ${1 code} = gaddgs(${1 code}, 1) 1 *gen 2 gen parens 1 gadd1e & 1 gen _+=_ 2 0 13 ${1 code} += ${parens 2 code} 2 *small small 2 small parens ${1 code} += ${parens 2 code} 2 *lg small 2 lg parens ${1 code} = addis(${1 code}, ${2 code}) 2 *int small 2 int parens ${1 code} = addii(${1 code}, ${2 code}) 2 *int int 2 int parens ${1 code} = addrs(${1 code}, ${2 code}) 2 *real small 2 real parens ${1 code} = addir(${2 code}, ${1 code}) 2 *real int 2 real parens ${1 code} = addrr(${1 code}, ${2 code}) 2 *real real 2 real parens ${1 code} = mpadd(${1 code}, ${2 code}) 2 *mp mp 2 mp parens ${1 code} = gaddgs(${1 code}, ${2 code}) 2 *pol small 2 gen parens ${1 code} = gadd(${1 code}, ${2 code}) 2 *pol gen 2 gen parens ${1 code} = gadd(${1 code}, ${2 code}) 2 *vec gen 2 gen parens ${1 code} = gaddgs(${1 code}, ${2 code}) 2 *gen small 2 gen parens ${1 code} = gadd(${1 code}, ${2 code}) 2 *gen gen 2 gen parens 1 gadde &G 1 gen _+_ 2 0 16 ${parens 1 code} 2 lg 1 2 small parens ${parens 1 code} + ${parens 2 code} 2 small small 2 small parens ${parens 1 code} + ${parens 2 code} 2 lg small 2 lg parens ${parens 1 code} + ${parens 2 code} 2 small lg 2 lg parens addis(${1 code}, ${2 code}) 2 int small 1 int addsi(${1 code}, ${2 code}) 2 small int 1 int addii(${1 code}, ${2 code}) 2 int int 1 int addrs(${1 code}, ${2 code}) 2 real small 1 real addsr(${1 code}, ${2 code}) 2 small real 1 real addrr(${1 code}, ${2 code}) 2 real real 1 real mpadd(${1 code}, ${2 code}) 2 mp real 1 real mpadd(${1 code}, ${2 code}) 2 real mp 1 real mpadd(${1 code}, ${2 code}) 2 mp mp 1 mp gaddgs(${1 code}, ${2 code}) 2 gen small 1 gen gaddsg(${1 code}, ${2 code}) 2 small gen 1 gen gadd(${1 code}, ${2 code}) 2 gen gen 1 gen 1 gadd GG 1 gen _-- 2 0 8 --${1 code} 1 *bptr 1 bptr --${1 code} 1 *small 1 small --${1 code} 1 *lg 1 lg ${1 code} = subis(${1 code}, 1) 1 *int 2 int parens ${1 code} = subrs(${1 code}, 1) 1 *real 2 real parens ${1 code} = mpsub(${1 code}, gen_1) 1 *mp 2 mp parens ${1 code} = gsubgs(${1 code}, 1) 1 *pol 2 pol parens ${1 code} = gsubgs(${1 code}, 1) 1 *gen 2 gen parens 1 gsub1e & 1 gen _-=_ 2 0 13 ${1 code} -= ${parens 2 code} 2 *small small 2 small parens ${1 code} -= ${parens 2 code} 2 *lg small 2 lg parens ${1 code} = subis(${1 code}, ${2 code}) 2 *int small 2 int parens ${1 code} = subii(${1 code}, ${2 code}) 2 *int int 2 int parens ${1 code} = subrs(${1 code}, ${2 code}) 2 *real small 2 real parens ${1 code} = subri(${1 code}, ${2 code}) 2 *real int 2 real parens ${1 code} = subrr(${1 code}, ${2 code}) 2 *real real 2 real parens ${1 code} = mpsub(${1 code}, ${2 code}) 2 *mp mp 2 mp parens ${1 code} = gsubgs(${1 code}, ${2 code}) 2 *pol small 2 gen parens ${1 code} = gsub(${1 code}, ${2 code}) 2 *pol gen 2 gen parens ${1 code} = gsub(${1 code}, ${2 code}) 2 *vec gen 2 gen parens ${1 code} = gsubgs(${1 code}, ${2 code}) 2 *gen small 2 gen parens ${1 code} = gsub(${1 code}, ${2 code}) 2 *gen gen 2 gen parens 1 gsube &G 1 gen _-_ 2 0 14 ${parens 1 code} - ${parens 2 code} 2 small small 2 small parens ${parens 1 code} - ${parens 2 code} 2 lg small 2 lg parens subis(${1 code}, ${2 code}) 2 int small 1 int subsi(${1 code}, ${2 code}) 2 small int 1 int subii(${1 code}, ${2 code}) 2 int int 1 int subrs(${1 code}, ${2 code}) 2 real small 1 real subsr(${1 code}, ${2 code}) 2 small real 1 real subrr(${1 code}, ${2 code}) 2 real real 1 real mpsub(${1 code}, ${2 code}) 2 mp real 1 real mpsub(${1 code}, ${2 code}) 2 real mp 1 real mpsub(${1 code}, ${2 code}) 2 mp mp 1 mp gsubgs(${1 code}, ${2 code}) 2 gen small 1 gen gsubsg(${1 code}, ${2 code}) 2 small gen 1 gen gsub(${1 code}, ${2 code}) 2 gen gen 1 gen 1 gsub GG 1 gen _.a1 2 0 1 ell_get_a1(${1 code}) 1 ell 2 gen copy 1 member_a1 G 2 gen copy _.a2 2 0 1 ell_get_a2(${1 code}) 1 ell 2 gen copy 1 member_a2 G 2 gen copy _.a3 2 0 1 ell_get_a3(${1 code}) 1 ell 2 gen copy 1 member_a3 G 2 gen copy _.a4 2 0 1 ell_get_a4(${1 code}) 1 ell 2 gen copy 1 member_a4 G 2 gen copy _.a6 2 0 1 ell_get_a6(${1 code}) 1 ell 2 gen copy 1 member_a6 G 2 gen copy _.area 2 0 1 gel(${1 code}, 19) 1 bell 2 gen copy 1 member_area G 2 gen copy _.b2 2 0 1 ell_get_b2(${1 code}) 1 ell 2 gen copy 1 member_b2 G 2 gen copy _.b4 2 0 1 ell_get_b4(${1 code}) 1 ell 2 gen copy 1 member_b4 G 2 gen copy _.b6 2 0 1 ell_get_b6(${1 code}) 1 ell 2 gen copy 1 member_b6 G 2 gen copy _.b8 2 0 1 ell_get_b8(${1 code}) 1 ell 2 gen copy 1 member_b8 G 2 gen copy _.bid 2 0 2 bnr_get_bid(${1 code}) 1 bnr 2 gen copy member_bid(${1 code}) 1 gen 2 gen copy 1 member_bid G 2 gen copy _.bnf 2 0 3 ${1 code} 1 bnf 2 bnf parens ${1 :bnf cast} 1 bnr 3 bnf copy parens member_bnf(${1 code}) 1 gen 2 bnf copy 1 member_bnf G 2 gen copy _.c4 2 0 1 ell_get_c4(${1 code}) 1 ell 2 gen copy 1 member_c4 G 2 gen copy _.c6 2 0 1 ell_get_c6(${1 code}) 1 ell 2 gen copy 1 member_c6 G 2 gen copy _.clgp 2 0 4 ${1 :clgp cast} 1 bnf 3 clgp copy parens ${1 :clgp cast} 1 bnr 3 clgp copy parens ${1 code} 1 clgp 2 clgp parens member_clgp(${1 code}) 1 gen 2 clgp copy 1 member_clgp G 2 gen copy _.codiff 1 1 member_codiff G 2 gen copy _.cyc 2 0 4 bnr_get_cyc(${1 code}) 1 bnr 2 vec copy bnf_get_cyc(${1 code}) 1 bnf 2 vec copy gel(${1 code}, 2) 1 clgp 2 vec copy member_cyc(${1 code}) 1 gen 2 vec copy 1 member_cyc G 2 gen copy _.diff 2 0 2 nf_get_diff(${1 code}) 1 nf 2 gen copy member_diff(${1 code}) 1 gen 2 gen copy 1 member_diff G 2 gen copy _.disc 2 0 3 nf_get_disc(${1 code}) 1 nf 2 int copy ell_get_disc(${1 code}) 1 ell 2 gen copy member_disc(${1 code}) 1 gen 2 gen copy 1 member_disc G 2 gen copy _.e 2 0 1 pr_get_e(${1 code}) 1 prid 1 small 1 member_e G 2 gen copy _.eta 1 1 member_eta G 2 gen copy _.f 2 0 1 pr_get_f(${1 code}) 1 prid 1 small 1 member_f G 2 gen copy _.fu 2 0 3 $"ray units not implemented" 1 bnr 1 void bnf_get_fu(${1 code}) 1 bnf 2 gen copy member_fu(${1 code}) 1 gen 1 gen 1 member_fu G 1 gen _.futu 1 1 member_futu G 2 gen copy _.gen 2 0 6 bnr_get_gen(${1 code}) 1 bnr 2 vec copy bnf_get_gen(${1 code}) 1 bnf 2 vec copy gal_get_gen(${1 code}) 1 gal 2 vec copy gel(${1 code}, 3) 1 clgp 2 vec copy pr_get_gen(${1 code}) 1 prid 2 gen copy member_gen(${1 code}) 1 gen 2 gen copy 1 member_gen G 2 gen copy _.group 2 0 2 gal_get_group(${1 code}) 1 gal 2 vec copy member_group(${1 code}) 1 gen 2 vec copy 1 member_group G 2 gen copy _.index 2 0 2 nf_get_index(${1 code}) 1 nf 2 int copy member_index(${1 code}) 1 gen 2 int copy 1 member_index G 2 gen copy _.j 2 0 1 ell_get_j(${1 code}) 1 ell 2 gen copy 1 member_j G 2 gen copy _.mod 1 1 member_mod G 2 gen copy _.nf 2 0 2 ${1 code} 1 nf 2 nf parens member_nf(${1 code}) 1 gen 2 nf copy 1 member_nf G 2 gen copy _.no 2 0 4 bnr_get_no(${1 code}) 1 bnr 2 int copy bnf_get_no(${1 code}) 1 bnf 2 int copy gel(${1 code}, 1) 1 clgp 2 int copy member_no(${1 code}) 1 gen 2 int copy 1 member_no G 2 gen copy _.omega 1 1 member_omega G 2 gen copy _.orders 2 0 1 gal_get_orders(${1 code}) 1 gal 2 vecsmall copy 1 member_orders G 2 gen copy _.p 2 0 3 gal_get_p(${1 code}) 1 gal 2 int copy pr_get_p(${1 code}) 1 prid 2 int copy member_p(${1 code}) 1 gen 2 int copy 1 member_p G 2 gen copy _.pol 2 0 3 gal_get_pol(${1 code}) 1 gal 2 gen copy nf_get_pol(${1 code}) 1 nf 2 gen copy member_pol(${1 code}) 1 gen 2 gen copy 1 member_pol G 2 gen copy _.r1 2 0 2 nf_get_r1(${1 code}) 1 nf 1 small member_r1(${1 code}) 1 gen 2 int copy 1 member_r1 G 2 gen copy _.r2 2 0 2 nf_get_r2(${1 code}) 1 nf 1 small member_r2(${1 code}) 1 gen 2 int copy 1 member_r2 G 2 gen copy _.reg 2 0 3 $"ray regulator not implemented" 1 bnr 1 real bnf_get_reg(${1 code}) 1 bnf 2 real copy member_reg(${1 code}) 1 gen 2 real copy 1 member_reg G 2 gen copy _.roots 2 0 4 gal_get_roots(${1 code}) 1 gal 2 vec copy ell_get_roots(${1 code}) 1 bell 2 vec copy nf_get_roots(${1 code}) 1 nf 2 vec copy member_roots(${1 code}) 1 gen 2 vec copy 1 member_roots G 2 gen copy _.sign 2 0 2 gel(${1 code}, 2) 1 nf 2 vec copy member_sign(${1 code}) 1 gen 2 vec copy 1 member_sign G 2 gen copy _.t2 2 0 1 member_t2(${1 code}) 1 gen 1 vec 1 member_t2 G 1 gen _.tate 1 1 member_tate G 2 gen copy _.tu 2 0 1 member_tu(${1 code}) 1 gen 2 gen copy 1 member_tu G 1 gen _.tufu 1 1 member_tufu G 2 gen copy _.w 2 0 1 gel(${1 code}, 18) 1 bell 2 gen copy 1 member_w G 2 gen copy _.zk 2 0 2 nf_get_zk(${1 code}) 1 nf 2 vec copy member_zk(${1 code}) 1 gen 2 vec copy 1 member_zk G 2 gen copy _.zkst 2 0 1 bnr_get_bid(${1 code}) 1 bnr 2 gen copy 1 member_zkst G 2 gen copy _/=_ 2 0 10 $"cannot divide small: use \= instead." 2 *small gen 1 void $"cannot divide int: use \= instead." 2 *int gen 1 void ${1 code} = divrr(${1 code}, ${2 code}) 2 *real real 2 real parens ${1 code} = divrs(${1 code}, ${2 code}) 2 *real small 2 real parens ${1 code} = mpdiv(${1 code}, ${2 code}) 2 *real mp 2 real parens ${1 code} = mpdiv(${1 code}, ${2 code}) 2 *mp real 2 mp parens ${1 code} = gdiv(${1 code}, ${2 code}) 2 *pol gen 2 gen parens ${1 code} = gdiv(${1 code}, ${2 code}) 2 *vec gen 2 gen parens ${1 code} = gdivgs(${1 code}, ${2 code}) 2 *gen small 2 gen parens ${1 code} = gdiv(${1 code}, ${2 code}) 2 *gen gen 2 gen parens 1 gdive &G 1 gen _/_ 2 0 12 (${2 code}, 0)/*for side effect*/ 2 0 mp 1 small invr(${2 code}) 2 1 real 1 real divsr(${1 code}, ${2 code}) 2 #small real 1 real divsr(${1 code}, ${2 code}) 2 small real 1 mp divrs(${1 code}, ${2 code}) 2 real small 1 real divrr(${1 code}, ${2 code}) 2 real real 1 real mpdiv(${1 code}, ${2 code}) 2 real mp 1 real mpdiv(${1 code}, ${2 code}) 2 mp real 1 mp ginv(${2 code}) 2 1 gen 1 gen gdivgs(${1 code}, ${2 code}) 2 gen small 1 gen gdivsg(${1 code}, ${2 code}) 2 small gen 1 gen gdiv(${1 code}, ${2 code}) 2 gen gen 1 gen 1 gdiv GG 1 gen _<<=_ 2 0 4 ${1 code} <<= ${parens 2 code} 2 *small small 2 small parens ${1 code} = shifti(${1 code}, ${2 code}) 2 *int small 2 int parens ${1 code} = mpshift(${1 code}, ${2 code}) 2 *mp small 2 mp parens ${1 code} = gshift(${1 code}, ${2 code}) 2 *gen small 2 mp parens 1 gshiftle &L 1 gen _<<_ 2 0 3 shifti(${1 code}, ${2 code}) 2 int small 1 int mpshift(${1 code}, ${2 code}) 2 mp small 1 mp gshift(${1 code}, ${2 code}) 2 gen small 1 mp 1 gshift GL 1 gen _<=_ 2 0 12 ${parens 1 code} <= ${parens 2 code} 2 small small 2 bool parens ${parens 1 code} < ${parens 2 code} 2 small lg 2 bool parens ${parens 1 code} <= ${parens 2 code} 2 lg lg 2 bool parens cmpsi(${1 code}, ${2 code}) <= 0 2 small int 2 bool parens cmpis(${1 code}, ${2 code}) < 0 2 int lg 2 bool parens cmpis(${1 code}, ${2 code}) <= 0 2 int small 2 bool parens cmpii(${1 code}, ${2 code}) <= 0 2 int int 2 bool parens mpcmp(${1 code}, ${2 code}) <= 0 2 mp mp 2 bool parens strcmp(${1 code}, ${2 code}) <= 0 2 str str 2 bool parens gcmpsg(${1 code}, ${2 code}) <= 0 2 small gen 2 bool parens gcmpgs(${1 code}, ${2 code}) <= 0 2 gen small 2 bool parens gcmp(${1 code}, ${2 code}) <= 0 2 gen gen 2 bool parens 1 gle GG 1 gen _<_ 2 0 11 ${parens 1 code} < ${parens 2 code} 2 small small 2 bool parens ${parens 1 code} < ${parens 2 code} 2 lg lg 2 bool parens ${parens 1 code} <= ${parens 2 code} 2 lg small 2 bool parens cmpsi(${1 code}, ${2 code}) < 0 2 small int 2 bool parens cmpis(${1 code}, ${2 code}) < 0 2 int small 2 bool parens cmpii(${1 code}, ${2 code}) < 0 2 int int 2 bool parens mpcmp(${1 code}, ${2 code}) < 0 2 mp mp 2 bool parens strcmp(${1 code}, ${2 code}) < 0 2 str str 2 bool parens gcmpsg(${1 code}, ${2 code}) < 0 2 small gen 2 bool parens gcmpgs(${1 code}, ${2 code}) < 0 2 gen small 2 bool parens gcmp(${1 code}, ${2 code}) < 0 2 gen gen 2 bool parens 1 glt GG 1 gen _===_ 1 1 gidentical GG 1 small_int _==_ 2 0 20 ${parens 1 code} == ${parens 2 code} 2 small small 2 bool parens ${parens 1 code} == ${parens 2 code} 2 lg lg 2 bool parens cmpsi(${1 code}, ${2 code}) == 0 2 small int 2 bool parens !signe(${1 code}) 2 mp 0 1 bool equali1(${1 code}) 2 int 1 1 bool equalim1(${1 code}) 2 int -1 1 bool cmpis(${1 code}, ${2 code}) == 0 2 int small 2 bool parens equalii(${1 code}, ${2 code}) 2 int int 1 bool gequal0(${1 code}) 2 gen 0 1 bool gequal1(${1 code}) 2 gen 1 1 bool gequalm1(${1 code}) 2 gen -1 1 bool cmprr(${1 code}, ${2 code}) == 0 2 real real 1 bool mpcmp(${1 code}, ${2 code}) == 0 2 mp mp 2 bool parens ${parens 1 code} == ${parens 2 code} 2 typ typ 2 bool parens ${parens 1 code} == ${parens 2 :typ cast} 2 typ #str 2 bool parens ${parens 1 :typ cast} == ${parens 2 code} 2 #str typ 2 bool parens strcmp(${1 code}, ${2 code}) 2 str str 1 negbool gequalsg(${1 code}, ${2 code}) 2 small gen 1 bool gequalgs(${1 code}, ${2 code}) 2 gen small 1 bool gequal(${1 code}, ${2 code}) 2 gen gen 1 bool 1 geq GG 1 gen _=_ 1 1 gstore &G 2 gen copy _>=_ 2 0 11 ${parens 1 code} >= ${parens 2 code} 2 small small 2 bool parens ${parens 1 code} >= ${parens 2 code} 2 lg lg 2 bool parens ${parens 1 code} > ${parens 2 code} 2 lg small 2 bool parens cmpsi(${1 code}, ${2 code}) >= 0 2 small int 2 bool parens cmpis(${1 code}, ${2 code}) >= 0 2 int small 2 bool parens cmpii(${1 code}, ${2 code}) >= 0 2 int int 2 bool parens mpcmp(${1 code}, ${2 code}) >= 0 2 mp mp 2 bool parens strcmp(${1 code}, ${2 code}) >= 0 2 str str 2 bool parens gcmpsg(${1 code}, ${2 code}) >= 0 2 small gen 2 bool parens gcmpgs(${1 code}, ${2 code}) >= 0 2 gen small 2 bool parens gcmp(${1 code}, ${2 code}) >= 0 2 gen gen 2 bool parens 1 gge GG 1 gen _>>=_ 2 0 4 ${1 code} >>= ${parens 2 code} 2 *small small 2 small parens ${1 code} = shifti(${1 code}, -${parens 2 code}) 2 *int small 2 int parens ${1 code} = mpshift(${1 code}, -${parens 2 code}) 2 *mp small 2 mp parens ${1 code} = gshift(${1 code}, -${parens 2 code}) 2 *gen small 2 mp parens 1 gshiftre &L 1 gen _>>_ 2 0 4 ${parens 1 code}>>${parens 2 code} 2 small small 2 small parens shifti(${1 code}, -${parens 2 code}) 2 int small 1 int mpshift(${1 code}, -${parens 2 code}) 2 mp small 1 mp gshift(${1 code}, -${parens 2 code}) 2 gen small 1 mp 1 gshift_right GL 1 gen _>_ 2 0 11 ${parens 1 code} > ${parens 2 code} 2 small small 2 bool parens ${parens 1 code} > ${parens 2 code} 2 lg lg 2 bool parens ${parens 1 code} >= ${parens 2 code} 2 small lg 2 bool parens cmpsi(${1 code}, ${2 code}) > 0 2 small int 2 bool parens cmpis(${1 code}, ${2 code}) > 0 2 int small 2 bool parens cmpii(${1 code}, ${2 code}) > 0 2 int int 2 bool parens mpcmp(${1 code}, ${2 code}) > 0 2 mp mp 2 bool parens strcmp(${1 code}, ${2 code}) > 0 2 str str 2 bool parens gcmpsg(${1 code}, ${2 code}) > 0 2 small gen 2 bool parens gcmpgs(${1 code}, ${2 code}) > 0 2 gen small 2 bool parens gcmp(${1 code}, ${2 code}) > 0 2 gen gen 2 bool parens 1 ggt GG 1 gen _[_,] 1 0 3 $"Scalar has no rows" 2 mp small 1 gen rowcopy(${1 code}, ${2 code}) 2 vec small 1 vec rowcopy(${1 code}, ${2 code}) 2 gen small 1 vec _[_,_] 1 0 9 $"Scalar has no components" 2 mp small 1 gen $"Scalar has no components" 3 mp small small 1 gen ${parens 1 code}[${2 code}] 2 vecsmall small 1 small $"Vecsmall are single-dimensional" 3 vecsmall small small 1 gen gel(list_data(${1 code}), ${2 code}) 2 list small 2 gen copy gel(${1 code}, ${2 code}) 2 vec small 2 gen copy gcoeff(${1 code}, ${2 code}, ${3 code}) 3 vec small small 2 gen copy gel(${1 code}, ${2 code}) 2 gen small 2 gen copy gcoeff(${1 code}, ${2 code}, ${3 code}) 3 gen small small 2 gen copy _\/=_ 2 0 3 ${1 code} = gdivround(${1 code}, ${2 code}) 2 *int int 2 int parens ${1 code} = gdivround(${1 code}, ${2 code}) 2 *pol gen 2 gen parens ${1 code} = gdivround(${1 code}, ${2 code}) 2 *gen gen 2 gen parens 1 gdivrounde &G 1 gen _\/_ 2 0 2 gdivround(${1 code}, ${2 code}) 2 int int 1 int gdivround(${1 code}, ${2 code}) 2 gen gen 1 gen 1 gdivround GG 1 gen _\=_ 2 0 4 ${1 code} /= ${parens 2 code} 2 *small small 2 small parens ${1 code} = gdivent(${1 code}, ${2 code}) 2 *int int 2 int parens ${1 code} = gdivent(${1 code}, ${2 code}) 2 *pol gen 2 gen parens ${1 code} = gdivent(${1 code}, ${2 code}) 2 *gen gen 2 gen parens 1 gdivente &G 1 gen _\_ 2 0 7 ${parens 1 code}/${parens 2 code} 2 small small 2 small parens truedivis(${1 code}, ${2 code}) 2 int small 1 int gdiventsg(${1 code}, ${2 code}) 2 small int 1 int truedivii(${1 code}, ${2 code}) 2 int int 1 int gdiventgs(${1 code}, ${2 code}) 2 gen small 1 gen gdiventsg(${1 code}, ${2 code}) 2 small gen 1 gen gdivent(${1 code}, ${2 code}) 2 gen gen 1 gen 1 gdivent GG 1 gen _^_ 2 0 16 sqri(${1 code}) 2 int 2 1 int powiu(${1 code}, 3) 2 int 3 1 int powiu(${1 code}, 4) 2 int 4 1 int powiu(${1 code}, 5) 2 int 5 1 int invr(${1 code}) 2 real -1 1 real ginv(${1 code}) 2 mp -1 1 mp ginv(${1 code}) 2 gen -1 1 gen sqrr(${1 code}) 2 real 2 1 real mpsqr(${1 code}) 2 mp 2 1 mp gsqr(${1 code}) 2 gen 2 1 gen powis(${1 code}, ${2 code}) 2 int small 1 gen gpowgs(${1 code}, ${2 code}) 2 real small 1 real gpowgs(${1 code}, ${2 code}) 2 gen small 1 gen powgi(${1 code}, ${2 code}) 2 real int 1 real powgi(${1 code}, ${2 code}) 2 gen int 1 gen gpow(${1 code}, ${2 code}, prec) 2 gen gen 2 gen prec 1 gpow GGp 2 gen prec _^s 1 1 gpowgs GL 1 gen __ 1 0 4 concat(${1 code}, ${2 code}) 2 genstr genstr 1 genstr concat(${1 code}, ${2 code}) 2 genstr gen 1 genstr concat(${1 code}, ${2 code}) 2 gen genstr 1 genstr concat(${1 :genstr cast}, ${2 code}) 2 gen gen 1 genstr _avma 1 0 1 avma 0 1 pari_sp _badtype 1 0 14 typ(${1 code}) != t_INT 1 int 2 bool parens typ(${1 code}) != t_REAL 1 real 2 bool parens is_intreal_t(typ(${1 code})) 1 mp 1 negbool is_matvec_t(typ(${1 code})) 1 vec 1 negbool typ(${1 code}) != t_VECSMALL 1 vecsmall 2 bool parens typ(${1 code}) != t_POL 1 pol 2 bool parens ${1 code} = checknf(${1 code}) 1 *nf 2 void parens ${1 code} = checkbnf(${1 code}) 1 *bnf 2 void parens checkbnr(${1 code}) 1 bnr 1 void checkprid(${1 code}) 1 prid 1 void lg(${1 code}) != 3 || typ(${parens 1 code}[2]) != t_POLMOD 1 @clgp 2 bool parens checksmallell(${1 code}) 1 ell 1 void checkell(${1 code}) 1 bell 1 void ${1 code} = checkgal(${1 code}) 1 *gal 2 gal parens _call_GG 1 0 1 ${parens 1 code}(${2 code}, ${3 code}) 3 func_GG gen gen 1 gen _cast 1 0 94 0 1 void 1 bool ${1 value not} 1 #negbool 1 bool !${parens 1 code} 1 negbool 1 bool 1 small_int 1 bool 1 small 1 bool ${parens 1 code}!=1 1 lg 2 bool parens *${parens 1 code} 1 bptr 1 bool !gequal0(${1 code}) 1 gen 1 bool signe(${1 code}) 1 real 1 bool signe(${1 code}) 1 int 1 bool signe(${1 code}) 1 mp 1 bool signe(${1 code}) 1 pol 1 bool 1 1 void 1 negbool ${1 value not} 1 #bool 1 negbool !${parens 1 code} 1 bool 1 negbool ${parens 1 code}==1 1 lg 2 negbool parens !*${parens 1 code} 1 bptr 1 negbool gequal0(${1 code}) 1 gen 1 negbool !signe(${1 code}) 1 int 1 negbool !signe(${1 code}) 1 real 1 negbool !signe(${1 code}) 1 mp 1 negbool !signe(${1 code}) 1 pol 1 negbool 1 bool 1 small_int 1 typ 1 small_int 1 small 1 small_int 1 bool 1 small 1 typ 1 small 1 small_int 1 small *${parens 1 code} 1 bptr 1 small itos(${1 code}) 1 int 1 small ${1 value 1 sub} 1 #lg 2 small parens ${parens 1 code}-1 1 lg 2 small parens gtos(${1 code}) 1 gen 1 small gen_0 1 void 1 int gen_m2 1 -2 1 int gen_m1 1 -1 1 int gen_0 1 0 1 int gen_1 1 1 1 int gen_2 1 2 1 int stoi(${1 code}) 1 bool 1 int stoi(${1 code}) 1 small 1 int 1 mp 1 int 1 gen 1 int 1 mp 1 real 1 gen 1 real 1 int 1 mp 1 real 1 mp 1 gen 1 mp ${1 1 value add} 1 #bool 2 lg parens ${parens 1 code}+1 1 bool 2 lg parens ${1 1 value add} 1 #small 2 lg parens ${parens 1 code}+1 1 small 2 lg parens 1 gen 1 closure 1 gen 1 vecsmall 1 nf 1 vec 1 bnf 1 vec 1 bnr 1 vec 1 ell 1 vec 1 bell 1 vec 1 clgp 1 vec 1 prid 1 vec 1 gal 1 vec 1 gen 1 vec 1 gen 1 list varn(${1 code}) 1 pol 1 var gvar(${1 code}) 1 gen 1 var pol_x(${1 code}) 1 var 1 pol 1 gen 1 pol 1 int 1 gen 1 mp 1 gen 1 vecsmall 1 gen 1 vec 1 gen 1 list 1 gen 1 pol 1 gen 1 genstr 1 gen 1 closure 1 gen GENtoGENstr(${1 code}) 1 gen 1 genstr strtoGENstr(${1 code}) 1 str 1 genstr GSTR(${1 code}) 1 genstr 1 str type_name(${1 code}) 1 typ 1 str ${1 str_format} 1 #str 1 typ bnf_get_nf(${1 code}) 1 bnf 1 nf 1 gen 1 nf bnr_get_bnf(${1 code}) 1 bnr 1 bnf 1 gen 1 bnf 1 gen 1 bnr bnf_get_clgp(${1 code}) 1 bnf 1 clgp bnr_get_clgp(${1 code}) 1 bnr 1 clgp 1 gen 1 clgp 1 bell 1 ell 1 gen 1 ell 1 gen 1 bell 1 gen 1 gal 1 gen 1 prid _cgetg 1 0 2 cgetg(${1 code}, ${2 str_raw}) 2 lg #str 1 gen ${1 code} = cgetg(${2 code}, ${3 str_raw}) 3 gen lg #str 1 gen _const_expr 1 0 1 readseq(${1 code}) 1 str 1 gen _const_quote 1 0 1 fetch_user_var(${1 code}) 1 str 1 var _const_real 1 0 1 strtor(${1 code}, prec) 1 str 2 real prec _const_smallreal 1 0 4 real_0(prec) 1 0 2 real prec real_1(prec) 1 1 2 real prec real_m1(prec) 1 -1 2 real prec stor(${1 code}, prec) 1 small 2 real prec _decl_base 1 0 8 void 1 C!void 0 long 1 C!long 0 int 1 C!int 0 GEN 1 C!GEN 0 char 1 C!char* 0 byteptr 1 C!byteptr 0 pari_sp 1 C!pari_sp 0 GEN 1 C!func_GG 0 _decl_ext 1 0 2 *${1 code} 1 C!char* 0 (*${1 code})(GEN, GEN) 1 C!func_GG 0 _default_check 1 0 2 !${parens 1 code} 1 C!GEN 1 bool ${parens 1 code} == -1 1 var 1 bool _default_marker 1 0 4 NULL 1 C!GEN 0 -1 1 var 0 0 1 small 0 "" 1 str 0 _derivfun 1 1 derivfun0 GGp 2 gen prec _diffptr 1 0 1 diffptr 0 1 bptr _err_primes 1 0 1 pari_err(primer1) 0 1 void _err_type 1 0 1 pari_err(typeer, ${1 code}) 1 str 1 void _eval_mnemonic 1 1 eval_mnemonic Gs 1 small _factor_Aurifeuille 1 1 factor_Aurifeuille GL 1 gen _factor_Aurifeuille_prime 1 1 factor_Aurifeuille_prime GL 1 gen _formatcode 1 0 5 ${1 code} 1 #small 1 void %ld 1 small 1 small ${1 str_format} 1 #str 1 void %s 1 str 1 str %Ps 1 gen 1 gen _forprime_next 1 0 1 NEXT_PRIME_VIADIFF(${1 code}, ${2 code}) 2 *small *bptr 1 void _forvec_start 1 0 1 forvec_start(${1 code}, ${2 code}, &${3 code}, &${4 code}) 4 gen small &gen &func_GG 1 vec _gerepileall 1 0 2 ${2 code} = gerepilecopy(${1 code}, ${2 code}) 2 pari_sp gen 2 void parens gerepileall(${1 code}, ${nbarg 1 sub}, ${stdref 3 code}) 3 pari_sp gen ... 1 void _gerepileupto 1 0 5 gerepileuptoint(${1 code}, ${2 code}) 2 pari_sp int 1 int gerepileuptoleaf(${1 code}, ${2 code}) 2 pari_sp mp 1 mp gerepileuptoleaf(${1 code}, ${2 code}) 2 pari_sp vecsmall 1 vecsmall gerepileupto(${1 code}, ${2 code}) 2 pari_sp vec 1 vec gerepileupto(${1 code}, ${2 code}) 2 pari_sp gen 1 gen _low_stack_lim 1 0 1 low_stack(${1 code}, stack_lim(${2 code}, 1)) 2 pari_sp pari_sp 1 bool _maxprime 1 0 1 maxprime() 0 1 small _proto_code 1 0 4 n 1 var 0 L 1 C!long 0 G 1 C!GEN 0 s 1 C!char* 0 _proto_max_args 1 0 1 1 20 0 _proto_ret 1 0 4 v 1 C!void 0 i 1 C!int 0 l 1 C!long 0 1 C!GEN 0 _stack_lim 1 0 1 stack_lim(${1 code}, ${2 code}) 2 pari_sp small 1 pari_sp _strtoclosure 1 0 2 strtofunction(${1 code}) 1 str 1 closure strtoclosure(${1 code}, ${nbarg 1 sub}, ${3 code}) 3 str gen ... 1 closure _toGENstr 1 0 2 strtoGENstr(${1 code}) 1 str 1 genstr GENtoGENstr(${1 code}) 1 gen 1 genstr _tovec 1 0 6 cgetg(1, t_VEC) 0 1 vec mkvec(${1 code}) 1 gen 1 vec mkvec2(${1 code}, ${2 code}) 2 gen gen 1 vec mkvec3(${1 code}, ${2 code}, ${3 code}) 3 gen gen gen 1 vec mkvec4(${1 code}, ${2 code}, ${3 code}, ${4 code}) 4 gen gen gen gen 1 vec mkvecn(${nbarg}, ${2 code}) 2 gen ... 1 vec _tovecprec 1 0 5 mkvecs(prec) 0 2 vec prec mkvec2(${1 code}, stoi(prec)) 1 gen 2 vec prec mkvec3(${1 code}, ${2 code}, stoi(prec)) 2 gen gen 2 vec prec mkvec4(${1 code}, ${2 code}, ${3 code}, stoi(prec)) 3 gen gen gen 2 vec prec mkvecn(${nbarg 1 add}, ${2 code}, stoi(prec)) 2 gen ... 2 vec prec _type_preorder 1 0 17 7 empty void bool small int mp gen 0 3 empty real mp 0 3 empty bptr small 0 4 empty bool lg small 0 4 empty bool small_int small 0 4 empty void negbool bool 0 5 empty typ str genstr gen 0 3 empty vecsmall gen 0 3 empty vec gen 0 3 empty list gen 0 3 empty closure gen 0 5 empty bnr bnf nf vec 0 5 empty bnr bnf clgp vec 0 4 empty bell ell vec 0 3 empty prid vec 0 3 empty gal vec 0 4 empty var pol gen 0 _typedef 1 0 31 void 1 empty 0 void 1 void 0 long 1 negbool 0 long 1 bool 0 int 1 small_int 0 long 1 small 0 GEN 1 int 0 GEN 1 real 0 GEN 1 mp 0 long 1 lg 0 GEN 1 vecsmall 0 GEN 1 vec 0 GEN 1 list 0 long 1 var 0 GEN 1 pol 0 GEN 1 gen 0 GEN 1 closure 0 GEN 1 genstr 0 char* 1 str 0 byteptr 1 bptr 0 func_GG 1 func_GG 0 pari_sp 1 pari_sp 0 long 1 typ 0 GEN 1 nf 0 GEN 1 bnf 0 GEN 1 bnr 0 GEN 1 ell 0 GEN 1 bell 0 GEN 1 clgp 0 GEN 1 prid 0 GEN 1 gal 0 _void_if 1 1 ifpari_void GDIDI 1 void _wrap_G 2 0 1 ${1 code} 1 gen 1 gen 1 gp_call G 1 gen _wrap_bG 2 0 1 ${1 code} 1 bool 1 bool 1 gp_callbool G 1 small _wrap_vG 2 0 1 0 1 void 1 small 1 gp_callvoid G 1 small _||_ 2 0 1 ${parens 1 code} || ${parens 2 code} 2 bool bool 2 bool parens 1 orpari GE 1 gen _~ 2 0 2 gtrans(${1 code}) 1 vec 1 vec gtrans(${1 code}) 1 gen 1 gen 1 gtrans G 1 gen abs 2 0 5 labs(${1 code}) 1 small 1 small mpabs(${1 code}) 1 int 1 int mpabs(${1 code}) 1 real 1 real mpabs(${1 code}) 1 mp 1 mp gabs(${1 code}, prec) 1 gen 2 gen prec 1 gabs Gp 2 gen prec acos 1 1 gacos Gp 2 gen prec acosh 1 1 gach Gp 2 gen prec addhelp 1 1 addhelp rs 1 void addprimes 1 1 addprimes DG 1 gen agm 1 1 agm GGp 2 gen prec alarm 1 1 alarm0 D0,L, 1 void algdep 1 1 algdep0 GLD0,L, 1 gen alias 1 1 alias0 rr 1 void allocatemem 1 1 allocatemem0 DG 1 void apply 3 0 1 genapply(${1 cookie}, ${1 wrapper}, ${2 code}) 2 closure gen 1 gen 1 apply0 GG 1 gen 2 1 _wrap_G arg 1 1 garg Gp 2 gen prec asin 1 1 gasin Gp 2 gen prec asinh 1 1 gash Gp 2 gen prec atan 1 1 gatan Gp 2 gen prec atanh 1 1 gath Gp 2 gen prec bernfrac 1 1 bernfrac L 1 gen bernreal 1 1 bernreal Lp 2 gen prec bernvec 1 1 bernvec L 1 gen besselh1 1 1 hbessel1 GGp 2 gen prec besselh2 1 1 hbessel2 GGp 2 gen prec besseli 1 1 ibessel GGp 2 gen prec besselj 1 1 jbessel GGp 2 gen prec besseljh 1 1 jbesselh GGp 2 gen prec besselk 1 1 kbessel GGp 2 gen prec besseln 1 1 nbessel GGp 2 gen prec bestappr 1 1 bestappr0 GDGDG 1 gen bezout 1 1 vecbezout GG 1 gen bezoutres 1 1 vecbezoutres GG 1 gen bigomega 2 0 2 bigomega(${1 code}) 1 int 1 small gbigomega(${1 code}) 1 gen 1 gen 1 gbigomega G 1 gen binary 1 1 binaire G 1 gen binomial 1 1 binomial GL 1 gen bitand 2 0 2 ${parens 1 code}&${parens 2 code} 2 small small 2 small parens gbitand(${1 code}, ${2 code}) 2 gen gen 1 int 1 gbitand GG 1 gen bitneg 1 1 gbitneg GD-1,L, 1 gen bitnegimply 2 0 2 ${parens 1 code}&~${parens 2 code} 2 small small 2 small parens gbitnegimply(${1 code}, ${2 code}) 2 gen gen 1 int 1 gbitnegimply GG 1 gen bitor 2 0 2 ${parens 1 code}|${parens 2 code} 2 small small 2 small parens gbitor(${1 code}, ${2 code}) 2 gen gen 1 int 1 gbitor GG 1 gen bittest 2 0 3 (${parens 1 code}>>${parens 2 code})&1 2 small small 2 bool parens bittest(${1 code}, ${2 code}) 2 int small 1 bool gbittest(${1 code}, ${2 code}) 2 gen small 1 gen 1 gbittest GL 1 gen bitxor 2 0 2 ${parens 1 code}^${parens 2 code} 2 small small 2 small parens gbitxor(${1 code}, ${2 code}) 2 gen gen 1 int 1 gbitxor GG 1 gen bnfcertify 1 1 bnfcertify0 GD0,L, 1 small bnfcompress 1 1 bnfcompress G 1 gen bnfdecodemodule 1 1 decodemodule GG 1 gen bnfinit 2 0 4 Buchall(${1 code}, 0, prec) 1 gen 2 bnf prec Buchall(${1 code}, 0, prec) 2 gen 0 2 bnf prec Buchall(${1 code}, nf_FORCE, prec) 2 gen 1 2 bnf prec bnfinit0(${1 code}, ${2 code}, ${3 code}, prec) 3 gen ?small ?gen 2 bnf prec 1 bnfinit0 GD0,L,DGp 2 gen prec bnfisintnorm 1 1 bnfisintnorm GG 1 gen bnfisnorm 1 1 bnfisnorm GGD1,L, 1 gen bnfisprincipal 1 1 bnfisprincipal0 GGD1,L, 1 gen bnfissunit 1 1 bnfissunit GGG 1 gen bnfisunit 1 1 bnfisunit GG 1 gen bnfnarrow 1 1 buchnarrow G 1 gen bnfsignunit 1 1 signunits G 1 gen bnfsunit 1 1 bnfsunit GGp 2 gen prec bnrL1 1 1 bnrL1 GDGD0,L,p 2 gen prec bnrclassno 1 1 bnrclassno GG 1 gen bnrclassnolist 1 1 bnrclassnolist GG 1 gen bnrconductor 1 1 bnrconductor0 GDGDGD0,L, 1 gen bnrconductorofchar 1 1 bnrconductorofchar GG 1 gen bnrdisc 1 1 bnrdisc0 GDGDGD0,L, 1 gen bnrdisclist 1 1 bnrdisclist0 GGDG 1 gen bnrinit 2 0 1 bnrinit0(${1 code}, ${2 code}, ${3 code}) 3 gen gen ?small 1 bnr 1 bnrinit0 GGD0,L, 1 gen bnrisconductor 1 1 bnrisconductor0 GDGDG 1 small bnrisprincipal 1 1 bnrisprincipal GGD1,L, 1 gen bnrrootnumber 1 1 bnrrootnumber GGD0,L,p 2 gen prec bnrstark 1 1 bnrstark GDGp 2 gen prec break 1 1 break0 D1,L, 1 gen ceil 2 0 5 ${1 code} 1 small 2 small parens ${1 code} 1 int 3 int copy parens ceilr(${1 code}) 1 real 1 int mpceil(${1 code}) 1 mp 1 int gceil(${1 code}) 1 gen 1 gen 1 gceil G 1 gen centerlift 2 0 6 centerlift(${1 code}) 1 pol 1 pol centerlift(${1 code}) 1 vec 1 vec centerlift(${1 code}) 1 gen 1 gen centerlift0(${1 code}, ${2 code}) 2 pol var 1 pol centerlift0(${1 code}, ${2 code}) 2 vec var 1 vec centerlift0(${1 code}, ${2 code}) 2 gen var 1 gen 1 centerlift0 GDn 1 gen charpoly 1 1 charpoly0 GDnD3,L, 1 gen chinese 2 0 2 chinese1(${1 code}) 1 gen 1 gen chinese(${1 code}, ${2 code}) 2 gen gen 1 gen 1 chinese GDG 1 gen clone 1 0 8 ${1 code} 1 small 2 small parens gclone(${1 code}) 1 int 1 int gclone(${1 code}) 1 real 1 real gclone(${1 code}) 1 mp 1 mp gclone(${1 code}) 1 vecsmall 1 vecsmall gclone(${1 code}) 1 vec 1 vec gclone(${1 code}) 1 pol 1 pol gclone(${1 code}) 1 gen 1 gen component 1 1 compo GL 1 gen concat 2 0 8 concat(${1 code}, ${2 code}) 2 mp mp 1 vec concat(${1 code}, ${2 code}) 2 vec mp 1 vec concat(${1 code}, ${2 code}) 2 mp vec 1 vec concat(${1 code}, ${2 code}) 2 vec vec 1 vec concat(${1 code}, ${2 code}) 2 list list 1 list concat(${1 code}, ${2 code}) 2 genstr gen 1 genstr concat(${1 code}, ${2 code}) 2 gen genstr 1 genstr concat(${1 code}, ${2 code}) 2 gen ?gen 1 gen 1 concat GDG 1 gen conj 1 1 gconj G 1 gen conjvec 1 1 conjvec Gp 2 gen prec content 1 1 content G 1 gen contfrac 1 1 contfrac0 GDGD0,L, 1 gen contfracpnqn 1 1 pnqn G 1 gen copy 1 0 8 ${1 code} 1 small 2 small parens icopy(${1 code}) 1 int 1 int gcopy(${1 code}) 1 real 1 real gcopy(${1 code}) 1 mp 1 mp gcopy(${1 code}) 1 vecsmall 1 vecsmall gcopy(${1 code}) 1 vec 1 vec gcopy(${1 code}) 1 pol 1 pol gcopy(${1 code}) 1 gen 1 gen core 1 1 core0 GD0,L, 1 gen coredisc 1 1 coredisc0 GD0,L, 1 gen cos 1 1 gcos Gp 2 gen prec cosh 1 1 gch Gp 2 gen prec cotan 1 1 gcotan Gp 2 gen prec default 2 0 16 getrealprecision() 1 "realprecision" 2 small prec setrealprecision(${2 code}, &prec) 2 "realprecision" small 2 small prec precdl 1 "seriesprecision" 1 small precdl = ${2 code} 2 "seriesprecision" small 2 small parens DEBUGLEVEL 1 "debug" 1 small DEBUGLEVEL = ${2 code} 2 "debug" small 2 small parens DEBUGMEM 1 "debugmem" 1 small DEBUGMEM = ${2 code} 2 "debugmem" small 2 small parens DEBUGFILES 1 "debugfiles" 1 small DEBUGFILES = ${2 code} 2 "debugfiles" small 2 small parens factor_add_primes 1 "factor_add_primes" 1 small factor_add_primes = ${2 code} 2 "factor_add_primes" small 1 small factor_proven 1 "factor_proven" 1 small factor_proven = ${2 code} 2 "factor_proven" small 1 small new_galois_format 1 "new_galois_format" 1 small new_galois_format = ${2 code} 2 "new_galois_format" small 1 small 1 default0 DrDs 1 gen denominator 1 1 denom G 1 gen deriv 1 1 deriv GDn 1 gen derivnum 3 0 1 derivnum(${2 cookie}, ${2 wrapper}, ${1 code}, prec) 2 gen gen 2 gen prec 1 derivnum0 V=GEp 2 gen prec 2 2 _wrap_G diffop 2 0 2 diffop(${1 code}, ${2 code}, ${3 code}) 4 gen gen gen ?1 1 gen diffop0(${1 code}, ${2 code}, ${3 code}, ${4 code}) 4 gen gen gen small 1 gen 1 diffop0 GGGD1,L, 1 gen dilog 1 1 dilog Gp 2 gen prec dirdiv 1 1 dirdiv GG 1 gen direuler 3 0 1 direuler(${3 cookie}, ${3 wrapper}, ${1 code}, ${2 code}, ${4 code}) 4 gen gen gen ?gen 1 gen 1 direuler0 V=GGEDG 1 gen 2 3 _wrap_G dirmul 1 1 dirmul GG 1 gen dirzetak 1 1 dirzetak GG 1 gen divisors 2 0 1 divisors(${1 code}) 1 gen 1 vec 1 divisors G 1 gen divrem 1 1 divrem GGDn 1 gen eint1 1 1 veceint1 GDGp 2 gen prec ellL1 1 1 ellL1 GLp 2 gen prec elladd 1 1 addell GGG 1 gen ellak 1 1 akell GG 1 gen ellan 1 1 anell GL 1 gen ellanalyticrank 1 1 ellanalyticrank GDGp 2 gen prec ellap 1 1 ellap GDG 1 gen ellbil 1 1 bilhell GGGp 2 gen prec ellchangecurve 2 0 1 ellchangecurve(${1 code}, ${2 code}) 2 gen gen 1 ell 1 ellchangecurve GG 1 gen ellchangepoint 1 1 ellchangepoint GG 1 gen ellconvertname 1 1 ellconvertname G 1 gen elldivpol 1 1 elldivpol GLDn 1 gen elleisnum 1 1 elleisnum GLD0,L,p 2 gen prec elleta 1 1 elleta Gp 2 gen prec ellgenerators 1 1 ellgenerators G 1 gen ellglobalred 2 0 1 ellglobalred(${1 code}) 1 gen 1 gen 1 ellglobalred G 1 gen ellgroup 1 1 ellgroup GDG 1 gen ellheight 1 1 ellheight0 GGD2,L,p 2 gen prec ellheightmatrix 1 1 mathell GGp 2 gen prec ellidentify 1 1 ellidentify G 1 gen ellinit 2 0 3 ellinit(${1 code}, prec) 2 gen ?0 2 bell prec smallellinit(${1 code}) 2 gen 1 1 ell ellinit0(${1 code}, ${2 code}, prec) 2 gen small 2 ell prec 1 ellinit0 GD0,L,p 2 gen prec ellisoncurve 1 1 ellisoncurve GG 1 gen ellj 1 1 jell Gp 2 gen prec elllocalred 1 1 elllocalred GG 1 gen elllog 1 1 elllog GGGDG 1 gen elllseries 1 1 elllseries GGDGp 2 gen prec ellminimalmodel 1 1 ellminimalmodel GD& 1 gen ellmodulareqn 1 1 ellmodulareqn LDnDn 1 gen ellorder 1 1 ellorder GGDG 1 gen ellordinate 1 1 ellordinate GGp 2 gen prec ellpointtoz 1 1 zell GGp 2 gen prec ellpow 1 1 powell GGG 1 gen ellrootno 1 1 ellrootno GDG 1 small ellsearch 1 1 ellsearch G 1 gen ellsigma 1 1 ellsigma GGD0,L,p 2 gen prec ellsub 1 1 subell GGG 1 gen elltaniyama 1 1 elltaniyama GDP 1 gen elltatepairing 1 1 elltatepairing GGGG 1 gen elltors 1 1 elltors0 GD0,L, 1 gen ellweilpairing 1 1 ellweilpairing GGGG 1 gen ellwp 1 1 ellwp0 GDGD0,L,DPp 2 gen prec ellzeta 1 1 ellzeta GGp 2 gen prec ellztopoint 1 1 pointell GGp 2 gen prec erfc 1 1 gerfc Gp 2 gen prec error 2 0 1 pari_err(talker, "${2 format_string}"${2 format_args}) 2 ?gen ... 1 void 1 error0 s* 1 void eta 1 1 eta0 GD0,L,p 2 gen prec eulerphi 2 0 2 eulerphi(${1 code}) 1 int 1 int geulerphi(${1 code}) 1 gen 1 gen 1 geulerphi G 1 gen eval 2 0 1 geval(${1 code}) 1 gen 1 gen 1 geval_gp GC 1 gen exp 2 0 3 mpexp(${1 code}) 1 real 1 real gexp(${1 code}, prec) 1 mp 2 mp prec gexp(${1 code}, prec) 1 gen 2 gen prec 1 gexp Gp 2 gen prec extern 1 1 extern0 s 1 gen externstr 1 1 externstr s 1 gen factor 2 0 3 Z_factor(${1 code}) 2 int ?-1 1 vec factor(${1 code}) 2 gen ?-1 1 vec factor0(${1 code}, ${2 code}) 2 gen small 1 vec 1 gp_factor0 GDG 1 gen factorback 2 0 3 factorback(${1 code}) 1 gen 1 gen factorback(${1 code}) 2 gen 1 gen factorback2(${1 code}, ${2 code}) 2 gen gen 1 gen 1 factorback2 GDG 1 gen factorcantor 1 1 factcantor GG 1 gen factorff 1 1 factorff GDGDG 1 gen factorial 1 1 mpfactr Lp 2 gen prec factorint 1 1 factorint GD0,L, 1 gen factormod 1 1 factormod0 GGD0,L, 1 gen factornf 1 1 polfnf GG 1 gen factorpadic 1 1 factorpadic0 GGLD0,L, 1 gen ffgen 1 1 ffgen GDn 1 gen ffinit 2 0 1 ffinit(${1 code}, ${2 code}, ${3 code}) 3 int small ?var 1 pol 1 ffinit GLDn 1 gen fflog 1 1 fflog GGDG 1 gen fforder 1 1 fforder GDG 1 gen ffprimroot 1 1 ffprimroot GD& 1 gen fibonacci 1 1 fibo L 1 gen floor 2 0 5 ${1 code} 1 small 2 small parens ${1 code} 1 int 3 int copy parens floorr(${1 code}) 1 real 1 int mpfloor(${1 code}) 1 mp 1 int gfloor(${1 code}) 1 gen 1 gen 1 gfloor G 1 gen for 1 1 forpari V=GGI 1 void fordiv 1 1 fordiv GVI 1 void forell 3 0 1 forell(${4 cookie}, ${4 wrapper}, ${2 code}, ${3 code}) 4 small small closure 1 void 1 forell0 VLLI 1 void 2 4 _wrap_vG forprime 1 1 forprime V=GGI 1 void forstep 1 1 forstep V=GGGI 1 void forsubgroup 3 0 1 forsubgroup(${3 cookie}, ${3 wrapper}, ${1 code}, ${2 code}) 3 gen ?gen closure 1 void 1 forsubgroup0 V=GDGI 1 void 2 3 _wrap_vG forvec 1 1 forvec V=GID0,L, 1 void frac 1 1 gfrac G 1 gen galoisexport 1 1 galoisexport GD0,L, 1 gen galoisfixedfield 2 0 1 galoisfixedfield(${1 code}, ${2 code}, ${3 code}, ${4 code}) 4 gen gen ?small ?var 1 vec 1 galoisfixedfield GGD0,L,Dn 1 gen galoisgetpol 2 0 4 galoisnbpol(${1 code}) 1 small 1 int galoisnbpol(${1 code}) 2 small 1 int galoisnbpol(${1 code}) 3 small 1 int galoisgetpol(${1 code}, ${2 code} ,${3 code}) 3 small small small 1 vec 1 galoisgetpol LD0,L,D1,L, 1 gen galoisidentify 1 1 galoisidentify G 1 gen galoisinit 2 0 1 galoisinit(${1 code}, ${2 code}) 2 gen ?int 1 gal 1 galoisinit GDG 1 gen galoisisabelian 1 1 galoisisabelian GD0,L, 1 gen galoisisnormal 1 1 galoisisnormal GG 1 small galoispermtopol 1 1 galoispermtopol GG 1 gen galoissubcyclo 1 1 galoissubcyclo GDGD0,L,Dn 1 gen galoissubfields 1 1 galoissubfields GD0,L,Dn 1 gen galoissubgroups 1 1 galoissubgroups G 1 gen gamma 1 1 ggamma Gp 2 gen prec gammah 1 1 ggamd Gp 2 gen prec gcd 2 0 4 cgcd(${1 code}, ${2 code}) 2 small small 1 small gcdii(${1 code}, ${2 code}) 2 int int 1 int content(${1 code}) 1 gen 1 gen ggcd(${1 code}, ${2 code}) 2 gen gen 1 gen 1 ggcd0 GDG 1 gen getheap 1 1 getheap 1 gen getrand 1 1 getrand 1 gen getstack 1 1 getstack 1 small gettime 1 1 gettime 1 small global 0 hilbert 1 1 hilbert GGDG 1 small hyperu 1 1 hyperu GGGp 2 gen prec idealadd 1 1 idealadd GGG 1 gen idealaddtoone 1 1 idealaddtoone0 GGDG 1 gen idealappr 1 1 idealappr0 GGD0,L, 1 gen idealchinese 1 1 idealchinese GGG 1 gen idealcoprime 1 1 idealcoprime GGG 1 gen idealdiv 2 0 4 idealdiv(${1 code}, ${2 code}, ${3 code}) 4 gen gen gen ?0 1 gen idealdivexact(${1 code}, ${2 code}, ${3 code}) 4 gen gen gen 1 1 gen $"invalid flag in idealdiv" 4 gen gen gen #small 1 gen idealdiv0(${1 code}, ${2 code}, ${3 code}, ${4 code}) 4 gen gen gen small 1 gen 1 idealdiv0 GGGD0,L, 1 gen idealfactor 1 1 idealfactor GG 1 gen idealfactorback 1 1 idealfactorback GGDGD0,L, 1 gen idealfrobenius 1 1 idealfrobenius GGG 1 gen idealhnf 1 1 idealhnf0 GGDG 1 gen idealintersect 1 1 idealintersect GGG 1 gen idealinv 2 0 1 idealinv(${1 code}, ${2 code}) 2 gen gen 1 gen 1 idealinv GG 1 gen ideallist 1 1 ideallist0 GLD4,L, 1 gen ideallistarch 1 1 ideallistarch GGG 1 gen ideallog 1 1 ideallog GGG 1 gen idealmin 1 1 idealmin GGDG 1 gen idealmul 2 0 4 idealmul(${1 code}, ${2 code}, ${3 code}) 4 gen gen gen ?0 1 gen idealmulred(${1 code}, ${2 code}, ${3 code}) 4 gen gen gen 1 1 gen $"invalid flag in idealmul" 4 gen gen gen #small 1 gen idealmul0(${1 code}, ${2 code}, ${3 code}, ${4 code}) 4 gen gen gen small 1 gen 1 idealmul0 GGGD0,L, 1 gen idealnorm 1 1 idealnorm GG 1 gen idealpow 1 1 idealpow0 GGGD0,L, 1 gen idealprimedec 1 1 idealprimedec GG 1 gen idealramgroups 1 1 idealramgroups GGG 1 gen idealred 1 1 idealred0 GGDG 1 gen idealstar 1 1 idealstar0 GGD1,L, 1 gen idealtwoelt 1 1 idealtwoelt0 GGDG 1 gen idealval 1 1 idealval GGG 1 small if 1 1 ifpari GDEDE 1 gen imag 1 1 gimag G 1 gen incgam 1 1 incgam0 GGDGp 2 gen prec incgamc 1 1 incgamc GGp 2 gen prec input 1 1 input0 1 gen install 1 1 gpinstall rrD"",r,D"",s, 1 void intcirc 3 0 1 intcirc(${3 cookie}, ${3 wrapper}, ${1 code}, ${2 code}, ${4 code}, prec) 4 gen gen gen ?gen 2 gen prec 1 intcirc0 V=GGEDGp 2 gen prec 2 3 _wrap_G intformal 1 1 integ GDn 1 gen intfouriercos 3 0 1 intfouriercos(${4 cookie}, ${4 wrapper}, ${1 code}, ${2 code}, ${3 code}, ${5 code}, prec) 5 gen gen gen gen ?gen 2 gen prec 1 intfourcos0 V=GGGEDGp 2 gen prec 2 4 _wrap_G intfourierexp 3 0 1 intfourierexp(${4 cookie}, ${4 wrapper}, ${1 code}, ${2 code}, ${3 code}, ${5 code}, prec) 5 gen gen gen gen ?gen 2 gen prec 1 intfourexp0 V=GGGEDGp 2 gen prec 2 4 _wrap_G intfouriersin 3 0 1 intfouriercos(${4 cookie}, ${4 wrapper}, ${1 code}, ${2 code}, ${3 code}, ${5 code}, prec) 5 gen gen gen gen ?gen 2 gen prec 1 intfoursin0 V=GGGEDGp 2 gen prec 2 4 _wrap_G intfuncinit 3 0 1 intfuncinit(${3 cookie}, ${3 wrapper}, ${1 code}, ${2 code}, ${4 code}, ${5 code}, prec) 5 gen gen gen ?small ?small 2 gen prec 1 intfuncinit0 V=GGED0,L,D0,L,p 2 gen prec 2 3 _wrap_G intlaplaceinv 3 0 1 intlaplaceinv(${3 cookie}, ${3 wrapper}, ${1 code}, ${2 code}, ${4 code}, prec) 4 gen gen gen ?gen 2 gen prec 1 intlaplaceinv0 V=GGEDGp 2 gen prec 2 3 _wrap_G intmellininv 3 0 1 intmellininv(${3 cookie}, ${3 wrapper}, ${1 code}, ${2 code}, ${4 code}, prec) 4 gen gen gen ?gen 2 gen prec 1 intmellininv0 V=GGEDGp 2 gen prec 2 3 _wrap_G intmellininvshort 1 1 intmellininvshort GGGp 2 gen prec intnum 3 0 1 intnum(${3 cookie}, ${3 wrapper}, ${1 code}, ${2 code}, ${4 code}, prec) 4 gen gen gen ?gen 2 gen prec 1 intnum0 V=GGEDGp 2 gen prec 2 3 _wrap_G intnuminit 1 1 intnuminit GGD0,L,p 2 gen prec intnuminitgen 1 1 intnuminitgen0 VGGED0,L,D0,L,p 2 gen prec intnumromb 3 0 1 intnumromb(${3 cookie}, ${3 wrapper}, ${1 code}, ${2 code}, ${4 code}, prec) 4 gen gen gen ?small 2 gen prec 1 intnumromb0 V=GGED0,L,p 2 gen prec 2 3 _wrap_G intnumstep 1 1 intnumstep p 2 small prec isfundamental 2 0 2 Z_isfundamental(${1 code}) 1 int 1 bool gisfundamental(${1 code}) 1 gen 1 gen 1 gisfundamental G 1 gen ispower 2 0 2 Z_isanypower(${1 code}, NULL) 1 int 1 small Z_isanypower(${1 code}, &${2 code}) 2 int &int 1 small 1 ispower GDGD& 1 small isprime 2 0 4 isprime(${1 code}) 2 int ?0 1 bool plisprime(${1 code}, 0) 2 int 1 1 bool plisprime(${1 code}, 1) 2 int 2 1 gen gisprime(${1 code}, ${2 code}) 2 gen ?small 1 gen 1 gisprime GD0,L, 1 gen ispseudoprime 2 0 4 BPSW_psp(${1 code}) 2 int ?0 1 bool millerrabin(${1 code},${2 code}) 2 int #small 1 bool ispseudoprime(${1 code}, ${2 code}) 2 int small 1 bool gispseudoprime(${1 code}, ${2 code}) 2 gen ?small 1 bool 1 gispseudoprime GD0,L, 1 gen issquare 2 0 5 Z_issquare(${1 code}) 1 int 1 bool gissquare(${1 code}) 1 mp 1 int gissquare(${1 code}) 1 gen 1 gen Z_issquarerem(${1 code}, &${2 code}) 2 int &int 1 bool gissquareall(${1 code}, &${2 code}) 2 gen &gen 1 gen 1 gissquareall GD& 1 gen issquarefree 2 0 2 issquarefree(${1 code}) 1 int 1 bool gissquarefree(${1 code}) 1 gen 1 gen 1 gissquarefree G 1 gen kill 1 1 kill0 r 1 void kronecker 2 0 5 kross(${1 code}, ${2 code}) 2 small small 1 small krois(${1 code}, ${2 code}) 2 int small 1 small krosi(${1 code}, ${2 code}) 2 small int 1 small kronecker(${1 code}, ${2 code}) 2 int int 1 small gkronecker(${1 code}, ${2 code}) 2 gen gen 1 gen 1 gkronecker GG 1 gen lcm 2 0 3 lcmii(${1 code}, ${2 code}) 2 int int 1 int glcm0(${1 code}, NULL) 1 gen 1 gen glcm(${1 code}, ${2 code}) 2 gen gen 1 gen 1 glcm0 GDG 1 gen length 2 0 4 lg(${1 code}) 1 vecsmall 1 lg lg(${1 code}) 1 vec 1 lg lgpol(${1 code}) 1 pol 1 small glength(${1 code}) 1 gen 1 small 1 glength G 1 small lex 1 1 lexcmp GG 1 small_int lift 2 0 6 lift(${1 code}) 1 pol 1 pol lift(${1 code}) 1 vec 1 vec lift(${1 code}) 1 gen 1 gen lift0(${1 code}, ${2 code}) 2 pol var 1 pol lift0(${1 code}, ${2 code}) 2 vec var 1 vec lift0(${1 code}, ${2 code}) 2 gen var 1 gen 1 lift0 GDn 1 gen lindep 1 1 lindep0 GD0,L, 1 gen listcreate 2 0 1 listcreate() 1 ?gen 1 list 1 listcreate D0,L, 1 gen listinsert 2 0 1 listinsert(${1 code}, ${2 code}, ${3 code}) 3 list gen small 1 gen 1 listinsert WGL 1 gen listkill 1 1 listkill G 1 void listpop 2 0 1 listpop(${1 code}, ${2 code}) 2 list small 1 void 1 listpop WD0,L, 1 void listput 2 0 1 listput(${1 code}, ${2 code}, ${3 code}) 3 list gen small 1 gen 1 listput WGD0,L, 1 gen listsort 1 1 listsort WD0,L, 1 void lngamma 1 1 glngamma Gp 2 gen prec local 0 log 2 0 1 glog(${1 code}, prec) 1 gen 2 gen prec 1 glog Gp 2 gen prec matadjoint 1 1 matadjoint0 GD0,L, 1 gen matalgtobasis 1 1 matalgtobasis GG 1 gen matbasistoalg 1 1 matbasistoalg GG 1 gen matcompanion 1 1 matcompanion G 1 gen matdet 2 0 4 det(${1 code}) 2 gen ?0 1 gen det2(${1 code}) 2 gen 1 1 gen $"incorrect flag in matdet" 2 gen #small 1 gen det0(${1 code}, ${2 code}) 2 gen small 1 gen 1 det0 GD0,L, 1 gen matdetint 1 1 detint G 1 gen matdiagonal 1 1 diagonal G 1 gen mateigen 1 1 eigen Gp 2 gen prec matfrobenius 1 1 matfrobenius GD0,L,Dn 1 gen mathess 1 1 hess G 1 gen mathilbert 1 1 mathilbert L 1 gen mathnf 1 1 mathnf0 GD0,L, 1 gen mathnfmod 1 1 hnfmod GG 1 gen mathnfmodid 1 1 hnfmodid GG 1 gen matid 2 0 1 matid(${1 code}) 1 small 1 vec 1 matid L 1 gen matimage 1 1 matimage0 GD0,L, 1 gen matimagecompl 1 1 imagecompl G 1 gen matindexrank 1 1 indexrank G 1 gen matintersect 1 1 intersect GG 1 gen matinverseimage 1 1 inverseimage GG 1 gen matisdiagonal 1 1 isdiagonal G 1 small_int matker 1 1 matker0 GD0,L, 1 gen matkerint 1 1 matkerint0 GD0,L, 1 gen matmuldiagonal 1 1 matmuldiagonal GG 1 gen matmultodiagonal 1 1 matmultodiagonal GG 1 gen matpascal 1 1 matqpascal LDG 1 gen matrank 1 1 rank G 1 small matrix 1 1 matrice GGDVDVDE 1 gen matrixqz 1 1 matrixqz0 GDG 1 gen matsize 1 1 matsize G 1 gen matsnf 1 1 matsnf0 GD0,L, 1 gen matsolve 1 1 gauss GG 1 gen matsolvemod 1 1 matsolvemod0 GGGD0,L, 1 gen matsupplement 1 1 suppl G 1 gen mattranspose 1 1 gtrans G 1 gen max 2 0 10 maxss(${1 code}, ${2 code}) 2 small small 1 small gmaxsg(${1 code}, ${2 code}) 2 small int 1 int gmaxgs(${1 code}, ${2 code}) 2 int small 1 int gmax(${1 code}, ${2 code}) 2 int int 1 int gmaxsg(${1 code}, ${2 code}) 2 small mp 1 mp gmaxgs(${1 code}, ${2 code}) 2 mp small 1 mp gmax(${1 code}, ${2 code}) 2 mp mp 1 mp gmaxsg(${1 code}, ${2 code}) 2 small gen 1 gen gmaxgs(${1 code}, ${2 code}) 2 gen small 1 gen gmax(${1 code}, ${2 code}) 2 gen gen 1 gen 1 gmax GG 1 gen min 2 0 10 minss(${1 code}, ${2 code}) 2 small small 1 small gminsg(${1 code}, ${2 code}) 2 small int 1 int gmings(${1 code}, ${2 code}) 2 int small 1 int gmin(${1 code}, ${2 code}) 2 int int 1 int gminsg(${1 code}, ${2 code}) 2 small mp 1 mp gmings(${1 code}, ${2 code}) 2 mp small 1 mp gmin(${1 code}, ${2 code}) 2 mp mp 1 mp gminsg(${1 code}, ${2 code}) 2 small gen 1 gen gmings(${1 code}, ${2 code}) 2 gen small 1 gen gmin(${1 code}, ${2 code}) 2 gen gen 1 gen 1 gmin GG 1 gen minpoly 1 1 minpoly GDn 1 gen modreverse 1 1 modreverse G 1 gen moebius 2 0 2 moebius(${1 code}) 1 int 1 small gmoebius(${1 code}) 1 gen 1 gen 1 gmoebius G 1 gen my 0 newtonpoly 1 1 newtonpoly GG 1 gen next 1 1 next0 D1,L, 1 gen nextprime 2 0 2 nextprime(${1 code}) 1 int 1 int gnextprime(${1 code}) 1 gen 1 gen 1 gnextprime G 1 gen nfalgtobasis 1 1 algtobasis GG 1 gen nfbasis 1 1 nfbasis0 GD0,L,DG 1 gen nfbasistoalg 1 1 basistoalg GG 1 gen nfdetint 1 1 nfdetint GG 1 gen nfdisc 1 1 nfdisc0 GD0,L,DG 1 gen nfeltadd 1 1 nfadd GGG 1 gen nfeltdiv 1 1 nfdiv GGG 1 gen nfeltdiveuc 1 1 nfdiveuc GGG 1 gen nfeltdivmodpr 1 1 nfdivmodpr GGGG 1 gen nfeltdivrem 1 1 nfdivrem GGG 1 gen nfeltmod 1 1 nfmod GGG 1 gen nfeltmul 1 1 nfmul GGG 1 gen nfeltmulmodpr 1 1 nfmulmodpr GGGG 1 gen nfeltnorm 1 1 nfnorm GG 1 gen nfeltpow 1 1 nfpow GGG 1 gen nfeltpowmodpr 1 1 nfpowmodpr GGGG 1 gen nfeltreduce 1 1 nfreduce GGG 1 gen nfeltreducemodpr 1 1 nfreducemodpr GGG 1 gen nfelttrace 1 1 nftrace GG 1 gen nfeltval 1 1 nfval GGG 1 small nffactor 1 1 nffactor GG 1 gen nffactorback 1 1 nffactorback GGDG 1 gen nffactormod 1 1 nffactormod GGG 1 gen nfgaloisapply 1 1 galoisapply GGG 1 gen nfgaloisconj 1 1 galoisconj0 GD0,L,DGp 2 gen prec nfhilbert 1 1 nfhilbert0 GGGDG 1 small nfhnf 1 1 nfhnf GG 1 gen nfhnfmod 1 1 nfhnfmod GGG 1 gen nfinit 2 0 8 nfinit0(${1 code}, 0, prec) 2 gen ?0 2 nf prec nfinit0(${1 code}, 1, prec) 2 gen 1 2 nf prec nfinit0(${1 code}, 2, prec) 2 gen 2 2 nf prec nfinit0(${1 code}, 3, prec) 2 gen 3 2 gen prec nfinit0(${1 code}, 4, prec) 2 gen 4 2 nf prec nfinit0(${1 code}, 5, prec) 2 gen 5 2 gen prec $"incorrect flag in nfinit" 2 gen #small 1 void nfinit0(${1 code}, ${2 code}, prec) 2 gen small 2 gen prec 1 nfinit0 GD0,L,p 2 gen prec nfisideal 1 1 isideal GG 1 small nfisincl 1 1 nfisincl GG 1 gen nfisisom 1 1 nfisisom GG 1 gen nfkermodpr 1 1 nfkermodpr GGG 1 gen nfmodprinit 1 1 nfmodprinit GG 1 gen nfnewprec 1 1 nfnewprec Gp 2 gen prec nfroots 1 1 nfroots DGG 1 gen nfrootsof1 1 1 rootsof1 G 1 gen nfsnf 1 1 nfsnf GG 1 gen nfsolvemodpr 1 1 nfsolvemodpr GGGG 1 gen nfsubfields 1 1 nfsubfields GD0,L, 1 gen norm 1 1 gnorm G 1 gen norml2 1 1 gnorml2 G 1 gen numbpart 1 1 numbpart G 1 gen numdiv 2 0 2 numbdiv(${1 code}) 1 int 1 int gnumbdiv(${1 code}) 1 gen 1 gen 1 gnumbdiv G 1 gen numerator 1 1 numer G 1 gen numtoperm 1 1 numtoperm LG 1 gen omega 2 0 2 omega(${1 code}) 1 int 1 small gomega(${1 code}) 1 gen 1 gen 1 gomega G 1 gen padicappr 1 1 padicappr GG 1 gen padicfields 1 1 padicfields0 GGD0,L, 1 gen padicprec 1 1 padicprec GG 1 small partitions 1 1 partitions LD0,L, 1 gen permtonum 1 1 permtonum G 1 gen plot 1 1 plot V=GGEDGDGp 2 void prec plotbox 1 1 rectbox LGG 1 void plotclip 1 1 rectclip L 1 void plotcolor 1 1 rectcolor LL 1 void plotcopy 1 1 rectcopy_gen LLGGD0,L, 1 void plotcursor 1 1 rectcursor L 1 gen plotdraw 1 1 rectdraw_flag GD0,L, 1 void ploth 1 1 ploth V=GGEpD0,M,D0,L,\nParametric|1; Recursive|2; no_Rescale|4; no_X_axis|8; no_Y_axis|16; no_Frame|32; no_Lines|64; Points_too|128; Splines|256; no_X_ticks|512; no_Y_ticks|1024; Same_ticks|2048; Complex|4096 2 gen prec plothraw 1 1 plothraw GGD0,L, 1 gen plothsizes 1 1 plothsizes_flag D0,L, 1 gen plotinit 1 1 initrect_gen LDGDGD0,L, 1 void plotkill 1 1 killrect L 1 void plotlines 1 1 rectlines LGGD0,L, 1 void plotlinetype 1 1 rectlinetype LL 1 void plotmove 1 1 rectmove LGG 1 void plotpoints 1 1 rectpoints LGG 1 void plotpointsize 1 1 rectpointsize LG 1 void plotpointtype 1 1 rectpointtype LL 1 void plotrbox 1 1 rectrbox LGG 1 void plotrecth 1 1 rectploth LV=GGEpD0,M,D0,L,\nParametric|1; Recursive|2; no_Rescale|4; no_X_axis|8; no_Y_axis|16; no_Frame|32; no_Lines|64; Points_too|128; Splines|256; no_X_ticks|512; no_Y_ticks|1024; Same_ticks|2048; Complex|4096 2 gen prec plotrecthraw 1 1 rectplothraw LGD0,L, 1 gen plotrline 1 1 rectrline LGG 1 void plotrmove 1 1 rectrmove LGG 1 void plotrpoint 1 1 rectrpoint LGG 1 void plotscale 1 1 rectscale LGGGG 1 void plotstring 1 1 rectstring3 LsD0,L, 1 void polchebyshev 2 0 3 polchebyshev1(${1 code},${3 code}) 3 small ?1 ?var 1 gen polchebyshev2(${1 code},${3 code}) 3 small 2 ?var 1 gen polchebyshev(${1 code},${2 code},${3 code}) 3 small small ?var 1 gen 1 polchebyshev_eval LD1,L,DG 1 gen polcoeff 2 0 2 constant_term(${1 code}) 2 pol 0 2 gen copy polcoeff0(${1 code}, ${2 code}, ${3 code}) 3 gen small ?var 1 gen 1 polcoeff0 GLDn 1 gen polcompositum 1 1 polcompositum0 GGD0,L, 1 gen polcyclo 2 0 2 polcyclo(${1 code},${2 code}) 2 small ?var 1 gen polcyclo_eval(${1 code},${2 code}) 2 small gen 1 gen 1 polcyclo_eval LDG 1 gen poldegree 2 0 3 degpol(${1 code}) 1 pol 1 small degree(${1 code}) 1 gen 1 small poldegree(${1 code}, ${2 code}) 2 gen var 1 small 1 poldegree GDn 1 small poldisc 2 0 3 discsr(${1 code}) 1 pol 1 gen poldisc0(${1 code}, -1) 1 gen 1 gen poldisc0(${1 code}, ${2 code}) 2 gen var 1 gen 1 poldisc0 GDn 1 gen poldiscreduced 1 1 reduceddiscsmith G 1 gen polgalois 1 1 polgalois Gp 2 gen prec polhensellift 1 1 polhensellift GGGL 1 gen polhermite 2 0 2 polhermite(${1 code},${2 code}) 2 small ?var 1 gen polhermite_eval(${1 code},${2 code}) 2 small gen 1 gen 1 polhermite_eval LDG 1 gen polinterpolate 1 1 polint GDGDGD& 1 gen polisirreducible 1 1 gisirreducible G 1 gen pollead 2 0 3 leading_term(${1 code}) 1 pol 2 gen copy pollead(${1 code}, -1) 1 gen 1 gen pollead(${1 code}, ${2 code}) 2 gen var 1 gen 1 pollead GDn 1 gen pollegendre 2 0 2 pollegendre(${1 code},${2 code}) 2 small ?var 1 gen pollegendre_eval(${1 code},${2 code}) 2 small gen 1 gen 1 pollegendre_eval LDG 1 gen polrecip 1 1 polrecip G 1 gen polred 1 1 polred0 GD0,L,DG 1 gen polredabs 1 1 polredabs0 GD0,L, 1 gen polredord 1 1 ordred G 1 gen polresultant 1 1 polresultant0 GGDnD0,L, 1 gen polroots 1 1 roots0 GD0,L,p 2 gen prec polrootsff 1 1 polrootsff GDGDG 1 gen polrootsmod 2 0 4 rootmod(${1 code}, ${2 code}) 3 pol int ?0 1 vec rootmod2(${1 code}, ${2 code}) 3 pol int 1 1 vec $"Bad flag in polrootsmod" 3 pol int #small 1 vec rootmod0(${1 code}, ${2 code}, ${3 code}) 3 pol int small 1 vec 1 rootmod0 GGD0,L, 1 gen polrootspadic 1 1 rootpadic GGL 1 gen polsturm 1 1 sturmpart GDGDG 1 small polsubcyclo 1 1 polsubcyclo LLDn 1 gen polsylvestermatrix 1 1 sylvestermatrix GG 1 gen polsym 1 1 polsym GL 1 gen poltchebi 1 1 polchebyshev1 LDn 1 gen poltschirnhaus 1 1 tschirnhaus G 1 gen polylog 1 1 polylog0 LGD0,L,p 2 gen prec polzagier 1 1 polzag LL 1 gen precision 2 0 8 prec2ndec(gprecision(${1 code})) 1 real 1 small precision0(${1 code}, 0) 1 gen 1 int prec2ndec(gprecision(${1 code})) 2 real 0 1 small precision0(${1 code}, 0) 2 gen 0 1 int rtor(${1 code}, ndec2prec(${2 code})) 2 real #small 1 real gprec(${1 code}, ${2 code}) 2 gen #small 1 gen precision0(${1 code}, ${2 code}) 2 real small 1 real precision0(${1 code}, ${2 code}) 2 gen small 1 gen 1 precision0 GD0,L, 1 gen precprime 2 0 2 precprime(${1 code}) 1 int 1 int gprecprime(${1 code}) 1 gen 1 gen 1 gprecprime G 1 gen prime 1 1 prime L 1 gen primepi 2 0 1 primepi(${1 code}) 1 gen 1 int 1 primepi G 1 gen primes 1 1 primes L 1 gen print 2 0 1 pari_printf("${2 format_string}\n"${2 format_args}) 2 ?gen ... 1 void 1 print s* 1 void print1 2 0 1 pari_printf("${2 format_string}"${2 format_args}) 2 ?gen ... 1 void 1 print1 s* 1 void printf 1 1 printf0 ss* 1 void printtex 1 1 printtex s* 1 void prod 1 1 produit V=GGEDG 1 gen prodeuler 1 1 prodeuler0 V=GGEp 2 gen prec prodinf 3 0 1 prodinf(${2 cookie}, ${2 wrapper}, ${1 code}, ${3 code}, prec) 3 gen gen ?small 2 gen prec 1 prodinf0 V=GED0,L,p 2 gen prec 2 2 _wrap_G psdraw 1 1 postdraw_flag GD0,L, 1 void psi 1 1 gpsi Gp 2 gen prec psploth 1 1 postploth V=GGEpD0,L,D0,L, 2 gen prec psplothraw 1 1 postplothraw GGD0,L, 1 gen qfbclassno 1 1 qfbclassno0 GD0,L, 1 gen qfbcompraw 1 1 qfbcompraw GG 1 gen qfbhclassno 1 1 hclassno G 1 gen qfbnucomp 1 1 nucomp GGG 1 gen qfbnupow 1 1 nupow GG 1 gen qfbpowraw 1 1 qfbpowraw GL 1 gen qfbprimeform 1 1 primeform GGp 2 gen prec qfbred 1 1 qfbred0 GD0,L,DGDGDG 1 gen qfbsolve 1 1 qfbsolve GG 1 gen qfgaussred 1 1 qfgaussred G 1 gen qfjacobi 1 1 jacobi Gp 2 gen prec qflll 2 0 8 lll(${1 code}) 2 vec ?0 1 vec lllint(${1 code}) 2 vec 1 1 vec lllintpartial(${1 code}) 2 vec 2 1 vec lllkerim(${1 code}) 2 vec 4 1 vec lllkerimgen(${1 code}) 2 vec 5 1 vec lllgen(${1 code}) 2 vec 8 1 vec $"Bad flag in qflll" 2 vec #small 1 vec qflll0(${1 code}, ${2 code}) 2 vec small 1 vec 1 qflll0 GD0,L, 1 gen qflllgram 1 1 qflllgram0 GD0,L, 1 gen qfminim 1 1 qfminim0 GDGDGD0,L,p 2 gen prec qfperfection 1 1 perf G 1 gen qfrep 1 1 qfrep0 GGD0,L, 1 gen qfsign 1 1 qfsign G 1 gen quadclassunit 1 1 quadclassunit0 GD0,L,DGp 2 gen prec quaddisc 1 1 quaddisc G 1 gen quadgen 1 1 quadgen G 1 gen quadhilbert 1 1 quadhilbert Gp 2 gen prec quadpoly 1 1 quadpoly0 GDn 1 gen quadray 1 1 quadray GGp 2 gen prec quadregulator 1 1 quadregulator Gp 2 gen prec quadunit 1 1 quadunit G 1 gen quit 1 1 gp_quit D0,L, 1 void random 1 1 genrand DG 1 gen read 2 0 1 gp_read_file(${1 code}) 1 str 1 gen 1 read0 D"",s, 1 gen readvec 2 0 1 gp_readvec_file(${1 code}) 1 str 1 gen 1 gp_readvec_file D"",s, 1 gen real 1 1 greal G 1 gen removeprimes 1 1 removeprimes DG 1 gen return 1 1 return0 DG 1 gen rnfalgtobasis 1 1 rnfalgtobasis GG 1 gen rnfbasis 1 1 rnfbasis GG 1 gen rnfbasistoalg 1 1 rnfbasistoalg GG 1 gen rnfcharpoly 1 1 rnfcharpoly GGGDn 1 gen rnfconductor 1 1 rnfconductor GGD0,L, 1 gen rnfdedekind 1 1 rnfdedekind GGDGD0,L, 1 gen rnfdet 1 1 rnfdet GG 1 gen rnfdisc 1 1 rnfdiscf GG 1 gen rnfeltabstorel 1 1 rnfelementabstorel GG 1 gen rnfeltdown 1 1 rnfelementdown GG 1 gen rnfeltreltoabs 1 1 rnfelementreltoabs GG 1 gen rnfeltup 1 1 rnfelementup GG 1 gen rnfequation 1 1 rnfequation0 GGD0,L, 1 gen rnfhnfbasis 1 1 rnfhnfbasis GG 1 gen rnfidealabstorel 1 1 rnfidealabstorel GG 1 gen rnfidealdown 1 1 rnfidealdown GG 1 gen rnfidealhnf 1 1 rnfidealhermite GG 1 gen rnfidealmul 1 1 rnfidealmul GGG 1 gen rnfidealnormabs 1 1 rnfidealnormabs GG 1 gen rnfidealnormrel 1 1 rnfidealnormrel GG 1 gen rnfidealreltoabs 1 1 rnfidealreltoabs GG 1 gen rnfidealtwoelt 1 1 rnfidealtwoelement GG 1 gen rnfidealup 1 1 rnfidealup GG 1 gen rnfinit 1 1 rnfinit GG 1 gen rnfisabelian 1 1 rnfisabelian GG 1 small rnfisfree 1 1 rnfisfree GG 1 small rnfisnorm 1 1 rnfisnorm GGD0,L, 1 gen rnfisnorminit 1 1 rnfisnorminit GGD2,L, 1 gen rnfkummer 1 1 rnfkummer GDGD0,L,p 2 gen prec rnflllgram 1 1 rnflllgram GGGp 2 gen prec rnfnormgroup 1 1 rnfnormgroup GG 1 gen rnfpolred 1 1 rnfpolred GGp 2 gen prec rnfpolredabs 1 1 rnfpolredabs GGD0,L, 1 gen rnfpseudobasis 1 1 rnfpseudobasis GG 1 gen rnfsteinitz 1 1 rnfsteinitz GG 1 gen round 2 0 9 ${1 code} 1 small 2 small parens ${1 code} 1 int 3 int copy parens roundr(${1 code}) 1 real 1 int mpround(${1 code}) 1 mp 1 int grndtoi(${1 code}, &${2 code}) 2 mp &small 1 int round0(${1 code}, &${2 code}) 2 mp &int 1 int ground(${1 code}) 1 gen 1 gen grndtoi(${1 code}, &${2 code}) 2 gen &small 1 gen round0(${1 code}, &${2 code}) 2 gen &int 1 gen 1 round0 GD& 1 gen select 3 0 1 genselect(${1 cookie}, ${1 wrapper}, ${2 code}) 2 gen gen 1 gen 1 select0 GG 1 gen 2 1 _wrap_bG serconvol 1 1 convol GG 1 gen serlaplace 1 1 laplace G 1 gen serreverse 1 1 recip G 1 gen setintersect 2 0 1 setintersect(${1 code}, ${2 code}) 2 vec vec 1 vec 1 setintersect GG 1 gen setisset 1 1 setisset G 1 small setminus 2 0 1 setminus(${1 code}, ${2 code}) 2 vec vec 1 vec 1 setminus GG 1 gen setrand 1 1 setrand G 1 void setsearch 1 1 setsearch GGD0,L, 1 small setunion 2 0 1 setunion(${1 code}, ${2 code}) 2 vec vec 1 vec 1 setunion GG 1 gen shift 1 1 gshift GL 1 gen shiftmul 1 1 gmul2n GL 1 gen sigma 2 0 6 sumdiv(${1 code}) 2 int ?1 1 int numbdiv(${1 code}) 2 int 0 1 int gsumdiv(${1 code}) 2 gen ?1 1 gen gnumbdiv(${1 code}) 2 gen 0 1 gen sumdivk(${1 code}, ${2 code}) 2 int small 1 int gsumdivk(${1 code}, ${2 code}) 2 gen small 1 gen 1 gsumdivk GD1,L, 1 gen sign 2 0 2 signe(${1 code}) 1 mp 1 small gsigne(${1 code}) 1 gen 1 small 1 gsigne G 1 small_int simplify 1 1 simplify G 1 gen sin 1 1 gsin Gp 2 gen prec sinh 1 1 gsh Gp 2 gen prec sizebyte 1 1 gsizebyte G 1 small sizedigit 1 1 sizedigit G 1 small solve 3 0 1 zbrent(${3 cookie}, ${3 wrapper}, ${1 code}, ${2 code}, prec) 3 gen gen gen 2 gen prec 1 zbrent0 V=GGEp 2 gen prec 2 3 _wrap_G sqr 2 0 3 sqri(${1 code}) 1 int 1 int gsqr(${1 code}) 1 mp 1 mp gsqr(${1 code}) 1 gen 1 gen 1 gsqr G 1 gen sqrt 2 0 2 sqrtr(${1 code}) 1 real 1 gen gsqrt(${1 code}, prec) 1 gen 2 gen prec 1 gsqrt Gp 2 gen prec sqrtint 2 0 1 sqrtint(${1 code}) 1 gen 1 int 1 sqrtint G 1 gen sqrtn 1 1 gsqrtn GGD&p 2 gen prec stirling 1 1 stirling LLD1,L, 1 gen subgrouplist 1 1 subgrouplist0 GDGD0,L, 1 gen subst 1 1 gsubst GnG 1 gen substpol 1 1 gsubstpol GGG 1 gen substvec 1 1 gsubstvec GGG 1 gen sum 1 1 somme V=GGEDG 1 gen sumalt 3 0 2 sumalt(${2 cookie}, ${2 wrapper}, ${1 code}, prec) 3 gen gen ?0 2 gen prec sumalt2(${2 cookie}, ${2 wrapper}, ${1 code}, prec) 3 gen gen 1 2 gen prec 1 sumalt0 V=GED0,L,p 2 gen prec 2 2 _wrap_G sumdedekind 1 1 sumdedekind GG 1 gen sumdiv 1 1 divsum GVE 1 gen suminf 3 0 1 suminf(${2 cookie}, ${2 wrapper}, ${1 code}, prec) 2 gen gen 2 gen prec 1 suminf0 V=GEp 2 gen prec 2 2 _wrap_G sumnum 3 0 1 sumnum(${3 cookie}, ${3 wrapper}, ${1 code}, ${2 code}, ${4 code}, ${5 code}, prec) 5 gen gen gen ?gen ?small 2 gen prec 1 sumnum0 V=GGEDGD0,L,p 2 gen prec 2 3 _wrap_G sumnumalt 3 0 1 sumnumalt(${3 cookie}, ${3 wrapper}, ${1 code}, ${2 code}, ${4 code}, ${5 code}, prec) 5 gen gen gen ?gen ?small 2 gen prec 1 sumnumalt0 V=GGEDGD0,L,p 2 gen prec 2 3 _wrap_G sumnuminit 1 1 sumnuminit GD0,L,D1,L,p 2 gen prec sumpos 3 0 2 sumpos(${2 cookie}, ${2 wrapper}, ${1 code}, prec) 3 gen gen ?0 2 gen prec sumpos2(${2 cookie}, ${2 wrapper}, ${1 code}, prec) 3 gen gen 1 2 gen prec 1 sumpos0 V=GED0,L,p 2 gen prec 2 2 _wrap_G system 1 1 system0 s 1 void tan 1 1 gtan Gp 2 gen prec tanh 1 1 gth Gp 2 gen prec taylor 1 1 tayl GnDP 1 gen teichmuller 1 1 teich G 1 gen theta 1 1 theta GGp 2 gen prec thetanullk 1 1 thetanullk GLp 2 gen prec thue 1 1 thue GGDG 1 gen thueinit 1 1 thueinit GD0,L,p 2 gen prec trace 1 1 gtrace G 1 gen trap 3 0 1 trap0(${1 code}, ${2 code}, ${3 code}) 3 ?str ?closure ?closure 1 gen 1 trap0 DrDEDE 1 gen 2 3 _ _ truncate 2 0 9 ${1 code} 1 small 2 small parens ${1 code} 1 int 3 int copy parens truncr(${1 code}) 1 real 1 int mptrunc(${1 code}) 1 mp 1 int gcvtoi(${1 code}, &${2 code}) 2 mp &small 1 int trunc0(${1 code}, &${2 code}) 2 mp &int 1 int gtrunc(${1 code}) 1 gen 1 gen gcvtoi(${1 code}, &${2 code}) 2 gen &small 1 gen trunc0(${1 code}, &${2 code}) 2 gen &int 1 gen 1 trunc0 GD& 1 gen type 2 0 1 typ(${1 code}) 1 gen 1 typ 1 type0 G 1 gen unclone 1 0 2 (void)0 /*unclone*/ 1 small 1 void gunclone(${1 code}) 1 gen 1 void until 1 1 untilpari EI 1 void valuation 1 1 ggval GG 1 small variable 2 0 2 ${1 :var cast} 1 pol 3 var parens copy gpolvar(${1 code}) 1 gen 1 gen 1 gpolvar DG 1 gen vecextract 2 0 1 extract0(${1 code}, ${2 code}, ${3 code}) 3 vec gen ?gen 1 vec 1 extract0 GGDG 1 gen vecmax 2 0 2 vecsmall_max(${1 code}) 1 vecsmall 1 small vecmax(${1 code}) 1 gen 1 gen 1 vecmax G 1 gen vecmin 2 0 2 vecsmall_min(${1 code}) 1 vecsmall 1 small vecmin(${1 code}) 1 gen 1 gen 1 vecmin G 1 gen vecsort 2 0 16 vecsort0(${1 code}, ${2 code}, 0) 2 vecsmall ?gen 1 vecsmall vecsort0(${1 code}, ${2 code}, ${3 code}) 3 vecsmall ?gen small 1 vecsmall sort(${1 code}) 3 vec ?0 1 vec indexsort(${1 code}) 3 vec 1 1 vecsmall lexsort(${1 code}) 3 vec 2 1 vec vecsort0(${1 code}, ${2 code}, 0) 2 vec gen 1 vec vecsort0(${1 code}, ${2 code}, 1) 3 vec ?gen 1 1 vecsmall vecsort0(${1 code}, ${2 code}, 3) 3 vec ?gen 3 1 vecsmall vecsort0(${1 code}, ${2 code}, 5) 3 vec ?gen 5 1 vecsmall vecsort0(${1 code}, ${2 code}, 7) 3 vec ?gen 7 1 vecsmall vecsort0(${1 code}, ${2 code}, 9) 3 vec ?gen 9 1 vecsmall vecsort0(${1 code}, ${2 code}, 11) 3 vec ?gen 11 1 vecsmall vecsort0(${1 code}, ${2 code}, 13) 3 vec ?gen 13 1 vecsmall vecsort0(${1 code}, ${2 code}, 15) 3 vec ?gen 15 1 vecsmall vecsort0(${1 code}, ${2 code}, ${3 code}) 3 vec ?gen #small 1 vec vecsort0(${1 code}, ${2 code}, ${3 code}) 3 vec ?gen small 1 gen 1 vecsort0 GDGD0,L, 1 gen vector 1 1 vecteur GDVDE 1 gen vectorsmall 1 1 vecteursmall GDVDE 1 gen vectorv 1 1 vvecteur GDVDE 1 gen version 1 1 pari_version 1 gen warning 2 0 1 pari_warn(user, "${2 format_string}"${2 format_args}) 2 ?gen ... 1 void 1 warning0 s* 1 void weber 1 1 weber0 GD0,L,p 2 gen prec whatnow 2 0 1 whatnow(${1 code}, 0) 1 str 1 void 1 whatnow0 r 1 void while 1 1 whilepari EI 1 void write 1 1 write0 ss* 1 void write1 1 1 write1 ss* 1 void writebin 1 1 gpwritebin sDG 1 void writetex 1 1 writetex ss* 1 void zeta 1 1 gzeta Gp 2 gen prec zetak 1 1 gzetakall GGD0,L,p 2 gen prec zetakinit 1 1 initzeta Gp 2 gen prec zncoppersmith 1 1 zncoppersmith GGGDG 1 gen znlog 1 1 znlog GGDG 1 gen znorder 2 0 3 order(${1 code}) 1 gen 1 int order(${1 code}) 2 gen 1 int znorder(${1 code}, ${2 code}) 2 gen int 1 int 1 znorder GDG 1 gen znprimroot 2 0 2 znprimroot(${1 code}) 1 int 1 gen znprimroot0(${1 code}) 1 gen 1 gen 1 znprimroot0 G 1 gen znstar 1 1 znstar G 1 gen gp2c-0.0.8/desc/Makefile.in0000644000175000017500000003075412165534611012273 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = desc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkgdatadir)" DATA = $(pkgdata_DATA) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHOC = @ECHOC@ ECHON = @ECHON@ ECHOT = @ECHOT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GP2C_DBG = @GP2C_DBG@ GP2C_DBG1 = @GP2C_DBG1@ GP_PATH = @GP_PATH@ GP_PATH_DBG = @GP_PATH_DBG@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARI_DATADIR = @PARI_DATADIR@ PARI_DESC = @PARI_DESC@ PARI_MODULE_BUILD = @PARI_MODULE_BUILD@ PARI_MODULE_DEBUG = @PARI_MODULE_DEBUG@ PARI_RUNTEST = @PARI_RUNTEST@ PARI_VERSION = @PARI_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_PATH = @PERL_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ mybindir = @mybindir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkgdata_DATA = func.dsc EXTRA_DIST = $(COMPAT_DESC) $(FUNC2X_DSC) CLEANFILES = func.dsc COMPILE_DESC = ../scripts/822_desc.pl FUNC2X_DSC = $(srcdir)/func23.dsc $(srcdir)/func25.dsc COMPAT_DESC = $(srcdir)/compat.desc OVERRIDE_DESC = $(srcdir)/override.desc all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu desc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu desc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-pkgdataDATA: $(pkgdata_DATA) @$(NORMAL_INSTALL) @list='$(pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgdatadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdatadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \ done uninstall-pkgdataDATA: @$(NORMAL_UNINSTALL) @list='$(pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgdatadir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(pkgdatadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-pkgdataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkgdataDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-pkgdataDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am uninstall-pkgdataDATA func.dsc: $(COMPILE_DESC) $(PARI_DESC) $(COMPAT_DESC) $(OVERRIDE_DESC) @$(COMPILE_DESC) $(PARI_DESC) $(COMPAT_DESC) $(OVERRIDE_DESC) >func.dsc\ && echo "Description recompiled" \ || ( cp $(srcdir)/func25.dsc func.dsc && echo "Using PARI 2.5 description" ) $(OVERRIDE_DESC): touch $(OVERRIDE_DESC) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: gp2c-0.0.8/desc/compat.desc0000644000175000017500000000000112141547407012330 00000000000000 gp2c-0.0.8/desc/Makefile.am0000644000175000017500000000111112155572710012244 00000000000000pkgdata_DATA = func.dsc EXTRA_DIST = $(COMPAT_DESC) $(FUNC2X_DSC) CLEANFILES = func.dsc COMPILE_DESC = ../scripts/822_desc.pl PARI_DESC = @PARI_DESC@ FUNC2X_DSC = $(srcdir)/func23.dsc $(srcdir)/func25.dsc COMPAT_DESC = $(srcdir)/compat.desc OVERRIDE_DESC = $(srcdir)/override.desc func.dsc: $(COMPILE_DESC) $(PARI_DESC) $(COMPAT_DESC) $(OVERRIDE_DESC) @$(COMPILE_DESC) $(PARI_DESC) $(COMPAT_DESC) $(OVERRIDE_DESC) >func.dsc\ && echo "Description recompiled" \ || ( cp $(srcdir)/func25.dsc func.dsc && echo "Using PARI 2.5 description" ) $(OVERRIDE_DESC): touch $(OVERRIDE_DESC) gp2c-0.0.8/src/0000755000175000017500000000000012217042364010143 500000000000000gp2c-0.0.8/src/config.h.in0000644000175000017500000000532312165534616012121 00000000000000/* src/config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* Define to 1 if you have the `getopt' function. */ #undef HAVE_GETOPT /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H /* Define to 1 if you have the `memccpy' function. */ #undef HAVE_MEMCCPY /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcmp' function. */ #undef HAVE_STRCMP /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strrchr' function. */ #undef HAVE_STRRCHR /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* target PARI module build */ #undef PARI_MODULE_BUILD /* target PARI version */ #undef PARI_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Version number of package */ #undef VERSION /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to `unsigned int' if does not define. */ #undef size_t gp2c-0.0.8/src/toplevel.c0000644000175000017500000000721412156115130012057 00000000000000/* Copyright (C) 2002-2003 The PARI group. This file is part of the GP2C package. PARI/GP is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY WHATSOEVER. Check the License for details. You should have received a copy of it, along with the package; see the file 'COPYING'. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" #include #include #include #include #include "header.h" static int toplevel=0; int initnode=0; const char *basename(const char *s) { long i; long l=strlen(s); for(i=l-1;i>=0;i--) if (s[i]=='/') return s+i+1; return s; } char *nameinitfunc(void) { const char *initname="init_"; const char *absname, *p; char *name, *q; absname=basename(nameparse); name=calloc(strlen(initname)+strlen(absname)+1,sizeof(*name)); sprintf(name,"%s",initname); q=name+strlen(name); for(p=absname;*p && *p!='.';p++,q++) if (isalnum(*p)) *q=*p; else *q='_'; *q=0; return name; } int addinitfunc(int n) { int code; int ret; char *name; name=nameinitfunc(); code=toplevel?toplevel:-1; code=addseqright(code,GNIL); initnode = newentry(name); code=newnode(Fdeffunc,newnode(Ffunction,initnode,-1),code); ret=addseqright(code,n); return ret; } void genpredeclaration(int args, int n) { int stack[STACKSZ]; int i; int nb=listtostack(args,Flistarg,stack,STACKSZ,"function declaration",n); if (nb==1 && stack[0]==GNOARG) nb--; for(i=0;i=0 && tree[x].f!=Fdeffunc && tree[x].f!=Fseq) { if (isfunc(x,"global")) genpredeclaration(tree[x].y,x); if (isfunc(x,"local")) warning(x,"`local' at top-level discarded"); else toplevel=addseqright(toplevel,x); tree[n].x=GNIL; } else gentoplevel(x,n); if (y>=0 && tree[y].f!=Fdeffunc) { if (isfunc(y,"global")) genpredeclaration(tree[y].y,y); if (isfunc(y,"local")) warning(y,"`local' at top-level discarded"); else toplevel=addseqright(toplevel,y); tree[n].y=GNIL; } else gentoplevel(y,n); break; case Ffunction: die(n,"Ffunction in toplevel"); gentoplevel(y,n); break; case Fdeffunc: case Fentry: case Fconst: case Fsmall: case Fnoarg: break; case Frefarg: case Ftag: die(n,"%s in toplevel",funcname(tree[n].f)); gentoplevel(x,n); break; default: if (tree[n].f>=FneedENTRY) { die(n,"Internal error: unknown func %s in gentoplevel",funcname(tree[n].f)); } else { gentoplevel(x,n); gentoplevel(y,n); } } } gp2c-0.0.8/src/context.c0000644000175000017500000000644312156115130011714 00000000000000/* Copyright (C) 2000 The PARI group. This file is part of the GP2C package. PARI/GP is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY WHATSOEVER. Check the License for details. You should have received a copy of it, along with the package; see the file 'COPYING'. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" #include #include #include #include #include "header.h" /* return hashing value for variable s*/ long varkey(const char *s) { long n = 0; while (*s) { n = (n<<1) ^ *s; s++; } return n; } int newctx(int flag) { int n; n=stack_new(&s_ctx); ctxstack[n].flag=flag; return n; } int newaff(enum AFenum func, int idx) { int n=stack_new(&s_aff); if (idx<0) die(-1,"Internal error: unknown var"); affstack[n].f=func; affstack[n].idx=idx; return n; } int newblock(void) { int n=stack_new(&s_bloc); stack_init(&block[n].s,sizeof(*block[n].c),(void **)&block[n].c); block[n].ret=-1; stack_init(&block[n].v,sizeof(*block[n].var),(void **)&block[n].var); block[n].gc=0; block[n].egc=-1; stack_init(&block[n].g,sizeof(*block[n].gcvar),(void **)&block[n].gcvar); return n; } int fillvar(int n, int flag, int t, int initval) { int c=getvarerr(n); ctxvar *v=ctxstack+c; v->flag=flag; vartype(*v)=t; v->initval=initval; return c; } int pushvar(int n, int flag, int t, int initval) { const char *s=entryname(n); int c=newctx(flag); ctxvar *v=ctxstack+c; if (flag&(1<cvar=usercname(s); else v->cvar=s; v->key=varkey(s); v->node=newnode(Fentry,newentry(s),-1); vartype(*v)=t; v->initval=initval; v->val=-1; return c; } int getvarinstack(const char *s, int n, const ctxvar *ctx) { int i,key; key=varkey(s); for(i=n-1;i>=0 && (ctx[i].key!=key || strcmp(varstr(ctx[i]),s));i--); return i; } int getvarbyname(const char *s) { return getvarinstack(s,s_ctx.n,ctxstack); } int getvar(int n) { if(tree[n].f!=Fentry && tree[n].f!=Ffunction) die(n,"Internal error : Not a Fentry/Ffunction in getvar"); return getvarbyname(value[tree[n].x].val.str); } ctxvar *getvarinblock(int n, context *fc) { int v; if (tree[n].f!=Fentry) die(n,"Internal error : %s(%d) in getvarinblock",funcname(tree[n].f),tree[n].f); v=getvarinstack(value[tree[n].x].val.str,fc->s.n,fc->c); if ( v<0 ) die(n,"Internal error : var not found in getvarinblock"); return fc->c+v; } int getvarerr(int n) { int v=getvar(n); if (v==-1) die(n,"Internal error: variable %s appears from nowhere", value[tree[n].x].val.str); return v; } void restorectx(int c) { int i,j; for(i=c,j=c;is_ctx.n) die(-1,"Internal error: restorectx"); s_ctx.n=j; } void pushctx(context *fc) { stack_push(&s_ctx,&fc->s); } void copyctx(int c, context *fc) { int i; fc->s.n=0; for (i=c; is); fc->c[n]=ctxstack[i]; } } gp2c-0.0.8/src/node.c0000644000175000017500000002132112165531671011161 00000000000000/* Copyright (C) 2002-2004 The PARI group. This file is part of the GP2C package. PARI/GP is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY WHATSOEVER. Check the License for details. You should have received a copy of it, along with the package; see the file 'COPYING'. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" #include #include #include #include #include #include "header.h" #define GP2C_MAX_INT_32 2147483647L const char *Ffuncname[]={"Fseq", "Fmatrix","Frange", "Fassign", "Fmatcoeff", "Fmatrixelts","Fmatrixlines", "Fmat","Fvec", "Flistarg", "Frefarg", "Fcall", "Fconst","Fsmall","Fnoarg", "Ftag", "Fentry","Ffunction","Flambda","Fdeffunc", /*These nodes are generated by genblock, not by parser*/ "Fblock", "Ffun" }; /* 0 not an integer * 1 a true integer * 2 a real which is an integer (1.,17.00) */ int isarealint(const char *s) { while (*s>='0' && *s<='9') s++; if (!*s) return 1; if (*s != '.') return 0; while(*++s) if (*s != '0') return 0; return 2; } int linecount; int newcomment(void) { int n=stack_new(&s_comment); comment *c=com+n; stack_init(&c->s,sizeof(*c->txt),(void **)&c->txt); return n; } void pushcomment(int n, char x) { comment *c=com+n; int m=stack_new(&c->s); c->txt[m]=x; } int newnodecom(Ffunc f, int x, int y, int com) { int n=stack_new(&s_node); tree[n].f=f; tree[n].x=x; tree[n].y=y; tree[n].t=Gnotype; tree[n].m=0; tree[n].lineno=linecount; tree[n].comment=com; return n; } int newnode(Ffunc f, int x, int y) { return newnodecom(f,x,y,-1); } int newsmall(int val) { return newnode(Fsmall,val,-1); } int newopcall(OPerator op, int x, int y) { if (y==-1) return newnode(Ffunction,op,x); else return newnode(Ffunction,op,newnode(Flistarg,x,y)); } int newopcall3(OPerator op, int x, int y, int z) { return newopcall(op,newnode(Flistarg,x,y),z); } static int countarg(int n) { int i; for(i=1; tree[n].f==Flistarg; i++) n = tree[n].x; return i; } int addcurrexpr(int n, int currexpr) { int y, m = n; while (tree[m].x==OPcomprc) { y = tree[m].y; if (countarg(y)==4) y = tree[y].x; m = tree[y].y; } y = tree[m].y; if (countarg(y)==4) y = tree[y].x; tree[y].y = currexpr; return n; } int newstringvalue(const char *s) { int n=stack_new(&s_value); value[n].type=CSTstr; value[n].val.str=s; return n++; } int newsmallrealvalue(long small) { int n=stack_new(&s_value); value[n].type=CSTsmallreal; value[n].val.small=small; return n++; } int newintvalue(const char *s) { int n=stack_new(&s_value); value[n].type=CSTint; value[n].val.str=s; return n++; } int newrealvalue(const char *s) { int n=stack_new(&s_value); value[n].type=CSTreal; value[n].val.str=s; return n++; } /* newxxxnode functions * These functions take a token value as a string and a comment index. * They must return a new Fconst or Fsmall node. * They must free the string if they do not reference it. * the cast free((char *)s) is to remove the const qualifier. */ int newintnode(const char *s, int c) { long small; char *endptr; /* We do not want to inline 64bit integers to preserve the portability * of the resulting C code.*/ errno=0;/* for catching strtol overflows*/ small=strtol(s,&endptr,10); if (!*endptr && !errno && small<=GP2C_MAX_INT_32) { free((char *)s); return newnodecom(Fsmall,small,-1,c); } else return newnodecom(Fconst,newintvalue(s),-1,c); } int newrealnode(const char *s, int c) { char *endptr; int val; if (!isarealint(s)) val=newrealvalue(s); else { long small; errno=0;/* for catching strtol overflows*/ small=strtol(s,&endptr,10); if (*endptr=='.' && !errno && small<=GP2C_MAX_INT_32) { val=newsmallrealvalue(small); free((char *)s); } else val=newrealvalue(s); } return newnodecom(Fconst,val,-1,c); } int newstringnode(const char *s, int c) { return newnodecom(Fconst,newstringvalue(s),-1,c); } int newquotenode(const char *s, int c) { return newcall("_const_quote",newstringnode(s,c)); } int is_const(int n, CSTtype t) { int f=tree[n].f; int x=tree[n].x; return f==Fconst && value[x].type==t; } int newentry(const char *s) { return newstringvalue(s); } int isfunc(int n, const char *s) { return tree[n].f==Ffunction && !strcmp(s,value[tree[n].x].val.str); } extern char *optprefix; const char *usercname(const char *s) { const char *p; if (!optprefix) { if (s[0]=='p' || s[0]=='l') { for(p=s+1; *p=='_'; p++); if (isdigit(*p)) { for ( ; isdigit(*p); p++); if (!*p) { char *q=calloc(sizeof(*s),2+strlen(s)); sprintf(q,"%c_%s",s[0],s+1); return q; } } } } else { char *q=calloc(sizeof(*s),strlen(optprefix)+1+strlen(s)); sprintf(q,"%s%s",optprefix,s); return q; } return s; } int newmember(const char *s) { char *p; int n; p=calloc(sizeof(*s),3+strlen(s)); sprintf(p,"_.%s",s); n=newentry(p); free((char *)s); return n; } void initoperators(void) { int i; for (i=0;it) die(n,"Unknown type '%s' or unexpected ':'",s); return n; } int detag(int n) { while(tree[n].f==Ftag) n=tree[n].x; return n; } int getlvaluerr(int n) { int ret=getlvalue(n); if (ret==-1) die(n,"not an lvalue"); return ret; } int newctype(const char *s) { int n=stack_new(&s_Ctype); Ctype[n].name=strdup(s); return n; } int strtoctype(const char *s) { int i; for(i=0;i= 8*sizeof(long)) die(err_desc,"GP2C only supports %ld modes",8*sizeof(long)); Mmode[n].name=strdup(s); return n; } int strtomode(char *s) { int i; for(i=0;iFlastfunc) return "Funknown"; else return Ffuncname[f]; } const char *GPname(int f) { if (f<0 || f>s_GPtype.n) return "Gunknown"; else return GPtype[f].name; } static int currlabel=0; int newlabel(int type) { int n=stack_new(&s_label); label[n].num=currlabel; label[n].type=type; label[n].go=0; label[n].ne=0; currlabel+=2; return n; } gp2c-0.0.8/src/gencast.c0000644000175000017500000000532212155572710011661 00000000000000/* Copyright (C) 2002-2005 The PARI group. This file is part of the GP2C package. PARI/GP is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY WHATSOEVER. Check the License for details. You should have received a copy of it, along with the package; see the file 'COPYING'. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" #include #include #include #include #include "header.h" extern int indent; extern int indentlevel; int gencastcode(FILE *fout, int n, int t, int nt, int f); void gencastf(FILE *fout, int n, int nt, int f) { int t=tree[n].t; int tnt=typemax[t][nt]; int i; if (t==nt) { /*bottom of the recursion*/ if (f) genparens(fout,n); else gencode(fout,n); return; } if (gencastcode(fout,n,t,nt,f)) return; /*the interesting case */ if (is_subtype(t,nt)) for (i=0;i%s",GPname(t),GPname(nt)); for(i=0;i%s",GPname(t),GPname(nt)); } void gencast(FILE *fout, int n, int nt) { if (ntdsc; for(i=0; inb; i++) { gpdescarg *rule=dsc->a+i; descargatom atom=rule->args[0]; if (rule->type!=nt || (atom.mode&tree[n].m)!=atom.mode) continue; switch(atom.t) { case AAherevalue: if(tree[n].f!=Fsmall && tree[n].f!=Fconst) continue; case AAtype: if(atom.type!=t) continue; break; case AAsmall: if (tree[n].f!=Fsmall || atom.misc!=tree[n].x) continue; break; default: continue; } if (rule->cname[0]==0) gencastf(fout,n,t,f); else { if (f && rule->mode&(1<mode&(1< #include #include #include "header.h" int gentypefuncdesc(int n, gpfunc *gp); void inittrans(int n,int p) { int i; for(i=0;idsc; typemax=(int **) calloc(Gnbtype,sizeof(*typemax)); for(i=0;inb; n++) { gpdescarg *ga=dsc->a+n; int oldt=-1; for (i=0; i < ga->nargs; i++) { descargatom *a=ga->args+i; int t=a->type; if (a->t!=AAtype) die(err_desc,"unexpected atom in _type_preorder"); if (oldt>=0) typemax[t][oldt]=typemax[oldt][t]=t; oldt=t; } } for(i=0;is.n;i++) { ctxvar *v=fc->c+i; int val=v->initval; if (val!=-1) { int t=gentype(val); int vt=vartype(*v); if (v->flag&(1<gpname,funcmode(*gp),tree[seq].m); /*funcmode(*gp)|(tree[seq].m&((1<ret==-1) tree[n].t=Gvoid; else { int v=getvarerr(fc->ret); tree[n].t=vartype(ctxstack[v]); } tree[n].m=mode|(tree[seq].m&MODHERIT); } int gentype(int n) { int t,tx,ty; int mx,my; int x,y,c; gpfunc *gp; int nf; if (n<0) return Gnotype; x=tree[n].x; y=tree[n].y; if (tree[n].f=0)?tree[x].m:0; ty=gentype(y); my=(y>=0)?tree[y].m:0; } else { tx=-1; mx=-1; ty=-1; my=-1; } switch(tree[n].f) { case Fseq: if (x<0 || y<0) die(n,"internal error in gentype"); if (mx&(1<flag&(1<flag&(1<flag&(1<flag&(1<=0) tree[n].m=(1<%s" ,GPname(tx),GPname(y)); tree[n].m=tree[x].m&MODHERIT; break; case Frefarg: gentype(x); tree[n].t=tree[x].t; tree[n].m=tree[x].m; break; case Fentry: c=getvar(n); if (c>=0) { ctxvar *v=ctxstack+c; tree[n].t=vartype(*v); tree[n].m=(1<flag&(1<=0) { gp=lfunc+nf; if (functype(*gp)==Gnotype && gp->spec>0) /* is a special function ? */ tree[n].t=gentypefuncspec(n,gp); else if (gp->dsc && (t=gentypefuncdesc(n,gp))!=Gnotype) /* else has the function a description ?*/ tree[n].t=t; else /* else use the function a type */ { gentype(y); tree[n].t=functype(*gp); my=(y==-1)?0:tree[y].m; tree[n].m=(funcmode(*gp)&(~(1< #include #include #include #include "header.h" extern int indent; int currfunc; static int newcvar=1; /*Use getfunc or newuserfunc instead*/ static int newfunc(const char *gpname) { int nf=stack_new(&s_func); gpfunc *f=lfunc+nf; f->gpname=gpname; f->proto.cname=gpname; f->proto.code=NULL; f->proto.origin=NULL; f->proto.help=-1; f->node=newnode(Ffun,nf,-1); functype(*f)=Gempty; funcmode(*f)=0; f->spec=GPpari; f->iter=NULL; f->wrap=NULL; f->dsc=NULL; f->user=NULL; return nf; } int newuserfunc(const char *gpname) { int nf=newfunc(gpname); gpfunc *f=lfunc+nf; userfunc *uf; if (gpname[0]=='_' && gpname[1]=='.') { char *s=strdup(gpname); s[0]='m'; s[1]='_'; f->proto.cname=usercname(s); if (s!= f->proto.cname) free(s); } else f->proto.cname=usercname(gpname); f->spec=GPuser; f->proto.origin=namelib; uf=f->user=(userfunc*) malloc(sizeof(*f->user)); stack_init(&uf->v,sizeof(*uf->var),(void **)&uf->var); stack_init(&uf->g,sizeof(*uf->gcvar),(void **)&uf->gcvar); return nf; } int findfunction_len(const char *s, size_t n) { int i; for(i=0; i=0 && !lfunc[n].dsc) die(err_desc,"Function %s has no description",s); return n; } int findfunctype(const char *s) { int nf=findfuncdesc(s); gpdescarg *da=descfindrules(0,NULL,lfunc+nf); return da->type; } int findfunctypeopt(const char *s) { gpdescarg *da; int nf=findfuncdescopt(s); if (nf<0) return -1; da=descfindrules(0,NULL,lfunc+nf); return da->type; } int getfunc(const char *gpname) { int r=findfunction(gpname); if (r>=0) return r; return newfunc(strdup(gpname)); } void genautoarg(FILE *fout, char c, int nerr) { switch(c) { case 'p': fprintf(fout,"prec"); break; case 'P': fprintf(fout,"precdl"); break; default: die(nerr,"unhandled letter '%c' in prototype",c); } } int genarg(int nerr, FILE *fout, char c, int n, PPproto pr) { if (n==-1) die(n,"missing mandatory argument in function call"); switch(c) { case 'G': gencast(fout,n,Ggen); return 1; case 'L': case 'P': gencast(fout,n,Gsmall); return 1; case '&': if (tree[n].f!=Frefarg && pr == PPdefault) die(nerr,"Missing & for reference"); case '*': /* Fall through */ fprintf(fout,"&"); gencode(fout,n); return 1; case 'W': gencode(fout,n); return 1; case 'r': case 's': gencast(fout,n,Gstr); return 1; case 'n': gencast(fout,n,Gvar); return 1; default: die(nerr,"Unsupported letter `%c' in prototype.\n" "This function is not supported by the compiler." ,c); return 0; } } void gendefarg(int n, FILE *fout, char c, const char *name) { switch(c) { case 'G': case '&': case 'r': case 's': case 'I': case 'V': fprintf(fout,"NULL"); break; case 'n': fprintf(fout,"-1"); break; case 'P': fprintf(fout,"precdl"); break; default: die(n,"Unknown default in prototype code `%c' for `%s'",c,name); } } void gendefargmulti(FILE *fout, char const *q, char const *p) { for(p++;puser; context *fc=block+gp->user->bl; nb=genlistargs(n,arg,0,ufunc->narg); fprintf(fout,"%s(",gp->proto.cname); for(j=0;jnarg;j++) { ctxvar *v=fc->c+ufunc->sarg+j; int t=vartype(*v); if (firstarg) fprintf(fout,", "); firstarg=1; if (j=0 && arg[j]!=GNOARG) gencast(fout,arg[j],t); else if (v->flag&(1<initval<0) die(n,"a mandatory argument is missing"); else gencast(fout,v->initval,t); } if (funcmode(*gp)&(1<= 0) { gpfunc *gp=lfunc+nf; if (gp->spec==0) { genuserfunc(fout,n,nf); return; } else if (gp->spec>0) { genentryspec(fout,n,gp); return; } nb=genlistargs(n,stack,0,STACKSZ); if (genfunc(fout,nb,stack,nf,n)==0) return; if (gp->dsc) die(n," %s: arguments do not match descriptions",name); if (gp->proto.cname) name=gp->proto.cname; } else if (FC_call>=0 && v>=0) { nb=genlistargs(n,stack+1,0,STACKSZ-1)+1; stack[0] = ctxstack[v].node; if (!genfuncbydesc(fout,nb,stack,FC_call,n)) return; } /*copy verbatim*/ nb=genlistargs(n,stack,0,STACKSZ); fprintf(fout,"%s(",name); for(i=0;icvar); } void genvarproto(FILE *fout, int n, int nerr) { if (genfuncbydesc1(fout,n,FC_decl_base,nerr)) die(nerr,"type not suitable for a variable"); fprintf(fout," "); if (genfuncbydesc1(fout,n,FC_decl_ext,nerr)) gencode(fout,n); } void genfuncproto(FILE *fout, int nf, const char *sep, int nerr) { gpfunc *gp=lfunc+nf; int n=gp->node; if (genfuncbydesc1(fout,n,FC_decl_base,nerr)) die(nerr,"type not suitable for a function"); fprintf(fout,"%s",sep); if (genfuncbydesc1(fout,n,FC_decl_ext,nerr)) gencode(fout,n); } static void gendecvarend(FILE *fout, int t) { if (t>=0) { if (t!=Ggen && t!=Gsmall && t!=Gpari_sp && t!=Gvoid) fprintf(fout,";\t /* %s */\n",GPname(t)); else fprintf(fout,";\n"); } } void gendecvar(FILE *fout, context *fc, int nerr) { int oldt=-1; int idx; for(idx=0;idxs.n;idx++) { ctxvar *v=fc->c+idx; int t=vartype(*v); if ((v->flag&(1<val!=-1) continue; if (v->flag&(1<node,FC_decl_base,nerr)) die(nerr,"type `%s' not suitable for a variable",GPname(t)); fprintf(fout, " "); } else fprintf(fout, ", "); if (genfuncbydesc1(fout,v->node,FC_decl_ext,nerr)) gencode(fout,v->node); if (v->initval>=0) { fprintf(fout," = "); gencast(fout,v->initval,vartype(*v)); } else if (ctype[t]==Vgen && autogc) { /* We want to protect gerepile from uninitialized values*/ fprintf(fout," = "); gencast(fout, GNIL, Ggen); } oldt=t; } gendecvarend(fout,oldt); } static void genprotoargs(FILE *fout, int nf, int firstarg, int nb, int *name) { gpfunc *gp=lfunc+nf; int i = 0; char const *p=gp->proto.code; char c; PPproto mod; while((mod=parseproto(&p,&c))) { if (firstarg) fprintf(fout,", "); firstarg=1; switch(c) { case 'p': case 'P': case 'L': case 'n': fprintf(fout,"long"); break; case 'f': fprintf(fout,"long *"); break; case 'W': case 'G': case 'E': case 'I': fprintf(fout,"GEN"); break; case 'F': case '*': case '&': fprintf(fout,"GEN *"); break; case 'r': case 's': fprintf(fout,"char *"); break; default: die(err_func,"prototype letter `%c' not known",c); } if (name) { if (i>=nb) die(err_func,"too few arguments in lambda"); fputs(" ",fout); if (c=='p') fprintf(fout,"prec"); else gencode(fout, name[i++]); } } if (name && iuser->defnode; int savc=s_ctx.n; context *fc=block+gp->user->bl; if (gp->user->flag&(1<s.n;i++) { ctxvar *v=fc->c+i; if( v->flag&(1<node, nerr); if (v->initval>=0 && !(v->flag&(1<proto.code; char c; PPproto mod; while((mod=parseproto(&p,&c))) { if (!firstarg) fprintf(fout,", "); firstarg=0; switch(c) { case 'p': case 'P': case 'L': t = Gsmall; break; case 'n': t = Gvar; break; case 'W': case 'G': case 'E': case 'I': t = Ggen; break; case 'r': case 's': t = Gstr; break; default: die(err_func,"prototype letter `%c' not known",c); } if (i>=nb) die(err_func,"too few arguments in lambda"); if (c=='p') fprintf(fout,"prec"); else gencast(fout, name[i++], t); } if (name && iuser->defnode; int savc=s_ctx.n; int stack[STACKSZ]; int nb=0, nbc=0, par=0; int res; ctxvar *vres; context *fc=block+gp->user->bl; gpfunc *wr=lfunc+wrap; gpdescarg *rule; if (!wr->proto.code) die(wr->node,"Wrapper not defined"); pushctx(fc); for (i=0;is.n;i++) { ctxvar *v=fc->c+i; if( v->flag&(1<flag&(1<node; } } fprintf(fout,"static "); genfuncbydesc1(fout,wr->node,FC_decl_base,nerr); fprintf(fout,"\nwrap_%s(void * _cargs",gp->proto.cname); genprotoargs(fout, wrap, 1, nb, stack); fprintf(fout,")\n{\n"); if (nbc || has_prec) fprintf(fout," GEN _args = (GEN) _cargs;\n "); else fprintf(fout," (void) _cargs;\n "); res = pushvar(newnode(Fentry, newentry("_res"), -1), 0, t, -1); vres = ctxstack+res; if (ctype[t]==ctype[Gvoid]) fprintf(fout,"(void) "); else { genfuncbydesc1(fout,vres->node,FC_decl_base,nerr); fprintf(fout," "); if (genfuncbydesc1(fout,vres->node,FC_decl_ext,nerr)) gencode(fout,vres->node); fprintf(fout," = "); } fprintf(fout,"%s(",gp->proto.cname); firstarg=genwrapargs(fout, wrap, nb, stack); for (i=0,d=1;is.n;i++) { ctxvar *v=fc->c+i; if (v->flag&(1<node, wr); if (rule) { if (rule->type==Gvoid) gencodedesc(fout,1, &vres->node, rule, nerr, nf); else { fprintf(fout,"return "); gencodedesc(fout,1, &vres->node, rule, nerr, nf); fprintf(fout,";\n"); } } fprintf(fout,"}\n\n"); s_ctx.n=savc; } void gendeffunc(FILE *fout, int n) { int funcid=tree[n].x; int seq=tree[n].y; const char *name=entryname(funcid); int savcf=currfunc; gpfunc *gp; int t; /*get func number and context*/ currfunc=findfunction(name); newcvar=1; if (currfunc==-1) die(n,"Internal error in gendeffunc : func %s not found",name); gp=lfunc+currfunc; gencomment(fout,funcid,0); genprototype(fout,currfunc,1); t=functype(*gp); if (t!=Ggen && t!=Gsmall) fprintf(fout,"\t /* %s */",GPname(t)); fprintf(fout,"\n"); gencode(fout,seq); fprintf(fout,"\n"); if (gp->user->wrapper>=0) genwrapper(fout,currfunc,gp->user->wrapper); currfunc=savcf; } void gendefblock(FILE *fout, int n) { int b=tree[n].x; int seq=tree[n].y; int i; int m; int savc; context *fc=block+b; savc=s_ctx.n; for(i=0;is.n;i++) { ctxvar *v=fc->c+i; int t=vartype(*v); if ((v->flag&(1<val!=-1) continue; if (t!=Gvoid && isdigit(*varstr(*v))) { char s[33]; sprintf(s,"%c%d",(ctype[t]==Vgen?'p':'l'),newcvar++); v->cvar=strdup(s); } } pushctx(fc); m=tree[n].m; if(!(m&(1< #include #include #include #include "header.h" static int multi=0; static int newprivvar=1; extern int initnode; extern int optstrict; extern int linecount; extern int safecoeff; int newdecl(int flag, int t, int initval, int *v) { char s[33]; sprintf(s,"%d",newprivvar++); *v=newnode(Fentry,newentry(strdup(s)),-1); return pushvar(*v,flag,t,initval); } int newcall(const char *s, int y) { return newnode(Ffunction,newentry(s),y); } int stacktofun(int fun, int *stack, int nb) { int n,i; if (nb==-1) return -1; for(n=stack[0],i=1;i=0) { if (tree[seq].f==Fseq) { bseq=newnode(Fassign,ret,tree[seq].y); bseq=newnode(Fseq,tree[seq].x,bseq); } else bseq=newnode(Fassign,ret,seq); } else bseq=seq; return bseq; } int geninsertvarop(int seq, int ret, OPerator op) { int bseq; if (seq==-1) return -1; if (ret>=0) { if (tree[seq].f==Fseq) { bseq=newopcall(op,ret,tree[seq].y); bseq=newnode(Fseq,tree[seq].x,bseq); } else bseq=newopcall(op,ret, seq); } else bseq=seq; return bseq; } int newcoeff(int n, int x, int y) { int arg[3]; int nb=y<0?2:3; arg[0]=n; arg[1]=x; arg[2]=y; return newnode(Ffunction,OPcoeff,stacktoargs(arg,nb)); } int newcoeffsafe(int n, int x, int y) { int arg[3]; int nb=y<0?2:3; arg[0]=n; arg[1]=x; arg[2]=y; if (!safecoeff) return newnode(Ffunction,OPcoeff,stacktoargs(arg,nb)); else return newcall("_safecoeff",stacktoargs(arg,nb)); } void makeblock(int bl, int n, int aseq, int ret, int savx) { /*create a block*/ tree[n].f=Fblock; tree[n].x=bl; block[bl].ret=ret; tree[n].y=aseq; copyctx(savx,block+bl); restorectx(savx); } void makeblocks(int bl1, int bl2, int n, int bseq, int aseq, int ret, int savx) { int y; tree[n].f=Fblock; tree[n].x=bl1; block[tree[n].x].ret=ret; y=addseqright(bseq,newnode(Fblock,bl2,aseq)); tree[n].y=y; copyctx(savx,block+bl2); restorectx(savx); } void makeblocks3(int bl1, int bl2, int bl3, int n, int bseq, int aseq, int ret, int sav0, int savx) { int y; tree[n].f=Fblock; tree[n].x=bl1; block[tree[n].x].ret=ret; y=addseqright(bseq,newnode(Fblock,bl2,newnode(Fblock,bl3,aseq))); tree[n].y=y; copyctx(savx,block+bl3); restorectx(savx); copyctx(sav0,block+bl2); restorectx(sav0); } static void affectval(int vn, int val, int *seq) { ctxvar *v = ctxstack+vn; int valn=newnode(Fassign,newleaf(v->node),val); *seq=addseqright(*seq,valn); } int genblockdeclaration(int args, int n, int flag, int type, int *seq) { int stack[STACKSZ]; int i; enum {local,global,function} decl; int mint=(type>=0)?type:Ggen; int nb=listtostack(args,Flistarg,stack,STACKSZ,"function declaration",n); if (nb==1 && stack[0]==GNOARG) nb--; decl=(flag&(1<node,FC_default_check)) v->flag|=(1<narg-1;i>=0;i--) { ctxvar *v=ctxstack+sav1+i; gpdescarg *rule; int check=-1; if (!(v->flag&(1<node, FC_badtype); if (rule && rule->args[0].type==vartype(*v)) { check=newcall("_badtype",newleaf(v->node)); if (rule->type!=Gvoid) { int name=newstringnode(gp->gpname,-1); int args = descfindrules1(name,findfuncdesc("_err_type")) ? name : newnode(Flistarg,name,v->node); check=newcall("if", newnode(Flistarg,check, newcall("_err_type", args))); } } if (v->initval>=0 && (v->flag&(1<node)), newnode(Fassign,newleaf(v->node),v->initval)); check=newcall("if", (check>=0)?newnode(Flistarg,n,check):n); v->initval=-1; } if (check>=0) seq=addseqleft(check,seq); } return seq; } #if 0 /*The code for global(globalvars) f(args)=local(localvars);code;... is */ { ulong ltop=avma; GEN p1; { GEN args; GEN localvars; code; p1=...; } gerepileall(ltop,2,&p1,&globalsvar); return p1; } #endif void genblockdeffunc(int n) { int funcid=tree[n].x; int seq=tree[n].y; const char *name=entryname(funcid); int args=tree[funcid].y; int bl1,gltop=-1; int savcf,savnpv; int sav1,nodebl1; userfunc *ufunc; /*save global var*/ savcf=currfunc; savnpv=newprivvar; /*reset private var counter*/ newprivvar=1; /*create function*/ currfunc=findfunction(entryname(funcid)); if (currfunc<0) die(n,"internal error: unknown function %s in genblockdeffunc",name); if (lfunc[currfunc].spec!=GPuser) { if (lfunc[currfunc].spec==GPinstalled) die(n,"Cannot redefine install'ed function %s",name); else die(n,"internal error: not a user function %s in genblockdeffunc",name); } ufunc=lfunc[currfunc].user; /*create external block*/ bl1=newblock(); sav1=s_ctx.n; ufunc->bctx=sav1; ufunc->bl=bl1; if (autogc) { /*declare ltop*/ gltop=newnode(Fentry,newentry("ltop"),-1); pushvar(gltop,0,Gpari_sp,newcall("_avma",-1)); } /*declare function arguments*/ ufunc->sarg=s_ctx.n-sav1; ufunc->narg=genblockdeclaration(args,n,(1<sarg,seq,ufunc); /*generate block*/ genblock(seq,-1); if (tree[funcid].x!=initnode) { /*FIXME: For now, clear Cglobal flag to avoid initialization problem with implicit fetch_user_var().*/ int i; for (i=sav1;iproto.code ? gp->proto.code : "&DG"; /* 2.3 compat */ char c; PPproto mod; int nb=genlistargs(n,arg,0,STACKSZ); int i=0; while((mod=parseproto(&p,&c))!=PPend) { if (i=nb) die(n,"too few arguments"); switch(c) { case 'r': if (tree[arg[i]].f==Fentry) tree[arg[i]].f=Fconst; else if (tree[arg[i]].f!=Fconst) die(n,"argument must be a raw string"); break; case '&': if (tree[arg[i]].f!=Frefarg) die(arg[i],"missing &"); arg[i]=tree[arg[i]].x; case '*': /*Fall through */ { int a = detag(arg[i]); if (tree[a].f==Fmatcoeff) { int l=getlvaluerr(a); genblock(l,n); ctxstack[getvarerr(l)].flag|=1<user->bl; for (i=0; is.n; i++) { ctxvar *v=fc->c+i; if (v->flag&(1<node)); } return n; } static int has_mand_arg(const char *code) { PPproto mod; char c; while ((mod=parseproto(&code,&c))!=PPend) if(mod==PPstd) return 1; return 0; } void genblock(int n, int p) { int x,y; if (n<0) return; linecount=tree[n].lineno; x=tree[n].x; y=tree[n].y; switch(tree[n].f) { case Fseq: genblock(x, n); genblock(y, n); break; case Fmat: if (x==-1) { int z=newgetgvec("t_MAT"); tree[n]=tree[z]; } else genblockmatrix(n); break; case Fvec: if (x==-1) { int z=newgetgvec("t_VEC"); tree[n]=tree[z]; } else genblockvector(n, "t_VEC"); break; case Fassign: x=detag(x); if (tree[x].f==Fvec) genblockvecaff(n); else { if (tree[x].f==Fmatcoeff) { int l=getlvaluerr(x); int m=matindex_type(tree[x].y); genblock(l,n); ctxstack[getvarerr(l)].flag|=1<=0) { genblockindex(tree[y].x); genblockindex(tree[y].y); } } break; case Fmatcoeff: { int nn; int m=matindex_type(y); int yx=tree[y].x, yy=tree[y].y; genblock(x,n); genblock(y,n); switch(m) { case VEC_std: nn=newcoeffsafe(x,tree[yx].x,-1); break; case MAT_std: nn=newcoeffsafe(x,tree[yx].x,tree[yy].x); break; case MAT_line: tree[n].y=yx; if (FC_matrixrow>=0) nn=newcall("_[_,]",newnode(Flistarg,x,tree[yx].x)); else { genblockmatrixl(n,x,tree[yx].x); nn=n; } break; case MAT_column: nn=newcoeff(x,tree[yy].x,-1); break; case MAT_range: { int arg[5]; arg[0] = x; arg[1] = tree[yx].x; arg[2] = tree[yx].y; if(yy<0) nn=newnode(Ffunction,newentry("_[_.._]"),stacktoargs(arg,3)); else { arg[3] = tree[yy].x; arg[4] = tree[yy].y; nn=newnode(Ffunction,newentry("_[_.._,_.._]"),stacktoargs(arg,5)); } } break; default: die(-1,"Unknown matindex"); } tree[n]=tree[nn]; break; } case Fcall: { int seq = newcall("_(_)",addlistleft(x,y)); if (FC_call<0) die(n,"closures not available in this version"); tree[n]=tree[seq]; genblock(n,p); } break; case Fentry: { int nf, nv = getvar(n); if (nv>=0) break; nf = findfunction(entryname(n)); if (nf<0) /*Undeclared variable*/ { gpfunc *gp = lfunc+currfunc; userfunc *uf = gp->user; if (uf->flag&(1<narg++; } else {/*The variable has not been declared. * We declare it as a function-local variable initialized * to 'var. The global flag is set to avoid being block-local. * It is discarded in genblockdeffunc. This can be changed. */ int iv=newquotenode(entryname(n),-1); pushvar(n,(1<proto.code; GPspec spec = gp->spec; if (spec==GPuser && gp->user->flag&(1<type==CSTsmall || val->type==CSTsmallreal) { tree[n]=tree[y]; val->val.small=-val->val.small; break; } } } else if (x==OPtrans && tree[y].f==Fvec) { if (tree[y].x==-1) { int z=newgetgvec("t_COL"); tree[n]=tree[z]; break; } else { tree[n]=tree[y]; genblockvector(n,"t_COL"); break; } } { int nf=findfunction(value[x].val.str); gpfunc *gp = lfunc+currfunc; userfunc *uf = gp->user; int nv = getvar(n); if (nf<0 && uf->flag&(1<narg++; genblock(y,n); } else if (nf<0 && nv>=0) { int seq = newnode(Fcall,newnode(Fentry,x,-1),y); tree[n]=tree[seq]; genblock(n,p); } else if (nf>=0 && lfunc[nf].iter) genblockfunciter(n,p,lfunc+nf); else if (nf>=0 && lfunc[nf].spec>0) genblockfuncspec(n,p,lfunc+nf); else if (nf>=0 && lfunc[nf].proto.code) genblockproto(n,lfunc+nf); else if (nf>=0 && x>=OPss && x<=OPme) /* For compatibility with PARI 2.3 */ genblockproto(n,lfunc+nf); else genblock(y,n); } break; case Fdeffunc: if (currfunc!=-1) die(n,"Internal error : nested function"); genblockdeffunc(n); break; case Fconst: case Fsmall: case Fnoarg: break; case Ftag: genblock(x,n); break; case Fblock: die(p,"Internal error : looping in genblock"); default: if (tree[n].f>=FneedENTRY) { die(p,"Internal error : unknown func %s in genblock",funcname(tree[n].f)); } else { genblock(x, n); genblock(y, n); } } } gp2c-0.0.8/src/header.h0000644000175000017500000003052212165115645011473 00000000000000/* Copyright (C) 2000-2005 The PARI group. This file is part of the GP2C package. PARI/GP is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY WHATSOEVER. Check the License for details. You should have received a copy of it, along with the package; see the file 'COPYING'. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "stack.h" extern int debug; extern const char *nameparse, *namelib; extern int currfunc; extern int lastpass; extern int autogc; extern int warn; #define STACKSZ (1024) #define GNIL (0) #define GNOARG (1) static inline int min(int x, int y) { return (x<=y)?x:y; } static inline int max(int x, int y) { return (x>=y)?x:y; } typedef struct { char *txt; long lineno; } error_string; typedef struct { stack s; char *txt; } comment; typedef struct { char *s; int c; } strcom; typedef enum {Fseq, Fmatrix,Frange, Fassign, Fmatcoeff, Fmatrixelts,Fmatrixlines, Fmat,Fvec, Flistarg, Frefarg, Fcall, Fconst,Fsmall,Fnoarg, Ftag, Fentry,Ffunction,Flambda,Fdeffunc, /*This node is generated by genblock, not by parser*/ Fblock, Ffun } Ffunc; #define FneedENTRY (Fconst) #define Flastfunc (Ffun) /*see parse.y for definition. Fblock x: block number y:seq */ extern const char *Ffuncname[]; #include "type.h" #include "optable.h" typedef enum {Cuser,Cauto,Cglobal,Cconst,Carg,Ccompo,Cclosed, Cimmutable,Cdefmarker,Cundeclared,Cfunction} Vtype; /* Cuser: Variable defined by user in the source Cauto: Variable get type of initialisation Cglobal: Global variable for this module. Cconst: Variable affected exactly once in the code. Carg: Variable is a function's parameter. Ccompo: Variable components are updated. Cimmutable: Variable affected exactly once in the run. Cdefmarker: Variable initialised to the default marker. Cundeclared: Variable was not declared. Cfunction: Variable belong to function scope. */ typedef struct node_s { Ffunc f; /*node function*/ int x; /*node left child*/ int y; /*node right child*/ int t; /*node type*/ int m; /*node mode bitmask*/ int lineno; /*linenumber of corresponding code*/ int comment; } node; /* Automatic variables GP names are . * Automatic variables C names are {p,l} * with number2<=number1 since we remove unused variables. */ #define varstr(y) (value[tree[(y).node].x].val.str) #define vartype(x) (tree[(x).node].t) typedef struct { int flag; /*context type, Vtype bitmask*/ int key; /*context hashkey*/ const char *cvar; /*context var C name*/ int node; int initval; /*context initial value of var*/ int val; /*context value, if constant*/ } ctxvar; enum AFenum {AFaccess,AFassign,AFassigncompo,AFassigncopy,AFrefarg, AFhide, AFclone}; typedef struct { enum AFenum f; int idx; } affnode; enum GCenum {GCneeded, GCupto, GCglobal, GCreturn}; typedef struct { ctxvar *c; /*context stack*/ stack s; int ret; /*if not -1 , node number of var holding return value*/ affnode *var; /*Data about variable*/ stack v; int savb; int egc; /*Extra var to be gerepiled*/ long gc; /*garbage collecting attribute, bitmask of GCenum*/ int *gcvar; /*List of var that need to be gerepiled*/ stack g; } context; enum AAenum {AAtype,AActype,AAnoarg,AAsmall,AAstring,AAreftype,AAherevalue,AAlvalue,AAmulti,AAstdarg,AAoptsmall,AAopttype}; typedef struct { enum AAenum t; int misc; int type; int mode; char *str; } descargatom; typedef struct { int type; int init; int next; } gpiterator; typedef struct { const char *cname; /* C code */ gpiterator iter; int type; /*return type*/ int mode; /*return mode*/ int nargs; /*nb args*/ descargatom *args; /*type of args*/ } gpdescarg; typedef struct { int nb; /*nb of description*/ gpdescarg *a; /*array of description*/ } gpdesc; typedef struct { int nb; /*nb of wrappers*/ int *w; /*array of wrappers*/ } gpwrap; typedef struct { const char *cname; /* C name */ const char *code; /* GP code */ const char *origin; /* library name of the symbol, NULL for gp/libpari*/ int help; } gpproto; enum UFenum {UFclosure, UFstatic}; typedef struct { enum UFenum flag; int pdefnode; int defnode; int bl; int sarg; int narg; int bctx; int wrapper; affnode *var; /*Data about variable*/ stack v; int savb; int *gcvar; /*List of var that need to be gerepiled*/ stack g; } userfunc; /*Positive enum are private to funcspec.c/patchfunc.h*/ enum {GPinstalled=-2,GPpari=-1,GPuser=0}; typedef int GPspec; typedef struct { const char *gpname; /*name for GP*/ int node; /*Ffunction node*/ GPspec spec; /*Spec name for spec function*/ gpproto proto; gpdesc *iter; /*Iterator or NULL*/ gpwrap *wrap; /*Wrapper or NULL*/ gpdesc *dsc; /*Description or NULL*/ userfunc *user; } gpfunc; #define functype(x) (tree[(x).node].t) #define funcmode(x) (tree[(x).node].m) int FC_badtype, FC_formatcode, FC_tovec, FC_tovecprec, FC_cast; int FC_decl_base,FC_decl_ext; int FC_gerepileupto, FC_gerepileall; int FC_const_smallreal, FC_const_real, FC_const_expr; int FC_proto_ret, FC_proto_code; int FC_default_check, FC_default_marker; int FC_copy, FC_avma, FC_low_stack_lim; int FC_forprime_next, FC_forprime_init, FC_matrixrow; int FC_proto_max_args; int FC_call, FC_strtoclosure; int Vgen; int Gpari_sp, Gforprime, Gerror; int max_args; typedef enum {CSTsmall, CSTsmallreal, CSTint, CSTreal, CSTstr} CSTtype; typedef struct { CSTtype type; /*type of data*/ union value_u { long small; const char *str; } val; } value_t; typedef struct { const char *name; } Ctype_t; typedef struct { const char *name; } GPtype_t; typedef struct { const char *name; } Mmode_t; typedef struct { enum {Lbreak, Lnobrk, Liferr} type; int num; int go; int ne; int ie; } Clabel_t; node *tree; value_t *value; gpfunc *lfunc; ctxvar *ctxstack; affnode *affstack; context *block; comment *com; error_string *errors; Ctype_t *Ctype; GPtype_t *GPtype; Mmode_t *Mmode; Clabel_t *label; stack s_node,s_value,s_func,s_ctx,s_aff,s_bloc,s_comment,s_errors; stack s_Ctype, s_GPtype, s_Mmode, s_label; typedef enum { err_func=-1,err_parse=-2,err_desc=-3 } err_name; char *xstrndup(const char *s, size_t n); #ifdef __GNUC__ /*Avoid spurious warning*/ void die(int n, const char *format, ...) __attribute__ ((noreturn)); #else void die(int n, const char *format, ...); #endif void warning(int n, const char *format, ...); int listtostack(int n, Ffunc f, int *stack, int nbmax, const char *error,int nerr); int listcalltostack(int n, int fnum, int *stack, int nbmax, const char *error,int nerr); int listtostackparent(int n, Ffunc f, int *stack, int nbmax, const char *error,int nerr); int genlistargs(int n,int *stack,int min,int max); int genlistcats(int y,int *stack,int max); void killlistarg(int n, int a); int newcomment(void); void pushcomment(int n, char x); void gencomment(FILE *fout, int n, int flag); typedef enum {PPend,PPstd,PPdefault,PPdefaultmulti,PPstar,PPauto} PPproto; PPproto parseproto(char const **q, char *c); int addcurrexpr(int n, int currexpr); int newnode(Ffunc f, int x, int y); int newnodecom(Ffunc f, int x, int y, int com); int newsmall(int n); int newrealnode(const char *s, int c); int newintnode(const char *s, int c); int newstringnode(const char *s, int c); int newquotenode(const char *s, int c); int newsmallrealvalue(long small); int newentry(const char *s); int newmember(const char *s); int newleaf(int n); int newopcall(OPerator s, int x, int y); int newopcall3(OPerator s, int x, int y, int z); int newtag(int x, const char *s, int c); int newcoeff(int n, int x, int y); int newlabel(int n); const char *usercname(const char *s); int is_const(int n, CSTtype t); const char *entryname(int n); int newuserfunc(const char *gpname); int newblock(void); int stacktoargs(int *stack, int nb); int newseq(int x, int y); int newdecl(int flag, int t, int initval, int *v); int newcall(const char *s, int y); int findfunction(const char *name); int findfunction_len(const char *s, size_t n); int findfuncdesc(const char *s); int findfuncdescopt(const char *s); int findfunctype(const char *s); int findfunctypeopt(const char *s); void genequal(int aff, const char *func, int *var, int *binf, int *t); int addseqright(int seq, int n); int addseqleft(int n, int seq); int addlistleft(int n, int l); int getfunc(const char *gpname); const char *funcname(int f); const char *GPname(int f); void printnode(FILE *fout, int n); void maketree(FILE *fout,int n); int gentype(int n); int genblockdeclaration(int args, int n, int flag, int type, int *seq); void genheader(FILE *fout); void gencode(FILE *fout, int n); void genblock(int n, int p); void gentopfunc(int n, int p, int fun, int pfun); void gentoplevel(int n, int p); int addinitfunc(int n); void gendeblock(int n, int p, int ps, int *r, int *rs); void moveblock(int n, int p, int ps, int *r, int *rs); void pilelist(int n); void pileclean(int n); void varlist(int n); void gensemicolon(FILE *fout,int x); void genparens(FILE *fout, int x); void genparensg(FILE *fout, int x); void genendbrace(FILE * fout, int x); void genbrace(FILE *fout, int x); void genindent(FILE *fout); void genindentline(FILE *fout, char *s); void genindentseq(FILE *fout, int x); void genpercent(FILE *fout, int n); void gencast(FILE *fout, int n, int nt); void gencastf(FILE *fout, int n, int nt, int f); void gentypedec(FILE *fout, int t); void genvarproto(FILE *fout, int n, int nerr); void genentry(FILE *fout, int n); void genentryfunc(FILE *fout, int n); void genprotocode(FILE *fout,int nf); void genprototype(FILE *fout,int nf, int kb); void gendeffunc(FILE *fout, int n); void gendefblock(FILE *fout, int n); void genblockfuncspec(int n, int p, gpfunc *gp); void genblockfunciter(int n, int p, gpfunc *gp); int gentypefuncspec(int n, gpfunc *gp); void genentryspec(FILE *fout, int n, gpfunc *gp); void gencodenoarg(FILE *fout, int t, int n); void checkisvar(int aff, const char *func, int *var, int *t); gpdescarg *descfindrulesdsc(int nb, int *arg, gpdesc *dsc); gpdescarg *descfindrules(int nb, int *arg, gpfunc *gp); gpdescarg *descfindrules1(int arg, int nf); void gencodedesc(FILE *fout, int nb, int *arg, gpdescarg *rule, int nerr, int nf); int genfuncbydesc(FILE *fout, int nb, int *arg, int nf, int nerr); int genfuncbydesc1(FILE *fout, int arg, int nf, int nerr); int genfuncbycode(FILE *fout, int nb, int *arg, int nf, int nerr); int genfuncbycode1(FILE *fout, int arg, int nf, int nerr); int genfunc(FILE *fout, int nb, int *arg, int nf, int nerr); int genfunc1(FILE *fout, int arg, int nf, int nerr); enum {MAT_range,MAT_std,MAT_line,MAT_column,VEC_std}; int matindex_type(long n); int detag(int n); int getlvalue(int n); int getlvaluerr(int n); int getvar(int n); int getvarerr(int n); int getvarbyname(const char *s); ctxvar *getvarinblock(int n, context *fc); int fillvar(int n, int flag, int t, int initval); int pushvar(int n, int ctype, int t, int initval); void pushctx(context *fc); void restorectx(int c); void copyctx(int n, context *fc); int newctx(int flag); int newaff(enum AFenum, int idx); void copyaff(int sava, int savc, context *fc); int isfunc(int n, const char *s); int isasmall(const char *s, long *res); int newctype(const char *s); int strtoctype(const char *s); int newtype(const char *s); int strtotype(const char *s); int strtotype_len(const char *s, size_t n); int newmode(const char *s); int strtomode(char *s); int geninsertvar(int seq, int ret); int geninsertvarop(int seq, int ret, OPerator op); int newgetg(int v, int l, const char *t); void makeblock(int bl, int n, int aseq, int ret, int savx); void makeblocks(int bl1, int bl2, int n, int bseq, int aseq, int ret, int savx); void makeblocks3(int bl1, int bl2, int bl3, int n, int bseq, int aseq, int ret, int sav0, int savx); int gengerepilelist(context *fc,int **gc); void gengerepileend(int bl); gp2c-0.0.8/src/parse.c0000644000175000017500000023041712155572737011365 00000000000000 /* A Bison parser, made by GNU Bison 2.4.1. */ /* Skeleton implementation for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "2.4.1" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* Using locations. */ #define YYLSP_NEEDED 0 /* Copy the first part of user declarations. */ /* Line 189 of yacc.c */ #line 1 "parse.y" /* Copyright (C) 2000-2004 The PARI group. This file is part of the GP2C package. PARI/GP is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY WHATSOEVER. Check the License for details. You should have received a copy of it, along with the package; see the file 'COPYING'. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define YYDEBUG 1 #define YYERROR_VERBOSE 1 #include "config.h" #include #include #include #include "header.h" int linecount; int yyerror(const char *s); int yylex(void); static int once=0; static int newcommand(int x, int y) { return (x==GNOARG)?y:(y==GNOARG)?x:newnode(Fseq,x,y); } /* Line 189 of yacc.c */ #line 106 "y.tab.c" /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* Enabling the token table. */ #ifndef YYTOKEN_TABLE # define YYTOKEN_TABLE 0 #endif /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { KDOTDOT = 258, KPARROW = 259, KARROW = 260, KPE = 261, KSE = 262, KME = 263, KDE = 264, KDRE = 265, KEUCE = 266, KMODE = 267, KAND = 268, KOR = 269, KID = 270, KEQ = 271, KNE = 272, KGE = 273, KLE = 274, KSRE = 275, KSLE = 276, KSR = 277, KSL = 278, KDR = 279, KPP = 280, KSS = 281, KINTEGER = 282, KREAL = 283, KENTRY = 284, KSTRING = 285, DEFFUNC = 286, SEQ = 287, LVAL = 288, INT = 289, SIGN = 290, MAT = 291 }; #endif /* Tokens. */ #define KDOTDOT 258 #define KPARROW 259 #define KARROW 260 #define KPE 261 #define KSE 262 #define KME 263 #define KDE 264 #define KDRE 265 #define KEUCE 266 #define KMODE 267 #define KAND 268 #define KOR 269 #define KID 270 #define KEQ 271 #define KNE 272 #define KGE 273 #define KLE 274 #define KSRE 275 #define KSLE 276 #define KSR 277 #define KSL 278 #define KDR 279 #define KPP 280 #define KSS 281 #define KINTEGER 282 #define KREAL 283 #define KENTRY 284 #define KSTRING 285 #define DEFFUNC 286 #define SEQ 287 #define LVAL 288 #define INT 289 #define SIGN 290 #define MAT 291 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { /* Line 214 of yacc.c */ #line 32 "parse.y" int val; strcom str; /* Line 214 of yacc.c */ #line 221 "y.tab.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif /* Copy the second part of user declarations. */ /* Line 264 of yacc.c */ #line 233 "y.tab.c" #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #elif (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) typedef signed char yytype_int8; #else typedef short int yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short int yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short int yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned int # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) # endif # endif # ifndef YY_ # define YY_(msgid) msgid # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(e) ((void) (e)) #else # define YYUSE(e) /* empty */ #endif /* Identity function, used to suppress warnings about constant conditions. */ #ifndef lint # define YYID(n) (n) #else #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int YYID (int yyi) #else static int YYID (yyi) int yyi; #endif { return yyi; } #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (YYID (0)) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (YYID (0)) #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 45 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 659 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 63 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 21 /* YYNRULES -- Number of rules. */ #define YYNRULES 106 /* YYNRULES -- Number of states. */ #define YYNSTATES 187 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 291 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 31, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 51, 2, 50, 2, 44, 39, 54, 57, 61, 47, 42, 37, 43, 55, 46, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 58, 36, 41, 38, 40, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 53, 45, 59, 49, 2, 60, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 62, 2, 52, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 48, 56 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const yytype_uint16 yyprhs[] = { 0, 0, 3, 5, 9, 10, 12, 15, 19, 20, 22, 26, 29, 35, 39, 41, 44, 46, 49, 52, 54, 56, 58, 62, 64, 67, 69, 74, 76, 78, 80, 82, 84, 88, 92, 95, 98, 102, 106, 110, 114, 118, 122, 126, 130, 134, 137, 140, 144, 148, 152, 156, 160, 164, 168, 172, 176, 180, 184, 188, 192, 196, 200, 204, 208, 212, 216, 219, 222, 226, 229, 232, 235, 238, 240, 244, 248, 250, 253, 257, 259, 263, 267, 271, 274, 280, 284, 288, 292, 296, 301, 303, 307, 311, 317, 323, 325, 328, 329, 334, 336, 340, 345, 349, 353, 357, 361 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { 64, 0, -1, 65, -1, 64, 31, 65, -1, -1, 70, -1, 65, 36, -1, 65, 36, 70, -1, -1, 70, -1, 70, 3, 70, -1, 49, 70, -1, 53, 66, 37, 66, 59, -1, 53, 66, 59, -1, 60, -1, 68, 60, -1, 44, -1, 44, 27, -1, 44, 68, -1, 27, -1, 28, -1, 55, -1, 27, 55, 29, -1, 30, -1, 54, 29, -1, 69, -1, 70, 57, 80, 61, -1, 81, -1, 71, -1, 74, -1, 77, -1, 83, -1, 74, 38, 70, -1, 71, 38, 70, -1, 71, 25, -1, 71, 26, -1, 71, 8, 70, -1, 71, 9, 70, -1, 71, 10, 70, -1, 71, 11, 70, -1, 71, 12, 70, -1, 71, 21, 70, -1, 71, 20, 70, -1, 71, 6, 70, -1, 71, 7, 70, -1, 51, 70, -1, 50, 70, -1, 70, 14, 70, -1, 70, 13, 70, -1, 70, 39, 70, -1, 70, 15, 70, -1, 70, 16, 70, -1, 70, 17, 70, -1, 70, 18, 70, -1, 70, 40, 70, -1, 70, 19, 70, -1, 70, 41, 70, -1, 70, 43, 70, -1, 70, 42, 70, -1, 70, 23, 70, -1, 70, 22, 70, -1, 70, 44, 70, -1, 70, 24, 70, -1, 70, 45, 70, -1, 70, 46, 70, -1, 70, 47, 70, -1, 42, 70, -1, 43, 70, -1, 70, 49, 70, -1, 70, 52, -1, 70, 54, -1, 70, 51, -1, 70, 67, -1, 82, -1, 70, 58, 29, -1, 57, 70, 61, -1, 29, -1, 71, 67, -1, 71, 58, 29, -1, 70, -1, 72, 37, 70, -1, 72, 36, 72, -1, 73, 36, 72, -1, 53, 59, -1, 53, 70, 3, 70, 59, -1, 53, 36, 59, -1, 53, 72, 59, -1, 53, 73, 59, -1, 53, 1, 59, -1, 71, 41, 43, 70, -1, 75, -1, 75, 37, 70, -1, 75, 36, 76, -1, 75, 37, 70, 36, 76, -1, 53, 70, 62, 76, 59, -1, 65, -1, 39, 71, -1, -1, 78, 1, 79, 70, -1, 78, -1, 80, 37, 78, -1, 29, 57, 80, 61, -1, 70, 55, 29, -1, 81, 38, 65, -1, 82, 38, 65, -1, 71, 5, 65, -1, 57, 80, 4, 65, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { 0, 91, 91, 92, 95, 96, 97, 98, 101, 102, 103, 104, 107, 108, 111, 112, 115, 116, 117, 123, 124, 125, 126, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 183, 184, 185, 188, 189, 192, 193, 196, 197, 198, 199, 200, 201, 204, 207, 208, 209, 210, 213, 216, 217, 218, 218, 222, 223, 226, 229, 232, 234, 236, 237 }; #endif #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "\"..\"", "\")->\"", "\"->\"", "\"+=\"", "\"-=\"", "\"*=\"", "\"/=\"", "\"\\\\/=\"", "\"\\\\=\"", "\"%=\"", "\"&&\"", "\"||\"", "\"===\"", "\"==\"", "\"!=\"", "\">=\"", "\"<=\"", "\">>=\"", "\"<<=\"", "\">>\"", "\"<<\"", "\"\\\\/\"", "\"++\"", "\"--\"", "\"integer\"", "\"real number\"", "\"variable name\"", "\"character string\"", "'\\n'", "DEFFUNC", "SEQ", "LVAL", "INT", "';'", "','", "'='", "'&'", "'>'", "'<'", "'+'", "'-'", "'%'", "'\\\\'", "'/'", "'*'", "SIGN", "'^'", "'#'", "'!'", "'~'", "'['", "'\\''", "'.'", "MAT", "'('", "':'", "']'", "'`'", "')'", "'|'", "$accept", "commands", "seq", "range", "matrix_index", "backticks", "history", "expr", "lvalue", "matrixelts", "matrixlines", "matrix", "in", "inseq", "compr", "arg", "$@1", "listarg", "funcid", "memberid", "definition", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 10, 286, 287, 288, 289, 59, 44, 61, 38, 62, 60, 43, 45, 37, 92, 47, 42, 290, 94, 35, 33, 126, 91, 39, 46, 291, 40, 58, 93, 96, 41, 124 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 63, 64, 64, 65, 65, 65, 65, 66, 66, 66, 66, 67, 67, 68, 68, 69, 69, 69, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 71, 71, 71, 72, 72, 73, 73, 74, 74, 74, 74, 74, 74, 75, 76, 76, 76, 76, 77, 78, 78, 79, 78, 80, 80, 81, 82, 83, 83, 83, 83 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 1, 3, 0, 1, 2, 3, 0, 1, 3, 2, 5, 3, 1, 2, 1, 2, 2, 1, 1, 1, 3, 1, 2, 1, 4, 1, 1, 1, 1, 1, 3, 3, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 3, 2, 2, 2, 2, 1, 3, 3, 1, 2, 3, 1, 3, 3, 3, 2, 5, 3, 3, 3, 3, 4, 1, 3, 3, 5, 5, 1, 2, 0, 4, 1, 3, 4, 3, 3, 3, 3, 4 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 4, 19, 20, 76, 23, 0, 0, 16, 0, 0, 0, 0, 21, 4, 0, 2, 25, 5, 28, 29, 30, 27, 73, 31, 0, 4, 66, 67, 17, 14, 18, 46, 45, 0, 0, 83, 79, 0, 0, 24, 0, 95, 5, 0, 0, 1, 4, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 71, 69, 8, 70, 0, 4, 0, 72, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 35, 0, 0, 77, 0, 4, 4, 22, 0, 15, 88, 85, 0, 0, 0, 0, 86, 0, 87, 76, 96, 75, 97, 4, 4, 3, 7, 48, 47, 50, 51, 52, 53, 55, 60, 59, 62, 49, 54, 56, 58, 57, 61, 63, 64, 65, 68, 0, 0, 9, 102, 0, 74, 105, 43, 44, 36, 37, 38, 39, 40, 42, 41, 33, 78, 32, 103, 104, 101, 0, 0, 90, 0, 79, 81, 80, 82, 0, 106, 0, 11, 8, 13, 0, 26, 84, 0, 0, 0, 94, 98, 0, 10, 0, 92, 91, 12, 89, 0, 93 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 14, 41, 135, 75, 30, 16, 17, 18, 37, 38, 19, 158, 159, 20, 43, 164, 44, 21, 22, 23 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -161 static const yytype_int16 yypact[] = { 602, -39, -161, -18, -161, 602, 602, -20, 602, 602, 103, 42, -161, 566, 10, 48, -161, 438, 270, 47, -161, 51, 68, -161, 78, 566, -31, -31, -161, -161, 56, 60, 43, 49, 61, -161, 163, -25, -21, -161, 90, 48, 296, 27, 32, -161, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, -161, -161, 584, -161, 92, 566, 93, -161, 602, 602, 602, 602, 602, 602, 602, 602, 602, 602, -161, -161, 602, 94, -161, 602, 602, 602, -161, -28, -161, -161, -161, 602, 90, 602, 602, -161, 602, -161, -161, 37, -161, -161, 602, 566, 48, 438, 482, 482, 519, 519, 519, 519, 519, -31, -31, -31, 482, 519, 519, 534, 534, -31, -31, -31, -31, -31, 602, 44, 216, -161, -24, -161, 48, 438, 438, 438, 438, 438, 438, 438, 438, 438, 438, -161, 438, 48, 48, -161, 345, 29, -7, 65, 438, 88, 438, 88, 602, 48, 31, 438, 584, -161, 602, -161, -161, 83, 90, 602, -161, 438, 69, 438, 602, -161, 392, -161, 438, 90, -161 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -161, -161, 17, -33, -16, -161, -161, -5, -34, 1, -161, -161, -161, -160, -161, 23, -161, -6, -161, -161, -161 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -101 static const yytype_int16 yytable[] = { 26, 27, 90, 31, 32, 36, 107, 28, 42, 111, 45, 101, 102, 111, 181, 104, 24, 15, 67, 95, 68, 69, 70, 71, 72, 186, 73, 74, 109, 174, 175, -99, 109, 155, 103, -100, 110, 171, 105, 25, 29, 46, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 112, -99, 136, 157, 138, -100, 111, 173, 39, 141, 142, 143, 144, 145, 146, 147, 148, 149, 168, 70, 150, 47, 91, 152, 89, -99, 92, 70, 90, -100, 140, 156, 89, 160, 162, 72, 160, 73, 74, 161, 169, 33, 163, 93, 94, 97, 153, 154, 68, 69, 70, 71, 72, 96, 73, 74, 106, 98, 137, 139, 151, 176, 102, 180, 165, 183, 167, 1, 2, 3, 4, 166, 178, 0, 0, 0, 34, 157, 90, 0, 0, 0, 5, 6, 7, 0, 0, 0, 157, 0, 8, 9, 0, 10, 11, 12, 177, 13, 0, 35, 136, 0, 179, 99, 0, 0, 0, 182, 0, 0, 0, 0, 184, 48, 49, 50, 51, 52, 53, 54, 0, 0, 55, 56, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, 59, 60, 61, 62, 63, 64, 65, 66, 0, 67, 0, 68, 69, 70, 71, 72, 170, 73, 74, 0, 0, 0, 100, 0, 0, 0, 48, 49, 50, 51, 52, 53, 54, 0, 0, 55, 56, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, 59, 60, 61, 62, 63, 64, 65, 66, 0, 67, 0, 68, 69, 70, 71, 72, 0, 73, 74, 76, 77, 78, 79, 80, 81, 82, 83, 0, 0, 0, 0, 0, 0, 0, 84, 85, 0, 0, 0, 86, 87, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 48, 49, 50, 51, 52, 53, 54, 0, 0, 55, 56, 57, 0, 0, 70, 0, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 58, 59, 60, 61, 62, 63, 64, 65, 66, 0, 67, 0, 68, 69, 70, 71, 72, 0, 73, 74, 0, 0, 108, 48, 49, 50, 51, 52, 53, 54, 0, 0, 55, 56, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, 59, 60, 61, 62, 63, 64, 65, 66, 0, 67, 0, 68, 69, 70, 71, 72, 0, 73, 74, 172, 48, 49, 50, 51, 52, 53, 54, 0, 0, 55, 56, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 185, 0, 0, 58, 59, 60, 61, 62, 63, 64, 65, 66, 0, 67, 0, 68, 69, 70, 71, 72, 0, 73, 74, 48, 49, 50, 51, 52, 53, 54, 0, 0, 55, 56, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, 59, 60, 61, 62, 63, 64, 65, 66, 0, 67, 0, 68, 69, 70, 71, 72, 0, 73, 74, 50, 51, 52, 53, 54, 0, 0, 55, 56, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 60, 61, 62, 63, 64, 65, 66, 0, 67, 0, 68, 69, 70, 71, 72, 0, 73, 74, 55, 56, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 56, 57, 0, 0, 61, 62, 63, 64, 65, 66, 0, 67, 0, 68, 69, 70, 71, 72, 0, 73, 74, 63, 64, 65, 66, 0, 67, 0, 68, 69, 70, 71, 72, 0, 73, 74, 1, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 5, 6, 7, 1, 2, 3, 4, 0, 8, 9, 0, 10, 11, 12, 0, 13, 0, 0, 5, 6, 7, 1, 2, 3, 4, 134, 8, 9, 0, 10, 11, 12, 0, 13, 0, 0, 5, 6, 7, 0, 0, 0, 0, 0, 8, 9, 0, 10, 11, 12, 0, 13 }; static const yytype_int16 yycheck[] = { 5, 6, 18, 8, 9, 10, 40, 27, 13, 37, 0, 36, 37, 37, 174, 36, 55, 0, 49, 25, 51, 52, 53, 54, 55, 185, 57, 58, 1, 36, 37, 4, 1, 61, 59, 4, 4, 61, 59, 57, 60, 31, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 46, 37, 70, 100, 73, 37, 37, 41, 29, 77, 78, 79, 80, 81, 82, 83, 84, 85, 37, 53, 88, 36, 38, 91, 58, 61, 38, 53, 107, 61, 76, 99, 58, 101, 102, 55, 104, 57, 58, 101, 59, 1, 104, 38, 29, 59, 92, 93, 51, 52, 53, 54, 55, 60, 57, 58, 29, 59, 29, 29, 29, 59, 37, 43, 110, 59, 134, 27, 28, 29, 30, 111, 168, -1, -1, -1, 36, 174, 157, -1, -1, -1, 42, 43, 44, -1, -1, -1, 185, -1, 50, 51, -1, 53, 54, 55, 164, 57, -1, 59, 168, -1, 170, 3, -1, -1, -1, 175, -1, -1, -1, -1, 180, 13, 14, 15, 16, 17, 18, 19, -1, -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 39, 40, 41, 42, 43, 44, 45, 46, 47, -1, 49, -1, 51, 52, 53, 54, 55, 3, 57, 58, -1, -1, -1, 62, -1, -1, -1, 13, 14, 15, 16, 17, 18, 19, -1, -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 39, 40, 41, 42, 43, 44, 45, 46, 47, -1, 49, -1, 51, 52, 53, 54, 55, -1, 57, 58, 5, 6, 7, 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, -1, -1, -1, 25, 26, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 38, 13, 14, 15, 16, 17, 18, 19, -1, -1, 22, 23, 24, -1, -1, 53, -1, -1, -1, -1, 58, -1, -1, -1, -1, -1, -1, 39, 40, 41, 42, 43, 44, 45, 46, 47, -1, 49, -1, 51, 52, 53, 54, 55, -1, 57, 58, -1, -1, 61, 13, 14, 15, 16, 17, 18, 19, -1, -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 39, 40, 41, 42, 43, 44, 45, 46, 47, -1, 49, -1, 51, 52, 53, 54, 55, -1, 57, 58, 59, 13, 14, 15, 16, 17, 18, 19, -1, -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 36, -1, -1, 39, 40, 41, 42, 43, 44, 45, 46, 47, -1, 49, -1, 51, 52, 53, 54, 55, -1, 57, 58, 13, 14, 15, 16, 17, 18, 19, -1, -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 39, 40, 41, 42, 43, 44, 45, 46, 47, -1, 49, -1, 51, 52, 53, 54, 55, -1, 57, 58, 15, 16, 17, 18, 19, -1, -1, 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 40, 41, 42, 43, 44, 45, 46, 47, -1, 49, -1, 51, 52, 53, 54, 55, -1, 57, 58, 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, 23, 24, -1, -1, 42, 43, 44, 45, 46, 47, -1, 49, -1, 51, 52, 53, 54, 55, -1, 57, 58, 44, 45, 46, 47, -1, 49, -1, 51, 52, 53, 54, 55, -1, 57, 58, 27, 28, 29, 30, -1, -1, -1, -1, -1, -1, -1, -1, 39, -1, -1, 42, 43, 44, 27, 28, 29, 30, -1, 50, 51, -1, 53, 54, 55, -1, 57, -1, -1, 42, 43, 44, 27, 28, 29, 30, 49, 50, 51, -1, 53, 54, 55, -1, 57, -1, -1, 42, 43, 44, -1, -1, -1, -1, -1, 50, 51, -1, 53, 54, 55, -1, 57 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 27, 28, 29, 30, 42, 43, 44, 50, 51, 53, 54, 55, 57, 64, 65, 69, 70, 71, 74, 77, 81, 82, 83, 55, 57, 70, 70, 27, 60, 68, 70, 70, 1, 36, 59, 70, 72, 73, 29, 39, 65, 70, 78, 80, 0, 31, 36, 13, 14, 15, 16, 17, 18, 19, 22, 23, 24, 39, 40, 41, 42, 43, 44, 45, 46, 47, 49, 51, 52, 53, 54, 55, 57, 58, 67, 5, 6, 7, 8, 9, 10, 11, 12, 20, 21, 25, 26, 38, 58, 67, 38, 38, 38, 29, 80, 60, 59, 59, 3, 62, 36, 37, 59, 36, 59, 29, 71, 61, 1, 4, 37, 65, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 49, 66, 70, 29, 80, 29, 65, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 29, 70, 65, 65, 61, 70, 71, 75, 76, 70, 72, 70, 72, 79, 65, 78, 70, 37, 59, 3, 61, 59, 41, 36, 37, 59, 70, 66, 70, 43, 76, 70, 59, 70, 36, 76 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ #define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (YYID (N)) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ } \ else \ { \ (Current).first_line = (Current).last_line = \ YYRHSLOC (Rhs, 0).last_line; \ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ while (YYID (0)) #endif /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT # if YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ (Loc).first_line, (Loc).first_column, \ (Loc).last_line, (Loc).last_column) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (YYLEX_PARAM) #else # define YYLEX yylex () #endif /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (YYID (0)) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (YYID (0)) /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_value_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # else YYUSE (yyoutput); # endif switch (yytype) { default: break; } } /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (yytype < YYNTOKENS) YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) #else static void yy_stack_print (yybottom, yytop) yytype_int16 *yybottom; yytype_int16 *yytop; #endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void yy_reduce_print (yyvsp, yyrule) YYSTYPE *yyvsp; int yyrule; #endif { int yynrhs = yyr2[yyrule]; int yyi; unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) ); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyvsp, Rule); \ } while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) #else static YYSIZE_T yystrlen (yystr) const char *yystr; #endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) #else static char * yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; #endif { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return yystpcpy (yyres, yystr) - yyres; } # endif /* Copy into YYRESULT an error message about the unexpected token YYCHAR while in state YYSTATE. Return the number of bytes copied, including the terminating null byte. If YYRESULT is null, do not copy anything; just return the number of bytes that would be copied. As a special case, return 0 if an ordinary "syntax error" message will do. Return YYSIZE_MAXIMUM if overflow occurs during size calculation. */ static YYSIZE_T yysyntax_error (char *yyresult, int yystate, int yychar) { int yyn = yypact[yystate]; if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) return 0; else { int yytype = YYTRANSLATE (yychar); YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); YYSIZE_T yysize = yysize0; YYSIZE_T yysize1; int yysize_overflow = 0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; int yyx; # if 0 /* This is so xgettext sees the translatable formats that are constructed on the fly. */ YY_("syntax error, unexpected %s"); YY_("syntax error, unexpected %s, expecting %s"); YY_("syntax error, unexpected %s, expecting %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); # endif char *yyfmt; char const *yyf; static char const yyunexpected[] = "syntax error, unexpected %s"; static char const yyexpecting[] = ", expecting %s"; static char const yyor[] = " or %s"; char yyformat[sizeof yyunexpected + sizeof yyexpecting - 1 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) * (sizeof yyor - 1))]; char const *yyprefix = yyexpecting; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yycount = 1; yyarg[0] = yytname[yytype]; yyfmt = yystpcpy (yyformat, yyunexpected); for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; yyformat[sizeof yyunexpected - 1] = '\0'; break; } yyarg[yycount++] = yytname[yyx]; yysize1 = yysize + yytnamerr (0, yytname[yyx]); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; yyfmt = yystpcpy (yyfmt, yyprefix); yyprefix = yyor; } yyf = YY_(yyformat); yysize1 = yysize + yystrlen (yyf); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; if (yysize_overflow) return YYSIZE_MAXIMUM; if (yyresult) { /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ char *yyp = yyresult; int yyi = 0; while ((*yyp = *yyf) != '\0') { if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyf += 2; } else { yyp++; yyf++; } } } return yysize; } } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void yydestruct (yymsg, yytype, yyvaluep) const char *yymsg; int yytype; YYSTYPE *yyvaluep; #endif { YYUSE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); #else int yyparse (); #endif #else /* ! YYPARSE_PARAM */ #if defined __STDC__ || defined __cplusplus int yyparse (void); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*-------------------------. | yyparse or yypush_parse. | `-------------------------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void *YYPARSE_PARAM) #else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; #endif #else /* ! YYPARSE_PARAM */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void) #else int yyparse () #endif #endif { int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: `yyss': related to states. `yyvs': related to semantic values. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs; YYSTYPE *yyvsp; YYSIZE_T yystacksize; int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ int yytoken; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; yytoken = 0; yyss = yyssa; yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); if (yystate == YYFINAL) YYACCEPT; goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token. */ yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: /* Line 1455 of yacc.c */ #line 91 "parse.y" {(yyval.val)=(yyvsp[(1) - (1)].val);} break; case 3: /* Line 1455 of yacc.c */ #line 92 "parse.y" {(yyval.val)=newcommand((yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 4: /* Line 1455 of yacc.c */ #line 95 "parse.y" {(yyval.val)=GNOARG;} break; case 5: /* Line 1455 of yacc.c */ #line 96 "parse.y" {(yyval.val)=(yyvsp[(1) - (1)].val);} break; case 6: /* Line 1455 of yacc.c */ #line 97 "parse.y" {(yyval.val)=(yyvsp[(1) - (2)].val);} break; case 7: /* Line 1455 of yacc.c */ #line 98 "parse.y" {(yyval.val)=newcommand((yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 8: /* Line 1455 of yacc.c */ #line 101 "parse.y" { (yyval.val)=newnode(Frange,GNOARG,GNOARG); } break; case 9: /* Line 1455 of yacc.c */ #line 102 "parse.y" { (yyval.val)=newnode(Frange,(yyvsp[(1) - (1)].val),GNOARG); } break; case 10: /* Line 1455 of yacc.c */ #line 103 "parse.y" { (yyval.val)=newnode(Frange,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val)); } break; case 11: /* Line 1455 of yacc.c */ #line 104 "parse.y" { (yyval.val)=newnode(Frange,GNOARG,(yyvsp[(2) - (2)].val)); } break; case 12: /* Line 1455 of yacc.c */ #line 107 "parse.y" {(yyval.val)=newnode(Fmatrix,(yyvsp[(2) - (5)].val),(yyvsp[(4) - (5)].val));} break; case 13: /* Line 1455 of yacc.c */ #line 108 "parse.y" {(yyval.val)=newnode(Fmatrix,(yyvsp[(2) - (3)].val),-1);} break; case 14: /* Line 1455 of yacc.c */ #line 111 "parse.y" {(yyval.val)=1;} break; case 15: /* Line 1455 of yacc.c */ #line 112 "parse.y" {(yyval.val)=(yyvsp[(1) - (2)].val)+1;} break; case 16: /* Line 1455 of yacc.c */ #line 115 "parse.y" {(yyval.val)=newopcall(OPhist,-1,-1);} break; case 17: /* Line 1455 of yacc.c */ #line 116 "parse.y" {(yyval.val)=newopcall(OPhist,newintnode((yyvsp[(2) - (2)].str).s,(yyvsp[(2) - (2)].str).c),-1);} break; case 18: /* Line 1455 of yacc.c */ #line 117 "parse.y" {(yyval.val)=newopcall(OPhist,newnode(Fsmall,-(yyvsp[(2) - (2)].val),-1),-1);} break; case 19: /* Line 1455 of yacc.c */ #line 123 "parse.y" {(yyval.val)=newintnode((yyvsp[(1) - (1)].str).s,(yyvsp[(1) - (1)].str).c);} break; case 20: /* Line 1455 of yacc.c */ #line 124 "parse.y" {(yyval.val)=newrealnode((yyvsp[(1) - (1)].str).s,(yyvsp[(1) - (1)].str).c);} break; case 21: /* Line 1455 of yacc.c */ #line 125 "parse.y" {(yyval.val)=newnode(Fconst,newsmallrealvalue(0),-1);} break; case 22: /* Line 1455 of yacc.c */ #line 126 "parse.y" {(yyval.val)=newnodecom(Ffunction,newmember((yyvsp[(3) - (3)].str).s),newintnode((yyvsp[(1) - (3)].str).s,(yyvsp[(1) - (3)].str).c), (yyvsp[(3) - (3)].str).c);} break; case 23: /* Line 1455 of yacc.c */ #line 128 "parse.y" {(yyval.val)=newstringnode((yyvsp[(1) - (1)].str).s,(yyvsp[(1) - (1)].str).c);} break; case 24: /* Line 1455 of yacc.c */ #line 129 "parse.y" {(yyval.val)=newquotenode((yyvsp[(2) - (2)].str).s,(yyvsp[(2) - (2)].str).c);} break; case 25: /* Line 1455 of yacc.c */ #line 130 "parse.y" {(yyval.val)=(yyvsp[(1) - (1)].val);} break; case 26: /* Line 1455 of yacc.c */ #line 131 "parse.y" {(yyval.val)=newnode(Fcall,(yyvsp[(1) - (4)].val),(yyvsp[(3) - (4)].val));} break; case 27: /* Line 1455 of yacc.c */ #line 132 "parse.y" {(yyval.val)=(yyvsp[(1) - (1)].val);} break; case 28: /* Line 1455 of yacc.c */ #line 133 "parse.y" {(yyval.val)=(yyvsp[(1) - (1)].val);} break; case 29: /* Line 1455 of yacc.c */ #line 134 "parse.y" {(yyval.val)=(yyvsp[(1) - (1)].val);} break; case 30: /* Line 1455 of yacc.c */ #line 135 "parse.y" {(yyval.val)=(yyvsp[(1) - (1)].val);} break; case 31: /* Line 1455 of yacc.c */ #line 136 "parse.y" {(yyval.val)=(yyvsp[(1) - (1)].val);} break; case 32: /* Line 1455 of yacc.c */ #line 137 "parse.y" {(yyval.val)=newnode(Fassign,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 33: /* Line 1455 of yacc.c */ #line 138 "parse.y" {(yyval.val)=newnode(Fassign,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 34: /* Line 1455 of yacc.c */ #line 139 "parse.y" {(yyval.val)=newopcall(OPpp,(yyvsp[(1) - (2)].val),-1);} break; case 35: /* Line 1455 of yacc.c */ #line 140 "parse.y" {(yyval.val)=newopcall(OPss,(yyvsp[(1) - (2)].val),-1);} break; case 36: /* Line 1455 of yacc.c */ #line 141 "parse.y" {(yyval.val)=newopcall(OPme,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 37: /* Line 1455 of yacc.c */ #line 142 "parse.y" {(yyval.val)=newopcall(OPde,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 38: /* Line 1455 of yacc.c */ #line 143 "parse.y" {(yyval.val)=newopcall(OPdre,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 39: /* Line 1455 of yacc.c */ #line 144 "parse.y" {(yyval.val)=newopcall(OPeuce,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 40: /* Line 1455 of yacc.c */ #line 145 "parse.y" {(yyval.val)=newopcall(OPmode,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 41: /* Line 1455 of yacc.c */ #line 146 "parse.y" {(yyval.val)=newopcall(OPsle,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 42: /* Line 1455 of yacc.c */ #line 147 "parse.y" {(yyval.val)=newopcall(OPsre,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 43: /* Line 1455 of yacc.c */ #line 148 "parse.y" {(yyval.val)=newopcall(OPpe,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 44: /* Line 1455 of yacc.c */ #line 149 "parse.y" {(yyval.val)=newopcall(OPse,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 45: /* Line 1455 of yacc.c */ #line 150 "parse.y" {(yyval.val)=newopcall(OPnb,(yyvsp[(2) - (2)].val),-1);} break; case 46: /* Line 1455 of yacc.c */ #line 151 "parse.y" {(yyval.val)=newcall("length",(yyvsp[(2) - (2)].val));} break; case 47: /* Line 1455 of yacc.c */ #line 152 "parse.y" {(yyval.val)=newopcall(OPor,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 48: /* Line 1455 of yacc.c */ #line 153 "parse.y" {(yyval.val)=newopcall(OPand,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 49: /* Line 1455 of yacc.c */ #line 154 "parse.y" {(yyval.val)=newopcall(OPand,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 50: /* Line 1455 of yacc.c */ #line 155 "parse.y" {(yyval.val)=newopcall(OPid,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 51: /* Line 1455 of yacc.c */ #line 156 "parse.y" {(yyval.val)=newopcall(OPeq,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 52: /* Line 1455 of yacc.c */ #line 157 "parse.y" {(yyval.val)=newopcall(OPne,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 53: /* Line 1455 of yacc.c */ #line 158 "parse.y" {(yyval.val)=newopcall(OPge,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 54: /* Line 1455 of yacc.c */ #line 159 "parse.y" {(yyval.val)=newopcall(OPg,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 55: /* Line 1455 of yacc.c */ #line 160 "parse.y" {(yyval.val)=newopcall(OPle,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 56: /* Line 1455 of yacc.c */ #line 161 "parse.y" {(yyval.val)=newopcall(OPl,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 57: /* Line 1455 of yacc.c */ #line 162 "parse.y" {(yyval.val)=newopcall(OPs,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 58: /* Line 1455 of yacc.c */ #line 163 "parse.y" {(yyval.val)=newopcall(OPp,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 59: /* Line 1455 of yacc.c */ #line 164 "parse.y" {(yyval.val)=newopcall(OPsl,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 60: /* Line 1455 of yacc.c */ #line 165 "parse.y" {(yyval.val)=newopcall(OPsr,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 61: /* Line 1455 of yacc.c */ #line 166 "parse.y" {(yyval.val)=newopcall(OPmod,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 62: /* Line 1455 of yacc.c */ #line 167 "parse.y" {(yyval.val)=newopcall(OPdr,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 63: /* Line 1455 of yacc.c */ #line 168 "parse.y" {(yyval.val)=newopcall(OPeuc,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 64: /* Line 1455 of yacc.c */ #line 169 "parse.y" {(yyval.val)=newopcall(OPd,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 65: /* Line 1455 of yacc.c */ #line 170 "parse.y" {(yyval.val)=newopcall(OPm,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 66: /* Line 1455 of yacc.c */ #line 171 "parse.y" {(yyval.val)=newopcall(OPpl,(yyvsp[(2) - (2)].val),-1);} break; case 67: /* Line 1455 of yacc.c */ #line 172 "parse.y" {(yyval.val)=newopcall(OPn,(yyvsp[(2) - (2)].val),-1);} break; case 68: /* Line 1455 of yacc.c */ #line 173 "parse.y" {(yyval.val)=newopcall(OPpow,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 69: /* Line 1455 of yacc.c */ #line 174 "parse.y" {(yyval.val)=newopcall(OPtrans,(yyvsp[(1) - (2)].val),-1);} break; case 70: /* Line 1455 of yacc.c */ #line 175 "parse.y" {(yyval.val)=newopcall(OPderiv,(yyvsp[(1) - (2)].val),-1);} break; case 71: /* Line 1455 of yacc.c */ #line 176 "parse.y" {(yyval.val)=newopcall(OPfact,(yyvsp[(1) - (2)].val),-1);} break; case 72: /* Line 1455 of yacc.c */ #line 177 "parse.y" {(yyval.val)=newnode(Fmatcoeff,(yyvsp[(1) - (2)].val),(yyvsp[(2) - (2)].val));} break; case 73: /* Line 1455 of yacc.c */ #line 178 "parse.y" {(yyval.val)=(yyvsp[(1) - (1)].val);} break; case 74: /* Line 1455 of yacc.c */ #line 179 "parse.y" {(yyval.val)=newtag((yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].str).s,(yyvsp[(3) - (3)].str).c);} break; case 75: /* Line 1455 of yacc.c */ #line 180 "parse.y" {(yyval.val)=(yyvsp[(2) - (3)].val);} break; case 76: /* Line 1455 of yacc.c */ #line 183 "parse.y" {(yyval.val)=newnodecom(Fentry,newentry((yyvsp[(1) - (1)].str).s),-1,(yyvsp[(1) - (1)].str).c);} break; case 77: /* Line 1455 of yacc.c */ #line 184 "parse.y" {(yyval.val)=newnode(Fmatcoeff,(yyvsp[(1) - (2)].val),(yyvsp[(2) - (2)].val));} break; case 78: /* Line 1455 of yacc.c */ #line 185 "parse.y" {(yyval.val)=newtag((yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].str).s,(yyvsp[(3) - (3)].str).c);} break; case 79: /* Line 1455 of yacc.c */ #line 188 "parse.y" {(yyval.val)=(yyvsp[(1) - (1)].val);} break; case 80: /* Line 1455 of yacc.c */ #line 189 "parse.y" {(yyval.val)=newnode(Fmatrixelts,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 81: /* Line 1455 of yacc.c */ #line 192 "parse.y" {(yyval.val)=newnode(Fmatrixlines,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 82: /* Line 1455 of yacc.c */ #line 193 "parse.y" {(yyval.val)=newnode(Fmatrixlines,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 83: /* Line 1455 of yacc.c */ #line 196 "parse.y" {(yyval.val)=newnode(Fvec,-1,-1);} break; case 84: /* Line 1455 of yacc.c */ #line 197 "parse.y" {(yyval.val)=newopcall(OPrange,(yyvsp[(2) - (5)].val),(yyvsp[(4) - (5)].val));} break; case 85: /* Line 1455 of yacc.c */ #line 198 "parse.y" {(yyval.val)=newnode(Fmat,-1,-1);} break; case 86: /* Line 1455 of yacc.c */ #line 199 "parse.y" {(yyval.val)=newnode(Fvec,(yyvsp[(2) - (3)].val),-1);} break; case 87: /* Line 1455 of yacc.c */ #line 200 "parse.y" {(yyval.val)=newnode(Fmat,(yyvsp[(2) - (3)].val),-1);} break; case 88: /* Line 1455 of yacc.c */ #line 201 "parse.y" {YYABORT;} break; case 89: /* Line 1455 of yacc.c */ #line 204 "parse.y" {(yyval.val)=newnode(Flistarg,(yyvsp[(4) - (4)].val),(yyvsp[(1) - (4)].val));} break; case 90: /* Line 1455 of yacc.c */ #line 207 "parse.y" {(yyval.val)=newopcall(OPcompr,(yyvsp[(1) - (1)].val),-2);} break; case 91: /* Line 1455 of yacc.c */ #line 208 "parse.y" {(yyval.val)=newopcall3(OPcompr,(yyvsp[(1) - (3)].val),-2,(yyvsp[(3) - (3)].val));} break; case 92: /* Line 1455 of yacc.c */ #line 209 "parse.y" {(yyval.val)=newopcall(OPcomprc,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 93: /* Line 1455 of yacc.c */ #line 210 "parse.y" {(yyval.val)=newopcall3(OPcomprc,(yyvsp[(1) - (5)].val),(yyvsp[(5) - (5)].val),(yyvsp[(3) - (5)].val));} break; case 94: /* Line 1455 of yacc.c */ #line 213 "parse.y" {(yyval.val)=addcurrexpr((yyvsp[(4) - (5)].val),(yyvsp[(2) - (5)].val));} break; case 95: /* Line 1455 of yacc.c */ #line 216 "parse.y" {(yyval.val)=(yyvsp[(1) - (1)].val);} break; case 96: /* Line 1455 of yacc.c */ #line 217 "parse.y" {(yyval.val)=newnode(Frefarg,(yyvsp[(2) - (2)].val),-1);} break; case 97: /* Line 1455 of yacc.c */ #line 218 "parse.y" {if (!once) { yyerrok; s_errors.n--;} once=1;} break; case 98: /* Line 1455 of yacc.c */ #line 219 "parse.y" {once=0; (yyval.val)=newopcall(OPcat,(yyvsp[(1) - (4)].val),(yyvsp[(4) - (4)].val));} break; case 99: /* Line 1455 of yacc.c */ #line 222 "parse.y" {(yyval.val)=(yyvsp[(1) - (1)].val);} break; case 100: /* Line 1455 of yacc.c */ #line 223 "parse.y" {(yyval.val)=newnode(Flistarg,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 101: /* Line 1455 of yacc.c */ #line 226 "parse.y" {(yyval.val)=newnodecom(Ffunction,newentry((yyvsp[(1) - (4)].str).s),(yyvsp[(3) - (4)].val),(yyvsp[(1) - (4)].str).c);} break; case 102: /* Line 1455 of yacc.c */ #line 229 "parse.y" {(yyval.val)=newnodecom(Ffunction,newmember((yyvsp[(3) - (3)].str).s),(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].str).c);} break; case 103: /* Line 1455 of yacc.c */ #line 233 "parse.y" {(yyval.val)=newnode(Fdeffunc,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 104: /* Line 1455 of yacc.c */ #line 235 "parse.y" {(yyval.val)=newnode(Fdeffunc,(yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 105: /* Line 1455 of yacc.c */ #line 236 "parse.y" {(yyval.val)=newnode(Flambda, (yyvsp[(1) - (3)].val),(yyvsp[(3) - (3)].val));} break; case 106: /* Line 1455 of yacc.c */ #line 237 "parse.y" {(yyval.val)=newnode(Flambda, (yyvsp[(2) - (4)].val),(yyvsp[(4) - (4)].val));} break; /* Line 1455 of yacc.c */ #line 2430 "y.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else { YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) { YYSIZE_T yyalloc = 2 * yysize; if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) yyalloc = YYSTACK_ALLOC_MAXIMUM; if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yyalloc); if (yymsg) yymsg_alloc = yyalloc; else { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; } } if (0 < yysize && yysize <= yymsg_alloc) { (void) yysyntax_error (yymsg, yystate, yychar); yyerror (yymsg); } else { yyerror (YY_("syntax error")); if (yysize != 0) goto yyexhaustedlab; } } #endif } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto yyerrorlab; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } *++yyvsp = yylval; /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #if !defined(yyoverflow) || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: if (yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif /* Make sure YYID is used. */ return YYID (yyresult); } /* Line 1675 of yacc.c */ #line 240 "parse.y" int yyerror(const char *s) { int n=stack_new(&s_errors); errors[n].lineno=linecount; errors[n].txt=strdup(s); if (yydebug) fprintf(stderr,"%s:%d: %s\n",nameparse,linecount,s); return 0; } gp2c-0.0.8/src/util.c0000644000175000017500000001121312156172320011200 00000000000000/* Copyright (C) 2000-2003 The PARI group. This file is part of the GP2C package. PARI/GP is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY WHATSOEVER. Check the License for details. You should have received a copy of it, along with the package; see the file 'COPYING'. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" #include #include #include #include "header.h" int linecount; static void msgprefix(int n) { if (n>0) fprintf(stderr,"%s:%d: ",nameparse,tree[n].lineno); else { switch(n) { case err_func: fprintf(stderr,"%s:%s: ",nameparse,currfunc==-1?"toplevel":lfunc[currfunc].gpname); break; case err_parse: fprintf(stderr,"%s:%d: ",nameparse,linecount); break; case err_desc: fprintf(stderr,"func.dsc:: "); break; } } } void die(int n, const char *format, ...) { va_list ap; static int dead; va_start(ap, format); fprintf(stderr,"Error:"); msgprefix(n); vfprintf(stderr,format,ap); if (dead++) exit(1); fprintf(stderr,"\n"); printnode(stderr,n); fprintf(stderr,"\n"); exit(1); } extern int do_warning; void warning(int n, const char *format, ...) { va_list ap; va_start(ap, format); if (do_warning) { fprintf(stderr,"Warning:"); msgprefix(n); vfprintf(stderr,format,ap); fprintf(stderr,"\n"); printnode(stderr,n); fprintf(stderr,"\n"); } va_end(ap); } int listtostack(int n, Ffunc f, int *stack, int nbmax, const char *error,int nerr) { int x,i,nb; if (n==-1) return 0; for(x=n,i=0;tree[x].f==f && i0;stack[i]=tree[x].y,x=tree[x].x,i--); stack[0]=x; return nb; } int listcalltostack(int n, int fnum, int *stack, int nbmax, const char *error,int nerr) { int x=n, i=0, nb; if (n==-1) return 0; while(1) { int xx=tree[x].x; int xy=tree[x].y; if (tree[x].f!=Ffunction || xx!=fnum) break; x=tree[xy].x; i++; if (i>=nbmax) die(nerr,"Too many args for `%s'",error); } nb=i+1; for(x=n;i>0;i--) { int y=tree[x].y; x=tree[y].x; stack[i]=tree[y].y; } stack[0]=x; return nb; } int listtostackparent(int n, Ffunc f, int *stack, int nbmax, const char *error,int nerr) { int x,i,nb; if (n==-1) return 0; nbmax--; for(x=n,i=0;tree[x].f==f && i=0;stack[i]=x,x=tree[x].x,i--); return nb; } int genlistargs(int n,int *stack,int min,int max) { const char *name=value[tree[n].x].val.str; int y=tree[n].y; int nb=(y==GNOARG)?0:listtostack(y,Flistarg,stack,max,name,n); if(nb #include #include #include #include "header.h" extern gpfunc listfunc[]; gpdesc *newdesc(int nb) { gpdesc *gd = (gpdesc *) malloc(sizeof(*gd)); gd->nb=nb; gd->a=nb?(gpdescarg *)calloc(nb,sizeof(*(gd->a))):NULL; return gd; } gpwrap *newwrap(int nb) { gpwrap *gw = (gpwrap *) malloc(sizeof(*gw)); gw->nb=nb; gw->w=nb?(int *)calloc(nb,sizeof(*(gw->w))):NULL; return gw; } static void strtoargsdefault(char *s, descargatom *aa, int opt) { if (isdigit(*s) || *s=='-' || *s=='+') { aa->t=opt?AAoptsmall:AAsmall; aa->type=Gsmall; aa->misc=atol(s); } else { int t=strtotype(s); aa->t=opt?AAopttype:AAtype; aa->type=t; } } /*modify s*/ descargatom strtoargs(char *s) { descargatom aa; int t; char *mstr=s; aa.mode=0; aa.type=Gnotype; aa.misc=0; while ((mstr=strrchr(mstr,':'))) { aa.mode|=1<"); buf[strlen(buf)-1]=0; } int readnumber(FILE *f, char *buf, int len) { readentry(f,buf,len); return atol(buf); } int readtypemode(FILE *f,char *buf, int len, int *mode) { int nb=readnumber(f,buf,len); int type; *mode=0; if (nb) { int j; readentry(f,buf,len); type=strtotype(buf); for(j=1;jgpname); for(i=0;idsc=gd; else func->iter=gd; } for(j=0; ja+j; if (type==0) { readentry(dfile,buf,BUFFER_SIZE); da->cname=strdup(buf); } else { gpiterator *iter = &(da->iter); int niter=readnumber(dfile,buf,BUFFER_SIZE); if (niter!=3) die(err_desc,"unsupported iterator"); readentry(dfile,buf,BUFFER_SIZE); iter->type=strtotype(buf); readentry(dfile,buf,BUFFER_SIZE); iter->init=getfunc(buf); func = lfunc+nf; readentry(dfile,buf,BUFFER_SIZE); iter->next=getfunc(buf); func = lfunc+nf; } nargs=readnumber(dfile,buf,BUFFER_SIZE); da->nargs=nargs; if (nargs) da->args=(descargatom *) calloc(nargs,sizeof(*da->args)); else da->args=NULL; for(k=0; kargs[k]=strtoargs(buf); } da->type=readtypemode(dfile,buf,BUFFER_SIZE,&da->mode); } break; case 1: /*This is a prototype*/ readentry(dfile,buf,BUFFER_SIZE); func->proto.cname=strdup(buf); readentry(dfile,buf,BUFFER_SIZE); func->proto.code=strdup(buf); functype(*func)=readtypemode(dfile,buf,BUFFER_SIZE,&funcmode(*func)); break; case 2: /*This is a wrapper*/ nargs=readnumber(dfile,buf,BUFFER_SIZE); func->wrap = newwrap(nargs); for(j=0;jwrap->w[j]=*buf?(buf[1]?nw:-1):-2; } break; default: die(err_desc,"Unknown description type %d in %s",type,descfile); } } } fclose(dfile); } int descrulescore(int nb, int *args, gpdescarg *ga, int * const psc,int * const pesc) { int sc=0, esc=0; int i,j; descargatom *da=ga->args; for (i=0, j=0;jnargs;j++, i++) { int t; int arg=(i=nb) break; j--; } if (arg==GNOARG) { if (da[j].t==AAnoarg || da[j].t==AAoptsmall || da[j].t==AAopttype) { esc++; if (i>=nb) sc++; continue; } return 1; } if (arg<0) die(err_desc,"Internal error: Bad argument in descfindrules"); if (da[j].mode>=0) { if ((tree[arg].m&da[j].mode)==da[j].mode) esc++; else return 1; } t=tree[arg].t; switch(da[j].t) { case AAopttype: /* Since arg is not GNOARG, arg is present */ case AAtype: if (t==da[j].type) esc++; if (is_subtype(t,da[j].type)) break; if (is_subtype(da[j].type,t)) sc++; else return 1; break; case AActype: if (ctype[t]==da[j].misc) esc++; else return 1; break; case AAoptsmall: /* Since arg is not GNOARG, arg is present */ case AAsmall: if (tree[arg].f==Fsmall && tree[arg].x==da[j].misc) esc++; else return 1; break; case AAstring: if (is_const(arg,CSTstr) && strcmp(entryname(arg),da[j].str)==0) esc++; else return 1; break; case AAreftype: if (t==da[j].type) esc++; if (tree[arg].f==Frefarg && is_subtype(da[j].type,t) && ctype[t]==ctype[da[j].type]) break; return 1; case AAherevalue: if (t==da[j].type && (tree[arg].f==Fsmall || tree[arg].f==Fconst)) { esc++; break; } return 1; case AAlvalue: if (getlvalue(arg)<0) return 1; if (t==da[j].type) esc++; else if (ctype[t]!=ctype[da[j].type] || !is_subtype(t,da[j].type)) return 1; break; case AAmulti: if (tree[arg].f==Fentry || tree[arg].f==Fsmall) break; return 1; case AAnoarg:/* Since arg is not GNOARG, reject*/ return 1; default: die(err_desc,"Internal error unknown AAvalue in descrulescore"); } } if (ia; for(i=0;inb;i++) { int sc=0, esc=0; if (descrulescore(nb,arg,ga+i,&sc,&esc)) continue; if (best==-1 || scescore )) { score=sc; escore=esc; best=i; } } return (best==-1)?NULL:ga+best; } gpdescarg *descfindrules(int nb, int *arg, gpfunc *gp) { return descfindrulesdsc(nb, arg, gp->dsc); } gpdescarg *descfindrules1(int arg, int nf) { return descfindrules(1, &arg, lfunc+nf); } int gentypefuncdesc(int n, gpfunc *gp) { int arg[STACKSZ]; int i, nb; int y=tree[n].y; gpdescarg *rule; if ( y!=-1 ) { gentype(y); tree[n].m|=tree[y].m&MODHERIT; } nb=genlistargs(n,arg,0,STACKSZ); rule=descfindrules(nb,arg,gp); if (!rule) return Gnotype; for(i=0;inargs;i++) if (rule->args[i].t==AAlvalue) { int ta=tree[arg[i]].t, ts=rule->args[i].type; if (!is_subtype(ts,ta)) warning(n,"Assignement to a less precise type: %s<-%s",GPname(ta),GPname(ts)); } tree[n].m|=rule->mode; return rule->type; } enum FBenum {FBparens, FBstdref} flagbit; struct rpn_data { FILE *fout; gpdescarg *rule; int nbarg; int *arg; int nerr; int nf; int sp; long flag; }; static int get_arg(struct rpn_data *d, int n) { if (n<=d->nbarg) return d->arg[n-1]; return GNOARG; } static int get_str(struct rpn_data *d, int n) { int x=get_arg(d,n); if (tree[x].f!=Fconst && value[tree[x].x].type!=CSTstr) die(n,"Constant string expected"); return x; } static descargatom* get_atom(struct rpn_data *d, int n) { if(n>d->rule->nargs) die(d->nerr,"Too few parameters"); return d->rule->args+n-1; } static void cast_flag(struct rpn_data *d, int n, int t) { gencastf(d->fout,n,t,d->flag&(1<sp-=(n) #define push(n) d->sp+=(n) #define LVL(n) (stk[d->sp-1-(n)]) #define NOLVL ((void)stk) RPN(rpn_add) {LVL(1)+=LVL(0); pop(1);} RPN(rpn_sub) {LVL(1)-=LVL(0); pop(1);} RPN(rpn_mul) {LVL(1)*=LVL(0); pop(1);} RPN(rpn_div) {LVL(1)/=LVL(0); pop(1);} RPN(rpn_mod) {LVL(1)%=LVL(0); pop(1);} RPN(rpn_and) {LVL(1)&=LVL(0); pop(1);} RPN(rpn_or) {LVL(1)|=LVL(0); pop(1);} RPN(rpn_xor) {LVL(1)^=LVL(0); pop(1);} RPN(rpn_neg) {LVL(0)=-LVL(0);} RPN(rpn_not) {LVL(0)=!LVL(0);} RPN(rpn_nbarg) {push(1);LVL(0)=d->nbarg;} RPN(rpn_parens) {NOLVL;d->flag|=1<flag|=1<fout, get_str(d, LVL(0))); pop(1); } RPN(rpn_str_raw) { fputs(entryname(get_str(d, LVL(0))),d->fout); pop(1); } RPN(rpn_type) { LVL(0)=get_atom(d, LVL(0))->type; } RPN(rpn_value) { int n=get_arg(d,LVL(0)); if (tree[n].f!=Fsmall) die(n,"Not an immediate small"); LVL(0)=tree[n].x; } RPN(rpn_cast) { int n=get_arg(d,LVL(1)); int cast=LVL(0); descargatom *r=get_atom(d, LVL(1)); int t=(cast==-1)?r->type:cast; switch(r->t) { case AAstdarg: { int i; int x=LVL(1)-1; if (x==0) die(d->nerr,"No argument before ellipsis (...)"); t=r[-1].type; for(i=x-1;inbarg;i++) { if (i>=x) fprintf(d->fout,", "); if (d->flag&(1<fout,"&"); gencast(d->fout,d->arg[i],t); } } break; case AAoptsmall: fprintf(d->fout,"%d",r->misc); break; case AAopttype: if (n==GNOARG) gencodenoarg(d->fout,t,n); else cast_flag(d,n,t); break; case AActype: if (cast==-1) t=tree[n].t; default: /*Fall through*/ cast_flag(d,n,t); break; } pop(2); } RPN(rpn_code) { push(1); LVL(0)=-1; rpn_cast(d,stk); } RPN(rpn_wrapper) { int idx = LVL(0); int n = get_arg(d,idx); gpfunc *gp; pop(1); if (isfunc(n,"_closure")) { int y = tree[n].y; while(tree[y].f==Flistarg) y=tree[y].x; gp = lfunc+findfunction(entryname(y)); if (gp->spec==GPuser && gp->user->wrapper>=0) { fprintf(d->fout, "wrap_%s", gp->proto.cname); return; } } gp = lfunc+lfunc[d->nf].wrap->w[idx-1]; fputs(gp->proto.cname, d->fout); } RPN(rpn_cookie) { int arg[STACKSZ]; int n=get_arg(d,LVL(0)); if (isfunc(n,"_closure")) { int nb=genlistargs(n,arg,1,STACKSZ-1); gpfunc *gp = lfunc + findfunction(entryname(arg[0])); if (gp->spec==GPuser && gp->user->wrapper>=0) { if (funcmode(*gp)&(1<fout, nb-1,arg+1,FC_tovecprec,d->nerr); else { if (nb==1) fputs("NULL", d->fout); else genfuncbydesc(d->fout, nb-1,arg+1,FC_tovec,d->nerr); } pop(1); return; } } rpn_code(d,stk); } RPN(rpn_format_string) { int x=LVL(0)-1; int i,j; int arg[STACKSZ]; if (x==0) die(d->nerr,"Ellipsis at start of description"); for(j=x-1;jnbarg;j++) { int nb=genlistcats(d->arg[j],arg,STACKSZ); for(i=0;ifout,n,FC_formatcode,n)) die(n,"No format for %s arg",GPname(tree[n].t)); } } pop(1); } RPN(rpn_format_args) { int x=LVL(0)-1; int arg[STACKSZ]; int i,j; if (x==0) die(d->nerr,"Ellipsis at start of description"); for(j=x-1;jnbarg;j++) { int nb=genlistcats(d->arg[j],arg,STACKSZ); for(i=0;itype!=Gvoid) { fprintf(d->fout,", "); gencast(d->fout,arg[i],rule->type); } } } pop(1); } const char *gencoderpn(FILE *fout, const char *p, gpdescarg *rule, int nbarg, int *arg, int nerr, int nf) { int stk[STACKSZ]; struct rpn_data data; const char *ps = p+1; struct rpn_func rpn[] = { {"add",2,rpn_add},{"sub",2,rpn_sub},{"neg",1,rpn_neg}, {"mul",2,rpn_mul},{"div",2,rpn_div},{"mod",2,rpn_mod}, {"and",2,rpn_and},{"or",2,rpn_or},{"xor",2,rpn_xor},{"not",1,rpn_not}, {"value",1,rpn_value},{"type",1,rpn_type},{"nbarg",0,rpn_nbarg}, {"parens",0,rpn_parens},{"stdref",0,rpn_stdref}, {"str_format",1,rpn_str_format},{"str_raw",1,rpn_str_raw}, {"code",1,rpn_code},{"cast",2,rpn_cast}, {"format_string",1,rpn_format_string}, {"format_args",1,rpn_format_args}, {"cookie",1,rpn_cookie}, {"wrapper",1,rpn_wrapper}, {NULL,0,NULL} }; data.fout=fout; data.rule=rule; data.nbarg=nbarg; data.arg=arg; data.nerr=nerr; data.nf=nf; data.flag=0; data.sp=0; for(;;p++) { if (!*p) die(nerr,"Unfinished ${} in description"); if (*p==' ' || *p=='}' ) { size_t l=p-ps; if (isdigit(ps[0]) || ps[0]=='-') stk[data.sp++]=strtol(ps,NULL,10); else if (ps[0]==':') stk[data.sp++]=strtotype_len(ps+1,l-1); else { int r; for(r=0; rpn[r].name; r++) { const char *name=rpn[r].name; if (l==strlen(name) && !strncmp(ps,name,l)) { if (rpn[r].arity>data.sp) die(nerr,"Too few arguments for %s",name); rpn[r].function(&data,stk); break; } } if(!rpn[r].name) die(nerr,"Unknown description command %s",xstrndup(ps,l)); } ps=p+1; if(*p=='}') break; } } if (data.sp) fprintf(fout,"%d",stk[--data.sp]); return p; } void gencodedesc(FILE *fout, int nb, int *arg, gpdescarg *rule, int nerr, int nf) { char buf[STACKSZ]; const char *p; int mode; p=rule->cname; mode=0; do { switch(mode) { case 0: if (*p=='$') mode=1; else if (*p) fputc(*p,fout); break; case 1: switch(*p) { case '$': mode=0; fprintf(fout,"$"); break; case '"': { char *s=(char*) memccpy(buf,p+1,'"',STACKSZ-1); if (!s) die(nerr,"Unfinished \" in description"); *(s-1)=0; die(nerr,buf); } case 0: die(nerr,"Unfinished $ in description"); case '{': p=gencoderpn(fout, p, rule, nb, arg, nerr, nf); mode=0; break; default: die(nerr,"Unknown description"); } } } while(*p++); } int genfuncbydesc(FILE *fout, int nb, int *arg, int nf, int nerr) { gpdescarg *rule=descfindrules(nb, arg, lfunc+nf); if (!rule) return 1; gencodedesc(fout,nb, arg, rule, nerr, nf); return 0; } int genfuncbydesc1(FILE *fout, int arg, int nf, int nerr) { return genfuncbydesc(fout, 1, &arg, nf, nerr); } gp2c-0.0.8/src/gp2c.c0000644000175000017500000002675312163306441011076 00000000000000/* Copyright (C) 2000-2013 The PARI group. This file is part of the GP2C package. PARI/GP is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY WHATSOEVER. Check the License for details. You should have received a copy of it, along with the package; see the file 'COPYING'. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define TYPE #include "config.h" #include #include #include #include #include #include "header.h" FILE *yyin; int yyparse (void); void yyrestart(FILE *new_file); void patchfunclist(void); void inittype(void); void initoperators(void); int linecount; int yydebug; static int optgen=0,opttree=0,opttype=0,optinfo=0; int optstrict=0; int optcleanvar=0;/*used in genbrace to suppress {} optimization*/ int indentlevel=2; int do_warning=1; char *optprefix,*optsuffix; int debug; const char *nameparse, *namelib; int lastpass; int autogc; int warn; int safecoeff; void printlistfunc(FILE *fout); void outputtype(FILE *fout); void cleancode(int n, int p); void cleanvar(int n); void initdesc(const char *s); void maketreeGRL(FILE *fout,int n); void dump(FILE *fout) { int i,j; for(i=0;iuser->bl; fprintf(fout,"Function:\n %s(",gp->proto.cname); for(j=0;js.n;j++) { if (fc->c[j].flag&(1<c[j])),varstr(fc->c[j])); } fprintf(fout,")\n"); if (strcmp(gp->gpname,gp->proto.cname)) fprintf(fout,"GP name: %s\n",gp->gpname); fprintf(fout,"code: %s\n",gp->proto.code); fprintf(fout,"return type: %s\n",GPname(functype(*gp))); fprintf(fout,"mode=%d \t spec=%d\n",funcmode(*gp),gp->spec); for( ;js.n;j++) { ctxvar *c=fc->c+j; if (!((c->flag&(1<flag&(1<val==-1))) fprintf(fout,"%s %s\n",GPname(vartype(*c)),varstr(*c)); } fprintf(fout,"\n"); } } extern int indent; void init_compiler(void) { int n; stack_init(&s_node,sizeof(*tree),(void **)&tree); stack_init(&s_value,sizeof(*value),(void **)&value); stack_init(&s_func,sizeof(*lfunc),(void **)&lfunc); stack_init(&s_ctx,sizeof(*ctxstack),(void **)&ctxstack); stack_init(&s_aff,sizeof(*affstack),(void **)&affstack); stack_init(&s_bloc,sizeof(*block),(void **)&block); stack_init(&s_comment,sizeof(*com),(void **)&com); stack_init(&s_errors,sizeof(*errors),(void **)&errors); stack_init(&s_Ctype,sizeof(*Ctype),(void **)&Ctype); stack_init(&s_GPtype,sizeof(*GPtype),(void **)&GPtype); stack_init(&s_Mmode,sizeof(*Mmode),(void **)&Mmode); stack_init(&s_label,sizeof(*label),(void **)&label); /*Node 0 should be a (Gvoid)Fnoarg*/ n=newnode(Fnoarg,-1,-1); tree[n].t=Gvoid; /*Node 1 should be a (Gnotype)Fnoarg*/ n=newnode(Fnoarg,-1,-1); tree[n].t=Gnotype; } void init_stdfunc(void) { FC_badtype=findfuncdesc("_badtype"); FC_formatcode=findfuncdesc("_formatcode"); FC_tovec=findfuncdesc("_tovec"); FC_tovecprec=findfuncdescopt("_tovecprec"); FC_cast=findfuncdesc("_cast"); FC_proto_ret=findfuncdesc("_proto_ret"); FC_proto_code=findfuncdesc("_proto_code"); FC_decl_base=findfuncdesc("_decl_base"); FC_decl_ext=findfuncdesc("_decl_ext"); FC_default_check=findfuncdesc("_default_check"); FC_default_marker=findfuncdesc("_default_marker"); FC_gerepileupto=findfuncdesc("_gerepileupto"); FC_const_smallreal=findfuncdesc("_const_smallreal"); FC_const_expr=findfuncdesc("_const_expr"); FC_copy=findfuncdesc("copy"); FC_avma=findfuncdesc("_avma"); Gpari_sp=findfunctype("_avma"); FC_low_stack_lim=findfuncdesc("_low_stack_lim"); FC_gerepileall=findfuncdesc("_gerepileall"); FC_forprime_init=findfuncdescopt("_forprime_init"); if (FC_forprime_init>=0) Gforprime=strtotype("forprime"); else { Gforprime=findfunctype("_diffptr"); FC_forprime_next=findfuncdesc("_forprime_next"); } Gerror=findfunctypeopt("_iferr_error"); FC_matrixrow=findfuncdescopt("_[_,]"); FC_const_real=findfuncdescopt("_const_real"); FC_call=findfuncdescopt("_(_)"); FC_strtoclosure=findfuncdescopt("_strtoclosure"); FC_proto_max_args=findfuncdescopt("_proto_max_args"); max_args = FC_proto_max_args<0 ? 8 : lfunc[FC_proto_max_args].dsc->a[0].args[0].misc; if (safecoeff && findfuncdescopt("_safecoeff")<0) { warning(-1,"gp2c option -C not supported by this PARI version"); safecoeff=0; } } void init_typedef(void) { gpdesc *def=lfunc[findfuncdesc("_typedef")].dsc; int r; ctype=(int*)calloc(s_GPtype.n,sizeof(*ctype)); for (r=0; rnb; r++) { gpdescarg *rule=def->a+r; int t=rule->args[0].type; ctype[t]=strtoctype(rule->cname); } Vgen=strtoctype("GEN"); } void compile(FILE *fin, FILE *fout, const char *nom) { const char *descfile; char *tmplib; int startnode; int status; int i; init_compiler(); linecount=1; nameparse=nom; tmplib=(char*)calloc(strlen(nameparse)+6,sizeof(*nameparse)); sprintf(tmplib,"%s%s.so",nameparse[0]=='/'?"":"./",nameparse); namelib=tmplib; yyin=fin; currfunc=-1; initoperators(); if (!(descfile=getenv("GP2C_FUNC_DSC"))) descfile=FUNCDSC_PATH; for(i=0;GPneeded[i];i++) newtype(GPneeded[i]); for(i=0; Mneeded[i];i++) newmode( Mneeded[i]); initdesc(descfile); inittype(); patchfunclist(); if(opttype) {outputtype(fout);exit(0);} init_stdfunc(); init_typedef(); startnode=s_node.n-1; status=yyparse(); for(i=0;ilineno,s->txt); } if(status) { fprintf(stderr,"Errors found: aborting...\n"); exit(1); } if (s_errors.n) { fprintf(stderr,"%d error%s found: aborting...\n",s_errors.n,s_errors.n==1?"":"s"); exit(1); } if (startnode==s_node.n-1) startnode=GNIL; else startnode=s_node.n-1; if (optgen) { printnode(fout,startnode); printf("\n"); return; } if (yydebug) fprintf(stderr,"End of parsing\n"); startnode=addseqleft(newnode(Ffunction,newentry("_initfunc"),-1),startnode); gentoplevel(startnode,-1); startnode=addinitfunc(startnode); if (debug>1) printnode(stderr,startnode); gentopfunc(startnode,-1,-1,-1); if (debug) { fprintf(stderr,"\n--------------END TOPFUNC------------\n"); printnode(stderr,startnode); } genblock(startnode,-1); if (opttree==1) { maketree(stderr,startnode); fprintf(stderr,";\n"); } if (debug) printnode(stderr,startnode); lastpass=0; gentype(startnode); do_warning=0; while (lastpass) { lastpass=0; gentype(startnode); } do_warning=1; if (debug>=2) { fprintf(stderr,"\n--------------END GENTYPE------------\n"); printnode(stderr,startnode); } gendeblock(startnode,-1,0,NULL,NULL); moveblock(startnode,-1,0,NULL,NULL); if (debug) { fprintf(stderr,"\n--------------END MOVEBLOCK------------\n"); printnode(stderr,startnode); } do { lastpass=0; varlist(startnode); } while(lastpass); if (!optcleanvar) cleanvar(startnode); pilelist(startnode); if (autogc) pileclean(startnode); if (optinfo) dump(stderr); if (!optcleanvar) cleanvar(startnode); cleancode(startnode,-1); if (tree[startnode].f==Fseq && tree[startnode].y==GNIL) startnode=tree[startnode].x; switch(opttree) { case 1: maketree(stderr,startnode); break; case 2: maketreeGRL(stderr,startnode); break; } if (debug) { fprintf(stderr,"\n--------------END CLEANCODE------------\n"); printnode(stderr,startnode); } indent=0; genheader(fout); gencode(fout,startnode); } void version(void) { printf("GP to C compiler version %s \n targeted at PARI/GP %s\n",VERSION,PARI_VERSION); printf("Copyright 2000-2013 The PARI Group\n"); printf("GP2C is free software, covered by the GNU General Public License, and \n\ you are welcome to change it and/or distribute copies of it under \n\ certain conditions. There is absolutely no warranty for GP2C.\n"); } void usage(FILE *fout, char *s) { fprintf(fout,"%s [-ghfltvydSWTGV] [-o ] [-i N] [-p ] [file.gp] \n\ GP to C translator. \n\ \n\ user option: \n\ -o : Place output in file . \n\ -g : Generate automatic garbage collection code. \n\ -iN: Set indentation level to N spaces (default 2). \n\ -W : Output information about global variables. \n\ -p : Prefix user-defined symbol by to avoid conflict. \n\ -s : Add suffix to GP install names of functions. \n\ -S : Assume strict declarations for functions. \n\ query options: \n\ -h : This help. \n\ -f : Dump information about functions to stderr. \n\ -l : Output the list of functions known to the compiler. \n\ -t : Output the table of types known to the compiler. \n\ -v : Output version information and exit. \n\ debugging options: \n\ -d : Increase debugging level. \n\ -y : Switch parser to debug mode. \n\ -T : Output syntactic tree in treetool format. \n\ -TT: Output syntactic tree in VCG/GRL format. \n\ -G : Generate GP code in place of C code. Don't smile. \n\ -V : Do not clean up variables. \n\ \n\ file.gp: file to be processed, default to stdin. \n\ The generated C code is output to stdout unless the -o option is used \n\ \n\ See the script gp2c-run for an automated compilation process. \n\ ",s); } int main(int argc, char **argv) { int c; FILE *fin=stdin; FILE *fout=stdout; const char *outfile = NULL, *infile = "stdin"; autogc=0; safecoeff=0; warn=0; optprefix=NULL; optsuffix=NULL; while((c=getopt(argc,argv,"gi:hflo:p:s:StvydCGTVW"))!=-1) { switch(c) { case 'g': autogc=1-autogc; break; case 'i': indentlevel=atoi(optarg); break; case 'h': usage(stdout,argv[0]); exit(0); break; case 'f': optinfo=1-optinfo; break; case 'l': { const char *descfile; init_compiler(); if (!(descfile=getenv("GP2C_FUNC_DSC"))) descfile=FUNCDSC_PATH; initdesc(descfile); patchfunclist(); printlistfunc(fout); exit(0); } case 'o': outfile=strdup(optarg); break; case 'p': optprefix=strdup(optarg); break; case 's': optsuffix=strdup(optarg); break; case 'S': optstrict=1-optstrict; break; case 't': opttype=1-opttype; break; case 'v': version(); exit(0); case 'd': debug++; debug_stack=debug>1; break; case 'y': yydebug++; break; case 'T': opttree++; break; case 'G': optgen=1-optgen; break; case 'V': optcleanvar=1-optcleanvar; break; case 'C': safecoeff=1-safecoeff; break; case 'W': warn=1-warn; break; case '?': usage(stderr,argv[0]); exit(1); break; } } if (argc-optind>1) { usage(stderr,argv[0]); exit(1); } if (argc!=optind) { infile = argv[optind]; if ((fin=fopen(infile,"r"))==NULL) { perror(argv[0]); exit(errno); } } if (outfile && ((fout=fopen(outfile,"w"))==NULL)) { perror(argv[0]); exit(errno); } compile(fin,fout,infile); if (fin!=stdin) fclose(fin); if (fout!=stdout) fclose(fout); return 0; } gp2c-0.0.8/src/parse.h0000644000175000017500000000637712155572737011400 00000000000000 /* A Bison parser, made by GNU Bison 2.4.1. */ /* Skeleton interface for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { KDOTDOT = 258, KPARROW = 259, KARROW = 260, KPE = 261, KSE = 262, KME = 263, KDE = 264, KDRE = 265, KEUCE = 266, KMODE = 267, KAND = 268, KOR = 269, KID = 270, KEQ = 271, KNE = 272, KGE = 273, KLE = 274, KSRE = 275, KSLE = 276, KSR = 277, KSL = 278, KDR = 279, KPP = 280, KSS = 281, KINTEGER = 282, KREAL = 283, KENTRY = 284, KSTRING = 285, DEFFUNC = 286, SEQ = 287, LVAL = 288, INT = 289, SIGN = 290, MAT = 291 }; #endif /* Tokens. */ #define KDOTDOT 258 #define KPARROW 259 #define KARROW 260 #define KPE 261 #define KSE 262 #define KME 263 #define KDE 264 #define KDRE 265 #define KEUCE 266 #define KMODE 267 #define KAND 268 #define KOR 269 #define KID 270 #define KEQ 271 #define KNE 272 #define KGE 273 #define KLE 274 #define KSRE 275 #define KSLE 276 #define KSR 277 #define KSL 278 #define KDR 279 #define KPP 280 #define KSS 281 #define KINTEGER 282 #define KREAL 283 #define KENTRY 284 #define KSTRING 285 #define DEFFUNC 286 #define SEQ 287 #define LVAL 288 #define INT 289 #define SIGN 290 #define MAT 291 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { /* Line 1676 of yacc.c */ #line 32 "parse.y" int val; strcom str; /* Line 1676 of yacc.c */ #line 131 "y.tab.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE yylval; gp2c-0.0.8/src/patchfunc.h0000644000175000017500000000574112165115645012223 00000000000000/* Copyright (C) 2000-2005 The PARI group. This file is part of the GP2C package. PARI/GP is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY WHATSOEVER. Check the License for details. You should have received a copy of it, along with the package; see the file 'COPYING'. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /*Patch for list of gp functions. Must be include after header.h.*/ typedef enum {GPuser_private, GPgpmany, GPinstall,GPaddhelp, GPgrandO, GPbreak,GPnext,GPreturn, GPfor,GPforstep,GPforstepvec,GPforprime,GPforvec,GPfordiv, GPdoloop, GPlabel, GPglobal,GPlocal, GPif, GPprod,GPsum,GPsumdiv,GPprodeuler, GPuntil,GPwhile,GPwhilenull, GPmakevec,GPmakemat, GPvector,GPvectorsmall,GPvectorv,GPmatrix, GPiferr, GPinitfunc,GPcopyarg, GPclosure } GPspec_private; struct patchfunc_s { const char *gpname; const char *code; int type; int mode; int spec; } patchfunc[]={ /*Override previous definition in pari/src/init.c*/ {"O",NULL,Ggen,0,GPgrandO}, {"addhelp",NULL,Gnotype,(1< #include #include #include "header.h" void varlistaff(int sava, int savc, stack *v) { affnode **an=(affnode **) stack_base(v); int i; v->n=0; for (i=sava;iflag&(1<initval>=0) { varlist(v->initval); newaff(AFassign,idx); } } void varlistfunc(int n,int fc) { gpfunc *gp=lfunc+fc; gpproto pro=gp->proto; const char *proto=pro.code; int i=0; char const *p=proto; char c; PPproto mod; int arg[STACKSZ]; int nb=genlistargs(n,arg,0,STACKSZ); gpdescarg *rule=gp->dsc?descfindrules(nb,arg,gp):NULL; if (rule) { for (i=0; inargs; i++) { switch(rule->args[i].t) { case AAlvalue: case AAreftype: { int v, a=detag(arg[i]); if (tree[a].f==Frefarg) a=tree[a].x; v=getvarerr(getlvaluerr(a)); newaff(AFrefarg,v); if (tree[a].f!=Fentry) newaff(AFassigncompo,v); break; } default: break; } } return; } if (!proto) return; while((mod=parseproto(&p,&c))) { switch(mod) { case PPdefault: if (i>=nb || arg[i]==GNOARG) { i++; break; } case PPauto: case PPstd: /* Fall through */ switch(c) { case '&': case '*': case 'W': { int v, a=detag(arg[i]); if (tree[a].f==Frefarg) a=tree[a].x; v=getvarerr(getlvaluerr(a)); newaff(AFrefarg,v); if (c=='W' || tree[a].f!=Fentry) newaff(AFassigncompo,v); break; } } i++; break; case PPdefaultmulti: i++; break; case PPstar: i=nb; break; default: die(n,"internal error: PPproto %d in varlistfunc",mod); } } if(ispec==GPuser) { userfunc *uf=gp->user; int base=lfunc[currfunc].user->savb;/*currfunc!=fc*/ int i; char *c; c=calloc(base,sizeof(*c)); for(i=0;iv.n;i++) { affnode *an=uf->var+i; if (an->idxidx].flag&(1<f!=AFaccess && an->f!=AFhide && c[an->idx]==0) { c[an->idx]=1; newaff(AFassign,an->idx); } } free(c); } else varlistfunc(n,fc); } break; case Fdeffunc: { int funcid=tree[n].x; const char *name=entryname(funcid); int savcf=currfunc; userfunc *uf; /*get func number and context*/ currfunc=findfunction(name); uf=lfunc[currfunc].user; savc=s_ctx.n; uf->savb=savc; sava=s_aff.n; varlist(y); nv=uf->v.n; varlistaff(sava,savc,&uf->v); if (nv!=uf->v.n) lastpass=1; currfunc=savcf; } break; case Fblock: savc=s_ctx.n; sava=s_aff.n; bl=block+tree[n].x; for (i=0;is.n;i++) { ctxvar *v=bl->c+i; int nv=getvarbyname(varstr(*v)); if (nv!=-1) newaff(AFhide,nv); } pushctx(bl); savb=s_ctx.n; for(i=0;is.n;i++) varlistvar(savc+i); varlist(y); nv=bl->v.n; varlistaff(sava,savb,&bl->v); if (nv!=bl->v.n) lastpass=1; bl->savb=savb; copyctx(savc,bl); s_ctx.n=savc; break; default: if (tree[n].f>=FneedENTRY) die(n,"Incorrect node %s in varlist",funcname(tree[n].f)); varlist(x); varlist(y); } } gp2c-0.0.8/src/gencode.c0000644000175000017500000002246012172024005011627 00000000000000/* Copyright (C) 2000-2005 The PARI group. This file is part of the GP2C package. PARI/GP is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY WHATSOEVER. Check the License for details. You should have received a copy of it, along with the package; see the file 'COPYING'. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" #include #include #include #include #include "header.h" int indent=0; extern int indentlevel; void genindent(FILE *fout) { int i; for (i=0;is.n-1;i++) { if (c->txt[i]=='\n') { if (!flag) fputc('\n',fout); genindent(fout); while(c->txt[i+1]==' ' || c->txt[i+1]=='\t') i++; } else fputc(c->txt[i],fout); } if (c->txt[i]=='\n') { if (!flag) fputc('\n',fout); if (!(tree[n].m&(1<txt[i],fout); } void gensemicolon(FILE *fout, int x) { if (x!=-1 && !(tree[x].m&(1<gpname,(optsuffix?optsuffix:"")); nb=genlistcats(h,stack,STACKSZ); for(i=0;iuser->bl; if (!descfindrules1(gp->node, FC_proto_ret)) return 1; for (i=0;is.n;i++) { ctxvar *v=fc->c+i; if ( v->flag&(1<node, FC_proto_code)) nargs++; else return 1; } } if (max_args>0 && nargs>max_args) return 1; return 0; } /*If there is no suitable GP prototype, just print nothing*/ void geninstall(FILE *fout, int nf) { int i; gpfunc *gp=lfunc+nf; if(gp->spec==GPuser) { context *fc=block+gp->user->bl; if (checkinstall(gp)) return; fprintf(fout,"GP;install(\"%s\",\"",gp->proto.cname); genfuncbydesc1(fout,gp->node,FC_proto_ret,-1); for (i=0;is.n;i++) { ctxvar *v=fc->c+i; if ( v->flag&(1<flag&(1<node,FC_proto_code,-1); } else if (v->initval<0) genfuncbydesc1(fout,v->node,FC_proto_code,-1); else { fputc('D',fout); printnode(fout,v->initval); fputc(',',fout); genfuncbydesc1(fout,v->node,FC_proto_code,-1); fputc(',',fout); } } } if (funcmode(*gp)&(1<proto.cname); genfuncbydesc1(fout,gp->node,FC_proto_ret,-1); fprintf(fout,"%s",gp->proto.code); } /* Member function has a gpname of "_.func" which is not a valid * GP func name. * we use "m_" instead. */ if( gp->gpname[0]=='_' && gp->gpname[1]=='.' ) fprintf(fout,"\",\"m_%s%s\"",gp->gpname+2,(optsuffix?optsuffix:"")); else fprintf(fout,"\",\"%s%s\"",gp->gpname,(optsuffix?optsuffix:"")); if (gp->proto.origin) fprintf(fout,",\"%s\"",gp->proto.origin); fprintf(fout,");\n"); } void genheader(FILE *fout) { int i; fprintf(fout,"/*-*- compile-command: \""); fprintf(fout,PARI_MODULE_BUILD,nameparse,nameparse,nameparse,nameparse); fprintf(fout,"\"; -*-*/\n"); fprintf(fout,"#include \n"); fprintf(fout,"/*\n"); for(i=0;iflag&(1<flag&(1<node,v->node); fprintf(fout,";\n"); } fprintf(fout,"/*End of global vars*/\n\n"); } } void gencode(FILE *fout, int n) { int x=tree[n].x; int y=tree[n].y; if (n<0) return; if (tree[n].comment>=0) { if (tree[n].m&(1<=3) fprintf(fout,"/*%s:%d*/",GPname(tree[n].t),tree[n].m); switch(tree[n].f) { case Fseq: genindentseq(fout,x); gencode(fout,x); gensemicolon(fout,x); genindentseq(fout,y); gencode(fout,y); gensemicolon(fout,y); break; case Fassign: genfacteuraff(fout,x,y); break; case Fconst: { long val=value[x].val.small; const char *str=value[x].val.str; long typ=value[x].type; switch (typ) { case CSTsmall: fprintf(fout,"%ld",val); break; case CSTsmallreal: { int arg=newsmall(val); tree[arg].t=Gsmall; if (genfuncbydesc1(fout,arg,FC_const_smallreal,n)) die(n,"Bad description for _const_smallreal"); stack_pop_safe(&s_node,arg); } break; case CSTint: case CSTreal: { int arg=newstringnode(str,-1); int fc=FC_const_expr; tree[arg].t=Gstr; if (FC_const_real>=0 && typ==CSTreal) fc=FC_const_real; if (genfuncbydesc1(fout,arg,fc,n)) die(n,"Bad description for _const_expr"); stack_pop_safe(&s_value,tree[arg].x); stack_pop_safe(&s_node,arg); } break; case CSTstr: genstring(fout,str); break; } break; } case Fsmall: fprintf(fout,"%d",tree[n].x); break; case Frefarg: gencode(fout,x); break; case Fentry: genentry(fout,n); break; case Ffun: { gpfunc *gp=lfunc+tree[n].x; fprintf(fout,"%s",gp->proto.cname); } break; case Ffunction: genentryfunc(fout,n); break; case Fdeffunc: gendeffunc(fout,n); break; case Fblock: gendefblock(fout,n); break; case Fnoarg: fputc('0',fout); break; case Ftag: gencast(fout,x,y); break; default: die(n,"Internal error : unknown func %s in gencode",funcname(tree[n].f)); break; } } void genparensg(FILE *fout, int n) { if (n!=-1 && (tree[n].m&(1</dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : bin_PROGRAMS = gp2c$(EXEEXT) subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/config.h.in lang.c parse.c parse.h ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_gp2c_OBJECTS = gp2c.$(OBJEXT) context.$(OBJEXT) funcdesc.$(OBJEXT) \ funcspec.$(OBJEXT) genblock.$(OBJEXT) gencast.$(OBJEXT) \ gencode.$(OBJEXT) genfunc.$(OBJEXT) gentype.$(OBJEXT) \ gerepile.$(OBJEXT) lang.$(OBJEXT) moveblock.$(OBJEXT) \ node.$(OBJEXT) parse.$(OBJEXT) printnode.$(OBJEXT) \ toplevel.$(OBJEXT) topfunc.$(OBJEXT) util.$(OBJEXT) \ varlist.$(OBJEXT) stack.$(OBJEXT) gp2c_OBJECTS = $(am_gp2c_OBJECTS) gp2c_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ @MAINTAINER_MODE_FALSE@am__skiplex = test -f $@ || LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) YLWRAP = $(top_srcdir)/config/ylwrap @MAINTAINER_MODE_FALSE@am__skipyacc = test -f $@ || YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) SOURCES = $(gp2c_SOURCES) DIST_SOURCES = $(gp2c_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHOC = @ECHOC@ ECHON = @ECHON@ ECHOT = @ECHOT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GP2C_DBG = @GP2C_DBG@ GP2C_DBG1 = @GP2C_DBG1@ GP_PATH = @GP_PATH@ GP_PATH_DBG = @GP_PATH_DBG@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARI_DATADIR = @PARI_DATADIR@ PARI_DESC = @PARI_DESC@ PARI_MODULE_BUILD = @PARI_MODULE_BUILD@ PARI_MODULE_DEBUG = @PARI_MODULE_DEBUG@ PARI_RUNTEST = @PARI_RUNTEST@ PARI_VERSION = @PARI_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_PATH = @PERL_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ mybindir = @mybindir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = -DFUNCDSC_PATH=\"@datadir@/@PACKAGE@/func.dsc\" BUILT_SOURCES = parse.h gp2c_SOURCES = gp2c.c context.c funcdesc.c funcspec.c genblock.c gencast.c gencode.c genfunc.c gentype.c gerepile.c header.h lang.l moveblock.c node.c optable.h parse.y patchfunc.h printnode.c toplevel.c topfunc.c type.h util.c varlist.c stack.h stack.c AM_YFLAGS = -d all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .l .o .obj .y $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then rm -f stamp-h1; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) parse.h: parse.c @if test ! -f $@; then rm -f parse.c; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) parse.c; else :; fi gp2c$(EXEEXT): $(gp2c_OBJECTS) $(gp2c_DEPENDENCIES) $(EXTRA_gp2c_DEPENDENCIES) @rm -f gp2c$(EXEEXT) $(LINK) $(gp2c_OBJECTS) $(gp2c_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/context.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/funcdesc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/funcspec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genblock.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gencast.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gencode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genfunc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gentype.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gerepile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gp2c.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lang.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/moveblock.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/node.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printnode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/topfunc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/toplevel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/varlist.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .l.c: $(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) .y.c: $(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE) ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) config.h installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -rm -f lang.c -rm -f parse.c -rm -f parse.h -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: all check install install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags distclean distclean-compile \ distclean-generic distclean-hdr distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS ctags: ctags $(gp2c_SOURCES) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: gp2c-0.0.8/src/lang.c0000644000175000017500000016423712155572740011174 00000000000000 #line 3 "lex.yy.c" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include #include #include #include /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! C99 */ #endif /* ! FLEXINT_H */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST #endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart(yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k. * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. * Ditto for the __ia64__ case accordingly. */ #define YY_BUF_SIZE 32768 #else #define YY_BUF_SIZE 16384 #endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart (FILE *input_file ); void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); void yy_delete_buffer (YY_BUFFER_STATE b ); void yy_flush_buffer (YY_BUFFER_STATE b ); void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); void yypop_buffer_state (void ); static void yyensure_buffer_stack (void ); static void yy_load_buffer_state (void ); static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); void *yyalloc (yy_size_t ); void *yyrealloc (void *,yy_size_t ); void yyfree (void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; extern int yylineno; int yylineno = 1; extern char *yytext; #define yytext_ptr yytext static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ yyleng = (size_t) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 43 #define YY_END_OF_BUFFER 44 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static yyconst flex_int16_t yy_accept[101] = { 0, 0, 0, 0, 0, 44, 42, 39, 33, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 2, 42, 38, 42, 1, 42, 35, 42, 36, 41, 39, 34, 41, 41, 7, 41, 39, 17, 0, 5, 0, 30, 20, 0, 0, 26, 22, 24, 23, 25, 10, 9, 3, 0, 40, 27, 0, 0, 2, 0, 14, 15, 19, 16, 13, 0, 1, 37, 12, 28, 21, 0, 8, 0, 7, 7, 0, 11, 0, 3, 0, 0, 3, 4, 3, 0, 3, 32, 18, 31, 29, 7, 6, 0, 3, 0, 3, 0, 3, 0, 3, 0 } ; static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 5, 6, 7, 1, 8, 9, 1, 1, 10, 11, 12, 1, 13, 14, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 1, 1, 17, 18, 19, 20, 1, 21, 21, 21, 21, 22, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 1, 23, 1, 1, 24, 1, 25, 25, 25, 25, 26, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 27, 25, 25, 25, 25, 25, 25, 25, 25, 28, 29, 30, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst flex_int32_t yy_meta[31] = { 0, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 3, 1, 1, 1, 1, 5, 3, 1, 5, 5, 3, 5, 1, 1, 1 } ; static yyconst flex_int16_t yy_base[108] = { 0, 0, 0, 29, 51, 193, 194, 33, 194, 174, 28, 173, 181, 37, 171, 28, 29, 43, 27, 71, 43, 170, 45, 183, 65, 194, 154, 194, 194, 68, 194, 74, 167, 0, 95, 80, 194, 50, 194, 167, 194, 194, 87, 148, 194, 194, 194, 194, 194, 194, 194, 86, 83, 194, 194, 63, 85, 0, 93, 135, 194, 132, 194, 131, 142, 106, 194, 85, 194, 194, 111, 194, 121, 0, 0, 0, 194, 88, 112, 114, 78, 113, 194, 115, 70, 128, 194, 194, 194, 194, 0, 0, 27, 129, 131, 132, 135, 136, 138, 139, 194, 155, 160, 163, 168, 173, 176, 181 } ; static yyconst flex_int16_t yy_def[108] = { 0, 100, 1, 101, 101, 100, 100, 100, 100, 100, 102, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 103, 100, 100, 100, 100, 100, 100, 100, 100, 100, 104, 100, 100, 100, 102, 100, 102, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 105, 19, 100, 100, 100, 100, 100, 100, 103, 103, 100, 100, 100, 100, 100, 100, 100, 104, 106, 107, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 106, 107, 100, 100, 100, 100, 100, 100, 100, 100, 0, 100, 100, 100, 100, 100, 100, 100 } ; static yyconst flex_int16_t yy_nxt[225] = { 0, 6, 7, 8, 7, 9, 10, 6, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 6, 23, 23, 24, 6, 23, 23, 23, 25, 26, 27, 29, 30, 29, 38, 35, 31, 35, 53, 42, 45, 42, 47, 93, 32, 54, 46, 48, 49, 33, 43, 39, 34, 29, 30, 29, 38, 50, 31, 51, 59, 60, 36, 62, 63, 52, 32, 55, 66, 52, 35, 33, 35, 39, 34, 55, 70, 71, 70, 57, 67, 72, 35, 68, 35, 56, 85, 57, 53, 42, 77, 42, 77, 58, 81, 80, 80, 58, 66, 81, 43, 83, 78, 89, 78, 84, 84, 52, 79, 85, 64, 52, 79, 70, 71, 70, 77, 94, 53, 77, 74, 74, 75, 70, 71, 70, 92, 92, 78, 95, 93, 78, 96, 98, 79, 94, 94, 79, 79, 96, 96, 79, 98, 98, 97, 99, 64, 95, 95, 88, 87, 97, 97, 86, 99, 99, 28, 28, 28, 28, 28, 37, 37, 37, 37, 37, 65, 76, 65, 73, 100, 73, 73, 73, 82, 82, 82, 90, 53, 90, 90, 90, 91, 69, 91, 91, 91, 64, 61, 44, 41, 40, 36, 100, 5, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100 } ; static yyconst flex_int16_t yy_chk[225] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 10, 7, 3, 7, 18, 13, 15, 13, 16, 92, 3, 18, 15, 16, 16, 3, 13, 10, 3, 4, 4, 4, 37, 17, 4, 17, 20, 20, 20, 22, 22, 17, 4, 55, 24, 17, 29, 4, 29, 37, 4, 19, 31, 31, 31, 55, 24, 31, 35, 24, 35, 19, 84, 19, 24, 42, 51, 42, 77, 19, 80, 52, 52, 19, 34, 52, 42, 56, 51, 67, 77, 58, 58, 56, 51, 58, 65, 56, 51, 70, 70, 70, 78, 81, 34, 83, 34, 34, 34, 72, 72, 72, 79, 79, 78, 81, 79, 83, 85, 93, 78, 94, 95, 83, 78, 96, 97, 83, 98, 99, 85, 93, 64, 94, 95, 63, 61, 96, 97, 59, 98, 99, 101, 101, 101, 101, 101, 102, 102, 102, 102, 102, 103, 43, 103, 104, 39, 104, 104, 104, 105, 105, 105, 106, 32, 106, 106, 106, 107, 26, 107, 107, 107, 23, 21, 14, 12, 11, 9, 5, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; extern int yy_flex_debug; int yy_flex_debug = 0; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "lang.l" #line 2 "lang.l" /* Copyright (C) 2000-2006 The PARI group. This file is part of the GP2C package. PARI/GP is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY WHATSOEVER. Check the License for details. You should have received a copy of it, along with the package; see the file 'COPYING'. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" #include #include #include "header.h" #include "parse.h" #define MAX_INCLUDE_DEPTH 10 YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; int depth = 0; int linecount_stack[MAX_INCLUDE_DEPTH]; const char *nameparse_stack[MAX_INCLUDE_DEPTH]; int linecount=1; int yydebug; static enum {Mread_lines,Min_braces} mode=Mread_lines; static int start=0; static int lastcom=-1; static void countline(char *text,int len) { int i; for (i=0; i #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif static int yy_init_globals (void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int yylex_destroy (void ); int yyget_debug (void ); void yyset_debug (int debug_flag ); YY_EXTRA_TYPE yyget_extra (void ); void yyset_extra (YY_EXTRA_TYPE user_defined ); FILE *yyget_in (void ); void yyset_in (FILE * in_str ); FILE *yyget_out (void ); void yyset_out (FILE * out_str ); int yyget_leng (void ); char *yyget_text (void ); int yyget_lineno (void ); void yyset_lineno (int line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap (void ); #else extern int yywrap (void ); #endif #endif static void yyunput (int c,char *buf_ptr ); #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void ); #else static int input (void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k */ #define YY_READ_BUF_SIZE 16384 #else #define YY_READ_BUF_SIZE 8192 #endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(yyin); \ } \ }\ \ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int yylex (void); #define YY_DECL int yylex (void) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 89 "lang.l" if (!start) {start=1; BEGIN(toplevel);} #line 809 "lex.yy.c" if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_load_buffer_state( ); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = (yy_start); yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 101 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 194 ); yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = (yy_hold_char); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); goto yy_find_action; case 1: YY_RULE_SETUP #line 91 "lang.l" copyentry(yytext); return KENTRY; YY_BREAK case 2: YY_RULE_SETUP #line 92 "lang.l" copytoken(yytext); return KINTEGER; YY_BREAK case 3: YY_RULE_SETUP #line 93 "lang.l" copytoken(yytext); return KREAL; YY_BREAK case 4: /* rule 4 can match eol */ *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 94 "lang.l" copytoken(yytext); return KREAL; YY_BREAK case 5: /* rule 5 can match eol */ YY_RULE_SETUP #line 95 "lang.l" copystring(yytext,yyleng); return KSTRING; YY_BREAK case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(toplevel): #line 97 "lang.l" { if ( --depth < 0 ) yyterminate(); else { yy_delete_buffer(YY_CURRENT_BUFFER ); yy_switch_to_buffer(include_stack[depth]); linecount = linecount_stack[depth]; free((void*)nameparse); nameparse = nameparse_stack[depth]; } } YY_BREAK case 6: YY_RULE_SETUP #line 110 "lang.l" { /*With credit to flex manpage*/ char *s=yytext+2; while(*s==' ' || *s=='\t') s++; if ( depth >= MAX_INCLUDE_DEPTH ) die(-1,"\\r includes nested too deeply" ); linecount_stack[depth] = linecount; nameparse_stack[depth] = nameparse; include_stack[depth++] = YY_CURRENT_BUFFER; linecount=1; yyin = fopen(s,"r"); if (!yyin) { char *t=(char*)malloc(strlen(s)+4); sprintf(t,"%s.gp",s); yyin = fopen(t,"r"); if (!yyin) die(-1,"cannot open file `%s'",s); nameparse=strdup(t); free(t); } else nameparse=strdup(s); yy_switch_to_buffer(yy_create_buffer(yyin,YY_BUF_SIZE ) ); } YY_BREAK case 7: YY_RULE_SETUP #line 135 "lang.l" { fprintf(stderr,"Warning:%s:%d: meta commands not implemented\n%s\n", nameparse,linecount,yytext); } YY_BREAK case 8: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 140 "lang.l" { /*We cannot recognize # */ fprintf(stderr,"Warning:%s:%d: meta commands not implemented\n%s\n", nameparse,linecount,yytext); } YY_BREAK case 9: YY_RULE_SETUP #line 145 "lang.l" return KDOTDOT; YY_BREAK case 10: YY_RULE_SETUP #line 146 "lang.l" return KARROW; YY_BREAK case 11: YY_RULE_SETUP #line 147 "lang.l" return KPARROW; YY_BREAK case 12: YY_RULE_SETUP #line 148 "lang.l" return KDR; YY_BREAK case 13: YY_RULE_SETUP #line 149 "lang.l" return KSR; YY_BREAK case 14: YY_RULE_SETUP #line 150 "lang.l" return KSL; YY_BREAK case 15: YY_RULE_SETUP #line 151 "lang.l" return KLE; YY_BREAK case 16: YY_RULE_SETUP #line 152 "lang.l" return KGE; YY_BREAK case 17: YY_RULE_SETUP #line 153 "lang.l" return KNE; YY_BREAK case 18: YY_RULE_SETUP #line 154 "lang.l" return KID; YY_BREAK case 19: YY_RULE_SETUP #line 155 "lang.l" return KEQ; YY_BREAK case 20: YY_RULE_SETUP #line 156 "lang.l" return KAND; YY_BREAK case 21: YY_RULE_SETUP #line 157 "lang.l" return KOR; YY_BREAK case 22: YY_RULE_SETUP #line 159 "lang.l" return KPP; YY_BREAK case 23: YY_RULE_SETUP #line 160 "lang.l" return KSS; YY_BREAK case 24: YY_RULE_SETUP #line 161 "lang.l" return KPE; YY_BREAK case 25: YY_RULE_SETUP #line 162 "lang.l" return KSE; YY_BREAK case 26: YY_RULE_SETUP #line 163 "lang.l" return KME; YY_BREAK case 27: YY_RULE_SETUP #line 164 "lang.l" return KDE; YY_BREAK case 28: YY_RULE_SETUP #line 165 "lang.l" return KEUCE; YY_BREAK case 29: YY_RULE_SETUP #line 166 "lang.l" return KDRE; YY_BREAK case 30: YY_RULE_SETUP #line 167 "lang.l" return KMODE; YY_BREAK case 31: YY_RULE_SETUP #line 168 "lang.l" return KSRE; YY_BREAK case 32: YY_RULE_SETUP #line 169 "lang.l" return KSLE; YY_BREAK case 33: /* rule 33 can match eol */ YY_RULE_SETUP #line 171 "lang.l" {linecount++;if (mode==Mread_lines) {BEGIN(toplevel);return '\n';}} YY_BREAK case 34: /* rule 34 can match eol */ YY_RULE_SETUP #line 172 "lang.l" {linecount++;return '\n';} YY_BREAK case 35: YY_RULE_SETUP #line 173 "lang.l" {mode=Min_braces;BEGIN(INITIAL);} YY_BREAK case 36: YY_RULE_SETUP #line 174 "lang.l" {mode=Mread_lines;BEGIN(toplevel);} YY_BREAK case 37: /* rule 37 can match eol */ YY_RULE_SETUP #line 176 "lang.l" {linecount++;} YY_BREAK case 38: YY_RULE_SETUP #line 178 "lang.l" { for( ; ; ) { int c, nc, star=0; for( ; ; ) { c = input(); if ( c == EOF ) return c; if ( c == '\n' ) linecount++; else if ( c!=' ' && c!='\t' && c!='\r') break; } /*Since only one char of look-ahead is available, we have to handle the / or \ by ourself. Fortunately: after =/, only * is valid, after =\, only \ and \\n are valid. Thus we handle them and reject the rest. */ if (c!='/' && c!='\\') { unput(c); return '='; } nc=input(); if (c=='\\' && nc=='\n') { linecount++; continue; } if ((c=='/' && nc!='*') || (c=='\\' && nc!='\\')) { fprintf(stderr,"%s:%d: parse error after =%c%c\n" ,nameparse,linecount,(char)c,(char)nc); fprintf(stderr,"Errors found: aborting...\n"); exit(1); } if (c=='/') { for ( ; ; ) { int c = input(); if ( c == EOF ) die(-1,"Unfinished comment"); if ( c == '/' && star) break; if ( c == '*' ) star=1; else star=0; if ( c == '\n' ) linecount++; } } else { for ( ; ; ) { int c = input(); if ( c == EOF ) die(-1,"Unfinished comment"); if ( c == '/' && star) c='\\'; if ( c == '*' ) star=1; else star=0; if ( c == '\n' ) { linecount++; break; } if ( c == '\r' ) continue; } } } } YY_BREAK case 39: YY_RULE_SETUP #line 251 "lang.l" YY_BREAK case 40: YY_RULE_SETUP #line 252 "lang.l" { int star=0; int n; int nl=0; int lc=linecount; if (lastcom==-1) lastcom=newcomment(); n=lastcom; pushcomment(n,'/'); pushcomment(n,'*'); if (yytext[0]=='/') { for ( ; ; ) { int c = input(); if ( c == EOF ) die(-1,"Unfinished comment"); pushcomment(n,c); if ( c == '/' && star) break; if ( c == '*' ) star=1; else star=0; if ( c == '\n' ) linecount++; } } else { nl=1; for ( ; ; ) { int c = input(); if ( c == EOF ) die(-1,"Unfinished comment"); if ( c == '/' && star) c='\\'; if ( c == '*' ) star=1; else star=0; if ( c == '\n' ) { linecount++; break; } if ( c == '\r' ) continue; pushcomment(n,c); } pushcomment(n,' '); pushcomment(n,'*'); pushcomment(n,'/'); pushcomment(n,'\n'); } /*We hack: we put white spaces after comments in the comments This makes output looking better in most cases. Sadly we can't add white spaces that are before comments. */ for( ; ; ) { int c = input(); if ( c == EOF ) return '\n'; if ( c == '\n' ) { linecount++; pushcomment(n,c); nl=1; } else if ( c == ' ' || c == '\t') { if (nl==0) pushcomment(n,c); /*We only add spaces on the same line*/ } else if ( c != '\r' ) { unput(c); break; } } if (lcyy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = (yy_c_buf_p); goto yy_find_action; } } else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; register char *source = (yytext_ptr); register int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), (size_t) num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart(yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 101 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { register int yy_is_jam; register char *yy_cp = (yy_c_buf_p); register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 101 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 100); return yy_is_jam ? 0 : yy_current_state; } static void yyunput (int c, register char * yy_bp ) { register char *yy_cp; yy_cp = (yy_c_buf_p); /* undo effects of setting up yytext */ *yy_cp = (yy_hold_char); if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = (yy_n_chars) + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; (yytext_ptr) = yy_bp; (yy_hold_char) = *yy_cp; (yy_c_buf_p) = yy_cp; } #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ int offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart(yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ void yyrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_init_buffer(YY_CURRENT_BUFFER,input_file ); yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); */ yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } static void yy_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer(b,file ); return b; } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * */ void yy_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yyfree((void *) b->yy_ch_buf ); yyfree((void *) b ); } #ifndef __cplusplus extern int isatty (int ); #endif /* __cplusplus */ /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; yy_flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; yyensure_buffer_stack(); /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void yyensure_buffer_stack (void) { int num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ int grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer(b ); return b; } /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) { return yy_scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) yyalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer(buf,n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yy_fatal_error (yyconst char* msg ) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ int yyget_lineno (void) { return yylineno; } /** Get the input stream. * */ FILE *yyget_in (void) { return yyin; } /** Get the output stream. * */ FILE *yyget_out (void) { return yyout; } /** Get the length of the current token. * */ int yyget_leng (void) { return yyleng; } /** Get the current token. * */ char *yyget_text (void) { return yytext; } /** Set the current line number. * @param line_number * */ void yyset_lineno (int line_number ) { yylineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. * * @see yy_switch_to_buffer */ void yyset_in (FILE * in_str ) { yyin = in_str ; } void yyset_out (FILE * out_str ) { yyout = out_str ; } int yyget_debug (void) { return yy_flex_debug; } void yyset_debug (int bdebug ) { yy_flex_debug = bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from yylex_destroy(), so don't allocate here. */ (yy_buffer_stack) = 0; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = (char *) 0; (yy_init) = 0; (yy_start) = 0; /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; yyout = stdout; #else yyin = (FILE *) 0; yyout = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by * yylex_init() */ return 0; } /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } /* Destroy the stack itself. */ yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *yyalloc (yy_size_t size ) { return (void *) malloc( size ); } void *yyrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } void yyfree (void * ptr ) { free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 336 "lang.l" gp2c-0.0.8/src/stack.c0000644000175000017500000000714312156323515011343 00000000000000/* Copyright (C) 2002 The PARI group. This file is part of the GP2C package. PARI/GP is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY WHATSOEVER. Check the License for details. You should have received a copy of it, along with the package; see the file 'COPYING'. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include "stack.h" void ** stack_base(stack *s) { return (void **) ((unsigned long)s + (unsigned long)s->offset); } void stack_init(stack *s, int size, void **data) { s->offset=(unsigned long)data-(unsigned long)s; *data=NULL; s->n=0; s->alloc=0; s->size=size; } void stack_alloc(stack *s, int nb) { void **sdat=(void **)((char *)s+s->offset); if (s->n+nb <= s->alloc) return; while (s->n+nb > s->alloc) s->alloc=s->alloc?s->alloc<<1:1; if (debug_stack) fprintf(stderr,"data=%lx (%d/%ld)\n", (unsigned long) sdat,s->n,(long) s->alloc); *sdat=realloc(*sdat,s->alloc*s->size); if (*sdat==NULL) fprintf(stderr,"Cannot alloc memory (%ld bytes)\n",(long)s->alloc*s->size); } int stack_new(stack *s) { stack_alloc(s, 1); return s->n++; } void stack_push_int(stack *s, int val) { int *sdat; stack_alloc(s, 1); sdat = * (int **) ((char *)s+s->offset); sdat[s->n++] = val; } int stack_has_int(stack *s, int val) { int *sdat= * (int **) ((char *)s+s->offset); int i; for (i=0; in; i++) if (sdat[i]==val) return 1; return 0; } void stack_remove_int(stack *s, int val) { int *sdat= * (int **) ((char *)s+s->offset); int i, k; for (i=0, k=0; in; i++) { if (sdat[i]==val) k++; else sdat[i-k]=sdat[i]; } s->n-=k; } static int cmpss(const void *a, const void *b) { return *(int*)a - *(int*)b; } void stack_int_sort(stack *s) { int *sdat= * (int **) ((char *)s+s->offset); qsort(sdat, s->n, s->size, cmpss); } void stack_int_merge(stack *s, stack *t) { int *sdat= * (int **) ((char *)s+s->offset); int *tdat= * (int **) ((char *)t+t->offset); int *var; int i,j; int sn = s->n, tn = t->n; stack v; if (t->n==0) return; stack_init(&v,sizeof(*var),(void *)&var); for(i=0,j=0; i tdat[j]) stack_push_int(&v,tdat[j++]); else { stack_push_int(&v,sdat[i]); i++; j++; } } for (;in) s->n--; else fprintf(stderr,"stack_pop: stack is already empty\n"); } void stack_pop_safe(stack *s, int n) { if (n == s->n-1) stack_pop(s); else fprintf(stderr,"stack_pop: unexpected stack level\n"); } /*Push stack t on stack s*/ void stack_push(stack *s, stack *t) { if ( s->size!=t->size ) fprintf(stderr,"Incompatible stack size in stack_push: %ld!=%ld\n", (long)s->size,(long)t->size); if ( t->n>0 ) { void **sdat=(void **) ((char *)s+s->offset); void **tdat=(void **) ((char *)t+t->offset); stack_alloc(s, t->n); memcpy((char *)*(sdat)+s->n*s->size,*tdat,t->n*t->size); s->n+=t->n; } } void stack_replace(stack *s, stack *t) { void **sdat=(void **) ((char *)s+s->offset); void **tdat=(void **) ((char *)t+t->offset); *sdat=realloc(*sdat,0); *sdat=*tdat; s->n=t->n; s->alloc=t->alloc; } gp2c-0.0.8/src/moveblock.c0000644000175000017500000002514012156152554012217 00000000000000/* Copyright (C) 2002-2005 The PARI group. This file is part of the GP2C package. PARI/GP is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY WHATSOEVER. Check the License for details. You should have received a copy of it, along with the package; see the file 'COPYING'. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" #include #include #include #include "header.h" static int currblo; typedef enum {left,right} side; void destroynode(int p, side s) { if (p==-1) return; if (s==left) tree[p].x=GNIL; else tree[p].y=GNIL; } /* n: node p: parent (-1 for first node) ps: left/right r: root of seq rs:left/right */ void movecode(int n, int p, int ps, int *r, int *rs, int ret) { if (debug) fprintf(stderr,"movecode:%d %d %d\n",n,p,*r); if (ret==-1) ret=GNIL; if (p!=*r)/*we are not at the root of seq*/ { if ( tree[*r].f==Fseq ) { /*the interesting case*/ if (*rs==left) { int seq=newseq(n,tree[*r].x); tree[*r].x=seq; *rs=right;*r=seq; } else { int seq=newseq(tree[*r].x,n); tree[*r].x=seq; } } else /*we are at the start of a func, block or args entry*/ { if (*rs==left) { int seq=newseq(n,tree[*r].x); tree[*r].x=seq; *r=seq;*rs=right; } else { int seq=newseq(n,tree[*r].y); tree[*r].y=seq; *r=seq;*rs=right; } } if (ps==left) tree[p].x=ret; else tree[p].y=ret; } } void moveblock(int n, int p, int ps, int *r, int *rs) { int x,y; int z; int s; gpfunc *gp; int nf; if (n<0) return; x=tree[n].x; y=tree[n].y; switch(tree[n].f) { case Fseq: s=left;z=n; moveblock(x,n,left,&z,&s); s=right;z=n; moveblock(y,n,right,&z,&s); break; case Frefarg: case Ftag: moveblock(x,n,left,r,rs); break; case Fconst: case Fsmall: case Fnoarg: case Fentry: break; case Ffunction: /*If it is a func with "seq" arg we must change the root... Yes it's a real pain. Note: normally 'E' code does not contain Fseq after parsing, but may after this stage, e.g. if it calls "vector". */ nf=findfunction(entryname(n)); gp=lfunc+nf; if (nf>=0 && gp->spec>0) tree[n].m|=funcmode(*gp)&(1<=0 && gp->spec>0 && gp->proto.code && y!=-1) { int stack[STACKSZ]; int nb=listtostackparent(y,Flistarg,stack,STACKSZ,gp->gpname,n); const char *code=gp->proto.code; int i, star=code[0]=='*'; if (code[0]==0) die(-1,"incorrect pseudoprototype for %s: %s\n",gp->gpname,code); if (nb==0) { if (star || code[0]=='I' || code[0]=='E') { z=n; s=right; moveblock(y,z,right,&z,&s); } else moveblock(y,n,right,r,rs); } else { if (star || code[0]=='I' || code[0]=='E') { z=stack[0];s=left; moveblock(tree[z].x,z,left,&z,&s); } else moveblock(tree[stack[0]].x,stack[0],left,r,rs); } for(i=0;igpname,code); if (star || code[i+1]=='I' || code[i+1]=='E') { z=stack[i];s=right; moveblock(tree[z].y,z,right,&z,&s); } else moveblock(tree[stack[i]].y,stack[i],right,r,rs); } } else moveblock(y,n,right,r,rs); break; case Fdeffunc: z=n;s=right; moveblock(y,n,right,&z,&s); break; case Fblock: z=n;s=right; movecode(n,p,ps,r,rs,newleaf(block[x].ret)); moveblock(y,n,right,&z,&s); break; default: if (tree[n].f>=FneedENTRY) die(n,"Incorrect node %s in moveblock",funcname(tree[n].f)); moveblock(x,n,left,r,rs); moveblock(y,n,right,r,rs); } } int blockisempty(int n) { int i; context *fc=block+tree[n].x; for(i=0;is.n;i++) { ctxvar *v=fc->c+i; if (!(v->flag&(1<val==-1) return 0; } return 1; } /* n: node p: parent (-1 for first node) d: 0 right child, 1 left child */ void cleanvar(int n) { int x,y; int i; int v,savc,savblo; context *bl; if (n<0) return; x=tree[n].x; y=tree[n].y; switch(tree[n].f) { case Fassign: cleanvar(x); cleanvar(y); x=tree[n].x; y=tree[n].y; if (tree[x].f==Fentry) { v=getvarerr(x); if (ctxstack[v].flag&(1<v.n;i++) { affnode *an=bl->var+i; if (an->idx==w && an->f!=AFaccess) simple=0; } } } if (simple) { ctxstack[v].val=y; tree[n]=tree[GNIL]; } } } break; case Frefarg: case Ftag: cleanvar(x); break; case Fconst: case Fsmall: case Fnoarg: break; case Fentry: v=getvarerr(n); if ( (ctxstack[v].flag&(1<s.n;i++) { ctxvar *c=bl->c+i; if (c->initval!=-1) cleanvar(c->initval); } cleanvar(y); copyctx(savc,block+tree[n].x); if (blockisempty(n)) tree[n].m|=(1<=FneedENTRY) die(n,"Incorrect node %s in cleanvar",funcname(tree[n].f)); cleanvar(x); cleanvar(y); } } /* n: node p: parent (-1 for first node) d: side */ void cleancode(int n, int p, int d) { int x,fx; int y,fy; if (n<0) return; x=tree[n].x; y=tree[n].y; switch(tree[n].f) { case Fseq: cleancode(x,n,left); cleancode(y,n,right); x=tree[n].x;fx=tree[detag(x)].f; y=tree[n].y;fy=tree[detag(y)].f; if ( p>=0 && ( fx==Fnoarg || fy==Fnoarg)) { if (fx==Fnoarg && fy==Fnoarg) destroynode(p,d); else { if (d==left) tree[p].x=(fx==Fnoarg)?y:x; else tree[p].y=(fx==Fnoarg)?y:x; } } else tree[n].m|=(1<=FneedENTRY) die(n,"Incorrect node %s in cleancode",funcname(tree[n].f)); cleancode(x,n,left); cleancode(y,n,right); } } /* n: node p: parent (-1 for first node) ps: child side(left/right) *r: root *rs: root child side */ void gendeblock(int n, int p, int ps, int *r, int *rs) { int x,y; int z; int s; gpfunc *gp; int nf; if (n<0) return; x=tree[n].x; y=tree[n].y; switch(tree[n].f) { case Fseq: s=left;z=n; gendeblock(x,n,left,&z,&s); s=right;z=n; gendeblock(y,n,right,&z,&s); break; case Frefarg: case Ftag: gendeblock(x,n,left,r,rs); break; case Fconst: case Fsmall: case Fnoarg: case Fentry: break; case Ffunction: /*If it is a func with "seq" arg we must change the root... Yes it's a real pain. Note: normally 'E' code does not contain Fseq after parsing, but may after this stage, e.g. if it calls "vector". */ nf=findfunction(entryname(n)); gp=lfunc+nf; if (nf>=0 && gp->spec>0 && gp->proto.code && y!=-1) { int stack[STACKSZ]; int nb=listtostackparent(y,Flistarg,stack,STACKSZ,gp->gpname,n); const char *code=gp->proto.code; int i, star=code[0]=='*'; if (code[0]==0) die(-1,"incorrect pseudoprototype for %s: %s\n",gp->gpname,code); if (nb==0) { if (star || code[0]=='I' || code[0]=='E') { z=n; s=right; gendeblock(y,z,right,&z,&s); } else gendeblock(y,n,right,r,rs); } else { if (star || code[0]=='I' || code[0]=='E') { z=stack[0];s=left; gendeblock(tree[z].x,z,left,&z,&s); } else gendeblock(tree[stack[0]].x,stack[0],left,r,rs); } for(i=0;igpname,code); if (star || code[i+1]=='I' || code[i+1]=='E') { z=stack[i];s=right; gendeblock(tree[z].y,z,right,&z,&s); } else gendeblock(tree[stack[i]].y,stack[i],right,r,rs); } } else { gendeblock(y,n,right,r,rs); if (ps==left) n=tree[p].x; else n=tree[p].y; if (is_subtype(tree[n].t,Gvoid)) { /*C doesn't allow making anything from void, so we need to move the call here. GP cast void to zero if necessary*/ movecode(n,p,ps,r,rs,-1); } } break; case Fdeffunc: z=n;s=right; gendeblock(y,n,right,&z,&s); break; case Fblock: z=n;s=right; gendeblock(y,n,right,&z,&s); break; default: if (tree[n].f>=FneedENTRY) die(n,"Incorrect node %s in gendeblock",funcname(tree[n].f)); gendeblock(x,n,left,r,rs); gendeblock(y,n,right,r,rs); } } gp2c-0.0.8/src/optable.h0000644000175000017500000000240212155572710011664 00000000000000/* Copyright (C) 2000 The PARI group. This file is part of the GP2C package. PARI/GP is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY WHATSOEVER. Check the License for details. You should have received a copy of it, along with the package; see the file 'COPYING'. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ typedef enum {OPor, OPand, OPid, OPeq, OPne, OPge, OPg, OPle, OPl, OPs, OPp, OPsl, OPsr, OPmod, OPdr, OPeuc, OPd, OPm, OPpow, OPcat, OPss, OPpp, OPse ,OPpe ,OPsle ,OPsre ,OPmode ,OPdre ,OPeuce ,OPde ,OPme, OPpl, OPn, OPnb, OPfact, OPderiv, OPtrans, OPrange, OPcompr, OPcomprc, OPhist, OPcoeff, OPnboperator} OPerator; #ifndef TYPE extern const char *opname[]; #else const char *opname[]={"_||_", "_&&_", "_===_", "_==_", "_!=_", "_>=_", "_>_", "_<=_", "_<_", "_-_","_+_","_<<_", "_>>_", "_%_", "_\\/_", "_\\_", "_/_", "_*_","_^_","__","_--","_++","_-=_", "_+=_", "_<<=_", "_>>=_", "_%=_", "_\\/=_", "_\\=_", "_/=_", "_*=_","+_","-_","!_","_!","_'","_~","[_.._]","[_|_<-_,_]","[_|_<-_,_;_]","%","_[_,_]",""}; #endif gp2c-0.0.8/src/gerepile.c0000644000175000017500000001221412155572710012027 00000000000000/* Copyright (C) 2002 The PARI group. This file is part of the GP2C package. PARI/GP is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY WHATSOEVER. Check the License for details. You should have received a copy of it, along with the package; see the file 'COPYING'. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" #include #include #include #include "header.h" void gerepilelist(stack *s, stack *g, int savb) { affnode *an=(affnode *) *stack_base(s); int i; for(i=0;in;i++) { int idx=an[i].idx; ctxvar *v=ctxstack+idx; int t=vartype(*v); if (ctype[t]!=Vgen || ((v->flag&(1<val!=-1)) continue; /*If i is affected or referenced*/ if (an[i].f==AFclone) stack_remove_int(g,v->node); else if (an[i].f!=AFaccess && an[i].f!=AFhide) { int j; /*search the first occurence of i*/ for(j=0;j=savb && an[j].f==AFassign) continue; /*else check if it is not already in the list*/ if (stack_has_int(g,v->node)) continue; stack_push_int(g,v->node); } } stack_int_sort(g); if (debug) { int i; fprintf(stderr,"/*"); for(i=0;in;i++) fprintf(stderr,"%s%s ",varstr(ctxstack[an[i].idx]),an[i].f==AFassigncompo?"=[]":an[i].f==AFassign?"=":""); fprintf(stderr,"*/\n"); } } void pilelistvar(int idx) { ctxvar *v=ctxstack+idx; if (v->flag&(1<initval>=0) { pilelist(v->initval); newaff(AFassign,idx); } } void pilelist(int n) { int x,y; int savc; context *bl; if (n<0) return; x=tree[n].x; y=tree[n].y; switch(tree[n].f) { case Fassign: if (tree[x].f!=Fentry) pilelist(x); pilelist(y); x=getlvaluerr(x); if (ctype[tree[x].t]==Vgen && ctype[tree[y].t]==Vgen && (tree[detag(y)].m&(1<v,&uf->g,uf->savb); currfunc=savcf; } break; case Fblock: savc=s_ctx.n; bl=block+tree[n].x; pushctx(bl); pilelist(y); if (bl->gc&(1<v,&bl->g,bl->savb); if (bl->egc>=0) { int vret=getvar(bl->egc); ctxvar *v=ctxstack+vret; if (ctype[vartype(*v)]==Vgen && !stack_has_int(&bl->g,vret)) stack_push_int(&bl->g,v->node); } } copyctx(savc,bl); s_ctx.n=savc; break; default: if (tree[n].f>=FneedENTRY) die(n,"Incorrect node %s in pilelist",funcname(tree[n].f)); pilelist(x); pilelist(y); } } void pileclean(int n) { int x,y; int savc,sava,savb; context *bl; if (n<0) return; x=tree[n].x; y=tree[n].y; switch(tree[n].f) { case Fassign: pileclean(x); pileclean(y); break; case Frefarg: case Ftag: pileclean(x); break; case Fconst: case Fsmall: case Fnoarg: case Fentry: break; case Ffunction: pileclean(y); break; case Fdeffunc: { int funcid=tree[n].x; const char *name=entryname(funcid); int savcf=currfunc; /*get func number and context*/ currfunc=findfunction(name); pileclean(y); currfunc=savcf; } break; case Fblock: savc=s_ctx.n; sava=s_aff.n; bl=block+tree[n].x; pushctx(bl); savb=s_ctx.n; pileclean(y); if (bl->gc&(1<g,&ufunc->g); if (bl->g.n!=1) bl->gc&=~(1<gc&(1<g.n || (bl->gc&(1<gc&(1<=savc && wgc&(1<g.n==0 || (bl->g.n==1 && (bl->gc&(1<=FneedENTRY) die(n,"Incorrect node %s in pileclean",funcname(tree[n].f)); pileclean(x); pileclean(y); } } gp2c-0.0.8/src/funcspec.c0000644000175000017500000012507112165533365012053 00000000000000/* Copyright (C) 2000-2005 The PARI group. This file is part of the GP2C package. PARI/GP is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY WHATSOEVER. Check the License for details. You should have received a copy of it, along with the package; see the file 'COPYING'. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" #include #include #include #include "header.h" #include "patchfunc.h" extern int indent; int has_iter(char *s) { int nf=getfunc(s); return !!lfunc[nf].iter; } void patchfunction(struct patchfunc_s *p) { int nf=getfunc(p->gpname); lfunc[nf].proto.code=p->code; functype(lfunc[nf])=p->type; funcmode(lfunc[nf])=p->mode; lfunc[nf].spec=p->spec; } void patchfunclist(void) { int i; for(i=0;patchfunc[i].gpname;i++) patchfunction(patchfunc+i); if (!has_iter("forvec")) { struct patchfunc_s pforvec = {"forvec",NULL,Gnotype,(1<proto.code; char c; PPproto mod; int nb=genlistargs(n,arg,0,STACKSZ); int i=0, k=0, binf; while((mod=parseproto(&p,&c))!=PPend) { if (i=nb) die(n,"too few arguments"); switch(c) { case '=': genequal(arg[i], gp->gpname, var, &binf, tv); if (fl) { tree[*var].t = *tv; argo[k++] = *var; tree[binf].t = guesstype(binf); } argo[k++] = binf; break; case 'V': checkisvar(arg[i], gp->gpname, var, tv); if (fl) { tree[*var].t = *tv; argo[k++] = *var; } break; case 'I': *seq = arg[i]; break; default: if (fl) tree[arg[i]].t = guesstype(arg[i]); argo[k++] = arg[i]; } break; case PPdefault: case PPdefaultmulti: if (iiter); if (!da) die(n, "no suitable iterator found"); iter = &(da->iter); init = lfunc[iter->init].gpname; next = lfunc[iter->next].gpname; vprime=newnode(Fentry,newentry("iter"),-1); pushvar(vprime,1<type,-1); nb = geniterproto(n, 0, gp, arg+1, &seq, &var, &tv)+1; arg[0] = vprime; bseq = newcall(init, stacktoargs(arg,nb)); genblock(bseq,-1); savx=s_ctx.n; bl1=newblock(); bl2=newblock(); if (autogc) gpm=gengerepile(bl2); if (tv==Gnotype) { tree[vprime].t = iter->type; gpdescarg *da=descfindrules(1, &vprime, lfunc+iter->next); tv = da->type; } pushvar(var,1<spec) { case GPaddhelp: { /*prototype vSs*/ gpfunc *gp; int d, nf; nb=genlistargs(n,arg,2,2); d=detag(arg[0]); if (tree[d].f!=Fentry && !is_const(d,CSTstr)) die(n,"Incorrect function name in addhelp"); tree[d].f=Fconst; nf=getfunc(entryname(d)); gp=lfunc+nf; d=detag(arg[1]); gp->proto.help=d; } break; case GPgrandO: if (tree[y].f==Ffunction && tree[y].x==OPpow) tree[y]=tree[tree[y].y]; tree[n].x=newentry("O(_^_)"); genblock(y,n); break; case GPif: nb=genlistargs(n,arg,2,STACKSZ); if (nb==3 && arg[2]==GNOARG) /*Some people type 'if(x!=0,print(x),)'*/ nb--; if (nb==3 && arg[1]==GNOARG) { /*Some people type 'if(x!=0,,print(x))'*/ arg[0]=newopcall(OPnb,arg[0],-1); arg[1]=arg[2]; nb--; } if (tree[arg[0]].f==Fsmall && tree[arg[0]].x) { /*if(1,...) expr are often used to create block. We honor it here*/ if (p>=0 && tree[p].f!=Fseq) newdecl((1<=0 && tree[p].f!=Fseq) newdecl((1<=4) { arg[2] = newcall("if", stacktoargs(arg+2,nb-2)); nb = 3; } if (arg[0]>=0 && tree[arg[0]].f==Fseq) { int pred; newdecl((1<proto.cname=entryname(d); if (nb==4 && arg[3]!=GNOARG) { d=detag(arg[3]); if (!is_const(d,CSTstr)) die(n,"Incorrect library name in install"); gp->proto.origin=entryname(d); } d=detag(arg[1]); if (tree[d].f!=Fentry && !is_const(d,CSTstr)) die(n,"Incorrect code in install"); tree[d].f=Fconst; p=entryname(d); gp->proto.code=p+1; funcmode(*gp)=0; switch(p[0]) { case 'v': functype(*gp)=Gvoid; break; case 'l': functype(*gp)=Gsmall; break; case 'i': functype(*gp)=Gsmall_int; break; case 'm': functype(*gp)=Ggen; funcmode(*gp)=(1<proto.code--; } if (tree[arg[1]].f==Ftag) functype(*gp)=tree[arg[1]].y; for(;*p;p++) if (*p=='p') funcmode(*gp)|=(1<spec=GPinstalled; } break; case GPfor: nb=genlistargs(n,arg,3,3); genequal(arg[0],gp->gpname,&var,&binf,&tv); bsup=arg[1];seq=arg[2]; newdecl((1<gpname,&var,&binf,&tv); seq=arg[1]; flag=(nb==3)?arg[2]:newsmall(0); newdecl((1<gpname,&var,&tv); newdecl(1<gpname,&var,&binf,&tv); bsup=arg[1];bstep=arg[2];seq=arg[3]; newdecl((1<0 ) arg[3]=newopcall(OPle,newleaf(var),vsup); else arg[3]=newopcall(OPge,newleaf(var),vsup); nb=4; } else { arg[3]=newleaf(vsign); arg[4]=newopcall(OPle,newleaf(var),vsup); arg[5]=newopcall(OPge,newleaf(var),vsup); nb=6; } if (isvec) { arg[2]=newopcall(OPpe,var,newcoeff(vstep,vindex,-1)); arg[6]=vindex; arg[7]=newleaf(lstep); nb=8; } else arg[2]=newopcall(OPpe,var,vstep); arg[1]=seq; if (isvec) aseq=newcall("_forstepvec",stacktoargs(arg,nb)); else aseq=newnode(tree[n].f,tree[n].x,stacktoargs(arg,nb)); if (lab.go) aseq=newseq(aseq,newcall("_label",newsmall(lab.go))); makeblocks(bl1,bl2,n,bseq,aseq,ret,savx); } break; case GPprodeuler: nb=genlistargs(n,arg,3,3); seq = arg[2]; newdecl(0,Ggen,-1,&ret); savx=s_ctx.n; bl1=newblock(); arg[2]=geninsertvarop(seq,ret,OPme); aseq=newnode(Fseq, geninsertvar(newnode(Fconst,newsmallrealvalue(1),-1),newleaf(ret)), newcall("forprime",stacktoargs(arg,3))); genblock(aseq,-1); makeblock(bl1,n,aseq,ret,savx); break; case GPforprime: nb=genlistargs(n,arg,3,3); genequal(arg[0],gp->gpname,&var,&binf,&tv); bsup=arg[1];seq=arg[2]; newdecl((1<=0?Gint:Gsmall); pushvar(var,1<=0?-1:newsmall(0)); vprime=newnode(Fentry,newentry("primepointer"),-1); pushvar(vprime,1<=0?-1:newcall("_diffptr",-1)); lab=makesubblock_label(seq,Lbreak); if (lab.ne) seq=newseq(seq,newcall("_label",newsmall(lab.ne))); if (autogc) seq=addseqright(seq,newcall("_gerepilemany",gpm)); if (FC_forprime_init>=0) { int args[3],bseq; int nbs=3; args[0]=vprime; args[1]=vinf; if (bsup==GNOARG) nbs=2; else args[2]=vsup; aseq=addseqleft(newcall((tv==Gsmall?"_u_forprime_init":"_forprime_init"), stacktoargs(args,nbs)),aseq); bseq=newnode(Fassign,var,newcall(tv==Gsmall?"_u_forprime_next":"_forprime_next_",vprime)); tree[bseq].m=Mparens; aseq=addseqright(aseq,newcall("_whilenull",newnode(Flistarg,bseq,seq))); } else { /*if (vsup>maxprime()) err(primer1);*/ aseq=addseqleft(newcall("if",newnode(Flistarg, newopcall(OPg,vsup,newcall("_maxprime",-1)), newcall("_err_primes",-1))) ,aseq); if (tree[binf].f!=Fsmall || tree[binf].x>2) /*if(vargpname,&var,&binf,&tv); bsup=arg[1];seq=arg[2]; newdecl((1<spec==GPsum?0:1), newleaf(ret))); else bseq=addseqright(bseq,geninsertvar(arg[3],newleaf(ret))); genblock(bseq,-1); savx=s_ctx.n; bl1=newblock(); bl2=newblock(); if (autogc) gpm=gengerepile(bl2); genequaltosmall(binf,bsup,&tv,Gint); pushvar(var,1<spec==GPsum?OPpe:OPme)); makesubblock_label(seq,Lnobrk); if (autogc) seq=addseqright(seq,newcall("_gerepilemany",gpm)); arg[0]=newnode(Fassign,var,vinf); arg[1]=newopcall(OPle,newleaf(var),vsup); arg[2]=seq; arg[3]=newopcall(OPpp,newleaf(var),-1); aseq=addseqright(aseq,newcall("for",stacktoargs(arg,4))); makeblocks(bl1,bl2,n,bseq,aseq,ret,savx); break; case GPsumdiv: { int vdiv,div; int vloop; nb=genlistargs(n,arg,3,3); seq=arg[2]; checkisvar(arg[1],gp->gpname,&var,&tv); newdecl(1<spec==GPvectorsmall?Gvecsmall:Gvec,-1,&ret); savx=s_ctx.n; bl1=newblock(); bl2=newblock(); if (nb>=2) { checkisvar(arg[1],gp->gpname,&var,&tv); pushvar(var,1<spec==GPvector?"t_VEC":gp->spec==GPvectorv?"t_COL":"t_VECSMALL")); arg[0]=newnode(Fassign,var,newsmall(1)); arg[1]=newopcall(OPle,newleaf(var),vsup); arg[2]=newcoeff(newleaf(ret),newleaf(var),-1); arg[2]=geninsertvar(seq,arg[2]); makesubblock_label(arg[2],Lnobrk); arg[3]=newopcall(OPpp,newleaf(var),-1); aseq=addseqright(aseq,newcall("for",stacktoargs(arg,4))); makeblocks(bl1,bl2,n,bseq,aseq,ret,savx); break; case GPmatrix: { int var1,bsup1,vsup1,var2,bsup2,vsup2; int tv1,tv2; nb=genlistargs(n,arg,2,5); bsup2=arg[0];bsup1=arg[1]; newdecl((1<=3) { checkisvar(arg[2],gp->gpname,&var2,&tv2); pushvar(var2,1<=4) { checkisvar(arg[3],gp->gpname,&var1,&tv1); pushvar(var1,1<spec==GPglobal) flag|=(1<=0 && y!=GNOARG) { if (tree[y].f!=Fsmall || tree[y].x<=0) die(n,"%s(n) only supported for constant n>0",gp->gpname); nb=tree[y].x; } else { nb=1; tree[n].y=GNOARG; } if (check_labels(nb,Lnobrk)) die(n,"%s not allowed here",gp->gpname); if (nb>1) { int l = s_label.n-nb; if (gp->spec==GPbreak) { if (label[l].go==0) label[l].go=++labbrk; tree[y].x=labbrk; } else { if (label[l].ne==0) label[l].ne=++labbrk; tree[y].x=labbrk; } } if (check_labels(nb,Liferr)) { int ie = newsmall(get_iferr(nb)); aseq=addseqleft(newcall("_iferr_CATCH_reset",ie),newleaf(n)); makeblock(newblock(),n,aseq,-1,s_ctx.n); } } break; case GPiferr: { Clabel_t lab; nb=genlistargs(n,arg,3,4); checkisvar(arg[1],gp->gpname,&var,&tv); seq=arg[0]; bseq=arg[2]; if (tv==Gnotype) { tv=Gerror; if (tv<0) die(n,"iferr not supported by your GP version"); } if (p>=0 && tree[p].f!=Fseq) newdecl((1<spec) { case GPif: nb=genlistargs(n,arg,2,3); gentype(arg[0]); gentype(arg[1]); tree[n].m=(1<spec==GPwhile) tree[n].m=(tree[arg[0]].m|(tree[arg[1]].m&~(1<=0) { gentype(y); tree[n].m=(1<gpname,GPname(functype(*cf)),GPname(t),GPname(tree[y].t)); functype(*cf)=t; lastpass++; } } return Gempty; case GPinstall: case GPaddhelp: tree[n].m=0; return Gvoid; case GPmakevec: gentype(y); tree[n].m=(tree[y].m&MODHERIT)|(1<=0 && lfunc[nf].spec==GPuser && lfunc[nf].user->wrapper>=0 && (funcmode(lfunc[nf])&(1<spec>0) die(n,"gentypefuncspec : func spec not implemented"); else die(n,"Internal error : gentypefuncspec called with no spec"); } } void gencopyarg(FILE *fout) { gpfunc *gp=lfunc+currfunc; userfunc *ufunc=gp->user; context *fc=block+ufunc->bl; int n=tree[ufunc->defnode].y; long i; if (tree[n].x!=ufunc->bl || !fc->var) return; for (i=0;is.n;i++) if (fc->c[i].flag&(1<c+i; long j; for(j=0;jv.n;j++) if (fc->var[j].f==AFassigncompo && fc->var[j].idx==i+fc->savb-fc->s.n ) { genindent(fout); fprintf(fout,"%s = ",v->cvar); genfuncbydesc1(fout,v->node,FC_copy,n); gensemicolon(fout,v->node); break; } } } void geninitfunc(FILE *fout) { gpfunc *gp=lfunc+currfunc; int i; for (i=0;iuser->savb;i++) { ctxvar *v=ctxstack+i; if (!(v->flag&(1<initval is equal to 'v, this is harmless. */ gentype(v->initval); genindent(fout); fprintf(fout,"%s = ", v->cvar); gencast(fout,v->initval,vartype(*v)); fprintf(fout,";\n"); } } void genentryspec(FILE *fout, int n, gpfunc *gp) { int arg[STACKSZ]; int nb; int y=tree[n].y; int i; context *bl; switch(gp->spec) { case GPbreak: case GPnext: if (y>=0 && tree[y].f==Fsmall) fprintf(fout,"goto label%d",tree[y].x); else fprintf(fout,gp->spec==GPbreak?"break":"continue"); break; case GPif: nb=genlistargs(n,arg,2,3); genindentline(fout,"if ("); gencast(fout,arg[0],Gbool); fprintf(fout,")\n"); if (nb==2) genbrace(fout,arg[1]); else { genbrace(fout,arg[1]); genindentline(fout,"else\n"); genbrace(fout,arg[2]); } break; case GPiferr: nb=genlistargs(n,arg,4,4); genindent(fout); gencode(fout,arg[0]); fprintf(fout,"\n"); genbrace(fout,arg[1]); fprintf(fout," pari_TRY\n"); genbrace(fout,arg[2]); fprintf(fout," "); gencode(fout,arg[3]); fprintf(fout,"\n"); break; case GPwhilenull: nb=genlistargs(n,arg,2,2); genindentline(fout,"while ("); genparens(fout,arg[0]); fprintf(fout,")\n"); genbrace(fout,arg[1]); break; case GPwhile: nb=genlistargs(n,arg,2,2); if (tree[arg[0]].f!=Fseq && tree[arg[0]].f!=Fblock) { genindentline(fout,"while ("); gencast(fout,arg[0],Gbool); fprintf(fout,")\n"); genbrace(fout,arg[1]); } else { int x=tree[arg[0]].x; int y=tree[arg[0]].y; if (tree[arg[0]].f==Fblock) { y=block[x].ret; x=tree[arg[0]].y; } genindentline(fout,"for(;;)\n"); genindentline(fout,"{\n"); indent++; genindentseq(fout,x); gencode(fout,x); gensemicolon(fout,x); if (tree[y].f==Fblock) { gencode(fout,y); y=block[tree[y].x].ret; } genindentline(fout,"if ("); gencast(fout,y,Gnegbool); fprintf(fout,")\n"); indent++; genindentline(fout,"break;\n"); indent--; genindentseq(fout,arg[1]); gencode(fout,arg[1]); gensemicolon(fout,arg[1]); indent--; genendbrace(fout,n); } break; case GPuntil: nb=genlistargs(n,arg,2,2); if ( tree[arg[0]].f!=Fseq && tree[arg[0]].f!=Fblock) { genindentline(fout,"do\n"); genbrace(fout,arg[1]); fprintf(fout," while(");/*KB style*/ gencast(fout,arg[0],Gnegbool); fprintf(fout,");\n"); } else { int x=tree[arg[0]].x; int y=tree[arg[0]].y; if (tree[arg[0]].f==Fblock) { y=block[x].ret; x=tree[arg[0]].y; } genindentline(fout,"for(;;)\n"); genindentline(fout,"{\n"); indent++; genindentseq(fout,arg[1]); gencode(fout,arg[1]); gensemicolon(fout,arg[1]); genindentseq(fout,x); gencode(fout,x); gensemicolon(fout,x); if (tree[y].f==Fblock) { genindent(fout); gencode(fout,y); y=block[tree[y].x].ret; } genindentline(fout,"if ("); gencast(fout,y,Gbool); fprintf(fout,")\n"); indent++; genindentline(fout,"break;\n"); indent--; indent--; genendbrace(fout,n); } break; case GPfor: nb=genlistargs(n,arg,4,4); genindentline(fout,"for ("); if (arg[0]!=GNOARG) gencode(fout,arg[0]); else fprintf(fout," "); fprintf(fout,"; "); if (arg[1]!=GNOARG) gencode(fout,arg[1]); fprintf(fout,"; "); if (arg[3]!=GNOARG) gencode(fout,arg[3]); fprintf(fout,")\n"); genbrace(fout,arg[2]); break; case GPdoloop: genindentline(fout,"for (;;)\n"); genbrace(fout,y); break; case GPforstep: nb=genlistargs(n,arg,4,6); genindentline(fout,"for ("); gencode(fout,arg[0]); fprintf(fout,"; "); if ( nb==4 ) gencode(fout,arg[3]); else { gencode(fout,arg[3]); fprintf(fout,"?"); gencode(fout,arg[4]); fprintf(fout,":"); gencode(fout,arg[5]); } fprintf(fout,"; "); gencode(fout,arg[2]); fprintf(fout,")\n"); genbrace(fout,arg[1]); break; #if 0 forstep(x=binf,bsup,step,SEQ) { int idx; for( idx=0,x=binf; x<=bsup; i=i==lg(step)?1:i+1,x+=step[i]) { } } #endif case GPforstepvec: nb=genlistargs(n,arg,8,8); genindentline(fout,"for ("); gencode(fout,arg[6]); fprintf(fout," = 0, "); gencode(fout,arg[0]); fprintf(fout,"; "); gencode(fout,arg[3]); fprintf(fout,"?"); gencode(fout,arg[4]); fprintf(fout,":"); gencode(fout,arg[5]); fprintf(fout,"; "); gencode(fout,arg[6]); fprintf(fout," = "); gencode(fout,arg[6]); fprintf(fout," == "); gencast(fout,arg[7],Gsmall); fprintf(fout," ? 1 :"); gencode(fout,arg[6]); fprintf(fout," + 1, "); gencode(fout,arg[2]); fprintf(fout,")\n"); genbrace(fout,arg[1]); break; case GPmakevec: nb=genlistargs(n,arg,1,STACKSZ); genindent(fout); gencode(fout,arg[0]); gensemicolon(fout,arg[0]); for(i=1;igc&(1<g.n) { genfuncbydesc(fout,0,NULL,FC_avma,n); fprintf(fout," = "); gencode(fout,arg[0]); fprintf(fout,";\n"); } else if (bl->gc&(1<gcvar[0]; int parg[2]; gencode(fout,var); fprintf(fout," = "); parg[0]=arg[0]; parg[1]=var; genfuncbydesc(fout,2,parg,FC_gerepileupto,n); fprintf(fout,";\n"); } else { int parg[STACKSZ+1]; /*FIXME:Putting an if statement in the wilderness is not secure*/ if (arg[1]!=GNOARG) { parg[0]=arg[1]; parg[1]=arg[0]; fprintf(fout,"if ("); genfuncbydesc(fout,2,parg,FC_low_stack_lim,n); fprintf(fout,")\n"); indent++; genindent(fout); indent--; } parg[0]=arg[0]; for(i=0;ig.n;i++) parg[i+1]=bl->gcvar[i]; genfuncbydesc(fout,bl->g.n+1,parg,FC_gerepileall,n); fprintf(fout,";\n"); } break; case GPreturn: fprintf(fout,"return"); if (functype(lfunc[currfunc])!=Gvoid) { /*I don't like to see `return ;'*/ fprintf(fout," "); gencast(fout,y,functype(lfunc[currfunc])); } break; case GPlabel: fprintf(fout,"label%d:",tree[y].x); break; case GPcopyarg: gencopyarg(fout); break; case GPinitfunc: geninitfunc(fout); break; case GPaddhelp: case GPinstall: break; case GPclosure: nb=genlistargs(n,arg,1,STACKSZ); if (FC_strtoclosure >=0) genfuncbydesc(fout,nb,arg,FC_strtoclosure,n); else die(n,"closure not available in this version"); break; default: if (gp->spec>0) die(n,"genentryspec: func spec not implemented"); else die(n,"Internal error: genentryspec called with no spec"); } } gp2c-0.0.8/src/lang.l0000644000175000017500000002162212155572710011170 00000000000000%{ /* Copyright (C) 2000-2006 The PARI group. This file is part of the GP2C package. PARI/GP is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY WHATSOEVER. Check the License for details. You should have received a copy of it, along with the package; see the file 'COPYING'. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" #include #include #include "header.h" #include "parse.h" #define MAX_INCLUDE_DEPTH 10 YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; int depth = 0; int linecount_stack[MAX_INCLUDE_DEPTH]; const char *nameparse_stack[MAX_INCLUDE_DEPTH]; int linecount=1; int yydebug; static enum {Mread_lines,Min_braces} mode=Mread_lines; static int start=0; static int lastcom=-1; static void countline(char *text,int len) { int i; for (i=0; i> { if ( --depth < 0 ) yyterminate(); else { yy_delete_buffer( YY_CURRENT_BUFFER ); yy_switch_to_buffer(include_stack[depth]); linecount = linecount_stack[depth]; free((void*)nameparse); nameparse = nameparse_stack[depth]; } } \\r[^\n]+ { /*With credit to flex manpage*/ char *s=yytext+2; while(*s==' ' || *s=='\t') s++; if ( depth >= MAX_INCLUDE_DEPTH ) die(-1,"\\r includes nested too deeply" ); linecount_stack[depth] = linecount; nameparse_stack[depth] = nameparse; include_stack[depth++] = YY_CURRENT_BUFFER; linecount=1; yyin = fopen(s,"r"); if (!yyin) { char *t=(char*)malloc(strlen(s)+4); sprintf(t,"%s.gp",s); yyin = fopen(t,"r"); if (!yyin) die(-1,"cannot open file `%s'",s); nameparse=strdup(t); free(t); } else nameparse=strdup(s); yy_switch_to_buffer( yy_create_buffer( yyin, YY_BUF_SIZE ) ); } \\[a-qs-z][^\n]*|\?[^\n]* { fprintf(stderr,"Warning:%s:%d: meta commands not implemented\n%s\n", nameparse,linecount,yytext); } ##?[ \t\r]*$ { /*We cannot recognize # */ fprintf(stderr,"Warning:%s:%d: meta commands not implemented\n%s\n", nameparse,linecount,yytext); } ".." return KDOTDOT; "->" return KARROW; \)[ \t\r]*-> return KPARROW; "\\/" return KDR; ">>" return KSR; "<<" return KSL; "<=" return KLE; ">=" return KGE; "!="|"<>" return KNE; "===" return KID; "==" return KEQ; "&&" return KAND; "||" return KOR; "++" return KPP; "--" return KSS; "+=" return KPE; "-=" return KSE; "*=" return KME; "/=" return KDE; "\\=" return KEUCE; "\\/=" return KDRE; "%=" return KMODE; ">>=" return KSRE; "<<=" return KSLE; "\n" {linecount++;if (mode==Mread_lines) {BEGIN(toplevel);return '\n';}} "\n" {linecount++;return '\n';} "{" {mode=Min_braces;BEGIN(INITIAL);} "}" {mode=Mread_lines;BEGIN(toplevel);} "\\\n" {linecount++;} "=" { for( ; ; ) { int c, nc, star=0; for( ; ; ) { c = input(); if ( c == EOF ) return c; if ( c == '\n' ) linecount++; else if ( c!=' ' && c!='\t' && c!='\r') break; } /*Since only one char of look-ahead is available, we have to handle the / or \ by ourself. Fortunately: after =/, only * is valid, after =\, only \ and \\n are valid. Thus we handle them and reject the rest. */ if (c!='/' && c!='\\') { unput(c); return '='; } nc=input(); if (c=='\\' && nc=='\n') { linecount++; continue; } if ((c=='/' && nc!='*') || (c=='\\' && nc!='\\')) { fprintf(stderr,"%s:%d: parse error after =%c%c\n" ,nameparse,linecount,(char)c,(char)nc); fprintf(stderr,"Errors found: aborting...\n"); exit(1); } if (c=='/') { for ( ; ; ) { int c = input(); if ( c == EOF ) die(-1,"Unfinished comment"); if ( c == '/' && star) break; if ( c == '*' ) star=1; else star=0; if ( c == '\n' ) linecount++; } } else { for ( ; ; ) { int c = input(); if ( c == EOF ) die(-1,"Unfinished comment"); if ( c == '/' && star) c='\\'; if ( c == '*' ) star=1; else star=0; if ( c == '\n' ) { linecount++; break; } if ( c == '\r' ) continue; } } } } [ \t\r]+ "/*"|"\\\\" { int star=0; int n; int nl=0; int lc=linecount; if (lastcom==-1) lastcom=newcomment(); n=lastcom; pushcomment(n,'/'); pushcomment(n,'*'); if (yytext[0]=='/') { for ( ; ; ) { int c = input(); if ( c == EOF ) die(-1,"Unfinished comment"); pushcomment(n,c); if ( c == '/' && star) break; if ( c == '*' ) star=1; else star=0; if ( c == '\n' ) linecount++; } } else { nl=1; for ( ; ; ) { int c = input(); if ( c == EOF ) die(-1,"Unfinished comment"); if ( c == '/' && star) c='\\'; if ( c == '*' ) star=1; else star=0; if ( c == '\n' ) { linecount++; break; } if ( c == '\r' ) continue; pushcomment(n,c); } pushcomment(n,' '); pushcomment(n,'*'); pushcomment(n,'/'); pushcomment(n,'\n'); } /*We hack: we put white spaces after comments in the comments This makes output looking better in most cases. Sadly we can't add white spaces that are before comments. */ for( ; ; ) { int c = input(); if ( c == EOF ) return '\n'; if ( c == '\n' ) { linecount++; pushcomment(n,c); nl=1; } else if ( c == ' ' || c == '\t') { if (nl==0) pushcomment(n,c); /*We only add spaces on the same line*/ } else if ( c != '\r' ) { unput(c); break; } } if (lc. {BEGIN(INITIAL); unput(yytext[0]);} . return yytext[0]; %% gp2c-0.0.8/src/printnode.c0000644000175000017500000002200412155572710012233 00000000000000/* Copyright (C) 2002 The PARI group. This file is part of the GP2C package. PARI/GP is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY WHATSOEVER. Check the License for details. You should have received a copy of it, along with the package; see the file 'COPYING'. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" #include #include #include "header.h" void printentryname(FILE *fout, const char *s) { if (isdigit(*s)) fprintf(fout,"p%s",s); else fprintf(fout,"%s",s); } void printentry(FILE *fout, int x) { const char *s=value[x].val.str; printentryname(fout, s); } extern int indent; void printnodeparens(FILE *fout, int n, int parens) { int i,v; context *fc; int x,y; if (n<0) return; x=tree[n].x; y=tree[n].y; gencomment(fout,n,!indent); if (debug>=3) fprintf(fout,"/*%s:%d:%s*/",GPname(tree[n].t),tree[n].m,funcname(tree[n].f)); switch(tree[n].f) { case Fseq: printnode(fout,x); if (x>=0 && tree[x].f==Fseq) x=tree[x].y; if (x>=0 && tree[x].f!=Fblock && tree[x].f!=Fdeffunc) { if (indent) fprintf(fout,";\n"); else fprintf(fout,"; \\\n"); genindent(fout); } printnode(fout,y); break; case Fmatrix: fputc('[',fout); printnode(fout,x); if (y>0) { fprintf(fout,","); printnode(fout,y); } fputc(']',fout); break; case Frange: if (x!=GNOARG) { printnode(fout,x); if (y!=GNOARG) { fputs("..",fout); printnode(fout,y); } } else if (y!=GNOARG) { fputc('^',fout); printnode(fout,y); } break; case Fmatcoeff: printnodeparens(fout,x,1); printnode(fout,y); break; case Fassign: if (parens) fputc('(',fout); printnode(fout,x); fprintf(fout,"="); printnode(fout,y); if (parens) fputc(')',fout); break; case Fconst: switch(value[x].type) { case CSTsmall: fprintf(fout,"%ld",value[x].val.small); break; case CSTsmallreal: fprintf(fout,"%ld.",value[x].val.small); break; case CSTint: case CSTreal: fprintf(fout,"%s",value[x].val.str); break; case CSTstr: fprintf(fout,"\"%s\"",value[x].val.str); break; } break; case Fsmall: fprintf(fout,"%d",x); break; case Fmatrixelts: printnode(fout,x); fprintf(fout,","); printnode(fout,y); break; case Fmatrixlines: printnode(fout,x); fprintf(fout,";"); /*Would be nice to indent matrix, alas I have no way to know where is the * bottomrow*/ printnode(fout,y); break; case Fmat: case Fvec: fprintf(fout,"["); if (tree[n].f==Fmat && x==-1) fputc(';',fout); else printnode(fout,x); fprintf(fout,"]"); break; case Flistarg: printnode(fout,x); fprintf(fout,","); printnode(fout,y); break; case Fentry: printentry(fout,x); break; case Ffun: fprintf(fout,"%s",lfunc[x].gpname); break; case Ffunction: if (x=0) { fprintf(fout,"("); if (y!=GNOARG) printnode(fout,y); fprintf(fout,")"); } } break; case Frefarg: fprintf(fout,"&"); printnode(fout,x); break; case Fcall: printnode(fout,x); fprintf(fout,"("); printnode(fout,y); fprintf(fout,")"); break; case Flambda: fprintf(fout,"("); printnode(fout,x); fprintf(fout,")->"); printnode(fout,y); break; case Fdeffunc: fprintf(fout,"\n"); printnode(fout,x); fprintf(fout,"=\n"); genindent(fout); if (tree[y].f!=Fblock) { fprintf(fout,"{\n"); indent++; genindent(fout); } printnode(fout,y); fprintf(fout,"\n"); indent--; genindent(fout); if (tree[y].f!=Fblock) { fprintf(fout,"}\n"); genindent(fout); } break; case Fblock: fprintf(fout,"{"); fc=block+x; v=fc->ret; if (v>=0) { fprintf(fout,"/*="); printentry(fout,tree[v].x); fprintf(fout,"*/"); } indent++; fprintf(fout,"\n"); genindent(fout); if (fc->s.n) { int k=fc->s.n; fprintf(fout,"my("); for(i=0;i0) fprintf(fout,", "); printentryname(fout,varstr(fc->c[i])); } fprintf(fout,");\n"); genindent(fout); } printnode(fout,y); fprintf(fout,"\n"); indent--; genindentline(fout,"}\n"); genindent(fout); break; case Fnoarg: if ( n!= GNOARG ) fprintf(fout,"gnil"); break; case Ftag: printnodeparens(fout,x,1); fprintf(fout,":%s",GPname(y)); break; } } void printnode(FILE *fout, int n) { printnodeparens(fout,n,0); } void maketreeGRL_node(FILE *fout,int n) { int x,y,f; if (n<2) return; x=tree[n].x; y=tree[n].y; f=tree[n].f; switch(tree[n].f) { case Ftag: fprintf(fout,"node: { title: \"%d\" label: \"(%s)\" }\n",n,GPname(y)); fprintf(fout,"edge: { sourcename: \"%d\" targetname: \"%d\" class:2 color: red}\n",n,x); maketreeGRL_node(fout,x); break; default: if (f #include #include #include "header.h" int linecount; int yyerror(const char *s); int yylex(void); static int once=0; static int newcommand(int x, int y) { return (x==GNOARG)?y:(y==GNOARG)?x:newnode(Fseq,x,y); } %} %union { int val; strcom str; } %token KDOTDOT ".." %token KPARROW ")->" %token KARROW "->" %token KPE "+=" %token KSE "-=" %token KME "*=" %token KDE "/=" %token KDRE "\\/=" %token KEUCE "\\=" %token KMODE "%=" %token KAND "&&" %token KOR "||" %token KID "===" %token KEQ "==" %token KNE "!=" %token KGE ">=" %token KLE "<=" %token KSRE ">>=" %token KSLE "<<=" %token KSR ">>" %token KSL "<<" %token KDR "\\/" %token KPP "++" %token KSS "--" %token KINTEGER "integer" %token KREAL "real number" %token KENTRY "variable name" %token KSTRING "character string" %left '\n' %left SEQ DEFFUNC %left INT LVAL %right ")->" "->" %left ';' ',' %right '=' "+=" "-=" "*=" "/=" "\\/=" "\\=" "%=" ">>=" "<<=" %left '&' "&&" "||" %left "===" "==" "!=" '>' ">=" '<' "<=" %left '+' '-' %left '%' "\\/" '\\' '/' '*' ">>" "<<" %left SIGN %right '^' %left '#' %left '!' '~' '[' '\'' %left '.' MAT %left "++" "--" %left '(' %left ':' %type commands seq %type range matrix matrix_index expr %type lvalue %type matrixelts matrixlines arg listarg definition %type funcid memberid %type backticks history %type compr in inseq %% commands: seq {$$=$1;} | commands '\n' seq {$$=newcommand($1,$3);} ; seq: /**/ %prec SEQ {$$=GNOARG;} | expr %prec SEQ {$$=$1;} | seq ';' {$$=$1;} | seq ';' expr {$$=newcommand($1,$3);} ; range: /* */ { $$=newnode(Frange,GNOARG,GNOARG); } | expr { $$=newnode(Frange,$1,GNOARG); } | expr ".." expr { $$=newnode(Frange,$1,$3); } | '^' expr { $$=newnode(Frange,GNOARG,$2); } ; matrix_index: '[' range ',' range ']' {$$=newnode(Fmatrix,$2,$4);} | '[' range ']' {$$=newnode(Fmatrix,$2,-1);} ; backticks: '`' {$$=1;} | backticks '`' {$$=$1+1;} ; history: '%' {$$=newopcall(OPhist,-1,-1);} | '%' KINTEGER {$$=newopcall(OPhist,newintnode($2.s,$2.c),-1);} | '%' backticks {$$=newopcall(OPhist,newnode(Fsmall,-$2,-1),-1);} ; /* KREAL catch all reals except "." * We need to fix that here. */ expr: KINTEGER %prec INT {$$=newintnode($1.s,$1.c);} | KREAL {$$=newrealnode($1.s,$1.c);} | '.' {$$=newnode(Fconst,newsmallrealvalue(0),-1);} | KINTEGER '.' KENTRY {$$=newnodecom(Ffunction,newmember($3.s),newintnode($1.s,$1.c), $3.c);} | KSTRING {$$=newstringnode($1.s,$1.c);} | '\'' KENTRY {$$=newquotenode($2.s,$2.c);} | history {$$=$1;} | expr '(' listarg ')' {$$=newnode(Fcall,$1,$3);} | funcid {$$=$1;} | lvalue %prec LVAL {$$=$1;} | matrix {$$=$1;} | compr {$$=$1;} | definition {$$=$1;} | matrix '=' expr {$$=newnode(Fassign,$1,$3);} | lvalue '=' expr {$$=newnode(Fassign,$1,$3);} | lvalue "++" {$$=newopcall(OPpp,$1,-1);} | lvalue "--" {$$=newopcall(OPss,$1,-1);} | lvalue "*=" expr {$$=newopcall(OPme,$1,$3);} | lvalue "/=" expr {$$=newopcall(OPde,$1,$3);} | lvalue "\\/=" expr {$$=newopcall(OPdre,$1,$3);} | lvalue "\\=" expr {$$=newopcall(OPeuce,$1,$3);} | lvalue "%=" expr {$$=newopcall(OPmode,$1,$3);} | lvalue "<<=" expr {$$=newopcall(OPsle,$1,$3);} | lvalue ">>=" expr {$$=newopcall(OPsre,$1,$3);} | lvalue "+=" expr {$$=newopcall(OPpe,$1,$3);} | lvalue "-=" expr {$$=newopcall(OPse,$1,$3);} | '!' expr {$$=newopcall(OPnb,$2,-1);} | '#' expr {$$=newcall("length",$2);} | expr "||" expr {$$=newopcall(OPor,$1,$3);} | expr "&&" expr {$$=newopcall(OPand,$1,$3);} | expr '&' expr {$$=newopcall(OPand,$1,$3);} | expr "===" expr {$$=newopcall(OPid,$1,$3);} | expr "==" expr {$$=newopcall(OPeq,$1,$3);} | expr "!=" expr {$$=newopcall(OPne,$1,$3);} | expr ">=" expr {$$=newopcall(OPge,$1,$3);} | expr '>' expr {$$=newopcall(OPg,$1,$3);} | expr "<=" expr {$$=newopcall(OPle,$1,$3);} | expr '<' expr {$$=newopcall(OPl,$1,$3);} | expr '-' expr {$$=newopcall(OPs,$1,$3);} | expr '+' expr {$$=newopcall(OPp,$1,$3);} | expr "<<" expr {$$=newopcall(OPsl,$1,$3);} | expr ">>" expr {$$=newopcall(OPsr,$1,$3);} | expr '%' expr {$$=newopcall(OPmod,$1,$3);} | expr "\\/" expr {$$=newopcall(OPdr,$1,$3);} | expr '\\' expr {$$=newopcall(OPeuc,$1,$3);} | expr '/' expr {$$=newopcall(OPd,$1,$3);} | expr '*' expr {$$=newopcall(OPm,$1,$3);} | '+' expr %prec SIGN {$$=newopcall(OPpl,$2,-1);} | '-' expr %prec SIGN {$$=newopcall(OPn,$2,-1);} | expr '^' expr {$$=newopcall(OPpow,$1,$3);} | expr '~' {$$=newopcall(OPtrans,$1,-1);} | expr '\'' {$$=newopcall(OPderiv,$1,-1);} | expr '!' {$$=newopcall(OPfact,$1,-1);} | expr matrix_index %prec MAT {$$=newnode(Fmatcoeff,$1,$2);} | memberid {$$=$1;} | expr ':' KENTRY {$$=newtag($1,$3.s,$3.c);} | '(' expr ')' {$$=$2;} ; lvalue: KENTRY %prec LVAL {$$=newnodecom(Fentry,newentry($1.s),-1,$1.c);} | lvalue matrix_index {$$=newnode(Fmatcoeff,$1,$2);} | lvalue ':' KENTRY {$$=newtag($1,$3.s,$3.c);} ; matrixelts: expr {$$=$1;} | matrixelts ',' expr {$$=newnode(Fmatrixelts,$1,$3);} ; matrixlines: matrixelts ';' matrixelts {$$=newnode(Fmatrixlines,$1,$3);} | matrixlines ';' matrixelts {$$=newnode(Fmatrixlines,$1,$3);} ; matrix: '[' ']' {$$=newnode(Fvec,-1,-1);} | '[' expr ".." expr ']' {$$=newopcall(OPrange,$2,$4);} | '[' ';' ']' {$$=newnode(Fmat,-1,-1);} | '[' matrixelts ']' {$$=newnode(Fvec,$2,-1);} | '[' matrixlines ']' {$$=newnode(Fmat,$2,-1);} | '[' error ']' {YYABORT;} ; in: lvalue '<' '-' expr {$$=newnode(Flistarg,$4,$1);} ; inseq: in {$$=newopcall(OPcompr,$1,-2);} | in ',' expr {$$=newopcall3(OPcompr,$1,-2,$3);} | in ';' inseq {$$=newopcall(OPcomprc,$1,$3);} | in ',' expr ';' inseq {$$=newopcall3(OPcomprc,$1,$5,$3);} ; compr: '[' expr '|' inseq ']' {$$=addcurrexpr($4,$2);} ; arg: seq {$$=$1;} | '&' lvalue {$$=newnode(Frefarg,$2,-1);} | arg error {if (!once) { yyerrok; s_errors.n--;} once=1;} expr {once=0; $$=newopcall(OPcat,$1,$4);} ; listarg: arg {$$=$1;} | listarg ',' arg {$$=newnode(Flistarg,$1,$3);} ; funcid: KENTRY '(' listarg ')' {$$=newnodecom(Ffunction,newentry($1.s),$3,$1.c);} ; memberid: expr '.' KENTRY {$$=newnodecom(Ffunction,newmember($3.s),$1,$3.c);} ; definition: funcid '=' seq %prec DEFFUNC {$$=newnode(Fdeffunc,$1,$3);} | memberid '=' seq %prec DEFFUNC {$$=newnode(Fdeffunc,$1,$3);} | lvalue "->" seq {$$=newnode(Flambda, $1,$3);} | '(' listarg ")->" seq {$$=newnode(Flambda, $2,$4);} ; %% int yyerror(const char *s) { int n=stack_new(&s_errors); errors[n].lineno=linecount; errors[n].txt=strdup(s); if (yydebug) fprintf(stderr,"%s:%d: %s\n",nameparse,linecount,s); return 0; } gp2c-0.0.8/src/type.h0000644000175000017500000000354312155572710011226 00000000000000/* Copyright (C) 2000-2005 The PARI group. This file is part of the GP2C package. PARI/GP is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY WHATSOEVER. Check the License for details. You should have received a copy of it, along with the package; see the file 'COPYING'. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ int **typemax; int *ctype; static inline int is_subtype(int a, int b) {return typemax[a][b]==b;} /*Mode: Mvar : value cannot be determined at compile time Msidef: Statement has (probably) a side effect Mterm: Statement never return. Mprec: function need the prec arg. Melse : This is an if else block, (try to) be clever... If there is doubt, set Mvar, Msidef and Mprec but not Mterm. moveblock: Msemicolon: This is a full statement, no need of ';' Mparens : May need to be braced by parens. Mbrace : This is a false block, no need of '{}' Mcopy : May need to be gcopyed. Muntil : Do not put a linebreak after the closing } */ #define MODHERIT ((1< #include #include #include #include "header.h" static int newanonvar=0; int newanon(void) { char s[33]; sprintf(s,"anon_%d",newanonvar++); return newentry(strdup(s)); } int newfun(const char *name) { char *s = malloc(5+strlen(name)); sprintf(s,"fun_%s",name); if (findfunction(s)<0) return newentry(s); free(s); return newanon(); } void mkfunc(int n, int p, int flag, int wr) { int x = tree[n].x; gpfunc *gp; const char *name=entryname(x); int nf=findfunction(name); if (nf==-1) gp=lfunc+newuserfunc(name); else { gp=lfunc+nf; if (gp->spec!=GPuser) die(n,"Trying to redefine function %s",name); else { userfunc *ufunc=gp->user; int parent=ufunc->pdefnode; int node=ufunc->defnode; if (tree[node].y>=0) warning(node,"Function %s redefined line %d",name,tree[n].lineno); if (tree[parent].x==node) tree[parent].x=GNIL; else tree[parent].y=GNIL; } } gp->user->flag=flag; gp->user->wrapper=wr; gp->user->pdefnode=p; gp->user->defnode=n; } static void topfunc(int n, int p, int fun, int pfun, int nf, int wr) { int y = tree[n].y; int fl = wr<0?(1<=0) tree[n] = tree[seq]; } static int topfuncproto(int n, int fun, int pfun, int nf) { int arg[STACKSZ+1]; int nb=genlistargs(n,arg,0,STACKSZ); gpfunc *gp = lfunc+nf; gpwrap *gw = gp->wrap; const char *proto=gp->proto.code; int i=0; int var=-1, seq, a, t, binf, wr; char const *p=proto; char c; PPproto mod; if (!proto) return 1; while((mod=parseproto(&p,&c))) { switch(mod) { case PPauto: break; case PPstd: if (i>=nb || arg[i]==GNOARG) die(n,"missing mandatorry argument"); a = arg[i++]; wr = i<=gw->nb ? gw->w[i-1]:-2; switch(c) { case 'G': if (wr>=0 && tree[a].f==Flambda) topfunclambda(a, n, fun, pfun, wr); break; case 'V': var = a; killlistarg(n,a); break; case '=': genequal(a,lfunc[nf].gpname,&var,&binf,&t); tree[a]=tree[binf]; break; case 'I': case 'E': if (wr>=-1) { seq = newnode(Flambda,var,newleaf(a)); tree[a] = tree[seq]; topfunclambda(a, n, fun, pfun, wr); } break; } break; case PPdefault: i++; a = i<=nb ? arg[i-1]: GNOARG; wr = i<=gw->nb ? gw->w[i-1]:-2; switch(c) { case 'I': case 'E': if (a!=GNOARG && wr>=-1) { seq = newnode(Flambda,var,newleaf(a)); tree[a]=tree[seq]; topfunclambda(a, n, fun, pfun, wr); } break; } break; case PPdefaultmulti: i++; break; case PPstar: break; default: die(n,"internal error: PPproto %d in genfuncbycode",mod); } } return 0; } /* n: node p:parent node */ void gentopfunc(int n, int p, int fun, int pfun) { int x,y; if (n<0) return; x=tree[n].x; y=tree[n].y; switch(tree[n].f) { case Flambda: topfunclambda(n,p,fun,pfun,-1); break; case Fdeffunc: if (fun>=0) { int nn = newfun(entryname(x)); int seq= newnode(Fassign,newnode(Fentry,tree[x].x,-1),newnode(Fentry,nn,-1)); int nf = newnode(Fdeffunc,newnode(Ffunction,nn,tree[x].y),tree[n].y); topfunc(n,p,fun,pfun,nf,-1); tree[n] = tree[seq]; } else topfunc(n,p,fun,pfun,n,-1); break; case Fassign: if (tree[x].f==Fentry && tree[y].f==Flambda) { int nn = newfun(entryname(x)); int seq= newnode(Fentry,nn,-1); int nf = newnode(Fdeffunc,newnode(Ffunction,nn,tree[y].x),tree[y].y); topfunc(y,n,fun,pfun,nf,-1); if (fun>=0) tree[y] = tree[seq]; } else { gentopfunc(x,n,fun,pfun); gentopfunc(y,n,fun,pfun); } break; case Ffunction: { int nf = findfunction(entryname(n)); if (nf>=0 && !lfunc[nf].iter && lfunc[nf].wrap && lfunc[nf].spec<0) topfuncproto(n,fun,pfun,nf); gentopfunc(y,n,fun,pfun); } break; case Fentry: case Fconst: case Fsmall: case Fnoarg: break; case Frefarg: case Ftag: gentopfunc(x,n,fun,pfun); break; default: if (tree[n].f>=FneedENTRY) die(n,"Internal error: unknown func %s in gentopfunc",funcname(tree[n].f)); else { gentopfunc(x,n,fun,pfun); gentopfunc(y,n,fun,pfun); } } } gp2c-0.0.8/gp2c-dbg0000755000175000017500000000047211642144547010621 00000000000000#! /bin/sh #This file is part of the GP2C package # #This stupid shell script is Public Domain. # if test ! -f scripts/gp2c-dbg; then cat <&2 Package has not been configured for debugging. Please type ./configure --enable-debug to configure it for debugging. EOF exit 1; fi GP2C=./gp2c scripts/gp2c-dbg $* gp2c-0.0.8/gp2c0000755000175000017500000000041511642144547010064 00000000000000#! /bin/sh #This file is part of the GP2C package # #This stupid shell script is Public Domain. # if test ! -f src/gp2c; then cat <&2 gp2c has not been compiled. Please type ./configure make to compile it. EOF exit 1; fi GP2C_FUNC_DSC=desc/func.dsc src/gp2c $* gp2c-0.0.8/NEWS0000644000175000017500000000357612155572710010012 00000000000000gp2c 0.0.7 -- This version is targeted to PARI 2.5 by default, though PARI 2.3 is still supported. -- This release fixes support for some PARI 2.5 GP extensions. -- This release adds support for declaring local variables declared inside blocks. gp2c 0.0.6 -- This release add support for most PARI 2.5 GP extensions. -- When used with PARI 2.4.4 and up, this release adds support for closures, and iterators like intnum, sumalt, forsubgroup, etc. gp2c 0.0.5 -- This version handles PARI 2.3 and later release, but not the 2.1 and 2.2 release. -- This release allows to use a PARI debug build for configuring gp2c-dbg separatly from gp2c-run. -- gp2c-run and gp2c-dbg create a .gp.run file instead of gp2c_start.gp and gp2c_gprc. -- This release adds support for &a[b] and break(n)/next(n). gp2c 0.0.4 -- This version handles PARI 2.2.8 release and above, 2.1 stable release, but no more the release 2.2.0 to 2.2.6, and mostly the 2.2.7 release. -- All references to libpari API is made through the description system. -- When used with PARI 2.2.8 and above, this release fully supports forvec(). -- The documentation has been extended to cover types. -- This version generates cleaner and more ANSI-C compliant C code. gp2c 0.0.3 -- This version handles PARI 2.2.7 release and above, 2.1 stable release, but no more the release 2.2.0 to 2.2.6. -- When used with PARI 2.2.7 and above, this release has full support for member function and functions taking a variable number of strings as arguments, usually text-based I/O functions. gp2c 0.0.2 -- This version handles automatic concatenation and supports more functions. gp2c 0.0.1 -- This version comes with a manual. This is doc/gp2c.tex LaTeX source doc/gp2c.dvi DVI format doc/html/index.html HTML format -- There is now a script gp2c-run to simplify the use of gp2c. gp2c 0.0.0 -- Add NEWS file to be computer-friendly with automake. gp2c-0.0.8/scripts/0000755000175000017500000000000012217042364011043 500000000000000gp2c-0.0.8/scripts/dotest.in0000755000175000017500000000207612156115130012617 00000000000000#! /bin/sh -e suite=${1:-"test"} bugs=0 testdir=`cd "$srcdir/$suite" && pwd` cd $suite RUNTEST=${RUNTEST:-"@PARI_RUNTEST@"} GP2C_FUNC_DSC=../desc/func.dsc export GP2C_FUNC_DSC for i in `ls "$testdir/input"`; do if test -f "$testdir/gp/$i.gp"; then echo @ECHON@ "Testing script $i...@ECHOC@" rm -f $i.gp.c $i.gp.o $i.gp.so $i.gp $i.res start.gp cp "$testdir/gp/$i.gp" . if ../src/gp2c -p gp2c_ -g -o $i.gp.c $i.gp 2>$i.res; then command=`echo "@PARI_MODULE_BUILD@" | sed -e s/%s/$i.gp/g` eval $command grep "^GP;" $i.gp.c | sed 's/^GP;//' >start.gp cat "$testdir/input/$i" >>start.gp $RUNTEST '@GP_PATH@' -f -q --test $i.res 2>&1 if test -f "$testdir/res/$i.res"; then if diff "$testdir/res/$i.res" $i.res >/dev/null; then echo "@ECHOT@OK." else echo "@ECHOT@BUG." bugs=1; fi else test "$srcdir" = "." && cp $i.res "$testdir/res/$i.res" echo cat $i.res fi else echo "@ECHOT@BUG." bugs=1; fi fi done exit $bugs gp2c-0.0.8/scripts/gp2c-run.in0000755000175000017500000000273512141547407012766 00000000000000#!/bin/sh -e #Copyright (C) 2001-2006 The PARI group. # #This file is part of the GP2C package. # #PARI/GP is free software; you can redistribute it and/or modify it under the #terms of the GNU General Public License as published by the Free Software #Foundation. It is distributed in the hope that it will be useful, but WITHOUT #ANY WARRANTY WHATSOEVER. # #Check the License for details. You should have received a copy of it, along #with the package; see the file 'COPYING'. If not, write to the Free Software #Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. name="stdin"; for p in "$@"; do case "$p" in -h|--help) cat < Compile file.gp with gp2c and launch a gp session with functions of file.gp added. are passed to gp2c gp2c-run Compile file.c and launch a gp session with functions of file.c added. ENVIRONMENT: GP2C: path to the gp2c compiler, default: @mybindir@/gp2c GP: path to the gp calculator, default: @GP_PATH@ EOF exit ;; -l|-t|-v) exec $GP2C "$@" ;; -o) echo "gp2c-run does not support option -o" 1>&2; exit 1;; -*) ;; #We discard options *) name=$p;; esac done if test "x$GP2C" = "x"; then GP2C="@mybindir@/gp2c" fi if test "x$GP" = "x"; then GP="@GP_PATH@" fi case $name in *.c) name=${name%.c};; *) $GP2C -o $name.c "$@" ;; esac command=`echo "@PARI_MODULE_BUILD@" | sed -e "s %s $name g"` eval $command || exit $? grep "^GP;" $name.c | sed 's/^GP;//' >$name.run $GP $name.run gp2c-0.0.8/scripts/Makefile.in0000644000175000017500000003252012165534611013035 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = scripts DIST_COMMON = $(srcdir)/822_desc.pl.in $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/dotest.in \ $(srcdir)/gp2c-dbg.in $(srcdir)/gp2c-run.in \ $(srcdir)/runtest.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = 822_desc.pl runtest dotest gp2c-run gp2c-dbg CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(bindir)" SCRIPTS = $(bin_SCRIPTS) SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHOC = @ECHOC@ ECHON = @ECHON@ ECHOT = @ECHOT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GP2C_DBG = @GP2C_DBG@ GP2C_DBG1 = @GP2C_DBG1@ GP_PATH = @GP_PATH@ GP_PATH_DBG = @GP_PATH_DBG@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARI_DATADIR = @PARI_DATADIR@ PARI_DESC = @PARI_DESC@ PARI_MODULE_BUILD = @PARI_MODULE_BUILD@ PARI_MODULE_DEBUG = @PARI_MODULE_DEBUG@ PARI_RUNTEST = @PARI_RUNTEST@ PARI_VERSION = @PARI_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_PATH = @PERL_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ mybindir = @mybindir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ bin_SCRIPTS = gp2c-run @GP2C_DBG@ EXTRA_SCRIPTS = gp2c-dbg all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu scripts/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu scripts/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): 822_desc.pl: $(top_builddir)/config.status $(srcdir)/822_desc.pl.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ runtest: $(top_builddir)/config.status $(srcdir)/runtest.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ dotest: $(top_builddir)/config.status $(srcdir)/dotest.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ gp2c-run: $(top_builddir)/config.status $(srcdir)/gp2c-run.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ gp2c-dbg: $(top_builddir)/config.status $(srcdir)/gp2c-dbg.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(SCRIPTS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-binSCRIPTS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-am uninstall-binSCRIPTS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: gp2c-0.0.8/scripts/gp2c-dbg.in0000644000175000017500000000274512141547407012714 00000000000000#!/bin/sh -e #Copyright (C) 2001-2006 The PARI group. # #This file is part of the GP2C package. # #PARI/GP is free software; you can redistribute it and/or modify it under the #terms of the GNU General Public License as published by the Free Software #Foundation. It is distributed in the hope that it will be useful, but WITHOUT #ANY WARRANTY WHATSOEVER. # #Check the License for details. You should have received a copy of it, along #with the package; see the file 'COPYING'. If not, write to the Free Software #Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. name="stdin"; for p in "$@"; do case "$p" in -h|--help) cat < Compile file.gp with gp2c and launch a debugger session of gp with functions of file.gp added. are passed to gp2c ENVIRONMENT: GP2C: path to the GP2C compiler, default: @mybindir@/gp2c GP_DBG: path to the GP calculator, default: @GP_PATH@ GP2C_DBG: command to start the debugger, default: gdb --args EOF exit ;; -l|-t|-v) exec $GP2C "$@" ;; -*) ;; #We discard options *) name=$p;; esac done if test "x$GP2C" = "x"; then GP2C="@mybindir@/gp2c" fi if test "x$GP_DBG" = "x"; then GP_DBG="@GP_PATH_DBG@" fi if test "x$GP2C_DBG" = "x"; then GP2C_DBG="gdb --args" fi case $name in *.c) name=${name%.c};; *) $GP2C "$@" >$name.c;; esac command=`printf "@PARI_MODULE_DEBUG@" $name $name $name $name` eval $command || exit $? grep "^GP;" $name.c | sed 's/^GP;//' >$name.run $GP2C_DBG $GP_DBG $name.run gp2c-0.0.8/scripts/822_desc.pl.in0000644000175000017500000001122712165115645013246 00000000000000#! @PERL_PATH@ #Copyright (C) 2003-2005 The PARI group. # #This file is part of the GP2C package. # #PARI/GP is free software; you can redistribute it and/or modify it under the #terms of the GNU General Public License as published by the Free Software #Foundation. It is distributed in the hope that it will be useful, but WITHOUT #ANY WARRANTY WHATSOEVER. # #Check the License for details. You should have received a copy of it, along #with the package; see the file 'COPYING'. If not, write to the Free Software #Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #This is the description compiler for gp2c. BEGIN { $pari_desc=shift @ARGV; $compat_desc=shift @ARGV; $override_desc=shift @ARGV; -f "@PARI_DATADIR@/PARI/822.pm" || exit 1; -f $pari_desc || exit 1; } use lib "@PARI_DATADIR@"; use PARI::822; PARI::822::read(\%funcs,$override_desc,0) if defined($override_desc); PARI::822::read(\%funcs,$pari_desc,0); PARI::822::read(\%funcs,$compat_desc,0) if defined($compat_desc); %accepted_class=( ''=>1, 'basic'=>1, 'gp'=>1,'highlevel'=>1, 'symbolic_operators'=>1, 'member_functions'=>1, 'gp2c'=>1, 'gp2c_internal'=>1); %accepted_command= ( 'add'=>1, 'sub'=>1, 'neg'=>1, 'mul'=>1, 'div'=>1, 'mod'=>1, 'and'=>1, 'or'=>1, 'xor'=>1, 'not'=>1, 'parens'=>1, 'stdref'=>1, 'value'=>1, 'type'=>1, 'nbarg'=>1, 'str_format'=>1, 'str_raw'=>1, 'cast'=>1,'code'=>1, 'format_string'=>1,'format_args'=>1, 'cookie' => 1, 'wrapper' => 1 ); sub check_cname { my ($gpname, $cname) = @_; while($cname =~ /\$\{([^}]*)\}(.*)/) { my ($rpl) = $1; $cname = $2; for (split(' ', $rpl)) { /^-?[0-9]+$/ and next; /^:[a-z_A-Z]+$/ and next; defined($accepted_command{$_}) and next; print STDERR "Warning: $gpname unsupported command $_, skipped\n"; return 0; } } return 1; } for $gpname (sort keys %funcs) { my $f=$funcs{$gpname}; next unless (defined($accepted_class{$f->{'Class'}})); my $description=$f->{'Description'}; my $proto=$f->{'Prototype'}; my $wrapper=$f->{'Wrapper'}; my $iterator=$f->{'Iterator'}; print "$gpname\n"; my @entry=(); if (defined($description)) { my @rules = split("\n",$description); @rules = grep { $_ !~ /^[ \n\t]*$/ } @rules; my @erules = (); push @erules, join("\n",0,scalar(@rules)); foreach (@rules) { /^[ \n\t]* \(([^)]*)\) (?::([A-Za-z0-9_:]*))? [ \n\t]* ([^\n]*) [ \n\t]*$/x or die "badly formatted description $_"; my $arglist=$1; my $cname=$3; my $typelist=$2; $arglist =~ tr/ \n\t//d; my @args=split(',',$arglist,-1); my @type=split(':',$typelist,-1); $cname =~ s/\$%([0-9]+)/\${$1 str_format}/g; $cname =~ s/\$#/\${nbarg}/g; $cname =~ s/\$\(([0-9]+)\)/\${parens $1 code}/g; $cname =~ s/\$([0-9]+)/\${$1 code}/g; $cname =~ s/\$([a-z_A-Z]+):([0-9]+)/\${$2 :$1 cast}/g; $cname =~ s/\$\(([a-z_A-Z]+):([0-9]+)\)/\${parens $2 :$1 cast}/g; check_cname($gpname,$cname) or next; push @erules, join("\n",$cname,scalar(@args),@args,scalar(@type),@type); } push @entry, join("\n",@erules); } if (defined($proto)) { $type="gen"; $type="void" if ($proto =~ /^v/); $type="small" if ($proto =~ /^l/); $type="small_int" if ($proto =~ /^i/); @type=($type); push @type,"copy" if ($proto =~ /^m/); push @type,"prec" if ($proto =~ /p/); $proto =~ s/^[ilmv]//; push @entry, join("\n",1,$f->{'C-Name'},$proto,scalar(@type),@type); } if (defined($wrapper)) { $wrapper =~ tr/ \n\t//d; $wrapper =~ m/^\(([^)]*)\)/ or die "badly formatted wrapper $wrapper"; my $wraplist=$1; my @wrap=map { ($_ eq "" || $_ eq "_") ? "$_":"_wrap_$_"; } split(',',$wraplist,-1); push @entry, join("\n",2,scalar(@wrap),@wrap); } if (defined($iterator)) { my @rules = split("\n",$iterator); @rules = grep { $_ !~ /^[ \n\t]*$/ } @rules; my @erules = (); push @erules, join("\n",3,scalar(@rules)); foreach (@rules) { /^[ \n\t]* \(([^)]*)\) (?::([A-Za-z0-9_:]*))? [ \n\t]* \(([^\n]*)\) [ \n\t]*$/x or die "badly formatted iterator $_"; my $arglist=$1; my $iterlist=$3; my $typelist=$2; $arglist =~ tr/ \n\t//d; $iterlist =~ tr/ \n\t//d; my @args=split(',',$arglist,-1); my @type=split(':',$typelist,-1); my @iter=split(',',$iterlist,-1); push @erules, join("\n",scalar(@iter),@iter, scalar(@args),@args, scalar(@type),@type); } push @entry, join("\n",@erules); } print scalar(@entry),"\n"; print join("\n",@entry)."\n" if (@entry); } gp2c-0.0.8/scripts/Makefile.am0000644000175000017500000000007312141547407013023 00000000000000bin_SCRIPTS = gp2c-run @GP2C_DBG@ EXTRA_SCRIPTS = gp2c-dbg gp2c-0.0.8/scripts/runtest.in0000644000175000017500000000056612156150301013017 00000000000000#! /bin/sh -e MAJORVER=`echo "@PARI_VERSION@" | cut -d. -f1` MINORVER=`echo "@PARI_VERSION@" | cut -d. -f2` echo Running test traditionnal scripts/dotest test if test $MAJORVER -gt 2 || test $MINORVER -gt 4; then echo Running test closure scripts/dotest test2 fi if test $MAJORVER -gt 2 || test $MINORVER -gt 5; then echo Running test ranges scripts/dotest test3 fi gp2c-0.0.8/aclocal.m40000644000175000017500000011152712165534610011145 00000000000000# generated automatically by aclocal 1.11.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, # Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11.6], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11.6])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, # 2010, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 16 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.62])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_PROG_LEX # ----------- # Autoconf leaves LEX=: if lex or flex can't be found. Change that to a # "missing" invocation, for better error output. AC_DEFUN([AM_PROG_LEX], [AC_PREREQ(2.50)dnl AC_REQUIRE([AM_MISSING_HAS_RUN])dnl AC_REQUIRE([AC_PROG_LEX])dnl if test "$LEX" = :; then LEX=${am_missing_run}flex fi]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008, # 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless `enable' is passed literally. # For symmetry, `disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful (and sometimes confusing) to the casual installer], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, # Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software # Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 1 # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR gp2c-0.0.8/doc/0000755000175000017500000000000012217042364010121 500000000000000gp2c-0.0.8/doc/gp2c.html0000644000175000017500000012612012156115342011563 00000000000000 An introduction to gp2c

An introduction to gp2c

By Bill Allombert and Ariel Pacetti

Contents

1  What is gp2c?

The gp2c compiler is a package for translating GP routines into the C programming language, so that they can be compiled and used with the PARI system or the GP calculator.

The main advantage of doing this is to speed up computations and to include your own routines within the preexisting GP ones. It may also find bugs in GP scripts.

This package (including the latest versions) can be obtained at the URL:
http://pari.math.u-bordeaux.fr/download.html#gp2c

1.1  Installing gp2c

After downloading the file gp2c-x.y.zplt.tar.gz (where x,y,z and t depend on the version), you first have to unzip the file with the command:

gunzip gp2c-x.y.zplt.tar.gz

This will create the new file gp2c-x.y.zplt.tar. Next you have to extract the files with the tar program:

tar -xvf gp2c-x.y.zplt.tar

Note: You can do both steps at once with GNU tar by using the command:

tar -zxvf gp2c-x.y.zplt.tar.gz

This creates a directory gp2c-x.y.zplt, which contains the main gp2c files. Now you have to install the program.

You need the file pari.cfg. This file can be found in the PARI object directory and is installed in $prefix/lib/pari/.

Copy or link this file in the gp2c directory, be sure to call it pari.cfg.

ln -s .../lib/pari/pari.cfg pari.cfg

Run ./configure, which will search for the PARI version and some other configuration tools of the system. To install the program, type make, and the program will be compiled. You can then run make check to verify that everything has gone fine (a bunch of OK’s should show up). All of this is completely standard, and you are now ready to use gp2c.

You can use gp2c directly from this directory or you can install it by running make install as root. If you do not install it, you can run it from the gp2c directory by typing ./gp2c

2  A gp2c tutorial

2.1  How can I compile and run my scripts?

The simplest way to use gp2c is to call gp2c-run. If you want to know what happens in detail, see next section.

To make the examples easier to follow, please move to the gp2c directory and link the root of your PARI source there:

ln -s .../pari .

As an example, we will take the file pari/examples/squfof.gp, which is a simple implementation of the well-known SQUFOF factoring method of D. Shanks.

We just run the command:

./gp2c-run pari/examples/squfof.gp

After a little processing we get a GP session. But this session is special, because it contains the compiled squfof function. Hence we can do the following:

parisize = 4000000, primelimit = 500000
? squfof(3097180303181)
[419]
i = 596
Qfb(133225, 1719841, -261451, 0.E-28)
%1 = 1691693

Let’s try a bigger example:

? squfof(122294051504814979)
[20137]
  ***   the PARI stack overflows !
  current stack size: 4.0 Mbytes
  [hint] you can increase GP stack with allocatemem()
? allocatemem()
  ***   Warning: doubling stack size; new stack = 8.0 MBytes.
? squfof(122294051504814979)
[20137]
[20137, 3445]
i = 46474
Qfb(321233929, 131349818, -367273962, 0.E-28)
%2 = 73823023

We need a large stack because by default gp2c does not generate code to handle the stack (the so-called gerepile code). To instruct gp2c to add gerepile code automatically, we must use the -g option. So quit this GP session and launch a new one with -g. Oh well, before that type

ls pari/examples/squfof.gp*

pari/examples/squfof.gp    pari/examples/squfof.gp.run
pari/examples/squfof.gp.c  pari/examples/squfof.gp.so
pari/examples/squfof.gp.o

These are the files generated by gp2c-run:

  • pari/examples/squfof.gp.c is the C file generated by gp2c.
  • pari/examples/squfof.gp.o is the object file generated by the C compiler.
  • pari/examples/squfof.gp.so is the shared library generated by the linker.
  • pari/examples/squfof.gp.run is a file that contains the commands needed to load the compiled functions inside GP.

It is the shared library which is used by GP.

Now let’s continue:

./gp2c-run -g pari/examples/squfof.gp

parisize = 4000000, primelimit = 500000
? squfof(122294051504814979)
[20137]
[20137, 3445]
i = 46474
Qfb(321233929, 131349818, -367273962, 0.E-28)
%1 = 73823023

This time it works with no difficulty using the default stack. We would like to know how much faster the compiled code runs, so we need to load the non compiled squfof file in GP:

? \r pari/examples/squfof.gp
  ***   unexpected character: squfof(n)=if(isprime(n),retur
                                       ^--------------------

Why?? Because squfof already exists as an installed function and GP refuses to overwrite it. To solve this problem, we will add a suffix to the name of the compiled function under GP. Quit the session and type:

./gp2c-run -g -s_c pari/examples/squfof.gp

Now the function squfof is named squfof_c instead, so we can do

parisize = 4000000, primelimit = 500000
? \r pari/examples/squfof.gp
? #
   timer = 1 (on)
? squfof(122294051504814979)
[20137]
[20137, 3445]
i = 46474
Qfb(321233929, 131349818, -367273962, 0.E-28)
time = 5,810 ms.
%1 = 73823023
? squfof_c(122294051504814979)
[20137]
[20137, 3445]
i = 46474
Qfb(321233929, 131349818, -367273962, 0.E-28)
time = 560 ms.
%2 = 73823023

So the compiled version is more than ten times faster than the noncompiled one. However for more complex examples, compiled code usually runs only three times faster on average.

An extra trick: once you have run gp2c-run on your script, it is compiled and you can use the compiled version outside gp2c-run in any GP session by loading the file with extension .gp.run. For example quit the gp2c-run session and start gp and do

parisize = 4000000, primelimit = 500000
? \r pari/examples/squfof.gp.run

Now you have access to the compiled function squfof_c as well.

2.2  How can I compile directly with gp2c?

Now we want to compile directly with gp2c to understand what happens. We should run the command

./gp2c pari/examples/squfof.gp > squfof.gp.c

This creates a file squfof.gp.c in the gp2c directory. Now read this file with your favorite editor.

The first line is highly system-dependent, but should be similar to:

/*-*- compile-command: "/usr/bin/gcc -c -o pari/examples/squfof.gp.o
  -O3 -Wall -I/usr/local/include pari/examples/squfof.gp.c
  && /usr/bin/gcc -o pari/examples/squfof.gp.so
  -shared   pari/examples/squfof.gp.o"; -*-*/

This is the command needed to compile this C file to an object file with the C compiler and then to make a shared library with the linker. If you use emacs, typing ’M-x compile’ will know about this command, so you will just need to type Return to compile.

The second line is

#include <pari/pari.h>

This includes the PARI header files. It is important that the header files come from the same PARI version as GP, else it will create problems.

The next lines are

/*
GP;install("squfof","D0,G,p","squfof","./pari/examples/squfof.gp.so");
GP;install("init_squfof","v","init_squfof","./pari/.../squfof.gp.so");
*/

The characters "GP;" denote a command that should be read by GP at start-up. Here, the install() commands above must be given to GP to let it know about functions defined by the library. gp2c-run copy such commands to the file ./pari/examples/squfof.gp.run.

Please read the entry about the install() command in the PARI manual.

The init_squfof function is an initialization function that is created automatically by gp2c to hold codes that is outside any function. Since in our case there are none, this is a dummy function. In other cases, it is essential. The next lines are

GEN squfof(GEN n, long prec);
void init_squfof(void);
/*End of prototype*/

This is the C prototypes of your functions. The rest of the file is the C code proper.

For teaching purpose, let’s run the command

./gp2c -s_c pari/examples/squfof.gp > squfof2.gp.c

and look at the difference between squfof.gp.c and squfof2.gp.c:

diff -u squfof.gp.c squfof2.gp.c

--- squfof.gp.c Tue Feb 26 13:44:42 2002
+++ squfof2.gp.c        Tue Feb 26 13:44:49 2002
@@ -1,8 +1,8 @@
 /*-*- compile-command: "/usr/bin/gcc -c -o pari/examples/squfof.gp.o
  -DMEMSTEP=1048576 -g -Wall -Wno-implicit  -I/usr/local/include
  pari/examples/squfof.gp.c && /usr/bin/ld -o pari/examples/squfof.gp.so
  -shared   pari/examples/squfof.gp.o"; -*-*/
 #include <pari/pari.h>
 /*
-GP;install("squfof","D0,G,p","squfof","./pari/examples/squfof.gp.so");
-GP;install("init_squfof","v","init_squfof","./pari/.../squfof.gp.so");
+GP;install("squfof","D0,G,p","squfof_c","./pari/...les/squfof.gp.so");
+GP;install("init_squfof","v","init_squfof_c","./par.../squfof.gp.so");
 */
 GEN squfof(GEN n, long prec);
 void init_squfof(void);

If you are not familiar with the diff utility, the above means that only the two lines starting with GP;install have changed. In fact squfof is still named squfof in the C file, but the install command tells GP to rename it squfof_c in the GP session.

2.3  Using gp2c to find errors in GP scripts

The gp2c compiler can also be used to find errors in GP programs. For that we should use the -W option like in

./gp2c -W pari/examples/squfof.gp > squfof.gp.c

Warning:pari/examples/squfof.gp:7:variable undeclared
p
Warning:pari/examples/squfof.gp:11:variable undeclared
dd
Warning:pari/examples/squfof.gp:11:variable undeclared
d
Warning:pari/examples/squfof.gp:11:variable undeclared
b
...
Warning:pari/examples/squfof.gp:45:variable undeclared
b1

This option lists variables that are used but not declared. It is important to declare all your variables with local(), or with global(). For gp2c, undeclared variables are taken to be “formal variables” for polynomials. For example if you write a function to build a second degree polynomial like

pol(a,b,c)=a*x^2+b*x+c

you must not declare ’x’ here, since it stands for the formal variable x.

2.4  Using compiled functions in a new program

One you have successfully compiled and tested your functions you may want to reuse them in another GP program.

The best way is to copy the install commands of the functions you use at the start of the new program so that reading it will automatically load the compiled functions.

As an example, we write a simple program fact.gp that reads

install("squfof","D0,G,p","squfof","./pari/examples/squfof.gp.so");
fact_mersenne(p)=squfof(2^p-1)

and run GP:

parisize = 4000000, primelimit = 500000
? \rfact
? fact_mersenne(67)
i = 2418
Qfb(10825778209, 4021505768, -13258245519, 0.E-28)
%1 = 193707721

So all goes well. But what is even better is that gp2c understands the install command and will be able to compile this new program.

Also this particular example will fail because as stated above, PARI/GP already has a squfof function, and the linker will pick the wrong one, which is unfortunate.

So use the -p option to gp2c-run to change squfof to my_squfof.

./gp2c-run -pmy_ -g pari/examples/squfof.gp

This option prefixes my_ to every GP name in the program so as to avoid name clashes. Change fact.gp to

install("my_squfof","D0,G,p","squfof","./pari/examples/squfof.gp.so");
fact_mersenne(p)=squfof(2^p-1)

and run

./gp2c-run -g fact.gp

parisize = 4000000, primelimit = 500000
? fact_mersenne(67)
i = 2418
Qfb(10825778209, 4021505768, -13258245519, 0.E-28)
%1 = 193707721

Nice isn’t it?

But it gets even better: instead of writing the install command directly in your script you can just load the squfof.gp.run using \r: just change fact.gp to

\r ./pari/examples/squfof.gp.run
fact_mersenne(p)=squfof(2^p-1)

2.5  Hand-editing the C file generated by gp2c

If you have some experience in PARI programming, you may want to manually edit the C file generated by gp2c, for example to improve memory handling. Here some tips:

  • If you preserve the install() at the start of the file, you can use the command gp2c-run file.c to recompile your file and start a new GP session with your functions added, just as you use gp2c-run with GP scripts.
  • More generally, gp2c-run automatically passes any line in the C file starting with ’GP;’ to GP at start-up.
  • As explained in Section 2.2, under emacs you can type ’M-x compile’ to recompile the shared library.

3  Advanced use of gp2c

3.1  gp2c types

Internally gp2c assign types to objects. The most common types are given below:

namedescription
voidlike in C
boolboolean, true (1) or false (0)
negboolantiboolean, true (0) or false (1)
smallC integer long
intmultiprecision integer
realmultiprecision floating point
mpmultiprecision number
varvariable
polpolynomial
vecsmallvector of C long (t_VECSMALL)
vecvector and matrices (excluding vecsmall)
listGP lists
strcharacters string as a char *
genstrcharacters string as a GEN (t_STR)
gengeneric PARI object (GEN)
lglength of object (returned by length)
typtype of object (returned by type)

Table 1: Types preorder

Types are preordered as in Table 1. The complete preorder known by gp2c can be accessed by running gp2c -t.

Variables are typed. A variable can only take values having a type equal or lower than its type. By default, variables are of type gen.

3.2  Type declaration

To declare a variable as belonging to type type, use:

function(x:type,y:type=2)
local(x:type, y:type=2)
global(x:type, y:type=2)
for(i:type=...

To declare several variables of the same type type at once, use:

local(x, y=2):type
global(x, y=2):type

You can even mix the two ways:

local(x, y:type2=2):type1

will declare x to be of type type1 and y of type type2.

3.3  Effect of types declaration on default values

Under GP, all GP variables start with a default value, which is 0 for a local variable and ’v for a global variable v.

The gp2c compiler follows this rule for variables declared without a type. However, when a variable is declared with a type, gp2c will not assign it a default value. This means that the declaration local(g) is equivalent to local(g:gen=0), but not to local(g:gen), global(g) is equivalent to global(g:gen=’g), but not to global(g:gen), and f(g)=... is equivalent to f(g:gen=0)=..., but not to f(g:gen)=....

This rule was chosen for several reasons:

  • The default value (0 or ’v) might not be an object suitable for the type in question. For example, local(v:vec) declares v as being of type vec. It would make no sense to initialize v to 0 since 0 does not belong to type vec. Similarly global(N:int) declares N as being of type int. It would make no sense to initialize N to ’N since ’N does not belong to type int.
  • This allows defining GP functions with mandatory arguments. This way, GP will issue an error if a mandatory argument is missing. Without this rule, there is no way to tell apart 0 from a missing argument.
  • This allows telling gp2c not to generate useless default values.

3.4  Type casting

Sometimes, we know a more precise type than the one the transtyping algorithm can derive. For example if x is a real number, its logarithm might be complex. However, if we are sure x is positive, the logarithm will be real.

To force an expression to belong to type type, use the syntax:
expr:type
gp2c will check types consistency and output warnings if necessary. For example
f(x:int)=local(r:real); r=log(x^2+1)
gp2c will complain that the logarithm might not be real. Since x^2+1 is always positive, we can write:
f(x:int)=local(r:real); r=log(x^2+1):real

3.5  Example of optimisation

Declaring the types of variables allow gp2c to perform some optimisations. For example, the following piece of GP code

rho(n)=
{
  local(x,y);

  x=2; y=5;
  while(gcd(y-x,n)==1,
    x=(x^2+1)%n;
    y=(y^2+1)%n; y=(y^2+1)%n
   );
  gcd(n,y-x)
}

generates the following output:

GEN
rho(GEN n)
{
  GEN x = gen_0, y = gen_0;
  x = gen_2;
  y = stoi(5);
  while (gcmp1(ggcd(gsub(y, x), n)))
  {
    x = gmod(gaddgs(gsqr(x), 1), n);
    y = gmod(gaddgs(gsqr(y), 1), n);
    y = gmod(gaddgs(gsqr(y), 1), n);
  }
  return ggcd(n, gsub(y, x));
}

The functions gsqr, gaddgs, gmod, ggcd are generic PARI functions that handle gen objects. Since we only want to factor integers with this method, we can declare n, x   y of type int:

rho(n:int)=
{
local(x:int,y:int);

  x=2; y=5;
  while(gcd(y-x,n)==1,
    x=(x^2+1)%n;
    y=(y^2+1)%n; y=(y^2+1)%n
   );
  gcd(n,y-x)
}

The new C code output by gp2c is:

GEN
rho(GEN n)        /* int */
{
  GEN x, y;       /* int */
  if (typ(n) != t_INT)
    pari_err(typeer, "rho");
  x = gen_2;
  y = stoi(5);
  while (gcmp1(gcdii(subii(y, x), n)))
  {
    x = modii(addis(sqri(x), 1), n);
    y = modii(addis(sqri(y), 1), n);
    y = modii(addis(sqri(y), 1), n);
  }
  return gcdii(n, subii(y, x));
}

Now, the code now uses the more specific functions sqri, addis, modii and gcdii.

The most efficient way to use typing is to declare some variables of type small. This way, these variables will be implemented by C long variables, which are faster than PARI integers and do not require garbage collecting. However, you will not be protected from integer overflow. For that reason, gp2c will automatically declare some loop indices of type small when the range cannot cause overflow. Sometimes gp2c can be too conservative but you can force a loop index to be small with the syntax for(i:small=a,b,...).

3.6  Types and member functions

For use with members functions, gp2c provides the following types:

nf
for ordinary number fields, i.e., a result given by the GP function nfinit.
bnf
for big number fields, i.e., a result given by the GP function bnfinit which includes class and unit group data.
bnr
for ray class groups, i.e., a result given by the GP function bnrinit.
ell
for elliptic curves, i.e., a result given by the GP function ellinit.
gal
for galois extensions, i.e., a result given by the GP function galoisinit.
prid
for prime ideals, i.e., a component of the result given by the GP function idealprimedec.

Members functions on typed objects are much more efficient.

4  Common problems

4.1  Meta-commands.

Meta-commands (commands starting with a \) other than \r are currently ignored by gp2c, though a warning will be issued, because it is not clear what they should do in a compiled program. Instead you probably want to run the meta-command in the GP session itself.

The meta-command \rinclude is replaced with the content of the file include (or include.gp) when gp2c reads the file. If you would prefer gp2c to link include.so to the program instead, see Section 2.4.

4.2  Unsupported functions.

The functions forell and forsubgroup are currently not implemented as an iterator but as a procedure with callbacks, which limits what you can do inside the loop.

Some functions are passed to GP by gp2c-run at start-up (using the GP; syntax) instead of being translated in C: install and addhelp. In practice, they can be considered as supported.

Some functions are built-in in GP, and so are not available to libpari programs. So if you use them gp2c generate a program that needs to run under GP, or with gp2c-run. Since the C prototype for those functions are not available, the C compiler will output a warning. This serves as a reminder of the problem. They are all the plotting functions and allocatemem, default, extern, input, quit, read, system, whatnow.

Some GP functions are not available for C programs, so the compiler cannot handle them. If you use them you will get the infamous "unhandled letter in prototype" error. Sorry for the inconvenience. These are plot, ploth, plotrecth.

Also the functions read, eval, kill may compile fine but have a surprising behaviour in some case, because they may modify the state of the GP interpreter, not of the compiled program. Please see Section 4.3 for details. For example f(n)=eval("n^2") is very different from f(n)=n^2.

The forstep function is supported when the step is a number. If it is a vector, you must add a tag :vec to make GP know about it like in

f(x)=
{
  local(v);
  v=[2,4,6,6,6,6,6,2,4,6,6]
  forstep(y=7,x,v:vec,print(y))
}

This is not needed if the step is a vector or a variable of type vec, but is needed if the step is only an expression which evaluates to a vector.

There is little that can be done about these problems without changing PARI/GP itself.

4.3  Memory handling and global variables.

While a lot of work has been done to ensure that gp2c handles global variables properly, the use of global variables is still a lot of trouble, so try to avoid them if you do not understand the implications on memory handling.

First, there is a common practice to use undeclared variables as formal variables, for example we assume x=’x and write a*x+b instead of a*’x+b. So gp2c will not raise an undeclared variable to the rank of global variable unless you declare it with the global() command, or you use it at toplevel (i.e. outside any function). See also Section 2.3

Second, global variables seen by a compiled function are C variables, not GP variables. There is no connection between the two. You may well have two variables with the same name and a different content. Currently GP knows only how to install functions, not variables, so you need to write compiled functions in order to access global variables under GP.

Basically, global variables are allocated in the main stack which is destroyed each time GP prints a new prompt. This means you must put all your commands on the same line. Also global variables must be initialized using the init_<filename> function before being used, and are only supported with the -g flag.

So you end up doing gp2c-run -g global.gp

parisize = 4000000, primelimit = 500000
? init_global();myfunction(args);

Note that nothing prevents you from calling init_global in the GP program. In that case, you can omit the parentheses (i.e, write init_global, not init_global()) so that you can still run your noncompiled program.

Another way to handle global variables is to use the clone function which copies a PARI object to the heap, hence avoids its destruction when GP prints a new prompt. You can use unclone to free a clone. Please read the PARI/GP manual for more information about clone.

A good use of clone is for initializing constant variables: for example in test/gp/initfunc.gp, the vector T is initialized by

T=clone([4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0])

You must still run the init_<filename> after starting GP, but after that you can use T safely.

GP itself currently does not know about clone and unclone, but you can use dummy functions

clone(x)=x
unclone(x)=while(0,)

when running uncompiled.

4.4  GP lists

GP lists are not fully supported by gp2c. A partial support is available with the list type. You must tell gp2c that a variable will contain a list by using L:list inside a declaration, where L is the name of the variable as explained in Section 3.

Currently, assigning to a list element (L[2]=x) will not work and lists will not be freed unless you explicitly use listkill.

Note: The PARI user’s manual states that lists are useless in library mode.

4.5  The install command

The install command is interpreted as a gp2c directive. This allows using installed function in compiled programs, see Section 2.4.

However this has some side-effects:

  • If present, the lib argument must be a string, not an expression that evaluate to a string.
  • The install command is not compiled, instead it is added to the list of functions to install.

5  Command-line options of gp2c

Here is a brief description of the main options of gp2c, which can be seen with ./gp2c -h.

In Section 2.1 we saw how to use the -g option.

  • -g tells gp2c to generate gerepile calls to clean up the PARI stack and reduce memory usage. You will probably need this option, although the C code will be easier to read or hand-edit without it.
  • -ofile tells gp2c to write the generated C file to the file file instead of the standard output.
  • -iN allows you to change the indentation of the generated C file. So if you want 4 spaces, just use the -i4 option with gp2c. The default is 2.
  • -W is useful for debugging the .gp file, in the sense that it detects if some local variable is undeclared. For example, if the file algorithm.gp has a routine like
    radical(x)=F=factor(x)[,1];prod(i=1,length(F),F[i])
    

    The variable ’F’ is undeclared in this routine, so when running gp2c with the -W option it prints

  • -C adds code to perform range checking for GP constructs like x[a] and x[a,b]. This also checks whether x has the correct type. By default gp2c does not perform such check, which can lead to a runtime crash with invalid code. This option causes a small runtime penalty and a large C code readability penalty.

    Warning:algorithm.gp:1:variable undeclared F

    At present, an undeclared variable is taken to be a "formal variable" for polynomials by gp2c, so do not declare it if that is what you intend. For example in pol(a,b,c)=a*x^2+b*x+c you must not declare x since it stands for the formal variable ’x.

  • -pprefix A problem with C is that it is subject to name clashes, i.e., if a GP variable in your routine has the same name as a C symbol in the pari library, the compiler will report strange errors. So this option changes ALL user variables and user routine names by adding a prefix prefix to them. For example the GP routine add(x,y) with -pmy_ will become the C function my_add(x,y).

    Try this option each time the compiler fails to compile gp2c output to see if there is a name conflict. If this is the case, change the name in your GP script. It may be difficult to find conflicting names if your compiler is not verbose enough and if you are not familiar with the PARI code and C in general.

    Example of conflicting names are top,bot,prec,un, but there are thousands of others and they may be system-dependent.

  • -ssuffix: Add suffix to the names of the installed functions under GP. This is to avoid clashes with the original GP script. For example, if you want to compare timings you may want to use the option -s_c This does not affect the C code, only the install commands.
  • -S: Assume strict prototypes for functions. This means that you have declared all the local variables with local and not as parameters. Also, when a parameter is not mandatory, a default value must be assigned to it in the declaration, like for ’flag’ in
    test(data,flag=0)={CODE}
    
    This does not affect the C code, only the install commands.
  • -h gives the help.
  • -v gives the gp2c version.
  • -l prints a list of all the GP functions known by the compiler. So if a routine contains a GP routine not on this list, gp2c will show an error when trying to translate it. For example the routine forvec is not yet implemented, so you should not use it.

    Reasons why a GP function may not be known by the compiler are:

    • The function is not part of the PARI library. See Section 4.2
    • You use the old PARI 1.39 function names instead of the new ones. gp2c currently does not know about the ’compat’ default. Use whatnow under GP to get the current name. For example, mod() is now Mod().
    • You use a GP function that does not exists in the GP version gp2c was compiled against. Please recompile gp2c against this GP version.

      Normally no functions are added between two stable releases of GP with the same minor version number (say 2.1.1 and 2.1.2) so there is no need to recompile gp2c when you upgrade. But if you use the developement versions, you need to recompile. Also some new developement versions may break old versions of gp2c, so upgrade gp2c at the same time.

      However, if you want to compile scripts which do not use the new functions, you do not need to recompile. Note that you may use the GP environment variables to tell gp2c-run which GP to use.

    • -t Output the table of types known to the compiler, see Section 3.

This document was translated from LATEX by HEVEA.
gp2c-0.0.8/doc/gp2c001.png0000644000175000017500000000231111721004127011612 00000000000000‰PNG  IHDRŠÎ`‡-PLTE˙˙˙UUU999ŞŞŞrrröĹ)ötRNS@ćŘfbIDAThíšÍnă …ˇĄ^s%ËëY´űÎhfM•u5óXŞúţŹ0üŘŰŘ\ŔmŁ$¤Ťlă|:ľĆ—c€o*í G í Š˘-F6˘©ĄôĐ5¤Ž-Q„ÔR¸ /­ĄtÜDWЬe‚Č*Bh5…™‹ŕUúkÜŞ,ý©ż^+)˘c[Eą3AJ1ĹÖÜ ŠřśPF ÷˘Š2ä’ßă~e€x)E”ÂĽ” SăÁKɧ°ńľR˛)BÁŃLĘËŁÇ=S¤đ›ˇ”m«ŽÂ>´ąĐNÔPhĎ€‚ '»ŃI`OIE$Ś[-@x˸u„Ba\ŞJ{!EšĆZR]$=(uŞlěGĄŻ7¤Pid”QŔ_‘îŽZ}Q„Î)Iß»č:/ŞČ,şĽk;Ńc˘›,_u ëŧěXÔz•éčz5Žâ:ś_§¸ľ 'f•2şUÔ‹Í*eüőH+˘ś~ŚłFyň[/1+”»7żÉă§ (OÁ6BLśr˙ě„®3‹ňg˛8ŕĘÉĂ#ĹD)ó_˝¤ÄÄ(3)ŰŁ,ŰYŞ;‰P"mž%í%Öäb–”h.HYRâçoç™eíôşQ‡[ąŔB•ý^­ďP×Ě×)9–vÝŠG)ŢăŞń€˘ďŔ»™“c=AMýע=®ńďţŃŰĺ Ë;ĄBšăqŠö¸D Qţ€Ů^R´[…ŽĐn…˘=®KĘ<ĽÖó˛vM‹ö¸ú xšBŐvž®Ü#í‰dďµőöł®ľî–´ÝUç?ś“ó§ MřŐQr˙•Pr{Ł|=%;oź%Zvˇd÷J(ßz‹ŽS[ZH™§Ň°”S¤v©f8Ö™ŇR ×ĆŐ Ç63 >,Tk†@YWLáÄŻšką7oă…7´Śb&儎…ގ-E÷°U‰Ą<kЦ4A¸żY‰·­ 07C#$bfgĚ®ýęlf‹lR5s_ҬÍʦnĺĆ ”&ŞŇ:«µCn좆Báśd^Ń„Âú×^ÔjÖdůčŇ>Ů^bÍeą&+Ővc”嚬ÔsmşË5Y‰g™/ůŰĄm÷XĘv€î¤·Äŕ˝Ë– ´!&˛!&ÇŤY1nLŐć7sLŞ[Tt˘ś6ł¬îaŠ={ö3i¦a¦Ä/*óNí–„9pJÁ{DäŠ (ŕŁë§ÚoŻŔűRÔţ”âŕŢ(_E)ot—M)Ď M©ČQgJ©čöˇĺÖ}"ĺnQ?řÝ:ŠYŚSO!ŽR\·¨€3łŔłśbÎZgŘVh1‹ śKUÓ2ŻŘ…łŐ»pÖb#*ř˘ŻKaô»źQţĎl–î?~`ĎIEND®B`‚gp2c-0.0.8/doc/type.dvi0000644000175000017500000007255012156115342011536 00000000000000÷’Ŕ;č TeX output 2013.06.12:1759‹˙˙˙˙ ŞŤ ýs oŤ ýŢŤ‘[7÷ó߆µTG® cmtt12şgp2c–7tóDÓítG®G®cmr17ątŚqypsŽes“and“the“description“systemŽźŤŤŤŤŤ’łRóX«Q cmr12»By–ę¨Bill“Allom¬rbSŽertŽŽŽŽŽźfjŤ’ľ+yJune–ę¨12,“2013Žź+ÄŤ‘5óÂÖN ff cmbx12ĹCon•ŚĚten“tsŽ©ŤŤ‘5óň"V cmbx10Ć1Ž‘Dóßę cmmi10µA;‘ިB‘€q˛)“where‘?áµA“˛is“a“mathematicalގŤ‘5ob‘Ž8ject–Z-and“µB‘Úž˛its“computer“represen•¸ătation.‘€PTw“o›Z-di eren“tt“ypGescancon“taintheގŤ‘5same–Ĺímathematical›Ĺěob‘Ž8ject,‘â›with“adi erenš¸ăt“computer“representation.‘AůF‘˙*Şor“exam-ގŤ‘5ple–v]the›v\t¸ăypGe“Ęb–˙}'o“ol‘~ć˛is–v]theset“ó !",š cmsy10¸f˛(true,1L),“(false,0L)¸g˛,‘~žĘi.e.“˛true“and“falsewith“trueގŤ‘5coGded–"ćbš¸ăy“the“C-long“integer‘"ĺ1“and“false“coGded“by“the“C-long“integer‘"ĺ0;‘3¶the“typGeގŤ‘5Ęne–˙}'gb“o“ol‘Ur˛is›Lęthe–Léset“¸f˛(true,0L),(false,1L)¸g“˛whic¸ăh“isthe“same“setof“mathematicalގŤ‘5ob‘Ž8jects,‘…but–{Źno¸ăw›{true“is“coGdedb¸ăy“the“C-longin¸ăteger“0and“false“b¸ăythe“C-longގŤ‘5in¸ăteger‘UU1.ގŤ‘DF‘˙*Şor‘Bżeac•¸ăh›BľGP2C‘Bşt“ypGe,‘Fwthereexists–Bża“C‘Bątš¸ăypGe“µC‘·t“˛such›Bľthat“for“allpairs“(µA;‘ިB‘€q˛)ގŤ‘5bšGelonging–Îqto‘Îpthe“t•¸ăype,‘ě·the‘ÎpC‘ÎRt“ype‘Îpof–ÎqµB‘Ná˛is“µC‘·t˛.‘ÝThis“C‘ÎQt¸ăype‘Îpis“speci ed‘Îpb¸ăy“theގŤ‘5descriptionŤ‘îí‰ffŽ‘îďó m#˝R cmss10Ët¸ăypGedef˛.ގŤ‘DThe–GP2C‘ tš¸ăypGes“are–preordered.‘Z Abstractly‘˙*Ş,‘[we“say›that“µtŤź˙óŮ“ Rcmr7±1Ž‘C‹¸‘ǵtŤź˙±2Ž‘ŠŹ˛if“andonlyގŤ‘5if–U¬there›U­is“a“mapµf‘i;˛suc¸ăh“that(µA;–ިB›€q˛)‘Ç©¸7!‘ÇŞ˛(µA;“f‘ʞ(µB˛))–U¬de nes“a‘U­one-to-one“mappingގŤ‘5from›®µtŤź˙±1Ž‘*t˛to–®µtŤź˙±2Ž‘|s˛.‘{ËPractically“w¸ăerestricttherelation“¸˛tomak¸ăeit“apartialorderގŤ‘5sucš¸ăh–Aithat“any‘Ajtwo“typGes“have“an“upp•Ger›Ajb“ound.‘6This–Aipartialorder“is“de nedގŤ‘5bš¸ăy–0$the“chains“in“the“descriptionŤ‘ÉĽ‰ffŽ‘ÉľËtypGeŤ‘™‰ffŽ‘™špreorder˛.‘4It“can“bGe“printed“by“runningގŤ‘5Çgp2c‘?ý-t˛.Ž ÓnŤ ˙:Ęă ™CVŤŤŤŤŤŤ’ëQ ˙qĽŞgenŽŽŤŤ’ň_ ź‚Îü„9ďfeŽŽŤŤ’ë ‰źŽ0mpŽŽŤŤ’ŰĎ:ź‚ÎüóäOŁ line10¬ŽŤ’ŕ ) ˙~–«ŽŽŤŤ’ŇźŽ0˛v¸ăecŽŽŤŤ’Çä…ź‚Îü¬ŽŤ’Ńä… ˙}ÎüŽŤ’Űä… ˙xÎüŽŤ’ŕ ) ˙v˝ŽŽŤŤ’ÁJźŽ0˛pGolŽŽŤŤ’DZSźźBÚ„9ďfeŽŽŤŤ’ÁĽźŞ¤fv‘˙qÇarŽŽŤŤ’ůp‘źŞ¤frealŽŽŤŤ’ů¤¤źźBÚ¬@ŽŤ’őjµź› ‰@ŽŽŤŤ’ŮdŃźŞ¤f˛in¸ătŽŽŤŤ’ဟźBÚ¬ŽŤ’ĺąďź› ‰ŽŽŤŤ’×…źÇD˛smallŽŽŤŤ’áLÎź»¶¸„9ďfeŽŽŤŤ’ŮzhźăŚ"b•Go“olŽŽŤŤ’ĘĽčźĎˇm¬ŽŤ’ĚtźÎ@&ŽŽŤŤ’§LšźŐR3˛negb•Go“olŽŽŤŤ’Ětźŕłż¬@ŽŤ’ĘĽčźßRx@ŽŽŤŤ’áLÎźŘ*–„9ďfeŽŽŤŤ’ŮÁ…˛v¸ăoidŽŽŤŤ’ďąďźý'ť¬ŽŤ’ň9ďźó'ťŽŤ’ôąďźé'ťŽŤ’÷9ďźß'ťŽŤ’ůąďźŐ'ťŽŤ’ü9ďźË'ťŽŤ’ţąďźÁ'ťŽŤ’$¤ź·~¨ŽŽŤŤ’áLÎźôžt„9ďfeŽŽŽŽŽŽź ŤŤ’“‡˛Figure–UU1:‘qÇExample“of“t¸ăypGe“preorderŽŽŽźÇŤ‘DThe–ťąprošGcess“of“con•¸ăv“erting–ťąa“mathematical‘ť¸ob‘Ž8ject“from“one“t¸ăype“to“anotherގŤ‘5is–µ…called“casting.‘’VThe“casting“methoGds“knoš¸ăwn“to“GP2C‘µlare‘µ„given“by“theŤ‘O‰ffŽ‘OËcastގŤ‘5˛description.Žźţ6ŤŤ‘5É1.2Ž‘SŔList–€of“t yp`esŽ©uTŤ‘5˛In–Gthis“section,‘«±wš¸ăe“list“the“typGes“known“to“P–˙*ŞARI/GP“.–GThe“current“list“is“av‘˙qÇailableގŤ‘5in–UUthe“descriptionŤ‘îí‰ffŽ‘îďËt¸ăypGedef˛.Žźţ6ŤŤ‘5Ć1.2.1Ž‘X#‚Basic‘ŐTt®9ypQÇesަŤŤŤ‘5smallŽŽ‘T3˛Small–UUinš¸ătegers“represented“by“C“Ëlong‘xâ˛integers.ŽŽźŤ’ß2ŽŽŚ‹€ ŞŤ ýs oŤ ý´ŤŤŤ‘5Ćin®9tŽŽ‘GĽm˛Multi-precision–UUinš¸ătegers“represented“by‘xâÇtŤ‘ˇE‰ff&fŽ‘Ç«INT“˛GENs.ޤŤŤŤ‘5ĆrealŽŽ‘Lʤ˛Multi-precision–UU oating“pGoinš¸ăt“real“numbGers“represented“by‘xâÇtŤ‘ˇE‰ff&fŽ‘Ç«REAL“˛GENs.ގŤŤŤ‘5ĆmpŽŽ‘Iř޲Multi-precision›UUn•¸ăum“bGers.‘qÇUnionofthet“ypGesĘint‘H-˛andĘr–˙}'e“al˛.ގŤŤŤ‘5Ćv®9ecsmallŽŽ‘d:ő˛V‘˙*Şectors–UUof“small“inš¸ătegers“represented“by‘xâÇtŤ‘ˇE‰ff&fŽ‘Ç«VECSMALL“˛GENs.ގŤŤŤ‘5Ćv®9ecŽŽ‘J!²V›˙*Şectors–Wćand“matrices“of“PARI‘WĄob‘Ž8jects,‘Š—represen•¸ăted‘Wĺb“y‘{sÇtŤ‘ˇE‰ff&fŽ–Ç«VEC˛,›WćÇtŤ‘ˇE‰ff&fŽ“COL‘W¦˛orÇtŤ‘ˇE‰ff&fŽ“MATŽ© Ť‘N˛GENs.ގŤŤŤ‘5Ćv‘˙\rarŽŽ‘IÁÁ˛P•¸ăolynomial›uŰv‘˙qÇariables‘uÚrepresen“tedb“y‘uÚtheirv‘˙qÇariablen“um“bGer‘uÚwhic“his‘uÚaCަŤ‘NËlong‘xâ˛inš¸ăteger.‘qÇThis–UUis“assoGciated“to“the“prototypšGe“code“'n'.ގŤŤŤ‘5ĆpQÇolŽŽ‘I§˛P•¸ăolynomials›UUrepresen“tedb“y‘xâÇtŤ‘ˇE‰ff&fŽ‘Ç«POL˛GENs.ގŤŤŤ‘5ĆgenstrŽŽ‘Y'm˛Strings–UUrepresenš¸ăted“by‘xâÇtŤ‘ˇE‰ff&fŽ‘Ç«STR“˛GENs.ގŤŤŤ‘5ĆlistŽŽ‘IeŞ˛GP–UUlists“represenš¸ăted“by‘xâÇtŤ‘ˇE‰ff&fŽ‘Ç«LIST“˛GENs.ގŤŤŤ‘5ĆgenŽŽ‘Kh޲Generic–UUP‘˙*ŞARI“ob‘Ž8jects“represenš¸ăted“by“GENs.Žźţ6ŤŤ‘5Ć1.2.2Ž‘X#‚Sp•QÇecial‘ŐTt®9yp“esŽźuTŤŤŤ‘5v®9oidŽŽ‘ON˛This–áTt¸ăypGe›áUis“a“set“withonly“one“elemen¸ăt“calledĘvoid˛.‘ÄThisis“the“returnަŤ‘Ntš¸ăypGe–UUof“functions“not“returning“anything.‘qÇGP“allows“to“cast“it“to“0.ގŤŤŤ‘5Ćb•QÇo“olŽŽ‘O¸Ü˛BoGolean–av‘˙qÇalues“represenš¸ăted‘bas“C‘.Ëlong‘>î˛integers,‘Läwhere“1“is“true‘band“0“isަŤ‘Nfalse.ގŤŤŤ‘5Ćnegb•QÇo“olŽŽ‘a!ş˛Negated›©¨b•Go“oleanv‘˙qÇaluesrepresen•¸ăted‘©§asC‘©}Ëlong‘Í5˛in“tegers,‘Ëýwhere0istrueަŤ‘Nand–UU1“is“false.ގŤŤŤ‘5ĆlgŽŽ‘BńIJV‘˙*Şector–”…lengths‘”„represenš¸ăted“by“the“Ëlg›¸˛macro“output,‘»i.e.‘1‚a“C‘”TËlong˛in¸ăteger“equalަŤ‘Nto–UUthe“actual“length“plus“one.ގŤŤŤ‘5ĆstrŽŽ‘GľŹ˛C–UUstrings“represenš¸ăted“by“C“Ëconst“char“*“˛strings.ގŤŤŤ‘5Ćt®9ypŽŽ‘Jśl˛GEN‘ď˛t•¸ăypGes›ďĚrepresen“tedb“y‘ďÍC‘ď˛Ëlong‘Y˛in“tegers,‘asreturnedb“ytheËt“yp()˛macro.Žźţ6ŤŤ‘5Ć1.2.3Ž‘X#‚In•®9ternal‘ŐTt“ypQÇesŽźuTŤ‘5˛The–UUfolloš¸ăwing“typGes“are“mainly“for“internal“use“inside“GP2C.ގŤŤŤ‘5Ćempt®9yŽŽ‘Yw˛This– Ütš¸ăypGe“is“the“empty“set.‘›[No“individual“ob‘Ž8ject“can“bGe“of“this“typGeަŤ‘Nbut–µa›µset“of“ob‘Ž8jects“can.‘‘ Infact“this“isa“default“t¸ăypGe“foran“unspGeci edަŤ‘Nset–UUof“ob‘Ž8jects.ގŤŤŤ‘5ĆsmallŤ‘°ˇ‰ffs4Ž‘#Őin®9tŽŽ‘eůu˛Small›Ěfin•¸ătegers‘Ěerepresen“tedb“y‘ĚeC‘ĚGËint˛in“tegers.‘ÖřThisis‘Ěeonlya“v‘˙qÇailableަŤ‘Nfor–UUcompatibilit¸ăy“with“P‘˙*ŞARI“function“returning‘xâËint“˛(instead“of‘rËlong#Ť˛).ގŤŤŤ‘5ĆbptrŽŽ‘Oük˛Byte–UUpGoinš¸ăter.‘qÇThis“is“used“for“the“ËprimepGointer‘xâ˛global“v‘˙qÇariable.ގŤŤŤ‘5ĆfuncŤ‘°ˇ‰ffs4Ž‘#ŐGGŽŽ‘e 8˛function–UUwith“protš¸ăypGe“ËGEN“f(GEN,GEN)˛.“Used“by“Ęforve‘˙}'c˛.ގŤŤŤ‘5ĆpariŤ‘°ˇ‰ffs4Ž‘#ŐspŽŽ‘\ůy˛This–UUis“the“stacš¸ăk“pGointer“typGe“ËpariŤ‘™‰ffŽ‘™šsp˛.ŽŽźŤ’ß3ŽŽŚ‹+î ŞŤ ýs oŤ ý´ŤŤ‘5Ć1.2.4Ž‘X#‚T®9ypQÇes–ŐTfor“data“structure.ŽźuTŤ‘5˛These–UUtš¸ăypGes“are“mainly“de ned“to“allow“the“use“of“inline“membGer“functions.ŽźĎŤŤŤ‘5ĆnfŽŽ‘Cç˛Numš¸ăbGer–UU eld“as“returned“by“Ęn nit˛.ޤźŤŤŤ‘5ĆbnfŽŽ‘JJĄ˛Big›UUn•¸ăum“bGer eldasreturnedb“yĘbn nit˛.Ž© ŤŤŤ‘5ĆbnrŽŽ‘K‰˛Raš¸ăy–UUclass“ eld“as“returned“by“Ębnrinit˛.ގŤŤŤ‘5ĆellŽŽ‘E¨ŕ˛Elliptic–UUcurvš¸ăe“as“returned“by“Ęel‘‚Řlinit˛.ގŤŤŤ‘5ĆbQÇellŽŽ‘L^3˛Big–UUelliptic“curvš¸ăe“as“returned“by“Ęel‘‚Řlinit˛.ގŤŤŤ‘5ĆclgpŽŽ‘NqŔ˛Class–UUgroup“as“returned“bš¸ăy“the“'clgp'“membGer“function.ަŤŤŤ‘5ĆpridŽŽ‘NµO˛Prime–UUideal“as“returned“b¸ăy“Ęide–˙}'alprime“de“c˛.ގŤŤŤ‘5ĆgalŽŽ‘HݲGalois–UUgroup“as“returned“b¸ăy“Ęgaloisinit˛.Žźť›ŤŤ‘5É1.3Ž‘SŔC-T yp`eŽ©uTŤ‘5˛A‘/0ĘC-T‘˙;Ľyp‘˙}'e‘ď–˛is–/:just“a“levš¸ăel“of“indirection“toward‘/;real“C‘/0typ•Ges.‘eC-typ“es–/:are“de nedޤ Ť‘5b¸ăy–«úthe“descriptionsŤ‘E’‰ffŽ–E”ËdeclŤ‘™‰ffŽ›™šbase‘«ű˛andŤ‘E’‰ffŽ“ËdeclŤ‘™‰ffŽext˛.‘u¶Eac•¸ăh›«út“yp•Geb“elongs‘«űtoaC-t¸ăyp“easގŤ‘5spGeci ed–UUbš¸ăy“the“descriptionŤ‘îí‰ffŽ‘îďËtypGedef˛.Žź ±*ŤŤ‘5Ĺ2Ž‘MLËThe–ffdescription“systemŽźçŤŤ‘5É2.1Ž‘SŔIn tro`ductionަŤ‘5˛The–ëOdescription›ëNsystem“is“a“w•¸ăa“yto–ëOdescribGe“theP‘˙*ŞARI‘ë4application“programmingގŤ‘5inš¸ăterface–‰-in“a‘‰,way“understandable“by“bGoth›‰,the“GP2C‘‰ compilerand“h¸ăuman“bGe-ގŤ‘5ings.‘V»The›öűpresen•¸ăt‘öüdoGcumen“tis–öümostlyaddressed“tothis“secondcategory–˙*Ş.‘V»W“eގŤ‘5start–UUb¸ăy“a“simple“example:ގŤ‘DThe–UUdescription“of“the“GP“function“Ęsqr‘hâ˛isŽ©?>Ť‘:?ýÇ(int):int‘îsqri($1)ގŤ‘:?ý(mp):mp‘)˙čgsqr($1)ގŤ‘:?ý(gen):gen‘îgsqr($1)Žź??Ť‘D˛Eac¸ăh–nline›nis“called“aĘrule˛,‘´-whic¸ăh“in“thiscase“consists“ofthree“parts.‘»ĎLetގŤ‘5us–f„consider›fthe“ rst“one:‘”$the“partsÇ(int)˛,‘jĎÇ:int“˛and“Çsqri($1)˛are“respGectiv¸ăelyގŤ‘5called–UUthe“Ęp›˙}'attern˛,“Ętype˛,“and“Ęaction‘¸˛part.ގŤ‘DWhen–ť×GP2C‘ť¨compiles›ťÖĘsqr(1)˛,‘Šit“computesthe“t¸ăypGes“ofthe“argumen¸ăts(here“Ę1ގŤ‘5˛is–ŐÂof›ŐĂt¸ăypGe“Ęsmal‘‚Řl‘‰˛)and“matc¸ăhesthem“againstthe“patternsfrom“topto“bGottom.ގŤ‘5The–q\bGest"›qrule“isused;‘~Ţincase“of“atie,‘wňthetopmost“rulewins.‘ÄŮHere,‘wńall“threeގŤ‘5rules–Şapply‘˙*Ş,‘ Ěand›©the“ rst“rulewins.‘[äSincethe“t¸ăypGeof“this“ruleis“Ęint˛,‘ ĚGP2C‘™setsގŤ‘5the–%•t¸ăypGe›%”of“theexpression“Ęsqr(1)‘„'˛to“Ęint˛.‘aÜTheaction“partis“Çsqri($1)˛,‘/!so“GP2CގŤ‘5generates–6Wthe›6XC‘6OcoGde“Ësqri($1)˛where“Ë$1“˛is“replacedb¸ăy“the“coGde“ofthe“argumen¸ătގŤ‘5Ę1‘°[˛cast–UUto“the“pattern“t¸ăypšGe“(Ęint‘ňز).‘qÇThe“result“is“the“C“code“Ësqri(genŤ‘™‰ffŽ‘™š1)˛.ގŤ‘DNo¸ăw–UUa“more“complex“example:‘qÇthe“description“of“the“GP“function“Ęexp‘öí˛isަŤ‘:?ýÇ(real):real‘˙ômpexp($1)ގŤ‘:?ý(mp):mp:prec‘ż÷gexp($1,‘?ýprec)ގŤ‘:?ý(gen):gen:prec–?ýgexp($1,“prec)ŽŽźŤ’߲4ŽŽŚ‹8^ ŞŤ ýs oŤ ý´Ť‘5˛When–ÄŢGP2C‘Äącompiles“Ęexp(1)˛,‘áĂit“lošGoks“for“the“"best"“rules.‘AźThe“ rst“rule“cannotޤ Ť‘5b•Ge›Aťused,‘EŹb“ecausethereisnow•¸ăa“ytocastaĘsmal‘‚Řl‘J&˛toaĘr–˙}'e“al˛,‘EŹsoitusesthesecondގŤ‘5rule.‘#ŮThis–ćtime“the“result“will‘ćbšGe“of“t¸ăype“Ęmp˛.‘#ŮThe“extra“part‘ćÇ:prec“˛is“calledގŤ‘5a–xomošGde.‘ŰThe“mode›xp`prec'“states“that“theaction“part“will“usethe“spGecial“`prec'ގŤ‘5v‘˙qÇariable–Âthat“holds“the“currenš¸ăt“real“precision.‘·×This“is“obvious“from“the“actionގŤ‘5part–jŽcošGde,‘oÜbut“GP2C‘j‰do“not“parse“the“action“part“so‘jŹit“needs“this“mode.‘±rNoteގŤ‘5that–•the“last“rule›”is“also“v‘˙qÇalid“and“has“the“same“actionpart“so“w¸ăould“generateގŤ‘5the–3exact›4same“coGde.‘WgHo•¸ăw“ev“er,‘thet“ypGe–3ofthe“expressionw¸ăould“bGeless“precise.ގŤ‘DThe–UUdescription“of“the“GP“function“Ęmatdet‘H-˛isŽ©ó%Ť‘:?ýÇ(gen,‘?ý?0):gen‘îdet($1)ގŤ‘:?ý(gen,‘?ý1):gen‘$żëdet2($1)ގŤ‘:?ý(gen,–?ý#small):gen‘ ú$"incorrect“flag“in“matdet"ގŤ‘:?ý(gen,–?ýsmall):gen‘ż÷det0($1,“$2)Žźó&Ť‘5˛W‘˙*Şe–UUsee“sev¸ăeral“new“pattern“atoms:ަŤŤŤŤ‘D¸ŽŽŽ‘NĘ1‘°[˛matcš¸ăhes–UUa“literal“1,“e.g.‘qÇĘmatdet(M,1)‘łč˛would“match“the“second“rule.Ž©y“ŤŤŤŤ‘D¸ŽŽŽ‘NĘ?0‘´z˛matc¸ăhes–Ytan›Ysoptional“literal“0:‘ó×Ęmatdet(M)˛,Ęmatdet(M,0)‘¸˛and“Ęmatdet(M,)ގŤ‘N˛all–UUmatc¸ăh“the“ rst“rule.ަŤŤŤŤ‘D¸ŽŽŽ‘NĘ#smal›‚Řl‘]޲matc¸ăhes–UUan“unspGeci ed“literal“Ęsmall˛.Ž©ó%Ť‘5Finally‘˙*Ş,›«ďw¸ăe–gjalso“see“a“new“action“ó!p®0J cmsl10Ě$Ę".–.“.“"˛,whicš¸ăh–gjcauses“GP2C‘g#to“display“theގŤ‘5error–UUmessage“and“abGort.ŽźÄVŤŤ‘5É2.2Ž‘SŔDe nitionsޤuTŤ‘5˛W‘˙*Şe–UUnoš¸ăw“give“a“formal“de nition“of“descriptions.ŽźÄVŤŤ‘5Ć2.2.1Ž‘X#‚DescriptionގŤ‘5˛A–UUdescription“is“a“line-separated“list“of“Ęrules˛.ŽźÄUŤŤ‘5Ć2.2.2Ž‘X#‚RuleގŤ‘5˛A–UUrule“is“a“line“of“the“formŽźó&Ť‘N(Ęp–˙}'attern‘Äc˛)Ę:typ“e‘Ŕ[:mo“delist‘H-actionަŤ‘5˛Only–ČBthe›ČApattern“part“ismandatory‘˙*Ş,‘äýthough“mostrules“also“includean“actionŽź Ť‘5and–UUa“t¸ăypGe.Ž©ÄVŤŤ‘5Ć2.2.3Ž‘X#‚P®9atternގŤ‘5˛A–UUpattern“is“a“comma-separated“list“of“Ęp‘˙}'attern‘“çatoms˛.ŽźÄUŤŤ‘5Ć2.2.4Ž‘X#‚T®9ypQÇeގŤ‘5˛The–UUtš¸ăypGe“of“a“rule“is“a“standard“GP2C“typGe.ަŤŤ‘5Ć2.2.5Ž‘X#‚MoQÇdelistގŤ‘5˛A–UUmoGdelist“is“a“colon-separated“list“of“Ęmo‘˙}'des˛.ŽŽźŤ’ß5ŽŽŚ‹D{ ŞŤ ýs oŤ ý´ŤŤ‘5Ć2.2.6Ž‘X#‚ActionŽ©uTŤ‘5˛An–,Íaction›,Ěis“a“string(normally“a“pieceof“C‘,ÂcoGde)“that“caninclude“Ęr–˙}'eplac“ementޤ Ť‘5strings˛.‘Replacemenš¸ăt–‹“strings“start“by“a‘‹’$“and“are“substituted“according“to“theގŤ‘5replacemen¸ăt‘UUrules.ŽźËŠŤŤ‘5É2.3Ž‘SŔP attern‘€atomަŤ‘5˛A‘ Úpattern› atom– is“oneof“thefolloš¸ăwing,‘75where“Ętyp‘˙}'e‘Ęc˛is“any‘ GP2C‘ ÚtypGe,‘75Ęn‘Îl˛anyގŤ‘5small›űin•¸ăteger,‘ !Ę"str"‘­H˛an“yc“haracterstringand‘űĘctyp‘˙}'e‘»o˛an“yC-t“ypGe.‘S±A‘úýpatternatomގŤ‘5can–UUmatc¸ăh“an“ob‘Ž8ject.ŽźŮĂŤŤŤŤ‘D¸ŽŽŽ‘NĘtyp‘˙}'e˛.‘qÇThis–UUmatcš¸ăhes“any“ob‘Ž8ject“of“typGe“comparable“to“Ętyp‘˙}'e˛.ޤŠNŤŤŤŤ‘D¸ŽŽŽ‘NĘn˛.‘qÇThis–UUmatcš¸ăhes“a“constant“small“integer“v‘˙qÇalue“equal“to“Ęn˛.ގŤŤŤŤ‘D¸ŽŽŽ‘NĘ?n˛.‘qÇThis–UUmatcš¸ăhes“an“optional“Ęsmal‘‚Řl‘]޲v‘˙qÇalue“which“defaults“to“Ęn˛.ގŤŤŤŤ‘D¸ŽŽŽ‘NĘ?typ›˙}'e˛.‘qÇThis–UUmatc¸ăhes“an“optional“Ętype‘°˛v›˙qÇalue“with“standard“default“value.ގŤŤŤŤ‘D¸ŽŽŽ‘NĘ"str"˛.‘qÇThis–UUmatcš¸ăhes“a“constant“character“string“equal“to“Ęstr˛.ގŤŤŤŤ‘D¸ŽŽŽ‘NĘ&typ‘˙}'e˛.‘ĂThis–ĹÇmatc¸ăhes›ĹĆa“reference(the“GP‘Ĺ©Ę&x‘ú ˛construction)to“anob‘Ž8jectŽ© Ť‘Nof–UUtš¸ăypGe“equal“or“less“than“Ętyp‘˙}'e‘°˛referencing“the“same“data“typGe.ގŤŤŤŤ‘D¸ŽŽŽ‘NĘnothing˛.‘qÇThis–UUmatcš¸ăhes“a“missing“argument.ގŤŤŤŤ‘D¸ŽŽŽ‘NĘ#typ‘˙}'e˛.‘qÇThis–UUmatcš¸ăhes“a“constant“v‘˙qÇalue“of“typGe“Ętyp‘˙}'e˛.ŽźŠMŤŤŤŤ‘D¸ŽŽŽ‘NĘ...‘f¸˛This–¦űmatcš¸ăhes“any“numbGer‘¦úof“arguments“matching“the‘¦úprevious“atom.ަŤ‘NThis–¤ m¸ăust›¤bGe“the“lastatom“ofthe“pattern.‘]đThis“allo¸ăwsto“implemen¸ătަŤ‘Nfunctions–UUtaking“an“unlimited“n•¸ăum“bGer–UUof“argumen¸ăts.ގŤŤŤŤ‘D¸ŽŽŽ‘NĘC!ctyp‘˙}'e˛.‘qÇThis–UUmatcš¸ăhes“any“ob‘Ž8ject“of“C-typGe“Ęctyp‘˙}'e˛.ގŤŤŤŤ‘D¸ŽŽŽ‘NĘ@typ‘˙}'e˛.‘h,This–§wmatc¸ăhes›§va“v‘˙qÇariableof“t¸ăypGe“Ętyp‘˙}'e˛.‘h,Thisis“mainlyused“forަŤ‘Nexpressions–UUthat“ev‘˙qÇaluate“their“argumenš¸ăts“several“times.ގŤŤŤŤ‘D¸ŽŽŽ‘NĘ*typ‘˙}'e˛.‘éThis–}>matcš¸ăhes‘}=an“lv‘˙qÇalue“of“typGe›}=Ętyp‘˙}'e˛.‘éThis“is“usedin“constructionsަŤ‘Nthat–UUmoGdify“their“argumen¸ăts.ŽźËŠŤŤ‘5É2.4Ž‘SŔMatc hingŽźuTŤ‘5˛The–UUbGest“rule“is“determined“as“follo¸ăws:ŽźśŤŤŤŤ‘A8ä1.ŽŽŽ‘NThe–I1result›I2of“matc¸ăhing“apattern“atom“againstsome“GP‘HňcoGdeis“eitherަŤ‘N'reject'–UUor“'matc¸ăh'.ގŤŤŤŤ‘A8ä2.ŽŽŽ‘NThere–UUare“three“matcš¸ăhing“levels:‘qÇ'partial',“'normal'“and“'pGerfect'.ގŤŤŤŤ‘A8ä3.ŽŽŽ‘NA–UUpattern“matcš¸ăhes“if“all“the“atoms“match.ގŤŤŤŤ‘A8ä4.ŽŽŽ‘NA–UUrule“matcš¸ăhes“if“its“pattern“matches.ގŤŤŤŤ‘A8ä5.ŽŽŽ‘NThe–:„bGest›:…rule“isthe“matc¸ăhing“rulewith“the“highern•¸ăum“bGer–:„ofnormal“andަŤ‘NpGerfect–ł¤matc¸ăhes.‘ڞIn“case›łŁof“atie,‘Ë7the“highestn•¸ăum“b•Ger‘ł¤ofp“erfect‘ł¤matc¸ăhesަŤ‘Nwins.‘qÇIf–UUthere“is“still“a“tie,“the“topmost“rule“wins.ŽŽźŤ’ß6ŽŽŚ‹N5 ŞŤ ýs oŤ ý´Ť‘D˛When–¬fmatc¸ăhing›¬gthe“patternatoms“Ętyp›˙}'e‘l²and“Ę?type˛,‘+the“matc•¸ăhing‘¬glev“el‘¬fisŽ© Ť‘5determined–UUas“follo¸ăws:ޤŤŤŤŤ‘D¸ŽŽŽ‘N˛a–UUpšGerfect“matc¸ăh“occurs“when“the“t¸ăype“of“the“ob‘Ž8ject“is“exactly“Ętyp‘˙}'e˛,ގŤŤŤŤ‘D¸ŽŽŽ‘N˛a–UUnormal“matcš¸ăh“when“the“typGe“is“less“than“Ętyp‘˙}'e˛,ގŤŤŤŤ‘D¸ŽŽŽ‘N˛a–UUpartial“matcš¸ăh“when“the“typGe“is“bigger“than“Ętyp‘˙}'e˛.ގŤŤŤŤ‘D¸ŽŽŽ‘N˛Rejection–UUhappšGens“when“the“t¸ăypes“are“uncomparable.ގŤ‘5Other–UUpattern“atoms“alw•¸ăa“ys–UUresult“in“a“reject“or“a“pGerfect“matc¸ăh.Žźţ6ŤŤ‘5É2.5Ž‘SŔMo`deŽźuTŤ‘5˛MoGdes–*÷are›*řused“indescriptions“togiv¸ăe“more“informationto“GP2C‘*ÁabGout“theަŤ‘5action–Çpart.‘ÇThey“are“usually“useless›Çto“h¸ăuman“bGeings“thatare“smart“enoughަŤ‘5to–UUunderstand“the“action“part.‘qÇThe“curren¸ăt“list“of“moGdes“is:ގŤŤŤ‘5ĆprecŽŽ‘OÁ˛The–UUaction“uses“the“Ëp¸ărec“˛v‘˙qÇariable.ގŤŤŤ‘5ĆparensŽŽ‘Zé2˛The–ö‹action“došGes“not“ha•¸ăv“e–ö‹top“precedence.‘UiGP2C‘öbwill“put“it“bet•¸ăw“eenަŤ‘Nparen¸ătheses–UUwhen“needed“(see“$())ގŤŤŤ‘5Ćcop®9yŽŽ‘P˙ř˛The–‡action›‡returns“data“thataccess“memory“bGelonging“toother“ob‘Ž8jects.ަŤ‘NGP2C–UUwill“generate“calls“to“Ëgcop¸ăy()“˛when“needed.Žźţ6ŤŤ‘5É2.6Ž‘SŔLists–€of“replacemen t“stringsŽźuTŤ‘5˛The–UUfollo¸ăwing“spšGecial“sequences“can“occur“in“the“action“part:ގŤŤŤŤ‘D¸ŽŽŽ‘NË$n˛.‘qÇThis–UUis“replaced“bš¸ăy“the“µn˛-th“argument“of“the“function.ގŤŤŤŤ‘D¸ŽŽŽ‘NË$(n)˛.‘ d{This–ű‘is“replaced“bš¸ăy“the“µn˛-th“argument“of“the“function“bGetweenަŤ‘Nparen¸ăthesis–UUif“it“has“the“parens“moGde.ގŤŤŤŤ‘D¸ŽŽŽ‘NË$tš¸ăypGe:n˛.‘9ŁThis‘¬ęis–¬éreplaced“by“the‘¬ęµn˛-th“argument“of“the“function‘¬ęcast“to“typGeަŤ‘NĘtyp‘˙}'e˛.ގŤŤŤŤ‘D¸ŽŽŽ‘NË$(t•¸ăypšGe:n)˛.‘qÇCom“bination–UUof“$(n)“and“$t¸ăype:n.ގŤŤŤŤ‘D¸ŽŽŽ‘NË$%n˛.‘%EThis–‘*is“replaced›‘)b¸ăy“the“µn˛-thargumen¸ăt“of“thefunction,‘ whicš¸ăh“mustަŤ‘NbGe–¨©a›¨¨constan¸ăt“string,‘˝~withall“%“c¸ăharacters“doubledand“no“quotes.‘kÂThisަŤ‘Nis–UUfor“use“inside“format“spGeci cation.ގŤŤŤŤ‘D¸ŽŽŽ‘NË$"message"˛.›÷Signals–,•an‘,–in¸ăv‘˙qÇalid“condition.GP2C‘,^will“abGort‘,–bš¸ăy“printingަŤ‘Nthe–UUerror“message“Ëmessage˛.ގŤŤŤŤ‘D¸ŽŽŽ‘NË$¸fËRPN–˘Msequence¸g›˘Ł˛The‘˘˘RPN“sequenceisaspaceseparated‘˘˘listofRPNަŤ‘Ncommands–Űcthat“will“bGe“ev‘˙qÇaluated‘Űdbš¸ăy“the“GP2C‘Ű@internal“RPN‘ŰAev‘˙qÇaluator.ަŤ‘NIf–vnthe“stacš¸ăk“is“empty‘voat“the“end“of“the“ev‘˙qÇaluation,‘~µthis“is“replaced“by“theަŤ‘Nemptš¸ăy–˛¤string,‘Éřelse“this“is“replaced“by“the“integer“at“the“top“of“the“stack.ަŤ‘NSome–iRPN‘[commands›hgenerate“text,‘•-in“thatcase“itis“pastedjust“bGeforeަŤ‘Nthe–UU$“sign.ŽŽźŤ’ß7ŽŽŚ‹ZB ŞŤ ýs oŤ ý´ŤŤ‘5É2.7Ž‘SŔLists–€of“RPN“commandsŽźuTŤ‘5˛The–N±commands›N°are“ev‘˙qÇaluatedwith“respGectto“a“stac¸ăkof“in¸ătegerv‘˙qÇalues,‘Pinitiallyޤ Ť‘5empt¸ăy‘˙*Ş.‘fUThe–¦Úexact“list›¦Ůof“command“suppGortedbš¸ăy“a“particular“GP2C‘¦Äversion“isގŤ‘5the–UUË%acceptedŤ‘™‰ffŽ‘™šcommand“˛hash“in“the“script“Çscripts/822Ť‘ˇE‰ff&fŽ‘Ç«desc.pl.in˛.ŽźBNŤŤŤ‘5ó"F C– cmbxti10Íliter–˙i>al‘$řinte“gerŽŽ‘~Ž ˛push–UUthe“inš¸ăteger“at“the“top“of“the“stack.ޤ€ěŤŤŤ‘5Ć:Ítyp‘˙i>eŽŽ‘R'òpush–UUthe“tš¸ăypGe“Ętyp‘˙}'e‘°˛at“the“top“of“the“stack.ގŤŤŤ‘5Ćadd,–ŐTsub,“m®9ul,“div,“moQÇdŽŽ’˛U„˛2-ary–UUarithmetic“opGeratorsގŤŤŤ‘5ĆnegŽŽ‘Kh޲1-ary–UUarithmetic“opGeratorގŤŤŤ‘5Ćand,–ŐTor,“xorŽŽ‘uw˛2-ary–UUlogical“opGeratorsގŤŤŤ‘5ĆnotŽŽ‘Jśl˛1-ary–UUlogical“opGeratorގŤŤŤ‘5Ćt®9ypQÇeŽŽ‘P3‡˛pGop–UUan“inš¸ăteger“µn“˛and“push“the“typGe“of“the“µn˛-th“argument.ގŤŤŤ‘5Ćv‘˙\ralueŽŽ‘Sßö˛pGop–an“in¸ăteger›‰µn“˛and“push“the“v‘˙qÇalue“ofthe“µn˛-th“argumen•¸ăt,‘pro“vided–it“isŽ© Ť‘Na–UUconstanš¸ăt“integer.ގŤŤŤ‘5ĆcoQÇdeŽŽ‘PײpšGop–UUan“in¸ăteger“µn“˛and“generate“the“C“code“for“the“µn˛-th“argumen¸ăt.ގŤŤŤ‘5ĆcastŽŽ‘Mµ§˛pGop–Iĺan›Ićin¸ăteger“µn˛and“at¸ăypGe“µt˛and“generatethe“C‘IăcoGdefor“theµn˛-th“argu-ަŤ‘Nmenš¸ăt–UUcast“to“typGe“µt˛.ގŤŤŤ‘5ĆparensŽŽ‘Zé2˛this–m is›mźa“ agrequesting“ĆcoQÇde˛and“Ćcast˛to“enclose“theC‘m™cošGde“bet•¸ăw“eenަŤ‘Nparenš¸ăthesis–UUif“the“argument“has“the“Ęp–˙}'ar“ens‘'v˛moGde.ގŤŤŤ‘5ĆstrŤ‘°ˇ‰ffs4Ž–#Őformat,‘ŐTstrŤ‘°ˇ‰ffs4Ž“ra®9wŽŽ’Á$˛pGop–¶şan“inš¸ăteger“µn“˛such“that‘¶»the“µn˛-th“argument“is“a“con-ަŤ‘Nstanš¸ăt–âdstring“and“display“the“string“without“leading“and“ending“".‘KwF‘˙*Şurther-ަŤ‘Nmore–:ĆstrŤ‘°ˇ‰ffs4Ž‘#Őformat“˛will‘:displaš¸ăy“the“string“in“a“way‘:suitable“for“inclusion“inަŤ‘Na–UUformat“string“bš¸ăy“quoting“meta-characters.ŽźBOŤ‘DThe›Ákfollo¸ăwing–ÁlRPN‘ÁOcommands“areusefulwith“theĘ...‘¶ ˛patternatom“toim-ަŤ‘5plemenš¸ăt–UUfunctions“that“take“an“unlimited“numbGer“of“arguments.ŽźŘŤŤŤ‘5Ćn®9bargŽŽ‘Vٲpush–UUthe“actual“n•¸ăum“bGer–UUof“argumen¸ăts“of“the“function.ގŤŤŤ‘5ĆformatŤ‘°ˇ‰ffs4Ž–#Őstring,‘ŐTformatŤ‘°ˇ‰ffs4Ž“argsŽŽ’ľIů˛pGop–+ían“inš¸ăteger‘+ěµn“˛such“that“the‘+ěµn˛-th“argumentަŤ‘NcorrespGonds–RRto›RSa“Ę...‘pDzpattern“atomand“generatea“formatstring“anda“listަŤ‘Nof–UUargumen¸ăts,“see“the“description“of“the“GP“function“Ęprint˛.ގŤŤŤ‘5ĆcoQÇde,‘ŐTcastŽŽ‘k“Ö˛If– Őthe“in¸ăteger‘ Öµn“˛correspGonds“to“a“Ę...‘ H˛pattern“atom,‘zµgenerate“aަŤ‘Ncomma-separated–"list“of“C‘ňcoGde“for“the“argumen¸ăts“µn›¶˝¸‘¶ľ˛1,–AUµn˛,“µn˛+‘¶ľ1,“.–ŞŞ.“.“,ަŤ‘NĆn®9barg˛,–UUbš¸ăy“matching“each“argument“against“the“µn–8ณ˛1–UUpattern“atom.ގŤŤŤ‘5ĆstdrefŽŽ‘Vęü˛this–his“a“ ag“requesting“ĆcošQÇde“˛and‘iĆt®9ype“˛to“prepšGend“a“'&'“before“eac¸ăhަŤ‘Nargumen¸ăts.ޤŘŤ‘5The›=ffollo¸ăwing–=gRPN‘=`commands“areuseful“toimplemen¸ăt“functionsthat“tak¸ăeclo-ަŤ‘5sures–UUas“argumen¸ăts.ގŤŤŤ‘5Ćwrapp•QÇer,‘ŐTco“okieŽŽ’Š:˛pGop–»çan›»čin¸ăteger“µn“˛andgenerate“acall“to“thewrappGer“(resp.ަŤ‘Nthe–—ScošGokie“associated“to‘—Rthe“wrapper)“for“the“µn˛-th“argumen¸ăt.‘2qThe“wrapperަŤ‘Ngenerated–ŢÍdepšGends“on“the“wrapper“protot¸ăype‘ŢÎin“the“W‘˙*Şrapper“ eld.‘/TheަŤ‘NcošGokie–UUis“the“list“of“local“v‘˙qÇariables“seen“b¸ăy“the“closure.ŽŽźŤ’ß8ŽŽŚře¬’Ŕ;誎 ó"F C– cmbxti10ó!p®0J cmsl10ó m#˝R cmss10óý': cmti10óÂÖN  cmbx12ó߆µTff cmtt12óßę cmmi10óKń`y cmr10óŮ“ Rcmr7óäOŁ line10ůsÍßßßßßgp2c-0.0.8/doc/type001.png0000644000175000017500000000231111721004131011733 00000000000000‰PNG  IHDRŠÎ`‡-PLTE˙˙˙UUU999ŞŞŞrrröĹ)ötRNS@ćŘfbIDAThíšÍnă …ˇĄ^s%ËëY´űÎhfM•u5óXŞúţŹ0üŘŰŘ\ŔmŁ$¤Ťlă|:ľĆ—c€o*í G í Š˘-F6˘©ĄôĐ5¤Ž-Q„ÔR¸ /­ĄtÜDWЬe‚Č*Bh5…™‹ŕUúkÜŞ,ý©ż^+)˘c[Eą3AJ1ĹÖÜ ŠřśPF ÷˘Š2ä’ßă~e€x)E”ÂĽ” SăÁKɧ°ńľR˛)BÁŃLĘËŁÇ=S¤đ›ˇ”m«ŽÂ>´ąĐNÔPhĎ€‚ '»ŃI`OIE$Ś[-@x˸u„Ba\ŞJ{!EšĆZR]$=(uŞlěGĄŻ7¤Pid”QŔ_‘îŽZ}Q„Î)Iß»č:/ŞČ,şĽk;Ńc˘›,_u ëŧěXÔz•éčz5Žâ:ś_§¸ľ 'f•2şUÔ‹Í*eüőH+˘ś~ŚłFyň[/1+”»7żÉă§ (OÁ6BLśr˙ě„®3‹ňg˛8ŕĘÉĂ#ĹD)ó_˝¤ÄÄ(3)ŰŁ,ŰYŞ;‰P"mž%í%Öäb–”h.HYRâçoç™eíôşQ‡[ąŔB•ý^­ďP×Ě×)9–vÝŠG)ŢăŞń€˘ďŔ»™“c=AMýע=®ńďţŃŰĺ Ë;ĄBšăqŠö¸D Qţ€Ů^R´[…ŽĐn…˘=®KĘ<ĽÖó˛vM‹ö¸ú xšBŐvž®Ü#í‰dďµőöł®ľî–´ÝUç?ś“ó§ MřŐQr˙•Pr{Ł|=%;oź%Zvˇd÷J(ßz‹ŽS[ZH™§Ň°”S¤v©f8Ö™ŇR ×ĆŐ Ç63 >,Tk†@YWLáÄŻšką7oă…7´Śb&儎…ގ-E÷°U‰Ą<kЦ4A¸żY‰·­ 07C#$bfgĚ®ýęlf‹lR5s_ҬÍʦnĺĆ ”&ŞŇ:«µCn좆Báśd^Ń„Âú×^ÔjÖdůčŇ>Ů^bÍeą&+Ővc”嚬ÔsmşË5Y‰g™/ůŰĄm÷XĘv€î¤·Äŕ˝Ë– ´!&˛!&ÇŤY1nLŐć7sLŞ[Tt˘ś6ł¬îaŠ={ö3i¦a¦Ä/*óNí–„9pJÁ{DäŠ (ŕŁë§ÚoŻŔűRÔţ”âŕŢ(_E)ot—M)Ď M©ČQgJ©čöˇĺÖ}"ĺnQ?řÝ:ŠYŚSO!ŽR\·¨€3łŔłśbÎZgŘVh1‹ śKUÓ2ŻŘ…łŐ»pÖb#*ř˘ŻKaô»źQţĎl–î?~`ĎIEND®B`‚gp2c-0.0.8/doc/gp2c.dvi0000644000175000017500000013432412156115341011405 00000000000000÷’Ŕ;č TeX output 2013.06.12:1759‹˙˙˙˙ ŞŤ ýs oŤ ýŢŤ’‹áoóDÓítG®G®cmr17ąAn–7tinŚqtrosŽduction“to“ó߆µTG® cmtt12şgp2cŽźŤŤŤŤŤ’…8ÇóX«Q cmr12»By–ę¨Bill“Allomš¬rbSŽert“and“Ariel“PacettiŽŽŽŽŽźfjŤ’ľ+yJune–ę¨12,“2013Žź(đÁŤ‘5óÂÖN ff cmbx12ĹCon•ŚĚten“tsޤŤŤ‘5óň"V cmbx10Ć1Ž‘DWhat–ŐTis“óßꍍ‘ü.ŽŽ–ÇŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽŤ‘˘9ŽŽ¦ŤŤ‘D3.5Ž‘[Example–UUof“optimisation‘[ÍŤŤ‘ü.ŽŽ–ÇŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽŤ‘˘9ŽŽ¦ŤŤ‘D3.6Ž‘[Tš¸ăypGes–UUand“membGer“functions‘żGŤŤ‘ü.ŽŽ–ÇŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽŤ‘ˇ11ŽŽˇŤŤ‘5Ć4Ž‘DCommon‘ŐTproblemsŤ’ßu11ŽŽ¦ŤŤ‘D˛4.1Ž‘[Meta-commands.‘㍍‘ü.ŽŽ–ÇŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽŤ‘ˇ11ŽŽ¦ŤŤ‘D4.2Ž‘[UnsuppGorted‘UUfunctions.‘"썍‘ü.ŽŽ–ÇŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽŤ‘ˇ12ŽŽ¦ŤŤ‘D4.3Ž‘[Memory–UUhandling“and“global“v‘˙qÇariables.‘›‰ŤŤ‘ü.ŽŽ–ÇŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽŤ‘ˇ12ŽŽ¦ŤŤ‘D4.4Ž‘[GP‘UUlists‘uŤŤ‘ü.ŽŽ–ÇŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽŤ‘ˇ13ŽŽ¦ŤŤ‘D4.5Ž‘[The‘UUóý': cmti10Činstal‘‚Řl‘]޲command>ŤŤ‘ü.ŽŽ–ÇŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽ“ŤŤ‘ü.ŽŽŤ‘ˇ13ŽŽˇŤŤ‘5Ć5Ž‘DCommand-line–ŐToptions“of“Çgp2cŤ’¦ČÇĆ14ŽŽź Á˛ŤŤ‘5Ĺ1Ž‘MLËWhat–ffis“ó߆µTff cmtt12Égp2cĹ?ŽźçŤ‘5˛The–Ô†Çgp2c“˛compiler“is“a“pacš¸ăk‘˙qÇage‘Ô‡for“translating“GP‘Ôeroutines“into“the‘Ô‡C‘Ôeprogram-ަŤ‘5ming–·language,‘Ďlso›·that“they“can“bGecompiled“and“used“withthe“P‘˙*ŞARI‘¶čsystemަŤ‘5or–UUthe“GP“calculator.ަŤ‘DThe–Śmain“adv‘˙qÇan¸ătage“of“doing“this“is“to“spGeed“up“computations“and“to“includeަŤ‘5y•¸ăour›!o“wnroutines‘!withinthepreexistingGP‘!ones.‘`ZItma“yalso nd‘!bugsinGPަŤ‘5scripts.ަŤ‘DThis–UUpacš¸ăk‘˙qÇage“(including“the“latest“versions)“can“bGe“obtained“at“the“URL:ަŤ‘5Çhttp://pari.math.u-bordeaux.fr/download.html#gp2cŽŽźŤ’߲1ŽŽŚ‹* ŞŤ ýs oŤ ý´ŤŤ‘5óÂÖN  cmbx12Ę1.1Ž‘SŔInstalling‘€ó ߆µT cmtt12Ëgp2cŽ©uTŤ‘5˛After–ŠŘdo¸ăwnloading“the“ le“Çgp2c-ó!ßęcreates“a‘j=directory‘ŤËÇgp2c-Ěx.y.z–ĽrÇplĚt“˛,‘™Cwhic•¸ăh›j>con“tainsthe‘j=mainÇgp2c˛ les.ގŤ‘5No•¸ăw›UUy“ouha“v“etoinstalltheprogram.ގŤ‘DY‘˙*Şou–»Áneed›»Âthe“ leÇpari.cfg˛.‘Ą This le“canbGe“foundin“theP‘˙*ŞARI‘»eob‘Ž8jectގŤ‘5directory–UUand“is“installed“in“$pre x/lib/pari/.ގŤ‘DCop¸ăy–UUor“link“this“ le“in“the“Çgp2c“˛directory‘˙*Ş,“bGe“sure“to“call“it“Çpari.cfg˛.ގŤ‘5Ćln–ŐT-s“.../lib/pari/pari.cfg“pari.cfgގŤ‘D˛Run– VĆ./con gure˛,‘6Vwhicš¸ăh“will“search“for“the“P‘˙*ŞARI‘ (version“and“some“otherގŤ‘5con guration–ąhtošGols“of“the“system.‘žT‘˙*Şo“install“the“program,‘lt¸ăype“Ćmak®9e˛,‘landގŤ‘5the–˙ program›˙!will“bGecompiled.‘o)Y‘˙*Şoucan“thenrun“Ćmak•®9e‘c“hec“k–˙ ˛tov¸ăerify“thatގŤ‘5evš¸ăerything–Ö¨has“gone“ ne“(a“bunch“of“OK's“should‘Ö§show“up).‘őŔAll“of“this“isގŤ‘5completely–UUstandard,“and“yš¸ăou“are“now“ready“to“use“Çgp2c˛.ގŤ‘DY‘˙*Şou–ź|can“use›ź{Çgp2c“˛directly“from“thisdirectory“or“y¸ăou“can“installit“b¸ăy“runningގŤ‘5Ćmak®9e‘źŔinstall›[˛as–ZroGot.‘×If“y¸ăou“donot“install“it,‘1[y¸ăoucan“run“it“fromthe“Çgp2cގŤ‘5˛directory–UUbš¸ăy“typing“Ć./gp2cŽź!ÄŤŤ‘5Ĺ2Ž‘MLËA–ffÉgp2c“ĹtutorialŽźçŤŤ‘5Ę2.1Ž‘SŔHoš w–€can“I“compile“and“run“my“scripts?ަŤ‘5˛The›ĐQsimplest‘ĐPw•¸ăa“yto–ĐPuseÇgp2c˛is“tocall“Çgp2c-run˛.‘âşIfyš¸ăou“want‘ĐQto“know‘ĐQwhatގŤ‘5happGens–UUin“detail,“see“next“section.ގŤ‘DT‘˙*Şo– /makš¸ăe“the“examples“easier“to“follow,‘9ĺplease“move“to“the“Çgp2c“˛directoryގŤ‘5and–UUlink“the“roGot“of“y¸ăour“P‘˙*ŞARI“source“there:ގŤ‘5Ćln–ŐT-s“.../pari“.ގŤ‘D˛As›Kźan–K example,‘É1w¸ăe“willtak¸ăe“the le“Çpari/examples/squfof.gp˛,‘É1whic¸ăhގŤ‘5is–‘Ęa›‘Ësimple“implemen¸ătationof“thew•¸ăell-kno“wn‘‘ĘSQUF“OF‘‘yfactoringmethoGd‘‘ĘofގŤ‘5D.‘UUShanks.ގŤ‘DW‘˙*Şe–UUjust“run“the“command:ގŤ‘5Ć./gp2c-run‘ŐTpari/examples/squfof.gpގŤ‘D˛After–M…a“little“prošGcessing“w¸ăe“get“a“GP‘MDsession.‘ZWBut“this“session“is“special,ގŤ‘5bGecause–rŔit“conš¸ătains“the‘rÁcompiled“Čsqufof‘‘T˛function.‘&@Hence“we‘rÁcan“do“the“following:Ž©Ť‘5Çparisize–?ý=“4000000,“primelimit“=“500000ގŤ‘5?‘?ýsqufof(3097180303181)ގŤ‘5[419]ގŤ‘5i–?ý=“596ގŤ‘5Qfb(133225,–?ý1719841,“-261451,“0.E-28)ގŤ‘5%1–?ý=“1691693ަŤ‘5˛Let's–UUtry“a“bigger“example:ŽŽźŤ’ß2ŽŽŚ‹ ŞŤ ýs oŤ ý´Ť‘5Ç?‘?ýsqufof(122294051504814979)ޤ Ť‘5[20137]ގŤ‘?ú***‘ż÷the–?ýPARI“stack“overflows“!ގŤ‘?úcurrent–?ýstack“size:“4.0“MbytesގŤ‘?ú[hint]–?ýyou“can“increase“GP“stack“with“allocatemem()ގŤ‘5?‘?ýallocatemem()ގŤ‘?ú***‘ż÷Warning:–?ýdoubling“stack“size;“new“stack“=“8.0“MBytes.ގŤ‘5?‘?ýsqufof(122294051504814979)ގŤ‘5[20137]ގŤ‘5[20137,‘?ý3445]ގŤ‘5i–?ý=“46474ގŤ‘5Qfb(321233929,–?ý131349818,“-367273962,“0.E-28)ގŤ‘5%2–?ý=“73823023Ž©bvŤ‘5˛W‘˙*Şe–Ď;need“a“large“stacš¸ăk“bGecause“by“default‘Ď<Çgp2c“˛došGes“not“generate“code“to“handleގŤ‘5the–pĂstac¸ăk›pÄ(the“so-calledó#m#˝R cmss10Îgerepile˛coGde).‘ÄT‘˙*Şo“instructÇgp2c˛to“add“Çgerepile˛coGdeގŤ‘5automatically‘˙*Ş,‘fw•¸ăe›ëm“ust–ęuse“theĆ-g“˛option.‘[NSoquit“thisGP‘Ůsession“andlaunc¸ăh“aގŤ‘5new–UUone“with“-g.‘qÇOh“wš¸ăell,“bGefore“that“typGeގŤ‘5Ćls‘ŐTpari/examples/squfof.gp*ަŤ‘5Çpari/examples/squfof.gp‘˙ôpari/examples/squfof.gp.runގŤ‘5pari/examples/squfof.gp.c‘ úpari/examples/squfof.gp.soގŤ‘5pari/examples/squfof.gp.oަŤ‘D˛These–UUare“the“ les“generated“b¸ăy‘xâÇgp2c-run˛:ŽźbwŤŤŤŤ‘Dó !",š cmsy10¸ŽŽŽ‘N˛pari/examples/squfof.gp.c–UUis“the“C“ le“generated“b¸ăy‘xâÇgp2c˛.ޤ±;ŤŤŤŤ‘D¸ŽŽŽ‘N˛pari/examples/squfof.gp.o–UUis“the“ob‘Ž8ject“ le“generated“b¸ăy“the“C“compiler.ގŤŤŤŤ‘D¸ŽŽŽ‘N˛pari/examples/squfof.gp.so–UUis“the“shared“library“generated“bš¸ăy“the“linker.ގŤŤŤŤ‘D¸ŽŽŽ‘N˛pari/examples/squfof.gp.run–ePis›eOa“ lethat“con¸ătainsthe“commandsneededޤ Ť‘Nto–UUload“the“compiled“functions“inside“GP‘˙*Ş.ަŤ‘5It–UUis“the“shared“library“whicš¸ăh“is“used“by“GP‘˙*Ş.ގŤ‘DNoš¸ăw–UUlet's“continue:ގŤ‘5Ć./gp2c-run–ŐT-g“pari/examples/squfof.gpަŤ‘5Çparisize–?ý=“4000000,“primelimit“=“500000ގŤ‘5?‘?ýsqufof(122294051504814979)ގŤ‘5[20137]ގŤ‘5[20137,‘?ý3445]ގŤ‘5i–?ý=“46474ގŤ‘5Qfb(321233929,–?ý131349818,“-367273962,“0.E-28)ގŤ‘5%1–?ý=“73823023ަŤ‘D˛This–P"time›P!it“w¸ăorkswith“nodicult¸ăy“using“thedefault“stac•¸ăk.‘p W‘˙*Şew“ould‘P"lik“eގŤ‘5to›Ákno•¸ăw‘Á‚ho“wm“uc“h–Á‚fasterthecompiled“coGderuns,‘ÜŤsow¸ăeneed“toload“thenonގŤ‘5compiled–UUČsqufof‘sé˛ le“in“GP:Žź;Ť‘5Ç?–?ý\r“pari/examples/squfof.gpގŤ‘?ú***‘ż÷unexpected–?ýcharacter:“squfof(n)=if(isprime(n),returގŤ’ż‹^--------------------ŽŽźŤ’߲3ŽŽŚ‹$  ŞŤ ýs oŤ ý´Ť‘5˛Wh¸ăy??‘âBecause–ĐČsqufof‘already“exists“as‘Đan“installed“function“and“GP‘Ďörefusesޤ Ť‘5to›ŁĄo•¸ăv“erwriteit.‘\¶T‘˙*Şosolv“ethisproblem,‘·9w“ewilladdasux‘٤tothenameoftheގŤ‘5compiled–UUfunction“under“GP‘˙*Ş.“Quit“the“session“and“t¸ăypGe:ގŤ‘5Ć./gp2c-run–ŐT-g“-sŤ‘°ˇ‰ffs4Ž‘#Őc“pari/examples/squfof.gpގŤ‘D˛Noš¸ăw–UUthe“function“squfof“is“named“squfofŤ‘™‰ffŽ‘™šc“instead,“so“we“can“doŽ©Ť‘5Çparisize–?ý=“4000000,“primelimit“=“500000ގŤ‘5?–?ý\r“pari/examples/squfof.gpގŤ‘5?‘?ý#ގŤ‘Dż÷timer–?ý=“1“(on)ގŤ‘5?‘?ýsqufof(122294051504814979)ގŤ‘5[20137]ގŤ‘5[20137,‘?ý3445]ގŤ‘5i–?ý=“46474ގŤ‘5Qfb(321233929,–?ý131349818,“-367273962,“0.E-28)ގŤ‘5time–?ý=“5,810“ms.ގŤ‘5%1–?ý=“73823023ގŤ‘5?‘?ýsqufof_c(122294051504814979)ގŤ‘5[20137]ގŤ‘5[20137,‘?ý3445]ގŤ‘5i–?ý=“46474ގŤ‘5Qfb(321233929,–?ý131349818,“-367273962,“0.E-28)ގŤ‘5time–?ý=“560“ms.ގŤ‘5%2–?ý=“73823023ަŤ‘5˛So–Yxthe›Ywcompiled“v¸ăersion“ismore“than“tentimes“faster“thanthe“noncompiledގŤ‘5one.‘†ŁHo•¸ăw“ev“er–±źfor›±žmore“complexexamples,‘°compiled“coGdeusually“runsonlyގŤ‘5three–UUtimes“faster“on“a•¸ăv“erage.ގŤ‘DAn–˝ extra‘˝ˇtricš¸ăk:‘B^once“you“have›˝ˇrun“Çgp2c-run“˛ony¸ăour“script,‘׳itis“compiledގŤ‘5and–ĆŘyš¸ăou“can‘Ć×use“the“compiled“version“outside‘Ć×Çgp2c-run“˛in“any“GP‘Ćşsession“byގŤ‘5loading–çëthe“ le“with“extension“Ç.gp.run˛.‘MOF‘˙*Şor“example“quit“the“Çgp2c-run“˛sessionގŤ‘5and–UUstart“Çgp“˛and“doŽ©Ť‘5Çparisize–?ý=“4000000,“primelimit“=“500000ގŤ‘5?–?ý\r“pari/examples/squfof.gp.runަŤ‘D˛No•¸ăw›UUy“ouha“v“eaccesstothecompiledfunctionČsqufofŤ‘ť‰ffŽ‘®c‘ć ˛asw“ell.Žźţ6ŤŤ‘5Ę2.2Ž‘SŔHo w–€can“I“compile“directly“with“Ëgp2cĘ?ŽźuTŤ‘5˛No•¸ăw› €w“ew“an“tto– compiledirectlywithÇgp2c˛tounderstandwhat“happGens.‘SHW‘˙*ŞeގŤ‘5should–UUrun“the“commandގŤ‘DĆ./gp2c–ŐTpari/examples/squfof.gp“Ç>“Ćsqufof.gp.cގŤ‘D˛This–_Âcreates“a›_Á le“squfof.gp.c“in“the“Çgp2c˛directory‘˙*Ş.‘‘No¸ăw“readthis“ le“withގŤ‘5y•¸ăour›UUfa“v“oriteeditor.ގŤ‘DThe–UU rst“line“is“highly“system-depšGenden¸ăt,“but“should“be“similar“to:ŽźŤ‘5ó%ߤN cmtt9Đ/*-*-–ą–compile-command:“"/usr/bin/gcc“-c“-o“pari/examples/squfof.gp.oޤ Ť‘>s,-O3–ą–-Wall“-I/usr/local/include“pari/examples/squfof.gp.cގŤ‘>s,&&–ą–/usr/bin/gcc“-o“pari/examples/squfof.gp.soގŤ‘>s,-shared‘,Âpari/examples/squfof.gp.o";‘ą–-*-*/ŽŽźŤ’߲4ŽŽŚ‹-­ ŞŤ ýs oŤ ý´Ť‘D˛This–Vis›Uthe“commandneeded“to“compilethis“C‘G le“to“anob‘Ž8ject“ lewith“theޤ Ť‘5C‘ćcompiler›ć3and–ć4then“tomak¸ăe“a“shared“librarywith“the“linkš¸ăer.‘LĽIf“you‘ć3use“Çemacs˛,ގŤ‘5tš¸ăyping–ÝŁ'M-x‘ݤcompile'“will“know“abGout‘ݤthis“command,‘˙·so“you“will“just‘ݤneed“toގŤ‘5t¸ăypGe–UUÇReturn“˛to“compile.ގŤ‘DThe–UUsecond“line“isŽ©»ĽŤ‘5Ç#include‘?ýŽź»»Ť‘5˛This–fŢincludes›fÝthe“P‘˙*ŞARI‘fŘheader“ les.‘¦`It“isimpGortan¸ăt“thatthe“header les“comeގŤ‘5from–UUthe“same“P›˙*ŞARI“v¸ăersion“as“GP,“else“it“will“create“problems.ޤ Ť‘DThe–UUnext“lines“areŽź»ĽŤ‘5Đ/*ގŤ‘5GP;install("squfof","D0,G,p","squfof","./pari/examples/squfof.gp.so");ގŤ‘5GP;install("init_squfof","v","init_squfof","./pari/.../squfof.gp.so");ގŤ‘5*/ަŤ‘D˛The–”*c¸ăharacters›”)"GP;"“denotea“commandthat“shouldbGe“readb¸ăy“GP‘“×atޤ Ť‘5start-up.‘J]Here,‘„čthe›H2Činstal‘‚Řl()‘¦Ĺ˛commands‘H1abGo•¸ăv“em“ustbGe‘H1giv“entoGP‘Góto‘H1letitގŤ‘5knoš¸ăw–űÝabGout“functions“de ned‘űŢby“the“library‘˙*Ş.‘SôÇgp2c-run‘ű޲copy“such“commands“toގŤ‘5the–UU le“Ç./pari/examples/squfof.gp.run˛.ގŤ‘DPlease–UUread“the“enš¸ătry“abGout“the“Činstal‘‚Řl()‘łč˛command“in“the“P‘˙*ŞARI“manual.ގŤ‘DThe–PČinitŤ‘ť‰ffŽ‘®squfof‘n¨˛function›Pis“an“initialization“function“thatis“created“auto-ގŤ‘5matically–WŚb¸ăy“Çgp2c›WŤ˛to“hold“coGdes“that“isoutside“an¸ăy“function.‘xlSincein“our“caseގŤ‘5there–ôare›ônone,‘Ăthis“isa“dumm¸ăyfunction.‘NIn“othercases,‘Ăit“isessen¸ătial.‘NTheގŤ‘5next–UUlines“areŽźŞ«Ť‘5ÇGEN–?ýsqufof(GEN“n,“long“prec);ގŤ‘5void‘?ýinit_squfof(void);ގŤ‘5/*End–?ýof“prototype*/ŽźŞŞŤ‘5˛This–ńdis›ńethe“C‘ń“Ćsqufof2.gp.cގŤ‘D˛and–UUlošGok“at“the“di erence“bet•¸ăw“een–UUsqufof.gp.c“and“squfof2.gp.c:ޤ Ť‘5Ćdi –ŐT-u“squfof.gp.c“squfof2.gp.cŽź»ĽŤ‘5Đ---–ą–squfof.gp.c“Tue“Feb“26“13:44:42“2002ގŤ‘5+++–ą–squfof2.gp.c‘%̰Tue“Feb“26“13:44:49“2002ގŤ‘5@@–ą–-1,8“+1,8“@@ގŤ‘9ą–/*-*-–ą–compile-command:“"/usr/bin/gcc“-c“-o“pari/examples/squfof.gp.oގŤ‘>s,-DMEMSTEP=1048576–ą–-g“-Wall“-Wno-implicit‘ s,-I/usr/local/includeގŤ‘>s,pari/examples/squfof.gp.c–ą–&&“/usr/bin/ld“-o“pari/examples/squfof.gp.soގŤ‘>s,-shared‘,Âpari/examples/squfof.gp.o";‘ą–-*-*/ގŤ‘9ą–#include‘ą–ŽˇŤ‘9ą–/*ގŤ‘5-GP;install("squfof","D0,G,p","squfof","./pari/examples/squfof.gp.so");ގŤ‘5-GP;install("init_squfof","v","init_squfof","./pari/.../squfof.gp.so");ގŤ‘5+GP;install("squfof","D0,G,p","squfof_c","./pari/...les/squfof.gp.so");ގŤ‘5+GP;install("init_squfof","v","init_squfof_c","./par.../squfof.gp.so");ގŤ‘9ą–*/ގŤ‘9ą–GEN–ą–squfof(GEN“n,“long“prec);ގŤ‘9ą–void‘ą–init_squfof(void);ŽŽźŤ’߲5ŽŽŚ‹7Ë ŞŤ ýs oŤ ý´Ť‘D˛If–P,yš¸ăou“are“not‘P+familiar“with“the“Çdiff“˛utility‘˙*Ş,‘Q4the“abGove‘P+means“that“only“theޤ Ť‘5t•¸ăw“o–ÝAlines›ÝBstarting“withČGP;instal‘‚Řl‘ĺʲha•¸ăv“ec“hanged.‘ ŚIn–ÝAfactČsqufof‘űŐ˛isstill“namedގŤ‘5Čsqufof‘žm˛in›Úthe–ŮC‘Î le,‘Š{but“the“installcommand“tells“GP‘Ďto“rename“itČsqufofŤ‘ť‰ffŽ‘®c‘ʞinގŤ‘5the–UUGP“session.Žźţ6ŤŤ‘5Ę2.3Ž‘SŔUsing–€Ëgp2c“Ęto“ nd“errors“in“GP“scriptsŽźuTŤ‘5˛The–7Çgp2c“˛compiler›8can“also“bGe“usedto“ nd“errors“inGP‘"programs.‘VľF‘˙*Şor“that“w¸ăeގŤ‘5should–UUuse“the“-W“option“lik¸ăe“inގŤ‘DĆ./gp2c–ŐT-W“pari/examples/squfof.gp“Ç>“Ćsqufof.gp.cŽ©Ť‘5ÇWarning:pari/examples/squfof.gp:7:variable‘?ýundeclaredގŤ‘5pގŤ‘5Warning:pari/examples/squfof.gp:11:variable‘?ýundeclaredގŤ‘5ddގŤ‘5Warning:pari/examples/squfof.gp:11:variable‘?ýundeclaredގŤ‘5dގŤ‘5Warning:pari/examples/squfof.gp:11:variable‘?ýundeclaredގŤ‘5bގŤ‘5...ގŤ‘5Warning:pari/examples/squfof.gp:45:variable‘?ýundeclaredގŤ‘5b1ަŤ‘D˛This–ďĽoption“lists“v‘˙qÇariables“that“are“used“but‘ď»not“declared.‘@üIt“is“impGortan¸ătގŤ‘5to–%declare›%™all“y¸ăourv‘˙qÇariables“withČlo–˙}'c“al()˛,‘/$orwith›%Čglob“al()˛.‘aŢF‘˙*ŞorÇgp2c˛,‘/%undeclaredގŤ‘5v‘˙qÇariables–Óoare›Óntak¸ăen“to“bGe\formal“v‘˙qÇariables"“forpGolynomials.‘F{F‘˙*Şor“exampleif“y¸ăouގŤ‘5write–UUa“function“to“build“a“second“degree“pGolynomial“lik¸ăeަŤ’§Ŕ!Çpol(a,b,c)=a*x^2+b*x+cަŤ‘5˛y•¸ăou›UUm“ustnotdeclare'x'here,sinceitstandsfortheformalv‘˙qÇariableČx˛.Žźţ6ŤŤ‘5Ę2.4Ž‘SŔUsing–€compiled“functions“in“a“new“programŽźuTŤ‘5˛One›dy•¸ăou‘eha“v“esuccessfully–ecompiledand“testedy¸ăour“functionsyš¸ăou“may‘dwant“toގŤ‘5reuse–UUthem“in“another“GP“program.ގŤ‘DThe›ÁibGest‘Ájw•¸ăa“yistocop“y–Ájtheinstallcommandsof“thefunctionsy¸ăouuse“attheގŤ‘5start–¸of›Âąthe“new“programso“that“reading“itwill“automatically“loadthe“compiledގŤ‘5functions.ޤ Ť‘DAs–UUan“example,“w¸ăe“write“a“simple“program“Çfact.gp“˛that“readsŽźŤ‘5Đinstall("squfof","D0,G,p","squfof","./pari/examples/squfof.gp.so");ގŤ‘5fact_mersenne(p)=squfof(2^p-1)ަŤ‘D˛and–UUrun“GP:ަŤ‘5Çparisize–?ý=“4000000,“primelimit“=“500000ޤ Ť‘5?‘?ý\rfactގŤ‘5?‘?ýfact_mersenne(67)ގŤ‘5i–?ý=“2418ގŤ‘5Qfb(10825778209,–?ý4021505768,“-13258245519,“0.E-28)ގŤ‘5%1–?ý=“193707721ŽŽźŤ’߲6ŽŽŚ‹CÜ ŞŤ ýs oŤ ý´Ť‘D˛So–Ŕall›Ŕ‡goGes“w¸ăell.‘@.Butwhat“isev¸ăen“bGetter“isthat“Çgp2c“˛understandsthe“Činstal‘‚Řlޤ Ť‘5˛command–UUand“will“bGe“able“to“compile“this“new“program.ގŤ‘DAlso–†ěthis›†íparticular“example“will“failbšGecause“as“stated“abo•¸ăv“e,‘ÓRP‘˙*ŞARI/GPގŤ‘5already–ťçhas›ťča“Îsqufof‘Oݞfunction,‘° and“thelinkš¸ăer“will“pick›ťčthe“wrongone,‘° whic¸ăh“isގŤ‘5unfortunate.ގŤ‘DSo–UUuse“the“-p“option“to“Çgp2c-run“˛to“c¸ăhange“Čsqufof‘sé˛to“ČmyŤ‘ť‰ffŽ‘®squfof˛.ގŤ‘8ŐTĆ./gp2c-run–ŐT-pm®9yŤ‘°ˇ‰ffs4Ž‘ů)-g“pari/examples/squfof.gpޤ Ť‘D˛This–ŮÚoption“pre xes“mš¸ăyŤ‘™‰ffŽ‘stto“every“GP‘ٸname‘ŮŰin“the“program“so“as“to“avoidގŤ‘5name–UUclashes.‘qÇChange“Çfact.gp“˛toŽźŤ‘5Đinstall("my_squfof","D0,G,p","squfof","./pari/examples/squfof.gp.so");ގŤ‘5fact_mersenne(p)=squfof(2^p-1)ޤŤ‘D˛and‘UUrunŽ© Ť‘5Ć./gp2c-run–ŐT-g“fact.gpގŤ‘5Çparisize–?ý=“4000000,“primelimit“=“500000ަŤ‘5?‘?ýfact_mersenne(67)ަŤ‘5i–?ý=“2418ަŤ‘5Qfb(10825778209,–?ý4021505768,“-13258245519,“0.E-28)ަŤ‘5%1–?ý=“193707721ގŤ‘D˛Nice–UUisn't“it?ޤ Ť‘DBut–¤it“gets“ev¸ăen“bGetter:‘-instead“of“writing“the“Činstal‘‚Řl‘­˛command“directly“inގŤ‘5yš¸ăour–Â-script“you›Â.can“just“load“the“Çsqufof.gp.run“˛usingÇ\r˛:‘(3just“c¸ăhange“Çfact.gpގŤ‘5˛toŽźŤ‘5Đ\r‘ą–./pari/examples/squfof.gp.runގŤ‘5fact_mersenne(p)=squfof(2^p-1)Žźţ6ŤŤ‘5Ę2.5Ž‘SŔHand-editing–€the“C“ le“generated“b y“Ëgp2cŽźuTŤ‘5˛If›( y•¸ăou‘(ha“v“esomeexpGerience‘(inP‘˙*ŞARI‘(programming,‘1*y“ouma“yw“an“t‘(toman“uallyަŤ‘5edit›1îthe–1ďC‘1µ le“generatedb¸ăy“Çgp2c˛,‘iforexample“toimpro•¸ăv“e‘1ďmemoryhandling.ަŤ‘5Here–UUsome“tips:ޤŤŤŤŤ‘D¸ŽŽŽ‘N˛If›~ y•¸ăou‘~ preserv“ethe–~ Činstal‘‚Řl()‘Üś˛atthe“startof“the le,‘6y¸ăou“canuse“thecom-ަŤ‘Nmand–pşĆgp2c-run‘ôÔÍ leĆ.c“˛to›pąrecompile“y¸ăour le“and“starta“newGP‘płsessionަŤ‘Nwith–UUyš¸ăour“functions“added,“just“as“you“use“Ćgp2c-run“˛with“GP“scripts.ގŤŤŤŤ‘D¸ŽŽŽ‘N˛More–Šŕgenerally‘˙*Ş,‘ł^Ćgp2c-run“˛automatically“passes“an¸ăy“line“in‘Šßthe“C‘Š­ le“start-ަŤ‘Ning–UUwith“'GP;'“to“GP“at“start-up.ގŤŤŤŤ‘D¸ŽŽŽ‘N˛As–n±explained“in“Section›n˛2.2,‘uunder“Ćemacs“˛y¸ăou“cant¸ăypGe“'M-x“compile'“toަŤ‘Nrecompile–UUthe“shared“library‘˙*Ş.Žź!ÄŤŤ‘5Ĺ3Ž‘MLËAdv‘˙™anced–ffuse“of“Égp2cŽźçŤŤ‘5Ę3.1Ž‘SŔËgp2c‘€Ęt yp`esŽźuTŤ‘5˛Inš¸ăternally–­ńÇgp2c“˛assign“typGes›­đto“ob‘Ž8jects.‘{›The“mostcommon“tš¸ăypGes“are“givenަŤ‘5bGelo¸ăw:ŽŽźŤ’ß7ŽŽŚ‹M¶ ŞŤ ýs oŤ ţł3ŤŤŤź™ł1ŤŤ‘J˛name‘Éáź™ś„ ffŽŤ‘{RodescriptionŽŽ‘Dź‰ffđł&źfdŤŤ‘Čvoid‘;łź™ś„ ffŽŤ‘7Ro˛lik¸ăe–UUin“CŽŽ¤ ŤŤ‘Čb–˙}'o“ol‘Ä=ź™ś„ ffŽŤ‘7Ro˛b•Go“olean,–UUtrue“(1)“or“false“(0)ŽŽˇŤŤ‘Čne–˙}'gb“o“ol‘ t ź™ś„ ffŽŤ‘7Ro˛an¸ătib•Go“olean,–UUtrue“(0)“or“false“(1)ŽŽˇŤŤ‘Čsmal‘‚Řl‘Bź™ś„ ffŽŤ‘7Ro˛C–UUin¸ăteger“ÎlongŽŽˇŤŤ‘Čint‘gź™ś„ ffŽŤ‘7Ro˛m•¸ăultiprecision‘UUin“tegerŽŽˇŤŤ‘Čr–˙}'e“al‘©8ź™ś„ ffŽŤ‘7Ro˛mš¸ăultiprecision–UU oating“pGointŽŽˇŤŤ‘Čmp‘ŐJź™ś„ ffŽŤ‘7Ro˛m•¸ăultiprecision‘UUn“um“bGerŽŽˇŤŤ‘Čvar‘1ľź™ś„ ffŽŤ‘7Ro˛v‘˙qÇariableŽŽˇŤŤ‘Čp‘˙}'ol‘Úűź™ś„ ffŽŤ‘7Ro˛pGolynomialŽŽˇŤŤ‘Čve‘˙}'csmal‘‚Řl‘ŐVź™ś„ ffŽŤ‘7Ro˛v¸ăector–UUof“C“long“(ÎtŤ‘™‰ffŽ‘™šVECSMALL˛)ŽŽˇŤŤ‘Čve‘˙}'c‘ŐNź™ś„ ffŽŤ‘7Ro˛v¸ăector–UUand“matrices“(excluding“Čve‘˙}'csmal‘‚Řl‘‰˛)ŽŽˇŤŤ‘Člist‘·ź™ś„ ffŽŤ‘7Ro˛GP‘UUlistsŽŽˇŤŤ‘Čstr‘~Šź™ś„ ffŽŤ‘7Ro˛cš¸ăharacters–UUstring“as“a“Îchar“*ŽŽˇŤŤ‘Čgenstr‘¬ź™ś„ ffŽŤ‘7Ro˛c¸ăharacters–UUstring“as“a“ÎGEN“˛(ÎtŤ‘™‰ffŽ‘™šSTR˛)ŽŽˇŤŤ‘Čgen‘LÄź™ś„ ffŽŤ‘7Ro˛generic–UUP‘˙*ŞARI“ob‘Ž8ject“(ÎGEN˛)ŽŽˇŤŤ‘Člg‘#÷kź™ś„ ffŽŤ‘7Ro˛length–UUof“ob‘Ž8ject“(returned“b¸ăy“Člength‘Äc˛)ŽŽˇŤŤ‘Čtyp‘ŐLź™ś„ ffŽŤ‘7Ro˛tš¸ăypGe–UUof“ob‘Ž8ject“(returned“by“Čtyp‘˙}'e‘Ŕ[˛)ŽŽŽŽŽ !?Ť ˙RĘă ŹCVŤŤŤŤŤŤ’ëQ ˙qĽŞgenŽŽŤŤ’ň_ ź‚Îü„9ďfeŽŽŤŤ’ë ‰źŽ0mpŽŽŤŤ’ŰĎ:ź‚ÎüóäOŁ line10¬ŽŤ’ŕ ) ˙~–«ŽŽŤŤ’ŇźŽ0˛v¸ăecŽŽŤŤ’Çä…ź‚Îü¬ŽŤ’Ńä… ˙}ÎüŽŤ’Űä… ˙xÎüŽŤ’ŕ ) ˙v˝ŽŽŤŤ’ÁJźŽ0˛pGolŽŽŤŤ’DZSźźBÚ„9ďfeŽŽŤŤ’ÁĽźŞ¤fv‘˙qÇarŽŽŤŤ’ůp‘źŞ¤frealŽŽŤŤ’ů¤¤źźBÚ¬@ŽŤ’őjµź› ‰@ŽŽŤŤ’ŮdŃźŞ¤f˛in¸ătŽŽŤŤ’ဟźBÚ¬ŽŤ’ĺąďź› ‰ŽŽŤŤ’×…źÇD˛smallŽŽŤŤ’áLÎź»¶¸„9ďfeŽŽŤŤ’ŮzhźăŚ"b•Go“olŽŽŤŤ’ĘĽčźĎˇm¬ŽŤ’ĚtźÎ@&ŽŽŤŤ’§LšźŐR3˛negb•Go“olŽŽŤŤ’Ětźŕłż¬@ŽŤ’ĘĽčźßRx@ŽŽŤŤ’áLÎźŘ*–„9ďfeŽŽŤŤ’ŮÁ…˛v¸ăoidŽŽŤŤ’ďąďźý'ť¬ŽŤ’ň9ďźó'ťŽŤ’ôąďźé'ťŽŤ’÷9ďźß'ťŽŤ’ůąďźŐ'ťŽŤ’ü9ďźË'ťŽŤ’ţąďźÁ'ťŽŤ’$¤ź·~¨ŽŽŤŤ’áLÎźôžt„9ďfeŽŽŽŽŽŽźŤŤ’¬_ű˛T‘˙*Şable–UU1:‘qÇT¸ăypGes“preorderŽŽŽźHŹŤ‘DT¸ăypGes–[îare“preordered›[ďas“in“T‘˙*Şable“1.‘…“The“complete“preorderknoš¸ăwn“by“Çgp2cޤ Ť‘5˛can–UUbGe“accessed“b¸ăy“running“Ćgp2c‘ŐT-t˛.ގŤ‘DV‘˙*Şariables–Jńare“tš¸ăypGed.‘nPA‘Jďv‘˙qÇariable“can“only“take“v‘˙qÇalues“having“a“typGe“equal“orގŤ‘5lo•¸ăw“er–UUthan“its“tš¸ăypGe.‘qÇBy“default,“v‘˙qÇariables“are“of“typGe“Čgen˛.ŽźG#ŤŤ‘5Ę3.2Ž‘SŔT yp`e‘€declarationŽźuTŤ‘5˛T‘˙*Şo–UUdeclare“a“v‘˙qÇariable“as“bšGelonging“to“t¸ăype“Čtyp‘˙}'e˛,“use:Žź­ŹŤ‘NČfunction‘Äc˛(xČ:typ–˙}'e˛,yČ:typ“e‘Ŕ[˛=2)ގŤ‘NloGcal(xČ:typ–˙}'e˛,‘UUyČ:typ“e‘Ŕ[˛=2)ގŤ‘Nglobal(xČ:typ–˙}'e˛,‘UUyČ:typ“e‘Ŕ[˛=2)ގŤ‘Nfor(iČ:typ‘˙}'e‘Ŕ[˛=...ޤ­Ť‘DT‘˙*Şo–UUdeclare“sevš¸ăeral“v‘˙qÇariables“of“the“same“typGe“Čtyp‘˙}'e‘°˛at“once,“use:ގŤ‘NloGcal(x,‘UUy=2)Č:typ‘˙}'eŽź Ť‘N˛global(x,‘UUy=2)Č:typ‘˙}'eŽŽźŤ’߲8ŽŽŚ‹ X ŞŤ ýs oŤ ý´Ť‘D˛Y‘˙*Şou–UUcan“evš¸ăen“mix“the“two“ways:ޤŤ‘NloGcal(x,‘UUy:Čtyp–˙}'e2‘[˛=2)Č:typ“e1ގŤ‘5˛will–UUdeclare“Čx‘‰™˛to“bšGe“of“t¸ăype“Čtyp‘˙}'e1‘°[˛and“Čy‘7Ҳof“t¸ăype“Čtyp‘˙}'e2˛.Žźţ6ŤŤ‘5Ę3.3Ž‘SŔE ect–€of“t yp`es“declaration“on“default“v‘˙@aluesŽźuTŤ‘5˛Under–6GP‘˙*Ş,›5all“GP‘v‘˙qÇariables“startwith“adefault“v‘˙qÇalue,‘Kmwhic¸ăh“isČ0‘u<˛fora“loGcalޤ Ť‘5v›˙qÇariable–UUand“Č'v‘hâ˛for“a“global“variable“Čv˛.ގŤ‘DThe–4Çgp2c“˛compiler“folloš¸ăws“this“rule“for“v‘˙qÇariables“declared“without“a“typGe.ގŤ‘5Ho•¸ăw“ev“er,‘ěýwhen–›ua“v‘˙qÇariable“is“declared“with››va“t¸ăypGe,‘ěüÇgp2c˛will“not“assign“it“aގŤ‘5default–÷Lv›˙qÇalue.‘ W­This“means“that“the“declaration“Člo–˙}'c“al(g)‘Uŕ˛is–÷Lequivalen¸ăt“to“Člo-ގŤ‘5c›˙}'al(g:gen=0)˛,‘but–ďżnot“to“Člocal(g:gen)˛,‘Čglobal(g)‘NR˛is“equiv‘˙qÇalen¸ăt“to“Čglobal(g:gen='g)˛,ގŤ‘5but–ŢLnot›ŢMto“Čglob‘˙}'al(g:gen)˛,‘Šand“Čf(g)=...‘ ®˛is“equiv‘˙qÇalen¸ăt“toČf(g:gen=0)=...˛,‘Šbut“notގŤ‘5to‘UUČf(g:gen)=...˛.ގŤ‘DThis–UUrule“wš¸ăas“chosen“for“several“reasons:Ž©ŤŤŤŤ‘D¸ŽŽŽ‘N˛The–Ż÷default“v‘˙qÇalue“(Č0‘ ý˛or“Č'v‘Ť˛)“mighš¸ăt“not‘ŻöbGe“an“ob‘Ž8ject“suitable“for“the“typGeގŤ‘Nin–¤˛question.‘_ÝF‘˙*Şor“example,‘¸‰Člo–˙}'c“al(v:ve“c)‘D˛declares–¤˛Čv‘¸?˛as“bšGeing‘¤±of“t¸ăype“Čve‘˙}'c˛.‘_ÝItގŤ‘Nw•¸ăould›Ź0mak“e–Ź/nosense“toinitializeČv‘˘Ľ˛toČ0‘ę5˛sinceČ0‘ę6˛doGes“notbGelong“tot¸ăypGeގŤ‘NČve–˙}'c˛.‘; Similarly›±'Čglob“al(N:int)‘ş˛declaresČN‘T‹˛asb•Geingof‘±&t¸ăyp“eČint˛.‘; Itw•¸ăouldmak“eގŤ‘Nno–UUsense“to“initialize“ČN›řă˛to“Č'N˛since“Č'N˛došGes“not“belong“to“t¸ăype“Čint˛.ަŤŤŤŤ‘D¸ŽŽŽ‘N˛This–b’alloš¸ăws“de ning–b“GP‘bŽfunctions“with–b’mandatory“arguments.‘™This“way‘˙*Ş,ގŤ‘NGP‘q|will–qissue›q„an“errorif“a“mandatoryargumen¸ăt“is“missing.‘ĆSWithout“thisގŤ‘Nrule,–UUthere“is“no“w•¸ăa“y–UUto“tell“apart“Č0‘°[˛from“a“missing“argumen¸ăt.ަŤŤŤŤ‘D¸ŽŽŽ‘N˛This–UUallo¸ăws“telling“Çgp2c“˛not“to“generate“useless“default“v‘˙qÇalues.Ž©ţ6ŤŤ‘5Ę3.4Ž‘SŔT yp`e‘€castingŽźuTŤ‘5˛Sometimes,‘¶:w•¸ăe›Žskno“w‘Žramorepreciset“ypGe–Žrthantheonethe“transt¸ăypingalgorithmގŤ‘5can–\,derivš¸ăe.‘†KF‘˙*Şor“example“if“Čx‘p˛is‘\+a“real“numbGer,‘]âits“logarithm‘\+might“bGe“complex.ގŤ‘5Ho•¸ăw“ev“er,–UUif“wš¸ăe“are“sure“Čx‘‰™˛is“pGositive,“the“logarithm“will“bGe“real.ގŤ‘DT‘˙*Şo–UUforce“an“expression“to“bšGelong“to“t¸ăype“Čtyp‘˙}'e˛,“use“the“syn¸ătax:ގŤ‘5Čexpr‘Ť:typ‘˙}'eގŤ‘5Çgp2c›{ܲwill‘{Ýc•¸ăhec“kt“ypGesconsistency‘{Ýandoutputw“arningsif‘{Ýnecessary–˙*Ş.‘)JF“orexampleގŤ‘5Čf(x:int)=lo–˙}'c“al(r:r“e“al);‘“çr=lo“g(x^2+1)ގŤ‘5Çgp2c–Řç˛will“complain“that“the‘Řćlogarithm“mighš¸ăt“not“bGe“real.‘HMSince“Čx^2+1‘3í˛is“alwaysގŤ‘5pGositiv•¸ăe,›UUw“ecanwrite:ގŤ‘5Čf(x:int)=lo–˙}'c“al(r:r“e“al);‘“çr=lo“g(x^2+1):r“e“alަŤŤ‘5Ę3.5Ž‘SŔExample–€of“optimisationŽźuTŤ‘5˛Declaring–$vthe“tš¸ăypGes“of“v‘˙qÇariables“allow“Çgp2c“˛to“pGerform“some“optimisations.‘a}F‘˙*ŞorގŤ‘5example,–UUthe“follo¸ăwing“piece“of“GP“coGdeŽźˇŤ‘5Çrho(n)=ގŤ‘5{ގŤ‘?úlocal(x,y);ŽŽźŤ’߲9ŽŽŚ‹ có ŞŤ ýs oŤ ý´¤ Ť‘?úÇx=2;‘?ýy=5;ގŤ‘?úwhile(gcd(y-x,n)==1,ގŤ‘I˙ôx=(x^2+1)%n;ގŤ‘I˙ôy=(y^2+1)%n;‘?ýy=(y^2+1)%nގŤ‘Dż÷);ގŤ‘?úgcd(n,y-x)ގŤ‘5}ޤŤ‘D˛generates–UUthe“follo¸ăwing“output:ގŤ‘5ÇGENޤ Ť‘5rho(GEN‘?ýn)ގŤ‘5{ގŤ‘?úGEN–?ýx“=“gen_0,“y“=“gen_0;ގŤ‘?úx–?ý=“gen_2;ގŤ‘?úy–?ý=“stoi(5);ގŤ‘?úwhile–?ý(gcmp1(ggcd(gsub(y,“x),“n)))ގŤ‘?ú{ގŤ‘I˙ôx–?ý=“gmod(gaddgs(gsqr(x),“1),“n);ގŤ‘I˙ôy–?ý=“gmod(gaddgs(gsqr(y),“1),“n);ގŤ‘I˙ôy–?ý=“gmod(gaddgs(gsqr(y),“1),“n);ގŤ‘?ú}ގŤ‘?úreturn–?ýggcd(n,“gsub(y,“x));ގŤ‘5}ŽźŤ‘D˛The–Ĺ&functions“Îgsqr˛,‘!Îgaddgs˛,–!ÎgmoGd˛,“Îggcd‘Ĺ%˛are–Ĺ&generic“P‘˙*ŞARI‘ÄÇfunctions“thatގŤ‘5handle–&ĺČgen‘ëI˛ob‘Ž8jects.‘bLSince›&ćw¸ăe“onlyw•¸ăan“t–&ĺto“factorin¸ătegers“withthis“methoGd,‘0/w¸ăeގŤ‘5can–UUdeclare“Čn˛,“Čx‘‰™y‘7Ҳof“t¸ăypGe“Čint‘ňز:ގŤ‘5Çrho(nĚ:int‘ĽrÇ)=ގŤ‘5{ގŤ‘?úlocal(xĚ:intÇ,yĚ:int‘ĽrÇ);Ž©Ť‘?úx=2;‘?ýy=5;ގŤ‘?úwhile(gcd(y-x,n)==1,ގŤ‘I˙ôx=(x^2+1)%n;ގŤ‘I˙ôy=(y^2+1)%n;‘?ýy=(y^2+1)%nގŤ‘Dż÷);ގŤ‘?úgcd(n,y-x)ގŤ‘5}ަŤ‘D˛The–UUnew“C“coGde“output“b¸ăy“Çgp2c“˛is:ŽźŤ‘5ÇGENގŤ‘5rho(GEN–?ýn)‘)˙č/*“int“*/ގŤ‘5{ގŤ‘?úGEN–?ýx,“y;‘$żë/*“int“*/ގŤ‘?úif–?ý(typ(n)“!=“t_INT)ގŤ‘I˙ôpari_err(typeer,‘?ý"rho");ގŤ‘?úx–?ý=“gen_2;ގŤ‘?úy–?ý=“stoi(5);ŽŽźŤ’Ü˙˛10ŽŽŚ‹ pĺ ŞŤ ýs oŤ ý´Ť‘?úÇwhile–?ý(gcmp1(gcdii(subii(y,“x),“n)))ޤ Ť‘?ú{ގŤ‘I˙ôx–?ý=“modii(addis(sqri(x),“1),“n);ގŤ‘I˙ôy–?ý=“modii(addis(sqri(y),“1),“n);ގŤ‘I˙ôy–?ý=“modii(addis(sqri(y),“1),“n);ގŤ‘?ú}ގŤ‘?úreturn–?ýgcdii(n,“subii(y,“x));ގŤ‘5}Ž©Ť‘D˛No•¸ăw,‘h´the›1ˇcoGde‘1 no“wusesthemoresp•Geci cfunctionsÎsqri˛,‘hłÎaddis˛,‘h´Îmo“dii˛andގŤ‘5Îgcdii˛.ގŤ‘DThe–eĽmost‘e»ecienš¸ăt“way›e»to“uset¸ăyping“isto“declaresome“v‘˙qÇariablesof“t¸ăypGeގŤ‘5Čsmal‘‚Řl˛.‘RXThis‘÷w•¸ăa“y‘˙*Ş,‘ ăthese–÷v‘˙qÇariables“will“bGe“implemenš¸ăted“by‘÷C‘öîÎlong‘“˛v‘˙qÇariables,‘ ăwhichގŤ‘5are–†faster›†than“P‘˙*ŞARI‘…öin¸ătegers“anddo“not“requiregarbage“collecting.‘ĎHo•¸ăw“ev“er,ގŤ‘5y¸ăou–ź/will›ź.not“bGeprotected“frominš¸ăteger“over ow.‘OTF‘˙*Şor‘ź.that“reason,‘ń¤Çgp2c“˛willގŤ‘5automatically–ö)declare›ö*some“loGop“indicesof“t¸ăypGeČsmal‘‚Řl‘ţ˛˛when“therange“cannotގŤ‘5cause›Ío•¸ăv“er o“w.‘­0Sometimes–ÎÇgp2c˛can“b•Geto“oconserv‘˙qÇativ•¸ăe‘Îbuty“oucan‘ÎforceaގŤ‘5lošGop–UUindex“to“be“Čsmal›‚Řl‘]޲with“the“syn¸ătax“Čfor(i:small=a,b,...)˛.Žźţ6ŤŤ‘5Ę3.6Ž‘SŔTš yp`es–€and“memb`er“functionsŽźuTŤ‘5˛F‘˙*Şor–UUuse“with“memš¸ăbGers“functions,“Çgp2c“˛provides“the“following“typGes:ަŤŤŤ‘5ĆnfŽŽ‘Cç˛for–UUordinary“n•¸ăum“bGer–UU elds,“i.e.,“a“result“givš¸ăen“by“the“GP“function“Čn nit˛.Ž©ŤŤŤ‘5ĆbnfŽŽ‘JJĄ˛for›Vhbig‘Vin•¸ăum“bGer elds,–V­i.e.,“a–Viresultgivš¸ăen“by–Vhthe“GP“function‘ViČbn nit‘I@˛whichގŤ‘Nincludes–UUclass“and“unit“group“data.ަŤŤŤ‘5ĆbnrŽŽ‘K‰˛for–UUraš¸ăy“class“groups,“i.e.,“a“result“given“by“the“GP“function“Čbnrinit˛.ަŤŤŤ‘5ĆellŽŽ‘E¨ŕ˛for–UUelliptic“curvš¸ăes,“i.e.,“a“result“given“by“the“GP“function“Čel‘‚Řlinit˛.ަŤŤŤ‘5ĆgalŽŽ‘Hݲfor–UUgalois“extensions,“i.e.,“a“result“givš¸ăen“by“the“GP“function“Čgaloisinit˛.ަŤŤŤ‘5ĆpridŽŽ‘NµO˛for›Ddprime–Deideals,‘GČi.e.,‘GÇa“compGonen¸ătof“theresult“giv•¸ăenb“ythe‘DeGP‘D`functionގŤ‘NČide–˙}'alprime“de“c˛.ŽźŤ‘DMemš¸ăbGers–UUfunctions“on“typGed“ob‘Ž8jects“are“much“more“ecient.Žź!ÄŤŤ‘5Ĺ4Ž‘MLËCommon‘ffproblemsŽźçŤŤ‘5Ę4.1Ž‘SŔMeta-commands.ŽźuTŤ‘5˛Meta-commands–ě(commands›ěstarting“witha“Ç\˛)other“thanÇ\r“˛arecurren¸ătlyގŤ‘5ignored–‡×bš¸ăy“Çgp2c˛,‘”wthough“a“warning“will“b•Ge›‡Öissued,‘”xb“ecause–‡×itis“not“clear“whatގŤ‘5they–µshould›µdo“in“acompiled“program.‘‘Instead“y¸ăouprobably“w•¸ăan“t–µtorun“theގŤ‘5meta-command–UUin“the“GP“session“itself.ގŤ‘DThe–Ş`meta-command›ŞaÇ\rČinclude‘j»˛is“replacedwith“thecon•¸ăten“t–Ş`of“the le“ČincludeގŤ‘5˛(or–ěxČinclude˛.gp)“when‘ěyÇgp2c“˛reads“the“ le.‘ 71If“yš¸ăou“would“prefer‘ěyÇgp2c“˛to“linkގŤ‘5Činclude˛.so–UUto“the“program“instead,“see“Section“2.4.ŽŽźŤ’Ü˙11ŽŽŚ‹ v> ŞŤ ýs oŤ ý´ŤŤ‘5Ę4.2Ž‘SŔUnsupp`orted‘€functions.ŽźuTŤ‘5˛The–cĽfunctions“Čfor›˙}'el‘‚Řl‘lE˛and“Čforsubgroup‘T˛are“currenš¸ătly“not“implemented“as“an“iter-ޤ Ť‘5ator–but“as›‚a“proGcedure“with“callbac•¸ăks,‘whic“h–limits“what“y¸ăou“cando“inside“theގŤ‘5loGop.ގŤ‘DSome– 2functions› 3are“passedto“GP‘ b¸ăy‘,ŔÇgp2c-run“˛atstart-up“(usingthe“ÎGP;ގŤ‘5˛syn¸ătax)–iăinstead›iäof“bGeingtranslated“inC:“Činstal‘‚Řl‘rm˛and“Čaddhelp˛.‘ŻrInpractice,‘otheyގŤ‘5can–UUbšGe“considered“as“supported.ގŤ‘DSome–ćfunctions“are“built-in“in“GP‘˙*Ş,“and“so“are“not“a¸ăv‘˙qÇailable“to“libpari“pro-ގŤ‘5grams.‘9ĂSo–íSif›íTy¸ăou“usethem“Çgp2c˛generate“aprogram“thatneeds“torun“underގŤ‘5GP‘˙*Ş,–9ňor›9ńwith“Çgp2c-run˛.‘h¦Sincethe“C‘9ęprotot¸ăypGe“for“thosefunctions“arenot“a¸ăv‘˙qÇail-ގŤ‘5able,‘)the–ţ°C‘ţ…compiler“will“output“a“wš¸ăarning.‘mŮThis“serves“as“a‘ţ±reminder“of“theގŤ‘5problem.‘ÍThey–…­are›…¬all“theplotting“functionsandČal‘‚Řlo–˙}'c“atemem,–Ëdefault,“extern,ގŤ‘5input,–“çquit,“r–˙}'e“ad,–“çsystem,“whatnow˛.ގŤ‘DSome–Ý·GP›Ý™functions“are“not“a¸ăv‘˙qÇailable“for“Cprograms,‘ő¤so“the“compiler“cannotގŤ‘5handle–ĺęthem.‘#…If“yš¸ăou“use“them“you“will“get“the‘ĺéinfamous“"unhandled“letter“inގŤ‘5prototš¸ăypGe"–UUerror.‘qÇSorry“for“the“inconvenience.‘qÇThese“are“Čplot,–“çploth,“plotr–˙}'e“cth˛.ގŤ‘DAlso–ăithe›ăjfunctions“Čr–˙}'e“ad,‘@eval,‘@kil‘‚Řl‘ëó˛ma¸ăy–ăicompile ne“butha•¸ăv“e–ăiasurprising“bGe-ގŤ‘5ha¸ăviour–Ein›Fsome“case,‘âbGecause“theyma¸ăy“moGdify“thestate“of“theGP‘0in¸ăterpreter,ގŤ‘5not–đáof“the›đŕcompiled“program.‘DjPlease“see“Section“4.3for“details.‘DjF‘˙*Şor“exampleގŤ‘5Çf(n)=eval("n^2")–UU˛is“vš¸ăery“di erent“from“Çf(n)=n^2˛.ގŤ‘DThe–ŠżČforstep‘,X˛function“is›ŠŔsuppGorted“when“thestep“isa“n•¸ăum“bGer.‘.@Ifit–Šżisa“v¸ăector,ގŤ‘5y•¸ăou›UUm“ustaddatagČ:ve‘˙}'c‘ć ˛tomak“eGPkno“wabGoutitlik“einŽ©”ĚŤ‘5Çf(x)=ގŤ‘5{ގŤ‘?úlocal(v);ގŤ‘?úv=[2,4,6,6,6,6,6,2,4,6,6]ގŤ‘?úforstep(y=7,x,v:vec,print(y))ގŤ‘5}ަŤ‘D˛This–×is“not“needed›Řif“the“step“is“a“v¸ăectoror“a“v‘˙qÇariable“of“tš¸ăypGe“vec,‘Eřbut“isގŤ‘5needed–UUif“the“step“is“only“an“expression“whicš¸ăh“ev‘˙qÇaluates“to“a“vector.ގŤ‘DThere–Ú~is›Ú}little“that“canbGe“doneabGout“these“problemswithout“c¸ăhangingގŤ‘5P‘˙*ŞARI/GP‘UUitself.ŽźëŔŤŤ‘5Ę4.3Ž‘SŔMemory–€handling“and“global“v‘˙@ariables.ŽźuTŤ‘5˛While–3Ka“lot“of“w¸ăork“has“bGeen“done“to“ensure“that“Çgp2c“˛handles“global“v‘˙qÇariablesގŤ‘5propGerly‘˙*Ş,‘‚the–Śuse›Ťof“globalv‘˙qÇariables“isstill“alotof“trouble,‘‚so“tryto“a•¸ăv“oidthemގŤ‘5if–UUy¸ăou“do“not“understand“the“implications“on“memory“handling.ގŤ‘DFirst,‘Ýthere–˙żis“a›˙ľcommon“practice“to“use“undeclared“v‘˙qÇariablesas“formal“v‘˙qÇari-ގŤ‘5ables,‘ůgfor–âlexample“w¸ăe“assume“Čx='x‘°˛and“write“Ča*x+b‘„˛instead“of“Ča*'x+b˛.‘KySo“Çgp2cގŤ‘5˛will–݆not“raise›݇an“undeclared“v‘˙qÇariable“tothe“rank“of“globalv‘˙qÇariable“unless“y¸ăouގŤ‘5declare–*Ňit›*Ówith“the“Čglob‘˙}'al()‘‰f˛command,‘3Sor“y¸ăouuse“it“attoplevš¸ăel“(i.e.‘cśoutside“anyގŤ‘5function).‘qÇSee–UUalso“Section“2.3ގŤ‘DSecond,‘‹Kglobal–MMv‘˙qÇariables›MNseen“b¸ăy“acompiled“function“areC‘M v‘˙qÇariables,‘‹KnotގŤ‘5GP‘@âv‘˙qÇariables.‘jřThere–@čis›@çno“connectionbGet•¸ăw“een‘@čthet“w“o.‘jřY‘˙*Şou‘@čma“yw“ell‘@čha“v“et“w“oގŤ‘5v‘˙qÇariables–łĂwith›łÄthe“samename“anda“di erenš¸ăt“content.‘;íCurrently“GP‘ł›knows“onlyގŤ‘5hoš¸ăw–Möto“install“functions,‘Opnot“v‘˙qÇariables,‘Ooso“you‘M÷need“to“write“compiled“functionsގŤ‘5in–UUorder“to“access“global“v‘˙qÇariables“under“GP‘˙*Ş.ŽŽźŤ’Ü˙12ŽŽŚ‹ š ŞŤ ýs oŤ ý´Ť‘D˛Basically‘˙*Ş,‘]global–óŢv‘˙qÇariables›óßare“alloGcatedin“themain“stac•¸ăkwhic“h‘óŢisdestro“y“edޤ Ť‘5eac•¸ăh› 9time‘ :GP‘ prin“tsanewprompt.‘–tThismeans‘ :y“oum“ustputall‘ :y“ourcom-ގŤ‘5mands–{on“the›zsame“line.‘đ9Alsoglobal“v‘˙qÇariables“m¸ăust“bGeinitialized“using“theގŤ‘5ČinitŤ‘ť‰ffŽ‘®Ç–ăć˛function“b•Gefore›ăĺb“eing–ăćused,‘ú–and“are“only“suppGortedwith“the“-gގŤ‘5 ag.ގŤ‘DSo–UUy¸ăou“end“up“doing“Ćgp2c-run–ŐT-g“global.gpŽ©âÝŤ‘5Çparisize–?ý=“4000000,“primelimit“=“500000ގŤ‘5?‘?ýinit_global();myfunction(args);ŽźâÜŤ‘D˛Note–TŇthat‘TÓnothing“prev•¸ăen“ts›TŇy“oufrom–TÓcallingČinitŤ‘ť‰ffŽ‘®glob‘˙}'al‘][˛in“theGPprogram.ގŤ‘5In–Euthat›Etcase,‘{Őy¸ăou“can“omitthe“paren¸ătheses“(i.e,–{ŐwriteČinitŤ‘ť‰ffŽ›®glob‘˙}'al˛,“not‘EuČinitŤ‘ť‰ffŽglob‘˙}'al()^“˛)ގŤ‘5so–UUthat“yš¸ăou“can“still“run“your“noncompiled“program.ގŤ‘DAnother›ň’w•¸ăa“y–ň‘tohandle“globalv‘˙qÇariables“isto“usethe“Čclone‘˛í˛function“whic¸ăhގŤ‘5copies›Dđa–DďP‘˙*ŞARI‘Děob‘Ž8ject“tothe“heap,‘H8hence“a•¸ăv“oidsits‘DďdestructionwhenGP‘Dëprin“tsގŤ‘5a–Inew“prompt.›mµY‘˙*Şou“can“use“Čunclone‘ x˛to“free“a“clone.Please“read“the“P‘˙*ŞARI/GPގŤ‘5man¸ăual–UUfor“more“information“abGout“Čclone˛.ގŤ‘DA‘“”go•Go“d–“ćuse“of“Čclone‘TA˛is“for“initializing‘“çconstan¸ăt“v‘˙qÇariables:‘îéfor“example“inގŤ‘5Çtest/gp/initfunc.gp˛,–UUthe“vš¸ăector“ČT‘©ó˛is“initialized“byަŤ‘5ÇT=clone([4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0])ަŤ‘5˛Y›˙*Şou–)m¸ăust“still‘)run“the“ČinitŤ‘ť‰ffŽ‘®Ç“˛after“starting“GP,‘)but“after“that“y¸ăouގŤ‘5can–UUuse“ČT‘©ó˛safely‘˙*Ş.ގŤ‘DGP‘í'itself–íAcurrenš¸ătly“doGes“not“know“abGout“Čclone‘­ś˛and“Čunclone˛,‘but“you“can“useގŤ‘5dumm¸ăy‘UUfunctionsަŤ‘5Çclone(x)=xގŤ‘5unclone(x)=while(0,)ŽźâÜŤ‘5˛when–UUrunning“uncompiled.Žź÷ńŤŤ‘5Ę4.4Ž‘SŔGP‘€listsŽ©uTŤ‘5˛GP›ňŃlists–ňúare“not‘ňůfully“suppGorted“b¸ăy“Çgp2c˛.‘JµApartial“suppGort‘ňůis“a¸ăv‘˙qÇailable“withގŤ‘5the›#ÓČlist‘Ş˛t•¸ăypGe.‘Ý@Y‘˙*Şou‘#Ňm“usttell–#ŇÇgp2c˛that“av‘˙qÇariable“willcon¸ătain“alist“b¸ăyusingގŤ‘5ČL:list‘ă˛inside–Ź a“declaration,‘ťxwhere“ČL‘Žü˛is“the“name“of“the“v‘˙qÇariable“as“explained“inގŤ‘5Section‘UU3.ގŤ‘DCurren¸ătly‘˙*Ş,‘üAassigning–ÚŢto›Úßa“listelemen¸ăt(ČL[2]=x‘4D˛)“willnot“w¸ăorkand“listswillގŤ‘5not–UUbGe“freed“unless“y¸ăou“explicitly“use“Člistkil‘‚Řl˛.ގŤ‘DNote:‘q'The–TP‘˙*ŞARI›Tuser's“man¸ăual“statesthat“listsare“useless“inlibrary“moGde.Žź÷đŤŤ‘5Ę4.5Ž‘SŔThe‘€ó&F C– cmbxti10Ńinstal‘´çl‘Í©ĘcommandަŤ‘5˛The–ůSČinstal‘‚Řl‘ܲcommand“is“inš¸ăterpreted“as“a‘ůRÇgp2c“˛directive.‘ ]ÁThis“allows“usingގŤ‘5installed–UUfunction“in“compiled“programs,“see“Section“2.4.ގŤ‘DHo•¸ăw“ev“er–UUthis“has“some“side-e ects:ŽźâÝŤŤŤŤ‘D¸ŽŽŽ‘N˛If›ńípresen•¸ăt,‘Ythe‘ńěČlib‘“…˛argumen“tm“ustbGe–ńěastring,‘Ynotan“expressionthatގŤ‘Nev‘˙qÇaluate–UUto“a“string.ŽźńnŤŤŤŤ‘D¸ŽŽŽ‘N˛The–6Činstal‘‚Řl‘> ˛command“is“not“compiled,‘nGinstead“it“is“added“to“the“list“ofގŤ‘Nfunctions–UUto“install.ŽŽźŤ’Ü˙13ŽŽŚ‹Ă ŞŤ ýs oŤ ý´ŤŤ‘5Ĺ5Ž‘MLËCommand-line–ffoptions“of“Égp2cŽźçŤ‘5˛Here–D‚is›Da“briefdescription“ofthe“mainoptions“of‘ źÇgp2c˛,‘Gŕwhic¸ăhcan“bGeseen“withޤ Ť‘5Ç./gp2c‘?ý-h˛.ގŤ‘DIn–UUSection“2.1“wš¸ăe“saw“how“to“use“the“Ç-g“˛option.Ž©ŤŤŤŤ‘D¸ŽŽŽ‘N˛-g–o›tells“Çgp2c›oś˛to“generate“Îgerepile“˛calls“toclean“up“the“P‘˙*ŞARI‘oSstac¸ăk“andގŤ‘Nreduce–ążmemory›ąľusage.‘źY‘˙*Şou“willprobably“need“thisoption,‘ŇŮalthough“theގŤ‘NC–UUcošGde“will“be“easier“to“read“or“hand-edit“without“it.ަŤŤŤŤ‘D¸ŽŽŽ‘N˛-oČ le‘̲tells–RpÇgp2c›Rq˛to“writethe“generatedC“ leto“the le“Č le‘̲instead“oftheގŤ‘Nstandard‘UUoutput.ަŤŤŤŤ‘D¸ŽŽŽ‘N˛-iN‘ţPallo•¸ăws›ţgy“ou‘ţftoc“hange‘ţftheinden“tation–ţfofthe“generatedC‘ţP le.‘TÍSoif“y¸ăouގŤ‘Nw•¸ăan“t–UU4“spaces,“just“use“the“Ç-i4“˛option“with“Çgp2c˛.‘qÇThe“default“is“2.ަŤŤŤŤ‘D¸ŽŽŽ‘N˛-W‘(™is–(¤useful“for“debugging“the›(Ą.gp“ le,‘1”in“the“sense“thatit“detects“if“someގŤ‘NloGcal–‹v‘˙qÇariable›‹is“undeclared.‘ÉF‘˙*Şor“example,‘kif“the le“Çalgorithm.gp˛has“aގŤ‘Nroutine‘UUlik¸ăeޤŤ‘NÇradical(x)=F=factor(x)[,1];prod(i=1,length(F),F[i])ގŤ‘N˛The–'‡v‘˙qÇariable“'F'‘'|is“undeclared“in“this“routine,‘0±so“when“running‘KÇgp2c“˛withޤ Ť‘Nthe–UUÇ-W“˛option“it“prin¸ătsަŤŤŤŤ‘D¸ŽŽŽ‘N˛-C‘ئadds‘ŘÉcošGde–ŘČto“perform“range“c•¸ăhec“king–ŘÉfor›ŘČGP‘ئconstructs“lik¸ăeČx[a]‘ćK˛andގŤ‘NČx[a,b]˛.‘öčThis›¶also‘µc•¸ăhec“kswhether–µČx‘µú˛has“the“correctt¸ăypGe.‘öčBydefault“Çgp2cގŤ‘N˛do•Ges›Č×not‘ČŘp“erformsuc•¸ăhc“hec“k,‘%¸whic“hcanlead‘ČŘtoarun“time‘ČŘcrashwithގŤ‘Nin¸ăv‘˙qÇalid–÷ÜcoGde.‘Y]This›÷Ýoption“causesa“small“run•¸ătimepGenalt“y–÷Üand“alarge“CގŤ‘NcošGde–UUreadabilit¸ăy“penalt¸ăy‘˙*Ş.ޤŤ‘NĆW‘˙ «arning:algorithm.gp:1:v‘˙\rariable–ŐTundeclared“FގŤ‘N˛A•¸ăt› Épresen“t,‘łĄanundeclaredv‘˙qÇariable‘ Čistak“ento– ČbGea"formal“v‘˙qÇariable"forޤ Ť‘NpGolynomials–Ţ.b¸ăy‘»Çgp2c˛,‘@dso“do›Ţ/not“declare“it“if“that“iswhat“yš¸ăou“intend.ގŤ‘NF‘˙*Şor–zexample›{in“Çpol(a,b,c)=a*x^2+b*x+c˛yš¸ăou“must›{not“declareČx‘4ľ˛sinceitގŤ‘Nstands–UUfor“the“formal“v‘˙qÇariable“Č'x˛.ަŤŤŤŤ‘D¸ŽŽŽ‘N˛-pČpr‘˙}'e x‘Ý­˛A‘©Sproblem–©iwith“C‘©Tis‘©hthat“it“is“sub‘Ž8ject“to“name“clashes,–ľni.e.,“if‘©iaގŤ‘NGP‘&v‘˙qÇariable–&)in›&(y¸ăour“routinehasthe“samename“asaC‘&sym¸ăbGolin“thepariގŤ‘Nlibrary‘˙*Ş,‘ĄHthe–bcompiler“will›brepGort“strangeerrors.‘So“thisoption“c¸ăhangesގŤ‘NALL‘Âuser–îv‘˙qÇariables›ďand“user“routinenames“b¸ăyadding“a“pre xČpr‘˙}'e x‘62˛toގŤ‘Nthem.‘n gp2c types and the description system

gp2c types and the description system

By Bill Allombert

Contents

1  gp2c types

1.1  Introduction

The main feature GP2C adds above GP is the use of types. Types give a semantic to PARI objects, so that GP2C can generate code that use specialized (hence faster) PARI functions instead of generic ones. Please read the section ’Advanced use of GP2C’ in the GP2C manual for how to use the GP2C types and examples.

Such types are used in conjunctions with so-called descriptions which are stored in the field ’Description:’ of the file pari.desc and provide the actual C code to use depending of the types of the arguments. They are described in Section 2.

Abstractly, a GP2C type is a set of pairs (A,B) where A is a mathematical object and B its computer representation. Two different types can contain the same mathematical object, with a different computer representation. For example the type bool is the set {(true,1L), (false,0L)}, i.e. true and false with true coded by the C-long integer 1 and false coded by the C-long integer 0; the type negbool is the set {(true,0L), (false,1L)} which is the same set of mathematical objects, but now true is coded by the C-long integer 0 and false by the C-long integer 1.

For each GP2C type, there exists a C type Ct such that for all pairs (A,B) belonging to the type, the C type of B is Ct. This C type is specified by the description _typedef.

The GP2C types are preordered. Abstractly, we say that t1t2 if and only if there is a map f such that (A,B)↦ (A,f(B)) defines a one-to-one mapping from t1 to t2. Practically we restrict the relation ≺ to make it a partial order such that any two types have an upper bound. This partial order is defined by the chains in the description _type_preorder. It can be printed by running gp2c -t.


Figure 1: Example of type preorder

The process of converting a mathematical object from one type to another is called casting. The casting methods known to GP2C are given by the _cast description.

1.2  List of types

In this section, we list the types known to PARI/GP. The current list is available in the description _typedef.

1.2.1  Basic types

small
Small integers represented by C long integers.
int
Multi-precision integers represented by t_INT GENs.
real
Multi-precision floating point real numbers represented by t_REAL GENs.
mp
Multi-precision numbers. Union of the types int and real.
vecsmall
Vectors of small integers represented by t_VECSMALL GENs.
vec
Vectors and matrices of PARI objects, represented by t_VEC, t_COL or t_MAT GENs.
var
Polynomial variables represented by their variable number which is a C long integer. This is associated to the prototype code ’n’.
pol
Polynomials represented by t_POL GENs.
genstr
Strings represented by t_STR GENs.
list
GP lists represented by t_LIST GENs.
gen
Generic PARI objects represented by GENs.

1.2.2  Special types

void
This type is a set with only one element called void. This is the return type of functions not returning anything. GP allows to cast it to 0.
bool
Boolean values represented as C long integers, where 1 is true and 0 is false.
negbool
Negated boolean values represented as C long integers, where 0 is true and 1 is false.
lg
Vector lengths represented by the lg macro output, i.e. a C long integer equal to the actual length plus one.
str
C strings represented by C const char * strings.
typ
GEN types represented by C long integers, as returned by the typ() macro.

1.2.3  Internal types

The following types are mainly for internal use inside GP2C.

empty
This type is the empty set. No individual object can be of this type but a set of objects can. In fact this is a default type for an unspecified set of objects.
small_int
Small integers represented by C int integers. This is only available for compatibility with PARI function returning int (instead of long).
bptr
Byte pointer. This is used for the primepointer global variable.
func_GG
function with protype GEN f(GEN,GEN). Used by forvec.
pari_sp
This is the stack pointer type pari_sp.

1.2.4  Types for data structure.

These types are mainly defined to allow the use of inline member functions.

nf
Number field as returned by nfinit.
bnf
Big number field as returned by bnfinit.
bnr
Ray class field as returned by bnrinit.
ell
Elliptic curve as returned by ellinit.
bell
Big elliptic curve as returned by ellinit.
clgp
Class group as returned by the ’clgp’ member function.
prid
Prime ideal as returned by idealprimedec.
gal
Galois group as returned by galoisinit.

1.3  C-Type

A C-Type is just a level of indirection toward real C types. C-types are defined by the descriptions _decl_base and _decl_ext. Each type belongs to a C-type as specified by the description _typedef.

2  The description system

2.1  Introduction

The description system is a way to describe the PARI application programming interface in a way understandable by both the GP2C compiler and human beings. The present document is mostly addressed to this second category. We start by a simple example:

The description of the GP function sqr is

 (int):int      sqri($1)
 (mp):mp        gsqr($1)
 (gen):gen      gsqr($1)

Each line is called a rule, which in this case consists of three parts. Let us consider the first one: the parts (int), :int and sqri($1) are respectively called the pattern, type, and action part.

When GP2C compiles sqr(1), it computes the types of the arguments (here 1 is of type small) and matches them against the patterns from top to bottom. The “best” rule is used; in case of a tie, the topmost rule wins. Here, all three rules apply, and the first rule wins. Since the type of this rule is int, GP2C sets the type of the expression sqr(1) to int. The action part is sqri($1), so GP2C generates the C code sqri($1) where $1 is replaced by the code of the argument 1 cast to the pattern type (int). The result is the C code sqri(gen_1).

Now a more complex example: the description of the GP function exp is

 (real):real    mpexp($1)
 (mp):mp:prec   gexp($1, prec)
 (gen):gen:prec gexp($1, prec)

When GP2C compiles exp(1), it looks for the "best" rules. The first rule cannot be used, because there is no way to cast a small to a real, so it uses the second rule. This time the result will be of type mp. The extra part :prec is called a mode. The mode ‘prec’ states that the action part will use the special ‘prec’ variable that holds the current real precision. This is obvious from the action part code, but GP2C do not parse the action part so it needs this mode. Note that the last rule is also valid and has the same action part so would generate the exact same code. However, the type of the expression would be less precise.

The description of the GP function matdet is

 (gen, ?0):gen      det($1)
 (gen, 1):gen       det2($1)
 (gen, #small):gen  $"incorrect flag in matdet"
 (gen, small):gen   det0($1, $2)

We see several new pattern atoms:

  • 1 matches a literal 1, e.g. matdet(M,1) would match the second rule.
  • ?0 matches an optional literal 0: matdet(M), matdet(M,0) and matdet(M,) all match the first rule.
  • #small matches an unspecified literal small.

Finally, we also see a new action $"…", which causes GP2C to display the error message and abort.

2.2  Definitions

We now give a formal definition of descriptions.

2.2.1  Description

A description is a line-separated list of rules.

2.2.2  Rule

A rule is a line of the form

(pattern):type:modelist action

Only the pattern part is mandatory, though most rules also include an action and a type.

2.2.3  Pattern

A pattern is a comma-separated list of pattern atoms.

2.2.4  Type

The type of a rule is a standard GP2C type.

2.2.5  Modelist

A modelist is a colon-separated list of modes.

2.2.6  Action

An action is a string (normally a piece of C code) that can include replacement strings. Replacement strings start by a $ and are substituted according to the replacement rules.

2.3  Pattern atom

A pattern atom is one of the following, where type is any GP2C type, n any small integer, "str" any character string and ctype any C-type. A pattern atom can match an object.

  • type. This matches any object of type comparable to type.
  • n. This matches a constant small integer value equal to n.
  • ?n. This matches an optional small value which defaults to n.
  • ?type. This matches an optional type value with standard default value.
  • "str". This matches a constant character string equal to str.
  • &type. This matches a reference (the GP &x construction) to an object of type equal or less than type referencing the same data type.
  • nothing. This matches a missing argument.
  • #type. This matches a constant value of type type.
  • ... This matches any number of arguments matching the previous atom. This must be the last atom of the pattern. This allows to implement functions taking an unlimited number of arguments.
  • C!ctype. This matches any object of C-type ctype.
  • @type. This matches a variable of type type. This is mainly used for expressions that evaluate their arguments several times.
  • *type. This matches an lvalue of type type. This is used in constructions that modify their arguments.

2.4  Matching

The best rule is determined as follows:

  1. The result of matching a pattern atom against some GP code is either ’reject’ or ’match’.
  2. There are three matching levels: ’partial’, ’normal’ and ’perfect’.
  3. A pattern matches if all the atoms match.
  4. A rule matches if its pattern matches.
  5. The best rule is the matching rule with the higher number of normal and perfect matches. In case of a tie, the highest number of perfect matches wins. If there is still a tie, the topmost rule wins.

When matching the pattern atoms type and ?type, the matching level is determined as follows:

  • a perfect match occurs when the type of the object is exactly type,
  • a normal match when the type is less than type,
  • a partial match when the type is bigger than type.
  • Rejection happens when the types are uncomparable.

Other pattern atoms always result in a reject or a perfect match.

2.5  Mode

Modes are used in descriptions to give more information to GP2C about the action part. They are usually useless to human beings that are smart enough to understand the action part. The current list of modes is:

prec
The action uses the prec variable.
parens
The action does not have top precedence. GP2C will put it between parentheses when needed (see $())
copy
The action returns data that access memory belonging to other objects. GP2C will generate calls to gcopy() when needed.

2.6  Lists of replacement strings

The following special sequences can occur in the action part:

  • $n. This is replaced by the n-th argument of the function.
  • $(n). This is replaced by the n-th argument of the function between parenthesis if it has the parens mode.
  • $type:n. This is replaced by the n-th argument of the function cast to type type.
  • $(type:n). Combination of $(n) and $type:n.
  • $%n. This is replaced by the n-th argument of the function, which must be a constant string, with all % characters doubled and no quotes. This is for use inside format specification.
  • $"message". Signals an invalid condition. GP2C will abort by printing the error message message.
  • ${RPN sequence} The RPN sequence is a space separated list of RPN commands that will be evaluated by the GP2C internal RPN evaluator. If the stack is empty at the end of the evaluation, this is replaced by the empty string, else this is replaced by the integer at the top of the stack. Some RPN commands generate text, in that case it is pasted just before the $ sign.

2.7  Lists of RPN commands

The commands are evaluated with respect to a stack of integer values, initially empty. The exact list of command supported by a particular GP2C version is the %accepted_command hash in the script scripts/822_desc.pl.in.

literal integer
push the integer at the top of the stack.
:type
push the type type at the top of the stack.
add, sub, mul, div, mod
2-ary arithmetic operators
neg
1-ary arithmetic operator
and, or, xor
2-ary logical operators
not
1-ary logical operator
type
pop an integer n and push the type of the n-th argument.
value
pop an integer n and push the value of the n-th argument, provided it is a constant integer.
code
pop an integer n and generate the C code for the n-th argument.
cast
pop an integer n and a type t and generate the C code for the n-th argument cast to type t.
parens
this is a flag requesting code and cast to enclose the C code between parenthesis if the argument has the parens mode.
str_format, str_raw
pop an integer n such that the n-th argument is a constant string and display the string without leading and ending ". Furthermore str_format will display the string in a way suitable for inclusion in a format string by quoting meta-characters.

The following RPN commands are useful with the ... pattern atom to implement functions that take an unlimited number of arguments.

nbarg
push the actual number of arguments of the function.
format_string, format_args
pop an integer n such that the n-th argument corresponds to a ... pattern atom and generate a format string and a list of arguments, see the description of the GP function print.
code, cast
If the integer n corresponds to a ... pattern atom, generate a comma-separated list of C code for the arguments n−1, n, n+1, …, nbarg, by matching each argument against the n−1 pattern atom.
stdref
this is a flag requesting code and type to prepend a ’&’ before each arguments.

The following RPN commands are useful to implement functions that take closures as arguments.

wrapper, cookie
pop an integer n and generate a call to the wrapper (resp. the cookie associated to the wrapper) for the n-th argument. The wrapper generated depends on the wrapper prototype in the Wrapper field. The cookie is the list of local variables seen by the closure.

This document was translated from LATEX by HEVEA.
gp2c-0.0.8/doc/gp2c.10000644000175000017500000000400012156115130010742 00000000000000.TH GP2C "1" "January 2005" "GP to C compiler" PARI .SH NAME GP2C \- The GP to C compiler .SH DESCRIPTION gp2c [-ghfltvydWSTGV] [-i N] [-o ] [-p ] [file.gp] gp2c is a program that translate GP code to C code that use the libpari library. It tries to generate code looking like the PARI source code. .SS "user option:" .HP \fB\-o\fR : Place output in file . .HP \fB\-g\fR : Generate automatic garbage collection code. .HP \fB\-iN\fR: Set indentation level to N spaces (default 2). .HP \fB\-W\fR : Output information about global variables. .HP \fB\-C\fR : Generate range checking code. .HP \fB\-p\fR : Prefix user-defined symbol by to avoid conflict. .HP \fB\-s\fR : Add suffix to GP install names of functions. .HP \fB\-S\fR: Assume strict declarations for functions. .SS "query options:" .HP \fB\-h\fR : This help. .HP \fB\-f\fR : Dump information about functions to stderr. .HP \fB\-l\fR : Output the list of functions known to the compiler. .HP \fB\-t\fR : Output the table of types known to the compiler. .HP \fB\-v\fR : Output version information and exit. .SS "debugging options:" .HP \fB\-d\fR : Increase debugging level. .HP \fB\-y\fR : Switch parser to debug mode. .HP \fB\-T\fR : Output syntactic tree in treetool format. .HP \fB\-TT\fR : Output syntactic tree in VCG/GRL format. .HP \fB\-G\fR : Generate GP code in place of C code. Don't smile. .HP \fB\-V\fR : Do not clean up variables. .PP file.gp: file to be processed, default to stdin. The generated C code is output to stdout unless option \fB\-o\fR is used. See the script \fIgp2c-run\fR for an automated compilation process. .SH "COPYING" Copyright 2000-2013 The PARI Group .PP GP2C is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. There is absolutely no warranty for GP2C. .SH "AUTHOR" Bill Allombert .SH "SEE ALSO" .IR gp2c-run(1), .IR gp2c-dbg(1), .IR gp(1), .IR gcc(1) gp2c-0.0.8/doc/gp2c.tex0000644000175000017500000010203712155572710011425 00000000000000\documentclass[a4paper]{article} \usepackage[latin1]{inputenc} %I want this document to compile if latex2html is not installed \usepackage{ifthen} \ifthenelse{\boolean{true}}{% %Currently this is always true, but see below. \newcommand{\link}[2]{#1} \newcommand{\gpcc}{{\tt gp2c}} %HEVEA \renewcommand{\link}[2]{\ahref{#2}{#1}} }{% %If we use latex2html, we must set the boolean to false so that this branch is %used. However current latex2html version does not know about ifthen and so %just read *both* branch so it is *not* necessary. \usepackage{html} \newcommand{\link}[2]{\htmladdnormallink{#1}{#2}} \newcommand{\gpcc}{gp2c} } %Use \gpcc only for large fonts.(titles, sections) \newcommand{\pathlink}[1]{\link{\path{#1}}{#1}} \newcommand{\path}[1]{\texttt{#1}} \newcommand{\gp}[1]{\textit{#1}} \newcommand{\pari}[1]{\textsf{#1}} \newcommand{\cmd}[1]{{\noindent\bf #1}} \title{An introduction to \gpcc} \author{By Bill Allombert and Ariel Pacetti} \begin{document} \maketitle \tableofcontents \section{What is \gpcc ?} The \path{gp2c} compiler is a package for translating GP routines into the C programming language, so that they can be compiled and used with the \link{PARI}{http://pari.math.u-bordeaux.fr} system or the GP calculator. The main advantage of doing this is to speed up computations and to include your own routines within the preexisting GP ones. It may also find bugs in GP scripts. This package (including the latest versions) can be obtained at the URL:\\ \pathlink{http://pari.math.u-bordeaux.fr/download.html\#gp2c} \subsection{Installing \gpcc} After downloading the file \path{gp2c-\emph{x.y.z}pl\emph{t}.tar.gz} (where \emph{x,y,z} and \emph{t} depend on the version), you first have to unzip the file with the command: \cmd{gunzip gp2c-\emph{x.y.z}pl\emph{t}.tar.gz} This will create the new file \path{gp2c-\emph{x.y.z}pl\emph{t}.tar}. Next you have to extract the files with the \cmd{tar} program: \cmd{tar -xvf gp2c-\emph{x.y.z}pl\emph{t}.tar} Note: You can do both steps at once with GNU \cmd{tar} by using the command: \cmd{tar -zxvf gp2c-\emph{x.y.z}pl\emph{t}.tar.gz} This creates a directory \path{gp2c-\emph{x.y.z}pl\emph{t}}, which contains the main \gpcc\ files. Now you have to install the program. You need the file \path{pari.cfg}. This file can be found in the PARI object directory and is installed in \$prefix/lib/pari/. Copy or link this file in the \path{gp2c} directory, be sure to call it \path{pari.cfg}. \cmd{ln -s .../lib/pari/pari.cfg pari.cfg} Run \cmd{./configure}, which will search for the PARI version and some other configuration tools of the system. To install the program, type \cmd{make}, and the program will be compiled. You can then run \cmd{make check} to verify that everything has gone fine (a bunch of OK's should show up). All of this is completely standard, and you are now ready to use \gpcc. You can use \path{gp2c} directly from this directory or you can install it by running \cmd{make install} as root. If you do not install it, you can run it from the \path{gp2c} directory by typing \cmd{./gp2c} \section{A \gpcc\ tutorial} \subsection{How can I compile and run my scripts?}\label{compile_and_run} The simplest way to use \path{gp2c} is to call \path{gp2c-run}. If you want to know what happens in detail, see next section. To make the examples easier to follow, please move to the \path{gp2c} directory and link the root of your PARI source there: \cmd{ln -s .../pari .} As an example, we will take the file \path{pari/examples/squfof.gp}, which is a simple implementation of the well-known SQUFOF factoring method of D.~Shanks. We just run the command: \cmd{./gp2c-run pari/examples/squfof.gp} After a little processing we get a GP session. But this session is special, because it contains the compiled \gp{squfof} function. Hence we can do the following: \begin{verbatim} parisize = 4000000, primelimit = 500000 ? squfof(3097180303181) [419] i = 596 Qfb(133225, 1719841, -261451, 0.E-28) %1 = 1691693 \end{verbatim} Let's try a bigger example: \begin{verbatim} ? squfof(122294051504814979) [20137] *** the PARI stack overflows ! current stack size: 4.0 Mbytes [hint] you can increase GP stack with allocatemem() ? allocatemem() *** Warning: doubling stack size; new stack = 8.0 MBytes. ? squfof(122294051504814979) [20137] [20137, 3445] i = 46474 Qfb(321233929, 131349818, -367273962, 0.E-28) %2 = 73823023 \end{verbatim} We need a large stack because by default \path{gp2c} does not generate code to handle the stack (the so-called \pari{gerepile} code). To instruct \path{gp2c} to add \path{gerepile} code automatically, we must use the \cmd{-g} option. So quit this GP session and launch a new one with -g. Oh well, before that type \cmd{ls pari/examples/squfof.gp*} \begin{verbatim} pari/examples/squfof.gp pari/examples/squfof.gp.run pari/examples/squfof.gp.c pari/examples/squfof.gp.so pari/examples/squfof.gp.o \end{verbatim} These are the files generated by \path{gp2c-run}: \begin{itemize} \item pari/examples/squfof.gp.c is the C file generated by \path{gp2c}. \item pari/examples/squfof.gp.o is the object file generated by the C compiler. \item pari/examples/squfof.gp.so is the shared library generated by the linker. \item pari/examples/squfof.gp.run is a file that contains the commands needed to load the compiled functions inside GP. \end{itemize} It is the shared library which is used by GP. Now let's continue: \cmd{./gp2c-run -g pari/examples/squfof.gp} \begin{verbatim} parisize = 4000000, primelimit = 500000 ? squfof(122294051504814979) [20137] [20137, 3445] i = 46474 Qfb(321233929, 131349818, -367273962, 0.E-28) %1 = 73823023 \end{verbatim} This time it works with no difficulty using the default stack. We would like to know how much faster the compiled code runs, so we need to load the non compiled \gp{squfof} file in GP: \begin{verbatim} ? \r pari/examples/squfof.gp *** unexpected character: squfof(n)=if(isprime(n),retur ^-------------------- \end{verbatim} Why?? Because \gp{squfof} already exists as an installed function and GP refuses to overwrite it. To solve this problem, we will add a suffix to the name of the compiled function under GP. Quit the session and type: \cmd{./gp2c-run -g -s\_c pari/examples/squfof.gp} Now the function squfof is named squfof\_c instead, so we can do \begin{verbatim} parisize = 4000000, primelimit = 500000 ? \r pari/examples/squfof.gp ? # timer = 1 (on) ? squfof(122294051504814979) [20137] [20137, 3445] i = 46474 Qfb(321233929, 131349818, -367273962, 0.E-28) time = 5,810 ms. %1 = 73823023 ? squfof_c(122294051504814979) [20137] [20137, 3445] i = 46474 Qfb(321233929, 131349818, -367273962, 0.E-28) time = 560 ms. %2 = 73823023 \end{verbatim} So the compiled version is more than ten times faster than the noncompiled one. However for more complex examples, compiled code usually runs only three times faster on average. An extra trick: once you have run \path{gp2c-run} on your script, it is compiled and you can use the compiled version outside \path{gp2c-run} in any GP session by loading the file with extension \path{.gp.run}. For example quit the \path{gp2c-run} session and start \path{gp} and do \begin{verbatim} parisize = 4000000, primelimit = 500000 ? \r pari/examples/squfof.gp.run \end{verbatim} Now you have access to the compiled function \gp{squfof\_c} as well. \subsection{How can I compile directly with \gpcc ?}\label{compile_directly} Now we want to compile directly with \path{gp2c} to understand what happens. We should run the command {\bf ./gp2c pari/examples/squfof.gp \verb!>! squfof.gp.c} This creates a file squfof.gp.c in the \path{gp2c} directory. Now read this file with your favorite editor. The first line is highly system-dependent, but should be similar to: {\small \begin{verbatim} /*-*- compile-command: "/usr/bin/gcc -c -o pari/examples/squfof.gp.o -O3 -Wall -I/usr/local/include pari/examples/squfof.gp.c && /usr/bin/gcc -o pari/examples/squfof.gp.so -shared pari/examples/squfof.gp.o"; -*-*/ \end{verbatim} } This is the command needed to compile this C file to an object file with the C compiler and then to make a shared library with the linker. If you use \path{emacs}, typing 'M-x compile' will know about this command, so you will just need to type {\tt Return} to compile. The second line is \begin{verbatim} #include \end{verbatim} This includes the PARI header files. It is important that the header files come from the same PARI version as GP, else it will create problems. The next lines are {\small \begin{verbatim} /* GP;install("squfof","D0,G,p","squfof","./pari/examples/squfof.gp.so"); GP;install("init_squfof","v","init_squfof","./pari/.../squfof.gp.so"); */ \end{verbatim} } The characters "GP;" denote a command that should be read by GP at start-up. Here, the \gp{install()} commands above must be given to GP to let it know about functions defined by the library. \path{gp2c-run} copy such commands to the file \path{./pari/examples/squfof.gp.run}. Please read the entry about the \gp{install()} command in the PARI manual. The \gp{init\_squfof} function is an initialization function that is created automatically by \gpcc\ to hold codes that is outside any function. Since in our case there are none, this is a dummy function. In other cases, it is essential. The next lines are \begin{verbatim} GEN squfof(GEN n, long prec); void init_squfof(void); /*End of prototype*/ \end{verbatim} This is the C prototypes of your functions. The rest of the file is the C code proper. For teaching purpose, let's run the command {\bf ./gp2c -s\_c pari/examples/squfof.gp \verb!>! squfof2.gp.c} and look at the difference between squfof.gp.c and squfof2.gp.c: \cmd{diff -u squfof.gp.c squfof2.gp.c} {\small \begin{verbatim} --- squfof.gp.c Tue Feb 26 13:44:42 2002 +++ squfof2.gp.c Tue Feb 26 13:44:49 2002 @@ -1,8 +1,8 @@ /*-*- compile-command: "/usr/bin/gcc -c -o pari/examples/squfof.gp.o -DMEMSTEP=1048576 -g -Wall -Wno-implicit -I/usr/local/include pari/examples/squfof.gp.c && /usr/bin/ld -o pari/examples/squfof.gp.so -shared pari/examples/squfof.gp.o"; -*-*/ #include /* -GP;install("squfof","D0,G,p","squfof","./pari/examples/squfof.gp.so"); -GP;install("init_squfof","v","init_squfof","./pari/.../squfof.gp.so"); +GP;install("squfof","D0,G,p","squfof_c","./pari/...les/squfof.gp.so"); +GP;install("init_squfof","v","init_squfof_c","./par.../squfof.gp.so"); */ GEN squfof(GEN n, long prec); void init_squfof(void); \end{verbatim} } If you are not familiar with the \path{diff} utility, the above means that only the two lines starting with \gp{GP;install} have changed. In fact \gp{squfof} is still named \gp{squfof} in the C file, but the install command tells GP to rename it \gp{squfof\_c} in the GP session. \subsection{Using \gpcc\ to find errors in GP scripts}\label{find_errors} The \path{gp2c} compiler can also be used to find errors in GP programs. For that we should use the -W option like in {\bf ./gp2c -W pari/examples/squfof.gp \verb!>! squfof.gp.c} \begin{verbatim} Warning:pari/examples/squfof.gp:7:variable undeclared p Warning:pari/examples/squfof.gp:11:variable undeclared dd Warning:pari/examples/squfof.gp:11:variable undeclared d Warning:pari/examples/squfof.gp:11:variable undeclared b ... Warning:pari/examples/squfof.gp:45:variable undeclared b1 \end{verbatim} This option lists variables that are used but not declared. It is important to declare all your variables with \gp{local()}, or with \gp{global()}. For \gpcc , undeclared variables are taken to be ``formal variables'' for polynomials. For example if you write a function to build a second degree polynomial like \begin{center} \verb!pol(a,b,c)=a*x^2+b*x+c! \end{center} you must not declare 'x' here, since it stands for the formal variable \gp{x}. \subsection{Using compiled functions in a new program}\label{compiled_in_new_program} One you have successfully compiled and tested your functions you may want to reuse them in another GP program. The best way is to copy the install commands of the functions you use at the start of the new program so that reading it will automatically load the compiled functions. As an example, we write a simple program \path{fact.gp} that reads {\small \begin{verbatim} install("squfof","D0,G,p","squfof","./pari/examples/squfof.gp.so"); fact_mersenne(p)=squfof(2^p-1) \end{verbatim} } and run GP: \begin{verbatim} parisize = 4000000, primelimit = 500000 ? \rfact ? fact_mersenne(67) i = 2418 Qfb(10825778209, 4021505768, -13258245519, 0.E-28) %1 = 193707721 \end{verbatim} So all goes well. But what is even better is that \gpcc\ understands the \gp{install} command and will be able to compile this new program. Also this particular example will fail because as stated above, PARI/GP already has a \pari{squfof} function, and the linker will pick the wrong one, which is unfortunate. So use the -p option to \path{gp2c-run} to change \gp{squfof} to \gp{my\_squfof}. \cmd{ ./gp2c-run -pmy\_ -g pari/examples/squfof.gp} This option prefixes my\_ to every GP name in the program so as to avoid name clashes. Change \path{fact.gp} to {\small \begin{verbatim} install("my_squfof","D0,G,p","squfof","./pari/examples/squfof.gp.so"); fact_mersenne(p)=squfof(2^p-1) \end{verbatim} } and run \cmd{./gp2c-run -g fact.gp} \begin{verbatim} parisize = 4000000, primelimit = 500000 ? fact_mersenne(67) i = 2418 Qfb(10825778209, 4021505768, -13258245519, 0.E-28) %1 = 193707721 \end{verbatim} Nice isn't it? But it gets even better: instead of writing the \gp{install} command directly in your script you can just load the \path{squfof.gp.run} using \verb!\r!: just change \path{fact.gp} to {\small \begin{verbatim} \r ./pari/examples/squfof.gp.run fact_mersenne(p)=squfof(2^p-1) \end{verbatim} } \subsection{Hand-editing the C file generated by \gpcc} If you have some experience in PARI programming, you may want to manually edit the C file generated by \gpcc , for example to improve memory handling. Here some tips: \begin{itemize} %\item The C file created with gp2c-run is name \textit{file}.gp.c. To avoid %subsequent run of gp2c-run accidently clobbering it, it is advised to rename %this file to \textit{file}.c, and change the \gp{install()} \item If you preserve the \gp{install()} at the start of the file, you can use the command \cmd{gp2c-run \textit{file}.c} to recompile your file and start a new GP session with your functions added, just as you use \cmd{gp2c-run} with GP scripts. \item More generally, \cmd{gp2c-run} automatically passes any line in the C file starting with 'GP;' to GP at start-up. \item As explained in Section~\ref{compile_directly}, under \textbf{emacs} you can type 'M-x compile' to recompile the shared library. \end{itemize} \section{Advanced use of \gpcc}\label{advanced} \subsection {\gpcc\ types} Internally \gpcc\ assign types to objects. The most common types are given below: \begin{tabular}{l|l} name & description \\ \hline \gp{void} & like in C \\ \gp{bool} & boolean, true (1) or false (0) \\ \gp{negbool} & antiboolean, true (0) or false (1) \\ \gp{small}& C integer \pari{long} \\ \gp{int} & multiprecision integer \\ \gp{real} & multiprecision floating point \\ \gp{mp} & multiprecision number \\ \gp{var} & variable \\ \gp{pol} & polynomial \\ \gp{vecsmall} & vector of C long (\pari{t\_VECSMALL}) \\ \gp{vec} & vector and matrices (excluding \gp{vecsmall})\\ \gp{list} & GP lists \\ \gp{str} & characters string as a \pari{char *}\\ \gp{genstr} & characters string as a \pari{GEN} (\pari{t\_STR})\\ \gp{gen} & generic PARI object (\pari{GEN})\\ \gp{lg} & length of object (returned by \gp{length}) \\ \gp{typ} & type of object (returned by \gp{type}) \\ \end{tabular} \begin{table}[hbpt] $$ %HEVEA \begin{toimage} \unitlength=1.mm \begin{picture}(12,50)(-6,0) \put(6,50){\makebox[0mm]{gen}} \put(6,44){\line(0,1){5}} \put(6,40){\makebox[0mm]{mp}} \put(-2,44){\line(1,1){5}} \put(-3,40){\makebox[0mm]{vec}} \put(-9,44){\line(2,1){12}} \put(-9,40){\makebox[0mm]{pol}} \put(-9,34){\line(0,1){5}} \put(-9,30){\makebox[0mm]{var}} \put(12,30){\makebox[-1.5mm]{real}} \put(12,34){\line(-1,1){5}} \put(0,30){\makebox[-1.5mm]{int}} \put(0,34){\line(1,1){5}} \put(0,20){\makebox[1mm]{small}} \put(0,24){\line(0,1){5}} \put(0,10){\makebox[1mm]{bool}} \put(-8,17){\line(1,1){4}} \put(-15,15){\makebox[1mm]{negbool}} \put(-4,11){\line(-1,1){4}} \put(0,14){\line(0,1){5}} \put(0,00){\makebox[1mm]{void}} \put(5,01){\line(1,4){7}} \put(0,04){\line(0,1){5}} \end{picture} %HEVEA \end{toimage} %HEVEA \imageflush $$ \caption{Types preorder}\label{preorder} \end{table} Types are preordered as in Table~\ref{preorder}. The complete preorder known by \gpcc\ can be accessed by running \cmd{gp2c -t}. Variables are typed. A variable can only take values having a type equal or lower than its type. By default, variables are of type \gp{gen}. \subsection{Type declaration} To declare a variable as belonging to type \gp{type}, use: \begin{quote} \textit{function}(x\textit{:type},y\textit{:type}=2) \\ local(x\textit{:type}, y\textit{:type}=2) \\ global(x\textit{:type}, y\textit{:type}=2) \\ for(i\textit{:type}=... \end{quote} To declare several variables of the same type \gp{type} at once, use: \begin{quote} local(x, y=2)\textit{:type}\\ global(x, y=2)\textit{:type} \end{quote} You can even mix the two ways: \begin{quote} local(x, y:\textit{type2}=2)\textit{:type1} \end{quote} will declare \gp{x} to be of type \gp{type1} and \gp{y} of type \gp{type2}. \subsection{Effect of types declaration on default values} Under GP, all GP variables start with a default value, which is \gp{0} for a local variable and \gp{'v} for a global variable \gp{v}. The \gpcc\ compiler follows this rule for variables declared without a type. However, when a variable is declared with a type, \gpcc\ will not assign it a default value. This means that the declaration \gp{local(g)} is equivalent to \gp{local(g:gen=0)}, but not to \gp{local(g:gen)}, \gp{global(g)} is equivalent to \gp{global(g:gen='g)}, but not to \gp{global(g:gen)}, and \gp{f(g)=...} is equivalent to \gp{f(g:gen=0)=...}, but not to \gp{f(g:gen)=...}. This rule was chosen for several reasons: \begin{itemize} \item The default value (\gp{0} or \gp{'v}) might not be an object suitable for the type in question. For example, \gp{local(v:vec)} declares \gp{v} as being of type \gp{vec}. It would make no sense to initialize \gp{v} to \gp{0} since \gp{0} does not belong to type \gp{vec}. Similarly \gp{global(N:int)} declares \gp{N} as being of type \gp{int}. It would make no sense to initialize \gp{N} to \gp{'N} since \gp{'N} does not belong to type \gp{int}. \item This allows defining GP functions with mandatory arguments. This way, GP will issue an error if a mandatory argument is missing. Without this rule, there is no way to tell apart \gp{0} from a missing argument. \item This allows telling \gpcc\ not to generate useless default values. \end{itemize} \subsection{Type casting} Sometimes, we know a more precise type than the one the transtyping algorithm can derive. For example if \gp{x} is a real number, its logarithm might be complex. However, if we are sure \gp{x} is positive, the logarithm will be real. To force an expression to belong to type \gp{type}, use the syntax: \\ \textit{expr}\textit{:type}\\ \gpcc\ will check types consistency and output warnings if necessary. For example\\ \gp{f(x:int)=local(r:real); r=log(x\^{}2+1)}\\ \gpcc\ will complain that the logarithm might not be real. Since \gp{x\^{}2+1} is always positive, we can write:\\ \gp{f(x:int)=local(r:real); r=log(x\^{}2+1):real} \subsection{Example of optimisation} Declaring the types of variables allow \gpcc\ to perform some optimisations. For example, the following piece of GP code \begin{verbatim} rho(n)= { local(x,y); x=2; y=5; while(gcd(y-x,n)==1, x=(x^2+1)%n; y=(y^2+1)%n; y=(y^2+1)%n ); gcd(n,y-x) } \end{verbatim} generates the following output: \begin{verbatim} GEN rho(GEN n) { GEN x = gen_0, y = gen_0; x = gen_2; y = stoi(5); while (gcmp1(ggcd(gsub(y, x), n))) { x = gmod(gaddgs(gsqr(x), 1), n); y = gmod(gaddgs(gsqr(y), 1), n); y = gmod(gaddgs(gsqr(y), 1), n); } return ggcd(n, gsub(y, x)); } \end{verbatim} The functions \pari{gsqr}, \pari{gaddgs}, \pari{gmod}, \pari{ggcd} are generic PARI functions that handle \gp{gen} objects. Since we only want to factor integers with this method, we can declare \gp{n}, \gp{x} \and \gp{y} of type \gp{int}: {\noindent\tt rho(n\textit{:int})=\\ \verb!{!\\ \verb! local!(x\textit{:int},y\textit{:int});} \begin{verbatim} x=2; y=5; while(gcd(y-x,n)==1, x=(x^2+1)%n; y=(y^2+1)%n; y=(y^2+1)%n ); gcd(n,y-x) } \end{verbatim} The new C code output by \gpcc\ is: \begin{verbatim} GEN rho(GEN n) /* int */ { GEN x, y; /* int */ if (typ(n) != t_INT) pari_err(typeer, "rho"); x = gen_2; y = stoi(5); while (gcmp1(gcdii(subii(y, x), n))) { x = modii(addis(sqri(x), 1), n); y = modii(addis(sqri(y), 1), n); y = modii(addis(sqri(y), 1), n); } return gcdii(n, subii(y, x)); } \end{verbatim} Now, the code now uses the more specific functions \pari{sqri}, \pari{addis}, \pari{modii} and \pari{gcdii}. The most efficient way to use typing is to declare some variables of type \gp{small}. This way, these variables will be implemented by C \pari{long} variables, which are faster than PARI integers and do not require garbage collecting. However, you will not be protected from integer overflow. For that reason, \gpcc\ will automatically declare some loop indices of type \gp{small} when the range cannot cause overflow. Sometimes \gpcc\ can be too conservative but you can force a loop index to be \gp{small} with the syntax \gp{for(i:small=a,b,...)}. \subsection{Types and member functions} For use with members functions, \gpcc\ provides the following types: \begin{description} \item[nf] for ordinary number fields, i.e., a result given by the GP function \gp{nfinit}. \item[bnf] for big number fields, i.e., a result given by the GP function \gp{bnfinit} which includes class and unit group data. \item[bnr] for ray class groups, i.e., a result given by the GP function \gp{bnrinit}. \item[ell] for elliptic curves, i.e., a result given by the GP function \gp{ellinit}. \item[gal] for galois extensions, i.e., a result given by the GP function \gp{galoisinit}. \item[prid] for prime ideals, i.e., a component of the result given by the GP function \gp{idealprimedec}. \end{description} Members functions on typed objects are much more efficient. \section{Common problems} \subsection{Meta-commands.} Meta-commands (commands starting with a \verb!\!) other than \verb!\r! are currently ignored by \gpcc, though a warning will be issued, because it is not clear what they should do in a compiled program. Instead you probably want to run the meta-command in the GP session itself. The meta-command \verb!\r!\textit{include} is replaced with the content of the file \textit{include} (or \textit{include}.gp) when \gpcc\ reads the file. If you would prefer \gpcc\ to link \textit{include}.so to the program instead, see Section~\ref{compiled_in_new_program}. \subsection{Unsupported functions.}\label{unsupported_funcs} The functions \gp{forell} and \gp{forsubgroup} are currently not implemented as an iterator but as a procedure with callbacks, which limits what you can do inside the loop. Some functions are passed to GP by \path{gp2c-run} at start-up (using the \pari{GP;} syntax) instead of being translated in C: \gp{install} and \gp{addhelp}. In practice, they can be considered as supported. Some functions are built-in in GP, and so are not available to libpari programs. So if you use them \gpcc\ generate a program that needs to run under GP, or with \path{gp2c-run}. Since the C prototype for those functions are not available, the C compiler will output a warning. This serves as a reminder of the problem. They are all the plotting functions and \gp{allocatemem, default, extern, input, quit, read, system, whatnow}. Some GP functions are not available for C programs, so the compiler cannot handle them. If you use them you will get the infamous "unhandled letter in prototype" error. Sorry for the inconvenience. These are \gp{plot, ploth, plotrecth}. Also the functions \gp{read, eval, kill} may compile fine but have a surprising behaviour in some case, because they may modify the state of the GP interpreter, not of the compiled program. Please see Section~\ref{global_variables} for details. For example \verb!f(n)=eval("n^2")! is very different from \verb!f(n)=n^2!. The \gp{forstep} function is supported when the step is a number. If it is a vector, you must add a tag \gp{:vec} to make GP know about it like in \begin{verbatim} f(x)= { local(v); v=[2,4,6,6,6,6,6,2,4,6,6] forstep(y=7,x,v:vec,print(y)) } \end{verbatim} This is not needed if the step is a vector or a variable of type vec, but is needed if the step is only an expression which evaluates to a vector. There is little that can be done about these problems without changing PARI/GP itself. \subsection{Memory handling and global variables.}\label{global_variables} While a lot of work has been done to ensure that \gpcc\ handles global variables properly, the use of global variables is still a lot of trouble, so try to avoid them if you do not understand the implications on memory handling. First, there is a common practice to use undeclared variables as formal variables, for example we assume \gp{x='x} and write \gp{a*x+b} instead of \gp{a*'x+b}. So \gpcc\ will not raise an undeclared variable to the rank of global variable unless you declare it with the \gp{global()} command, or you use it at toplevel (i.e. outside any function). See also Section~\ref{find_errors} Second, global variables seen by a compiled function are C variables, not GP variables. There is no connection between the two. You may well have two variables with the same name and a different content. Currently GP knows only how to install functions, not variables, so you need to write compiled functions in order to access global variables under GP. Basically, global variables are allocated in the main stack which is destroyed each time GP prints a new prompt. This means you must put all your commands on the same line. Also global variables must be initialized using the \gp{init\_}\verb!! function before being used, and are only supported with the -g flag. So you end up doing \cmd{gp2c-run -g global.gp} \begin{verbatim} parisize = 4000000, primelimit = 500000 ? init_global();myfunction(args); \end{verbatim} Note that nothing prevents you from calling \gp{init\_global} in the GP program. In that case, you can omit the parentheses (i.e, write \gp{init\_global}, not \gp{init\_global()}) so that you can still run your noncompiled program. Another way to handle global variables is to use the \gp{clone} function which copies a PARI object to the heap, hence avoids its destruction when GP prints a new prompt. You can use \gp{unclone} to free a clone. Please read the PARI/GP manual for more information about \gp{clone}. A good use of \gp{clone} is for initializing constant variables: for example in \path{test/gp/initfunc.gp}, the vector \gp{T} is initialized by \begin{verbatim} T=clone([4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0]) \end{verbatim} You must still run the \gp{init\_}\verb!! after starting GP, but after that you can use \gp{T} safely. GP itself currently does not know about \gp{clone} and \gp{unclone}, but you can use dummy functions \begin{verbatim} clone(x)=x unclone(x)=while(0,) \end{verbatim} when running uncompiled. \subsection{GP lists} GP lists are not fully supported by \gpcc . A partial support is available with the \gp{list} type. You must tell \gpcc\ that a variable will contain a list by using \gp{L:list} inside a declaration, where \gp{L} is the name of the variable as explained in Section~\ref{advanced}. Currently, assigning to a list element (\gp{L[2]=x}) will not work and lists will not be freed unless you explicitly use \gp{listkill}. Note: The PARI user's manual states that lists are useless in library mode. \subsection{The \gp{install} command} The \gp{install} command is interpreted as a \gpcc\ directive. This allows using installed function in compiled programs, see Section~\ref{compiled_in_new_program}. However this has some side-effects: \begin{itemize} \item If present, the \gp{lib} argument must be a string, not an expression that evaluate to a string. \item The \gp{install} command is not compiled, instead it is added to the list of functions to install. \end{itemize} \section{Command-line options of \gpcc} Here is a brief description of the main options of \path{gp2c}, which can be seen with \path{./gp2c -h}. In Section~\ref{compile_and_run} we saw how to use the \path{-g} option. \begin{itemize} \item -g tells \gpcc\ to generate \pari{gerepile} calls to clean up the PARI stack and reduce memory usage. You will probably need this option, although the C code will be easier to read or hand-edit without it. \item -o\textit{file} tells \gpcc\ to write the generated C file to the file \textit{file} instead of the standard output. \item -iN allows you to change the indentation of the generated C file. So if you want 4 spaces, just use the \path{-i4} option with \path{gp2c}. The default is 2. \item -W is useful for debugging the .gp file, in the sense that it detects if some local variable is undeclared. For example, if the file \path{algorithm.gp} has a routine like \begin{verbatim} radical(x)=F=factor(x)[,1];prod(i=1,length(F),F[i]) \end{verbatim} The variable 'F' is undeclared in this routine, so when running \path{gp2c} with the \path{-W} option it prints \item -C adds code to perform range checking for GP constructs like \gp{x[a]} and \gp{x[a,b]}. This also checks whether \gp{x} has the correct type. By default \gpcc\ does not perform such check, which can lead to a runtime crash with invalid code. This option causes a small runtime penalty and a large C code readability penalty. \noindent{\bf Warning:algorithm.gp:1:variable undeclared F} At present, an undeclared variable is taken to be a "formal variable" for polynomials by \path{gp2c}, so do not declare it if that is what you intend. For example in \verb!pol(a,b,c)=a*x^2+b*x+c! you must not declare \gp{x} since it stands for the formal variable \gp{'x}. \item -p\textit{prefix} A problem with C is that it is subject to name clashes, i.e., if a GP variable in your routine has the same name as a C symbol in the pari library, the compiler will report strange errors. So this option changes ALL user variables and user routine names by adding a prefix \textit{prefix} to them. For example the GP routine \gp{add(x,y)} with \cmd{-pmy\_} will become the C function \pari{my\_add(x,y)}. Try this option each time the compiler fails to compile \path{gp2c} output to see if there is a name conflict. If this is the case, change the name in your GP script. It may be difficult to find conflicting names if your compiler is not verbose enough and if you are not familiar with the PARI code and C in general. Example of conflicting names are \pari{top},\pari{bot},\pari{prec},\pari{un}, but there are thousands of others and they may be system-dependent. \item -s\textit{suffix}: Add \textit{suffix} to the names of the installed functions under GP. This is to avoid clashes with the original GP script. For example, if you want to compare timings you may want to use the option \cmd{-s\_c} This does not affect the C code, only the \gp{install} commands. \item -S: Assume strict prototypes for functions. This means that you have declared all the local variables with \gp{local} and not as parameters. Also, when a parameter is not mandatory, a default value must be assigned to it in the declaration, like for 'flag' in \begin{verbatim} test(data,flag=0)={CODE} \end{verbatim} This does not affect the C code, only the \gp{install} commands. \item -h gives the help. \item -v gives the \gpcc\ version. \item -l prints a list of all the GP functions known by the compiler. So if a routine contains a GP routine not on this list, \path{gp2c} will show an error when trying to translate it. For example the routine \gp{forvec} is not yet implemented, so you should not use it. Reasons why a GP function may not be known by the compiler are: \begin{itemize} \item The function is not part of the PARI library. See Section~\ref{unsupported_funcs} \item You use the old PARI 1.39 function names instead of the new ones. \gpcc\ currently does not know about the 'compat' default. Use \gp{whatnow} under GP to get the current name. For example, \gp{mod()} is now \gp{Mod()}. \item You use a GP function that does not exists in the GP version \gpcc\ was compiled against. Please recompile \gpcc\ against this GP version. Normally no functions are added between two stable releases of GP with the same minor version number (say 2.1.1 and 2.1.2) so there is no need to recompile \gpcc\ when you upgrade. But if you use the developement versions, you need to recompile. Also some new developement versions may break old versions of \gpcc, so upgrade gp2c\ at the same time. However, if you want to compile scripts which do not use the new functions, you do not need to recompile. Note that you may use the GP environment variables to tell \path{gp2c-run} which GP to use. \item -t Output the table of types known to the compiler, see Section~\ref{advanced}. \end{itemize} \end{itemize} \end{document} gp2c-0.0.8/doc/gp2c-dbg.1.in0000644000175000017500000000312112156115130012104 00000000000000.TH GP2C-DBG "1" "November 2001" "GP to C compiler driver" PARI .SH NAME GP2C-DBG \- The GP to C debugger driver .SH DESCRIPTION gp2c-dbg .I [gp2c options] [file.gp] .PP Compile \fIfile.gp\fR with \fBgp2c\fR and launch a debugger session of gp where the functions of \fIfile.gp\fR are loaded. [gp2c options] are passed to \fBgp2c\fR. .PP gp2c-dbg .I file.c .PP Compile \fIfile.c\fR and launch a debugger session of \fBgp\fR where the functions of \fIfile.c\fR are loaded. The file \fIfile.c\fR must have suitable \fPGP;install()\fR lines. .SH "USAGE" .PP Since there is no debugger for the GP language, \fBgp2c-dbg\fR allows to debug GP scripts with the C debugger. To catch \fBPARI\fR errors, you can set a break point on the function "pari_err". Note that your functions will not be loaded until \fBgp\fR read the .run file. .SH "FILES" .I file.gp.c The C output of \fBgp2c\fR. .TP .I file.gp.so The GP loadable module. .TP .I file.gp.run The commands to load the module. Once a module is compiled, you can load it inside a \fBgp\fR session by running this script. .SH "ENVIRONMENT" .TP .I GP2C Path to the gp2c compiler, default: @mybindir@/gp2c .TP .I GP_DBG Path to the gp calculator, default: @GP_PATH@ .TP .I GP2C_DBG Command to start the debugger, default: "gdb --args" .SH "COPYING" Copyright 2000-2013 The PARI Group .PP GP2C is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. There is absolutely no warranty for GP2C. .SH "SEE ALSO" The GP2C manual, .IR gp2c-run(1), .IR gp2c(1), .IR gp(1), .IR gdb(1) gp2c-0.0.8/doc/Makefile.in0000644000175000017500000003703112165534611012115 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = doc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/gp2c-dbg.1.in $(srcdir)/gp2c-run.1.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = gp2c-run.1 gp2c-dbg.1 CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" NROFF = nroff MANS = $(man_MANS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHOC = @ECHOC@ ECHON = @ECHON@ ECHOT = @ECHOT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GP2C_DBG = @GP2C_DBG@ GP2C_DBG1 = @GP2C_DBG1@ GP_PATH = @GP_PATH@ GP_PATH_DBG = @GP_PATH_DBG@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARI_DATADIR = @PARI_DATADIR@ PARI_DESC = @PARI_DESC@ PARI_MODULE_BUILD = @PARI_MODULE_BUILD@ PARI_MODULE_DEBUG = @PARI_MODULE_DEBUG@ PARI_RUNTEST = @PARI_RUNTEST@ PARI_VERSION = @PARI_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_PATH = @PERL_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = $(datadir)/doc dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ mybindir = @mybindir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkgdocdir = $(docdir)/$(PACKAGE) man_MANS = gp2c.1 gp2c-run.1 $(GP2C_DBG1) EXTRA_MANS = gp2c-dbg.1 GP2C_DOC = gp2c.dvi gp2c.html gp2c001.png TYPE_DOC = type.dvi type.html type001.png ALL_DOC = gp2c.ps type.ps gp2c.pdf type.pdf GP2C_CRUFT = gp2c.aux gp2c.haux gp2c.htoc gp2c.image.tex gp2c.log gp2c.toc TYPE_CRUFT = type.aux type.haux type.htoc type.image.tex type.log type.toc EXTRA_DIST = gp2c.1 gp2c.tex type.tex $(GP2C_DOC) $(TYPE_DOC) MAINTAINERCLEANFILES = $(GP2C_DOC) $(TYPE_DOC) $(ALL_DOC) $(GP2C_CRUFT) $(TYPE_CRUFT) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): gp2c-run.1: $(top_builddir)/config.status $(srcdir)/gp2c-run.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ gp2c-dbg.1: $(top_builddir)/config.status $(srcdir)/gp2c-dbg.1.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-local install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-man1 install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-am uninstall-local \ uninstall-man uninstall-man1 all: gp2c.dvi gp2c.aux: $(srcdir)/gp2c.tex latex $(srcdir)/gp2c.tex latex $(srcdir)/gp2c.tex type.dvi type.aux: $(srcdir)/type.tex latex $(srcdir)/type.tex latex $(srcdir)/type.tex gp2c.pdf: $(srcdir)/gp2c.tex pdflatex $(srcdir)/gp2c.tex pdflatex $(srcdir)/gp2c.tex type.pdf: $(srcdir)/type.tex pdflatex $(srcdir)/type.tex pdflatex $(srcdir)/type.tex gp2c.ps: gp2c.dvi dvips gp2c.dvi -o gp2c.ps type.ps: type.dvi dvips type.dvi -o type.ps gp2c.html: $(srcdir)/gp2c.tex hevea -fix $(srcdir)/gp2c.tex type.html: $(srcdir)/type.tex hevea -fix $(srcdir)/type.tex doc: gp2c.dvi type.dvi dochtml: gp2c.html type.html docall: $(ALL_DOC) gp2c.html type.html gzip -c gp2c.ps > gp2c.ps.gz gzip -c type.ps > type.ps.gz dolatex2html: $(srcdir)/html/index.html html/index.html: $(srcdir)/gp2c.aux mkdir -p html latex2html -dir html gp2c.tex -html_version 3.2,math install-data-local: $(INSTALL) -d $(DESTDIR)$(pkgdocdir) for i in $(GP2C_DOC) $(TYPE_DOC); do \ if test -f $(srcdir)/$$i; then \ $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(pkgdocdir); \ fi \ done; uninstall-local: rm -r $(DESTDIR)$(pkgdocdir) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: gp2c-0.0.8/doc/gp2c-run.1.in0000644000175000017500000000331512156115130012161 00000000000000.TH GP2C-RUN "1" "November 2001" "GP to C compiler driver" PARI .SH NAME GP2C-RUN \- The GP to C compiler driver .SH DESCRIPTION gp2c-run \fI[gp2c options] [file.gp]\fR .PP Compile \fIfile.gp\fR with \fBgp2c\fR and launch a \fBgp\fR session where the functions of functions of \fIfile.gp\fR are preloaded. Any options are passed to \fBgp2c\fR. .PP gp2c-run \fIfile.c\fR .PP Compile \fIfile.c\fR and launch a \fBgp\fR session where the functions of \fIfile.c\fR are preloaded. the file \fIfile.c\fR must have suitable \fPGP;install()\fR lines. .PP This is especially useful if you manually modify the \fIfile.gp.c\fR produced by \fBgp2c-run\fR. In this case it is advised to rename it to \fIfile.c\fR to avoid subsequent calls of \fBgp2c-run\fR to overwrite your changes. .SH "FILES" .I file.gp.c The C output of \fBgp2c\fR. .TP .I file.gp.so The GP loadable module. .TP .I file.gp.run The commands to load the module. Once a module is compiled, you can load it inside a \fBgp\fR session by running this script. .SH "ENVIRONMENT" .TP .I GP2C Path to the \fBgp2c\fR compiler, default: @mybindir@/gp2c .TP .I GP Path to the \fIgp\fR calculator, default: @GP_PATH@ .SH "FILES" .I file.gp.c The C output of \fBgp2c\fR. .TP .I file.gp.so The GP loadable module. .TP .I file.gp.run The commands to load the module. Once a module is compiled, you can load it inside a \fBgp\fR session by running this script. .SH "COPYING" Copyright 2000-2013 The PARI Group .PP GP2C is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. There is absolutely no warranty for GP2C. .SH "SEE ALSO" The GP2C manual, .IR gp2c(1), .IR gp2c-dbg(1), .IR gp(1), .IR gcc(1) gp2c-0.0.8/doc/Makefile.am0000644000175000017500000000322312155572710012101 00000000000000all: docdir=$(datadir)/doc pkgdocdir=$(docdir)/$(PACKAGE) man_MANS = gp2c.1 gp2c-run.1 $(GP2C_DBG1) EXTRA_MANS = gp2c-dbg.1 GP2C_DOC = gp2c.dvi gp2c.html gp2c001.png TYPE_DOC = type.dvi type.html type001.png ALL_DOC = gp2c.ps type.ps gp2c.pdf type.pdf GP2C_CRUFT = gp2c.aux gp2c.haux gp2c.htoc gp2c.image.tex gp2c.log gp2c.toc TYPE_CRUFT = type.aux type.haux type.htoc type.image.tex type.log type.toc EXTRA_DIST = gp2c.1 gp2c.tex type.tex $(GP2C_DOC) $(TYPE_DOC) MAINTAINERCLEANFILES = $(GP2C_DOC) $(TYPE_DOC) $(ALL_DOC) $(GP2C_CRUFT) $(TYPE_CRUFT) gp2c.dvi gp2c.aux: $(srcdir)/gp2c.tex latex $(srcdir)/gp2c.tex latex $(srcdir)/gp2c.tex type.dvi type.aux: $(srcdir)/type.tex latex $(srcdir)/type.tex latex $(srcdir)/type.tex gp2c.pdf: $(srcdir)/gp2c.tex pdflatex $(srcdir)/gp2c.tex pdflatex $(srcdir)/gp2c.tex type.pdf: $(srcdir)/type.tex pdflatex $(srcdir)/type.tex pdflatex $(srcdir)/type.tex gp2c.ps: gp2c.dvi dvips gp2c.dvi -o gp2c.ps type.ps: type.dvi dvips type.dvi -o type.ps gp2c.html: $(srcdir)/gp2c.tex hevea -fix $(srcdir)/gp2c.tex type.html: $(srcdir)/type.tex hevea -fix $(srcdir)/type.tex doc: gp2c.dvi type.dvi dochtml: gp2c.html type.html docall: $(ALL_DOC) gp2c.html type.html gzip -c gp2c.ps > gp2c.ps.gz gzip -c type.ps > type.ps.gz dolatex2html: $(srcdir)/html/index.html html/index.html: $(srcdir)/gp2c.aux mkdir -p html latex2html -dir html gp2c.tex -html_version 3.2,math install-data-local: $(INSTALL) -d $(DESTDIR)$(pkgdocdir) for i in $(GP2C_DOC) $(TYPE_DOC); do \ if test -f $(srcdir)/$$i; then \ $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(pkgdocdir); \ fi \ done; uninstall-local: rm -r $(DESTDIR)$(pkgdocdir) gp2c-0.0.8/configure0000755000175000017500000055063712165534610011225 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="src/gp2c.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS mybindir ECHOT ECHOC ECHON EGREP GREP CPP PARI_RUNTEST GP2C_DBG1 GP2C_DBG GP_PATH_DBG PARI_MODULE_DEBUG PARI_DESC PARI_DATADIR GP_PATH PARI_MODULE_BUILD PARI_VERSION PERL_PATH YFLAGS YACC LEXLIB LEX_OUTPUT_ROOT LEX am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_maintainer_mode enable_dependency_tracking with_perl with_paricfg with_paricfg_dbg ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS YACC YFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-perl=FILE Perl is needed to compile the description files. But gp2c comes with precompiled descriptions for PARI 2.5, so can be used without perl. Default is to use perl if we find it. You can specify the path to perl with --with-perl=PATH. --with-paricfg=FILE Details about PARI configuration are needed to build plug-ins. Without them, gp2c itself can be compiled, but gp2c-run and 'make check' will not work. You must specify the path to the 'pari.cfg' file with --with-paricfg=PATH. --with-paricfg-dbg=FILE gp2c-dbg is more useful with the debugging version of PARI. You can specify the path to the 'pari.cfg' file of a debugging version with --with-paricfg-dbg=PATH while still using the optimised version with gp2c-run. Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in config "$srcdir"/config; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. am__api_version='1.11' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE=gp2c VERSION=0.0.8 cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE ac_config_headers="$ac_config_headers src/config.h" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 $as_echo "$LEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test "x$LEX" != "x:"; then cat >conftest.l <<_ACEOF %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ yyless ((input () != 0)); } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% #ifdef YYTEXT_POINTER extern char *yytext; #endif int main (void) { return ! yylex () + ! yywrap (); } _ACEOF { { ac_try="$LEX conftest.l" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$LEX conftest.l") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 $as_echo_n "checking lex output file root... " >&6; } if ${ac_cv_prog_lex_root+:} false; then : $as_echo_n "(cached) " >&6 else if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 $as_echo "$ac_cv_prog_lex_root" >&6; } LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test -z "${LEXLIB+set}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 $as_echo_n "checking lex library... " >&6; } if ${ac_cv_lib_lex+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_LIBS=$LIBS ac_cv_lib_lex='none needed' for ac_lib in '' -lfl -ll; do LIBS="$ac_lib $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lex=$ac_lib fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext test "$ac_cv_lib_lex" != 'none needed' && break done LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 $as_echo "$ac_cv_lib_lex" >&6; } test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 $as_echo_n "checking whether yytext is a pointer... " >&6; } if ${ac_cv_prog_lex_yytext_pointer+:} false; then : $as_echo_n "(cached) " >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no ac_save_LIBS=$LIBS LIBS="$LEXLIB $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_prog_lex_yytext_pointer=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 $as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then $as_echo "#define YYTEXT_POINTER 1" >>confdefs.h fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi if test "$LEX" = :; then LEX=${am_missing_run}flex fi for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_YACC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 $as_echo "$YACC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" # Check whether --with-perl was given. if test "${with_perl+set}" = set; then : withval=$with_perl; fi if test "$with_perl" = "no"; then PERL_PATH=/bin/false elif test -x "$with_perl"; then PERL_PATH="$with_perl" else # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PERL_PATH+:} false; then : $as_echo_n "(cached) " >&6 else case $PERL_PATH in [\\/]* | ?:[\\/]*) ac_cv_path_PERL_PATH="$PERL_PATH" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PERL_PATH="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PERL_PATH" && ac_cv_path_PERL_PATH="/bin/false" ;; esac fi PERL_PATH=$ac_cv_path_PERL_PATH if test -n "$PERL_PATH"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL_PATH" >&5 $as_echo "$PERL_PATH" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi # Check whether --with-paricfg was given. if test "${with_paricfg+set}" = set; then : withval=$with_paricfg; fi if test "$with_paricfg" = "no" ; then PARI_CONFIG= else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PARI configuration" >&5 $as_echo_n "checking for PARI configuration... " >&6; } if test "$with_paricfg" = "yes" || test "x$with_paricfg" = "x" ; then test -f /usr/local/lib/pari/pari.cfg && PARI_CONFIG=/usr/local/lib/pari/pari.cfg test -f /usr/lib/pari/pari.cfg && PARI_CONFIG=/usr/lib/pari/pari.cfg test -f "$srcdir/../pari.cfg" && PARI_CONFIG="$srcdir/../pari.cfg" test -f "$srcdir/pari.cfg" && PARI_CONFIG="$srcdir/pari.cfg" else test -f "$with_paricfg" && PARI_CONFIG="$with_paricfg" fi if test "x$with_paricfg" != "x" && test "x$PARI_CONFIG" = "x" ; then as_fn_error $? "pari.cfg file not found. Please use --with-paricfg=PATH where PATH is the path to pari.cfg or dft.Config.in file." "$LINENO" 5 fi if test "x$PARI_CONFIG" = "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"not found\"" >&5 $as_echo "\"not found\"" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PARI_CONFIG" >&5 $as_echo "$PARI_CONFIG" >&6; } fi fi # Check whether --with-paricfg-dbg was given. if test "${with_paricfg_dbg+set}" = set; then : withval=$with_paricfg_dbg; fi if test "$with_paricfg_dbg" = "no" ; then PARI_CONFIG_DBG= else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PARI configuration (debugging)" >&5 $as_echo_n "checking for PARI configuration (debugging)... " >&6; } if test "$with_paricfg_dbg" = "yes" || test "x$with_paricfg_dbg" = "x" ; then test -f /usr/local/lib/pari/pari.cfg.dbg && PARI_CONFIG_DBG=/usr/local/lib/pari/pari.cfg.dbg test -f /usr/lib/pari/pari.cfg.dbg && PARI_CONFIG_DBG=/usr/lib/pari/pari.cfg.dbg test -f "$srcdir/../pari.cfg.dbg" && PARI_CONFIG_DBG="$srcdir/../pari.cfg.dbg" test -f "$srcdir/pari.cfg.dbg" && PARI_CONFIG_DBG="$srcdir/pari.cfg.dbg" else test -f "$with_paricfg_dbg" && PARI_CONFIG_DBG="$with_paricfg_dbg" fi if test "x$with_paricfg_dbg" != "x" && test "x$PARI_CONFIG_DBG" = "x" ; then as_fn_error $? "pari.cfg.dbg file not found. Please use --with-paricfg-dbg=PATH where PATH is the path to pari.cfg.dbg or dft.Config.in file." "$LINENO" 5 fi if test "x$PARI_CONFIG_DBG" = "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"not found\"" >&5 $as_echo "\"not found\"" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PARI_CONFIG_DBG" >&5 $as_echo "$PARI_CONFIG_DBG" >&6; } fi fi if test "x$PARI_CONFIG" != "x" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PARI version" >&5 $as_echo_n "checking for PARI version... " >&6; } PARI_VERSION=`$srcdir/config/pari-version $PARI_CONFIG` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PARI_VERSION" >&5 $as_echo "$PARI_VERSION" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PARI module build" >&5 $as_echo_n "checking for PARI module build... " >&6; } PARI_MODULE_BUILD=`$srcdir/config/module-build $PARI_CONFIG` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PARI_MODULE_BUILD" >&5 $as_echo "$PARI_MODULE_BUILD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GP path" >&5 $as_echo_n "checking for GP path... " >&6; } GP_PATH=`$srcdir/config/pari-conf $PARI_CONFIG bindir`/gp { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GP_PATH" >&5 $as_echo "$GP_PATH" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PARI data directory" >&5 $as_echo_n "checking for PARI data directory... " >&6; } PARI_DATADIR=`$srcdir/config/pari-conf $PARI_CONFIG datadir` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PARI_DATADIR" >&5 $as_echo "$PARI_DATADIR" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PARI description database" >&5 $as_echo_n "checking for PARI description database... " >&6; } PARI_DESC="$PARI_DATADIR/pari.desc"; test -f "$PARI_DESC" || PARI_DESC="missing" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PARI_DESC" >&5 $as_echo "$PARI_DESC" >&6; } else PARI_VERSION='2.5.x (released)' PARI_MODULE_BUILD="`pwd`/$srcdir/config/missing $PARI_CONF"; GP_PATH="gp" fi if test "x$PARI_CONFIG_DBG" != "x" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PARI module build (debugging)" >&5 $as_echo_n "checking for PARI module build (debugging)... " >&6; } PARI_MODULE_DEBUG=`$srcdir/config/module-build $PARI_CONFIG_DBG` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PARI_MODULE_DEBUG" >&5 $as_echo "$PARI_MODULE_DEBUG" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GP path (debugging)" >&5 $as_echo_n "checking for GP path (debugging)... " >&6; } GP_PATH_DBG=`$srcdir/config/pari-conf $PARI_CONFIG_DBG bindir`/gp { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GP_PATH_DBG" >&5 $as_echo "$GP_PATH_DBG" >&6; } GP2C_DBG="gp2c-dbg" GP2C_DBG1="gp2c-dbg.1" else PARI_MODULE_DEBUG=$PARI_MODULE_BUILD GP_PATH_DBG=$GP_PATH GP2C_DBG="" GP2C_DBG1="" fi cat >>confdefs.h <<_ACEOF #define PARI_VERSION "$PARI_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PARI_MODULE_BUILD "$PARI_MODULE_BUILD" _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RUNTEST (if needed)" >&5 $as_echo_n "checking for RUNTEST (if needed)... " >&6; } if test "x$RUNTEST" = "x" && test "x$PARI_CONFIG" != "x" ; then PARI_RUNTEST=`$srcdir/config/pari-conf $PARI_CONFIG RUNTEST` else PARI_RUNTEST="$RUNTEST" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PARI_RUNTEST" >&5 $as_echo "$PARI_RUNTEST" >&6; } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in malloc.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if ${ac_cv_struct_tm+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h else ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h fi for ac_func in vprintf do : ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" if test "x$ac_cv_func_vprintf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VPRINTF 1 _ACEOF ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" if test "x$ac_cv_func__doprnt" = xyes; then : $as_echo "#define HAVE_DOPRNT 1" >>confdefs.h fi fi done for ac_func in strdup strtol getopt strcmp memccpy strrchr do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done ECHON=${ECHO_N-"$ac_n"} ECHOC=${ECHO_C-"$ac_c"} ECHOT=${ECHO_T-"$ac_t"} if test "$bindir" = '${exec_prefix}/bin'; then if test "x${exec_prefix}" != xNONE; then mybindir=${exec_prefix}/bin elif test "x${prefix}" != xNONE; then mybindir=${prefix}/bin else mybindir=${ac_default_prefix}/bin fi else mybindir=$bindir fi ac_config_files="$ac_config_files Makefile src/Makefile desc/Makefile doc/Makefile test/Makefile test2/Makefile test3/Makefile scripts/Makefile scripts/822_desc.pl scripts/runtest scripts/dotest scripts/gp2c-run scripts/gp2c-dbg doc/gp2c-run.1 doc/gp2c-dbg.1" ac_config_commands="$ac_config_commands default" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "desc/Makefile") CONFIG_FILES="$CONFIG_FILES desc/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "test2/Makefile") CONFIG_FILES="$CONFIG_FILES test2/Makefile" ;; "test3/Makefile") CONFIG_FILES="$CONFIG_FILES test3/Makefile" ;; "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; "scripts/822_desc.pl") CONFIG_FILES="$CONFIG_FILES scripts/822_desc.pl" ;; "scripts/runtest") CONFIG_FILES="$CONFIG_FILES scripts/runtest" ;; "scripts/dotest") CONFIG_FILES="$CONFIG_FILES scripts/dotest" ;; "scripts/gp2c-run") CONFIG_FILES="$CONFIG_FILES scripts/gp2c-run" ;; "scripts/gp2c-dbg") CONFIG_FILES="$CONFIG_FILES scripts/gp2c-dbg" ;; "doc/gp2c-run.1") CONFIG_FILES="$CONFIG_FILES doc/gp2c-run.1" ;; "doc/gp2c-dbg.1") CONFIG_FILES="$CONFIG_FILES doc/gp2c-dbg.1" ;; "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "default":C) chmod a+x scripts/822_desc.pl scripts/runtest scripts/dotest scripts/gp2c-run scripts/gp2c-dbg ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi gp2c-0.0.8/test3/0000755000175000017500000000000012217042364010416 500000000000000gp2c-0.0.8/test3/res/0000755000175000017500000000000012165113645011212 500000000000000gp2c-0.0.8/test3/res/forpart.res0000644000175000017500000000050012165114222013305 00000000000000[6, 36] [8, 64] [6, 36] [8, 64] [6, 36] [8, 64] [6, 36] [8, 64] [6, 36] [8, 64] [4, 16] [6, 36] [8, 64] [4, 16] [6, 36] [8, 64] [4, 16] [6, 36] [8, 64] [4, 16] [6, 36] [8, 64] [4, 16] [6, 36] [8, 64] 5 1 2 1 1 1 1 5 1 2 1 1 1 1 5 1 2 1 1 1 1 5 1 2 1 1 1 1 5 1 2 1 1 1 1 5 1 2 1 1 5 1 2 1 1 5 1 2 1 1 5 1 2 1 1 5 1 2 1 1 gp2c-0.0.8/test3/res/iferr.res0000644000175000017500000000023212156142054012745 00000000000000274177 274177 *** at top-level: ecm3(2^64+1,10,200!) *** ^-------------------- *** ecm3: impossible inverse in Fp_inv: Mod(2, 4). gp2c-0.0.8/test3/res/range.res0000644000175000017500000000130012156142054012727 00000000000000[7, 11, 13, 17] [11, 13, 17, 19, 23] [7, 12; 8, 13] [1, 2]~ [1, 6, 11, 16] [1, 6, 11, 16, 21; 2, 7, 12, 17, 22; 3, 8, 13, 18, 23] [1, 6, 11; 2, 7, 12; 3, 8, 13; 4, 9, 14; 5, 10, 15] [1, 6, 11, 16; 2, 7, 12, 17; 3, 8, 13, 18; 4, 9, 14, 19; 5, 10, 15, 20] [1, 6, 11, 16; 2, 7, 12, 17; 3, 8, 13, 18; 4, 9, 14, 19] [13, 18, 23; 14, 19, 24; 15, 20, 25] [6, 11; 7, 12; 9, 14; 10, 15] [1, 3, 4, 5]~ [1, 6, 11, 21] [1, 6, 11, 16, 21; 2, 7, 12, 17, 22; 4, 9, 14, 19, 24; 5, 10, 15, 20, 25] [1, 6, 16, 21; 2, 7, 17, 22; 3, 8, 18, 23; 4, 9, 19, 24; 5, 10, 20, 25] [1, 6, 11, 16; 2, 7, 12, 17; 3, 8, 13, 18; 4, 9, 14, 19] [1, 6, 11, 21; 2, 7, 12, 22; 3, 8, 13, 23; 4, 9, 14, 24] [13, 18, 23; 14, 19, 24; 15, 20, 25] gp2c-0.0.8/test3/res/forprime.res0000644000175000017500000000001412156142054013457 0000000000000026861 26861 gp2c-0.0.8/test3/res/compr.res0000644000175000017500000000216612156142054012766 00000000000000[1267650600228229401496703205376, 1267650600228229401496703205377, 126765060 0228229401496703205378, 1267650600228229401496703205379] [5, 10, 26, 50, 122, 170, 290, 362, 530, 842, 962, 1370, 1682, 1850, 2210, 2 810, 3482, 3722, 4490, 5042, 5330, 6242, 6890, 7922, 9410, 10202, 10610, 114 50, 11882, 12770, 16130, 17162, 18770, 19322, 22202, 22802, 24650, 26570, 27 890, 29930] [5, 10, 26, 50] [2, 5, 10, 17, 26, 37, 50, 65, 82, 101] [2, 5, 10, 17, 26, 37, 50, 65, 82, 101, 5, 13, 29, 53, 85, 10, 13, 25, 34, 5 8, 73, 109, 17, 25, 41, 65, 97, 26, 29, 34, 41, 61, 74, 89, 106, 37, 61, 85, 50, 53, 58, 65, 74, 85, 113, 130, 149, 65, 73, 89, 113, 145, 82, 85, 97, 10 6, 130, 145, 181, 101, 109, 149, 181] [13, 29, 53, 13, 34, 58, 29, 34, 74, 53, 58, 74] [[1, 1, 1], [2, 1, 1], [2, 2, 1], [2, 2, 2], [3, 1, 1], [3, 2, 1], [3, 2, 2] , [3, 3, 1], [3, 3, 2], [3, 3, 3], [4, 1, 1], [4, 2, 1], [4, 2, 2], [4, 3, 1 ], [4, 3, 2], [4, 3, 3], [4, 4, 1], [4, 4, 2], [4, 4, 3], [4, 4, 4], [5, 1, 1], [5, 2, 1], [5, 2, 2], [5, 3, 1], [5, 3, 2], [5, 3, 3], [5, 4, 1], [5, 4, 2], [5, 4, 3], [5, 4, 4], [5, 5, 1], [5, 5, 2], [5, 5, 3], [5, 5, 4], [5, 5 , 5]] gp2c-0.0.8/test3/input/0000755000175000017500000000000012165113701011551 500000000000000gp2c-0.0.8/test3/input/range0000644000175000017500000000000412156142054012505 00000000000000f() gp2c-0.0.8/test3/input/forprime0000644000175000017500000000001112156142054013232 00000000000000f() fs() gp2c-0.0.8/test3/input/forpart0000644000175000017500000000002112165113617013070 00000000000000f() ff() g() h() gp2c-0.0.8/test3/input/compr0000644000175000017500000000000412156142054012531 00000000000000f() gp2c-0.0.8/test3/input/iferr0000644000175000017500000000007612156142054012531 00000000000000ecm(2^64+1,10,200!) ecm2(2^64+1,10,200!) ecm3(2^64+1,10,200!) gp2c-0.0.8/test3/Makefile.in0000644000175000017500000002405412165534611012413 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = test3 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHOC = @ECHOC@ ECHON = @ECHON@ ECHOT = @ECHOT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GP2C_DBG = @GP2C_DBG@ GP2C_DBG1 = @GP2C_DBG1@ GP_PATH = @GP_PATH@ GP_PATH_DBG = @GP_PATH_DBG@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARI_DATADIR = @PARI_DATADIR@ PARI_DESC = @PARI_DESC@ PARI_MODULE_BUILD = @PARI_MODULE_BUILD@ PARI_MODULE_DEBUG = @PARI_MODULE_DEBUG@ PARI_RUNTEST = @PARI_RUNTEST@ PARI_VERSION = @PARI_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_PATH = @PERL_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ mybindir = @mybindir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test3/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu test3/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic dist-hook \ distclean distclean-generic distdir dvi dvi-am html html-am \ info info-am install install-am install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am mostlyclean-generic: rm -f *.gp *.gp.[co] *.gp.so *.res dist-hook: cp -pR $(srcdir)/gp $(srcdir)/input $(srcdir)/res $(distdir) rm -rf $(distdir)/gp/CVS $(distdir)/input/CVS $(distdir)/res/CVS rm -rf $(distdir)/gp/.svn $(distdir)/input/.svn $(distdir)/res/.svn # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: gp2c-0.0.8/test3/gp/0000755000175000017500000000000012165114220011015 500000000000000gp2c-0.0.8/test3/gp/range.gp0000644000175000017500000000070412156142054012370 00000000000000f()= { my(V,M); V=primes(100); M=matrix(5,5,i,j,i+5*j-5); print(primes(100)[4..7]); print(V[5..9]); print(M[2..3,2..3]); print(M[1..2,1]); print(M[1,1..4]); print(M[1..3,]); print(M[,1..3]); print(M[1..5,1..-2]); print(M[1..-2,1..-2]); print(M[-3..-1,-3..-1]); print(M[^3,2..3]); print(M[^2,1]); print(M[1,^4]); print(M[^3,]); print(M[,^3]); print(M[^5,1..-2]); print(M[1..-2,^-2]); print(M[-3..-1,-3..-1]); } gp2c-0.0.8/test3/gp/iferr.gp0000644000175000017500000000134012156142054012400 00000000000000ecm(N, B = 1000!, nb = 100)= { for(a:small = 1, nb, iferr(ellpow(ellinit([a,1]*Mod(1,N)), [0,1]*Mod(1,N), B), E, if(errname(E)=="e_INV", return(gcd(lift(component(E,2)),N)), error(E)))); } ecm2(N, B = 1000!, nb = 100)= { for(a:small = 1, nb, iferr(ellpow(ellinit([a,1]*Mod(1,N)), [0,1]*Mod(1,N), B), E, my(d=component(E,2)); if(type(d)=="t_INTMOD", return(gcd(lift(d),N)), error(E)), errname(E)=="e_INV")); } ecm3(N, B = 1000!, nb = 100)= { for(a:small = 1, nb, iferr(if(ellpow(ellinit([a,1]*Mod(1,N)), [0,1]*Mod(1,N), B),break), E, my(d=component(E,2)); return(gcd(lift(d),N)), errname(E)=="e_INV" && type(component(E,2))=="t_INTMOD")); Mod(2,4)^-1 } gp2c-0.0.8/test3/gp/compr.gp0000644000175000017500000000047112156142054012415 00000000000000f()= { print([2^100..2^100+3]); print([x^2+1|x<-primes(40)]); print([x^2+1|x<-[1..10],isprime(x)]); print([x^2+1|x<-[1..10]]); print([a^2+b^2|a<-[1..10];b<-[1..10],gcd(a,b)==1]); print([a^2+b^2|a<-[1..10],isprime(a);b<-[1..10],a!=b && isprime(b)]); print([[a,b,c]|a<-[1..5];b<-[1..a];c<-[1..b]]); } gp2c-0.0.8/test3/gp/forprime.gp0000644000175000017500000000023712156142054013120 00000000000000f()=local(s:small=0);forprime(p:int=2,,if(p%4==1,s++,s--);if(s==0,return(p))) fs()=local(s:small=0);forprime(p:small=2,,if(p%4==1,s++,s--);if(s==0,return(p))) gp2c-0.0.8/test3/gp/forpart.gp0000644000175000017500000000040012165114210012733 00000000000000f() = for(i=1,5,forcomposite(p=sum(i=1,3,i), sum(i=1,6,i), if(p%9==0,next(2));print([p,p^2]))) ff()= for(i=1,5,forcomposite(p=1,111, if(p%9==0,next(2));print([p,p^2]))) g() = for(i=1,5,forpart(p=5,print(p[1]))) h() = for(i=1,5,forpart(p=5,print(p[1]),,3)) gp2c-0.0.8/test3/Makefile.am0000644000175000017500000000041212162636237012376 00000000000000mostlyclean-generic: rm -f *.gp *.gp.[co] *.gp.so *.res dist-hook: cp -pR $(srcdir)/gp $(srcdir)/input $(srcdir)/res $(distdir) rm -rf $(distdir)/gp/CVS $(distdir)/input/CVS $(distdir)/res/CVS rm -rf $(distdir)/gp/.svn $(distdir)/input/.svn $(distdir)/res/.svn gp2c-0.0.8/test2/0000755000175000017500000000000012217042364010415 500000000000000gp2c-0.0.8/test2/res/0000755000175000017500000000000012156115130011200 500000000000000gp2c-0.0.8/test2/res/closure.res0000644000175000017500000000014512156115130013307 000000000000003628800 [1, 1/2, 1/3, 1/4] [1/2, 1/3, 1/4, 1/5] [1/3, 1/4, 1/5, 1/6] [1/4, 1/5, 1/6, 1/7] 720 137/60 gp2c-0.0.8/test2/res/call.res0000644000175000017500000000010612155572710012555 000000000000002 I 1 5 -1 [[0, 0, 0], 0, [0, 0, 0]] [1, 0, 1] [1, 0, 1] -1 3 1 1 0 3 gp2c-0.0.8/test2/res/sums.res0000644000175000017500000000003712155572710012634 00000000000000773/1000 1/4 277/500 -577/1000 gp2c-0.0.8/test2/res/apply.res0000644000175000017500000000033412155572710012772 00000000000000[1, 4, 9, 16] [1, 4, 9, 16] [1, 4, 9, 16] [2, 5, 10, 17] [3, 4] [2, 3] [2, 3] [1, 2, 3, 4] 0 Mod(1, 4) 0 Mod(3, 4) [0, 0] [0, 2] [0, 2] [0, 2] [0, 1] [0, 1] [0, 1] [0, 1] [0, 1] [0, 1] [2, 2] [2, 1] [2, 1] [2, 1] [1, 1] gp2c-0.0.8/test2/res/printf.res0000644000175000017500000000001212155572710013140 00000000000000123 "123" gp2c-0.0.8/test2/res/lambda.res0000644000175000017500000000001112155572710013055 0000000000000020 625 5 gp2c-0.0.8/test2/input/0000755000175000017500000000000012156115130011546 500000000000000gp2c-0.0.8/test2/input/apply0000644000175000017500000000025012155572710012545 00000000000000f1([1,2,3,4],2) f2([1,2,3,4]) f3(sqr,[1,2,3,4]) f4([1,2,3,4]) g1([1,2,3,4],2) g2([1,2,3,4]) g3(isprime,[1,2,3,4]) g4([1,2,3,4]) for(i=0,3,print(invmod(i,4))) sub2(4) gp2c-0.0.8/test2/input/closure0000644000175000017500000000013512156115130013064 00000000000000init_closure();rec=fun_rec; init_closure();rec(10) col(Vec(mathilbert(4))) ttrans(5) sumi(5) gp2c-0.0.8/test2/input/lambda0000644000175000017500000000041312155572710012641 00000000000000two=fun_two; three=fun_three; add=fun_add; sub=fun_sub; mul=fun_mul; power=fun_power; disp=fun_disp; init_lambda(); disp(mul(add(two,three),add(two,two))) init_lambda(); disp(power(add(two,three),add(two,two))) init_lambda(); disp(sub(mul(three,three),add(two,two))) gp2c-0.0.8/test2/input/sums0000644000175000017500000000007212155572710012411 00000000000000r(wallis(10)) r(dedeketa(-1)) r(lambert(Pi)) r(dgamma(1)) gp2c-0.0.8/test2/input/printf0000644000175000017500000000000712155572710012722 00000000000000f(123) gp2c-0.0.8/test2/input/call0000644000175000017500000000031312155572710012333 00000000000000dist(1,2) call(()->I) call1(sqrtint,2) call1(x->x^2+1,2) call2(kronecker,5,7) call3((x,y,z)->[x*y,y*z,z*x],[1,2,3]) gen([isprime,issquare,issquarefree],3) baz(2) bar() booz() foo() boor() toto1() buzz() gp2c-0.0.8/test2/Makefile.in0000644000175000017500000002405412165534611012412 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = test2 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHOC = @ECHOC@ ECHON = @ECHON@ ECHOT = @ECHOT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GP2C_DBG = @GP2C_DBG@ GP2C_DBG1 = @GP2C_DBG1@ GP_PATH = @GP_PATH@ GP_PATH_DBG = @GP_PATH_DBG@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARI_DATADIR = @PARI_DATADIR@ PARI_DESC = @PARI_DESC@ PARI_MODULE_BUILD = @PARI_MODULE_BUILD@ PARI_MODULE_DEBUG = @PARI_MODULE_DEBUG@ PARI_RUNTEST = @PARI_RUNTEST@ PARI_VERSION = @PARI_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_PATH = @PERL_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ mybindir = @mybindir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test2/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu test2/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic dist-hook \ distclean distclean-generic distdir dvi dvi-am html html-am \ info info-am install install-am install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am mostlyclean-generic: rm -f *.gp *.gp.[co] *.gp.so *.res dist-hook: cp -pR $(srcdir)/gp $(srcdir)/input $(srcdir)/res $(distdir) rm -rf $(distdir)/gp/CVS $(distdir)/input/CVS $(distdir)/res/CVS rm -rf $(distdir)/gp/.svn $(distdir)/input/.svn $(distdir)/res/.svn # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: gp2c-0.0.8/test2/gp/0000755000175000017500000000000012156115130011015 500000000000000gp2c-0.0.8/test2/gp/printf.gp0000644000175000017500000000006112155572710012576 00000000000000f(x)= { printf("%s",x); Strprintf("%s",x); } gp2c-0.0.8/test2/gp/lambda.gp0000644000175000017500000000070312155572710012517 00000000000000global(zero,one,two,three); global(inc,add,mul,power,dec,sub,mod,disp); zero=f->x->x; one =f->f; two =f->x->f(f(x)); three=f->x->f(f(f(x))); inc= n->f->x->f(n(f)(x)); add= (n,m)->f->x->n(f)(m(f)(x)); mul= (n,m)->f->n(m(f)); power= (n,m) -> m(n); \\ try with spaces dec= n->f->x-> n (g->h->h (g(f))) (u->x) (u->u); sub= (n,m)->m(dec)(n); mod= (n,b)->n(a->(aa->sub(aa,b)(zero)(aa)) (inc(a))) (zero) disp=n->n(x->1+x)(0); num(n)=if(n,inc(num(n-1)),zero) gp2c-0.0.8/test2/gp/closure.gp0000644000175000017500000000035212156115130012741 00000000000000global(inc,rec); rec=x->if(x,rec(x-1)*x,1) col(V)=for(i=1,#V,print(apply(x->x[i],V))) g(z)=my(h(x)=x^2+1);apply(h,z) gg(x)=(inc=x->x+1);inc(2) trans(F)=x->F(x+1) sump(a)=x->sum(i=1,x,i^a) ttrans(s)=trans(x->x!)(s) sumi(n)=sump(-1)(n) gp2c-0.0.8/test2/gp/apply.gp0000644000175000017500000000041212155572710012421 00000000000000f1(v,z)=apply(x->x^z,v) f2(v)=apply(sqr,v) f3(f,v)=apply(f,v) g(x)=x^2+1 f4(v)=apply(g,v) g1(v,z)=select(x->x>z,v) g2(v)=select(isprime,v) g3(f,v)=select(f,v) h(x)=x g4(v)=select(h,v) invmod(a,b)=trap(,0,Mod(a,b)^-1) sub2(n)=forsubgroup(G=[n,n],,print(matsnf(G))) gp2c-0.0.8/test2/gp/sums.gp0000644000175000017500000000025212155572710012265 00000000000000r(x)=round(x*1000)/1000 wallis(n)=intnum(x=0,Pi,sin(x)^n) dedeketa(s)=sumalt(n=1,(-1)^(n-1)/n^s) lambert(s)=solve(x=0,log(s),exp(x)-s*x) dgamma(s)=derivnum(x=s,gamma(x)) gp2c-0.0.8/test2/gp/call.gp0000644000175000017500000000046312155572710012215 00000000000000dist(x,y)=sqrtint(x^2+y^2) call(f) =f() call1(f,x)=f(x) call2(f,x,y)=f(x,y) call3(f,x,y,z)=print(f(x,y,z)) gen(T,x)=vector(#T,i,T[i](x)) baz(x)=gen([isprime,issquare,issquarefree],x) bar(z)=call2(kronecker,5,7) booz(z)=call2(dist,3,2) foo()=1 boor(x)=[foo][1](); toto1(x)=apply(sqrtint,x) buzz()=dist(3,2) gp2c-0.0.8/test2/Makefile.am0000644000175000017500000000041212155572710012372 00000000000000mostlyclean-generic: rm -f *.gp *.gp.[co] *.gp.so *.res dist-hook: cp -pR $(srcdir)/gp $(srcdir)/input $(srcdir)/res $(distdir) rm -rf $(distdir)/gp/CVS $(distdir)/input/CVS $(distdir)/res/CVS rm -rf $(distdir)/gp/.svn $(distdir)/input/.svn $(distdir)/res/.svn gp2c-0.0.8/Makefile.in0000644000175000017500000006317112165534611011354 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \ ChangeLog INSTALL NEWS config/depcomp config/install-sh \ config/missing config/ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags am__tty_colors = \ red=; grn=; lgn=; blu=; std= DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHOC = @ECHOC@ ECHON = @ECHON@ ECHOT = @ECHOT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GP2C_DBG = @GP2C_DBG@ GP2C_DBG1 = @GP2C_DBG1@ GP_PATH = @GP_PATH@ GP_PATH_DBG = @GP_PATH_DBG@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARI_DATADIR = @PARI_DATADIR@ PARI_DESC = @PARI_DESC@ PARI_MODULE_BUILD = @PARI_MODULE_BUILD@ PARI_MODULE_DEBUG = @PARI_MODULE_DEBUG@ PARI_RUNTEST = @PARI_RUNTEST@ PARI_VERSION = @PARI_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_PATH = @PERL_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ mybindir = @mybindir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = src desc scripts doc test test2 test3 EXTRA_DIST = BUGS gp2c gp2c-run gp2c-dbg TESTS = scripts/runtest all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ col="$$grn"; \ else \ col="$$red"; \ fi; \ echo "$${col}$$dashes$${std}"; \ echo "$${col}$$banner$${std}"; \ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ test -z "$$report" || echo "$${col}$$report$${std}"; \ echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \ ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-TESTS check-am clean \ clean-generic ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-hook dist-lzip dist-lzma dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-generic \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am dist-hook: test -d $(distdir)/config || mkdir $(distdir)/config for i in $(srcdir)/config/*; do \ test -f $$i && $(INSTALL_SCRIPT) $$i $(distdir)/config; done checkspaces: config/checkspaces # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: gp2c-0.0.8/README0000644000175000017500000000324612155572710010165 00000000000000GP2C, GP to C translator Copyright (C) 2000-2013 The PARI Group, Bordeaux. GP2C is part of the PARI/GP system, http://pari.math.u-bordeaux.fr/. New versions are available at and ========================================================================== To get started, read the manual in doc/gp2c.dvi or doc/html. You need PARI/GP installed to compile this package. The command provided are: gp2c file.gp Translate file.gp to C and output the resulting code to stdout. gp2c-run file.gp This will translate file.gp to C, compile it, and run a GP session including the compiled functions. This rely on install() working for external module so is not as portable as GP2C. However it is known to work on Linux, Solaris, OSF/1, Mac OS X, and Cygwin. gp2c-dbg file.gp [not installed by default] This does the same as gp2c-run but launch GP inside the C debugger, so you can debug your script. See the configure option '--with-paricfg-dbg' to enable it. Thanks for your support, and have fun ! Bill Allombert ======================================================================== GP2C is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY WHATSOEVER. Check the License for details. You should have received a copy of it, along with the package; see the file 'COPYING'. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. gp2c-0.0.8/Makefile.am0000644000175000017500000000047512156142054011335 00000000000000SUBDIRS = src desc scripts doc test test2 test3 EXTRA_DIST = BUGS gp2c gp2c-run gp2c-dbg TESTS = scripts/runtest dist-hook: test -d $(distdir)/config || mkdir $(distdir)/config for i in $(srcdir)/config/*; do \ test -f $$i && $(INSTALL_SCRIPT) $$i $(distdir)/config; done checkspaces: config/checkspaces gp2c-0.0.8/gp2c-run0000755000175000017500000000041711642144547010670 00000000000000#! /bin/sh #This file is part of the GP2C package # #This stupid shell script is Public Domain. # if test ! -f scripts/gp2c-run; then cat <&2 Package has not been configured. Please type ./configure to configure it. EOF exit 1; fi GP2C=./gp2c scripts/gp2c-run $* gp2c-0.0.8/test/0000755000175000017500000000000012217042364010333 500000000000000gp2c-0.0.8/test/res/0000755000175000017500000000000012156167324011132 500000000000000gp2c-0.0.8/test/res/if.res0000644000175000017500000000017012155572710012157 000000000000001 5 [0, 2] end 1 5 [0, 1] end 3 5 [2, 0] end 0 2 5 [1, 0] end 0 2 4 [0, 1] end g g 2 2 h 3 3 h [100000, 200000] [12, 0] gp2c-0.0.8/test/res/multiif.res0000644000175000017500000000015612156166676013251 00000000000000[1] [1] [1] [1] [1] [1] default [2] [2] [2] [2] default default [3] [3] default default default 0 1 2 default gp2c-0.0.8/test/res/sumprod.res0000644000175000017500000000030412141547407013251 0000000000000070 3386621706029845412513501979616206027407101056377880279852301473829656268554 3271776172678447667677355715741901509782957394190089337511608320000000000000 0000000000000 90271489869610542397 146 gp2c-0.0.8/test/res/gerepile.res0000644000175000017500000000020712141547407013356 00000000000000[1, 0, 0] [1, 0, 0] [1, 0, 0] [1, 0, 0] [1, 0, 0] [1, 0, 0] [1, 0, 0] [1, 0, 0] [1, 0, 0] [1, 0, 0] [[3]] [[3]] [1, 2] [1, 2] ["gp2c"] gp2c-0.0.8/test/res/affect.res0000644000175000017500000000100012155572710013002 00000000000000[[1, 1, 1, 1, 1], [2, 0, 0, 0, 0, 0; 1, 3, 0, 0, 0, 0; 1, 2, 4, 0, 0, 0; 1, 3, 3, 5, 0, 0; 1, 4, 6, 4, 6, 0; 1, 5, 10, 10, 5, 1]] [[1, 1, 1], [2, 0, 0, 0; 1, 3, 0, 0; 1, 2, 4, 0; 1, 3, 3, 1]] [[1, 3], [2, 1/2, 1/3, 1/4; 1/2, 1/3, 1/4, 1/5; 1/3, 1/4, 1/5, 1/6; 1/4, 1/5 , 1/6, 1/7]] [1, 2] [1, 1/2, 1/3, 1/4; 1/2, 1/3, 1/4, 1/5; 1/3, 1/4, 1/5, 1/6; 1/4, 1/5, 1/6, 1/ 7] [0, 2, 3, 4, 5] 458330 [1 0] [1 1] [1 0] [2 1] [1 0] [1 1] [1 0] [1 2] [1 0] [1 1] a is too small 0 [-3, 9, 1, 3] [4, 9, 1, 3] gp2c-0.0.8/test/res/forvec.res0000644000175000017500000000142412141547407013050 000000000000003 4 4 5 4 5 5 6 3 4 5 6 9 10 10 11 10 11 11 12 9 10 10 11 10 11 11 12 9 10 10 11 10 11 11 12 7723918609442037417844821879307588409406852561588760100219624258814011012043 2095155602539796609408955320659979831286242012381627657050096534990231420407 1346396411042480260305718507746494766288798698870859035531286297826743859242 1091554189424642041400325612363061180667162545314618205493105546850355020293 3930406813203132229657168686013396274515841399331299711053350396047611089528 1711342677257166459584889784809081703820196027635862366744751880730830266608 4040329159100356899945870393224912960692678547662202890807811834146011208211 7302148962254779492735958222034798357783463657812430256245866011571402442740 7362874031069199599526178887443344551249257663443982945591 [3, 2] [3, 2] gp2c-0.0.8/test/res/print.res0000644000175000017500000000014712141547407012721 00000000000000x^4 + 1x^4 + 1 [1, 1/2, 1/3; 1/2, 1/3, 1/4; 1/3, 1/4, 1/5][1, 1/2, 1/3; 1/2, 1/3, 1/4; 1/3, 1/4, 1/5] gp2c-0.0.8/test/res/read.res0000644000175000017500000000023612141547407012477 000000000000008186649319552898393079654597951351236 [66030319100549341396551971786221327184, 17812363643588632576460922366103285 027] 8186649319552898393079654597951351236 gp2c-0.0.8/test/res/member.res0000644000175000017500000000002312155572710013025 00000000000000[x^2 + 1, x^3 - 2] gp2c-0.0.8/test/res/args.res0000644000175000017500000000104712155572710012521 00000000000000[-1000000, -100, 100, 1000000]~ [1, 2, 3, 4, 5] [[5, 1, 2, 4, 3], [5, 1, 3, 2, 4], [5, 1, 4, 3, 2], [5, 3, 1, 4, 2], [5, 4, 1, 2, 3]] [5, 4, 3, 2, 1] [[5, 4, 1, 2, 3], [5, 3, 1, 4, 2], [5, 1, 4, 3, 2], [5, 1, 3, 2, 4], [5, 1, 2, 4, 3]] [1, 2, 3, 4, 5] [[5, 4, 3, 2, 1]] [5, 4, 3, 2, 1] [[5, 4, 3, 2, 1]] [1, 2, 3, 4, 5] [[5, 1, 2, 4, 3], [5, 1, 3, 2, 4], [5, 1, 4, 3, 2], [5, 3, 1, 4, 2], [5, 4, 1, 2, 3]] [5, 4, 3, 2, 1] [[5, 4, 1, 2, 3], [5, 3, 1, 4, 2], [5, 1, 4, 3, 2], [5, 1, 3, 2, 4], [5, 1, 2, 4, 3]] 0 4 4 4 2 2 1 6 6 5 3 7 ["ab", "abab"] gp2c-0.0.8/test/res/multiassign.res0000644000175000017500000000002712156142054014114 000000000000007 [0, 4, 5, [4, 5], 3] gp2c-0.0.8/test/res/matrix.res0000644000175000017500000000016012141547407013064 00000000000000[2, 1, 3; 5, 4, 6; 8, 7, 9] [2, 1; 4, 3; 6, 5; 8, 7] [1 1 1] [2 1 4] [3 1 9] 1 2 3 4 5 6 [1 2 3] [4 5 6] gp2c-0.0.8/test/res/cast.res0000644000175000017500000000011412155572710012511 000000000000004 ["1", "42", "4 + I", "0", "45", "[y^3 + y + 45]", "a", "7978886869909"] 3 gp2c-0.0.8/test/res/moveblock.res0000644000175000017500000000006411751724575013555 000000000000003 1 4 1 5 1 0 2 0 [[-2, -2]] 4 5 [2, 2] 2 1 2 3 end gp2c-0.0.8/test/res/initfunc.res0000644000175000017500000000107512155572710013405 00000000000000x^4 + 2 [7, 10; 15, 22] [32, 31, 30, 30, 29, 29, 29, 29, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25] [32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2] 1 32 2 31 3 30 4 30 5 29 gp2c-0.0.8/test/res/break.res0000644000175000017500000000005212141547407012644 000000000000001 8 1 1 0 1 0 1 0 0 0 1 0 1 0 0 0 1 0 1 0 gp2c-0.0.8/test/res/cleanvar.res0000644000175000017500000000000212155572710013346 000000000000001 gp2c-0.0.8/test/res/vector.res0000644000175000017500000021260312141547407013071 0000000000000015 8 4 2 x^2012 + 15*x^2011 + 120*x^2010 + 680*x^2009 + 3060*x^2008 + 11628*x^2007 + 38760*x^2006 + 116280*x^2005 + 319770*x^2004 + 817190*x^2003 + 1961256*x^200 2 + 4457400*x^2001 + 9657700*x^2000 + 20058300*x^1999 + 40116600*x^1998 + 77 558760*x^1997 + 145422675*x^1996 + 265182525*x^1995 + 471435600*x^1994 + 818 809200*x^1993 + 1391975640*x^1992 + 2319959400*x^1991 + 3796297200*x^1990 + 6107086800*x^1989 + 9669554100*x^1988 + 15084504396*x^1987 + 23206929840*x^1 986 + 35240152720*x^1985 + 52860229080*x^1984 + 78378960360*x^1983 + 1149558 08528*x^1982 + 166871334960*x^1981 + 239877544005*x^1980 + 341643774795*x^19 79 + 482320623240*x^1978 + 675248872536*x^1977 + 937845656300*x^1976 + 12927 06174900*x^1975 + 1768966344600*x^1974 + 2403979904200*x^1973 + 324537287067 0*x^1972 + 4353548972850*x^1971 + 5804731963800*x^1970 + 7694644696200*x^196 9 + 10142940735900*x^1968 + 13298522298180*x^1967 + 17345898649800*x^1966 + 22512762077400*x^1965 + 29078984349975*x^1964 + 37387265592825*x^1963 + 4785 5699958816*x^1962 + 60992558771040*x^1961 + 77413632286320*x^1960 + 97862516 286480*x^1959 + 123234279768160*x^1958 + 154603005527328*x^1957 + 1932537569 09160*x^1956 + 240719591939480*x^1955 + 298824321028320*x^1954 + 36973178703 5040*x^1953 + 456002537343216*x^1952 + 560658857389200*x^1951 + 687259244541 600*x^1950 + 839983521106400*x^1949 + 1023729916348425*x^1948 + 124422559063 8855*x^1947 + 1508152231077400*x^1946 + 1823288518168200*x^1945 + 2198671448 379300*x^1944 + 2644778698775100*x^1943 + 3173734438530120*x^1942 + 37995412 29226200*x^1941 + 4538340912686850*x^1940 + 5408707663065150*x^1939 + 643197 6680401800*x^1938 + 7632612327410136*x^1937 + 9038619861406740*x^1936 + 1068 2005290753420*x^1935 + 12599288291657880*x^1934 + 14832073558533960*x^1933 + 17427686431277403*x^1932 + 20439879147794485*x^1931 + 23929614612052080*x^1 930 + 27965935149024720*x^1929 + 32626924340528840*x^1928 + 3800077070249829 6*x^1927 + 44186942677323600*x^1926 + 51297485177122800*x^1925 + 59458448728 028700*x^1924 + 68811463134684900*x^1923 + 79515468511191440*x^1922 + 917486 17512913200*x^1921 + 105710363656182600*x^1920 + 121623751733457400*x^1919 + 139737927523546800*x^1918 + 160330885263858960*x^1917 + 183712472698171725* x^1916 + 210227674943268675*x^1915 + 240260199935164200*x^1914 + 27423638982 4985400*x^1913 + 312629484400483356*x^1912 + 355964264416391939*x^1911 + 404 822104630406505*x^1910 + 459846468366578159*x^1909 + 521748877569770815*x^19 08 + 591315394579071198*x^1907 + 669413654240449252*x^1906 + 757000487505526 859*x^1905 + 855130180330236697*x^1904 + 964963414500878489*x^1903 + 1087776 939982278611*x^1902 + 1224974031510342794*x^1901 + 1378095785446418477*x^190 0 + 1548833316380963848*x^1899 + 1739040916626724377*x^1898 + 19507502455848 79850*x^1897 + 2186185620009652790*x^1896 + 2447780480446148639*x^1895 + 273 8195113581500497*x^1894 + 3060335714939780009*x^1893 + 3417374881275973495*x ^1892 + 3812773627193276690*x^1891 + 4250305025931013150*x^1890 + 4734079579 957930629*x^1889 + 5268572432968103115*x^1888 + 5858652541125123701*x^1887 + 6509613927946015419*x^1886 + 7227209154070961339*x^1885 + 80176851403405638 14*x^1884 + 8887821490111249380*x^1883 + 9844971464594372643*x^1882 + 108971 05773218647191*x^1881 + 12052859349602234421*x^1880 + 13321581292694032027*x ^1879 + 14713388162017699209*x^1878 + 16239220825741415461*x^1877 + 17910905 070516384621*x^1876 + 19741216192693173685*x^1875 + 21743947801653048953*x^1 874 + 23933985077597903736*x^1873 + 26327382738243963300*x^1872 + 2894144798 1478449669*x^1871 + 31794828684182488191*x^1870 + 34907607151115893867*x^186 9 + 38301399722018706896*x^1868 + 41999462559929542630*x^1867 + 460268039591 71546695*x^1866 + 50410303527533049649*x^1865 + 55178838613892434119*x^1864 + 60363418369926292298*x^1863 + 65997325852618194606*x^1862 + 72116268593074 348588*x^1861 + 78758538076674649224*x^1860 + 85965178599866172579*x^1859 + 93780165989964630297*x^1858 + 102250596696191795198*x^1857 + 111426887782868 071338*x^1856 + 121362988379224393730*x^1855 + 132116603164722221302*x^1854 + 143749428494100792753*x^1853 + 156327401792633856996*x^1852 + 169920964879 301126600*x^1851 + 184605341903790646507*x^1850 + 200460832612475590342*x^18 49 + 217573121688781721086*x^1848 + 236033604944709471470*x^1847 + 255939733 172727465374*x^1846 + 277395374500843033109*x^1845 + 300511196128411155489*x ^1844 + 325405066356198156221*x^1843 + 352202477861402769485*x^1842 + 381036 993206787927950*x^1841 + 412050713612825302166*x^1840 + 44539477206283539895 7*x^1839 + 481229851853553584143*x^1838 + 519726731747401988561*x^1837 + 561 066858928034703838*x^1836 + 605442951007485354198*x^1835 + 65305962838151897 9011*x^1834 + 704134078279611668462*x^1833 + 758896751907389602818*x^1832 + 817592096132392641648*x^1831 + 880479321218725521600*x^1830 + 94783320617256 1714341*x^1829 + 1019944943318611264163*x^1828 + 1097123023787595184851*x^18 27 + 1179694165656526480965*x^1826 + 1268004286547223311142*x^1825 + 1362419 522554015471562*x^1824 + 1463327295439093978231*x^1823 + 1571137430103438280 105*x^1822 + 1686283324412780224849*x^1821 + 1809223173531672468344*x^1820 + 1940441250994466158964*x^1819 + 2080449248819913464651*x^1818 + 22297876790 56240293750*x^1817 + 2389027339225929246710*x^1816 + 2558770844224158676226* x^1815 + 2739654227311907357762*x^1814 + 2932348612934202672533*x^1813 + 313 7561964185910718181*x^1812 + 3356040907841887053433*x^1811 + 358857263996527 4825933*x^1810 + 3835986915207301090846*x^1809 + 4099158123014130734863*x^18 08 + 4379007454061239357408*x^1807 + 4676505160343410736123*x^1806 + 4992672 912458900328665*x^1805 + 5328586257739583028967*x^1804 + 5685377182995070650 141*x^1803 + 6064236785757892024613*x^1802 + 6466418058038925974620*x^1801 + 6893238786727414568473*x^1800 + 7346084574898110943125*x^1799 + 78264119884 19482462933*x^1798 + 8335751832391446007396*x^1797 + 8875712562078907603171* x^1796 + 9447983833148463228467*x^1795 + 10054340196160041103045*x^1794 + 10 696644940413077673814*x^1793 + 11376854092398069175828*x^1792 + 120970205742 59077238761*x^1791 + 12859298527831039415928*x^1790 + 1366594780997759234362 2*x^1789 + 14519338665120604771539*x^1788 + 15421956581021787850409*x^1787 + 16376407334049648320985*x^1786 + 17385422230341723667736*x^1785 + 184518635 49452533434352*x^1784 + 19578730197262043760628*x^1783 + 2076916357510771822 1060*x^1782 + 22026453672295462023383*x^1781 + 23354045389341002681052*x^178 0 + 24755545099493531801650*x^1779 + 26234727456297802251983*x^1778 + 277955 42455159374462636*x^1777 + 29442122757090375934921*x^1776 + 3117879128303001 9096386*x^1775 + 33010069087355253518898*x^1774 + 34940683519422347129414*x^ 1773 + 36975576682209934278221*x^1772 + 39119914197368172103159*x^1771 + 413 79094286217145054374*x^1770 + 43758757176480583970011*x^1769 + 4626479484478 8352641368*x^1768 + 48903361105233031913330*x^1767 + 51680882054522328122534 *x^1766 + 54604066884529976662791*x^1765 + 57679919073313328693715*x^1764 + 60915747965935923846915*x^1763 + 64319180756708086905895*x^1762 + 6789817488 4737962745316*x^1761 + 71661030854969440383090*x^1760 + 75616405497172130994 215*x^1759 + 79773325675641971358031*x^1758 + 84141202462669136621651*x^1757 + 88729845789132775514026*x^1756 + 93549479585889636110466*x^1755 + 9861075 7429935937548800*x^1754 + 103924778709638867035281*x^1753 + 1095031053236558 43954850*x^1752 + 115357778928486193351534*x^1751 + 121501338749931106362645 *x^1750 + 127946839974073729649530*x^1749 + 134707872733731911049549*x^1748 + 141798581706681523391857*x^1747 + 149233686342298378641828*x^1746 + 157028 501733621513312567*x^1745 + 165198960152200053455392*x^1744 + 17376163326344 9930486935*x^1743 + 182733755040615391447311*x^1742 + 1921332453958034995984 13*x^1741 + 201978734546937620840273*x^1740 + 212289588139858202134131*x^173 9 + 223085933145185930393226*x^1738 + 234388684549953571009607*x^1737 + 2462 19572864408377575099*x^1736 + 258601172464786887969963*x^1735 + 271556930793 268122593138*x^1734 + 285111198436719619990047*x^1733 + 29928926010626332145 3188*x^1732 + 314117366540104983262466*x^1731 + 329622767352491482933334*x^1 730 + 345833744852085019811573*x^1729 + 362779648853471711999819*x^1728 + 38 0490932505954377996794*x^1727 + 398999189164215275240911*x^1726 + 4183371903 25874157155591*x^1725 + 438538924661410108913274*x^1724 + 459639638162362128 951442*x^1723 + 481675875434173232558872*x^1722 + 504685522160495855091049*x ^1721 + 528707848766232410199859*x^1720 + 553783555307043892574361*x^1719 + 579954817613521279785839*x^1718 + 607265334718679053539812*x^1717 + 63576037 7597897291448681*x^1716 + 665486839250908335631893*x^1715 + 6964932861558958 78032155*x^1714 + 728830011126248262972800*x^1713 + 762549087600983738435562 *x^1712 + 797704425400343126606057*x^1711 + 834351827978524763685044*x^1710 + 872549051206017405478956*x^1709 + 912355863714468929900342*x^1708 + 953834 108837511905563902*x^1707 + 997047768181451246737604*x^1706 + 10420630268602 04042774077*x^1705 + 1088948340429367032719950*x^1704 + 11377745035547728850 88180*x^1703 + 1188614720451382224835678*x^1702 + 1241544677128844004473366* x^1701 + 1296642615480542117966574*x^1700 + 1353989409253430872599936*x^1699 + 1413668641936445827106135*x^1698 + 1475766686605759329764705*x^1697 + 154 0372787765631597355499*x^1696 + 1607579145224088108078948*x^1695 + 167748100 0043132175870415*x^1694 + 1750176722603677560714406*x^1693 + 182576790282585 9574097804*x^1692 + 1904359442585854078819312*x^1691 + 198605965037080176986 7600*x^1690 + 2070980338213899863537050*x^1689 + 2159236920952184514573740*x ^1688 + 2250948517849984618798729*x^1687 + 2346238056631480827859165*x^1686 + 2445232379966252283685050*x^1685 + 2548062354452137446716846*x^1684 + 2654 862982140174111522571*x^1683 + 2765773514646816937230772*x^1682 + 2880937569 899058223153952*x^1681 + 3000503251558498880669638*x^1680 + 3124623271170831 233208738*x^1679 + 3253455073087603053187699*x^1678 + 3387160962207532747827 636*x^1677 + 3525908234585038458782139*x^1676 + 3669869310954028660974727*x^ 1675 + 3819221873215378245576866*x^1674 + 3974149003936881656157892*x^1673 + 4134839328914833015251847*x^1672 + 4301487162846731924536542*x^1671 + 44742 92658164952333273357*x^1670 + 4653461957081540128588346*x^1669 + 48392073468 94622483843400*x^1668 + 5031747418607218078365433*x^1667 + 52313072289095316 38225506*x^1666 + 5438118465576098403167082*x^1665 + 56524196163294136533676 98*x^1664 + 5874456141221938880387654*x^1663 + 6104480648588619103132259*x^1 662 + 6342753074622274750569333*x^1661 + 6589540866624445991970172*x^1660 + 6845119169984466921396262*x^1659 + 7109771018939731120120799*x^1658 + 738378 7531170278348134657*x^1657 + 7667468106280983968850408*x^1656 + 796112062822 4767700261160*x^1655 + 8265061671720355917618663*x^1654 + 857961671271823150 9610854*x^1653 + 8905120342968486710598662*x^1652 + 924191648874435689054344 5*x^1651 + 9590358633775256473085186*x^1650 + 9950810046443161458690994*x^16 49 + 10323644011296185938541584*x^1648 + 10709244064933181977484928*x^1647 + 11108004236313152799740189*x^1646 + 11520329291543207805208067*x^1645 + 119 46634983198704050909200*x^1644 + 12387348304229111922655080*x^1643 + 1284290 7746503012265942665*x^1642 + 13313763564045477709818966*x^1641 + 13800378041 020911769049473*x^1640 + 14303225764514215012935548*x^1639 + 148227939021629 17607012247*x^1638 + 15359582484692661329169804*x^1637 + 1591410469340813119 6372986*x^1636 + 16486887152691226573589929*x^1635 + 17078470227557923534122 218*x^1634 + 17689408326324913761697541*x^1633 + 18320270208436709891268995* x^1632 + 18971639297503482339934199*x^1631 + 19644113999599437845143050*x^16 30 + 20338308026871064569015815*x^1629 + 21054850726504052211252702*x^1628 + 21794387415097147566684231*x^1627 + 22557579718490625836982630*x^1626 + 233 45105917096445231818330*x^1625 + 24157661296776506447898379*x^1624 + 2499595 8505314758972981519*x^1623 + 25860727914528182307583992*x^1622 + 26752717988 060921614791566*x^1621 + 27672695654905073487491394*x^1620 + 286214466886907 97955874799*x^1619 + 29599776092787577044348512*x^1618 + 3060850849125754762 9147273*x^1617 + 31648488525700906554443397*x^1616 + 32720581258032418449787 996*x^1615 + 33825672579227050975550505*x^1614 + 34964669624071717832332676* x^1613 + 36138501191959026338598099*x^1612 + 37348118173757803248618393*x^16 11 + 38594493984794009298466976*x^1610 + 39878625003974449287276341*x^1609 + 41201531019084439888691646*x^1608 + 42564255678289311416453220*x^1607 + 439 67866947868292020435479*x^1606 + 45413457576207952856822901*x^1605 + 4690214 5564080980259822117*x^1604 + 48435074641234585454039338*x^1603 + 50013414749 311363508678641*x^1602 + 51638362531123870680362239*x^1601 + 533111418263026 02665403941*x^1600 + 55033004173335425241394197*x^1599 + 5680522931801483299 0846932*x^1598 + 58629125728307690947946452*x^1597 + 60506031115660347787723 733*x^1596 + 62437312962750197293379423*x^1595 + 64424369057692907013950886* x^1594 + 66468628034712628997403164*x^1593 + 68571549921280557004550454*x^15 92 + 70734626691725197443174392*x^1591 + 72959382827315677191050622*x^1590 + 75247375882817320299058793*x^1589 + 77600197059516587095263480*x^1588 + 800 19471784710283278758517*x^1587 + 82506860297651713046338622*x^1586 + 8506405 8241944169001518939*x^1585 + 87692797264369822437943828*x^1584 + 90394845620 139700470162471*x^1583 + 93172008784548011325337077*x^1582 + 960261300710116 05850221263*x^1581 + 98959091255472841888936710*x^1580 + 1019728132071415486 29030397*x^1579 + 105069256525549170296871227*x^1578 + 108250422183885502730 417191*x^1577 + 111518352178585722410839085*x^1576 + 11487513018513264555921 9261*x^1575 + 118322882220036344987449066*x^1574 + 1218637773089503946429096 60*x^1573 + 125500028160881106336793025*x^1572 + 129233891848443170151510225 *x^1571 + 133067670494112109662676448*x^1570 + 137003711962420915588788621*x ^1569 + 141044410558045127024415798*x^1568 + 145192207729717488272722179*x^1 567 + 149449592779910121747731649*x^1566 + 153819103580218923768640612*x^156 5 + 158303327292381610646179576*x^1564 + 162904901094857517619103395*x^1563 + 167626512914893883318377068*x^1562 + 172470902165999937925293777*x^1561 + 177440860490746654482457411*x^1560 + 182539232508806520375500522*x^1559 + 18 7768916570144140318480840*x^1558 + 193132865513264893764958868*x^1557 + 1986 34087428425239075904644*x^1556 + 204275646425704584579430695*x^1555 + 210060 663407834933459299851*x^1554 + 215992316847680755841646881*x^1553 + 22207384 3570257748174099199*x^1552 + 228308539539175307699717695*x^1551 + 2346997606 47383679240878310*x^1550 + 241250923512102823376307194*x^1549 + 247965506273 806110199053830*x^1548 + 254847049399127961995673781*x^1547 + 26189915648756 0552229262414*x^1546 + 269125495081800618013898896*x^1545 + 2765297974816033 59739047744*x^1544 + 284115861560996285574045609*x^1543 + 291887551588701711 220628744*x^1542 + 299848799051612447482438509*x^1541 + 30800360348116100101 2842964*x^1540 + 316356033282418378045947378*x^1539 + 3249102265657543181015 80320*x^1538 + 333670391980886495706174741*x^1537 + 342640809553141914242300 802*x^1536 + 351825831521749378316317263*x^1535 + 36122988317997757073406342 0*x^1534 + 370857463716928878548297480*x^1533 + 380713147060794710969986492* x^1532 + 390801582723373631531533406*x^1531 + 401127496645649189098194395*x^ 1530 + 411695692044219878520484895*x^1529 + 422511050258369193312999975*x^15 28 + 433578531597559251172913481*x^1527 + 444903176189126979884922276*x^1526 + 456490104825957347700218738*x^1525 + 468344519813903610157920988*x^1524 + 480471705818720026101888079*x^1523 + 492877030712267970928353556*x^1522 + 5 05565946417751846505227331*x^1521 + 518543989753736656387481853*x^1520 + 531 816783276694583600104798*x^1519 + 545390036121823378085885507*x^1518 + 55926 9544841874833664630602*x^1517 + 573461194243727111797425611*x^1516 + 5879709 58222430153397450724*x^1515 + 602804900592448912209505831*x^1514 + 617969175 915824645754061434*x^1513 + 633470030326970014386604133*x^1512 + 64931380235 3809267575207721*x^1511 + 665506923734970340991802941*x^1510 + 6820559202327 31250415547366*x^1509 + 698967412441418750756423658*x^1508 + 716248116590952 832746085574*x^1507 + 733904845345226258058875561*x^1506 + 75194450859500398 7891697434*x^1505 + 770374114245023042444367131*x^1504 + 7892007689949690414 23461874*x^1503 + 808431679114001420787225362*x^1502 + 828074151208495100624 281311*x^1501 + 848135592982662195504523968*x^1500 + 86862351399171321406799 5021*x^1499 + 889545526387213091259235266*x^1498 + 9109093456542833367232934 67*x^1497 + 932722791340297568727757309*x^1496 + 954993787774713736854325083 *x^1495 + 977730364779682420923348149*x^1494 + 1000940658371066730502807634* x^1493 + 1024632911449505521253541597*x^1492 + 1048815474481147893635477225* x^1491 + 1073496806167683248520698185*x^1490 + 1098685474105287545418424790* x^1489 + 1124390155432102844718100624*x^1488 + 1150619637463863718016281807* x^1487 + 1177382818317280682639395106*x^1486 + 1204688707520787460347235139* x^1485 + 1232546426612255578351065523*x^1484 + 1260965209723276625664406856* x^1483 + 1289954404149609351891413472*x^1482 + 1319523470907385751321933897* x^1481 + 1349681985274667315125118297*x^1480 + 1380439637317939761001425752* x^1479 + 1411806232403131765357183932*x^1478 + 1443791691690740530400977992* x^1477 + 1476406052614644420023999392*x^1476 + 1509659469344180396415314224* x^1475 + 1543562213229061586576333429*x^1474 + 1578124673226708006734294322* x^1473 + 1613357356311561275608098254*x^1472 + 1649270887865952057044178481* x^1471 + 1685876012052086991203834988*x^1470 + 1723183592164720003730021439* x^1469 + 1761204610964071126627813226*x^1468 + 1799950170988554325428022803* x^1467 + 1839431494846874307028163466*x^1466 + 1879659925489050883869711318* x^1465 + 1920646926455928195254697511*x^1464 + 1962404082106724938054984419* x^1463 + 2004943097824180739237400327*x^1462 + 2048275800196852913915600845* x^1461 + 2092414137178117097427325944*x^1460 + 2137370178221424620588462479* x^1459 + 2183156114391369016139163576*x^1458 + 2229784258450113703798424725* x^1457 + 2277267044918732703586934896*x^1456 + 2325617030113016174446131603* x^1455 + 2374846892153292669932767639*x^1454 + 2424969430947820247136362035* x^1453 + 2475997568149298961158599673*x^1452 + 2527944347084057827688202572* x^1451 + 2580822932653470042552029620*x^1450 + 2634646611207151111742713053* x^1449 + 2689428790387495570402747243*x^1448 + 2745182998945109156639199275* x^1447 + 2801922886524694657872209905*x^1446 + 2859662223420951165668456239* x^1445 + 2918414900304048161624822769*x^1444 + 2978194927914237713756204091* x^1443 + 3039016436725170091873278504*x^1442 + 3100893676575480313438642702* x^1441 + 3163841016268215510147688119*x^1440 + 3227872943137675561734893216* x^1439 + 3293004062583242178952380823*x^1438 + 3359249097569774533954593655* x^1437 + 3426622888094152635051753061*x^1436 + 3495140390617552925517059930* x^1435 + 3564816677463044054349411261*x^1434 + 3635666936178094422053820055* x^1433 + 3707706468861586948001540482*x^1432 + 3780950691454940539112325813* x^1431 + 3855415132996941963747601662*x^1430 + 3931115434841896251043752351* x^1429 + 4008067349840708345618851370*x^1428 + 4086286741484513551763927236* x^1427 + 4165789583010479300930139870*x^1426 + 4246591956469405972532680208* x^1425 + 4328710051754759891733920680*x^1424 + 4412160165592777219800725493* x^1423 + 4496958700493283243646317999*x^1422 + 4583122163660877561990990680* x^1421 + 4670667165866141856865192408*x^1420 + 4759610420276533331520598655* x^1419 + 4849968741246633489726473040*x^1418 + 4941759043067428727354987892* x^1417 + 5034998338674306205472311952*x^1416 + 5129703738313455675150322862* x^1415 + 5225892448166375328119815476*x^1414 + 5323581768932187354346979975* x^1413 + 5422789094367476697700478284*x^1412 + 5523531909783374514078239162* x^1411 + 5625827790499616052593541426*x^1410 + 5729694400255311099511348867* x^1409 + 5835149489576173746329413411*x^1408 + 5942210894097967067383598175* x^1407 + 6050896532845927318209530777*x^1406 + 6161224406469941493115674890* x^1405 + 6273212595435261508434216413*x^1404 + 6386879258168547906048418775* x^1403 + 6502242629159045799294755293*x^1402 + 6619321017014705809364695836* x^1401 + 6738132802473072963956384852*x^1400 + 6858696436366776950134135982* x^1399 + 6981030437543467729038227115*x^1398 + 7105153390740051330053828102* x^1397 + 7231083944411091645010733600*x^1396 + 7358840808511255237568829812* x^1395 + 7488442752231687567680515541*x^1394 + 7619908601690220604351447300* x^1393 + 7753257237575323560193553672*x^1392 + 7888507592743720426735159345* x^1391 + 8025678649771610118285108682*x^1390 + 8164789438459437342410410207* x^1389 + 8305859033290174804755848706*x^1388 + 8448906550841090022890954913* x^1387 + 8593951147148982865902187994*x^1386 + 8741012015028892951249263891* x^1385 + 8890108381346289215572776913*x^1384 + 9041259504242767329179456856* x^1383 + 9194484670315294142250671575*x^1382 + 9349803191749052031733434773* x^1381 + 9507234403403949858600748555*x^1380 + 9666797659854881242834419301* x^1379 + 9828512332385825015118730417*x^1378 + 9992397805937897006773249847* x^1377 + 10158473476011476789739006290*x^1376 + 1032675874552254757321162380 4*x^1375 + 10497273021613402199441294017*x^1374 + 10670035712417883054852734 045*x^1373 + 10845066223781338720445443551*x^1372 + 110223839559354953237898 30209*x^1371 + 11202008300128455820120041000*x^1370 + 1138395863521005581822 9763519*x^1369 + 11568254324172820074201760126*x^1368 + 11754914710648779398 453737576*x^1367 + 11943959115362423455080596231*x^1366 + 121354068325400807 72845079854*x^1365 + 12329277126276033230155695098*x^1364 + 1252558922685568 8317625002656*x^1363 + 12724362327036148616888513667*x^1362 + 12925615578284 534158763839855*x^1361 + 13129368086974429632935616107*x^1360 + 133356389105 40844810473963944*x^1359 + 13544447053594093004859581641*x^1358 + 1375581146 3993008931941442605*x^1357 + 13969751028877943929456998386*x^1356 + 14186284 570663993157383239759*x^1355 + 14405430842994926116364775942*x^1354 + 146272 08526658308587609587315*x^1353 + 14851636225462320908705456882*x^1352 + 1507 8732462074794350466624662*x^1351 + 15308515673825004244773828755*x^1350 + 15 541004208468775426952480570*x^1349 + 15776216319917472493003626449*x^1348 + 16014170163931464326351931037*x^1347 + 16254883793778669315028110193*x^1346 + 16498375155858804652618166101*x^1345 + 16744662085293980089082413443*x^134 4 + 16993762301486293464805176307*x^1343 + 17245693403643102317052041531*x^1 342 + 17500472866270662786397650435*x^1341 + 17758118034636843965598127488*x ^1340 + 18018646120203642718718150552*x^1339 + 18282074196030240847929897794 *x^1338 + 18548419192147363293074930619*x^1337 + 188176978909037128085665047 68*x^1336 + 19089926922285273267207654855*x^1335 + 1936512275920829038466337 2453*x^1334 + 19643301712786755235264017783*x^1333 + 19924479927575232433101 687431*x^1332 + 20208673376787891275542927186*x^1331 + 204958978574946144828 14905214*x^1330 + 20786168985795075410688860927*x^1329 + 2107950219197169075 6913495852*x^1328 + 21375912715622371819341772263*x^1327 + 21675415600774013 288020145825*x^1326 + 21978025690977674358217835568*x^1325 + 222837576243864 22629791488547*x^1324 + 22592625828816826803714087264*x^1323 + 2290464451679 5099592335660720*x^1322 + 23219827680588907519262263198*x^1321 + 23538189087 225879390901817254*x^1320 + 23859742273499860167984504414*x^1319 + 241845005 40965971744968485687*x^1318 + 24512476950925556751431904430*x^1317 + 2484368 4319402095915571127881*x^1316 + 25178135212109203769016206881*x^1315 + 25515 841939411821517584933896*x^1314 + 25856816551281739747580957711*x^1313 + 262 01070832248597275063204169*x^1312 + 26548616296347515869449939286*x^1311 + 2 6899464182064543786163158519*x^1310 + 27253625447281094019077791557*x^1309 + 27611110764218575925646775844*x^1308 + 27971930514384431379082662296*x^1307 + 28336094783520798856271250350*x^1306 + 28703613356557040870584787123*x^13 05 + 29074495712567381898896218532*x^1304 + 29448751019734915425352229975*x^ 1303 + 29826388130323249924360360663*x^1302 + 30207415575657074525344895780* x^1301 + 30591841561112935735732653596*x^1300 + 3097967396112152693999582408 6*x^1299 + 31370920314182802435107806463*x^1298 + 31765587817895237500216132 250*x^1297 + 32163683324000565424517100034*x^1296 + 325652133334453315261021 78819*x^1295 + 32970183991460612979871472557*x^1294 + 3337860108266126172847 4897216*x^1293 + 33790470026166035870715905282*x^1292 + 34205795870739992701 075660239*x^1291 + 34624583289960524006201900785*x^1290 + 350468365774084213 03648013960*x^1289 + 35472559641885365429215970145*x^1288 + 3590175600265924 1236406854905*x^1287 + 36334428784738684159255969066*x^1286 + 36770580714178 271002856095287*x^1285 + 37210214113415772558874715755*x^1284 + 376533308966 42890491165700724*x^1283 + 38099932565210905394077950704*x^1282 + 3855002020 3072666988287886520*x^1281 + 39003594472262361081048133396*x^1280 + 39460655 608414491174876010789*x^1279 + 39921203416323515456236258842*x^1278 + 403852 37265545582329148273084*x^1277 + 40852756086043809673428912736*x^1276 + 4132 3758363878554599144797043*x^1275 + 41798242136944121633589860525*x^1274 + 42 276204990753358010644252037*x^1273 + 42757644054271585030753998649*x^1272 + 43242555995801314319169475856*x^1271 + 43730937018919197226797138872*x^1270 + 44222782858466654588488442545*x^1269 + 44718088776595632574382909744*x^126 8 + 45216849558870928437747068918*x^1267 + 45719059510430527574455704397*x^1 266 + 46224712452205390461837199588*x^1265 + 46733801717200124735186084024*x ^1264 + 47246320146835973886115595691*x^1263 + 47762260087357549825512730837 *x^1262 + 48281613386304731842750853510*x^1261 + 488043713890511493097469682 16*x^1260 + 49330524935410659821314300798*x^1259 + 4986006435631322833010557 5621*x^1258 + 50392979470551606223477594541*x^1257 + 50929259581600202199204 188005*x^1256 + 51468893474507529225656456538*x^1255 + 520118694128636038185 55756283*x^1254 + 52558175135843665329552327533*x^1253 + 5310779785532957392 0725651020*x^1252 + 53660724253110236392846612780*x^1251 + 54216940478162399 043263243108*x^1250 + 54776432144013136251121363310*x^1249 + 553391843261853 52523033881514*x^1248 + 55905181559727604281168822910*x^1247 + 5647440783682 9535738115013998*x^1246 + 57046846604524210779062923321*x^1245 + 57622480762 478609862243637721*x^1244 + 58201292660873547553819467752*x^1243 + 587832640 98374252434315416018*x^1242 + 59368376320192836751204912016*x^1241 + 5995661 0016243868347582939719*x^1240 + 60547945319394242071326832194*x^1239 + 61142 361803808532064296960506*x^1238 + 61739838483390990048689872294*x^1237 + 623 40353810325337969535509213*x^1236 + 62943885673713486120625656819*x^1235 + 6 3550411398314290178158253003*x^1234 + 64159907743383442394555273601*x^1233 + 64772350901615573566922776754*x^1232 + 65387716498189623293321176366*x^1231 + 66005979589918516468441637838*x^1230 + 66627114664504163951669275955*x^12 29 + 67251095639898784868273125905*x^1228 + 67877895863773527082203014170*x^ 1227 + 68507488113095341010489484860*x^1226 + 69139844593813040138518242958* x^1225 + 69774936940653459346656624542*x^1224 + 7041273621702859947620550692 7*x^1223 + 71053212915054623450982088605*x^1222 + 71696336955683545734739927 746*x^1221 + 72342077688948432949021262220*x^1220 + 729904038943229091060168 37032*x^1219 + 73641283781195734131868461894*x^1218 + 7429468498946119917306 0957924*x^1217 + 74950574590226056597767099573*x^1216 + 75608919086633676631 067035446*x^1215 + 76269684414806096203878086668*x^1214 + 769328359449045988 56396324194*x^1213 + 77598338482309437424240083669*x^1212 + 7826615626891928 3755845961185*x^1211 + 78936252984570961869722932258*x^1210 + 79608591748579 992766816274523*x^1209 + 80283135121402450573537657540*x^1208 + 809598451064 18600812218537015*x^1207 + 81638683151838762385246221217*x^1206 + 8231961015 2731805324517046296*x^1205 + 83002586453176666506824418881*x^1204 + 83687571 848537235376288441004*x^1203 + 84374525587860931254985629697*x^1202 + 850634 06376401263070766686492*x^1201 + 85754172378264631295227461714*x^1200 + 8644 6781219181600573446210886*x^1199 + 87141189989402839949092427374*x^1198 + 87 837355246719895752670347573*x^1197 + 88535233019610930135950360270*x^1196 + 89234778810511525911173326810*x^1195 + 89935947599210625798635405668*x^1194 + 90638693846371641410160565393*x^1193 + 91342971497178734308264864323*x^119 2 + 92048733985108238291162202051*x^1191 + 92755934235825158671935108815*x^1 190 + 93464524671204650756100688503*x^1189 + 94174457213478345985467281560*x ^1188 + 94885683289505360317746477326*x^1187 + 95598153835167785361117664498 *x^1186 + 96311819299890428591210025616*x^1185 + 970266296512845346552497402 88*x^1184 + 97742534379915185325002946576*x^1183 + 9845948250419204110731372 2799*x^1182 + 99177422575383052869274569623*x^1181 + 99896302682750737095252 042826*x^1180 + 100616070458810573576089869125*x^1179 + 10133667308471104944 7879922303*x^1178 + 102058057295734838559864115866*x^1177 + 1027801693869205 70169522346193*x^1176 + 103502955218804605949002375668*x^1175 + 104226360223 282209252116742542*x^1174 + 104950329409587455546595593360*x^1173 + 10567480 7370391197873631204674*x^1172 + 106399738288016366167526451083*x^1171 + 1071 25065940769844264066035217*x^1170 + 107850733709390133458716003042*x^1169 + 108576684583609976556619337880*x^1168 + 109302861168833081497329664898*x^116 7 + 110029205692924048850084327104*x^1166 + 110755660013110572771967541038*x ^1165 + 111482165622996950413386990737*x^1164 + 1122086636596879002547393380 83*x^1163 + 112935094911021655476846754716*x^1162 + 113661399822911264217596 989952*x^1161 + 114387518506792994460112628872*x^1160 + 11511339074718070734 5615099847*x^1159 + 115838956009325028918840173276*x^1158 + 1165641534469761 16707304512399*x^1157 + 117288921910248784119808850437*x^1156 + 118013199953 588712436170667198*x^1155 + 118736925843838447161167767677*x^1154 + 11946003 7568401842742881031714*x^1153 + 120182472843505587120859373097*x^1152 + 1209 04169122556405284569932163*x^1151 + 121625063604592508999182072000*x^1150 + 122345093242827828105563507580*x^1149 + 123064194753287527336093107174*x^114 8 + 123782304623533281419118664614*x^1147 + 124499359121476750384154486515*x ^1146 + 125215294304279666438707628389*x^1145 + 1259300460273389135773624146 87*x^1144 + 126643549953354951215789862889*x^1143 + 127355741561481903627956 486275*x^1142 + 128066556156557607815180991809*x^1141 + 12877592887841188366 1938903292*x^1140 + 129483794711251261846466728214*x^1139 + 1301900884931183 76985198240350*x^1138 + 130894744925424205909707139318*x^1137 + 131597698582 551303813861637177*x^1136 + 132298883921526164277939208547*x^1135 + 13299823 5291758802886014023541*x^1134 + 133695686944847638313409558705*x^1133 + 1343 91173044447719382678073207*x^1132 + 135084627676200321679575557358*x^1131 + 135775984857721912894864506597*x^1130 + 136465178548650462123382767550*x^112 9 + 137152142660747044918411963782*x^1128 + 137836811068050672976568474505*x ^1127 + 138519117617084254925681826137*x^1126 + 1391989961371095728147270682 09*x^1125 + 139876380450429137569991689849*x^1124 + 140551204382732765894277 289975*x^1123 + 141223401773486700854891852185*x^1122 + 14189290648636307874 0143325635*x^1121 + 142559652419707525671491499207*x^1120 + 1432235735170426 48947770220056*x^1119 + 143884603777605170177094497012*x^1118 + 144542677266 914429929173146601*x^1117 + 145197728127369976923527453787*x^1116 + 14584969 0588875938665150144765*x^1115 + 146498498979489854955813808935*x^1114 + 1471 44087736093640853743969299*x^1113 + 147786391415084331433699281803*x^1112 + 148425344703082247120436288171*x^1111 + 149060882427654205437658375711*x^111 0 + 149692939568049392738227719940*x^1109 + 150321451265945497865811481918*x ^1108 + 150946352836202698749179718365*x^1107 + 1515675797776230826537935369 02*x^1106 + 152185067783713071216617198040*x^1105 + 152798752753446412474531 557056*x^1104 + 153408570802025293869365396664*x^1103 + 15401445827163712267 8212669457*x^1102 + 154616351742204513480951662809*x^1101 + 1552141880421260 16142075765648*x^1100 + 155807904259005112355196587072*x^1099 + 156397437750 365004079760708953*x^1098 + 156982726154346713194261569909*x^1097 + 15756370 7400388008401914192673*x^1096 + 158140319719880672856533119052*x^1095 + 1587 12501656803624131105689806*x^1094 + 159280192078329397031926851118*x^1093 + 159843330185401499369549922151*x^1092 + 160401855523280151136349363934*x^109 1 + 160955707992053918611071420996*x^1090 + 161504827857114756714995786948*x ^1089 + 162049155759593975483618472571*x^1088 + 1625886327267566497932070331 41*x^1087 + 163123200182351995494029280789*x^1086 + 163652799956917239852110 481957*x^1085 + 164177374298032519689365750882*x^1084 + 16469686588052434683 7956095019*x^1083 + 165211217816615187488538166649*x^1082 + 1657203736660167 09713266130437*x^1081 + 166224277445964261882242728311*x^1080 + 166722873641 190153865625503265*x^1079 + 167216107213833322821529245754*x^1078 + 16770392 3613282976010719079915*x^1077 + 168186268785953814451088262892*x^1076 + 1686 63089184990453326024915442*x^1075 + 169134331779898667888693081053*x^1074 + 169599944066101107156422961295*x^1073 + 170059874074415131962997269013*x^107 2 + 170514070380450448928547437228*x^1071 + 170962482113924227613685328163*x ^1070 + 171405058967891404542782631979*x^1069 + 1718417512078878949071008581 37*x^1068 + 172272509680984450587640224568*x^1067 + 172697285824748921665728 452012*x^1066 + 173116031676114697811866381796*x^1065 + 17352869988015312585 5286977583*x^1064 + 173935243698747720432914205544*x^1063 + 1743356170191680 05891522642333*x^1062 + 174729774362540849565240772915*x^1061 + 175117670892 217169166205099633*x^1060 + 175499262422031920303005481661*x^1059 + 17587450 5424455294073166410630*x^1058 + 176243357038633079255642873230*x^1057 + 1766 05775078314168850290707633*x^1056 + 176961718039663216566378830509*x^1055 + 177311145108956475344086917477*x^1054 + 177654016170158877093985674098*x^105 3 + 177990291812380440551905009500*x^1052 + 178319933337210122462306823356*x ^1051 + 178642902765925256214016440725*x^1050 + 1789591628465747515494296436 04*x^1049 + 179268677060934259043380343524*x^1048 + 179571409631331533691789 788099*x^1047 + 179867325527340263153870499141*x^1046 + 18015639047234065794 5664976965*x^1045 + 180438570949945133177491357196*x^1044 + 1807138342102874 44253672583983*x^1043 + 180982148276173672299768818019*x^1042 + 181243481949 093488940244517596*x^1041 + 181497804815090164407718624924*x^1040 + 18174508 7250487817813115954032*x^1039 + 181985300427474443733422142606*x^1038 + 1822 18416319539285069423795299*x^1037 + 182444407706763158378692581222*x^1036 + 182663248180960374587876483522*x^1035 + 182874912150670935121653284396*x^103 4 + 183079374846001721041875809714*x^1033 + 183276612323315430757729820313*x ^1032 + 183466601469766060234211726917*x^1031 + 1836493200076797583798406106 65*x^1030 + 183824746498779929423026033945*x^1029 + 183992860348255493577555 679235*x^1028 + 184153641808671257138742617596*x^1027 + 18430707198371938333 0245150488*x^1026 + 184453132831810995724678119122*x^1025 + 1845918071695069 86875984841499*x^1024 + 184723078674787145915125869337*x^1023 + 184846931890 156760259842869341*x^1022 + 184963352225589888260842272728*x^1021 + 18507232 5961308541537378900861*x^1020 + 185173840250397057931470473857*x^1019 + 1852 67883121250988418311673483*x^1018 + 185354443479859863937264359390*x^1017 + 185433511111923250939378080770*x^1016 + 185505076684799547469963213412*x^101 5 + 185569131749287014804445749791*x^1014 + 185625668741236583018657967428*x ^1013 + 185674680982996012386880333483*x^1012 + 1857161626846850361483072987 39*x^1011 + 185750108945301153951071483648*x^1010 + 185776515753655789158389 114346*x^1009 + 185795379989140567169605353939*x^1008 + 18580669942232351595 5706728859*x^1007 + 185810472715375034119984364263*x^1006 + 1858066994223235 15955706728859*x^1005 + 185795379989140567169605353939*x^1004 + 185776515753 655789158389114346*x^1003 + 185750108945301153951071483648*x^1002 + 18571616 2684685036148307298739*x^1001 + 185674680982996012386880333483*x^1000 + 1856 25668741236583018657967428*x^999 + 185569131749287014804445749791*x^998 + 18 5505076684799547469963213412*x^997 + 185433511111923250939378080770*x^996 + 185354443479859863937264359390*x^995 + 185267883121250988418311673483*x^994 + 185173840250397057931470473857*x^993 + 185072325961308541537378900861*x^99 2 + 184963352225589888260842272728*x^991 + 184846931890156760259842869341*x^ 990 + 184723078674787145915125869337*x^989 + 184591807169506986875984841499* x^988 + 184453132831810995724678119122*x^987 + 18430707198371938333024515048 8*x^986 + 184153641808671257138742617596*x^985 + 183992860348255493577555679 235*x^984 + 183824746498779929423026033945*x^983 + 1836493200076797583798406 10665*x^982 + 183466601469766060234211726917*x^981 + 18327661232331543075772 9820313*x^980 + 183079374846001721041875809714*x^979 + 182874912150670935121 653284396*x^978 + 182663248180960374587876483522*x^977 + 1824444077067631583 78692581222*x^976 + 182218416319539285069423795299*x^975 + 18198530042747444 3733422142606*x^974 + 181745087250487817813115954032*x^973 + 181497804815090 164407718624924*x^972 + 181243481949093488940244517596*x^971 + 1809821482761 73672299768818019*x^970 + 180713834210287444253672583983*x^969 + 18043857094 9945133177491357196*x^968 + 180156390472340657945664976965*x^967 + 179867325 527340263153870499141*x^966 + 179571409631331533691789788099*x^965 + 1792686 77060934259043380343524*x^964 + 178959162846574751549429643604*x^963 + 17864 2902765925256214016440725*x^962 + 178319933337210122462306823356*x^961 + 177 990291812380440551905009500*x^960 + 177654016170158877093985674098*x^959 + 1 77311145108956475344086917477*x^958 + 176961718039663216566378830509*x^957 + 176605775078314168850290707633*x^956 + 176243357038633079255642873230*x^955 + 175874505424455294073166410630*x^954 + 175499262422031920303005481661*x^9 53 + 175117670892217169166205099633*x^952 + 174729774362540849565240772915*x ^951 + 174335617019168005891522642333*x^950 + 173935243698747720432914205544 *x^949 + 173528699880153125855286977583*x^948 + 1731160316761146978118663817 96*x^947 + 172697285824748921665728452012*x^946 + 17227250968098445058764022 4568*x^945 + 171841751207887894907100858137*x^944 + 171405058967891404542782 631979*x^943 + 170962482113924227613685328163*x^942 + 1705140703804504489285 47437228*x^941 + 170059874074415131962997269013*x^940 + 16959994406610110715 6422961295*x^939 + 169134331779898667888693081053*x^938 + 168663089184990453 326024915442*x^937 + 168186268785953814451088262892*x^936 + 1677039236132829 76010719079915*x^935 + 167216107213833322821529245754*x^934 + 16672287364119 0153865625503265*x^933 + 166224277445964261882242728311*x^932 + 165720373666 016709713266130437*x^931 + 165211217816615187488538166649*x^930 + 1646968658 80524346837956095019*x^929 + 164177374298032519689365750882*x^928 + 16365279 9956917239852110481957*x^927 + 163123200182351995494029280789*x^926 + 162588 632726756649793207033141*x^925 + 162049155759593975483618472571*x^924 + 1615 04827857114756714995786948*x^923 + 160955707992053918611071420996*x^922 + 16 0401855523280151136349363934*x^921 + 159843330185401499369549922151*x^920 + 159280192078329397031926851118*x^919 + 158712501656803624131105689806*x^918 + 158140319719880672856533119052*x^917 + 157563707400388008401914192673*x^91 6 + 156982726154346713194261569909*x^915 + 156397437750365004079760708953*x^ 914 + 155807904259005112355196587072*x^913 + 155214188042126016142075765648* x^912 + 154616351742204513480951662809*x^911 + 15401445827163712267821266945 7*x^910 + 153408570802025293869365396664*x^909 + 152798752753446412474531557 056*x^908 + 152185067783713071216617198040*x^907 + 1515675797776230826537935 36902*x^906 + 150946352836202698749179718365*x^905 + 15032145126594549786581 1481918*x^904 + 149692939568049392738227719940*x^903 + 149060882427654205437 658375711*x^902 + 148425344703082247120436288171*x^901 + 1477863914150843314 33699281803*x^900 + 147144087736093640853743969299*x^899 + 14649849897948985 4955813808935*x^898 + 145849690588875938665150144765*x^897 + 145197728127369 976923527453787*x^896 + 144542677266914429929173146601*x^895 + 1438846037776 05170177094497012*x^894 + 143223573517042648947770220056*x^893 + 14255965241 9707525671491499207*x^892 + 141892906486363078740143325635*x^891 + 141223401 773486700854891852185*x^890 + 140551204382732765894277289975*x^889 + 1398763 80450429137569991689849*x^888 + 139198996137109572814727068209*x^887 + 13851 9117617084254925681826137*x^886 + 137836811068050672976568474505*x^885 + 137 152142660747044918411963782*x^884 + 136465178548650462123382767550*x^883 + 1 35775984857721912894864506597*x^882 + 135084627676200321679575557358*x^881 + 134391173044447719382678073207*x^880 + 133695686944847638313409558705*x^879 + 132998235291758802886014023541*x^878 + 132298883921526164277939208547*x^8 77 + 131597698582551303813861637177*x^876 + 130894744925424205909707139318*x ^875 + 130190088493118376985198240350*x^874 + 129483794711251261846466728214 *x^873 + 128775928878411883661938903292*x^872 + 1280665561565576078151809918 09*x^871 + 127355741561481903627956486275*x^870 + 12664354995335495121578986 2889*x^869 + 125930046027338913577362414687*x^868 + 125215294304279666438707 628389*x^867 + 124499359121476750384154486515*x^866 + 1237823046235332814191 18664614*x^865 + 123064194753287527336093107174*x^864 + 12234509324282782810 5563507580*x^863 + 121625063604592508999182072000*x^862 + 120904169122556405 284569932163*x^861 + 120182472843505587120859373097*x^860 + 1194600375684018 42742881031714*x^859 + 118736925843838447161167767677*x^858 + 11801319995358 8712436170667198*x^857 + 117288921910248784119808850437*x^856 + 116564153446 976116707304512399*x^855 + 115838956009325028918840173276*x^854 + 1151133907 47180707345615099847*x^853 + 114387518506792994460112628872*x^852 + 11366139 9822911264217596989952*x^851 + 112935094911021655476846754716*x^850 + 112208 663659687900254739338083*x^849 + 111482165622996950413386990737*x^848 + 1107 55660013110572771967541038*x^847 + 110029205692924048850084327104*x^846 + 10 9302861168833081497329664898*x^845 + 108576684583609976556619337880*x^844 + 107850733709390133458716003042*x^843 + 107125065940769844264066035217*x^842 + 106399738288016366167526451083*x^841 + 105674807370391197873631204674*x^84 0 + 104950329409587455546595593360*x^839 + 104226360223282209252116742542*x^ 838 + 103502955218804605949002375668*x^837 + 102780169386920570169522346193* x^836 + 102058057295734838559864115866*x^835 + 10133667308471104944787992230 3*x^834 + 100616070458810573576089869125*x^833 + 998963026827507370952520428 26*x^832 + 99177422575383052869274569623*x^831 + 984594825041920411073137227 99*x^830 + 97742534379915185325002946576*x^829 + 970266296512845346552497402 88*x^828 + 96311819299890428591210025616*x^827 + 955981538351677853611176644 98*x^826 + 94885683289505360317746477326*x^825 + 941744572134783459854672815 60*x^824 + 93464524671204650756100688503*x^823 + 927559342358251586719351088 15*x^822 + 92048733985108238291162202051*x^821 + 913429714971787343082648643 23*x^820 + 90638693846371641410160565393*x^819 + 899359475992106257986354056 68*x^818 + 89234778810511525911173326810*x^817 + 885352330196109301359503602 70*x^816 + 87837355246719895752670347573*x^815 + 871411899894028399490924273 74*x^814 + 86446781219181600573446210886*x^813 + 857541723782646312952274617 14*x^812 + 85063406376401263070766686492*x^811 + 843745255878609312549856296 97*x^810 + 83687571848537235376288441004*x^809 + 830025864531766665068244188 81*x^808 + 82319610152731805324517046296*x^807 + 816386831518387623852462212 17*x^806 + 80959845106418600812218537015*x^805 + 802831351214024505735376575 40*x^804 + 79608591748579992766816274523*x^803 + 789362529845709618697229322 58*x^802 + 78266156268919283755845961185*x^801 + 775983384823094374242400836 69*x^800 + 76932835944904598856396324194*x^799 + 762696844148060962038780866 68*x^798 + 75608919086633676631067035446*x^797 + 749505745902260565977670995 73*x^796 + 74294684989461199173060957924*x^795 + 736412837811957341318684618 94*x^794 + 72990403894322909106016837032*x^793 + 723420776889484329490212622 20*x^792 + 71696336955683545734739927746*x^791 + 710532129150546234509820886 05*x^790 + 70412736217028599476205506927*x^789 + 697749369406534593466566245 42*x^788 + 69139844593813040138518242958*x^787 + 685074881130953410104894848 60*x^786 + 67877895863773527082203014170*x^785 + 672510956398987848682731259 05*x^784 + 66627114664504163951669275955*x^783 + 660059795899185164684416378 38*x^782 + 65387716498189623293321176366*x^781 + 647723509016155735669227767 54*x^780 + 64159907743383442394555273601*x^779 + 635504113983142901781582530 03*x^778 + 62943885673713486120625656819*x^777 + 623403538103253379695355092 13*x^776 + 61739838483390990048689872294*x^775 + 611423618038085320642969605 06*x^774 + 60547945319394242071326832194*x^773 + 599566100162438683475829397 19*x^772 + 59368376320192836751204912016*x^771 + 587832640983742524343154160 18*x^770 + 58201292660873547553819467752*x^769 + 576224807624786098622436377 21*x^768 + 57046846604524210779062923321*x^767 + 564744078368295357381150139 98*x^766 + 55905181559727604281168822910*x^765 + 553391843261853525230338815 14*x^764 + 54776432144013136251121363310*x^763 + 542169404781623990432632431 08*x^762 + 53660724253110236392846612780*x^761 + 531077978553295739207256510 20*x^760 + 52558175135843665329552327533*x^759 + 520118694128636038185557562 83*x^758 + 51468893474507529225656456538*x^757 + 509292595816002021992041880 05*x^756 + 50392979470551606223477594541*x^755 + 498600643563132283301055756 21*x^754 + 49330524935410659821314300798*x^753 + 488043713890511493097469682 16*x^752 + 48281613386304731842750853510*x^751 + 477622600873575498255127308 37*x^750 + 47246320146835973886115595691*x^749 + 467338017172001247351860840 24*x^748 + 46224712452205390461837199588*x^747 + 457190595104305275744557043 97*x^746 + 45216849558870928437747068918*x^745 + 447180887765956325743829097 44*x^744 + 44222782858466654588488442545*x^743 + 437309370189191972267971388 72*x^742 + 43242555995801314319169475856*x^741 + 427576440542715850307539986 49*x^740 + 42276204990753358010644252037*x^739 + 417982421369441216335898605 25*x^738 + 41323758363878554599144797043*x^737 + 408527560860438096734289127 36*x^736 + 40385237265545582329148273084*x^735 + 399212034163235154562362588 42*x^734 + 39460655608414491174876010789*x^733 + 390035944722623610810481333 96*x^732 + 38550020203072666988287886520*x^731 + 380999325652109053940779507 04*x^730 + 37653330896642890491165700724*x^729 + 372102141134157725588747157 55*x^728 + 36770580714178271002856095287*x^727 + 363344287847386841592559690 66*x^726 + 35901756002659241236406854905*x^725 + 354725596418853654292159701 45*x^724 + 35046836577408421303648013960*x^723 + 346245832899605240062019007 85*x^722 + 34205795870739992701075660239*x^721 + 337904700261660358707159052 82*x^720 + 33378601082661261728474897216*x^719 + 329701839914606129798714725 57*x^718 + 32565213333445331526102178819*x^717 + 321636833240005654245171000 34*x^716 + 31765587817895237500216132250*x^715 + 313709203141828024351078064 63*x^714 + 30979673961121526939995824086*x^713 + 305918415611129357357326535 96*x^712 + 30207415575657074525344895780*x^711 + 298263881303232499243603606 63*x^710 + 29448751019734915425352229975*x^709 + 290744957125673818988962185 32*x^708 + 28703613356557040870584787123*x^707 + 283360947835207988562712503 50*x^706 + 27971930514384431379082662296*x^705 + 276111107642185759256467758 44*x^704 + 27253625447281094019077791557*x^703 + 268994641820645437861631585 19*x^702 + 26548616296347515869449939286*x^701 + 262010708322485972750632041 69*x^700 + 25856816551281739747580957711*x^699 + 255158419394118215175849338 96*x^698 + 25178135212109203769016206881*x^697 + 248436843194020959155711278 81*x^696 + 24512476950925556751431904430*x^695 + 241845005409659717449684856 87*x^694 + 23859742273499860167984504414*x^693 + 235381890872258793909018172 54*x^692 + 23219827680588907519262263198*x^691 + 229046445167950995923356607 20*x^690 + 22592625828816826803714087264*x^689 + 222837576243864226297914885 47*x^688 + 21978025690977674358217835568*x^687 + 216754156007740132880201458 25*x^686 + 21375912715622371819341772263*x^685 + 210795021919716907569134958 52*x^684 + 20786168985795075410688860927*x^683 + 204958978574946144828149052 14*x^682 + 20208673376787891275542927186*x^681 + 199244799275752324331016874 31*x^680 + 19643301712786755235264017783*x^679 + 193651227592082903846633724 53*x^678 + 19089926922285273267207654855*x^677 + 188176978909037128085665047 68*x^676 + 18548419192147363293074930619*x^675 + 182820741960302408479298977 94*x^674 + 18018646120203642718718150552*x^673 + 177581180346368439655981274 88*x^672 + 17500472866270662786397650435*x^671 + 172456934036431023170520415 31*x^670 + 16993762301486293464805176307*x^669 + 167446620852939800890824134 43*x^668 + 16498375155858804652618166101*x^667 + 162548837937786693150281101 93*x^666 + 16014170163931464326351931037*x^665 + 157762163199174724930036264 49*x^664 + 15541004208468775426952480570*x^663 + 153085156738250042447738287 55*x^662 + 15078732462074794350466624662*x^661 + 148516362254623209087054568 82*x^660 + 14627208526658308587609587315*x^659 + 144054308429949261163647759 42*x^658 + 14186284570663993157383239759*x^657 + 139697510288779439294569983 86*x^656 + 13755811463993008931941442605*x^655 + 135444470535940930048595816 41*x^654 + 13335638910540844810473963944*x^653 + 131293680869744296329356161 07*x^652 + 12925615578284534158763839855*x^651 + 127243623270361486168885136 67*x^650 + 12525589226855688317625002656*x^649 + 123292771262760332301556950 98*x^648 + 12135406832540080772845079854*x^647 + 119439591153624234550805962 31*x^646 + 11754914710648779398453737576*x^645 + 115682543241728200742017601 26*x^644 + 11383958635210055818229763519*x^643 + 112020083001284558201200410 00*x^642 + 11022383955935495323789830209*x^641 + 108450662237813387204454435 51*x^640 + 10670035712417883054852734045*x^639 + 104972730216134021994412940 17*x^638 + 10326758745522547573211623804*x^637 + 101584734760114767897390062 90*x^636 + 9992397805937897006773249847*x^635 + 9828512332385825015118730417 *x^634 + 9666797659854881242834419301*x^633 + 9507234403403949858600748555*x ^632 + 9349803191749052031733434773*x^631 + 9194484670315294142250671575*x^6 30 + 9041259504242767329179456856*x^629 + 8890108381346289215572776913*x^628 + 8741012015028892951249263891*x^627 + 8593951147148982865902187994*x^626 + 8448906550841090022890954913*x^625 + 8305859033290174804755848706*x^624 + 8 164789438459437342410410207*x^623 + 8025678649771610118285108682*x^622 + 788 8507592743720426735159345*x^621 + 7753257237575323560193553672*x^620 + 76199 08601690220604351447300*x^619 + 7488442752231687567680515541*x^618 + 7358840 808511255237568829812*x^617 + 7231083944411091645010733600*x^616 + 710515339 0740051330053828102*x^615 + 6981030437543467729038227115*x^614 + 68586964363 66776950134135982*x^613 + 6738132802473072963956384852*x^612 + 6619321017014 705809364695836*x^611 + 6502242629159045799294755293*x^610 + 638687925816854 7906048418775*x^609 + 6273212595435261508434216413*x^608 + 61612244064699414 93115674890*x^607 + 6050896532845927318209530777*x^606 + 5942210894097967067 383598175*x^605 + 5835149489576173746329413411*x^604 + 572969440025531109951 1348867*x^603 + 5625827790499616052593541426*x^602 + 55235319097833745140782 39162*x^601 + 5422789094367476697700478284*x^600 + 5323581768932187354346979 975*x^599 + 5225892448166375328119815476*x^598 + 512970373831345567515032286 2*x^597 + 5034998338674306205472311952*x^596 + 4941759043067428727354987892* x^595 + 4849968741246633489726473040*x^594 + 4759610420276533331520598655*x^ 593 + 4670667165866141856865192408*x^592 + 4583122163660877561990990680*x^59 1 + 4496958700493283243646317999*x^590 + 4412160165592777219800725493*x^589 + 4328710051754759891733920680*x^588 + 4246591956469405972532680208*x^587 + 4165789583010479300930139870*x^586 + 4086286741484513551763927236*x^585 + 40 08067349840708345618851370*x^584 + 3931115434841896251043752351*x^583 + 3855 415132996941963747601662*x^582 + 3780950691454940539112325813*x^581 + 370770 6468861586948001540482*x^580 + 3635666936178094422053820055*x^579 + 35648166 77463044054349411261*x^578 + 3495140390617552925517059930*x^577 + 3426622888 094152635051753061*x^576 + 3359249097569774533954593655*x^575 + 329300406258 3242178952380823*x^574 + 3227872943137675561734893216*x^573 + 31638410162682 15510147688119*x^572 + 3100893676575480313438642702*x^571 + 3039016436725170 091873278504*x^570 + 2978194927914237713756204091*x^569 + 291841490030404816 1624822769*x^568 + 2859662223420951165668456239*x^567 + 28019228865246946578 72209905*x^566 + 2745182998945109156639199275*x^565 + 2689428790387495570402 747243*x^564 + 2634646611207151111742713053*x^563 + 258082293265347004255202 9620*x^562 + 2527944347084057827688202572*x^561 + 24759975681492989611585996 73*x^560 + 2424969430947820247136362035*x^559 + 2374846892153292669932767639 *x^558 + 2325617030113016174446131603*x^557 + 2277267044918732703586934896*x ^556 + 2229784258450113703798424725*x^555 + 2183156114391369016139163576*x^5 54 + 2137370178221424620588462479*x^553 + 2092414137178117097427325944*x^552 + 2048275800196852913915600845*x^551 + 2004943097824180739237400327*x^550 + 1962404082106724938054984419*x^549 + 1920646926455928195254697511*x^548 + 1 879659925489050883869711318*x^547 + 1839431494846874307028163466*x^546 + 179 9950170988554325428022803*x^545 + 1761204610964071126627813226*x^544 + 17231 83592164720003730021439*x^543 + 1685876012052086991203834988*x^542 + 1649270 887865952057044178481*x^541 + 1613357356311561275608098254*x^540 + 157812467 3226708006734294322*x^539 + 1543562213229061586576333429*x^538 + 15096594693 44180396415314224*x^537 + 1476406052614644420023999392*x^536 + 1443791691690 740530400977992*x^535 + 1411806232403131765357183932*x^534 + 138043963731793 9761001425752*x^533 + 1349681985274667315125118297*x^532 + 13195234709073857 51321933897*x^531 + 1289954404149609351891413472*x^530 + 1260965209723276625 664406856*x^529 + 1232546426612255578351065523*x^528 + 120468870752078746034 7235139*x^527 + 1177382818317280682639395106*x^526 + 11506196374638637180162 81807*x^525 + 1124390155432102844718100624*x^524 + 1098685474105287545418424 790*x^523 + 1073496806167683248520698185*x^522 + 104881547448114789363547722 5*x^521 + 1024632911449505521253541597*x^520 + 1000940658371066730502807634* x^519 + 977730364779682420923348149*x^518 + 954993787774713736854325083*x^51 7 + 932722791340297568727757309*x^516 + 910909345654283336723293467*x^515 + 889545526387213091259235266*x^514 + 868623513991713214067995021*x^513 + 8481 35592982662195504523968*x^512 + 828074151208495100624281311*x^511 + 80843167 9114001420787225362*x^510 + 789200768994969041423461874*x^509 + 770374114245 023042444367131*x^508 + 751944508595003987891697434*x^507 + 7339048453452262 58058875561*x^506 + 716248116590952832746085574*x^505 + 69896741244141875075 6423658*x^504 + 682055920232731250415547366*x^503 + 665506923734970340991802 941*x^502 + 649313802353809267575207721*x^501 + 633470030326970014386604133* x^500 + 617969175915824645754061434*x^499 + 602804900592448912209505831*x^49 8 + 587970958222430153397450724*x^497 + 573461194243727111797425611*x^496 + 559269544841874833664630602*x^495 + 545390036121823378085885507*x^494 + 5318 16783276694583600104798*x^493 + 518543989753736656387481853*x^492 + 50556594 6417751846505227331*x^491 + 492877030712267970928353556*x^490 + 480471705818 720026101888079*x^489 + 468344519813903610157920988*x^488 + 4564901048259573 47700218738*x^487 + 444903176189126979884922276*x^486 + 43357853159755925117 2913481*x^485 + 422511050258369193312999975*x^484 + 411695692044219878520484 895*x^483 + 401127496645649189098194395*x^482 + 390801582723373631531533406* x^481 + 380713147060794710969986492*x^480 + 370857463716928878548297480*x^47 9 + 361229883179977570734063420*x^478 + 351825831521749378316317263*x^477 + 342640809553141914242300802*x^476 + 333670391980886495706174741*x^475 + 3249 10226565754318101580320*x^474 + 316356033282418378045947378*x^473 + 30800360 3481161001012842964*x^472 + 299848799051612447482438509*x^471 + 291887551588 701711220628744*x^470 + 284115861560996285574045609*x^469 + 2765297974816033 59739047744*x^468 + 269125495081800618013898896*x^467 + 26189915648756055222 9262414*x^466 + 254847049399127961995673781*x^465 + 247965506273806110199053 830*x^464 + 241250923512102823376307194*x^463 + 234699760647383679240878310* x^462 + 228308539539175307699717695*x^461 + 222073843570257748174099199*x^46 0 + 215992316847680755841646881*x^459 + 210060663407834933459299851*x^458 + 204275646425704584579430695*x^457 + 198634087428425239075904644*x^456 + 1931 32865513264893764958868*x^455 + 187768916570144140318480840*x^454 + 18253923 2508806520375500522*x^453 + 177440860490746654482457411*x^452 + 172470902165 999937925293777*x^451 + 167626512914893883318377068*x^450 + 1629049010948575 17619103395*x^449 + 158303327292381610646179576*x^448 + 15381910358021892376 8640612*x^447 + 149449592779910121747731649*x^446 + 145192207729717488272722 179*x^445 + 141044410558045127024415798*x^444 + 137003711962420915588788621* x^443 + 133067670494112109662676448*x^442 + 129233891848443170151510225*x^44 1 + 125500028160881106336793025*x^440 + 121863777308950394642909660*x^439 + 118322882220036344987449066*x^438 + 114875130185132645559219261*x^437 + 1115 18352178585722410839085*x^436 + 108250422183885502730417191*x^435 + 10506925 6525549170296871227*x^434 + 101972813207141548629030397*x^433 + 989590912554 72841888936710*x^432 + 96026130071011605850221263*x^431 + 931720087845480113 25337077*x^430 + 90394845620139700470162471*x^429 + 876927972643698224379438 28*x^428 + 85064058241944169001518939*x^427 + 82506860297651713046338622*x^4 26 + 80019471784710283278758517*x^425 + 77600197059516587095263480*x^424 + 7 5247375882817320299058793*x^423 + 72959382827315677191050622*x^422 + 7073462 6691725197443174392*x^421 + 68571549921280557004550454*x^420 + 6646862803471 2628997403164*x^419 + 64424369057692907013950886*x^418 + 6243731296275019729 3379423*x^417 + 60506031115660347787723733*x^416 + 5862912572830769094794645 2*x^415 + 56805229318014832990846932*x^414 + 55033004173335425241394197*x^41 3 + 53311141826302602665403941*x^412 + 51638362531123870680362239*x^411 + 50 013414749311363508678641*x^410 + 48435074641234585454039338*x^409 + 46902145 564080980259822117*x^408 + 45413457576207952856822901*x^407 + 43967866947868 292020435479*x^406 + 42564255678289311416453220*x^405 + 41201531019084439888 691646*x^404 + 39878625003974449287276341*x^403 + 38594493984794009298466976 *x^402 + 37348118173757803248618393*x^401 + 36138501191959026338598099*x^400 + 34964669624071717832332676*x^399 + 33825672579227050975550505*x^398 + 327 20581258032418449787996*x^397 + 31648488525700906554443397*x^396 + 306085084 91257547629147273*x^395 + 29599776092787577044348512*x^394 + 286214466886907 97955874799*x^393 + 27672695654905073487491394*x^392 + 267527179880609216147 91566*x^391 + 25860727914528182307583992*x^390 + 24995958505314758972981519* x^389 + 24157661296776506447898379*x^388 + 23345105917096445231818330*x^387 + 22557579718490625836982630*x^386 + 21794387415097147566684231*x^385 + 2105 4850726504052211252702*x^384 + 20338308026871064569015815*x^383 + 1964411399 9599437845143050*x^382 + 18971639297503482339934199*x^381 + 1832027020843670 9891268995*x^380 + 17689408326324913761697541*x^379 + 1707847022755792353412 2218*x^378 + 16486887152691226573589929*x^377 + 15914104693408131196372986*x ^376 + 15359582484692661329169804*x^375 + 14822793902162917607012247*x^374 + 14303225764514215012935548*x^373 + 13800378041020911769049473*x^372 + 13313 763564045477709818966*x^371 + 12842907746503012265942665*x^370 + 12387348304 229111922655080*x^369 + 11946634983198704050909200*x^368 + 11520329291543207 805208067*x^367 + 11108004236313152799740189*x^366 + 10709244064933181977484 928*x^365 + 10323644011296185938541584*x^364 + 9950810046443161458690994*x^3 63 + 9590358633775256473085186*x^362 + 9241916488744356890543445*x^361 + 890 5120342968486710598662*x^360 + 8579616712718231509610854*x^359 + 82650616717 20355917618663*x^358 + 7961120628224767700261160*x^357 + 7667468106280983968 850408*x^356 + 7383787531170278348134657*x^355 + 7109771018939731120120799*x ^354 + 6845119169984466921396262*x^353 + 6589540866624445991970172*x^352 + 6 342753074622274750569333*x^351 + 6104480648588619103132259*x^350 + 587445614 1221938880387654*x^349 + 5652419616329413653367698*x^348 + 54381184655760984 03167082*x^347 + 5231307228909531638225506*x^346 + 5031747418607218078365433 *x^345 + 4839207346894622483843400*x^344 + 4653461957081540128588346*x^343 + 4474292658164952333273357*x^342 + 4301487162846731924536542*x^341 + 4134839 328914833015251847*x^340 + 3974149003936881656157892*x^339 + 381922187321537 8245576866*x^338 + 3669869310954028660974727*x^337 + 35259082345850384587821 39*x^336 + 3387160962207532747827636*x^335 + 3253455073087603053187699*x^334 + 3124623271170831233208738*x^333 + 3000503251558498880669638*x^332 + 28809 37569899058223153952*x^331 + 2765773514646816937230772*x^330 + 2654862982140 174111522571*x^329 + 2548062354452137446716846*x^328 + 244523237996625228368 5050*x^327 + 2346238056631480827859165*x^326 + 2250948517849984618798729*x^3 25 + 2159236920952184514573740*x^324 + 2070980338213899863537050*x^323 + 198 6059650370801769867600*x^322 + 1904359442585854078819312*x^321 + 18257679028 25859574097804*x^320 + 1750176722603677560714406*x^319 + 1677481000043132175 870415*x^318 + 1607579145224088108078948*x^317 + 1540372787765631597355499*x ^316 + 1475766686605759329764705*x^315 + 1413668641936445827106135*x^314 + 1 353989409253430872599936*x^313 + 1296642615480542117966574*x^312 + 124154467 7128844004473366*x^311 + 1188614720451382224835678*x^310 + 11377745035547728 85088180*x^309 + 1088948340429367032719950*x^308 + 1042063026860204042774077 *x^307 + 997047768181451246737604*x^306 + 953834108837511905563902*x^305 + 9 12355863714468929900342*x^304 + 872549051206017405478956*x^303 + 83435182797 8524763685044*x^302 + 797704425400343126606057*x^301 + 762549087600983738435 562*x^300 + 728830011126248262972800*x^299 + 696493286155895878032155*x^298 + 665486839250908335631893*x^297 + 635760377597897291448681*x^296 + 60726533 4718679053539812*x^295 + 579954817613521279785839*x^294 + 553783555307043892 574361*x^293 + 528707848766232410199859*x^292 + 504685522160495855091049*x^2 91 + 481675875434173232558872*x^290 + 459639638162362128951442*x^289 + 43853 8924661410108913274*x^288 + 418337190325874157155591*x^287 + 398999189164215 275240911*x^286 + 380490932505954377996794*x^285 + 362779648853471711999819* x^284 + 345833744852085019811573*x^283 + 329622767352491482933334*x^282 + 31 4117366540104983262466*x^281 + 299289260106263321453188*x^280 + 285111198436 719619990047*x^279 + 271556930793268122593138*x^278 + 2586011724647868879699 63*x^277 + 246219572864408377575099*x^276 + 234388684549953571009607*x^275 + 223085933145185930393226*x^274 + 212289588139858202134131*x^273 + 201978734 546937620840273*x^272 + 192133245395803499598413*x^271 + 1827337550406153914 47311*x^270 + 173761633263449930486935*x^269 + 165198960152200053455392*x^26 8 + 157028501733621513312567*x^267 + 149233686342298378641828*x^266 + 141798 581706681523391857*x^265 + 134707872733731911049549*x^264 + 1279468399740737 29649530*x^263 + 121501338749931106362645*x^262 + 115357778928486193351534*x ^261 + 109503105323655843954850*x^260 + 103924778709638867035281*x^259 + 986 10757429935937548800*x^258 + 93549479585889636110466*x^257 + 887298457891327 75514026*x^256 + 84141202462669136621651*x^255 + 79773325675641971358031*x^2 54 + 75616405497172130994215*x^253 + 71661030854969440383090*x^252 + 6789817 4884737962745316*x^251 + 64319180756708086905895*x^250 + 6091574796593592384 6915*x^249 + 57679919073313328693715*x^248 + 54604066884529976662791*x^247 + 51680882054522328122534*x^246 + 48903361105233031913330*x^245 + 46264794844 788352641368*x^244 + 43758757176480583970011*x^243 + 41379094286217145054374 *x^242 + 39119914197368172103159*x^241 + 36975576682209934278221*x^240 + 349 40683519422347129414*x^239 + 33010069087355253518898*x^238 + 311787912830300 19096386*x^237 + 29442122757090375934921*x^236 + 27795542455159374462636*x^2 35 + 26234727456297802251983*x^234 + 24755545099493531801650*x^233 + 2335404 5389341002681052*x^232 + 22026453672295462023383*x^231 + 2076916357510771822 1060*x^230 + 19578730197262043760628*x^229 + 18451863549452533434352*x^228 + 17385422230341723667736*x^227 + 16376407334049648320985*x^226 + 15421956581 021787850409*x^225 + 14519338665120604771539*x^224 + 13665947809977592343622 *x^223 + 12859298527831039415928*x^222 + 12097020574259077238761*x^221 + 113 76854092398069175828*x^220 + 10696644940413077673814*x^219 + 100543401961600 41103045*x^218 + 9447983833148463228467*x^217 + 8875712562078907603171*x^216 + 8335751832391446007396*x^215 + 7826411988419482462933*x^214 + 73460845748 98110943125*x^213 + 6893238786727414568473*x^212 + 6466418058038925974620*x^ 211 + 6064236785757892024613*x^210 + 5685377182995070650141*x^209 + 53285862 57739583028967*x^208 + 4992672912458900328665*x^207 + 4676505160343410736123 *x^206 + 4379007454061239357408*x^205 + 4099158123014130734863*x^204 + 38359 86915207301090846*x^203 + 3588572639965274825933*x^202 + 3356040907841887053 433*x^201 + 3137561964185910718181*x^200 + 2932348612934202672533*x^199 + 27 39654227311907357762*x^198 + 2558770844224158676226*x^197 + 2389027339225929 246710*x^196 + 2229787679056240293750*x^195 + 2080449248819913464651*x^194 + 1940441250994466158964*x^193 + 1809223173531672468344*x^192 + 1686283324412 780224849*x^191 + 1571137430103438280105*x^190 + 1463327295439093978231*x^18 9 + 1362419522554015471562*x^188 + 1268004286547223311142*x^187 + 1179694165 656526480965*x^186 + 1097123023787595184851*x^185 + 1019944943318611264163*x ^184 + 947833206172561714341*x^183 + 880479321218725521600*x^182 + 817592096 132392641648*x^181 + 758896751907389602818*x^180 + 704134078279611668462*x^1 79 + 653059628381518979011*x^178 + 605442951007485354198*x^177 + 56106685892 8034703838*x^176 + 519726731747401988561*x^175 + 481229851853553584143*x^174 + 445394772062835398957*x^173 + 412050713612825302166*x^172 + 3810369932067 87927950*x^171 + 352202477861402769485*x^170 + 325405066356198156221*x^169 + 300511196128411155489*x^168 + 277395374500843033109*x^167 + 255939733172727 465374*x^166 + 236033604944709471470*x^165 + 217573121688781721086*x^164 + 2 00460832612475590342*x^163 + 184605341903790646507*x^162 + 16992096487930112 6600*x^161 + 156327401792633856996*x^160 + 143749428494100792753*x^159 + 132 116603164722221302*x^158 + 121362988379224393730*x^157 + 1114268877828680713 38*x^156 + 102250596696191795198*x^155 + 93780165989964630297*x^154 + 859651 78599866172579*x^153 + 78758538076674649224*x^152 + 72116268593074348588*x^1 51 + 65997325852618194606*x^150 + 60363418369926292298*x^149 + 5517883861389 2434119*x^148 + 50410303527533049649*x^147 + 46026803959171546695*x^146 + 41 999462559929542630*x^145 + 38301399722018706896*x^144 + 34907607151115893867 *x^143 + 31794828684182488191*x^142 + 28941447981478449669*x^141 + 263273827 38243963300*x^140 + 23933985077597903736*x^139 + 21743947801653048953*x^138 + 19741216192693173685*x^137 + 17910905070516384621*x^136 + 1623922082574141 5461*x^135 + 14713388162017699209*x^134 + 13321581292694032027*x^133 + 12052 859349602234421*x^132 + 10897105773218647191*x^131 + 9844971464594372643*x^1 30 + 8887821490111249380*x^129 + 8017685140340563814*x^128 + 722720915407096 1339*x^127 + 6509613927946015419*x^126 + 5858652541125123701*x^125 + 5268572 432968103115*x^124 + 4734079579957930629*x^123 + 4250305025931013150*x^122 + 3812773627193276690*x^121 + 3417374881275973495*x^120 + 3060335714939780009 *x^119 + 2738195113581500497*x^118 + 2447780480446148639*x^117 + 21861856200 09652790*x^116 + 1950750245584879850*x^115 + 1739040916626724377*x^114 + 154 8833316380963848*x^113 + 1378095785446418477*x^112 + 1224974031510342794*x^1 11 + 1087776939982278611*x^110 + 964963414500878489*x^109 + 8551301803302366 97*x^108 + 757000487505526859*x^107 + 669413654240449252*x^106 + 59131539457 9071198*x^105 + 521748877569770815*x^104 + 459846468366578159*x^103 + 404822 104630406505*x^102 + 355964264416391939*x^101 + 312629484400483356*x^100 + 2 74236389824985400*x^99 + 240260199935164200*x^98 + 210227674943268675*x^97 + 183712472698171725*x^96 + 160330885263858960*x^95 + 139737927523546800*x^94 + 121623751733457400*x^93 + 105710363656182600*x^92 + 91748617512913200*x^9 1 + 79515468511191440*x^90 + 68811463134684900*x^89 + 59458448728028700*x^88 + 51297485177122800*x^87 + 44186942677323600*x^86 + 38000770702498296*x^85 + 32626924340528840*x^84 + 27965935149024720*x^83 + 23929614612052080*x^82 + 20439879147794485*x^81 + 17427686431277403*x^80 + 14832073558533960*x^79 + 12599288291657880*x^78 + 10682005290753420*x^77 + 9038619861406740*x^76 + 76 32612327410136*x^75 + 6431976680401800*x^74 + 5408707663065150*x^73 + 453834 0912686850*x^72 + 3799541229226200*x^71 + 3173734438530120*x^70 + 2644778698 775100*x^69 + 2198671448379300*x^68 + 1823288518168200*x^67 + 15081522310774 00*x^66 + 1244225590638855*x^65 + 1023729916348425*x^64 + 839983521106400*x^ 63 + 687259244541600*x^62 + 560658857389200*x^61 + 456002537343216*x^60 + 36 9731787035040*x^59 + 298824321028320*x^58 + 240719591939480*x^57 + 193253756 909160*x^56 + 154603005527328*x^55 + 123234279768160*x^54 + 97862516286480*x ^53 + 77413632286320*x^52 + 60992558771040*x^51 + 47855699958816*x^50 + 3738 7265592825*x^49 + 29078984349975*x^48 + 22512762077400*x^47 + 17345898649800 *x^46 + 13298522298180*x^45 + 10142940735900*x^44 + 7694644696200*x^43 + 580 4731963800*x^42 + 4353548972850*x^41 + 3245372870670*x^40 + 2403979904200*x^ 39 + 1768966344600*x^38 + 1292706174900*x^37 + 937845656300*x^36 + 675248872 536*x^35 + 482320623240*x^34 + 341643774795*x^33 + 239877544005*x^32 + 16687 1334960*x^31 + 114955808528*x^30 + 78378960360*x^29 + 52860229080*x^28 + 352 40152720*x^27 + 23206929840*x^26 + 15084504396*x^25 + 9669554100*x^24 + 6107 086800*x^23 + 3796297200*x^22 + 2319959400*x^21 + 1391975640*x^20 + 81880920 0*x^19 + 471435600*x^18 + 265182525*x^17 + 145422675*x^16 + 77558760*x^15 + 40116600*x^14 + 20058300*x^13 + 9657700*x^12 + 4457400*x^11 + 1961256*x^10 + 817190*x^9 + 319770*x^8 + 116280*x^7 + 38760*x^6 + 11628*x^5 + 3060*x^4 + 6 80*x^3 + 120*x^2 + 15*x + 1 78[][;][]~ gp2c-0.0.8/test/res/dot.res0000644000175000017500000000150512141547407012352 00000000000000[0.E-38, 0.E3, 0.E-3, 0.30000000000000000000000000000000000000, 300.00000000 000000000000000000000000000, 0.00030000000000000000000000000000000000000, 2. 0000000000000000000000000000000000000, 2000.00000000000000000000000000000000 00, 0.0020000000000000000000000000000000000000, 2.30000000000000000000000000 00000000000, 2300.0000000000000000000000000000000000, 0.00230000000000000000 00000000000000000000, [0.E-38], [0.E3], [0.E-3], [0.300000000000000000000000 00000000000000], [300.00000000000000000000000000000000000], [0.0003000000000 0000000000000000000000000000], [2.0000000000000000000000000000000000000], [2 000.0000000000000000000000000000000000], [0.00200000000000000000000000000000 00000000], [1.3000000000000000000000000000000000000], [1300.0000000000000000 000000000000000000], [0.0013000000000000000000000000000000000000]] gp2c-0.0.8/test/res/while.res0000644000175000017500000000006612141547407012675 00000000000000end 2 3 4 5 end 2 end 2 end [-1, 0, 1] [-2, -1, 1, 2] gp2c-0.0.8/test/res/forstep.res0000644000175000017500000000074212156115130013236 000000000000007 9 13 19 25 31 37 43 45 49 55 61 63 67 73 79 85 91 97 99 end 7 5 3 1 -1 -3 -5 -7 -9 -11 -13 -15 -17 -19 -21 -23 -25 -27 -29 -31 -33 end 7 9 11 13 15 17 19 21 23 25 27 29 31 33 end 1 -1 -3 -5 -7 -9 -11 -13 -15 -17 -19 end 1 3 5 7 9 11 13 15 17 19 end 0 6 12 17 21 23 24 23 21 17 12 6 0 0 2 5 10 17 19 22 27 34 36 39 44 51 53 56 61 68 70 73 78 85 87 90 95 0 1 0 2 3 2 4 5 4 6 7 6 8 9 8 10 0 1 2 -1 0 1 -2 -1 0 -3 -2 -1 -4 -3 -2 -5 -4 -3 -6 -5 -4 -7 -6 -5 -8 -7 -6 -9 -8 -7 -10 -9 -8 gp2c-0.0.8/test/res/forprime.res0000644000175000017500000000001412155572710013401 0000000000000026861 26861 gp2c-0.0.8/test/res/install.res0000644000175000017500000000023512141547407013231 0000000000000062156359365916137150765161741278104262 2169540938509044941783277184121659944916164088084619610420367315011133797315 4 62156359365916137150765161741278104262 gp2c-0.0.8/test/res/upto.res0000644000175000017500000000011112155572710012543 00000000000000[1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800] ["3->1 + I"] 1 + I gp2c-0.0.8/test/res/return.res0000644000175000017500000000013112155572710013075 000000000000003628803 1 1 1 [[2, 1], [2, 4], [3, 2], [2, 4], [2, 4]] [0] List([0]) [0] [0] 4 5 4 6 4 7 gp2c-0.0.8/test/res/trunc.res0000644000175000017500000000001311751724575012721 00000000000000-3 -3 -3 4 gp2c-0.0.8/test/input/0000755000175000017500000000000012162636065011500 500000000000000gp2c-0.0.8/test/input/dot0000644000175000017500000000004112141547407012122 00000000000000default(realprecision,38); dot() gp2c-0.0.8/test/input/moveblock0000644000175000017500000000010611751724575013330 00000000000000f([3,1,4,1,5]) g(2) k(12) l([1,2,3]) l([4,5,6]) m(12) o([1,2,3]) n(3) gp2c-0.0.8/test/input/multiassign0000644000175000017500000000002212156142054013665 00000000000000f([3,4]) g([4,5]) gp2c-0.0.8/test/input/multiif0000644000175000017500000000005012156166555013014 00000000000000for(i=1,4,f(i)); for(i=1,4,g([i,i+1])); gp2c-0.0.8/test/input/print0000644000175000017500000000003211751724575012501 00000000000000f(x^4+1) f(mathilbert(3)) gp2c-0.0.8/test/input/return0000644000175000017500000000012512155572710012656 00000000000000f(1+2)+10! g(0) h([1,2]) h([1,2,3;4,5,6]) k(5) t1(1) t2(1) t3(1) t4(1) init(4);foo() gp2c-0.0.8/test/input/read0000644000175000017500000000024612155572710012256 00000000000000\\?randprime \\?buildkey v=buildkey(128); publickey=v[1]; privatekey=v[2]; clear=gp2crand(2^128) crypted=crypt(clear,publickey) decrypted=decrypt(crypted,privatekey) gp2c-0.0.8/test/input/sumprod0000644000175000017500000000003312141547407013026 00000000000000f(10) g(100) h(1000) k(36) gp2c-0.0.8/test/input/gerepile0000644000175000017500000000013012141547407013127 00000000000000f1() f2() g1() g2() h1() h2() k1() k2() l1() l2() m1() m2() n1() n2() o1("gp2c") gp2c-0.0.8/test/input/break0000644000175000017500000000005112141547407012421 00000000000000f(65) for(i=2,20,print(Miller_Rabin(i))) gp2c-0.0.8/test/input/forstep0000644000175000017500000000010612156115130013006 00000000000000f(100) g(-2) g(2) h() k([2,3,5,7],100) k([1,-1,2],10) k([1,1,-3],-10) gp2c-0.0.8/test/input/forvec0000644000175000017500000000006712162636065012632 00000000000000g(3,0) g(3,1) g(3,2) h(3,0) h(3,1) h(3,2) FV(2) fv(72) gp2c-0.0.8/test/input/forprime0000644000175000017500000000002312155572710013157 00000000000000f(50000) fs(50000) gp2c-0.0.8/test/input/args0000644000175000017500000000026612155670557012311 00000000000000f(1) g(,[[5,4,1,2,3],[5,1,4,3,2],[5,3,1,4,2],[5,1,2,4,3],[5,1,3,2,4]]) g([2,5,4,1,3],) g([2,5,4,1,3],[[5,4,1,2,3],[5,1,4,3,2],[5,3,1,4,2],[5,1,2,4,3],[5,1,3,2,4]]) testh() s("ab") gp2c-0.0.8/test/input/trunc0000644000175000017500000000002611751724575012503 00000000000000f(Pi) g(Pi) h(Pi) k() gp2c-0.0.8/test/input/if0000644000175000017500000000012112155572710011731 00000000000000f(0,0) f(0,1) f(1,0) f(1,1) f([1,2,3],1) g(0,2) g(1,2) h(0,3) h(1,3) pile() j(2) gp2c-0.0.8/test/input/member0000644000175000017500000000003112155572710012602 00000000000000polmod(Mod(x^2+1,x^3-2)) gp2c-0.0.8/test/input/initfunc0000644000175000017500000000016212155572710013157 00000000000000init_initfunc(); print(pow_M(2)) vector(100,i,mybfffo(i)) vector(31,i,mybfffo(1<<(i-1))) for(i=1,5,count();aff()) gp2c-0.0.8/test/input/while0000644000175000017500000000006012141547407012445 00000000000000f(0); f(5); g(0); g(5); h([3,4,5]) k([4,5,6,7]) gp2c-0.0.8/test/input/upto0000644000175000017500000000001012141547407012317 00000000000000h() p() gp2c-0.0.8/test/input/vector0000644000175000017500000000001211751724575012645 00000000000000f(15) g() gp2c-0.0.8/test/input/cast0000644000175000017500000000002112155572710012264 00000000000000f(45) g(1.3,1.8) gp2c-0.0.8/test/input/cleanvar0000644000175000017500000000000512155572710013127 00000000000000f(1) gp2c-0.0.8/test/input/affect0000644000175000017500000000021312155572710012565 00000000000000f(5) f(3) A=[1,2];B=mathilbert(4); g(A,B) A print(B) th() ml(2) B=matpascal(1) col(B,1,A~) B lin(B,2,A) B col(B,-1,A) v=[4,9,1,3]; tr(v) v gp2c-0.0.8/test/input/matrix0000644000175000017500000000006212141547407012643 00000000000000testswap() swaprow(vandermonde([1,2,3])) sideef() gp2c-0.0.8/test/input/install0000644000175000017500000000021512141547407013005 00000000000000v=buildkey(128); publickey=v[1]; privatekey=v[2]; clear=gp2crand(2^128) crypted=crypt(clear,publickey) decrypted=decrypt(crypted,privatekey) gp2c-0.0.8/test/Makefile.in0000644000175000017500000002405112165534611012325 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = test DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHOC = @ECHOC@ ECHON = @ECHON@ ECHOT = @ECHOT@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GP2C_DBG = @GP2C_DBG@ GP2C_DBG1 = @GP2C_DBG1@ GP_PATH = @GP_PATH@ GP_PATH_DBG = @GP_PATH_DBG@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PARI_DATADIR = @PARI_DATADIR@ PARI_DESC = @PARI_DESC@ PARI_MODULE_BUILD = @PARI_MODULE_BUILD@ PARI_MODULE_DEBUG = @PARI_MODULE_DEBUG@ PARI_RUNTEST = @PARI_RUNTEST@ PARI_VERSION = @PARI_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL_PATH = @PERL_PATH@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ mybindir = @mybindir@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu test/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic dist-hook \ distclean distclean-generic distdir dvi dvi-am html html-am \ info info-am install install-am install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ uninstall-am mostlyclean-generic: rm -f *.gp *.gp.[co] *.gp.so *.res dist-hook: cp -pR $(srcdir)/gp $(srcdir)/input $(srcdir)/res $(distdir) rm -rf $(distdir)/gp/CVS $(distdir)/input/CVS $(distdir)/res/CVS rm -rf $(distdir)/gp/.svn $(distdir)/input/.svn $(distdir)/res/.svn # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: gp2c-0.0.8/test/gp/0000755000175000017500000000000012165105713010741 500000000000000gp2c-0.0.8/test/gp/initfunc.gp0000644000175000017500000000060712155572710013037 00000000000000global(y:var,n:small=0,m:small,k=2,L:vec,T2) T=clone([4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0]) T2=clone([4,3,2,2,1,1,1,1,0,0,0,0,0,0,0,0]) L=[]~; mybfffo(x:small)= { local(sc:small=28); if (x > 65535, sc -= 16; x >>= 16); if (x > 255, sc -= 8; x >>= 8); if (x > 15, sc -= 4; x >>= 4); sc + T[x]; } count()=n++;y+1;m=mybfffo(n) aff()=print(n," ",m); M=[1,2;3,4] print(x^4+k); pow_M(k)=M^k gp2c-0.0.8/test/gp/member.gp0000644000175000017500000000003212155572710012457 00000000000000polmod(a)= [a.pol, a.mod] gp2c-0.0.8/test/gp/sumprod.gp0000644000175000017500000000024112141547407012703 00000000000000f(x)=sum(i=1,x,if(2*i<=x,2*i,i)) g(x)=prod(i=1,x,if(i^2<=x,i^2,i)) h(x)=round(10^20*prodeuler(p=3,x,if(p%4==1,1+p^-2,1-p^-2))) k(x)=sumdiv(x,i,if(2*i<=x,2*i,i)) gp2c-0.0.8/test/gp/install.gp0000644000175000017500000000075212155572710012667 00000000000000install("gpow","GGp"); install("gp2c_gp2crand","G","gp2crand","./affect.gp.so"); install("gp2c_randprime","G","randprime","./affect.gp.so"); powmod(a,b,c)=lift(gpow(Mod(a,c),b)) buildkey(N)= { local(p,q,e,phi); p=randprime(N); q=randprime(N); phi=(p-1)*(q-1); until(gcd(e,phi)==1,e=gp2crand(p*q)); [[e,p*q],[powmod(e,-1,phi),p*q]] } crypt(data,publickey)= { powmod(data,publickey[1],publickey[2]) } decrypt(data,privatekey)= { powmod(data,privatekey[1],privatekey[2]) } gp2c-0.0.8/test/gp/if.gp0000644000175000017500000000071712155572710011620 00000000000000f(a,b)= { local(x); x=vector(2); if(a,if(b,print(0)),print(1)); if(a,if(b,print(2),print(3))); if(a==[1,2,3],print(4),print(5)); if(a==1,if(b==1,x[1]=1,x[1]=2),if(b==1,x[2]=1,x[2]=2)); print(x); print("end"); } g(p,n)=print("g");if(p,print(n),);if(p,print(n),;); h(p,n)=print("h");if(p,,print(n));if(p,;,print(n)); pile()= { local(a,b); a=[0,0]; for(i=1,10^5, if(i>0,b=[1,2],b=[3,4]); a+=b; ); a } j(x)=vector(2,i,if(i==1,12)) gp2c-0.0.8/test/gp/vector.gp0000644000175000017500000000065112141547407012521 00000000000000dacmul(V)=/*Divide-and-conquer multiplication*/ { local(l:small); while(length(V)>1, l=length(V); print1(l," "); V=vector((l+1)\2,i, if(2*i<=l, V[2*i]*V[2*i-1], V[2*i-1]))); print(); V[1] } f(a:small)=\\Multiply some cyclotomic polynomials { local(p:small=100,V); V=vector(a,i,p=nextprime(p+1):small;polcyclo(p)); dacmul(V); }/*parse some matrices*/ g()=print([1,2]*[1,2,3;4,5,6]*[1,2,3]~,[],[;],[]~) gp2c-0.0.8/test/gp/args.gp0000644000175000017500000000070712155572710012155 00000000000000f(a)=vecsort(subst(nfgaloisconj(x^4+1,,a),x,100)) g(a=[5,4,1,3,2],b=[[5,4,3,2,1]])= { print(vecsort(a)); print(vecsort(b,[2,3])); print(vecsort(a,,4)); print(vecsort(b,[2,3],4)); } h(x=0,y=0,z=0)=4*x+2*y+z testh()= { print(h()); print(h(1)); print(h(1,)); print(h(1,,)); print(h(,1)); print(h(,1,)); print(h(,,1)); print(h(1,1)); print(h(1,1,)); print(h(1,,1)); print(h(,1,1)); print(h(1,1,1)); } s(x)=[Str(x,,),Str(x,,x)] gp2c-0.0.8/test/gp/forstep.gp0000644000175000017500000000047412156115130012672 00000000000000f(x)= { forstep(y=7,x,[2,4,6,6,6,6,6,2,4,6,6], print (y)); print("end"); forstep(y=7,-34,-2,print(y)); print("end"); forstep(y=7,34,2,print(y)); print("end"); } g(x)= { forstep(y=1,10*x,x,print(y)); print("end"); } h()=forstep(x=0,Pi,Pi/12,print(round(24*sin(x)))) k(v:vec,l)=forstep(x=0,l,v:vec,print(x)) gp2c-0.0.8/test/gp/trunc.gp0000644000175000017500000000021111751724575012353 00000000000000f(x)=local(s:small);truncate(x,&s);s g(x)=local(s:int);truncate(x,&s);s h(x)=local(s:gen);truncate(x,&s);s k()=truncate(4.123105625617); gp2c-0.0.8/test/gp/read.gp0000644000175000017500000000105512155572710012131 00000000000000\raffect addhelp(randprime,"randprime(N): generate a random prime number < 2^N") powmod(a,b,c)=lift(Mod(a,c)^b) buildkey(N)= { local(A,P,x); A=gp2crand(2^N); P=randprime(N+1); x=gp2crand(P); Ax=powmod(A,x,P); [[Ax,A,P],[x,P]] } addhelp(buildkey,"buildkey(N): compute a random El Gamal key of N bits"); crypt(data,key)= { local(y,Ax=key[1],A=key[2],P=key[3]); y=gp2crand(P); Ay=powmod(A,y,P); Axy=powmod(Ax,y,P); [data*Axy%P,Ay] } decrypt(data,key)= { local(Axy,Ay=data[2],x=key[1],P=key[2]); Axy=powmod(Ay,-x,P); data[1]*Axy%P } gp2c-0.0.8/test/gp/affect.gp0000644000175000017500000000121112155572710012440 00000000000000f(x)= { local(v,i=0,j:small=0); v=vector(x); m=matpascal(x); while(i0,x,y) th()=local(V=vector(5,i,i));vector(5,i,h(V[i],i-1)) ml(x)=local(a=x^2+1,b=a^2+1,c=b^2+1);c^2+1 col(x,a,v)=x[,if(a<=0,print("a is too small");return,a)]=v;x lin(x,a,v)=x[if(a<=0,error("a is too small"),a),]=v;x tr(v)=truncate(Pi,&v[1]);v H1(n)=GA[n]=1 H2(n)=truncate(Pi,&GB[1]) H3(n)=GC[n]+=1 global(seed:small=0); gp2crand31()=seed=bitand(1000276549*seed:int+12347,(1<<31)-1); gp2crand(N)=local(p);while(p"i2)]); return(i2); } gp2c-0.0.8/test/gp/moveblock.gp0000644000175000017500000000036612141547407013203 00000000000000f(V:vec)=for(i=1,length(V),print(V[i])) g(x)=for(i=1,x,print(print(i))) k(x)=a=factor(x);[-a[if(x%2,2,1),]] l(a)=if(a==[1,2,3],print(4),print(5)); m(x)=a=factor(x);print(a[1,]) n(x)=sum(i=1,x,sin(print(i)));print("end"); o(x)=if(x[1],x[2],x[3]) gp2c-0.0.8/test/gp/forvec.gp0000644000175000017500000000063512141547407012505 00000000000000g(n,f)= { forvec(v=vector(n,i,[1,2]), s=sum(i:small=1,#v,v[i]);print1(s," "),f); print } h(n,f)= { forvec(v=vector(n,i,[2*i-1,2*i]), s=sum(i:small=1,#v,v[i]);print1(s," "),f); print } FV(R)= { local(b=vector(5,i,[0,R]),N); forvec(a=b, N+=prod(n=1,100, sum(m=0,4,a[m+1]*n^m))); N } fv(N)= { local(a); forvec(b=vector(2,k,[1,5]), if((2^b[1])*(3^b[2])==N, a=b)); print(a); a; } gp2c-0.0.8/test/gp/print.gp0000644000175000017500000000010212141547407012342 00000000000000f(x)= { print1(x); print(x); } g(x)=write("gp2c_test","x=",x) gp2c-0.0.8/test/gp/matrix.gp0000644000175000017500000000055012141547407012521 00000000000000vandermonde(V:vec)= { local(n:lg); n=length(V); matrix(n,n,i,j,V[i]^(j-1)) } swaprow(M:vec)= { local(n:lg); n=length(M); concat(vector(n,j,Mat(M[,if(j%2,min(j+1,n),j-1)]))); } testswap()= { print(swaprow([1,2,3;4,5,6;7,8,9])); print(swaprow([1,2;3,4;5,6;7,8])); } sideef()= { [1+print(1),2+print(2),3+print(3); 4+print(4),5+print(5),6+print(6)] } gp2c-0.0.8/test/gp/multiassign.gp0000644000175000017500000000013512156142054013546 00000000000000f(v,c=0)=local(a,b=[1]);[a,b[c+1]]=v;a+b[1] g(v)= { my(a,[b,c]=v,d=v,e=3); [a,b,c,d,e] } gp2c-0.0.8/test/gp/break.gp0000644000175000017500000000060512141547407012302 00000000000000f(x)= { for(i=1,x, for(j=1,x, if(i^2+j^2==x, print(i," ",j); break(2)))); } Miller_Rabin(n:int,p:small=20)= { local(s:small,t:int,at); if (n<=2, return(n==2)); s=valuation(n-1,2); t=(n-1)\2^s; for (i=1, p, at=Mod(random(n-2)+1,n)^t; if (at==1 || at==-1, next); for (k:small=1,s-1,at=at^2;if(at==-1,next(2))); return(0)); 1 } gp2c-0.0.8/test/gp/dot.gp0000644000175000017500000000032212155572710012000 00000000000000x.eee=[x] dot()= {[ ., .e3, .e-3, .3, .3e3, .3e-3, 2., 2.e3, 2.e-3, 2.3, 2.3e3, 2.3e-3, (.).eee, .e3.eee, .e-3.eee, .3.eee, .3e3.eee, .3e-3.eee, (2.).eee, 2.e3.eee, 2.e-3.eee, 1.3.eee, 1.3e3.eee, 1.3e-3.eee ]} gp2c-0.0.8/test/gp/cast.gp0000644000175000017500000000022212155572710012143 00000000000000f(x:int)=local(y:var='y);[Str(1),Str(42),Str(4+I),Str(print(4)),Str(x),Str([y^3+y+45]),Str("a"),Str(7978886869909)] g(r:real,g:gen)=r+=g;round(r) gp2c-0.0.8/test/gp/cleanvar.gp0000644000175000017500000000012112155572710013002 00000000000000f(m)= { while(0, vector(h1)); if(m>0, for(j=1,m, if(j==1, print(j)))); } gp2c-0.0.8/test/Makefile.am0000644000175000017500000000041212141547407012310 00000000000000mostlyclean-generic: rm -f *.gp *.gp.[co] *.gp.so *.res dist-hook: cp -pR $(srcdir)/gp $(srcdir)/input $(srcdir)/res $(distdir) rm -rf $(distdir)/gp/CVS $(distdir)/input/CVS $(distdir)/res/CVS rm -rf $(distdir)/gp/.svn $(distdir)/input/.svn $(distdir)/res/.svn gp2c-0.0.8/config/0000755000175000017500000000000012217042364010621 500000000000000gp2c-0.0.8/config/module-build0000755000175000017500000000124512217042364013053 00000000000000#! /bin/sh . "$1" if test "x$modules_build" = "x"; then # /usr/bin/sed on solaris does not understand \+ case "$DLLDFLAGS" in *LIBPARI_SONAME*) mydlldflags=`echo "$DLLDFLAGS" | sed -e 's/-[^ \t][^ \t]*[= \t][ \t]*\$(LIBPARI_SONAME)//'`;; *) mydlldflags=`echo "$DLLDFLAGS" | sed -e 's/-[^ \t][^ \t]*[ \t][ \t]*\$@//'`;; esac if test "$static" = "n"; then LIBS="$LIBS $LDDYN" fi myextradlldflags=`eval echo $EXTRADLLDFLAGS` myincludedir=`echo "$includedir" | sed -e 's/\/pari\/*$//'` echo "$CC -c -o %s.o $cflags -I$myincludedir %s.c && $DLLD -o %s.$DLSUFFIX $mydlldflags %s.o $myextradlldflags" else echo "$modules_build" | sed 's/"/\\"/g' fi gp2c-0.0.8/config/pari-version0000755000175000017500000000021512217042364013103 00000000000000#! /bin/sh . "$1" if [ "x$pari_release_verbose" = "x" ]; then version="unknown" else version="$pari_release_verbose" fi echo "$version" gp2c-0.0.8/config/pari-conf0000755000175000017500000000004412217042364012343 00000000000000#! /bin/sh . "$1" eval 'echo $'"$2" gp2c-0.0.8/config/install-sh0000755000175000017500000003325612217042364012556 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for `test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for `test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: gp2c-0.0.8/config/ylwrap0000755000175000017500000001435712217042364012017 00000000000000#! /bin/sh # ylwrap - wrapper for lex/yacc invocations. scriptversion=2011-08-25.18; # UTC # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005, # 2007, 2009, 2010, 2011 Free Software Foundation, Inc. # # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case "$1" in '') echo "$0: No files given. Try \`$0 --help' for more information." 1>&2 exit 1 ;; --basedir) basedir=$2 shift 2 ;; -h|--h*) cat <<\EOF Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... Wrapper for lex/yacc invocations, renaming files as desired. INPUT is the input file OUTPUT is one file PROG generates DESIRED is the file we actually want instead of OUTPUT PROGRAM is program to run ARGS are passed to PROG Any number of OUTPUT,DESIRED pairs may be used. Report bugs to . EOF exit $? ;; -v|--v*) echo "ylwrap $scriptversion" exit $? ;; esac # The input. input="$1" shift case "$input" in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. input="`pwd`/$input" ;; esac pairlist= while test "$#" -ne 0; do if test "$1" = "--"; then shift break fi pairlist="$pairlist $1" shift done # The program to run. prog="$1" shift # Make any relative path in $prog absolute. case "$prog" in [\\/]* | ?:[\\/]*) ;; *[\\/]*) prog="`pwd`/$prog" ;; esac # FIXME: add hostname here for parallel makes that run commands on # other machines. But that might take us over the 14-char limit. dirname=ylwrap$$ do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 mkdir $dirname || exit 1 cd $dirname case $# in 0) "$prog" "$input" ;; *) "$prog" "$@" "$input" ;; esac ret=$? if test $ret -eq 0; then set X $pairlist shift first=yes # Since DOS filename conventions don't allow two dots, # the DOS version of Bison writes out y_tab.c instead of y.tab.c # and y_tab.h instead of y.tab.h. Test to see if this is the case. y_tab_nodot="no" if test -f y_tab.c || test -f y_tab.h; then y_tab_nodot="yes" fi # The directory holding the input. input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'` # Quote $INPUT_DIR so we can use it in a regexp. # FIXME: really we should care about more than `.' and `\'. input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'` while test "$#" -ne 0; do from="$1" # Handle y_tab.c and y_tab.h output by DOS if test $y_tab_nodot = "yes"; then if test $from = "y.tab.c"; then from="y_tab.c" else if test $from = "y.tab.h"; then from="y_tab.h" fi fi fi if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend `../'. case "$2" in [\\/]* | ?:[\\/]*) target="$2";; *) target="../$2";; esac # We do not want to overwrite a header file if it hasn't # changed. This avoid useless recompilations. However the # parser itself (the first file) should always be updated, # because it is the destination of the .y.c rule in the # Makefile. Divert the output of all other files to a temporary # file so we can compare them to existing versions. if test $first = no; then realtarget="$target" target="tmp-`echo $target | sed s/.*[\\/]//g`" fi # Edit out `#line' or `#' directives. # # We don't want the resulting debug information to point at # an absolute srcdir; it is better for it to just mention the # .y file with no path. # # We want to use the real output file name, not yy.lex.c for # instance. # # We want the include guards to be adjusted too. FROM=`echo "$from" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` TARGET=`echo "$2" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \ -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$? # Check whether header files must be updated. if test $first = no; then if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then echo "$2" is unchanged rm -f "$target" else echo updating "$2" mv -f "$target" "$realtarget" fi fi else # A missing file is only an error for the first file. This # is a blatant hack to let us support using "yacc -d". If -d # is not specified, we don't want an error when the header # file is "missing". if test $first = yes; then ret=1 fi fi shift shift first=no done else ret=$? fi # Remove the directory. cd .. rm -rf $dirname exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: gp2c-0.0.8/config/depcomp0000755000175000017500000005064312217042364012126 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2012-03-27.16; # UTC # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # A tabulation character. tab=' ' # A newline character. nl=' ' if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' "$nl" < "$tmpdepfile" | ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependent.h'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. # However on # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\': # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... # tcc 0.9.26 (FIXME still under development at the moment of writing) # will emit a similar output, but also prepend the continuation lines # with horizontal tabulation characters. "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form 'foo.o: dependent.h', # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. # Do two passes, one to just change these to # '$object: dependent.h' and one to simply 'dependent.h:'. sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ < "$tmpdepfile" > "$depfile" sed ' s/[ '"$tab"'][ '"$tab"']*/ /g s/^ *// s/ *\\*$// s/^[^:]*: *// /^$/d /:$/d s/$/ :/ ' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test "$stat" = 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' "$nl" < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: gp2c-0.0.8/config/arch-osname0000755000175000017500000000371112217042364012666 00000000000000#! /bin/sh arch=none; osname=unknown myuname=`(uname -a) 2>/dev/null || arch 2>&1` if test -d /NextApps; then myuname=nextstep; fi if test -n "$myuname"; then myuname=`echo $myuname | sed -e 's/^[^=]*=//' -e 's,/,,g' | \ tr '[A-Z]' '[a-z]' | tr '\012' ' '` set X $myuname; shift; osname=$1 case "$osname" in irix*) osname=irix;; fx2800) arch=fx2800; osname=concentrix;; hp*) arch=hppa; osname=hpux;; freebsd|os2) arch=ix86;; ultrix) arch=mips;; nextstep) arch=`file /bin/sh | sed 's/.*(for architecture \(.*\))/\1/'`;; osf1) case "$5" in alpha) arch=alpha;; esac;; cygwin*) arch=$HOSTTYPE;; linux) arch=`uname -m` case "`cat /proc/cpuinfo`" in *SuperSparc*) arch=sparcv8_super;; *TMS390Z5[05]*) arch=sparcv8_super;; # SuperSparc I or II *TMS390S1[05]*) arch=sparcv8_micro;; # MicroSparc I *MB86904*) arch=sparcv8_micro;; # MicroSparc II *MB86907*) arch=sparcv8_micro;; # TurboSparc *MB86934*) arch=sparcv8_super;; # SparcLite *RT625*) arch=sparcv8_super;; # HyperSparc *CY605*) arch=sparcv8_super;; esac;; sunos) case "$3" in 5*) osname=solaris;; esac case "$5" in sun3*) arch=m68k;; sun4|sun4[ce]) arch=sparcv7;; sun4[dm]) cpu="TI,|FMI,|Cypress,|Ross," case "`(prtconf||devinfo)2>&- |egrep $cpu`" in *TI,TMS390Z5[05]*) arch=sparcv8_super;; # SuperSparc I or II *TI,TMS390S1[05]*) arch=sparcv8_micro;; # MicroSparc I *FMI,MB86904*) arch=sparcv8_micro;; # MicroSparc II *FMI,MB86907*) arch=sparcv8_micro;; # TurboSparc *FMI,MB86934*) arch=sparcv8_super;; # SparcLite *Ross,RT625*) arch=sparcv8_super;; # HyperSparc *Cypress,CY605*) arch=sparcv8_super;; *) arch=sparcv8;; esac;; sun4u) arch=sparcv9;; i*pc) arch=ix86;; *) case "$4" in sun) arch=m68k;; esac;; esac;; esac fi echo $arch-$osname gp2c-0.0.8/config/checkspaces0000755000175000017500000000067712217042364012755 00000000000000#! /bin/sh CFILES="`echo src/*.[chyl] |sed -e 's,src/\(parse\|lang\)\.[ch],,g'`" OFILES="AUTHORS README NEWS BUGS doc/*.tex" SCRIPTS="`echo scripts/*.in |sed -e 's,scripts/Makefile.in,,g'`" err=0; if grep ' $' $CFILES $OFILES $SCRIPTS; then echo "BUG: trailing spaces found." err=1; fi if grep ' ' $CFILES $OFILES; then echo "BUG: TAB found." err=1; fi if grep ' $' $SCRIPTS; then echo "BUG: TAB found in scripts." err=1; fi exit $err gp2c-0.0.8/config/missing0000755000175000017500000002415212217042364012144 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, # 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and \`g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # normalize program name to check for. program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). This is about non-GNU programs, so use $1 not # $program. case $1 in lex*|yacc*) # Not GNU programs, they don't have --version. ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $program in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te*) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison*|yacc*) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex*|flex*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit $? fi ;; makeinfo*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: