Changeset 8f769bb in git for Singular/feread.cc


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


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

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.