├── LICENSE ├── ReadMe.txt ├── btr0btr.cc ├── btr0btr.h ├── btr0btr.inl ├── btr0cur.cc ├── btr0cur.h ├── btr0cur.inl ├── btr0pcur.cc ├── btr0pcur.h ├── btr0pcur.inl ├── btr0sea.cc ├── btr0sea.h ├── btr0sea.inl ├── btr0types.h ├── buf0buf.cc ├── buf0buf.h ├── buf0buf.inl ├── buf0flu.cc ├── buf0flu.h ├── buf0flu.inl ├── buf0lru.cc ├── buf0lru.h ├── buf0lru.inl ├── buf0rea.cc ├── buf0rea.h ├── buf0types.h ├── cmake ├── CMakeLists.txt ├── core │ └── CMakeLists.txt ├── daemon │ └── CMakeLists.txt ├── revolver │ └── CMakeLists.txt ├── rudp │ └── CMakeLists.txt ├── rudprecv │ └── CMakeLists.txt ├── rudpsend │ └── CMakeLists.txt ├── sample │ └── CMakeLists.txt ├── silencer │ └── CMakeLists.txt └── test │ └── CMakeLists.txt ├── code_generator ├── code_generator.sln ├── code_generator │ ├── code_generator.vcxproj │ ├── code_generator.vcxproj.filters │ ├── main.cpp │ └── template │ │ ├── ##file_prefix#.cpp │ │ ├── ##file_prefix#_frame.cpp │ │ ├── ##file_prefix#_frame.h │ │ ├── ##file_prefix#_log.cpp │ │ ├── ##file_prefix#_log.h │ │ ├── ##file_prefix#_server.cpp │ │ ├── ##file_prefix#_server.h │ │ └── list.txt └── strtk │ └── strtk_combinations │ └── strtk_combinations.vcxproj ├── common ├── core │ ├── ReadMe.txt │ ├── core.vcproj │ ├── core.vcxproj │ ├── core.vcxproj.filters │ ├── core.vcxproj.user │ ├── core_bandwidth_throttler.cpp │ ├── core_bandwidth_throttler.h │ ├── core_cmd_target.cpp │ ├── core_cmd_target.h │ ├── core_connection.cpp │ ├── core_connection.h │ ├── core_connection_manager.h │ ├── core_connection_mananger.cpp │ ├── core_daemon_client.cpp │ ├── core_daemon_client.h │ ├── core_daemon_event.h │ ├── core_daemon_msg.h │ ├── core_dc_client.cpp │ ├── core_dc_client.h │ ├── core_event_message.h │ ├── core_frame.cpp │ ├── core_frame.h │ ├── core_local_info.h │ ├── core_log_macro.cpp │ ├── core_log_macro.h │ ├── core_main.cpp │ ├── core_main.h │ ├── core_message_map_decl.cpp │ ├── core_message_map_decl.h │ ├── core_message_processor.cpp │ ├── core_message_processor.h │ ├── core_messgae_template.h │ ├── core_msg_.h │ ├── core_packet.cpp │ ├── core_packet.h │ ├── core_reactor_thread.cpp │ ├── core_reactor_thread.h │ ├── core_reciver_interface.h │ ├── core_server_type.cpp │ ├── core_server_type.h │ ├── core_tcp_disconnect_notify.h │ ├── core_tcp_listener.cpp │ ├── core_tcp_listener.h │ ├── core_udp_handler.cpp │ ├── core_udp_handler.h │ ├── data_center_msg.h │ ├── dc_short_conn.cpp │ └── dc_short_conn.h ├── def │ ├── make.exe │ ├── make.ilk │ ├── sample_msg.def │ ├── sample_msg.h │ └── syntax_analysis.pdb ├── json │ ├── json_stream.h │ └── rapidjson │ │ ├── document.h │ │ ├── filestream.h │ │ ├── internal │ │ ├── pow10.h │ │ ├── stack.h │ │ └── strfunc.h │ │ ├── prettywriter.h │ │ ├── rapidjson.h │ │ ├── reader.h │ │ ├── stringbuffer.h │ │ └── writer.h ├── revolver │ ├── ReadMe.txt │ ├── aes.c │ ├── aes.h │ ├── base64.cpp │ ├── base64.h │ ├── base_bin_stream.h │ ├── base_bin_stream.inl │ ├── base_block_buffer.h │ ├── base_cache_buffer.h │ ├── base_epoll_reactor.cpp │ ├── base_epoll_reactor.h │ ├── base_event_handler.cpp │ ├── base_event_handler.h │ ├── base_file.cpp │ ├── base_file.h │ ├── base_guard.h │ ├── base_hex_string.cpp │ ├── base_hex_string.h │ ├── base_inet_addr.cpp │ ├── base_inet_addr.h │ ├── base_log.cpp │ ├── base_log.h │ ├── base_log_thread.cpp │ ├── base_log_thread.h │ ├── base_namespace.h │ ├── base_nodes_load.cpp │ ├── base_nodes_load.h │ ├── base_os.h │ ├── base_packet.h │ ├── base_queue.h │ ├── base_reactor.h │ ├── base_reactor_instance.h │ ├── base_select_reactor.cpp │ ├── base_select_reactor.h │ ├── base_singleton.h │ ├── base_sock_acceptor.cpp │ ├── base_sock_acceptor.h │ ├── base_sock_connector.cpp │ ├── base_sock_connector.h │ ├── base_sock_dgram.cpp │ ├── base_sock_dgram.h │ ├── base_sock_stream.cpp │ ├── base_sock_stream.h │ ├── base_socket.cpp │ ├── base_socket.h │ ├── base_thread.cpp │ ├── base_thread.h │ ├── base_thread_mutex.h │ ├── base_timer_value.cpp │ ├── base_timer_value.h │ ├── base_typedef.h │ ├── crc_crypt.c │ ├── crc_crypt.h │ ├── date_time.cpp │ ├── date_time.h │ ├── gettimeofday.cpp │ ├── gettimeofday.h │ ├── lzo_object.cpp │ ├── lzo_object.h │ ├── lzoconf.h │ ├── lzodefs.h │ ├── md5.h │ ├── md5c.c │ ├── minilzo.c │ ├── minilzo.h │ ├── object_pool.h │ ├── revolver.vcproj │ ├── revolver.vcxproj │ ├── revolver.vcxproj.filters │ ├── revolver.vcxproj.user │ ├── timer_node_t.h │ ├── timer_node_t.inl │ ├── timer_queue_t.h │ ├── timer_queue_t.inl │ ├── timer_ring.cpp │ └── timer_ring.h ├── revolver_v12.sln ├── rudp │ ├── ReadMe.txt │ ├── rudp.vcxproj │ ├── rudp.vcxproj.filters │ ├── rudp.vcxproj.user │ ├── rudp_acceptor.h │ ├── rudp_adapter.cpp │ ├── rudp_adapter.h │ ├── rudp_adapter_interface.h │ ├── rudp_ccc.cpp │ ├── rudp_ccc.h │ ├── rudp_channel_interface.h │ ├── rudp_event_handler.h │ ├── rudp_half_connection.h │ ├── rudp_interface.cpp │ ├── rudp_interface.h │ ├── rudp_log_macro.cpp │ ├── rudp_log_macro.h │ ├── rudp_packet.h │ ├── rudp_recv_buffer.cpp │ ├── rudp_recv_buffer.h │ ├── rudp_segment.cpp │ ├── rudp_segment.h │ ├── rudp_send_buffer.cpp │ ├── rudp_send_buffer.h │ ├── rudp_socket.cpp │ ├── rudp_socket.h │ ├── rudp_stream.cpp │ └── rudp_stream.h ├── silencer │ ├── ReadMe.txt │ ├── daemon_config.cpp │ ├── daemon_config.h │ ├── dc_tcp_listener.cpp │ ├── dc_tcp_listener.h │ ├── sil_connection_hash.h │ ├── silencer.vcxproj │ ├── silencer.vcxproj.filters │ └── silencer.vcxproj.user └── vsproj │ ├── core_v12.vcxproj │ ├── core_v12.vcxproj.filters │ ├── revolver_v12.vcxproj │ ├── revolver_v12.vcxproj.filters │ ├── rudp_v12.vcxproj │ ├── rudp_v12.vcxproj.filters │ ├── silencer_v12.vcxproj │ └── silencer_v12.vcxproj.filters ├── daemon ├── daemon.cpp ├── daemon.sln ├── daemon.sln.docstates.suo ├── daemon.suo ├── daemon.vcproj ├── daemon.vcxproj ├── daemon.vcxproj.filters ├── daemon.vcxproj.user ├── daemon_element.cpp ├── daemon_element.h ├── daemon_frame.cpp ├── daemon_frame.h ├── daemon_json.h ├── daemon_log.cpp ├── daemon_log.h ├── daemon_physical.h ├── daemon_server.cpp ├── daemon_server.h ├── daemon_simple_physical.cpp └── daemon_simple_physical.h ├── data0data.cc ├── data0data.h ├── data0data.inl ├── data0type.cc ├── data0type.h ├── data0type.inl ├── data0types.h ├── db0err.h ├── dict0boot.cc ├── dict0boot.h ├── dict0crea.cc ├── dict0crea.h ├── dict0dict.cc ├── dict0dict.h ├── dict0dict.inl ├── dict0load.cc ├── dict0load.h ├── dict0mem.cc ├── dict0mem.h ├── dict0types.h ├── dyn0dyn.cc ├── dyn0dyn.h ├── dyn0dyn.inl ├── eval0eval.h ├── eval0eval.inl ├── fil0fil.cc ├── fil0fil.h ├── fsp0fsp.cc ├── fsp0fsp.h ├── fsp0fsp.inl ├── fut0fut.h ├── fut0fut.inl ├── fut0lst.cc ├── fut0lst.h ├── fut0lst.inl ├── ha0ha.cc ├── ha0ha.h ├── ha0storage.cc ├── ha0storage.h ├── hash0hash.cc ├── hash0hash.h ├── ibuf0ibuf.cc ├── ibuf0ibuf.h ├── ibuf0ibuf.inl ├── ibuf0types.h ├── innodb.sln ├── innodb.vcxproj ├── innodb.vcxproj.filters ├── innodb.vcxproj.user ├── innodb_prj.udb ├── lexyy.c ├── license.txt ├── lock0lock.cc ├── lock0lock.h ├── lock0lock.inl ├── lock0types.h ├── log0log.cc ├── log0log.h ├── log0log.inl ├── log0recv.cc ├── log0recv.h ├── log0recv.inl ├── mach0data.cc ├── mach0data.h ├── mem0dbg.cc ├── mem0dbg.h ├── mem0mem.cc ├── mem0mem.h ├── mem0pool.cc ├── mem0pool.h ├── mtr0log.cc ├── mtr0log.h ├── mtr0log.inl ├── mtr0mtr.cc ├── mtr0mtr.h ├── mtr0mtr.inl ├── mtr0types.h ├── my_global.h ├── my_pthread.h ├── os0file.cc ├── os0file.h ├── os0sync.cc ├── os0sync.h ├── os0thread.cc ├── os0thread.h ├── page0cur.cc ├── page0cur.h ├── page0cur.inl ├── page0page.cc ├── page0page.h ├── page0page.inl ├── page0types.h ├── pars0grm.cc ├── pars0grm.h ├── pars0opt.cc ├── pars0opt.h ├── pars0pars.cc ├── pars0pars.h ├── pars0sym.cc ├── pars0sym.h ├── pars0types.h ├── protocol_analysis ├── sample_msg.def ├── syntax_analysis.sln ├── syntax_analysis.sln.docstates.suo ├── syntax_analysis.suo └── syntax_analysis │ ├── as_translator.cpp │ ├── as_translator.h │ ├── base_block_handler.cpp │ ├── base_block_handler.h │ ├── base_error.cpp │ ├── base_error.h │ ├── base_line_handler.cpp │ ├── base_line_handler.h │ ├── base_translator.cpp │ ├── base_translator.h │ ├── basedefine.cpp │ ├── basedefine.h │ ├── cpp_translator.cpp │ ├── cpp_translator.h │ ├── datatype_handler.cpp │ ├── datatype_handler.h │ ├── file_handler.cpp │ ├── file_handler.h │ ├── filetitle_handler.cpp │ ├── filetitle_handler.h │ ├── global.cpp │ ├── global.h │ ├── lua_translator.cpp │ ├── lua_translator.h │ ├── main.cpp │ ├── memdesc_handler.cpp │ ├── memdesc_handler.h │ ├── message_handler.cpp │ ├── message_handler.h │ ├── namespace_handler.cpp │ ├── namespace_handler.h │ ├── sample_msg.h │ ├── singleton.cpp │ ├── singleton.h │ ├── syntax_analysis.vcxproj │ ├── syntax_analysis.vcxproj.filters │ ├── syntax_analysis.vcxproj.user │ ├── typedef_handler.cpp │ ├── typedef_handler.h │ ├── var_handler.cpp │ └── var_handler.h ├── que0que.cc ├── que0que.h ├── que0que.inl ├── que0types.h ├── read0read.cc ├── read0read.h ├── read0read.inl ├── rem0cmp.cc ├── rem0cmp.h ├── rem0cmp.inl ├── rem0rec.cc ├── rem0rec.h ├── rem0rec.inl ├── rem0types.h ├── row0ins.cc ├── row0ins.h ├── row0mysql.cc ├── row0mysql.h ├── row0mysql.inl ├── row0purge.cc ├── row0purge.h ├── row0row.cc ├── row0row.h ├── row0row.inl ├── row0sel.cc ├── row0sel.h ├── row0sel.inl ├── row0types.h ├── row0uins.cc ├── row0uins.h ├── row0umod.cc ├── row0umod.h ├── row0undo.cc ├── row0undo.h ├── row0upd.cc ├── row0upd.h ├── row0upd.inl ├── row0vers.cc ├── row0vers.h ├── srv0que.cc ├── srv0que.h ├── srv0srv.cc ├── srv0srv.h ├── srv0start.cc ├── srv0start.h ├── sync0arr.cc ├── sync0arr.h ├── sync0rw.cc ├── sync0rw.h ├── sync0sync.cc ├── sync0sync.h ├── sync0types.h ├── test ├── rudp_reciver │ ├── rudp_reciver.sln │ └── rudp_reciver │ │ ├── reciver_adapter.cpp │ │ ├── reciver_adapter.h │ │ ├── reciver_thread.cpp │ │ ├── reciver_thread.h │ │ ├── rudp_connection.cpp │ │ ├── rudp_connection.h │ │ ├── rudp_listen_handler.cpp │ │ ├── rudp_listen_handler.h │ │ ├── rudp_reciver.cpp │ │ ├── rudp_reciver.vcxproj │ │ ├── rudp_reciver.vcxproj.filters │ │ ├── rudp_reciver.vcxproj.user │ │ ├── udp_handler.cpp │ │ └── udp_handler.h ├── rudp_sender │ ├── rudp_sender.sln │ └── rudp_sender │ │ ├── reciver_adapter.cpp │ │ ├── reciver_adapter.h │ │ ├── reciver_thread.cpp │ │ ├── reciver_thread.h │ │ ├── rudp_connection.cpp │ │ ├── rudp_connection.h │ │ ├── rudp_listen_handler.cpp │ │ ├── rudp_listen_handler.h │ │ ├── rudp_reciver.cpp │ │ ├── rudp_reciver.vcxproj │ │ ├── rudp_reciver.vcxproj.filters │ │ ├── rudp_reciver.vcxproj.user │ │ ├── stat_packet.h │ │ ├── udp_handler.cpp │ │ └── udp_handler.h ├── sample_server │ ├── sample_frame.cpp │ ├── sample_frame.h │ ├── sample_log_macro.cpp │ ├── sample_log_macro.h │ ├── sample_server.cpp │ ├── sample_server.h │ ├── sample_server.sln │ ├── sample_server.sln.docstates.suo │ ├── sample_server.suo │ ├── sample_server.vcxproj │ ├── sample_server.vcxproj.filters │ ├── sample_server.vcxproj.user │ └── server.cpp ├── test.sln ├── test.sln.docstates.suo ├── test.suo └── test │ ├── core_test.cpp │ ├── core_test.h │ ├── stat_packet.h │ ├── test.cpp │ ├── test.vcproj │ ├── test.vcxproj │ ├── test.vcxproj.filters │ ├── test.vcxproj.user │ ├── test_body.cpp │ ├── test_body.h │ ├── test_select.cpp │ ├── test_select.h │ ├── test_tcp_delay.cpp │ └── test_tcp_delay.h ├── thr0loc.cc ├── thr0loc.h ├── trx0purge.cc ├── trx0purge.h ├── trx0purge.inl ├── trx0rec.cc ├── trx0rec.h ├── trx0rec.inl ├── trx0roll.cc ├── trx0roll.h ├── trx0rseg.cc ├── trx0rseg.h ├── trx0rseg.inl ├── trx0sys.c ├── trx0sys.h ├── trx0sys.inl ├── trx0trx.cc ├── trx0trx.h ├── trx0trx.inl ├── trx0types.h ├── trx0undo.cc ├── trx0undo.h ├── trx0undo.inl ├── ul0crc32.cc ├── ul0crc32.h ├── univ.h ├── usr0sess.cc ├── usr0sess.h ├── usr0types.h ├── ut0bh.cc ├── ut0bh.h ├── ut0byte.cc ├── ut0byte.h ├── ut0dbg.cc ├── ut0dbg.h ├── ut0list.cc ├── ut0list.h ├── ut0lst.h ├── ut0mem.cc ├── ut0mem.h ├── ut0rbt.cc ├── ut0rbt.h ├── ut0rnd.cc ├── ut0rnd.h ├── ut0ut.cc ├── ut0ut.h ├── ut0vec.cc ├── ut0vec.h ├── ut0wqueque.h └── ut0wqueue.cc /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 zerok 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /ReadMe.txt: -------------------------------------------------------------------------------- 1 | +项目目录介绍: 2 | cmake linux 下cmake编译脚本,要首先安装cmake编译工具 3 | common revolver核心框架代码目录 4 | +revolver revolver基础封装代码目录 5 | +core revolver的框架代码目录 6 | +json 一个JSON的封装代码目录 7 | +rudp revolver的rudp实现代码目录 8 | +silencer revolver的服务器扩展代码目录 9 | daemon 精灵服务器代码目录 10 | protocol_analysis def协议翻译程序代码目录(由金山zhurw提供) 11 | test 测试代码目录(所有相关的模块测试例子、服务器框架例子等) 12 | 13 | 编译说明: 14 | 1.windows下 15 | 用VS 2010 打开common的工程,编译revolver的核心代码,让后可以在各个目录下打开相对应的工程进行编译,如果要使用到协议翻译器,请打开protocol_analysis目录下的工程进行编译,执行程序会生成在common/def目录下 16 | 2.linux下 17 | 先安装cmake编译器,在centos下用yum install cmake,在ubuntu下apt-get install cmake 18 | 切换到revolver/cmake目录,输入cmake . 19 | 完成后,make就可以生成各个执行文件,执行文件在revolver/cmake/bin下 20 | 21 | 需要了解关于revolver细节,请访问博客http://blog.csdn.net/column/details/zerok-revolver.html 22 | -------------------------------------------------------------------------------- /btr0btr.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/btr0btr.cc -------------------------------------------------------------------------------- /btr0btr.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/btr0btr.h -------------------------------------------------------------------------------- /btr0btr.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/btr0btr.inl -------------------------------------------------------------------------------- /btr0cur.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/btr0cur.cc -------------------------------------------------------------------------------- /btr0cur.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/btr0cur.h -------------------------------------------------------------------------------- /btr0cur.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/btr0cur.inl -------------------------------------------------------------------------------- /btr0pcur.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/btr0pcur.cc -------------------------------------------------------------------------------- /btr0pcur.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/btr0pcur.h -------------------------------------------------------------------------------- /btr0pcur.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/btr0pcur.inl -------------------------------------------------------------------------------- /btr0sea.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/btr0sea.cc -------------------------------------------------------------------------------- /btr0sea.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/btr0sea.h -------------------------------------------------------------------------------- /btr0sea.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/btr0sea.inl -------------------------------------------------------------------------------- /btr0types.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/btr0types.h -------------------------------------------------------------------------------- /buf0buf.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/buf0buf.cc -------------------------------------------------------------------------------- /buf0buf.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/buf0buf.h -------------------------------------------------------------------------------- /buf0buf.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/buf0buf.inl -------------------------------------------------------------------------------- /buf0flu.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/buf0flu.cc -------------------------------------------------------------------------------- /buf0flu.h: -------------------------------------------------------------------------------- 1 | #ifndef __buf0flu_h_ 2 | #define __buf0flu_h_ 3 | 4 | #include "unvi.h" 5 | #include "buf0types.h" 6 | #include "ut0byte.h" 7 | #include "mtr0types.h" 8 | 9 | #define BUF_FLUSH_FREE_BLOCK_MARGIN (5 + BUF_READ_AHEAD_AREA) 10 | #define BUF_FLUSH_EXTRA_MARGIN (BUF_FLUSH_FREE_BLOCK_MARGIN / 4 + 100) 11 | 12 | 13 | 14 | void buf_flush_write_complete(buf_block_t* block); 15 | 16 | void buf_flush_free_margin(); 17 | 18 | void buf_flush_init_for_writing(byte* page, dulint newest_lsn, ulint space, ulint page_no); 19 | 20 | ulint buf_flush_batch(ulint flush_type, ulint min_n, dulint lsn_limit); 21 | 22 | void buf_flush_wait_batch_end(ulint type); 23 | 24 | UNIV_INLINE void buf_flush_note_modification(buf_block_t* block, mtr_t* mtr); 25 | 26 | UNIV_INLINE void buf_flush_recv_note_modification(buf_block_t* block, dulint start_lsn, dulint end_lsn); 27 | 28 | ibool buf_flush_ready_for_replace(buf_block_t* block); 29 | 30 | ibool buf_flush_validate(); 31 | 32 | #include "buf0flu.h" 33 | 34 | #endif 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /buf0flu.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/buf0flu.inl -------------------------------------------------------------------------------- /buf0lru.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/buf0lru.cc -------------------------------------------------------------------------------- /buf0lru.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/buf0lru.h -------------------------------------------------------------------------------- /buf0lru.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/buf0lru.inl -------------------------------------------------------------------------------- /buf0rea.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/buf0rea.cc -------------------------------------------------------------------------------- /buf0rea.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/buf0rea.h -------------------------------------------------------------------------------- /buf0types.h: -------------------------------------------------------------------------------- 1 | #ifndef __buf0types_h_ 2 | #define __buf0types_h_ 3 | 4 | typedef byte buf_frame_t; 5 | 6 | #endif 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /cmake/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6) 2 | PROJECT(all) 3 | 4 | #### library paths 5 | SET(LIBRARY_PATH "${CMAKE_SOURCE_DIR}/lib") 6 | 7 | #### output paths 8 | SET(LIBRARY_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/lib") 9 | SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin") 10 | 11 | #### settings 12 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wno-deprecated") 13 | # SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") 14 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3") 15 | SET(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -L${LIBRARY_PATH} -lpthread") 16 | 17 | #### projects 18 | ADD_SUBDIRECTORY(revolver) 19 | ADD_SUBDIRECTORY(rudp) 20 | ADD_SUBDIRECTORY(core) 21 | ADD_SUBDIRECTORY(silencer) 22 | ADD_SUBDIRECTORY(daemon) 23 | ADD_SUBDIRECTORY(test) 24 | ADD_SUBDIRECTORY(rudprecv) 25 | ADD_SUBDIRECTORY(rudpsend) 26 | ADD_SUBDIRECTORY(sample) 27 | -------------------------------------------------------------------------------- /cmake/core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6) 2 | PROJECT(core) 3 | 4 | # definitions 5 | # 6 | 7 | # includes 8 | SET(includes 9 | "../../common" 10 | "../../common/zlib" 11 | "./" 12 | ) 13 | INCLUDE_DIRECTORIES(${includes}) 14 | 15 | # sources 16 | FILE(GLOB sources_cpp "../../common/core/*.cpp") 17 | 18 | # targets 19 | ADD_LIBRARY (core STATIC ${sources_cpp}) 20 | -------------------------------------------------------------------------------- /cmake/daemon/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6) 2 | PROJECT(daemon) 3 | 4 | # definitions 5 | # 6 | 7 | # includes 8 | SET(includes 9 | "../../common" 10 | "../common" 11 | ) 12 | INCLUDE_DIRECTORIES(${includes}) 13 | 14 | SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin/daemon") 15 | 16 | # sources 17 | FILE(GLOB sources_cpp "../../daemon/*.cpp") 18 | 19 | # targets 20 | ADD_EXECUTABLE(daemond ${sources_cpp}) 21 | TARGET_LINK_LIBRARIES(daemond silencer core revolver pthread) 22 | -------------------------------------------------------------------------------- /cmake/revolver/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6) 2 | PROJECT(revolver) 3 | 4 | # definitions 5 | # 6 | 7 | # includes 8 | SET(includes 9 | "./" 10 | "../../common/" 11 | ) 12 | INCLUDE_DIRECTORIES(${includes}) 13 | 14 | # sources 15 | FILE(GLOB sources_cpp "../../common/revolver/*.cpp") 16 | FILE(GLOB sources_c "../../common/revolver/*.c") 17 | 18 | # targets 19 | ADD_LIBRARY (revolver STATIC ${sources_cpp} ${sources_c}) 20 | -------------------------------------------------------------------------------- /cmake/rudp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6) 2 | PROJECT(rudp) 3 | 4 | # definitions 5 | # 6 | 7 | # includes 8 | SET(includes 9 | "../../common" 10 | "./" 11 | ) 12 | INCLUDE_DIRECTORIES(${includes}) 13 | 14 | # sources 15 | FILE(GLOB sources_cpp "../../common/rudp/*.cpp") 16 | 17 | # targets 18 | ADD_LIBRARY (rudp STATIC ${sources_cpp}) 19 | -------------------------------------------------------------------------------- /cmake/rudprecv/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6) 2 | PROJECT(rudprecv) 3 | 4 | # definitions 5 | # 6 | 7 | # includes 8 | SET(includes 9 | "../../common" 10 | ) 11 | INCLUDE_DIRECTORIES(${includes}) 12 | 13 | SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin/rudprecv") 14 | 15 | # sources 16 | FILE(GLOB sources_cpp "../../test/rudp_reciver/rudp_reciver/*.cpp") 17 | 18 | # targets 19 | ADD_EXECUTABLE(rudprecv ${sources_cpp}) 20 | TARGET_LINK_LIBRARIES(rudprecv silencer core rudp revolver pthread) 21 | -------------------------------------------------------------------------------- /cmake/rudpsend/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6) 2 | PROJECT(rudpsend) 3 | 4 | # definitions 5 | # 6 | 7 | # includes 8 | SET(includes 9 | "../../common" 10 | ) 11 | INCLUDE_DIRECTORIES(${includes}) 12 | 13 | SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin/rudpsend") 14 | 15 | # sources 16 | FILE(GLOB sources_cpp "../../test/rudp_sender/rudp_sender/*.cpp") 17 | 18 | # targets 19 | ADD_EXECUTABLE(rudpsend ${sources_cpp}) 20 | TARGET_LINK_LIBRARIES(rudpsend silencer core rudp revolver pthread) 21 | -------------------------------------------------------------------------------- /cmake/sample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6) 2 | PROJECT(sampled) 3 | 4 | # definitions 5 | # 6 | 7 | # includes 8 | SET(includes 9 | "../../common" 10 | ) 11 | INCLUDE_DIRECTORIES(${includes}) 12 | 13 | SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin/sample") 14 | 15 | # sources 16 | FILE(GLOB sources_cpp "../../test/sample_server/*.cpp") 17 | 18 | # targets 19 | ADD_EXECUTABLE(sampled ${sources_cpp}) 20 | TARGET_LINK_LIBRARIES(sampled silencer core revolver pthread) 21 | -------------------------------------------------------------------------------- /cmake/silencer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6) 2 | PROJECT(silencer) 3 | 4 | # definitions 5 | # 6 | 7 | # includes 8 | SET(includes 9 | "../../common" 10 | ) 11 | INCLUDE_DIRECTORIES(${includes}) 12 | 13 | # sources 14 | FILE(GLOB sources_cpp "../../common/silencer/*.cpp") 15 | 16 | # targets 17 | ADD_LIBRARY (silencer STATIC ${sources_cpp}) 18 | -------------------------------------------------------------------------------- /cmake/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6) 2 | PROJECT(test) 3 | 4 | # definitions 5 | # 6 | 7 | # includes 8 | SET(includes 9 | "../../common" 10 | ) 11 | INCLUDE_DIRECTORIES(${includes}) 12 | 13 | SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin/test") 14 | 15 | # sources 16 | FILE(GLOB sources_cpp "../../test/test/*.cpp") 17 | 18 | # targets 19 | ADD_EXECUTABLE(test ${sources_cpp}) 20 | TARGET_LINK_LIBRARIES(test silencer core revolver pthread) 21 | -------------------------------------------------------------------------------- /code_generator/code_generator.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "code_generator", "code_generator\code_generator.vcxproj", "{374C512A-E826-4ECD-8EAB-31AD2822B02F}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {374C512A-E826-4ECD-8EAB-31AD2822B02F}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {374C512A-E826-4ECD-8EAB-31AD2822B02F}.Debug|Win32.Build.0 = Debug|Win32 14 | {374C512A-E826-4ECD-8EAB-31AD2822B02F}.Release|Win32.ActiveCfg = Release|Win32 15 | {374C512A-E826-4ECD-8EAB-31AD2822B02F}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /code_generator/code_generator/code_generator.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /code_generator/code_generator/template/##file_prefix#.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/code_generator/code_generator/template/##file_prefix#.cpp -------------------------------------------------------------------------------- /code_generator/code_generator/template/##file_prefix#_frame.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/code_generator/code_generator/template/##file_prefix#_frame.cpp -------------------------------------------------------------------------------- /code_generator/code_generator/template/##file_prefix#_frame.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/code_generator/code_generator/template/##file_prefix#_frame.h -------------------------------------------------------------------------------- /code_generator/code_generator/template/##file_prefix#_log.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/code_generator/code_generator/template/##file_prefix#_log.cpp -------------------------------------------------------------------------------- /code_generator/code_generator/template/##file_prefix#_log.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/code_generator/code_generator/template/##file_prefix#_log.h -------------------------------------------------------------------------------- /code_generator/code_generator/template/##file_prefix#_server.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/code_generator/code_generator/template/##file_prefix#_server.cpp -------------------------------------------------------------------------------- /code_generator/code_generator/template/##file_prefix#_server.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/code_generator/code_generator/template/##file_prefix#_server.h -------------------------------------------------------------------------------- /code_generator/code_generator/template/list.txt: -------------------------------------------------------------------------------- 1 | ##file_prefix#_server.h 2 | ##file_prefix#_frame.h 3 | ##file_prefix#_server.cpp 4 | ##file_prefix#_frame.cpp 5 | ##file_prefix#_log.h 6 | ##file_prefix#_log.cpp 7 | ##file_prefix#.cpp -------------------------------------------------------------------------------- /common/core/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | STATIC LIBRARY : core Project Overview 3 | ======================================================================== 4 | 5 | AppWizard has created this core library project for you. 6 | 7 | No source files were created as part of your project. 8 | 9 | 10 | core.vcproj 11 | This is the main project file for VC++ projects generated using an Application Wizard. 12 | It contains information about the version of Visual C++ that generated the file, and 13 | information about the platforms, configurations, and project features selected with the 14 | Application Wizard. 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | Other notes: 18 | 19 | AppWizard uses "TODO:" comments to indicate parts of the source code you 20 | should add to or customize. 21 | 22 | ///////////////////////////////////////////////////////////////////////////// 23 | -------------------------------------------------------------------------------- /common/core/core.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /common/core/core_bandwidth_throttler.cpp: -------------------------------------------------------------------------------- 1 | #include "core_bandwidth_throttler.h" 2 | 3 | BASE_NAMESPACE_BEGIN_DECL 4 | 5 | CoreThrottler::CoreThrottler() 6 | { 7 | total_up_count_ = 0; 8 | total_down_count_ = 0; 9 | 10 | reset(); 11 | } 12 | 13 | CoreThrottler::~CoreThrottler() 14 | { 15 | 16 | } 17 | 18 | void CoreThrottler::reset() 19 | { 20 | up_bandwidth_ = 0; 21 | down_bandwidth_ = 0; 22 | 23 | up_packet_count_ = 0; 24 | down_packet_count_ = 0; 25 | 26 | up_udp_count_ = 0; 27 | down_udp_count_ = 0; 28 | 29 | up_tcp_count_ = 0; 30 | down_tcp_count_ = 0; 31 | } 32 | 33 | void CoreThrottler::add_udp_packet(uint32_t packet_size, bool up /* = false */) 34 | { 35 | if(up) 36 | { 37 | up_bandwidth_ += packet_size; 38 | up_packet_count_ ++; 39 | up_udp_count_ ++; 40 | 41 | total_up_count_ ++; 42 | } 43 | else 44 | { 45 | down_bandwidth_ += packet_size; 46 | down_packet_count_ ++; 47 | down_udp_count_ ++; 48 | 49 | total_down_count_ ++; 50 | } 51 | } 52 | 53 | void CoreThrottler::add_tcp_packet(uint32_t packet_size, bool up /* = false */) 54 | { 55 | if(up) 56 | { 57 | up_bandwidth_ += packet_size; 58 | up_packet_count_ ++; 59 | up_tcp_count_ ++; 60 | 61 | total_up_count_ ++; 62 | } 63 | else 64 | { 65 | down_bandwidth_ += packet_size; 66 | down_packet_count_ ++; 67 | down_tcp_count_ ++; 68 | 69 | total_down_count_ ++; 70 | } 71 | } 72 | 73 | BASE_NAMESPACE_END_DECL 74 | 75 | -------------------------------------------------------------------------------- /common/core/core_bandwidth_throttler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_bandwidth_throttler.h -------------------------------------------------------------------------------- /common/core/core_cmd_target.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_cmd_target.h -------------------------------------------------------------------------------- /common/core/core_connection.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_connection.cpp -------------------------------------------------------------------------------- /common/core/core_connection.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_connection.h -------------------------------------------------------------------------------- /common/core/core_connection_manager.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_connection_manager.h -------------------------------------------------------------------------------- /common/core/core_connection_mananger.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_connection_mananger.cpp -------------------------------------------------------------------------------- /common/core/core_daemon_client.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_daemon_client.cpp -------------------------------------------------------------------------------- /common/core/core_daemon_client.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_daemon_client.h -------------------------------------------------------------------------------- /common/core/core_daemon_event.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_daemon_event.h -------------------------------------------------------------------------------- /common/core/core_daemon_msg.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_daemon_msg.h -------------------------------------------------------------------------------- /common/core/core_dc_client.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_dc_client.cpp -------------------------------------------------------------------------------- /common/core/core_dc_client.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_dc_client.h -------------------------------------------------------------------------------- /common/core/core_event_message.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_event_message.h -------------------------------------------------------------------------------- /common/core/core_frame.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_frame.cpp -------------------------------------------------------------------------------- /common/core/core_frame.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_frame.h -------------------------------------------------------------------------------- /common/core/core_local_info.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_local_info.h -------------------------------------------------------------------------------- /common/core/core_log_macro.cpp: -------------------------------------------------------------------------------- 1 | #include "core/core_log_macro.h" 2 | 3 | #ifdef WIN32 4 | SingleLogStream core_log("core", BaseLogStreamInterface::debug); 5 | #else 6 | BaseLogStream core_log("core", BaseLogStreamInterface::debug); 7 | #endif 8 | 9 | -------------------------------------------------------------------------------- /common/core/core_log_macro.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_log_macro.h -------------------------------------------------------------------------------- /common/core/core_main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_main.cpp -------------------------------------------------------------------------------- /common/core/core_main.h: -------------------------------------------------------------------------------- 1 | #ifndef __CORE_MAIN_H 2 | #define __CORE_MAIN_H 3 | 4 | #include "revolver/base_typedef.h" 5 | 6 | void ignore_pipe(); 7 | int32_t core_main(); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /common/core/core_message_map_decl.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_message_map_decl.cpp -------------------------------------------------------------------------------- /common/core/core_message_map_decl.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_message_map_decl.h -------------------------------------------------------------------------------- /common/core/core_message_processor.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_message_processor.cpp -------------------------------------------------------------------------------- /common/core/core_message_processor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_message_processor.h -------------------------------------------------------------------------------- /common/core/core_messgae_template.h: -------------------------------------------------------------------------------- 1 | #ifndef CORE_MESSAGE_TEMPLATE_H 2 | #define CORE_MESSAGE_TEMPLATE_H 3 | 4 | #include "revolver/base_typedef.h" 5 | #include "revolver/base_inet_addr.h" 6 | 7 | BASE_NAMESPACE_BEGIN_DECL 8 | 9 | class BaseMsg 10 | { 11 | public: 12 | BaseMsg(){}; 13 | virtual ~BaseMsg(){}; 14 | 15 | public: 16 | uint32_t msg_type; 17 | }; 18 | 19 | template 20 | class TypedBaseMsg : public BaseMsg 21 | { 22 | public: 23 | TypedBaseMsg() { msg_type = MSGTYPE;} 24 | virtual ~TypedBaseMsg() {}; 25 | const T& data() const { return data_; } 26 | T& data() { return data_; } 27 | private: 28 | T data_; 29 | }; 30 | 31 | BASE_NAMESPACE_END_DECL 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /common/core/core_msg_.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_msg_.h -------------------------------------------------------------------------------- /common/core/core_packet.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_packet.cpp -------------------------------------------------------------------------------- /common/core/core_packet.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_packet.h -------------------------------------------------------------------------------- /common/core/core_reactor_thread.cpp: -------------------------------------------------------------------------------- 1 | #include "revolver/base_reactor_instance.h" 2 | #include "core/core_reactor_thread.h" 3 | BASE_NAMESPACE_BEGIN_DECL 4 | 5 | CCoreThread::CCoreThread() 6 | { 7 | 8 | } 9 | 10 | CCoreThread::~CCoreThread() 11 | { 12 | 13 | } 14 | 15 | void CCoreThread::execute() 16 | { 17 | while(!get_terminated()) 18 | { 19 | REACTOR_INSTANCE()->event_loop(); 20 | } 21 | 22 | REACTOR_INSTANCE()->stop_event_loop(); 23 | 24 | clear_thread(); 25 | } 26 | 27 | BASE_NAMESPACE_END_DECL 28 | -------------------------------------------------------------------------------- /common/core/core_reactor_thread.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_reactor_thread.h -------------------------------------------------------------------------------- /common/core/core_reciver_interface.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_reciver_interface.h -------------------------------------------------------------------------------- /common/core/core_server_type.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_server_type.cpp -------------------------------------------------------------------------------- /common/core/core_server_type.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_server_type.h -------------------------------------------------------------------------------- /common/core/core_tcp_disconnect_notify.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_tcp_disconnect_notify.h -------------------------------------------------------------------------------- /common/core/core_tcp_listener.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_tcp_listener.cpp -------------------------------------------------------------------------------- /common/core/core_tcp_listener.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_tcp_listener.h -------------------------------------------------------------------------------- /common/core/core_udp_handler.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_udp_handler.cpp -------------------------------------------------------------------------------- /common/core/core_udp_handler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_udp_handler.h -------------------------------------------------------------------------------- /common/core/dc_short_conn.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/dc_short_conn.cpp -------------------------------------------------------------------------------- /common/core/dc_short_conn.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/dc_short_conn.h -------------------------------------------------------------------------------- /common/def/make.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/def/make.exe -------------------------------------------------------------------------------- /common/def/make.ilk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/def/make.ilk -------------------------------------------------------------------------------- /common/def/sample_msg.def: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/def/sample_msg.def -------------------------------------------------------------------------------- /common/def/syntax_analysis.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/def/syntax_analysis.pdb -------------------------------------------------------------------------------- /common/json/json_stream.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/json/json_stream.h -------------------------------------------------------------------------------- /common/json/rapidjson/filestream.h: -------------------------------------------------------------------------------- 1 | #ifndef RAPIDJSON_FILESTREAM_H_ 2 | #define RAPIDJSON_FILESTREAM_H_ 3 | 4 | #include 5 | 6 | namespace rapidjson { 7 | 8 | //! Wrapper of C file stream for input or output. 9 | /*! 10 | This simple wrapper does not check the validity of the stream. 11 | \implements Stream 12 | */ 13 | class FileStream { 14 | public: 15 | typedef char Ch; //!< Character type. Only support char. 16 | 17 | FileStream(FILE* fp) : fp_(fp), count_(0) { Read(); } 18 | char Peek() const { return current_; } 19 | char Take() { char c = current_; Read(); return c; } 20 | size_t Tell() const { return count_; } 21 | void Put(char c) { fputc(c, fp_); } 22 | 23 | // Not implemented 24 | char* PutBegin() { return 0; } 25 | size_t PutEnd(char*) { return 0; } 26 | 27 | private: 28 | void Read() { 29 | RAPIDJSON_ASSERT(fp_ != 0); 30 | int c = fgetc(fp_); 31 | if (c != EOF) { 32 | current_ = (char)c; 33 | count_++; 34 | } 35 | else 36 | current_ = '\0'; 37 | } 38 | 39 | FILE* fp_; 40 | char current_; 41 | size_t count_; 42 | }; 43 | 44 | } // namespace rapidjson 45 | 46 | #endif // RAPIDJSON_FILESTREAM_H_ 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /common/json/rapidjson/internal/strfunc.h: -------------------------------------------------------------------------------- 1 | #ifndef RAPIDJSON_INTERNAL_STRFUNC_H_ 2 | #define RAPIDJSON_INTERNAL_STRFUNC_H_ 3 | 4 | namespace rapidjson { 5 | namespace internal { 6 | 7 | //! Custom strlen() which works on different character types. 8 | /*! \tparam Ch Character type (e.g. char, wchar_t, short) 9 | \param s Null-terminated input string. 10 | \return Number of characters in the string. 11 | \note This has the same semantics as strlen(), the return value is not number of Unicode codepoints. 12 | */ 13 | template 14 | inline SizeType StrLen(const Ch* s) { 15 | const Ch* p = s; 16 | while (*p != '\0') 17 | ++p; 18 | return SizeType(p - s); 19 | } 20 | 21 | } // namespace internal 22 | } // namespace rapidjson 23 | 24 | #endif // RAPIDJSON_INTERNAL_STRFUNC_H_ 25 | -------------------------------------------------------------------------------- /common/json/rapidjson/stringbuffer.h: -------------------------------------------------------------------------------- 1 | #ifndef RAPIDJSON_STRINGBUFFER_H_ 2 | #define RAPIDJSON_STRINGBUFFER_H_ 3 | 4 | #include "rapidjson.h" 5 | #include "internal/stack.h" 6 | 7 | namespace rapidjson { 8 | 9 | //! Represents an in-memory output stream. 10 | /*! 11 | \tparam Encoding Encoding of the stream. 12 | \tparam Allocator type for allocating memory buffer. 13 | \implements Stream 14 | */ 15 | template 16 | struct GenericStringBuffer { 17 | typedef typename Encoding::Ch Ch; 18 | 19 | GenericStringBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {} 20 | 21 | void Put(Ch c) { *stack_.template Push() = c; } 22 | 23 | void Clear() { stack_.Clear(); } 24 | 25 | const char* GetString() const { 26 | // Push and pop a null terminator. This is safe. 27 | *stack_.template Push() = '\0'; 28 | stack_.template Pop(1); 29 | 30 | return stack_.template Bottom(); 31 | } 32 | 33 | size_t Size() const { return stack_.GetSize(); } 34 | 35 | static const size_t kDefaultCapacity = 256; 36 | mutable internal::Stack stack_; 37 | }; 38 | 39 | typedef GenericStringBuffer > StringBuffer; 40 | 41 | //! Implement specialized version of PutN() with memset() for better performance. 42 | template<> 43 | inline void PutN(GenericStringBuffer >& stream, char c, size_t n) { 44 | memset(stream.stack_.Push(n), c, n * sizeof(c)); 45 | } 46 | 47 | } // namespace rapidjson 48 | 49 | #endif // RAPIDJSON_STRINGBUFFER_H_ 50 | 51 | 52 | -------------------------------------------------------------------------------- /common/revolver/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | STATIC LIBRARY : revolver Project Overview 3 | ======================================================================== 4 | 5 | AppWizard has created this revolver library project for you. 6 | 7 | This file contains a summary of what you will find in each of the files that 8 | make up your revolver application. 9 | 10 | 11 | revolver.vcproj 12 | This is the main project file for VC++ projects generated using an Application Wizard. 13 | It contains information about the version of Visual C++ that generated the file, and 14 | information about the platforms, configurations, and project features selected with the 15 | Application Wizard. 16 | 17 | 18 | ///////////////////////////////////////////////////////////////////////////// 19 | 20 | StdAfx.h, StdAfx.cpp 21 | These files are used to build a precompiled header (PCH) file 22 | named revolver.pch and a precompiled types file named StdAfx.obj. 23 | 24 | ///////////////////////////////////////////////////////////////////////////// 25 | Other notes: 26 | 27 | AppWizard uses "TODO:" comments to indicate parts of the source code you 28 | should add to or customize. 29 | 30 | ///////////////////////////////////////////////////////////////////////////// 31 | -------------------------------------------------------------------------------- /common/revolver/aes.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/aes.h -------------------------------------------------------------------------------- /common/revolver/base64.h: -------------------------------------------------------------------------------- 1 | 2 | //********************************************************************* 3 | //* C_Base64 - a simple base64 encoder and decoder. 4 | //* 5 | //* Copyright (c) 1999, Bob Withers - bwit@pobox.com 6 | //* 7 | //* This code may be freely used for any purpose, either personal 8 | //* or commercial, provided the authors copyright notice remains 9 | //* intact. 10 | //********************************************************************* 11 | 12 | #ifndef TALK_BASE_BASE64_H__ 13 | #define TALK_BASE_BASE64_H__ 14 | 15 | #include 16 | #include "revolver/base_namespace.h" 17 | 18 | BASE_NAMESPACE_BEGIN_DECL 19 | 20 | class Base64 21 | { 22 | public: 23 | static std::string encode(const std::string & data); 24 | static std::string decode(const std::string & data); 25 | static std::string encodeFromArray(const char * data, size_t len); 26 | private: 27 | static const std::string Base64Table; 28 | static const std::string::size_type DecodeTable[]; 29 | }; 30 | 31 | BASE_NAMESPACE_END_DECL 32 | 33 | #endif // TALK_BASE_BASE64_H__ 34 | -------------------------------------------------------------------------------- /common/revolver/base_bin_stream.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_bin_stream.h -------------------------------------------------------------------------------- /common/revolver/base_bin_stream.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_bin_stream.inl -------------------------------------------------------------------------------- /common/revolver/base_block_buffer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_block_buffer.h -------------------------------------------------------------------------------- /common/revolver/base_cache_buffer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_cache_buffer.h -------------------------------------------------------------------------------- /common/revolver/base_epoll_reactor.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_epoll_reactor.cpp -------------------------------------------------------------------------------- /common/revolver/base_epoll_reactor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_epoll_reactor.h -------------------------------------------------------------------------------- /common/revolver/base_event_handler.cpp: -------------------------------------------------------------------------------- 1 | #include "base_reactor.h" 2 | #include "base_event_handler.h" 3 | 4 | BASE_NAMESPACE_BEGIN_DECL 5 | 6 | CEventHandler::CEventHandler() : reactor_index_(0) 7 | { 8 | reactor_ = NULL; 9 | } 10 | 11 | CEventHandler::~CEventHandler() 12 | { 13 | } 14 | 15 | BASE_HANDLER CEventHandler::get_handle() const 16 | { 17 | return INVALID_HANDLER; 18 | } 19 | 20 | void CEventHandler::set_handle(BASE_HANDLER handle) 21 | { 22 | 23 | } 24 | 25 | int32_t CEventHandler::handle_input(BASE_HANDLER handle) 26 | { 27 | return -1; 28 | } 29 | 30 | int32_t CEventHandler::handle_output(BASE_HANDLER handle) 31 | { 32 | return -1; 33 | } 34 | 35 | int32_t CEventHandler::handle_timeout(const void *act, uint32_t timer_id) 36 | { 37 | return -1; 38 | } 39 | 40 | int32_t CEventHandler::handle_exception(BASE_HANDLER handle) 41 | { 42 | return -1; 43 | } 44 | 45 | int32_t CEventHandler::handle_close(BASE_HANDLER handle, ReactorMask close_mask) 46 | { 47 | return -1; 48 | } 49 | 50 | CReactor* CEventHandler::reactor() const 51 | { 52 | return reactor_; 53 | } 54 | 55 | void CEventHandler::reactor(CReactor *r) 56 | { 57 | reactor_ = r; 58 | } 59 | 60 | void CEventHandler::add_timer_event(uint32_t id) 61 | { 62 | if(id > 0) 63 | { 64 | timer_events_.insert(id); 65 | } 66 | } 67 | 68 | void CEventHandler::del_timer_event(uint32_t id) 69 | { 70 | if(id > 0) 71 | { 72 | timer_events_.erase(id); 73 | } 74 | } 75 | 76 | void CEventHandler::clear_timer_events() 77 | { 78 | if(reactor_ == NULL) 79 | return ; 80 | 81 | BaseEventIDSet::iterator it = timer_events_.begin(); 82 | uint32_t id = 0; 83 | 84 | while(it != timer_events_.end()) 85 | { 86 | id = *it; 87 | it ++; 88 | 89 | const void* act = NULL; 90 | reactor_->cancel_timer(id, &act); 91 | if(act != NULL) 92 | { 93 | release_timer_act(act); 94 | } 95 | } 96 | 97 | timer_events_.clear(); 98 | reactor_ = NULL; 99 | } 100 | 101 | void CEventHandler::release_timer_act(const void* act) 102 | { 103 | 104 | } 105 | 106 | BASE_NAMESPACE_END_DECL 107 | -------------------------------------------------------------------------------- /common/revolver/base_event_handler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_event_handler.h -------------------------------------------------------------------------------- /common/revolver/base_file.h: -------------------------------------------------------------------------------- 1 | #ifndef __BASE_FILE_H 2 | #define __BASE_FILE_H 3 | 4 | #include 5 | #include "revolver/base_typedef.h" 6 | #include "revolver/base_namespace.h" 7 | #include "revolver/base_os.h" 8 | 9 | using namespace std; 10 | 11 | BASE_NAMESPACE_BEGIN_DECL 12 | 13 | enum BaseFileState 14 | { 15 | SS_CLOSED, 16 | SS_OPENING, 17 | SS_OPEN 18 | }; 19 | 20 | enum BaseFileResult 21 | { 22 | SR_ERROR, 23 | SR_SUCCESS, 24 | SR_BLOCK, 25 | SR_EOS 26 | }; 27 | 28 | enum BaseFileEvent 29 | { 30 | SE_OPEN = 1, 31 | SE_READ = 2, 32 | SE_WRITE = 4, 33 | SE_CLOSE = 8 34 | }; 35 | 36 | 37 | class BaseFile 38 | { 39 | public: 40 | BaseFile(); 41 | ~BaseFile(); 42 | 43 | bool open(const string& filename, const char* mode); 44 | void close(); 45 | 46 | bool disable_buffering(); 47 | 48 | 49 | uint8_t get_state() const; 50 | 51 | BaseFileResult read(void* buffer, size_t buffer_len, size_t& read_size, int32_t& error); 52 | BaseFileResult write(const void* data, size_t data_len, size_t& writte_size, int& error); 53 | 54 | void seek(size_t pos); 55 | void flush(); 56 | 57 | bool set_postion(size_t pos); 58 | bool get_postion(size_t& pos) const; 59 | 60 | protected: 61 | FILE* file_; 62 | }; 63 | BASE_NAMESPACE_END_DECL 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /common/revolver/base_guard.h: -------------------------------------------------------------------------------- 1 | #ifndef __BASE_GUARD_H 2 | #define __BASE_GUARD_H 3 | 4 | #include "revolver/base_namespace.h" 5 | 6 | BASE_NAMESPACE_BEGIN_DECL 7 | template 8 | class BaseGuard 9 | { 10 | public: 11 | BaseGuard(BASE_MUTEX &mutex) : mutex_(mutex) 12 | { 13 | mutex_.acquire(); 14 | locked_ = true; 15 | }; 16 | 17 | ~BaseGuard() 18 | { 19 | locked_ = false; 20 | mutex_.release(); 21 | }; 22 | 23 | bool locked() const 24 | { 25 | return locked_; 26 | }; 27 | 28 | private: 29 | BASE_MUTEX& mutex_; 30 | bool locked_; 31 | }; 32 | 33 | BASE_NAMESPACE_END_DECL 34 | 35 | #define BASE_GUARD_ACTION(MUTEX, OBJ, LOCK, ACTION, REACTION) \ 36 | BaseGuard OBJ(LOCK);\ 37 | if(OBJ.locked()){ ACTION; } \ 38 | else { REACTION; } 39 | 40 | #define BASE_GUARD_REACTION(MUTEX, OBJ, LOCK, REACTION) \ 41 | BASE_GUARD_ACTION(MUTEX, OBJ, LOCK, ;, REACTION) 42 | 43 | #define BASE_GUARD(MUTEX, OBJ, LOCK) \ 44 | BASE_GUARD_REACTION(MUTEX, OBJ, LOCK, return) 45 | 46 | #define BASE_GUARD_RETURN(MUTEX, OBJ, LOCK, REACTION)\ 47 | BASE_GUARD_REACTION(MUTEX, OBJ, LOCK, return REACTION) 48 | #endif 49 | -------------------------------------------------------------------------------- /common/revolver/base_hex_string.h: -------------------------------------------------------------------------------- 1 | #ifndef __BASE_HEX_STRING_H 2 | #define __BASE_HEX_STRING_H 3 | 4 | #include "revolver/base_typedef.h" 5 | #include "revolver/base_namespace.h" 6 | 7 | #include 8 | using namespace std; 9 | 10 | BASE_NAMESPACE_BEGIN_DECL 11 | 12 | string bin2asc(const uint8_t *in, int32_t in_size); 13 | 14 | void asc2bin(const string& in, uint8_t* out, int32_t out_size, int32_t &out_length); 15 | 16 | BASE_NAMESPACE_END_DECL 17 | #endif 18 | -------------------------------------------------------------------------------- /common/revolver/base_inet_addr.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_inet_addr.cpp -------------------------------------------------------------------------------- /common/revolver/base_inet_addr.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_inet_addr.h -------------------------------------------------------------------------------- /common/revolver/base_log.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_log.cpp -------------------------------------------------------------------------------- /common/revolver/base_log.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_log.h -------------------------------------------------------------------------------- /common/revolver/base_log_thread.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_log_thread.cpp -------------------------------------------------------------------------------- /common/revolver/base_log_thread.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_log_thread.h -------------------------------------------------------------------------------- /common/revolver/base_namespace.h: -------------------------------------------------------------------------------- 1 | #ifndef __BASE_NAMESPACE_H 2 | #define __BASE_NAMESPACE_H 3 | 4 | #define BASE_NAMESPACE_BEGIN_DECL namespace BASEOBJECT { 5 | #define BASE_NAMESPACE_END_DECL } 6 | 7 | #define BASE_NAMEPSACE_DECL BASEOBJECT 8 | 9 | #define BASE BASEOBJECT 10 | #endif 11 | -------------------------------------------------------------------------------- /common/revolver/base_nodes_load.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_nodes_load.cpp -------------------------------------------------------------------------------- /common/revolver/base_nodes_load.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_nodes_load.h -------------------------------------------------------------------------------- /common/revolver/base_os.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_os.h -------------------------------------------------------------------------------- /common/revolver/base_packet.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_packet.h -------------------------------------------------------------------------------- /common/revolver/base_queue.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_queue.h -------------------------------------------------------------------------------- /common/revolver/base_reactor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_reactor.h -------------------------------------------------------------------------------- /common/revolver/base_reactor_instance.h: -------------------------------------------------------------------------------- 1 | #ifndef __BASE_REACTOR_INSTANCE_H 2 | #define __BASE_REACTOR_INSTANCE_H 3 | 4 | #include "revolver/base_select_reactor.h" 5 | #include "revolver/base_epoll_reactor.h" 6 | 7 | #ifdef WIN32 8 | #define REACTOR_CREATE CSingleton::instance 9 | #define REACTOR_INSTANCE CSingleton::instance 10 | #define REACTOR_DESTROY CSingleton::destroy 11 | #else 12 | #define REACTOR_CREATE CSingleton::instance 13 | #define REACTOR_INSTANCE CSingleton::instance 14 | #define REACTOR_DESTROY CSingleton::destroy 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /common/revolver/base_select_reactor.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_select_reactor.cpp -------------------------------------------------------------------------------- /common/revolver/base_select_reactor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_select_reactor.h -------------------------------------------------------------------------------- /common/revolver/base_singleton.h: -------------------------------------------------------------------------------- 1 | #ifndef __BASE_SIGNLETON_H 2 | #define __BASE_SIGNLETON_H 3 | 4 | #include 5 | 6 | template 7 | class CSingleton 8 | { 9 | public: 10 | static T* instance() 11 | { 12 | if(obj_ == NULL) 13 | { 14 | obj_ = new T(); 15 | } 16 | 17 | return obj_; 18 | }; 19 | 20 | static void destroy() 21 | { 22 | if(obj_ != NULL) 23 | { 24 | delete obj_; 25 | obj_ = NULL; 26 | } 27 | }; 28 | 29 | protected: 30 | CSingleton() 31 | { 32 | }; 33 | 34 | virtual ~CSingleton() 35 | { 36 | }; 37 | 38 | protected: 39 | static T* obj_; 40 | 41 | private: 42 | CSingleton(const CSingleton&) 43 | { 44 | }; 45 | 46 | CSingleton& operator=(const CSingleton&) 47 | { 48 | }; 49 | }; 50 | 51 | 52 | template 53 | T* CSingleton::obj_ = NULL; 54 | 55 | #endif 56 | 57 | -------------------------------------------------------------------------------- /common/revolver/base_sock_acceptor.cpp: -------------------------------------------------------------------------------- 1 | #include "base_sock_acceptor.h" 2 | 3 | BASE_NAMESPACE_BEGIN_DECL 4 | CSockAcceptor::CSockAcceptor() 5 | { 6 | 7 | } 8 | 9 | CSockAcceptor::~CSockAcceptor() 10 | { 11 | sock_stream_.close(); 12 | } 13 | 14 | BASE_HANDLER CSockAcceptor::get_socket_handler() const 15 | { 16 | return sock_stream_.get_handler(); 17 | } 18 | 19 | int32_t CSockAcceptor::open(const BASEOBJECT::Inet_Addr &addr, bool nonblocking, int32_t listen_max) 20 | { 21 | if(sock_stream_.open(addr, nonblocking) == -1) 22 | return -1; 23 | 24 | int32_t ret = ::listen(sock_stream_.get_handler(), listen_max); 25 | if(ret != 0) 26 | { 27 | sock_stream_.close(); 28 | return -1; 29 | } 30 | 31 | return 0; 32 | } 33 | 34 | int32_t CSockAcceptor::close() 35 | { 36 | return sock_stream_.close(); 37 | } 38 | 39 | int32_t CSockAcceptor::accept(CSockStream& new_stream, Inet_Addr &remote_addr, bool nonblocking) 40 | { 41 | sockaddr_in addr; 42 | #ifdef WIN32 43 | int32_t addr_len = sizeof(addr); 44 | #else 45 | uint32_t addr_len = sizeof(addr); 46 | #endif 47 | 48 | BASE_HANDLER new_socket = ::accept(get_socket_handler(),(sockaddr *)&addr, &addr_len); 49 | if(new_socket == INVALID_HANDLER) 50 | { 51 | return -1; 52 | } 53 | 54 | if(nonblocking) 55 | { 56 | set_socket_nonblocking(new_socket); 57 | } 58 | 59 | new_stream.set_handler(new_socket); 60 | remote_addr = addr; 61 | 62 | return 0; 63 | } 64 | 65 | int32_t CSockAcceptor::get_local_addr(Inet_Addr& local_addr) const 66 | { 67 | return sock_stream_.get_local_addr(local_addr); 68 | } 69 | 70 | BASE_NAMESPACE_END_DECL 71 | -------------------------------------------------------------------------------- /common/revolver/base_sock_acceptor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_sock_acceptor.h -------------------------------------------------------------------------------- /common/revolver/base_sock_connector.cpp: -------------------------------------------------------------------------------- 1 | #include "base_sock_connector.h" 2 | 3 | BASE_NAMESPACE_BEGIN_DECL 4 | CSockConnector::CSockConnector() 5 | { 6 | 7 | } 8 | 9 | CSockConnector::~CSockConnector() 10 | { 11 | 12 | } 13 | 14 | int32_t CSockConnector::connect(CSockStream &sock_stream, const Inet_Addr &remote_addr) 15 | { 16 | if(remote_addr.is_null()) 17 | { 18 | return -1; 19 | } 20 | 21 | remote_addr_ = remote_addr; 22 | 23 | int32_t ret = ::connect(sock_stream.get_handler(), (struct sockaddr *)remote_addr_.get_addr(), sizeof(sockaddr_in)); 24 | if(ret != 0 && error_no() != XEINPROGRESS) 25 | { 26 | return -1; 27 | } 28 | 29 | return 0; 30 | } 31 | BASE_NAMESPACE_END_DECL 32 | -------------------------------------------------------------------------------- /common/revolver/base_sock_connector.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_sock_connector.h -------------------------------------------------------------------------------- /common/revolver/base_sock_dgram.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_sock_dgram.cpp -------------------------------------------------------------------------------- /common/revolver/base_sock_dgram.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_sock_dgram.h -------------------------------------------------------------------------------- /common/revolver/base_sock_stream.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_sock_stream.cpp -------------------------------------------------------------------------------- /common/revolver/base_sock_stream.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_sock_stream.h -------------------------------------------------------------------------------- /common/revolver/base_socket.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_socket.h -------------------------------------------------------------------------------- /common/revolver/base_thread.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_thread.h -------------------------------------------------------------------------------- /common/revolver/base_thread_mutex.h: -------------------------------------------------------------------------------- 1 | #ifndef __BASE_THREAD_MUTEX_H 2 | #define __BASE_THREAD_MUTEX_H 3 | 4 | #include "revolver/base_namespace.h" 5 | 6 | #if defined(WIN32) | defined(_WIN32) | defined(_WIN64) 7 | 8 | #if _WIN32_WINNT < 0x0502 9 | #define _WIN32_WINNT 0x0502 10 | #endif 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | BASE_NAMESPACE_BEGIN_DECL 17 | 18 | class BaseThreadMutex 19 | { 20 | public: 21 | BaseThreadMutex() 22 | { 23 | InitializeCriticalSection(§ion_); 24 | }; 25 | 26 | ~BaseThreadMutex() 27 | { 28 | DeleteCriticalSection(§ion_); 29 | }; 30 | 31 | void acquire() 32 | { 33 | EnterCriticalSection(§ion_); 34 | }; 35 | 36 | bool try_acquire() 37 | { 38 | return (TryEnterCriticalSection(§ion_) != FALSE) ? true : false; 39 | }; 40 | 41 | void release() 42 | { 43 | LeaveCriticalSection(§ion_); 44 | }; 45 | 46 | private: 47 | CRITICAL_SECTION section_; 48 | }; 49 | 50 | BASE_NAMESPACE_END_DECL; 51 | #else 52 | #include 53 | 54 | BASE_NAMESPACE_BEGIN_DECL 55 | class BaseThreadMutex 56 | { 57 | public: 58 | BaseThreadMutex() 59 | { 60 | pthread_mutexattr_t mutex_a; 61 | pthread_mutexattr_init(&mutex_a); 62 | pthread_mutexattr_settype(&mutex_a, PTHREAD_MUTEX_RECURSIVE); 63 | 64 | pthread_mutex_init(&mutex_, &mutex_a); 65 | pthread_mutexattr_destroy(&mutex_a); 66 | }; 67 | 68 | ~BaseThreadMutex() 69 | { 70 | pthread_mutex_destroy(&mutex_); 71 | }; 72 | 73 | void acquire() 74 | { 75 | pthread_mutex_lock(&mutex_); 76 | } 77 | 78 | bool try_acquire() 79 | { 80 | return pthread_mutex_trylock(&mutex_) == 0 ? true : false; 81 | } 82 | 83 | void release() 84 | { 85 | pthread_mutex_unlock(&mutex_); 86 | } 87 | 88 | private: 89 | pthread_mutex_t mutex_; 90 | }; 91 | BASE_NAMESPACE_END_DECL; 92 | #endif 93 | 94 | #endif 95 | -------------------------------------------------------------------------------- /common/revolver/base_timer_value.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_timer_value.h -------------------------------------------------------------------------------- /common/revolver/base_typedef.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_typedef.h -------------------------------------------------------------------------------- /common/revolver/crc_crypt.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/crc_crypt.c -------------------------------------------------------------------------------- /common/revolver/crc_crypt.h: -------------------------------------------------------------------------------- 1 | #ifndef __CRC_CRYPT_H 2 | #define __CRC_CRYPT_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include "revolver/aes.h" 9 | 10 | aes_context* create_crypt(unsigned char* _ekey, int _ebits); 11 | void destroy_crypt(aes_context* context); 12 | 13 | int encrypt(aes_context* handler, unsigned char* src, int src_size, unsigned char* dst); 14 | int decrypt(aes_context* handler, unsigned char* src, int src_size, unsigned char* dst); 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /common/revolver/date_time.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/date_time.cpp -------------------------------------------------------------------------------- /common/revolver/date_time.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/date_time.h -------------------------------------------------------------------------------- /common/revolver/gettimeofday.cpp: -------------------------------------------------------------------------------- 1 | #ifdef WIN32 2 | #include 3 | /* 4 | * Number of micro-seconds between the beginning of the Windows epoch 5 | * (Jan. 1, 1601) and the Unix epoch (Jan. 1, 1970). 6 | * 7 | * This assumes all Win32 compilers have 64-bit support. 8 | */ 9 | #if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) || defined(__WATCOMC__) 10 | #define DELTA_EPOCH_IN_USEC 11644473600000000Ui64 11 | #else 12 | #define DELTA_EPOCH_IN_USEC 11644473600000000ULL 13 | #endif 14 | 15 | typedef unsigned __int64 u_int64_t; 16 | 17 | static u_int64_t filetime_to_unix_epoch (const FILETIME *ft) 18 | { 19 | u_int64_t res = (u_int64_t) ft->dwHighDateTime << 32; 20 | 21 | res |= ft->dwLowDateTime; 22 | res /= 10; /* from 100 nano-sec periods to usec */ 23 | res -= DELTA_EPOCH_IN_USEC; /* from Win epoch to Unix epoch */ 24 | return (res); 25 | } 26 | 27 | int gettimeofday (struct timeval *tv, void *tz) 28 | { 29 | FILETIME ft; 30 | u_int64_t tim; 31 | 32 | if (!tv) { 33 | //errno = EINVAL; 34 | return (-1); 35 | } 36 | ::GetSystemTimeAsFileTime (&ft); 37 | tim = filetime_to_unix_epoch (&ft); 38 | tv->tv_sec = (long) (tim / 1000000L); 39 | tv->tv_usec = (long) (tim % 1000000L); 40 | return (0); 41 | } 42 | #endif 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /common/revolver/gettimeofday.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/gettimeofday.h -------------------------------------------------------------------------------- /common/revolver/lzo_object.cpp: -------------------------------------------------------------------------------- 1 | #include "minilzo.h" 2 | #include "lzo_object.h" 3 | 4 | #include 5 | 6 | using namespace std; 7 | 8 | BASE_NAMESPACE_BEGIN_DECL 9 | 10 | BaseLZObject::BaseLZObject() : wrkmem_(NULL), init_flag_(false) 11 | { 12 | init(); 13 | } 14 | 15 | BaseLZObject::~BaseLZObject() 16 | { 17 | destroy(); 18 | } 19 | 20 | void BaseLZObject::init() 21 | { 22 | if (lzo_init() != LZO_E_OK) 23 | { 24 | cout << "internal error - lzo_init() failed !!!" << endl; 25 | return ; 26 | } 27 | 28 | init_flag_ = true; 29 | 30 | if(wrkmem_ == NULL) 31 | { 32 | wrkmem_ = new uint8_t[LZO_VMEM_SISE]; 33 | } 34 | } 35 | 36 | void BaseLZObject::destroy() 37 | { 38 | if(wrkmem_ != NULL) 39 | { 40 | delete []wrkmem_; 41 | wrkmem_ = NULL; 42 | }; 43 | } 44 | 45 | int32_t BaseLZObject::compress(const uint8_t* src, uint32_t src_size, uint8_t *dst, uint32_t& dst_size) 46 | { 47 | if(wrkmem_ == NULL || !init_flag_) 48 | return -1; 49 | 50 | int32_t ret = -1; 51 | try{ 52 | lzo_uint out_size = dst_size; 53 | ret = lzo1x_1_compress(src, src_size, dst, &out_size, wrkmem_); 54 | if(out_size >= src_size) 55 | return -1; 56 | 57 | dst_size = out_size; 58 | } 59 | catch(...) 60 | { 61 | cout << "lzo1x_1_compress crach!!" << endl; 62 | return -1; 63 | } 64 | 65 | return ret; 66 | } 67 | 68 | int32_t BaseLZObject::uncompress(const uint8_t* src, uint32_t src_size, uint8_t *dst, uint32_t& dst_size) 69 | { 70 | if(!init_flag_) 71 | return -1; 72 | 73 | int32_t ret = -1; 74 | try{ 75 | lzo_uint out_size = dst_size; 76 | ret = lzo1x_decompress(src, src_size, dst, &out_size, NULL); 77 | if(ret == LZO_E_OK) 78 | dst_size = out_size; 79 | } 80 | catch(...) 81 | { 82 | cout << "lzo1x_decompress crach!!" << endl; 83 | return -1; 84 | } 85 | 86 | return ret; 87 | } 88 | 89 | BASE_NAMESPACE_END_DECL 90 | 91 | -------------------------------------------------------------------------------- /common/revolver/lzo_object.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/lzo_object.h -------------------------------------------------------------------------------- /common/revolver/md5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * md5.h Structures and prototypes for md5. 3 | * 4 | * Version: $Id: md5.h,v 1.3 2006/06/30 01:28:16 cvsroot Exp $ 5 | * License: LGPL, but largely derived from a public domain source. 6 | * 7 | */ 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | 13 | #ifndef _LRAD_MD5_H 14 | #define _LRAD_MD5_H 15 | 16 | 17 | void librad_md5_calc(unsigned char *output, unsigned char *input,unsigned int inputlen); 18 | 19 | /* 20 | * FreeRADIUS defines to ensure globally unique MD5 function names, 21 | * so that we don't pick up vendor-specific broken MD5 libraries. 22 | */ 23 | #define MD5_CTX librad_MD5_CTX 24 | #define MD5Init librad_MD5Init 25 | #define MD5Update librad_MD5Update 26 | #define MD5Final librad_MD5Final 27 | #define MD5Transform librad_MD5Transform 28 | #define MD5_BLOCK_LENGTH 64 29 | #define MD5_DIGEST_LENGTH 16 30 | 31 | typedef unsigned int uint32_t; 32 | typedef unsigned char uint8_t; 33 | 34 | typedef struct MD5Context { 35 | uint32_t state[4]; /* state */ 36 | uint32_t count[2]; /* number of bits, mod 2^64 */ 37 | uint8_t buffer[MD5_BLOCK_LENGTH]; /* input buffer */ 38 | } MD5_CTX; 39 | 40 | /* include */ 41 | 42 | /* __BEGIN_DECLS */ 43 | void MD5Init(MD5_CTX *); 44 | void MD5Update(MD5_CTX *, const uint8_t *, size_t) 45 | /* __attribute__((__bounded__(__string__,2,3)))*/; 46 | void MD5Final(uint8_t [MD5_DIGEST_LENGTH], MD5_CTX *) 47 | /* __attribute__((__bounded__(__minbytes__,1,MD5_DIGEST_LENGTH)))*/; 48 | void MD5Transform(uint32_t [4], const uint8_t [MD5_BLOCK_LENGTH]) 49 | /* __attribute__((__bounded__(__minbytes__,1,4)))*/ 50 | /* __attribute__((__bounded__(__minbytes__,2,MD5_BLOCK_LENGTH)))*/; 51 | /* __END_DECLS */ 52 | 53 | #endif /* _LRAD_MD5_H */ 54 | 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | -------------------------------------------------------------------------------- /common/revolver/object_pool.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/object_pool.h -------------------------------------------------------------------------------- /common/revolver/revolver.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /common/revolver/timer_node_t.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/timer_node_t.h -------------------------------------------------------------------------------- /common/revolver/timer_node_t.inl: -------------------------------------------------------------------------------- 1 | BASE_NAMESPACE_BEGIN_DECL 2 | 3 | #define FIRST_ROUND 16777216 4 | #define SECOND_ROUND 65536 5 | #define THIRD_ROUND 256 6 | 7 | template 8 | BaseTimerNode_T::BaseTimerNode_T(void) 9 | : act_(NULL), timer_id_(0xffffffff) 10 | , timeout_stamp_(0), internal_(0), handler_(0) 11 | { 12 | 13 | } 14 | 15 | template 16 | BaseTimerNode_T::~BaseTimerNode_T(void) 17 | { 18 | 19 | } 20 | 21 | template 22 | void BaseTimerNode_T::set(HANDLER handler, const void* act, 23 | uint32_t timeout_stamp, uint32_t intval, uint32_t timer_id) 24 | { 25 | handler_ = handler; 26 | act_ = act; 27 | timeout_stamp_ = timeout_stamp; 28 | internal_ = intval; 29 | timer_id_ = timer_id; 30 | } 31 | 32 | template 33 | void BaseTimerNode_T::get_dispatch_info(BaseTimerDispathInfo_T &info) 34 | { 35 | info.act_ = act_; 36 | info.handler_ = handler_; 37 | info.recurring_ = internal_ > 0 ? true : false; 38 | } 39 | 40 | template 41 | void BaseTimerNode_T::get_revolver_pos(uint8_t& first, uint8_t &second, uint8_t& third, uint8_t& fourth) const 42 | { 43 | first = (uint8_t)(timeout_stamp_ / FIRST_ROUND); 44 | second = (uint8_t)((timeout_stamp_ % FIRST_ROUND) / SECOND_ROUND); 45 | third = (uint8_t)((timeout_stamp_ % SECOND_ROUND) / THIRD_ROUND); 46 | fourth = (uint8_t) (timeout_stamp_ % THIRD_ROUND); 47 | } 48 | BASE_NAMESPACE_END_DECL 49 | -------------------------------------------------------------------------------- /common/revolver/timer_queue_t.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/timer_queue_t.h -------------------------------------------------------------------------------- /common/revolver/timer_queue_t.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/timer_queue_t.inl -------------------------------------------------------------------------------- /common/revolver/timer_ring.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/timer_ring.cpp -------------------------------------------------------------------------------- /common/revolver/timer_ring.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/timer_ring.h -------------------------------------------------------------------------------- /common/rudp/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | STATIC LIBRARY : rudp Project Overview 3 | ======================================================================== 4 | 5 | AppWizard has created this rudp library project for you. 6 | 7 | No source files were created as part of your project. 8 | 9 | 10 | rudp.vcxproj 11 | This is the main project file for VC++ projects generated using an Application Wizard. 12 | It contains information about the version of Visual C++ that generated the file, and 13 | information about the platforms, configurations, and project features selected with the 14 | Application Wizard. 15 | 16 | rudp.vcxproj.filters 17 | This is the filters file for VC++ projects generated using an Application Wizard. 18 | It contains information about the association between the files in your project 19 | and the filters. This association is used in the IDE to show grouping of files with 20 | similar extensions under a specific node (for e.g. ".cpp" files are associated with the 21 | "Source Files" filter). 22 | 23 | ///////////////////////////////////////////////////////////////////////////// 24 | Other notes: 25 | 26 | AppWizard uses "TODO:" comments to indicate parts of the source code you 27 | should add to or customize. 28 | 29 | ///////////////////////////////////////////////////////////////////////////// 30 | -------------------------------------------------------------------------------- /common/rudp/rudp.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /common/rudp/rudp_acceptor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_acceptor.h -------------------------------------------------------------------------------- /common/rudp/rudp_adapter.cpp: -------------------------------------------------------------------------------- 1 | #include "rudp/rudp_adapter.h" 2 | #include "rudp/rudp_interface.h" 3 | 4 | BASE_NAMESPACE_BEGIN_DECL 5 | 6 | void IRUDPAdapter::on_data(BinStream& strm, const Inet_Addr& remote_addr) 7 | { 8 | RUDP()->process(this, strm, remote_addr); 9 | } 10 | 11 | BASE_NAMESPACE_END_DECL -------------------------------------------------------------------------------- /common/rudp/rudp_adapter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_adapter.h -------------------------------------------------------------------------------- /common/rudp/rudp_adapter_interface.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_adapter_interface.h -------------------------------------------------------------------------------- /common/rudp/rudp_ccc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_ccc.cpp -------------------------------------------------------------------------------- /common/rudp/rudp_ccc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_ccc.h -------------------------------------------------------------------------------- /common/rudp/rudp_channel_interface.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_channel_interface.h -------------------------------------------------------------------------------- /common/rudp/rudp_event_handler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_event_handler.h -------------------------------------------------------------------------------- /common/rudp/rudp_half_connection.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_half_connection.h -------------------------------------------------------------------------------- /common/rudp/rudp_interface.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_interface.cpp -------------------------------------------------------------------------------- /common/rudp/rudp_interface.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_interface.h -------------------------------------------------------------------------------- /common/rudp/rudp_log_macro.cpp: -------------------------------------------------------------------------------- 1 | #include "rudp/rudp_log_macro.h" 2 | 3 | SingleLogStream rdup_log("rudp", SingleLogStream::debug); 4 | SingleLogStream rdup_recv_log("rudp_recv", SingleLogStream::debug); 5 | SingleLogStream rdup_send_log("rudp_send", SingleLogStream::debug); -------------------------------------------------------------------------------- /common/rudp/rudp_log_macro.h: -------------------------------------------------------------------------------- 1 | #ifndef __RDUP_LOG_MACRO_H_ 2 | #define __RDUP_LOG_MACRO_H_ 3 | 4 | #include "revolver/base_log.h" 5 | #include "revolver/base_hex_string.h" 6 | 7 | extern SingleLogStream rdup_log; 8 | extern SingleLogStream rdup_recv_log; 9 | extern SingleLogStream rdup_send_log; 10 | 11 | #define RUDP_DEBUG(arg)\ 12 | DEBUG_TRACE(rdup_log, arg) 13 | 14 | #define RUDP_INFO(arg)\ 15 | INFO_TRACE(rdup_log, arg) 16 | 17 | #define RUDP_WARNING(arg)\ 18 | WARNING_TRACE(rdup_log, arg) 19 | 20 | #define RUDP_ERROR(arg)\ 21 | ERROR_TRACE(rdup_log, arg) 22 | 23 | #define RUDP_FATAL(arg)\ 24 | FATAL_TRACE(rdup_log, arg) 25 | 26 | #define SET_RUDP_LEVEL(arg)\ 27 | rdup_log.set_trace_level(arg) 28 | 29 | 30 | #define RUDP_RECV_DEBUG(arg)\ 31 | DEBUG_TRACE(rdup_recv_log, arg) 32 | 33 | #define RUDP_RECV_INFO(arg)\ 34 | INFO_TRACE(rdup_recv_log, arg) 35 | 36 | #define RUDP_RECV_WARNING(arg)\ 37 | WARNING_TRACE(rdup_recv_log, arg) 38 | 39 | #define RUDP_RECV_ERROR(arg)\ 40 | ERROR_TRACE(rdup_recv_log, arg) 41 | 42 | #define RUDP_RECV_FATAL(arg)\ 43 | FATAL_TRACE(rdup_recv_log, arg) 44 | 45 | #define SET_RUDP_RECV_LEVEL(arg)\ 46 | rdup_recv_log.set_trace_level(arg) 47 | 48 | 49 | #define RUDP_SEND_DEBUG(arg)\ 50 | DEBUG_TRACE(rdup_send_log, arg) 51 | 52 | #define RUDP_SEND_INFO(arg)\ 53 | INFO_TRACE(rdup_send_log, arg) 54 | 55 | #define RUDP_SEND_WARNING(arg)\ 56 | WARNING_TRACE(rdup_send_log, arg) 57 | 58 | #define RUDP_SEND_ERROR(arg)\ 59 | ERROR_TRACE(rdup_send_log, arg) 60 | 61 | #define RUDP_SEND_FATAL(arg)\ 62 | FATAL_TRACE(rdup_send_log, arg) 63 | 64 | #define SET_RUDP_SEND_LEVEL(arg)\ 65 | rdup_send_log.set_trace_level(arg) 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /common/rudp/rudp_packet.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_packet.h -------------------------------------------------------------------------------- /common/rudp/rudp_recv_buffer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_recv_buffer.cpp -------------------------------------------------------------------------------- /common/rudp/rudp_recv_buffer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_recv_buffer.h -------------------------------------------------------------------------------- /common/rudp/rudp_segment.cpp: -------------------------------------------------------------------------------- 1 | #include "rudp/rudp_segment.h" 2 | 3 | BASE_NAMESPACE_BEGIN_DECL 4 | 5 | ObjectPool SENDSEGPOOL; 6 | ObjectPool RECVSEGPOOL; 7 | 8 | BASE_NAMESPACE_END_DECL -------------------------------------------------------------------------------- /common/rudp/rudp_segment.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_segment.h -------------------------------------------------------------------------------- /common/rudp/rudp_send_buffer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_send_buffer.cpp -------------------------------------------------------------------------------- /common/rudp/rudp_send_buffer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_send_buffer.h -------------------------------------------------------------------------------- /common/rudp/rudp_socket.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_socket.cpp -------------------------------------------------------------------------------- /common/rudp/rudp_socket.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_socket.h -------------------------------------------------------------------------------- /common/rudp/rudp_stream.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_stream.cpp -------------------------------------------------------------------------------- /common/rudp/rudp_stream.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_stream.h -------------------------------------------------------------------------------- /common/silencer/ReadMe.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/silencer/ReadMe.txt -------------------------------------------------------------------------------- /common/silencer/daemon_config.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/silencer/daemon_config.cpp -------------------------------------------------------------------------------- /common/silencer/daemon_config.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/silencer/daemon_config.h -------------------------------------------------------------------------------- /common/silencer/dc_tcp_listener.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/silencer/dc_tcp_listener.cpp -------------------------------------------------------------------------------- /common/silencer/dc_tcp_listener.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/silencer/dc_tcp_listener.h -------------------------------------------------------------------------------- /common/silencer/sil_connection_hash.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/silencer/sil_connection_hash.h -------------------------------------------------------------------------------- /common/silencer/silencer.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | -------------------------------------------------------------------------------- /common/silencer/silencer.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /common/vsproj/silencer_v12.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Header Files 16 | 17 | 18 | Header Files 19 | 20 | 21 | Header Files 22 | 23 | 24 | 25 | 26 | Source Files 27 | 28 | 29 | Source Files 30 | 31 | 32 | -------------------------------------------------------------------------------- /daemon/daemon.cpp: -------------------------------------------------------------------------------- 1 | // daemon.cpp : Defines the entry point for the console application. 2 | // 3 | 4 | #include "daemon_frame.h" 5 | #include "core/core_main.h" 6 | 7 | int main(int argc, char* argv[]) 8 | { 9 | CREATE_DAEMON_FRAME(); 10 | 11 | DAEMON_FRAME()->init(); 12 | DAEMON_FRAME()->start(); 13 | 14 | core_main(); 15 | 16 | DAEMON_FRAME()->destroy(); 17 | 18 | DESTROY_DAEMON_FRAME(); 19 | 20 | return 0; 21 | } 22 | 23 | -------------------------------------------------------------------------------- /daemon/daemon.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "daemon", "daemon.vcxproj", "{B5026BD0-9443-42DD-996D-29434E1B0953}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {B5026BD0-9443-42DD-996D-29434E1B0953}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {B5026BD0-9443-42DD-996D-29434E1B0953}.Debug|Win32.Build.0 = Debug|Win32 14 | {B5026BD0-9443-42DD-996D-29434E1B0953}.Release|Win32.ActiveCfg = Release|Win32 15 | {B5026BD0-9443-42DD-996D-29434E1B0953}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /daemon/daemon.sln.docstates.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/daemon/daemon.sln.docstates.suo -------------------------------------------------------------------------------- /daemon/daemon.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/daemon/daemon.suo -------------------------------------------------------------------------------- /daemon/daemon.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | 38 | 39 | Header Files 40 | 41 | 42 | Header Files 43 | 44 | 45 | Header Files 46 | 47 | 48 | Header Files 49 | 50 | 51 | Header Files 52 | 53 | 54 | Header Files 55 | 56 | 57 | Header Files 58 | 59 | 60 | -------------------------------------------------------------------------------- /daemon/daemon.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /daemon/daemon_element.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/daemon/daemon_element.cpp -------------------------------------------------------------------------------- /daemon/daemon_element.h: -------------------------------------------------------------------------------- 1 | #ifndef __DAEMON_ELEMENT_H 2 | #define __DAEMON_ELEMENT_H 3 | 4 | #include "revolver/base_namespace.h" 5 | #include "revolver/base_typedef.h" 6 | #include "revolver/base_inet_addr.h" 7 | 8 | #include 9 | 10 | using namespace BASE; 11 | 12 | class CDaemonElement 13 | { 14 | public: 15 | CDaemonElement(); 16 | ~CDaemonElement(); 17 | 18 | uint32_t get_server_id() const; 19 | uint8_t get_server_type() const; 20 | uint16_t get_net_type() const; 21 | 22 | const Inet_Addr& get_tel_addr() const; 23 | const Inet_Addr& get_cnc_addr() const; 24 | 25 | uint32_t get_max_user() const {return max_user_;}; 26 | void set_max_user(uint32_t max_user) {max_user_ = max_user;}; 27 | 28 | void set_server_info(uint8_t stype, uint32_t sid, uint16_t net_type, const Inet_Addr& tel_addr, const Inet_Addr& cnc_addr); 29 | void clear_info(); 30 | 31 | void start_notify(uint32_t server_id, uint8_t server_type, uint16_t net_type, const Inet_Addr &tel_addr, const Inet_Addr &cnc_addr); 32 | void stop_notify(uint32_t server_id, uint8_t server_type); 33 | 34 | bool is_null() const { return null_;}; 35 | 36 | public: 37 | uint32_t server_id_; 38 | uint8_t server_type_; 39 | uint16_t net_type_; 40 | uint32_t max_user_; 41 | 42 | Inet_Addr tel_addr_; 43 | Inet_Addr cnc_addr_; 44 | 45 | bool null_; 46 | }; 47 | 48 | typedef map ServerElementMap; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /daemon/daemon_frame.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/daemon/daemon_frame.cpp -------------------------------------------------------------------------------- /daemon/daemon_frame.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/daemon/daemon_frame.h -------------------------------------------------------------------------------- /daemon/daemon_json.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/daemon/daemon_json.h -------------------------------------------------------------------------------- /daemon/daemon_log.cpp: -------------------------------------------------------------------------------- 1 | #include "daemon_log.h" 2 | 3 | BaseLogStream daemon_log("daemon", BaseLogStream::debug); 4 | -------------------------------------------------------------------------------- /daemon/daemon_log.h: -------------------------------------------------------------------------------- 1 | #ifndef __DAEMON_LOG_H 2 | #define __DAEMON_LOG_H 3 | 4 | #include "revolver/base_log.h" 5 | 6 | extern BaseLogStream daemon_log; 7 | 8 | #define DAEMON_DEBUG(arg)\ 9 | DEBUG_TRACE(daemon_log, arg) 10 | 11 | #define DAEMON_INFO(arg)\ 12 | INFO_TRACE(daemon_log, arg) 13 | 14 | #define DAEMON_WARNING(arg)\ 15 | WARNING_TRACE(daemon_log, arg) 16 | 17 | #define DAEMON_ERROR(arg)\ 18 | ERROR_TRACE(daemon_log, arg) 19 | 20 | #define DAEMON_FATAL(arg)\ 21 | FATAL_TRACE(daemon_log, arg) 22 | 23 | #define SET_DAEMON_LOG_LEVEL(arg)\ 24 | daemon_log.set_trace_level(arg) 25 | 26 | #endif 27 | 28 | 29 | -------------------------------------------------------------------------------- /daemon/daemon_physical.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/daemon/daemon_physical.h -------------------------------------------------------------------------------- /daemon/daemon_server.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/daemon/daemon_server.cpp -------------------------------------------------------------------------------- /daemon/daemon_server.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/daemon/daemon_server.h -------------------------------------------------------------------------------- /daemon/daemon_simple_physical.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/daemon/daemon_simple_physical.cpp -------------------------------------------------------------------------------- /daemon/daemon_simple_physical.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/daemon/daemon_simple_physical.h -------------------------------------------------------------------------------- /data0data.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/data0data.cc -------------------------------------------------------------------------------- /data0data.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/data0data.h -------------------------------------------------------------------------------- /data0data.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/data0data.inl -------------------------------------------------------------------------------- /data0type.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/data0type.cc -------------------------------------------------------------------------------- /data0type.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/data0type.h -------------------------------------------------------------------------------- /data0type.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/data0type.inl -------------------------------------------------------------------------------- /data0types.h: -------------------------------------------------------------------------------- 1 | #ifndef __DATA0TYPES_H_ 2 | #define __DATA0TYPES_H_ 3 | 4 | #include "univ.h" 5 | 6 | typedef struct dfield_struct dfield_t; 7 | typedef struct dtuple_struct dtuple_t; 8 | 9 | #endif 10 | 11 | 12 | -------------------------------------------------------------------------------- /db0err.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/db0err.h -------------------------------------------------------------------------------- /dict0boot.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/dict0boot.cc -------------------------------------------------------------------------------- /dict0boot.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/dict0boot.h -------------------------------------------------------------------------------- /dict0crea.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/dict0crea.cc -------------------------------------------------------------------------------- /dict0crea.h: -------------------------------------------------------------------------------- 1 | #ifndef __dict0crea_h_ 2 | #define __dict0crea_h_ 3 | 4 | #include "univ.h" 5 | #include "dict0types.h" 6 | #include "dict0dict.h" 7 | #include "que0types.h" 8 | #include "row0types.h" 9 | #include "mtr0mtr.h" 10 | 11 | /* Table create node states */ 12 | #define TABLE_BUILD_TABLE_DEF 1 13 | #define TABLE_BUILD_COL_DEF 2 14 | #define TABLE_COMMIT_WORK 3 15 | #define TABLE_ADD_TO_CACHE 4 16 | #define TABLE_COMPLETED 5 17 | 18 | /* Index create node states */ 19 | #define INDEX_BUILD_INDEX_DEF 1 20 | #define INDEX_BUILD_FIELD_DEF 2 21 | #define INDEX_CREATE_INDEX_TREE 3 22 | #define INDEX_COMMIT_WORK 4 23 | #define INDEX_ADD_TO_CACHE 5 24 | 25 | struct tab_node_struct 26 | { 27 | que_common_t common; 28 | dict_table_t* table; 29 | ins_node_t* table_ref; 30 | ins_node_t* col_ref; 31 | commit_node_t* commit_node; 32 | ulint state; 33 | ulint col_no; 34 | mem_heap_t* heap; 35 | }; 36 | 37 | struct ind_node_struct 38 | { 39 | que_common_t common; 40 | dict_index_t* index; 41 | ins_node_t* ind_def; 42 | ins_node_t* field_def; 43 | commit_node_t* commit_node; 44 | 45 | ulint state; 46 | dict_table_t* table; 47 | dtuple_t* ind_row; 48 | ulint field_no; 49 | mem_heap_t* heap; 50 | }; 51 | 52 | void dict_create_default_index(dict_table_t* table, trx_t* trx); 53 | 54 | tab_node_t* tab_create_graph_create(dict_table_t* table, mem_heap_t* heap); 55 | 56 | ind_node_t* ind_create_graph_create(dict_index_t* index, mem_heap_t* heap); 57 | 58 | que_thr_t* dict_create_table_step(que_thr_t* thr); 59 | 60 | que_thr_t* dict_create_index_step(que_thr_t* thr); 61 | 62 | void dict_drop_index_tree(rec_t* rec, mtr_t* mtr); 63 | 64 | ulint dict_create_or_check_foreign_constraint_tables(); 65 | 66 | ulint dict_create_add_foreigns_to_dictionary(dict_table_t* table, trx_t* trx); 67 | 68 | #endif 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /dict0dict.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/dict0dict.cc -------------------------------------------------------------------------------- /dict0dict.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/dict0dict.h -------------------------------------------------------------------------------- /dict0dict.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/dict0dict.inl -------------------------------------------------------------------------------- /dict0load.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/dict0load.cc -------------------------------------------------------------------------------- /dict0load.h: -------------------------------------------------------------------------------- 1 | #ifndef __dict0load_h_ 2 | #define __dict0load_h_ 3 | 4 | #include "univ.h" 5 | #include "dict0types.h" 6 | #include "ut0byte.h" 7 | 8 | char* dict_get_first_table_name_in_db(char* name); 9 | 10 | dict_table_t* dict_load_table(char* name); 11 | 12 | dict_table_t* dict_load_table_on_id(dulint table_id); 13 | 14 | void dict_load_sys_table(dict_table_t* table); 15 | 16 | ulint dict_load_foreigns(char* table_name); 17 | 18 | void dict_print(); 19 | 20 | #endif 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /dict0mem.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/dict0mem.cc -------------------------------------------------------------------------------- /dict0mem.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/dict0mem.h -------------------------------------------------------------------------------- /dict0types.h: -------------------------------------------------------------------------------- 1 | #ifndef dict0types_h 2 | #define dict0types_h 3 | 4 | typedef struct dict_sys_struct dict_sys_t; 5 | typedef struct dict_col_struct dict_col_t; 6 | typedef struct dict_field_struct dict_field_t; 7 | typedef struct dict_index_struct dict_index_t; 8 | typedef struct dict_tree_struct dict_tree_t; 9 | typedef struct dict_table_struct dict_table_t; 10 | typedef struct dict_proc_struct dict_proc_t; 11 | typedef struct dict_foreign_struct dict_foreign_t; 12 | 13 | /* A cluster object is a table object with the type field set to DICT_CLUSTERED */ 14 | 15 | typedef dict_table_t dict_cluster_t; 16 | 17 | typedef struct ind_node_struct ind_node_t; 18 | typedef struct tab_node_struct tab_node_t; 19 | 20 | #endif 21 | 22 | 23 | -------------------------------------------------------------------------------- /dyn0dyn.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/dyn0dyn.cc -------------------------------------------------------------------------------- /dyn0dyn.h: -------------------------------------------------------------------------------- 1 | #ifndef __DYN0DYN_H_ 2 | #define __DYN0DYN_H_ 3 | 4 | #include "univ.h" 5 | #include "ut0lst.h" 6 | #include "mem0mem.h" 7 | 8 | typedef struct dyn_block_struct dyn_block_t; 9 | typedef dyn_block_t dyn_array_t; 10 | 11 | #define DYN_ARRAY_DATA_SIZE 512 12 | 13 | UNIV_INLINE dyn_array_t* dyn_array_create(dyn_array_t* arr); 14 | 15 | UNIV_INLINE void dyn_array_free(dyn_array_t* arr); 16 | 17 | UNIV_INLINE byte* dyn_array_open(dyn_array_t* arr, ulint size); 18 | 19 | UNIV_INLINE void dyn_array_close(dyn_array_t* arr, byte* ptr); 20 | 21 | UNIV_INLINE void* dyn_array_push(dyn_array_t* arr, ulint size); 22 | 23 | UNIV_INLINE void* dyn_array_get_element(dyn_array_t* arr, ulint pos); 24 | 25 | UNIV_INLINE ulint dyn_array_get_data_size(dyn_array_t* arr); 26 | 27 | UNIV_INLINE dyn_block_t* dyn_array_get_first_block(dyn_array_t* arr); 28 | 29 | UNIV_INLINE dyn_block_t* dyn_array_get_last_block(dyn_array_t* arr); 30 | 31 | UNIV_INLINE dyn_block_t* dyn_array_get_next_block(dyn_array_t* arr, dyn_block_t* block); 32 | 33 | UNIV_INLINE ulint dyn_block_get_used(dyn_block_t* block); 34 | 35 | UNIV_INLINE byte* dyn_block_get_data(dyn_block_t* block); 36 | 37 | UNIV_INLINE void dyn_push_string(dyn_array_t* arr, byte* str, ulint len); 38 | 39 | struct dyn_block_struct 40 | { 41 | mem_heap_t* heap; 42 | ulint used; 43 | ulint data[DYN_ARRAY_DATA_SIZE]; 44 | UT_LIST_BASE_NODE_T(dyn_block_t) base; 45 | UT_LIST_NODE_T(dyn_block_t) list; 46 | 47 | #ifdef UNIV_DEBUG 48 | ulint buf_end; 49 | ulint magic_n; 50 | #endif 51 | 52 | }; 53 | 54 | #include "dyn0dyn.inl" 55 | 56 | #endif 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /fil0fil.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/fil0fil.cc -------------------------------------------------------------------------------- /fil0fil.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/fil0fil.h -------------------------------------------------------------------------------- /fsp0fsp.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/fsp0fsp.cc -------------------------------------------------------------------------------- /fsp0fsp.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/fsp0fsp.h -------------------------------------------------------------------------------- /fsp0fsp.inl: -------------------------------------------------------------------------------- 1 | 2 | UNIV_INLINE ibool fsp_descr_page(ulint page_no) 3 | { 4 | if(page_no % XDES_DESCRIBED_PER_PAGE == FSP_XDES_OFFSET) 5 | return TRUE; 6 | 7 | return FALSE; 8 | } -------------------------------------------------------------------------------- /fut0fut.h: -------------------------------------------------------------------------------- 1 | #ifndef __FUT0FUT_H_ 2 | #define __FUT0FUT_H_ 3 | 4 | #include "univ.h" 5 | #include "fil0fil.h" 6 | #include "mtr0mtr.h" 7 | 8 | UNIV_INLINE byte* fut_get_ptr(ulint space, fil_addr_t addr, ulint rw_latch, mtr_t* mtr); 9 | 10 | #include "fut0fut.inl" 11 | #endif 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /fut0fut.inl: -------------------------------------------------------------------------------- 1 | #include "sync0rw.h" 2 | #include "buf0buf.h" 3 | 4 | UNIV_INLINE btye* fut_get_ptr(ulint space, fil_addr_t addr, ulint rw_latch, mtr_t* mtr) 5 | { 6 | byte* ptr; 7 | 8 | ut_ad(mtr); 9 | ut_ad(addr.boffset < UNIV_PAGE_SIZE); 10 | ut_ad((rw_latch == RW_S_LATCH) || (rw_latch == RW_X_LATCH)); 11 | 12 | ptr = buf_page_get(space, addr.page, rw_latch, mtr) + addr.boffset; 13 | buf_page_dbg_add_level(ptr, SYNC_NO_ORDER_CHECK); 14 | 15 | return ptr; 16 | } 17 | 18 | 19 | -------------------------------------------------------------------------------- /fut0lst.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/fut0lst.cc -------------------------------------------------------------------------------- /fut0lst.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/fut0lst.h -------------------------------------------------------------------------------- /fut0lst.inl: -------------------------------------------------------------------------------- 1 | #include "fut0fut.h" 2 | #include "mtr0log.h" 3 | #include "buf0buf.h" 4 | 5 | #define FLST_PREV 0 6 | #define FLST_NEXT FIL_ADDR_SIZE 7 | #define FLST_LEN 0 8 | #define FLST_FIRST 4 9 | #define FLST_LAST (4 + FIL_ADDR_SIZE) 10 | 11 | UNIV_INLINE void flst_write_addr(fil_faddr_t* faddr, fil_addr_t addr, mtr_t* mtr) 12 | { 13 | ut_ad(faddr && mtr); 14 | ut_ad(mtr_memo_contains(mtr, buf_block_align(faddr), MTR_MEMO_PAGE_X_FIX)); 15 | 16 | mlog_write_ulint(faddr + FIL_ADDR_PAGE, addr.page, MLOG_4BYTES, mtr); 17 | mlog_write_ulint(faddr + FIL_ADDR_BYTE, addr.boffset, MLOG_2BYTES, mtr); 18 | } 19 | 20 | UNIV_INLINE fil_addr_t flst_read_addr(fil_faddr_t* faddr, mtr_t* mtr) 21 | { 22 | fil_addr_t addr; 23 | 24 | ut_ad(faddr && mtr); 25 | addr.page = mtr_read_ulint(faddr + FIL_ADDR_PAGE, MLOG_4BYTES, mtr); 26 | addr.boffset = mtr_read_ulint(faddr + FIL_ADDR_BYTE, MLOG_2BYTES, mtr); 27 | 28 | return addr; 29 | } 30 | 31 | UNIV_INLINE void flst_init(flst_base_node_t* base, mtr_t* mtr) 32 | { 33 | ut_ad(mtr_memo_contains(mtr, buf_block_align(base), MTR_MEMO_PAGE_X_FIX)); 34 | 35 | mlog_write_ulint(base + FLST_LEN, 0, MLOG_4BYTES, mtr); 36 | flst_write_addr(base + FLST_FIRST, fil_addr_null, mtr); 37 | flst_write_addr(base + FLST_LAST, fil_addr_null, mtr); 38 | } 39 | 40 | UNIV_INLINE ulint flst_get_len(flst_base_node_t* base, mtr_t* mtr) 41 | { 42 | return mtr_read_ulint(base + FLST_LEN, MLOG_4BYTES, mtr); 43 | } 44 | 45 | UNIV_INLINE fil_addr_t flst_get_first(flst_base_node_t* base, mtr_t* mtr) 46 | { 47 | return flst_read_addr(base + FLST_FIRST, mtr); 48 | } 49 | 50 | UNIV_INLINE fil_addr_t flst_get_last(flst_base_node_t* base, mtr_t* mtr) 51 | { 52 | return flst_read_addr(base + FLST_LAST, mtr); 53 | } 54 | 55 | UNIV_INLINE fil_addr_t flst_get_next_addr(flst_node_t* node, mtr_t* mtr) 56 | { 57 | return flst_read_addr(node + FLST_NEXT, mtr); 58 | } 59 | 60 | UNIV_INLINE fil_addr_t flst_get_prev_addr(flst_node_t* node, mtr_t* mtr) 61 | { 62 | return(flst_read_addr(node + FLST_PREV, mtr)); 63 | } 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /ha0ha.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/ha0ha.cc -------------------------------------------------------------------------------- /ha0ha.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/ha0ha.h -------------------------------------------------------------------------------- /ha0storage.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/ha0storage.cc -------------------------------------------------------------------------------- /ha0storage.h: -------------------------------------------------------------------------------- 1 | #ifndef __HA0STORAGE_H_ 2 | #define __HA0STORAGE_H_ 3 | 4 | #include "univ.h" 5 | 6 | #define HA_STORAGE_DEFAULT_HEAP_BYTES 1024 7 | #define HA_STORAGE_DEFAULT_HASH_CELLS 4096 8 | 9 | typedef struct ha_storage_struct ha_storage_t; 10 | 11 | UNIV_INLINE ha_storage_t* ha_storage_create(ulint initial_heap_bytes, ulint initial_hash_cells); 12 | 13 | UNIV_INLINE void ha_storage_empty(ha_storage_t** storage); 14 | 15 | UNIV_INLINE void ha_storage_free(ha_storage_t* storage); 16 | 17 | UNIV_INLINE ulint ha_storage_get_size(const ha_storage_t* storage); 18 | 19 | UNIV_INTERN const void* ha_storage_put_memlim(ha_storage_t* storage, const void* data, ulint data_len, ulint memlim); 20 | 21 | #define ha_storage_put(storage, data, data_len) ha_storage_put_memlim(storage, data, data_len, 0) 22 | 23 | #define ha_storage_put_str(storage, str) ((const char*)ha_storage_put((storage), (str), strlen(str) + 1)) 24 | 25 | #define ha_storage_put_str_memlim(storage, str, memlim) \ 26 | ((const char*)ha_storage_put_memlim((storage), (str), strlen(str) + 1, (memlim))) 27 | 28 | 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /hash0hash.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/hash0hash.cc -------------------------------------------------------------------------------- /hash0hash.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/hash0hash.h -------------------------------------------------------------------------------- /ibuf0ibuf.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/ibuf0ibuf.cc -------------------------------------------------------------------------------- /ibuf0ibuf.h: -------------------------------------------------------------------------------- 1 | #ifndef __ibuf0ibuf_h_ 2 | #define __ibuf0ibuf_h_ 3 | 4 | #include "univ.h" 5 | #include "dict0mem.h" 6 | #include "dict0dict.h" 7 | #include "mtr0mtr.h" 8 | #include "que0types.h" 9 | #include "ibuf0types.h" 10 | #include "fsp0fsp.h" 11 | 12 | #define IBUF_HEADER_PAGE_NO FSP_IBUF_HEADER_PAGE_NO 13 | #define IBUF_TREE_ROOT_PAGE_NO FSP_IBUF_TREE_ROOT_PAGE_NO 14 | 15 | #define IBUF_HEADER PAGE_DATA 16 | #define IBUF_TREE_SEG_HEADER 0 17 | 18 | ibuf_data_t* ibuf_data_init_for_space(ulint space); 19 | 20 | void ibuf_init_at_db_start(); 21 | 22 | void ibuf_bitmap_page_init(page_t* page, mtr_t* mtr); 23 | 24 | void ibuf_reset_free_bits_with_type(ulint type, page_t* page); 25 | 26 | void ibuf_reset_free_bits(dict_index_t* index); 27 | 28 | UNIV_INLINE void ibuf_update_free_bits_if_full(dict_index_t* index, page_t* page, ulint max_ins_size, ulint increase); 29 | 30 | void ibuf_update_free_bits_low(dict_index_t* index, page_t* page, ulint max_ins_size, mtr_t* mtr); 31 | 32 | void ibuf_update_free_bits_for_two_pages_low(dict_index_t* index, page_t* page1, page_t* page2, mtr_t* mtr); 33 | 34 | UNIV_INLINE ibool ibuf_should_try(dict_index_t* index, ulint ignore_sec_unique); 35 | 36 | ibool ibuf_inside(); 37 | 38 | UNIV_INLINE ibool ibuf_bitmap_page(ulint page_no); 39 | 40 | ibool ibuf_page(ulint space, ulint page_no); 41 | 42 | ibool ibuf_page_low(ulint space, ulint page_no, mtr_t* mtr); 43 | 44 | ibool ibuf_index_page_has_free(page_t* page); 45 | 46 | void ibuf_free_excess_pages(ulint space); 47 | 48 | ibool ibuf_insert(dtuple_t* entry, dict_index_t* index, ulint space, ulint page_no, que_thr_t* thr); 49 | 50 | void ibuf_merge_or_delete_for_page(page_t* page, ulint space, ulint page_no); 51 | 52 | ulint ibuf_contract(ibool sync); 53 | 54 | ulint ibuf_contract_for_n_pages(ibool sync, ulint n_pages); 55 | 56 | byte* ibuf_parse_bitmap_init(byte* ptr, byte* end_ptr, page_t* page, mtr_t* mtr); 57 | 58 | ulint ibuf_count_get(ulint space, ulint page_no); 59 | 60 | void ibuf_print(char* buf, char* buf_end); 61 | 62 | extern ibuf_t* ibuf; 63 | 64 | #include "ibuf0ibuf.inl" 65 | 66 | #endif 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /ibuf0ibuf.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/ibuf0ibuf.inl -------------------------------------------------------------------------------- /ibuf0types.h: -------------------------------------------------------------------------------- 1 | #ifndef __ibuf0types_h_ 2 | #define __ibuf0types_h_ 3 | 4 | typedef struct ibuf_data_struct ibuf_data_t; 5 | typedef struct ibuf_struct ibuf_t; 6 | 7 | #endif 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /innodb.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "innodb", "innodb.vcxproj", "{74685957-031E-4F31-97E0-965255757FFC}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {74685957-031E-4F31-97E0-965255757FFC}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {74685957-031E-4F31-97E0-965255757FFC}.Debug|Win32.Build.0 = Debug|Win32 14 | {74685957-031E-4F31-97E0-965255757FFC}.Release|Win32.ActiveCfg = Release|Win32 15 | {74685957-031E-4F31-97E0-965255757FFC}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /innodb.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /innodb_prj.udb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/innodb_prj.udb -------------------------------------------------------------------------------- /lock0lock.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/lock0lock.cc -------------------------------------------------------------------------------- /lock0lock.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/lock0lock.h -------------------------------------------------------------------------------- /lock0lock.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/lock0lock.inl -------------------------------------------------------------------------------- /lock0types.h: -------------------------------------------------------------------------------- 1 | #ifndef __LOCK0TYPES_H_ 2 | #define __LOCK0TYPES_H_ 3 | 4 | #define lock_t ib_lock_t 5 | 6 | typedef struct lock_struct lock_t; 7 | typedef struct lock_sys_struct lock_sys_t; 8 | 9 | #endif 10 | 11 | 12 | -------------------------------------------------------------------------------- /log0log.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/log0log.cc -------------------------------------------------------------------------------- /log0log.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/log0log.h -------------------------------------------------------------------------------- /log0log.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/log0log.inl -------------------------------------------------------------------------------- /log0recv.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/log0recv.cc -------------------------------------------------------------------------------- /log0recv.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/log0recv.h -------------------------------------------------------------------------------- /log0recv.inl: -------------------------------------------------------------------------------- 1 | #include "sync0sync.h" 2 | #include "mem0mem.h" 3 | #include "log0log.h" 4 | #include "os0file.h" 5 | 6 | extern ibool recv_recovery_from_backup_on; 7 | 8 | UNIV_INLINE ibool recv_recovery_is_on() 9 | { 10 | return recv_recovery_on; 11 | } 12 | 13 | UNIV_INLINE ibool recv_recovery_from_backup_is_on() 14 | { 15 | return recv_recovery_from_backup_on; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /mem0mem.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/mem0mem.cc -------------------------------------------------------------------------------- /mem0mem.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/mem0mem.h -------------------------------------------------------------------------------- /mem0pool.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/mem0pool.cc -------------------------------------------------------------------------------- /mem0pool.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/mem0pool.h -------------------------------------------------------------------------------- /mtr0log.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/mtr0log.cc -------------------------------------------------------------------------------- /mtr0log.h: -------------------------------------------------------------------------------- 1 | #ifndef __MTR0LOG_H_ 2 | #define __MTR0LOG_H_ 3 | 4 | #include "univ.h" 5 | #include "mtr0mtr.h" 6 | 7 | void mlog_write_ulint(byte* ptr, ulint val, byte type, mtr_t* mtr); 8 | 9 | void mlog_write_dulint(byte* ptr, dulint val, byte type, mtr_t* mtr); 10 | 11 | void mlog_write_string(byte* ptr, byte* str, ulint len, mtr_t* mtr); 12 | 13 | void mlog_write_initial_log_record(byte* ptr, byte type, mtr_t* mtr); 14 | 15 | void mlog_catenate_string(mtr_t* mtr, byte* str, ulint len); 16 | 17 | UNIV_INLINE void mlog_catenate_ulint(mtr_t* mtr, ulint val, ulint type); 18 | 19 | UNIV_INLINE void mlog_catenate_ulint_compressed(mtr_t* mtr, ulint val); 20 | 21 | UNIV_INLINE void mlog_catenate_dulint_compressed(mtr_t* mtr, dulint val); 22 | 23 | UNIV_INLINE byte* mlog_open(mtr_t* mtr, ulint size); 24 | 25 | UNIV_INLINE void mlog_close(mtr_t* mtr, byte* ptr); 26 | 27 | UNIV_INLINE byte* mlog_write_initial_log_record_fast(byte* ptr, byte type, byte* log_ptr, mtr_t* mtr); 28 | 29 | UNIV_INLINE dulint mlog_write(dyn_array_t* mlog, ibool* modifications); 30 | 31 | byte* mlog_parse_initial_log_record(byte* ptr, byte* end_ptr, byte* type, ulint* space, ulint* page_no); 32 | 33 | byte* mlog_parse_nbytes(ulint type, byte* ptr, byte* end_ptr, byte* page); 34 | 35 | byte* mlog_parse_string(byte* ptr, byte* end_ptr, byte* page); 36 | 37 | #define MLOG_BUF_MARGIN 256 38 | 39 | #include "mtr0log.inl" 40 | #endif 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /mtr0log.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/mtr0log.inl -------------------------------------------------------------------------------- /mtr0mtr.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/mtr0mtr.cc -------------------------------------------------------------------------------- /mtr0mtr.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/mtr0mtr.h -------------------------------------------------------------------------------- /mtr0mtr.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/mtr0mtr.inl -------------------------------------------------------------------------------- /mtr0types.h: -------------------------------------------------------------------------------- 1 | #ifndef __mtr0types_h_ 2 | #define __mtr0types_h_ 3 | 4 | typedef mtr_struct mtr_t; 5 | #endif 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /os0file.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/os0file.cc -------------------------------------------------------------------------------- /os0file.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/os0file.h -------------------------------------------------------------------------------- /os0sync.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/os0sync.cc -------------------------------------------------------------------------------- /os0sync.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/os0sync.h -------------------------------------------------------------------------------- /os0thread.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/os0thread.cc -------------------------------------------------------------------------------- /os0thread.h: -------------------------------------------------------------------------------- 1 | #ifndef os0thread_h_ 2 | #define os0thread_h_ 3 | 4 | #include "univ.h" 5 | 6 | #ifdef __WIN__ 7 | #define OS_THREAD_MAX_N 1000 8 | #else 9 | #define OS_THREAD_MAX_N 10000 10 | #endif 11 | 12 | #define OS_THREAD_PRIORITY_NONE 100 13 | #define OS_THREAD_PRIORITY_BACKGROUND 1 14 | #define OS_THREAD_PRIORITY_NORMAL 2 15 | #define OS_THREAD_PRIORITY_ABOVE_NORMAL 3 16 | 17 | #ifdef __WIN__ 18 | typedef void* os_thread_t; 19 | typedef ulint os_thread_id_t; 20 | #else 21 | typedef pthread_t os_thread_t; 22 | typedef os_thread_t os_thread_id_t; 23 | #endif 24 | 25 | typedef void* (*os_posix_f_t)(void*); 26 | 27 | ibool os_thread_eq(os_thread_id_t a, os_thread_id_t b); 28 | ulint os_thread_pf(os_thread_id_t a); 29 | 30 | os_thread_t os_thread_create( 31 | #ifndef __WIN__ 32 | os_posix_f_t start_f, 33 | #else 34 | ulint (*start_f)(void*), 35 | #endif 36 | void* arg, os_thread_id_t* thread_id); 37 | 38 | void os_thread_exit(ulint code); 39 | 40 | os_thread_id_t os_thread_get_curr_id(); 41 | 42 | os_thread_t os_thread_get_curr(); 43 | 44 | void os_thread_wait(os_thread_t thread); 45 | 46 | void os_thread_yield(); 47 | 48 | void os_thread_sleep(ulint tm); 49 | 50 | ulint os_thread_get_prority(os_thread_t handle); 51 | 52 | void os_thread_set_priority(os_thread_t handle, ulint pri); 53 | 54 | ulint os_thread_get_last_error(); 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /page0cur.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/page0cur.cc -------------------------------------------------------------------------------- /page0cur.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/page0cur.h -------------------------------------------------------------------------------- /page0cur.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/page0cur.inl -------------------------------------------------------------------------------- /page0page.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/page0page.cc -------------------------------------------------------------------------------- /page0page.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/page0page.h -------------------------------------------------------------------------------- /page0page.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/page0page.inl -------------------------------------------------------------------------------- /page0types.h: -------------------------------------------------------------------------------- 1 | #ifndef __page0types_h_ 2 | #define __page0types_h_ 3 | 4 | #include "univ.h" 5 | 6 | /*#define page_t ib_page_t*/ 7 | typedef byte page_t; 8 | typedef struct page_search_struct page_search_t; 9 | typedef struct page_cur_struct page_cur_t; 10 | 11 | 12 | #endif 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /pars0opt.h: -------------------------------------------------------------------------------- 1 | /****************************************************** 2 | Simple SQL optimizer 3 | 4 | (c) 1997 Innobase Oy 5 | 6 | Created 12/21/1997 Heikki Tuuri 7 | *******************************************************/ 8 | 9 | #ifndef pars0opt_h 10 | #define pars0opt_h 11 | 12 | #include "univ.i" 13 | #include "que0types.h" 14 | #include "usr0types.h" 15 | #include "pars0sym.h" 16 | #include "dict0types.h" 17 | #include "row0sel.h" 18 | 19 | /*********************************************************************** 20 | Optimizes a select. Decides which indexes to tables to use. The tables 21 | are accessed in the order that they were written to the FROM part in the 22 | select statement. */ 23 | 24 | void 25 | opt_search_plan( 26 | /*============*/ 27 | sel_node_t* sel_node); /* in: parsed select node */ 28 | /*********************************************************************** 29 | Looks for occurrences of the columns of the table in the query subgraph and 30 | adds them to the list of columns if an occurrence of the same column does not 31 | already exist in the list. If the column is already in the list, puts a value 32 | indirection to point to the occurrence in the column list, except if the 33 | column occurrence we are looking at is in the column list, in which case 34 | nothing is done. */ 35 | 36 | void 37 | opt_find_all_cols( 38 | /*==============*/ 39 | ibool copy_val, /* in: if TRUE, new found columns are 40 | added as columns to copy */ 41 | dict_index_t* index, /* in: index to use */ 42 | sym_node_list_t* col_list, /* in: base node of a list where 43 | to add new found columns */ 44 | plan_t* plan, /* in: plan or NULL */ 45 | que_node_t* exp); /* in: expression or condition */ 46 | /************************************************************************ 47 | Prints info of a query plan. */ 48 | 49 | void 50 | opt_print_query_plan( 51 | /*=================*/ 52 | sel_node_t* sel_node); /* in: select node */ 53 | 54 | #ifndef UNIV_NONINL 55 | #include "pars0opt.ic" 56 | #endif 57 | 58 | #endif 59 | 60 | -------------------------------------------------------------------------------- /pars0types.h: -------------------------------------------------------------------------------- 1 | /****************************************************** 2 | SQL parser global types 3 | 4 | (c) 1997 Innobase Oy 5 | 6 | Created 1/11/1998 Heikki Tuuri 7 | *******************************************************/ 8 | 9 | #ifndef pars0types_h 10 | #define pars0types_h 11 | 12 | typedef struct sym_node_struct sym_node_t; 13 | typedef struct sym_tab_struct sym_tab_t; 14 | typedef struct pars_res_word_struct pars_res_word_t; 15 | typedef struct func_node_struct func_node_t; 16 | typedef struct order_node_struct order_node_t; 17 | typedef struct proc_node_struct proc_node_t; 18 | typedef struct call_node_struct call_node_t; 19 | typedef struct elsif_node_struct elsif_node_t; 20 | typedef struct if_node_struct if_node_t; 21 | typedef struct while_node_struct while_node_t; 22 | typedef struct for_node_struct for_node_t; 23 | typedef struct return_node_struct return_node_t; 24 | typedef struct assign_node_struct assign_node_t; 25 | typedef struct col_assign_node_struct col_assign_node_t; 26 | 27 | typedef UT_LIST_BASE_NODE_T(sym_node_t) sym_node_list_t; 28 | 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /protocol_analysis/sample_msg.def: -------------------------------------------------------------------------------- 1 | filetitle = sample_msg 2 | 3 | namespace = BASE_NAMEPSACE_DECL 4 | datatype(Inet_Addr) 5 | var SAMPLE_MSGID = 0xff000001 6 | 7 | typedef array : INT8_ARRAY 8 | typedef array : INT32_ARRAY 9 | 10 | datatype(Inet_Addr) 11 | 12 | datatype(CDesc) 13 | { 14 | int8 n_type = 0 15 | string str_desc = "" 16 | INT32_ARRAY arr_fd 17 | INT8_ARRAY arr_status 18 | } 19 | 20 | message(CSamplePacket, SAMPLE_MSGID) 21 | { 22 | uint8 msg_type = 0 23 | CDesc msg_desc 24 | } -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "syntax_analysis", "syntax_analysis\syntax_analysis.vcxproj", "{0AC4C1F9-CD4F-424D-BA18-9326AE1B9E1A}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {0AC4C1F9-CD4F-424D-BA18-9326AE1B9E1A}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {0AC4C1F9-CD4F-424D-BA18-9326AE1B9E1A}.Debug|Win32.Build.0 = Debug|Win32 14 | {0AC4C1F9-CD4F-424D-BA18-9326AE1B9E1A}.Release|Win32.ActiveCfg = Release|Win32 15 | {0AC4C1F9-CD4F-424D-BA18-9326AE1B9E1A}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis.sln.docstates.suo: -------------------------------------------------------------------------------- 1 | 2 | 3 |  -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/protocol_analysis/syntax_analysis.suo -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/base_block_handler.cpp: -------------------------------------------------------------------------------- 1 | #include "base_block_handler.h" 2 | 3 | CBaseBlockHandler::CBaseBlockHandler() 4 | { 5 | // handle_line_ = NULL; 6 | } 7 | 8 | CBaseBlockHandler::~CBaseBlockHandler() 9 | { 10 | 11 | } 12 | 13 | void CBaseBlockHandler::AnalysisBlockContent(string& str_line, int line_num) 14 | { 15 | 16 | } -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/base_block_handler.h: -------------------------------------------------------------------------------- 1 | #ifndef BASE_BLOCK_HANDLER_H_ 2 | #define BASE_BLOCK_HANDLER_H_ 3 | 4 | #include "basedefine.h" 5 | #include 6 | 7 | using namespace std; 8 | 9 | class CBaseBlockHandler 10 | { 11 | public: 12 | CBaseBlockHandler(); 13 | virtual ~CBaseBlockHandler(); 14 | 15 | public: 16 | virtual void AnalysisBlockContent(string& str_line, int line_num); 17 | string GetKeyWord(){return str_keyword_;} 18 | 19 | protected: 20 | string str_keyword_; 21 | }; 22 | #endif //BASE_BLOCK_HANDLER_H_ -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/base_error.cpp: -------------------------------------------------------------------------------- 1 | #include "base_error.h" 2 | #include 3 | 4 | CBaseError::CBaseError(int line_num /* = 0 */, string str /* = ""*/ ) : error_line_num_(line_num), 5 | error_desc_(str) 6 | { 7 | 8 | } 9 | 10 | CBaseError::~CBaseError() 11 | { 12 | 13 | } 14 | 15 | CBaseErrorHandler::CBaseErrorHandler() 16 | { 17 | 18 | } 19 | 20 | CBaseErrorHandler::~CBaseErrorHandler() 21 | { 22 | 23 | } 24 | 25 | void CBaseErrorHandler::ErrorHandle(const CBaseError& error) 26 | { 27 | std::cerr << "line:" << error.error_line_num_ << " " << error.error_desc_ << std::endl; 28 | } -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/base_error.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/protocol_analysis/syntax_analysis/base_error.h -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/base_line_handler.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/protocol_analysis/syntax_analysis/base_line_handler.cpp -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/base_line_handler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/protocol_analysis/syntax_analysis/base_line_handler.h -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/base_translator.cpp: -------------------------------------------------------------------------------- 1 | #include "base_translator.h" 2 | 3 | CBaseTranslator::CBaseTranslator() 4 | { 5 | 6 | } 7 | 8 | CBaseTranslator::~CBaseTranslator() 9 | { 10 | 11 | } 12 | 13 | void CBaseTranslator::AddFileDescToFile() 14 | { 15 | 16 | } 17 | 18 | void CBaseTranslator::AddTypeDefToFile() 19 | { 20 | 21 | } 22 | 23 | void CBaseTranslator::AddVarDefToFile() 24 | { 25 | 26 | } 27 | 28 | void CBaseTranslator::AddUserClassDef() 29 | { 30 | 31 | } 32 | 33 | void CBaseTranslator::AddMsgBodyDef() 34 | { 35 | 36 | } -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/base_translator.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/protocol_analysis/syntax_analysis/base_translator.h -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/basedefine.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/protocol_analysis/syntax_analysis/basedefine.cpp -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/basedefine.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/protocol_analysis/syntax_analysis/basedefine.h -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/cpp_translator.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/protocol_analysis/syntax_analysis/cpp_translator.cpp -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/cpp_translator.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/protocol_analysis/syntax_analysis/cpp_translator.h -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/datatype_handler.h: -------------------------------------------------------------------------------- 1 | #ifndef DATATYPE_HANDLER_H_ 2 | #define DATATYPE_HANDLER_H_ 3 | 4 | #include "base_block_handler.h" 5 | #include "basedefine.h" 6 | 7 | class CDatatypeHandler : public CBaseBlockHandler 8 | { 9 | public: 10 | CDatatypeHandler(); 11 | virtual ~CDatatypeHandler(); 12 | 13 | public: 14 | void AnalysisBlockContent(string& str_line, int line_num); 15 | 16 | private: 17 | void CheckTypeDef(string& str_line, int line_num); 18 | 19 | private: 20 | string type_name_; 21 | MemItemVec memdesc_; 22 | }; 23 | #endif //DATATYPE_HANDLER_H_ -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/file_handler.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/protocol_analysis/syntax_analysis/file_handler.cpp -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/file_handler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/protocol_analysis/syntax_analysis/file_handler.h -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/filetitle_handler.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/protocol_analysis/syntax_analysis/filetitle_handler.cpp -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/filetitle_handler.h: -------------------------------------------------------------------------------- 1 | #ifndef FILE_TITLE_HANDLER_H_ 2 | #define FILE_TITLE_HANDLER_H_ 3 | 4 | #include "base_block_handler.h" 5 | class CFileTitleHandler : public CBaseBlockHandler 6 | { 7 | public: 8 | CFileTitleHandler(); 9 | virtual ~CFileTitleHandler(); 10 | 11 | public: 12 | void AnalysisBlockContent(string& str_line, int line_num); 13 | }; 14 | #endif //FILE_TITLE_HANDLER_H_ -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/global.cpp: -------------------------------------------------------------------------------- 1 | #include "global.h" 2 | #include "cpp_translator.h" 3 | #include "lua_translator.h" 4 | #include "as_translator.h" 5 | 6 | char* g_keywords[KEYWORDNUM] = { 7 | "filetitle", 8 | "namespace", 9 | "var", 10 | "datatype", 11 | "typedef", 12 | "message" 13 | }; 14 | char* g_basedatatype[BASEDATATYPENUM] = { 15 | "int8", 16 | "int16", 17 | "int32", 18 | "int64", 19 | "uint8", 20 | "uint16", 21 | "uint32", 22 | "uint64", 23 | "char", 24 | "string", 25 | "array" 26 | }; 27 | 28 | CBaseTranslator* GenerateTranslator(string& str_objlang) 29 | { 30 | if (str_objlang == "c++" || str_objlang == "cpp") 31 | { 32 | return new CCppTranslator; 33 | } 34 | else if (str_objlang == "lua") 35 | { 36 | return new CLuaTranslator; 37 | } 38 | else if (str_objlang == "as") 39 | { 40 | return new CASTranslator; 41 | } 42 | else 43 | { 44 | return NULL; 45 | } 46 | } 47 | 48 | -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/global.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/protocol_analysis/syntax_analysis/global.h -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/lua_translator.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/protocol_analysis/syntax_analysis/lua_translator.cpp -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/lua_translator.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/protocol_analysis/syntax_analysis/lua_translator.h -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/memdesc_handler.cpp: -------------------------------------------------------------------------------- 1 | #include "memdesc_handler.h" 2 | #include "base_line_handler.h" 3 | #include "basedefine.h" 4 | #include "base_error.h" 5 | 6 | CMemItem CMemDescHandler::CheckMemDesc(string& str_line, int line_num) 7 | { 8 | StringArray v_elem; 9 | CBaseLineHandler::SplitLineWithSpace(str_line, v_elem); 10 | 11 | if (v_elem.size() != 2 && v_elem.size() != 4) 12 | { 13 | THROW_ERROR(line_num, "Error:wrong form, expected 'type var_name [= [val]]'"); 14 | } 15 | 16 | if (!(GET_DATATYPESET()->IsContainType(v_elem[0]))) 17 | { 18 | THROW_ERROR(line_num, string("Error:type ") + v_elem[0] + "not defined"); 19 | } 20 | 21 | if (!CBaseLineHandler::IsVarNameLegal(v_elem[1])) 22 | { 23 | THROW_ERROR(line_num, string("Error:") + v_elem[1] + "is bad name"); 24 | } 25 | 26 | CMemItem mem_item; 27 | mem_item.m_type = v_elem[0]; 28 | mem_item.m_name = v_elem[1]; 29 | mem_item.m_value = NONE; 30 | 31 | if (v_elem.size() == 4) 32 | { 33 | if (v_elem[2] != "=") 34 | { 35 | THROW_ERROR(line_num, "Error:bad syntax, expected a '='"); 36 | } 37 | mem_item.m_value = v_elem[3]; 38 | } 39 | 40 | return mem_item; 41 | } 42 | 43 | bool CMemDescHandler::IsMemNameNotUsed(string& str_name, MemItemVec& v_mem, int line_num) 44 | { 45 | for (MemItemVec::iterator ite = v_mem.begin(); 46 | ite != v_mem.end(); ++ite) 47 | { 48 | if (ite->m_name == str_name) 49 | { 50 | THROW_ERROR(line_num, string("Error:Redefined var name ") + str_name); 51 | } 52 | } 53 | return true; 54 | } -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/memdesc_handler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/protocol_analysis/syntax_analysis/memdesc_handler.h -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/message_handler.h: -------------------------------------------------------------------------------- 1 | #ifndef MESSAGE_HANDLER_H_ 2 | #define MESSAGE_HANDLER_H_ 3 | 4 | #include "base_block_handler.h" 5 | #include "basedefine.h" 6 | 7 | class CMessageDefHandler : public CBaseBlockHandler 8 | { 9 | public: 10 | CMessageDefHandler(); 11 | virtual ~CMessageDefHandler(); 12 | 13 | public: 14 | void AnalysisBlockContent(string& str_line, int line_num); 15 | 16 | private: 17 | void CheckMessageDef(string& str_line, int line_num); 18 | 19 | private: 20 | string msgid_; 21 | string msgname_; 22 | MemItemVec typedesc_; 23 | }; 24 | #endif //MESSAGE_HANDLER_H_ -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/namespace_handler.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/protocol_analysis/syntax_analysis/namespace_handler.cpp -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/namespace_handler.h: -------------------------------------------------------------------------------- 1 | #ifndef NAMESPACE_HANDLER_H_ 2 | #define NAMESPACE_HANDLER_H_ 3 | 4 | #include "base_block_handler.h" 5 | 6 | class CNameSpaceHandler : public CBaseBlockHandler 7 | { 8 | public: 9 | CNameSpaceHandler(); 10 | virtual ~CNameSpaceHandler(); 11 | 12 | public: 13 | void AnalysisBlockContent(string& str_line, int line_num); 14 | }; 15 | #endif //NAMESPACE_HANDLER_H_ -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/sample_msg.h: -------------------------------------------------------------------------------- 1 | #ifndef SAMPLE_MSG_H__ 2 | #define SAMPLE_MSG_H__ 3 | 4 | #include "base_packet.h" 5 | #include "core_server_type.h" 6 | #include "core_message_map_decl.h" 7 | #include "base_inet_addr.h" 8 | 9 | namespace BASE_NAMEPSACE_DECL { 10 | 11 | #define SAMPLE_MSGID 0xff000001 12 | 13 | typedef vector INT32_ARRAY; 14 | typedef vector array; 15 | 16 | 17 | class CDesc 18 | { 19 | public: 20 | CDesc() 21 | { 22 | int8_t n_type = 0; 23 | string str_desc = ""; 24 | } 25 | ~CDesc() 26 | { 27 | } 28 | public: 29 | INT32_ARRAY arr_fd; 30 | INT8_ARRAY arr_status; 31 | int8_t n_type; 32 | string str_desc; 33 | }; 34 | 35 | class CSamplePacket : public CBasePacket 36 | { 37 | public: 38 | CSamplePacket() 39 | { 40 | uint8_t msg_type = 0; 41 | } 42 | ~CSamplePacket() 43 | { 44 | } 45 | public: 46 | CDesc msg_desc; 47 | uint8_t msg_type; 48 | void Pack(BinStream& strm) const 49 | { 50 | strm << msg_desc<< msg_type; 51 | } 52 | void UnPack(BinStream& strm) const 53 | { 54 | strm >> msg_desc>> msg_type; 55 | } 56 | }; 57 | } 58 | #endif 59 | -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/singleton.cpp: -------------------------------------------------------------------------------- 1 | #include "singleton.h" 2 | 3 | 4 | -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/singleton.h: -------------------------------------------------------------------------------- 1 | #ifndef SINGLETON_H_ 2 | #define SINGLETON_H_ 3 | 4 | template 5 | class CSingleton 6 | { 7 | public: 8 | ~CSingleton() 9 | { 10 | } 11 | public: 12 | static T* CreateInstance() 13 | { 14 | return GetInstance(); 15 | } 16 | static T* GetInstance() 17 | { 18 | if (p_T_ == NULL) 19 | { 20 | return p_T_ = new T; 21 | } 22 | else 23 | { 24 | return p_T_; 25 | } 26 | } 27 | static void DestoryInstance() 28 | { 29 | if (p_T_ != NULL) 30 | { 31 | delete p_T_; 32 | p_T_ = NULL; 33 | } 34 | } 35 | private: 36 | CSingleton() 37 | { 38 | } 39 | private: 40 | static T* p_T_; 41 | }; 42 | 43 | template 44 | T* CSingleton::p_T_ = NULL; 45 | #endif //SINGLETON_H_ -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/syntax_analysis.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/typedef_handler.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/protocol_analysis/syntax_analysis/typedef_handler.cpp -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/typedef_handler.h: -------------------------------------------------------------------------------- 1 | #ifndef TYPE_DEFINE_HANDLER_H_ 2 | #define TYPE_DEFINE_HANDLER_H_ 3 | 4 | #include "base_block_handler.h" 5 | 6 | class CTypedefHandler : public CBaseBlockHandler 7 | { 8 | public: 9 | CTypedefHandler(); 10 | virtual ~CTypedefHandler(); 11 | 12 | void AnalysisBlockContent(string& str_line, int line_num); 13 | private: 14 | void CheckComplexType(string& str_type, int line_num); 15 | }; 16 | #endif //TYPE_DEFINE_HANDLER_H_ -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/var_handler.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/protocol_analysis/syntax_analysis/var_handler.cpp -------------------------------------------------------------------------------- /protocol_analysis/syntax_analysis/var_handler.h: -------------------------------------------------------------------------------- 1 | #ifndef VAR_HANDLER_H_ 2 | #define VAR_HANDLER_H_ 3 | 4 | #include "base_block_handler.h" 5 | 6 | class CVarHandler : public CBaseBlockHandler 7 | { 8 | public: 9 | CVarHandler(); 10 | virtual ~CVarHandler(); 11 | 12 | public: 13 | void AnalysisBlockContent(string& str_line, int line_num); 14 | }; 15 | #endif //VAR_HANDLER_H_ -------------------------------------------------------------------------------- /que0que.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/que0que.cc -------------------------------------------------------------------------------- /que0que.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/que0que.h -------------------------------------------------------------------------------- /que0que.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/que0que.inl -------------------------------------------------------------------------------- /que0types.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/que0types.h -------------------------------------------------------------------------------- /read0read.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/read0read.cc -------------------------------------------------------------------------------- /read0read.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/read0read.h -------------------------------------------------------------------------------- /read0read.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/read0read.inl -------------------------------------------------------------------------------- /rem0cmp.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/rem0cmp.cc -------------------------------------------------------------------------------- /rem0cmp.h: -------------------------------------------------------------------------------- 1 | #ifndef __rem0cmp_h_ 2 | #define __rem0cmp_h_ 3 | 4 | #include "univ.h" 5 | #include "data0data.h" 6 | #include "data0type.h" 7 | #include "dict0dict.h" 8 | #include "rem0rec.h" 9 | 10 | ibool cmp_types_are_equal(dtype_t* type1, dtype_t* type2); 11 | 12 | UNIV_INLINE int cmp_data_data(dtype_t* cur_type, byte* data1, ulint len1, byte* data2, ulint len2); 13 | 14 | UNIV_INLINE int cmp_dfield_dfield(dfield_t* dfield1, dfield_t* dfield2); 15 | 16 | int cmp_dtuple_rec_with_match(dtuple_t* dtuple, rec_t* rec, ulint* matched_fields, ulint* matched_bytes); 17 | 18 | int cmp_dtuple_rec(dtuple_t* dtuple, rec_t* rec); 19 | 20 | ibool cmp_dtuple_is_prefix_of_rec(dtuple_t* dtuple, rec_t* rec); 21 | 22 | ibool cmp_dtuple_rec_prefix_equal(dtuple_t* dtuple, rec_t* rec, ulint n_fields); 23 | 24 | int cmp_rec_rec_with_match(rec_t* rec1, rec_t* rec2, dict_index_t* index, ulint* matched_fields, ulint* matched_bytes); 25 | 26 | UNIV_INLINE int cmp_rec_rec(rec_t* rec1, rec_t* rec2, dict_index_t* index); 27 | 28 | #include "rem0cmp.inl" 29 | #endif 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /rem0cmp.inl: -------------------------------------------------------------------------------- 1 | 2 | int cmp_data_data_slow(dtype_t* cur_type, byte* data1, ulint len1, byte* data2, ulint len2); 3 | 4 | UNIV_INLINE int cmp_data_data(dtype_t* cur_type, byte* data1, ulint len1, byte* data2, ulint len2) 5 | { 6 | return cmp_data_data_slow(cur_type, data1, len1, data2, len2); 7 | } 8 | 9 | UNIV_INLINE int cmp_dfield_dfield(dfield_t* dfield1, dfield_t* dfield2) 10 | { 11 | ut_ad(dfield_check_typed(dfield1)); 12 | return cmp_data_data(dfield_get_type(dfield1), dfield_get_data(dfield1), dfield_get_len(dfield1), 13 | dfield_get_data(dfield2), dfield_get_len(dfield2)); 14 | } 15 | 16 | UNIV_INLINE int cmp_rec_rec(rec_t* rec1, rec_t* rec2, dict_index_t* index) 17 | { 18 | ulint match_f = 0; 19 | ulint match_b = 0; 20 | 21 | return cmp_rec_rec_with_match(rec1, rec2, index, &match_f, &match_b); 22 | } 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /rem0rec.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/rem0rec.cc -------------------------------------------------------------------------------- /rem0rec.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/rem0rec.h -------------------------------------------------------------------------------- /rem0rec.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/rem0rec.inl -------------------------------------------------------------------------------- /rem0types.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | 3 | Copyright (c) 1994, 2009, Innobase Oy. All Rights Reserved. 4 | 5 | This program is free software; you can redistribute it and/or modify it under 6 | the terms of the GNU General Public License as published by the Free Software 7 | Foundation; version 2 of the License. 8 | 9 | This program is distributed in the hope that it will be useful, but WITHOUT 10 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 12 | 13 | You should have received a copy of the GNU General Public License along with 14 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple 15 | Place, Suite 330, Boston, MA 02111-1307 USA 16 | 17 | *****************************************************************************/ 18 | 19 | #ifndef rem0types_h 20 | #define rem0types_h 21 | 22 | /* We define the physical record simply as an array of bytes */ 23 | typedef byte rec_t; 24 | 25 | /* Maximum values for various fields (for non-blob tuples) */ 26 | #define REC_MAX_N_FIELDS (1024 - 1) 27 | #define REC_MAX_HEAP_NO (2 * 8192 - 1) 28 | #define REC_MAX_N_OWNED (16 - 1) 29 | 30 | /* REC_ANTELOPE_MAX_INDEX_COL_LEN is measured in bytes and is the maximum 31 | indexed field length (or indexed prefix length) for indexes on tables of 32 | ROW_FORMAT=REDUNDANT and ROW_FORMAT=COMPACT format. 33 | Before we support UTF-8 encodings with mbmaxlen = 4, a UTF-8 character 34 | may take at most 3 bytes. So the limit was set to 3*256, so that one 35 | can create a column prefix index on 256 characters of a TEXT or VARCHAR 36 | column also in the UTF-8 charset. 37 | This constant MUST NOT BE CHANGED, or the compatibility of InnoDB data 38 | files would be at risk! */ 39 | #define REC_ANTELOPE_MAX_INDEX_COL_LEN 768 40 | 41 | /** Maximum indexed field length for table format DICT_TF_FORMAT_ZIP and 42 | beyond. 43 | This (3072) is the maximum index row length allowed, so we cannot create index 44 | prefix column longer than that. */ 45 | #define REC_VERSION_56_MAX_INDEX_COL_LEN 3072 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /row0ins.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/row0ins.cc -------------------------------------------------------------------------------- /row0ins.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/row0ins.h -------------------------------------------------------------------------------- /row0purge.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/row0purge.cc -------------------------------------------------------------------------------- /row0purge.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/row0purge.h -------------------------------------------------------------------------------- /row0row.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/row0row.cc -------------------------------------------------------------------------------- /row0row.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/row0row.inl -------------------------------------------------------------------------------- /row0sel.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/row0sel.cc -------------------------------------------------------------------------------- /row0sel.inl: -------------------------------------------------------------------------------- 1 | /****************************************************** 2 | Select 3 | 4 | (c) 1997 Innobase Oy 5 | 6 | Created 12/19/1997 Heikki Tuuri 7 | *******************************************************/ 8 | 9 | #include "que0que.h" 10 | 11 | /************************************************************************* 12 | Gets the plan node for the nth table in a join. */ 13 | UNIV_INLINE 14 | plan_t* 15 | sel_node_get_nth_plan( 16 | /*==================*/ 17 | /* out: plan node */ 18 | sel_node_t* node, /* in: select node */ 19 | ulint i) /* in: get ith plan node */ 20 | { 21 | ut_ad(i < node->n_tables); 22 | 23 | return(node->plans + i); 24 | } 25 | 26 | /************************************************************************* 27 | Resets the cursor defined by sel_node to the SEL_NODE_OPEN state, which means 28 | that it will start fetching from the start of the result set again, regardless 29 | of where it was before, and it will set intention locks on the tables. */ 30 | UNIV_INLINE 31 | void 32 | sel_node_reset_cursor( 33 | /*==================*/ 34 | sel_node_t* node) /* in: select node */ 35 | { 36 | node->state = SEL_NODE_OPEN; 37 | } 38 | 39 | /************************************************************************** 40 | Performs an execution step of an open or close cursor statement node. */ 41 | UNIV_INLINE 42 | que_thr_t* 43 | open_step( 44 | /*======*/ 45 | /* out: query thread to run next or NULL */ 46 | que_thr_t* thr) /* in: query thread */ 47 | { 48 | sel_node_t* sel_node; 49 | open_node_t* node; 50 | ulint err; 51 | 52 | ut_ad(thr); 53 | 54 | node = thr->run_node; 55 | ut_ad(que_node_get_type(node) == QUE_NODE_OPEN); 56 | 57 | sel_node = node->cursor_def; 58 | 59 | err = DB_SUCCESS; 60 | 61 | if (node->op_type == ROW_SEL_OPEN_CURSOR) { 62 | 63 | /* if (sel_node->state == SEL_NODE_CLOSED) { */ 64 | 65 | sel_node_reset_cursor(sel_node); 66 | /* } else { 67 | err = DB_ERROR; 68 | } */ 69 | } else { 70 | if (sel_node->state != SEL_NODE_CLOSED) { 71 | 72 | sel_node->state = SEL_NODE_CLOSED; 73 | } else { 74 | err = DB_ERROR; 75 | } 76 | } 77 | 78 | if (err != DB_SUCCESS) { 79 | /* SQL error detected */ 80 | printf("SQL error %lu\n", err); 81 | 82 | ut_error; 83 | que_thr_handle_error(thr, err, NULL, 0); 84 | 85 | return(NULL); 86 | } 87 | 88 | thr->run_node = que_node_get_parent(node); 89 | 90 | return(thr); 91 | } 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /row0types.h: -------------------------------------------------------------------------------- 1 | /****************************************************** 2 | Row operation global types 3 | 4 | (c) 1996 Innobase Oy 5 | 6 | Created 12/27/1996 Heikki Tuuri 7 | *******************************************************/ 8 | 9 | #ifndef row0types_h 10 | #define row0types_h 11 | 12 | typedef struct plan_struct plan_t; 13 | 14 | typedef struct upd_struct upd_t; 15 | 16 | typedef struct upd_field_struct upd_field_t; 17 | 18 | typedef struct upd_node_struct upd_node_t; 19 | 20 | typedef struct del_node_struct del_node_t; 21 | 22 | typedef struct ins_node_struct ins_node_t; 23 | 24 | typedef struct sel_node_struct sel_node_t; 25 | 26 | typedef struct open_node_struct open_node_t; 27 | 28 | typedef struct fetch_node_struct fetch_node_t; 29 | 30 | typedef struct row_printf_node_struct row_printf_node_t; 31 | typedef struct sel_buf_struct sel_buf_t; 32 | 33 | typedef struct undo_node_struct undo_node_t; 34 | 35 | typedef struct purge_node_struct purge_node_t; 36 | 37 | #endif 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /row0uins.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/row0uins.cc -------------------------------------------------------------------------------- /row0uins.h: -------------------------------------------------------------------------------- 1 | #ifndef __row0uins_h_ 2 | #define __row0uins_h_ 3 | 4 | #include "univ.h" 5 | #include "data0data.h" 6 | #include "dict0types.h" 7 | #include "trx0types.h" 8 | #include "que0types.h" 9 | #include "row0types.h" 10 | #include "mtr0mtr.h" 11 | 12 | ulint row_undo_ins(undo_node_t* node, que_thr_t* thr); 13 | 14 | #endif 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /row0umod.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/row0umod.cc -------------------------------------------------------------------------------- /row0umod.h: -------------------------------------------------------------------------------- 1 | #ifndef __row0umod_h_ 2 | #define __row0umod_h_ 3 | 4 | #include "univ.h" 5 | #include "data0data.h" 6 | #include "dict0types.h" 7 | #include "trx0types.h" 8 | #include "que0types.h" 9 | #include "row0types.h" 10 | #include "mtr0mtr.h" 11 | 12 | ulint row_undo_mod(undo_node_t* node, que_thr_t* thr); 13 | 14 | #endif 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /row0undo.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/row0undo.cc -------------------------------------------------------------------------------- /row0undo.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/row0undo.h -------------------------------------------------------------------------------- /row0upd.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/row0upd.cc -------------------------------------------------------------------------------- /row0upd.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/row0upd.h -------------------------------------------------------------------------------- /row0upd.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/row0upd.inl -------------------------------------------------------------------------------- /row0vers.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/row0vers.cc -------------------------------------------------------------------------------- /row0vers.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/row0vers.h -------------------------------------------------------------------------------- /srv0que.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/srv0que.cc -------------------------------------------------------------------------------- /srv0que.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/srv0que.h -------------------------------------------------------------------------------- /srv0srv.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/srv0srv.cc -------------------------------------------------------------------------------- /srv0srv.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/srv0srv.h -------------------------------------------------------------------------------- /srv0start.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/srv0start.cc -------------------------------------------------------------------------------- /srv0start.h: -------------------------------------------------------------------------------- 1 | #ifndef __srv0start_h_ 2 | #define __srv0start_h_ 3 | 4 | #include "univ.h" 5 | 6 | #define SRV_SHUTDOWN_CLEANUP 1 7 | #define SRV_SHUTDOWN_LAST_PHASE 2 8 | 9 | void srv_normalize_path_for_win(char* str); 10 | 11 | char* srv_add_path_separator_if_needed(char* str); 12 | 13 | ibool srv_parse_data_file_paths_and_sizes(char* str, char*** data_file_names, ulint** data_file_sizes, ulint** data_file_is_raw_partition 14 | ulint* n_data_files, ibool* is_auto_extending, ulint* max_auto_extend_size); 15 | 16 | ibool srv_parse_log_group_home_dirs(char* str, char*** log_group_home_dirs); 17 | 18 | int innobase_start_or_create_for_mysql(); 19 | 20 | int innobase_shutdown_for_mysql(); 21 | 22 | 23 | extern ibool srv_startup_is_before_trx_rollback_phase; 24 | extern ibool srv_is_being_shut_down; 25 | 26 | #endif 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /sync0arr.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/sync0arr.cc -------------------------------------------------------------------------------- /sync0arr.h: -------------------------------------------------------------------------------- 1 | #ifndef sync0arr_h 2 | #define sync0arr_h 3 | 4 | #include "univ.h" 5 | #include "ut0lst.h" 6 | #include "ut0mem.h" 7 | #include "os0thread.h" 8 | 9 | typedef struct sync_cell_struct sync_cell_t; 10 | typedef struct sync_array_struct sync_array_t; 11 | 12 | #define SYNC_ARRAY_OS_MUTEX 1 13 | #define SYNC_ARRAY_MUTEX 2 14 | 15 | sync_array_t* sync_array_create(ulint n_cells, ulint protecton); 16 | 17 | void sync_array_free(sync_array_t* arr); 18 | 19 | void sync_array_reserve_cell(sync_array_t* arr, void* object, ulint type, char* file, ulint line, ulint* index); 20 | 21 | void sync_array_wait_event(sync_array_t* arr, ulint index); 22 | 23 | void sync_array_free_cell(sync_array_t* arr, ulint index); 24 | 25 | void sync_array_signal_object(sync_array_t* arr, void* object); 26 | 27 | void sync_arr_wake_threads_if_sema_free(); 28 | 29 | void sync_array_validate(sync_array_t* arr); 30 | 31 | void sync_array_print_info(char* buf, char* buf_end, sync_array_t* arr); 32 | 33 | #endif 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /sync0rw.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/sync0rw.cc -------------------------------------------------------------------------------- /sync0rw.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/sync0rw.h -------------------------------------------------------------------------------- /sync0sync.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/sync0sync.cc -------------------------------------------------------------------------------- /sync0sync.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/sync0sync.h -------------------------------------------------------------------------------- /sync0types.h: -------------------------------------------------------------------------------- 1 | #ifndef __SYNC0TYPES_H_ 2 | #define __SYNC0TYPES_H_ 3 | 4 | typedef struct mutex_struct mutex_t; 5 | typedef struct mutex_struct ib_mutex_t; 6 | 7 | #endif 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/rudp_reciver/rudp_reciver.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rudp_reciver", "rudp_reciver\rudp_reciver.vcxproj", "{96A0325B-236A-4A04-AF26-8886A74FEA99}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {96A0325B-236A-4A04-AF26-8886A74FEA99}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {96A0325B-236A-4A04-AF26-8886A74FEA99}.Debug|Win32.Build.0 = Debug|Win32 14 | {96A0325B-236A-4A04-AF26-8886A74FEA99}.Release|Win32.ActiveCfg = Release|Win32 15 | {96A0325B-236A-4A04-AF26-8886A74FEA99}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /test/rudp_reciver/rudp_reciver/reciver_adapter.cpp: -------------------------------------------------------------------------------- 1 | #include "reciver_adapter.h" 2 | #include "udp_handler.h" 3 | 4 | ReciverAdapter::ReciverAdapter() 5 | { 6 | 7 | } 8 | 9 | ReciverAdapter::~ReciverAdapter() 10 | { 11 | 12 | } 13 | 14 | void ReciverAdapter::send(BinStream& strm, const Inet_Addr& remote_addr) 15 | { 16 | if(RECV_UDP()->is_open()) 17 | RECV_UDP()->send(strm, remote_addr); 18 | } 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/rudp_reciver/rudp_reciver/reciver_adapter.h: -------------------------------------------------------------------------------- 1 | #ifndef __RECIVER_ADAPTER_H_ 2 | #define __RECIVER_ADAPTER_H_ 3 | 4 | #include "rudp/rudp_adapter.h" 5 | 6 | using namespace BASE; 7 | 8 | class ReciverAdapter : public IRUDPAdapter 9 | { 10 | public: 11 | ReciverAdapter(); 12 | virtual ~ReciverAdapter(); 13 | 14 | virtual void send(BinStream& strm, const Inet_Addr& remote_addr); 15 | }; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /test/rudp_reciver/rudp_reciver/reciver_thread.cpp: -------------------------------------------------------------------------------- 1 | #include "revolver/base_reactor_instance.h" 2 | #include "reciver_thread.h" 3 | 4 | RecvThread::RecvThread() 5 | { 6 | 7 | } 8 | 9 | RecvThread::~RecvThread() 10 | { 11 | 12 | } 13 | 14 | void RecvThread::execute() 15 | { 16 | while(!get_terminated()) 17 | { 18 | REACTOR_INSTANCE()->event_loop(); 19 | } 20 | 21 | REACTOR_INSTANCE()->stop_event_loop(); 22 | 23 | clear_thread(); 24 | } 25 | 26 | -------------------------------------------------------------------------------- /test/rudp_reciver/rudp_reciver/reciver_thread.h: -------------------------------------------------------------------------------- 1 | #ifndef __RECIVER_THREAD_H_ 2 | #define __RECIVER_THREAD_H_ 3 | 4 | #include "revolver/base_namespace.h" 5 | #include "revolver/base_typedef.h" 6 | #include "revolver/base_thread.h" 7 | #include "revolver/base_singleton.h" 8 | 9 | using namespace BASE; 10 | 11 | class RecvThread : public CThread 12 | { 13 | public: 14 | RecvThread(); 15 | virtual ~RecvThread(); 16 | 17 | void execute(); 18 | }; 19 | 20 | #define CREATE_RECV_THREAD CSingleton::instance 21 | #define RECV_THREAD CSingleton::instance 22 | #define DESTROY_RECV_THREAD CSingleton::destroy 23 | 24 | #endif 25 | 26 | 27 | -------------------------------------------------------------------------------- /test/rudp_reciver/rudp_reciver/rudp_connection.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/rudp_reciver/rudp_reciver/rudp_connection.cpp -------------------------------------------------------------------------------- /test/rudp_reciver/rudp_reciver/rudp_connection.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/rudp_reciver/rudp_reciver/rudp_connection.h -------------------------------------------------------------------------------- /test/rudp_reciver/rudp_reciver/rudp_listen_handler.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/rudp_reciver/rudp_reciver/rudp_listen_handler.cpp -------------------------------------------------------------------------------- /test/rudp_reciver/rudp_reciver/rudp_listen_handler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/rudp_reciver/rudp_reciver/rudp_listen_handler.h -------------------------------------------------------------------------------- /test/rudp_reciver/rudp_reciver/rudp_reciver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/rudp_reciver/rudp_reciver/rudp_reciver.cpp -------------------------------------------------------------------------------- /test/rudp_reciver/rudp_reciver/rudp_reciver.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | 38 | 39 | Header Files 40 | 41 | 42 | Header Files 43 | 44 | 45 | Header Files 46 | 47 | 48 | Header Files 49 | 50 | 51 | Header Files 52 | 53 | 54 | -------------------------------------------------------------------------------- /test/rudp_reciver/rudp_reciver/rudp_reciver.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ../../../bin/debug/rudp_reciver/reciver.exe 5 | 6 | 7 | ../../../bin/debug/rudp_reciver 8 | WindowsLocalDebugger 9 | 10 | -------------------------------------------------------------------------------- /test/rudp_reciver/rudp_reciver/udp_handler.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/rudp_reciver/rudp_reciver/udp_handler.cpp -------------------------------------------------------------------------------- /test/rudp_reciver/rudp_reciver/udp_handler.h: -------------------------------------------------------------------------------- 1 | #ifndef __RECIVER_UDP_HANDLER_H_ 2 | #define __RECIVER_UDP_HANDLER_H_ 3 | 4 | #include "revolver/base_event_handler.h" 5 | #include "revolver/base_sock_dgram.h" 6 | #include "revolver/base_bin_stream.h" 7 | #include "revolver/base_singleton.h" 8 | #include "reciver_adapter.h" 9 | 10 | using namespace BASE; 11 | 12 | class RecvUDPHandler : public CEventHandler 13 | { 14 | public: 15 | RecvUDPHandler(); 16 | virtual ~RecvUDPHandler(); 17 | 18 | bool is_open() const; 19 | 20 | int32_t open(const Inet_Addr& local_addr); 21 | int32_t close(); 22 | int32_t send(BinStream& bin_strm, const Inet_Addr& remote_addr); 23 | 24 | BASE_HANDLER get_handle() const; 25 | 26 | virtual int32_t handle_input(BASE_HANDLER handle); 27 | virtual int32_t handle_output(BASE_HANDLER handle); 28 | virtual int32_t handle_close(BASE_HANDLER handle, ReactorMask close_mask); 29 | virtual int32_t handle_exception(BASE_HANDLER handle); 30 | 31 | protected: 32 | BinStream bin_strm_; 33 | CSockDgram sock_dgram_; 34 | ReciverAdapter adapter_; 35 | }; 36 | 37 | #define CREATE_RECV_UDP CSingleton::instance 38 | #define RECV_UDP CSingleton::instance 39 | #define DESTROY_RECV_UDP CSingleton::destroy 40 | 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /test/rudp_sender/rudp_sender.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rudp_sender", "rudp_sender\rudp_reciver.vcxproj", "{96A0325B-236A-4A04-AF26-8886A74FEA99}" 5 | EndProject 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{96E7E530-4479-43E5-A084-2121DC32955E}" 7 | ProjectSection(SolutionItems) = preProject 8 | Performance1.psess = Performance1.psess 9 | EndProjectSection 10 | EndProject 11 | Global 12 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 13 | Debug|Win32 = Debug|Win32 14 | Release|Win32 = Release|Win32 15 | EndGlobalSection 16 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 17 | {96A0325B-236A-4A04-AF26-8886A74FEA99}.Debug|Win32.ActiveCfg = Debug|Win32 18 | {96A0325B-236A-4A04-AF26-8886A74FEA99}.Debug|Win32.Build.0 = Debug|Win32 19 | {96A0325B-236A-4A04-AF26-8886A74FEA99}.Release|Win32.ActiveCfg = Release|Win32 20 | {96A0325B-236A-4A04-AF26-8886A74FEA99}.Release|Win32.Build.0 = Release|Win32 21 | EndGlobalSection 22 | GlobalSection(SolutionProperties) = preSolution 23 | HideSolutionNode = FALSE 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /test/rudp_sender/rudp_sender/reciver_adapter.cpp: -------------------------------------------------------------------------------- 1 | #include "reciver_adapter.h" 2 | #include "udp_handler.h" 3 | 4 | ReciverAdapter::ReciverAdapter() 5 | { 6 | 7 | } 8 | 9 | ReciverAdapter::~ReciverAdapter() 10 | { 11 | 12 | } 13 | 14 | void ReciverAdapter::send(BinStream& strm, const Inet_Addr& remote_addr) 15 | { 16 | if(RECV_UDP()->is_open()) 17 | RECV_UDP()->send(strm, remote_addr); 18 | } 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/rudp_sender/rudp_sender/reciver_adapter.h: -------------------------------------------------------------------------------- 1 | #ifndef __RECIVER_ADAPTER_H_ 2 | #define __RECIVER_ADAPTER_H_ 3 | 4 | #include "rudp/rudp_adapter.h" 5 | 6 | using namespace BASE; 7 | 8 | class ReciverAdapter : public IRUDPAdapter 9 | { 10 | public: 11 | ReciverAdapter(); 12 | virtual ~ReciverAdapter(); 13 | 14 | virtual void send(BinStream& strm, const Inet_Addr& remote_addr); 15 | }; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /test/rudp_sender/rudp_sender/reciver_thread.cpp: -------------------------------------------------------------------------------- 1 | #include "revolver/base_reactor_instance.h" 2 | #include "reciver_thread.h" 3 | 4 | RecvThread::RecvThread() 5 | { 6 | 7 | } 8 | 9 | RecvThread::~RecvThread() 10 | { 11 | 12 | } 13 | 14 | void RecvThread::execute() 15 | { 16 | while(!get_terminated()) 17 | { 18 | REACTOR_INSTANCE()->event_loop(); 19 | } 20 | 21 | REACTOR_INSTANCE()->stop_event_loop(); 22 | 23 | clear_thread(); 24 | } 25 | 26 | -------------------------------------------------------------------------------- /test/rudp_sender/rudp_sender/reciver_thread.h: -------------------------------------------------------------------------------- 1 | #ifndef __RECIVER_THREAD_H_ 2 | #define __RECIVER_THREAD_H_ 3 | 4 | #include "revolver/base_namespace.h" 5 | #include "revolver/base_typedef.h" 6 | #include "revolver/base_thread.h" 7 | #include "revolver/base_singleton.h" 8 | 9 | using namespace BASE; 10 | 11 | class RecvThread : public CThread 12 | { 13 | public: 14 | RecvThread(); 15 | virtual ~RecvThread(); 16 | 17 | void execute(); 18 | }; 19 | 20 | #define CREATE_RECV_THREAD CSingleton::instance 21 | #define RECV_THREAD CSingleton::instance 22 | #define DESTROY_RECV_THREAD CSingleton::destroy 23 | 24 | #endif 25 | 26 | 27 | -------------------------------------------------------------------------------- /test/rudp_sender/rudp_sender/rudp_connection.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/rudp_sender/rudp_sender/rudp_connection.cpp -------------------------------------------------------------------------------- /test/rudp_sender/rudp_sender/rudp_connection.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/rudp_sender/rudp_sender/rudp_connection.h -------------------------------------------------------------------------------- /test/rudp_sender/rudp_sender/rudp_listen_handler.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/rudp_sender/rudp_sender/rudp_listen_handler.cpp -------------------------------------------------------------------------------- /test/rudp_sender/rudp_sender/rudp_listen_handler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/rudp_sender/rudp_sender/rudp_listen_handler.h -------------------------------------------------------------------------------- /test/rudp_sender/rudp_sender/rudp_reciver.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/rudp_sender/rudp_sender/rudp_reciver.cpp -------------------------------------------------------------------------------- /test/rudp_sender/rudp_sender/rudp_reciver.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | 38 | 39 | Header Files 40 | 41 | 42 | Header Files 43 | 44 | 45 | Header Files 46 | 47 | 48 | Header Files 49 | 50 | 51 | Header Files 52 | 53 | 54 | -------------------------------------------------------------------------------- /test/rudp_sender/rudp_sender/rudp_reciver.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ../../../bin/debug/rudp_sender/rudp_sender.exe 5 | 6 | 7 | ../../../bin/debug/rudp_sender 8 | WindowsLocalDebugger 9 | 10 | -------------------------------------------------------------------------------- /test/rudp_sender/rudp_sender/udp_handler.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/rudp_sender/rudp_sender/udp_handler.cpp -------------------------------------------------------------------------------- /test/rudp_sender/rudp_sender/udp_handler.h: -------------------------------------------------------------------------------- 1 | #ifndef __RECIVER_UDP_HANDLER_H_ 2 | #define __RECIVER_UDP_HANDLER_H_ 3 | 4 | #include "revolver/base_event_handler.h" 5 | #include "revolver/base_sock_dgram.h" 6 | #include "revolver/base_bin_stream.h" 7 | #include "revolver/base_singleton.h" 8 | #include "reciver_adapter.h" 9 | 10 | using namespace BASE; 11 | 12 | class RecvUDPHandler : public CEventHandler 13 | { 14 | public: 15 | RecvUDPHandler(); 16 | virtual ~RecvUDPHandler(); 17 | 18 | bool is_open() const; 19 | 20 | int32_t open(const Inet_Addr& local_addr); 21 | int32_t close(); 22 | int32_t send(BinStream& bin_strm, const Inet_Addr& remote_addr); 23 | 24 | BASE_HANDLER get_handle() const; 25 | 26 | virtual int32_t handle_input(BASE_HANDLER handle); 27 | virtual int32_t handle_output(BASE_HANDLER handle); 28 | virtual int32_t handle_close(BASE_HANDLER handle, ReactorMask close_mask); 29 | virtual int32_t handle_exception(BASE_HANDLER handle); 30 | 31 | protected: 32 | BinStream bin_strm_; 33 | CSockDgram sock_dgram_; 34 | ReciverAdapter adapter_; 35 | }; 36 | 37 | #define CREATE_RECV_UDP CSingleton::instance 38 | #define RECV_UDP CSingleton::instance 39 | #define DESTROY_RECV_UDP CSingleton::destroy 40 | 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /test/sample_server/sample_frame.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/sample_server/sample_frame.cpp -------------------------------------------------------------------------------- /test/sample_server/sample_frame.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/sample_server/sample_frame.h -------------------------------------------------------------------------------- /test/sample_server/sample_log_macro.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/sample_server/sample_log_macro.cpp -------------------------------------------------------------------------------- /test/sample_server/sample_log_macro.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/sample_server/sample_log_macro.h -------------------------------------------------------------------------------- /test/sample_server/sample_server.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/sample_server/sample_server.cpp -------------------------------------------------------------------------------- /test/sample_server/sample_server.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/sample_server/sample_server.h -------------------------------------------------------------------------------- /test/sample_server/sample_server.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample_server", "sample_server.vcxproj", "{44C8E6AF-19A3-4F59-B7C3-8BE22B91C22A}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {44C8E6AF-19A3-4F59-B7C3-8BE22B91C22A}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {44C8E6AF-19A3-4F59-B7C3-8BE22B91C22A}.Debug|Win32.Build.0 = Debug|Win32 14 | {44C8E6AF-19A3-4F59-B7C3-8BE22B91C22A}.Release|Win32.ActiveCfg = Release|Win32 15 | {44C8E6AF-19A3-4F59-B7C3-8BE22B91C22A}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /test/sample_server/sample_server.sln.docstates.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/sample_server/sample_server.sln.docstates.suo -------------------------------------------------------------------------------- /test/sample_server/sample_server.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/sample_server/sample_server.suo -------------------------------------------------------------------------------- /test/sample_server/sample_server.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | 32 | 33 | Header Files 34 | 35 | 36 | Header Files 37 | 38 | 39 | Header Files 40 | 41 | 42 | 43 | 44 | Resource Files 45 | 46 | 47 | -------------------------------------------------------------------------------- /test/sample_server/sample_server.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /test/sample_server/server.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/sample_server/server.cpp -------------------------------------------------------------------------------- /test/test.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "test\test.vcxproj", "{BD79A81B-00A4-4175-8382-0361A24D804A}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {BD79A81B-00A4-4175-8382-0361A24D804A}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {BD79A81B-00A4-4175-8382-0361A24D804A}.Debug|Win32.Build.0 = Debug|Win32 14 | {BD79A81B-00A4-4175-8382-0361A24D804A}.Release|Win32.ActiveCfg = Release|Win32 15 | {BD79A81B-00A4-4175-8382-0361A24D804A}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /test/test.sln.docstates.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/test.sln.docstates.suo -------------------------------------------------------------------------------- /test/test.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/test.suo -------------------------------------------------------------------------------- /test/test/core_test.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/test/core_test.cpp -------------------------------------------------------------------------------- /test/test/core_test.h: -------------------------------------------------------------------------------- 1 | #ifndef __CORE_TEST_H 2 | #define __CORE_TEST_H 3 | 4 | void test_message_map(); 5 | void test_message_call(); 6 | void test_message_call2(); 7 | void test_core_udp(); 8 | void test_core_tcp_server(); 9 | #endif 10 | -------------------------------------------------------------------------------- /test/test/test.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/test/test.cpp -------------------------------------------------------------------------------- /test/test/test.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | 35 | 36 | Header Files 37 | 38 | 39 | Header Files 40 | 41 | 42 | Header Files 43 | 44 | 45 | Header Files 46 | 47 | 48 | Header Files 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /test/test/test.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | C:\projects\open_source\revolver\bin\debug\test\test.exe 5 | 6 | 7 | C:\projects\open_source\revolver\bin\debug\test\ 8 | WindowsLocalDebugger 9 | 10 | -------------------------------------------------------------------------------- /test/test/test_body.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/test/test_body.cpp -------------------------------------------------------------------------------- /test/test/test_body.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/test/test_body.h -------------------------------------------------------------------------------- /test/test/test_select.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/test/test_select.cpp -------------------------------------------------------------------------------- /test/test/test_select.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/test/test_select.h -------------------------------------------------------------------------------- /test/test/test_tcp_delay.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/test/test_tcp_delay.cpp -------------------------------------------------------------------------------- /test/test/test_tcp_delay.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/test/test/test_tcp_delay.h -------------------------------------------------------------------------------- /thr0loc.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/thr0loc.cc -------------------------------------------------------------------------------- /thr0loc.h: -------------------------------------------------------------------------------- 1 | #ifndef thr0loc_h 2 | #define thr0loc_h 3 | 4 | #include "univ.h" 5 | #include "os0thread.h" 6 | 7 | void thr_local_init(); 8 | 9 | void thr_local_create(); 10 | 11 | void local_free(os_thread_id_t id); 12 | 13 | ulint thr_local_get_slot_no(os_thread_id_t id); 14 | 15 | void thr_local_set_slot_no(os_thread_id_t id, ulint slot_no); 16 | 17 | ibool* thr_local_get_in_ibuf_field(); 18 | #endif 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /trx0purge.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/trx0purge.cc -------------------------------------------------------------------------------- /trx0purge.h: -------------------------------------------------------------------------------- 1 | #ifndef __trx0purge_h_ 2 | #define __trx0purge_h_ 3 | 4 | #include "univ.h" 5 | #include "trx0types.h" 6 | #include "mtr0mtr.h" 7 | #include "trx0sys.h" 8 | #include "que0types.h" 9 | #include "page0page.h" 10 | #include "usr0sess.h" 11 | #include "fil0fil.h" 12 | 13 | extern trx_purge_t* purge_sys; 14 | 15 | extern trx_undo_rec_t trx_purge_dummy_rec; 16 | 17 | #define TRX_PURGE_ON 1 18 | #define TRX_STOP_PURGE 2 19 | 20 | struct trx_purge_struct 21 | { 22 | ulint state; 23 | sess_t* sess; 24 | trx_t* trx; 25 | que_t* query; 26 | rw_lock_t* purge_is_running; 27 | rw_lock_t* latch; 28 | read_view_t* view; 29 | mutex_t mutex; 30 | 31 | ulint n_pages_handled; 32 | ulint handle_limit; 33 | dulint purge_trx_no; 34 | dulint purge_undo_no; 35 | 36 | ibool next_stored; 37 | trx_rseg_t* rseg; 38 | ulint page_no; 39 | ulint offset; 40 | ulint hdr_page_no; 41 | ulint hdr_offset; 42 | 43 | trx_undo_arr_t* arr; 44 | 45 | mem_heap_t* heap; 46 | }; 47 | 48 | UNIV_INLINE fil_addr_t trx_purge_get_log_from_hist(fil_addr_t node_addr); 49 | 50 | ibool trx_purge_update_undo_must_exist(dulint trx_id); 51 | 52 | void trx_purge_sys_create(); 53 | 54 | void trx_purge_add_update_undo_to_history(trx_t* trx, page_t* undo_page, mtr_t* mtr); 55 | 56 | trx_undo_rec_t* trx_purge_fetch_next_rec(dulint* roll_ptr, trx_undo_inf_t** cell, mem_heap_t* heap); 57 | 58 | void trx_purge_rec_release(trx_undo_inf_t* cell); 59 | 60 | ulint trx_purge(); 61 | 62 | void trx_purge_sys_print(); 63 | 64 | #include "trx0purge.inl" 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /trx0purge.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/trx0purge.inl -------------------------------------------------------------------------------- /trx0rec.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/trx0rec.cc -------------------------------------------------------------------------------- /trx0rec.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/trx0rec.inl -------------------------------------------------------------------------------- /trx0roll.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/trx0roll.cc -------------------------------------------------------------------------------- /trx0roll.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/trx0roll.h -------------------------------------------------------------------------------- /trx0rseg.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/trx0rseg.cc -------------------------------------------------------------------------------- /trx0rseg.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/trx0rseg.h -------------------------------------------------------------------------------- /trx0rseg.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/trx0rseg.inl -------------------------------------------------------------------------------- /trx0sys.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/trx0sys.c -------------------------------------------------------------------------------- /trx0sys.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/trx0sys.h -------------------------------------------------------------------------------- /trx0sys.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/trx0sys.inl -------------------------------------------------------------------------------- /trx0trx.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/trx0trx.cc -------------------------------------------------------------------------------- /trx0trx.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/trx0trx.inl -------------------------------------------------------------------------------- /trx0types.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/trx0types.h -------------------------------------------------------------------------------- /trx0undo.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/trx0undo.cc -------------------------------------------------------------------------------- /trx0undo.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/trx0undo.h -------------------------------------------------------------------------------- /trx0undo.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/trx0undo.inl -------------------------------------------------------------------------------- /ul0crc32.h: -------------------------------------------------------------------------------- 1 | #ifndef ut0crc32_h 2 | #define ut0crc32_h 3 | 4 | #include "univ.h" 5 | 6 | UNIV_INTERNvoid ut_crc32_init(); 7 | 8 | typedef ib_uint32_t (*ib_ut_crc32_t)(const byte* ptr, ulint len); 9 | 10 | extern ib_ut_crc32_t ut_crc32; 11 | 12 | extern bool ut_crc32_sse2_enabled; 13 | 14 | #endif 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /usr0types.h: -------------------------------------------------------------------------------- 1 | #ifndef usr0types_h 2 | #define usr0types_h 3 | 4 | typedef struct sess_struct sess_t; 5 | typedef struct sess_sys_struct sess_sys_t; 6 | typedef struct sess_sig_struct sess_sig_t; 7 | 8 | #endif 9 | 10 | 11 | -------------------------------------------------------------------------------- /ut0bh.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/ut0bh.cc -------------------------------------------------------------------------------- /ut0bh.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/ut0bh.h -------------------------------------------------------------------------------- /ut0byte.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/ut0byte.cc -------------------------------------------------------------------------------- /ut0byte.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/ut0byte.h -------------------------------------------------------------------------------- /ut0list.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/ut0list.cc -------------------------------------------------------------------------------- /ut0list.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/ut0list.h -------------------------------------------------------------------------------- /ut0lst.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/ut0lst.h -------------------------------------------------------------------------------- /ut0mem.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/ut0mem.cc -------------------------------------------------------------------------------- /ut0mem.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/ut0mem.h -------------------------------------------------------------------------------- /ut0rbt.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/ut0rbt.cc -------------------------------------------------------------------------------- /ut0rbt.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/ut0rbt.h -------------------------------------------------------------------------------- /ut0ut.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/ut0ut.h -------------------------------------------------------------------------------- /ut0vec.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/ut0vec.cc -------------------------------------------------------------------------------- /ut0vec.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/ut0vec.h -------------------------------------------------------------------------------- /ut0wqueque.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/ut0wqueque.h -------------------------------------------------------------------------------- /ut0wqueue.cc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/ut0wqueue.cc --------------------------------------------------------------------------------