- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: CLI$ROUTINES.H
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2005 07:49 PM
08-02-2005 07:49 PM
Re: CLI$ROUTINES.H
I wrote too hurry ...
INVREQTYP ia new status; it means "Calling process did not have a CLI to perform
this function, or the CLI did not support the request".
My code is merely an example. It show you:
1) Using of $DESCRIPTOR macro, instead of using VMS structure;
2) Using of symbolic code instead of numeric codes;
Personally I don't like CLI interface, because is too complex. For my purpose, I sue standard argv and argc parameters.
Antonio Vigliotti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2005 07:56 PM
08-02-2005 07:56 PM
Re: CLI$ROUTINES.H
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2005 08:16 PM
08-02-2005 08:16 PM
Re: CLI$ROUTINES.H
$! Define symbolic name of my application
$ MYAPPL="RUN
$! Now I run my appl with parameters
$ MYAPPL PARAM1 PARAM2 ...
Antonio Vigliotti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2005 10:00 PM
08-02-2005 10:00 PM
Re: CLI$ROUTINES.H
Sure it's easier to use the Unix-style of parameter passing, and it may mean less overhead. In some cases, I'd agree, and not just in C programs.
But I think I speak for a lot of people when I disagree:
A. VMS <> UNIX.
B. In a DCL-style interface, options are NAMED, not just an abitrary letter that could mean anything. /EXECUTE is clearer the -e, or, even worse, -E
C. When well done, a lot of validity checking is done during image activation (by DCL!). /EXECUTE=
I would prefer to avoid image activation when options and required parameters are missing, in stead of activating it anyway and then finding the parameters don't mix.
At lkeast, the error messages are standard VMS so tell me what's wrong, where an activated image can spit out rubbish that doesn't tell anything at all. (well, it can deliver the right message but quite likely, that will not be done).
There are enough examples, formerly from Unix, both commercial and freeware, that use the Unix-style interface where a DCL-style interface would be much, much more appropiate: HP TCPIP, Apache, SSL, Java, and MySQL, to name a few (The ones I have experience with).
OpenVMS Developer & System Manager
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2005 10:16 PM
08-02-2005 10:16 PM
Re: CLI$ROUTINES.H
I get an error -
%SYSTEM-F-ACCVIO, access violation, reason mask=01, virtual address=010E0009,
PC=0001B78D, PSL=03C00020
break on unhandled exception at SHARE$LIBRTL+106893
how did you conclude that it was this stmt 'status = CLI$PRESENT(entity);' which was causing the problem? Am just curious...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2005 10:35 PM
08-02-2005 10:35 PM
Re: CLI$ROUTINES.H
B. In a DCL-style interface, options are NAMED, not just an abitrary letter that could mean anything. /EXECUTE is clearer the -e, or, even worse, -E
Willem,
even YOU give them *NIXians too much credit!
About 1 in 5 will probably already have some other meaning for -e, (or the author has some private conventions) and so they choose - x for eXecute), -P ( = Perform ) or -d ( = Do ), or (use your imagination). Of course, randomly choose upper- or lower case.
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2005 10:49 PM
08-02-2005 10:49 PM
Re: CLI$ROUTINES.H
I ran your program with the debugger until it failed with ACCVIO. Then I did a
DBG> SHOW CALL
module name routine name line rel PC abs PC
*STR$ANALYZE_SDESC
str$analyze_sdesc
4358 0000000000000300 0000000000030AA0
----- the above looks like a null frame in the same scope as the frame below
000000000002031C 000000000003031C
*ITRC_944542 main 22134 0000000000000124 0000000000030124
*ITRC_944542 __main 000000000000009C 000000000003009C
FFFFFFFF8031DFFC FFFFFFFF8031DFFC
Then I looked at the first routine call inside your program:
DBG> set scope ITRC_944542
DBG> ty 22134
module ITRC_944542
22134: status = CLI$PRESENT(entity);
Easy, isn't it ;-)
Volker.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2005 11:02 PM
08-02-2005 11:02 PM
Re: CLI$ROUTINES.H
This too is a bit o.t. but here goes...
Willem wrote:
There are enough examples, formerly from Unix, both commercial and freeware, that use the Unix-style interface where a DCL-style interface would be much, much more appropiate: HP TCPIP, Apache, SSL, Java, and MySQL, to name a few (The ones I have experience with).
There's also at least one example of a program that impressively handles both DCL and Unix style command lines. It's GAWK. Best of all, it's free.
Galen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2005 11:30 PM
08-02-2005 11:30 PM
Re: CLI$ROUTINES.H
#pragma inline(cli_present)
unsigned cli_present(char *s) {
$DESCRIPTOR1(s_desc, s);
return cli$present(&s_desc);
}
So I don't have to deal with manually creating a descriptor every time I want to do this.
There's also a cli_get_value() that uses LIB$SGET1_DD() to dynamically allocate storage for the string returned by CLI$GET_VALUE() and then copies that string to a user buffer(with null termination) using LIB$MOVC3(). (Hey, I just noticed a small memory leak in my code. The dynamically allocated storage never gets freed!-)
cli_parse() is another jacket routine that wraps LIB$GET_FOREIGN(), CLI$DCL_PARSE(), and CLI$DISPATCH() in one neat package.
Despite some limitations (like the memory leak :-), I've found them usable enough for a number of small applications I've written.
Here at work this all lives on a system with no Internet connections or removable media so I can't easily attach it (security rules.) And I'd probably make too many typos if I tried to transcribe it.
I have an older version of it at home and perhaps will remember to post it here or elsewhere.
(Side note: the version at home is stored in a VMS disk image on my Mac OS X system. I'll have to boot up my copy of simh running VMS to retrieve it, unless someone has an OS X tool to read VMS disk images!)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2005 11:55 PM
08-02-2005 11:55 PM
Re: CLI$ROUTINES.H
Me, giving credit to Unixionians? No way:
-d, -e, -p, -x (or their uppercase counterparts) can all be used where in VMS /EXECUTE might be used. This is just one example. And I know it's even worse:
In another context, -d may mean /DISPLAY or /DESCENDING, -e could mean /EXTENDED, /EXTERNAL or /ERROR; read /PRINT or /PREFIX for p, and -x may be translated to /EXTERNAL, or, what I've seen /DEBUG or /VERBOSE.
And: case matters. Sometimes the uppercase version is a more expanded version of the lowercase one. Sometimes it's the opposite. Somethimes it's something completely different. Sometimes, the counterpart doesn't even exist.
No credit for Unixonians. Nor for OpenVMS engineering that seems to persuade it's clients to use the very same rubbish, no matter where it comes from: from within HP (Tru64's TCPIP stack!) or OpenSource (Apache, SSL). Porting is more than just getting code compiled and linked. It also means that the code is adapted to comply with the OS's standards and methods.
New users like ram take the challenge to master "the VMS way of doing things". This should be encouraged and supported. Not just by this community but by HP as well.
OpenVMS Developer & System Manager
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2005 12:31 AM
08-03-2005 12:31 AM
Re: CLI$ROUTINES.H
Porting is more than just getting code compiled and linked. It also means that the code is adapted to comply with the OS's standards and methods.
<<<
A very good resource that has all the VMS programming aspects is "How to Write a Native VMS Command": http://members.fortunecity.com/twirlip/vms_command.html
cu,
Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2005 01:13 AM
08-03-2005 01:13 AM
Re: CLI$ROUTINES.H
New users like ram take the challenge to master "the VMS way of doing things". This should be encouraged and supported
Oh yes! Absolutely.
ram, take this as encouragement, it IS intended to!
And we are here to help you with it.
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2005 02:06 AM
08-03-2005 02:06 AM
Re: CLI$ROUTINES.H
Martin - thanks for that link, now if only I could award you points. :)
cheers
Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2005 02:59 AM
08-03-2005 02:59 AM
Re: CLI$ROUTINES.H
your linked web site is fantastic.
Ram carefully at that page because it can help you.
Antonio Vigliotti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2005 07:25 PM
08-04-2005 07:25 PM
Re: CLI$ROUTINES.H
The website is great. Thanks again.
- « Previous
-
- 1
- 2
- Next »