ldns_duration2string(3)

ldns_duration2string3

Duration type and related functions

Usage

#include <stdint.h>
#include <stdbool.h>

#include <ldns/ldns.h>

ldns_duration_type* ldns_duration_create(void);

ldns_duration_type* ldns_duration_create_from_string(const char* str);

void ldns_duration_cleanup(ldns_duration_type* duration);

int ldns_duration_compare(const ldns_duration_type* d1, const ldns_duration_type* d2);

char* ldns_duration2string(const ldns_duration_type* duration);

time_t ldns_duration2time(const ldns_duration_type* duration);

Overview

ldns_duration_type
Duration.

struct ldns_duration_struct
{

time_t years;

time_t months;

time_t weeks;

time_t days;

time_t hours;

time_t minutes;

time_t seconds;
};

typedef struct ldns_duration_struct ldns_duration_type;

ldns_duration_create() Create a new 'instant' duration. .br Returns ldns_duration_type* created duration

ldns_duration_create_from_string() Create a duration from string. .br str: string-format duration .br Returns ldns_duration_type* created duration

ldns_duration_cleanup() Clean up duration. .br duration: duration to be cleaned up

ldns_duration_compare() Compare durations. .br d1: one duration .br d2: another duration .br Returns int 0 if equal, -1 if d1 < d2, 1 if d2 < d1

ldns_duration2string() Convert a duration to a string. .br duration: duration to be converted .br Returns char* string-format duration

ldns_duration2time() Convert a duration to a time. .br duration: duration to be converted .br Returns time_t time-format duration

Remarks

This manpage was automatically generated from the ldns source code.

Releases

6 releases since Debian 9 (Stretch); the text changed 2 times.

  1. 9–10
  2. 11–12
  3. 13–Arch

Author

The ldns team at NLnet Labs.

Reporting bugs

Please report bugs to [email protected] or on GitHub at https://github.com/NLnetLabs/ldns/issues

From ldns 1.9.2-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.