19#include <grass/glocale.h>
20#include <grass/vector.h>
22#include "manage_local_proto.h"
35int M_do_copy(
int n,
const char *old,
const char *mapset,
const char *
new)
38 char path[GPATH_MAX], path2[GPATH_MAX];
43 G_message(_(
"Copying %s <%s> to current mapset as <%s>"),
list[n].maindesc,
48 ret = Vect_copy(old, mapset,
new);
50 G_warning(_(
"Unable to copy <%s> to current mapset as <%s>"),
56 for (i = 0; i <
list[n].nelem; i++) {
59 if (access(
path, 0) != 0) {
67 G_warning(_(
"Unable to copy <%s> to current mapset as <%s>"),
80 char colr2[6 + GMAPSET_MAX];
82 if (snprintf(colr2, 6 + GMAPSET_MAX,
"colr2/%s",
G_mapset()) >=
84 G_warning(_(
"String for secondary color table has been truncated"));
int G_recursive_copy(const char *src, const char *dst)
Copy recursively source directory to destination directory.
int G_debug(int level, const char *msg,...)
Print debugging message.
int M_do_copy(int n, const char *old, const char *mapset, const char *new)
Copy element.
char * G_file_name(char *path, const char *element, const char *name, const char *mapset)
Builds full path names to GIS data files.
void G_verbose_message(const char *msg,...)
Print a message to stderr but only if module is in verbose mode.
void G_message(const char *msg,...)
Print a message to stderr.
void G_warning(const char *msg,...)
Print a warning message to stderr.
const char * G_mapset(void)
Get current mapset name.
int G_make_mapset_object_group(const char *type)
Create directory for group of elements of a given type.
char * G_fully_qualified_name(const char *name, const char *mapset)
Get fully qualified element name.
int G_remove(const char *element, const char *name)
Remove a database file.
int M__hold_signals(int hold)
Hold signals.
int G_strcasecmp(const char *x, const char *y)
String compare ignoring case (upper or lower)