Loading...
Searching...
No Matches
parser_md_common.c File Reference

GIS Library - Argument parsing functions (Markdown output). More...

`#include <stdio.h>`
`#include <string.h>`
`#include <grass/gis.h>`
`#include <grass/glocale.h>`
`#include "parser_local_proto.h"`
Include dependency graph for parser_md_common.c:

Go to the source code of this file.

## Macros

#define | do_escape(c, escaped)
| Format text for Markdown output.

## Functions

void | G__md_print_escaped (FILE *f, const char *str, const char *indent)
void | G__md_print_escaped_for_options (FILE *f, const char *str)
int | G__option_num_tuple_items (const struct Option *opt)
| Get number of tuple items if option is a tuple.

## Detailed Description

GIS Library - Argument parsing functions (Markdown output).

(C) 2023-2025 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
  Martin Landa

Definition in file parser_md_common.c.

## Macro Definition Documentation

## do_escape

#define do_escape | ( |  | c,
|  |  | escaped )

Value:
case c: \
fputs(escaped, f); \
break

Format text for Markdown output.

Definition at line 24 of file parser_md_common.c.

Referenced by G__md_print_escaped_for_options().

## Function Documentation

## G__md_print_escaped()

void G__md_print_escaped | ( | FILE * | f,
|  | const char * | str,
|  | const char * | indent )

Definition at line 29 of file parser_md_common.c.

Referenced by G__md_print_python_long_version(), and G__md_print_python_short_version().

## G__md_print_escaped_for_options()

void G__md_print_escaped_for_options | ( | FILE * | f,
|  | const char * | str )

Definition at line 56 of file parser_md_common.c.

References do_escape.

## G__option_num_tuple_items()

int G__option_num_tuple_items | ( | const struct Option * | opt | ) |

Get number of tuple items if option is a tuple.

Note that parser code generally does not consider tuples with only one item, so this function never returns 1.

The number of items is determined by counting commas in the option key description.

Parameters

  opt | Option definition

Returns
  Number of items or zero if not a tuple

Definition at line 86 of file parser_md_common.c.

Referenced by G__md_print_python_short_version().