link.c File Reference

#include <string.h>
#include <stdio.h>
#include "core_math.h"
#include "MALLOC.h"
#include "../../../string/includes/men_Sutils.h"
#include "link.h"
#include "sciprint.h"
#include <stdlib.h>
#include "machine.h"
#include "stack-c.h"
#include "warningmode.h"

Include dependency graph for link.c:

Go to the source code of this file.

Data Structures

struct  Epoints
struct  Hd

Defines

#define OK   1
#define FAIL   0
#define ENTRYMAX   5000
#define MAXNAME   256
#define TMPL   256

Typedefs

typedef void(*) function ()
typedef char Name [MAXNAME]

Functions

static void Underscores __PARAMS ((int isfor, char *ename, char *ename1))
static int SearchFandS __PARAMS ((char *, int))
int LinkStatus __PARAMS ((void))
int C2F() scilinknorhs (void)
void C2F() iislink (char *buf, integer *irep)
void ulinkall (void)
void C2F() iscilink (int *descla, int *ptrdescla, int *nvla, int *desc, int *ptrdesc, int *nv, char *strf, int *ilib, int *iflag, int *rhs)
int LinkStatus ()
void SciLink (int iflag, int *rhs, int *ilib, files, en_names,*strf)
void C2F() isciulink (integer *i)
static void Underscores (int isfor, char *ename, char *ename1)
void SciLinkInit (void)
void GetDynFunc (int ii, void(**realop)())
int SearchInDynLinks (char *op, void(**realop)())
static int SearchFandS (char *op, int ilib)
void ShowDynLinks (void)

Variables

static Hd hd [ENTRYMAX]
static int Nshared = 0
static Epoints EP [ENTRYMAX]
static int NEpoints = 0


Define Documentation

#define ENTRYMAX   5000

Definition at line 40 of file link.c.

Referenced by Sci_Delsym(), Sci_dlopen(), Sci_dlsym(), SciLink(), and SciLinkInit().

#define FAIL   0

Definition at line 37 of file link.c.

#define MAXNAME   256

Definition at line 41 of file link.c.

#define OK   1

Definition at line 36 of file link.c.

#define TMPL   256

Definition at line 53 of file link.c.

Referenced by Sci_dlopen().


Typedef Documentation

typedef void(*) function()

Definition at line 43 of file link.c.

typedef char Name[MAXNAME]

Definition at line 45 of file link.c.


Function Documentation

int LinkStatus __PARAMS ( (void)   ) 

