diff options
author | François Revol <revol@free.fr> | 2002-11-02 10:35:07 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2002-11-02 10:35:07 +0000 |
commit | 9ddd71fc6063b357344f81a0f704c1d04f584ada (patch) | |
tree | 87e9377d16bd2a22727ca6f572ba312f167d258f /libav/barpainet.c | |
parent | bbd8335b69b4960b2a6e830317f189748232c749 (diff) | |
download | ffmpeg-9ddd71fc6063b357344f81a0f704c1d04f584ada.tar.gz |
added BeOS net_server support (R5 network stack), basically the same
problems as with winsock (sockets != fd), and the broken select().
based on older patch by Andrew Bachmann.
patch by (François Revol <revol at free dot fr>)
Originally committed as revision 1144 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libav/barpainet.c')
-rw-r--r-- | libav/barpainet.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/libav/barpainet.c b/libav/barpainet.c new file mode 100644 index 0000000000..c1e8877718 --- /dev/null +++ b/libav/barpainet.c @@ -0,0 +1,25 @@ + +#include <stdlib.h> +#include <strings.h> +#include "barpainet.h" + +int inet_aton (const char * str, struct in_addr * add) { + const char * pch = str; + unsigned int add1 = 0, add2 = 0, add3 = 0, add4 = 0; + + add1 = atoi(pch); + pch = strpbrk(pch,"."); + if (pch == 0 || ++pch == 0) goto done; + add2 = atoi(pch); + pch = strpbrk(pch,"."); + if (pch == 0 || ++pch == 0) goto done; + add3 = atoi(pch); + pch = strpbrk(pch,"."); + if (pch == 0 || ++pch == 0) goto done; + add4 = atoi(pch); + +done: + add->s_addr=(add4<<24)+(add3<<16)+(add2<<8)+add1; + + return 1; +} |