gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ./ChangeLog ./Makefile.am ./configure.ac ...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ./ChangeLog ./Makefile.am ./configure.ac ...
Date: Fri, 12 May 2006 22:17:29 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Branch:         
Changes by:     Sandro Santilli <address@hidden>        06/05/12 22:17:29

Modified files:
        .              : ChangeLog Makefile.am configure.ac 
        backend        : Makefile.am 
        libbase        : Makefile.am curl_adapter.cpp 
        utilities      : Makefile.am 
Added files:
        macros         : curl.m4 

Log message:
        * utililites/Makefile.am, backend/Makefile.am: add CURL_LIBS.
        * libbase/Makefile.am: curl_adapter build.
        * Makefile.am: CURL config dump.
        * macros/curl.m4: libcurl detection macro.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/ChangeLog.diff?tr1=1.311&tr2=1.312&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/Makefile.am.diff?tr1=1.21&tr2=1.22&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/configure.ac.diff?tr1=1.75&tr2=1.76&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/backend/Makefile.am.diff?tr1=1.21&tr2=1.22&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/libbase/Makefile.am.diff?tr1=1.22&tr2=1.23&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/libbase/curl_adapter.cpp.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/macros/curl.m4?rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/gnash/utilities/Makefile.am.diff?tr1=1.17&tr2=1.18&r1=text&r2=text

Patches:
Index: gnash/ChangeLog
diff -u gnash/ChangeLog:1.311 gnash/ChangeLog:1.312
--- gnash/ChangeLog:1.311       Fri May 12 20:56:46 2006
+++ gnash/ChangeLog     Fri May 12 22:17:29 2006
@@ -1,7 +1,11 @@
 2006-05-12 Sandro Santilli <address@hidden>
 
+       * utililites/Makefile.am, backend/Makefile.am: add CURL_LIBS.
+       * libbase/Makefile.am: curl_adapter build.
+       * Makefile.am: CURL config dump.
+       * macros/curl.m4: libcurl detection macro.
        * libbase/curl_adapter.cpp, libbase/curl_adapter.h: initial
-       implementation of a libcurl adapter for tu_file
+       implementation of a libcurl adapter for tu_file.
 
 2006-05-12 Rob Savoye <address@hidden>
 
Index: gnash/Makefile.am
diff -u gnash/Makefile.am:1.21 gnash/Makefile.am:1.22
--- gnash/Makefile.am:1.21      Mon Apr 24 23:05:55 2006
+++ gnash/Makefile.am   Fri May 12 22:17:29 2006
@@ -120,6 +120,8 @@
        @echo "MP3_LIBS is $(MP3_LIBS)"
        @echo "PTHREAD_CFLAGS is $(PTHREAD_CFLAGS)"
        @echo "PTHREAD_LIBS is $(PTHREAD_LIBS)"
+       @echo "CURL_CFLAGS is $(CURL_CFLAGS)"
+       @echo "CURL_LIBS is $(CURL_LIBS)"
        @echo "A blank value for CFLAGS means the header is installed in the"
        @echo "default system header location. All the LIBS should have a"
        @echo "legit value"
Index: gnash/backend/Makefile.am
diff -u gnash/backend/Makefile.am:1.21 gnash/backend/Makefile.am:1.22
--- gnash/backend/Makefile.am:1.21      Tue May  2 20:51:59 2006
+++ gnash/backend/Makefile.am   Fri May 12 22:17:29 2006
@@ -32,6 +32,7 @@
        $(PNG_LIBS)             \
         $(OGG_LIBS)            \
        $(ZLIB_LIBS)            \
+       $(CURL_LIBS)            \
         $(LIBXML_LIBS)         \
         $(SDL_LIBS)            \
         $(SDL_MIXER_LIBS)      \
Index: gnash/configure.ac
diff -u gnash/configure.ac:1.75 gnash/configure.ac:1.76
--- gnash/configure.ac:1.75     Fri May 12 04:51:33 2006
+++ gnash/configure.ac  Fri May 12 22:17:29 2006
@@ -328,6 +328,7 @@
 GNASH_DOCBOOK
 AM_CONDITIONAL(DOCBOOK, test x$docbook = xyes)
 GNASH_PROG_LIBTOOL
