src/core/ngx_json_unescape.h - nginx-1.31.9 nginx/ @ 2a3a19c6f

Macros defined

Source code


  1. /*
  2. * Copyright (C) Nginx, Inc.
  3. */


  4. #ifndef _NGX_JSON_UNESCAPE_H_INCLUDED_
  5. ‌#define _NGX_JSON_UNESCAPE_H_INCLUDED_


  6. #include <ngx_config.h>
  7. #include <ngx_core.h>


  8. /*
  9. * Decode JSON escape sequences (RFC 8259, Section 7).  The input
  10. * is an unquoted JSON string body (no surrounding double quotes).
  11. *
  12. * On entry, dst->len is the capacity of dst->data and must be at least
  13. * src->len.
  14. * On success, dst->len is the decoded length.
  15. *
  16. * Returns NGX_OK, or NGX_ERROR on a malformed escape or invalid input.
  17. */
  18. ngx_int_t ngx_json_unescape_string(ngx_str_t *dst, ngx_str_t *src);

  19. ngx_int_t ngx_json_hex_digit(u_char ch);


  20. #endif /* _NGX_JSON_UNESCAPE_H_INCLUDED_ */