X-Git-Url: https://www.flypig.org.uk/git/?a=blobdiff_plain;f=include%2Fcontrac%2Futils.h;h=0f40c8c8c0b6d7fd3d6933517375d9f912c8cfe1;hb=e48c390a86b448137a87d0d0a5863c202ba66abd;hp=38b0c3f4bd041a7c6175533e3f8743080e4187cd;hpb=8515bbba069347de07a452586d7e49a2e8bdf151;p=libcontrac.git diff --git a/include/contrac/utils.h b/include/contrac/utils.h index 38b0c3f..0f40c8c 100644 --- a/include/contrac/utils.h +++ b/include/contrac/utils.h @@ -1,25 +1,34 @@ -/** \ingroup contrac +/** \ingroup Utils * @file - * @author David Llewellyn-Jones + * @author David Llewellyn-Jones * @version $(VERSION) * * @section LICENSE * + * Copyright David Llewellyn-Jones, 2020 + * Released under the GPLv2. * - * - * @brief + * @brief Static utility functions * @section DESCRIPTION * + * Provides various static utitlity functions. In particular: * + * base64 encoding and decoding functionality. + * Time conversion: from epoch to day numbers and time interval numbers. * */ +/** \addtogroup Utils + * @{ + */ #ifndef __UTILS_H #define __UTILS_H // Includes +#include + // Defines #define MAX(a,b) \ @@ -41,11 +50,12 @@ size_t base64_decode_size(size_t base64_input); void base64_encode_binary_to_base64(unsigned char const *input, size_t input_size, unsigned char *output, size_t *output_size); void base64_decode_base64_to_binary(unsigned char const *input, size_t input_size, unsigned char *output, size_t *output_size); +uint32_t epoch_to_day_number(time_t epoch); +uint8_t epoch_to_time_interval_number(time_t epoch); + // Function definitions #endif // __UTILS_H - - - +/** @} addtogroup Utils */