* src/vm/initialize.c: Moved to C++.
[cacao.git] / src / native / vm / openjdk / hpi.hpp
1 /* src/native/vm/openjdk/hpi.hpp - HotSpot HPI interface functions
2
3    Copyright (C) 2008
4    CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
5
6    This file is part of CACAO.
7
8    This program is free software; you can redistribute it and/or
9    modify it under the terms of the GNU General Public License as
10    published by the Free Software Foundation; either version 2, or (at
11    your option) any later version.
12
13    This program is distributed in the hope that it will be useful, but
14    WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16    General Public License for more details.
17
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21    02110-1301, USA.
22
23 */
24
25
26 #ifndef _HPI_HPP
27 #define _HPI_HPP
28
29 #include "config.h"
30
31 /* HPI headers *****************************************************************
32
33    We include hpi_md.h before hpi.h as the latter includes the former.
34
35    These includes define:
36
37    #define _JAVASOFT_HPI_MD_H_
38    #define _JAVASOFT_HPI_H_
39
40 *******************************************************************************/
41
42 // Include our JNI header before the HPI headers, because the HPI
43 // headers include jni.h and we want to override the typedefs in
44 // jni.h.
45 #include "native/jni.hpp"
46
47 #include INCLUDE_HPI_MD_H
48 #include INCLUDE_HPI_H
49
50
51 #ifdef __cplusplus
52
53 /**
54  * Host Porting Interface (HPI).
55  */
56 class HPI {
57 private:
58         GetInterfaceFunc      _get_interface;
59         HPI_FileInterface*    _file;
60         HPI_SocketInterface*  _socket;
61         HPI_LibraryInterface* _library;
62         HPI_SystemInterface*  _system;
63
64 public: 
65         HPI();
66
67         inline HPI_FileInterface&    get_file   () const { return *_file; }
68         inline HPI_SocketInterface&  get_socket () const { return *_socket; }
69         inline HPI_LibraryInterface& get_library() const { return *_library; }
70         inline HPI_SystemInterface&  get_system () const { return *_system; }
71         
72         void initialize(); // REMOVEME
73         int initialize_socket_library();
74 };
75
76 #else
77
78 void HPI_initialize();
79
80 #endif
81
82 #endif // _HPI_HPP
83
84
85 /*
86  * These are local overrides for various environment variables in Emacs.
87  * Please do not remove this and leave it at the end of the file, where
88  * Emacs will automagically detect them.
89  * ---------------------------------------------------------------------
90  * Local variables:
91  * mode: c++
92  * indent-tabs-mode: t
93  * c-basic-offset: 4
94  * tab-width: 4
95  * End:
96  * vim:noexpandtab:sw=4:ts=4:
97  */