diff --git a/ChangeLog b/ChangeLog index 31f6dc2a8..399319067 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-11-08 Hans Ulrich Niedermann + + * configure.in: 2.1.1dev10, increased AGE to 3 + * libgphoto2/gphoto2-version.[ch]: added + * libgphoto2/Makefile.am: added gphoto2-version.[ch] + 2002-11-06 Hans Ulrich Niedermann * camlibs/*/Makefile.am: diff --git a/configure.in b/configure.in index 75294610c..9274ab10c 100644 --- a/configure.in +++ b/configure.in @@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.50) AC_INIT(libgphoto2/gphoto2.h) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(libgphoto2, 2.1.1dev9) +AM_INIT_AUTOMAKE(libgphoto2, 2.1.1dev10) AM_MAINTAINER_MODE AC_LIBTOOL_DLOPEN @@ -16,7 +16,7 @@ dnl 0 if you incremented CURRENT. dnl - CURRENT (Major): Increment if the interface has additions, changes, dnl removals. dnl --------------------------------------------------------------------------- -LIBGPHOTO2_AGE=2 +LIBGPHOTO2_AGE=3 LIBGPHOTO2_REVISION=0 LIBGPHOTO2_CURRENT=2 AC_SUBST(LIBGPHOTO2_AGE) diff --git a/libgphoto2/Makefile.am b/libgphoto2/Makefile.am index 1ee13609d..74c3d64a4 100644 --- a/libgphoto2/Makefile.am +++ b/libgphoto2/Makefile.am @@ -23,6 +23,8 @@ libgphoto2_la_SOURCES = \ gphoto2-list.c \ pattrec.c pattrec.h \ gphoto2-result.c \ + gphoto2-version.c \ + gphoto2-version.h \ gphoto2-setting.c \ gphoto2-widget.c libgphoto2_la_LIBADD = \ @@ -43,6 +45,7 @@ libgphoto2include_HEADERS = \ gphoto2-list.h \ gphoto2-result.h \ gphoto2-setting.h \ + gphoto2-version.h \ gphoto2-widget.h pkgconfigdir = $(libdir)/pkgconfig diff --git a/libgphoto2/gphoto2-version.c b/libgphoto2/gphoto2-version.c new file mode 100644 index 000000000..eb6751a71 --- /dev/null +++ b/libgphoto2/gphoto2-version.c @@ -0,0 +1,77 @@ +/* gphoto2-version.c + * + * Copyright (C) 2002 Hans Ulrich Niedermann + +#include + +#include + +const char **gp_library_version(GPVersionVerbosity verbose) +{ + static const char *shrt[] = + { + VERSION, +#ifdef HAVE_EXIF + "EXIF", +#else + "no EXIF", +#endif +#ifdef HAVE_LTDL + "ltdl", +#else + "no ltdl", +#endif +#ifdef HAVE_PROCMEMINFO + "/proc/meminfo", +#else + "no /proc/meminfo", +#endif + NULL + }; + static const char *verb[] = + { + VERSION, +#ifdef HAVE_EXIF + "EXIF (for special handling of EXIF files)", +#else + "no EXIF (for special handling of EXIF files)", +#endif +#ifdef HAVE_LTDL + "ltdl (hopefully with non-buggy libltdl :-)", +#else + "no ltdl (working around bugg libltdl, eh? :-)", +#endif +#ifdef HAVE_PROCMEMINFO + "/proc/meminfo (adapts cache size to memory available)", +#else + "no /proc/meminfo (adapts cache size to memory available)", +#endif + NULL + }; + return((verbose == GP_VERSION_VERBOSE)?verb:shrt); +} + +/* + * Local Variables: + * c-file-style:"linux" + * indent-tabs-mode:t + * End: + */ diff --git a/libgphoto2/gphoto2-version.h b/libgphoto2/gphoto2-version.h new file mode 100644 index 000000000..a3d963e1d --- /dev/null +++ b/libgphoto2/gphoto2-version.h @@ -0,0 +1,35 @@ +/* gphoto2-version.h + * + * Copyright (C) 2002 Hans Ulrich Niedermann + * + * 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., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifndef __GPHOTO2_VERSION_H__ +#define __GPHOTO2_VERSION_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +const char **gp_library_version(GPVersionVerbosity verbose); + +#ifdef __cplusplus +} +#endif + +#endif /* __GPHOTO2_VERSION_H__ */ diff --git a/libgphoto2_port/ChangeLog b/libgphoto2_port/ChangeLog index 154a630b4..bd917d396 100644 --- a/libgphoto2_port/ChangeLog +++ b/libgphoto2_port/ChangeLog @@ -1,3 +1,9 @@ +2002-11-08 Hans Ulrich Niedermann + + * configure.in: increased AGE to 1, define HAVE_USB and HAVE_SERIAL + * libgphoto2-port/gphoto2-port-version.[ch]: added + * libgphoto2-port/Makefile.am: added gphoto2-version.[ch] + 2002-09-12 Marcus Meissner * configure.in, serial/Makefile.am: Do not use xx_LDFLAGS, diff --git a/libgphoto2_port/libgphoto2_port/Makefile.am b/libgphoto2_port/libgphoto2_port/Makefile.am index 84d87f87e..a0216bc7a 100644 --- a/libgphoto2_port/libgphoto2_port/Makefile.am +++ b/libgphoto2_port/libgphoto2_port/Makefile.am @@ -11,6 +11,8 @@ libgphoto2_port_la_LIBADD = $(LTDL_LIBS) $(INTLLIBS) libgphoto2_port_la_SOURCES = \ gphoto2-port-info-list.c \ gphoto2-port-log.c \ + gphoto2-port-version.c \ + gphoto2-port-version.h \ gphoto2-port-library.h \ gphoto2-port.c \ gphoto2-port-portability.c \ @@ -21,6 +23,7 @@ libgphoto2_portinclude_HEADERS = \ gphoto2-port.h \ gphoto2-port-info-list.h \ gphoto2-port-log.h \ + gphoto2-port-version.h \ gphoto2-port-portability.h \ gphoto2-port-result.h diff --git a/libgphoto2_port/libgphoto2_port/gphoto2-port-version.c b/libgphoto2_port/libgphoto2_port/gphoto2-port-version.c new file mode 100644 index 000000000..6e21bc6a4 --- /dev/null +++ b/libgphoto2_port/libgphoto2_port/gphoto2-port-version.c @@ -0,0 +1,74 @@ +/* gphoto2-port-version.c + * + * Copyright (C) 2002 Hans Ulrich Niedermann +#include + +#include + +const char **gp_port_library_version(GPVersionVerbosity verbose) +{ + static const char *shrt[] = + { + VERSION, +#ifdef HAVE_USB + "USB", +#else + "no USB", +#endif +#ifdef HAVE_SERIAL + "serial", +#else + "no serial", +#endif + NULL + }; + static const char *verb[] = + { + VERSION, +#ifdef HAVE_USB + "USB (for USB cameras)", +#else + "no USB (for USB cameras)", +#endif +#ifdef HAVE_SERIAL + "serial (for serial cameras)", +#else + "no serial (for serial cameras)", +#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: + */ diff --git a/libgphoto2_port/libgphoto2_port/gphoto2-port-version.h b/libgphoto2_port/libgphoto2_port/gphoto2-port-version.h new file mode 100644 index 000000000..dc0aa989d --- /dev/null +++ b/libgphoto2_port/libgphoto2_port/gphoto2-port-version.h @@ -0,0 +1,48 @@ +/* gphoto2-port-version.h + * + * Copyright (C) 2002 Hans Ulrich Niedermann + * + * 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., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GPHOTO2_PORT_VERSION_H__ +#define __GPHOTO2_PORT_VERSION_H__ + +typedef enum { + GP_VERSION_SHORT = 0, + GP_VERSION_VERBOSE = 1 +} GPVersionVerbosity; + + +#ifdef __cplusplus +extern "C" { +#endif + +typedef const char **(*GPVersionFunc)(GPVersionVerbosity verbose); +const char **gp_port_library_version(GPVersionVerbosity verbose); + +#ifdef __cplusplus +} +#endif + +#endif /* __GPHOTO2_PORT_VERSION_H__ */ + +/* + * Local Variables: + * c-file-style:"linux" + * indent-tabs-mode:t + * End: + */