Scroll to navigation

libcdatetime(3) Library Functions Manual libcdatetime(3)

NAME

libcdatetime.hLibrary to support cross-platform C date and time functions

SYNOPSIS

#include <libcdatetime.h>

Support functions
const char *
libcdatetime_get_version(void);

Error functions
void
libcdatetime_error_free(libcdatetime_error_t **error);

int
libcdatetime_error_fprint(libcdatetime_error_t *error, FILE *stream);

int
libcdatetime_error_sprint(libcdatetime_error_t *error, char *string, size_t size);

int
libcdatetime_error_backtrace_fprint(libcdatetime_error_t *error, FILE *stream);

int
libcdatetime_error_backtrace_sprint(libcdatetime_error_t *error, char *string, size_t size);

Date and time elements functions
int
libcdatetime_elements_initialize(libcdatetime_elements_t **elements, libcdatetime_error_t **error);

int
libcdatetime_elements_free(libcdatetime_elements_t **elements, libcdatetime_error_t **error);

int
libcdatetime_elements_copy(libcdatetime_elements_t *destination_elements, const libcdatetime_elements_t *source_elements, libcdatetime_error_t **error);

int
libcdatetime_elements_get_year(libcdatetime_elements_t *elements, uint16_t *year, libcdatetime_error_t **error);

int
libcdatetime_elements_get_day_of_year(libcdatetime_elements_t *elements, uint16_t *day_of_year, libcdatetime_error_t **error);

int
libcdatetime_elements_get_month(libcdatetime_elements_t *elements, uint8_t *month, libcdatetime_error_t **error);

int
libcdatetime_elements_get_day_of_month(libcdatetime_elements_t *elements, uint8_t *day_of_month, libcdatetime_error_t **error);

int
libcdatetime_elements_get_date_values(libcdatetime_elements_t *elements, uint16_t *year, uint8_t *month, uint8_t *day_of_month, libcdatetime_error_t **error);

int
libcdatetime_elements_get_hours(libcdatetime_elements_t *elements, uint8_t *hours, libcdatetime_error_t **error);

int
libcdatetime_elements_get_minutes(libcdatetime_elements_t *elements, uint8_t *minutes, libcdatetime_error_t **error);

int
libcdatetime_elements_get_seconds(libcdatetime_elements_t *elements, uint8_t *seconds, libcdatetime_error_t **error);

int
libcdatetime_elements_get_milli_seconds(libcdatetime_elements_t *elements, uint16_t *milli_seconds, libcdatetime_error_t **error);

int
libcdatetime_elements_get_micro_seconds(libcdatetime_elements_t *elements, uint16_t *micro_seconds, libcdatetime_error_t **error);

int
libcdatetime_elements_get_nano_seconds(libcdatetime_elements_t *elements, uint16_t *nano_seconds, libcdatetime_error_t **error);

int
libcdatetime_elements_get_time_values(libcdatetime_elements_t *elements, uint8_t *hours, uint8_t *minutes, uint8_t *seconds, libcdatetime_error_t **error);

int
libcdatetime_elements_set_current_time_utc(libcdatetime_elements_t *elements, libcdatetime_error_t **error);

int
libcdatetime_elements_set_current_time_localtime(libcdatetime_elements_t *elements, libcdatetime_error_t **error);

int
libcdatetime_elements_get_delta_in_seconds(libcdatetime_elements_t *first_elements, libcdatetime_elements_t *second_elements, int64_t *number_of_seconds, libcdatetime_error_t **error);

int
libcdatetime_elements_set_from_delta_in_seconds(libcdatetime_elements_t *elements, int64_t number_of_seconds, libcdatetime_error_t **error);

int
libcdatetime_elements_get_string_size(libcdatetime_elements_t *elements, size_t *string_size, uint32_t string_format_flags, libcdatetime_error_t **error);

int
libcdatetime_elements_copy_to_string(libcdatetime_elements_t *elements, uint8_t *string, size_t string_size, uint32_t string_format_flags, libcdatetime_error_t **error);

int
libcdatetime_elements_copy_to_string_with_index(libcdatetime_elements_t *elements, uint8_t *string, size_t string_size, size_t *string_index, uint32_t string_format_flags, libcdatetime_error_t **error);

Timestamp functions
int
libcdatetime_timestamp_initialize(libcdatetime_timestamp_t **timestamp, libcdatetime_error_t **error);

int
libcdatetime_timestamp_free(libcdatetime_timestamp_t **timestamp, libcdatetime_error_t **error);

int
libcdatetime_timestamp_copy(libcdatetime_timestamp_t *destination_timestamp, const libcdatetime_timestamp_t *source_timestamp, libcdatetime_error_t **error);

int
libcdatetime_timestamp_set_current_time(libcdatetime_timestamp_t *timestamp, libcdatetime_error_t **error);

int
libcdatetime_timestamp_get_delta_in_seconds(libcdatetime_timestamp_t *first_timestamp, libcdatetime_timestamp_t *second_timestamp, int64_t *number_of_seconds, libcdatetime_error_t **error);

int
libcdatetime_timestamp_get_string_size(libcdatetime_timestamp_t *timestamp, size_t *string_size, uint32_t string_format_flags, libcdatetime_error_t **error);

int
libcdatetime_timestamp_copy_to_string(libcdatetime_timestamp_t *timestamp, uint8_t *string, size_t string_size, uint32_t string_format_flags, libcdatetime_error_t **error);

int
libcdatetime_timestamp_copy_to_string_with_index(libcdatetime_timestamp_t *timestamp, uint8_t *string, size_t string_size, size_t *string_index, uint32_t string_format_flags, libcdatetime_error_t **error);

DESCRIPTION

The () function is used to retrieve the library version.

RETURN VALUES

Most of the functions return NULL or -1 on error, dependent on the return type. For the actual return values see "libcdatetime.h".

ENVIRONMENT

None

FILES

None

BUGS

Please report bugs of any kind on the project issue tracker: https://github.com/libyal/libcdatetime/issues

AUTHOR

These man pages are generated from "libcdatetime.h".

COPYRIGHT

Copyright (C) 2013-2024, Joachim Metz <joachim.metz@gmail.com>.

This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

SEE ALSO

the libcdatetime.h include file

February 25, 2019 libcdatetime