summaryrefslogtreecommitdiff
path: root/scanopt.c
diff options
context:
space:
mode:
authorJohn Millaway <john43@users.sourceforge.net>2002-07-17 06:46:23 +0000
committerJohn Millaway <john43@users.sourceforge.net>2002-07-17 06:46:23 +0000
commit58d399341dc4d8a1da79a3636fb823e92b82c912 (patch)
tree6688a3617266590bac71c152b650bd072e3c81a3 /scanopt.c
parenta336daae24c230b9c5fbc82b5d5f8f10d90b6f6d (diff)
Fixed prototype/definition conflicts with "traditional" C in skeleton at request of gcc developer.
Removed duplicate prototypes in gen.c, sym.c, main.c. Added missing prototypes where needed. All functions in skeleton follow ISO C style protos and defs, instead of BOTH ISO and new-style. Skeleton now compiles cleanly under super-strict gcc flags. Flex itself almost compiles cleanly under strict flags.
Diffstat (limited to 'scanopt.c')
-rw-r--r--scanopt.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/scanopt.c b/scanopt.c
index fa42cf6..42c411d 100644
--- a/scanopt.c
+++ b/scanopt.c
@@ -39,6 +39,8 @@
#ifdef HAVE_STRCASECMP
#define STRCASECMP(a,b) strcasecmp(a,b)
#else
+static int STRCASECMP PROTO((const char*, const char*));
+
static int STRCASECMP(a,b)
const char* a;
const char* b;
@@ -76,6 +78,15 @@ struct _scanopt_t
};
/* Accessor functions. These WOULD be one-liners, but portability calls. */
+static const char* NAME PROTO((struct _scanopt_t *, int));
+static int PRINTLEN PROTO((struct _scanopt_t *, int));
+static int RVAL PROTO((struct _scanopt_t *, int));
+static int FLAGS PROTO((struct _scanopt_t *, int));
+static const char* DESC PROTO((struct _scanopt_t *, int));
+static int scanopt_err PROTO(( struct _scanopt_t *, int, int, int));
+static int matchlongopt PROTO((char*,char**,int*,char**,int*));
+static int find_opt PROTO(( struct _scanopt_t *, int, char *, int, int *, int* opt_offset));
+
static const char* NAME(s,i)
struct _scanopt_t *s; int i;
{
@@ -99,6 +110,7 @@ static int FLAGS(s,i)
{
return s->aux[i].flags;
}
+
static const char* DESC(s,i)
struct _scanopt_t *s; int i;
{
@@ -106,6 +118,8 @@ static const char* DESC(s,i)
}
#ifndef NO_SCANOPT_USAGE
+static int get_cols PROTO((void));
+
static int get_cols()
{
char *env;
@@ -246,10 +260,12 @@ int scanopt_usage (scanner,fp,usage)
usg_elem *store; /* array of preallocated elements. */
int store_idx=0;
usg_elem *ue;
- int maxlen[2] = {0,0};
+ int maxlen[2];
int desccol=0;
int print_run=0;
+ maxlen[0] = 0;
+ maxlen[1] = 0;
s = (struct _scanopt_t*)scanner;
@@ -408,8 +424,8 @@ int scanopt_usage (scanner,fp,usage)
PRINT_SPACES(fp,indent);nchars+=indent;
- /* Print, adding a ", " between aliases. */
- #define PRINT_IT(i) do{\
+/* Print, adding a ", " between aliases. */
+#define PRINT_IT(i) do{\
if(nwords++)\
nchars+=fprintf(fp,", ");\
nchars+=fprintf(fp,"%s",s->options[i].opt_fmt);\