Browse code

avio: deprecate the typedef for URLInterruptCB

There's no particular reason to pollute the namespace with a typedef for
it.

Anton Khirnov authored on 2011/04/08 02:17:55
Showing 3 changed files
... ...
@@ -49,7 +49,7 @@ static const AVClass urlcontext_class =
49 49
 static int default_interrupt_cb(void);
50 50
 
51 51
 URLProtocol *first_protocol = NULL;
52
-URLInterruptCB *url_interrupt_cb = default_interrupt_cb;
52
+int (*url_interrupt_cb)(void) = default_interrupt_cb;
53 53
 
54 54
 URLProtocol *av_protocol_next(URLProtocol *p)
55 55
 {
... ...
@@ -389,7 +389,7 @@ static int default_interrupt_cb(void)
389 389
     return 0;
390 390
 }
391 391
 
392
-void avio_set_interrupt_cb(URLInterruptCB *interrupt_cb)
392
+void avio_set_interrupt_cb(int (*interrupt_cb)(void))
393 393
 {
394 394
     if (!interrupt_cb)
395 395
         interrupt_cb = default_interrupt_cb;
... ...
@@ -90,11 +90,9 @@ typedef struct URLPollEntry {
90 90
  * silently ignored.
91 91
  */
92 92
 #define URL_FLAG_NONBLOCK 4
93
-#endif
94 93
 
95 94
 typedef int URLInterruptCB(void);
96 95
 
97
-#if FF_API_OLD_AVIO
98 96
 /**
99 97
  * @defgroup old_url_funcs Old url_* functions
100 98
  * @deprecated use the buffered API based on AVIOContext instead
... ...
@@ -117,7 +115,7 @@ attribute_deprecated void url_get_filename(URLContext *h, char *buf, int buf_siz
117 117
 attribute_deprecated int av_url_read_pause(URLContext *h, int pause);
118 118
 attribute_deprecated int64_t av_url_read_seek(URLContext *h, int stream_index,
119 119
                                               int64_t timestamp, int flags);
120
-attribute_deprecated void url_set_interrupt_cb(URLInterruptCB *interrupt_cb);
120
+attribute_deprecated void url_set_interrupt_cb(int (*interrupt_cb)(void));
121 121
 #endif
122 122
 
123 123
 /**
... ...
@@ -132,7 +130,7 @@ int url_exist(const char *url);
132 132
  * in this case by the interrupted function. 'NULL' means no interrupt
133 133
  * callback is given.
134 134
  */
135
-void avio_set_interrupt_cb(URLInterruptCB *interrupt_cb);
135
+void avio_set_interrupt_cb(int (*interrupt_cb)(void));
136 136
 
137 137
 #if FF_API_OLD_AVIO
138 138
 /* not implemented */
... ...
@@ -31,7 +31,7 @@
31 31
 #if !FF_API_OLD_AVIO
32 32
 #define URL_PROTOCOL_FLAG_NESTED_SCHEME 1 /*< The protocol name can be the first part of a nested protocol scheme */
33 33
 
34
-extern URLInterruptCB *url_interrupt_cb;
34
+extern int (*url_interrupt_cb)(void);
35 35
 #endif
36 36
 
37 37
 /**