mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
rename platform_socket.h to pika_socket.h
This commit is contained in:
parent
31bda65f87
commit
b590df0979
@ -20,7 +20,7 @@
|
||||
#include <stddef.h>
|
||||
#include "pika_adapter_rtt.h"
|
||||
/* depend on the socket module */
|
||||
#include "../socket/platform_socket.h"
|
||||
#include "../socket/pika_socket.h"
|
||||
|
||||
#define RT_USING_SAL 1
|
||||
|
||||
|
@ -1,16 +1,5 @@
|
||||
#include "_socket.h"
|
||||
#include "_socket_socket.h"
|
||||
#ifdef __linux__
|
||||
#include <arpa/inet.h>
|
||||
#include <unistd.h>
|
||||
#else
|
||||
/*
|
||||
You need to create the __platform_socket.h for your platform.
|
||||
For example:
|
||||
You can #include "lwip/socket.h" in the __platform_socket.h
|
||||
*/
|
||||
#include "__platform_socket.h"
|
||||
#endif
|
||||
#include "pika_socket.h"
|
||||
|
||||
#if !PIKASCRIPT_VERSION_REQUIRE_MINIMUN(1, 10, 4)
|
||||
#error "This library requires PikaScript version 1.10.4 or higher"
|
||||
|
28
package/socket/pika_socket.h
Normal file
28
package/socket/pika_socket.h
Normal file
@ -0,0 +1,28 @@
|
||||
#include "PikaObj.h"
|
||||
#ifdef __linux__
|
||||
#include <arpa/inet.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
#else
|
||||
/*
|
||||
You need to create the __platform_socket.h for your platform.
|
||||
For example:
|
||||
You can #include "lwip/socket.h" in the __platform_socket.h
|
||||
*/
|
||||
#include "__platform_socket.h"
|
||||
#endif
|
||||
int __platform_socket(int __domain, int __type, int __protocol);
|
||||
int __platform_bind(int __fd,
|
||||
const struct sockaddr* __addr,
|
||||
socklen_t __addr_len);
|
||||
|
||||
int __platform_listen(int __fd, int __n);
|
||||
int __platform_accept(int __fd, struct sockaddr* __addr, socklen_t* __addr_len);
|
||||
int __platform_connect(int __fd,
|
||||
const struct sockaddr* __addr,
|
||||
socklen_t __addr_len);
|
||||
int __platform_send(int __fd, const void* __buf, size_t __n, int __flags);
|
||||
int __platform_recv(int __fd, void* __buf, size_t __n, int __flags);
|
||||
int __platform_close(int __fd);
|
||||
int __platform_gethostname(char* __name, size_t __len);
|
@ -20,7 +20,7 @@
|
||||
#include <stddef.h>
|
||||
#include "pika_adapter_rtt.h"
|
||||
/* depend on the socket module */
|
||||
#include "../socket/platform_socket.h"
|
||||
#include "../socket/pika_socket.h"
|
||||
|
||||
#define RT_USING_SAL 1
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "_socket_socket.h"
|
||||
#include "platform_socket.h"
|
||||
#include "pika_socket.h"
|
||||
|
||||
#if !PIKASCRIPT_VERSION_REQUIRE_MINIMUN(1, 10, 4)
|
||||
#error "This library requires PikaScript version 1.10.4 or higher"
|
||||
|
@ -0,0 +1,28 @@
|
||||
#include "PikaObj.h"
|
||||
#ifdef __linux__
|
||||
#include <arpa/inet.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
#else
|
||||
/*
|
||||
You need to create the __platform_socket.h for your platform.
|
||||
For example:
|
||||
You can #include "lwip/socket.h" in the __platform_socket.h
|
||||
*/
|
||||
#include "__platform_socket.h"
|
||||
#endif
|
||||
int __platform_socket(int __domain, int __type, int __protocol);
|
||||
int __platform_bind(int __fd,
|
||||
const struct sockaddr* __addr,
|
||||
socklen_t __addr_len);
|
||||
|
||||
int __platform_listen(int __fd, int __n);
|
||||
int __platform_accept(int __fd, struct sockaddr* __addr, socklen_t* __addr_len);
|
||||
int __platform_connect(int __fd,
|
||||
const struct sockaddr* __addr,
|
||||
socklen_t __addr_len);
|
||||
int __platform_send(int __fd, const void* __buf, size_t __n, int __flags);
|
||||
int __platform_recv(int __fd, void* __buf, size_t __n, int __flags);
|
||||
int __platform_close(int __fd);
|
||||
int __platform_gethostname(char* __name, size_t __len);
|
Loading…
x
Reference in New Issue
Block a user