Browse code

move ff_url_split() and ff_url_join() declarations to internal.h those functions are not part of the public API

Originally committed as revision 22534 to svn://svn.ffmpeg.org/ffmpeg/trunk

Aurelien Jacobs authored on 2010/03/15 08:59:48
Showing 9 changed files
... ...
@@ -1340,59 +1340,6 @@ const char *small_strptime(const char *p, const char *fmt,
1340 1340
                            struct tm *dt);
1341 1341
 
1342 1342
 /**
1343
- * Splits a URL string into components. To reassemble components back into
1344
- * a URL, use ff_url_join instead of using snprintf directly.
1345
- *
1346
- * The pointers to buffers for storing individual components may be null,
1347
- * in order to ignore that component. Buffers for components not found are
1348
- * set to empty strings. If the port isn't found, it is set to a negative
1349
- * value.
1350
- *
1351
- * @see ff_url_join
1352
- *
1353
- * @param proto the buffer for the protocol
1354
- * @param proto_size the size of the proto buffer
1355
- * @param authorization the buffer for the authorization
1356
- * @param authorization_size the size of the authorization buffer
1357
- * @param hostname the buffer for the host name
1358
- * @param hostname_size the size of the hostname buffer
1359
- * @param port_ptr a pointer to store the port number in
1360
- * @param path the buffer for the path
1361
- * @param path_size the size of the path buffer
1362
- * @param url the URL to split
1363
- */
1364
-void ff_url_split(char *proto, int proto_size,
1365
-                  char *authorization, int authorization_size,
1366
-                  char *hostname, int hostname_size,
1367
-                  int *port_ptr,
1368
-                  char *path, int path_size,
1369
-                  const char *url);
1370
-
1371
-/**
1372
- * Assembles a URL string from components. This is the reverse operation
1373
- * of ff_url_split.
1374
- *
1375
- * Note, this requires networking to be initialized, so the caller must
1376
- * ensure ff_network_init has been called.
1377
- *
1378
- * @see ff_url_split
1379
- *
1380
- * @param str the buffer to fill with the url
1381
- * @param size the size of the str buffer
1382
- * @param proto the protocol identifier, if null, the separator
1383
- *              after the identifier is left out, too
1384
- * @param authorization an optional authorization string, may be null
1385
- * @param hostname the host name string
1386
- * @param port the port number, left out from the string if negative
1387
- * @param fmt a generic format string for everything to add after the
1388
- *            host/port, may be null
1389
- * @return the number of characters written to the destination buffer
1390
- */
1391
-int ff_url_join(char *str, int size, const char *proto,
1392
-                const char *authorization, const char *hostname,
1393
-                int port, const char *fmt, ...);
1394
-
1395
-/**
1396 1343
  * Returns a positive value if the given filename has one of the given
1397 1344
  * extensions, 0 otherwise.
1398 1345
  *
... ...
@@ -24,6 +24,7 @@
24 24
 
25 25
 #include "libavutil/avstring.h"
26 26
 #include "avformat.h"
27
+#include "internal.h"
27 28
 #include "network.h"
28 29
 
29 30
 typedef struct {
... ...
@@ -24,6 +24,7 @@
24 24
 #include "avformat.h"
25 25
 #include <unistd.h>
26 26
 #include <strings.h>
27
+#include "internal.h"
27 28
 #include "network.h"
28 29
 #include "os_support.h"
29 30
 
... ...
@@ -59,4 +59,57 @@ int ff_probe_input_buffer(ByteIOContext **pb, AVInputFormat **fmt,
59 59
                           const char *filename, void *logctx,
60 60
                           unsigned int offset, unsigned int max_probe_size);
61 61
 
62
+/**
63
+ * Splits a URL string into components. To reassemble components back into
64
+ * a URL, use ff_url_join instead of using snprintf directly.
65
+ *
66
+ * The pointers to buffers for storing individual components may be null,
67
+ * in order to ignore that component. Buffers for components not found are
68
+ * set to empty strings. If the port isn't found, it is set to a negative
69
+ * value.
70
+ *
71
+ * @see ff_url_join
72
+ *
73
+ * @param proto the buffer for the protocol
74
+ * @param proto_size the size of the proto buffer
75
+ * @param authorization the buffer for the authorization
76
+ * @param authorization_size the size of the authorization buffer
77
+ * @param hostname the buffer for the host name
78
+ * @param hostname_size the size of the hostname buffer
79
+ * @param port_ptr a pointer to store the port number in
80
+ * @param path the buffer for the path
81
+ * @param path_size the size of the path buffer
82
+ * @param url the URL to split
83
+ */
84
+void ff_url_split(char *proto, int proto_size,
85
+                  char *authorization, int authorization_size,
86
+                  char *hostname, int hostname_size,
87
+                  int *port_ptr,
88
+                  char *path, int path_size,
89
+                  const char *url);
90
+
91
+/**
92
+ * Assembles a URL string from components. This is the reverse operation
93
+ * of ff_url_split.
94
+ *
95
+ * Note, this requires networking to be initialized, so the caller must
96
+ * ensure ff_network_init has been called.
97
+ *
98
+ * @see ff_url_split
99
+ *
100
+ * @param str the buffer to fill with the url
101
+ * @param size the size of the str buffer
102
+ * @param proto the protocol identifier, if null, the separator
103
+ *              after the identifier is left out, too
104
+ * @param authorization an optional authorization string, may be null
105
+ * @param hostname the host name string
106
+ * @param port the port number, left out from the string if negative
107
+ * @param fmt a generic format string for everything to add after the
108
+ *            host/port, may be null
109
+ * @return the number of characters written to the destination buffer
110
+ */
111
+int ff_url_join(char *str, int size, const char *proto,
112
+                const char *authorization, const char *hostname,
113
+                int port, const char *fmt, ...);
114
+
62 115
 #endif /* AVFORMAT_INTERNAL_H */
... ...
@@ -29,6 +29,7 @@
29 29
 #include "libavutil/lfg.h"
30 30
 #include "libavutil/sha.h"
31 31
 #include "avformat.h"
32
+#include "internal.h"
32 33
 
33 34
 #include "network.h"
34 35
 
... ...
@@ -30,6 +30,7 @@
30 30
 
31 31
 #include <unistd.h>
32 32
 #include <stdarg.h>
33
+#include "internal.h"
33 34
 #include "network.h"
34 35
 #include "os_support.h"
35 36
 #include <fcntl.h>
... ...
@@ -29,6 +29,7 @@
29 29
 #include <sys/select.h>
30 30
 #endif
31 31
 #include <strings.h>
32
+#include "internal.h"
32 33
 #include "network.h"
33 34
 #include "os_support.h"
34 35
 #include "rtsp.h"
... ...
@@ -20,6 +20,7 @@
20 20
  */
21 21
 #include "avformat.h"
22 22
 #include <unistd.h>
23
+#include "internal.h"
23 24
 #include "network.h"
24 25
 #include "os_support.h"
25 26
 #if HAVE_SYS_SELECT_H
... ...
@@ -27,6 +27,7 @@
27 27
 #define _BSD_SOURCE     /* Needed for using struct ip_mreq with recent glibc */
28 28
 #include "avformat.h"
29 29
 #include <unistd.h>
30
+#include "internal.h"
30 31
 #include "network.h"
31 32
 #include "os_support.h"
32 33
 #if HAVE_SYS_SELECT_H