1 /********************************************************************
3 * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
4 * USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
5 * THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
6 * PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
8 * THE Ogg123 SOURCE CODE IS (C) COPYRIGHT 2000-2001 *
9 * by Stan Seibert <volsung@xiph.org> AND OTHER CONTRIBUTORS *
10 * http://www.xiph.org/ *
12 ********************************************************************
14 last mod: $Id: transport.c,v 1.4 2002/05/05 03:45:04 segher Exp $
16 ********************************************************************/
25 #include "transport.h"
28 extern transport_t file_transport
;
30 extern transport_t http_transport
;
33 transport_t
*transports
[] = {
42 transport_t
*get_transport_by_name (char *name
)
46 while (transports
[i
] != NULL
&& strcmp(name
, transports
[i
]->name
) != 0)
53 transport_t
*select_transport (char *source
)
57 while (transports
[i
] != NULL
&& !transports
[i
]->can_transport(source
))
64 data_source_stats_t
*malloc_data_source_stats (data_source_stats_t
*to_copy
)
66 data_source_stats_t
*new_stats
;
68 new_stats
= malloc(sizeof(data_source_stats_t
));
70 if (new_stats
== NULL
) {
71 fprintf(stderr
, _("Error: Could not allocate memory in malloc_data_source_stats()\n"));
75 *new_stats
= *to_copy
; /* Copy the data */