aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/os_support.c
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2006-11-14 21:31:19 +0000
committerDiego Biurrun <diego@biurrun.de>2006-11-14 21:31:19 +0000
commit54eb77c05e6a03815316908a64fa31b8c5353929 (patch)
treeeae7721dc81b867e1e85de7073a11acce7de5a82 /libavformat/os_support.c
parent9bb328d39764deafd9ed2f07187b106ff86d696a (diff)
downloadffmpeg-54eb77c05e6a03815316908a64fa31b8c5353929.tar.gz
Move BeOS-specific code into os_support.c.
Originally committed as revision 7071 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/os_support.c')
-rw-r--r--libavformat/os_support.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/libavformat/os_support.c b/libavformat/os_support.c
index 079a8a9fc1..fc043c1411 100644
--- a/libavformat/os_support.c
+++ b/libavformat/os_support.c
@@ -1,6 +1,7 @@
/*
* Various utilities for ffmpeg system
* Copyright (c) 2000, 2001, 2002 Fabrice Bellard
+ * copyright (c) 2002 Francois Revol
*
* This file is part of FFmpeg.
*
@@ -35,6 +36,10 @@
#endif
#include <time.h>
+#include <stdlib.h>
+#include <strings.h>
+#include "barpainet.h"
+
/**
* gets the current time in micro seconds.
*/
@@ -65,3 +70,27 @@ struct tm *localtime_r(const time_t *t, struct tm *tp)
return tp;
}
#endif /* !defined(CONFIG_WINCE) && !defined(HAVE_LOCALTIME_R) */
+
+#if !defined(HAVE_INET_ATON)
+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;
+}
+#endif /* !defined HAVE_INET_ATON */