-Delete some old unused files

-Some style fixes (mostly whitespace)
-Switch to the short language list and make it build again. seems to have trouble with BStringByteSink and utf8, or is it just my build env having encoding problems ?


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33209 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues 2009-09-20 17:57:06 +00:00
parent 36e4aeea57
commit 76065080e6
7 changed files with 72 additions and 428 deletions

View File

@ -159,9 +159,9 @@ class BCatalogAddOn {
status_t InitCheck() const; status_t InitCheck() const;
BCatalogAddOn *Next(); BCatalogAddOn *Next();
// the following could be used to localize non-textual data (e.g. icons), // the following could be used to localize non-textual data (e.g.
// but these will only be implemented if there's demand for such a // icons), but these will only be implemented if there's demand for such
// feature: // a feature:
virtual bool CanHaveData() const; virtual bool CanHaveData() const;
virtual status_t GetData(const char *name, BMessage *msg); virtual status_t GetData(const char *name, BMessage *msg);
virtual status_t GetData(uint32 id, BMessage *msg); virtual status_t GetData(uint32 id, BMessage *msg);
@ -172,18 +172,18 @@ class BCatalogAddOn {
const char *context = NULL, const char *context = NULL,
const char *comment = NULL); const char *comment = NULL);
virtual status_t SetString(int32 id, const char *translated); virtual status_t SetString(int32 id, const char *translated);
//
virtual bool CanWriteData() const; virtual bool CanWriteData() const;
virtual status_t SetData(const char *name, BMessage *msg); virtual status_t SetData(const char *name, BMessage *msg);
virtual status_t SetData(uint32 id, BMessage *msg); virtual status_t SetData(uint32 id, BMessage *msg);
//
virtual status_t ReadFromFile(const char *path = NULL); virtual status_t ReadFromFile(const char *path = NULL);
virtual status_t ReadFromAttribute(entry_ref *appOrAddOnRef); virtual status_t ReadFromAttribute(entry_ref *appOrAddOnRef);
virtual status_t ReadFromResource(entry_ref *appOrAddOnRef); virtual status_t ReadFromResource(entry_ref *appOrAddOnRef);
virtual status_t WriteToFile(const char *path = NULL); virtual status_t WriteToFile(const char *path = NULL);
virtual status_t WriteToAttribute(entry_ref *appOrAddOnRef); virtual status_t WriteToAttribute(entry_ref *appOrAddOnRef);
virtual status_t WriteToResource(entry_ref *appOrAddOnRef); virtual status_t WriteToResource(entry_ref *appOrAddOnRef);
//
virtual void MakeEmpty(); virtual void MakeEmpty();
virtual int32 CountItems() const; virtual int32 CountItems() const;
@ -326,18 +326,18 @@ class EditableCatalog : public BCatalog {
const char *context = NULL, const char *context = NULL,
const char *comment = NULL); const char *comment = NULL);
status_t SetString(int32 id, const char *translated); status_t SetString(int32 id, const char *translated);
//
bool CanWriteData() const; bool CanWriteData() const;
status_t SetData(const char *name, BMessage *msg); status_t SetData(const char *name, BMessage *msg);
status_t SetData(uint32 id, BMessage *msg); status_t SetData(uint32 id, BMessage *msg);
//
status_t ReadFromFile(const char *path = NULL); status_t ReadFromFile(const char *path = NULL);
status_t ReadFromAttribute(entry_ref *appOrAddOnRef); status_t ReadFromAttribute(entry_ref *appOrAddOnRef);
status_t ReadFromResource(entry_ref *appOrAddOnRef); status_t ReadFromResource(entry_ref *appOrAddOnRef);
status_t WriteToFile(const char *path = NULL); status_t WriteToFile(const char *path = NULL);
status_t WriteToAttribute(entry_ref *appOrAddOnRef); status_t WriteToAttribute(entry_ref *appOrAddOnRef);
status_t WriteToResource(entry_ref *appOrAddOnRef); status_t WriteToResource(entry_ref *appOrAddOnRef);
//
void MakeEmpty(); void MakeEmpty();
private: private:

View File

