qdf_parse.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Copyright (c) 2018 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /**
  19. * DOC: Thin filesystem API abstractions
  20. */
  21. #ifndef __QDF_PARSE_H
  22. #define __QDF_PARSE_H
  23. #include "qdf_status.h"
  24. /**
  25. * cfg_ini_parse() - parse an ini file
  26. * @ini_path: The full file path of the ini file to parse
  27. * @item_cb: Ini item (key/value pair) handler callback function
  28. * Return QDF_STATUS_SUCCESS to continue parsing, else to abort
  29. * @section_cb: Ini section header handler callback function
  30. * Return QDF_STATUS_SUCCESS to continue parsing, else to abort
  31. *
  32. * The *.ini file format is a simple format consiting of a list of key/value
  33. * pairs (items), separated by an '=' character. Comments are initiated with
  34. * a '#' character. Sections are also supported, using '[' and ']' around the
  35. * section name. e.g.
  36. *
  37. * # comments are started with a '#' character
  38. * # items are key/value string pairs, separated by the '=' character
  39. * someKey1=someValue1
  40. * someKey2=someValue2 # this is also a comment
  41. *
  42. * # section headers are enclosed in square brackets
  43. * [some section header] # new section begins
  44. * someKey3=someValue3
  45. *
  46. * Return: QDF_STATUS
  47. */
  48. QDF_STATUS
  49. qdf_ini_parse(const char *ini_path,
  50. QDF_STATUS (*item_cb)(const char *key, const char *value),
  51. QDF_STATUS (*section_cb)(const char *name));
  52. #endif /* __QDF_PARSE_H */