_info 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #include "config.h"
  2. #include <stdio.h>
  3. #include <string.h>
  4. /**
  5. * ciniparser - easily parse and manipulate ini style configuration files
  6. *
  7. * A dictionary object is allocated which contains string keys and values.
  8. * Functions to read string values return statically allocated objects,
  9. * there is no need to free them (also, do not modify them directly).
  10. *
  11. * Additional functions to manipulate or unset objects in the dictionary
  12. * can be found in the test suite.
  13. *
  14. * Example:
  15. *
  16. * #include <stdio.h>
  17. * #include <stdbool.h>
  18. * #include <ccan/ciniparser/ciniparser.h>
  19. *
  20. * #define CONFIG_FILE "/etc/config.ini"
  21. *
  22. * int main(int argc, char *argv[])
  23. * {
  24. * dictionary *d;
  25. * char *val1;
  26. * bool val2;
  27. * double val3;
  28. * int val4;
  29. *
  30. * d = ciniparser_load(CONFIG_FILE);
  31. * if (d == NULL)
  32. * return 1;
  33. *
  34. * val1 = ciniparser_getstring(d, "daemon:pidfile", NULL);
  35. * val2 = ciniparser_getboolean(d, "daemon:debug", false);
  36. * val3 = ciniparser_getdouble(d, "daemon:maxload", 3.5);
  37. * val4 = ciniparser_getint(d, "daemon:maxchild", 5);
  38. *
  39. * ciniparser_freedict(d);
  40. *
  41. * return 0;
  42. *}
  43. * License: MIT
  44. */
  45. int main(int argc, char *argv[])
  46. {
  47. if (argc != 2)
  48. return 1;
  49. if (strcmp(argv[1], "depends") == 0) {
  50. return 0;
  51. }
  52. return 1;
  53. }