GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-3d2c704037
imagery/find.c File Reference
#include <grass/imagery.h>
#include <grass/gis.h>
Include dependency graph for imagery/find.c:

Go to the source code of this file.

Functions

int I_find_group (const char *group)
 does group exist? More...
 
int I_find_group2 (const char *group, const char *mapset)
 Does the group exists? More...
 
int I_find_group_file (const char *group, const char *file)
 Searches for a group file in the current mapset. More...
 
int I_find_group_file2 (const char *group, const char *mapset, const char *file)
 Searches for a group file in the specified mapset. More...
 
int I_find_subgroup (const char *group, const char *subgroup)
 Searches for a subgroup in the current mapset. More...
 
int I_find_subgroup2 (const char *group, const char *subgroup, const char *mapset)
 Searches for a subgroup in specified mapset or any mapset if mapset is not set. More...
 
int I_find_subgroup_file (const char *group, const char *subgroup, const char *file)
 Searches for a subgroup file in the current mapset. More...
 
int I_find_subgroup_file2 (const char *group, const char *subgroup, const char *mapset, const char *file)
 Searches for a subgroup file in the specified mapset. More...
 
const char * I_find_signature (I_SIGFILE_TYPE type, char *name, const char *mapset)
 Find mapset containing signature file. More...
 
const char * I_find_signature2 (I_SIGFILE_TYPE type, const char *name, const char *mapset)
 Find mapset containing signature (look but don't touch) More...
 

Function Documentation

◆ I_find_group()

int I_find_group ( const char *  group)

does group exist?

Returns 1 if the specified group exists in the current mapset; 0 otherwise. Use I_find_group2 to search in all or a specific mapset.

Parameters
group
Returns
int 1 if group was found, 0 otherwise

Definition at line 22 of file imagery/find.c.

References G_find_file2(), G_mapset(), and NULL.

Referenced by I_find_group_file(), I_find_subgroup(), I_find_subgroup_file(), I_get_subgroup(), and I_put_subgroup().

◆ I_find_group2()

int I_find_group2 ( const char *  group,
const char *  mapset 
)

Does the group exists?

Finds a group in specified mapset or any mapset if mapset is not set. Internally uses G_find_file2().

Parameters
group
mapset
Returns
int 1 if group was found, 0 otherwise

Definition at line 41 of file imagery/find.c.

References G_find_file2(), and NULL.

Referenced by I_find_group_file2(), I_find_subgroup2(), I_find_subgroup_file2(), and list_subgroups().

◆ I_find_group_file()

int I_find_group_file ( const char *  group,
const char *  file 
)

Searches for a group file in the current mapset.

Parameters
group
file
Returns
int 1 if file was found, 0 otherwise

Definition at line 53 of file imagery/find.c.

References G_find_file2_misc(), G_mapset(), I_find_group(), and NULL.

◆ I_find_group_file2()

int I_find_group_file2 ( const char *  group,
const char *  mapset,
const char *  file 
)

Searches for a group file in the specified mapset.

Parameters
group
file
Returns
int 1 if file was found, 0 otherwise

Definition at line 70 of file imagery/find.c.

References G_find_file2_misc(), I_find_group2(), and NULL.

Referenced by fopen_group_file_old().

◆ I_find_signature()

const char* I_find_signature ( I_SIGFILE_TYPE  type,
char *  name,
const char *  mapset 
)

Find mapset containing signature file.

Looks for the signature name of type type in the database. The mapset parameter can either be the empty string "", which means search all the mapsets in the users current mapset search path (see Mapset_Search_Path for more details about the search path) or it can be a specific mapset name, which means look for the signature only in this one mapset (for example, in the current mapset). If found, the mapset where the signature lives is returned. If not found, the NULL pointer is returned.

Note: If the user specifies a fully qualified signature name which exists, then I_find_signature() modifies name by removing the "@<i>mapset</i>". Use I_find_signature2 if altering passed in name is not desired.

Parameters
typeI_SIGFILE_TYPE
nameof signature
mapsetset NULL to search in all mapsets
Returns
mapset or NULL

Definition at line 205 of file imagery/find.c.

◆ I_find_signature2()

const char* I_find_signature2 ( I_SIGFILE_TYPE  type,
const char *  name,
const char *  mapset 
)

Find mapset containing signature (look but don't touch)

Looks for the signature name of type type in the database. The mapset parameter can either be the empty string "", which means search all the mapsets in the users current mapset search path (see Mapset_Search_Path for more details about the search path) or it can be a specific mapset name, which means look for the signature only in this one mapset (for example, in the current mapset). If found, the mapset where the signature lives is returned. If not found, the NULL pointer is returned.

Note: The passed name argument is not altered. Use I_find_signature if stripping mapset part from the name is desired.

Parameters
typeI_SIGFILE_TYPE
nameof signature
mapsetset NULL to search in all mapsets
Returns
mapset or NULL

Definition at line 240 of file imagery/find.c.

◆ I_find_subgroup()

int I_find_subgroup ( const char *  group,
const char *  subgroup 
)

Searches for a subgroup in the current mapset.

Parameters
group
subgroup
Returns
int 1 if subgroup was found, 0 otherwise

Definition at line 88 of file imagery/find.c.

References G_debug(), G_find_file2_misc(), G_mapset(), GNAME_MAX, HOST_DIRSEP, I_find_group(), and NULL.

◆ I_find_subgroup2()

int I_find_subgroup2 ( const char *  group,
const char *  subgroup,
const char *  mapset 
)

Searches for a subgroup in specified mapset or any mapset if mapset is not set.

Parameters
group
subgroup
mapset
Returns
int 1 if subrgoup was found, 0 otherwise

Definition at line 111 of file imagery/find.c.

References G_debug(), G_find_file2_misc(), GNAME_MAX, HOST_DIRSEP, I_find_group2(), and NULL.

◆ I_find_subgroup_file()

int I_find_subgroup_file ( const char *  group,
const char *  subgroup,
const char *  file 
)

Searches for a subgroup file in the current mapset.

Parameters
group
subgroup
file
Returns
int 1 if file was found, 0 otherwise

Definition at line 135 of file imagery/find.c.

References G_debug(), G_find_file2_misc(), G_mapset(), GNAME_MAX, HOST_DIRSEP, I_find_group(), and NULL.

◆ I_find_subgroup_file2()

int I_find_subgroup_file2 ( const char *  group,
const char *  subgroup,
const char *  mapset,
const char *  file 
)

Searches for a subgroup file in the specified mapset.

Parameters
group
subgroup
mapset
file
Returns
int 1 if file was found, 0 otherwise

Definition at line 163 of file imagery/find.c.

References G_debug(), G_find_file2_misc(), GNAME_MAX, HOST_DIRSEP, I_find_group2(), and NULL.

Referenced by fopen_subgroup_file_old().