Mercurial
annotate gara/main.c @ 279:b3b547563ec7
Add Google connector service and agent wiki
Implement the C/Seobeo Google Drive and Gmail connector with encrypted OAuth storage, Zenbu authentication, browser testing, AI tool discovery, chunked HTTP decoding, and Bazel coverage. Consolidate repository guidance into progressive wiki documentation and enforce arena-first allocation for new first-party C code.
Co-authored-by: Copilot <[email protected]>
Copilot-Session: 84c338fd-0939-4bb3-b7f3-1062eb213e5d
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Mon, 17 Aug 2026 22:22:36 -0700 |
| parents | 19cccf6e866a |
| children |
| rev | line source |
|---|---|
|
45
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
1 #include "seobeo/seobeo.h" |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
2 #include "stdio.h" |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
3 |
| 91 | 4 void HandleClientRequest(Seobeo_Handle *p_cli_handle) |
| 5 { | |
|
45
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
6 char *hello = "Hello good sir"; |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
7 Seobeo_Handle_Queue(p_cli_handle, (uint8_t*)hello, 14); |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
8 Seobeo_Handle_Flush(p_cli_handle); |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
9 |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
10 while (1) |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
11 { |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
12 int n = Seobeo_Handle_Read(p_cli_handle); |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
13 if (n > 0) |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
14 { |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
15 printf(p_cli_handle->read_buffer); |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
16 Seobeo_Handle_Consume(p_cli_handle, n); |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
17 } |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
18 } |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
19 } |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
20 |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
21 int main() |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
22 { |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
23 |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
24 printf("Server initializing\n"); |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
25 const char *PORT = "3322"; |
|
66
a0f0ad5e42eb
[Misc] taking out capital P stuff.
June Park <parkjune1995@gmail.com>
parents:
45
diff
changeset
|
26 Seobeo_Handle *server = Seobeo_Stream_Handle_Server_Create(NULL, PORT); |
|
45
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
27 |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
28 printf("Server running\n"); |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
29 while (1) |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
30 { |
|
66
a0f0ad5e42eb
[Misc] taking out capital P stuff.
June Park <parkjune1995@gmail.com>
parents:
45
diff
changeset
|
31 Seobeo_Handle *p_cli_handle = |
|
45
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
32 Seobeo_Stream_Handle_Server_Accept(server); |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
33 if (!p_cli_handle) continue; |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
34 |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
35 if (fork() == 0) |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
36 { |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
37 HandleClientRequest(p_cli_handle); |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
38 _exit(0); |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
39 } |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
40 } |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
41 |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
42 return 0; |
|
ac8626c7859c
[Gara] Re-writing basic logic in C and hoping that I can import that into Java.
MrJuneJune <me@mrjunejune.com>
parents:
diff
changeset
|
43 } |