Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add Curl_ prefix to conform with cURL naming standards
  • Loading branch information
yangtse committed Jun 9, 2010
1 parent d3714b0 commit 6a0d323
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
10 changes: 5 additions & 5 deletions lib/ftp.c
Expand Up @@ -3474,7 +3474,7 @@ static void wc_data_dtor(void *ptr)
{ {
struct ftp_wc_tmpdata *tmp = ptr; struct ftp_wc_tmpdata *tmp = ptr;
if(tmp) if(tmp)
ftp_parselist_data_free(&tmp->parser); Curl_ftp_parselist_data_free(&tmp->parser);
Curl_safefree(tmp); Curl_safefree(tmp);
} }


Expand Down Expand Up @@ -3525,7 +3525,7 @@ static CURLcode init_wc_data(struct connectdata *conn)
} }


/* INITIALIZE parselist structure */ /* INITIALIZE parselist structure */
ftp_tmp->parser = ftp_parselist_data_alloc(); ftp_tmp->parser = Curl_ftp_parselist_data_alloc();
if(!ftp_tmp->parser) if(!ftp_tmp->parser)
return CURLE_OUT_OF_MEMORY; return CURLE_OUT_OF_MEMORY;


Expand All @@ -3545,7 +3545,7 @@ static CURLcode init_wc_data(struct connectdata *conn)
/* backup old write_function */ /* backup old write_function */
ftp_tmp->backup.write_function = conn->data->set.fwrite_func; ftp_tmp->backup.write_function = conn->data->set.fwrite_func;
/* parsing write function (callback included directly from ftplistparser.c) */ /* parsing write function (callback included directly from ftplistparser.c) */
conn->data->set.fwrite_func = ftp_parselist; conn->data->set.fwrite_func = Curl_ftp_parselist;
/* backup old file descriptor */ /* backup old file descriptor */
ftp_tmp->backup.file_descriptor = conn->data->set.out; ftp_tmp->backup.file_descriptor = conn->data->set.out;
/* let the writefunc callback know what curl pointer is working with */ /* let the writefunc callback know what curl pointer is working with */
Expand Down Expand Up @@ -3586,7 +3586,7 @@ static CURLcode wc_statemach(struct connectdata *conn)
conn->data->set.out = ftp_tmp->backup.file_descriptor; conn->data->set.out = ftp_tmp->backup.file_descriptor;
wildcard->state = CURLWC_DOWNLOADING; wildcard->state = CURLWC_DOWNLOADING;


if(ftp_parselist_geterror(ftp_tmp->parser)) { if(Curl_ftp_parselist_geterror(ftp_tmp->parser)) {
/* error found in LIST parsing */ /* error found in LIST parsing */
wildcard->state = CURLWC_CLEAN; wildcard->state = CURLWC_CLEAN;
return wc_statemach(conn); return wc_statemach(conn);
Expand Down Expand Up @@ -3670,7 +3670,7 @@ static CURLcode wc_statemach(struct connectdata *conn)
case CURLWC_CLEAN: case CURLWC_CLEAN:
ret = CURLE_OK; ret = CURLE_OK;
if(ftp_tmp) { if(ftp_tmp) {
ret = ftp_parselist_geterror(ftp_tmp->parser); ret = Curl_ftp_parselist_geterror(ftp_tmp->parser);
} }
wildcard->state = ret ? CURLWC_ERROR : CURLWC_DONE; wildcard->state = ret ? CURLWC_ERROR : CURLWC_DONE;
break; break;
Expand Down
9 changes: 5 additions & 4 deletions lib/ftplistparser.c
Expand Up @@ -188,7 +188,7 @@ struct ftp_parselist_data {
} offsets; } offsets;
}; };


struct ftp_parselist_data *ftp_parselist_data_alloc(void) struct ftp_parselist_data *Curl_ftp_parselist_data_alloc(void)
{ {
struct ftp_parselist_data *parselist_data = struct ftp_parselist_data *parselist_data =
malloc(sizeof(struct ftp_parselist_data)); malloc(sizeof(struct ftp_parselist_data));
Expand All @@ -199,15 +199,15 @@ struct ftp_parselist_data *ftp_parselist_data_alloc(void)
} }




void ftp_parselist_data_free(struct ftp_parselist_data **pl_data) void Curl_ftp_parselist_data_free(struct ftp_parselist_data **pl_data)
{ {
if(*pl_data) if(*pl_data)
free(*pl_data); free(*pl_data);
*pl_data = NULL; *pl_data = NULL;
} }




CURLcode ftp_parselist_geterror(struct ftp_parselist_data *pl_data) CURLcode Curl_ftp_parselist_geterror(struct ftp_parselist_data *pl_data)
{ {
return pl_data->error; return pl_data->error;
} }
Expand Down Expand Up @@ -365,7 +365,8 @@ static CURLcode ftp_pl_insert_finfo(struct connectdata *conn,
return CURLE_OK; return CURLE_OK;
} }


size_t ftp_parselist(char *buffer, size_t size, size_t nmemb, void *connptr) size_t Curl_ftp_parselist(char *buffer, size_t size, size_t nmemb,
void *connptr)
{ {
size_t bufflen = size*nmemb; size_t bufflen = size*nmemb;
struct connectdata *conn = (struct connectdata *)connptr; struct connectdata *conn = (struct connectdata *)connptr;
Expand Down
9 changes: 5 additions & 4 deletions lib/ftplistparser.h
Expand Up @@ -25,14 +25,15 @@
#include <curl/curl.h> #include <curl/curl.h>


/* WRITEFUNCTION callback for parsing LIST responses */ /* WRITEFUNCTION callback for parsing LIST responses */
size_t ftp_parselist(char *buffer, size_t size, size_t nmemb, void *connptr); size_t Curl_ftp_parselist(char *buffer, size_t size, size_t nmemb,
void *connptr);


struct ftp_parselist_data; /* defined inside ftplibparser.c */ struct ftp_parselist_data; /* defined inside ftplibparser.c */


CURLcode ftp_parselist_geterror(struct ftp_parselist_data *pl_data); CURLcode Curl_ftp_parselist_geterror(struct ftp_parselist_data *pl_data);


struct ftp_parselist_data *ftp_parselist_data_alloc(void); struct ftp_parselist_data *Curl_ftp_parselist_data_alloc(void);


void ftp_parselist_data_free(struct ftp_parselist_data **pl_data); void Curl_ftp_parselist_data_free(struct ftp_parselist_data **pl_data);


#endif /* HEADER_CURL_FTPLISTPARSER_H */ #endif /* HEADER_CURL_FTPLISTPARSER_H */

0 comments on commit 6a0d323

Please sign in to comment.