home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Demos / OOFILE / docs / xplat.txt < prev    next >
Encoding:
Text File  |  1995-06-01  |  1.5 KB  |  38 lines  |  [TEXT/ttxt]

  1. xplat.txt
  2. This document summarises the issues in going cross-platform. By observing these
  3. simple points you should be able to build a database on one platform and use the
  4. data file on any of the others. This forms part of our release testing.
  5.  
  6. MAC REALS
  7. The default on the Mac is for 10-byte doubles. Both Symantec and CodeWarrior
  8. have a Project-level option that allows you to build with 8-byte doubles.
  9.  
  10. If you build a database that has dbReal fields, with the default 10-byte doubles:
  11. 1) your binary real data won't be cross-platform
  12. 2) the extra 2 bytes/field will cause errors on other platforms due to the record length
  13.  
  14.  
  15. FIELD ALIGNMENT
  16. dbLong, dbUlong, dbDate, dbBLOB and dbWin3RGB fields are aligned on 4-byte
  17. boundaries. (dbBLOB & subclasses take two longints consecutively).
  18.  
  19. dbReal fields are aligned on 8-byte boundaries.
  20.  
  21. This field alignment is automatic and is provided by inserting dummy fields in
  22. the c-tree record.
  23.  
  24. You can avoid wasting any space in your records by being aware of these
  25. alignments and the following two rules: 
  26.  
  27. 1) there is a leading 2-byte field inside the c-tree record
  28.  
  29. 2) dbChar fields are followed by a trailing null or two (out to a 2-byte
  30. boundary). Thus a 79 char field takes 80 chars in the record. An 80 char field
  31. takes 82 chars in the record.
  32.  
  33. The easy way to minimise padding is keep like types together & declare all your
  34. dbShort fields up front.
  35.  
  36. Note: if you wanted to insert an alert to see if dummy padding fields were being
  37. inserted, have a look at OOF_tableBackend_ctree::BuildBackendtables.
  38.