libyang  5.7.2
libyang is YANG data modelling language parser and toolkit written (and providing API) in C.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
time.c File Reference

ietf-yang-types time and time-no-zone type plugin. More...

#include "plugins_types.h"
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "libyang.h"
#include "compat.h"
#include "ly_common.h"
#include "plugins_internal.h"
Include dependency graph for time.c:

Go to the source code of this file.

Macros

#define _GNU_SOURCE   /* strdup */
 
#define _XOPEN_SOURCE   /* strptime */
 

Functions

 if (!strcmp(val1->realtype->name,"time"))
 
 if (dt!=0)
 
 if (v1)
 
 LYD_VALUE_GET (val2, vn2)
 

Variables

double dt = difftime(vn1->seconds, vn2->seconds)
 
 else
 
struct lyplg_type_record plugins_time []
 Plugin information for time and time-no-zone type implementation. More...
 
struct lyd_value_time_nzvn1 = NULL
 
struct lyd_value_time_nzvn2
 

Detailed Description

ietf-yang-types time and time-no-zone type plugin.

Author
Michal Vasko mvask.nosp@m.o@ce.nosp@m.snet..nosp@m.cz Copyright (c) 2026 CESNET, z.s.p.o.

This source code is licensed under BSD 3-Clause License (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at

https://opensource.org/licenses/BSD-3-Clause

Definition in file time.c.

Macro Definition Documentation

#define _GNU_SOURCE   /* strdup */

Definition at line 15 of file time.c.

#define _XOPEN_SOURCE   /* strptime */

Definition at line 16 of file time.c.

Function Documentation

if ( strcmpval1->realtype->name,"time")

Definition at line 328 of file time.c.

if ( dt!  = 0)

Definition at line 341 of file time.c.

if ( v1  )

Definition at line 346 of file time.c.

LYD_VALUE_GET ( val2  ,
vn2   
)

Variable Documentation

dt = difftime(vn1->seconds, vn2->seconds)

Definition at line 326 of file time.c.

else
Initial value:
{
#define LYD_VALUE_GET(value, type_val)
Get the value in format specific to the type.
Definition: tree_data.h:566
struct lyd_value_date_nz * vn1
Definition: date.c:227

Definition at line 334 of file time.c.

struct lyplg_type_record plugins_time[]

Plugin information for time and time-no-zone type implementation.

Note that external plugins are supposed to use:

LYPLG_TYPES = {

Definition at line 556 of file time.c.

struct lyd_value_time_nz* vn1 = NULL

Definition at line 325 of file time.c.

struct lyd_value_time_nz * vn2

Definition at line 325 of file time.c.