]> Git repositories of Nishi - tewi.git/commitdiff
adding __cplusplus thing
authorNishi <nishi@nishi.boats>
Mon, 23 Sep 2024 11:31:18 +0000 (11:31 +0000)
committerNishi <nishi@nishi.boats>
Mon, 23 Sep 2024 11:31:18 +0000 (11:31 +0000)
git-svn-id: file:///raid/svn-personal/tewi/trunk@140 8739d7e6-ffea-ec47-b151-bdff447c6205

Server/server.c
Server/strptime.h
Server/tw_config.h
Server/tw_http.h
Server/tw_module.h
Server/tw_server.h
Server/tw_ssl.h
Server/tw_version.h

index 2337ed5a31872d2b8c69fe7027b3aa14923e2154..9dc3bc72b9979d9fde5926680e3cd08c06005083 100644 (file)
@@ -502,7 +502,7 @@ int32_t tw_server_pass(void* ptr) {
                                        cmtime = mktime(&tm);
                                        cmtime -= (btm->tm_hour * 60 + btm->tm_min) * 60;
 #else
-                                       cmtime = timegm(&tm);
+                                               cmtime = timegm(&tm);
 #endif
                                }
                        }
index 891e6f462d5481597c120b72081702b741204a0a..bc168bf9ffd49f7546053bbfb3194ec3a609df48 100644 (file)
@@ -1,10 +1,18 @@
 #ifndef STRPTIME_H
 #define STRPTIME_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <time.h>
 
 #ifdef _WIN32
 char* strptime(const char *buf, const char *fmt, struct tm *tm);
 #endif
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif // STRPTIME_H
index e405419dfadb19970c9dc2fcf43f0332f4f1b4ea..7d476203ec5f1cd40c7b7f62400be28f1f8e6569 100644 (file)
@@ -3,6 +3,10 @@
 #ifndef __TW_CONFIG_H__
 #define __TW_CONFIG_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "tw_http.h"
 
 #include <stdint.h>
@@ -91,4 +95,8 @@ int tw_config_read(const char* path);
 struct tw_config_entry* tw_vhost_match(const char* name, int port);
 bool tw_permission_allowed(const char* path, SOCKADDR addr, struct tw_http_request req, struct tw_config_entry* vhost);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 1a249b36dfba5db5df668a330f338c292f81495d..ce102e76463faafea033762b893a457b5a6c1433 100644 (file)
@@ -3,6 +3,10 @@
 #ifndef __TW_HTTP_H__
 #define __TW_HTTP_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <stdbool.h>
 
 #include "../config.h"
@@ -34,4 +38,8 @@ int tw_http_parse(void* ssl, int sock, struct tw_http_request* req);
 #endif
 #endif
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 17c81bb82ebeef327516841f1bcb47c5b8be95de..de82bf98118616e5b7fc1085216792b2ebb408e3 100644 (file)
@@ -3,6 +3,10 @@
 #ifndef __TW_MODULE_H__
 #define __TW_MODULE_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "tw_config.h"
 #include "tw_http.h"
 
@@ -33,9 +37,15 @@ typedef int (*tw_mod_init_t)(struct tw_config* config, struct tw_tool* tools);
 typedef int (*tw_mod_request_t)(struct tw_tool* tools, struct tw_http_request* req, struct tw_http_response* res);
 typedef int (*tw_mod_config_t)(struct tw_tool* tools, char** argv, int argc);
 
+#ifdef SOURCE
 void* tw_module_load(const char* path);
 void* tw_module_symbol(void* mod, const char* sym);
 void tw_init_tools(struct tw_tool* tools);
 int tw_module_init(void* mod);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
 
 #endif
index bf75fd293d47c55a97f876a3bd4083f975fdd5d7..0e87a0e49a0434dab49a484fd09b17acde172ac1 100644 (file)
@@ -3,6 +3,10 @@
 #ifndef __TW_SERVER_H__
 #define __TW_SERVER_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "../config.h"
 
 #include <stddef.h>
@@ -22,4 +26,8 @@ size_t tw_read(void* ssl, int s, void* data, size_t len);
 size_t tw_write(void* ssl, int s, void* data, size_t len);
 #endif
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 9176ef28acc791a67014f4b47eed4a60e6215b01..59ca476691cbb3d7f82e1de56e434fa9c9bd6599 100644 (file)
@@ -3,9 +3,17 @@
 #ifndef __TW_SSL_H__
 #define __TW_SSL_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <openssl/ssl.h>
 #include <stdint.h>
 
 SSL_CTX* tw_create_ssl_ctx(__UINTPTR_TYPE__ port);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 303ff044e076a6e2ce0e7ebc6b7350ae7f32e754..bc5a6e89b2dbb8b1300ad955e07c1b97c7626f42 100644 (file)
@@ -3,9 +3,17 @@
 #ifndef __TW_VERSION_H__
 #define __TW_VERSION_H__
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define TW_VERSION "1.05A\0"
 
 const char* tw_get_version(void);
 const char* tw_get_platform(void);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif