addinter.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define DynInterfStart   500

Functions

int SciLibLoad (int num_names, char **names, char **files, int *nums, int *err)
void BuildName (char *name, char *str)
void CallDynInterf (int *pos, int num_names, int namepos, char **names, int *nums, char **files)


Define Documentation

#define DynInterfStart   500

the first dynamic interface is at position 500+1

Definition at line 5 of file addinter.h.

Referenced by callinterf(), DynFuntab(), and userlk().


Function Documentation

void BuildName ( char *  name,
char *  str 
)

Definition at line 360 of file addinter.c.

References GetenvB(), MAX_ENV, and nc.

00361 {
00362   int  nc= MAX_ENV;
00363   GetenvB("SCI",name,nc);
00364   strcat(name,"/libs/");
00365   strcat(name,str);
00366 }

Here is the call graph for this function:

void CallDynInterf ( int pos,
int  num_names,
int  namepos,
char **  names,
int nums,
char **  files 
)

Definition at line 368 of file addinter.c.

References C2F, err, error, getWarningMode(), ok, SciLibLoad(), and sciprint().

00370 {
00371   int imes = 9999;
00372   if ( *pos == -1 || DynInterf[*pos].ok == 0) 
00373     {
00375       int err=0;
00376       SciLibLoad(num_names,names,files,nums,&err);
00377       if (err != 1) *pos = nums[namepos];
00378     }
00379   if ( DynInterf[*pos].ok == 1 ) 
00380     (*DynInterf[*pos].func)();
00381   else 
00382     {
00383       if (getWarningMode()) sciprint("Interface %s not linked\r\n",DynInterf[*pos].name);
00384       C2F(error)(&imes);
00385     }
00386 }  

Here is the call graph for this function:

int SciLibLoad ( int  num_names,
char **  names,
char **  files,
int nums,
int err 
)

Definition at line 305 of file addinter.c.

References getWarningMode(), i, INTERFSIZE, j, MAXINTERF, Nshared, ok, rhs, SciInterInit(), SciLink(), SciLinkInit(), sciprint(), SearchInDynLinks(), and ShowInterf().

Referenced by CallDynInterf().

00306 {
00307   int i,rhs=2,inum,ilib=0,j;
00308   SciLinkInit();
00309   SciInterInit();
00310   *err=0;
00311   
00312   for ( j=0 ; j < num_names ; j++) 
00313     {
00315       inum=-1;
00316       for ( i = 0 ; i < LastInterf ; i++) 
00317         {
00318           if ( DynInterf[i].ok == 0 ) inum= i;
00319         }
00320       inum = ( inum == -1 ) ? LastInterf : inum ;
00322       if ( inum >=  MAXINTERF ) 
00323         {
00324           if (getWarningMode()) sciprint("Maximum number of dynamic interfaces %d\r\n",MAXINTERF);
00325           if (getWarningMode()) sciprint("has been reached\r\n");
00326           *err=1;
00327           return -1 ;
00328         }
00329       else 
00330         nums[j]=inum;
00331       if ( inum == LastInterf ) LastInterf++;
00332     }
00333   SciLink(0,&rhs,&ilib,files,names,"f");
00334   if ( ilib < 0 ) 
00335     {
00336       *err=1;  return -1;
00337     }
00340   for ( j=0 ; j < num_names ; j++) 
00341     {
00342       DynInterf[nums[j]].Nshared = ilib;
00343       if ( SearchInDynLinks(names[0],&DynInterf[nums[j]].func) < 0 ) 
00344         {
00345           if (getWarningMode()) sciprint("addinter failed for %s Not  found!\r\n",names[j]);
00346           return -1;
00347         }
00348       else
00349         {
00350           strncpy(DynInterf[nums[j]].name,names[j],INTERFSIZE);
00351           DynInterf[nums[j]].ok = 1;
00352         }
00353     }
00354   ShowInterf();
00355   return 0;
00356 }

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Sun Mar 4 15:14:35 2007 for Scilab [trunk] by  doxygen 1.5.1