1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2024-12-01 21:23:09 +02:00
xburst-tools/jzboot/include/shell.h

50 lines
1.7 KiB
C
Raw Permalink Normal View History

2010-12-04 03:14:23 +02:00
/*
* JzBoot: an USB bootloader for JZ series of Ingenic(R) microprocessors.
* Copyright (C) 2010 Sergey Gridassov <grindars@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __SHELL__H__
#define __SHELL__H__
2010-12-10 11:43:54 +02:00
#ifndef SHELL_INTERNALS
typedef void shell_context_t;
#endif
typedef struct shell_command {
2010-12-04 03:14:23 +02:00
const char *cmd;
const char *description;
2010-12-10 11:43:54 +02:00
int (*handler)(shell_context_t *ctx, int argc, char *argv[]);
const char *args;
2010-12-04 03:14:23 +02:00
} shell_command_t;
2010-12-10 11:43:54 +02:00
shell_context_t *shell_init(void *ingenic);
void shell_fini(shell_context_t *context);
2010-12-04 03:14:23 +02:00
2010-12-10 11:43:54 +02:00
void shell_interactive(shell_context_t *ctx);
int shell_source(shell_context_t *ctx, const char *filename);
int shell_execute(shell_context_t *ctx, const char *input);
void *shell_device(shell_context_t *ctx);
int shell_run(shell_context_t *ctx, int argc, char *argv[]);
2010-12-04 03:14:23 +02:00
2010-12-10 11:43:54 +02:00
void shell_exit(shell_context_t *ctx, int val);
int shell_enumerate_commands(shell_context_t *ctx, int (*callback)(shell_context_t *ctx, const shell_command_t *cmd, void *arg), void *arg);
2010-12-04 03:14:23 +02:00
extern const shell_command_t spl_cmdset[];
2010-12-04 05:43:15 +02:00
extern const shell_command_t usbboot_cmdset[];
2010-12-10 11:43:54 +02:00
extern const shell_command_t builtin_cmdset[];
2010-12-04 03:14:23 +02:00
#endif