GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
lo-utils.cc File Reference
#include <cstdlib>
#include <cstring>
#include <complex>
#include <istream>
#include <limits>
#include <ostream>
#include <string>
#include "quit.h"
#include "intprops-wrappers.h"
#include "lo-error.h"
#include "lo-ieee.h"
#include "lo-mappers.h"
#include "lo-utils.h"
#include "oct-inttypes.h"
Include dependency graph for lo-utils.cc:

Go to the source code of this file.

Functions

std::string fgetl (FILE *f)
 
std::string fgetl (FILE *f, bool &eof)
 
std::string fgets (FILE *f)
 
std::string fgets (FILE *f, bool &eof)
 
bool int_multiply_overflow (int a, int b, int *r)
 
bool int_multiply_overflow (long int a, long int b, long int *r)
 
bool int_multiply_overflow (unsigned int a, unsigned int b, unsigned int *r)
 
bool int_multiply_overflow (unsigned long int a, unsigned long int b, unsigned long int *r)
 
bool is_int_or_inf_or_nan (double x)
 
bool is_int_or_inf_or_nan (float x)
 
template<typename T >
std::complex< T > read_cx_fp_value (std::istream &is)
 
template<typename T >
double read_fp_value (std::istream &is)
 
template<typename T >
read_inf_nan_na (std::istream &is, char c0)
 
template<typename T >
read_value (std::istream &is)
 
template<>
OCTAVE_API double read_value (std::istream &is)
 
template OCTAVE_API bool read_value< bool > (std::istream &is)
 
template OCTAVE_API octave_int16 read_value< octave_int16 > (std::istream &is)
 
template OCTAVE_API octave_int32 read_value< octave_int32 > (std::istream &is)
 
template OCTAVE_API octave_int64 read_value< octave_int64 > (std::istream &is)
 
template OCTAVE_API octave_int8 read_value< octave_int8 > (std::istream &is)
 
template OCTAVE_API octave_uint16 read_value< octave_uint16 > (std::istream &is)
 
template OCTAVE_API octave_uint32 read_value< octave_uint32 > (std::istream &is)
 
template OCTAVE_API octave_uint64 read_value< octave_uint64 > (std::istream &is)
 
template OCTAVE_API octave_uint8 read_value< octave_uint8 > (std::istream &is)
 
char * strsave (const char *s)
 
bool too_large_for_float (const Complex &x)
 
bool too_large_for_float (double x)
 
template<>
OCTAVE_API void write_value (std::ostream &os, const Complex &value)
 
template<>
OCTAVE_API void write_value (std::ostream &os, const double &value)
 
template<>
OCTAVE_API void write_value (std::ostream &os, const float &value)
 
template<>
OCTAVE_API void write_value (std::ostream &os, const FloatComplex &value)
 
template<typename T >
void write_value (std::ostream &os, const T &value)
 
template OCTAVE_API void write_value< bool > (std::ostream &os, const bool &value)
 
template OCTAVE_API void write_value< octave_int16 > (std::ostream &os, const octave_int16 &value)
 
template OCTAVE_API void write_value< octave_int32 > (std::ostream &os, const octave_int32 &value)
 
template OCTAVE_API void write_value< octave_int64 > (std::ostream &os, const octave_int64 &value)
 
template OCTAVE_API void write_value< octave_int8 > (std::ostream &os, const octave_int8 &value)
 
template OCTAVE_API void write_value< octave_uint16 > (std::ostream &os, const octave_uint16 &value)
 
template OCTAVE_API void write_value< octave_uint32 > (std::ostream &os, const octave_uint32 &value)
 
template OCTAVE_API void write_value< octave_uint64 > (std::ostream &os, const octave_uint64 &value)
 
template OCTAVE_API void write_value< octave_uint8 > (std::ostream &os, const octave_uint8 &value)
 

Function Documentation

◆ fgetl() [1/2]

std::string fgetl ( FILE *  f)

Definition at line 165 of file lo-utils.cc.

References f.

Referenced by default_command_editor::do_readline().

◆ fgetl() [2/2]

std::string fgetl ( FILE *  f,
bool &  eof 
)

Definition at line 171 of file lo-utils.cc.

References f, and fgets().

◆ fgets() [1/2]

std::string fgets ( FILE *  f)

Definition at line 85 of file lo-utils.cc.

References f.

Referenced by fgetl(), fgets(), and load_path::read_dir_config().

◆ fgets() [2/2]

std::string fgets ( FILE *  f,
bool &  eof 
)

Definition at line 91 of file lo-utils.cc.

References f, fgets(), free(), len, malloc(), and strlen().

◆ int_multiply_overflow() [1/4]

bool int_multiply_overflow ( int  a,
int  b,
int *  r 
)

Definition at line 480 of file lo-utils.cc.

References octave_i_multiply_overflow_wrapper(), and r.

◆ int_multiply_overflow() [2/4]

bool int_multiply_overflow ( long int  a,
long int  b,
long int *  r 
)

Definition at line 485 of file lo-utils.cc.

References octave_li_multiply_overflow_wrapper(), and r.

◆ int_multiply_overflow() [3/4]

bool int_multiply_overflow ( unsigned int  a,
unsigned int  b,
unsigned int *  r 
)

Definition at line 498 of file lo-utils.cc.

References octave_ui_multiply_overflow_wrapper(), and r.

◆ int_multiply_overflow() [4/4]

