extern bool ipset_match_envopt(const char *arg, const char * const name[]);
extern void ipset_shift_argv(int *argc, char *argv[], int from);
extern void ipset_port_usage(void);
+extern int ipset_parse_file(struct ipset_session *s, int opt, const char *str);
#endif /* LIBIPSET_UI_H */
}
int
-ipset_parse_file(struct ipset_session *session UNUSED,
+ipset_parse_file(struct ipset_session *s UNUSED,
int opt UNUSED, const char *str)
{
if (filename != NULL)
return 0;
}
+static
int __attribute__ ((format (printf, 1, 2)))
ipset_print_file(const char *fmt, ...)
{
{
int ret = 0;
char *c;
- FILE *fread = stdin;
+ FILE *rfd = stdin;
/* Initialize newargv/newargc */
newargc = 0;
"Cannot open %s for reading: %s",
filename, strerror(errno));
}
- fread = fd;
+ rfd = fd;
}
- while (fgets(cmdline, sizeof(cmdline), fread)) {
+ while (fgets(cmdline, sizeof(cmdline), rfd)) {
restore_line++;
c = cmdline;
while (isspace(c[0]))
* -! -exist
*/
-int
-ipset_parse_file(struct ipset_session *session,
- int opt, const char *str);
-
const struct ipset_envopts ipset_envopts[] = {
{ .name = { "-o", "-output" },
.has_arg = IPSET_MANDATORY_ARG, .flag = IPSET_OPT_MAX,