All of the DOS-specific extended predicates are implemented in a file in the main Amzi! directory called DOS.C. These include predicates that work with the file system, the screen cursor, the keyboard and the mouse. See the source code for details on the implementations. The predicates are documented in the Prolog Reference under the DOS-specific predicates section.
Here is the PRED_INIT table for DOS.C, listing the predicates defined in the module.
PRED_INIT dosPreds[] =
{
/* file and directory manipulation */
{"chdir", 2, p_chdir},
{"mkdir", 2, p_mkdir},
{"rmdir", 2, p_rmdir},
{"setdrive", 1, p_setdrive},
{"getdrive", 1, p_getdrive},
{"findfirst", 3, p_findfirst},
{"findnext", 1, p_findnext},
/* screen and cursor control */
{"tget", 2, p_tget},
{"tmove", 2, p_tmove},
{"tscroll", 5, p_tscroll},
{"cls", 0, p_cls},
{"show_cursor", 0, p_show_cursor},
{"hide_cursor", 0, p_hide_cursor},
{"wa", 2, p_wa},
{"wc", 2, p_wc},
{"wca", 3, p_wca},
{"rca", 2, p_rca},
/* keyboard support */
{"keyb", 1, p_keyb},
{"kbhit", 0, p_kbhit},
{"kbas", 2, p_kbas},
/* mouse support */
{"m_reset", 0, p_mreset},
{"m_show", 0, p_mshow},
{"m_hide", 0, p_mhide},
{"m_status", 4, p_mstatus},
{"m_move", 2, p_mmove},
{"m_press", 4, p_mpress},
{"m_release", 4, p_mrelease},
{"m_rowlimit", 2, p_mrowlimit},
{"m_collimit", 2, p_mcollimit},
{"m_curtype", 3, p_mcurtype},
/* other */
{"port", 2, p_port},
{"spawn", 2, p_spawn},
{NULL, 0, NULL}
};
There is also a Prolog component to the DOS predicates, called DOS.PRO. It provides some additional services and a little help. The additional services include mappings of color names to attribute values for easier full screen programming. The help is for the findfirst and findnext functions for finding files. Prolog code is used to map these two procedural calls into a more familiar Prolog backtracking predicate that will find all files through backtracking.
Copyright ©1987-1997 Amzi! inc. All Rights Reserved.