]> git.sur5r.net Git - cc65/blobdiff - src/cc65/datatype.h
Fixed several type conversion issues
[cc65] / src / cc65 / datatype.h
index 75892f0f11e6f210d48c7922cd6171691c0235da..76bd018e1bf10989c7a772af45393a5c0b272470 100644 (file)
@@ -42,6 +42,7 @@
 
 /* common */
 #include "attrib.h"
+#include "inline.h"
 
 /* cc65 */
 #include "funcdesc.h"
@@ -143,6 +144,10 @@ typedef unsigned short type;
 /* Type elements needed for Encode/Decode */
 #define DECODE_SIZE            5
 
+/* Special encodings for element counts of an array */
+#define UNSPECIFIED     -1L     /* Element count was not specified */
+#define FLEXIBLE        0L      /* Flexible array struct member */
+
 /* Sizes */
 #define SIZEOF_CHAR     1
 #define SIZEOF_SHORT    2
@@ -217,7 +222,7 @@ void PrintFuncSig (FILE* F, const char* Name, type* Type);
 /* Print a function signature. */
 
 void Encode (type* Type, unsigned long Val);
-/* Encode an unsigned long into a type array */
+/* Encode Val into the given type string */
 
 void EncodePtr (type* Type, void* P);
 /* Encode a pointer into a type array */
@@ -269,6 +274,9 @@ type* Indirect (type* Type);
  * given type points to.
  */
 
+type* ArrayToPtr (const type* Type);
+/* Convert an array to a pointer to it's first element */
+
 #if defined(HAVE_INLINE)
 INLINE int IsTypeChar (const type* T)
 /* Return true if this is a character type */
@@ -470,6 +478,14 @@ FuncDesc* GetFuncDesc (const type* T) attribute ((const));
 type* GetFuncReturn (type* T) attribute ((const));
 /* Return a pointer to the return type of a function or pointer-to-function type */
 
+long GetElementCount (const type* T);
+/* Get the element count of the array specified in T (which must be of
+ * array type).
+ */
+
+type* GetElementType (type* T);
+/* Return the element type of the given array type. */
+
 
 
 /* End of datatype.h */