[Info-vax] callable BACKUP example
VAXman- at SendSpamHere.ORG
VAXman- at SendSpamHere.ORG
Fri Jul 9 20:25:44 EDT 2021
In article <00B65888.594833A3 at SendSpamHere.ORG>, VAXman- @SendSpamHere.ORG writes:
>In article <sc86be$cvo$1 at dont-email.me>, Dave Froble <davef at tsoft-inc.com> writes:
>>On 7/8/2021 7:11 PM, Chris Townley wrote:
>>> On 08/07/2021 23:53, Arne Vajhøj wrote:
>>>> On 7/8/2021 5:42 PM, Chris Townley wrote:
>>>>> On 08/07/2021 18:49, Arne Vajhøj wrote:
>>>>>> On 7/8/2021 12:22 PM, VAXman- at SendSpamHere.ORG wrote:
>>>>>>> Does anybody have the callable BACKUP example in compilable format?
>>>>>>>
>>>>>>> Trying to select and copy it from the PDF manual gives me garbage.
>>>>>>>
>>>>>>> FWIW, that's the ugliest bit of VMS documentation I have read in a
>>>>>>> very long while.
>>>>>>
>>>>>> I rewrote the example in the manual and ended up with:
>>>>
>>>>>> BACKUP/LIST look OK on the result.
>>>>>>
>>>>> Always beware of copying/pasting from Word or PDF - it usually does
>>>>> strange things - especially with quotes!
>>>>
>>>> It was more than copy/paste problems.
>>>>
>>>> The example in the manual declared a function:
>>>>
>>>> unsigned int subtest(void *);
>>>>
>>>> without using it.
>>>>
>>>> It did:
>>>>
>>>> static char input_str[] = "[.wrk]";
>>>> ...
>>>> input_dsc.dsc$w_length = sizeof(input_str);
>>>>
>>>> which I believe must be off by 1.
>>>>
>>>> It did not declare return type of main and it made all variables
>>>> global instead of local in main, which is valid C but not very
>>>> good C.
>>>>
>>>> Arne
>>>>
>>>>
>>> Ouch!
>>>
>>> Chris
>>>
>>
>>"Cut-n-Paste" usually means the user didn't bother to understand the
>>example/source. That isn't a good idea at any time. The doc examples
>>are to help one understand, not to be blindly copied.
>
>I wanted something quick to play with but copying it from Preview on my
>Mac to TextEdit produced put unadulterated garbage. What I don't under-
>stand is why the various macros (C-headers) were never added into the
>system's libraries. They need to be included from SYS$EXAMPLES. If the
>*include* files can be placed into SYS$EXAMPLES, why wasn't the example?
>After perusing that awful BACKUP API documentation, I whipped together a
>macro example. Far more readable too.
>
>If you want to wish you had a migraine a augmented by a hangover from a
>college toga party coupled with a raging case of herpes, take a gander
>at that BACKUP API documentation.
In fact, the only thing that I believe could be worse than that BACKUP
API documentation would be the .SDL that created the awful definitions
you see in SYS$EXAMPLES.
--
VAXman- A Bored Certified VMS Kernel Mode Hacker VAXman(at)TMESIS(dot)ORG
I speak to machines with the voice of humanity.
More information about the Info-vax
mailing list