diff options
Diffstat (limited to 'src/map/if/ifLibBox.c')
-rw-r--r-- | src/map/if/ifLibBox.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/map/if/ifLibBox.c b/src/map/if/ifLibBox.c index f420cf36..9423d4f9 100644 --- a/src/map/if/ifLibBox.c +++ b/src/map/if/ifLibBox.c @@ -20,6 +20,7 @@ #include "if.h" #include "misc/extra/extra.h" +#include "base/main/main.h" ABC_NAMESPACE_IMPL_START @@ -359,6 +360,37 @@ void If_LibBoxWrite( char * pFileName, If_LibBox_t * p ) fclose( pFile ); } +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +int If_LibBoxLoad( char * pFileName ) +{ + FILE * pFile; + If_LibBox_t * pLib; + char * pFileNameOther; + // check if library can be read + pFileNameOther = Extra_FileNameGenericAppend( pFileName, ".cdl" ); + pFile = fopen( pFileNameOther, "r" ); + if ( pFile == NULL ) + return 0; + fclose( pFile ); + // read library + pLib = If_LibBoxRead2( pFileNameOther ); + // replace the current library + If_LibBoxFree( (If_LibBox_t *)Abc_FrameReadLibBox() ); + Abc_FrameSetLibBox( pLib ); + return 1; +} + + //////////////////////////////////////////////////////////////////////// /// END OF FILE /// //////////////////////////////////////////////////////////////////////// |