home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / compat / stdlib / getlongp.txh < prev    next >
Encoding:
Text File  |  1995-07-23  |  851 b   |  32 lines

  1. @node getlongpass, misc
  2. @subheading Syntax
  3.  
  4. @example
  5. #include <stdlib.h>
  6.  
  7. int  getlongpass(const char *prompt, char *password, int max_length)
  8. @end example
  9.  
  10. @subheading Description
  11.  
  12. This function reads up to a Newline (CR or LF) or EOF (Ctrl-D or Ctrl-Z)
  13. from the standard input, without an echo, after prompting with a
  14. null-terminated string @var{prompt}.  It puts a null-terminated string of
  15. at most @var{max_length - 1} first characters typed by the user into a
  16. buffer pointed to by @var{password}.  Pressing Ctrl-C or Ctrl-Break will
  17. cause the calling program to @code{exit(1)}. 
  18.  
  19. @subheading Return Value
  20.   
  21. Zero if successfull, -1 on error (and @var{errno} is set to and
  22. appropriate value.
  23.  
  24. @subheading Example
  25.  
  26. @example
  27. char password[MAX_PASS];
  28.  
  29. (void)getlongpass("Password: ", password, MAX_PASS);
  30. @end example
  31.  
  32.