@ -46,7 +46,8 @@ BCatalog::~BCatalog()
const char * const char *
BCatalog::GetString(const char *string, const char *context, const char *comment) BCatalog::GetString(const char *string, const char *context,
const char *comment)
{ {
const char *translated; const char *translated;
for (BCatalogAddOn* cat = fCatalog; cat != NULL; cat = cat->fNext) { for (BCatalogAddOn* cat = fCatalog; cat != NULL; cat = cat->fNext) {
@ -80,8 +81,7 @@ BCatalog::GetData(const char *name, BMessage *msg)
for (BCatalogAddOn* cat = fCatalog; cat != NULL; cat = cat->fNext) { for (BCatalogAddOn* cat = fCatalog; cat != NULL; cat = cat->fNext) {
res = cat->GetData(name, msg); res = cat->GetData(name, msg);
if (res != B_NAME_NOT_FOUND && res != EOPNOTSUPP) if (res != B_NAME_NOT_FOUND && res != EOPNOTSUPP)
return res; return res; // return B_OK if found, or specific error-code
// return B_OK if found, or specific error-code
} }
return B_NAME_NOT_FOUND; return B_NAME_NOT_FOUND;
} }
@ -96,8 +96,7 @@ BCatalog::GetData(uint32 id, BMessage *msg)
for (BCatalogAddOn* cat = fCatalog; cat != NULL; cat = cat->fNext) { for (BCatalogAddOn* cat = fCatalog; cat != NULL; cat = cat->fNext) {
res = cat->GetData(id, msg); res = cat->GetData(id, msg);
if (res != B_NAME_NOT_FOUND && res != EOPNOTSUPP) if (res != B_NAME_NOT_FOUND && res != EOPNOTSUPP)
return res; return res; // return B_OK if found, or specific error-code
// return B_OK if found, or specific error-code
} }
return B_NAME_NOT_FOUND; return B_NAME_NOT_FOUND;
} }

View File

@ -32,7 +32,6 @@ SharedLibrary liblocale.so
NumberFormatImpl.cpp NumberFormatImpl.cpp
NumberFormatParameters.cpp NumberFormatParameters.cpp
PropertyFile.cpp PropertyFile.cpp
strfmon.cpp
UnicodeChar.cpp UnicodeChar.cpp
: be $(TARGET_LIBSTDC++) libicu-common.so libicu-i18n.so : be $(TARGET_LIBSTDC++) libicu-common.so libicu-i18n.so
; ;

View File

@ -498,7 +498,7 @@ BLocaleRoster::GetInstalledLanguages(BMessage *languages) const
BString languageName; BString languageName;
std::set<BString> languageSet; std::set<BString> languageSet;
#define REALLY_ALL_LANGUAGES #undef REALLY_ALL_LANGUAGES
#ifdef REALLY_ALL_LANGUAGES #ifdef REALLY_ALL_LANGUAGES
static const char* const* icuLocaleList = Locale::getISOLanguages(); static const char* const* icuLocaleList = Locale::getISOLanguages();
@ -513,7 +513,12 @@ BLocaleRoster::GetInstalledLanguages(BMessage *languages) const
// Loop over the strings and add them to an std::set to remove duplicates // Loop over the strings and add them to an std::set to remove duplicates
for (i = 0; i < localeCount; i++) { for (i = 0; i < localeCount; i++) {
languageSet.insert(BString(icuLocaleList[i])); UnicodeString ICULanguageName;
BString LanguageName;
BStringByteSink StringConverter(&LanguageName);
icuLocaleList[i].getDisplayLanguage(ICULanguageName);
ICULanguageName.toUTF8(StringConverter);
languageSet.insert(LanguageName);
} }
#endif #endif

View File

