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.

77 lines
2.1 KiB

  1. //============== DAE: OS/2 Database Access Engine ===================
  2. //============== util.h: DAE Misc Utilities ===================
  3. #ifndef UTIL_H /* Allow this file to be included at will */
  4. #define UTIL_H
  5. #ifndef _FILE_DEFINED
  6. #include <stdio.h> /* Needed for FPrintF2 prototype */
  7. #endif /* !_FILE_DEFINED */
  8. /* system node keys
  9. /**/
  10. extern const KEY rgkeySTATIC[13];
  11. #define pkeyNull (KEY *)(rgkeySTATIC+0)
  12. #define pkeyTables (KEY *)(rgkeySTATIC+1)
  13. #define pkeyIndexes (KEY *)(rgkeySTATIC+2)
  14. #define pkeyFields (KEY *)(rgkeySTATIC+3)
  15. #define pkeyOwnExt (KEY *)(rgkeySTATIC+4)
  16. #define pkeyAvailExt (KEY *)(rgkeySTATIC+5)
  17. #define pkeyData (KEY *)(rgkeySTATIC+6)
  18. #define pkeyDatabases (KEY *)(rgkeySTATIC+7)
  19. #define pkeyStats (KEY *)(rgkeySTATIC+8)
  20. #define pkeyLong (KEY *)(rgkeySTATIC+9)
  21. #define pkeyAutoInc (KEY *)(rgkeySTATIC+10)
  22. #define pkeyOLCStats (KEY *)(rgkeySTATIC+11)
  23. /* NOTE: whenever this is changed, also update the rgres[] in sysinit.c */
  24. #define iresBGCB 0
  25. #define iresCSR 1
  26. #define iresFCB 2
  27. #define iresFUCB 3
  28. #define iresIDB 4
  29. #define iresPIB 5
  30. #define iresSCB 6
  31. #define iresVersionBucket 7
  32. #define iresDAB 8
  33. #define iresLinkedMax 9 // the last linked ires + 1
  34. #define iresBF 9
  35. #define iresMax 10 // max all category
  36. /**************** function prototypes *********************
  37. /**********************************************************
  38. /**/
  39. ERR ErrMEMInit( VOID );
  40. BYTE *PbMEMAlloc( int ires);
  41. VOID MEMRelease( int ires, BYTE *pb );
  42. VOID MEMTerm( VOID );
  43. #ifdef MEM_CHECK
  44. VOID MEMCheck( VOID );
  45. #else
  46. #define MEMCheck()
  47. #endif
  48. #ifdef DEBUG
  49. void VARARG PrintF2(const char * fmt, ...);
  50. void VARARG FPrintF2(const char * fmt, ...);
  51. VOID MEMPrintStat( VOID );
  52. #define PrintF PrintF2
  53. #else
  54. #define PrintF()
  55. #endif
  56. CHAR *GetEnv2( CHAR *szEnvVar );
  57. ERR ErrCheckName( char *szNewName, const char *szName, int cchName );
  58. CHAR *StrTok2( CHAR *szLine, CHAR *szDelimiters );
  59. INT CmpStKey( BYTE *stKey, const KEY *pkey );
  60. INT CmpPartialKeyKey( KEY *pkey1, KEY *pkey2 );
  61. ERR ErrCheckName( char *szNewName, const char *szName, int cchName );
  62. #endif /* !UTIL_H */