cdb_next_item() is always preceded by a call to cdb_rewind() before the
iteration loop. We're going to remove the cursor from thread-specific
data, and replace it with a void pointer that the caller is responsible
for passing back. This will make the backend drivers easier to build.
struct cdbdata *cdbqr;
cdb_rewind(CDB_ROOMS);
-
while (cdbqr = cdb_next_item(CDB_ROOMS), cdbqr != NULL) {
memset(&qrbuf, 0, sizeof(struct ctdlroom));
memcpy(&qrbuf, cdbqr->ptr, ((cdbqr->len > sizeof(struct ctdlroom)) ? sizeof(struct ctdlroom) : cdbqr->len) );
return;
}
-
- cdb_rewind(CDB_USERS);
-
// Phase 1 : build an array of all our user account names
+ cdb_rewind(CDB_USERS);
while (cdbus = cdb_next_item(CDB_USERS), cdbus != NULL) {
usptr = (struct ctdluser *) cdbus->ptr;
if (strlen(usptr->fullname) > 0) {