home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!wupost!usc!news.service.uci.edu!unogate!mvb.saic.com!vmsnet-sources
- From: flowers@memstvx1.memst.edu
- Newsgroups: vmsnet.sources
- Subject: C Swing v3.6.4 patches, part 04/04
- Message-ID: <9908351@MVB.SAIC.COM>
- Date: Mon, 04 Jan 1993 20:21:21 GMT
- Organization: Memphis State University
- Lines: 573
- Approved: Mark.Berryman@Mvb.Saic.Com
-
- Submitted-by: flowers@memstvx1.memst.edu
- Posting-number: Volume 4, Issue 25
- Archive-name: cswing/patch3_04
- Patch-to: cswing: Volume 3, Issue 35-52,93,211-218
-
- -+-+-+-+-+-+-+-+ START OF PART 4 -+-+-+-+-+-+-+-+
- X! ** sequence, or a `5EM overstrike string.
- X! */
- X! if (!MOST_B_OPT)
- X! `7B
- X! if (!MOST_V_OPT)
- X! `7B
- X! if ((char1 == '`5B' &&
- X! (*end == '\033' && *(end + 3) == 'm' &&
- X! (*(end + 2) == '0' `7C`7C *(end + 2) == '1' `7
- VC`7C`20
- X! *(end + 2) == '4' `7C`7C *(end + 2) == '7')))
- V `7C`7C
- X! (char1 == 'm' &&
- X! (*(end - 2) == '\033' && *(end - 1) == '`5B' &&
- X! (*end == '0' `7C`7C *end == '1' `7C`7C
- X! *end == '4' `7C`7C *end == '7'))) `7C`7C
- X! ((char1 == '0' `7C`7C char1 == '1' `7C`7C
- X! char1 == '4' `7C`7C char1 == '7') &&
- X! (*(end - 1) == '\033' && *end == '`5B' &&
- X! *(end + 2) == 'm')))
- X! goto again;
- X! else
- X! `7B
- X! save_pos = C_POS;
- X! C_POS = end + 1;
- X! b = beg_of_line1();
- X! if (!MOST_W_OPT)
- X! `7B
- X! e = end_of_line1();
- X! for (i = b; i <= e; i++)
- X! if (*i == '\015')
- X! `7B
- X! M_FLAG = 1;
- X! M_POS = i;
- X! `7D
- X! `7D
- X! else
- X! e = end_of_line();
- X! if (M_FLAG && C_POS > M_POS)
- X! `7B
- X! C_POS = save_pos;
- X! M_FLAG = 0;
- X! goto again;
- X! `7D
- X! C_POS = save_pos;
- X! M_FLAG = 0;
- X! `7D
- X! `7D
- X! `7D
- X! `20
- X! /*
- X! ** Now see if the rest of the string matches.
- X! ** If not Binary mode,
- X! ** deal with any embedded backspaces (`5EH)
- X! ** or <ESC>`5B#m sequences if not Verbose mode,
- X! ** and with tabs if not Verbose or explicit Tab modes.
- X! */
- X pos = end; /* save this position so we start from here again */
- X `20
- X if (!MOST_B_OPT && tab_flag)
- X**************
- X*** 107,114
- X `20
- X j = key_len - 2;
- X pos = end; /* save this position so we start from here again */
- X- while(ch = *end--, ch = upcase(ch),
- X- ch2 = work`5Bj`5D, (ch == ch2) && (j >= 0)) j--;
- X `20
- X if (j < 0)
- X `7B
- X--- 411,416 -----
- X ** and with tabs if not Verbose or explicit Tab modes.
- X */
- X pos = end; /* save this position so we start from here again */
- X `20
- X if (!MOST_B_OPT && tab_flag)
- X `7B
- X**************
- X*** 110,116
- X while(ch = *end--, ch = upcase(ch),
- X ch2 = work`5Bj`5D, (ch == ch2) && (j >= 0)) j--;
- X `20
- X! if (j < 0)
- X `7B
- X /* make key match 'key' in beg */
- X end = pos + 1; /* skip back to beginning of match */
- X--- 412,418 -----
- X */
- X pos = end; /* save this position so we start from here again */
- X `20
- X! if (!MOST_B_OPT && tab_flag)
- X `7B
- X end++;
- X j = key_len - 1;
- X**************
- X*** 112,118
- X `20
- X if (j < 0)
- X `7B
- X! /* make key match 'key' in beg */
- X end = pos + 1; /* skip back to beginning of match */
- X for (j = key_len; j > 0; j--) key`5Bj - 1`5D = *end--;
- X return(end + 1);
- X--- 414,516 -----
- X `20
- X if (!MOST_B_OPT && tab_flag)
- X `7B
- X! end++;
- X! j = key_len - 1;
- X! `7D
- X! else
- X! j = key_len - 2;
- X!`20
- X! if (MOST_B_OPT)
- X! `7B
- X! while(ch = *end--, ch = upcase(ch), ch2 = work`5Bj`5D,
- X! (ch == ch2 && j >= 0)) j--;
- X! `7D
- X! else
- X! `7B
- X! while(ch = *end--, ch = upcase(ch), ch2 = work`5Bj`5D,
- X! ((ch == ch2) `7C`7C
- X! (!MOST_V_OPT && (ch == '\b' `7C`7C ch == 'm')) `7C`
- V7C
- X! ((!MOST_V_OPT `7C`7C !MOST_T_OPT) &&
- X! ch == '\t' && ch2 == ' ') &&
- X! (j >= 0)))
- X! `7B
- X! j--;
- X! `20
- X! /*
- X! ** deal with `5EH if not Verbose mode
- X! */
- X! if (ch2 != '\b' && ch == '\b')
- X! `7B
- X! ch = *(end - 1);
- X! ch = upcase(ch);
- X! if (ch == ch2)
- X! end -= 2;
- X! else
- X! break;
- X! `7D
- X! `20
- X! /*
- X! ** deal with <ESC>`5B#m if not Verbose mode
- X! */
- X! else if (ch == 'm' &&
- X! *(end - 2) == '\033' && *(end - 1) == '`5B'
- V &&
- X! (*end == '0' `7C`7C *end == '1' `7C`7C
- X! *end == '4' `7C`7C *end == '7'))
- X! `7B
- X! ch = *(end - 3);
- X! ch = upcase(ch);
- X! if (ch != ch2) break;
- X! else end -= 4;
- X! `7D
- X! `20
- X! /*
- X! ** deal with tabs if not Verbose or explicit Tab mo
- Vdes
- X! */
- X! else if (ch == '\t' && ch2 == ' ')
- X! `7B
- X! j++;
- X! save_pos = end + 2;
- X! while (*end == '\t' `7C`7C *end == ' ')
- X! end--;
- X! if (save_pos >= EOB)
- X! s = EOB - apparant_distance(end);
- X! else if (MOST_W_OPT)
- X! `7B
- X! MOST_W_OPT = 0;
- X! s = apparant_distance(save_pos) -
- X! apparant_distance(end) - 1;
- X! MOST_W_OPT = 1;
- X! `7D
- X! else
- X! s = apparant_distance(save_pos) -
- X! apparant_distance(end) - 1;
- X! if (end < b) s++;
- X! while (s && work`5Bj`5D == ' ' && j >= 0)
- X! `7B
- X! j--;
- X! s--;
- X! `7D
- X! if (j < 0)
- X! `7B
- X! S_DIFF = s;
- X! `7D
- X! else if (!tab_flag && s != 0 && j >= 0)
- X! `7B
- X! j = 0;
- X! break;
- X! `7D
- X! `7D
- X! `7D
- X! `7D
- X! `20
- X! /*
- X! ** if it's a full match
- X! */
- X! if (j < 0)
- X! `7B
- X! /*`20
- X! ** make key match 'key' in beg
- X! */
- X end = pos + 1; /* skip back to beginning of match */
- X for (j = key_len; j > 0; j--)
- X `7B
- X**************
- X*** 114,120
- X `7B
- X /* make key match 'key' in beg */
- X end = pos + 1; /* skip back to beginning of match */
- X! for (j = key_len; j > 0; j--) key`5Bj - 1`5D = *end--;
- X return(end + 1);
- X `7D
- X `20
- X--- 512,556 -----
- X ** make key match 'key' in beg
- X */
- X end = pos + 1; /* skip back to beginning of match */
- X! for (j = key_len; j > 0; j--)
- X! `7B
- X! if (MOST_B_OPT)
- X! `7B
- X! key`5Bj - 1`5D = *end--;
- X! `7D
- X! else
- X! `7B
- X! /*
- X! ** deal with overstriking via `5EH if not Ver
- Vbose
- X! */
- X! if (!MOST_V_OPT && *end == '\b')
- X! end -= 2;
- X! `20
- X! /*
- X! ** now deal with tabs if not Verbose or
- X! ** explicit Tab modes,
- X! ** else just get the character
- X! */
- X! if ((!MOST_V_OPT `7C`7C !MOST_T_OPT) &&
- X! *end == '\t' && work`5Bj - 1`5D == ' ')
- X! `7B
- X! while (*end == '\t' `7C`7C *end == ' ')
- V end--;
- X! while (key`5Bj - 1`5D == ' ') j--;
- X! j++;
- X! `7D
- X! else
- X! key`5Bj - 1`5D = *end--;
- X! `20
- X! /*
- X! ** now deal with <ESC>`5B#m if not Verbose
- X! */
- X! if (!MOST_V_OPT && *end == 'm' &&
- X! *(end - 3) == '\033' && *(end - 2) == '`5B
- V' &&
- X! (*(end - 1) == '0' `7C`7C *(end - 1) == '1
- V' `7C`7C
- X! *(end - 1) == '4' `7C`7C *(end - 1) == '7
- V'))
- X! end -= 4;
- X! `7D
- X! `7D
- X return(end + 1);
- X `7D
- X else end = pos;
- X**************
- X*** 117,123
- X for (j = key_len; j > 0; j--) key`5Bj - 1`5D = *end--;
- X return(end + 1);
- X `7D
- X- `20
- X else end = pos;
- X `7D
- X `7D
- X--- 553,558 -----
- X `7D
- X return(end + 1);
- X `7D
- X else end = pos;
- X `7D
- X `7D
- X**************
- X*** 123,129
- X `7D
- X `20
- X `20
- X!`20
- X int search(unsigned char *from, int repeat, int *col)
- X `7B
- X /* return the line match was found as well as line number,
- X--- 558,568 -----
- X `7D
- X `20
- X `20
- X! /*
- X! ** Return the line match was found as well as line number.
- X! ** Search from 'from' on.
- X! ** Assume that line_array match the 'from' so we need no initial lookup.
- X! */
- X int search(unsigned char *from, int repeat, int *col)
- X `7B
- X int str_len,i,test,j,save_line,the_col,row;
- X**************
- X*** 126,134
- X `20
- X int search(unsigned char *from, int repeat, int *col)
- X `7B
- X! /* return the line match was found as well as line number,
- X! search from i on; assume that line_array match the i so we need
- X! no initial lookup */
- X `20
- X int test,j,save_line, the_col, row;
- X char ch, string`5B80`5D;
- X--- 565,574 -----
- X */
- X int search(unsigned char *from, int repeat, int *col)
- X `7B
- X! int str_len,i,test,j,save_line,the_col,row;
- X! char ch,string`5B80`5D;
- X! unsigned char *pos,*save_pos,*found_at;
- X! extern int SCREEN_WIDTH;
- X `20
- X /*
- X ** if out out bounds, do nothing
- X**************
- X*** 130,138
- X search from i on; assume that line_array match the i so we need
- X no initial lookup */
- X `20
- X! int test,j,save_line, the_col, row;
- X! char ch, string`5B80`5D;
- X! unsigned char *pos, *save_pos, *found_at;
- X `20
- X if ((from < BEG) `7C`7C (from > EOB)) return(-1);
- X save_pos = C_POS;
- X--- 570,580 -----
- X unsigned char *pos,*save_pos,*found_at;
- X extern int SCREEN_WIDTH;
- X `20
- X! /*
- X! ** if out out bounds, do nothing
- X! */
- X! if ((from < BEG) `7C`7C (from > EOB))
- X! return(-1);
- X `20
- X /*
- X ** If not Binary mode,
- X**************
- X*** 134,140
- X char ch, string`5B80`5D;
- X unsigned char *pos, *save_pos, *found_at;
- X `20
- X! if ((from < BEG) `7C`7C (from > EOB)) return(-1);
- X save_pos = C_POS;
- X save_line = C_LINE;
- X found_at = EOB;
- X--- 576,620 -----
- X if ((from < BEG) `7C`7C (from > EOB))
- X return(-1);
- X `20
- X! /*
- X! ** If not Binary mode,
- X! ** if not Verbose mode and search string has an overstrike
- X! ** (`5EH or `5EM) character or a legal <ESC>`5B#m sequence,
- X! ** else if not Verbose or not explicit Tab mode and search
- X! ** string has a tab,
- X! ** tell the user to implement the appropriate mode(s).
- X! */
- X! if (!MOST_B_OPT)
- X! `7B
- X! if (!MOST_V_OPT `7C`7C !MOST_T_OPT)
- X! `7B
- X! str_len = strlen(SEARCH_STR);
- X! for (i = 0; i < str_len; i++)
- X! `7B
- X! if ((!MOST_V_OPT) &&
- X! (SEARCH_STR`5Bi`5D == '\b' `7C`7C SEARCH_STR`5Bi
- V`5D == '\015' `7C`7C
- X! (SEARCH_STR`5Bi`5D == '\033' && i + 3 < str_len
- V &&
- X! SEARCH_STR`5Bi+1`5D == '`5B' && SEARCH_STR`5Bi
- V+3`5D == 'm' &&
- X! (SEARCH_STR`5Bi+2`5D == '0' `7C`7C
- X! SEARCH_STR`5Bi+2`5D == '1' `7C`7C
- X! SEARCH_STR`5Bi+2`5D == '4' `7C`7C
- X! SEARCH_STR`5Bi+2`5D == '7'))))
- X! `7B
- X! most_message
- X! ("Use Verbose mode to search for this string
- V.",1);
- X! return(-1);
- X! `7D
- X! else if ((!MOST_V_OPT `7C`7C !MOST_T_OPT) &&
- X! (SEARCH_STR`5Bi`5D == '\t'))
- X! `7B
- X! most_message
- X! ("Use Verbose and explicit Tab mode to search for this string
- V.",1);
- X! return(-1);
- X! `7D
- X! `7D
- X! `7D
- X! `7D
- X!`20
- X save_pos = C_POS;
- X save_line = C_LINE;
- X found_at = EOB;
- X**************
- X*** 177,186
- X `20
- X row = -1;
- X `7D
- X! /*
- X! ** expand tabs to get col correct
- X! */
- X! else if ( (!MOST_T_OPT `7C`7C !MOST_V_OPT) && !MOST_B_OPT)
- X `7B
- X find_row_column(found_at,&row,&the_col);
- X *col = apparant_distance(found_at);
- X--- 657,664 -----
- X `20
- X row = -1;
- X `7D
- X!`20
- X! else
- X `7B
- X find_row_column(found_at,&row,&the_col);
- X *col = the_col;
- X**************
- X*** 182,189
- X */
- X else if ( (!MOST_T_OPT `7C`7C !MOST_V_OPT) && !MOST_B_OPT)
- X `7B
- X! find_row_column(found_at,&row,&the_col);
- X! *col = apparant_distance(found_at);
- X `7D
- X C_POS = save_pos;
- X C_LINE = save_line;
- X--- 660,667 -----
- X `20
- X else
- X `7B
- X! find_row_column(found_at,&row,&the_col);
- X! *col = the_col;
- X `7D
- X `20
- X S_DIFF = 0;
- X**************
- X*** 185,190
- X find_row_column(found_at,&row,&the_col);
- X *col = apparant_distance(found_at);
- X `7D
- X C_POS = save_pos;
- X C_LINE = save_line;
- X if (row > 0) CURS_POS = found_at;
- X--- 663,670 -----
- X find_row_column(found_at,&row,&the_col);
- X *col = the_col;
- X `7D
- X+`20
- X+ S_DIFF = 0;
- X C_POS = save_pos;
- X C_LINE = save_line;
- X if (row > 0) CURS_POS = found_at;
- X**************
- X*** 190,192
- X if (row > 0) CURS_POS = found_at;
- X return( row );
- X `7D
- X--- 670,674 -----
- X if (row > 0) CURS_POS = found_at;
- X return( row );
- X `7D
- X+`20
- X+`20
- $ CALL UNPACK SEARCH_C.PAT;364 1514220245
- $ create 'f'
- X*** disk$disk1:`5Bflowers.swing.vmsnet`5Dswing_38.c;2
- X--- disk$disk1:`5Bflowers.swing.src`5Dswing_38.c;4
- X**************
- X*** 65,71
- X ** so these lines are here as an example,
- X ** but we don't use them.
- X **
- X! most_args`5Bmost_args`5D = (char *) malloc(strlen("-csv")+1);
- X strcpy(most_args`5Bnum_most_args++`5D,"-csv");
- X most_args`5Bnum_most_args`5D = (char *) malloc(strlen("+d")+1);
- X strcpy(most_args`5Bnum_most_args++`5D,"+d");
- X--- 65,71 -----
- X ** so these lines are here as an example,
- X ** but we don't use them.
- X **
- X! most_args`5Bnum_most_args`5D = (char *) malloc(strlen("-csv")+1);
- X strcpy(most_args`5Bnum_most_args++`5D,"-csv");
- X most_args`5Bnum_most_args`5D = (char *) malloc(strlen("+d")+1);
- X strcpy(most_args`5Bnum_most_args++`5D,"+d");
- $ CALL UNPACK SWING_38_C.PAT;364 427501045
- $ create 'f'
- X*** disk$disk1:`5Bflowers.swing.vmsnet`5Dswing.c;2
- X--- disk$disk1:`5Bflowers.swing.src`5Dswing.c;6
- X**************
- X*** 1757,1760
- X `09 programs derived from it: You must freely distribute the source
- X `09 code.).
- X `20
- X */
- X--- 1757,1763 -----
- X `09 programs derived from it: You must freely distribute the source
- X `09 code.).
- X `20
- X+ 921128 Foteos Macrides (MACRIDES@SCI.WFEB.EDU, MACRIDES@WFEB2.BITNET)
- X+ o Upgraded MOST to 3.03FM, as described in the header of its main.
- Vc.
- X+`20
- X */
- $ CALL UNPACK SWING_C.PAT;364 863834316
- $ create 'f'
- X*** disk$disk1:`5Bflowers.swing.vmsnet`5Dswing.h;2
- X--- disk$disk1:`5Bflowers.swing.src`5Dswing.h;6
- X**************
- X*** 111,117
- X #define realloc`09VAXC$REALLOC_OPT
- X #endif
- X `20
- X! #define VERSION`09"C SWING v3.6.3 (S.J.Brown, M.Akerberg, H.Flowers, F.Mac
- Vrides & others)"
- X #define DEFAULT_DIR_SPEC`09"*.*"
- X `20
- X #define AUTO_CONTINUAL_UPDATE`095
- X--- 111,117 -----
- X #define realloc`09VAXC$REALLOC_OPT
- X #endif
- X `20
- X! #define VERSION`09"C SWING v3.6.4 (S.J.Brown, M.Akerberg, H.Flowers, F.Mac
- Vrides & others)"
- X #define DEFAULT_DIR_SPEC`09"*.*"
- X `20
- X #define AUTO_CONTINUAL_UPDATE`095
- $ CALL UNPACK SWING_H.PAT;364 337474121
- $ create 'f'
- X*** disk$disk1:`5Bflowers.swing.vmsnet`5Dwindow.c;2
- X--- disk$disk1:`5Bflowers.swing.src`5Dwindow.c;3
- X**************
- X*** 171,176
- X if (NUM_LINES <= wsize) /* short file */
- X `7B
- X *line = 1;
- X return(0);
- X `7D
- X `20
- X--- 171,177 -----
- X if (NUM_LINES <= wsize) /* short file */
- X `7B
- X *line = 1;
- X+ most_message("Entire Buffer is in the window.",1);
- X return(0);
- X `7D
- X `20
- $ CALL UNPACK WINDOW_C.PAT;364 7081570
- $ v=f$verify(v)
- $ EXIT
-
-