]> git.sur5r.net Git - cc65/blobdiff - src/cc65/dataseg.c
Restructured search path handling.
[cc65] / src / cc65 / dataseg.c
index 980246a05e48d674520bfbb6cc4f6f235cc531f6..ebb033cbc2058515dcf07ea61e7cdf88dbac7743 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2001     Ullrich von Bassewitz                                        */
-/*              Wacholderweg 14                                              */
-/*              D-70597 Stuttgart                                            */
-/* EMail:       uz@musoftware.de                                             */
+/* (C) 2001-2009, Ullrich von Bassewitz                                      */
+/*                Roemerstrasse 52                                           */
+/*                D-70794 Filderstadt                                        */
+/* EMail:         uz@cc65.org                                                */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
@@ -39,8 +39,9 @@
 #include "xsprintf.h"
 
 /* cc65 */
-#include "error.h"
 #include "dataseg.h"
+#include "error.h"
+#include "output.h"
 
 
 
@@ -67,15 +68,7 @@ DataSeg* NewDataSeg (const char* Name, SymEntry* Func)
 
 
 
-void FreeDataSeg (DataSeg* S)
-/* Free a data segment including all line entries */
-{
-    Internal ("Not implemented");
-}
-
-
-
-void AppendDataSeg (DataSeg* Target, const DataSeg* Source)
+void DS_Append (DataSeg* Target, const DataSeg* Source)
 /* Append the data from Source to Target */
 {
     unsigned I;
@@ -89,7 +82,7 @@ void AppendDataSeg (DataSeg* Target, const DataSeg* Source)
 
 
 
-void AddDataEntry (DataSeg* S, const char* Format, va_list ap)
+void DS_AddVLine (DataSeg* S, const char* Format, va_list ap)
 /* Add a line to the given data segment */
 {
     /* Format the line */
@@ -102,8 +95,19 @@ void AddDataEntry (DataSeg* S, const char* Format, va_list ap)
 
 
 
-void OutputDataSeg (const DataSeg* S, FILE* F)
-/* Output the data segment data to a file */
+void DS_AddLine (DataSeg* S, const char* Format, ...)
+/* Add a line to the given data segment */
+{
+    va_list ap;
+    va_start (ap, Format);
+    DS_AddVLine (S, Format, ap);
+    va_end (ap);
+}
+
+
+
+void DS_Output (const DataSeg* S)
+/* Output the data segment data to the output file */
 {
     unsigned I;
 
@@ -116,16 +120,17 @@ void OutputDataSeg (const DataSeg* S, FILE* F)
     }
 
     /* Output the segment directive */
-    fprintf (F, ".segment\t\"%s\"\n\n", S->SegName);
+    WriteOutput (".segment\t\"%s\"\n\n", S->SegName);
 
     /* Output all entries */
     for (I = 0; I < Count; ++I) {
-       fprintf (F, "%s\n", (const char*) CollConstAt (&S->Lines, I));
+       WriteOutput ("%s\n", (const char*) CollConstAt (&S->Lines, I));
     }
 
     /* Add an additional newline after the segment output */
-    fprintf (F, "\n");
+    WriteOutput ("\n");
 }
 
 
 
+