CTEX Interface Library for DECUS C ================================== This document contains a brief description of the interface library for accessing CTEX functions from DECUS C. The library is called CTEX.OLB and is located in the usual P/OS development library directory (e.g., [001005] on the PRO). The interface maps fairly closely to the equivalent given in the toolkit manual, except for the parameters and other things as explicitly noted. Many of the routines in this library require the calling program be linked against the POSRES cluster library, and in some cases, the RMSRES library as well. Consult toolkit documentation for linking requirements. Sorry, but for now there are no "H" files for status values, and no "fancy" documentation. This library was done in a big hurry as a midnight hack. PLEASE NOTE: When passing 'null' strings, do NOT pass a NULL, rather, pass "". Bob Denny 02-Jan-84 P$CPRNT - Callable print services --------------------------------- unsigned req; /* Request code */ char *file; /* File name or "" */ int *stat; /* --> 2-word status block */ p$cprnt(req, file, stat); P$DMENU - Display dynamic menu ------------------------------ char *action; /* --> buffer to receive action str */ int maxlen; /* Size of action string buffer */ int addopt; /* TRUE = enable additional opt's */ char *msg1; /* Message for line 23 or "" */ char *msg2; /* Message for line 24 or "" */ int *stat; /* --> 2 word status block */ p$dmenu(action, maxlen, addopt, msg1, msg2, stat); P$DPACK - Pack dynamic single-choice menu ----------------------------------------- char *fid; /* Field ID */ char *buf; /* Field 'value' buffer */ char *keyw; /* "DFLT", "KEYWnn" or "" */ int p1, p2; /* Parameter(s) for above */ int clear; /* TRUE = clear dynamic buffer */ int stat[2]; /* 2-word status */ p$dpack(fid, buf, keyw, p1, p2, clear, stat); CTEX Interface Library for DECUS C ================================== P$FATLER - Fatal error ---------------------- char *msg; /* Message */ p$fatler(msg); P$GETKEY - Get keystroke ------------------------ int stat[2]; /* 2-word status block */ p$getkey(stat); P$HCLOSE - Close current help frame file ---------------------------------------- int stat[2]; /* 2-word status block */ p$hclose(stat); P$HELP - Display help frame --------------------------- char *frame; /* Frame ID */ int stat[2]; /* 2-word status block */ p$help(frame, stat); P$HFILE - Open help file ------------------------ char *file; /* Help frame file name */ char *frame; /* Default frame ID */ int stat[2]; /* 2-word status block */ p$hfile(file, frame, stat); P$HFRAME - Display help frame & set new default ----------------------------------------------- char *frame; /* Frame ID */ int stat[2]; /* 2-word status block */ p$hframe(frame, stat); P$MCLOSE - Close current menu frame file ---------------------------------------- int stat[2]; /* 2-word status block */ p$mclose(stat); CTEX Interface Library for DECUS C ================================== P$MENU - Display single-choice menu frame ----------------------------------------- char *action; /* --> buffer for action string */ int maxlen; /* Maximum action string length */ int addopt; /* TRUE = enable add'tl options */ char *msg1; /* Message for line 23 or "" */ char *msg2; /* Message for line 24 or "" */ int stat[2]; /* 2-word status block */ p$menu(action, maxlen, addopt, msg1, msg2, stat); P$MFILE - Open menu frame file ------------------------------ char *file; /* Name of menu file */ int stat[2]; /* 2-word status block */ p$mfile(file, stat); P$MFRAME - Load static menu frame --------------------------------- char *frame; /* Frame ID */ char *gblact; /* Buffer for global action str */ int maxlen; /* Size of gblact buffer */ int stat[2]; /* 2-word status block */ p$mframe(frame, gblact, maxlen, stat); P$MMENU - Pack multiple-choice menu frame ----------------------------------------- char *optstr; /* Array of fixed-length opt strs */ int optlen; /* Fixed length of option strings */ int nopts; /* Number of options */ int lim; /* Limit to number of selections */ int *sels; /* Returned array of sel'd opt's */ int addopt; /* TRUE = enable additional opt's */ char *msg1; /* Message for line 23 or "" */ char *msg2; /* Message for line 24 or "" */ int *stat; /* --> 2 word status block */ p$mmenu(optstr, optlen, nopts, lim, sels, addopt, msg1, msg2, stat); P$MPACK - Pack multiple-choice menu ----------------------------------- char *fid; /* Field ID */ char *buf; /* Field 'value' buffer */ int clear; /* TRUE = clear dynamic buffer */ int stat[2]; /* 2-word status */ p$mpack(fid, buf, clear, stat); CTEX Interface Library for DECUS C ================================== P$MUNPK - Unpack menu buffer ---------------------------- char *fid; /* Field ID */ char *buf; /* Field 'value' buffer */ int maxl; /* Value buffer size */ char *keyw; /* "DFLT", "KEYWnn" or "" */ int *p1, *p2; /* Parameter(s) for above */ int stat[2]; /* 2-word status */ p$munpk(fid, buf, maxl, keyw, p1, p2, stat); P$MSGBRD - Post message on message board ---------------------------------------- char *msg; /* Message to post */ int stat[2]; /* 2-word status */ p$msgbrd(msg, stat); P$NEWFIL - New File Specification Menu -------------------------------------- char name[50]; /* Receives specified file name */ char *defext; /* Default extension (R/W) */ char *text1; /* Text at top of menu or "" */ char *msg1; /* Text for line 23 or "" */ int stat[2]; /* 2-word status block */ p$newfil(name, defext, text1, msg1, stat); P$OLDFIL - File Selection Menu ------------------------------ #define NCHOICES xxx char *wspec; /* Wild file specification */ int nchoice = xxx; /* Max allowed to select */ char fspecs[NCHOICES][50]; /* Array of 50-byte spec bufs */ char *text1; /* Text at top of menu or "" */ char *msg1; /* Text for line 23 or "" */ char *msg2; /* Text for line 24 "" */ int stat[2]; /* 2-word status block */ p$oldfil(wspec, nchoice, fspecs, text1, msg1, msg2, stat); P$WTRES - Wait for 'resume' key ------------------------------- p$wtres();