/*
* 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"
/*
*
* Terminal Information Compiler
*
* 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
static char const rcsID[] = "$Header: /rd/src/tic/rcs/ticmain.c 1.11 1995/06/22 18:40:30 ross Exp $";
#endif
#endif
#include "tic.h"
#include <ctype.h>
int curr_line;
int check_only = 0;
int debug_level = 0;
static char const dstdir_err[] = m_textstr(3106, "terminfo database directory \"%s/%s\" ", "E pathname");
static void init(void);
int
{
char *ap;
--argc;
++argv;
break;
}
while (*ap != '\0') {
switch (*ap++) {
case 'c':
check_only = 1;
continue;
case 'v':
debug_level = 1;
break;
default:
return (USAGE);
}
break;
}
}
/* There must be only one source file. */
if (argc != 1) {
return (USAGE);
}
source_file = *argv;
init();
compile();
if (warnings > 0) {
return 1;
}
return (0);
}
/*f
* Miscellaneous initializations
*
* Open source file as standard input
* Check for access rights to destination directories
* Create any directories which don't exist.
*/
static void
init(void)
{
char *s;
char const *p;
curr_line = 0;
}
destination = s;
}
if (chdir(destination) < 0) {
}
for (p = dirnames; *p != '\0'; ++p) {
*dir = *p;
exit(1);
exit(1);
}
}
}
/*f
* Reset boolean[], number[], and string[].
*/
void
reset(void)
{
int i;
for (i = 0; i < BOOLCOUNT; ++i)
boolean[i] = 0;
for (i = 0; i < NUMCOUNT; ++i)
number[i] = -1;
for (i = 0; i < STRCOUNT; ++i)
string[i] = -1;
}
/*f
* Return a linear index value.
*
* Search in the following order boolnames[], numnames[], and strnames[]
* for the matching capability name. Then map the array and index into
* a linear index. Return -1 if capname is not valid.
*
* While this linear approach is slow, TIC is seldom used once the
* database is created, therefore we don't bother spending extra
* effort to speed it up.
*/
int
{
char **p;
return (0);
}
return (0);
}
return (0);
}
return (-1);
}