Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/source/development/reference/functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,15 @@ 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.

.. note:: Available from version 5.1.0.

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