int teakey[4] = {1,2,3,4}; NPK_PACKAGE pack; NPK_ENTITY entity; size_t size; void* buf; pack = npk_package_open( "foo.npk", teakey ); entity = npk_package_get_entity( pack, "bar.jpg" ); size = npk_entity_get_size( entity ); buf = malloc( size ); npk_entity_read( entity, buf ); free( buf ); npk_package_close( pack );
int teakey[4] = {1,2,3,4}; NPK_PACKAGE pack; NPK_ENTITY entity; npk_package_alloc( &pack, teakey ); npk_package_add_file( pack, "/tmp/bar.jpg", "bar.jpg", &entity ); npk_package_save( pack, "foo.npk", true ); npk_package_close( pack );
int teakey[4] = {1,2,3,4}; NPK_PACKAGE pack; NPK_ENTITY entity; pack = npk_package_open( "foo.npk", teakey ); entity = npk_package_get_entity( pack, "bar.jpg" ); npk_entity_export( entity, "newbar.jpg", true ); npk_package_close( pack );
There was an error while loading. Please reload this page.