WHITESMITHS' UTILITIES ---------------------- Submitted by: Chris Doran Date: September 1988 Sira Ltd., South Hill, Chislehurst, Kent, BR7 5EH, England. Tel: +44 1 467 2636, Telex: 896649, FAX: +44 1 467 6515 This directory contains things for use with Whitesmiths' V2.2 C and Pascal. They may not work on, or be needed for, V3.x, but we haven't upgraded, and aren't likely to. CPRINT.C printf() etc, see "The C Letter" V2 No 2, pp7-10, reprinted in PRINTF.C V2 No 3 pp8-11. Whilst printf() is in the Whitesmiths' SPRINTF.C Unix-compatible library under V2.2, this version avoids the enormous code overhead of ULIB (though it doesn't implement quite all the features of the Kernighan and Ritchie standard). I put this version in PLIB, so if anyone actually specifies ULIB (before PLIB), the ULIB version takes precedence. If they don't ask for ULIB, they still have printf(), which saves everyone getting disillusioned when their very first ("Hello world!") program typed in from K&R fails miserably. DATE.MAR DATE and TIME for VAX Pascal. Return "[d]d-mmm-yyyy" and TIME.MAR "mm:hh:ss.tt". DATIM.PAS is a simple demo program. DATIM.PAS PCW.* This is the Pascal Benchmark from "Personal Computer World" magazine, together with some timings for various Pascal's and similar high level languages on different machines. CLIST.C Whitesmiths' C version of C Checker program from a VAX SIG tape ([VAX84C.MADISONDE.MICRO]CC.C), with some corrections and many extensions. Counts brackets, quotes, primes, and comments to check for matches. Also does a line-numbered listing. Hardly as good as lint, but better than nothing. UNMATCHED.C Demonstration file, with almost everything unmatched. ENCRYPT*.* Simple program to encrypt and decrypt data using the Whitesmiths' encrypt/decrypt functions. Install as both ...ENC and ...DEC on RSX. Needs two separate programs on VMS -- see program source. XSE.RNH HELP file sources for two Real Time Systems' products. X68000.RNH ----- Only the following are new/updated for the Sept 88 submission ---- C.RNH HELP on using Whitesmiths' C and Pascal compilers. These PASCAL.RNO require Bonner Lab Runoff to expand substitutions. Runoff C.RNH C_SYNTAX.RNO alone for the C file, PASCAL.RNO+C.RNH for the Pascal version. These files may be slightly Sira-specific, as I've altered (debugged) the compiler driver scripts a little. There is no description of Pascal language syntax yet, and descriptions of the C runtime libraries could do with fleshing out a bit. TOH.COM Command procedure to convert a MACRO symbol definitions file to a C .H file. The MACRO file is extracted from a library (presumably SYS$LIBRARY:STARLET.MLB, or LIB.MLB). Then all lines other than those beginning $EQU are thrown away, $EQU's are changed to #define's, and ;...'s become /*...*/. Invoke as: $@TOH library module .H_file You are prompted for the arguments if you don't give them. Thus, SMGDEF.H, required for the above program can be produced by: $@TOH SYS$LIBRARY:STARLET $SMGDEF SMGDEF (default filetypes are .MLB and .H). This procedure uses the Real Time Systems "stream editor", XSE. If you don't have XSE, you may be able to write an EDT or TPU command file to do what XSE does There is an option (module=*) to extract ALL $*DEF modules from the library, but it takes a long time; I suggest you only fetch things when you need them. An alternative option (module = ^) replaces only those which already exist, which is useful after system updates. In this case, you are told about modules which have changed, and both old and new versions are left for you to compare. In any case, you should examine what TOH produces; MACRO forms I haven't encountered may produce invalid C code. Note that only simple constant #defines are produced. For things which are really structs (RAB, FAB etc.) see the [FERMILAB.VAXC*] directories on recent US SIG tapes. SINGLE.C Simple demonstration of the above. SMGDEMO.C Whitesmiths' C version of the SMG$ demonstration program in the Screen Management Guidelines section of the VAX/VMS Runtime Library Manual, Part I. Also needs, and demonstrates, .H files produced by TOH.COM. DESCRIPTOR.H Includes DESCRIPTOR typedef and $DESCRIPTOR_x macros (described in C.RNH, and used in the above demo programs. You should append this to SYS$LIBRARY:VMS.H. EDTDEF.H .H file for EDT$... symbols. There isn't a $EDTDEF module anywhere I can find, but you may need the symbol values if you want to use callable EDT. This file is created from the System Routines Manual, and listing of EDT$FILEIO in the V4.4 microfiche. In principle, I should warn you that it may change with a new release of VMS, but since EDT is being made obsolete, this is most unlikely. ******************************************************************************** * * * H U G E A P O L O G Y * * ========================== * * * * In previous submissions of this directory, I mislead everyone (and myself) * * by saying that Whitesmiths' C wouldn't accept '$' in identifiers. On the * * basis of this misinformation, I did a LOT of work supplying tools to change * * all the dollar signs to underscores and back! THIS WAS TOTALLY UNNECESSARY * * -- Whitesmiths' C DOES (at least in V2.2) accept '$' signs, so you (and I) * * don't need all that effort. * * * * The revised files supplied here remove all references to these lies. The old * * TOWH.COM is replaced by TOH.COM, which is basically the same, but doesn't * * change the dollar signs. If you have to rewrite all your programs, I do * * APOLOGISE. If it's any consolation, I am having to do the same with 3000 * * blocks of code! How this misapprehension arose is a mystery; I am SURE I * * tried using $ signs in identifiers, even though they're not mentioned as * * legal in the Whitesmiths' manuals (and certainly not in Kernighan & Ritchie).* * * * They aren't accepted by the Whitesmiths' RSX C (which is possibly where I * * got mislead), and are treated as terminators, even in #ifdef'd-out code, * * which can lead to some obscure compilation faults. An example is as follows: * * #ifdef vms * * sys$qiow(...) * * #else * * qiow(...) * * #endif * * where qiow() is a macro for RSX. All is well for VMS, but when you try to * * compile on RSX, it fails on the sys$qiow line, even though it's in code * * disabled by the #ifdef vms. * * * ******************************************************************************** -------- Whitesmiths' C and Pascal compilers are marketed by Whitesmiths Ltd., 97 Lowell Road, Concord, Massachusetts, in the U.S.A., and by Real Time Systems, PO Box 70, Viking House, Nelson Street, Douglas, Isle of Man, (0624 26021) in the U.K.. Real Time Systems also produce XSE, X68000, etc..