Update of /cvsroot/linux-decnet/dnprogs/dncopy
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32414
Modified Files:
Makefile dncopy.1 dncopy.cc dnetfile.h dnetfile_dap.cc file.h
Log Message:
add -D & -P options to dncopy.
Index: Makefile
===================================================================
RCS file: /cvsroot/linux-decnet/dnprogs/dncopy/Makefile,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** Makefile 12 Aug 2004 09:17:32 -0000 1.3
--- Makefile 10 Mar 2006 08:13:16 -0000 1.4
***************
*** 13,17 ****
$(PROG1): $(PROG1OBJS) $(DEPLIBS)
! $(CXX) -o $@ $(PROG1OBJS) $(LIBS)
$(PROG2): $(PROG1)
--- 13,17 ----
$(PROG1): $(PROG1OBJS) $(DEPLIBS)
! $(CXX) $(LDFLAGS) -o $@ $(PROG1OBJS) $(LIBS)
$(PROG2): $(PROG1)
Index: dncopy.1
===================================================================
RCS file: /cvsroot/linux-decnet/dnprogs/dncopy/dncopy.1,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** dncopy.1 1 Sep 2005 08:34:39 -0000 1.7
--- dncopy.1 10 Mar 2006 08:13:16 -0000 1.8
***************
*** 153,156 ****
--- 153,164 ----
This option is ignored when copying from VMS.
.TP
+ .I "\-P"
+ Queue the file for printing to SYS$PRINT when it arrives at the VMS end.
+ .TP
+ .I "\-D"
+ Delete the file when it is closed. This is only really useful in conjunction
+ with
+ .I -P.
+ .TP
.I \-h \-?
Displays help for using the command.
Index: dncopy.cc
===================================================================
RCS file: /cvsroot/linux-decnet/dnprogs/dncopy/dncopy.cc,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** dncopy.cc 5 Jan 2006 19:24:13 -0000 1.8
--- dncopy.cc 10 Mar 2006 08:13:16 -0000 1.9
***************
*** 38,42 ****
int &rfm, int &rat, int &org,
int &interactive, int &keep_version, int &user_bufsize,
! int &remove_cr, int &show_stats, int &verbose, int &rrl, char *protection);
// Start here:
--- 38,43 ----
int &rfm, int &rat, int &org,
int &interactive, int &keep_version, int &user_bufsize,
! int &remove_cr, int &show_stats, int &verbose,
! int &flags, char *protection);
// Start here:
***************
*** 59,63 ****
int remove_cr = 0;
int show_stats = 0;
! int rrl = 0;
char opt;
char protection[255]={'\0'};
--- 60,65 ----
int remove_cr = 0;
int show_stats = 0;
! int printfile = 0;
! int flags = 0;
char opt;
char protection[255]={'\0'};
***************
*** 85,89 ****
rfm, rat,org,
interactive, keep_version, user_bufsize,
! remove_cr, show_stats, verbose, rrl, protection);
--- 87,91 ----
rfm, rat,org,
interactive, keep_version, user_bufsize,
! remove_cr, show_stats, verbose, flags, protection);
***************
*** 92,96 ****
rfm, rat,org,
interactive, keep_version, user_bufsize,
! remove_cr, show_stats, verbose, rrl, protection);
// Work out the buffer size. The default for block transfers is 512
--- 94,98 ----
rfm, rat,org,
interactive, keep_version, user_bufsize,
! remove_cr, show_stats, verbose, flags, protection);
// Work out the buffer size. The default for block transfers is 512
***************
*** 153,157 ****
// Set up the network links if necessary
! if (out->setup_link(bufsize, rfm, rat, org, 0))
{
out->perror("Error setting up output link");
--- 155,159 ----
// Set up the network links if necessary
! if (out->setup_link(bufsize, rfm, rat, org, flags))
{
out->perror("Error setting up output link");
***************
*** 178,182 ****
}
! if (in->setup_link(bufsize, rfm, rat, org, rrl))
{
in->perror("Error setting up input link");
--- 180,184 ----
}
! if (in->setup_link(bufsize, rfm, rat, org, flags))
{
in->perror("Error setting up input link");
***************
*** 356,360 ****
fprintf(f, " -b <n> use a block size of <n> bytes\n");
fprintf(f, " -d (s)remove trailing CR on record (DOS file transfer)\n");
! fprintf(f, " -l (r)Ignore interlocks on remote file\n");
fprintf(f, " -V show version number\n");
fprintf(f, "\n");
--- 358,364 ----
fprintf(f, " -b <n> use a block size of <n> bytes\n");
fprintf(f, " -d (s)remove trailing CR on record (DOS file transfer)\n");
! fprintf(f, " -l (r)ignore interlocks on remote file\n");
! fprintf(f, " -P (s)print file to SYS$PRINT\n");
! fprintf(f, " -D (s)delete file on close. Only really useful with -P\n");
fprintf(f, " -V show version number\n");
fprintf(f, "\n");
***************
*** 437,446 ****
int &rfm, int &rat, int &org,
int &interactive, int &keep_version, int &user_bufsize,
! int &remove_cr, int &show_stats, int &verbose, int &rrl, char *protection)
{
int opt;
opterr = 0;
optind = 0;
! while ((opt=getopt(argc,argv,"?Vvhdr:a:b:kislm:p:")) != EOF)
{
switch(opt) {
--- 441,451 ----
int &rfm, int &rat, int &org,
int &interactive, int &keep_version, int &user_bufsize,
! int &remove_cr, int &show_stats, int &verbose,
! int &flags, char *protection)
{
int opt;
opterr = 0;
optind = 0;
! while ((opt=getopt(argc,argv,"?Vvhdr:a:b:kislm:p:PD")) != EOF)
{
switch(opt) {
***************
*** 458,462 ****
case 'l':
! rrl = 1;
break;
--- 463,467 ----
case 'l':
! flags = file::FILE_FLAGS_RRL;
break;
***************
*** 511,514 ****
--- 516,527 ----
break;
+ case 'P':
+ flags = file::FILE_FLAGS_SPOOL;
+ break;
+
+ case 'D':
+ flags = file::FILE_FLAGS_DELETE;
+ break;
+
case 'b':
user_bufsize = atoi(optarg);
Index: dnetfile.h
===================================================================
RCS file: /cvsroot/linux-decnet/dnprogs/dncopy/dnetfile.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** dnetfile.h 1 Sep 2005 08:34:39 -0000 1.4
--- dnetfile.h 10 Mar 2006 08:13:16 -0000 1.5
***************
*** 50,54 ****
int verbose;
-
/* File attributes, requested and actual */
int file_rat, file_rfm;
--- 50,53 ----
Index: dnetfile_dap.cc
===================================================================
RCS file: /cvsroot/linux-decnet/dnprogs/dncopy/dnetfile_dap.cc,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** dnetfile_dap.cc 17 Jan 2006 11:33:54 -0000 1.11
--- dnetfile_dap.cc 10 Mar 2006 08:13:16 -0000 1.12
***************
*** 1,4 ****
/******************************************************************************
! (c) 1998-2005 P.J. Caulfield pa...@ty...
This program is free software; you can redistribute it and/or modify
--- 1,4 ----
/******************************************************************************
! (c) 1998-2006 P.J. Caulfield pa...@ty...
This program is free software; you can redistribute it and/or modify
***************
*** 94,98 ****
att.set_mrs(0);
att.set_datatype(dap_attrib_message::IMAGE);
! if (user_flags) {
acc.set_shr(1<<dap_access_message::FB$PUT |
1<<dap_access_message::FB$UPD |
--- 94,98 ----
att.set_mrs(0);
att.set_datatype(dap_attrib_message::IMAGE);
! if (user_flags & FILE_FLAGS_RRL) {
acc.set_shr(1<<dap_access_message::FB$PUT |
1<<dap_access_message::FB$UPD |
***************
*** 223,227 ****
ctl.set_ctlfunc(dap_control_message::PUT);
}
! if (user_flags)
{
ctl.set_rop_bit(dap_control_message::RB$RRL);
--- 223,227 ----
ctl.set_ctlfunc(dap_control_message::PUT);
}
! if (user_flags & file::FILE_FLAGS_RRL)
{
ctl.set_rop_bit(dap_control_message::RB$RRL);
***************
*** 236,239 ****
--- 236,245 ----
dap_accomp_message accomp;
accomp.set_cmpfunc(dap_accomp_message::CLOSE);
+
+ /* Remote printing support */
+ if (user_flags & FILE_FLAGS_SPOOL)
+ accomp.set_fop_bit(dap_attrib_message::FB$SPL);
+ if (user_flags & FILE_FLAGS_DELETE)
+ accomp.set_fop_bit(dap_attrib_message::FB$DLT);
if (!accomp.write(conn)) return -1;
conn.set_blocked(false);
Index: file.h
===================================================================
RCS file: /cvsroot/linux-decnet/dnprogs/dncopy/file.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** file.h 1 Sep 2005 08:34:39 -0000 1.3
--- file.h 10 Mar 2006 08:13:16 -0000 1.4
***************
*** 37,41 ****
virtual int max_buffersize(int biggest) = 0;
virtual void set_protection(char *vmsprot) {};
!
// Some constants
--- 37,41 ----
virtual int max_buffersize(int biggest) = 0;
virtual void set_protection(char *vmsprot) {};
!
// Some constants
***************
*** 58,62 ****
static const int RFM_STMLF = 5;
static const int RFM_STMCR = 6;
!
private:
// Disable copy constructor
--- 58,67 ----
static const int RFM_STMLF = 5;
static const int RFM_STMCR = 6;
!
! // user_flags passed to setup_link.
! static const int FILE_FLAGS_RRL = 1;
! static const int FILE_FLAGS_SPOOL = 2;
! static const int FILE_FLAGS_DELETE = 4;
!
private:
// Disable copy constructor
|