-
-
Notifications
You must be signed in to change notification settings - Fork 302
/
find.c
41 lines (30 loc) · 827 Bytes
/
find.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*!
\file lib/manage/find.c
\brief Manage Library - Find element in data base
(C) 2001-2011 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
*/
#include <string.h>
#include <grass/gis.h>
#include "manage_local_proto.h"
/*!
\brief Find element in data base
\param n element id
\param name element name
\param mapsets name of mapsets
\return mapset if found
\return if not found
*/
const char *M_find(int n, char *name, const char *mapsets)
{
const char *mapset;
mapset = G_find_file2(list[n].element[0], name, mapsets);
if (mapset) {
char temp[GNAME_MAX];
sscanf(name, "%s", temp);
strcpy(name, temp);
}
return mapset;
}