pfsget.cpp (pfstools-2.1.0.tgz) | : | pfsget.cpp (pfstools-2.2.0.tgz) | ||
---|---|---|---|---|
skipping to change at line 38 | skipping to change at line 38 | |||
#include <octave/oct.h> | #include <octave/oct.h> | |||
#include <octave/oct-stream.h> | #include <octave/oct-stream.h> | |||
#include <octave/ov-struct.h> | #include <octave/ov-struct.h> | |||
#include <octave/Cell.h> | #include <octave/Cell.h> | |||
//#include "../../config.h" // conflicts with config. h from octave distribution | //#include "../../config.h" // conflicts with config. h from octave distribution | |||
#include <string> | #include <string> | |||
#include <pfs.h> | #include <pfs.h> | |||
#if OCTAVE_MAJOR_VERSION < 4 || (OCTAVE_MAJOR_VERSION == 4 && OCTAVE_MINOR_VERSI | ||||
ON < 4) | ||||
#define isstruct is_map | ||||
#endif | ||||
#define SCRIPT_NAME "pfsget" | #define SCRIPT_NAME "pfsget" | |||
static const char *helpString = | static const char *helpString = | |||
#include "pfsget_help.h" | #include "pfsget_help.h" | |||
DEFUN_DLD( pfsget, args, , helpString) | DEFUN_DLD( pfsget, args, , helpString) | |||
{ | { | |||
octave_value_list retval; | octave_value_list retval; | |||
int nargin = args.length(); | int nargin = args.length(); | |||
if( nargin != 1 || !args(0).is_map() ) | if( nargin != 1 || !args(0).isstruct() ) | |||
{ | { | |||
error( SCRIPT_NAME ": Improper usage!"); | error( SCRIPT_NAME ": Improper usage!"); | |||
return retval; | return retval; | |||
} | } | |||
octave_map pfsStream = args(0).map_value(); | octave_map pfsStream = args(0).map_value(); | |||
octave_map::const_iterator itFH = pfsStream.seek( "FH" ); | octave_map::const_iterator itFH = pfsStream.seek( "FH" ); | |||
if( itFH == pfsStream.end() || | if( itFH == pfsStream.end() || | |||
!pfsStream.contents( itFH )(0).is_real_scalar() ) | !pfsStream.contents( itFH )(0).is_real_scalar() ) | |||
skipping to change at line 155 | skipping to change at line 159 | |||
} | } | |||
pfsStream.assign( "channelTags", octave_value(channelTagList) ); | pfsStream.assign( "channelTags", octave_value(channelTagList) ); | |||
} | } | |||
} | } | |||
ctx.freeFrame( frame ); | ctx.freeFrame( frame ); | |||
} | } | |||
catch( pfs::Exception ex ) | catch( pfs::Exception ex ) | |||
{ | { | |||
char error_message[100]; | error( "%s: %s", SCRIPT_NAME, ex.getMessage() ); | |||
sprintf( error_message, "%s: %s", SCRIPT_NAME, ex.getMessage() ); | ||||
error( error_message ); | ||||
} | } | |||
// if( fh != stdin ) fclose( fh ); | // if( fh != stdin ) fclose( fh ); | |||
retval.append(pfsStream); | retval.append(pfsStream); | |||
return retval; | return retval; | |||
} | } | |||
End of changes. 3 change blocks. | ||||
4 lines changed or deleted | 7 lines changed or added |