summaryrefslogtreecommitdiff
path: root/other/apidsl
diff options
context:
space:
mode:
Diffstat (limited to 'other/apidsl')
-rw-r--r--other/apidsl/tox.in.h48
1 files changed, 41 insertions, 7 deletions
diff --git a/other/apidsl/tox.in.h b/other/apidsl/tox.in.h
index 84a4a03e..b769135a 100644
--- a/other/apidsl/tox.in.h
+++ b/other/apidsl/tox.in.h
@@ -340,6 +340,24 @@ enum class PROXY_TYPE {
340 SOCKS5, 340 SOCKS5,
341} 341}
342 342
343/**
344 * Type of savedata to create the Tox instance from.
345 */
346enum class SAVEDATA_TYPE {
347 /**
348 * No savedata.
349 */
350 NONE,
351 /**
352 * Savedata is one that was obtained from ${savedata.get}
353 */
354 TOX_SAVE,
355 /**
356 * Savedata is a secret key of length ${SECRET_KEY_SIZE}
357 */
358 SECRET_KEY,
359}
360
343 361
344static class options { 362static class options {
345 /** 363 /**
@@ -411,6 +429,28 @@ static class options {
411 * The end port of the inclusive port range to attempt to use. 429 * The end port of the inclusive port range to attempt to use.
412 */ 430 */
413 uint16_t end_port; 431 uint16_t end_port;
432
433 /**
434 * The port to use for the TCP server. If 0, the tcp server is disabled.
435 */
436 uint16_t tcp_port;
437
438 namespace savedata {
439 /**
440 * The type of savedata to load from.
441 */
442 SAVEDATA_TYPE type;
443
444 /**
445 * The savedata.
446 */
447 const uint8_t[length] data;
448
449 /**
450 * The length of the savedata.
451 */
452 size_t length;
453 }
414 } 454 }
415 455
416 456
@@ -469,21 +509,15 @@ static class options {
469 * This function will bring the instance into a valid state. Running the event 509 * This function will bring the instance into a valid state. Running the event
470 * loop with a new instance will operate correctly. 510 * loop with a new instance will operate correctly.
471 * 511 *
472 * If the data parameter is not NULL, this function will load the Tox instance
473 * from a byte array previously filled by ${savedata.get}.
474 *
475 * If loading failed or succeeded only partially, the new or partially loaded 512 * If loading failed or succeeded only partially, the new or partially loaded
476 * instance is returned and an error code is set. 513 * instance is returned and an error code is set.
477 * 514 *
478 * @param options An options object as described above. If this parameter is 515 * @param options An options object as described above. If this parameter is
479 * NULL, the default options are used. 516 * NULL, the default options are used.
480 * @param data A byte array containing data previously stored by ${savedata.get}.
481 * @param length The length of the byte array data. If this parameter is 0, the
482 * data parameter is ignored.
483 * 517 *
484 * @see $iterate for the event loop. 518 * @see $iterate for the event loop.
485 */ 519 */
486static this new(const options_t *options, const uint8_t[length] data) { 520static this new(const options_t *options) {
487 NULL, 521 NULL,
488 /** 522 /**
489 * The function was unable to allocate enough memory to store the internal 523 * The function was unable to allocate enough memory to store the internal