… | |
… | |
33 | |
33 | |
34 | /* place holders used for parsing command-line options */ |
34 | /* place holders used for parsing command-line options */ |
35 | #define Optflag_Reverse 0x40000000UL |
35 | #define Optflag_Reverse 0x40000000UL |
36 | #define Optflag_Boolean 0x80000000UL |
36 | #define Optflag_Boolean 0x80000000UL |
37 | #define Optflag_mask 0x3fffffffUL |
37 | #define Optflag_mask 0x3fffffffUL |
38 | |
|
|
39 | /* #define DEBUG_RESOURCES */ |
|
|
40 | |
38 | |
41 | /*{{{ monolithic option/resource structure: */ |
39 | /*{{{ monolithic option/resource structure: */ |
42 | /* |
40 | /* |
43 | * `string' options MUST have a usage argument |
41 | * `string' options MUST have a usage argument |
44 | * `switch' and `boolean' options have no argument |
42 | * `switch' and `boolean' options have no argument |
… | |
… | |
218 | #if ENABLE_FRILLS |
216 | #if ENABLE_FRILLS |
219 | RSTRG (Rs_transient_for, "transient-for", "windowid"), |
217 | RSTRG (Rs_transient_for, "transient-for", "windowid"), |
220 | BOOL (Rs_override_redirect, "override-redirect", "override-redirect", Opt_override_redirect, "set override-redirect on the terminal window"), |
218 | BOOL (Rs_override_redirect, "override-redirect", "override-redirect", Opt_override_redirect, "set override-redirect on the terminal window"), |
221 | STRG (Rs_pty_fd, NULL, "pty-fd", "fileno", "file descriptor of pty to use"), |
219 | STRG (Rs_pty_fd, NULL, "pty-fd", "fileno", "file descriptor of pty to use"), |
222 | BOOL (Rs_hold, "hold", "hold", Opt_hold, "retain window after shell exit"), |
220 | BOOL (Rs_hold, "hold", "hold", Opt_hold, "retain window after shell exit"), |
|
|
221 | STRG (Rs_depth, "depth", "depth", "number", "depth of visual to request"), |
223 | STRG (Rs_ext_bwidth, "externalBorder", "w", "number", "external border in pixels"), |
222 | STRG (Rs_ext_bwidth, "externalBorder", "w", "number", "external border in pixels"), |
224 | STRG (Rs_ext_bwidth, NULL, "bw", NULL, NULL), |
223 | STRG (Rs_ext_bwidth, NULL, "bw", NULL, NULL), |
225 | STRG (Rs_ext_bwidth, NULL, "borderwidth", NULL, NULL), |
224 | STRG (Rs_ext_bwidth, NULL, "borderwidth", NULL, NULL), |
226 | STRG (Rs_int_bwidth, "internalBorder", "b", "number", "internal border in pixels"), |
225 | STRG (Rs_int_bwidth, "internalBorder", "b", "number", "internal border in pixels"), |
227 | BOOL (Rs_borderLess, "borderLess", "bl", Opt_borderLess, "borderless window"), |
226 | BOOL (Rs_borderLess, "borderLess", "bl", Opt_borderLess, "borderless window"), |
… | |
… | |
361 | "8bitctrls," |
360 | "8bitctrls," |
362 | #endif |
361 | #endif |
363 | #if defined(ENABLE_FRILLS) |
362 | #if defined(ENABLE_FRILLS) |
364 | "frills," |
363 | "frills," |
365 | #endif |
364 | #endif |
366 | #if defined(PREFER_24BIT) |
|
|
367 | "24bit," |
|
|
368 | #endif |
|
|
369 | #if defined(SELECTION_SCROLLING) |
365 | #if defined(SELECTION_SCROLLING) |
370 | "selectionscrolling," |
366 | "selectionscrolling," |
371 | #endif |
367 | #endif |
372 | #if MOUSE_WHEEL |
368 | #if MOUSE_WHEEL |
373 | "wheel," |
369 | "wheel," |
… | |
… | |
492 | { |
488 | { |
493 | unsigned int entry, longopt = 0; |
489 | unsigned int entry, longopt = 0; |
494 | const char *flag, *opt; |
490 | const char *flag, *opt; |
495 | |
491 | |
496 | opt = argv[i]; |
492 | opt = argv[i]; |
497 | #ifdef DEBUG_RESOURCES |
493 | |
498 | fprintf (stderr, "argv[%d] = %s: ", i, opt); |
|
|
499 | #endif |
|
|
500 | if (*opt == '-') |
494 | if (*opt == '-') |
501 | { |
495 | { |
502 | flag = On; |
496 | flag = On; |
503 | if (*++opt == '-') |
497 | if (*++opt == '-') |
504 | longopt = *opt++; /* long option */ |
498 | longopt = *opt++; /* long option */ |
… | |
… | |
545 | rs[optList[entry].doff] = flag == On && argv[i+1] |
539 | rs[optList[entry].doff] = flag == On && argv[i+1] |
546 | ? argv[++i] : 0; |
540 | ? argv[++i] : 0; |
547 | } |
541 | } |
548 | else |
542 | else |
549 | { /* boolean value */ |
543 | { /* boolean value */ |
550 | #ifdef DEBUG_RESOURCES |
|
|
551 | fprintf (stderr, "boolean (%s,%s) = %s\n", |
|
|
552 | optList[entry].opt, optList[entry].kw, flag); |
|
|
553 | #endif |
|
|
554 | set_option (optList[entry].flag & Optflag_mask, flag == On); |
544 | set_option (optList[entry].flag & Optflag_mask, flag == On); |
555 | |
545 | |
556 | if (optList[entry].doff != -1) |
546 | if (optList[entry].doff != -1) |
557 | rs[optList[entry].doff] = flag; |
547 | rs[optList[entry].doff] = flag; |
558 | } |
548 | } |