1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
|
/*
* The internal definitions
*
* Copyright (C) 2013-2017, Joachim Metz <joachim.metz@gmail.com>
*
* Refer to AUTHORS for acknowledgements.
*
* This software is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined( LIBCDATETIME_INTERNAL_DEFINITIONS_H )
#define LIBCDATETIME_INTERNAL_DEFINITIONS_H
#include <common.h>
#include <types.h>
/* Define HAVE_LOCAL_LIBCDATETIME for local use of libcdatetime
*/
#if !defined( HAVE_LOCAL_LIBCDATETIME )
#include <libcdatetime/definitions.h>
/* The definitions in <libcdatetime/definitions.h> are copied here
* for local use of libcdatetime
*/
#else
#define LIBCDATETIME_VERSION 20170609
/* The libcdatetime version string
*/
#define LIBCDATETIME_VERSION_STRING "20170609"
/* The string format definition flags
*/
enum LIBCDATETIME_STRING_FORMAT_FLAGS
{
/* Format the date time value in C time
*/
LIBCDATETIME_STRING_FORMAT_TYPE_CTIME = 0x00000001UL,
/* Format the date time value in ISO 8601
*/
LIBCDATETIME_STRING_FORMAT_TYPE_ISO8601 = 0x00000002UL,
/* Format the date time value as a date only
*/
LIBCDATETIME_STRING_FORMAT_FLAG_DATE = 0x00000100UL,
/* Format the date time value as a time only
*/
LIBCDATETIME_STRING_FORMAT_FLAG_TIME = 0x00000200UL,
/* Format the date time value as a duration
*/
LIBCDATETIME_STRING_FORMAT_FLAG_DURATION = 0x00000400UL,
/* Format the date time value with a time in milli seconds
*/
LIBCDATETIME_STRING_FORMAT_FLAG_TIME_MILLI_SECONDS = 0x00010000UL,
/* Format the date time value with a time in micro seconds
*/
LIBCDATETIME_STRING_FORMAT_FLAG_TIME_MICRO_SECONDS = 0x00020000UL,
/* Format the date time value with a time in nano seconds
*/
LIBCDATETIME_STRING_FORMAT_FLAG_TIME_NANO_SECONDS = 0x00040000UL,
/* Add a timezone indicator
*/
LIBCDATETIME_STRING_FORMAT_FLAG_TIMEZONE_INDICATOR = 0x80000000UL,
};
#define LIBCDATETIME_STRING_FORMAT_FLAG_DATE_TIME \
(uint32_t) ( LIBCDATETIME_STRING_FORMAT_FLAG_DATE | LIBCDATETIME_STRING_FORMAT_FLAG_TIME )
#define LIBCDATETIME_STRING_FORMAT_FLAG_DATE_TIME_MILLI_SECONDS \
(uint32_t) ( LIBCDATETIME_STRING_FORMAT_FLAG_DATE | LIBCDATETIME_STRING_FORMAT_FLAG_TIME | LIBCDATETIME_STRING_FORMAT_FLAG_TIME_MILLI_SECONDS )
#define LIBCDATETIME_STRING_FORMAT_FLAG_DATE_TIME_MICRO_SECONDS \
(uint32_t) ( LIBCDATETIME_STRING_FORMAT_FLAG_DATE | LIBCDATETIME_STRING_FORMAT_FLAG_TIME | LIBCDATETIME_STRING_FORMAT_FLAG_TIME_MICRO_SECONDS )
#define LIBCDATETIME_STRING_FORMAT_FLAG_DATE_TIME_NANO_SECONDS \
(uint32_t) ( LIBCDATETIME_STRING_FORMAT_FLAG_DATE | LIBCDATETIME_STRING_FORMAT_FLAG_TIME | LIBCDATETIME_STRING_FORMAT_FLAG_TIME_NANO_SECONDS )
#endif /* !defined( HAVE_LOCAL_LIBCDATETIME ) */
/* The month values
*/
enum LIBCDATETIME_MONTHS
{
LIBCDATETIME_MONTH_JANUARY = 0,
LIBCDATETIME_MONTH_FEBRUARY = 1,
LIBCDATETIME_MONTH_MARCH = 2,
LIBCDATETIME_MONTH_APRIL = 3,
LIBCDATETIME_MONTH_MAY = 4,
LIBCDATETIME_MONTH_JUNE = 5,
LIBCDATETIME_MONTH_JULY = 6,
LIBCDATETIME_MONTH_AUGUST = 7,
LIBCDATETIME_MONTH_SEPTEMBER = 8,
LIBCDATETIME_MONTH_OCTOBER = 9,
LIBCDATETIME_MONTH_NOVEMBER = 10,
LIBCDATETIME_MONTH_DECEMBER = 11
};
#endif /* !defined( LIBCDATETIME_INTERNAL_DEFINITIONS_H ) */
|