X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=tools%2Fpjinfo.cpp;h=3e2a1db80ccad1d93fc3b7da82b1c078e6e1732e;hb=ad846952429412dd9b090cbb4500f179ca460b12;hp=9be697f1ea3d0a1eafee7e517e62eb1ccef5ee8f;hpb=5ff5b33a6bc64fb804106c4d50b83e4cf0d7b0f4;p=ctsim.git diff --git a/tools/pjinfo.cpp b/tools/pjinfo.cpp index 9be697f..3e2a1db 100644 --- a/tools/pjinfo.cpp +++ b/tools/pjinfo.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: pjinfo.cpp,v 1.5 2001/01/10 21:21:53 kevin Exp $ +** $Id$ ** ** 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 @@ -26,7 +26,7 @@ ******************************************************************************/ /* FILE -* pjinfo.c Convert Raysum to image +* pjinfo.c Convert Raysum to image * * DATE * August 2000 @@ -50,9 +50,9 @@ static struct option my_options[] = {0, 0, 0, 0} }; -static const char* g_szIdStr = "$Id: pjinfo.cpp,v 1.5 2001/01/10 21:21:53 kevin Exp $"; +static const char* g_szIdStr = "$Id$"; -void +void pjinfo_usage (const char *program) { std::cout << "usage: " << fileBasename(program) << " proj-file [OPTIONS]\n"; @@ -69,7 +69,7 @@ pjinfo_usage (const char *program) -int +int pjinfo_main (const int argc, char *const argv[]) { std::string pj_name; @@ -79,14 +79,14 @@ pjinfo_main (const int argc, char *const argv[]) int optStartView = 0; int optEndView = -1; // tells copyViewData to use default last view extern int optind; - + while (1) { char *endptr, *endstr; int c = getopt_long (argc, argv, "", my_options, NULL); if (c == -1) break; - + switch (c) { case O_DUMP: @@ -132,14 +132,14 @@ pjinfo_main (const int argc, char *const argv[]) return (1); } } - + if (argc - optind != 1) { pjinfo_usage(argv[0]); return (1); } - + pj_name = argv[optind]; - + if (optBinaryHeader) Projections::copyHeader (pj_name, std::cout); else if (optBinaryViews) @@ -150,7 +150,7 @@ pjinfo_main (const int argc, char *const argv[]) sys_error (ERR_SEVERE, "Can not open projection file %s", pj_name.c_str()); return (1); } - + if (optDump) { pj.printProjectionData (optStartView, optEndView); } else { @@ -159,17 +159,17 @@ 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; - + try { retval = pjinfo_main(argc, argv); } catch (exception e) { @@ -177,7 +177,7 @@ main (const int argc, char *const argv[]) } catch (...) { std::cerr << "Unknown exception\n"; } - + return (retval); } #endif