Line data Source code
1 :
2 : /* Copyright (c) 2005-2014, Stefan Eilemann <eile@equalizergraphics.com>
3 : *
4 : * This file is part of Collage <https://github.com/Eyescale/Collage>
5 : *
6 : * This library is free software; you can redistribute it and/or modify it under
7 : * the terms of the GNU Lesser General Public License version 2.1 as published
8 : * by the Free Software Foundation.
9 : *
10 : * This library is distributed in the hope that it will be useful, but WITHOUT
11 : * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 : * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 : * details.
14 : *
15 : * You should have received a copy of the GNU Lesser General Public License
16 : * along with this library; if not, write to the Free Software Foundation, Inc.,
17 : * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 : */
19 :
20 : #ifndef CO_INIT_H
21 : #define CO_INIT_H
22 :
23 : #include <co/api.h>
24 : #include <co/version.h> // used inline
25 : #include <lunchbox/log.h> // used inline
26 :
27 : namespace co
28 : {
29 : /** @internal */
30 : CO_API bool _init(const int argc, char** argv);
31 :
32 : /**
33 : * Initialize the Collage network library.
34 : *
35 : * exit() should be called independent of the return value of this function.
36 : *
37 : * @param argc the command line argument count.
38 : * @param argv the command line argument values.
39 : * @return true if the library was successfully initialised, false otherwise
40 : * @version 1.0
41 : */
42 20 : inline bool init(const int argc, char** argv)
43 : {
44 20 : if (CO_VERSION_ABI == Version::getABI())
45 20 : return co::_init(argc, argv);
46 0 : LBWARN << "Collage shared library v" << Version::getABI()
47 0 : << " not binary compatible with application v" << CO_VERSION_ABI
48 0 : << std::endl;
49 0 : return false;
50 : }
51 :
52 : /**
53 : * De-initialize the Collage network library.
54 : *
55 : * @return true if the library was successfully de-initialised,
56 : * false otherwise.
57 : * @version 1.0
58 : */
59 : CO_API bool exit();
60 : }
61 :
62 : #endif // CO_INIT_H
|