[sword-cvs] icu-sword/source/extra/ustdio Makefile.in,1.4,1.5 locbund.c,1.3,1.4 locbund.h,1.3,1.4 sprintf.c,1.4,1.5 sprintf.h,1.3,1.4 sscanf.c,1.4,1.5 sscanf.h,1.3,1.4 ufile.c,1.7,1.8 ufile.h,1.3,1.4 ufmt_cmn.h,1.3,1.4 uprintf.c,1.4,1.5 uprintf.h,1.3,1.4 uprntf_p.c,1.3,1.4 uprntf_p.h,1.3,1.4 uscanf.c,1.4,1.5 uscanf.h,1.3,1.4 ustdio.c,1.4,1.5 ustdio.dsp,1.4,1.5 ustdio.rc,1.3,1.4 ustdio.vcproj,1.1,1.2 loccache.c,1.3,NONE loccache.h,1.3,NONE sprntf_p.c,1.3,NONE sprntf_p.h,1.3,NONE sscanf_p.c,1.3,NONE sscanf_p.h,1.3,NONE

sword@www.crosswire.org sword@www.crosswire.org
Tue, 6 Apr 2004 03:11:13 -0700


Update of /cvs/core/icu-sword/source/extra/ustdio
In directory www:/tmp/cvs-serv8911/source/extra/ustdio

Modified Files:
	Makefile.in locbund.c locbund.h sprintf.c sprintf.h sscanf.c 
	sscanf.h ufile.c ufile.h ufmt_cmn.h uprintf.c uprintf.h 
	uprntf_p.c uprntf_p.h uscanf.c uscanf.h ustdio.c ustdio.dsp 
	ustdio.rc ustdio.vcproj 
Removed Files:
	loccache.c loccache.h sprntf_p.c sprntf_p.h sscanf_p.c 
	sscanf_p.h 
Log Message:
ICU 2.8 sync

Index: Makefile.in
===================================================================
RCS file: /cvs/core/icu-sword/source/extra/ustdio/Makefile.in,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- Makefile.in	10 Sep 2003 02:42:21 -0000	1.4
+++ Makefile.in	6 Apr 2004 10:08:42 -0000	1.5
@@ -27,13 +27,17 @@
 TARGET_STUBNAME=io
 
 ifneq ($(ENABLE_STATIC),)
-TARGET = $(LIBICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX).a
+TARGET = $(LIBSICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX).$(A)
 endif
 
 ifneq ($(ENABLE_SHARED),)
 SO_TARGET = $(LIBICU)$(TARGET_STUBNAME)$(ICULIBSUFFIX).$(SO)
 ALL_SO_TARGETS = $(SO_TARGET) $(MIDDLE_SO_TARGET) $(FINAL_SO_TARGET)
 
+ifeq ($(ENABLE_SO_VERSION_DATA),1)
+SO_VERSION_DATA = ustdio.res
+endif
+
 ifeq ($(OS390BATCH),1)
 BATCH_TARGET = $(BATCH_USTDIO_TARGET)
 BATCH_LIBS = $(BATCH_LIBICUUC) $(BATCH_LIBICUI18N) -lm
@@ -51,9 +55,9 @@
 DEFS += -DU_USTDIO_IMPLEMENTATION
 LIBS = $(LIBICUUC) $(LIBICUI18N) $(DEFAULT_LIBS)
 
-OBJECTS = locbund.o loccache.o ufile.o ufmt_cmn.o uprintf.o uprntf_p.o \
-uscanf.o uscanf_p.o uscanset.o ustdio.o sprintf.o sprntf_p.o \
-sscanf.o sscanf_p.o ustream.o
+OBJECTS = locbund.o ufile.o ufmt_cmn.o uprintf.o uprntf_p.o \
+uscanf.o uscanf_p.o uscanset.o ustdio.o sprintf.o \
+sscanf.o ustream.o
 
 STATIC_OBJECTS = $(OBJECTS:.o=.$(STATIC_O))
 
@@ -114,7 +118,7 @@
 
 clean-local:
 	test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
-	$(RMV) $(OBJECTS) $(STATIC_OBJECTS) $(ALL_TARGETS)
+	$(RMV) $(OBJECTS) $(STATIC_OBJECTS) $(ALL_TARGETS) $(SO_VERSION_DATA)
 
 distclean-local: clean-local
 	$(RMV) Makefile
@@ -131,7 +135,7 @@
 endif
 
 ifneq ($(ENABLE_SHARED),)
-$(FINAL_SO_TARGET): $(OBJECTS)
+$(FINAL_SO_TARGET): $(OBJECTS) $(SO_VERSION_DATA)
 	$(SHLIB.cc) $(LD_SONAME) $(OUTOPT)$@ $^ $(LIBS)
 
 ifeq ($(OS390BATCH),1)

Index: locbund.c
===================================================================
RCS file: /cvs/core/icu-sword/source/extra/ustdio/locbund.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- locbund.c	10 Sep 2003 02:42:21 -0000	1.3
+++ locbund.c	6 Apr 2004 10:08:42 -0000	1.4
@@ -1,7 +1,7 @@
 /*
 *******************************************************************************
 *
-*   Copyright (C) 1998-1999, International Business Machines
+*   Copyright (C) 1998-2003, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
@@ -29,197 +29,109 @@
 #include "unicode/uloc.h"
 
 ULocaleBundle*        
-u_locbund_new(const char *loc)
-{
-  ULocaleBundle *result = (ULocaleBundle*) uprv_malloc(sizeof(ULocaleBundle));
-  int32_t len;
-
-  if(result == 0)
-    return 0;
-
-  len = (int32_t)(loc == 0 ? strlen(uloc_getDefault()) : strlen(loc));
-  result->fLocale = (char*) uprv_malloc(len + 1);
-  if(result->fLocale == 0) {
-    uprv_free(result);
-    return 0;
-  }
-  
-  strcpy(result->fLocale, (loc == 0 ? uloc_getDefault() : loc) );
-  
-  result->fNumberFormat     = 0;
-  result->fPercentFormat     = 0;
-  result->fCurrencyFormat     = 0;
-  result->fScientificFormat     = 0;
-  result->fSpelloutFormat     = 0;
-  result->fDateFormat         = 0;
-  result->fTimeFormat         = 0;
-
-  return result;
-}
-
-ULocaleBundle*
-u_locbund_clone(const ULocaleBundle *bundle)
-{
-  ULocaleBundle *result = (ULocaleBundle*)uprv_malloc(sizeof(ULocaleBundle));
-  UErrorCode status = U_ZERO_ERROR;
-
-  if(result == 0)
-    return 0;
-  
-  result->fLocale = (char*) uprv_malloc(strlen(bundle->fLocale) + 1);
-  if(result->fLocale == 0) {
-    uprv_free(result);
-    return 0;
-  }
-  
-  strcpy(result->fLocale, bundle->fLocale );
-  
-  result->fNumberFormat     = (bundle->fNumberFormat == 0 ? 0 :
-                   unum_clone(bundle->fNumberFormat, &status));
-  result->fPercentFormat     = (bundle->fPercentFormat == 0 ? 0 :
-                   unum_clone(bundle->fPercentFormat, 
-                          &status));
-  result->fCurrencyFormat     = (bundle->fCurrencyFormat == 0 ? 0 :
-                   unum_clone(bundle->fCurrencyFormat, 
-                          &status));
-  result->fScientificFormat     = (bundle->fScientificFormat == 0 ? 0 :
-                   unum_clone(bundle->fScientificFormat, 
-                          &status));
-  result->fSpelloutFormat     = (bundle->fSpelloutFormat == 0 ? 0 :
-                   unum_clone(bundle->fSpelloutFormat, 
-                          &status));
-  result->fDateFormat         = (bundle->fDateFormat == 0 ? 0 :
-                   udat_clone(bundle->fDateFormat, &status));
-  result->fTimeFormat         = (bundle->fTimeFormat == 0 ? 0 :
-                   udat_clone(bundle->fTimeFormat, &status));
-
-  return result;
-}
-
-void
-u_locbund_delete(ULocaleBundle *bundle)
+u_locbund_init(ULocaleBundle *result, const char *loc)
 {
-  uprv_free(bundle->fLocale);
+    int32_t len;
 
-  if(bundle->fNumberFormat != 0)
-    unum_close(bundle->fNumberFormat);
-  if(bundle->fPercentFormat != 0)
-    unum_close(bundle->fPercentFormat);
-  if(bundle->fCurrencyFormat != 0)
-    unum_close(bundle->fCurrencyFormat);
-  if(bundle->fScientificFormat != 0)
-    unum_close(bundle->fScientificFormat);
-  if(bundle->fSpelloutFormat != 0)
-    unum_close(bundle->fSpelloutFormat);
-  if(bundle->fDateFormat != 0)
-    udat_close(bundle->fDateFormat);
-  if(bundle->fTimeFormat != 0)
-    udat_close(bundle->fTimeFormat);
+    if(result == 0)
+        return 0;
 
-  uprv_free(bundle);
-}
+    if (loc == NULL) {
+        loc = uloc_getDefault();
+    }
+    
+    uprv_memset(result, 0, sizeof(ULocaleBundle));
 
-UNumberFormat*        
-u_locbund_getNumberFormat(ULocaleBundle *bundle)
-{
-  UErrorCode status = U_ZERO_ERROR;
-  
-  if(bundle->fNumberFormat == 0) {
-    bundle->fNumberFormat = unum_open(UNUM_DEFAULT, NULL,0,bundle->fLocale,NULL, &status);
-    if(U_FAILURE(status))
-      return 0;
-  }
-  
-  return bundle->fNumberFormat;
+    len = (int32_t)strlen(loc);
+    result->fLocale = (char*) uprv_malloc(len + 1);
+    if(result->fLocale == 0) {
+        uprv_free(result);
+        return 0;
+    }
+    
+    strcpy(result->fLocale, loc);
+    
+    return result;
 }
 
-UNumberFormat*    
-u_locbund_getPercentFormat(ULocaleBundle *bundle)
+/*ULocaleBundle*        
+u_locbund_new(const char *loc)
 {
-  UErrorCode status = U_ZERO_ERROR;
-  
-  if(bundle->fPercentFormat == 0) {
-    bundle->fPercentFormat = unum_open(UNUM_PERCENT,NULL,0, bundle->fLocale,NULL, &status);
-    if(U_FAILURE(status))
-      return 0;
-  }
-  
-  return bundle->fPercentFormat;
+    ULocaleBundle *result = (ULocaleBundle*) uprv_malloc(sizeof(ULocaleBundle));
+    return u_locbund_init(result, loc);
 }
 
-UNumberFormat*    
-u_locbund_getCurrencyFormat(ULocaleBundle *bundle)
+ULocaleBundle*
+u_locbund_clone(const ULocaleBundle *bundle)
 {
-  UErrorCode status = U_ZERO_ERROR;
-  
-  if(bundle->fCurrencyFormat == 0) {
-    bundle->fCurrencyFormat = unum_open(UNUM_CURRENCY,NULL,0, bundle->fLocale, NULL,&status);
-    if(U_FAILURE(status))
-      return 0;
-  }
-  
-  return bundle->fCurrencyFormat;
-}
-
-#define PAT_SIZE 512
+    ULocaleBundle *result = (ULocaleBundle*)uprv_malloc(sizeof(ULocaleBundle));
+    UErrorCode status = U_ZERO_ERROR;
+    int32_t styleIdx;
+    
+    if(result == 0)
+        return 0;
+    
+    result->fLocale = (char*) uprv_malloc(strlen(bundle->fLocale) + 1);
+    if(result->fLocale == 0) {
+        uprv_free(result);
+        return 0;
+    }
+    
+    strcpy(result->fLocale, bundle->fLocale );
+    
+    for (styleIdx = 0; styleIdx < ULOCALEBUNDLE_NUMBERFORMAT_COUNT; styleIdx++) {
+        status = U_ZERO_ERROR;
+        if (result->fNumberFormat[styleIdx]) {
+            result->fNumberFormat[styleIdx] = unum_clone(bundle->fNumberFormat[styleIdx], &status);
+            if (U_FAILURE(status)) {
+                result->fNumberFormat[styleIdx] = NULL;
+            }
+        }
+        else {
+            result->fNumberFormat[styleIdx] = NULL;
+        }
+    }
+    result->fDateFormat         = (bundle->fDateFormat == 0 ? 0 :
+        udat_clone(bundle->fDateFormat, &status));
+    result->fTimeFormat         = (bundle->fTimeFormat == 0 ? 0 :
+        udat_clone(bundle->fTimeFormat, &status));
+    
+    return result;
+}*/
 
