+/*****************************************************************************/
+/* Id lists */
+/*****************************************************************************/
+
+
+
+static cc65_idlist* new_cc65_idlist (unsigned Count)
+/* Allocate and return a new idlist with the given count. The count field in
+ * the list will already be set on return.
+ */
+{
+ /* Allocate memory */
+ cc65_idlist* L = xmalloc (sizeof (*L) - sizeof (L->ids[0]) +
+ Count * sizeof (L->ids[0]));
+ L->count = Count;
+ return L;
+}
+
+
+
/*****************************************************************************/
/* File info */
/*****************************************************************************/
{
cc65_sourceinfo* S = xmalloc (sizeof (*S) - sizeof (S->data[0]) +
Count * sizeof (S->data[0]));
- S->count = Count;
+ S->count = Count;
return S;
}
/* A value that is used to mark invalid ids */
#define CC65_INV_ID (~0U)
+/* A structure that is used to store a list of ids */
+typedef struct cc65_idlist cc65_idlist;
+struct cc65_idlist {
+ unsigned count; /* Number of elements */
+ unsigned ids[1]; /* List of ids, number is dynamic */
+};
+
/*****************************************************************************/