Changeset 116023 in git


Ignore:
Timestamp:
Jan 8, 2014, 4:26:06 PM (10 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
9a236dfb836ff04c250f1791ac6bfcf9c199c40a
Parents:
a821d149b494cb7005a11357ee001ae657e735ff
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2014-01-08 16:26:06+01:00
git-committer:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2014-01-08 16:27:02+01:00
Message:
update iiLocateLib,iiInitSingularProcinfo
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/iplib.cc

    ra821d14 r116023  
    797797BOOLEAN iiLocateLib(const char* lib, char* where)
    798798{
    799   idhdl hl;
    800 
    801   char *p;
    802 
    803   hl = IDROOT->get("LIB", 0);
    804   if (hl == NULL || (p=strstr(IDSTRING(hl), lib)) == NULL) return FALSE;
    805   if ((p!=IDSTRING(hl)) && (*(p-1)!=',')) return FALSE;
    806 
    807   if (strstr(IDSTRING(hl), ",") == NULL)
    808   {
    809     strcpy(where, IDSTRING(hl));
     799  char *plib = iiConvName(lib);
     800  idhdl pl = basePack->idroot->get(plib,0);
     801  if( (pl!=NULL) && (IDTYPr(pl)==PACKAGE_CMD) &&
     802    (IDPACKAGE(pl)->language == LANG_SINGULAR))
     803  {
     804    strncpy(where,IDPACKAGE(pl)->libname,127);
     805    return TRUE;
    810806  }
    811807  else
    812   {
    813     char* tmp = omStrDup(IDSTRING(hl));
    814     char* tok = strtok(tmp, ",");
    815     do
    816     {
    817       if (strstr(tok, lib) != NULL) break;
    818       tok = strtok(NULL, ",");
    819     }
    820     while (tok != NULL);
    821     assume(tok != NULL);
    822     strcpy(where, tok);
    823     omFree(tmp);
    824   }
    825   return TRUE;
     808    return FALSE;;
    826809}
    827810
     
    995978{
    996979  pi->libname = omStrDup(libname);
    997 
    998   if( strcmp(procname,"_init")==0)
    999   {
    1000     pi->procname = iiConvName(libname);
    1001   }
    1002   else
    1003     pi->procname = omStrDup(procname);
     980  pi->procname = omStrDup(procname);
    1004981  pi->language = LANG_SINGULAR;
    1005982  pi->ref = 1;
     
    1021998}
    1022999
    1023 #if 0
    1024 // TODO!?
    1025 procinfo *iiInitSingularProcinfo(procinfo* pi, const char *libname,
    1026                                  const char *procname, int line, long pos,
    1027                                  BOOLEAN pstatic /*= FALSE*/)
    1028 {
    1029   pi->libname = (char *)malloc(strlen(libname)+1);
    1030   memcpy(pi->libname, libname, strlen(libname));
    1031   *(pi->libname+strlen(libname)) = '\0';
    1032 
    1033   pi->procname = (char *)malloc(strlen(procname)+1);
    1034   strcpy(pi->procname, procname/*, strlen(procname)*/);
    1035   pi->language = LANG_SINGULAR;
    1036   pi->ref = 1;
    1037   pi->is_static = pstatic;
    1038   pi->data.s.proc_start = pos;
    1039   pi->data.s.def_end    = 0L;
    1040   pi->data.s.help_start = 0L;
    1041   pi->data.s.body_start = 0L;
    1042   pi->data.s.body_end   = 0L;
    1043   pi->data.s.example_start = 0L;
    1044   pi->data.s.proc_lineno = line;
    1045   pi->data.s.body_lineno = 0;
    1046   pi->data.s.example_lineno = 0;
    1047   pi->data.s.body = NULL;
    1048   pi->data.s.help_chksum = 0;
    1049   return(pi);
    1050 }
    1051 #endif
    1052 
    10531000/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
    10541001int iiAddCproc(const char *libname, const char *procname, BOOLEAN pstatic,
Note: See TracChangeset for help on using the changeset viewer.