Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
5f921c7f
Commit
5f921c7f
authored
Oct 05, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make_xftmpl: Avoid using getopt().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e0ef1224
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
33 deletions
+25
-33
make_xftmpl.c
tools/make_xftmpl.c
+25
-33
No files found.
tools/make_xftmpl.c
View file @
5f921c7f
...
...
@@ -25,9 +25,6 @@
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_GETOPT_H
# include <getopt.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
...
...
@@ -91,8 +88,6 @@ static const struct keyword reserved_words[] = {
{
"WORD"
,
TOKEN_WORD
}
};
extern
int
getopt
(
int
argc
,
char
*
const
*
argv
,
const
char
*
optstring
);
static
BOOL
option_header
;
static
char
*
option_inc_var_name
=
NULL
;
static
char
*
option_inc_size_name
=
NULL
;
...
...
@@ -419,50 +414,47 @@ static void usage(void)
program_name
);
}
static
char
**
parse_options
(
int
argc
,
char
**
argv
)
static
void
option_callback
(
int
optc
,
char
*
optarg
)
{
int
optc
;
while
((
optc
=
getopt
(
argc
,
argv
,
"hHi:o:s:"
))
!=
-
1
)
switch
(
optc
)
{
switch
(
optc
)
{
case
'h'
:
usage
();
exit
(
0
)
;
case
'H'
:
option_header
=
TRUE
;
break
;
case
'i'
:
option_header
=
TRUE
;
option_inc_var_name
=
xstrdup
(
optarg
);
break
;
case
'o'
:
option_outfile_name
=
xstrdup
(
optarg
);
break
;
case
's'
:
option_inc_size_name
=
xstrdup
(
optarg
);
break
;
}
case
'h'
:
usage
();
exit
(
0
);
case
'H'
:
option_header
=
TRUE
;
break
;
case
'i'
:
option_header
=
TRUE
;
option_inc_var_name
=
xstrdup
(
optarg
);
break
;
case
'o'
:
option_outfile_name
=
xstrdup
(
optarg
)
;
break
;
case
's'
:
option_inc_size_name
=
xstrdup
(
optarg
)
;
break
;
case
'?'
:
fprintf
(
stderr
,
"%s: %s
\n
"
,
program_name
,
optarg
)
;
exit
(
1
);
}
return
&
argv
[
optind
];
}
int
main
(
int
argc
,
char
**
argv
)
{
char
header
[
16
];
char
**
args
;
struct
strarray
args
;
char
*
header_name
=
NULL
;
program_name
=
argv
[
0
];
args
=
parse_options
(
argc
,
argv
);
infile_name
=
*
args
++
;
if
(
!
infile_name
||
*
args
)
args
=
parse_options
(
argc
,
argv
,
"hHi:o:s:"
,
NULL
,
0
,
option_callback
);
if
(
!
args
.
count
)
{
usage
();
return
1
;
}
infile_name
=
args
.
str
[
0
];
infile
=
stdin
;
outfile
=
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment