Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

vendors.h File Reference


Detailed Description

Vendor code management.

Author:
Richard Eckart
Date:
2001-2003

#include <glib.h>

Go to the source code of this file.

Data Structures

union  vendor_code

Defines

#define MAKE_CODE(a, b, c, d)
#define T_ACQL   MAKE_CODE('A','C','Q','L')
#define T_ACQX   MAKE_CODE('A','C','Q','X')
#define T_AGNT   MAKE_CODE('A','G','N','T')
#define T_ARES   MAKE_CODE('A','R','E','S')
#define T_ATOM   MAKE_CODE('A','T','O','M')
#define T_AZOO   MAKE_CODE('A','Z','O','O')
#define T_BARE   MAKE_CODE('B','A','R','E')
#define T_BEAR   MAKE_CODE('B','E','A','R')
#define T_BGNU   MAKE_CODE('B','G','N','U')
#define T_COCO   MAKE_CODE('C','O','C','O')
#define T_CULT   MAKE_CODE('C','U','L','T')
#define T_DRIP   MAKE_CODE('D','R','I','P')
#define T_EVIL   MAKE_CODE('E','V','I','L')
#define T_FEVR   MAKE_CODE('F','E','V','R')
#define T_FIRE   MAKE_CODE('F','I','R','E')
#define T_FISH   MAKE_CODE('F','I','S','H')
#define T_FZZN   MAKE_CODE('F','Z','Z','N')
#define T_GDNA   MAKE_CODE('G','D','N','A')
#define T_GIFT   MAKE_CODE('G','I','F','T')
#define T_GNEW   MAKE_CODE('G','N','E','W')
#define T_GNOT   MAKE_CODE('G','N','O','T')
#define T_GNTD   MAKE_CODE('G','N','T','D')
#define T_GNTG   MAKE_CODE('G','N','T','G')
#define T_GNUC   MAKE_CODE('G','N','U','C')
#define T_GNUM   MAKE_CODE('G','N','U','M')
#define T_GNUT   MAKE_CODE('G','N','U','T')
#define T_GTKG   MAKE_CODE('G','T','K','G')
#define T_HSLG   MAKE_CODE('H','S','L','G')
#define T_HUIT   MAKE_CODE('H','U','I','T')
#define T_JHOP   MAKE_CODE('J','H','O','P')
#define T_JOEY   MAKE_CODE('J','O','E','Y')
#define T_KIKI   MAKE_CODE('K','I','K','I')
#define T_KISS   MAKE_CODE('K','I','S','S')
#define T_LIME   MAKE_CODE('L','I','M','E')
#define T_LION   MAKE_CODE('L','I','O','N')
#define T_MACT   MAKE_CODE('M','A','C','T')
#define T_MESH   MAKE_CODE('M','E','S','H')
#define T_MIRT   MAKE_CODE('M','I','R','T')
#define T_MLDK   MAKE_CODE('M','L','D','K')
#define T_MMMM   MAKE_CODE('M','M','M','M')
#define T_MNAP   MAKE_CODE('M','N','A','P')
#define T_MRPH   MAKE_CODE('M','R','P','H')
#define T_MUTE   MAKE_CODE('M','U','T','E')
#define T_NAPS   MAKE_CODE('N','A','P','S')
#define T_NGET   MAKE_CODE('N','G','E','T')
#define T_NOOG   MAKE_CODE('N','O','O','G')
#define T_NOVA   MAKE_CODE('N','O','V','A')
#define T_OCFG   MAKE_CODE('O','C','F','G')
#define T_OPRA   MAKE_CODE('O','P','R','A')
#define T_OXID   MAKE_CODE('O','X','I','D')
#define T_PCST   MAKE_CODE('P','C','S','T')
#define T_PHEX   MAKE_CODE('P','H','E','X')
#define T_PWRT   MAKE_CODE('P','W','R','T')
#define T_QTEL   MAKE_CODE('Q','T','E','L')
#define T_RASP   MAKE_CODE('R','A','S','P')
#define T_RAZA   MAKE_CODE('R','A','Z','A')
#define T_SHNB   MAKE_CODE('S','H','N','B')
#define T_SNOW   MAKE_CODE('S','N','O','W')
#define T_SNUT   MAKE_CODE('S','N','U','T')
#define T_STRM   MAKE_CODE('S','T','R','M')
#define T_SWAP   MAKE_CODE('S','W','A','P')
#define T_SWFT   MAKE_CODE('S','W','F','T')
#define T_TFLS   MAKE_CODE('T','F','L','S')
#define T_TOAD   MAKE_CODE('T','O','A','D')
#define T_VPUT   MAKE_CODE('V','P','U','T')
#define T_WAST   MAKE_CODE('W','A','S','T')
#define T_XOLO   MAKE_CODE('X','O','L','O')
#define T_XTLA   MAKE_CODE('X','T','L','A')
#define T_YAFS   MAKE_CODE('Y','A','F','S')
#define T_ZIGA   MAKE_CODE('Z','I','G','A')
#define T_peer   MAKE_CODE('p','e','e','r')
#define T_0000   0x00000000
#define VENDOR_CODE_CMP(a, b)   CMP(a, b)
 Compare two codes, alphanumerically (id est "ACQX" < "GTKG").


