home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume33 / u386mon / part06 < prev    next >
Encoding:
Text File  |  1992-11-20  |  54.6 KB  |  1,971 lines

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