summaryrefslogtreecommitdiff
path: root/other/apidsl
diff options
context:
space:
mode:
authormannol <eniz_vukovic@hotmail.com>2015-06-25 00:58:23 +0200
committermannol <eniz_vukovic@hotmail.com>2015-06-25 00:58:23 +0200
commitf9f17fdf10d6fa233ffc0dbf568afbbd4b1ef179 (patch)
tree657a96c2adf5eb3989c5ae9493bfde431bdda586 /other/apidsl
parenta3132feddb25656e33c7ce8c9bc6abc78657a01e (diff)
parent1434b319f3956fa3a62033486851ab3815775901 (diff)
Merge remote-tracking branch 'upstream/master' into new_api
Diffstat (limited to 'other/apidsl')
-rw-r--r--other/apidsl/README.md50
-rw-r--r--other/apidsl/tox.in.h18
2 files changed, 61 insertions, 7 deletions
diff --git a/other/apidsl/README.md b/other/apidsl/README.md
index 0b3e776d..3c194df5 100644
--- a/other/apidsl/README.md
+++ b/other/apidsl/README.md
@@ -1,11 +1,49 @@
1This folder contains the input file that can be used to generate the tox.h api 1This 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
2with: https://github.com/iphydf/apidsl
3 2
4You can also use the following command if you can't install it: 3# Minimal requirements
5 4
5There are some minimal requirements to contribute to ``tox.h``:
6* unix environment
7* ``astyle`` ``>=2.03``
8* [``apidsl``](https://github.com/iphydf/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.in.h``](/other/apidsl/tox.in.h)
173. Run command below ↓
18
19Command to run from ``toxcore`` directory (quick way, involves using curl):
20```bash
21rm toxcore/tox.h && \
22( curl -X POST --data-binary @- https://criticism.herokuapp.com/apidsl < ./other/apidsl/tox.in.h > ./toxcore/tox.h ) && \
23astyle --options=./other/astyle/astylerc ./toxcore/tox.h
24```
25
26When formatting will be complete, you should see output like:
6``` 27```
7curl -X POST --data-binary @- https://criticism.herokuapp.com/apidsl < tox.in.h > tox.h 28Formatted ./toxcore/tox.h
29```
30
31You may want to make sure with ``git diff`` that changes made in ``tox.h`` reflect changes in ``tox.in.h``.
32
33And you're done.
34
35
36## Manually
37
38If you prefer to have more control over what is happening, there are steps below:
39
401. Install [``apidsl``](https://github.com/iphydf/apidsl)
412. Install ``astyle``, version 2.03 or later.
423. Modify [``tox.in.h``](/other/apidsl/tox.in.h)
434. Use ``apidsl`` ``??``
445. Parse generated ``tox.h`` with astyle, minimal command for it would be:
45```bash
46astyle --options=./other/astyle/astylerc ./toxcore/tox.h
8``` 47```
9 48
10Note 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
11other/astyle/astylerc to generate the exact same file.
diff --git a/other/apidsl/tox.in.h b/other/apidsl/tox.in.h
index 30c78e44..4a0ab950 100644
--- a/other/apidsl/tox.in.h
+++ b/other/apidsl/tox.in.h
@@ -34,6 +34,14 @@ extern "C" {
34#endif 34#endif
35%} 35%}
36 36
37
38/*****************************************************************************
39 * `tox.h` SHOULD *NOT* BE EDITED MANUALLY – any changes should be made to *
40 * `tox.in.h`, located in `other/apidsl/`. For instructions on how to *
41 * generate `tox.h` from `tox.in.h` please refer to `other/apidsl/README.md` *
42 *****************************************************************************/
43
44
37/** \page core Public core API for Tox clients. 45/** \page core Public core API for Tox clients.
38 * 46 *
39 * Every function that can fail takes a function-specific error code pointer 47 * Every function that can fail takes a function-specific error code pointer
@@ -431,7 +439,15 @@ static class options {
431 uint16_t end_port; 439 uint16_t end_port;
432 440
433 /** 441 /**
434 * The port to use for the TCP server. If 0, the tcp server is disabled. 442 * The port to use for the TCP server (relay). If 0, the TCP server is
443 * disabled.
444 *
445 * Enabling it is not required for Tox to function properly.
446 *
447 * When enabled, your Tox instance can act as a TCP relay for other Tox
448 * instance. This leads to increased traffic, thus when writing a client
449 * it is recommended to enable TCP server only if the user has an option
450 * to disable it.
435 */ 451 */
436 uint16_t tcp_port; 452 uint16_t tcp_port;
437 453