1. [Announce] euLibCurl - An internet protocol transfer library
- Posted by Ray Smith <smithr at ix.net.au> Aug 23, 2002
- 453 views
Hi, Late last night I did a bit of a hunt around the net looking for a library to replace the euTcp4u http4u_get_file() function that fails with the HTTP 1.1 protocol web servers. I found "Curl" and the excellent library behind it "LibCurl". So now there is an euLibCurl! (ie. a Euphoria wrapper) euLibCurl is a very early wrapper that can replace the tcp4u get_file function. It isn't a drop in replacement for the tcp4u function - you'll need to recode any existing apps. You'll be glad you did as LibCurl is much much better! LibCurl has many many options which I might add in the future, but for now it can be used to download web pages/files from the web (including through a proxy and receiving pages/files stright to memory / sequences). Since this is such a quick release I can't promise not to change the current functions. So don't get too involved with it without sending me a message! euLibCurl comes with 2 demo programs and simple doco. It can be downloaded from my web page below. I'd love to hear from the people you had trouble with the tcp4u functions and see if euLibCurl works! :) Any questions, comments, bug reports, typos etc gladly accepted :) Thanks, Ray Smith http://rays-web.com
2. Re: [Announce] euLibCurl - An internet protocol transfer library
- Posted by Kat <gertie at PELL.NET> Aug 23, 2002
- 435 views
On 23 Aug 2002, at 13:40, Ray Smith wrote: > > Hi, > > Late last night I did a bit of a hunt around the net looking for a > library to replace the euTcp4u http4u_get_file() function that fails > with the HTTP 1.1 protocol web servers. > > I found "Curl" and the excellent library behind it "LibCurl". > > So now there is an euLibCurl! (ie. a Euphoria wrapper) > > euLibCurl is a very early wrapper that can replace the tcp4u > get_file function. It isn't a drop in replacement for the tcp4u > function - you'll need to recode any existing apps. You'll be glad > you did as LibCurl is much much better! > > LibCurl has many many options which I might add in the future, but for > now it can be used to download web pages/files from the web (including > through a proxy and receiving pages/files stright to memory / > sequences). > > Since this is such a quick release I can't promise not to change the > current functions. So don't get too involved with it without sending > me a message! > > euLibCurl comes with 2 demo programs and simple doco. > > It can be downloaded from my web page below. > > I'd love to hear from the people you had trouble with the tcp4u > functions and see if euLibCurl works! :) > > Any questions, comments, bug reports, typos etc gladly accepted :) I have two questions and a suggestion..... Q1) Re: aCurlHandle = 0 is failure, anything else is an error. so any value for a handle that is not a failure, is an error? Can you explain the difference, and why we would use a function that returns only failures and errors? Q2) If cURL is a commandline-only setup, is there a way to NOT open a gui or dosbox, and just get the webpage into a file or sequence like TCP4u does now? My suggestion is a better readme and examples, when you have the time. And maybe making the functions look like tcp4u, so the curl code would work just by changing the include declaration? Kat
3. Re: [Announce] euLibCurl - An internet protocol transfer library
- Posted by 10963508 at europeonline.com Aug 23, 2002
- 452 views
Can you just make simple internet functions, like: file_handle = open_internet_file (url) size = get_internet_file_size (file_handle) bool = does_internet_file_exist (file_handle) data = read_internet_file (file_handle) read_internet_file_bytes_by_bytes (file_handle, routineid) close_internet_file (file_handle) So that they would work with ftp and http? ----- Original Message ----- From: "Ray Smith" <smithr at ix.net.au> To: "EUforum" <EUforum at topica.com> Sent: Friday, August 23, 2002 3:40 PM Subject: [Announce] euLibCurl - An internet protocol transfer library > > Hi, > > Late last night I did a bit of a hunt around the net looking for a > library to replace the euTcp4u http4u_get_file() function that fails > with the HTTP 1.1 protocol web servers. > > I found "Curl" and the excellent library behind it "LibCurl". > > So now there is an euLibCurl! (ie. a Euphoria wrapper) > > euLibCurl is a very early wrapper that can replace the tcp4u > get_file function. It isn't a drop in replacement for the tcp4u > function - you'll need to recode any existing apps. You'll be glad > you did as LibCurl is much much better! > > LibCurl has many many options which I might add in the future, but for > now it can be used to download web pages/files from the web (including > through a proxy and receiving pages/files stright to memory / > sequences). > > Since this is such a quick release I can't promise not to change the > current functions. So don't get too involved with it without sending > me a message! > > euLibCurl comes with 2 demo programs and simple doco. > > It can be downloaded from my web page below. > > I'd love to hear from the people you had trouble with the tcp4u > functions and see if euLibCurl works! :) > > Any questions, comments, bug reports, typos etc gladly accepted :) > > Thanks, > > Ray Smith > http://rays-web.com > > > >
4. Re: [Announce] euLibCurl - An internet protocol transfer library
- Posted by 10963508 at europeonline.com Aug 23, 2002
- 440 views
----- Original Message ----- From: "Ray Smith" <smithr at ix.net.au> > My first instincts with wrapping a library is to keep as close as > possible to the base library ... which is what I have done so far. > (I added a curl_easy_process_ex() which takes care of the callbacks > as an extension) Yes, but you need to make it simple, like Win32Lib has done it: Let the user possibility to use original library functions or use simpler functions. > By making a strict parameter list like you specified above would > mean that some of the flexibility and power of the library would be > lost. > > I'm pretty sure I can implement a hybrid system where you can still set > these "extra" options before calling your listed functions. > > I need to implement (and play) more with LibCurl before trying to start > hiding some the gory details. This is how you can make functions simple and powerful at the same time (that's how I write some of my library functions): Last parameter of function is sequence named "params", which can be {} to use deault values, or only partially filled, or every member can be DEFAULT value. Like this: procedure draw_my_circle (integer x, integer y, sequence params) integer radius, color radius = get_member_default (params, 1, DEFAULT, 10) color = get_member_default (params, 2, DEFAULT, RED) draw_circle (x, y, radius, color) end procedure Then user can use that function like this: draw_my_circle (10, 10, {}) draw_my_circle (10, 10, {50}) draw_my_circle (10, 10, {DEFAULT, GREEN}) draw_my_circle (10, 10, {110, BLACK}) Where DEFAULT = -1073741824 (lowest euphoria integer) And get_member_default () is: function get_member_default (sequence s, integer pos, object must_not_be, object default_value) if pos >= 1 and pos <= length (s) then if not equal (s [pos], must_not_be) then return s [pos] else return default_value end if else return default_value end if end function
5. Re: [Announce] euLibCurl - An internet protocol transfer library
- Posted by 10963508 at europeonline.com Aug 26, 2002
- 445 views
Can you tell me where is main documentation for this library? On their site it's all messed up, I don't know where is main documentation to download, for programmers. I just want one internet library to: work with ftp and http and should never fail - find out if file exists - get size of file - read whole file, or read it bytes by bytes - enumerate files in ftp directory and get their info (size etc) Is curlib capable to do this? If yes, which functions do this? I wrapped wininet win32 api but it fails a lot of times. for example internet exporer can browse one ftp, but when i try that ftp with my lib it fails.