home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sources / misc / 4120 < prev    next >
Encoding:
Text File  |  1992-11-21  |  54.8 KB  |  1,977 lines

  1. Newsgroups: comp.sources.misc
  2. Path: sparky!kent
  3. From: Warren Tucker <wht@n4hgf.Mt-Park.GA.US>
  4. Subject:  v33i115:  u386mon - SVR3 performance/status monitor v2.60, Part06/09
  5. Message-ID: <1992Nov22.020232.24328@sparky.imd.sterling.com>
  6. Followup-To: comp.sources.d
  7. X-Md4-Signature: 1e9cf01b341b8419416fd06cfa6d6fb2
  8. Sender: kent@sparky.imd.sterling.com (Kent Landfield)
  9. Organization: Sterling Software
  10. References: <csm-v33i110=u386mon.195754@sparky.IMD.Sterling.COM>
  11. Date: Sun, 22 Nov 1992 02:02:32 GMT
  12. Approved: kent@sparky.imd.sterling.com
  13. Lines: 1962
  14.  
  15. Submitted-by: Warren Tucker <wht@n4hgf.Mt-Park.GA.US>
  16. Posting-number: Volume 33, Issue 115
  17. Archive-name: u386mon/part06
  18. Environment: SYSVR3
  19. Supersedes: u386mon: Volume 22, Issue 3-9
  20.  
  21. #!/bin/sh
  22. # This is part 06 of u386mon.2.60
  23. # ============= libpanel.c ==============
  24. if test -f 'libpanel.c' -a X"$1" != X"-c"; then
  25.     echo 'x - skipping libpanel.c (File already exists)'
  26. else
  27. echo 'x - extracting libpanel.c (Text)'
  28. sed 's/^X//' << 'SHAR_EOF' > 'libpanel.c' &&
  29. X/* CHK=0x65C3 */
  30. X/*LINTLIBRARY*/
  31. X/*+-------------------------------------------------------------------------
  32. X    libpanel.c - panel support for u386mon
  33. X    wht@n4hgf.Mt-Park.GA.US
  34. X
  35. X  This module is not an efficient replacement for the SVR3.2 panel
  36. X  facility.  It is, however, fully featured and serves the needs of
  37. X  u386mon, assisting a port to SVR3.1.  It seems efficient enough to
  38. X  use in lieu of native (vendor-supplied) panels.
  39. X
  40. X  To use a native panels library, use -DNATIVE_PANELS, omit libpanel.o
  41. X  from OBJ, and compile the whole of u386mon, linking with -lpanel.
  42. X
  43. X  Some auld curses do not have is_linetouched() and is_wintouched().
  44. X  Defining NO_ISTOUCH will turn on some brain-damaged attempts at
  45. X  supplying these routines.
  46. X
  47. X  Defined functions:
  48. X    Touchline(pan,start,count)
  49. X    Touchpan(pan)
  50. X    Wnoutrefresh(pan)
  51. X    __calculate_obscure()
  52. X    __free_obscure(pan)
  53. X    __override(pan,show)
  54. X    __panel_is_linked(pan)
  55. X    __panel_link_bottom(pan)
  56. X    __panel_link_top(pan)
  57. X    __panel_unlink(pan)
  58. X    __panels_overlapped(pan1,pan2)
  59. X    bottom_panel(pan)
  60. X    dPanel(text,pan)
  61. X    dStack(fmt,num,pan)
  62. X    del_panel(pan)
  63. X    hide_panel(pan)
  64. X    is_linetouched(win,line)
  65. X    is_wintouched(win)
  66. X    move_panel(pan,starty,startx)
  67. X    new_panel(win)
  68. X    open_dfp()
  69. X    panel_above(pan)
  70. X    panel_below(pan)
  71. X    panel_hidden(pan)
  72. X    panel_userptr(pan)
  73. X    panel_window(pan)
  74. X    replace_panel(pan,win)
  75. X    set_panel_userptr(pan,uptr)
  76. X    show_panel(pan)
  77. X    top_panel(pan)
  78. X    update_panels()
  79. X
  80. X--------------------------------------------------------------------------*/
  81. X/*+:EDITS:*/
  82. X/*:07-15-1992-14:31-wht@n4hgf-2.60 release - u386mon+siotools merge */
  83. X/*:08-20-1991-12:44-root@n4hgf-nba@sysware.dk S5R31 and config reorg */
  84. X/*:08-01-1991-23:34-wht@n4hgf-release 2.40 source control point */
  85. X/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
  86. X/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
  87. X/*:08-02-1990-15:36-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
  88. X/*:08-02-1990-14:55-wht@n4hgf-add is_linetouched/is_wintouched hacks */
  89. X/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
  90. X/*:07-23-1990-05:25-wht@n4hgf-needed __override call in update_panels */
  91. X/*:07-23-1990-00:56-wht@n4hgf-full library working */
  92. X/*:07-21-1990-22:37-wht@n4hgf-flush out rest of routines */
  93. X/*:07-20-1990-18:58-wht-creation */
  94. X
  95. X#include "config.h"
  96. X
  97. X#if !defined(NATIVE_PANELS)
  98. X
  99. X#include <curses.h>
  100. X# include "libpanel.h"
  101. X#ifdef U386MON
  102. X#include "u386mon.h"
  103. X#endif
  104. X
  105. X#ifdef __STDC__
  106. X#ifdef LINT_ARGS    /* use Microsoft "ANSI" prototypes
  107. X                     * (the "best" divination of the "standard")
  108. X                     */
  109. Xvoid *malloc(int);
  110. Xvoid free(void *);
  111. X#else    /* LINT_ARGS */
  112. Xvoid *malloc();
  113. Xvoid free();
  114. X#endif    /* LINT_ARGS */
  115. X#else    /* __STDC__ */
  116. Xchar *malloc();
  117. Xvoid free();
  118. X#endif    /* __STDC__ */
  119. X
  120. XPANEL *__bottom_panel = (PANEL *)0;
  121. XPANEL *__top_panel = (PANEL *)0;
  122. XPANEL __stdscr_pseudo_panel = { (WINDOW *)0 };
  123. X
  124. X#ifndef lint
  125. X/*
  126. X * I don't like lint, but some do, so we try to calm the
  127. X * nervous bastard (lint, that is); I only get the notorious
  128. X * "warning: possible pointer alignment problem" on two
  129. X * usages of malloc.
  130. X */
  131. Xstatic char pident[] = "@(#) wht@n4hgf libpanel.c 1.2 07/23/90";
  132. X#endif
  133. X
  134. X#define STATIC static
  135. X
  136. X#ifdef PANEL_DEBUG
  137. XFILE *dfp = (FILE *)0;
  138. XFILE *open_dfp()
  139. X{
  140. X    if(!dfp)
  141. X    {
  142. X        dfp = fopen("p.log","w");
  143. X        fputs("-------\n",dfp);
  144. X    }
  145. X    return(dfp);
  146. X}
  147. X#define dBug(fmt,p1,p2) fprintf(open_dfp(),(fmt),(p1),(p2))
  148. X#else
  149. X#define dBug(fmt,p1,p2)
  150. X#endif
  151. X
  152. X/*+-------------------------------------------------------------------------
  153. X    dPanel(text,pan)
  154. X--------------------------------------------------------------------------*/
  155. X#ifdef PANEL_DEBUG
  156. XdPanel(text,pan)
  157. Xchar *text;
  158. XPANEL *pan;
  159. X{
  160. X    open_dfp();
  161. X    fprintf(dfp,"%s id=%s b=%s a=%s y=%d x=%d\n",
  162. X        text,pan->user,
  163. X        (pan->below) ? pan->below->user : "--",
  164. X        (pan->above) ? pan->above->user : "--",
  165. X        pan->wstarty, pan->wstartx);
  166. X    fflush(dfp);
  167. X}    /* end of dPanel */
  168. X#else
  169. X#define dPanel(text,pan)
  170. X#endif
  171. X
  172. X/*+-------------------------------------------------------------------------
  173. X    dStack(fmt,num,pan)
  174. X--------------------------------------------------------------------------*/
  175. X#ifdef PANEL_DEBUG
  176. Xvoid
  177. XdStack(fmt,num,pan)
  178. Xchar *fmt;
  179. Xint num;
  180. XPANEL *pan;
  181. X{
  182. Xchar s80[80];
  183. X
  184. X    open_dfp();
  185. X    sprintf(s80,fmt,num,pan);
  186. X    fprintf(dfp,"%s b=%s t=%s\n",s80,
  187. X        (__bottom_panel) ? __bottom_panel->user : "--",
  188. X        (__top_panel)    ? __top_panel->user    : "--");
  189. X    if(pan)
  190. X        fprintf(dfp,"pan id=%s\n",pan->user);
  191. X    pan = __bottom_panel;
  192. X    while(pan)
  193. X    {
  194. X        dPanel("stk",pan);
  195. X        pan = pan->above;
  196. X    }
  197. X    if(num == 9)
  198. X        fprintf(dfp,"\n");
  199. X
  200. X    fflush(dfp);
  201. X}    /* end of dStack */
  202. X#else
  203. X#define dStack(fmt,num,pan)
  204. X#endif
  205. X
  206. X/*+-------------------------------------------------------------------------
  207. X    Wnoutrefresh(pan) - debugging hook for wnoutrefresh
  208. X--------------------------------------------------------------------------*/
  209. X#ifdef PANEL_DEBUG
  210. XSTATIC int
  211. XWnoutrefresh(pan)
  212. XPANEL *pan;
  213. X{
  214. X    dPanel("wnoutrefresh",pan);
  215. X    wnoutrefresh(pan->win);
  216. X}    /* end of Wnoutrefresh */
  217. X#else
  218. X#define Wnoutrefresh(pan) wnoutrefresh((pan)->win)
  219. X#endif
  220. X
  221. X/*+-------------------------------------------------------------------------
  222. X    Touchpan(pan)
  223. X--------------------------------------------------------------------------*/
  224. X#ifdef PANEL_DEBUG
  225. XSTATIC int
  226. XTouchpan(pan)
  227. XPANEL *pan;
  228. X{
  229. X    dPanel("Touchpan",pan);
  230. X    touchwin(pan->win);
  231. X}    /* end of Touchpan */
  232. X#else
  233. X#define Touchpan(pan) touchwin((pan)->win)
  234. X#endif
  235. X
  236. X/*+-------------------------------------------------------------------------
  237. X    Touchline(pan,start,count)
  238. X--------------------------------------------------------------------------*/
  239. X#ifdef PANEL_DEBUG
  240. XSTATIC int
  241. XTouchline(pan,start,count)
  242. XPANEL *pan;
  243. Xint start;
  244. Xint count;
  245. X{
  246. Xchar s80[80];
  247. X    sprintf(s80,"Touchline s=%d c=%d",start,count);
  248. X    dPanel(s80,pan);
  249. X    touchline(pan->win,start,count);
  250. X}    /* end of Touchline */
  251. X#else
  252. X#define Touchline(pan,start,count) touchline((pan)->win,start,count)
  253. X#endif
  254. X
  255. X/*+-------------------------------------------------------------------------
  256. X    is_linetouched(win,line) - check to see if line has been touched
  257. XI don't know much about this - no guarantees - comments appreciated
  258. X--------------------------------------------------------------------------*/
  259. X#ifdef NO_ISTOUCH
  260. Xint
  261. Xis_linetouched(win,line)
  262. XWINDOW *win;
  263. Xint line;
  264. X{
  265. X    if(!win || (getmaxy(win) <= line) || (line < 0))
  266. X        return(ERR);
  267. X#ifdef _INFINITY
  268. X    return((win->_firstch[line] == _INFINITY) ? FALSE : TRUE);
  269. X#else /* _INFINITY */
  270. X#ifdef _NOCHANGE
  271. X    return(((win->_lastch[line] == _NOCHANGE) ||
  272. X            (win->_firstch[line] == _NOCHANGE))
  273. X            ? FALSE : TRUE);
  274. X#else /* _NOCHANGE */
  275. X    return((win->_firstch[line] >= getmaxx(win)) ? FALSE : TRUE);
  276. X#endif /* _NOCHANGE */
  277. X#endif    /* _INFINITY */
  278. X}    /* end of is_linetouched */
  279. X#endif /* NO_ISTOUCH */
  280. X
  281. X/*+-------------------------------------------------------------------------
  282. X    is_wintouched(win) - check to see if window has been touched
  283. XI don't know much about this - no guarantees - comments appreciated
  284. X--------------------------------------------------------------------------*/
  285. X#ifdef NO_ISTOUCH
  286. Xint
  287. Xis_wintouched(win)
  288. XWINDOW *win;
  289. X{
  290. X#ifdef _WINCHANGED
  291. X    if(!win)
  292. X        return(ERR);
  293. X    return((win->_flags & _WINCHANGED) ? TRUE : FALSE);
  294. X#else /* _WINCHANGED */
  295. Xregister int line;
  296. X
  297. X    if(!win)
  298. X        return(ERR);
  299. X    /*
  300. X     * could not discover a _WINCHANGED analog in old curses
  301. X     */
  302. X    for(line = 0; line < getmaxy(win); line++)
  303. X    {
  304. X        if(is_linetouched(win,line))
  305. X            return(TRUE);
  306. X    }
  307. X    return(FALSE);
  308. X#endif /* _WINCHANGED */
  309. X
  310. X}    /* end of is_wintouched */
  311. X#endif /* NO_ISTOUCH */
  312. X
  313. X/*+-------------------------------------------------------------------------
  314. X    __panels_overlapped(pan1,pan2) - check panel overlapped
  315. X--------------------------------------------------------------------------*/
  316. XSTATIC int
  317. X__panels_overlapped(pan1,pan2)
  318. Xregister PANEL *pan1;
  319. Xregister PANEL *pan2;
  320. X{
  321. X    if(!pan1 || !pan2)
  322. X        return(0);
  323. X    dBug("__panels_overlapped %s %s\n",pan1->user,pan2->user);
  324. X    if((pan1->wstarty >= pan2->wstarty) && (pan1->wstarty < pan2->wendy) &&
  325. X        (pan1->wstartx >= pan2->wstartx) && (pan1->wstartx < pan2->wendx))
  326. X        return(1);
  327. X    if((pan1->wstarty >= pan1->wstarty) && (pan2->wstarty < pan1->wendy) &&
  328. X        (pan1->wstartx >= pan1->wstartx) && (pan2->wstartx < pan1->wendx))
  329. X        return(1);
  330. X    dBug("  no\n",0,0);
  331. X    return(0);
  332. X}    /* end of __panels_overlapped */
  333. X
  334. X/*+-------------------------------------------------------------------------
  335. X    __free_obscure(pan)
  336. X--------------------------------------------------------------------------*/
  337. XSTATIC void
  338. X__free_obscure(pan)
  339. XPANEL *pan;
  340. X{
  341. XPANELOBS *tobs = pan->obscure;                /* "this" one */
  342. XPANELOBS *nobs;                                /* "next" one */
  343. X
  344. X    while(tobs)
  345. X    {
  346. X        nobs = tobs->above;
  347. X        free((char *)tobs);
  348. X        tobs = nobs;
  349. X    }
  350. X    pan->obscure = (PANELOBS *)0;
  351. X}    /* end of __free_obscure */
  352. X
  353. X/*+-------------------------------------------------------------------------
  354. X    __override(pan,show)
  355. X--------------------------------------------------------------------------*/
  356. XSTATIC void
  357. X__override(pan,show)
  358. XPANEL *pan;
  359. Xint show;
  360. X{
  361. Xregister y;
  362. Xregister PANEL *pan2;
  363. XPANELOBS *tobs = pan->obscure;                /* "this" one */
  364. X
  365. X    dBug("__override %s,%d\n",pan->user,show);
  366. X
  367. X    if(show == 1)
  368. X        Touchpan(pan);
  369. X    else if(!show)
  370. X    {
  371. X        Touchpan(pan);
  372. X/*
  373. X        Touchline(&__stdscr_pseudo_panel,pan->wendy,getmaxy(pan->win));
  374. X*/
  375. X        Touchpan(&__stdscr_pseudo_panel);
  376. X    }
  377. X    else if(show == -1)
  378. X    {
  379. X        while(tobs && (tobs->pan != pan))
  380. X            tobs = tobs->above;
  381. X    }
  382. X
  383. X    while(tobs)
  384. X    {
  385. X        if((pan2 = tobs->pan) != pan)
  386. X        {
  387. X            dBug("test obs pan=%s pan2=%s\n",pan->user,pan2->user);
  388. X            for(y = pan->wstarty; y < pan->wendy; y++)
  389. X            {
  390. X                if( (y >= pan2->wstarty) && (y < pan2->wendy) &&
  391. X                    ((is_linetouched(pan->win,y - pan->wstarty) == 1) ||
  392. X                    (is_linetouched(stdscr,y) == 1)))
  393. X                {
  394. X                    Touchline(pan2,y - pan2->wstarty,1);
  395. X                }
  396. X            }
  397. X        }
  398. X        tobs = tobs->above;
  399. X    }
  400. X}    /* end of __override */
  401. X
  402. X/*+-------------------------------------------------------------------------
  403. X    __calculate_obscure()
  404. X--------------------------------------------------------------------------*/
  405. XSTATIC void
  406. X__calculate_obscure()
  407. X{
  408. XPANEL *pan;
  409. Xregister PANEL *pan2;
  410. Xregister PANELOBS *tobs;            /* "this" one */
  411. XPANELOBS *lobs = (PANELOBS *)0;        /* last one */
  412. X
  413. X    pan = __bottom_panel;
  414. X    while(pan)
  415. X    {
  416. X        if(pan->obscure)
  417. X            __free_obscure(pan);
  418. X        dBug("--> __calculate_obscure %s\n",pan->user,0);
  419. X        lobs = (PANELOBS *)0;        /* last one */
  420. X        pan2 = __bottom_panel;
  421. X        while(pan2)
  422. X        {
  423. X            if(__panels_overlapped(pan,pan2))
  424. X            {
  425. X                if(!(tobs = (PANELOBS *)malloc(sizeof(PANELOBS))))
  426. X                    return;
  427. X                tobs->pan = pan2;
  428. X                dPanel("obscured",pan2);
  429. X                tobs->above = (PANELOBS *)0;
  430. X                if(lobs)
  431. X                    lobs->above = tobs;
  432. X                else
  433. X                    pan->obscure = tobs;
  434. X                lobs  = tobs;
  435. X            }
  436. X            pan2 = pan2->above;
  437. X        }
  438. X        __override(pan,1);
  439. X        pan = pan->above;
  440. X    }
  441. X
  442. X}    /* end of __calculate_obscure */
  443. X
  444. X/*+-------------------------------------------------------------------------
  445. X    __panel_is_linked(pan) - check to see if panel is in the stack
  446. X--------------------------------------------------------------------------*/
  447. XSTATIC int
  448. X__panel_is_linked(pan)
  449. XPANEL *pan;
  450. X{
  451. Xregister PANEL *pan2 = __bottom_panel;
  452. X
  453. X    while(pan2)
  454. X    {
  455. X        if(pan2 == pan)
  456. X            return(1);
  457. X        pan2 = pan2->above;
  458. X    }
  459. X    return(OK);
  460. X}    /* end of __panel_is_linked */
  461. X
  462. X/*+-------------------------------------------------------------------------
  463. X    __panel_link_top(pan) - link panel into stack at top
  464. X--------------------------------------------------------------------------*/
  465. XSTATIC void
  466. X__panel_link_top(pan)
  467. XPANEL *pan;
  468. X{
  469. X
  470. X#ifdef PANEL_DEBUG
  471. X    dStack("<lt%d>",1,pan);
  472. X    if(__panel_is_linked(pan))
  473. X        return;
  474. X#endif
  475. X
  476. X    pan->above = (PANEL *)0;
  477. X    pan->below = (PANEL *)0;
  478. X    if(__top_panel)
  479. X    {
  480. X        __top_panel->above = pan;
  481. X        pan->below = __top_panel;
  482. X    }
  483. X    __top_panel = pan;
  484. X    if(!__bottom_panel)
  485. X        __bottom_panel = pan;
  486. X    __calculate_obscure();
  487. X    dStack("<lt%d>",9,pan);
  488. X
  489. X}    /* end of __panel_link_top */
  490. X
  491. X/*+-------------------------------------------------------------------------
  492. X    __panel_link_bottom(pan) - link panel into stack at bottom
  493. X--------------------------------------------------------------------------*/
  494. XSTATIC void
  495. X__panel_link_bottom(pan)
  496. XPANEL *pan;
  497. X{
  498. X
  499. X#ifdef PANEL_DEBUG
  500. X    dStack("<lb%d>",1,pan);
  501. X    if(__panel_is_linked(pan))
  502. X        return;
  503. X#endif
  504. X
  505. X    pan->above = (PANEL *)0;
  506. X    pan->below = (PANEL *)0;
  507. X    if(__bottom_panel)
  508. X    {
  509. X        __bottom_panel->below = pan;
  510. X        pan->above = __bottom_panel;
  511. X    }
  512. X    __bottom_panel = pan;
  513. X    if(!__top_panel)
  514. X        __top_panel = pan;
  515. X    __calculate_obscure();
  516. X    dStack("<lb%d>",9,pan);
  517. X
  518. X}    /* end of __panel_link_bottom */
  519. X
  520. X/*+-------------------------------------------------------------------------
  521. X    __panel_unlink(pan) - unlink panel from stack
  522. X--------------------------------------------------------------------------*/
  523. XSTATIC void
  524. X__panel_unlink(pan)
  525. XPANEL *pan;
  526. X{
  527. Xregister PANEL *prev;
  528. Xregister PANEL *next;
  529. X
  530. X#ifdef PANEL_DEBUG
  531. X    dStack("<u%d>",1,pan);
  532. X    if(!__panel_is_linked(pan))
  533. X        return;
  534. X#endif
  535. X
  536. X    __override(pan,0);
  537. X    __free_obscure(pan);
  538. X
  539. X    prev = pan->below;
  540. X    next = pan->above;
  541. X
  542. X    if(prev)        /* if non-zero, we will not update the list head */
  543. X    {
  544. X        prev->above = next;
  545. X        if(next)
  546. X            next->below = prev;
  547. X    }
  548. X    else if(next)
  549. X        next->below = prev;
  550. X    if(pan == __bottom_panel)
  551. X        __bottom_panel = next;
  552. X    if(pan == __top_panel)
  553. X        __top_panel = prev;
  554. X
  555. X    __calculate_obscure();
  556. X
  557. X    pan->above = (PANEL *)0;
  558. X    pan->below = (PANEL *)0;
  559. X    dStack("<u%d>",9,pan);
  560. X
  561. X}    /* end of __panel_unlink */
  562. X
  563. X/*+-------------------------------------------------------------------------
  564. X    panel_window(pan) - get window associated with panel
  565. X--------------------------------------------------------------------------*/
  566. XWINDOW *
  567. Xpanel_window(pan)
  568. XPANEL *pan;
  569. X{
  570. X    return(pan->win);
  571. X}    /* end of panel_window */
  572. X
  573. X/*+-------------------------------------------------------------------------
  574. X    update_panels() - wnoutrefresh windows in an orderly fashion
  575. X--------------------------------------------------------------------------*/
  576. Xvoid
  577. Xupdate_panels()
  578. X{
  579. XPANEL *pan;
  580. X
  581. X    dBug("--> update_panels\n",0,0);
  582. X    pan = __bottom_panel;
  583. X    while(pan)
  584. X    {
  585. X        __override(pan,-1);
  586. X        pan = pan->above;
  587. X    }
  588. X
  589. X    if(is_wintouched(stdscr))
  590. X        Wnoutrefresh(&__stdscr_pseudo_panel);
  591. X    
  592. X    if(pan = __bottom_panel)
  593. X    {
  594. X        while(pan)
  595. X        {
  596. X            if(is_wintouched(pan->win))
  597. X                Wnoutrefresh(pan);
  598. X            pan = pan->above;
  599. X        }
  600. X    }
  601. X}    /* end of update_panels */
  602. X
  603. X/*+-------------------------------------------------------------------------
  604. X    hide_panel(pan) - remove a panel from stack
  605. X--------------------------------------------------------------------------*/
  606. Xint
  607. Xhide_panel(pan)
  608. Xregister PANEL *pan;
  609. X{
  610. X
  611. X    if(!pan)
  612. X        return(ERR);
  613. X
  614. X    dBug("--> hide_panel %s\n",pan->user,0);
  615. X
  616. X    if(!__panel_is_linked(pan))
  617. X    {
  618. X        pan->above = (PANEL *)0;
  619. X        pan->below = (PANEL *)0;
  620. X        return(ERR);
  621. X    }
  622. X
  623. X    __panel_unlink(pan);
  624. X
  625. X    return(OK);
  626. X}    /* end of hide_panel */
  627. X
  628. X/*+-------------------------------------------------------------------------
  629. X    show_panel(pan) - place a panel on top of stack
  630. Xmay already be in stack
  631. X--------------------------------------------------------------------------*/
  632. Xint
  633. Xshow_panel(pan)
  634. Xregister PANEL *pan;
  635. X{
  636. X
  637. X    if(!pan)
  638. X        return(ERR);
  639. X    if(pan == __top_panel)
  640. X        return(OK);
  641. X    dBug("--> show_panel %s\n",pan->user,0);
  642. X    if(__panel_is_linked(pan))
  643. X        (void)hide_panel(pan);
  644. X    __panel_link_top(pan);
  645. X    return(OK);
  646. X}    /* end of show_panel */
  647. X
  648. X/*+-------------------------------------------------------------------------
  649. X    top_panel(pan) - place a panel on top of stack
  650. X--------------------------------------------------------------------------*/
  651. Xint
  652. Xtop_panel(pan)
  653. Xregister PANEL *pan;
  654. X{
  655. X    return(show_panel(pan));
  656. X}    /* end of top_panel */
  657. X
  658. X/*+-------------------------------------------------------------------------
  659. X    del_panel(pan) - remove a panel from stack, if in it, and free struct
  660. X--------------------------------------------------------------------------*/
  661. Xint
  662. Xdel_panel(pan)
  663. Xregister PANEL *pan;
  664. X{
  665. X    if(pan)
  666. X    {
  667. X        dBug("--> del_panel %s\n",pan->user,0);
  668. X        if(__panel_is_linked(pan))
  669. X            (void)hide_panel(pan);
  670. X        free((char *)pan);
  671. X        return(OK);
  672. X    }
  673. X    return(ERR);
  674. X}    /* end of del_panel */
  675. X
  676. X/*+-------------------------------------------------------------------------
  677. X    bottom_panel(pan) - place a panel on bottom of stack
  678. Xmay already be in stack
  679. X--------------------------------------------------------------------------*/
  680. Xint
  681. Xbottom_panel(pan)
  682. Xregister PANEL *pan;
  683. X{
  684. X    if(!pan)
  685. X        return(ERR);
  686. X    if(pan == __bottom_panel)
  687. X        return(OK);
  688. X    dBug("--> bottom_panel %s\n",pan->user,0);
  689. X    if(__panel_is_linked(pan))
  690. X        (void)hide_panel(pan);
  691. X    __panel_link_bottom(pan);
  692. X    return(OK);
  693. X}    /* end of bottom_panel */
  694. X
  695. X/*+-------------------------------------------------------------------------
  696. X    new_panel(win) - create a panel and place on top of stack
  697. X--------------------------------------------------------------------------*/
  698. XPANEL *
  699. Xnew_panel(win)
  700. XWINDOW *win;
  701. X{
  702. XPANEL *pan = (PANEL *)malloc(sizeof(PANEL));
  703. X
  704. X    if(!__stdscr_pseudo_panel.win)
  705. X    {
  706. X        __stdscr_pseudo_panel.win = stdscr;
  707. X        __stdscr_pseudo_panel.wstarty = 0;
  708. X        __stdscr_pseudo_panel.wstartx = 0;
  709. X        __stdscr_pseudo_panel.wendy = LINES;
  710. X        __stdscr_pseudo_panel.wendx = COLS;
  711. X        __stdscr_pseudo_panel.user = "stdscr";
  712. X        __stdscr_pseudo_panel.obscure = (PANELOBS *)0;
  713. X    }
  714. X
  715. X    if(pan)
  716. X    {
  717. X        pan->win = win;
  718. X        pan->above = (PANEL *)0;
  719. X        pan->below = (PANEL *)0;
  720. X        pan->wstarty = getbegy(win);
  721. X        pan->wstartx = getbegx(win);
  722. X        pan->wendy = pan->wstarty + getmaxy(win);
  723. X        pan->wendx = pan->wstartx + getmaxx(win);
  724. X#ifdef PANEL_DEBUG
  725. X        pan->user = "new";
  726. X#else
  727. X        pan->user = (char *)0;
  728. X#endif
  729. X        pan->obscure = (PANELOBS *)0;
  730. X        (void)show_panel(pan);
  731. X    }
  732. X
  733. X    return(pan);
  734. X}    /* end of new_panel */
  735. X
  736. X/*+-------------------------------------------------------------------------
  737. X    panel_above(pan)
  738. X--------------------------------------------------------------------------*/
  739. XPANEL *
  740. Xpanel_above(pan)
  741. XPANEL *pan;
  742. X{
  743. X    if(!pan)
  744. X        return(__bottom_panel);
  745. X    else
  746. X        return(pan->above);
  747. X}    /* end of panel_above */
  748. X
  749. X/*+-------------------------------------------------------------------------
  750. X    panel_below(pan)
  751. X--------------------------------------------------------------------------*/
  752. XPANEL *
  753. Xpanel_below(pan)
  754. XPANEL *pan;
  755. X{
  756. X    if(!pan)
  757. X        return(__top_panel);
  758. X    else
  759. X        return(pan->below);
  760. X}    /* end of panel_below */
  761. X
  762. X/*+-------------------------------------------------------------------------
  763. X    set_panel_userptr(pan,uptr)
  764. X--------------------------------------------------------------------------*/
  765. Xint
  766. Xset_panel_userptr(pan,uptr)
  767. XPANEL *pan;
  768. Xchar *uptr;
  769. X{
  770. X    if(!pan)
  771. X        return(ERR);
  772. X    pan->user = uptr;
  773. X    return(OK);
  774. X}    /* end of set_panel_userptr */
  775. X
  776. X/*+-------------------------------------------------------------------------
  777. X    panel_userptr(pan)
  778. X--------------------------------------------------------------------------*/
  779. Xchar *
  780. Xpanel_userptr(pan)
  781. XPANEL *pan;
  782. X{
  783. X    if(!pan)
  784. X        return((char *)0);
  785. X    return(pan->user);
  786. X}    /* end of panel_userptr */
  787. X
  788. X/*+-------------------------------------------------------------------------
  789. X    move_panel(pan,starty,startx)
  790. X--------------------------------------------------------------------------*/
  791. Xint
  792. Xmove_panel(pan,starty,startx)
  793. XPANEL *pan;
  794. Xint starty;
  795. Xint startx;
  796. X{
  797. XWINDOW *win;
  798. X
  799. X    if(!pan)
  800. X        return(ERR);
  801. X    if(__panel_is_linked(pan))
  802. X        __override(pan,0);
  803. X    win = pan->win;
  804. X    if(mvwin(win,starty,startx))
  805. X        return(ERR);
  806. X    pan->wstarty = getbegy(win);
  807. X    pan->wstartx = getbegx(win);
  808. X    pan->wendy = pan->wstarty + getmaxy(win);
  809. X    pan->wendx = pan->wstartx + getmaxx(win);
  810. X    if(__panel_is_linked(pan))
  811. X        __calculate_obscure();
  812. X    return(OK);
  813. X}    /* end of move_panel */
  814. X
  815. X/*+-------------------------------------------------------------------------
  816. X    replace_panel(pan,win)
  817. X--------------------------------------------------------------------------*/
  818. Xint
  819. Xreplace_panel(pan,win)
  820. XPANEL *pan;
  821. XWINDOW *win;
  822. X{
  823. X    if(!pan)
  824. X        return(ERR);
  825. X    if(__panel_is_linked(pan))
  826. X        __override(pan,0);
  827. X    pan->win = win;
  828. X    if(__panel_is_linked(pan))
  829. X        __calculate_obscure();
  830. X    return(OK);
  831. X}    /* end of replace_panel */
  832. X
  833. X/*+-------------------------------------------------------------------------
  834. X    panel_hidden(pan)
  835. X--------------------------------------------------------------------------*/
  836. Xint
  837. Xpanel_hidden(pan)
  838. XPANEL *pan;
  839. X{
  840. X    if(!pan)
  841. X        return(ERR);
  842. X    return(__panel_is_linked(pan) ? ERR : OK);
  843. X}    /* end of panel_hidden */
  844. X
  845. X#endif /* !defined(NATIVE_PANELS) */
  846. X/* vi: set tabstop=4 shiftwidth=4: */
  847. X/* end of libpanel.c */
  848. SHAR_EOF
  849. chmod 0644 libpanel.c ||
  850. echo 'restore of libpanel.c failed'
  851. Wc_c="`wc -c < 'libpanel.c'`"
  852. test 20097 -eq "$Wc_c" ||
  853.     echo 'libpanel.c: original size 20097, current size' "$Wc_c"
  854. fi
  855. # ============= libswap.c ==============
  856. if test -f 'libswap.c' -a X"$1" != X"-c"; then
  857.     echo 'x - skipping libswap.c (File already exists)'
  858. else
  859. echo 'x - extracting libswap.c (Text)'
  860. sed 's/^X//' << 'SHAR_EOF' > 'libswap.c' &&
  861. X/* CHK=0xFE62 */
  862. X/*LINTLIBRARY*/
  863. X/*+-------------------------------------------------------------------------
  864. X    libswap.c -- /dev/swap routines for SCO UNIX/386 (maybe other *NIX)
  865. X    ...!{gatech,emory}!n4hgf!wht
  866. X
  867. X  Defined functions:
  868. X    sinit()
  869. X    sread(caddr,maddr,len)
  870. X
  871. X routines were originally written by Mike "Ford" Ditto: kudos!!!
  872. X--------------------------------------------------------------------------*/
  873. X/*+:EDITS:*/
  874. X/*:07-15-1992-14:31-wht@n4hgf-2.60 release - u386mon+siotools merge */
  875. X/*:08-01-1991-23:34-wht@n4hgf-release 2.40 source control point */
  876. X/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
  877. X/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
  878. X/*:08-02-1990-15:36-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
  879. X/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
  880. X/*:06-27-1990-01:57-wht@n4hgf-1.10-incorporate suggestions from alpha testers */
  881. X/*:06-25-1990-04:14-wht@n4hgf-1.02-better error handling */
  882. X/*:06-24-1990-20:53-wht@n4hgf-v1.01-add ISC support thanks to peter@radig.de */
  883. X/*:06-22-1990-02:00-root@n4hgf-creation from libmem */
  884. X
  885. X#include <sys/types.h>
  886. X#include <fcntl.h>
  887. X#include "libswap.h"
  888. X
  889. Xvoid leave_text();
  890. X
  891. Xextern int errno;
  892. X
  893. Xstatic int fdswap = -2;
  894. Xdaddr_t lseek();
  895. X
  896. X/*+-------------------------------------------------------------------------
  897. X    sinit()
  898. X--------------------------------------------------------------------------*/
  899. Xvoid
  900. Xsinit()
  901. X{
  902. X    if(fdswap >= 0)
  903. X        return;
  904. X    if((fdswap=open("/dev/swap",O_RDONLY)) < 0)
  905. X#ifdef M_SYS5
  906. X        leave_text("can't open /dev/swap (chgrp mem /dev/swap)",1);
  907. X#else
  908. X        leave_text("can't open /dev/swap (chgrp sys /dev/swap)",1);
  909. X#endif
  910. X
  911. X}    /* end of sinit */
  912. X
  913. X/*+-------------------------------------------------------------------------
  914. X    sread(caddr,maddr,len)
  915. X--------------------------------------------------------------------------*/
  916. Xvoid
  917. Xsread(caddr,maddr,len)
  918. Xcaddr_t caddr;
  919. Xdaddr_t maddr;
  920. Xint len;
  921. X{
  922. Xchar s80[80];
  923. Xextern daddr_t myreadlen;
  924. Xextern int myreadcnt;
  925. X
  926. X#if defined(M_I286)
  927. X    maddr &= 0xFFFFL;
  928. X#endif
  929. X
  930. X    if(fdswap == -2)
  931. X        leave_text("sinit() not called",1);
  932. X
  933. X    if(lseek(fdswap,maddr,0) == -1L)
  934. X    {
  935. X        (void)sprintf(s80,"swap seek error addr %08lx",maddr);
  936. X        leave_text(s80,1);
  937. X    }
  938. X
  939. X    if(read(fdswap,caddr,len) != len)
  940. X    {
  941. X        (void)sprintf(s80,"swap read error len %d addr %08lx",len,maddr);
  942. X        leave_text(s80,255);
  943. X    }
  944. X    myreadlen += len;
  945. X    myreadcnt++;
  946. X}    /* end of sread */
  947. X
  948. X/* vi: set tabstop=4 shiftwidth=4: */
  949. SHAR_EOF
  950. chmod 0644 libswap.c ||
  951. echo 'restore of libswap.c failed'
  952. Wc_c="`wc -c < 'libswap.c'`"
  953. test 2421 -eq "$Wc_c" ||
  954.     echo 'libswap.c: original size 2421, current size' "$Wc_c"
  955. fi
  956. # ============= libnlsym.c ==============
  957. if test -f 'libnlsym.c' -a X"$1" != X"-c"; then
  958.     echo 'x - skipping libnlsym.c (File already exists)'
  959. else
  960. echo 'x - extracting libnlsym.c (Text)'
  961. sed 's/^X//' << 'SHAR_EOF' > 'libnlsym.c' &&
  962. X/* CHK=0xBEA7 */
  963. X/*LINTLIBRARY*/
  964. X/*+-------------------------------------------------------------------------
  965. X    libnlsym.c -- common runtime for nlsym users
  966. X    ...!{gatech,emory}!n4hgf!wht
  967. X
  968. X  Defined functions:
  969. X    nlsym_error(text)
  970. X    nlsym_read()
  971. X
  972. X--------------------------------------------------------------------------*/
  973. X/*+:EDITS:*/
  974. X/*:07-15-1992-14:31-wht@n4hgf-2.60 release - u386mon+siotools merge */
  975. X/*:08-01-1991-23:34-wht@n4hgf-release 2.40 source control point */
  976. X/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
  977. X/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
  978. X/*:08-02-1990-15:36-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
  979. X/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
  980. X/*:07-15-1990-01:41-wht@n4hgf-keep indicator nlsym has been read */
  981. X/*:06-27-1990-01:57-wht@n4hgf-1.10-incorporate suggestions from alpha testers */
  982. X/*:06-27-1990-01:55-wht@n4hgf-use 64 bits of unique check */
  983. X/*:06-25-1990-04:14-wht@n4hgf-1.02-better error handling */
  984. X/*:06-24-1990-20:53-wht@n4hgf-v1.01-add ISC support thanks to peter@radig.de */
  985. X/*:06-21-1990-14:26-r@n4hgf-version x0.12 seems bug free */
  986. X/*:10-27-1988-11:44-wht-creation */
  987. X
  988. X#include "config.h"
  989. X#include <stdio.h>
  990. X#include <sys/types.h>
  991. X#include <sys/stat.h>
  992. X#include <fcntl.h>
  993. X#include <nlist.h>
  994. X#if defined(mips)
  995. X#define n_sclass n_type
  996. X#endif
  997. X
  998. Xvoid leave_text();
  999. X
  1000. X#define DEFINE_NLSYM
  1001. X#include "nlsym.h"
  1002. X#include "libnlsym.h"
  1003. X
  1004. Xextern int errno;
  1005. Xextern char *sys_errlist[];
  1006. X
  1007. Xint nlsym_has_been_read = 0;
  1008. X
  1009. X/*+-------------------------------------------------------------------------
  1010. X    nlsym_error(text)
  1011. X--------------------------------------------------------------------------*/
  1012. Xvoid
  1013. Xnlsym_error(text)
  1014. Xchar *text;
  1015. X{
  1016. Xchar s128[128];
  1017. X
  1018. X    (void)strcpy(s128,text);
  1019. X    (void)strcat(s128,": run nlsym");
  1020. X    leave_text(s128,(errno) ? 255 : 1);
  1021. X}    /* end of nlsym_error */
  1022. X
  1023. X/*+-------------------------------------------------------------------------
  1024. X    nlsym_read()
  1025. X--------------------------------------------------------------------------*/
  1026. Xvoid
  1027. Xnlsym_read()
  1028. X{
  1029. Xchar s80[80];
  1030. Xint fdnlsym;
  1031. Xstruct stat curstat;    /* current /unix status */
  1032. Xstruct stat unixstat;        /* /unix status at nlsym run (void)time */
  1033. Xlong unique1 = 0;
  1034. Xlong unique2 = 0;
  1035. X
  1036. X    if(nlsym_has_been_read)
  1037. X        return;
  1038. X
  1039. X    if(stat(UNIX_KERNEL,&curstat) < 0)
  1040. X    {
  1041. X        (void)sprintf(s80,"cannot stat %s",UNIX_KERNEL);
  1042. X        nlsym_error(s80);
  1043. X    }
  1044. X
  1045. X    errno = 0;
  1046. X    if((fdnlsym = open(UNIX_NLSYM,O_RDONLY,0)) < 0)
  1047. X    {
  1048. X        (void)sprintf(s80,"%s open error\n",UNIX_NLSYM);
  1049. X        nlsym_error(s80);
  1050. X    }
  1051. X
  1052. X    if(read(fdnlsym,(char *)&unixstat,sizeof(unixstat)) != sizeof(unixstat))
  1053. X        nlsym_error("nlsym_read: /unix stat read error");
  1054. X
  1055. X    if(read(fdnlsym,(char *)nlsym,sizeof(nlsym)) != sizeof(nlsym))
  1056. X        nlsym_error("nlsym_read: nlsym read error");
  1057. X
  1058. X    if(read(fdnlsym,(char *)&unique1,sizeof(unique1)) != sizeof(unique1))
  1059. X        nlsym_error("nlsym_read: `unique' read error");
  1060. X
  1061. X    if(read(fdnlsym,(char *)&unique2,sizeof(unique2)) != sizeof(unique2))
  1062. X        nlsym_error("nlsym_read: `unique' read error");
  1063. X
  1064. X    (void)close(fdnlsym);
  1065. X
  1066. X    if( (unique1 != NLSYM_UNIQUE1) ||
  1067. X        (unique2 != NLSYM_UNIQUE2) ||
  1068. X        (unixstat.st_ino != curstat.st_ino) ||
  1069. X        (unixstat.st_mtime != curstat.st_mtime) ||
  1070. X        (unixstat.st_size != curstat.st_size))
  1071. X    {
  1072. X        (void)sprintf(s80,"%s out of date",UNIX_NLSYM);
  1073. X        nlsym_error(s80);
  1074. X    }
  1075. X    nlsym_has_been_read = 1;
  1076. X
  1077. X}    /* end of nlsym_read */
  1078. SHAR_EOF
  1079. chmod 0644 libnlsym.c ||
  1080. echo 'restore of libnlsym.c failed'
  1081. Wc_c="`wc -c < 'libnlsym.c'`"
  1082. test 3346 -eq "$Wc_c" ||
  1083.     echo 'libnlsym.c: original size 3346, current size' "$Wc_c"
  1084. fi
  1085. # ============= nlsym.c ==============
  1086. if test -f 'nlsym.c' -a X"$1" != X"-c"; then
  1087.     echo 'x - skipping nlsym.c (File already exists)'
  1088. else
  1089. echo 'x - extracting nlsym.c (Text)'
  1090. sed 's/^X//' << 'SHAR_EOF' > 'nlsym.c' &&
  1091. X/* CHK=0x8A22 */
  1092. X/*+-------------------------------------------------------------------------
  1093. X    nlsym.c -- utility nlist - fast access to kernel /dev/kmem offsets
  1094. X    ...!{gatech,emory}!n4hgf!wht
  1095. X
  1096. X  Defined functions:
  1097. X    main(argc,argv,envp)
  1098. X    nlsym_write_error(code)
  1099. X
  1100. X--------------------------------------------------------------------------*/
  1101. X/*+:EDITS:*/
  1102. X/*:07-15-1992-14:32-wht@n4hgf-2.60 release - u386mon+siotools merge */
  1103. X/*:08-20-1991-12:44-root@n4hgf-nba@sysware.dk S5R31 and config reorg */
  1104. X/*:08-01-1991-23:34-wht@n4hgf-release 2.40 source control point */
  1105. X/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
  1106. X/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
  1107. X/*:08-02-1990-15:36-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
  1108. X/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
  1109. X/*:06-27-1990-01:57-wht@n4hgf-1.10-incorporate suggestions from alpha testers */
  1110. X/*:06-27-1990-01:55-wht@n4hgf-use 64 bits of unique check */
  1111. X/*:06-25-1990-04:14-wht@n4hgf-1.02-better error handling */
  1112. X/*:06-24-1990-20:53-wht@n4hgf-v1.01-add ISC support thanks to peter@radig.de */
  1113. X/*:06-21-1990-14:26-r@n4hgf-version x0.12 seems bug free */
  1114. X/*:05-12-1989-18:27-wht-fix endless loop error on cannot nlist */
  1115. X/*:10-27-1988-10:58-wht-creation */
  1116. X
  1117. X#include "config.h"
  1118. X#include <stdio.h>
  1119. X#include <sys/types.h>
  1120. X#include <sys/stat.h>
  1121. X#include <fcntl.h>
  1122. X#include <nlist.h>
  1123. X#if defined(mips)
  1124. X#define n_sclass n_type
  1125. X#endif
  1126. X
  1127. X#define DEFINE_NLSYM
  1128. X#include "nlsym.h"
  1129. X
  1130. X/*+-------------------------------------------------------------------------
  1131. X    nlsym_write_error(code)
  1132. X--------------------------------------------------------------------------*/
  1133. Xvoid
  1134. Xnlsym_write_error(code)
  1135. Xint code;
  1136. X{
  1137. X    (void)fprintf(stderr,"code %d: ",code);
  1138. X    perror(UNIX_NLSYM);
  1139. X    exit(1);
  1140. X}    /* end of nlsym_write_error */
  1141. X
  1142. X/*+-------------------------------------------------------------------------
  1143. X    main(argc,argv,envp)
  1144. X--------------------------------------------------------------------------*/
  1145. X/*ARGSUSED*/
  1146. Xmain(argc,argv,envp)
  1147. Xint argc;
  1148. Xchar **argv;
  1149. Xchar **envp;
  1150. X{
  1151. Xregister int itmp;
  1152. Xregister struct nlist *nn;
  1153. Xstruct stat unixstat;        /* /unix status at nlsym run (void)time */
  1154. Xint fdnlsym;
  1155. Xint nlist_error = 0;
  1156. Xlong unique;
  1157. X
  1158. X    (void)nlist(UNIX_KERNEL,nlsym);
  1159. X
  1160. X    nn = nlsym;
  1161. X    while(nn->n_name)
  1162. X    {
  1163. X        if(!nn->n_sclass)
  1164. X        {
  1165. X            if (strcmp (nn->n_name, "dummy") != 0) {
  1166. X                (void)printf("%s: can't nlist\n", nn->n_name);
  1167. X                nlist_error = 1;
  1168. X            }
  1169. X        }
  1170. X        else
  1171. X            (void)printf("%-12.12s  storage class: %04x value: %08lx\n",
  1172. X                        nn->n_name, nn->n_sclass, nn->n_value);
  1173. X        nn++;
  1174. X    }
  1175. X
  1176. X#if 0
  1177. X    if(nlist_error > 0)
  1178. X    {
  1179. X        (void)fprintf(stderr,"%s NOT produced\n",UNIX_NLSYM);
  1180. X        exit(1);
  1181. X    }
  1182. X#endif
  1183. X
  1184. X    if((fdnlsym = open(UNIX_NLSYM,O_WRONLY|O_CREAT|O_TRUNC,0660)) < 0)
  1185. X        nlsym_write_error(fdnlsym);
  1186. X
  1187. X    if(stat(UNIX_KERNEL,&unixstat) < 0)
  1188. X    {
  1189. X        (void)fputs("cannot stat ",stderr);
  1190. X        perror(UNIX_KERNEL);
  1191. X        exit(1);
  1192. X    }
  1193. X
  1194. X    if((itmp = write(fdnlsym,&unixstat,sizeof(unixstat))) != sizeof(unixstat))
  1195. X        nlsym_write_error(itmp);
  1196. X
  1197. X    if((itmp = write(fdnlsym,nlsym,sizeof(nlsym))) != sizeof(nlsym))
  1198. X        nlsym_write_error(itmp);
  1199. X
  1200. X    unique = NLSYM_UNIQUE1;
  1201. X    if((itmp = write(fdnlsym,&unique,sizeof(unique))) != sizeof(unique))
  1202. X        nlsym_write_error(itmp);
  1203. X
  1204. X    unique = NLSYM_UNIQUE2;
  1205. X    if((itmp = write(fdnlsym,&unique,sizeof(unique))) != sizeof(unique))
  1206. X        nlsym_write_error(itmp);
  1207. X
  1208. X    (void)close(fdnlsym);
  1209. X    exit(0);
  1210. X    /*NOTREACHED*/
  1211. X}    /* end of main */
  1212. X
  1213. X/* vi: set tabstop=4 shiftwidth=4: */
  1214. SHAR_EOF
  1215. chmod 0644 nlsym.c ||
  1216. echo 'restore of nlsym.c failed'
  1217. Wc_c="`wc -c < 'nlsym.c'`"
  1218. test 3435 -eq "$Wc_c" ||
  1219.     echo 'nlsym.c: original size 3435, current size' "$Wc_c"
  1220. fi
  1221. # ============= proc.c ==============
  1222. if test -f 'proc.c' -a X"$1" != X"-c"; then
  1223.     echo 'x - skipping proc.c (File already exists)'
  1224. else
  1225. echo 'x - extracting proc.c (Text)'
  1226. sed 's/^X//' << 'SHAR_EOF' > 'proc.c' &&
  1227. X/* CHK=0xCC01 */
  1228. X/*+-------------------------------------------------------------------------
  1229. X    proc.c - u386mon proc table functions
  1230. X
  1231. X  Defined functions:
  1232. X    display_proc(win,y,x)
  1233. X    grok_proc()
  1234. X    pstat_text(pstat)
  1235. X
  1236. X--------------------------------------------------------------------------*/
  1237. X/*+:EDITS:*/
  1238. X/*:07-15-1992-14:32-wht@n4hgf-2.60 release - u386mon+siotools merge */
  1239. X/*:08-20-1991-12:44-root@n4hgf-nba@sysware.dk S5R31 and config reorg */
  1240. X/*:08-01-1991-23:35-wht@n4hgf-release 2.40 source control point */
  1241. X/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
  1242. X/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
  1243. X/*:08-02-1990-15:36-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
  1244. X/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
  1245. X/*:07-11-1990-03:45-root@n4hgf-faster proc table manipulation */
  1246. X/*:06-27-1990-01:57-wht@n4hgf-1.10-incorporate suggestions from alpha testers */
  1247. X/*:06-25-1990-04:14-wht@n4hgf-1.02-better error handling */
  1248. X/*:06-24-1990-20:53-wht@n4hgf-v1.01-add ISC support thanks to peter@radig.de */
  1249. X/*:06-21-1990-14:26-r@n4hgf-version x0.12 seems bug free */
  1250. X/*:06-17-1990-16:46-wht-creation */
  1251. X
  1252. X#include "config.h"
  1253. X
  1254. X#include <curses.h>
  1255. X#undef reg     /* per nba@sysware.dk */
  1256. X#include "libpanel.h"
  1257. X#include <sys/types.h>
  1258. X#undef NGROUPS_MAX
  1259. X#undef NULL
  1260. X#include <sys/param.h>
  1261. X#include <sys/immu.h>
  1262. X#include <sys/region.h>
  1263. X#if defined(mips)
  1264. X#include <sys/sbd.h>
  1265. X#endif
  1266. X#include <sys/proc.h>
  1267. X#include <sys/var.h>
  1268. X#include <nlist.h>
  1269. X#include "nlsym.h"
  1270. X#include "libkmem.h"
  1271. X#include "libnlsym.h"
  1272. X#include "u386mon.h"
  1273. X
  1274. Xextern struct var v;
  1275. X
  1276. Xstruct proc *procs = (struct proc *)0;
  1277. Xstruct proc *oldprocs = (struct proc *)0;
  1278. Xstruct proc **pprocs = (struct proc **)0;
  1279. Xstruct proc **poldprocs = (struct proc **)0;
  1280. X
  1281. Xint procs_per_pstat[SXBRK + 1];
  1282. Xint procs_in_core;
  1283. Xint procs_alive;
  1284. X
  1285. X/*+-------------------------------------------------------------------------
  1286. X    pstat_text(pstat)
  1287. X--------------------------------------------------------------------------*/
  1288. Xchar *
  1289. Xpstat_text(pstat)
  1290. Xchar pstat;
  1291. X{
  1292. Xstatic char errant[10];
  1293. X
  1294. X    switch(pstat)
  1295. X    {
  1296. X        case SSLEEP:   return("sleep ");
  1297. X        case SRUN:     return("run   ");
  1298. X        case SZOMB:    return("zombie");
  1299. X        case SSTOP:    return("stop  ");
  1300. X        case SIDL:     return("idle  ");
  1301. X        case SONPROC:  return("onproc");
  1302. X        case SXBRK:    return("xbrk  ");
  1303. X    }
  1304. X    (void)sprintf(errant,"%06u?",(unsigned char)pstat);
  1305. X    return(errant);
  1306. X
  1307. X}    /* end of pstat_text */
  1308. X
  1309. X/*+-------------------------------------------------------------------------
  1310. X    grok_proc() - read and examine kernel process table
  1311. X--------------------------------------------------------------------------*/
  1312. Xvoid
  1313. Xgrok_proc()
  1314. X{
  1315. Xregister iproc;
  1316. Xregister struct proc *tproc;
  1317. Xstatic char *memfail = "cannot alloc memory for proc table";
  1318. X
  1319. X    if(!procs)
  1320. X    {
  1321. X        if(!(procs = (struct proc *)malloc(sizeof(struct proc) * v.v_proc)))
  1322. X            leave_text(memfail,1);
  1323. X        if(!(oldprocs = (struct proc *)malloc(sizeof(struct proc) * v.v_proc)))
  1324. X            leave_text(memfail,1);
  1325. X        if(!(pprocs = (struct proc **)malloc(sizeof(struct proc *) * v.v_proc)))
  1326. X            leave_text(memfail,1);
  1327. X        if(!(poldprocs=(struct proc **)malloc(sizeof(struct proc *)*v.v_proc)))
  1328. X            leave_text(memfail,1);
  1329. X    }
  1330. X    kread((caddr_t)procs,procaddr,sizeof(struct proc) * v.v_proc);
  1331. X    for(iproc = 0; iproc < SXBRK + 1; iproc++)
  1332. X        procs_per_pstat[iproc] = 0;
  1333. X    procs_in_core = 0;
  1334. X    procs_alive = 0;
  1335. X
  1336. X    for(iproc = 0; iproc < v.v_proc; iproc++)
  1337. X    {
  1338. X        tproc = pprocs[iproc] = (procs + iproc);
  1339. X
  1340. X        if(tproc->p_stat)
  1341. X            procs_alive++;
  1342. X
  1343. X        procs_per_pstat[tproc->p_stat]++;    /* count # procs in each state */
  1344. X
  1345. X        if(tproc->p_flag & SLOAD)            /* count # procs in memory */
  1346. X            procs_in_core++;
  1347. X    }
  1348. X
  1349. X}    /* end of grok_proc */
  1350. X
  1351. X/*+-------------------------------------------------------------------------
  1352. X    display_proc(win,y,x)
  1353. X--------------------------------------------------------------------------*/
  1354. Xvoid
  1355. Xdisplay_proc(win,y,x)
  1356. XWINDOW *win;
  1357. Xint y;
  1358. Xint x;
  1359. X{
  1360. X    register char istat;
  1361. X
  1362. X    grok_proc();
  1363. X
  1364. X    use_cp(win,cpBANNER);
  1365. X    wmove(win,y++,x);
  1366. X    waddstr(win,"-- Proc ---");
  1367. X    for(istat = SSLEEP; istat <= SXBRK; istat++)
  1368. X    {
  1369. X        wmove(win,y++,x);
  1370. X        disp_info_int(win,pstat_text(istat),"  %3d",procs_per_pstat[istat]);
  1371. X    }
  1372. X    wmove(win,y++,x);
  1373. X    disp_info_int(win,"total ","  %3d",procs_alive);
  1374. X    wmove(win,y++,x);
  1375. X    disp_info_int(win,"in mem","  %3d",procs_in_core);
  1376. X}    /* end of display_proc */
  1377. X
  1378. X/* vi: set tabstop=4 shiftwidth=4: */
  1379. X/* end of proc.c */
  1380. SHAR_EOF
  1381. chmod 0644 proc.c ||
  1382. echo 'restore of proc.c failed'
  1383. Wc_c="`wc -c < 'proc.c'`"
  1384. test 4380 -eq "$Wc_c" ||
  1385.     echo 'proc.c: original size 4380, current size' "$Wc_c"
  1386. fi
  1387. # ============= tune.c ==============
  1388. if test -f 'tune.c' -a X"$1" != X"-c"; then
  1389.     echo 'x - skipping tune.c (File already exists)'
  1390. else
  1391. echo 'x - extracting tune.c (Text)'
  1392. sed 's/^X//' << 'SHAR_EOF' > 'tune.c' &&
  1393. X/* CHK=0x92D2 */
  1394. X/*+-------------------------------------------------------------------------
  1395. X    tune.c - u386mon tune struct display
  1396. X
  1397. X  Defined functions:
  1398. X    display_tune(win,y,x)
  1399. X
  1400. X--------------------------------------------------------------------------*/
  1401. X/*+:EDITS:*/
  1402. X/*:07-15-1992-14:33-wht@n4hgf-2.60 release - u386mon+siotools merge */
  1403. X/*:06-21-1992-00:34-root@n4hgf-needed extern for 3.2v4 */
  1404. X/*:08-20-1991-12:44-root@n4hgf-nba@sysware.dk S5R31 and config reorg */
  1405. X/*:08-01-1991-23:35-wht@n4hgf-release 2.40 source control point */
  1406. X/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
  1407. X/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
  1408. X/*:08-02-1990-15:36-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
  1409. X/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
  1410. X/*:06-27-1990-01:57-wht@n4hgf-1.10-incorporate suggestions from alpha testers */
  1411. X/*:06-25-1990-17:33-wht@n4hgf-alpha sort identifiers */
  1412. X/*:06-25-1990-04:14-wht@n4hgf-1.02-better error handling */
  1413. X/*:06-24-1990-20:53-wht@n4hgf-v1.01-add ISC support thanks to peter@radig.de */
  1414. X/*:06-21-1990-14:26-r@n4hgf-version x0.12 seems bug free */
  1415. X/*:06-17-1990-14:59-wht-creation */
  1416. X
  1417. X#include "config.h"
  1418. X
  1419. X#include <curses.h>
  1420. X#undef reg     /* per nba@sysware.dk */
  1421. X#include "libpanel.h"
  1422. X#include <sys/types.h>
  1423. X#include <sys/tuneable.h>
  1424. Xextern struct tune tune;
  1425. X#if defined(mips)
  1426. X#define t_gpgsmsk  t_gpgslmsk
  1427. X#endif
  1428. X#include "u386mon.h"
  1429. X
  1430. X/*+-------------------------------------------------------------------------
  1431. X    display_tune(win,y,x)
  1432. X--------------------------------------------------------------------------*/
  1433. Xvoid
  1434. Xdisplay_tune(win,y,x)
  1435. XWINDOW *win;
  1436. Xint y;
  1437. Xint x;
  1438. X{
  1439. X
  1440. X    use_cp(win,cpBANNER);
  1441. X    wmove(win,y++,x);
  1442. X    waddstr(win,"-- Tune ---------");
  1443. X#ifdef    SVR32
  1444. X    wmove(win,y++,x);
  1445. X    disp_static_int(win,"t_ageintvl  ","%5d",tune.t_ageinterval);
  1446. X#endif
  1447. X    wmove(win,y++,x);
  1448. X    disp_static_int(win,"t_bdflushr  ","%5d",tune.t_bdflushr);
  1449. X    wmove(win,y++,x);
  1450. X    disp_static_int(win,"t_gpgshi    ","%5d",tune.t_gpgshi);
  1451. X    wmove(win,y++,x);
  1452. X    disp_static_int(win,"t_gpgslo    ","%5d",tune.t_gpgslo);
  1453. X    wmove(win,y++,x);
  1454. X    disp_static_int(win,"t_gpgsmsk   ","0x%03lx",tune.t_gpgsmsk);
  1455. X    wmove(win,y++,x);
  1456. X    disp_static_int(win,"t_maxfc     ","%5d",tune.t_maxfc);
  1457. X    wmove(win,y++,x);
  1458. X    disp_static_int(win,"t_maxsc     ","%5d",tune.t_maxsc);
  1459. X    wmove(win,y++,x);
  1460. X    disp_static_int(win,"t_maxumem   ","%5d",tune.t_maxumem);
  1461. X    wmove(win,y++,x);
  1462. X    disp_static_int(win,"t_minarmem  ","%5d",tune.t_minarmem);
  1463. X    wmove(win,y++,x);
  1464. X    disp_static_int(win,"t_minasmem  ","%5d",tune.t_minasmem);
  1465. X
  1466. X}    /* end of display_tune */
  1467. X
  1468. X/* vi: set tabstop=4 shiftwidth=4: */
  1469. X/* end of tune.c */
  1470. SHAR_EOF
  1471. chmod 0644 tune.c ||
  1472. echo 'restore of tune.c failed'
  1473. Wc_c="`wc -c < 'tune.c'`"
  1474. test 2627 -eq "$Wc_c" ||
  1475.     echo 'tune.c: original size 2627, current size' "$Wc_c"
  1476. fi
  1477. # ============= var.c ==============
  1478. if test -f 'var.c' -a X"$1" != X"-c"; then
  1479.     echo 'x - skipping var.c (File already exists)'
  1480. else
  1481. echo 'x - extracting var.c (Text)'
  1482. sed 's/^X//' << 'SHAR_EOF' > 'var.c' &&
  1483. X/* CHK=0x3115 */
  1484. X/*+-------------------------------------------------------------------------
  1485. X    var.c - u386mon var struct display
  1486. X
  1487. X  Defined functions:
  1488. X    display_var(win,y,x)
  1489. X
  1490. X--------------------------------------------------------------------------*/
  1491. X/*+:EDITS:*/
  1492. X/*:07-15-1992-14:34-wht@n4hgf-2.60 release - u386mon+siotools merge */
  1493. X/*:06-21-1992-00:34-root@n4hgf-needed extern for 3.2v4 */
  1494. X/*:08-20-1991-12:44-root@n4hgf-nba@sysware.dk S5R31 and config reorg */
  1495. X/*:08-01-1991-23:35-wht@n4hgf-release 2.40 source control point */
  1496. X/*:08-10-1990-14:13-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
  1497. X/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
  1498. X/*:08-02-1990-15:36-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
  1499. X/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
  1500. X/*:06-27-1990-01:57-wht@n4hgf-1.10-incorporate suggestions from alpha testers */
  1501. X/*:06-25-1990-17:33-wht@n4hgf-alpha sort identifiers */
  1502. X/*:06-25-1990-04:14-wht@n4hgf-1.02-better error handling */
  1503. X/*:06-24-1990-20:53-wht@n4hgf-v1.01-add ISC support thanks to peter@radig.de */
  1504. X/*:06-21-1990-14:27-r@n4hgf-version x0.12 seems bug free */
  1505. X/*:06-17-1990-14:59-wht-creation */
  1506. X
  1507. X#include "config.h"
  1508. X
  1509. X#include <curses.h>
  1510. X#undef reg     /* per nba@sysware.dk */
  1511. X#include "libpanel.h"
  1512. X#include <sys/types.h>
  1513. X#include <sys/var.h>
  1514. X#include "u386mon.h"
  1515. X
  1516. Xextern struct var v;
  1517. X
  1518. X/*+-------------------------------------------------------------------------
  1519. X    display_var(win,y,x)
  1520. X--------------------------------------------------------------------------*/
  1521. Xvoid
  1522. Xdisplay_var(win,y,x)
  1523. XWINDOW *win;
  1524. Xint y;
  1525. Xint x;
  1526. X{
  1527. X    use_cp(win,cpBANNER);
  1528. X    wmove(win,y++,x);
  1529. X    waddstr(win,"-- Var ---------");
  1530. X    wmove(win,y++,x);
  1531. X    disp_static_int(win,"v_autoup   ","%5d",v.v_autoup);
  1532. X    wmove(win,y++,x);
  1533. X    disp_static_int(win,"v_buf      ","%5d",v.v_buf);
  1534. X    wmove(win,y++,x);
  1535. X    disp_static_int(win,"v_clist    ","%5d",v.v_clist);
  1536. X    wmove(win,y++,x);
  1537. X    disp_static_int(win,"v_file     ","%5d",v.v_file);
  1538. X    wmove(win,y++,x);
  1539. X    disp_static_int(win,"v_hbuf     ","%5d",v.v_hbuf);
  1540. X    wmove(win,y++,x);
  1541. X    disp_static_int(win,"v_inode    ","%5d",v.v_inode);
  1542. X    wmove(win,y++,x);
  1543. X    disp_static_int(win,"v_maxpmem  ","%5d",v.v_maxpmem);
  1544. X    wmove(win,y++,x);
  1545. X    disp_static_int(win,"v_maxup    ","%5d",v.v_maxup);
  1546. X    wmove(win,y++,x);
  1547. X    disp_static_int(win,"v_mount    ","%5d",v.v_mount);
  1548. X    wmove(win,y++,x);
  1549. X    disp_static_int(win,"v_pbuf     ","%5d",v.v_pbuf);
  1550. X    wmove(win,y++,x);
  1551. X    disp_static_int(win,"v_proc     ","%5d",v.v_proc);
  1552. X    wmove(win,y++,x);
  1553. X    disp_static_int(win,"v_region   ","%5d",v.v_region);
  1554. X    wmove(win,y++,x);
  1555. X    disp_static_int(win,"v_vhndfrac ","%5d",v.v_vhndfrac);
  1556. X
  1557. X}    /* end of display_var */
  1558. X
  1559. X/* vi: set tabstop=4 shiftwidth=4: */
  1560. X/* end of var.c */
  1561. SHAR_EOF
  1562. chmod 0644 var.c ||
  1563. echo 'restore of var.c failed'
  1564. Wc_c="`wc -c < 'var.c'`"
  1565. test 2687 -eq "$Wc_c" ||
  1566.     echo 'var.c: original size 2687, current size' "$Wc_c"
  1567. fi
  1568. # ============= config.h ==============
  1569. if test -f 'config.h' -a X"$1" != X"-c"; then
  1570.     echo 'x - skipping config.h (File already exists)'
  1571. else
  1572. echo 'x - extracting config.h (Text)'
  1573. sed 's/^X//' << 'SHAR_EOF' > 'config.h' &&
  1574. X/* CHK=0xEF8D */
  1575. X/*+-------------------------------------------------------------------------
  1576. X    config.h - u386mon system monitor configuration
  1577. X
  1578. XHopefully, we will hide most of the Machiavellian version-hackery
  1579. X--------------------------------------------------------------------------*/
  1580. X/*+:EDITS:*/
  1581. X/*:07-15-1992-14:31-wht@n4hgf-2.60 release - u386mon+siotools merge */
  1582. X/*:03-09-1992-11:54-wht@n4hgf-p_sid addition per rw@namu01.gwdg.de */
  1583. X/*:08-20-1991-14:00-root@n4hgf-add ESIX per info from jdm1@esd1.esd.com */
  1584. X/*:08-20-1991-12:44-root@n4hgf-nba@sysware.dk S5R31 and config reorg */
  1585. X/*:08-01-1991-23:34-wht@n4hgf-release 2.40 source control point */
  1586. X/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
  1587. X/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
  1588. X/*:08-02-1990-15:35-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
  1589. X/*:08-01-1990-19:24-jdc@dell.com-add DELL config */
  1590. X/*:08-01-1990-12:24-wht@n4hgf-2.11-try to support ISC 1.x.x */
  1591. X/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
  1592. X/*:07-26-1990-17:51-wht-creation */
  1593. X
  1594. X#ifndef _config_h
  1595. X#define _config_h
  1596. X
  1597. X#define U386MON
  1598. X
  1599. X#if defined(M_UNIX)
  1600. X#define HAS_RDCHK
  1601. X#define HAS_P_SID        /* has proc->p_sid (job control) */
  1602. X#define HAS_NAP
  1603. X#define M_TERMINFO
  1604. X#if !defined(SVR32)
  1605. X#define SVR32
  1606. X#endif
  1607. X#if !defined(SCO320) && !defined(USIZE_FIXED)    /* you want USIZE_FIXED */
  1608. X#define USIZE_FIXED                    /* unless you are using SCO 3.2.0 */
  1609. X#endif
  1610. X/* The next two lines may speed up other True S5R3 versions, but I can't say */
  1611. X#define PERFORMANCE /* see u386mon.c, kludge.c, /usr/include/tinfo.h */
  1612. X#define CURSES_MACROS
  1613. X#endif
  1614. X
  1615. X#if defined(DELL)
  1616. X#define ISC
  1617. X#if !defined(SVR32)
  1618. X#define SVR32
  1619. X#endif
  1620. X#endif
  1621. X
  1622. X/*
  1623. X * no offense to ESIX or ISC, but this is what works
  1624. X * see undef of NATIVE_PANELS below
  1625. X */
  1626. X#if defined(ESIX532)
  1627. X#define ISC
  1628. X#define ISC22
  1629. X#endif
  1630. X
  1631. X#ifdef ISC_1
  1632. X#define ISC
  1633. X#if !defined(SVR31)
  1634. X#define SVR31
  1635. X#endif
  1636. X#ifndef NO_ISTOUCH
  1637. X#define NO_ISTOUCH
  1638. X#endif
  1639. X#else /* !ISC 1.x.x */
  1640. X#if defined(ISC)
  1641. X#define HAS_RDCHK
  1642. X#define HAS_NAP
  1643. X#if !defined(SVR32)
  1644. X#define SVR32
  1645. X#endif
  1646. X#endif
  1647. X#endif
  1648. X
  1649. X#if defined(SVR32)
  1650. X#define NATIVE_PANELS
  1651. X#define HAS_BOOTINFO
  1652. X#define HAS_TIMEB
  1653. X#endif
  1654. X
  1655. X/*
  1656. X * ESIX panels not existent or don't work (unclear, but this works)
  1657. X */
  1658. X#if defined(ESIX532)
  1659. X#undef NATIVE_PANELS
  1660. X#endif
  1661. X
  1662. X/*
  1663. X * some old curses do not have is_wintouched() or is_linetouched()
  1664. X * ... sigh ... This makes our homebrew panel object severely
  1665. X * disappointed, maybe useless ... but define NO_ISTOUCH to try
  1666. X * it if you get undefined externs for these two work saver functions.
  1667. X */
  1668. X#ifdef SVR31
  1669. X#ifndef NO_ISTOUCH
  1670. X/* #define NO_ISTOUCH */
  1671. X#endif
  1672. X#endif
  1673. X
  1674. X#if defined(mips)
  1675. X#if !defined(SVR31)
  1676. X#define SVR31
  1677. X#endif
  1678. X#if !defined(NO_ISTOUCH)
  1679. X#define NO_ISTOUCH
  1680. X#endif
  1681. X#endif
  1682. X
  1683. X#define DPT_NONE    0
  1684. X#define DPT_PS        1
  1685. X#define DPT_PS_LONG    2
  1686. X#define DPT_EXTRA    3
  1687. X#ifdef M_UNIX
  1688. X#define DPT_SIO        4
  1689. X#endif
  1690. X#if defined(M_UNIX) || defined(SVR31) || defined(ISC22)
  1691. X#define DPT_STREAMS    5
  1692. X#define DPT_TABLE    6
  1693. X#endif
  1694. X#ifdef SCO322
  1695. X#define DPT_WD        7
  1696. X#endif
  1697. X
  1698. X#endif /* _config_h */
  1699. X
  1700. X/* vi: set tabstop=4 shiftwidth=4: */
  1701. X/* end of config.h */
  1702. SHAR_EOF
  1703. chmod 0644 config.h ||
  1704. echo 'restore of config.h failed'
  1705. Wc_c="`wc -c < 'config.h'`"
  1706. test 3105 -eq "$Wc_c" ||
  1707.     echo 'config.h: original size 3105, current size' "$Wc_c"
  1708. fi
  1709. # ============= libkmem.h ==============
  1710. if test -f 'libkmem.h' -a X"$1" != X"-c"; then
  1711.     echo 'x - skipping libkmem.h (File already exists)'
  1712. else
  1713. echo 'x - extracting libkmem.h (Text)'
  1714. sed 's/^X//' << 'SHAR_EOF' > 'libkmem.h' &&
  1715. X/* CHK=0x7E11 */
  1716. X/*+-----------------------------------------------------------------------
  1717. X    libkmem.h
  1718. X    ...!{gatech,emory}!n4hgf!wht
  1719. X------------------------------------------------------------------------*/
  1720. X/*+:EDITS:*/
  1721. X/*:07-15-1992-14:31-wht@n4hgf-2.60 release - u386mon+siotools merge */
  1722. X/*:08-01-1991-23:34-wht@n4hgf-release 2.40 source control point */
  1723. X/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
  1724. X/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
  1725. X/*:08-02-1990-15:36-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
  1726. X/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
  1727. X/*:06-27-1990-01:57-wht@n4hgf-1.10-incorporate suggestions from alpha testers */
  1728. X/*:06-25-1990-04:14-wht@n4hgf-1.02-better error handling */
  1729. X/*:06-24-1990-20:53-wht@n4hgf-v1.01-add ISC support thanks to peter@radig.de */
  1730. X/*:06-21-1990-14:26-r@n4hgf-version x0.12 seems bug free */
  1731. X/*:10-28-1988-14:46-afterlint-creation */
  1732. X
  1733. X#ifndef _libkmem_h
  1734. X#define _libkmem_h
  1735. X
  1736. X#ifndef BUILDING_LINT_ARGS
  1737. X#ifdef LINT_ARGS
  1738. X
  1739. X/* libkmem.c */
  1740. Xvoid kinit(int );
  1741. Xvoid kread(char  *,long ,int );
  1742. Xvoid kwrite(long ,char  *,int );
  1743. X
  1744. X#else        /* compiler doesn't know about prototyping */
  1745. X
  1746. X/* libkmem.c */
  1747. Xvoid kinit();
  1748. Xvoid kread();
  1749. Xvoid kwrite();
  1750. X
  1751. X#endif /* LINT_ARGS */
  1752. X#endif /* BUILDING_LINT_ARGS */
  1753. X#endif /* _libkmem_h */
  1754. X
  1755. X/* vi: set tabstop=4 shiftwidth=4: */
  1756. X/* end of libkmem.h */
  1757. SHAR_EOF
  1758. chmod 0644 libkmem.h ||
  1759. echo 'restore of libkmem.h failed'
  1760. Wc_c="`wc -c < 'libkmem.h'`"
  1761. test 1381 -eq "$Wc_c" ||
  1762.     echo 'libkmem.h: original size 1381, current size' "$Wc_c"
  1763. fi
  1764. # ============= libmem.h ==============
  1765. if test -f 'libmem.h' -a X"$1" != X"-c"; then
  1766.     echo 'x - skipping libmem.h (File already exists)'
  1767. else
  1768. echo 'x - extracting libmem.h (Text)'
  1769. sed 's/^X//' << 'SHAR_EOF' > 'libmem.h' &&
  1770. X/* CHK=0x2D54 */
  1771. X/*+-----------------------------------------------------------------------
  1772. X    libmem.h
  1773. X    ...!{gatech,emory}!n4hgf!wht
  1774. X------------------------------------------------------------------------*/
  1775. X/*+:EDITS:*/
  1776. X/*:07-15-1992-14:31-wht@n4hgf-2.60 release - u386mon+siotools merge */
  1777. X/*:08-01-1991-23:34-wht@n4hgf-release 2.40 source control point */
  1778. X/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
  1779. X/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
  1780. X/*:08-02-1990-15:36-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
  1781. X/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
  1782. X/*:06-27-1990-01:57-wht@n4hgf-1.10-incorporate suggestions from alpha testers */
  1783. X/*:06-25-1990-04:14-wht@n4hgf-1.02-better error handling */
  1784. X/*:06-24-1990-20:53-wht@n4hgf-v1.01-add ISC support thanks to peter@radig.de */
  1785. X/*:06-21-1990-14:26-r@n4hgf-version x0.12 seems bug free */
  1786. X/*:10-28-1988-14:46-afterlint-creation */
  1787. X
  1788. X#ifndef _libmem_h
  1789. X#define _libmem_h
  1790. X
  1791. X#ifndef BUILDING_LINT_ARGS
  1792. X#ifdef LINT_ARGS
  1793. X
  1794. X/* libmem.c */
  1795. Xvoid minit(int );
  1796. Xvoid mread(char  *,long ,int );
  1797. Xvoid mwrite(long ,char  *,int );
  1798. X
  1799. X#else        /* compiler doesn't mnow about prototyping */
  1800. X
  1801. X/* libmem.c */
  1802. Xvoid minit();
  1803. Xvoid mread();
  1804. Xvoid mwrite();
  1805. X
  1806. X#endif /* LINT_ARGS */
  1807. X#endif /* BUILDING_LINT_ARGS */
  1808. X#endif /* _libmem_h */
  1809. X
  1810. X/* vi: set tabstop=4 shiftwidth=4: */
  1811. X/* end of libmem.h */
  1812. SHAR_EOF
  1813. chmod 0644 libmem.h ||
  1814. echo 'restore of libmem.h failed'
  1815. Wc_c="`wc -c < 'libmem.h'`"
  1816. test 1374 -eq "$Wc_c" ||
  1817.     echo 'libmem.h: original size 1374, current size' "$Wc_c"
  1818. fi
  1819. # ============= libpanel.h ==============
  1820. if test -f 'libpanel.h' -a X"$1" != X"-c"; then
  1821.     echo 'x - skipping libpanel.h (File already exists)'
  1822. else
  1823. echo 'x - extracting libpanel.h (Text)'
  1824. sed 's/^X//' << 'SHAR_EOF' > 'libpanel.h' &&
  1825. X/* CHK=0xDDDE */
  1826. X/*+-------------------------------------------------------------------------
  1827. X    libpanel.h - libpanel.c <panel.h> surrogate
  1828. X    wht@n4hgf.Mt-Park.GA.US
  1829. X--------------------------------------------------------------------------*/
  1830. X/*+:EDITS:*/
  1831. X/*:07-15-1992-14:31-wht@n4hgf-2.60 release - u386mon+siotools merge */
  1832. X/*:08-01-1991-23:34-wht@n4hgf-release 2.40 source control point */
  1833. X/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
  1834. X/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
  1835. X/*:08-02-1990-15:36-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
  1836. X/*:07-31-1990-08:18-wht@n4hgf-some cpps wont take #error even in untrue ifdef */
  1837. X/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
  1838. X/*:07-23-1990-00:56-wht@n4hgf-full library working */
  1839. X/*:07-21-1990-15:42-wht-creation */
  1840. X
  1841. X
  1842. X#ifndef _libpanel_h
  1843. X#define _libpanel_h
  1844. X
  1845. X#ifdef NATIVE_PANELS
  1846. X# include <panel.h>
  1847. X#else
  1848. X
  1849. Xtypedef struct panelobs
  1850. X{
  1851. X    struct panelobs *above;
  1852. X    struct panel *pan;
  1853. X} PANELOBS;
  1854. X
  1855. Xtypedef struct panel
  1856. X{
  1857. X    WINDOW *win;
  1858. X    int wstarty;
  1859. X    int wendy;
  1860. X    int wstartx;
  1861. X    int wendx;
  1862. X    struct panel *below;
  1863. X    struct panel *above;
  1864. X    char *user;
  1865. X    struct panelobs *obscure;
  1866. X} PANEL;
  1867. X
  1868. X#ifndef BUILDING_LINT_ARGS
  1869. X#ifdef LINT_ARGS
  1870. X
  1871. Xextern  WINDOW *panel_window(PANEL *pan);
  1872. Xextern  void update_panels(void );
  1873. Xextern  int hide_panel(PANEL *pan);
  1874. Xextern  int show_panel(PANEL *pan);
  1875. Xextern  int del_panel(PANEL *pan);
  1876. Xextern  int top_panel(PANEL *pan);
  1877. Xextern  int bottom_panel(PANEL *pan);
  1878. Xextern  PANEL *new_panel(WINDOW *win);
  1879. Xextern  PANEL *panel_above(PANEL *pan);
  1880. Xextern  PANEL *panel_below(PANEL *pan);
  1881. Xextern  int set_panel_userptr(PANEL *pan,char *uptr);
  1882. Xextern  char *panel_userptr(PANEL *pan);
  1883. Xextern  int move_panel(PANEL *pan,int starty,int startx);
  1884. Xextern  int replace_panel(PANEL *pan,WINDOW *win);
  1885. X
  1886. X#else        /* compiler doesn't know about prototyping */
  1887. X
  1888. Xextern  WINDOW *panel_window();
  1889. Xextern  void update_panels();
  1890. Xextern  int hide_panel();
  1891. Xextern  int show_panel();
  1892. Xextern  int del_panel();
  1893. Xextern  int top_panel();
  1894. Xextern  int bottom_panel();
  1895. Xextern  PANEL *new_panel();
  1896. Xextern  PANEL *panel_above();
  1897. Xextern  PANEL *panel_below();
  1898. Xextern  int set_panel_userptr();
  1899. Xextern  char *panel_userptr();
  1900. Xextern  int move_panel();
  1901. Xextern  int replace_panel();
  1902. X
  1903. X#endif /* LINT_ARGS */
  1904. X#endif /* BUILDING_LINT_ARGS */
  1905. X
  1906. X#endif    /* NATIVE_PANELS */
  1907. X
  1908. X#endif /* _libpanel_h */
  1909. X
  1910. X/* vi: set tabstop=4 shiftwidth=4: */
  1911. X/* end of libpanel.h */
  1912. SHAR_EOF
  1913. chmod 0644 libpanel.h ||
  1914. echo 'restore of libpanel.h failed'
  1915. Wc_c="`wc -c < 'libpanel.h'`"
  1916. test 2432 -eq "$Wc_c" ||
  1917.     echo 'libpanel.h: original size 2432, current size' "$Wc_c"
  1918. fi
  1919. # ============= libswap.h ==============
  1920. if test -f 'libswap.h' -a X"$1" != X"-c"; then
  1921.     echo 'x - skipping libswap.h (File already exists)'
  1922. else
  1923. echo 'x - extracting libswap.h (Text)'
  1924. sed 's/^X//' << 'SHAR_EOF' > 'libswap.h' &&
  1925. X/* CHK=0x1230 */
  1926. X/*+-----------------------------------------------------------------------
  1927. X    libswap.h
  1928. X    ...!{gatech,emory}!n4hgf!wht
  1929. X------------------------------------------------------------------------*/
  1930. X/*+:EDITS:*/
  1931. X/*:07-15-1992-14:31-wht@n4hgf-2.60 release - u386mon+siotools merge */
  1932. X/*:08-01-1991-23:34-wht@n4hgf-release 2.40 source control point */
  1933. X/*:08-10-1990-14:12-jmd@p1so/wht@n4hgf-2.20-add Tandem Integrity S2 */
  1934. X/*:08-07-1990-14:24-wht@n4hgf-nba@sysware.dk SVR31 updates */
  1935. X/*:08-02-1990-15:36-wht@n4hgf-2.12-old curses hacks+minor 3.2 formalizations */
  1936. X/*:07-28-1990-18:06-wht@n4hgf-2.10 release */
  1937. X/*:06-27-1990-01:57-wht@n4hgf-1.10-incorporate suggestions from alpha testers */
  1938. X/*:06-25-1990-04:14-wht@n4hgf-1.02-better error handling */
  1939. X/*:06-24-1990-20:53-wht@n4hgf-v1.01-add ISC support thanks to peter@radig.de */
  1940. X/*:06-22-1990-02:03-root@n4hgf-creation from libmem */
  1941. X
  1942. X#ifndef _libswap_h
  1943. X#define _libswap_h
  1944. X
  1945. X#ifndef BUILDING_LINT_ARGS
  1946. X#ifdef LINT_ARGS
  1947. X
  1948. X/* libswap.c */
  1949. Xvoid sinit(void );
  1950. Xvoid sread(char  *,long ,int );
  1951. X
  1952. X#else        /* compiler doesn't mnow about prototyping */
  1953. X
  1954. X/* libswap.c */
  1955. Xvoid sinit();
  1956. Xvoid sread();
  1957. Xvoid swrite();
  1958. X
  1959. X#endif /* LINT_ARGS */
  1960. X#endif /* BUILDING_LINT_ARGS */
  1961. X#endif /* _libswap_h */
  1962. X
  1963. X/* vi: set tabstop=4 shiftwidth=4: */
  1964. X/* end of libswap.h */
  1965. SHAR_EOF
  1966. chmod 0644 libswap.h ||
  1967. echo 'restore of libswap.h failed'
  1968. Wc_c="`wc -c < 'libswap.h'`"
  1969. test 1302 -eq "$Wc_c" ||
  1970.     echo 'libswap.h: original size 1302, current size' "$Wc_c"
  1971. fi
  1972. true || echo 'restore of libnlsym.h failed'
  1973. echo End of part 6, continue with part 7
  1974. exit 0
  1975.  
  1976. exit 0 # Just in case...
  1977.