Update copyright date; remove old CVS keyword
[ctsim.git] / tools / pjinfo.cpp
index 265a9fecd6539c8633dc69234e35695dfb34d2ab..85d1964e1835cbf9cddbb15dd5e8b5daef58f354 100644 (file)
@@ -7,9 +7,7 @@
 **   Date Started:  April 2000
 **
 **  This is part of the CTSim program
-**  Copyright (C) 1983-2000 Kevin Rosenberg
-**
-**  $Id: pjinfo.cpp,v 1.3 2000/12/16 07:28:25 kevin Exp $
+**  Copyright (C) 1983-2009 Kevin Rosenberg
 **
 **  This program is free software; you can redistribute it and/or modify
 **  it under the terms of the GNU General Public License (version 2) as
 ******************************************************************************/
 
 /* FILE
- *   pjinfo.c                  Convert Raysum to image
- *
- * DATE
- *   August 2000
- */
+*   pjinfo.c                    Convert Raysum to image
+*
+* DATE
+*   August 2000
+*/
 
 #include "ct.h"
 #include "timer.h"
@@ -50,9 +48,9 @@ static struct option my_options[] =
   {0, 0, 0, 0}
 };
 
-static const char* g_szIdStr = "$Id: pjinfo.cpp,v 1.3 2000/12/16 07:28:25 kevin Exp $";
+static const char* g_szIdStr = "$Id$";
 
-void 
+void
 pjinfo_usage (const char *program)
 {
   std::cout << "usage: " << fileBasename(program) << " proj-file [OPTIONS]\n";
@@ -67,9 +65,9 @@ pjinfo_usage (const char *program)
   std::cout << "   --help          Print this help message\n";
 }
 
-         
 
-int 
+
+int
 pjinfo_main (const int argc, char *const argv[])
 {
   std::string pj_name;
@@ -81,58 +79,58 @@ pjinfo_main (const int argc, char *const argv[])
   extern int optind;
 
   while (1)
+  {
+    char *endptr, *endstr;
+    int c = getopt_long (argc, argv, "", my_options, NULL);
+    if (c == -1)
+      break;
+
+    switch (c)
     {
-      char *endptr, *endstr;
-      int c = getopt_long (argc, argv, "", my_options, NULL);
-      if (c == -1)
-       break;
-      
-      switch (c)
-       {
-       case O_DUMP:
-         optDump = true;
-         break;
-        case O_BINARYHEADER:
-           optBinaryHeader = true;
-           break;
-        case O_BINARYVIEWS:
-           optBinaryViews = true;
-           break;
-       case O_STARTVIEW:
-         optStartView = strtol(optarg, &endptr, 10);
-         endstr = optarg + strlen(optarg);
-         if (endptr != endstr) {
-           cerr << "Error setting --startview to %s" << optarg << std::endl;
-           pjinfo_usage(argv[0]);
-           return (1);
-         }
-         break;
-       case O_ENDVIEW:
-         optEndView = strtol(optarg, &endptr, 10);
-         endstr = optarg + strlen(optarg);
-         if (endptr != endstr) {
-           cerr << "Error setting --endview to %s" << optarg << std::endl;
-           pjinfo_usage(argv[0]);
-           return (1);
-         }
-         break;
-        case O_VERSION:
+    case O_DUMP:
+      optDump = true;
+      break;
+    case O_BINARYHEADER:
+      optBinaryHeader = true;
+      break;
+    case O_BINARYVIEWS:
+      optBinaryViews = true;
+      break;
+    case O_STARTVIEW:
+      optStartView = strtol(optarg, &endptr, 10);
+      endstr = optarg + strlen(optarg);
+      if (endptr != endstr) {
+        std::cerr << "Error setting --startview to %s" << optarg << std::endl;
+        pjinfo_usage(argv[0]);
+        return (1);
+      }
+      break;
+    case O_ENDVIEW:
+      optEndView = strtol(optarg, &endptr, 10);
+      endstr = optarg + strlen(optarg);
+      if (endptr != endstr) {
+        std::cerr << "Error setting --endview to %s" << optarg << std::endl;
+        pjinfo_usage(argv[0]);
+        return (1);
+      }
+      break;
+    case O_VERSION:
 #ifdef VERSION
-         std::cout << "Version " << VERSION << std::endl << g_szIdStr << std::endl;
+      std::cout << "Version " << VERSION << std::endl << g_szIdStr << std::endl;
 #else
-          std::cout << "Unknown version number\n";
+      std::cout << "Unknown version number\n";
 #endif
-         return (0);
-       case O_HELP:
-       case '?':
-         pjinfo_usage(argv[0]);
-         return (0);
-       default:
-         pjinfo_usage(argv[0]);
-         return (1);
-       }
+      return (0);
+    case O_HELP:
+    case '?':
+      pjinfo_usage(argv[0]);
+      return (0);
+    default:
+      pjinfo_usage(argv[0]);
+      return (1);
     }
-  
+  }
+
   if (argc - optind != 1) {
     pjinfo_usage(argv[0]);
     return (1);
@@ -159,13 +157,13 @@ pjinfo_main (const int argc, char *const argv[])
       std::cout << os.str();
     }
   }
-  
+
   return(0);
 }
 
 
 #ifndef NO_MAIN
-int 
+int
 main (const int argc, char *const argv[])
 {
   int retval = 1;
@@ -173,9 +171,9 @@ main (const int argc, char *const argv[])
   try {
     retval = pjinfo_main(argc, argv);
   } catch (exception e) {
-    cerr << "Exception: " << e.what() << std::endl;
+    std::cerr << "Exception: " << e.what() << std::endl;
   } catch (...) {
-    cerr << "Unknown exception\n";
+    std::cerr << "Unknown exception\n";
   }
 
   return (retval);