mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-12-01 19:49:11 +08:00
restruct folders in streams
This commit is contained in:
parent
412207e63e
commit
2153960093
@ -4,7 +4,7 @@ import copy
|
||||
BIN_DIR=os.environ['BIN_DIR'];
|
||||
LIB_DIR=os.environ['LIB_DIR'];
|
||||
|
||||
sources = Glob('*.c')
|
||||
sources = Glob('buffered/*.c') + Glob('file/*.c') + Glob('inet/*.c') + Glob('mem/*.c') + Glob('serial/*.c') + Glob('shdlc/*.c')
|
||||
|
||||
env=DefaultEnvironment().Clone()
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "tkc/mem.h"
|
||||
#include "streams/istream_buffered.h"
|
||||
#include "streams/buffered/istream_buffered.h"
|
||||
|
||||
static int32_t tk_istream_buffered_read(tk_istream_t* stream, uint8_t* buff, uint32_t max_size) {
|
||||
tk_istream_buffered_t* istream_buffered = TK_ISTREAM_BUFFERED(stream);
|
@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "tkc/buffer.h"
|
||||
#include "streams/ostream_buffered.h"
|
||||
#include "streams/buffered/ostream_buffered.h"
|
||||
|
||||
static int32_t tk_ostream_buffered_write(tk_ostream_t* stream, const uint8_t* buff,
|
||||
uint32_t max_size) {
|
@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "tkc/mem.h"
|
||||
#include "streams/istream_file.h"
|
||||
#include "streams/file/istream_file.h"
|
||||
|
||||
static int32_t tk_istream_file_read(tk_istream_t* stream, uint8_t* buff, uint32_t max_size) {
|
||||
tk_istream_file_t* istream_file = TK_ISTREAM_FILE(stream);
|
@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "tkc/mem.h"
|
||||
#include "streams/ostream_file.h"
|
||||
#include "streams/file/ostream_file.h"
|
||||
|
||||
static int32_t tk_ostream_file_write(tk_ostream_t* stream, const uint8_t* buff, uint32_t max_size) {
|
||||
tk_ostream_file_t* ostream_file = TK_OSTREAM_FILE(stream);
|
@ -24,10 +24,10 @@
|
||||
#endif /*WIN32_LEAN_AND_MEAN*/
|
||||
|
||||
#include "tkc/mem.h"
|
||||
#include "streams/socket_helper.h"
|
||||
#include "streams/istream_tcp.h"
|
||||
#include "streams/ostream_tcp.h"
|
||||
#include "streams/iostream_tcp.h"
|
||||
#include "streams/inet/socket_helper.h"
|
||||
#include "streams/inet/istream_tcp.h"
|
||||
#include "streams/inet/ostream_tcp.h"
|
||||
#include "streams/inet/iostream_tcp.h"
|
||||
|
||||
static ret_t tk_iostream_tcp_get_prop(object_t* obj, const char* name, value_t* v) {
|
||||
tk_iostream_tcp_t* iostream_tcp = TK_IOSTREAM_TCP(obj);
|
@ -24,10 +24,10 @@
|
||||
#endif /*WIN32_LEAN_AND_MEAN*/
|
||||
|
||||
#include "tkc/mem.h"
|
||||
#include "streams/socket_helper.h"
|
||||
#include "streams/istream_udp.h"
|
||||
#include "streams/ostream_udp.h"
|
||||
#include "streams/iostream_udp.h"
|
||||
#include "streams/inet/socket_helper.h"
|
||||
#include "streams/inet/istream_udp.h"
|
||||
#include "streams/inet/ostream_udp.h"
|
||||
#include "streams/inet/iostream_udp.h"
|
||||
|
||||
static ret_t tk_iostream_udp_get_prop(object_t* obj, const char* name, value_t* v) {
|
||||
tk_iostream_udp_t* iostream_udp = TK_IOSTREAM_UDP(obj);
|
@ -24,8 +24,8 @@
|
||||
#endif /*WIN32_LEAN_AND_MEAN*/
|
||||
|
||||
#include "tkc/mem.h"
|
||||
#include "streams/socket_helper.h"
|
||||
#include "streams/istream_tcp.h"
|
||||
#include "streams/inet/socket_helper.h"
|
||||
#include "streams/inet/istream_tcp.h"
|
||||
|
||||
static int32_t tk_istream_tcp_read(tk_istream_t* stream, uint8_t* buff, uint32_t max_size) {
|
||||
int32_t ret = 0;
|
@ -24,8 +24,8 @@
|
||||
#endif /*WIN32_LEAN_AND_MEAN*/
|
||||
|
||||
#include "tkc/mem.h"
|
||||
#include "streams/socket_helper.h"
|
||||
#include "streams/istream_udp.h"
|
||||
#include "streams/inet/socket_helper.h"
|
||||
#include "streams/inet/istream_udp.h"
|
||||
|
||||
static int32_t tk_istream_udp_read(tk_istream_t* stream, uint8_t* buff, uint32_t max_size) {
|
||||
int32_t ret = 0;
|
@ -24,8 +24,8 @@
|
||||
#endif /*WIN32_LEAN_AND_MEAN*/
|
||||
|
||||
#include "tkc/mem.h"
|
||||
#include "streams/socket_helper.h"
|
||||
#include "streams/ostream_tcp.h"
|
||||
#include "streams/inet/socket_helper.h"
|
||||
#include "streams/inet/ostream_tcp.h"
|
||||
|
||||
static int32_t tk_ostream_tcp_write(tk_ostream_t* stream, const uint8_t* buff, uint32_t max_size) {
|
||||
int32_t ret = 0;
|
@ -24,8 +24,8 @@
|
||||
#endif /*WIN32_LEAN_AND_MEAN*/
|
||||
|
||||
#include "tkc/mem.h"
|
||||
#include "streams/socket_helper.h"
|
||||
#include "streams/ostream_udp.h"
|
||||
#include "streams/inet/socket_helper.h"
|
||||
#include "streams/inet/ostream_udp.h"
|
||||
|
||||
static int32_t tk_ostream_udp_write(tk_ostream_t* stream, const uint8_t* buff, uint32_t max_size) {
|
||||
int32_t ret = 0;
|
@ -24,7 +24,7 @@
|
||||
#endif /*WIN32_LEAN_AND_MEAN*/
|
||||
|
||||
#include "tkc/mem.h"
|
||||
#include "streams/socket_helper.h"
|
||||
#include "streams/inet/socket_helper.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#pragma comment(lib, "ws2_32")
|
@ -20,9 +20,9 @@
|
||||
*/
|
||||
|
||||
#include "tkc/mem.h"
|
||||
#include "streams/istream_mem.h"
|
||||
#include "streams/ostream_mem.h"
|
||||
#include "streams/iostream_mem.h"
|
||||
#include "streams/mem/istream_mem.h"
|
||||
#include "streams/mem/ostream_mem.h"
|
||||
#include "streams/mem/iostream_mem.h"
|
||||
|
||||
static ret_t tk_iostream_mem_on_destroy(object_t* obj) {
|
||||
tk_iostream_mem_t* iostream_mem = TK_IOSTREAM_MEM(obj);
|
@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "tkc/mem.h"
|
||||
#include "streams/istream_mem.h"
|
||||
#include "streams/mem/istream_mem.h"
|
||||
|
||||
static int32_t tk_istream_mem_read(tk_istream_t* stream, uint8_t* buff, uint32_t max_size) {
|
||||
int32_t size = max_size;
|
@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "tkc/mem.h"
|
||||
#include "streams/ostream_mem.h"
|
||||
#include "streams/mem/ostream_mem.h"
|
||||
|
||||
static int32_t tk_ostream_mem_write(tk_ostream_t* stream, const uint8_t* buff, uint32_t max_size) {
|
||||
int32_t size = max_size;
|
@ -20,9 +20,9 @@
|
||||
*/
|
||||
|
||||
#include "tkc/mem.h"
|
||||
#include "streams/istream_serial.h"
|
||||
#include "streams/ostream_serial.h"
|
||||
#include "streams/iostream_serial.h"
|
||||
#include "streams/serial/istream_serial.h"
|
||||
#include "streams/serial/ostream_serial.h"
|
||||
#include "streams/serial/iostream_serial.h"
|
||||
|
||||
static ret_t tk_iostream_serial_get_prop(object_t* obj, const char* name, value_t* v) {
|
||||
tk_iostream_serial_t* iostream_serial = TK_IOSTREAM_SERIAL(obj);
|
@ -24,7 +24,7 @@
|
||||
|
||||
#include "tkc/fs.h"
|
||||
#include "tkc/iostream.h"
|
||||
#include "streams/serial_helper.h"
|
||||
#include "streams/serial/serial_helper.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
@ -20,8 +20,8 @@
|
||||
*/
|
||||
|
||||
#include "tkc/mem.h"
|
||||
#include "streams/serial_helper.h"
|
||||
#include "streams/istream_serial.h"
|
||||
#include "streams/serial/serial_helper.h"
|
||||
#include "streams/serial/istream_serial.h"
|
||||
|
||||
static int32_t tk_istream_serial_read(tk_istream_t* stream, uint8_t* buff, uint32_t max_size) {
|
||||
tk_istream_serial_t* istream_serial = TK_ISTREAM_SERIAL(stream);
|
@ -24,7 +24,7 @@
|
||||
|
||||
#include "tkc/fs.h"
|
||||
#include "tkc/istream.h"
|
||||
#include "streams/serial_helper.h"
|
||||
#include "streams/serial/serial_helper.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
@ -20,8 +20,8 @@
|
||||
*/
|
||||
|
||||
#include "tkc/mem.h"
|
||||
#include "streams/serial_helper.h"
|
||||
#include "streams/ostream_serial.h"
|
||||
#include "streams/serial/serial_helper.h"
|
||||
#include "streams/serial/ostream_serial.h"
|
||||
|
||||
static int32_t tk_ostream_serial_write(tk_ostream_t* stream, const uint8_t* buff,
|
||||
uint32_t max_size) {
|
@ -24,7 +24,7 @@
|
||||
|
||||
#include "tkc/fs.h"
|
||||
#include "tkc/ostream.h"
|
||||
#include "streams/serial_helper.h"
|
||||
#include "streams/serial/serial_helper.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
@ -35,8 +35,8 @@
|
||||
#include "tkc/wstr.h"
|
||||
#include "tkc/thread.h"
|
||||
#include "tkc/socket_pair.h"
|
||||
#include "streams/socket_helper.h"
|
||||
#include "streams/serial_helper.h"
|
||||
#include "streams/inet/socket_helper.h"
|
||||
#include "streams/serial/serial_helper.h"
|
||||
|
||||
#ifdef WIN32
|
||||
#define prefix L"\\\\.\\"
|
@ -20,10 +20,10 @@
|
||||
*/
|
||||
|
||||
#include "tkc/mem.h"
|
||||
#include "streams/istream_shdlc.h"
|
||||
#include "streams/ostream_shdlc.h"
|
||||
#include "streams/iostream_shdlc.h"
|
||||
#include "streams/istream_buffered.h"
|
||||
#include "streams/shdlc/istream_shdlc.h"
|
||||
#include "streams/shdlc/ostream_shdlc.h"
|
||||
#include "streams/shdlc/iostream_shdlc.h"
|
||||
#include "streams/buffered/istream_buffered.h"
|
||||
|
||||
static ret_t tk_iostream_shdlc_on_destroy(object_t* obj) {
|
||||
tk_iostream_shdlc_t* iostream_shdlc = TK_IOSTREAM_SHDLC(obj);
|
@ -20,8 +20,8 @@
|
||||
*/
|
||||
|
||||
#include "tkc/mem.h"
|
||||
#include "streams/shdlc_helper.h"
|
||||
#include "streams/istream_shdlc.h"
|
||||
#include "streams/shdlc/shdlc_helper.h"
|
||||
#include "streams/shdlc/istream_shdlc.h"
|
||||
|
||||
static ret_t tk_istream_shdlc_send_ack(tk_istream_t* stream, bool_t ok, uint8_t seqno) {
|
||||
wbuffer_t wb;
|
@ -24,7 +24,7 @@
|
||||
|
||||
#include "tkc/buffer.h"
|
||||
#include "tkc/ring_buffer.h"
|
||||
#include "streams/iostream_shdlc.h"
|
||||
#include "streams/shdlc/iostream_shdlc.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
@ -20,8 +20,8 @@
|
||||
*/
|
||||
|
||||
#include "tkc/mem.h"
|
||||
#include "streams/shdlc_helper.h"
|
||||
#include "streams/ostream_shdlc.h"
|
||||
#include "streams/shdlc/shdlc_helper.h"
|
||||
#include "streams/shdlc/ostream_shdlc.h"
|
||||
|
||||
static int32_t tk_ostream_shdlc_write(tk_ostream_t* stream, const uint8_t* buff, uint32_t size) {
|
||||
ret_t ret = 0;
|
@ -23,7 +23,7 @@
|
||||
#define TK_OSTREAM_SHDLC_H
|
||||
|
||||
#include "tkc/buffer.h"
|
||||
#include "streams/iostream_shdlc.h"
|
||||
#include "streams/shdlc/iostream_shdlc.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "tkc/crc.h"
|
||||
#include "streams/shdlc_helper.h"
|
||||
#include "streams/shdlc/shdlc_helper.h"
|
||||
|
||||
static inline uint8_t shdlc_escape(uint8_t c) {
|
||||
return c ^ 0x20;
|
@ -1,7 +1,7 @@
|
||||
#include "tkc/utils.h"
|
||||
#include "tkc/platform.h"
|
||||
#include "streams/iostream_serial.h"
|
||||
#include "streams/serial_helper.h"
|
||||
#include "streams/serial/iostream_serial.h"
|
||||
#include "streams/serial/serial_helper.h"
|
||||
|
||||
void do_send(tk_iostream_t* iostream, const char* msg) {
|
||||
char buff[128];
|
||||
|
@ -3,9 +3,9 @@
|
||||
#endif /*WIN32_LEAN_AND_MEAN*/
|
||||
|
||||
#include "tkc/platform.h"
|
||||
#include "streams/iostream_serial.h"
|
||||
#include "streams/socket_helper.h"
|
||||
#include "streams/serial_helper.h"
|
||||
#include "streams/serial/iostream_serial.h"
|
||||
#include "streams/inet/socket_helper.h"
|
||||
#include "streams/serial/serial_helper.h"
|
||||
|
||||
void do_echo(tk_iostream_t* iostream) {
|
||||
char buff[128];
|
||||
|
@ -3,9 +3,9 @@
|
||||
#endif /*WIN32_LEAN_AND_MEAN*/
|
||||
|
||||
#include "tkc/platform.h"
|
||||
#include "streams/iostream_serial.h"
|
||||
#include "streams/socket_helper.h"
|
||||
#include "streams/serial_helper.h"
|
||||
#include "streams/serial/iostream_serial.h"
|
||||
#include "streams/inet/socket_helper.h"
|
||||
#include "streams/serial/serial_helper.h"
|
||||
|
||||
void do_send(tk_iostream_t* iostream, const char* msg) {
|
||||
char buff[128];
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#include "tkc/utils.h"
|
||||
#include "tkc/platform.h"
|
||||
#include "streams/iostream_udp.h"
|
||||
#include "streams/socket_helper.h"
|
||||
#include "streams/inet/iostream_udp.h"
|
||||
#include "streams/inet/socket_helper.h"
|
||||
|
||||
void do_recv(int port) {
|
||||
int32_t n = 10;
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
#include "tkc/utils.h"
|
||||
#include "tkc/platform.h"
|
||||
#include "streams/iostream_udp.h"
|
||||
#include "streams/socket_helper.h"
|
||||
#include "streams/inet/iostream_udp.h"
|
||||
#include "streams/inet/socket_helper.h"
|
||||
|
||||
void do_send(tk_iostream_t* iostream, const char* msg) {
|
||||
char buff[1024];
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
#include "tkc/thread.h"
|
||||
#include "tkc/socket_pair.h"
|
||||
#include "streams/iostream_shdlc.h"
|
||||
#include "streams/iostream_tcp.h"
|
||||
#include "streams/shdlc/iostream_shdlc.h"
|
||||
#include "streams/inet/iostream_tcp.h"
|
||||
|
||||
static uint8_t rbuff[7];
|
||||
static uint8_t sbuff[7] = {1, 2, 3, 4, 5, 6, 7};
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "gtest/gtest.h"
|
||||
#include "streams/istream_mem.h"
|
||||
#include "streams/istream_buffered.h"
|
||||
#include "streams/mem/istream_mem.h"
|
||||
#include "streams/buffered/istream_buffered.h"
|
||||
|
||||
TEST(IStreamBuffered, basic) {
|
||||
char c = 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "streams/istream_mem.h"
|
||||
#include "streams/mem/istream_mem.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
TEST(IStreamMem, basic) {
|
||||
|
@ -40,7 +40,7 @@
|
||||
#include "ext_widgets/ext_widgets.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "demos/assets.h"
|
||||
#include "streams/socket_helper.h"
|
||||
#include "streams/inet/socket_helper.h"
|
||||
|
||||
GTEST_API_ int main(int argc, char** argv) {
|
||||
printf("Running main() from gtest_main.cc\n");
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "gtest/gtest.h"
|
||||
#include "streams/ostream_mem.h"
|
||||
#include "streams/ostream_buffered.h"
|
||||
#include "streams/mem/ostream_mem.h"
|
||||
#include "streams/buffered/ostream_buffered.h"
|
||||
|
||||
TEST(OStreamBuffered, basic) {
|
||||
char buff[32];
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "streams/ostream_mem.h"
|
||||
#include "streams/mem/ostream_mem.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
TEST(OStreamMem, basic) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "gtest/gtest.h"
|
||||
#include "streams/shdlc_helper.h"
|
||||
#include "streams/istream_mem.h"
|
||||
#include "streams/shdlc/shdlc_helper.h"
|
||||
#include "streams/mem/istream_mem.h"
|
||||
|
||||
TEST(SHDLC, header) {
|
||||
shdlc_header_t header = {0};
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "streams/ostream_file.h"
|
||||
#include "streams/istream_file.h"
|
||||
#include "streams/file/ostream_file.h"
|
||||
#include "streams/file/istream_file.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
static void test_write(const char* filename) {
|
||||
|
Loading…
Reference in New Issue
Block a user