_info 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #include "config.h"
  2. #include <stdio.h>
  3. #include <string.h>
  4. /**
  5. * ntdb - Next Generation Trivial Database
  6. *
  7. * This package provides an experimental persistent keyword/data store.
  8. * Its main advantage over tdb is that it's 64-bit.
  9. *
  10. * Example:
  11. * #include <stdio.h>
  12. * #include <err.h>
  13. * #include <unistd.h>
  14. * #include <ccan/ntdb/ntdb.h>
  15. *
  16. * int main(int argc, char *argv[])
  17. * {
  18. * NTDB_DATA key = ntdb_mkdata("key", 3);
  19. * NTDB_DATA val = ntdb_mkdata("val", 3);
  20. * struct ntdb_context *ntdb;
  21. *
  22. * ntdb = ntdb_open("example.ntdb", NTDB_DEFAULT,
  23. * O_RDWR | O_CREAT | O_TRUNC, 0600, NULL);
  24. * if (ntdb == NULL)
  25. * errx(1, "failed to open database file");
  26. *
  27. * ntdb_store(ntdb, key, val, NTDB_INSERT);
  28. *
  29. * ntdb_close(ntdb);
  30. *
  31. * return 0;
  32. * }
  33. *
  34. * License: LGPL (v3 or any later version)
  35. * Authors: Rusty Russell
  36. * Andrew Tridgell
  37. * Jeremy Allison
  38. * Jelmer Vernooij
  39. * Volker Lendecke
  40. * Andrew Esh
  41. * Simon McVittie
  42. * Tim Potter
  43. * Maintainer: Rusty Russell <rusty@rustcorp.com.au>
  44. */
  45. int main(int argc, char *argv[])
  46. {
  47. if (argc != 2)
  48. return 1;
  49. if (strcmp(argv[1], "depends") == 0) {
  50. printf("ccan/asearch\n");
  51. printf("ccan/build_assert\n");
  52. printf("ccan/cast\n");
  53. printf("ccan/compiler\n");
  54. printf("ccan/endian\n");
  55. printf("ccan/hash\n");
  56. printf("ccan/ilog\n");
  57. printf("ccan/likely\n");
  58. printf("ccan/tally\n");
  59. printf("ccan/typesafe_cb\n");
  60. return 0;
  61. }
  62. if (strcmp(argv[1], "testdepends") == 0) {
  63. printf("ccan/failtest\n");
  64. printf("ccan/err\n");
  65. return 0;
  66. }
  67. return 1;
  68. }