From 01bcbfbc6bb08ea71bff1a714ed6b4655dbaeb91 Mon Sep 17 00:00:00 2001 From: Dave Peticolas Date: Sun, 1 Jul 2001 21:09:09 +0000 Subject: [PATCH] 2001-07-01 Dave Peticolas * src/gnc-ui-util.[ch]: implement towupper and iswlower if they are missing * src/register/quickfillcell.c: include gnc-ui-util.h * src/register/QuickFill.c: include gnc-ui-util.h * configure.in: check for towupper git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4843 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 11 +++++++++++ configure.in | 2 +- src/gnc-ui-util.c | 22 +++++++++++++++++++++- src/gnc-ui-util.h | 8 ++++++++ src/register/QuickFill.c | 1 + src/register/quickfillcell.c | 1 + 6 files changed, 43 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index fd5aabd1a1..f3104030ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2001-07-01 Dave Peticolas + + * src/gnc-ui-util.[ch]: implement towupper and iswlower + if they are missing + + * src/register/quickfillcell.c: include gnc-ui-util.h + + * src/register/QuickFill.c: include gnc-ui-util.h + + * configure.in: check for towupper + 2001-06-29 Joshua Sled * src/gnome/gnc-frequency.c: Added functions for dealing with diff --git a/configure.in b/configure.in index bbacc3fc0e..7e15a944ee 100644 --- a/configure.in +++ b/configure.in @@ -43,7 +43,7 @@ AC_PROG_MAKE_SET AC_HEADER_STDC AC_CHECK_HEADERS(limits.h) -AC_CHECK_FUNCS(stpcpy memcpy timegm) +AC_CHECK_FUNCS(stpcpy memcpy timegm towupper) STRUCT_TM_GMTOFF_CHECK SCANF_LLD_CHECK diff --git a/src/gnc-ui-util.c b/src/gnc-ui-util.c index bf8cee168d..c718990e1a 100644 --- a/src/gnc-ui-util.c +++ b/src/gnc-ui-util.c @@ -1,5 +1,5 @@ /********************************************************************\ - * gnc-ui-util.h -- utility functions for the GnuCash UI * + * gnc-ui-util.c -- utility functions for the GnuCash UI * * Copyright (C) 2000 Dave Peticolas * * * * This program is free software; you can redistribute it and/or * @@ -1830,3 +1830,23 @@ gnc_set_auto_decimal_places( int places ) auto_decimal_places = places; } +/* These implementations are rather lame. */ +#ifndef HAVE_TOWUPPER +gint32 +towupper (gint32 wc) +{ + if (wc > 127) + return wc; + + return toupper ((int) wc); +} + +int +iswlower (gint32 wc) +{ + if (wc > 127) + return 1; + + return islower ((int) wc); +} +#endif diff --git a/src/gnc-ui-util.h b/src/gnc-ui-util.h index 5001c7b65d..b16917d8b6 100644 --- a/src/gnc-ui-util.h +++ b/src/gnc-ui-util.h @@ -217,4 +217,12 @@ void gnc_set_auto_decimal_enabled(gboolean enabled); /* set how many auto decimal places to use */ void gnc_set_auto_decimal_places(int places); + +/* Missing functions ************************************************/ + +#ifndef HAVE_TOWUPPER +gint32 towupper (gint32 wc); +int iswlower (gint32 wc); +#endif + #endif diff --git a/src/register/QuickFill.c b/src/register/QuickFill.c index 9ba2e5d0ec..1e39228cb8 100644 --- a/src/register/QuickFill.c +++ b/src/register/QuickFill.c @@ -33,6 +33,7 @@ #include "basiccell.h" #include "gnc-engine.h" #include "gnc-engine-util.h" +#include "gnc-ui-util.h" struct _QuickFill diff --git a/src/register/quickfillcell.c b/src/register/quickfillcell.c index 2429ffcac1..646d452082 100644 --- a/src/register/quickfillcell.c +++ b/src/register/quickfillcell.c @@ -43,6 +43,7 @@ #include #include "basiccell.h" +#include "gnc-ui-util.h" #include "quickfillcell.h"