A minimal Bible format designed for the C language.
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.

41 lines
567 B

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include "main.h"
  5. // Runtime struct
  6. struct Biblec_translation loadedTranslation;
  7. int main() {
  8. int tryFile = biblec_parse(
  9. &loadedTranslation,
  10. "../bibles/web.i"
  11. );
  12. if (tryFile) {
  13. puts("Index parsing error");
  14. return 0;
  15. }
  16. struct Biblec_reader reader;
  17. int tryReader = biblec_new(
  18. &reader,
  19. &loadedTranslation,
  20. "John",
  21. 3,
  22. 1,
  23. 2
  24. );
  25. if (tryReader) {
  26. puts("Verse error");
  27. return 0;
  28. }
  29. while (!biblec_next(&reader)) {
  30. printf("%s\n", reader.result);
  31. }
  32. fclose(reader.file);
  33. }