1*ae19eda8Szrj /* $NetBSD: literal.h,v 1.2 2017/06/30 20:26:52 kre Exp $ */ 2*ae19eda8Szrj 3*ae19eda8Szrj /*- 4*ae19eda8Szrj * Copyright (c) 2017 The NetBSD Foundation, Inc. 5*ae19eda8Szrj * All rights reserved. 6*ae19eda8Szrj * 7*ae19eda8Szrj * This code is derived from software contributed to The NetBSD Foundation 8*ae19eda8Szrj * by Christos Zoulas. 9*ae19eda8Szrj * 10*ae19eda8Szrj * Redistribution and use in source and binary forms, with or without 11*ae19eda8Szrj * modification, are permitted provided that the following conditions 12*ae19eda8Szrj * are met: 13*ae19eda8Szrj * 1. Redistributions of source code must retain the above copyright 14*ae19eda8Szrj * notice, this list of conditions and the following disclaimer. 15*ae19eda8Szrj * 2. Redistributions in binary form must reproduce the above copyright 16*ae19eda8Szrj * notice, this list of conditions and the following disclaimer in the 17*ae19eda8Szrj * documentation and/or other materials provided with the distribution. 18*ae19eda8Szrj * 19*ae19eda8Szrj * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20*ae19eda8Szrj * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21*ae19eda8Szrj * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22*ae19eda8Szrj * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23*ae19eda8Szrj * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24*ae19eda8Szrj * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25*ae19eda8Szrj * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26*ae19eda8Szrj * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27*ae19eda8Szrj * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28*ae19eda8Szrj * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29*ae19eda8Szrj * SUCH DAMAGE. 30*ae19eda8Szrj */ 31*ae19eda8Szrj 32*ae19eda8Szrj /* 33*ae19eda8Szrj * el.literal.h: Literal character 34*ae19eda8Szrj */ 35*ae19eda8Szrj #ifndef _h_el_literal 36*ae19eda8Szrj #define _h_el_literal 37*ae19eda8Szrj 38*ae19eda8Szrj #define EL_LITERAL ((wint_t)0x80000000) 39*ae19eda8Szrj 40*ae19eda8Szrj typedef struct el_literal_t { 41*ae19eda8Szrj char **l_buf; /* array of buffers */ 42*ae19eda8Szrj size_t l_idx; /* max in use */ 43*ae19eda8Szrj size_t l_len; /* max allocated */ 44*ae19eda8Szrj } el_literal_t; 45*ae19eda8Szrj 46*ae19eda8Szrj libedit_private void literal_init(EditLine *); 47*ae19eda8Szrj libedit_private void literal_end(EditLine *); 48*ae19eda8Szrj libedit_private void literal_clear(EditLine *); 49*ae19eda8Szrj libedit_private wint_t literal_add(EditLine *, const wchar_t *, 50*ae19eda8Szrj const wchar_t *, int *); 51*ae19eda8Szrj libedit_private const char *literal_get(EditLine *, wint_t); 52*ae19eda8Szrj 53*ae19eda8Szrj #endif /* _h_el_literal */ 54