diff options
Diffstat (limited to 'other/apidsl/README.md')
-rw-r--r-- | other/apidsl/README.md | 50 |
1 files changed, 44 insertions, 6 deletions
diff --git a/other/apidsl/README.md b/other/apidsl/README.md index 0b3e776d..c0f29ea4 100644 --- a/other/apidsl/README.md +++ b/other/apidsl/README.md | |||
@@ -1,11 +1,49 @@ | |||
1 | This folder contains the input file that can be used to generate the tox.h api | 1 | This folder contains the input file (``tox.in.h``) that has to be used to generate the ``tox.h`` api with: https://github.com/iphydf/apidsl |
2 | with: https://github.com/iphydf/apidsl | ||
3 | 2 | ||
4 | You can also use the following command if you can't install it: | 3 | # Minimal requirements |
5 | 4 | ||
5 | There are some minimal requirements to contribute to ``tox.h``: | ||
6 | * unix enrironment | ||
7 | * ``astyle`` ``>=2.03`` | ||
8 | * [``apidsl``](https://github.com/iphydf/apidsl) (you can use provided service with curl instead) | ||
9 | |||
10 | ## Quick way | ||
11 | |||
12 | If you want to do it quickly and you don't have time for anything other than copypasting commands, you should have ``curl`` installed. | ||
13 | |||
14 | |||
15 | 1. Make sure that you have ``curl`` and ``>=astyle-2.03`` installed | ||
16 | 2. Modify [``tox.in.h``](/other/apidsl/tox.in.h) | ||
17 | 3. Run command below ↓ | ||
18 | |||
19 | Command to run from ``toxcore`` directory (quick way, involves using curl): | ||
20 | ```bash | ||
21 | rm toxcore/tox.h && \ | ||
22 | ( curl -X POST --data-binary @- https://criticism.herokuapp.com/apidsl < ./other/apidsl/tox.in.h > ./toxcore/tox.h ) && \ | ||
23 | astyle --options=./other/astyle/astylerc ./toxcore/tox.h | ||
24 | ``` | ||
25 | |||
26 | When formatting will be complete, you should see output like: | ||
6 | ``` | 27 | ``` |
7 | curl -X POST --data-binary @- https://criticism.herokuapp.com/apidsl < tox.in.h > tox.h | 28 | Formatted ./toxcore/tox.h |
29 | ``` | ||
30 | |||
31 | You may want to make sure with ``git diff`` that changes made in ``tox.h`` reflect changes in ``tox.in.h``. | ||
32 | |||
33 | And you're done. | ||
34 | |||
35 | |||
36 | ## Manually | ||
37 | |||
38 | If you prefer to have more control over what is happening, there are steps below: | ||
39 | |||
40 | 1. Install [``apidsl``](https://github.com/iphydf/apidsl) | ||
41 | 2. Install ``astyle``, version 2.03 or later. | ||
42 | 3. Modify [``tox.in.h``](/other/apidsl/tox.in.h) | ||
43 | 4. Use ``apidsl`` ``??`` | ||
44 | 5. Parse generated ``tox.h`` with astyle, minimal command for it would be: | ||
45 | ```bash | ||
46 | astyle --options=./other/astyle/astylerc ./toxcore/tox.h | ||
8 | ``` | 47 | ``` |
9 | 48 | ||
10 | Note that the output must be passed through astyle with the config in | 49 | **Always pass output from ``apidsl`` through astyle.** \ No newline at end of file |
11 | other/astyle/astylerc to generate the exact same file. | ||