⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rb_clear.c

📁 可以在嵌入式应用中
💻 C
字号:
#include <CsAgb.h>
#include <variable.h>
#include <tree.h>
#include <rbasic.h>
#include <rb_data.h>
extern void rb_clean_num();
extern void rb_clean_str();
void clear_dim()//清除数组
{
   u8 i;
   for (i=0;i<rb_int_dim_count;i++) free(v_int_dim[i]);
   for (i=0;i<rb_float_dim_count;i++) free(v_float_dim[i]);//释放数组空间
   rb_int_dim_count=0;
   rb_str_dim_count=0;
   rb_float_dim_count=0;//计数器清零
   tre_destroy(rb_int_dim);
   tre_destroy(rb_str_dim);
   tre_destroy(rb_float_dim);//销毁变量树
   rb_int_dim=NULL;
   rb_str_dim=NULL;
   rb_float_dim=NULL;
}

void build_dim()//重建数组
{
   rb_int_dim=new_tre('/');
	rb_str_dim=new_tre('/');
	rb_float_dim=new_tre('/');
}

void clear_var()//清除所有变量
{
   u8 i;
   for (i=0;i<rb_str_count;i++)//释放字符串空间
   {
      if (v_str[i]!=NULL) free(v_str[i]);
      v_str[i]=NULL;
   }
   for (i=0;i<rb_int_count;i++)//释放整数空间
   {
      if (v_int[i]!=NULL) free(v_int[i]);
      v_int[i]=NULL;
   }
   for (i=0;i<rb_float_count;i++)
   {
      if (v_float[i]!=NULL) free(v_float[i]);
      v_float[i]=NULL;
   }
   rb_int_count=0;
   rb_str_count=0;
   rb_float_count=0;//计数器清空
   tre_destroy(rb_int);
   tre_destroy(rb_str);
   tre_destroy(rb_float);//销毁变量树
   rb_int=NULL;
   rb_str=NULL;
   rb_float=NULL;
}
void build_var()
{
	rb_int=new_tre('/');
	rb_str=new_tre('/');
	rb_float=new_tre('/');
}
void clear_key()
{
   tre_destroy(rb_key);
   tre_destroy(rb_math_key);
   tre_destroy(rb_str_key);//销毁关健字树
}
void build_key()
{
   rb_key=new_tre('/');//创建树根(关健字)
	rb_math_key=new_tre('/');
	rb_str_key=new_tre('/');
}
void clear_dat()
{
   rb_clean_num();
   rb_clean_str();
}
void clear_com()//清除所有命令行
{
   struct comtree *com=comstart;
   struct comtree *next;
   while (com!=NULL)
   {
      next=com->next;
      free(com);
      com=next;
   }
   rb_now_line=NULL;
   comstart=NULL;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -