winsnwstr.c revision 2
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe/*
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * CDDL HEADER START
ed22c7109fc5dd9e1b7a5d0333bdc7ad2718e2abYuri Pankov *
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * The contents of this file are subject to the terms of the
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * Common Development and Distribution License, Version 1.0 only
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * (the "License"). You may not use this file except in compliance
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * with the License.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe *
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
ed22c7109fc5dd9e1b7a5d0333bdc7ad2718e2abYuri Pankov * or http://www.opensolaris.org/os/licensing.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * See the License for the specific language governing permissions
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * and limitations under the License.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe *
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * When distributing Covered Code, include this CDDL HEADER in each
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
ed22c7109fc5dd9e1b7a5d0333bdc7ad2718e2abYuri Pankov * If applicable, add the following below this CDDL HEADER, with the
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * fields enclosed by brackets "[]" replaced with your own identifying
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * information: Portions Copyright [yyyy] [name of copyright owner]
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe *
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * CDDL HEADER END
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe */
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe/* Copyright (c) 1988 AT&T */
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe/* All Rights Reserved */
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe/*
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * Copyright (c) 1997, by Sun Microsystems, Inc.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * All rights reserved.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe */
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#pragma ident "%Z%%M% %I% %E% SMI"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe/*LINTLIBRARY*/
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#include <sys/types.h>
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe#include "curses_inc.h"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe/*
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe * Insert to 'win' at most n 'characters' of code starting at(cury, curx)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe */
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Loweint
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowewinsnwstr(WINDOW *win, wchar_t *code, int n)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe{
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe char *sp;
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe /* translate the process code to character code */
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe if ((sp = _strcode2byte(code, NULL, n)) == NULL)
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe return (ERR);
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe
ed22c7109fc5dd9e1b7a5d0333bdc7ad2718e2abYuri Pankov /* now call winsnstr to do the real work */
ed22c7109fc5dd9e1b7a5d0333bdc7ad2718e2abYuri Pankov return (winsnstr(win, sp, -1));
ed22c7109fc5dd9e1b7a5d0333bdc7ad2718e2abYuri Pankov}
ed22c7109fc5dd9e1b7a5d0333bdc7ad2718e2abYuri Pankov