🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: vmsnet.sources
Article #8

C Swing v3.6.3 patches, part 07/07

#8
From: flowers
Date: Thu, 29 Oct 1992 17:42
575 lines
17050 bytes
Submitted-by: flowers@memstvx1.memst.edu (Harry Flowers)
Posting-number: Volume 3, Issue 218
Archive-name: cswing/patch2_07
Patch-to: cswing: Volume 3, Issue 35-52,93

-+-+-+-+-+-+-+-+ START OF PART 7 -+-+-+-+-+-+-+-+
X! #define VERSION`09"C SWING v3.6.2 (S.J.Brown, M.Akerberg, H.Flowers & othe
Vrs)"
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.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
$ CALL UNPACK SWING_H.PAT;363 1212249273
$ create 'f'
X*** disk$disk1:`5Bflowers.swing.vmsnet`5Dswing_refs.h;1
X--- disk$disk1:`5Bflowers.swing.src`5Dswing_refs.h;2
X**************
X*** 103,105
X `20
X  globalref char this_user`5B`5D;
X  globalref char start_dir`5B`5D;
X--- 103,107 -----
X `20
X  globalref char this_user`5B`5D;
X  globalref char start_dir`5B`5D;
X+`20
X+ globalref int sysroot_flag;
$ CALL UNPACK SWING_REFS_H.PAT;363 1513106295
$ create 'f'
X*** disk$disk1:`5Bflowers.swing.vmsnet`5Dsysdep.c;1
X--- disk$disk1:`5Bflowers.swing.src`5Dsysdep.c;3
X**************
X*** 11,19
X   *      deletion code for both unix and vms.
X   */
X  #include "sysdep.h"
X- #include smgdef
X- #include "swing.h"
X- #include "swing_refs.h"
X `20
X  /*`20
X   * `20
X--- 11,16 -----
X   *      deletion code for both unix and vms.
X   */
X  #include "sysdep.h"
X `20
X `20
X  /*`20
X**************
X*** 15,20
X  #include "swing.h"
X  #include "swing_refs.h"
X `20
X  /*`20
X   * `20
X   * `20
X--- 12,18 -----
X   */
X  #include "sysdep.h"
X `20
X+`20
X  /*`20
X   * `20
X   * `20
X**************
X*** 67,73
X `20
X  unsigned long SHELL_PID = 0; `20
X `20
X! /* returns 0 on success */
X  int do_shell_command()
X  `7B
X      /* here we try to attach to the parent otherwise just spawn a new one
V */
X--- 65,71 -----
X `20
X  unsigned long SHELL_PID = 0; `20
X `20
X! /* returns 1 on success */
X  int do_shell_command()
X  `7B
X      /* here we try to attach to the parent otherwise just spawn a new one
V */
X**************
X*** 74,81
X      unsigned long parent_pid;
X      unsigned long status = 0;
X      char str`5B80`5D;
X!    `20
X!    `20
X      parent_pid = getppid();
X     `20
X      if (parent_pid && parent_pid != 0xffffffff) `20
X--- 72,80 -----
X      unsigned long parent_pid;
X      unsigned long status = 0;
X      char str`5B80`5D;
X!`20
X!     $DESCRIPTOR(MOST_$_descr, "MOST > ");
X!`20
X      parent_pid = getppid();
X `20
X      if (parent_pid && parent_pid != 0xffffffff)
X**************
X*** 77,84
X     `20
X     `20
X      parent_pid = getppid();
X!    `20
X!     if (parent_pid && parent_pid != 0xffffffff) `20
X        /* we attach to parent */
X        status = lib$attach(&parent_pid);
X `20
X--- 76,83 -----
X      $DESCRIPTOR(MOST_$_descr, "MOST > ");
X `20
X      parent_pid = getppid();
X!`20
X!     if (parent_pid && parent_pid != 0xffffffff)
X        /* we attach to parent */
X        status = lib$attach(&parent_pid);
X `20
X**************
X*** 85,91
X      else if (SHELL_PID && SHELL_PID != 0xffffffff)
X        /* try to attach to previous shell */
X        status = lib$attach (&SHELL_PID);
X!      `20
X      if (status != SS$_NORMAL)`09`09/* others fail so spawn a new shell */
X        `7B
X            status = 0;
X--- 84,90 -----
X      else if (SHELL_PID && SHELL_PID != 0xffffffff)
X        /* try to attach to previous shell */
X        status = lib$attach (&SHELL_PID);
X!`20
X      if (status != SS$_NORMAL)`09`09/* others fail so spawn a new shell */
X        `7B
X            status = 0;
X**************
X*** 89,97
X      if (status != SS$_NORMAL)`09`09/* others fail so spawn a new shell */
X        `7B
X            status = 0;
X! `09  fputs("Spawning Subprocess...",stdout);
X!           fflush(stdout);
X! `09  lib$spawn(0,0,0,0,0,&SHELL_PID,&status);
X            /* if we attach back, status may come back unchanged */
X            if ((status != 0) && (status != SS$_NORMAL))
X              `7B
X--- 88,96 -----
X      if (status != SS$_NORMAL)`09`09/* others fail so spawn a new shell */
X        `7B
X            status = 0;
X! `09  fputs("Spawning MOST DCL SUBPROCESS (Logout when finished)...",
X!                 stdout);
X! `09  lib$spawn(0,0,0,0,0,&SHELL_PID,&status,0,0,0,&MOST_$_descr);
X            /* if we attach back, status may come back unchanged */
X            if ((status != 0) && (status != SS$_NORMAL))
X              `7B
X**************
X*** 100,105
X                  return(0);
X              `7D
X        `7D
X      return(1);
X  `7D
X `20
X--- 99,105 -----
X                  return(0);
X              `7D
X        `7D
X+     most_message(" ",0);  /* make sure message window is restored */
X      return(1);
X  `7D
X `20
X**************
X*** 155,160
X   * `20
X   */
X `20
X  void init_tty()
X  `7B
X  #ifdef VMS
X--- 155,167 -----
X   * `20
X   */
X `20
X+ #ifdef VMS
X+ /*
X+ ** For deciding whether to request a terminal channel.
X+ */
X+ static int first_request_for_MostTT_chan   = TRUE;
X+ #endif
X+`20
X  void init_tty()
X  `7B
X  #ifdef VMS
X**************
X*** 159,170
X  `7B
X  #ifdef VMS
X      $DESCRIPTOR ( Term, "SYS$COMMAND");
X!     if (sys$assign ( &Term, &TTY_CHANNEL_GLOBAL, 0, 0 )
X!         != SS$_NORMAL)
X!       `7B
X!           fprintf(stderr,"Unable to assign input channel\n");
X!           /* exit(0); */ return;
X!       `7D
X  #else   `20
X  #ifdef BSD
X      struct sgttyb  newtty;
X--- 166,185 -----
X  `7B
X  #ifdef VMS
X      $DESCRIPTOR ( Term, "SYS$COMMAND");
X!`20
X! /*
X! ** Assign a channel to the terminal, if necessary.
X! */
X!     if (first_request_for_MostTT_chan)
X!     `7B
X! `09if (sys$assign ( &Term, &TTY_CHANNEL_GLOBAL, 0, 0 )
X! `09!= SS$_NORMAL)
X! `09`7B
X! `09    fprintf(stderr,"Unable to assign input channel\n");
X! `09    /* exit(0); */ return;
X! `09`7D
X! `09first_request_for_MostTT_chan = FALSE;
X!     `7D
X  #else   `20
X  #ifdef BSD
X      struct sgttyb  newtty;
X**************
X*** 248,254
X      /* VMS */
X      /* see Guide to Programming VAX/VMS */
X      int status, trmmsk `5B2`5D = `7B 0, 0 `7D;
X! /*`09
X      short iosb `5B4`5D;
X      status = sys$qiow ( 0, TTY_CHANNEL_GLOBAL,
X                         IO$_READVBLK + IO$M_NOECHO `7C IO$_TTYREADALL,
X--- 263,269 -----
X      /* VMS */
X      /* see Guide to Programming VAX/VMS */
X      int status, trmmsk `5B2`5D = `7B 0, 0 `7D;
X!`20
X      short iosb `5B4`5D;
X `20
X      status = sys$qiow ( 0, TTY_CHANNEL_GLOBAL,
X**************
X*** 250,255
X      int status, trmmsk `5B2`5D = `7B 0, 0 `7D;
X  /*`09
X      short iosb `5B4`5D;
X      status = sys$qiow ( 0, TTY_CHANNEL_GLOBAL,
X                         IO$_READVBLK + IO$M_NOECHO `7C IO$_TTYREADALL,
X                         iosb, 0, 0,
X--- 265,271 -----
X      int status, trmmsk `5B2`5D = `7B 0, 0 `7D;
X `20
X      short iosb `5B4`5D;
X+`20
X      status = sys$qiow ( 0, TTY_CHANNEL_GLOBAL,
X                         IO$_READVBLK + IO$M_NOECHO `7C IO$_TTYREADALL,
X                         iosb, 0, 0,
X**************
X*** 254,286
X                         IO$_READVBLK + IO$M_NOECHO `7C IO$_TTYREADALL,
X                         iosb, 0, 0,
X                         &c, 1, 0, trmmsk, 0, 0 );
X! */
X!     int keycode;
X!     status = smg$read_keystroke(&keyboard,`20
X!                                 &keycode,
X!                                 0,
X!                                 0,
X!                                 0,
X!                                 0);
X! /*
X! **`09Map SMG defs back to character equivalents
X! */
X!     switch(keycode)
X!     `7B
X! `09case SMG$K_TRM_UP:`09`09c = '`5E'; break;
X! `09case SMG$K_TRM_DOWN:`09`09c = 'V'; break;
X! `09case SMG$K_TRM_LEFT:`09`09c = '<'; break;
X! `09case SMG$K_TRM_RIGHT:`09`09c = '>'; break;
X! `09case SMG$K_TRM_HELP:`09`09c = 'H'; break;
X! `09case SMG$K_TRM_DO:`09`09c = '$'; break;
X! `09case SMG$K_TRM_FIND:`09`09c = 'F'; break;
X! `09case SMG$K_TRM_INSERT_HERE:`09c = ','; break;
X! `09case SMG$K_TRM_REMOVE:`09`09c = '\007'; break;
X! `09case SMG$K_TRM_SELECT:`09`09c = 'M'; break;
X! `09case SMG$K_TRM_PREV_SCREEN:`09c = 'U'; break;
X! `09case SMG$K_TRM_NEXT_SCREEN:`09c = ' '; break;
X! `09default:`09`09`09c = keycode;
X!     `7D
X  #endif  /* VMS */
X  `09
X      return(c);`20
X--- 270,276 -----
X                         IO$_READVBLK + IO$M_NOECHO `7C IO$_TTYREADALL,
X                         iosb, 0, 0,
X                         &c, 1, 0, trmmsk, 0, 0 );
X!`20
X  #endif  /* VMS */
X  `09
X      return(c);`20
$ CALL UNPACK SYSDEP_C.PAT;363 33901425
$ create 'f'
X*** disk$disk1:`5Bflowers.swing.vmsnet`5Dwindow.c;1
X--- disk$disk1:`5Bflowers.swing.src`5Dwindow.c;2
X**************
X*** 60,67
X       `20
X      if (ch == '\007')
X        `7B
X!           fputc('\007',stdout);
X!           return(-1);    /* `5EG quits */
X        `7D
X      str`5Bi`5D = '\0';
X      return(i);
X--- 60,67 -----
X       `20
X      if (ch == '\007')
X        `7B
X!           fputc('\007',stdout);  /* ring bell */
X!           return(-1);            /* `5EG quits  */
X        `7D
X      str`5Bi`5D = '\0';
X      return(i);
X**************
X*** 329,335
X      if (MOST_B_OPT) w->flags `7C= _MOST_B_OPT;
X      if (MOST_T_OPT) w->flags `7C= _MOST_T_OPT;
X      if (MOST_W_OPT) w->flags `7C= _MOST_W_OPT;
X!     if (SQUEEZE_LINES) w->flags `7C= _MOST_SQ_OPT;
X      w->n_lines = NUM_LINES;
X      w->display = MOST_S_OPT;
X  `7D
X--- 329,335 -----
X      if (MOST_B_OPT) w->flags `7C= _MOST_B_OPT;
X      if (MOST_T_OPT) w->flags `7C= _MOST_T_OPT;
X      if (MOST_W_OPT) w->flags `7C= _MOST_W_OPT;
X!     if (MOST_S_OPT) w->flags `7C= _MOST_SQ_OPT;
X      w->n_lines = NUM_LINES;
X      w->display = SELECTIVE_I_DISPLAY;
X  `7D
X**************
X*** 331,337
X      if (MOST_W_OPT) w->flags `7C= _MOST_W_OPT;
X      if (SQUEEZE_LINES) w->flags `7C= _MOST_SQ_OPT;
X      w->n_lines = NUM_LINES;
X!     w->display = MOST_S_OPT;
X  `7D
X `20
X  void window_buffer()
X--- 331,337 -----
X      if (MOST_W_OPT) w->flags `7C= _MOST_W_OPT;
X      if (MOST_S_OPT) w->flags `7C= _MOST_SQ_OPT;
X      w->n_lines = NUM_LINES;
X!     w->display = SELECTIVE_I_DISPLAY;
X  `7D
X `20
X  void window_buffer()
X**************
X*** 340,346
X      WIN->beg_pos = C_POS;
X      WIN->col = COLUMN;
X      WIN->buf = BUF;
X!     MOST_S_OPT = 0;
X      save_win_flags(WIN);
X  `7D
X `20
X--- 340,346 -----
X      WIN->beg_pos = C_POS;
X      WIN->col = COLUMN;
X      WIN->buf = BUF;
X!     SELECTIVE_I_DISPLAY = 0;
X      save_win_flags(WIN);
X  `7D
X `20
X**************
X*** 375,381
X      MOST_B_OPT = WIN->flags & _MOST_B_OPT;
X      MOST_T_OPT = WIN->flags & _MOST_T_OPT;
X      MOST_W_OPT = WIN->flags & _MOST_W_OPT;
X!     SQUEEZE_LINES = WIN->flags & _MOST_SQ_OPT;
X      NUM_LINES = WIN->n_lines;
X      MOST_S_OPT = WIN->display;
X  `7D
X--- 375,381 -----
X      MOST_B_OPT = WIN->flags & _MOST_B_OPT;
X      MOST_T_OPT = WIN->flags & _MOST_T_OPT;
X      MOST_W_OPT = WIN->flags & _MOST_W_OPT;
X!     MOST_S_OPT = WIN->flags & _MOST_SQ_OPT;
X      NUM_LINES = WIN->n_lines;
X      SELECTIVE_I_DISPLAY = WIN->display;
X  `7D
X**************
X*** 377,383
X      MOST_W_OPT = WIN->flags & _MOST_W_OPT;
X      SQUEEZE_LINES = WIN->flags & _MOST_SQ_OPT;
X      NUM_LINES = WIN->n_lines;
X!     MOST_S_OPT = WIN->display;
X  `7D
X `20
X `20
X--- 377,383 -----
X      MOST_W_OPT = WIN->flags & _MOST_W_OPT;
X      MOST_S_OPT = WIN->flags & _MOST_SQ_OPT;
X      NUM_LINES = WIN->n_lines;
X!     SELECTIVE_I_DISPLAY = WIN->display;
X  `7D
X `20
X `20
X**************
X*** 434,442
X      goto_rc(r,1);
X `20
X      i = ii = 0;
X!     new`5Bii++`5D = '-';
X!     if (WIN->lock) new`5Bii++`5D = '*'; else new`5Bii++`5D = '-';
X!     strp = " MOST: ";
X      while(*strp != '\0') new`5Bii++`5D = *strp++;
X     `20
X      while(ch = WIN->buf->file`5Bi++`5D, ch != '\0') new`5Bii++`5D = ch;
X--- 434,444 -----
X      goto_rc(r,1);
X `20
X      i = ii = 0;
X! /*  new`5Bii++`5D = '-'; */
X! /*  if (WIN->lock) new`5Bii++`5D = '*'; else new`5Bii++`5D = '-'; */
X!     if (WIN->lock) new`5Bii++`5D = '*'; else new`5Bii++`5D = ' ';
X! /*  strp = " MOST: "; */
X!     strp = "";
X      while(*strp != '\0') new`5Bii++`5D = *strp++;
X     `20
X      while(ch = WIN->buf->file`5Bi++`5D, ch != '\0') new`5Bii++`5D = ch;
$ CALL UNPACK WINDOW_C.PAT;363 2137135067
$ create 'f'
X*** disk$disk1:`5Bflowers.swing.vmsnet`5Dwindow.h;1
X--- disk$disk1:`5Bflowers.swing.src`5Dwindow.h;2
X**************
X*** 13,19
X        int n_lines;              /* number of lines of buffer (mode depende
Vnt) */
X        int top;                  /* screen location of top */
X        int bot;                  /* screen location of bot */
X!       int display;              /* value of MOST_S_OPT for selective displ
Vay */
X        char *status;             /* status line */
X        Buffer *buf;              /* buffer structure in window */
X        struct Window_Type *next; /* next window */
X--- 13,19 -----
X        int n_lines;              /* number of lines of buffer (mode depende
Vnt) */
X        int top;                  /* screen location of top */
X        int bot;                  /* screen location of bot */
X!       int display;              /* value of SELECTIVE_I_DISPLAY */
X        char *status;             /* status line */
X        Buffer *buf;              /* buffer structure in window */
X        struct Window_Type *next; /* next window */
$ CALL UNPACK WINDOW_H.PAT;363 1952521226
$ create 'f'
X1 SWING
X
X  SWING is a graphical VAX/VMS file management utility similar to PC
X  packages such as XTREE-GOLD and PCTOOLS.  SWING may be run on any
X  terminal supported by the VMS SMG (Screen Management) routines,
X  such as Digital's VT series or any reasonably complete emulation.
X
X  Format:
X
X      $ SWING
X!
X2 Parameters
X
X  If a directory specification is used as a parameter on the SWING
X  command line, SWING will open its display at that directory.
X  Multiple directories may be sepparated by commas and/or spaces.
X!
X3 Examples
X
X  Valid SWING commands include:
X
X      $ SWING SYS$LOGIN
X      $ SWING SYS$LOGIN,SYS$EXAMPLES,SYS$LIBRARY
X      $ SWING SYS$LOGIN SYS$EXAMPLES SYS$LIBRARY
X      $ SWING SYS$LOGIN,SYS$EXAMPLES SYS$LIBRARY
X!
X2 Command_Qualifiers                           `20
X
X  /FILEMANAGER
X
X    This command qualifier starts SWING in the File Manager screen,
X    bypassing the Directory Manager.  It may be specified as either:
X
X       $ SWING /FILEMANAGER
X     or
X       $ SWING -F
X
X
X  /HELP
X
X    This command qualifier displays basic syntactical help for SWING.
X    It may be specified as either:
X
X       $ SWING /HELP
X     or
X       $ SWING -H
X
X
X  /VERSION
X
X    This command qualifier displays the current version of SWING.  It
X    may be specified as either:
X
X       $ SWING /VERSION
X     or
X       $ SWING -V
X
X!
X2 /FILEMANAGER
X
X  This command qualifier starts SWING in the File Manager screen,
X  bypassing the Directory Manager.  It may be specified as either:
X
X     $ SWING /FILEMANAGER
X   or
X     $ SWING -F
X!
X2 /HELP
X
X  This command qualifier displays basic syntactical help for SWING.
X  It may be specified as either:
X
X     $ SWING /HELP
X   or
X     $ SWING -H
X!
X2 /VERSION                         `20
X
X  This command qualifier displays the current version of SWING.  It
X  may be specified as either:
X
X     $ SWING /VERSION
X   or
X     $ SWING -V
X!
X2 Help
X
X  There are two kinds of online help within SWING.  Quick menues are
X  available via the ? option, and standard VMS help is available via
X  the H option.
X!
X2 Settings_Files
X
X  SWING creates several files which are documented in the online help.
X  By default, these files are created in SYS$LOGIN:.  SWING may be told
X  to use another directory by defining the logical name SWING$SAVE to
X  equate to the desired directory.
$ CALL UNPACK [.DOCUMENTATION]DCL_SWING.HLP;363 1853045330
$ v=f$verify(v)
$ EXIT
Technical Details
Message-ID: <8880519@MVB.SAIC.COM>
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!umn.edu!paperboy.micro.umn.edu!magnus.acs.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!news.service.uci.edu!unogate!mvb.saic.com!vmsnet-sources

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!umn.edu!paperboy.micro.umn.edu!magnus.acs.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!news.service.uci.edu!unogate!mvb.saic.com!vmsnet-sources
From: flowers@memstvx1.memst.edu
Newsgroups: vmsnet.sources
Subject: C Swing v3.6.3 patches, part 07/07
Message-ID: <8880519@MVB.SAIC.COM>
Date: Thu, 29 Oct 1992 17:42:27 GMT
Organization: Memphis State University
Lines: 576
Approved: Mark.Berryman@Mvb.Saic.Com