source: git/Singular/extra.cc @ d8db70

spielwiese
Last change on this file since d8db70 was d8db70, checked in by Frank Seelisch <seelisch@…>, 15 years ago
changes of extra system command 'changeRing' to ease generation of Maple, M2, and Magma scripts git-svn-id: file:///usr/local/Singular/svn/trunk@12178 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 95.6 KB
Line 
1/*****************************************
2*  Computer Algebra System SINGULAR      *
3*****************************************/
4/* $Id: extra.cc,v 1.324 2009-10-09 09:05:18 seelisch Exp $ */
5/*
6* ABSTRACT: general interface to internals of Singular ("system" command)
7*/
8
9#define HAVE_WALK 1
10
11#include <stdlib.h>
12#include <stdio.h>
13#include <string.h>
14#include <ctype.h>
15#include <signal.h>
16#include "mod2.h"
17
18#ifdef TIME_WITH_SYS_TIME
19# include <time.h>
20# ifdef HAVE_SYS_TIME_H
21#   include <sys/time.h>
22# endif
23#else
24# ifdef HAVE_SYS_TIME_H
25#   include <sys/time.h>
26# else
27#   include <time.h>
28# endif
29#endif
30#ifdef HAVE_SYS_TIMES_H
31#include <sys/times.h>
32#endif
33
34#include <unistd.h>
35
36#include "tok.h"
37#include "ipid.h"
38#include "polys.h"
39#include "lists.h"
40#include "kutil.h"
41#include "cntrlc.h"
42#include "stairc.h"
43#include "ipshell.h"
44#include "modulop.h"
45#include "febase.h"
46#include "matpol.h"
47#include "longalg.h"
48#include "ideals.h"
49#include "kstd1.h"
50#include "syz.h"
51#include "sdb.h"
52#include "feOpt.h"
53#include "distrib.h"
54#include "prCopy.h"
55#include "mpr_complex.h"
56#include "ffields.h" // test GF only
57
58#ifdef HAVE_RINGS
59#include "ringgb.h"
60#endif
61
62#ifdef HAVE_GFAN
63#include "gfan.h"
64#endif
65
66#ifdef HAVE_F5
67#include "f5gb.h"
68#endif
69
70#ifdef HAVE_F5C
71#include "f5c.h"
72#endif
73
74#ifdef HAVE_WALK
75#include "walk.h"
76#endif
77
78#include "weight.h"
79#include "fast_mult.h"
80#include "digitech.h"
81
82#ifdef HAVE_SPECTRUM
83#include "spectrum.h"
84#endif
85
86#ifdef HAVE_BIFAC
87#include <bifac.h>
88#endif
89
90#include "attrib.h"
91
92#if defined(HPUX_10) || defined(HPUX_9)
93extern "C" int setenv(const char *name, const char *value, int overwrite);
94#endif
95
96#ifdef HAVE_PLURAL
97#include "ring.h"
98#include "gring.h"
99#include "sca.h"
100#include <ncSAMult.h> // for CMultiplier etc classes
101#include "ipconv.h"
102#include "ratgring.h"
103#endif
104
105#ifdef ix86_Win /* only for the DLLTest */
106/* #include "WinDllTest.h" */
107#ifdef HAVE_DL
108#include "mod_raw.h"
109#endif
110#endif
111
112// for tests of t-rep-GB
113#include "tgb.h"
114
115// Define to enable many more system commands
116#undef MAKE_DISTRIBUTION
117#ifndef MAKE_DISTRIBUTION
118#define HAVE_EXTENDED_SYSTEM 1
119#endif
120
121#ifdef HAVE_FACTORY
122#define SI_DONT_HAVE_GLOBAL_VARS
123#include "clapsing.h"
124#include "clapconv.h"
125#include "kstdfac.h"
126#endif
127
128#include "silink.h"
129#include "walk.h"
130
131#include "fast_maps.h"
132
133#include "shiftgb.h"
134
135#ifdef HAVE_EIGENVAL
136#include "eigenval_ip.h"
137#endif
138
139#ifdef HAVE_GMS
140#include "gms.h"
141#endif
142
143/*
144 *   New function/system-calls that will be included as dynamic module
145 * should be inserted here.
146 * - without HAVE_DYNAMIC_LOADING: these functions comes as system("....");
147 * - with    HAVE_DYNAMIC_LOADING: these functions are loaded as module.
148 */
149//#ifndef HAVE_DYNAMIC_LOADING
150
151#ifdef HAVE_PCV
152#include "pcv.h"
153#endif
154
155//#endif /* not HAVE_DYNAMIC_LOADING */
156
157#ifdef ix86_Win
158//#include <Python.h>
159//#include <python_wrapper.h>
160#endif
161
162#ifdef HAVE_MINOR
163#include "TestMinors.h" // for testing new minor code
164#endif // HAVE_MINOR
165
166#ifdef HAVE_WRAPPERS
167#include "Wrappers.h" // for testing C++ wrappers
168#endif // HAVE_WRAPPERS
169
170
171void piShowProcList();
172#ifndef MAKE_DISTRIBUTION
173static BOOLEAN jjEXTENDED_SYSTEM(leftv res, leftv h);
174#endif
175
176extern BOOLEAN jjJanetBasis(leftv res, leftv v);
177
178#ifdef ix86_Win  /* PySingular initialized? */
179static int PyInitialized = 0;
180#endif
181
182int singular_homog_flag=1;
183
184//void emStart();
185/*2
186*  the "system" command
187*/
188BOOLEAN jjSYSTEM(leftv res, leftv args)
189{
190  if(args->Typ() == STRING_CMD)
191  {
192    const char *sys_cmd=(char *)(args->Data());
193    leftv h=args->next;
194// ONLY documented system calls go here
195// Undocumented system calls go down into jjEXTENDED_SYSTEM (#ifdef HAVE_EXTENDED_SYSTEM)
196/*==================== nblocks ==================================*/
197    if (strcmp(sys_cmd, "nblocks") == 0)
198    {
199      ring r;
200      if (h == NULL)
201      {
202        if (currRingHdl != NULL)
203        {
204          r = IDRING(currRingHdl);
205        }
206        else
207        {
208          WerrorS("no ring active");
209          return TRUE;
210        }
211      }
212      else
213      {
214        if (h->Typ() != RING_CMD)
215        {
216          WerrorS("ring expected");
217          return TRUE;
218        }
219        r = (ring) h->Data();
220      }
221      res->rtyp = INT_CMD;
222      res->data = (void*) (long)(rBlocks(r) - 1);
223      return FALSE;
224    }
225/*==================== version ==================================*/
226    if(strcmp(sys_cmd,"version")==0)
227    {
228      res->rtyp=INT_CMD;
229      res->data=(void *)SINGULAR_VERSION;
230      return FALSE;
231    }
232    else
233
234
235
236
237/*==================== gen ==================================*/
238    if(strcmp(sys_cmd,"gen")==0)
239    {
240      res->rtyp=INT_CMD;
241      res->data=(void *)(long)npGen;
242      return FALSE;
243    }
244    else
245/*==================== sh ==================================*/
246    if(strcmp(sys_cmd,"sh")==0)
247    {
248      res->rtyp=INT_CMD;
249      if (h==NULL) res->data = (void *)(long) system("sh");
250      else if (h->Typ()==STRING_CMD)
251        res->data = (void*)(long) system((char*)(h->Data()));
252      else
253        WerrorS("string expected");
254      return FALSE;
255    }
256    else
257/*==================== uname ==================================*/
258    if(strcmp(sys_cmd,"uname")==0)
259    {
260      res->rtyp=STRING_CMD;
261      res->data = omStrDup(S_UNAME);
262      return FALSE;
263    }
264    else
265/*==================== with ==================================*/
266    if(strcmp(sys_cmd,"with")==0)
267    {
268      if (h==NULL)
269      {
270        res->rtyp=STRING_CMD;
271        res->data=(void *)omStrDup(versionString());
272        return FALSE;
273      }
274      else if (h->Typ()==STRING_CMD)
275      {
276        #define TEST_FOR(A) if(strcmp(s,A)==0) res->data=(void *)1; else
277        char *s=(char *)h->Data();
278        res->rtyp=INT_CMD;
279        #ifdef HAVE_DBM
280          TEST_FOR("DBM")
281        #endif
282        #ifdef HAVE_DLD
283          TEST_FOR("DLD")
284        #endif
285        #ifdef HAVE_FACTORY
286          TEST_FOR("factory")
287          //TEST_FOR("libfac")
288        #endif
289        #ifdef HAVE_MPSR
290          TEST_FOR("MP")
291        #endif
292        #ifdef HAVE_READLINE
293          TEST_FOR("readline")
294        #endif
295        #ifdef HAVE_TCL
296          TEST_FOR("tcl")
297        #endif
298        #ifdef TEST_MAC_ORDER
299          TEST_FOR("MAC_ORDER");
300        #endif
301        // unconditional since 3-1-0-6
302          TEST_FOR("Namespaces");
303        #ifdef HAVE_DYNAMIC_LOADING
304          TEST_FOR("DynamicLoading");
305        #endif
306        #ifdef HAVE_EIGENVAL
307          TEST_FOR("eigenval");
308        #endif
309        #ifdef HAVE_GMS
310          TEST_FOR("gms");
311        #endif
312          ;
313        return FALSE;
314        #undef TEST_FOR
315      }
316      return TRUE;
317    }
318    else
319/*==================== browsers ==================================*/
320    if (strcmp(sys_cmd,"browsers")==0)
321    {
322      res->rtyp = STRING_CMD;
323      char* b = StringSetS("");
324      feStringAppendBrowsers(0);
325      res->data = omStrDup(b);
326      return FALSE;
327    }
328    else
329/*==================== pid ==================================*/
330    if (strcmp(sys_cmd,"pid")==0)
331    {
332      res->rtyp=INT_CMD;
333      res->data=(void *)(long) getpid();
334      return FALSE;
335    }
336    else
337/*==================== getenv ==================================*/
338    if (strcmp(sys_cmd,"getenv")==0)
339    {
340      if ((h!=NULL) && (h->Typ()==STRING_CMD))
341      {
342        res->rtyp=STRING_CMD;
343        const char *r=getenv((char *)h->Data());
344        if (r==NULL) r="";
345        res->data=(void *)omStrDup(r);
346        return FALSE;
347      }
348      else
349      {
350        WerrorS("string expected");
351        return TRUE;
352      }
353    }
354    else
355/*==================== setenv ==================================*/
356    if (strcmp(sys_cmd,"setenv")==0)
357    {
358#ifdef HAVE_SETENV
359      if (h!=NULL && h->Typ()==STRING_CMD && h->Data() != NULL &&
360          h->next != NULL && h->next->Typ() == STRING_CMD
361          && h->next->Data() != NULL)
362      {
363        res->rtyp=STRING_CMD;
364        setenv((char *)h->Data(), (char *)h->next->Data(), 1);
365        res->data=(void *)omStrDup((char *)h->next->Data());
366        feReInitResources();
367        return FALSE;
368      }
369      else
370      {
371        WerrorS("two strings expected");
372        return TRUE;
373      }
374#else
375      WerrorS("setenv not supported on this platform");
376      return TRUE;
377#endif
378    }
379    else
380/*==================== Singular ==================================*/
381    if (strcmp(sys_cmd, "Singular") == 0)
382    {
383      res->rtyp=STRING_CMD;
384      const char *r=feResource("Singular");
385      if (r == NULL) r="";
386      res->data = (void*) omStrDup( r );
387      return FALSE;
388    }
389    else
390    if (strcmp(sys_cmd, "SingularLib") == 0)
391    {
392      res->rtyp=STRING_CMD;
393      const char *r=feResource("SearchPath");
394      if (r == NULL) r="";
395      res->data = (void*) omStrDup( r );
396      return FALSE;
397    }
398    else
399/*==================== options ==================================*/
400    if (strstr(sys_cmd, "--") == sys_cmd)
401    {
402      if (strcmp(sys_cmd, "--") == 0)
403      {
404        fePrintOptValues();
405        return FALSE;
406      }
407
408      feOptIndex opt = feGetOptIndex(&sys_cmd[2]);
409      if (opt == FE_OPT_UNDEF)
410      {
411        Werror("Unknown option %s", sys_cmd);
412        Werror("Use 'system(\"--\");' for listing of available options");
413        return TRUE;
414      }
415
416      // for Untyped Options (help version),
417      // setting it just triggers action
418      if (feOptSpec[opt].type == feOptUntyped)
419      {
420        feSetOptValue(opt,0);
421        return FALSE;
422      }
423
424      if (h == NULL)
425      {
426        if (feOptSpec[opt].type == feOptString)
427        {
428          res->rtyp = STRING_CMD;
429          const char *r=(const char*)feOptSpec[opt].value;
430          if (r == NULL) r="";
431          res->data = omStrDup(r);
432        }
433        else
434        {
435          res->rtyp = INT_CMD;
436          res->data = feOptSpec[opt].value;
437        }
438        return FALSE;
439      }
440
441      if (h->Typ() != STRING_CMD &&
442          h->Typ() != INT_CMD)
443      {
444        Werror("Need string or int argument to set option value");
445        return TRUE;
446      }
447      const char* errormsg;
448      if (h->Typ() == INT_CMD)
449      {
450        if (feOptSpec[opt].type == feOptString)
451        {
452          Werror("Need string argument to set value of option %s", sys_cmd);
453          return TRUE;
454        }
455        errormsg = feSetOptValue(opt, (int)((long) h->Data()));
456        if (errormsg != NULL)
457          Werror("Option '--%s=%d' %s", sys_cmd, (int) ((long)h->Data()), errormsg);
458      }
459      else
460      {
461        errormsg = feSetOptValue(opt, (char*) h->Data());
462        if (errormsg != NULL)
463          Werror("Option '--%s=%s' %s", sys_cmd, (char*) h->Data(), errormsg);
464      }
465      if (errormsg != NULL) return TRUE;
466      return FALSE;
467    }
468    else
469/*==================== HC ==================================*/
470    if (strcmp(sys_cmd,"HC")==0)
471    {
472      res->rtyp=INT_CMD;
473      res->data=(void *)(long) HCord;
474      return FALSE;
475    }
476    else
477/*==================== random ==================================*/
478    if(strcmp(sys_cmd,"random")==0)
479    {
480      if ((h!=NULL) &&(h->Typ()==INT_CMD))
481      {
482        siRandomStart=(int)((long)h->Data());
483#ifdef buildin_rand
484        siSeed=siRandomStart;
485#else
486        srand((unsigned int)siRandomStart);
487#endif
488#ifdef HAVE_FACTORY
489        factoryseed(siRandomStart);
490#endif
491        return FALSE;
492      }
493      else if (h != NULL)
494      {
495        WerrorS("int expected");
496        return TRUE;
497      }
498      res->rtyp=INT_CMD;
499      res->data=(void*)(long) siRandomStart;
500      return FALSE;
501    }
502/*==================== complexNearZero ======================*/
503    if(strcmp(sys_cmd,"complexNearZero")==0)
504    {
505      if (h->Typ()==NUMBER_CMD )
506      {
507        if ( h->next!=NULL && h->next->Typ()==INT_CMD )
508        {
509          if ( !rField_is_long_C() )
510            {
511              Werror( "unsupported ground field!");
512              return TRUE;
513            }
514          else
515            {
516              res->rtyp=INT_CMD;
517              res->data=(void*)complexNearZero((gmp_complex*)h->Data(),
518                             (int)((long)(h->next->Data())));
519              return FALSE;
520            }
521        }
522        else
523        {
524          Werror( "expected <int> as third parameter!");
525          return TRUE;
526        }
527      }
528      else
529      {
530        Werror( "expected <number> as second parameter!");
531        return TRUE;
532      }
533    }
534/*==================== getPrecDigits ======================*/
535    if(strcmp(sys_cmd,"getPrecDigits")==0)
536    {
537      if ( !rField_is_long_C() && !rField_is_long_R() )
538      {
539        Werror( "unsupported ground field!");
540        return TRUE;
541      }
542      res->rtyp=INT_CMD;
543      res->data=(void*)getGMPFloatDigits();
544      return FALSE;
545    }
546/*==================== neworder =============================*/
547// should go below
548#ifdef HAVE_FACTORY
549    if(strcmp(sys_cmd,"neworder")==0)
550    {
551      if ((h!=NULL) &&(h->Typ()==IDEAL_CMD))
552      {
553        res->rtyp=STRING_CMD;
554        res->data=(void *)singclap_neworder((ideal)h->Data());
555        return FALSE;
556      }
557      else
558        WerrorS("ideal expected");
559    }
560    else
561#endif
562//#ifndef HAVE_DYNAMIC_LOADING
563/*==================== pcv ==================================*/
564#ifdef HAVE_PCV
565    if(strcmp(sys_cmd,"pcvLAddL")==0)
566    {
567      return pcvLAddL(res,h);
568    }
569    else
570    if(strcmp(sys_cmd,"pcvPMulL")==0)
571    {
572      return pcvPMulL(res,h);
573    }
574    else
575    if(strcmp(sys_cmd,"pcvMinDeg")==0)
576    {
577      return pcvMinDeg(res,h);
578    }
579    else
580    if(strcmp(sys_cmd,"pcvP2CV")==0)
581    {
582      return pcvP2CV(res,h);
583    }
584    else
585    if(strcmp(sys_cmd,"pcvCV2P")==0)
586    {
587      return pcvCV2P(res,h);
588    }
589    else
590    if(strcmp(sys_cmd,"pcvDim")==0)
591    {
592      return pcvDim(res,h);
593    }
594    else
595    if(strcmp(sys_cmd,"pcvBasis")==0)
596    {
597      return pcvBasis(res,h);
598    }
599    else
600#endif
601/*==================== eigenvalues ==================================*/
602#ifdef HAVE_EIGENVAL
603    if(strcmp(sys_cmd,"hessenberg")==0)
604    {
605      return evHessenberg(res,h);
606    }
607    else
608    if(strcmp(sys_cmd,"eigenvals")==0)
609    {
610      return evEigenvals(res,h);
611    }
612    else
613#endif
614/*==================== Gauss-Manin system ==================================*/
615#ifdef HAVE_GMS
616    if(strcmp(sys_cmd,"gmsnf")==0)
617    {
618      return gmsNF(res,h);
619    }
620    else
621#endif
622//#endif /* HAVE_DYNAMIC_LOADING */
623/*==================== contributors =============================*/
624   if(strcmp(sys_cmd,"contributors") == 0)
625   {
626     res->rtyp=STRING_CMD;
627     res->data=(void *)omStrDup(
628       "Olaf Bachmann, Michael Brickenstein, Hubert Grassmann, Kai Krueger, Victor Levandovskyy, Wolfgang Neumann, Thomas Nuessler, Wilfred Pohl, Jens Schmidt, Mathias Schulze, Thomas Siebert, Ruediger Stobbe, Moritz Wenk, Tim Wichmann");
629     return FALSE;
630   }
631   else
632/*==================== spectrum =============================*/
633   #ifdef HAVE_SPECTRUM
634   if(strcmp(sys_cmd,"spectrum") == 0)
635   {
636     if (h->Typ()!=POLY_CMD)
637     {
638       WerrorS("poly expected");
639       return TRUE;
640     }
641     if (h->next==NULL)
642       return spectrumProc(res,h);
643     if (h->next->Typ()!=INT_CMD)
644     {
645       WerrorS("poly,int expected");
646       return TRUE;
647     }
648     if(((long)h->next->Data())==1L)
649       return spectrumfProc(res,h);
650     return spectrumProc(res,h);
651   }
652   else
653/*==================== semic =============================*/
654   if(strcmp(sys_cmd,"semic") == 0)
655   {
656     if ((h->next!=NULL)
657     && (h->Typ()==LIST_CMD)
658     && (h->next->Typ()==LIST_CMD))
659     {
660       if (h->next->next==NULL)
661         return semicProc(res,h,h->next);
662       else if (h->next->next->Typ()==INT_CMD)
663         return semicProc3(res,h,h->next,h->next->next);
664     }
665     return TRUE;
666   }
667   else
668/*==================== spadd =============================*/
669   if(strcmp(sys_cmd,"spadd") == 0)
670   {
671     if ((h->next!=NULL)
672     && (h->Typ()==LIST_CMD)
673     && (h->next->Typ()==LIST_CMD))
674     {
675       if (h->next->next==NULL)
676         return spaddProc(res,h,h->next);
677     }
678     return TRUE;
679   }
680   else
681/*==================== spmul =============================*/
682   if(strcmp(sys_cmd,"spmul") == 0)
683   {
684     if ((h->next!=NULL)
685     && (h->Typ()==LIST_CMD)
686     && (h->next->Typ()==INT_CMD))
687     {
688       if (h->next->next==NULL)
689         return spmulProc(res,h,h->next);
690     }
691     return TRUE;
692   }
693   else
694#endif
695
696#define HAVE_SHEAFCOH_TRICKS 1
697
698#ifdef HAVE_SHEAFCOH_TRICKS
699    if(strcmp(sys_cmd,"tensorModuleMult")==0)
700    {
701//      WarnS("tensorModuleMult!");
702      if (h!=NULL && h->Typ()==INT_CMD && h->Data() != NULL &&
703          h->next != NULL && h->next->Typ() == MODUL_CMD
704          && h->next->Data() != NULL)
705      {
706        int m = (int)( (long)h->Data() );
707        ideal M = (ideal)h->next->Data();
708
709        res->rtyp=MODUL_CMD;
710        res->data=(void *)id_TensorModuleMult(m, M, currRing);
711        return FALSE;
712      }
713      WerrorS("system(\"tensorModuleMult\", int, module) expected");
714      return TRUE;
715    } else
716#endif
717
718
719#if 0
720    /// Returns old SyzCompLimit, can set new limit
721    if(strcmp(sys_cmd,"SetSyzComp")==0)
722    {
723      res->rtyp = INT_CMD;
724      res->data = (void *)rGetCurrSyzLimit(currRing);
725      if ((h!=NULL) && (h->Typ()==INT_CMD))
726      {
727        const int iSyzComp = (int)((long)(h->Data()));
728        assume( iSyzComp > 0 );
729        rSetSyzComp( iSyzComp );
730      }
731
732      return FALSE;
733    }
734    /// Endowe the current ring with additional (leading) Syz-component ordering
735    if(strcmp(sys_cmd,"MakeSyzCompOrdering")==0)
736    {
737      extern ring rAssure_SyzComp(const ring r, BOOLEAN complete);
738
739//    res->data = rCurrRingAssure_SyzComp(); // changes current ring! :(
740      res->data = (void *)rAssure_SyzComp(currRing, TRUE);
741      res->rtyp = RING_CMD; // return new ring!
742
743      return FALSE;
744    }
745#endif
746
747    /// Same for Induced Schreyer ordering (ordering on components is defined by sign!)
748    if(strcmp(sys_cmd,"MakeInducedSchreyerOrdering")==0)
749    {
750      extern ring rAssure_InducedSchreyerOrdering(const ring r, BOOLEAN complete, int sign);
751      int sign = 1;
752      if ((h!=NULL) && (h->Typ()==INT_CMD))
753      {
754        sign = (int)((long)(h->Data()));
755        assume( sign == 1 || sign == -1 );
756      }
757      res->data = (void *)rAssure_InducedSchreyerOrdering(currRing, TRUE, sign);
758      res->rtyp = RING_CMD; // return new ring!
759      return FALSE;
760    }
761
762    /// Returns old SyzCompLimit, can set new limit
763    if(strcmp(sys_cmd,"SetInducedReferrence")==0)
764    {
765      extern void rSetISReference(const ideal F, const int rank, const int p, const intvec * componentWeights, const ring r);
766
767      if ((h!=NULL) && ( (h->Typ()==IDEAL_CMD) || (h->Typ()==MODUL_CMD)))
768      {
769        intvec * componentWeights = (intvec *)atGet(h,"isHomog",INTVEC_CMD); // No copy?!
770
771        const ideal F = (ideal)h->Data(); ; // No copy!
772        h=h->next;
773
774        int rank = idRankFreeModule(F, currRing, currRing); // Starting syz-comp (1st: i+1)
775
776        if ((h!=NULL) && (h->Typ()==INT_CMD))
777        {
778          rank = (int)((long)(h->Data())); h=h->next;
779        }
780
781        int p = 0; // which IS-block? p^th!
782
783        if ((h!=NULL) && (h->Typ()==INT_CMD))
784        {
785          p = (int)((long)(h->Data())); h=h->next;
786        }
787
788        // F & componentWeights belong to that ordering block of currRing now:
789        rSetISReference(F, rank, p, componentWeights, currRing); // F and componentWeights will be copied!
790      }
791      else
792      {
793        WerrorS("`system(\"SetISReferrence\",<ideal/module>, [int, int])` expected");
794        return TRUE;
795      }
796      return FALSE;
797    }
798
799
800//    F = system("ISUpdateComponents", F, V, MIN );
801//    // replace gen(i) -> gen(MIN + V[i-MIN]) for all i > MIN in all terms from F!
802//    extern void pISUpdateComponents(ideal F, const intvec *const V, const int MIN, const ring r);
803    if(strcmp(sys_cmd,"ISUpdateComponents")==0)
804    {
805
806      PrintS("ISUpdateComponents:.... \n");
807
808      if ((h!=NULL) && (h->Typ()==MODUL_CMD))
809      {
810        ideal F = (ideal)h->Data(); ; // No copy!
811        h=h->next;
812
813        if ((h!=NULL) && (h->Typ()==INTVEC_CMD))
814        {
815          const intvec* const V = (const intvec* const) h->Data();
816          h=h->next;
817
818          if ((h!=NULL) && (h->Typ()==INT_CMD))
819          {
820            const int MIN = (int)((long)(h->Data()));
821
822            extern void pISUpdateComponents(ideal F, const intvec *const V, const int MIN, const ring r);
823            pISUpdateComponents(F, V, MIN, currRing);
824            return FALSE;
825          }
826        }
827      }
828
829      WerrorS("`system(\"ISUpdateComponents\",<module>, intvec, int)` expected");
830      return TRUE;
831    }
832   
833
834
835
836////////////////////////////////////////////////////////////////////////
837/// Additional interface functions to non-commutative subsystem (PLURAL)
838///
839
840
841#ifdef HAVE_PLURAL
842/*==================== Approx_Step  =================*/
843     if (strcmp(sys_cmd, "astep") == 0)
844     {
845       ideal I;
846       if ((h!=NULL) && (h->Typ()==IDEAL_CMD))
847       {
848         I=(ideal)h->CopyD();
849         res->rtyp=IDEAL_CMD;
850         if (rIsPluralRing(currRing)) res->data=Approx_Step(I);
851         else res->data=I;
852         setFlag(res,FLAG_STD);
853       }
854       else return TRUE;
855       return FALSE;
856     }
857/*==================== PrintMat  =================*/
858    if (strcmp(sys_cmd, "PrintMat") == 0)
859    {
860        int a;
861        int b;
862        ring r;
863        int metric;
864        if ((h!=NULL) && (h->Typ()==INT_CMD))
865        {
866          a=(int)((long)(h->Data()));
867          h=h->next;
868        }
869        else if ((h!=NULL) && (h->Typ()==INT_CMD))
870        {
871          b=(int)((long)(h->Data()));
872          h=h->next;
873        }
874        else if ((h!=NULL) && (h->Typ()==RING_CMD))
875        {
876          r=(ring)h->Data();
877          h=h->next;
878        }
879        else
880          return TRUE;
881        if ((h!=NULL) && (h->Typ()==INT_CMD))
882        {
883          metric=(int)((long)(h->Data()));
884        }
885        res->rtyp=MATRIX_CMD;
886        if (rIsPluralRing(r)) res->data=nc_PrintMat(a,b,r,metric);
887        else res->data=NULL;
888        return FALSE;
889      }
890/*==================== twostd  =================*/
891      if (strcmp(sys_cmd, "twostd") == 0)
892      {
893        ideal I;
894        if ((h!=NULL) && (h->Typ()==IDEAL_CMD))
895        {
896          I=(ideal)h->CopyD();
897          res->rtyp=IDEAL_CMD;
898          if (rIsPluralRing(currRing)) res->data=twostd(I);
899          else res->data=I;
900          setFlag(res,FLAG_TWOSTD);
901          setFlag(res,FLAG_STD);
902        }
903        else return TRUE;
904        return FALSE;
905      }
906/*==================== lie bracket =================*/
907    if (strcmp(sys_cmd, "bracket") == 0)
908    {
909      poly p;
910      poly q;
911      if ((h!=NULL) && (h->Typ()==POLY_CMD))
912      {
913        p=(poly)h->CopyD();
914        h=h->next;
915      }
916      else return TRUE;
917      if ((h!=NULL) && (h->Typ()==POLY_CMD))
918      {
919        q=(poly)h->Data();
920      }
921      else return TRUE;
922      res->rtyp=POLY_CMD;
923      if (rIsPluralRing(currRing))  res->data=nc_p_Bracket_qq(p,q);
924      else res->data=NULL;
925      return FALSE;
926    }
927    if(strcmp(sys_cmd,"NCUseExtensions")==0)
928    {
929
930      if ((h!=NULL) && (h->Typ()==INT_CMD))
931        res->data=(void *)setNCExtensions( (int)((long)(h->Data())) );
932      else
933        res->data=(void *)getNCExtensions();
934
935      res->rtyp=INT_CMD;
936      return FALSE;
937    }
938
939
940    if(strcmp(sys_cmd,"NCGetType")==0)
941    {
942      res->rtyp=INT_CMD;
943
944      if( rIsPluralRing(currRing) )
945        res->data=(void *)ncRingType(currRing);
946      else
947        res->data=(void *)(-1);
948
949      return FALSE;
950    }
951
952
953    if(strcmp(sys_cmd,"ForceSCA")==0)
954    {
955      if( !rIsPluralRing(currRing) )
956        return TRUE;
957
958      int b, e;
959
960      if ((h!=NULL) && (h->Typ()==INT_CMD))
961      {
962        b = (int)((long)(h->Data()));
963        h=h->next;
964      }
965      else return TRUE;
966
967      if ((h!=NULL) && (h->Typ()==INT_CMD))
968      {
969        e = (int)((long)(h->Data()));
970      }
971      else return TRUE;
972
973
974      if( !sca_Force(currRing, b, e) )
975        return TRUE;
976
977      return FALSE;
978    }
979
980    if(strcmp(sys_cmd,"ForceNewNCMultiplication")==0)
981    {
982      if( !rIsPluralRing(currRing) )
983        return TRUE;
984
985      if( !ncInitSpecialPairMultiplication(currRing) ) // No Plural!
986        return TRUE;
987
988      return FALSE;
989    }
990
991    if(strcmp(sys_cmd,"ForceNewOldNCMultiplication")==0)
992    {
993      if( !rIsPluralRing(currRing) )
994        return TRUE;
995
996      if( !ncInitSpecialPowersMultiplication(currRing) ) // Enable Formula for Plural (depends on swiches)!
997        return TRUE;
998
999      return FALSE;
1000    }
1001
1002
1003
1004
1005    /*==================== PLURAL =================*/
1006/*==================== opp ==================================*/
1007    if (strcmp(sys_cmd, "opp")==0)
1008    {
1009      if ((h!=NULL) && (h->Typ()==RING_CMD))
1010      {
1011        ring r=(ring)h->Data();
1012        res->data=rOpposite(r);
1013        res->rtyp=RING_CMD;
1014        return FALSE;
1015      }
1016      else
1017      {
1018        WerrorS("`system(\"opp\",<ring>)` expected");
1019        return TRUE;
1020      }
1021    }
1022    else
1023/*==================== env ==================================*/
1024    if (strcmp(sys_cmd, "env")==0)
1025    {
1026      if ((h!=NULL) && (h->Typ()==RING_CMD))
1027      {
1028        ring r = (ring)h->Data();
1029        res->data = rEnvelope(r);
1030        res->rtyp = RING_CMD;
1031        return FALSE;
1032      }
1033      else
1034      {
1035        WerrorS("`system(\"env\",<ring>)` expected");
1036        return TRUE;
1037      }
1038    }
1039    else
1040/*==================== oppose ==================================*/
1041    if (strcmp(sys_cmd, "oppose")==0)
1042    {
1043      if ((h!=NULL) && (h->Typ()==RING_CMD)
1044      && (h->next!= NULL))
1045      {
1046        ring Rop = (ring)h->Data();
1047        h   = h->next;
1048        idhdl w;
1049        if ((w=Rop->idroot->get(h->Name(),myynest))!=NULL)
1050        {
1051          poly p = (poly)IDDATA(w);
1052          res->data = pOppose(Rop,p);
1053          res->rtyp = POLY_CMD;
1054          return FALSE;
1055        }
1056      }
1057      else
1058      {
1059        WerrorS("`system(\"oppose\",<ring>,<poly>)` expected");
1060        return TRUE;
1061      }
1062    }
1063    else
1064/*==================== freeGB, twosided GB in free algebra =================*/
1065#ifdef HAVE_SHIFTBBA
1066    if (strcmp(sys_cmd, "freegb") == 0)
1067    {
1068      ideal I;
1069      int uptodeg, lVblock;
1070      if ((h!=NULL) && (h->Typ()==IDEAL_CMD))
1071      {
1072        I=(ideal)h->CopyD();
1073        h=h->next;
1074      }
1075      else return TRUE;
1076      if ((h!=NULL) && (h->Typ()==INT_CMD))
1077      {
1078        uptodeg=(int)((long)(h->Data()));
1079        h=h->next;
1080      }
1081      else return TRUE;
1082      if ((h!=NULL) && (h->Typ()==INT_CMD))
1083      {
1084        lVblock=(int)((long)(h->Data()));
1085        res->data = freegb(I,uptodeg,lVblock);
1086        if (res->data == NULL)
1087        {
1088          /* that is there were input errors */
1089          res->data = I;
1090        }
1091        res->rtyp = IDEAL_CMD;
1092      }
1093      else return TRUE;
1094      return FALSE;
1095    }
1096    else
1097#endif /*SHIFTBBA*/
1098#endif /*PLURAL*/
1099/*==================== walk stuff =================*/
1100#ifdef HAVE_WALK
1101#ifdef OWNW
1102    if (strcmp(sys_cmd, "walkNextWeight") == 0)
1103    {
1104      if (h == NULL || h->Typ() != INTVEC_CMD ||
1105          h->next == NULL || h->next->Typ() != INTVEC_CMD ||
1106          h->next->next == NULL || h->next->next->Typ() != IDEAL_CMD)
1107      {
1108        Werror("system(\"walkNextWeight\", intvec, intvec, ideal) expected");
1109        return TRUE;
1110      }
1111
1112      if (((intvec*) h->Data())->length() != currRing->N ||
1113          ((intvec*) h->next->Data())->length() != currRing->N)
1114      {
1115        Werror("system(\"walkNextWeight\" ...) intvecs not of length %d\n",
1116               currRing->N);
1117        return TRUE;
1118      }
1119      res->data = (void*) walkNextWeight(((intvec*) h->Data()),
1120                                         ((intvec*) h->next->Data()),
1121                                         (ideal) h->next->next->Data());
1122      if (res->data == (void*) 0 || res->data == (void*) 1)
1123      {
1124        res->rtyp = INT_CMD;
1125      }
1126      else
1127      {
1128        res->rtyp = INTVEC_CMD;
1129      }
1130      return FALSE;
1131    }
1132    else if (strcmp(sys_cmd, "walkInitials") == 0)
1133    {
1134      if (h == NULL || h->Typ() != IDEAL_CMD)
1135      {
1136        WerrorS("system(\"walkInitials\", ideal) expected");
1137        return TRUE;
1138      }
1139
1140      res->data = (void*) walkInitials((ideal) h->Data());
1141      res->rtyp = IDEAL_CMD;
1142      return FALSE;
1143    }
1144    else
1145#endif
1146#ifdef WAIV
1147    if (strcmp(sys_cmd, "walkAddIntVec") == 0)
1148    {
1149      if (h == NULL || h->Typ() != INTVEC_CMD ||
1150          h->next == NULL || h->next->Typ() != INTVEC_CMD)
1151      {
1152        WerrorS("system(\"walkAddIntVec\", intvec, intvec) expected");
1153        return TRUE;
1154      }
1155      intvec* arg1 = (intvec*) h->Data();
1156      intvec* arg2 = (intvec*) h->next->Data();
1157
1158
1159      res->data = (intvec*) walkAddIntVec(arg1, arg2);
1160      res->rtyp = INTVEC_CMD;
1161      return FALSE;
1162    }
1163    else
1164#endif
1165#ifdef MwaklNextWeight
1166    if (strcmp(sys_cmd, "MwalkNextWeight") == 0)
1167    {
1168      if (h == NULL || h->Typ() != INTVEC_CMD ||
1169          h->next == NULL || h->next->Typ() != INTVEC_CMD ||
1170          h->next->next == NULL || h->next->next->Typ() != IDEAL_CMD)
1171      {
1172        Werror("system(\"MwalkNextWeight\", intvec, intvec, ideal) expected");
1173        return TRUE;
1174      }
1175
1176      if (((intvec*) h->Data())->length() != currRing->N ||
1177          ((intvec*) h->next->Data())->length() != currRing->N)
1178      {
1179        Werror("system(\"MwalkNextWeight\" ...) intvecs not of length %d\n",
1180               currRing->N);
1181        return TRUE;
1182      }
1183      intvec* arg1 = (intvec*) h->Data();
1184      intvec* arg2 = (intvec*) h->next->Data();
1185      ideal arg3   =   (ideal) h->next->next->Data();
1186
1187      intvec* result = (intvec*) MwalkNextWeight(arg1, arg2, arg3);
1188
1189      res->rtyp = INTVEC_CMD;
1190      res->data =  result;
1191
1192      return FALSE;
1193    }
1194    else
1195#endif //MWalkNextWeight
1196    if(strcmp(sys_cmd, "Mivdp") == 0)
1197    {
1198      if (h == NULL || h->Typ() != INT_CMD)
1199      {
1200        Werror("system(\"Mivdp\", int) expected");
1201        return TRUE;
1202      }
1203      if ((int) ((long)(h->Data())) != currRing->N)
1204      {
1205        Werror("system(\"Mivdp\" ...) intvecs not of length %d\n",
1206               currRing->N);
1207        return TRUE;
1208      }
1209      int arg1 = (int) ((long)(h->Data()));
1210
1211      intvec* result = (intvec*) Mivdp(arg1);
1212
1213      res->rtyp = INTVEC_CMD;
1214      res->data =  result;
1215
1216      return FALSE;
1217    }
1218
1219    else if(strcmp(sys_cmd, "Mivlp") == 0)
1220    {
1221      if (h == NULL || h->Typ() != INT_CMD)
1222      {
1223        Werror("system(\"Mivlp\", int) expected");
1224        return TRUE;
1225      }
1226      if ((int) ((long)(h->Data())) != currRing->N)
1227      {
1228        Werror("system(\"Mivlp\" ...) intvecs not of length %d\n",
1229               currRing->N);
1230        return TRUE;
1231      }
1232      int arg1 = (int) ((long)(h->Data()));
1233
1234      intvec* result = (intvec*) Mivlp(arg1);
1235
1236      res->rtyp = INTVEC_CMD;
1237      res->data =  result;
1238
1239      return FALSE;
1240    }
1241   else
1242#ifdef MpDiv
1243      if(strcmp(sys_cmd, "MpDiv") == 0)
1244      {
1245        if(h==NULL || h->Typ() != POLY_CMD ||
1246           h->next == NULL || h->next->Typ() != POLY_CMD)
1247        {
1248          Werror("system(\"MpDiv\",poly, poly) expected");
1249          return TRUE;
1250        }
1251        poly arg1 = (poly) h->Data();
1252        poly arg2 = (poly) h->next->Data();
1253
1254        poly result = MpDiv(arg1, arg2);
1255
1256        res->rtyp = POLY_CMD;
1257        res->data = result;
1258        return FALSE;
1259      }
1260    else
1261#endif
1262#ifdef MpMult
1263      if(strcmp(sys_cmd, "MpMult") == 0)
1264      {
1265        if(h==NULL || h->Typ() != POLY_CMD ||
1266           h->next == NULL || h->next->Typ() != POLY_CMD)
1267        {
1268          Werror("system(\"MpMult\",poly, poly) expected");
1269          return TRUE;
1270        }
1271        poly arg1 = (poly) h->Data();
1272        poly arg2 = (poly) h->next->Data();
1273
1274        poly result = MpMult(arg1, arg2);
1275        res->rtyp = POLY_CMD;
1276        res->data = result;
1277        return FALSE;
1278      }
1279  else
1280#endif
1281   if (strcmp(sys_cmd, "MivSame") == 0)
1282    {
1283      if(h == NULL || h->Typ() != INTVEC_CMD ||
1284         h->next == NULL || h->next->Typ() != INTVEC_CMD )
1285      {
1286        Werror("system(\"MivSame\", intvec, intvec) expected");
1287        return TRUE;
1288      }
1289      /*
1290      if (((intvec*) h->Data())->length() != currRing->N ||
1291          ((intvec*) h->next->Data())->length() != currRing->N)
1292      {
1293        Werror("system(\"MivSame\" ...) intvecs not of length %d\n",
1294               currRing->N);
1295        return TRUE;
1296      }
1297      */
1298      intvec* arg1 = (intvec*) h->Data();
1299      intvec* arg2 = (intvec*) h->next->Data();
1300      /*
1301      poly result = (poly) MivSame(arg1, arg2);
1302
1303      res->rtyp = POLY_CMD;
1304      res->data =  (poly) result;
1305      */
1306      res->rtyp = INT_CMD;
1307      res->data = (void*)(long) MivSame(arg1, arg2);
1308      return FALSE;
1309    }
1310  else
1311   if (strcmp(sys_cmd, "M3ivSame") == 0)
1312    {
1313      if(h == NULL || h->Typ() != INTVEC_CMD ||
1314         h->next == NULL || h->next->Typ() != INTVEC_CMD ||
1315         h->next->next == NULL || h->next->next->Typ() != INTVEC_CMD  )
1316      {
1317        Werror("system(\"M3ivSame\", intvec, intvec, intvec) expected");
1318        return TRUE;
1319      }
1320      /*
1321      if (((intvec*) h->Data())->length() != currRing->N ||
1322          ((intvec*) h->next->Data())->length() != currRing->N ||
1323          ((intvec*) h->next->next->Data())->length() != currRing->N )
1324      {
1325        Werror("system(\"M3ivSame\" ...) intvecs not of length %d\n",
1326               currRing->N);
1327        return TRUE;
1328      }
1329      */
1330      intvec* arg1 = (intvec*) h->Data();
1331      intvec* arg2 = (intvec*) h->next->Data();
1332      intvec* arg3 = (intvec*) h->next->next->Data();
1333      /*
1334      poly result = (poly) M3ivSame(arg1, arg2, arg3);
1335
1336      res->rtyp = POLY_CMD;
1337      res->data =  (poly) result;
1338      */
1339      res->rtyp = INT_CMD;
1340      res->data = (void*)(long) M3ivSame(arg1, arg2, arg3);
1341      return FALSE;
1342    }
1343  else
1344      if(strcmp(sys_cmd, "MwalkInitialForm") == 0)
1345      {
1346        if(h == NULL || h->Typ() != IDEAL_CMD ||
1347           h->next == NULL || h->next->Typ() != INTVEC_CMD)
1348        {
1349          Werror("system(\"MwalkInitialForm\", ideal, intvec) expected");
1350          return TRUE;
1351        }
1352        if(((intvec*) h->next->Data())->length() != currRing->N)
1353        {
1354          Werror("system \"MwalkInitialForm\"...) intvec not of length %d\n",
1355                 currRing->N);
1356          return TRUE;
1357        }
1358        ideal id      = (ideal) h->Data();
1359        intvec* int_w = (intvec*) h->next->Data();
1360        ideal result  = (ideal) MwalkInitialForm(id, int_w);
1361
1362        res->rtyp = IDEAL_CMD;
1363        res->data = result;
1364        return FALSE;
1365      }
1366  else
1367    /************** Perturbation walk **********/
1368     if(strcmp(sys_cmd, "MivMatrixOrder") == 0)
1369      {
1370        if(h==NULL || h->Typ() != INTVEC_CMD)
1371        {
1372          Werror("system(\"MivMatrixOrder\",intvec) expected");
1373          return TRUE;
1374        }
1375        intvec* arg1 = (intvec*) h->Data();
1376
1377        intvec* result = MivMatrixOrder(arg1);
1378
1379        res->rtyp = INTVEC_CMD;
1380        res->data =  result;
1381        return FALSE;
1382      }
1383    else
1384     if(strcmp(sys_cmd, "MivMatrixOrderdp") == 0)
1385      {
1386        if(h==NULL || h->Typ() != INT_CMD)
1387        {
1388          Werror("system(\"MivMatrixOrderdp\",intvec) expected");
1389          return TRUE;
1390        }
1391        int arg1 = (int) ((long)(h->Data()));
1392
1393        intvec* result = (intvec*) MivMatrixOrderdp(arg1);
1394
1395        res->rtyp = INTVEC_CMD;
1396        res->data =  result;
1397        return FALSE;
1398      }
1399    else
1400    if(strcmp(sys_cmd, "MPertVectors") == 0)
1401      {
1402
1403        if(h==NULL || h->Typ() != IDEAL_CMD ||
1404           h->next == NULL || h->next->Typ() != INTVEC_CMD ||
1405           h->next->next == NULL || h->next->next->Typ() != INT_CMD)
1406        {
1407          Werror("system(\"MPertVectors\",ideal, intvec, int) expected");
1408          return TRUE;
1409        }
1410
1411        ideal arg1 = (ideal) h->Data();
1412        intvec* arg2 = (intvec*) h->next->Data();
1413        int arg3 = (int) ((long)(h->next->next->Data()));
1414
1415        intvec* result = (intvec*) MPertVectors(arg1, arg2, arg3);
1416
1417        res->rtyp = INTVEC_CMD;
1418        res->data =  result;
1419        return FALSE;
1420      }
1421    else
1422    if(strcmp(sys_cmd, "MPertVectorslp") == 0)
1423      {
1424
1425        if(h==NULL || h->Typ() != IDEAL_CMD ||
1426           h->next == NULL || h->next->Typ() != INTVEC_CMD ||
1427           h->next->next == NULL || h->next->next->Typ() != INT_CMD)
1428        {
1429          Werror("system(\"MPertVectorslp\",ideal, intvec, int) expected");
1430          return TRUE;
1431        }
1432
1433        ideal arg1 = (ideal) h->Data();
1434        intvec* arg2 = (intvec*) h->next->Data();
1435        int arg3 = (int) ((long)(h->next->next->Data()));
1436
1437        intvec* result = (intvec*) MPertVectorslp(arg1, arg2, arg3);
1438
1439        res->rtyp = INTVEC_CMD;
1440        res->data =  result;
1441        return FALSE;
1442      }
1443        /************** fractal walk **********/
1444    else
1445      if(strcmp(sys_cmd, "Mfpertvector") == 0)
1446      {
1447        if(h==NULL || h->Typ() != IDEAL_CMD ||
1448          h->next==NULL || h->next->Typ() != INTVEC_CMD  )
1449        {
1450          Werror("system(\"Mfpertvector\", ideal,intvec) expected");
1451          return TRUE;
1452        }
1453        ideal arg1 = (ideal) h->Data();
1454        intvec* arg2 = (intvec*) h->next->Data();
1455        intvec* result = Mfpertvector(arg1, arg2);
1456
1457        res->rtyp = INTVEC_CMD;
1458        res->data =  result;
1459        return FALSE;
1460      }
1461    else
1462     if(strcmp(sys_cmd, "MivUnit") == 0)
1463      {
1464        int arg1 = (int) ((long)(h->Data()));
1465
1466        intvec* result = (intvec*) MivUnit(arg1);
1467
1468        res->rtyp = INTVEC_CMD;
1469        res->data =  result;
1470        return FALSE;
1471      }
1472     else
1473       if(strcmp(sys_cmd, "MivWeightOrderlp") == 0)
1474       {
1475        if(h==NULL || h->Typ() != INTVEC_CMD)
1476        {
1477          Werror("system(\"MivWeightOrderlp\",intvec) expected");
1478          return TRUE;
1479        }
1480        intvec* arg1 = (intvec*) h->Data();
1481        intvec* result = MivWeightOrderlp(arg1);
1482
1483        res->rtyp = INTVEC_CMD;
1484        res->data =  result;
1485        return FALSE;
1486      }
1487     else
1488    if(strcmp(sys_cmd, "MivWeightOrderdp") == 0)
1489      {
1490        if(h==NULL || h->Typ() != INTVEC_CMD)
1491        {
1492          Werror("system(\"MivWeightOrderdp\",intvec) expected");
1493          return TRUE;
1494        }
1495        intvec* arg1 = (intvec*) h->Data();
1496        //int arg2 = (int) h->next->Data();
1497
1498        intvec* result = MivWeightOrderdp(arg1);
1499
1500        res->rtyp = INTVEC_CMD;
1501        res->data =  result;
1502        return FALSE;
1503      }
1504    else
1505     if(strcmp(sys_cmd, "MivMatrixOrderlp") == 0)
1506      {
1507        if(h==NULL || h->Typ() != INT_CMD)
1508        {
1509          Werror("system(\"MivMatrixOrderlp\",int) expected");
1510          return TRUE;
1511        }
1512        int arg1 = (int) ((long)(h->Data()));
1513
1514        intvec* result = (intvec*) MivMatrixOrderlp(arg1);
1515
1516        res->rtyp = INTVEC_CMD;
1517        res->data =  result;
1518        return FALSE;
1519      }
1520    else
1521    if (strcmp(sys_cmd, "MkInterRedNextWeight") == 0)
1522    {
1523      if (h == NULL || h->Typ() != INTVEC_CMD ||
1524          h->next == NULL || h->next->Typ() != INTVEC_CMD ||
1525          h->next->next == NULL || h->next->next->Typ() != IDEAL_CMD)
1526      {
1527        Werror("system(\"MkInterRedNextWeight\", intvec, intvec, ideal) expected");
1528        return TRUE;
1529      }
1530
1531      if (((intvec*) h->Data())->length() != currRing->N ||
1532          ((intvec*) h->next->Data())->length() != currRing->N)
1533      {
1534        Werror("system(\"MkInterRedNextWeight\" ...) intvecs not of length %d\n",
1535               currRing->N);
1536        return TRUE;
1537      }
1538      intvec* arg1 = (intvec*) h->Data();
1539      intvec* arg2 = (intvec*) h->next->Data();
1540      ideal arg3   =   (ideal) h->next->next->Data();
1541
1542      intvec* result = (intvec*) MkInterRedNextWeight(arg1, arg2, arg3);
1543
1544      res->rtyp = INTVEC_CMD;
1545      res->data =  result;
1546
1547      return FALSE;
1548    }
1549    else
1550#ifdef MPertNextWeight
1551    if (strcmp(sys_cmd, "MPertNextWeight") == 0)
1552    {
1553      if (h == NULL || h->Typ() != INTVEC_CMD ||
1554          h->next == NULL || h->next->Typ() != IDEAL_CMD ||
1555          h->next->next == NULL || h->next->next->Typ() != INT_CMD)
1556      {
1557        Werror("system(\"MPertNextWeight\", intvec, ideal, int) expected");
1558        return TRUE;
1559      }
1560
1561      if (((intvec*) h->Data())->length() != currRing->N)
1562      {
1563        Werror("system(\"MPertNextWeight\" ...) intvecs not of length %d\n",
1564               currRing->N);
1565        return TRUE;
1566      }
1567      intvec* arg1 = (intvec*) h->Data();
1568      ideal arg2 = (ideal) h->next->Data();
1569      int arg3   =   (int) h->next->next->Data();
1570
1571      intvec* result = (intvec*) MPertNextWeight(arg1, arg2, arg3);
1572
1573      res->rtyp = INTVEC_CMD;
1574      res->data =  result;
1575
1576      return FALSE;
1577    }
1578    else
1579#endif //MPertNextWeight
1580#ifdef Mivperttarget
1581  if (strcmp(sys_cmd, "Mivperttarget") == 0)
1582    {
1583      if (h == NULL || h->Typ() != IDEAL_CMD ||
1584          h->next == NULL || h->next->Typ() != INT_CMD )
1585      {
1586        Werror("system(\"Mivperttarget\", ideal, int) expected");
1587        return TRUE;
1588      }
1589
1590      ideal arg1 = (ideal) h->Data();
1591      int arg2 = (int) h->next->Data();
1592
1593      intvec* result = (intvec*) Mivperttarget(arg1, arg2);
1594
1595      res->rtyp = INTVEC_CMD;
1596      res->data =  result;
1597
1598      return FALSE;
1599    }
1600    else
1601#endif //Mivperttarget
1602    if (strcmp(sys_cmd, "Mwalk") == 0)
1603    {
1604      if (h == NULL || h->Typ() != IDEAL_CMD ||
1605          h->next == NULL || h->next->Typ() != INTVEC_CMD ||
1606          h->next->next == NULL || h->next->next->Typ() != INTVEC_CMD)
1607      {
1608        Werror("system(\"Mwalk\", ideal, intvec, intvec) expected");
1609        return TRUE;
1610      }
1611
1612      if (((intvec*) h->next->Data())->length() != currRing->N &&
1613          ((intvec*) h->next->next->Data())->length() != currRing->N )
1614      {
1615        Werror("system(\"Mwalk\" ...) intvecs not of length %d\n",
1616               currRing->N);
1617        return TRUE;
1618      }
1619      ideal arg1 = (ideal) h->Data();
1620      intvec* arg2 = (intvec*) h->next->Data();
1621      intvec* arg3   =  (intvec*) h->next->next->Data();
1622
1623
1624      ideal result = (ideal) Mwalk(arg1, arg2, arg3);
1625
1626      res->rtyp = IDEAL_CMD;
1627      res->data =  result;
1628
1629      return FALSE;
1630    }
1631    else
1632#ifdef MPWALK_ORIG
1633    if (strcmp(sys_cmd, "Mpwalk") == 0)
1634    {
1635      if (h == NULL || h->Typ() != IDEAL_CMD ||
1636          h->next == NULL || h->next->Typ() != INT_CMD ||
1637          h->next->next == NULL || h->next->next->Typ() != INT_CMD ||
1638          h->next->next->next == NULL ||
1639            h->next->next->next->Typ() != INTVEC_CMD ||
1640          h->next->next->next->next == NULL ||
1641            h->next->next->next->next->Typ() != INTVEC_CMD)
1642      {
1643        Werror("system(\"Mpwalk\", ideal, int, int, intvec, intvec) expected");
1644        return TRUE;
1645      }
1646
1647      if (((intvec*) h->next->next->next->Data())->length() != currRing->N &&
1648          ((intvec*) h->next->next->next->next->Data())->length()!=currRing->N)
1649      {
1650        Werror("system(\"Mpwalk\" ...) intvecs not of length %d\n",
1651               currRing->N);
1652        return TRUE;
1653      }
1654      ideal arg1 = (ideal) h->Data();
1655      int arg2 = (int) h->next->Data();
1656      int arg3 = (int) h->next->next->Data();
1657      intvec* arg4 = (intvec*) h->next->next->next->Data();
1658      intvec* arg5   =  (intvec*) h->next->next->next->next->Data();
1659
1660
1661      ideal result = (ideal) Mpwalk(arg1, arg2, arg3, arg4, arg5);
1662
1663      res->rtyp = IDEAL_CMD;
1664      res->data =  result;
1665
1666      return FALSE;
1667    }
1668    else
1669#endif
1670    if (strcmp(sys_cmd, "Mpwalk") == 0)
1671    {
1672      if (h == NULL || h->Typ() != IDEAL_CMD ||
1673          h->next == NULL || h->next->Typ() != INT_CMD ||
1674          h->next->next == NULL || h->next->next->Typ() != INT_CMD ||
1675          h->next->next->next == NULL ||
1676            h->next->next->next->Typ() != INTVEC_CMD ||
1677          h->next->next->next->next == NULL ||
1678            h->next->next->next->next->Typ() != INTVEC_CMD||
1679          h->next->next->next->next->next == NULL ||
1680            h->next->next->next->next->next->Typ() != INT_CMD)
1681      {
1682        Werror("system(\"Mpwalk\", ideal, int, int, intvec, intvec, int) expected");
1683        return TRUE;
1684      }
1685
1686      if (((intvec*) h->next->next->next->Data())->length() != currRing->N &&
1687          ((intvec*) h->next->next->next->next->Data())->length()!=currRing->N)
1688      {
1689        Werror("system(\"Mpwalk\" ...) intvecs not of length %d\n",
1690               currRing->N);
1691        return TRUE;
1692      }
1693      ideal arg1 = (ideal) h->Data();
1694      int arg2 = (int) ((long)(h->next->Data()));
1695      int arg3 = (int) ((long)(h->next->next->Data()));
1696      intvec* arg4 = (intvec*) h->next->next->next->Data();
1697      intvec* arg5   =  (intvec*) h->next->next->next->next->Data();
1698      int arg6   =  (int) ((long)(h->next->next->next->next->next->Data()));
1699
1700
1701      ideal result = (ideal) Mpwalk(arg1, arg2, arg3, arg4, arg5, arg6);
1702
1703      res->rtyp = IDEAL_CMD;
1704      res->data =  result;
1705
1706      return FALSE;
1707    }
1708    else
1709    if (strcmp(sys_cmd, "MAltwalk1") == 0)
1710    {
1711      if (h == NULL || h->Typ() != IDEAL_CMD ||
1712          h->next == NULL || h->next->Typ() != INT_CMD ||
1713          h->next->next == NULL || h->next->next->Typ() != INT_CMD ||
1714          h->next->next->next == NULL ||
1715            h->next->next->next->Typ() != INTVEC_CMD ||
1716          h->next->next->next->next == NULL ||
1717            h->next->next->next->next->Typ() != INTVEC_CMD)
1718      {
1719        Werror("system(\"MAltwalk1\", ideal, int, int, intvec, intvec) expected");
1720        return TRUE;
1721      }
1722
1723      if (((intvec*) h->next->next->next->Data())->length() != currRing->N &&
1724          ((intvec*) h->next->next->next->next->Data())->length()!=currRing->N)
1725      {
1726        Werror("system(\"MAltwalk1\" ...) intvecs not of length %d\n",
1727               currRing->N);
1728        return TRUE;
1729      }
1730      ideal arg1 = (ideal) h->Data();
1731      int arg2 = (int) ((long)(h->next->Data()));
1732      int arg3 = (int) ((long)(h->next->next->Data()));
1733      intvec* arg4 = (intvec*) h->next->next->next->Data();
1734      intvec* arg5   =  (intvec*) h->next->next->next->next->Data();
1735
1736
1737      ideal result = (ideal) MAltwalk1(arg1, arg2, arg3, arg4, arg5);
1738
1739      res->rtyp = IDEAL_CMD;
1740      res->data =  result;
1741
1742      return FALSE;
1743    }
1744#ifdef MFWALK_ALT
1745    else
1746    if (strcmp(sys_cmd, "Mfwalk_alt") == 0)
1747    {
1748      if (h == NULL || h->Typ() != IDEAL_CMD ||
1749          h->next == NULL || h->next->Typ() != INTVEC_CMD ||
1750          h->next->next == NULL || h->next->next->Typ() != INTVEC_CMD ||
1751          h->next->next->next == NULL || h->next->next->next->Typ() !=INT_CMD)
1752      {
1753        Werror("system(\"Mfwalk\", ideal, intvec, intvec,int) expected");
1754        return TRUE;
1755      }
1756
1757      if (((intvec*) h->next->Data())->length() != currRing->N &&
1758          ((intvec*) h->next->next->Data())->length() != currRing->N )
1759      {
1760        Werror("system(\"Mfwalk\" ...) intvecs not of length %d\n",
1761               currRing->N);
1762        return TRUE;
1763      }
1764      ideal arg1 = (ideal) h->Data();
1765      intvec* arg2 = (intvec*) h->next->Data();
1766      intvec* arg3   =  (intvec*) h->next->next->Data();
1767      int arg4 = (int) h->next->next->next->Data();
1768
1769      ideal result = (ideal) Mfwalk_alt(arg1, arg2, arg3, arg4);
1770
1771      res->rtyp = IDEAL_CMD;
1772      res->data =  result;
1773
1774      return FALSE;
1775    }
1776#endif
1777    else
1778    if (strcmp(sys_cmd, "Mfwalk") == 0)
1779    {
1780      if (h == NULL || h->Typ() != IDEAL_CMD ||
1781          h->next == NULL || h->next->Typ() != INTVEC_CMD ||
1782          h->next->next == NULL || h->next->next->Typ() != INTVEC_CMD)
1783      {
1784        Werror("system(\"Mfwalk\", ideal, intvec, intvec) expected");
1785        return TRUE;
1786      }
1787
1788      if (((intvec*) h->next->Data())->length() != currRing->N &&
1789          ((intvec*) h->next->next->Data())->length() != currRing->N )
1790      {
1791        Werror("system(\"Mfwalk\" ...) intvecs not of length %d\n",
1792               currRing->N);
1793        return TRUE;
1794      }
1795      ideal arg1 = (ideal) h->Data();
1796      intvec* arg2 = (intvec*) h->next->Data();
1797      intvec* arg3   =  (intvec*) h->next->next->Data();
1798
1799      ideal result = (ideal) Mfwalk(arg1, arg2, arg3);
1800
1801      res->rtyp = IDEAL_CMD;
1802      res->data =  result;
1803
1804      return FALSE;
1805    }
1806    else
1807
1808#ifdef TRAN_Orig
1809    if (strcmp(sys_cmd, "TranMImprovwalk") == 0)
1810    {
1811      if (h == NULL || h->Typ() != IDEAL_CMD ||
1812          h->next == NULL || h->next->Typ() != INTVEC_CMD ||
1813          h->next->next == NULL || h->next->next->Typ() != INTVEC_CMD)
1814      {
1815        Werror("system(\"TranMImprovwalk\", ideal, intvec, intvec) expected");
1816        return TRUE;
1817      }
1818
1819      if (((intvec*) h->next->Data())->length() != currRing->N &&
1820          ((intvec*) h->next->next->Data())->length() != currRing->N )
1821      {
1822        Werror("system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
1823               currRing->N);
1824        return TRUE;
1825      }
1826      ideal arg1 = (ideal) h->Data();
1827      intvec* arg2 = (intvec*) h->next->Data();
1828      intvec* arg3   =  (intvec*) h->next->next->Data();
1829
1830
1831      ideal result = (ideal) TranMImprovwalk(arg1, arg2, arg3);
1832
1833      res->rtyp = IDEAL_CMD;
1834      res->data =  result;
1835
1836      return FALSE;
1837    }
1838    else
1839#endif
1840    if (strcmp(sys_cmd, "MAltwalk2") == 0)
1841      {
1842      if (h == NULL || h->Typ() != IDEAL_CMD ||
1843          h->next == NULL || h->next->Typ() != INTVEC_CMD ||
1844          h->next->next == NULL || h->next->next->Typ() != INTVEC_CMD)
1845      {
1846        Werror("system(\"MAltwalk2\", ideal, intvec, intvec) expected");
1847        return TRUE;
1848      }
1849
1850      if (((intvec*) h->next->Data())->length() != currRing->N &&
1851          ((intvec*) h->next->next->Data())->length() != currRing->N )
1852      {
1853        Werror("system(\"MAltwalk2\" ...) intvecs not of length %d\n",
1854               currRing->N);
1855        return TRUE;
1856      }
1857      ideal arg1 = (ideal) h->Data();
1858      intvec* arg2 = (intvec*) h->next->Data();
1859      intvec* arg3   =  (intvec*) h->next->next->Data();
1860
1861
1862      ideal result = (ideal) MAltwalk2(arg1, arg2, arg3);
1863
1864      res->rtyp = IDEAL_CMD;
1865      res->data =  result;
1866
1867      return FALSE;
1868    }
1869    else
1870    if (strcmp(sys_cmd, "TranMImprovwalk") == 0)
1871    {
1872      if (h == NULL || h->Typ() != IDEAL_CMD ||
1873          h->next == NULL || h->next->Typ() != INTVEC_CMD ||
1874          h->next->next == NULL || h->next->next->Typ() != INTVEC_CMD||
1875          h->next->next->next == NULL || h->next->next->next->Typ() != INT_CMD)
1876      {
1877        Werror("system(\"TranMImprovwalk\", ideal, intvec, intvec, int) expected");
1878        return TRUE;
1879      }
1880
1881      if (((intvec*) h->next->Data())->length() != currRing->N &&
1882          ((intvec*) h->next->next->Data())->length() != currRing->N )
1883      {
1884        Werror("system(\"TranMImprovwalk\" ...) intvecs not of length %d\n",
1885               currRing->N);
1886        return TRUE;
1887      }
1888      ideal arg1 = (ideal) h->Data();
1889      intvec* arg2 = (intvec*) h->next->Data();
1890      intvec* arg3   =  (intvec*) h->next->next->Data();
1891      int arg4   =  (int) ((long)(h->next->next->next->Data()));
1892
1893      ideal result = (ideal) TranMImprovwalk(arg1, arg2, arg3, arg4);
1894
1895      res->rtyp = IDEAL_CMD;
1896      res->data =  result;
1897
1898      return FALSE;
1899    }
1900    else
1901#endif
1902/*================= Extended system call ========================*/
1903   {
1904     #ifndef MAKE_DISTRIBUTION
1905     return(jjEXTENDED_SYSTEM(res, args));
1906     #else
1907     Werror( "system(\"%s\",...) %s", sys_cmd, feNotImplemented );
1908     #endif
1909   }
1910  } /* typ==string */
1911  return TRUE;
1912}
1913
1914
1915#ifdef HAVE_EXTENDED_SYSTEM
1916// You can put your own system calls here
1917#include "../kernel/fglmcomb.cc"
1918#include "fglm.h"
1919#ifdef HAVE_NEWTON
1920#include <hc_newton.h>
1921#endif
1922#include "mpsr.h"
1923#include "mod_raw.h"
1924#include "ratgring.h"
1925#include "shiftgb.h"
1926
1927static BOOLEAN jjEXTENDED_SYSTEM(leftv res, leftv h)
1928{
1929  if(h->Typ() == STRING_CMD)
1930  {
1931    char *sys_cmd=(char *)(h->Data());
1932    h=h->next;
1933/*==================== test syz strat =================*/
1934    if (strcmp(sys_cmd, "syz") == 0)
1935    {
1936       int posInT_EcartFDegpLength(const TSet set,const int length,LObject &p);
1937       int posInT_FDegpLength(const TSet set,const int length,LObject &p);
1938       int posInT_pLength(const TSet set,const int length,LObject &p);
1939       int posInT0(const TSet set,const int length,LObject &p);
1940       int posInT1(const TSet set,const int length,LObject &p);
1941       int posInT2(const TSet set,const int length,LObject &p);
1942       int posInT11(const TSet set,const int length,LObject &p);
1943       int posInT110(const TSet set,const int length,LObject &p);
1944       int posInT13(const TSet set,const int length,LObject &p);
1945       int posInT15(const TSet set,const int length,LObject &p);
1946       int posInT17(const TSet set,const int length,LObject &p);
1947       int posInT17_c(const TSet set,const int length,LObject &p);
1948       int posInT19(const TSet set,const int length,LObject &p);
1949       if ((h!=NULL) && (h->Typ()==STRING_CMD))
1950       {
1951         const char *s=(const char *)h->Data();
1952         if (strcmp(s,"posInT_EcartFDegpLength")==0)
1953           test_PosInT=posInT_EcartFDegpLength;
1954         else if (strcmp(s,"posInT_FDegpLength")==0)
1955           test_PosInT=posInT_FDegpLength;
1956         else if (strcmp(s,"posInT_pLength")==0)
1957           test_PosInT=posInT_pLength;
1958         else if (strcmp(s,"posInT0")==0)
1959           test_PosInT=posInT0;
1960         else if (strcmp(s,"posInT1")==0)
1961           test_PosInT=posInT1;
1962         else if (strcmp(s,"posInT2")==0)
1963           test_PosInT=posInT2;
1964         else if (strcmp(s,"posInT11")==0)
1965           test_PosInT=posInT11;
1966         else if (strcmp(s,"posInT110")==0)
1967           test_PosInT=posInT110;
1968         else if (strcmp(s,"posInT13")==0)
1969           test_PosInT=posInT13;
1970         else if (strcmp(s,"posInT15")==0)
1971           test_PosInT=posInT15;
1972         else if (strcmp(s,"posInT17")==0)
1973           test_PosInT=posInT17;
1974         else if (strcmp(s,"posInT17_c")==0)
1975           test_PosInT=posInT17_c;
1976         else if (strcmp(s,"posInT19")==0)
1977           test_PosInT=posInT19;
1978         else Print("valid posInT:0,1,2,11,110,13,15,17,17_c,19,_EcartFDegpLength,_FDegpLength,_pLength,_EcartpLength\n");
1979       }
1980       else
1981       {
1982         test_PosInT=NULL;
1983         test_PosInL=NULL;
1984       }
1985       verbose|=Sy_bit(23);
1986       return FALSE;
1987    }
1988    else
1989/*==================== locNF ======================================*/
1990    if(strcmp(sys_cmd,"locNF")==0)
1991    {
1992      if (h != NULL && h->Typ() == VECTOR_CMD)
1993      {
1994        poly f=(poly)h->Data();
1995        h=h->next;
1996        if (h != NULL && h->Typ() == MODUL_CMD)
1997        {
1998          ideal m=(ideal)h->Data();
1999          assumeStdFlag(h);
2000          h=h->next;
2001          if (h != NULL && h->Typ() == INT_CMD)
2002          {
2003            int n=(int)((long)h->Data());
2004            h=h->next;
2005            if (h != NULL && h->Typ() == INTVEC_CMD)
2006            {
2007              intvec *v=(intvec *)h->Data();
2008
2009              /* == now the work starts == */
2010
2011              short * iv=iv2array(v);
2012              poly r=0;
2013              poly hp=ppJetW(f,n,iv);
2014              int s=MATCOLS(m);
2015              int j=0;
2016              matrix T=mpInitI(s,1,0);
2017
2018              while (hp != NULL)
2019              {
2020                if (pDivisibleBy(m->m[j],hp))
2021                  {
2022                    if (MATELEM(T,j+1,1)==0)
2023                    {
2024                      MATELEM(T,j+1,1)=pDivideM(pHead(hp),pHead(m->m[j]));
2025                    }
2026                    else
2027                    {
2028                      pAdd(MATELEM(T,j+1,1),pDivideM(pHead(hp),pHead(m->m[j])));
2029                    }
2030                    hp=ppJetW(ksOldSpolyRed(m->m[j],hp,0),n,iv);
2031                    j=0;
2032                  }
2033                else
2034                {
2035                  if (j==s-1)
2036                  {
2037                    r=pAdd(r,pHead(hp));
2038                    hp=pLmDeleteAndNext(hp); /* hp=pSub(hp,pHead(hp));*/
2039                    j=0;
2040                  }
2041                  else
2042                  {
2043                    j++;
2044                  }
2045                }
2046              }
2047
2048              matrix Temp=mpTransp((matrix) idVec2Ideal(r));
2049              matrix R=mpNew(MATCOLS((matrix) idVec2Ideal(f)),1);
2050              for (int k=1;k<=MATROWS(Temp);k++)
2051              {
2052                MATELEM(R,k,1)=MATELEM(Temp,k,1);
2053              }
2054
2055              lists L=(lists)omAllocBin(slists_bin);
2056              L->Init(2);
2057              L->m[0].rtyp=MATRIX_CMD;   L->m[0].data=(void *)R;
2058              L->m[1].rtyp=MATRIX_CMD;   L->m[1].data=(void *)T;
2059              res->data=L;
2060              res->rtyp=LIST_CMD;
2061              // iv aufraeumen
2062              omFree(iv);
2063            }
2064            else
2065            {
2066              Warn ("4th argument: must be an intvec!");
2067            }
2068          }
2069          else
2070          {
2071            Warn("3rd argument must be an int!!");
2072          }
2073        }
2074        else
2075        {
2076          Warn("2nd argument must be a module!");
2077        }
2078      }
2079      else
2080      {
2081        Warn("1st argument must be a vector!");
2082      }
2083      return FALSE;
2084    }
2085    else
2086/*==================== poly debug ==================================*/
2087#ifdef RDEBUG
2088      if(strcmp(sys_cmd,"p")==0)
2089      {
2090        pDebugPrint((poly)h->Data());
2091        return FALSE;
2092      }
2093      else
2094#endif
2095/*==================== ring debug ==================================*/
2096#ifdef RDEBUG
2097      if(strcmp(sys_cmd,"r")==0)
2098      {
2099        rDebugPrint((ring)h->Data());
2100        return FALSE;
2101      }
2102      else
2103#endif
2104/*==================== C++ wrappers ========================*/
2105#ifdef HAVE_WRAPPERS
2106      if(strcmp(sys_cmd,"c++wrappers")==0)
2107      {
2108        if (h == NULL) testWrappers(FALSE);  // wrapper tests, no detailed printout
2109        else if (h->Typ() == INT_CMD)
2110        {
2111          const int detailedOutput = (const int)(long)h->Data();
2112          testWrappers(detailedOutput == 0 ? FALSE : TRUE);
2113          // wrapper tests, with or without detailed printout
2114        }
2115        return FALSE;
2116      }
2117      else
2118#endif // HAVE_WRAPPERS
2119/*==================== new minor code ========================*/
2120#ifdef HAVE_MINOR
2121      if(strcmp(sys_cmd,"minors")==0)
2122      {
2123        if (h == NULL) minorUsageInfo();  // writes some info to the console
2124                                          // on how to use this experimental code
2125        else if (h->Typ() == INT_CMD)
2126        {
2127           testIntMinors(0);  // effectively no arguments provided:
2128                              // this starts 5 default tests
2129                              // with a random matrix with
2130                              // integer entries;
2131                              // for that, no ring needs to be
2132                              // declared
2133        }
2134        else if ((h->Typ() == MATRIX_CMD) &&
2135                 (h->next->Typ() == INT_CMD) &&
2136                 (h->next->next->Typ() == INT_CMD) &&
2137                 (h->next->next->next->Typ() == INT_CMD) &&
2138                 (h->next->next->next->next->Typ() == INT_CMD) &&
2139                 (h->next->next->next->next->next == NULL))
2140        {
2141          const matrix m           = (const matrix)h->Data();
2142          const int k              = (const int)(long)h->next->Data();
2143          const int strategy       = (const int)(long)h->next->next->Data();
2144          const int cacheEntries   = (const int)(long)h->next->next->next->Data();
2145          const int cacheWeight    = (const int)(long)h->next->next->next->next->Data();
2146          ideal iii = testAllPolyMinorsAsIdeal(m, k, strategy, cacheEntries, cacheWeight);
2147            // starts the computation of all k x k minors in the
2148            // provided matrix m (which is assumed to have polynomial
2149            // entries) using a cache with 200 entries and a maximum total
2150            // number of 10000 cached monomials;
2151            // when calling this method, a ring must be declared before;
2152            // there will be a run without using a cache; afterwards all 5
2153            // caching strategies will be run
2154          res->rtyp = IDEAL_CMD;
2155          res->data = iii;
2156        }
2157        else if ((h->Typ() == MATRIX_CMD) &&
2158                 (h->next->Typ() == INT_CMD) &&
2159                 (h->next->next->Typ() == INT_CMD) &&
2160                 (h->next->next->next->Typ() == INT_CMD) &&
2161                 (h->next->next->next->next->Typ() == INT_CMD) &&
2162                 (h->next->next->next->next->next->Typ() == INT_CMD) &&
2163                 (h->next->next->next->next->next->next->Typ() == INT_CMD) &&
2164                 (h->next->next->next->next->next->next->next->Typ() == INT_CMD))
2165        {
2166          const matrix m           = (const matrix)h->Data();
2167          const int k              = (const int)(long)h->next->Data();
2168          const int strategies     = (const int)(long)h->next->next->Data();
2169          const int cacheEntries   = (const int)(long)h->next->next->next->Data();
2170          const int cacheWeight    = (const int)(long)h->next->next->next->next->Data();
2171          const int dumpMinors     = (const int)(long)h->next->next->next->next->next->Data();
2172          const int dumpResults    = (const int)(long)h->next->next->next->next->next->next->Data();
2173          const int dumpComplete   = (const int)(long)h->next->next->next->next->next->next->next->Data();
2174          const int dumpConsole    = (const int)(long)h->next->next->next->next->next->next->next->next->Data();
2175          testAllPolyMinors(m, k, strategies, cacheEntries, cacheWeight, dumpMinors, dumpResults, dumpComplete, dumpConsole);
2176            // starts the computation of all k x k minors in the
2177            // provided matrix m (which is assumed to have polynomial
2178            // entries) using a cache with a maximum number of
2179            // 'cacheEntries' entries and a maximum weight of 'cacheWeight';
2180            // when calling this method, a ring must be declared before;
2181            // strategy = "310" means that the code is run first without a
2182            // cache ("0") and then afterwards with the caching strategies
2183            // "1" and "3"
2184        }
2185        else if (h->Typ() == POLY_CMD)
2186        { // for quick tests with a single polynomial
2187          const poly p = (const poly)h->Data();
2188          testStuff(p);
2189        }
2190        return FALSE;
2191      }
2192      else
2193      if(strcmp(sys_cmd,"changeRing")==0)
2194      {
2195        if ((h->Typ() == INT_CMD) &&
2196            (h->next->Typ() == INT_CMD))
2197        {
2198          const int fc     = (const int)(long)h->Data();
2199          const int varN   = (const int)(long)h->next->Data();
2200          {
2201            /*
2202            The following code creates and returns a ring with characteristic fc,
2203            order dp and varN variables with the names "x1", "x2", ..., "x4711"
2204            (in the case varN = 4711).
2205            The purpose of this rewriting is to eliminate indexed variables,
2206            as they may cause problems when generating scripts for Magma,
2207            Maple, or Macaulay2.
2208            */
2209            ring newRing = (ring) omAlloc0Bin(sip_sring_bin);
2210            newRing->ch = fc;
2211            newRing->N = varN;
2212            char h[10];
2213            newRing->names = (char **) omAlloc0(varN * sizeof(char_ptr));
2214            for (int i = 1; i <= varN; i++)
2215            {
2216              sprintf(h, "x%d", i);
2217              newRing->names[i - 1] = omStrDup(h);
2218            }
2219            newRing->wvhdl = (int **)omAlloc0(2 * sizeof(int_ptr));
2220            newRing->order = (int *)omAlloc(2* sizeof(int *));
2221            newRing->block0 = (int *)omAlloc0(2 * sizeof(int *));
2222            newRing->block1 = (int *)omAlloc0(2 * sizeof(int *));
2223            newRing->order[0] = ringorder_dp;
2224            newRing->block0[0] = 1;
2225            newRing->block1[0] = varN;
2226            newRing->order[1]  = 0;
2227            newRing->OrdSgn    = 1;
2228            rComplete(newRing);
2229            res->rtyp = RING_CMD;
2230            res->data = (void *)newRing;
2231            return FALSE;
2232          }
2233        } 
2234      }
2235      else
2236#endif // HAVE_MINOR
2237/*==================== generic debug ==================================*/
2238#ifdef PDEBUG
2239      if(strcmp(sys_cmd,"DetailedPrint")==0)
2240      {
2241        if( h == NULL )
2242        {
2243          WarnS("DetailedPrint needs arguments...");
2244          return TRUE;
2245        }
2246       
2247        if( h->Typ() == RING_CMD)
2248        {
2249          const ring r = (const ring)h->Data();
2250          rWrite(r);
2251          PrintLn();
2252#ifdef RDEBUG
2253          rDebugPrint(r);
2254#endif
2255        }
2256        else
2257        if( h->Typ() == POLY_CMD || h->Typ() == VECTOR_CMD)
2258        {
2259          const int nTerms = 3;
2260          const poly p = (const poly)h->Data();
2261          p_DebugPrint(p, currRing, currRing, nTerms);
2262        }
2263        else
2264        if( h->Typ() == IDEAL_CMD || h->Typ() == MODUL_CMD)
2265        {
2266          const ideal id = (const ideal)h->Data();
2267         
2268          h = h->Next();
2269         
2270          int nTerms = 3;
2271
2272          if( h!= NULL && h->Typ() == INT_CMD )
2273          {
2274            int n = (int)(long)(h->Data());
2275            if( n < 0 )
2276            {
2277              Warn("Negative int argument: %d", n);
2278            }
2279            else
2280              nTerms = n;
2281          }
2282         
2283          idShow(id, currRing, currRing, nTerms);
2284        }
2285
2286        return FALSE;
2287      }
2288      else
2289#endif
2290/*==================== mtrack ==================================*/
2291    if(strcmp(sys_cmd,"mtrack")==0)
2292    {
2293#ifdef OM_TRACK
2294      om_Opts.MarkAsStatic = 1;
2295      FILE *fd = NULL;
2296      int max = 5;
2297      while (h != NULL)
2298      {
2299        omMarkAsStaticAddr(h);
2300        if (fd == NULL && h->Typ()==STRING_CMD)
2301        {
2302          fd = fopen((char*) h->Data(), "w");
2303          if (fd == NULL)
2304            Warn("Can not open %s for writing og mtrack. Using stdout"); // %s  ???
2305        }
2306        if (h->Typ() == INT_CMD)
2307        {
2308          max = (int)(long)h->Data();
2309        }
2310        h = h->Next();
2311      }
2312      omPrintUsedTrackAddrs((fd == NULL ? stdout : fd), max);
2313      if (fd != NULL) fclose(fd);
2314      om_Opts.MarkAsStatic = 0;
2315      return FALSE;
2316#else
2317     WerrorS("mtrack not supported without OM_TRACK");
2318     return TRUE;
2319#endif
2320    }
2321/*==================== mtrack_all ==================================*/
2322    if(strcmp(sys_cmd,"mtrack_all")==0)
2323    {
2324#ifdef OM_TRACK
2325      om_Opts.MarkAsStatic = 1;
2326      FILE *fd = NULL;
2327      if ((h!=NULL) &&(h->Typ()==STRING_CMD))
2328      {
2329        fd = fopen((char*) h->Data(), "w");
2330        if (fd == NULL)
2331          Warn("Can not open %s for writing og mtrack. Using stdout");
2332        omMarkAsStaticAddr(h);
2333      }
2334      // OB: TBC print to fd
2335      omPrintUsedAddrs((fd == NULL ? stdout : fd), 5);
2336      if (fd != NULL) fclose(fd);
2337      om_Opts.MarkAsStatic = 0;
2338      return FALSE;
2339#else
2340     WerrorS("mtrack not supported without OM_TRACK");
2341     return TRUE;
2342#endif
2343    }
2344    else
2345/*==================== backtrace ==================================*/
2346#ifndef OM_NDEBUG
2347    if(strcmp(sys_cmd,"backtrace")==0)
2348    {
2349      omPrintCurrentBackTrace(stdout);
2350      return FALSE;
2351    }
2352    else
2353#endif
2354/*==================== naIdeal ==================================*/
2355    if(strcmp(sys_cmd,"naIdeal")==0)
2356    {
2357      if ((h!=NULL) &&(h->Typ()==IDEAL_CMD))
2358      {
2359        naSetIdeal((ideal)h->Data());
2360        return FALSE;
2361      }
2362      else
2363         WerrorS("ideal expected");
2364    }
2365    else
2366/*==================== isSqrFree =============================*/
2367#ifdef HAVE_FACTORY
2368    if(strcmp(sys_cmd,"isSqrFree")==0)
2369    {
2370      if ((h!=NULL) &&(h->Typ()==POLY_CMD))
2371      {
2372        res->rtyp=INT_CMD;
2373        res->data=(void *)(long) singclap_isSqrFree((poly)h->Data());
2374        return FALSE;
2375      }
2376      else
2377        WerrorS("poly expected");
2378    }
2379    else
2380#endif
2381/*==================== pDivStat =============================*/
2382#if defined(PDEBUG) || defined(PDIV_DEBUG)
2383    if(strcmp(sys_cmd,"pDivStat")==0)
2384    {
2385      extern void pPrintDivisbleByStat();
2386      pPrintDivisbleByStat();
2387      return FALSE;
2388    }
2389    else
2390#endif
2391/*==================== alarm ==================================*/
2392#ifdef unix
2393    if(strcmp(sys_cmd,"alarm")==0)
2394    {
2395      if ((h!=NULL) &&(h->Typ()==INT_CMD))
2396      {
2397        // standard variant -> SIGALARM (standard: abort)
2398        //alarm((unsigned)h->next->Data());
2399        // process time (user +system): SIGVTALARM
2400        struct itimerval t,o;
2401        memset(&t,0,sizeof(t));
2402        t.it_value.tv_sec     =(unsigned)((unsigned long)h->Data());
2403        setitimer(ITIMER_VIRTUAL,&t,&o);
2404        return FALSE;
2405      }
2406      else
2407        WerrorS("int expected");
2408    }
2409    else
2410#endif
2411/*==================== red =============================*/
2412#if 0
2413    if(strcmp(sys_cmd,"red")==0)
2414    {
2415      if ((h!=NULL) &&(h->Typ()==IDEAL_CMD))
2416      {
2417        res->rtyp=IDEAL_CMD;
2418        res->data=(void *)kStdred((ideal)h->Data(),NULL,testHomog,NULL);
2419        setFlag(res,FLAG_STD);
2420        return FALSE;
2421      }
2422      else
2423        WerrorS("ideal expected");
2424    }
2425    else
2426#endif
2427#ifdef HAVE_FACTORY
2428/*==================== fastcomb =============================*/
2429    if(strcmp(sys_cmd,"fastcomb")==0)
2430    {
2431      if ((h!=NULL) &&(h->Typ()==IDEAL_CMD))
2432      {
2433        int i=0;
2434        if (h->next!=NULL)
2435        {
2436          if (h->next->Typ()!=POLY_CMD)
2437          {
2438            Warn("Wrong types for poly= comb(ideal,poly)");
2439          }
2440        }
2441        res->rtyp=POLY_CMD;
2442        res->data=(void *) fglmLinearCombination(
2443                           (ideal)h->Data(),(poly)h->next->Data());
2444        return FALSE;
2445      }
2446      else
2447        WerrorS("ideal expected");
2448    }
2449    else
2450/*==================== comb =============================*/
2451    if(strcmp(sys_cmd,"comb")==0)
2452    {
2453      if ((h!=NULL) &&(h->Typ()==IDEAL_CMD))
2454      {
2455        int i=0;
2456        if (h->next!=NULL)
2457        {
2458          if (h->next->Typ()!=POLY_CMD)
2459          {
2460              Warn("Wrong types for poly= comb(ideal,poly)");
2461          }
2462        }
2463        res->rtyp=POLY_CMD;
2464        res->data=(void *)fglmNewLinearCombination(
2465                            (ideal)h->Data(),(poly)h->next->Data());
2466        return FALSE;
2467      }
2468      else
2469        WerrorS("ideal expected");
2470    }
2471    else
2472#endif
2473/*==================== listall ===================================*/
2474    if(strcmp(sys_cmd,"listall")==0)
2475    {
2476      int showproc=0;
2477      if ((h!=NULL) && (h->Typ()==INT_CMD)) showproc=(int)((long)h->Data());
2478      listall(showproc);
2479      return FALSE;
2480    }
2481    else
2482/*==================== proclist =================================*/
2483    if(strcmp(sys_cmd,"proclist")==0)
2484    {
2485      piShowProcList();
2486      return FALSE;
2487    }
2488    else
2489/* ==================== newton ================================*/
2490#ifdef HAVE_NEWTON
2491    if(strcmp(sys_cmd,"newton")==0)
2492    {
2493      if ((h->Typ()!=POLY_CMD)
2494      || (h->next->Typ()!=INT_CMD)
2495      || (h->next->next->Typ()!=INT_CMD))
2496      {
2497        WerrorS("system(\"newton\",<poly>,<int>,<int>) expected");
2498        return TRUE;
2499      }
2500      poly  p=(poly)(h->Data());
2501      int l=pLength(p);
2502      short *points=(short *)omAlloc(currRing->N*l*sizeof(short));
2503      int i,j,k;
2504      k=0;
2505      poly pp=p;
2506      for (i=0;pp!=NULL;i++)
2507      {
2508        for(j=1;j<=currRing->N;j++)
2509        {
2510          points[k]=pGetExp(pp,j);
2511          k++;
2512        }
2513        pIter(pp);
2514      }
2515      hc_ERG r=hc_KOENIG(currRing->N,      // dimension
2516                l,      // number of points
2517                (short*) points,   // points: x_1, y_1,z_1, x_2,y_2,z2,...
2518                currRing->OrdSgn==-1,
2519                (int) (h->next->Data()),      // 1: Milnor, 0: Newton
2520                (int) (h->next->next->Data()) // debug
2521               );
2522      //----<>---Output-----------------------
2523
2524
2525//  PrintS("Bin jetzt in extra.cc bei der Auswertung.\n"); // **********
2526
2527
2528      lists L=(lists)omAllocBin(slists_bin);
2529      L->Init(6);
2530      L->m[0].rtyp=STRING_CMD;               // newtonnumber;
2531      L->m[0].data=(void *)omStrDup(r.nZahl);
2532      L->m[1].rtyp=INT_CMD;
2533      L->m[1].data=(void *)r.achse;          // flag for unoccupied axes
2534      L->m[2].rtyp=INT_CMD;
2535      L->m[2].data=(void *)r.deg;            // #degenerations
2536      if ( r.deg != 0)              // only if degenerations exist
2537      {
2538        L->m[3].rtyp=INT_CMD;
2539        L->m[3].data=(void *)r.anz_punkte;     // #points
2540        //---<>--number of points------
2541        int anz = r.anz_punkte;    // number of points
2542        int dim = (currRing->N);     // dimension
2543        intvec* v = new intvec( anz*dim );
2544        for (i=0; i<anz*dim; i++)    // copy points
2545          (*v)[i] = r.pu[i];
2546        L->m[4].rtyp=INTVEC_CMD;
2547        L->m[4].data=(void *)v;
2548        //---<>--degenerations---------
2549        int deg = r.deg;    // number of points
2550        intvec* w = new intvec( r.speicher );  // necessary memeory
2551        i=0;               // start copying
2552        do
2553        {
2554          (*w)[i] = r.deg_tab[i];
2555          i++;
2556        }
2557        while (r.deg_tab[i-1] != -2);   // mark for end of list
2558        L->m[5].rtyp=INTVEC_CMD;
2559        L->m[5].data=(void *)w;
2560      }
2561      else
2562      {
2563        L->m[3].rtyp=INT_CMD; L->m[3].data=(char *)0;
2564        L->m[4].rtyp=DEF_CMD;
2565        L->m[5].rtyp=DEF_CMD;
2566      }
2567
2568      res->data=(void *)L;
2569      res->rtyp=LIST_CMD;
2570      // free all pointer in r:
2571      delete[] r.nZahl;
2572      delete[] r.pu;
2573      delete[] r.deg_tab;      // Ist das ein Problem??
2574
2575      omFreeSize((ADDRESS)points,currRing->N*l*sizeof(short));
2576      return FALSE;
2577    }
2578    else
2579#endif
2580/*==================== sdb_flags =================*/
2581#ifdef HAVE_SDB
2582    if (strcmp(sys_cmd, "sdb_flags") == 0)
2583    {
2584      if ((h!=NULL) && (h->Typ()==INT_CMD))
2585      {
2586        sdb_flags=(int)((long)h->Data());
2587      }
2588      else
2589      {
2590        WerrorS("system(\"sdb_flags\",`int`) expected");
2591        return TRUE;
2592      }
2593      return FALSE;
2594    }
2595    else
2596#endif
2597/*==================== sdb_edit =================*/
2598#ifdef HAVE_SDB
2599    if (strcmp(sys_cmd, "sdb_edit") == 0)
2600    {
2601      if ((h!=NULL) && (h->Typ()==PROC_CMD))
2602      {
2603        procinfov p=(procinfov)h->Data();
2604        sdb_edit(p);
2605      }
2606      else
2607      {
2608        WerrorS("system(\"sdb_edit\",`proc`) expected");
2609        return TRUE;
2610      }
2611      return FALSE;
2612    }
2613    else
2614#endif
2615/*==================== GF =================*/
2616#if 0 // for testing only
2617    if (strcmp(sys_cmd, "GF") == 0)
2618    {
2619      if ((h!=NULL) && (h->Typ()==POLY_CMD))
2620      {
2621        int c=rChar(currRing);
2622        setCharacteristic( c,nfMinPoly[0], currRing->parameter[0][0] );
2623        CanonicalForm F( convSingGFFactoryGF( (poly)h->Data() ) );
2624        res->rtyp=POLY_CMD;
2625        res->data=convFactoryGFSingGF( F );
2626        return FALSE;
2627      }
2628      else { Werror("wrong typ"); return TRUE;}
2629    }
2630    else
2631#endif
2632/*==================== stdX =================*/
2633    if (strcmp(sys_cmd, "std") == 0)
2634    {
2635      ideal i1;
2636      int i2;
2637      if ((h!=NULL) && (h->Typ()==MODUL_CMD))
2638      {
2639        i1=(ideal)h->CopyD();
2640        h=h->next;
2641      }
2642      else return TRUE;
2643      if ((h!=NULL) && (h->Typ()==INT_CMD))
2644      {
2645        i2=(int)((long)h->Data());
2646      }
2647      else return TRUE;
2648      res->rtyp=MODUL_CMD;
2649      res->data=idXXX(i1,i2);
2650      return FALSE;
2651    }
2652    else
2653/*==================== SVD =================*/
2654#ifdef HAVE_SVD
2655     if (strcmp(sys_cmd, "svd") == 0)
2656     {
2657          extern lists testsvd(matrix M);
2658            res->rtyp=LIST_CMD;
2659          res->data=(char*)(testsvd((matrix)h->Data()));
2660          return FALSE;
2661     }
2662     else
2663#endif
2664/*==================== DLL =================*/
2665#ifdef ix86_Win
2666#ifdef HAVE_DL
2667/* testing the DLL functionality under Win32 */
2668      if (strcmp(sys_cmd, "DLL") == 0)
2669      {
2670        typedef void  (*Void_Func)();
2671        typedef int  (*Int_Func)(int);
2672        void *hh=dynl_open("WinDllTest.dll");
2673        if ((h!=NULL) && (h->Typ()==INT_CMD))
2674        {
2675          int (*f)(int);
2676          if (hh!=NULL)
2677          {
2678            int (*f)(int);
2679            f=(Int_Func)dynl_sym(hh,"PlusDll");
2680            int i=10;
2681            if (f!=NULL) printf("%d\n",f(i));
2682            else PrintS("cannot find PlusDll\n");
2683          }
2684        }
2685        else
2686        {
2687          void (*f)();
2688          f= (Void_Func)dynl_sym(hh,"TestDll");
2689          if (f!=NULL) f();
2690          else PrintS("cannot find TestDll\n");
2691        }
2692        return FALSE;
2693      }
2694      else
2695#endif
2696#endif
2697/*==================== eigenvalues ==================================*/
2698#ifdef HAVE_EIGENVAL
2699    if(strcmp(sys_cmd,"eigenvals")==0)
2700    {
2701      return evEigenvals(res,h);
2702    }
2703    else
2704#endif
2705/*==================== Gauss-Manin system ==================================*/
2706#ifdef HAVE_GMS
2707    if(strcmp(sys_cmd,"gmsnf")==0)
2708    {
2709      return gmsNF(res,h);
2710    }
2711    else
2712#endif
2713/*==================== facstd_debug ==================================*/
2714#if !defined(NDEBUG)
2715    if(strcmp(sys_cmd,"facstd")==0)
2716    {
2717      extern int strat_nr;
2718      extern int strat_fac_debug;
2719      strat_fac_debug=(int)(long)h->Data();
2720      strat_nr=0;
2721      return FALSE;
2722    }
2723    else
2724#endif
2725#ifdef HAVE_RING2TOM
2726/*==================== ring-GB ==================================*/
2727    if (strcmp(sys_cmd, "findZeroPoly")==0)
2728    {
2729      ring r = currRing;
2730      poly f = (poly) h->Data();
2731      res->rtyp=POLY_CMD;
2732      res->data=(poly) kFindZeroPoly(f, r, r);
2733      return(FALSE);
2734    }
2735    else
2736/*==================== Creating zero polynomials =================*/
2737#ifdef HAVE_VANIDEAL
2738    if (strcmp(sys_cmd, "createG0")==0)
2739    {
2740      /* long exp[50];
2741      int N = 0;
2742      while (h != NULL)
2743      {
2744        N += 1;
2745        exp[N] = (long) h->Data();
2746        // if (exp[i] % 2 != 0) exp[i] -= 1;
2747        h = h->next;
2748      }
2749      for (int k = 1; N + k <= currRing->N; k++) exp[k] = 0;
2750
2751      poly t_p;
2752      res->rtyp=POLY_CMD;
2753      res->data= (poly) kCreateZeroPoly(exp, -1, &t_p, currRing, currRing);
2754      return(FALSE); */
2755
2756      res->rtyp = IDEAL_CMD;
2757      res->data = (ideal) createG0();
2758      return(FALSE);
2759    }
2760    else
2761#endif
2762/*==================== redNF_ring =================*/
2763    if (strcmp(sys_cmd, "redNF_ring")==0)
2764    {
2765      ring r = currRing;
2766      poly f = (poly) h->Data();
2767      h = h->next;
2768      ideal G = (ideal) h->Data();
2769      res->rtyp=POLY_CMD;
2770      res->data=(poly) ringRedNF(f, G, r);
2771      return(FALSE);
2772    }
2773    else
2774#endif
2775/*==================== minor =================*/
2776    if (strcmp(sys_cmd, "minor")==0)
2777    {
2778      ring r = currRing;
2779      matrix a = (matrix) h->Data();
2780      h = h->next;
2781      int ar = (int)(long) h->Data();
2782      h = h->next;
2783      int which = (int)(long) h->Data();
2784      h = h->next;
2785      ideal R = NULL;
2786      if (h != NULL)
2787      {
2788        R = (ideal) h->Data();
2789      }
2790      res->data=(poly) idMinor(a, ar, (unsigned long) which, R);
2791      if (res->data == (poly) 1)
2792      {
2793        res->rtyp=INT_CMD;
2794        res->data = 0;
2795      }
2796      else
2797      {
2798        res->rtyp=POLY_CMD;
2799      }
2800      return(FALSE);
2801    }
2802    else
2803/*==================== F5 Implementation =================*/
2804#ifdef HAVE_F5
2805    if (strcmp(sys_cmd, "f5")==0)
2806    {
2807      if (h->Typ()!=IDEAL_CMD)
2808      {
2809        WerrorS("ideal expected");
2810        return TRUE;
2811      }
2812
2813      ring r = currRing;
2814      ideal G = (ideal) h->Data();
2815      h = h->next;
2816      int opt;
2817      if(h != NULL) {
2818        opt = (int) (long) h->Data();
2819      }
2820      else {
2821        opt = 2;
2822      }
2823      res->rtyp=IDEAL_CMD;
2824      res->data=(ideal) F5main(G,r,opt);
2825      return FALSE;
2826    }
2827    else
2828#endif
2829/*==================== F5C Implementation =================*/
2830#ifdef HAVE_F5C
2831    if (strcmp(sys_cmd, "f5c")==0)
2832    {
2833      if (h->Typ()!=IDEAL_CMD)
2834      {
2835        WerrorS("ideal expected");
2836        return TRUE;
2837      }
2838
2839      ring r = currRing;
2840      ideal G = (ideal) h->Data();
2841      res->rtyp=IDEAL_CMD;
2842      res->data=(ideal) f5cMain(G,r);
2843      return FALSE;
2844    }
2845    else
2846#endif
2847/*==================== Testing groebner basis =================*/
2848#ifdef HAVE_RINGS
2849    if (strcmp(sys_cmd, "NF_ring")==0)
2850    {
2851      ring r = currRing;
2852      poly f = (poly) h->Data();
2853      h = h->next;
2854      ideal G = (ideal) h->Data();
2855      res->rtyp=POLY_CMD;
2856      res->data=(poly) ringNF(f, G, r);
2857      return(FALSE);
2858    }
2859    else
2860    if (strcmp(sys_cmd, "spoly")==0)
2861    {
2862      poly f = pCopy((poly) h->Data());
2863      h = h->next;
2864      poly g = pCopy((poly) h->Data());
2865
2866      res->rtyp=POLY_CMD;
2867      res->data=(poly) plain_spoly(f,g);
2868      return(FALSE);
2869    }
2870    else
2871    if (strcmp(sys_cmd, "testGB")==0)
2872    {
2873      ideal I = (ideal) h->Data();
2874      h = h->next;
2875      ideal GI = (ideal) h->Data();
2876      res->rtyp = INT_CMD;
2877      res->data = (void *) testGB(I, GI);
2878      return(FALSE);
2879    }
2880    else
2881#endif
2882/*==================== sca?AltVar ==================================*/
2883#ifdef HAVE_PLURAL
2884    if ( (strcmp(sys_cmd, "AltVarStart") == 0) || (strcmp(sys_cmd, "AltVarEnd") == 0) )
2885    {
2886      ring r = currRing;
2887
2888      if((h!=NULL) && (h->Typ()==RING_CMD)) r = (ring)h->Data(); else
2889      {
2890        WerrorS("`system(\"AltVarStart/End\"[,<ring>])` expected");
2891        return TRUE;
2892      }
2893
2894      res->rtyp=INT_CMD;
2895
2896      if (rIsSCA(r))
2897      {
2898        if(strcmp(sys_cmd, "AltVarStart") == 0)
2899          res->data = (void*)scaFirstAltVar(r);
2900        else
2901          res->data = (void*)scaLastAltVar(r);
2902        return FALSE;
2903      }
2904
2905      WerrorS("`system(\"AltVarStart/End\",<ring>) requires a SCA ring");
2906      return TRUE;
2907    }
2908    else
2909#endif
2910/*==================== RatNF, noncomm rational coeffs =================*/
2911#ifdef HAVE_PLURAL
2912#ifdef HAVE_RATGRING
2913    if (strcmp(sys_cmd, "intratNF") == 0)
2914    {
2915      poly p;
2916      poly *q;
2917      ideal I;
2918      int is, k, id;
2919      if ((h!=NULL) && (h->Typ()==POLY_CMD))
2920      {
2921        p=(poly)h->CopyD();
2922        h=h->next;
2923        //        Print("poly is done\n");
2924      }
2925      else return TRUE;
2926      if ((h!=NULL) && (h->Typ()==IDEAL_CMD))
2927      {
2928        I=(ideal)h->CopyD();
2929        q = I->m;
2930        h=h->next;
2931        //        Print("ideal is done\n");
2932      }
2933      else return TRUE;
2934      if ((h!=NULL) && (h->Typ()==INT_CMD))
2935      {
2936        is=(int)((long)(h->Data()));
2937        //        res->rtyp=INT_CMD;
2938        //        Print("int is done\n");
2939        //        res->rtyp=IDEAL_CMD;
2940        if (rIsPluralRing(currRing))
2941        {
2942          id = IDELEMS(I);
2943                 int *pl=(int*)omAlloc0(IDELEMS(I)*sizeof(int));
2944          for(k=0; k < id; k++)
2945          {
2946            pl[k] = pLength(I->m[k]);
2947          }
2948          Print("starting redRat\n");
2949          //res->data = (char *)
2950          redRat(&p, q, pl, (int)IDELEMS(I),is,currRing);
2951          res->data=p;
2952          res->rtyp=POLY_CMD;
2953          //        res->data = ncGCD(p,q,currRing);
2954        }
2955        else
2956        {
2957          res->rtyp=POLY_CMD;
2958          res->data=p;
2959        }
2960      }
2961      else return TRUE;
2962      return FALSE;
2963    }
2964    else
2965/*==================== RatNF, noncomm rational coeffs =================*/
2966    if (strcmp(sys_cmd, "ratNF") == 0)
2967    {
2968      poly p,q;
2969      int is, htype;
2970      if ((h!=NULL) && ( (h->Typ()==POLY_CMD) || (h->Typ()==VECTOR_CMD) ) )
2971      {
2972        p=(poly)h->CopyD();
2973        h=h->next;
2974        htype = h->Typ();
2975      }
2976      else return TRUE;
2977      if ((h!=NULL) && ( (h->Typ()==POLY_CMD) || (h->Typ()==VECTOR_CMD) ) )
2978      {
2979        q=(poly)h->CopyD();
2980        h=h->next;
2981      }
2982      else return TRUE;
2983      if ((h!=NULL) && (h->Typ()==INT_CMD))
2984      {
2985        is=(int)((long)(h->Data()));
2986        res->rtyp=htype;
2987        //        res->rtyp=IDEAL_CMD;
2988        if (rIsPluralRing(currRing))
2989        {
2990          res->data = nc_rat_ReduceSpolyNew(q,p,is, currRing);
2991          //        res->data = ncGCD(p,q,currRing);
2992        }
2993        else res->data=p;
2994      }
2995      else return TRUE;
2996      return FALSE;
2997    }
2998    else
2999/*==================== RatSpoly, noncomm rational coeffs =================*/
3000    if (strcmp(sys_cmd, "ratSpoly") == 0)
3001    {
3002      poly p,q;
3003      int is;
3004      if ((h!=NULL) && (h->Typ()==POLY_CMD))
3005      {
3006        p=(poly)h->CopyD();
3007        h=h->next;
3008      }
3009      else return TRUE;
3010      if ((h!=NULL) && (h->Typ()==POLY_CMD))
3011      {
3012        q=(poly)h->CopyD();
3013        h=h->next;
3014      }
3015      else return TRUE;
3016      if ((h!=NULL) && (h->Typ()==INT_CMD))
3017      {
3018        is=(int)((long)(h->Data()));
3019        res->rtyp=POLY_CMD;
3020        //        res->rtyp=IDEAL_CMD;
3021        if (rIsPluralRing(currRing))
3022        {
3023          res->data = nc_rat_CreateSpoly(p,q,is,currRing);
3024          //        res->data = ncGCD(p,q,currRing);
3025        }
3026        else res->data=p;
3027      }
3028      else return TRUE;
3029      return FALSE;
3030    }
3031    else
3032#endif // HAVE_RATGRING
3033/*==================== Rat def =================*/
3034    if (strcmp(sys_cmd, "ratVar") == 0)
3035    {
3036      int start,end;
3037      int is;
3038      if ((h!=NULL) && (h->Typ()==POLY_CMD))
3039      {
3040        start=pIsPurePower((poly)h->Data());
3041        h=h->next;
3042      }
3043      else return TRUE;
3044      if ((h!=NULL) && (h->Typ()==POLY_CMD))
3045      {
3046        end=pIsPurePower((poly)h->Data());
3047        h=h->next;
3048      }
3049      else return TRUE;
3050      currRing->real_var_start=start;
3051      currRing->real_var_end=end;
3052      return (start==0)||(end==0)||(start>end);
3053    }
3054    else
3055/*==================== shift-test for freeGB  =================*/
3056#ifdef HAVE_SHIFTBBA
3057    if (strcmp(sys_cmd, "stest") == 0)
3058    {
3059      poly p;
3060      int sh,uptodeg, lVblock;
3061      if ((h!=NULL) && (h->Typ()==POLY_CMD))
3062      {
3063        p=(poly)h->CopyD();
3064        h=h->next;
3065      }
3066      else return TRUE;
3067      if ((h!=NULL) && (h->Typ()==INT_CMD))
3068      {
3069        sh=(int)((long)(h->Data()));
3070        h=h->next;
3071      }
3072      else return TRUE;
3073
3074      if ((h!=NULL) && (h->Typ()==INT_CMD))
3075      {
3076        uptodeg=(int)((long)(h->Data()));
3077        h=h->next;
3078      }
3079      else return TRUE;
3080      if ((h!=NULL) && (h->Typ()==INT_CMD))
3081      {
3082        lVblock=(int)((long)(h->Data()));
3083        res->data = pLPshift(p,sh,uptodeg,lVblock);
3084        res->rtyp = POLY_CMD;
3085      }
3086      else return TRUE;
3087      return FALSE;
3088    }
3089    else
3090#endif
3091/*==================== block-test for freeGB  =================*/
3092#ifdef HAVE_SHIFTBBA
3093    if (strcmp(sys_cmd, "btest") == 0)
3094    {
3095      poly p;
3096      int lV;
3097      if ((h!=NULL) && (h->Typ()==POLY_CMD))
3098      {
3099        p=(poly)h->CopyD();
3100        h=h->next;
3101      }
3102      else return TRUE;
3103      if ((h!=NULL) && (h->Typ()==INT_CMD))
3104      {
3105        lV=(int)((long)(h->Data()));
3106        res->rtyp = INT_CMD;
3107        res->data = (void*)pLastVblock(p, lV);
3108      }
3109      else return TRUE;
3110      return FALSE;
3111    }
3112    else
3113/*==================== shrink-test for freeGB  =================*/
3114    if (strcmp(sys_cmd, "shrinktest") == 0)
3115    {
3116      poly p;
3117      int lV;
3118      if ((h!=NULL) && (h->Typ()==POLY_CMD))
3119      {
3120        p=(poly)h->CopyD();
3121        h=h->next;
3122      }
3123      else return TRUE;
3124      if ((h!=NULL) && (h->Typ()==INT_CMD))
3125      {
3126        lV=(int)((long)(h->Data()));
3127        res->rtyp = POLY_CMD;
3128        //        res->data = p_mShrink(p, lV, currRing);
3129        //        kStrategy strat=new skStrategy;
3130        //        strat->tailRing = currRing;
3131        res->data = p_Shrink(p, lV, currRing);
3132      }
3133      else return TRUE;
3134      return FALSE;
3135    }
3136    else
3137#endif
3138#endif
3139/*==================== t-rep-GB ==================================*/
3140    if (strcmp(sys_cmd, "unifastmult")==0)
3141    {
3142      ring r = currRing;
3143      poly f = (poly)h->Data();
3144      h=h->next;
3145      poly g=(poly)h->Data();
3146      res->rtyp=POLY_CMD;
3147      res->data=unifastmult(f,g,currRing);
3148      return(FALSE);
3149    }
3150    else
3151    if (strcmp(sys_cmd, "multifastmult")==0)
3152    {
3153      ring r = currRing;
3154      poly f = (poly)h->Data();
3155      h=h->next;
3156      poly g=(poly)h->Data();
3157      res->rtyp=POLY_CMD;
3158      res->data=multifastmult(f,g,currRing);
3159      return(FALSE);
3160    }
3161    else
3162    if (strcmp(sys_cmd, "mults")==0)
3163    {
3164      res->rtyp=INT_CMD ;
3165      res->data=(void*)(long) Mults();
3166      return(FALSE);
3167    }
3168    else
3169    if (strcmp(sys_cmd, "fastpower")==0)
3170    {
3171      ring r = currRing;
3172      poly f = (poly)h->Data();
3173      h=h->next;
3174      int n=(int)((long)h->Data());
3175      res->rtyp=POLY_CMD ;
3176      res->data=(void*) pFastPower(f,n,r);
3177      return(FALSE);
3178    }
3179    else
3180    if (strcmp(sys_cmd, "normalpower")==0)
3181    {
3182      ring r = currRing;
3183      poly f = (poly)h->Data();
3184      h=h->next;
3185      int n=(int)((long)h->Data());
3186      res->rtyp=POLY_CMD ;
3187      res->data=(void*) pPower(pCopy(f),n);
3188      return(FALSE);
3189    }
3190    else
3191    if (strcmp(sys_cmd, "MCpower")==0)
3192    {
3193      ring r = currRing;
3194      poly f = (poly)h->Data();
3195      h=h->next;
3196      int n=(int)((long)h->Data());
3197      res->rtyp=POLY_CMD ;
3198      res->data=(void*) pFastPowerMC(f,n,r);
3199      return(FALSE);
3200    }
3201    else
3202    if (strcmp(sys_cmd, "bit_subst")==0)
3203    {
3204      ring r = currRing;
3205      poly outer = (poly)h->Data();
3206      h=h->next;
3207      poly inner=(poly)h->Data();
3208      res->rtyp=POLY_CMD ;
3209      res->data=(void*) uni_subst_bits(outer, inner,r);
3210      return(FALSE);
3211    }
3212    else
3213/*==================== bifac =================*/
3214#ifdef HAVE_BIFAC
3215    if (strcmp(sys_cmd, "bifac")==0)
3216    {
3217      if (h->Typ()!=POLY_CMD)
3218      {
3219        WerrorS("`system(\"bifac\",<poly>) expected");
3220        return TRUE;
3221      }
3222      if (!rField_is_Q())
3223      {
3224        WerrorS("coeff field must be Q");
3225        return TRUE;
3226      }
3227      BIFAC B;
3228      CFFList C;
3229      int sw_rat=isOn(SW_RATIONAL);
3230      On(SW_RATIONAL);
3231      CanonicalForm F( convSingPClapP((poly)(h->Data())));
3232      B.bifac(F, 1);
3233      CFFList L=B.getFactors();
3234      // construct the ring ==============================================
3235      int i;
3236      int lev=ExtensionLevel();
3237      char **names=(char**)omAlloc0(lev*sizeof(char_ptr));
3238      for(i=1;i<=lev; i++)
3239      {
3240        StringSetS("");
3241        names[i-1]=omStrDup(StringAppend("a(%d)",i));
3242      }
3243      ring alg_ring=rDefault(0,lev,names);
3244      ring new_ring=rCopy0(currRing); // all variable names, ordering etc.
3245      new_ring->P=lev;
3246      new_ring->parameter=names;
3247      new_ring->algring=alg_ring;
3248      new_ring->ch=1;
3249      rComplete(new_ring,TRUE);
3250      // set the mipo ===============================================
3251      ring save_currRing=currRing; idhdl save_currRingHdl=currRingHdl;
3252      rChangeCurrRing(alg_ring);
3253      ideal mipo_id=idInit(lev,1);
3254      for (i=lev; i>0;i--)
3255      {
3256        CanonicalForm Mipo=getMipo(Variable(-i),Variable(i));
3257        mipo_id->m[i-1]=convClapPSingP(Mipo);
3258      }
3259      idShow(mipo_id);
3260      alg_ring->qideal=mipo_id;
3261      rChangeCurrRing(new_ring);
3262      for (i=lev-1; i>=0;i--)
3263      {
3264        poly p=pOne();
3265        lnumber n=(lnumber)pGetCoeff(p);
3266        // no need to delete nac 1
3267        n->z=(napoly)mipo_id->m[i];
3268        mipo_id->m[i]=p;
3269      }
3270      new_ring->minideal=id_Copy(alg_ring->qideal,new_ring);
3271      // convert factors =============================================
3272      ideal fac_id=idInit(L.length(),1);
3273      CFFListIterator J=L;
3274      i=0;
3275      intvec *v = new intvec( L.length() );
3276      for ( ; J.hasItem(); J++,i++ )
3277      {
3278        fac_id->m[i]=convClapAPSingAP( J.getItem().factor() );
3279        (*v)[i]=J.getItem().exp();
3280      }
3281      idhdl hh=enterid("factors",0,LIST_CMD,&(currRing->idroot),FALSE);
3282      lists LL=(lists)omAllocBin( slists_bin);
3283      LL->Init(2);
3284      LL->m[0].rtyp=IDEAL_CMD;
3285      LL->m[0].data=(char *)fac_id;
3286      LL->m[1].rtyp=INTVEC_CMD;
3287      LL->m[1].data=(char *)v;
3288      IDDATA(hh)=(char *)LL;
3289
3290      rChangeCurrRing(save_currRing);
3291      currRingHdl=save_currRingHdl;
3292      if (!sw_rat) Off(SW_RATIONAL);
3293
3294      res->data=new_ring;
3295      res->rtyp=RING_CMD;
3296      return FALSE;
3297    }
3298    else
3299#endif
3300/*==================== gcd-varianten =================*/
3301    if (strcmp(sys_cmd, "gcd") == 0)
3302    {
3303      if (h==NULL)
3304      {
3305        Print("NTL_0:%d (use NTL for gcd of polynomials in char 0)\n",isOn(SW_USE_NTL_GCD_0));
3306        Print("NTL_p:%d (use NTL for gcd of polynomials in char p)\n",isOn(SW_USE_NTL_GCD_P));
3307        Print("EZGCD:%d (use EZGCD for gcd of polynomials in char 0)\n",isOn(SW_USE_EZGCD));
3308        Print("EZGCD_P:%d (use EZGCD_P for gcd of polynomials in char p)\n",isOn(SW_USE_EZGCD_P));
3309        Print("CRGCD:%d (use chinese Remainder for gcd of polynomials in char 0)\n",isOn(SW_USE_CHINREM_GCD));
3310        Print("SPARSEMOD:%d (use SPARSEMOD for gcd of polynomials in char 0)\n",isOn(SW_USE_SPARSEMOD));
3311        Print("QGCD:%d (use QGCD for gcd of polynomials in alg. ext.)\n",isOn(SW_USE_QGCD));
3312        Print("FGCD:%d (use fieldGCD for gcd of polynomials in Z/p)\n",isOn(SW_USE_fieldGCD));
3313        Print("homog:%d (use homog. test for factorization of polynomials)\n",singular_homog_flag);
3314        return FALSE;
3315      }
3316      else
3317      if ((h!=NULL) && (h->Typ()==STRING_CMD)
3318      && (h->next!=NULL) && (h->next->Typ()==INT_CMD))
3319      {
3320        int d=(int)(long)h->next->Data();
3321        char *s=(char *)h->Data();
3322        if (strcmp(s,"NTL_0")==0) { if (d) On(SW_USE_NTL_GCD_0); else Off(SW_USE_NTL_GCD_0); } else
3323        if (strcmp(s,"NTL_p")==0) { if (d) On(SW_USE_NTL_GCD_P); else Off(SW_USE_NTL_GCD_P); } else
3324        if (strcmp(s,"EZGCD")==0) { if (d) On(SW_USE_EZGCD); else Off(SW_USE_EZGCD); } else
3325        if (strcmp(s,"EZGCD_P")==0) { if (d) On(SW_USE_EZGCD_P); else Off(SW_USE_EZGCD_P); } else
3326        if (strcmp(s,"CRGCD")==0) { if (d) On(SW_USE_CHINREM_GCD); else Off(SW_USE_CHINREM_GCD); } else
3327        if (strcmp(s,"SPARSEMOD")==0) { if (d) On(SW_USE_SPARSEMOD); else Off(SW_USE_SPARSEMOD); } else
3328        if (strcmp(s,"QGCD")==0) { if (d) On(SW_USE_QGCD); else Off(SW_USE_QGCD); } else
3329        if (strcmp(s,"FGCD")==0) { if (d) On(SW_USE_fieldGCD); else Off(SW_USE_fieldGCD); } else
3330        if (strcmp(s,"homog")==0) { if (d) singular_homog_flag=1; else singular_homog_flag=0; } else
3331        return TRUE;
3332        return FALSE;
3333      }
3334      else return TRUE;
3335    }
3336    else
3337#if 0
3338/*==================== gcd-test =================*/
3339    if (strcmp(sys_cmd, "GCD") == 0)
3340    {
3341      if ((h!=NULL) && (h->Typ()==POLY_CMD)
3342      && (h->next!=NULL) && (h->next->Typ()==POLY_CMD))
3343      {
3344        poly f=(poly)h->Data();
3345        poly g=(poly)h->next->Data();
3346        res->rtyp=POLY_CMD;
3347        res->data=(char*)id_GCD(f,g,currRing);
3348        return FALSE;
3349      }
3350      else return TRUE;
3351    }
3352    else
3353#endif
3354/*==================== subring =================*/
3355    if (strcmp(sys_cmd, "subring") == 0)
3356    {
3357      if (h!=NULL)
3358      {
3359        extern ring rSubring(ring r,leftv v); /* ipshell.cc*/
3360        res->data=(char *)rSubring(currRing,h);
3361        res->rtyp=RING_CMD;
3362        return res->data==NULL;
3363      }
3364      else return TRUE;
3365    }
3366    else
3367#ifdef ix86_Win
3368/*==================== Python Singular =================*/
3369    if (strcmp(sys_cmd, "python") == 0)
3370    {
3371      const char* c;
3372      if ((h!=NULL) && (h->Typ()==STRING_CMD))
3373      {
3374        c=(const char*)h->Data();
3375        if (!PyInitialized) {
3376          PyInitialized = 1;
3377//          Py_Initialize();
3378//          initPySingular();
3379        }
3380//      PyRun_SimpleString(c);
3381        return FALSE;
3382      }
3383      else return TRUE;
3384    }
3385    else
3386/*==================== Python Singular =================
3387    if (strcmp(sys_cmd, "ipython") == 0)
3388    {
3389      const char* c;
3390      {
3391        if (!PyInitialized) {
3392          PyInitialized = 1;
3393          Py_Initialize();
3394          initPySingular();
3395        }
3396  PyRun_SimpleString(
3397"try:                                                                                       \n\
3398    __IPYTHON__                                                                             \n\
3399except NameError:                                                                           \n\
3400    argv = ['']                                                                             \n\
3401    banner = exit_msg = ''                                                                  \n\
3402else:                                                                                       \n\
3403    # Command-line options for IPython (a list like sys.argv)                               \n\
3404    argv = ['-pi1','In <\\#>:','-pi2','   .\\D.:','-po','Out<\\#>:']                        \n\
3405    banner = '*** Nested interpreter ***'                                                   \n\
3406    exit_msg = '*** Back in main IPython ***'                                               \n\
3407                          \n\
3408# First import the embeddable shell class                                                   \n\
3409from IPython.Shell import IPShellEmbed                                                      \n\
3410# Now create the IPython shell instance. Put ipshell() anywhere in your code                \n\
3411# where you want it to open.                                                                \n\
3412ipshell = IPShellEmbed(argv,banner=banner,exit_msg=exit_msg)                                \n\
3413ipshell()");
3414        return FALSE;
3415      }
3416    }
3417    else
3418              */
3419
3420#endif
3421
3422// TODO: What about a dynamic module instead? Only Linux?
3423#ifdef HAVE_SINGULAR_PLUS_PLUS
3424  if (strcmp(sys_cmd,"Singular++")==0)
3425  {
3426//    using namespace SINGULAR_NS;
3427    extern BOOLEAN Main(leftv res, leftv h); // FALSE = Ok, TRUE = Error!
3428    return Main(res, h);
3429  }
3430  else
3431#endif // HAVE_SINGULAR_PLUS_PLUS
3432
3433    if (strcmp(sys_cmd,"FrankTest")==0)
3434  {
3435    PrintS("Hell Or Word!");
3436    return FALSE;
3437  };
3438
3439#ifdef HAVE_GFAN
3440/*======== GFAN ==============*/
3441/*
3442WILL HAVE TO CHANGE RETURN TYPE TO LIST_CMD
3443*/
3444if (strcmp(sys_cmd,"gfan")==0)
3445{
3446        if ((h==NULL) || (h!=NULL && h->Typ()!=IDEAL_CMD))
3447        {
3448                Werror("system(\"gfan\"...) Ideal expected");
3449                return TRUE; //Ooooops
3450        }
3451ideal I=((ideal)h->Data());
3452res->rtyp=IDEAL_CMD;
3453res->data=(ideal) gfan(I);
3454//res->rtyp=LIST_CMD;
3455//res->data= ???
3456
3457return FALSE; //Everything went fine
3458}
3459else
3460#endif
3461/*==================== Error =================*/
3462      Werror( "(extended) system(\"%s\",...) %s", sys_cmd, feNotImplemented );
3463  }
3464  return TRUE;
3465}
3466
3467#endif // HAVE_EXTENDED_SYSTEM
3468
3469
Note: See TracBrowser for help on using the repository browser.