Implement streams IPC mechanism
All checks were successful
Build documentation / build-and-deploy (push) Successful in 3m47s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 3m47s
This commit is contained in:
10
ce/edit.c
10
ce/edit.c
@@ -14,6 +14,7 @@
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <streams.h>
|
||||
#include <string.h>
|
||||
#include <system.h>
|
||||
#include <tcursor.h>
|
||||
@@ -231,10 +232,15 @@ void edit_start (const char* volume, const char* file_path, const char* text, si
|
||||
(int)(editor.cursor.line - editor.row_offset) + 1,
|
||||
(int)(editor.cursor.col - editor.col_offset) + 1 + (int)gutter_width);
|
||||
|
||||
mail_send (process_get_exec_pgid (), backbuffer, bbptr - backbuffer);
|
||||
stream_write (process_get_pgid (), STREAM_OUT, backbuffer, bbptr - backbuffer);
|
||||
|
||||
uint8_t ch = 0;
|
||||
mail_receive (&ch, 1);
|
||||
for (;;) {
|
||||
if (stream_read (process_get_pgid (), STREAM_IN, &ch, 1) > 0)
|
||||
break;
|
||||
else
|
||||
sched ();
|
||||
}
|
||||
|
||||
switch (ch) {
|
||||
case '\b':
|
||||
|
||||
Reference in New Issue
Block a user