2000-05-28 13:40:48 +00:00
|
|
|
/*****************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* datatype.h */
|
|
|
|
/* */
|
|
|
|
/* Type string handling for the cc65 C compiler */
|
|
|
|
/* */
|
|
|
|
/* */
|
|
|
|
/* */
|
2002-09-30 18:46:08 +00:00
|
|
|
/* (C) 1998-2002 Ullrich von Bassewitz */
|
|
|
|
/* Wacholderweg 14 */
|
|
|
|
/* D-70597 Stuttgart */
|
|
|
|
/* EMail: uz@musoftware.de */
|
2000-05-28 13:40:48 +00:00
|
|
|
/* */
|
|
|
|
/* */
|
|
|
|
/* This software is provided 'as-is', without any expressed or implied */
|
|
|
|
/* warranty. In no event will the authors be held liable for any damages */
|
|
|
|
/* arising from the use of this software. */
|
|
|
|
/* */
|
|
|
|
/* Permission is granted to anyone to use this software for any purpose, */
|
|
|
|
/* including commercial applications, and to alter it and redistribute it */
|
|
|
|
/* freely, subject to the following restrictions: */
|
|
|
|
/* */
|
|
|
|
/* 1. The origin of this software must not be misrepresented; you must not */
|
|
|
|
/* claim that you wrote the original software. If you use this software */
|
|
|
|
/* in a product, an acknowledgment in the product documentation would be */
|
|
|
|
/* appreciated but is not required. */
|
|
|
|
/* 2. Altered source versions must be plainly marked as such, and must not */
|
|
|
|
/* be misrepresented as being the original software. */
|
|
|
|
/* 3. This notice may not be removed or altered from any source */
|
|
|
|
/* distribution. */
|
|
|
|
/* */
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef DATATYPE_H
|
|
|
|
#define DATATYPE_H
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2000-08-19 21:55:06 +00:00
|
|
|
/* common */
|
|
|
|
#include "attrib.h"
|
|
|
|
|
2001-03-23 19:17:04 +00:00
|
|
|
/* cc65 */
|
|
|
|
#include "funcdesc.h"
|
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* Data */
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-07-27 21:08:52 +00:00
|
|
|
|
2000-12-20 17:44:12 +00:00
|
|
|
/* Basic data types */
|
2000-08-01 15:04:35 +00:00
|
|
|
enum {
|
|
|
|
T_END = 0x0000,
|
2000-07-27 21:08:52 +00:00
|
|
|
|
2000-12-20 17:44:12 +00:00
|
|
|
/* Basic types */
|
2000-07-27 21:08:52 +00:00
|
|
|
T_TYPE_NONE = 0x0000,
|
|
|
|
T_TYPE_CHAR = 0x0001,
|
2000-08-01 18:45:08 +00:00
|
|
|
T_TYPE_SHORT = 0x0002,
|
|
|
|
T_TYPE_INT = 0x0003,
|
|
|
|
T_TYPE_LONG = 0x0004,
|
|
|
|
T_TYPE_LONGLONG = 0x0005,
|
|
|
|
T_TYPE_ENUM = 0x0006,
|
|
|
|
T_TYPE_FLOAT = 0x0007,
|
|
|
|
T_TYPE_DOUBLE = 0x0008,
|
|
|
|
T_TYPE_VOID = 0x0009,
|
|
|
|
T_TYPE_STRUCT = 0x000A,
|
|
|
|
T_TYPE_UNION = 0x000B,
|
|
|
|
T_TYPE_ARRAY = 0x000C,
|
|
|
|
T_TYPE_PTR = 0x000D,
|
|
|
|
T_TYPE_FUNC = 0x000E,
|
2000-07-27 21:08:52 +00:00
|
|
|
T_MASK_TYPE = 0x001F,
|
|
|
|
|
2000-12-20 17:44:12 +00:00
|
|
|
/* Type classes */
|
2000-07-27 21:08:52 +00:00
|
|
|
T_CLASS_NONE = 0x0000,
|
|
|
|
T_CLASS_INT = 0x0020,
|
|
|
|
T_CLASS_FLOAT = 0x0040,
|
|
|
|
T_CLASS_PTR = 0x0060,
|
|
|
|
T_CLASS_STRUCT = 0x0080,
|
|
|
|
T_CLASS_FUNC = 0x00A0,
|
|
|
|
T_MASK_CLASS = 0x00E0,
|
|
|
|
|
2000-12-20 17:44:12 +00:00
|
|
|
/* Type signedness */
|
2000-07-27 21:08:52 +00:00
|
|
|
T_SIGN_NONE = 0x0000,
|
|
|
|
T_SIGN_UNSIGNED = 0x0100,
|
|
|
|
T_SIGN_SIGNED = 0x0200,
|
|
|
|
T_MASK_SIGN = 0x0300,
|
|
|
|
|
2000-12-20 17:44:12 +00:00
|
|
|
/* Type size modifiers */
|
2000-07-27 21:08:52 +00:00
|
|
|
T_SIZE_NONE = 0x0000,
|
|
|
|
T_SIZE_SHORT = 0x0400,
|
|
|
|
T_SIZE_LONG = 0x0800,
|
|
|
|
T_SIZE_LONGLONG = 0x0C00,
|
|
|
|
T_MASK_SIZE = 0x0C00,
|
|
|
|
|
2000-12-20 17:44:12 +00:00
|
|
|
/* Type qualifiers */
|
2000-07-27 21:08:52 +00:00
|
|
|
T_QUAL_NONE = 0x0000,
|
|
|
|
T_QUAL_CONST = 0x1000,
|
|
|
|
T_QUAL_VOLATILE = 0x2000,
|
|
|
|
T_MASK_QUAL = 0x3000,
|
|
|
|
|
2000-12-20 17:44:12 +00:00
|
|
|
/* Types */
|
2000-08-01 18:45:08 +00:00
|
|
|
T_CHAR = T_TYPE_CHAR | T_CLASS_INT | T_SIGN_UNSIGNED | T_SIZE_NONE,
|
|
|
|
T_SCHAR = T_TYPE_CHAR | T_CLASS_INT | T_SIGN_SIGNED | T_SIZE_NONE,
|
|
|
|
T_UCHAR = T_TYPE_CHAR | T_CLASS_INT | T_SIGN_UNSIGNED | T_SIZE_NONE,
|
|
|
|
T_SHORT = T_TYPE_SHORT | T_CLASS_INT | T_SIGN_SIGNED | T_SIZE_SHORT,
|
|
|
|
T_USHORT = T_TYPE_SHORT | T_CLASS_INT | T_SIGN_UNSIGNED | T_SIZE_SHORT,
|
|
|
|
T_INT = T_TYPE_INT | T_CLASS_INT | T_SIGN_SIGNED | T_SIZE_NONE,
|
|
|
|
T_UINT = T_TYPE_INT | T_CLASS_INT | T_SIGN_UNSIGNED | T_SIZE_NONE,
|
|
|
|
T_LONG = T_TYPE_LONG | T_CLASS_INT | T_SIGN_SIGNED | T_SIZE_LONG,
|
|
|
|
T_ULONG = T_TYPE_LONG | T_CLASS_INT | T_SIGN_UNSIGNED | T_SIZE_LONG,
|
|
|
|
T_LONGLONG = T_TYPE_LONGLONG | T_CLASS_INT | T_SIGN_SIGNED | T_SIZE_LONGLONG,
|
|
|
|
T_ULONGLONG = T_TYPE_LONGLONG | T_CLASS_INT | T_SIGN_UNSIGNED | T_SIZE_LONGLONG,
|
|
|
|
T_ENUM = T_TYPE_ENUM | T_CLASS_INT | T_SIGN_SIGNED | T_SIZE_NONE,
|
|
|
|
T_FLOAT = T_TYPE_FLOAT | T_CLASS_FLOAT | T_SIGN_NONE | T_SIZE_NONE,
|
|
|
|
T_DOUBLE = T_TYPE_DOUBLE | T_CLASS_FLOAT | T_SIGN_NONE | T_SIZE_NONE,
|
|
|
|
T_VOID = T_TYPE_VOID | T_CLASS_NONE | T_SIGN_NONE | T_SIZE_NONE,
|
|
|
|
T_STRUCT = T_TYPE_STRUCT | T_CLASS_STRUCT | T_SIGN_NONE | T_SIZE_NONE,
|
|
|
|
T_UNION = T_TYPE_UNION | T_CLASS_STRUCT | T_SIGN_NONE | T_SIZE_NONE,
|
|
|
|
T_ARRAY = T_TYPE_ARRAY | T_CLASS_PTR | T_SIGN_NONE | T_SIZE_NONE,
|
|
|
|
T_PTR = T_TYPE_PTR | T_CLASS_PTR | T_SIGN_NONE | T_SIZE_NONE,
|
|
|
|
T_FUNC = T_TYPE_FUNC | T_CLASS_FUNC | T_SIGN_NONE | T_SIZE_NONE,
|
2000-07-27 21:08:52 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
/* Forward for a symbol entry */
|
|
|
|
struct SymEntry;
|
|
|
|
|
|
|
|
/* Type entry */
|
|
|
|
typedef unsigned short type;
|
|
|
|
|
|
|
|
/* Maximum length of a type string */
|
|
|
|
#define MAXTYPELEN 30
|
|
|
|
|
2000-12-20 17:44:12 +00:00
|
|
|
/* Type elements needed for Encode/Decode */
|
2000-05-28 13:40:48 +00:00
|
|
|
#define DECODE_SIZE 5
|
|
|
|
|
2002-11-01 21:27:31 +00:00
|
|
|
/* Sizes */
|
|
|
|
#define SIZEOF_CHAR 1
|
|
|
|
#define SIZEOF_INT 2
|
|
|
|
#define SIZEOF_LONG 4
|
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
/* Predefined type strings */
|
2000-08-16 09:10:50 +00:00
|
|
|
extern type type_uchar [];
|
2000-05-28 13:40:48 +00:00
|
|
|
extern type type_int [];
|
|
|
|
extern type type_uint [];
|
|
|
|
extern type type_long [];
|
|
|
|
extern type type_ulong [];
|
|
|
|
extern type type_void [];
|
2000-08-20 09:25:47 +00:00
|
|
|
extern type type_size_t [];
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
/* Code */
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned TypeLen (const type* Type);
|
|
|
|
/* Return the length of the type string */
|
|
|
|
|
|
|
|
type* TypeCpy (type* Dest, const type* Src);
|
|
|
|
/* Copy a type string */
|
|
|
|
|
|
|
|
type* TypeCat (type* Dest, const type* Src);
|
|
|
|
/* Append Src */
|
|
|
|
|
|
|
|
type* TypeDup (const type* Type);
|
|
|
|
/* Create a copy of the given type on the heap */
|
|
|
|
|
|
|
|
type* TypeAlloc (unsigned Len);
|
|
|
|
/* Allocate memory for a type string of length Len. Len *must* include the
|
|
|
|
* trailing T_END.
|
|
|
|
*/
|
|
|
|
|
|
|
|
void TypeFree (type* Type);
|
|
|
|
/* Free a type string */
|
|
|
|
|
2002-09-30 18:46:08 +00:00
|
|
|
int SignExtendChar (int C);
|
|
|
|
/* Do correct sign extension of a character */
|
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
type GetDefaultChar (void);
|
|
|
|
/* Return the default char type (signed/unsigned) depending on the settings */
|
|
|
|
|
|
|
|
type* GetCharArrayType (unsigned Len);
|
|
|
|
/* Return the type for a char array of the given length */
|
|
|
|
|
|
|
|
type* GetImplicitFuncType (void);
|
|
|
|
/* Return a type string for an inplicitly declared function */
|
|
|
|
|
2000-08-20 09:25:47 +00:00
|
|
|
type* PointerTo (const type* T);
|
|
|
|
/* Return a type string that is "pointer to T". The type string is allocated
|
|
|
|
* on the heap and may be freed after use.
|
|
|
|
*/
|
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
void PrintType (FILE* F, const type* Type);
|
|
|
|
/* Output translation of type array. */
|
|
|
|
|
|
|
|
void PrintRawType (FILE* F, const type* Type);
|
|
|
|
/* Print a type string in raw format (for debugging) */
|
|
|
|
|
2001-05-03 17:34:54 +00:00
|
|
|
void PrintFuncSig (FILE* F, const char* Name, type* Type);
|
|
|
|
/* Print a function signature. */
|
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
void Encode (type* Type, unsigned long Val);
|
|
|
|
/* Encode an unsigned long into a type array */
|
|
|
|
|
|
|
|
void EncodePtr (type* Type, void* P);
|
|
|
|
/* Encode a pointer into a type array */
|
|
|
|
|
|
|
|
unsigned long Decode (const type* Type);
|
|
|
|
/* Decode an unsigned long from a type array */
|
|
|
|
|
|
|
|
void* DecodePtr (const type* Type);
|
|
|
|
/* Decode a pointer from a type array */
|
|
|
|
|
|
|
|
int HasEncode (const type* Type);
|
|
|
|
/* Return true if the given type has encoded data */
|
2000-07-27 21:08:52 +00:00
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
void CopyEncode (const type* Source, type* Target);
|
|
|
|
/* Copy encoded data from Source to Target */
|
|
|
|
|
2000-08-01 18:45:08 +00:00
|
|
|
type UnqualifiedType (type T);
|
|
|
|
/* Return the unqalified type */
|
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
unsigned SizeOf (const type* Type);
|
|
|
|
/* Compute size of object represented by type array. */
|
|
|
|
|
|
|
|
unsigned PSizeOf (const type* Type);
|
|
|
|
/* Compute size of pointer object. */
|
|
|
|
|
2002-03-10 20:44:58 +00:00
|
|
|
unsigned CheckedSizeOf (const type* T);
|
|
|
|
/* Return the size of a data type. If the size is zero, emit an error and
|
|
|
|
* return some valid size instead (so the rest of the compiler doesn't have
|
|
|
|
* to work with invalid sizes).
|
|
|
|
*/
|
|
|
|
unsigned CheckedPSizeOf (const type* T);
|
|
|
|
/* Return the size of a data type that is pointed to by a pointer. If the
|
|
|
|
* size is zero, emit an error and return some valid size instead (so the
|
|
|
|
* rest of the compiler doesn't have to work with invalid sizes).
|
|
|
|
*/
|
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
unsigned TypeOf (const type* Type);
|
|
|
|
/* Get the code generator base type of the object */
|
|
|
|
|
|
|
|
type* Indirect (type* Type);
|
|
|
|
/* Do one indirection for the given type, that is, return the type where the
|
|
|
|
* given type points to.
|
|
|
|
*/
|
|
|
|
|
2002-10-10 20:23:41 +00:00
|
|
|
#if defined(HAVE_INLINE)
|
|
|
|
INLINE int IsTypeChar (const type* T)
|
2000-08-14 22:18:26 +00:00
|
|
|
/* Return true if this is a character type */
|
2002-10-10 20:23:41 +00:00
|
|
|
{
|
|
|
|
return (T[0] & T_MASK_TYPE) == T_TYPE_CHAR;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
# define IsTypeChar(T) (((T)[0] & T_MASK_TYPE) == T_TYPE_CHAR)
|
|
|
|
#endif
|
2000-08-01 18:45:08 +00:00
|
|
|
|
2002-10-10 20:23:41 +00:00
|
|
|
#if defined(HAVE_INLINE)
|
|
|
|
INLINE int IsTypeInt (const type* T)
|
2000-08-14 22:18:26 +00:00
|
|
|
/* Return true if this is an int type (signed or unsigned) */
|
2002-10-10 20:23:41 +00:00
|
|
|
{
|
|
|
|
return (T[0] & T_MASK_TYPE) == T_TYPE_INT;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
# define IsTypeInt(T) (((T)[0] & T_MASK_TYPE) == T_TYPE_INT)
|
|
|
|
#endif
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2002-10-10 20:23:41 +00:00
|
|
|
#if defined(HAVE_INLINE)
|
|
|
|
INLINE int IsTypeLong (const type* T)
|
2000-08-14 22:18:26 +00:00
|
|
|
/* Return true if this is a long type (signed or unsigned) */
|
2002-10-10 20:23:41 +00:00
|
|
|
{
|
|
|
|
return (T[0] & T_MASK_TYPE) == T_TYPE_LONG;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
# define IsTypeLong(T) (((T)[0] & T_MASK_TYPE) == T_TYPE_LONG)
|
|
|
|
#endif
|
2000-08-14 22:18:26 +00:00
|
|
|
|
2002-10-10 20:23:41 +00:00
|
|
|
#if defined(HAVE_INLINE)
|
|
|
|
INLINE int IsTypeFloat (const type* T)
|
2000-08-19 21:55:06 +00:00
|
|
|
/* Return true if this is a float type */
|
2002-10-10 20:23:41 +00:00
|
|
|
{
|
|
|
|
return (T[0] & T_MASK_TYPE) == T_TYPE_FLOAT;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
# define IsTypeFloat(T) (((T)[0] & T_MASK_TYPE) == T_TYPE_FLOAT)
|
|
|
|
#endif
|
2000-08-19 21:55:06 +00:00
|
|
|
|
2002-10-10 20:23:41 +00:00
|
|
|
#if defined(HAVE_INLINE)
|
|
|
|
INLINE int IsTypeDouble (const type* T)
|
2000-08-19 21:55:06 +00:00
|
|
|
/* Return true if this is a double type */
|
2002-10-10 20:23:41 +00:00
|
|
|
{
|
|
|
|
return (T[0] & T_MASK_TYPE) == T_TYPE_DOUBLE;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
# define IsTypeDouble(T) (((T)[0] & T_MASK_TYPE) == T_TYPE_DOUBLE)
|
|
|
|
#endif
|
2000-08-19 21:55:06 +00:00
|
|
|
|
2002-10-10 20:23:41 +00:00
|
|
|
#if defined(HAVE_INLINE)
|
|
|
|
INLINE int IsTypePtr (const type* T)
|
2000-05-28 13:40:48 +00:00
|
|
|
/* Return true if this is a pointer type */
|
2002-10-10 20:23:41 +00:00
|
|
|
{
|
|
|
|
return ((T[0] & T_MASK_TYPE) == T_TYPE_PTR);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
# define IsTypePtr(T) (((T)[0] & T_MASK_TYPE) == T_TYPE_PTR)
|
|
|
|
#endif
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2002-10-10 20:23:41 +00:00
|
|
|
#if defined(HAVE_INLINE)
|
|
|
|
INLINE int IsTypeStruct (const type* T)
|
|
|
|
/* Return true if this is a struct type */
|
|
|
|
{
|
|
|
|
return ((T[0] & T_MASK_TYPE) == T_TYPE_STRUCT);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
# define IsTypeStruct(T) (((T)[0] & T_MASK_TYPE) == T_TYPE_STRUCT)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(HAVE_INLINE)
|
|
|
|
INLINE int IsTypeUnion (const type* T)
|
|
|
|
/* Return true if this is a union type */
|
|
|
|
{
|
|
|
|
return ((T[0] & T_MASK_TYPE) == T_TYPE_UNION);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
# define IsTypeUnion(T) (((T)[0] & T_MASK_TYPE) == T_TYPE_UNION)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(HAVE_INLINE)
|
|
|
|
INLINE int IsTypeArray (const type* T)
|
2000-08-14 22:18:26 +00:00
|
|
|
/* Return true if this is an array type */
|
2002-10-10 20:23:41 +00:00
|
|
|
{
|
|
|
|
return ((T[0] & T_MASK_TYPE) == T_TYPE_ARRAY);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
# define IsTypeArray(T) (((T)[0] & T_MASK_TYPE) == T_TYPE_ARRAY)
|
|
|
|
#endif
|
2000-08-14 22:18:26 +00:00
|
|
|
|
2002-10-10 20:23:41 +00:00
|
|
|
#if defined(HAVE_INLINE)
|
|
|
|
INLINE int IsTypeVoid (const type* T)
|
2000-08-14 22:18:26 +00:00
|
|
|
/* Return true if this is a void type */
|
2002-10-10 20:23:41 +00:00
|
|
|
{
|
|
|
|
return (T[0] & T_MASK_TYPE) == T_TYPE_VOID;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
# define IsTypeVoid(T) (((T)[0] & T_MASK_TYPE) == T_TYPE_VOID)
|
|
|
|
#endif
|
2000-08-14 22:18:26 +00:00
|
|
|
|
2002-10-10 20:23:41 +00:00
|
|
|
#if defined(HAVE_INLINE)
|
|
|
|
INLINE int IsTypeFunc (const type* T)
|
2000-08-14 22:18:26 +00:00
|
|
|
/* Return true if this is a function class */
|
2002-10-10 20:23:41 +00:00
|
|
|
{
|
|
|
|
return ((T[0] & T_MASK_TYPE) == T_TYPE_FUNC);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
# define IsTypeFunc(T) (((T)[0] & T_MASK_TYPE) == T_TYPE_FUNC)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(HAVE_INLINE)
|
|
|
|
INLINE int IsTypeFuncPtr (const type* T)
|
|
|
|
/* Return true if this is a function pointer */
|
|
|
|
{
|
|
|
|
return ((T[0] & T_MASK_TYPE) == T_TYPE_PTR && (T[1] & T_MASK_TYPE) == T_TYPE_FUNC);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
# define IsTypeFuncPtr(T) \
|
|
|
|
((((T)[0] & T_MASK_TYPE) == T_TYPE_PTR) && (((T)[1] & T_MASK_TYPE) == T_TYPE_FUNC))
|
|
|
|
#endif
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2000-08-19 21:55:06 +00:00
|
|
|
int IsClassInt (const type* Type) attribute ((const));
|
2000-05-28 13:40:48 +00:00
|
|
|
/* Return true if this is an integer type */
|
|
|
|
|
2000-08-19 21:55:06 +00:00
|
|
|
int IsClassFloat (const type* Type) attribute ((const));
|
|
|
|
/* Return true if this is a float type */
|
|
|
|
|
|
|
|
int IsClassPtr (const type* Type) attribute ((const));
|
2000-08-14 22:18:26 +00:00
|
|
|
/* Return true if this is a pointer type */
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2000-08-19 21:55:06 +00:00
|
|
|
int IsClassStruct (const type* Type) attribute ((const));
|
2000-05-28 13:40:48 +00:00
|
|
|
/* Return true if this is a struct type */
|
|
|
|
|
2000-08-19 21:55:06 +00:00
|
|
|
int IsSignUnsigned (const type* Type) attribute ((const));
|
2000-08-14 22:18:26 +00:00
|
|
|
/* Return true if this is an unsigned type */
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2000-08-19 21:55:06 +00:00
|
|
|
int IsQualConst (const type* T) attribute ((const));
|
2000-08-14 22:18:26 +00:00
|
|
|
/* Return true if the given type has a const memory image */
|
|
|
|
|
2000-08-19 21:55:06 +00:00
|
|
|
int IsQualVolatile (const type* T) attribute ((const));
|
2000-08-14 22:18:26 +00:00
|
|
|
/* Return true if the given type has a volatile type qualifier */
|
|
|
|
|
2000-08-19 21:55:06 +00:00
|
|
|
int IsFastCallFunc (const type* T) attribute ((const));
|
2001-09-24 22:36:35 +00:00
|
|
|
/* Return true if this is a function type or pointer to function with
|
|
|
|
* __fastcall__ calling conventions
|
|
|
|
*/
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2001-03-23 19:17:04 +00:00
|
|
|
int IsVariadicFunc (const type* T) attribute ((const));
|
2001-09-24 22:36:35 +00:00
|
|
|
/* Return true if this is a function type or pointer to function type with
|
|
|
|
* variable parameter list
|
|
|
|
*/
|
2001-03-22 21:02:01 +00:00
|
|
|
|
2000-08-19 21:55:06 +00:00
|
|
|
type GetType (const type* T) attribute ((const));
|
2000-08-14 22:18:26 +00:00
|
|
|
/* Get the raw type */
|
|
|
|
|
2000-08-19 21:55:06 +00:00
|
|
|
type GetClass (const type* T) attribute ((const));
|
2000-08-14 22:18:26 +00:00
|
|
|
/* Get the class of a type string */
|
|
|
|
|
2000-08-19 21:55:06 +00:00
|
|
|
type GetSignedness (const type* T) attribute ((const));
|
2000-08-14 22:18:26 +00:00
|
|
|
/* Get the sign of a type */
|
|
|
|
|
2000-08-19 21:55:06 +00:00
|
|
|
type GetSizeModifier (const type* T) attribute ((const));
|
2000-08-14 22:18:26 +00:00
|
|
|
/* Get the size modifier of a type */
|
|
|
|
|
2000-08-19 21:55:06 +00:00
|
|
|
type GetQualifier (const type* T) attribute ((const));
|
2000-08-14 22:18:26 +00:00
|
|
|
/* Get the qualifier from the given type string */
|
2000-05-28 13:40:48 +00:00
|
|
|
|
2001-03-23 19:17:04 +00:00
|
|
|
FuncDesc* GetFuncDesc (const type* T) attribute ((const));
|
2000-05-28 13:40:48 +00:00
|
|
|
/* Get the FuncDesc pointer from a function or pointer-to-function type */
|
|
|
|
|
2001-05-03 17:34:54 +00:00
|
|
|
type* GetFuncReturn (type* T) attribute ((const));
|
|
|
|
/* Return a pointer to the return type of a function or pointer-to-function type */
|
|
|
|
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* End of datatype.h */
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|