]> www.ginac.de Git - cln.git/blobdiff - src/real/input/cl_R_read_stream.cc
* */*: cl_istream -> std::istream, cl_ostream -> std::ostream.
[cln.git] / src / real / input / cl_R_read_stream.cc
index 5bdc7736977b07ba57f34047eaefc1703fe55e5a..b6947451b5619f079744e047b83329539fd0f1b6 100644 (file)
@@ -6,14 +6,16 @@
 #include "cl_sysdep.h"
 
 // Specification.
-#include "cl_real_io.h"
+#include "cln/real_io.h"
 
 
 // Implementation.
 
-#include "cl_io.h"
+#include "cln/io.h"
 #include "cl_spushstring.h"
-#include "cl_input.h"
+#include "cln/input.h"
+
+namespace cln {
 
 // We read an entire token (or even more, if it begins with #C) into a
 // buffer and then call read_real() on the buffer.
@@ -31,14 +33,14 @@ static cl_boolean number_char_p (char c)
        if (((c >= 'A') && (c <= 'Z')) || ((c >= 'a') && (c <= 'z')))
                return cl_true;
        switch (c) {
-               case '+': case '-': case '.': case '/':
+               case '+': case '-': case '.': case '_': case '/':
                        return cl_true;
                default:
                        return cl_false;
        }
 }
 
-const cl_R read_real (cl_istream stream, const cl_read_flags& flags)
+const cl_R read_real (std::istream& stream, const cl_read_flags& flags)
 {
        // One pre-allocated buffer. This reduces the allocation/free cost.
        static pushstring_hack buffer;
@@ -102,3 +104,5 @@ syntax1:    buffer.push(c);
        // Handle premature EOF.
 eof:   read_number_eof();
 }
+
+}  // namespace cln