all repos — fluxbox @ 2065e654a357c6bf45c5747e25b713415eab8983

custom fork of the fluxbox windowmanager

removed nl_types_cygnus and did some cleaning
fluxgen fluxgen
commit

2065e654a357c6bf45c5747e25b713415eab8983

parent

00dc4656ea45071c9d2bbd1545493ea391ac4668

2 files changed, 22 insertions(+), 29 deletions(-)

jump to
M src/i18n.ccsrc/i18n.cc

@@ -1,5 +1,5 @@

// i18n.hh for Fluxbox Window Manager -// Copyright (c) 2001 - 2002 Henrik Kinnunen (fluxgen@linuxmail.org) +// Copyright (c) 2001 - 2003 Henrik Kinnunen (fluxgen(at)users.sourceforge.net) // // i18n.cc for Blackbox - an X11 Window manager // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net)

@@ -22,26 +22,20 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: i18n.cc,v 1.8 2002/12/02 22:50:57 fluxgen Exp $ +// $Id: i18n.cc,v 1.9 2003/04/26 15:46:03 fluxgen Exp $ //usr GNU extensions #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif // _GNU_SOURCE -#ifdef HAVE_CONFIG_H -#include "../config.h" -#endif // HAVE_CONFIG_H - #include "i18n.hh" #include <X11/Xlocale.h> - #include <cstdlib> #include <cstring> #include <cstdio> - #ifdef HAVE_LOCALE_H #include <locale.h>

@@ -59,15 +53,18 @@ }

I18n::I18n():m_multibyte(false), m_catalog_fd((nl_catd)(-1)) { -#ifdef HAVE_SETLOCALE +#ifdef HAVE_SETLOCALE //make sure we don't get 0 to m_locale string char *temp = setlocale(LC_ALL, ""); m_locale = ( temp ? temp : ""); if (m_locale.size() == 0) { cerr<<"Warning: Failed to set locale, reverting to \"C\""<<endl; #endif // HAVE_SETLOCALE + m_locale = "C"; -#ifdef HAVE_SETLOCALE + +#ifdef HAVE_SETLOCALE + } else { // MB_CUR_MAX returns the size of a char in the current locale if (MB_CUR_MAX > 1)

@@ -109,7 +106,7 @@ catalog_filename += m_locale;

catalog_filename += '/'; catalog_filename += catalog; -#ifdef MCLoadBySet +#ifdef MCLoadBySet m_catalog_fd = catopen(catalog_filename.c_str(), MCLoadBySet); #else // !MCLoadBySet m_catalog_fd = catopen(catalog_filename.c_str(), NL_CAT_LOCALE);

@@ -125,7 +122,8 @@ #endif // HAVE_CATOPEN

} -const char *I18n::getMessage(int set_number, int message_number, const char *default_message) { +const char *I18n::getMessage(int set_number, int message_number, + const char *default_message) { #if defined(NLS) && defined(HAVE_CATGETS) if (m_catalog_fd != (nl_catd)-1)
M src/i18n.hhsrc/i18n.hh

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: i18n.hh,v 1.10 2002/12/01 13:42:07 rathnor Exp $ +// $Id: i18n.hh,v 1.11 2003/04/26 15:46:03 fluxgen Exp $ #ifndef I18N_HH #define I18N_HH

@@ -30,37 +30,32 @@

#include "../nls/blackbox-nls.hh" #ifdef HAVE_CONFIG_H -#include "../config.h" +#include "config.h" #endif // HAVE_CONFIG_H -#ifdef HAVE_LOCALE_H -# include <locale.h> +#ifdef HAVE_LOCALE_H +#include <locale.h> #endif // HAVE_LOCALE_H -#ifdef HAVE_NL_TYPES_H +#ifdef HAVE_NL_TYPES_H // this is needed for linux libc5 systems extern "C" { -# include <nl_types.h> +#include <nl_types.h> } -#else // HAVE_NL_TYPES_H -#include "nl_types_cygnus.h" #endif // HAVE_NL_TYPES_H -#ifdef __CYGWIN32__ -# include "nl_types_cygnus.h" -#endif - #include <string> class I18n { public: static I18n *instance(); - inline const char *getLocale(void) const { return m_locale.c_str(); } - inline bool multibyte(void) const { return m_multibyte; } - inline const nl_catd &getCatalogFd(void) const { return m_catalog_fd; } + inline const char *getLocale() const { return m_locale.c_str(); } + inline bool multibyte() const { return m_multibyte; } + inline const nl_catd &getCatalogFd() const { return m_catalog_fd; } - const char *getMessage(int set_number, int message_number, const char *default_messsage = 0); - void openCatalog(const char *); + const char *getMessage(int set_number, int message_number, + const char *default_messsage = 0); + void openCatalog(const char *catalog); private: I18n(); ~I18n();