Lines Matching defs:opt

172 static int process_option __P((option_t *opt, char **argv, int sline));
173 static int n_arguments __P((option_t *opt));
184 opt_t opt;
393 option_t *opt;
407 opt = find_option(arg);
408 if (opt != NULL) {
409 int n = n_arguments(opt);
415 if (!process_option(opt, argv, 0))
457 option_t *opt;
506 opt = find_option(cmd);
507 if (opt != NULL) {
508 int n = n_arguments(opt);
517 if ((opt->flags & OPT_DEVEQUIV) && devnam_fixed) {
521 if (!process_option(opt, argv, sline))
631 option_t *opt;
642 opt = find_option(w->word);
643 if (opt != NULL) {
644 int n = n_arguments(opt);
656 if (!process_option(opt, argv, option_line))
692 if (bucket->opt.p->name != NULL) {
693 if ((strcmp(bucket->opt.p->name, name) == 0) &&
694 !(bucket->opt.p->flags & OPT_DISABLE)) {
695 return (bucket->opt.p);
708 process_option(opt, argv, sline)
709 option_t *opt;
718 if ((opt->flags & OPT_PREPASS) == 0 && prepass)
720 if ((opt->flags & OPT_INITONLY) && phase != PHASE_INITIALIZE) {
721 option_error("it's too late to use the '%s' option", opt->name);
724 if ((opt->flags & OPT_PRIV) && !privileged_option) {
726 opt->name);
729 if ((opt->flags & OPT_ENABLE) && !privileged_option &&
730 *(bool *)(opt->addr2) == 0) {
731 option_error("'%s' option is disabled", opt->name);
734 if ((opt->flags & OPT_PRIVFIX) && !privileged_option) {
735 struct option_info *ip = (struct option_info *) opt->addr2;
737 option_error("'%s' option cannot be overridden", opt->name);
742 switch (opt->type) {
744 v = opt->flags & OPT_VALUE;
745 *(bool *)(opt->addr) = (v != 0);
746 if ((opt->addr2 != NULL) && (opt->flags & OPT_A2COPY))
747 *(bool *)(opt->addr2) = (v != 0);
752 if ((opt->flags & OPT_NOARG) == 0) {
755 if ((((opt->flags & OPT_LLIMIT) && (iv < opt->lower_limit)) ||
756 ((opt->flags & OPT_ULIMIT) && (iv > opt->upper_limit))) &&
757 !((opt->flags & OPT_ZEROOK) && (iv == 0))) {
758 char *zok = (opt->flags & OPT_ZEROOK) ? " zero or" : "";
759 switch (opt->flags & OPT_LIMITS) {
762 opt->name, zok, opt->lower_limit);
766 opt->name, zok, opt->upper_limit);
770 opt->name, zok, opt->lower_limit, opt->upper_limit);
776 a = opt->flags & OPT_VALUE;
780 if (opt->flags & OPT_INC)
781 iv += *(int *)(opt->addr);
782 if ((opt->flags & OPT_NOINCR) && !privileged_option) {
783 int oldv = *(int *)(opt->addr);
785 if ((opt->flags & OPT_ZEROINF) && (iv == 0)) {
788 opt->name, oldv);
793 opt->name, oldv);
797 *(int *)(opt->addr) = iv;
798 if ((opt->addr2 != NULL) && (opt->flags & OPT_A2COPY))
799 *(int *)(opt->addr2) = iv;
803 if (opt->flags & OPT_NOARG) {
804 v = opt->flags & OPT_VALUE;
807 if (opt->flags & OPT_OR)
808 v |= *(u_int32_t *)(opt->addr);
809 *(u_int32_t *)(opt->addr) = v;
810 if ((opt->addr2 != NULL) && (opt->flags & OPT_A2COPY))
811 *(u_int32_t *)(opt->addr2) = v;
815 if (opt->flags & OPT_STATIC) {
816 (void) strlcpy((char *)(opt->addr), *argv, opt->upper_limit);
817 if ((opt->addr2 != NULL) && (opt->flags & OPT_A2COPY)) {
818 (void) strlcpy((char *)(opt->addr2), *argv, opt->upper_limit);
824 *(char **)(opt->addr) = sv;
825 if (opt->addr2 != NULL && (opt->flags & OPT_A2COPY))
826 *(char **)(opt->addr2) = sv;
832 parser = (int (*) __P((char **, option_t *))) opt->addr;
833 if (!(*parser)(argv, opt))
838 if (opt->addr2 != NULL) {
839 if (opt->flags & OPT_A2INFO) {
840 struct option_info *ip = (struct option_info *) opt->addr2;
844 } else if ((opt->flags & (OPT_A2COPY|OPT_ENABLE)) == 0)
845 *(bool *)(opt->addr2) = 1;
856 n_arguments(opt)
857 option_t *opt;
859 return ((opt->type == o_bool || opt->type == o_special_noarg ||
860 (opt->flags & OPT_NOARG)) ? 0 : 1);
895 add_options(opt)
896 option_t *opt;
904 for (sopt = opt; sopt->name != NULL; ++sopt, hash_tblcnt++) {
911 he->opt.p = sopt;
922 if (!(bucket->opt.p->flags & OPT_DISABLE) &&
923 strcmp(sopt->name, bucket->opt.p->name) == 0) {
926 bucket->opt.p->flags |= OPT_DISABLE;
948 option_t *opt;
950 if ((opt = find_option(name)) != NULL) {
951 opt->flags |= OPT_DISABLE;
953 return (opt);
981 (void) slprintf(opt_str, sizeof(opt_str), "%s", opt->name); \
982 if ((opt->type == o_int || opt->type == o_uint32) && \
983 !(opt->flags & OPT_NOARG)) { \
985 } else if (opt->type == o_string) { \
987 } else if (opt->type == o_special) { \
990 if (opt->flags & OPT_PRIV) { \
992 } else if (opt->flags & OPT_DISABLE) { \
995 (void) printf("%-26s%s\n", opt_str, opt->description); \
999 option_t *opt;
1009 for (opt = dummy_options; opt->name != NULL; ++opt) {
1024 sopt[sofar++].p = bucket->opt.p;
1030 opt = sopt[i].p;
1074 showhelp(argv, opt)
1076 option_t *opt;
1091 showversion(argv, opt)
1093 option_t *opt;
1488 readfile(argv, opt)
1490 option_t *opt;
1502 callfile(argv, opt)
1504 option_t *opt;
1559 setpassfilter(argv, opt)
1561 option_t *opt;
1578 setactivefilter(argv, opt)
1580 option_t *opt;
1598 noopt(argv, opt)
1600 option_t *opt;
1616 setdomain(argv, opt)
1618 option_t *opt;
1795 setnetmask(argv, opt)
1797 option_t *opt;
1924 setxonxoff(argv, opt)
1926 option_t *opt;
1946 setlogfile(argv, opt)
1948 option_t *opt;
1980 loadplugin(argv, opt)
1982 option_t *opt;