[sword-svn] r2956 - in trunk: . doc include src/mgr src/utilfuns

scribe at crosswire.org scribe at crosswire.org
Mon Aug 12 00:19:42 MST 2013


Author: scribe
Date: 2013-08-12 00:19:41 -0700 (Mon, 12 Aug 2013)
New Revision: 2956

Added:
   trunk/include/swversion.h.in
Removed:
   trunk/include/config.h
Modified:
   trunk/README
   trunk/configure.ac
   trunk/doc/README
   trunk/include/swversion.h
   trunk/src/mgr/ftplibftpt.cpp
   trunk/src/utilfuns/ftplib.c
   trunk/src/utilfuns/swversion.cpp
Log:
first cut at a swversion macro facility
removed config.h from version control/package, as this was only for version info for non linux compiles, swversion.h is now included instead
fixed warnings in ftplib reported by Greg
updated docs with changes from Peter




Modified: trunk/README
===================================================================
--- trunk/README	2013-08-11 07:11:34 UTC (rev 2955)
+++ trunk/README	2013-08-12 07:19:41 UTC (rev 2956)
@@ -24,8 +24,10 @@
 
 	If you are an end user looking for a nice SWORD, graphical Bible study
 	software suite, then you'll probably want to download one of the
-	many nice frontends found at http://crosswire.org
+	many nice frontends found at
 
+	http://crosswire.org/applications.jsp
+
 	./buildtest.cpp compiles to the executable 'buildtest' as a test to
 	see if the libs have compiled and can be linked against successfully.
 	This is NOT the final target of the build, nor does anything useful.
@@ -44,7 +46,7 @@
 	Kylix bindings (and maybe Delphi bindings) may be found in sword/bindings/clx
 	CORBA (orbit-c++) bindings with Java example classes in /bindings/corba
 	Perl stuff in bindings/perl
-	SWIG stuff (Python, .NET, many others) in bindings/swig
+	SWIG stuff (Python, Perl) in bindings/swig
 
 
 C++BUILDER DEVELOPERS

Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2013-08-11 07:11:34 UTC (rev 2955)
+++ trunk/configure.ac	2013-08-12 07:19:41 UTC (rev 2956)
@@ -296,16 +296,30 @@
 fi
 
 changequote(<<,>>)
-V1=`expr $VERSION : '\([0-9]*\)\.[0-9]*\.*[0-9]*[a-zA-Z]*[0-9]*'`
-V2=`expr $VERSION : '[0-9]*\.\([0-9]*\)\.*[0-9]*[a-zA-Z]*[0-9]*'`
-V3=`expr $VERSION : '[0-9]*\.[0-9]*\.*\([0-9]*\)[a-zA-Z]*[0-9]*'`
+V1=`expr $VERSION : '\([0-9]*\)\.[0-9]*\.*[0-9]*\.*[0-9]*'`
+V2=`expr $VERSION : '[0-9]*\.\([0-9]*\)\.*[0-9]*\.*[0-9]*'`
+V3=`expr $VERSION : '[0-9]*\.[0-9]*\.*\([0-9]*\)\.*[0-9]*'`
+V4=`expr $VERSION : '[0-9]*\.[0-9]*\.*[0-9]*\.*\([0-9]*\)'`
 changequote([,])
 
+SWORD_VERSION_STR=$VERSION
+SWORD_VERSION_MAJOR=$V1
+SWORD_VERSION_MINOR=$V2
+SWORD_VERSION_MICRO=$V3
+if test "$V4" = "" ; then V4=0; fi
+SWORD_VERSION_NANO=$V4
+
 if test "$V2" -le 9 ; then V2=0$V2 ; fi
 if test "$V3" -le 9 ; then V3=00$V3 ; elif test "$V3" -le 99 ; then V3=0$V3 ; fi
+if test "$V4" -le 9 ; then V4=00$V4 ; elif test "$V4" -le 99 ; then V4=0$V4 ; fi
+SWORD_VERSION_NUM=$V1$V2$V3$V4
 
-SWORD_NUMVERSION=$V1$V2$V3
-AC_SUBST(SWORD_NUMVERSION)
+AC_SUBST(SWORD_VERSION_NUM)
+AC_SUBST(SWORD_VERSION_STR)
+AC_SUBST(SWORD_VERSION_MAJOR)
+AC_SUBST(SWORD_VERSION_MINOR)
+AC_SUBST(SWORD_VERSION_MICRO)
+AC_SUBST(SWORD_VERSION_NANO)
 
 
 
