# HG changeset patch # User John W. Eaton # Date 1357172295 18000 # Node ID f69530e3600d95aae46d308ec4cf400452f2bd5a # Parent 7d300b85ee255f31fe8ba059ec922f02266a711a make docstrings for __java_init__ and __java_exit__ available unconditionally * ov-java.cc (F__java_init__, F__java_exit__): Move function definitions outside of HAVE_JAVA conditional. diff -r 7d300b85ee25 -r f69530e3600d libinterp/octave-value/ov-java.cc --- a/libinterp/octave-value/ov-java.cc Wed Jan 02 14:29:50 2013 -0500 +++ b/libinterp/octave-value/ov-java.cc Wed Jan 02 19:18:15 2013 -0500 @@ -1409,38 +1409,6 @@ } } -DEFUN (__java_init__, , , - "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} java_init ()\n\ -Internal function used @strong{only} when debugging Java interface.\n\ -Function will directly call initialize_java() to create an instance of a JVM.\n\ -@end deftypefn") -{ - octave_value retval; - - retval = 0; - initialize_java (); - if (! error_state) - retval = 1; - - return retval; -} - -DEFUN (__java_exit__, , , - "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} java_exit ()\n\ -Internal function used @strong{only} when debugging Java interface.\n\ -Function will directly call terminate_jvm() to destroy the current JVM\n\ -instance.\n\ -@end deftypefn") -{ - octave_value retval; - - terminate_jvm (); - - return retval; -} - JNIEXPORT jboolean JNICALL Java_org_octave_Octave_call (JNIEnv *env, jclass, jstring funcName, jobjectArray argin, jobjectArray argout) @@ -1937,6 +1905,48 @@ // DEFUN blocks below must be outside of HAVE_JAVA block so that // documentation strings are always available, even when functions are not. +DEFUN (__java_init__, , , + "-*- texinfo -*-\n\ +@deftypefn {Built-in Function} {} java_init ()\n\ +Internal function used @strong{only} when debugging Java interface.\n\ +Function will directly call initialize_java() to create an instance of a JVM.\n\ +@end deftypefn") +{ + +#ifdef HAVE_JAVA + octave_value retval; + + retval = 0; + + initialize_java (); + + if (! error_state) + retval = 1; + + return retval; +#else + error ("__java_init__: Octave was not compiled with Java interface"); + return octave_value (); +#endif +} + +DEFUN (__java_exit__, , , + "-*- texinfo -*-\n\ +@deftypefn {Built-in Function} {} java_exit ()\n\ +Internal function used @strong{only} when debugging Java interface.\n\ +Function will directly call terminate_jvm() to destroy the current JVM\n\ +instance.\n\ +@end deftypefn") +{ +#ifdef HAVE_JAVA + terminate_jvm (); +#else + error ("__java_init__: Octave was not compiled with Java interface"); +#endif + + return octave_value (); +} + DEFUN (javaObject, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{jobj} =} javaObject (@var{classname})\n\