aboutsummaryrefslogtreecommitdiff
path: root/docs/components/c_picker.rst
blob: da89520a31440bc02336555a864e55535044617a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
c-picker
========

c-picker uses ``libclang``'s Python interface for parsing source files.

Command line options
--------------------

- ``-h, --help`` - Showing help message
- ``--root ROOT`` - Root source directory
- ``--config CONFIG`` - Configuration file (``.json|.yml``)
- ``--output OUTPUT`` - Output file
- ``--print-dependencies`` - Prints the dependencies
- ``--version`` - Shows the program's version number and exit
- ``--args ...``  - clang arguments


Configuration file format
-------------------------

c-picker configuration can be described in ``JSON`` or ``YAML`` format using the same object structure.

- ``elements`` - List of elements to pick from the original code

  - ``name`` - Name of the element
  - ``type`` - Type of the element: ``include``, ``function``, ``variable``
  - ``args`` - Arguments for clang used during picking the element
  - ``options`` - Currenly the only options is ``remove_static`` which removes
    the ``static`` qualifier from the element's definition.

- ``options`` - Global options for all elements
- ``args`` - Global clang arguments for all elements

YAML example
------------

YAML format is preferred because it can contain metadata like comments and licence information.

.. code-block:: YAML

  elements:
  - file: bl1/bl1_fwu.c
    type: variable
    name: bl1_fwu_loaded_ids
    options: [remove_static]
  - file: bl1/bl1_fwu.c
    type: function
    name: bl1_fwu_add_loaded_id
    options: [remove_static]
  - file: bl1/bl1_fwu.c
    type: function
    name: bl1_fwu_remove_loaded_id
    options: [remove_static]
  args:
  - -DFWU_MAX_SIMULTANEOUS_IMAGES=10
  - -DINVALID_IMAGE_ID=0xffffffff


--------------

*Copyright (c) 2019-2021, Arm Limited. All rights reserved.*