GRASS GIS 8 Programmer's Manual  8.5.0dev(2025)-299a28a7d0
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. More...
 

Functions

void G__md_print_escaped (FILE *f, const char *str)
 
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. More...
 

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.

Function Documentation

◆ G__md_print_escaped()

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

Definition at line 29 of file parser_md_common.c.

Referenced by 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 46 of file parser_md_common.c.

◆ 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
optOption definition
Returns
Number of items or zero if not a tuple

Definition at line 76 of file parser_md_common.c.

References Option::key_desc.

Referenced by G__md_print_python_short_version().