diff --git a/apputil/Makefile.in b/apputil/Makefile.in index 33302f8a..ab69d61f 100644 --- a/apputil/Makefile.in +++ b/apputil/Makefile.in @@ -17,7 +17,6 @@ CONFIG_H=demo_config.h LIBPREFIX=lib # srcdir must be set before this is included include $(top_builddir)/icuapps.mk -include $(shell $(ICU_CONFIG) --incfile) ## Extra files to remove for 'make clean' CLEANFILES = *~ $(DEPS) diff --git a/convexp/Makefile.in b/convexp/Makefile.in index 293ef2a7..bb3ac340 100644 --- a/convexp/Makefile.in +++ b/convexp/Makefile.in @@ -43,7 +43,7 @@ install-local: all-local install-target install-target: all-local $(MKINSTALLDIRS) $(BINDIR) $(DESTDIR)$(BINDIR)/data $(INSTALL) $(TARGET) $(DESTDIR)$(BINDIR)/$(TARGET) - $(INSTALL) convexp-header.html $(DESTDIR)$(BINDIR)/data + $(INSTALL) $(srcdir)/convexp-header.html $(DESTDIR)$(BINDIR)/data dist-local: diff --git a/dumpdat/Makefile.in b/dumpdat/Makefile.in index 2be0fad0..e208c550 100644 --- a/dumpdat/Makefile.in +++ b/dumpdat/Makefile.in @@ -53,8 +53,8 @@ distclean distclean-local target-clean-local dist dist-local check \ check-local install-local: all-local - $(MKINSTALLDIRS) $(BINDIR) - $(INSTALL) $(TARGET) $(BINDIR)/$(TARGET) + $(MKINSTALLDIRS) $(DESTDIR)$(BINDIR) + $(INSTALL) $(TARGET) $(DESTDIR)$(BINDIR)/$(TARGET) all-local: $(TARGET) diff --git a/icu-kube/docker.d/icu4c-demos/Dockerfile b/icu-kube/docker.d/icu4c-demos/Dockerfile index 08dfb956..8ae7e7a7 100644 --- a/icu-kube/docker.d/icu4c-demos/Dockerfile +++ b/icu-kube/docker.d/icu4c-demos/Dockerfile @@ -31,10 +31,13 @@ RUN mkdir /home/build/build /home/build/src WORKDIR /home/build/build ADD . /home/build/src/ ENV PREFIX=/home/build/icu -RUN ~/src/configure --prefix=${PREFIX} ICU_CONFIG=$(which icu-config) -RUN make all OBS= && make install OBS= DESTDIR=${PREFIX} +# HACK: translitdemo is not out of source enabled +RUN cp -R /home/build/src/translitdemo /home/build/build/translitdemo +RUN ~/src/configure --prefix=${PREFIX} ICU_CONFIG=$(which icu-config) && \ + make all install OBS= DESTDIR=${PREFIX} CONTEXTPATH=/icu-bin/ ICU_COMMON_HEADERS=/home/build/src/icu-kube/icuheaders #make -k DEPS= clean && make -k DEPS= distclean && sudo apt-get purge -y git subversion python3 doxygen zip curl g++ && sudo apt-get -y autoremove && sudo apt-get clean -y #RUN make all +RUN cp -R /home/build/src/translitdemo /home/build/icu/translitdemo FROM alpine:latest as httpd USER root @@ -47,6 +50,8 @@ COPY --from=build /home/build/icu /home/build/icu RUN if [ -d /home/build/icu/usr/local ]; then (cd /home/build/icu/usr/; ln -sv local/* .); fi; ls -l /home/build/icu/usr/bin/ ENV LD_LIBRARY_PATH /home/build/icu/usr/lib EXPOSE 8080 +# this needs special treatment +RUN cp -v /home/build/icu/usr/bin/data/collation.html /var/www/localhost/htdocs/ || true COPY icu-kube/lighttpd.conf /etc/lighttpd/lighttpd.conf COPY icu-kube/index.html /var/www/localhost/htdocs/index.html CMD ["lighttpd", "-D", "-f", "/etc/lighttpd/lighttpd.conf"] diff --git a/icu-kube/icuheaders/README.md b/icu-kube/icuheaders/README.md new file mode 100644 index 00000000..81463301 --- /dev/null +++ b/icu-kube/icuheaders/README.md @@ -0,0 +1,4 @@ +# icuheaders + +This contains copies of ICU header files that are used by some demos. +TODO: change demos to not depend on these. diff --git a/icu-kube/icuheaders/cmemory.h b/icu-kube/icuheaders/cmemory.h new file mode 100644 index 00000000..7f7fd8d0 --- /dev/null +++ b/icu-kube/icuheaders/cmemory.h @@ -0,0 +1,736 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html +/* +****************************************************************************** +* +* Copyright (C) 1997-2016, International Business Machines +* Corporation and others. All Rights Reserved. +* +****************************************************************************** +* +* File CMEMORY.H +* +* Contains stdlib.h/string.h memory functions +* +* @author Bertrand A. Damiba +* +* Modification History: +* +* Date Name Description +* 6/20/98 Bertrand Created. +* 05/03/99 stephen Changed from functions to macros. +* +****************************************************************************** +*/ + +#ifndef CMEMORY_H +#define CMEMORY_H + +#include "unicode/utypes.h" + +#include +#include +#include "unicode/localpointer.h" + +#if U_DEBUG && defined(UPRV_MALLOC_COUNT) +#include +#endif + + +#define uprv_memcpy(dst, src, size) U_STANDARD_CPP_NAMESPACE memcpy(dst, src, size) +#define uprv_memmove(dst, src, size) U_STANDARD_CPP_NAMESPACE memmove(dst, src, size) + +/** + * \def UPRV_LENGTHOF + * Convenience macro to determine the length of a fixed array at compile-time. + * @param array A fixed length array + * @return The length of the array, in elements + * @internal + */ +#define UPRV_LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0])) +#define uprv_memset(buffer, mark, size) U_STANDARD_CPP_NAMESPACE memset(buffer, mark, size) +#define uprv_memcmp(buffer1, buffer2, size) U_STANDARD_CPP_NAMESPACE memcmp(buffer1, buffer2,size) +#define uprv_memchr(ptr, value, num) U_STANDARD_CPP_NAMESPACE memchr(ptr, value, num) + +U_CAPI void * U_EXPORT2 +uprv_malloc(size_t s) U_MALLOC_ATTR U_ALLOC_SIZE_ATTR(1); + +U_CAPI void * U_EXPORT2 +uprv_realloc(void *mem, size_t size) U_ALLOC_SIZE_ATTR(2); + +U_CAPI void U_EXPORT2 +uprv_free(void *mem); + +U_CAPI void * U_EXPORT2 +uprv_calloc(size_t num, size_t size) U_MALLOC_ATTR U_ALLOC_SIZE_ATTR2(1,2); + +/** + * Get the least significant bits of a pointer (a memory address). + * For example, with a mask of 3, the macro gets the 2 least significant bits, + * which will be 0 if the pointer is 32-bit (4-byte) aligned. + * + * uintptr_t is the most appropriate integer type to cast to. + */ +#define U_POINTER_MASK_LSB(ptr, mask) ((uintptr_t)(ptr) & (mask)) + +/** + * Create & return an instance of "type" in statically allocated storage. + * e.g. + * static std::mutex *myMutex = STATIC_NEW(std::mutex); + * To destroy an object created in this way, invoke the destructor explicitly, e.g. + * myMutex->~mutex(); + * DO NOT use delete. + * DO NOT use with class UMutex, which has specific support for static instances. + * + * STATIC_NEW is intended for use when + * - We want a static (or global) object. + * - We don't want it to ever be destructed, or to explicitly control destruction, + * to avoid use-after-destruction problems. + * - We want to avoid an ordinary heap allocated object, + * to avoid the possibility of memory allocation failures, and + * to avoid memory leak reports, from valgrind, for example. + * This is defined as a macro rather than a template function because each invocation + * must define distinct static storage for the object being returned. + */ +#define STATIC_NEW(type) [] () { \ + alignas(type) static char storage[sizeof(type)]; \ + return new(storage) type();} () + +/** + * Heap clean up function, called from u_cleanup() + * Clears any user heap functions from u_setMemoryFunctions() + * Does NOT deallocate any remaining allocated memory. + */ +U_CFUNC UBool +cmemory_cleanup(void); + +/** + * A function called by uhash_remove, + * uhash_close, or uhash_put to delete + * an existing key or value. + * @param obj A key or value stored in a hashtable + * @see uprv_deleteUObject + */ +typedef void U_CALLCONV UObjectDeleter(void* obj); + +/** + * Deleter for UObject instances. + * Works for all subclasses of UObject because it has a virtual destructor. + */ +U_CAPI void U_EXPORT2 +uprv_deleteUObject(void *obj); + +#ifdef __cplusplus + +#include +#include "unicode/uobject.h" + +U_NAMESPACE_BEGIN + +/** + * "Smart pointer" class, deletes memory via uprv_free(). + * For most methods see the LocalPointerBase base class. + * Adds operator[] for array item access. + * + * @see LocalPointerBase + */ +template +class LocalMemory : public LocalPointerBase { +public: + using LocalPointerBase::operator*; + using LocalPointerBase::operator->; + /** + * Constructor takes ownership. + * @param p simple pointer to an array of T items that is adopted + */ + explicit LocalMemory(T *p=NULL) : LocalPointerBase(p) {} + /** + * Move constructor, leaves src with isNull(). + * @param src source smart pointer + */ + LocalMemory(LocalMemory &&src) U_NOEXCEPT : LocalPointerBase(src.ptr) { + src.ptr=NULL; + } + /** + * Destructor deletes the memory it owns. + */ + ~LocalMemory() { + uprv_free(LocalPointerBase::ptr); + } + /** + * Move assignment operator, leaves src with isNull(). + * The behavior is undefined if *this and src are the same object. + * @param src source smart pointer + * @return *this + */ + LocalMemory &operator=(LocalMemory &&src) U_NOEXCEPT { + uprv_free(LocalPointerBase::ptr); + LocalPointerBase::ptr=src.ptr; + src.ptr=NULL; + return *this; + } + /** + * Swap pointers. + * @param other other smart pointer + */ + void swap(LocalMemory &other) U_NOEXCEPT { + T *temp=LocalPointerBase::ptr; + LocalPointerBase::ptr=other.ptr; + other.ptr=temp; + } + /** + * Non-member LocalMemory swap function. + * @param p1 will get p2's pointer + * @param p2 will get p1's pointer + */ + friend inline void swap(LocalMemory &p1, LocalMemory &p2) U_NOEXCEPT { + p1.swap(p2); + } + /** + * Deletes the array it owns, + * and adopts (takes ownership of) the one passed in. + * @param p simple pointer to an array of T items that is adopted + */ + void adoptInstead(T *p) { + uprv_free(LocalPointerBase::ptr); + LocalPointerBase::ptr=p; + } + /** + * Deletes the array it owns, allocates a new one and reset its bytes to 0. + * Returns the new array pointer. + * If the allocation fails, then the current array is unchanged and + * this method returns NULL. + * @param newCapacity must be >0 + * @return the allocated array pointer, or NULL if the allocation failed + */ + inline T *allocateInsteadAndReset(int32_t newCapacity=1); + /** + * Deletes the array it owns and allocates a new one, copying length T items. + * Returns the new array pointer. + * If the allocation fails, then the current array is unchanged and + * this method returns NULL. + * @param newCapacity must be >0 + * @param length number of T items to be copied from the old array to the new one; + * must be no more than the capacity of the old array, + * which the caller must track because the LocalMemory does not track it + * @return the allocated array pointer, or NULL if the allocation failed + */ + inline T *allocateInsteadAndCopy(int32_t newCapacity=1, int32_t length=0); + /** + * Array item access (writable). + * No index bounds check. + * @param i array index + * @return reference to the array item + */ + T &operator[](ptrdiff_t i) const { return LocalPointerBase::ptr[i]; } +}; + +template +inline T *LocalMemory::allocateInsteadAndReset(int32_t newCapacity) { + if(newCapacity>0) { + T *p=(T *)uprv_malloc(newCapacity*sizeof(T)); + if(p!=NULL) { + uprv_memset(p, 0, newCapacity*sizeof(T)); + uprv_free(LocalPointerBase::ptr); + LocalPointerBase::ptr=p; + } + return p; + } else { + return NULL; + } +} + + +template +inline T *LocalMemory::allocateInsteadAndCopy(int32_t newCapacity, int32_t length) { + if(newCapacity>0) { + T *p=(T *)uprv_malloc(newCapacity*sizeof(T)); + if(p!=NULL) { + if(length>0) { + if(length>newCapacity) { + length=newCapacity; + } + uprv_memcpy(p, LocalPointerBase::ptr, (size_t)length*sizeof(T)); + } + uprv_free(LocalPointerBase::ptr); + LocalPointerBase::ptr=p; + } + return p; + } else { + return NULL; + } +} + +/** + * Simple array/buffer management class using uprv_malloc() and uprv_free(). + * Provides an internal array with fixed capacity. Can alias another array + * or allocate one. + * + * The array address is properly aligned for type T. It might not be properly + * aligned for types larger than T (or larger than the largest subtype of T). + * + * Unlike LocalMemory and LocalArray, this class never adopts + * (takes ownership of) another array. + * + * WARNING: MaybeStackArray only works with primitive (plain-old data) types. + * It does NOT know how to call a destructor! If you work with classes with + * destructors, consider LocalArray in localpointer.h or MemoryPool. + */ +template +class MaybeStackArray { +public: + // No heap allocation. Use only on the stack. + static void* U_EXPORT2 operator new(size_t) U_NOEXCEPT = delete; + static void* U_EXPORT2 operator new[](size_t) U_NOEXCEPT = delete; +#if U_HAVE_PLACEMENT_NEW + static void* U_EXPORT2 operator new(size_t, void*) U_NOEXCEPT = delete; +#endif + + /** + * Default constructor initializes with internal T[stackCapacity] buffer. + */ + MaybeStackArray() : ptr(stackArray), capacity(stackCapacity), needToRelease(FALSE) {} + /** + * Automatically allocates the heap array if the argument is larger than the stack capacity. + * Intended for use when an approximate capacity is known at compile time but the true + * capacity is not known until runtime. + */ + MaybeStackArray(int32_t newCapacity) : MaybeStackArray() { + if (capacity < newCapacity) { resize(newCapacity); } + } + /** + * Destructor deletes the array (if owned). + */ + ~MaybeStackArray() { releaseArray(); } + /** + * Move constructor: transfers ownership or copies the stack array. + */ + MaybeStackArray(MaybeStackArray &&src) U_NOEXCEPT; + /** + * Move assignment: transfers ownership or copies the stack array. + */ + MaybeStackArray &operator=(MaybeStackArray &&src) U_NOEXCEPT; + /** + * Returns the array capacity (number of T items). + * @return array capacity + */ + int32_t getCapacity() const { return capacity; } + /** + * Access without ownership change. + * @return the array pointer + */ + T *getAlias() const { return ptr; } + /** + * Returns the array limit. Simple convenience method. + * @return getAlias()+getCapacity() + */ + T *getArrayLimit() const { return getAlias()+capacity; } + // No "operator T *() const" because that can make + // expressions like mbs[index] ambiguous for some compilers. + /** + * Array item access (const). + * No index bounds check. + * @param i array index + * @return reference to the array item + */ + const T &operator[](ptrdiff_t i) const { return ptr[i]; } + /** + * Array item access (writable). + * No index bounds check. + * @param i array index + * @return reference to the array item + */ + T &operator[](ptrdiff_t i) { return ptr[i]; } + /** + * Deletes the array (if owned) and aliases another one, no transfer of ownership. + * If the arguments are illegal, then the current array is unchanged. + * @param otherArray must not be NULL + * @param otherCapacity must be >0 + */ + void aliasInstead(T *otherArray, int32_t otherCapacity) { + if(otherArray!=NULL && otherCapacity>0) { + releaseArray(); + ptr=otherArray; + capacity=otherCapacity; + needToRelease=FALSE; + } + } + /** + * Deletes the array (if owned) and allocates a new one, copying length T items. + * Returns the new array pointer. + * If the allocation fails, then the current array is unchanged and + * this method returns NULL. + * @param newCapacity can be less than or greater than the current capacity; + * must be >0 + * @param length number of T items to be copied from the old array to the new one + * @return the allocated array pointer, or NULL if the allocation failed + */ + inline T *resize(int32_t newCapacity, int32_t length=0); + /** + * Gives up ownership of the array if owned, or else clones it, + * copying length T items; resets itself to the internal stack array. + * Returns NULL if the allocation failed. + * @param length number of T items to copy when cloning, + * and capacity of the clone when cloning + * @param resultCapacity will be set to the returned array's capacity (output-only) + * @return the array pointer; + * caller becomes responsible for deleting the array + */ + inline T *orphanOrClone(int32_t length, int32_t &resultCapacity); +private: + T *ptr; + int32_t capacity; + UBool needToRelease; + T stackArray[stackCapacity]; + void releaseArray() { + if(needToRelease) { + uprv_free(ptr); + } + } + void resetToStackArray() { + ptr=stackArray; + capacity=stackCapacity; + needToRelease=FALSE; + } + /* No comparison operators with other MaybeStackArray's. */ + bool operator==(const MaybeStackArray & /*other*/) {return FALSE;} + bool operator!=(const MaybeStackArray & /*other*/) {return TRUE;} + /* No ownership transfer: No copy constructor, no assignment operator. */ + MaybeStackArray(const MaybeStackArray & /*other*/) {} + void operator=(const MaybeStackArray & /*other*/) {} +}; + +template +icu::MaybeStackArray::MaybeStackArray( + MaybeStackArray && src) U_NOEXCEPT + : ptr(src.ptr), capacity(src.capacity), needToRelease(src.needToRelease) { + if (src.ptr == src.stackArray) { + ptr = stackArray; + uprv_memcpy(stackArray, src.stackArray, sizeof(T) * src.capacity); + } else { + src.resetToStackArray(); // take ownership away from src + } +} + +template +inline MaybeStackArray & +MaybeStackArray::operator=(MaybeStackArray && src) U_NOEXCEPT { + releaseArray(); // in case this instance had its own memory allocated + capacity = src.capacity; + needToRelease = src.needToRelease; + if (src.ptr == src.stackArray) { + ptr = stackArray; + uprv_memcpy(stackArray, src.stackArray, sizeof(T) * src.capacity); + } else { + ptr = src.ptr; + src.resetToStackArray(); // take ownership away from src + } + return *this; +} + +template +inline T *MaybeStackArray::resize(int32_t newCapacity, int32_t length) { + if(newCapacity>0) { +#if U_DEBUG && defined(UPRV_MALLOC_COUNT) + ::fprintf(::stderr,"MaybeStacArray (resize) alloc %d * %lu\n", newCapacity,sizeof(T)); +#endif + T *p=(T *)uprv_malloc(newCapacity*sizeof(T)); + if(p!=NULL) { + if(length>0) { + if(length>capacity) { + length=capacity; + } + if(length>newCapacity) { + length=newCapacity; + } + uprv_memcpy(p, ptr, (size_t)length*sizeof(T)); + } + releaseArray(); + ptr=p; + capacity=newCapacity; + needToRelease=TRUE; + } + return p; + } else { + return NULL; + } +} + +template +inline T *MaybeStackArray::orphanOrClone(int32_t length, int32_t &resultCapacity) { + T *p; + if(needToRelease) { + p=ptr; + } else if(length<=0) { + return NULL; + } else { + if(length>capacity) { + length=capacity; + } + p=(T *)uprv_malloc(length*sizeof(T)); +#if U_DEBUG && defined(UPRV_MALLOC_COUNT) + ::fprintf(::stderr,"MaybeStacArray (orphan) alloc %d * %lu\n", length,sizeof(T)); +#endif + if(p==NULL) { + return NULL; + } + uprv_memcpy(p, ptr, (size_t)length*sizeof(T)); + } + resultCapacity=length; + resetToStackArray(); + return p; +} + +/** + * Variant of MaybeStackArray that allocates a header struct and an array + * in one contiguous memory block, using uprv_malloc() and uprv_free(). + * Provides internal memory with fixed array capacity. Can alias another memory + * block or allocate one. + * The stackCapacity is the number of T items in the internal memory, + * not counting the H header. + * Unlike LocalMemory and LocalArray, this class never adopts + * (takes ownership of) another memory block. + */ +template +class MaybeStackHeaderAndArray { +public: + // No heap allocation. Use only on the stack. + static void* U_EXPORT2 operator new(size_t) U_NOEXCEPT = delete; + static void* U_EXPORT2 operator new[](size_t) U_NOEXCEPT = delete; +#if U_HAVE_PLACEMENT_NEW + static void* U_EXPORT2 operator new(size_t, void*) U_NOEXCEPT = delete; +#endif + + /** + * Default constructor initializes with internal H+T[stackCapacity] buffer. + */ + MaybeStackHeaderAndArray() : ptr(&stackHeader), capacity(stackCapacity), needToRelease(FALSE) {} + /** + * Destructor deletes the memory (if owned). + */ + ~MaybeStackHeaderAndArray() { releaseMemory(); } + /** + * Returns the array capacity (number of T items). + * @return array capacity + */ + int32_t getCapacity() const { return capacity; } + /** + * Access without ownership change. + * @return the header pointer + */ + H *getAlias() const { return ptr; } + /** + * Returns the array start. + * @return array start, same address as getAlias()+1 + */ + T *getArrayStart() const { return reinterpret_cast(getAlias()+1); } + /** + * Returns the array limit. + * @return array limit + */ + T *getArrayLimit() const { return getArrayStart()+capacity; } + /** + * Access without ownership change. Same as getAlias(). + * A class instance can be used directly in expressions that take a T *. + * @return the header pointer + */ + operator H *() const { return ptr; } + /** + * Array item access (writable). + * No index bounds check. + * @param i array index + * @return reference to the array item + */ + T &operator[](ptrdiff_t i) { return getArrayStart()[i]; } + /** + * Deletes the memory block (if owned) and aliases another one, no transfer of ownership. + * If the arguments are illegal, then the current memory is unchanged. + * @param otherArray must not be NULL + * @param otherCapacity must be >0 + */ + void aliasInstead(H *otherMemory, int32_t otherCapacity) { + if(otherMemory!=NULL && otherCapacity>0) { + releaseMemory(); + ptr=otherMemory; + capacity=otherCapacity; + needToRelease=FALSE; + } + } + /** + * Deletes the memory block (if owned) and allocates a new one, + * copying the header and length T array items. + * Returns the new header pointer. + * If the allocation fails, then the current memory is unchanged and + * this method returns NULL. + * @param newCapacity can be less than or greater than the current capacity; + * must be >0 + * @param length number of T items to be copied from the old array to the new one + * @return the allocated pointer, or NULL if the allocation failed + */ + inline H *resize(int32_t newCapacity, int32_t length=0); + /** + * Gives up ownership of the memory if owned, or else clones it, + * copying the header and length T array items; resets itself to the internal memory. + * Returns NULL if the allocation failed. + * @param length number of T items to copy when cloning, + * and array capacity of the clone when cloning + * @param resultCapacity will be set to the returned array's capacity (output-only) + * @return the header pointer; + * caller becomes responsible for deleting the array + */ + inline H *orphanOrClone(int32_t length, int32_t &resultCapacity); +private: + H *ptr; + int32_t capacity; + UBool needToRelease; + // stackHeader must precede stackArray immediately. + H stackHeader; + T stackArray[stackCapacity]; + void releaseMemory() { + if(needToRelease) { + uprv_free(ptr); + } + } + /* No comparison operators with other MaybeStackHeaderAndArray's. */ + bool operator==(const MaybeStackHeaderAndArray & /*other*/) {return FALSE;} + bool operator!=(const MaybeStackHeaderAndArray & /*other*/) {return TRUE;} + /* No ownership transfer: No copy constructor, no assignment operator. */ + MaybeStackHeaderAndArray(const MaybeStackHeaderAndArray & /*other*/) {} + void operator=(const MaybeStackHeaderAndArray & /*other*/) {} +}; + +template +inline H *MaybeStackHeaderAndArray::resize(int32_t newCapacity, + int32_t length) { + if(newCapacity>=0) { +#if U_DEBUG && defined(UPRV_MALLOC_COUNT) + ::fprintf(::stderr,"MaybeStackHeaderAndArray alloc %d + %d * %ul\n", sizeof(H),newCapacity,sizeof(T)); +#endif + H *p=(H *)uprv_malloc(sizeof(H)+newCapacity*sizeof(T)); + if(p!=NULL) { + if(length<0) { + length=0; + } else if(length>0) { + if(length>capacity) { + length=capacity; + } + if(length>newCapacity) { + length=newCapacity; + } + } + uprv_memcpy(p, ptr, sizeof(H)+(size_t)length*sizeof(T)); + releaseMemory(); + ptr=p; + capacity=newCapacity; + needToRelease=TRUE; + } + return p; + } else { + return NULL; + } +} + +template +inline H *MaybeStackHeaderAndArray::orphanOrClone(int32_t length, + int32_t &resultCapacity) { + H *p; + if(needToRelease) { + p=ptr; + } else { + if(length<0) { + length=0; + } else if(length>capacity) { + length=capacity; + } +#if U_DEBUG && defined(UPRV_MALLOC_COUNT) + ::fprintf(::stderr,"MaybeStackHeaderAndArray (orphan) alloc %ul + %d * %lu\n", sizeof(H),length,sizeof(T)); +#endif + p=(H *)uprv_malloc(sizeof(H)+length*sizeof(T)); + if(p==NULL) { + return NULL; + } + uprv_memcpy(p, ptr, sizeof(H)+(size_t)length*sizeof(T)); + } + resultCapacity=length; + ptr=&stackHeader; + capacity=stackCapacity; + needToRelease=FALSE; + return p; +} + +/** + * A simple memory management class that creates new heap allocated objects (of + * any class that has a public constructor), keeps track of them and eventually + * deletes them all in its own destructor. + * + * A typical use-case would be code like this: + * + * MemoryPool pool; + * + * MyType* o1 = pool.create(); + * if (o1 != nullptr) { + * foo(o1); + * } + * + * MyType* o2 = pool.create(1, 2, 3); + * if (o2 != nullptr) { + * bar(o2); + * } + * + * // MemoryPool will take care of deleting the MyType objects. + * + * It doesn't do anything more than that, and is intentionally kept minimalist. + */ +template +class MemoryPool : public UMemory { +public: + MemoryPool() : count(0), pool() {} + + ~MemoryPool() { + for (int32_t i = 0; i < count; ++i) { + delete pool[i]; + } + } + + MemoryPool(const MemoryPool&) = delete; + MemoryPool& operator=(const MemoryPool&) = delete; + + MemoryPool(MemoryPool&& other) U_NOEXCEPT : count(other.count), + pool(std::move(other.pool)) { + other.count = 0; + } + + MemoryPool& operator=(MemoryPool&& other) U_NOEXCEPT { + count = other.count; + pool = std::move(other.pool); + other.count = 0; + return *this; + } + + /** + * Creates a new object of typename T, by forwarding any and all arguments + * to the typename T constructor. + * + * @param args Arguments to be forwarded to the typename T constructor. + * @return A pointer to the newly created object, or nullptr on error. + */ + template + T* create(Args&&... args) { + int32_t capacity = pool.getCapacity(); + if (count == capacity && + pool.resize(capacity == stackCapacity ? 4 * capacity : 2 * capacity, + capacity) == nullptr) { + return nullptr; + } + return pool[count++] = new T(std::forward(args)...); + } + +private: + int32_t count; + MaybeStackArray pool; +}; + +U_NAMESPACE_END + +#endif /* __cplusplus */ +#endif /* CMEMORY_H */ diff --git a/icu-kube/icuheaders/hash.h b/icu-kube/icuheaders/hash.h new file mode 100644 index 00000000..f02cb708 --- /dev/null +++ b/icu-kube/icuheaders/hash.h @@ -0,0 +1,248 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html +/* +****************************************************************************** +* Copyright (C) 1997-2014, International Business Machines +* Corporation and others. All Rights Reserved. +****************************************************************************** +* Date Name Description +* 03/28/00 aliu Creation. +****************************************************************************** +*/ + +#ifndef HASH_H +#define HASH_H + +#include "unicode/unistr.h" +#include "unicode/uobject.h" +#include "cmemory.h" +#include "uhash.h" + +U_NAMESPACE_BEGIN + +/** + * Hashtable is a thin C++ wrapper around UHashtable, a general-purpose void* + * hashtable implemented in C. Hashtable is designed to be idiomatic and + * easy-to-use in C++. + * + * Hashtable is an INTERNAL CLASS. + */ +class U_COMMON_API Hashtable : public UMemory { + UHashtable* hash; + UHashtable hashObj; + + inline void init(UHashFunction *keyHash, UKeyComparator *keyComp, UValueComparator *valueComp, UErrorCode& status); + + inline void initSize(UHashFunction *keyHash, UKeyComparator *keyComp, UValueComparator *valueComp, int32_t size, UErrorCode& status); + +public: + /** + * Construct a hashtable + * @param ignoreKeyCase If true, keys are case insensitive. + * @param status Error code + */ + inline Hashtable(UBool ignoreKeyCase, UErrorCode& status); + + /** + * Construct a hashtable + * @param ignoreKeyCase If true, keys are case insensitive. + * @param size initial size allocation + * @param status Error code + */ + inline Hashtable(UBool ignoreKeyCase, int32_t size, UErrorCode& status); + + /** + * Construct a hashtable + * @param keyComp Comparator for comparing the keys + * @param valueComp Comparator for comparing the values + * @param status Error code + */ + inline Hashtable(UKeyComparator *keyComp, UValueComparator *valueComp, UErrorCode& status); + + /** + * Construct a hashtable + * @param status Error code + */ + inline Hashtable(UErrorCode& status); + + /** + * Construct a hashtable, _disregarding any error_. Use this constructor + * with caution. + */ + inline Hashtable(); + + /** + * Non-virtual destructor; make this virtual if Hashtable is subclassed + * in the future. + */ + inline ~Hashtable(); + + inline UObjectDeleter *setValueDeleter(UObjectDeleter *fn); + + inline int32_t count() const; + + inline void* put(const UnicodeString& key, void* value, UErrorCode& status); + + inline int32_t puti(const UnicodeString& key, int32_t value, UErrorCode& status); + + inline void* get(const UnicodeString& key) const; + + inline int32_t geti(const UnicodeString& key) const; + + inline void* remove(const UnicodeString& key); + + inline int32_t removei(const UnicodeString& key); + + inline void removeAll(void); + + inline const UHashElement* find(const UnicodeString& key) const; + + /** + * @param pos - must be UHASH_FIRST on first call, and untouched afterwards. + * @see uhash_nextElement + */ + inline const UHashElement* nextElement(int32_t& pos) const; + + inline UKeyComparator* setKeyComparator(UKeyComparator*keyComp); + + inline UValueComparator* setValueComparator(UValueComparator* valueComp); + + inline UBool equals(const Hashtable& that) const; +private: + Hashtable(const Hashtable &other); // forbid copying of this class + Hashtable &operator=(const Hashtable &other); // forbid copying of this class +}; + +/********************************************************************* + * Implementation + ********************************************************************/ + +inline void Hashtable::init(UHashFunction *keyHash, UKeyComparator *keyComp, + UValueComparator *valueComp, UErrorCode& status) { + if (U_FAILURE(status)) { + return; + } + uhash_init(&hashObj, keyHash, keyComp, valueComp, &status); + if (U_SUCCESS(status)) { + hash = &hashObj; + uhash_setKeyDeleter(hash, uprv_deleteUObject); + } +} + +inline void Hashtable::initSize(UHashFunction *keyHash, UKeyComparator *keyComp, + UValueComparator *valueComp, int32_t size, UErrorCode& status) { + if (U_FAILURE(status)) { + return; + } + uhash_initSize(&hashObj, keyHash, keyComp, valueComp, size, &status); + if (U_SUCCESS(status)) { + hash = &hashObj; + uhash_setKeyDeleter(hash, uprv_deleteUObject); + } +} + +inline Hashtable::Hashtable(UKeyComparator *keyComp, UValueComparator *valueComp, + UErrorCode& status) : hash(0) { + init( uhash_hashUnicodeString, keyComp, valueComp, status); +} + +inline Hashtable::Hashtable(UBool ignoreKeyCase, UErrorCode& status) + : hash(0) +{ + init(ignoreKeyCase ? uhash_hashCaselessUnicodeString + : uhash_hashUnicodeString, + ignoreKeyCase ? uhash_compareCaselessUnicodeString + : uhash_compareUnicodeString, + NULL, + status); +} + +inline Hashtable::Hashtable(UBool ignoreKeyCase, int32_t size, UErrorCode& status) + : hash(0) +{ + initSize(ignoreKeyCase ? uhash_hashCaselessUnicodeString + : uhash_hashUnicodeString, + ignoreKeyCase ? uhash_compareCaselessUnicodeString + : uhash_compareUnicodeString, + NULL, size, + status); +} + +inline Hashtable::Hashtable(UErrorCode& status) + : hash(0) +{ + init(uhash_hashUnicodeString, uhash_compareUnicodeString, NULL, status); +} + +inline Hashtable::Hashtable() + : hash(0) +{ + UErrorCode status = U_ZERO_ERROR; + init(uhash_hashUnicodeString, uhash_compareUnicodeString, NULL, status); +} + +inline Hashtable::~Hashtable() { + if (hash != NULL) { + uhash_close(hash); + } +} + +inline UObjectDeleter *Hashtable::setValueDeleter(UObjectDeleter *fn) { + return uhash_setValueDeleter(hash, fn); +} + +inline int32_t Hashtable::count() const { + return uhash_count(hash); +} + +inline void* Hashtable::put(const UnicodeString& key, void* value, UErrorCode& status) { + return uhash_put(hash, new UnicodeString(key), value, &status); +} + +inline int32_t Hashtable::puti(const UnicodeString& key, int32_t value, UErrorCode& status) { + return uhash_puti(hash, new UnicodeString(key), value, &status); +} + +inline void* Hashtable::get(const UnicodeString& key) const { + return uhash_get(hash, &key); +} + +inline int32_t Hashtable::geti(const UnicodeString& key) const { + return uhash_geti(hash, &key); +} + +inline void* Hashtable::remove(const UnicodeString& key) { + return uhash_remove(hash, &key); +} + +inline int32_t Hashtable::removei(const UnicodeString& key) { + return uhash_removei(hash, &key); +} + +inline const UHashElement* Hashtable::find(const UnicodeString& key) const { + return uhash_find(hash, &key); +} + +inline const UHashElement* Hashtable::nextElement(int32_t& pos) const { + return uhash_nextElement(hash, &pos); +} + +inline void Hashtable::removeAll(void) { + uhash_removeAll(hash); +} + +inline UKeyComparator* Hashtable::setKeyComparator(UKeyComparator*keyComp){ + return uhash_setKeyComparator(hash, keyComp); +} + +inline UValueComparator* Hashtable::setValueComparator(UValueComparator* valueComp){ + return uhash_setValueComparator(hash, valueComp); +} + +inline UBool Hashtable::equals(const Hashtable& that)const{ + return uhash_equals(hash, that.hash); +} +U_NAMESPACE_END + +#endif + diff --git a/icu-kube/icuheaders/uassert.h b/icu-kube/icuheaders/uassert.h new file mode 100644 index 00000000..f0f7a925 --- /dev/null +++ b/icu-kube/icuheaders/uassert.h @@ -0,0 +1,49 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html +/* +****************************************************************************** +* +* Copyright (C) 2002-2011, International Business Machines +* Corporation and others. All Rights Reserved. +* +****************************************************************************** +* +* File uassert.h +* +* Contains the U_ASSERT and UPRV_UNREACHABLE macros +* +****************************************************************************** +*/ +#ifndef U_ASSERT_H +#define U_ASSERT_H + +/* utypes.h is included to get the proper define for uint8_t */ +#include "unicode/utypes.h" +/* for abort */ +#include + +/** + * \def U_ASSERT + * By default, U_ASSERT just wraps the C library assert macro. + * By changing the definition here, the assert behavior for ICU can be changed + * without affecting other non - ICU uses of the C library assert(). +*/ +#if U_DEBUG +# include +# define U_ASSERT(exp) assert(exp) +#else +# define U_ASSERT(exp) +#endif + +/** + * \def UPRV_UNREACHABLE + * This macro is used to unconditionally abort if unreachable code is ever executed. + * @internal +*/ +#if defined(UPRV_UNREACHABLE) + // Use the predefined value. +#else +# define UPRV_UNREACHABLE abort() +#endif + +#endif diff --git a/icu-kube/icuheaders/uelement.h b/icu-kube/icuheaders/uelement.h new file mode 100644 index 00000000..05f36a09 --- /dev/null +++ b/icu-kube/icuheaders/uelement.h @@ -0,0 +1,91 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html +/* +******************************************************************************* +* Copyright (C) 1997-2011, International Business Machines +* Corporation and others. All Rights Reserved. +******************************************************************************* +* file name: uelement.h +* encoding: UTF-8 +* tab size: 8 (not used) +* indentation:4 +* +* created on: 2011jul04 +* created by: Markus W. Scherer +* +* Common definitions for UHashTable and UVector. +* UHashTok moved here from uhash.h and renamed UElement. +* This allows users of UVector to avoid the confusing #include of uhash.h. +* uhash.h aliases UElement to UHashTok, +* so that we need not change all of its code and its users. +*/ + +#ifndef __UELEMENT_H__ +#define __UELEMENT_H__ + +#include "unicode/utypes.h" + +U_CDECL_BEGIN + +/** + * A UVector element, or a key or value within a UHashtable. + * It may be either a 32-bit integral value or an opaque void* pointer. + * The void* pointer may be smaller than 32 bits (e.g. 24 bits) + * or may be larger (e.g. 64 bits). + * + * Because a UElement is the size of a native pointer or a 32-bit + * integer, we pass it around by value. + */ +union UElement { + void* pointer; + int32_t integer; +}; +typedef union UElement UElement; + +/** + * An element-equality (boolean) comparison function. + * @param e1 An element (object or integer) + * @param e2 An element (object or integer) + * @return TRUE if the two elements are equal. + */ +typedef UBool U_CALLCONV UElementsAreEqual(const UElement e1, const UElement e2); + +/** + * An element sorting (three-way) comparison function. + * @param e1 An element (object or integer) + * @param e2 An element (object or integer) + * @return 0 if the two elements are equal, -1 if e1 is < e2, or +1 if e1 is > e2. + */ +typedef int8_t U_CALLCONV UElementComparator(UElement e1, UElement e2); + +/** + * An element assignment function. It may copy an integer, copy + * a pointer, or clone a pointer, as appropriate. + * @param dst The element to be assigned to + * @param src The element to assign from + */ +typedef void U_CALLCONV UElementAssigner(UElement *dst, UElement *src); + +U_CDECL_END + +/** + * Comparator function for UnicodeString* keys. Implements UElementsAreEqual. + * @param key1 The string for comparison + * @param key2 The string for comparison + * @return true if key1 and key2 are equal, return false otherwise. + */ +U_CAPI UBool U_EXPORT2 +uhash_compareUnicodeString(const UElement key1, const UElement key2); + +/** + * Comparator function for UnicodeString* keys (case insensitive). + * Make sure to use together with uhash_hashCaselessUnicodeString. + * Implements UElementsAreEqual. + * @param key1 The string for comparison + * @param key2 The string for comparison + * @return true if key1 and key2 are equal, return false otherwise. + */ +U_CAPI UBool U_EXPORT2 +uhash_compareCaselessUnicodeString(const UElement key1, const UElement key2); + +#endif /* __UELEMENT_H__ */ diff --git a/icu-kube/icuheaders/uhash.h b/icu-kube/icuheaders/uhash.h new file mode 100644 index 00000000..b59d2711 --- /dev/null +++ b/icu-kube/icuheaders/uhash.h @@ -0,0 +1,718 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html +/* +****************************************************************************** +* Copyright (C) 1997-2015, International Business Machines +* Corporation and others. All Rights Reserved. +****************************************************************************** +* Date Name Description +* 03/22/00 aliu Adapted from original C++ ICU Hashtable. +* 07/06/01 aliu Modified to support int32_t keys on +* platforms with sizeof(void*) < 32. +****************************************************************************** +*/ + +#ifndef UHASH_H +#define UHASH_H + +#include "unicode/utypes.h" +#include "cmemory.h" +#include "uelement.h" +#include "unicode/localpointer.h" + +/** + * UHashtable stores key-value pairs and does moderately fast lookup + * based on keys. It provides a good tradeoff between access time and + * storage space. As elements are added to it, it grows to accomodate + * them. By default, the table never shrinks, even if all elements + * are removed from it. + * + * Keys and values are stored as void* pointers. These void* pointers + * may be actual pointers to strings, objects, or any other structure + * in memory, or they may simply be integral values cast to void*. + * UHashtable doesn't care and manipulates them via user-supplied + * functions. These functions hash keys, compare keys, delete keys, + * and delete values. Some function pointers are optional (may be + * NULL); others must be supplied. Several prebuilt functions exist + * to handle common key types. + * + * UHashtable ownership of keys and values is flexible, and controlled + * by whether or not the key deleter and value deleter functions are + * set. If a void* key is actually a pointer to a deletable object, + * then UHashtable can be made to delete that object by setting the + * key deleter function pointer to a non-NULL value. If this is done, + * then keys passed to uhash_put() are owned by the hashtable and will + * be deleted by it at some point, either as keys are replaced, or + * when uhash_close() is finally called. The same is true of values + * and the value deleter function pointer. Keys passed to methods + * other than uhash_put() are never owned by the hashtable. + * + * NULL values are not allowed. uhash_get() returns NULL to indicate + * a key that is not in the table, and having a NULL value in the + * table would generate an ambiguous result. If a key and a NULL + * value is passed to uhash_put(), this has the effect of doing a + * uhash_remove() on that key. This keeps uhash_get(), uhash_count(), + * and uhash_nextElement() consistent with one another. + * + * To see everything in a hashtable, use uhash_nextElement() to + * iterate through its contents. Each call to this function returns a + * UHashElement pointer. A hash element contains a key, value, and + * hashcode. During iteration an element may be deleted by calling + * uhash_removeElement(); iteration may safely continue thereafter. + * The uhash_remove() function may also be safely called in + * mid-iteration. If uhash_put() is called during iteration, + * the iteration is still guaranteed to terminate reasonably, but + * there is no guarantee that every element will be returned or that + * some won't be returned more than once. + * + * Under no circumstances should the UHashElement returned by + * uhash_nextElement be modified directly. + * + * By default, the hashtable grows when necessary, but never shrinks, + * even if all items are removed. For most applications this is + * optimal. However, in a highly dynamic usage where memory is at a + * premium, the table can be set to both grow and shrink by calling + * uhash_setResizePolicy() with the policy U_GROW_AND_SHRINK. In a + * situation where memory is critical and the client wants a table + * that does not grow at all, the constant U_FIXED can be used. + */ + +/******************************************************************** + * Data Structures + ********************************************************************/ + +U_CDECL_BEGIN + +/** + * A key or value within a UHashtable. + * The hashing and comparison functions take a pointer to a + * UHashTok, but the deleter receives the void* pointer within it. + */ +typedef UElement UHashTok; + +/** + * This is a single hash element. + */ +struct UHashElement { + /* Reorder these elements to pack nicely if necessary */ + int32_t hashcode; + UHashTok value; + UHashTok key; +}; +typedef struct UHashElement UHashElement; + +/** + * A hashing function. + * @param key A key stored in a hashtable + * @return A NON-NEGATIVE hash code for parm. + */ +typedef int32_t U_CALLCONV UHashFunction(const UHashTok key); + +/** + * A key equality (boolean) comparison function. + */ +typedef UElementsAreEqual UKeyComparator; + +/** + * A value equality (boolean) comparison function. + */ +typedef UElementsAreEqual UValueComparator; + +/* see cmemory.h for UObjectDeleter and uprv_deleteUObject() */ + +/** + * This specifies whether or not, and how, the hastable resizes itself. + * See uhash_setResizePolicy(). + */ +enum UHashResizePolicy { + U_GROW, /* Grow on demand, do not shrink */ + U_GROW_AND_SHRINK, /* Grow and shrink on demand */ + U_FIXED /* Never change size */ +}; + +/** + * The UHashtable struct. Clients should treat this as an opaque data + * type and manipulate it only through the uhash_... API. + */ +struct UHashtable { + + /* Main key-value pair storage array */ + + UHashElement *elements; + + /* Function pointers */ + + UHashFunction *keyHasher; /* Computes hash from key. + * Never null. */ + UKeyComparator *keyComparator; /* Compares keys for equality. + * Never null. */ + UValueComparator *valueComparator; /* Compares the values for equality */ + + UObjectDeleter *keyDeleter; /* Deletes keys when required. + * If NULL won't do anything */ + UObjectDeleter *valueDeleter; /* Deletes values when required. + * If NULL won't do anything */ + + /* Size parameters */ + + int32_t count; /* The number of key-value pairs in this table. + * 0 <= count <= length. In practice we + * never let count == length (see code). */ + int32_t length; /* The physical size of the arrays hashes, keys + * and values. Must be prime. */ + + /* Rehashing thresholds */ + + int32_t highWaterMark; /* If count > highWaterMark, rehash */ + int32_t lowWaterMark; /* If count < lowWaterMark, rehash */ + float highWaterRatio; /* 0..1; high water as a fraction of length */ + float lowWaterRatio; /* 0..1; low water as a fraction of length */ + + int8_t primeIndex; /* Index into our prime table for length. + * length == PRIMES[primeIndex] */ + UBool allocated; /* Was this UHashtable allocated? */ +}; +typedef struct UHashtable UHashtable; + +U_CDECL_END + +/******************************************************************** + * API + ********************************************************************/ + +/** + * Initialize a new UHashtable. + * @param keyHash A pointer to the key hashing function. Must not be + * NULL. + * @param keyComp A pointer to the function that compares keys. Must + * not be NULL. + * @param status A pointer to an UErrorCode to receive any errors. + * @return A pointer to a UHashtable, or 0 if an error occurred. + * @see uhash_openSize + */ +U_CAPI UHashtable* U_EXPORT2 +uhash_open(UHashFunction *keyHash, + UKeyComparator *keyComp, + UValueComparator *valueComp, + UErrorCode *status); + +/** + * Initialize a new UHashtable with a given initial size. + * @param keyHash A pointer to the key hashing function. Must not be + * NULL. + * @param keyComp A pointer to the function that compares keys. Must + * not be NULL. + * @param size The initial capacity of this hash table. + * @param status A pointer to an UErrorCode to receive any errors. + * @return A pointer to a UHashtable, or 0 if an error occurred. + * @see uhash_open + */ +U_CAPI UHashtable* U_EXPORT2 +uhash_openSize(UHashFunction *keyHash, + UKeyComparator *keyComp, + UValueComparator *valueComp, + int32_t size, + UErrorCode *status); + +/** + * Initialize an existing UHashtable. + * @param keyHash A pointer to the key hashing function. Must not be + * NULL. + * @param keyComp A pointer to the function that compares keys. Must + * not be NULL. + * @param status A pointer to an UErrorCode to receive any errors. + * @return A pointer to a UHashtable, or 0 if an error occurred. + * @see uhash_openSize + */ +U_CAPI UHashtable* U_EXPORT2 +uhash_init(UHashtable *hash, + UHashFunction *keyHash, + UKeyComparator *keyComp, + UValueComparator *valueComp, + UErrorCode *status); + +/** + * Initialize an existing UHashtable. + * @param keyHash A pointer to the key hashing function. Must not be + * NULL. + * @param keyComp A pointer to the function that compares keys. Must + * not be NULL. + * @param size The initial capacity of this hash table. + * @param status A pointer to an UErrorCode to receive any errors. + * @return A pointer to a UHashtable, or 0 if an error occurred. + * @see uhash_openSize + */ +U_CAPI UHashtable* U_EXPORT2 +uhash_initSize(UHashtable *hash, + UHashFunction *keyHash, + UKeyComparator *keyComp, + UValueComparator *valueComp, + int32_t size, + UErrorCode *status); + +/** + * Close a UHashtable, releasing the memory used. + * @param hash The UHashtable to close. If hash is NULL no operation is performed. + */ +U_CAPI void U_EXPORT2 +uhash_close(UHashtable *hash); + + + +/** + * Set the function used to hash keys. + * @param hash The UHashtable to set + * @param fn the function to be used hash keys; must not be NULL + * @return the previous key hasher; non-NULL + */ +U_CAPI UHashFunction *U_EXPORT2 +uhash_setKeyHasher(UHashtable *hash, UHashFunction *fn); + +/** + * Set the function used to compare keys. The default comparison is a + * void* pointer comparison. + * @param hash The UHashtable to set + * @param fn the function to be used compare keys; must not be NULL + * @return the previous key comparator; non-NULL + */ +U_CAPI UKeyComparator *U_EXPORT2 +uhash_setKeyComparator(UHashtable *hash, UKeyComparator *fn); + +/** + * Set the function used to compare values. The default comparison is a + * void* pointer comparison. + * @param hash The UHashtable to set + * @param fn the function to be used compare keys; must not be NULL + * @return the previous key comparator; non-NULL + */ +U_CAPI UValueComparator *U_EXPORT2 +uhash_setValueComparator(UHashtable *hash, UValueComparator *fn); + +/** + * Set the function used to delete keys. If this function pointer is + * NULL, this hashtable does not delete keys. If it is non-NULL, this + * hashtable does delete keys. This function should be set once + * before any elements are added to the hashtable and should not be + * changed thereafter. + * @param hash The UHashtable to set + * @param fn the function to be used delete keys, or NULL + * @return the previous key deleter; may be NULL + */ +U_CAPI UObjectDeleter *U_EXPORT2 +uhash_setKeyDeleter(UHashtable *hash, UObjectDeleter *fn); + +/** + * Set the function used to delete values. If this function pointer + * is NULL, this hashtable does not delete values. If it is non-NULL, + * this hashtable does delete values. This function should be set + * once before any elements are added to the hashtable and should not + * be changed thereafter. + * @param hash The UHashtable to set + * @param fn the function to be used delete values, or NULL + * @return the previous value deleter; may be NULL + */ +U_CAPI UObjectDeleter *U_EXPORT2 +uhash_setValueDeleter(UHashtable *hash, UObjectDeleter *fn); + +/** + * Specify whether or not, and how, the hastable resizes itself. + * By default, tables grow but do not shrink (policy U_GROW). + * See enum UHashResizePolicy. + * @param hash The UHashtable to set + * @param policy The way the hashtable resizes itself, {U_GROW, U_GROW_AND_SHRINK, U_FIXED} + */ +U_CAPI void U_EXPORT2 +uhash_setResizePolicy(UHashtable *hash, enum UHashResizePolicy policy); + +/** + * Get the number of key-value pairs stored in a UHashtable. + * @param hash The UHashtable to query. + * @return The number of key-value pairs stored in hash. + */ +U_CAPI int32_t U_EXPORT2 +uhash_count(const UHashtable *hash); + +/** + * Put a (key=pointer, value=pointer) item in a UHashtable. If the + * keyDeleter is non-NULL, then the hashtable owns 'key' after this + * call. If the valueDeleter is non-NULL, then the hashtable owns + * 'value' after this call. Storing a NULL value is the same as + * calling uhash_remove(). + * @param hash The target UHashtable. + * @param key The key to store. + * @param value The value to store, may be NULL (see above). + * @param status A pointer to an UErrorCode to receive any errors. + * @return The previous value, or NULL if none. + * @see uhash_get + */ +U_CAPI void* U_EXPORT2 +uhash_put(UHashtable *hash, + void *key, + void *value, + UErrorCode *status); + +/** + * Put a (key=integer, value=pointer) item in a UHashtable. + * keyDeleter must be NULL. If the valueDeleter is non-NULL, then the + * hashtable owns 'value' after this call. Storing a NULL value is + * the same as calling uhash_remove(). + * @param hash The target UHashtable. + * @param key The integer key to store. + * @param value The value to store, may be NULL (see above). + * @param status A pointer to an UErrorCode to receive any errors. + * @return The previous value, or NULL if none. + * @see uhash_get + */ +U_CAPI void* U_EXPORT2 +uhash_iput(UHashtable *hash, + int32_t key, + void* value, + UErrorCode *status); + +/** + * Put a (key=pointer, value=integer) item in a UHashtable. If the + * keyDeleter is non-NULL, then the hashtable owns 'key' after this + * call. valueDeleter must be NULL. Storing a 0 value is the same as + * calling uhash_remove(). + * @param hash The target UHashtable. + * @param key The key to store. + * @param value The integer value to store. + * @param status A pointer to an UErrorCode to receive any errors. + * @return The previous value, or 0 if none. + * @see uhash_get + */ +U_CAPI int32_t U_EXPORT2 +uhash_puti(UHashtable *hash, + void* key, + int32_t value, + UErrorCode *status); + +/** + * Put a (key=integer, value=integer) item in a UHashtable. If the + * keyDeleter is non-NULL, then the hashtable owns 'key' after this + * call. valueDeleter must be NULL. Storing a 0 value is the same as + * calling uhash_remove(). + * @param hash The target UHashtable. + * @param key The key to store. + * @param value The integer value to store. + * @param status A pointer to an UErrorCode to receive any errors. + * @return The previous value, or 0 if none. + * @see uhash_get + */ +U_CAPI int32_t U_EXPORT2 +uhash_iputi(UHashtable *hash, + int32_t key, + int32_t value, + UErrorCode *status); + +/** + * Retrieve a pointer value from a UHashtable using a pointer key, + * as previously stored by uhash_put(). + * @param hash The target UHashtable. + * @param key A pointer key stored in a hashtable + * @return The requested item, or NULL if not found. + */ +U_CAPI void* U_EXPORT2 +uhash_get(const UHashtable *hash, + const void *key); + +/** + * Retrieve a pointer value from a UHashtable using a integer key, + * as previously stored by uhash_iput(). + * @param hash The target UHashtable. + * @param key An integer key stored in a hashtable + * @return The requested item, or NULL if not found. + */ +U_CAPI void* U_EXPORT2 +uhash_iget(const UHashtable *hash, + int32_t key); + +/** + * Retrieve an integer value from a UHashtable using a pointer key, + * as previously stored by uhash_puti(). + * @param hash The target UHashtable. + * @param key A pointer key stored in a hashtable + * @return The requested item, or 0 if not found. + */ +U_CAPI int32_t U_EXPORT2 +uhash_geti(const UHashtable *hash, + const void* key); +/** + * Retrieve an integer value from a UHashtable using an integer key, + * as previously stored by uhash_iputi(). + * @param hash The target UHashtable. + * @param key An integer key stored in a hashtable + * @return The requested item, or 0 if not found. + */ +U_CAPI int32_t U_EXPORT2 +uhash_igeti(const UHashtable *hash, + int32_t key); + +/** + * Remove an item from a UHashtable stored by uhash_put(). + * @param hash The target UHashtable. + * @param key A key stored in a hashtable + * @return The item removed, or NULL if not found. + */ +U_CAPI void* U_EXPORT2 +uhash_remove(UHashtable *hash, + const void *key); + +/** + * Remove an item from a UHashtable stored by uhash_iput(). + * @param hash The target UHashtable. + * @param key An integer key stored in a hashtable + * @return The item removed, or NULL if not found. + */ +U_CAPI void* U_EXPORT2 +uhash_iremove(UHashtable *hash, + int32_t key); + +/** + * Remove an item from a UHashtable stored by uhash_puti(). + * @param hash The target UHashtable. + * @param key An key stored in a hashtable + * @return The item removed, or 0 if not found. + */ +U_CAPI int32_t U_EXPORT2 +uhash_removei(UHashtable *hash, + const void* key); + +/** + * Remove an item from a UHashtable stored by uhash_iputi(). + * @param hash The target UHashtable. + * @param key An integer key stored in a hashtable + * @return The item removed, or 0 if not found. + */ +U_CAPI int32_t U_EXPORT2 +uhash_iremovei(UHashtable *hash, + int32_t key); + +/** + * Remove all items from a UHashtable. + * @param hash The target UHashtable. + */ +U_CAPI void U_EXPORT2 +uhash_removeAll(UHashtable *hash); + +/** + * Locate an element of a UHashtable. The caller must not modify the + * returned object. The primary use of this function is to obtain the + * stored key when it may not be identical to the search key. For + * example, if the compare function is a case-insensitive string + * compare, then the hash key may be desired in order to obtain the + * canonical case corresponding to a search key. + * @param hash The target UHashtable. + * @param key A key stored in a hashtable + * @return a hash element, or NULL if the key is not found. + */ +U_CAPI const UHashElement* U_EXPORT2 +uhash_find(const UHashtable *hash, const void* key); + +/** + * \def UHASH_FIRST + * Constant for use with uhash_nextElement + * @see uhash_nextElement + */ +#define UHASH_FIRST (-1) + +/** + * Iterate through the elements of a UHashtable. The caller must not + * modify the returned object. However, uhash_removeElement() may be + * called during iteration to remove an element from the table. + * Iteration may safely be resumed afterwards. If uhash_put() is + * called during iteration the iteration will then be out of sync and + * should be restarted. + * @param hash The target UHashtable. + * @param pos This should be set to UHASH_FIRST initially, and left untouched + * thereafter. + * @return a hash element, or NULL if no further key-value pairs + * exist in the table. + */ +U_CAPI const UHashElement* U_EXPORT2 +uhash_nextElement(const UHashtable *hash, + int32_t *pos); + +/** + * Remove an element, returned by uhash_nextElement(), from the table. + * Iteration may be safely continued afterwards. + * @param hash The hashtable + * @param e The element, returned by uhash_nextElement(), to remove. + * Must not be NULL. Must not be an empty or deleted element (as long + * as this was returned by uhash_nextElement() it will not be empty or + * deleted). Note: Although this parameter is const, it will be + * modified. + * @return the value that was removed. + */ +U_CAPI void* U_EXPORT2 +uhash_removeElement(UHashtable *hash, const UHashElement* e); + +/******************************************************************** + * UHashTok convenience + ********************************************************************/ + +/** + * Return a UHashTok for an integer. + * @param i The given integer + * @return a UHashTok for an integer. + */ +/*U_CAPI UHashTok U_EXPORT2 +uhash_toki(int32_t i);*/ + +/** + * Return a UHashTok for a pointer. + * @param p The given pointer + * @return a UHashTok for a pointer. + */ +/*U_CAPI UHashTok U_EXPORT2 +uhash_tokp(void* p);*/ + +/******************************************************************** + * UChar* and char* Support Functions + ********************************************************************/ + +/** + * Generate a hash code for a null-terminated UChar* string. If the + * string is not null-terminated do not use this function. Use + * together with uhash_compareUChars. + * @param key The string (const UChar*) to hash. + * @return A hash code for the key. + */ +U_CAPI int32_t U_EXPORT2 +uhash_hashUChars(const UHashTok key); + +/** + * Generate a hash code for a null-terminated char* string. If the + * string is not null-terminated do not use this function. Use + * together with uhash_compareChars. + * @param key The string (const char*) to hash. + * @return A hash code for the key. + */ +U_CAPI int32_t U_EXPORT2 +uhash_hashChars(const UHashTok key); + +/** + * Generate a case-insensitive hash code for a null-terminated char* + * string. If the string is not null-terminated do not use this + * function. Use together with uhash_compareIChars. + * @param key The string (const char*) to hash. + * @return A hash code for the key. + */ +U_CAPI int32_t U_EXPORT2 +uhash_hashIChars(const UHashTok key); + +/** + * Comparator for null-terminated UChar* strings. Use together with + * uhash_hashUChars. + * @param key1 The string for comparison + * @param key2 The string for comparison + * @return true if key1 and key2 are equal, return false otherwise. + */ +U_CAPI UBool U_EXPORT2 +uhash_compareUChars(const UHashTok key1, const UHashTok key2); + +/** + * Comparator for null-terminated char* strings. Use together with + * uhash_hashChars. + * @param key1 The string for comparison + * @param key2 The string for comparison + * @return true if key1 and key2 are equal, return false otherwise. + */ +U_CAPI UBool U_EXPORT2 +uhash_compareChars(const UHashTok key1, const UHashTok key2); + +/** + * Case-insensitive comparator for null-terminated char* strings. Use + * together with uhash_hashIChars. + * @param key1 The string for comparison + * @param key2 The string for comparison + * @return true if key1 and key2 are equal, return false otherwise. + */ +U_CAPI UBool U_EXPORT2 +uhash_compareIChars(const UHashTok key1, const UHashTok key2); + +/******************************************************************** + * UnicodeString Support Functions + ********************************************************************/ + +/** + * Hash function for UnicodeString* keys. + * @param key The string (const char*) to hash. + * @return A hash code for the key. + */ +U_CAPI int32_t U_EXPORT2 +uhash_hashUnicodeString(const UElement key); + +/** + * Hash function for UnicodeString* keys (case insensitive). + * Make sure to use together with uhash_compareCaselessUnicodeString. + * @param key The string (const char*) to hash. + * @return A hash code for the key. + */ +U_CAPI int32_t U_EXPORT2 +uhash_hashCaselessUnicodeString(const UElement key); + +/******************************************************************** + * int32_t Support Functions + ********************************************************************/ + +/** + * Hash function for 32-bit integer keys. + * @param key The string (const char*) to hash. + * @return A hash code for the key. + */ +U_CAPI int32_t U_EXPORT2 +uhash_hashLong(const UHashTok key); + +/** + * Comparator function for 32-bit integer keys. + * @param key1 The integer for comparison + * @param Key2 The integer for comparison + * @return true if key1 and key2 are equal, return false otherwise + */ +U_CAPI UBool U_EXPORT2 +uhash_compareLong(const UHashTok key1, const UHashTok key2); + +/******************************************************************** + * Other Support Functions + ********************************************************************/ + +/** + * Deleter for Hashtable objects. + * @param obj The object to be deleted + */ +U_CAPI void U_EXPORT2 +uhash_deleteHashtable(void *obj); + +/* Use uprv_free() itself as a deleter for any key or value allocated using uprv_malloc. */ + +/** + * Checks if the given hash tables are equal or not. + * @param hash1 + * @param hash2 + * @return true if the hashtables are equal and false if not. + */ +U_CAPI UBool U_EXPORT2 +uhash_equals(const UHashtable* hash1, const UHashtable* hash2); + + +#if U_SHOW_CPLUSPLUS_API + +U_NAMESPACE_BEGIN + +/** + * \class LocalUHashtablePointer + * "Smart pointer" class, closes a UHashtable via uhash_close(). + * For most methods see the LocalPointerBase base class. + * + * @see LocalPointerBase + * @see LocalPointer + * @stable ICU 4.4 + */ +U_DEFINE_LOCAL_OPEN_POINTER(LocalUHashtablePointer, UHashtable, uhash_close); + +U_NAMESPACE_END + +#endif + +#endif diff --git a/icu-kube/icuheaders/uvectr64.h b/icu-kube/icuheaders/uvectr64.h new file mode 100644 index 00000000..1cc9a501 --- /dev/null +++ b/icu-kube/icuheaders/uvectr64.h @@ -0,0 +1,279 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html +/* +********************************************************************** +* Copyright (C) 1999-2014, International Business Machines +* Corporation and others. All Rights Reserved. +********************************************************************** +*/ + +// +// UVector64 is a class implementing a vector of 64 bit integers. +// It is similar to UVector32, but holds int64_t values rather than int32_t. +// Most of the code is unchanged from UVector. +// + +#ifndef UVECTOR64_H +#define UVECTOR64_H + +#include "unicode/utypes.h" +#include "unicode/uobject.h" +#include "uhash.h" +#include "uassert.h" + +U_NAMESPACE_BEGIN + + + +/** + *

