Make messages consistent. Stop using fixed input buffer. Volset mount checks

Use the VMS-style messages for all errors,warnings.

Allow selection of full message or just text in getmsg()

Use dynamic buffer for command input (except VMS).

Simplify command input and pre-processing.

Mount command improvements:
  If labels are specified, make sure they match the volumes
  Make sure number of devices specified matches hom block's volset count.
  Verify that all volumes claim to belong to the same volume set
  Verify that volumes are mounted in RVN order, and that labels match VOLSET.SYS
  When a volume set is mounted, announce its name.
  Improve cleanup on mount failure (more to do)

Remove obsolete/unused header.h
This commit is contained in:
Timothe Litt
2016-03-02 17:35:50 -05:00
parent 45e3b4e500
commit 2c8ee0b04c
11 changed files with 424 additions and 425 deletions

View File

@@ -4,6 +4,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* Should replace with lib$sys_getmsg under VMS
@@ -13,6 +14,7 @@
#include "ssdef.h"
#include "rms.h"
#include "compat.h"
#include "sysmsg.h"
static
const struct VMSMSG {
@@ -70,17 +72,26 @@ const struct VMSMSG {
{0, NULL},
};
const char *getmsg( unsigned int vmscode ) {
char fmt[] = "%SYSTEM-E-NOSUCHMSG, Unknown message code %08X";
static char buf[sizeof(fmt)+8+1];
const char *getmsg( unsigned int vmscode, unsigned int flags ) {
const char fmt[] = "%%SYSTEM-E-NOSUCHMSG, Unknown message code %08X";
static char buf[sizeof(fmt)+8+1];
const char *txtp = NULL;
for( mp = vms2text; mp->text; mp++ ) {
if( vmscode == mp-> code ) {
return mp->text;
for( mp = vms2text; mp->text; mp++ ) {
if( vmscode == mp-> code ) {
txtp = mp->text;
break;
}
}
}
snprintf( buf, sizeof(buf), fmt, vmscode );
return buf;
if( txtp == NULL ) {
txtp = buf;
}
if( flags == MSG_TEXT ) {
txtp = strchr( txtp, ',' );
if( txtp == NULL ) abort();
return txtp+2;
}
return txtp;
}
/*