PROFILE.H 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /****************************************************************************
  2. *
  3. * File : profile.h
  4. * Date Created : 11/24/94
  5. * Description : header file for .ini file management
  6. *
  7. * Programmer(s) : Nick Skrepetos
  8. * Last Modification : 11/25/94 - 11:14:58 PM
  9. * Additional Notes :
  10. *
  11. *****************************************************************************
  12. * Copyright (c) 1993-95, HMI, Inc. All Rights Reserved *
  13. ****************************************************************************/
  14. #ifndef _HMI_INI_MANAGER
  15. #define _HMI_INI_MANAGER
  16. // profile structure
  17. typedef struct _tagINIInstance
  18. {
  19. W32 wFlags; // misc. flags
  20. BYTE szName[ 128 ]; // name of .ini file
  21. PSTR pData; // pointer to .ini file in memory
  22. W32 wSize; // size, in bytes, of file
  23. W32 wMaxSize; // maximum size in bytes of the .ini
  24. PSTR pCurrent; // current location in file
  25. W32 wCurrent; // current location in file
  26. PSTR pSection; // pointer to section start
  27. PSTR pItemPtr; // pointer to the start of line w/item
  28. PSTR pItem; // pointer to last item
  29. PSTR pList; // pointer to last item location, for list
  30. // management.
  31. PSTR pListPtr; // pointer for raw string list
  32. } _INI_INSTANCE;
  33. // equates
  34. #define _INI_SECTION_START '['
  35. #define _INI_SECTION_END ']'
  36. #define _INI_EQUATE '='
  37. #define _INI_SPACE ' '
  38. #define _INI_TAB 0x9
  39. #define _INI_STRING_START '"'
  40. #define _INI_STRING_END '"'
  41. #define _INI_EOL 0x0d
  42. #define _INI_CR 0x0d
  43. #define _INI_LF 0x0a
  44. #define _INI_HEX_INDICATOR 'x'
  45. #define _INI_LIST_SEPERATOR ','
  46. // amount of bytes to allocate in addition to file size so that the
  47. // .ini file may be modified by the application.
  48. #define _INI_EXTRA_MEMORY 1024
  49. // various flags for .ini structure
  50. #define _INI_MODIFIED 0x8000
  51. #endif
  52. // function prototypes
  53. BOOL cdecl hmiINIOpen ( _INI_INSTANCE * sInstance, PSTR szName );
  54. BOOL cdecl hmiINIClose ( _INI_INSTANCE * sInstance );
  55. BOOL cdecl hmiINILocateSection ( _INI_INSTANCE * sInstance, PSTR szName );
  56. BOOL cdecl hmiINILocateItem ( _INI_INSTANCE * sInstance, PSTR szItem );
  57. BOOL cdecl hmiINIGetDecimal ( _INI_INSTANCE * sInstance, W32 * wValue );
  58. BOOL cdecl hmiINIGetString ( _INI_INSTANCE * sInstance, PSTR pString, W32 wMaxLength );
  59. BOOL cdecl hmiINIGetQuery ( _INI_INSTANCE * sInstance, PSTR szItem );
  60. BOOL cdecl hmiINIWriteDecimal ( _INI_INSTANCE * sInstance, W32 wValue );
  61. BOOL cdecl hmiINIWriteString ( _INI_INSTANCE * sInstance, PSTR szString );
  62. BOOL cdecl hmiINIWriteQuery ( _INI_INSTANCE * sInstance, PSTR szItem, BOOL wState );
  63. BOOL cdecl hmiINIDeleteItem ( _INI_INSTANCE * sInstance, PSTR szItem );
  64. BOOL cdecl hmiINIDeleteSection ( _INI_INSTANCE * sInstance, PSTR szSection );
  65. BOOL cdecl hmiINIGetRawString ( _INI_INSTANCE * sInstance, PSTR pString, W32 wMaxLength );
  66. BOOL cdecl hmiINIAddSection ( _INI_INSTANCE * sInstance, PSTR szSection );
  67. BOOL cdecl hmiINIAddItemString ( _INI_INSTANCE * sInstance, PSTR szItem, PSTR szString, W32 wJustify );
  68. BOOL cdecl hmiINIGetItemDecimal ( _INI_INSTANCE * sInstance, PSTR szItem, W32 * wValue );
  69. BOOL cdecl hmiINIGetItemString ( _INI_INSTANCE * sInstance,
  70. PSTR szItem,
  71. PSTR pString,
  72. W32 wMaxSize );
  73. BOOL cdecl hmiINIAddItemDecimal ( _INI_INSTANCE * sInstance,
  74. PSTR szItem,
  75. W32 wValue,
  76. W32 wJustify,
  77. W32 wRadix );