#ifndef H_ED_HTON_20030425131423
#define H_ED_HTON_20030425131423

#ifdef __cplusplus
extern "C"
{
#endif

/* ---------------------------------------------------------------------
   (c) ED 2003-2006
   Project      : CLIB
   Function     : Host to Network portable conversions
   Module       : HTON
   File         : HTON.C
   Created      : 25-04-2003
   Modified     : 29-11-2006
   --------------------------------------------------------------------- */

/* ---------------------------------------------------------------------
   Log

   1.1 29-11-2006 network functions added nread*(), nwrite*().
   .              *to*() becomes *to*s().
   1.0 25-04-2003 Intial version
   0.0 25-04-2003 Creation

   --------------------------------------------------------------------- */
#include "ed/inc/types.h"

/* compatibiblity macros */
#ifndef HTON_NO_COMPATIBILITY
#define hton(a) htons(a)
#define ntoh(a) ntohs(a)
#endif
/* Host to Network */
   uint htons (uint const data_h);
   ulong htonl (ulong const data_h);

/* Network to Host  */
   uint ntohs (uint const data_n);
   ulong ntohl (ulong const data_n);

   /* read or write bytes from/to network */
   uint nreads (uchar const a[2]);
   void nwrites (uchar a[2], uint data);

   ulong nreadl (uchar const a[4]);
   void nwritel (uchar a[4], ulong data);

#ifdef __cplusplus
}
#endif

#endif                          /* H_ED_HTON_20030425131423 */

/* Guards added by GUARD (c) ED 2000-2003 Feb 14 2003 Ver. 1.5 */
