diff --git a/bldcfg.c b/bldcfg.c index 36ba9be52..27d767ef3 100644 --- a/bldcfg.c +++ b/bldcfg.c @@ -1681,10 +1681,9 @@ char pathname[MAX_PATH]; /* file path in host format */ /* Parse devnum */ rc=parse_and_attach_devices(sdevnum,sdevtype,addargc,addargv); - if(rc==-2) - { - logmsg(_("HHCCF036S Error in %s line %d: " - "%s is not a valid device number(s) specification\n"), + if (rc != 0) { + logmsg(_("HHCCF087S Configuration error in %s line %d: " + "see previous message for details.\n"), fname, inc_stmtnum[inc_level], sdevnum); delayed_exit(1); } diff --git a/con1052c.c b/con1052c.c index 44b0e5dda..be73696b9 100644 --- a/con1052c.c +++ b/con1052c.c @@ -62,6 +62,8 @@ static int con1052_init_handler ( DEVBLK *dev, int argc, char *argv[] ) { int ac=0; + int return_code = 0; + int changed_prefix = 0; /* Integrated console is always connected */ dev->connected = 1; @@ -81,22 +83,32 @@ con1052_init_handler ( DEVBLK *dev, int argc, char *argv[] ) /* Default command character is "/" */ strcpy(dev->filename,"/"); - /* Is there an argument? */ - if (argc > 0) + if(!sscanf(dev->typname,"%hx",&(dev->devtype))) + dev->devtype = 0x1052; + + /* Is there one or more argument? */ + for (ac = 0; ac < argc; ac++) { /* Look at the argument and set noprompt flag if specified. */ - if (strcasecmp(argv[ac], "noprompt") == 0) + if (dev->prompt1052 && !strcasecmp(argv[ac], "noprompt")) { dev->prompt1052 = 0; - ac++; argc--; - } - else + } else if (!changed_prefix && strlen(dev->filename) == 1) { + /* First command prefix seen */ + changed_prefix = 1; strlcpy(dev->filename,argv[ac],sizeof(dev->filename)); + } else { + // FIXME: Mommy, where do little error message numbers come from? + logmsg(_("HHCCF037S Configuration error for %s integrated console at address %4.4X:" + " invalid/extra parameter \"%s\"\n"), + dev->typname, + dev->devnum, + argv[ac]); + return_code = -1; + break; + } } - if(!sscanf(dev->typname,"%hx",&(dev->devtype))) - dev->devtype = 0x1052; - /* Initialize the device identifier bytes */ dev->devid[0] = 0xFF; dev->devid[1] = dev->devtype >> 8; @@ -107,7 +119,7 @@ con1052_init_handler ( DEVBLK *dev, int argc, char *argv[] ) dev->devid[6] = 0x00; dev->numdevid = 7; - return 0; + return return_code; } /* end function con1052_init_handler */ diff --git a/config.c b/config.c index 1b56bca3d..249518dbc 100644 --- a/config.c +++ b/config.c @@ -379,7 +379,7 @@ int i; /* Loop index */ if (find_device_by_devnum(lcss,devnum) != NULL) { logmsg (_("HHCCF041E Device %d:%4.4X already exists\n"), lcss,devnum); - return 1; + return -1; } /* obtain device block */ @@ -391,7 +391,7 @@ int i; /* Loop index */ ret_devblk(dev); - return 1; + return -1; } dev->typname = strdup(type); @@ -415,9 +415,6 @@ int i; /* Loop index */ if (rc < 0) { - logmsg (_("HHCCF044E Initialization failed for device %4.4X\n"), - devnum); - for (i = 0; i < dev->argc; i++) if (dev->argv[i]) free(dev->argv[i]); @@ -428,7 +425,7 @@ int i; /* Loop index */ ret_devblk(dev); - return 1; + return rc; } /* Obtain device data buffer */ @@ -451,7 +448,7 @@ int i; /* Loop index */ ret_devblk(dev); - return 1; + return -1; } } @@ -1193,12 +1190,11 @@ parse_and_attach_devices(const char *sdevnum, char **addargv) { DEVNUMSDESC dnd; - int baddev; size_t devncount; DEVARRAY *da; int i; U16 devnum; - int rc; + int rc = 0; #if defined(OPTION_CONFIG_SYMBOLS) int j; @@ -1210,6 +1206,8 @@ parse_and_attach_devices(const char *sdevnum, if(devncount==0) { + logmsg(_("%s is not a valid device number(s) specification\n"), + sdevnum); return -2; } @@ -1217,10 +1215,10 @@ parse_and_attach_devices(const char *sdevnum, newargv=malloc(MAX_ARGS*sizeof(char *)); orig_newargv=malloc(MAX_ARGS*sizeof(char *)); #endif /* #if defined(OPTION_CONFIG_SYMBOLS) */ - for(baddev=0,i=0;i<(int)devncount;i++) + for(rc=0,i=0;rc == 0 && i<(int)devncount;i++) { da=dnd.da; - for(devnum=da[i].cuu1;devnum<=da[i].cuu2;devnum++) + for(devnum=da[i].cuu1;rc == 0 && devnum<=da[i].cuu2;devnum++) { #if defined(OPTION_CONFIG_SYMBOLS) char wrkbfr[16]; @@ -1238,34 +1236,27 @@ parse_and_attach_devices(const char *sdevnum, { orig_newargv[j]=newargv[j]=resolve_symbol_string(addargv[j]); } - /* Build the device configuration block */ + + /* Build the device configuration block */ rc=attach_device(dnd.lcss, devnum, sdevtype, addargc, newargv); for(j=0;jArguments required for each device type

If your tn3270 client software allows you to specify a device type suffix - (e.g. IBM-3278@001F ), then you can use the suffix to connect + (e.g. IBM-3278@001F), then you can use the suffix to connect to that specific device number, if eligible. If no suffix is specified, then your client will be connected to the first available 3270 device for which it is eligible, if any. @@ -1876,7 +1876,7 @@

Arguments required for each device type

If a terminal group name is given on the device statement, a device type suffix with this group name can be used to indicate that a device in this group is to be used. If a group name is specified as a terminal type suffix - (e.g. IBM-3278@GROUPNAME ) and there are no devices defined + (e.g. IBM-3278@GROUPNAME) and there are no devices defined for that group (or there are no more available devices remaining in that group), then the connection is rejected. If no group name is specified as a terminal type suffix, then the connection will only be eligible for @@ -1965,22 +1965,60 @@

Arguments required for each device type


-

Integrated Console printer-keyboard devices -

+

+ Integrated Console printer-keyboard devices +
+

+ There are two optional arguments, which may be specified in any order: +

+
+
+ c|'c' +
+
+ A single character (optionally quoted) which specifies the prefix character for commands sent to the host system device. + The default seperator is slash (/). + +

+ Command Prefix Notes +

+
    +
  • + There is no restriction on the character you can select. If you select a command character that is the first character of + a panel command, you will not be able to use that command. +
  • +
  • + Each integrated device must use a different command prefix. Hercules will + not detect the use of duplicate command prefixes -- commands will simply be directed to the first integerated + console it finds using the command prefix. +
  • +
  • + If you use the hash mark/US pound sign (#), as the seperator character you + must quote it, because otherwise it is parsed as the + beginning of a comment extending to end of the line. + (The pound sign is useful because it is natural to type + #CP as the prefix to VM commands. +
  • +
+
+
+
+ NOPROMPT +
+
+ Causes suppression of the "Enter input for console device nnnn" prompt message which is otherwise normally issued to the + device whenever the system is awaiting input on that device. +
+
+ - There is one optional argument which is the command prefix - for sending input to the device. The default command prefix is '/'. -

- Note: There is no restriction on the character you can select. - If you select a command character that is the first character of a panel - command, you will not be able to use that command. - -

+

+ To send a + logon command when using the default prefix to a 1052-C or 3215-C, enter + /logon on the Hercules console. +

- To send a logon command to a 1052-C or 3215-C enter /logon on the Hercules console. -

- All integrated devices must use a different command prefix. -

+


@@ -1997,7 +2035,7 @@

Arguments required for each device type

If your telnet client software allows you to specify a device type suffix - (for example: ansi@0009 ), then you can use that suffix to specify + (for example: ansi@0009), then you can use that suffix to specify the specific 1052 or 3215 device to which you wish to connect. If you do not specify a suffix in your telnet client software (or your software does not allow it), then your client will be connected to the first available 1052 or