Permalink
Browse files

Resolve stdio getline naming conflict

  • Loading branch information...
1 parent ba2f739 commit 076cf4ad5cc993be0c6195ec0d5d57e5ad8ac1eb H.Merijn Brand committed with Feb 17, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 ref.c
View
@@ -42,7 +42,7 @@ typedef enum
#if USE_PROTOTYPES
static void usage(char *argv0);
-static char *getline(FILE *fp);
+static char *elv_getline(FILE *fp);
static void store(char *line, char **list);
static LINECLS classify(char *line, LINECLS prev);
static void lookup(TAG *tag);
@@ -171,7 +171,7 @@ ELVBOOL ioclose()
/* This function reads a single line, and replaces the terminating newline with
* a '\0' byte. The string will be in a static buffer. Returns NULL at EOF.
*/
-static char *getline(fp)
+static char *elv_getline(fp)
FILE *fp;
{
int ch;
@@ -348,7 +348,7 @@ static void lookup(tag)
}
/* for each line... */
- for (lnum = 1, lc = LC_COMPLETE; (line = getline(fp)) != NULL; lnum++)
+ for (lnum = 1, lc = LC_COMPLETE; (line = elv_getline(fp)) != NULL; lnum++)
{
/* is this the tag definition? */
if (taglnum > 0 ? taglnum == lnum : !strncmp(tagline, line, len))
@@ -377,7 +377,7 @@ static void lookup(tag)
{
if (strchr(line, '(') != NULL)
{
- while ((line = getline(fp)) != NULL
+ while ((line = elv_getline(fp)) != NULL
&& *line
&& ((*line != '#' && *line != '{')
|| line[strlen(line) - 1] == '\\'))
@@ -387,7 +387,7 @@ static void lookup(tag)
}
else if ((lc = classify(line, lc)) == LC_PARTIAL)
{
- while ((line = getline(fp)) != NULL
+ while ((line = elv_getline(fp)) != NULL
&& (lc = classify(line, lc)) == LC_PARTIAL)
{
puts(line);

0 comments on commit 076cf4a

Please sign in to comment.