libcbor 0.12.0
libcbor is a C library for parsing and generating CBOR, the general-purpose schema-less binary data format.
Loading...
Searching...
No Matches
tags.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2014-2020 Pavel Kalvoda <me@pavelkalvoda.com>
3 *
4 * libcbor is free software; you can redistribute it and/or modify
5 * it under the terms of the MIT license. See LICENSE for details.
6 */
7
8#ifndef LIBCBOR_TAGS_H
9#define LIBCBOR_TAGS_H
10
11#include "cbor/cbor_export.h"
12#include "cbor/common.h"
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18/*
19 * ============================================================================
20 * Tag manipulation
21 * ============================================================================
22 */
23
31_CBOR_NODISCARD CBOR_EXPORT cbor_item_t* cbor_new_tag(uint64_t value);
32
42
48_CBOR_NODISCARD CBOR_EXPORT uint64_t cbor_tag_value(const cbor_item_t* tag);
49
60CBOR_EXPORT void cbor_tag_set_item(cbor_item_t* tag, cbor_item_t* tagged_item);
61
71_CBOR_NODISCARD CBOR_EXPORT cbor_item_t* cbor_build_tag(uint64_t value,
72 cbor_item_t* item);
73
74#ifdef __cplusplus
75}
76#endif
77
78#endif // LIBCBOR_TAGS_H
#define _CBOR_NODISCARD
Definition common.h:93
The item handle.
Definition data.h:171
cbor_item_t * cbor_tag_item(const cbor_item_t *tag)
Get the tagged item (what the tag points to).
Definition tags.c:23
uint64_t cbor_tag_value(const cbor_item_t *tag)
Get the tag value.
Definition tags.c:28
cbor_item_t * cbor_build_tag(uint64_t value, cbor_item_t *item)
Build a new tag.
Definition tags.c:39
void cbor_tag_set_item(cbor_item_t *tag, cbor_item_t *tagged_item)
Assign a tag to an item.
Definition tags.c:33
cbor_item_t * cbor_new_tag(uint64_t value)
Create a new tag.
Definition tags.c:10