Skip to content

Commit

Permalink
Merge db52d43 into 20e5610
Browse files Browse the repository at this point in the history
  • Loading branch information
kbevers committed Mar 8, 2018
2 parents 20e5610 + db52d43 commit fadc8f4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions docs/source/development/reference/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,13 @@ Change the error-state of :c:data:`P` to `err`.
:param PJ* P: Transformation object.
:param int err: Error code.
.. c:function:: const char* proj_errno_string(int err)
Get a text representation of an error number.
:param int err: Error number.
:returns: :c:type:`const char*` String with description of error.
Info functions
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Expand Down
9 changes: 7 additions & 2 deletions src/pj_strerrno.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/* list of projection system pj_errno values */
#include "projects.h"
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include "proj.h"
#include "projects.h"

static const char * const
static const char * const
pj_err_list[] = {
"no arguments in initialization list", /* -1 */
"no options found in 'init' file", /* -2 */
Expand Down Expand Up @@ -96,3 +97,7 @@ char *pj_strerrno(int err) {
sprintf( note, "invalid projection system error (%d)", (err > -9999)? err: -9999);
return note;
}

const char* proj_errno_string(int err) {
return pj_strerrno(err);
}
1 change: 1 addition & 0 deletions src/proj.h
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ int proj_errno (const PJ *P);
int proj_errno_set (const PJ *P, int err);
int proj_errno_reset (const PJ *P);
int proj_errno_restore (const PJ *P, int err);
const char* proj_errno_string (int err);

/* Scaling and angular distortion factors */
PJ_FACTORS proj_factors(PJ *P, PJ_COORD lp);
Expand Down

0 comments on commit fadc8f4

Please sign in to comment.