grass  7.8.6
About: GRASS (Geographic Resources Analysis Support System) is a raster- and vector-based GIS, image processing system, graphics production system and spatial modeling system.
  Fossies Dox: grass-7.8.6.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

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 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...
 
static int read_cats (const char *name, const char *mapset, struct Categories *pcats)
 
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 177 of file cats.c.

References G_warning(), name, read_cats(), and type.

◆ 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 27 of file 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.

Referenced by close_new().

◆ read_cats()

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