xref: /netbsd-src/external/gpl2/gettext/dist/gettext-tools/gnulib-lib/javaexec.h (revision 946379e7b37692fc43f68eb0d1c10daa0a7f3b6c)
1*946379e7Schristos /* Execute a Java program.
2*946379e7Schristos    Copyright (C) 2001-2002 Free Software Foundation, Inc.
3*946379e7Schristos    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
4*946379e7Schristos 
5*946379e7Schristos    This program is free software; you can redistribute it and/or modify
6*946379e7Schristos    it under the terms of the GNU General Public License as published by
7*946379e7Schristos    the Free Software Foundation; either version 2, or (at your option)
8*946379e7Schristos    any later version.
9*946379e7Schristos 
10*946379e7Schristos    This program is distributed in the hope that it will be useful,
11*946379e7Schristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
12*946379e7Schristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13*946379e7Schristos    GNU General Public License for more details.
14*946379e7Schristos 
15*946379e7Schristos    You should have received a copy of the GNU General Public License
16*946379e7Schristos    along with this program; if not, write to the Free Software Foundation,
17*946379e7Schristos    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
18*946379e7Schristos 
19*946379e7Schristos #ifndef _JAVAEXEC_H
20*946379e7Schristos #define _JAVAEXEC_H
21*946379e7Schristos 
22*946379e7Schristos #include <stdbool.h>
23*946379e7Schristos 
24*946379e7Schristos typedef bool execute_fn (const char *progname,
25*946379e7Schristos 			 const char *prog_path, char **prog_argv,
26*946379e7Schristos 			 void *private_data);
27*946379e7Schristos 
28*946379e7Schristos /* Execute a Java class.
29*946379e7Schristos    class_name is the Java class name to be executed.
30*946379e7Schristos    classpaths is a list of pathnames to be prepended to the CLASSPATH.
31*946379e7Schristos    use_minimal_classpath = true means to ignore the user's CLASSPATH and
32*946379e7Schristos    use a minimal one. This is likely to reduce possible problems if the
33*946379e7Schristos    user's CLASSPATH contains garbage or a classes.zip file of the wrong
34*946379e7Schristos    Java version.
35*946379e7Schristos    exe_dir is a directory that may contain a native executable for the class.
36*946379e7Schristos    args is a NULL terminated list of arguments to be passed to the program.
37*946379e7Schristos    If verbose, the command to be executed will be printed.
38*946379e7Schristos    Then the command is passed to the execute function together with the
39*946379e7Schristos    private_data argument.  This function returns false if OK, true on error.
40*946379e7Schristos    Return false if OK, true on error.
41*946379e7Schristos    If quiet, error messages will not be printed.  */
42*946379e7Schristos extern bool execute_java_class (const char *class_name,
43*946379e7Schristos 				const char * const *classpaths,
44*946379e7Schristos 				unsigned int classpaths_count,
45*946379e7Schristos 				bool use_minimal_classpath,
46*946379e7Schristos 				const char *exe_dir,
47*946379e7Schristos 				const char * const *args,
48*946379e7Schristos 				bool verbose, bool quiet,
49*946379e7Schristos 				execute_fn *executer, void *private_data);
50*946379e7Schristos 
51*946379e7Schristos #endif /* _JAVAEXEC_H */
52