fork of PCE focusing on macplus, supporting DaynaPort SCSI network emulation
at master 66 lines 2.7 kB view raw
1/***************************************************************************** 2 * pce * 3 *****************************************************************************/ 4 5/***************************************************************************** 6 * File name: src/lib/cmd.h * 7 * Created: 2003-11-08 by Hampa Hug <hampa@hampa.ch> * 8 * Copyright: (C) 2003-2009 Hampa Hug <hampa@hampa.ch> * 9 *****************************************************************************/ 10 11/***************************************************************************** 12 * This program is free software. You can redistribute it and / or modify it * 13 * under the terms of the GNU General Public License version 2 as published * 14 * by the Free Software Foundation. * 15 * * 16 * This program is distributed in the hope that it will be useful, but * 17 * WITHOUT ANY WARRANTY, without even the implied warranty of * 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * 19 * Public License for more details. * 20 *****************************************************************************/ 21 22 23#ifndef PCE_LIB_CMD_H 24#define PCE_LIB_CMD_H 1 25 26 27#define PCE_CMD_MAX 256 28 29 30typedef struct { 31 unsigned i; 32 char str[PCE_CMD_MAX]; 33} cmd_t; 34 35 36void cmd_get (cmd_t *cmd, const char *prompt); 37void cmd_set_str (cmd_t *cmd, const char *str); 38void cmd_rewind (cmd_t *cmd); 39const char *cmd_get_str (cmd_t *cmd); 40 41void cmd_list_syms (cmd_t *cmd); 42 43void cmd_error (cmd_t *cmd, const char *str); 44 45int cmd_match_space (cmd_t *cmd); 46int cmd_match_ident (cmd_t *cmd, char *str, unsigned max); 47int cmd_match_str (cmd_t *cmd, char *str, unsigned max); 48int cmd_match_eol (cmd_t *cmd); 49int cmd_match_end (cmd_t *cmd); 50int cmd_match (cmd_t *cmd, const char *str); 51 52int cmd_match_expr (cmd_t *cmd, unsigned long *val, unsigned base); 53 54int cmd_match_ulng (cmd_t *cmd, unsigned long *val, unsigned base); 55int cmd_match_uint (cmd_t *cmd, unsigned *val, unsigned base); 56 57int cmd_match_uint16b (cmd_t *cmd, unsigned short *val, unsigned base); 58int cmd_match_uint16 (cmd_t *cmd, unsigned short *val); 59int cmd_match_uint32b (cmd_t *cmd, unsigned long *val, unsigned base); 60int cmd_match_uint32 (cmd_t *cmd, unsigned long *val); 61int cmd_match_uint16_16 (cmd_t *cmd, unsigned short *seg, unsigned short *ofs); 62 63void cmd_init (void *ext, void *getsym, void *setsym); 64 65 66#endif