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

vendors.c File Reference


Detailed Description

Vendor code management.

Author:
Richard Eckart
Date:
2001-2003

#include "common.h"
#include "vendors.h"
#include "endian.h"
#include "misc.h"
#include "override.h"

Data Structures

struct  vendor

Defines

#define GET_KEY(i)   (vendor_map[(i)].code)
#define FOUND(i)

Functions

 RCSID ("$Id:vendors.c, v 1.14 2005/11/13 10:36:12 cbiere Exp $")
gchar * find_vendor (guint32 code)
 Find vendor name, given vendor code.

gboolean is_vendor_known (union vendor_code code)
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.

void vendor_init (void)
 Initialize the vendor lookup.


Variables

vendor vendor_map []


Define Documentation

#define FOUND  ) 
 

Value:

G_STMT_START { \
    return vendor_map[(i)].name; \
    /* NOTREACHED */ \
} G_STMT_END

#define GET_KEY  )     (vendor_map[(i)].code)
 


Function Documentation

gchar* find_vendor guint32  code  )  [static]
 

Find vendor name, given vendor code.

Returns:
vendor string if found, NULL otherwise.

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.

RCSID "$Id:vendors.  c,
v 1.14 2005/11/13 10:36:12 cbiere Exp $" 
 

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.


Variable Documentation

struct vendor vendor_map[]
 


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