PatchworkOS
Loading...
Searching...
No Matches
main.c
Go to the documentation of this file.
1#include <stdlib.h>
2
3#include "terminal.h"
4
5int main(void)
6{
7 display_t* disp = display_new();
8 if (disp == NULL)
9 {
10 return EXIT_FAILURE;
11 }
12
13 window_t* term = terminal_new(disp);
14 if (term == NULL)
15 {
16 display_free(disp);
17 return EXIT_FAILURE;
18 }
19
20 terminal_loop(term);
21
22 window_free(term);
23 display_free(disp);
24 return 0;
25}
void display_free(display_t *disp)
Free a display connection.
Definition display.c:113
display_t * display_new(void)
Create a new display connection.
Definition display.c:36
void window_free(window_t *win)
Free a window.
Definition window.c:415
#define NULL
Pointer error value.
Definition NULL.h:23
void terminal_loop(window_t *win)
Terminal main loop.
Definition terminal.c:702
window_t * terminal_new(display_t *disp)
Create a new terminal window.
Definition terminal.c:674
int main()
Definition main.c:97
#define EXIT_FAILURE
Definition stdlib.h:47
Opaque display structure.
Definition internal.h:61
Opaque window structure.
Definition internal.h:44