Traverses the internal list of screen structures and returns the screen name.
#include <screen.h> scr_t scanscreens ( void **sequence, size_t maxnamelen, char *name );
(IN/OUT) Points to a value used in scanning the next screen. On the first call, set this parameter to point to NULL. On subsequent calls, use the returned value.
(IN) Specifies the size of thebuffer for the name parameter. To return valid names for all screens, set this parameter to MAX_SCREEN_STRING_LEN + 1. To not return the name of the screens, set the name parameter to NULL.
(OUT) Points to the name of the screen.
If successful, returns the ID of the first screen. On subsequent calls, returns the ID of the next screen. Returns NULL when there are no more screens to display.
If unsuccessful, returns NULL and sets errno.
Management utilities use this function to display the names of the current screens. It needs to be called once for each screen until NULL is returned. If screens are created or destroyed while calling this function, the resulting list can be truncated or missing screens.
#include <stdio.h> #include <screen.h> int main ( int argc, char *argv[] ) { int count = 0; char name[MAX_SCREEN_STRING_LEN+1]; void *sequence = (void *) NULL; scr_t scr; setscreenmode(SCR_NO_MODE); while (scr = scanscreens(&sequence, sizeof(name), name)) { printf("0x%08x: \"%s\"\n", scr, name); if (count++ > 20) break; } }