"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libvips/iofuncs/error.c" between
vips-8.10.6.tar.gz and vips-8.11.0.tar.gz

About: VIPS is a free image processing system (see also the GUI nip2).

error.c  (vips-8.10.6):error.c  (vips-8.11.0)
skipping to change at line 68 skipping to change at line 68
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <vips/vips.h> #include <vips/vips.h>
#include <vips/internal.h> #include <vips/internal.h>
#include <vips/buf.h> #include <vips/buf.h>
#include <vips/thread.h> #include <vips/thread.h>
#include <vips/debug.h> #include <vips/debug.h>
#ifdef OS_WIN32 #ifdef G_OS_WIN32
#include <windows.h> #include <windows.h>
#include <lmerr.h> #include <lmerr.h>
#endif /*OS_WIN32*/ #endif /*G_OS_WIN32*/
/** /**
* SECTION: errors * SECTION: errors
* @short_description: error messages and error handling * @short_description: error messages and error handling
* @stability: Stable * @stability: Stable
* @include: vips/vips.h * @include: vips/vips.h
* *
* VIPS maintains an error buffer (a log of localised text messages), * VIPS maintains an error buffer (a log of localised text messages),
* a set of functions * a set of functions
* for adding messages, and a way to access and clear the buffer. * for adding messages, and a way to access and clear the buffer.
skipping to change at line 203 skipping to change at line 203
* *
* Returns: a copy of the libvips error buffer * Returns: a copy of the libvips error buffer
*/ */
char * char *
vips_error_buffer_copy( void ) vips_error_buffer_copy( void )
{ {
char *msg; char *msg;
g_mutex_lock( vips__global_lock ); g_mutex_lock( vips__global_lock );
msg = g_strdup( vips_buf_all( &vips_error_buf ) ); msg = g_strdup( vips_buf_all( &vips_error_buf ) );
vips_error_clear(); vips_buf_rewind( &vips_error_buf );
g_mutex_unlock( vips__global_lock ); g_mutex_unlock( vips__global_lock );
return( msg ); return( msg );
} }
/* Some systems do not have va_copy() ... this might work (it does on MSVC), /* Some systems do not have va_copy() ... this might work (it does on MSVC),
* apparently. * apparently.
* *
* FIXME ... this should be in configure.in * FIXME ... this should be in configure.in
*/ */
skipping to change at line 297 skipping to change at line 297
* Then create and append a localised message based on the system error code, * Then create and append a localised message based on the system error code,
* usually the value of errno. * usually the value of errno.
* *
* See also: vips_error_system(). * See also: vips_error_system().
*/ */
void void
vips_verror_system( int err, const char *domain, const char *fmt, va_list ap ) vips_verror_system( int err, const char *domain, const char *fmt, va_list ap )
{ {
vips_verror( domain, fmt, ap ); vips_verror( domain, fmt, ap );
#ifdef OS_WIN32 #ifdef G_OS_WIN32
{ {
char *buf; char *buf;
if( FormatMessageA( if( FormatMessageA(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_IGNORE_INSERTS |
FORMAT_MESSAGE_FROM_SYSTEM, FORMAT_MESSAGE_FROM_SYSTEM,
NULL, NULL,
err, err,
MAKELANGID( LANG_NEUTRAL, SUBLANG_DEFAULT ), MAKELANGID( LANG_NEUTRAL, SUBLANG_DEFAULT ),
(LPSTR) &buf, 0, NULL ) ) { (LPSTR) &buf, 0, NULL ) ) {
vips_error( _( "windows error" ), "%s", buf ); vips_error( _( "windows error" ), "%s", buf );
LocalFree( buf ); LocalFree( buf );
} }
} }
#else /*OS_WIN32*/ #else /*!G_OS_WIN32*/
{ {
char *buf; char *buf;
buf = g_locale_to_utf8( strerror( err ), -1, NULL, NULL, NULL ); buf = g_locale_to_utf8( strerror( err ), -1, NULL, NULL, NULL );
vips_error( _( "unix error" ), "%s", buf ); vips_error( _( "unix error" ), "%s", buf );
g_free( buf ); g_free( buf );
} }
#endif /*OS_WIN32*/ #endif /*G_OS_WIN32*/
} }
/** /**
* vips_error_system: * vips_error_system:
* @err: the system error code * @err: the system error code
* @domain: the source of the error * @domain: the source of the error
* @fmt: printf()-style format string for the error * @fmt: printf()-style format string for the error
* @...: arguments to the format string * @...: arguments to the format string
* *
* Format the string in the style of printf() and append to the error buffer. * Format the string in the style of printf() and append to the error buffer.
skipping to change at line 432 skipping to change at line 432
* exiting. * exiting.
* *
* See also: vips_error(). * See also: vips_error().
*/ */
void void
vips_error_exit( const char *fmt, ... ) vips_error_exit( const char *fmt, ... )
{ {
if( fmt ) { if( fmt ) {
va_list ap; va_list ap;
fprintf( stderr, "%s: ", g_get_prgname() ); fprintf( stderr, "%s: ", vips_get_prgname() );
va_start( ap, fmt ); va_start( ap, fmt );
(void) vfprintf( stderr, fmt, ap ); (void) vfprintf( stderr, fmt, ap );
va_end( ap ); va_end( ap );
fprintf( stderr, "\n" ); fprintf( stderr, "\n" );
} }
fprintf( stderr, "%s", vips_error_buffer() ); fprintf( stderr, "%s", vips_error_buffer() );
 End of changes. 7 change blocks. 
7 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)