@ -1,179 +0,0 @@
## BeOS Generic Makefile v2.2 ##
## Fill in this file to specify the project being created, and the referenced
## makefile-engine will do all of the hard work for you. This handles both
## Intel and PowerPC builds of the BeOS.
## Application Specific Settings ---------------------------------------------
# specify the name of the binary
NAME= liblocale.so
# specify the type of binary
# APP: Application
# SHARED: Shared library or add-on
# STATIC: Static library archive
# DRIVER: Kernel Driver
TYPE= SHARED
# add support for new Pe and Eddie features
# to fill in generic makefile
#%{
# @src->@
# specify the source files to use
# full paths or paths relative to the makefile can be included
# all files, regardless of directory, will have their object
# files created in the common object directory.
# Note that this means this makefile will not work correctly
# if two source files with the same name (source.c or source.cpp)
# are included from different directories. Also note that spaces
# in folder names do not work well with this makefile.
SRCS= \
adler32.c \
cat.cpp \
Catalog.cpp \
Collator.cpp \
Country.cpp \
Currency.cpp \
DefaultCatalog.cpp \
FloatFormat.cpp \
FloatFormatImpl.cpp \
FloatFormatParameters.cpp \
Format.cpp \
FormatImpl.cpp \
FormatParameters.cpp \
GenericNumberFormat.cpp \
IntegerFormat.cpp \
IntegerFormatImpl.cpp \
IntegerFormatParameters.cpp \
langinfo.cpp \
Language.cpp \
LibraryInit.cpp \
Locale.cpp \
LocaleRoster.cpp \
NumberFormat.cpp \
NumberFormatImpl.cpp \
NumberFormatParameters.cpp \
PropertyFile.cpp \
strfmon.cpp \
UnicodeChar.cpp
# specify the resource files to use
# full path or a relative path to the resource file can be used.
RSRCS=
# @<-src@
#%}
# end support for Pe and Eddie
# specify additional libraries to link against
# there are two acceptable forms of library specifications
# - if your library follows the naming pattern of:
# libXXX.so or libXXX.a you can simply specify XXX
# library: libbe.so entry: be
#
# - if your library does not follow the standard library
# naming scheme you need to specify the path to the library
# and it's name
# library: my_lib.a entry: my_lib.a or path/my_lib.a
LIBS= be
# specify additional paths to directories following the standard
# libXXX.so or libXXX.a naming scheme. You can specify full paths
# or paths relative to the makefile. The paths included may not
# be recursive, so include all of the paths where libraries can
# be found. Directories where source files are found are
# automatically included.
LIBPATHS=
# additional paths to look for system headers
# thes use the form: #include <header>
# source file directories are NOT auto-included here
SYSTEM_INCLUDE_PATHS = ../include ../include/posix
# additional paths to look for local headers
# thes use the form: #include "header"
# source file directories are automatically included
LOCAL_INCLUDE_PATHS =
# specify the level of optimization that you desire
# NONE, SOME, FULL
OPTIMIZE= SOME
# specify any preprocessor symbols to be defined. The symbols will not
# have their values set automatically; you must supply the value (if any)
# to use. For example, setting DEFINES to "DEBUG=1" will cause the
# compiler option "-DDEBUG=1" to be used. Setting DEFINES to "DEBUG"
# would pass "-DDEBUG" on the compiler's command line.
DEFINES=
# specify special warning levels
# if unspecified default warnings will be used
# NONE = supress all warnings
# ALL = enable all warnings
WARNINGS = ALL
# specify whether image symbols will be created
# so that stack crawls in the debugger are meaningful
# if TRUE symbols will be created
SYMBOLS = TRUE
# specify debug settings
# if TRUE will allow application to be run from a source-level
# debugger. Note that this will disable all optimzation.
ifeq ($(DEBUG_BUILD), true)
DEBUGGER = TRUE
else
DEBUGGER = FALSE
endif
# specify additional compiler flags for all files
COMPILER_FLAGS =
# specify additional linker flags
LINKER_FLAGS =
# specify the version of this particular item
# (for example, -app 3 4 0 d 0 -short 340 -long "340 "`echo -n -e '\302\251'`"1999 GNU GPL")
# This may also be specified in a resource.
APP_VERSION =
# (for TYPE == DRIVER only) Specify desired location of driver in the /dev
# hierarchy. Used by the driverinstall rule. E.g., DRIVER_PATH = video/usb will
# instruct the driverinstall rule to place a symlink to your driver's binary in
# ~/add-ons/kernel/drivers/dev/video/usb, so that your driver will appear at
# /dev/video/usb when loaded. Default is "misc".
DRIVER_PATH =
#MACHINE=$(shell uname -m)
#ifneq ($(MACHINE),BePC)
# COMPILER_FLAGS += -w iserr
#else
# COMPILER_FLAGS += -Werror
#endif
# Custom overrides that can be set from the command line.
ifeq ($(DEBUG_BUILD), true)
SYMBOLS := TRUE
DEBUGGER := TRUE
OPTIMIZE := NONE
COMPILER_FLAGS += -DDEBUG=1
endif
ifeq ($(CHECK_MEM), true)
SYMBOLS := TRUE
DEBUGGER := TRUE
OPTIMIZE := NONE
COMPILER_FLAGS += -fcheck-memory-usage -DDEBUG=1 -D_NO_INLINE_ASM=1
#-D_KERNEL_MODE=1
endif
INSTALL_DIR=/boot/home/config/lib
TARGET_DIR=.
## include the makefile-engine
include $(BUILDHOME)/etc/makefile-engine

