You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

json_tokener.h 2.0 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * $Id: json_tokener.h,v 1.5 2004/07/22 01:20:05 mclark Exp $
  3. *
  4. * Copyright Metaparadigm Pte. Ltd. 2004.
  5. * Michael Clark <michael@metaparadigm.com>
  6. *
  7. * This library is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public (LGPL)
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * This library is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details: http://www.gnu.org/
  16. *
  17. */
  18. #ifndef _json_tokener_h_
  19. #define _json_tokener_h_
  20. #include "json_object.h"
  21. enum json_tokener_error {
  22. json_tokener_success,
  23. json_tokener_error_parse_unexpected,
  24. json_tokener_error_parse_null,
  25. json_tokener_error_parse_boolean,
  26. json_tokener_error_parse_number,
  27. json_tokener_error_parse_array,
  28. json_tokener_error_parse_object,
  29. json_tokener_error_parse_string,
  30. json_tokener_error_parse_comment,
  31. json_tokener_error_parse_eof,
  32. };
  33. enum json_tokener_state {
  34. json_tokener_state_eatws,
  35. json_tokener_state_start,
  36. json_tokener_state_finish,
  37. json_tokener_state_null,
  38. json_tokener_state_comment_start,
  39. json_tokener_state_comment,
  40. json_tokener_state_comment_eol,
  41. json_tokener_state_comment_end,
  42. json_tokener_state_string,
  43. json_tokener_state_string_escape,
  44. json_tokener_state_escape_unicode,
  45. json_tokener_state_boolean,
  46. json_tokener_state_number,
  47. json_tokener_state_array,
  48. json_tokener_state_array_sep,
  49. json_tokener_state_object,
  50. json_tokener_state_object_field_start,
  51. json_tokener_state_object_field,
  52. json_tokener_state_object_field_end,
  53. json_tokener_state_object_value,
  54. json_tokener_state_object_sep,
  55. };
  56. struct json_tokener
  57. {
  58. char *source;
  59. int pos;
  60. struct printbuf *pb;
  61. };
  62. extern struct json_object* json_tokener_parse(char *s);
  63. #endif

No Description

Contributors (1)