src/p_net_ifc_lnx.c
static void
p_net_ifs_makeAddress( lua_State *L, struct sockaddr* iadr, const char * adr_name )
{
	struct sockaddr_storage   *adr;

	if (iadr)
	{
		adr = t_net_adr_create_ud( L );
		memcpy( adr, iadr, (AF_INET6 == iadr->sa_family)
				? sizeof( struct sockaddr_in6 )
				: sizeof( struct sockaddr_in ) );
		lua_setfield( L, -2, adr_name );
	}
}
/**--------------------------------------------------------------------------
 * Parse interface address into a t.Net.Address (sockaddr_storage).
 * take a sockaddr and turn it into a Lua controlled sockaddr_storage
 * this way it can be returned as a t.Net.Address instance
 * \param   L        Lua state.
 * \param   addr     struct sockaddr instance.
 * \param   adr_name Name/Function of address.
 * \lreturn void     Push value to table
 * \return  void
 * --------------------------------------------------------------------------*/
Parse interface address into a t.Net.Address (sockaddr_storage).
take a sockaddr and turn it into a Lua controlled sockaddr_storage
this way it can be returned as a t.Net.Address instance
\param   L        Lua state.
\param   addr     struct sockaddr instance.
\param   adr_name Name/Function of address.
\lreturn void     Push value to table
\return  void
Parse interface address into a t . Net . Address ( sockaddr_storage ) . take a sockaddr and turn it into a Lua controlled sockaddr_storage this way it can be returned as a t . Net . Address instance \ param L Lua state . \ param addr struct sockaddr instance . \ param adr_name Name / Function of address . \ lreturn void Push value to table \ return void
static void
p_net_ifs_makeAddress( lua_State *L, struct sockaddr* iadr, const char * adr_name )
{
	struct sockaddr_storage   *adr;
	if (iadr)
	{
		adr = t_net_adr_create_ud( L );
		memcpy( adr, iadr, (AF_INET6 == iadr->sa_family)
				? sizeof( struct sockaddr_in6 )
				: sizeof( struct sockaddr_in ) );
		lua_setfield( L, -2, adr_name );
	}
}
static void p_net_ifs_makeAddress ( lua_State * L , struct sockaddr * iadr , const char * adr_name ) { struct sockaddr_storage * adr ; if ( iadr ) { adr = t_net_adr_create_ud ( L ) ; memcpy ( adr , iadr , ( AF_INET6 == iadr -> sa_family ) ? sizeof ( struct sockaddr_in6 ) : sizeof ( struct sockaddr_in ) ) ; lua_setfield ( L , -2 , adr_name ) ; } }
Parse interface address into a t.Net.Address (sockaddr_storage).
Parse interface address into a t . Net . Address ( sockaddr_storage ) .