23 lines
575 B
C
23 lines
575 B
C
//---
|
|
// fxBoot:terminal:close - Close primitive for the terminal
|
|
//---
|
|
#include "fxBoot/terminal.h"
|
|
#include <gint/std/stdlib.h>
|
|
#include <gint/timer.h>
|
|
|
|
/* internal symbols */
|
|
extern struct terminal terminal;
|
|
|
|
/* terminal_close(): Uninitialize the terminal */
|
|
int terminal_close(void)
|
|
{
|
|
if (terminal.private.watermark != TERM_PRIVATE_WATERMARK)
|
|
return (-1);
|
|
if (terminal.private.timer.id >= 0)
|
|
timer_stop(terminal.private.timer.id);
|
|
if (terminal.buffer.data != NULL)
|
|
free(terminal.buffer.data);
|
|
terminal.private.watermark = TERM_PRIVATE_WATERMARK;
|
|
return (0);
|
|
}
|