home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / thesrc15.zip / vax.c < prev    next >
C/C++ Source or Header  |  1993-09-01  |  5KB  |  149 lines

  1. /***********************************************************************/
  2. /* VAX.C -                                                             */
  3. /* This file contains pseudo SystemV functions that are missing on VAX.*/
  4. /***********************************************************************/
  5. /*
  6.  * THE - The Hessling Editor. A text editor similar to VM/CMS xedit.
  7.  * Copyright (C) 1991-1993 Mark Hessling
  8.  * 
  9.  * This program is free software; you can redistribute it and/or
  10.  * modify it under the terms of the GNU General Public License as
  11.  * published by the Free Software Foundation; either version 2 of
  12.  * the License, or any later version.
  13.  * 
  14.  * This program is distributed in the hope that it will be useful,
  15.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17.  * General Public License for more details.
  18.  * 
  19.  * You should have received a copy of the GNU General Public License
  20.  * along with this program; if not, write to:
  21.  * 
  22.  *    The Free Software Foundation, Inc.
  23.  *    675 Mass Ave,
  24.  *    Cambridge, MA 02139 USA.
  25.  * 
  26.  * 
  27.  * If you make modifications to this software that you feel increases
  28.  * it usefulness for the rest of the community, please email the
  29.  * changes, enhancements, bug fixes as well as any and all ideas to me.
  30.  * This software is going to be maintained and enhanced as deemed 
  31.  * necessary by the community.
  32.  *
  33.  * Mark Hessling                     email: M.Hessling@gu.edu.au
  34.  * 36 David Road                     Phone: +61 7 849 7731
  35.  * Holland Park                      Fax:   +61 7 875 5314
  36.  * QLD 4121
  37.  * Australia
  38.  */
  39.  
  40. /*
  41. $Header: C:\THE\RCS\vax.c 1.4 1993/09/01 16:27:29 MH Interim MH $
  42. */
  43.  
  44. #include <stdio.h>
  45.  
  46. #include "the.h"
  47. /*-------------------------- external data ----------------------------*/
  48. extern VIEW_DETAILS *vd_current,*vd_first;
  49. extern char current_file;                   /* pointer to current file */
  50. /*---------------------- function definitions -------------------------*/
  51. /***********************************************************************/
  52. int reset_shell_mode()
  53. /***********************************************************************/
  54. {
  55. /*--------------------------- local data ------------------------------*/
  56. /*--------------------------- processing ------------------------------*/
  57.  return(0);
  58. }
  59. /***********************************************************************/
  60. int reset_prog_mode()
  61. /***********************************************************************/
  62. {
  63. /*--------------------------- local data ------------------------------*/
  64. /*--------------------------- processing ------------------------------*/
  65.  return(0);
  66. }
  67. /***********************************************************************/
  68. int doupdate()
  69. /***********************************************************************/
  70. {
  71. /*--------------------------- local data ------------------------------*/
  72.  unsigned short y,x;
  73. /*--------------------------- processing ------------------------------*/
  74.  getyx(CURRENT_WINDOW,y,x);
  75.  refresh();
  76.  wmove(CURRENT_WINDOW,y,x);
  77.  wrefresh(CURRENT_WINDOW);
  78.  return(0);
  79. }
  80. /***********************************************************************/
  81. int wnoutrefresh(win)
  82. WINDOW *win;
  83. /***********************************************************************/
  84. {
  85. /*--------------------------- local data ------------------------------*/
  86. /*--------------------------- processing ------------------------------*/
  87.  wrefresh(win);
  88.  return(0);
  89. }
  90. /***********************************************************************/
  91. int notimeout(win,bf)
  92. WINDOW *win;
  93. bool bf;
  94. /***********************************************************************/
  95. {
  96. /*--------------------------- local data ------------------------------*/
  97. /*--------------------------- processing ------------------------------*/
  98.  return(0);
  99. }
  100. /***********************************************************************/
  101. int wattrset(win,attrs)
  102. WINDOW *win;
  103. long attrs;
  104. /***********************************************************************/
  105. {
  106. /*--------------------------- local data ------------------------------*/
  107. #define A_NORMAL        000000000000L
  108. /*--------------------------- processing ------------------------------*/
  109.  if (attrs == A_NORMAL)
  110.     wstandend(win);
  111.  else
  112.     wstandout(win);
  113.  return(0);
  114. }
  115. /*#include "sys$login:vax.i" */
  116. #include iodef
  117. #include descrip
  118. /***********************************************************************/
  119. int keypress()
  120. /***********************************************************************/
  121. {
  122. /*--------------------------- local data ------------------------------*/
  123. struct { long length; char *address; } logical_name;
  124. struct { short status; short length; int remainder; } iosb;
  125.  
  126. static char kb[] = { "sys$input" };
  127. static int chan;
  128.  
  129. static char key = 0;
  130. int new_key;
  131. static int first = 1;
  132. int status;
  133. /*--------------------------- processing ------------------------------*/
  134.  
  135.  key = 0;
  136.  logical_name.length = strlen (kb);
  137.  logical_name.address = kb;
  138.  status = sys$assign (&logical_name, &chan, 0, 0);
  139.  if (status != 1)
  140.    return(-1);
  141.  status = SYS$QIOW(0, chan, IO$_READVBLK | IO$M_NOFILTR | IO$M_NOECHO
  142.         | IO$M_TIMED, &iosb, 0, 0, &key, 1,600, 0,0, 0, 0);
  143.  if (!key)
  144.     return (0);
  145.  new_key = (int)(unsigned)(key);
  146.  status = sys$dassgn (chan);
  147.  return (new_key);
  148. }
  149.