-UNumberFormat*    
-u_locbund_getScientificFormat(ULocaleBundle *bundle)
+void
+u_locbund_close(ULocaleBundle *bundle)
 {
-  UErrorCode status = U_ZERO_ERROR;
-/*  UChar pattern [PAT_SIZE];*/
+    int32_t styleIdx;
 
-  if(bundle->fScientificFormat == 0) {
-    /* create the pattern for the locale */
-/*    u_uastrcpy(pattern, "0.000000E000");*/
+    uprv_free(bundle->fLocale);
     
-    bundle->fScientificFormat = unum_open(UNUM_SCIENTIFIC, NULL, 0,
-                         bundle->fLocale, NULL,&status);
+    for (styleIdx = 0; styleIdx < ULOCALEBUNDLE_NUMBERFORMAT_COUNT; styleIdx++) {
+        if (bundle->fNumberFormat[styleIdx]) {
+            unum_close(bundle->fNumberFormat[styleIdx]);
+        }
+    }
     
-    if(U_FAILURE(status))
-      return 0;
-  }
-  
-  return bundle->fScientificFormat;
+    uprv_memset(bundle, 0, sizeof(ULocaleBundle));
+/*    uprv_free(bundle);*/
 }
 
 UNumberFormat*
-u_locbund_getSpelloutFormat(ULocaleBundle *bundle)
-{
-  UErrorCode status = U_ZERO_ERROR;
-  
-  if(bundle->fSpelloutFormat == 0) {
-    bundle->fSpelloutFormat = unum_open(UNUM_SPELLOUT,NULL,0 ,bundle->fLocale, NULL,
-                    &status);
-  }
-  
-  return bundle->fSpelloutFormat;
-}
-
-UDateFormat*
-u_locbund_getDateFormat(ULocaleBundle *bundle)
-{
-  UErrorCode status = U_ZERO_ERROR;
-  
-  if(bundle->fDateFormat == 0) {
-    bundle->fDateFormat = udat_open(UDAT_NONE, UDAT_DEFAULT, 
-                    bundle->fLocale, 0, 0,NULL,0, &status);
-  }
-  
-  return bundle->fDateFormat;
-}
-
-UDateFormat*
-u_locbund_getTimeFormat(ULocaleBundle *bundle)
+u_locbund_getNumberFormat(ULocaleBundle *bundle, UNumberFormatStyle style)
 {
-  UErrorCode status = U_ZERO_ERROR;
-  
-  if(bundle->fTimeFormat == 0) {
-    bundle->fTimeFormat = udat_open(UDAT_DEFAULT, UDAT_NONE, 
-                    bundle->fLocale, 0, 0,NULL,0, &status);
-  }
-
-  return bundle->fTimeFormat;
+    if (style >= UNUM_IGNORE) {
+        UNumberFormat **formatAlias = &bundle->fNumberFormat[style-1];
+        if (*formatAlias == NULL) {
+            UErrorCode status = U_ZERO_ERROR;
+            *formatAlias = unum_open(style, NULL, 0, bundle->fLocale, NULL, &status);
+            if (U_FAILURE(status)) {
+                unum_close(*formatAlias);
+                *formatAlias = NULL;
+            }
+        }
+        return *formatAlias;
+    }
+    return NULL;
 }
 
 #endif /* #if !UCONFIG_NO_FORMATTING */

Index: locbund.h
===================================================================
RCS file: /cvs/core/icu-sword/source/extra/ustdio/locbund.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- locbund.h	10 Sep 2003 02:42:21 -0000	1.3
+++ locbund.h	6 Apr 2004 10:08:42 -0000	1.4
@@ -1,7 +1,7 @@
 /*
 *******************************************************************************
 *
-*   Copyright (C) 1998-1999, International Business Machines
+*   Copyright (C) 1998-2003, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
@@ -24,45 +24,47 @@
 #if !UCONFIG_NO_FORMATTING
 
 #include "unicode/unum.h"
-#include "unicode/udat.h"
 
-struct ULocaleBundle {
-  char         *fLocale;
-  
-  UNumberFormat    *fNumberFormat;
-  UNumberFormat    *fPercentFormat;
-  UNumberFormat    *fCurrencyFormat;
-  UNumberFormat    *fScientificFormat;
-  UNumberFormat    *fSpelloutFormat;
+#define ULOCALEBUNDLE_NUMBERFORMAT_COUNT ((int32_t)UNUM_SPELLOUT)
 
-  UDateFormat    *fDateFormat;
-  UDateFormat    *fTimeFormat;
-};
-typedef struct ULocaleBundle ULocaleBundle;
+typedef struct ULocaleBundle {
+    char            *fLocale;
+
+    UNumberFormat   *fNumberFormat[ULOCALEBUNDLE_NUMBERFORMAT_COUNT];
+} ULocaleBundle;
 
 
 /**
+ * Initialize a ULocaleBundle, initializing all formatters to 0.
+ * @param result A ULocaleBundle to initialize.
+ * @param loc The locale of the ULocaleBundle.
+ * @return A pointer to a ULocaleBundle, or 0 if <TT>loc</TT> was invalid.
+ */
+ULocaleBundle*        
+u_locbund_init(ULocaleBundle *result, const char *loc);
+
+/**
  * Create a new ULocaleBundle, initializing all formatters to 0.
  * @param loc The locale of the ULocaleBundle.
  * @return A pointer to a ULocaleBundle, or 0 if <TT>loc</TT> was invalid.
  */
-ULocaleBundle*
-u_locbund_new(const char *loc);
+/*ULocaleBundle*
+u_locbund_new(const char *loc);*/
 
 /**
  * Create a deep copy of this ULocaleBundle;
  * @param bundle The ULocaleBundle to clone.
  * @return A new ULocaleBundle.
  */
-ULocaleBundle*
-u_locbund_clone(const ULocaleBundle *bundle);
+/*ULocaleBundle*
+u_locbund_clone(const ULocaleBundle *bundle);*/
 
 /**
  * Delete the specified ULocaleBundle, freeing all associated memory.
  * @param bundle The ULocaleBundle to delete
  */
 void
