Follow our own style guide.
[AROS.git] / arch / all-mingw32 / bsdsocket / inet_ntoa.c
blob5925087ff684ec9068ece8953814cb112b14bf94
1 /*
2 Copyright © 2000-2010, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: English
7 */
9 #include "bsdsocket_intern.h"
10 #include "netdb_util.h"
12 /*****************************************************************************
14 NAME */
16 AROS_LH1(char *, Inet_NtoA,
18 /* SYNOPSIS */
19 AROS_LHA(unsigned long, in, D0),
21 /* LOCATION */
22 struct TaskBase *, taskBase, 29, BSDSocket)
24 /* FUNCTION
26 INPUTS
28 RESULT
30 NOTES
32 EXAMPLE
34 BUGS
36 SEE ALSO
38 INTERNALS
40 HISTORY
42 *****************************************************************************/
44 AROS_LIBFUNC_INIT
46 struct bsdsocketBase *SocketBase = taskBase->glob;
47 char *res;
48 struct in_addr a;
50 D(bug("[bsdsocket] Inet_NToA(0x%08lX)\n", in));
51 a.s_addr = in;
53 Forbid();
55 res = WSinet_ntoa(a);
56 if (res)
57 res = CopyString(res, taskBase->pool);
59 Permit();
61 if (res)
63 if (taskBase->inaddr)
64 FreeVecPooled(taskBase->inaddr, taskBase->pool);
65 taskBase->inaddr = res;
68 Permit();
70 D(bug("[inet_ntoa] Result: %s\n", res));
71 return res;
73 AROS_LIBFUNC_EXIT
75 } /* Inet_NtoA */