transactd 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. checksums.yaml +7 -0
  2. data/BUILD_UNIX-JA +174 -0
  3. data/BUILD_WIN-JA +256 -0
  4. data/CMakeLists.txt +96 -0
  5. data/COPYING +339 -0
  6. data/README +406 -0
  7. data/README-JA +424 -0
  8. data/bin/common/tdclc_32_1_0.dll +0 -0
  9. data/bin/common/tdclc_64_1_0.dll +0 -0
  10. data/build/common/check_for_link_iconv.cmake +73 -0
  11. data/build/common/copyifgreater.cmd +30 -0
  12. data/build/common/copyifgreater.js +290 -0
  13. data/build/common/get_boost_libs.cmake +106 -0
  14. data/build/common/get_ruby_path.cmake +115 -0
  15. data/build/common/options.cmake +127 -0
  16. data/build/common/smart_install.cmake +263 -0
  17. data/build/common/system.cmake +122 -0
  18. data/build/common/transactd.rc.in +52 -0
  19. data/build/common/transactd_cl_common.cmake +101 -0
  20. data/build/common/transactd_cl_output.cmake +93 -0
  21. data/build/common/transactd_common.cmake +237 -0
  22. data/build/common/transactd_required.cmake +28 -0
  23. data/build/swig/ruby/generate.cmake.in +35 -0
  24. data/build/swig/ruby/generate.cmd.in +19 -0
  25. data/build/swig/ruby/ruby.swg +101 -0
  26. data/build/swig/tdcl.i +188 -0
  27. data/build/tdclc/BUILDNUMBER.txt +1 -0
  28. data/build/tdclc/CMakeLists.txt +170 -0
  29. data/build/tdclc/tdclc_32.cbproj +181 -0
  30. data/build/tdclc/tdclc_64.cbproj +205 -0
  31. data/build/tdclcpp/BUILDNUMBER.txt +1 -0
  32. data/build/tdclcpp/CMakeLists.txt +142 -0
  33. data/build/tdclcpp/tdclcpp_bcb_32.cbproj +239 -0
  34. data/build/tdclcpp/tdclcpp_bcb_64.cbproj +304 -0
  35. data/build/tdclrb/BUILDNUMBER.txt +1 -0
  36. data/build/tdclrb/CMakeLists.txt +258 -0
  37. data/build/tdclrb/GEM_VERSION +3 -0
  38. data/build/tdclrb/bldgem/extconf.rb +123 -0
  39. data/build/tdclrb/gem/INSTALLLOG.win32 +9 -0
  40. data/build/tdclrb/gem/Makefile.win32-VS +65 -0
  41. data/build/tdclrb/gem/Makefile.win32-prebuilt +48 -0
  42. data/build/tdclrb/gem/detect.rb +31 -0
  43. data/build/tdclrb/gem/helper.rb +113 -0
  44. data/build/tdclrb/gem/transactd.rb +22 -0
  45. data/build/tdclrb/gem_output.cmake +44 -0
  46. data/source/bzs/db/IBlobBuffer.h +51 -0
  47. data/source/bzs/db/blobBuffer.h +177 -0
  48. data/source/bzs/db/blobStructs.h +85 -0
  49. data/source/bzs/db/engine/mysql/IReadRecords.h +52 -0
  50. data/source/bzs/db/engine/mysql/bookmark.h +195 -0
  51. data/source/bzs/db/engine/mysql/database.cpp +1882 -0
  52. data/source/bzs/db/engine/mysql/database.h +465 -0
  53. data/source/bzs/db/engine/mysql/dbManager.cpp +303 -0
  54. data/source/bzs/db/engine/mysql/dbManager.h +143 -0
  55. data/source/bzs/db/engine/mysql/errorMessage.cpp +75 -0
  56. data/source/bzs/db/engine/mysql/errorMessage.h +43 -0
  57. data/source/bzs/db/engine/mysql/fieldAccess.h +158 -0
  58. data/source/bzs/db/engine/mysql/mydebuglog.cpp +349 -0
  59. data/source/bzs/db/engine/mysql/mydebuglog.h +89 -0
  60. data/source/bzs/db/engine/mysql/mysqlInternal.h +171 -0
  61. data/source/bzs/db/engine/mysql/mysqlThd.cpp +169 -0
  62. data/source/bzs/db/engine/mysql/mysqlThd.h +35 -0
  63. data/source/bzs/db/engine/mysql/percentageKey.h +260 -0
  64. data/source/bzs/db/protocol/ICommandExecuter.h +49 -0
  65. data/source/bzs/db/protocol/hs/hsCommandExecuter.cpp +689 -0
  66. data/source/bzs/db/protocol/hs/hsCommandExecuter.h +228 -0
  67. data/source/bzs/db/protocol/tdap/btrDate.cpp +437 -0
  68. data/source/bzs/db/protocol/tdap/btrDate.h +227 -0
  69. data/source/bzs/db/protocol/tdap/client/bulkInsert.h +127 -0
  70. data/source/bzs/db/protocol/tdap/client/client.cpp +106 -0
  71. data/source/bzs/db/protocol/tdap/client/client.h +292 -0
  72. data/source/bzs/db/protocol/tdap/client/connMgr.cpp +144 -0
  73. data/source/bzs/db/protocol/tdap/client/connMgr.h +82 -0
  74. data/source/bzs/db/protocol/tdap/client/database.cpp +863 -0
  75. data/source/bzs/db/protocol/tdap/client/database.h +118 -0
  76. data/source/bzs/db/protocol/tdap/client/databaseFactory.cpp +100 -0
  77. data/source/bzs/db/protocol/tdap/client/dbDef.cpp +1640 -0
  78. data/source/bzs/db/protocol/tdap/client/dbDef.h +135 -0
  79. data/source/bzs/db/protocol/tdap/client/dllmain.cpp +434 -0
  80. data/source/bzs/db/protocol/tdap/client/errorMessage.cpp +92 -0
  81. data/source/bzs/db/protocol/tdap/client/errorMessage_ja.cpp +98 -0
  82. data/source/bzs/db/protocol/tdap/client/fieldDDF.cpp +174 -0
  83. data/source/bzs/db/protocol/tdap/client/fieldDDF.h +91 -0
  84. data/source/bzs/db/protocol/tdap/client/fileDDF.cpp +140 -0
  85. data/source/bzs/db/protocol/tdap/client/fileDDF.h +86 -0
  86. data/source/bzs/db/protocol/tdap/client/filter.cpp +527 -0
  87. data/source/bzs/db/protocol/tdap/client/filter.h +154 -0
  88. data/source/bzs/db/protocol/tdap/client/indexDDF.cpp +137 -0
  89. data/source/bzs/db/protocol/tdap/client/indexDDF.h +84 -0
  90. data/source/bzs/db/protocol/tdap/client/nsDatabase.cpp +724 -0
  91. data/source/bzs/db/protocol/tdap/client/nsDatabase.h +123 -0
  92. data/source/bzs/db/protocol/tdap/client/nsTable.cpp +899 -0
  93. data/source/bzs/db/protocol/tdap/client/nsTable.h +199 -0
  94. data/source/bzs/db/protocol/tdap/client/request.h +198 -0
  95. data/source/bzs/db/protocol/tdap/client/sharedData.cpp +58 -0
  96. data/source/bzs/db/protocol/tdap/client/sharedData.h +56 -0
  97. data/source/bzs/db/protocol/tdap/client/sqlBuilder.cpp +574 -0
  98. data/source/bzs/db/protocol/tdap/client/sqlBuilder.h +53 -0
  99. data/source/bzs/db/protocol/tdap/client/stringConverter.h +627 -0
  100. data/source/bzs/db/protocol/tdap/client/table.cpp +2613 -0
  101. data/source/bzs/db/protocol/tdap/client/table.h +221 -0
  102. data/source/bzs/db/protocol/tdap/client/trdboostapi.h +1096 -0
  103. data/source/bzs/db/protocol/tdap/client/trdboostapiInternal.h +179 -0
  104. data/source/bzs/db/protocol/tdap/client/trdclcppautolink.h +40 -0
  105. data/source/bzs/db/protocol/tdap/client/trnsctcl.def +11 -0
  106. data/source/bzs/db/protocol/tdap/myDateTime.cpp +500 -0
  107. data/source/bzs/db/protocol/tdap/mysql/characterset.cpp +184 -0
  108. data/source/bzs/db/protocol/tdap/mysql/characterset.h +60 -0
  109. data/source/bzs/db/protocol/tdap/mysql/databaseSchema.cpp +284 -0
  110. data/source/bzs/db/protocol/tdap/mysql/databaseSchema.h +53 -0
  111. data/source/bzs/db/protocol/tdap/mysql/debuglog.cpp +383 -0
  112. data/source/bzs/db/protocol/tdap/mysql/debuglog.h +106 -0
  113. data/source/bzs/db/protocol/tdap/mysql/recordsetReader.h +680 -0
  114. data/source/bzs/db/protocol/tdap/mysql/request.h +202 -0
  115. data/source/bzs/db/protocol/tdap/mysql/tdapCommandExecuter.cpp +1020 -0
  116. data/source/bzs/db/protocol/tdap/mysql/tdapCommandExecuter.h +141 -0
  117. data/source/bzs/db/protocol/tdap/tdapRequest.h +190 -0
  118. data/source/bzs/db/protocol/tdap/tdapSchema.cpp +295 -0
  119. data/source/bzs/db/protocol/tdap/tdapSchema.h +558 -0
  120. data/source/bzs/db/protocol/tdap/tdapcapi.h +423 -0
  121. data/source/bzs/db/transactd/appBuilderImple.h +55 -0
  122. data/source/bzs/db/transactd/appModule.cpp +183 -0
  123. data/source/bzs/db/transactd/appModule.h +80 -0
  124. data/source/bzs/db/transactd/connManager.cpp +201 -0
  125. data/source/bzs/db/transactd/connManager.h +60 -0
  126. data/source/bzs/db/transactd/connectionRecord.h +69 -0
  127. data/source/bzs/db/transactd/transactd.cpp +325 -0
  128. data/source/bzs/env/compiler.h +135 -0
  129. data/source/bzs/env/crosscompile.cpp +130 -0
  130. data/source/bzs/env/crosscompile.h +150 -0
  131. data/source/bzs/env/fileopen.h +36 -0
  132. data/source/bzs/env/mbcswchrLinux.cpp +40 -0
  133. data/source/bzs/env/mbcswchrLinux.h +88 -0
  134. data/source/bzs/env/tstring.h +183 -0
  135. data/source/bzs/example/changeSchema.cpp +117 -0
  136. data/source/bzs/example/changeSchema_c.cpp +78 -0
  137. data/source/bzs/example/connection_pool_c.cpp +171 -0
  138. data/source/bzs/example/createDatabase.cpp +305 -0
  139. data/source/bzs/example/createDatabase_c.cpp +202 -0
  140. data/source/bzs/example/deleteRecords.cpp +87 -0
  141. data/source/bzs/example/deleteRecords_c.cpp +57 -0
  142. data/source/bzs/example/dropDatabase.cpp +59 -0
  143. data/source/bzs/example/dropDatabase_c.cpp +34 -0
  144. data/source/bzs/example/insertRecords.cpp +212 -0
  145. data/source/bzs/example/insertRecords_c.cpp +153 -0
  146. data/source/bzs/example/readRecords.cpp +141 -0
  147. data/source/bzs/example/readRecords_c.cpp +107 -0
  148. data/source/bzs/example/updateRecords.cpp +99 -0
  149. data/source/bzs/example/updateRecords_c.cpp +71 -0
  150. data/source/bzs/example/update_with_transaction.cpp +104 -0
  151. data/source/bzs/example/update_with_transaction_c.cpp +80 -0
  152. data/source/bzs/netsvc/client/tcpClient.cpp +226 -0
  153. data/source/bzs/netsvc/client/tcpClient.h +489 -0
  154. data/source/bzs/netsvc/server/IAppModule.h +94 -0
  155. data/source/bzs/netsvc/server/iserver.h +65 -0
  156. data/source/bzs/netsvc/server/serverCpt.cpp +522 -0
  157. data/source/bzs/netsvc/server/serverCpt.h +88 -0
  158. data/source/bzs/netsvc/server/serverPipe.cpp +705 -0
  159. data/source/bzs/netsvc/server/serverPipe.h +96 -0
  160. data/source/bzs/netsvc/server/serverTpool.cpp +416 -0
  161. data/source/bzs/netsvc/server/serverTpool.h +84 -0
  162. data/source/bzs/rtl/benchmark.cpp +96 -0
  163. data/source/bzs/rtl/benchmark.h +65 -0
  164. data/source/bzs/rtl/datetime.cpp +375 -0
  165. data/source/bzs/rtl/datetime.h +53 -0
  166. data/source/bzs/rtl/debuglog.cpp +106 -0
  167. data/source/bzs/rtl/debuglog.h +97 -0
  168. data/source/bzs/rtl/exception.h +116 -0
  169. data/source/bzs/rtl/stl_uty.cpp +35 -0
  170. data/source/bzs/rtl/stl_uty.h +29 -0
  171. data/source/bzs/rtl/stringBuffers.cpp +101 -0
  172. data/source/bzs/rtl/stringBuffers.h +58 -0
  173. data/source/bzs/rtl/strtrim.cpp +135 -0
  174. data/source/bzs/rtl/strtrim.h +46 -0
  175. data/source/bzs/test/tdclatl/bench_tdclatl.js +445 -0
  176. data/source/bzs/test/tdclrb/bench_tdclcpp.rb +375 -0
  177. data/source/bzs/test/tdclrb/prepare.rb +226 -0
  178. data/source/bzs/test/tdclrb/transactd_datetime_spec.rb +172 -0
  179. data/source/bzs/test/tdclrb/transactd_kanjischema_spec.rb +208 -0
  180. data/source/bzs/test/tdclrb/transactd_spec.rb +1536 -0
  181. data/source/bzs/test/transactdBench/transactdBench.cpp +430 -0
  182. data/source/bzs/test/transactdBench/transactdBench2.cpp +342 -0
  183. data/source/bzs/test/trdclengn/test_trdclengn.cpp +2030 -0
  184. data/source/global/tdclatl/Database.cpp +503 -0
  185. data/source/global/tdclatl/Database.h +139 -0
  186. data/source/global/tdclatl/DbDef.cpp +242 -0
  187. data/source/global/tdclatl/DbDef.h +79 -0
  188. data/source/global/tdclatl/Field.cpp +92 -0
  189. data/source/global/tdclatl/Field.h +59 -0
  190. data/source/global/tdclatl/FieldDef.cpp +238 -0
  191. data/source/global/tdclatl/FieldDef.h +87 -0
  192. data/source/global/tdclatl/Flags.cpp +111 -0
  193. data/source/global/tdclatl/Flags.h +55 -0
  194. data/source/global/tdclatl/KeyDef.cpp +51 -0
  195. data/source/global/tdclatl/KeyDef.h +55 -0
  196. data/source/global/tdclatl/KeySegment.cpp +55 -0
  197. data/source/global/tdclatl/Table.cpp +600 -0
  198. data/source/global/tdclatl/Table.h +144 -0
  199. data/source/global/tdclatl/TableDef.cpp +291 -0
  200. data/source/global/tdclatl/TableDef.h +86 -0
  201. data/source/global/tdclatl/TdVersion.cpp +74 -0
  202. data/source/global/tdclatl/TdVersion.h +54 -0
  203. data/source/global/tdclatl/_IDatabaseEvents_CP.h +113 -0
  204. data/source/global/tdclatl/dllmain.cpp +30 -0
  205. data/source/global/tdclatl/dllmain.h +27 -0
  206. data/source/global/tdclatl/keySegment.h +57 -0
  207. data/source/global/tdclatl/resource.h +0 -0
  208. data/source/global/tdclatl/stdafx.cpp +2 -0
  209. data/source/global/tdclatl/stdafx.h +25 -0
  210. data/source/global/tdclatl/targetver.h +4 -0
  211. data/source/global/tdclatl/tdclatl.cpp +68 -0
  212. data/source/global/tdclatl/tdclatl.def +10 -0
  213. data/source/global/tdclatl/tdclatl.idl +1035 -0
  214. data/source/linux/charsetConvert.h +112 -0
  215. data/source/linux/linuxTypes.h +33 -0
  216. data/source/linux/tchar.h +428 -0
  217. data/transactd.gemspec +97 -0
  218. metadata +267 -0
