terminal_init(): * Initialize the terminal stuff */
| 266 | * Initialize the terminal stuff |
| 267 | */ |
| 268 | protected int |
| 269 | terminal_init(EditLine *el) |
| 270 | { |
| 271 | |
| 272 | el->el_terminal.t_buf = el_malloc(TC_BUFSIZE * |
| 273 | sizeof(*el->el_terminal.t_buf)); |
| 274 | if (el->el_terminal.t_buf == NULL) |
| 275 | return -1; |
| 276 | el->el_terminal.t_cap = el_malloc(TC_BUFSIZE * |
| 277 | sizeof(*el->el_terminal.t_cap)); |
| 278 | if (el->el_terminal.t_cap == NULL) |
| 279 | return -1; |
| 280 | el->el_terminal.t_fkey = el_malloc(A_K_NKEYS * |
| 281 | sizeof(*el->el_terminal.t_fkey)); |
| 282 | if (el->el_terminal.t_fkey == NULL) |
| 283 | return -1; |
| 284 | el->el_terminal.t_loc = 0; |
| 285 | el->el_terminal.t_str = el_malloc(T_str * |
| 286 | sizeof(*el->el_terminal.t_str)); |
| 287 | if (el->el_terminal.t_str == NULL) |
| 288 | return -1; |
| 289 | (void) memset(el->el_terminal.t_str, 0, T_str * |
| 290 | sizeof(*el->el_terminal.t_str)); |
| 291 | el->el_terminal.t_val = el_malloc(T_val * |
| 292 | sizeof(*el->el_terminal.t_val)); |
| 293 | if (el->el_terminal.t_val == NULL) |
| 294 | return -1; |
| 295 | (void) memset(el->el_terminal.t_val, 0, T_val * |
| 296 | sizeof(*el->el_terminal.t_val)); |
| 297 | (void) terminal_set(el, NULL); |
| 298 | terminal_init_arrow(el); |
| 299 | return 0; |
| 300 | } |
| 301 | |
| 302 | /* terminal_end(): |
| 303 | * Clean up the terminal stuff |
no test coverage detected