sl.h revision 72445
1257752Semaste/* 2257752Semaste * Copyright (c) 1995 - 2000 Kungliga Tekniska H�gskolan 3257752Semaste * (Royal Institute of Technology, Stockholm, Sweden). 4257752Semaste * All rights reserved. 5257752Semaste * 6257752Semaste * Redistribution and use in source and binary forms, with or without 7257752Semaste * modification, are permitted provided that the following conditions 8257752Semaste * are met: 9257752Semaste * 10257752Semaste * 1. Redistributions of source code must retain the above copyright 11257752Semaste * notice, this list of conditions and the following disclaimer. 12257752Semaste * 13257752Semaste * 2. Redistributions in binary form must reproduce the above copyright 14257752Semaste * notice, this list of conditions and the following disclaimer in the 15257752Semaste * documentation and/or other materials provided with the distribution. 16257752Semaste * 17257752Semaste * 3. Neither the name of the Institute nor the names of its contributors 18257752Semaste * may be used to endorse or promote products derived from this software 19257752Semaste * without specific prior written permission. 20257752Semaste * 21257752Semaste * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 22257752Semaste * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23257752Semaste * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24257752Semaste * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 25257752Semaste * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26257752Semaste * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27257752Semaste * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28257752Semaste * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29257752Semaste * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30257752Semaste * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31257752Semaste * SUCH DAMAGE. 32257752Semaste */ 33257752Semaste 34257752Semaste/* $Id: sl.h,v 1.9 2001/01/26 14:58:41 joda Exp $ */ 35257752Semaste 36257752Semaste#ifndef _SL_H 37257752Semaste#define _SL_H 38257752Semaste 39257752Semaste#define SL_BADCOMMAND -1 40257752Semaste 41257752Semastetypedef int (*cmd_func)(int, char **); 42257752Semaste 43257752Semastestruct sl_cmd { 44257752Semaste char *name; 45257752Semaste cmd_func func; 46257752Semaste char *usage; 47257752Semaste char *help; 48257752Semaste}; 49257752Semaste 50257752Semastetypedef struct sl_cmd SL_cmd; 51257752Semaste 52257752Semastevoid sl_help (SL_cmd *, int argc, char **argv); 53257752Semasteint sl_loop (SL_cmd *, const char *prompt); 54257752Semasteint sl_command_loop (SL_cmd *cmds, const char *prompt, void **data); 55257752Semasteint sl_command (SL_cmd *cmds, int argc, char **argv); 56257752Semasteint sl_make_argv(char*, int*, char***); 57257752Semastevoid sl_apropos (SL_cmd *cmd, const char *topic); 58257752Semaste 59257752Semaste 60257752Semaste#endif /* _SL_H */ 61257752Semaste