Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
2.9 KiB

  1. //============== DAE: OS/2 Database Access Engine ===================
  2. //============== idb.h: Index Descriptor Block ===================
  3. // Flags for IDB
  4. #define fidbUnique (1<<0) // Duplicate keys not allowed
  5. #define fidbHasTagged (1<<1) // Has a tagged segment
  6. #define fidbAllowAllNulls (1<<2) // Make entries for NULL keys (all segments are null)
  7. #define fidbAllowSomeNulls (1<<3) // Make entries for keys with some null segments
  8. #define fidbNoNullSeg (1<<4) // Don't allow a NULL key segment
  9. #define fidbPrimary (1<<5) // Index is the primary index
  10. #define fidbLangid (1<<6) // Index langid
  11. #define fidbHasMultivalue (1<<7) // Has a multivalued segment
  12. #define IDBSetUnique( pidb ) ( (pidb)->fidb |= fidbUnique )
  13. #define IDBResetUnique( pidb ) ( (pidb)->fidb &= ~fidbUnique )
  14. #define FIDBUnique( pidb ) ( (pidb)->fidb & fidbUnique )
  15. #define IDBSetHasTagged( pidb ) ( (pidb)->fidb |= fidbHasTagged )
  16. #define IDBResetHasTagged( pidb ) ( (pidb)->fidb &= ~fidbHasTagged )
  17. #define FIDBHasTagged( pidb ) ( (pidb)->fidb & fidbHasTagged )
  18. #define IDBSetAllowAllNulls( pidb ) ( (pidb)->fidb |= fidbAllowAllNulls )
  19. #define IDBResetAllowAllNulls( pidb ) ( (pidb)->fidb &= ~fidbAllowAllNulls )
  20. #define FIDBAllowAllNulls( pidb ) ( (pidb)->fidb & fidbAllowAllNulls )
  21. #define IDBSetAllowSomeNulls( pidb ) ( (pidb)->fidb |= fidbAllowSomeNulls )
  22. #define IDBResetAllowSomeNulls( pidb ) ( (pidb)->fidb &= ~fidbAllowSomeNulls )
  23. #define FIDBAllowSomeNulls( pidb ) ( (pidb)->fidb & fidbAllowSomeNulls )
  24. #define IDBSetNoNullSeg( pidb ) ( (pidb)->fidb |= fidbNoNullSeg )
  25. #define IDBResetNoNullSeg( pidb ) ( (pidb)->fidb &= ~fidbNoNullSeg )
  26. #define FIDBNoNullSeg( pidb ) ( (pidb)->fidb & fidbNoNullSeg )
  27. #define IDBSetPrimary( pidb ) ( (pidb)->fidb |= fidbPrimary )
  28. #define IDBResetPrimary( pidb ) ( (pidb)->fidb &= ~fidbPrimary )
  29. #define FIDBPrimary( pidb ) ( (pidb)->fidb & fidbPrimary )
  30. #define IDBSetLangid( pidb ) ( (pidb)->fidb |= fidbLangid )
  31. #define IDBResetLangid( pidb ) ( (pidb)->fidb &= ~fidbLangid )
  32. #define FIDBLangid( pidb ) ( (pidb)->fidb & fidbLangid )
  33. #define IDBSetMultivalued( pidb ) ( (pidb)->fidb |= fidbMultivalued )
  34. #define IDBResetMultivalued( pidb ) ( (pidb)->fidb &= ~fidbMultivalued )
  35. #define FIDBMultivalued( pidb ) ( (pidb)->fidb & fidbMultivalued )
  36. // Index Descriptor Block: information about index key
  37. struct _idb
  38. {
  39. IDXSEG rgidxseg[JET_ccolKeyMost];
  40. BYTE rgbitIdx[32];
  41. LANGID langid; // language of index
  42. CHAR szName[JET_cbNameMost + 1];
  43. BYTE iidxsegMac;
  44. BYTE fidb;
  45. BYTE rgbFiller[2];
  46. };
  47. #define PidbMEMAlloc() (IDB*)PbMEMAlloc(iresIDB)
  48. #ifdef DEBUG /* Debug check for illegal use of freed idb */
  49. #define MEMReleasePidb(pidb) { MEMRelease(iresIDB, (BYTE*)(pidb)); pidb = pidbNil; }
  50. #else
  51. #define MEMReleasePidb(pidb) { MEMRelease(iresIDB, (BYTE*)(pidb)); }
  52. #endif