static int SearchFandS __PARAMS ( (char *, int  )  [static]

static void Underscores __PARAMS ( (int isfor, char *ename, char *ename1)   )  [static]

void GetDynFunc ( int  ii,
void(**)()  realop 
)

Definition at line 316 of file link.c.

References EP, and Epoints::epoint.

Referenced by scicos().

00317 {
00318   if ( EP[ii].Nshared != -1 ) 
00319     *realop = EP[ii].epoint;
00320   else
00321     *realop = (function) 0;
00322 }

Here is the caller graph for this function:

void C2F() iislink ( char *  buf,
integer irep 
)

Referenced by funnum().

Here is the caller graph for this function:

void C2F() iscilink ( int descla,
int ptrdescla,
int nvla,
int desc,
int ptrdesc,
int nv,
char *  strf,
int ilib,
int iflag,
int rhs 
)

define DEBUG

for ( i=0 ; i < *nvla ; i++ ) sciprint("file %d : %s \r\n",i, files[i]);

for ( i=0 ; i < *nv ; i++ ) sciprint("name %d : %s \r\n",i, en_names[i]);

calling the linker

void C2F() isciulink ( integer i  ) 

Definition at line 228 of file link.c.

00230 {
00231   if (getWarningMode()) sciprint("Sorry : Unlinking is not implemented \r\n");
00232 }

int LinkStatus ( void   ) 

C2F(dynload)() {cerro("Dynamic link not implemented");} C2F(dyncall)() {cerro("Dynamic link not implemented");}

Definition at line 215 of file link.c.

Referenced by addinter().

00216 {
00217   return(0);
00218 }

Here is the caller graph for this function:

void SciLink ( int  iflag,
int rhs,
int ilib,
files  ,
en_names  ,
strf 
)

Definition at line 220 of file link.c.

References getWarningMode(), and sciprint().

Referenced by addinter(), and SciLibLoad().

00223 {
00224   if (getWarningMode()) sciprint("Sorry : Dynamic linking is not implemented  \r\n");
00225 }

Here is the call graph for this function:

Here is the caller graph for this function:

void SciLinkInit ( void   ) 

Definition at line 270 of file link.c.

References ENTRYMAX, EP, FAIL, hd, i, Epoints::Nshared, and ok.

Referenced by addinter(), and SciLibLoad().

00271 {
00272   static int first_entry = 0;
00273   int i;
00274   if ( first_entry == 0)
00275     {
00276       
00277       for ( i = 0 ; i < ENTRYMAX ; i++) 
00278         {
00279           hd[i].ok= FAIL;
00280           EP[i].Nshared = -1;
00281         }
00282       first_entry++;
00283     }
00284 }

Here is the caller graph for this function:

int C2F() scilinknorhs ( void   ) 

static int SearchFandS ( char *  op,
int  ilib 
) [static]

Definition at line 349 of file link.c.

References EP, i, and name.

Referenced by Sci_dlsym().

00350 {
00351   int i=0;
00352   for ( i = NEpoints-1 ; i >=0 ; i--) 
00353     {
00354       if ( strcmp(op,EP[i].name) == 0 && EP[i].Nshared == ilib)
00355         {
00356            return(i);
00357          }
00358     }
00359   return(-1);
00360 }

Here is the caller graph for this function:

int SearchInDynLinks ( char *  op,
void(**)()  realop 
)

Definition at line 329 of file link.c.

References EP, i, and name.

Referenced by addinter(), SciLibLoad(), and SetFunction().

00330 {
00331   int i=0;
00332   for ( i = NEpoints-1 ; i >=0 ; i--) 
00333     {
00334       if ( strcmp(op,EP[i].name) == 0) 
00335         {
00336            *realop = EP[i].epoint;
00337            return(EP[i].Nshared );
00338          }
00339     }
00340   return(-1);
00341 }

Here is the caller graph for this function:

void ShowDynLinks ( void   ) 

Definition at line 366 of file link.c.

References count, EP, getWarningMode(), hd, i, name, OK, ok, and sciprint().

00367 {
00368   int i=0,count=0;
00369   if (getWarningMode()) sciprint("Number of entry points %d\r\n",NEpoints);
00370   if (getWarningMode()) sciprint("Shared libs : [");
00371   for ( i = 0 ; i < Nshared ; i++) 
00372     if ( hd[i].ok == OK) { if (getWarningMode())sciprint("%d ",i);count++;}
00373   if (getWarningMode()) sciprint("] : %d libs\r\n",count);
00374   for ( i = NEpoints-1 ; i >=0 ; i--) 
00375     {
00376       if (getWarningMode()) sciprint("Entry point %s in shared lib %d\r\n",EP[i].name,EP[i].Nshared);
00377     }
00378 }

Here is the call graph for this function:

void ulinkall ( void   ) 

static void Underscores ( int  isfor,
char *  ename,
char *  ename1 
) [static]

Definition at line 254 of file link.c.

Referenced by Sci_dlsym(), and SciLink().

00255 {
00256 #ifdef WLU1
00257   *ename1='_'; ename1++;
00258 #endif
00259   strcpy(ename1,ename);
00260 #ifdef WTU
00261   if (isfor==1) strcat(ename1,"_");
00262 #endif
00263   return;
00264 }

Here is the caller graph for this function:


Variable Documentation

Epoints EP[ENTRYMAX] [static]

Definition at line 63 of file link.c.

Referenced by dynload(), dynload_(), GetDynFunc(), Sci_Delsym(), Sci_dlsym(), SciLink(), SciLinkInit(), SearchFandS(), SearchInDynLinks(), and ShowDynLinks().

Hd hd[ENTRYMAX] [static]

Definition at line 61 of file link.c.

Referenced by Sci_Delsym(), Sci_dlopen(), Sci_dlsym(), SciLink(), SciLinkInit(), ShowDynLinks(), and ulinkall().

int NEpoints = 0 [static]

Definition at line 64 of file link.c.

Referenced by Sci_Delsym(), Sci_dlsym(), and SciLink().

int Nshared = 0 [static]

Definition at line 62 of file link.c.

Referenced by addinter(), C2F(), Sci_Delsym(), Sci_dlopen(), SciLibLoad(), and SciLink().


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