[Info-vax] C Examples of Calling SMG$ Routines?

Stephen Hoffman seaohveh at hoffmanlabs.invalid
Sun Jun 27 14:30:06 EDT 2021


On 2021-06-27 17:13:04 +0000, Zane H. Healy said:

> In looking at the "OpenVMS RTL Screen Management (SMG$) Manual" on the 
> VSI website, they give examples of every language supported, except 
> C/C++.  The manual itself says it's new as of 2019, but also says it's 
> for HP OpenVMS VAX/Alpha 7.3.  :-)  Looking at my copy of the manual 
> for v6, all they did was remove the code for "RPG II".
> 
> Does anyone happen to have some basic examples of using the SMG$ 
> Routines in C?  As it happens, the example does just what I need, since 
> it shows how to use SMG$READ_KEYSTROKE.

Yeah, past whatever is in SYS$EXAMPLES, the OpenVMS doc tends to have 
gaps. (The "the OpenVMS doc is great!" crowd always goes silent right 
about now, too.)

If you have support, ask VSI. They're starting up a support database 
offering with examples.  Having just checked, they do not yet have an 
example of smg$read_keystroke. The predecessor to the VSI database, the 
DEC/Compaq/HP TIMA/STARS/AskQ database—which did have lots of source 
code examples—is long gone.

The worst of that batch of SMG calls is probably the smg$create_menu 
call, and the OpenVMS developers have yet to add an example of that 
one, or an example of implementing command-line recall from what I can 
find of it.  That might be a starting point for you.

https://www.digiater.nl/openvms/decus/vax91b/bzl/smg_in_c/subprocess.c

As you don't indicate what you're looking for a keystroke read for, and 
unless you're already using SMG (possibly for command recall or such, 
though that's not well documented), a $qio call is the approach I'd use:

https://www.digiater.nl/openvms/freeware/v80/hoffman_examples/qio_extended_read_2.c 

https://www.digiater.nl/openvms/freeware/v80/hoffman_examples/qio_extended_read_3.c 


Here are some other SMG examples:

http://svn.csrri.iit.edu/mx/branches/1.4/motor/command.c
https://www.digiater.nl/openvms/decus/vax91b/bzl/smg_in_c/

Alas, I don't see a C example of smg$read_keystroke anywhere, and the 
eight-cubed source code example coverage doesn't include SMG.


-- 
Pure Personal Opinion | HoffmanLabs LLC 




More information about the Info-vax mailing list