Rizin
unix-like reverse engineering framework and cli tools
main.c File Reference
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <uv.h>

Go to the source code of this file.

Functions

int main ()
 

Variables

uv_loop_tloop
 
uv_tty_t tty
 

Function Documentation

◆ main()

int main ( void  )

Definition at line 8 of file main.c.

8  {
10 
13 
14  if (uv_guess_handle(1) == UV_TTY) {
16  uv_buf_t buf;
17  buf.base = "\033[41;37m";
18  buf.len = strlen(buf.base);
19  uv_write(&req, (uv_stream_t*) &tty, &buf, 1, NULL);
20  }
21 
23  uv_buf_t buf;
24  buf.base = "Hello TTY\n";
25  buf.len = strlen(buf.base);
26  uv_write(&req, (uv_stream_t*) &tty, &buf, 1, NULL);
28  return uv_run(loop, UV_RUN_DEFAULT);
29 }
#define NULL
Definition: cris-opc.c:27
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec req
Definition: sflib.h:128
voidpf void * buf
Definition: ioapi.h:138
Definition: unix.h:123
Definition: uv.h:525
uv_loop_t * loop
Definition: main.c:7
uv_tty_t tty
Definition: main.c:7
#define STDOUT_FILENO
Definition: private.h:41
@ UV_RUN_DEFAULT
Definition: uv.h:255
@ UV_TTY_MODE_NORMAL
Definition: uv.h:722
UV_EXTERN int uv_write(uv_write_t *req, uv_stream_t *handle, const uv_buf_t bufs[], unsigned int nbufs, uv_write_cb cb)
Definition: stream.c:1492
UV_EXTERN int uv_run(uv_loop_t *, uv_run_mode mode)
Definition: core.c:365
UV_EXTERN int uv_tty_set_mode(uv_tty_t *, uv_tty_mode_t mode)
Definition: tty.c:250
UV_EXTERN int uv_tty_reset_mode(void)
Definition: tty.c:378
UV_EXTERN uv_handle_type uv_guess_handle(uv_file file)
Definition: tty.c:315
UV_EXTERN int uv_tty_init(uv_loop_t *, uv_tty_t *, uv_file fd, int readable)
Definition: tty.c:123
UV_EXTERN uv_loop_t * uv_default_loop(void)
Definition: uv-common.c:763

References loop, NULL, req, STDOUT_FILENO, tty, uv_default_loop(), uv_guess_handle(), uv_run(), UV_RUN_DEFAULT, uv_tty_init(), UV_TTY_MODE_NORMAL, uv_tty_reset_mode(), uv_tty_set_mode(), and uv_write().

Variable Documentation

◆ loop

uv_loop_t* loop

Definition at line 6 of file main.c.

◆ tty