-
-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use parson to add json output format support to the v.info module. The module has various flags to control the fields being output in case of plain format. The current prototype ignores the flags and always outputs all data for the JSON output.
- Loading branch information
1 parent
090c5df
commit 9ae3726
Showing
6 changed files
with
328 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
#include <grass/vector.h> | ||
#include <grass/parson.h> | ||
|
||
#define SHELL_NO 0x00 | ||
#define SHELL_BASIC 0x02 | ||
#define SHELL_REGION 0x04 | ||
#define SHELL_TOPO 0x08 | ||
|
||
enum OutputFormat { PLAIN, JSON }; | ||
|
||
/* level1.c */ | ||
int level_one_info(struct Map_info *); | ||
|
||
/* parse.c */ | ||
void parse_args(int, char **, char **, char **, int *, int *, int *); | ||
void parse_args(int, char **, char **, char **, int *, int *, int *, enum OutputFormat *); | ||
|
||
/* print.c */ | ||
void format_double(double, char *); | ||
void print_region(struct Map_info *); | ||
void print_topo(struct Map_info *); | ||
void print_region(struct Map_info *, enum OutputFormat, JSON_Object *); | ||
void print_topo(struct Map_info *, enum OutputFormat, JSON_Object *); | ||
void print_columns(struct Map_info *, const char *, const char *); | ||
void print_info(struct Map_info *); | ||
void print_shell(struct Map_info *, const char *); | ||
void print_shell(struct Map_info *, const char *, enum OutputFormat, JSON_Object *); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.