ia5.c
author viric@llimona
Tue, 28 Aug 2007 01:03:24 +0200
changeset 11 68ea18fe402c
parent 8 09ec33061ff3
permissions -rw-r--r--
Adding code for the zprocess, for processing the Zaliznjak dictionary.

#include <stdio.h>
#include <stdlib.h>
#include "dictre.h"

int main(int argn, char **argv)
{
    int val;
    char *input;
    char *end;
    char type;

    if (argn != 3 || (argv[1][1] != 'w' && argv[1][1] != 'n') )
    {
        printf("usage: %s <-w word | -n num>\n", argv[0]);
        return 0;
    }

    type = argv[1][1];
    input = argv[2];
    if(type == 'n')
    {
        /* Whole string number */
        char tmp[20];

        val = strtol(input, &end, 10);
        num_to_ia5(tmp, val);
        printf("%s\n", tmp);
    } else
    {
        val = str2int(input);
        printf("%i\n", val);
    }
    return 0;
}