2010-03-22 07:49:57 +08:00
|
|
|
/*
|
2018-10-14 19:28:18 +08:00
|
|
|
* Copyright (c) 2006-2018, RT-Thread Development Team
|
2010-03-22 07:49:57 +08:00
|
|
|
*
|
2018-10-14 19:28:18 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2010-03-22 07:49:57 +08:00
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
* 2010-03-22 Bernard first version
|
|
|
|
*/
|
2009-07-03 06:48:23 +08:00
|
|
|
#include <finsh.h>
|
|
|
|
|
|
|
|
#include "finsh_node.h"
|
|
|
|
#include "finsh_vm.h"
|
|
|
|
#include "finsh_parser.h"
|
|
|
|
#include "finsh_var.h"
|
|
|
|
#include "finsh_error.h"
|
|
|
|
#include "finsh_heap.h"
|
|
|
|
|
|
|
|
int finsh_init(struct finsh_parser* parser)
|
|
|
|
{
|
2018-03-01 21:01:20 +08:00
|
|
|
finsh_parser_init(parser);
|
2009-07-03 06:48:23 +08:00
|
|
|
|
2018-03-01 21:01:20 +08:00
|
|
|
/* finsh init */
|
|
|
|
finsh_node_init();
|
|
|
|
finsh_var_init();
|
|
|
|
finsh_error_init();
|
|
|
|
finsh_heap_init();
|
2009-07-03 06:48:23 +08:00
|
|
|
|
2018-03-01 21:01:20 +08:00
|
|
|
return 0;
|
2009-07-03 06:48:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
long finsh_stack_bottom()
|
|
|
|
{
|
|
|
|
return finsh_vm_stack[0].long_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
int finsh_flush(struct finsh_parser* parser)
|
|
|
|
{
|
2018-03-01 21:01:20 +08:00
|
|
|
finsh_parser_init(parser);
|
2009-07-03 06:48:23 +08:00
|
|
|
|
2018-03-01 21:01:20 +08:00
|
|
|
/* finsh init */
|
|
|
|
finsh_node_init();
|
|
|
|
finsh_error_init();
|
2009-07-03 06:48:23 +08:00
|
|
|
|
2018-03-01 21:01:20 +08:00
|
|
|
return 0;
|
2009-07-03 06:48:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
int finsh_reset(struct finsh_parser* parser)
|
|
|
|
{
|
2018-03-01 21:01:20 +08:00
|
|
|
/* finsh init */
|
|
|
|
finsh_node_init();
|
|
|
|
finsh_var_init();
|
|
|
|
finsh_error_init();
|
|
|
|
finsh_heap_init();
|
2009-07-03 06:48:23 +08:00
|
|
|
|
2018-03-01 21:01:20 +08:00
|
|
|
return 0;
|
2009-07-03 06:48:23 +08:00
|
|
|
}
|