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.

109 lines
3.4 KiB

  1. /*****************************************************************************
  2. ** Microsoft Rasfile Library
  3. ** Copyright (C) Microsoft Corp., 1992
  4. **
  5. ** File Name : rasfile.h
  6. **
  7. ** Revision History :
  8. ** July 10, 1992 David Kays Created
  9. ** Dec 12, 1992 Ram Cherala Added RFM_KEEPDISKFILEOPEN
  10. **
  11. ** Description :
  12. ** Rasfile file export include file.
  13. ******************************************************************************/
  14. #ifndef _RASFILE_
  15. #define _RASFILE_
  16. /*
  17. * RASFILE load modes
  18. */
  19. #define RFM_SYSFORMAT 0x01 /* DOS config.sys style file */
  20. #define RFM_CREATE 0x02 /* create file if it does't exist */
  21. #define RFM_READONLY 0x04 /* open file for read only */
  22. #define RFM_LOADCOMMENTS 0x08 /* load comment lines into memory */
  23. #define RFM_ENUMSECTIONS 0x10 /* only section headers loaded */
  24. #define RFM_KEEPDISKFILEOPEN 0x20 /* if not set close the disk file */
  25. /*
  26. * RASFILE line type bit-masks.
  27. * The ANY types are shorthand for multiple line types.
  28. */
  29. #define RFL_SECTION 0x01
  30. #define RFL_GROUP 0x02
  31. #define RFL_ANYHEADER (RFL_SECTION | RFL_GROUP)
  32. #define RFL_BLANK 0x04
  33. #define RFL_COMMENT 0x08
  34. #define RFL_ANYINACTIVE (RFL_BLANK | RFL_COMMENT)
  35. #define RFL_KEYVALUE 0x10
  36. #define RFL_COMMAND 0x20
  37. #define RFL_ANYACTIVE (RFL_KEYVALUE | RFL_COMMAND)
  38. #define RFL_ANY 0x3F
  39. /*
  40. * RASFILE search scope.
  41. */
  42. typedef enum {
  43. RFS_FILE,
  44. RFS_SECTION,
  45. RFS_GROUP
  46. } RFSCOPE;
  47. typedef int HRASFILE;
  48. typedef BOOL (*PFBISGROUP)();
  49. #define INVALID_HRASFILE -1
  50. #define RAS_MAXLINEBUFLEN 300
  51. #define RAS_MAXSECTIONNAME RAS_MAXLINEBUFLEN
  52. #ifndef APIENTRY
  53. #define APIENTRY
  54. #endif
  55. /*
  56. * RasfileLoad parameters as returned by RasfileLoadInfo.
  57. */
  58. typedef struct
  59. RASFILELOADINFO
  60. {
  61. TCHAR szPath[ MAX_PATH ];
  62. DWORD dwMode;
  63. TCHAR szSection[ RAS_MAXSECTIONNAME + 1 ];
  64. PFBISGROUP pfbIsGroup;
  65. }
  66. RASFILELOADINFO;
  67. /*
  68. * RASFILE APIs
  69. */
  70. /* file management routines */
  71. extern HRASFILE APIENTRY RasfileLoad( LPTSTR, DWORD, LPTSTR, PFBISGROUP);
  72. extern BOOL APIENTRY RasfileWrite( HRASFILE, LPTSTR );
  73. extern BOOL APIENTRY RasfileClose( HRASFILE );
  74. extern VOID APIENTRY RasfileLoadInfo( HRASFILE, RASFILELOADINFO* );
  75. /* file navigation routines */
  76. extern BOOL APIENTRY RasfileFindFirstLine( HRASFILE, BYTE, RFSCOPE );
  77. extern BOOL APIENTRY RasfileFindLastLine( HRASFILE, BYTE, RFSCOPE );
  78. extern BOOL APIENTRY RasfileFindPrevLine( HRASFILE, BYTE, RFSCOPE );
  79. extern BOOL APIENTRY RasfileFindNextLine( HRASFILE, BYTE, RFSCOPE );
  80. extern BOOL APIENTRY RasfileFindNextKeyLine( HRASFILE, LPTSTR, RFSCOPE );
  81. extern BOOL APIENTRY RasfileFindMarkedLine( HRASFILE, BYTE );
  82. extern BOOL APIENTRY RasfileFindSectionLine( HRASFILE, LPTSTR, BOOL );
  83. /* file editing routines */
  84. extern const LPTSTR APIENTRY RasfileGetLine( HRASFILE );
  85. extern BOOL APIENTRY RasfileGetLineText( HRASFILE, LPTSTR );
  86. extern BOOL APIENTRY RasfilePutLineText( HRASFILE, LPTSTR );
  87. extern BYTE APIENTRY RasfileGetLineMark( HRASFILE );
  88. extern BOOL APIENTRY RasfilePutLineMark( HRASFILE, BYTE );
  89. extern BYTE APIENTRY RasfileGetLineType( HRASFILE );
  90. extern BOOL APIENTRY RasfileInsertLine( HRASFILE, LPTSTR, BOOL );
  91. extern BOOL APIENTRY RasfileDeleteLine( HRASFILE );
  92. extern BOOL APIENTRY RasfileGetSectionName( HRASFILE, LPTSTR );
  93. extern BOOL APIENTRY RasfilePutSectionName( HRASFILE, LPTSTR );
  94. extern BOOL APIENTRY RasfileGetKeyValueFields( HRASFILE, LPTSTR, LPTSTR );
  95. extern BOOL APIENTRY RasfilePutKeyValueFields( HRASFILE, LPTSTR, LPTSTR );
  96. #endif