23#if defined(HAVE_LANGINFO_H)
26#if defined(__MINGW32__) && defined(USE_NLS)
27#include <localcharset.h>
37#include "parser_local_proto.h"
40static const char *src_enc;
49static void print_escaped_for_xml(
FILE *fp,
const char *str)
56 char *src = (
char *)str;
108 const char *encoding =
NULL;
117#if defined(HAVE_LANGINFO_H)
119#elif defined(_WIN32) && defined(USE_NLS)
123 if (!encoding ||
strlen(encoding) == 0)
136 fprintf(
stdout,
"<?xml version=\"1.0\" encoding=\"%s\"?>\n", encoding);
137 fprintf(
stdout,
"<!DOCTYPE task SYSTEM \"grass-interface.dtd\">\n");
141 if (
st->module_info.label) {
143 print_escaped_for_xml(
stdout,
st->module_info.label);
147 if (
st->module_info.description) {
149 print_escaped_for_xml(
stdout,
st->module_info.description);
153 if (
st->module_info.keywords) {
169 opt = &
st->first_option;
191 "multiple=\"%s\">\n",
192 opt->key, type,
opt->required ==
YES ?
"yes" :
"no",
193 opt->multiple ==
YES ?
"yes" :
"no");
197 print_escaped_for_xml(
stdout,
opt->label);
201 if (
opt->description) {
203 print_escaped_for_xml(
stdout,
opt->description);
212 for (i = 1; s !=
NULL; i++) {
214 print_escaped_for_xml(
stdout, s);
222 if (
opt->gisprompt) {
223 const char *
atts[] = {
"age",
"element",
"prompt",
NULL};
249 while (
opt->opts[i]) {
252 print_escaped_for_xml(
stdout,
opt->opts[i]);
254 if (
opt->descs &&
opt->opts[i] &&
opt->descs[i]) {
256 print_escaped_for_xml(
stdout,
opt->descs[i]);
264 if (
opt->guisection) {
266 print_escaped_for_xml(
stdout,
opt->guisection);
269 if (
opt->guidependency) {
271 print_escaped_for_xml(
stdout,
opt->guidependency);
295 if (
flag->suppress_required)
298 if (
flag->description) {
300 print_escaped_for_xml(
stdout,
flag->description);
303 if (
flag->guisection) {
305 print_escaped_for_xml(
stdout,
flag->guisection);
326 print_escaped_for_xml(
327 stdout,
_(
"Allow output files to overwrite existing files"));
335 print_escaped_for_xml(
stdout,
_(
"Print usage summary"));
342 print_escaped_for_xml(
stdout,
_(
"Verbose module output"));
349 print_escaped_for_xml(
stdout,
_(
"Quiet module output"));
const char * G_program_name(void)
Return module name.
void G_free(void *)
Free allocated memory.
void G__print_keywords(FILE *fd, void(*format)(FILE *, const char *), int newline)
Print list of keywords (internal use only)
int G__uses_new_gisprompt(void)
void G__describe_option_rules_xml(FILE *fp)
Describe option rules in XML format (internal use only)
void G__usage_xml(void)
Print module usage description in XML format.
Structure that stores flag info.
Structure that stores option information.