CVS: main/libmpdemux url.h,1.3,1.4 url.c,1.7,1.8
Update of /cvsroot/mplayer/main/libmpdemux In directory mplayer:/var/tmp.root/cvs-serv22231 Modified Files: url.h url.c Log Message: Added a function to copy URL. Index: url.h =================================================================== RCS file: /cvsroot/mplayer/main/libmpdemux/url.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- url.h 29 May 2001 16:58:52 -0000 1.3 +++ url.h 20 Nov 2001 22:15:32 -0000 1.4 @@ -18,6 +18,7 @@ } URL_t; URL_t* url_new(char* url); +URL_t* url_copy(URL_t* url); void url_free(URL_t* url); #endif Index: url.c =================================================================== RCS file: /cvsroot/mplayer/main/libmpdemux/url.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- url.c 22 Aug 2001 19:40:46 -0000 1.7 +++ url.c 20 Nov 2001 22:15:32 -0000 1.8 @@ -104,6 +104,22 @@ 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;
participants (2)
-
Bertrand Baudet -
Gabucino