PageRenderTime 40ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/ncftp-3.2.5/ncftp/gl_getline.h

#
C Header | 73 lines | 37 code | 11 blank | 25 comment | 0 complexity | c6a2c2ce7d8a9971b332d5d17e0eb9cd MD5 | raw file
Possible License(s): AGPL-3.0
  1. /*
  2. * gl_getline.h
  3. *
  4. * Copyright (C) 1991, 1992, 1993 by Chris Thewalt (thewalt@ce.berkeley.edu)
  5. *
  6. * Permission to use, copy, modify, and distribute this software
  7. * for any purpose and without fee is hereby granted, provided
  8. * that the above copyright notices appear in all copies and that both the
  9. * copyright notice and this permission notice appear in supporting
  10. * documentation. This software is provided "as is" without express or
  11. * implied warranty.
  12. *
  13. * Thanks to the following people who have provided enhancements and fixes:
  14. * Ron Ueberschaer, Christoph Keller, Scott Schwartz, Steven List,
  15. * DaviD W. Sanderson, Goran Bostrom, Michael Gleason, Glenn Kasten,
  16. * Edin Hodzic, Eric J Bivona, Kai Uwe Rommel, Danny Quah, Ulrich Betzler
  17. */
  18. /*
  19. * Note: This version has been updated by
  20. * Mike Gleason (http://www.NcFTP.com/contact/)
  21. */
  22. #ifndef gl_getline_h
  23. #define gl_getline_h
  24. /* unix systems can #define POSIX to use termios, otherwise
  25. * the bsd or sysv interface will be used
  26. */
  27. #define GL_BUF_SIZE 2048
  28. /* Result codes available for gl_get_result() */
  29. #define GL_OK 0 /* Valid line of input entered */
  30. #define GL_EOF (-1) /* End of input */
  31. #define GL_INTERRUPT (-2) /* User hit Ctrl+C */
  32. #define GL_SUSPEND (-3) /* User hit Ctrl+Z */
  33. typedef int (*gl_in_hook_proc)(char *);
  34. typedef int (*gl_out_hook_proc)(char *);
  35. typedef int (*gl_tab_hook_proc)(char *, int, int *, size_t);
  36. typedef size_t (*gl_strlen_proc)(const char *);
  37. typedef char * (*gl_tab_completion_proc)(const char *, int);
  38. char *gl_getline(char *); /* read a line of input */
  39. void gl_dispose(void);
  40. void gl_setwidth(int); /* specify width of screen */
  41. void gl_setheight(int); /* specify height of screen */
  42. void gl_histadd(const char *const); /* adds entries to hist */
  43. void gl_tab_completion(gl_tab_completion_proc);
  44. char *gl_local_filename_completion_proc(const char *, int);
  45. void gl_set_home_dir(const char *homedir);
  46. void gl_histsavefile(const char *const path);
  47. void gl_histloadfile(const char *const path);
  48. char *gl_getpass(const char *const prompt, char *const pass, int dsize);
  49. int gl_get_result(void);
  50. #ifndef _gl_getline_c_
  51. extern gl_in_hook_proc gl_in_hook;
  52. extern gl_out_hook_proc gl_out_hook;
  53. extern gl_tab_hook_proc gl_tab_hook;
  54. extern gl_strlen_proc gl_strlen;
  55. extern gl_tab_completion_proc gl_completion_proc;
  56. extern int gl_filename_quoting_desired;
  57. extern const char *gl_filename_quote_characters;
  58. extern int gl_ellipses_during_completion;
  59. extern int gl_completion_exact_match_extra_char;
  60. extern char gl_buf[GL_BUF_SIZE];
  61. #endif /* ! _gl_getline_c_ */
  62. #endif /* gl_getline_h */