-u_locbund_delete(ULocaleBundle *bundle);
+u_locbund_close(ULocaleBundle *bundle);
 
 /**
  * Get the NumberFormat used to format and parse numbers in a ULocaleBundle.
@@ -70,55 +72,7 @@
  * @return A pointer to the NumberFormat used for number formatting and parsing.
  */
 UNumberFormat*        
-u_locbund_getNumberFormat(ULocaleBundle *bundle);
-
-/**
- * Get the NumberFormat used to format and parse percents in a ULocaleBundle.
- * @param bundle The ULocaleBundle to use
- * @return A pointer to the NumberFormat used for percent formatting and parsing.
- */
-UNumberFormat*        
-u_locbund_getPercentFormat(ULocaleBundle *bundle);
-
-/**
- * Get the NumberFormat used to format and parse currency in a ULocaleBundle.
- * @param bundle The ULocaleBundle to use
- * @return A pointer to the NumberFormat used for currency formatting and parsing.
- */
-UNumberFormat*    
-u_locbund_getCurrencyFormat(ULocaleBundle *bundle);
-
-/**
- * Get the NumberFormat used to format and parse scientific numbers in a ULocaleBundle.
- * @param bundle The ULocaleBundle to use
- * @return A pointer to the NumberFormat used for scientific formatting and parsing.
- */
-UNumberFormat*    
-u_locbund_getScientificFormat(ULocaleBundle *bundle);
-
-/**
- * Get the NumberFormat used format to and parse spelled-out numbers in a ULocaleBundle.
- * @param bundle The ULocaleBundle to use
- * @return A pointer to the NumberFormat used for spelled-out number formatting and parsing.
- */
-UNumberFormat*
-u_locbund_getSpelloutFormat(ULocaleBundle *bundle);
-
-/**
- * Get the DateFormat used to format and parse dates in a ULocaleBundle.
- * @param bundle The ULocaleBundle to use
- * @return A pointer to the DateFormat used for date formatting and parsing.
- */
-UDateFormat*
-u_locbund_getDateFormat(ULocaleBundle *bundle);
-
-/**
- * Get the DateFormat used to format and parse times in a ULocaleBundle.
- * @param bundle The ULocaleBundle to use
- * @return A pointer to the DateFormat used for time formatting and parsing.
- */
-UDateFormat*
-u_locbund_getTimeFormat(ULocaleBundle *bundle);
+u_locbund_getNumberFormat(ULocaleBundle *bundle, UNumberFormatStyle style);
 
 #endif /* #if !UCONFIG_NO_FORMATTING */
 

Index: sprintf.c
===================================================================
RCS file: /cvs/core/icu-sword/source/extra/ustdio/sprintf.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- sprintf.c	10 Sep 2003 02:42:21 -0000	1.4
+++ sprintf.c	6 Apr 2004 10:08:42 -0000	1.5
@@ -1,19 +1,20 @@
 /*
-*******************************************************************************
+******************************************************************************
 *
-*   Copyright (C) 1998-2003, International Business Machines
+*   Copyright (C) 2001-2003, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
-*******************************************************************************
+******************************************************************************
 *
[...1377 lines suppressed...]
 
         /* update the pointer in pattern and continue */
         alias += patCount;
@@ -1436,14 +274,11 @@
     }
 
     /* Release the cloned bundle, if we cloned it. */
-    if(outStr.fOwnBundle) {
-        u_locbund_delete(outStr.fBundle);
-        outStr.fBundle = NULL;
-        outStr.fOwnBundle = FALSE;
-    }
+    u_locbund_close(&outStr.fBundle);
 
     /* return # of UChars written */
     return written;
 }
 
 #endif /* #if !UCONFIG_NO_FORMATTING */
+

Index: sprintf.h
===================================================================
RCS file: /cvs/core/icu-sword/source/extra/ustdio/sprintf.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- sprintf.h	10 Sep 2003 02:42:21 -0000	1.3
+++ sprintf.h	6 Apr 2004 10:08:43 -0000	1.4
@@ -1,7 +1,7 @@
 /*
 ******************************************************************************
 *
-*   Copyright (C) 2000-2001, International Business Machines
+*   Copyright (C) 2000-2003, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 ******************************************************************************
@@ -22,56 +22,17 @@
 
 #if !UCONFIG_NO_FORMATTING
 
-#include "unicode/ustdio.h"
-#include "ufmt_cmn.h"
+#include "uprintf.h"
 #include "locbund.h"
+#include "uprintf.h"
 
-/**
- * Struct encapsulating a single uprintf format specification.
- */
-struct u_sprintf_spec_info {
-  UChar     fSpec;          /* Conversion specification */
-
-  int32_t    fPrecision;    /* Precision  */
-  int32_t    fWidth;        /* Width  */
-
-  UChar     fPadChar;       /* Padding character  */
-
-  UBool     fAlt;           /* # flag  */
-  UBool     fSpace;         /* Space flag  */
-  UBool     fLeft;          /* - flag  */
-  UBool     fShowSign;      /* + flag  */
-  UBool     fZero;          /* 0 flag  */
-
-  UBool     fIsLongDouble;  /* L flag  */
-  UBool     fIsShort;       /* h flag  */
-  UBool     fIsLong;        /* l flag  */
-  UBool     fIsLongLong;    /* ll flag  */
-};
-typedef struct u_sprintf_spec_info u_sprintf_spec_info;
-
-struct u_localized_string {
-  UChar     *str;     /* Place to write the string */
-  int32_t   available;/* Number of codeunits available to write to */
-  int32_t   len;      /* Maximum number of code units that can be written to output */
-
-  ULocaleBundle  *fBundle;     /* formatters */
-  UBool        fOwnBundle;     /* TRUE if fBundle should be deleted */
-};
-typedef struct u_localized_string u_localized_string;
+typedef struct u_localized_string {
+    UChar     *str;     /* Place to write the string */
+    int32_t   available;/* Number of codeunits available to write to */
+    int32_t   len;      /* Maximum number of code units that can be written to output */
 
-/**
- * A u_printf handler function.  
- * A u_printf handler is responsible for handling a single u_printf 
- * format specification, for example 'd' or 's'.
- * @param info A pointer to a <TT>u_printf_spec_info</TT> struct containing
- * information on the format specification.
- * @param args A pointer to the argument data
- * @return The number of Unicode characters written to <TT>stream</TT>.
- */
-typedef int32_t (*u_sprintf_handler) (u_localized_string *output,
-                        const u_sprintf_spec_info  *info,
-                        const ufmt_args            *args);
+    ULocaleBundle  fBundle;     /* formatters */
+} u_localized_string;
 
 #endif /* #if !UCONFIG_NO_FORMATTING */
 

Index: sscanf.c
===================================================================
RCS file: /cvs/core/icu-sword/source/extra/ustdio/sscanf.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- sscanf.c	10 Sep 2003 02:42:21 -0000	1.4
+++ sscanf.c	6 Apr 2004 10:08:43 -0000	1.5
@@ -21,343 +21,90 @@
 
 #include "unicode/uchar.h"
 
-#include "sscanf.h"
-#include "sscanf_p.h"
-#include "uscanset.h"
 #include "unicode/ustdio.h"
 #include "unicode/ustring.h"
-#include "locbund.h"
-#include "loccache.h"
 #include "unicode/unum.h"
[...1356 lines suppressed...]
-                    args.ptrValue = va_arg(ap, UChar*);
+                case ufmt_count:
+                    args.intValue = va_arg(ap, int);
+                    /* set the spec's width to the # of items converted */
+                    spec.fInfo.fWidth = converted;
                     break;
 
                 default:
@@ -1327,9 +1018,11 @@
 
         /* just ignore unknown tags */
     }
+    u_locbund_close(&inStr.fBundle);
 
     /* return # of items converted */
     return converted;
 }
 
 #endif /* #if !UCONFIG_NO_FORMATTING */
+

Index: sscanf.h
===================================================================
RCS file: /cvs/core/icu-sword/source/extra/ustdio/sscanf.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- sscanf.h	10 Sep 2003 02:42:21 -0000	1.3
+++ sscanf.h	6 Apr 2004 10:08:43 -0000	1.4
@@ -1,7 +1,7 @@
 /*
 ******************************************************************************
 *
-*   Copyright (C) 2000-2001, International Business Machines
+*   Copyright (C) 2000-2003, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 ******************************************************************************
@@ -25,31 +25,14 @@
 #include "unicode/ustdio.h"
 #include "ufmt_cmn.h"
 #include "locbund.h"
-
-/**
- * Struct encapsulating a single uscanf format specification.
- */
-struct u_sscanf_spec_info {
-  UChar     fSpec;            /* Format specification  */
-
-  int32_t    fWidth;            /* Width  */
-
-  UChar     fPadChar;        /* Padding character  */
-
-  UBool     fIsLongDouble;        /* L flag  */
-  UBool     fIsShort;        /* h flag  */
-  UBool     fIsLong;        /* l flag  */
-  UBool     fIsLongLong;        /* ll flag  */
-};
-typedef struct u_sscanf_spec_info u_sscanf_spec_info;
+#include "uscanf.h"
 
 struct u_localized_string {
   UChar     *str;   /* Place to write the string */
   int32_t   pos;    /* Number of codeunits available to write to */
   int32_t   len;    /* Maximum number of code units that can be written to output */
 
-  ULocaleBundle  *fBundle;     /* formatters */
-  UBool        fOwnBundle;     /* TRUE if fBundle should be deleted */
+  ULocaleBundle  fBundle;     /* formatters */
 };
 typedef struct u_localized_string u_localized_string;
 
