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

GIS Library - check map name. More...

#include <string.h>
#include <grass/gis.h>
Include dependency graph for nme_in_mps.c:

Go to the source code of this file.

Functions

int G_name_is_fully_qualified (const char *fullname, char *name, char *mapset)
 Check if map name is fully qualified (map @ mapset)
 
charG_fully_qualified_name (const char *name, const char *mapset)
 Get fully qualified element name.
 
int G_unqualified_name (const char *name, const char *mapset, char *xname, char *xmapset)
 Returns unqualified map name (without @ mapset)
 

Detailed Description

GIS Library - check map name.

(C) 2001-2009, 2013 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
Original author CERL

Definition in file nme_in_mps.c.

Function Documentation

◆ G_fully_qualified_name()

char * G_fully_qualified_name ( const char name,
const char mapset 
)

Get fully qualified element name.

Returns a fully qualified name for GIS element name in mapset. Currently this string is in the form name@mapset, but the programmer should pretend not to know this and always call this routine to get the fully qualified name.

String is allocated by G_store().

#include <grass/gis.h>
int main(char *argc, char **argv)
{
char name[GNAME_MAX], *mapset, *fqn;
char command[1024];
mapset = G_find_rast(name, "");
if (mapset == NULL)
printf (stdout, "map='%s'", fqn);
}
#define NULL
Definition ccmath.h:32
char * G_fully_qualified_name(const char *, const char *)
Get fully qualified element name.
Definition nme_in_mps.c:101
#define G_gisinit(pgm)
Definition gis.h:71
#define GNAME_MAX
Definition gis.h:196
const char * name
Definition named_colr.c:6
int main(void)
Definition winlocale.c:201
Parameters
nameelement name
mapsetmapset name
Returns
pointer to full element name (map@mapset)

Definition at line 101 of file nme_in_mps.c.

References G_store(), GMAPSET_MAX, GNAME_MAX, and name.

Referenced by Gp_load_sites(), Gp_load_sites_thematic(), GS_load_att_map(), Gs_loadmap_as_bitmap(), Gs_loadmap_as_char(), Gs_loadmap_as_float(), Gs_loadmap_as_int(), Gs_loadmap_as_short(), Gs_pack_colors(), Gs_pack_colors_float(), Gv_load_vect(), Gv_load_vect_thematic(), I_signatures_copy(), M_do_copy(), Rast__check_fp_type(), Rast__open_old(), Rast__quant_import(), Rast_map_is_fp(), Rast_mask_name(), Rast_put_reclass(), Rast_quantize_fp_map(), Rast_read_fp_range(), Rast_read_range(), and Rast_read_rstats().

◆ G_name_is_fully_qualified()

int G_name_is_fully_qualified ( const char fullname,
char name,
char mapset 
)

Check if map name is fully qualified (map @ mapset)

Returns a fully qualified name for the file name in mapset. Currently this string is in the form name@mapset, but the programmer should pretend not to know this and always call this routine to get the fully qualified name.

Note:

  • name is char array of size GNAME_MAX
  • mapset is char array of size GMAPSET_MAX
Parameters
fullnamefull map name
[out]namemap name
[out]mapsetmapset name
Returns
1 if input map name is fully qualified
0 if input map name is not fully qualified

Definition at line 36 of file nme_in_mps.c.

References name.

Referenced by G_check_input_output_name(), G_rename(), G_unqualified_name(), I_signatures_copy(), I_signatures_remove(), I_signatures_rename(), M_do_remove(), Rast3d_read_region_map(), Rast__quant_export(), Rast__quant_import(), Rast_remove_colors(), Rast_write_colors(), Vect__delete(), Vect__open_old(), Vect_check_input_output_name(), Vect_copy(), Vect_remove_colors(), Vect_rename(), and Vect_write_colors().

◆ G_unqualified_name()

int G_unqualified_name ( const char name,
const char mapset,
char xname,
char xmapset 
)

Returns unqualified map name (without @ mapset)

Returns an unqualified name for the file name in mapset.

Note:

  • name, xname are char array of size GNAME_MAX
  • mapset, xmapset are char array of size GMAPSET_MAX
Parameters
namemap name
mapsetmapset to check or NULL
[out]xnamemap name
[out]xmapsetmapset name
Returns
1 if input map name is fully qualified
0 if name is not fully qualified
-1 if input mapset invalid (mapset != xmapset)

Definition at line 134 of file nme_in_mps.c.

References G_name_is_fully_qualified(), name, and strcpy.

Referenced by I_fopen_signature_file_old(), I_fopen_sigset_file_old(), I_signatures_copy(), Rast3d_open_cell_new(), Rast3d_open_cell_old_no_header(), Rast__open_null_write(), and Rast__open_old().