+GNASH_PATH_CURL
 
 dnl Define winsock if we're on windows. We could do something complicated,
 dnl but since AC_EXEEXT does it for us, we'll do this the easy way.
@@ -800,6 +801,15 @@
 
 fi
 
+if test x"$CURL_LIBS" != x; then
+  if test x"$CURL_CFLAGS" != x; then
+    echo "        CURL flags are: $CURL_CFLAGS"
+  else
+    echo "        CURL flags are: default include path"
+  fi
+    echo "        CURL libs are: $CURL_LIBS"
+fi
+
 
 # If anything critical is missing, don't bother to continue
 if test x"$nogo" = x"true"; then
Index: gnash/libbase/Makefile.am
diff -u gnash/libbase/Makefile.am:1.22 gnash/libbase/Makefile.am:1.23
--- gnash/libbase/Makefile.am:1.22      Thu May 11 13:22:51 2006
+++ gnash/libbase/Makefile.am   Fri May 12 22:17:29 2006
@@ -48,6 +48,7 @@
         $(PNG_CFLAGS) \
         $(SDL_CFLAGS) \
        $(SDL_MIXER_CFLAGS) \
+       $(CURL_CFLAGS) \
         $(ZLIB_CFLAGS) \
         $(JPEG_CFLAGS)
 
@@ -98,6 +99,7 @@
        tu_types.cpp            \
        utf8.cpp                \
        utility.cpp             \
+       curl_adapter.cpp        \
        zlib_adapter.cpp
 libgnashbase_la_LIBADD = $(JPEG_LIBS) $(ZLIB_LIBS)
 
@@ -125,6 +127,7 @@
        tu_types.h              \
        utf8.h                  \
        utility.h               \
+       curl_adapter.h          \
        zlib_adapter.h
 
 #libbase_la_LDFLAGS = -module -avoid-version -no-undefined
Index: gnash/libbase/curl_adapter.cpp
diff -u gnash/libbase/curl_adapter.cpp:1.1 gnash/libbase/curl_adapter.cpp:1.2
--- gnash/libbase/curl_adapter.cpp:1.1  Fri May 12 20:56:46 2006
+++ gnash/libbase/curl_adapter.cpp      Fri May 12 22:17:29 2006
@@ -35,30 +35,25 @@
 // 
 //
 
-//#define HAVE_LIBCURL 1
-//#define GNASH_CURL_VERBOSE 1
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
+#ifdef HAVE_CURL_CURL_H
+# define HAVE_LIBCURL 1
+#endif
 
 #include "curl_adapter.h"
 #include "tu_file.h"
 #include "utility.h"
 
-#include <stdexcept>
-#include <cstdio>
-#include <cerrno>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-
-
-// remove me when done
-//#include "log.h"
+//#define GNASH_CURL_VERBOSE 1
 
+// define this if you want seeks back to be reported (on stderr)
+//#define GNASH_CURL_WARN_SEEKSBACK 1
 
 #ifndef HAVE_LIBCURL
 
-
 // Stubs, in case client doesn't want to link to zlib.
 namespace curl_adapter
 {
@@ -73,6 +68,12 @@
 #else // def HAVE_LIBCURL
 
 
+#include <stdexcept>
+#include <cstdio>
+#include <cerrno>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
 #include <curl/curl.h>
 
 namespace curl_adapter
@@ -103,6 +104,7 @@
 
 public:
 
+       /// Open a stream from the specified URL
        CurlStreamFile(const std::string& url);
 
        ~CurlStreamFile();
@@ -124,8 +126,6 @@
 
 private:
 
-       static const size_t BUFSIZE = 2;
-
        // Use this file to cache data
        FILE* _cache;
 
@@ -146,15 +146,17 @@
        // transfer in progress
        int _running;
 
-       /// Attempt at filling the cache up to the given size
+       // Attempt at filling the cache up to the given size.
+       // Will call libcurl routines to fetch data.
        void fill_cache(size_t size);
 
-       /// Append sz bytes to the cache
+       // Append sz bytes to the cache
        size_t cache(void *from, size_t sz);
 
        void printInfo();
 
-       /// Callback for libcurl 
+       // Callback for libcurl, will be called
+       // by fill_cache() and will call cache() 
        static size_t recv(void *buf, size_t  size, 
                size_t  nmemb, void *userp);
 
@@ -167,7 +169,7 @@
  * 
  **********************************************************************/
 
-/// Ensure libcurl is initialized
+// Ensure libcurl is initialized
 static void ensure_libcurl_initialized()
 {
        static bool initialized=0;
@@ -192,11 +194,6 @@
 }
 
        
-/// Cache a chunk of data to the buffer
-//
-/// add to the buffer, resizing if needed.
-/// Return the number of bytes taken care of.
-///
 /*private*/
 size_t
 CurlStreamFile::cache(void *from, size_t sz)
@@ -226,10 +223,6 @@
 }
 
 