Functions

const gchar * vendor_code_str (guint32 code)
 Make up a printable version of the vendor code.

const gchar * lookup_vendor_name (union vendor_code code)
 Return the "human readable" name associated with the 4-byte vendor code.

gboolean is_vendor_known (union vendor_code code)
void vendor_init (void)
 Initialize the vendor lookup.


Define Documentation

#define MAKE_CODE a,
b,
c,
 ) 
 

Value:

( \
    ((guint32) (a) << 24) | \
    ((guint32) (b) << 16) | \
    ((guint32) (c) << 8)  | \
    ((guint32) (d)))

#define T_0000   0x00000000
 

#define T_ACQL   MAKE_CODE('A','C','Q','L')
 

#define T_ACQX   MAKE_CODE('A','C','Q','X')
 

#define T_AGNT   MAKE_CODE('A','G','N','T')
 

#define T_ARES   MAKE_CODE('A','R','E','S')
 

#define T_ATOM   MAKE_CODE('A','T','O','M')
 

#define T_AZOO   MAKE_CODE('A','Z','O','O')
 

#define T_BARE   MAKE_CODE('B','A','R','E')
 

#define T_BEAR   MAKE_CODE('B','E','A','R')
 

#define T_BGNU   MAKE_CODE('B','G','N','U')
 

#define T_COCO   MAKE_CODE('C','O','C','O')
 

#define T_CULT   MAKE_CODE('C','U','L','T')
 

#define T_DRIP   MAKE_CODE('D','R','I','P')
 

#define T_EVIL   MAKE_CODE('E','V','I','L')
 

#define T_FEVR   MAKE_CODE('F','E','V','R')
 

#define T_FIRE   MAKE_CODE('F','I','R','E')
 

#define T_FISH   MAKE_CODE('F','I','S','H')
 

#define T_FZZN   MAKE_CODE('F','Z','Z','N')
 

#define T_GDNA   MAKE_CODE('G','D','N','A')
 

#define T_GIFT   MAKE_CODE('G','I','F','T')
 

#define T_GNEW   MAKE_CODE('G','N','E','W')
 

#define T_GNOT   MAKE_CODE('G','N','O','T')
 

#define T_GNTD   MAKE_CODE('G','N','T','D')
 

#define T_GNTG   MAKE_CODE('G','N','T','G')
 

#define T_GNUC   MAKE_CODE('G','N','U','C')
 

#define T_GNUM   MAKE_CODE('G','N','U','M')
 

#define T_GNUT   MAKE_CODE('G','N','U','T')
 

#define T_GTKG   MAKE_CODE('G','T','K','G')
 

#define T_HSLG   MAKE_CODE('H','S','L','G')
 

#define T_HUIT   MAKE_CODE('H','U','I','T')
 

#define T_JHOP   MAKE_CODE('J','H','O','P')
 

