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

iso3166.c File Reference


Detailed Description

Support for mapping ISO 3166 2-letter codes and country names.

Author:
Christian Biere
Date:
2004

#include "common.h"
#include "iso3166.h"
#include "misc.h"
#include "override.h"

Data Structures

struct  iso3166_entry_t

Defines

#define NUM_CODES   (36 * 35 + 35)

Functions

 RCSID ("$Id:iso3166.c, v 1.12 2005/06/29 14:24:26 daichik Exp $")
const gchar * iso3166_decode_cc (gint code)
 Decodes a valid 2-letter country code into an integer.

gint iso3166_encode_cc (const gchar *cc)
 Encodes a valid 2-letter country code into an integer.

void iso3166_init (void)
void iso3166_close (void)
const gchar * iso3166_country_name (gint code)
 Maps a valid encoded country code to the country name.

const gchar * iso3166_country_cc (gint code)
 Maps a valid encoded country code to the 2-letter code.


Variables

struct {
   const char   cc [3]
   const char *   country
iso3166_tab []
 Suggestion for translators: Translate only the name the of country in which the language is spoken - if the native name is different.

iso3166_entry_tiso3166_countries [NUM_CODES]


Define Documentation

#define NUM_CODES   (36 * 35 + 35)
 


Function Documentation

void iso3166_close void   ) 
 

const gchar* iso3166_country_cc gint  code  ) 
 

Maps a valid encoded country code to the 2-letter code.

Returns:
NULL integer isn't a validly encoded country code. If the country is valid, a string pointing two the 2-letter code is returned. Each string has its own buffer which is only free()d by iso3166_close().

const gchar* iso3166_country_name gint  code  ) 
 

Maps a valid encoded country code to the country name.

Returns:
NULL integer isn't a validly encoded country code. If the country is valid, a string pointing two the country name is returned. Each string has its own buffer which is only free()d by iso3166_close().

const gchar* iso3166_decode_cc gint  code  )  [static]
 

Decodes a valid 2-letter country code into an integer.

Returns:
NULL integer isn't a validly encoded country code. If the country is valid, a string pointing two the 2-letter code is returned. The string is in a static buffer.

gint iso3166_encode_cc const gchar *  cc  ) 
 

Encodes a valid 2-letter country code into an integer.

Returns:
-1 if the given string is obviously not a 2-letter country code.

void iso3166_init void   ) 
 

RCSID "$Id:iso3166.  c,
v 1.12 2005/06/29 14:24:26 daichik Exp $" 
 


Variable Documentation

const char cc[3]
 

const char* country
 

iso3166_entry_t* iso3166_countries[NUM_CODES] [static]
 

const { ... } iso3166_tab[] [static]
 

Suggestion for translators: Translate only the name the of country in which the language is spoken - if the native name is different.


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