+ // If we have a valid record type and a target database open, dispatch the correct record type handler.
+ memset(&out_key, 0, sizeof(DBT));
+ memset(&out_data, 0, sizeof(DBT));
+ row_was_good = 0;
+ if (!strcasecmp(record_type, "msgtext")) row_was_good = convert_msgtext(line, &out_key, &out_data);
+ else if (!strcasecmp(record_type, "msgmeta")) row_was_good = convert_foo(line, &out_key, &out_data);
+ else if (!strcasecmp(record_type, "user")) row_was_good = convert_foo(line, &out_key, &out_data);
+ else if (!strcasecmp(record_type, "room")) row_was_good = convert_foo(line, &out_key, &out_data);
+ else if (!strcasecmp(record_type, "floor")) row_was_good = convert_foo(line, &out_key, &out_data);
+ else if (!strcasecmp(record_type, "msglist")) row_was_good = convert_foo(line, &out_key, &out_data);
+ else if (!strcasecmp(record_type, "visit")) row_was_good = convert_foo(line, &out_key, &out_data);
+ else if (!strcasecmp(record_type, "dir")) row_was_good = convert_foo(line, &out_key, &out_data);
+ else if (!strcasecmp(record_type, "use")) row_was_good = convert_foo(line, &out_key, &out_data);
+ else if (!strcasecmp(record_type, "bigmsg")) row_was_good = convert_foo(line, &out_key, &out_data);
+ else if (!strcasecmp(record_type, "euidindex")) row_was_good = convert_foo(line, &out_key, &out_data);
+ else if (!strcasecmp(record_type, "usersbynumber")) row_was_good = convert_foo(line, &out_key, &out_data);
+ else if (!strcasecmp(record_type, "config")) row_was_good = convert_foo(line, &out_key, &out_data);
+ else row_was_good = 0;
+
+ if (row_was_good) {
+ ret = dst_dbp->put(dst_dbp, NULL, &out_key, &out_data, 0);
+ if (ret) {
+ fprintf(stderr, "db: cdb_put(%d): %s", current_cdb, db_strerror(ret));
+ exit(CTDLEXIT_DB);
+ }
+ }
+
+ free(out_key.data);
+ free(out_data.data);