summaryrefslogtreecommitdiff
path: root/libgphoto2_port/libgphoto2_port/gphoto2-port-version.c
blob: 136b78358d12a00d510656b0662059b1769eda8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/** \file
 *
 * Copyright 2002 Hans Ulrich Niedermann <gp@n-dimensional.de
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details. 
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA  02110-1301  USA
 */

#include "config.h"
#include <stdlib.h>

#include <gphoto2/gphoto2-port-version.h>

const char **gp_port_library_version(GPVersionVerbosity verbose)
{
	/* we could also compute/parse the short strings from the long
	   ones, but the current method is easier for now :-) */
	static const char *shrt[] =
		{
			PACKAGE_VERSION,
			"iolibs: " IOLIB_LIST,
#ifdef HAVE_CC
			HAVE_CC,
#else
			"unknown cc",
#endif
#ifdef HAVE_LTDL
			"ltdl",
#else
			"no ltdl",
#endif
#ifdef HAVE_LIBEXIF
			"EXIF",
#else
			"no EXIF",
#endif
#if defined(HAVE_LIBUSB) || defined(HAVE_LIBUSB1) || defined(HAVE_LIBUSB_WIN32)
			"USB",
#else
			"no USB",
#endif
#ifdef HAVE_SERIAL
			"serial "

#ifdef HAVE_RESMGR
			"resmgr locking",
#elif HAVE_TTYLOCK
			"ttylock locking",
#elif HAVE_LOCKDEV
			"lockdev locking",
#else
			"without locking",
#endif

#else
			"no serial",
#endif
			NULL
		};
	static const char *verb[] =
		{
			PACKAGE_VERSION,
			"iolibs: " IOLIB_LIST,
#ifdef HAVE_CC
			HAVE_CC " (C compiler used)",
#else
			"unknown (C compiler used)",
#endif
#ifdef HAVE_LTDL
			"ltdl (for portable loading of iolibs)",
#else
			"no ltdl (for portable loading of iolibs)",
#endif
#ifdef HAVE_LIBEXIF
			"EXIF (for vusb)",
#else
			"no EXIF (for vusb)",
#endif
#ifdef HAVE_LIBUSB_WIN32
			"USB (libusb-win32, for USB cameras)",
#elif defined(HAVE_LIBUSB1)
			"USB (libusb1, for USB cameras)",
#elif defined(HAVE_LIBUSB)
			"USB (libusb0, for USB cameras)",
#else
			"no USB (for USB cameras)",
#endif
#ifdef HAVE_SERIAL
			"serial (for serial cameras)",
#else
			"no serial (for serial cameras)",
#endif
#ifdef HAVE_RESMGR
			"resmgr (serial port access and locking)",
#else
			"no resmgr (serial port access and locking)",
#endif
#ifdef HAVE_TTYLOCK
			"ttylock (serial port locking)",
#else
			"no ttylock (serial port locking)",
#endif
#ifdef HAVE_LOCKDEV
			"lockdev (serial port locking)",
#else
			"no lockdev (serial port locking)",
#endif
			NULL
		};
	return((verbose == GP_VERSION_VERBOSE)?verb:shrt);
}

/*
static void foobar() {
	GPVersionFunc gp_port_lib_ver_func = NULL;
	gp_port_lib_ver_func = gp_port_library_version;
	gp_port_lib_ver_func(GP_VERSION_VERBOSE);
}
*/

/*
 * Local Variables:
 * c-file-style:"linux"
 * indent-tabs-mode:t
 * End:
 */