You may use `make libs` to create a static and a shared numericx library. To install a shared library into your system use `sudo make prefix=/usr install-lib`.
### Functions
See [Numericx documentation website](https://dacs-git.codeberg.page/numericx/), for the list of functions and function arguments of the Numericx library.
Look at `Files > File List` in the documentation menubar website.
There are basically two main functions: the `numericx_translate()` and the `numericx_free()`. Remember to free your numericx result with `numericx_free(var);`!
### Code example
Look at the `cli.c` file for an example of how to call Numericx in your C program.
Here is a code snippet:
```
(...)
/* 'result' variable has to be NULL */
char* result = NULL;
/*
* 'from', 'to' and 'number' are strings (malloced or literals, not arrays).
* the rest of the variables, except 'result', are booleans
fprintf(stderr, "error: numericx: Incapable of translating.\n");
numericx_free(result);
exit(EXIT_FAILURE);
}
/* Print translated number ('result') in case of success */
printf("%s\n", result);
/* Free translated number, when no longer needed */
numericx_free(result);
(...)
```
## CLI
### Compiling
With this program, you can create an executable (or many) that will convert a number from one numerical system into another one. This is good if, for example, you want to use numerical system translation with your bash terminal.
For example, you may want to convert a hexadecimal number into a ternary number. Here is what you would do.
For example, let's make the hexdecimal numerical system with numerals from `0-f`, with a infinite 0 and it start counting on 1. So, our hexadecimal system will need the following compilation flags:
|`FROM_UNITS_ON_THE_END`|Defines the units case to be on the end (on the right) for the 'from'|
|`FROM_FIRST_NUMBER_VOID`|Defines the first number as a "not counting" for the 'from'|
|`FROM_INFINITE_BASE`|Defines the first number to be infinite, for the 'from' (for example, if the first numeral is 0, then 0 == 00 == 000 == 0000 ... . Or if the first numeral is 1, then 1 == 11 == 111 ...)|