home *** CD-ROM | disk | FTP | other *** search
/ Super Net 1 / SUPERNET_1.iso / PC / OTROS / MSDOS / WATTCP / DELFT / SAGE.TAR / sage / scheme / schhdr.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-04-26  |  4.4 KB  |  172 lines

  1. /**********************************************************************
  2. ** MODULE INFORMATION*
  3. **********************
  4. **     FILE     NAME:       SCHHDR.C
  5. **     SYSTEM   NAME:       SCHEME
  6. **     ORIGINAL AUTHOR(S):  TOOHLP.EXE
  7. **     VERSION  NUMBER:     1.0
  8. **     CREATION DATE:       89/12/07
  9. **                                    
  10. ** DESCRIPTION: Generated by TOOHLP. Contains functions to print (help)
  11. **              messages.
  12. ***********************************************************************
  13. ** CHANGES INFORMATION **
  14. *************************
  15. ** REVISION:    $Revision$
  16. ** CHANGER:     $Author$
  17. ** WORKFILE:    $Workfile$
  18. ** LOGFILE:     $Logfile$
  19. ** LOGINFO:     $Log$
  20. **********************************************************************/
  21. #ifdef OS2
  22. #define INCL_VIO
  23. #include <os2.h>
  24. #endif
  25. #include "schinc.h"
  26.  
  27. /*****************************************************************
  28. ** NAME:        info
  29. ** SYNOPSIS:    void info()
  30. ** DESCRIPTION: This function prints some informative text.
  31. **              Generated by TOOHELP. (c) Kayser Systems 1990.
  32. ** RETURNS:     void
  33. *****************************************************************/
  34. void PASCAL info __((void)); /* prototype */
  35.  
  36. static char *address[]= {
  37.     "Ir. Alfred Kayser",
  38.     "Delft University of Technology",
  39.     "Faculty of Electrical Engineering",
  40.     "Laboratory of Computer Architecture",
  41.     "and Digital Technique",
  42.     "DELFT The Netherlands" } ;
  43.  
  44. #define MAXX 35
  45. #define MAXY 6
  46.  
  47. #ifdef OS2
  48. static char kop[] = SYSTEM" "VERSION" for "SYSTEEM;
  49. #define KOPSIZE sizeof(kop)
  50. #define KOPSET  ((viomi.col-KOPSIZE-4)/2)
  51. #define OFFSET  ((viomi.col-MAXX-4)/2)
  52. #define PUTROW(k,l,m,r,c,w) VioWrtNChar(k,1,r,c,0); \
  53.                             VioWrtNChar(l,w+2,r,c+1,0); \
  54.                             VioWrtNChar(m,1,r,c+w+3,0);
  55.  
  56. void PASCAL info()
  57. {
  58.     static BYTE abCell[2];        /* character/attribute pair */
  59.     static VIOMODEINFO viomi;
  60.     int i,w;
  61.  
  62.     viomi.cb=sizeof(viomi);
  63.     VioGetMode(&viomi,0);
  64.  
  65.     abCell[0]=' ';       
  66.     abCell[1]=15;      
  67.     VioWrtNCell(abCell, viomi.row*viomi.col, 0, 0, 0);                
  68.     abCell[1]=12;
  69.  
  70.     PUTROW("┌","─","╖", 9,OFFSET,MAXX);
  71.     PUTROW("┌","─","╖", 8,KOPSET,KOPSIZE);
  72.     PUTROW("┤"," ","╟", 9,KOPSET,KOPSIZE);
  73.     PUTROW("╘","═","╝",10,KOPSET,KOPSIZE);
  74.     VioWrtCharStrAtt(kop,KOPSIZE,9,KOPSET+2,&abCell[1],0);
  75.     for (i=0;i<MAXY+1;i++)
  76.     {
  77.         VioWrtNChar("│",1,10+i,OFFSET,0);
  78.         VioWrtNChar("║",1,10+i,OFFSET+MAXX+3,0);
  79.     }
  80.     for (i=0;i<MAXY;i++)
  81.     {
  82.         w=strlen(address[i]);
  83.         VioWrtCharStr(address[i],w,11+i,(80-w)/2,0);
  84.     }
  85.     PUTROW("╘","═","╝",11+MAXY,OFFSET,MAXX);
  86.     VioSetCurPos(23,0,0);
  87. }
  88. #endif
  89.  
  90. #ifdef UNIX
  91. void PASCAL info()
  92. {
  93.     int i,len;
  94.     char buf[80];
  95.  
  96.     sprintf(buf,"%s %s for %s",SYSTEM,VERSION,SYSTEEM);
  97.     len=strlen(buf)+6;
  98.     if (MAXX>len) len=MAXX;
  99.     printf("\n\t\t+");
  100.     for (i=len;i>2;i--) putchar('-');
  101.     printf("+\n\t\t%*s\n\t\t+",(len+strlen(buf))/2,buf);
  102.     for (i=len;i>2;i--) putchar('-');
  103.     printf("+\n\n");
  104.     for (i=0;i<MAXY;i++)
  105.         printf("\t\t%*s\n",(len+strlen(address[i]))/2,address[i]);
  106.     puts("\n\n");
  107. }
  108. #endif
  109.  
  110. #ifdef MSDOS
  111. #ifdef GRAPHICS
  112. #include <graph.h>
  113.  
  114. static struct videoconfig vc;
  115. static struct _fontinfo fi;
  116.  
  117. void PASCAL center(int n,char *s);
  118. short PASCAL findfont(char *env,char *name);
  119.  
  120. void PASCAL center(n,s)
  121. int n;
  122. char *s;
  123. {
  124.     _moveto((vc.numxpixels - _getgtextextent(s)) / 2,
  125.             (vc.numypixels/2 + (n * fi.pixheight)*12/10));
  126.     _outgtext(s);
  127. }
  128.  
  129. void PASCAL info()
  130. {
  131.     short i;
  132.     char buf[80];
  133.     time_t end;
  134.  
  135.     sprintf(buf,"%s %s for %s",SYSTEM,VERSION,SYSTEEM);
  136.     if ( (_registerfonts("TMSRB.FON")>0)
  137.       && (_setvideomode(_MAXRESMODE)!=0)
  138.       && (_setfont("t'tms rmn'h30w18bpr")>=0)
  139.       && (_getfontinfo(&fi)>=0))
  140.     {
  141.         _getvideoconfig(&vc);
  142.         _setcolor(12);
  143.         center(-4,buf);
  144.         _setcolor(15);
  145.         for (i=0;i<MAXY;i++)
  146.             center(i-2,address[i]);
  147.         end=clock()+CLOCKS_PER_SEC*2;           /* Wait two seconds */
  148.         while ((clock()<end) && (!kbhit()));
  149.         _unregisterfonts();
  150.         _setvideomode( _DEFAULTMODE );
  151.     }
  152.     else
  153.     {
  154.         puts(buf);
  155.         for (i=0;i<MAXY;i++)
  156.             puts(address[i]);
  157.     }
  158. }
  159. #else
  160. void PASCAL info()
  161. {
  162.     printf("%s %s for %s\n\n",SYSTEM,VERSION,SYSTEEM);
  163.     puts(address[0]);
  164.     puts(address[1]);
  165.     puts(address[2]);
  166.     puts(address[3]);
  167.     puts(address[4]);
  168.     puts(address[5]);
  169. }
  170. #endif
  171. #endif
  172.