| 3887 | } |
| 3888 | |
| 3889 | staticfn boolean |
| 3890 | status_hilite_menu_add(int origfld) |
| 3891 | { |
| 3892 | int fld; |
| 3893 | int behavior; |
| 3894 | int lt_gt_eq; |
| 3895 | int clr = NO_COLOR, atr = HL_UNDEF; |
| 3896 | struct hilite_s hilite; |
| 3897 | unsigned long cond = 0UL; |
| 3898 | char colorqry[BUFSZ]; |
| 3899 | char attrqry[BUFSZ]; |
| 3900 | int retry = 0; |
| 3901 | |
| 3902 | choose_field: |
| 3903 | fld = origfld; |
| 3904 | if (fld == BL_FLUSH) { |
| 3905 | fld = status_hilite_menu_choose_field(); |
| 3906 | /* isn't this redundant given what follows? */ |
| 3907 | if (fld == BL_FLUSH) |
| 3908 | return FALSE; |
| 3909 | } |
| 3910 | |
| 3911 | if (fld == BL_FLUSH) |
| 3912 | return FALSE; |
| 3913 | |
| 3914 | colorqry[0] = '\0'; |
| 3915 | attrqry[0] = '\0'; |
| 3916 | |
| 3917 | memset((genericptr_t) &hilite, 0, sizeof (struct hilite_s)); |
| 3918 | hilite.next = (struct hilite_s *) 0; |
| 3919 | hilite.set = FALSE; /* mark it "unset" */ |
| 3920 | hilite.fld = fld; |
| 3921 | |
| 3922 | choose_behavior: |
| 3923 | behavior = status_hilite_menu_choose_behavior(fld); |
| 3924 | |
| 3925 | if (behavior == (BL_TH_NONE - 1)) { |
| 3926 | return FALSE; |
| 3927 | } else if (behavior == BL_TH_NONE) { |
| 3928 | if (origfld == BL_FLUSH) |
| 3929 | goto choose_field; |
| 3930 | return FALSE; |
| 3931 | } |
| 3932 | |
| 3933 | hilite.behavior = behavior; |
| 3934 | |
| 3935 | choose_value: |
| 3936 | if (retry++ > 5) { |
| 3937 | pline("That's enough tries."); |
| 3938 | return FALSE; |
| 3939 | } |
| 3940 | if (behavior == BL_TH_VAL_PERCENTAGE |
| 3941 | || behavior == BL_TH_VAL_ABSOLUTE) { |
| 3942 | char inbuf[BUFSZ], buf[BUFSZ]; |
| 3943 | anything aval; |
| 3944 | int val, dt; |
| 3945 | boolean gotnum = FALSE, percent = (behavior == BL_TH_VAL_PERCENTAGE); |
| 3946 | char *inp, *numstart; |
no test coverage detected