Skip to content

Draft: Another API

Sebastian Wick requested to merge swick/libdisplay-info:baseline into main

The basic idea from #4 (comment 1313098) but changed in a few significant ways.

struct di_blob has no sub-structs anymore. The result of parsing a blob is struct di_blob which gives access to diagnostics, lets you iterate over the data in several ways and it can be added to struct di_info.

struct di_info is an aggregate of struct di_blobs and is used in the high level API. In the future it can also carry mode information when the high level API needs it.

struct di_blocks contain data. They have parents and children (i.e. a struct di_block_edid can have children struct di_block_cta861 and struct di_block_displayid) that can be iterated over.

A single struct di_block sub-struct can be queried for the data it contains.

How the parse error and diagnostics work is still up in the air. I would like it to be possible to return an error only when it's impossible to continue and log diagnostics otherwise.

Merge request reports