WinTer 0.1.1
Windows Terminal Emulator
Loading...
Searching...
No Matches
main.c
Go to the documentation of this file.
1
8
9#include "base/base_macros.h"
10#include "pty.h"
11#include "base/base_types.h"
12
13#include <stdio.h>
14#include <stdlib.h>
15
23int
24main(int argc, char *argv[])
25{
26#if BUILD_DEBUG
27 printf("Winter Terminal Debug Build \n");
29#endif
30
31 ASSERT_NOT_NULL(argv);
32 (void)argc;
33
34 PTY_State pty = {0};
35
36 printf("Starting Winter Terminal...\n");
37
38 if (!pty_init(&pty, 80, 24)) {
39 (void)fprintf(stderr, "Fatal: Could not initialize Pseudo Console API.\n");
40 return EXIT_FAILURE;
41 }
42
43 printf("ConPTY initialized successfully.\n");
44
45 b32 is_running = true;
46 u32 frame_count = 0;
47
48 while (is_running) {
49 // TODO: Spawning the shell and message pumping logic goes here.
50
51 frame_count++;
52
53 // Mock exit condition to prevent an infinite loop in this skeleton
54 if (frame_count >= 5) {
55 is_running = false;
56 }
57 }
58
59 pty_cleanup(&pty);
60 printf("Shutting down gracefully.\n");
61
62 return EXIT_SUCCESS;
63}
Compile-time context detection, compiler abstractions, math utilities, and intrusive data structure m...
Core type definitions and fixed-width aliases.
uint32_t u32
Definition base_types.h:24
#define ASSERT_NOT_NULL(ptr)
Asserts that a given pointer is not NULL.
static void print_context_info(void)
Prints OS, architecture, compiler, endianness, build, and C standard to stdout.
struct pty_state_t PTY_State
Encapsulates the OS-level state of an active Pseudo Console session.
b32 pty_init(struct pty_state_t *state, u16 columns, u16 rows)
Initializes a Pseudo Console and establishes bidirectional communication pipes.
Definition pty.c:50
void pty_cleanup(struct pty_state_t *state)
Terminates the Pseudo Console session and releases all active system handles.
Definition pty.c:260
int32_t b32
Definition base_types.h:75
Pseudo Console (PTY) lifecycle, stream management, and shell process spawning.
int main(void)
Definition main.c:8