Added a function to copy URL.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@3041 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
bertrand 2001-11-20 22:15:32 +00:00
parent 9ea246653a
commit 04178fa6f9
2 changed files with 17 additions and 0 deletions

View File

@ -104,6 +104,22 @@ url_new(char* url) {
return Curl;
}
URL_t *
url_copy(URL_t* url) {
URL_t *dup_url;
if( url==NULL ) return NULL;
dup_url = (URL_t*)malloc(sizeof(URL_t));
if( dup_url==NULL ) {
printf("Memory allocation failed!\n");
return NULL;
}
memcpy( dup_url, url, sizeof(URL_t) );
return dup_url;
}
void
url_free(URL_t* url) {
if(!url) return;

View File

@ -18,6 +18,7 @@ typedef struct {
} URL_t;
URL_t* url_new(char* url);
URL_t* url_copy(URL_t* url);
void url_free(URL_t* url);
#endif