home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 344b.lha / plplot_v2.6 / Amiga / plprefs.c < prev    next >
C/C++ Source or Header  |  1990-01-27  |  1KB  |  49 lines

  1. #include "plplot.h"
  2. #include "plamiga.h"
  3. #include <stdio.h>
  4.  
  5. struct PLPrefs PLCurPrefs;
  6.  
  7. static struct PLPrefs PLDefPrefs = {
  8.    PLCUST | PLBUFF,
  9.    PLLACE | PLHIRES,
  10.    20, 20,
  11.    300, 200,
  12.    0, 0,       /* Let ScreenChange set width and height for custom screen */
  13.    0, 0,
  14.    2,
  15.    0xCCC, 0x000, 0x00D, 0x080, 0xF00, 0xEE0, 0xE90, 0xF0F,
  16.    0x0BE, 0x090, 0x999, 0xBBB, 0xF99, 0x909, 0x0DB, 0xDDD
  17. };
  18.  
  19. void GetPLDefs(void)
  20. {
  21.    FILE *PrefsFile;
  22.  
  23.    /* Read user preferences from s:PlPlot/PlPlot.def if it exists,
  24.       otherwise use default preferences */
  25.  
  26.    if((PrefsFile = fopen("s:PlPlot.def","r")) != NULL) {
  27.       (void)fread((char *)&PLDefPrefs,sizeof(struct PLPrefs),1,PrefsFile);
  28.       (void)fclose(PrefsFile);
  29.    }
  30.    PLCurPrefs = PLDefPrefs;
  31. }
  32.  
  33. void SetPLDefs(void)
  34. {
  35.    FILE *PrefsFile;
  36.  
  37.    if((PrefsFile = fopen("s:PlPlot.def","w")) != NULL) {
  38.       (void)fwrite((char *)&PLCurPrefs,sizeof(struct PLPrefs),1,PrefsFile);
  39.       (void)fclose(PrefsFile);
  40.    }
  41.    PLDefPrefs = PLCurPrefs;
  42. }
  43.  
  44. void RestorePrefs(void)
  45. {
  46.    PLCurPrefs = PLDefPrefs;
  47. }
  48.  
  49.