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.

44 lines
797 B

  1. #ifndef __BIBLEC
  2. #define __BIBLEC 1
  3. enum Biblec_max {
  4. VERSE_LENGTH = 700,
  5. INDEX_MAX_LENGTH = 500
  6. };
  7. enum BibleC_error {
  8. FILE_NOT_FOUND = -1,
  9. BOOK_NOT_FOUND = -2,
  10. FILE_ERROR = -3,
  11. CHAPTER_TOO_BIG = -4
  12. };
  13. struct Biblec_reader {
  14. char *book;
  15. int chapter;
  16. int verse;
  17. int to;
  18. char result[VERSE_LENGTH];
  19. FILE *file;
  20. int linesRead;
  21. };
  22. struct Biblec_translation {
  23. char name[20];
  24. char lang[20];
  25. char location[50];
  26. int length;
  27. struct Book {
  28. char name[20];
  29. int start;
  30. int length;
  31. int chapters[151];
  32. }book[66];
  33. };
  34. int biblec_parse(struct Biblec_translation *translation, char *indexLocation);
  35. int biblec_new(struct Biblec_reader *reader, struct Biblec_translation *translation, char *book, int chapter, int verse, int to);
  36. int biblec_next(struct Biblec_reader *reader);
  37. #endif