Changeset 97454d in git


Ignore:
Timestamp:
Apr 7, 1998, 8:35:28 PM (25 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '00e2e9c41af3fde1273eb3633f4c0c7c3db2579d')
Children:
37e22dccbc1d4231d5dd6c765a95b61021b1266c
Parents:
80ad5e767969bf7b39d2bf33f65964782429ecb1
Message:
1998-04-07  Olaf Bachmann  <obachman@mathematik.uni-kl.de>

	* mpsr_Put.cc (mpsr_PutDump): dump does not dump LIB string
any more

	* extra.cc (jjSYSTEM): added System("whoami") to return full
	executable pathname of running Singular


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

Legend:

Unmodified
Added
Removed
  • Singular/ChangeLog

    r80ad5e r97454d  
     11998-04-07  Olaf Bachmann  <obachman@mathematik.uni-kl.de>
     2
     3        * mpsr_Put.cc (mpsr_PutDump): dump does not dump LIB string any more
     4
     5        * extra.cc (jjSYSTEM): added System("whoami") to return full
     6        executable pathname of running Singular
     7
    18Tue Apr  7 10:27:50 MET DST 1998 hannes
    29        * fixed scanner bug: ignoring { and } in <block> (scanner.l)
  • Singular/extra.cc

    r80ad5e r97454d  
    22*  Computer Algebra System SINGULAR      *
    33*****************************************/
    4 /* $Id: extra.cc,v 1.33 1998-04-06 17:59:27 obachman Exp $ */
     4/* $Id: extra.cc,v 1.34 1998-04-07 18:35:21 obachman Exp $ */
    55/*
    66* ABSTRACT: general interface to internals of Singular ("system" command)
     
    245245    #endif
    246246    #endif
    247 #if 0
    248247/*==================== whoami ==================================*/
    249248    if (strcmp((char*)(h->data), "whoami") == 0)
    250249    {
    251       res->rtype=STRING_CMD;
    252     }
    253 #endif
     250      res->rtyp=STRING_CMD;
     251      res->data=(void*)feGetExpandedExecutable();
     252      if (res->data != NULL)
     253        res->data = mstrdup((char*) res->data);
     254      else
     255        res->data = mstrdup("");
     256      return FALSE;
     257    }
    254258/*==================== HC ==================================*/
    255259    if (strcmp((char*)(h->data),"HC")==0)
  • Singular/febase.cc

    r80ad5e r97454d  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: febase.cc,v 1.27 1998-04-06 17:59:27 obachman Exp $ */
     4/* $Id: febase.cc,v 1.28 1998-04-07 18:35:22 obachman Exp $ */
    55/*
    66* ABSTRACT: i/o system
     
    103103#endif  /* macintosh */
    104104
    105 extern "C" char* find_executable_path(const char* argv0);
     105extern "C" char* find_executable(const char* argv0);
    106106
    107107#define SINGULAR_RELATIVE_DATA_DIR "LIB"
    108108
    109109static char* SearchPath = NULL;
     110static char* ExpandedExecutable = NULL;
     111
     112char* feGetExpandedExecutable(const char* argv0)
     113{
     114  if (ExpandedExecutable == NULL)
     115  {
     116    if (argv0 != NULL)
     117      ExpandedExecutable = find_executable(argv0);
     118  }
     119  return ExpandedExecutable;
     120}
     121
     122static char* feRemovePathnameHead(const char* ef)
     123{
     124  if (ef != NULL)
     125  {
     126    char *temp, *temp2, *temp3;
     127
     128    temp2 = mstrdup(ef);
     129    temp3 = temp2;
     130    temp = NULL;
     131    while (*temp3 != '\0')
     132    {
     133      if (*temp3 == DIR_SEP) temp = temp3;
     134      temp3++;
     135    }
     136    if (temp != NULL)
     137    {
     138      *temp = '\0';
     139    }
     140    return temp2;
     141  }
     142  else
     143    return NULL;
     144}
     145
    110146
    111147// Return the file search path for singular w.r.t. the following priorities:
     
    125161 
    126162    if (argv0 != NULL)
    127       sibbling = find_executable_path(argv0);
     163      sibbling = feRemovePathnameHead(feGetExpandedExecutable(argv0));
    128164 
    129165    if (env != NULL)
  • Singular/febase.h

    r80ad5e r97454d  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: febase.h,v 1.10 1998-04-06 17:59:28 obachman Exp $ */
     6/* $Id: febase.h,v 1.11 1998-04-07 18:35:23 obachman Exp $ */
    77/*
    88* ABSTRACT
     
    6666
    6767char*   feGetSearchPath(const char* argv0 = NULL);
     68char*   feGetExpandedExecutable(const char* argv0 = NULL);
    6869FILE *  feFopen(char *path, char *mode, char *where=NULL, int useWerror=FALSE);
    6970void    fePause(void);
  • Singular/find_exec.c

    r80ad5e r97454d  
    171171}
    172172
    173 char* find_executable_path(const char *name)
    174 {
    175   char *ef = find_executable(name);
    176   char *temp, *temp2;
    177  
    178   temp2 = ef;
    179   if (ef != NULL)
    180   {
    181     temp = NULL;
    182     while (*ef != '\0')
    183     {
    184       if (*ef == '/') temp = ef;
    185       ef++;
    186     }
    187     if (temp != NULL)
    188     {
    189       *temp = '\0';
    190     }
    191   }
    192   return temp2;
    193 }
    194 
    195  
    196173#else
    197174
     
    201178}
    202179
    203 char* find_executable_path(const char *name)
    204 {
    205   return NULL;
    206 }
    207 
    208180#endif /* #if ! defined(MSDOS) && ! defined(macintosh) && defined(HAVE_SYS_TYPES_H) && defined(HAVE_PWD_H)&&defined(HAVE_SYS_PARAM_H) */
    209181
  • Singular/misc.cc

    r80ad5e r97454d  
    675675  StringSet("\t");
    676676#ifdef HAVE_FACTORY
    677               StringAppend("factory (%s),", factoryVersion);
     677              StringAppend("factory(%s),", factoryVersion);
    678678#endif
    679679#ifdef HAVE_LIBFAC_P
  • Singular/mpsr_Get.cc

    r80ad5e r97454d  
    33****************************************/
    44
    5 /* $Id: mpsr_Get.cc,v 1.14 1997-12-03 16:58:54 obachman Exp $ */
     5/* $Id: mpsr_Get.cc,v 1.15 1998-04-07 18:35:25 obachman Exp $ */
    66/***************************************************************
    77 *
     
    171171{
    172172  number n = (number) Alloc(sizeof(rnumber));
    173 
     173#ifdef LDEBUG
     174    n->debug=123456;
     175#endif
    174176  mlv->r = mpsr_rDefault(0);
    175177  n->s = 3;
     
    846848  mpsr_Status_t status = mpsr_Success;
    847849
    848   MP_SkipMsg(link);
    849   while ((! MP_TestEofMsg(link)) && (status == mpsr_Success))
     850  status = (MP_InitMsg(link) == MP_Success ? mpsr_Success : mpsr_MP_Failure);
     851  while ((status == mpsr_Success) && (! MP_TestEofMsg(link)))
    850852  {
    851853    status=mpsr_GetLeftv(link, &mlv, 0);
  • Singular/mpsr_GetPoly.cc

    r80ad5e r97454d  
    33****************************************/
    44
    5 /* $Id: mpsr_GetPoly.cc,v 1.14 1998-03-27 14:44:25 obachman Exp $ */
     5/* $Id: mpsr_GetPoly.cc,v 1.15 1998-04-07 18:35:26 obachman Exp $ */
    66
    77/***************************************************************
     
    242242    mpz_ptr gnum;
    243243    y =  (number) Alloc0(sizeof(rnumber));
     244#ifdef LDEBUG
     245    y->debug = 123456;
     246#endif
    244247    y->s = 3;
    245248    gnum = &(y->z);
     
    260263    *x =  (number) Alloc0(sizeof(rnumber));
    261264    y = (number) *x;
     265#ifdef LDEBUG
     266    y->debug = 123456;
     267#endif
    262268    y->s = 1;
    263269    failr(GetApInt(link, &(y->z)));
     
    282288      *x =  (number) Alloc0(sizeof(rnumber));
    283289      y = (number) *x;
     290#ifdef LDEBUG
     291      y->debug = 123456;
     292#endif
    284293      mpz_init_set_ui(&(y->z), ui);
    285294      y->s = 3;
  • Singular/mpsr_Put.cc

    r80ad5e r97454d  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mpsr_Put.cc,v 1.7 1998-01-16 14:29:55 krueger Exp $ */
     4/* $Id: mpsr_Put.cc,v 1.8 1998-04-07 18:35:27 obachman Exp $ */
    55
    66
     
    534534#endif
    535535    }
    536     else if (IDTYP(h) != LINK_CMD)
     536    // do not dump LIB string and Links
     537    else if (!(IDTYP(h) == STRING_CMD && strcmp("LIB", IDID(h)) == 0) &&
     538             IDTYP(h) != LINK_CMD)
    537539    {
    538540      cmd.arg1.name = IDID(h);
  • Singular/silink.cc

    r80ad5e r97454d  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: silink.cc,v 1.15 1998-02-27 16:28:01 Singular Exp $ */
     4/* $Id: silink.cc,v 1.16 1998-04-07 18:35:27 obachman Exp $ */
    55
    66/*
     
    459459
    460460  if (currRingHdl != rh) rSetHdl(rh, TRUE);
    461   fwrite("RETURN();\n",1,10,fd);
     461  fprintf(fd, "RETURN();\n");
    462462  fflush(fd);
    463463 
     
    526526  if (type_id == QRING_CMD) return DumpQring(fd, h, type_str);
    527527 
     528  // do not dump LIB string
    528529  if (type_id == STRING_CMD && strcmp("LIB", IDID(h)) == 0)
    529530  {
    530     if (fprintf(fd, "LIB \"%s\";\n", IDSTRING(h)) == EOF) return TRUE;
    531     else return FALSE;
     531    return FALSE;
    532532  }
    533533                                     
     
    646646    while (*pstr != '\0')
    647647    {
    648       if (*pstr == '"') fputc('\\', fd);
     648      if (*pstr == '"' || *pstr == '\\') fputc('\\', fd);
    649649      fputc(*pstr, fd);
    650650      pstr++;
     
    660660      fputc('"', fd);
    661661      while (*pstr != '\0') {
    662         if (*pstr == '"') fputc('\\', fd);
    663         fputc(*pstr, fd);
    664         pstr++;
     662        if (*pstr == '"' || *pstr == '\\') fputc('\\', fd);
     663        fputc(*pstr, fd);
     664        pstr++;
    665665      }
    666666      fputc('"', fd);
  • Singular/spSpolyLoop.inc

    r80ad5e r97454d  
    15251525    {
    15261526      assume(pComp0(b, a2) == 1);
    1527       assume(pComp0(b,a2) == 1);
    15281527      pSetCoeff0(b,npMultM(pGetCoeff(a1), tneg));
    15291528      a = pNext(a) = b;       // append b to result and advance a1
Note: See TracChangeset for help on using the changeset viewer.