Changeset 8f769bb in git


Ignore:
Timestamp:
Sep 22, 1999, 12:19:05 PM (24 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
Children:
fcc8828a7bb095ce2cfa6cabeb554095b3e4aefe
Parents:
2907f59317cf17c238dd583d6ac1c10ba279ba40
Message:
* hannes: dynamic readline


git-svn-id: file:///usr/local/Singular/svn/trunk@3638 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • Singular/febase.h

    r2907f5 r8f769bb  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: febase.h,v 1.38 1999-09-21 14:44:58 obachman Exp $ */
     6/* $Id: febase.h,v 1.39 1999-09-22 10:19:04 Singular Exp $ */
    77/*
    88* ABSTRACT: basic i/o
     
    244244/* the interface for reading: */
    245245extern  char * (*fe_fgets_stdin)(char *pr,char *s, int size);
     246void fe_reset_input_mode();
    246247
    247248/* possible implementations: */
  • Singular/fegetopt.c

    r2907f5 r8f769bb  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: fegetopt.c,v 1.1 1999-09-20 18:03:47 obachman Exp $ */
     4/* $Id: fegetopt.c,v 1.2 1999-09-22 10:19:04 Singular Exp $ */
    55
    66/* Getopt for GNU.
     
    8484   they can distinguish the relative order of options and other arguments.  */
    8585
    86 #include "getopt.h"
     86#include "fegetopt.h"
    8787
    8888/* For communication from `getopt' to the caller.
  • Singular/feread.cc

    r2907f5 r8f769bb  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: feread.cc,v 1.23 1999-09-20 18:03:48 obachman Exp $ */
     4/* $Id: feread.cc,v 1.24 1999-09-22 10:19:04 Singular Exp $ */
    55/*
    66* ABSTRACT: input from ttys, simulating fgets
     
    6161  return ((char *)NULL);
    6262}
    63 
    64 
    65 #endif
     63#endif
     64
    6665/* ===================================================================*/
    6766/* =                      static readline                           = */
     
    126125}
    127126
    128 void fe_reset_input_mode (void)
    129 {
    130   char *p = getenv("SINGULARHIST");
    131   if (p != NULL)
    132   {
    133     if(history_total_bytes()!=0)
    134       write_history (p);
    135   }
    136 }
    137 
    138127char * fe_fgets_stdin_rl(char *pr,char *s, int size)
    139128{
     
    188177}
    189178#endif
    190 
    191179
    192180/* ===================================================================*/
     
    263251}
    264252
    265 
    266253/* Attempt to complete on the contents of TEXT.  START and END show the
    267254*   region of TEXT that contains the word to complete.  We can use the
     
    287274}
    288275
    289 void fe_reset_input_mode (void)
    290 {
    291   char *p = getenv("SINGULARHIST");
    292   if (p != NULL)
    293   {
    294     if((*fe_history_total_bytes)()!=0)
    295       (*fe_write_history) (p);
    296   }
    297 }
    298 
    299276char * fe_fgets_stdin_drl(char *pr,char *s, int size)
    300277{
     
    429406  return fgets(s,size,stdin);
    430407}
     408
    431409#endif
    432410
     
    439417  return NULL;
    440418}
     419
     420/* ===================================================================*/
     421/* =          fe_reset_input_mode (all possibilities)               = */
     422/* ===================================================================*/
     423void fe_reset_input_mode ()
     424{
     425#if defined(HAVE_DYN_RL)
     426  char *p = getenv("SINGULARHIST");
     427  if (p != NULL)
     428  {
     429    if((*fe_history_total_bytes)()!=0)
     430      (*fe_write_history) (p);
     431  }
     432#endif
     433#if defined(HAVE_READLINE) && !defined(HAVE_FEREAD) && !defined(HAVE_DYN_RL)
     434  char *p = getenv("SINGULARHIST");
     435  if (p != NULL)
     436  {
     437    if(history_total_bytes()!=0)
     438      write_history (p);
     439  }
     440#endif
     441}
     442
  • Singular/misc.cc

    r2907f5 r8f769bb  
    9999  }
    100100  #endif
     101  fe_reset_input_mode();
    101102  if (i<=0)
    102103  {
     
    111112          printf("\n$Bye.\n");
    112113      }
    113     #ifndef macintosh
    114       #ifdef HAVE_FEREAD
    115         #ifdef HAVE_ATEXIT
    116           //fe_reset_input_mode();
    117         #else
    118           //fe_reset_input_mode(0,NULL);
    119         #endif
    120       #else
    121         #ifdef HAVE_READLINE
    122           //fe_reset_input_mode();
    123         #endif
    124       #endif
    125     #endif
    126114    #ifdef sun
    127115      #ifndef __svr4__
     
    535523#endif
    536524#if defined(HAVE_DYN_RL)
    537               StringAppendS("d-readline,"
     525              StringAppendS("d-readline,");
    538526#else
    539527  #if defined(HAVE_READLINE) && !defined(FEREAD)
     
    569557#endif
    570558#ifdef HAVE_ASSUME
    571              StringAppendS("ASSUME,"); 
     559             StringAppendS("ASSUME,");
    572560#endif
    573561#ifdef MDEBUG
  • Singular/mod2.h.in

    r2907f5 r8f769bb  
    55 *          DO NOT EDIT!
    66 *
    7  *  Version: $Id: mod2.h.in,v 1.66 1999-08-25 16:02:48 Singular Exp $
     7 *  Version: $Id: mod2.h.in,v 1.67 1999-09-22 10:19:05 Singular Exp $
    88 *******************************************************************/
    99#ifndef MOD2_H
     
    146146 ******************************************************************/
    147147/* define to use the dynamic linking of readline in non-distributions builds */
    148 /* #undef USE_DYN_RL */
     148/* #undef USE_STATIC_RL */
    149149
    150150/* Default value for timer resolution in ticks per second */
     
    204204/* dynamic readline or readline ? */
    205205#ifdef HAVE_DL
    206   #if defined(MAKE_DISTRIBUTION) || defined(USE_DYN_RL)
     206  #if !defined(USE_STATIC_RL)
    207207    #define HAVE_DYN_RL
    208208  #endif
Note: See TracChangeset for help on using the changeset viewer.