diff options
m--------- | doc | 0 | ||||
-rw-r--r-- | numericx.c | 43 |
2 files changed, 22 insertions, 21 deletions
diff --git a/doc b/doc -Subproject 067ff23dc8b28c70d883e832dea29dbb9019615 +Subproject c68628b1e5600b62a35d884b52f5a21fd80a22a diff --git a/numericx.c b/numericx.c index d14fb4c..3518fcc 100644 --- a/numericx.c +++ b/numericx.c @@ -16,8 +16,8 @@ * @name Compilation Flags * * These are the valid compilation flags for the definition of numerical systems. - * Use them to make the program show more output, or - * to set the proprieties of the FROM and the TO numerical system. + * Use them to set the proprieties of the FROM and the TO numerical system, when + * compiling the cli executable. * * @{ */ @@ -117,7 +117,7 @@ typedef struct NumeralPtr * new numeral ('to_first'). * * @param last_numeral - last numeral_ptr* into which new numeral_ptr will be added. - * @param to_first - symbol of the new digit. + * @param to_first - the symbol of the new digit. * * @return pointer to new numeral_ptr in case of success. * @return NULL in case of no memory. @@ -208,8 +208,8 @@ increment(numeral_ptr* numeral, char* num_first, char* num_last, char* brand_new * * It needs to know the first numeral ('first_numeral') and also the * last numeral ('last_numeral'). It also needs the numeral system in - * form of a string ('numeral_system') to know which is the numeral - * before the actual numeral that needs decrementation. + * form of a string ('numeral_system') to know which is the numeral, + * before the actual numeral, that needs decrementation. * * @param number - the string number to be decremented. * @param first_numeral - number's numeral system first numeral. @@ -371,7 +371,7 @@ free_numeral(numeral_ptr* numeral) /** * @brief Free numericx result. * - * Function frees up the result of numericx_translate(), + * Free up the result string of numericx_translate(), * after we are done with it. * * @param string - char pointer to be free. @@ -390,7 +390,7 @@ numericx_free(char* string) * @param numeral - numeral_ptr to be converted to string. * @param result_with_units_on_the_end - define if result has units on the end. * - * @return char pointer to converted string in case of success. + * @return char pointer to converted string, in case of success. * @return NULL in case of no memory. */ char* @@ -440,19 +440,19 @@ numeral_to_string(numeral_ptr* numeral, bool result_with_units_on_the_end) * 'from' to the 'to' numerical system, resulting in a string. * * @param from - string with all the numerals of the number's numerical system. + * @param from_units_on_the_end - does the translate 'from' numerical system have units on the end (on the right)? + * @param from_first_number_void - does the translate 'from' numerical system start counting on the second number? + * @param from_infinite_base - is the translate 'from' numerical system first numeral infinite? For example, if first numeral is 'A', then does 'A' == 'AA' == 'AAA' == 'AAAA' ... ? * @param to - string with all the numerals of the resulting number's numerical system. - * @param from_units_on_the_end - does the translate from numerical system have units on the end (on the right)? - * @param to_units_on_the_end - does the translate to numerical system have units on the end (on the right)? - * @param from_first_number_void - does the translate from numerical system start counting on the second number? - * @param to_first_number_void - does the translate to numerical system start counting on the second number? - * @param from_infinite_base - is the translate from numerical system first numeral infinite? For example, if first numeral is 'A', then does 'A' == 'AA' == 'AAA' == 'AAAA' ... ? - * @param to_infinite_base - is the translate to numerical system first numeral infinite? For example, if first numeral is 'A', then does 'A' == 'AA' == 'AAA' == 'AAAA' ... ? - * @param number - number of the from numerical system, to be translated into the to numerical system. + * @param to_units_on_the_end - does the translate 'to' numerical system have units on the end (on the right)? + * @param to_first_number_void - does the translate 'to' numerical system start counting on the second number? + * @param to_infinite_base - is the translate 'to' numerical system first numeral infinite? For example, if first numeral is 'A', then does 'A' == 'AA' == 'AAA' == 'AAAA' ... ? + * @param number - number of the 'from' numerical system, to be translated into the 'to' numerical system. * @param result_string - string to where to store the result. * * @return EINVAL if argument of result_string is not NULL. - * @return EDOM if number doesn't belong to the from numerical system. - * @return ERANGE if the resulting number cannot be represented, because of a from void number and a lack of void number in to. + * @return EDOM if number doesn't belong to the 'from' numerical system. + * @return ERANGE if the resulting number cannot be represented, because of a 'from' void number and a lack of void number in 'to'. * @return EXIT_SUCCESS in case of success. */ int @@ -541,13 +541,14 @@ numericx_translate(char* from, bool from_units_on_the_end, bool from_first_numbe * @brief CLI program. * * This is a command-line interface program, that uses the 'numericx_*' - * functions. It receives on number and returns the translated number. + * functions. It receives one number argument from the command-line and + * prints the translated number, or an error message. * - * @param argv[] - one number as a string + * @param argv[] - one number from the command-line. * - * @return E2BIG in case of wrong number of arguments - * @return EXIT_FAILURE in case of unsuccessful number translation - * @return EXIT_SUCCESS in case of a successful number translation + * @return E2BIG in case of wrong number of arguments. + * @return EXIT_FAILURE in case of unsuccessful number translation. + * @return EXIT_SUCCESS in case of a successful number translation. */ int main(int argc, char* argv[]) |