help-octave
[Top][All Lists]
Advanced

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

Using DFUNX_DLD macro


From: John W. Eaton
Subject: Using DFUNX_DLD macro
Date: Fri, 2 Mar 2007 11:45:21 -0500

On  2-Mar-2007, Hall, Benjamin wrote:

| I'm trying to use the octave_sockets code that was posted here
| 
| http://www.cae.wisc.edu/pipermail/octave-sources/2006-May/000001.html
| 
| in a relatively recent CVS version of octave.  The original used the
| DEFCONSTX macro to define built-in constants.  As these are no longer
| supported, I am trying to replace those with built-in functions (similar to
| F_GETFD in syscalls.cc), but I'm having trouble.
| 
| For example, if I compile the code (at end of message), then, in octave
| 
| autoload("AF_INET","try2.oct")
| autoload("MY_CONSTANT","try2.oct")
| 
| I am able to access MY_CONSTANT, but not AF_INET.  Can someone help me with
| some insight as to what I should be doing?

| // What is the "fsname" in DEFUNX_DLD ?
| #if defined (AF_INET)
| DEFUNX_DLD ("AF_INET",FAF_INET,FsAF_INET,args,nargout,

This should be

  DEFUNX_DLD ("AF_INET",FAF_INET,FSAF_INET,args,nargout,

The third argument is the name of a function that the DEFUNX_DLD macro
generates and Octave looks for when loading the function.  It must
have the FS prefix and the rest of the name must be the same as the
scripting language function you are defining (in this case AF_INET).
If it isn't named this way, then Octave won't be able to load the
function corresponding to AF_INET when it loads the .oct file.

jwe


reply via email to

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