Ultralightweight C++ implementation of an int64_t vector + * that has a subset of methods from UVector32 + * + *

This is a very simple implementation, written to satisfy an + * immediate porting need. As such, it is not completely fleshed out, + * and it aims for simplicity and conformity. Nonetheless, it serves + * its purpose (porting code from java that uses java.util.Vector) + * well, and it could be easily made into a more robust vector class. + * + *

Design notes + * + *

There is index bounds checking, but little is done about it. If + * indices are out of bounds, either nothing happens, or zero is + * returned. We do avoid indexing off into the weeds. + * + *

There is detection of out of memory, but the handling is very + * coarse-grained -- similar to UnicodeString's protocol, but even + * coarser. The class contains one static flag that is set + * when any call to new returns zero. This allows the caller + * to use several vectors and make just one check at the end to see if + * a memory failure occurred. This is more efficient than making a + * check after each call on each vector when doing many operations on + * multiple vectors. The single static flag works best when memory + * failures are infrequent, and when recovery options are limited or + * nonexistent. + * + *

To do + * + *

Improve the handling of index out of bounds errors. + * + */ +class U_COMMON_API UVector64 : public UObject { +private: + int32_t count; + + int32_t capacity; + + int32_t maxCapacity; // Limit beyond which capacity is not permitted to grow. + + int64_t* elements; + +public: + UVector64(UErrorCode &status); + + UVector64(int32_t initialCapacity, UErrorCode &status); + + virtual ~UVector64(); + + /** + * Assign this object to another (make this a copy of 'other'). + * Use the 'assign' function to assign each element. + */ + void assign(const UVector64& other, UErrorCode &ec); + + /** + * Compare this vector with another. They will be considered + * equal if they are of the same size and all elements are equal, + * as compared using this object's comparer. + */ + UBool operator==(const UVector64& other); + + /** + * Equivalent to !operator==() + */ + inline UBool operator!=(const UVector64& other); + + //------------------------------------------------------------ + // subset of java.util.Vector API + //------------------------------------------------------------ + + inline void addElement(int64_t elem, UErrorCode &status); + + void setElementAt(int64_t elem, int32_t index); + + void insertElementAt(int64_t elem, int32_t index, UErrorCode &status); + + inline int64_t elementAti(int32_t index) const; + + //UBool equals(const UVector64 &other) const; + + inline int64_t lastElementi(void) const; + + //int32_t indexOf(int64_t elem, int32_t startIndex = 0) const; + + //UBool contains(int64_t elem) const; + + //UBool containsAll(const UVector64& other) const; + + //UBool removeAll(const UVector64& other); + + //UBool retainAll(const UVector64& other); + + //void removeElementAt(int32_t index); + + void removeAllElements(); + + inline int32_t size(void) const; + + inline UBool isEmpty(void) const { return count == 0; } + + // Inline. Use this one for speedy size check. + inline UBool ensureCapacity(int32_t minimumCapacity, UErrorCode &status); + + // Out-of-line, handles actual growth. Called by ensureCapacity() when necessary. + UBool expandCapacity(int32_t minimumCapacity, UErrorCode &status); + + /** + * Change the size of this vector as follows: If newSize is + * smaller, then truncate the array, possibly deleting held + * elements for i >= newSize. If newSize is larger, grow the + * array, filling in new slows with zero. + */ + void setSize(int32_t newSize); + + //------------------------------------------------------------ + // New API + //------------------------------------------------------------ + + //UBool containsNone(const UVector64& other) const; + + + //void sortedInsert(int64_t elem, UErrorCode& ec); + + /** + * Returns a pointer to the internal array holding the vector. + */ + inline int64_t *getBuffer() const; + + /** + * Set the maximum allowed buffer capacity for this vector/stack. + * Default with no limit set is unlimited, go until malloc() fails. + * A Limit of zero means unlimited capacity. + * Units are vector elements (64 bits each), not bytes. + */ + void setMaxCapacity(int32_t limit); + + /** + * ICU "poor man's RTTI", returns a UClassID for this class. + */ + static UClassID U_EXPORT2 getStaticClassID(); + + /** + * ICU "poor man's RTTI", returns a UClassID for the actual class. + */ + virtual UClassID getDynamicClassID() const; + +private: + void _init(int32_t initialCapacity, UErrorCode &status); + + // Disallow + UVector64(const UVector64&); + + // Disallow + UVector64& operator=(const UVector64&); + + + // API Functions for Stack operations. + // In the original UVector, these were in a separate derived class, UStack. + // Here in UVector64, they are all together. +public: + //UBool empty(void) const; // TODO: redundant, same as empty(). Remove it? + + //int64_t peeki(void) const; + + inline int64_t popi(void); + + inline int64_t push(int64_t i, UErrorCode &status); + + inline int64_t *reserveBlock(int32_t size, UErrorCode &status); + inline int64_t *popFrame(int32_t size); +}; + + +// UVector64 inlines + +inline UBool UVector64::ensureCapacity(int32_t minimumCapacity, UErrorCode &status) { + if ((minimumCapacity >= 0) && (capacity >= minimumCapacity)) { + return TRUE; + } else { + return expandCapacity(minimumCapacity, status); + } +} + +inline int64_t UVector64::elementAti(int32_t index) const { + return (0 <= index && index < count) ? elements[index] : 0; +} + + +inline void UVector64::addElement(int64_t elem, UErrorCode &status) { + if (ensureCapacity(count + 1, status)) { + elements[count] = elem; + count++; + } +} + +inline int64_t *UVector64::reserveBlock(int32_t size, UErrorCode &status) { + if (ensureCapacity(count+size, status) == FALSE) { + return NULL; + } + int64_t *rp = elements+count; + count += size; + return rp; +} + +inline int64_t *UVector64::popFrame(int32_t size) { + U_ASSERT(count >= size); + count -= size; + if (count < 0) { + count = 0; + } + return elements+count-size; +} + + + +inline int32_t UVector64::size(void) const { + return count; +} + +inline int64_t UVector64::lastElementi(void) const { + return elementAti(count-1); +} + +inline UBool UVector64::operator!=(const UVector64& other) { + return !operator==(other); +} + +inline int64_t *UVector64::getBuffer() const { + return elements; +} + + +// UStack inlines + +inline int64_t UVector64::push(int64_t i, UErrorCode &status) { + addElement(i, status); + return i; +} + +inline int64_t UVector64::popi(void) { + int64_t result = 0; + if (count > 0) { + count--; + result = elements[count]; + } + return result; +} + +U_NAMESPACE_END + +#endif diff --git a/icu-kube/lighttpd.conf b/icu-kube/lighttpd.conf index 60a04e70..540f9732 100644 --- a/icu-kube/lighttpd.conf +++ b/icu-kube/lighttpd.conf @@ -1,4 +1,4 @@ -server.modules = ( "mod_alias", "mod_redirect", "mod_cgi" ) +server.modules = ( "mod_alias", "mod_rewrite", "mod_redirect", "mod_cgi" ) server.document-root = "/var/www/localhost/htdocs/" index-file.names = ( "index.html" ) @@ -10,7 +10,9 @@ mimetype.assign = ( ".jpg" => "image/jpeg", ".png" => "image/png" ) - +url.rewrite-once = ( + "^/icu-bin/collation.html" => "/collation.html" +) $HTTP["url"] =~ "^/icu-bin/" { alias.url += ( "/icu-bin/" => "/home/build/icu/usr/bin/" ) diff --git a/icu4jweb/.gitignore b/icu4jweb/.gitignore index ea8c4bf7..4874fbf3 100644 --- a/icu4jweb/.gitignore +++ b/icu4jweb/.gitignore @@ -1 +1,4 @@ /target +.classpath +.project +.settings diff --git a/icuapps.mk.in b/icuapps.mk.in index 830d8139..88338e3c 100644 --- a/icuapps.mk.in +++ b/icuapps.mk.in @@ -25,6 +25,7 @@ CPPFLAGS=$(shell @ICU_CONFIG@ --cppflags) @DEFS@ CFLAGS=$(shell @ICU_CONFIG@ --cflags) CXXFLAGS=$(shell @ICU_CONFIG@ --cxxflags) LDFLAGS =$(shell @ICU_CONFIG@ --ldflags) @LIBS@ +# We assume CFLAGS / CPPFLAGS for IO and OBSOLETE are the same, below… LDFLAGS_ICUIO =$(shell @ICU_CONFIG@ --ldflags-icuio) LDFLAGS_OBSOLETE =$(shell @ICU_CONFIG@ --ldflags-obsolete) INVOKE =$(shell @ICU_CONFIG@ --invoke) @@ -77,7 +78,13 @@ RMV=rm -rf %.o: $(srcdir)/%.cpp # list of CGIs -CGIAPPS=convexp idnbrowser translit locexp nbrowser scompare ubrowse redemo icudemos +CGIAPPS=convexp idnbrowser translit locexp nbrowser scompare ubrowse redemo icudemos icusegments + +# include icu-config's include file +# TODO we will need to remove this for a pkgconfig +ifneq ($(ICU_CONFIG),) +-include $(shell $(ICU_CONFIG) --incfile) +endif # optional override file -include $(top_srcdir)/icuapps-mk.local diff --git a/icudemos/Makefile.in b/icudemos/Makefile.in index 46510c55..3ec6f686 100644 --- a/icudemos/Makefile.in +++ b/icudemos/Makefile.in @@ -16,7 +16,6 @@ subdir = icudemos # srcdir must be set before this is included include $(top_builddir)/icuapps.mk -include $(shell $(ICU_CONFIG) --incfile) ## Extra files to remove for 'make clean' CLEANFILES = *~ *.res $(PKG).lst README_$(PKG).txt $(PKG).dat demolist.h diff --git a/icudemos/root.txt b/icudemos/root.txt index afad856f..e61c74cf 100644 --- a/icudemos/root.txt +++ b/icudemos/root.txt @@ -25,6 +25,10 @@ root { name { "Locale Explorer" } desc { "Illustrates the International Components for Unicode localization data." } } + icusegments { + name { "ICU Segments" } + desc { "Shows various ICU Segmentation (BreakIterator) boundaries" } + } nbrowser { name { "Normalization Browser" } diff --git a/icusegments/Makefile.in b/icusegments/Makefile.in index 9c3d5ff4..63dec4cc 100644 --- a/icusegments/Makefile.in +++ b/icusegments/Makefile.in @@ -15,7 +15,6 @@ subdir = icusegments # srcdir must be set before this is included include $(top_builddir)/icuapps.mk -include $(shell $(ICU_CONFIG) --incfile) ## Extra files to remove for 'make clean' CLEANFILES = *~ diff --git a/idnbrowser/Makefile.in b/idnbrowser/Makefile.in index da4b2ecb..9bb26ef9 100644 --- a/idnbrowser/Makefile.in +++ b/idnbrowser/Makefile.in @@ -51,7 +51,7 @@ install-local: all-local install-target install-target: all-local $(MKINSTALLDIRS) $(BINDIR) $(DESTDIR)$(BINDIR)/data $(INSTALL) $(TARGET) $(DESTDIR)$(BINDIR)/$(TARGET) - $(INSTALL) idna-header.html $(DESTDIR)$(BINDIR)/data + $(INSTALL) $(srcdir)/idna-header.html $(DESTDIR)$(BINDIR)/data dist-local: diff --git a/locexp/Makefile.in b/locexp/Makefile.in index a19d9bf8..a382b008 100644 --- a/locexp/Makefile.in +++ b/locexp/Makefile.in @@ -18,7 +18,6 @@ BUILTRES=resource/.builtres # srcdir must be set before this is included include $(top_builddir)/icuapps.mk --include $(shell $(ICU_CONFIG) --incfile) CPPFLAGS+=-I$(srcdir)/../apputil CPPFLAGS+=-I$(ICU_SORUCE)/common -I$(srcdir) diff --git a/locexp/resource/Makefile.in b/locexp/resource/Makefile.in index 199b1e3c..fe837e7f 100644 --- a/locexp/resource/Makefile.in +++ b/locexp/resource/Makefile.in @@ -19,7 +19,6 @@ subdir = locexp/resource # srcdir must be set before this is included include $(top_builddir)/icuapps.mk --include $(shell $(ICU_CONFIG) --incfile) # the 'locexp' directory lives inside the exported ICU data dir.. lxdatadir= $(libdir)/$(PACKAGE)/$(VERSION)/locexp @@ -50,7 +49,23 @@ RES_SHORT = $(ALLSRC:.txt=.res) RES=$(RES_SHORT) # C Source files to extract FSWF strings from. Remove items from here during development to not require a recompile. -FSWF_SRC= ../calexp.c ../cgimain.c ../fcgimain.c ../locexp.c ../lxconv.c ../lxdate.c ../lxlocale.c ../lxnum.c ../lxprint.c ../lxrun.c ../lxshow.cpp ../lxshowloc.c ../srchexp.c ../wfobject.c ../lxsort.c ../lxcgi.c ../lxicir.c +FSWF_SRC= $(srcdir)/../calexp.c $(srcdir)/../cgimain.c $(srcdir)/../fcgimain.c $(srcdir)/../locexp.c $(srcdir)/../lxconv.c $(srcdir)/../lxdate.c $(srcdir)/../lxlocale.c $(srcdir)/../lxnum.c $(srcdir)/../lxprint.c $(srcdir)/../lxrun.c $(srcdir)/../lxshow.cpp $(srcdir)/../lxshowloc.c $(srcdir)/../srchexp.c $(srcdir)/../wfobject.c $(srcdir)/../lxsort.c $(srcdir)/../lxcgi.c $(srcdir)/../lxicir.c + +all: root Makefile all-local + +ifneq ($(top_srcdir),.) +# for out of source, add a symlink for res files +root: $(srcdir)/root + ln -sv $< $@ +endif + +root.res : root.txt + @echo Rebuilding $@ + @$(INVOKE) $(GENRB) -d. $< + +res_index.res : res_index.txt + @echo Rebuilding $@ + @$(INVOKE) $(GENRB) -d. $< %.res : $(srcdir)/%.txt @echo Rebuilding $@ @@ -71,7 +86,6 @@ build-dirs -include Makefile.local ## List of standard targets -all: Makefile all-local install: install-local clean: clean-local distclean : distclean-local @@ -88,10 +102,10 @@ res-local: $(RES) $(OUT)/locexp.lst -include Makefile.res -root.txt: $(FSWF_SRC) root.txt.inc $(srcdir)/../tools/extractStrings.sh - $(INVOKE) PATH="$(srcdir)/../tools:$(bindir):$(sbindir):$(PATH)" extractStrings.sh $(FSWF_SRC) > ../resource/root.txt || ( rm -f root.txt ; false ) +root.txt: $(FSWF_SRC) $(srcdir)/root.txt.inc $(srcdir)/../tools/extractStrings.sh + $(INVOKE) PATH="$(srcdir)/../tools:$(bindir):$(sbindir):$(PATH)" srcdir=$(srcdir)/ extractStrings.sh $(FSWF_SRC) > ../resource/root.txt || ( rm -f root.txt ; false ) -res_index.txt: Makefile.in $(SRC) $(srcdir)/../tools/genIndex.sh +res_index.txt: $(srcdir)/Makefile.in $(SRC:%.txt=$(srcdir)/%.txt) $(srcdir)/../tools/genIndex.sh sh $(srcdir)/../tools/genIndex.sh $(SRC) $(srcdir)/root.txt > $@ install-local: install-res @@ -106,7 +120,7 @@ $(OUT)/locexp.lst: build-dirs Makefile done; install-res: all-local - $(INVOKE) $(XPATH) $(PKGDATA) -p $(PKG) -m $(PKGMODE) -v -c -d $(OUT) -T $(OUT) $(OUT)/locexp.lst -I $(libdir) + $(INVOKE) $(XPATH) $(PKGDATA) -p $(PKG) -m $(PKGMODE) -v -c -d $(OUT) -T $(OUT) $(OUT)/locexp.lst -I $(DESTDIR)$(libdir) dist-local: @@ -136,12 +150,12 @@ $(PKG)_root.res : $(srcdir)/root.txt $(INVOKE) $(GENRB) --package-name $(PKG) -d. -eutf-8 $< escapeABundle: $(srcdir)/escapeABundle.c - cc -o escapeABundle $(srcdir)/escapeABundle.c + cc -o escapeABundle $< -root_SAMPLE.txt: $(srcdir)/root.txt +root_SAMPLE.txt: root.txt echo "// Generated copy of root.txt. Also look at 'en.txt'." > root_SAMPLE.txt - cat < root.txt >> root_SAMPLE.txt + cat < $< >> root_SAMPLE.txt #-include *.d diff --git a/locexp/resource/root_SAMPLE.txt b/locexp/resource/root_SAMPLE.txt index c84124df..3437318e 100644 --- a/locexp/resource/root_SAMPLE.txt +++ b/locexp/resource/root_SAMPLE.txt @@ -1,6 +1,6 @@ // Generated copy of root.txt. Also look at 'en.txt'. // root file. Generated from ../calexp.c ../cgimain.c ../fcgimain.c ../locexp.c ../lxconv.c ../lxdate.c ../lxlocale.c ../lxnum.c ../lxprint.c ../lxrun.c ../lxshow.cpp ../lxshowloc.c ../srchexp.c ../wfobject.c ../lxsort.c ../lxcgi.c ../lxicir.c -// Copyright (C) 2000-2015, International Business Machines +// Copyright (C) 2000-2006, International Business Machines // It's probably not a good idea to change this file. // Better to change locexp.c or the ROOT.* source files and rebuild. @@ -10,46 +10,12 @@ root { ... { "..." } AmPmMarkers0 { "am" } AmPmMarkers1 { "pm" } - bigStringClickToExpand { "Truncated due to size. Click here to show. " } - bigStringClickToShow { "(Omitted due to size. Click here to show.)" } - bigStringHide { "Hide" } - bigStringShorten { "Don't show all" } - bigStringSize { "(%d of %d shown)" } Calendar_type_format { "Formatting" } Calendar_type_stand-alone { "Stand-alone" } - calexp_calTab { "Calendar" } - calexp_chg { "Change buttons:" } - calexp_chg_roll_decr { "Roll down" } - calexp_chg_roll_incr { "Roll up" } - calexp_chg_set_decr { "Decrement" } - calexp_chg_set_incr { "Increment" } - calexp_errGet { "Can't get initial date: " } - calexp_fieldsTab { "Fields" } - changeEncoding { "Change Your Encoding" } - changeLocale { "Change the Locale used for Labels" } - char { "Char" } - charMeaning { "Meaning" } - charNum { "#" } - chooseEncoding { "Choose Your Encoding" } - chooseLocale { "Choose Your Locale." } - chooseZone { "Choose Your Timezone." } Collation { "Collation" } - convERR { "AN error occured trying to sort the converters.\n" } - converter_matchesTo { "Looking for matches to these chars: " } - converter_searching { "Searching for converters which match .." } - convsAvail { "%d converters available, %d aliases total." } - convsMatch { "%d converters match (out of %d), %d aliases total." } - cumulative_notshown { "cumulative data from parent not shown" } - currCode { "Code" } - currDefault { "Default Currency for this locale" } - currDigits { "Decimal Digits" } - currName { "Name" } - currNoDefault { "No Default Currency" } - currNotInLoc { "Note: localization for this currency was not found in this locale" } - currSymbol { "Symbol" } + DateTimeElements { "Date and Time Options" } DateTimeElements0 { "First day of the week: " } DateTimeElements1 { "Minimal Days in First Week: " } - DateTimeElements { "Date and Time Options" } DateTimePatterns0 { "Full Time" } DateTimePatterns1 { "Long Time" } DateTimePatterns2 { "Medium Time" } @@ -62,128 +28,40 @@ root { DayAbbreviations { "Short Names" } DayNames { "Long Names" } DayNarrow { "Narrow Names" } - display_ALT { "Display Problems?" } - display_GIF { "displayproblems.gif" } - display_OPTIONS { "width=\x22\x31\x31\x34\x22 height=\x22\x31\x37\x22" } - empty { "(Empty)" } - encoding_mime { "Note (ICU 1.6 release): This list has been pared down to only show MIME aliases that browsers would understand. I'll add a 'show all' button later." } - encoding_Missing { "The following characters could not be displayed properly by the current encoding:" } - encodingOK0 { "Click here if the encoding '" } - encodingOK1 { "' is acceptable, or choose one from below." } - encoding_PickABetter { "Click here to search for a better encoding" } - encoding_translit_setting { "Transliteration:" } - EXPLORE_change { "Change" } EXPLORE_CollationElements_Defaults { "Reset Rules and Options" } EXPLORE_CollationElements_HideCollKey { "Hide Collation Key" } + EXPLORE_CollationElements_Prompt { "Type in some lines of text to be sorted." } + EXPLORE_CollationElements_Sort { "Sort" } EXPLORE_CollationElements_moreInfo1 { "For more information, see the" } EXPLORE_CollationElements_moreInfo2 { "ICU userguide" } EXPLORE_CollationElements_options { "Options" } - EXPLORE_CollationElements_Prompt { "Type in some lines of text to be sorted." } - EXPLORE_CollationElements_Sort { "Sort" } - EXPLORE_DateTimePatterns_dateAsNumber { "#" } EXPLORE_DateTimePatterns { "Explore > Date/Time" } - explore_G7 { "Try Multi-lingual Sorting" } - EXPLORE_NumberPatterns_defaultPattern { "#,###.###############" } + EXPLORE_DateTimePatterns_dateAsNumber { "#" } EXPLORE_NumberPatterns { "Explore > Numbers" } + EXPLORE_NumberPatterns_defaultPattern { "#,###.###############" } + EXPLORE_change { "Change" } EXPLORE_search_found { "%d items were found." } EXPLORE_search_notfound { "Sorry, nothing was found." } EXPLORE_search_oneperlocale { "Note that only the first match in each locale is shown." } - explore_search { "Search" } EXPLORE_search_searching { "Searching for %S..." } - exploreTitle { "Explore" } - explore_xlitomatic { "Translit-o-matic" } - formatExample_DateTimePatterns_errorFormat { "Couldn't format the date." } - formatExample_DateTimePatterns_What { "This example demonstrates the formatting of date and time patterns in this locale." } - formatExample_errorFormatDefault { "Unable to format number using default version of the pattern" } - formatExample_errorFormat_number { "Couldn't format the number." } - formatExample_errorOpen { "Couldn't open the formatter" } - formatExample_errorOpenDefault { "Couldn't open the default number fmt" } - formatExample_errorParse3 { "Could not parse this, replaced with a default value." } - formatExample_errorParse { "Could not parse this, replaced with a default value. Formatted This many chars:" } - formatExample_errorParse_num { "Could not parse this, replaced with a default value." } - formatExample_errorToPattern { "Couldn't convert the pattern [toPattern]" } - formatExample_NumberPatterns_What { "This example demonstrates formatting of numbers in this locale." } - helpgif { "help.gif" } - helpgif_opt { "border=\x22\x30\x22 width=\x22\x34\x30\x22 height=\x22\x34\x30\x22" } - help { "Help" } - ibmg11n { "ICU Demonstration - " } - icir_Basics { "Basics" } - icir_c { "Fixed" } - icir_email { "Email Address: (required for submissions)" } - icir_intro { "Each section below has an example in %S (as determined by the 'Display Locale' setting at the bottom of the page), followed by the translation in %S." } - icir_menu { "Section: " } - icir_Misc { "Misc" } - icir_none { "(no action)" } - icir_submit { "Submit" } - icirView { "Switch to Survey View" } - icir_v { "Verified" } - icir_w { "Incorrect" } - idat { "Date and Time" } - iloc { "Display Names" } - inherited_from { "(inherited from %S)" } - inherited { "(inherited)" } - introSpiel { "This demo illustrates the International Components for Unicode localization data. The data covers %V different languages, further divided into %V regions and variants. For each language, data such as days of the week, months, and their abbreviations are defined.

ICU is an open-source project." } - inum { "Numbers" } - keyword_Current { "Current" } - keyword_Default { "Default" } + LX_UCOL_DEFAULT { "Don't change" } + LX_UCOL_DEFAULTMSG0 { "Default (" } + LX_UCOL_DEFAULTMSG1 { ")" } + LocaleCodes { "Locale Codes" } LocaleCodes_3 { "3" } LocaleCodes_Country { "Region" } LocaleCodes_Language { "Language" } - LocaleCodes { "Locale Codes" } LocaleCodes_Region { "Region" } LocaleCodes_Variant { "Variant" } - localeDataDefault { "This is the default localization data, which will be used if no other installed locale is specified." } - localeDataEuro { "This Locale contains currency formatting information for use with the Euro currency." } - localeDataLangCountry { "This Locale contains data for this language, as well as conventions for this particular region." } - localeDataLangCountryVariant { "This Locale contains data for this language, as well as conventions for a variant within this particular region." } - localeDataLanguage { "No region is specified, so the data is generic to this language." } - localeDataWhat { "This page shows the localization data for the locale listed at left. " } - locale_experimental { "Locales in Italics are Draft and not officially supported." } - localeList_Calendar { "Calendars" } - localeList_Collation { "Collation" } - localeList_Currency { "Currency" } - localeList_Default { "(default)" } - localeList_Locale { "Languages" } - localeList_None { "(none)" } - localeList_Number { "Number" } - localeList_Sublocale { "Regions" } - locale { "locale" } - LocaleScriptAbbreviations { "Short Names" } LocaleScript { "Locale Script" } + LocaleScriptAbbreviations { "Short Names" } LocaleScriptNames { "Long Names" } - locale_unsupported { "This display locale, %s, is unsupported." } - localPatternChars0 { "Era" } - localPatternChars10 { "Day Of Year" } - localPatternChars11 { "Day Of Week In Month" } - localPatternChars12 { "Week Of Year" } - localPatternChars13 { "Week Of Month" } - localPatternChars14 { "Am/Pm" } - localPatternChars15 { "Hour 1" } - localPatternChars16 { "Hour 0" } - localPatternChars17 { "Timezone" } - localPatternChars18 { "Year (of 'Week of Year')" } - localPatternChars19 { "Day of Week (1=first day according to locale)" } - localPatternChars1 { "Year" } - localPatternChars2 { "Month" } - localPatternChars3 { "Day of Month" } - localPatternChars4 { "Hour Of Day 1" } - localPatternChars5 { "Hour Of Day 0" } - localPatternChars6 { "Minute" } - localPatternChars7 { "Second" } - localPatternChars8 { "Millisecond" } - localPatternChars9 { "Day Of Week" } - LX_UCOL_DEFAULT { "Don't change" } - LX_UCOL_DEFAULTMSG0 { "Default (" } - LX_UCOL_DEFAULTMSG1 { ")" } MonthAbbreviations { " - NOT USED - see DayAbbreviations " } MonthNames { " - NOT USED - see DayNames " } - myConverter { "Encoding:" } - myLocale { "Label Locale:" } NoLocale { "MISSING LOCALE NAME" } - none { "None" } NumberElements0 { "Decimal Separator" } - NumberElements10 { "Not a number" } NumberElements1 { "Grouping Separator" } + NumberElements10 { "Not a number" } NumberElements2 { "Pattern Separator" } NumberElements3 { "Percent" } NumberElements4 { "ZeroDigit" } @@ -196,30 +74,7 @@ root { NumberPatterns1 { "Currency Pattern" } NumberPatterns2 { "Percent Pattern" } NumberPatterns3 { "Scientific Pattern" } - off { "off" } - on { "on" } - otherLanguageSameCountryLocales { "%S under other languages" } - poweredby_cldr { "CLDR Version" } - poweredby_filebug { "File a bug" } - poweredby { "Powered by" } - poweredby_tz { "Timezone ID" } - rules { "Rules" } - set { "Set" } - showAll { "Show All" } - showSort_cantOpenCustomConverter { "Could not open a custom usort/collator for the following locale and reason" } - showSort_Context { "Error shown by this mark:" } - showSort_shortString { "Using Short String" } - sourceFile { "View Locale Source" } Spellout { "Spellout" } - statusTableHeaderChange { "(click to change)" } - statusTableHeader { "Your settings:" } - stringClickToShow { "(Click here to show.)" } - sublocales { "Sublocales:" } - taggedarrayTag { "Tag" } - title { "Locale Explorer" } - translit_CantOpenPair { "Warning: Could not open the transliterator for the locale pair." } - transliterate_help { "Transliteration Help" } - ubrowse { "Browse Unicode in this codepage" } UCAL_AM_PM { "AM/PM field" } UCAL_DATE { "Date field" } UCAL_DAY_OF_WEEK { "Day of week field" } @@ -236,8 +91,8 @@ root { UCAL_SECOND { "Second field" } UCAL_WEEK_OF_MONTH { "Week of month field" } UCAL_WEEK_OF_YEAR { "Week of year field" } - UCAL_YEAR_WOY { "Year / week of year" } UCAL_YEAR { "Year field" } + UCAL_YEAR_WOY { "Year / week of year" } UCAL_ZONE_OFFSET { "Zone offset field" } UCOL_ALTERNATE_HANDLING { "Alternate handling" } UCOL_CASE_FIRST { "Case first" } @@ -246,7 +101,6 @@ root { UCOL_HIRAGANA__QUATERNARY_MODE { "Add Hiragana Level" } UCOL_IDENTICAL { "L5 = L4 + Codepoint" } UCOL_LOWER_FIRST { "Force Lowercase first" } - UCOL_noforcecase { "Don't force case" } UCOL_NON_IGNORABLE { "Punctuation = Base" } UCOL_NORMALIZATION_MODE { "Full normalization mode" } UCOL_NUMERIC_COLLATION { "Numeric collation" } @@ -260,88 +114,16 @@ root { UCOL_STRENGTH { "Strength" } UCOL_TERTIARY { "L3 = L2 + Case" } UCOL_UPPER_FIRST { "Force Uppercase first" } + UCOL_noforcecase { "Don't force case" } U_MISSING_RESOURCE_ERROR { "(missing resource)" } - usort_attrib { "Attributes" } - usortCollated { "Collated" } - usortCustomRules { "Custom Rules" } - usortCustomRules_note0 { "Click" } - usortCustomRules_note1 { "above, to edit rules" } - usortLocaleRules1 { "Fetch rules for" } - usortLocaleRules2 { "" } - usortOriginal { "Original" } - usortSearchResults { "Search Results" } - usortSearch { "Search for: (or leave blank for no search)" } - usortSource { "Source" } - usortWhat { "This example demonstrates sorting (collation) in this locale." } Version { "Version" } - warningExperimentalLocale { "Note: You're viewing a Draft locale. This locale is not part of the official ICU installation.  " } - warningInheritedLocale { "Note: You're viewing a locale that does not have verified data . ICU will support this with inherited information, but that information is not verified to be correct." } - warningNoBug { "Please do not file bugs against this locale." } XMLcomp { "Compare" } XMLsource { "XML Source" } - zone_set { "Set timezone to:" } - zoneStrings0 { "Canonical" } - zoneStrings1 { "Normal Name" } - zoneStrings2 { "Normal Abbrev" } - zoneStrings3 { "Summer/DST Name" } - zoneStrings4 { "Summer/DST Abbrev" } - zoneStrings5 { "Example City" } - zoneStrings6 { "Raw Offset" } - zoneStrings_open_failed { "Unknown" } - zone_warn { "Note: only works if you have cookies turned on." } - -// Special Cases - - - // Imported from: root.txt.inc - -// [root.txt.inc] Copyright (c) 2000-2013 IBM, Inc. and Others, all rights reserved - - c.gif:import { "root/c.gif" } - opened.gif:import { "root/opened.gif" } - locexp.css:import { "root/locexp.css" } - locexp.js:import { "root/locexp.js" } - closed.gif:import { "root/closed.gif" } - help.html:import { "root/help.html" } - transliteration.html:import { "root/transliteration.html" } - sortHelp:include { "root/sortHelp.html" } - displayproblems.gif:import { "root/displayproblems.gif" } - explore.gif:import { "root/explore.gif" } - help.gif:import { "root/help.gif" } - incorrect.gif:import { "root/incorrect.gif" } - lx.jpg:import { "root/lx.jpg" } - lxbar_dev.jpg:import { "root/lxbar_dev.jpg" } - lxbar_g.gif:import { "root/lxbar_g.gif" } - lxbar_ibm.jpg:import { "root/lxbar_ibm.jpg" } - lxbar_icu.jpg:import { "root/lxbar_icu.jpg" } - "data/locexp-header.html":include { "root/locexp-header.html" } - -// tab - tab_bot.gif:import { "root/tab_bot.gif" } - tab_aleft.gif:import { "root/tab_aleft.gif" } - tab_aright.gif:import { "root/tab_aright.gif" } - - -} - -// root file. Generated from ../calexp.c ../cgimain.c ../fcgimain.c ../locexp.c ../lxconv.c ../lxdate.c ../lxlocale.c ../lxnum.c ../lxprint.c ../lxrun.c ../lxshow.cpp ../lxshowloc.c ../srchexp.c ../wfobject.c ../lxsort.c ../lxcgi.c ../lxicir.c -// Copyright (C) 2000-2006, International Business Machines -// It's probably not a good idea to change this file. -// Better to change locexp.c or the ROOT.* source files and rebuild. - - -root { - - ... { "..." } - AmPmMarkers0 { "am" } - AmPmMarkers1 { "pm" } bigStringClickToExpand { "Truncated due to size. Click here to show. " } bigStringClickToShow { "(Omitted due to size. Click here to show.)" } bigStringHide { "Hide" } bigStringShorten { "Don't show all" } bigStringSize { "(%d of %d shown)" } - Calendar_type_format { "Formatting" } - Calendar_type_stand-alone { "Stand-alone" } calexp_calTab { "Calendar" } calexp_chg { "Change buttons:" } calexp_chg_roll_decr { "Roll down" } @@ -358,7 +140,6 @@ root { chooseEncoding { "Choose Your Encoding" } chooseLocale { "Choose Your Locale." } chooseZone { "Choose Your Timezone." } - Collation { "Collation" } convERR { "AN error occured trying to sort the converters.\n" } converter_matchesTo { "Looking for matches to these chars: " } converter_searching { "Searching for converters which match .." } @@ -372,112 +153,56 @@ root { currNoDefault { "No Default Currency" } currNotInLoc { "Note: localization for this currency was not found in this locale" } currSymbol { "Symbol" } - DateTimeElements0 { "First day of the week: " } - DateTimeElements1 { "Minimal Days in First Week: " } - DateTimeElements { "Date and Time Options" } - DateTimePatterns0 { "Full Time" } - DateTimePatterns1 { "Long Time" } - DateTimePatterns2 { "Medium Time" } - DateTimePatterns3 { "Short Time" } - DateTimePatterns4 { "Full Date" } - DateTimePatterns5 { "Long Date" } - DateTimePatterns6 { "Medium Date" } - DateTimePatterns7 { "Short Date" } - DateTimePatterns8 { "Date-Time pattern.
{0} = time, {1} = date" } - DayAbbreviations { "Short Names" } - DayNames { "Long Names" } - DayNarrow { "Narrow Names" } display_ALT { "Display Problems?" } display_GIF { "displayproblems.gif" } display_OPTIONS { "width=\x22\x31\x31\x34\x22 height=\x22\x31\x37\x22" } empty { "(Empty)" } - encoding_mime { "Note (ICU 1.6 release): This list has been pared down to only show MIME aliases that browsers would understand. I'll add a 'show all' button later." } - encoding_Missing { "The following characters could not be displayed properly by the current encoding:" } encodingOK0 { "Click here if the encoding '" } encodingOK1 { "' is acceptable, or choose one from below." } + encoding_Missing { "The following characters could not be displayed properly by the current encoding:" } encoding_PickABetter { "Click here to search for a better encoding" } + encoding_mime { "Note (ICU 1.6 release): This list has been pared down to only show MIME aliases that browsers would understand. I'll add a 'show all' button later." } encoding_translit_setting { "Transliteration:" } - EXPLORE_change { "Change" } - EXPLORE_CollationElements_Defaults { "Reset Rules and Options" } - EXPLORE_CollationElements_HideCollKey { "Hide Collation Key" } - EXPLORE_CollationElements_moreInfo1 { "For more information, see the" } - EXPLORE_CollationElements_moreInfo2 { "ICU userguide" } - EXPLORE_CollationElements_options { "Options" } - EXPLORE_CollationElements_Prompt { "Type in some lines of text to be sorted." } - EXPLORE_CollationElements_Sort { "Sort" } - EXPLORE_DateTimePatterns_dateAsNumber { "#" } - EXPLORE_DateTimePatterns { "Explore > Date/Time" } + exploreTitle { "Explore" } explore_G7 { "Try Multi-lingual Sorting" } - EXPLORE_NumberPatterns_defaultPattern { "#,###.###############" } - EXPLORE_NumberPatterns { "Explore > Numbers" } - EXPLORE_search_found { "%d items were found." } - EXPLORE_search_notfound { "Sorry, nothing was found." } - EXPLORE_search_oneperlocale { "Note that only the first match in each locale is shown." } explore_search { "Search" } - EXPLORE_search_searching { "Searching for %S..." } - exploreTitle { "Explore" } explore_xlitomatic { "Translit-o-matic" } - formatExample_DateTimePatterns_errorFormat { "Couldn't format the date." } formatExample_DateTimePatterns_What { "This example demonstrates the formatting of date and time patterns in this locale." } + formatExample_DateTimePatterns_errorFormat { "Couldn't format the date." } + formatExample_NumberPatterns_What { "This example demonstrates formatting of numbers in this locale." } formatExample_errorFormatDefault { "Unable to format number using default version of the pattern" } formatExample_errorFormat_number { "Couldn't format the number." } formatExample_errorOpen { "Couldn't open the formatter" } formatExample_errorOpenDefault { "Couldn't open the default number fmt" } - formatExample_errorParse3 { "Could not parse this, replaced with a default value." } formatExample_errorParse { "Could not parse this, replaced with a default value. Formatted This many chars:" } + formatExample_errorParse3 { "Could not parse this, replaced with a default value." } formatExample_errorParse_num { "Could not parse this, replaced with a default value." } formatExample_errorToPattern { "Couldn't convert the pattern [toPattern]" } - formatExample_NumberPatterns_What { "This example demonstrates formatting of numbers in this locale." } + help { "Help" } helpgif { "help.gif" } helpgif_opt { "border=\x22\x30\x22 width=\x22\x34\x30\x22 height=\x22\x34\x30\x22" } - help { "Help" } ibmg11n { "ICU Demonstration - " } + icirView { "Switch to Survey View" } icir_Basics { "Basics" } + icir_Misc { "Misc" } icir_c { "Fixed" } icir_email { "Email Address: (required for submissions)" } icir_intro { "Each section below has an example in %S (as determined by the 'Display Locale' setting at the bottom of the page), followed by the translation in %S." } icir_menu { "Section: " } - icir_Misc { "Misc" } icir_none { "(no action)" } icir_submit { "Submit" } - icirView { "Switch to Survey View" } icir_v { "Verified" } icir_w { "Incorrect" } idat { "Date and Time" } iloc { "Display Names" } - inherited_from { "(inherited from %S)" } inherited { "(inherited)" } + inherited_from { "(inherited from %S)" } introSpiel { "This demo illustrates the International Components for Unicode localization data. The data covers %V different languages, further divided into %V regions and variants. For each language, data such as days of the week, months, and their abbreviations are defined.

ICU is an open-source project." } inum { "Numbers" } keyword_Current { "Current" } keyword_Default { "Default" } - LocaleCodes_3 { "3" } - LocaleCodes_Country { "Region" } - LocaleCodes_Language { "Language" } - LocaleCodes { "Locale Codes" } - LocaleCodes_Region { "Region" } - LocaleCodes_Variant { "Variant" } - localeDataDefault { "This is the default localization data, which will be used if no other installed locale is specified." } - localeDataEuro { "This Locale contains currency formatting information for use with the Euro currency." } - localeDataLangCountry { "This Locale contains data for this language, as well as conventions for this particular region." } - localeDataLangCountryVariant { "This Locale contains data for this language, as well as conventions for a variant within this particular region." } - localeDataLanguage { "No region is specified, so the data is generic to this language." } - localeDataWhat { "This page shows the localization data for the locale listed at left. " } - locale_experimental { "Locales in Italics are Draft and not officially supported." } - localeList_Calendar { "Calendars" } - localeList_Collation { "Collation" } - localeList_Currency { "Currency" } - localeList_Default { "(default)" } - localeList_Locale { "Languages" } - localeList_None { "(none)" } - localeList_Number { "Number" } - localeList_Sublocale { "Regions" } - locale { "locale" } - LocaleScriptAbbreviations { "Short Names" } - LocaleScript { "Locale Script" } - LocaleScriptNames { "Long Names" } - locale_unsupported { "This display locale, %s, is unsupported." } localPatternChars0 { "Era" } + localPatternChars1 { "Year" } localPatternChars10 { "Day Of Year" } localPatternChars11 { "Day Of Week In Month" } localPatternChars12 { "Week Of Year" } @@ -488,7 +213,6 @@ root { localPatternChars17 { "Timezone" } localPatternChars18 { "Year (of 'Week of Year')" } localPatternChars19 { "Day of Week (1=first day according to locale)" } - localPatternChars1 { "Year" } localPatternChars2 { "Month" } localPatternChars3 { "Day of Month" } localPatternChars4 { "Hour Of Day 1" } @@ -497,47 +221,42 @@ root { localPatternChars7 { "Second" } localPatternChars8 { "Millisecond" } localPatternChars9 { "Day Of Week" } - LX_UCOL_DEFAULT { "Don't change" } - LX_UCOL_DEFAULTMSG0 { "Default (" } - LX_UCOL_DEFAULTMSG1 { ")" } - MonthAbbreviations { " - NOT USED - see DayAbbreviations " } - MonthNames { " - NOT USED - see DayNames " } + locale { "locale" } + localeDataDefault { "This is the default localization data, which will be used if no other installed locale is specified." } + localeDataEuro { "This Locale contains currency formatting information for use with the Euro currency." } + localeDataLangCountry { "This Locale contains data for this language, as well as conventions for this particular region." } + localeDataLangCountryVariant { "This Locale contains data for this language, as well as conventions for a variant within this particular region." } + localeDataLanguage { "No region is specified, so the data is generic to this language." } + localeDataWhat { "This page shows the localization data for the locale listed at left. " } + localeList_Calendar { "Calendars" } + localeList_Collation { "Collation" } + localeList_Currency { "Currency" } + localeList_Default { "(default)" } + localeList_Locale { "Languages" } + localeList_None { "(none)" } + localeList_Number { "Number" } + localeList_Sublocale { "Regions" } + locale_experimental { "Locales in Italics are Draft and not officially supported." } + locale_unsupported { "This display locale, %s, is unsupported." } myConverter { "Encoding:" } myLocale { "Label Locale:" } - NoLocale { "MISSING LOCALE NAME" } none { "None" } - NumberElements0 { "Decimal Separator" } - NumberElements10 { "Not a number" } - NumberElements1 { "Grouping Separator" } - NumberElements2 { "Pattern Separator" } - NumberElements3 { "Percent" } - NumberElements4 { "ZeroDigit" } - NumberElements5 { "Digit" } - NumberElements6 { "Minus Sign" } - NumberElements7 { "Exponential" } - NumberElements8 { "PerMill [/1000]" } - NumberElements9 { "Infinity" } - NumberPatterns0 { "Decimal Pattern" } - NumberPatterns1 { "Currency Pattern" } - NumberPatterns2 { "Percent Pattern" } - NumberPatterns3 { "Scientific Pattern" } off { "off" } on { "on" } otherLanguageSameCountryLocales { "%S under other languages" } + poweredby { "Powered by" } poweredby_cldr { "CLDR Version" } poweredby_filebug { "File a bug" } - poweredby { "Powered by" } poweredby_tz { "Timezone ID" } rules { "Rules" } set { "Set" } showAll { "Show All" } - showSort_cantOpenCustomConverter { "Could not open a custom usort/collator for the following locale and reason" } showSort_Context { "Error shown by this mark:" } + showSort_cantOpenCustomConverter { "Could not open a custom usort/collator for the following locale and reason" } showSort_shortString { "Using Short String" } sourceFile { "View Locale Source" } - Spellout { "Spellout" } - statusTableHeaderChange { "(click to change)" } statusTableHeader { "Your settings:" } + statusTableHeaderChange { "(click to change)" } stringClickToShow { "(Click here to show.)" } sublocales { "Sublocales:" } taggedarrayTag { "Tag" } @@ -545,48 +264,6 @@ root { translit_CantOpenPair { "Warning: Could not open the transliterator for the locale pair." } transliterate_help { "Transliteration Help" } ubrowse { "Browse Unicode in this codepage" } - UCAL_AM_PM { "AM/PM field" } - UCAL_DATE { "Date field" } - UCAL_DAY_OF_WEEK { "Day of week field" } - UCAL_DAY_OF_WEEK_IN_MONTH { "Day of week in month field" } - UCAL_DAY_OF_YEAR { "Day of year field" } - UCAL_DOW_LOCAL { "Day of week localized (1..7)" } - UCAL_DST_OFFSET { "DST offset field" } - UCAL_ERA { "Era field" } - UCAL_HOUR { "Hour field" } - UCAL_HOUR_OF_DAY { "Hour of day field" } - UCAL_MILLISECOND { "Millisecond field" } - UCAL_MINUTE { "Minute field" } - UCAL_MONTH { "Month field" } - UCAL_SECOND { "Second field" } - UCAL_WEEK_OF_MONTH { "Week of month field" } - UCAL_WEEK_OF_YEAR { "Week of year field" } - UCAL_YEAR_WOY { "Year / week of year" } - UCAL_YEAR { "Year field" } - UCAL_ZONE_OFFSET { "Zone offset field" } - UCOL_ALTERNATE_HANDLING { "Alternate handling" } - UCOL_CASE_FIRST { "Case first" } - UCOL_CASE_LEVEL { "Add case level" } - UCOL_FRENCH_COLLATION { "French accents" } - UCOL_HIRAGANA__QUATERNARY_MODE { "Add Hiragana Level" } - UCOL_IDENTICAL { "L5 = L4 + Codepoint" } - UCOL_LOWER_FIRST { "Force Lowercase first" } - UCOL_noforcecase { "Don't force case" } - UCOL_NON_IGNORABLE { "Punctuation = Base" } - UCOL_NORMALIZATION_MODE { "Full normalization mode" } - UCOL_NUMERIC_COLLATION { "Numeric collation" } - UCOL_OFF { "Off" } - UCOL_ON { "On" } - UCOL_ON_WITHOUT_HANGUL { "On,without Hangul" } - UCOL_PRIMARY { "L1 = Base Letters" } - UCOL_QUATERNARY { "L4 = L3 + Punct." } - UCOL_SECONDARY { "L2 = L1 + Accents" } - UCOL_SHIFTED { "Ignore Punctuation" } - UCOL_STRENGTH { "Strength" } - UCOL_TERTIARY { "L3 = L2 + Case" } - UCOL_UPPER_FIRST { "Force Uppercase first" } - U_MISSING_RESOURCE_ERROR { "(missing resource)" } - usort_attrib { "Attributes" } usortCollated { "Collated" } usortCustomRules { "Custom Rules" } usortCustomRules_note0 { "Click" } @@ -594,17 +271,14 @@ root { usortLocaleRules1 { "Fetch rules for" } usortLocaleRules2 { "" } usortOriginal { "Original" } - usortSearchResults { "Search Results" } usortSearch { "Search for: (or leave blank for no search)" } + usortSearchResults { "Search Results" } usortSource { "Source" } usortWhat { "This example demonstrates sorting (collation) in this locale." } - Version { "Version" } + usort_attrib { "Attributes" } warningExperimentalLocale { "Note: You're viewing a Draft locale. This locale is not part of the official ICU installation.  " } warningInheritedLocale { "Note: You're viewing a locale that does not have verified data . ICU will support this with inherited information, but that information is not verified to be correct." } warningNoBug { "Please do not file bugs against this locale." } - XMLcomp { "Compare" } - XMLsource { "XML Source" } - zone_set { "Set timezone to:" } zoneStrings0 { "Canonical" } zoneStrings1 { "Normal Name" } zoneStrings2 { "Normal Abbrev" } @@ -613,6 +287,7 @@ root { zoneStrings5 { "Example City" } zoneStrings6 { "Raw Offset" } zoneStrings_open_failed { "Unknown" } + zone_set { "Set timezone to:" } zone_warn { "Note: only works if you have cookies turned on." } // Special Cases diff --git a/locexp/tools/Makefile.in b/locexp/tools/Makefile.in index de6a9f5b..04c95723 100644 --- a/locexp/tools/Makefile.in +++ b/locexp/tools/Makefile.in @@ -15,7 +15,6 @@ subdir = locexp/tools # srcdir must be set before this is included include $(top_builddir)/icuapps.mk --include $(shell $(ICU_CONFIG) --incfile) SCRIPTS = genIndex.sh emitResourceFromFile.sh extractStrings.sh @@ -52,10 +51,10 @@ install-local: all-local install-target install-target: all-local - $(MKINSTALLDIRS) $(bindir) - $(INSTALL_PROGRAM) $(TARGET) $(sbindir)/$(TARGET) + $(MKINSTALLDIRS) $(DESTDIR)$(bindir) + $(INSTALL_PROGRAM) $(TARGET) $(DESTDIR)$(sbindir)/$(TARGET) @for script in $(SCRIPTS) ; do \ - $(INSTALL_SCRIPT) $(srcdir)/$(script) $(sbindir) ;\ + $(INSTALL_SCRIPT) $(srcdir)/$$script $(DESTDIR)$(sbindir) ;\ done dist-local: diff --git a/locexp/tools/extractStrings.sh b/locexp/tools/extractStrings.sh index 9bb562f9..b404e585 100755 --- a/locexp/tools/extractStrings.sh +++ b/locexp/tools/extractStrings.sh @@ -43,12 +43,12 @@ echo "root {" echo fgrep -h 'FSWF("' $* | sed -e 's%.*FSWF("\([^"]*\)",[ ]*"\([^"]*\)".*% \1 { "\2" }%' | sort | uniq echo -if [ -f root.txt.inc ]; then +if [ -f ${srcdir}root.txt.inc ]; then echo "// Special Cases" echo echo echo " // Imported from: root.txt.inc " - cat root.txt.inc + cat ${srcdir}root.txt.inc fi echo echo "}" diff --git a/locexp/util/Makefile.in b/locexp/util/Makefile.in index f7484b2b..422a3a5b 100644 --- a/locexp/util/Makefile.in +++ b/locexp/util/Makefile.in @@ -13,7 +13,6 @@ subdir = locexp/util # srcdir must be set before this is included include $(top_builddir)/icuapps.mk --include $(shell $(ICU_CONFIG) --incfile) FINAL_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION) @@ -84,15 +83,15 @@ all-local: $(ALL_TARGETS) install-local: all-local install-headers install-library install-library: all-local - $(MKINSTALLDIRS) $(libdir) - $(INSTALL) $(SO_TARGET) $(libdir)/$(SO_TARGET) + $(MKINSTALLDIRS) $(DESTDIR)$(libdir) + $(INSTALL) $(SO_TARGET) $(DESTDIR)$(libdir)/$(SO_TARGET) install-headers: $(MKINSTALLDIRS) $(includedir) @list='$(HEADERS)'; for file in $$list; do \ - echo " $(INSTALL_DATA) $$file $(includedir)/$$file"; \ - $(INSTALL_DATA) $$file $(includedir)/$$file; \ + echo " $(INSTALL_DATA) $(srcdir)/$$file $(DESTDIR)$(includedir)/$$file"; \ + $(INSTALL_DATA) $(srcdir)/$$file $(DESTDIR)$(includedir)/$$file; \ done diff --git a/locexp2/Makefile.in b/locexp2/Makefile.in index c52c22e1..4491a77d 100644 --- a/locexp2/Makefile.in +++ b/locexp2/Makefile.in @@ -15,7 +15,6 @@ subdir = locexp2 include $(top_builddir)/icuapps.mk -include $(shell $(ICU_CONFIG) --incfile) DYNAMICCPPFLAGS = $(SHAREDLIBCPPFLAGS) DYNAMICCFLAGS = $(SHAREDLIBCFLAGS) diff --git a/nbrowser/Makefile.in b/nbrowser/Makefile.in index fed31a23..367ab1fa 100644 --- a/nbrowser/Makefile.in +++ b/nbrowser/Makefile.in @@ -53,7 +53,7 @@ install-local: all-local install-target install-target: all-local $(MKINSTALLDIRS) $(BINDIR) $(DESTDIR)$(BINDIR)/data $(INSTALL) $(TARGET) $(DESTDIR)$(BINDIR)/$(TARGET) - $(INSTALL) normalization-header.html $(DESTDIR)$(BINDIR)/data + $(INSTALL) $(srcdir)/normalization-header.html $(DESTDIR)$(BINDIR)/data dist-local: diff --git a/obsolete/Makefile.in b/obsolete/Makefile.in index 00753df6..d8ec9dcd 100644 --- a/obsolete/Makefile.in +++ b/obsolete/Makefile.in @@ -21,8 +21,6 @@ CFLAGS += $(SHAREDLIBCFLAGS) include $(top_builddir)/icuapps.mk --include $(shell $(ICU_CONFIG) --incfile) - CPPFLAGS += -I$(ICU_SOURCE)/common -I$(srcdir) ## Extra files to remove for 'make clean' diff --git a/redemo/Makefile.in b/redemo/Makefile.in index dbb9629c..85aeade8 100644 --- a/redemo/Makefile.in +++ b/redemo/Makefile.in @@ -42,9 +42,9 @@ install-local: all-local install-target install-target: all-local - $(INSTALL) $(TARGET) $(BINDIR)/$(TARGET) - $(MKINSTALLDIRS) $(BINDIR) $(BINDIR)/data - $(INSTALL) redemo.html $(BINDIR)/data + $(INSTALL) $(TARGET) $(DESTDIR)$(BINDIR)/$(TARGET) + $(MKINSTALLDIRS) $(DESTDIR)$(BINDIR) $(DESTDIR)$(BINDIR)/data + $(INSTALL) $(srcdir)/redemo.html $(DESTDIR)$(BINDIR)/data dist-local: diff --git a/scompare/Makefile.in b/scompare/Makefile.in index aefedd9b..1e9098f5 100644 --- a/scompare/Makefile.in +++ b/scompare/Makefile.in @@ -54,8 +54,8 @@ install-local: all-local install-target install-target: all-local $(MKINSTALLDIRS) $(BINDIR) $(DESTDIR)$(BINDIR)/data $(INSTALL) $(TARGET) $(DESTDIR)$(BINDIR)/$(TARGET) - $(INSTALL) scompare-content-templ.html $(DESTDIR)$(BINDIR)/data - $(INSTALL) scompare-page-templ.html $(DESTDIR)$(BINDIR)/data + $(INSTALL) $(srcdir)/scompare-content-templ.html $(DESTDIR)$(BINDIR)/data + $(INSTALL) $(srcdir)/scompare-page-templ.html $(DESTDIR)$(BINDIR)/data dist-local: diff --git a/test/obstest/Makefile.in b/test/obstest/Makefile.in index b4797a9c..e1686f01 100644 --- a/test/obstest/Makefile.in +++ b/test/obstest/Makefile.in @@ -16,10 +16,6 @@ subdir = test/obstest include $(top_builddir)/icuapps.mk -# for the LDLIBRARYPATH_ENVVAR -include $(shell @ICU_CONFIG@ --incfile) - - ## Extra files to remove for 'make clean' CLEANFILES = *~ diff --git a/test/testdata/Makefile.in b/test/testdata/Makefile.in index 8381e873..5da56aa5 100644 --- a/test/testdata/Makefile.in +++ b/test/testdata/Makefile.in @@ -13,7 +13,6 @@ subdir = test/testdata # srcdir must be set before this is included include $(top_builddir)/icuapps.mk --include $(shell $(ICU_CONFIG) --incfile) ## Extra files to remove for 'make clean' CLEANFILES = *~ diff --git a/translitdemo/Makefile b/translitdemo/Makefile index 99c2c553..732b9d3c 100644 --- a/translitdemo/Makefile +++ b/translitdemo/Makefile @@ -44,7 +44,7 @@ OBJECTS += util.o OBJECTS += TextCache.o CPPFLAGS += -I$(ICU_COMMON_HEADERS) -CPPFLAGS += -I../apputil +CPPFLAGS += -I$(base_top_srcdir)/apputil -I../apputil ICULIBS := -L../apputil $(ICULIBS) -lapputil $(ICULIBS_ICUIO) @@ -67,15 +67,15 @@ $(TARGET): $(OBJECTS) TRANSLITD=$(bindir)/data install: all - -mkdir $(bindir) - cp $(TARGET) $(bindir) - -mkdir $(TRANSLITD) - cp data/js/*.js $(TRANSLITD)/ - cp data/*.html $(TRANSLITD) - -mkdir $(TRANSLITD)/cache - -chmod a+rw $(TRANSLITD)/cache - -find $(TRANSLITD) -type d -print | xargs chmod a+x - -find $(TRANSLITD) -type f -print | xargs chmod a+r + -mkdir $(DESTDIR)$(bindir) + cp $(TARGET) $(DESTDIR)$(bindir) + -mkdir $(DESTDIR)$(TRANSLITD) + cp data/js/*.js $(DESTDIR)$(TRANSLITD)/ + cp data/*.html $(DESTDIR)$(TRANSLITD) + -mkdir $(DESTDIR)$(TRANSLITD)/cache + -chmod a+rw $(DESTDIR)$(TRANSLITD)/cache + -find $(DESTDIR)$(TRANSLITD) -type d -print | xargs chmod a+x + -find $(DESTDIR)$(TRANSLITD) -type f -print | xargs chmod a+r $(ICU_INC): @echo "Please read the directions at the top of this file (Makefile)" diff --git a/ubrowse/.gitignore b/ubrowse/.gitignore new file mode 100644 index 00000000..4c7e3596 --- /dev/null +++ b/ubrowse/.gitignore @@ -0,0 +1,2 @@ +res/root.txt +res/*.xlf \ No newline at end of file diff --git a/ubrowse/Makefile.in b/ubrowse/Makefile.in index e77b57cd..fbea2fc8 100644 --- a/ubrowse/Makefile.in +++ b/ubrowse/Makefile.in @@ -20,10 +20,12 @@ include $(top_builddir)/icuapps.mk CLEANFILES = *~ README_$(PKG).txt $(PKG).* icons.txt *.res ubrowse.msg ## Target information -TARGET = ubrowse +TARGET = $(subdir) -LDFLAGS += -L../apputil -lapputil -L../locexp/util -liculxutil $(LDFLAGS_ICUIO) CPPFLAGS += -I$(top_srcdir)/apputil +ICULIBS := -L../apputil -lapputil -L../locexp/util -liculxutil $(LDFLAGS_ICUIO) $(ICULIBS) +LDFLAGS += $(ICULIBS) + ITMP=icontmp ICONS=icons RES_DIR=res @@ -63,7 +65,7 @@ install-local: all-local install-target install-target: all-local $(MKINSTALLDIRS) $(BINDIR) $(DESTDIR)$(BINDIR)/data $(INSTALL) $(TARGET) $(DESTDIR)$(BINDIR)/$(TARGET) - $(INSTALL) ubrowse-header.html $(DESTDIR)$(BINDIR)/data + $(INSTALL) $(srcdir)/ubrowse-header.html $(DESTDIR)$(BINDIR)/data $(INVOKE) $(PKGDATA) -I $(DESTDIR)$(BINDIR)/../lib -p $(PKG) -m $(PKGMODE) -c -d $(OUT) -T $(OUT) $(PKG).lst dist-local: @@ -90,12 +92,13 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -include local.mk -include Makefile.local -TRANSLATION_SRC=ubrowse.c +TRANSLATION_SRC=$(srcdir)/ubrowse.c -ubrowse.msg: $(TRANSLATION_SRC) extractStringsUltra.sh extractStrings.sed - $(SHELL) ./extractStringsUltra.sh $(TRANSLATION_SRC) > $@ +ubrowse.msg: $(TRANSLATION_SRC) $(srcdir)/extractStringsUltra.sh $(srcdir)/extractStrings.sed + srcdir=$(srcdir) $(SHELL) $(srcdir)/extractStringsUltra.sh $(TRANSLATION_SRC) > $@ $(RES_DIR)/root.txt: ubrowse.msg + @$(MKINSTALLDIRS) $(RES_DIR) @cp $^ $@.tmp @if [ ! -f $@ ]; then \ echo installing new $@ ; \ @@ -110,6 +113,7 @@ $(RES_DIR)/root.txt: ubrowse.msg fi $(RES_DIR)/root.xlf: $(RES_DIR)/root.txt + @$(MKINSTALLDIRS) $(RES_DIR) $(INVOKE) $(GENRB) -s $(RES_DIR) -d $(RES_DIR) root.txt -x #mt.res: $(RES_DIR)/mt.xlf @@ -126,12 +130,13 @@ $(TARGET) : $(OBJECTS) icons.res: icons.txt $(INVOKE) $(GENRB) -d. $< -icons.txt: $(ICONS)/*.gif +icons.txt: $(srcdir)/$(ICONS)/*.gif + @$(MKINSTALLDIRS) $(ICONS) echo creating $@ in $(ICONS) @echo "icons : table(nofallback) { " > $@ - @for file in `cd ./$(ICONS) ; ls *.gif *.css`; do \ + @for file in `cd $(srcdir)/$(ICONS) ; ls *.gif *.css`; do \ echo "Processing $$file " ; \ - echo " $$file:import { $(ICONS)/$$file } " >> $@; \ + echo " $$file:import { $(srcdir)/$(ICONS)/$$file } " >> $@; \ done; @echo "}" >> $@ diff --git a/ubrowse/extractStringsUltra.sh b/ubrowse/extractStringsUltra.sh index 172c599b..a6b4b6aa 100755 --- a/ubrowse/extractStringsUltra.sh +++ b/ubrowse/extractStringsUltra.sh @@ -1,7 +1,7 @@ #!/bin/sh ## ***************************************************************************** ## * -## * Copyright (C) 1999-2010, International Business Machines +## * Copyright (C) 1999-2019, International Business Machines ## * Corporation and others. All Rights Reserved. ## * ## ***************************************************************************** @@ -41,14 +41,14 @@ echo "// Now with XLIFF tags" echo echo "root {" echo -fgrep -h 'FSWF("' $* | sort | uniq | sed -f extractStrings.sed +fgrep -h 'FSWF("' $* | sort | uniq | sed -f ${srcdir}/extractStrings.sed echo -if [ -f root.txt.inc ]; then +if [ -f ${srcdir}/root.txt.inc ]; then echo "// Special Cases" echo echo echo " // Imported from: root.txt.inc " - cat root.txt.inc + cat ${srcdir}/root.txt.inc fi echo echo "}" diff --git a/ubrowse/res/root.txt b/ubrowse/res/root.txt deleted file mode 100644 index 56b7e350..00000000 --- a/ubrowse/res/root.txt +++ /dev/null @@ -1,38 +0,0 @@ -// root file. Generated from ubrowse.c -// Copyright (C) 2000-2015, International Business Machines -// It's probably not a good idea to change this file. -// Better to change locexp.c or the ROOT.* source files and rebuild. -// Now with XLIFF tags - -root { - - /** - * @translate yes - */ - ETOP_clickmsg { "Click on a type of character to view it in more detail" } - - /** - * @translate yes - */ - APP_NAME { "Unicode Browser" } - - /** - * @note Note about green text - * @translate yes - */ - NOTE_ANY_DECOMPOSE { "Note: text in Italic Green is the best-try using decomposition. Underscore (_) denotes missing characters in the decomposition." } - - /** - * @translate yes - */ - ETOP_blocks { "Blocks" } - - /** - * @translate yes - */ - ETOP_general_categories { "General Categories" } - - - -} - diff --git a/ubrowse/res/root.xlf b/ubrowse/res/root.xlf deleted file mode 100644 index 09134f6c..00000000 --- a/ubrowse/res/root.xlf +++ /dev/null @@ -1,28 +0,0 @@ - - - -

- -
- - - - Unicode Browser - - - Blocks - - - Click on a type of character to view it in more detail - - - General Categories - - - Note: text in <span class='anydecompose'>Italic Green</span> is the best-try using decomposition. Underscore (_) denotes missing characters in the decomposition. - Note about green text - - - - - diff --git a/ucd/Makefile.in b/ucd/Makefile.in index d521d94d..86ba1989 100644 --- a/ucd/Makefile.in +++ b/ucd/Makefile.in @@ -57,8 +57,8 @@ distclean distclean-local target-clean-local dist dist-local check \ check-local install-local: all-local - $(MKINSTALLDIRS) $(BINDIR) - $(INSTALL) $(TARGET) $(BINDIR)/$(TARGET) + $(MKINSTALLDIRS) $(DESTDIR)$(BINDIR) + $(INSTALL) $(TARGET) $(DESTDIR)$(BINDIR)/$(TARGET) all-local: $(TARGET) diff --git a/usort/lib/Makefile.in b/usort/lib/Makefile.in index 7380c2fe..05a0044a 100644 --- a/usort/lib/Makefile.in +++ b/usort/lib/Makefile.in @@ -25,8 +25,6 @@ LIBPREFIX=lib TARGET_STUBNAME=usort include $(top_builddir)/icuapps.mk -include $(shell $(ICU_CONFIG) --incfile) - CXXFLAGS += $(SHAREDLIBCXXFLAGS) CPPFLAGS += $(SHAREDLIDBCPPFLAGS) CFLAGS += $(SHAREDLIBCFLAGS) diff --git a/webdemo/collation/Makefile.in b/webdemo/collation/Makefile.in index 1642ff7f..2c1dbeb7 100644 --- a/webdemo/collation/Makefile.in +++ b/webdemo/collation/Makefile.in @@ -40,6 +40,10 @@ TARGET = available sortcgi #LDFLAGS += -L../apputil CPPFLAGS += -I$(ICU_SOURCE)/common +ifneq ($(ICU_COMMON_HEADERS),) +CPPFLAGS += -I$(ICU_COMMON_HEADERS) +endif + #CPPFLAGS += -I$(top_srcdir)/apputil # Want to make sure the usort.h dependency is not on the installed version .. #CPPFLAGS += -I../locexp/util @@ -62,17 +66,17 @@ check: check-local all-local: $(TARGET) collation.html -collation.html: index.html +collation.html: $(srcdir)/index.html sed -e 's%\(
$@ install-local: all-local install-target install-target: all-local - $(MKINSTALLDIRS) $(BINDIR) $(BINDIR)/data - $(INSTALL) sortcgi$(EXEEXT) $(BINDIR)/sortcgi$(EXEEXT) - $(INSTALL) available$(EXEEXT) $(BINDIR)/available$(EXEEXT) - $(INSTALL) collation.html $(BINDIR)/data/collation.html + $(MKINSTALLDIRS) $(BINDIR) $(DESTDIR)$(BINDIR)/data + $(INSTALL) sortcgi$(EXEEXT) $(DESTDIR)$(BINDIR)/sortcgi$(EXEEXT) + $(INSTALL) available$(EXEEXT) $(DESTDIR)$(BINDIR)/available$(EXEEXT) + $(INSTALL) collation.html $(DESTDIR)$(BINDIR)/data/collation.html dist-local: