libcurl.pbi

Share your advanced PureBasic knowledge/code with the community.
User avatar
Tristano
Enthusiast
Enthusiast
Posts: 195
Joined: Thu Nov 26, 2015 6:52 pm
Location: Italy
Contact:

Re: libcurl.pbi

Post by Tristano »

infratec wrote: Wed Jul 24, 2024 7:21 am Added a License.txt file
Thanks @infratec!
flashbob wrote: Thu Jul 25, 2024 2:55 pm You're basically right, but in this case I don't really understand the licensing confusion. The LibCurl library (dll) cannot be licensed again because it is an external open source project and a license already exists.
@flashbob, that license only covers the code of libcurl, but the bindings are the work of @infratec so they are Copyright by him, and he's free to keep it proprietary or release it under a license of his choosing (of course, if the license were to conflict with that of libcurl it would make little sense, but legally it doesn't make a difference).

Copyright is complex topic and has different rules for different types of works. In code projects, every chunk of code contributed by third parties also means that these parties have copy rights over their contributed code (e.g. in a cause for compensation, they will be allotted a share calculated on percentages over the entire code). So much so, that once a project creator has accepted external contributions he might not re-license the project without the consent of every contributor, since they own the decision rights over their code chunks.

Translations also count as Copyright, even though the Copyright of the original text is owned by the original author, the translation rights are owned by the translator. Even pagination and typesetting count as Copyrighted work. When it comes to photographs the laws are quite complex, since it depends on the central subject of the photograph: important building require permission from the architect who designed it, people must sign permissions to reuse, and with photographs of minors it's even more complicated, and these laws vary from country to country (in Italy, permission to reproduce photographs of living people expire after a fixed number of years).

Usually, the main problem when it comes to software licenses is always Germany, which has strict laws, and different ones from the rest of Europe. For example, in Germany public domain is basically impossible to use, because of a famous case where someone scanned public domain material for redistribution but the court ruled that the very act of scanning it made it copyrighted material, and revoked its public domain status — which is why German citizens and residents can't subscribe or contribute to the Gutenberg project, for example. Basically, in Germany it's very hard for a contemporary person do declare his work into the public domain, because any human efforts to operate on that material would make it copyrighted by those who handle it.

And of course, different countries tend to interpret differently the various licenses clauses (what constitutes "derivate work", what is eligible for copyright status, etc.). An example are the recent legal court cases over the use of library headers in proprietary closed-source software, where the offended party claims that using the headers binds to the license terms of the project, and where the other party claims that headers are not code and thus are not subject to the license terms.

Big companies have pools of lawyers who's job is to look into these legal problems, keeping track of international law. But for us Indy developers, the best we can do is stick to well known FOSS licenses and cross fingers — but at least with these licenses you are somewhat backed-up by the FOSS world, since many organizations have interests in seeing these licenses pass the test of real court trials.
The PureBASIC Archives: FOSS Resources:
User avatar
Tristano
Enthusiast
Enthusiast
Posts: 195
Joined: Thu Nov 26, 2015 6:52 pm
Location: Italy
Contact:

Default License of Code Published on Forum

Post by Tristano »

@flashbob:
flashbob wrote: Thu Jul 25, 2024 2:55 pm Btw.: Apart from that, any code posted by one in the forum can be used by others. Otherwise you wouldn't publish it. This is also part of the terms and conditions in most dev forums...
That's an interesting point, and it's true that some developer communities enforce a default license for contributed code (e.g. Rosetta Code, and others), but as far as I can remember there's no such clause on the PB forums, but I might be wrong, not having read it or forgotten about it. But then, even if there was the case, the Zip file with libcurl-pb wrapper is not published on the forum but elsewhere, it's just linked here, so the basic assumption of being proprietary unless otherwise states applies.

It's not unusual to see code examples being posted on communities, yet their author claiming them to be proprietary. Many think that unless there's a clear Copyright notice with "all rights reserved" then it's not copyrighted, but that's not the case, indeed it's copyrights and proprietary by default, and unless there's a clear statement regarding the permissibility to reuse it, the assumption is that it can't. To be clear, even FOSS licensed software retains copyright (unless it's a public domain deed), the only thing that the license grants are some type of usage permissions.

The real problem with code that hasn't got a clear license (e.g. the author granted generic permission, but not a license file) is that it becomes then hard to use it on public code platforms, like GitHub, GitLab, and others, where they have strict rules when it comes to licenses (they have to, since they are legally responsible for what happens on their servers). If the author were to write on the forum that he's OK with others using his/her code, that is probably enough legal ground to use it in you projects (after all, you can proof that the author granted such permission publicly), but it will be not enough to republish that code on platforms like GitHub, where they'd need stronger guarantees than hearsay.

As a practical example, I've translated some books to Italian with the author's permission, provided the book would be distributed freely (the original book was still being published and sold by a publisher). Some ebook platforms removed the book on the ground that since I wasn't the original author they couldn't be sure it was a legitimate publications, other were OK with seeing that the author acknowledged the Italian edition on his website and public forums, taking it as a confirmation that everything was OK. So, ultimately it's a problem of company policies when it comes to how strict they handle licenses and permissions. (BTW, although the original author retains the Copyright over the book, the Italian translation is Copyrighted by me, even though it doesn't make the author, but I am the translator in this case).