@@ -69,7 +52,7 @@
  * error occurred.
  */
 typedef int32_t (*u_sscanf_handler) (u_localized_string    *input,
-                   const u_sscanf_spec_info     *info,
+                   const u_scanf_spec_info     *info,
                    ufmt_args  *args,
                    const UChar            *fmt,
                    int32_t            *consumed);

Index: ufile.c
===================================================================
RCS file: /cvs/core/icu-sword/source/extra/ustdio/ufile.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- ufile.c	10 Sep 2003 08:09:39 -0000	1.7
+++ ufile.c	6 Apr 2004 10:08:43 -0000	1.8
@@ -1,7 +1,7 @@
 /*
 ******************************************************************************
 *
-*   Copyright (C) 1998-2001, International Business Machines
+*   Copyright (C) 1998-2003, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 ******************************************************************************
@@ -22,59 +22,12 @@
 #include "unicode/ustdio.h"
 #include "ufile.h"
 #include "unicode/uloc.h"
-#include "loccache.h"
 #include "unicode/ures.h"
 #include "unicode/ucnv.h"
 #include "cstring.h"
 #include "cmemory.h"
 
 
-static UBool hasICUData(const char *cp) {
-    UErrorCode status = U_ZERO_ERROR;
-    UConverter *cnv = NULL;
-#if 0
-    UResourceBundle *r = NULL;
-
-    r = ures_open(NULL, NULL, &status);
-    if(U_FAILURE(status)) {
-        return FALSE;
-    } else {
-        ures_close(r);
-    }
-#endif
-    cnv = ucnv_open(cp, &status);
-    if(cnv == NULL) {
-        return FALSE;
-    } else {
-        ucnv_close(cnv);
-    }
-
-    return TRUE;
-}
-
-
-
-U_CAPI UFILE* U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
-u_fopen(const char    *filename,
-        const char    *perm,
-        const char    *locale,
-        const char    *codepage)
-{
-    UFILE     *result;
-    FILE     *systemFile = fopen(filename, perm);
-    if(systemFile == 0) {
-        return 0;
-    }
-
-    result = u_finit(systemFile, locale, codepage);
-
-    if (result) {
-        result->fOwnFile = TRUE;
-    }
-
-    return result;
-}
-
 U_CAPI UFILE* U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
 u_finit(FILE        *f,
         const char    *locale,
@@ -89,7 +42,7 @@
 
     uprv_memset(result, 0, sizeof(UFILE));
 
-#if defined(WIN32) && !defined(__BORLANDC__)
+#ifdef WIN32 && !defined(__BORLANDC__)
     result->fFile = &_iob[_fileno(f)];
 #else
     result->fFile = f;
@@ -97,24 +50,18 @@
     result->fUCPos     = result->fUCBuffer;
     result->fUCLimit     = result->fUCBuffer;
 
-    if(hasICUData(codepage)) {
 #if !UCONFIG_NO_FORMATTING
         /* if locale is 0, use the default */
         if(locale == 0) {
             locale = uloc_getDefault();
         }
 
-        result->fBundle = u_loccache_get(locale);
-        if(result->fBundle == 0) {
+        if(u_locbund_init(&result->fBundle, locale) == 0) {
             /* DO NOT FCLOSE HERE! */
             uprv_free(result);
             return 0;
         }
 #endif
-    } else {
-        /* bootstrap mode */
-        return result;
-    }
 
     /* if the codepage is NULL, use the default for the locale */
     if(codepage == NULL) {
@@ -124,22 +71,42 @@
 
         /* if the codepage is still NULL, the default codepage will be used */
         result->fConverter = ucnv_open(codepage, &status);
-        if(U_FAILURE(status) || result->fConverter == NULL) {
-            /* DO NOT fclose here!!!!!! */
-            uprv_free(result);
-            return 0;
-        }
     } else if (*codepage != '\0') {
         result->fConverter = ucnv_open(codepage, &status);
-        if(U_FAILURE(status) || result->fConverter == NULL) {
-            /* DO NOT fclose here!!!!!! */
-            uprv_free(result);
-            return 0;
-        }
     }
+
+    if(U_FAILURE(status)) {
+#if !UCONFIG_NO_FORMATTING
+        u_locbund_close(&result->fBundle);
+#endif
+        /* DO NOT fclose here!!!!!! */
+        uprv_free(result);
+        result = NULL;
+    }
+
     return result;
 }
 
+U_CAPI UFILE* U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
+u_fopen(const char    *filename,
+        const char    *perm,
+        const char    *locale,
+        const char    *codepage)
+{
+    UFILE     *result;
+    FILE     *systemFile = fopen(filename, perm);
+    if(systemFile == 0) {
+        return 0;
+    }
+
+    result = u_finit(systemFile, locale, codepage);
+
+    if (result) {
+        result->fOwnFile = TRUE;
+    }
+
+    return result;
+}
 
 U_CAPI void U_EXPORT2
 u_fflush(UFILE *file)
@@ -149,6 +116,16 @@
   /* TODO: flush input */
 }
 
+U_CAPI void
+u_frewind(UFILE *file)
+{
+    u_fflush(file);
+    rewind(file->fFile);
+    ucnv_reset(file->fConverter);
+    file->fUCPos   = file->fUCBuffer;
+    file->fUCLimit = file->fUCBuffer;
+}
+
 U_CAPI void U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
 u_fclose(UFILE *file)
 {
@@ -159,8 +136,7 @@
         fclose(file->fFile);
 
 #if !UCONFIG_NO_FORMATTING
-    if(file->fOwnBundle)
-        u_locbund_delete(file->fBundle);
+    u_locbund_close(&file->fBundle);
 #endif
 
     ucnv_close(file->fConverter);
@@ -178,20 +154,16 @@
 U_CAPI const char*  U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
 u_fgetlocale(    UFILE        *file)
 {
-    return file->fBundle->fLocale;
+    return file->fBundle.fLocale;
 }
 
 U_CAPI int32_t U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
 u_fsetlocale(const char        *locale,
              UFILE        *file)
 {
-    if(file->fOwnBundle)
-        u_locbund_delete(file->fBundle);
-
-    file->fBundle     = u_loccache_get(locale);
-    file->fOwnBundle     = FALSE;
+    u_locbund_close(&file->fBundle);
 
-    return file->fBundle == 0 ? -1 : 0;
+    return u_locbund_init(&file->fBundle, locale) == 0 ? -1 : 0;
 }
 
 #endif
@@ -215,21 +187,26 @@
                UFILE        *file)
 {
     UErrorCode status = U_ZERO_ERROR;
+    int32_t retVal = -1;
 
-#if !UCONFIG_NO_FORMATTING
+    /* We use the normal default codepage for this system, and not the one for the locale. */
+#if 0 /* !UCONFIG_NO_FORMATTING */
     /* if the codepage is 0, use the default for the locale */
     if(codepage == 0) {
-        codepage = uprv_defaultCodePageForLocale(file->fBundle->fLocale);
+        codepage = uprv_defaultCodePageForLocale(file->fBundle.fLocale);
 
         /* if the codepage is still 0, fall back on the default codepage */
     }
 #endif
 
-    ucnv_close(file->fConverter);
-    file->fConverter = ucnv_open(codepage, &status);
-    if(U_FAILURE(status))
-        return -1;
-    return 0;
+    if ((file->fUCPos == file->fUCBuffer) && (file->fUCLimit == file->fUCBuffer)) {
+        ucnv_close(file->fConverter);
+        file->fConverter = ucnv_open(codepage, &status);
+        if(U_SUCCESS(status)) {
+            retVal = 0;
+        }
+    }
+    return retVal;
 }
 
 
@@ -238,3 +215,4 @@
 {
     return file->fConverter;
 }
+

Index: ufile.h
===================================================================
RCS file: /cvs/core/icu-sword/source/extra/ustdio/ufile.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- ufile.h	10 Sep 2003 02:42:21 -0000	1.3
+++ ufile.h	6 Apr 2004 10:08:43 -0000	1.4
@@ -1,7 +1,7 @@
 /*
 *******************************************************************************
 *
-*   Copyright (C) 1998-1999, International Business Machines
+*   Copyright (C) 1998-2003, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
@@ -49,8 +49,7 @@
   UBool        fOwnFile;    /* TRUE if fFile should be closed */
 
 #if !UCONFIG_NO_FORMATTING
-  ULocaleBundle        *fBundle;     /* formatters */
-  UBool        fOwnBundle;     /* TRUE if fBundle should be deleted */
+  ULocaleBundle        fBundle;     /* formatters */
 #endif
 
   UConverter        *fConverter;     /* for codeset conversion */

Index: ufmt_cmn.h
===================================================================
RCS file: /cvs/core/icu-sword/source/extra/ustdio/ufmt_cmn.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- ufmt_cmn.h	10 Sep 2003 02:42:21 -0000	1.3
+++ ufmt_cmn.h	6 Apr 2004 10:08:43 -0000	1.4
@@ -22,7 +22,7 @@
 
 #include "unicode/utypes.h"
 
-#define UFMT_DEFAULT_BUFFER_SIZE 64
+#define UFMT_DEFAULT_BUFFER_SIZE 128
 #define MAX_UCHAR_BUFFER_SIZE(buffer) (sizeof(buffer)/(UTF_MAX_CHAR_LENGTH*sizeof(UChar)))
 #define MAX_UCHAR_BUFFER_NEEDED(strLen) ((strLen+1)*UTF_MAX_CHAR_LENGTH*sizeof(UChar))
 
