mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 01:29:05 -04:00
sgr-direct PoC: use ncdirect_supported_styles() to guide output
This commit is contained in:
parent
a22414cd35
commit
c4e5ee2c38
@ -14,11 +14,19 @@ int main(void){
|
||||
}
|
||||
int e = 0;
|
||||
for(unsigned i = 0 ; i < (NCSTYLE_STRUCK << 1u) ; ++i){
|
||||
if(ncdirect_set_styles(nc, i)){
|
||||
if((ncdirect_supported_styles(nc) & i) == i){
|
||||
if(ncdirect_set_styles(nc, i)){
|
||||
ncdirect_stop(nc);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
printf("%08x ", i);
|
||||
}else{
|
||||
printf(" ");
|
||||
}
|
||||
if(ncdirect_set_styles(nc, NCSTYLE_NONE)){
|
||||
ncdirect_stop(nc);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
printf("%08x ", i);
|
||||
if(++e % 8 == 0){
|
||||
printf("\n");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user