with an error code */\r}\rmidx = getmaxx() / 2;\rmidy = getmaxyO / 2;\r/* display a message */\rsettextjustify(CENTER_TEXT,CENTER_TEXT);\routtextxy(midx, midy, “Press any key to exit graphics mode:*');\r/* clean up */\rgetch();\rclosegraph();\rreturn 0;\r)\r/* called by the graphics kernel to allocate memory */\rvoid far * far _graphgetmem(unsigned size)\r{\rprintfC'_graphgetmem called to allocate %d bytes.\nM, size);\rprintf("hit any key:0);\rgetch();\rprintfC^n1');\r/* allocate memory from far heap */\rreturn farmalloc(size);\r}\r/* called by the graphics kernel to free memory */\rvoid far _graphfreemem(void far *ptr, unsigned size)\r(\rprintf(n_graphfreemem called to free %d bytes.\nH, size);\rprintf(Hhit any key:");\rgetch();\rprintf("\n")\r/* free ptr from far heap */\rfarfree(ptr);