DMTESTNAME(5ICD)

NAME
dmTestname - test a name

SYNOPSIS

#include "dmincl.h"
dmTestname (name)
char *name;

PARAMETERS
is the name which has to be tested.

DESCRIPTION
Function dmTestname() tests the name whether it is allowed to become e.g. a cell or terminal name. Valid names have to start with a letter and all other characters have to be a letter (upper or lower case), a number or an under-score '_'. The length of the name will always be truncated to DM_MAXNAME characters (if too long).

DIAGNOSTICS
Function dmTestname() returns 0 if no illegal character is detected within the first DM_MAXNAME characters.
Function dmTestname() returns -1 when a bad name is found. External variable dmerrno will be set to DME_BADNAME and a call to function dmError() is done.
Function dmTestname() returns 1 when the first DM_MAXNAME characters constitute a valid name but the string length of name is greater than DM_MAXNAME. The name will therefore be truncated.