read.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // © 2016 and later: Unicode, Inc. and others.
  2. // License & terms of use: http://www.unicode.org/copyright.html
  3. /*
  4. *******************************************************************************
  5. *
  6. * Copyright (C) 1998-2011, International Business Machines
  7. * Corporation and others. All Rights Reserved.
  8. *
  9. *******************************************************************************
  10. *
  11. * File read.h
  12. *
  13. * Modification History:
  14. *
  15. * Date Name Description
  16. * 05/26/99 stephen Creation.
  17. * 5/10/01 Ram removed ustdio dependency
  18. *******************************************************************************
  19. */
  20. #ifndef READ_H
  21. #define READ_H 1
  22. #include "unicode/utypes.h"
  23. #include "ustr.h"
  24. #include "ucbuf.h"
  25. /* The types of tokens which may be returned by getNextToken.
  26. NOTE: Keep these in sync with tokenNames in parse.c */
  27. enum ETokenType
  28. {
  29. TOK_STRING, /* A string token, such as "MonthNames" */
  30. TOK_OPEN_BRACE, /* An opening brace character */
  31. TOK_CLOSE_BRACE, /* A closing brace character */
  32. TOK_COMMA, /* A comma */
  33. TOK_COLON, /* A colon */
  34. TOK_EOF, /* End of the file has been reached successfully */
  35. TOK_ERROR, /* An error, such an unterminated quoted string */
  36. TOK_TOKEN_COUNT /* Number of "real" token types */
  37. };
  38. U_CFUNC UChar32 unescape(UCHARBUF *buf, UErrorCode *status);
  39. U_CFUNC void resetLineNumber(void);
  40. U_CFUNC enum ETokenType
  41. getNextToken(UCHARBUF *buf,
  42. struct UString *token,
  43. uint32_t *linenumber, /* out: linenumber of token */
  44. struct UString *comment,
  45. UErrorCode *status);
  46. #endif