/* shchars.c */ /* compile me: cc -o shchars -lcurses shchars.c */ #include #include #include #include #include static unsigned char stoplist [256]; static void ruler (void); int main (void) { const char *term, *smacs, *rmacs, *acsc; int err, rc, i, j, c, len; term= getenv ("TERM"); if (term) { fprintf (stderr, "TERM=%s\n", term); } else { fprintf (stderr, "TERM variable not set, exiting\n"); return 4; } rc= setupterm ((char *)term, 1, &err); if (rc!=OK) { fprintf (stderr, "setupterm failed err=%d\n", err); return 4; } smacs= tigetstr ("smacs"); rmacs= tigetstr ("rmacs"); acsc = tigetstr ("acsc"); if (smacs==NULL || smacs==(char *)-1 || rmacs==NULL || rmacs==(char *)-1 || acsc ==NULL || acsc ==(char *)-1) { fprintf (stderr, "could not get smacs, rmacs or acsc\n"); return 8; } /* enable graphical characters */ for (len= strlen (acsc), i=0; i