Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions bldcfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
32 changes: 22 additions & 10 deletions con1052c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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 */


Expand Down
39 changes: 15 additions & 24 deletions config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -391,7 +391,7 @@ int i; /* Loop index */

ret_devblk(dev);

return 1;
return -1;
}

dev->typname = strdup(type);
Expand All @@ -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]);
Expand All @@ -428,7 +425,7 @@ int i; /* Loop index */

ret_devblk(dev);

return 1;
return rc;
}

/* Obtain device data buffer */
Expand All @@ -451,7 +448,7 @@ int i; /* Loop index */

ret_devblk(dev);

return 1;
return -1;
}
}

Expand Down Expand Up @@ -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;
Expand All @@ -1210,17 +1206,19 @@ parse_and_attach_devices(const char *sdevnum,

if(devncount==0)
{
logmsg(_("%s is not a valid device number(s) specification\n"),
sdevnum);
return -2;
}

#if defined(OPTION_CONFIG_SYMBOLS)
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];
Expand All @@ -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;j<addargc;j++)
{
free(orig_newargv[j]);
}
#else /* #if defined(OPTION_CONFIG_SYMBOLS) */
/* Build the device configuration block (no syms) */
/* Build the device configuration block (no syms) */
rc=attach_device(dnd.lcss, devnum, sdevtype, addargc, addargv);
#endif /* #if defined(OPTION_CONFIG_SYMBOLS) */
if(rc!=0)
{
baddev=1;
break;
}
}
if(baddev)
{
break;
}
}
#if defined(OPTION_CONFIG_SYMBOLS)
free(newargv);
free(orig_newargv);
#endif /* #if defined(OPTION_CONFIG_SYMBOLS) */

free(dnd.da);
return baddev?0:-1;
}
return rc;
}

#define MAX_LOGO_LINES 256
void
Expand Down
9 changes: 8 additions & 1 deletion hsccmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -4222,14 +4222,21 @@ int qd_cmd(int argc, char *argv[], char *cmdline)
/*-------------------------------------------------------------------*/
int attach_cmd(int argc, char *argv[], char *cmdline)
{
int rc;
UNREFERENCED(cmdline);

if (argc < 3)
{
logmsg( _("HHCPN057E Missing argument(s)\n") );
return -1;
}
return parse_and_attach_devices(argv[1],argv[2],argc-3,&argv[3]);

rc = parse_and_attach_devices(argv[1],argv[2],argc-3,&argv[3]);
if (rc != 0)
{
logmsg (_("HHCCF044E Initialization failed for device\n"));
}
return rc;

#if 0
if((cdev = strchr(argv[1],':')))
Expand Down
72 changes: 55 additions & 17 deletions html/hercconf.html
Original file line number Diff line number Diff line change
Expand Up @@ -1853,7 +1853,7 @@ <h4>Arguments required for each device type</h4>
<p>

If your tn3270 client software allows you to specify a device type suffix
(e.g. <code>IBM-3278@001F</code> ), then you can use the suffix to connect
(e.g. <code>IBM-3278@001F</code>), 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.
Expand All @@ -1876,7 +1876,7 @@ <h4>Arguments required for each device type</h4>
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. <code>IBM-3278@GROUPNAME</code> ) and there are no devices defined
(e.g. <code>IBM-3278@GROUPNAME</code>) 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
Expand Down Expand Up @@ -1965,22 +1965,60 @@ <h4>Arguments required for each device type</h4>
<hr width="50%"><p>

<a name="consysc"></a>
<dt><em>Integrated Console printer-keyboard devices</em>
<dd><p>
<dt>
<em>Integrated Console printer-keyboard devices</em>
<dd>
<p>
There are two optional arguments, which may be specified in any order:
<dl>
<dt>
<dt>
<em>c</em>&#124;<em>'c'</em>
</dt>
<dd>
A single character (optionally quoted) which specifies the prefix character for commands sent to the host system device.
The default seperator is slash (/).
<em>
<p>
<b>Command Prefix Notes</b>
</p>
<ul>
<li>
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.
</li>
<li>
Each integrated device must use a different command prefix. Hercules will
<b>not</b> detect the use of duplicate command prefixes -- commands will simply be directed to the first integerated
console it finds using the command prefix.
</li>
<li>
If you use the hash mark/US pound sign (<code>#</code>), as the seperator character you
<b>must</b> 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
<code>#CP</code> as the prefix to VM commands.
</li>
</ul>
</em>
</dd>
<dt>
<code>NOPROMPT</code>
</dt>
<dd>
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.
</dd>
</dl>
</dt>

There is one optional argument which is the command prefix
for sending input to the device. The default command prefix is '/'.
<p><em>
<b>Note:</b> 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.
</em>
<p>
<p>
To send a
<code>logon</code> command when using the default prefix to a <code>1052-C</code> or <code>3215-C</code>, enter
<code>/logon</code> on the Hercules console.
</p>

To send a logon command to a 1052-C or 3215-C enter /logon on the Hercules console.
<p>
All integrated devices must use a different command prefix.
<p>
<p/>

<hr width="50%"><p>

Expand All @@ -1997,7 +2035,7 @@ <h4>Arguments required for each device type</h4>
<p>

If your telnet client software allows you to specify a device type suffix
(for example: <code>ansi@0009</code> ), then you can use that suffix to specify
(for example: <code>ansi@0009</code>), 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
Expand Down