@@ -0,0 +1,112 @@
1
+ #ifndef CHARSET_CONVERT_H
2
+ #define CHARSET_CONVERT_H
3
+
4
+ /*=================================================================
5
+ Copyright (C) 2013 BizStation Corp All rights reserved.
6
+
7
+ This program is free software; you can redistribute it and/or
8
+ modify it under the terms of the GNU General Public License
9
+ as published by the Free Software Foundation; either version 2
10
+ of the License, or (at your option) any later version.
11
+
12
+ This program is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ GNU General Public License for more details.
16
+
17
+ You should have received a copy of the GNU General Public License
18
+ along with this program; if not, write to the Free Software
19
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20
+ 02111-1307, USA.
21
+ =================================================================*/
22
+
23
+ #include <iconv.h>
24
+ #include <string.h>
25
+ #include <wchar.h>
26
+ #include <linuxTypes.h>
27
+
28
+ inline size_t strlen16(const char16_t* src)
29
+ {
30
+ const char16_t* p = src;
31
+ while(*p)
32
+ ++p;
33
+ return p - src;
34
+ }
35
+
36
+ #define ICONV_NO_INIT -1
37
+ #define ICONV_SUCCESS 0
38
+ #define ICONV_OPENRRROR 1
39
+ class cvt
40
+ {
41
+ iconv_t m_cd;
42
+ int m_stat;
43
+ bool m_isOpend;
44
+
45
+ public:
46
+ cvt():m_stat(ICONV_NO_INIT),m_isOpend(false)
47
+ {
48
+
49
+ }
50
+
51
+ cvt(const char* to, const char* from)
52
+ :m_stat(ICONV_NO_INIT),m_isOpend(false)
53
+ {
54
+ setCharset(to, from);
55
+ }
56
+
57
+ ~cvt()
58
+ {
59
+ if (m_isOpend)
60
+ iconv_close(m_cd);
61
+ }
62
+
63
+ int setCharset(const char* to, const char* from)
64
+ {
65
+ m_cd = iconv_open(to, from);
66
+ if (m_cd == (iconv_t)-1)
67
+ m_stat = ICONV_OPENRRROR;
68
+ else
69
+ m_stat = ICONV_SUCCESS;
70
+ m_isOpend = (m_stat == ICONV_SUCCESS);
71
+ return m_stat;
72
+ }
73
+
74
+ size_t conv(const char* src, size_t inszie, char* outbuf, size_t outbufsize)
75
+ {
76
+ if (inszie == -1)
77
+ inszie = strlen(src);
78
+ char* pout = outbuf;
79
+
80
+ size_t len = iconv(m_cd, (char**)&src, &inszie, &pout, &outbufsize);
81
+ if (outbufsize)
82
+ *pout = 0x00;
83
+ return pout - outbuf;
84
+ }
85
+
86
+ size_t conv(const char* src, size_t inszie, char16_t* outbuf, size_t outbufsize)
87
+ {
88
+ if (inszie == -1)
89
+ inszie = strlen(src);
90
+ char* pout = (char*)outbuf;
91
+ size_t len = iconv(m_cd, (char**)&src, &inszie, &pout, &outbufsize);
92
+
93
+ if (outbufsize)
94
+ *pout = 0x00;
95
+ return (char16_t*)pout - outbuf;
96
+ }
97
+
98
+ size_t conv(const char16_t* src, size_t inszie, char* outbuf, size_t outbufsize)
99
+ {
100
+ if (inszie == -1)
101
+ inszie = strlen16(src)*sizeof(char16_t);
102
+ char* pout = outbuf;
103
+ size_t len = iconv(m_cd, (char**)&src, &inszie, &pout, &outbufsize);
104
+ if (outbufsize)
105
+ *pout = 0x00;
106
+ return pout - outbuf;
107
+ }
108
+
109
+ };
110
+
111
+ #endif //CHARSET_CONVERT_H
112
+
@@ -0,0 +1,33 @@
1
+ #ifndef LINUX_TYPES_H
2
+ #define LINUX_TYPES_H
3
+ /*=================================================================
4
+ Copyright (C) 2013 BizStation Corp All rights reserved.
5
+
6
+ This program is free software; you can redistribute it and/or
7
+ modify it under the terms of the GNU General Public License
8
+ as published by the Free Software Foundation; either version 2
9
+ of the License, or (at your option) any later version.
10
+
11
+ This program is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU General Public License for more details.
15
+
16
+ You should have received a copy of the GNU General Public License
17
+ along with this program; if not, write to the Free Software
18
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19
+ 02111-1307, USA.
20
+ =================================================================*/
21
+
22
+
23
+
24
+ #ifndef WCHAR
25
+
26
+ typedef unsigned short char16_t;
27
+ typedef char16_t WCHAR;
28
+
29
+ #endif
30
+
31
+
32
+ #endif //LINUX_TYPES_H
33
+
@@ -0,0 +1,428 @@
1
+ /*
2
+ * tchar.h
3
+ *
4
+ * Unicode mapping layer for the standard C library. By including this
5
+ * file and using the 't' names for string functions
6
+ * (eg. _tprintf) you can make code which can be easily adapted to both
7
+ * Unicode and non-unicode environments. In a unicode enabled compile define
8
+ * _UNICODE before including tchar.h, otherwise the standard non-unicode
9
+ * library functions will be used.
10
+ *
11
+ * Note that you still need to include string.h or stdlib.h etc. to define
12
+ * the appropriate functions. Also note that there are several defines
13
+ * included for non-ANSI functions which are commonly available (but using
14
+ * the convention of prepending an underscore to non-ANSI library function
15
+ * names).
16
+ *
17
+ * This file is part of the Mingw32 package.
18
+ *
19
+ * Contributors:
20
+ * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
21
+ *
22
+ * THIS SOFTWARE IS NOT COPYRIGHTED
23
+ *
24
+ * This source code is offered for use in the public domain. You may
25
+ * use, modify or distribute it freely.
26
+ *
27
+ * This code is distributed in the hope that it will be useful but
28
+ * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
29
+ * DISCLAIMED. This includes but is not limited to warranties of
30
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
31
+ *
32
+ * $Revision: 1.10 $
33
+ * $Author: earnie $
34
+ * $Date: 2002/11/12 15:29:40 $
35
+ *
36
+ */
37
+
38
+ #ifndef _TCHAR_H_
39
+ #define _TCHAR_H_
40
+
41
+ #define _tcsclen _tcslen
42
+ #define _tcsnccpy _tcsncpy
43
+
44
+ /*
45
+ * NOTE: This tests _UNICODE, which is different from the UNICODE define
46
+ * used to differentiate Win32 API calls.
47
+ */
48
+
49
+ #ifdef _UNICODE
50
+ /*
51
+
52
+
53
+ // Use TCHAR instead of char or wchar_t. It will be appropriately translated
54
+ // if _UNICODE is correctly defined (or not).
55
+
56
+ #ifndef _TCHAR_DEFINED
57
+ #ifndef RC_INVOKED
58
+ typedef wchar_t TCHAR;
59
+ #ifndef _TCHAR
60
+ typedef wchar_t _TCHAR;
61
+ #endif
62
+ typedef wchar_t _TUCHAR;
63
+ #endif // Not RC_INVOKED
64
+ #define _TCHAR_DEFINED
65
+ #endif
66
+
67
+
68
+
69
+ // __TEXT is a private macro whose specific use is to force the expansion of a
70
+ // macro passed as an argument to the macros _T or _TEXT. DO NOT use this
71
+ // macro within your programs. It's name and function could change without
72
+ // notice.
73
+
74
+ #define __TEXT(q) L##q
75
+
76
+ // for porting from other Windows compilers
77
+ #if 0 // no wide startup module
78
+ #define _tmain wmain
79
+ #define _tWinMain wWinMain
80
+ #define _tenviron _wenviron
81
+ #define __targv __wargv
82
+ #endif
83
+
84
+
85
+ // Unicode functions
86
+
87
+ #define _tprintf wprintf
88
+ #define _ftprintf fwprintf
89
+ #define _stprintf swprintf
90
+ #define _sntprintf _snwprintf
91
+ #define _vtprintf vwprintf
92
+ #define _vftprintf vfwprintf
93
+ #define _vstprintf vswprintf
94
+ #define _vsntprintf _vsnwprintf
95
+ #define _tscanf wscanf
96
+ #define _ftscanf fwscanf
97
+ #define _stscanf swscanf
98
+ #define _fgettc fgetwc
99
+ #define _fgettchar _fgetwchar
100
+ #define _fgetts fgetws
101
+ #define _fputtc fputwc
102
+ #define _fputtchar _fputwchar
103
+ #define _fputts fputws
104
+ #define _gettc getwc
105
+ #define _getts _getws
106
+ #define _puttc putwc
107
+ #define _putts _putws
108
+ #define _ungettc ungetwc
109
+ #define _tcstod wcstod
110
+ #define _tcstol wcstol
111
+ #define _tcstoul wcstoul
112
+ #define _itot _itow
113
+ #define _ltot _ltow
114
+ #define _ultot _ultow
115
+ #define _ttoi _wtoi
116
+ #define _ttol _wtol
117
+ #define _tcscat wcscat
118
+ #define _tcscat_s wcscat_s
119
+ #define _tcschr wcschr
120
+ #define _tcscmp wcscmp
121
+ #define _tcscpy wcscpy
122
+ #define _tcscpy_s wcscpy_s
123
+ #define _tcscspn wcscspn
124
+ #define _tcslen wcslen
125
+ #define _tcsncat wcsncat
126
+ #define _tcsncmp wcsncmp
127
+ #define _tcsncpy wcsncpy
128
+ #define _tcsncpy_s wcsncpy_s
129
+ #define _tcspbrk wcspbrk
130
+ #define _tcsrchr wcsrchr
131
+ #define _tcsspn wcsspn
132
+ #define _tcsstr wcsstr
133
+ #define _tcstok wcstok
134
+ #define _tcsdup _wcsdup
135
+ #define _tcsicmp _wcsicmp
136
+ #define _tcsnicmp _wcsnicmp
137
+ #define _tcsnset _wcsnset
138
+ #define _tcsrev _wcsrev
139
+ #define _tcsset _wcsset
140
+ #define _tcslwr _wcslwr
141
+ #define _tcsupr _wcsupr
142
+ #define _tcsxfrm wcsxfrm
143
+ #define _tcscoll wcscoll
144
+ #define _tcsicoll _wcsicoll
145
+ #define _istalpha iswalpha
146
+ #define _istupper iswupper
147
+ #define _istlower iswlower
148
+ #define _istdigit iswdigit
149
+ #define _istxdigit iswxdigit
150
+ #define _istspace iswspace
151
+ #define _istpunct iswpunct
152
+ #define _istalnum iswalnum
153
+ #define _istprint iswprint
154
+ #define _istgraph iswgraph
155
+ #define _istcntrl iswcntrl
156
+ #define _istascii iswascii
157
+ #define _totupper towupper
158
+ #define _totlower towlower
159
+ #define _tcsftime wcsftime
160
+ // Macro functions
161
+ #define _tcsdec _wcsdec
162
+ #define _tcsinc _wcsinc
163
+ #define _tcsnbcnt _wcsncnt
164
+ #define _tcsnccnt _wcsncnt
165
+ #define _tcsnextc _wcsnextc
166
+ #define _tcsninc _wcsninc
167
+ #define _tcsspnp _wcsspnp
168
+ #define _wcsdec(_wcs1, _wcs2) ((_wcs1)>=(_wcs2) ? NULL : (_wcs2)-1)
169
+ #define _wcsinc(_wcs) ((_wcs)+1)
170
+ #define _wcsnextc(_wcs) ((unsigned int) *(_wcs))
171
+ #define _wcsninc(_wcs, _inc) (((_wcs)+(_inc)))
172
+ #define _wcsncnt(_wcs, _cnt) ((wcslen(_wcs)>_cnt) ? _count : wcslen(_wcs))
173
+ #define _wcsspnp(_wcs1, _wcs2) ((*((_wcs1)+wcsspn(_wcs1,_wcs2))) ? ((_wcs1)+wcsspn(_wcs1,_wcs2)) : NULL)
174
+
175
+ #if 1 // defined __MSVCRT__
176
+
177
+ // These wide functions not in crtdll.dll.
178
+ // Define macros anyway so that _wfoo rather than _tfoo is undefined
179
+
180
+ #define _ttoi64 _wtoi64
181
+ #define _i64tot _i64tow
182
+ #define _ui64tot _ui64tow
183
+ #define _tasctime _wasctime
184
+ #define _tctime _wctime
185
+ #define _tstrdate _wstrdate
186
+ #define _tstrtime _wstrtime
187
+ #define _tutime _wutime
188
+ #define _tcsnccoll _wcsncoll
189
+ #define _tcsncoll _wcsncoll
190
+ #define _tcsncicoll _wcsnicoll
191
+ #define _tcsnicoll _wcsnicoll
192
+ #define _taccess _waccess
193
+ #define _tchmod _wchmod
194
+ #define _tcreat _wcreat
195
+ #define _tfindfirst _wfindfirst
196
+ #define _tfindnext _wfindnext
197
+ #define _tfdopen _wfdopen
198
+ #define _tfopen _wfopen
199
+ #define _tgetenv _wgetenv
200
+ #define _tputenv _wputenv
201
+ #define _tsearchenv _wsearchenv
202
+ #define _tmakepath _wmakepath
203
+ #define _tsplitpath _wsplitpath
204
+ #define _tfullpath _wfullpath
205
+ #define _tmktemp _wmktemp
206
+ #define _topen _wopen
207
+ #define _tremove _wremove
208
+ #define _trename _wrename
209
+ #define _tsopen _wsopen
210
+ #define _tsetlocale _wsetlocale
211
+ #define _tunlink _wunlink
212
+ #define _tfinddata_t _wfinddata_t
213
+ #define _tfindfirsti64 _wfindfirsti64
214
+ #define _tfindnexti64 _wfindnexti64
215
+ #define _tfinddatai64_t _wfinddatai64_t
216
+ #define _tchdir _wchdir
217
+ #define _tgetcwd _wgetcwd
218
+ #define _tgetdcwd _wgetdcwd
219
+ #define _tmkdir _wmkdir
220
+ #define _trmdir _wrmdir
221
+ #define _tstat _wstat
222
+ #endif // __MSVCRT__
223
+
224
+ // dirent structures and functions
225
+ #define _tdirent _wdirent
226
+ #define _TDIR _WDIR
227
+ #define _topendir _wopendir
228
+ #define _tclosedir _wclosedir
229
+ #define _treaddir _wreaddir
230
+ #define _trewinddir _wrewinddir
231
+ #define _ttelldir _wtelldir
232
+ #define _tseekdir _wseekdir
233
+ #define _stprintf_s swprintf_s
234
+ */
235
+ #else // Not _UNICODE
236
+
237
+ /*
238
+ * TCHAR, the type you should use instead of char.
239
+ */
240
+ #ifndef _TCHAR_DEFINED
241
+ #ifndef RC_INVOKED
242
+ typedef char TCHAR;
243
+ #ifndef _TCHAR
244
+ typedef char _TCHAR;
245
+ #endif
246
+ typedef char _TUCHAR;
247
+
248
+ #endif
249
+ #define _TCHAR_DEFINED
250
+ #endif
251
+
252
+ /*
253
+ * __TEXT is a private macro whose specific use is to force the expansion of a
254
+ * macro passed as an argument to the macros _T or _TEXT. DO NOT use this
255
+ * macro within your programs. It's name and function could change without
256
+ * notice.
257
+ */
258
+ #define __TEXT(q) q
259
+
260
+ /* for porting from other Windows compilers */
261
+ #define _tmain main
262
+ #define _tWinMain WinMain
263
+ #define _tenviron _environ
264
+ #define __targv __argv
265
+
266
+ /*
267
+ * Non-unicode (standard) functions
268
+ */
269
+
270
+ #define _tprintf printf
271
+ #define _ftprintf fprintf
272
+ #define _stprintf sprintf
273
+ #define _sntprintf _snprintf
274
+ #define _vtprintf vprintf
275
+ #define _vftprintf vfprintf
276
+ #define _vstprintf vsprintf
277
+ #define _vsntprintf _vsnprintf
278
+ #define _tscanf scanf
279
+ #define _ftscanf fscanf
280
+ #define _stscanf sscanf
281
+ #define _fgettc fgetc
282
+ #define _fgettchar _fgetchar
283
+ #define _fgetts fgets
284
+ #define _fputtc fputc
285
+ #define _fputtchar _fputchar
286
+ #define _fputts fputs
287
+ #define _tfdopen _fdopen
288
+ #define _tfopen fopen
289
+ #define _tgetenv getenv
290
+ #define _tputenv _putenv
291
+ #define _tsearchenv _searchenv
292
+ #define _tmakepath _makepath
293
+ #define _tsplitpath _splitpath
294
+ #define _tfullpath _fullpath
295
+ #define _gettc getc
296
+ #define _getts gets
297
+ #define _puttc putc
298
+ #define _putts puts
299
+ #define _ungettc ungetc
300
+ #define _tcstod strtod
301
+ #define _tcstol strtol
302
+ #define _tcstoul strtoul
303
+ #define _itot _itoa
304
+ #define _ltot _ltoa
305
+ #define _ltot_s _ltoa_s
306
+ #define _ultot _ultoa
307
+ #define _ttoi atoi
308
+ #define _ttol atol
309
+ #define _ttof atof
310
+ #define _tcscat strcat
311
+ #define _tcscat_s strcat_s
312
+ #define _tcschr strchr
313
+ #define _tcscmp strcmp
314
+ #define _tcscpy strcpy
315
+ #define _tcscpy_s strcpy_s
316
+ #define _tcscspn strcspn
317
+ #define _tcslen strlen
318
+ #define _tcsncat strncat
319
+ #define _tcsncmp strncmp
320
+ #define _tcsncpy strncpy
321
+ #define _tcsncpy_s strncpy_s
322
+ #define _tcspbrk strpbrk
323
+ #define _tcsrchr strrchr
324
+ #define _tcsspn strspn
325
+ #define _tcsstr strstr
326
+ #define _tcstok strtok
327
+ #define _tcsdup _strdup
328
+ #define _tcsicmp _stricmp
329
+ #define _tcsnicmp _strnicmp
330
+ #define _tcsnset _strnset
331
+ #define _tcsrev _strrev
332
+ #define _tcsset _strset
333
+ #define _tcslwr _strlwr
334
+ #define _tcsupr _strupr
335
+ #define _tcsxfrm strxfrm
336
+ #define _tcscoll strcoll
337
+ #define _tcsicoll _stricoll
338
+ #define _istalpha isalpha
339
+ #define _istupper isupper
340
+ #define _istlower islower
341
+ #define _istdigit isdigit
342
+ #define _istxdigit isxdigit
343
+ #define _istspace isspace
344
+ #define _istpunct ispunct
345
+ #define _istalnum isalnum
346
+ #define _istprint isprint
347
+ #define _istgraph isgraph
348
+ #define _istcntrl iscntrl
349
+ #define _istascii isascii
350
+ #define _totupper toupper
351
+ #define _totlower tolower
352
+ #define _tasctime asctime
353
+ #define _tctime ctime
354
+ #define _tstrdate _strdate
355
+ #define _tstrtime _strtime
356
+ #define _tutime _utime
357
+ #define _tcsftime strftime
358
+ /* Macro functions */
359
+ #define _tcsdec _strdec
360
+ #define _tcsinc _strinc
361
+ #define _tcsnbcnt _strncnt
362
+ #define _tcsnccnt _strncnt
363
+ #define _tcsnextc _strnextc
364
+ #define _tcsninc _strninc
365
+ #define _tcsspnp _strspnp
366
+ #define _strdec(_str1, _str2) ((_str1)>=(_str2) ? NULL : (_str2)-1)
367
+ #define _strinc(_str) ((_str)+1)
368
+ #define _strnextc(_str) ((unsigned int) *(_str))
369
+ #define _strninc(_str, _inc) (((_str)+(_inc)))
370
+ #define _strncnt(_str, _cnt) ((strlen(_str)>_cnt) ? _count : strlen(_str))
371
+ #define _strspnp(_str1, _str2) ((*((_str1)+strspn(_str1,_str2))) ? ((_str1)+strspn(_str1,_str2)) : NULL)
372
+
373
+ #define _tchmod _chmod
374
+ #define _tcreat _creat
375
+ #define _tfindfirst _findfirst
376
+ #define _tfindnext _findnext
377
+ #define _tmktemp _mktemp
378
+ #define _topen _open
379
+ #define _taccess _access
380
+ #define _tremove remove
381
+ #define _trename rename
382
+ #define _tsopen _sopen
383
+ #define _tsetlocale setlocale
384
+ #define _tunlink _unlink
385
+ #define _tfinddata_t _finddata_t
386
+ #define _tchdir _chdir
387
+ #define _tgetcwd _getcwd
388
+ #define _tgetdcwd _getdcwd
389
+ #define _tmkdir _mkdir
390
+ #define _trmdir _rmdir
391
+ #define _tstat _stat
392
+
393
+ #if 1 /* defined __MSVCRT__ */
394
+ /* Not in crtdll.dll. Define macros anyway? */
395
+ #define _ttoi64 _atoi64
396
+ #define _i64tot _i64toa
397
+ #define _ui64tot _ui64toa
398
+ #define _tcsnccoll _strncoll
399
+ #define _tcsncoll _strncoll
400
+ #define _tcsncicoll _strnicoll
401
+ #define _tcsnicoll _strnicoll
402
+ #define _tfindfirsti64 _findfirsti64
403
+ #define _tfindnexti64 _findnexti64
404
+ #define _tfinddatai64_t _finddatai64_t
405
+ #endif /* __MSVCRT__ */
406
+
407
+ /* dirent structures and functions */
408
+ #define _tdirent dirent
409
+ #define _TDIR DIR
410
+ #define _topendir opendir
411
+ #define _tclosedir closedir
412
+ #define _treaddir readdir
413
+ #define _trewinddir rewinddir
414
+ #define _ttelldir telldir
415
+ #define _tseekdir seekdir
416
+ #define _stprintf_s snprintf
417
+ #endif /* Not _UNICODE */
418
+
419
+ /*
420
+ * UNICODE a constant string when _UNICODE is defined else returns the string
421
+ * unmodified. Also defined in w32api/winnt.h.
422
+ */
423
+ #define _TEXT(x) __TEXT(x)
424
+ #ifndef _T
425
+ #define _T(x) __TEXT(x)
426
+ #endif
427
+ #endif /* Not _TCHAR_H_ */
428
+
data/transactd.gemspec ADDED
@@ -0,0 +1,97 @@
1
+ # coding : utf-8
2
+ =begin =============================================================
3
+ Copyright (C) 2013 BizStation Corp All rights reserved.
4
+
5
+ This program is free software; you can redistribute it and/or
6
+ modify it under the terms of the GNU General Public License
7
+ as published by the Free Software Foundation; either version 2
8
+ of the License, or (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program; if not, write to the Free Software
17
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
18
+ 02111-1307, USA.
19
+ ===================================================================
20
+ =end
21
+ spec_build = Gem::Specification.new do |s|
22
+ s.name = 'transactd'
23
+ s.date = '2013-11-20'
24
+ s.summary = 'Transactd client'
25
+ s.description = 'Transactd client for ruby gem'
26
+ s.author = 'BizStation Corp.'
27
+ s.email = 'transactd@aie.ne.jp'
28
+ s.homepage = 'http://www.bizstation.jp/ja/transactd'
29
+ s.license = 'GPL v2'
30
+
31
+ verfile = 'build/tdclrb/GEM_VERSION'
32
+ unless File.exist?(verfile)
33
+ raise 'Can not found ' + verfile
34
+ end
35
+ vers = IO.readlines(verfile).map{ |i| i.strip.split(/\s+/) }
36
+ versions = {}
37
+ for i in vers
38
+ versions[i[0].to_sym] = Integer(i[1].sub(/^"(.*)"$/, '\1')) if i.length == 2
39
+ end
40
+ unless (versions.has_key?(:TDVER_RUBYGEM_VER_MAJOR) &&
41
+ versions.has_key?(:TDVER_RUBYGEM_VER_MINOR) &&
42
+ versions.has_key?(:TDVER_RUBYGEM_VER_RELEASE))
43
+ raise 'Can not read versions from ' + verfile +
44
+ "\n need: TDVER_RUBYGEM_VER_MAJOR,TDVER_RUBYGEM_VER_MINOR,TDVER_RUBYGEM_VER_RELEASE"
45
+ end
46
+ s.version = versions[:TDVER_RUBYGEM_VER_MAJOR].to_s + '.' +
47
+ versions[:TDVER_RUBYGEM_VER_MINOR].to_s + '.' +
48
+ versions[:TDVER_RUBYGEM_VER_RELEASE].to_s
49
+
50
+ binary_file = File.join('bin', RUBY_VERSION.match(/\d+\.\d+/)[0], 'transactd.so')
51
+ binarymode = File.exist?(binary_file)
52
+
53
+ if binarymode
54
+ #
55
+ # use prebuilt binary
56
+ #
57
+ s.platform = Gem::Platform.local
58
+ s.extensions = ['build/tdclrb/bldgem/extconf.rb']
59
+ s.files = Dir.glob('bin/**/*.so')
60
+ s.files += Dir.glob('bin/common/*.dll') + Dir.glob('bin/common/*.so')
61
+ s.files += Dir.glob('build/tdclrb/gem/**/*')
62
+ s.files += Dir.glob('build/common/copyifgreater.*')
63
+ s.files += Dir.glob('build/common/system.*')
64
+ s.files += Dir.glob('source/bzs/test/tdclrb/*')
65
+ s.files += Dir.glob('./*')
66
+ else
67
+ #
68
+ # without prebuilt binary
69
+ #
70
+ s.platform = Gem::Platform::RUBY
71
+ s.extensions = ['build/tdclrb/bldgem/extconf.rb']
72
+ s.files = ['CMakeLists.txt']
73
+ s.files += Dir.glob('bin/common/*.dll') + Dir.glob('bin/common/*.so')
74
+ s.files += Dir.glob('source/**/*') + Dir.glob('build/common/**/*')
75
+ s.files += Dir.glob('build/swig/**/*') + Dir.glob('build/tdclc/**/*')
76
+ s.files += Dir.glob('build/tdclcpp/**/*') + Dir.glob('build/tdclrb/**/*')
77
+ s.files += Dir.glob('./*')
78
+ end
79
+
80
+ msgs = []
81
+ if binarymode
82
+ msgs.push('You installed PRE-BUILT BINARY of Transactd client.')
83
+ else
84
+ msgs.push('You build Transactd client from source code.')
85
+ end
86
+ if (RUBY_PLATFORM =~ /mswin/)
87
+ msgs.push('*** Please check install log ***')
88
+ msgs.push('TRANSACTD_GEM_DIR/install.log')
89
+ else
90
+ msgs.push('Install log is here:')
91
+ msgs.push('TRANSACTD_GEM_DIR/../build/tdclrb/bldgem/install_manifest.txt')
92
+ end
93
+ msgs.push('(TRANSACTD_GEM_DIR: `gem which transactd` and remove "lib/transactd.rb")')
94
+ msgs.push('-' * 50)
95
+ msgs.unshift('-' * 50)
96
+ s.post_install_message = msgs.join("\n") if msgs.length > 0
97
+ end