annotate barpainet.c @ 73:d40ddc73858a libavformat

reversing not yet reversed changes from r1.7 -> r1.8 except the static/const stuff this seems to fix all avi parsing bugs kabi, can u explain what this was good for?
author michaelni
date Sat, 08 Mar 2003 00:44:52 +0000
parents 05318cf2e886
children da1d5db0ce5c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
1
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
2 #include <stdlib.h>
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
3 #include <strings.h>
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
4 #include "barpainet.h"
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
5
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
6 int inet_aton (const char * str, struct in_addr * add) {
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
7 const char * pch = str;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
8 unsigned int add1 = 0, add2 = 0, add3 = 0, add4 = 0;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
9
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
10 add1 = atoi(pch);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
11 pch = strpbrk(pch,".");
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
12 if (pch == 0 || ++pch == 0) goto done;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
13 add2 = atoi(pch);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
14 pch = strpbrk(pch,".");
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
15 if (pch == 0 || ++pch == 0) goto done;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
16 add3 = atoi(pch);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
17 pch = strpbrk(pch,".");
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
18 if (pch == 0 || ++pch == 0) goto done;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
19 add4 = atoi(pch);
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
20
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
21 done:
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
22 add->s_addr=(add4<<24)+(add3<<16)+(add2<<8)+add1;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
23
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
24 return 1;
05318cf2e886 renamed libav to libavformat
bellard
parents:
diff changeset
25 }