When _DIRENT_HAVE_D_TYPE is defined, struct dirent defines a
d_type member that will indicate if the type of the entry. This
saves an expensive syscall for each entry which can really add
up on slow filesystems (such as VirtualBox's shared folder FS).
We use the same logic as do_isfile, and return a 1 when the entry
is not a directory, and a 0 otherwise.
For our large project this reduced the overall stat syscalls from
118,865 to 39,177 and total premake generation time from 59,977ms
to 20,729ms on vboxsf.
See: https://gist.github.com/mendsley/4b56932056d5c231a94d1cdefd15c027
There was an undocumented return code from http.download which was the
numerical CURL error code.
This has been replaced with the HTTP response code. The return for
http.download is now error message, HTTP response code. This could
break code that was relying on the CURL error but my light research is
that users of this call were checking for the error message being “OK”
and that functionality is preserved.
http.get has been updated to have a consistent return signature to
http.download and now returns the result, error message, HTTP response
code. The error message is now set to “OK” to match http.download.
These changes abstract this api from curl and make the focus http.
Cleaned up the code to make it easier to follow and removed some memory
leaks.
http.get and http.download would leak if headers were supplied.
http.get would leak the string buffer if curl_init failed.
All options are now provided via a table which currently supports progress, userpwd, username, password, headers and should be extensible to add more options.
The previous signature of these funtions is supported for backward compatibility.
It appears that there were logic errors in the existing code such that a progress function would have only worked as the last parameter and would not work if headers were supplied. This is fixed such that the old signature will work if progress and headers are supplied.
Moved project definitions from premake.c to premake.h and added PREMAKE_ prefixes.
Utilized PREMAKE_VERSION in the user agent when making curl requests.