GRASS GIS 8 Programmer's Manual
8.2.2dev(2023)-3d2c704037
|
#include <unistd.h>
#include <string.h>
#include <grass/gis.h>
#include <grass/imagery.h>
#include <grass/glocale.h>
Go to the source code of this file.
Functions | |
void | I_get_signatures_dir (char *dir, I_SIGFILE_TYPE type) |
Get signature directory. More... | |
void | I_make_signatures_dir (I_SIGFILE_TYPE type) |
Make signature dir. More... | |
int | I_signatures_remove (I_SIGFILE_TYPE type, const char *name) |
Remove a signature file. More... | |
int | I_signatures_copy (I_SIGFILE_TYPE type, const char *old_name, const char *old_mapset, const char *new_name) |
Copy a signature file. More... | |
int | I_signatures_rename (I_SIGFILE_TYPE type, const char *old_name, const char *new_name) |
Rename a signature file. More... | |
int | I_signatures_list_by_type (I_SIGFILE_TYPE type, const char *mapset, char ***out_list) |
Get list of existing signatures by type. More... | |
void | I_free_signatures_list (int count, char ***list) |
Free memory allocated by I_signatures_list_by_type. More... | |
void I_free_signatures_list | ( | int | count, |
char *** | list | ||
) |
Free memory allocated by I_signatures_list_by_type.
Calls G_free for all list items returned by I_signatures_list_by_type() Sets pointer to NULL to prevent accidental use after free.
int | Return value of I_signatures_list_by_type() |
pointer | to array filled by I_signatures_list_by_type() |
Definition at line 262 of file manage_signatures.c.
void I_get_signatures_dir | ( | char * | dir, |
I_SIGFILE_TYPE | type | ||
) |
Get signature directory.
The directory will be in a form "signatures/<type>".
dir | [GNAME_MAX] allocated string buffer |
type | I_SIGFILE_TYPE |
Definition at line 29 of file manage_signatures.c.
Referenced by I_fopen_signature_file_new(), I_fopen_signature_file_old(), I_fopen_sigset_file_new(), and I_fopen_sigset_file_old().
void I_make_signatures_dir | ( | I_SIGFILE_TYPE | type | ) |
Make signature dir.
Creates directories for storage of signature files of specified type. E.g. "<location>/<mapset>/signatures/<type>/"
type | I_SIGFILE_TYPE |
Definition at line 50 of file manage_signatures.c.
Referenced by I_fopen_signature_file_new(), and I_fopen_sigset_file_new().
int I_signatures_copy | ( | I_SIGFILE_TYPE | type, |
const char * | old_name, | ||
const char * | old_mapset, | ||
const char * | new_name | ||
) |
Copy a signature file.
If copy fails, prints warning messages and returns 1. It is safe to pass fully qualified names.
type | I_SIGFILE_TYPE signature type |
name | of old signature |
mapset | of old signature |
name | of new signature |
Definition at line 112 of file manage_signatures.c.
int I_signatures_list_by_type | ( | I_SIGFILE_TYPE | type, |
const char * | mapset, | ||
char *** | out_list | ||
) |
Get list of existing signatures by type.
Fills passed list with fully qualified names of existing signatures.
If no mapset is passed, all mapsets in the search path are used. If no signatures are found, returns 0 and list is set to NULL.
The function will assign memory for the list. It is up to callee to free the memory of each list item and the list itself.
type | I_SIGFILE_TYPE signature type |
mapset | optional mapset to search in or NULL |
pointer | to array of found signature strings or NULL if none found |
Definition at line 235 of file manage_signatures.c.
int I_signatures_remove | ( | I_SIGFILE_TYPE | type, |
const char * | name | ||
) |
Remove a signature file.
If removal fails, prints a warning and returns 1. It is safe to pass fully qualified names.
type | I_SIGFILE_TYPE signature type |
name | of signature to remove |
Definition at line 72 of file manage_signatures.c.
int I_signatures_rename | ( | I_SIGFILE_TYPE | type, |
const char * | old_name, | ||
const char * | new_name | ||
) |
Rename a signature file.
If rename fails, prints warning messages and returns 1. It is safe to pass fully qualified names.
type | I_SIGFILE_TYPE signature type |
name | of old signature |
name | of new signature |
Definition at line 170 of file manage_signatures.c.