home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d157 / 60or80.lha / 60or80 / cli_60or80.c < prev    next >
C/C++ Source or Header  |  1988-10-02  |  2KB  |  77 lines

  1. echo ;  /*  Hmmm
  2. lc -cwusf -v -sc=__MERGED -y cli_60or80.c
  3. blink cli_60or80.o LIB lib:amiga.lib DEFINE _stdout=_echo SD SC ND VERBOSE
  4. quit
  5. */
  6.  
  7. /*   cli_60or80.c                                                     */
  8. /*   by Mark E. Schretlen    87-09-26   modified 87-12-15             */
  9.  
  10. /*   type "execute cli_60or80.c" to compile & link with Lattice 4.0   */
  11.  
  12. #include <exec/types.h>
  13. #include <intuition/intuition.h>
  14. #include <intuition/intuitionbase.h>
  15. #include "proto/intuition.h"
  16. #include "exec/execbase.h"
  17. #include "proto/exec.h"
  18. #include "proto/dos.h"
  19.  
  20. #define INTUITION_REV 0L
  21. #pragma libcall IntuitionBase GetPrefs 84 802
  22. #pragma libcall IntuitionBase SetPrefs 144 10803
  23. #pragma syscall CloseLibrary 19e 901
  24. #pragma syscall OpenLibrary 228 902
  25.  
  26. int   printf(char *,);
  27.  
  28. struct ExecBase *SysBase = 0;
  29. struct IntuitionBase *IntuitionBase = 0;
  30. struct Preferences Buffer;
  31. struct Window *w;
  32. struct DosLibrary  *DOSBase;
  33. struct List *lh = NULL;
  34. struct Node *ln, *FindName();
  35.  
  36. char NewSIZE = TOPAZ_EIGHTY;
  37.  
  38. void cli6080()
  39. {
  40.    struct Preferences *PrefBuffer;
  41.  
  42.    if ( !(DOSBase = (struct DosLibrary *)OpenLibrary("dos.library",0)))  return;
  43.  
  44.    echo = (int)Output();
  45.  
  46.    PrefBuffer = &Buffer;
  47.    SysBase = (struct ExecBase *)OpenLibrary("exec.library", 0);
  48.  
  49.    lh = &(SysBase->PortList);
  50.    ln = FindName(lh,"Workbench");
  51.    IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library", INTUITION_REV);
  52.    if( (ln == 0) || (IntuitionBase == NULL)  ||  ((w = IntuitionBase->ActiveWindow) == NULL) )
  53.       {
  54.       printf (" Where's Workbench ? \n");
  55.       CloseLibrary((struct Library *)IntuitionBase); /* modify to a closeAllLibs() routine  */
  56.       CloseLibrary((struct Library *)SysBase);
  57.       CloseLibrary((struct Library *)DosBase);
  58.       return;
  59.       }
  60.  
  61.    Forbid ();
  62.    GetPrefs(PrefBuffer, (long) sizeof(struct Preferences));
  63.  
  64.    if( NewSIZE == PrefBuffer->FontHeight ) NewSIZE = TOPAZ_SIXTY;
  65.    else NewSIZE = TOPAZ_EIGHTY;
  66.  
  67.    PrefBuffer->FontHeight = NewSIZE;
  68.    SetPrefs(PrefBuffer, (long) sizeof(struct Preferences), TRUE);
  69.    w->WScreen->FirstWindow->NextWindow->Title = "60or80 by Mark Schretlen ";
  70.    Permit ();
  71.  
  72.    printf (" 60or80 by Mark Schretlen ---- distribute freely \n");
  73.    CloseLibrary((struct Library *)IntuitionBase);
  74.    CloseLibrary((struct Library *)SysBase);
  75.    CloseLibrary((struct Library *)DosBase);
  76. }
  77.