GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71817
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
legal_vname.c File Reference

Vector library - Check if map name is legal vector map name. More...

#include <string.h>
#include <grass/vector.h>
#include <grass/glocale.h>
Include dependency graph for legal_vname.c:

Go to the source code of this file.

Functions

int Vect_legal_filename (const char *s)
 Check if output is legal vector name. More...
 
int Vect_check_input_output_name (const char *input, const char *output, int error)
 Check for input and output vector map name. More...
 

Detailed Description

Vector library - Check if map name is legal vector map name.

(C) 2001-2009 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
Radim Blazek

Definition in file legal_vname.c.

Function Documentation

int Vect_check_input_output_name ( const char *  input,
const char *  output,
int  error 
)

Check for input and output vector map name.

Check

  • output is legal vector name
  • if can find input map
  • if input was found in current mapset, check if input != output
Parameters
inputinput name
outputoutput name
errorerror type G_FATAL_EXIT, G_FATAL_PRINT, G_FATAL_RETURN
Returns
0 OK
1 error

Definition at line 89 of file legal_vname.c.

References _, G_fatal_error(), G_FATAL_EXIT, G_FATAL_PRINT, G_find_vector2(), G_mapset(), G_name_is_fully_qualified(), G_warning(), GMAPSET_MAX, GNAME_MAX, NULL, and Vect_legal_filename().

int Vect_legal_filename ( const char *  s)

Check if output is legal vector name.

Rule: [A-Za-z][A-Za-z0-9_]*

Check also for SQL keywords.

Parameters
sfilename to be checked
Returns
1 OK
-1 if name does not start with letter A..Za..z or if name does not continue with A..Za..z0..9_

Definition at line 31 of file legal_vname.c.

References _, G_strcasecmp(), G_warning(), GNAME_MAX, and NULL.

Referenced by Vect_check_input_output_name(), Vect_copy(), and Vect_rename().