PostGIS  3.4.0dev-r@@SVN_REVISION@@
postgis_libprotobuf.c
Go to the documentation of this file.
1 #include "postgres.h"
2 #include "utils/builtins.h"
3 #include "../postgis_config.h"
4 #include "lwgeom_pg.h"
5 
6 #ifdef HAVE_LIBPROTOBUF
7 #include <protobuf-c/protobuf-c.h>
8 #include "lwgeom_wagyu.h"
9 #endif
10 
12 Datum postgis_libprotobuf_version(PG_FUNCTION_ARGS)
13 {
14 #ifdef HAVE_LIBPROTOBUF
15  const char *ver = protobuf_c_version();
16  text *result = cstring_to_text(ver);
17  PG_RETURN_POINTER(result);
18 #else
19  PG_RETURN_NULL();
20 #endif
21 }
22 
24 Datum postgis_wagyu_version(PG_FUNCTION_ARGS)
25 {
26 #ifndef HAVE_LIBPROTOBUF
27  PG_RETURN_NULL();
28 #else /* HAVE_LIBPROTOBUF */
29  const char *ver = libwagyu_version();
30  text *result = cstring_to_text(ver);
31  PG_RETURN_POINTER(result);
32 #endif
33 }
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition: cu_print.c:262
Datum postgis_wagyu_version(PG_FUNCTION_ARGS)
Datum postgis_libprotobuf_version(PG_FUNCTION_ARGS)
PG_FUNCTION_INFO_V1(postgis_libprotobuf_version)