registry_reg.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /**
  2. * WinPR: Windows Portable Runtime
  3. * Windows Registry (.reg file format)
  4. *
  5. * Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
  6. *
  7. * Licensed under the Apache License, Version 2.0 (the "License");
  8. * you may not use this file except in compliance with the License.
  9. * You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS,
  15. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. * See the License for the specific language governing permissions and
  17. * limitations under the License.
  18. */
  19. #ifndef REGISTRY_REG_H_
  20. #define REGISTRY_REG_H_
  21. #include <winpr/registry.h>
  22. typedef struct _reg Reg;
  23. typedef struct _reg_key RegKey;
  24. typedef struct _reg_val RegVal;
  25. struct _reg
  26. {
  27. FILE* fp;
  28. char* line;
  29. char* next_line;
  30. int line_length;
  31. char* buffer;
  32. char* filename;
  33. BOOL read_only;
  34. RegKey* root_key;
  35. };
  36. struct _reg_val
  37. {
  38. char* name;
  39. DWORD type;
  40. RegVal* prev;
  41. RegVal* next;
  42. union reg_data {
  43. DWORD dword;
  44. char* string;
  45. } data;
  46. };
  47. struct _reg_key
  48. {
  49. char* name;
  50. DWORD type;
  51. RegKey* prev;
  52. RegKey* next;
  53. char* subname;
  54. RegVal* values;
  55. RegKey* subkeys;
  56. };
  57. Reg* reg_open(BOOL read_only);
  58. void reg_close(Reg* reg);
  59. #endif