25#if defined(HAVE_LANGINFO_H)
28#if defined(__MINGW32__) && defined(USE_NLS)
29#include <localcharset.h>
39#include "parser_local_proto.h"
42static const char *src_enc;
51static void print_escaped_for_xml(
FILE *fp,
const char *str)
58 char *src = (
char *)str;
110 const char *encoding =
NULL;
119#if defined(HAVE_LANGINFO_H)
121#elif defined(_WIN32) && defined(USE_NLS)
125 if (!encoding ||
strlen(encoding) == 0)
138 fprintf(
stdout,
"<?xml version=\"1.0\" encoding=\"%s\"?>\n", encoding);
139 fprintf(
stdout,
"<!DOCTYPE task SYSTEM \"grass-interface.dtd\">\n");
143 if (
st->module_info.label) {
145 print_escaped_for_xml(
stdout,
st->module_info.label);
149 if (
st->module_info.description) {
151 print_escaped_for_xml(
stdout,
st->module_info.description);
155 if (
st->module_info.keywords) {
171 opt = &
st->first_option;
193 "multiple=\"%s\">\n",
194 opt->key, type,
opt->required ==
YES ?
"yes" :
"no",
195 opt->multiple ==
YES ?
"yes" :
"no");
199 print_escaped_for_xml(
stdout,
opt->label);
203 if (
opt->description) {
205 print_escaped_for_xml(
stdout,
opt->description);
214 for (i = 1; s !=
NULL; i++) {
216 print_escaped_for_xml(
stdout, s);
224 if (
opt->gisprompt) {
225 const char *
atts[] = {
"age",
"element",
"prompt",
NULL};
251 while (
opt->opts[i]) {
254 print_escaped_for_xml(
stdout,
opt->opts[i]);
256 if (
opt->descs &&
opt->opts[i] &&
opt->descs[i]) {
258 print_escaped_for_xml(
stdout,
opt->descs[i]);
266 if (
opt->guisection) {
268 print_escaped_for_xml(
stdout,
opt->guisection);
271 if (
opt->guidependency) {
273 print_escaped_for_xml(
stdout,
opt->guidependency);
297 if (
flag->suppress_required)
300 if (
flag->description) {
302 print_escaped_for_xml(
stdout,
flag->description);
305 if (
flag->guisection) {
307 print_escaped_for_xml(
stdout,
flag->guisection);
328 print_escaped_for_xml(
329 stdout,
_(
"Allow output files to overwrite existing files"));
337 print_escaped_for_xml(
stdout,
_(
"Print usage summary"));
344 print_escaped_for_xml(
stdout,
_(
"Verbose module output"));
351 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.