/* */
/* */
/* */
-/* (C) 1998-2001 Ullrich von Bassewitz */
-/* Wacholderweg 14 */
-/* D-70597 Stuttgart */
-/* EMail: uz@cc65.org */
+/* (C) 1998-2011, Ullrich von Bassewitz */
+/* Roemerstrasse 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"
/*****************************************************************************/
-/* 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->LI = EmptyCollection;
+ GetFullLineInfo (&F->LI);
+ F->Len = Len;
+ F->Type = Type;
+
+ /* And return it */
+ return F;
+}