octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mex Extensions


From: Thomas Treichl
Subject: Re: Mex Extensions
Date: Wed, 10 Jan 2007 19:52:05 +0100
User-agent: Thunderbird 1.5.0.9 (Macintosh/20061207)

Sorry for being late.

LabMat?

MatLab.

- Is it possible to add #defines for
  mwSize (=int), mwIndex (=int), true and false
  to the mex sources (the mex.h file) for compatibility with LabMat?
  If I only use #include <mex.h> I cannot see these defines.

What I meant here is that one might port his mex function from Matlab to Octave and uses one or more of these functions (cf. MatLab documentation)
  - mxArray *mxCreateCellMatrix (mwSize m, mwSize n);
  - mxArray *mxGetCell (const mxArray *pm, mwIndex index);
So we could need a typedef or a define or whatever for mwSize and mwIndex. The same with the constants true and false. This is no extension but more a fix.

As a function call, this implies that each time the mex function is
called, the help text is reset. This is easy enough to do probably as
the octave_function class has a method "void document (const
std::string&)" whose sole purpose is to set the document string...

Okay, I understood, thanks.

To address this we might modify defun.cc(install_mex_function) to also
call parse.y(get_help_from_file) and associate the help string from the
m-file with the symbol record of the mex-function. The construct for
octave_mex_function would also then need modifying to accept the help
string.. Consider the attached patch..

I would be happy with the patch and the modified help.cc file,
both work very well, thank you,
Thomas

PS. What about the README.MacOSX file? Will you add this to the sources or should I continue working with this on the Wiki? Cf. first paragraph here:
http://www.cae.wisc.edu/pipermail/help-octave/2007-January/002639.html


reply via email to

[Prev in Thread] Current Thread [Next in Thread]