currencygithub.com/castedo/isomon

Name

isomon::data::add_currency — Add a currency to the data tables.

Synopsis

// In header: </home/castedo/src/isomon/currency_data.h>


bool add_currency(int16_t isonum, const char * code);

Description

Not thread-safe. Typically this would only be called during program initialization. ISO numeric and alphabetic codes can not be re-used if already in use. Number of minor units per major unit default to zero. Use set_num_minors function to change this value for a newly added currency.

Parameters:

code

An ISO alphabetic code that is 3 Latin letters.

isonum

An ISO numeric code, real or fake, in the range [0, ISOMON_ISONUM_COUNT). ISOMON_ISONUM_COUNT is probably 1024.

Returns:

False iff any inputs are invalid or ISOMON_ISONUM_COUNT currencies have already filled up the tables.