Ported basic GTIN functions to C