mb_load_compiled |
![]() ![]() |
status_t mb_load_compiled( mb_interpreter_t* s, const char* l, int nLen )
Loads a compiled file into the interpreter. This function is usually called from mb_load_file or mb_load_file_ex and should normally not be called from host applications.
Example
fp = fopen( pFileName, "rb" );
if ( fp ) { curpos = ftell( fp ); fseek( fp, 0L, SEEK_END ); len = ftell( fp ); fseek( fp, curpos, SEEK_SET ); buf = (char*)mb_malloc( (size_t)(len + 1) ); fread( buf, 1, len, fp ); fclose( fp ); buf[len] = '\0';
if ( ( stricmp( buf, _MB_SIGNATURE ) == 0 ) && ( buf[strlen( buf )+4] == _VER_MAJOR ) ) { // Load Compiled File result = mb_load_compiled( s, buf, len ); . . . } fclose( fp ); } |