halcc: Introduce halcc library 64/303164/13
authorYoungjae Cho <y0.cho@samsung.com>
Tue, 19 Dec 2023 06:24:38 +0000 (15:24 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Mon, 15 Jan 2024 09:02:35 +0000 (18:02 +0900)
commit0bae662a9fe3b876c0e5491a8e99e541cddfe018
tree0caf50852514c90e513dc647cd424a7f954e04fb
parentab6f05528fc5cc7ea1bf9dc6960c48b6a2b35d88
halcc: Introduce halcc library

The halcc stands for hal compatibility checker.

Tizen hal-apis can specify what feature and version it expects to
hal-backends in manifest file. The halcc library deserializes and
utilizes the information for checking compatibility between
hal-api and hal-backend.

For example, a hal-api specifies what it needs in xml file:

  | <!--hal-api-xxx.xml-->
  |
  | <manifest version="1.0" type="platform" level="2">
  |     <hal>
  |         <name>AAA</name>
  |         <version>3.1</version>
  |         <transport>passthrough</transport>
  |     </hal>
  |     ...
  | </manifest>

It means that the hal-api expects and requires hal-backend module name
of AAA, and version of 3.x where x >= 1.
(See semantic versioning, https://semver.org)

These are collected and tested by the halcc library.

Currently only the function below is provieded
 - int halcc_check_compatibility(const char *hal_api_manifest_dir,
     halcc_compatibility_cb callback, void *user_data)
   : It collects manifest files at hal_api_manifest_dir and checks
     whether the hal-backends have compatible what hal-apis have
     specified. For each specified <hal> in manifests, callback is
     invoked.

Change-Id: Ibb16c378f6fbe08750b6df7db99ee6626bcfd033
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
14 files changed:
CMakeLists.txt
halcc/CMakeLists.txt [new file with mode: 0644]
halcc/include/halcc/hal-compatibility-checker.h [new file with mode: 0644]
halcc/src/hal-compatibility-checker.c [new file with mode: 0644]
halcc/src/halcc-object.c [new file with mode: 0644]
halcc/src/halcc-object.h [new file with mode: 0644]
halcc/src/halcc-parser.c [new file with mode: 0644]
halcc/src/halcc-parser.h [new file with mode: 0644]
halcc/src/halcc-util.c [new file with mode: 0644]
halcc/src/halcc-util.h [new file with mode: 0644]
packaging/hal-api-common.pc.in
packaging/hal-api-common.spec
tests/unittest/CMakeLists.txt
tests/unittest/test-hal-compatibility-checker.cc [new file with mode: 0644]