#include #include // #include #include "globals.h" #include #define MAX_ARGS 10 static H3270 *session = NULL; static void * mainloop(void *dunno) { while(session) { lib3270_main_iterate(session,1); } return NULL; } int main(int numpar, char *param[]) { H3270 * h; int rc = 0; // char line[4096]; // pthread_t thread; lib3270_initialize(); session = h = lib3270_session_new(""); printf("3270 session %p created\n]",h); // lib3270_set_toggle(session,LIB3270_TOGGLE_DS_TRACE,1); // pthread_create(&thread, NULL, mainloop, NULL); // pthread_detach(thread); // rc = lib3270_connect_host(h, "fandezhi.efglobe.com", "telnet", LIB3270_CONNECT_OPTION_WAIT); // rc = lib3270_connect_host(h, "127.0.0.1", "9090", LIB3270_CONNECT_OPTION_WAIT); // lib3270_set_host_url(h,"tn3270://fandezhi.efglobe.com:9090?lu=default"); lib3270_set_host(h,"tn3270://fandezhi.efglobe.com"); printf("\nConnect exits with rc=%d\n",rc); mainloop(0); /* while(fgets(line,4095,stdin)) { // const LIB3270_MACRO_LIST *cmd = get_3270_calls(); int f; int argc = 0; const char * argv[MAX_ARGS+1]; char * ptr; line[4095] = 0; // Just in case. for(ptr = line;ptr && *ptr != '\n';ptr++); *ptr = 0; if(!*line) break; argv[argc++] = strtok(line," "); for(f=1;f