prompt.h revision 276881
1262197Srwatson/*	$NetBSD: prompt.h,v 1.10 2009/12/30 22:37:40 christos Exp $	*/
2262197Srwatson
3262197Srwatson/*-
4262197Srwatson * Copyright (c) 1992, 1993
5262197Srwatson *	The Regents of the University of California.  All rights reserved.
6262197Srwatson *
7262197Srwatson * This code is derived from software contributed to Berkeley by
8262197Srwatson * Christos Zoulas of Cornell University.
9262197Srwatson *
10262197Srwatson * Redistribution and use in source and binary forms, with or without
11262197Srwatson * modification, are permitted provided that the following conditions
12262197Srwatson * are met:
13262197Srwatson * 1. Redistributions of source code must retain the above copyright
14262197Srwatson *    notice, this list of conditions and the following disclaimer.
15262197Srwatson * 2. Redistributions in binary form must reproduce the above copyright
16262197Srwatson *    notice, this list of conditions and the following disclaimer in the
17262197Srwatson *    documentation and/or other materials provided with the distribution.
18262197Srwatson * 3. Neither the name of the University nor the names of its contributors
19262197Srwatson *    may be used to endorse or promote products derived from this software
20262197Srwatson *    without specific prior written permission.
21262197Srwatson *
22262197Srwatson * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23262197Srwatson * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24262197Srwatson * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25262197Srwatson * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26262197Srwatson * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27262197Srwatson * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28262197Srwatson * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29262197Srwatson * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30262197Srwatson * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31262197Srwatson * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32262197Srwatson * SUCH DAMAGE.
33262197Srwatson *
34262197Srwatson *	@(#)prompt.h	8.1 (Berkeley) 6/4/93
35262197Srwatson * $FreeBSD: head/lib/libedit/prompt.h 276881 2015-01-09 07:40:56Z bapt $
36262197Srwatson */
37262197Srwatson
38262197Srwatson/*
39262197Srwatson * el.prompt.h: Prompt printing stuff
40262197Srwatson */
41#ifndef _h_el_prompt
42#define	_h_el_prompt
43
44#include "histedit.h"
45
46typedef Char    *(*el_pfunc_t)(EditLine *);
47
48typedef struct el_prompt_t {
49	el_pfunc_t	p_func;		/* Function to return the prompt */
50	coord_t		p_pos;		/* position in the line after prompt */
51	Char		p_ignore;	/* character to start/end literal */
52	int		p_wide;
53} el_prompt_t;
54
55protected void	prompt_print(EditLine *, int);
56protected int	prompt_set(EditLine *, el_pfunc_t, Char, int, int);
57protected int	prompt_get(EditLine *, el_pfunc_t *, Char *, int);
58protected int	prompt_init(EditLine *);
59protected void	prompt_end(EditLine *);
60
61#endif /* _h_el_prompt */
62