Skip to content

Commit

Permalink
Add an lwpgwarning function, for those who worry !
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/postgis/trunk@13683 b70326c6-7e19-0410-871a-916f4a2858ee
  • Loading branch information
Sandro Santilli committed Jun 19, 2015
1 parent c530ee4 commit 9515471
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
23 changes: 23 additions & 0 deletions libpgcommon/lwgeom_pg.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,17 @@ pg_error(const char *fmt, va_list ap)
ereport(ERROR, (errmsg_internal("%s", errmsg)));
}

static void
pg_warning(const char *fmt, va_list ap)
{
char errmsg[PGC_ERRMSG_MAXLEN+1];

vsnprintf (errmsg, PGC_ERRMSG_MAXLEN, fmt, ap);

errmsg[PGC_ERRMSG_MAXLEN]='\0';
ereport(WARNING, (errmsg_internal("%s", errmsg)));
}

static void
pg_notice(const char *fmt, va_list ap)
{
Expand Down Expand Up @@ -245,6 +256,18 @@ lwpgnotice(const char *fmt, ...)
va_end(ap);
}

void
lwpgwarning(const char *fmt, ...)
{
va_list ap;

va_start(ap, fmt);

pg_warning(fmt, ap);

va_end(ap);
}

void
lwpgerror(const char *fmt, ...)
{
Expand Down
1 change: 1 addition & 0 deletions libpgcommon/lwgeom_pg.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,5 +172,6 @@ Datum LWGEOM_dropBBOX(PG_FUNCTION_ARGS);

void lwpgerror(const char *fmt, ...);
void lwpgnotice(const char *fmt, ...);
void lwpgwarning(const char *fmt, ...);

#endif /* !defined _LWGEOM_PG_H */

0 comments on commit 9515471

Please sign in to comment.