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

Zane H. Healy healyzh at avanthar.avanthar.com
Sun Jun 27 15:07:46 EDT 2021


Stephen Hoffman <seaohveh at hoffmanlabs.invalid> wrote:
> 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.

Thank you for the detailed writeup and list of links!  Keith Halewood got me
the basic answer I needed, and it looks like your examples should take me
much further.  The last link, with the example programs look especially
useful!

I was already reading SMGDEF.H, which gets me the rest of what I needed.

For someone looking for an smg$create_menu example, they might want to try
reading through the DX sourcecode.  I'd been trying to use it to figure out
SMG$READ_KEYSTROKE command, and noticed the code for the menues.

Thanks,
Zane





More information about the Info-vax mailing list