优化源码配置宏位置,方便个性化编译

This commit is contained in:
2025-12-16 09:13:30 +08:00
parent 08589dfe79
commit cd75b098f5
9 changed files with 62 additions and 36 deletions

View File

@ -174,6 +174,8 @@ int exce(const int command,ctx *all_ctx)
all_ctx->statue = -1;
write(all_ctx->fifofd[1],"q",1);
return 1;
default :
return -1;
}
}
@ -186,7 +188,7 @@ int interpret(int mod, ctx *all_ctx,Cmd *cmd_dic)
split(all_ctx->command,all_ctx);
get_args(all_ctx);
char *cmd_buf = malloc(MAX_BUF);
char *cmd_buf = malloc(INTER_MAX_BUF);
int len;
if(all_ctx->space_index[0]==0)
{
@ -214,5 +216,8 @@ int interpret(int mod, ctx *all_ctx,Cmd *cmd_dic)
if (mod == FILE_MOD)
{
//todo 读取命令脚本并执行
return -1;
}
return -1;
}

View File

@ -1,7 +1,7 @@
#ifndef INTERPRETER
#define INTERPRETER
#define MAX_BUF 256
#include "config.h"
#define SIG_MOD 0
#define FILE_MOD 1
@ -37,7 +37,7 @@ typedef struct ctx
int line;//当前行长度
int word;//当前解释词位置
args *arg;//当前环境下参数链表
char command[MAX_BUF];//当前行缓存
char command[INTER_MAX_BUF];//当前行缓存
int statue;//当前状态
int fifofd[2];
log_manager *log_manager;