Advertisement
P22DX

ncurses_ffi.php

Jun 11th, 2020
897
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1. <?php
  2.  
  3. $ncurses = FFI::cdef(<<< CDEF
  4. void initscr();
  5. void *newwin(int width, int height, int start, ...);
  6. void box(void *win, char text, ...);
  7. void refresh();
  8. void touchwin(void *win);
  9. void wrefresh(void *win);
  10. void getchar();
  11. void endwin();
  12.  
  13. CDEF,
  14. 'libncurses.so.5');
  15.  
  16. $ncurses->initscr();
  17. $window = $ncurses->newwin(10, 10, 1, 1);
  18. $ncurses->box(($window), '*', '*');
  19. $ncurses->refresh();
  20. $ncurses->touchwin(($window));
  21. $ncurses->getchar();
  22. $ncurses->endwin();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement