Skip to content

Commit e56a154

Browse files
author
Micah N Gorrell
committed
Merge branch 'titanlien-cpack'
2 parents 137b77d + 2ce8c12 commit e56a154

File tree

7 files changed

+165
-6
lines changed

7 files changed

+165
-6
lines changed

CMakeLists.txt

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,36 @@ configure_file(
107107

108108
add_custom_target(uninstall
109109
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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ console.log(JSON.stringify(doc));
6464
#include <wjelement.h>
6565
#include <inttypes.h>
6666

67+
WJRType
68+
WJE_GET_TYPE(WJElement parent)
69+
{
70+
return parent->child->next->type;
71+
}
6772

6873
int main(int argc, char **argv) {
6974
WJElement doc = NULL;
@@ -102,10 +107,7 @@ int main(int argc, char **argv) {
102107
WJECloseDocument(WJEGet(doc, "shiny", NULL));
103108

104109
while((person = _WJEObject(doc, "crew[]", WJE_GET, &person))) {
105-
printf("%s (%s) is %"PRId64"\n",
106-
WJEString(person, "name", WJE_GET, ""),
107-
WJEString(person, "job", WJE_GET, ""),
108-
(2517 - WJEInt64(person, "born", WJE_GET, 0)));
110+
printf("person Type is %c\n", WJE_GET_TYPE(person));
109111
}
110112
while((cameo = WJEGet(doc, "cameo[]", cameo))) {
111113
printf("Cameo: %s\n", WJEString(cameo, NULL, WJE_GET, ""));

example/layout.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"type": "layout",
3+
"headers": {
4+
"msg_id": "DSCS1385112923586"
5+
},
6+
"obj": {
7+
"name": "test",
8+
"status": "draft",
9+
"orientation": "landscape",
10+
"widget": []
11+
}
12+
}

example/layout.schema

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
{
2+
"name": "layout schema check",
3+
"type": "object",
4+
"properties": {
5+
"_id": {
6+
"type": "string",
7+
"required": true
8+
},
9+
"name": {
10+
"type": "string",
11+
"required": true
12+
},
13+
"template": {
14+
"type": "string",
15+
},
16+
"orientation": {
17+
"type": "string",
18+
"enum": [
19+
"portrait",
20+
"landscape"
21+
],
22+
"required": true
23+
},
24+
"status": {
25+
"type": "string",
26+
"enum": [
27+
"draft",
28+
"ready"
29+
],
30+
"default": "ready",
31+
"required": true
32+
},
33+
"ts": {
34+
"type": "string",
35+
"required": true
36+
},
37+
"widgets": {
38+
"type": "array",
39+
"required": true,
40+
"items": {
41+
"name": "widget setting",
42+
"type": "object",
43+
"additionalProperties": false,
44+
"properties": {
45+
"widget": {
46+
"type": "string",
47+
"required": true
48+
},
49+
"name": {
50+
"type": "string",
51+
"description": "Must be the widget name( package name )",
52+
"required": true
53+
},
54+
"h": {
55+
"type": "number",
56+
"description": " 0.0 ~ 1.0",
57+
"required": true
58+
},
59+
"w": {
60+
"type": "number",
61+
"description": " 0.0 ~ 1.0",
62+
"required": true
63+
},
64+
"top": {
65+
"type": "number",
66+
"description": " 0.0 ~ 1.0",
67+
"required": true
68+
},
69+
"left": {
70+
"type": "number",
71+
"description": " 0.0 ~ 1.0",
72+
"required": true
73+
},
74+
"_id": {
75+
"type": "string",
76+
"required": true
77+
},
78+
"param": {
79+
"type": "array",
80+
"items": {
81+
"type": "object",
82+
"additionalProperties": false,
83+
"properties": {
84+
"name": {
85+
"type": "string",
86+
"required": true
87+
},
88+
"val": {
89+
"required": true
90+
},
91+
92+
"_id": {
93+
"type": "string",
94+
"required": true
95+
}
96+
}
97+
}
98+
}
99+
}
100+
}
101+
}
102+
}
103+
}

example/validate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static WJElement schema_load(const char *name, void *client,
4646
}
4747
free(path);
4848
}
49-
49+
WJEDump(schema);
5050
return schema;
5151
}
5252

include/xpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
typedef int XplBool;
7070

7171
#ifndef WIN32
72-
typedef unsigned long LONG;
72+
typedef long LONG;
7373
#endif
7474

7575
#ifndef FALSE

0 commit comments

Comments
 (0)