26 #if defined (HAVE_CONFIG_H)
65 if (! is.read (
reinterpret_cast<char *
> (&nargs), 4))
76 for (
int i = 0; i < nargs; i++)
78 if (! is.read (
reinterpret_cast<char *
> (&tmp), 4))
85 args(i+1) = std::string (ctmp);
91 if (! is.read (
reinterpret_cast<char *
> (&tmp), 4))
104 if (! is.read (
reinterpret_cast<char *
> (&tmp), 4))
110 is.read (ctmp2, tmp);
114 args(0) = std::string (ctmp2);
121 if (tmp_inl.
length () > 0)
199 const std::string& filename,
bool& global,
204 unsigned char tmp = 0;
206 int32_t name_len = 0;
214 is.read (
reinterpret_cast<char *
> (&name_len), 4);
222 name[name_len] =
'\0';
223 if (! is.read (
reinterpret_cast<char *
> (
name), name_len))
224 error (
"load: trouble reading binary file '%s'", filename.c_str ());
228 is.read (
reinterpret_cast<char *
> (&doc_len), 4);
230 error (
"load: trouble reading binary file '%s'", filename.c_str ());
236 tdoc[doc_len] =
'\0';
237 if (! is.read (
reinterpret_cast<char *
> (tdoc), doc_len))
238 error (
"load: trouble reading binary file '%s'", filename.c_str ());
242 if (! is.read (
reinterpret_cast<char *
> (&tmp), 1))
243 error (
"load: trouble reading binary file '%s'", filename.c_str ());
244 global = (tmp ? 1 : 0);
247 if (! is.read (
reinterpret_cast<char *
> (&tmp), 1))
248 error (
"load: trouble reading binary file '%s'", filename.c_str ());
278 if (! is.read (
reinterpret_cast<char *
> (&
len), 4))
279 error (
"load: trouble reading binary file '%s'", filename.c_str ());
283 if (! is.read (
reinterpret_cast<char *
> (s),
len))
284 error (
"load: trouble reading binary file '%s'", filename.c_str ());
305 if (! is.read (
reinterpret_cast<char *
> (&
len), 4))
306 error (
"load: trouble reading binary file '%s'", filename.c_str ());
310 if (! is.read (s,
len))
311 error (
"load: trouble reading binary file '%s'", filename.c_str ());
315 if (typ ==
"inline function")
319 error (
"load: trouble reading binary file '%s'", filename.c_str ());
327 error (
"load: trouble reading binary file '%s'", filename.c_str ());
332 error (
"load: trouble reading binary file '%s'", filename.c_str ());
343 const std::string&
name,
const std::string& doc,
344 bool mark_global,
bool save_as_floats)
346 int32_t name_len =
name.length ();
348 os.write (
reinterpret_cast<char *
> (&name_len), 4);
351 int32_t doc_len = doc.length ();
353 os.write (
reinterpret_cast<char *
> (&doc_len), 4);
359 os.write (
reinterpret_cast<char *
> (&tmp), 1);
363 os.write (
reinterpret_cast<char *
> (&tmp), 1);
367 int32_t
len = typ.length ();
368 os.write (
reinterpret_cast<char *
> (&
len), 4);
369 const char *btmp = typ.data ();
370 os.write (btmp,
len);
376 bool success = val.
save_binary (os, save_as_floats);
378 return (os && success);
void swap_bytes< 4 >(void *ptr)
octave_value_list feval(const char *name, const octave_value_list &args=octave_value_list(), int nargout=0)
Evaluate an Octave function (built-in or interpreted) and return the list of result values.
octave_value lookup_type(const std::string &nm)
octave_idx_type length(void) const
bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format fmt)
bool save_binary(std::ostream &os, bool save_as_floats)
std::string type_name(void) const
void error(const char *fmt,...)
std::string read_binary_data(std::istream &is, bool swap, octave::mach_info::float_format fmt, const std::string &filename, bool &global, octave_value &tc, std::string &doc)
bool save_binary_data(std::ostream &os, const octave_value &tc, const std::string &name, const std::string &doc, bool mark_global, bool save_as_floats)
static bool load_inline_fcn(std::istream &is, bool swap, octave::mach_info::float_format, octave_value &retval)
type_info & __get_type_info__(const std::string &who)
interpreter & __get_interpreter__(const std::string &who)
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
octave_value::octave_value(const Array< char > &chm, char type) return retval