@@ -31,21 +31,21 @@
  */
 enum ufmt_type_info
 {
-  ufmt_empty = 0,
-  ufmt_simple_percent, /* %% do nothing */
-  ufmt_count,      /* special flag for count */
-  ufmt_int,        /* int */
-  ufmt_char,       /* int, cast to char */
-  ufmt_wchar,      /* wchar_t */
-  ufmt_string,     /* char* */
-  ufmt_wstring,    /* wchar_t* */
-  ufmt_pointer,    /* void* */
-  ufmt_float,      /* float */
-  ufmt_double,     /* double */
-  ufmt_date,       /* Date */
-  ufmt_uchar,      /* int, cast to UChar */
-  ufmt_ustring,    /* UChar* */
-  ufmt_last
+    ufmt_empty = 0,
+    ufmt_simple_percent, /* %% do nothing */
+    ufmt_count,      /* special flag for count */
+    ufmt_int,        /* int */
+    ufmt_char,       /* int, cast to char */
+    ufmt_string,     /* char* */
+    ufmt_pointer,    /* void* */
+    ufmt_float,      /* float */
+    ufmt_double,     /* double */
+    ufmt_uchar,      /* int, cast to UChar */
+    ufmt_ustring,    /* UChar* */
+    /*ufmt_wchar,*/      /* wchar_t */
+    /*ufmt_wstring,*/    /* wchar_t* */
+    /*ufmt_date,*/       /* Date */
+    ufmt_last
 };
 typedef enum ufmt_type_info ufmt_type_info;
 
@@ -53,12 +53,12 @@
  * Union representing a uprintf/uscanf argument
  */
 union ufmt_args {
-  signed int    intValue;      /* int, UChar */     /* TODO: Should int32_t be used instead of int? */
-  float         floatValue;    /* float */
-  double        doubleValue;   /* double */
-  void          *ptrValue;     /* any pointer - void*, char*, wchar_t*, UChar* */
-  wchar_t       wcharValue;    /* wchar_t */    /* TODO: Should wchar_t be used? */
-  UDate         dateValue;     /* Date */
+    signed int    intValue;      /* int, UChar */     /* TODO: Should int32_t be used instead of int? */
+    float         floatValue;    /* float */
+    double        doubleValue;   /* double */
+    void          *ptrValue;     /* any pointer - void*, char*, wchar_t*, UChar* */
+    /*wchar_t       wcharValue;*/    /* wchar_t */    /* TODO: Should wchar_t be used? */
+    /*UDate         dateValue;*/     /* Date */
 };
 typedef union ufmt_args ufmt_args;
 

Index: uprintf.c
===================================================================
RCS file: /cvs/core/icu-sword/source/extra/ustdio/uprintf.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- uprintf.c	10 Sep 2003 02:42:21 -0000	1.4
+++ uprintf.c	6 Apr 2004 10:08:43 -0000	1.5
@@ -11,9 +11,10 @@
 * Modification History:
 *
 *   Date        Name        Description
-*   11/19/98    stephen        Creation.
+*   11/19/98    stephen     Creation.
 *   03/12/99    stephen     Modified for new C API.
 *                           Added conversion from default codepage.
+*   08/07/2003  george      Reunify printf implementations
 ******************************************************************************
 */
 
[...1313 lines suppressed...]
-            }
-            else {
-                /* just echo unknown tags */
-                written += u_file_write(alias, patCount, f);
-            }
-        }
-        else {
-            /* just echo unknown tags */
-            written += u_file_write(alias, patCount, f);
-        }
+        /* parse and print the specifier */
+        patCount = u_printf_print_spec(&g_stream_handler, alias, f, &f->fBundle, patCount, &written, (va_list*)&ap);
 
         /* update the pointer in pattern and continue */
         alias += patCount;
@@ -1336,3 +186,4 @@
 }
 
 #endif /* #if !UCONFIG_NO_FORMATTING */
+

Index: uprintf.h
===================================================================
RCS file: /cvs/core/icu-sword/source/extra/ustdio/uprintf.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- uprintf.h	10 Sep 2003 02:42:21 -0000	1.3
+++ uprintf.h	6 Apr 2004 10:08:43 -0000	1.4
@@ -1,7 +1,7 @@
 /*
 ******************************************************************************
 *
-*   Copyright (C) 1998-2001, International Business Machines
+*   Copyright (C) 1998-2003, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 ******************************************************************************
@@ -25,31 +25,45 @@
 
 #include "unicode/ustdio.h"
 #include "ufmt_cmn.h"
+#include "locbund.h"
 
 /**
  * Struct encapsulating a single uprintf format specification.
  */
-struct u_printf_spec_info {
-  UChar     fSpec;            /* Conversion specification */
-
-  int32_t    fPrecision;        /* Precision  */
-  int32_t    fWidth;            /* Width  */
+typedef struct u_printf_spec_info {
+  int32_t    fPrecision;    /* Precision  */
+  int32_t    fWidth;        /* Width  */
 
-  UChar     fPadChar;        /* Padding character  */
+  UChar     fSpec;          /* Conversion specification */
+  UChar     fPadChar;       /* Padding character  */
 
-  UBool     fAlt;            /* # flag  */
-  UBool     fSpace;            /* Space flag  */
-  UBool     fLeft;            /* - flag  */
-  UBool     fShowSign;        /* + flag  */
-  UBool     fZero;            /* 0 flag  */
+  UBool     fAlt;           /* # flag  */
+  UBool     fSpace;         /* Space flag  */
+  UBool     fLeft;          /* - flag  */
+  UBool     fShowSign;      /* + flag  */
+  UBool     fZero;          /* 0 flag  */
 
-  UBool     fIsLongDouble;        /* L flag  */
-  UBool     fIsShort;        /* h flag  */
+  UBool     fIsLongDouble;  /* L flag  */
+  UBool     fIsShort;       /* h flag  */
   UBool     fIsLong;        /* l flag  */
-  UBool     fIsLongLong;        /* ll flag  */
-};
-typedef struct u_printf_spec_info u_printf_spec_info;
+  UBool     fIsLongLong;    /* ll flag  */
+} u_printf_spec_info;
+
+typedef int32_t U_EXPORT2
+u_printf_write_stream(void          *context,
+                      const UChar   *str,
+                      int32_t       count);
+
+typedef int32_t U_EXPORT2
+u_printf_pad_and_justify_stream(void                        *context,
+                                const u_printf_spec_info    *info,
+                                const UChar                 *result,
+                                int32_t                     resultLen);
 
+typedef struct u_printf_stream_handler {
+    u_printf_write_stream *write;
+    u_printf_pad_and_justify_stream *pad_and_justify;
+} u_printf_stream_handler;
 
 /**
  * A u_printf handler function.  
@@ -61,9 +75,12 @@
  * @param args A pointer to the argument data
  * @return The number of Unicode characters written to <TT>stream</TT>.
  */
-typedef int32_t (*u_printf_handler) (UFILE             *stream,
-                     const u_printf_spec_info     *info,
-                     const ufmt_args            *args);
+typedef int32_t U_EXPORT2
+u_printf_handler(const u_printf_stream_handler  *handler,
+                 void                           *context,
+                 ULocaleBundle                  *formatBundle,
+                 const u_printf_spec_info       *info,
+                 const ufmt_args                *args);
 
 #endif /* #if !UCONFIG_NO_FORMATTING */
 

Index: uprntf_p.c
===================================================================
RCS file: /cvs/core/icu-sword/source/extra/ustdio/uprntf_p.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- uprntf_p.c	10 Sep 2003 02:42:21 -0000	1.3
+++ uprntf_p.c	6 Apr 2004 10:08:43 -0000	1.4
@@ -1,27 +1,925 @@
 /*
-*******************************************************************************
+******************************************************************************
 *
-*   Copyright (C) 1998-1999, International Business Machines
+*   Copyright (C) 1998-2003, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
-*******************************************************************************
+******************************************************************************
 *
[...1085 lines suppressed...]
+            }
+        }
+
+        /* call the handler function */
+        handler = g_u_printf_infos[ handlerNum ].handler;
+        if(handler != 0) {
+            *written += (*handler)(streamHandler, context, formatBundle, info, &args);
+        }
+        else {
+            /* just echo unknown tags */
+            *written += (streamHandler->write)(context, fmt, patCount);
+        }
+    }
+    else {
+        /* just echo unknown tags */
+        *written += (streamHandler->write)(context, fmt, patCount);
+    }
     /* return # of characters in this specifier */
     return (int32_t)(s - fmt);
 }

Index: uprntf_p.h
===================================================================
RCS file: /cvs/core/icu-sword/source/extra/ustdio/uprntf_p.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- uprntf_p.h	10 Sep 2003 02:42:21 -0000	1.3
+++ uprntf_p.h	6 Apr 2004 10:08:43 -0000	1.4
@@ -1,10 +1,10 @@
 /*
-*******************************************************************************
+******************************************************************************
 *
-*   Copyright (C) 1998-1999, International Business Machines
+*   Copyright (C) 1998-2003, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
-*******************************************************************************
+******************************************************************************
 *
 * File uprntf_p.h
 *
@@ -13,7 +13,7 @@
 *   Date        Name        Description
 *   12/02/98    stephen        Creation.
 *   03/12/99    stephen     Modified for new C API.
-*******************************************************************************
+******************************************************************************
 */
 
 #ifndef UPRNTF_P_H
