From 31b5435710d08dabe935c124bdd5ba6821fb8e9c Mon Sep 17 00:00:00 2001 From: PerryWerneck Date: Sun, 11 Dec 2016 04:25:03 -0200 Subject: [PATCH] Incluindo método para obter a URL do host --- host.c | 13 +++++++++++++ 1 file changed, 13 insertions(+), 0 deletions(-) diff --git a/host.c b/host.c index f296d64..957e175 100644 --- a/host.c +++ b/host.c @@ -219,6 +219,19 @@ static void update_host(H3270 *h) } +LIB3270_EXPORT const char * lib3270_get_url(H3270 *h, char *buffer, int len) +{ + CHECK_SESSION_HANDLE(h); + + snprintf(buffer,len,"%s://%s:%s", + ((h->options & LIB3270_OPTION_SSL) == 0) ? "tn3270" : "tn3270s", + h->host.current, + h->host.srvc + ); + + return buffer; +} + LIB3270_EXPORT const char * lib3270_set_url(H3270 *h, const char *n) { CHECK_SESSION_HANDLE(h); -- libgit2 0.21.2