grass  7.8.6
About: GRASS (Geographic Resources Analysis Support System) is a raster- and vector-based GIS, image processing system, graphics production system and spatial modeling system.
  Fossies Dox: grass-7.8.6.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

legal_dbname.c File Reference

DBMI Library (base) - validate DB names. More...

#include <grass/gis.h>
#include <grass/dbmi.h>
#include <grass/glocale.h>
Include dependency graph for legal_dbname.c:

Go to the source code of this file.

Functions

int db_legal_tablename (const char *s)
 Check if output is legal table name. More...
 

Detailed Description

DBMI Library (base) - validate DB names.

Todo:
Are we as restrictive here as for vector names?

(C) 1999-2009, 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
Joel Jones (CERL/UIUC), Radim Blazek
Doxygenized by Martin Landa <landa.martin gmail.com> (2011)

Definition in file legal_dbname.c.

Function Documentation

◆ db_legal_tablename()

int db_legal_tablename ( const char *  s)

Check if output is legal table name.

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

Parameters
stable name 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_dbname.c.

References _, DB_FAILED, DB_OK, G_warning(), GNAME_MAX, and s.