From ab92de7881cd12954c88d348cf58a493ee0fe3a1 Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Wed, 29 Feb 2012 11:00:40 +0000 Subject: [PATCH] Mais ajustes para multi-sessao, retirando warnings durante a compilação da lib em modo stand-alone, corrigindo compilação em linux --- src/lib/Makefile.in | 4 ++-- src/lib/ansi.c | 2 +- src/lib/charset.c | 13 +++++++++---- src/lib/ctlr.h | 2 +- src/lib/host.c | 4 ++-- src/lib/kybd.c | 98 ++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------- src/lib/mkfb.c | 20 ++++++++++---------- src/lib/util.c | 113 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- src/lib/w3misc.c | 41 +++++++++++++++++++++-------------------- src/lib/winvers.c | 27 +++++++++++++++------------ 10 files changed, 219 insertions(+), 105 deletions(-) diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in index a7a4fa9..13ca0e7 100644 --- a/src/lib/Makefile.in +++ b/src/lib/Makefile.in @@ -123,9 +123,9 @@ version.c: ./mkversion.sh @chmod +x ./mkversion.sh @./mkversion.sh -fallbacks.c: $(BINDIR)/mkfb.exe X3270.xad +fallbacks.c: $(BINDIR)/mkfb@EXEEXT@ X3270.xad @mkdir -p $(TMPDIR) - @$(BINDIR)/mkfb.exe -c X3270.xad falbacks.c + @$(BINDIR)/mkfb@EXEEXT@ -c X3270.xad falbacks.c $(OBJDIR)/fallbacks@OBJEXT@: fallbacks.c @echo $@ ... diff --git a/src/lib/ansi.c b/src/lib/ansi.c index 8ebc864..09c6127 100644 --- a/src/lib/ansi.c +++ b/src/lib/ansi.c @@ -714,7 +714,7 @@ ansi_erase_in_display(int nn, int ig2 unused) ctlr_aclear(0, h3270.cursor_addr + 1, 1); break; case 2: /* all (without moving cursor) */ - if (cursor_addr == 0 && !h3270.is_altbuffer) + if (h3270.cursor_addr == 0 && !h3270.is_altbuffer) scroll_save(h3270.rows, True); ctlr_aclear(0, h3270.rows * h3270.cols, 1); break; diff --git a/src/lib/charset.c b/src/lib/charset.c index db3ade2..2124435 100644 --- a/src/lib/charset.c +++ b/src/lib/charset.c @@ -211,13 +211,18 @@ charset_init(char *csname) charset_defaults(); set_cgcsgids(CN); set_charset_name(CN); -#if defined(_WIN32) || defined(LIB3270)/*[*/ set_display_charset("iso8859-1"); -#elif defined(X3270_DISPLAY) || (defined(C3270) && !defined(_WIN32)) /*[*/ + +/* +#if defined(_WIN32) || defined(LIB3270) + set_display_charset("iso8859-1"); +#elif defined(X3270_DISPLAY) || (defined(C3270) && !defined(_WIN32)) (void) screen_new_display_charsets(default_display_charset,"us"); -#else /*][*/ +#else utf8_set_display_charsets(default_display_charset, "us"); -#endif /*]*/ +#endif +*/ + return CS_OKAY; } diff --git a/src/lib/ctlr.h b/src/lib/ctlr.h index 13808ab..577458c 100644 --- a/src/lib/ctlr.h +++ b/src/lib/ctlr.h @@ -18,7 +18,7 @@ */ LIB3270_INTERNAL int buffer_addr; /**< buffer address */ -LIB3270_INTERNAL int cursor_addr; /**< cursor address */ +// LIB3270_INTERNAL int cursor_addr; /**< cursor address */ LIB3270_INTERNAL struct ea *ea_buf; /**< 3270 device buffer */ //LIB3270_INTERNAL Boolean formatted; /**< contains at least one field? */ //LIB3270_INTERNAL Boolean is_altbuffer; /**< in alternate-buffer mode? */ diff --git a/src/lib/host.c b/src/lib/host.c index c73b5e9..532ba1a 100644 --- a/src/lib/host.c +++ b/src/lib/host.c @@ -579,8 +579,8 @@ static int do_connect(H3270 *hSession, const char *n) Replace(hSession->current_host, CN); if (localprocess_cmd != CN) { - if (full_current_host[strlen(OptLocalProcess)] != '\0') - hSession->current_host = NewString(full_current_host + strlen(OptLocalProcess) + 1); + if (hSession->full_current_host[strlen(OptLocalProcess)] != '\0') + hSession->current_host = NewString(hSession->full_current_host + strlen(OptLocalProcess) + 1); else hSession->current_host = NewString("default shell"); } else { diff --git a/src/lib/kybd.c b/src/lib/kybd.c index 4fe311b..68de745 100644 --- a/src/lib/kybd.c +++ b/src/lib/kybd.c @@ -1771,13 +1771,13 @@ LIB3270_ACTION( delete ) if (!do_delete()) return 0; if (reverse) { - int baddr = cursor_addr; + int baddr = hSession->cursor_addr; DEC_BA(baddr); if (!ea_buf[baddr].fa) cursor_move(baddr); } - screen_disp(&h3270); + screen_disp(hSession); return 0; } @@ -1848,9 +1848,9 @@ do_erase(void) * This ensures that if this is the end of a DBCS subfield, we will * land on the SI, instead of on the character following. */ - d = ctlr_dbcs_state(cursor_addr); + d = ctlr_dbcs_state(h3270.cursor_addr); if (IS_RIGHT(d)) { - baddr = cursor_addr; + baddr = h3270.cursor_addr; DEC_BA(baddr); cursor_move(baddr); } @@ -2596,11 +2596,11 @@ LIB3270_ACTION( eraseeol ) d = ctlr_lookleft_state(cursor_addr, &why); if (IS_DBCS(d) && why == DBCS_SUBFIELD) { if (d == DBCS_RIGHT) { - baddr = cursor_addr; + baddr = h3270.cursor_addr; DEC_BA(baddr); ea_buf[baddr].cc = EBC_si; } else - ea_buf[cursor_addr].cc = EBC_si; + ea_buf[h3270.cursor_addr].cc = EBC_si; } (void) ctlr_dbcs_postprocess(); screen_disp(&h3270); @@ -2628,18 +2628,18 @@ LIB3270_ACTION( eraseeof ) if (IN_ANSI) return 0; #endif /*]*/ - baddr = h3270.cursor_addr; - fa = get_field_attribute(&h3270,baddr); + baddr = hSession->cursor_addr; + fa = get_field_attribute(hSession,baddr); if (FA_IS_PROTECTED(fa) || ea_buf[baddr].fa) { operator_error(KL_OERR_PROTECTED); return -1; } - if (h3270.formatted) { /* erase to next field attribute */ + if (hSession->formatted) { /* erase to next field attribute */ do { ctlr_add(baddr, EBC_null, 0); INC_BA(baddr); } while (!ea_buf[baddr].fa); - mdt_set(h3270.cursor_addr); + mdt_set(hSession->cursor_addr); } else { /* erase to end of screen */ do { ctlr_add(baddr, EBC_null, 0); @@ -2651,14 +2651,14 @@ LIB3270_ACTION( eraseeof ) d = ctlr_lookleft_state(cursor_addr, &why); if (IS_DBCS(d) && why == DBCS_SUBFIELD) { if (d == DBCS_RIGHT) { - baddr = cursor_addr; + baddr = hSession->cursor_addr; DEC_BA(baddr); ea_buf[baddr].cc = EBC_si; } else - ea_buf[cursor_addr].cc = EBC_si; + ea_buf[hSession->cursor_addr].cc = EBC_si; } (void) ctlr_dbcs_postprocess(); - screen_disp(&h3270); + screen_disp(hSession); return 0; } @@ -2677,7 +2677,7 @@ LIB3270_ACTION( eraseinput ) if (IN_ANSI) return 0; #endif /*]*/ - if (h3270.formatted) { + if (hSession->formatted) { /* find first field attribute */ baddr = 0; do { @@ -2710,10 +2710,10 @@ LIB3270_ACTION( eraseinput ) if (!f) cursor_move(0); } else { - ctlr_clear(&h3270,True); + ctlr_clear(hSession,True); cursor_move(0); } - screen_disp(&h3270); + screen_disp(hSession); return 0; } @@ -2743,11 +2743,11 @@ LIB3270_ACTION( deleteword ) return 0; } #endif /*]*/ - if (!h3270.formatted) + if (!hSession->formatted) return 0; - baddr = h3270.cursor_addr; - fa = get_field_attribute(&h3270,baddr); + baddr = hSession->cursor_addr; + fa = get_field_attribute(hSession,baddr); /* Make sure we're on a modifiable field. */ if (FA_IS_PROTECTED(fa) || ea_buf[baddr].fa) { @@ -2757,7 +2757,7 @@ LIB3270_ACTION( deleteword ) /* Backspace over any spaces to the left of the cursor. */ for (;;) { - baddr = h3270.cursor_addr; + baddr = hSession->cursor_addr; DEC_BA(baddr); if (ea_buf[baddr].fa) return 0; @@ -2770,7 +2770,7 @@ LIB3270_ACTION( deleteword ) /* Backspace until the character to the left of the cursor is blank. */ for (;;) { - baddr = h3270.cursor_addr; + baddr = hSession->cursor_addr; DEC_BA(baddr); if (ea_buf[baddr].fa) return 0; @@ -2780,7 +2780,7 @@ LIB3270_ACTION( deleteword ) else do_erase(); } - screen_disp(&h3270); + screen_disp(hSession); return 0; } @@ -2810,11 +2810,11 @@ LIB3270_ACTION( deletefield ) return 0; } #endif /*]*/ - if (!h3270.formatted) + if (!hSession->formatted) return 0; - baddr = h3270.cursor_addr; - fa = get_field_attribute(&h3270,baddr); + baddr = hSession->cursor_addr; + fa = get_field_attribute(hSession,baddr); if (FA_IS_PROTECTED(fa) || ea_buf[baddr].fa) { operator_error(KL_OERR_PROTECTED); return -1; @@ -2822,13 +2822,13 @@ LIB3270_ACTION( deletefield ) while (!ea_buf[baddr].fa) DEC_BA(baddr); INC_BA(baddr); - mdt_set(h3270.cursor_addr); + mdt_set(hSession->cursor_addr); cursor_move(baddr); while (!ea_buf[baddr].fa) { ctlr_add(baddr, EBC_null, 0); INC_BA(baddr); } - screen_disp(&h3270); + screen_disp(hSession); return 0; } @@ -2914,10 +2914,10 @@ LIB3270_ACTION( fieldend ) if (IN_ANSI) return 0; #endif /*]*/ - if (!h3270.formatted) + if (!hSession->formatted) return 0; - baddr = h3270.cursor_addr; - faddr = find_field_attribute(&h3270,baddr); + baddr = hSession->cursor_addr; + faddr = find_field_attribute(hSession,baddr); fa = ea_buf[faddr].fa; if (faddr == baddr || FA_IS_PROTECTED(fa)) return 0; @@ -3375,12 +3375,12 @@ LIB3270_EXPORT int lib3270_emulate_input(H3270 *session, char *s, int len, int p if (pasting && IN_3270) { /* Check for cursor wrap to top of screen. */ - if (h3270.cursor_addr < orig_addr) + if (session->cursor_addr < orig_addr) return len-1; /* wrapped */ /* Jump cursor over left margin. */ if (toggled(MARGINED_PASTE) && - BA_TO_COL(h3270.cursor_addr) < orig_col) { + BA_TO_COL(session->cursor_addr) < orig_col) { if (!remargin(orig_col)) return len-1; skipped = True; @@ -3393,7 +3393,7 @@ LIB3270_EXPORT int lib3270_emulate_input(H3270 *session, char *s, int len, int p case BASE: switch (c) { case '\b': - lib3270_cursor_left(&h3270); + lib3270_cursor_left(session); skipped = False; break; case '\f': @@ -3401,7 +3401,7 @@ LIB3270_EXPORT int lib3270_emulate_input(H3270 *session, char *s, int len, int p key_ACharacter((unsigned char) ' ', KT_STD, ia, &skipped); } else { - lib3270_clear(&h3270); + lib3270_clear(session); skipped = False; if (IN_3270) return len-1; @@ -3410,11 +3410,11 @@ LIB3270_EXPORT int lib3270_emulate_input(H3270 *session, char *s, int len, int p case '\n': if (pasting) { if (!skipped) - lib3270_cursor_newline(&h3270); + lib3270_cursor_newline(session); // action_internal(Newline_action,ia, CN, CN); skipped = False; } else { - lib3270_enter(&h3270); + lib3270_enter(session); skipped = False; if (IN_3270) return len-1; @@ -3423,7 +3423,7 @@ LIB3270_EXPORT int lib3270_emulate_input(H3270 *session, char *s, int len, int p case '\r': /* ignored */ break; case '\t': - lib3270_tab(&h3270); + lib3270_tab(session); skipped = False; break; case '\\': /* backslashes are NOT special when @@ -3489,13 +3489,13 @@ LIB3270_EXPORT int lib3270_emulate_input(H3270 *session, char *s, int len, int p state = BASE; break; case 'b': - lib3270_cursor_left(&h3270); + lib3270_cursor_left(session); // action_internal(Left_action, ia, CN, CN); skipped = False; state = BASE; break; case 'f': - lib3270_clear(&h3270); + lib3270_clear(session); skipped = False; state = BASE; if (IN_3270) @@ -3503,7 +3503,7 @@ LIB3270_EXPORT int lib3270_emulate_input(H3270 *session, char *s, int len, int p else break; case 'n': - lib3270_enter(&h3270); + lib3270_enter(session); skipped = False; state = BASE; if (IN_3270) @@ -3515,25 +3515,24 @@ LIB3270_EXPORT int lib3270_emulate_input(H3270 *session, char *s, int len, int p break; case 'r': - lib3270_cursor_newline(&h3270); + lib3270_cursor_newline(session); // action_internal(Newline_action, ia, CN, CN); skipped = False; state = BASE; break; case 't': - lib3270_tab(&h3270); + lib3270_tab(session); skipped = False; state = BASE; break; case 'T': - lib3270_tab(&h3270); + lib3270_tab(session); skipped = False; state = BASE; break; case 'v': - popup_an_error("%s: Vertical tab not supported", - action_name(String_action)); + popup_an_error("%s: Vertical tab not supported",action_name(String_action)); // cancel_if_idle_command(); state = BASE; break; @@ -3541,8 +3540,7 @@ LIB3270_EXPORT int lib3270_emulate_input(H3270 *session, char *s, int len, int p state = BACKX; break; case '\\': - key_ACharacter((unsigned char) c, KT_STD, ia, - &skipped); + key_ACharacter((unsigned char) c, KT_STD, ia,&skipped); state = BASE; break; case '0': @@ -3679,7 +3677,7 @@ LIB3270_EXPORT int lib3270_emulate_input(H3270 *session, char *s, int len, int p switch (state) { case BASE: if (toggled(MARGINED_PASTE) && - BA_TO_COL(h3270.cursor_addr) < orig_col) { + BA_TO_COL(session->cursor_addr) < orig_col) { (void) remargin(orig_col); } break; @@ -3688,7 +3686,7 @@ LIB3270_EXPORT int lib3270_emulate_input(H3270 *session, char *s, int len, int p key_ACharacter((unsigned char) literal, KT_STD, ia, &skipped); state = BASE; if (toggled(MARGINED_PASTE) && - BA_TO_COL(h3270.cursor_addr) < orig_col) { + BA_TO_COL(session->cursor_addr) < orig_col) { (void) remargin(orig_col); } break; @@ -3711,7 +3709,7 @@ LIB3270_EXPORT int lib3270_emulate_input(H3270 *session, char *s, int len, int p break; } - screen_disp(&h3270); + screen_disp(session); return len; } diff --git a/src/lib/mkfb.c b/src/lib/mkfb.c index fb257e7..9ef6c84 100644 --- a/src/lib/mkfb.c +++ b/src/lib/mkfb.c @@ -1,27 +1,27 @@ -/* +/* * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a * aplicativos mainframe. Registro no INPI sob o nome G3270. Registro no INPI sob o nome G3270. - * + * * Copyright (C) <2008> - * + * * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela * Free Software Foundation. - * + * * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para * obter mais detalhes. - * + * * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA, 02111-1307, USA - * + * * Este programa está nomeado como mkfb.c e possui 577 linhas de código. - * - * Contatos: - * + * + * Contatos: + * * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) * licinio@bb.com.br (Licínio Luis Branco) @@ -538,7 +538,7 @@ main(int argc, char *argv[]) fprintf(o, "\t(String)NULL\n};\n\n"); /* Emit some test code. */ - fprintf(o, "%s", "#if defined(DEBUG) /*[*/\n\ + fprintf(o, "%s", "#if defined(DUMP) /*[*/\n\ #include \n\ int\n\ main(int argc, char *argv[])\n\ diff --git a/src/lib/util.c b/src/lib/util.c index eb21aeb..f4001a3 100644 --- a/src/lib/util.c +++ b/src/lib/util.c @@ -36,9 +36,23 @@ */ #include "globals.h" -#if !defined(_WIN32) /*[*/ -#include -#endif /*]*/ + +#if defined(_WIN32) + + #include + #include "winversc.h" + + #include + #include + #include + #include + + #include "w3miscc.h" + +#else + #include +#endif // _WIN32 + #include #include "resources.h" @@ -47,6 +61,99 @@ #define my_isspace(c) isspace((unsigned char)c) + +#if defined(_WIN32) + +int is_nt = 1; +int has_ipv6 = 1; + +int get_version_info(void) +{ + OSVERSIONINFO info; + + // Figure out what version of Windows this is. + memset(&info, '\0', sizeof(info)); + info.dwOSVersionInfoSize = sizeof(info); + if(GetVersionEx(&info) == 0) + { + WriteLog("lib3270","%s","Can't get Windows version"); + return -1; + } + + // Yes, people still run Win98. + if (info.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) + is_nt = 0; + + // Win2K and earlier is IPv4-only. WinXP and later can have IPv6. + if (!is_nt || info.dwMajorVersion < 5 || (info.dwMajorVersion == 5 && info.dwMinorVersion < 1)) + { + has_ipv6 = 0; + } + + return 0; +} + +// Convert a network address to a string. +const char * inet_ntop(int af, const void *src, char *dst, socklen_t cnt) +{ + union { + struct sockaddr sa; + struct sockaddr_in sin; + struct sockaddr_in6 sin6; + } sa; + DWORD ssz; + DWORD sz = cnt; + + memset(&sa, '\0', sizeof(sa)); + + switch (af) { + case AF_INET: + sa.sin = *(struct sockaddr_in *)src; // struct copy + ssz = sizeof(struct sockaddr_in); + break; + case AF_INET6: + sa.sin6 = *(struct sockaddr_in6 *)src; // struct copy + ssz = sizeof(struct sockaddr_in6); + break; + default: + if (cnt > 0) + dst[0] = '\0'; + return NULL; + } + + sa.sa.sa_family = af; + + if (WSAAddressToString(&sa.sa, ssz, NULL, dst, &sz) != 0) { + if (cnt > 0) + dst[0] = '\0'; + return NULL; + } + + return dst; +} + +// Decode a Win32 error number. +const char * win32_strerror(int e) +{ + static char buffer[4096]; + + if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, + NULL, + e, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + buffer, + sizeof(buffer), + NULL) == 0) { + + sprintf(buffer, "Windows error %d", e); + } + + return buffer; +} + + +#endif // _WIN32 + /* * Cheesy internal version of sprintf that allocates its own memory. */ diff --git a/src/lib/w3misc.c b/src/lib/w3misc.c index 7f92b07..17e0798 100644 --- a/src/lib/w3misc.c +++ b/src/lib/w3misc.c @@ -1,27 +1,27 @@ -/* +/* * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a * aplicativos mainframe. Registro no INPI sob o nome G3270. Registro no INPI sob o nome G3270. - * + * * Copyright (C) <2008> - * + * * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela * Free Software Foundation. - * + * * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para * obter mais detalhes. - * + * * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA, 02111-1307, USA - * + * * Este programa está nomeado como w3misc.c e possui 110 linhas de código. - * - * Contatos: - * + * + * Contatos: + * * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) * licinio@bb.com.br (Licínio Luis Branco) @@ -36,11 +36,12 @@ * Miscellaneous Win32 functions. */ +/* #include "globals.h" -#if !defined(_WIN32) /*[*/ +#if !defined(_WIN32) #error This module is only for Win32. -#endif /*]*/ +#endif #include #include @@ -49,9 +50,8 @@ #include "w3miscc.h" -/* Convert a network address to a string. */ -const char * -inet_ntop(int af, const void *src, char *dst, socklen_t cnt) +// Convert a network address to a string. +const char * inet_ntop(int af, const void *src, char *dst, socklen_t cnt) { union { struct sockaddr sa; @@ -65,11 +65,11 @@ inet_ntop(int af, const void *src, char *dst, socklen_t cnt) switch (af) { case AF_INET: - sa.sin = *(struct sockaddr_in *)src; /* struct copy */ + sa.sin = *(struct sockaddr_in *)src; // struct copy ssz = sizeof(struct sockaddr_in); break; case AF_INET6: - sa.sin6 = *(struct sockaddr_in6 *)src; /* struct copy */ + sa.sin6 = *(struct sockaddr_in6 *)src; // struct copy ssz = sizeof(struct sockaddr_in6); break; default: @@ -89,9 +89,8 @@ inet_ntop(int af, const void *src, char *dst, socklen_t cnt) return dst; } -/* Decode a Win32 error number. */ -const char * -win32_strerror(int e) +// Decode a Win32 error number. +const char * win32_strerror(int e) { static char buffer[4096]; @@ -102,9 +101,11 @@ win32_strerror(int e) buffer, sizeof(buffer), NULL) == 0) { - + sprintf(buffer, "Windows error %d", e); } return buffer; } + +*/ diff --git a/src/lib/winvers.c b/src/lib/winvers.c index a772f6e..34b3a04 100644 --- a/src/lib/winvers.c +++ b/src/lib/winvers.c @@ -1,27 +1,27 @@ -/* +/* * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a * aplicativos mainframe. Registro no INPI sob o nome G3270. Registro no INPI sob o nome G3270. - * + * * Copyright (C) <2008> - * + * * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela * Free Software Foundation. - * + * * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para * obter mais detalhes. - * + * * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA, 02111-1307, USA - * + * * Este programa está nomeado como winvers.c e possui 73 linhas de código. - * - * Contatos: - * + * + * Contatos: + * * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) * licinio@bb.com.br (Licínio Luis Branco) @@ -37,6 +37,7 @@ * OS version query */ +/* #include #include @@ -51,7 +52,7 @@ get_version_info(void) { OSVERSIONINFO info; - /* Figure out what version of Windows this is. */ + // Figure out what version of Windows this is. memset(&info, '\0', sizeof(info)); info.dwOSVersionInfoSize = sizeof(info); if (GetVersionEx(&info) == 0) { @@ -59,11 +60,11 @@ get_version_info(void) return -1; } - /* Yes, people still run Win98. */ + // Yes, people still run Win98. if (info.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) is_nt = 0; - /* Win2K and earlier is IPv4-only. WinXP and later can have IPv6. */ + // Win2K and earlier is IPv4-only. WinXP and later can have IPv6. if (!is_nt || info.dwMajorVersion < 5 || (info.dwMajorVersion == 5 && info.dwMinorVersion < 1)) { @@ -72,3 +73,5 @@ get_version_info(void) return 0; } + +*/ -- libgit2 0.21.2