Main Page | Modules | Alphabetical List | Data Structures | Directories | 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 "atoms.h"
#include "iso3166.h"
#include "misc.h"
#include "override.h"

Data Structures

struct  iso3166_entry_t

Defines

#define NUM_CODES   (36 * 35 + 35)

Functions

const gchar * iso3166_decode_cc (guint16 code)
 Decodes a valid 2-letter country code into an integer.
guint16 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 iso3166_entry_tiso3166_country_entry (guint16 code)
const gchar * iso3166_country_name (guint16 code)
 Maps a valid encoded country code to the country name.
const gchar * iso3166_country_cc (guint16 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_t iso3166_entries [G_N_ELEMENTS(iso3166_tab)]
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 guint16  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 iso3166_entry_t* iso3166_country_entry guint16  code  )  [inline, static]
 

const gchar* iso3166_country_name guint16  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 guint16  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.

guint16 iso3166_encode_cc const gchar *  cc  ) 
 

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

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

void iso3166_init void   ) 
 


Variable Documentation

const char cc[3]
 

const char* country
 

iso3166_entry_t* iso3166_countries[NUM_CODES] [static]
 

iso3166_entry_t iso3166_entries[G_N_ELEMENTS(iso3166_tab)] [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 Sat Jun 30 17:53:28 2007 for gtk-gnutella by  doxygen 1.3.9.1