@@ -25,16 +25,7 @@
 
 #include "uprintf.h"
 
-/**
- * Struct encapsulating a single uprintf format specification.
- */
-struct u_printf_spec {
-  u_printf_spec_info    fInfo;        /* Information on this spec */
-  int32_t        fWidthPos;     /* Position of width in arg list */
-  int32_t        fPrecisionPos;    /* Position of precision in arg list */
-  int32_t        fArgPos;    /* Position of data in arg list */
-};
-typedef struct u_printf_spec u_printf_spec;
+#define UP_PERCENT 0x0025
 
 /**
  * Parse a single u_printf format specifier.
@@ -44,8 +35,13 @@
  * @return The number of characters contained in this specifier.
  */
 int32_t
-u_printf_parse_spec (const UChar     *fmt,
-             u_printf_spec    *spec);
+u_printf_print_spec(const u_printf_stream_handler *streamHandler,
+                    const UChar     *fmt,
+                    void            *context,
+                    ULocaleBundle   *formatBundle,
+                    int32_t         patCount,
+                    int32_t         *written,
+                    va_list         *ap);
 
 #endif /* #if !UCONFIG_NO_FORMATTING */
 

Index: uscanf.c
===================================================================
RCS file: /cvs/core/icu-sword/source/extra/ustdio/uscanf.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- uscanf.c	10 Sep 2003 02:42:21 -0000	1.4
+++ uscanf.c	6 Apr 2004 10:08:43 -0000	1.5
@@ -22,160 +22,21 @@
 
 #include "unicode/uchar.h"
 
+#include "unicode/ustdio.h"
+#include "unicode/ustring.h"
+#include "unicode/unum.h"
+#include "unicode/udat.h"
 #include "uscanf.h"
 #include "uscanf_p.h"
 #include "uscanset.h"
-#include "unicode/ustdio.h"
[...1429 lines suppressed...]
-
-                case ufmt_date:
-                    args.ptrValue = va_arg(ap, UDate*);
+                    args.ptrValue = va_arg(ap, void*);
                     break;
 
-                case ufmt_ustring:
-                    args.ptrValue = va_arg(ap, UChar*);
+                case ufmt_count:
+                    args.intValue = va_arg(ap, int);
+                    /* set the spec's width to the # of items converted */
+                    spec.fInfo.fWidth = converted;
                     break;
 
                 default:
@@ -1346,3 +1042,4 @@
 }
 
 #endif /* #if !UCONFIG_NO_FORMATTING */
+

Index: uscanf.h
===================================================================
RCS file: /cvs/core/icu-sword/source/extra/ustdio/uscanf.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- uscanf.h	10 Sep 2003 02:42:21 -0000	1.3
+++ uscanf.h	6 Apr 2004 10:08:43 -0000	1.4
@@ -1,7 +1,7 @@
 /*
 ******************************************************************************
 *
-*   Copyright (C) 1998-2001, International Business Machines
+*   Copyright (C) 1998-2003, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 ******************************************************************************
@@ -30,16 +30,16 @@
  * Struct encapsulating a single uscanf format specification.
  */
 struct u_scanf_spec_info {
-  UChar     fSpec;            /* Format specification  */
+  int32_t    fWidth;        /* Width  */
 
-  int32_t    fWidth;            /* Width  */
+  UChar     fSpec;          /* Format specification  */
 
-  UChar     fPadChar;        /* Padding character  */
+  UChar     fPadChar;       /* Padding character  */
 
-  UBool     fIsLongDouble;        /* L flag  */
-  UBool     fIsShort;        /* h flag  */
+  UBool     fIsLongDouble;  /* L flag  */
+  UBool     fIsShort;       /* h flag  */
   UBool     fIsLong;        /* l flag  */
-  UBool     fIsLongLong;        /* ll flag  */
+  UBool     fIsLongLong;    /* ll flag  */
 };
 typedef struct u_scanf_spec_info u_scanf_spec_info;
 
@@ -67,3 +67,4 @@
 #endif /* #if !UCONFIG_NO_FORMATTING */
 
 #endif
+

Index: ustdio.c
===================================================================
RCS file: /cvs/core/icu-sword/source/extra/ustdio/ustdio.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- ustdio.c	10 Sep 2003 02:42:21 -0000	1.4
+++ ustdio.c	6 Apr 2004 10:08:43 -0000	1.5
@@ -27,22 +27,38 @@
 
 #include <string.h>
 
-#define DELIM_CR 0x000D
 #define DELIM_LF 0x000A
+#define DELIM_VT 0x000B
+#define DELIM_FF 0x000C
+#define DELIM_CR 0x000D
+#define DELIM_NEL 0x0085
+#define DELIM_LS 0x2028
+#define DELIM_PS 0x2029
 
 /* Leave this copyright notice here! */
 static const char copyright[] = U_COPYRIGHT_STRING;
 
+/* TODO: is this correct for all codepages? Should we just use \n and let the converter handle it? */
 #ifdef WIN32
 static const UChar DELIMITERS [] = { DELIM_CR, DELIM_LF, 0x0000 };
 static const uint32_t DELIMITERS_LEN = 2;
+#elif (U_CHARSET_FAMILY == U_EBCDIC_FAMILY)
+static const UChar DELIMITERS [] = { DELIM_NEL, 0x0000 };
+static const uint32_t DELIMITERS_LEN = 1;
 #else
 static const UChar DELIMITERS [] = { DELIM_LF, 0x0000 };
 static const uint32_t DELIMITERS_LEN = 1;
 #endif
 
-#define IS_STRING_DELIMITER(s)    (UBool)(    (s) == DELIM_CR || \
-(s) == DELIM_LF    )
+#define IS_FIRST_STRING_DELIMITER(c1) \
+ (UBool)((DELIM_LF <= (c1) && (c1) <= DELIM_CR) \
+        || (c1) == DELIM_NEL \
+        || (c1) == DELIM_LS \
+        || (c1) == DELIM_PS)
+#define CAN_HAVE_COMBINED_STRING_DELIMITER(c1) (UBool)((c1) == DELIM_CR)
+#define IS_COMBINED_STRING_DELIMITER(c1, c2) \
+ (UBool)((c1) == DELIM_CR && (c2) == DELIM_LF)
+
 
 #if !UCONFIG_NO_TRANSLITERATION
 
@@ -289,14 +305,19 @@
                    UBool         flush)
 {
     /* Set up conversion parameters */
-    UErrorCode         status        = U_ZERO_ERROR;
-    const UChar        *mySource       = chars;
-    const UChar        *sourceAlias       = chars;
-    const UChar        *mySourceEnd     = chars + count;
-    char            *myTarget     = f->fCharBuffer;
-    int32_t        bufferSize    = UFILE_CHARBUFFER_SIZE;
-    int32_t        written        = 0;
-    int32_t        numConverted   = 0;
+    UErrorCode         status       = U_ZERO_ERROR;
+    const UChar        *mySource    = chars;
+    const UChar        *sourceAlias = chars;
+    const UChar        *mySourceEnd;
+    char            *myTarget   = f->fCharBuffer;
+    int32_t        bufferSize   = UFILE_CHARBUFFER_SIZE;
+    int32_t        written      = 0;
+    int32_t        numConverted = 0;
+
+    if (count < 0) {
+        count = u_strlen(chars);
+    }
+    mySourceEnd     = chars + count;
 
 #if !UCONFIG_NO_TRANSLITERATION
     if((f->fTranslit) && (f->fTranslit->translit))
@@ -419,15 +440,16 @@
 }
 
 U_CAPI UChar* U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
