/*
* 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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
* The Regents of the University of California
* All Rights Reserved
*
* University Acknowledgment- Portions of this document are derived from
* software developed by the University of California, Berkeley, and its
* contributors.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*LINTLIBRARY*/
#include <stdlib.h>
#include "curses_inc.h"
/*
* Figure out (roughly) how much each of these capabilities costs.
* In the parameterized cases, we just take a typical case and
* use that value. This is done only once at startup, since it
* would be too expensive for intensive use.
*/
static int _cost_fn(char *, int);
static short offsets[] = {
52, /* insert_character, */
21, /* delete_character, */
12, /* cursor_home, */
18, /* cursor_to_ll, */
14, /* cursor_left, */
17, /* cursor_right, */
11, /* cursor_down, */
19, /* cursor_up, */
2, /* carriage_return, */
134, /* tab, */
0, /* back_tab, */
6, /* clr_eol, */
269, /* clr_bol, */
108, /* parm_ich, */
105, /* parm_dch, */
111, /* parm_left_cursor, */
114, /* parm_up_cursor, */
107, /* parm_down_cursor, */
112, /* parm_right_cursor, */
};
void
_init_costs(void)
{
int i = 0;
xon_xoff = 0;
/*
* This next block of code is actually correct in that it takes into
* account many things that wrefresh has to keep figuring in the function
* _useidch. Wrefresh MUST be changed (in the words of Tony Hansen) !!!
*
* Wrefresh has been changed (in my words -Phong Vo) !!!!
*/
while (i < FIRST_LOOP)
while (i < SECOND_LOOP)
#ifdef DEBUG
if (outf) {
_cost_fn(exit_insert_mode, 0));
}
#endif /* DEBUG */
/*FALLTHROUGH*/
}
static int counter = 0;
int
/* ARGSUSED */
{
counter++;
return (0);
}
/*
* Figure out the _COST in characters to print this string.
* Due to padding, we can't just use strlen, so instead we
* feed it through tputs and trap the results.
* pad chars here since they estimate the real time to do the
* operation, useful in calculating costs.
*/
static int
{
return (LARGECOST);
counter = 0;
return (counter);
}