From 8a69797c6e24502df30528b71e0ef16ae77798fc Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Tue, 15 May 2012 19:59:43 +0000 Subject: [PATCH] Android - Work in progress --- src/include/lib3270.h | 2 ++ src/include/lib3270/popup.h | 9 +++++++++ src/lib3270/ft_cut.c | 2 +- src/lib3270/ft_dft.c | 2 +- src/lib3270/resources.c | 2 +- src/lib3270/util.c | 8 ++++---- src/lib3270/utilc.h | 2 -- 7 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/include/lib3270.h b/src/include/lib3270.h index dff87ec..9a6d623 100644 --- a/src/include/lib3270.h +++ b/src/include/lib3270.h @@ -32,6 +32,7 @@ #ifndef LIB3270_H_INCLUDED #define LIB3270_H_INCLUDED 1 + #include /** * Character attributes @@ -798,6 +799,7 @@ LIB3270_EXPORT const char * lib3270_get_version(void); LIB3270_EXPORT const char * lib3270_get_revision(void); + LIB3270_EXPORT char * lib3270_vsprintf(const char *fmt, va_list args); #ifdef __cplusplus diff --git a/src/include/lib3270/popup.h b/src/include/lib3270/popup.h index 5cc35eb..49252fe 100644 --- a/src/include/lib3270/popup.h +++ b/src/include/lib3270/popup.h @@ -33,9 +33,18 @@ #define LIB3270_POPUP_INCLUDED 1 +#ifdef __cplusplus + extern "C" { +#endif + LIB3270_EXPORT void lib3270_set_popup_handler(int (*popup_handler)(H3270 *, void *, LIB3270_NOTIFY, const char *, const char *, const char *, va_list)); LIB3270_EXPORT void lib3270_popup_dialog(H3270 *session, LIB3270_NOTIFY id , const char *title, const char *message, const char *fmt, ...); + +#ifdef __cplusplus + } +#endif + #endif // LIB3270_POPUP_INCLUDED diff --git a/src/lib3270/ft_cut.c b/src/lib3270/ft_cut.c index 769bc36..c4d091f 100644 --- a/src/lib3270/ft_cut.c +++ b/src/lib3270/ft_cut.c @@ -532,7 +532,7 @@ static void cut_abort(unsigned short reason, const char *fmt, ...) /* Save the error message. */ va_start(args, fmt); - saved_errmsg = xs_vsprintf(fmt, args); + saved_errmsg = lib3270_vsprintf(fmt, args); va_end(args); /* Send the abort sequence. */ diff --git a/src/lib3270/ft_dft.c b/src/lib3270/ft_dft.c index 9e619f2..8f51db3 100644 --- a/src/lib3270/ft_dft.c +++ b/src/lib3270/ft_dft.c @@ -497,7 +497,7 @@ static void dft_abort(unsigned short code, const char *fmt, ...) lib3270_free(abort_string); va_start(args, fmt); - abort_string = xs_vsprintf(fmt, args); + abort_string = lib3270_vsprintf(fmt, args); va_end(args); trace_ds("> WriteStructuredField FileTransferData Error\n"); diff --git a/src/lib3270/resources.c b/src/lib3270/resources.c index 3577406..06f82e6 100644 --- a/src/lib3270/resources.c +++ b/src/lib3270/resources.c @@ -172,7 +172,7 @@ const char * get_fresource(const char *fmt, ...) const char *r; va_start(args, fmt); - name = xs_vsprintf(fmt, args); + name = lib3270_vsprintf(fmt, args); va_end(args); r = get_resource(name); lib3270_free(name); diff --git a/src/lib3270/util.c b/src/lib3270/util.c index d3a7111..4dd8355 100644 --- a/src/lib3270/util.c +++ b/src/lib3270/util.c @@ -166,7 +166,7 @@ const char * win32_strerror(int e) /* * Cheesy internal version of sprintf that allocates its own memory. */ -char * xs_vsprintf(const char *fmt, va_list args) +char * lib3270_vsprintf(const char *fmt, va_list args) { char *r; #if defined(HAVE_VASPRINTF) /*[*/ @@ -198,7 +198,7 @@ xs_buffer(const char *fmt, ...) char *r; va_start(args, fmt); - r = xs_vsprintf(fmt, args); + r = lib3270_vsprintf(fmt, args); va_end(args); return r; } @@ -211,7 +211,7 @@ xs_warning(const char *fmt, ...) char *r; va_start(args, fmt); - r = xs_vsprintf(fmt, args); + r = lib3270_vsprintf(fmt, args); va_end(args); Warning(NULL,r); lib3270_free(r); @@ -224,7 +224,7 @@ xs_error(const char *fmt, ...) char *r; va_start(args, fmt); - r = xs_vsprintf(fmt, args); + r = lib3270_vsprintf(fmt, args); va_end(args); Error(NULL,r); lib3270_free(r); diff --git a/src/lib3270/utilc.h b/src/lib3270/utilc.h index a527a52..4de1292 100644 --- a/src/lib3270/utilc.h +++ b/src/lib3270/utilc.h @@ -35,8 +35,6 @@ LIB3270_INTERNAL char *strip_whitespace(const char *s); LIB3270_INTERNAL char *xs_buffer(const char *fmt, ...) printflike(1, 2); LIB3270_INTERNAL void xs_error(const char *fmt, ...) printflike(1, 2); LIB3270_INTERNAL void xs_warning(const char *fmt, ...) printflike(1, 2); -LIB3270_INTERNAL char * xs_vsprintf(const char *fmt, va_list args); - LIB3270_INTERNAL void * AddInput(int, H3270 *session, void (*fn)(H3270 *session)); LIB3270_INTERNAL void * AddExcept(int, H3270 *session, void (*fn)(H3270 *session)); -- libgit2 0.21.2