home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume22 / u386mon / part06 < prev    next >
Text File  |  1991-08-13  |  55KB  |  1,946 lines

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