-u_fgets(UFILE        *f,
-        int32_t        n,
-        UChar        *s)
+u_fgets(UChar        *s,
+        int32_t       n,
+        UFILE        *f)
 {
     int32_t dataSize;
     int32_t count;
     UChar *alias;
     UChar *limit;
     UChar *sItr;
+    UChar currDelim = 0;
 
     if (n <= 0) {
         /* Caller screwed up. We need to write the null terminatior. */
@@ -452,6 +474,7 @@
     /* otherwise, iteratively fill the buffer and copy */
     count = 0;
     sItr = s;
+    currDelim = 0;
     while (dataSize > 0 && count < n) {
         alias = f->fUCPos;
 
@@ -463,22 +486,35 @@
             limit = alias + n;
         }
 
-        /* Copy UChars until we find the first occurrence of a delimiter character */
-        while (alias < limit && !IS_STRING_DELIMITER(*alias)) {
-            count++;
-            *(sItr++) = *(alias++);
+        if (!currDelim) {
+            /* Copy UChars until we find the first occurrence of a delimiter character */
+            while (alias < limit && !IS_FIRST_STRING_DELIMITER(*alias)) {
+                count++;
+                *(sItr++) = *(alias++);
+            }
+            /* Preserve the newline */
+            if (alias < limit && IS_FIRST_STRING_DELIMITER(*alias)) {
+                if (CAN_HAVE_COMBINED_STRING_DELIMITER(*alias)) {
+                    currDelim = *alias;
+                }
+                count++;
+                *(sItr++) = *(alias++);
+            }
         }
-        /* Preserve the newline */
-        if (alias < limit && IS_STRING_DELIMITER(*alias)) {
-            count++;
-            *(sItr++) = *(alias++);
+        /* If we have a CRLF combination, preserve that too. */
+        if (alias < limit) {
+            if (currDelim && IS_COMBINED_STRING_DELIMITER(currDelim, *alias)) {
+                count++;
+                *(sItr++) = *(alias++);
+            }
+            currDelim = 0;
         }
 
         /* update the current buffer position */
         f->fUCPos = alias;
 
         /* if we found a delimiter */
-        if (alias < f->fUCLimit) {
+        if (alias < f->fUCLimit && !currDelim) {
 
             /* break out */
             break;
@@ -505,78 +541,70 @@
     /* otherwise, fill the buffer and return the next character */
     else {
         ufile_fill_uchar_buffer(f);
-        if(f->fUCPos < f->fUCLimit)
+        if(f->fUCPos < f->fUCLimit) {
             return *(f->fUCPos)++;
-        else
-            return 0xFFFF;
+        }
+        else {
+            return U_EOF;
+        }
     }
 }
 
-/* u_unescapeAt() callback to return a UChar from a UFILE */
-static UChar U_CALLCONV
-_charAt(int32_t offset, void *context) {
-    return ((UFILE*) context)->fUCPos[offset];
-}
-
 /* Read a UChar from a UFILE and process escape sequences */
 U_CAPI UChar32 U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
 u_fgetcx(UFILE        *f)
 {
-    int32_t length;
-    int32_t offset;
     UChar32 c32;
-    UChar c16;
 
     /* Fill the buffer if it is empty */
-    if (f->fUCPos >= f->fUCLimit) {
+    if (f->fUCPos + 1 >= f->fUCLimit) {
         ufile_fill_uchar_buffer(f);
     }
 
     /* Get the next character in the buffer */
     if (f->fUCPos < f->fUCLimit) {
-        c16 = *(f->fUCPos)++;
-    } else {
-        c16 = U_EOF;
+        c32 = *(f->fUCPos)++;
     }
-
-    /* If it isn't a backslash, return it */
-    if (c16 != 0x005C /*'\\'*/) {
-        return c16;
+    else {
+        c32 = U_EOF;
     }
 
-    /* Determine the amount of data in the buffer */
-    length = (int32_t)(f->fUCLimit - f->fUCPos);
-
-    /* The longest escape sequence is \Uhhhhhhhh; make sure
-    we have at least that many characters */
-    if (length < 10) {
-        /* fill the buffer */
-        ufile_fill_uchar_buffer(f);
-        length = (int32_t)(f->fUCLimit - f->fUCPos);
+    if (U_IS_LEAD(c32)) {
+        if (f->fUCPos < f->fUCLimit) {
+            UChar c16 = *(f->fUCPos)++;
+            c32 = U16_GET_SUPPLEMENTARY(c32, c16);
+        }
+        else {
+            c32 = U_EOF;
+        }
     }
 
-    /* Process the escape */
-    offset = 0;
-    c32 = u_unescapeAt(_charAt, &offset, length, (void*)f);
-
-    /* Update the current buffer position */
-    f->fUCPos += offset;
-
     return c32;
 }
 
-U_CAPI UChar U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
-u_fungetc(UChar        c,
+U_CAPI UChar32 U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */
+u_fungetc(UChar32        ch,
     UFILE        *f)
 {
     /* if we're at the beginning of the buffer, sorry! */
-    if(f->fUCPos == f->fUCBuffer)
-        return 0xFFFF;
-    /* otherwise, put the character back */
+    if (f->fUCPos == f->fUCBuffer
+        || (U_IS_LEAD(ch) && (f->fUCPos - 1) == f->fUCBuffer))
+    {
+        ch = U_EOF;
+    }
     else {
-        *--(f->fUCPos) = c;
-        return c;
+        /* otherwise, put the character back */
+        /* TODO: Maybe we shouldn't be writing to the buffer and just verify the contents */
+        if (U_IS_LEAD(ch)) {
+            /* Remember, put them back on in the reverse order. */
+            *--(f->fUCPos) = U16_TRAIL(ch);
+            *--(f->fUCPos) = U16_LEAD(ch);
+        }
+        else {
+            *--(f->fUCPos) = (UChar)ch;
+        }
     }
+    return ch;
 }
 
 U_CAPI int32_t U_EXPORT2 /* U_CAPI ... U_EXPORT2 added by Peter Kirk 17 Nov 2001 */

Index: ustdio.dsp
===================================================================
RCS file: /cvs/core/icu-sword/source/extra/ustdio/ustdio.dsp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- ustdio.dsp	10 Sep 2003 02:42:21 -0000	1.4
+++ ustdio.dsp	6 Apr 2004 10:08:43 -0000	1.5
@@ -55,7 +55,7 @@
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 icuuc.lib icuin.lib /nologo /dll /machine:I386 /out:"..\..\..\bin\icuio26.dll" /implib:"..\..\..\lib/icuio.lib" /libpath:"..\..\..\lib\\"
+# ADD LINK32 icuuc.lib icuin.lib /nologo /dll /machine:I386 /out:"..\..\..\bin\icuio28.dll" /implib:"..\..\..\lib/icuio.lib" /libpath:"..\..\..\lib\\"
 # SUBTRACT LINK32 /pdb:none
 
 !ELSEIF  "$(CFG)" == "ustdio - Win32 Debug"
@@ -82,7 +82,7 @@
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 icuucd.lib icuind.lib /nologo /dll /debug /machine:I386 /out:"..\..\..\bin\icuio26d.dll" /implib:"..\..\..\lib\icuiod.lib" /pdbtype:sept /libpath:"debug" /libpath:"..\..\..\lib\\"
+# ADD LINK32 icuucd.lib icuind.lib /nologo /dll /debug /machine:I386 /out:"..\..\..\bin\icuio28d.dll" /implib:"..\..\..\lib\icuiod.lib" /pdbtype:sept /libpath:"debug" /libpath:"..\..\..\lib\\"
 # SUBTRACT LINK32 /pdb:none
 
 !ELSEIF  "$(CFG)" == "ustdio - Win64 Release"
@@ -109,7 +109,7 @@
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:IX86 /machine:IA64
-# ADD LINK32 icuuc.lib icuin.lib /nologo /dll /machine:IX86 /out:"..\..\..\bin\icuio26.dll" /implib:"..\..\..\lib/icuio.lib" /libpath:"..\..\..\lib\\" /machine:IA64
+# ADD LINK32 icuuc.lib icuin.lib /nologo /dll /machine:IX86 /out:"..\..\..\bin\icuio28.dll" /implib:"..\..\..\lib/icuio.lib" /libpath:"..\..\..\lib\\" /machine:IA64
 
 !ELSEIF  "$(CFG)" == "ustdio - Win64 Debug"
 
@@ -135,7 +135,7 @@
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:IX86 /pdbtype:sept /machine:IA64
-# ADD LINK32 icuucd.lib icuind.lib /nologo /dll /incremental:no /debug /machine:IX86 /out:"..\..\..\bin\icuio26d.dll" /implib:"..\..\..\lib\icuiod.lib" /pdbtype:sept /libpath:"debug" /libpath:"..\..\..\lib\\" /machine:IA64
+# ADD LINK32 icuucd.lib icuind.lib /nologo /dll /incremental:no /debug /machine:IX86 /out:"..\..\..\bin\icuio28d.dll" /implib:"..\..\..\lib\icuiod.lib" /pdbtype:sept /libpath:"debug" /libpath:"..\..\..\lib\\" /machine:IA64
 
 !ENDIF 
 
@@ -154,26 +154,14 @@
 # End Source File
 # Begin Source File
 
-SOURCE=.\loccache.c
-# End Source File
-# Begin Source File
-
 SOURCE=.\sprintf.c
 # End Source File
 # Begin Source File
 
-SOURCE=.\sprntf_p.c
-# End Source File
-# Begin Source File
-
 SOURCE=.\sscanf.c
 # End Source File
 # Begin Source File
 
-SOURCE=.\sscanf_p.c
-# End Source File
-# Begin Source File
-
 SOURCE=.\ufile.c
 # End Source File
 # Begin Source File
@@ -219,23 +207,11 @@
 # End Source File
 # Begin Source File
 
-SOURCE=.\loccache.h
-# End Source File
-# Begin Source File
-
 SOURCE=.\sprintf.h
 # End Source File
 # Begin Source File
 
-SOURCE=.\sprntf_p.h
-# End Source File
-# Begin Source File
-
 SOURCE=.\sscanf.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\sscanf_p.h
 # End Source File
 # Begin Source File
 

Index: ustdio.rc
===================================================================
RCS file: /cvs/core/icu-sword/source/extra/ustdio/ustdio.rc,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- ustdio.rc	10 Sep 2003 02:42:21 -0000	1.3
+++ ustdio.rc	6 Apr 2004 10:08:44 -0000	1.4
@@ -1,29 +1,50 @@
-// Version Resource file for ICU usdtio library.
-
 // Do not edit with Microsoft Developer Studio Resource Editor.
 //   It will permanently substitute version numbers that are intended to be
 //   picked up by the pre-processor during each build.
 // Copyright (c) 2001-2003 International Business Machines
 // Corporation and others. All Rights Reserved.
 //
+#include "../../common/msvcres.h"
 
 #define APSTUDIO_READONLY_SYMBOLS
 /////////////////////////////////////////////////////////////////////////////
 //
 // Generated from the TEXTINCLUDE 2 resource.
 //
-#include "winresrc.h"
-
+#include <winresrc.h>
 /////////////////////////////////////////////////////////////////////////////
 #undef APSTUDIO_READONLY_SYMBOLS
 
 /////////////////////////////////////////////////////////////////////////////
-//
+// 
 
 LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
 #pragma code_page(1252)
 
-#include "unicode\uversion.h"
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE 
+BEGIN
+    "../../common/msvcres.h\0"
+END
+
+2 TEXTINCLUDE 
+BEGIN
+    "#include <winresrc.h>\0"
+END
+
+3 TEXTINCLUDE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
 
 /////////////////////////////////////////////////////////////////////////////
 //
@@ -51,7 +72,7 @@
         BEGIN
             VALUE "Comments", "http://oss.software.ibm.com/icu/\0"
             VALUE "CompanyName", "IBM Corporation and others\0"
-            VALUE "FileDescription", "IBM ICU ustdio DLL\0"
+            VALUE "FileDescription", "IBM ICU I/O DLL\0"
             VALUE "FileVersion",  CommaVersionString(U_ICU_VERSION_MAJOR_NUM, U_ICU_VERSION_MINOR_NUM, U_ICU_VERSION_PATCHLEVEL_NUM, 0)
             VALUE "LegalCopyright", U_COPYRIGHT_STRING "\0"
 #ifdef _DEBUG
@@ -59,7 +80,6 @@
 #else
             VALUE "OriginalFilename", "icuio" U_ICU_VERSION_SHORT ".dll\0")
 #endif
-
             VALUE "PrivateBuild", "\0"
             VALUE "ProductName", "International Components for Unicode\0"
             VALUE "ProductVersion", CommaVersionString(U_ICU_VERSION_MAJOR_NUM, U_ICU_VERSION_MINOR_NUM, U_ICU_VERSION_PATCHLEVEL_NUM, 0)
@@ -73,4 +93,16 @@
 END
 
 /////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
 

Index: ustdio.vcproj
===================================================================
RCS file: /cvs/core/icu-sword/source/extra/ustdio/ustdio.vcproj,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ustdio.vcproj	10 Sep 2003 02:42:21 -0000	1.1
+++ ustdio.vcproj	6 Apr 2004 10:08:44 -0000	1.2
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding = "Windows-1252"?>
+<?xml version="1.0" encoding="Windows-1252"?>
 <VisualStudioProject
 	ProjectType="Visual C++"
-	Version="7.00"
+	Version="7.10"
 	Name="ustdio"
 	SccProjectName=""
 	SccLocalPath="">
@@ -22,8 +22,9 @@
 				Name="VCCLCompilerTool"
 				InlineFunctionExpansion="2"
 				ImproveFloatingPointConsistency="TRUE"
+				OptimizeForProcessor="2"
 				AdditionalIncludeDirectories="..\..\..\include,..\..\common"
-				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;USTDIO_EXPORTS;U_USTDIO_IMPLEMENTATION"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;U_USTDIO_IMPLEMENTATION"
 				StringPooling="TRUE"
 				RuntimeLibrary="2"
 				EnableFunctionLevelLinking="TRUE"
@@ -32,6 +33,7 @@
 				AssemblerListingLocation=".\Release/"
 				ObjectFile=".\Release/"
 				ProgramDataBaseFileName=".\Release/"
+				BrowseInformation="1"
 				WarningLevel="3"
 				SuppressStartupBanner="TRUE"
 				CompileAs="0"/>
@@ -41,11 +43,12 @@
 				Name="VCLinkerTool"
 				AdditionalOptions="/MACHINE:I386"
 				AdditionalDependencies="icuuc.lib icuin.lib"
-				OutputFile="..\..\..\bin\icuio26.dll"
+				OutputFile="..\..\..\bin\icuio28.dll"
 				LinkIncremental="1"
 				SuppressStartupBanner="TRUE"
 				AdditionalLibraryDirectories="..\..\..\lib\"
-				ProgramDatabaseFile=".\..\..\..\lib/icuio26.pdb"
+				ProgramDatabaseFile=".\..\..\..\lib/icuio28.pdb"
+				BaseAddress="0x4ab00000"
 				ImportLibrary="..\..\..\lib/icuio.lib"/>
 			<Tool
 				Name="VCMIDLTool"
@@ -68,7 +71,13 @@
 			<Tool
 				Name="VCWebServiceProxyGeneratorTool"/>
 			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
 				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
 		</Configuration>
 		<Configuration
 			Name="Debug|Win32"
@@ -84,7 +93,7 @@
 				ImproveFloatingPointConsistency="TRUE"
 				OptimizeForProcessor="2"
 				AdditionalIncludeDirectories="..\..\..\include,..\..\common"
-				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;USTDIO_EXPORTS;U_USTDIO_IMPLEMENTATION"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;U_USTDIO_IMPLEMENTATION"
 				BasicRuntimeChecks="3"
 				RuntimeLibrary="3"
 				DisableLanguageExtensions="TRUE"
@@ -103,12 +112,13 @@
 				Name="VCLinkerTool"
 				AdditionalOptions="/MACHINE:I386"
 				AdditionalDependencies="icuucd.lib icuind.lib"
-				OutputFile="..\..\..\bin\icuio26d.dll"
+				OutputFile="..\..\..\bin\icuio28d.dll"
 				LinkIncremental="2"
 				SuppressStartupBanner="TRUE"
 				AdditionalLibraryDirectories="debug,..\..\..\lib\"
 				GenerateDebugInformation="TRUE"
-				ProgramDatabaseFile=".\..\..\..\lib/icuio26d.pdb"
+				ProgramDatabaseFile=".\..\..\..\lib/icuio28d.pdb"
+				BaseAddress="0x4ab00000"
 				ImportLibrary="..\..\..\lib\icuiod.lib"/>
 			<Tool
 				Name="VCMIDLTool"
@@ -131,9 +141,17 @@
 			<Tool
 				Name="VCWebServiceProxyGeneratorTool"/>
 			<Tool
+				Name="VCXMLDataGeneratorTool"/>
+			<Tool
 				Name="VCWebDeploymentTool"/>
+			<Tool
+				Name="VCManagedWrapperGeneratorTool"/>
+			<Tool
+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
 		</Configuration>
 	</Configurations>
+	<References>
+	</References>
 	<Files>
 		<Filter
 			Name="Source Files"
@@ -142,21 +160,12 @@
 				RelativePath=".\locbund.c">
 			</File>
 			<File
-				RelativePath=".\loccache.c">
-			</File>
-			<File
 				RelativePath=".\sprintf.c">
 			</File>
 			<File
-				RelativePath=".\sprntf_p.c">
-			</File>
-			<File
 				RelativePath=".\sscanf.c">
 			</File>
 			<File
-				RelativePath=".\sscanf_p.c">
-			</File>
-			<File
 				RelativePath=".\ufile.c">
 			</File>
 			<File
@@ -203,21 +212,12 @@
 				RelativePath=".\locbund.h">
 			</File>
 			<File
-				RelativePath=".\loccache.h">
-			</File>
-			<File
 				RelativePath=".\sprintf.h">
 			</File>
 			<File
-				RelativePath=".\sprntf_p.h">
-			</File>
-			<File
 				RelativePath=".\sscanf.h">
 			</File>
 			<File
-				RelativePath=".\sscanf_p.h">
-			</File>
-			<File
 				RelativePath=".\ufile.h">
 			</File>
 			<File
@@ -244,17 +244,17 @@
 					Name="Release|Win32">
 					<Tool
 						Name="VCCustomBuildTool"
-						CommandLine="copy $(InputPath) ..\..\..\include\unicode
+						CommandLine="copy &quot;$(InputPath)&quot; ..\..\..\include\unicode
 "
-						Outputs="..\..\..\include\unicode\ustdio.h"/>
+						Outputs="..\..\..\include\unicode\$(InputFileName)"/>
 				</FileConfiguration>
 				<FileConfiguration
 					Name="Debug|Win32">
 					<Tool
 						Name="VCCustomBuildTool"
-						CommandLine="copy $(InputPath) ..\..\..\include\unicode
+						CommandLine="copy &quot;$(InputPath)&quot; ..\..\..\include\unicode
 "
-						Outputs="..\..\..\include\unicode\ustdio.h"/>
+						Outputs="..\..\..\include\unicode\$(InputFileName)"/>
 				</FileConfiguration>
 			</File>
 			<File
@@ -263,17 +263,17 @@
 					Name="Release|Win32">
 					<Tool
 						Name="VCCustomBuildTool"
-						CommandLine="copy $(InputPath) ..\..\..\include\unicode
+						CommandLine="copy &quot;$(InputPath)&quot; ..\..\..\include\unicode
 "
-						Outputs="..\..\..\include\unicode\ustream.h"/>
+						Outputs="..\..\..\include\unicode\$(InputFileName)"/>
 				</FileConfiguration>
 				<FileConfiguration
 					Name="Debug|Win32">
 					<Tool
 						Name="VCCustomBuildTool"
-						CommandLine="copy $(InputPath) ..\..\..\include\unicode
+						CommandLine="copy &quot;$(InputPath)&quot; ..\..\..\include\unicode
 "
-						Outputs="..\..\..\include\unicode\ustream.h"/>
+						Outputs="..\..\..\include\unicode\$(InputFileName)"/>
 				</FileConfiguration>
 			</File>
 		</Filter>

--- loccache.c DELETED ---

--- loccache.h DELETED ---

--- sprntf_p.c DELETED ---

--- sprntf_p.h DELETED ---

--- sscanf_p.c DELETED ---

--- sscanf_p.h DELETED ---