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