Another practical issue is that when it comes to using a wrapper inside a project which abides to a specific license, you need to ensure that the code is compatible with that license, but you might also end up not knowing how to handle it from a legal perspective: e.g. if the project is under license X, how can I declare the wrapper to be under the same license? only the original author can license it. As long as some code falls under a same family of compatible licenses, they it's OK to mix them together (even under a different license, as long as it abides by the original one in terms of what can and can't be done with it).

Anyhow, it might be a good idea if the PB forum were to provide some clear guidelines regarding contributed code published by its users. GitHub, for example, does grant some basic rights over any published code, even if it's without a license: cloning and forking, but not much else really.

Since enforcing a specific license might not work well with everybody (there's no "default" license for PB projects, everyone uses the license he prefers), it might be enough to tweak the forum interface, when editing for publishing, by adding a reminder that if the poster wants his/her code to be used by other he/she might want to add a license statement of some sort in the post.
The PureBASIC Archives: FOSS Resources:
flashbob
User
User
Posts: 92
Joined: Sat May 11, 2024 4:04 pm

Re: libcurl.pbi

Post by flashbob »

It seems that you have looked into the topic in more detail.
I think not many people know this. Thanks for the clarification!
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: libcurl.pbi

Post by Kwai chang caine »

Hello at all

How can i replace "password" word in this line

Code: Select all

#REMOTE_URL = "ftp://user:password@server/home/user" + #REMOTE_FILE
if there is a "@" in the password :oops:
Last edited by Kwai chang caine on Tue Dec 03, 2024 6:45 pm, edited 1 time in total.
ImageThe happiness is a road...
Not a destination
Marc56us
Addict
Addict
Posts: 1600
Joined: Sat Feb 08, 2014 3:26 pm

Re: libcurl.pbi

Post by Marc56us »

Kwai chang caine wrote: Mon Aug 05, 2024 8:05 pm Hello at all

How can i replace "password" word in this line

Code: Select all

#REMOTE_URL = "ftp://user:password@server/home/user" + #REMOTE_FILE
if there is a "@" in the password :oops:
Hi KCC,

Try replace @ in password with %40
(not tested)

Ref Wikipedia
:wink:
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: libcurl.pbi

Post by Kwai chang caine »

Hello Marc56US :D

Already, thanks to you i have lost the error message, it's a good news, i can continue a little bit far :wink:
Have a very good night 8)
ImageThe happiness is a road...
Not a destination
normeus
Enthusiast
Enthusiast
Posts: 470
Joined: Fri Apr 20, 2012 8:09 pm
Contact:

Re: libcurl.pbi

Post by normeus »

kcc
Use this to create the url for ftp instead of the single line:

Code: Select all

  #URL$ = "ftp.test.com"
  #Username$ = "username"
  #Password$ = "Le@mot@de@passe" 


    curl_easy_setopt_str(curl, #CURLOPT_URL, #URL$)
    curl_easy_setopt_str(curl, #CURLOPT_USERNAME, #Username$)
    curl_easy_setopt_str(curl, #CURLOPT_PASSWORD, #Password$)  


it replaces this 2 lines:

Code: Select all

#REMOTE_URL = "sftp://tester:password@192.168.56.1:2222"
    curl_easy_setopt_str(curl, #CURLOPT_URL, #REMOTE_URL)

google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari
infratec
Always Here
Always Here
Posts: 7582
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: libcurl.pbi

Post by infratec »

Updated to libcurl 8.9.1
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: libcurl.pbi

Post by Kwai chang caine »

@NORMEUS

Whaouh !!! that works now !!!

My file is corectly created at the good place :D
On the other hand, i don't know why, i'm force to write "SFTP://" instead of "FTP://" but it's perhaps normal ??
And i have a return of error, i don't know why :|
Amazing WRAPPER wrote:Error: Quote command returned error
Thanks a lot for your precious help, without forgetting Marc56 and obviously the GREAT INFRATEC for his merveillous jewel of wrapper 8)
ImageThe happiness is a road...
Not a destination
infratec
Always Here
Always Here
Posts: 7582
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: libcurl.pbi

Post by infratec »

Added

FTPS_GetDirectory.pb

to the examples.
infratec
Always Here
Always Here
Posts: 7582
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: libcurl.pbi

Post by infratec »

PB 6.12 beta 2 supported

Import of 2 additional libs were needed.
infratec
Always Here
Always Here
Posts: 7582
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: libcurl.pbi

Post by infratec »

Added:

SFTP_delete.pb
SFTP_rename.pb

to the examples.
infratec
Always Here
Always Here
Posts: 7582
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: libcurl.pbi

Post by infratec »

Updated the dlls to version 8.10.1
flashbob
User
User
Posts: 92
Joined: Sat May 11, 2024 4:04 pm

Possible to log in once to access all emails

Post by flashbob »

The function Pop3_GetMessageByNumber(...) demonstrates how to receive a message depending on the message number. Every time you receive a message, a new login is performed.

Is it possible to log on to the mail server once, receive all messages and then log off ? I think that would be faster...
infratec
Always Here
Always Here
Posts: 7582
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: libcurl.pbi

Post by infratec »

This is only an example.
You can program what you want or need :wink:
Post Reply