File: stdin_input.c

package info (click to toggle)
termpaint 0.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,740 kB
  • sloc: cpp: 40,344; ansic: 10,323; python: 402; sh: 36; makefile: 14
file content (21 lines) | stat: -rw-r--r-- 493 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// SPDX-License-Identifier: BSL-1.0
#include <stdint.h>
#include <stddef.h>
#include <unistd.h>

#include "../termpaint_input.h"

void null_callback(void *data, termpaint_event *event) {
}


int main() {
    char buff[10000];
    int amount = read(0, buff, 10000);

    termpaint_input *input_ctx = termpaint_input_new();
    termpaint_input_set_event_cb(input_ctx, null_callback, 0);
    termpaint_input_add_data(input_ctx, buff, amount);
    termpaint_input_free(input_ctx);
    return 0;
}