(xdhdr,xdhdr1,xditem,xdmeta,xdopt,xdver,xdfldnam):
Remove the column header. Not need as the xdump meta is functional.
This commit is contained in:
parent
ba5b1b0a79
commit
a16b3266ff
1 changed files with 7 additions and 51 deletions
|
@ -163,41 +163,13 @@ xdflds(struct castr ca[], void *ptr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Dump field names; CA[] describes fields. */
|
|
||||||
static void
|
|
||||||
xdfldnam(struct castr ca[])
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
char *sep = "";
|
|
||||||
|
|
||||||
for (i = 0; ca[i].ca_name; ++i) {
|
|
||||||
if (ca[i].ca_flags & NSC_DEITY && !player->god)
|
|
||||||
continue;
|
|
||||||
if (ca[i].ca_flags & NSC_EXTRA)
|
|
||||||
continue;
|
|
||||||
pr("%s%s", sep, ca[i].ca_name);
|
|
||||||
if (ca[i].ca_len && ca[i].ca_type != NSC_STRINGY)
|
|
||||||
pr(" %d", ca[i].ca_len);
|
|
||||||
sep = " ";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Dump first line of header for dump NAME. */
|
/* Dump first line of header for dump NAME. */
|
||||||
static void
|
static void
|
||||||
xdhdr1(char *name, int meta)
|
xdhdr(char *name, int meta)
|
||||||
{
|
{
|
||||||
pr("XDUMP %s%s %ld\n", meta ? "meta " : "", name, (long)time(NULL));
|
pr("XDUMP %s%s %ld\n", meta ? "meta " : "", name, (long)time(NULL));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Dump header for dump NAME with fields described by CA[]. */
|
|
||||||
static void
|
|
||||||
xdhdr(char *name, struct castr ca[], int meta)
|
|
||||||
{
|
|
||||||
xdhdr1(name, meta);
|
|
||||||
xdfldnam(ca);
|
|
||||||
pr("\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Dump footer for a dump that dumped N objects. */
|
/* Dump footer for a dump that dumped N objects. */
|
||||||
static void
|
static void
|
||||||
xdftr(int n)
|
xdftr(int n)
|
||||||
|
@ -225,7 +197,7 @@ xditem(int type, char *arg)
|
||||||
if (!snxtitem(&ni, type, arg))
|
if (!snxtitem(&ni, type, arg))
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
|
|
||||||
xdhdr(ef_nameof(type), ca, 0);
|
xdhdr(ef_nameof(type), 0);
|
||||||
|
|
||||||
n = 0;
|
n = 0;
|
||||||
while (nxtitem(&ni, buf)) {
|
while (nxtitem(&ni, buf)) {
|
||||||
|
@ -255,7 +227,7 @@ xdmeta(int type)
|
||||||
if (!ca)
|
if (!ca)
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
|
|
||||||
xdhdr(ef_nameof(type), mdchr_ca, 1);
|
xdhdr(ef_nameof(type), 1);
|
||||||
|
|
||||||
for (i = 0; ca[i].ca_name; i++) {
|
for (i = 0; ca[i].ca_name; i++) {
|
||||||
if (ca[i].ca_flags & NSC_DEITY && !player->god)
|
if (ca[i].ca_flags & NSC_DEITY && !player->god)
|
||||||
|
@ -281,7 +253,7 @@ xdopt(int meta)
|
||||||
struct castr ca;
|
struct castr ca;
|
||||||
|
|
||||||
if (meta) {
|
if (meta) {
|
||||||
xdhdr("options", mdchr_ca, 1);
|
xdhdr("options", 1);
|
||||||
for (i = 0; Options[i].opt_key; ++i) {
|
for (i = 0; Options[i].opt_key; ++i) {
|
||||||
ca.ca_type = NSC_INT;
|
ca.ca_type = NSC_INT;
|
||||||
ca.ca_flags = 0;
|
ca.ca_flags = 0;
|
||||||
|
@ -296,14 +268,7 @@ xdopt(int meta)
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
xdhdr1("options" , 0);
|
xdhdr("options", 0);
|
||||||
|
|
||||||
sep = "";
|
|
||||||
for (i = 0; Options[i].opt_key; ++i) {
|
|
||||||
pr("%s%s", sep, Options[i].opt_key);
|
|
||||||
sep = " ";
|
|
||||||
}
|
|
||||||
pr("\n");
|
|
||||||
|
|
||||||
sep = "";
|
sep = "";
|
||||||
for (i = 0; Options[i].opt_key; ++i) {
|
for (i = 0; Options[i].opt_key; ++i) {
|
||||||
|
@ -327,7 +292,7 @@ xdver(int meta)
|
||||||
struct valstr val;
|
struct valstr val;
|
||||||
|
|
||||||
if (meta) {
|
if (meta) {
|
||||||
xdhdr("version", mdchr_ca, 1);
|
xdhdr("version", 1);
|
||||||
n = 0;
|
n = 0;
|
||||||
for (kp = configkeys; kp->km_key; ++kp) {
|
for (kp = configkeys; kp->km_key; ++kp) {
|
||||||
if (kp->km_type != NSC_NOTYPE && !(kp->km_flags & KM_INTERNAL)) {
|
if (kp->km_type != NSC_NOTYPE && !(kp->km_flags & KM_INTERNAL)) {
|
||||||
|
@ -346,16 +311,7 @@ xdver(int meta)
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
xdhdr1("version", 0);
|
xdhdr("version", 0);
|
||||||
|
|
||||||
sep = "";
|
|
||||||
for (kp = configkeys; kp->km_key; ++kp) {
|
|
||||||
if (kp->km_type != NSC_NOTYPE && !(kp->km_flags & KM_INTERNAL)) {
|
|
||||||
pr("%s%s", sep, kp->km_key);
|
|
||||||
sep = " ";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pr("\n");
|
|
||||||
|
|
||||||
sep = "";
|
sep = "";
|
||||||
for (kp = configkeys; kp->km_key; ++kp) {
|
for (kp = configkeys; kp->km_key; ++kp) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue