* Used if only one of a collection of objects is named (e.g. in eat.c). */
| 2088 | * Used if only one of a collection of objects is named (e.g. in eat.c). |
| 2089 | */ |
| 2090 | const char * |
| 2091 | singular(struct obj *otmp, char *(*func)(OBJ_P)) |
| 2092 | { |
| 2093 | long savequan; |
| 2094 | char *nam; |
| 2095 | |
| 2096 | /* using xname for corpses does not give the monster type */ |
| 2097 | if (otmp->otyp == CORPSE && func == xname) |
| 2098 | func = cxname; |
| 2099 | |
| 2100 | savequan = otmp->quan; |
| 2101 | otmp->quan = 1L; |
| 2102 | nam = (*func)(otmp); |
| 2103 | otmp->quan = savequan; |
| 2104 | return nam; |
| 2105 | } |
| 2106 | |
| 2107 | /* pick "", "a ", or "an " as article for 'str'; used by an() and doname() */ |
| 2108 | char * |
no outgoing calls
no test coverage detected