Changeset 78a9c9 in git


Ignore:
Timestamp:
Jan 10, 2022, 6:06:25 PM (17 months ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
Children:
676e2a091749a42bee06cf6f1c818c7058262096
Parents:
5c29ad95d24d1484c07c51e546825480eccc41b0
Message:
storing/using history in .singularhist by default
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • Singular/dyn_modules/machinelearning/machinelearning.cc

    r5c29ad r78a9c9  
    66#include "Singular/ipid.h"
    77#include "Singular/mod_lib.h"
     8#include "kernel/oswrapper/feread.h"
    89
    910#ifdef HAVE_PYTHON
     
    1617        int lengths[5];
    1718        char *filename = getenv("SINGULARHIST");
    18         if (filename==NULL) filename=(char*)"~/.history";
     19        if (filename==NULL) filename=SINGULARHIST_FILE;
    1920        int i;
    2021        lists L = (lists)omAllocBin(slists_bin);
     
    4041        #ifdef HAVE_OMALLOC
    4142        ml_make_prediction(filename, buffer, lengths, _omStrDup);
    42         #else /*xalloc*/
     43        #else /*xalloc*/
    4344        ml_make_prediction(filename, buffer, lengths, omStrDup);
    44         #endif
     45        #endif
    4546
    4647        L->Init(5);
     
    6667{
    6768        char *filename = getenv("SINGULARHIST");
    68         if (filename==NULL)
    69         {
    70           WarnS("SINGULARHIST is not set - no history available, using ~/.history");
    71         }
     69        if (filename==NULL)
     70        {
     71          WarnS("SINGULARHIST is not set - no history available, using ~/.singularhist");
     72        }
    7273        // this is the initialization routine of the module
    7374        // adding the routine predictHelp:
  • Singular/misc_ip.cc

    r5c29ad r78a9c9  
    11191119    }
    11201120#endif   // HAVE_SIMPLEIPC
    1121     fe_reset_input_mode();
    11221121    monitor(NULL,0);
    11231122#ifdef PAGE_TEST
  • doc/NEWS.texi

    r5c29ad r78a9c9  
    2525@c @itemize
    2626@c @end itemize
    27 @c 
     27@c
    2828@c New libraries:
    29 @c 
     29@c
    3030@c @itemize
    3131@c @end itemize
     
    4141Changes in the kernel/build system:
    4242@itemize
     43@item input history is stored by default in @code{.singularhist} (@nref{SINGULARHSIT}).
    4344@item ABI change: all number routines (@code{n_...}) have only @code{coeffs} as last argument,
    4445     functions with @code{ring} as last argument are removed
     
    129130@itemize
    130131@item chern.lib:  new version (@nref{chern_lib})
    131 @item grobcov.lib: new version (@nref{grobcov_lib}), 
    132       new functions @nref{ConsLevels}, @nref{Levels}, @nref{Grob1Levels}, 
     132@item grobcov.lib: new version (@nref{grobcov_lib}),
     133      new functions @nref{ConsLevels}, @nref{Levels}, @nref{Grob1Levels},
    133134      @nref{DifConsLCSets}
    134135@end itemize
  • kernel/oswrapper/feread.cc

    r5c29ad r78a9c9  
    367367    using_history();
    368368    char *p = getenv("SINGULARHIST");
    369     if (p != NULL)
     369    if (p==NULL) p=SINGULARHIST_FILE;
     370    if (strlen(p) != 0)
    370371    {
    371372      read_history (p);
  • kernel/oswrapper/feread.h

    r5c29ad r78a9c9  
    99
    1010EXTERN_VAR char    prompt_char; /*1 either '>' or '.'*/
     11
     12#define SINGULARHIST_FILE ".singularhist"
    1113
    1214#ifdef __cplusplus
  • kernel/oswrapper/fereadl.c

    r5c29ad r78a9c9  
    1212#include "kernel/mod2.h"
    1313#include "omalloc/omalloc.h"
     14#include "kernel/oswrapper/feread.h"
    1415
    1516#ifdef HAVE_FEREAD
     
    829830#if defined(HAVE_DYN_RL)
    830831  char *p = getenv("SINGULARHIST");
    831   if ((p != NULL) && (fe_history_total_bytes != NULL))
     832  if (p==NULL) p=SINGULARHIST_FILE;
     833  if ((strlen(p) != 0) && (fe_history_total_bytes != NULL))
    832834  {
    833835    if((*fe_history_total_bytes)()!=0)
    834836      (*fe_write_history) (p);
    835837  }
    836 #endif
    837 #if defined(HAVE_READLINE) && !defined(HAVE_FEREAD) && !defined(HAVE_DYN_RL)
     838#elif defined(HAVE_READLINE) && !defined(HAVE_FEREAD) && !defined(HAVE_DYN_RL)
    838839  char *p = getenv("SINGULARHIST");
    839   if (p != NULL)
     840  if (p==NULL) p=SINGULARHIST_FILE;
     841  if (strlen(p) != 0)
    840842  {
    841843    if(history_total_bytes()!=0)
    842844      write_history (p);
    843845  }
    844 #endif
    845 #if defined(HAVE_FEREAD)
     846#elif defined(HAVE_FEREAD)
    846847  #ifndef HAVE_ATEXIT
    847848  fe_reset_fe(NULL,NULL);
Note: See TracChangeset for help on using the changeset viewer.