+ avio_put_str(s, str);
+}
+
+#define GET(name, type) \
+ type get_be ##name(AVIOContext *s) \
+{\
+ return avio_rb ##name(s);\
+}\
+ type get_le ##name(AVIOContext *s) \
+{\
+ return avio_rl ##name(s);\
+}
+
+GET(16, unsigned int)
+GET(24, unsigned int)
+GET(32, unsigned int)
+GET(64, uint64_t)
+
+#undef GET
+
+#define PUT(name, type ) \
+ void put_le ##name(AVIOContext *s, type val)\
+{\
+ avio_wl ##name(s, val);\
+}\
+ void put_be ##name(AVIOContext *s, type val)\
+{\
+ avio_wb ##name(s, val);\
+}
+
+PUT(16, unsigned int)
+PUT(24, unsigned int)
+PUT(32, unsigned int)
+PUT(64, uint64_t)
+#undef PUT
+
+int get_byte(AVIOContext *s)
+{
+ return avio_r8(s);
+}
+int get_buffer(AVIOContext *s, unsigned char *buf, int size)
+{
+ return avio_read(s, buf, size);
+}
+int get_partial_buffer(AVIOContext *s, unsigned char *buf, int size)
+{
+ return ffio_read_partial(s, buf, size);
+}
+void put_byte(AVIOContext *s, int val)
+{
+ avio_w8(s, val);
+}
+void put_buffer(AVIOContext *s, const unsigned char *buf, int size)
+{
+ avio_write(s, buf, size);
+}
+void put_nbyte(AVIOContext *s, int b, int count)
+{
+ ffio_fill(s, b, count);
+}
+
+int url_fopen(AVIOContext **s, const char *filename, int flags)
+{
+ return avio_open(s, filename, flags);
+}
+int url_fclose(AVIOContext *s)
+{
+ return avio_close(s);
+}
+int64_t url_fseek(AVIOContext *s, int64_t offset, int whence)
+{
+ return avio_seek(s, offset, whence);
+}
+#endif
+
+int avio_put_str(AVIOContext *s, const char *str)
+{
+ int len = 1;
+ if (str) {
+ len += strlen(str);
+ avio_write(s, (const unsigned char *) str, len);
+ } else
+ avio_w8(s, 0);
+ return len;
+}
+
+int avio_put_str16le(AVIOContext *s, const char *str)
+{
+ const uint8_t *q = str;
+ int ret = 0;
+
+ while (*q) {
+ uint32_t ch;
+ uint16_t tmp;
+
+ GET_UTF8(ch, *q++, break;)
+ PUT_UTF16(ch, tmp, avio_wl16(s, tmp);ret += 2;)
+ }
+ avio_wl16(s, 0);
+ ret += 2;
+ return ret;