print active/inactive information
[oweals/gnunet.git] / src / include / gnunet_peerstore_plugin.h
index ce473b508a6cda65ba543c30cd122ac157e443f8..8eea796bb7857f13e7957af34d147f3d68509fc3 100644 (file)
@@ -38,22 +38,6 @@ extern "C"
 #endif
 
 
-/**
- * Function called by for each matching record.
- *
- * @param cls closure
- * @param peer peer identity
- * @param sub_system name of the GNUnet sub system responsible
- * @param value stored value
- * @param size size of stored value
- */
-typedef void (*GNUNET_PEERSTORE_RecordIterator) (void *cls,
-    const char *sub_system,
-    const struct GNUNET_PeerIdentity *peer,
-    const char *key,
-    const void *value,
-    size_t size);
-
 /**
  * @brief struct returned by the initialization function of the plugin
  */
@@ -84,7 +68,8 @@ struct GNUNET_PEERSTORE_PluginFunctions
       const char *key,
       const void *value,
       size_t size,
-      struct GNUNET_TIME_Absolute expiry);
+      struct GNUNET_TIME_Absolute expiry,
+      enum GNUNET_PEERSTORE_StoreOption options);
 
   /**
    * Iterate over the records given an optional peer id
@@ -103,7 +88,18 @@ struct GNUNET_PEERSTORE_PluginFunctions
       const char *sub_system,
       const struct GNUNET_PeerIdentity *peer,
       const char *key,
-      GNUNET_PEERSTORE_RecordIterator iter, void *iter_cls);
+      GNUNET_PEERSTORE_Processor iter, void *iter_cls);
+
+  /**
+   * Delete expired records (expiry < now)
+   *
+   * @param cls closure (internal context for the plugin)
+   * @param now time to use as reference
+   * @return number of records deleted
+   */
+  int
+  (*expire_records) (void *cls,
+      struct GNUNET_TIME_Absolute now);
 
 };