History

buffer commands in LIL

Paul Batchelor committed 5 years ago

Commit 93158fc1 parent b45a0c95 files · +78 −0Browse files

Showing the changes to nodes/buffer (2 of 5 files). Show all

Unified · Split

2 files
  1. nodes/buffer/buffer.c +41 −0
  2. nodes/buffer/config.mk +1 −0
nodes/buffer/buffer.c+41−0
@@ -0,0 +1,41 @@
1+#include <stdlib.h>
2+#include <stdio.h>
3+#include <string.h>
4+#include "lil/lil.h"
5+#include "patchwerk/patchwerk.h"
6+#include "core.h"
7+#include "sklil.h"
8+
9+static lil_value_t hold(lil_t lil, size_t argc, lil_value_t *argv)
10+{
11+ sk_core *core;
12+ int rc;
13+
14+ core = lil_get_data(lil);
15+
16+ rc = sk_core_hold(core);
17+
18+ SKLIL_ERROR_CHECK(lil, rc, "hold didn't work out.");
19+
20+ return NULL;
21+}
22+
23+static lil_value_t unhold(lil_t lil, size_t argc, lil_value_t *argv)
24+{
25+ sk_core *core;
26+ int rc;
27+
28+ core = lil_get_data(lil);
29+
30+ rc = sk_core_hold(core);
31+
32+ SKLIL_ERROR_CHECK(lil, rc, "unhold didn't work out.");
33+
34+ return NULL;
35+}
36+
37+void sklil_load_buffer(lil_t lil)
38+{
39+ lil_register(lil, "hold", hold);
40+ lil_register(lil, "unhold", unhold);
41+}
nodes/buffer/config.mk+1−0
@@ -0,0 +1 @@
1+OBJ+=nodes/buffer/buffer.o

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t