Skip to content

Commit d7d5315

Browse files
dhdeangelisNishantBansal2003
authored andcommitted
docs: v.to.3d.html minor edits (OSGeo#4787)
1 parent a6e03d3 commit d7d5315

15 files changed

Lines changed: 666 additions & 12 deletions

File tree

include/Make/Docs.make

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ docs_dirs = \
1919
lib/raster3d \
2020
lib/gis \
2121
lib/gmath \
22+
lib/gparson \
2223
lib/gpde \
2324
lib/proj \
2425
lib/ogsf \

include/Make/Grass.make

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ libs = \
133133
RASTER3D:g3d \
134134
GIS:gis \
135135
GMATH:gmath \
136+
GPARSON:gparson \
136137
GPDE:gpde \
137138
GPROJ:gproj \
138139
GRAPH:dgl \
@@ -199,6 +200,7 @@ FORMDEPS = $(DBMILIB) $(GISLIB)
199200
RASTER3DDEPS = $(RASTERLIB) $(GISLIB)
200201
GISDEPS = $(DATETIMELIB) $(ZLIBLIBPATH) $(ZLIB) $(BZIP2LIBPATH) $(BZIP2LIB) $(ZSTDLIBPATH) $(ZSTDLIB) $(INTLLIB) $(REGEXLIBPATH) $(REGEXLIB) $(ICONVLIB) $(PTHREADLIBPATH) $(PTHREADLIB) $(MATHLIB)
201202
GMATHDEPS = $(GISLIB) $(FFTWLIB) $(LAPACKLIB) $(BLASLIB) $(CCMATHLIB) $(OPENMP_CFLAGS) $(OPENMP_LIBPATH) $(OPENMP_LIB)
203+
GPARSONDEPS = $(PARSONLIB)
202204
GPDEDEPS = $(RASTER3DLIB) $(RASTERLIB) $(GISLIB) $(GMATHLIB) $(OPENMP_LIBPATH) $(OPENMP_LIB) $(MATHLIB)
203205
GPROJDEPS = $(GISLIB) $(GDALLIBS) $(PROJLIB) $(MATHLIB)
204206
HTMLDRIVERDEPS = $(DRIVERLIB) $(GISLIB) $(MATHLIB)

include/grass/defs/gparson.h

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#ifndef GRASS_GPARSONDEFS_H
2+
#define GRASS_GPARSONDEFS_H
3+
4+
#include <grass/parson.h>
5+
/* *************************************************************** */
6+
/* ***** WRAPPER FOR PARSON FUNCTIONS USED IN GRASS ************** */
7+
/* *************************************************************** */
8+
9+
/* Serialization Functions */
10+
extern char *G_json_serialize_to_string_pretty(const JSON_Value *);
11+
extern void G_json_free_serialized_string(char *);
12+
13+
/* JSON Value Creation and Freeing */
14+
extern JSON_Value *G_json_value_init_object(void);
15+
extern JSON_Value *G_json_value_init_array(void);
16+
extern JSON_Value *G_json_value_init_string(const char *);
17+
extern JSON_Value *G_json_value_init_number(double);
18+
extern JSON_Value *G_json_value_init_boolean(int);
19+
extern void G_json_value_free(JSON_Value *);
20+
21+
/* JSON Object Access Functions */
22+
extern JSON_Object *G_json_value_get_object(const JSON_Value *);
23+
extern JSON_Object *G_json_object(const JSON_Value *);
24+
extern JSON_Object *G_json_object_get_object(const JSON_Object *, const char *);
25+
extern JSON_Array *G_json_object_get_array(const JSON_Object *, const char *);
26+
extern JSON_Value *G_json_object_get_value(const JSON_Object *, const char *);
27+
extern const char *G_json_object_get_string(const JSON_Object *, const char *);
28+
extern double G_json_object_get_number(const JSON_Object *, const char *);
29+
extern int G_json_object_get_boolean(const JSON_Object *, const char *);
30+
extern JSON_Value *G_json_object_get_wrapping_value(const JSON_Object *);
31+
32+
/* JSON Object Modification Functions */
33+
extern JSON_Status G_json_object_set_value(JSON_Object *, const char *,
34+
JSON_Value *);
35+
extern JSON_Status G_json_object_set_string(JSON_Object *, const char *,
36+
const char *);
37+
extern JSON_Status G_json_object_set_number(JSON_Object *, const char *,
38+
double);
39+
extern JSON_Status G_json_object_set_boolean(JSON_Object *, const char *, int);
40+
extern JSON_Status G_json_object_set_null(JSON_Object *, const char *);
41+
extern JSON_Status G_json_object_dotset_string(JSON_Object *, const char *,
42+
const char *);
43+
extern JSON_Status G_json_object_dotset_number(JSON_Object *, const char *,
44+
double);
45+
46+
/* JSON Array Functions */
47+
extern JSON_Array *G_json_array(const JSON_Value *);
48+
extern JSON_Value *G_json_array_get_value(const JSON_Array *, size_t);
49+
extern JSON_Status G_json_array_append_value(JSON_Array *, JSON_Value *);
50+
extern JSON_Status G_json_array_append_string(JSON_Array *, const char *);
51+
extern JSON_Status G_json_array_append_number(JSON_Array *, double);
52+
extern JSON_Status G_json_array_append_boolean(JSON_Array *, int);
53+
extern JSON_Status G_json_array_append_null(JSON_Array *);
54+
55+
#endif /* GRASS_GPARSONDEFS_H */

include/grass/gparson.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/******************************************************************************
2+
* gparson.h
3+
* Top level header file for gparson units
4+
5+
* This file is part of GRASS GIS. It is free software. You can
6+
* redistribute it and/or modify it under the terms of
7+
* the GNU General Public License as published by the Free Software
8+
* Foundation; either version 2 of the License, or (at your option)
9+
* any later version.
10+
11+
* This program is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
16+
******************************************************************************/
17+
18+
#ifndef GRASS_GPARSON_H
19+
#define GRASS_GPARSON_H
20+
21+
#include <grass/defs/gparson.h>
22+
23+
#endif /* GRASS_GPARSON_H */

lib/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ SUBDIRS = \
1010
proj \
1111
raster \
1212
gmath \
13+
gparson \
1314
linkm \
1415
driver \
1516
pngdriver \

lib/gparson/Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
MODULE_TOPDIR = ../..
2+
3+
LIB = GPARSON
4+
5+
include $(MODULE_TOPDIR)/include/Make/Lib.make
6+
include $(MODULE_TOPDIR)/include/Make/Doxygen.make
7+
8+
default: lib
9+
10+
#doxygen:
11+
DOXNAME=gparson

lib/gparson/parson_grass_wrapper.c

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
/*****************************************************************************
2+
*
3+
* MODULE: Grass json output interface
4+
*
5+
* PURPOSE: parson library function wrapper
6+
* part of the gparson library
7+
*
8+
* COPYRIGHT: (C) 2010 by the GRASS Development Team
9+
*
10+
* This program is free software under the GNU General Public
11+
* License (>=v2). Read the file COPYING that comes with GRASS
12+
* for details.
13+
*
14+
*****************************************************************************/
15+
16+
#if defined(HAVE_PARSON)
17+
#include <parson.h>
18+
#else
19+
#include <grass/parson.h>
20+
#endif
21+
22+
/* *************************************************************** */
23+
/* ***** WRAPPER FOR PARSON FUNCTIONS USED IN GRASS ************** */
24+
/* *************************************************************** */
25+
26+
/* Serialization Functions */
27+
char *G_json_serialize_to_string_pretty(const JSON_Value *value)
28+
{
29+
return json_serialize_to_string_pretty(value);
30+
}
31+
32+
void G_json_free_serialized_string(char *string)
33+
{
34+
json_free_serialized_string(string);
35+
}
36+
37+
/* JSON Object Access Functions */
38+
JSON_Value *G_json_object_get_value(const JSON_Object *object, const char *name)
39+
{
40+
return json_object_get_value(object, name);
41+
}
42+
43+
const char *G_json_object_get_string(const JSON_Object *object,
44+
const char *name)
45+
{
46+
return json_object_get_string(object, name);
47+
}
48+
49+
JSON_Object *G_json_object_get_object(const JSON_Object *object,
50+
const char *name)
51+
{
52+
return json_object_get_object(object, name);
53+
}
54+
55+
JSON_Array *G_json_object_get_array(const JSON_Object *object, const char *name)
56+
{
57+
return json_object_get_array(object, name);
58+
}
59+
60+
double G_json_object_get_number(const JSON_Object *object, const char *name)
61+
{
62+
return json_object_get_number(object, name);
63+
}
64+
65+
int G_json_object_get_boolean(const JSON_Object *object, const char *name)
66+
{
67+
return json_object_get_boolean(object, name);
68+
}
69+
70+
JSON_Value *G_json_object_get_wrapping_value(const JSON_Object *object)
71+
{
72+
return json_object_get_wrapping_value(object);
73+
}
74+
75+
/* JSON Object Modification Functions */
76+
JSON_Status G_json_object_set_value(JSON_Object *object, const char *name,
77+
JSON_Value *value)
78+
{
79+
return json_object_set_value(object, name, value);
80+
}
81+
82+
JSON_Status G_json_object_set_string(JSON_Object *object, const char *name,
83+
const char *string)
84+
{
85+
return json_object_set_string(object, name, string);
86+
}
87+
88+
JSON_Status G_json_object_set_number(JSON_Object *object, const char *name,
89+
double number)
90+
{
91+
return json_object_set_number(object, name, number);
92+
}
93+
94+
JSON_Status G_json_object_set_boolean(JSON_Object *object, const char *name,
95+
int boolean)
96+
{
97+
return json_object_set_boolean(object, name, boolean);
98+
}
99+
100+
JSON_Status G_json_object_set_null(JSON_Object *object, const char *name)
101+
{
102+
return json_object_set_null(object, name);
103+
}
104+
105+
JSON_Status G_json_object_dotset_string(JSON_Object *object, const char *name,
106+
const char *string)
107+
{
108+
return json_object_dotset_string(object, name, string);
109+
}
110+
111+
JSON_Status G_json_object_dotset_number(JSON_Object *object, const char *name,
112+
double number)
113+
{
114+
return json_object_dotset_number(object, name, number);
115+
}
116+
117+
/* JSON Array Functions */
118+
JSON_Status G_json_array_append_value(JSON_Array *array, JSON_Value *value)
119+
{
120+
return json_array_append_value(array, value);
121+
}
122+
123+
JSON_Status G_json_array_append_string(JSON_Array *array, const char *string)
124+
{
125+
return json_array_append_string(array, string);
126+
}
127+
128+
JSON_Status G_json_array_append_number(JSON_Array *array, double number)
129+
{
130+
return json_array_append_number(array, number);
131+
}
132+
133+
JSON_Status G_json_array_append_boolean(JSON_Array *array, int boolean)
134+
{
135+
return json_array_append_boolean(array, boolean);
136+
}
137+
138+
JSON_Status G_json_array_append_null(JSON_Array *array)
139+
{
140+
return json_array_append_null(array);
141+
}
142+
143+
/* JSON Value Creation and Freeing */
144+
JSON_Value *G_json_value_init_object(void)
145+
{
146+
return json_value_init_object();
147+
}
148+
149+
JSON_Object *G_json_value_get_object(const JSON_Value *value)
150+
{
151+
return json_value_get_object(value);
152+
}
153+
154+
JSON_Object *G_json_object(const JSON_Value *value)
155+
{
156+
return json_object(value);
157+
}
158+
159+
JSON_Array *G_json_array(const JSON_Value *value)
160+
{
161+
return json_array(value);
162+
}
163+
164+
JSON_Value *G_json_array_get_value(const JSON_Array *array, size_t index)
165+
{
166+
return json_array_get_value(array, index);
167+
}
168+
169+
JSON_Value *G_json_value_init_array(void)
170+
{
171+
return json_value_init_array();
172+
}
173+
174+
JSON_Value *G_json_value_init_string(const char *string)
175+
{
176+
return json_value_init_string(string);
177+
}
178+
179+
JSON_Value *G_json_value_init_number(double number)
180+
{
181+
return json_value_init_number(number);
182+
}
183+
184+
JSON_Value *G_json_value_init_boolean(int boolean)
185+
{
186+
return json_value_init_boolean(boolean);
187+
}
188+
189+
void G_json_value_free(JSON_Value *value)
190+
{
191+
json_value_free(value);
192+
}

lib/gparson/test/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
MODULE_TOPDIR = ../../..
2+
3+
PGM=test.gparson.lib
4+
5+
LIBES = $(PARSONLIB) $(GPARSONLIB) $(GISLIB)
6+
DEPENDENCIES = $(PARSONDEP) $(GPARSONDEP) $(GISDEP)
7+
8+
include $(MODULE_TOPDIR)/include/Make/Module.make
9+
10+
default: cmd
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
3+
Take a look at the module command line help for more information.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*****************************************************************************
2+
*
3+
* MODULE: Grass gparson Library
4+
*
5+
* PURPOSE: Unit tests
6+
*
7+
* COPYRIGHT: (C) 2000 by the GRASS Development Team
8+
*
9+
* This program is free software under the GNU General Public
10+
* License (>=v2). Read the file COPYING that comes with GRASS
11+
* for details.
12+
*
13+
*****************************************************************************/
14+
15+
#ifndef _TEST_GPARSON_LIB_H_
16+
#define _TEST_GPARSON_LIB_H_
17+
18+
#include <grass/gparson.h>
19+
20+
/* parson wrapper tests */
21+
int unit_test_parson_wrapper(void);
22+
23+
#endif

0 commit comments

Comments
 (0)