diff --git a/source/build.c b/source/build.c index 24c773c..656b5ef 100644 --- a/source/build.c +++ b/source/build.c @@ -309,7 +309,7 @@ void build(void) { } /* get the first file name in the old cross-reference */ blocknumber = -1; - read_block(); /* read the first cross-ref block */ + read_crossreference_block(); /* read the first cross-ref block */ scanpast('\t'); /* skip the header */ oldfile = getoldfile(); } else { /* force cross-referencing of all the source files */ @@ -558,13 +558,13 @@ void copydata(void) { while(*cp != '\t') { dbputc(*cp++); } - } while(*++cp == '\0' && (cp = read_block()) != NULL); + } while(*++cp == '\0' && (cp = read_crossreference_block()) != NULL); dbputc('\t'); /* copy the tab */ /* get the next character */ /* HBB 2010-08-21: potential problem if above loop was left * with cp==NULL */ - if(cp && (*(cp + 1) == '\0')) { cp = read_block(); } + if(cp && (*(cp + 1) == '\0')) { cp = read_crossreference_block(); } /* exit if at the end of this file's data */ if(cp == NULL || *cp == NEWFILE) { break; } /* look for an #included file */ @@ -598,13 +598,13 @@ void copyinverted(void) { while(*cp != '\n') { dbputc(*cp++); } - } while(*++cp == '\0' && (cp = read_block()) != NULL); + } while(*++cp == '\0' && (cp = read_crossreference_block()) != NULL); dbputc('\n'); /* copy the newline */ /* get the next character */ /* HBB 2010-08-21: potential problem if above loop was left * with cp==NULL */ - if(cp && (*(cp + 1) == '\0')) { cp = read_block(); } + if(cp && (*(cp + 1) == '\0')) { cp = read_crossreference_block(); } /* exit if at the end of this file's data */ if(cp == NULL) { break; } switch(*cp) { diff --git a/source/constants.h b/source/constants.h index ab52d8b..8dfc977 100644 --- a/source/constants.h +++ b/source/constants.h @@ -50,13 +50,13 @@ /* get the next character in the cross-reference */ /* note that blockp is assumed not to be null */ #define getrefchar() \ - (*(++blockp + 1) != '\0' ? *blockp : (read_block() != NULL ? *blockp : '\0')) + (*(++blockp + 1) != '\0' ? *blockp : (read_crossreference_block() != NULL ? *blockp : '\0')) /* skip the next character in the cross-reference */ /* note that blockp is assumed not to be null and that this macro will always be in a statement by itself */ #define skiprefchar() \ - if(*(++blockp + 1) == '\0') (void)read_block() + if(*(++blockp + 1) == '\0') (void)read_crossreference_block() #define DUMMYCHAR ' ' /* use space as a dummy character */ #define MSGLEN ((PATLEN) + 80) /* displayed message length */ diff --git a/source/find.c b/source/find.c index 5ba2efa..2cfc27e 100644 --- a/source/find.c +++ b/source/find.c @@ -159,7 +159,7 @@ bool check_for_assignment(void) { if(asgn_char[0] == '\0') { /* get the next block when we reach the end of * the current block */ - if(NULL == (asgn_char = read_block())){ + if(NULL == (asgn_char = read_crossreference_block())){ return false; } } @@ -240,10 +240,10 @@ char *find_symbol_or_assignment(const char *pattern, bool assign_flag) { while(*cp != '\n') { ++cp; } - } while(*(cp + 1) == '\0' && (cp = read_block()) != NULL); + } while(*(cp + 1) == '\0' && (cp = read_crossreference_block()) != NULL); /* skip the found character */ - if(cp != NULL && *(++cp + 1) == '\0') { cp = read_block(); } + if(cp != NULL && *(++cp + 1) == '\0') { cp = read_crossreference_block(); } if(cp == NULL) { break; } /* look for a source file, function, or macro name */ if(*cp == '\t') { @@ -811,7 +811,7 @@ bool matchrest(void) { ++blockp; ++i; } - } while(*(blockp + 1) == '\0' && read_block() != NULL); + } while(*(blockp + 1) == '\0' && read_crossreference_block() != NULL); if(*blockp == '\n' && cpattern[i] == '\0') { return (true); } return (false); @@ -914,7 +914,7 @@ void putline(FILE *output) { } ++cp; } - } while(*(cp + 1) == '\0' && (cp = read_block()) != NULL); + } while(*(cp + 1) == '\0' && (cp = read_crossreference_block()) != NULL); blockp = cp; } @@ -940,7 +940,7 @@ void fetch_string_from_dbase(char *s, size_t length) { } ++cp; } - } while(length > 0 && cp[1] == '\0' && (cp = read_block()) != NULL); + } while(length > 0 && cp[1] == '\0' && (cp = read_crossreference_block()) != NULL); blockp = cp; *s = '\0'; } @@ -955,14 +955,14 @@ char *scanpast(char c) { while(*cp != c) { ++cp; } - } while(*(cp + 1) == '\0' && (cp = read_block()) != NULL); + } while(*(cp + 1) == '\0' && (cp = read_crossreference_block()) != NULL); blockp = cp; if(cp != NULL) { skiprefchar(); /* skip the found character */ } return blockp; } /* read a block of the cross-reference */ -char *read_block(void) { +char *read_crossreference_block(void) { /* read the next block */ blocklen = read(symrefs, block, BUFSIZ); blockp = block; @@ -1171,7 +1171,7 @@ long dbseek(long offset) { sleep(3); return rc; } - read_block(); + read_crossreference_block(); blocknumber = n; } blockp = block + offset % BUFSIZ; diff --git a/source/global.h b/source/global.h index e258f20..f416bbc 100644 --- a/source/global.h +++ b/source/global.h @@ -197,7 +197,7 @@ const char * prepend_path(const char * prepand_with, const char * file); char *inviewpath(const char *file); char *lookup(char *ident, bool do_compressed); char *pathcomponents(char *path, int components); -char *read_block(void); +char *read_crossreference_block(void); char *scanpast(char c); char **parse_options(const int argc, const char * const * const argv);