+ int i, j;
+ char buf[256];
+
+ struct {
+ char name[128];
+ } *rooms = NULL;
+ int num_roomnames = 0;
+ int num_roomnames_alloc = 0;
+
+
+ /* load the roomnames */
+ serv_puts("LKRA");
+ serv_getln(buf, sizeof buf);
+ if (buf[0] == '1') {
+ while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
+ ++num_roomnames;
+ if (num_roomnames > num_roomnames_alloc) {
+ num_roomnames_alloc += 250;
+ rooms = realloc(rooms, (num_roomnames_alloc * 128));
+ }
+ extract_token(rooms[num_roomnames-1].name, buf, 0, '|', 128);
+ }
+ }
+