bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFA/PATCH] GSWEB: GDL2 Handling and MD5 Update


From: David Ayers
Subject: [RFA/PATCH] GSWEB: GDL2 Handling and MD5 Update
Date: Thu, 23 Jan 2003 17:13:06 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) Gecko/20021212

Hello Manuel,
hello David

This patch replaces the gscrypt dependancy with the base-categorie and fixes come minor details about GDL2 handling. I would be interested in seeing your GDL2 hanlding patches, as I was playing with trying to get gsweb to work with "arbitrary" DB-Libraries as long as the implement either the parts of either db or gdl2 API. That way we could find cleaner way to allow for custom db- libraries like TCSimpleDB.

I was thinking along the line of

./configure
- checking for GDL2 to emit a warning it it's not installed (or even an error if not possible.) - expect the explicit EOControl and EOAccess headers as they are included now when GDL2 is set

./configure --with-dblib=CustomDBLib
- import <CustomDBLib/CustomDBLib.h> and make set LIBRARIES_DEPENDS_ON to libCustomDBLib

If you think it's still releavent we can also still continue to support db and have the ./configure fall back to checking for the db-stuff and setting up the headers and makefiles accordingly.

I'll try to work things out with you, David, to get things running smoothly with TCSimpleDB, if we can agree to do this.

Note though, that gsweb libraries (and thier _wo counterparts) will be compiled for only one database library at any point in time! I don't think we should start splitting these into seprate libraries also. Otherwise we will soon need a similar setup as used to designeate the binaries with the gnu-gnu-gnu scheme! You must chose one DB-Libraray that all your gsweb apps will work with at ./configure time.

Cheers,
Dave

PS: Is TCSimpleDB publicly available?

? dev-libs/gsweb/autom4te.cache
? dev-libs/gsweb/Examples/hello/Hello.gswa
? dev-libs/gsweb/Examples/hello/shared_obj
? dev-libs/gsweb/GSWExtensions.framework/GSWExtensions.framework
? dev-libs/gsweb/GSWExtensionsGSW.framework/GSWExtensionsGSW.framework
? dev-libs/gsweb/GSWeb.framework/GSWeb.framework
Index: dev-libs/gsweb/ChangeLog
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-libs/gsweb/ChangeLog,v
retrieving revision 1.88
diff -u -r1.88 ChangeLog
--- dev-libs/gsweb/ChangeLog    22 Jan 2003 14:16:56 -0000      1.88
+++ dev-libs/gsweb/ChangeLog    23 Jan 2003 15:44:55 -0000
@@ -1,3 +1,19 @@
+2003-01-23   David Ayers <d.ayers@inode.at>
+       * configure.ac:
+               o Check for GDL2 to set config.h correctly.
+       * configure:
+               o Regenerated.
+       * config.mak.in:
+               o Determine whether we have GDL2 during confifure.
+       * gsweb.make.in:
+               o Change AUXILIARY_INCLUDE_LIBS to AUXILIARY_TOOL_LIB.
+               o Handle GDL2 with ADDITIONAL_OBJCFLAGS.
+       * GSWeb/GSWHTMLURLValuesElement.m:
+       * GSWeb/GSWSession.m:
+               o Replace GSMD5 class with MD5Digest of new NSData category.
+       * Examples/hello/GNUmakefile:
+               o Use gsweb.make.
+
 2003-01-22   Manuel Guesdon <mguesdon@orange-concept.com>
        * GSWeb.framework/WebObjects: removed WO*
 
Index: dev-libs/gsweb/config.mak.in
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-libs/gsweb/config.mak.in,v
retrieving revision 1.1
diff -u -r1.1 config.mak.in
--- dev-libs/gsweb/config.mak.in        22 Jan 2003 12:24:23 -0000      1.1
+++ dev-libs/gsweb/config.mak.in        23 Jan 2003 15:44:55 -0000
@@ -2,7 +2,7 @@
 #
 #
 DYNAMIC_LINKER=simple
-GDL2=yes
+GDL2=@GDL2@
 LIBWRAP=@LIBWRAP@
 
 #Log Memory Alloc/Dealloc
Index: dev-libs/gsweb/configure
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-libs/gsweb/configure,v
retrieving revision 1.3
diff -u -r1.3 configure
--- dev-libs/gsweb/configure    22 Jan 2003 12:24:23 -0000      1.3
+++ dev-libs/gsweb/configure    23 Jan 2003 15:44:56 -0000
@@ -1174,6 +1174,40 @@
 echo "${ECHO_T}$GSWNAMES" >&6
 
 
