#ifndef HALCMD_H
#define HALCMD_H
#include <stdio.h>
#include "hal.h"
extern int halcmd_startup(int quiet);
extern void halcmd_shutdown();
extern int halcmd_parse_cmd(char * tokens[]);
extern int halcmd_parse_line(char * line);
extern void halcmd_shutdown(void);
extern int prompt_mode, echo_mode, errorcount, halcmd_done;
extern int halcmd_preprocess_line ( char *line, char **tokens);
void halcmd_info(const char *format,...) __attribute__((format(printf,1,2)));
void halcmd_output(const char *format,...) __attribute__((format(printf,1,2)));
void halcmd_warning(const char *format,...) __attribute__((format(printf,1,2)));
void halcmd_error(const char *format,...) __attribute__((format(printf,1,2)));
void halcmd_echo(const char *format,...) __attribute__((format(printf,1,2)));
void halcmd_set_filename(const char *new_filename);
const char *halcmd_get_filename(void);
void halcmd_set_linenumber(int new_linenumber);
int halcmd_get_linenumber(void);
enum halcmd_argtype {
A_ZERO,
A_ONE,
A_TWO,
A_THREE,
A_PLUS = 0x100,
A_REMOVE_ARROWS = 0x200,
A_OPTIONAL = 0x400,
A_TILDE = 0x800,
};
typedef int(*halcmd_func_t)(void);
struct halcmd_command {
const char *name;
halcmd_func_t func;
enum halcmd_argtype type;
};
extern struct halcmd_command halcmd_commands[];
extern int halcmd_ncommands;
extern FILE *halcmd_inifile;
#define MAX_TOK 32
#define MAX_CMD_LEN 1024
#define MAX_EXPECTED_SIGS 999
#endif