sgr-direct PoC: use ncdirect_supported_styles() to guide output

pull/1693/head
nick black 3 years ago committed by Nick Black
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…
Cancel
Save