MCPcopy Create free account
hub / github.com/NetHack/NetHack / trace_yn_function

Function trace_yn_function

win/chain/wc_trace.c:801–846  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

799}
800
801char
802trace_yn_function(
803 void *vp,
804 const char *query,
805 const char *resp,
806 char def)
807{
808 struct trace_data *tdp = vp;
809 char rv;
810 char buf[10];
811
812 if (query) {
813 fprintf(wc_tracelogf, "%syn_function('%s'(%d), ", INDENT, query,
814 (int) strlen(query));
815 } else {
816 fprintf(wc_tracelogf, "%syn_function(NULL, ", INDENT);
817 }
818
819 if (resp) {
820 fprintf(wc_tracelogf, "'%s'(%d), ", resp, (int) strlen(resp));
821 } else {
822 fprintf(wc_tracelogf, "NULL, ");
823 }
824
825 if (isprint(def)) {
826 sprintf(buf, "'%c'(%d)", def, def);
827 } else {
828 sprintf(buf, "(%d)", def);
829 }
830
831 fprintf(wc_tracelogf, "%s)\n", buf);
832
833 PRE;
834 rv = (*tdp->nprocs->win_yn_function)(tdp->ndata, query, resp, def);
835 POST;
836
837 if (isprint(rv)) {
838 sprintf(buf, "'%c'(%d)", rv, rv);
839 } else {
840 sprintf(buf, "(%d)", rv);
841 }
842
843 fprintf(wc_tracelogf, "%s=> %s\n", INDENT, buf);
844
845 return rv;
846}
847
848void
849trace_getlin(

Callers

nothing calls this directly

Calls 2

fprintfFunction · 0.85
isprintFunction · 0.85

Tested by

no test coverage detected