ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/xdefaults.C
(Generate patch)

Comparing rxvt-unicode/src/xdefaults.C (file contents):
Revision 1.97 by ayin, Tue May 1 09:34:07 2007 UTC vs.
Revision 1.99 by ayin, Tue May 1 21:10:04 2007 UTC

54#define RSTRG(rsp, kw, arg) \ 54#define RSTRG(rsp, kw, arg) \
55 {0, 0, (rsp), (kw), NULL, (arg), NULL} 55 {0, 0, (rsp), (kw), NULL, (arg), NULL}
56 56
57/* BOOL () - regular boolean `-/+' flag */ 57/* BOOL () - regular boolean `-/+' flag */
58#define BOOL(rsp, kw, opt, option, flag, desc) \ 58#define BOOL(rsp, kw, opt, option, flag, desc) \
59 { option ## _idx, (Optflag_Boolean | (flag)), (rsp), (kw), (opt), NULL, (desc)} 59 { (option), (Optflag_Boolean | (flag)), (rsp), (kw), (opt), NULL, (desc)}
60 60
61/* SWCH () - `-' flag */ 61/* SWCH () - `-' flag */
62#define SWCH(opt, option, flag, desc) \ 62#define SWCH(opt, option, flag, desc) \
63 { option ## _idx, (flag), -1, NULL, (opt), NULL, (desc)} 63 { (option), (flag), -1, NULL, (opt), NULL, (desc)}
64 64
65/* convenient macros */ 65/* convenient macros */
66#define optList_strlen(i) \ 66#define optList_strlen(i) \
67 (optList[i].flag ? 0 : (optList[i].arg ? strlen (optList[i].arg) : 1)) 67 (optList[i].flag ? 0 : (optList[i].arg ? strlen (optList[i].arg) : 1))
68#define optList_isBool(i) \ 68#define optList_isBool(i) \
74 74
75static const struct 75static const struct
76 { 76 {
77 const uint8_t index; /* Option index */ 77 const uint8_t index; /* Option index */
78 const uint8_t flag; /* Option flag */ 78 const uint8_t flag; /* Option flag */
79 const int doff; /* data offset */ 79 const int16_t doff; /* resource value index or -1 */
80 const char *kw; /* keyword */ 80 const char *kw; /* keyword */
81 const char *opt; /* option */ 81 const char *opt; /* option */
82 const char *arg; /* argument */ 82 const char *arg; /* argument */
83 const char *desc; /* description */ 83 const char *desc; /* description */
84 } 84 }
549 rs[optList[entry].doff] = flag == resval_on ? argv[++i] : resval_undef; 549 rs[optList[entry].doff] = flag == resval_on ? argv[++i] : resval_undef;
550 } 550 }
551 } 551 }
552 else 552 else
553 { /* boolean value */ 553 { /* boolean value */
554 set_option (1UL << optList[entry].index, flag == resval_on); 554 set_option (optList[entry].index, flag == resval_on);
555 555
556 if (optList[entry].doff != -1) 556 if (optList[entry].doff != -1)
557 rs[optList[entry].doff] = flag; 557 rs[optList[entry].doff] = flag;
558 } 558 }
559 } 559 }
827 || strcasecmp (p, "1") == 0; 827 || strcasecmp (p, "1") == 0;
828 828
829 if (optList_isReverse (entry)) 829 if (optList_isReverse (entry))
830 s = !s; 830 s = !s;
831 831
832 set_option (1UL << optList[entry].index, s); 832 set_option (optList[entry].index, s);
833 } 833 }
834 } 834 }
835 } 835 }
836 836
837 /* 837 /*

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines