diff --git a/CCIEF-BASIC_Master/sample/include/SOCKET.h b/CCIEF-BASIC_Master/sample/include/SOCKET.h
index 6966ebb49983541653c96f10b1ddc253922b8514..e8676345a25acaec91161691a05a95bb92e29f49 100644 (file)
-/*\r
- * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/\r
- * Copyright (C) 2016 CC-Link Partner Association -http://am.cc-link.org/\r
- * \r
- * \r
- * Redistribution and use in source and binary forms, with or without \r
- * modification, are permitted provided that the following conditions \r
- * are met:\r
- *\r
- * Redistributions of source code must retain the above copyright \r
- * notice, this list of conditions and the following disclaimer.\r
- *\r
- * Redistributions in binary form must reproduce the above copyright\r
- * notice, this list of conditions and the following disclaimer in the \r
- * documentation and/or other materials provided with the \r
- * distribution.\r
- *\r
- * Neither the name of Texas Instruments Incorporated nor the names of\r
- * its contributors may be used to endorse or promote products derived\r
- * from this software without specific prior written permission.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \r
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT \r
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT \r
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, \r
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT \r
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \r
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE \r
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
- *\r
-*/\r
-\r
-#ifndef __SOCKET_H__\r
-#define __SOCKET_H__\r
-\r
-#include <stdint.h>\r
-#ifdef _WIN32\r
-#include <winsock2.h>\r
-#elif __linux__\r
-#include <sys/socket.h>\r
-#endif\r
-\r
-/*[ Definition for sample code ]*/\r
-#define SOCKET_ERR_OK 0\r
-#define SOCKET_ERR_SOCKET (-100)\r
-#define SOCKET_ERR_RECV (-103)\r
-#define SOCKET_ERR_SEND (-104)\r
-#define SOCKET_ERR_NO_RECEIVABLE (-200)\r
-\r
-/* Definition of function of sample code */\r
-#ifdef _WIN32\r
-extern int socket_initialize( SOCKET *sock, uint32_t ulIpAddress, uint16_t usPortNumber );\r
-extern void socket_terminate( SOCKET sock );\r
-extern int socket_recv( SOCKET sock, uint8_t *pucStream, int iLength, uint32_t *pulRecvAddr, uint16_t *pusRecvPortNumber );\r
-extern int socket_send( SOCKET sock, uint8_t *pucStream, int iLength, uint32_t ulSendAddr, uint16_t usSendPortNumber );\r
-#elif __linux__\r
-extern int socket_initialize( int *sock, uint32_t ulIpAddress, uint16_t usPortNumber );\r
-extern void socket_terminate( int sock );\r
-extern int socket_recv( int sock, uint8_t *pucStream, int iLength, uint32_t *pulRecvAddr, uint16_t *pusRecvPortNumber );\r
-extern int socket_send( int sock, uint8_t *pucStream, int iLength, uint32_t ulSendAddr, uint16_t usSendPortNumber );\r
-#endif\r
-\r
-#endif\r
-/*EOF*/\r
+/*
+ * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/
+ * Copyright (C) 2016 CC-Link Partner Association -http://am.cc-link.org/
+ *
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
+
+#ifndef __SOCKET_H__
+#define __SOCKET_H__
+
+#include <stdint.h>
+#ifdef _WIN32
+#include <winsock2.h>
+#elif __linux__
+#include <sys/socket.h>
+#endif
+
+/*[ Definition for sample code ]*/
+#define SOCKET_ERR_OK 0
+#define SOCKET_ERR_SOCKET (-100)
+#define SOCKET_ERR_RECV (-103)
+#define SOCKET_ERR_SEND (-104)
+#define SOCKET_ERR_NO_RECEIVABLE (-200)
+
+/* Definition of function of sample code */
+#ifdef _WIN32
+extern int socket_initialize( SOCKET *sock, uint32_t ulIpAddress, uint16_t usPortNumber );
+extern void socket_terminate( SOCKET sock );
+extern int socket_recv( SOCKET sock, uint8_t *pucStream, int iLength, uint32_t *pulRecvAddr, uint16_t *pusRecvPortNumber );
+extern int socket_send( SOCKET sock, uint8_t *pucStream, int iLength, uint32_t ulSendAddr, uint16_t usSendPortNumber );
+#elif __linux__
+extern int socket_initialize( int *sock, uint32_t ulIpAddress, uint16_t usPortNumber );
+extern void socket_terminate( int sock );
+extern int socket_recv( int sock, uint8_t *pucStream, int iLength, uint32_t *pulRecvAddr, uint16_t *pusRecvPortNumber );
+extern int socket_send( int sock, uint8_t *pucStream, int iLength, uint32_t ulSendAddr, uint16_t usSendPortNumber );
+#endif
+
+#endif
+/*EOF*/