Skip to content

Commit

Permalink
Merge pull request #275 from PJK/update-standard
Browse files Browse the repository at this point in the history
Update docs for STD94
  • Loading branch information
PJK committed Feb 17, 2023
2 parents f6433dd + c700c19 commit 5126b3c
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Template:

Next
---------------------
- [Updated documentation to refer to RFC 8949](https://github.com/PJK/libcbor/issues/269)

0.10.2 (2023-01-31)
---------------------
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
[![latest packaged version(s)](https://repology.org/badge/latest-versions/libcbor.svg)](https://repology.org/project/libcbor/versions)
[![codecov](https://codecov.io/gh/PJK/libcbor/branch/master/graph/badge.svg)](https://codecov.io/gh/PJK/libcbor)

**libcbor** is a C library for parsing and generating [CBOR](https://tools.ietf.org/html/rfc7049), the general-purpose schema-less binary data format.
**libcbor** is a C library for parsing and generating [CBOR](https://cbor.io/), the general-purpose schema-less binary data format.

## Main features
- Complete RFC conformance
- Robust C99 implementation
- Complete [IETF RFC 8949 (STD 94)](https://www.rfc-editor.org/info/std94) conformance
- Robust platform-independent C99 implementation
- Layered architecture offers both control and convenience
- Flexible memory management
- No shared global state - threading friendly
Expand Down
2 changes: 1 addition & 1 deletion doc/source/api/item_types.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Types of items
===============================================

Every :type:`cbor_item_t` has a :type:`cbor_type` associated with it - these constants correspond to the types specified by the `CBOR standard <http://tools.ietf.org/html/rfc7049>`_:
Every :type:`cbor_item_t` has a :type:`cbor_type` associated with it - these constants correspond to the types specified by the `CBOR standard <https://www.rfc-editor.org/info/std94>`_:

.. doxygenenum:: cbor_type

Expand Down
4 changes: 2 additions & 2 deletions doc/source/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ everywhere.
Goals
~~~~~~~~~~~~~~~~~~~~~~

RFC-conformance and full feature support
Standard conformance and full feature support
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Anything the standard allows, libcbor can do.

**Why?** Because conformance and interoperability is the point of defining
standards. Clients expect the support to be feature-complete and
there is no significant complexity reduction that can be achieved by slightly
cutting corners, which means that the incremental cost of full RFC support is
cutting corners, which means that the incremental cost of full [CBOR standard](https://www.rfc-editor.org/info/std94) support is
comparatively small over "almost-conformance" seen in many alternatives.


Expand Down
8 changes: 4 additions & 4 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Overview


Main features
- Complete RFC conformance [#]_
- - Complete IETF RFC 8949 (STD 94) conformance [#]_
- Robust C99 implementation
- Layered architecture offers both control and convenience
- Flexible memory management
Expand All @@ -19,7 +19,7 @@ Main features
- Extensive documentation and test suite
- No runtime dependencies, small footprint

.. [#] See :doc:`rfc_conformance`
.. [#] See :doc:`standard_conformance`
.. [#] With the exception of custom memory allocators (see :doc:`api/item_reference_counting`)
Expand All @@ -31,9 +31,9 @@ Contents
using
api
tests
rfc_conformance
standard_conformance
internal
changelog
development

.. _CBOR: http://tools.ietf.org/html/rfc7049
.. _CBOR: https://www.rfc-editor.org/info/std94
2 changes: 1 addition & 1 deletion doc/source/internal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Internal workings of *libcbor* are mostly derived from the specification. The pu
Terminology
---------------
=== ====================== ========================================================================================================================================
MTB Major Type Byte http://tools.ietf.org/html/rfc7049#section-2.1
MTB Major Type Byte https://www.rfc-editor.org/rfc/rfc8949.html#section-3.1
--- ---------------------- ----------------------------------------------------------------------------------------------------------------------------------------
DST Dynamically Sized Type Type whose storage requirements cannot be determined

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
RFC conformance
IETF standard conformance
=========================

*libcbor* is, generally speaking, very faithful implementation of `RFC 7049 <https://tools.ietf.org/html/rfc7049>`_. There are, however, some limitations imposed by technical constraints.
*libcbor* is, generally speaking, a very faithful implementation of `IETF RFC 8949 (STD 94) <https://www.rfc-editor.org/info/std94>`_. There are, however, some limitations related to the numerical range and precision available in portable C99.

Bytestring length
-------------------
There is no explicit limitation of indefinite length byte strings. [#]_ *libcbor* will not handle byte strings with more chunks than the maximum value of :type:`size_t`. On any sane platform, such string would not fit in the memory anyway. It is, however, possible to process arbitrarily long strings and byte strings using the streaming decoder.

.. [#] https://tools.ietf.org/html/rfc7049#section-2.2.2
.. [#] https://www.rfc-editor.org/rfc/rfc8949.html#section-3.2.3
"Half-precision" IEEE 754 floats
---------------------------------
Expand Down
2 changes: 1 addition & 1 deletion examples/readfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ int main(int argc, char* argv[]) {
case CBOR_ERR_SYNTAXERROR: {
printf(
"Syntactically malformed data -- see "
"http://tools.ietf.org/html/rfc7049\n");
"https://www.rfc-editor.org/info/std94\n");
break;
}
case CBOR_ERR_NONE: {
Expand Down
2 changes: 1 addition & 1 deletion src/cbor/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ _CBOR_NODISCARD
CBOR_EXPORT cbor_type cbor_typeof(
const cbor_item_t *item); /* Will be inlined iff link-time opt is enabled */

/* Standard item types as described by the RFC */
/* Standard CBOR Major item types */

/** Does the item have the appropriate major type?
* @param item the item
Expand Down
2 changes: 1 addition & 1 deletion src/cbor/internal/loaders.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ uint64_t _cbor_load_uint64(const unsigned char *source) {
#endif
}

/* As per http://tools.ietf.org/html/rfc7049#appendix-D */
/* As per https://www.rfc-editor.org/rfc/rfc8949.html#name-half-precision */
float _cbor_decode_half(unsigned char *halfp) {
int half = (halfp[0] << 8) + halfp[1];
int exp = (half >> 10) & 0x1f;
Expand Down

0 comments on commit 5126b3c

Please sign in to comment.