Permalink
Browse files

Georg Horn's Curl::easy interface for perl

  • Loading branch information...
1 parent 71b4b2f commit d538241a58f293b3510b301eff1acdc3c5ee41c2 @bagder bagder committed Mar 16, 2001
Showing with 612 additions and 0 deletions.
  1. +35 −0 perl/Curl_easy/Changes
  2. +6 −0 perl/Curl_easy/MANIFEST
  3. +14 −0 perl/Curl_easy/Makefile.PL
  4. +27 −0 perl/Curl_easy/README
  5. +139 −0 perl/Curl_easy/easy.pm
  6. +290 −0 perl/Curl_easy/easy.xs
  7. +101 −0 perl/Curl_easy/test.pl
@@ -0,0 +1,35 @@
+Revision history for Perl extension Curl::easy.
+Check out the file README for more info.
+
+1.0.2 Tue Oct 10 2000:
+ - runs with libcurl 7.4
+ - modified curl_easy_getinfo(). It now calls curl_getinfo() that has
+ been added to libcurl in version 7.4.
+
+1.0.1 Tue Oct 10 2000:
+ - Added some missing features of curl_easy_setopt():
+ - CURLOPT_ERRORBUFFER now works by passing the name of a perl
+ variable that shall be crated and the errormessage (if any)
+ be stored to.
+ - Passing filehandles (Options FILE, INFILE and WRITEHEADER) now works.
+ Have a look at test.pl to see how it works...
+
+ - Added a new function, curl_easy_getinfo(), that for now always
+ returns the number of bytes that where written to disk during the last
+ download. If the curl_easy_getinfo() function is included in libcurl,
+ (as promised by Daniel ;-)) i will turn this into just a call to this
+ function.
+
+1.0 Thu Oct 5 2000:
+ - first released version
+ - runs with libcurl 7.3
+ - some features of curl_easy_setopt() are still missing:
+ - passing function pointers doesn't work (options WRITEFUNCTION,
+ READFUNCTION and PROGRESSFUNCTION).
+ - passing FILE * pointers doesn't work (options FILE, INFILE and
+ WRITEHEADER).
+ - passing linked lists doesn't work (options HTTPHEADER and
+ HTTPPOST).
+ - setting the buffer where to store error messages in doesn't work
+ (option ERRORBUFFER).
+
@@ -0,0 +1,6 @@
+Changes
+MANIFEST
+Makefile.PL
+easy.pm
+easy.xs
+test.pl
@@ -0,0 +1,14 @@
+# Makefile.PL for Perl extension Curl::easy.
+# Check out the file README for more info.
+
+use ExtUtils::MakeMaker;
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+WriteMakefile(
+ 'NAME' => 'Curl::easy',
+ 'VERSION_FROM' => 'easy.pm', # finds $VERSION
+ 'LIBS' => ['-lcurl '], # e.g., '-lm'
+ 'DEFINE' => '', # e.g., '-DHAVE_SOMETHING'
+ 'INC' => '', # e.g., '-I/usr/include/other'
+ 'clean' => {FILES => "head.out body.out"}
+);
View
@@ -0,0 +1,27 @@
+README for Perl extension Curl::easy.
+
+The perl module Curl::easy provides an interface to the cURL library "libcurl".
+See http://curl.haxx.se/ for more information on cURL and libcurl.
+
+This module requires libcurl and the corresponding headerfiles to be
+installed. You then may install this module via the usual way:
+
+ perl Makefile.PL
+ make
+ make test
+ make install
+
+The module provides the same functionality as libcurl provides to C programs,
+please refer to the documentation of libcurl.
+
+A short example how to use the module may be found in test.pl.
+
+This Software is distributed AS IS, WITHOUT WARRANTY OF ANY KIND,
+either express or implied. Send praise, patches, money, beer and
+pizza to the author. Send complaints to /dev/null. ;-)
+
+The author of this module is Georg Horn <horn@koblenz-net.de>
+
+The latest version of this module can be dowloaded from
+http://koblenz-net.de/~horn/export/
+
View
@@ -0,0 +1,139 @@
+# Perl interface for libcurl. Check out the file README for more info.
+
+package Curl::easy;
+
+use strict;
+use Carp;
+use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD);
+
+require Exporter;
+require DynaLoader;
+require AutoLoader;
+
+@ISA = qw(Exporter DynaLoader);
+# Items to export into callers namespace by default. Note: do not export
+# names by default without a very good reason. Use EXPORT_OK instead.
+# Do not simply export all your public functions/methods/constants.
+@EXPORT = qw(
+CURLOPT_AUTOREFERER
+CURLOPT_COOKIE
+CURLOPT_COOKIEFILE
+CURLOPT_CRLF
+CURLOPT_CUSTOMREQUEST
+CURLOPT_ERRORBUFFER
+CURLOPT_FAILONERROR
+CURLOPT_FILE
+CURLOPT_FOLLOWLOCATION
+CURLOPT_FTPAPPEND
+CURLOPT_FTPASCII
+CURLOPT_FTPLISTONLY
+CURLOPT_FTPPORT
+CURLOPT_HEADER
+CURLOPT_HTTPHEADER
+CURLOPT_HTTPPOST
+CURLOPT_HTTPPROXYTUNNEL
+CURLOPT_HTTPREQUEST
+CURLOPT_INFILE
+CURLOPT_INFILESIZE
+CURLOPT_INTERFACE
+CURLOPT_KRB4LEVEL
+CURLOPT_LOW_SPEED_LIMIT
+CURLOPT_LOW_SPEED_TIME
+CURLOPT_MUTE
+CURLOPT_NETRC
+CURLOPT_NOBODY
+CURLOPT_NOPROGRESS
+CURLOPT_NOTHING
+CURLOPT_PORT
+CURLOPT_POST
+CURLOPT_POSTFIELDS
+CURLOPT_POSTFIELDSIZE
+CURLOPT_POSTQUOTE
+CURLOPT_PROGRESSDATA
+CURLOPT_PROGRESSFUNCTION
+CURLOPT_PROXY
+CURLOPT_PROXYPORT
+CURLOPT_PROXYUSERPWD
+CURLOPT_PUT
+CURLOPT_QUOTE
+CURLOPT_RANGE
+CURLOPT_READFUNCTION
+CURLOPT_REFERER
+CURLOPT_RESUME_FROM
+CURLOPT_SSLCERT
+CURLOPT_SSLCERTPASSWD
+CURLOPT_SSLVERSION
+CURLOPT_STDERR
+CURLOPT_TIMECONDITION
+CURLOPT_TIMEOUT
+CURLOPT_TIMEVALUE
+CURLOPT_TRANSFERTEXT
+CURLOPT_UPLOAD
+CURLOPT_URL
+CURLOPT_USERAGENT
+CURLOPT_USERPWD
+CURLOPT_VERBOSE
+CURLOPT_WRITEFUNCTION
+CURLOPT_WRITEHEADER
+
+CURLINFO_EFFECTIVE_URL
+CURLINFO_HTTP_CODE
+CURLINFO_TOTAL_TIME
+CURLINFO_NAMELOOKUP_TIME
+CURLINFO_CONNECT_TIME
+CURLINFO_PRETRANSFER_TIME
+CURLINFO_SIZE_UPLOAD
+CURLINFO_SIZE_DOWNLOAD
+CURLINFO_SPEED_DOWNLOAD
+CURLINFO_SPEED_UPLOAD
+CURLINFO_HEADER_SIZE
+CURLINFO_REQUEST_SIZE
+);
+$VERSION = '1.0.1';
+
+sub AUTOLOAD {
+ # This AUTOLOAD is used to 'autoload' constants from the constant()
+ # XS function.
+
+ (my $constname = $AUTOLOAD) =~ s/.*:://;
+ return constant($constname, 0);
+}
+
+bootstrap Curl::easy $VERSION;
+
+# Preloaded methods go here.
+
+# Autoload methods go after =cut, and are processed by the autosplit program.
+
+1;
+__END__
+# Below is the stub of documentation for your module. You better edit it!
+
+=head1 NAME
+
+Curl::easy - Perl extension for libcurl
+
+=head1 SYNOPSIS
+
+ use Curl::easy;
+
+ $CURL = curl_easy_init();
+ $CURLcode = curl_easy_setopt($CURL, CURLoption, Value);
+ $CURLcode = curl_easy_perform($CURL);
+ curl_easy_cleanup($CURL);
+
+
+=head1 DESCRIPTION
+
+This perl module provides an interface to the libcurl C library. See
+http://curl.haxx.se/ for more information on cURL and libcurl.
+
+=head1 AUTHOR
+
+Georg Horn <horn@koblenz-net.de>
+
+=head1 SEE ALSO
+
+http://curl.haxx.se/
+
+=cut
Oops, something went wrong. Retry.

0 comments on commit d538241

Please sign in to comment.