#define T_JOEY   MAKE_CODE('J','O','E','Y')
 

#define T_KIKI   MAKE_CODE('K','I','K','I')
 

#define T_KISS   MAKE_CODE('K','I','S','S')
 

#define T_LIME   MAKE_CODE('L','I','M','E')
 

#define T_LION   MAKE_CODE('L','I','O','N')
 

#define T_MACT   MAKE_CODE('M','A','C','T')
 

#define T_MESH   MAKE_CODE('M','E','S','H')
 

#define T_MIRT   MAKE_CODE('M','I','R','T')
 

#define T_MLDK   MAKE_CODE('M','L','D','K')
 

#define T_MMMM   MAKE_CODE('M','M','M','M')
 

#define T_MNAP   MAKE_CODE('M','N','A','P')
 

#define T_MRPH   MAKE_CODE('M','R','P','H')
 

#define T_MUTE   MAKE_CODE('M','U','T','E')
 

#define T_NAPS   MAKE_CODE('N','A','P','S')
 

#define T_NGET   MAKE_CODE('N','G','E','T')
 

#define T_NOOG   MAKE_CODE('N','O','O','G')
 

#define T_NOVA   MAKE_CODE('N','O','V','A')
 

#define T_OCFG   MAKE_CODE('O','C','F','G')
 

#define T_OPRA   MAKE_CODE('O','P','R','A')
 

#define T_OXID   MAKE_CODE('O','X','I','D')
 

#define T_PCST   MAKE_CODE('P','C','S','T')
 

#define T_peer   MAKE_CODE('p','e','e','r')
 

#define T_PHEX   MAKE_CODE('P','H','E','X')
 

#define T_PWRT   MAKE_CODE('P','W','R','T')
 

#define T_QTEL   MAKE_CODE('Q','T','E','L')
 

#define T_RASP   MAKE_CODE('R','A','S','P')
 

#define T_RAZA   MAKE_CODE('R','A','Z','A')
 

#define T_SHNB   MAKE_CODE('S','H','N','B')
 

#define T_SNOW   MAKE_CODE('S','N','O','W')
 

#define T_SNUT   MAKE_CODE('S','N','U','T')
 

#define T_STRM   MAKE_CODE('S','T','R','M')
 

#define T_SWAP   MAKE_CODE('S','W','A','P')
 

#define T_SWFT   MAKE_CODE('S','W','F','T')
 

#define T_TFLS   MAKE_CODE('T','F','L','S')
 

#define T_TOAD   MAKE_CODE('T','O','A','D')
 

#define T_VPUT   MAKE_CODE('V','P','U','T')
 

#define T_WAST   MAKE_CODE('W','A','S','T')
 

#define T_XOLO   MAKE_CODE('X','O','L','O')
 

#define T_XTLA   MAKE_CODE('X','T','L','A')
 

#define T_YAFS   MAKE_CODE('Y','A','F','S')
 

#define T_ZIGA   MAKE_CODE('Z','I','G','A')
 

#define VENDOR_CODE_CMP a,
 )     CMP(a, b)
 

Compare two codes, alphanumerically (id est "ACQX" < "GTKG").

Returns -1/0/+1 depending on comparison's sign. Note that this comparison is case-sensitive.


Function Documentation

gboolean is_vendor_known union vendor_code  code  ) 
 

Returns:
true is gtk-gnutella knows the given 4-byte vendor code.

const gchar* lookup_vendor_name union vendor_code  code  ) 
 

Return the "human readable" name associated with the 4-byte vendor code.

If we can't understand the code return NULL or if the 4-byte code consists only of printable characters, return the code as a string.

const gchar* vendor_code_str guint32  code  ) 
 

Make up a printable version of the vendor code.

Parameters:
code A 4-letter Gnutella vendor ID in host-endian order thus after peek_be32() or ntohl().
Returns:
pointer to static data.

void vendor_init void   ) 
 

Initialize the vendor lookup.


Generated on Sun Feb 12 10:50:10 2006 for Gtk-Gnutella by doxygen 1.3.6