1995-08-09 08:06:35 -07:00
|
|
|
/***********************************************************************/
|
|
|
|
/* */
|
1996-04-30 07:53:58 -07:00
|
|
|
/* Objective Caml */
|
1995-08-09 08:06:35 -07:00
|
|
|
/* */
|
|
|
|
/* Xavier Leroy, projet Cristal, INRIA Rocquencourt */
|
|
|
|
/* */
|
1996-04-30 07:53:58 -07:00
|
|
|
/* Copyright 1996 Institut National de Recherche en Informatique et */
|
1995-08-09 08:06:35 -07:00
|
|
|
/* Automatique. Distributed only by permission. */
|
|
|
|
/* */
|
|
|
|
/***********************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
1995-05-08 08:18:32 -07:00
|
|
|
#include <mlvalues.h>
|
|
|
|
#include <fail.h>
|
1996-09-04 07:15:31 -07:00
|
|
|
#include "unixsupport.h"
|
1995-05-08 08:18:32 -07:00
|
|
|
|
|
|
|
#ifdef HAS_SOCKETS
|
|
|
|
|
|
|
|
#include "socketaddr.h"
|
|
|
|
|
|
|
|
value unix_inet_addr_of_string(s) /* ML */
|
|
|
|
value s;
|
|
|
|
{
|
1996-11-25 05:31:19 -08:00
|
|
|
unsigned int address;
|
1995-05-08 08:18:32 -07:00
|
|
|
address = inet_addr(String_val(s));
|
1996-11-25 05:31:19 -08:00
|
|
|
if (address == (unsigned int) -1) failwith("inet_addr_of_string");
|
1995-05-08 08:18:32 -07:00
|
|
|
return alloc_inet_addr(address);
|
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
value unix_inet_addr_of_string()
|
|
|
|
{ invalid_argument("inet_addr_of_string not implemented"); }
|
|
|
|
|
|
|
|
#endif
|