8000 treewide: add ul_ to parse_switch() function name · util-linux/util-linux@96895a4 · GitHub
[go: up one dir, main page]

Skip to content
Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 96895a4

Browse files
treewide: add ul_ to parse_switch() function name
Signed-off-by: Karel Zak <kzak@redhat.com>
1 parent b041bc9 commit 96895a4

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

include/strutils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ extern int isxdigit_strend(const char *str, const char **end);
6868
#define isxdigit_string(_s) isxdigit_strend(_s, NULL)
6969

7070

71-
extern int parse_switch(const char *arg, const char *errmesg, ...);
71+
extern int ul_parse_switch(const char *arg, const char *errmesg, ...);
7272

7373
#ifndef HAVE_MEMPCPY
7474
extern void *mempcpy(void *restrict dest, const void *restrict src, size_t n);

lib/strutils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,9 @@ int isxdigit_strend(const char *str, const char **end)
247247
}
248248

249249
/*
250-
* parse_switch(argv[i], "on", "off", "yes", "no", NULL);
250+
* ul_parse_switch(argv[i], "on", "off", "yes", "no", NULL);
251251
*/
252-
int parse_switch(const char *arg, const char *errmesg, ...)
252+
int ul_parse_switch(const char *arg, const char *errmesg, ...)
253253
{
254254
const char *a, *b;
255255
va_list ap;

sys-utils/eject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ static void parse_args(struct eject_control *ctl, int argc, char **argv)
207207
switch (c) {
208208
case 'a':
209209
ctl->a_option = 1;
210-
ctl->a_arg = parse_switch(optarg, _("argument error"),
210+
ctl->a_arg = ul_parse_switch(optarg, _("argument error"),
211211
"on", "off", "1", "0", NULL);
212212
break;
213213
case 'c':
@@ -229,7 +229,7 @@ static void parse_args(struct eject_control *ctl, int argc, char **argv)
229229
break;
230230
case 'i':
231231
ctl->i_option = 1;
232-
ctl->i_arg = parse_switch(optarg, _("argument error"),
232+
ctl->i_arg = ul_parse_switch(optarg, _("argument error"),
233233
"on", "off", "1", "0", NULL);
234234
break;
235235
case 'm':

sys-utils/losetup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ int main(int argc, char **argv)
818818
case 8000 OPT_DIO:
819819
use_dio = set_dio = 1;
820820
if (optarg)
821-
use_dio = parse_switch(optarg, _("argument error"), "on", "off", NULL);
821+
use_dio = ul_parse_switch(optarg, _("argument error"), "on", "off", NULL);
822822
if (use_dio)
823823
lo_flags |= LO_FLAGS_DIRECT_IO;
824824
break;

sys-utils/tunelp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,24 +189,24 @@ int main(int argc, char **argv)
189189
break;
190190
case 'a':
191191
cmds->op = LPABORT;
192-
cmds->val = parse_switch(optarg, _("argument error"), "on", "off", NULL);
192+
cmds->val = ul_parse_switch(optarg, _("argument error"), "on", "off", NULL);
193193
cmds->next = xmalloc(sizeof(struct command));
194194
cmds = cmds->next;
195195
cmds->next = NULL;
196196
break;
197197
case 'q':
198-
show_irq = parse_switch(optarg, _("argument error"), "on", "off", NULL);
198+
show_irq = ul_parse_switch(optarg, _("argument error"), "on", "off", NULL);
199199
break;
200200
case 'o':
201201
cmds->op = LPABORTOPEN;
202-
cmds->val = parse_switch(optarg, _("argument error"), "on", "off", NULL);
202+
cmds->val = ul_parse_switch(optarg, _("argument error"), "on", "off", NULL);
203203
cmds->next = xmalloc(sizeof(struct command));
204204
cmds = cmds->next;
205205
cmds->next = NULL;
206206
break;
207207
case 'C':
208208
cmds->op = LPCAREFUL;
209-
cmds->val = parse_switch(optarg, _("argument error"), "on", "off", NULL);
209+
cmds->val = ul_parse_switch(optarg, _("argument error"), "on", "off", NULL);
210210
cmds->next = xmalloc(sizeof(struct command));
211211
cmds = cmds->next;
212212
cmds->next = NULL;

term-utils/setterm.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -559,22 +559,22 @@ static void parse_option(struct setterm_control *ctl, int ac, char **av)
559559
break;
560560
case OPT_CURSOR:
561561
ctl->opt_cursor = set_opt_flag(ctl->opt_cursor);
562-
ctl->opt_cu_on = parse_switch(optarg, _("argument error"),
562+
ctl->opt_cu_on = ul_parse_switch(optarg, _("argument error"),
563563
"on", "off", NULL);
564564
break;
565565
case OPT_REPEAT:
566566
ctl->opt_repeat = set_opt_flag(ctl->opt_repeat);
567-
ctl->opt_rep_on = parse_switch(optarg, _("argument error"),
567+
ctl->opt_rep_on = ul_parse_switch(optarg, _("argument error"),
568568
"on", "off", NULL);
569569
break;
570570
case OPT_APPCURSORKEYS:
571571
ctl->opt_appcursorkeys = set_opt_flag(ctl->opt_appcursorkeys);
572-
ctl->opt_appck_on = parse_switch(optarg, _("argument error"),
572+
ctl->opt_appck_on = ul_parse_switch(optarg, _("argument error"),
573573
"on", "off", NULL);
574574
break;
575575
case OPT_LINEWRAP:
576576
ctl->opt_linewrap = set_opt_flag(ctl->opt_linewrap);
577-
ctl->opt_li_on = parse_switch(optarg, _("argument error"),
577+
ctl->opt_li_on = ul_parse_switch(optarg, _("argument error"),
578578
"on", "off", NULL);
579579
break;
580580
case OPT_DEFAULT:
@@ -598,32 +598,32 @@ static void parse_option(struct setterm_control *ctl, int ac, char **av)
598598
break;
599599
case OPT_INVERSESCREEN:
600600
ctl->opt_inversescreen = set_opt_flag(ctl->opt_inversescreen);
601-
ctl->opt_invsc_on = parse_switch(optarg, _("argument error"),
601+
ctl->opt_invsc_on = ul_parse_switch(optarg, _("argument error"),
602602
"on", "off", NULL);
603603
break;
604604
case OPT_BOLD:
605605
ctl->opt_bold = set_opt_flag(ctl->opt_bold);
606-
ctl->opt_bo_on = parse_switch(optarg, _("argument error"),
606+
ctl->opt_bo_on = ul_parse_switch(optarg, _("argument error"),
607607
"on", "off", NULL);
608608
break;
609609
case OPT_HALF_BRIGHT:
610610
ctl->opt_halfbright = set_opt_flag(ctl->opt_halfbright);
611-
ctl->opt_hb_on = parse_switch(optarg, _("argument error"),
611+
ctl->opt_hb_on = ul_parse_switch(optarg, _("argument error"),
612612
"on", "off", NULL);
613613
break;
614614
case OPT_BLINK:
615615
ctl->opt_blink = set_opt_flag(ctl->opt_blink);
616-
ctl->opt_bl_on = parse_switch(optarg, _("argument error"),
616+
ctl->opt_bl_on = ul_parse_switch(optarg, _("argument error"),
617617
"on", "off", NULL);
618618
break;
619619
case OPT_REVERSE:
620620
ctl->opt_reverse = set_opt_flag(ctl->opt_reverse);
621-
ctl->opt_re_on = parse_switch(optarg, _("argument error"),
621+
ctl->opt_re_on = ul_parse_switch(optarg, _("argument error"),
622622
"on", "off", NULL);
623623
break;
624624
case OPT_UNDERLINE:
625625
ctl->opt_underline = set_opt_flag(ctl->opt_underline);
626-
ctl->opt_un_on = parse_switch(optarg, _("argument error"),
626+
ctl->opt_un_on = ul_parse_switch(optarg, _("argument error"),
627627
"on", "off", NULL);
628628
break;
629629
case OPT_STORE:
@@ -632,7 +632,7 @@ static void parse_option(struct setterm_control *ctl, int ac, char **av)
632632
case OPT_CLEAR:
633633
ctl->opt_clear = set_opt_flag(ctl->opt_clear);
634634
if (optarg)
635-
ctl->opt_cl_all = parse_switch(optarg, _("argument error"),
635+
ctl->opt_cl_all = ul_parse_switch(optarg, _("argument error"),
636636
"all", "rest", NULL);
637637
else
638638
ctl->opt_cl_all = 1;
@@ -667,7 +667,7 @@ static void parse_option(struct setterm_control *ctl, int ac, char **av)
667667
break;
668668
case OPT_MSG:
669669
ctl->opt_msg = set_opt_flag(ctl->opt_msg);
670-
ctl->opt_msg_on = parse_switch(optarg, _("argument error"),
670+
ctl->opt_msg_on = ul_parse_switch(optarg, _("argument error"),
671671
"on", "off", NULL);
672672
break;
673673
case OPT_MSGLEVEL:

0 commit comments

Comments
 (0)
0