diff options
Diffstat (limited to 'other/apidsl/tox.in.h')
-rw-r--r-- | other/apidsl/tox.in.h | 43 |
1 files changed, 36 insertions, 7 deletions
diff --git a/other/apidsl/tox.in.h b/other/apidsl/tox.in.h index dd47df23..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 | */ | ||
346 | enum 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 | ||
344 | static class options { | 362 | static class options { |
345 | /** | 363 | /** |
@@ -416,6 +434,23 @@ static class options { | |||
416 | * The port to use for the TCP server. If 0, the tcp server is disabled. | 434 | * The port to use for the TCP server. If 0, the tcp server is disabled. |
417 | */ | 435 | */ |
418 | uint16_t tcp_port; | 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 | } | ||
419 | } | 454 | } |
420 | 455 | ||
421 | 456 | ||
@@ -474,21 +509,15 @@ static class options { | |||
474 | * 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 |
475 | * loop with a new instance will operate correctly. | 510 | * loop with a new instance will operate correctly. |
476 | * | 511 | * |
477 | * If the data parameter is not NULL, this function will load the Tox instance | ||
478 | * from a byte array previously filled by ${savedata.get}. | ||
479 | * | ||
480 | * 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 |
481 | * instance is returned and an error code is set. | 513 | * instance is returned and an error code is set. |
482 | * | 514 | * |
483 | * @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 |
484 | * NULL, the default options are used. | 516 | * NULL, the default options are used. |
485 | * @param data A byte array containing data previously stored by ${savedata.get}. | ||
486 | * @param length The length of the byte array data. If this parameter is 0, the | ||
487 | * data parameter is ignored. | ||
488 | * | 517 | * |
489 | * @see $iterate for the event loop. | 518 | * @see $iterate for the event loop. |
490 | */ | 519 | */ |
491 | static this new(const options_t *options, const uint8_t[length] data) { | 520 | static this new(const options_t *options) { |
492 | NULL, | 521 | NULL, |
493 | /** | 522 | /** |
494 | * 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 |