| 1 | ! ============================================================================== |
| 2 | ! Readline buffer access macros for pooled vs non-pooled compilation |
| 3 | ! Use C preprocessor to handle buffer references cleanly |
| 4 | ! ============================================================================== |
| 5 | |
| 6 | #ifdef USE_MEMORY_POOL |
| 7 | ! Pooled memory - use string_ref%data pointers |
| 8 | #define BUFFER_DATA(state) state%buffer_ref%data |
| 9 | #define ORIGINAL_BUFFER_DATA(state) state%original_buffer_ref%data |
| 10 | #define KILL_BUFFER_DATA(state) state%kill_buffer_ref%data |
| 11 | #define COMPLETION_BUFFER_DATA(state) state%last_completion_buffer_ref%data |
| 12 | #define SEARCH_STRING_DATA(state) state%search_string_ref%data |
| 13 | #define VI_COMMAND_DATA(state) state%vi_command_buffer_ref%data |
| 14 | #define VI_YANK_DATA(state) state%vi_yank_buffer_ref%data |
| 15 | #define VI_SEARCH_DATA(state) state%vi_search_pattern_ref%data |
| 16 | #define MENU_PREFIX_DATA(state) state%menu_prefix_ref%data |
| 17 | #define PROCESS_NAME_DATA(state) state%selected_process_name_ref%data |
| 18 | #else |
| 19 | ! Traditional allocatable strings |
| 20 | #define BUFFER_DATA(state) state%buffer |
| 21 | #define ORIGINAL_BUFFER_DATA(state) state%original_buffer |
| 22 | #define KILL_BUFFER_DATA(state) state%kill_buffer |
| 23 | #define COMPLETION_BUFFER_DATA(state) state%last_completion_buffer |
| 24 | #define SEARCH_STRING_DATA(state) state%search_string |
| 25 | #define VI_COMMAND_DATA(state) state%vi_command_buffer |
| 26 | #define VI_YANK_DATA(state) state%vi_yank_buffer |
| 27 | #define VI_SEARCH_DATA(state) state%vi_search_pattern |
| 28 | #define MENU_PREFIX_DATA(state) state%menu_prefix |
| 29 | #define PROCESS_NAME_DATA(state) state%selected_process_name |
| 30 | #endif |
| 31 |