View File

@ -1,181 +0,0 @@
/*
** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
** Distributed under the terms of the MIT License.
*/
#include <SupportDefs.h>
#include <errno.h>
#include <monetary.h>
#include <locale.h>
#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
// ToDo: implementation is not yet working!
enum strfmon_flags {
USE_GROUPING = 1,
USE_SIGN = 2,
USE_LOCALE_POSNEG = 4,
NEG_IN_PARENTHESES = 8,
NO_CURRENCY = 16,
LEFT_JUSTIFIED = 32,
USE_INT_CURRENCY = 64
};
static int32
parseNumber(const char **_format)
{
const char *format = *_format;
int32 number = 0;
while (isdigit(*format))
number = number * 10 + *format++ - '0';
*_format = format;
return number;
}
ssize_t
vstrfmon(char *string, size_t maxSize, const char *format, va_list args)
{
if (format == NULL || string == NULL)
return B_BAD_VALUE;
struct lconv *lconv = localeconv();
int32 length = 0;
while (*format) {
if (format[0] != '%' || *++format == '%') {
if (++length >= (int32)maxSize)
return E2BIG;
*string++ = *format++;
continue;
}
if (format[0] == '\0')
return B_BAD_VALUE;
char flags = USE_GROUPING | USE_LOCALE_POSNEG;
char fill = ' ';
int32 width = 0, leftPrecision = 0, rightPrecision = -1;
bool isNegative = false;
// flags
int32 mode = 0;
while (*format && mode == 0) {
switch (*format++) {
case '=':
fill = *format++;
if (fill == '\0')
return B_BAD_VALUE;
break;
case '+':
if (flags & USE_SIGN)
return B_BAD_VALUE;
flags |= USE_SIGN;
break;
case '(':
if (flags & USE_SIGN)
return B_BAD_VALUE;
flags |= USE_SIGN | NEG_IN_PARENTHESES;
break;
case '^':
flags &= ~USE_GROUPING;
break;
case '!':
flags |= NO_CURRENCY;
break;
case '-':
flags |= LEFT_JUSTIFIED;
break;
default:
mode = 1;
}
}
// width
if (isdigit(*format))
width = parseNumber(&format);
// left precision
if (*format == '#') {
format++;
if (!isdigit(*format))
return B_BAD_VALUE;
leftPrecision = parseNumber(&format);
}
// right precision
if (*format == '.') {
format++;
if (!isdigit(*format))
return B_BAD_VALUE;
rightPrecision = parseNumber(&format);
}
// which currency symbol to use?
switch (*format++) {
case 'n':
// national currency symbol is the default
break;
case 'i':
flags |= USE_INT_CURRENCY;
break;
default:
return B_BAD_VALUE;
}
// adjust the default right precision value according the currency symbol
if (rightPrecision == -1) {
rightPrecision = flags & USE_INT_CURRENCY ? lconv->int_frac_digits : lconv->frac_digits;
if (rightPrecision == CHAR_MAX)
rightPrecision = 2;
}
double value = va_arg(args,double);
if (value < 0) {
isNegative = true;
value = -value;
}
if (leftPrecision + rightPrecision > 255)
return B_BAD_VALUE;
char number[256];
sprintf(number, "%*.*f", (int)leftPrecision, (int)rightPrecision,
value);
if (leftPrecision >= 0) {
}
}
return B_OK;
}
ssize_t
strfmon(char *string, size_t maxSize, const char *format, ...)
{
va_list args;
va_start(args, format);
ssize_t status = vstrfmon(string, maxSize, format, args);
va_end(args);
if (status < B_OK) {
errno = status;
return -1;
}
return status;
}

View File

@ -331,7 +331,8 @@ const static uint32 kMsgRevert = 'revt';
LocaleWindow::LocaleWindow(BRect rect) LocaleWindow::LocaleWindow(BRect rect)
: BWindow(rect, "Locale", B_TITLED_WINDOW, : BWindow(rect, "Locale", B_TITLED_WINDOW,
B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS) B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS
| B_AUTO_UPDATE_SIZE_LIMITS)
{ {
SetLayout(new BGroupLayout(B_HORIZONTAL)); SetLayout(new BGroupLayout(B_HORIZONTAL));