GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-b4e4cb0fe9
raster3d/cats.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include <grass/gis.h>
#include <grass/raster.h>
#include "raster3d_intern.h"
Include dependency graph for raster3d/cats.c:

Go to the source code of this file.

Functions

int Rast3d_write_cats (const char *name, struct Categories *cats)
 Writes the categories stored in the cats structure into the categories file for map name in the current mapset. See Rast_write_cats (Raster_Category_File) for details and return values. More...
 
int Rast3d_read_cats (const char *name, const char *mapset, struct Categories *pcats)
 Reads the categories file for map name in mapset and stores the categories in the pcats structure. See Rast_read_cats (Raster_Category_File) for details and return values. More...
 

Function Documentation

◆ Rast3d_read_cats()

int Rast3d_read_cats ( const char *  name,
const char *  mapset,
struct Categories pcats 
)

Reads the categories file for map name in mapset and stores the categories in the pcats structure. See Rast_read_cats (Raster_Category_File) for details and return values.

Parameters
name
mapset
pcats
Returns
int

Definition at line 175 of file raster3d/cats.c.

◆ Rast3d_write_cats()

int Rast3d_write_cats ( const char *  name,
struct Categories cats 
)

Writes the categories stored in the cats structure into the categories file for map name in the current mapset. See Rast_write_cats (Raster_Category_File) for details and return values.

Parameters
name
cats
Returns
int

Definition at line 26 of file raster3d/cats.c.

References Categories::a1, Categories::a2, Categories::fmt, G_fopen_new_misc(), G_trim_decimal(), Categories::m1, Categories::m2, name, NULL, Categories::num, Categories::q, Rast_get_ith_d_cat(), Rast_quant_nof_rules(), RASTER3D_CATS_ELEMENT, RASTER3D_DIRECTORY, and Categories::title.