vm_storage.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these libraries and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /* $XConsortium: vm_storage.h /main/4 1996/07/18 16:35:41 drk $ */
  24. #ifndef _vm_storage_h
  25. #define _vm_storage_h 1
  26. #include "dstr/void_ptr_array.h"
  27. #include "storage/abs_storage.h"
  28. class vm_storage : public abs_storage
  29. {
  30. protected:
  31. void_ptr_array f_array;
  32. public:
  33. vm_storage(char* path, char* name, rep_policy* rep_p = 0);
  34. ~vm_storage() ;
  35. void remove();
  36. // i/o functions
  37. int readString (mmdb_pos_t loc, char* base, int len,
  38. int str_offset = 0) ;
  39. int insertString(mmdb_pos_t& loc, const char* base, int len, Boolean flush = false) ;
  40. int get_str_ptr(mmdb_pos_t loc, char*&, int& len);
  41. int updateString(mmdb_pos_t loc, const char* base, int len,
  42. int string_ofst = 0, Boolean flush = false) ;
  43. int deleteString (mmdb_pos_t loc, Boolean flush = false) ;
  44. int allocString (mmdb_pos_t& loc, int len, char*&, int mode = 0);
  45. int appendString(mmdb_pos_t loc, const char*, int len,
  46. Boolean flush_opt = false) ;
  47. // status functions
  48. Boolean io_mode(int mode) ;
  49. friend class storage_mgr_t;
  50. protected:
  51. };
  52. #endif