anchor.diff:    {$I tox-uses.inc}
     {$IFDEF FPC}dynlibs,{$ENDIF}
     {$IFDEF UNIX}dl,{$ENDIF}
  -  SysUtils;
  +  SysUtils, Winsock2;
   
   type
   	TTox = Pointer;
   
  +  PToxIP4 = PInAddr;
  +  TToxIP4 = TInAddr;
  +
  +  pin6_addr = ^in6_addr;
  +  in6_addr = packed record
  +  case byte of
  +    0: (u6_addr8  : array[0..15] of byte);
  +    1: (u6_addr16 : array[0..7] of Word);
  +    2: (u6_addr32 : array[0..3] of Cardinal);
  +    3: (s6_addr8  : array[0..15] of shortint);
  +    4: (s6_addr   : array[0..15] of shortint);
  +    5: (s6_addr16 : array[0..7] of smallint);
  +    6: (s6_addr32 : array[0..3] of LongInt);
  +  end;
  +  TIn6Addr = in6_addr;
  +  PIn6Addr = pin6_addr;
  +
   //typedef union {
  -//    uint8_t c[4];
  -//    uint16_t s[2];
  -//    uint32_t i;
  -//} tox_IP;
  -  PToxIp = ^TToxIp;
  -  TToxIp = record
  -//    c: Integer;
  -//    s: Integer;
  -    i: Integer;
  +//    uint8_t uint8[16];
  +//    uint16_t uint16[8];
  +//    uint32_t uint32[4];
  +//    struct in6_addr in6_addr;
  +//} tox_IP6;
  +
  +  TToxIP6 = record
  +    case Byte of
  +      0: (uint8: array[0..15] of Byte);
  +      1: (uint16: array[0..7] of Word);
  +      2: (uint32: array[0..3] of Cardinal);
  +      3: (in6_addr: PIn6Addr);
  +  end;
  +
  +//typedef struct {
  +//    sa_family_t family;
  +//    union {
  +//        tox_IP4 ip4;
  +//        tox_IP6 ip6;
  +//    };
  +//} tox_IPAny;
  +  TToxIPAny = record
  +    family: ShortInt;
  +    case Byte of
  +      0: (ip4: TToxIP4);
  +      1: (ip6: TToxIP6);
  +  end;
  +
  +//typedef union {
  +//    struct {
  +//        tox_IP4  ip;
  +//        uint16_t port;
  +//        /* Not used for anything right now. */
  +//        uint16_t padding;
  +//    };
  +//    uint8_t uint8[8];
  +//} tox_IP4_Port;
  +
  +
  +  TIp4PortData = record
  +    ip: TToxIP4;
  +    port: Word;
  +    padding: Word;
  +  end;
  +
  +  TToxIP4Port = record
  +    case Byte of
  +      0: (data: TIp4PortData);
  +//      1: (uint8: )
     end;
   
   //typedef struct {
  
positive.code: // *  return -1 if failure.
  // */
  //int tox_setname(Tox *tox, uint8_t *name, uint16_t length);
  function tox_setname(tox: TTox; name: PByte; length: Word): Integer;
  
  ///*
  // * Get your nickname.
  
negative.code: // *  returns -1 on failure.
  // */
  //int tox_set_statusmessage(Tox *tox, uint8_t *status, uint16_t length);
  //int tox_set_userstatus(Tox *tox, TOX_USERSTATUS status);
  function tox_set_statusmessage(tox: TTox; status: PByte; length: Word): Integer; cdecl; external TOX_LIBRARY;
  function tox_set_userstatus(tox: TTox; status: TToxUserStatus): Integer; cdecl; external TOX_LIBRARY;
  
  ///*  return the length of friendnumber's status message, including null.
  // *  Pass it into malloc
  // */
  //int tox_get_statusmessage_size(Tox *tox, int friendnumber);
  function tox_get_statusmessage_size(tox: TTox; friendnumber: Integer): Integer; cdecl; external TOX_LIBRARY;
  
  ///* Copy friendnumber's status message into buf, truncating if size is over maxlen.
  // * Get the size you need to allocate from m_get_statusmessage_size.
  // * The self variant will copy our own status message.
  // *
  // * returns the length of the copied data on success
  // * retruns -1 on failure.
  // */
  //int tox_copy_statusmessage(Tox *tox, int friendnumber, uint8_t *buf, uint32_t maxlen);
  //int tox_copy_self_statusmessage(Tox *tox, uint8_t *buf, uint32_t maxlen);
  function tox_copy_statusmessage(tox: TTox; friendnumber: Integer; buf: PByte; maxlen: Integer): Integer; cdecl; external TOX_LIBRARY;
  function tox_copy_self_statusmessage(tox: TTox; buf: PByte; maxlen: Integer): Integer; cdecl; external TOX_LIBRARY;
  
  ///*  return one of USERSTATUS values.
  // *  Values unknown to your application should be represented as USERSTATUS_NONE.
  