intel / tinycbor

Concise Binary Object Representation (CBOR) Library
MIT License
487 stars 187 forks source link

Use a code generator to update CborKnownTags enum list from IANA #240

Open mofosyne opened 11 months ago

mofosyne commented 11 months ago

Created https://github.com/mofosyne/iana-headers/blob/main/cbor/c/cbor-constants.h#L22-L31 but noticed that https://github.com/intel/tinycbor/blob/04b306c447d1144a868f563a5d43357fd8f5c3fd/src/cbor.h#L105-L128 has a different naming approach so it's not directly adaptable to use my existing codegenerator (written in python).

Also it doesn't seem like the enum is directly referenced in the code so am proposing to add a iana-cbor-constant.h so you can still keep the existing CborKnownTags for backwards compatibility. Other option is to manually adapt the python code to match tinycbor naming convention.

thiagomacieira commented 11 months ago

Adapting the naming from your generator shouldn't be too difficult, though.

mofosyne commented 11 months ago

Okay gave it a shot https://github.com/intel/tinycbor/pull/241/files