gala_clients/DIS_group/src/GroupApp.cxx
//
// Check to see if the specified name is already taken:
//
Check to see if the specified name is already taken.
Check to see if the specified name is already taken .
GroupApp::NameCode GroupApp::ValidName(const char *name)
{
  Initialize(GroupApp::ValidName);
  NameCode ret = NAME_INVALID;
  if (name) {
    if (*name) {
      if (ValidChars(name)) {
        if (UnusedSubsysName(name)) {
          genString command;
          command.printf("%s %s", apiSub[EXISTS], (char *)name);
          char *result = NULL;
          int code = SendCommand((char *)command, result);
          if (code != TCL_ERROR) {
            if (result)
              if (!strcmp(result, "0"))          
                ret = NAME_VALID;
          }
          else {
            dis_message(NULL, MSG_ERROR, "M_SETS_GETNAME_FATAL");
	    ret = NAME_FATAL;
          }
        }
      }
      else
        ret = NAME_BADCHAR;
    }
  }
  return ret;
}
GroupApp :: NameCode GroupApp :: ValidName ( const char * name ) { Initialize ( GroupApp :: ValidName ) ; NameCode ret = NAME_INVALID ; if ( name ) { if ( * name ) { if ( ValidChars ( name ) ) { if ( UnusedSubsysName ( name ) ) { genString command ; command . printf ( " " , apiSub [ EXISTS ] , ( char * ) name ) ; char * result = NULL ; int code = SendCommand ( ( char * ) command , result ) ; if ( code != TCL_ERROR ) { if ( result ) if ( ! strcmp ( result , " " ) ) ret = NAME_VALID ; } else { dis_message ( NULL , MSG_ERROR , " " ) ; ret = NAME_FATAL ; } } } else ret = NAME_BADCHAR ; } } return ret ; }
Check to see if the specified name is already taken:
Check to see if the specified name is already taken :
// No such group