libgphoto2 photo camera library (libgphoto2) Internals  2.5.23
gphoto2-port-version.c
Go to the documentation of this file.
1 
21 #include "config.h"
22 #include <stdlib.h>
23 
25 
27 {
28  /* we could also compute/parse the short strings from the long
29  ones, but the current method is easier for now :-) */
30  static const char *shrt[] =
31  {
32  PACKAGE_VERSION,
33  "iolibs: " IOLIB_LIST,
34 #ifdef HAVE_CC
35  HAVE_CC,
36 #else
37  "unknown cc",
38 #endif
39 #ifdef HAVE_LTDL
40  "ltdl",
41 #else
42  "no ltdl",
43 #endif
44 #if defined(HAVE_LIBUSB) || defined(HAVE_LIBUSB1) || defined(HAVE_LIBUSB_WIN32)
45  "USB",
46 #else
47  "no USB",
48 #endif
49 #ifdef HAVE_SERIAL
50  "serial "
51 
52 #ifdef HAVE_RESMGR
53  "resmgr locking",
54 #elif HAVE_TTYLOCK
55  "ttylock locking",
56 #elif HAVE_LOCKDEV
57  "lockdev locking",
58 #else
59  "without locking",
60 #endif
61 
62 #else
63  "no serial",
64 #endif
65  NULL
66  };
67  static const char *verb[] =
68  {
69  PACKAGE_VERSION,
70  "iolibs: " IOLIB_LIST,
71 #ifdef HAVE_CC
72  HAVE_CC " (C compiler used)",
73 #else
74  "unknown (C compiler used)",
75 #endif
76 #ifdef HAVE_LTDL
77  "ltdl (for portable loading of iolibs)",
78 #else
79  "no ltdl (for portable loading of iolibs)",
80 #endif
81 #ifdef HAVE_LIBUSB_WIN32
82  "USB (libusb-win32, for USB cameras)",
83 #elif defined(HAVE_LIBUSB1)
84  "USB (libusb1, for USB cameras)",
85 #elif defined(HAVE_LIBUSB)
86  "USB (libusb0, for USB cameras)",
87 #else
88  "no USB (for USB cameras)",
89 #endif
90 #ifdef HAVE_SERIAL
91  "serial (for serial cameras)",
92 #else
93  "no serial (for serial cameras)",
94 #endif
95 #ifdef HAVE_RESMGR
96  "resmgr (serial port access and locking)",
97 #else
98  "no resmgr (serial port access and locking)",
99 #endif
100 #ifdef HAVE_TTYLOCK
101  "ttylock (serial port locking)",
102 #else
103  "no ttylock (serial port locking)",
104 #endif
105 #ifdef HAVE_LOCKDEV
106  "lockdev (serial port locking)",
107 #else
108  "no lockdev (serial port locking)",
109 #endif
110  NULL
111  };
112  return((verbose == GP_VERSION_VERBOSE)?verb:shrt);
113 }
114 
115 /*
116 static void foobar() {
117  GPVersionFunc gp_port_lib_ver_func = NULL;
118  gp_port_lib_ver_func = gp_port_library_version;
119  gp_port_lib_ver_func(GP_VERSION_VERBOSE);
120 }
121 */
122 
123 /*
124  * Local Variables:
125  * c-file-style:"linux"
126  * indent-tabs-mode:t
127  * End:
128  */
gp_port_library_version
const char ** gp_port_library_version(GPVersionVerbosity verbose)
Definition: gphoto2-port-version.c:26
gphoto2-port-version.h
GP_VERSION_VERBOSE
@ GP_VERSION_VERBOSE
Definition: gphoto2-port-version.h:26
GPVersionVerbosity
GPVersionVerbosity
Definition: gphoto2-port-version.h:24