added version/feature reporting functionality

git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@5563 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
Hans Ulrich Niedermann
2002-11-08 18:27:38 +00:00
parent 6fd5daa2cc
commit 14c38dddf6
9 changed files with 254 additions and 2 deletions

View File

@@ -1,3 +1,9 @@
2002-11-08 Hans Ulrich Niedermann <gp@n-dimensional.de>
* 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 <gp@n-dimensional.de>
* camlibs/*/Makefile.am:

View File

@@ -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)

View File

@@ -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

View File

@@ -0,0 +1,77 @@
/* gphoto2-version.c
*
* Copyright (C) 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include <config.h>
#include <stdlib.h>
#include <gphoto2-version.h>
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:
*/

View File

@@ -0,0 +1,35 @@
/* gphoto2-version.h
*
* Copyright (C) 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GPHOTO2_VERSION_H__
#define __GPHOTO2_VERSION_H__
#include <gphoto2-port-version.h>
#ifdef __cplusplus
extern "C" {
#endif
const char **gp_library_version(GPVersionVerbosity verbose);
#ifdef __cplusplus
}
#endif
#endif /* __GPHOTO2_VERSION_H__ */

View File

@@ -1,3 +1,9 @@
2002-11-08 Hans Ulrich Niedermann <gp@n-dimensional.de>
* 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 <marcus@jet.franken.de>
* configure.in, serial/Makefile.am: Do not use xx_LDFLAGS,

View File

@@ -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

View File

@@ -0,0 +1,74 @@
/* gphoto2-port-version.c
*
* Copyright (C) 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include <config.h>
#include <stdlib.h>
#include <gphoto2-port-version.h>
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:
*/

View File

@@ -0,0 +1,48 @@
/* gphoto2-port-version.h
*
* Copyright (C) 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., 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:
*/