-/// Attempt at filling the cache up to the given size
-//
-/// Return
-//
 /*private*/
 void
 CurlStreamFile::fill_cache(size_t size)
@@ -357,10 +350,6 @@
        fclose(_cache);
 }
 
-/// Read 'bytes' bytes into the given buffer.
-//
-/// Return number of actually read bytes
-///
 /*public*/
 size_t
 CurlStreamFile::read(void *dst, size_t bytes)
@@ -381,7 +370,6 @@
 
 }
 
-/// Return true if EOF has been reached
 /*public*/
 bool
 CurlStreamFile::eof()
@@ -395,7 +383,6 @@
 
 }
 
-/// Report global position within the file
 /*public*/
 size_t
 CurlStreamFile::tell()
@@ -410,16 +397,17 @@
 
 }
 
-/// Put read pointer at given position
 /*public*/
 bool
 CurlStreamFile::seek(size_t pos)
 {
+#ifdef GNASH_CURL_WARN_SEEKSBACK
        if ( pos < tell() ) {
                fprintf(stderr,
                        "Warning: seek backward requested (%zd from %zd)\n",
                        pos, tell());
        }
+#endif
 
        fill_cache(pos);
 
@@ -440,30 +428,27 @@
 
 
 // Return number of bytes actually read.
-/*private*/
-int
+static int
 read(void* dst, int bytes, void* appdata)
 {
        CurlStreamFile* stream = (CurlStreamFile*) appdata;
        return stream->read(dst, bytes);
 }
 
-/*public*/
-bool
+static bool
 eof(void* appdata)
 {
        CurlStreamFile* stream = (CurlStreamFile*) appdata;
        return stream->eof();
 }
 
-int
+static int
 write(const void* src, int bytes, void* appdata)
 {
        assert(0); // not supported
 }
 
-/*public*/
-int
+static int
 seek(int pos, void* appdata)
 {
        CurlStreamFile* stream = (CurlStreamFile*) appdata;
@@ -471,21 +456,20 @@
        else return TU_FILE_SEEK_ERROR;
 }
 
-int
+static int
 seek_to_end(void* appdata)
 {
        assert(0); // not supported
 }
 
-int
+static int
 tell(void* appdata)
 {
        CurlStreamFile* stream = (CurlStreamFile*) appdata;
        return stream->tell();
 }
 
-
-int
+static int
 close(void* appdata)
 {
        CurlStreamFile* stream = (CurlStreamFile*) appdata;
@@ -496,6 +480,7 @@
        return 0;
 }
 
+// this is the only exported interface
 tu_file*
 make_stream(const char* url)
 {
Index: gnash/utilities/Makefile.am
diff -u gnash/utilities/Makefile.am:1.17 gnash/utilities/Makefile.am:1.18
--- gnash/utilities/Makefile.am:1.17    Thu Apr 27 15:31:18 2006
+++ gnash/utilities/Makefile.am Fri May 12 22:17:29 2006
@@ -37,6 +37,7 @@
        $(PNG_LIBS) \
         $(OGG_LIBS) \
        $(ZLIB_LIBS) \
+       $(CURL_LIBS) \
         $(LIBXML_LIBS) \
         $(OPENGL_LIBS) \
        $(GLEXT_LIBS) \




reply via email to

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