r348: fix linefeed problem
[ctsim.git] / libctgraphics / pol.cpp
index 9c0e4278b61b951e7490d9c9e0981eaddcaccfed..22741e3938df85c0de739eabe38460ea2d40e402 100644 (file)
@@ -6,7 +6,7 @@
 **  This is part of the CTSim program
 **  Copyright (C) 1983-2000 Kevin Rosenberg
 **
-**  $Id: pol.cpp,v 1.8 2000/12/29 15:45:06 kevin Exp $
+**  $Id: pol.cpp,v 1.9 2001/01/02 16:02:13 kevin Exp $
 **
 **  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
@@ -22,7 +22,7 @@
 **  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 ******************************************************************************/
 
-#include "ct.h"\r
+#include "ct.h"
 #include <math.h>
 #include <stdio.h>
 #include <ctype.h>
@@ -50,11 +50,11 @@ const struct POL::KeywordCodeList POL::cmdlist[] = {
 };
 
 const unsigned int POL::NUMCMD = (sizeof(POL::cmdlist) / sizeof (struct POL::KeywordCodeList));
-\r
+
 
 POL::POL()
 {
-  currentf = -1;\r
+  currentf = -1;
   m_bTrace = false;
   init();
 }
@@ -76,7 +76,7 @@ POL::init ()
   meta.ter    = PERCENT;
   meta.inb    = LBRACK;
   
-  m_bNewlineIsEOC = true;\r
+  m_bNewlineIsEOC = true;
   m_szSkipChars[0] = EOS;
   
   
@@ -85,7 +85,7 @@ POL::init ()
   
   token.ready = false;         // no token read yet 
 }
-\r
+
 
 /* addSkipWord (w)
 *
@@ -107,11 +107,11 @@ POL::addSkipWord (const char* const w)
 */
 void 
 POL::addSkipChar (int c)
-{\r
-  int n = strlen (m_szSkipChars);\r
-  if (n < MAXSKIPCHAR) {\r
-    m_szSkipChars[n] = c;\r
-    m_szSkipChars[n+1] = 0;\r
+{
+  int n = strlen (m_szSkipChars);
+  if (n < MAXSKIPCHAR) {
+    m_szSkipChars[n] = c;
+    m_szSkipChars[n+1] = 0;
   }
 }
 
@@ -122,7 +122,7 @@ POL::addSkipChar (int c)
 //
 // tok() looks for these user defined tokens.  If it finds one,
 // it stores the tokens code in the token structure and returns TT_USERTOK
-void\r
+void
 POL::addKeyword (const char* const str, int code)
 {
   usertable.installKeywordCode (str, code);
@@ -228,7 +228,7 @@ POL::readInteger (int *n, int typecode, bool boundcode, int bb1, int bb2)
   return (false);
 }
 
-bool\r
+bool
 POL::readFloat (double *n, double typecode, bool boundcode, double bb1, double bb2)
 {
   tok (&token);
@@ -275,7 +275,7 @@ POL::skipTokens()
   return (skipSingleToken (term));
 }
 
-void \r
+void 
 POL::reader()
 {
   while (skipTokens())
@@ -621,7 +621,7 @@ POL::getescape (    /* reads up to delim */
   }
   s[i] = EOS;
 }
-\r
+
 
 bool 
 POL::readText (char *str, int lim)
@@ -630,17 +630,17 @@ POL::readText (char *str, int lim)
   while ((c = inchar()) == BLANK || c == TAB)
     ;
   ungetch (c);
-  if (c == EOF) {\r
-    str[0] = 0;\r
-    return false;\r
-  }\r
-  \r
+  if (c == EOF) {
+    str[0] = 0;
+    return false;
+  }
+  
   int i;
   for (i = 0; i < lim && (c = inchar()) != EOF && c != NEWLINE; i++)
     str[i] = c;
   ungetch (c);
-  str[i] = 0;\r
-  \r
+  str[i] = 0;
+  
   return true;
 }
 
@@ -831,9 +831,9 @@ POL::usefile (int source, char *fn)
     sys_error (ERR_SEVERE, "files nested too deeply");
     return;
   }
-  \r
-  while (! m_stackPushBackInput.empty())\r
-    m_stackPushBackInput.pop();\r
+  
+  while (! m_stackPushBackInput.empty())
+    m_stackPushBackInput.pop();
 
   if (source == P_USE_STR) {
     filep[currentf] = NULL;
@@ -898,12 +898,12 @@ POL::inchar()
 int 
 POL::getch (FILE *fp)
 {
-  int c;\r
-  if (m_stackPushBackInput.size() > 0) {\r
-    c = m_stackPushBackInput.top();\r
-    m_stackPushBackInput.pop();\r
-    return c;\r
-  }\r
+  int c;
+  if (m_stackPushBackInput.size() > 0) {
+    c = m_stackPushBackInput.top();
+    m_stackPushBackInput.pop();
+    return c;
+  }
 
   if (fp == NULL) {
     if ((c = inputline[lineptr]) == EOS)
@@ -922,17 +922,17 @@ POL::getch (FILE *fp)
 void 
 POL::ungetch (int c)
 {
-  m_stackPushBackInput.push (c);\r
+  m_stackPushBackInput.push (c);
 }
 
 
 int 
 POL::get_inputline (FILE *fp)
 {
-  while (! m_stackPushBackInput.empty())\r
-    m_stackPushBackInput.pop();\r
-\r
-  lineptr = 0;\r
+  while (! m_stackPushBackInput.empty())
+    m_stackPushBackInput.pop();
+
+  lineptr = 0;
   if (fgets (inputline, MAXLINE, fp) == NULL)
     return (EOF);
   else
@@ -942,9 +942,9 @@ POL::get_inputline (FILE *fp)
 void 
 POL::set_inputline (const char* const line)
 {
-  while (! m_stackPushBackInput.empty())\r
-    m_stackPushBackInput.pop();\r
-\r
+  while (! m_stackPushBackInput.empty())
+    m_stackPushBackInput.pop();
+
   strncpy (inputline, line, MAXLINE);
-  lineptr = 0;\r
+  lineptr = 0;
 }