1994-05-26 05:23:31 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 1980, 1993
|
|
|
|
* The Regents of the University of California. All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by the University of
|
|
|
|
* California, Berkeley and its contributors.
|
|
|
|
* 4. Neither the name of the University nor the names of its contributors
|
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef lint
|
1997-09-15 06:37:10 +00:00
|
|
|
#if 0
|
1994-05-26 05:23:31 +00:00
|
|
|
static char sccsid[] = "@(#)mkioconf.c 8.2 (Berkeley) 1/21/94";
|
1997-09-15 06:37:10 +00:00
|
|
|
#endif
|
|
|
|
static const char rcsid[] =
|
1999-04-17 14:41:41 +00:00
|
|
|
"$Id: mkioconf.c,v 1.49 1999/04/16 21:28:10 peter Exp $";
|
1994-05-26 05:23:31 +00:00
|
|
|
#endif /* not lint */
|
|
|
|
|
1997-09-15 06:37:10 +00:00
|
|
|
#include <err.h>
|
1994-05-26 05:23:31 +00:00
|
|
|
#include <stdio.h>
|
1996-06-02 17:22:01 +00:00
|
|
|
#include "y.tab.h"
|
1994-05-26 05:23:31 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* build the ioconf.c file
|
|
|
|
*/
|
1999-04-17 14:41:41 +00:00
|
|
|
static char *qu();
|
|
|
|
static char *intv();
|
|
|
|
static char *wnum();
|
1998-10-16 15:00:18 +00:00
|
|
|
void scbus_devtab __P((FILE *, int *));
|
1997-09-15 06:37:10 +00:00
|
|
|
void i386_ioconf __P((void));
|
1999-04-17 14:41:41 +00:00
|
|
|
void alpha_ioconf __P((void));
|
1994-05-26 05:23:31 +00:00
|
|
|
|
1999-04-16 21:28:10 +00:00
|
|
|
static char *
|
|
|
|
devstr(struct device *dp)
|
|
|
|
{
|
|
|
|
static char buf[100];
|
|
|
|
|
|
|
|
if (dp == TO_NEXUS)
|
|
|
|
return "nexus0";
|
|
|
|
|
|
|
|
if (dp->d_unit >= 0) {
|
|
|
|
sprintf(buf, "%s%d", dp->d_name, dp->d_unit);
|
|
|
|
return buf;
|
|
|
|
} else
|
|
|
|
return dp->d_name;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
write_device_resources(FILE *fp, struct device *dp)
|
|
|
|
{
|
|
|
|
int count = 0;
|
|
|
|
|
|
|
|
fprintf(fp, "struct config_resource %s_resources[] = {\n", devstr(dp));
|
|
|
|
if (dp->d_conn) {
|
|
|
|
fprintf(fp, "\t{ \"at\",\tRES_STRING,\t{ (long)\"%s\" }},\n",
|
|
|
|
devstr(dp->d_conn));
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
if (dp->d_drive != -2) {
|
|
|
|
fprintf(fp, "\t{ \"drive\",\tRES_INT,\t{ %d }},\n", dp->d_drive);
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
if (dp->d_target != -2) {
|
|
|
|
fprintf(fp, "\t{ \"target\",\tRES_INT,\t{ %d }},\n", dp->d_target);
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
if (dp->d_lun != -2) {
|
|
|
|
fprintf(fp, "\t{ \"lun\",\tRES_INT,\t{ %d }},\n", dp->d_lun);
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
if (dp->d_flags) {
|
|
|
|
fprintf(fp, "\t{ \"flags\",\tRES_INT,\t{ 0x%x }},\n", dp->d_flags);
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
if (dp->d_conflicts) {
|
|
|
|
fprintf(fp, "\t{ \"conflicts\",\tRES_INT,\t{ %d }},\n", dp->d_conflicts);
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
if (dp->d_disabled) {
|
|
|
|
fprintf(fp, "\t{ \"disabled\",\tRES_INT,\t{ %d }},\n", dp->d_disabled);
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
if (dp->d_port) {
|
|
|
|
fprintf(fp, "\t{ \"port\",\tRES_INT,\t { %s }},\n", dp->d_port);
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
if (dp->d_portn > 0) {
|
|
|
|
fprintf(fp, "\t{ \"port\",\tRES_INT,\t{ 0x%x }},\n", dp->d_portn);
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
if (dp->d_maddr > 0) {
|
|
|
|
fprintf(fp, "\t{ \"maddr\",\tRES_INT,\t{ 0x%x }},\n", dp->d_maddr);
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
if (dp->d_msize > 0) {
|
|
|
|
fprintf(fp, "\t{ \"msize\",\tRES_INT,\t{ 0x%x }},\n", dp->d_msize);
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
if (dp->d_drq > 0) {
|
|
|
|
fprintf(fp, "\t{ \"drq\",\tRES_INT,\t{ %d }},\n", dp->d_drq);
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
if (dp->d_irq > 0) {
|
|
|
|
fprintf(fp, "\t{ \"irq\",\tRES_INT,\t{ %d }},\n", dp->d_irq);
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
fprintf(fp, "};\n");
|
|
|
|
fprintf(fp, "#define %s_count %d\n", devstr(dp), count);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
write_all_device_resources(FILE *fp)
|
|
|
|
{
|
|
|
|
struct device *dp;
|
|
|
|
|
|
|
|
for (dp = dtab; dp != 0; dp = dp->d_next) {
|
|
|
|
if (dp->d_type != CONTROLLER && dp->d_type != MASTER
|
|
|
|
&& dp->d_type != DEVICE)
|
|
|
|
continue;
|
|
|
|
write_device_resources(fp, dp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
write_devtab(FILE *fp)
|
|
|
|
{
|
|
|
|
struct device *dp;
|
|
|
|
int count;
|
|
|
|
|
|
|
|
write_all_device_resources(fp);
|
|
|
|
|
|
|
|
count = 0;
|
|
|
|
fprintf(fp, "struct config_device config_devtab[] = {\n");
|
|
|
|
for (dp = dtab; dp != 0; dp = dp->d_next) {
|
|
|
|
char* n = devstr(dp);
|
|
|
|
if (dp->d_type != CONTROLLER && dp->d_type != MASTER
|
|
|
|
&& dp->d_type != DEVICE)
|
|
|
|
continue;
|
|
|
|
fprintf(fp, "\t{ \"%s\",\t%d,\t%s_count,\t%s_resources },\n",
|
|
|
|
dp->d_name, dp->d_unit, n, n);
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
fprintf(fp, "};\n");
|
|
|
|
fprintf(fp, "int devtab_count = %d;\n", count);
|
|
|
|
}
|
|
|
|
|
1994-05-26 05:23:31 +00:00
|
|
|
#if MACHINE_I386
|
1999-04-17 14:41:41 +00:00
|
|
|
static char *sirq();
|
1994-05-26 05:23:31 +00:00
|
|
|
|
1997-09-15 06:37:10 +00:00
|
|
|
void
|
1994-05-26 05:23:31 +00:00
|
|
|
i386_ioconf()
|
|
|
|
{
|
1997-09-15 06:37:10 +00:00
|
|
|
register struct device *dp, *mp;
|
1994-08-18 05:11:32 +00:00
|
|
|
int dev_id;
|
1998-10-16 15:00:18 +00:00
|
|
|
FILE *fp;
|
1995-09-19 16:37:34 +00:00
|
|
|
static char *old_d_name;
|
1998-09-03 21:03:43 +00:00
|
|
|
int count;
|
1994-05-26 05:23:31 +00:00
|
|
|
|
1996-01-12 08:57:10 +00:00
|
|
|
fp = fopen(path("ioconf.c.new"), "w");
|
1997-09-15 06:37:10 +00:00
|
|
|
if (fp == 0)
|
|
|
|
err(1, "%s", path("ioconf.c.new"));
|
1994-05-26 05:23:31 +00:00
|
|
|
fprintf(fp, "/*\n");
|
1995-09-19 16:37:34 +00:00
|
|
|
fprintf(fp, " * I/O configuration.\n");
|
|
|
|
fprintf(fp, " * DO NOT EDIT-- this file is automatically generated.\n");
|
|
|
|
fprintf(fp, " */\n");
|
1994-05-26 05:23:31 +00:00
|
|
|
fprintf(fp, "\n");
|
1995-09-19 16:37:34 +00:00
|
|
|
fprintf(fp, "#include <sys/param.h>\n");
|
|
|
|
fprintf(fp, "\n");
|
|
|
|
fprintf(fp, "#define C (caddr_t)\n");
|
1999-04-16 21:28:10 +00:00
|
|
|
|
1995-09-19 16:37:34 +00:00
|
|
|
if (seen_scbus)
|
1998-10-16 15:00:18 +00:00
|
|
|
scbus_devtab(fp, &dev_id);
|
1995-09-19 16:37:34 +00:00
|
|
|
|
1998-09-03 21:03:43 +00:00
|
|
|
fprintf(fp, "\n");
|
|
|
|
fprintf(fp, "/*\n");
|
|
|
|
fprintf(fp, " * New bus architecture devices.\n");
|
|
|
|
fprintf(fp, " */\n");
|
|
|
|
fprintf(fp, "\n");
|
1998-09-04 07:48:53 +00:00
|
|
|
fprintf(fp, "#include <sys/queue.h>\n");
|
1999-04-16 21:28:10 +00:00
|
|
|
fprintf(fp, "#include <sys/sysctl.h>\n");
|
|
|
|
fprintf(fp, "#include <isa/isareg.h>\n");
|
1998-09-03 21:03:43 +00:00
|
|
|
fprintf(fp, "#include <sys/bus_private.h>\n");
|
|
|
|
fprintf(fp, "\n");
|
1999-04-16 21:28:10 +00:00
|
|
|
|
|
|
|
write_devtab(fp);
|
1998-09-03 21:03:43 +00:00
|
|
|
|
1994-05-26 13:24:02 +00:00
|
|
|
(void) fclose(fp);
|
1996-01-12 08:57:10 +00:00
|
|
|
moveifchanged(path("ioconf.c.new"), path("ioconf.c"));
|
1994-05-26 13:24:02 +00:00
|
|
|
}
|
1994-05-26 05:23:31 +00:00
|
|
|
|
1997-09-15 06:37:10 +00:00
|
|
|
static char *
|
|
|
|
id(int unit)
|
1995-03-01 22:34:05 +00:00
|
|
|
{
|
|
|
|
char *s;
|
|
|
|
switch(unit)
|
|
|
|
{
|
|
|
|
case UNKNOWN:
|
1998-09-15 10:29:32 +00:00
|
|
|
s ="CAMCONF_UNSPEC";
|
|
|
|
break;;
|
1995-03-01 22:34:05 +00:00
|
|
|
|
|
|
|
case QUES:
|
1998-09-15 10:29:32 +00:00
|
|
|
s ="CAMCONF_ANY";
|
1995-03-01 22:34:05 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
s = qu(unit);
|
|
|
|
}
|
|
|
|
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
1999-04-17 14:41:41 +00:00
|
|
|
static void
|
|
|
|
id_put(fp, unit, s)
|
1995-03-01 22:34:05 +00:00
|
|
|
FILE *fp;
|
|
|
|
int unit;
|
|
|
|
char *s;
|
|
|
|
{
|
|
|
|
fprintf(fp, "%s%s", id(unit), s);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* XXX: dufault@hda.com: wiped out mkioconf.c locally:
|
|
|
|
* All that nice "conflicting SCSI ID checking" is now
|
|
|
|
* lost and should be put back in.
|
|
|
|
*/
|
1997-09-15 06:37:10 +00:00
|
|
|
void
|
1998-10-16 15:00:18 +00:00
|
|
|
scbus_devtab(fp, dev_idp)
|
1995-03-01 22:34:05 +00:00
|
|
|
FILE *fp;
|
|
|
|
int *dev_idp;
|
|
|
|
{
|
|
|
|
register struct device *dp, *mp;
|
|
|
|
|
1995-09-19 16:37:34 +00:00
|
|
|
fprintf(fp, "\n");
|
|
|
|
fprintf(fp, "/*\n");
|
1998-09-15 10:29:32 +00:00
|
|
|
fprintf(fp, " * CAM devices.\n");
|
1995-09-19 16:37:34 +00:00
|
|
|
fprintf(fp, " */\n");
|
|
|
|
fprintf(fp, "\n");
|
1998-09-15 10:29:32 +00:00
|
|
|
fprintf(fp, "#include <cam/cam_conf.h>\n");
|
1995-09-19 16:37:34 +00:00
|
|
|
fprintf(fp, "\n");
|
1998-09-15 10:29:32 +00:00
|
|
|
fprintf(fp, "struct cam_sim_config cam_sinit[] = {\n");
|
|
|
|
fprintf(fp, "/* pathid, sim name, sim unit, sim bus */\n");
|
1995-03-01 22:34:05 +00:00
|
|
|
|
|
|
|
/* XXX: Why do we always get an entry such as:
|
1995-07-17 23:38:16 +00:00
|
|
|
* { '?', "ncr", '?', '?' },
|
1995-03-01 22:34:05 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
for (dp = dtab; dp; dp = dp->d_next) {
|
|
|
|
mp = dp->d_conn;
|
|
|
|
if (dp->d_type != CONTROLLER || mp == TO_NEXUS || mp == 0 ||
|
|
|
|
!eq(dp->d_name, "scbus")) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
fprintf(fp, "{ %s, ", id(dp->d_unit));
|
|
|
|
fprintf(fp, "\"%s\", ", mp->d_name);
|
1995-07-17 23:38:16 +00:00
|
|
|
fprintf(fp, "%s, ", id(mp->d_unit));
|
|
|
|
fprintf(fp, "%s },\n", id(dp->d_slave));
|
1995-03-01 22:34:05 +00:00
|
|
|
}
|
1995-09-19 16:37:34 +00:00
|
|
|
fprintf(fp, "{ 0, 0, 0, 0 }\n");
|
|
|
|
fprintf(fp, "};\n");
|
1995-03-01 22:34:05 +00:00
|
|
|
|
1998-09-15 10:29:32 +00:00
|
|
|
|
1995-09-19 16:37:34 +00:00
|
|
|
fprintf(fp, "\n");
|
1998-09-15 10:29:32 +00:00
|
|
|
fprintf(fp, "struct cam_periph_config cam_pinit[] = {\n");
|
|
|
|
fprintf(fp,
|
|
|
|
"/* periph name, periph unit, pathid, target, LUN, flags */\n");
|
1995-03-01 22:34:05 +00:00
|
|
|
for (dp = dtab; dp; dp = dp->d_next) {
|
|
|
|
if (dp->d_type == CONTROLLER || dp->d_type == MASTER ||
|
1999-04-16 21:28:10 +00:00
|
|
|
dp->d_type == PSEUDO_DEVICE
|
|
|
|
|| dp->d_conn == TO_NEXUS)
|
1995-03-01 22:34:05 +00:00
|
|
|
continue;
|
|
|
|
|
|
|
|
mp = dp->d_conn;
|
|
|
|
if (mp == 0 || !eq(mp->d_name, "scbus")) {
|
|
|
|
continue;
|
|
|
|
}
|
1995-03-03 19:00:39 +00:00
|
|
|
|
1995-03-07 11:03:42 +00:00
|
|
|
if (mp->d_conn == 0 &&
|
|
|
|
(dp->d_target != UNKNOWN && dp->d_target != QUES)) {
|
1995-03-03 19:00:39 +00:00
|
|
|
fprintf(stderr,
|
1995-03-07 11:03:42 +00:00
|
|
|
"Warning: %s%s is configured at ",
|
|
|
|
dp->d_name, wnum(dp->d_unit));
|
|
|
|
|
|
|
|
fprintf(stderr,
|
|
|
|
"%s%s which is not fixed at a single adapter.\n",
|
|
|
|
mp->d_name, wnum(mp->d_unit));
|
1995-03-01 22:34:05 +00:00
|
|
|
}
|
1995-05-30 03:57:47 +00:00
|
|
|
|
1995-03-01 22:34:05 +00:00
|
|
|
fprintf(fp, "{ ");
|
|
|
|
fprintf(fp, "\"%s\", ", dp->d_name);
|
|
|
|
id_put(fp, dp->d_unit, ", ");
|
|
|
|
id_put(fp, mp->d_unit, ", ");
|
|
|
|
id_put(fp, dp->d_target, ", ");
|
|
|
|
id_put(fp, dp->d_lun, ", ");
|
|
|
|
fprintf(fp, " 0x%x },\n", dp->d_flags);
|
|
|
|
}
|
1995-09-19 16:37:34 +00:00
|
|
|
fprintf(fp, "{ 0, 0, 0, 0, 0, 0 }\n");
|
|
|
|
fprintf(fp, "};\n");
|
1995-03-01 22:34:05 +00:00
|
|
|
}
|
|
|
|
|
1994-05-26 13:24:02 +00:00
|
|
|
/*
|
|
|
|
* XXX - there should be a general function to print devtabs instead of these
|
|
|
|
* little pieces of it.
|
|
|
|
*/
|
|
|
|
|
1999-04-17 14:41:41 +00:00
|
|
|
static char *
|
1994-05-26 05:23:31 +00:00
|
|
|
sirq(num)
|
|
|
|
{
|
|
|
|
|
|
|
|
if (num == -1)
|
|
|
|
return ("0");
|
|
|
|
sprintf(errbuf, "IRQ%d", num);
|
|
|
|
return (errbuf);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
1998-06-09 14:02:08 +00:00
|
|
|
#if MACHINE_ALPHA
|
|
|
|
void
|
|
|
|
alpha_ioconf()
|
|
|
|
{
|
|
|
|
register struct device *dp, *mp;
|
|
|
|
FILE *fp;
|
|
|
|
int dev_id = 10;
|
1998-07-21 21:47:51 +00:00
|
|
|
int count;
|
1998-06-09 14:02:08 +00:00
|
|
|
|
|
|
|
fp = fopen(path("ioconf.c.new"), "w");
|
|
|
|
if (fp == 0)
|
|
|
|
err(1, "%s", path("ioconf.c"));
|
|
|
|
fprintf(fp, "#include <sys/types.h>\n");
|
|
|
|
fprintf(fp, "#include <sys/time.h>\n");
|
1998-07-21 21:47:51 +00:00
|
|
|
fprintf(fp, "#include <sys/queue.h>\n\n");
|
1999-04-16 21:28:10 +00:00
|
|
|
fprintf(fp, "#include <sys/sysctl.h>\n");
|
1998-07-21 21:47:51 +00:00
|
|
|
fprintf(fp, "#include <sys/bus_private.h>\n");
|
|
|
|
fprintf(fp, "#include <isa/isareg.h>\n\n");
|
1998-06-09 14:02:08 +00:00
|
|
|
fprintf(fp, "#define C (char *)\n\n");
|
|
|
|
|
1999-04-16 21:28:10 +00:00
|
|
|
write_devtab(fp);
|
1998-07-21 21:47:51 +00:00
|
|
|
|
1998-06-09 14:02:08 +00:00
|
|
|
if (seen_scbus)
|
1998-10-16 15:00:18 +00:00
|
|
|
scbus_devtab(fp, &dev_id);
|
1998-06-09 14:02:08 +00:00
|
|
|
|
|
|
|
(void) fclose(fp);
|
|
|
|
moveifchanged(path("ioconf.c.new"), path("ioconf.c"));
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
1999-04-17 14:41:41 +00:00
|
|
|
static char *
|
1994-05-26 05:23:31 +00:00
|
|
|
intv(dev)
|
|
|
|
register struct device *dev;
|
|
|
|
{
|
|
|
|
static char buf[20];
|
|
|
|
|
|
|
|
if (dev->d_vec == 0)
|
|
|
|
return (" 0");
|
|
|
|
(void) sprintf(buf, "%sint%d", dev->d_name, dev->d_unit);
|
|
|
|
return (buf);
|
|
|
|
}
|
|
|
|
|
1999-04-17 14:41:41 +00:00
|
|
|
static char *
|
1994-05-26 05:23:31 +00:00
|
|
|
qu(num)
|
|
|
|
{
|
|
|
|
|
|
|
|
if (num == QUES)
|
|
|
|
return ("'?'");
|
|
|
|
if (num == UNKNOWN)
|
|
|
|
return (" -1");
|
|
|
|
(void) sprintf(errbuf, "%3d", num);
|
|
|
|
return (errbuf);
|
|
|
|
}
|
|
|
|
|
1999-04-17 14:41:41 +00:00
|
|
|
static char *
|
1994-05-26 05:23:31 +00:00
|
|
|
wnum(num)
|
|
|
|
{
|
|
|
|
|
|
|
|
if (num == QUES || num == UNKNOWN)
|
|
|
|
return ("?");
|
|
|
|
(void) sprintf(errbuf, "%d", num);
|
|
|
|
return (errbuf);
|
|
|
|
}
|