Changeset c6474a in git for kernel


Ignore:
Timestamp:
Jul 18, 2011, 6:17:35 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
7d0225e5a511b7f22d8c67004515cac681735586
Parents:
76fead820d6b7ae29bbdfa38fdb5cf7cc1b8169d
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-07-18 18:17:35+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:39:56+01:00
Message:
fixed febase.h for febase.cc
Location:
kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/febase.h

    r76fead rc6474a  
    1 // Dummy
     1#ifndef FEBASE_H
     2#define FEBASE_H
     3/****************************************
     4 * *  Computer Algebra System SINGULAR     *
     5 * ****************************************/
     6/* $Id: febase.h 14137 2011-04-11 16:39:34Z hannes $ */
     7/*
     8 * * ABSTRACT: basic i/o
     9 * */
     10
     11#include <reporter/reporter.h>
    212#include <resources/feFopen.h>
    313#include <resources/feResource.h>
     14#include <kernel/structs.h>
    415
     16enum   feBufferTypes
     17{
     18  BT_none  = 0,  // entry level
     19  BT_break = 1,  // while, for
     20  BT_proc,       // proc
     21  BT_example,    // example
     22  BT_file,       // <"file"
     23  BT_execute,    // execute
     24  BT_if,         // if
     25  BT_else        // else
     26};
     27
     28enum   feBufferInputs
     29{
     30  BI_stdin = 1,
     31  BI_buffer,
     32  BI_file
     33};
     34enum noeof_t
     35{
     36  noeof_brace = 1,
     37  noeof_asstring,
     38  noeof_block,
     39  noeof_bracket,
     40  noeof_comment,
     41  noeof_procname,
     42  noeof_string
     43};  /* for scanner.l */
     44
     45extern int myynest;
     46extern int yylineno;
     47extern char     my_yylinebuf[80];
     48
     49#ifdef __cplusplus
     50
     51/* the C++-part: */
     52
     53typedef enum { LANG_NONE, LANG_TOP, LANG_SINGULAR, LANG_C, LANG_MAX} language_defs;
     54// LANG_TOP     : Toplevel package only
     55// LANG_SINGULAR:
     56// LANG_C       :
     57//
     58
     59class proc_singular
     60{
     61public:
     62  long   proc_start;       // position where proc is starting
     63  long   def_end;          // position where proc header is ending
     64  long   help_start;       // position where help is starting
     65  long   help_end;         // position where help is starting
     66  long   body_start;       // position where proc-body is starting
     67  long   body_end;         // position where proc-body is ending
     68  long   example_start;    // position where example is starting
     69  long   proc_end;         // position where proc is ending
     70  int    proc_lineno;
     71  int    body_lineno;
     72  int    example_lineno;
     73  char   *body;
     74  long help_chksum;
     75};
     76
     77struct proc_object
     78{
     79//public:
     80  BOOLEAN (*function)(leftv res, leftv v);
     81};
     82union uprocinfodata
     83{
     84public:
     85  proc_singular  s;        // data of Singular-procedure
     86  struct proc_object    o; // pointer to binary-function
     87};
     88
     89typedef union uprocinfodata procinfodata;
     90
     91class procinfo;
     92typedef procinfo *         procinfov;
     93
     94class procinfo
     95{
     96public:
     97  char          *libname;
     98  char          *procname;
     99  package       pack;
     100  language_defs language;
     101  short         ref;
     102  char          is_static;        // if set, proc not accessible for user
     103  char          trace_flag;
     104  procinfodata  data;
     105};
     106
     107class Voice
     108{
     109  public:
     110    Voice  * next;
     111    Voice  * prev;
     112    char   * filename;    // file name or proc name
     113    procinfo * pi;        // proc info
     114    void   * oldb;        // internal scanner buffer
     115    // for files only:
     116    FILE * files;         // file handle
     117    // for buffers only:
     118    char * buffer;        // buffer pointer
     119    long   fptr;          // current position in buffer
     120
     121    int    start_lineno;  // lineno, to restore in recursion
     122    int    curr_lineno;   // current lineno
     123    feBufferInputs   sw;  // BI_stdin: read from STDIN
     124                          // BI_buffer: buffer
     125                          // BI_file: files
     126    char   ifsw;          // if-switch:
     127            /*1 ifsw==0: no if statement, else is invalid
     128            *       ==1: if (0) processed, execute else
     129            *       ==2: if (1) processed, else allowed but not executed
     130            */
     131    feBufferTypes   typ;  // buffer type: see BT_..
     132
     133  Voice() { memset(this,0,sizeof(*this));}
     134  feBufferTypes Typ();
     135  void Next();
     136} ;
     137
     138extern Voice  *currentVoice;
     139
     140Voice * feInitStdin(Voice *pp);
     141
     142/* feread.cc: */
     143
     144/* the interface for reading: */
     145extern  char * (*fe_fgets_stdin)(const char *pr,char *s, int size);
     146
     147#ifdef HAVE_DYN_RL
     148char * fe_fgets_stdin_drl(const char *pr,char *s, int size);
     149#endif
     150
     151extern "C" void fe_reset_input_mode();
     152
     153extern "C" {
     154#ifndef HAVE_ATEXIT
     155void fe_reset_fe (int i, void *v);
     156#else
     157void fe_reset_fe (void);
     158#endif
     159}
     160
     161/* possible implementations: */
     162extern "C"
     163{
     164  /* readline, linked in: */
     165  char * fe_fgets_stdin_rl(const char *pr,char *s, int size);
     166
     167  /* emulated readline: */
     168  char * fe_fgets_stdin_emu(const char *pr,char *s, int size);
     169
     170  /* fgets: */
     171  char * fe_fgets(const char *pr,char *s, int size);
     172
     173  /* dummy (for batch mode): */
     174  char * fe_fgets_dummy(const char *pr,char *s, int size);
     175
     176}
     177#endif
     178const  char * VoiceName();
     179void    VoiceBackTrack();
     180BOOLEAN contBuffer(feBufferTypes typ);
     181const char *  eati(const char *s, int *i);
     182BOOLEAN exitBuffer(feBufferTypes typ);
     183BOOLEAN exitVoice();
     184void    monitor(void *F, int mode); /* FILE*, int */
     185BOOLEAN newFile(char* fname, FILE *f=NULL);
     186void    newBuffer(char* s, feBufferTypes t, procinfo *pname = NULL, int start_lineno = 0);
     187void *  myynewbuffer();
     188void    myyoldbuffer(void * oldb);
     189
     190#endif
    5191 
  • kernel/structs.h

    r76fead rc6474a  
    99*/
    1010
    11 /* for memset: */
    12 #include <string.h>
    1311/* for omBin */
    1412#include <omalloc/omalloc.h>
     
    4745#ifdef __cplusplus
    4846class sleftv;
    49 class slists;
    50 class sattr;
     47class procinfo;
    5148class skStrategy;
    5249class ssyStrategy;
    53 class procinfo;
    5450class CPolynomialSummator;
    5551class CGlobalMultiplier;
     
    6056typedef struct sip_package ip_package;
    6157typedef ip_package *       package;
    62 
    6358
    6459typedef struct  n_Procs_s  n_Procs_s;
     
    7671
    7772#ifdef __cplusplus
    78 typedef ip_link *          si_link;
     73//typedef ip_link *          si_link;
    7974typedef sleftv *           leftv;
    80 typedef slists *           lists;
    81 typedef sattr *            attr;
     75//typedef slists *           lists;
     76//typedef sattr *            attr;
    8277typedef skStrategy *       kStrategy;
    8378typedef ssyStrategy *      syStrategy;
     
    124119
    125120extern omBin char_ptr_bin;
    126 extern omBin sleftv_bin;
    127121
    128122#endif
Note: See TracChangeset for help on using the changeset viewer.