@@ -364,7 +378,7 @@
 # ---------------------------------------------------------------------
 # Final output
 # ---------------------------------------------------------------------
-AC_CONFIG_FILES(Makefile lib/Makefile tests/Makefile tests/cppunit/Makefile utilities/Makefile examples/Makefile examples/cmdline/Makefile utilities/diatheke/Makefile sword.pc sword.spec)
+AC_CONFIG_FILES(Makefile lib/Makefile tests/Makefile tests/cppunit/Makefile utilities/Makefile examples/Makefile examples/cmdline/Makefile utilities/diatheke/Makefile sword.pc include/swversion.h sword.spec)
 AC_OUTPUT
 
 echo

Modified: trunk/doc/README
===================================================================
--- trunk/doc/README	2013-08-11 07:11:34 UTC (rev 2955)
+++ trunk/doc/README	2013-08-12 07:19:41 UTC (rev 2956)
@@ -1,9 +1,10 @@
 See README and INSTALL in root directory of the sword package
 
 No real good docs for developers yet, but see tutorials and primers on
-our website at:
+our website and wiki at:
 
-http://www.crosswire.org
+http://www.crosswire.org/sword
+http://www.crosswire.org/wiki
 
 
 Thanks!  More to come, Lord willing!

Deleted: trunk/include/config.h
===================================================================
--- trunk/include/config.h	2013-08-11 07:11:34 UTC (rev 2955)
+++ trunk/include/config.h	2013-08-12 07:19:41 UTC (rev 2956)
@@ -1,84 +0,0 @@
-/* include/config.h.  Generated from config.h.in by configure.  */
-/* include/config.h.in.  Generated from configure.ac by autoheader.  */
-
-/* Define if building universal (internal helper macro) */
-/* #undef AC_APPLE_UNIVERSAL_BUILD */
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#define HAVE_DLFCN_H 1
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#define HAVE_INTTYPES_H 1
-
-/* Define to 1 if you have the `z' library (-lz). */
-#define HAVE_LIBZ 1
-
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define to 1 if you have the `vsnprintf' function. */
-#define HAVE_VSNPRINTF 1
-
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
-   */
-#define LT_OBJDIR ".libs/"
-
-/* Name of package */
-#define PACKAGE "sword"
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT "sword-bugs at crosswire.org"
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME "sword"
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "sword 1.6.902"
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME "sword"
-
-/* Define to the home page for this package. */
-#define PACKAGE_URL "http://crosswire.org/sword"
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION "1.6.902"
-
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Version number of package */
-#define VERSION "1.6.902"
-
-/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
-   significant byte first (like Motorola and SPARC, unlike Intel). */
-#if defined AC_APPLE_UNIVERSAL_BUILD
-# if defined __BIG_ENDIAN__
-#  define WORDS_BIGENDIAN 1
-# endif
-#else
-# ifndef WORDS_BIGENDIAN
-/* #  undef WORDS_BIGENDIAN */
-# endif
-#endif

Modified: trunk/include/swversion.h
===================================================================
--- trunk/include/swversion.h	2013-08-11 07:11:34 UTC (rev 2955)
+++ trunk/include/swversion.h	2013-08-12 07:19:41 UTC (rev 2956)
@@ -24,6 +24,13 @@
 #ifndef SWVERSION_H
 #define SWVERSION_H
 
+#define SWORD_VERSION_NUM 106902000
+#define SWORD_VERSION_STR "1.6.902"
+#define SWORD_VERSION_MAJOR 1
+#define SWORD_VERSION_MINOR 6
+#define SWORD_VERSION_MICRO 902
+#define SWORD_VERSION_NANO 0
+
 #include <defs.h>
 SWORD_NAMESPACE_START
 

Added: trunk/include/swversion.h.in
===================================================================
--- trunk/include/swversion.h.in	                        (rev 0)
+++ trunk/include/swversion.h.in	2013-08-12 07:19:41 UTC (rev 2956)
@@ -0,0 +1,74 @@
+/******************************************************************************
+ *
+ *  swversion.h -	definition of class SWVersion used to compare version
+ *			info
+ *
+ * $Id: swversion.h 2833 2013-06-29 06:40:28Z chrislit $
+ *
+ * Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
+ *	CrossWire Bible Society
+ *	P. O. Box 2528
+ *	Tempe, AZ  85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program 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
+ * General Public License for more details.
+ *
+ */
+
+#ifndef SWVERSION_H
+#define SWVERSION_H
+
+#define SWORD_VERSION_NUM @SWORD_VERSION_NUM@
+#define SWORD_VERSION_STR "@SWORD_VERSION_STR@"
+#define SWORD_VERSION_MAJOR @SWORD_VERSION_MAJOR@
+#define SWORD_VERSION_MINOR @SWORD_VERSION_MINOR@
+#define SWORD_VERSION_MICRO @SWORD_VERSION_MICRO@
+#define SWORD_VERSION_NANO @SWORD_VERSION_NANO@
+
+#include <defs.h>
+SWORD_NAMESPACE_START
+
+/** A basic tool class to handle program version numbers.
+*/
+class SWDLLEXPORT SWVersion {
+	public:
+	/** The different version subnumbers.
+	*/
+	int major, minor, minor2, minor3;
+	/**The constructor.
+	* @param version Version string to be parsed.
+	*/
+	SWVersion(const char *version = "0.0");
+	/** Compare 2 Versions with each other.
+	* @param vi Version number to compare with.
+	* @return >0:this>vi; 0:this==vi; <0:this<vi
+	*/
+	int compare(const SWVersion &vi) const;
+	/** @return The parsed version number text.
+	*/
+	const char *getText() const;
+	/** @return The parsed version number text.
+	*/
+	operator const char *() const { return getText(); }
+	bool operator>(const SWVersion &vi) const {return (compare(vi) > 0);}
+	bool operator<(const SWVersion &vi) const {return (compare(vi) < 0);}
+	bool operator>=(const SWVersion &vi) const {return (compare(vi) >= 0);}
+	bool operator<=(const SWVersion &vi) const {return (compare(vi) <= 0);}
+	bool operator==(const SWVersion &vi) const {return (compare(vi) == 0);}
+
+	/** Current sword library version.
+	* Use this to check (e.g. at compile time) if the
+	* version of the sword lib is recent enough for your program.
+	*/
+	static SWVersion currentVersion;
+};
+
+SWORD_NAMESPACE_END
+#endif
+

Modified: trunk/src/mgr/ftplibftpt.cpp
===================================================================
--- trunk/src/mgr/ftplibftpt.cpp	2013-08-11 07:11:34 UTC (rev 2955)
+++ trunk/src/mgr/ftplibftpt.cpp	2013-08-12 07:19:41 UTC (rev 2956)
@@ -48,6 +48,11 @@
 	return size;
 }
 
+#if defined(__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
 int my_fprogress(netbuf *nControl, int xfered, void *arg) {
 	if (arg) {
 		MyProgressData *pd = (MyProgressData *)arg;
@@ -60,6 +65,10 @@
 	return 1;
 }
 
+#if defined(__GNUC__)
+#pragma GCC diagnostic pop
+#endif
+
 }
 
 

Modified: trunk/src/utilfuns/ftplib.c
===================================================================
--- trunk/src/utilfuns/ftplib.c	2013-08-11 07:11:34 UTC (rev 2955)
+++ trunk/src/utilfuns/ftplib.c	2013-08-12 07:19:41 UTC (rev 2956)
@@ -135,8 +135,10 @@
     char response[256];
 };
 
+#if 0
 static char *version =
 "ftplib Release 3.1-1 9/16/00, copyright 1996-2000 Thomas Pfau";
+#endif
 
 GLOBALDEF int ftplib_debug = 0;
 

Modified: trunk/src/utilfuns/swversion.cpp
===================================================================
--- trunk/src/utilfuns/swversion.cpp	2013-08-11 07:11:34 UTC (rev 2955)
+++ trunk/src/utilfuns/swversion.cpp	2013-08-12 07:19:41 UTC (rev 2956)
@@ -20,8 +20,6 @@
  *
  */
 
-#include <config.h>
-
 #include <swversion.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -29,7 +27,7 @@
 
 SWORD_NAMESPACE_START
 
-SWVersion SWVersion::currentVersion( VERSION );
+SWVersion SWVersion::currentVersion( SWORD_VERSION_STR );
 
 /******************************************************************************
  * SWVersion c-tor - Constructs a new SWVersion




More information about the sword-cvs mailing list