home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / tt / vmem11 / vmemdemo / vmem.h < prev    next >
Text File  |  1990-10-03  |  3KB  |  114 lines

  1. /*******************************/
  2. /* INCLUDE-Datei für VMEM 1.1: */
  3. /*******************************/
  4.  
  5. #define _NULL           (0L)
  6.  
  7. typedef unsigned int    WORD;
  8. typedef unsigned long   V_ADR;
  9.  
  10. #define V_INFO          struct v_info
  11. #define TAB             struct tab
  12.  
  13. #define SIZE_1024       0   /* Seiten-Typen */
  14. #define SIZE_2048       1
  15. #define SIZE_4096       2
  16. #define SIZE_8192       3
  17. #define SIZE_16384      4
  18. #define SIZE_32768      5
  19.  
  20. /************************
  21.  * Funktions-Meldungen: *
  22.  ************************/
  23.  
  24. #define OK                  0
  25. #define ILLEGAL_FUNCTION    -0x1234
  26.  
  27. /* vm_config: */
  28.  
  29. #define    NO_LIST             1
  30. #define    NOT_FOUND           4
  31. #define WRONG_CACHE_SIZE    -256
  32. #define WRONG_PAGE_TYPE     -257
  33. #define OUT_OF_MEMORY       -258
  34. #define FILE_ERROR          -259
  35. #define ILLEGAL_DRIVE       -260
  36. #define ILLEGAL_FATSIZE     -265
  37.  
  38. /* vm_free: */
  39.  
  40. #define NOT_OK              -261
  41.  
  42. /* vm_address / vm_fill / vm_copy / vm_load / vm_save / vm_read / vm_write: */
  43.  
  44. #define ILLEGAL_ADDRESS     -262
  45. #define ILLEGAL_COUNT       -263
  46. #define ILLEGAL_MODE        -264
  47.  
  48. /************************/
  49. /* Funktions-Parameter: */
  50. /************************/
  51.  
  52. #define DRIVE_C             3   /* vm_config */
  53. #define DRIVE_D             4
  54. #define DRIVE_E             5
  55. #define DRIVE_F             6
  56. #define DRIVE_G             7
  57.  
  58. #define READ_MODE           2   /* vm_address */
  59. #define WRITE_MODE          4
  60.  
  61. /***************/
  62. /* Strukturen: */
  63. /***************/
  64.  
  65. V_INFO                      /* für vm_info */
  66. {
  67.     WORD    version;        /* Versionsnummer des Programms */
  68.  
  69.     WORD    count_page;     /* Maximalanzahl an Seiten */
  70.  
  71.     WORD    count_blocks;   /* Maximale Anzahl an Blöcken */
  72.     WORD    free_blocks;    /* Anzahl der noch verfügbaren Blöcke */
  73.  
  74.     int     fill_value;     /* Füllwert */
  75.  
  76.     long    cache_size;     /* Größe des Caches in Bytes */
  77.     WORD    cache_count;    /* Größe des Caches in Seiten */
  78.  
  79.     long    page_size;      /* Größe einer Seite in Bytes */
  80.  
  81.     long    max_size;       /* Maximalgröße des virtuellen Speichers */
  82.     long    max_alloc;      /* Maximalgröße eines einzelnen Blocks */
  83.  
  84.     int     drive_no;       /* TMP-Laufwerk (C=3, D=4, E=5, ...) */
  85.     long    drive_free;     /* freier Speicher auf dem TMP-Laufwerk */
  86. };
  87.  
  88. TAB                         /* für vm_config */
  89. {
  90.     WORD    version;
  91.     WORD    count_page;
  92.     WORD    cache_size;
  93.     WORD    page_type;
  94.     int     fill_value;
  95.     int     drive_no;
  96. };
  97.  
  98. /***************************/
  99. /* Prototypen für Turbo C: */
  100. /***************************/
  101.  
  102. int     vm_config   (TAB *parameter);
  103. void    vm_close    (void);
  104. V_INFO  *vm_info    (void);
  105. void    vm_clrcache (void);
  106. V_ADR   vm_alloc    (long size);
  107. int     vm_free     (V_ADR address);
  108. char    *vm_address (V_ADR address, long *window_size, int mode);
  109. long    vm_fill     (V_ADR address, long count, int value);
  110. long    vm_load     (V_ADR source, char *destination, long count);
  111. long    vm_save     (char *source, V_ADR destination, long count);
  112. long    vm_write    (int handle, long count, V_ADR source);
  113. long    vm_read     (int handle, long count, V_ADR destination);
  114.