optical/NxBase/console.h

67 lines
1.3 KiB
C
Raw Normal View History

2025-09-04 01:45:08 +00:00
#ifndef __CONSOLE_H__
#define __CONSOLE_H__
#include "config.h"
//---------------------------------------------------------------------------------------------
#ifndef MAX_CMD_LINE
#define MAX_CMD_LINE 50
#endif
#ifdef _IN_CONSOLE_C
int g_netDebugInfo = 0; // = 0, <20><>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> = 1, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#else
extern int g_netDebugInfo;
#endif
//---------------------------------------------------------------------------------------------
#define MAX_DEBUG_INFO_LEN 127
#define DEBUG_INFO(...) do\
{\
if (g_netDebugInfo != 0)\
{\
char str[MAX_DEBUG_INFO_LEN+1]; \
sprintf(str, __VA_ARGS__); \
str[MAX_DEBUG_INFO_LEN] = 0; \
SendDebugInfo(str); \
} \
printf(__VA_ARGS__); \
}while(0)
//---------------------------------------------------------------------------------------------
void InitConsole(void);
void ConsoleCmdScan(void);
void OutNewCmdLine(void);
int IsConsoleCancel(void);
int PutChar(int ch);
int GetChar(void);
void SetConsoleOutType(int type);
int IsNewCommand(void);
int LockExecAndGetCmdStr(char*pBuf);
void UnlockExec(void);
void SetPauseStatus(int sta);
int GetHistoryCmd(int hisIdx, char * pch);
int GetHistoryNum(void);
int GetHistoryMaxNum(void);
int GetHistoryIdx(void);
//---------------------------------------------------------------------------------------------
#endif