Browse Source

No underscore in struct names

master
Daniel 4 months ago
parent
commit
e70251a20c
2 changed files with 12 additions and 12 deletions
  1. +5
    -5
      biblec.c
  2. +7
    -7
      biblec.h

+ 5
- 5
biblec.c View File

@@ -15,7 +15,7 @@ int strToInt(char *buf) {
}

// Parse BibleC index file, see format.md
int biblec_parse(struct Biblec_translation *translation, char *indexLocation) {
int biblec_parse(struct BiblecTranslation *translation, char *indexLocation) {
FILE *index = fopen(indexLocation, "r");
if (index == NULL) {
return FILE_NOT_FOUND;
@@ -86,7 +86,7 @@ int biblec_parse(struct Biblec_translation *translation, char *indexLocation) {
fclose(index);
return 0;
}
int getBookID(struct Biblec_translation *translation, char *book) {
int getBookID(struct BiblecTranslation *translation, char *book) {
int bookID = BOOK_NOT_FOUND;
for (int i = 0; i < translation->length; i++) {
if (!strcmp(book, translation->books[i].name)) {
@@ -97,7 +97,7 @@ int getBookID(struct Biblec_translation *translation, char *book) {
return bookID;
}

int biblec_next(struct Biblec_reader *reader) {
int biblec_next(struct BiblecReader *reader) {
// Reached end of requested verses
if (reader->linesRead > reader->to) {
return 0;
@@ -115,7 +115,7 @@ int biblec_next(struct Biblec_reader *reader) {
}

// Create a new reader structure
int biblec_new(struct Biblec_reader *reader, struct Biblec_translation *translation,
int biblec_new(struct BiblecReader *reader, struct BiblecTranslation *translation,
char *book, int chapter, int verse, int to) {
int c;

@@ -174,6 +174,6 @@ int biblec_new(struct Biblec_reader *reader, struct Biblec_translation *translat
return 0;
}

void biblec_close(struct Biblec_reader *reader) {
void biblec_close(struct BiblecReader *reader) {
fclose(reader->file);
}

+ 7
- 7
biblec.h View File

@@ -28,7 +28,7 @@ enum Biblec_error {
BIBLEC_VERSE_ERROR = -6
};

struct Biblec_reader {
struct BiblecReader {
char *book;
int chapter;
int verse;
@@ -38,7 +38,7 @@ struct Biblec_reader {
FILE *file;
};

struct Biblec_translation {
struct BiblecTranslation {
char name[MAX_NAME];
char lang[MAX_LANG];
char location[MAX_LOCATION];
@@ -51,13 +51,13 @@ struct Biblec_translation {
}books[MAX_BOOKS];
};

int biblec_parse(struct Biblec_translation *translation, char *indexLocation);
int biblec_next(struct Biblec_reader *reader);
void biblec_close(struct Biblec_reader *reader);
int biblec_parse(struct BiblecTranslation *translation, char *indexLocation);
int biblec_next(struct BiblecReader *reader);
void biblec_close(struct BiblecReader *reader);

int biblec_new(
struct Biblec_reader *reader,
struct Biblec_translation *translation,
struct BiblecReader *reader,
struct BiblecTranslation *translation,
char *book,
int chapter,
int verse,


Loading…
Cancel
Save