scanscreens

Traverses the internal list of screen structures and returns the screen name.

Library:LibC
Classification:Novell
Service:Screen Support

Syntax

  #include <screen.h> 
   
  scr_t scanscreens (
     void   **sequence,
     size_t   maxnamelen,
     char    *name );
  

Parameters

sequence

(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.

maxnamelen

(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.

name

(OUT) Points to the name of the screen.

Return Values

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.

Remarks

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.

See Also

Sample Code

  #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;
     }
  }