Mercurial > hg > octave-lojdl
changeset 14111:c5222658dc3c stable
doc: Build documentation for functions even when they are unavailable
on a particular platform due to lack of libraries.
syscalls.cc (F_DUPFD, F_GETFD, F_GETFL, F_SETFD, F_SETFL, O_APPEND, O_ASYNC,
O_CREAT, O_EXCL, O_NONBLOCK, O_RDONLY, O_RDWR, O_SYNC, O_TRUNC, O_WRONLY):
Build documentation for functions even when they are not available
due to lack of libraries.
__init_fltk__.cc (Fgui_mode, Fmouse_wheel_zoom): Build documentation
for functions even when they are not available due to lack of libraries.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Mon, 26 Dec 2011 10:38:45 -0800 |
parents | b8d9530e940e |
children | 6e9fee72a01c |
files | src/DLD-FUNCTIONS/__init_fltk__.cc src/syscalls.cc |
diffstat | 2 files changed, 90 insertions(+), 33 deletions(-) [+] |
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/__init_fltk__.cc +++ b/src/DLD-FUNCTIONS/__init_fltk__.cc @@ -35,6 +35,9 @@ #include <config.h> #endif +#include "defun-dld.h" +#include "error.h" + #if defined (HAVE_FLTK) #include <map> @@ -69,8 +72,6 @@ #include "cmd-edit.h" #include "lo-ieee.h" -#include "defun-dld.h" -#include "error.h" #include "file-ops.h" #include "gl-render.h" #include "gl2ps-renderer.h" @@ -2004,6 +2005,8 @@ return retval; } +#endif + // FIXME -- This function should be abstracted and made potentially // available to all graphics toolkits. This suggests putting it in // graphics.cc as is done for drawnow() and having the master @@ -2021,6 +2024,7 @@ @seealso{gui_mode}\n\ @end deftypefn") { +#if defined (HAVE_FLTK) octave_value retval = wheel_zoom_speed; if (args.length () == 1) @@ -2032,6 +2036,10 @@ } return retval; +#else + error ("mouse_wheel_zoom: not available without OpenGL and FLTK libraries"); + return octave_value (); +#endif } DEFUN_DLD (gui_mode, args, , @@ -2055,6 +2063,7 @@ @seealso{mouse_wheel_zoom}\n\ @end deftypefn") { +#if defined (HAVE_FLTK) caseless_str mode_str; if (gui_mode == pan_zoom) @@ -2089,6 +2098,9 @@ error ("MODE must be one of the strings: \"2D\", \"3D\", or \"none\""); return octave_value (mode_str); +#else + error ("mouse_wheel_zoom: not available without OpenGL and FLTK libraries"); + return octave_value (); +#endif } -#endif
--- a/src/syscalls.cc +++ b/src/syscalls.cc @@ -1643,7 +1643,6 @@ #define O_NONBLOCK O_NDELAY #endif -#if defined (F_DUPFD) DEFUNX ("F_DUPFD", FF_DUPFD, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} F_DUPFD ()\n\ @@ -1652,11 +1651,14 @@ @seealso{fcntl, F_GETFD, F_GETFL, F_SETFD, F_SETFL}\n\ @end deftypefn") { +#if defined (F_DUPFD) return const_value (args, F_DUPFD); -} +#else + error ("F_DUPFD: not available on this system"); + return octave_value (); #endif +} -#if defined (F_GETFD) DEFUNX ("F_GETFD", FF_GETFD, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} F_GETFD ()\n\ @@ -1665,11 +1667,14 @@ @seealso{fcntl, F_DUPFD, F_GETFL, F_SETFD, F_SETFL}\n\ @end deftypefn") { +#if defined (F_GETFD) return const_value (args, F_GETFD); -} +#else + error ("F_GETFD: not available on this system"); + return octave_value (); #endif +} -#if defined (F_GETFL) DEFUNX ("F_GETFL", FF_GETFL, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} F_GETFL ()\n\ @@ -1678,11 +1683,14 @@ @seealso{fcntl, F_DUPFD, F_GETFD, F_SETFD, F_SETFL}\n\ @end deftypefn") { +#if defined (F_GETFL) return const_value (args, F_GETFL); -} +#else + error ("F_GETFL: not available on this system"); + return octave_value (); #endif +} -#if defined (F_SETFD) DEFUNX ("F_SETFD", FF_SETFD, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} F_SETFD ()\n\ @@ -1691,11 +1699,14 @@ @seealso{fcntl, F_DUPFD, F_GETFD, F_GETFL, F_SETFL}\n\ @end deftypefn") { +#if defined (F_SETFD) return const_value (args, F_SETFD); -} +#else + error ("F_SETFD: not available on this system"); + return octave_value (); #endif +} -#if defined (F_SETFL) DEFUNX ("F_SETFL", FF_SETFL, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} F_SETFL ()\n\ @@ -1704,11 +1715,14 @@ @seealso{fcntl, F_DUPFD, F_GETFD, F_GETFL, F_SETFD}\n\ @end deftypefn") { +#if defined (F_SETFL) return const_value (args, F_SETFL); -} +#else + error ("F_SETFL: not available on this system"); + return octave_value (); #endif +} -#if defined (O_APPEND) DEFUNX ("O_APPEND", FO_APPEND, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} O_APPEND ()\n\ @@ -1718,11 +1732,14 @@ @seealso{fcntl, O_ASYNC, O_CREAT, O_EXCL, O_NONBLOCK, O_RDONLY, O_RDWR, O_SYNC, O_TRUNC, O_WRONLY}\n\ @end deftypefn") { +#if defined (O_APPEND) return const_value (args, O_APPEND); -} +#else + error ("O_APPEND: not available on this system"); + return octave_value (); #endif +} -#if defined (O_ASYNC) DEFUNX ("O_ASYNC", FO_ASYNC, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} O_ASYNC ()\n\ @@ -1731,11 +1748,14 @@ @seealso{fcntl, O_APPEND, O_CREAT, O_EXCL, O_NONBLOCK, O_RDONLY, O_RDWR, O_SYNC, O_TRUNC, O_WRONLY}\n\ @end deftypefn") { +#if defined (O_ASYNC) return const_value (args, O_ASYNC); -} +#else + error ("O_ASYNC: not available on this system"); + return octave_value (); #endif +} -#if defined (O_CREAT) DEFUNX ("O_CREAT", FO_CREAT, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} O_CREAT ()\n\ @@ -1745,11 +1765,14 @@ @seealso{fcntl, O_APPEND, O_ASYNC, O_EXCL, O_NONBLOCK, O_RDONLY, O_RDWR, O_SYNC, O_TRUNC, O_WRONLY}\n\ @end deftypefn") { +#if defined (O_CREAT) return const_value (args, O_CREAT); -} +#else + error ("O_CREAT: not available on this system"); + return octave_value (); #endif +} -#if defined (O_EXCL) DEFUNX ("O_EXCL", FO_EXCL, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} O_EXCL ()\n\ @@ -1758,11 +1781,14 @@ @seealso{fcntl, O_APPEND, O_ASYNC, O_CREAT, O_NONBLOCK, O_RDONLY, O_RDWR, O_SYNC, O_TRUNC, O_WRONLY}\n\ @end deftypefn") { +#if defined (O_EXCL) return const_value (args, O_EXCL); -} +#else + error ("O_EXCL: not available on this system"); + return octave_value (); #endif +} -#if defined (O_NONBLOCK) DEFUNX ("O_NONBLOCK", FO_NONBLOCK, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} O_NONBLOCK ()\n\ @@ -1772,11 +1798,14 @@ @seealso{fcntl, O_APPEND, O_ASYNC, O_CREAT, O_EXCL, O_RDONLY, O_RDWR, O_SYNC, O_TRUNC, O_WRONLY}\n\ @end deftypefn") { +#if defined (O_NONBLOCK) return const_value (args, O_NONBLOCK); -} +#else + error ("O_NONBLOCK: not available on this system"); + return octave_value (); #endif +} -#if defined (O_RDONLY) DEFUNX ("O_RDONLY", FO_RDONLY, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} O_RDONLY ()\n\ @@ -1786,11 +1815,14 @@ @seealso{fcntl, O_APPEND, O_ASYNC, O_CREAT, O_EXCL, O_NONBLOCK, O_RDWR, O_SYNC, O_TRUNC, O_WRONLY}\n\ @end deftypefn") { +#if defined (O_RDONLY) return const_value (args, O_RDONLY); -} +#else + error ("O_RDONLY: not available on this system"); + return octave_value (); #endif +} -#if defined (O_RDWR) DEFUNX ("O_RDWR", FO_RDWR, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} O_RDWR ()\n\ @@ -1800,11 +1832,14 @@ @seealso{fcntl, O_APPEND, O_ASYNC, O_CREAT, O_EXCL, O_NONBLOCK, O_RDONLY, O_SYNC, O_TRUNC, O_WRONLY}\n\ @end deftypefn") { +#if defined (O_RDWR) return const_value (args, O_RDWR); -} +#else + error ("O_RDWR: not available on this system"); + return octave_value (); #endif +} -#if defined (O_SYNC) DEFUNX ("O_SYNC", FO_SYNC, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} O_SYNC ()\n\ @@ -1814,11 +1849,14 @@ @seealso{fcntl, O_APPEND, O_ASYNC, O_CREAT, O_EXCL, O_NONBLOCK, O_RDONLY, O_RDWR, O_TRUNC, O_WRONLY}\n\ @end deftypefn") { +#if defined (O_SYNC) return const_value (args, O_SYNC); -} +#else + error ("O_SYNC: not available on this system"); + return octave_value (); #endif +} -#if defined (O_TRUNC) DEFUNX ("O_TRUNC", FO_TRUNC, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} O_TRUNC ()\n\ @@ -1828,11 +1866,14 @@ @seealso{fcntl, O_APPEND, O_ASYNC, O_CREAT, O_EXCL, O_NONBLOCK, O_RDONLY, O_RDWR, O_SYNC, O_WRONLY}\n\ @end deftypefn") { +#if defined (O_TRUNC) return const_value (args, O_TRUNC); -} +#else + error ("O_TRUNC: not available on this system"); + return octave_value (); #endif +} -#if defined (O_WRONLY) DEFUNX ("O_WRONLY", FO_WRONLY, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} O_WRONLY ()\n\ @@ -1842,9 +1883,13 @@ @seealso{fcntl, O_APPEND, O_ASYNC, O_CREAT, O_EXCL, O_NONBLOCK, O_RDONLY, O_RDWR, O_SYNC, O_TRUNC}\n\ @end deftypefn") { +#if defined (O_WRONLY) return const_value (args, O_WRONLY); +#else + error ("O_WRONLY: not available on this system"); + return octave_value (); +#endif } -#endif #if !defined (WNOHANG) #define WNOHANG 0