parser: fix warnings about unused functions

Signed-off-by: Eric Chiang <ericchiang@google.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
Eric Chiang 2018-12-18 16:20:17 -08:00 committed by John Johansen
parent 803cb5558f
commit 2609f356cb
2 changed files with 1 additions and 46 deletions

View file

@ -60,10 +60,6 @@
static char *path[MAX_PATH] = { NULL };
static int npath = 0;
static int fgetline(FILE * f, char *buffer, size_t len);
static int stripcomment(char *s);
static char *stripblanks(char *s);
/* default base directory is /etc/apparmor.d, it can be overriden
with the -b option. */
@ -177,48 +173,6 @@ FILE *search_path(char *filename, char **fullpath)
return newf;
}
/* get a line from the file. If it is to long truncate it. */
static int fgetline(FILE * f, char *buffer, size_t len)
{
char *b = buffer;
int c;
while (((c = fgetc(f)) != EOF) && (c != '\n')
&& (strlen(buffer) < len - 1)) {
*b = c;
b++;
}
*b = '\0';
if (c != EOF)
return 1;
return 0;
}
/* If there is a comment null terminate the string,
return strlen of the stripped string*/
static int stripcomment(char *s)
{
char *t = s;
while (*s != '#' && *s != 0)
s++;
*s = 0;
return strlen(t);
}
static char *stripblanks(char *s)
{
char *c;
while (isspace(*s))
s++;
c = s;
while (!isspace(*s) && *s != 0)
s++;
*s = 0;
return c;
}
struct include_stack_t {
char *filename;
int lineno;

View file

@ -22,6 +22,7 @@
/* eliminates need to link with libfl */
%option noyywrap
%option noyy_top_state
%option nounput
%option stack