home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / store / IXStoreBlock.h < prev    next >
Text File  |  1992-04-28  |  2KB  |  69 lines

  1. /*
  2. IXStoreBlock.h
  3. Copyright 1991, NeXT Computer, Inc.
  4. */
  5.  
  6. #import    "protocols.h"
  7. #import    "IXStore.h"
  8.  
  9. #ifndef    RELEASE_2
  10. #import <machkit/reference.h>
  11. #else    RELEASE_2
  12. #import "reference.h"
  13. #endif    RELEASE_2
  14. #import    <objc/Object.h>
  15.  
  16. extern unsigned 
  17. IXWriteRootObjectToStore(IXStore *aStore, 
  18.     unsigned aHandle, id anObject);
  19. extern id 
  20. IXReadObjectFromStore(IXStore *aStore, 
  21.     unsigned aHandle, NXZone *aZone);
  22.  
  23. #ifndef    RELEASE_2
  24. @interface IXStoreBlock: Object <NXReference,IXBlockAndStoreAccess>
  25. #else    RELEASE_2
  26. @interface IXStoreBlock: Object
  27. #endif    RELEASE_2
  28. {
  29.     unsigned        _references;
  30. @public
  31.     IXStore        *store;
  32.     unsigned    handle;
  33.     unsigned        blockSize;
  34. }
  35.  
  36. - (unsigned)copyAtOffset:(unsigned)offset forLength:(unsigned)length;
  37.  
  38. - close; // makes block available to other contexts
  39. // opens for writing; shadows region if transactions enabled
  40. - (void *)openAtOffset:(unsigned)offset forLength:(unsigned)length;
  41. // opens for reading; opened region not shadowed
  42. - (void *)readAtOffset:(unsigned)offset forLength:(unsigned)length;
  43.  
  44. - (unsigned)size; // locks and determines the size of the block
  45. - resizeTo:(unsigned)size; // resizes the block; the block may move
  46.  
  47. - readObject; // opens typed stream on block and calls NXReadObject()
  48. - writeObject:anObject; // calls NXWriteRootObject(), copies archive to block
  49.  
  50. #ifdef    RELEASE_2
  51. // @protocol NXReference
  52.  
  53. - (unsigned) references;
  54. - addReference;
  55.  
  56. // @protocol IXBlockAndStoreAccess
  57.  
  58. + freeFromBlock:(unsigned)aHandle inStore:(id)aStore;
  59.  
  60. - initInStore:(id)aStore;
  61. - initFromBlock:(unsigned)aHandle inStore:(id)aStore;
  62.  
  63. - freeFromStore;
  64. - getBlock:(unsigned *)aHandle andStore:(id *)aStore;
  65. #endif    RELEASE_2
  66.  
  67. @end
  68.  
  69.