aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/barpainet.c
diff options
context:
space:
mode:
authorFabrice Bellard <fabrice@bellard.org>2002-11-25 19:07:40 +0000
committerFabrice Bellard <fabrice@bellard.org>2002-11-25 19:07:40 +0000
commitabac6175916c57f59ddb51ffe41bfd1d9851fe38 (patch)
tree8fc5b70a143f0f74468c353afbf043d7e104cdc0 /libavformat/barpainet.c
parent57fc25764261abe71b6cf7571eca182f8acf5795 (diff)
downloadffmpeg-abac6175916c57f59ddb51ffe41bfd1d9851fe38.tar.gz
renamed libav to libavformat
Originally committed as revision 1276 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/barpainet.c')
-rw-r--r--libavformat/barpainet.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/libavformat/barpainet.c b/libavformat/barpainet.c
new file mode 100644
index 0000000000..c1e8877718
--- /dev/null
+++ b/libavformat/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;
+}