/*	Copyright (c) 1988 AT&T	*/
/*	  All Rights Reserved  	*/

/*	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T	*/
/*	The copyright notice above does not evidence any   	*/
/*	actual or intended publication of such source code.	*/

/*
 *      Copyright (c) 1997, by Sun Microsystems, Inc.
 *      All rights reserved.
 */

#pragma ident	"@(#)curs_set.c	1.9	97/08/22 SMI"	/* SVr4.0 1.8	*/

/*LINTLIBRARY*/

#include	<sys/types.h>
#include	"curses_inc.h"

/* Change the style of cursor in use. */

int
curs_set(int visibility)
{
	int	ret = cur_term->_cursorstate;
	char	**cursor_seq = cur_term->cursor_seq;

	if ((visibility < 0) || (visibility > 2) || (!cursor_seq[visibility]))
		ret = ERR;
	else
		if (visibility != ret)
			(void) tputs(cursor_seq[cur_term->_cursorstate =
			    /*LINTED*/
			    (char)visibility], 0, _outch);
	(void) fflush(SP->term_file);
	return (ret);
}
