Mercurial > libavformat.hg
diff avformat.h @ 151:ec4d9190d3b1 libavformat
dynamic array functions
| author | bellard |
|---|---|
| date | Fri, 13 Jun 2003 14:22:23 +0000 |
| parents | b9703b3c10b6 |
| children | 7d698c3213a0 |
line wrap: on
line diff
--- a/avformat.h Mon Jun 09 19:11:50 2003 +0000 +++ b/avformat.h Fri Jun 13 14:22:23 2003 +0000 @@ -428,6 +428,16 @@ 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);
