version 1.174, 2019/03/14 21:27:26 |
version 1.175, 2019/03/14 21:31:43 |
|
|
#define FORMAT_QUOTE 0x8 |
#define FORMAT_QUOTE 0x8 |
#define FORMAT_LITERAL 0x10 |
#define FORMAT_LITERAL 0x10 |
#define FORMAT_EXPAND 0x20 |
#define FORMAT_EXPAND 0x20 |
#define FORMAT_SESSIONS 0x40 |
#define FORMAT_EXPANDTIME 0x40 |
#define FORMAT_WINDOWS 0x80 |
#define FORMAT_SESSIONS 0x80 |
#define FORMAT_PANES 0x100 |
#define FORMAT_WINDOWS 0x100 |
|
#define FORMAT_PANES 0x200 |
|
|
/* Entry in format tree. */ |
/* Entry in format tree. */ |
struct format_entry { |
struct format_entry { |
|
|
|
|
/* |
/* |
* Modifiers are a ; separated list of the forms: |
* Modifiers are a ; separated list of the forms: |
* l,m,C,b,d,t,q |
* l,m,C,b,d,t,q,E,T,S,W,P |
* =a |
* =a |
* =/a |
* =/a |
* =/a/ |
* =/a/ |
|
|
cp++; |
cp++; |
|
|
/* Check single character modifiers with no arguments. */ |
/* Check single character modifiers with no arguments. */ |
if (strchr("lmCbdtqESWP", cp[0]) != NULL && |
if (strchr("lmCbdtqETSWP", cp[0]) != NULL && |
format_is_end(cp[1])) { |
format_is_end(cp[1])) { |
format_add_modifier(&list, count, cp, 1, NULL, 0); |
format_add_modifier(&list, count, cp, 1, NULL, 0); |
cp++; |
cp++; |
|
|
case 'E': |
case 'E': |
modifiers |= FORMAT_EXPAND; |
modifiers |= FORMAT_EXPAND; |
break; |
break; |
|
case 'T': |
|
modifiers |= FORMAT_EXPANDTIME; |
|
break; |
case 'S': |
case 'S': |
modifiers |= FORMAT_SESSIONS; |
modifiers |= FORMAT_SESSIONS; |
break; |
break; |
|
|
/* Expand again if required. */ |
/* Expand again if required. */ |
if (modifiers & FORMAT_EXPAND) { |
if (modifiers & FORMAT_EXPAND) { |
new = format_expand(ft, value); |
new = format_expand(ft, value); |
|
free(value); |
|
value = new; |
|
} |
|
else if (modifiers & FORMAT_EXPANDTIME) { |
|
new = format_expand_time(ft, value, 0); |
free(value); |
free(value); |
value = new; |
value = new; |
} |
} |