/*
* 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) 1988 AT&T */
/* All Rights Reserved */
/*
* Copyright (c) 1997, by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdlib.h>
#include "curses_inc.h"
/*
* Translate process code to byte-equivalent
* Return the length of the byte-equivalent string
*/
/*
* use _curs_wctomb() instead of _code2byte(code, bytes)
*/
/*
* Translate a set of byte to a single process code
*/
/*
* use _curs_mbtowc() instead of wchar_t _byte2code(bytes)
*/
/*
* Translate a string of wchar_t to a byte string.
* code: the input code string
* byte: if not NULL, space to store the output string
* n: maximum number of codes to be translated.
*/
char
{
char *bufp;
static char *buf;
static int bufsize;
/* compute the length of the code string */
if (n < 0)
for (n = 0; code[n] != 0; ++n)
;
/* get space to store the translated string */
if (buf)
bufsize = 0;
}
/* no space to do it */
return (NULL);
/* start the translation */
++code;
}
*bufp = '\0';
}
/*
* Translate a byte-string to a wchar_t string.
*/
{
char *endbyte;
static int bufsize;
if (n < 0)
for (n = 0; byte[n] != '\0'; ++n)
;
if (buf)
bufsize = n + 1;
NULL)
bufsize = 0;
}
return (NULL);
width++;
}
}
*bufp = 0;
}