Beispiel #1
0
/* _lib7_NetDB_getnetbyname : String -> (String * String list * addr_family * sysword) option
 */
lib7_val_t _lib7_NetDB_getnetbyname (lib7_state_t *lib7_state, lib7_val_t arg)
{
#if defined(OPSYS_WIN32)
  /* FIXME:  getnetbyname() does not seem to exist under Windows.  What is
     the equivalent? */
  return RAISE_ERROR(lib7_state, "<getnetbyname not implemented>");
#else
    return _util_NetDB_mknetent (lib7_state, getnetbyname (STR_LIB7toC(arg)));
#endif
} /* end of _lib7_NetDB_getnetbyname */
Val   _lib7_netdb_get_network_by_address   (Task* task,  Val arg)   {
    //==================================
    //
    // Mythryl type:   (Sysword, Address_Family) -> Null_Or(  (String, List(String), Address_Family, Sysword)  )
    //
    // This fn gets bound as   get_network_by_address'   in:
    //
    //     src/lib/std/src/socket/net-db.pkg

    #if defined(OPSYS_WIN32)
        // XXX BUGGO FIXME:  getnetbyaddr() does not seem to exist under Windows.	  What is the equivalent?
        return RAISE_ERROR(task, "<getnetbyaddr not implemented>");
    #else
	unsigned long   net  =  TUPLE_GETWORD(arg, 0);
	int		type =  GET_TUPLE_SLOT_AS_INT( arg, 1);
	//
	return _util_NetDB_mknetent (task, getnetbyaddr(net, type));
    #endif
}