|
From: Frank V. C. <fr...@us...> - 2000-11-21 16:26:07
|
Update of /cvsroot/corelinux/clfll/src/clfll In directory slayer.i.sourceforge.net:/tmp/cvs-serv5190/src/clfll Modified Files: FunctionLibraryInstance.cpp FunctionLibraryObject.cpp Log Message: 112702 FunctionLibraryLoad Index: FunctionLibraryInstance.cpp =================================================================== RCS file: /cvsroot/corelinux/clfll/src/clfll/FunctionLibraryInstance.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** FunctionLibraryInstance.cpp 2000/11/20 05:26:35 1.1 --- FunctionLibraryInstance.cpp 2000/11/21 16:26:04 1.2 *************** *** 47,50 **** --- 47,51 ---- { #include <dlfcn.h> + #include <string.h> } *************** *** 151,159 **** if( anObject != NULLPTR && anObject->getFunctionPointer() == NULLPTR ) { ! CharPtr anError( NULLPTR ); ! VoidPtr anAddress( NULLPTR ); - anAddress = dlsym( theLibraryHandle, aObjName ); - if( (anError = dlerror()) != NULLPTR ) { --- 152,165 ---- if( anObject != NULLPTR && anObject->getFunctionPointer() == NULLPTR ) { ! CharPtr anError( NULLPTR ); ! VoidPtr anAddress( NULLPTR ); ! CharPtr aLibrarySymbol( getAlternateSymbol(anObject) ); ! ! anAddress = dlsym ! ( ! theLibraryHandle, ! (aLibrarySymbol == NULLPTR ? aObjName : aLibrarySymbol) ! ); if( (anError = dlerror()) != NULLPTR ) { *************** *** 189,192 **** --- 195,236 ---- LibraryObjectRegistry::returnObject( this, anObject ); } + } + + // + // Get the library symbol + // + + CharPtr FunctionLibraryInstance::getAlternateSymbol + ( + FunctionLibraryObjectPtr aObject + ) + { + CharPtr *alternate( NULLPTR ); + MetaTypePtr aType( aObject->getType() ); + + Iterator<MemberDescriptorPtr>* + aIterator( aType->createMemberIterator() ); + + while( alternate == NULLPTR && aIterator->isValid() ) + { + if( strcmp + ( + aIterator->getElement()->theTypeVariableName, + "LibrarySymbol" + ) == 0 ) + { + alternate = (CharPtr*) aType->get( "LibrarySymbol", aObject ); + } + else + { + ; // do nothing + } + + aIterator->setNext(); + } + + aType->destroyIterator( aIterator ); + + return *alternate; } Index: FunctionLibraryObject.cpp =================================================================== RCS file: /cvsroot/corelinux/clfll/src/clfll/FunctionLibraryObject.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** FunctionLibraryObject.cpp 2000/11/20 05:26:35 1.1 --- FunctionLibraryObject.cpp 2000/11/21 16:26:04 1.2 *************** *** 81,90 **** OPEN_METATYPE_PARENTS( FunctionLibraryObject ) ! DEFINE_METATYPE_PARENT( LibraryObject ) ! CLOSE_METATYPE_PARENT; // We define our properties data descriptors ! DEFINE_INSTANCEDATA_DESCRIPTOR(FunctionLibraryObject,Handle,FunctionPointer); // We construct the values references --- 81,95 ---- OPEN_METATYPE_PARENTS( FunctionLibraryObject ) ! DEFINE_METATYPE_PARENT( LibraryObject ) ! CLOSE_METATYPE_PARENT; // We define our properties data descriptors ! DEFINE_INSTANCEDATA_DESCRIPTOR ! ( ! FunctionLibraryObject, ! Handle, ! FunctionPointer ! ); // We construct the values references |