]> git.sur5r.net Git - cc65/blobdiff - src/co65/main.c
Move the version numbers from the interface of the version module into a new
[cc65] / src / co65 / main.c
index adb1766374d39627372e4a286da6b5191cba8fc9..fe7ba8c7acb1aff14dc07ed82b194b052482cb24 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2003      Ullrich von Bassewitz                                       */
-/*               Römerstrasse 52                                             */
-/*               D-70794 Filderstadt                                         */
-/* EMail:        uz@cc65.org                                                 */
+/* (C) 2003-2009, Ullrich von Bassewitz                                      */
+/*                Roemerstrasse 52                                           */
+/*                D-70794 Filderstadt                                        */
+/* EMail:         uz@cc65.org                                                */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
 static void Usage (void)
 /* Print usage information and exit */
 {
-    fprintf (stderr,
-            "Usage: %s [options] file\n"
-            "Short options:\n"
-                    "  -V\t\t\tPrint the version number\n"
-                    "  -g\t\t\tAdd debug info to object file\n"
-                    "  -h\t\t\tHelp (this text)\n"
-             "  -m model\t\tOverride the o65 model\n"
-             "  -n\t\t\tDon't generate an output file\n"
-                    "  -o name\t\tName the output file\n"
-                    "  -v\t\t\tIncrease verbosity\n"
-            "\n"
-            "Long options:\n"
-             "  --bss-label name\tDefine and export a BSS segment label\n"
-            "  --bss-name seg\tSet the name of the BSS segment\n"
-             "  --code-label name\tDefine and export a CODE segment label\n"
-                    "  --code-name seg\tSet the name of the CODE segment\n"
-             "  --data-label name\tDefine and export a DATA segment label\n"
-                    "  --data-name seg\tSet the name of the DATA segment\n"
-                    "  --debug-info\t\tAdd debug info to object file\n"
-            "  --help\t\tHelp (this text)\n"
-             "  --no-output\t\tDon't generate an output file\n"
-             "  --o65-model model\tOverride the o65 model\n"
-                    "  --verbose\t\tIncrease verbosity\n"
-                    "  --version\t\tPrint the version number\n"
-             "  --zeropage-label name\tDefine and export a ZEROPAGE segment label\n"
-                    "  --zeropage-name seg\tSet the name of the ZEROPAGE segment\n",
-            ProgName);
+    printf ("Usage: %s [options] file\n"
+            "Short options:\n"
+            "  -V\t\t\tPrint the version number\n"
+            "  -g\t\t\tAdd debug info to object file\n"
+            "  -h\t\t\tHelp (this text)\n"
+            "  -m model\t\tOverride the o65 model\n"
+            "  -n\t\t\tDon't generate an output file\n"
+            "  -o name\t\tName the output file\n"
+            "  -v\t\t\tIncrease verbosity\n"
+            "\n"
+            "Long options:\n"
+            "  --bss-label name\tDefine and export a BSS segment label\n"
+            "  --bss-name seg\tSet the name of the BSS segment\n"
+            "  --code-label name\tDefine and export a CODE segment label\n"
+            "  --code-name seg\tSet the name of the CODE segment\n"
+            "  --data-label name\tDefine and export a DATA segment label\n"
+            "  --data-name seg\tSet the name of the DATA segment\n"
+            "  --debug-info\t\tAdd debug info to object file\n"
+            "  --help\t\tHelp (this text)\n"
+            "  --no-output\t\tDon't generate an output file\n"
+            "  --o65-model model\tOverride the o65 model\n"
+            "  --verbose\t\tIncrease verbosity\n"
+            "  --version\t\tPrint the version number\n"
+            "  --zeropage-label name\tDefine and export a ZEROPAGE segment label\n"
+            "  --zeropage-name seg\tSet the name of the ZEROPAGE segment\n",
+            ProgName);
 }
 
 
@@ -265,8 +264,8 @@ static void OptVersion (const char* Opt attribute ((unused)),
 /* Print the assembler version */
 {
     fprintf (stderr,
-                    "co65 V%u.%u.%u - (C) Copyright 1998-2003 Ullrich von Bassewitz\n",
-                    VER_MAJOR, VER_MINOR, VER_PATCH);
+                    "co65 V%s - (C) Copyright 1998-2009 Ullrich von Bassewitz\n",
+                    GetVersionAsString ());
 }
 
 
@@ -295,14 +294,14 @@ static void OptZeropageName (const char* Opt attribute ((unused)), const char* A
 
 
 
-static void ConvertOneFile (const char* InputFile, const char* OutputFile)
+static void DoConversion (void)
 /* Do file conversion */
 {
     /* Read the o65 file into memory */
-    O65Data* D = ReadO65File (InputFile);
+    O65Data* D = ReadO65File (InputName);
 
     /* Do the conversion */
-    Convert (D, OutputFile);
+    Convert (D);
 
     /* Free the o65 module data */
     /* ### */
@@ -410,7 +409,7 @@ int main (int argc, char* argv [])
     }
 
     /* Do the conversion */
-    ConvertOneFile (InputName, OutputName);
+    DoConversion ();
 
     /* Return an apropriate exit code */
     return EXIT_SUCCESS;