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

Function put_ext_cmd

sys/amiga/winami.c:951–993  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

949}
950
951static int
952put_ext_cmd(char *obufp, int colx, struct amii_WinDesc *cw, int bottom)
953{
954 struct Window *w = cw->win;
955 char *t;
956
957 t = (char *) alloc(strlen(obufp) + 7);
958 if (t != NULL) {
959 if (scrollmsg) {
960 sprintf(t, "xxx%s", obufp);
961 t[0] = 1;
962 t[1] = 1;
963 t[2] = '#';
964 amii_curs(WIN_MESSAGE, 0, bottom);
965 SetAPen(w->RPort, C_WHITE);
966 Text(w->RPort, "># ", 3);
967 /* SetAPen( w->RPort, C_BLACK ); */ /* Black text on black
968 * screen doesn't look
969 * too well ... -jhsa */
970 Text(w->RPort, t + 3, strlen(t) - 3);
971 } else {
972 sprintf(t, "# %s", obufp);
973 amii_curs(WIN_MESSAGE, 0, bottom);
974 SetAPen(w->RPort, C_WHITE);
975 Text(w->RPort, t, strlen(t));
976 }
977 if (scrollmsg)
978 SetAPen(w->RPort, C_WHITE);
979 if (cw->data[cw->maxrow - 1])
980 free(cw->data[cw->maxrow - 1]);
981 cw->data[cw->maxrow - 1] = t;
982 } else {
983 amii_curs(WIN_MESSAGE, 0, bottom);
984 SetAPen(w->RPort, C_WHITE);
985 Text(w->RPort, "# ", 2);
986 /* SetAPen( w->RPort, C_BLACK ); */ /* Black on black ... -jhsa */
987 Text(w->RPort, obufp, strlen(obufp));
988 SetAPen(w->RPort, C_WHITE);
989 }
990 amii_curs(WIN_MESSAGE, colx = strlen(obufp) + 3 + (scrollmsg != 0),
991 bottom);
992 return colx;
993}
994
995/* Ask a question and get a response */
996char

Callers 1

amii_get_ext_cmdFunction · 0.85

Calls 2

amii_cursFunction · 0.85
allocFunction · 0.70

Tested by

no test coverage detected