Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/src/runtime/c-libs/smlnj-sockets/getaddrfamily.c
ViewVC logotype

Annotation of /sml/trunk/src/runtime/c-libs/smlnj-sockets/getaddrfamily.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 727 - (view) (download) (as text)

1 : monnier 249 /* getaddrfamily.c
2 :     *
3 :     * COPYRIGHT (c) 1995 AT&T Bell Laboratories.
4 :     */
5 :    
6 :     #include "ml-unixdep.h"
7 :     #include "sockets-osdep.h"
8 :     #include INCLUDE_TYPES_H
9 :     #include INCLUDE_SOCKET_H
10 :     #include INCLUDE_IN_H /* for htons */
11 :     #include "ml-base.h"
12 :     #include "ml-values.h"
13 :     #include "ml-objects.h"
14 :     #include "ml-c.h"
15 :     #include "cfun-proto-list.h"
16 :     #include "sock-util.h"
17 :    
18 :     /* _ml_Sock_getaddrfamily : addr -> af
19 :     *
20 :     * Extract the family field, convert to host byteorder, and return it.
21 :     */
22 :     ml_val_t _ml_Sock_getaddrfamily (ml_state_t *msp, ml_val_t arg)
23 :     {
24 : jhr 727 struct sockaddr *addr = GET_SEQ_DATAPTR(struct sockaddr, arg);
25 : monnier 249
26 :     return ML_SysConst (msp, &_Sock_AddrFamily, ntohs(addr->sa_family));
27 :    
28 :     } /* end of _ml_Sock_getaddrfamily */

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0