GRASS 8 Programmer's Manual 8.6.0dev(2026)-1878fdfec5
Loading...
Searching...
No Matches
find_vect.c
Go to the documentation of this file.
1/*!
2 \file lib/gis/find_vect.c
3
4 \brief GIS library - Find a vector map
5
6 SPDX-FileCopyrightText: 2001-2009 GRASS Development Team
7 SPDX-License-Identifier: GPL-2.0-or-later
8
9 \author Original author CERL
10 */
11
12#include <string.h>
13
14#include <grass/config.h>
15#include <grass/gis.h>
17#include <grass/glocale.h>
18
19/*!
20 \brief Finds a vector map
21
22 Searches for a vector map from the mapset search list or in a
23 specified mapset. Returns the mapset name where the vector map was
24 found.
25
26 NOTES:
27 If the user specifies a fully qualified vector map which exists,
28 then G_find_vector() modifies <i>name</i> by removing the
29 "@<i>mapset</i>" part.
30
31 Rejects all names that begin with "."
32
33 \param name vector map name
34 \param mapset mapset name or "" for search path
35
36 \return pointer to a string with name of mapset where vector map was found
37 \return NULL if not found
38 */
39const char *G_find_vector(char *name, const char *mapset)
40{
41 G_debug(1, "G_find_vector(): name=%s mapset=%s", name, mapset);
42 return G_find_file(GV_DIRECTORY, name, mapset);
43}
44
45/*!
46 * \brief Find a vector map (look but don't touch)
47 *
48 * The same as G_find_vector() but doesn't remove the "@<i>mapset</i>"
49 * qualification from <i>name</i>, if present.
50 *
51 * Returns NULL if the map wasn't found, or the mapset the vector was
52 * found in if it was.
53 *
54 * \param name vector map name
55 * \param mapset mapset name where to search
56 *
57 * \return pointer to buffer containing mapset name
58 * \return NULL when vector map not found
59 */
60const char *G_find_vector2(const char *name, const char *mapset)
61{
62 G_debug(1, "G_find_vector2(): name=%s mapset=%s", name, mapset);
63 return G_find_file2(GV_DIRECTORY, name, mapset);
64}
const char * G_find_file(const char *, char *, const char *)
Searches for a file from the mapset search list or in a specified mapset.
Definition find_file.c:182
const char * G_find_file2(const char *, const char *, const char *)
Searches for a file from the mapset search list or in a specified mapset. (look but don't touch)
Definition find_file.c:230
int G_debug(int, const char *,...) __attribute__((format(printf
#define GV_DIRECTORY
Name of vector directory.
Definition dig_defines.h:8
const char * G_find_vector2(const char *name, const char *mapset)
Find a vector map (look but don't touch)
Definition find_vect.c:60
const char * G_find_vector(char *name, const char *mapset)
Finds a vector map.
Definition find_vect.c:39
const char * name
Definition named_colr.c:6