1
0
Fork 0

Add some new function and clean up

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1793
This commit is contained in:
Sjoerd van der Berg 2004-05-11 18:58:18 +00:00
parent 2339e11d9c
commit c7e25e08b7
2 changed files with 13 additions and 16 deletions

View file

@ -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<std::string> 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

View file

@ -19,11 +19,11 @@
#if !defined __SUPPORT_H
#define __SUPPORT_H
#include <dosbox.h>
#include <string.h>
#include <ctype.h>
#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);