home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 6 / AACD06.ISO / AACD / Programming / ICU / src / icu / source / tools / genrb / ufile.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-08-16  |  2.0 KB  |  64 lines

  1. /*
  2. *******************************************************************************
  3. *                                                                             *
  4. * COPYRIGHT:                                                                  *
  5. *   (C) Copyright International Business Machines Corporation, 1998           *
  6. *   Licensed Material - Program-Property of IBM - All Rights Reserved.        *
  7. *   US Government Users Restricted Rights - Use, duplication, or disclosure   *
  8. *   restricted by GSA ADP Schedule Contract with IBM Corp.                    *
  9. *                                                                             *
  10. *******************************************************************************
  11. *
  12. * File ufile.h
  13. *
  14. * Modification History:
  15. *
  16. *   Date        Name        Description
  17. *   12/01/98    stephen        Creation.
  18. *   03/12/99    stephen     Modified for new C API.
  19. *   05/26/99    stephen     Created in tools/genrb from extra/ustdio.
  20. *                           Modified to use FileStream, removed LocaleBundle.
  21. *******************************************************************************
  22. */
  23.  
  24. #ifndef UFILE_H
  25. #define UFILE_H 1
  26.  
  27. #include "utypes.h"
  28. #include "ucnv.h"
  29. #include "filestrm.h"
  30.  
  31. /* The buffer size for fromUnicode calls */
  32. #define UFILE_CHARBUFFER_SIZE 1024
  33.  
  34. /* The buffer size for toUnicode calls */
  35. #define UFILE_UCHARBUFFER_SIZE 1024
  36.  
  37. /* A UFILE */
  38. struct UFILE {
  39.   FileStream        *fFile;        /* the actual fs interface */
  40.   bool_t        fOwnFile;    /* TRUE if fFile should be closed */
  41.  
  42.   UConverter        *fConverter;     /* for codeset conversion */
  43.  
  44.                       /* buffer used for fromUnicode */
  45.   char            fCharBuffer     [UFILE_CHARBUFFER_SIZE];
  46.  
  47.                       /* buffer used for toUnicode */
  48.   UChar            fUCBuffer     [UFILE_UCHARBUFFER_SIZE];
  49.  
  50.   UChar            *fUCLimit;     /* data limit in fUCBuffer */
  51.   UChar         *fUCPos;     /* current pos in fUCBuffer */
  52. };
  53. typedef struct UFILE UFILE;
  54.  
  55. /**
  56.  * Fill a UFILE's buffer with converted codepage data.
  57.  * @param f The UFILE containing the buffer to fill.
  58.  */
  59. void
  60. ufile_fill_uchar_buffer(UFILE *f,
  61.             UErrorCode *status);
  62.  
  63. #endif
  64.