linux-decnet-commit Mailing List for DECnet for Linux (Page 24)
Brought to you by:
chrissie_c,
ph3-der-loewe
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(15) |
Nov
(16) |
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(20) |
Feb
(27) |
Mar
(25) |
Apr
(12) |
May
(2) |
Jun
(6) |
Jul
(36) |
Aug
(12) |
Sep
(12) |
Oct
(16) |
Nov
(5) |
Dec
(5) |
2003 |
Jan
(8) |
Feb
(9) |
Mar
(25) |
Apr
(18) |
May
(29) |
Jun
(4) |
Jul
(1) |
Aug
|
Sep
(10) |
Oct
(5) |
Nov
(3) |
Dec
(9) |
2004 |
Jan
(17) |
Feb
|
Mar
(9) |
Apr
|
May
(4) |
Jun
(1) |
Jul
(2) |
Aug
(21) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2005 |
Jan
(5) |
Feb
|
Mar
(13) |
Apr
|
May
(3) |
Jun
(1) |
Jul
|
Aug
|
Sep
(13) |
Oct
(83) |
Nov
(2) |
Dec
|
2006 |
Jan
(21) |
Feb
(1) |
Mar
(32) |
Apr
(31) |
May
(3) |
Jun
(1) |
Jul
|
Aug
(7) |
Sep
|
Oct
(1) |
Nov
(3) |
Dec
(13) |
2007 |
Jan
(1) |
Feb
(7) |
Mar
|
Apr
(2) |
May
|
Jun
(1) |
Jul
(2) |
Aug
(20) |
Sep
|
Oct
|
Nov
|
Dec
(7) |
2008 |
Jan
(4) |
Feb
(13) |
Mar
(24) |
Apr
(18) |
May
(10) |
Jun
|
Jul
|
Aug
(40) |
Sep
(72) |
Oct
(61) |
Nov
(9) |
Dec
(2) |
2009 |
Jan
(6) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(7) |
Jul
|
Aug
|
Sep
|
Oct
(8) |
Nov
|
Dec
(3) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
(41) |
Aug
(28) |
Sep
(2) |
Oct
(5) |
Nov
(4) |
Dec
|
2011 |
Jan
(7) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Patrick C. <pa...@us...> - 2005-10-21 14:40:38
|
Update of /cvsroot/linux-decnet/dnprogs/dnlogin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30746 Added Files: dnlogin.1 Log Message: Man page (such as it is) --- NEW FILE: dnlogin.1 --- .TH DNLOGIN 1 "October 21 2005" "DECnet utilities" .SH NAME dnlogin \- Connect as a terminal to a DECnet system .SH SYNOPSIS .B dnlogin [options] nodename .br Options: .br [\-Vh] [\-d level] [\-e char] .br .SH DESCRIPTION .PP dnlogin connects to a remote DECnet system. .br .br This application implements the CTERM protocol over DECnet for connecting to a remote DECnet host. It expects to be run from a VT100-compatible terminal. .SH OPTIONS .TP .TP .I "\-e <char>" Set the exit character. By default this is ^]. You can specify the exit character as a control character by preceding it with a circumflex eg (^A means control-A) or as a number in decimal (default), octal (starting with a zero), or hexadecimal (preceded by 0x or 0X). .TP .I \-h \-? Displays help for using the command. .TP .I \-V Show the version of the package that dnlogin was built with. .SH EXAMPLES .br Connect to remote VAX host named "mv3100". .br .br .PP dnlogin mv3100 .br .SH HELPFUL HINTS The CTERM specifications available from Digital does not include how to setup VMS terminal characteristics, so the host cannot identify the capabilities of the session we are creating. The simplest workaround is to set the terminal capabilities manually upon login or including the following command in the .B login.com DCL procedure. .B $ SET TERM/DEC_CRT .SH SEE ALSO .BR dntype "(1), " dndir "(1), " dndel "(1), " dntask "(1), " dnping "(1)" |
From: Patrick C. <pa...@us...> - 2005-10-21 14:36:00
|
Update of /cvsroot/linux-decnet/dnprogs/dnlogin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29614 Modified Files: cterm.c dnlogin.c found.c tty.c Log Message: Lots of stuff seems to work now :) Index: cterm.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/cterm.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** cterm.c 21 Oct 2005 12:13:17 -0000 1.12 --- cterm.c 21 Oct 2005 14:35:37 -0000 1.13 *************** *** 270,279 **** // QQ 1=postfix is a newline count, 2=postfix=character // S 1=Send write completion when this wrote completes ! // T 1=This data is written to foundation servics transparently if (debug & 2) fprintf(stderr, "CTERM: process_write flags = %x (prefix=%d,postfix=%d)\n",flags, prefixdata, postfixdata); ! if (flags >> 3) ! tty_set_discard(!(flags>>3)); send_prepostfix(((flags >> 6) & 3), prefixdata); //PP --- 270,278 ---- // QQ 1=postfix is a newline count, 2=postfix=character // S 1=Send write completion when this wrote completes ! // T 1=This data is written to foundation services transparently if (debug & 2) fprintf(stderr, "CTERM: process_write flags = %x (prefix=%d,postfix=%d)\n",flags, prefixdata, postfixdata); ! tty_set_discard(!(flags>>3)); send_prepostfix(((flags >> 6) & 3), prefixdata); //PP *************** *** 531,534 **** --- 530,535 ---- { // TODO other characteristics ? + if (debug & 2) + fprintf(stderr, "Discarding rest of attrs, ptr=%d, len=%d\n",bufptr, len); return len; } *************** *** 548,551 **** --- 549,555 ---- char_attr[(int)c] |= (val & mask); // set the new ones. bufptr += 3; + if (debug & 2) + fprintf(stderr, "CTERM: Setting characteristics for char %d to 0x%x\n", + c, char_attr[(int)c]); break; Index: dnlogin.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/dnlogin.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** dnlogin.c 21 Oct 2005 12:13:17 -0000 1.9 --- dnlogin.c 21 Oct 2005 14:35:37 -0000 1.10 *************** *** 1,4 **** /****************************************************************************** ! (c) 2002 P.J. Caulfield pa...@de... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 2002-2005 P.J. Caulfield pa...@de... This program is free software; you can redistribute it and/or modify *************** *** 62,70 **** } ! if (res == 0) /* Timeout */ { tty_timeout(); - timeout_valid = 0; } /* Read from keyboard */ --- 62,70 ---- } ! if (res == 0 && timeout_valid && tv.tv_sec == 0 && tv.tv_usec == 0) { tty_timeout(); } + timeout_valid = 0; /* Read from keyboard */ Index: found.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/found.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** found.c 21 Oct 2005 12:13:17 -0000 1.11 --- found.c 21 Oct 2005 14:35:37 -0000 1.12 *************** *** 167,176 **** if ( (len=dnet_recv(sockfd, inbuf, sizeof(inbuf), MSG_EOR|MSG_DONTWAIT)) <= 0) - { if (len == -1 && errno == EAGAIN) return 0; ! fprintf(stderr, "%s\n", found_connerror()); return -1; } --- 167,176 ---- if ( (len=dnet_recv(sockfd, inbuf, sizeof(inbuf), MSG_EOR|MSG_DONTWAIT)) <= 0) { if (len == -1 && errno == EAGAIN) return 0; ! if (len < 0 && errno != EINVAL)/* Shurely shome mishtake */ ! fprintf(stderr, "%s\n", strerror(errno)); return -1; } *************** *** 268,273 **** if (connect(sockfd, (struct sockaddr *) &sockaddr, sizeof(sockaddr)) < 0) { ! perror("socket"); ! return -1; } --- 268,273 ---- if (connect(sockfd, (struct sockaddr *) &sockaddr, sizeof(sockaddr)) < 0) { ! fprintf(stderr, "Cannot connect to %s: %s\n", node, found_connerror()); ! return -1; } *************** *** 286,290 **** char *msg; ! if (getsockopt(sockfd, DNPROTO_NSP, DSO_DISDATA, &optdata, &len) == -1) { --- 286,290 ---- char *msg; ! if (getsockopt(sockfd, DNPROTO_NSP, DSO_CONDATA, &optdata, &len) == -1) { Index: tty.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/tty.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** tty.c 21 Oct 2005 12:13:17 -0000 1.11 --- tty.c 21 Oct 2005 14:35:38 -0000 1.12 *************** *** 37,40 **** --- 37,41 ---- extern int exit_char; extern int finished; + extern unsigned char char_attr[]; /* Input state buffers & variables */ *************** *** 143,147 **** /* All control chars except ^R ^U ^W, BS & HT */ /* ie 18, 21, 23, 8, 9 */ ! /* PJC: also remove ^A(1) ^E(5) ^X(29) ESC(27) for line-editting.. CHECK!! */ memset(terminators, 0, sizeof(terminators)); --- 144,148 ---- /* All control chars except ^R ^U ^W, BS & HT */ /* ie 18, 21, 23, 8, 9 */ ! /* PJC: also remove ^A(1) ^E(5) ^X(29) for line-editting.. CHECK!! */ memset(terminators, 0, sizeof(terminators)); *************** *** 149,153 **** terminators[1] = 0xFC; terminators[2] = 0x5B; ! terminators[3] = 0xD7; } --- 150,154 ---- terminators[1] = 0xFC; terminators[2] = 0x5B; ! terminators[3] = 0xDF; } *************** *** 329,344 **** buf[i] = '\r'; ! /* Check for OOB - these discard input */ ! if (buf[i] == CTRL_C || buf[i] == CTRL_Y) { ! send_oob(buf[i], 1); ! continue; ! } ! /* Check for OOB - these don't */ ! if (buf[i] == CTRL_T) ! { ! send_oob(buf[i], 0); ! continue; } --- 330,344 ---- buf[i] = '\r'; ! /* Check for OOB */ ! if (char_attr[(int)buf[i]] & 3) { ! int oob_discard = (char_attr[(int)buf[i]]>>2)&1; ! send_oob(buf[i], oob_discard); ! if (oob_discard) ! { ! input_len = input_pos = 0; ! } ! continue; } *************** *** 399,404 **** { memcpy(input_buf+input_len, esc_buf, esc_len); ! send_input(input_buf, input_len+esc_len, input_len, 3); ! interpret_escape = 0; } esc_len = 0; --- 399,404 ---- { memcpy(input_buf+input_len, esc_buf, esc_len); ! send_input(input_buf, input_len+esc_len, input_len, 1); ! echo = 1; } esc_len = 0; *************** *** 429,433 **** break; case CTRL_A: /* switch overstrike/insert mode */ ! insert_mode = 1-insert_mode; break; case CTRL_W: /* redraw */ --- 429,433 ---- break; case CTRL_A: /* switch overstrike/insert mode */ ! insert_mode = ~insert_mode; break; case CTRL_W: /* redraw */ *************** *** 439,442 **** --- 439,445 ---- input_len = input_pos = 0; reading = 0; + case CTRL_O: + // TODO echo "output on/off" + discard = ~discard; break; case DEL: |
From: Patrick C. <pa...@us...> - 2005-10-21 12:13:28
|
Update of /cvsroot/linux-decnet/dnprogs/dnlogin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20518 Modified Files: Makefile cterm.c dnlogin.c dnlogin.h found.c tty.c tty.h Log Message: More editting, and edt (though not TPU) now works. Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** Makefile 12 Aug 2004 09:17:33 -0000 1.4 --- Makefile 21 Oct 2005 12:13:17 -0000 1.5 *************** *** 9,15 **** PROG1OBJS=dnlogin.o found.o cterm.o tty.o all: $(PROG1) ! $(PROG1): $(PROG1OBJS) $(DEPLIBDNET) $(CC) -o $@ $(PROG1OBJS) $(LIBDNET) --- 9,20 ---- PROG1OBJS=dnlogin.o found.o cterm.o tty.o + CFLAGS+=-funsigned-char + + CFLAGS+=-g + #CFLAGS+=-O2 + all: $(PROG1) ! $(PROG1): $(PROG1OBJS) tty.h dnlogin.h $(DEPLIBDNET) $(CC) -o $@ $(PROG1OBJS) $(LIBDNET) Index: cterm.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/cterm.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** cterm.c 20 Oct 2005 16:07:31 -0000 1.11 --- cterm.c 21 Oct 2005 12:13:17 -0000 1.12 *************** *** 124,133 **** 1,FALSE,FALSE}; ! unsigned char char_attr[256]; /* Process incoming CTERM messages */ static int cterm_process_initiate(char *buf, int len) { ! unsigned char initsq[] = { 0x01, 0x00, 0x01, 0x04, 0x00, 'd', 'n', 'l', 'o', 'g', 'i', 'n', ' ', --- 124,133 ---- 1,FALSE,FALSE}; ! char char_attr[256]; /* Process incoming CTERM messages */ static int cterm_process_initiate(char *buf, int len) { ! char initsq[] = { 0x01, 0x00, 0x01, 0x04, 0x00, 'd', 'n', 'l', 'o', 'g', 'i', 'n', ' ', *************** *** 151,157 **** unsigned short sodisplay; unsigned short lowwater; ! unsigned char term_len; ! int ptr = 0; ! unsigned char ZZ; flags = buf[1] | (buf[2] << 8) | (buf[3] << 16); --- 151,158 ---- unsigned short sodisplay; unsigned short lowwater; ! char term_len; ! int ptr = 0; ! unsigned char ZZ, EE, DDD, Q, II; ! int old_esc_state; flags = buf[1] | (buf[2] << 8) | (buf[3] << 16); *************** *** 166,170 **** term_len = buf[ptr++]; ! ZZ = (flags>>14)&3; // TODO more flags (Page 59) --- 167,175 ---- term_len = buf[ptr++]; ! ZZ = (flags>>14)&3; ! EE = (flags>>16)&3; ! DDD = (flags>>8)&7; ! Q = (flags>>13)&1; ! II = (flags>>6)&3; // TODO more flags (Page 59) *************** *** 185,189 **** // EE 1=Do NOT perform esc-seq recognition (this read only) // 2=DO perform esc-seq recognition (this read only) - // --- 190,193 ---- *************** *** 191,195 **** if (debug & 2) fprintf(stderr, "CTERM: len=%d, term_len=%d, ptr=%d\n", len, term_len, ptr); ! if (debug & 2) fprintf(stderr, "CTERM: timeout = %d\n", timeout); if (flags & 4) tty_clear_typeahead(); --- 195,199 ---- if (debug & 2) fprintf(stderr, "CTERM: len=%d, term_len=%d, ptr=%d\n", len, term_len, ptr); ! if (debug & 2) fprintf(stderr, "CTERM: Q=%d timeout = %d, EE=%d\n", Q, timeout, EE); if (flags & 4) tty_clear_typeahead(); *************** *** 198,205 **** if (ZZ==1) tty_set_terminators(buf+ptr, term_len); if (ZZ==2) tty_set_default_terminators(); tty_start_read(buf+ptr+term_len, len-term_len-ptr, eoprompt); ! tty_set_timeout(timeout); tty_set_maxlen(maxlength); tty_echo_terminator((flags>>12)&1); --- 202,212 ---- if (ZZ==1) tty_set_terminators(buf+ptr, term_len); if (ZZ==2) tty_set_default_terminators(); + if (EE) old_esc_state = tty_set_escape_proc(EE-1); + tty_allow_edit(!(DDD==2)); + tty_set_uppercase(II==2); tty_start_read(buf+ptr+term_len, len-term_len-ptr, eoprompt); ! if (Q) tty_set_timeout(timeout); tty_set_maxlen(maxlength); tty_echo_terminator((flags>>12)&1); *************** *** 208,218 **** } ! static int cterm_process_read_data(unsigned char *buf, int len) {return len;} ! static int cterm_process_oob(unsigned char *buf, int len) {return len;} ! static int cterm_process_unread(unsigned char *buf, int len) { tty_send_unread(); --- 215,225 ---- } ! static int cterm_process_read_data(char *buf, int len) {return len;} ! static int cterm_process_oob(char *buf, int len) {return len;} ! static int cterm_process_unread(char *buf, int len) { tty_send_unread(); *************** *** 220,230 **** } ! static int cterm_process_clear_input(unsigned char *buf, int len) {return len;} ! static void send_prepostfix(int flag, unsigned char data) { int i; ! unsigned char feed; if (debug & 2)fprintf(stderr, "CTERM: send_prepostfix: flag =%d, data=%d\n", flag, data); --- 227,237 ---- } ! static int cterm_process_clear_input(char *buf, int len) {return len;} ! static void send_prepostfix(int flag, char data) { int i; ! char feed; if (debug & 2)fprintf(stderr, "CTERM: send_prepostfix: flag =%d, data=%d\n", flag, data); *************** *** 246,255 **** } ! static int cterm_process_write(unsigned char *buf, int len) { unsigned short flags = buf[1] | buf[2]<<8; ! unsigned char prefixdata = buf[3]; ! unsigned char postfixdata = buf[4]; ! unsigned char feed; // TODO: flags... --- 253,262 ---- } ! static int cterm_process_write(char *buf, int len) { unsigned short flags = buf[1] | buf[2]<<8; ! char prefixdata = buf[3]; ! char postfixdata = buf[4]; ! char feed; // TODO: flags... *************** *** 278,288 **** } ! static int cterm_process_write_complete(unsigned char *buf, int len) {return len;} ! static int cterm_process_discard_state(unsigned char *buf, int len) {return len;} ! static int cterm_process_read_characteristics(unsigned char *buf, int len) { int bufptr = 2;/* skip past flags */ --- 285,295 ---- } ! static int cterm_process_write_complete(char *buf, int len) {return len;} ! static int cterm_process_discard_state(char *buf, int len) {return len;} ! static int cterm_process_read_characteristics(char *buf, int len) { int bufptr = 2;/* skip past flags */ *************** *** 449,453 **** if ((selector & 0x300) == 0x200) /* Handler Charact */ { ! unsigned char c; outbuf[outptr++] = selector & 0xFF; --- 456,460 ---- if ((selector & 0x300) == 0x200) /* Handler Charact */ { ! char c; outbuf[outptr++] = selector & 0xFF; *************** *** 511,520 **** } ! static int cterm_process_characteristics(unsigned char *buf, int len) { int bufptr = 2; /* skip past flags */ int selector; ! unsigned char c; ! unsigned char mask, val; while (bufptr < len) --- 518,527 ---- } ! static int cterm_process_characteristics(char *buf, int len) { int bufptr = 2; /* skip past flags */ int selector; ! char c; ! char mask, val; while (bufptr < len) *************** *** 538,543 **** mask = buf[bufptr+1]; val = buf[bufptr+2]; ! char_attr[c] &= ~mask; // clear those in the mask ! char_attr[c] |= (val & mask); // set the new ones. bufptr += 3; break; --- 545,550 ---- mask = buf[bufptr+1]; val = buf[bufptr+2]; ! char_attr[(int)c] &= ~mask; // clear those in the mask ! char_attr[(int)c] |= (val & mask); // set the new ones. bufptr += 3; break; *************** *** 559,562 **** --- 566,570 ---- han_char.input_escseq_recognition = buf[bufptr]; bufptr += 1; + tty_set_escape_proc(han_char.input_escseq_recognition); break; *************** *** 586,600 **** } ! static int cterm_process_check_input(unsigned char *buf, int len) {return len;} ! static int cterm_process_input_count(unsigned char *buf, int len) {return len;} ! static int cterm_process_input_state(unsigned char *buf, int len) {return len;} /* Process buffer from cterm host */ ! int cterm_process_network(unsigned char *buf, int len) { int offset = 0; --- 594,608 ---- } ! static int cterm_process_check_input(char *buf, int len) {return len;} ! static int cterm_process_input_count(char *buf, int len) {return len;} ! static int cterm_process_input_state(char *buf, int len) {return len;} /* Process buffer from cterm host */ ! int cterm_process_network(char *buf, int len) { int offset = 0; *************** *** 652,656 **** default: fprintf(stderr, "Unknown cterm message %d received, offset=%d\n", ! (unsigned char)buf[offset], offset); return -1; } --- 660,664 ---- default: fprintf(stderr, "Unknown cterm message %d received, offset=%d\n", ! (char)buf[offset], offset); return -1; } *************** *** 673,677 **** /* Echo needed ? */ ! if (char_attr[oobchar] & 0x30) //TODO NAME! { if (oobchar == CTRL_C || oobchar == CTRL_Y) --- 681,685 ---- /* Echo needed ? */ ! if (char_attr[(int)oobchar] & 0x30) //TODO NAME! { if (oobchar == CTRL_C || oobchar == CTRL_Y) *************** *** 684,688 **** } ! int cterm_send_input(unsigned char *buf, int len, int term_pos, int flags) { char newbuf[len+9]; --- 692,696 ---- } ! int cterm_send_input(char *buf, int len, int term_pos, int flags) { char newbuf[len+9]; Index: dnlogin.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/dnlogin.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** dnlogin.c 21 Apr 2003 16:20:34 -0000 1.8 --- dnlogin.c 21 Oct 2005 12:13:17 -0000 1.9 *************** *** 39,42 **** --- 39,43 ---- int debug = 0; int char_timeout = 0; + int timeout_valid = 0; static int mainloop(void) *************** *** 46,49 **** --- 47,54 ---- char inbuf[1024]; struct timeval tv; + int res; + + tv.tv_usec = 0; + tv.tv_sec = char_timeout; fd_set in_set; *************** *** 52,60 **** FD_SET(found_getsockfd(), &in_set); ! if (select(FD_SETSIZE, &in_set, NULL, NULL, NULL) < 0) { break; } /* Read from keyboard */ if (FD_ISSET(termfd, &in_set)) --- 57,71 ---- FD_SET(found_getsockfd(), &in_set); ! if ( (res=select(FD_SETSIZE, &in_set, NULL, NULL, timeout_valid?&tv:NULL)) < 0) { break; } + if (res == 0) /* Timeout */ + { + tty_timeout(); + timeout_valid = 0; + } + /* Read from keyboard */ if (FD_ISSET(termfd, &in_set)) *************** *** 155,159 **** if (found_setup_link(argv[optind], DNOBJECT_CTERM, cterm_process_network) == 0) { ! tty_setup("/dev/tty", 1); mainloop(); tty_setup(NULL, 0); --- 166,170 ---- if (found_setup_link(argv[optind], DNOBJECT_CTERM, cterm_process_network) == 0) { ! tty_setup("/dev/fd/0", 1); mainloop(); tty_setup(NULL, 0); Index: dnlogin.h =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/dnlogin.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** dnlogin.h 20 Oct 2005 16:07:31 -0000 1.11 --- dnlogin.h 21 Oct 2005 12:13:17 -0000 1.12 *************** *** 18,40 **** extern char *found_connerror(void); extern int found_getsockfd(void); ! extern int found_write(unsigned char *buf, int len); extern int found_read(void); ! extern int found_setup_link(char *node, int object, int (*processor)(unsigned char *, int)); ! extern int found_common_write(unsigned char *buf, int len); /* cterm/dterm routines */ ! extern int cterm_send_input(unsigned char *buf, int len, int term_pos, int flags); extern int cterm_send_oob(char, int); ! extern int cterm_process_network(unsigned char *buf, int len); /* TTY routines */ ! extern int tty_write(unsigned char *buf, int len); ! extern void tty_set_terminators(unsigned char *buf, int len); ! void tty_set_default_terminators(void); extern void tty_start_read(char *prompt, int len, int promptlen); extern void tty_set_timeout(unsigned short to); extern void tty_set_maxlen(unsigned short len); extern void tty_send_unread(void); ! extern int tty_process_terminal(unsigned char *inbuf, int len); extern int tty_setup(char *name, int setup); extern void tty_clear_typeahead(void); --- 18,41 ---- extern char *found_connerror(void); extern int found_getsockfd(void); ! extern int found_write(char *buf, int len); extern int found_read(void); ! extern int found_setup_link(char *node, int object, int (*processor)(char *, int)); ! extern int found_common_write(char *buf, int len); /* cterm/dterm routines */ ! extern int cterm_send_input(char *buf, int len, int term_pos, int flags); extern int cterm_send_oob(char, int); ! extern int cterm_process_network(char *buf, int len); /* TTY routines */ ! extern int tty_write(char *buf, int len); ! extern void tty_set_terminators(char *buf, int len); ! extern void tty_timeout(void); ! extern void tty_set_default_terminators(void); extern void tty_start_read(char *prompt, int len, int promptlen); extern void tty_set_timeout(unsigned short to); extern void tty_set_maxlen(unsigned short len); extern void tty_send_unread(void); ! extern int tty_process_terminal(char *inbuf, int len); extern int tty_setup(char *name, int setup); extern void tty_clear_typeahead(void); *************** *** 42,47 **** extern void tty_echo_terminator(int a); extern void tty_set_discard(int onoff); ! extern int (*send_input)(unsigned char *buf, int len, int term_pos, int flags); extern int (*send_oob)(char, int); --- 43,51 ---- extern void tty_echo_terminator(int a); extern void tty_set_discard(int onoff); + extern int tty_set_escape_proc(int onoff); + extern void tty_set_uppercase(int onoff); + extern void tty_allow_edit(int onoff); ! extern int (*send_input)(char *buf, int len, int term_pos, int flags); extern int (*send_oob)(char, int); Index: found.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/found.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** found.c 20 Oct 2005 16:07:31 -0000 1.10 --- found.c 21 Oct 2005 12:13:17 -0000 1.11 *************** *** 84,89 **** struct common_header { ! unsigned char msg; ! unsigned char pad; unsigned short len; }; --- 84,89 ---- struct common_header { ! char msg; ! char pad; unsigned short len; }; *************** *** 91,100 **** static int sockfd = -1; ! static int (*terminal_processor)(unsigned char *, int); static int send_bindaccept(void) { int wrote; ! unsigned char bindacc_msg[] = { FOUND_MSG_BINDACCEPT, --- 91,100 ---- static int sockfd = -1; ! static int (*terminal_processor)(char *, int); static int send_bindaccept(void) { int wrote; ! char bindacc_msg[] = { FOUND_MSG_BINDACCEPT, *************** *** 121,125 **** /* Write "Common data" with a foundation header */ ! int found_common_write(unsigned char *buf, int len) { struct iovec vectors[2]; --- 121,125 ---- /* Write "Common data" with a foundation header */ ! int found_common_write(char *buf, int len) { struct iovec vectors[2]; *************** *** 133,137 **** for (i=0; i<len; i++) ! fprintf(stderr, "%02x ", (unsigned char)buf[i]); fprintf(stderr, "\n\n"); } --- 133,137 ---- for (i=0; i<len; i++) ! fprintf(stderr, "%02x ", (char)buf[i]); fprintf(stderr, "\n\n"); } *************** *** 163,167 **** { int len; ! unsigned char inbuf[1024]; int ptr = 0; --- 163,167 ---- { int len; ! char inbuf[1024]; int ptr = 0; *************** *** 183,187 **** for (i=0; i<len; i++) ! fprintf(stderr, "%02x ", (unsigned char)inbuf[i]); fprintf(stderr, "\n\n"); } --- 183,187 ---- for (i=0; i<len; i++) ! fprintf(stderr, "%02x ", (char)inbuf[i]); fprintf(stderr, "\n\n"); } *************** *** 239,243 **** /* Open the DECnet connection */ ! int found_setup_link(char *node, int object, int (*processor)(unsigned char *, int)) { struct nodeent *np; --- 239,243 ---- /* Open the DECnet connection */ ! int found_setup_link(char *node, int object, int (*processor)(char *, int)) { struct nodeent *np; Index: tty.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/tty.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** tty.c 20 Oct 2005 16:07:31 -0000 1.10 --- tty.c 21 Oct 2005 12:13:17 -0000 1.11 *************** *** 1,4 **** /****************************************************************************** ! (c) 2002-2003 P.J. Caulfield pa...@de... This program is free software; you can redistribute it and/or modify --- 1,4 ---- /****************************************************************************** ! (c) 2002-2005 P.J. Caulfield pa...@de... This program is free software; you can redistribute it and/or modify *************** *** 39,43 **** /* Input state buffers & variables */ ! static unsigned char terminators[32]; static char rahead_buf[128]; static int rahead_len=0; --- 39,43 ---- /* Input state buffers & variables */ ! static char terminators[32]; static char rahead_buf[128]; static int rahead_len=0; *************** *** 47,50 **** --- 47,51 ---- static char prompt_buf[1024]; static char prompt_len=0; + static char line_start_pos=0; static char esc_buf[132]; static int esc_len=0; *************** *** 55,64 **** static int echo_terminator = 0; static int discard = 0; /* in dnlogin.c */ extern int char_timeout; /* Output processors */ ! int (*send_input)(unsigned char *buf, int len, int term_pos, int flags); int (*send_oob)(char oobchar, int discard); --- 56,69 ---- static int echo_terminator = 0; static int discard = 0; + static int interpret_escape = 0; + static int allow_edit = 0; + static int convert_uppercase = 0; /* in dnlogin.c */ extern int char_timeout; + extern int timeout_valid; /* Output processors */ ! int (*send_input)(char *buf, int len, int term_pos, int flags); int (*send_oob)(char oobchar, int discard); *************** *** 74,81 **** reading = 0; echo = 1; } /* Raw write to terminal */ ! int tty_write(unsigned char *buf, int len) { if (discard) --- 79,95 ---- reading = 0; echo = 1; + interpret_escape = 0; + } + + /* Called when select() times out */ + void tty_timeout() + { + if (debug & 4) + fprintf(stderr, "TTY: timeout\n"); + send_input_buffer(5); } /* Raw write to terminal */ ! int tty_write(char *buf, int len) { if (discard) *************** *** 96,99 **** --- 110,131 ---- } + void tty_set_uppercase(int onoff) + { + convert_uppercase = onoff; + } + + void tty_allow_edit(int onoff) + { + allow_edit = onoff; + } + + int tty_set_escape_proc(int onoff) + { + int oldval = interpret_escape; + interpret_escape = onoff; + + return interpret_escape; + } + void tty_echo_terminator(int a) { *************** *** 111,128 **** /* All control chars except ^R ^U ^W, BS & HT */ /* ie 18, 21, 23, 8, 9 */ ! /* PJC: also remove ^A(1) ^E(5) ^X(29) ^U(21) for line-editting.. CHECK!! */ memset(terminators, 0, sizeof(terminators)); ! terminators[0] = 0x7F; ! terminators[1] = 0xFE; ! terminators[2] = 0xAD; ! terminators[3] = 0xFF; ! ! // terminators[0] = 0x6A; ! // terminators[1] = 0xFE; ! // terminators[2] = 0xAD; ! // terminators[3] = 0xEF; } ! void tty_set_terminators(unsigned char *buf, int len) { if (debug & 4) { --- 143,156 ---- /* All control chars except ^R ^U ^W, BS & HT */ /* ie 18, 21, 23, 8, 9 */ ! /* PJC: also remove ^A(1) ^E(5) ^X(29) ESC(27) for line-editting.. CHECK!! */ memset(terminators, 0, sizeof(terminators)); ! ! terminators[0] = 0xDD; ! terminators[1] = 0xFC; ! terminators[2] = 0x5B; ! terminators[3] = 0xD7; } ! void tty_set_terminators(char *buf, int len) { if (debug & 4) { *************** *** 140,143 **** --- 168,172 ---- void tty_start_read(char *prompt, int len, int promptlen) { + int i; if (debug & 4) fprintf(stderr, "TTY: start_read promptlen = %d, maxlen=%d\n", *************** *** 151,154 **** --- 180,189 ---- prompt_len = promptlen; + /* Work out the position of the cursor after the prompt (which may contain CRLF chars ) */ + line_start_pos = 0; + for (i = 0; i<prompt_len; i++) + if (prompt_buf[i] >= ' ') + line_start_pos++; + /* Prefilled data (eg a recalled command) */ memcpy(input_buf, prompt+promptlen, len-promptlen); *************** *** 180,184 **** void tty_set_timeout(unsigned short to) { ! char_timeout = to; } --- 215,220 ---- void tty_set_timeout(unsigned short to) { ! timeout_valid = 1; ! char_timeout = to; } *************** *** 232,240 **** msk = (1 << aux); ! if (debug > 4) ! fprintf(stderr, "is_terminator: %d: %s\n", c, ! (terminators[termind] && msk)?"Yes":"No"); ! if (terminators[termind] && msk) { return 1; --- 268,276 ---- msk = (1 << aux); ! if (debug & 4) ! fprintf(stderr, "TTY: is_terminator: %d: (byte=%x, msk=%x) %s\n", c, terminators[termind],msk, ! (terminators[termind] & msk)?"Yes":"No"); ! if (terminators[termind] & msk) { return 1; *************** *** 264,269 **** } /* Input from keyboard */ ! int tty_process_terminal(unsigned char *buf, int len) { int i; --- 300,316 ---- } + + static void redraw_input_line(void) + { + if (!echo) + return; + move_cursor_abs(line_start_pos); + erase_eol(); + write(termfd, input_buf, input_len); + move_cursor_abs(line_start_pos + input_pos); + } + /* Input from keyboard */ ! int tty_process_terminal(char *buf, int len) { int i; *************** *** 282,292 **** buf[i] = '\r'; - /* Is it ESCAPE ? */ - if (buf[i] == ESC && esc_len == 0) - { - esc_buf[esc_len++] = buf[i]; - continue; - } - /* Check for OOB - these discard input */ if (buf[i] == CTRL_C || buf[i] == CTRL_Y) --- 329,332 ---- *************** *** 303,306 **** --- 343,353 ---- } + /* Is it ESCAPE ? */ + if (buf[i] == ESC && esc_len == 0 && interpret_escape) + { + esc_buf[esc_len++] = buf[i]; + continue; + } + /* Terminators */ if (!esc_len && is_terminator(buf[i])) *************** *** 320,351 **** { esc_buf[esc_len++] = buf[i]; ! if (isalpha(buf[i])) { int esc_done = 0; ! /* Process escape sequences */ ! if (strncmp(esc_buf, "\033[C", 3) == 0) /* Cursor RIGHT */ ! { ! if (input_pos < input_len) ! { ! input_pos++; ! if (echo) write(termfd, esc_buf, esc_len); ! } ! esc_done = 1; ! } ! if (strncmp(esc_buf, "\033[D", 3) == 0) /* Cursor LEFT */ { ! if (input_pos > 0) ! { ! input_pos--; ! if (echo) write(termfd, esc_buf, esc_len); ! } ! esc_done = 1; } /* If we didn't process it above, then just send it to ! the host */ if (!esc_done) { ! send_input(esc_buf, esc_len, 0, 3); //woz2 } esc_len = 0; --- 367,404 ---- { esc_buf[esc_len++] = buf[i]; ! if (isalpha(buf[i]) || buf[i] == '~') { int esc_done = 0; ! if (allow_edit) { ! /* Process escape sequences */ ! if (strncmp(esc_buf, "\033[C", 3) == 0) /* Cursor RIGHT */ ! { ! if (input_pos < input_len) ! { ! input_pos++; ! if (echo) write(termfd, esc_buf, esc_len); ! } ! esc_done = 1; ! } ! if (strncmp(esc_buf, "\033[D", 3) == 0) /* Cursor LEFT */ ! { ! if (input_pos > 0) ! { ! input_pos--; ! if (echo) write(termfd, esc_buf, esc_len); ! } ! esc_done = 1; ! } } + /* If we didn't process it above, then just send it to ! the host on the end of whatever is also in the buffer */ if (!esc_done) { ! memcpy(input_buf+input_len, esc_buf, esc_len); ! send_input(input_buf, input_len+esc_len, input_len, 3); ! interpret_escape = 0; } esc_len = 0; *************** *** 355,359 **** /* Process non-terminator control chars */ ! if (buf[i] < ' ' || buf[i] == DEL) { switch (buf[i]) --- 408,412 ---- /* Process non-terminator control chars */ ! if ((buf[i] < ' ' || buf[i] == DEL) && allow_edit) { switch (buf[i]) *************** *** 363,376 **** case CTRL_X: // delete input line case CTRL_U: // delete input line ! move_cursor_abs(prompt_len); if (echo) erase_eol(); input_pos = input_len = 0; break; case CTRL_H: // back to start of line ! if (echo) move_cursor_abs(prompt_len); input_pos = 0; break; case CTRL_E: // Move to end of line ! if (echo) move_cursor_abs(input_len); input_pos = input_len; break; --- 416,429 ---- case CTRL_X: // delete input line case CTRL_U: // delete input line ! move_cursor_abs(line_start_pos); if (echo) erase_eol(); input_pos = input_len = 0; break; case CTRL_H: // back to start of line ! if (echo) move_cursor_abs(line_start_pos); input_pos = 0; break; case CTRL_E: // Move to end of line ! if (echo) move_cursor_abs(input_len+line_start_pos); input_pos = input_len; break; *************** *** 378,381 **** --- 431,437 ---- insert_mode = 1-insert_mode; break; + case CTRL_W: /* redraw */ + redraw_input_line(); + break; case CTRL_M: input_buf[input_len++] = buf[i]; *************** *** 388,399 **** { input_pos--; ! input_len = input_pos; if (echo) write(termfd, "\033[D \033[D", 7); } - break; } continue; } /* Read not active, store in the read ahead buffer */ if (!reading) --- 444,463 ---- { input_pos--; ! input_len--; if (echo) write(termfd, "\033[D \033[D", 7); + if (input_pos != input_len) + { + memmove(input_buf+input_pos, input_buf+input_pos+1, input_len-input_pos); + redraw_input_line(); + } + break; } } continue; } + if (convert_uppercase) + buf[i] &= 0x5F; + /* Read not active, store in the read ahead buffer */ if (!reading) *************** *** 404,416 **** } ! /* echo if req'd */ ! if (echo) write(termfd, &buf[i], 1); ! /* Check for buffer overflow */ input_buf[input_pos++] = buf[i]; if (input_len < input_pos) input_len = input_pos; if (input_len >= max_read_len) { --- 468,488 ---- } ! /* echo if req'd, insert will redraw the whole line */ ! if (echo && !insert_mode) write(termfd, &buf[i], 1); ! if (insert_mode && input_len > input_pos) ! { ! memmove(input_buf+input_pos+1, input_buf+input_pos, input_len-input_pos); ! input_len++; ! } input_buf[input_pos++] = buf[i]; + if (input_len < input_pos) input_len = input_pos; + if (insert_mode) + redraw_input_line(); + if (input_len >= max_read_len) { Index: tty.h =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/tty.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** tty.h 16 Jul 2002 18:41:06 -0000 1.1 --- tty.h 21 Oct 2005 12:13:17 -0000 1.2 *************** *** 37,44 **** #define CTRL_S 0x13 #define CTRL_T 0x14 ! //efine CTRL_U 0x15 #define CTRL_V 0x16 #define CTRL_W 0x17 - #define CTRL_U 0x17 #define CTRL_X 0x18 #define CTRL_Y 0x19 --- 37,43 ---- #define CTRL_S 0x13 #define CTRL_T 0x14 ! #define CTRL_U 0x15 #define CTRL_V 0x16 #define CTRL_W 0x17 #define CTRL_X 0x18 #define CTRL_Y 0x19 |
From: Patrick C. <pa...@us...> - 2005-10-20 16:07:40
|
Update of /cvsroot/linux-decnet/dnprogs/dnlogin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10214 Modified Files: cterm.c dnlogin.h found.c tty.c Log Message: Almost line-editting! Index: cterm.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/cterm.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** cterm.c 21 Apr 2003 16:20:34 -0000 1.10 --- cterm.c 20 Oct 2005 16:07:31 -0000 1.11 *************** *** 1,4 **** /****************************************************************************** ! (c) 2002-2003 P.J. Caulfield pa...@de... Portions based on code (c) 2000 Eduardo M Serrat --- 1,4 ---- /****************************************************************************** ! (c) 2002-2005 P.J. Caulfield pa...@de... Portions based on code (c) 2000 Eduardo M Serrat *************** *** 33,36 **** --- 33,37 ---- #include "dn_endian.h" #include "dnlogin.h" + #include "tty.h" #ifndef TRUE *************** *** 126,130 **** /* Process incoming CTERM messages */ ! static int cterm_process_initiate(unsigned char *buf, int len) { unsigned char initsq[] = --- 127,131 ---- /* Process incoming CTERM messages */ ! static int cterm_process_initiate(char *buf, int len) { unsigned char initsq[] = *************** *** 141,145 **** } ! static int cterm_process_start_read(unsigned char *buf, int len) { unsigned int flags; --- 142,146 ---- } ! static int cterm_process_start_read(char *buf, int len) { unsigned int flags; *************** *** 167,172 **** ZZ = (flags>>14)&3; ! // TODO more flags ! if (debug & 2) fprintf(stderr, "CTERM: flags = %x (ZZ=%d)\n",flags, ZZ); if (debug & 2) fprintf(stderr, "CTERM: len=%d, term_len=%d, ptr=%d\n", len, term_len, ptr); --- 168,192 ---- ZZ = (flags>>14)&3; ! // TODO more flags (Page 59) ! // EE ZZQT NDDD IIKV FCUU ! // UU 1=write BEL on underflow, 2=terminate on underflow ! // C 1=clear typeahead ! // F 1=if last char was CR, end LF, discard LF if first char of ! // preloaded input (whatever that is) ! // V 1=Terminate if vertical pos changes while echoing input char. ! // K 1=This is a continuation of previous read - see doc ! // II 2=Convert lower to uppercase ! // DDD 1=Disable ^U & ^R only, 2=Disable all editing control chars ! // 3=Disable all editting chars EXCEPT XON/XOFF ! // N 1=Do not echo chars from this read ! // T 1=echo terminator, 0=no not echo terminator ! // Q 1=Timeout field is present ! // ZZ 1=Use this terminator set, 2=use universal terminator set. ! // EE 1=Do NOT perform esc-seq recognition (this read only) ! // 2=DO perform esc-seq recognition (this read only) ! ! // ! ! if (debug & 2) fprintf(stderr, "CTERM: process_start_read. flags = %x (ZZ=%d)\n",flags, ZZ); if (debug & 2) fprintf(stderr, "CTERM: len=%d, term_len=%d, ptr=%d\n", len, term_len, ptr); *************** *** 180,183 **** --- 200,204 ---- tty_start_read(buf+ptr+term_len, len-term_len-ptr, eoprompt); + tty_set_timeout(timeout); tty_set_maxlen(maxlength); *************** *** 202,205 **** --- 223,249 ---- {return len;} + static void send_prepostfix(int flag, unsigned char data) + { + int i; + unsigned char feed; + + if (debug & 2)fprintf(stderr, "CTERM: send_prepostfix: flag =%d, data=%d\n", flag, data); + if (flag == 0) + return; + + if (flag == 1) + { + int i; + + feed = '\r'; + tty_write(&feed, 1); + feed = '\n'; + for (i=0; i<data; i++) + tty_write(&feed, 1); + } + if (flag == 2) + tty_write(&data, 1); + } + static int cterm_process_write(unsigned char *buf, int len) { *************** *** 207,213 **** --- 251,278 ---- unsigned char prefixdata = buf[3]; unsigned char postfixdata = buf[4]; + unsigned char feed; // TODO: flags... + // TSQQ PPEB DLUU + // UU lock handling "Page 65" + // L 1=Output LF at end and set a flag to skip next LF i nnext write + // D 1=Set output discard state to "do not discard" + // B 1=This is the beginning of a host data message + // E 1=This is the end of a host data message + // PP 1=prefixdata is a newline count, 2=prefixdata=character + // QQ 1=postfix is a newline count, 2=postfix=character + // S 1=Send write completion when this wrote completes + // T 1=This data is written to foundation servics transparently + + if (debug & 2) fprintf(stderr, "CTERM: process_write flags = %x (prefix=%d,postfix=%d)\n",flags, prefixdata, postfixdata); + + if (flags >> 3) + tty_set_discard(!(flags>>3)); + + send_prepostfix(((flags >> 6) & 3), prefixdata); //PP + tty_write(buf+4, len-4); + + send_prepostfix(((flags >> 8) & 3), postfixdata); //QQ return len; } *************** *** 415,419 **** case 0x06: /* Input Escape Seq Recognition */ ! outbuf[outptr++]=han_char.input_escseq_recognition; break; --- 480,484 ---- case 0x06: /* Input Escape Seq Recognition */ ! outbuf[outptr++]= han_char.input_escseq_recognition; break; *************** *** 447,451 **** static int cterm_process_characteristics(unsigned char *buf, int len) ! {return len;} static int cterm_process_check_input(unsigned char *buf, int len) --- 512,588 ---- static int cterm_process_characteristics(unsigned char *buf, int len) ! { ! int bufptr = 2; /* skip past flags */ ! int selector; ! unsigned char c; ! unsigned char mask, val; ! ! while (bufptr < len) ! { ! selector = buf[bufptr] | (buf[bufptr+1]<<8); ! if ((selector & 0x300) != 0x200) ! { ! // TODO other characteristics ? ! return len; ! } ! selector &= 0xFF; ! bufptr += 2; /* Point to selector value */ ! switch(selector) ! { ! case 0x01: ! han_char.ignore_input = buf[bufptr]; ! bufptr += 1; ! break; ! case 0x02: /* Character attributes */ ! c = buf[bufptr]; ! mask = buf[bufptr+1]; ! val = buf[bufptr+2]; ! char_attr[c] &= ~mask; // clear those in the mask ! char_attr[c] |= (val & mask); // set the new ones. ! bufptr += 3; ! break; ! ! case 0x03: /* Control-o pass through */ ! han_char.control_o_pass_through = buf[bufptr]; ! bufptr += 1; ! break; ! case 0x04: /* Raise Input */ ! han_char.raise_input = buf[bufptr]; ! bufptr += 1; ! break; ! case 0x05: /* Normal Echo */ ! han_char.normal_echo = buf[bufptr]; ! bufptr += 1; ! break; ! ! case 0x06: /* Input Escape Seq Recognition */ ! han_char.input_escseq_recognition = buf[bufptr]; ! bufptr += 1; ! break; ! ! case 0x07: /* Output Esc Seq Recognition */ ! han_char.output_escseq_recognition=buf[bufptr]; ! bufptr += 1; ! break; ! ! case 0x08: /* Input count state */ ! han_char.input_count_state = buf[bufptr] | buf[bufptr+1]<<8; ! bufptr += 2; ! break; ! ! case 0x09: /* Auto Prompt */ ! han_char.auto_prompt = buf[bufptr]; ! bufptr += 1; ! break; ! ! case 0x0A: /* Error processing option */ ! han_char.error_processing = buf[bufptr]; ! bufptr += 1; ! break; ! } ! } ! ! return len; ! } static int cterm_process_check_input(unsigned char *buf, int len) *************** *** 526,529 **** --- 663,667 ---- { char newbuf[3]; + int ret; if (debug & 2) fprintf(stderr, "CTERM: sending OOB char %d\n", oobchar); *************** *** 532,540 **** newbuf[2] = oobchar; ! return found_common_write(newbuf, 3); } ! int cterm_send_input(unsigned char *buf, int len, int flags) { char newbuf[len+9]; --- 670,688 ---- newbuf[2] = oobchar; ! ret = found_common_write(newbuf, 3); ! ! /* Echo needed ? */ ! if (char_attr[oobchar] & 0x30) //TODO NAME! ! { ! if (oobchar == CTRL_C || oobchar == CTRL_Y) ! tty_write("\n*Interrupt*\n", 13); ! if (oobchar == CTRL_O) ! tty_write("\n*Output On/Off*\n", 16); ! } ! return ret; } ! int cterm_send_input(unsigned char *buf, int len, int term_pos, int flags) { char newbuf[len+9]; *************** *** 548,553 **** newbuf[4] = 0; // vert pos newbuf[5] = 0; // horiz pos ! newbuf[6] = len-1; // term pos 1 ! newbuf[7] = (len-1) << 8; // term pos 2 memcpy(newbuf+8, buf, len); --- 696,701 ---- newbuf[4] = 0; // vert pos newbuf[5] = 0; // horiz pos ! newbuf[6] = term_pos; ! newbuf[7] = term_pos << 8; memcpy(newbuf+8, buf, len); Index: dnlogin.h =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/dnlogin.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** dnlogin.h 21 Apr 2003 16:20:34 -0000 1.10 --- dnlogin.h 20 Oct 2005 16:07:31 -0000 1.11 *************** *** 24,28 **** /* cterm/dterm routines */ ! extern int cterm_send_input(unsigned char *buf, int len, int flags); extern int cterm_send_oob(char, int); extern int cterm_process_network(unsigned char *buf, int len); --- 24,28 ---- /* cterm/dterm routines */ ! extern int cterm_send_input(unsigned char *buf, int len, int term_pos, int flags); extern int cterm_send_oob(char, int); extern int cterm_process_network(unsigned char *buf, int len); *************** *** 41,46 **** extern void tty_set_noecho(void); extern void tty_echo_terminator(int a); ! extern int (*send_input)(unsigned char *buf, int len, int flags); extern int (*send_oob)(char, int); --- 41,47 ---- extern void tty_set_noecho(void); extern void tty_echo_terminator(int a); + extern void tty_set_discard(int onoff); ! extern int (*send_input)(unsigned char *buf, int len, int term_pos, int flags); extern int (*send_oob)(char, int); Index: found.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/found.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** found.c 21 Apr 2003 14:17:32 -0000 1.9 --- found.c 20 Oct 2005 16:07:31 -0000 1.10 *************** *** 205,209 **** char nomode_msg[] = {0x8}; if (debug) ! fprintf(stderr, "FOUND: Request to enter node = %d\n", inbuf[1]); write(sockfd, nomode_msg, sizeof(nomode_msg)); return 0; --- 205,209 ---- char nomode_msg[] = {0x8}; if (debug) ! fprintf(stderr, "FOUND: Request to enter mode = %d\n", inbuf[1]); write(sockfd, nomode_msg, sizeof(nomode_msg)); return 0; Index: tty.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dnlogin/tty.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** tty.c 21 Apr 2003 16:20:34 -0000 1.9 --- tty.c 20 Oct 2005 16:07:31 -0000 1.10 *************** *** 54,57 **** --- 54,58 ---- static int insert_mode = 0; static int echo_terminator = 0; + static int discard = 0; /* in dnlogin.c */ *************** *** 59,63 **** /* Output processors */ ! int (*send_input)(unsigned char *buf, int len, int flags); int (*send_oob)(char oobchar, int discard); --- 60,64 ---- /* Output processors */ ! int (*send_input)(unsigned char *buf, int len, int term_pos, int flags); int (*send_oob)(char oobchar, int discard); *************** *** 68,72 **** memcpy(buf, input_buf, input_len); ! send_input(buf, input_len, flags); input_len = input_pos = 0; reading = 0; --- 69,74 ---- memcpy(buf, input_buf, input_len); ! // Assumes the terminator (CR) is the last char... ! send_input(buf, input_len, input_len-1, flags); input_len = input_pos = 0; reading = 0; *************** *** 77,89 **** int tty_write(unsigned char *buf, int len) { ! int i; ! for (i=0; i<len; i++) ! { ! if (buf[i] == '\r') ! write(termfd, "\r\n", 2); ! else ! write(termfd, &buf[i], 1); ! } return len; } --- 79,86 ---- int tty_write(unsigned char *buf, int len) { ! if (discard) ! return len; ! write(termfd, buf, len); return len; } *************** *** 94,97 **** --- 91,99 ---- } + void tty_set_discard(int onoff) + { + discard = onoff; + } + void tty_echo_terminator(int a) { *************** *** 109,112 **** --- 111,115 ---- /* All control chars except ^R ^U ^W, BS & HT */ /* ie 18, 21, 23, 8, 9 */ + /* PJC: also remove ^A(1) ^E(5) ^X(29) ^U(21) for line-editting.. CHECK!! */ memset(terminators, 0, sizeof(terminators)); terminators[0] = 0x7F; *************** *** 114,123 **** terminators[2] = 0xAD; terminators[3] = 0xFF; } void tty_set_terminators(unsigned char *buf, int len) { ! if (debug & 4) fprintf(stderr, "TTY: set terminators... %d bytes\n", len); memset(terminators, 0, sizeof(terminators)); memcpy(terminators, buf, len); --- 117,137 ---- terminators[2] = 0xAD; terminators[3] = 0xFF; + + // terminators[0] = 0x6A; + // terminators[1] = 0xFE; + // terminators[2] = 0xAD; + // terminators[3] = 0xEF; } void tty_set_terminators(unsigned char *buf, int len) { ! if (debug & 4) { ! int i; fprintf(stderr, "TTY: set terminators... %d bytes\n", len); + fprintf(stderr, "TTY: terms: "); + for (i=0; i<len; i++) + fprintf(stderr, "%02x ", buf[i]); + fprintf(stderr, "\n"); + } memset(terminators, 0, sizeof(terminators)); memcpy(terminators, buf, len); *************** *** 137,143 **** prompt_len = promptlen; ! memcpy(input_buf, prompt+promptlen, len); ! input_len = 0; input_pos = input_len; max_read_len = len; --- 151,160 ---- prompt_len = promptlen; ! /* Prefilled data (eg a recalled command) */ ! memcpy(input_buf, prompt+promptlen, len-promptlen); ! input_len = len-promptlen; input_pos = input_len; + write(termfd, input_buf, input_len); + max_read_len = len; *************** *** 212,218 **** termind = c / 8; ! aux = c - (termind * 8); msk = (1 << aux); if (terminators[termind] && msk) { --- 229,239 ---- termind = c / 8; ! aux = c % 8; msk = (1 << aux); + if (debug > 4) + fprintf(stderr, "is_terminator: %d: %s\n", c, + (terminators[termind] && msk)?"Yes":"No"); + if (terminators[termind] && msk) { *************** *** 268,284 **** } - /* Terminators */ - if (!esc_len && is_terminator(buf[i])) - { - if (echo_terminator) - { - write(termfd, &buf[i], 1); - } - input_buf[input_len++] = buf[i]; - send_input_buffer(1); - reading = 0; - return 0; - } - /* Check for OOB - these discard input */ if (buf[i] == CTRL_C || buf[i] == CTRL_Y) --- 289,292 ---- *************** *** 289,293 **** /* Check for OOB - these don't */ ! if (buf[i] == CTRL_Z || buf[i] == CTRL_T) { send_oob(buf[i], 0); --- 297,301 ---- /* Check for OOB - these don't */ ! if (buf[i] == CTRL_T) { send_oob(buf[i], 0); *************** *** 295,298 **** --- 303,319 ---- } + /* Terminators */ + if (!esc_len && is_terminator(buf[i])) + { + if (echo_terminator) + { + write(termfd, &buf[i], 1); + } + input_buf[input_len++] = buf[i]; + send_input_buffer(1); + reading = 0; + return 0; + } + /* Still processing escape sequence */ if (esc_len) *************** *** 326,330 **** if (!esc_done) { ! send_input(esc_buf, esc_len, 2); } esc_len = 0; --- 347,351 ---- if (!esc_done) { ! send_input(esc_buf, esc_len, 0, 3); //woz2 } esc_len = 0; *************** *** 350,353 **** --- 371,378 ---- input_pos = 0; break; + case CTRL_E: // Move to end of line + if (echo) move_cursor_abs(input_len); + input_pos = input_len; + break; case CTRL_A: /* switch overstrike/insert mode */ insert_mode = 1-insert_mode; |
From: Patrick C. <pa...@us...> - 2005-10-18 07:29:26
|
Update of /cvsroot/linux-decnet/dnprogs/dapfs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23482/dapfs Modified Files: dapfs.c Log Message: Check args length so we don't segv if started by hand. Index: dapfs.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dapfs/dapfs.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** dapfs.c 16 Oct 2005 10:46:28 -0000 1.6 --- dapfs.c 18 Oct 2005 07:29:18 -0000 1.7 *************** *** 402,405 **** --- 402,408 ---- int main(int argc, char *argv[]) { + if (argc < 2) + return 1; + // This is the host name ending :: (eg zarqon"patrick password"::) strcpy(prefix, argv[1]); |
From: Patrick C. <pa...@us...> - 2005-10-17 08:41:21
|
Update of /cvsroot/linux-decnet/dnprogs/debian In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11592/debian Modified Files: changelog control rules Log Message: 2.31 Index: changelog =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/changelog,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -r1.33 -r1.34 *** changelog 2 Sep 2005 08:41:59 -0000 1.33 --- changelog 17 Oct 2005 08:41:09 -0000 1.34 *************** *** 1,2 **** --- 1,22 ---- + dnprogs (2.31) unstable; urgency=low + + * Add more RMS features to libdap. + * fix get_date as time_t in libdap. + * librms rms_open() now returns file info in the FAB. + * librms rms_read() returns EOF correctly + * librms rms_write() now works + * build mail with -fdollars-in-identifiers + Closes: #334138 + * Remove /etc/decnet.conf.old at Debian purge time. + Closes: #330362 + + -- Patrick Caulfield <pa...@de...> Mon, 17 Oct 2005 08:53:58 +0100 + + dnprogs (2.30.1) unstable; urgency=low + + * Add alternative dependancy on debconf-2.0 + + -- Patrick Caulfield <pa...@de...> Tue, 27 Sep 2005 08:20:46 +0100 + dnprogs (2.30) unstable; urgency=low Index: control =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/control,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -r1.27 -r1.28 *** control 30 May 2004 09:30:01 -0000 1.27 --- control 17 Oct 2005 08:41:09 -0000 1.28 *************** *** 8,12 **** Package: dnet-common Architecture: all ! Depends: debconf(>=0.5.00), debianutils(>=1.13), modutils Priority: extra Section: net --- 8,12 ---- Package: dnet-common Architecture: all ! Depends: debconf(>=0.5.00) | debconf-2.0, debianutils(>=1.13), modutils Priority: extra Section: net Index: rules =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/rules,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** rules 26 Sep 2003 08:01:43 -0000 1.18 --- rules 17 Oct 2005 08:41:09 -0000 1.19 *************** *** 1,6 **** #!/usr/bin/make -f - export DH_COMPAT=2 - build: $(checkdir) --- 1,4 ---- |
From: Patrick C. <pa...@us...> - 2005-10-17 07:53:31
|
Update of /cvsroot/linux-decnet/dnprogs/dapfs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1780/dapfs Modified Files: filenames.h Log Message: getting ready for 2.31 Index: filenames.h =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dapfs/filenames.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** filenames.h 12 Oct 2005 10:31:31 -0000 1.1 --- filenames.h 17 Oct 2005 07:53:14 -0000 1.2 *************** *** 14,20 **** */ /* filenames.c */ - int is_vms_name(char *name); - void split_filespec(char *volume, char *directory, char *file); void make_vms_filespec(const char *unixname, char *vmsname, int full); - void parse_vms_filespec(char *volume, char *directory, char *file); void make_unix_filespec(char *unixname, char *vmsname); --- 14,17 ---- |
From: Patrick C. <pa...@us...> - 2005-10-17 07:53:31
|
Update of /cvsroot/linux-decnet/dnprogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1780 Modified Files: Makefile.common Log Message: getting ready for 2.31 Index: Makefile.common =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/Makefile.common,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -r1.30 -r1.31 *** Makefile.common 1 Sep 2005 09:28:16 -0000 1.30 --- Makefile.common 17 Oct 2005 07:53:14 -0000 1.31 *************** *** 58,62 **** MAJOR_VERSION=2 ! MINOR_VERSION=30 VERSION=$(MAJOR_VERSION).$(MINOR_VERSION) --- 58,62 ---- MAJOR_VERSION=2 ! MINOR_VERSION=31 VERSION=$(MAJOR_VERSION).$(MINOR_VERSION) |
From: Patrick C. <pa...@us...> - 2005-10-16 14:35:02
|
Update of /cvsroot/linux-decnet/dnprogs/dapfs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10959 Modified Files: filenames.c Log Message: Remove some leftover functions & variables. Index: filenames.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dapfs/filenames.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** filenames.c 13 Oct 2005 11:54:04 -0000 1.4 --- filenames.c 16 Oct 2005 14:34:50 -0000 1.5 *************** *** 36,40 **** #include "filenames.h" - static int vms_format; // Do we use this ?? #define true 1 #define false 0 --- 36,39 ---- *************** *** 55,119 **** } - - // A test to see if the file is a VMS-type filespec or a Unix one - // Also sets the 'vms_format' flag - int is_vms_name(char *name) - { - if ( (strchr(name, '[') && strchr(name, ']')) || - strchr(name, ';') || strchr(name, ':') ) - return vms_format=true; - else - return vms_format=false; - } - - // Splits a filename up into volume, directory and file parts. - // The volume and directory are just for display purposes (they get sent back - // to the client). file is the (possibly) wildcard filespec to use for - // searching for files. - // - // Unix filenames are just returned as-is. - // - // volume and directory are assumed to be long enough for PATH_MAX. file - // also contains the input filespec. - // - void split_filespec(char *volume, char *directory, char *file) - { - - if (is_vms_name(file)) - { - // This converts the VMS name to a Unix name and back again. This - // involves calling parse_vms_filespec twice and ourself once more. - // YES THIS IS RIGHT! We need to make sense of the input file name - // in our own terms and then send back our re-interpretation of - // the input filename. This is what any sensible operating - // system would do. (VMS certainly does!) - - // Convert it to a Unix filespec - char unixname[PATH_MAX]; - char vmsname[PATH_MAX]; - - make_unix_filespec(unixname, file); - - // Parse that Unix name - strcpy(file, unixname); - split_filespec(volume, directory, file); - - // Then convert it back to VMS - make_vms_filespec(unixname, vmsname, true); - - // Split up the VMS spec for returning in bits - parse_vms_filespec(volume, directory, vmsname); - - // Make sure we set this back to true after we called ourself with a - // Unix filespec - vms_format = true; - return; - } - - // We don't fill in the volume for unix filespecs - volume[0] = '\0'; - directory[0] = '\0'; - } - // Convert a Unix-style filename to a VMS-style name // No return code because this routine cannot fail :-) --- 54,57 ---- *************** *** 183,187 **** // Split out the volume, directory and file portions of a VMS file spec // We assume that the VMS name is (quite) well formed. ! void parse_vms_filespec(char *volume, char *directory, char *file) { char *colon = strchr(file, ':'); --- 121,125 ---- // Split out the volume, directory and file portions of a VMS file spec // We assume that the VMS name is (quite) well formed. ! static void parse_vms_filespec(char *volume, char *directory, char *file) { char *colon = strchr(file, ':'); |
From: Patrick C. <pa...@us...> - 2005-10-16 14:31:33
|
Update of /cvsroot/linux-decnet/dnprogs/librms In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10577 Modified Files: close.cc Log Message: Actually, better wait for accomp::RESPONSE too. Index: close.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/librms/close.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** close.cc 16 Oct 2005 13:36:16 -0000 1.4 --- close.cc 16 Oct 2005 14:31:22 -0000 1.5 *************** *** 42,45 **** --- 42,48 ---- ac.write(*conn); + dap_message *m; + int r = rms_getreply(h, 1, NULL, &m); + conn->close(); *************** *** 47,51 **** delete rc; ! return 0; } --- 50,54 ---- delete rc; ! return r; } |
From: Patrick C. <pa...@us...> - 2005-10-16 13:36:32
|
Update of /cvsroot/linux-decnet/dnprogs/librms In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2109 Modified Files: close.cc Log Message: Send accomp::CLOSE before closing, so the buffers get flushed. Index: close.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/librms/close.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** close.cc 15 Aug 2001 07:17:18 -0000 1.3 --- close.cc 16 Oct 2005 13:36:16 -0000 1.4 *************** *** 37,41 **** rms_conn *rc = (rms_conn *)h; dap_connection *conn = (dap_connection *)rc->conn; ! conn->close(); --- 37,45 ---- rms_conn *rc = (rms_conn *)h; dap_connection *conn = (dap_connection *)rc->conn; ! ! dap_accomp_message ac; ! ac.set_cmpfunc(dap_accomp_message::CLOSE); ! ac.write(*conn); ! conn->close(); |
From: Patrick C. <pa...@us...> - 2005-10-16 10:46:49
|
Update of /cvsroot/linux-decnet/dnprogs/dapfs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7447 Modified Files: dapfs.c Log Message: A bit more Index: dapfs.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/dapfs/dapfs.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** dapfs.c 13 Oct 2005 11:47:39 -0000 1.5 --- dapfs.c 16 Oct 2005 10:46:28 -0000 1.6 *************** *** 11,22 **** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! ****************************************************************************** ! */ /* dapfs via FUSE */ ! ! /* ! This program can be distributed under the terms of the GNU GPL. ! See the file COPYING. ! */ #define _FILE_OFFSET_BITS 64 --- 11,18 ---- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! ****************************************************************************** ! */ /* dapfs via FUSE */ ! // mount -tfuse dapfs#'alpha1"patrick password"::' /mnt/dap #define _FILE_OFFSET_BITS 64 *************** *** 38,44 **** --- 34,49 ---- #include "filenames.h" + /* Copied from dncopy */ + struct dapfs_handle { RMSHANDLE rmsh; + /* RMS File attributes */ + int org; + int rat; + int rfm; + int mrs; + int fsz; + /* Last known offset in the file */ off_t offset; }; *************** *** 46,49 **** --- 51,119 ---- char prefix[1024]; + static const int RAT_DEFAULT = -1; // Use RMS defaults + static const int RAT_FTN = 1; // RMS RAT values from fab.h + static const int RAT_CR = 2; + static const int RAT_PRN = 4; + static const int RAT_NONE = 0; + + static const int RFM_DEFAULT = -1; // Use RMS defaults + static const int RFM_UDF = 0; // RMS RFM values from fab.h + static const int RFM_FIX = 1; + static const int RFM_VAR = 2; + static const int RFM_VFC = 3; + static const int RFM_STM = 4; + static const int RFM_STMLF = 5; + static const int RFM_STMCR = 6; + + + /* Convert RMS record carriage control into something more unixy */ + static int convert_rms_record(char *buf, int len, struct dapfs_handle *fh) + { + int retlen = len; + + /* If the file has implied carriage control then add an LF to the end of the line */ + if ((fh->rfm != RFM_STMLF) && + (fh->rat & RAT_CR || fh->rat & RAT_PRN)) + buf[retlen++] = '\n'; + + /* Print files have a two-byte header indicating the line length. */ + if (fh->rat & RAT_PRN) + { + memmove(buf, buf + fh->fsz, retlen - fh->fsz); + retlen -= fh->fsz; + } + + /* FORTRAN files have a leading character that indicates carriage control */ + if (fh->rat & RAT_FTN) + { + switch (buf[0]) + { + + case '+': // No new line + buf[0] = '\r'; + break; + + case '1': // Form Feed + buf[0] = '\f'; + break; + + case '0': // Two new lines + memmove(buf+1, buf, retlen+1); + buf[0] = '\n'; + buf[1] = '\n'; + retlen++; + break; + + + case ' ': // new line + default: // Default to a new line. This seems to be what VMS does. + buf[0] = '\n'; + break; + } + } + + return retlen; + } + static int dapfs_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offset, struct fuse_file_info *fi) *************** *** 81,95 **** } static int dapfs_truncate(const char *path, off_t size) { ! // TODO - DAP::CONTROL::TRUNCATE message. ! // NOTE: This can also be called at create time to overwrite an ! // existing file ! return 0; } static int dapfs_mkdir(const char *path, mode_t mode) { ! syslog(1, "PJC: dapfs_mkdir called for %s\n", path); // TODO Use remote object return -ENOSYS; --- 151,201 ---- } + int dapfs_chown(const char *path, uid_t u, gid_t g) + { + // Can we do this ?? + return 0; + } + + static int dapfs_flush(const char *path, struct fuse_file_info *fi) + { + // NO-OP + return 0; + } + static int dapfs_truncate(const char *path, off_t size) { ! RMSHANDLE rmsh; ! int offset; ! int res; ! struct RAB rab; ! char fullname[2048]; ! char vmsname[2048]; ! ! make_vms_filespec(path, vmsname, 0); ! sprintf(fullname, "%s%s", prefix, vmsname); ! ! rmsh = rms_open(fullname, O_WRONLY, NULL); ! if (!rmsh) { ! return -errno; ! } ! ! memset(&rab, 0, sizeof(rab)); ! if (size) { ! rab.rab$l_kbf = &offset; ! rab.rab$b_rac = 2;//FB$RFA; ! rab.rab$b_ksz = sizeof(offset); ! } ! res = rms_find(rmsh, &rab); ! if (!res) ! goto finish; ! res = rms_truncate(rmsh, NULL); ! finish: ! rms_close(rmsh); ! return res; } static int dapfs_mkdir(const char *path, mode_t mode) { ! syslog(LOG_DEBUG, "PJC: dapfs_mkdir called for %s\n", path); // TODO Use remote object return -ENOSYS; *************** *** 98,102 **** static int dapfs_statfs(const char *path, struct statfs *stbuf) { ! syslog(1, "PJC: dapfs_statfs called for %s\n", path); // TODO Use remote object return -ENOSYS; --- 204,208 ---- static int dapfs_statfs(const char *path, struct statfs *stbuf) { ! syslog(LOG_DEBUG, "PJC: dapfs_statfs called for %s\n", path); // TODO Use remote object return -ENOSYS; *************** *** 112,120 **** char vmsname[2048]; - syslog(1, "PJC: mknod, path=%s, mode=%x\n", path, mode); - - if (S_ISDIR(mode)) - return -ENOSYS; // Does this happen ?? - if (!S_ISREG(mode)) return -ENOSYS; --- 218,221 ---- *************** *** 123,127 **** sprintf(fullname, "%s%s", prefix, vmsname); ! rmsh = rms_open(fullname, O_CREAT|O_WRONLY, NULL); if (!rmsh) return -errno; --- 224,228 ---- sprintf(fullname, "%s%s", prefix, vmsname); ! rmsh = rms_t_open(fullname, O_CREAT|O_WRONLY, "rfm=stmlf"); if (!rmsh) return -errno; *************** *** 132,155 **** static int dapfs_open(const char *path, struct fuse_file_info *fi) { ! struct dapfs_handle *h; ! char fullname[2048]; ! char vmsname[2048]; ! ! h = malloc(sizeof(struct dapfs_handle)); ! if (!h) ! return -ENOMEM; ! ! make_vms_filespec(path, vmsname, 0); ! sprintf(fullname, "%s%s", prefix, vmsname); ! ! h->rmsh = rms_open(fullname, fi->flags, NULL); ! if (!h->rmsh) { ! int saved_errno = errno; ! free(h); ! return -saved_errno; ! } ! fi->fh = (unsigned long)h; ! h->offset = 0; ! return 0; } --- 233,268 ---- static int dapfs_open(const char *path, struct fuse_file_info *fi) { ! struct dapfs_handle *h; ! struct FAB fab; ! char fullname[2048]; ! char vmsname[2048]; ! ! syslog(LOG_DEBUG, "open %s, flags=%x\n", path, fi->flags); ! h = malloc(sizeof(struct dapfs_handle)); ! if (!h) ! return -ENOMEM; ! ! memset(&fab, 0, sizeof(struct FAB)); ! make_vms_filespec(path, vmsname, 0); ! sprintf(fullname, "%s%s", prefix, vmsname); ! if (fi->flags & O_CREAT) ! fab.fab$b_rfm = RFM_STMLF; ! ! h->rmsh = rms_open(fullname, fi->flags, &fab); ! if (!h->rmsh) { ! int saved_errno = errno; ! free(h); ! return -saved_errno; ! } ! /* Save RMS attributes */ ! h->org = fab.fab$b_org; ! h->rat = fab.fab$b_rat; ! h->rfm = fab.fab$b_rfm; ! h->mrs = fab.fab$w_mrs; ! h->fsz = fab.fab$b_fsz; ! ! fi->fh = (unsigned long)h; ! h->offset = 0; ! return 0; } *************** *** 157,230 **** struct fuse_file_info *fi) { ! int res; ! int got = 0; ! struct RAB rab; ! struct dapfs_handle *h = (struct dapfs_handle *)fi->fh; ! if (!h) { ! res = dapfs_open(path, fi); ! if (!res) ! return res; ! } ! memset(&rab, 0, sizeof(rab)); ! if (offset && offset != h->offset) { ! rab.rab$l_kbf = &offset; ! rab.rab$b_rac = 2;//FB$RFA; ! rab.rab$b_ksz = sizeof(offset); ! } ! ! // TODO this can be quite slow, because it reads records. Maybe we ! // should abandon librms and pull blocks down as per dncopy ! do { ! res = rms_read(h->rmsh, buf+got, size-got, &rab); ! if (res > 0) ! got += res; ! if (res < 0 && got) { ! // Not enough room for a record but we read something ! return got; ! } ! ! } while (res > 0); ! if (res >= 0) ! res = got; ! if (res == -1) ! res = -errno; ! h->offset += res; ! return res; } static int dapfs_write(const char *path, const char *buf, size_t size, ! off_t offset, struct fuse_file_info *fi) { ! int res; ! int got = 0; ! struct RAB rab; ! struct dapfs_handle *h = (struct dapfs_handle *)fi->fh; ! ! if (!h) { ! res = dapfs_open(path, fi); ! if (!res) ! return res; ! } ! ! memset(&rab, 0, sizeof(rab)); ! if (offset && offset != h->offset) { ! rab.rab$l_kbf = &offset; ! rab.rab$b_rac = 2;//FB$RFA; ! rab.rab$b_ksz = sizeof(offset); ! } ! ! res = rms_write(h->rmsh, (char *)buf+got, size-got, &rab); ! if (res == -1) { ! res = -errno; ! } ! else { ! h->offset += res; ! res = size; ! } ! return res; } --- 270,347 ---- struct fuse_file_info *fi) { ! int res; ! int got = 0; ! struct RAB rab; ! struct dapfs_handle *h = (struct dapfs_handle *)fi->fh; ! if (!h) { ! res = dapfs_open(path, fi); ! if (!res) ! return res; ! } ! memset(&rab, 0, sizeof(rab)); ! if (offset && offset != h->offset) { ! rab.rab$l_kbf = &offset; ! rab.rab$b_rac = 2;//FB$RFA; ! rab.rab$b_ksz = sizeof(offset); ! } ! ! /* This can be quite slow, because it reads records. ! However, it's safer this way as we can make sense of sequential files. */ ! do { ! res = rms_read(h->rmsh, buf+got, size-got, &rab); ! if (res > 0) { ! res = convert_rms_record(buf+got, res, h); ! got += res; ! } ! if (res < 0 && got) { ! // Not enough room for a record but we read something ! return got; ! } ! } while (res > 0); ! if (res >= 0) ! res = got; ! if (res == -1) ! res = -errno; ! ! h->offset += res; ! return res; } static int dapfs_write(const char *path, const char *buf, size_t size, ! off_t offset, struct fuse_file_info *fi) { ! int res; ! struct RAB rab; ! struct dapfs_handle *h = (struct dapfs_handle *)fi->fh; ! ! if (!h) { ! res = dapfs_open(path, fi); ! if (!res) ! return res; ! } ! ! syslog(LOG_DEBUG, "dapfs_write. offset=%d, (%p) fh->offset=%d\n", (int)offset, h, (int)h->offset); ! memset(&rab, 0, sizeof(rab)); ! if (offset && offset != h->offset) { ! rab.rab$l_kbf = &offset; ! rab.rab$b_rac = 2;//FB$RFA; ! rab.rab$b_ksz = sizeof(offset); ! } ! ! res = rms_write(h->rmsh, (char *)buf, size, &rab); ! if (res == -1) { ! syslog(LOG_DEBUG, "rms_write returned %d, errno=%d\n", res, errno); ! res = -errno; ! } ! else { ! h->offset += size; ! res = size; ! syslog(LOG_DEBUG, "rms_write returned 0, offset (%p) now=%d\n", h, (int)h->offset); ! } ! return res; } *************** *** 239,246 **** --- 356,365 ---- ret = rms_close(h->rmsh); free(h); + fi->fh = 0L; return ret; } + static int dapfs_getattr(const char *path, struct stat *stbuf) { *************** *** 274,278 **** --- 393,399 ---- .mknod = dapfs_mknod, .chmod = dapfs_chmod, + .chown = dapfs_chown, .mkdir = dapfs_mkdir, + .flush = dapfs_flush, .statfs = dapfs_statfs, .release = dapfs_release, *************** *** 293,295 **** } - // TODO statfs & mkkdir, use DECnet object used by old dapfs! --- 414,415 ---- |
From: Patrick C. <pa...@us...> - 2005-10-16 09:05:35
|
Update of /cvsroot/linux-decnet/dnprogs/librms In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25514/librms Modified Files: readwrite.cc Log Message: Only set RAB options if they are valid Index: readwrite.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/librms/readwrite.cc,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** readwrite.cc 15 Oct 2005 15:45:03 -0000 1.7 --- readwrite.cc 16 Oct 2005 09:05:25 -0000 1.8 *************** *** 35,53 **** static void build_control_message(rms_conn *rc, dap_control_message *ctl, struct RAB *rab) { ! ctl->set_rac(rab->rab$b_rac); ! ctl->set_rop(rab->rab$l_rop); ! if (rab->rab$l_kbf) ! { ! // To be helpful - if the ksz is zero then assume it's a string ! if (rab->rab$b_ksz) ! { ! ctl->set_key((char*)rab->rab$l_kbf, (int)rab->rab$b_ksz); ! } ! else { ! ctl->set_key((char *)rab->rab$l_kbf); } - ctl->set_krf(rab->rab$b_krf); - } } --- 35,53 ---- static void build_control_message(rms_conn *rc, dap_control_message *ctl, struct RAB *rab) { ! if (rab->rab$b_rac) ctl->set_rac(rab->rab$b_rac); ! if (rab->rab$l_rop) ctl->set_rop(rab->rab$l_rop); ! if (rab->rab$l_kbf) { ! // To be helpful - if the ksz is zero then assume it's a string ! if (rab->rab$b_ksz) ! { ! ctl->set_key((char*)rab->rab$l_kbf, (int)rab->rab$b_ksz); ! } ! else ! { ! ctl->set_key((char *)rab->rab$l_kbf); ! } ! ctl->set_krf(rab->rab$b_krf); } } |
From: Patrick C. <pa...@us...> - 2005-10-16 09:04:29
|
Update of /cvsroot/linux-decnet/dnprogs/debian In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25255 Modified Files: dnet-common.postrm Log Message: Remove /etc/decnet.conf.old when removing --purge Index: dnet-common.postrm =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/debian/dnet-common.postrm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** dnet-common.postrm 4 Feb 2001 14:44:06 -0000 1.1 --- dnet-common.postrm 16 Oct 2005 09:04:18 -0000 1.2 *************** *** 20,23 **** --- 20,24 ---- then rm -f /etc/decnet.conf + rm -f /etc/decnet.conf.old rm -f /etc/decnet.proxy rm -f /etc/dnetd.conf |
From: Patrick C. <pa...@us...> - 2005-10-16 09:00:58
|
Update of /cvsroot/linux-decnet/dnprogs/mail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24783 Modified Files: Makefile Log Message: Need -fdollars-in-identifiers Index: Makefile =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/mail/Makefile,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** Makefile 12 Aug 2004 09:17:34 -0000 1.7 --- Makefile 16 Oct 2005 09:00:41 -0000 1.8 *************** *** 17,20 **** --- 17,21 ---- CDEFS+=-I$(UUDIR) -DPROTOTYPES + CFLAGS+=-fdollars-in-identifiers all: $(UULIB) $(PROG1) $(PROG2) |
From: Patrick C. <pa...@us...> - 2005-10-15 15:45:10
|
Update of /cvsroot/linux-decnet/dnprogs/librms In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15999 Modified Files: readwrite.cc Log Message: Fix writes Index: readwrite.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/librms/readwrite.cc,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** readwrite.cc 15 Oct 2005 14:52:50 -0000 1.6 --- readwrite.cc 15 Oct 2005 15:45:03 -0000 1.7 *************** *** 176,180 **** } - int rms_write(RMSHANDLE h, char *buf, int len, struct RAB *rab) { --- 176,179 ---- *************** *** 195,208 **** } - dap_message *m; - int r = rms_getreply(h, 1, NULL, &m); - if (r == -2) delete m; - if (r < 0) return -1; - dap_data_message data; data.set_data(buf, len); bool status; ! status = data.write_with_len(*conn); if (!status) { --- 194,205 ---- } dap_data_message data; data.set_data(buf, len); bool status; ! if (len >= 256) ! status = data.write_with_len256(*conn); ! else ! status = data.write_with_len(*conn); if (!status) { *************** *** 211,215 **** } ! r = rms_getreply(h, 1, NULL, &m); if (r == -2) delete m; if (r < 0) return -1; --- 208,213 ---- } ! dap_message *m; ! int r = rms_getreply(h, 1, NULL, &m); if (r == -2) delete m; if (r < 0) return -1; *************** *** 218,222 **** } - int rms_update(RMSHANDLE h, char *buf, int len, struct RAB *rab) { --- 216,219 ---- *************** *** 237,245 **** } - dap_message *m; - int r = rms_getreply(h, 1, NULL, &m); - if (r == -2) delete m; - if (r < 0) return -1; - dap_data_message data; data.set_data(buf, len); --- 234,237 ---- *************** *** 255,259 **** } ! r = rms_getreply(h, 1, NULL, &m); if (r == -2) delete m; if (r < 0 ) return -1; --- 247,252 ---- } ! dap_message *m; ! int r = rms_getreply(h, 1, NULL, &m); if (r == -2) delete m; if (r < 0 ) return -1; |
From: Patrick C. <pa...@us...> - 2005-10-15 15:07:27
|
Update of /cvsroot/linux-decnet/dnprogs/librms In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10037/librms Modified Files: parse.cc Log Message: Fix some stream confusion. Index: parse.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/librms/parse.cc,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** parse.cc 1 Sep 2005 08:21:56 -0000 1.6 --- parse.cc 15 Oct 2005 15:07:18 -0000 1.7 *************** *** 331,336 **** if (strcmp(p, "vfc") == 0) {*ptr |= FAB$C_VFC; goto rfmdone;} if (strcmp(p, "stm") == 0) {*ptr |= FAB$C_STM; goto rfmdone;} ! if (strcmp(p, "stmlf") == 0) {*ptr |= FAB$C_STMCR; goto rfmdone;} ! if (strcmp(p, "stmcr") == 0) {*ptr |= FAB$C_STMLF; goto rfmdone;} fprintf(stderr, "Error: unknown record format type: %s\n", p); --- 331,336 ---- if (strcmp(p, "vfc") == 0) {*ptr |= FAB$C_VFC; goto rfmdone;} if (strcmp(p, "stm") == 0) {*ptr |= FAB$C_STM; goto rfmdone;} ! if (strcmp(p, "stmlf") == 0) {*ptr |= FAB$C_STMLF; goto rfmdone;} ! if (strcmp(p, "stmcr") == 0) {*ptr |= FAB$C_STMCR; goto rfmdone;} fprintf(stderr, "Error: unknown record format type: %s\n", p); |
From: Patrick C. <pa...@us...> - 2005-10-15 15:07:27
|
Update of /cvsroot/linux-decnet/dnprogs/Documentation In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10037/Documentation Modified Files: librms.README Log Message: Fix some stream confusion. Index: librms.README =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/Documentation/librms.README,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** librms.README 15 Oct 2005 14:29:55 -0000 1.5 --- librms.README 15 Oct 2005 15:07:18 -0000 1.6 *************** *** 204,208 **** fac=put,del,get,upd,del shr=put,del,get,upd,del ! rfm=udf,fix,var,vfc,stm,stmcr,stmcr rat=ftn,cr,prn,blk --- 204,208 ---- fac=put,del,get,upd,del shr=put,del,get,upd,del ! rfm=udf,fix,var,vfc,stm,stmcr,stmlf rat=ftn,cr,prn,blk |
From: Patrick C. <pa...@us...> - 2005-10-15 14:53:00
|
Update of /cvsroot/linux-decnet/dnprogs/librms In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7895 Modified Files: readwrite.cc Log Message: Return EOF correctly Index: readwrite.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/librms/readwrite.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** readwrite.cc 14 Oct 2005 12:17:18 -0000 1.5 --- readwrite.cc 15 Oct 2005 14:52:50 -0000 1.6 *************** *** 52,56 **** } - int rms_read(RMSHANDLE h, char *buf, int maxlen, struct RAB *rab) { --- 52,55 ---- *************** *** 131,134 **** --- 130,135 ---- return -1; } + if (status == 047) // EOF + status = 0; return status; } |
From: Patrick C. <pa...@us...> - 2005-10-15 14:30:07
|
Update of /cvsroot/linux-decnet/dnprogs/librms In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4640/librms Modified Files: getreply.cc Log Message: Return FSZ too Index: getreply.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/librms/getreply.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** getreply.cc 14 Oct 2005 12:17:18 -0000 1.4 --- getreply.cc 15 Oct 2005 14:29:55 -0000 1.5 *************** *** 79,82 **** --- 79,85 ---- if (am->get_menu_bit(dap_attrib_message::MENU_MRN)) fab->fab$l_mrn = am->get_mrn(); + + if (am->get_menu_bit(dap_attrib_message::MENU_FSZ)) + fab->fab$b_fsz = am->get_fsz(); } |
From: Patrick C. <pa...@us...> - 2005-10-15 14:30:07
|
Update of /cvsroot/linux-decnet/dnprogs/Documentation In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4640/Documentation Modified Files: librms.README Log Message: Return FSZ too Index: librms.README =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/Documentation/librms.README,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** librms.README 14 Oct 2005 12:17:18 -0000 1.4 --- librms.README 15 Oct 2005 14:29:55 -0000 1.5 *************** *** 69,72 **** --- 69,73 ---- fab$w_mrs fab$l_mrn + fab$b_fsz >>> char *rms_openerror(void); |
From: Patrick C. <pa...@us...> - 2005-10-14 12:19:03
|
Update of /cvsroot/linux-decnet/dnprogs/libdap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18531/libdap Modified Files: protocol.cc protocol.h Log Message: Add jnl field to attrib message, and allow external access to the menu bitmap so callers know what attributes are available. Index: protocol.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/libdap/protocol.cc,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** protocol.cc 13 Oct 2005 07:59:35 -0000 1.13 --- protocol.cc 14 Oct 2005 12:18:55 -0000 1.14 *************** *** 705,708 **** --- 705,713 ---- } + int dap_attrib_message::get_menu_bit(int bit) + { + return attmenu.get_bit(bit); + } + int dap_attrib_message::get_datatype() {return datatype.get_byte(0); } int dap_attrib_message::get_org(){return org.get_int(); } *************** *** 726,729 **** --- 731,735 ---- int dap_attrib_message::get_ffb(){return ffb.get_short(); } int dap_attrib_message::get_sbn(){return sbn.get_int(); } + int dap_attrib_message::get_jnl(){return jnl.get_byte(0); } // Returns the filesize in bytes Index: protocol.h =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/libdap/protocol.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** protocol.h 1 Sep 2005 12:53:04 -0000 1.7 --- protocol.h 14 Oct 2005 12:18:55 -0000 1.8 *************** *** 275,279 **** ebk(5), ffb(2), ! sbn(5) {msg_type = ATTRIB;} --- 275,280 ---- ebk(5), ffb(2), ! sbn(5), ! jnl(4) {msg_type = ATTRIB;} *************** *** 281,284 **** --- 282,286 ---- virtual bool write(dap_connection&); + int get_menu_bit(int); int get_datatype(); int get_org(); *************** *** 302,305 **** --- 304,308 ---- int get_ffb(); int get_sbn(); + int get_jnl(); void set_datatype(int); *************** *** 333,336 **** --- 336,363 ---- unsigned long get_size(); + // Bits in ATTMENU + static const int MENU_DATATYPE = 0; + static const int MENU_ORG = 1; + static const int MENU_RFM = 2; + static const int MENU_RAT = 3; + static const int MENU_BLS = 4; + static const int MENU_MRS = 5; + static const int MENU_ALQ = 6; + static const int MENU_BKS = 7; + static const int MENU_FSZ = 8; + static const int MENU_MRN = 9; + static const int MENU_RUNSYS = 10; + static const int MENU_DEQ = 11; + static const int MENU_FOP = 12; + static const int MENU_BSZ = 13; + static const int MENU_DEV = 14; + static const int MENU_SDC = 15; + static const int MENU_LRL = 16; + static const int MENU_HBK = 17; + static const int MENU_EBK = 18; + static const int MENU_FFB = 19; + static const int MENU_SBN = 20; + static const int MENU_JNL = 21; + //DATATYPEs static const int ASCII = 0; *************** *** 444,447 **** --- 471,475 ---- dap_bytes ffb; dap_image sbn; + dap_ex jnl; }; |
From: Patrick C. <pa...@us...> - 2005-10-14 12:17:30
|
Update of /cvsroot/linux-decnet/dnprogs/Documentation In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18232/Documentation Modified Files: librms.README Log Message: rms_open() now fills in some FAB fields. Index: librms.README =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/Documentation/librms.README,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** librms.README 1 Sep 2005 08:21:56 -0000 1.3 --- librms.README 14 Oct 2005 12:17:18 -0000 1.4 *************** *** 37,45 **** "Record Management Services Reference". - THE FUTURE - ---------- - I *may* make fairly complete sys$* functions available. - I *may* backfill the FAB with the attributes of the file just opened. - Please let me know what you think of this library and any other functions you think you might need. It's not (very) difficult for me to add features --- 37,40 ---- *************** *** 65,68 **** --- 60,72 ---- fab$b_rat + The following fields will be filled in on return: + fab$b_org + fab$l_alq + fab$w_deq + fab$b_rat + fab$b_rfm + fab$l_jnl + fab$w_mrs + fab$l_mrn >>> char *rms_openerror(void); *************** *** 202,205 **** --- 206,211 ---- rat=ftn,cr,prn,blk + You can't retrieve file information from this call as the FAB fields + filled in by rms_opn() are lost. >>> int rms_t_read(RMSHANDLE h, char *buf, int maxlen, char *options); |
From: Patrick C. <pa...@us...> - 2005-10-14 12:17:30
|
Update of /cvsroot/linux-decnet/dnprogs/librms In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18232/librms Modified Files: getreply.cc open.cc readwrite.cc rmsp.h Log Message: rms_open() now fills in some FAB fields. Index: getreply.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/librms/getreply.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** getreply.cc 31 Oct 2001 09:49:35 -0000 1.3 --- getreply.cc 14 Oct 2005 12:17:18 -0000 1.4 *************** *** 2,6 **** getreply.cc from librms ! Copyright (C) 1999 Patrick Caulfield pa...@ty... This library is free software; you can redistribute it and/or --- 2,6 ---- getreply.cc from librms ! Copyright (C) 1999-2005 Patrick Caulfield pa...@ty... This library is free software; you can redistribute it and/or *************** *** 54,60 **** } // Users should not need to call this. ! int rms_getreply(RMSHANDLE h, int wait, dap_message **msg) { rms_conn *rc = (rms_conn *)h; --- 54,87 ---- } + static void fill_fab(dap_attrib_message *am, struct FAB *fab) + { + if (am->get_menu_bit(dap_attrib_message::MENU_ORG)) + fab->fab$b_org = am->get_org(); + + if (am->get_menu_bit(dap_attrib_message::MENU_ALQ)) + fab->fab$l_alq = am->get_alq(); + + if (am->get_menu_bit(dap_attrib_message::MENU_DEQ)) + fab->fab$w_deq = am->get_deq(); + + if (am->get_menu_bit(dap_attrib_message::MENU_RAT)) + fab->fab$b_rat = am->get_rat(); + + if (am->get_menu_bit(dap_attrib_message::MENU_RFM)) + fab->fab$b_rfm = am->get_rfm(); + + if (am->get_menu_bit(dap_attrib_message::MENU_JNL)) + fab->fab$l_jnl = am->get_jnl(); + + if (am->get_menu_bit(dap_attrib_message::MENU_MRS)) + fab->fab$w_mrs = am->get_mrs(); + + if (am->get_menu_bit(dap_attrib_message::MENU_MRN)) + fab->fab$l_mrn = am->get_mrn(); + } + // Users should not need to call this. ! int rms_getreply(RMSHANDLE h, int wait, struct FAB *fab, dap_message **msg) { rms_conn *rc = (rms_conn *)h; *************** *** 65,69 **** { int next_msg = dap_message::peek_message_type(*conn); ! if (next_msg == dap_message::DATA) return 0; } --- 92,96 ---- { int next_msg = dap_message::peek_message_type(*conn); ! if (next_msg == dap_message::DATA) return 0; } *************** *** 87,90 **** --- 114,119 ---- if (m->get_type() == dap_message::ATTRIB) { + if (fab) + fill_fab((dap_attrib_message *)m, fab); delete m; return 0; // OK *************** *** 96,100 **** } rc->lasterror = conn->get_error(); ! return -1; } --- 125,129 ---- } rc->lasterror = conn->get_error(); ! return -1; } *************** *** 102,106 **** { rms_conn *rc = (rms_conn *)h; ! return rc->lasterror; } --- 131,135 ---- { rms_conn *rc = (rms_conn *)h; ! return rc->lasterror; } *************** *** 109,113 **** { rms_conn *rc = (rms_conn *)h; ! return rc->lasterr; } --- 138,142 ---- { rms_conn *rc = (rms_conn *)h; ! return rc->lasterr; } Index: open.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/librms/open.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** open.cc 15 Aug 2001 07:17:18 -0000 1.4 --- open.cc 14 Oct 2005 12:17:18 -0000 1.5 *************** *** 39,50 **** static void build_access_message(dap_access_message *acc, struct FAB *fab) { ! acc->set_fac(fab->fab$b_fac); ! acc->set_shr(fab->fab$b_shr); } static void build_attrib_message(dap_attrib_message *att, struct FAB *fab) { ! att->set_rfm((int)fab->fab$b_rfm); ! att->set_rat((int)fab->fab$b_rat); //att->set_fop((int)fab->fab$l_fop); } --- 39,50 ---- static void build_access_message(dap_access_message *acc, struct FAB *fab) { ! if (fab->fab$b_fac) acc->set_fac(fab->fab$b_fac); ! if (fab->fab$b_shr) acc->set_shr(fab->fab$b_shr); } static void build_attrib_message(dap_attrib_message *att, struct FAB *fab) { ! if (fab->fab$b_rfm) att->set_rfm((int)fab->fab$b_rfm); ! if (fab->fab$b_rat) att->set_rat((int)fab->fab$b_rat); //att->set_fop((int)fab->fab$l_fop); } *************** *** 118,121 **** --- 118,122 ---- dap_access_message acc; acc.set_accfunc(dap_access_message::OPEN); + acc.set_display(dap_access_message::DISPLAY_MAIN_MASK); if (mode & O_CREAT) acc.set_accfunc(dap_access_message::CREATE); *************** *** 141,145 **** // Get reply to OPEN dap_message *m; ! int r = rms_getreply(rc, 1, &m); if (r < 0) { --- 142,146 ---- // Get reply to OPEN dap_message *m; ! int r = rms_getreply(rc, 1, fab, &m); if (r < 0) { *************** *** 158,162 **** // Get reply to CONNECT ! r = rms_getreply(rc, 1, &m); if (r < 0) { --- 159,163 ---- // Get reply to CONNECT ! r = rms_getreply(rc, 1, fab, &m); if (r < 0) { Index: readwrite.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/librms/readwrite.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** readwrite.cc 15 Aug 2001 07:17:18 -0000 1.4 --- readwrite.cc 14 Oct 2005 12:17:18 -0000 1.5 *************** *** 85,94 **** { rc->lasterror = conn->get_error(); ! return -1; } ! // Check the reply dap_message *m; ! int r = rms_getreply(h, 0, &m); if (r == -1) return -1; if (r == 047) return 0; // EOF --- 85,94 ---- { rc->lasterror = conn->get_error(); ! return -1; } ! // Check the reply dap_message *m; ! int r = rms_getreply(h, 0, NULL, &m); if (r == -1) return -1; if (r == 047) return 0; // EOF *************** *** 154,175 **** rms_conn *rc = (rms_conn *)h; dap_connection *conn = (dap_connection *)rc->conn; ! dap_control_message ctl; ctl.set_ctlfunc(dap_control_message::FIND); if (rab) build_control_message(rc, &ctl, rab); ! if (!ctl.write(*conn)) { rc->lasterror = conn->get_error(); ! return -1; } ! dap_message *m; ! int r = rms_getreply(h, 1, &m); if (r == -2) delete m; if (r < 0) return -1; if (r == 047) return 0; // EOF ! return 0; } --- 154,175 ---- rms_conn *rc = (rms_conn *)h; dap_connection *conn = (dap_connection *)rc->conn; ! dap_control_message ctl; ctl.set_ctlfunc(dap_control_message::FIND); if (rab) build_control_message(rc, &ctl, rab); ! if (!ctl.write(*conn)) { rc->lasterror = conn->get_error(); ! return -1; } ! dap_message *m; ! int r = rms_getreply(h, 1, NULL, &m); if (r == -2) delete m; if (r < 0) return -1; if (r == 047) return 0; // EOF ! return 0; } *************** *** 182,199 **** rms_conn *rc = (rms_conn *)h; dap_connection *conn = (dap_connection *)rc->conn; ! dap_control_message ctl; ctl.set_ctlfunc(dap_control_message::PUT); if (rab) build_control_message(rc, &ctl, rab); ! if (!ctl.write(*conn)) { rc->lasterror = conn->get_error(); ! return -1; } ! dap_message *m; ! int r = rms_getreply(h, 1, &m); if (r == -2) delete m; if (r < 0) return -1; --- 182,199 ---- rms_conn *rc = (rms_conn *)h; dap_connection *conn = (dap_connection *)rc->conn; ! dap_control_message ctl; ctl.set_ctlfunc(dap_control_message::PUT); if (rab) build_control_message(rc, &ctl, rab); ! if (!ctl.write(*conn)) { rc->lasterror = conn->get_error(); ! return -1; } ! dap_message *m; ! int r = rms_getreply(h, 1, NULL, &m); if (r == -2) delete m; if (r < 0) return -1; *************** *** 207,217 **** { rc->lasterror = conn->get_error(); ! return -1; } ! r = rms_getreply(h, 1, &m); if (r == -2) delete m; if (r < 0) return -1; ! return 0; } --- 207,217 ---- { rc->lasterror = conn->get_error(); ! return -1; } ! r = rms_getreply(h, 1, NULL, &m); if (r == -2) delete m; if (r < 0) return -1; ! return 0; } *************** *** 224,241 **** rms_conn *rc = (rms_conn *)h; dap_connection *conn = (dap_connection *)rc->conn; ! dap_control_message ctl; ctl.set_ctlfunc(dap_control_message::UPDATE); if (rab) build_control_message(rc, &ctl, rab); ! if (!ctl.write(*conn)) { rc->lasterror = conn->get_error(); ! return -1; } ! dap_message *m; ! int r = rms_getreply(h, 1, &m); if (r == -2) delete m; if (r < 0) return -1; --- 224,241 ---- rms_conn *rc = (rms_conn *)h; dap_connection *conn = (dap_connection *)rc->conn; ! dap_control_message ctl; ctl.set_ctlfunc(dap_control_message::UPDATE); if (rab) build_control_message(rc, &ctl, rab); ! if (!ctl.write(*conn)) { rc->lasterror = conn->get_error(); ! return -1; } ! dap_message *m; ! int r = rms_getreply(h, 1, NULL, &m); if (r == -2) delete m; if (r < 0) return -1; *************** *** 251,261 **** { rc->lasterror = conn->get_error(); ! return -1; } ! r = rms_getreply(h, 1, &m); if (r == -2) delete m; if (r < 0 ) return -1; ! return 0; } --- 251,261 ---- { rc->lasterror = conn->get_error(); ! return -1; } ! r = rms_getreply(h, 1, NULL, &m); if (r == -2) delete m; if (r < 0 ) return -1; ! return 0; } *************** *** 267,284 **** rms_conn *rc = (rms_conn *)h; dap_connection *conn = (dap_connection *)rc->conn; ! dap_control_message ctl; ctl.set_ctlfunc(dap_control_message::DELETE); if (rab) build_control_message(rc, &ctl, rab); ! if (!ctl.write(*conn)) { rc->lasterror = conn->get_error(); ! return -1; } ! dap_message *m; ! int r = rms_getreply(h, 1, &m); if (r == -2) delete m; if (r < 0) return -1; --- 267,284 ---- rms_conn *rc = (rms_conn *)h; dap_connection *conn = (dap_connection *)rc->conn; ! dap_control_message ctl; ctl.set_ctlfunc(dap_control_message::DELETE); if (rab) build_control_message(rc, &ctl, rab); ! if (!ctl.write(*conn)) { rc->lasterror = conn->get_error(); ! return -1; } ! dap_message *m; ! int r = rms_getreply(h, 1, NULL, &m); if (r == -2) delete m; if (r < 0) return -1; *************** *** 293,310 **** rms_conn *rc = (rms_conn *)h; dap_connection *conn = (dap_connection *)rc->conn; ! dap_control_message ctl; ctl.set_ctlfunc(dap_control_message::TRUNCATE); if (rab) build_control_message(rc, &ctl, rab); ! if (!ctl.write(*conn)) { rc->lasterror = conn->get_error(); ! return -1; } ! dap_message *m; ! int r = rms_getreply(h, 1, &m); if (r == -2) delete m; if (r < 0) return -1; --- 293,310 ---- rms_conn *rc = (rms_conn *)h; dap_connection *conn = (dap_connection *)rc->conn; ! dap_control_message ctl; ctl.set_ctlfunc(dap_control_message::TRUNCATE); if (rab) build_control_message(rc, &ctl, rab); ! if (!ctl.write(*conn)) { rc->lasterror = conn->get_error(); ! return -1; } ! dap_message *m; ! int r = rms_getreply(h, 1, NULL, &m); if (r == -2) delete m; if (r < 0) return -1; *************** *** 319,336 **** rms_conn *rc = (rms_conn *)h; dap_connection *conn = (dap_connection *)rc->conn; ! dap_control_message ctl; ctl.set_ctlfunc(dap_control_message::REWIND); if (rab) build_control_message(rc,&ctl, rab); ! if (!ctl.write(*conn)) { rc->lasterror = conn->get_error(); ! return -1; } ! dap_message *m; ! int r = rms_getreply(h, 1, &m); if (r == -2) delete m; if (r < 0) return -1; --- 319,336 ---- rms_conn *rc = (rms_conn *)h; dap_connection *conn = (dap_connection *)rc->conn; ! dap_control_message ctl; ctl.set_ctlfunc(dap_control_message::REWIND); if (rab) build_control_message(rc,&ctl, rab); ! if (!ctl.write(*conn)) { rc->lasterror = conn->get_error(); ! return -1; } ! dap_message *m; ! int r = rms_getreply(h, 1, NULL, &m); if (r == -2) delete m; if (r < 0) return -1; Index: rmsp.h =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/librms/rmsp.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** rmsp.h 13 Sep 2001 13:51:24 -0000 1.4 --- rmsp.h 14 Oct 2005 12:17:18 -0000 1.5 *************** *** 44,48 **** }; ! int rms_getreply(RMSHANDLE h, int wait, dap_message **msg); int check_status(rms_conn *c, dap_message *m); bool parse_options(RMSHANDLE h, char *options, struct FAB *fab, struct RAB *rab, va_list ap); --- 44,48 ---- }; ! int rms_getreply(RMSHANDLE h, int wait, struct FAB *fab, dap_message **msg); int check_status(rms_conn *c, dap_message *m); bool parse_options(RMSHANDLE h, char *options, struct FAB *fab, struct RAB *rab, va_list ap); |
From: Patrick C. <pa...@us...> - 2005-10-14 10:59:20
|
Update of /cvsroot/linux-decnet/dnprogs/fal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv870 Modified Files: task.cc Log Message: Don't get confused by people that put [] in filenames. Index: task.cc =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/fal/task.cc,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** task.cc 1 Sep 2005 08:58:11 -0000 1.16 --- task.cc 14 Oct 2005 10:59:06 -0000 1.17 *************** *** 399,402 **** --- 399,411 ---- for (i=0; i< (int)strlen(dir); i++) { + // Remove '[]' as it's a no-op + if (dir[i] == '[' && + dir[i+1] == ']') + { + i++; + ptr = 0; + continue; + } + // If the directory name starts [. then it is relative to the // user's home directory and we lose the starting slash |