From 163bcc6f01dca1a51b67f95161544ea0f54fcb82 Mon Sep 17 00:00:00 2001 From: Frank Warmerdam Date: Tue, 30 Apr 2002 16:27:27 +0000 Subject: improve debug output git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1009 4e78687f-474d-0410-85f9-8d5e500ac6b2 --- src/pj_apply_gridshift.c | 17 +++++++++++++++++ src/pj_open_lib.c | 10 ++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/pj_apply_gridshift.c b/src/pj_apply_gridshift.c index 5a9232b7..61a5944b 100644 --- a/src/pj_apply_gridshift.c +++ b/src/pj_apply_gridshift.c @@ -31,6 +31,9 @@ ****************************************************************************** * * $Log$ + * Revision 1.3 2002/04/30 16:27:27 warmerda + * improve debug output + * * Revision 1.2 2001/03/15 16:57:55 warmerda * fixed intermittent problem in pj_load_nadgrids() * @@ -215,7 +218,10 @@ static struct CTABLE **pj_load_nadgrids( const char *nadgrids ) last_nadgrids_list[nadgrids_count] = pj_get_grid( name ); if( last_nadgrids_list[nadgrids_count] == NULL ) + { + pj_errno = -38; return NULL; + } nadgrids_count++; } @@ -259,6 +265,17 @@ int pj_apply_gridshift( const char *nadgrids, int inverse, if( output.lam == HUGE_VAL ) { + if( getenv( "PROJ_DEBUG" ) != NULL ) + { + fprintf( stderr, + "pj_apply_gridshift(): failed to find a grid shift table for\n" + " location (%.7fdW,%.7fdN)\n", + x[io] * RAD_TO_DEG, + y[io] * RAD_TO_DEG ); + fprintf( stderr, + " tried: %s\n", nadgrids ); + } + pj_errno = -38; return pj_errno; } diff --git a/src/pj_open_lib.c b/src/pj_open_lib.c index 488d7234..69031fd3 100644 --- a/src/pj_open_lib.c +++ b/src/pj_open_lib.c @@ -66,11 +66,13 @@ pj_open_lib(char *name, char *mode) { } else /* just try it bare bones */ sysname = name; - if( getenv( "PROJ_DEBUG" ) != NULL ) - fprintf( stderr, "pj_open_lib(%s): call fopen(%s).\n", - name, sysname); - if (fid = fopen(sysname, mode)) errno = 0; + + if( getenv( "PROJ_DEBUG" ) != NULL ) + fprintf( stderr, "pj_open_lib(%s): call fopen(%s) - %s\n", + name, sysname, + fid == NULL ? "failed" : "succeeded" ); + return(fid); } -- cgit v1.2.3