summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2016-09-21 10:51:58 +0100
committeriphydf <iphydf@users.noreply.github.com>2016-10-02 23:54:03 +0100
commitb8b9789a6975266433904b0ab4d381a9f3317986 (patch)
tree22a472dcc207a712fc7bb8abf44c54dd211431bc /docs
parent66e1bb4510f69e3361ff95ebeaae42ee51a70675 (diff)
Rebuild apidsl'd headers in cmake.
- Moved apidsl headers next to their generated versions. In the future, perhaps all (or most) headers will be apidsl-generated, so the sources should stay together. - Try to find apidsl/apigen binary and astyle binary and use it for the format test. Don't run the format test if these can't be found.
Diffstat (limited to 'docs')
-rw-r--r--docs/apidsl.md51
1 files changed, 51 insertions, 0 deletions
diff --git a/docs/apidsl.md b/docs/apidsl.md
new file mode 100644
index 00000000..96ff5d0d
--- /dev/null
+++ b/docs/apidsl.md
@@ -0,0 +1,51 @@
1This folder contains the input file (``tox.in.h``) that has to be used to generate the ``tox.h`` api with: https://github.com/TokTok/apidsl
2
3# Minimal requirements
4
5There are some minimal requirements to contribute to ``tox.h``:
6* unix environment
7* ``astyle`` ``>=2.03``
8* [``apidsl``](https://github.com/TokTok/apidsl) (you can use provided service with curl instead)
9
10## Quick way
11
12If 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
151. Make sure that you have ``curl`` and ``>=astyle-2.03`` installed
162. Modify [``tox.api.h``](/toxcore/tox.api.h)
173. Run command below ↓
18
19Command to run from ``toxcore`` directory (quick way, involves using curl):
20```bash
21# For tox.h:
22curl -X POST --data-binary @- https://apidsl.herokuapp.com/apidsl \
23 < toxcore/tox.api.h \
24 | astyle --options=other/astyle/astylerc \
25 > toxcore/tox.h
26# For toxav.h:
27curl -X POST --data-binary @- https://apidsl.herokuapp.com/apidsl \
28 < toxav/toxav.api.h \
29 | astyle --options=other/astyle/astylerc \
30 > toxav/toxav.h
31```
32
33You may want to make sure with ``git diff`` that changes made in ``tox.h`` reflect changes in ``tox.in.h``.
34
35And you're done.
36
37
38## Manually
39
40If you prefer to have more control over what is happening, there are steps below:
41
421. Install [``apidsl``](https://github.com/TokTok/apidsl)
432. Install ``astyle``, version 2.03 or later.
443. Modify [``tox.api.h``](/toxcore/tox.api.h)
454. Use ``apidsl`` ``??``
465. Parse generated ``tox.h`` with astyle, minimal command for it would be:
47```bash
48astyle --options=other/astyle/astylerc toxcore/tox.h
49```
50
51**Always pass output from ``apidsl`` through astyle.**