Fixed some compile warnings and errors and improved portability in the
examples. Removed ftp3rdparty.c since libcurl doesn't support 3rd party FTP transfers any longer.
This commit is contained in:
@@ -70,7 +70,7 @@ struct fcurl_data
|
||||
typedef struct fcurl_data URL_FILE;
|
||||
|
||||
/* exported functions */
|
||||
URL_FILE *url_fopen(char *url,const char *operation);
|
||||
URL_FILE *url_fopen(const char *url,const char *operation);
|
||||
int url_fclose(URL_FILE *file);
|
||||
int url_feof(URL_FILE *file);
|
||||
size_t url_fread(void *ptr, size_t size, size_t nmemb, URL_FILE *file);
|
||||
@@ -93,11 +93,11 @@ write_callback(char *buffer,
|
||||
URL_FILE *url = (URL_FILE *)userp;
|
||||
size *= nitems;
|
||||
|
||||
rembuff=url->buffer_len - url->buffer_pos;//remaining space in buffer
|
||||
rembuff=url->buffer_len - url->buffer_pos; /* remaining space in buffer */
|
||||
|
||||
if(size > rembuff)
|
||||
{
|
||||
//not enuf space in buffer
|
||||
/* not enough space in buffer */
|
||||
newbuff=realloc(url->buffer,url->buffer_len + (size - rembuff));
|
||||
if(newbuff==NULL)
|
||||
{
|
||||
@@ -211,7 +211,7 @@ use_buffer(URL_FILE *file,int want)
|
||||
|
||||
|
||||
URL_FILE *
|
||||
url_fopen(char *url,const char *operation)
|
||||
url_fopen(const char *url,const char *operation)
|
||||
{
|
||||
/* this code could check for URLs or types in the 'url' and
|
||||
basicly use the real fopen() for standard files */
|
||||
@@ -236,7 +236,7 @@ url_fopen(char *url,const char *operation)
|
||||
|
||||
curl_easy_setopt(file->handle.curl, CURLOPT_URL, url);
|
||||
curl_easy_setopt(file->handle.curl, CURLOPT_WRITEDATA, file);
|
||||
curl_easy_setopt(file->handle.curl, CURLOPT_VERBOSE, FALSE);
|
||||
curl_easy_setopt(file->handle.curl, CURLOPT_VERBOSE, 0);
|
||||
curl_easy_setopt(file->handle.curl, CURLOPT_WRITEFUNCTION, write_callback);
|
||||
|
||||
if(!multi_handle)
|
||||
@@ -466,7 +466,7 @@ main(int argc, char *argv[])
|
||||
|
||||
int nread;
|
||||
char buffer[256];
|
||||
char *url;
|
||||
const char *url;
|
||||
|
||||
if(argc < 2)
|
||||
{
|
||||
@@ -481,7 +481,7 @@ main(int argc, char *argv[])
|
||||
outf=fopen("fgets.test","w+");
|
||||
if(!outf)
|
||||
{
|
||||
perror("couldnt open fgets output file\n");
|
||||
perror("couldn't open fgets output file\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -508,7 +508,7 @@ main(int argc, char *argv[])
|
||||
outf=fopen("fread.test","w+");
|
||||
if(!outf)
|
||||
{
|
||||
perror("couldnt open fread output file\n");
|
||||
perror("couldn't open fread output file\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -533,7 +533,7 @@ main(int argc, char *argv[])
|
||||
outf=fopen("rewind.test","w+");
|
||||
if(!outf)
|
||||
{
|
||||
perror("couldnt open fread output file\n");
|
||||
perror("couldn't open fread output file\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user