read.h revision 148834
1238788Sandrew/*- 2238788Sandrew * Copyright (c) 2001 The NetBSD Foundation, Inc. 3238788Sandrew * All rights reserved. 4238788Sandrew * 5238788Sandrew * This code is derived from software contributed to The NetBSD Foundation 6238788Sandrew * by Anthony Mallet. 7238788Sandrew * 8238788Sandrew * Redistribution and use in source and binary forms, with or without 9238788Sandrew * modification, are permitted provided that the following conditions 10238788Sandrew * are met: 11238788Sandrew * 1. Redistributions of source code must retain the above copyright 12238788Sandrew * notice, this list of conditions and the following disclaimer. 13238788Sandrew * 2. Redistributions in binary form must reproduce the above copyright 14238788Sandrew * notice, this list of conditions and the following disclaimer in the 15238788Sandrew * documentation and/or other materials provided with the distribution. 16238788Sandrew * 3. All advertising materials mentioning features or use of this software 17238788Sandrew * must display the following acknowledgement: 18238788Sandrew * This product includes software developed by the NetBSD 19238788Sandrew * Foundation, Inc. and its contributors. 20238788Sandrew * 4. Neither the name of The NetBSD Foundation nor the names of its 21238788Sandrew * contributors may be used to endorse or promote products derived 22238788Sandrew * from this software without specific prior written permission. 23238788Sandrew * 24238788Sandrew * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 25238788Sandrew * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 26238788Sandrew * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 27238788Sandrew * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 28238788Sandrew * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29238788Sandrew * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30238788Sandrew * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31238788Sandrew * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 32238788Sandrew * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33238788Sandrew * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34238788Sandrew * POSSIBILITY OF SUCH DAMAGE. 35238788Sandrew * 36238788Sandrew * $NetBSD: read.h,v 1.4 2004/02/27 14:52:18 christos Exp $ 37238788Sandrew * $FreeBSD: head/lib/libedit/read.h 148834 2005-08-07 20:55:59Z stefanf $ 38238788Sandrew */ 39238788Sandrew 40238788Sandrew/* 41238788Sandrew * el.read.h: Character reading functions 42238788Sandrew */ 43238788Sandrew#ifndef _h_el_read 44238788Sandrew#define _h_el_read 45238788Sandrew 46238788Sandrewtypedef int (*el_rfunc_t)(EditLine *, char *); 47238788Sandrew 48238788Sandrewtypedef struct el_read_t { 49238788Sandrew el_rfunc_t read_char; /* Function to read a character */ 50238788Sandrew} el_read_t; 51238788Sandrew 52238788Sandrewprotected int read_init(EditLine *); 53238788Sandrewprotected void read_prepare(EditLine *); 54238788Sandrewprotected void read_finish(EditLine *); 55238788Sandrewprotected int el_read_setfn(EditLine *, el_rfunc_t); 56238788Sandrewprotected el_rfunc_t el_read_getfn(EditLine *); 57238788Sandrew 58238788Sandrew#endif /* _h_el_read */ 59238788Sandrew