+#--------------------------------------------------------------------
+# Check for GDL2
+#--------------------------------------------------------------------
+as_ac_File=`echo "ac_cv_file_$GNUSTEP_MAKEFILES/Auxiliary/gdl2.make" | 
$as_tr_sh`
+echo "$as_me:$LINENO: checking for $GNUSTEP_MAKEFILES/Auxiliary/gdl2.make" >&5
+echo $ECHO_N "checking for $GNUSTEP_MAKEFILES/Auxiliary/gdl2.make... $ECHO_C" 
>&6
+if eval "test \"\${$as_ac_File+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  test "$cross_compiling" = yes &&
+  { { echo "$as_me:$LINENO: error: cannot check for file existence when cross 
compiling" >&5
+echo "$as_me: error: cannot check for file existence when cross compiling" 
>&2;}
+   { (exit 1); exit 1; }; }
+if test -r "$GNUSTEP_MAKEFILES/Auxiliary/gdl2.make"; then
+  eval "$as_ac_File=yes"
+else
+  eval "$as_ac_File=no"
+fi
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6
+if test `eval echo '${'$as_ac_File'}'` = yes; then
+  GDL2=yes
+else
+  GDL2=no
+fi
+
+if test "$GDL2" = yes; then
+  cat >>confdefs.h <<\_ACEOF
+#define HAVE_GDL2 1
+_ACEOF
+
+fi
+
 
 #--------------------------------------------------------------------
 # Check for libwrap
@@ -2874,6 +2908,7 @@
 s,@ECHO_T@,$ECHO_T,;t t
 s,@LIBS@,$LIBS,;t t
 s,@GSWNAMES@,$GSWNAMES,;t t
+s,@GDL2@,$GDL2,;t t
 s,@CC@,$CC,;t t
 s,@CFLAGS@,$CFLAGS,;t t
 s,@LDFLAGS@,$LDFLAGS,;t t
Index: dev-libs/gsweb/configure.ac
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-libs/gsweb/configure.ac,v
retrieving revision 1.3
diff -u -r1.3 configure.ac
--- dev-libs/gsweb/configure.ac 22 Jan 2003 12:24:23 -0000      1.3
+++ dev-libs/gsweb/configure.ac 23 Jan 2003 15:44:56 -0000
@@ -44,6 +44,14 @@
 AC_MSG_RESULT($GSWNAMES)
 AC_SUBST(GSWNAMES)
 
+#--------------------------------------------------------------------
+# Check for GDL2
+#--------------------------------------------------------------------
+AC_CHECK_FILE($GNUSTEP_MAKEFILES/Auxiliary/gdl2.make, GDL2=yes, GDL2=no)
+if test "$GDL2" = yes; then
+  AC_DEFINE(HAVE_GDL2)
+fi
+AC_SUBST(GDL2)
 
 #--------------------------------------------------------------------
 # Check for libwrap
Index: dev-libs/gsweb/gsweb.make.in
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-libs/gsweb/gsweb.make.in,v
retrieving revision 1.3
diff -u -r1.3 gsweb.make.in
--- dev-libs/gsweb/gsweb.make.in        22 Jan 2003 12:24:23 -0000      1.3
+++ dev-libs/gsweb/gsweb.make.in        23 Jan 2003 15:44:56 -0000
@@ -35,7 +35,12 @@
 AUXILIARY_GSW_LIBS += -lGSWeb$(GSWEXT) -lGSWExtensions$(GSWEXT) 
-lGSWExtensionsGSW$(GSWEXT)
 
 AUXILIARY_INCLUDE_DIRS += @AUX_INCS@
-AUXILIARY_INCLUDE_LIBS += @AUX_LIBS@ -lGSANTLR
+AUXILIARY_TOOL_LIBS += @AUX_LIBS@ -lGSANTLR
+
+GDL2=@GDL2@
+ifeq ($(GDL2),yes)
+ADDITIONAL_OBJCFLAGS += -DGDL2=1
+endif
 
 endif # GSWEB_MAKE_LOADED
 
Index: dev-libs/gsweb/Examples/hello/GNUmakefile
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-libs/gsweb/Examples/hello/GNUmakefile,v
retrieving revision 1.1
diff -u -r1.1 GNUmakefile
--- dev-libs/gsweb/Examples/hello/GNUmakefile   11 Dec 2001 14:34:38 -0000      
1.1
+++ dev-libs/gsweb/Examples/hello/GNUmakefile   23 Jan 2003 15:44:57 -0000
@@ -28,6 +28,7 @@
 GNUSTEP_MAKEFILES = $(GNUSTEP_SYSTEM_ROOT)/Makefiles
 
 include $(GNUSTEP_MAKEFILES)/common.make
