From c7e25e08b7b197fcef5c3418fb121182073cf32c Mon Sep 17 00:00:00 2001 From: Sjoerd van der Berg Date: Tue, 11 May 2004 18:58:18 +0000 Subject: [PATCH] Add some new function and clean up Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1793 --- include/shell.h | 12 +++--------- include/support.h | 17 ++++++++++------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/include/shell.h b/include/shell.h index 6e4b6d25..9e1f336d 100644 --- a/include/shell.h +++ b/include/shell.h @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: shell.h,v 1.4 2004-03-10 13:35:03 qbix79 Exp $ */ +/* $Id: shell.h,v 1.5 2004-05-11 18:58:18 harekiet Exp $ */ #ifndef SHELL_H_ #define SHELL_H_ @@ -57,9 +57,7 @@ public: }; class DOS_Shell : public Program { - private: - std::list l_history, l_completion; char *completion_start; @@ -117,15 +115,12 @@ struct SHELL_Cmd { const char * help; /* String with command help */ }; -static inline void StripSpaces(char*&args) -{ +static inline void StripSpaces(char*&args) { while(*args && ((*args == ' ') || (*args == '\t'))) args++; } - -static inline char* ExpandDot(char*args, char* buffer) -{ +static inline char* ExpandDot(char*args, char* buffer) { if(*args=='.') { if(*(args+1)==0) @@ -146,5 +141,4 @@ static inline char* ExpandDot(char*args, char* buffer) return buffer; } - #endif diff --git a/include/support.h b/include/support.h index 1b663347..a8ffdc1d 100644 --- a/include/support.h +++ b/include/support.h @@ -19,11 +19,11 @@ #if !defined __SUPPORT_H #define __SUPPORT_H - -#include #include #include +#include "dosbox.h" + #if defined (_MSC_VER) /* MS Visual C++ */ #define strcasecmp(a,b) stricmp(a,b) #define strncasecmp(a,b,n) _strnicmp(a,b,n) @@ -38,14 +38,17 @@ #endif void strreplace(char * str,char o,char n); -char *ltrim(char *str); -void rtrim(char * const str); -char *trim(char *str); +char *ltrim(const char *str); +char *rtrim(const char *str); +char *trim(const char *str); bool ScanCMDBool(char * cmd,char * check); char * ScanCMDRemain(char * cmd); -bool ScanCMDHex(char * cmd,char * check,Bits * result); -char * StripWord(char * cmd); +char * StripWord(char *&cmd); +bool IsDecWord(char * word); +bool IsHexWord(char * word); +Bits ConvDecWord(char * word); +Bits ConvHexWord(char * word); INLINE char * upcase(char * str) { for (char* idx = str; *idx ; idx++) *idx = toupper(*idx);