vips_init() comes back

we need a public function for bindings
This commit is contained in:
John Cupitt 2014-08-29 13:51:03 +01:00
parent 43eddbef7a
commit f8f288c1a6
6 changed files with 28 additions and 11 deletions

View File

@ -2,6 +2,7 @@
- start working on --disable-deprecated
- fix pngload with libpng >1.6.1
- add vips_resize()
- return of vips_init(), but just for bindings
21/8/14 started 7.40.7
- width and height were swapped in matlab load

View File

@ -422,7 +422,7 @@ im_init( const char *filename )
int
im_init_world( const char *argv0 )
{
return( vips__init( argv0 ) );
return( vips_init( argv0 ) );
}
/* Prettyprint various header fields. Just for vips7 compat, use
@ -5347,3 +5347,11 @@ im_insertset( IMAGE *main, IMAGE *sub, IMAGE *out, int n, int *x, int *y )
return( 0 );
}
/* We had this entry point in earlier libvipses, hilariously.
*/
int
vips__init( const char *argv0 )
{
return( vips_init( argv0 ) );
}

View File

@ -56,7 +56,7 @@ extern "C" {
*/
#define VIPS_SIZEOF_HEADER (64)
/* Startup plus ABI check.
/* Startup ABI check.
*/
int vips__init( const char *argv0 );
size_t vips__get_sizeof_vipsobject( void );

View File

@ -175,7 +175,9 @@ extern "C" {
sizeof( VipsObject ) ), \
vips_error( "vips_init", "ABI mismatch" ), \
-1 ) : \
vips__init( ARGV0 ))
vips_init( ARGV0 ))
int vips_init( const char *argv0 );
const char *vips_get_argv0( void );
void vips_shutdown( void );

View File

@ -266,10 +266,6 @@ vips_image_new_mode( const char *filename, const char *mode );
int im_init_world( const char *argv0 );
/* We used to have this in lowercase.
*/
#define vips_init(X) VIPS_INIT(X)
VipsImage *im_open( const char *filename, const char *mode );
VipsImage *im_open_local( VipsImage *parent,

View File

@ -166,12 +166,22 @@ vips_get_argv0( void )
* Returns: 0 on success, -1 otherwise
*/
/* vips_init() is a macro which checks library and application
* compatibility before calling vips__init().
/**
* vips_init:
* @argv0: name of application
*
* This function starts up libvips, see VIPS_INIT().
*
* This function is for bindings which need to start up vips. C programs
* should use the VIPS_INIT() macro, which does some extra checks.
*
* See also: VIPS_INIT().
*
* Returns: 0 on success, -1 otherwise
*/
int
vips__init( const char *argv0 )
vips_init( const char *argv0 )
{
extern GType vips_system_get_type( void );
@ -349,7 +359,7 @@ vips_check_init( void )
* for old programs which are missing an vips_init() call. We need
* i18n set up before we can translate.
*/
if( vips__init( "vips" ) )
if( vips_init( "vips" ) )
vips_error_clear();
}