+include $(GNUSTEP_MAKEFILES)/Auxiliary/gsweb.make
 include config.mak
 
 
Index: dev-libs/gsweb/GSWeb.framework/GSWHTMLURLValuedElement.m
===================================================================
RCS file: 
/cvsroot/gnustep/gnustep/dev-libs/gsweb/GSWeb.framework/GSWHTMLURLValuedElement.m,v
retrieving revision 1.7
diff -u -r1.7 GSWHTMLURLValuedElement.m
--- dev-libs/gsweb/GSWeb.framework/GSWHTMLURLValuedElement.m    22 Jan 2003 
12:24:25 -0000      1.7
+++ dev-libs/gsweb/GSWeb.framework/GSWHTMLURLValuedElement.m    23 Jan 2003 
15:44:57 -0000
@@ -31,7 +31,7 @@
 static const char rcsId[] = "$Id: GSWHTMLURLValuedElement.m,v 1.7 2003/01/22 
12:24:25 mguesdon Exp $";
 
 #include "GSWeb.h"
-#include <gscrypt/GSMD5.h>
+#include <gnustep/base/GSCategories.h>
 
 //====================================================================
 @implementation GSWHTMLURLValuedElement
@@ -577,8 +577,8 @@
         {
           // We calculate cidKeyValue by computing md5 on path
           // so there will be no duplicate elements with different keys
-          cidKeyValue=DataToHexString([GSMD5 digestOfString:url
-                                             
usingEncoding:NSISOLatin1StringEncoding]);
+           cidKeyValue=DataToHexString(
+               [[url dataUsingEncoding: NSISOLatin1StringEncoding] MD5Digest]);
         };
       newURL=[self addCIDElement:[NSDictionary dictionaryWithObject:url
                                                forKey:@"url"]
@@ -608,7 +608,7 @@
         {
           // We calculate cidKeyValue by computing md5 on path
           // so there will be no duplicate elements with different keys
-          //NSString* cidKeyValue=DataToHexString([GSMD5 digestOfData:data]);
+          //NSString* cidKeyValue=DataToHexString([data MD5Digest]);
           cidKeyValue=[data key];
         };
       newURL=[self addCIDElement:[NSDictionary dictionaryWithObject:data
@@ -639,8 +639,8 @@
         {
           // We calculate cidKeyValue by computing md5 on path
           // so there will be no duplicate elements with different keys
-          cidKeyValue=DataToHexString([GSMD5 digestOfString:path
-                                             
usingEncoding:NSISOLatin1StringEncoding]);
+         cidKeyValue=DataToHexString(
+               [[path dataUsingEncoding: NSISOLatin1StringEncoding] 
MD5Digest]);
         };
 
       newURL=[self addCIDElement:[NSDictionary dictionaryWithObject:path
Index: dev-libs/gsweb/GSWeb.framework/GSWSession.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-libs/gsweb/GSWeb.framework/GSWSession.m,v
retrieving revision 1.16
diff -u -r1.16 GSWSession.m
--- dev-libs/gsweb/GSWeb.framework/GSWSession.m 22 Jan 2003 12:24:25 -0000      
1.16
+++ dev-libs/gsweb/GSWeb.framework/GSWSession.m 23 Jan 2003 15:44:57 -0000
@@ -31,7 +31,8 @@
 static const char rcsId[] = "$Id: GSWSession.m,v 1.16 2003/01/22 12:24:25 
mguesdon Exp $";
 
 #include "GSWeb.h"
-#include <gscrypt/GSMD5.h>
+#include <gnustep/base/GSCategories.h>
+
 #include <time.h>
 #if __linux__
 #include <linux/kernel.h>
@@ -39,12 +40,6 @@
 #include <sys/sysinfo.h>
 #endif
 
-/*
-#ifdef NOEXTENSIONS
-#else
-#include <extensions/GarbageCollector.h>
-#endif
-*/
 //====================================================================
 
 @implementation GSWSession
@@ -205,7 +200,7 @@
       pMd5Data++;
     };
   //Now do md5 on bytes after sizeof(ts)
-  md5Sum=[GSMD5 digestOfData:md5Data];
+  md5Sum=[md5Data MD5Digest];
   [data appendData:md5Sum];
   sessionID=DataToHexString(data);
   return sessionID;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]