diff options
Diffstat (limited to 'src/datastore/plugin_datastore_sqlite.c')
-rw-r--r-- | src/datastore/plugin_datastore_sqlite.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/datastore/plugin_datastore_sqlite.c b/src/datastore/plugin_datastore_sqlite.c index 00195fb13..40b4de33e 100644 --- a/src/datastore/plugin_datastore_sqlite.c +++ b/src/datastore/plugin_datastore_sqlite.c | |||
@@ -480,7 +480,7 @@ delete_by_rowid (struct Plugin *plugin, unsigned long long rid) | |||
480 | * @return GNUNET_OK on success | 480 | * @return GNUNET_OK on success |
481 | */ | 481 | */ |
482 | static int | 482 | static int |
483 | sqlite_plugin_put (void *cls, const GNUNET_HashCode * key, uint32_t size, | 483 | sqlite_plugin_put (void *cls, const struct GNUNET_HashCode * key, uint32_t size, |
484 | const void *data, enum GNUNET_BLOCK_Type type, | 484 | const void *data, enum GNUNET_BLOCK_Type type, |
485 | uint32_t priority, uint32_t anonymity, uint32_t replication, | 485 | uint32_t priority, uint32_t anonymity, uint32_t replication, |
486 | struct GNUNET_TIME_Absolute expiration, char **msg) | 486 | struct GNUNET_TIME_Absolute expiration, char **msg) |
@@ -489,7 +489,7 @@ sqlite_plugin_put (void *cls, const GNUNET_HashCode * key, uint32_t size, | |||
489 | int n; | 489 | int n; |
490 | int ret; | 490 | int ret; |
491 | sqlite3_stmt *stmt; | 491 | sqlite3_stmt *stmt; |
492 | GNUNET_HashCode vhash; | 492 | struct GNUNET_HashCode vhash; |
493 | uint64_t rvalue; | 493 | uint64_t rvalue; |
494 | 494 | ||
495 | if (size > MAX_ITEM_SIZE) | 495 | if (size > MAX_ITEM_SIZE) |
@@ -510,10 +510,10 @@ sqlite_plugin_put (void *cls, const GNUNET_HashCode * key, uint32_t size, | |||
510 | (SQLITE_OK != sqlite3_bind_int64 (stmt, 5, expiration.abs_value)) || | 510 | (SQLITE_OK != sqlite3_bind_int64 (stmt, 5, expiration.abs_value)) || |
511 | (SQLITE_OK != sqlite3_bind_int64 (stmt, 6, rvalue)) || | 511 | (SQLITE_OK != sqlite3_bind_int64 (stmt, 6, rvalue)) || |
512 | (SQLITE_OK != | 512 | (SQLITE_OK != |
513 | sqlite3_bind_blob (stmt, 7, key, sizeof (GNUNET_HashCode), | 513 | sqlite3_bind_blob (stmt, 7, key, sizeof (struct GNUNET_HashCode), |
514 | SQLITE_TRANSIENT)) || | 514 | SQLITE_TRANSIENT)) || |
515 | (SQLITE_OK != | 515 | (SQLITE_OK != |
516 | sqlite3_bind_blob (stmt, 8, &vhash, sizeof (GNUNET_HashCode), | 516 | sqlite3_bind_blob (stmt, 8, &vhash, sizeof (struct GNUNET_HashCode), |
517 | SQLITE_TRANSIENT)) || | 517 | SQLITE_TRANSIENT)) || |
518 | (SQLITE_OK != sqlite3_bind_blob (stmt, 9, data, size, SQLITE_TRANSIENT))) | 518 | (SQLITE_OK != sqlite3_bind_blob (stmt, 9, data, size, SQLITE_TRANSIENT))) |
519 | { | 519 | { |
@@ -648,7 +648,7 @@ execute_get (struct Plugin *plugin, sqlite3_stmt * stmt, | |||
648 | case SQLITE_ROW: | 648 | case SQLITE_ROW: |
649 | size = sqlite3_column_bytes (stmt, 5); | 649 | size = sqlite3_column_bytes (stmt, 5); |
650 | rowid = sqlite3_column_int64 (stmt, 6); | 650 | rowid = sqlite3_column_int64 (stmt, 6); |
651 | if (sqlite3_column_bytes (stmt, 4) != sizeof (GNUNET_HashCode)) | 651 | if (sqlite3_column_bytes (stmt, 4) != sizeof (struct GNUNET_HashCode)) |
652 | { | 652 | { |
653 | GNUNET_log_from (GNUNET_ERROR_TYPE_WARNING, "sqlite", | 653 | GNUNET_log_from (GNUNET_ERROR_TYPE_WARNING, "sqlite", |
654 | _ | 654 | _ |
@@ -768,8 +768,8 @@ sqlite_plugin_get_zero_anonymity (void *cls, uint64_t offset, | |||
768 | * @param proc_cls closure for proc | 768 | * @param proc_cls closure for proc |
769 | */ | 769 | */ |
770 | static void | 770 | static void |
771 | sqlite_plugin_get_key (void *cls, uint64_t offset, const GNUNET_HashCode * key, | 771 | sqlite_plugin_get_key (void *cls, uint64_t offset, const struct GNUNET_HashCode * key, |
772 | const GNUNET_HashCode * vhash, | 772 | const struct GNUNET_HashCode * vhash, |
773 | enum GNUNET_BLOCK_Type type, PluginDatumProcessor proc, | 773 | enum GNUNET_BLOCK_Type type, PluginDatumProcessor proc, |
774 | void *proc_cls) | 774 | void *proc_cls) |
775 | { | 775 | { |
@@ -796,11 +796,11 @@ sqlite_plugin_get_key (void *cls, uint64_t offset, const GNUNET_HashCode * key, | |||
796 | } | 796 | } |
797 | sqoff = 1; | 797 | sqoff = 1; |
798 | ret = | 798 | ret = |
799 | sqlite3_bind_blob (stmt, sqoff++, key, sizeof (GNUNET_HashCode), | 799 | sqlite3_bind_blob (stmt, sqoff++, key, sizeof (struct GNUNET_HashCode), |
800 | SQLITE_TRANSIENT); | 800 | SQLITE_TRANSIENT); |
801 | if ((vhash != NULL) && (ret == SQLITE_OK)) | 801 | if ((vhash != NULL) && (ret == SQLITE_OK)) |
802 | ret = | 802 | ret = |
803 | sqlite3_bind_blob (stmt, sqoff++, vhash, sizeof (GNUNET_HashCode), | 803 | sqlite3_bind_blob (stmt, sqoff++, vhash, sizeof (struct GNUNET_HashCode), |
804 | SQLITE_TRANSIENT); | 804 | SQLITE_TRANSIENT); |
805 | if ((type != 0) && (ret == SQLITE_OK)) | 805 | if ((type != 0) && (ret == SQLITE_OK)) |
806 | ret = sqlite3_bind_int (stmt, sqoff++, type); | 806 | ret = sqlite3_bind_int (stmt, sqoff++, type); |
@@ -845,11 +845,11 @@ sqlite_plugin_get_key (void *cls, uint64_t offset, const GNUNET_HashCode * key, | |||
845 | } | 845 | } |
846 | sqoff = 1; | 846 | sqoff = 1; |
847 | ret = | 847 | ret = |
848 | sqlite3_bind_blob (stmt, sqoff++, key, sizeof (GNUNET_HashCode), | 848 | sqlite3_bind_blob (stmt, sqoff++, key, sizeof (struct GNUNET_HashCode), |
849 | SQLITE_TRANSIENT); | 849 | SQLITE_TRANSIENT); |
850 | if ((vhash != NULL) && (ret == SQLITE_OK)) | 850 | if ((vhash != NULL) && (ret == SQLITE_OK)) |
851 | ret = | 851 | ret = |
852 | sqlite3_bind_blob (stmt, sqoff++, vhash, sizeof (GNUNET_HashCode), | 852 | sqlite3_bind_blob (stmt, sqoff++, vhash, sizeof (struct GNUNET_HashCode), |
853 | SQLITE_TRANSIENT); | 853 | SQLITE_TRANSIENT); |
854 | if ((type != 0) && (ret == SQLITE_OK)) | 854 | if ((type != 0) && (ret == SQLITE_OK)) |
855 | ret = sqlite3_bind_int (stmt, sqoff++, type); | 855 | ret = sqlite3_bind_int (stmt, sqoff++, type); |
@@ -916,7 +916,7 @@ struct ReplCtx | |||
916 | * GNUNET_NO to delete the item | 916 | * GNUNET_NO to delete the item |
917 | */ | 917 | */ |
918 | static int | 918 | static int |
919 | repl_proc (void *cls, const GNUNET_HashCode * key, uint32_t size, | 919 | repl_proc (void *cls, const struct GNUNET_HashCode * key, uint32_t size, |
920 | const void *data, enum GNUNET_BLOCK_Type type, uint32_t priority, | 920 | const void *data, enum GNUNET_BLOCK_Type type, uint32_t priority, |
921 | uint32_t anonymity, struct GNUNET_TIME_Absolute expiration, | 921 | uint32_t anonymity, struct GNUNET_TIME_Absolute expiration, |
922 | uint64_t uid) | 922 | uint64_t uid) |
@@ -1076,7 +1076,7 @@ sqlite_plugin_get_keys (void *cls, | |||
1076 | void *proc_cls) | 1076 | void *proc_cls) |
1077 | { | 1077 | { |
1078 | struct Plugin *plugin = cls; | 1078 | struct Plugin *plugin = cls; |
1079 | const GNUNET_HashCode *key; | 1079 | const struct GNUNET_HashCode *key; |
1080 | sqlite3_stmt *stmt; | 1080 | sqlite3_stmt *stmt; |
1081 | int ret; | 1081 | int ret; |
1082 | 1082 | ||
@@ -1090,7 +1090,7 @@ sqlite_plugin_get_keys (void *cls, | |||
1090 | while (SQLITE_ROW == (ret = sqlite3_step (stmt))) | 1090 | while (SQLITE_ROW == (ret = sqlite3_step (stmt))) |
1091 | { | 1091 | { |
1092 | key = sqlite3_column_blob (stmt, 1); | 1092 | key = sqlite3_column_blob (stmt, 1); |
1093 | if (sizeof (GNUNET_HashCode) == sqlite3_column_bytes (stmt, 1)) | 1093 | if (sizeof (struct GNUNET_HashCode) == sqlite3_column_bytes (stmt, 1)) |
1094 | proc (proc_cls, key, 1); | 1094 | proc (proc_cls, key, 1); |
1095 | } | 1095 | } |
1096 | if (SQLITE_DONE != ret) | 1096 | if (SQLITE_DONE != ret) |