Leaked source code of windows server 2003
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.

158 lines
6.1 KiB

  1. /////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1998 Active Voice Corporation. All Rights Reserved.
  4. //
  5. // Active Agent(r) and Unified Communications(tm) are trademarks of Active Voice Corporation.
  6. //
  7. // Other brand and product names used herein are trademarks of their respective owners.
  8. //
  9. // The entire program and user interface including the structure, sequence, selection,
  10. // and arrangement of the dialog, the exclusively "yes" and "no" choices represented
  11. // by "1" and "2," and each dialog message are protected by copyrights registered in
  12. // the United States and by international treaties.
  13. //
  14. // Protected by one or more of the following United States patents: 5,070,526, 5,488,650,
  15. // 5,434,906, 5,581,604, 5,533,102, 5,568,540, 5,625,676, 5,651,054.
  16. //
  17. // Active Voice Corporation
  18. // Seattle, Washington
  19. // USA
  20. //
  21. /////////////////////////////////////////////////////////////////////////////////////////
  22. ////
  23. // ini.h - interface for ini profile functions in ini.c
  24. ////
  25. #ifndef __INI_H__
  26. #define __INI_H__
  27. #include "winlocal.h"
  28. #define INI_VERSION 0x00000107
  29. // handle to ini engine
  30. //
  31. DECLARE_HANDLE32(HINI);
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35. // IniOpen - open ini file
  36. // <dwVersion> (i) must be INI_VERSION
  37. // <hInst> (i) instance handle of calling module
  38. // <lpszCmdLine> (i) command line from WinMain()
  39. // <lpszFilename> (i) name of ini file
  40. // <dwFlags> (i) reserved, must be 0
  41. // return handle (NULL if error)
  42. //
  43. HINI DLLEXPORT WINAPI IniOpen(DWORD dwVersion, HINSTANCE hInst, LPCTSTR lpszFilename, DWORD dwFlags);
  44. // IniClose - close ini file
  45. // <hIni> (i) handle returned from IniOpen
  46. // return 0 if success
  47. //
  48. int DLLEXPORT WINAPI IniClose(HINI hIni);
  49. // IniGetInt - read integer value from specified section and entry
  50. // <hIni> (i) handle returned from IniOpen
  51. // <lpszSection> (i) section heading in the ini file
  52. // <lpszEntry> (i) entry whose value is to be retrieved
  53. // <iDefault> (i) return value if entry not found
  54. // return entry value (iDefault if error or not found)
  55. //
  56. UINT DLLEXPORT WINAPI IniGetInt(HINI hIni, LPCTSTR lpszSection, LPCTSTR lpszEntry, int iDefault);
  57. // IniGetString - read string value from specified section and entry
  58. // <hIni> (i) handle returned from IniOpen
  59. // <lpszSection> (i) section heading in the ini file
  60. // <lpszEntry> (i) entry whose value is to be retrieved
  61. // <lpszDefault> (i) return value if entry not found
  62. // <lpszReturnBuffer> (o) destination buffer
  63. // <sizReturnBuffer> (i) size of destination buffer
  64. // return count of bytes copied (0 if error or not found)
  65. //
  66. int DLLEXPORT WINAPI IniGetString(HINI hIni, LPCTSTR lpszSection, LPCTSTR lpszEntry,
  67. LPCTSTR lpszDefault, LPTSTR lpszReturnBuffer, int cbReturnBuffer);
  68. // GetPrivateProfileLong - retrieve long from specified section of specified file
  69. // <lpszSection> (i) section name within ini file
  70. // <lpszEntry> (i) entry name within section
  71. // <lDefault> (i) return value if entry not found
  72. // <lpszFilename> (i) name of ini file
  73. // return TRUE if success
  74. //
  75. long DLLEXPORT WINAPI GetPrivateProfileLong(LPCTSTR lpszSection,
  76. LPCTSTR lpszEntry, long lDefault, LPCTSTR lpszFilename);
  77. // GetProfileLong - retrieve long from specified section of win.ini
  78. // <lpszSection> (i) section name within ini file
  79. // <lpszEntry> (i) entry name within section
  80. // <lDefault> (i) return value if entry not found
  81. // return TRUE if success
  82. //
  83. long DLLEXPORT WINAPI GetProfileLong(LPCTSTR lpszSection,
  84. LPCTSTR lpszEntry, long lDefault);
  85. // WritePrivateProfileInt - write int to specified section of specified file
  86. // <lpszSection> (i) section name within ini file
  87. // <lpszEntry> (i) entry name within section
  88. // <iValue> (i) integer value to assign to entry
  89. // <lpszFilename> (i) name of ini file
  90. // return TRUE if success
  91. //
  92. BOOL DLLEXPORT WINAPI WritePrivateProfileInt(LPCTSTR lpszSection, LPCTSTR lpszEntry, int iValue, LPCTSTR lpszFilename);
  93. // WriteProfileInt - write int to specified section of win.ini
  94. // <lpszSection> (i) section name within win.ini file
  95. // <lpszEntry> (i) entry name within section
  96. // <iValue> (i) integer value to assign to entry
  97. // return TRUE if success
  98. //
  99. BOOL DLLEXPORT WINAPI WriteProfileInt(LPCTSTR lpszSection, LPCTSTR lpszEntry, int iValue);
  100. // WritePrivateProfileLong - write long to specified section of specified file
  101. // <lpszSection> (i) section name within ini file
  102. // <lpszEntry> (i) entry name within section
  103. // <iValue> (i) integer value to assign to entry
  104. // <lpszFilename> (i) name of ini file
  105. // return TRUE if success
  106. //
  107. BOOL DLLEXPORT WINAPI WritePrivateProfileLong(LPCTSTR lpszSection, LPCTSTR lpszEntry, long iValue, LPCTSTR lpszFilename);
  108. // WriteProfileLong - write long to specified section of win.ini
  109. // <lpszSection> (i) section name within win.ini file
  110. // <lpszEntry> (i) entry name within section
  111. // <iValue> (i) integer value to assign to entry
  112. // return TRUE if success
  113. //
  114. BOOL DLLEXPORT WINAPI WriteProfileLong(LPCTSTR lpszSection, LPCTSTR lpszEntry, long iValue);
  115. // UpdatePrivateProfileSection - update destination section based on source
  116. // <lpszSection> (i) section name within ini file
  117. // <lpszFileNameSrc> (i) name of source ini file
  118. // <lpszFileNameDst> (i) name of destination ini file
  119. // return 0 if success
  120. //
  121. // NOTE: if the source file has UpdateLocal=1 entry in the specified
  122. // section, each entry in the source file is compared to the corresponding
  123. // entry in the destination file. If no corresponding entry is found,
  124. // it is copied. If a corresponding entry is found, it is overwritten
  125. // ONLY IF the source file entry name is all uppercase.
  126. //
  127. // Src Dst before Dst after
  128. //
  129. // [Section] [Section] [Section]
  130. // UpdateLocal=1
  131. // EntryA=red none EntryA=red
  132. // EntryB=blue EntryB=white EntryB=white
  133. // ENTRYC=blue EntryC=white EntryC=blue
  134. //
  135. int DLLEXPORT WINAPI UpdatePrivateProfileSection(LPCTSTR lpszSection, LPCTSTR lpszFileNameSrc, LPCTSTR lpszFileNameDst);
  136. #ifdef __cplusplus
  137. }
  138. #endif
  139. #endif // __INI_H__