aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/avformat.h
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2003-06-13 14:22:23 +0000
committerFabrice Bellard <fabrice@bellard.org>2003-06-13 14:22:23 +0000
commit39f472c3b6dd8405b33ad3c59f0b52046a393938 (patch)
treec173fc0b8904e494ba60783c6f2f588c9b99601d /libavformat/avformat.h
parent124ba5836fb896e580de0ed5d2f2b0b2daee4a27 (diff)
downloadffmpeg-39f472c3b6dd8405b33ad3c59f0b52046a393938.tar.gz
dynamic array functions
Originally committed as revision 1955 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/avformat.h')
-rw-r--r--libavformat/avformat.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 3267cba7b1..e7dab88671 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -428,6 +428,16 @@ int stristart(const char *str, const char *val, const char **ptr);
void pstrcpy(char *buf, int buf_size, const char *str);
char *pstrcat(char *buf, int buf_size, const char *s);
+void __dynarray_add(unsigned long **tab_ptr, int *nb_ptr, unsigned long elem);
+
+#define dynarray_add(tab, nb_ptr, elem)\
+do {\
+ typeof(tab) _tab = (tab);\
+ typeof(elem) _elem = (elem);\
+ (void)sizeof(**_tab == _elem); /* check that types are compatible */\
+ __dynarray_add((unsigned long **)_tab, nb_ptr, (unsigned long)_elem);\
+} while(0)
+
struct in_addr;
int resolve_host(struct in_addr *sin_addr, const char *hostname);