readline.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. *
  4. * BlueZ - Bluetooth protocol stack for Linux
  5. *
  6. * Copyright (C) 1987-2011 Free Software Foundation, Inc.
  7. *
  8. *
  9. */
  10. #ifndef _READLINE_H_
  11. #define _READLINE_H_
  12. typedef void (*rl_vcpfunc_t)(char *c);
  13. typedef void (*rl_compdisp_func_t)(char **c, int i, int j);
  14. typedef char *(*rl_compentry_func_t)(const char *c, int i);
  15. typedef char **(*rl_completion_func_t)(const char *c, int i, int j);
  16. #define RL_STATE_DONE 0x1000000
  17. #define RL_ISSTATE(x) (rl_readline_state & (x))
  18. static int rl_end;
  19. static int rl_point;
  20. static int rl_readline_state;
  21. static int rl_erase_empty_line;
  22. static int rl_attempted_completion_over;
  23. static char *rl_prompt;
  24. static char *rl_line_buffer;
  25. static rl_compdisp_func_t rl_completion_display_matches_hook;
  26. static rl_completion_func_t rl_attempted_completion_function;
  27. static inline void rl_callback_handler_install(const char *c, rl_vcpfunc_t f)
  28. {
  29. printf("readline not available\n");
  30. exit(1);
  31. }
  32. static inline int rl_set_prompt(const char *c)
  33. {
  34. return -1;
  35. }
  36. static inline void rl_replace_line(const char *c, int i)
  37. {
  38. }
  39. static inline void rl_redisplay(void)
  40. {
  41. }
  42. static inline char **rl_completion_matches(const char *c, rl_compentry_func_t f)
  43. {
  44. return NULL;
  45. }
  46. static inline int rl_insert_text(const char *c)
  47. {
  48. return -1;
  49. }
  50. static inline int rl_crlf(void)
  51. {
  52. return -1;
  53. }
  54. static inline void rl_callback_read_char(void)
  55. {
  56. }
  57. static inline int rl_message(const char *c, ...)
  58. {
  59. return -1;
  60. }
  61. static inline void rl_callback_handler_remove(void)
  62. {
  63. }
  64. static inline char *rl_copy_text(int i, int j)
  65. {
  66. return NULL;
  67. }
  68. static inline void rl_save_prompt(void)
  69. {
  70. }
  71. static inline void rl_restore_prompt(void)
  72. {
  73. }
  74. static inline int rl_forced_update_display(void)
  75. {
  76. return -1;
  77. }
  78. #endif