/* */
/* */
/* */
-/* (C) 1998-2000 Ullrich von Bassewitz */
-/* Wacholderweg 14 */
-/* D-70597 Stuttgart */
-/* EMail: uz@musoftware.de */
+/* (C) 1998-2003 Ullrich von Bassewitz */
+/* Römerstrasse 52 */
+/* D-70794 Filderstadt */
+/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
+/* common */
+#include "xmalloc.h"
+
+/* ca65 */
#include "fragment.h"
+#include "lineinfo.h"
+#include "scanner.h"
/*****************************************************************************/
-/* struct Fragment */
+/* Code */
/*****************************************************************************/
-/* List of all fragments */
-Fragment* FragList = 0;
-Fragment* FragLast = 0;
+Fragment* NewFragment (unsigned char Type, unsigned short Len)
+/* Create, initialize and return a new fragment. The fragment will be inserted
+ * into the current segment.
+ */
+{
+ /* Create a new fragment */
+ Fragment* F = xmalloc (sizeof (*F));
+
+ /* Initialize it */
+ F->Next = 0;
+ F->LineList = 0;
+ F->Pos = CurPos;
+ F->LI = UseLineInfo (CurLineInfo);
+ F->Len = Len;
+ F->Type = Type;
+
+ /* And return it */
+ return F;
+}
+