VirtualBox

source: vbox/trunk/src/libs/ffmpeg-20060710/libavformat/barpainet.c@ 7692

Last change on this file since 7692 was 5776, checked in by vboxsync, 17 years ago

ffmpeg: exported to OSE

File size: 644 bytes
Line 
1
2#include <stdlib.h>
3#include <strings.h>
4#include "barpainet.h"
5
6int inet_aton (const char * str, struct in_addr * add) {
7 const char * pch = str;
8 unsigned int add1 = 0, add2 = 0, add3 = 0, add4 = 0;
9
10 add1 = atoi(pch);
11 pch = strpbrk(pch,".");
12 if (pch == 0 || ++pch == 0) goto done;
13 add2 = atoi(pch);
14 pch = strpbrk(pch,".");
15 if (pch == 0 || ++pch == 0) goto done;
16 add3 = atoi(pch);
17 pch = strpbrk(pch,".");
18 if (pch == 0 || ++pch == 0) goto done;
19 add4 = atoi(pch);
20
21done:
22 add->s_addr=(add4<<24)+(add3<<16)+(add2<<8)+add1;
23
24 return 1;
25}
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette