struct GNUNET_NAMESTORE_QueueEntry *next;
struct GNUNET_NAMESTORE_QueueEntry *prev;
+ struct GNUNET_NAMESTORE_Handle *nsh;
+
uint64_t op_id;
GNUNET_NAMESTORE_ContinuationWithStatus cont;
};
+/**
+ * Zone iterator
+ */
+struct GNUNET_NAMESTORE_ZoneIterator
+{
+ struct GNUNET_NAMESTORE_ZoneIterator *next;
+ struct GNUNET_NAMESTORE_ZoneIterator *prev;
+
+ struct GNUNET_NAMESTORE_Handle *h;
+ GNUNET_NAMESTORE_RecordProcessor proc;
+ void* proc_cls;
+ const GNUNET_HashCode * zone;
+ uint32_t no_flags;
+ uint32_t flags;
+};
+
+
/**
* Message in linked list we should send to the service. The
* actual binary message follows this struct.
/**
- * Pending namestore operations
+ * Pending namestore queue entries
*/
-
struct GNUNET_NAMESTORE_QueueEntry * op_head;
struct GNUNET_NAMESTORE_QueueEntry * op_tail;
uint64_t op_id;
+
+ /**
+ * Pending namestore zone iterator entries
+ */
+ struct GNUNET_NAMESTORE_ZoneIterator * z_head;
+ struct GNUNET_NAMESTORE_ZoneIterator * z_tail;
};
struct GNUNET_NAMESTORE_SimpleRecord
const void *data;
};
+
/**
* Disconnect from service and then reconnect.
*
{
struct PendingMessage *p;
struct GNUNET_NAMESTORE_QueueEntry *q;
+ struct GNUNET_NAMESTORE_ZoneIterator *z;
+
+ GNUNET_assert (nsh != NULL);
while (NULL != (p = nsh->pending_head))
{
GNUNET_free (q);
}
+ while (NULL != (z = nsh->z_head))
+ {
+ GNUNET_CONTAINER_DLL_remove (nsh->z_head, nsh->z_tail, z);
+ GNUNET_free (z);
+ }
+
if (NULL != nsh->client)
{
GNUNET_CLIENT_disconnect (nsh->client, GNUNET_NO);
GNUNET_assert (NULL != h);
qe = GNUNET_malloc(sizeof (struct GNUNET_NAMESTORE_QueueEntry));
+ qe->nsh = h;
qe->cont = cont;
qe->cont_cls = cont_cls;
enqeue_namestore_operation(h, qe);
GNUNET_assert (NULL != h);
qe = GNUNET_malloc(sizeof (struct GNUNET_NAMESTORE_QueueEntry));
+ qe->nsh = h;
qe->cont = cont;
qe->cont_cls = cont_cls;
enqeue_namestore_operation(h, qe);
GNUNET_assert (NULL != h);
qe = GNUNET_malloc(sizeof (struct GNUNET_NAMESTORE_QueueEntry));
+ qe->nsh = h;
qe->cont = cont;
qe->cont_cls = cont_cls;
enqeue_namestore_operation(h, qe);
GNUNET_assert (NULL != h);
qe = GNUNET_malloc(sizeof (struct GNUNET_NAMESTORE_QueueEntry));
+ qe->nsh = h;
qe->proc = proc;
qe->proc_cls = proc_cls;
enqeue_namestore_operation(h, qe);
GNUNET_NAMESTORE_RecordProcessor proc,
void *proc_cls)
{
- return NULL;
+ struct GNUNET_NAMESTORE_ZoneIterator *it;
+
+ GNUNET_assert (h != NULL);
+
+ it = GNUNET_malloc (sizeof (struct GNUNET_NAMESTORE_ZoneIterator));
+ it->h = h;
+ it->proc = proc;
+ it->proc_cls = proc;
+ GNUNET_CONTAINER_DLL_insert(h->z_head, h->z_tail, it);
+
+ return it;
}
void
GNUNET_NAMESTORE_zone_iterator_next (struct GNUNET_NAMESTORE_ZoneIterator *it)
{
+
}
void
GNUNET_NAMESTORE_zone_iteration_stop (struct GNUNET_NAMESTORE_ZoneIterator *it)
{
+ struct GNUNET_NAMESTORE_Handle * nsh;
+ GNUNET_assert (it != NULL);
+
+ nsh = it->h;
+ GNUNET_CONTAINER_DLL_remove (nsh->z_head, nsh->z_tail, it);
+ GNUNET_free (it);
+
}
void
GNUNET_NAMESTORE_cancel (struct GNUNET_NAMESTORE_QueueEntry *qe)
{
- if (qe)
- GNUNET_free(qe);
+ struct GNUNET_NAMESTORE_Handle *nsh = qe->nsh;
+
+ GNUNET_assert (qe != NULL);
+
+ GNUNET_CONTAINER_DLL_remove(nsh->op_head, nsh->op_tail, qe);
+ GNUNET_free(qe);
+
}
/* end of namestore_api.c */