GRASS 8 Programmer's Manual 8.6.0dev(2026)-8843f13794
Loading...
Searching...
No Matches
color_rules.c File Reference

GIS Library - Color tables management subroutines. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <grass/gis.h>
#include <grass/glocale.h>
Include dependency graph for gis/color_rules.c:

Go to the source code of this file.

Functions

charG_color_rules_options (void)
 Get list of color rules for Option->options.
 
charG_color_rules_descriptions (void)
 Get color rules description for Option->descriptions.
 
charG_color_rules_description_type (void)
 Get color rules description for Option->descriptions.
 
void G_list_color_rules (FILE *out)
 Print color rules.
 
void G_list_color_rules_description_type (FILE *out, char *name)
 Print color rules with description and type.
 
int G_find_color_rule (const char *name)
 Check if color rule is defined.
 

Detailed Description

GIS Library - Color tables management subroutines.

Taken from r.colors module.

SPDX-FileCopyrightText: 2001-2011 GRASS Development Team SPDX-License-Identifier: GPL-2.0-or-later

Definition in file gis/color_rules.c.

Function Documentation

◆ G_color_rules_description_type()

char * G_color_rules_description_type ( void  )

Get color rules description for Option->descriptions.

The type of color rule including range is appended to the description

Returns
allocated buffer with name, description, and type

Definition at line 125 of file gis/color_rules.c.

References G_malloc, G_realloc, and name.

Referenced by G_define_standard_option().

◆ G_color_rules_descriptions()

char * G_color_rules_descriptions ( void  )

Get color rules description for Option->descriptions.

Returns
allocated buffer with descriptions

Definition at line 80 of file gis/color_rules.c.

References _, G_malloc, G_realloc, and name.

◆ G_color_rules_options()

char * G_color_rules_options ( void  )

Get list of color rules for Option->options.

Returns
allocated string buffer with options

Definition at line 41 of file gis/color_rules.c.

References G_realloc, name, and NULL.

Referenced by G_define_standard_option().

◆ G_find_color_rule()

int G_find_color_rule ( const char name)

Check if color rule is defined.

Parameters
namecolor rule name
Returns
1 found
0 not found

Definition at line 247 of file gis/color_rules.c.

References AMI_STREAM< T >::name(), name, and NULL.

◆ G_list_color_rules()

void G_list_color_rules ( FILE out)

Print color rules.

Parameters
outfile where to print

Definition at line 176 of file gis/color_rules.c.

References name.

◆ G_list_color_rules_description_type()

void G_list_color_rules_description_type ( FILE out,
char name 
)

Print color rules with description and type.

The type of color rule including range is appended to the description. If a color rule name is given, color info is printed only for this rule.

Parameters
nameoptional color rule name, or NULL
outfile where to print

Definition at line 199 of file gis/color_rules.c.

References AMI_STREAM< T >::name(), name, and NULL.