source: git/Singular/iplib.cc @ 057e93c

spielwiese
Last change on this file since 057e93c was 057e93c, checked in by Hans Schönemann <hannes@…>, 26 years ago
* Fri Feb 27 15:02:10 MET 1998 hannes new input scheme: many modifications to febase.h, febase.inc, febase.cc, scanner.l, grammar.y, iplib.cc, ipshell.{h,cc} git-svn-id: file:///usr/local/Singular/svn/trunk@1183 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 17.8 KB
Line 
1/****************************************
2*  Computer Algebra System SINGULAR     *
3****************************************/
4/* $Id: iplib.cc,v 1.10 1998-02-27 14:06:18 Singular Exp $ */
5/*
6* ABSTRACT: interpreter: LIB and help
7*/
8
9//#include <stdlib.h>
10#include <stdio.h>
11#include <string.h>
12//#include <ctype.h>
13
14#include "mod2.h"
15#include "tok.h"
16#include "ipid.h"
17#include "mmemory.h"
18#include "febase.h"
19#include "ring.h"
20#include "subexpr.h"
21#include "ipshell.h"
22#include "lists.h"
23
24procinfo *iiInitSingularProcinfo(procinfo *pi, char *libname,
25                                 char *procname, int line, long pos);
26char *iiConvName(char *p);
27
28/*2
29* find the library of an proc:
30*  => return (pi->libname)
31*/
32char * iiGetLibName(procinfov pi)
33{
34  char *res=NULL;
35
36  res = pi->libname;
37  return res;
38}
39/*2
40* given a line 'proc[ ]+{name}[ \t]*'
41* return a pointer to name and set the end of '\0'
42* changes the input!
43* returns: e: pointer to 'end of name'
44*          ct: changed char at the end of s
45*/
46char* iiProcName(char *buf, char & ct, char* &e)
47{
48  char *s=buf+5;
49  while (*s==' ') s++;
50  e=s+1;
51  while ((*e>' ') && (*e!='(')) e++;
52  ct=*e;
53  *e='\0';
54  return s;
55}
56
57/*2
58* given a line with args, return the argstr
59*/
60char * iiProcArgs(char *e,BOOLEAN withParenth)
61{
62  while ((*e==' ') || (*e=='(')) e++;
63  if (*e<' ')
64  {
65    if (withParenth)
66    {
67      // no argument list, allow list #
68      return mstrdup("parameter list #;");
69    }
70    else
71    {
72      // empty list
73      return mstrdup("");
74    }
75  }
76  BOOLEAN in_args;
77  BOOLEAN args_found;
78  char *s;
79  char *argstr=(char *)AllocL(200);
80  *argstr='\0';
81  do
82  {
83    args_found=FALSE;
84    s=e; // set s to the starting point of the arg
85         // and search for the end
86    while ((*e!=',')&&(*e!=')')&&(*e!='\0'))
87    {
88      args_found=args_found || (*e>' ');
89      e++;
90    }
91    in_args=(*e==',');
92    if (args_found)
93    {
94      *e='\0';
95      // copy the result to argstr
96      strcat(argstr,"parameter ");
97      strcat(argstr,s);
98      strcat(argstr,";\n");
99      e++; // e was pointing to ','
100    }
101  } while (in_args);
102  return argstr;
103}
104
105/*2
106* locate `procname` in lib `libname` and find the part `part`:
107*  part=0: help, between, but excluding the line "proc ..." and "{...":
108*    => return
109*  part=1: body, between "{ ..." and "}", including the 1. line, w/o "{"
110*    => set pi->data.s.body, return NULL
111*  part=2: example, between, but excluding the line "exapmle {..." and "}":
112*    => return
113*/
114char* iiGetLibProcBuffer(procinfo *pi, int part )
115{
116  char buf[256], *s = NULL, *p;
117  long procbuflen;
118
119  FILE * fp = feFopen( pi->libname, "rb", NULL, TRUE );
120  if (fp==NULL)
121  {
122    return NULL;
123  }
124
125  fseek(fp, pi->data.s.proc_start, SEEK_SET);
126  if(part==0)
127  { // load help string
128    procbuflen = pi->data.s.body_start - pi->data.s.proc_start;
129    //Print("Help=%ld-%ld=%d\n", pi->data.s.body_start,
130    //    pi->data.s.proc_start, procbuflen);
131    s = (char *)AllocL(procbuflen);
132    fread(s, procbuflen, 1, fp);
133    s[procbuflen] = '\0';
134    return(s);
135  }
136  if(part==1)
137  { // load proc part
138    fgets(buf, sizeof(buf), fp);
139    char ct;
140    char *e;
141    s=iiProcName(buf,ct,e);
142    char *argstr=NULL;
143    *e=ct;
144    argstr=iiProcArgs(e,TRUE);
145    procbuflen = pi->data.s.body_end - pi->data.s.body_start;
146    pi->data.s.body = (char *)AllocL( strlen(argstr)+procbuflen+15+
147                                      strlen(pi->libname) );
148    //Print("Body=%ld-%ld=%d\n", pi->data.s.body_end,
149    //    pi->data.s.body_start, procbuflen);
150    if (pi->data.s.body==NULL)
151    {
152      Werror( "unable to allocate proc buffer `%s`", pi->procname );
153      return NULL;
154    }
155    fseek(fp, pi->data.s.body_start, SEEK_SET);
156    strcpy(pi->data.s.body,argstr);
157    fread( pi->data.s.body+strlen(argstr), procbuflen, 1, fp);
158    procbuflen+=strlen(argstr);
159    FreeL(argstr);
160    fclose( fp );
161    pi->data.s.body[procbuflen] = '\0';
162    strcat( pi->data.s.body+procbuflen, "\n;return();\n\n" );
163    strcat( pi->data.s.body+procbuflen+13,pi->libname);
164    s=strchr(pi->data.s.body,'{');
165    if (s!=NULL) *s=' ';
166    return NULL;
167  }
168  if(part==2)
169  { // load example
170    fseek(fp, pi->data.s.example_start, SEEK_SET);
171    fgets(buf, sizeof(buf), fp);
172    procbuflen = pi->data.s.proc_end - pi->data.s.example_start - strlen(buf);
173    //Print("Example=%ld-%ld=%d\n", pi->data.s.proc_end,
174    //  pi->data.s.example_start, procbuflen);
175    s = (char *)AllocL(procbuflen+14);
176    fread(s, procbuflen, 1, fp);
177    s[procbuflen] = '\0';
178    strcat(s+procbuflen-3, "\n;return();\n\n" );
179    p=strchr(s,'{');
180    if (p!=NULL) *s=' ';
181    return(s);
182  }
183  return NULL;
184}
185
186/*2
187* start a proc
188* parameters are built as exprlist
189* TODO:interrupt
190* return FALSE on success, TRUE if an error occurs
191*/
192BOOLEAN iiPStart(idhdl pn, sleftv  * v)
193{
194  char * str;
195  BOOLEAN err=FALSE;
196  int old_echo=si_echo;
197
198  /* init febase ======================================== */
199  /* we do not enter this case if filename != NULL !! */
200  if (pn!=NULL)
201  {
202    procinfov pi;
203    pi = IDPROC(pn);
204    if(pi!=NULL)
205    {
206      if( pi->data.s.body==NULL )
207      {
208        iiGetLibProcBuffer(IDPROC(pn));
209        if (IDPROC(pn)->data.s.body==NULL) return TRUE;
210      }
211      newBuffer( mstrdup(IDPROC(pn)->data.s.body), BT_proc,
212                 pi, IDPROC(pn)->data.s.body_lineno );
213    }
214    //else
215    //{ // for security only
216    //  newBuffer( mstrdup(IDSTRING(pn)), BT_proc, IDID(pn) );
217    //}
218  }
219  /* generate argument list ======================================*/
220  if (v!=NULL)
221  {
222    iiCurrArgs=(leftv)Alloc(sizeof(sleftv));
223    memcpy(iiCurrArgs,v,sizeof(sleftv));
224    memset(v,0,sizeof(sleftv));
225  }
226  else
227  {
228    iiCurrArgs=NULL;
229  }
230  /* start interpreter ======================================*/
231  //Print("PStart <<%s>>\n",IDID(pn));
232  myynest++;
233  err=yyparse();
234  killlocals(myynest);
235  myynest--;
236  si_echo=old_echo;
237  //Print("PEnd <<%s>>\n",IDID(pn));
238 
239  return err;
240}
241
242ring    *iiLocalRing
243#ifdef TEST
244                    =NULL
245#endif
246                   ;
247sleftv  *iiRETURNEXPR
248#ifdef TEST
249                    =NULL
250#endif
251                   ;
252int     iiRETURNEXPR_len=0;
253
254#ifdef RDEBUG
255static void iiShowLevRings()
256{
257  int i;
258  for (i=1;i<=myynest;i++)
259  {
260    Print("lev %d:",i);
261    if (iiLocalRing[i]==NULL) PrintS("NULL");
262    else                      Print("%d",iiLocalRing[i]);
263    Print("\n");
264  }
265  if (currRing==NULL) PrintS("curr:NULL\n");
266  else                Print ("curr:%d\n",currRing->no);
267}
268#endif
269
270static void iiCheckNest()
271{
272  if (myynest >= iiRETURNEXPR_len-1)
273  {
274    iiRETURNEXPR=(sleftv *)ReAlloc(iiRETURNEXPR,
275                                   iiRETURNEXPR_len*sizeof(sleftv),
276                                   (iiRETURNEXPR_len+16)*sizeof(sleftv));
277    iiLocalRing=(ring *)ReAlloc(iiLocalRing,
278                                   iiRETURNEXPR_len*sizeof(ring),
279                                   (iiRETURNEXPR_len+16)*sizeof(ring));
280    iiRETURNEXPR_len+=16;
281  }
282}
283sleftv * iiMake_proc(idhdl pn, sleftv* sl)
284{
285  int err;
286  procinfov pi = IDPROC(pn);
287  iiCheckNest();
288  iiLocalRing[myynest]=currRing;
289  iiRETURNEXPR[myynest+1].Init();
290  if (traceit&TRACE_SHOW_PROC)
291  {
292    if (traceit&TRACE_SHOW_LINENO) printf("\n");
293    printf("entering %s (level %d)\n",IDID(pn),myynest);
294  }
295#ifdef RDEBUG
296  if (traceit&TRACE_SHOW_RINGS) iiShowLevRings();
297#endif
298#if 1
299  if(pi->language == LANG_SINGULAR) err=iiPStart(pn,sl);
300  if(pi->language == LANG_C)
301  {
302    leftv res = (leftv)Alloc0(sizeof(sleftv));
303    err = (pi->data.o.function)(res, sl);
304    iiRETURNEXPR[myynest+1].Copy(res);
305    Free((ADDRESS)res, sizeof(sleftv));
306  }
307#else
308  switch (pi->language)
309  {
310    case LANG_SINGULAR: err=iiPStart(pn,sl); break;
311    case LANG_C: leftv res = (leftv)Alloc0(sizeof(sleftv));
312      err = (pi->data.o.function)(res, sl);
313      iiRETURNEXPR[myynest+1].Copy(res);
314      Free((ADDRESS)res, sizeof(sleftv));
315      break;
316    default: err=TRUE;
317  }
318#endif
319  if (traceit&TRACE_SHOW_PROC)
320  {
321    if (traceit&TRACE_SHOW_LINENO) printf("\n");
322    printf("leaving  %s (level %d)\n",IDID(pn),myynest);
323  }
324#ifdef RDEBUG
325  if (traceit&TRACE_SHOW_RINGS) iiShowLevRings();
326#endif
327  if (err)
328  {
329    iiRETURNEXPR[myynest+1].CleanUp();
330    iiRETURNEXPR[myynest+1].Init();
331  }
332  if (iiLocalRing[myynest] != currRing)
333  {
334    if (((iiRETURNEXPR[myynest+1].Typ()>BEGIN_RING)
335      && (iiRETURNEXPR[myynest+1].Typ()<END_RING))
336    || ((iiRETURNEXPR[myynest+1].Typ()==LIST_CMD)
337      && (lRingDependend((lists)iiRETURNEXPR[myynest+1].Data()))))
338    {
339      //idhdl hn;
340      char *n;
341      char *o;
342      if (iiLocalRing[myynest]!=NULL) o=rFindHdl(iiLocalRing[myynest],NULL)->id;
343      else                            o="none";
344      if (currRing!=NULL)             n=rFindHdl(currRing,NULL)->id;
345      else                            n="none";
346      Werror("ring change during procedure call: %s -> %s",o,n);
347      iiRETURNEXPR[myynest+1].CleanUp();
348      err=TRUE;
349    }
350    if (iiLocalRing[myynest]!=NULL)
351    {
352      rSetHdl(rFindHdl(iiLocalRing[myynest],NULL),TRUE);
353      iiLocalRing[myynest]=NULL;
354    }
355    else
356    { currRingHdl=NULL; currRing=NULL; }
357  }
358  if (iiCurrArgs!=NULL)
359  {
360    Warn("too many arguments for %s",IDID(pn));
361    iiCurrArgs->CleanUp();
362    Free((ADDRESS)iiCurrArgs,sizeof(sleftv));
363    iiCurrArgs=NULL;
364  }
365  if (err) return NULL;
366  return &iiRETURNEXPR[myynest+1];
367}
368
369/*2
370* start an example (as a proc),
371* destroys the string 'example'
372*/
373BOOLEAN iiEStart(char* example, procinfo *pi)
374{
375  BOOLEAN err;
376  int old_echo=si_echo;
377
378  newBuffer( example, BT_example, pi, pi->data.s.example_lineno );
379  iiCheckNest();
380  iiLocalRing[myynest]=currRing;
381  if (traceit&TRACE_SHOW_PROC)
382  {
383    if (traceit&TRACE_SHOW_LINENO) printf("\n");
384    printf("entering example (level %d)\n",myynest);
385  }
386  myynest++;
387  err=yyparse();
388  killlocals(myynest);
389  myynest--;
390  si_echo=old_echo;
391  if (traceit&TRACE_SHOW_PROC)
392  {
393    if (traceit&TRACE_SHOW_LINENO) printf("\n");
394    printf("leaving  -example- (level %d)\n",myynest);
395  }
396  if (iiLocalRing[myynest] != currRing)
397  {
398    if (iiLocalRing[myynest]!=NULL)
399    {
400      rSetHdl(rFindHdl(iiLocalRing[myynest],NULL),TRUE);
401      iiLocalRing[myynest]=NULL;
402    }
403    else
404    {
405      currRingHdl=NULL;
406      currRing=NULL;
407    }
408  }
409  return err;
410}
411
412BOOLEAN iiLibCmd( char *newlib, BOOLEAN tellerror )
413{
414  char buf[256];
415  char libnamebuf[128];
416  idhdl h,hl;
417  int lines = 1;
418  long pos = 0L;
419  procinfov pi;
420  FILE * fp = feFopen( newlib, "r", libnamebuf, tellerror );
421  if (fp==NULL)
422  {
423    return TRUE;
424  }
425  hl = idroot->get("LIB",0);
426  if (hl==NULL)
427  {
428    hl = enterid( mstrdup("LIB"),0, STRING_CMD, &idroot, FALSE );
429    IDSTRING(hl) = mstrdup(newlib);
430  }
431  else
432  {
433#ifdef TEST
434    if (IDSTRING(hl) != NULL)
435#endif
436    {
437      char *s = (char *)AllocL( strlen(newlib) + strlen(IDSTRING(hl)) + 2 );
438      strcpy(s,IDSTRING(hl));
439      BOOLEAN f=FALSE;
440      if(strchr(s,',')==NULL)
441      {
442        if (strcmp(s,newlib)==0)
443          f=TRUE;
444      }
445      else
446      {
447        char *p=strtok(s,",");
448        do
449        {
450          if(strcmp(p,newlib)==0)
451          {
452            f=TRUE;
453            break;
454          }
455          p=strtok(NULL,",");
456        } while (p!=NULL);
457      }
458      if (f)
459        FreeL(s);
460      else
461      {
462        sprintf( s, "%s,%s", IDSTRING(hl), newlib);
463        FreeL((ADDRESS)IDSTRING(hl));
464        IDSTRING(hl) = s;
465      }
466    }
467#ifdef TEST
468    else
469    {
470      PrintS("## empty LIB string\n");
471      IDSTRING(hl) = mstrdup(newlib);
472    }
473#endif
474  }
475
476  // processing head section
477  if (fgets( buf, sizeof(buf), fp))
478  {
479    if (BVERBOSE(V_LOAD_LIB))
480    {
481      if (strncmp( buf, "// $Id", 5) == 0)
482      {
483        char ver[10];
484        char date[16];
485        ver[0]='?'; ver[1]='.'; ver[2]='?'; ver[3]='\0';
486        date[0]='?'; date[1]='\0';
487        sscanf(buf,"// %*s %*s %10s %16s",ver,date);
488        strcat(libnamebuf,"(");
489        strcat(libnamebuf,ver);
490        strcat(libnamebuf,",");
491        strcat(libnamebuf,date);
492        strcat(libnamebuf,")");
493      }
494      else
495      {
496        strcat(libnamebuf,"(**unknown version**)");
497      }
498      Warn( "loading %s", libnamebuf );
499    }
500  }
501
502
503  #define IN_HEADER 1
504  #define IN_BODY   2
505  #define IN_EXAMPLE      3
506  #define IN_EXAMPLE_BODY 4
507  #define IN_LIB_HEADER   5
508  int v=-1,otherLines=0,inBlock=IN_LIB_HEADER;
509  do /*while (fgets( buf, sizeof(buf), fp))*/
510  {
511    int  offset;
512    if (buf[0]!='\n')
513    {
514      if ((inBlock==0)||(inBlock==IN_LIB_HEADER))
515      {
516        if (strncmp( buf, "LIB ", 4) == 0)
517        {
518          char *s=buf+5;
519          char *f=strchr(s,'"');
520          if (f!=NULL)
521            *f='\0';
522          else
523            return TRUE;
524          // if (BVERBOSE(V_LOAD_LIB)) Print("// requires %s",s);
525          f=strstr(IDSTRING(hl),s);
526          if (f == NULL)
527          {
528            // if (BVERBOSE(V_LOAD_LIB)) PrintLn();
529            iiLibCmd(mstrdup(s));
530            // if (BVERBOSE(V_LOAD_LIB)) Print( "// loading %s\n", newlib);
531          }
532          //else if (BVERBOSE(V_LOAD_LIB)) PrintS(" -> already loaded\n");
533        }
534        else if (strncmp( buf, "proc ", 5) == 0)
535        {
536          char proc[256];
537          char ct1, *e;
538          sscanf( buf, "proc %s", proc);
539          offset = 2;
540          char *ct=strchr(proc,'(');
541          if (ct!=NULL) { *ct='\0'; offset=3; }
542          sprintf( buf, "LIB:%s", newlib);
543#if 0
544          if(strcmp(proc, "_init")==0)
545          {
546            char *p =  iiConvName(newlib);
547            Print("Init found:%s;\n", p);
548            h = enterid( mstrdup(p), myynest, PROC_CMD, &idroot, FALSE );
549            FreeL((ADDRESS)p);
550          } else
551#endif
552            h = enterid( mstrdup(proc), myynest, PROC_CMD, &idroot, FALSE );
553          if (h!=NULL)
554          {
555            iiInitSingularProcinfo(IDPROC(h),newlib,proc,lines,pos);
556            if (BVERBOSE(V_LOAD_PROC)) Warn( "     proc %s loaded", proc );
557          }
558          inBlock=IN_HEADER;
559        }
560        else if (strncmp( buf, "// ver:", 7) == 0)
561        {
562          v=0;
563          sscanf( buf+7, "%d", &v);
564          if(v!=(SINGULAR_VERSION/100))
565            Warn("version mismatch - library `%s` requires:%d.%d",
566                  newlib,v/1000,(v%1000)/100);
567        }
568        else if (strncmp( buf, "example", 7) == 0)
569        {
570          IDPROC(h)->data.s.example_start = pos;
571          IDPROC(h)->data.s.example_lineno = lines;
572          inBlock=IN_EXAMPLE;
573        }
574        else if (strncmp( buf, "//", 2) != 0)
575        {
576          if (inBlock==0)
577          {
578            otherLines++;
579          }
580        }
581      }
582      else if ((inBlock==IN_HEADER) || (inBlock==IN_EXAMPLE))
583      {
584        if (buf[0]=='{')
585        {
586          if(inBlock==IN_HEADER)
587          {
588            IDPROC(h)->data.s.body_start = pos;
589            IDPROC(h)->data.s.body_lineno = lines-offset;
590            // Print("%s: %d-%d\n", pi->procname, lines, offset);
591          }
592          inBlock=IN_BODY;
593        }
594      }
595      else if ((inBlock==IN_BODY) || (inBlock==IN_EXAMPLE_BODY))
596      {
597        if (buf[0]=='}')
598        {
599          if(IDPROC(h)->data.s.example_start==0)
600            IDPROC(h)->data.s.example_start=pos;
601          if(IDPROC(h)->data.s.body_end==0) IDPROC(h)->data.s.body_end=pos;
602          IDPROC(h)->data.s.proc_end = pos;
603          inBlock=0;
604        }
605      }
606    }
607    lines++;
608    pos = ftell(fp);
609  } while (fgets( buf, sizeof(buf), fp));
610  fclose( fp );
611  //if (h!=NULL) IDPROC(h) = pi;
612  if (BVERBOSE(V_DEBUG_LIB))
613  {
614    if (inBlock!=0)
615      Warn("LIB `%s` ends within block",newlib);
616    if (otherLines!=0)
617      Warn("%d lines not recognised in LIB `%s`",otherLines,newlib);
618    if(v==-1)
619      Warn("LIB `%s` has no version flag",newlib);
620  }
621  FreeL((ADDRESS)newlib);
622  return FALSE;
623}
624
625procinfo *iiInitSingularProcinfo(procinfov pi, char *libname,
626                                 char *procname, int line, long pos)
627{
628  pi->libname = mstrdup(libname);
629
630  if( strcmp(procname,"_init")==0)
631  {
632    char *p = iiConvName(libname);
633    pi->procname = mstrdup(p);
634    FreeL((ADDRESS)p);
635  } else pi->procname = mstrdup(procname);
636  pi->language = LANG_SINGULAR;
637  pi->ref = 1;
638  pi->data.s.proc_start = pos;
639  pi->data.s.help_start = 0L;
640  pi->data.s.body_start = 0L;
641  pi->data.s.body_end   = 0L;
642  pi->data.s.example_start = 0L;
643  pi->data.s.proc_lineno = line;
644  pi->data.s.body_lineno = 0;
645  pi->data.s.example_lineno = 0;
646  pi->data.s.body = NULL;
647  return(pi);
648}
649
650/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
651char *iiConvName(char *libname)
652{
653  char *p = (char *)AllocL(strlen(libname)+7);
654  char *q = mstrdup(libname);
655  char *r = q;
656  for(; *r!='\0'; r++)
657  {
658    if(*r=='.') *r='_';
659    if(*r==':') *r='_';
660  }
661  sprintf(p, "%s_init\0", q);
662  FreeL((ADDRESS)q);
663  return(p);
664}
665
666/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
667int piShowProcList()
668{
669  idhdl h;
670  procinfo *proc;
671  char *name;
672
673  Print( "%-15s  %20s      %s,%s  %s,%s   %s,%s\n", "Library", "function",
674         "line", "start", "line", "body", "line", "example");
675  for(h = idroot; h != NULL; h = IDNEXT(h))
676  {
677    if(IDTYP(h) == PROC_CMD)
678    {
679      proc = IDPROC(h);
680      if(strcmp(proc->procname, IDID(h))!=0)
681      {
682        name = (char *)AllocL(strlen(IDID(h))+strlen(proc->procname)+4);
683        sprintf(name, "%s -> %s", IDID(h), proc->procname);
684        Print( "%-15s  %20s ", proc->libname, name);
685        FreeL(name);
686      } else Print( "%-15s  %20s ", proc->libname, proc->procname);
687      if(proc->language==LANG_SINGULAR)
688        Print("line %4d,%-5ld  %4d,%-5ld  %4d,%-5ld\n",
689              proc->data.s.proc_lineno, proc->data.s.proc_start,
690              proc->data.s.body_lineno, proc->data.s.body_start,
691              proc->data.s.example_lineno, proc->data.s.example_start);
692      else if(proc->language==LANG_C) Print("type: object\n");
693
694    }
695  }
696}
697
698/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/
699char *iiLineNo(char *procname, int lineno)
700{
701  char buf[256];
702  idhdl pn = ggetid(procname);
703  procinfo *pi = IDPROC(pn);
704
705  sprintf(buf, "%s %3d\0", procname, lineno);
706  //sprintf(buf, "%s::%s %3d\0", pi->libname, pi->procname,
707  //  lineno + pi->data.s.body_lineno);
708  return(buf);
709}
Note: See TracBrowser for help on using the repository browser.