mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-12-26 15:44:51 +01:00
24cb244d43
This was a _ton_ of changes, made 15 years ago, so there are probably some problems to work out still. Among others: Engine/Base/Stream.* was mostly abandoned and will need to be re-ported. Still, this is a pretty good start, and probably holds a world record for lines of changes or something. :)
78 lines
2.0 KiB
C++
78 lines
2.0 KiB
C++
/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */
|
|
|
|
#ifndef SE_INCL_SHELL_INTERNAL_H
|
|
#define SE_INCL_SHELL_INTERNAL_H
|
|
#ifdef PRAGMA_ONCE
|
|
#pragma once
|
|
#endif
|
|
|
|
#include <Engine/Base/CTString.h>
|
|
|
|
// basic data type types
|
|
enum ShellTypeType {
|
|
STT_ILLEGAL ,
|
|
STT_POINTER ,
|
|
STT_FUNCTION ,
|
|
STT_ARRAY ,
|
|
STT_VOID ,
|
|
STT_INDEX ,
|
|
STT_FLOAT ,
|
|
STT_STRING ,
|
|
};
|
|
|
|
|
|
// data type structure
|
|
struct ShellType {
|
|
ShellType() :
|
|
st_sttType(STT_ILLEGAL),
|
|
st_ctArraySize(0),
|
|
st_istBaseType(0),
|
|
st_istFirstArgument(0),
|
|
st_istLastArgument(0),
|
|
st_istNextInArguments(0),
|
|
st_istPrevInArguments(0)
|
|
{
|
|
}
|
|
|
|
enum ShellTypeType st_sttType;
|
|
|
|
INDEX st_ctArraySize; // number of members if an array
|
|
|
|
INDEX st_istBaseType; // type pointed to by a pointer, or member of array
|
|
// or result of a function
|
|
|
|
INDEX st_istFirstArgument; // first argument in function
|
|
INDEX st_istLastArgument; // last argument in function
|
|
INDEX st_istNextInArguments; // next argument in function
|
|
INDEX st_istPrevInArguments; // previous argument in function
|
|
};
|
|
|
|
// symbol flags
|
|
#define SSF_CONSTANT (1L<<0) // the symbol cannot be changed
|
|
#define SSF_USER (1L<<1) // the symbol is visible to user (with ListSymbols() )
|
|
#define SSF_PERSISTENT (1L<<2) // the symbol is saved when exiting
|
|
#define SSF_EXTERNAL (1L<<3) // the symbol was declared externally (in a script)
|
|
|
|
// A symbol defined for using in shell.
|
|
class CShellSymbol {
|
|
public:
|
|
// implementation:
|
|
INDEX ss_istType; // type of the symbol
|
|
CTString ss_strName; // symbol name
|
|
void *ss_pvValue; // symbol value
|
|
BOOL (*ss_pPreFunc)(void *);
|
|
void (*ss_pPostFunc)(void *);
|
|
ULONG ss_ulFlags; // various flags
|
|
// Clear function.
|
|
void Clear(void);
|
|
// check if declared
|
|
BOOL IsDeclared(void);
|
|
// interface:
|
|
// get string for 'tab' completion in console
|
|
ENGINE_API CTString GetCompletionString(void) const;
|
|
};
|
|
|
|
|
|
#endif /* include-once check. */
|
|
|