HomeInternet Applications

cURL-Bigloo: transferring Internet data with Bigloo Scheme

cURL is a command line tool and libcurl is a library for transferring data specified with URL syntax.
curl-bigloo.scm provides Bigloo bindings for this library.

Usage (by example):

This is a sample code which gets HTTP header and HTML file from the URL specified.
-----------  ----------

(module
  test
  (use 
    (curl "curl-bigloo.scm")))

(print "CURL version: " (curl-version))

;; Initialization
(define curl-ptr (curl-easy-init))

(print "URL: " 
       (curl-easy-setopt curl-ptr (CURLOPT-URL) "http://localhost/index.html"))

(print "FILE: "
       (curl-easy-setopt curl-ptr (CURLOPT-FILE) (fopen "index.html" "w")))

(print "WRITE-HEADER: "
       (curl-easy-setopt curl-ptr (CURLOPT-WRITEHEADER) (fopen "header" "w")))

(print "Perform: " (curl-easy-perform curl-ptr))

;; Clean up
(curl-easy-cleanup curl-ptr)

(exit)

----------  ----
It have to be linked with libcurl:
bigloo test.scm -lcurl
Please consult cURL manuals for more information.

Acknowledgements:

Many thanks to Vladimir Tsichevski for hints and tips on Bigloo FFI.

Copyrights:

curl-bigloo code is in Public Domain.
libcurl is subject of MPL or MIT/X license.
The Bigloo run-time system and the libraries are distributed under the terms of the GNU Library General Public License The compiler and the tools are distributed under the terms of the Gnu Public License.

Links:

curl-bigloo

Bigloo-lib
now provides cURL bindings

Bigloo

cURL


HomeInternet Applications