bool int_multiply_overflow ( unsigned long int  a,
unsigned long int  b,
unsigned long int *  r 
)

Definition at line 504 of file lo-utils.cc.

References octave_uli_multiply_overflow_wrapper(), and r.

◆ is_int_or_inf_or_nan() [1/2]

bool is_int_or_inf_or_nan ( double  x)

◆ is_int_or_inf_or_nan() [2/2]

bool is_int_or_inf_or_nan ( float  x)

Definition at line 67 of file lo-utils.cc.

References isnan(), x, and x_nint().

◆ read_cx_fp_value()

template<typename T >
std::complex<T> read_cx_fp_value ( std::istream &  is)

Definition at line 336 of file lo-utils.cc.

◆ read_fp_value()

template<typename T >
double read_fp_value ( std::istream &  is)

Definition at line 261 of file lo-utils.cc.

References max().

◆ read_inf_nan_na()

template<typename T >
T read_inf_nan_na ( std::istream &  is,
char  c0 
)

Definition at line 205 of file lo-utils.cc.

◆ read_value() [1/2]

template<typename T >
T read_value ( std::istream &  is)

Definition at line 183 of file lo-utils.cc.

◆ read_value() [2/2]

template<>
OCTAVE_API FloatComplex read_value ( std::istream &  is)

Definition at line 380 of file lo-utils.cc.

◆ read_value< bool >()

template OCTAVE_API bool read_value< bool > ( std::istream &  is)

◆ read_value< octave_int16 >()

template OCTAVE_API octave_int16 read_value< octave_int16 > ( std::istream &  is)

◆ read_value< octave_int32 >()

template OCTAVE_API octave_int32 read_value< octave_int32 > ( std::istream &  is)

◆ read_value< octave_int64 >()

template OCTAVE_API octave_int64 read_value< octave_int64 > ( std::istream &  is)

◆ read_value< octave_int8 >()

template OCTAVE_API octave_int8 read_value< octave_int8 > ( std::istream &  is)

◆ read_value< octave_uint16 >()

template OCTAVE_API octave_uint16 read_value< octave_uint16 > ( std::istream &  is)

◆ read_value< octave_uint32 >()

template OCTAVE_API octave_uint32 read_value< octave_uint32 > ( std::istream &  is)

◆ read_value< octave_uint64 >()

template OCTAVE_API octave_uint64 read_value< octave_uint64 > ( std::istream &  is)

◆ read_value< octave_uint8 >()

template OCTAVE_API octave_uint8 read_value< octave_uint8 > ( std::istream &  is)

◆ strsave()

char* strsave ( const char *  s)

Definition at line 74 of file lo-utils.cc.

References len, and strlen().

◆ too_large_for_float() [1/2]

bool too_large_for_float ( const Complex x)

Definition at line 61 of file lo-utils.cc.

References too_large_for_float(), and x.

◆ too_large_for_float() [2/2]

◆ write_value() [1/5]

template<>
OCTAVE_API void write_value ( std::ostream &  os,
const Complex value 
)

Definition at line 443 of file lo-utils.cc.

References imag(), and real().

◆ write_value() [2/5]

template<>
OCTAVE_API void write_value ( std::ostream &  os,
const double &  value 
)

Definition at line 430 of file lo-utils.cc.

References lo_ieee_is_NA, lo_ieee_isinf, and lo_ieee_isnan.

◆ write_value() [3/5]

template<>
OCTAVE_API void write_value ( std::ostream &  os,
const float &  value 
)

Definition at line 456 of file lo-utils.cc.

References lo_ieee_is_NA, lo_ieee_isinf, and lo_ieee_isnan.

◆ write_value() [4/5]

template<>
OCTAVE_API void write_value ( std::ostream &  os,
const FloatComplex value 
)

Definition at line 469 of file lo-utils.cc.

References imag(), and real().

◆ write_value() [5/5]

template<typename T >
void write_value ( std::ostream &  os,
const T &  value 
)

Definition at line 402 of file lo-utils.cc.

◆ write_value< bool >()

template OCTAVE_API void write_value< bool > ( std::ostream &  os,
const bool &  value 
)

◆ write_value< octave_int16 >()

template OCTAVE_API void write_value< octave_int16 > ( std::ostream &  os,
const octave_int16 value 
)

◆ write_value< octave_int32 >()

template OCTAVE_API void write_value< octave_int32 > ( std::ostream &  os,
const octave_int32 value 
)

◆ write_value< octave_int64 >()

template OCTAVE_API void write_value< octave_int64 > ( std::ostream &  os,
const octave_int64 value 
)

◆ write_value< octave_int8 >()

template OCTAVE_API void write_value< octave_int8 > ( std::ostream &  os,
const octave_int8 value 
)

◆ write_value< octave_uint16 >()

template OCTAVE_API void write_value< octave_uint16 > ( std::ostream &  os,
const octave_uint16 value 
)

◆ write_value< octave_uint32 >()

template OCTAVE_API void write_value< octave_uint32 > ( std::ostream &  os,
const octave_uint32 value 
)

◆ write_value< octave_uint64 >()

template OCTAVE_API void write_value< octave_uint64 > ( std::ostream &  os,
const octave_uint64 value 
)

◆ write_value< octave_uint8 >()

template OCTAVE_API void write_value< octave_uint8 > ( std::ostream &  os,
const octave_uint8 value 
)