diff options
author | Gabor X Toth <*@tg-x.net> | 2015-07-18 00:03:00 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2015-07-18 00:03:00 +0000 |
commit | 2275976cf61565bde4f17e8c2c0bc0d359541ac4 (patch) | |
tree | e1e921aade10b820b739b95dcad878c5b0fa870a /src | |
parent | 5781ff7e1a968262eb19fcb456a3cf6320575e75 (diff) | |
download | gnunet-2275976cf61565bde4f17e8c2c0bc0d359541ac4.tar.gz gnunet-2275976cf61565bde4f17e8c2c0bc0d359541ac4.zip |
psycstore: doc formatting
Diffstat (limited to 'src')
-rw-r--r-- | src/include/gnunet_psycstore_service.h | 150 | ||||
-rw-r--r-- | src/psycstore/psycstore_api.c | 124 |
2 files changed, 182 insertions, 92 deletions
diff --git a/src/include/gnunet_psycstore_service.h b/src/include/gnunet_psycstore_service.h index 99f27a994..12a375c44 100644 --- a/src/include/gnunet_psycstore_service.h +++ b/src/include/gnunet_psycstore_service.h | |||
@@ -430,14 +430,19 @@ GNUNET_PSYCSTORE_message_get_fragment (struct GNUNET_PSYCSTORE_Handle *h, | |||
430 | * @see GNUNET_PSYCSTORE_counters_get() | 430 | * @see GNUNET_PSYCSTORE_counters_get() |
431 | * | 431 | * |
432 | * @param cls Closure. | 432 | * @param cls Closure. |
433 | * @param result_code Status code for the operation: | 433 | * @param result_code |
434 | * Status code for the operation: | ||
434 | * #GNUNET_OK: success, counter values are returned. | 435 | * #GNUNET_OK: success, counter values are returned. |
435 | * #GNUNET_NO: no message has been sent to the channel yet. | 436 | * #GNUNET_NO: no message has been sent to the channel yet. |
436 | * #GNUNET_SYSERR: an error occurred. | 437 | * #GNUNET_SYSERR: an error occurred. |
437 | * @param max_fragment_id Latest message fragment ID, used by multicast. | 438 | * @param max_fragment_id |
438 | * @param max_message_id Latest message ID, used by PSYC. | 439 | * Latest message fragment ID, used by multicast. |
439 | * @param max_group_generation Latest group generation, used by PSYC. | 440 | * @param max_message_id |
440 | * @param max_state_message_id Latest message ID containing state modifiers that | 441 | * Latest message ID, used by PSYC. |
442 | * @param max_group_generation | ||
443 | * Latest group generation, used by PSYC. | ||
444 | * @param max_state_message_id | ||
445 | * Latest message ID containing state modifiers that | ||
441 | * was applied to the state store. Used for the state sync process. | 446 | * was applied to the state store. Used for the state sync process. |
442 | */ | 447 | */ |
443 | typedef void | 448 | typedef void |
@@ -457,10 +462,14 @@ typedef void | |||
457 | * the counters from their last value. | 462 | * the counters from their last value. |
458 | * - when a channel slave rejoins and starts the state synchronization process. | 463 | * - when a channel slave rejoins and starts the state synchronization process. |
459 | * | 464 | * |
460 | * @param h Handle for the PSYCstore. | 465 | * @param h |
461 | * @param channel_key Public key that identifies the channel. | 466 | * Handle for the PSYCstore. |
462 | * @param ccb Callback to call with the result. | 467 | * @param channel_key |
463 | * @param ccb_cls Closure for the @a ccb callback. | 468 | * Public key that identifies the channel. |
469 | * @param ccb | ||
470 | * Callback to call with the result. | ||
471 | * @param ccb_cls | ||
472 | * Closure for the @a ccb callback. | ||
464 | * | 473 | * |
465 | * @return Handle that can be used to cancel the operation. | 474 | * @return Handle that can be used to cancel the operation. |
466 | */ | 475 | */ |
@@ -477,14 +486,22 @@ GNUNET_PSYCSTORE_counters_get (struct GNUNET_PSYCSTORE_Handle *h, | |||
477 | * An error is returned if there are missing messages containing state | 486 | * An error is returned if there are missing messages containing state |
478 | * operations before the current one. | 487 | * operations before the current one. |
479 | * | 488 | * |
480 | * @param h Handle for the PSYCstore. | 489 | * @param h |
481 | * @param channel_key The channel we are interested in. | 490 | * Handle for the PSYCstore. |
482 | * @param message_id ID of the message that contains the @a modifiers. | 491 | * @param channel_key |
483 | * @param state_delta Value of the @e state_delta PSYC header variable of the message. | 492 | * The channel we are interested in. |
484 | * @param modifier_count Number of elements in the @a modifiers array. | 493 | * @param message_id |
485 | * @param modifiers List of modifiers to apply. | 494 | * ID of the message that contains the @a modifiers. |
486 | * @param rcb Callback to call with the result of the operation. | 495 | * @param state_delta |
487 | * @param rcb_cls Closure for the @a rcb callback. | 496 | * Value of the @e state_delta PSYC header variable of the message. |
497 | * @param modifier_count | ||
498 | * Number of elements in the @a modifiers array. | ||
499 | * @param modifiers | ||
500 | * List of modifiers to apply. | ||
501 | * @param rcb | ||
502 | * Callback to call with the result of the operation. | ||
503 | * @param rcb_cls | ||
504 | * Closure for the @a rcb callback. | ||
488 | * | 505 | * |
489 | * @return Handle that can be used to cancel the operation. | 506 | * @return Handle that can be used to cancel the operation. |
490 | */ | 507 | */ |
@@ -502,13 +519,20 @@ GNUNET_PSYCSTORE_state_modify (struct GNUNET_PSYCSTORE_Handle *h, | |||
502 | /** | 519 | /** |
503 | * Store synchronized state. | 520 | * Store synchronized state. |
504 | * | 521 | * |
505 | * @param h Handle for the PSYCstore. | 522 | * @param h |
506 | * @param channel_key The channel we are interested in. | 523 | * Handle for the PSYCstore. |
507 | * @param message_id ID of the message that contains the state_hash PSYC header variable. | 524 | * @param channel_key |
508 | * @param modifier_count Number of elements in the @a modifiers array. | 525 | * The channel we are interested in. |
509 | * @param modifiers Full state to store. | 526 | * @param message_id |
510 | * @param rcb Callback to call with the result of the operation. | 527 | * ID of the message that contains the state_hash PSYC header variable. |
511 | * @param rcb_cls Closure for the callback. | 528 | * @param modifier_count |
529 | * Number of elements in the @a modifiers array. | ||
530 | * @param modifiers | ||
531 | * Full state to store. | ||
532 | * @param rcb | ||
533 | * Callback to call with the result of the operation. | ||
534 | * @param rcb_cls | ||
535 | * Closure for the callback. | ||
512 | * | 536 | * |
513 | * @return Handle that can be used to cancel the operation. | 537 | * @return Handle that can be used to cancel the operation. |
514 | */ | 538 | */ |
@@ -528,10 +552,14 @@ GNUNET_PSYCSTORE_state_sync (struct GNUNET_PSYCSTORE_Handle *h, | |||
528 | * | 552 | * |
529 | * Delete all state variables stored for the given channel. | 553 | * Delete all state variables stored for the given channel. |
530 | * | 554 | * |
531 | * @param h Handle for the PSYCstore. | 555 | * @param h |
532 | * @param channel_key The channel we are interested in. | 556 | * Handle for the PSYCstore. |
533 | * @param rcb Callback to call with the result of the operation. | 557 | * @param channel_key |
534 | * @param rcb_cls Closure for the callback. | 558 | * The channel we are interested in. |
559 | * @param rcb | ||
560 | * Callback to call with the result of the operation. | ||
561 | * @param rcb_cls | ||
562 | * Closure for the callback. | ||
535 | * | 563 | * |
536 | * @return Handle that can be used to cancel the operation. | 564 | * @return Handle that can be used to cancel the operation. |
537 | */ | 565 | */ |
@@ -546,12 +574,18 @@ GNUNET_PSYCSTORE_state_reset (struct GNUNET_PSYCSTORE_Handle *h, | |||
546 | /** | 574 | /** |
547 | * Update signed values of state variables in the state store. | 575 | * Update signed values of state variables in the state store. |
548 | * | 576 | * |
549 | * @param h Handle for the PSYCstore. | 577 | * @param h |
550 | * @param channel_key The channel we are interested in. | 578 | * Handle for the PSYCstore. |
551 | * @param message_id Message ID that contained the state @a hash. | 579 | * @param channel_key |
552 | * @param hash Hash of the serialized full state. | 580 | * The channel we are interested in. |
553 | * @param rcb Callback to call with the result of the operation. | 581 | * @param message_id |
554 | * @param rcb_cls Closure for the callback. | 582 | * Message ID that contained the state @a hash. |
583 | * @param hash | ||
584 | * Hash of the serialized full state. | ||
585 | * @param rcb | ||
586 | * Callback to call with the result of the operation. | ||
587 | * @param rcb_cls | ||
588 | * Closure for the callback. | ||
555 | * | 589 | * |
556 | */ | 590 | */ |
557 | struct GNUNET_PSYCSTORE_OperationHandle * | 591 | struct GNUNET_PSYCSTORE_OperationHandle * |
@@ -566,11 +600,15 @@ GNUNET_PSYCSTORE_state_hash_update (struct GNUNET_PSYCSTORE_Handle *h, | |||
566 | /** | 600 | /** |
567 | * Function called with the value of a state variable. | 601 | * Function called with the value of a state variable. |
568 | * | 602 | * |
569 | * @param cls Closure. | 603 | * @param cls |
570 | * @param name Name of the state variable. A NULL value indicates that there are no more | 604 | * Closure. |
605 | * @param name | ||
606 | * Name of the state variable. A NULL value indicates that there are no more | ||
571 | * state variables to be returned. | 607 | * state variables to be returned. |
572 | * @param value Value of the state variable. | 608 | * @param value |
573 | * @param value_size Number of bytes in @a value. | 609 | * Value of the state variable. |
610 | * @param value_size | ||
611 | * Number of bytes in @a value. | ||
574 | * | 612 | * |
575 | * @return #GNUNET_NO to stop calling this callback with further variables, | 613 | * @return #GNUNET_NO to stop calling this callback with further variables, |
576 | * #GNUNET_YES to continue. | 614 | * #GNUNET_YES to continue. |
@@ -583,12 +621,18 @@ typedef int | |||
583 | /** | 621 | /** |
584 | * Retrieve the best matching state variable. | 622 | * Retrieve the best matching state variable. |
585 | * | 623 | * |
586 | * @param h Handle for the PSYCstore. | 624 | * @param h |
587 | * @param channel_key The channel we are interested in. | 625 | * Handle for the PSYCstore. |
588 | * @param name Name of variable to match, the returned variable might be less specific. | 626 | * @param channel_key |
589 | * @param scb Callback to return the matching state variable. | 627 | * The channel we are interested in. |
590 | * @param rcb Callback to call with the result of the operation. | 628 | * @param name |
591 | * @param cls Closure for the callbacks. | 629 | * Name of variable to match, the returned variable might be less specific. |
630 | * @param scb | ||
631 | * Callback to return the matching state variable. | ||
632 | * @param rcb | ||
633 | * Callback to call with the result of the operation. | ||
634 | * @param cls | ||
635 | * Closure for the callbacks. | ||
592 | * | 636 | * |
593 | * @return Handle that can be used to cancel the operation. | 637 | * @return Handle that can be used to cancel the operation. |
594 | */ | 638 | */ |
@@ -604,12 +648,18 @@ GNUNET_PSYCSTORE_state_get (struct GNUNET_PSYCSTORE_Handle *h, | |||
604 | /** | 648 | /** |
605 | * Retrieve all state variables for a channel with the given prefix. | 649 | * Retrieve all state variables for a channel with the given prefix. |
606 | * | 650 | * |
607 | * @param h Handle for the PSYCstore. | 651 | * @param h |
608 | * @param channel_key The channel we are interested in. | 652 | * Handle for the PSYCstore. |
609 | * @param name_prefix Prefix of state variable names to match. | 653 | * @param channel_key |
610 | * @param scb Callback to return matching state variables. | 654 | * The channel we are interested in. |
611 | * @param rcb Callback to call with the result of the operation. | 655 | * @param name_prefix |
612 | * @param cls Closure for the callbacks. | 656 | * Prefix of state variable names to match. |
657 | * @param scb | ||
658 | * Callback to return matching state variables. | ||
659 | * @param rcb | ||
660 | * Callback to call with the result of the operation. | ||
661 | * @param cls | ||
662 | * Closure for the callbacks. | ||
613 | * | 663 | * |
614 | * @return Handle that can be used to cancel the operation. | 664 | * @return Handle that can be used to cancel the operation. |
615 | */ | 665 | */ |
diff --git a/src/psycstore/psycstore_api.c b/src/psycstore/psycstore_api.c index 6c90ae569..f5210ac76 100644 --- a/src/psycstore/psycstore_api.c +++ b/src/psycstore/psycstore_api.c | |||
@@ -1180,10 +1180,14 @@ GNUNET_PSYCSTORE_message_get_fragment (struct GNUNET_PSYCSTORE_Handle *h, | |||
1180 | * The current value of counters are needed when a channel master is restarted, | 1180 | * The current value of counters are needed when a channel master is restarted, |
1181 | * so that it can continue incrementing the counters from their last value. | 1181 | * so that it can continue incrementing the counters from their last value. |
1182 | * | 1182 | * |
1183 | * @param h Handle for the PSYCstore. | 1183 | * @param h |
1184 | * @param channel_key Public key that identifies the channel. | 1184 | * Handle for the PSYCstore. |
1185 | * @param ccb Callback to call with the result. | 1185 | * @param channel_key |
1186 | * @param ccb_cls Closure for the @a ccb callback. | 1186 | * Public key that identifies the channel. |
1187 | * @param ccb | ||
1188 | * Callback to call with the result. | ||
1189 | * @param ccb_cls | ||
1190 | * Closure for the @a ccb callback. | ||
1187 | * | 1191 | * |
1188 | * @return Handle that can be used to cancel the operation. | 1192 | * @return Handle that can be used to cancel the operation. |
1189 | */ | 1193 | */ |
@@ -1222,14 +1226,22 @@ GNUNET_PSYCSTORE_counters_get (struct GNUNET_PSYCSTORE_Handle *h, | |||
1222 | * An error is returned if there are missing messages containing state | 1226 | * An error is returned if there are missing messages containing state |
1223 | * operations before the current one. | 1227 | * operations before the current one. |
1224 | * | 1228 | * |
1225 | * @param h Handle for the PSYCstore. | 1229 | * @param h |
1226 | * @param channel_key The channel we are interested in. | 1230 | * Handle for the PSYCstore. |
1227 | * @param message_id ID of the message that contains the @a modifiers. | 1231 | * @param channel_key |
1228 | * @param state_delta Value of the _state_delta PSYC header variable of the message. | 1232 | * The channel we are interested in. |
1229 | * @param modifier_count Number of elements in the @a modifiers array. | 1233 | * @param message_id |
1230 | * @param modifiers List of modifiers to apply. | 1234 | * ID of the message that contains the @a modifiers. |
1231 | * @param rcb Callback to call with the result of the operation. | 1235 | * @param state_delta |
1232 | * @param rcb_cls Closure for the @a rcb callback. | 1236 | * Value of the _state_delta PSYC header variable of the message. |
1237 | * @param modifier_count | ||
1238 | * Number of elements in the @a modifiers array. | ||
1239 | * @param modifiers | ||
1240 | * List of modifiers to apply. | ||
1241 | * @param rcb | ||
1242 | * Callback to call with the result of the operation. | ||
1243 | * @param rcb_cls | ||
1244 | * Closure for the @a rcb callback. | ||
1233 | * | 1245 | * |
1234 | * @return Handle that can be used to cancel the operation. | 1246 | * @return Handle that can be used to cancel the operation. |
1235 | */ | 1247 | */ |
@@ -1292,13 +1304,20 @@ GNUNET_PSYCSTORE_state_modify (struct GNUNET_PSYCSTORE_Handle *h, | |||
1292 | /** | 1304 | /** |
1293 | * Store synchronized state. | 1305 | * Store synchronized state. |
1294 | * | 1306 | * |
1295 | * @param h Handle for the PSYCstore. | 1307 | * @param h |
1296 | * @param channel_key The channel we are interested in. | 1308 | * Handle for the PSYCstore. |
1297 | * @param message_id ID of the message that contains the state_hash PSYC header variable. | 1309 | * @param channel_key |
1298 | * @param modifier_count Number of elements in the @a modifiers array. | 1310 | * The channel we are interested in. |
1299 | * @param modifiers Full state to store. | 1311 | * @param message_id |
1300 | * @param rcb Callback to call with the result of the operation. | 1312 | * ID of the message that contains the state_hash PSYC header variable. |
1301 | * @param rcb_cls Closure for the callback. | 1313 | * @param modifier_count |
1314 | * Number of elements in the @a modifiers array. | ||
1315 | * @param modifiers | ||
1316 | * Full state to store. | ||
1317 | * @param rcb | ||
1318 | * Callback to call with the result of the operation. | ||
1319 | * @param rcb_cls | ||
1320 | * Closure for the callback. | ||
1302 | * | 1321 | * |
1303 | * @return Handle that can be used to cancel the operation. | 1322 | * @return Handle that can be used to cancel the operation. |
1304 | */ | 1323 | */ |
@@ -1357,10 +1376,14 @@ GNUNET_PSYCSTORE_state_sync (struct GNUNET_PSYCSTORE_Handle *h, | |||
1357 | * | 1376 | * |
1358 | * Delete all state variables stored for the given channel. | 1377 | * Delete all state variables stored for the given channel. |
1359 | * | 1378 | * |
1360 | * @param h Handle for the PSYCstore. | 1379 | * @param h |
1361 | * @param channel_key The channel we are interested in. | 1380 | * Handle for the PSYCstore. |
1362 | * @param rcb Callback to call with the result of the operation. | 1381 | * @param channel_key |
1363 | * @param rcb_cls Closure for the callback. | 1382 | * The channel we are interested in. |
1383 | * @param rcb | ||
1384 | * Callback to call with the result of the operation. | ||
1385 | * @param rcb_cls | ||
1386 | * Closure for the callback. | ||
1364 | * | 1387 | * |
1365 | * @return Handle that can be used to cancel the operation. | 1388 | * @return Handle that can be used to cancel the operation. |
1366 | */ | 1389 | */ |
@@ -1398,13 +1421,18 @@ GNUNET_PSYCSTORE_state_reset (struct GNUNET_PSYCSTORE_Handle *h, | |||
1398 | /** | 1421 | /** |
1399 | * Update signed values of state variables in the state store. | 1422 | * Update signed values of state variables in the state store. |
1400 | * | 1423 | * |
1401 | * @param h Handle for the PSYCstore. | 1424 | * @param h |
1402 | * @param channel_key The channel we are interested in. | 1425 | * Handle for the PSYCstore. |
1403 | * @param message_id Message ID that contained the state @a hash. | 1426 | * @param channel_key |
1404 | * @param hash Hash of the serialized full state. | 1427 | * The channel we are interested in. |
1405 | * @param rcb Callback to call with the result of the operation. | 1428 | * @param message_id |
1406 | * @param rcb_cls Closure for the callback. | 1429 | * Message ID that contained the state @a hash. |
1407 | * | 1430 | * @param hash |
1431 | * Hash of the serialized full state. | ||
1432 | * @param rcb | ||
1433 | * Callback to call with the result of the operation. | ||
1434 | * @param rcb_cls | ||
1435 | * Closure for the callback. | ||
1408 | */ | 1436 | */ |
1409 | struct GNUNET_PSYCSTORE_OperationHandle * | 1437 | struct GNUNET_PSYCSTORE_OperationHandle * |
1410 | GNUNET_PSYCSTORE_state_hash_update (struct GNUNET_PSYCSTORE_Handle *h, | 1438 | GNUNET_PSYCSTORE_state_hash_update (struct GNUNET_PSYCSTORE_Handle *h, |
@@ -1441,12 +1469,18 @@ GNUNET_PSYCSTORE_state_hash_update (struct GNUNET_PSYCSTORE_Handle *h, | |||
1441 | /** | 1469 | /** |
1442 | * Retrieve the best matching state variable. | 1470 | * Retrieve the best matching state variable. |
1443 | * | 1471 | * |
1444 | * @param h Handle for the PSYCstore. | 1472 | * @param h |
1445 | * @param channel_key The channel we are interested in. | 1473 | * Handle for the PSYCstore. |
1446 | * @param name Name of variable to match, the returned variable might be less specific. | 1474 | * @param channel_key |
1447 | * @param scb Callback to return the matching state variable. | 1475 | * The channel we are interested in. |
1448 | * @param rcb Callback to call with the result of the operation. | 1476 | * @param name |
1449 | * @param cls Closure for the callbacks. | 1477 | * Name of variable to match, the returned variable might be less specific. |
1478 | * @param scb | ||
1479 | * Callback to return the matching state variable. | ||
1480 | * @param rcb | ||
1481 | * Callback to call with the result of the operation. | ||
1482 | * @param cls | ||
1483 | * Closure for the callbacks. | ||
1450 | * | 1484 | * |
1451 | * @return Handle that can be used to cancel the operation. | 1485 | * @return Handle that can be used to cancel the operation. |
1452 | */ | 1486 | */ |
@@ -1488,12 +1522,18 @@ GNUNET_PSYCSTORE_state_get (struct GNUNET_PSYCSTORE_Handle *h, | |||
1488 | /** | 1522 | /** |
1489 | * Retrieve all state variables for a channel with the given prefix. | 1523 | * Retrieve all state variables for a channel with the given prefix. |
1490 | * | 1524 | * |
1491 | * @param h Handle for the PSYCstore. | 1525 | * @param h |
1492 | * @param channel_key The channel we are interested in. | 1526 | * Handle for the PSYCstore. |
1493 | * @param name_prefix Prefix of state variable names to match. | 1527 | * @param channel_key |
1494 | * @param scb Callback to return matching state variables. | 1528 | * The channel we are interested in. |
1495 | * @param rcb Callback to call with the result of the operation. | 1529 | * @param name_prefix |
1496 | * @param cls Closure for the callbacks. | 1530 | * Prefix of state variable names to match. |
1531 | * @param scb | ||
1532 | * Callback to return matching state variables. | ||
1533 | * @param rcb | ||
1534 | * Callback to call with the result of the operation. | ||
1535 | * @param cls | ||
1536 | * Closure for the callbacks. | ||
1497 | * | 1537 | * |
1498 | * @return Handle that can be used to cancel the operation. | 1538 | * @return Handle that can be used to cancel the operation. |
1499 | */ | 1539 | */ |