-
Notifications
You must be signed in to change notification settings - Fork 16
/
func.js
58 lines (52 loc) · 1.19 KB
/
func.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* Copyright (c) 2022 ACOAUTO Team.
* All rights reserved.
*
* Detailed license information can be found in the LICENSE file.
*
* File: func.js function template.
*
* Author: Han.hui <hanhui@acoinfo.com>
*
*/
/* Configure */
const CONF = global.CONF;
/*
* JSON parse
*/
exports.JSON_PARSE =
`/*
* Deserialize the JSON string into a structure '${CONF.struct.name}'
*/
bool ${CONF.name}_json_parse (struct ${CONF.struct.name} *des, const char *str, size_t len)`;
/*
* Parse free
*/
exports.PARSE_FREE =
`/*
* Free ${CONF.name}_json_parse() buffer, Warning: string type member can no longer be used
*/
void ${CONF.name}_json_parse_free (struct ${CONF.struct.name} *des)`;
/*
* JSON stringify
*/
exports.JSON_STRINGIFY =
`/*
* Serialize the structure '${CONF.struct.name}' into a JSON string
*/
char *${CONF.name}_json_stringify (const struct ${CONF.struct.name} *des)`;
/*
* Stringify free
*/
exports.STRINGIFY_FREE =
`/*
* Free ${CONF.name}_json_stringify() return value
*/
void ${CONF.name}_json_stringify_free (char *str)`;
/*
* Function Object declaration
*/
exports.FUNCTION_OBJECT_DECLARATION =
`/*
* Serialize and Deserialize function declaration of substructure
*/`;