untic.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1996, by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* untic.c CURSES Library
*
* Copyright 1990, 1992 by Mortice Kern Systems Inc. All rights reserved.
*
* Portions of this code Copyright 1982 by Pavel Curtis.
*
*/
#ifdef M_RCSID
#ifndef lint
#endif
#endif
#include <mks.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <term.h>
#include <unistd.h>
#include <m_ord.h>
#ifdef _XOPEN_CURSES
/*
* MKS XCurses to be conforming has to avoid name space pollution
* by using reserved prefixes. Map the pre-XCurses names to the
* new ones.
*/
#define BOOLCOUNT __COUNT_BOOL
#define NUMCOUNT __COUNT_NUM
#define STRCOUNT __COUNT_STR
#define boolnames __m_boolnames
#define boolcodes __m_boolcodes
#define boolfnames __m_boolfnames
#define numnames __m_numnames
#define numcodes __m_numcodes
#define numfnames __m_numfnames
#define strnames __m_strnames
#define strcodes __m_strcodes
#define strfnames __m_strfnames
#define __t_term_header terminfo_header_t
#define TERMINFO_MAGIC __TERMINFO_MAGIC
#define term_names _names
#endif
extern char *_cmdname;
/* Exit Status */
#define SUCCESS 0
#define NOT_DEFINED 1
#define USAGE 2
#define BAD_TERMINAL 3
#define NOT_VALID 4
#define ERROR 5
char **Bool;
char **Num;
char **Str;
3138, "%s - Display compiled terminfo database entry. Oct 92\n", "I _"
);
int
int argc;
char **argv;
{
int err;
--argc;
++argv;
break;
}
while (*ap != '\0') {
switch (*ap++) {
case 'C':
break;
case 'I':
break;
case 'L':
Bool = boolfnames;
break;
case 'V':
(void) fprintf(
);
break;
default:
(void) fprintf(
);
return (USAGE);
}
break;
}
}
if (argc <= 0) {
return (USAGE);
}
/* Assume that, even if there were no parameters, space
* for argv[0] (the command name) and argv[1] (NULL) would
* have been put aside. We can use this space to fake a
* a single default parameter.
*/
argc = 1;
}
use_env(0);
switch (err) {
case 1:
(void) del_curterm(cur_term);
break;
case 0:
*argv
);
return (BAD_TERMINAL);
case -1:
return (BAD_TERMINAL);
}
}
return (SUCCESS);
}
/*f
* Dump the contents of a compiled terminfo file into a
* human readable format.
*/
STATIC void
{
int i;
char *p;
for (i = 0; i < BOOLCOUNT; ++i) {
}
for (i = 0; i < NUMCOUNT; ++i) {
}
for (i = 0; i < STRCOUNT; ++i) {
}
}
(void) putchar('\n');
}
/*f
* Display error message.
*/
STATIC void
{
}
/*f
* This routine is a codeset independent method of specifying a translation
* from an internal binary value, to an unambiguous printable format.
* This mapping is defined by Table 2-13 in section 2-12 of POSIX.2.
*
* of additional characters: <escape>, <space>, <colon>, <caret>, <comma>
*/
char *
escape(c)
int c;
{
int i;
static char buf[5];
static int cntl_code[] = {
-1
};
static char *cntl_str[] = {
"\\0", "\\\\", "\\a", "\\b", "\\f", "\\n", "\\r", "\\t",
"\\v", "\\E", "\\s", "\\:", "\\^", "\\,"
};
for (i = 0; cntl_code[i] != -1; ++i)
if (c == cntl_code[i])
return (cntl_str[i]);
if (!isprint(c))
else
return (buf);
}