-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructured the project so sources weren't in root folder. Fixed an …
…error in socket server link
- Loading branch information
1 parent
efe3a86
commit e519e26
Showing
24 changed files
with
171 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* Test example of gracht protocol message version 2 | ||
* Includes example of a test protocol and some test structures | ||
*/ | ||
|
||
import "test_structs" | ||
namespace gracht | ||
|
||
// define calculator service with id of 1 | ||
service calculator (0x1) { | ||
func add(int a, int b) : (int result); | ||
func add_many(int[] inputs) : (int result); | ||
func print(string text) : (int result); | ||
|
||
func getHistory() : (string history); | ||
func getHistories() : (string[] histories); | ||
|
||
func transfer(transfer_request request) : (int status); | ||
func transfer_many(transfer_request[] request) : (int[] statuses); | ||
|
||
event error : (int code, string description); | ||
event transfer_complete : transfer_complete_event; | ||
} | ||
|
||
service control (2) { | ||
func subscribe(uint8_t protocol) : (); | ||
func unsubscribe(uint8_t protocol) : (); | ||
|
||
event error : (uint32_t messageId, int errorCode); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* Test example of gracht protocol message version 2 | ||
* Includes example of a test protocol and some test structures | ||
*/ | ||
|
||
import "test_types" | ||
|
||
struct transfer_device { | ||
string device; | ||
} | ||
|
||
struct transfer_bit { | ||
int start; | ||
int length; | ||
} | ||
|
||
struct transfer_request { | ||
transfer_device device; | ||
transfer_bit[] bits; | ||
} | ||
|
||
struct transfer_complete_event { | ||
uint32_t id; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* Test example of gracht protocol message version 2 | ||
* Includes example of a test protocol and some test structures | ||
*/ | ||
|
||
define uint32_t from "stdint.h" | ||
|
||
enum error_codes { | ||
ok = 0, | ||
invalid_parameters = -1, | ||
invalid_result = -2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
|
||
set (WARNING_COMPILE_FLAGS "-Wall -Wextra -Wno-unused-function") | ||
set (SRCS "") | ||
|
||
macro (add_sources) | ||
file (RELATIVE_PATH _relPath "${PROJECT_SOURCE_DIR}/runtime" "${CMAKE_CURRENT_SOURCE_DIR}") | ||
foreach (_src ${ARGN}) | ||
if (_relPath) | ||
list (APPEND SRCS "${_relPath}/${_src}") | ||
else() | ||
list (APPEND SRCS "${_src}") | ||
endif() | ||
endforeach() | ||
endmacro() | ||
|
||
# Configure include paths | ||
if (VALI_BUILD) | ||
include_directories ( | ||
${CMAKE_BINARY_DIR} | ||
../libds/include | ||
../libddk/include | ||
../libc/include | ||
../include | ||
) | ||
else () | ||
include_directories( | ||
${CMAKE_BINARY_DIR} | ||
../include | ||
) | ||
endif () | ||
|
||
if (MOLLENOS) | ||
add_definitions(${WARNING_COMPILE_FLAGS}) | ||
add_sources ( | ||
link/vali-ipc/client.c | ||
link/vali-ipc/message.c | ||
link/vali-ipc/os.c | ||
link/vali-ipc/server.c | ||
) | ||
endif () | ||
|
||
if (UNIX) | ||
add_definitions(${WARNING_COMPILE_FLAGS}) | ||
endif () | ||
|
||
add_sources(link/socket/client.c link/socket/server.c link/socket/shared.c) | ||
add_sources(client.c client_config.c crc.c server.c server_config.c shared.c arena.c dispatch.c hashtable.c control.c) | ||
|
||
add_library(gracht ${SRCS}) | ||
|
||
if (VALI_BUILD) | ||
install(TARGETS gracht | ||
ARCHIVE DESTINATION vali-ddk/lib | ||
LIBRARY DESTINATION vali-ddk/lib | ||
RUNTIME DESTINATION vali-ddk/bin | ||
) | ||
install(DIRECTORY include/ DESTINATION vali-ddk/include) | ||
install(DIRECTORY generator/ DESTINATION vali-ddk/share/vali) | ||
else () | ||
install(TARGETS gracht | ||
ARCHIVE DESTINATION lib | ||
LIBRARY DESTINATION lib | ||
RUNTIME DESTINATION bin | ||
) | ||
install(DIRECTORY include/ DESTINATION include) | ||
install(DIRECTORY generator/ DESTINATION share/gracht) | ||
install(FILES protocol.xml DESTINATION share/gracht) | ||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters