thanks. Anyway I was looking for some C code, so that I can make
bindings for higher level languages as Python.
You have already some C code, because tn5250 is really lib5250 plus several
demo applications.
For example, you can do this:
Tn5250Terminal *t = tn5250_new(Tn5250Terminal, 1);
t->data = tn5250_new(struct _Tn5250TerminalPrivate, 1);
t->data->xxxx = yyyy;
t->conn_fd = -1;
t->init = my_terminal_init;
t->term = my_terminal_term;
t->destroy = my_terminal_destroy;
t->width = NULL;
t->height = NULL;
t->flags = NULL;
t->update = my_terminal_update;
t->update_indicators = my_terminal_update_indicators;
t->waitevent = NULL;
t->getkey = my_terminal_getkey;
t->putkey = NULL;
t->beep = my_terminal_beep;
t->enhanced = NULL;
t->config = NULL;
t->create_window = NULL;
t->destroy_window = NULL;
t->create_scrollbar = NULL;
t->destroy_scrollbar = NULL;
t->destroy_menubar = NULL;
t->create_menubar = NULL;
t->destroy_menuitem = NULL;
t->create_menuitem = NULL;
...
tn5250_terminal_init(t);
tn5250_display_set_terminal(display, t);
...
Now you have your own term, that will relay all the needed screen updates in
your own functions. Now keep an internal representation of the screen there
and act accordingly.