[Info-vax] callable BACKUP example

Chris Townley news at cct-net.co.uk
Thu Jul 8 17:42:14 EDT 2021


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:
> 
> #include <stdio.h>
> #include <string.h>
> #include <stdlib.h>
> #include <descrip.h>
> 
> #include "sys$examples:bapidef.h"
> 
> typedef struct _buf_arg
> {
>      bck_opt_struct_dsc arg1;
>      bck_opt_struct_dsc arg2;
>      bck_opt_struct_flag arg3;
>      bck_opt_struct_flag arg4;
>      bck_opt_struct_flag arg5;
> } buf_arg;
> 
> int backup$start(buf_arg *mybufarg);
> 
> int main()
> {
>      buf_arg mybufarg;;
>      int status;
>      $DESCRIPTOR(input_dsc, "[.ratfor...]");
>      $DESCRIPTOR(output_dsc, "ratfor.bck");
>      mybufarg.arg1.opt_dsc_type = BCK_OPT_K_INPUT;
>      memcpy(&mybufarg.arg1.opt_dsc, &input_dsc, 8);
>      mybufarg.arg2.opt_dsc_type = BCK_OPT_K_OUTPUT;
>      memcpy(&mybufarg.arg2.opt_dsc, &output_dsc, 8);
>      mybufarg.arg3.option_type = BCK_OPT_K_SAVE_SET_OUT;
>      mybufarg.arg3.opt_flag_value = TRUE;
>      mybufarg.arg4.option_type = BCK_OPT_K_OPERATION_TYPE;
>      mybufarg.arg4.opt_flag_value = BCK_OP_K_SAVE ;
>      mybufarg.arg5.option_type = BCK_OPT_K_END_OPT;
>      mybufarg.arg5.opt_flag_value = FALSE;
>      status = backup$start(&mybufarg);
>      exit(status);
> }
> 
> BACKUP/LIST look OK on the result.
> 
> Arne
> 
Always beware of copying/pasting from Word or PDF - it usually does 
strange things - especially with quotes!

Chris

-- 
Chris



More information about the Info-vax mailing list