1/* Copyright (C) 2019 Sören Tempel 2 * 3 * This program is free software: you can redistribute it and/or modify 4 * it under the terms of the GNU General Public License as published by 5 * the Free Software Foundation, either version 3 of the License, or 6 * (at your option) any later version. 7 * 8 * This program is distributed in the hope that it will be useful, 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11 * GNU General Public License for more details.12 *13 * You should have received a copy of the GNU General Public License14 * along with this program. If not, see <https://www.gnu.org/licenses/>.15 */1617#ifndef EDITLINE_TABCOMP18#define EDITLINE_TABCOMP1920#include <histedit.h>2122/* Completion functions, receives the input prefix and its length. */23typedef void (*compfn)(const char *, size_t);2425/* Can be called from the completion function, adds a completion to the26 * list of suggested completions, performs memory allocations */27void addcomp(char *);2829/* Initializes the completion API with the given completion function.30 * The second argument indicates what kind of completions should be31 * performed. If zero lines are completed, otherwise individual words. */32void initcomp(compfn, int);3334/* Editline completion function which needs to be added using EL_ADDFN35 * and bound to the completion key (e.g. tab) using EL_BIND. */36unsigned char complete(EditLine *, int);3738#endif