Changeset a4ff0a0 in tol


Ignore:
Timestamp:
Aug 3, 2010, 10:10:22 AM (16 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
d8f2e4f
Parents:
ae1a7e1d
Message:

Refs #956
Using ad-hoc implementations of new to avoid problems with deleting memory in a dll created with another one
New optional argument libraryName

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@2436 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/LoadDynLib/LoadDynLib.cpp

    rae1a7e1d ra4ff0a0  
    3838typedef void* (*get_nb_t)(void);
    3939
     40
     41//--------------------------------------------------------------------
     42BExternalOperator* NewExternalOperator(
     43  const BText& name,
     44  BGrammar* gra,
     45  const BText& grammars,
     46  BEvaluator evaluator,
     47  BInt min,
     48  BInt max,
     49  const BText& args,
     50  const BText& desc,
     51  BOperClassify* cl       )
     52//--------------------------------------------------------------------
     53{
     54  return(new BExternalOperator(
     55    name,gra,grammars,evaluator,min,max,args,desc,cl));
     56}
     57
     58//--------------------------------------------------------------------
     59BGraContensP<BNameBlock>* NewUserNameBlock()
     60//--------------------------------------------------------------------
     61{
     62  return(new BGraContensP<BNameBlock>("", new BNameBlock));
     63}
     64
    4065//--------------------------------------------------------------------
    4166class BLoadDynLib: public BExternalOperator
    … …  
    4469  BLoadDynLib() : BExternalOperator
    4570  (
    46     "LoadDynLib",GraNameBlock(),"Text", NIL,1,1,
    47     "(Text libraryPath)",
     71    "LoadDynLib",GraNameBlock(),"Text", NIL,1,2,
     72    "(Text libraryPath [, Text libraryName])",
    4873    I2("Returns a NameBlock that contains methods and members written "
    4974    "in C + + in a precompiled library for dynamic linking. Once "
    … …  
    6994  BText& libraryPath = Text(Car(arg));
    7095  BText libraryName = GetFilePrefix(libraryPath); 
     96  if(Cdr(arg))
     97  {
     98    libraryName = Text(Car(Cdr(arg)));
     99  }
    71100  BUserNameBlock* unb = NULL;
    72101  //VBR: Jorge, inserta aquí el código que enlaza con la dll y pon
Note: See TracChangeset for help on using the changeset viewer.