diff src/file-io.cc @ 12483:7a5aacf65f81

Rewrite error strings in src/ to use variables named in documentation.
author Rik <octave@nomad.inbox5.com>
date Sat, 26 Feb 2011 17:28:11 -0800
parents 0f70c5db58c3
children 39ca02387a32
line wrap: on
line diff
--- a/src/file-io.cc	Sat Feb 26 16:21:02 2011 -0500
+++ b/src/file-io.cc	Sat Feb 26 17:28:11 2011 -0800
@@ -893,7 +893,7 @@
               result = os.printf (args(fmt_n), tmp_args, who);
             }
           else
-            ::error ("%s: format must be a string", who.c_str ());
+            ::error ("%s: format TEMPLATE must be a string", who.c_str ());
         }
     }
   else
@@ -944,7 +944,7 @@
           result = stdout_stream.printf (args(0), tmp_args, who);
         }
       else
-        ::error ("%s: format must be a string", who.c_str ());
+        ::error ("%s: format TEMPLATE must be a string", who.c_str ());
     }
   else
     print_usage ();
@@ -1052,7 +1052,7 @@
                                         fmt_arg.is_sq_string () ? '\'' : '"');
             }
           else
-            ::error ("%s: format must be a string", who.c_str ());
+            ::error ("%s: format TEMPLATE must be a string", who.c_str ());
         }
       else
         ::error ("%s: unable to create output buffer", who.c_str ());
@@ -1127,7 +1127,7 @@
           if (args(1).is_string ())
             retval = os.oscanf (args(1), who);
           else
-            ::error ("%s: format must be a string", who.c_str ());
+            ::error ("%s: format TEMPLATE must be a string", who.c_str ());
         }
     }
   else
@@ -1200,14 +1200,14 @@
               if (args(1).is_string ())
                 retval = os.oscanf (args(1), who);
               else
-                ::error ("%s: format must be a string", who.c_str ());
+                ::error ("%s: format TEMPLATE must be a string", who.c_str ());
             }
           else
             ::error ("%s: unable to create temporary input buffer",
                      who.c_str ());
         }
       else
-        ::error ("%s: first argument must be a string", who.c_str ());
+        ::error ("%s: argument STRING must be a string", who.c_str ());
     }
   else
     {
@@ -1251,14 +1251,14 @@
                         }
                     }
                   else
-                    ::error ("%s: format must be a string", who.c_str ());
+                    ::error ("%s: format TEMPLATE must be a string", who.c_str ());
                 }
               else
                 ::error ("%s: unable to create temporary input buffer",
                          who.c_str  ());
             }
           else
-            ::error ("%s: first argument must be a string", who.c_str ());
+            ::error ("%s: argument STRING must be a string", who.c_str ());
         }
       else
         print_usage ();
@@ -1331,19 +1331,19 @@
                                           output_type, skip, flt_fmt, count);
                     }
                   else
-                    ::error ("fread: architecture type must be a string");
+                    ::error ("fread: ARCH architecture type must be a string");
                 }
               else
-                ::error ("fread: skip must be an integer");
+                ::error ("fread: SKIP must be an integer");
             }
           else
-            ::error ("fread: invalid data type specified");
+            ::error ("fread: invalid PRECISION specified");
         }
       else
-        ::error ("fread: precision must be a string");
+        ::error ("fread: PRECISION must be a string");
     }
   else
-    ::error ("fread: invalid size specified");
+    ::error ("fread: invalid SIZE specified");
 
   return retval;
 }
@@ -1608,16 +1608,16 @@
                                        skip, flt_fmt);
                 }
               else
-                ::error ("fwrite: architecture type must be a string");
+                ::error ("fwrite: ARCH architecture type must be a string");
             }
           else
-            ::error ("fwrite: skip must be an integer");
+            ::error ("fwrite: SKIP must be an integer");
         }
       else
-        ::error ("fwrite: invalid precision specified");
+        ::error ("fwrite: invalid PRECISION specified");
     }
   else
-    ::error ("fwrite: precision must be a string");
+    ::error ("fwrite: PRECISION must be a string");
 
   return retval;
 }
@@ -1818,13 +1818,13 @@
                   retval = octave_stream_list::insert (ops);
                 }
               else
-                ::error ("popen: invalid mode specified");
+                ::error ("popen: invalid MODE specified");
             }
           else
-            ::error ("popen: mode must be a string");
+            ::error ("popen: MODE must be a string");
         }
       else
-        ::error ("popen: name must be a string");
+        ::error ("popen: COMMAND must be a string");
     }
   else
     print_usage ();
@@ -1883,10 +1883,10 @@
           if (! error_state)
             retval = octave_tempnam (dir, pfx);
           else
-            ::error ("expecting second argument to be a string");
+            ::error ("PREFIX must be a string");
         }
       else
-        ::error ("expecting first argument to be a string");
+        ::error ("DIR argument must be a string");
     }
   else
     print_usage ();
@@ -2026,7 +2026,7 @@
             }
         }
       else
-        error ("mkstemp: expecting string as first argument");
+        error ("mkstemp: TEMPLATE argument must be a string");
     }
   else
     print_usage ();
@@ -2098,7 +2098,7 @@
       else
         {
           status = -1;
-          ::error ("umask: expecting integer argument");
+          ::error ("umask: MASK must be an integer");
         }
     }
   else