]> git.proxmox.com Git - ceph.git/blob - ceph/src/civetweb/src/third_party/duktape-1.8.0/src-separate/duk_bi_protos.h
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / civetweb / src / third_party / duktape-1.8.0 / src-separate / duk_bi_protos.h
1 /*
2 * Prototypes for built-in functions not automatically covered by the
3 * header declarations emitted by genbuiltins.py.
4 */
5
6 #ifndef DUK_BUILTIN_PROTOS_H_INCLUDED
7 #define DUK_BUILTIN_PROTOS_H_INCLUDED
8
9 /* Buffer size needed for duk_bi_date_format_timeval().
10 * Accurate value is 32 + 1 for NUL termination:
11 * >>> len('+123456-01-23T12:34:56.123+12:34')
12 * 32
13 * Include additional space to be safe.
14 */
15 #define DUK_BI_DATE_ISO8601_BUFSIZE 48
16
17 /* Maximum length of CommonJS module identifier to resolve. Length includes
18 * both current module ID, requested (possibly relative) module ID, and a
19 * slash in between.
20 */
21 #define DUK_BI_COMMONJS_MODULE_ID_LIMIT 256
22
23 /* Helpers exposed for internal use */
24 DUK_INTERNAL_DECL void duk_bi_date_timeval_to_parts(duk_double_t d, duk_int_t *parts, duk_double_t *dparts, duk_small_uint_t flags);
25 DUK_INTERNAL_DECL duk_double_t duk_bi_date_get_timeval_from_dparts(duk_double_t *dparts, duk_small_uint_t flags);
26 DUK_INTERNAL_DECL void duk_bi_date_format_timeval(duk_double_t timeval, duk_uint8_t *out_buf);
27 DUK_INTERNAL_DECL duk_bool_t duk_bi_date_is_leap_year(duk_int_t year);
28 DUK_INTERNAL_DECL duk_bool_t duk_bi_date_timeval_in_valid_range(duk_double_t x);
29 DUK_INTERNAL_DECL duk_bool_t duk_bi_date_year_in_valid_range(duk_double_t year);
30 DUK_INTERNAL_DECL duk_bool_t duk_bi_date_timeval_in_leeway_range(duk_double_t x);
31 /* Built-in providers */
32 #if defined(DUK_USE_DATE_NOW_GETTIMEOFDAY)
33 DUK_INTERNAL_DECL duk_double_t duk_bi_date_get_now_gettimeofday(duk_context *ctx);
34 #endif
35 #if defined(DUK_USE_DATE_NOW_TIME)
36 DUK_INTERNAL_DECL duk_double_t duk_bi_date_get_now_time(duk_context *ctx);
37 #endif
38 #if defined(DUK_USE_DATE_NOW_WINDOWS)
39 DUK_INTERNAL_DECL duk_double_t duk_bi_date_get_now_windows(duk_context *ctx);
40 #endif
41 #if defined(DUK_USE_DATE_TZO_GMTIME_R) || defined(DUK_USE_DATE_TZO_GMTIME)
42 DUK_INTERNAL_DECL duk_int_t duk_bi_date_get_local_tzoffset_gmtime(duk_double_t d);
43 #endif
44 #if defined(DUK_USE_DATE_TZO_WINDOWS)
45 DUK_INTERNAL_DECL duk_int_t duk_bi_date_get_local_tzoffset_windows(duk_double_t d);
46 #endif
47 #if defined(DUK_USE_DATE_PRS_STRPTIME)
48 DUK_INTERNAL_DECL duk_bool_t duk_bi_date_parse_string_strptime(duk_context *ctx, const char *str);
49 #endif
50 #if defined(DUK_USE_DATE_PRS_GETDATE)
51 DUK_INTERNAL_DECL duk_bool_t duk_bi_date_parse_string_getdate(duk_context *ctx, const char *str);
52 #endif
53 #if defined(DUK_USE_DATE_FMT_STRFTIME)
54 DUK_INTERNAL_DECL duk_bool_t duk_bi_date_format_parts_strftime(duk_context *ctx, duk_int_t *parts, duk_int_t tzoffset, duk_small_uint_t flags);
55 #endif
56
57 DUK_INTERNAL_DECL
58 void duk_bi_json_parse_helper(duk_context *ctx,
59 duk_idx_t idx_value,
60 duk_idx_t idx_reviver,
61 duk_small_uint_t flags);
62 DUK_INTERNAL_DECL
63 void duk_bi_json_stringify_helper(duk_context *ctx,
64 duk_idx_t idx_value,
65 duk_idx_t idx_replacer,
66 duk_idx_t idx_space,
67 duk_small_uint_t flags);
68
69 #endif /* DUK_BUILTIN_PROTOS_H_INCLUDED */