| 83 | } |
| 84 | |
| 85 | void |
| 86 | genl_outrip(winid tmpwin, int how, time_t when) |
| 87 | { |
| 88 | char **dp; |
| 89 | char *dpx; |
| 90 | char buf[BUFSZ]; |
| 91 | int x; |
| 92 | int line, year; |
| 93 | long cash; |
| 94 | |
| 95 | gr.rip = dp = (char **) alloc(sizeof(rip_txt)); |
| 96 | for (x = 0; rip_txt[x]; ++x) |
| 97 | dp[x] = dupstr(rip_txt[x]); |
| 98 | dp[x] = (char *) 0; |
| 99 | |
| 100 | /* Put name on stone */ |
| 101 | Sprintf(buf, "%.*s", (int) STONE_LINE_LEN, svp.plname); |
| 102 | center(NAME_LINE, buf); |
| 103 | |
| 104 | /* Put $ on stone */ |
| 105 | cash = max(gd.done_money, 0L); |
| 106 | /* arbitrary upper limit; practical upper limit is quite a bit less */ |
| 107 | if (cash > 999999999L) |
| 108 | cash = 999999999L; |
| 109 | Sprintf(buf, "%ld Au", cash); |
| 110 | center(GOLD_LINE, buf); |
| 111 | |
| 112 | /* Put together death description */ |
| 113 | formatkiller(buf, sizeof buf, how, FALSE); |
| 114 | |
| 115 | /* Put death type on stone */ |
| 116 | for (line = DEATH_LINE, dpx = buf; line < YEAR_LINE; line++) { |
| 117 | char tmpchar; |
| 118 | int i, i0 = (int) strlen(dpx); |
| 119 | |
| 120 | if (i0 > STONE_LINE_LEN) { |
| 121 | for (i = STONE_LINE_LEN; (i > 0) && (i0 > STONE_LINE_LEN); --i) |
| 122 | if (dpx[i] == ' ') |
| 123 | i0 = i; |
| 124 | if (!i) |
| 125 | i0 = STONE_LINE_LEN; |
| 126 | } |
| 127 | tmpchar = dpx[i0]; |
| 128 | dpx[i0] = 0; |
| 129 | center(line, dpx); |
| 130 | if (tmpchar != ' ') { |
| 131 | dpx[i0] = tmpchar; |
| 132 | dpx = &dpx[i0]; |
| 133 | } else |
| 134 | dpx = &dpx[i0 + 1]; |
| 135 | } |
| 136 | |
| 137 | /* Put year on stone */ |
| 138 | year = (int) ((yyyymmdd(when) / 10000L) % 10000L); |
| 139 | Sprintf(buf, "%4d", year); |
| 140 | center(YEAR_LINE, buf); |
| 141 | |
| 142 | #ifdef DUMPLOG |
no test coverage detected