Changeset 743c32 in git for Singular/iplib.cc


Ignore:
Timestamp:
Apr 29, 1999, 6:57:18 PM (25 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
b98018048375e2844cb029948d521db0a81570d8
Parents:
ce5fb2786eb5fa61fee54f85fe8647ef13e7be20
Message:
* hannes: - OPT_DEBUG revisited
          - fixes to sdb


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

Legend:

Unmodified
Added
Removed
  • Singular/iplib.cc

    rce5fb2 r743c32  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: iplib.cc,v 1.54 1999-04-15 17:28:04 Singular Exp $ */
     4/* $Id: iplib.cc,v 1.55 1999-04-29 16:57:13 Singular Exp $ */
    55/*
    66* ABSTRACT: interpreter: LIB and help
     
    172172    s[procbuflen+head+2] = '\0';
    173173    offset=0;
    174     for(i=0;i<=procbuflen+head+2; i++) {
     174    for(i=0;i<=procbuflen+head+2; i++)
     175    {
    175176      if(s[i]=='\\' &&
    176          (s[i+1]=='"' || s[i+1]=='{' || s[i+1]=='}' || s[i+1]=='\\')) {
     177         (s[i+1]=='"' || s[i+1]=='{' || s[i+1]=='}' || s[i+1]=='\\'))
     178      {
    177179        i++;
    178180        offset++;
     
    316318  {
    317319    namehdl nshdl;
    318     for(nshdl=namespaceroot; nshdl->isroot != TRUE; nshdl = nshdl->next) {
     320    for(nshdl=namespaceroot; nshdl->isroot != TRUE; nshdl = nshdl->next)
     321    {
    319322      Print("%d lev %d:",nshdl->lev, nshdl->myynest);
    320323      if (nshdl->currRing==NULL) PrintS("NULL");
     
    603606  lib_types LT;
    604607
    605   for(i=0; suffix[i] != NULL; i++) {
     608  for(i=0; suffix[i] != NULL; i++)
     609  {
    606610    sprintf(libname, "%s%s", id, suffix[i]);
    607611    *libname = mytolower(*libname);
    608     if((LT = type_of_LIB(libname, libnamebuf)) != LT_NONE) {
    609       if(!(LoadResult = iiLibCmd(mstrdup(libname), FALSE))) {
     612    if((LT = type_of_LIB(libname, libnamebuf)) != LT_NONE)
     613    {
     614      if(!(LoadResult = iiLibCmd(mstrdup(libname), FALSE)))
     615      {
    610616        v->name = iiConvName(libname);
    611617        break;
     
    813819  }
    814820#ifdef HAVE_NAMESPACES
    815   if (BVERBOSE(V_LOAD_LIB)) {
     821  if (BVERBOSE(V_LOAD_LIB))
     822  {
    816823    idhdl versionhdl  = namespaceroot->get("version",0);
    817824    if(versionhdl != NULL)
     
    10411048         "line", "start", "line", "body", "line", "example");
    10421049#ifdef HAVE_NAMESPACES
    1043 //  for(pl = IDROOT; pl != NULL; pl = IDNEXT(pl)) {
    1044     for(pl = NSROOT(namespaceroot->root); pl != NULL; pl = IDNEXT(pl)) {
    1045     if(IDTYP(pl) == PACKAGE_CMD) {
     1050//  for(pl = IDROOT; pl != NULL; pl = IDNEXT(pl))
     1051//{
     1052    for(pl = NSROOT(namespaceroot->root); pl != NULL; pl = IDNEXT(pl))
     1053    {
     1054    if(IDTYP(pl) == PACKAGE_CMD)
     1055    {
    10461056      for(h = IDPACKAGE(pl)->idroot; h != NULL; h = IDNEXT(h))
    10471057#else /* HAVE_NAMESPACES */
     
    11011111  char *f = NULL;
    11021112  if(hl!=NULL) f = strstr(IDSTRING(hl),libname);
    1103   if( (hl==NULL) || (f == NULL)) {
    1104     for(lp = this;lp!=NULL;lp=lp->next) {
     1113  if( (hl==NULL) || (f == NULL))
     1114  {
     1115    for(lp = this;lp!=NULL;lp=lp->next)
     1116    {
    11051117      if(strcmp(lp->get(), libname)==0) break;
    11061118    }
    1107     if(lp==NULL) {
     1119    if(lp==NULL)
     1120    {
    11081121      libstackv ls = (libstack *)Alloc0(sizeof(libstack));
    11091122      ls->next = this;
     
    11331146lib_types type_of_LIB(char *newlib, char *libnamebuf)
    11341147{
    1135   char  buf[HOWMANY+1]; /* one extra for terminating '\0' */
     1148  char        buf[HOWMANY+1];        /* one extra for terminating '\0' */
    11361149  struct stat sb;
    11371150  int nbytes = 0;
     
    11461159    return LT;
    11471160  }
    1148   if((sb.st_mode & S_IFMT) != S_IFREG) {
     1161  if((sb.st_mode & S_IFMT) != S_IFREG)
     1162  {
    11491163    goto lib_type_end;
    11501164  }
    1151   if ((nbytes = fread((char *)buf, sizeof(char), HOWMANY, fp)) == -1) {
     1165  if ((nbytes = fread((char *)buf, sizeof(char), HOWMANY, fp)) == -1)
     1166  {
    11521167    goto lib_type_end;
    11531168    /*NOTREACHED*/
     
    11551170  if (nbytes == 0)
    11561171    goto lib_type_end;
    1157   else {
    1158     buf[nbytes++] = '\0';       /* null-terminate it */
    1159   }
    1160   if( (strncmp(buf, "\177ELF\01\01\01", 7)==0) && buf[16]=='\03') {
     1172  else
     1173  {
     1174    buf[nbytes++] = '\0';        /* null-terminate it */
     1175  }
     1176  if( (strncmp(buf, "\177ELF\01\01\01", 7)==0) && buf[16]=='\03')
     1177  {
    11611178    LT = LT_ELF;
    11621179    FreeL(newlib);
     
    11641181    goto lib_type_end;
    11651182  }
    1166   if( (strncmp(buf, "\02\020\01\016\05\022@", 7)==0)) {
     1183  if( (strncmp(buf, "\02\020\01\016\05\022@", 7)==0))
     1184  {
    11671185    LT = LT_HPUX;
    11681186    FreeL(newlib);
     
    11701188    goto lib_type_end;
    11711189  }
    1172   if(isprint(buf[0]) || buf[0]=='\n') { LT = LT_SINGULAR; goto lib_type_end; }
     1190  if(isprint(buf[0]) || buf[0]=='\n')
     1191  { LT = LT_SINGULAR; goto lib_type_end; }
    11731192
    11741193  lib_type_end:
Note: See TracChangeset for help on using the changeset viewer.