Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
1ba6eea7
...
1ba6eea721a11d23f4d6f1a7996a4c879b60b8d6
authored
2003-11-04 14:32:51 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(mh_argp_parse): Changed prototype.
1 parent
6cd84cb1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
26 deletions
mh/mh_argp.c
mh/mh_getopt.h
mh/mh_argp.c
View file @
1ba6eea
...
...
@@ -95,7 +95,7 @@ my_argp_parse (struct argp *argp, int argc, char **argv, int flags,
}
int
mh_argp_parse
(
int
argc
,
char
**
argv
,
mh_argp_parse
(
int
*
pargc
,
char
**
pargv
[]
,
int
flags
,
struct
argp_option
*
option
,
struct
mh_option
*
mh_option
,
...
...
@@ -108,8 +108,8 @@ mh_argp_parse (int argc, char **argv,
int
index
;
int
extra
=
0
;
program_invocation_name
=
argv
[
0
];
p
=
strrchr
(
argv
[
0
],
'/'
);
program_invocation_name
=
(
*
pargv
)
[
0
];
p
=
strrchr
(
(
*
pargv
)
[
0
],
'/'
);
if
(
p
)
program_invocation_short_name
=
p
+
1
;
else
...
...
@@ -131,41 +131,42 @@ mh_argp_parse (int argc, char **argv,
p
=
mh_global_profile_get
(
program_invocation_short_name
,
NULL
);
if
(
p
)
{
int
_
argc
;
char
**
_
argv
;
int
argc
;
char
**
argv
;
int
xargc
;
char
**
xargv
;
int
i
,
j
;
argcv_get
(
p
,
""
,
NULL
,
&
xargc
,
&
xargv
);
_argc
=
argc
+
xargc
;
_argv
=
calloc
(
_argc
+
1
,
sizeof
*
_
argv
);
if
(
!
_
argv
)
argc
=
*
p
argc
+
xargc
;
argv
=
calloc
(
argc
+
1
,
sizeof
*
argv
);
if
(
!
argv
)
mh_err_memory
(
1
);
i
=
0
;
_argv
[
i
++
]
=
argv
[
0
];
argv
[
i
++
]
=
(
*
pargv
)
[
0
];
for
(
j
=
0
;
j
<
xargc
;
i
++
,
j
++
)
_argv
[
i
]
=
xargv
[
j
];
for
(
j
=
1
;
i
<
_argc
;
i
++
,
j
++
)
_argv
[
i
]
=
argv
[
j
];
_argv
[
i
]
=
NULL
;
mh_argv_preproc
(
_argc
,
_argv
,
&
data
);
my_argp_parse
(
&
argp
,
_argc
,
_argv
,
flags
,
&
index
,
&
data
);
free
(
_argv
);
extra
=
index
<
_argc
;
index
-=
xargc
;
if
(
index
<
0
)
index
=
argc
;
}
else
{
argv
[
i
]
=
xargv
[
j
];
for
(
j
=
1
;
i
<
argc
;
i
++
,
j
++
)
argv
[
i
]
=
(
*
pargv
)[
j
];
argv
[
i
]
=
NULL
;
mh_argv_preproc
(
argc
,
argv
,
&
data
);
my_argp_parse
(
&
argp
,
argc
,
argv
,
flags
,
&
index
,
&
data
);
extra
=
index
<
argc
;
*
pargc
=
argc
;
*
pargv
=
argv
;
free
(
xargv
);
}
else
{
mh_argv_preproc
(
*
pargc
,
*
pargv
,
&
data
);
my_argp_parse
(
&
argp
,
*
pargc
,
*
pargv
,
flags
,
&
index
,
&
data
);
extra
=
index
<
*
pargc
;
}
if
(
pindex
)
*
pindex
=
index
;
...
...
mh/mh_getopt.h
View file @
1ba6eea
...
...
@@ -178,7 +178,7 @@ struct mh_argp_data
void
mh_argv_preproc
__P
((
int
argc
,
char
**
argv
,
struct
mh_argp_data
*
data
));
int
mh_getopt
__P
((
int
argc
,
char
**
argv
,
struct
mh_option
*
mh_opt
,
const
char
*
doc
));
int
mh_argp_parse
__P
((
int
argc
,
char
**
argv
,
int
mh_argp_parse
__P
((
int
*
argc
,
char
**
argv
[]
,
int
flags
,
struct
argp_option
*
option
,
struct
mh_option
*
mh_option
,
...
...
Please
register
or
sign in
to post a comment