We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 137b77d + 2ce8c12 commit e56a154Copy full SHA for e56a154
CMakeLists.txt
@@ -107,3 +107,36 @@ configure_file(
107
108
add_custom_target(uninstall
109
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
110
+
111
+SET(MAJOR_VERSION 1)
112
+SET(MINOR_VERSION 0)
113
+SET(PATCH_VERSION 1)
114
+IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
115
116
+INCLUDE (InstallRequiredSystemLibraries)
117
118
+SET (CPACK_SET_DESTDIR "on")
119
+SET (CPACK_PACKAGING_INSTALL_PREFIX "/tmp")
120
+SET (CPACK_GENERATOR "DEB")
121
122
+SET (CPACK_DEBIAN_PACKAGE_PRIORITY "extra")
123
+SET (CPACK_DEBIAN_PACKAGE_SECTION "libs")
124
+SET (CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
125
+# autogenerate dependency information
126
+set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
127
128
+SET (CPACK_PACKAGE_DESCRIPTION "Short description")
129
+SET (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Long description")
130
+SET (CPACK_PACKAGE_VENDOR "Titan Lien (digbil)")
131
+SET (CPACK_PACKAGE_CONTACT "[email protected]")
132
+SET (CPACK_PACKAGE_VERSION_MAJOR "${MAJOR_VERSION}")
133
+SET (CPACK_PACKAGE_VERSION_MINOR "${MINOR_VERSION}")
134
+SET (CPACK_PACKAGE_VERSION_PATCH "${PATCH_VERSION}")
135
136
+SET (CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${MAJOR_VERSION}.${MINOR_VERSION}.${CPACK_PACKAGE_VERSION_PATCH}")
137
+SET (CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${MAJOR_VERSION}.${MINOR_VERSION}.${CPACK_PACKAGE_VERSION_PATCH}")
138
139
+SET (CPACK_COMPONENTS_ALL Libraries ApplicationData)
140
+INCLUDE (CPack)
141
+ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
142
example/Makefile
@@ -0,0 +1,9 @@
1
+TARGET=validate
2
+TARGET2=example
3
4
+all:
5
+ gcc -o ${TARGET} ${TARGET}.c -lwjelement -lwjreader
6
+ gcc -o ${TARGET2} ${TARGET2}.c -lwjelement -lwjreader
7
8
+clean:
9
+ rm ${TARGET} ${TARGET2}
example/example.c
@@ -64,6 +64,11 @@ console.log(JSON.stringify(doc));
64
#include <wjelement.h>
65
#include <inttypes.h>
66
67
+WJRType
68
+WJE_GET_TYPE(WJElement parent)
69
+{
70
+ return parent->child->next->type;
71
+}
72
73
int main(int argc, char **argv) {
74
WJElement doc = NULL;
@@ -102,10 +107,7 @@ int main(int argc, char **argv) {
102
WJECloseDocument(WJEGet(doc, "shiny", NULL));
103
104
while((person = _WJEObject(doc, "crew[]", WJE_GET, &person))) {
105
- printf("%s (%s) is %"PRId64"\n",
106
- WJEString(person, "name", WJE_GET, ""),
- WJEString(person, "job", WJE_GET, ""),
- (2517 - WJEInt64(person, "born", WJE_GET, 0)));
+ printf("person Type is %c\n", WJE_GET_TYPE(person));
}
while((cameo = WJEGet(doc, "cameo[]", cameo))) {
printf("Cameo: %s\n", WJEString(cameo, NULL, WJE_GET, ""));
example/layout.json
@@ -0,0 +1,12 @@
+ "type": "layout",
+ "headers": {
+ "msg_id": "DSCS1385112923586"
+ },
+ "obj": {
+ "name": "test",
+ "status": "draft",
+ "orientation": "landscape",
10
+ "widget": []
11
+ }
12
example/layout.schema
@@ -0,0 +1,103 @@
+ "name": "layout schema check",
+ "type": "object",
+ "properties": {
+ "_id": {
+ "type": "string",
+ "required": true
+ "name": {
13
+ "template": {
14
15
16
+ "orientation": {
17
18
+ "enum": [
19
+ "portrait",
20
+ "landscape"
21
+ ],
22
23
24
+ "status": {
25
26
27
+ "draft",
28
+ "ready"
29
30
+ "default": "ready",
31
32
33
+ "ts": {
34
35
36
37
+ "widgets": {
38
+ "type": "array",
39
+ "required": true,
40
+ "items": {
41
+ "name": "widget setting",
42
43
+ "additionalProperties": false,
44
45
+ "widget": {
46
47
48
49
50
51
+ "description": "Must be the widget name( package name )",
52
53
54
+ "h": {
55
+ "type": "number",
56
+ "description": " 0.0 ~ 1.0",
57
58
59
+ "w": {
60
61
62
63
+ "top": {
+ "left": {
75
76
77
78
+ "param": {
79
80
81
82
83
84
85
86
87
88
+ "val": {
89
90
91
92
93
94
95
96
97
98
99
100
101
example/validate.c
@@ -46,7 +46,7 @@ static WJElement schema_load(const char *name, void *client,
free(path);
-
+ WJEDump(schema);
return schema;
include/xpl.h
@@ -69,7 +69,7 @@
typedef int XplBool;
#ifndef WIN32
-typedef unsigned long LONG;
+typedef long LONG;
#endif
#ifndef FALSE
0 commit comments