Skip to content

Commit

Permalink
Rename MIO variables from fp to mio
Browse files Browse the repository at this point in the history
  • Loading branch information
techee committed Aug 7, 2016
1 parent 02138f9 commit 967b572
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions ctags/main/entry.c
Expand Up @@ -366,8 +366,8 @@ extern void openTagFile (void)
static int replacementTruncate (const char *const name, const long size)
{
char *tempName = NULL;
FILE *fp = tempFile ("w", &tempName);
fclose (fp);
MIO *mio = tempFile ("w", &tempName);
fclose (mio);
copyFile (name, tempName, size);
copyFile (tempName, name, WHOLE_FILE);
remove (tempName);
Expand Down
14 changes: 7 additions & 7 deletions ctags/main/read.c
Expand Up @@ -247,7 +247,7 @@ static boolean parseLineDirective (void)
*/

/* This function opens an input file, and resets the line counter. If it
* fails, it will display an error message and leave the File.fp set to NULL.
* fails, it will display an error message and leave the File.mio set to NULL.
*/
extern boolean fileOpen (const char *const fileName, const langType language)
{
Expand Down Expand Up @@ -539,12 +539,12 @@ extern const unsigned char *readLineFromInputFile (void)
/*
* Raw file line reading with automatic buffer sizing
*/
extern char *readLineRaw (vString *const vLine, MIO *const fp)
extern char *readLineRaw (vString *const vLine, MIO *const mio)
{
char *result = NULL;

vStringClear (vLine);
if (fp == NULL) /* to free memory allocated to buffer */
if (mio == NULL) /* to free memory allocated to buffer */
error (FATAL, "NULL file pointer");
else
{
Expand All @@ -560,13 +560,13 @@ extern char *readLineRaw (vString *const vLine, MIO *const fp)
char *const pLastChar = vStringValue (vLine) + vStringSize (vLine) -2;
long startOfLine;

startOfLine = mio_tell(fp);
startOfLine = mio_tell(mio);
reReadLine = FALSE;
*pLastChar = '\0';
result = mio_gets (fp, vStringValue (vLine), (int) vStringSize (vLine));
result = mio_gets (mio, vStringValue (vLine), (int) vStringSize (vLine));
if (result == NULL)
{
if (! mio_eof (fp))
if (! mio_eof (mio))
error (FATAL | PERROR, "Failure on attempt to read file");
}
else if (*pLastChar != '\0' &&
Expand All @@ -575,7 +575,7 @@ extern char *readLineRaw (vString *const vLine, MIO *const fp)
/* buffer overflow */
reReadLine = vStringAutoResize (vLine);
if (reReadLine)
mio_seek (fp, startOfLine, SEEK_SET);
mio_seek (mio, startOfLine, SEEK_SET);
else
error (FATAL | PERROR, "input line too big; out of memory");
}
Expand Down
2 changes: 1 addition & 1 deletion ctags/main/read.h
Expand Up @@ -114,7 +114,7 @@ extern int getNthPrevCFromInputFile (unsigned int nth, int def);
extern int skipToCharacterInInputFile (int c);
extern void ungetcToInputFile (int c);
extern const unsigned char *readLineFromInputFile (void);
extern char *readLineRaw (vString *const vLine, MIO *const fp);
extern char *readLineRaw (vString *const vLine, MIO *const mio);
extern char *readSourceLine (vString *const vLine, MIOPos location, long *const pSeekValue);
extern boolean bufferOpen (unsigned char *buffer, size_t buffer_size,
const char *const fileName, const langType language );
Expand Down

0 comments on commit 967b572

Please sign in to comment.