SASC
DVBSoftCAM

cScDll Class Reference

Inheritance diagram for cScDll:

List of all members.

Public Member Functions

 cScDll (const char *FileName)
 ~cScDll ()
bool Load (bool check)
 cScDll (const char *FileName)
 ~cScDll ()
bool Load (bool check)

Detailed Description

Definition at line 1062 of file sc.c.


Constructor & Destructor Documentation

cScDll::cScDll ( const char *  FileName)

Definition at line 1072 of file sc.c.

{
  fileName=strdup(FileName);
  handle=0;
}
cScDll::~cScDll ( )

Definition at line 1078 of file sc.c.

References dlclose(), and free.

{
  if(handle) dlclose(handle);
  free(fileName);
}
cScDll::cScDll ( const char *  FileName)
cScDll::~cScDll ( )

Member Function Documentation

bool cScDll::Load ( bool  check)

Definition at line 1084 of file sc.c.

References dlerror(), dlopen(), dlsym(), L_CORE_DYN, L_GEN_ERROR, PRINTF, and SCAPIVERS.

Referenced by cScDlls::Load().

{
  char *base=rindex(fileName,'/');
  if(base) base++; else base=fileName;
  PRINTF(L_CORE_DYN,"loading library: %s",base);
  if(!handle) {
    handle=dlopen(fileName,RTLD_NOW|(check?RTLD_LOCAL:RTLD_GLOBAL));
    if(handle) {
      if(!check) return true;
      dlerror();
      int *libapivers=(int *)dlsym(handle,"ScLibApiVersion");
      const char *error=dlerror();
      if(!error && *libapivers==SCAPIVERS) return true;
      else PRINTF(L_GEN_ERROR,"dload: %s: SCAPI version doesn't match (plugin=%d, library=%d)",base,SCAPIVERS,!error?*libapivers:0);
      }
    else PRINTF(L_GEN_ERROR,"dload: %s: %s",base,dlerror());
    }
  return false;
}
bool cScDll::Load ( bool  check)

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines