code
stringlengths
4
1.01M
/* vi: set sw=4 ts=4: */ /* * reformime: parse MIME-encoded message * * Copyright (C) 2008 by Vladimir Dronnikov <dronnikov@gmail.com> * * Licensed under GPLv2, see file LICENSE in this source tree. */ //kbuild:lib-$(CONFIG_REFORMIME) += reformime.o mail.o #include "libbb.h" #include "mail.h" #if 0 # define dbg_error_msg(...) bb_error_msg(__VA_ARGS__) #else # define dbg_error_msg(...) ((void)0) #endif static const char *find_token(const char *const string_array[], const char *key, const char *defvalue) { const char *r = NULL; int i; for (i = 0; string_array[i] != NULL; i++) { if (strcasecmp(string_array[i], key) == 0) { r = (char *)string_array[i+1]; break; } } return (r) ? r : defvalue; } static const char *xfind_token(const char *const string_array[], const char *key) { const char *r = find_token(string_array, key, NULL); if (r) return r; bb_error_msg_and_die("not found: '%s'", key); } enum { OPT_x = 1 << 0, OPT_X = 1 << 1, #if ENABLE_FEATURE_REFORMIME_COMPAT OPT_d = 1 << 2, OPT_e = 1 << 3, OPT_i = 1 << 4, OPT_s = 1 << 5, OPT_r = 1 << 6, OPT_c = 1 << 7, OPT_m = 1 << 8, OPT_h = 1 << 9, OPT_o = 1 << 10, OPT_O = 1 << 11, #endif }; static int parse(const char *boundary, char **argv) { int boundary_len = strlen(boundary); char uniq[sizeof("%%llu.%u") + sizeof(int)*3]; dbg_error_msg("BOUNDARY[%s]", boundary); // prepare unique string pattern sprintf(uniq, "%%llu.%u", (unsigned)getpid()); dbg_error_msg("UNIQ[%s]", uniq); while (1) { char *header; const char *tokens[32]; /* 32 is enough */ const char *type; /* Read the header (everything up to two \n) */ { unsigned header_idx = 0; int last_ch = 0; header = NULL; while (1) { int ch = fgetc(stdin); if (ch == '\r') /* Support both line endings */ continue; if (ch == EOF) break; if (ch == '\n' && last_ch == ch) break; if (!(header_idx & 0xff)) header = xrealloc(header, header_idx + 0x101); header[header_idx++] = last_ch = ch; } if (!header) { dbg_error_msg("EOF"); break; } header[header_idx] = '\0'; dbg_error_msg("H:'%s'", p); } /* Split to tokens */ { char *s, *p; unsigned ntokens; const char *delims = ";=\" \t\n"; /* Skip to last Content-Type: */ s = p = header; while ((p = strchr(p, '\n')) != NULL) { p++; if (strncasecmp(p, "Content-Type:", sizeof("Content-Type:")-1) == 0) s = p; } dbg_error_msg("L:'%s'", p); ntokens = 0; s = strtok(s, delims); while (s) { tokens[ntokens] = s; if (ntokens < ARRAY_SIZE(tokens) - 1) ntokens++; dbg_error_msg("L[%d]='%s'", ntokens, s); s = strtok(NULL, delims); } tokens[ntokens] = NULL; dbg_error_msg("EMPTYLINE, ntokens:%d", ntokens); if (ntokens == 0) break; } /* Is it multipart? */ type = find_token(tokens, "Content-Type:", "text/plain"); dbg_error_msg("TYPE:'%s'", type); if (0 == strncasecmp(type, "multipart/", 10)) { /* Yes, recurse */ if (strcasecmp(type + 10, "mixed") != 0) bb_error_msg_and_die("no support of content type '%s'", type); parse(xfind_token(tokens, "boundary"), argv); } else { /* No, process one non-multipart section */ char *end; pid_t pid = pid; FILE *fp; const char *charset = find_token(tokens, "charset", CONFIG_FEATURE_MIME_CHARSET); const char *encoding = find_token(tokens, "Content-Transfer-Encoding:", "7bit"); /* Compose target filename */ char *filename = (char *)find_token(tokens, "filename", NULL); if (!filename) filename = xasprintf(uniq, monotonic_us()); else filename = bb_get_last_path_component_strip(xstrdup(filename)); if (opts & OPT_X) { int fd[2]; /* start external helper */ xpipe(fd); pid = vfork(); if (0 == pid) { /* child reads from fd[0] */ close(fd[1]); xmove_fd(fd[0], STDIN_FILENO); xsetenv("CONTENT_TYPE", type); xsetenv("CHARSET", charset); xsetenv("ENCODING", encoding); xsetenv("FILENAME", filename); BB_EXECVP_or_die(argv); } /* parent will write to fd[1] */ close(fd[0]); fp = xfdopen_for_write(fd[1]); signal(SIGPIPE, SIG_IGN); } else { /* write to file */ char *fname = xasprintf("%s%s", *argv, filename); fp = xfopen_for_write(fname); free(fname); } free(filename); /* write to fp */ end = NULL; if (0 == strcasecmp(encoding, "base64")) { read_base64(stdin, fp, '-'); } else if (0 != strcasecmp(encoding, "7bit") && 0 != strcasecmp(encoding, "8bit") ) { /* quoted-printable, binary, user-defined are unsupported so far */ bb_error_msg_and_die("encoding '%s' not supported", encoding); } else { /* plain 7bit or 8bit */ while ((end = xmalloc_fgets(stdin)) != NULL) { if ('-' == end[0] && '-' == end[1] && strncmp(end + 2, boundary, boundary_len) == 0 ) { break; } fputs(end, fp); } } fclose(fp); /* Wait for child */ if (opts & OPT_X) { int rc; signal(SIGPIPE, SIG_DFL); rc = (wait4pid(pid) & 0xff); if (rc != 0) return rc + 20; } /* Multipart ended? */ if (end && '-' == end[2 + boundary_len] && '-' == end[2 + boundary_len + 1]) { dbg_error_msg("FINISHED MPART:'%s'", end); break; } dbg_error_msg("FINISHED:'%s'", end); free(end); } /* end of "handle one non-multipart block" */ free(header); } /* while (1) */ dbg_error_msg("ENDPARSE[%s]", boundary); return EXIT_SUCCESS; } //usage:#define reformime_trivial_usage //usage: "[OPTIONS]" //usage:#define reformime_full_usage "\n\n" //usage: "Parse MIME-encoded message on stdin\n" //usage: "\n -x PREFIX Extract content of MIME sections to files" //usage: "\n -X PROG ARGS Filter content of MIME sections through PROG" //usage: "\n Must be the last option" //usage: "\n" //usage: "\nOther options are silently ignored" /* Usage: reformime [options] -d - parse a delivery status notification. -e - extract contents of MIME section. -x - extract MIME section to a file. -X - pipe MIME section to a program. -i - show MIME info. -s n.n.n.n - specify MIME section. -r - rewrite message, filling in missing MIME headers. -r7 - also convert 8bit/raw encoding to quoted-printable, if possible. -r8 - also convert quoted-printable encoding to 8bit, if possible. -c charset - default charset for rewriting, -o, and -O. -m [file] [file]... - create a MIME message digest. -h "header" - decode RFC 2047-encoded header. -o "header" - encode unstructured header using RFC 2047. -O "header" - encode address list header using RFC 2047. */ int reformime_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int reformime_main(int argc UNUSED_PARAM, char **argv) { const char *opt_prefix = ""; INIT_G(); // parse options // N.B. only -x and -X are supported so far opt_complementary = "x--X:X--x" IF_FEATURE_REFORMIME_COMPAT(":m::"); opts = getopt32(argv, "x:X" IF_FEATURE_REFORMIME_COMPAT("deis:r:c:m:h:o:O:"), &opt_prefix IF_FEATURE_REFORMIME_COMPAT(, NULL, NULL, &G.opt_charset, NULL, NULL, NULL, NULL) ); argv += optind; return parse("", (opts & OPT_X) ? argv : (char **)&opt_prefix); }
/* SPDX-License-Identifier: GPL-2.0-only */ /* * Defines for Mobile Industry Processor Interface (MIPI(R)) * Display Working Group standards: DSI, DCS, DBI, DPI * * Copyright (C) 2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de> * Copyright (C) 2006 Nokia Corporation * Author: Imre Deak <imre.deak@nokia.com> */ #ifndef MIPI_DISPLAY_H #define MIPI_DISPLAY_H /* MIPI DSI Processor-to-Peripheral transaction types */ enum { MIPI_DSI_V_SYNC_START = 0x01, MIPI_DSI_V_SYNC_END = 0x11, MIPI_DSI_H_SYNC_START = 0x21, MIPI_DSI_H_SYNC_END = 0x31, MIPI_DSI_COMPRESSION_MODE = 0x07, MIPI_DSI_END_OF_TRANSMISSION = 0x08, MIPI_DSI_COLOR_MODE_OFF = 0x02, MIPI_DSI_COLOR_MODE_ON = 0x12, MIPI_DSI_SHUTDOWN_PERIPHERAL = 0x22, MIPI_DSI_TURN_ON_PERIPHERAL = 0x32, MIPI_DSI_GENERIC_SHORT_WRITE_0_PARAM = 0x03, MIPI_DSI_GENERIC_SHORT_WRITE_1_PARAM = 0x13, MIPI_DSI_GENERIC_SHORT_WRITE_2_PARAM = 0x23, MIPI_DSI_GENERIC_READ_REQUEST_0_PARAM = 0x04, MIPI_DSI_GENERIC_READ_REQUEST_1_PARAM = 0x14, MIPI_DSI_GENERIC_READ_REQUEST_2_PARAM = 0x24, MIPI_DSI_DCS_SHORT_WRITE = 0x05, MIPI_DSI_DCS_SHORT_WRITE_PARAM = 0x15, MIPI_DSI_DCS_READ = 0x06, MIPI_DSI_EXECUTE_QUEUE = 0x16, MIPI_DSI_SET_MAXIMUM_RETURN_PACKET_SIZE = 0x37, MIPI_DSI_NULL_PACKET = 0x09, MIPI_DSI_BLANKING_PACKET = 0x19, MIPI_DSI_GENERIC_LONG_WRITE = 0x29, MIPI_DSI_DCS_LONG_WRITE = 0x39, MIPI_DSI_PICTURE_PARAMETER_SET = 0x0a, MIPI_DSI_COMPRESSED_PIXEL_STREAM = 0x0b, MIPI_DSI_LOOSELY_PACKED_PIXEL_STREAM_YCBCR20 = 0x0c, MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR24 = 0x1c, MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR16 = 0x2c, MIPI_DSI_PACKED_PIXEL_STREAM_30 = 0x0d, MIPI_DSI_PACKED_PIXEL_STREAM_36 = 0x1d, MIPI_DSI_PACKED_PIXEL_STREAM_YCBCR12 = 0x3d, MIPI_DSI_PACKED_PIXEL_STREAM_16 = 0x0e, MIPI_DSI_PACKED_PIXEL_STREAM_18 = 0x1e, MIPI_DSI_PIXEL_STREAM_3BYTE_18 = 0x2e, MIPI_DSI_PACKED_PIXEL_STREAM_24 = 0x3e, }; /* MIPI DSI Peripheral-to-Processor transaction types */ enum { MIPI_DSI_RX_ACKNOWLEDGE_AND_ERROR_REPORT = 0x02, MIPI_DSI_RX_END_OF_TRANSMISSION = 0x08, MIPI_DSI_RX_GENERIC_SHORT_READ_RESPONSE_1BYTE = 0x11, MIPI_DSI_RX_GENERIC_SHORT_READ_RESPONSE_2BYTE = 0x12, MIPI_DSI_RX_GENERIC_LONG_READ_RESPONSE = 0x1a, MIPI_DSI_RX_DCS_LONG_READ_RESPONSE = 0x1c, MIPI_DSI_RX_DCS_SHORT_READ_RESPONSE_1BYTE = 0x21, MIPI_DSI_RX_DCS_SHORT_READ_RESPONSE_2BYTE = 0x22, }; /* MIPI DCS commands */ enum { MIPI_DCS_NOP = 0x00, MIPI_DCS_SOFT_RESET = 0x01, MIPI_DCS_GET_COMPRESSION_MODE = 0x03, MIPI_DCS_GET_DISPLAY_ID = 0x04, MIPI_DCS_GET_ERROR_COUNT_ON_DSI = 0x05, MIPI_DCS_GET_RED_CHANNEL = 0x06, MIPI_DCS_GET_GREEN_CHANNEL = 0x07, MIPI_DCS_GET_BLUE_CHANNEL = 0x08, MIPI_DCS_GET_DISPLAY_STATUS = 0x09, MIPI_DCS_GET_POWER_MODE = 0x0A, MIPI_DCS_GET_ADDRESS_MODE = 0x0B, MIPI_DCS_GET_PIXEL_FORMAT = 0x0C, MIPI_DCS_GET_DISPLAY_MODE = 0x0D, MIPI_DCS_GET_SIGNAL_MODE = 0x0E, MIPI_DCS_GET_DIAGNOSTIC_RESULT = 0x0F, MIPI_DCS_ENTER_SLEEP_MODE = 0x10, MIPI_DCS_EXIT_SLEEP_MODE = 0x11, MIPI_DCS_ENTER_PARTIAL_MODE = 0x12, MIPI_DCS_ENTER_NORMAL_MODE = 0x13, MIPI_DCS_GET_IMAGE_CHECKSUM_RGB = 0x14, MIPI_DCS_GET_IMAGE_CHECKSUM_CT = 0x15, MIPI_DCS_EXIT_INVERT_MODE = 0x20, MIPI_DCS_ENTER_INVERT_MODE = 0x21, MIPI_DCS_SET_GAMMA_CURVE = 0x26, MIPI_DCS_SET_DISPLAY_OFF = 0x28, MIPI_DCS_SET_DISPLAY_ON = 0x29, MIPI_DCS_SET_COLUMN_ADDRESS = 0x2A, MIPI_DCS_SET_PAGE_ADDRESS = 0x2B, MIPI_DCS_WRITE_MEMORY_START = 0x2C, MIPI_DCS_WRITE_LUT = 0x2D, MIPI_DCS_READ_MEMORY_START = 0x2E, MIPI_DCS_SET_PARTIAL_ROWS = 0x30, /* MIPI DCS 1.02 - MIPI_DCS_SET_PARTIAL_AREA before that */ MIPI_DCS_SET_PARTIAL_COLUMNS = 0x31, MIPI_DCS_SET_SCROLL_AREA = 0x33, MIPI_DCS_SET_TEAR_OFF = 0x34, MIPI_DCS_SET_TEAR_ON = 0x35, MIPI_DCS_SET_ADDRESS_MODE = 0x36, MIPI_DCS_SET_SCROLL_START = 0x37, MIPI_DCS_EXIT_IDLE_MODE = 0x38, MIPI_DCS_ENTER_IDLE_MODE = 0x39, MIPI_DCS_SET_PIXEL_FORMAT = 0x3A, MIPI_DCS_WRITE_MEMORY_CONTINUE = 0x3C, MIPI_DCS_SET_3D_CONTROL = 0x3D, MIPI_DCS_READ_MEMORY_CONTINUE = 0x3E, MIPI_DCS_GET_3D_CONTROL = 0x3F, MIPI_DCS_SET_VSYNC_TIMING = 0x40, MIPI_DCS_SET_TEAR_SCANLINE = 0x44, MIPI_DCS_GET_SCANLINE = 0x45, MIPI_DCS_SET_DISPLAY_BRIGHTNESS = 0x51, /* MIPI DCS 1.3 */ MIPI_DCS_GET_DISPLAY_BRIGHTNESS = 0x52, /* MIPI DCS 1.3 */ MIPI_DCS_WRITE_CONTROL_DISPLAY = 0x53, /* MIPI DCS 1.3 */ MIPI_DCS_GET_CONTROL_DISPLAY = 0x54, /* MIPI DCS 1.3 */ MIPI_DCS_WRITE_POWER_SAVE = 0x55, /* MIPI DCS 1.3 */ MIPI_DCS_GET_POWER_SAVE = 0x56, /* MIPI DCS 1.3 */ MIPI_DCS_SET_CABC_MIN_BRIGHTNESS = 0x5E, /* MIPI DCS 1.3 */ MIPI_DCS_GET_CABC_MIN_BRIGHTNESS = 0x5F, /* MIPI DCS 1.3 */ MIPI_DCS_READ_DDB_START = 0xA1, MIPI_DCS_READ_PPS_START = 0xA2, MIPI_DCS_READ_DDB_CONTINUE = 0xA8, MIPI_DCS_READ_PPS_CONTINUE = 0xA9, }; /* MIPI DCS pixel formats */ #define MIPI_DCS_PIXEL_FMT_24BIT 7 #define MIPI_DCS_PIXEL_FMT_18BIT 6 #define MIPI_DCS_PIXEL_FMT_16BIT 5 #define MIPI_DCS_PIXEL_FMT_12BIT 3 #define MIPI_DCS_PIXEL_FMT_8BIT 2 #define MIPI_DCS_PIXEL_FMT_3BIT 1 #endif
// This is a manifest file that'll be compiled into application.js, which will include all the files // listed below. // // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's // vendor/assets/javascripts directory can be referenced here using a relative path. // // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the // compiled file. JavaScript code in this file should be added after the last require_* statement. // // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details // about supported directives. // //= require rails-ujs //= require turbolinks //= require_tree .
<!DOCTYPE html> <meta charset=utf-8> <title>invalid video-source-media-src</title> <video><source media=screen src=x></video>
YUI.add('escape', function(Y) { /** Provides utility methods for escaping strings. @module escape @class Escape @static @since 3.3.0 **/ var HTML_CHARS = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#x27;', '/': '&#x2F;', '`': '&#x60;' }, Escape = { // -- Public Static Methods ------------------------------------------------ /** Returns a copy of the specified string with special HTML characters escaped. The following characters will be converted to their corresponding character entities: & < > " ' / ` This implementation is based on the [OWASP HTML escaping recommendations][1]. In addition to the characters in the OWASP recommendations, we also escape the <code>&#x60;</code> character, since IE interprets it as an attribute delimiter. If _string_ is not already a string, it will be coerced to a string. [1]: http://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet @method html @param {String} string String to escape. @return {String} Escaped string. @static **/ html: function (string) { return (string + '').replace(/[&<>"'\/`]/g, Escape._htmlReplacer); }, /** Returns a copy of the specified string with special regular expression characters escaped, allowing the string to be used safely inside a regex. The following characters, and all whitespace characters, are escaped: - # $ ^ * ( ) + [ ] { } | \ , . ? If _string_ is not already a string, it will be coerced to a string. @method regex @param {String} string String to escape. @return {String} Escaped string. @static **/ regex: function (string) { return (string + '').replace(/[\-#$\^*()+\[\]{}|\\,.?\s]/g, '\\$&'); }, // -- Protected Static Methods --------------------------------------------- /** * Regex replacer for HTML escaping. * * @method _htmlReplacer * @param {String} match Matched character (must exist in HTML_CHARS). * @returns {String} HTML entity. * @static * @protected */ _htmlReplacer: function (match) { return HTML_CHARS[match]; } }; Escape.regexp = Escape.regex; Y.Escape = Escape; }, '@VERSION@' ,{requires:['yui-base']});
// -*- C++ -*- // Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the terms // of the GNU General Public License as published by the Free Software // Foundation; either version 3, or (at your option) any later // version. // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. // Under Section 7 of GPL version 3, you are granted additional // permissions described in the GCC Runtime Library Exception, version // 3.1, as published by the Free Software Foundation. // You should have received a copy of the GNU General Public License and // a copy of the GCC Runtime Library Exception along with this program; // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // <http://www.gnu.org/licenses/>. // Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL. // Permission to use, copy, modify, sell, and distribute this software // is hereby granted without fee, provided that the above copyright // notice appears in all copies, and that both that copyright notice // and this permission notice appear in supporting documentation. None // of the above authors, nor IBM Haifa Research Laboratories, make any // representation about the suitability of this software for any // purpose. It is provided "as is" without express or implied // warranty. /** * @file hash_standard_resize_policy_imp.hpp * Contains a resize policy implementation. */ PB_DS_CLASS_T_DEC PB_DS_CLASS_C_DEC:: hash_standard_resize_policy() : m_size(Size_Policy::get_nearest_larger_size(1)) { trigger_policy_base::notify_externally_resized(m_size); } PB_DS_CLASS_T_DEC PB_DS_CLASS_C_DEC:: hash_standard_resize_policy(const Size_Policy& r_size_policy) : Size_Policy(r_size_policy), m_size(Size_Policy::get_nearest_larger_size(1)) { trigger_policy_base::notify_externally_resized(m_size); } PB_DS_CLASS_T_DEC PB_DS_CLASS_C_DEC:: hash_standard_resize_policy(const Size_Policy& r_size_policy, const Trigger_Policy& r_trigger_policy) : Size_Policy(r_size_policy), Trigger_Policy(r_trigger_policy), m_size(Size_Policy::get_nearest_larger_size(1)) { trigger_policy_base::notify_externally_resized(m_size); } PB_DS_CLASS_T_DEC PB_DS_CLASS_C_DEC:: ~hash_standard_resize_policy() { } PB_DS_CLASS_T_DEC void PB_DS_CLASS_C_DEC:: swap(PB_DS_CLASS_C_DEC& other) { trigger_policy_base::swap(other); size_policy_base::swap(other); std::swap(m_size, other.m_size); } PB_DS_CLASS_T_DEC inline void PB_DS_CLASS_C_DEC:: notify_find_search_start() { trigger_policy_base::notify_find_search_start(); } PB_DS_CLASS_T_DEC inline void PB_DS_CLASS_C_DEC:: notify_find_search_collision() { trigger_policy_base::notify_find_search_collision(); } PB_DS_CLASS_T_DEC inline void PB_DS_CLASS_C_DEC:: notify_find_search_end() { trigger_policy_base::notify_find_search_end(); } PB_DS_CLASS_T_DEC inline void PB_DS_CLASS_C_DEC:: notify_insert_search_start() { trigger_policy_base::notify_insert_search_start(); } PB_DS_CLASS_T_DEC inline void PB_DS_CLASS_C_DEC:: notify_insert_search_collision() { trigger_policy_base::notify_insert_search_collision(); } PB_DS_CLASS_T_DEC inline void PB_DS_CLASS_C_DEC:: notify_insert_search_end() { trigger_policy_base::notify_insert_search_end(); } PB_DS_CLASS_T_DEC inline void PB_DS_CLASS_C_DEC:: notify_erase_search_start() { trigger_policy_base::notify_erase_search_start(); } PB_DS_CLASS_T_DEC inline void PB_DS_CLASS_C_DEC:: notify_erase_search_collision() { trigger_policy_base::notify_erase_search_collision(); } PB_DS_CLASS_T_DEC inline void PB_DS_CLASS_C_DEC:: notify_erase_search_end() { trigger_policy_base::notify_erase_search_end(); } PB_DS_CLASS_T_DEC inline void PB_DS_CLASS_C_DEC:: notify_inserted(size_type num_e) { trigger_policy_base::notify_inserted(num_e); } PB_DS_CLASS_T_DEC inline void PB_DS_CLASS_C_DEC:: notify_erased(size_type num_e) { trigger_policy_base::notify_erased(num_e); } PB_DS_CLASS_T_DEC void PB_DS_CLASS_C_DEC:: notify_cleared() { trigger_policy_base::notify_cleared(); } PB_DS_CLASS_T_DEC inline bool PB_DS_CLASS_C_DEC:: is_resize_needed() const { return trigger_policy_base::is_resize_needed(); } PB_DS_CLASS_T_DEC typename PB_DS_CLASS_C_DEC::size_type PB_DS_CLASS_C_DEC:: get_new_size(size_type size, size_type num_used_e) const { if (trigger_policy_base::is_grow_needed(size, num_used_e)) return size_policy_base::get_nearest_larger_size(size); return size_policy_base::get_nearest_smaller_size(size); } PB_DS_CLASS_T_DEC void PB_DS_CLASS_C_DEC:: notify_resized(size_type new_size) { trigger_policy_base::notify_resized(new_size); m_size = new_size; } PB_DS_CLASS_T_DEC inline typename PB_DS_CLASS_C_DEC::size_type PB_DS_CLASS_C_DEC:: get_actual_size() const { PB_DS_STATIC_ASSERT(access, external_size_access); return m_size; } PB_DS_CLASS_T_DEC void PB_DS_CLASS_C_DEC:: resize(size_type new_size) { PB_DS_STATIC_ASSERT(access, external_size_access); size_type actual_size = size_policy_base::get_nearest_larger_size(1); while (actual_size < new_size) { const size_type pot = size_policy_base::get_nearest_larger_size(actual_size); if (pot == actual_size && pot < new_size) __throw_resize_error(); actual_size = pot; } if (actual_size > 0) --actual_size; const size_type old_size = m_size; __try { do_resize(actual_size - 1); } __catch(insert_error& ) { m_size = old_size; __throw_resize_error(); } __catch(...) { m_size = old_size; __throw_exception_again; } } PB_DS_CLASS_T_DEC void PB_DS_CLASS_C_DEC:: do_resize(size_type) { // Do nothing } PB_DS_CLASS_T_DEC Trigger_Policy& PB_DS_CLASS_C_DEC:: get_trigger_policy() { return *this; } PB_DS_CLASS_T_DEC const Trigger_Policy& PB_DS_CLASS_C_DEC:: get_trigger_policy() const { return *this; } PB_DS_CLASS_T_DEC Size_Policy& PB_DS_CLASS_C_DEC:: get_size_policy() { return *this; } PB_DS_CLASS_T_DEC const Size_Policy& PB_DS_CLASS_C_DEC:: get_size_policy() const { return *this; }
CHANGELOG ========= 2.5.0 ----- * [DEPRECATION] The `ApacheMatcherDumper` and `ApacheUrlMatcher` were deprecated and will be removed in Symfony 3.0, since the performance gains were minimal and it's hard to replicate the behaviour of PHP implementation. 2.3.0 ----- * added RequestContext::getQueryString() 2.2.0 ----- * [DEPRECATION] Several route settings have been renamed (the old ones will be removed in 3.0): * The `pattern` setting for a route has been deprecated in favor of `path` * The `_scheme` and `_method` requirements have been moved to the `schemes` and `methods` settings Before: ```yaml article_edit: pattern: /article/{id} requirements: { '_method': 'POST|PUT', '_scheme': 'https', 'id': '\d+' } ``` ```xml <route id="article_edit" pattern="/article/{id}"> <requirement key="_method">POST|PUT</requirement> <requirement key="_scheme">https</requirement> <requirement key="id">\d+</requirement> </route> ``` ```php $route = new Route(); $route->setPattern('/article/{id}'); $route->setRequirement('_method', 'POST|PUT'); $route->setRequirement('_scheme', 'https'); ``` After: ```yaml article_edit: path: /article/{id} methods: [POST, PUT] schemes: https requirements: { 'id': '\d+' } ``` ```xml <route id="article_edit" pattern="/article/{id}" methods="POST PUT" schemes="https"> <requirement key="id">\d+</requirement> </route> ``` ```php $route = new Route(); $route->setPath('/article/{id}'); $route->setMethods(array('POST', 'PUT')); $route->setSchemes('https'); ``` * [BC BREAK] RouteCollection does not behave like a tree structure anymore but as a flat array of Routes. So when using PHP to build the RouteCollection, you must make sure to add routes to the sub-collection before adding it to the parent collection (this is not relevant when using YAML or XML for Route definitions). Before: ```php $rootCollection = new RouteCollection(); $subCollection = new RouteCollection(); $rootCollection->addCollection($subCollection); $subCollection->add('foo', new Route('/foo')); ``` After: ```php $rootCollection = new RouteCollection(); $subCollection = new RouteCollection(); $subCollection->add('foo', new Route('/foo')); $rootCollection->addCollection($subCollection); ``` Also one must call `addCollection` from the bottom to the top hierarchy. So the correct sequence is the following (and not the reverse): ```php $childCollection->addCollection($grandchildCollection); $rootCollection->addCollection($childCollection); ``` * [DEPRECATION] The methods `RouteCollection::getParent()` and `RouteCollection::getRoot()` have been deprecated and will be removed in Symfony 2.3. * [BC BREAK] Misusing the `RouteCollection::addPrefix` method to add defaults, requirements or options without adding a prefix is not supported anymore. So if you called `addPrefix` with an empty prefix or `/` only (both have no relevance), like `addPrefix('', $defaultsArray, $requirementsArray, $optionsArray)` you need to use the new dedicated methods `addDefaults($defaultsArray)`, `addRequirements($requirementsArray)` or `addOptions($optionsArray)` instead. * [DEPRECATION] The `$options` parameter to `RouteCollection::addPrefix()` has been deprecated because adding options has nothing to do with adding a path prefix. If you want to add options to all child routes of a RouteCollection, you can use `addOptions()`. * [DEPRECATION] The method `RouteCollection::getPrefix()` has been deprecated because it suggested that all routes in the collection would have this prefix, which is not necessarily true. On top of that, since there is no tree structure anymore, this method is also useless. Don't worry about performance, prefix optimization for matching is still done in the dumper, which was also improved in 2.2.0 to find even more grouping possibilities. * [DEPRECATION] `RouteCollection::addCollection(RouteCollection $collection)` should now only be used with a single parameter. The other params `$prefix`, `$default`, `$requirements` and `$options` will still work, but have been deprecated. The `addPrefix` method should be used for this use-case instead. Before: `$parentCollection->addCollection($collection, '/prefix', array(...), array(...))` After: ```php $collection->addPrefix('/prefix', array(...), array(...)); $parentCollection->addCollection($collection); ``` * added support for the method default argument values when defining a @Route * Adjacent placeholders without separator work now, e.g. `/{x}{y}{z}.{_format}`. * Characters that function as separator between placeholders are now whitelisted to fix routes with normal text around a variable, e.g. `/prefix{var}suffix`. * [BC BREAK] The default requirement of a variable has been changed slightly. Previously it disallowed the previous and the next char around a variable. Now it disallows the slash (`/`) and the next char. Using the previous char added no value and was problematic because the route `/index.{_format}` would be matched by `/index.ht/ml`. * The default requirement now uses possessive quantifiers when possible which improves matching performance by up to 20% because it prevents backtracking when it's not needed. * The ConfigurableRequirementsInterface can now also be used to disable the requirements check on URL generation completely by calling `setStrictRequirements(null)`. It improves performance in production environment as you should know that params always pass the requirements (otherwise it would break your link anyway). * There is no restriction on the route name anymore. So non-alphanumeric characters are now also allowed. * [BC BREAK] `RouteCompilerInterface::compile(Route $route)` was made static (only relevant if you implemented your own RouteCompiler). * Added possibility to generate relative paths and network paths in the UrlGenerator, e.g. "../parent-file" and "//example.com/dir/file". The third parameter in `UrlGeneratorInterface::generate($name, $parameters = array(), $referenceType = self::ABSOLUTE_PATH)` now accepts more values and you should use the constants defined in `UrlGeneratorInterface` for claritiy. The old method calls with a Boolean parameter will continue to work because they equal the signature using the constants. 2.1.0 ----- * added RequestMatcherInterface * added RequestContext::fromRequest() * the UrlMatcher does not throw a \LogicException anymore when the required scheme is not the current one * added TraceableUrlMatcher * added the possibility to define options, default values and requirements for placeholders in prefix, including imported routes * added RouterInterface::getRouteCollection * [BC BREAK] the UrlMatcher urldecodes the route parameters only once, they were decoded twice before. Note that the `urldecode()` calls have been changed for a single `rawurldecode()` in order to support `+` for input paths. * added RouteCollection::getRoot method to retrieve the root of a RouteCollection tree * [BC BREAK] made RouteCollection::setParent private which could not have been used anyway without creating inconsistencies * [BC BREAK] RouteCollection::remove also removes a route from parent collections (not only from its children) * added ConfigurableRequirementsInterface that allows to disable exceptions (and generate empty URLs instead) when generating a route with an invalid parameter value
/* * FarSync X21 driver for Linux * * Actually sync driver for X.21, V.35 and V.24 on FarSync T-series cards * * Copyright (C) 2001 FarSite Communications Ltd. * www.farsite.co.uk * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * * Author: R.J.Dunlop <bob.dunlop@farsite.co.uk> * * For the most part this file only contains structures and information * that is visible to applications outside the driver. Shared memory * layout etc is internal to the driver and described within farsync.c. * Overlap exists in that the values used for some fields within the * ioctl interface extend into the cards firmware interface so values in * this file may not be changed arbitrarily. */ /* What's in a name * * The project name for this driver is Oscar. The driver is intended to be * used with the FarSite T-Series cards (T2P & T4P) running in the high * speed frame shifter mode. This is sometimes referred to as X.21 mode * which is a complete misnomer as the card continues to support V.24 and * V.35 as well as X.21. * * A short common prefix is useful for routines within the driver to avoid * conflict with other similar drivers and I chosen to use "fst_" for this * purpose (FarSite T-series). * * Finally the device driver needs a short network interface name. Since * "hdlc" is already in use I've chosen the even less informative "sync" * for the present. */ #define FST_NAME "fst" /* In debug/info etc */ #define FST_NDEV_NAME "sync" /* For net interface */ #define FST_DEV_NAME "farsync" /* For misc interfaces */ /* User version number * * This version number is incremented with each official release of the * package and is a simplified number for normal user reference. * Individual files are tracked by the version control system and may * have individual versions (or IDs) that move much faster than the * the release version as individual updates are tracked. */ #define FST_USER_VERSION "1.04" /* Ioctl call command values */ #define FSTWRITE (SIOCDEVPRIVATE+10) #define FSTCPURESET (SIOCDEVPRIVATE+11) #define FSTCPURELEASE (SIOCDEVPRIVATE+12) #define FSTGETCONF (SIOCDEVPRIVATE+13) #define FSTSETCONF (SIOCDEVPRIVATE+14) /* FSTWRITE * * Used to write a block of data (firmware etc) before the card is running */ struct fstioc_write { unsigned int size; unsigned int offset; unsigned char data[0]; }; /* FSTCPURESET and FSTCPURELEASE * * These take no additional data. * FSTCPURESET forces the cards CPU into a reset state and holds it there. * FSTCPURELEASE releases the CPU from this reset state allowing it to run, * the reset vector should be setup before this ioctl is run. */ /* FSTGETCONF and FSTSETCONF * * Get and set a card/ports configuration. * In order to allow selective setting of items and for the kernel to * indicate a partial status response the first field "valid" is a bitmask * indicating which other fields in the structure are valid. * Many of the field names in this structure match those used in the * firmware shared memory configuration interface and come originally from * the NT header file Smc.h * * When used with FSTGETCONF this structure should be zeroed before use. * This is to allow for possible future expansion when some of the fields * might be used to indicate a different (expanded) structure. */ struct fstioc_info { unsigned int valid; /* Bits of structure that are valid */ unsigned int nports; /* Number of serial ports */ unsigned int type; /* Type index of card */ unsigned int state; /* State of card */ unsigned int index; /* Index of port ioctl was issued on */ unsigned int smcFirmwareVersion; unsigned long kernelVersion; /* What Kernel version we are working with */ unsigned short lineInterface; /* Physical interface type */ unsigned char proto; /* Line protocol */ unsigned char internalClock; /* 1 => internal clock, 0 => external */ unsigned int lineSpeed; /* Speed in bps */ unsigned int v24IpSts; /* V.24 control input status */ unsigned int v24OpSts; /* V.24 control output status */ unsigned short clockStatus; /* lsb: 0=> present, 1=> absent */ unsigned short cableStatus; /* lsb: 0=> present, 1=> absent */ unsigned short cardMode; /* lsb: LED id mode */ unsigned short debug; /* Debug flags */ unsigned char transparentMode; /* Not used always 0 */ unsigned char invertClock; /* Invert clock feature for syncing */ unsigned char startingSlot; /* Time slot to use for start of tx */ unsigned char clockSource; /* External or internal */ unsigned char framing; /* E1, T1 or J1 */ unsigned char structure; /* unframed, double, crc4, f4, f12, */ /* f24 f72 */ unsigned char interface; /* rj48c or bnc */ unsigned char coding; /* hdb3 b8zs */ unsigned char lineBuildOut; /* 0, -7.5, -15, -22 */ unsigned char equalizer; /* short or lon haul settings */ unsigned char loopMode; /* various loopbacks */ unsigned char range; /* cable lengths */ unsigned char txBufferMode; /* tx elastic buffer depth */ unsigned char rxBufferMode; /* rx elastic buffer depth */ unsigned char losThreshold; /* Attenuation on LOS signal */ unsigned char idleCode; /* Value to send as idle timeslot */ unsigned int receiveBufferDelay; /* delay thro rx buffer timeslots */ unsigned int framingErrorCount; /* framing errors */ unsigned int codeViolationCount; /* code violations */ unsigned int crcErrorCount; /* CRC errors */ int lineAttenuation; /* in dB*/ unsigned short lossOfSignal; unsigned short receiveRemoteAlarm; unsigned short alarmIndicationSignal; }; /* "valid" bitmask */ #define FSTVAL_NONE 0x00000000 /* Nothing valid (firmware not running). * Slight misnomer. In fact nports, * type, state and index will be set * based on hardware detected. */ #define FSTVAL_OMODEM 0x0000001F /* First 5 bits correspond to the * output status bits defined for * v24OpSts */ #define FSTVAL_SPEED 0x00000020 /* internalClock, lineSpeed, clockStatus */ #define FSTVAL_CABLE 0x00000040 /* lineInterface, cableStatus */ #define FSTVAL_IMODEM 0x00000080 /* v24IpSts */ #define FSTVAL_CARD 0x00000100 /* nports, type, state, index, * smcFirmwareVersion */ #define FSTVAL_PROTO 0x00000200 /* proto */ #define FSTVAL_MODE 0x00000400 /* cardMode */ #define FSTVAL_PHASE 0x00000800 /* Clock phase */ #define FSTVAL_TE1 0x00001000 /* T1E1 Configuration */ #define FSTVAL_DEBUG 0x80000000 /* debug */ #define FSTVAL_ALL 0x00001FFF /* Note: does not include DEBUG flag */ /* "type" */ #define FST_TYPE_NONE 0 /* Probably should never happen */ #define FST_TYPE_T2P 1 /* T2P X21 2 port card */ #define FST_TYPE_T4P 2 /* T4P X21 4 port card */ #define FST_TYPE_T1U 3 /* T1U X21 1 port card */ #define FST_TYPE_T2U 4 /* T2U X21 2 port card */ #define FST_TYPE_T4U 5 /* T4U X21 4 port card */ #define FST_TYPE_TE1 6 /* T1E1 X21 1 port card */ /* "family" */ #define FST_FAMILY_TXP 0 /* T2P or T4P */ #define FST_FAMILY_TXU 1 /* T1U or T2U or T4U */ /* "state" */ #define FST_UNINIT 0 /* Raw uninitialised state following * system startup */ #define FST_RESET 1 /* Processor held in reset state */ #define FST_DOWNLOAD 2 /* Card being downloaded */ #define FST_STARTING 3 /* Released following download */ #define FST_RUNNING 4 /* Processor running */ #define FST_BADVERSION 5 /* Bad shared memory version detected */ #define FST_HALTED 6 /* Processor flagged a halt */ #define FST_IFAILED 7 /* Firmware issued initialisation failed * interrupt */ /* "lineInterface" */ #define V24 1 #define X21 2 #define V35 3 #define X21D 4 #define T1 5 #define E1 6 #define J1 7 /* "proto" */ #define FST_RAW 4 /* Two way raw packets */ #define FST_GEN_HDLC 5 /* Using "Generic HDLC" module */ /* "internalClock" */ #define INTCLK 1 #define EXTCLK 0 /* "v24IpSts" bitmask */ #define IPSTS_CTS 0x00000001 /* Clear To Send (Indicate for X.21) */ #define IPSTS_INDICATE IPSTS_CTS #define IPSTS_DSR 0x00000002 /* Data Set Ready (T2P Port A) */ #define IPSTS_DCD 0x00000004 /* Data Carrier Detect */ #define IPSTS_RI 0x00000008 /* Ring Indicator (T2P Port A) */ #define IPSTS_TMI 0x00000010 /* Test Mode Indicator (Not Supported)*/ /* "v24OpSts" bitmask */ #define OPSTS_RTS 0x00000001 /* Request To Send (Control for X.21) */ #define OPSTS_CONTROL OPSTS_RTS #define OPSTS_DTR 0x00000002 /* Data Terminal Ready */ #define OPSTS_DSRS 0x00000004 /* Data Signalling Rate Select (Not * Supported) */ #define OPSTS_SS 0x00000008 /* Select Standby (Not Supported) */ #define OPSTS_LL 0x00000010 /* Maintenance Test (Not Supported) */ /* "cardMode" bitmask */ #define CARD_MODE_IDENTIFY 0x0001 /* * Constants for T1/E1 configuration */ /* * Clock source */ #define CLOCKING_SLAVE 0 #define CLOCKING_MASTER 1 /* * Framing */ #define FRAMING_E1 0 #define FRAMING_J1 1 #define FRAMING_T1 2 /* * Structure */ #define STRUCTURE_UNFRAMED 0 #define STRUCTURE_E1_DOUBLE 1 #define STRUCTURE_E1_CRC4 2 #define STRUCTURE_E1_CRC4M 3 #define STRUCTURE_T1_4 4 #define STRUCTURE_T1_12 5 #define STRUCTURE_T1_24 6 #define STRUCTURE_T1_72 7 /* * Interface */ #define INTERFACE_RJ48C 0 #define INTERFACE_BNC 1 /* * Coding */ #define CODING_HDB3 0 #define CODING_NRZ 1 #define CODING_CMI 2 #define CODING_CMI_HDB3 3 #define CODING_CMI_B8ZS 4 #define CODING_AMI 5 #define CODING_AMI_ZCS 6 #define CODING_B8ZS 7 /* * Line Build Out */ #define LBO_0dB 0 #define LBO_7dB5 1 #define LBO_15dB 2 #define LBO_22dB5 3 /* * Range for long haul t1 > 655ft */ #define RANGE_0_133_FT 0 #define RANGE_0_40_M RANGE_0_133_FT #define RANGE_133_266_FT 1 #define RANGE_40_81_M RANGE_133_266_FT #define RANGE_266_399_FT 2 #define RANGE_81_122_M RANGE_266_399_FT #define RANGE_399_533_FT 3 #define RANGE_122_162_M RANGE_399_533_FT #define RANGE_533_655_FT 4 #define RANGE_162_200_M RANGE_533_655_FT /* * Receive Equaliser */ #define EQUALIZER_SHORT 0 #define EQUALIZER_LONG 1 /* * Loop modes */ #define LOOP_NONE 0 #define LOOP_LOCAL 1 #define LOOP_PAYLOAD_EXC_TS0 2 #define LOOP_PAYLOAD_INC_TS0 3 #define LOOP_REMOTE 4 /* * Buffer modes */ #define BUFFER_2_FRAME 0 #define BUFFER_1_FRAME 1 #define BUFFER_96_BIT 2 #define BUFFER_NONE 3 /* Debug support * * These should only be enabled for development kernels, production code * should define FST_DEBUG=0 in order to exclude the code. * Setting FST_DEBUG=1 will include all the debug code but in a disabled * state, use the FSTSETCONF ioctl to enable specific debug actions, or * FST_DEBUG can be set to prime the debug selection. */ #define FST_DEBUG 0x0000 #if FST_DEBUG extern int fst_debug_mask; /* Bit mask of actions to debug, bits * listed below. Note: Bit 0 is used * to trigger the inclusion of this * code, without enabling any actions. */ #define DBG_INIT 0x0002 /* Card detection and initialisation */ #define DBG_OPEN 0x0004 /* Open and close sequences */ #define DBG_PCI 0x0008 /* PCI config operations */ #define DBG_IOCTL 0x0010 /* Ioctls and other config */ #define DBG_INTR 0x0020 /* Interrupt routines (be careful) */ #define DBG_TX 0x0040 /* Packet transmission */ #define DBG_RX 0x0080 /* Packet reception */ #define DBG_CMD 0x0100 /* Port command issuing */ #define DBG_ASS 0xFFFF /* Assert like statements. Code that * should never be reached, if you see * one of these then I've been an ass */ #endif /* FST_DEBUG */
/******************************************************************* * This file is part of the Emulex Linux Device Driver for * * Fibre Channel Host Bus Adapters. * * Copyright (C) 2004-2009 Emulex. All rights reserved. * * EMULEX and SLI are trademarks of Emulex. * * www.emulex.com * * Portions Copyright (C) 2004-2005 Christoph Hellwig * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of version 2 of the GNU General * * Public License as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful. * * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * * TO BE LEGALLY INVALID. See the GNU General Public License for * * more details, a copy of which can be found in the file COPYING * * included with this package. * *******************************************************************/ #include <linux/blkdev.h> #include <linux/pci.h> #include <linux/slab.h> #include <linux/interrupt.h> #include <scsi/scsi.h> #include <scsi/scsi_device.h> #include <scsi/scsi_host.h> #include <scsi/scsi_transport_fc.h> #include "lpfc_hw4.h" #include "lpfc_hw.h" #include "lpfc_sli.h" #include "lpfc_sli4.h" #include "lpfc_nl.h" #include "lpfc_disc.h" #include "lpfc_scsi.h" #include "lpfc.h" #include "lpfc_logmsg.h" #include "lpfc_crtn.h" #include "lpfc_vport.h" #include "lpfc_debugfs.h" /* Called to verify a rcv'ed ADISC was intended for us. */ static int lpfc_check_adisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, struct lpfc_name *nn, struct lpfc_name *pn) { /* Compare the ADISC rsp WWNN / WWPN matches our internal node * table entry for that node. */ if (memcmp(nn, &ndlp->nlp_nodename, sizeof (struct lpfc_name))) return 0; if (memcmp(pn, &ndlp->nlp_portname, sizeof (struct lpfc_name))) return 0; /* we match, return success */ return 1; } int lpfc_check_sparm(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, struct serv_parm *sp, uint32_t class, int flogi) { volatile struct serv_parm *hsp = &vport->fc_sparam; uint16_t hsp_value, ssp_value = 0; /* * The receive data field size and buffer-to-buffer receive data field * size entries are 16 bits but are represented as two 8-bit fields in * the driver data structure to account for rsvd bits and other control * bits. Reconstruct and compare the fields as a 16-bit values before * correcting the byte values. */ if (sp->cls1.classValid) { if (!flogi) { hsp_value = ((hsp->cls1.rcvDataSizeMsb << 8) | hsp->cls1.rcvDataSizeLsb); ssp_value = ((sp->cls1.rcvDataSizeMsb << 8) | sp->cls1.rcvDataSizeLsb); if (!ssp_value) goto bad_service_param; if (ssp_value > hsp_value) { sp->cls1.rcvDataSizeLsb = hsp->cls1.rcvDataSizeLsb; sp->cls1.rcvDataSizeMsb = hsp->cls1.rcvDataSizeMsb; } } } else if (class == CLASS1) goto bad_service_param; if (sp->cls2.classValid) { if (!flogi) { hsp_value = ((hsp->cls2.rcvDataSizeMsb << 8) | hsp->cls2.rcvDataSizeLsb); ssp_value = ((sp->cls2.rcvDataSizeMsb << 8) | sp->cls2.rcvDataSizeLsb); if (!ssp_value) goto bad_service_param; if (ssp_value > hsp_value) { sp->cls2.rcvDataSizeLsb = hsp->cls2.rcvDataSizeLsb; sp->cls2.rcvDataSizeMsb = hsp->cls2.rcvDataSizeMsb; } } } else if (class == CLASS2) goto bad_service_param; if (sp->cls3.classValid) { if (!flogi) { hsp_value = ((hsp->cls3.rcvDataSizeMsb << 8) | hsp->cls3.rcvDataSizeLsb); ssp_value = ((sp->cls3.rcvDataSizeMsb << 8) | sp->cls3.rcvDataSizeLsb); if (!ssp_value) goto bad_service_param; if (ssp_value > hsp_value) { sp->cls3.rcvDataSizeLsb = hsp->cls3.rcvDataSizeLsb; sp->cls3.rcvDataSizeMsb = hsp->cls3.rcvDataSizeMsb; } } } else if (class == CLASS3) goto bad_service_param; /* * Preserve the upper four bits of the MSB from the PLOGI response. * These bits contain the Buffer-to-Buffer State Change Number * from the target and need to be passed to the FW. */ hsp_value = (hsp->cmn.bbRcvSizeMsb << 8) | hsp->cmn.bbRcvSizeLsb; ssp_value = (sp->cmn.bbRcvSizeMsb << 8) | sp->cmn.bbRcvSizeLsb; if (ssp_value > hsp_value) { sp->cmn.bbRcvSizeLsb = hsp->cmn.bbRcvSizeLsb; sp->cmn.bbRcvSizeMsb = (sp->cmn.bbRcvSizeMsb & 0xF0) | (hsp->cmn.bbRcvSizeMsb & 0x0F); } memcpy(&ndlp->nlp_nodename, &sp->nodeName, sizeof (struct lpfc_name)); memcpy(&ndlp->nlp_portname, &sp->portName, sizeof (struct lpfc_name)); return 1; bad_service_param: lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, "0207 Device %x " "(%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x) sent " "invalid service parameters. Ignoring device.\n", ndlp->nlp_DID, sp->nodeName.u.wwn[0], sp->nodeName.u.wwn[1], sp->nodeName.u.wwn[2], sp->nodeName.u.wwn[3], sp->nodeName.u.wwn[4], sp->nodeName.u.wwn[5], sp->nodeName.u.wwn[6], sp->nodeName.u.wwn[7]); return 0; } static void * lpfc_check_elscmpl_iocb(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, struct lpfc_iocbq *rspiocb) { struct lpfc_dmabuf *pcmd, *prsp; uint32_t *lp; void *ptr = NULL; IOCB_t *irsp; irsp = &rspiocb->iocb; pcmd = (struct lpfc_dmabuf *) cmdiocb->context2; /* For lpfc_els_abort, context2 could be zero'ed to delay * freeing associated memory till after ABTS completes. */ if (pcmd) { prsp = list_get_first(&pcmd->list, struct lpfc_dmabuf, list); if (prsp) { lp = (uint32_t *) prsp->virt; ptr = (void *)((uint8_t *)lp + sizeof(uint32_t)); } } else { /* Force ulpStatus error since we are returning NULL ptr */ if (!(irsp->ulpStatus)) { irsp->ulpStatus = IOSTAT_LOCAL_REJECT; irsp->un.ulpWord[4] = IOERR_SLI_ABORTED; } ptr = NULL; } return ptr; } /* * Free resources / clean up outstanding I/Os * associated with a LPFC_NODELIST entry. This * routine effectively results in a "software abort". */ int lpfc_els_abort(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp) { LIST_HEAD(completions); struct lpfc_sli *psli = &phba->sli; struct lpfc_sli_ring *pring = &psli->ring[LPFC_ELS_RING]; struct lpfc_iocbq *iocb, *next_iocb; /* Abort outstanding I/O on NPort <nlp_DID> */ lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_DISCOVERY, "0205 Abort outstanding I/O on NPort x%x " "Data: x%x x%x x%x\n", ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi); lpfc_fabric_abort_nport(ndlp); /* First check the txq */ spin_lock_irq(&phba->hbalock); list_for_each_entry_safe(iocb, next_iocb, &pring->txq, list) { /* Check to see if iocb matches the nport we are looking for */ if (lpfc_check_sli_ndlp(phba, pring, iocb, ndlp)) { /* It matches, so deque and call compl with anp error */ list_move_tail(&iocb->list, &completions); pring->txq_cnt--; } } /* Next check the txcmplq */ list_for_each_entry_safe(iocb, next_iocb, &pring->txcmplq, list) { /* Check to see if iocb matches the nport we are looking for */ if (lpfc_check_sli_ndlp(phba, pring, iocb, ndlp)) { lpfc_sli_issue_abort_iotag(phba, pring, iocb); } } spin_unlock_irq(&phba->hbalock); /* Cancel all the IOCBs from the completions list */ lpfc_sli_cancel_iocbs(phba, &completions, IOSTAT_LOCAL_REJECT, IOERR_SLI_ABORTED); lpfc_cancel_retry_delay_tmo(phba->pport, ndlp); return 0; } static int lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, struct lpfc_iocbq *cmdiocb) { struct Scsi_Host *shost = lpfc_shost_from_vport(vport); struct lpfc_hba *phba = vport->phba; struct lpfc_dmabuf *pcmd; uint32_t *lp; IOCB_t *icmd; struct serv_parm *sp; LPFC_MBOXQ_t *mbox; struct ls_rjt stat; int rc; memset(&stat, 0, sizeof (struct ls_rjt)); if (vport->port_state <= LPFC_FDISC) { /* Before responding to PLOGI, check for pt2pt mode. * If we are pt2pt, with an outstanding FLOGI, abort * the FLOGI and resend it first. */ if (vport->fc_flag & FC_PT2PT) { lpfc_els_abort_flogi(phba); if (!(vport->fc_flag & FC_PT2PT_PLOGI)) { /* If the other side is supposed to initiate * the PLOGI anyway, just ACC it now and * move on with discovery. */ phba->fc_edtov = FF_DEF_EDTOV; phba->fc_ratov = FF_DEF_RATOV; /* Start discovery - this should just do CLEAR_LA */ lpfc_disc_start(vport); } else lpfc_initial_flogi(vport); } else { stat.un.b.lsRjtRsnCode = LSRJT_LOGICAL_BSY; stat.un.b.lsRjtRsnCodeExp = LSEXP_NOTHING_MORE; lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, NULL); return 0; } } pcmd = (struct lpfc_dmabuf *) cmdiocb->context2; lp = (uint32_t *) pcmd->virt; sp = (struct serv_parm *) ((uint8_t *) lp + sizeof (uint32_t)); if (wwn_to_u64(sp->portName.u.wwn) == 0) { lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, "0140 PLOGI Reject: invalid nname\n"); stat.un.b.lsRjtRsnCode = LSRJT_UNABLE_TPC; stat.un.b.lsRjtRsnCodeExp = LSEXP_INVALID_PNAME; lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, NULL); return 0; } if (wwn_to_u64(sp->nodeName.u.wwn) == 0) { lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, "0141 PLOGI Reject: invalid pname\n"); stat.un.b.lsRjtRsnCode = LSRJT_UNABLE_TPC; stat.un.b.lsRjtRsnCodeExp = LSEXP_INVALID_NNAME; lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, NULL); return 0; } if ((lpfc_check_sparm(vport, ndlp, sp, CLASS3, 0) == 0)) { /* Reject this request because invalid parameters */ stat.un.b.lsRjtRsnCode = LSRJT_UNABLE_TPC; stat.un.b.lsRjtRsnCodeExp = LSEXP_SPARM_OPTIONS; lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, NULL); return 0; } icmd = &cmdiocb->iocb; /* PLOGI chkparm OK */ lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, "0114 PLOGI chkparm OK Data: x%x x%x x%x x%x\n", ndlp->nlp_DID, ndlp->nlp_state, ndlp->nlp_flag, ndlp->nlp_rpi); if (vport->cfg_fcp_class == 2 && sp->cls2.classValid) ndlp->nlp_fcp_info |= CLASS2; else ndlp->nlp_fcp_info |= CLASS3; ndlp->nlp_class_sup = 0; if (sp->cls1.classValid) ndlp->nlp_class_sup |= FC_COS_CLASS1; if (sp->cls2.classValid) ndlp->nlp_class_sup |= FC_COS_CLASS2; if (sp->cls3.classValid) ndlp->nlp_class_sup |= FC_COS_CLASS3; if (sp->cls4.classValid) ndlp->nlp_class_sup |= FC_COS_CLASS4; ndlp->nlp_maxframe = ((sp->cmn.bbRcvSizeMsb & 0x0F) << 8) | sp->cmn.bbRcvSizeLsb; /* no need to reg_login if we are already in one of these states */ switch (ndlp->nlp_state) { case NLP_STE_NPR_NODE: if (!(ndlp->nlp_flag & NLP_NPR_ADISC)) break; case NLP_STE_REG_LOGIN_ISSUE: case NLP_STE_PRLI_ISSUE: case NLP_STE_UNMAPPED_NODE: case NLP_STE_MAPPED_NODE: lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, cmdiocb, ndlp, NULL); return 1; } if ((vport->fc_flag & FC_PT2PT) && !(vport->fc_flag & FC_PT2PT_PLOGI)) { /* rcv'ed PLOGI decides what our NPortId will be */ vport->fc_myDID = icmd->un.rcvels.parmRo; mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); if (mbox == NULL) goto out; lpfc_config_link(phba, mbox); mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl; mbox->vport = vport; rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT); if (rc == MBX_NOT_FINISHED) { mempool_free(mbox, phba->mbox_mem_pool); goto out; } lpfc_can_disctmo(vport); } mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); if (!mbox) goto out; rc = lpfc_reg_rpi(phba, vport->vpi, icmd->un.rcvels.remoteID, (uint8_t *) sp, mbox, 0); if (rc) { mempool_free(mbox, phba->mbox_mem_pool); goto out; } /* ACC PLOGI rsp command needs to execute first, * queue this mbox command to be processed later. */ mbox->mbox_cmpl = lpfc_mbx_cmpl_reg_login; /* * mbox->context2 = lpfc_nlp_get(ndlp) deferred until mailbox * command issued in lpfc_cmpl_els_acc(). */ mbox->vport = vport; spin_lock_irq(shost->host_lock); ndlp->nlp_flag |= (NLP_ACC_REGLOGIN | NLP_RCV_PLOGI); spin_unlock_irq(shost->host_lock); /* * If there is an outstanding PLOGI issued, abort it before * sending ACC rsp for received PLOGI. If pending plogi * is not canceled here, the plogi will be rejected by * remote port and will be retried. On a configuration with * single discovery thread, this will cause a huge delay in * discovery. Also this will cause multiple state machines * running in parallel for this node. */ if (ndlp->nlp_state == NLP_STE_PLOGI_ISSUE) { /* software abort outstanding PLOGI */ lpfc_els_abort(phba, ndlp); } if ((vport->port_type == LPFC_NPIV_PORT && vport->cfg_restrict_login)) { /* In order to preserve RPIs, we want to cleanup * the default RPI the firmware created to rcv * this ELS request. The only way to do this is * to register, then unregister the RPI. */ spin_lock_irq(shost->host_lock); ndlp->nlp_flag |= NLP_RM_DFLT_RPI; spin_unlock_irq(shost->host_lock); stat.un.b.lsRjtRsnCode = LSRJT_INVALID_CMD; stat.un.b.lsRjtRsnCodeExp = LSEXP_NOTHING_MORE; lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, mbox); return 1; } lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, cmdiocb, ndlp, mbox); return 1; out: stat.un.b.lsRjtRsnCode = LSRJT_UNABLE_TPC; stat.un.b.lsRjtRsnCodeExp = LSEXP_OUT_OF_RESOURCE; lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, NULL); return 0; } static int lpfc_rcv_padisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, struct lpfc_iocbq *cmdiocb) { struct Scsi_Host *shost = lpfc_shost_from_vport(vport); struct lpfc_dmabuf *pcmd; struct serv_parm *sp; struct lpfc_name *pnn, *ppn; struct ls_rjt stat; ADISC *ap; IOCB_t *icmd; uint32_t *lp; uint32_t cmd; pcmd = (struct lpfc_dmabuf *) cmdiocb->context2; lp = (uint32_t *) pcmd->virt; cmd = *lp++; if (cmd == ELS_CMD_ADISC) { ap = (ADISC *) lp; pnn = (struct lpfc_name *) & ap->nodeName; ppn = (struct lpfc_name *) & ap->portName; } else { sp = (struct serv_parm *) lp; pnn = (struct lpfc_name *) & sp->nodeName; ppn = (struct lpfc_name *) & sp->portName; } icmd = &cmdiocb->iocb; if (icmd->ulpStatus == 0 && lpfc_check_adisc(vport, ndlp, pnn, ppn)) { if (cmd == ELS_CMD_ADISC) { lpfc_els_rsp_adisc_acc(vport, cmdiocb, ndlp); } else { lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, cmdiocb, ndlp, NULL); } return 1; } /* Reject this request because invalid parameters */ stat.un.b.lsRjtRsvd0 = 0; stat.un.b.lsRjtRsnCode = LSRJT_UNABLE_TPC; stat.un.b.lsRjtRsnCodeExp = LSEXP_SPARM_OPTIONS; stat.un.b.vendorUnique = 0; lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, NULL); /* 1 sec timeout */ mod_timer(&ndlp->nlp_delayfunc, jiffies + HZ); spin_lock_irq(shost->host_lock); ndlp->nlp_flag |= NLP_DELAY_TMO; spin_unlock_irq(shost->host_lock); ndlp->nlp_last_elscmd = ELS_CMD_PLOGI; ndlp->nlp_prev_state = ndlp->nlp_state; lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); return 0; } static int lpfc_rcv_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, struct lpfc_iocbq *cmdiocb, uint32_t els_cmd) { struct Scsi_Host *shost = lpfc_shost_from_vport(vport); struct lpfc_hba *phba = vport->phba; struct lpfc_vport **vports; int i, active_vlink_present = 0 ; /* Put ndlp in NPR state with 1 sec timeout for plogi, ACC logo */ /* Only call LOGO ACC for first LOGO, this avoids sending unnecessary * PLOGIs during LOGO storms from a device. */ spin_lock_irq(shost->host_lock); ndlp->nlp_flag |= NLP_LOGO_ACC; spin_unlock_irq(shost->host_lock); if (els_cmd == ELS_CMD_PRLO) lpfc_els_rsp_acc(vport, ELS_CMD_PRLO, cmdiocb, ndlp, NULL); else lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL); if (ndlp->nlp_DID == Fabric_DID) { if (vport->port_state <= LPFC_FDISC) goto out; lpfc_linkdown_port(vport); spin_lock_irq(shost->host_lock); vport->fc_flag |= FC_VPORT_LOGO_RCVD; spin_unlock_irq(shost->host_lock); vports = lpfc_create_vport_work_array(phba); if (vports) { for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) { if ((!(vports[i]->fc_flag & FC_VPORT_LOGO_RCVD)) && (vports[i]->port_state > LPFC_FDISC)) { active_vlink_present = 1; break; } } lpfc_destroy_vport_work_array(phba, vports); } if (active_vlink_present) { /* * If there are other active VLinks present, * re-instantiate the Vlink using FDISC. */ mod_timer(&ndlp->nlp_delayfunc, jiffies + HZ); spin_lock_irq(shost->host_lock); ndlp->nlp_flag |= NLP_DELAY_TMO; spin_unlock_irq(shost->host_lock); ndlp->nlp_last_elscmd = ELS_CMD_FDISC; vport->port_state = LPFC_FDISC; } else { spin_lock_irq(shost->host_lock); phba->pport->fc_flag &= ~FC_LOGO_RCVD_DID_CHNG; spin_unlock_irq(shost->host_lock); lpfc_retry_pport_discovery(phba); } } else if ((!(ndlp->nlp_type & NLP_FABRIC) && ((ndlp->nlp_type & NLP_FCP_TARGET) || !(ndlp->nlp_type & NLP_FCP_INITIATOR))) || (ndlp->nlp_state == NLP_STE_ADISC_ISSUE)) { /* Only try to re-login if this is NOT a Fabric Node */ mod_timer(&ndlp->nlp_delayfunc, jiffies + HZ * 1); spin_lock_irq(shost->host_lock); ndlp->nlp_flag |= NLP_DELAY_TMO; spin_unlock_irq(shost->host_lock); ndlp->nlp_last_elscmd = ELS_CMD_PLOGI; } out: ndlp->nlp_prev_state = ndlp->nlp_state; lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); spin_lock_irq(shost->host_lock); ndlp->nlp_flag &= ~NLP_NPR_ADISC; spin_unlock_irq(shost->host_lock); /* The driver has to wait until the ACC completes before it continues * processing the LOGO. The action will resume in * lpfc_cmpl_els_logo_acc routine. Since part of processing includes an * unreg_login, the driver waits so the ACC does not get aborted. */ return 0; } static void lpfc_rcv_prli(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, struct lpfc_iocbq *cmdiocb) { struct lpfc_dmabuf *pcmd; uint32_t *lp; PRLI *npr; struct fc_rport *rport = ndlp->rport; u32 roles; pcmd = (struct lpfc_dmabuf *) cmdiocb->context2; lp = (uint32_t *) pcmd->virt; npr = (PRLI *) ((uint8_t *) lp + sizeof (uint32_t)); ndlp->nlp_type &= ~(NLP_FCP_TARGET | NLP_FCP_INITIATOR); ndlp->nlp_fcp_info &= ~NLP_FCP_2_DEVICE; if (npr->prliType == PRLI_FCP_TYPE) { if (npr->initiatorFunc) ndlp->nlp_type |= NLP_FCP_INITIATOR; if (npr->targetFunc) ndlp->nlp_type |= NLP_FCP_TARGET; if (npr->Retry) ndlp->nlp_fcp_info |= NLP_FCP_2_DEVICE; } if (rport) { /* We need to update the rport role values */ roles = FC_RPORT_ROLE_UNKNOWN; if (ndlp->nlp_type & NLP_FCP_INITIATOR) roles |= FC_RPORT_ROLE_FCP_INITIATOR; if (ndlp->nlp_type & NLP_FCP_TARGET) roles |= FC_RPORT_ROLE_FCP_TARGET; lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_RPORT, "rport rolechg: role:x%x did:x%x flg:x%x", roles, ndlp->nlp_DID, ndlp->nlp_flag); fc_remote_port_rolechg(rport, roles); } } static uint32_t lpfc_disc_set_adisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) { struct Scsi_Host *shost = lpfc_shost_from_vport(vport); if (!(ndlp->nlp_flag & NLP_RPI_VALID)) { ndlp->nlp_flag &= ~NLP_NPR_ADISC; return 0; } if (!(vport->fc_flag & FC_PT2PT)) { /* Check config parameter use-adisc or FCP-2 */ if ((vport->cfg_use_adisc && (vport->fc_flag & FC_RSCN_MODE)) || ndlp->nlp_fcp_info & NLP_FCP_2_DEVICE) { spin_lock_irq(shost->host_lock); ndlp->nlp_flag |= NLP_NPR_ADISC; spin_unlock_irq(shost->host_lock); return 1; } } ndlp->nlp_flag &= ~NLP_NPR_ADISC; lpfc_unreg_rpi(vport, ndlp); return 0; } /** * lpfc_release_rpi - Release a RPI by issueing unreg_login mailbox cmd. * @phba : Pointer to lpfc_hba structure. * @vport: Pointer to lpfc_vport structure. * @rpi : rpi to be release. * * This function will send a unreg_login mailbox command to the firmware * to release a rpi. **/ void lpfc_release_rpi(struct lpfc_hba *phba, struct lpfc_vport *vport, uint16_t rpi) { LPFC_MBOXQ_t *pmb; int rc; pmb = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); if (!pmb) lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX, "2796 mailbox memory allocation failed \n"); else { lpfc_unreg_login(phba, vport->vpi, rpi, pmb); pmb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT); if (rc == MBX_NOT_FINISHED) mempool_free(pmb, phba->mbox_mem_pool); } } static uint32_t lpfc_disc_illegal(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_hba *phba; LPFC_MBOXQ_t *pmb = (LPFC_MBOXQ_t *) arg; MAILBOX_t *mb; uint16_t rpi; phba = vport->phba; /* Release the RPI if reglogin completing */ if (!(phba->pport->load_flag & FC_UNLOADING) && (evt == NLP_EVT_CMPL_REG_LOGIN) && (!pmb->u.mb.mbxStatus)) { mb = &pmb->u.mb; rpi = pmb->u.mb.un.varWords[0]; lpfc_release_rpi(phba, vport, rpi); } lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, "0271 Illegal State Transition: node x%x " "event x%x, state x%x Data: x%x x%x\n", ndlp->nlp_DID, evt, ndlp->nlp_state, ndlp->nlp_rpi, ndlp->nlp_flag); return ndlp->nlp_state; } static uint32_t lpfc_cmpl_plogi_illegal(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { /* This transition is only legal if we previously * rcv'ed a PLOGI. Since we don't want 2 discovery threads * working on the same NPortID, do nothing for this thread * to stop it. */ if (!(ndlp->nlp_flag & NLP_RCV_PLOGI)) { lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, "0272 Illegal State Transition: node x%x " "event x%x, state x%x Data: x%x x%x\n", ndlp->nlp_DID, evt, ndlp->nlp_state, ndlp->nlp_rpi, ndlp->nlp_flag); } return ndlp->nlp_state; } /* Start of Discovery State Machine routines */ static uint32_t lpfc_rcv_plogi_unused_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb; cmdiocb = (struct lpfc_iocbq *) arg; if (lpfc_rcv_plogi(vport, ndlp, cmdiocb)) { return ndlp->nlp_state; } return NLP_STE_FREED_NODE; } static uint32_t lpfc_rcv_els_unused_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { lpfc_issue_els_logo(vport, ndlp, 0); return ndlp->nlp_state; } static uint32_t lpfc_rcv_logo_unused_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct Scsi_Host *shost = lpfc_shost_from_vport(vport); struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; spin_lock_irq(shost->host_lock); ndlp->nlp_flag |= NLP_LOGO_ACC; spin_unlock_irq(shost->host_lock); lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL); return ndlp->nlp_state; } static uint32_t lpfc_cmpl_logo_unused_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { return NLP_STE_FREED_NODE; } static uint32_t lpfc_device_rm_unused_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { return NLP_STE_FREED_NODE; } static uint32_t lpfc_rcv_plogi_plogi_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct Scsi_Host *shost = lpfc_shost_from_vport(vport); struct lpfc_hba *phba = vport->phba; struct lpfc_iocbq *cmdiocb = arg; struct lpfc_dmabuf *pcmd = (struct lpfc_dmabuf *) cmdiocb->context2; uint32_t *lp = (uint32_t *) pcmd->virt; struct serv_parm *sp = (struct serv_parm *) (lp + 1); struct ls_rjt stat; int port_cmp; memset(&stat, 0, sizeof (struct ls_rjt)); /* For a PLOGI, we only accept if our portname is less * than the remote portname. */ phba->fc_stat.elsLogiCol++; port_cmp = memcmp(&vport->fc_portname, &sp->portName, sizeof(struct lpfc_name)); if (port_cmp >= 0) { /* Reject this request because the remote node will accept ours */ stat.un.b.lsRjtRsnCode = LSRJT_UNABLE_TPC; stat.un.b.lsRjtRsnCodeExp = LSEXP_CMD_IN_PROGRESS; lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, NULL); } else { if (lpfc_rcv_plogi(vport, ndlp, cmdiocb) && (ndlp->nlp_flag & NLP_NPR_2B_DISC) && (vport->num_disc_nodes)) { spin_lock_irq(shost->host_lock); ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; spin_unlock_irq(shost->host_lock); /* Check if there are more PLOGIs to be sent */ lpfc_more_plogi(vport); if (vport->num_disc_nodes == 0) { spin_lock_irq(shost->host_lock); vport->fc_flag &= ~FC_NDISC_ACTIVE; spin_unlock_irq(shost->host_lock); lpfc_can_disctmo(vport); lpfc_end_rscn(vport); } } } /* If our portname was less */ return ndlp->nlp_state; } static uint32_t lpfc_rcv_prli_plogi_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; struct ls_rjt stat; memset(&stat, 0, sizeof (struct ls_rjt)); stat.un.b.lsRjtRsnCode = LSRJT_LOGICAL_BSY; stat.un.b.lsRjtRsnCodeExp = LSEXP_NOTHING_MORE; lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, NULL); return ndlp->nlp_state; } static uint32_t lpfc_rcv_logo_plogi_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; /* software abort outstanding PLOGI */ lpfc_els_abort(vport->phba, ndlp); lpfc_rcv_logo(vport, ndlp, cmdiocb, ELS_CMD_LOGO); return ndlp->nlp_state; } static uint32_t lpfc_rcv_els_plogi_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct Scsi_Host *shost = lpfc_shost_from_vport(vport); struct lpfc_hba *phba = vport->phba; struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; /* software abort outstanding PLOGI */ lpfc_els_abort(phba, ndlp); if (evt == NLP_EVT_RCV_LOGO) { lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL); } else { lpfc_issue_els_logo(vport, ndlp, 0); } /* Put ndlp in npr state set plogi timer for 1 sec */ mod_timer(&ndlp->nlp_delayfunc, jiffies + HZ * 1); spin_lock_irq(shost->host_lock); ndlp->nlp_flag |= NLP_DELAY_TMO; spin_unlock_irq(shost->host_lock); ndlp->nlp_last_elscmd = ELS_CMD_PLOGI; ndlp->nlp_prev_state = NLP_STE_PLOGI_ISSUE; lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); return ndlp->nlp_state; } static uint32_t lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_hba *phba = vport->phba; struct Scsi_Host *shost = lpfc_shost_from_vport(vport); struct lpfc_iocbq *cmdiocb, *rspiocb; struct lpfc_dmabuf *pcmd, *prsp, *mp; uint32_t *lp; IOCB_t *irsp; struct serv_parm *sp; LPFC_MBOXQ_t *mbox; cmdiocb = (struct lpfc_iocbq *) arg; rspiocb = cmdiocb->context_un.rsp_iocb; if (ndlp->nlp_flag & NLP_ACC_REGLOGIN) { /* Recovery from PLOGI collision logic */ return ndlp->nlp_state; } irsp = &rspiocb->iocb; if (irsp->ulpStatus) goto out; pcmd = (struct lpfc_dmabuf *) cmdiocb->context2; prsp = list_get_first(&pcmd->list, struct lpfc_dmabuf, list); lp = (uint32_t *) prsp->virt; sp = (struct serv_parm *) ((uint8_t *) lp + sizeof (uint32_t)); /* Some switches have FDMI servers returning 0 for WWN */ if ((ndlp->nlp_DID != FDMI_DID) && (wwn_to_u64(sp->portName.u.wwn) == 0 || wwn_to_u64(sp->nodeName.u.wwn) == 0)) { lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, "0142 PLOGI RSP: Invalid WWN.\n"); goto out; } if (!lpfc_check_sparm(vport, ndlp, sp, CLASS3, 0)) goto out; /* PLOGI chkparm OK */ lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, "0121 PLOGI chkparm OK Data: x%x x%x x%x x%x\n", ndlp->nlp_DID, ndlp->nlp_state, ndlp->nlp_flag, ndlp->nlp_rpi); if (vport->cfg_fcp_class == 2 && (sp->cls2.classValid)) ndlp->nlp_fcp_info |= CLASS2; else ndlp->nlp_fcp_info |= CLASS3; ndlp->nlp_class_sup = 0; if (sp->cls1.classValid) ndlp->nlp_class_sup |= FC_COS_CLASS1; if (sp->cls2.classValid) ndlp->nlp_class_sup |= FC_COS_CLASS2; if (sp->cls3.classValid) ndlp->nlp_class_sup |= FC_COS_CLASS3; if (sp->cls4.classValid) ndlp->nlp_class_sup |= FC_COS_CLASS4; ndlp->nlp_maxframe = ((sp->cmn.bbRcvSizeMsb & 0x0F) << 8) | sp->cmn.bbRcvSizeLsb; mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); if (!mbox) { lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, "0133 PLOGI: no memory for reg_login " "Data: x%x x%x x%x x%x\n", ndlp->nlp_DID, ndlp->nlp_state, ndlp->nlp_flag, ndlp->nlp_rpi); goto out; } lpfc_unreg_rpi(vport, ndlp); if (lpfc_reg_rpi(phba, vport->vpi, irsp->un.elsreq64.remoteID, (uint8_t *) sp, mbox, 0) == 0) { switch (ndlp->nlp_DID) { case NameServer_DID: mbox->mbox_cmpl = lpfc_mbx_cmpl_ns_reg_login; break; case FDMI_DID: mbox->mbox_cmpl = lpfc_mbx_cmpl_fdmi_reg_login; break; default: mbox->mbox_cmpl = lpfc_mbx_cmpl_reg_login; } mbox->context2 = lpfc_nlp_get(ndlp); mbox->vport = vport; if (lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT) != MBX_NOT_FINISHED) { lpfc_nlp_set_state(vport, ndlp, NLP_STE_REG_LOGIN_ISSUE); return ndlp->nlp_state; } /* decrement node reference count to the failed mbox * command */ lpfc_nlp_put(ndlp); mp = (struct lpfc_dmabuf *) mbox->context1; lpfc_mbuf_free(phba, mp->virt, mp->phys); kfree(mp); mempool_free(mbox, phba->mbox_mem_pool); lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, "0134 PLOGI: cannot issue reg_login " "Data: x%x x%x x%x x%x\n", ndlp->nlp_DID, ndlp->nlp_state, ndlp->nlp_flag, ndlp->nlp_rpi); } else { mempool_free(mbox, phba->mbox_mem_pool); lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, "0135 PLOGI: cannot format reg_login " "Data: x%x x%x x%x x%x\n", ndlp->nlp_DID, ndlp->nlp_state, ndlp->nlp_flag, ndlp->nlp_rpi); } out: if (ndlp->nlp_DID == NameServer_DID) { lpfc_vport_set_state(vport, FC_VPORT_FAILED); lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, "0261 Cannot Register NameServer login\n"); } spin_lock_irq(shost->host_lock); ndlp->nlp_flag |= NLP_DEFER_RM; spin_unlock_irq(shost->host_lock); return NLP_STE_FREED_NODE; } static uint32_t lpfc_cmpl_logo_plogi_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { return ndlp->nlp_state; } static uint32_t lpfc_cmpl_reglogin_plogi_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_hba *phba; LPFC_MBOXQ_t *pmb = (LPFC_MBOXQ_t *) arg; MAILBOX_t *mb = &pmb->u.mb; uint16_t rpi; phba = vport->phba; /* Release the RPI */ if (!(phba->pport->load_flag & FC_UNLOADING) && !mb->mbxStatus) { rpi = pmb->u.mb.un.varWords[0]; lpfc_release_rpi(phba, vport, rpi); } return ndlp->nlp_state; } static uint32_t lpfc_device_rm_plogi_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct Scsi_Host *shost = lpfc_shost_from_vport(vport); if (ndlp->nlp_flag & NLP_NPR_2B_DISC) { spin_lock_irq(shost->host_lock); ndlp->nlp_flag |= NLP_NODEV_REMOVE; spin_unlock_irq(shost->host_lock); return ndlp->nlp_state; } else { /* software abort outstanding PLOGI */ lpfc_els_abort(vport->phba, ndlp); lpfc_drop_node(vport, ndlp); return NLP_STE_FREED_NODE; } } static uint32_t lpfc_device_recov_plogi_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct Scsi_Host *shost = lpfc_shost_from_vport(vport); struct lpfc_hba *phba = vport->phba; /* Don't do anything that will mess up processing of the * previous RSCN. */ if (vport->fc_flag & FC_RSCN_DEFERRED) return ndlp->nlp_state; /* software abort outstanding PLOGI */ lpfc_els_abort(phba, ndlp); ndlp->nlp_prev_state = NLP_STE_PLOGI_ISSUE; lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); spin_lock_irq(shost->host_lock); ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC); spin_unlock_irq(shost->host_lock); return ndlp->nlp_state; } static uint32_t lpfc_rcv_plogi_adisc_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct Scsi_Host *shost = lpfc_shost_from_vport(vport); struct lpfc_hba *phba = vport->phba; struct lpfc_iocbq *cmdiocb; /* software abort outstanding ADISC */ lpfc_els_abort(phba, ndlp); cmdiocb = (struct lpfc_iocbq *) arg; if (lpfc_rcv_plogi(vport, ndlp, cmdiocb)) { if (ndlp->nlp_flag & NLP_NPR_2B_DISC) { spin_lock_irq(shost->host_lock); ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; spin_unlock_irq(shost->host_lock); if (vport->num_disc_nodes) lpfc_more_adisc(vport); } return ndlp->nlp_state; } ndlp->nlp_prev_state = NLP_STE_ADISC_ISSUE; lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0); lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE); return ndlp->nlp_state; } static uint32_t lpfc_rcv_prli_adisc_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; lpfc_els_rsp_prli_acc(vport, cmdiocb, ndlp); return ndlp->nlp_state; } static uint32_t lpfc_rcv_logo_adisc_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_hba *phba = vport->phba; struct lpfc_iocbq *cmdiocb; cmdiocb = (struct lpfc_iocbq *) arg; /* software abort outstanding ADISC */ lpfc_els_abort(phba, ndlp); lpfc_rcv_logo(vport, ndlp, cmdiocb, ELS_CMD_LOGO); return ndlp->nlp_state; } static uint32_t lpfc_rcv_padisc_adisc_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb; cmdiocb = (struct lpfc_iocbq *) arg; lpfc_rcv_padisc(vport, ndlp, cmdiocb); return ndlp->nlp_state; } static uint32_t lpfc_rcv_prlo_adisc_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb; cmdiocb = (struct lpfc_iocbq *) arg; /* Treat like rcv logo */ lpfc_rcv_logo(vport, ndlp, cmdiocb, ELS_CMD_PRLO); return ndlp->nlp_state; } static uint32_t lpfc_cmpl_adisc_adisc_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct Scsi_Host *shost = lpfc_shost_from_vport(vport); struct lpfc_hba *phba = vport->phba; struct lpfc_iocbq *cmdiocb, *rspiocb; IOCB_t *irsp; ADISC *ap; int rc; cmdiocb = (struct lpfc_iocbq *) arg; rspiocb = cmdiocb->context_un.rsp_iocb; ap = (ADISC *)lpfc_check_elscmpl_iocb(phba, cmdiocb, rspiocb); irsp = &rspiocb->iocb; if ((irsp->ulpStatus) || (!lpfc_check_adisc(vport, ndlp, &ap->nodeName, &ap->portName))) { /* 1 sec timeout */ mod_timer(&ndlp->nlp_delayfunc, jiffies + HZ); spin_lock_irq(shost->host_lock); ndlp->nlp_flag |= NLP_DELAY_TMO; spin_unlock_irq(shost->host_lock); ndlp->nlp_last_elscmd = ELS_CMD_PLOGI; memset(&ndlp->nlp_nodename, 0, sizeof(struct lpfc_name)); memset(&ndlp->nlp_portname, 0, sizeof(struct lpfc_name)); ndlp->nlp_prev_state = NLP_STE_ADISC_ISSUE; lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); lpfc_unreg_rpi(vport, ndlp); return ndlp->nlp_state; } if (phba->sli_rev == LPFC_SLI_REV4) { rc = lpfc_sli4_resume_rpi(ndlp); if (rc) { /* Stay in state and retry. */ ndlp->nlp_prev_state = NLP_STE_ADISC_ISSUE; return ndlp->nlp_state; } } if (ndlp->nlp_type & NLP_FCP_TARGET) { ndlp->nlp_prev_state = NLP_STE_ADISC_ISSUE; lpfc_nlp_set_state(vport, ndlp, NLP_STE_MAPPED_NODE); } else { ndlp->nlp_prev_state = NLP_STE_ADISC_ISSUE; lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); } return ndlp->nlp_state; } static uint32_t lpfc_device_rm_adisc_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct Scsi_Host *shost = lpfc_shost_from_vport(vport); if (ndlp->nlp_flag & NLP_NPR_2B_DISC) { spin_lock_irq(shost->host_lock); ndlp->nlp_flag |= NLP_NODEV_REMOVE; spin_unlock_irq(shost->host_lock); return ndlp->nlp_state; } else { /* software abort outstanding ADISC */ lpfc_els_abort(vport->phba, ndlp); lpfc_drop_node(vport, ndlp); return NLP_STE_FREED_NODE; } } static uint32_t lpfc_device_recov_adisc_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct Scsi_Host *shost = lpfc_shost_from_vport(vport); struct lpfc_hba *phba = vport->phba; /* Don't do anything that will mess up processing of the * previous RSCN. */ if (vport->fc_flag & FC_RSCN_DEFERRED) return ndlp->nlp_state; /* software abort outstanding ADISC */ lpfc_els_abort(phba, ndlp); ndlp->nlp_prev_state = NLP_STE_ADISC_ISSUE; lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); spin_lock_irq(shost->host_lock); ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC); spin_unlock_irq(shost->host_lock); lpfc_disc_set_adisc(vport, ndlp); return ndlp->nlp_state; } static uint32_t lpfc_rcv_plogi_reglogin_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; lpfc_rcv_plogi(vport, ndlp, cmdiocb); return ndlp->nlp_state; } static uint32_t lpfc_rcv_prli_reglogin_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; lpfc_els_rsp_prli_acc(vport, cmdiocb, ndlp); return ndlp->nlp_state; } static uint32_t lpfc_rcv_logo_reglogin_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_hba *phba = vport->phba; struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; LPFC_MBOXQ_t *mb; LPFC_MBOXQ_t *nextmb; struct lpfc_dmabuf *mp; cmdiocb = (struct lpfc_iocbq *) arg; /* cleanup any ndlp on mbox q waiting for reglogin cmpl */ if ((mb = phba->sli.mbox_active)) { if ((mb->u.mb.mbxCommand == MBX_REG_LOGIN64) && (ndlp == (struct lpfc_nodelist *) mb->context2)) { lpfc_nlp_put(ndlp); mb->context2 = NULL; mb->mbox_cmpl = lpfc_sli_def_mbox_cmpl; } } spin_lock_irq(&phba->hbalock); list_for_each_entry_safe(mb, nextmb, &phba->sli.mboxq, list) { if ((mb->u.mb.mbxCommand == MBX_REG_LOGIN64) && (ndlp == (struct lpfc_nodelist *) mb->context2)) { if (phba->sli_rev == LPFC_SLI_REV4) { spin_unlock_irq(&phba->hbalock); lpfc_sli4_free_rpi(phba, mb->u.mb.un.varRegLogin.rpi); spin_lock_irq(&phba->hbalock); } mp = (struct lpfc_dmabuf *) (mb->context1); if (mp) { __lpfc_mbuf_free(phba, mp->virt, mp->phys); kfree(mp); } lpfc_nlp_put(ndlp); list_del(&mb->list); phba->sli.mboxq_cnt--; mempool_free(mb, phba->mbox_mem_pool); } } spin_unlock_irq(&phba->hbalock); lpfc_rcv_logo(vport, ndlp, cmdiocb, ELS_CMD_LOGO); return ndlp->nlp_state; } static uint32_t lpfc_rcv_padisc_reglogin_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; lpfc_rcv_padisc(vport, ndlp, cmdiocb); return ndlp->nlp_state; } static uint32_t lpfc_rcv_prlo_reglogin_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb; cmdiocb = (struct lpfc_iocbq *) arg; lpfc_els_rsp_acc(vport, ELS_CMD_PRLO, cmdiocb, ndlp, NULL); return ndlp->nlp_state; } static uint32_t lpfc_cmpl_reglogin_reglogin_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct Scsi_Host *shost = lpfc_shost_from_vport(vport); LPFC_MBOXQ_t *pmb = (LPFC_MBOXQ_t *) arg; MAILBOX_t *mb = &pmb->u.mb; uint32_t did = mb->un.varWords[1]; if (mb->mbxStatus) { /* RegLogin failed */ lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY, "0246 RegLogin failed Data: x%x x%x x%x\n", did, mb->mbxStatus, vport->port_state); /* * If RegLogin failed due to lack of HBA resources do not * retry discovery. */ if (mb->mbxStatus == MBXERR_RPI_FULL) { ndlp->nlp_prev_state = NLP_STE_REG_LOGIN_ISSUE; lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); return ndlp->nlp_state; } /* Put ndlp in npr state set plogi timer for 1 sec */ mod_timer(&ndlp->nlp_delayfunc, jiffies + HZ * 1); spin_lock_irq(shost->host_lock); ndlp->nlp_flag |= NLP_DELAY_TMO; spin_unlock_irq(shost->host_lock); ndlp->nlp_last_elscmd = ELS_CMD_PLOGI; lpfc_issue_els_logo(vport, ndlp, 0); ndlp->nlp_prev_state = NLP_STE_REG_LOGIN_ISSUE; lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); return ndlp->nlp_state; } ndlp->nlp_rpi = mb->un.varWords[0]; ndlp->nlp_flag |= NLP_RPI_VALID; /* Only if we are not a fabric nport do we issue PRLI */ if (!(ndlp->nlp_type & NLP_FABRIC)) { ndlp->nlp_prev_state = NLP_STE_REG_LOGIN_ISSUE; lpfc_nlp_set_state(vport, ndlp, NLP_STE_PRLI_ISSUE); lpfc_issue_els_prli(vport, ndlp, 0); } else { ndlp->nlp_prev_state = NLP_STE_REG_LOGIN_ISSUE; lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); } return ndlp->nlp_state; } static uint32_t lpfc_device_rm_reglogin_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct Scsi_Host *shost = lpfc_shost_from_vport(vport); if (ndlp->nlp_flag & NLP_NPR_2B_DISC) { spin_lock_irq(shost->host_lock); ndlp->nlp_flag |= NLP_NODEV_REMOVE; spin_unlock_irq(shost->host_lock); return ndlp->nlp_state; } else { lpfc_drop_node(vport, ndlp); return NLP_STE_FREED_NODE; } } static uint32_t lpfc_device_recov_reglogin_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct Scsi_Host *shost = lpfc_shost_from_vport(vport); /* Don't do anything that will mess up processing of the * previous RSCN. */ if (vport->fc_flag & FC_RSCN_DEFERRED) return ndlp->nlp_state; ndlp->nlp_prev_state = NLP_STE_REG_LOGIN_ISSUE; lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); spin_lock_irq(shost->host_lock); ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC); spin_unlock_irq(shost->host_lock); lpfc_disc_set_adisc(vport, ndlp); return ndlp->nlp_state; } static uint32_t lpfc_rcv_plogi_prli_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb; cmdiocb = (struct lpfc_iocbq *) arg; lpfc_rcv_plogi(vport, ndlp, cmdiocb); return ndlp->nlp_state; } static uint32_t lpfc_rcv_prli_prli_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; lpfc_els_rsp_prli_acc(vport, cmdiocb, ndlp); return ndlp->nlp_state; } static uint32_t lpfc_rcv_logo_prli_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; /* Software abort outstanding PRLI before sending acc */ lpfc_els_abort(vport->phba, ndlp); lpfc_rcv_logo(vport, ndlp, cmdiocb, ELS_CMD_LOGO); return ndlp->nlp_state; } static uint32_t lpfc_rcv_padisc_prli_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; lpfc_rcv_padisc(vport, ndlp, cmdiocb); return ndlp->nlp_state; } /* This routine is envoked when we rcv a PRLO request from a nport * we are logged into. We should send back a PRLO rsp setting the * appropriate bits. * NEXT STATE = PRLI_ISSUE */ static uint32_t lpfc_rcv_prlo_prli_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; lpfc_els_rsp_acc(vport, ELS_CMD_PRLO, cmdiocb, ndlp, NULL); return ndlp->nlp_state; } static uint32_t lpfc_cmpl_prli_prli_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct Scsi_Host *shost = lpfc_shost_from_vport(vport); struct lpfc_iocbq *cmdiocb, *rspiocb; struct lpfc_hba *phba = vport->phba; IOCB_t *irsp; PRLI *npr; cmdiocb = (struct lpfc_iocbq *) arg; rspiocb = cmdiocb->context_un.rsp_iocb; npr = (PRLI *)lpfc_check_elscmpl_iocb(phba, cmdiocb, rspiocb); irsp = &rspiocb->iocb; if (irsp->ulpStatus) { if ((vport->port_type == LPFC_NPIV_PORT) && vport->cfg_restrict_login) { goto out; } ndlp->nlp_prev_state = NLP_STE_PRLI_ISSUE; lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); return ndlp->nlp_state; } /* Check out PRLI rsp */ ndlp->nlp_type &= ~(NLP_FCP_TARGET | NLP_FCP_INITIATOR); ndlp->nlp_fcp_info &= ~NLP_FCP_2_DEVICE; if ((npr->acceptRspCode == PRLI_REQ_EXECUTED) && (npr->prliType == PRLI_FCP_TYPE)) { if (npr->initiatorFunc) ndlp->nlp_type |= NLP_FCP_INITIATOR; if (npr->targetFunc) ndlp->nlp_type |= NLP_FCP_TARGET; if (npr->Retry) ndlp->nlp_fcp_info |= NLP_FCP_2_DEVICE; } if (!(ndlp->nlp_type & NLP_FCP_TARGET) && (vport->port_type == LPFC_NPIV_PORT) && vport->cfg_restrict_login) { out: spin_lock_irq(shost->host_lock); ndlp->nlp_flag |= NLP_TARGET_REMOVE; spin_unlock_irq(shost->host_lock); lpfc_issue_els_logo(vport, ndlp, 0); ndlp->nlp_prev_state = NLP_STE_PRLI_ISSUE; lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); return ndlp->nlp_state; } ndlp->nlp_prev_state = NLP_STE_PRLI_ISSUE; if (ndlp->nlp_type & NLP_FCP_TARGET) lpfc_nlp_set_state(vport, ndlp, NLP_STE_MAPPED_NODE); else lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); return ndlp->nlp_state; } /*! lpfc_device_rm_prli_issue * * \pre * \post * \param phba * \param ndlp * \param arg * \param evt * \return uint32_t * * \b Description: * This routine is envoked when we a request to remove a nport we are in the * process of PRLIing. We should software abort outstanding prli, unreg * login, send a logout. We will change node state to UNUSED_NODE, put it * on plogi list so it can be freed when LOGO completes. * */ static uint32_t lpfc_device_rm_prli_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct Scsi_Host *shost = lpfc_shost_from_vport(vport); if (ndlp->nlp_flag & NLP_NPR_2B_DISC) { spin_lock_irq(shost->host_lock); ndlp->nlp_flag |= NLP_NODEV_REMOVE; spin_unlock_irq(shost->host_lock); return ndlp->nlp_state; } else { /* software abort outstanding PLOGI */ lpfc_els_abort(vport->phba, ndlp); lpfc_drop_node(vport, ndlp); return NLP_STE_FREED_NODE; } } /*! lpfc_device_recov_prli_issue * * \pre * \post * \param phba * \param ndlp * \param arg * \param evt * \return uint32_t * * \b Description: * The routine is envoked when the state of a device is unknown, like * during a link down. We should remove the nodelist entry from the * unmapped list, issue a UNREG_LOGIN, do a software abort of the * outstanding PRLI command, then free the node entry. */ static uint32_t lpfc_device_recov_prli_issue(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct Scsi_Host *shost = lpfc_shost_from_vport(vport); struct lpfc_hba *phba = vport->phba; /* Don't do anything that will mess up processing of the * previous RSCN. */ if (vport->fc_flag & FC_RSCN_DEFERRED) return ndlp->nlp_state; /* software abort outstanding PRLI */ lpfc_els_abort(phba, ndlp); ndlp->nlp_prev_state = NLP_STE_PRLI_ISSUE; lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); spin_lock_irq(shost->host_lock); ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC); spin_unlock_irq(shost->host_lock); lpfc_disc_set_adisc(vport, ndlp); return ndlp->nlp_state; } static uint32_t lpfc_rcv_plogi_unmap_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; lpfc_rcv_plogi(vport, ndlp, cmdiocb); return ndlp->nlp_state; } static uint32_t lpfc_rcv_prli_unmap_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; lpfc_rcv_prli(vport, ndlp, cmdiocb); lpfc_els_rsp_prli_acc(vport, cmdiocb, ndlp); return ndlp->nlp_state; } static uint32_t lpfc_rcv_logo_unmap_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; lpfc_rcv_logo(vport, ndlp, cmdiocb, ELS_CMD_LOGO); return ndlp->nlp_state; } static uint32_t lpfc_rcv_padisc_unmap_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; lpfc_rcv_padisc(vport, ndlp, cmdiocb); return ndlp->nlp_state; } static uint32_t lpfc_rcv_prlo_unmap_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; lpfc_els_rsp_acc(vport, ELS_CMD_PRLO, cmdiocb, ndlp, NULL); return ndlp->nlp_state; } static uint32_t lpfc_device_recov_unmap_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct Scsi_Host *shost = lpfc_shost_from_vport(vport); ndlp->nlp_prev_state = NLP_STE_UNMAPPED_NODE; lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); spin_lock_irq(shost->host_lock); ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC); spin_unlock_irq(shost->host_lock); lpfc_disc_set_adisc(vport, ndlp); return ndlp->nlp_state; } static uint32_t lpfc_rcv_plogi_mapped_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; lpfc_rcv_plogi(vport, ndlp, cmdiocb); return ndlp->nlp_state; } static uint32_t lpfc_rcv_prli_mapped_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; lpfc_els_rsp_prli_acc(vport, cmdiocb, ndlp); return ndlp->nlp_state; } static uint32_t lpfc_rcv_logo_mapped_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; lpfc_rcv_logo(vport, ndlp, cmdiocb, ELS_CMD_LOGO); return ndlp->nlp_state; } static uint32_t lpfc_rcv_padisc_mapped_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; lpfc_rcv_padisc(vport, ndlp, cmdiocb); return ndlp->nlp_state; } static uint32_t lpfc_rcv_prlo_mapped_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_hba *phba = vport->phba; struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; /* flush the target */ lpfc_sli_abort_iocb(vport, &phba->sli.ring[phba->sli.fcp_ring], ndlp->nlp_sid, 0, LPFC_CTX_TGT); /* Treat like rcv logo */ lpfc_rcv_logo(vport, ndlp, cmdiocb, ELS_CMD_PRLO); return ndlp->nlp_state; } static uint32_t lpfc_device_recov_mapped_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct Scsi_Host *shost = lpfc_shost_from_vport(vport); ndlp->nlp_prev_state = NLP_STE_MAPPED_NODE; lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); spin_lock_irq(shost->host_lock); ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC); spin_unlock_irq(shost->host_lock); lpfc_disc_set_adisc(vport, ndlp); return ndlp->nlp_state; } static uint32_t lpfc_rcv_plogi_npr_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct Scsi_Host *shost = lpfc_shost_from_vport(vport); struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; /* Ignore PLOGI if we have an outstanding LOGO */ if (ndlp->nlp_flag & (NLP_LOGO_SND | NLP_LOGO_ACC)) return ndlp->nlp_state; if (lpfc_rcv_plogi(vport, ndlp, cmdiocb)) { lpfc_cancel_retry_delay_tmo(vport, ndlp); spin_lock_irq(shost->host_lock); ndlp->nlp_flag &= ~(NLP_NPR_ADISC | NLP_NPR_2B_DISC); spin_unlock_irq(shost->host_lock); } else if (!(ndlp->nlp_flag & NLP_NPR_2B_DISC)) { /* send PLOGI immediately, move to PLOGI issue state */ if (!(ndlp->nlp_flag & NLP_DELAY_TMO)) { ndlp->nlp_prev_state = NLP_STE_NPR_NODE; lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE); lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0); } } return ndlp->nlp_state; } static uint32_t lpfc_rcv_prli_npr_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct Scsi_Host *shost = lpfc_shost_from_vport(vport); struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; struct ls_rjt stat; memset(&stat, 0, sizeof (struct ls_rjt)); stat.un.b.lsRjtRsnCode = LSRJT_UNABLE_TPC; stat.un.b.lsRjtRsnCodeExp = LSEXP_NOTHING_MORE; lpfc_els_rsp_reject(vport, stat.un.lsRjtError, cmdiocb, ndlp, NULL); if (!(ndlp->nlp_flag & NLP_DELAY_TMO)) { if (ndlp->nlp_flag & NLP_NPR_ADISC) { spin_lock_irq(shost->host_lock); ndlp->nlp_flag &= ~NLP_NPR_ADISC; ndlp->nlp_prev_state = NLP_STE_NPR_NODE; spin_unlock_irq(shost->host_lock); lpfc_nlp_set_state(vport, ndlp, NLP_STE_ADISC_ISSUE); lpfc_issue_els_adisc(vport, ndlp, 0); } else { ndlp->nlp_prev_state = NLP_STE_NPR_NODE; lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE); lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0); } } return ndlp->nlp_state; } static uint32_t lpfc_rcv_logo_npr_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; lpfc_rcv_logo(vport, ndlp, cmdiocb, ELS_CMD_LOGO); return ndlp->nlp_state; } static uint32_t lpfc_rcv_padisc_npr_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; lpfc_rcv_padisc(vport, ndlp, cmdiocb); /* * Do not start discovery if discovery is about to start * or discovery in progress for this node. Starting discovery * here will affect the counting of discovery threads. */ if (!(ndlp->nlp_flag & NLP_DELAY_TMO) && !(ndlp->nlp_flag & NLP_NPR_2B_DISC)) { if (ndlp->nlp_flag & NLP_NPR_ADISC) { ndlp->nlp_flag &= ~NLP_NPR_ADISC; ndlp->nlp_prev_state = NLP_STE_NPR_NODE; lpfc_nlp_set_state(vport, ndlp, NLP_STE_ADISC_ISSUE); lpfc_issue_els_adisc(vport, ndlp, 0); } else { ndlp->nlp_prev_state = NLP_STE_NPR_NODE; lpfc_nlp_set_state(vport, ndlp, NLP_STE_PLOGI_ISSUE); lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0); } } return ndlp->nlp_state; } static uint32_t lpfc_rcv_prlo_npr_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct Scsi_Host *shost = lpfc_shost_from_vport(vport); struct lpfc_iocbq *cmdiocb = (struct lpfc_iocbq *) arg; spin_lock_irq(shost->host_lock); ndlp->nlp_flag |= NLP_LOGO_ACC; spin_unlock_irq(shost->host_lock); lpfc_els_rsp_acc(vport, ELS_CMD_ACC, cmdiocb, ndlp, NULL); if ((ndlp->nlp_flag & NLP_DELAY_TMO) == 0) { mod_timer(&ndlp->nlp_delayfunc, jiffies + HZ * 1); spin_lock_irq(shost->host_lock); ndlp->nlp_flag |= NLP_DELAY_TMO; ndlp->nlp_flag &= ~NLP_NPR_ADISC; spin_unlock_irq(shost->host_lock); ndlp->nlp_last_elscmd = ELS_CMD_PLOGI; } else { spin_lock_irq(shost->host_lock); ndlp->nlp_flag &= ~NLP_NPR_ADISC; spin_unlock_irq(shost->host_lock); } return ndlp->nlp_state; } static uint32_t lpfc_cmpl_plogi_npr_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb, *rspiocb; IOCB_t *irsp; cmdiocb = (struct lpfc_iocbq *) arg; rspiocb = cmdiocb->context_un.rsp_iocb; irsp = &rspiocb->iocb; if (irsp->ulpStatus) { ndlp->nlp_flag |= NLP_DEFER_RM; return NLP_STE_FREED_NODE; } return ndlp->nlp_state; } static uint32_t lpfc_cmpl_prli_npr_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb, *rspiocb; IOCB_t *irsp; cmdiocb = (struct lpfc_iocbq *) arg; rspiocb = cmdiocb->context_un.rsp_iocb; irsp = &rspiocb->iocb; if (irsp->ulpStatus && (ndlp->nlp_flag & NLP_NODEV_REMOVE)) { lpfc_drop_node(vport, ndlp); return NLP_STE_FREED_NODE; } return ndlp->nlp_state; } static uint32_t lpfc_cmpl_logo_npr_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct Scsi_Host *shost = lpfc_shost_from_vport(vport); if (ndlp->nlp_DID == Fabric_DID) { spin_lock_irq(shost->host_lock); vport->fc_flag &= ~(FC_FABRIC | FC_PUBLIC_LOOP); spin_unlock_irq(shost->host_lock); } lpfc_unreg_rpi(vport, ndlp); return ndlp->nlp_state; } static uint32_t lpfc_cmpl_adisc_npr_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct lpfc_iocbq *cmdiocb, *rspiocb; IOCB_t *irsp; cmdiocb = (struct lpfc_iocbq *) arg; rspiocb = cmdiocb->context_un.rsp_iocb; irsp = &rspiocb->iocb; if (irsp->ulpStatus && (ndlp->nlp_flag & NLP_NODEV_REMOVE)) { lpfc_drop_node(vport, ndlp); return NLP_STE_FREED_NODE; } return ndlp->nlp_state; } static uint32_t lpfc_cmpl_reglogin_npr_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { LPFC_MBOXQ_t *pmb = (LPFC_MBOXQ_t *) arg; MAILBOX_t *mb = &pmb->u.mb; if (!mb->mbxStatus) { ndlp->nlp_rpi = mb->un.varWords[0]; ndlp->nlp_flag |= NLP_RPI_VALID; } else { if (ndlp->nlp_flag & NLP_NODEV_REMOVE) { lpfc_drop_node(vport, ndlp); return NLP_STE_FREED_NODE; } } return ndlp->nlp_state; } static uint32_t lpfc_device_rm_npr_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct Scsi_Host *shost = lpfc_shost_from_vport(vport); if (ndlp->nlp_flag & NLP_NPR_2B_DISC) { spin_lock_irq(shost->host_lock); ndlp->nlp_flag |= NLP_NODEV_REMOVE; spin_unlock_irq(shost->host_lock); return ndlp->nlp_state; } lpfc_drop_node(vport, ndlp); return NLP_STE_FREED_NODE; } static uint32_t lpfc_device_recov_npr_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { struct Scsi_Host *shost = lpfc_shost_from_vport(vport); /* Don't do anything that will mess up processing of the * previous RSCN. */ if (vport->fc_flag & FC_RSCN_DEFERRED) return ndlp->nlp_state; lpfc_cancel_retry_delay_tmo(vport, ndlp); spin_lock_irq(shost->host_lock); ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC); spin_unlock_irq(shost->host_lock); return ndlp->nlp_state; } /* This next section defines the NPort Discovery State Machine */ /* There are 4 different double linked lists nodelist entries can reside on. * The plogi list and adisc list are used when Link Up discovery or RSCN * processing is needed. Each list holds the nodes that we will send PLOGI * or ADISC on. These lists will keep track of what nodes will be effected * by an RSCN, or a Link Up (Typically, all nodes are effected on Link Up). * The unmapped_list will contain all nodes that we have successfully logged * into at the Fibre Channel level. The mapped_list will contain all nodes * that are mapped FCP targets. */ /* * The bind list is a list of undiscovered (potentially non-existent) nodes * that we have saved binding information on. This information is used when * nodes transition from the unmapped to the mapped list. */ /* For UNUSED_NODE state, the node has just been allocated . * For PLOGI_ISSUE and REG_LOGIN_ISSUE, the node is on * the PLOGI list. For REG_LOGIN_COMPL, the node is taken off the PLOGI list * and put on the unmapped list. For ADISC processing, the node is taken off * the ADISC list and placed on either the mapped or unmapped list (depending * on its previous state). Once on the unmapped list, a PRLI is issued and the * state changed to PRLI_ISSUE. When the PRLI completion occurs, the state is * changed to UNMAPPED_NODE. If the completion indicates a mapped * node, the node is taken off the unmapped list. The binding list is checked * for a valid binding, or a binding is automatically assigned. If binding * assignment is unsuccessful, the node is left on the unmapped list. If * binding assignment is successful, the associated binding list entry (if * any) is removed, and the node is placed on the mapped list. */ /* * For a Link Down, all nodes on the ADISC, PLOGI, unmapped or mapped * lists will receive a DEVICE_RECOVERY event. If the linkdown or devloss timers * expire, all effected nodes will receive a DEVICE_RM event. */ /* * For a Link Up or RSCN, all nodes will move from the mapped / unmapped lists * to either the ADISC or PLOGI list. After a Nameserver query or ALPA loopmap * check, additional nodes may be added or removed (via DEVICE_RM) to / from * the PLOGI or ADISC lists. Once the PLOGI and ADISC lists are populated, * we will first process the ADISC list. 32 entries are processed initially and * ADISC is initited for each one. Completions / Events for each node are * funnelled thru the state machine. As each node finishes ADISC processing, it * starts ADISC for any nodes waiting for ADISC processing. If no nodes are * waiting, and the ADISC list count is identically 0, then we are done. For * Link Up discovery, since all nodes on the PLOGI list are UNREG_LOGIN'ed, we * can issue a CLEAR_LA and reenable Link Events. Next we will process the PLOGI * list. 32 entries are processed initially and PLOGI is initited for each one. * Completions / Events for each node are funnelled thru the state machine. As * each node finishes PLOGI processing, it starts PLOGI for any nodes waiting * for PLOGI processing. If no nodes are waiting, and the PLOGI list count is * indentically 0, then we are done. We have now completed discovery / RSCN * handling. Upon completion, ALL nodes should be on either the mapped or * unmapped lists. */ static uint32_t (*lpfc_disc_action[NLP_STE_MAX_STATE * NLP_EVT_MAX_EVENT]) (struct lpfc_vport *, struct lpfc_nodelist *, void *, uint32_t) = { /* Action routine Event Current State */ lpfc_rcv_plogi_unused_node, /* RCV_PLOGI UNUSED_NODE */ lpfc_rcv_els_unused_node, /* RCV_PRLI */ lpfc_rcv_logo_unused_node, /* RCV_LOGO */ lpfc_rcv_els_unused_node, /* RCV_ADISC */ lpfc_rcv_els_unused_node, /* RCV_PDISC */ lpfc_rcv_els_unused_node, /* RCV_PRLO */ lpfc_disc_illegal, /* CMPL_PLOGI */ lpfc_disc_illegal, /* CMPL_PRLI */ lpfc_cmpl_logo_unused_node, /* CMPL_LOGO */ lpfc_disc_illegal, /* CMPL_ADISC */ lpfc_disc_illegal, /* CMPL_REG_LOGIN */ lpfc_device_rm_unused_node, /* DEVICE_RM */ lpfc_disc_illegal, /* DEVICE_RECOVERY */ lpfc_rcv_plogi_plogi_issue, /* RCV_PLOGI PLOGI_ISSUE */ lpfc_rcv_prli_plogi_issue, /* RCV_PRLI */ lpfc_rcv_logo_plogi_issue, /* RCV_LOGO */ lpfc_rcv_els_plogi_issue, /* RCV_ADISC */ lpfc_rcv_els_plogi_issue, /* RCV_PDISC */ lpfc_rcv_els_plogi_issue, /* RCV_PRLO */ lpfc_cmpl_plogi_plogi_issue, /* CMPL_PLOGI */ lpfc_disc_illegal, /* CMPL_PRLI */ lpfc_cmpl_logo_plogi_issue, /* CMPL_LOGO */ lpfc_disc_illegal, /* CMPL_ADISC */ lpfc_cmpl_reglogin_plogi_issue,/* CMPL_REG_LOGIN */ lpfc_device_rm_plogi_issue, /* DEVICE_RM */ lpfc_device_recov_plogi_issue, /* DEVICE_RECOVERY */ lpfc_rcv_plogi_adisc_issue, /* RCV_PLOGI ADISC_ISSUE */ lpfc_rcv_prli_adisc_issue, /* RCV_PRLI */ lpfc_rcv_logo_adisc_issue, /* RCV_LOGO */ lpfc_rcv_padisc_adisc_issue, /* RCV_ADISC */ lpfc_rcv_padisc_adisc_issue, /* RCV_PDISC */ lpfc_rcv_prlo_adisc_issue, /* RCV_PRLO */ lpfc_disc_illegal, /* CMPL_PLOGI */ lpfc_disc_illegal, /* CMPL_PRLI */ lpfc_disc_illegal, /* CMPL_LOGO */ lpfc_cmpl_adisc_adisc_issue, /* CMPL_ADISC */ lpfc_disc_illegal, /* CMPL_REG_LOGIN */ lpfc_device_rm_adisc_issue, /* DEVICE_RM */ lpfc_device_recov_adisc_issue, /* DEVICE_RECOVERY */ lpfc_rcv_plogi_reglogin_issue, /* RCV_PLOGI REG_LOGIN_ISSUE */ lpfc_rcv_prli_reglogin_issue, /* RCV_PLOGI */ lpfc_rcv_logo_reglogin_issue, /* RCV_LOGO */ lpfc_rcv_padisc_reglogin_issue, /* RCV_ADISC */ lpfc_rcv_padisc_reglogin_issue, /* RCV_PDISC */ lpfc_rcv_prlo_reglogin_issue, /* RCV_PRLO */ lpfc_cmpl_plogi_illegal, /* CMPL_PLOGI */ lpfc_disc_illegal, /* CMPL_PRLI */ lpfc_disc_illegal, /* CMPL_LOGO */ lpfc_disc_illegal, /* CMPL_ADISC */ lpfc_cmpl_reglogin_reglogin_issue,/* CMPL_REG_LOGIN */ lpfc_device_rm_reglogin_issue, /* DEVICE_RM */ lpfc_device_recov_reglogin_issue,/* DEVICE_RECOVERY */ lpfc_rcv_plogi_prli_issue, /* RCV_PLOGI PRLI_ISSUE */ lpfc_rcv_prli_prli_issue, /* RCV_PRLI */ lpfc_rcv_logo_prli_issue, /* RCV_LOGO */ lpfc_rcv_padisc_prli_issue, /* RCV_ADISC */ lpfc_rcv_padisc_prli_issue, /* RCV_PDISC */ lpfc_rcv_prlo_prli_issue, /* RCV_PRLO */ lpfc_cmpl_plogi_illegal, /* CMPL_PLOGI */ lpfc_cmpl_prli_prli_issue, /* CMPL_PRLI */ lpfc_disc_illegal, /* CMPL_LOGO */ lpfc_disc_illegal, /* CMPL_ADISC */ lpfc_disc_illegal, /* CMPL_REG_LOGIN */ lpfc_device_rm_prli_issue, /* DEVICE_RM */ lpfc_device_recov_prli_issue, /* DEVICE_RECOVERY */ lpfc_rcv_plogi_unmap_node, /* RCV_PLOGI UNMAPPED_NODE */ lpfc_rcv_prli_unmap_node, /* RCV_PRLI */ lpfc_rcv_logo_unmap_node, /* RCV_LOGO */ lpfc_rcv_padisc_unmap_node, /* RCV_ADISC */ lpfc_rcv_padisc_unmap_node, /* RCV_PDISC */ lpfc_rcv_prlo_unmap_node, /* RCV_PRLO */ lpfc_disc_illegal, /* CMPL_PLOGI */ lpfc_disc_illegal, /* CMPL_PRLI */ lpfc_disc_illegal, /* CMPL_LOGO */ lpfc_disc_illegal, /* CMPL_ADISC */ lpfc_disc_illegal, /* CMPL_REG_LOGIN */ lpfc_disc_illegal, /* DEVICE_RM */ lpfc_device_recov_unmap_node, /* DEVICE_RECOVERY */ lpfc_rcv_plogi_mapped_node, /* RCV_PLOGI MAPPED_NODE */ lpfc_rcv_prli_mapped_node, /* RCV_PRLI */ lpfc_rcv_logo_mapped_node, /* RCV_LOGO */ lpfc_rcv_padisc_mapped_node, /* RCV_ADISC */ lpfc_rcv_padisc_mapped_node, /* RCV_PDISC */ lpfc_rcv_prlo_mapped_node, /* RCV_PRLO */ lpfc_disc_illegal, /* CMPL_PLOGI */ lpfc_disc_illegal, /* CMPL_PRLI */ lpfc_disc_illegal, /* CMPL_LOGO */ lpfc_disc_illegal, /* CMPL_ADISC */ lpfc_disc_illegal, /* CMPL_REG_LOGIN */ lpfc_disc_illegal, /* DEVICE_RM */ lpfc_device_recov_mapped_node, /* DEVICE_RECOVERY */ lpfc_rcv_plogi_npr_node, /* RCV_PLOGI NPR_NODE */ lpfc_rcv_prli_npr_node, /* RCV_PRLI */ lpfc_rcv_logo_npr_node, /* RCV_LOGO */ lpfc_rcv_padisc_npr_node, /* RCV_ADISC */ lpfc_rcv_padisc_npr_node, /* RCV_PDISC */ lpfc_rcv_prlo_npr_node, /* RCV_PRLO */ lpfc_cmpl_plogi_npr_node, /* CMPL_PLOGI */ lpfc_cmpl_prli_npr_node, /* CMPL_PRLI */ lpfc_cmpl_logo_npr_node, /* CMPL_LOGO */ lpfc_cmpl_adisc_npr_node, /* CMPL_ADISC */ lpfc_cmpl_reglogin_npr_node, /* CMPL_REG_LOGIN */ lpfc_device_rm_npr_node, /* DEVICE_RM */ lpfc_device_recov_npr_node, /* DEVICE_RECOVERY */ }; int lpfc_disc_state_machine(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, void *arg, uint32_t evt) { uint32_t cur_state, rc; uint32_t(*func) (struct lpfc_vport *, struct lpfc_nodelist *, void *, uint32_t); uint32_t got_ndlp = 0; if (lpfc_nlp_get(ndlp)) got_ndlp = 1; cur_state = ndlp->nlp_state; /* DSM in event <evt> on NPort <nlp_DID> in state <cur_state> */ lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, "0211 DSM in event x%x on NPort x%x in " "state %d Data: x%x\n", evt, ndlp->nlp_DID, cur_state, ndlp->nlp_flag); lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_DSM, "DSM in: evt:%d ste:%d did:x%x", evt, cur_state, ndlp->nlp_DID); func = lpfc_disc_action[(cur_state * NLP_EVT_MAX_EVENT) + evt]; rc = (func) (vport, ndlp, arg, evt); /* DSM out state <rc> on NPort <nlp_DID> */ if (got_ndlp) { lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, "0212 DSM out state %d on NPort x%x Data: x%x\n", rc, ndlp->nlp_DID, ndlp->nlp_flag); lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_DSM, "DSM out: ste:%d did:x%x flg:x%x", rc, ndlp->nlp_DID, ndlp->nlp_flag); /* Decrement the ndlp reference count held for this function */ lpfc_nlp_put(ndlp); } else { lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, "0213 DSM out state %d on NPort free\n", rc); lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_DSM, "DSM out: ste:%d did:x%x flg:x%x", rc, 0, 0); } return rc; }
<!DOCTYPE html> <meta charset=utf-8> <title>invalid cite: userinfo-backslash</title> <q cite="http://a\b:c\d@foo.com"></q>
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Security\Http\Tests\Logout; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Http\Logout\SessionLogoutHandler; class SessionLogoutHandlerTest extends \PHPUnit_Framework_TestCase { public function testLogout() { $handler = new SessionLogoutHandler(); $request = $this->getMock('Symfony\Component\HttpFoundation\Request'); $response = new Response(); $session = $this->getMock('Symfony\Component\HttpFoundation\Session\Session', array(), array(), '', false); $request ->expects($this->once()) ->method('getSession') ->will($this->returnValue($session)) ; $session ->expects($this->once()) ->method('invalidate') ; $handler->logout($request, $response, $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface')); } }
class Hashpump < Formula desc "Tool to exploit hash length extension attack" homepage "https://github.com/bwall/HashPump" url "https://github.com/bwall/HashPump/archive/v1.2.0.tar.gz" sha256 "d002e24541c6604e5243e5325ef152e65f9fcd00168a9fa7a06ad130e28b811b" bottle do cellar :any revision 1 sha256 "bc00f1a7c60564fed1ebf0ece40306aa169e4a7ddf7f9c8d56c7088130f5e530" => :el_capitan sha256 "8b33f44272b46174184639f3a6044f47151756039068343262d3e2cbe4a26a7c" => :yosemite sha256 "667650946f6e697657832f9f906f3a548bc55991e2422f8cbbbe7c793434111f" => :mavericks sha256 "a776ebf2d22d7b5fa492308fff20409696064ea70149c5cac695b75bcf004d7c" => :mountain_lion end option "without-python", "Build without python 2 support" depends_on "openssl" depends_on :python => :recommended if MacOS.version <= :snow_leopard depends_on :python3 => :optional # Remove on next release patch do url "https://patch-diff.githubusercontent.com/raw/bwall/HashPump/pull/14.diff" sha256 "47236fed281000726942740002e44ef8bb90b05f55b2e7deeb183d9f708906c1" end def install bin.mkpath system "make", "INSTALLLOCATION=#{bin}", "CXX=#{ENV.cxx}", "install" Language::Python.each_python(build) do |python, _version| system python, *Language::Python.setup_install_args(prefix) end end test do output = %x(#{bin}/hashpump -s '6d5f807e23db210bc254a28be2d6759a0f5f5d99' \\ -d 'count=10&lat=37.351&user_id=1&long=-119.827&waffle=eggo' \\ -a '&waffle=liege' -k 14) assert output.include? "0e41270260895979317fff3898ab85668953aaa2" assert output.include? "&waffle=liege" assert_equal 0, $?.exitstatus end end
import React, {useState} from 'react'; import { ScrollView, StyleSheet, Text, TouchableOpacity, Platform, Linking, } from 'react-native'; import AutoHeightWebView from 'react-native-autoheight-webview'; import { autoHeightHtml0, autoHeightHtml1, autoHeightScript, autoWidthHtml0, autoWidthHtml1, autoWidthScript, autoDetectLinkScript, style0, inlineBodyStyle, } from './config'; const onShouldStartLoadWithRequest = result => { console.log(result); return true; }; const onError = ({nativeEvent}) => console.error('WebView error: ', nativeEvent); const onMessage = event => { const {data} = event.nativeEvent; let messageData; // maybe parse stringified JSON try { messageData = JSON.parse(data); } catch (e) { console.log(e.message); } if (typeof messageData === 'object') { const {url} = messageData; // check if this message concerns us if (url && url.startsWith('http')) { Linking.openURL(url).catch(error => console.error('An error occurred', error), ); } } }; const onHeightLoadStart = () => console.log('height on load start'); const onHeightLoad = () => console.log('height on load'); const onHeightLoadEnd = () => console.log('height on load end'); const onWidthLoadStart = () => console.log('width on load start'); const onWidthLoad = () => console.log('width on load'); const onWidthLoadEnd = () => console.log('width on load end'); const Explorer = () => { const [{widthHtml, heightHtml}, setHtml] = useState({ widthHtml: autoWidthHtml0, heightHtml: autoHeightHtml0, }); const changeSource = () => setHtml({ widthHtml: widthHtml === autoWidthHtml0 ? autoWidthHtml1 : autoWidthHtml0, heightHtml: heightHtml === autoHeightHtml0 ? autoHeightHtml1 : autoHeightHtml0, }); const [{widthStyle, heightStyle}, setStyle] = useState({ heightStyle: null, widthStyle: inlineBodyStyle, }); const changeStyle = () => setStyle({ widthStyle: widthStyle === inlineBodyStyle ? style0 + inlineBodyStyle : inlineBodyStyle, heightStyle: heightStyle === null ? style0 : null, }); const [{widthScript, heightScript}, setScript] = useState({ heightScript: autoDetectLinkScript, widthScript: null, }); const changeScript = () => setScript({ widthScript: widthScript == autoWidthScript ? autoWidthScript : null, heightScript: heightScript !== autoDetectLinkScript ? autoDetectLinkScript : autoHeightScript + autoDetectLinkScript, }); const [heightSize, setHeightSize] = useState({height: 0, width: 0}); const [widthSize, setWidthSize] = useState({height: 0, width: 0}); return ( <ScrollView style={{ paddingTop: 45, backgroundColor: 'lightyellow', }} contentContainerStyle={{ justifyContent: 'center', alignItems: 'center', }}> <AutoHeightWebView customStyle={heightStyle} onError={onError} onLoad={onHeightLoad} onLoadStart={onHeightLoadStart} onLoadEnd={onHeightLoadEnd} onShouldStartLoadWithRequest={onShouldStartLoadWithRequest} onSizeUpdated={setHeightSize} source={{html: heightHtml}} customScript={heightScript} onMessage={onMessage} /> <Text style={{padding: 5}}> height: {heightSize.height}, width: {heightSize.width} </Text> <AutoHeightWebView style={{ marginTop: 15, }} customStyle={widthStyle} onError={onError} onLoad={onWidthLoad} onLoadStart={onWidthLoadStart} onLoadEnd={onWidthLoadEnd} onShouldStartLoadWithRequest={onShouldStartLoadWithRequest} onSizeUpdated={setWidthSize} allowFileAccessFromFileURLs={true} allowUniversalAccessFromFileURLs={true} source={{ html: widthHtml, baseUrl: Platform.OS === 'android' ? 'file:///android_asset/' : 'web/', }} customScript={widthScript} /> <Text style={{padding: 5}}> height: {widthSize.height}, width: {widthSize.width} </Text> <TouchableOpacity onPress={changeSource} style={styles.button}> <Text>change source</Text> </TouchableOpacity> <TouchableOpacity onPress={changeStyle} style={styles.button}> <Text>change style</Text> </TouchableOpacity> <TouchableOpacity onPress={changeScript} style={[styles.button, {marginBottom: 100}]}> <Text>change script</Text> </TouchableOpacity> </ScrollView> ); }; const styles = StyleSheet.create({ button: { marginTop: 15, backgroundColor: 'aliceblue', borderRadius: 5, padding: 5, }, }); export default Explorer;
/* * Copyright © 2015 <code@io7m.com> http://io7m.com * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ package com.io7m.jcanephora.fake; import com.io7m.jcanephora.core.JCGLArrayBufferType; import com.io7m.jcanephora.core.JCGLArrayBufferUsableType; import com.io7m.jcanephora.core.JCGLBufferUpdateType; import com.io7m.jcanephora.core.JCGLException; import com.io7m.jcanephora.core.JCGLExceptionBufferNotBound; import com.io7m.jcanephora.core.JCGLExceptionDeleted; import com.io7m.jcanephora.core.JCGLResources; import com.io7m.jcanephora.core.JCGLUsageHint; import com.io7m.jcanephora.core.api.JCGLArrayBuffersType; import com.io7m.jcanephora.core.api.JCGLByteBufferProducerType; import com.io7m.jnull.NullCheck; import com.io7m.jnull.Nullable; import com.io7m.jranges.RangeCheck; import com.io7m.jranges.Ranges; import com.io7m.junsigned.ranges.UnsignedRangeInclusiveL; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.nio.ByteBuffer; import java.util.Objects; import java.util.Optional; final class FakeArrayBuffers implements JCGLArrayBuffersType { private static final Logger LOG; static { LOG = LoggerFactory.getLogger(FakeArrayBuffers.class); } private final FakeContext context; private @Nullable FakeArrayBuffer bind; FakeArrayBuffers(final FakeContext c) { this.context = NullCheck.notNull(c, "Context"); } private void actualBind(final FakeArrayBuffer a) { LOG.trace("bind {} -> {}", this.bind, a); if (!Objects.equals(a, this.bind)) { this.bind = a; } } private void actualUnbind() { LOG.trace( "unbind {} -> {}", this.bind, null); if (this.bind != null) { this.bind = null; } } @Override public ByteBuffer arrayBufferRead( final JCGLArrayBufferUsableType a, final JCGLByteBufferProducerType f) throws JCGLException, JCGLExceptionDeleted, JCGLExceptionBufferNotBound { NullCheck.notNull(a, "Array"); this.checkArray(a); if (Objects.equals(a, this.bind)) { final UnsignedRangeInclusiveL r = a.byteRange(); final long size = r.getInterval(); final ByteBuffer b = f.apply(size); b.rewind(); final FakeArrayBuffer fa = (FakeArrayBuffer) a; final ByteBuffer fa_data = fa.getData(); /* * XXX: Clearly overflowing integers. */ final long lo = r.getLower(); final long hi = r.getUpper(); for (long index = lo; Long.compareUnsigned(index, hi) <= 0; ++index) { final int ii = (int) index; final byte x = fa_data.get(ii); b.put(ii, x); } return b; } throw this.notBound(a); } @Override public JCGLArrayBufferType arrayBufferAllocate( final long size, final JCGLUsageHint usage) throws JCGLException { RangeCheck.checkIncludedInLong( size, "Size", Ranges.NATURAL_LONG, "Valid size range"); LOG.debug( "allocate ({} bytes, {})", Long.valueOf(size), usage); final ByteBuffer data = ByteBuffer.allocate((int) size); final FakeArrayBuffer ao = new FakeArrayBuffer( this.context, this.context.getFreshID(), data, usage); this.actualBind(ao); return ao; } @Override public void arrayBufferReallocate(final JCGLArrayBufferUsableType a) throws JCGLException, JCGLExceptionDeleted, JCGLExceptionBufferNotBound { this.checkArray(a); if (Objects.equals(a, this.bind)) { final UnsignedRangeInclusiveL r = a.byteRange(); final long size = r.getInterval(); final JCGLUsageHint usage = a.usageHint(); if (LOG.isDebugEnabled()) { LOG.debug( "reallocate ({} bytes, {})", Long.valueOf(size), usage); } } else { throw this.notBound(a); } } @Override public Optional<JCGLArrayBufferUsableType> arrayBufferGetCurrentlyBound() throws JCGLException { return Optional.ofNullable(this.bind); } @Override public boolean arrayBufferAnyIsBound() throws JCGLException { return this.bind != null; } @Override public boolean arrayBufferIsBound( final JCGLArrayBufferUsableType a) throws JCGLException { this.checkArray(a); return Objects.equals(a, this.bind); } @Override public void arrayBufferBind(final JCGLArrayBufferUsableType a) throws JCGLException, JCGLExceptionDeleted { this.checkArray(a); this.actualBind((FakeArrayBuffer) a); } private void checkArray(final JCGLArrayBufferUsableType a) { FakeCompatibilityChecks.checkArrayBuffer(this.context, a); JCGLResources.checkNotDeleted(a); } @Override public void arrayBufferUnbind() throws JCGLException { this.actualUnbind(); } @Override public void arrayBufferDelete(final JCGLArrayBufferType a) throws JCGLException, JCGLExceptionDeleted { this.checkArray(a); LOG.debug("delete {}", Integer.valueOf(a.glName())); ((FakeArrayBuffer) a).setDeleted(); if (Objects.equals(a, this.bind)) { this.actualUnbind(); } } @Override public void arrayBufferUpdate( final JCGLBufferUpdateType<JCGLArrayBufferType> u) throws JCGLException, JCGLExceptionDeleted, JCGLExceptionBufferNotBound { NullCheck.notNull(u, "Update"); final JCGLArrayBufferType a = u.buffer(); this.checkArray(a); if (Objects.equals(a, this.bind)) { final UnsignedRangeInclusiveL r = u.dataUpdateRange(); final ByteBuffer data = u.data(); data.rewind(); final FakeArrayBuffer fa = (FakeArrayBuffer) a; final ByteBuffer fa_data = fa.getData(); /* * XXX: Clearly overflowing integers. */ final long lo = r.getLower(); final long hi = r.getUpper(); for (long index = lo; Long.compareUnsigned(index, hi) <= 0; ++index) { final int ii = (int) index; fa_data.put(ii, data.get(ii)); } } else { throw this.notBound(a); } } private JCGLExceptionBufferNotBound notBound( final JCGLArrayBufferUsableType a) { final StringBuilder sb = new StringBuilder(128); sb.append("Buffer is not bound."); sb.append(System.lineSeparator()); sb.append(" Required: "); sb.append(a); sb.append(System.lineSeparator()); sb.append(" Actual: "); sb.append(this.bind == null ? "none" : this.bind); return new JCGLExceptionBufferNotBound(sb.toString()); } }
--- name: Shuriken Catapults modes: - range: (15cm) firepower: Small Arms ---
// Copyright (c) 2019 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. package lru import ( "container/list" "sync" ) // kv represents a key-value pair. type kv struct { key interface{} value interface{} } // KVCache provides a concurrency safe least-recently-used key/value cache with // nearly O(1) lookups, inserts, and deletions. The cache is limited to a // maximum number of items with eviction for the oldest entry when the // limit is exceeded. // // The NewKVCache function must be used to create a usable cache since the zero // value of this struct is not valid. type KVCache struct { mtx sync.Mutex cache map[interface{}]*list.Element // nearly O(1) lookups list *list.List // O(1) insert, update, delete limit uint } // Lookup returns the associated value of the passed key, if it is a member of // the cache. Looking up an existing item makes it the most recently used item. // // This function is safe for concurrent access. func (m *KVCache) Lookup(key interface{}) (interface{}, bool) { var value interface{} m.mtx.Lock() node, exists := m.cache[key] if exists { m.list.MoveToFront(node) pair := node.Value.(*kv) value = pair.value } m.mtx.Unlock() return value, exists } // Contains returns whether or not the passed key is a member of the cache. // The associated item of the passed key if it exists becomes the most // recently used item. // // This function is safe for concurrent access. func (m *KVCache) Contains(key interface{}) bool { m.mtx.Lock() node, exists := m.cache[key] if exists { m.list.MoveToFront(node) } m.mtx.Unlock() return exists } // Add adds the passed k/v to the cache and handles eviction of the oldest pair // if adding the new pair would exceed the max limit. Adding an existing pair // makes it the most recently used item. // // This function is safe for concurrent access. func (m *KVCache) Add(key interface{}, value interface{}) { m.mtx.Lock() defer m.mtx.Unlock() // When the limit is zero, nothing can be added to the cache, so just // return. if m.limit == 0 { return } // When the k/v already exists update the value and move it to the // front of the list thereby marking it most recently used. if node, exists := m.cache[key]; exists { node.Value.(*kv).value = value m.list.MoveToFront(node) m.cache[key] = node return } // Evict the least recently used k/v (back of the list) if the new // k/v would exceed the size limit for the cache. Also reuse the list // node so a new one doesn't have to be allocated. if uint(len(m.cache))+1 > m.limit { node := m.list.Back() lru := node.Value.(*kv) // Evict least recently used k/v. delete(m.cache, lru.key) // Reuse the list node of the k/v that was just evicted for the new // k/v. lru.key = key lru.value = value m.list.MoveToFront(node) m.cache[key] = node return } // The limit hasn't been reached yet, so just add the new k/v. node := m.list.PushFront(&kv{key: key, value: value}) m.cache[key] = node } // Delete deletes the k/v associated with passed key from the cache // (if it exists). // // This function is safe for concurrent access. func (m *KVCache) Delete(key interface{}) { m.mtx.Lock() if node, exists := m.cache[key]; exists { m.list.Remove(node) delete(m.cache, key) } m.mtx.Unlock() } // NewKVCache returns an initialized and empty KV LRU cache. // See the documentation for KV for more details. func NewKVCache(limit uint) KVCache { return KVCache{ cache: make(map[interface{}]*list.Element), list: list.New(), limit: limit, } }
* 0.1.1.0 Daniel Patterson <dbp@dbpmail.net> 2015-10-25 - Update to amazonka 1.*. * 0.1.0.0 Daniel Patterson <dbp@dbpmail.net> 2015-10-25 - Initial release.
# PaiGow 牌九(天九) ========= 牌九(天九),用木、骨或象牙制成。牌九是由骰子演变而来的,但牌九的构成远较骰子复杂,例如两个“六点”拼成“天牌”,两个“幺点”拼成“地牌”,一个“六点”和一个“五点”拼成“虎头”。一种汉族民间游戏用具。牌类娱乐用品。常用于赌博。因而牌九的玩法也比骰子更为多变和有趣。在明清时期盛行的“推牌九”、“打天九”都是较吸引人的游戏。麻将是骨牌中影响最广的一种游戏形式。 部分地方叫做‘骨牌’ 骨牌总共32块牌分为:宫.点.么三种牌名。 宫:天.地.人.和.梅.长.板.(每块两张同牌)。 点:九点(红九.黑九).八点(弯八.平八).七点(红七.黑七).红六点.五点(红五.黑五).红三点。 么:斧头.四六.么七.么六.(每块两张同牌)。 响:红六点加红三点称为响,是骨牌中最大的牌,分开使用就是最小的牌。 名称介绍 ========== 最大至尊宝,(皇上)猴王对 丁三配二四,歇后语“丁三配二四──绝配”由此而来,特点是点数3+6=9。二牌单数很小但对牌最大,是可玩味之处。 牌九图案 牌九图案(22张) 第二 双天 由两天牌组成 第三 双地 由两地牌组成 第四 双人 由两人牌组成 第五 双和, 双鹅 由两和牌组成 第六 双梅 由两梅花牌组成 第七 双长 由两长三牌组成 第八 双板凳 由两板凳牌组成 第九 双斧头 由两斧头牌组成 第十 双红头 由两红头牌组成 第十一 双高脚 由两高脚七牌组成 第十二 双零霖 由两零霖六牌组成 第十三 杂九 由两杂九牌组成 第十四 杂八 由两杂八牌组成 第十五 杂七 由两杂七牌组成 第十六 杂五 由两杂五牌组成 第十七 天王 王爷: 天牌配任何一种9点牌,即天牌配杂九牌,特点是点数为12+9=21,算个位数是1 第十八 地王 地牌配任何一种9点牌,即地牌配杂九牌。特点是点数为2+9=11,算个位数是1 第十九 天槓 天牌配任何一种8点牌,即天牌配人牌或杂八牌。特点是点数为12+8=20,算个位数是0 第二十 地槓 地牌配任何一种8点牌,即地牌配人牌或杂八牌。特点是点数为2+8=10,算个位数是0 第二十一 天高九 天牌配杂七中的二五牌,特点是点数为12+7=19,算个位数是9。 第二十二 地高九 地牌配高脚七牌,特点是点数为2+7=9,算个位数是9。 没有对牌,则以二牌之和的个位数分胜负。 ========== ![image](https://github.com/hxxyyangyong/PaiGow/blob/master/pai_screen_1.png)
<?php require_once "dbms.php"; $respuesta = getFieldPhoto("select photo from " . $_GET["source"] . " where id_" . $_GET["source"] . "=" . $_GET["id"]); //header('Content-type:image/gif'); //echo $respuesta; echo(base64_encode($respuesta)); ?>
"use strict"; import clear from "rollup-plugin-clear"; import resolve from "rollup-plugin-node-resolve"; import commonjs from "rollup-plugin-commonjs"; import typescript from "rollup-plugin-typescript2"; import screeps from "rollup-plugin-screeps"; let cfg; const dest = process.env.DEST; if (!dest) { console.log("No destination specified - code will be compiled but not uploaded"); } else if ((cfg = require("./screeps.json")[dest]) == null) { throw new Error("Invalid upload destination"); } export default { input: "src/main.ts", output: { file: "dist/main.js", format: "cjs", sourcemap: true }, plugins: [ clear({ targets: ["dist"] }), resolve(), commonjs(), typescript({tsconfig: "./tsconfig.json"}), screeps({config: cfg, dryRun: cfg == null}) ] }
#include <stan/math/prim/scal.hpp> #include <boost/math/special_functions/fpclassify.hpp> #include <gtest/gtest.h> TEST(MathFunctions, Phi) { EXPECT_EQ(0.5 + 0.5 * boost::math::erf(0.0), stan::math::Phi(0.0)); EXPECT_FLOAT_EQ(0.5 + 0.5 * boost::math::erf(0.9/std::sqrt(2.0)), stan::math::Phi(0.9)); EXPECT_EQ(0.5 + 0.5 * boost::math::erf(-5.0/std::sqrt(2.0)), stan::math::Phi(-5.0)); } // tests calculating using R 3.0.2 Snow Leopard build (6558) TEST(MathFunctions, PhiTails) { using stan::math::Phi; EXPECT_EQ(0, Phi(-40)); EXPECT_FLOAT_EQ(1, 4.60535300958196e-308 / Phi(-37.5)); EXPECT_FLOAT_EQ(1, 5.72557122252458e-300 / Phi(-37)); EXPECT_FLOAT_EQ(1, 5.54472571307484e-292 / Phi(-36.5)); EXPECT_FLOAT_EQ(1, 4.18262406579728e-284 / Phi(-36)); EXPECT_FLOAT_EQ(1, 2.45769154066194e-276 / Phi(-35.5)); EXPECT_FLOAT_EQ(1, 1.12491070647241e-268 / Phi(-35)); EXPECT_FLOAT_EQ(1, 4.01072896657726e-261 / Phi(-34.5)); EXPECT_FLOAT_EQ(1, 1.11389878557438e-253 / Phi(-34)); EXPECT_FLOAT_EQ(1, 2.40983869512039e-246 / Phi(-33.5)); EXPECT_FLOAT_EQ(1, 4.06118562091586e-239 / Phi(-33)); EXPECT_FLOAT_EQ(1, 5.33142435967881e-232 / Phi(-32.5)); EXPECT_FLOAT_EQ(1, 5.4520806035124e-225 / Phi(-32)); EXPECT_FLOAT_EQ(1, 4.34323260103177e-218 / Phi(-31.5)); EXPECT_FLOAT_EQ(1, 2.6952500812005e-211 / Phi(-31)); EXPECT_FLOAT_EQ(1, 1.30293791317808e-204 / Phi(-30.5)); EXPECT_FLOAT_EQ(1, 4.90671392714819e-198 / Phi(-30)); EXPECT_FLOAT_EQ(1, 1.43947455222918e-191 / Phi(-29.5)); EXPECT_FLOAT_EQ(1, 3.28978526670438e-185 / Phi(-29)); EXPECT_FLOAT_EQ(1, 5.85714125380634e-179 / Phi(-28.5)); EXPECT_FLOAT_EQ(1, 8.12386946965943e-173 / Phi(-28)); EXPECT_FLOAT_EQ(1, 8.77817055687808e-167 / Phi(-27.5)); EXPECT_FLOAT_EQ(1, 7.38948100688502e-161 / Phi(-27)); EXPECT_FLOAT_EQ(1, 4.84616266030332e-155 / Phi(-26.5)); EXPECT_FLOAT_EQ(1, 2.47606331550339e-149 / Phi(-26)); EXPECT_FLOAT_EQ(1, 9.85623651896393e-144 / Phi(-25.5)); EXPECT_FLOAT_EQ(1, 3.05669670638256e-138 / Phi(-25)); EXPECT_FLOAT_EQ(1, 7.38570686148941e-133 / Phi(-24.5)); EXPECT_FLOAT_EQ(1, 1.3903921185497e-127 / Phi(-24)); EXPECT_FLOAT_EQ(1, 2.03936756324998e-122 / Phi(-23.5)); EXPECT_FLOAT_EQ(1, 2.33063700622065e-117 / Phi(-23)); EXPECT_FLOAT_EQ(1, 2.07531079906636e-112 / Phi(-22.5)); EXPECT_FLOAT_EQ(1, 1.43989243514508e-107 / Phi(-22)); EXPECT_FLOAT_EQ(1, 7.78439707718263e-103 / Phi(-21.5)); EXPECT_FLOAT_EQ(1, 3.27927801897904e-98 / Phi(-21)); EXPECT_FLOAT_EQ(1, 1.0764673258791e-93 / Phi(-20.5)); EXPECT_FLOAT_EQ(1, 2.75362411860623e-89 / Phi(-20)); EXPECT_FLOAT_EQ(1, 5.48911547566041e-85 / Phi(-19.5)); EXPECT_FLOAT_EQ(1, 8.52722395263098e-81 / Phi(-19)); EXPECT_FLOAT_EQ(1, 1.03236986895633e-76 / Phi(-18.5)); EXPECT_FLOAT_EQ(1, 9.74094891893715e-73 / Phi(-18)); EXPECT_FLOAT_EQ(1, 7.16345876623504e-69 / Phi(-17.5)); EXPECT_FLOAT_EQ(1, 4.10599620209891e-65 / Phi(-17)); EXPECT_FLOAT_EQ(1, 1.83446300316473e-61 / Phi(-16.5)); EXPECT_FLOAT_EQ(1, 6.38875440053809e-58 / Phi(-16)); EXPECT_FLOAT_EQ(1, 1.73446079179387e-54 / Phi(-15.5)); EXPECT_FLOAT_EQ(1, 3.67096619931275e-51 / Phi(-15)); EXPECT_FLOAT_EQ(1, 6.05749476441522e-48 / Phi(-14.5)); EXPECT_FLOAT_EQ(1, 7.7935368191928e-45 / Phi(-14)); EXPECT_FLOAT_EQ(1, 7.81880730565789e-42 / Phi(-13.5)); EXPECT_FLOAT_EQ(1, 6.11716439954988e-39 / Phi(-13)); EXPECT_FLOAT_EQ(1, 3.73256429887771e-36 / Phi(-12.5)); EXPECT_FLOAT_EQ(1, 1.77648211207768e-33 / Phi(-12)); EXPECT_FLOAT_EQ(1, 6.59577144611367e-31 / Phi(-11.5)); EXPECT_FLOAT_EQ(1, 1.91065957449868e-28 / Phi(-11)); EXPECT_FLOAT_EQ(1, 4.31900631780923e-26 / Phi(-10.5)); EXPECT_FLOAT_EQ(1, 7.61985302416053e-24 / Phi(-10)); EXPECT_FLOAT_EQ(1, 1.04945150753626e-21 / Phi(-9.5)); EXPECT_FLOAT_EQ(1, 1.12858840595384e-19 / Phi(-9)); EXPECT_FLOAT_EQ(1, 9.47953482220332e-18 / Phi(-8.5)); EXPECT_FLOAT_EQ(1, 6.22096057427178e-16 / Phi(-8)); EXPECT_FLOAT_EQ(1, 3.1908916729109e-14 / Phi(-7.5)); EXPECT_FLOAT_EQ(1, 1.27981254388584e-12 / Phi(-7)); EXPECT_FLOAT_EQ(1, 4.01600058385912e-11 / Phi(-6.5)); EXPECT_FLOAT_EQ(1, 9.86587645037698e-10 / Phi(-6)); EXPECT_FLOAT_EQ(1, 1.89895624658877e-08 / Phi(-5.5)); EXPECT_FLOAT_EQ(1, 2.86651571879194e-07 / Phi(-5)); EXPECT_FLOAT_EQ(1, 3.39767312473006e-06 / Phi(-4.5)); EXPECT_FLOAT_EQ(1, 3.16712418331199e-05 / Phi(-4)); EXPECT_FLOAT_EQ(1, 0.000232629079035525 / Phi(-3.5)); EXPECT_FLOAT_EQ(1, 0.00134989803163009 / Phi(-3)); EXPECT_FLOAT_EQ(1, 0.00620966532577613 / Phi(-2.5)); EXPECT_FLOAT_EQ(1, 0.0227501319481792 / Phi(-2)); EXPECT_FLOAT_EQ(1, 0.0668072012688581 / Phi(-1.5)); EXPECT_FLOAT_EQ(1, 0.158655253931457 / Phi(-1)); EXPECT_FLOAT_EQ(1, 0.308537538725987 / Phi(-0.5)); EXPECT_FLOAT_EQ(1, 0.5 / Phi(0)); EXPECT_FLOAT_EQ(1, 0.691462461274013 / Phi(0.5)); EXPECT_FLOAT_EQ(1, 0.841344746068543 / Phi(1)); EXPECT_FLOAT_EQ(1, 0.933192798731142 / Phi(1.5)); EXPECT_FLOAT_EQ(1, 0.977249868051821 / Phi(2)); EXPECT_FLOAT_EQ(1, 0.993790334674224 / Phi(2.5)); EXPECT_FLOAT_EQ(1, 0.99865010196837 / Phi(3)); EXPECT_FLOAT_EQ(1, 0.999767370920964 / Phi(3.5)); EXPECT_FLOAT_EQ(1, 0.999968328758167 / Phi(4)); EXPECT_FLOAT_EQ(1, 0.999996602326875 / Phi(4.5)); EXPECT_FLOAT_EQ(1, 0.999999713348428 / Phi(5)); EXPECT_FLOAT_EQ(1, 0.999999981010438 / Phi(5.5)); EXPECT_FLOAT_EQ(1, 0.999999999013412 / Phi(6)); EXPECT_FLOAT_EQ(1, 0.99999999995984 / Phi(6.5)); EXPECT_FLOAT_EQ(1, 0.99999999999872 / Phi(7)); EXPECT_FLOAT_EQ(1, 0.999999999999968 / Phi(7.5)); EXPECT_FLOAT_EQ(1, 0.999999999999999 / Phi(8)); EXPECT_FLOAT_EQ(1, 1 / Phi(8.5)); EXPECT_FLOAT_EQ(1, 1 / Phi(9)); EXPECT_FLOAT_EQ(1, 1 / Phi(9.5)); EXPECT_FLOAT_EQ(1, 1 / Phi(10)); } TEST(MathFunctions, Phi_nan) { double nan = std::numeric_limits<double>::quiet_NaN(); EXPECT_THROW(stan::math::Phi(nan), std::domain_error); }
#!/usr/bin/env python # -*- coding: utf-8 -*- # # pyramid_sms documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys import os # If extensions (or modules to document with autodoc) are in another # directory, add these directories to sys.path here. If the directory is # relative to the documentation root, use os.path.abspath to make it # absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # Get the project root dir, which is the parent dir of this cwd = os.getcwd() project_root = os.path.dirname(cwd) # Insert the project root dir as the first element in the PYTHONPATH. # This lets us ensure that the source package is imported, and that its # version is used. sys.path.insert(0, project_root) import pyramid_sms # -- General configuration --------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'SMS for Pyramid' copyright = u'2016, Mikko Ohtamaa' # The version info for the project you're documenting, acts as replacement # for |version| and |release|, also used in various other places throughout # the built documents. # # The short X.Y version. version = "0.1" # The full version, including alpha/beta/rc tags. release = "0.1" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to # some non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # The reST default role (used for this markup: `text`) to use for all # documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # If true, keep warnings as "system message" paragraphs in the built # documents. #keep_warnings = False # -- Options for HTML output ------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a # theme further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # "<project> v<release> documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as # html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the # top of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon # of the docs. This file should be a Windows icon file (.ico) being # 16x16 or 32x32 pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) # here, relative to this directory. They are copied after the builtin # static files, so a file named "default.css" will overwrite the builtin # "default.css". html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page # bottom, using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names # to template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. # Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. # Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages # will contain a <link> tag referring to it. The value of this option # must be the base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'pyramid_smsdoc' # -- Options for LaTeX output ------------------------------------------ latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass # [howto/manual]). latex_documents = [ ('index', 'pyramid_sms.tex', u'SMS for Pyramid Documentation', u'Mikko Ohtamaa', 'manual'), ] # The name of an image file (relative to this directory) to place at # the top of the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings # are parts, not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output ------------------------------------ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'pyramid_sms', u'SMS for Pyramid Documentation', [u'Mikko Ohtamaa'], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ---------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'pyramid_sms', u'SMS for Pyramid Documentation', u'Mikko Ohtamaa', 'pyramid_sms', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. #texinfo_no_detailmenu = False autoclass_content = "both"
import { timeout as d3_timeout } from 'd3-timer'; export function uiFlash(context) { var _flashTimer; var _duration = 2000; var _iconName = '#iD-icon-no'; var _iconClass = 'disabled'; var _text = ''; var _textClass; function flash() { if (_flashTimer) { _flashTimer.stop(); } context.container().select('.main-footer-wrap') .classed('footer-hide', true) .classed('footer-show', false); context.container().select('.flash-wrap') .classed('footer-hide', false) .classed('footer-show', true); var content = context.container().select('.flash-wrap').selectAll('.flash-content') .data([0]); // Enter var contentEnter = content.enter() .append('div') .attr('class', 'flash-content'); var iconEnter = contentEnter .append('svg') .attr('class', 'flash-icon') .append('g') .attr('transform', 'translate(10,10)'); iconEnter .append('circle') .attr('r', 9); iconEnter .append('use') .attr('transform', 'translate(-7,-7)') .attr('width', '14') .attr('height', '14'); contentEnter .append('div') .attr('class', 'flash-text'); // Update content = content .merge(contentEnter); content .selectAll('.flash-icon') .attr('class', 'flash-icon ' + (_iconClass || '')); content .selectAll('.flash-icon use') .attr('xlink:href', _iconName); content .selectAll('.flash-text') .attr('class', 'flash-text ' + (_textClass || '')) .text(_text); _flashTimer = d3_timeout(function() { _flashTimer = null; context.container().select('.main-footer-wrap') .classed('footer-hide', false) .classed('footer-show', true); context.container().select('.flash-wrap') .classed('footer-hide', true) .classed('footer-show', false); }, _duration); return content; } flash.duration = function(_) { if (!arguments.length) return _duration; _duration = _; return flash; }; flash.text = function(_) { if (!arguments.length) return _text; _text = _; return flash; }; flash.textClass = function(_) { if (!arguments.length) return _textClass; _textClass = _; return flash; }; flash.iconName = function(_) { if (!arguments.length) return _iconName; _iconName = _; return flash; }; flash.iconClass = function(_) { if (!arguments.length) return _iconClass; _iconClass = _; return flash; }; return flash; }
APL language support in Atom ============================ [![Build status: TravisCI](https://travis-ci.org/Alhadis/language-apl.svg?branch=master)](https://travis-ci.org/Alhadis/language-apl) [![Build status: AppVeyor](https://ci.appveyor.com/api/projects/status/a6551f72vh91bjly?svg=true)](https://ci.appveyor.com/project/Alhadis/language-apl) [![Latest package version](https://img.shields.io/apm/v/language-apl.svg?colorB=brightgreen)](https://atom.io/packages/language-apl) This package adds Atom support for everybody's favourite array-wrangling crypto-language. ![Do you even ⍨, bro?](https://raw.githubusercontent.com/Alhadis/language-apl/master/preview.png) Font Support ------------ No APL symbol fonts are bundled with this package. Anybody interested in APL is assumed to already have supporting fonts installed. Furthermore, Windows and Mac OS both ship with fonts that support APL symbols (Arial Unicode MS and Menlo, to name two), so you'll probably be fine. If the characters aren't displaying correctly, try installing any or all of these: * [APL385 Unicode](http://archive.vector.org.uk/resource/apl385.ttf) * [SImPL](https://web.archive.org/web/20140316112809/http://www.chastney.com/~philip/sixpack/sixpack_medium.ttf) * [Noto Sans Symbols](https://www.google.com/get/noto/#sans-zsym) * [Symbola](https://dn-works.com/wp-content/uploads/2020/UFAS-Fonts/Symbola.zip) **Side-note:** I recommend installing Symbola anyway, even if you think you don't need it. Noto Sans Symbols is highly‑recommended as well. Install them both to dispel [tofu!](https://en.wikipedia.org/wiki/Noto_fonts#Etymology)
// Copyright (c) 2016 The btcsuite developers // Copyright (c) 2016-2020 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. package blockchain_test import ( "bytes" "context" "errors" "fmt" "io/ioutil" "os" "testing" "github.com/decred/dcrd/blockchain/v3" "github.com/decred/dcrd/blockchain/v3/fullblocktests" "github.com/decred/dcrd/chaincfg/chainhash" "github.com/decred/dcrd/chaincfg/v3" "github.com/decred/dcrd/database/v2" "github.com/decred/dcrd/dcrutil/v3" "github.com/decred/dcrd/txscript/v3" "github.com/decred/dcrd/wire" ) const ( // testDbType is the database backend type to use for the tests. testDbType = "ffldb" // blockDataNet is the expected network in the test block data. blockDataNet = wire.MainNet ) // isSupportedDbType returns whether or not the passed database type is // currently supported. func isSupportedDbType(dbType string) bool { supportedDrivers := database.SupportedDrivers() for _, driver := range supportedDrivers { if dbType == driver { return true } } return false } // chainSetup is used to create a new db and chain instance with the genesis // block already inserted. In addition to the new chain instance, it returns // a teardown function the caller should invoke when done testing to clean up. func chainSetup(dbName string, params *chaincfg.Params) (*blockchain.BlockChain, func(), error) { if !isSupportedDbType(testDbType) { return nil, nil, fmt.Errorf("unsupported db type %v", testDbType) } // Handle memory database specially since it doesn't need the disk // specific handling. var db database.DB var teardown func() if testDbType == "memdb" { ndb, err := database.Create(testDbType) if err != nil { return nil, nil, fmt.Errorf("error creating db: %v", err) } db = ndb // Setup a teardown function for cleaning up. This function is // returned to the caller to be invoked when it is done testing. teardown = func() { db.Close() } } else { // Create the directory for test database. dbPath, err := ioutil.TempDir("", dbName) if err != nil { err := fmt.Errorf("unable to create test db path: %v", err) return nil, nil, err } // Create a new database to store the accepted blocks into. ndb, err := database.Create(testDbType, dbPath, blockDataNet) if err != nil { os.RemoveAll(dbPath) return nil, nil, fmt.Errorf("error creating db: %v", err) } db = ndb // Setup a teardown function for cleaning up. This function is // returned to the caller to be invoked when it is done testing. teardown = func() { db.Close() os.RemoveAll(dbPath) } } // Copy the chain params to ensure any modifications the tests do to // the chain parameters do not affect the global instance. paramsCopy := *params // Create the main chain instance. chain, err := blockchain.New(context.Background(), &blockchain.Config{ DB: db, ChainParams: &paramsCopy, TimeSource: blockchain.NewMedianTime(), SigCache: txscript.NewSigCache(1000), }) if err != nil { teardown() err := fmt.Errorf("failed to create chain instance: %v", err) return nil, nil, err } return chain, teardown, nil } // TestFullBlocks ensures all tests generated by the fullblocktests package // have the expected result when processed via ProcessBlock. func TestFullBlocks(t *testing.T) { tests, err := fullblocktests.Generate(false) if err != nil { t.Fatalf("failed to generate tests: %v", err) } // Create a new database and chain instance to run tests against. chain, teardownFunc, err := chainSetup("fullblocktest", chaincfg.RegNetParams()) if err != nil { t.Fatalf("Failed to setup chain instance: %v", err) } defer teardownFunc() // testAcceptedBlock attempts to process the block in the provided test // instance and ensures that it was accepted according to the flags // specified in the test. testAcceptedBlock := func(item fullblocktests.AcceptedBlock) { blockHeight := item.Block.Header.Height block := dcrutil.NewBlock(item.Block) t.Logf("Testing block %s (hash %s, height %d)", item.Name, block.Hash(), blockHeight) var isOrphan bool forkLen, err := chain.ProcessBlock(block, blockchain.BFNone) if blockchain.IsErrorCode(err, blockchain.ErrMissingParent) { isOrphan = true err = nil } if err != nil { t.Fatalf("block %q (hash %s, height %d) should have "+ "been accepted: %v", item.Name, block.Hash(), blockHeight, err) } // Ensure the main chain and orphan flags match the values // specified in the test. isMainChain := !isOrphan && forkLen == 0 if isMainChain != item.IsMainChain { t.Fatalf("block %q (hash %s, height %d) unexpected main "+ "chain flag -- got %v, want %v", item.Name, block.Hash(), blockHeight, isMainChain, item.IsMainChain) } if isOrphan != item.IsOrphan { t.Fatalf("block %q (hash %s, height %d) unexpected "+ "orphan flag -- got %v, want %v", item.Name, block.Hash(), blockHeight, isOrphan, item.IsOrphan) } } // testRejectedBlock attempts to process the block in the provided test // instance and ensures that it was rejected with the reject code // specified in the test. testRejectedBlock := func(item fullblocktests.RejectedBlock) { blockHeight := item.Block.Header.Height block := dcrutil.NewBlock(item.Block) t.Logf("Testing block %s (hash %s, height %d)", item.Name, block.Hash(), blockHeight) _, err := chain.ProcessBlock(block, blockchain.BFNone) if err == nil { t.Fatalf("block %q (hash %s, height %d) should not "+ "have been accepted", item.Name, block.Hash(), blockHeight) } // Ensure the error code is of the expected type and the reject // code matches the value specified in the test instance. var rerr blockchain.RuleError if !errors.As(err, &rerr) { t.Fatalf("block %q (hash %s, height %d) returned "+ "unexpected error type -- got %T, want "+ "blockchain.RuleError", item.Name, block.Hash(), blockHeight, err) } if rerr.ErrorCode != item.RejectCode { t.Fatalf("block %q (hash %s, height %d) does not have "+ "expected reject code -- got %v, want %v", item.Name, block.Hash(), blockHeight, rerr.ErrorCode, item.RejectCode) } } // testRejectedNonCanonicalBlock attempts to decode the block in the // provided test instance and ensures that it failed to decode with a // message error. testRejectedNonCanonicalBlock := func(item fullblocktests.RejectedNonCanonicalBlock) { headerLen := wire.MaxBlockHeaderPayload if headerLen > len(item.RawBlock) { headerLen = len(item.RawBlock) } blockHeader := item.RawBlock[0:headerLen] blockHash := chainhash.HashH(chainhash.HashB(blockHeader)) blockHeight := item.Height t.Logf("Testing block %s (hash %s, height %d)", item.Name, blockHash, blockHeight) // Ensure there is an error due to deserializing the block. var msgBlock wire.MsgBlock err := msgBlock.BtcDecode(bytes.NewReader(item.RawBlock), 0) var werr *wire.MessageError if !errors.As(err, &werr) { t.Fatalf("block %q (hash %s, height %d) should have "+ "failed to decode", item.Name, blockHash, blockHeight) } } // testOrphanOrRejectedBlock attempts to process the block in the // provided test instance and ensures that it was either accepted as an // orphan or rejected with a rule violation. testOrphanOrRejectedBlock := func(item fullblocktests.OrphanOrRejectedBlock) { blockHeight := item.Block.Header.Height block := dcrutil.NewBlock(item.Block) t.Logf("Testing block %s (hash %s, height %d)", item.Name, block.Hash(), blockHeight) _, err := chain.ProcessBlock(block, blockchain.BFNone) if err != nil { // Ensure the error code is of the expected type. Note // that orphans are rejected with ErrMissingParent, so // this check covers both conditions. var rerr blockchain.RuleError if !errors.As(err, &rerr) { t.Fatalf("block %q (hash %s, height %d) "+ "returned unexpected error type -- "+ "got %T, want blockchain.RuleError", item.Name, block.Hash(), blockHeight, err) } } } // testExpectedTip ensures the current tip of the blockchain is the // block specified in the provided test instance. testExpectedTip := func(item fullblocktests.ExpectedTip) { blockHeight := item.Block.Header.Height block := dcrutil.NewBlock(item.Block) t.Logf("Testing tip for block %s (hash %s, height %d)", item.Name, block.Hash(), blockHeight) // Ensure hash and height match. best := chain.BestSnapshot() if best.Hash != item.Block.BlockHash() || best.Height != int64(blockHeight) { t.Fatalf("block %q (hash %s, height %d) should be "+ "the current tip -- got (hash %s, height %d)", item.Name, block.Hash(), blockHeight, best.Hash, best.Height) } } for testNum, test := range tests { for itemNum, item := range test { switch item := item.(type) { case fullblocktests.AcceptedBlock: testAcceptedBlock(item) case fullblocktests.RejectedBlock: testRejectedBlock(item) case fullblocktests.RejectedNonCanonicalBlock: testRejectedNonCanonicalBlock(item) case fullblocktests.OrphanOrRejectedBlock: testOrphanOrRejectedBlock(item) case fullblocktests.ExpectedTip: testExpectedTip(item) default: t.Fatalf("test #%d, item #%d is not one of "+ "the supported test instance types -- "+ "got type: %T", testNum, itemNum, item) } } } }
blochi3 ======= dodonna
//////////////////////////////////////////////////////////////////////////////// // // TYPHOON FRAMEWORK // Copyright 2013, Typhoon Framework Contributors // All Rights Reserved. // // NOTICE: The authors permit you to use, modify, and distribute this file // in accordance with the terms of the license agreement accompanying it. // //////////////////////////////////////////////////////////////////////////////// #import <UIKit/UIKit.h> @protocol PFCityDao; @class PFRootViewController; @class INJContainer; @class PFAppContext; @interface PFAppDelegate : UIResponder <UIApplicationDelegate> @property (nonatomic, strong) INJContainer *container; @property (nonatomic, strong) PFAppContext *appContext; @property(nonatomic, strong) UIWindow *window; @property(nonatomic, strong) id <PFCityDao> cityDao; @property(nonatomic, strong) PFRootViewController *rootViewController; @end
Hibbert is a very simple power monitor, which (at the moment) supports Linux. It has no dependencies aside from a Linux system with the /sys/class/power_supply interface. Hibbert periodically checks the battery status, and if the battery is below a certain percentage (default: 5) and not charging, then it tries to execute ~/.hibbertt as a shell script, or /etc/hibbertt should ~/.hibbertt not exist. Shibbert is also built, which is just a simpler hibbert which doesn't act as a daemon and is just meant to be run from cron if that's more your thing. Tips: You can have more than one entry for a user/group in sudoers, if you define things like pm-hibernate as NOPASSWD for yourself then you can hibernate or suspend as your trigger. There may also be a way to do this from logind or something.
module Main where areaTriangleTrig a b c = c * height / 2 where cosa = (b ^ 2 + c ^ 2 - a ^ 2) / (2 * b * c) sina = sqrt (1 - cosa ^ 2) height = b * sina areaTriangleHeron a b c = result where result = sqrt (s * (s - a) * (s - b) * (s - c)) s = (a + b + c) / 2
"use strict"; const http_1 = require("http"); const WebSocketServer = require("ws"); const express = require("express"); const dgram = require("dgram"); const readUInt64BE = require("readuint64be"); const buffer_1 = require("buffer"); const _ = require("lodash"); // Health Insurrance: process.on("uncaughtException", function (err) { console.log(err); }); const debug = require("debug")("PeerTracker:Server"), redis = require("redis"), GeoIpNativeLite = require("geoip-native-lite"), bencode = require("bencode"); // Load in GeoData GeoIpNativeLite.loadDataSync(); // Keep statistics going, update every 30 min let stats = { seedCount: 0, leechCount: 0, torrentCount: 0, activeTcount: 0, scrapeCount: 0, successfulDown: 0, countries: {} }; const ACTION_CONNECT = 0, ACTION_ANNOUNCE = 1, ACTION_SCRAPE = 2, ACTION_ERROR = 3, INTERVAL = 1801, startConnectionIdHigh = 0x417, startConnectionIdLow = 0x27101980; // Without using streams, this can handle ~320 IPv4 addresses. More doesn't necessarily mean better. const MAX_PEER_SIZE = 1500; const FOUR_AND_FIFTEEN_DAYS = 415 * 24 * 60 * 60; // assuming start time is seconds for redis; // Redis let client; class Server { constructor(opts) { this._debug = (...args) => { args[0] = "[" + this._debugId + "] " + args[0]; debug.apply(null, args); }; const self = this; if (!opts) opts = { port: 80, udpPort: 1337, docker: false }; self._debugId = ~~((Math.random() * 100000) + 1); self._debug("peer-tracker Server instance created"); self.PORT = opts.port; self.udpPORT = opts.udpPort; self.server = http_1.createServer(); self.wss = new WebSocketServer.Server({ server: self.server }); self.udp4 = dgram.createSocket({ type: "udp4", reuseAddr: true }); self.app = express(); // PREP VISUAL AID: console.log(` . | | | ||| /___\\ |_ _| | | | | | | | | |__| |__| | | | | | | | | | | | | Peer Tracker 1.1.0 | | | | | | | | Running in standalone mode | | | | UDP PORT: ${self.udpPORT} | | | | HTTP & WS PORT: ${self.PORT} | | | | | |_| | |__| |__| | | | | LET'S BUILD AN EMPIRE! | | | | https://github.com/CraigglesO/peer-tracker | | | | | | | | |____|_|____| `); // Redis if (opts.docker) client = redis.createClient("6379", "redis"); else client = redis.createClient(); // If an error occurs, print it to the console client.on("error", function (err) { console.log("Redis error: " + err); }); client.on("ready", function () { console.log(new Date() + ": Redis is up and running."); }); self.app.set("trust proxy", function (ip) { return true; }); // Express self.app.get("/", function (req, res) { let ip = req.headers["x-forwarded-for"] || req.connection.remoteAddress; if (ip.indexOf("::ffff:") !== -1) ip = ip.slice(7); res.status(202).send("Welcome to the Empire. Your address: " + ip); }); self.app.get("/stat.json", function (req, res) { res.status(202).send(stats); }); self.app.get("/stat", function (req, res) { // { seedCount, leechCount, torrentCount, activeTcount, scrapeCount, successfulDown, countries }; let parsedResponce = `<h1><span style="color:blue;">V1.0.3</span> - ${stats.torrentCount} Torrents {${stats.activeTcount} active}</h1>\n <h2>Successful Downloads: ${stats.successfulDown}</h2>\n <h2>Number of Scrapes to this tracker: ${stats.scrapeCount}</h2>\n <h3>Connected Peers: ${stats.seedCount + stats.leechCount}</h3>\n <h3><ul>Seeders: ${stats.seedCount}</ul></h3>\n <h3><ul>Leechers: ${stats.leechCount}</ul></h3>\n <h3>Countries that have connected: <h3>\n <ul>`; let countries; for (countries in stats.countries) parsedResponce += `<li>${stats.countries[countries]}</li>\n`; parsedResponce += "</ul>"; res.status(202).send(parsedResponce); }); self.app.get("*", function (req, res) { res.status(404).send("<h1>404 Not Found</h1>"); }); self.server.on("request", self.app.bind(self)); self.server.listen(self.PORT, function () { console.log(new Date() + ": HTTP Server Ready" + "\n" + new Date() + ": Websockets Ready."); }); // WebSocket: self.wss.on("connection", function connection(ws) { // let location = url.parse(ws.upgradeReq.url, true); let ip; let peerAddress; let port; if (opts.docker) { ip = ws.upgradeReq.headers["x-forwarded-for"]; peerAddress = ip.split(":")[0]; port = ip.split(":")[1]; } else { peerAddress = ws._socket.remoteAddress; port = ws._socket.remotePort; } if (peerAddress.indexOf("::ffff:") !== -1) peerAddress = peerAddress.slice(7); console.log("peerAddress", peerAddress); ws.on("message", function incoming(msg) { handleMessage(msg, peerAddress, port, "ws", (reply) => { ws.send(reply); }); }); }); // UDP: self.udp4.bind(self.udpPORT); self.udp4.on("message", function (msg, rinfo) { handleMessage(msg, rinfo.address, rinfo.port, "udp", (reply) => { self.udp4.send(reply, 0, reply.length, rinfo.port, rinfo.address, (err) => { if (err) { console.log("udp4 error: ", err); } ; }); }); }); self.udp4.on("error", function (err) { console.log("error", err); }); self.udp4.on("listening", () => { console.log(new Date() + ": UDP-4 Bound and ready."); }); self.updateStatus((info) => { stats = info; }); setInterval(() => { console.log("STAT UPDATE, " + Date.now()); self.updateStatus((info) => { stats = info; }); }, 30 * 60 * 1000); } updateStatus(cb) { const self = this; // Get hashes -> iterate through hashes and get all peers and leechers // Also get number of scrapes 'scrape' // Number of active hashes hash+':time' let NOW = Date.now(), seedCount = 0, // check leechCount = 0, // check torrentCount = 0, // check activeTcount = 0, // check scrapeCount = 0, // check successfulDown = 0, // check countries = {}; client.get("hashes", (err, reply) => { if (!reply) return; let hashList = reply.split(","); torrentCount = hashList.length; client.get("scrape", (err, rply) => { if (err) { return; } if (!rply) return; scrapeCount = rply; }); hashList.forEach((hash, i) => { client.mget([hash + ":seeders", hash + ":leechers", hash + ":time", hash + ":completed"], (err, rply) => { if (err) { return; } // iterate through: // seeders if (rply[0]) { rply[0] = rply[0].split(","); seedCount += rply[0].length; rply[0].forEach((addr) => { let ip = addr.split(":")[0]; let country = GeoIpNativeLite.lookup(ip); if (country) countries[country] = country.toUpperCase(); }); } if (rply[1]) { rply[1] = rply[1].split(","); seedCount += rply[1].length; rply[1].forEach((addr) => { let ip = addr.split(":")[0]; let country = GeoIpNativeLite.lookup(ip); if (country) countries[country] = country.toUpperCase(); }); } if (rply[2]) { if (((NOW - rply[2]) / 1000) < 432000) activeTcount++; } if (rply[3]) { successfulDown += Number(rply[3]); } if (i === (torrentCount - 1)) { cb({ seedCount, leechCount, torrentCount, activeTcount, scrapeCount, successfulDown, countries }); } }); }); }); } } // MESSAGE FUNCTIONS: function handleMessage(msg, peerAddress, port, type, cb) { // PACKET SIZES: // CONNECT: 16 - ANNOUNCE: 98 - SCRAPE: 16 OR (16 + 20 * n) let buf = new buffer_1.Buffer(msg), bufLength = buf.length, transaction_id = 0, action = null, connectionIdHigh = null, connectionIdLow = null, hash = null, responce = null, PEER_ID = null, PEER_ADDRESS = null, PEER_KEY = null, NUM_WANT = null, peerPort = port, peers = null; // Ensure packet fullfills the minimal 16 byte requirement. if (bufLength < 16) { ERROR(); } else { // Get generic data: connectionIdHigh = buf.readUInt32BE(0), connectionIdLow = buf.readUInt32BE(4), action = buf.readUInt32BE(8), transaction_id = buf.readUInt32BE(12); // 12 32-bit integer transaction_id } switch (action) { case ACTION_CONNECT: // Check whether the transaction ID is equal to the one you chose. if (startConnectionIdLow !== connectionIdLow || startConnectionIdHigh !== connectionIdHigh) { ERROR(); break; } // Create a new Connection ID and Transaction ID for this user... kill after 30 seconds: let newConnectionIDHigh = ~~((Math.random() * 100000) + 1); let newConnectionIDLow = ~~((Math.random() * 100000) + 1); client.setex(peerAddress + ":" + newConnectionIDHigh, 60, 1); client.setex(peerAddress + ":" + newConnectionIDLow, 60, 1); client.setex(peerAddress + ":" + startConnectionIdLow, 60, 1); client.setex(peerAddress + ":" + startConnectionIdHigh, 60, 1); // client.setex(peerAddress + ':' + transaction_id , 30 * 1000, 1); // THIS MIGHT BE WRONG // Create a responce buffer: responce = new buffer_1.Buffer(16); responce.fill(0); responce.writeUInt32BE(ACTION_CONNECT, 0); // 0 32-bit integer action 0 // connect responce.writeUInt32BE(transaction_id, 4); // 4 32-bit integer transaction_id responce.writeUInt32BE(newConnectionIDHigh, 8); // 8 64-bit integer connection_id responce.writeUInt32BE(newConnectionIDLow, 12); // 8 64-bit integer connection_id cb(responce); break; case ACTION_ANNOUNCE: // Checks to make sure the packet is worth analyzing: // 1. packet is atleast 84 bytes if (bufLength < 84) { ERROR(); break; } // Minimal requirements: hash = buf.slice(16, 36); hash = hash.toString("hex"); PEER_ID = buf.slice(36, 56); // -WD0017-I0mH4sMSAPOJ && -LT1000-9BjtQhMtTtTc PEER_ID = PEER_ID.toString(); let DOWNLOADED = readUInt64BE(buf, 56), LEFT = readUInt64BE(buf, 64), UPLOADED = readUInt64BE(buf, 72), EVENT = buf.readUInt32BE(80); if (bufLength > 96) { PEER_ADDRESS = buf.readUInt16BE(84); PEER_KEY = buf.readUInt16BE(88); NUM_WANT = buf.readUInt16BE(92); peerPort = buf.readUInt16BE(96); } // 2. check that Transaction ID and Connection ID match client.mget([peerAddress + ":" + connectionIdHigh, peerAddress + ":" + connectionIdLow], (err, reply) => { if (!reply[0] || !reply[1] || err) { ERROR(); return; } addHash(hash); // Check EVENT // 0: none; 1: completed; 2: started; 3: stopped // If 1, 2, or 3 do sets first. if (EVENT === 1) { // Change the array this peer is housed in. removePeer(peerAddress + ":" + peerPort, hash + type + ":leechers"); addPeer(peerAddress + ":" + peerPort, hash + type + ":seeders"); // Increment total users who completed file client.incr(hash + ":completed"); } else if (EVENT === 2) { // Add to array (leecher array if LEFT is > 0) if (LEFT > 0) addPeer(peerAddress + ":" + peerPort, hash + type + ":leechers"); else addPeer(peerAddress + ":" + peerPort, hash + type + ":seeders"); } else if (EVENT === 3) { // Remove peer from array (leecher array if LEFT is > 0) removePeer(peerAddress + ":" + peerPort, hash + type + ":leechers"); removePeer(peerAddress + ":" + peerPort, hash + type + ":seeders"); return; } client.mget([hash + type + ":seeders", hash + type + ":leechers"], (err, rply) => { if (err) { ERROR(); return; } // Convert all addresses to a proper hex buffer: // Addresses return: 0 - leechers; 1 - seeders; 2 - hexedUp address-port pairs; 3 - resulting buffersize let addresses = addrToBuffer(rply[0], rply[1], LEFT); // Create a responce buffer: responce = new buffer_1.Buffer(20); responce.fill(0); responce.writeUInt32BE(ACTION_ANNOUNCE, 0); // 0 32-bit integer action 1 -> announce responce.writeUInt32BE(transaction_id, 4); // 4 32-bit integer transaction_id responce.writeUInt32BE(INTERVAL, 8); // 8 32-bit integer interval responce.writeUInt32BE(addresses[0], 12); // 12 32-bit integer leechers responce.writeUInt32BE(addresses[1], 16); // 16 32-bit integer seeders responce = buffer_1.Buffer.concat([responce, addresses[2]]); // 20 + 6 * n 32-bit integer IP address // 24 + 6 * n 16-bit integer TCP port cb(responce); }); }); break; case ACTION_SCRAPE: // Check whether the transaction ID is equal to the one you chose. // 2. check that Transaction ID and Connection ID match // addresses return: 0 - leechers; 1 - seeders; 2 - hexedUp address-port pairs; 3 - resulting buffersize // Create a responce buffer: client.incr("scrape"); let responces = new buffer_1.Buffer(8); responces.fill(0); responces.writeUInt32BE(ACTION_SCRAPE, 0); // 0 32-bit integer action 2 -> scrape responces.writeUInt32BE(transaction_id, 4); // 4 32-bit integer transaction_id let bufferSum = []; // LOOP THROUGH REQUESTS for (let i = 16; i < (buf.length - 16); i += 20) { hash = buf.slice(i, i + 20); hash = hash.toString("hex"); client.mget([hash + type + ":seeders", hash + type + ":leechers", hash + type + ":completed"], (err, rply) => { if (err) { ERROR(); return; } // convert all addresses to a proper hex buffer: let addresses = addrToBuffer(rply[0], rply[1], 1); let responce = new buffer_1.Buffer(20); responce.fill(0); responce.writeUInt32BE(addresses[1], 8); // 8 + 12 * n 32-bit integer seeders responce.writeUInt32BE(rply[2], 12); // 12 + 12 * n 32-bit integer completed responce.writeUInt32BE(addresses[0], 16); // 16 + 12 * n 32-bit integer leechers bufferSum.push(responce); if ((i + 16) >= (buf.length - 16)) { let scrapes = buffer_1.Buffer.concat(bufferSum); responces = buffer_1.Buffer.concat([responces, scrapes]); cb(responces); } }); } break; default: ERROR(); } function ERROR() { responce = new buffer_1.Buffer(11); responce.fill(0); responce.writeUInt32BE(ACTION_ERROR, 0); responce.writeUInt32BE(transaction_id, 4); responce.write("900", 8); cb(responce); } function addPeer(peer, where) { client.get(where, (err, reply) => { if (err) { ERROR(); return; } else { if (!reply) reply = peer; else reply = peer + "," + reply; reply = reply.split(","); reply = _.uniq(reply); // Keep the list under MAX_PEER_SIZE; if (reply.length > MAX_PEER_SIZE) { reply = reply.slice(0, MAX_PEER_SIZE); } reply = reply.join(","); client.set(where, reply); } }); } function removePeer(peer, where) { client.get(where, (err, reply) => { if (err) { ERROR(); return; } else { if (!reply) return; else { reply = reply.split(","); let index = reply.indexOf(peer); if (index > -1) { reply.splice(index, 1); } reply = reply.join(","); client.set(where, reply); } } }); } function addrToBuffer(seeders, leechers, LEFT) { // Addresses return: 0 - leechers; 1 - seeders; 2 - hexedUp address-port pairs; 3 - resulting buffersize // Also we don't need to send the users own address // If peer is a leecher, send more seeders; if peer is a seeder, send only leechers let leecherCount = 0, seederCount = 0, peerBuffer = null, peerBufferSize = 0; if (LEFT === 0 || !seeders || seeders === "") seeders = new buffer_1.Buffer(0); else { seeders = seeders.split(","); seederCount = seeders.length; seeders = seeders.map((addressPort) => { let addr = addressPort.split(":")[0]; let port = addressPort.split(":")[1]; addr = addr.split("."); let b = new buffer_1.Buffer(6); b.fill(0); b.writeUInt8(addr[0], 0); b.writeUInt8(addr[1], 1); b.writeUInt8(addr[2], 2); b.writeUInt8(addr[3], 3); b.writeUInt16BE(port, 4); return b; }); seeders = buffer_1.Buffer.concat(seeders); } if (LEFT > 0 && seederCount > 50 && leechers > 15) leechers = leechers.slice(0, 15); if (!leechers || leechers === "") leechers = new buffer_1.Buffer(0); else { leechers = leechers.split(","); leecherCount = leechers.length; leechers = leechers.map((addressPort) => { let addr = addressPort.split(":")[0]; let port = addressPort.split(":")[1]; addr = addr.split("."); let b = new buffer_1.Buffer(6); b.fill(0); b.writeUInt8(addr[0], 0); b.writeUInt8(addr[1], 1); b.writeUInt8(addr[2], 2); b.writeUInt8(addr[3], 3); b.writeUInt16BE(port, 4); return b; }); leechers = buffer_1.Buffer.concat(leechers); } peerBuffer = buffer_1.Buffer.concat([seeders, leechers]); // Addresses return: 0 - leechers; 1 - seeders; 2 - hexedUp address-port pairs; 3 - resulting buffersize return [leecherCount, seederCount, peerBuffer]; } // Add a new hash to the swarm, ensure uniqeness function addHash(hash) { client.get("hashes", (err, reply) => { if (err) { ERROR(); return; } if (!reply) reply = hash; else reply = hash + "," + reply; reply = reply.split(","); reply = _.uniq(reply); reply = reply.join(","); client.set("hashes", reply); client.set(hash + ":time", Date.now()); }); } function getHashes() { let r = client.get("hashes", (err, reply) => { if (err) { ERROR(); return null; } reply = reply.split(","); return reply; }); return r; } } function binaryToHex(str) { if (typeof str !== "string") { str = String(str); } return buffer_1.Buffer.from(str, "binary").toString("hex"); } function hexToBinary(str) { if (typeof str !== "string") { str = String(str); } return buffer_1.Buffer.from(str, "hex").toString("binary"); } Object.defineProperty(exports, "__esModule", { value: true }); exports.default = Server; //# sourceMappingURL=/Users/connor/Desktop/Programming/myModules/peer-tracker/ts-node/b80e7f10257a0a2b7f29aee28a53e164f19fc5f2/98a6883f88ed207a422bce14e041cea9032231df.js.map
var parseString = require('xml2js').parseString; module.exports = function(req, res, next){ if (req.is('xml')){ var data = ''; req.setEncoding('utf8'); req.on('data', function(chunk){ data += chunk; }); req.on('end', function(){ if (!data){ return next(); } parseString(data, { trim: true, explicitArray: false }, function(err, result){ if (!err){ req.body = result || {}; } else { return res.error('BAD_REQUEST'); } next(); }); }); } else { next(); } };
# coding=utf-8 from django.utils.functional import SimpleLazyObject from mongo_auth import get_user as mongo_auth_get_user def get_user(request): if not hasattr(request, '_cached_user'): request._cached_user = mongo_auth_get_user(request) return request._cached_user class AuthenticationMiddleware(object): def process_request(self, request): assert hasattr(request, 'session'), ( "The Django authentication middleware requires session middleware " "to be installed. Edit your MIDDLEWARE_CLASSES setting to insert " "'django.contrib.sessions.middleware.SessionMiddleware' before " "'django.contrib.auth.middleware.AuthenticationMiddleware'." ) request.user = SimpleLazyObject(lambda: get_user(request)) class SessionAuthenticationMiddleware(object): """ Formerly, a middleware for invalidating a user's sessions that don't correspond to the user's current session authentication hash. However, it caused the "Vary: Cookie" header on all responses. Now a backwards compatibility shim that enables session verification in auth.get_user() if this middleware is in MIDDLEWARE_CLASSES. """ def process_request(self, request): pass
{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE TypeFamilies #-} -- | This module provides facilities for obtaining the types of -- various Futhark constructs. Typically, you will need to execute -- these in a context where type information is available as a -- 'Scope'; usually by using a monad that is an instance of -- 'HasScope'. The information is returned as a list of 'ExtType' -- values - one for each of the values the Futhark construct returns. -- Some constructs (such as subexpressions) can produce only a single -- value, and their typing functions hence do not return a list. -- -- Some representations may have more specialised facilities enabling -- even more information - for example, -- "Futhark.IR.Mem" exposes functionality for -- also obtaining information about the storage location of results. module Futhark.IR.Prop.TypeOf ( expExtType, expExtTypeSize, subExpType, subExpResType, basicOpType, mapType, -- * Return type module Futhark.IR.RetType, -- * Type environment module Futhark.IR.Prop.Scope, -- * Extensibility TypedOp (..), ) where import Futhark.IR.Prop.Constants import Futhark.IR.Prop.Reshape import Futhark.IR.Prop.Scope import Futhark.IR.Prop.Types import Futhark.IR.RetType import Futhark.IR.Syntax -- | The type of a subexpression. subExpType :: HasScope t m => SubExp -> m Type subExpType (Constant val) = pure $ Prim $ primValueType val subExpType (Var name) = lookupType name -- | Type type of a 'SubExpRes' - not that this might refer to names -- bound in the body containing the result. subExpResType :: HasScope t m => SubExpRes -> m Type subExpResType = subExpType . resSubExp -- | @mapType f arrts@ wraps each element in the return type of @f@ in -- an array with size equal to the outermost dimension of the first -- element of @arrts@. mapType :: SubExp -> Lambda rep -> [Type] mapType outersize f = [ arrayOf t (Shape [outersize]) NoUniqueness | t <- lambdaReturnType f ] -- | The type of a primitive operation. basicOpType :: HasScope rep m => BasicOp -> m [Type] basicOpType (SubExp se) = pure <$> subExpType se basicOpType (Opaque _ se) = pure <$> subExpType se basicOpType (ArrayLit es rt) = pure [arrayOf rt (Shape [n]) NoUniqueness] where n = intConst Int64 $ toInteger $ length es basicOpType (BinOp bop _ _) = pure [Prim $ binOpType bop] basicOpType (UnOp _ x) = pure <$> subExpType x basicOpType CmpOp {} = pure [Prim Bool] basicOpType (ConvOp conv _) = pure [Prim $ snd $ convOpType conv] basicOpType (Index ident slice) = result <$> lookupType ident where result t = [Prim (elemType t) `arrayOfShape` shape] shape = Shape $ sliceDims slice basicOpType (Update _ src _ _) = pure <$> lookupType src basicOpType (FlatIndex ident slice) = result <$> lookupType ident where result t = [Prim (elemType t) `arrayOfShape` shape] shape = Shape $ flatSliceDims slice basicOpType (FlatUpdate src _ _) = pure <$> lookupType src basicOpType (Iota n _ _ et) = pure [arrayOf (Prim (IntType et)) (Shape [n]) NoUniqueness] basicOpType (Replicate (Shape []) e) = pure <$> subExpType e basicOpType (Replicate shape e) = pure . flip arrayOfShape shape <$> subExpType e basicOpType (Scratch t shape) = pure [arrayOf (Prim t) (Shape shape) NoUniqueness] basicOpType (Reshape [] e) = result <$> lookupType e where result t = [Prim $ elemType t] basicOpType (Reshape shape e) = result <$> lookupType e where result t = [t `setArrayShape` newShape shape] basicOpType (Rearrange perm e) = result <$> lookupType e where result t = [rearrangeType perm t] basicOpType (Rotate _ e) = pure <$> lookupType e basicOpType (Concat i x _ ressize) = result <$> lookupType x where result xt = [setDimSize i xt ressize] basicOpType (Copy v) = pure <$> lookupType v basicOpType (Manifest _ v) = pure <$> lookupType v basicOpType Assert {} = pure [Prim Unit] basicOpType (UpdateAcc v _ _) = pure <$> lookupType v -- | The type of an expression. expExtType :: (HasScope rep m, TypedOp (Op rep)) => Exp rep -> m [ExtType] expExtType (Apply _ _ rt _) = pure $ map (fromDecl . declExtTypeOf) rt expExtType (If _ _ _ rt) = pure $ map extTypeOf $ ifReturns rt expExtType (DoLoop merge _ _) = pure $ loopExtType $ map fst merge expExtType (BasicOp op) = staticShapes <$> basicOpType op expExtType (WithAcc inputs lam) = fmap staticShapes $ (<>) <$> (concat <$> traverse inputType inputs) <*> pure (drop num_accs (lambdaReturnType lam)) where inputType (_, arrs, _) = traverse lookupType arrs num_accs = length inputs expExtType (Op op) = opType op -- | The number of values returned by an expression. expExtTypeSize :: (RepTypes rep, TypedOp (Op rep)) => Exp rep -> Int expExtTypeSize = length . feelBad . expExtType -- FIXME, this is a horrible quick hack. newtype FeelBad rep a = FeelBad {feelBad :: a} instance Functor (FeelBad rep) where fmap f = FeelBad . f . feelBad instance Applicative (FeelBad rep) where pure = FeelBad f <*> x = FeelBad $ feelBad f $ feelBad x instance RepTypes rep => HasScope rep (FeelBad rep) where lookupType = const $ pure $ Prim $ IntType Int64 askScope = pure mempty -- | Given the parameters of a loop, produce the return type. loopExtType :: Typed dec => [Param dec] -> [ExtType] loopExtType params = existentialiseExtTypes inaccessible $ staticShapes $ map typeOf params where inaccessible = map paramName params -- | Any operation must define an instance of this class, which -- describes the type of the operation (at the value level). class TypedOp op where opType :: HasScope t m => op -> m [ExtType] instance TypedOp () where opType () = pure []
/* $OpenBSD: ieee.h,v 1.1.1.1 2009/07/31 09:26:25 miod Exp $ */ /* public domain */ #include <mips64/ieee.h>
/* Fireworks demo written by Dave Ashley */ /* dash@xdr.com */ /* http://www.xdr.com/dash */ /* Sat Jun 13 02:46:09 PDT 1998 */ /* This is my first attempt at an SDL program */ /* See the SDL home page http://www.devolution.com/~slouken/projects/SDL/ */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include "SDL.h" #define XSIZE 640 #define YSIZE 480 SDL_Surface *thescreen; unsigned char *vmem1, *vmem2; int mousex,mousey; SDL_Color themap[256]; int scrlock() { if(SDL_MUSTLOCK(thescreen)) { if ( SDL_LockSurface(thescreen) < 0 ) { fprintf(stderr, "Couldn't lock display surface: %s\n", SDL_GetError()); return -1; } } return 0; } void scrunlock(void) { if(SDL_MUSTLOCK(thescreen)) SDL_UnlockSurface(thescreen); SDL_UpdateRect(thescreen, 0, 0, 0, 0); } #define MOUSEFRAC 2 #define MAXBLOBS 512 #define BLOBFRAC 6 #define BLOBGRAVITY 5 #define THRESHOLD 20 #define SMALLSIZE 3 #define BIGSIZE 6 #define ABS(x) ((x)<0 ? -(x) : (x)) int explodenum; char sizes[]={2,3,4,5,8,5,4,3}; struct blob { struct blob *blobnext; int blobx; int bloby; int blobdx; int blobdy; int bloblife; int blobsize; } *blobs,*freeblobs,*activeblobs; unsigned char **mul640; int oldmode; char sqrttab[]={ 0,1,1,1,2,2,2,2,2,3,3,3,3,3,3,3, 4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5, 5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6, 6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, 9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10, 10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11, 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11, 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, 12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13, 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, 13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14, 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, 14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15 }; void nomem(void) { printf("Not enough low memory!\n"); SDL_Quit(); exit(1); } void fire(unsigned char *p1,unsigned char *p2,int pitch,char *map) { int x,y; unsigned char *p3, *p4; for(y=2;y<YSIZE;y++) { for(x=0;x<XSIZE;x++) { p3 = p1+y*XSIZE+x; p4 = p2+y*pitch+x; *p4=map[*p3+p3[-XSIZE]+p3[-XSIZE-1]+p3[-XSIZE+1]+p3[-1]+p3[1]+p3[-XSIZE-XSIZE-1]+p3[-XSIZE-XSIZE]+p3[-XSIZE-XSIZE+1]]; } } } void disk(x,y,rad) { unsigned char *p; int i,j,k,aj; int rad2=rad*rad; int w; for(j=-rad;j<=rad;j++) { w=sqrttab[rad2-j*j]; aj=ABS(j)<<2; if(w) { p=mul640[y+j]+x-w; k=w+w+1; i=-w; while(k--) {*p++=255-(ABS(i)<<2)-aj;i++;} } } } void trydisk(void) { if(mousex>10 && mousex<XSIZE-10 && mousey>10 && mousey<YSIZE-10) disk(mousex,mousey,8); } void addblob(void) { int dx,dy; struct blob *ablob; if(!freeblobs) return; dx=(rand()&255)-128; dy=(rand()%200)+340; ablob=freeblobs; freeblobs=freeblobs->blobnext; ablob->bloblife=(rand()&511)+256; ablob->blobdx=dx; ablob->blobdy=dy; ablob->blobx=(256+(rand()&127))<<BLOBFRAC; ablob->bloby=2<<BLOBFRAC; ablob->blobnext=activeblobs; ablob->blobsize=BIGSIZE; activeblobs=ablob; } void moveblobs(void) { struct blob **lastblob,*ablob; int x,y; lastblob=&activeblobs; while(ablob=*lastblob) { x=ablob->blobx>>BLOBFRAC; y=ablob->bloby>>BLOBFRAC; if(!--ablob->bloblife || y<0 || x<10 || x>XSIZE-10) { *lastblob=ablob->blobnext; ablob->blobnext=freeblobs; freeblobs=ablob; continue; } ablob->blobx+=ablob->blobdx; ablob->bloby+=ablob->blobdy; ablob->blobdy-=BLOBGRAVITY; lastblob=&ablob->blobnext; } } void putblobs(void) { struct blob *ablob,*ablob2,*temp; int x,y,dy; int i,size; long x2,y2,vel; ablob=activeblobs; activeblobs=0; while(ablob) { dy=ablob->blobdy; if(ablob->blobsize!=SMALLSIZE && (dy>-THRESHOLD && dy<THRESHOLD && !(rand()&7) || (rand()&127)==63)) { i=explodenum; while(i-- && freeblobs) { ablob2=freeblobs; freeblobs=freeblobs->blobnext; ablob2->blobx=ablob->blobx; ablob2->bloby=ablob->bloby; for(;;) { x2=(rand()&511)-256; y2=(rand()&511)-256; vel=x2*x2+y2*y2; if(vel>0x3000 && vel<0x10000L) break; } ablob2->blobdx=ablob->blobdx+x2; ablob2->blobdy=ablob->blobdy+y2; ablob2->bloblife=16+(rand()&31); ablob2->blobsize=SMALLSIZE; ablob2->blobnext=activeblobs; activeblobs=ablob2; ablob->bloblife=1; } } x=ablob->blobx>>BLOBFRAC; y=ablob->bloby>>BLOBFRAC; size=ablob->blobsize; if(size==BIGSIZE && ablob->blobdy>0 && ablob->blobdy<200) size=sizes[ablob->bloblife&7]; if(x>10 && x<XSIZE-10 && y>10 && y<YSIZE-10) disk(x,YSIZE-1-y,size); temp=ablob; ablob=ablob->blobnext; temp->blobnext=activeblobs; activeblobs=temp; } } #define RATE 1 void normal(char *map) { int i,j; for(i=0;i<8192;i++) { j=i/9; map[i]=j<256 ? (j>=RATE ? j-RATE : 0) : 255; } } void bright(char *map) { int i; for(i=0;i<8192;i++) map[i]=i>>3<255 ? (i>>3) : 255; } void updatemap(void) { SDL_SetColors(thescreen, themap, 0, 256); } void loadcolor(int n,int r,int g,int b) { themap[n].r=r<<2; themap[n].g=g<<2; themap[n].b=b<<2; } void loadcolors(unsigned int which) { int i,j; int r,g,b; which%=11; for(i=0;i<256;i++) { switch(which) { case 0: if(i<64) loadcolor(i,0,0,0); else if(i<128) loadcolor(i,i-64,0,0); else if(i<192) loadcolor(i,63,i-128,0); else loadcolor(i,63,63,i-192); break; case 1: if(i<64) loadcolor(i,0,0,0); else if(i<128) loadcolor(i,0,0,i-64); else loadcolor(i,(i-128)>>1,(i-128)>>1,63); break; case 2: loadcolor(i,i>>2,i>>2,i>>2); break; case 3: r=rand()&0x3f; g=rand()&0x3f; b=rand()&0x3f; loadcolor(i,r*i>>8,g*i>>8,b*i>>8); break; case 4: loadcolor(i,i>>2,0,0); break; case 5: loadcolor(i,0,i>>2,0); break; case 6: loadcolor(i,0,0,i>>2); break; case 7: j=i&15; if(i&16) j=15-j; j=(i>>2)*j/16; loadcolor(i,j,j,j); break; case 8: j=0; if(i>8 && i<128) j=63; loadcolor(i,j,j,j); break; case 9: j=31-(i&31)<<1; r=i&32 ? j : 0; g=i&64 ? j : 0; b=i&128 ? j : 0; loadcolor(i,r,g,b); break; case 10: j=(i&15)<<2; if(i&16) j=63-j; r=i&32 ? j : 0; g=i&64 ? j : 0; b=i&128 ? j : 0; loadcolor(i,r,g,b); break; } } updatemap(); } main(int argc, char *argv[]) { int i,k; char *remap,*remap2; unsigned char *p1, *p2; long frames; int flash; int whichmap; int key; int ispaused; unsigned long videoflags; int done; int now; SDL_Event event; long starttime; int buttonstate; srand(time(NULL)); if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) { fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError()); exit(1); } videoflags = SDL_SWSURFACE|SDL_FULLSCREEN|SDL_HWPALETTE; thescreen = SDL_SetVideoMode(XSIZE, YSIZE, 8, videoflags); if ( thescreen == NULL ) { fprintf(stderr, "Couldn't set display mode: %s\n", SDL_GetError()); SDL_Quit(); exit(5); } vmem1=NULL; vmem2=malloc(XSIZE*YSIZE); if(!vmem2) nomem(); mul640=malloc(YSIZE*sizeof(char *)); if(!mul640) nomem(); remap=malloc(16384); if(!remap) nomem(); remap2=malloc(16384); if(!remap2) nomem(); blobs=malloc(MAXBLOBS*sizeof(struct blob)); if(!blobs) nomem(); puts("Fire demo by David Ashley (dash@xdr.com)"); puts("1 = Change color map"); puts("2 = Randomly change color map"); puts("p = Pause"); puts("spc = Fire"); puts("esc = Exit"); puts("Left mouse button = paint"); puts("Right mouse button, CR = ignite atmosphere"); freeblobs=activeblobs=0; for(i=0;i<MAXBLOBS;i++) { blobs[i].blobnext=freeblobs; freeblobs=blobs+i; } normal(remap); bright(remap2); flash=0; whichmap=0; loadcolors(whichmap); frames=0; ispaused=0; addblob(); done = 0; now=0; starttime=SDL_GetTicks(); buttonstate=0; mousex=mousey=0; while(!done) { if ( scrlock() < 0 ) continue; frames++; if ( vmem1 != (unsigned char *)thescreen->pixels ) { p1=vmem1=thescreen->pixels; for (i=0;i<YSIZE;i++) { mul640[i]=i*thescreen->pitch+vmem1; memset(p1,0,XSIZE); p1+=thescreen->pitch; } } if(!ispaused) { now++; if(!flash) { if(explodenum>96 && explodenum<160 && !(rand()&511) || (buttonstate&8)) flash=60; } else --flash; explodenum=(now>>4)+1;if(explodenum==320) now=0; if(explodenum>256) explodenum=256; if(!(rand()&31)) addblob(); moveblobs(); putblobs(); if(buttonstate&2) trydisk(); p1=vmem1; p2=vmem2; k=thescreen->pitch; for(i=0;i<YSIZE;i++) { memcpy(p2,p1,XSIZE); p2+=XSIZE; p1+=k; } fire(vmem2,vmem1,k,flash ? remap2 :remap); } scrunlock(); while(SDL_PollEvent(&event)) { switch (event.type) { case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEBUTTONUP: if ( event.button.state == SDL_PRESSED ) buttonstate|=1<<event.button.button; else buttonstate&=~(1<<event.button.button); mousex=event.button.x; mousey=event.button.y; if(!ispaused && buttonstate&2) trydisk(); break; case SDL_MOUSEMOTION: mousex=event.motion.x; mousey=event.motion.y; if(!ispaused && buttonstate&2) trydisk(); break; case SDL_KEYDOWN: key=event.key.keysym.sym; if(key==SDLK_RETURN) {flash=60;break;} if(key==SDLK_1 || key==SDLK_2) { if(key==SDLK_1) ++whichmap; else whichmap=rand(); loadcolors(whichmap); break; } if(key==SDLK_ESCAPE) {done=1;break;} if(key==SDLK_SPACE && !ispaused) {addblob();break;} if(key==SDLK_p) {ispaused=!ispaused;break;} break; case SDL_QUIT: done = 1; break; default: break; } } } starttime=SDL_GetTicks()-starttime; if(!starttime) starttime=1; SDL_Quit(); printf("fps = %d\n",1000*frames/starttime); exit(0); }
html { font-family: sans-serif; } .map { position: fixed; top: 0; left: 0; right: 0; bottom: 0; } .about { position: absolute; width: 320px; height: 380px; background: white; opacity: 0.7; left: 10px; bottom: 10px; padding: 12px; box-shadow: 0 1px 5px rgba(0,0,0,0.65); border-radius: 4px; } #sidebar { opacity: 0.8; } .handle { display: inline-block; transition: -webkit-transform 0.1s linear; cursor: pointer; } .examples { overflow-y: hidden; transition: height 0.25s ease-in; } .hide { height: 0; } .closed { -webkit-transform: rotate(-90deg); -moz-transform: rotate(-90deg); -ms-transform: rotate(-90deg); -o-transform: rotate(-90deg); transform: rotate(-90deg); }
/* * nextpnr -- Next Generation Place and Route * * Copyright (C) 2018-19 gatecat <gatecat@ds0.me> * Copyright (C) 2020 Pepijn de Vos <pepijn@symbioticeda.com> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ #include <algorithm> #include <iostream> #include <iterator> #include "cells.h" #include "design_utils.h" #include "log.h" #include "util.h" NEXTPNR_NAMESPACE_BEGIN static void make_dummy_alu(Context *ctx, int alu_idx, CellInfo *ci, CellInfo *packed_head, std::vector<std::unique_ptr<CellInfo>> &new_cells) { if ((alu_idx % 2) == 0) { return; } std::unique_ptr<CellInfo> dummy = create_generic_cell(ctx, id_SLICE, ci->name.str(ctx) + "_DUMMY_ALULC"); if (ctx->verbose) { log_info("packed dummy ALU %s.\n", ctx->nameOf(dummy.get())); } dummy->params[id_ALU_MODE] = std::string("C2L"); // add to cluster dummy->cluster = packed_head->name; dummy->constr_z = alu_idx % 6; dummy->constr_x = alu_idx / 6; dummy->constr_y = 0; packed_head->constr_children.push_back(dummy.get()); new_cells.push_back(std::move(dummy)); } // replace ALU with LUT static void pack_alus(Context *ctx) { log_info("Packing ALUs..\n"); // cell name, CIN net name pool<std::pair<IdString, IdString>> alu_heads; // collect heads for (auto &cell : ctx->cells) { CellInfo *ci = cell.second.get(); if (is_alu(ctx, ci)) { NetInfo *cin = ci->ports.at(id_CIN).net; CellInfo *cin_ci = cin->driver.cell; if (cin == nullptr || cin_ci == nullptr) { log_error("CIN disconnected at ALU:%s\n", ctx->nameOf(ci)); continue; } if (!is_alu(ctx, cin_ci) || cin->users.size() > 1) { if (ctx->verbose) { log_info("ALU head found %s. CIN net is %s\n", ctx->nameOf(ci), ctx->nameOf(cin)); } alu_heads.insert(std::make_pair(ci->name, cin->name)); } } } pool<IdString> packed_cells; pool<IdString> delete_nets; std::vector<std::unique_ptr<CellInfo>> new_cells; for (auto &head : alu_heads) { CellInfo *ci = ctx->cells[head.first].get(); IdString cin_netId = head.second; if (ctx->verbose) { log_info("cell '%s' is of type '%s'\n", ctx->nameOf(ci), ci->type.c_str(ctx)); } std::unique_ptr<CellInfo> packed_head = create_generic_cell(ctx, id_SLICE, ci->name.str(ctx) + "_HEAD_ALULC"); if (ctx->verbose) { log_info("packed ALU head into %s. CIN net is %s\n", ctx->nameOf(packed_head.get()), ctx->nameOf(cin_netId)); } connect_port(ctx, ctx->nets[ctx->id("$PACKER_VCC_NET")].get(), packed_head.get(), id_C); if (cin_netId == ctx->id("$PACKER_GND_NET")) { // CIN = 0 packed_head->params[id_ALU_MODE] = std::string("C2L"); } else { if (cin_netId == ctx->id("$PACKER_VCC_NET")) { // CIN = 1 packed_head->params[id_ALU_MODE] = std::string("ONE2C"); } else { // CIN from logic connect_port(ctx, ctx->nets[cin_netId].get(), packed_head.get(), id_B); connect_port(ctx, ctx->nets[cin_netId].get(), packed_head.get(), id_D); packed_head->params[id_ALU_MODE] = std::string("0"); // ADD } } int alu_idx = 1; do { // go through the ALU chain auto alu_bel = ci->attrs.find(ctx->id("BEL")); if (alu_bel != ci->attrs.end()) { log_error("ALU %s placement restrictions are not supported.\n", ctx->nameOf(ci)); return; } // remove cell packed_cells.insert(ci->name); // CIN/COUT are hardwired, delete disconnect_port(ctx, ci, id_CIN); NetInfo *cout = ci->ports.at(id_COUT).net; disconnect_port(ctx, ci, id_COUT); std::unique_ptr<CellInfo> packed = create_generic_cell(ctx, id_SLICE, ci->name.str(ctx) + "_ALULC"); if (ctx->verbose) { log_info("packed ALU into %s. COUT net is %s\n", ctx->nameOf(packed.get()), ctx->nameOf(cout)); } int mode = int_or_default(ci->params, id_ALU_MODE); packed->params[id_ALU_MODE] = mode; if (mode == 9) { // MULT connect_port(ctx, ctx->nets[ctx->id("$PACKER_GND_NET")].get(), packed.get(), id_C); } else { connect_port(ctx, ctx->nets[ctx->id("$PACKER_VCC_NET")].get(), packed.get(), id_C); } // add to cluster packed->cluster = packed_head->name; packed->constr_z = alu_idx % 6; packed->constr_x = alu_idx / 6; packed->constr_y = 0; packed_head->constr_children.push_back(packed.get()); ++alu_idx; // connect all remainig ports replace_port(ci, id_SUM, packed.get(), id_F); switch (mode) { case 0: // ADD replace_port(ci, id_I0, packed.get(), id_B); replace_port(ci, id_I1, packed.get(), id_D); break; case 1: // SUB replace_port(ci, id_I0, packed.get(), id_A); replace_port(ci, id_I1, packed.get(), id_D); break; case 5: // LE replace_port(ci, id_I0, packed.get(), id_A); replace_port(ci, id_I1, packed.get(), id_B); break; case 9: // MULT replace_port(ci, id_I0, packed.get(), id_A); replace_port(ci, id_I1, packed.get(), id_B); disconnect_port(ctx, packed.get(), id_D); connect_port(ctx, ctx->nets[ctx->id("$PACKER_VCC_NET")].get(), packed.get(), id_D); break; default: replace_port(ci, id_I0, packed.get(), id_A); replace_port(ci, id_I1, packed.get(), id_B); replace_port(ci, id_I3, packed.get(), id_D); } new_cells.push_back(std::move(packed)); if (cout != nullptr && cout->users.size() > 0) { // if COUT used by logic if ((cout->users.size() > 1) || (!is_alu(ctx, cout->users.at(0).cell))) { if (ctx->verbose) { log_info("COUT is used by logic\n"); } // make gate C->logic std::unique_ptr<CellInfo> packed_tail = create_generic_cell(ctx, id_SLICE, ci->name.str(ctx) + "_TAIL_ALULC"); if (ctx->verbose) { log_info("packed ALU tail into %s. COUT net is %s\n", ctx->nameOf(packed_tail.get()), ctx->nameOf(cout)); } packed_tail->params[id_ALU_MODE] = std::string("C2L"); connect_port(ctx, cout, packed_tail.get(), id_F); // add to cluster packed_tail->cluster = packed_head->name; packed_tail->constr_z = alu_idx % 6; packed_tail->constr_x = alu_idx / 6; packed_tail->constr_y = 0; ++alu_idx; packed_head->constr_children.push_back(packed_tail.get()); new_cells.push_back(std::move(packed_tail)); make_dummy_alu(ctx, alu_idx, ci, packed_head.get(), new_cells); break; } // next ALU ci = cout->users.at(0).cell; // if ALU is too big if (alu_idx == (ctx->gridDimX - 2) * 6 - 1) { log_error("ALU %s is the %dth in the chain. Such long chains are not supported.\n", ctx->nameOf(ci), alu_idx); break; } } else { // COUT is unused if (ctx->verbose) { log_info("cell is the ALU tail. Index is %d\n", alu_idx); } make_dummy_alu(ctx, alu_idx, ci, packed_head.get(), new_cells); break; } } while (1); // add head to the cluster packed_head->cluster = packed_head->name; new_cells.push_back(std::move(packed_head)); } // actual delete, erase and move cells/nets for (auto pcell : packed_cells) { ctx->cells.erase(pcell); } for (auto dnet : delete_nets) { ctx->nets.erase(dnet); } for (auto &ncell : new_cells) { ctx->cells[ncell->name] = std::move(ncell); } } // pack MUX2_LUT5 static void pack_mux2_lut5(Context *ctx, CellInfo *ci, pool<IdString> &packed_cells, pool<IdString> &delete_nets, std::vector<std::unique_ptr<CellInfo>> &new_cells) { if (bool_or_default(ci->attrs, ctx->id("SINGLE_INPUT_MUX"))) { // find the muxed LUT NetInfo *i1 = ci->ports.at(id_I1).net; CellInfo *lut1 = net_driven_by(ctx, i1, is_lut, id_F); if (lut1 == nullptr) { log_error("MUX2_LUT5 '%s' port I1 isn't connected to the LUT\n", ctx->nameOf(ci)); return; } if (ctx->verbose) { log_info("found attached lut1 %s\n", ctx->nameOf(lut1)); } // XXX enable the placement constraints auto mux_bel = ci->attrs.find(ctx->id("BEL")); auto lut1_bel = lut1->attrs.find(ctx->id("BEL")); if (lut1_bel != lut1->attrs.end() || mux_bel != ci->attrs.end()) { log_error("MUX2_LUT5 '%s' placement restrictions are not supported yet\n", ctx->nameOf(ci)); return; } std::unique_ptr<CellInfo> packed = create_generic_cell(ctx, ctx->id("GW_MUX2_LUT5"), ci->name.str(ctx) + "_LC"); if (ctx->verbose) { log_info("packed cell %s into %s\n", ctx->nameOf(ci), ctx->nameOf(packed.get())); } // mux is the cluster root packed->cluster = packed->name; lut1->cluster = packed->name; lut1->constr_z = -ctx->mux_0_z + 1; packed->constr_children.clear(); // reconnect MUX ports replace_port(ci, id_O, packed.get(), id_OF); replace_port(ci, id_I1, packed.get(), id_I1); // remove cells packed_cells.insert(ci->name); // new MUX cell new_cells.push_back(std::move(packed)); } else { // find the muxed LUTs NetInfo *i0 = ci->ports.at(id_I0).net; NetInfo *i1 = ci->ports.at(id_I1).net; CellInfo *lut0 = net_driven_by(ctx, i0, is_lut, id_F); CellInfo *lut1 = net_driven_by(ctx, i1, is_lut, id_F); if (lut0 == nullptr || lut1 == nullptr) { log_error("MUX2_LUT5 '%s' port I0 or I1 isn't connected to the LUT\n", ctx->nameOf(ci)); return; } if (ctx->verbose) { log_info("found attached lut0 %s\n", ctx->nameOf(lut0)); log_info("found attached lut1 %s\n", ctx->nameOf(lut1)); } // XXX enable the placement constraints auto mux_bel = ci->attrs.find(ctx->id("BEL")); auto lut0_bel = lut0->attrs.find(ctx->id("BEL")); auto lut1_bel = lut1->attrs.find(ctx->id("BEL")); if (lut0_bel != lut0->attrs.end() || lut1_bel != lut1->attrs.end() || mux_bel != ci->attrs.end()) { log_error("MUX2_LUT5 '%s' placement restrictions are not supported yet\n", ctx->nameOf(ci)); return; } std::unique_ptr<CellInfo> packed = create_generic_cell(ctx, ctx->id("GW_MUX2_LUT5"), ci->name.str(ctx) + "_LC"); if (ctx->verbose) { log_info("packed cell %s into %s\n", ctx->nameOf(ci), ctx->nameOf(packed.get())); } // mux is the cluster root packed->cluster = packed->name; lut0->cluster = packed->name; lut0->constr_z = -ctx->mux_0_z; lut1->cluster = packed->name; lut1->constr_z = -ctx->mux_0_z + 1; packed->constr_children.clear(); // reconnect MUX ports replace_port(ci, id_O, packed.get(), id_OF); replace_port(ci, id_S0, packed.get(), id_SEL); replace_port(ci, id_I0, packed.get(), id_I0); replace_port(ci, id_I1, packed.get(), id_I1); // remove cells packed_cells.insert(ci->name); // new MUX cell new_cells.push_back(std::move(packed)); } } // Common MUX2 packing routine static void pack_mux2_lut(Context *ctx, CellInfo *ci, bool (*pred)(const BaseCtx *, const CellInfo *), char const type_suffix, IdString const type_id, int const x[2], int const z[2], pool<IdString> &packed_cells, pool<IdString> &delete_nets, std::vector<std::unique_ptr<CellInfo>> &new_cells) { // find the muxed LUTs NetInfo *i0 = ci->ports.at(id_I0).net; NetInfo *i1 = ci->ports.at(id_I1).net; CellInfo *mux0 = net_driven_by(ctx, i0, pred, id_OF); CellInfo *mux1 = net_driven_by(ctx, i1, pred, id_OF); if (mux0 == nullptr || mux1 == nullptr) { log_error("MUX2_LUT%c '%s' port I0 or I1 isn't connected to the MUX\n", type_suffix, ctx->nameOf(ci)); return; } if (ctx->verbose) { log_info("found attached mux0 %s\n", ctx->nameOf(mux0)); log_info("found attached mux1 %s\n", ctx->nameOf(mux1)); } // XXX enable the placement constraints auto mux_bel = ci->attrs.find(ctx->id("BEL")); auto mux0_bel = mux0->attrs.find(ctx->id("BEL")); auto mux1_bel = mux1->attrs.find(ctx->id("BEL")); if (mux0_bel != mux0->attrs.end() || mux1_bel != mux1->attrs.end() || mux_bel != ci->attrs.end()) { log_error("MUX2_LUT%c '%s' placement restrictions are not supported yet\n", type_suffix, ctx->nameOf(ci)); return; } std::unique_ptr<CellInfo> packed = create_generic_cell(ctx, type_id, ci->name.str(ctx) + "_LC"); if (ctx->verbose) { log_info("packed cell %s into %s\n", ctx->nameOf(ci), ctx->nameOf(packed.get())); } // mux is the cluster root packed->cluster = packed->name; mux0->cluster = packed->name; mux0->constr_x = x[0]; mux0->constr_y = 0; mux0->constr_z = z[0]; for (auto &child : mux0->constr_children) { child->cluster = packed->name; child->constr_x += mux0->constr_x; child->constr_z += mux0->constr_z; packed->constr_children.push_back(child); } mux0->constr_children.clear(); mux1->cluster = packed->name; mux1->constr_x = x[1]; mux0->constr_y = 0; mux1->constr_z = z[1]; for (auto &child : mux1->constr_children) { child->cluster = packed->name; child->constr_x += mux1->constr_x; child->constr_z += mux1->constr_z; packed->constr_children.push_back(child); } mux1->constr_children.clear(); packed->constr_children.push_back(mux0); packed->constr_children.push_back(mux1); // reconnect MUX ports replace_port(ci, id_O, packed.get(), id_OF); replace_port(ci, id_S0, packed.get(), id_SEL); replace_port(ci, id_I0, packed.get(), id_I0); replace_port(ci, id_I1, packed.get(), id_I1); // remove cells packed_cells.insert(ci->name); // new MUX cell new_cells.push_back(std::move(packed)); } // pack MUX2_LUT6 static void pack_mux2_lut6(Context *ctx, CellInfo *ci, pool<IdString> &packed_cells, pool<IdString> &delete_nets, std::vector<std::unique_ptr<CellInfo>> &new_cells) { static int x[] = {0, 0}; static int z[] = {+1, -1}; pack_mux2_lut(ctx, ci, is_gw_mux2_lut5, '6', id_GW_MUX2_LUT6, x, z, packed_cells, delete_nets, new_cells); } // pack MUX2_LUT7 static void pack_mux2_lut7(Context *ctx, CellInfo *ci, pool<IdString> &packed_cells, pool<IdString> &delete_nets, std::vector<std::unique_ptr<CellInfo>> &new_cells) { static int x[] = {0, 0}; static int z[] = {+2, -2}; pack_mux2_lut(ctx, ci, is_gw_mux2_lut6, '7', id_GW_MUX2_LUT7, x, z, packed_cells, delete_nets, new_cells); } // pack MUX2_LUT8 static void pack_mux2_lut8(Context *ctx, CellInfo *ci, pool<IdString> &packed_cells, pool<IdString> &delete_nets, std::vector<std::unique_ptr<CellInfo>> &new_cells) { static int x[] = {1, 0}; static int z[] = {-4, -4}; pack_mux2_lut(ctx, ci, is_gw_mux2_lut7, '8', id_GW_MUX2_LUT8, x, z, packed_cells, delete_nets, new_cells); } // Pack wide LUTs static void pack_wideluts(Context *ctx) { log_info("Packing wide LUTs..\n"); pool<IdString> packed_cells; pool<IdString> delete_nets; std::vector<std::unique_ptr<CellInfo>> new_cells; pool<IdString> mux2lut6; pool<IdString> mux2lut7; pool<IdString> mux2lut8; // do MUX2_LUT5 and collect LUT6/7/8 log_info("Packing LUT5s..\n"); for (auto &cell : ctx->cells) { CellInfo *ci = cell.second.get(); if (ctx->verbose) { log_info("cell '%s' is of type '%s'\n", ctx->nameOf(ci), ci->type.c_str(ctx)); } if (is_widelut(ctx, ci)) { if (is_mux2_lut5(ctx, ci)) { pack_mux2_lut5(ctx, ci, packed_cells, delete_nets, new_cells); } else { if (is_mux2_lut6(ctx, ci)) { mux2lut6.insert(ci->name); } else { if (is_mux2_lut7(ctx, ci)) { mux2lut7.insert(ci->name); } else { if (is_mux2_lut8(ctx, ci)) { mux2lut8.insert(ci->name); } } } } } } // do MUX_LUT6 log_info("Packing LUT6s..\n"); for (auto &cell_name : mux2lut6) { pack_mux2_lut6(ctx, ctx->cells[cell_name].get(), packed_cells, delete_nets, new_cells); } // do MUX_LUT7 log_info("Packing LUT7s..\n"); for (auto &cell_name : mux2lut7) { pack_mux2_lut7(ctx, ctx->cells[cell_name].get(), packed_cells, delete_nets, new_cells); } // do MUX_LUT8 log_info("Packing LUT8s..\n"); for (auto &cell_name : mux2lut8) { pack_mux2_lut8(ctx, ctx->cells[cell_name].get(), packed_cells, delete_nets, new_cells); } // actual delete, erase and move cells/nets for (auto pcell : packed_cells) { ctx->cells.erase(pcell); } for (auto dnet : delete_nets) { ctx->nets.erase(dnet); } for (auto &ncell : new_cells) { ctx->cells[ncell->name] = std::move(ncell); } } // Pack LUTs and LUT-FF pairs static void pack_lut_lutffs(Context *ctx) { log_info("Packing LUT-FFs..\n"); pool<IdString> packed_cells; std::vector<std::unique_ptr<CellInfo>> new_cells; for (auto &cell : ctx->cells) { CellInfo *ci = cell.second.get(); if (ctx->verbose) log_info("cell '%s' is of type '%s'\n", ctx->nameOf(ci), ci->type.c_str(ctx)); if (is_lut(ctx, ci)) { std::unique_ptr<CellInfo> packed = create_generic_cell(ctx, ctx->id("SLICE"), ci->name.str(ctx) + "_LC"); for (auto &attr : ci->attrs) packed->attrs[attr.first] = attr.second; packed_cells.insert(ci->name); if (ctx->verbose) log_info("packed cell %s into %s\n", ctx->nameOf(ci), ctx->nameOf(packed.get())); // See if we can pack into a DFF // TODO: LUT cascade NetInfo *o = ci->ports.at(ctx->id("F")).net; CellInfo *dff = net_only_drives(ctx, o, is_ff, ctx->id("D"), true); auto lut_bel = ci->attrs.find(ctx->id("BEL")); bool packed_dff = false; if (dff) { if (ctx->verbose) log_info("found attached dff %s\n", ctx->nameOf(dff)); auto dff_bel = dff->attrs.find(ctx->id("BEL")); if (lut_bel != ci->attrs.end() && dff_bel != dff->attrs.end() && lut_bel->second != dff_bel->second) { // Locations don't match, can't pack } else { lut_to_lc(ctx, ci, packed.get(), false); dff_to_lc(ctx, dff, packed.get(), false); ctx->nets.erase(o->name); if (dff_bel != dff->attrs.end()) packed->attrs[ctx->id("BEL")] = dff_bel->second; packed_cells.insert(dff->name); if (ctx->verbose) log_info("packed cell %s into %s\n", ctx->nameOf(dff), ctx->nameOf(packed.get())); packed_dff = true; } } if (!packed_dff) { lut_to_lc(ctx, ci, packed.get(), true); } new_cells.push_back(std::move(packed)); } } for (auto pcell : packed_cells) { ctx->cells.erase(pcell); } for (auto &ncell : new_cells) { ctx->cells[ncell->name] = std::move(ncell); } } // Pack FFs not packed as LUTFFs static void pack_nonlut_ffs(Context *ctx) { log_info("Packing non-LUT FFs..\n"); pool<IdString> packed_cells; std::vector<std::unique_ptr<CellInfo>> new_cells; for (auto &cell : ctx->cells) { CellInfo *ci = cell.second.get(); if (is_ff(ctx, ci)) { std::unique_ptr<CellInfo> packed = create_generic_cell(ctx, ctx->id("SLICE"), ci->name.str(ctx) + "_DFFLC"); for (auto &attr : ci->attrs) packed->attrs[attr.first] = attr.second; if (ctx->verbose) log_info("packed cell %s into %s\n", ctx->nameOf(ci), ctx->nameOf(packed.get())); packed_cells.insert(ci->name); dff_to_lc(ctx, ci, packed.get(), true); new_cells.push_back(std::move(packed)); } } for (auto pcell : packed_cells) { ctx->cells.erase(pcell); } for (auto &ncell : new_cells) { ctx->cells[ncell->name] = std::move(ncell); } } // Merge a net into a constant net static void set_net_constant(const Context *ctx, NetInfo *orig, NetInfo *constnet, bool constval) { orig->driver.cell = nullptr; for (auto user : orig->users) { if (user.cell != nullptr) { CellInfo *uc = user.cell; if (ctx->verbose) log_info("%s user %s\n", ctx->nameOf(orig), ctx->nameOf(uc)); if ((is_lut(ctx, uc) || is_lc(ctx, uc)) && (user.port.str(ctx).at(0) == 'I') && !constval) { uc->ports[user.port].net = nullptr; } else { uc->ports[user.port].net = constnet; constnet->users.push_back(user); } } } orig->users.clear(); } // Pack constants (simple implementation) static void pack_constants(Context *ctx) { log_info("Packing constants..\n"); std::unique_ptr<CellInfo> gnd_cell = create_generic_cell(ctx, ctx->id("SLICE"), "$PACKER_GND"); gnd_cell->params[ctx->id("INIT")] = Property(0, 1 << 4); std::unique_ptr<NetInfo> gnd_net = std::unique_ptr<NetInfo>(new NetInfo); gnd_net->name = ctx->id("$PACKER_GND_NET"); gnd_net->driver.cell = gnd_cell.get(); gnd_net->driver.port = ctx->id("F"); gnd_cell->ports.at(ctx->id("F")).net = gnd_net.get(); std::unique_ptr<CellInfo> vcc_cell = create_generic_cell(ctx, ctx->id("SLICE"), "$PACKER_VCC"); // Fill with 1s vcc_cell->params[ctx->id("INIT")] = Property(Property::S1).extract(0, (1 << 4), Property::S1); std::unique_ptr<NetInfo> vcc_net = std::unique_ptr<NetInfo>(new NetInfo); vcc_net->name = ctx->id("$PACKER_VCC_NET"); vcc_net->driver.cell = vcc_cell.get(); vcc_net->driver.port = ctx->id("F"); vcc_cell->ports.at(ctx->id("F")).net = vcc_net.get(); std::vector<IdString> dead_nets; bool gnd_used = false; for (auto &net : ctx->nets) { NetInfo *ni = net.second.get(); if (ni->driver.cell != nullptr && ni->driver.cell->type == ctx->id("GND")) { IdString drv_cell = ni->driver.cell->name; set_net_constant(ctx, ni, gnd_net.get(), false); gnd_used = true; dead_nets.push_back(net.first); ctx->cells.erase(drv_cell); } else if (ni->driver.cell != nullptr && ni->driver.cell->type == ctx->id("VCC")) { IdString drv_cell = ni->driver.cell->name; set_net_constant(ctx, ni, vcc_net.get(), true); dead_nets.push_back(net.first); ctx->cells.erase(drv_cell); } } if (gnd_used) { ctx->cells[gnd_cell->name] = std::move(gnd_cell); ctx->nets[gnd_net->name] = std::move(gnd_net); } // Vcc cell always inserted for now, as it may be needed during carry legalisation (TODO: trim later if actually // never used?) ctx->cells[vcc_cell->name] = std::move(vcc_cell); ctx->nets[vcc_net->name] = std::move(vcc_net); for (auto dn : dead_nets) { ctx->nets.erase(dn); } } static bool is_nextpnr_iob(const Context *ctx, CellInfo *cell) { return cell->type == ctx->id("$nextpnr_ibuf") || cell->type == ctx->id("$nextpnr_obuf") || cell->type == ctx->id("$nextpnr_iobuf"); } static bool is_gowin_iob(const Context *ctx, const CellInfo *cell) { switch (cell->type.index) { case ID_IBUF: case ID_OBUF: case ID_IOBUF: case ID_TBUF: return true; default: return false; } } // Pack IO buffers static void pack_io(Context *ctx) { pool<IdString> packed_cells; pool<IdString> delete_nets; std::vector<std::unique_ptr<CellInfo>> new_cells; log_info("Packing IOs..\n"); for (auto &cell : ctx->cells) { CellInfo *ci = cell.second.get(); if (is_gowin_iob(ctx, ci)) { CellInfo *iob = nullptr; switch (ci->type.index) { case ID_IBUF: iob = net_driven_by(ctx, ci->ports.at(id_I).net, is_nextpnr_iob, id_O); break; case ID_OBUF: iob = net_only_drives(ctx, ci->ports.at(id_O).net, is_nextpnr_iob, id_I); break; case ID_IOBUF: iob = net_driven_by(ctx, ci->ports.at(id_IO).net, is_nextpnr_iob, id_O); break; case ID_TBUF: iob = net_only_drives(ctx, ci->ports.at(id_O).net, is_nextpnr_iob, id_I); break; default: break; } if (iob != nullptr) { // delete the $nexpnr_[io]buf for (auto &p : iob->ports) { IdString netname = p.second.net->name; disconnect_port(ctx, iob, p.first); delete_nets.insert(netname); } packed_cells.insert(iob->name); } // Create a IOB buffer std::unique_ptr<CellInfo> ice_cell = create_generic_cell(ctx, id_IOB, ci->name.str(ctx) + "$iob"); gwio_to_iob(ctx, ci, ice_cell.get(), packed_cells); new_cells.push_back(std::move(ice_cell)); auto gwiob = new_cells.back().get(); packed_cells.insert(ci->name); if (iob != nullptr) { // in Gowin .CST port attributes take precedence over cell attributes. // first copy cell attrs related to IO for (auto &attr : ci->attrs) { if (attr.first == IdString(ID_BEL) || attr.first.str(ctx)[0] == '&') { gwiob->setAttr(attr.first, attr.second); } } // rewrite attributes from the port for (auto &attr : iob->attrs) { gwiob->setAttr(attr.first, attr.second); } } } } for (auto pcell : packed_cells) { ctx->cells.erase(pcell); } for (auto dnet : delete_nets) { ctx->nets.erase(dnet); } for (auto &ncell : new_cells) { ctx->cells[ncell->name] = std::move(ncell); } } // Main pack function bool Arch::pack() { Context *ctx = getCtx(); try { log_break(); pack_constants(ctx); pack_io(ctx); pack_wideluts(ctx); pack_alus(ctx); pack_lut_lutffs(ctx); pack_nonlut_ffs(ctx); ctx->settings[ctx->id("pack")] = 1; ctx->assignArchInfo(); log_info("Checksum: 0x%08x\n", ctx->checksum()); return true; } catch (log_execution_error_exception) { return false; } } NEXTPNR_NAMESPACE_END
<div class="page-header"> <h1>About {{$stateParams.foo || something}}</h1> </div> <pre>{{$stateParams}}</pre> <div ng-repeat="i in [1,2,3,4,5]"> <h5>Lipsum {{i}} {{something}}</h5> <ng-include src="'/partials/lipsum.html'"></ng-include> </div>
"use strict"; var CustomError = require('custom-error-instance'); var inventory = require('./inventory'); var menu = require('./menu'); var OrderError = CustomError('OrderError'); module.exports = function() { var done = false; var factory = {}; var store = {}; /** * Add an item from the menu to the order. * @param {string} name The name of the menu item to add. */ factory.add = function(name) { var item = menu.get(name); if (done) throw new OrderError('Order has been closed.', { code: 'EDONE' }); if (!item) throw new OrderError('Menu item does not exist: ' + name, { code: 'EDNE' }); if (!menu.available(name)) throw new OrderError('Insufficient inventory', { code: 'EINV' }); if (!store.hasOwnProperty(name)) store[name] = 0; store[name]++; item.ingredients.forEach(function(ingredient) { inventory.changeQuantity(ingredient.name, -1 * ingredient.quantity); }); return factory; }; factory.checkout = function() { done = true; console.log('Order complete. Income: $' + factory.cost()); }; factory.cost = function() { var total = 0; Object.keys(store).forEach(function(menuItemName) { var item = menu.get(menuItemName); if (item) { total += item.cost; } else { factory.remove(menuItemName); } }); return total; }; factory.remove = function(name) { var item; if (done) throw new OrderError('Order has been closed.', { code: 'EDONE' }); if (!store.hasOwnProperty(name)) return; store[name]--; if (store[name] <= 0) delete store[name]; item = menu.get(name); item.ingredients.forEach(function(ingredient) { inventory.changeQuantity(ingredient.name, ingredient.quantity); }); return factory; }; return factory; };
const test = require('tape') const helpers = require('../test/helpers') const bindFunc = helpers.bindFunc const unary = require('./unary') test('unary helper', t => { const f = bindFunc(unary) const err = /unary: Argument must be a Function/ t.throws(f(undefined), err, 'throws with undefined') t.throws(f(null), err, 'throws with null') t.throws(f(0), err, 'throws with falsey number') t.throws(f(1), err, 'throws with truthy number') t.throws(f(''), err, 'throws with falsey string') t.throws(f('string'), err, 'throws with truthy string') t.throws(f(false), err, 'throws with false') t.throws(f(true), err, 'throws with true') t.throws(f({}), err, 'throws with object') t.throws(f([]), err, 'throws with array') const fn = unary((x, y, z) => ({ x: x, y: y, z: z })) t.same(fn(1, 2, 3), { x: 1, y: undefined, z: undefined }, 'only applies first argument to function') t.end() })
import Key from './key'; import SubscriberPayload from './subscriber-payload'; import Transition from './transition'; import TransitionHistory from './transition-history'; import TransitionSet from './transition-set'; /** * A class responsible for performing the transition between states. */ export default class Transitioner { private history: TransitionHistory; private transitions: TransitionSet; /** * @param transitions - The set of transitions to manage */ constructor(transitions: TransitionSet, history: TransitionHistory) { this.transitions = transitions; this.history = history; } /** * Check if it is possible to transition to a state from another state * @param toState - The state to transition to * @param fromState - The state to transition from * @return True if it is possible to transition */ canTransition(toState: Key, fromState: Key): boolean { return this.findExecutableTransition(toState, fromState) !== undefined; } /** * Check if it is possible to perform an undo * @return True if it is possible to undo */ canUndo(): boolean { return this.getTransitionForUndo() !== undefined; } /** * Check if it is possible to perform a redo * @return True if it is possible to redo */ canRedo(): boolean { return this.getTransitionForRedo() !== undefined; } /** * Transition to a state from another state. Fire the callback once the * transition is completed. If the to/from state does not exist, an error * will be thrown. * @param toState - The state to transition to * @param fromState - The state to transition from * @param [data] - The meta data associated with the transition * @param [callback] - The callback to fire once the transition is completed */ transition(toState: Key, fromState: Key, data?: any, callback?: (payload: SubscriberPayload) => void): void { if (!this.transitions.hasTransition({ from: fromState }) || !this.transitions.hasTransition({ to: toState })) { throw new Error(`Unable to transition from "${fromState}" to "${toState}"`); } const transition = this.findExecutableTransition(toState, fromState); if (transition) { this.history.addRecord({ data, state: transition.to }); if (callback) { callback({ from: transition.from, to: transition.to }); } } } /** * Transition to a new state by triggering an event. If the event or state * does not exist, an error will be thrown. * @param event - The event to trigger * @param fromState - The state to transition from * @param [data] - The meta data associated with the transition * @param [callback] - The callback to fire once the transition is completed */ triggerEvent(event: Key, fromState: Key, data?: any, callback?: (payload: SubscriberPayload) => void): void { if (!this.transitions.hasEvent(event) || !this.transitions.hasTransition({ from: fromState })) { throw new Error(`Unable to trigger "${event}" and transition from "${fromState}"`); } const transition = this.findExecutableTransitionByEvent(event, fromState); if (transition) { this.history.addRecord({ data, event, state: transition.to }); if (callback) { callback({ event: transition.event, from: transition.from, to: transition.to }); } } } /** * Undo a state transition. Fire the callback if it is possible to undo * @param [callback] - The callback to fire once the transition is completed */ undoTransition(callback?: (payload: SubscriberPayload) => void): void { const transition = this.getTransitionForUndo(); const record = this.history.getPreviousRecord(); if (!transition || !record) { return; } this.history.rewindHistory(); if (callback) { callback({ data: record.data, event: transition.event, from: transition.to, to: transition.from, }); } } /** * Redo a state transition. Fire the callback if it is possible to redo * @param [callback] - The callback to fire once the transition is completed */ redoTransition(callback?: (payload: SubscriberPayload) => void): void { const transition = this.getTransitionForRedo(); const record = this.history.getNextRecord(); if (!transition || !record) { return; } this.history.forwardHistory(); if (callback) { callback({ data: record.data, event: transition.event, from: transition.from, to: transition.to, }); } } /** * Find the first executable transition based on to/from state * @param toState - The state to transition to * @param fromState - The state to transition from * @return The executable transition */ private findExecutableTransition(toState: Key, fromState: Key): Transition | undefined { const transitions = this.transitions.filterExecutableTransitions({ from: fromState, to: toState, }); return transitions[0]; } /** * Find the first executable transition by event * @param toState - The state to transition to * @param fromState - The state to transition from * @return The executable transition */ private findExecutableTransitionByEvent(event: Key, fromState: Key): Transition | undefined { const transitions = this.transitions.filterExecutableTransitions({ event, from: fromState, }); return transitions[0]; } /** * Get a transition that can undo the current state * @return The undoable transition */ private getTransitionForUndo(): Transition | undefined { if (!this.history.getPreviousRecord()) { return; } const currentState = this.history.getCurrentRecord().state; const { state } = this.history.getPreviousRecord()!; const transition = this.findExecutableTransition(currentState, state); if (!transition || !transition.undoable) { return; } return transition; } /** * Get a transition that can redo the previous state * @return The redoable transition */ private getTransitionForRedo(): Transition | undefined { if (!this.history.getNextRecord()) { return; } const currentState = this.history.getCurrentRecord().state; const { state } = this.history.getNextRecord()!; const transition = this.findExecutableTransition(state, currentState); if (!transition || !transition.undoable) { return; } return transition; } }
// Copyright (c) 2016 The btcsuite developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. package rpctest import ( "errors" "math" "math/big" "runtime" "time" "github.com/ltcsuite/ltcd/blockchain" "github.com/ltcsuite/ltcd/chaincfg" "github.com/ltcsuite/ltcd/chaincfg/chainhash" "github.com/ltcsuite/ltcd/ltcutil" "github.com/ltcsuite/ltcd/mining" "github.com/ltcsuite/ltcd/txscript" "github.com/ltcsuite/ltcd/wire" ) // solveBlock attempts to find a nonce which makes the passed block header hash // to a value less than the target difficulty. When a successful solution is // found true is returned and the nonce field of the passed header is updated // with the solution. False is returned if no solution exists. func solveBlock(header *wire.BlockHeader, targetDifficulty *big.Int) bool { // sbResult is used by the solver goroutines to send results. type sbResult struct { found bool nonce uint32 } // solver accepts a block header and a nonce range to test. It is // intended to be run as a goroutine. quit := make(chan bool) results := make(chan sbResult) solver := func(hdr wire.BlockHeader, startNonce, stopNonce uint32) { // We need to modify the nonce field of the header, so make sure // we work with a copy of the original header. for i := startNonce; i >= startNonce && i <= stopNonce; i++ { select { case <-quit: return default: hdr.Nonce = i hash := hdr.PowHash() if blockchain.HashToBig(&hash).Cmp(targetDifficulty) <= 0 { select { case results <- sbResult{true, i}: return case <-quit: return } } } } select { case results <- sbResult{false, 0}: case <-quit: return } } startNonce := uint32(0) stopNonce := uint32(math.MaxUint32) numCores := uint32(runtime.NumCPU()) noncesPerCore := (stopNonce - startNonce) / numCores for i := uint32(0); i < numCores; i++ { rangeStart := startNonce + (noncesPerCore * i) rangeStop := startNonce + (noncesPerCore * (i + 1)) - 1 if i == numCores-1 { rangeStop = stopNonce } go solver(*header, rangeStart, rangeStop) } for i := uint32(0); i < numCores; i++ { result := <-results if result.found { close(quit) header.Nonce = result.nonce return true } } return false } // standardCoinbaseScript returns a standard script suitable for use as the // signature script of the coinbase transaction of a new block. In particular, // it starts with the block height that is required by version 2 blocks. func standardCoinbaseScript(nextBlockHeight int32, extraNonce uint64) ([]byte, error) { return txscript.NewScriptBuilder().AddInt64(int64(nextBlockHeight)). AddInt64(int64(extraNonce)).Script() } // createCoinbaseTx returns a coinbase transaction paying an appropriate // subsidy based on the passed block height to the provided address. func createCoinbaseTx(coinbaseScript []byte, nextBlockHeight int32, addr ltcutil.Address, mineTo []wire.TxOut, net *chaincfg.Params) (*ltcutil.Tx, error) { // Create the script to pay to the provided payment address. pkScript, err := txscript.PayToAddrScript(addr) if err != nil { return nil, err } tx := wire.NewMsgTx(wire.TxVersion) tx.AddTxIn(&wire.TxIn{ // Coinbase transactions have no inputs, so previous outpoint is // zero hash and max index. PreviousOutPoint: *wire.NewOutPoint(&chainhash.Hash{}, wire.MaxPrevOutIndex), SignatureScript: coinbaseScript, Sequence: wire.MaxTxInSequenceNum, }) if len(mineTo) == 0 { tx.AddTxOut(&wire.TxOut{ Value: blockchain.CalcBlockSubsidy(nextBlockHeight, net), PkScript: pkScript, }) } else { for i := range mineTo { tx.AddTxOut(&mineTo[i]) } } return ltcutil.NewTx(tx), nil } // CreateBlock creates a new block building from the previous block with a // specified blockversion and timestamp. If the timestamp passed is zero (not // initialized), then the timestamp of the previous block will be used plus 1 // second is used. Passing nil for the previous block results in a block that // builds off of the genesis block for the specified chain. func CreateBlock(prevBlock *ltcutil.Block, inclusionTxs []*ltcutil.Tx, blockVersion int32, blockTime time.Time, miningAddr ltcutil.Address, mineTo []wire.TxOut, net *chaincfg.Params) (*ltcutil.Block, error) { var ( prevHash *chainhash.Hash blockHeight int32 prevBlockTime time.Time ) // If the previous block isn't specified, then we'll construct a block // that builds off of the genesis block for the chain. if prevBlock == nil { prevHash = net.GenesisHash blockHeight = 1 prevBlockTime = net.GenesisBlock.Header.Timestamp.Add(time.Minute) } else { prevHash = prevBlock.Hash() blockHeight = prevBlock.Height() + 1 prevBlockTime = prevBlock.MsgBlock().Header.Timestamp } // If a target block time was specified, then use that as the header's // timestamp. Otherwise, add one second to the previous block unless // it's the genesis block in which case use the current time. var ts time.Time switch { case !blockTime.IsZero(): ts = blockTime default: ts = prevBlockTime.Add(time.Second) } extraNonce := uint64(0) coinbaseScript, err := standardCoinbaseScript(blockHeight, extraNonce) if err != nil { return nil, err } coinbaseTx, err := createCoinbaseTx(coinbaseScript, blockHeight, miningAddr, mineTo, net) if err != nil { return nil, err } // Create a new block ready to be solved. blockTxns := []*ltcutil.Tx{coinbaseTx} if inclusionTxs != nil { blockTxns = append(blockTxns, inclusionTxs...) } // We must add the witness commitment to the coinbase if any // transactions are segwit. witnessIncluded := false for i := 1; i < len(blockTxns); i++ { if blockTxns[i].MsgTx().HasWitness() { witnessIncluded = true break } } if witnessIncluded { _ = mining.AddWitnessCommitment(coinbaseTx, blockTxns) } merkles := blockchain.BuildMerkleTreeStore(blockTxns, false) var block wire.MsgBlock block.Header = wire.BlockHeader{ Version: blockVersion, PrevBlock: *prevHash, MerkleRoot: *merkles[len(merkles)-1], Timestamp: ts, Bits: net.PowLimitBits, } for _, tx := range blockTxns { if err := block.AddTransaction(tx.MsgTx()); err != nil { return nil, err } } found := solveBlock(&block.Header, net.PowLimit) if !found { return nil, errors.New("Unable to solve block") } utilBlock := ltcutil.NewBlock(&block) utilBlock.SetHeight(blockHeight) return utilBlock, nil }
use std::sync::Mutex; lazy_static! { pub static ref ERROR_MUTEX: Mutex<()> = Mutex::new(()); }
export const DEFAULTS = { API_BASE_URI: 'http://localhost:3000/axway', granularity: 'monthly', startDate: '2010-01-01', cacheExpirySeconds: 300//5 minutes }; export class Settings { /** * @param {string} setting * @returns {*} */ getSetting(setting) { return DEFAULTS[setting]; } /** * @param {string} customerNumber * @param {string} meterType * @returns {string} usageEndpoint */ getUsageEndpoint(customerNumber, meterType) { return `/v1/customers/${customerNumber}/usage/${meterType}`; } } export default new Settings;
/***************************************************************************** * lsmash.h: ***************************************************************************** * Copyright (C) 2010-2014 L-SMASH project * * Authors: Yusuke Nakamura <muken.the.vfrmaniac@gmail.com> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. *****************************************************************************/ /* This file is available under an ISC license. */ #ifndef LSMASH_H #define LSMASH_H #include <stddef.h> #include <stdint.h> #define PRIVATE /* If this declaration is placed at a variable, any user shall NOT use it. */ #define LSMASH_4CC( a, b, c, d ) (((a)<<24) | ((b)<<16) | ((c)<<8) | (d)) /**************************************************************************** * Version ****************************************************************************/ #define LSMASH_VERSION_MAJOR 2 #define LSMASH_VERSION_MINOR 5 #define LSMASH_VERSION_MICRO 5 #define LSMASH_VERSION_INT( a, b, c ) (((a) << 16) | ((b) << 8) | (c)) #define LIBLSMASH_VERSION_INT LSMASH_VERSION_INT( LSMASH_VERSION_MAJOR, \ LSMASH_VERSION_MINOR, \ LSMASH_VERSION_MICRO ) /**************************************************************************** * Error Values ****************************************************************************/ enum { LSMASH_ERR_NAMELESS = -1, /* An error but not assigned to any following errors */ LSMASH_ERR_MEMORY_ALLOC = -2, /* There is not enough room in the heap. */ LSMASH_ERR_INVALID_DATA = -3, /* Invalid data was found. */ LSMASH_ERR_FUNCTION_PARAM = -4, /* An error in the parameter list of the function */ LSMASH_ERR_PATCH_WELCOME = -5, /* Not implemented yet, so patches welcome. */ LSMASH_ERR_UNKNOWN = -6, /* Unknown error occured. */ }; /**************************************************************************** * ROOT * The top-level opaque handler for whole file handling. ****************************************************************************/ typedef struct lsmash_root_tag lsmash_root_t; /* Allocate a ROOT. * The allocated ROOT can be deallocate by lsmash_destroy_root(). * * Return the address of an allocated ROOT if successful. * Return NULL otherwise. */ lsmash_root_t *lsmash_create_root( void ); /* Deallocate a given ROOT. */ void lsmash_destroy_root ( lsmash_root_t *root /* the address of a ROOT you want to deallocate */ ); /**************************************************************************** * File Layer ****************************************************************************/ typedef struct lsmash_file_tag lsmash_file_t; typedef enum { LSMASH_FILE_MODE_WRITE = 1, /* output/muxing */ LSMASH_FILE_MODE_READ = 1<<1, /* input/demuxing */ LSMASH_FILE_MODE_FRAGMENTED = 1<<2, /* movie fragments */ LSMASH_FILE_MODE_DUMP = 1<<3, LSMASH_FILE_MODE_BOX = 1<<4, /* box structure */ LSMASH_FILE_MODE_INITIALIZATION = 1<<5, /* movie sample table */ LSMASH_FILE_MODE_MEDIA = 1<<6, /* media data */ LSMASH_FILE_MODE_INDEX = 1<<7, LSMASH_FILE_MODE_SEGMENT = 1<<8, /* segment */ LSMASH_FILE_MODE_WRITE_FRAGMENTED = LSMASH_FILE_MODE_WRITE | LSMASH_FILE_MODE_FRAGMENTED, /* deprecated */ } lsmash_file_mode; typedef enum { ISOM_BRAND_TYPE_3G2A = LSMASH_4CC( '3', 'g', '2', 'a' ), /* 3GPP2 */ ISOM_BRAND_TYPE_3GE6 = LSMASH_4CC( '3', 'g', 'e', '6' ), /* 3GPP Release 6 Extended Presentation Profile */ ISOM_BRAND_TYPE_3GE9 = LSMASH_4CC( '3', 'g', 'e', '9' ), /* 3GPP Release 9 Extended Presentation Profile */ ISOM_BRAND_TYPE_3GF9 = LSMASH_4CC( '3', 'g', 'f', '9' ), /* 3GPP Release 9 File-delivery Server Profile */ ISOM_BRAND_TYPE_3GG6 = LSMASH_4CC( '3', 'g', 'g', '6' ), /* 3GPP Release 6 General Profile */ ISOM_BRAND_TYPE_3GG9 = LSMASH_4CC( '3', 'g', 'g', '9' ), /* 3GPP Release 9 General Profile */ ISOM_BRAND_TYPE_3GH9 = LSMASH_4CC( '3', 'g', 'h', '9' ), /* 3GPP Release 9 Adaptive Streaming Profile */ ISOM_BRAND_TYPE_3GM9 = LSMASH_4CC( '3', 'g', 'm', '9' ), /* 3GPP Release 9 Media Segment Profile */ ISOM_BRAND_TYPE_3GP4 = LSMASH_4CC( '3', 'g', 'p', '4' ), /* 3GPP Release 4 */ ISOM_BRAND_TYPE_3GP5 = LSMASH_4CC( '3', 'g', 'p', '5' ), /* 3GPP Release 5 */ ISOM_BRAND_TYPE_3GP6 = LSMASH_4CC( '3', 'g', 'p', '6' ), /* 3GPP Release 6 Basic Profile */ ISOM_BRAND_TYPE_3GP7 = LSMASH_4CC( '3', 'g', 'p', '7' ), /* 3GPP Release 7 */ ISOM_BRAND_TYPE_3GP8 = LSMASH_4CC( '3', 'g', 'p', '8' ), /* 3GPP Release 8 */ ISOM_BRAND_TYPE_3GP9 = LSMASH_4CC( '3', 'g', 'p', '9' ), /* 3GPP Release 9 Basic Profile */ ISOM_BRAND_TYPE_3GR6 = LSMASH_4CC( '3', 'g', 'r', '6' ), /* 3GPP Release 6 Progressive Download Profile */ ISOM_BRAND_TYPE_3GR9 = LSMASH_4CC( '3', 'g', 'r', '9' ), /* 3GPP Release 9 Progressive Download Profile */ ISOM_BRAND_TYPE_3GS6 = LSMASH_4CC( '3', 'g', 's', '6' ), /* 3GPP Release 6 Streaming Server Profile */ ISOM_BRAND_TYPE_3GS9 = LSMASH_4CC( '3', 'g', 's', '9' ), /* 3GPP Release 9 Streaming Server Profile */ ISOM_BRAND_TYPE_3GT9 = LSMASH_4CC( '3', 'g', 't', '9' ), /* 3GPP Release 9 Media Stream Recording Profile */ ISOM_BRAND_TYPE_ARRI = LSMASH_4CC( 'A', 'R', 'R', 'I' ), /* ARRI Digital Camera */ ISOM_BRAND_TYPE_CAEP = LSMASH_4CC( 'C', 'A', 'E', 'P' ), /* Canon Digital Camera */ ISOM_BRAND_TYPE_CDES = LSMASH_4CC( 'C', 'D', 'e', 's' ), /* Convergent Designs */ ISOM_BRAND_TYPE_LCAG = LSMASH_4CC( 'L', 'C', 'A', 'G' ), /* Leica digital camera */ ISOM_BRAND_TYPE_M4A = LSMASH_4CC( 'M', '4', 'A', ' ' ), /* iTunes MPEG-4 audio protected or not */ ISOM_BRAND_TYPE_M4B = LSMASH_4CC( 'M', '4', 'B', ' ' ), /* iTunes AudioBook protected or not */ ISOM_BRAND_TYPE_M4P = LSMASH_4CC( 'M', '4', 'P', ' ' ), /* MPEG-4 protected audio */ ISOM_BRAND_TYPE_M4V = LSMASH_4CC( 'M', '4', 'V', ' ' ), /* MPEG-4 protected audio+video */ ISOM_BRAND_TYPE_MFSM = LSMASH_4CC( 'M', 'F', 'S', 'M' ), /* Media File for Samsung video Metadata */ ISOM_BRAND_TYPE_MPPI = LSMASH_4CC( 'M', 'P', 'P', 'I' ), /* Photo Player Multimedia Application Format */ ISOM_BRAND_TYPE_ROSS = LSMASH_4CC( 'R', 'O', 'S', 'S' ), /* Ross Video */ ISOM_BRAND_TYPE_AVC1 = LSMASH_4CC( 'a', 'v', 'c', '1' ), /* Advanced Video Coding extensions */ ISOM_BRAND_TYPE_BBXM = LSMASH_4CC( 'b', 'b', 'x', 'm' ), /* Blinkbox Master File */ ISOM_BRAND_TYPE_CAQV = LSMASH_4CC( 'c', 'a', 'q', 'v' ), /* Casio Digital Camera */ ISOM_BRAND_TYPE_CCFF = LSMASH_4CC( 'c', 'c', 'f', 'f' ), /* Common container file format */ ISOM_BRAND_TYPE_DA0A = LSMASH_4CC( 'd', 'a', '0', 'a' ), /* DMB AF */ ISOM_BRAND_TYPE_DA0B = LSMASH_4CC( 'd', 'a', '0', 'b' ), /* DMB AF */ ISOM_BRAND_TYPE_DA1A = LSMASH_4CC( 'd', 'a', '1', 'a' ), /* DMB AF */ ISOM_BRAND_TYPE_DA1B = LSMASH_4CC( 'd', 'a', '1', 'b' ), /* DMB AF */ ISOM_BRAND_TYPE_DA2A = LSMASH_4CC( 'd', 'a', '2', 'a' ), /* DMB AF */ ISOM_BRAND_TYPE_DA2B = LSMASH_4CC( 'd', 'a', '2', 'b' ), /* DMB AF */ ISOM_BRAND_TYPE_DA3A = LSMASH_4CC( 'd', 'a', '3', 'a' ), /* DMB AF */ ISOM_BRAND_TYPE_DA3B = LSMASH_4CC( 'd', 'a', '3', 'b' ), /* DMB AF */ ISOM_BRAND_TYPE_DASH = LSMASH_4CC( 'd', 'a', 's', 'h' ), /* Indexed self-initializing Media Segment */ ISOM_BRAND_TYPE_DBY1 = LSMASH_4CC( 'd', 'b', 'y', '1' ), /* MP4 files with Dolby content */ ISOM_BRAND_TYPE_DMB1 = LSMASH_4CC( 'd', 'm', 'b', '1' ), /* DMB AF */ ISOM_BRAND_TYPE_DSMS = LSMASH_4CC( 'd', 's', 'm', 's' ), /* Self-initializing Media Segment */ ISOM_BRAND_TYPE_DV1A = LSMASH_4CC( 'd', 'v', '1', 'a' ), /* DMB AF */ ISOM_BRAND_TYPE_DV1B = LSMASH_4CC( 'd', 'v', '1', 'b' ), /* DMB AF */ ISOM_BRAND_TYPE_DV2A = LSMASH_4CC( 'd', 'v', '2', 'a' ), /* DMB AF */ ISOM_BRAND_TYPE_DV2B = LSMASH_4CC( 'd', 'v', '2', 'b' ), /* DMB AF */ ISOM_BRAND_TYPE_DV3A = LSMASH_4CC( 'd', 'v', '3', 'a' ), /* DMB AF */ ISOM_BRAND_TYPE_DV3B = LSMASH_4CC( 'd', 'v', '3', 'b' ), /* DMB AF */ ISOM_BRAND_TYPE_DVR1 = LSMASH_4CC( 'd', 'v', 'r', '1' ), /* DVB RTP */ ISOM_BRAND_TYPE_DVT1 = LSMASH_4CC( 'd', 'v', 't', '1' ), /* DVB Transport Stream */ ISOM_BRAND_TYPE_IFRM = LSMASH_4CC( 'i', 'f', 'r', 'm' ), /* Apple iFrame */ ISOM_BRAND_TYPE_ISC2 = LSMASH_4CC( 'i', 's', 'c', '2' ), /* Files encrypted according to ISMACryp 2.0 */ ISOM_BRAND_TYPE_ISO2 = LSMASH_4CC( 'i', 's', 'o', '2' ), /* ISO Base Media file format version 2 */ ISOM_BRAND_TYPE_ISO3 = LSMASH_4CC( 'i', 's', 'o', '3' ), /* ISO Base Media file format version 3 */ ISOM_BRAND_TYPE_ISO4 = LSMASH_4CC( 'i', 's', 'o', '4' ), /* ISO Base Media file format version 4 */ ISOM_BRAND_TYPE_ISO5 = LSMASH_4CC( 'i', 's', 'o', '5' ), /* ISO Base Media file format version 5 */ ISOM_BRAND_TYPE_ISO6 = LSMASH_4CC( 'i', 's', 'o', '6' ), /* ISO Base Media file format version 6 */ ISOM_BRAND_TYPE_ISO7 = LSMASH_4CC( 'i', 's', 'o', '7' ), /* ISO Base Media file format version 7 */ ISOM_BRAND_TYPE_ISOM = LSMASH_4CC( 'i', 's', 'o', 'm' ), /* ISO Base Media file format version 1 */ ISOM_BRAND_TYPE_JPSI = LSMASH_4CC( 'j', 'p', 's', 'i' ), /* The JPSearch data interchange format */ ISOM_BRAND_TYPE_LMSG = LSMASH_4CC( 'l', 'm', 's', 'g' ), /* last Media Segment indicator */ ISOM_BRAND_TYPE_MJ2S = LSMASH_4CC( 'm', 'j', '2', 's' ), /* Motion JPEG 2000 simple profile */ ISOM_BRAND_TYPE_MJP2 = LSMASH_4CC( 'm', 'j', 'p', '2' ), /* Motion JPEG 2000, general profile */ ISOM_BRAND_TYPE_MP21 = LSMASH_4CC( 'm', 'p', '2', '1' ), /* MPEG-21 */ ISOM_BRAND_TYPE_MP41 = LSMASH_4CC( 'm', 'p', '4', '1' ), /* MP4 version 1 */ ISOM_BRAND_TYPE_MP42 = LSMASH_4CC( 'm', 'p', '4', '2' ), /* MP4 version 2 */ ISOM_BRAND_TYPE_MP71 = LSMASH_4CC( 'm', 'p', '7', '1' ), /* MPEG-7 file-level metadata */ ISOM_BRAND_TYPE_MSDH = LSMASH_4CC( 'm', 's', 'd', 'h' ), /* Media Segment */ ISOM_BRAND_TYPE_MSIX = LSMASH_4CC( 'm', 's', 'i', 'x' ), /* Indexed Media Segment */ ISOM_BRAND_TYPE_NIKO = LSMASH_4CC( 'n', 'i', 'k', 'o' ), /* Nikon Digital Camera */ ISOM_BRAND_TYPE_ODCF = LSMASH_4CC( 'o', 'd', 'c', 'f' ), /* OMA DCF */ ISOM_BRAND_TYPE_OPF2 = LSMASH_4CC( 'o', 'p', 'f', '2' ), /* OMA PDCF */ ISOM_BRAND_TYPE_OPX2 = LSMASH_4CC( 'o', 'p', 'x', '2' ), /* OMA Adapted PDCF */ ISOM_BRAND_TYPE_PANA = LSMASH_4CC( 'p', 'a', 'n', 'a' ), /* Panasonic Digital Camera */ ISOM_BRAND_TYPE_PIFF = LSMASH_4CC( 'p', 'i', 'f', 'f' ), /* Protected Interoperable File Format */ ISOM_BRAND_TYPE_PNVI = LSMASH_4CC( 'p', 'n', 'v', 'i' ), /* Panasonic Video Intercom */ ISOM_BRAND_TYPE_QT = LSMASH_4CC( 'q', 't', ' ', ' ' ), /* QuickTime file format */ ISOM_BRAND_TYPE_RISX = LSMASH_4CC( 'r', 'i', 's', 'x' ), /* Representation Index Segment */ ISOM_BRAND_TYPE_SDV = LSMASH_4CC( 's', 'd', 'v', ' ' ), /* SD Video */ ISOM_BRAND_TYPE_SIMS = LSMASH_4CC( 's', 'i', 'm', 's' ), /* Sub-Indexed Media Segment */ ISOM_BRAND_TYPE_SISX = LSMASH_4CC( 's', 'i', 's', 'x' ), /* Single Index Segment */ ISOM_BRAND_TYPE_SSSS = LSMASH_4CC( 's', 's', 's', 's' ), /* Subsegment Index Segment */ } lsmash_brand_type; typedef struct { lsmash_file_mode mode; /* file modes */ /** custom I/O stuff **/ void *opaque; /* custom I/O opaque handler used for the following callback functions */ /* Attempt to read up to 'size' bytes from the file referenced by 'opaque' into the buffer starting at 'buf'. * * Return the number of bytes read if successful. * Return 0 if no more read. * Return a negative value otherwise. */ int (*read) ( void *opaque, uint8_t *buf, int size ); /* Write up to 'size' bytes to the file referenced by 'opaque' from the buffer starting at 'buf'. * * Return the number of bytes written if successful. * Return a negative value otherwise. */ int (*write) ( void *opaque, uint8_t *buf, int size ); /* Change the location of the read/write pointer of 'opaque'. * The offset of the pointer is determined according to the directive 'whence' as follows: * If 'whence' is set to SEEK_SET, the offset is set to 'offset' bytes. * If 'whence' is set to SEEK_CUR, the offset is set to its current location plus 'offset' bytes. * If 'whence' is set to SEEK_END, the offset is set to the size of the file plus 'offset' bytes. * * Return the resulting offset of the location in bytes from the beginning of the file if successful. * Return a negative value otherwise. */ int64_t (*seek) ( void *opaque, int64_t offset, int whence ); /** file types or segment types **/ lsmash_brand_type major_brand; /* the best used brand */ lsmash_brand_type *brands; /* the list of compatible brands */ uint32_t brand_count; /* the number of compatible brands used in the file */ uint32_t minor_version; /* minor version of the best used brand * minor_version is informative only i.e. not specifying requirements but merely providing information. * It must not be used to determine the conformance of a file to a standard. */ /** muxing only **/ double max_chunk_duration; /* max duration per chunk in seconds. 0.5 is default value. */ double max_async_tolerance; /* max tolerance, in seconds, for amount of interleaving asynchronization between tracks. * 2.0 is default value. At least twice of max_chunk_duration is used. */ uint64_t max_chunk_size; /* max size per chunk in bytes. 4*1024*1024 (4MiB) is default value. */ /** demuxing only **/ uint64_t max_read_size; /* max size of reading from the file at a time. 4*1024*1024 (4MiB) is default value. */ } lsmash_file_parameters_t; typedef int (*lsmash_adhoc_remux_callback)( void *param, uint64_t done, uint64_t total ); typedef struct { uint64_t buffer_size; lsmash_adhoc_remux_callback func; void *param; } lsmash_adhoc_remux_t; /* Open a file where the path is given. * And if successful, set up the parameters by 'open_mode'. * Here, the 'open_mode' parameter is either 0 or 1 as follows: * 0: Create a file for output/muxing operations. * If a file with the same name already exists, its contents are discarded and the file is treated as a new file. * If user specifies "-" for 'filename', operations are done on stdout. * The file types or segment types are set up as specified in 'param'. * 1: Open a file for input/demuxing operations. The file must exist. * If user specifies "-" for 'filename', operations are done on stdin. * * This function sets up file modes minimally. * User can add additional modes and/or remove modes already set later. * The other parameters except for the custom I/O stuff are set to a default. * User shall not touch the custom I/O stuff for the opened file if using this function. * * The opened file can be closed by lsmash_close_file(). * * Note: * 'filename' must be encoded by UTF-8 if 'open_mode' is equal to 0. * On Windows, lsmash_convert_ansi_to_utf8() may help you. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_open_file ( const char *filename, int open_mode, lsmash_file_parameters_t *param ); /* Close a file opened by lsmash_open_file(). * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_close_file ( lsmash_file_parameters_t *param ); /* Associate a file with a ROOT and allocate the handle of that file. * The all allocated handles can be deallocated by lsmash_destroy_root(). * If the ROOT has no associated file yet, the first associated file is activated. * * Return the address of the allocated handle of the added file if successful. * Return NULL otherwise. */ lsmash_file_t *lsmash_set_file ( lsmash_root_t *root, lsmash_file_parameters_t *param ); /* Read whole boxes in a given file. * You can also get file modes and file types or segment types by this function. * * Return the file size (if seekable) or 0 if successful. * Return a negative value otherwise. */ int64_t lsmash_read_file ( lsmash_file_t *file, lsmash_file_parameters_t *param ); /* Deallocate all boxes within the current active file in a given ROOT. */ void lsmash_discard_boxes ( lsmash_root_t *root /* the address of a ROOT you want to deallocate all boxes within the active file in it */ ); /* Activate a file associated with a ROOT. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_activate_file ( lsmash_root_t *root, lsmash_file_t *file ); /* Switch from the current segment file to the following media segment file. * After switching, the followed segment file can be closed unless that file is an initialization segment. * * The first followed segment file must be also an initialization segment. * The second or later segment files must not be an initialization segment. * For media segment files flagging LSMASH_FILE_MODE_INDEX, 'remux' must be set. * * Users shall call lsmash_flush_pooled_samples() for each track before calling this function. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_switch_media_segment ( lsmash_root_t *root, lsmash_file_t *successor, lsmash_adhoc_remux_t *remux ); /**************************************************************************** * Basic Types ****************************************************************************/ /* rational types */ typedef struct { uint32_t n; /* numerator */ uint32_t d; /* denominator */ } lsmash_rational_u32_t; typedef struct { int32_t n; /* numerator */ uint32_t d; /* denominator */ } lsmash_rational_s32_t; typedef enum { LSMASH_BOOLEAN_FALSE = 0, LSMASH_BOOLEAN_TRUE = 1 } lsmash_boolean_t; /**************************************************************************** * Allocation ****************************************************************************/ /* Allocate a memory block. * The allocated memory block can be deallocate by lsmash_free(). * * Return the address to the beginning of a memory block if successful. * Return NULL otherwise. */ void *lsmash_malloc ( size_t size /* size of a memory block, in bytes */ ); /* Allocate a memory block. * The allocated memory block shall be initialized to all bits 0. * The allocated memory block can be deallocate by lsmash_free(). * * Return the address to the beginning of a memory block if successful. * Return NULL otherwise. */ void *lsmash_malloc_zero ( size_t size /* size of a memory block, in bytes */ ); /* Reallocate a memory block. * The reallocated memory block can be deallocate by lsmash_free(). * If this function succeed, the given memory block is deallocated and the address is invalid. * If this function fails, the address to the given memory block is still valid and the memory block is unchanged. * * Return the address to the beginning of a memory block if successful. * Return NULL otherwise. */ void *lsmash_realloc ( void *ptr, /* an address to a memory block previously allocated with * lsmash_malloc(), lsmash_malloc_zero(), lsmash_realloc() or lsmash_memdup() * Alternatively, NULL makes this function to allocate a new memory block. */ size_t size /* size of a memory block, in bytes */ ); /* Allocate a memory block and copy all bits from a given memory block. * The allocated memory block can be deallocate by lsmash_free(). * * Return the address to the beginning of an allocated memory block if successful. * Return NULL otherwise. */ void *lsmash_memdup ( const void *ptr, /* an address to the source of data to be copied */ size_t size /* number of bytes to copy */ ); /* Deallocate a given memory block. * If the given address to a memory block is NULL, this function does nothing. */ void lsmash_free ( void *ptr /* an address to a memory block previously allocated with * lsmash_malloc(), lsmash_malloc_zero(), lsmash_realloc() or lsmash_memdup() */ ); /* Deallocate a given memory block. * If the given address to a memory block is NULL, this function does nothing. * Set NULL to the pointer to the memory block after deallocating. * * As an example of usage. * Let's say you allocate a memory block and set the address to the beginning of it to the pointer 'ptr'. * You can deallocate the memory block and set NULL to 'ptr' by lsmash_freep( &ptr ). */ void lsmash_freep ( void *ptrptr /* the address to a pointer to a memory block previously allocated with * lsmash_malloc(), lsmash_malloc_zero(), lsmash_realloc() or lsmash_memdup() */ ); /**************************************************************************** * Box ****************************************************************************/ typedef struct lsmash_box_tag lsmash_box_t; typedef uint32_t lsmash_compact_box_type_t; /* An UUID structure for extended box type */ typedef struct { uint32_t fourcc; /* four characters codes that identify extended box type partially * If the box is not a UUID box, this field shall be the same as the box type. * Note: characters in this field aren't always printable. */ uint8_t id[12]; /* If the box is not a UUID box, this field shall be set to 12-byte ISO reserved value * { 0x00, 0x11, 0x00, 0x10, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 } * and shall not be written into the stream together with above-defined four characters codes. * As an exception, we could set the value * { 0x0F, 0x11, 0x4D, 0xA5, 0xBF, 0x4E, 0xF2, 0xC4, 0x8C, 0x6A, 0xA1, 0x1E } * to indicate the box is derived from QuickTime file format. */ } lsmash_extended_box_type_t; typedef struct { lsmash_compact_box_type_t fourcc; /* four characters codes that identify box type * Note: characters in this field aren't always printable. */ lsmash_extended_box_type_t user; /* Universal Unique IDentifier, i.e. UUID */ /* If 'fourcc' doesn't equal 'uuid', ignore this field. */ } lsmash_box_type_t; typedef struct { lsmash_box_type_t type; /* box type */ uint32_t number; /* the number of box in ascending order excluding boxes unspecified by 'type' within * the same level of the box nested structure. */ } lsmash_box_path_t; #define LSMASH_BOX_TYPE_INITIALIZER { 0x00000000, { 0x00000000, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } } #define LSMASH_BOX_TYPE_UNSPECIFIED static_lsmash_box_type_unspecified extern const lsmash_box_type_t static_lsmash_box_type_unspecified; /* Return extended box type that consists of combination of given FourCC and 12-byte ID. */ lsmash_extended_box_type_t lsmash_form_extended_box_type ( uint32_t fourcc, const uint8_t id[12] ); /* Return box type that consists of combination of given compact and extended box type. */ lsmash_box_type_t lsmash_form_box_type ( lsmash_compact_box_type_t type, lsmash_extended_box_type_t user ); #define LSMASH_ISO_BOX_TYPE_INITIALIZER( x ) { x, { x, { 0x00, 0x11, 0x00, 0x10, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 } } } #define LSMASH_QTFF_BOX_TYPE_INITIALIZER( x ) { x, { x, { 0x0F, 0x11, 0x4D, 0xA5, 0xBF, 0x4E, 0xF2, 0xC4, 0x8C, 0x6A, 0xA1, 0x1E } } } lsmash_box_type_t lsmash_form_iso_box_type( lsmash_compact_box_type_t type ); lsmash_box_type_t lsmash_form_qtff_box_type( lsmash_compact_box_type_t type ); /* precedence of the box position * Box with higher value will precede physically other boxes with lower one. * The lower 32-bits are intended to determine order of boxes with the same box type. */ #define LSMASH_BOX_PRECEDENCE_L 0x0000000000800000ULL /* Lowest */ #define LSMASH_BOX_PRECEDENCE_LP 0x000FFFFF00000000ULL /* Lowest+ */ #define LSMASH_BOX_PRECEDENCE_N 0x0080000000000000ULL /* Normal */ #define LSMASH_BOX_PRECEDENCE_HM 0xFFEEEEEE00000000ULL /* Highest- */ #define LSMASH_BOX_PRECEDENCE_H 0xFFFFFFFF00800000ULL /* Highest */ #define LSMASH_BOX_PRECEDENCE_S 0x0000010000000000ULL /* Step */ /* Check if the type of two boxes is identical or not. * * Return 1 if the both box types are identical. * Return 0 otherwise. */ int lsmash_check_box_type_identical ( lsmash_box_type_t a, lsmash_box_type_t b ); /* Check if the type of a given box is already specified or not. * * Return 1 if the box type is specified. * Return 0 otherwise, i.e. LSMASH_BOX_TYPE_UNSPECIFIED. */ int lsmash_check_box_type_specified ( const lsmash_box_type_t *box_type ); /* Allocate a box. * The allocated box can be deallocated by lsmash_destroy_box(). * * Return the address of an allocated box if successful. * Return NULL otherwise. */ lsmash_box_t *lsmash_create_box ( lsmash_box_type_t type, uint8_t *data, uint32_t size, uint64_t precedence ); /* Get a box under a given 'parent' box. * The path of a box must be terminated by LSMASH_BOX_TYPE_UNSPECIFIED. * * Return the address of the box specified by 'box_path'. * Return NULL otherwise. */ lsmash_box_t *lsmash_get_box ( lsmash_box_t *parent, const lsmash_box_path_t box_path[] ); /* Add a box into 'parent' box as a child box. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_add_box ( lsmash_box_t *parent, lsmash_box_t *box ); /* Add a box into 'parent' box as a child box. * If the adding child box is known and its children (if any) are known, expand them into known * struct formats for the internal references within the L-SMASH library. * If this function succeed, the adding child box is deallocated and the address is invalid. * Instead of that, this function replaces the invalid address with the valid one of the new * allocated memory block representing the added and expanded child box. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_add_box_ex ( lsmash_box_t *parent, lsmash_box_t **box ); /* Deallocate a given box and its children. */ void lsmash_destroy_box ( lsmash_box_t *box ); /* Deallocate all children of a given box. */ void lsmash_destroy_children ( lsmash_box_t *box ); /* Get the precedence of a given box. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_get_box_precedence ( lsmash_box_t *box, uint64_t *precedence ); /* This function allows you to handle a ROOT as if it is a box. * Of course, you can deallocate the ROOT by lsmash_destroy_box(). * * Return the address of a given ROOT as a box. */ lsmash_box_t *lsmash_root_as_box ( lsmash_root_t *root ); /* This function allows you to handle the handle of a file as if it is a box. * Of course, you can deallocate the handle of the file by lsmash_destroy_box(). * * Return the address of the handle of a given file as a box. */ lsmash_box_t *lsmash_file_as_box ( lsmash_file_t *file ); /* Write a top level box and its children already added to a file. * WARNING: * You should not use this function as long as media data is incompletely written. * That is before starting to write a media data or after finishing of writing that. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_write_top_level_box ( lsmash_box_t *box ); /* Export the data of a given box and its children as the binary string. * The returned address is of the beginning of an allocated memory block. * You can deallocate the memory block by lsmash_free(). * * Note that some boxes cannot be exported since L-SMASH might skip the cache for them. * Media Data Box is an unexportable example. * * Return the address to the beginning of the binary string if successful. * Return NULL otherwise. */ uint8_t *lsmash_export_box ( lsmash_box_t *box, uint32_t *size ); /**************************************************************************** * CODEC identifiers ****************************************************************************/ typedef lsmash_box_type_t lsmash_codec_type_t; #define LSMASH_CODEC_TYPE_INITIALIZER LSMASH_BOX_TYPE_INITIALIZER #define LSMASH_CODEC_TYPE_UNSPECIFIED LSMASH_BOX_TYPE_UNSPECIFIED #ifndef LSMASH_INITIALIZE_CODEC_ID_HERE #define DEFINE_ISOM_CODEC_TYPE( BOX_TYPE_NAME, BOX_TYPE_FOURCC ) \ extern const lsmash_codec_type_t BOX_TYPE_NAME #define DEFINE_QTFF_CODEC_TYPE( BOX_TYPE_NAME, BOX_TYPE_FOURCC ) \ extern const lsmash_codec_type_t BOX_TYPE_NAME #else #define DEFINE_ISOM_CODEC_TYPE( BOX_TYPE_NAME, BOX_TYPE_FOURCC ) \ const lsmash_codec_type_t BOX_TYPE_NAME = LSMASH_ISO_BOX_TYPE_INITIALIZER( BOX_TYPE_FOURCC ) #define DEFINE_QTFF_CODEC_TYPE( BOX_TYPE_NAME, BOX_TYPE_FOURCC ) \ const lsmash_codec_type_t BOX_TYPE_NAME = LSMASH_QTFF_BOX_TYPE_INITIALIZER( BOX_TYPE_FOURCC ) #endif /* Audio CODEC identifiers */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_AC_3_AUDIO, LSMASH_4CC( 'a', 'c', '-', '3' ) ); /* AC-3 audio */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_ALAC_AUDIO, LSMASH_4CC( 'a', 'l', 'a', 'c' ) ); /* Apple lossless audio codec */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_DRA1_AUDIO, LSMASH_4CC( 'd', 'r', 'a', '1' ) ); /* DRA Audio */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_DTSC_AUDIO, LSMASH_4CC( 'd', 't', 's', 'c' ) ); /* DTS Coherent Acoustics audio */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_DTSH_AUDIO, LSMASH_4CC( 'd', 't', 's', 'h' ) ); /* DTS-HD High Resolution Audio */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_DTSL_AUDIO, LSMASH_4CC( 'd', 't', 's', 'l' ) ); /* DTS-HD Master Audio */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_DTSE_AUDIO, LSMASH_4CC( 'd', 't', 's', 'e' ) ); /* DTS Express low bit rate audio, also known as DTS LBR */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_EC_3_AUDIO, LSMASH_4CC( 'e', 'c', '-', '3' ) ); /* Enhanced AC-3 audio */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_ENCA_AUDIO, LSMASH_4CC( 'e', 'n', 'c', 'a' ) ); /* Encrypted/Protected audio */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_G719_AUDIO, LSMASH_4CC( 'g', '7', '1', '9' ) ); /* ITU-T Recommendation G.719 (2008) ); */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_G726_AUDIO, LSMASH_4CC( 'g', '7', '2', '6' ) ); /* ITU-T Recommendation G.726 (1990) ); */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_M4AE_AUDIO, LSMASH_4CC( 'm', '4', 'a', 'e' ) ); /* MPEG-4 Audio Enhancement */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_MLPA_AUDIO, LSMASH_4CC( 'm', 'l', 'p', 'a' ) ); /* MLP Audio */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_MP4A_AUDIO, LSMASH_4CC( 'm', 'p', '4', 'a' ) ); /* MPEG-4 Audio */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_RAW_AUDIO, LSMASH_4CC( 'r', 'a', 'w', ' ' ) ); /* Uncompressed audio */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_SAMR_AUDIO, LSMASH_4CC( 's', 'a', 'm', 'r' ) ); /* Narrowband AMR voice */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_SAWB_AUDIO, LSMASH_4CC( 's', 'a', 'w', 'b' ) ); /* Wideband AMR voice */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_SAWP_AUDIO, LSMASH_4CC( 's', 'a', 'w', 'p' ) ); /* Extended AMR-WB (AMR-WB+) ); */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_SEVC_AUDIO, LSMASH_4CC( 's', 'e', 'v', 'c' ) ); /* EVRC Voice */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_SQCP_AUDIO, LSMASH_4CC( 's', 'q', 'c', 'p' ) ); /* 13K Voice */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_SSMV_AUDIO, LSMASH_4CC( 's', 's', 'm', 'v' ) ); /* SMV Voice */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_TWOS_AUDIO, LSMASH_4CC( 't', 'w', 'o', 's' ) ); /* Uncompressed 16-bit audio */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_WMA_AUDIO, LSMASH_4CC( 'w', 'm', 'a', ' ' ) ); /* Windows Media Audio V2 or V3 (not registered at MP4RA) */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_23NI_AUDIO, LSMASH_4CC( '2', '3', 'n', 'i' ) ); /* 32-bit little endian integer uncompressed */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_MAC3_AUDIO, LSMASH_4CC( 'M', 'A', 'C', '3' ) ); /* MACE 3:1 */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_MAC6_AUDIO, LSMASH_4CC( 'M', 'A', 'C', '6' ) ); /* MACE 6:1 */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_NONE_AUDIO, LSMASH_4CC( 'N', 'O', 'N', 'E' ) ); /* either 'raw ' or 'twos' */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_QDM2_AUDIO, LSMASH_4CC( 'Q', 'D', 'M', '2' ) ); /* Qdesign music 2 */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_QDMC_AUDIO, LSMASH_4CC( 'Q', 'D', 'M', 'C' ) ); /* Qdesign music 1 */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_QCLP_AUDIO, LSMASH_4CC( 'Q', 'c', 'l', 'p' ) ); /* Qualcomm PureVoice */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_AC_3_AUDIO, LSMASH_4CC( 'a', 'c', '-', '3' ) ); /* Digital Audio Compression Standard (AC-3, Enhanced AC-3) */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_AGSM_AUDIO, LSMASH_4CC( 'a', 'g', 's', 'm' ) ); /* GSM */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_ALAC_AUDIO, LSMASH_4CC( 'a', 'l', 'a', 'c' ) ); /* Apple lossless audio codec */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_ALAW_AUDIO, LSMASH_4CC( 'a', 'l', 'a', 'w' ) ); /* a-Law 2:1 */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_CDX2_AUDIO, LSMASH_4CC( 'c', 'd', 'x', '2' ) ); /* CD/XA 2:1 */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_CDX4_AUDIO, LSMASH_4CC( 'c', 'd', 'x', '4' ) ); /* CD/XA 4:1 */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_DVCA_AUDIO, LSMASH_4CC( 'd', 'v', 'c', 'a' ) ); /* DV Audio */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_DVI_AUDIO, LSMASH_4CC( 'd', 'v', 'i', ' ' ) ); /* DVI (as used in RTP, 4:1 compression) */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_FL32_AUDIO, LSMASH_4CC( 'f', 'l', '3', '2' ) ); /* 32-bit float */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_FL64_AUDIO, LSMASH_4CC( 'f', 'l', '6', '4' ) ); /* 64-bit float */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_IMA4_AUDIO, LSMASH_4CC( 'i', 'm', 'a', '4' ) ); /* IMA (International Multimedia Assocation, defunct, 4:1) */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_IN24_AUDIO, LSMASH_4CC( 'i', 'n', '2', '4' ) ); /* 24-bit integer uncompressed */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_IN32_AUDIO, LSMASH_4CC( 'i', 'n', '3', '2' ) ); /* 32-bit integer uncompressed */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_LPCM_AUDIO, LSMASH_4CC( 'l', 'p', 'c', 'm' ) ); /* Uncompressed audio (various integer and float formats) */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_MP4A_AUDIO, LSMASH_4CC( 'm', 'p', '4', 'a' ) ); /* MPEG-4 Audio */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_RAW_AUDIO, LSMASH_4CC( 'r', 'a', 'w', ' ' ) ); /* 8-bit offset-binary uncompressed */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_SOWT_AUDIO, LSMASH_4CC( 's', 'o', 'w', 't' ) ); /* 16-bit little endian uncompressed */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_TWOS_AUDIO, LSMASH_4CC( 't', 'w', 'o', 's' ) ); /* 8-bit or 16-bit big endian uncompressed */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_ULAW_AUDIO, LSMASH_4CC( 'u', 'l', 'a', 'w' ) ); /* uLaw 2:1 */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_VDVA_AUDIO, LSMASH_4CC( 'v', 'd', 'v', 'a' ) ); /* DV audio (variable duration per video frame) */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_FULLMP3_AUDIO, LSMASH_4CC( '.', 'm', 'p', '3' ) ); /* MPEG-1 layer 3, CBR & VBR (QT4.1 and later) */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_MP3_AUDIO, 0x6D730055 ); /* MPEG-1 layer 3, CBR only (pre-QT4.1) */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_ADPCM2_AUDIO, 0x6D730002 ); /* Microsoft ADPCM - ACM code 2 */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_ADPCM17_AUDIO, 0x6D730011 ); /* DVI/Intel IMA ADPCM - ACM code 17 */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_GSM49_AUDIO, 0x6D730031 ); /* Microsoft GSM 6.10 - ACM code 49 */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_NOT_SPECIFIED, 0x00000000 ); /* either 'raw ' or 'twos' */ /* Video CODEC identifiers */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_AVC1_VIDEO, LSMASH_4CC( 'a', 'v', 'c', '1' ) ); /* Advanced Video Coding * Any sample must not contain any paramerter set and filler data. */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_AVC2_VIDEO, LSMASH_4CC( 'a', 'v', 'c', '2' ) ); /* Advanced Video Coding * Any sample must not contain any paramerter set and filler data. * May only be used when Extractors or Aggregators are required to be supported. */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_AVC3_VIDEO, LSMASH_4CC( 'a', 'v', 'c', '3' ) ); /* Advanced Video Coding * It is allowed that sample contains parameter sets and filler data. */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_AVC4_VIDEO, LSMASH_4CC( 'a', 'v', 'c', '4' ) ); /* Advanced Video Coding * It is allowed that sample contains parameter sets and filler data. * May only be used when Extractors or Aggregators are required to be supported. */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_AVCP_VIDEO, LSMASH_4CC( 'a', 'v', 'c', 'p' ) ); /* Advanced Video Coding Parameters */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_DRAC_VIDEO, LSMASH_4CC( 'd', 'r', 'a', 'c' ) ); /* Dirac Video Coder */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_ENCV_VIDEO, LSMASH_4CC( 'e', 'n', 'c', 'v' ) ); /* Encrypted/protected video */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_HVC1_VIDEO, LSMASH_4CC( 'h', 'v', 'c', '1' ) ); /* High Efficiency Video Coding * The default and mandatory value of array_completeness is 1 for arrays of * all types of parameter sets, and 0 for all other arrays. * This means any sample must not contain any paramerter set and filler data. */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_HEV1_VIDEO, LSMASH_4CC( 'h', 'e', 'v', '1' ) ); /* High Efficiency Video Coding * The default value of array_completeness is 0 for all arrays. * It is allowed that sample contains parameter sets and filler data. */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_MJP2_VIDEO, LSMASH_4CC( 'm', 'j', 'p', '2' ) ); /* Motion JPEG 2000 */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_MP4V_VIDEO, LSMASH_4CC( 'm', 'p', '4', 'v' ) ); /* MPEG-4 Visual */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_MVC1_VIDEO, LSMASH_4CC( 'm', 'v', 'c', '1' ) ); /* Multiview coding */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_MVC2_VIDEO, LSMASH_4CC( 'm', 'v', 'c', '2' ) ); /* Multiview coding */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_S263_VIDEO, LSMASH_4CC( 's', '2', '6', '3' ) ); /* ITU H.263 video (3GPP format) */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_SVC1_VIDEO, LSMASH_4CC( 's', 'v', 'c', '1' ) ); /* Scalable Video Coding */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_VC_1_VIDEO, LSMASH_4CC( 'v', 'c', '-', '1' ) ); /* SMPTE VC-1 */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_2VUY_VIDEO, LSMASH_4CC( '2', 'v', 'u', 'y' ) ); /* Uncompressed Y'CbCr, 8-bit-per-component 4:2:2 * |Cb(8)|Y'0(8)|Cr(8)|Y'1(8)| */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_CFHD_VIDEO, LSMASH_4CC( 'C', 'F', 'H', 'D' ) ); /* CineForm High-Definition (HD) wavelet codec */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_DV10_VIDEO, LSMASH_4CC( 'D', 'V', '1', '0' ) ); /* Digital Voodoo 10 bit Uncompressed 4:2:2 codec */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_DVOO_VIDEO, LSMASH_4CC( 'D', 'V', 'O', 'O' ) ); /* Digital Voodoo 8 bit Uncompressed 4:2:2 codec */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_DVOR_VIDEO, LSMASH_4CC( 'D', 'V', 'O', 'R' ) ); /* Digital Voodoo intermediate raw */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_DVTV_VIDEO, LSMASH_4CC( 'D', 'V', 'T', 'V' ) ); /* Digital Voodoo intermediate 2vuy */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_DVVT_VIDEO, LSMASH_4CC( 'D', 'V', 'V', 'T' ) ); /* Digital Voodoo intermediate v210 */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_HD10_VIDEO, LSMASH_4CC( 'H', 'D', '1', '0' ) ); /* Digital Voodoo 10 bit Uncompressed 4:2:2 HD codec */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_M105_VIDEO, LSMASH_4CC( 'M', '1', '0', '5' ) ); /* Internal format of video data supported by Matrox hardware; pixel organization is proprietary*/ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_PNTG_VIDEO, LSMASH_4CC( 'P', 'N', 'T', 'G' ) ); /* Apple MacPaint image format */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_SVQ1_VIDEO, LSMASH_4CC( 'S', 'V', 'Q', '1' ) ); /* Sorenson Video 1 video */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_SVQ3_VIDEO, LSMASH_4CC( 'S', 'V', 'Q', '3' ) ); /* Sorenson Video 3 video */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_SHR0_VIDEO, LSMASH_4CC( 'S', 'h', 'r', '0' ) ); /* Generic SheerVideo codec */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_SHR1_VIDEO, LSMASH_4CC( 'S', 'h', 'r', '1' ) ); /* SheerVideo RGB[A] 8b - at 8 bits/channel */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_SHR2_VIDEO, LSMASH_4CC( 'S', 'h', 'r', '2' ) ); /* SheerVideo Y'CbCr[A] 8bv 4:4:4[:4] - at 8 bits/channel, in ITU-R BT.601-4 video range */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_SHR3_VIDEO, LSMASH_4CC( 'S', 'h', 'r', '3' ) ); /* SheerVideo Y'CbCr 8bv 4:2:2 - 2:1 chroma subsampling, at 8 bits/channel, in ITU-R BT.601-4 video range */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_SHR4_VIDEO, LSMASH_4CC( 'S', 'h', 'r', '4' ) ); /* SheerVideo Y'CbCr 8bw 4:2:2 - 2:1 chroma subsampling, at 8 bits/channel, with full-range luma and wide-range two's-complement chroma */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_WRLE_VIDEO, LSMASH_4CC( 'W', 'R', 'L', 'E' ) ); /* Windows BMP image format */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_APCH_VIDEO, LSMASH_4CC( 'a', 'p', 'c', 'h' ) ); /* Apple ProRes 422 High Quality */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_APCN_VIDEO, LSMASH_4CC( 'a', 'p', 'c', 'n' ) ); /* Apple ProRes 422 Standard Definition */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_APCS_VIDEO, LSMASH_4CC( 'a', 'p', 'c', 's' ) ); /* Apple ProRes 422 LT */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_APCO_VIDEO, LSMASH_4CC( 'a', 'p', 'c', 'o' ) ); /* Apple ProRes 422 Proxy */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_AP4H_VIDEO, LSMASH_4CC( 'a', 'p', '4', 'h' ) ); /* Apple ProRes 4444 */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_CIVD_VIDEO, LSMASH_4CC( 'c', 'i', 'v', 'd' ) ); /* Cinepak Video */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_DRAC_VIDEO, LSMASH_4CC( 'd', 'r', 'a', 'c' ) ); /* Dirac Video Coder */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_DVC_VIDEO, LSMASH_4CC( 'd', 'v', 'c', ' ' ) ); /* DV NTSC format */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_DVCP_VIDEO, LSMASH_4CC( 'd', 'v', 'c', 'p' ) ); /* DV PAL format */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_DVPP_VIDEO, LSMASH_4CC( 'd', 'v', 'p', 'p' ) ); /* Panasonic DVCPro PAL format */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_DV5N_VIDEO, LSMASH_4CC( 'd', 'v', '5', 'n' ) ); /* Panasonic DVCPro-50 NTSC format */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_DV5P_VIDEO, LSMASH_4CC( 'd', 'v', '5', 'p' ) ); /* Panasonic DVCPro-50 PAL format */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_DVH2_VIDEO, LSMASH_4CC( 'd', 'v', 'h', '2' ) ); /* Panasonic DVCPro-HD 1080p25 format */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_DVH3_VIDEO, LSMASH_4CC( 'd', 'v', 'h', '3' ) ); /* Panasonic DVCPro-HD 1080p30 format */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_DVH5_VIDEO, LSMASH_4CC( 'd', 'v', 'h', '5' ) ); /* Panasonic DVCPro-HD 1080i50 format */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_DVH6_VIDEO, LSMASH_4CC( 'd', 'v', 'h', '6' ) ); /* Panasonic DVCPro-HD 1080i60 format */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_DVHP_VIDEO, LSMASH_4CC( 'd', 'v', 'h', 'p' ) ); /* Panasonic DVCPro-HD 720p60 format */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_DVHQ_VIDEO, LSMASH_4CC( 'd', 'v', 'h', 'q' ) ); /* Panasonic DVCPro-HD 720p50 format */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_FLIC_VIDEO, LSMASH_4CC( 'f', 'l', 'i', 'c' ) ); /* Autodesk FLIC animation format */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_GIF_VIDEO, LSMASH_4CC( 'g', 'i', 'f', ' ' ) ); /* GIF image format */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_H261_VIDEO, LSMASH_4CC( 'h', '2', '6', '1' ) ); /* ITU H.261 video */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_H263_VIDEO, LSMASH_4CC( 'h', '2', '6', '3' ) ); /* ITU H.263 video */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_JPEG_VIDEO, LSMASH_4CC( 'j', 'p', 'e', 'g' ) ); /* JPEG image format */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_MJPA_VIDEO, LSMASH_4CC( 'm', 'j', 'p', 'a' ) ); /* Motion-JPEG (format A) */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_MJPB_VIDEO, LSMASH_4CC( 'm', 'j', 'p', 'b' ) ); /* Motion-JPEG (format B) */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_PNG_VIDEO, LSMASH_4CC( 'p', 'n', 'g', ' ' ) ); /* W3C Portable Network Graphics (PNG) */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_RAW_VIDEO, LSMASH_4CC( 'r', 'a', 'w', ' ' ) ); /* Uncompressed RGB */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_RLE_VIDEO, LSMASH_4CC( 'r', 'l', 'e', ' ' ) ); /* Apple animation codec */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_RPZA_VIDEO, LSMASH_4CC( 'r', 'p', 'z', 'a' ) ); /* Apple simple video 'road pizza' compression */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_TGA_VIDEO, LSMASH_4CC( 't', 'g', 'a', ' ' ) ); /* Truvision Targa video format */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_TIFF_VIDEO, LSMASH_4CC( 't', 'i', 'f', 'f' ) ); /* Tagged Image File Format (Adobe) */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_ULRA_VIDEO, LSMASH_4CC( 'U', 'L', 'R', 'A' ) ); /* Ut Video RGBA 4:4:4:4 8bit full-range */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_ULRG_VIDEO, LSMASH_4CC( 'U', 'L', 'R', 'G' ) ); /* Ut Video RGB 4:4:4 8bit full-range */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_ULY0_VIDEO, LSMASH_4CC( 'U', 'L', 'Y', '0' ) ); /* Ut Video YCbCr (BT.601) 4:2:0 8bit limited */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_ULY2_VIDEO, LSMASH_4CC( 'U', 'L', 'Y', '2' ) ); /* Ut Video YCbCr (BT.601) 4:2:2 8bit limited */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_ULH0_VIDEO, LSMASH_4CC( 'U', 'L', 'H', '0' ) ); /* Ut Video YCbCr (BT.709) 4:2:0 8bit limited */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_ULH2_VIDEO, LSMASH_4CC( 'U', 'L', 'H', '2' ) ); /* Ut Video YCbCr (BT.709) 4:2:2 8bit limited */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_V210_VIDEO, LSMASH_4CC( 'v', '2', '1', '0' ) ); /* Uncompressed Y'CbCr, 10-bit-per-component 4:2:2 * |Cb0(10)|Y'0(10)|Cr0(10)|XX(2)| * |Y'1(10)|Cb1(10)|Y'2(10)|XX(2)| * |Cr1(10)|Y'3(10)|Cb2(10)|XX(2)| * |Y'4(10)|Cr2(10)|Y'5(10)|XX(2)| (X is a zero bit) */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_V216_VIDEO, LSMASH_4CC( 'v', '2', '1', '6' ) ); /* Uncompressed Y'CbCr, 10, 12, 14, or 16-bit-per-component 4:2:2 * |Cb(16 LE)|Y'0(16 LE)|Cr(16 LE)|Y'1(16 LE)| */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_V308_VIDEO, LSMASH_4CC( 'v', '3', '0', '8' ) ); /* Uncompressed Y'CbCr, 8-bit-per-component 4:4:4 * |Cr(8)|Y'(8)|Cb(8)| */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_V408_VIDEO, LSMASH_4CC( 'v', '4', '0', '8' ) ); /* Uncompressed Y'CbCrA, 8-bit-per-component 4:4:4:4 * |Cb(8)|Y'(8)|Cr(8)|A(8)| */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_V410_VIDEO, LSMASH_4CC( 'v', '4', '1', '0' ) ); /* Uncompressed Y'CbCr, 10-bit-per-component 4:4:4 * |XX(2)|Cb(10)|Y'(10)|Cr(10)| (X is a zero bit) */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_YUV2_VIDEO, LSMASH_4CC( 'y', 'u', 'v', '2' ) ); /* Uncompressed Y'CbCr, 8-bit-per-component 4:2:2 * |Y'0(8)|Cb(8)|Y'1(8)|Cr(8)| */ /* Text CODEC identifiers */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_ENCT_TEXT, LSMASH_4CC( 'e', 'n', 'c', 't' ) ); /* Encrypted Text */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_STPP_TEXT, LSMASH_4CC( 's', 't', 'p', 'p' ) ); /* Sub-titles (Timed Text) */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_TX3G_TEXT, LSMASH_4CC( 't', 'x', '3', 'g' ) ); /* 3GPP Timed Text stream */ DEFINE_QTFF_CODEC_TYPE( QT_CODEC_TYPE_TEXT_TEXT, LSMASH_4CC( 't', 'e', 'x', 't' ) ); /* QuickTime Text Media */ /* Hint CODEC identifiers */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_FDP_HINT, LSMASH_4CC( 'f', 'd', 'p', ' ' ) ); /* File delivery hints */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_M2TS_HINT, LSMASH_4CC( 'm', '2', 't', 's' ) ); /* MPEG-2 transport stream for DMB */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_PM2T_HINT, LSMASH_4CC( 'p', 'm', '2', 't' ) ); /* Protected MPEG-2 Transport */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_PRTP_HINT, LSMASH_4CC( 'p', 'r', 't', 'p' ) ); /* Protected RTP Reception */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_RM2T_HINT, LSMASH_4CC( 'r', 'm', '2', 't' ) ); /* MPEG-2 Transport Reception */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_RRTP_HINT, LSMASH_4CC( 'r', 'r', 't', 'p' ) ); /* RTP reception */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_RSRP_HINT, LSMASH_4CC( 'r', 's', 'r', 'p' ) ); /* SRTP Reception */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_RTP_HINT, LSMASH_4CC( 'r', 't', 'p', ' ' ) ); /* RTP Hints */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_SM2T_HINT, LSMASH_4CC( 's', 'm', '2', 't' ) ); /* MPEG-2 Transport Server */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_SRTP_HINT, LSMASH_4CC( 's', 'r', 't', 'p' ) ); /* SRTP Hints */ /* Metadata CODEC identifiers */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_IXSE_META, LSMASH_4CC( 'i', 'x', 's', 'e' ) ); /* DVB Track Level Index Track */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_METT_META, LSMASH_4CC( 'm', 'e', 't', 't' ) ); /* Text timed metadata */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_METX_META, LSMASH_4CC( 'm', 'e', 't', 'x' ) ); /* XML timed metadata */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_MLIX_META, LSMASH_4CC( 'm', 'l', 'i', 'x' ) ); /* DVB Movie level index track */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_OKSD_META, LSMASH_4CC( 'o', 'k', 's', 'd' ) ); /* OMA Keys */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_SVCM_META, LSMASH_4CC( 's', 'v', 'c', 'M' ) ); /* SVC metadata */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_TEXT_META, LSMASH_4CC( 't', 'e', 'x', 't' ) ); /* Textual meta-data with MIME type */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_URIM_META, LSMASH_4CC( 'u', 'r', 'i', 'm' ) ); /* URI identified timed metadata */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_XML_META, LSMASH_4CC( 'x', 'm', 'l', ' ' ) ); /* XML-formatted meta-data */ /* Other CODEC identifiers */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_ENCS_SYSTEM, LSMASH_4CC( 'e', 'n', 'c', 's' ) ); /* Encrypted Systems stream */ DEFINE_ISOM_CODEC_TYPE( ISOM_CODEC_TYPE_MP4S_SYSTEM, LSMASH_4CC( 'm', 'p', '4', 's' ) ); /* MPEG-4 Systems */ DEFINE_QTFF_CODEC_TYPE( LSMASH_CODEC_TYPE_RAW, LSMASH_4CC( 'r', 'a', 'w', ' ' ) ); /* Either video or audio */ /* Check if the identifier of two CODECs is identical or not. * * Return 1 if the both CODEC identifiers are identical. * Return 0 otherwise. */ int lsmash_check_codec_type_identical( lsmash_codec_type_t a, lsmash_codec_type_t b ); /**************************************************************************** * Summary of Stream Configuration * This is L-SMASH's original structure. ****************************************************************************/ typedef enum { LSMASH_SUMMARY_TYPE_UNKNOWN = 0, LSMASH_SUMMARY_TYPE_VIDEO, LSMASH_SUMMARY_TYPE_AUDIO, } lsmash_summary_type; typedef enum { LSMASH_CODEC_SPECIFIC_DATA_TYPE_UNSPECIFIED = -1, /* must be LSMASH_CODEC_SPECIFIC_FORMAT_UNSPECIFIED */ LSMASH_CODEC_SPECIFIC_DATA_TYPE_UNKNOWN = 0, /* must be LSMASH_CODEC_SPECIFIC_FORMAT_UNSTRUCTURED */ LSMASH_CODEC_SPECIFIC_DATA_TYPE_MP4SYS_DECODER_CONFIG, LSMASH_CODEC_SPECIFIC_DATA_TYPE_ISOM_VIDEO_H264, LSMASH_CODEC_SPECIFIC_DATA_TYPE_ISOM_VIDEO_HEVC, LSMASH_CODEC_SPECIFIC_DATA_TYPE_ISOM_VIDEO_VC_1, LSMASH_CODEC_SPECIFIC_DATA_TYPE_ISOM_AUDIO_AC_3, LSMASH_CODEC_SPECIFIC_DATA_TYPE_ISOM_AUDIO_EC_3, LSMASH_CODEC_SPECIFIC_DATA_TYPE_ISOM_AUDIO_DTS, LSMASH_CODEC_SPECIFIC_DATA_TYPE_ISOM_AUDIO_ALAC, LSMASH_CODEC_SPECIFIC_DATA_TYPE_ISOM_VIDEO_SAMPLE_SCALE, LSMASH_CODEC_SPECIFIC_DATA_TYPE_ISOM_VIDEO_H264_BITRATE, LSMASH_CODEC_SPECIFIC_DATA_TYPE_QT_VIDEO_COMMON, /* must be LSMASH_CODEC_SPECIFIC_FORMAT_STRUCTURED */ LSMASH_CODEC_SPECIFIC_DATA_TYPE_QT_AUDIO_COMMON, /* must be LSMASH_CODEC_SPECIFIC_FORMAT_STRUCTURED */ LSMASH_CODEC_SPECIFIC_DATA_TYPE_QT_AUDIO_FORMAT_SPECIFIC_FLAGS, /* must be LSMASH_CODEC_SPECIFIC_FORMAT_STRUCTURED */ LSMASH_CODEC_SPECIFIC_DATA_TYPE_QT_AUDIO_DECOMPRESSION_PARAMETERS, /* must be LSMASH_CODEC_SPECIFIC_FORMAT_UNSTRUCTURED */ LSMASH_CODEC_SPECIFIC_DATA_TYPE_QT_VIDEO_FIELD_INFO, LSMASH_CODEC_SPECIFIC_DATA_TYPE_QT_VIDEO_PIXEL_FORMAT, LSMASH_CODEC_SPECIFIC_DATA_TYPE_QT_VIDEO_SIGNIFICANT_BITS, LSMASH_CODEC_SPECIFIC_DATA_TYPE_QT_VIDEO_GAMMA_LEVEL, LSMASH_CODEC_SPECIFIC_DATA_TYPE_QT_AUDIO_CHANNEL_LAYOUT, LSMASH_CODEC_SPECIFIC_DATA_TYPE_CODEC_GLOBAL_HEADER, } lsmash_codec_specific_data_type; typedef enum { LSMASH_CODEC_SPECIFIC_FORMAT_UNSPECIFIED = -1, LSMASH_CODEC_SPECIFIC_FORMAT_STRUCTURED = 0, LSMASH_CODEC_SPECIFIC_FORMAT_UNSTRUCTURED = 1 } lsmash_codec_specific_format; typedef union { void *always_null; /* LSMASH_CODEC_SPECIFIC_FORMAT_UNSPECIFIED */ void *structured; /* LSMASH_CODEC_SPECIFIC_FORMAT_STRUCTURED */ uint8_t *unstructured; /* LSMASH_CODEC_SPECIFIC_FORMAT_UNSTRUCTURED */ } lsmash_codec_specific_data_t; typedef void (*lsmash_codec_specific_destructor_t)( void * ); typedef struct { lsmash_codec_specific_data_type type; lsmash_codec_specific_format format; lsmash_codec_specific_data_t data; uint32_t size; lsmash_codec_specific_destructor_t destruct; } lsmash_codec_specific_t; typedef struct lsmash_codec_specific_list_tag lsmash_codec_specific_list_t; typedef enum { LSMASH_CODEC_SUPPORT_FLAG_NONE = 0, LSMASH_CODEC_SUPPORT_FLAG_MUX = 1 << 0, /* It's expected that L-SMASH can mux CODEC stream properly. * If not flagged, L-SMASH may recognize and/or handle CODEC specific info incorrectly when muxing. */ LSMASH_CODEC_SUPPORT_FLAG_DEMUX = 1 << 1, /* It's expected that L-SMASH can demux CODEC stream properly. * If not flagged, L-SMASH may recognize and/or handle CODEC specific info incorrectly when demuxing. */ LSMASH_CODEC_SUPPORT_FLAG_REMUX = LSMASH_CODEC_SUPPORT_FLAG_MUX | LSMASH_CODEC_SUPPORT_FLAG_DEMUX, } lsmash_codec_support_flag; #define LSMASH_BASE_SUMMARY \ lsmash_summary_type summary_type; \ lsmash_codec_type_t sample_type; \ lsmash_codec_specific_list_t *opaque; \ uint32_t max_au_length; /* buffer length for 1 access unit, \ * typically max size of 1 audio/video frame */ \ uint32_t data_ref_index; /* the index of a data reference */ typedef struct { LSMASH_BASE_SUMMARY } lsmash_summary_t; /* Allocate a summary by 'summary_type'. * The allocated summary can be deallocated by lsmash_cleanup_summary(). * * Return the address of an allocated summary if successful. * Return NULL otherwise. */ lsmash_summary_t *lsmash_create_summary ( lsmash_summary_type summary_type /* a type of summary you want */ ); /* Deallocate a given summary. */ void lsmash_cleanup_summary ( lsmash_summary_t *summary /* the address of a summary you want to deallocate */ ); /* Allocate and append a new sample description to a track by 'summary'. * * Return the index of an allocated and appended sample description if successful. * Return 0 otherwise. */ int lsmash_add_sample_entry ( lsmash_root_t *root, /* the address of the ROOT containing a track to which you want to append a new sample description */ uint32_t track_ID, /* the track_ID of a track to which you want to append a new sample description */ void *summary /* the summary of a sample description you want to append */ ); /* Count the number of summaries in a track. * * Return the number of summaries in a track if no error. * Return 0 otherwise. */ uint32_t lsmash_count_summary ( lsmash_root_t *root, /* the address of the ROOT containing a track in which you want to count the number of summaries */ uint32_t track_ID /* the track_ID of a track in which you want to count the number of summaries */ ); /* Get the summary of a sample description you want in a track. * The summary returned by this function is allocated internally, and can be deallocate by lsmash_cleanup_summary(). * * Return the address of an allocated summary you want if successful. * Return NULL otherwise. */ lsmash_summary_t *lsmash_get_summary ( lsmash_root_t *root, /* the address of the ROOT containing a track which contains a sample description you want */ uint32_t track_ID, /* the track_ID of a track containing a sample description you want */ uint32_t description_number /* the index of a sample description you want */ ); /* Allocate and initialize a CODEC specific configuration by 'type' and 'format'. * The allocated CODEC specific configuration can be deallocated by lsmash_destroy_codec_specific_data(). * * Return the address of an allocated and initialized CODEC specific configuration if successful. * Return NULL otherwise. */ lsmash_codec_specific_t *lsmash_create_codec_specific_data ( lsmash_codec_specific_data_type type, lsmash_codec_specific_format format ); /* Deallocate a CODEC specific configuration. */ void lsmash_destroy_codec_specific_data ( lsmash_codec_specific_t *specific /* the address of a CODEC specific configuration you want to deallocate */ ); /* Allocate a CODEC specific configuration which is a copy of 'specific', and append it to 'summary'. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_add_codec_specific_data ( lsmash_summary_t *summary, lsmash_codec_specific_t *specific ); /* Count the number of CODEC specific configuration in a summary. * * Return the number of CODEC specific configuration in a summary if successful. * Return 0 otherwise. */ uint32_t lsmash_count_codec_specific_data ( lsmash_summary_t *summary /* the address of a summary in which you want to count the number of CODEC specific configuration */ ); /* Get a CODEC specific configuration you want in a summary. * * Return the address of a CODEC specific configuration if successful. * Return NULL otherwise. */ lsmash_codec_specific_t *lsmash_get_codec_specific_data ( lsmash_summary_t *summary, uint32_t extension_number ); /* Convert a data format of CODEC specific configuration into another. * User can specify the same data format for the destination. * If so, a returned CODEC specific configuration is a copy of the source. * * Return an allocated CODEC specific configuration by specified 'format' from 'specific' if successful. * Return NULL otherwise. */ lsmash_codec_specific_t *lsmash_convert_codec_specific_format ( lsmash_codec_specific_t *specific, /* the address of a CODEC specific configuration as the source */ lsmash_codec_specific_format format /* a data format of the destination */ ); /* Compare two summaries. * * Return 0 if the two summaries are identical. * Return 1 if the two summaries are different. * Return a negative value if there is any error. */ int lsmash_compare_summary ( lsmash_summary_t *a, lsmash_summary_t *b ); /* Check status of CODEC support. * * Return support flags of a given CODEC. */ lsmash_codec_support_flag lsmash_check_codec_support ( lsmash_codec_type_t codec_type ); /**************************************************************************** * Audio Description Layer ****************************************************************************/ /* Audio Object Types */ typedef enum { MP4A_AUDIO_OBJECT_TYPE_NULL = 0, MP4A_AUDIO_OBJECT_TYPE_AAC_MAIN = 1, /* ISO/IEC 14496-3 subpart 4 */ MP4A_AUDIO_OBJECT_TYPE_AAC_LC = 2, /* ISO/IEC 14496-3 subpart 4 */ MP4A_AUDIO_OBJECT_TYPE_AAC_SSR = 3, /* ISO/IEC 14496-3 subpart 4 */ MP4A_AUDIO_OBJECT_TYPE_AAC_LTP = 4, /* ISO/IEC 14496-3 subpart 4 */ MP4A_AUDIO_OBJECT_TYPE_SBR = 5, /* ISO/IEC 14496-3 subpart 4 */ MP4A_AUDIO_OBJECT_TYPE_AAC_scalable = 6, /* ISO/IEC 14496-3 subpart 4 */ MP4A_AUDIO_OBJECT_TYPE_TwinVQ = 7, /* ISO/IEC 14496-3 subpart 4 */ MP4A_AUDIO_OBJECT_TYPE_CELP = 8, /* ISO/IEC 14496-3 subpart 3 */ MP4A_AUDIO_OBJECT_TYPE_HVXC = 9, /* ISO/IEC 14496-3 subpart 2 */ MP4A_AUDIO_OBJECT_TYPE_TTSI = 12, /* ISO/IEC 14496-3 subpart 6 */ MP4A_AUDIO_OBJECT_TYPE_Main_synthetic = 13, /* ISO/IEC 14496-3 subpart 5 */ MP4A_AUDIO_OBJECT_TYPE_Wavetable_synthesis = 14, /* ISO/IEC 14496-3 subpart 5 */ MP4A_AUDIO_OBJECT_TYPE_General_MIDI = 15, /* ISO/IEC 14496-3 subpart 5 */ MP4A_AUDIO_OBJECT_TYPE_Algorithmic_Synthesis_Audio_FX = 16, /* ISO/IEC 14496-3 subpart 5 */ MP4A_AUDIO_OBJECT_TYPE_ER_AAC_LC = 17, /* ISO/IEC 14496-3 subpart 4 */ MP4A_AUDIO_OBJECT_TYPE_ER_AAC_LTP = 19, /* ISO/IEC 14496-3 subpart 4 */ MP4A_AUDIO_OBJECT_TYPE_ER_AAC_scalable = 20, /* ISO/IEC 14496-3 subpart 4 */ MP4A_AUDIO_OBJECT_TYPE_ER_Twin_VQ = 21, /* ISO/IEC 14496-3 subpart 4 */ MP4A_AUDIO_OBJECT_TYPE_ER_BSAC = 22, /* ISO/IEC 14496-3 subpart 4 */ MP4A_AUDIO_OBJECT_TYPE_ER_AAC_LD = 23, /* ISO/IEC 14496-3 subpart 4 */ MP4A_AUDIO_OBJECT_TYPE_ER_CELP = 24, /* ISO/IEC 14496-3 subpart 3 */ MP4A_AUDIO_OBJECT_TYPE_ER_HVXC = 25, /* ISO/IEC 14496-3 subpart 2 */ MP4A_AUDIO_OBJECT_TYPE_ER_HILN = 26, /* ISO/IEC 14496-3 subpart 7 */ MP4A_AUDIO_OBJECT_TYPE_ER_Parametric = 27, /* ISO/IEC 14496-3 subpart 2 and 7 */ MP4A_AUDIO_OBJECT_TYPE_SSC = 28, /* ISO/IEC 14496-3 subpart 8 */ MP4A_AUDIO_OBJECT_TYPE_PS = 29, /* ISO/IEC 14496-3 subpart 8 */ MP4A_AUDIO_OBJECT_TYPE_MPEG_Surround = 30, /* ISO/IEC 23003-1 */ MP4A_AUDIO_OBJECT_TYPE_ESCAPE = 31, MP4A_AUDIO_OBJECT_TYPE_Layer_1 = 32, /* ISO/IEC 14496-3 subpart 9 */ MP4A_AUDIO_OBJECT_TYPE_Layer_2 = 33, /* ISO/IEC 14496-3 subpart 9 */ MP4A_AUDIO_OBJECT_TYPE_Layer_3 = 34, /* ISO/IEC 14496-3 subpart 9 */ MP4A_AUDIO_OBJECT_TYPE_DST = 35, /* ISO/IEC 14496-3 subpart 10 */ MP4A_AUDIO_OBJECT_TYPE_ALS = 36, /* ISO/IEC 14496-3 subpart 11 */ MP4A_AUDIO_OBJECT_TYPE_SLS = 37, /* ISO/IEC 14496-3 subpart 12 */ MP4A_AUDIO_OBJECT_TYPE_SLS_non_core = 38, /* ISO/IEC 14496-3 subpart 12 */ MP4A_AUDIO_OBJECT_TYPE_ER_AAC_ELD = 39, /* ISO/IEC 14496-3 subpart 4 */ MP4A_AUDIO_OBJECT_TYPE_SMR_Simple = 40, /* ISO/IEC 14496-23 */ MP4A_AUDIO_OBJECT_TYPE_SMR_Main = 41, /* ISO/IEC 14496-23 */ MP4A_AUDIO_OBJECT_TYPE_SAOC = 43, /* ISO/IEC 23003-2 */ } lsmash_mp4a_AudioObjectType; /* See ISO/IEC 14496-3 Signaling of SBR, SBR Signaling and Corresponding Decoder Behavior */ typedef enum { MP4A_AAC_SBR_NOT_SPECIFIED = 0x0, /* not mention to SBR presence. Implicit signaling. */ MP4A_AAC_SBR_NONE, /* explicitly signals SBR does not present. Useless in general. */ MP4A_AAC_SBR_BACKWARD_COMPATIBLE, /* explicitly signals SBR present. Recommended method to signal SBR. */ MP4A_AAC_SBR_HIERARCHICAL /* SBR exists. SBR dedicated method. */ } lsmash_mp4a_aac_sbr_mode; typedef struct { LSMASH_BASE_SUMMARY lsmash_mp4a_AudioObjectType aot; /* detailed codec type * If neither ISOM_CODEC_TYPE_MP4A_AUDIO nor QT_CODEC_TYPE_MP4A_AUDIO, just ignored. */ uint32_t frequency; /* the audio sampling rate (in Hz) at the default output playback * For some audio, this field is used as a nominal value. * For HE-AAC v1/SBR stream, this is base AAC's one. * For ISOM_CODEC_TYPE_AC_3_AUDIO and ISOM_CODEC_TYPE_EC_3_AUDIO, this shall be * equal to the sampling rate (in Hz) of the stream and the media timescale. */ uint32_t channels; /* the number of audio channels at the default output playback * Even if the stream is HE-AAC v2/SBR+PS, this is base AAC's one. */ uint32_t sample_size; /* For uncompressed audio, * the number of bits in each uncompressed sample for a single channel. * For some compressed audio, such as audio that uses MDCT, * N/A (not applicable), and may be set to 16. */ uint32_t samples_in_frame; /* the number of decoded PCM samples in an audio frame at 'frequency' * Even if the stream is HE-AAC/aacPlus/SBR(+PS), this is base AAC's one, so 1024. */ lsmash_mp4a_aac_sbr_mode sbr_mode; /* SBR treatment * Currently we always set this as mp4a_AAC_SBR_NOT_SPECIFIED (Implicit signaling). * User can set this for treatment in other way. */ uint32_t bytes_per_frame; /* the number of bytes per audio frame * If variable, shall be set to 0. */ } lsmash_audio_summary_t; /* Facilitate to make exdata (typically DecoderSpecificInfo or AudioSpecificConfig). */ int lsmash_setup_AudioSpecificConfig ( lsmash_audio_summary_t* summary ); /**************************************************************************** * Video Description Layer ****************************************************************************/ /* Clean Aperture */ typedef struct { lsmash_rational_u32_t width; lsmash_rational_u32_t height; lsmash_rational_s32_t horizontal_offset; lsmash_rational_s32_t vertical_offset; } lsmash_clap_t; typedef struct { lsmash_rational_u32_t top; lsmash_rational_u32_t left; lsmash_rational_u32_t bottom; lsmash_rational_u32_t right; } lsmash_crop_t; /* Video depth */ typedef enum { ISOM_DEPTH_TEMPLATE = 0x0018, /* H.264/AVC */ AVC_DEPTH_COLOR_WITH_NO_ALPHA = 0x0018, /* color with no alpha */ AVC_DEPTH_GRAYSCALE_WITH_NO_ALPHA = 0x0028, /* grayscale with no alpha */ AVC_DEPTH_WITH_ALPHA = 0x0020, /* gray or color with alpha */ /* QuickTime Video * (1-32) or (33-40 grayscale) */ QT_VIDEO_DEPTH_COLOR_1 = 0x0001, QT_VIDEO_DEPTH_COLOR_2 = 0x0002, QT_VIDEO_DEPTH_COLOR_4 = 0x0004, QT_VIDEO_DEPTH_COLOR_8 = 0x0008, QT_VIDEO_DEPTH_COLOR_16 = 0x0010, QT_VIDEO_DEPTH_COLOR_24 = 0x0018, QT_VIDEO_DEPTH_COLOR_32 = 0x0020, QT_VIDEO_DEPTH_GRAYSCALE_1 = 0x0021, QT_VIDEO_DEPTH_GRAYSCALE_2 = 0x0022, QT_VIDEO_DEPTH_GRAYSCALE_4 = 0x0024, QT_VIDEO_DEPTH_GRAYSCALE_8 = 0x0028, /* QuickTime Uncompressed RGB */ QT_VIDEO_DEPTH_555RGB = 0x0010, QT_VIDEO_DEPTH_24RGB = 0x0018, QT_VIDEO_DEPTH_32ARGB = 0x0020, } lsmash_video_depth; /* Index for the chromaticity coordinates of the color primaries */ enum { /* for ISO Base Media file format */ ISOM_PRIMARIES_INDEX_ITU_R709_5 = 1, /* ITU-R BT.709-2/5, ITU-R BT.1361, * SMPTE 274M-1995, SMPTE 296M-1997, * IEC 61966-2-1 (sRGB or sYCC), IEC 61966-2-4 (xvYCC), * SMPTE RP 177M-1993 Annex B * green x = 0.300 y = 0.600 * blue x = 0.150 y = 0.060 * red x = 0.640 y = 0.330 * white x = 0.3127 y = 0.3290 (CIE III. D65) */ ISOM_PRIMARIES_INDEX_UNSPECIFIED = 2, /* Unspecified */ ISOM_PRIMARIES_INDEX_ITU_R470M = 4, /* ITU-R BT.470-6 System M * green x = 0.21 y = 0.71 * blue x = 0.14 y = 0.08 * red x = 0.67 y = 0.33 * white x = 0.310 y = 0.316 */ ISOM_PRIMARIES_INDEX_ITU_R470BG = 5, /* EBU Tech. 3213 (1981), ITU-R BT.470-6 System B, G, * ITU-R BT.601-6 625, ITU-R BT.1358 625, * ITU-R BT.1700 625 PAL and 625 SECAM * green x = 0.29 y = 0.60 * blue x = 0.15 y = 0.06 * red x = 0.64 y = 0.33 * white x = 0.3127 y = 0.3290 (CIE III. D65) */ ISOM_PRIMARIES_INDEX_SMPTE_170M_2004 = 6, /* SMPTE C Primaries from SMPTE RP 145-1993, SMPTE 170M-2004, * ITU-R BT.601-6 525, ITU-R BT.1358 525, * ITU-R BT.1700 NTSC, SMPTE 170M-2004 * green x = 0.310 y = 0.595 * blue x = 0.155 y = 0.070 * red x = 0.630 y = 0.340 * white x = 0.3127 y = 0.3290 (CIE III. D65) */ ISOM_PRIMARIES_INDEX_SMPTE_240M_1999 = 7, /* SMPTE 240M-1999 * functionally the same as the value ISOM_PRIMARIES_INDEX_SMPTE_170M_2004 */ /* for QuickTime file format */ QT_PRIMARIES_INDEX_ITU_R709_2 = 1, /* the same as the value ISOM_PRIMARIES_INDEX_ITU_R709_5 */ QT_PRIMARIES_INDEX_UNSPECIFIED = 2, /* Unspecified */ QT_PRIMARIES_INDEX_EBU_3213 = 5, /* the same as the value ISOM_PRIMARIES_INDEX_ITU_R470BG */ QT_PRIMARIES_INDEX_SMPTE_C = 6, /* the same as the value ISOM_PRIMARIES_INDEX_SMPTE_170M_2004 */ }; /* Index for the opto-electronic transfer characteristic of the image color components */ enum { /* for ISO Base Media file format */ ISOM_TRANSFER_INDEX_ITU_R709_5 = 1, /* ITU-R BT.709-2/5, ITU-R BT.1361 * SMPTE 274M-1995, SMPTE 296M-1997, * SMPTE 293M-1996, SMPTE 170M-1994 * vV = 1.099 * vLc^0.45 - 0.099 for 1 >= vLc >= 0.018 * vV = 4.500 * vLc for 0.018 > vLc >= 0 */ ISOM_TRANSFER_INDEX_UNSPECIFIED = 2, /* Unspecified */ ISOM_TRANSFER_INDEX_ITU_R470M = 4, /* ITU-R BT.470-6 System M, ITU-R BT.1700 625 PAL and 625 SECAM * Assumed display gamma 2.2 */ ISOM_TRANSFER_INDEX_ITU_R470BG = 5, /* ITU-R BT.470-6 System B, G * Assumed display gamma 2.8 */ ISOM_TRANSFER_INDEX_SMPTE_170M_2004 = 6, /* ITU-R BT.601-6 525 or 625, ITU-R BT.1358 525 or 625, * ITU-R BT.1700 NTSC, SMPTE 170M-2004 * functionally the same as the value ISOM_TRANSFER_INDEX_ITU_R709_5 * vV = 1.099 * vLc^0.45 - 0.099 for 1 >= vLc >= 0.018 * vV = 4.500 * vLc for 0.018 > vLc >= 0 */ ISOM_TRANSFER_INDEX_SMPTE_240M_1999 = 7, /* SMPTE 240M-1995/1999, interim color implementation of SMPTE 274M-1995 * vV = 1.1115 * vLc^0.45 - 0.1115 for 1 >= vLc >= 0.0228 * vV = 4.0 * vLc for 0.0228 > vLc >= 0 */ ISOM_TRANSFER_INDEX_LINEAR = 8, /* Linear transfer characteristics */ ISOM_TRANSFER_INDEX_XVYCC = 11, /* IEC 61966-2-4 (xvYCC) * vV = 1.099 * vLc^0.45 - 0.099 for vLc >= 0.018 * vV = 4.500 * vLc for 0.018 > vLc > -0.018 * vV = -1.099 * (-vLc)^0.45 + 0.099 for -0.018 >= vLc */ ISOM_TRANSFER_INDEX_ITU_R1361 = 12, /* ITU-R BT.1361 * vV = 1.099 * vLc^0.45 - 0.099 for 1.33 > vLc >= 0.018 * vV = 4.500 * vLc for 0.018 > vLc >= -0.0045 * vV = -(1.099 * (-4 * vLc)^0.45 + 0.099) / 4 for -0.0045 > vLc >= -0.25 */ ISOM_TRANSFER_INDEX_SRGB = 13, /* IEC 61966-2-1 (sRGB or sYCC) * vV = 1.055 * vLc^(1/2.4) - 0.055 for 1 > vLc >= 0.0031308 * vV = 12.92 * vLc for 0.0031308 > vLc >= 0 */ /* for QuickTime file format */ QT_TRANSFER_INDEX_ITU_R709_2 = 1, /* the same as the value ISOM_TRANSFER_INDEX_ITU_R709_5 */ QT_TRANSFER_INDEX_UNSPECIFIED = 2, /* Unspecified */ QT_TRANSFER_INDEX_SMPTE_240M_1995 = 7, /* the same as the value ISOM_TRANSFER_INDEX_SMPTE_240M_1999 */ }; /* Index for the matrix coefficients associated with derivation of luma and chroma signals from the green, blue, and red primaries */ enum { /* for ISO Base Media file format */ ISOM_MATRIX_INDEX_NO_MATRIX = 0, /* No matrix transformation * IEC 61966-2-1 (sRGB) */ ISOM_MATRIX_INDEX_ITU_R_709_5 = 1, /* ITU-R BT.709-2/5, ITU-R BT.1361, * SMPTE 274M-1995, SMPTE 296M-1997 * IEC 61966-2-1 (sYCC), IEC 61966-2-4 xvYCC_709, * SMPTE RP 177M-1993 Annex B * vKr = 0.2126; vKb = 0.0722 */ ISOM_MATRIX_INDEX_UNSPECIFIED = 2, /* Unspecified */ ISOM_MATRIX_INDEX_USFCCT_47_CFR = 4, /* United States Federal Communications Commission Title 47 Code of Federal Regulations * vKr = 0.30; vKb = 0.11 */ ISOM_MATRIX_INDEX_ITU_R470BG = 5, /* ITU-R BT.470-6 System B, G, * ITU-R BT.601-4/6 625, ITU-R BT.1358 625, * ITU-R BT.1700 625 PAL and 625 SECAM, IEC 61966-2-4 xvYCC601 * vKr = 0.299; vKb = 0.114 */ ISOM_MATRIX_INDEX_SMPTE_170M_2004 = 6, /* ITU-R BT.601-4/6 525, ITU-R BT.1358 525, * ITU-R BT.1700 NTSC, * SMPTE 170M-1994, SMPTE 293M-1996 * functionally the same as the value ISOM_MATRIX_INDEX_ITU_R470BG * vKr = 0.299; vKb = 0.114 */ ISOM_MATRIX_INDEX_SMPTE_240M_1999 = 7, /* SMPTE 240M-1995, interim color implementation of SMPTE 274M-1995 * vKr = 0.212; vKb = 0.087 */ ISOM_MATRIX_INDEX_YCGCO = 8, /* YCoCg */ /* for QuickTime file format */ QT_MATRIX_INDEX_ITU_R_709_2 = 1, /* the same as the value ISOM_MATRIX_INDEX_ITU_R_709_5 */ QT_MATRIX_INDEX_UNSPECIFIED = 2, /* Unspecified */ QT_MATRIX_INDEX_ITU_R_601_4 = 6, /* the same as the value ISOM_MATRIX_INDEX_SMPTE_170M_2004 */ QT_MATRIX_INDEX_SMPTE_240M_1995 = 7 /* the same as the value ISOM_MATRIX_INDEX_SMPTE_240M_1999 */ }; typedef struct { LSMASH_BASE_SUMMARY // lsmash_mp4v_VideoObjectType vot; /* Detailed codec type. If not mp4v, just ignored. */ uint32_t timescale; /* media timescale * User can't set this parameter manually. */ uint32_t timebase; /* increment unit of timestamp * User can't set this parameter manually. */ uint8_t vfr; /* whether a stream is assumed as variable frame rate * User can't set this parameter manually. */ uint8_t sample_per_field; /* whether a stream may have a sample per field * User can't set this parameter manually. */ uint32_t width; /* pixel counts of width samples have */ uint32_t height; /* pixel counts of height samples have */ char compressorname[33]; /* a 32-byte Pascal string containing the name of the compressor that created the image */ lsmash_video_depth depth; /* data size of a pixel */ lsmash_clap_t clap; /* clean aperture */ uint32_t par_h; /* horizontal factor of pixel aspect ratio */ uint32_t par_v; /* vertical factor of pixel aspect ratio */ struct { /* To omit to write these field, set zero value to all them. */ uint16_t primaries_index; /* the chromaticity coordinates of the color primaries */ uint16_t transfer_index; /* the opto-electronic transfer characteristic of the image color components */ uint16_t matrix_index; /* the matrix coefficients associated with derivation of luma and chroma signals from the green, blue, and red primaries */ uint8_t full_range; } color; } lsmash_video_summary_t; int lsmash_convert_crop_into_clap ( lsmash_crop_t crop, uint32_t width, uint32_t height, lsmash_clap_t *clap ); int lsmash_convert_clap_into_crop ( lsmash_clap_t clap, uint32_t width, uint32_t height, lsmash_crop_t *crop ); /**************************************************************************** * Media Sample ****************************************************************************/ typedef enum { /* allow_ealier */ QT_SAMPLE_EARLIER_PTS_ALLOWED = 1, /* leading */ ISOM_SAMPLE_LEADING_UNKNOWN = 0, ISOM_SAMPLE_IS_UNDECODABLE_LEADING = 1, ISOM_SAMPLE_IS_NOT_LEADING = 2, ISOM_SAMPLE_IS_DECODABLE_LEADING = 3, /* independent */ ISOM_SAMPLE_INDEPENDENCY_UNKNOWN = 0, ISOM_SAMPLE_IS_NOT_INDEPENDENT = 1, ISOM_SAMPLE_IS_INDEPENDENT = 2, /* disposable */ ISOM_SAMPLE_DISPOSABLE_UNKNOWN = 0, ISOM_SAMPLE_IS_NOT_DISPOSABLE = 1, ISOM_SAMPLE_IS_DISPOSABLE = 2, /* redundant */ ISOM_SAMPLE_REDUNDANCY_UNKNOWN = 0, ISOM_SAMPLE_HAS_REDUNDANCY = 1, ISOM_SAMPLE_HAS_NO_REDUNDANCY = 2, } lsmash_sample_dependency; typedef enum { /* flags for ISO Base Media file format */ ISOM_SAMPLE_RANDOM_ACCESS_FLAG_NONE = 0, ISOM_SAMPLE_RANDOM_ACCESS_FLAG_SYNC = 1 << 0, /* a sync sample */ ISOM_SAMPLE_RANDOM_ACCESS_FLAG_RAP = 1 << 2, /* the first sample of a closed or an open GOP */ ISOM_SAMPLE_RANDOM_ACCESS_FLAG_CLOSED = 1 << 3, /* a sample in a closed GOP * This flag shall be set together with ISOM_SAMPLE_RANDOM_ACCESS_FLAG_RAP. */ ISOM_SAMPLE_RANDOM_ACCESS_FLAG_OPEN = 1 << 4, /* a sample in an open GOP * This flag shall be set together with ISOM_SAMPLE_RANDOM_ACCESS_FLAG_RAP. */ ISOM_SAMPLE_RANDOM_ACCESS_FLAG_GDR = 1 << 5, /* a sample on gradual decoder refresh or random access recovery */ ISOM_SAMPLE_RANDOM_ACCESS_FLAG_GDR_START = 1 << 6, /* a sample that is the starting point of gradual decoder refresh or random access recovery * This flag shall be set together with ISOM_SAMPLE_RANDOM_ACCESS_FLAG_GDR. */ ISOM_SAMPLE_RANDOM_ACCESS_FLAG_GDR_END = 1 << 7, /* a sample that is the ending point of gradual decoder refresh or random access recovery * This flag shall be set together with ISOM_SAMPLE_RANDOM_ACCESS_FLAG_GDR. */ ISOM_SAMPLE_RANDOM_ACCESS_FLAG_CLOSED_RAP /* the first sample of a closed GOP */ = ISOM_SAMPLE_RANDOM_ACCESS_FLAG_RAP | ISOM_SAMPLE_RANDOM_ACCESS_FLAG_CLOSED, ISOM_SAMPLE_RANDOM_ACCESS_FLAG_OPEN_RAP /* the first sample of an open GOP */ = ISOM_SAMPLE_RANDOM_ACCESS_FLAG_RAP | ISOM_SAMPLE_RANDOM_ACCESS_FLAG_OPEN, ISOM_SAMPLE_RANDOM_ACCESS_FLAG_POST_ROLL_START /* the post-roll starting point of random access recovery */ = ISOM_SAMPLE_RANDOM_ACCESS_FLAG_GDR | ISOM_SAMPLE_RANDOM_ACCESS_FLAG_GDR_START, ISOM_SAMPLE_RANDOM_ACCESS_FLAG_PRE_ROLL_END /* the pre-roll ending point of random access recovery */ = ISOM_SAMPLE_RANDOM_ACCESS_FLAG_GDR | ISOM_SAMPLE_RANDOM_ACCESS_FLAG_GDR_END, /* flags for QuickTime file format */ QT_SAMPLE_RANDOM_ACCESS_FLAG_NONE = 0, /* alias of ISOM_SAMPLE_RANDOM_ACCESS_FLAG_NONE */ QT_SAMPLE_RANDOM_ACCESS_FLAG_SYNC = ISOM_SAMPLE_RANDOM_ACCESS_FLAG_SYNC, QT_SAMPLE_RANDOM_ACCESS_FLAG_PARTIAL_SYNC = 1 << 1, /* partial sync sample * Partial sync sample is a sample * such that this sample and samples following in decoding order can be correctly decoded * using the first sample of the previous GOP and samples following in decoding order, * in addition, this sample and non-leading samples following in decoding order can be correctly decoded from this. */ QT_SAMPLE_RANDOM_ACCESS_FLAG_RAP = ISOM_SAMPLE_RANDOM_ACCESS_FLAG_RAP, QT_SAMPLE_RANDOM_ACCESS_FLAG_CLOSED = ISOM_SAMPLE_RANDOM_ACCESS_FLAG_CLOSED, QT_SAMPLE_RANDOM_ACCESS_FLAG_OPEN = ISOM_SAMPLE_RANDOM_ACCESS_FLAG_OPEN, QT_SAMPLE_RANDOM_ACCESS_FLAG_CLOSED_RAP /* the first sample of a closed GOP */ = QT_SAMPLE_RANDOM_ACCESS_FLAG_RAP | QT_SAMPLE_RANDOM_ACCESS_FLAG_CLOSED, QT_SAMPLE_RANDOM_ACCESS_FLAG_OPEN_RAP /* the first sample of an open GOP */ = QT_SAMPLE_RANDOM_ACCESS_FLAG_RAP | QT_SAMPLE_RANDOM_ACCESS_FLAG_OPEN, } lsmash_random_access_flag; #define LSMASH_FLAGS_SATISFIED( x, y ) (((x) & (y)) == (y)) #define LSMASH_IS_CLOSED_RAP( x ) LSMASH_FLAGS_SATISFIED( (x), ISOM_SAMPLE_RANDOM_ACCESS_FLAG_CLOSED_RAP ) #define LSMASH_IS_OPEN_RAP( x ) LSMASH_FLAGS_SATISFIED( (x), ISOM_SAMPLE_RANDOM_ACCESS_FLAG_OPEN_RAP ) #define LSMASH_IS_POST_ROLL_START( x ) LSMASH_FLAGS_SATISFIED( (x), ISOM_SAMPLE_RANDOM_ACCESS_FLAG_POST_ROLL_START ) #define LSMASH_IS_PRE_ROLL_END( x ) LSMASH_FLAGS_SATISFIED( (x), ISOM_SAMPLE_RANDOM_ACCESS_FLAG_PRE_ROLL_END ) typedef struct { uint32_t identifier; /* the identifier of sample * If this identifier equals a certain identifier of random access recovery point, * then this sample is the random access recovery point of the earliest unestablished post-roll group. */ uint32_t complete; /* the identifier of future random access recovery point, which is necessary for the recovery from its starting point to be completed * For muxing, this value is used only if (ra_flags & ISOM_SAMPLE_RANDOM_ACCESS_TYPE_POST_ROLL_START) is true. * The following is an example of use for gradual decoder refresh of H.264/AVC. * For each sample, set 'frame_num' to the 'identifier'. * For samples with recovery point SEI message, add ISOM_SAMPLE_RANDOM_ACCESS_TYPE_POST_ROLL_START to ra_flags * and set '(frame_num + recovery_frame_cnt) % MaxFrameNum' to the 'complete'. * The above-mentioned values are set appropriately, then L-SMASH will establish appropriate post-roll grouping. */ } lsmash_post_roll_t; typedef struct { uint32_t distance; /* the distance from the previous random access point or pre-roll starting point * of the random access recovery point to this sample. * For muxing, this value is used only if ra_flags is not set to ISOM_SAMPLE_RANDOM_ACCESS_TYPE_NONE * and LSMASH_IS_POST_ROLL_START( ra_flags ) is false. * Some derived specifications forbid using pre-roll settings and use post-roll settings instead (e.g. AVC uses only post-roll). * The following is an example of pre-roll distance for representing audio decoder delay derived from composition. * Typical AAC encoding uses a transform over consecutive sets of 2048 audio samples, * applied every 1024 audio samples (MDCTs are overlapped). * For correct audio to be decoded, both transforms for any period of 1024 audio samples are needed. * For this AAC stream, therefore, 'distance' of each sample shall be set to 1 (one AAC access unit). * Note: the number of priming audio sample i.e. encoder delay shall be represented by 'start_time' in an edit. */ } lsmash_pre_roll_t; typedef struct { lsmash_random_access_flag ra_flags; /* random access flags */ lsmash_post_roll_t post_roll; lsmash_pre_roll_t pre_roll; uint8_t allow_earlier; /* only for QuickTime file format */ uint8_t leading; uint8_t independent; uint8_t disposable; uint8_t redundant; uint8_t reserved[3]; /* non-output * broken link * ??? */ } lsmash_sample_property_t; typedef struct { uint32_t length; /* size of sample data * Note: this is NOT always an allocated size. */ uint8_t *data; /* sample data */ uint64_t dts; /* Decoding TimeStamp in units of media timescale */ uint64_t cts; /* Composition TimeStamp in units of media timescale */ uint64_t pos; /* absolute file offset of sample data (read-only) */ uint32_t index; /* index of sample description */ lsmash_sample_property_t prop; } lsmash_sample_t; typedef struct { uint64_t dts; /* Decoding TimeStamp in units of media timescale */ uint64_t cts; /* Composition TimeStamp in units of media timescale */ } lsmash_media_ts_t; typedef struct { uint32_t sample_count; lsmash_media_ts_t *timestamp; } lsmash_media_ts_list_t; /* Allocate a sample and then allocate data of the allocated sample by 'size'. * If 'size' is set to 0, data of the allocated sample won't be allocated and will be set to NULL instead. * The allocated sample can be deallocated by lsmash_delete_sample(). * * Return the address of an allocated sample if successful. * Return NULL otherwise. */ lsmash_sample_t *lsmash_create_sample ( uint32_t size /* size of sample data you request */ ); /* Allocate data of a given allocated sample by 'size'. * If the sample data is already allocated, reallocate it by 'size'. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_sample_alloc ( lsmash_sample_t *sample, /* the address of a sample you want to allocate its sample data */ uint32_t size /* size of sample data you request */ ); /* Deallocate a given sample. */ void lsmash_delete_sample ( lsmash_sample_t *sample /* the address of a sample you want to deallocate */ ); /* Append a sample to a track. * Note: * The appended sample will be deleted by lsmash_delete_sample() internally. * Users shall not deallocate the sample by lsmash_delete_sample() if successful to append the sample. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_append_sample ( lsmash_root_t *root, uint32_t track_ID, lsmash_sample_t *sample ); /**************************************************************************** * Media Layer ****************************************************************************/ /* Media handler types */ typedef enum { ISOM_MEDIA_HANDLER_TYPE_3GPP_SCENE_DESCRIPTION = LSMASH_4CC( '3', 'g', 's', 'd' ), ISOM_MEDIA_HANDLER_TYPE_ID3_VERSION2_METADATA = LSMASH_4CC( 'I', 'D', '3', '2' ), ISOM_MEDIA_HANDLER_TYPE_AUXILIARY_VIDEO_TRACK = LSMASH_4CC( 'a', 'u', 'x', 'v' ), ISOM_MEDIA_HANDLER_TYPE_CPCM_AUXILIARY_METADATA = LSMASH_4CC( 'c', 'p', 'a', 'd' ), ISOM_MEDIA_HANDLER_TYPE_CLOCK_REFERENCE_STREAM = LSMASH_4CC( 'c', 'r', 's', 'm' ), ISOM_MEDIA_HANDLER_TYPE_DVB_MANDATORY_BASIC_DESCRIPTION = LSMASH_4CC( 'd', 'm', 'b', 'd' ), ISOM_MEDIA_HANDLER_TYPE_TV_ANYTIME = LSMASH_4CC( 'd', 't', 'v', 'a' ), ISOM_MEDIA_HANDLER_TYPE_BROADBAND_CONTENT_GUIDE = LSMASH_4CC( 'd', 't', 'v', 'a' ), ISOM_MEDIA_HANDLER_TYPE_FONT_DATA_STREAM = LSMASH_4CC( 'f', 'd', 's', 'm' ), ISOM_MEDIA_HANDLER_TYPE_GENERAL_MPEG4_SYSTEM_STREAM = LSMASH_4CC( 'g', 'e', 's', 'm' ), ISOM_MEDIA_HANDLER_TYPE_HINT_TRACK = LSMASH_4CC( 'h', 'i', 'n', 't' ), ISOM_MEDIA_HANDLER_TYPE_IPDC_ELECTRONIC_SERVICE_GUIDE = LSMASH_4CC( 'i', 'p', 'd', 'c' ), ISOM_MEDIA_HANDLER_TYPE_IPMP_STREAM = LSMASH_4CC( 'i', 'p', 's', 'm' ), ISOM_MEDIA_HANDLER_TYPE_MPEG7_STREAM = LSMASH_4CC( 'm', '7', 's', 'm' ), ISOM_MEDIA_HANDLER_TYPE_TIMED_METADATA_TRACK = LSMASH_4CC( 'm', 'e', 't', 'a' ), ISOM_MEDIA_HANDLER_TYPE_MPEGJ_STREAM = LSMASH_4CC( 'm', 'j', 's', 'm' ), ISOM_MEDIA_HANDLER_TYPE_MPEG21_DIGITAL_ITEM = LSMASH_4CC( 'm', 'p', '2', '1' ), ISOM_MEDIA_HANDLER_TYPE_OBJECT_CONTENT_INFO_STREAM = LSMASH_4CC( 'o', 'c', 's', 'm' ), ISOM_MEDIA_HANDLER_TYPE_OBJECT_DESCRIPTOR_STREAM = LSMASH_4CC( 'o', 'd', 's', 'm' ), ISOM_MEDIA_HANDLER_TYPE_SCENE_DESCRIPTION_STREAM = LSMASH_4CC( 's', 'd', 's', 'm' ), ISOM_MEDIA_HANDLER_TYPE_KEY_MANAGEMENT_MESSAGES = LSMASH_4CC( 's', 'k', 'm', 'm' ), ISOM_MEDIA_HANDLER_TYPE_AUDIO_TRACK = LSMASH_4CC( 's', 'o', 'u', 'n' ), ISOM_MEDIA_HANDLER_TYPE_TEXT_TRACK = LSMASH_4CC( 't', 'e', 'x', 't' ), ISOM_MEDIA_HANDLER_TYPE_PROPRIETARY_DESCRIPTIVE_METADATA = LSMASH_4CC( 'u', 'r', 'i', ' ' ), ISOM_MEDIA_HANDLER_TYPE_VIDEO_TRACK = LSMASH_4CC( 'v', 'i', 'd', 'e' ), } lsmash_media_type; /* ISO language codes */ typedef enum { #define LSMASH_PACK_ISO_LANGUAGE( a, b, c ) ((((a-0x60)&0x1f)<<10) | (((b-0x60)&0x1f)<<5) | ((c-0x60)&0x1f)) ISOM_LANGUAGE_CODE_ENGLISH = LSMASH_PACK_ISO_LANGUAGE( 'e', 'n', 'g' ), ISOM_LANGUAGE_CODE_FRENCH = LSMASH_PACK_ISO_LANGUAGE( 'f', 'r', 'a' ), ISOM_LANGUAGE_CODE_GERMAN = LSMASH_PACK_ISO_LANGUAGE( 'd', 'e', 'u' ), ISOM_LANGUAGE_CODE_ITALIAN = LSMASH_PACK_ISO_LANGUAGE( 'i', 't', 'a' ), ISOM_LANGUAGE_CODE_DUTCH_M = LSMASH_PACK_ISO_LANGUAGE( 'd', 'u', 'm' ), ISOM_LANGUAGE_CODE_SWEDISH = LSMASH_PACK_ISO_LANGUAGE( 's', 'w', 'e' ), ISOM_LANGUAGE_CODE_SPANISH = LSMASH_PACK_ISO_LANGUAGE( 's', 'p', 'a' ), ISOM_LANGUAGE_CODE_DANISH = LSMASH_PACK_ISO_LANGUAGE( 'd', 'a', 'n' ), ISOM_LANGUAGE_CODE_PORTUGUESE = LSMASH_PACK_ISO_LANGUAGE( 'p', 'o', 'r' ), ISOM_LANGUAGE_CODE_NORWEGIAN = LSMASH_PACK_ISO_LANGUAGE( 'n', 'o', 'r' ), ISOM_LANGUAGE_CODE_HEBREW = LSMASH_PACK_ISO_LANGUAGE( 'h', 'e', 'b' ), ISOM_LANGUAGE_CODE_JAPANESE = LSMASH_PACK_ISO_LANGUAGE( 'j', 'p', 'n' ), ISOM_LANGUAGE_CODE_ARABIC = LSMASH_PACK_ISO_LANGUAGE( 'a', 'r', 'a' ), ISOM_LANGUAGE_CODE_FINNISH = LSMASH_PACK_ISO_LANGUAGE( 'f', 'i', 'n' ), ISOM_LANGUAGE_CODE_GREEK = LSMASH_PACK_ISO_LANGUAGE( 'e', 'l', 'l' ), ISOM_LANGUAGE_CODE_ICELANDIC = LSMASH_PACK_ISO_LANGUAGE( 'i', 's', 'l' ), ISOM_LANGUAGE_CODE_MALTESE = LSMASH_PACK_ISO_LANGUAGE( 'm', 'l', 't' ), ISOM_LANGUAGE_CODE_TURKISH = LSMASH_PACK_ISO_LANGUAGE( 't', 'u', 'r' ), ISOM_LANGUAGE_CODE_CROATIAN = LSMASH_PACK_ISO_LANGUAGE( 'h', 'r', 'v' ), ISOM_LANGUAGE_CODE_CHINESE = LSMASH_PACK_ISO_LANGUAGE( 'z', 'h', 'o' ), ISOM_LANGUAGE_CODE_URDU = LSMASH_PACK_ISO_LANGUAGE( 'u', 'r', 'd' ), ISOM_LANGUAGE_CODE_HINDI = LSMASH_PACK_ISO_LANGUAGE( 'h', 'i', 'n' ), ISOM_LANGUAGE_CODE_THAI = LSMASH_PACK_ISO_LANGUAGE( 't', 'h', 'a' ), ISOM_LANGUAGE_CODE_KOREAN = LSMASH_PACK_ISO_LANGUAGE( 'k', 'o', 'r' ), ISOM_LANGUAGE_CODE_LITHUANIAN = LSMASH_PACK_ISO_LANGUAGE( 'l', 'i', 't' ), ISOM_LANGUAGE_CODE_POLISH = LSMASH_PACK_ISO_LANGUAGE( 'p', 'o', 'l' ), ISOM_LANGUAGE_CODE_HUNGARIAN = LSMASH_PACK_ISO_LANGUAGE( 'h', 'u', 'n' ), ISOM_LANGUAGE_CODE_ESTONIAN = LSMASH_PACK_ISO_LANGUAGE( 'e', 's', 't' ), ISOM_LANGUAGE_CODE_LATVIAN = LSMASH_PACK_ISO_LANGUAGE( 'l', 'a', 'v' ), ISOM_LANGUAGE_CODE_SAMI = LSMASH_PACK_ISO_LANGUAGE( 's', 'm', 'i' ), ISOM_LANGUAGE_CODE_FAROESE = LSMASH_PACK_ISO_LANGUAGE( 'f', 'a', 'o' ), ISOM_LANGUAGE_CODE_RUSSIAN = LSMASH_PACK_ISO_LANGUAGE( 'r', 'u', 's' ), ISOM_LANGUAGE_CODE_DUTCH = LSMASH_PACK_ISO_LANGUAGE( 'n', 'l', 'd' ), ISOM_LANGUAGE_CODE_IRISH = LSMASH_PACK_ISO_LANGUAGE( 'g', 'l', 'e' ), ISOM_LANGUAGE_CODE_ALBANIAN = LSMASH_PACK_ISO_LANGUAGE( 's', 'q', 'i' ), ISOM_LANGUAGE_CODE_ROMANIAN = LSMASH_PACK_ISO_LANGUAGE( 'r', 'o', 'n' ), ISOM_LANGUAGE_CODE_CZECH = LSMASH_PACK_ISO_LANGUAGE( 'c', 'e', 's' ), ISOM_LANGUAGE_CODE_SLOVAK = LSMASH_PACK_ISO_LANGUAGE( 's', 'l', 'k' ), ISOM_LANGUAGE_CODE_SLOVENIA = LSMASH_PACK_ISO_LANGUAGE( 's', 'l', 'v' ), ISOM_LANGUAGE_CODE_YIDDISH = LSMASH_PACK_ISO_LANGUAGE( 'y', 'i', 'd' ), ISOM_LANGUAGE_CODE_SERBIAN = LSMASH_PACK_ISO_LANGUAGE( 's', 'r', 'p' ), ISOM_LANGUAGE_CODE_MACEDONIAN = LSMASH_PACK_ISO_LANGUAGE( 'm', 'k', 'd' ), ISOM_LANGUAGE_CODE_BULGARIAN = LSMASH_PACK_ISO_LANGUAGE( 'b', 'u', 'l' ), ISOM_LANGUAGE_CODE_UKRAINIAN = LSMASH_PACK_ISO_LANGUAGE( 'u', 'k', 'r' ), ISOM_LANGUAGE_CODE_BELARUSIAN = LSMASH_PACK_ISO_LANGUAGE( 'b', 'e', 'l' ), ISOM_LANGUAGE_CODE_UZBEK = LSMASH_PACK_ISO_LANGUAGE( 'u', 'z', 'b' ), ISOM_LANGUAGE_CODE_KAZAKH = LSMASH_PACK_ISO_LANGUAGE( 'k', 'a', 'z' ), ISOM_LANGUAGE_CODE_AZERBAIJANI = LSMASH_PACK_ISO_LANGUAGE( 'a', 'z', 'e' ), ISOM_LANGUAGE_CODE_ARMENIAN = LSMASH_PACK_ISO_LANGUAGE( 'h', 'y', 'e' ), ISOM_LANGUAGE_CODE_GEORGIAN = LSMASH_PACK_ISO_LANGUAGE( 'k', 'a', 't' ), ISOM_LANGUAGE_CODE_MOLDAVIAN = LSMASH_PACK_ISO_LANGUAGE( 'r', 'o', 'n' ), ISOM_LANGUAGE_CODE_KIRGHIZ = LSMASH_PACK_ISO_LANGUAGE( 'k', 'i', 'r' ), ISOM_LANGUAGE_CODE_TAJIK = LSMASH_PACK_ISO_LANGUAGE( 't', 'g', 'k' ), ISOM_LANGUAGE_CODE_TURKMEN = LSMASH_PACK_ISO_LANGUAGE( 't', 'u', 'k' ), ISOM_LANGUAGE_CODE_MONGOLIAN = LSMASH_PACK_ISO_LANGUAGE( 'm', 'o', 'n' ), ISOM_LANGUAGE_CODE_PASHTO = LSMASH_PACK_ISO_LANGUAGE( 'p', 'u', 's' ), ISOM_LANGUAGE_CODE_KURDISH = LSMASH_PACK_ISO_LANGUAGE( 'k', 'u', 'r' ), ISOM_LANGUAGE_CODE_KASHMIRI = LSMASH_PACK_ISO_LANGUAGE( 'k', 'a', 's' ), ISOM_LANGUAGE_CODE_SINDHI = LSMASH_PACK_ISO_LANGUAGE( 's', 'n', 'd' ), ISOM_LANGUAGE_CODE_TIBETAN = LSMASH_PACK_ISO_LANGUAGE( 'b', 'o', 'd' ), ISOM_LANGUAGE_CODE_NEPALI = LSMASH_PACK_ISO_LANGUAGE( 'n', 'e', 'p' ), ISOM_LANGUAGE_CODE_SANSKRIT = LSMASH_PACK_ISO_LANGUAGE( 's', 'a', 'n' ), ISOM_LANGUAGE_CODE_MARATHI = LSMASH_PACK_ISO_LANGUAGE( 'm', 'a', 'r' ), ISOM_LANGUAGE_CODE_BENGALI = LSMASH_PACK_ISO_LANGUAGE( 'b', 'e', 'n' ), ISOM_LANGUAGE_CODE_ASSAMESE = LSMASH_PACK_ISO_LANGUAGE( 'a', 's', 'm' ), ISOM_LANGUAGE_CODE_GUJARATI = LSMASH_PACK_ISO_LANGUAGE( 'g', 'u', 'j' ), ISOM_LANGUAGE_CODE_PUNJABI = LSMASH_PACK_ISO_LANGUAGE( 'p', 'a', 'n' ), ISOM_LANGUAGE_CODE_ORIYA = LSMASH_PACK_ISO_LANGUAGE( 'o', 'r', 'i' ), ISOM_LANGUAGE_CODE_MALAYALAM = LSMASH_PACK_ISO_LANGUAGE( 'm', 'a', 'l' ), ISOM_LANGUAGE_CODE_KANNADA = LSMASH_PACK_ISO_LANGUAGE( 'k', 'a', 'n' ), ISOM_LANGUAGE_CODE_TAMIL = LSMASH_PACK_ISO_LANGUAGE( 't', 'a', 'm' ), ISOM_LANGUAGE_CODE_TELUGU = LSMASH_PACK_ISO_LANGUAGE( 't', 'e', 'l' ), ISOM_LANGUAGE_CODE_SINHALESE = LSMASH_PACK_ISO_LANGUAGE( 's', 'i', 'n' ), ISOM_LANGUAGE_CODE_BURMESE = LSMASH_PACK_ISO_LANGUAGE( 'm', 'y', 'a' ), ISOM_LANGUAGE_CODE_KHMER = LSMASH_PACK_ISO_LANGUAGE( 'k', 'h', 'm' ), ISOM_LANGUAGE_CODE_LAO = LSMASH_PACK_ISO_LANGUAGE( 'l', 'a', 'o' ), ISOM_LANGUAGE_CODE_VIETNAMESE = LSMASH_PACK_ISO_LANGUAGE( 'v', 'i', 'e' ), ISOM_LANGUAGE_CODE_INDONESIAN = LSMASH_PACK_ISO_LANGUAGE( 'i', 'n', 'd' ), ISOM_LANGUAGE_CODE_TAGALOG = LSMASH_PACK_ISO_LANGUAGE( 't', 'g', 'l' ), ISOM_LANGUAGE_CODE_MALAY_ROMAN = LSMASH_PACK_ISO_LANGUAGE( 'm', 's', 'a' ), ISOM_LANGUAGE_CODE_MAYAY_ARABIC = LSMASH_PACK_ISO_LANGUAGE( 'm', 's', 'a' ), ISOM_LANGUAGE_CODE_AMHARIC = LSMASH_PACK_ISO_LANGUAGE( 'a', 'm', 'h' ), ISOM_LANGUAGE_CODE_OROMO = LSMASH_PACK_ISO_LANGUAGE( 'o', 'r', 'm' ), ISOM_LANGUAGE_CODE_SOMALI = LSMASH_PACK_ISO_LANGUAGE( 's', 'o', 'm' ), ISOM_LANGUAGE_CODE_SWAHILI = LSMASH_PACK_ISO_LANGUAGE( 's', 'w', 'a' ), ISOM_LANGUAGE_CODE_KINYARWANDA = LSMASH_PACK_ISO_LANGUAGE( 'k', 'i', 'n' ), ISOM_LANGUAGE_CODE_RUNDI = LSMASH_PACK_ISO_LANGUAGE( 'r', 'u', 'n' ), ISOM_LANGUAGE_CODE_CHEWA = LSMASH_PACK_ISO_LANGUAGE( 'n', 'y', 'a' ), ISOM_LANGUAGE_CODE_MALAGASY = LSMASH_PACK_ISO_LANGUAGE( 'm', 'l', 'g' ), ISOM_LANGUAGE_CODE_ESPERANTO = LSMASH_PACK_ISO_LANGUAGE( 'e', 'p', 'o' ), ISOM_LANGUAGE_CODE_WELSH = LSMASH_PACK_ISO_LANGUAGE( 'c', 'y', 'm' ), ISOM_LANGUAGE_CODE_BASQUE = LSMASH_PACK_ISO_LANGUAGE( 'e', 'u', 's' ), ISOM_LANGUAGE_CODE_CATALAN = LSMASH_PACK_ISO_LANGUAGE( 'c', 'a', 't' ), ISOM_LANGUAGE_CODE_LATIN = LSMASH_PACK_ISO_LANGUAGE( 'l', 'a', 't' ), ISOM_LANGUAGE_CODE_QUECHUA = LSMASH_PACK_ISO_LANGUAGE( 'q', 'u', 'e' ), ISOM_LANGUAGE_CODE_GUARANI = LSMASH_PACK_ISO_LANGUAGE( 'g', 'r', 'n' ), ISOM_LANGUAGE_CODE_AYMARA = LSMASH_PACK_ISO_LANGUAGE( 'a', 'y', 'm' ), ISOM_LANGUAGE_CODE_TATAR = LSMASH_PACK_ISO_LANGUAGE( 'c', 'r', 'h' ), ISOM_LANGUAGE_CODE_UIGHUR = LSMASH_PACK_ISO_LANGUAGE( 'u', 'i', 'g' ), ISOM_LANGUAGE_CODE_DZONGKHA = LSMASH_PACK_ISO_LANGUAGE( 'd', 'z', 'o' ), ISOM_LANGUAGE_CODE_JAVANESE = LSMASH_PACK_ISO_LANGUAGE( 'j', 'a', 'v' ), ISOM_LANGUAGE_CODE_UNDEFINED = LSMASH_PACK_ISO_LANGUAGE( 'u', 'n', 'd' ), } lsmash_iso_language_code; typedef struct { lsmash_media_type handler_type; /* the nature of the media * You can't change handler_type through this parameter manually. */ uint32_t timescale; /* media timescale: timescale for this media */ uint64_t duration; /* the duration of this media, expressed in the media timescale * You can't set this parameter manually. */ uint8_t roll_grouping; /* roll recovery grouping present * Require 'avc1' brand, or ISO Base Media File Format version 2 or later. */ uint8_t rap_grouping; /* random access point grouping present * Require ISO Base Media File Format version 6 or later. */ /* Use either type of language code. */ uint16_t MAC_language; /* Macintosh language code for this media */ uint16_t ISO_language; /* ISO 639-2/T language code for this media */ /* human-readable name for the track type (for debugging and inspection purposes) */ char *media_handler_name; char *data_handler_name; /* Any user shouldn't use the following parameters. */ PRIVATE char media_handler_name_shadow[256]; PRIVATE char data_handler_name_shadow[256]; } lsmash_media_parameters_t; typedef struct { uint32_t index; /* the index of a data reference */ char *location; /* URL; location of referenced media file */ /* Probably, additional string fields such as thing to indicate URN will be added in the future. */ } lsmash_data_reference_t; /* Set all the given media parameters to default. */ void lsmash_initialize_media_parameters ( lsmash_media_parameters_t *param /* the address of the media parameters to which you want to set default value */ ); /* Set media parameters to a track. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_set_media_parameters ( lsmash_root_t *root, /* the address of a ROOT containing a track to which you want to set the media parameters */ uint32_t track_ID, /* the track_ID of a track to which you want to set the media parameters */ lsmash_media_parameters_t *param /* the address of the media parameters you want to set to a track. */ ); /* Set the duration of the last sample to a track. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_set_last_sample_delta ( lsmash_root_t *root, uint32_t track_ID, uint32_t sample_delta ); /* Flush samples in the internal pool in a track. * Users shall call this function for each track before calling lsmash_finish_movie() or lsmash_create_fragment_movie(). * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_flush_pooled_samples ( lsmash_root_t *root, uint32_t track_ID, uint32_t last_sample_delta ); /* Update the modification time of a media to the most recent. * If the creation time of that media is larger than the modification time, * then override the creation one with the modification one. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_update_media_modification_time ( lsmash_root_t *root, uint32_t track_ID ); /* Get the media parameters in a track. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_get_media_parameters ( lsmash_root_t *root, uint32_t track_ID, lsmash_media_parameters_t *param ); /* Get the duration of a media. * * Return the duration of a media if successful. * Return 0 otherwise. */ uint64_t lsmash_get_media_duration ( lsmash_root_t *root, uint32_t track_ID ); /* Get the timescale of a media. * * Return the timescale of a media if successful. * Return 0 otherwise. */ uint32_t lsmash_get_media_timescale ( lsmash_root_t *root, uint32_t track_ID ); /* Get the duration of the last sample in a track. * * Return the duration of the last sample in a track if successful. * Return 0 otherwise. */ uint32_t lsmash_get_last_sample_delta ( lsmash_root_t *root, uint32_t track_ID ); /* Get the composition time offset of the first sample in a track. * * Return the composition time offset of the first sample in a track if successful. * Return 0 otherwise. */ uint32_t lsmash_get_start_time_offset ( lsmash_root_t *root, uint32_t track_ID ); /* Get the shift of composition timeline to decode timeline in a track. * * Return the shift of composition timeline to decode timeline in a track. if successful. * Return 0 otherwise. */ uint32_t lsmash_get_composition_to_decode_shift ( lsmash_root_t *root, uint32_t track_ID ); /* Pack a string of ISO 639-2/T language code into 16-bit data. * * Return a packed 16-bit ISO 639-2/T language if successful. * Return 0 otherwise. */ uint16_t lsmash_pack_iso_language ( char *iso_language /* a string of ISO 639-2/T language code */ ); /* Count the number of data references in a track. * * Return the number of data references in a track if no error. * Return 0 otherwise. */ uint32_t lsmash_count_data_reference ( lsmash_root_t *root, uint32_t track_ID ); /* Get the location of a data reference in a track by specifying the index in 'data_ref'. * The string fields in 'data_ref' may be allocated if referencing external media data. * If referencing self-contained media data, the all string fields are set to NULL. * You can deallocate the allocated fields by lsmash_free(). * Also you can deallocate all of the allocated fields by lsmash_cleanup_data_reference() at a time. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_get_data_reference ( lsmash_root_t *root, uint32_t track_ID, lsmash_data_reference_t *data_ref ); /* Deallocate all of allocated fields in a given data reference at a time. * The deallocated fields are set to NULL. */ void lsmash_cleanup_data_reference ( lsmash_data_reference_t *data_ref ); /* Create a data reference in a track and specify its location on playback for writing. * If no settings for data references in a track, the location of the first data reference is specified to * the location of the same file implicitly. * Note that referenced files shall be used as a media, i.e. LSMASH_FILE_MODE_MEDIA shall be set to the 'mode' * in the lsmash_file_parameters_t before calling lsmash_set_file(). * * As restrictions of the libary, * WARNING1: The box structured media files cannot be used as a reference data yet. * WARNING2: The external media files cannot be used as a reference data for movie fragments yet. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_create_data_reference ( lsmash_root_t *root, uint32_t track_ID, lsmash_data_reference_t *data_ref, lsmash_file_t *file ); /* Assign a data reference in a track to a read file. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_assign_data_reference ( lsmash_root_t *root, uint32_t track_ID, uint32_t data_ref_index, lsmash_file_t *file ); /**************************************************************************** * Track Layer ****************************************************************************/ /* Track mode */ typedef enum { /* In MP4 and/or ISO base media file format, if in a presentation all tracks have neither track_in_movie nor track_in_preview set, * then all tracks shall be treated as if both flags were set on all tracks. */ ISOM_TRACK_ENABLED = 0x000001, /* Track_enabled: Indicates that the track is enabled. * A disabled track is treated as if it were not present. */ ISOM_TRACK_IN_MOVIE = 0x000002, /* Track_in_movie: Indicates that the track is used in the presentation. */ ISOM_TRACK_IN_PREVIEW = 0x000004, /* Track_in_preview: Indicates that the track is used when previewing the presentation. */ QT_TRACK_IN_POSTER = 0x000008, /* Track_in_poster: Indicates that the track is used in the movie's poster. (only defined in QuickTime file format) */ } lsmash_track_mode; typedef struct { lsmash_track_mode mode; uint32_t track_ID; /* an integer that uniquely identifies the track * Don't set to value already used except for zero value. * Zero value don't override established track_ID. */ uint64_t duration; /* the duration of this track expressed in the movie timescale units * If there is any edit, your setting is ignored. */ int16_t alternate_group; /* an integer that specifies a group or collection of tracks * If this field is not 0, it should be the same for tracks that contain alternate data for one another * and different for tracks belonging to different such groups. * Only one track within an alternate group should be played or streamed at any one time. * Note: alternate_group is ignored when a file is read as an MPEG-4. */ /* The following parameters are ignored when a file is read as an MPEG-4 or 3GPP file format. */ int16_t video_layer; /* the front-to-back ordering of video tracks; tracks with lower numbers are closer to the viewer. */ int16_t audio_volume; /* fixed point 8.8 number. 0x0100 is full volume. */ int32_t matrix[9]; /* transformation matrix for the video * Each value represents, in order, a, b, u, c, d, v, x, y and w. * All the values in a matrix are stored as 16.16 fixed-point values, * except for u, v and w, which are stored as 2.30 fixed-point values. * Not all derived specifications use matrices. * If a matrix is used, the point (p, q) is transformed into (p', q') using the matrix as follows: * | a b u | * (p, q, 1) * | c d v | = z * (p', q', 1) * | x y w | * p' = (a * p + c * q + x) / z; q' = (b * p + d * q + y) / z; z = u * p + v * q + w * Note: transformation matrix is applied after scaling to display size up to display_width and display_height. */ /* visual presentation region size */ uint32_t display_width; /* visual presentation region size of horizontal direction as fixed point 16.16 number. */ uint32_t display_height; /* visual presentation region size of vertical direction as fixed point 16.16 number. */ /* */ uint8_t aperture_modes; /* track aperture modes present * This feature is only available under QuickTime file format. * Automatically disabled if multiple sample description is present or scaling method is specified. */ } lsmash_track_parameters_t; /* Explicit Timeline Map (Edit) * There are two types of timeline; one is the media timeline, the other is the presentation timeline (or the movie timeline). * An edit maps the presentation timeline to the media timeline. * Therefore, an edit can select any portion within the media and specify its playback speed. * The media within the track is played through the presentation timeline, so you can construct any complex presentation from a media by edits. * In the absence of any edit, there is an implicit one-to-one mapping of these timelines, and the presentation of a track starts at the beginning of the presentation. * Note: any edit doesn't restrict decoding and composition. So, if a sample in an edit need to decode from a sample in outside of that edit, * the decoder shall start to decode from there but player shall not display any sample in outside of that edit. */ #define ISOM_EDIT_MODE_NORMAL (1<<16) #define ISOM_EDIT_MODE_DWELL 0 #define ISOM_EDIT_MODE_EMPTY -1 #define ISOM_EDIT_DURATION_UNKNOWN32 0xffffffff #define ISOM_EDIT_DURATION_UNKNOWN64 0xffffffffffffffff #define ISOM_EDIT_DURATION_IMPLICIT 0 typedef struct { uint64_t duration; /* the duration of this edit expressed in the movie timescale units * An edit can refer to the media within fragmented tracks. * The duration can be unknown at the time of creation of the initial movie due to various limiting factors that include * real-time generation of content, such as live streaming. In such a case it is recommended that the duration is set to * either ISOM_EDIT_DURATION_UNKNOWN32 (the maximum 32-bit unsigned integer), ISOM_EDIT_DURATION_UNKNOWN64 (the maximum * 64-bit unsigned integer) or ISOM_EDIT_DURATION_IMPLICIT. * If you have no interest in the duration of this edit but want to set the offset from media composition time to movie * presentation time, ISOM_EDIT_DURATION_IMPLICIT is useful for the provision of the offset for the movie and subsequent * movie fragments. The duration is expected to be constructed by demuxer. */ int64_t start_time; /* the starting composition time within the media of this edit * If set to ISOM_EDIT_MODE_EMPTY (-1), it construct an empty edit, which doesn't select any portion within the media. */ int32_t rate; /* the relative rate at which to play the media corresponding to this edit, expressed as 16.16 fixed-point number * If set to ISOM_EDIT_MODE_NORMAL (0x00010000), there is no rate change for timeline mapping. * If set to ISOM_EDIT_MODE_DWELL (0), the media at start_time is presented for the duration. */ } lsmash_edit_t; /* Create a track in a movie. * Users can destroy the created track by lsmash_delete_track(). * When a track is created, its track_ID is assigned automatically so that any duplication of track_ID may be avoided. * * Return the current track_ID of a track created by this function if successful. * Return 0 otherwise. */ uint32_t lsmash_create_track ( lsmash_root_t *root, lsmash_media_type media_type ); /* Destroy the track of a given track_ID in a movie. */ void lsmash_delete_track ( lsmash_root_t *root, uint32_t track_ID ); /* Set all the given track parameters to default. */ void lsmash_initialize_track_parameters ( lsmash_track_parameters_t *param ); /* Set track parameters to a track. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_set_track_parameters ( lsmash_root_t *root, uint32_t track_ID, lsmash_track_parameters_t *param ); /* Update the duration of a track with a new duration of its last sample. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_update_track_duration ( lsmash_root_t *root, uint32_t track_ID, uint32_t last_sample_delta ); /* Update the modification time of a track to the most recent. * If the creation time of that track is larger than the modification time, * then override the creation one with the modification one. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_update_track_modification_time ( lsmash_root_t *root, uint32_t track_ID ); /* Get a track_ID by a track number. * A track number is given in created order in a movie. * If a track is removed, the track number of tracks with higher track number than one of just removed track will be decremented. * * Return a track_ID if successful. * Return 0 otherwise. */ uint32_t lsmash_get_track_ID ( lsmash_root_t *root, uint32_t track_number ); /* Get the track parameters in a track. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_get_track_parameters ( lsmash_root_t *root, uint32_t track_ID, lsmash_track_parameters_t *param ); /* Get the duration of a track. * * Return the duration of a track if successful. * Return 0 otherwise. */ uint64_t lsmash_get_track_duration ( lsmash_root_t *root, uint32_t track_ID ); /* Create an explicit timeline map (edit) and append it into a track. * Users can destroy ALL created edits in a track by lsmash_delete_explicit_timeline_map(). * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_create_explicit_timeline_map ( lsmash_root_t *root, uint32_t track_ID, lsmash_edit_t edit ); /* Destroy ALL created edits in a track. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_delete_explicit_timeline_map ( lsmash_root_t *root, uint32_t track_ID ); /* Count the number of edits in a track. * * Return the number of edits in a track if successful. * Return 0 otherwise. */ uint32_t lsmash_count_explicit_timeline_map ( lsmash_root_t *root, uint32_t track_ID ); /* Get an edit in a track by an edit number. * An edit number is given in created order in a track. * If an edit is removed, the edit number of edits with higher edit number than one of just removed edit will be decremented. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_get_explicit_timeline_map ( lsmash_root_t *root, uint32_t track_ID, uint32_t edit_number, lsmash_edit_t *edit ); /* Modify an edit in a track by an edit number. * An edit number is given in created order in a track. * If an edit is removed, the edit number of edits with higher edit number than one of just removed edit will be decremented. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_modify_explicit_timeline_map ( lsmash_root_t *root, uint32_t track_ID, uint32_t edit_number, lsmash_edit_t edit ); /**************************************************************************** * Movie Layer ****************************************************************************/ typedef struct { uint32_t timescale; /* movie timescale: timescale for the entire presentation */ uint64_t duration; /* the duration, expressed in movie timescale, of the longest track * You can't set this parameter manually. */ uint32_t number_of_tracks; /* the number of tracks in the movie * You can't set this parameter manually. */ /* The following parameters are recognized only when a file is read as an Apple MPEG-4 or QuickTime file format. */ int32_t playback_rate; /* fixed point 16.16 number. 0x00010000 is normal forward playback and default value. */ int32_t playback_volume; /* fixed point 8.8 number. 0x0100 is full volume and default value. */ int32_t preview_time; /* the time value in the movie at which the preview begins */ int32_t preview_duration; /* the duration of the movie preview in movie timescale units */ int32_t poster_time; /* the time value of the time of the movie poster */ } lsmash_movie_parameters_t; /* Set all the given movie parameters to default. */ void lsmash_initialize_movie_parameters ( lsmash_movie_parameters_t *param ); /* Set movie parameters to a movie. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_set_movie_parameters ( lsmash_root_t *root, lsmash_movie_parameters_t *param ); /* Finalize a movie. * If the movie is not fragmented and 'remux' is set to non-NULL, * move overall necessary data to access and decode samples into the very front of the file at the end. * This is useful for progressive downloading. * Users shall call lsmash_flush_pooled_samples() for each track before calling this function. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_finish_movie ( lsmash_root_t *root, lsmash_adhoc_remux_t *remux ); /* Update the modification time of a movie to the most recent. * If the creation time of that movie is larger than the modification time, * then override the creation one with the modification one. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_update_movie_modification_time ( lsmash_root_t *root ); /* Get the movie parameters in a movie. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_get_movie_parameters ( lsmash_root_t *root, lsmash_movie_parameters_t *param ); /* Get the timescale of a movie. * * Return the timescale of a movie if successful. * Return 0 otherwise. */ uint32_t lsmash_get_movie_timescale ( lsmash_root_t *root ); /**************************************************************************** * Chapter list ****************************************************************************/ /* Create a track as a chapter list referenced by another track. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_create_reference_chapter_track ( lsmash_root_t *root, uint32_t track_ID, char *file_name ); /* Create and set a chapter list as a user data to a movie. * The created chapter list in a movie can be destroyed by lsmash_delete_tyrant_chapter(). * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_set_tyrant_chapter ( lsmash_root_t *root, char *file_name, int add_bom ); /* Destroy a chapter list as a user data in a movie. */ void lsmash_delete_tyrant_chapter ( lsmash_root_t *root ); /* Count chapters in the chapter list (moov.udta.chpl). */ uint32_t lsmash_count_tyrant_chapter ( lsmash_root_t *root ); /* Retrieve a chapter entry from the chapter list (moov.udta.chpl). * Returned pointer is owned by the ROOT structure, so user shall not * modify or free it. * * Return chapter title string if successful, otherwise NULL. */ char *lsmash_get_tyrant_chapter ( lsmash_root_t *root, uint32_t index, /* index of chapter ( >= 1) */ double *timestamp /* timestamp of the chapter entry (in seconds) */ ); /**************************************************************************** * Fragments ****************************************************************************/ /* Flush the current movie fragment and create a new movie fragment. * Users shall call lsmash_flush_pooled_samples() for each track before calling this function. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_create_fragment_movie ( lsmash_root_t *root ); /* Create an empty duration track in the current movie fragment. * Don't specify track_ID any track fragment in the current movie fragment has. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_create_fragment_empty_duration ( lsmash_root_t *root, uint32_t track_ID, uint32_t duration ); #ifdef LSMASH_DEMUXER_ENABLED /**************************************************************************** * Dump / Print ****************************************************************************/ /* Dump and print box structure of ROOT into the destination. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_print_movie ( lsmash_root_t *root, /* the address of ROOT you want to dump and print */ const char *filename /* the path of a file as the destination */ ); /* Print a chapter list written as a user data on stdout. * This function might output BOM on Windows. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_print_chapter_list ( lsmash_root_t *root ); /**************************************************************************** * Timeline ****************************************************************************/ /* Copy all edits from the source track to the destination track. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_copy_timeline_map ( lsmash_root_t *dst, uint32_t dst_track_ID, lsmash_root_t *src, uint32_t src_track_ID ); /* Construct the timeline for a track. * The constructed timeline can be destructed by lsmash_destruct_timeline(). * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_construct_timeline ( lsmash_root_t *root, uint32_t track_ID ); /* Destruct the timeline for a given track. */ void lsmash_destruct_timeline ( lsmash_root_t *root, uint32_t track_ID ); /* Get the duration of the last sample from the media timeline for a track. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_get_last_sample_delta_from_media_timeline ( lsmash_root_t *root, uint32_t track_ID, uint32_t *last_sample_delta /* the address of a variable to which the duration of the last sample will be set */ ); /* Get the duration of a sample from the media timeline for a track. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_get_sample_delta_from_media_timeline ( lsmash_root_t *root, uint32_t track_ID, uint32_t sample_number, uint32_t *sample_delta /* the address of a variable to which the duration of a sample will be set */ ); /* Get the decoding timestamp of a sample from the media timeline for a track. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_get_dts_from_media_timeline ( lsmash_root_t *root, uint32_t track_ID, uint32_t sample_number, uint64_t *dts /* the address of a variable to which a decoding timestamp will be set */ ); /* Get the composition timestamp of a sample from the media timeline for a track. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_get_cts_from_media_timeline ( lsmash_root_t *root, uint32_t track_ID, uint32_t sample_number, uint64_t *cts /* the address of a variable to which a composition timestamp will be set */ ); /* Get the shift of composition timeline to decode timeline from the media timeline for a track. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_get_composition_to_decode_shift_from_media_timeline ( lsmash_root_t *root, uint32_t track_ID, uint32_t *ctd_shift /* the address of a variable to which the shift of composition timeline to decode timeline will be set */ ); /* Get the sample number which is the closest random accessible point to the sample * corresponding to a given sample number from the media timeline for a track. * This function tries to find the closest random accessible point from the past at the first. * If not found, try to find it from the future. * Note: * the closest random accessible point doesn't always guarantee that * the sample corresponding to a given number can be decodable correctly by decoding from there. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_get_closest_random_accessible_point_from_media_timeline ( lsmash_root_t *root, uint32_t track_ID, uint32_t sample_number, uint32_t *rap_number /* the address of a variable to which the sample number of the closest random accessible point will be set */ ); /* Get the detailed information of the closest random accessible point to the sample * corresponding to a given sample number from the media timeline for a track. * Note: * the closest random accessible point doesn't always guarantee that * the sample corresponding to a given number can be decodable correctly by decoding from there. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_get_closest_random_accessible_point_detail_from_media_timeline ( lsmash_root_t *root, uint32_t track_ID, uint32_t sample_number, uint32_t *rap_number, /* the address of a variable to which the sample number of the closest random accessible point will be set */ lsmash_random_access_flag *ra_flags, /* the address of a variable to which the flags of the closest random accessible point will be set */ uint32_t *leading, /* the address of a variable to which the number of leading samples will be set */ uint32_t *distance /* the address of a variable to which a distance from the closest random accessible point to a point which guarantees * that the sample corresponding to a given number can be decodable correctly by decoding from there will be set */ ); /* Get the number of samples in the media timeline for a track. * * Return the number of samples in a track if successful. * Return 0 otherwise. */ uint32_t lsmash_get_sample_count_in_media_timeline ( lsmash_root_t *root, uint32_t track_ID ); /* Get the maximum size of sample in the media timeline for a track. * * Return the maximum size of the samples in a track if successful. * Return 0 otherwise. */ uint32_t lsmash_get_max_sample_size_in_media_timeline ( lsmash_root_t *root, uint32_t track_ID ); /* Get the duration of the media from the media timeline for a track. * * Return the duration of the media in a track if successful. * Return 0 otherwise. */ uint64_t lsmash_get_media_duration_from_media_timeline ( lsmash_root_t *root, uint32_t track_ID ); /* Allocate and get the sample corresponding to a given sample number from the media timeline for a track. * The allocated sample can be deallocated by lsmash_delete_sample(). * * Return the address of an allocated and gotten sample if successful. * Return NULL otherwise. */ lsmash_sample_t *lsmash_get_sample_from_media_timeline ( lsmash_root_t *root, uint32_t track_ID, uint32_t sample_number ); /* Get the information of the sample correspondint to a given sample number from the media timeline for a track. * The information includes the size, timestamps and properties of the sample. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_get_sample_info_from_media_timeline ( lsmash_root_t *root, uint32_t track_ID, uint32_t sample_number, lsmash_sample_t *sample ); /* Get the properties of the sample correspondint to a given sample number from the media timeline for a track. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_get_sample_property_from_media_timeline ( lsmash_root_t *root, uint32_t track_ID, uint32_t sample_number, lsmash_sample_property_t *prop ); /* Check if the sample corresponding to a given sample number exists in the media timeline for a track. * * Return 1 if the sample exists. * Return 0 otherwise. */ int lsmash_check_sample_existence_in_media_timeline ( lsmash_root_t *root, uint32_t track_ID, uint32_t sample_number ); /* Set or change the decoding and composition timestamps in the media timeline for a track. * This function doesn't support for any LPCM track currently. * * Return 0 if successful. * Return a negative value othewise. */ int lsmash_set_media_timestamps ( lsmash_root_t *root, uint32_t track_ID, lsmash_media_ts_list_t *ts_list ); /* Allocate and get the decoding and composition timestamps from the media timeline for a track. * The allocated decoding and composition timestamps can be deallocated by lsmash_delete_media_timestamps(). * * Return 0 if successful. * Return a negative value othewise. */ int lsmash_get_media_timestamps ( lsmash_root_t *root, uint32_t track_ID, lsmash_media_ts_list_t *ts_list ); /* Deallocate the decoding and composition timestamps in a given media timestamp list. */ void lsmash_delete_media_timestamps ( lsmash_media_ts_list_t *ts_list ); /* Get the maximum composition delay derived from composition reordering. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_get_max_sample_delay ( lsmash_media_ts_list_t *ts_list, uint32_t *max_sample_delay ); /* Sort decoding and composition timestamps in decoding order. */ void lsmash_sort_timestamps_decoding_order ( lsmash_media_ts_list_t *ts_list ); /* Sort decoding and composition timestamps in composition order. */ void lsmash_sort_timestamps_composition_order ( lsmash_media_ts_list_t *ts_list ); #endif /**************************************************************************** * Tools for creating CODEC Specific Information Extensions (Magic Cookies) ****************************************************************************/ /* MPEG-4 Systems Specific Information * Mandatory : * ISOM_CODEC_TYPE_MP4A_AUDIO * QT_CODEC_TYPE_MP4A_AUDIO * ISOM_CODEC_TYPE_MP4V_AUDIO * ISOM_CODEC_TYPE_MP4S_AUDIO */ /* objectTypeIndication */ typedef enum { MP4SYS_OBJECT_TYPE_Forbidden = 0x00, /* Forbidden */ MP4SYS_OBJECT_TYPE_Systems_ISO_14496_1 = 0x01, /* Systems ISO/IEC 14496-1 * For all 14496-1 streams unless specifically indicated to the contrary. * Scene Description scenes, which are identified with StreamType=0x03, using * this object type value shall use the BIFSConfig. */ MP4SYS_OBJECT_TYPE_Systems_ISO_14496_1_BIFSv2 = 0x02, /* Systems ISO/IEC 14496-1 * This object type shall be used, with StreamType=0x03, for Scene * Description streams that use the BIFSv2Config. * Its use with other StreamTypes is reserved. */ MP4SYS_OBJECT_TYPE_Interaction_Stream = 0x03, /* Interaction Stream */ MP4SYS_OBJECT_TYPE_Extended_BIFS = 0x04, /* Extended BIFS * Used, with StreamType=0x03, for Scene Description streams that use the BIFSConfigEx; * its use with other StreamTypes is reserved. * (Was previously reserved for MUCommandStream but not used for that purpose.) */ MP4SYS_OBJECT_TYPE_AFX_Stream = 0x05, /* AFX Stream * Used, with StreamType=0x03, for Scene Description streams that use the AFXConfig; * its use with other StreamTypes is reserved. */ MP4SYS_OBJECT_TYPE_Font_Data_Stream = 0x06, /* Font Data Stream */ MP4SYS_OBJECT_TYPE_Synthetised_Texture = 0x07, /* Synthetised Texture */ MP4SYS_OBJECT_TYPE_Text_Stream = 0x08, /* Text Stream */ MP4SYS_OBJECT_TYPE_Visual_ISO_14496_2 = 0x20, /* Visual ISO/IEC 14496-2 * The actual object types are within the DecoderSpecificInfo and defined in 14496-2. */ MP4SYS_OBJECT_TYPE_Visual_H264_ISO_14496_10 = 0x21, /* Visual ITU-T Recommendation H.264 | ISO/IEC 14496-10 * The actual object types are within the DecoderSpecificInfo and defined in H.264 | 14496-10. */ MP4SYS_OBJECT_TYPE_Parameter_Sets_H_264_ISO_14496_10 = 0x22, /* Parameter Sets for ITU-T Recommendation H.264 | ISO/IEC 14496-10 * The actual object types are within the DecoderSpecificInfo and defined in H.264 | 14496-10. */ MP4SYS_OBJECT_TYPE_Audio_ISO_14496_3 = 0x40, /* Audio ISO/IEC 14496-3 (MPEG-4 Audio) * The actual object types are defined in 14496-3 and are in the DecoderSpecificInfo as specified in 14496-3. */ MP4SYS_OBJECT_TYPE_Visual_ISO_13818_2_Simple_Profile = 0x60, /* Visual ISO/IEC 13818-2 Simple Profile (MPEG-2 Video) */ MP4SYS_OBJECT_TYPE_Visual_ISO_13818_2_Main_Profile = 0x61, /* Visual ISO/IEC 13818-2 Main Profile */ MP4SYS_OBJECT_TYPE_Visual_ISO_13818_2_SNR_Profile = 0x62, /* Visual ISO/IEC 13818-2 SNR Profile */ MP4SYS_OBJECT_TYPE_Visual_ISO_13818_2_Spatial_Profile = 0x63, /* Visual ISO/IEC 13818-2 Spatial Profile */ MP4SYS_OBJECT_TYPE_Visual_ISO_13818_2_High_Profile = 0x64, /* Visual ISO/IEC 13818-2 High Profile */ MP4SYS_OBJECT_TYPE_Visual_ISO_13818_2_422_Profile = 0x65, /* Visual ISO/IEC 13818-2 422 Profile */ MP4SYS_OBJECT_TYPE_Audio_ISO_13818_7_Main_Profile = 0x66, /* Audio ISO/IEC 13818-7 Main Profile (MPEG-2 Audio)(AAC) */ MP4SYS_OBJECT_TYPE_Audio_ISO_13818_7_LC_Profile = 0x67, /* Audio ISO/IEC 13818-7 LowComplexity Profile */ MP4SYS_OBJECT_TYPE_Audio_ISO_13818_7_SSR_Profile = 0x68, /* Audio ISO/IEC 13818-7 Scaleable Sampling Rate Profile * For streams kinda 13818-7 the decoder specific information consists of the ADIF header if present * (or none if not present) and an access unit is a "raw_data_block()" as defined in 13818-7. */ MP4SYS_OBJECT_TYPE_Audio_ISO_13818_3 = 0x69, /* Audio ISO/IEC 13818-3 (MPEG-2 BC-Audio)(redefined MPEG-1 Audio in MPEG-2) * For streams kinda 13818-3 the decoder specific information is empty since all necessary data is in the bitstream frames itself. * The access units in this case are the "frame()" bitstream element as is defined in 11172-3. */ MP4SYS_OBJECT_TYPE_Visual_ISO_11172_2 = 0x6A, /* Visual ISO/IEC 11172-2 (MPEG-1 Video) */ MP4SYS_OBJECT_TYPE_Audio_ISO_11172_3 = 0x6B, /* Audio ISO/IEC 11172-3 (MPEG-1 Audio) */ MP4SYS_OBJECT_TYPE_Visual_ISO_10918_1 = 0x6C, /* Visual ISO/IEC 10918-1 (JPEG) */ MP4SYS_OBJECT_TYPE_PNG = 0x6D, /* Portable Network Graphics */ MP4SYS_OBJECT_TYPE_Visual_ISO_15444_1_JPEG2000 = 0x6E, /* Visual ISO/IEC 15444-1 (JPEG 2000) */ /* FIXME: rename these symbols to be explaining, rather than based on four cc */ MP4SYS_OBJECT_TYPE_EVRC_AUDIO = 0xA0, /* EVRC Voice */ MP4SYS_OBJECT_TYPE_SSMV_AUDIO = 0xA1, /* SMV Voice */ MP4SYS_OBJECT_TYPE_3GPP2_CMF = 0xA2, /* 3GPP2 Compact Multimedia Format (CMF) */ MP4SYS_OBJECT_TYPE_VC_1_VIDEO = 0xA3, /* SMPTE VC-1 Video */ MP4SYS_OBJECT_TYPE_DRAC_VIDEO = 0xA4, /* Dirac Video Coder */ MP4SYS_OBJECT_TYPE_AC_3_AUDIO = 0xA5, /* AC-3 Audio */ MP4SYS_OBJECT_TYPE_EC_3_AUDIO = 0xA6, /* Enhanced AC-3 audio */ MP4SYS_OBJECT_TYPE_DRA1_AUDIO = 0xA7, /* DRA Audio */ MP4SYS_OBJECT_TYPE_G719_AUDIO = 0xA8, /* ITU G.719 Audio */ MP4SYS_OBJECT_TYPE_DTSC_AUDIO = 0xA9, /* DTS Coherent Acoustics audio */ MP4SYS_OBJECT_TYPE_DTSH_AUDIO = 0xAA, /* DTS-HD High Resolution Audio */ MP4SYS_OBJECT_TYPE_DTSL_AUDIO = 0xAB, /* DTS-HD Master Audio */ MP4SYS_OBJECT_TYPE_DTSE_AUDIO = 0xAC, /* DTS Express low bit rate audio, also known as DTS LBR */ MP4SYS_OBJECT_TYPE_SQCP_AUDIO = 0xE1, /* 13K Voice */ MP4SYS_OBJECT_TYPE_NONE = 0xFF, /* no object type specified * Streams with this value with a StreamType indicating a systems stream (values 1,2,3,6,7,8,9) * shall be treated as if the ObjectTypeIndication had been set to 0x01. */ } lsmash_mp4sys_object_type_indication; /* streamType */ typedef enum { MP4SYS_STREAM_TYPE_Forbidden = 0x00, /* Forbidden */ MP4SYS_STREAM_TYPE_ObjectDescriptorStream = 0x01, /* ObjectDescriptorStream */ MP4SYS_STREAM_TYPE_ClockReferenceStream = 0x02, /* ClockReferenceStream */ MP4SYS_STREAM_TYPE_SceneDescriptionStream = 0x03, /* SceneDescriptionStream */ MP4SYS_STREAM_TYPE_VisualStream = 0x04, /* VisualStream */ MP4SYS_STREAM_TYPE_AudioStream = 0x05, /* AudioStream */ MP4SYS_STREAM_TYPE_MPEG7Stream = 0x06, /* MPEG7Stream */ MP4SYS_STREAM_TYPE_IPMPStream = 0x07, /* IPMPStream */ MP4SYS_STREAM_TYPE_ObjectContentInfoStream = 0x08, /* ObjectContentInfoStream */ MP4SYS_STREAM_TYPE_MPEGJStream = 0x09, /* MPEGJStream */ MP4SYS_STREAM_TYPE_InteractionStream = 0x0A, /* Interaction Stream */ MP4SYS_STREAM_TYPE_IPMPToolStream = 0x0B, /* IPMPToolStream */ MP4SYS_STREAM_TYPE_FontDataStream = 0x0C, /* FontDataStream */ MP4SYS_STREAM_TYPE_StreamingText = 0x0D, /* StreamingText */ } lsmash_mp4sys_stream_type; /* MPEG-4 Systems Decoder Specific Information * an opaque container with information for a specific media decoder * The existence and semantics of decoder specific information depends on the values of streamType and objectTypeIndication. */ typedef struct lsmash_mp4sys_decoder_specific_info_tag lsmash_mp4sys_decoder_specific_info_t; /* Note: bufferSizeDB, maxBitrate and avgBitrate are calculated internally when calling lsmash_finish_movie(). * You need not to set up them manually when muxing streams by L-SMASH. */ typedef struct { lsmash_mp4sys_object_type_indication objectTypeIndication; lsmash_mp4sys_stream_type streamType; uint32_t bufferSizeDB; /* the size of the decoding buffer for this elementary stream in byte */ uint32_t maxBitrate; /* the maximum bitrate in bits per second of the elementary stream in * any time window of one second duration */ uint32_t avgBitrate; /* the average bitrate in bits per second of the elementary stream * Set to 0 if the stream is encoded as variable bitrate. */ lsmash_mp4sys_decoder_specific_info_t *dsi; /* zero or one decoder specific information */ } lsmash_mp4sys_decoder_parameters_t; int lsmash_set_mp4sys_decoder_specific_info ( lsmash_mp4sys_decoder_parameters_t *param, uint8_t *payload, uint32_t payload_length ); void lsmash_destroy_mp4sys_decoder_specific_info ( lsmash_mp4sys_decoder_parameters_t *param ); uint8_t *lsmash_create_mp4sys_decoder_config ( lsmash_mp4sys_decoder_parameters_t *param, uint32_t *data_length ); /* Return MP4SYS_OBJECT_TYPE_Forbidden if objectTypeIndication is not found or there is an error to find it. */ lsmash_mp4sys_object_type_indication lsmash_mp4sys_get_object_type_indication ( lsmash_summary_t *summary ); /* Return -1 if any error. * Even if the decoder specific information is not found, it is not an error since no decoder specific information is allowed for some stream formats. */ int lsmash_get_mp4sys_decoder_specific_info ( lsmash_mp4sys_decoder_parameters_t *param, uint8_t **payload, uint32_t *payload_length ); /* AC-3 Specific Information * Mandatory : * ISOM_CODEC_TYPE_AC_3_AUDIO * * Unlike MPEG-4 Audio formats, the decoder does not require this for the initialization. * Each AC-3 sample is self-contained. * Users shall set the actual sample rate to 'frequency', which is a member of lsmash_audio_summary_t. */ typedef struct { uint8_t fscod; /* the same value as the fscod field in the AC-3 bitstream */ uint8_t bsid; /* the same value as the bsid field in the AC-3 bitstream */ uint8_t bsmod; /* the same value as the bsmod field in the AC-3 bitstream */ uint8_t acmod; /* the same value as the acmod field in the AC-3 bitstream */ uint8_t lfeon; /* the same value as the lfeon field in the AC-3 bitstream */ uint8_t frmsizecod; /* the same value as the frmsizecod field in the AC-3 bitstream */ } lsmash_ac3_specific_parameters_t; int lsmash_setup_ac3_specific_parameters_from_syncframe ( lsmash_ac3_specific_parameters_t *param, uint8_t *data, uint32_t data_length ); uint8_t *lsmash_create_ac3_specific_info ( lsmash_ac3_specific_parameters_t *param, uint32_t *data_length ); /* Enhanced AC-3 Specific Information * Mandatory : * ISOM_CODEC_TYPE_EC_3_AUDIO * * Unlike MPEG-4 Audio formats, the decoder does not require this for the initialization. * Each Enhanced AC-3 sample is self-contained. * Note that this cannot document reduced sample rates (24000, 22050 or 16000 Hz). * Therefore, users shall set the actual sample rate to 'frequency', which is a member of lsmash_audio_summary_t. */ typedef struct { uint8_t fscod; /* the same value as the fscod field in the independent substream */ uint8_t bsid; /* the same value as the bsid field in the independent substream */ uint8_t bsmod; /* the same value as the bsmod field in the independent substream * If the bsmod field is not present in the independent substream, this field shall be set to 0. */ uint8_t acmod; /* the same value as the acmod field in the independent substream */ uint8_t lfeon; /* the same value as the lfeon field in the independent substream */ uint8_t num_dep_sub; /* the number of dependent substreams that are associated with the independent substream */ uint16_t chan_loc; /* channel locations of dependent substreams associated with the independent substream * This information is extracted from the chanmap field of each dependent substream. */ } lsmash_eac3_substream_info_t; typedef struct { uint16_t data_rate; /* the data rate of the Enhanced AC-3 bitstream in kbit/s * If the Enhanced AC-3 stream is variable bitrate, then this value indicates the maximum data rate of the stream. */ uint8_t num_ind_sub; /* the number of independent substreams that are present in the Enhanced AC-3 bitstream * The value of this field is one less than the number of independent substreams present * and shall be in the range of 0 to 7, inclusive. */ lsmash_eac3_substream_info_t independent_info[8]; } lsmash_eac3_specific_parameters_t; int lsmash_setup_eac3_specific_parameters_from_frame ( lsmash_eac3_specific_parameters_t *param, uint8_t *data, uint32_t data_length ); uint16_t lsmash_eac3_get_chan_loc_from_chanmap ( uint16_t chanmap ); uint8_t *lsmash_create_eac3_specific_info ( lsmash_eac3_specific_parameters_t *param, uint32_t *data_length ); /* DTS Audio Specific Information * Mandatory : * ISOM_CODEC_TYPE_DTSC_AUDIO * ISOM_CODEC_TYPE_DTSH_AUDIO * ISOM_CODEC_TYPE_DTSL_AUDIO * ISOM_CODEC_TYPE_DTSE_AUDIO * * Unlike MPEG-4 Audio formats, the decoder does not require this for the initialization. * Each DTS Audio sample is self-contained. */ typedef enum { DTS_CORE_SUBSTREAM_CORE_FLAG = 0x00000001, DTS_CORE_SUBSTREAM_XXCH_FLAG = 0x00000002, DTS_CORE_SUBSTREAM_X96_FLAG = 0x00000004, DTS_CORE_SUBSTREAM_XCH_FLAG = 0x00000008, DTS_EXT_SUBSTREAM_CORE_FLAG = 0x00000010, DTS_EXT_SUBSTREAM_XBR_FLAG = 0x00000020, DTS_EXT_SUBSTREAM_XXCH_FLAG = 0x00000040, DTS_EXT_SUBSTREAM_X96_FLAG = 0x00000080, DTS_EXT_SUBSTREAM_LBR_FLAG = 0x00000100, DTS_EXT_SUBSTREAM_XLL_FLAG = 0x00000200, } lsmash_dts_construction_flag; typedef struct lsmash_dts_reserved_box_tag lsmash_dts_reserved_box_t; typedef struct { uint32_t DTSSamplingFrequency; /* the maximum sampling frequency stored in the compressed audio stream * 'frequency', which is a member of lsmash_audio_summary_t, shall be set according to DTSSamplingFrequency of either: * 48000 for original sampling frequencies of 24000Hz, 48000Hz, 96000Hz or 192000Hz; * 44100 for original sampling frequencies of 22050Hz, 44100Hz, 88200Hz or 176400Hz; * 32000 for original sampling frequencies of 16000Hz, 32000Hz, 64000Hz or 128000Hz. */ uint32_t maxBitrate; /* the peak bit rate, in bits per second, of the audio elementary stream for the duration of the track, * including the core substream (if present) and all extension substreams. * If the stream is a constant bit rate, this parameter shall have the same value as avgBitrate. * If the maximum bit rate is unknown, this parameter shall be set to 0. */ uint32_t avgBitrate; /* the average bit rate, in bits per second, of the audio elementary stream for the duration of the track, * including the core substream and any extension substream that may be present. */ uint8_t pcmSampleDepth; /* the bit depth of the rendered audio * The value is 16 or 24 bits. */ uint8_t FrameDuration; /* the number of audio samples decoded in a complete audio access unit at DTSSamplingFrequency * 0: 512, 1: 1024, 2: 2048, 3: 4096 */ uint8_t StreamConstruction; /* complete information on the existence and of location of extensions in any synchronized frame */ uint8_t CoreLFEPresent; /* the presence of an LFE channel in the core * 0: none * 1: LFE exists */ uint8_t CoreLayout; /* the channel layout of the core within the core substream * If no core substream exists, this parameter shall be ignored and ChannelLayout or * RepresentationType shall be used to determine channel configuration. */ uint16_t CoreSize; /* The size of a core substream AU in bytes. * If no core substream exists, CoreSize = 0. */ uint8_t StereoDownmix; /* the presence of an embedded stereo downmix in the stream * 0: none * 1: embedded downmix present */ uint8_t RepresentationType; /* This indicates special properties of the audio presentation. * 0: Audio asset designated for mixing with another audio asset * 2: Lt/Rt Encoded for matrix surround decoding * 3: Audio processed for headphone playback * otherwise: Reserved * If ChannelLayout != 0, this value shall be ignored. */ uint16_t ChannelLayout; /* complete information on channels coded in the audio stream including core and extensions */ uint8_t MultiAssetFlag; /* This flag shall set if the stream contains more than one asset. * 0: single asset * 1: multiple asset * When multiple assets exist, the remaining parameters only reflect the coding parameters of the first asset. */ uint8_t LBRDurationMod; /* This flag indicates a special case of the LBR coding bandwidth, resulting in 1/3 or 2/3 band limiting. * If set to 1, LBR frame duration is 50 % larger than indicated in FrameDuration */ lsmash_dts_reserved_box_t *box; } lsmash_dts_specific_parameters_t; int lsmash_setup_dts_specific_parameters_from_frame ( lsmash_dts_specific_parameters_t *param, uint8_t *data, uint32_t data_length ); uint8_t lsmash_dts_get_stream_construction ( lsmash_dts_construction_flag flags ); lsmash_dts_construction_flag lsmash_dts_get_construction_flags ( uint8_t stream_construction ); lsmash_codec_type_t lsmash_dts_get_codingname ( lsmash_dts_specific_parameters_t *param ); uint8_t *lsmash_create_dts_specific_info ( lsmash_dts_specific_parameters_t *param, uint32_t *data_length ); int lsmash_append_dts_reserved_box ( lsmash_dts_specific_parameters_t *param, uint8_t *box_data, uint32_t box_size ); void lsmash_remove_dts_reserved_box ( lsmash_dts_specific_parameters_t *param ); /* Apple Lossless Audio Specific Information * Mandatory : * ISOM_CODEC_TYPE_ALAC_AUDIO * QT_CODEC_TYPE_ALAC_AUDIO */ typedef struct { uint32_t frameLength; /* the frames per packet when no explicit frames per packet setting is present in the packet header * The encoder frames per packet can be explicitly set but for maximum compatibility, * the default encoder setting of 4096 should be used. */ uint8_t bitDepth; /* the bit depth of the source PCM data (maximum value = 32) */ uint8_t numChannels; /* the channel count (1 = mono, 2 = stereo, etc...) * When channel layout info is not provided in the Channel Layout extension, * a channel count > 2 describes a set of discreet channels with no specific ordering. */ uint32_t maxFrameBytes; /* the maximum size of an Apple Lossless packet within the encoded stream * Value of 0 indicates unknown. */ uint32_t avgBitrate; /* the average bit rate in bits per second of the Apple Lossless stream * Value of 0 indicates unknown. */ uint32_t sampleRate; /* sample rate of the encoded stream */ } lsmash_alac_specific_parameters_t; uint8_t *lsmash_create_alac_specific_info ( lsmash_alac_specific_parameters_t *param, uint32_t *data_length ); /* MPEG-4 Bitrate Information. * Optional : * ISOM_CODEC_TYPE_AVC1_VIDEO * ISOM_CODEC_TYPE_AVC2_VIDEO * ISOM_CODEC_TYPE_AVC3_VIDEO * ISOM_CODEC_TYPE_AVC4_VIDEO * ISOM_CODEC_TYPE_HVC1_VIDEO * ISOM_CODEC_TYPE_HEV1_VIDEO * * Though you need not to set these fields manually since lsmash_finish_movie() calls the function * that calculates these values internally, these fields are optional. * Therefore, if you want to add this info, append this as an extension via LSMASH_CODEC_SPECIFIC_DATA_TYPE_ISOM_VIDEO_H264_BITRATE at least. */ typedef struct { uint32_t bufferSizeDB; /* the size of the decoding buffer for the elementary stream in bytes */ uint32_t maxBitrate; /* the maximum rate in bits/second over any window of one second */ uint32_t avgBitrate; /* the average rate in bits/second over the entire presentation */ } lsmash_h264_bitrate_t; /* Appendability of NAL unit into Decoder Configuration Record */ typedef enum { DCR_NALU_APPEND_NEW_SAMPLE_ENTRY_REQUIRED = -3, /* A new sample description entry is needed because e.g. visual presentation size changes. */ DCR_NALU_APPEND_NEW_DCR_REQUIRED = -2, /* A new Decoder Configuration Record is needed. */ DCR_NALU_APPEND_ERROR = -1, /* something of errors */ DCR_NALU_APPEND_DUPLICATED = 0, /* The same NAL unit is in the Decoder Configuration Record. */ DCR_NALU_APPEND_POSSIBLE = 1, /* It is possible to append the NAL unit into the Decoder Configuration Record. */ } lsmash_dcr_nalu_appendable; /* H.264/AVC Specific Information * Mandatory : * ISOM_CODEC_TYPE_AVC1_VIDEO * ISOM_CODEC_TYPE_AVC2_VIDEO * ISOM_CODEC_TYPE_AVC3_VIDEO * ISOM_CODEC_TYPE_AVC4_VIDEO * * All members in lsmash_h264_specific_parameters_t except for lengthSizeMinusOne shall be automatically set up * when appending SPS NAL units by calling lsmash_append_h264_parameter_set(). */ typedef enum { H264_PARAMETER_SET_TYPE_SPS = 0, /* SPS (Sequence Parameter Set) */ H264_PARAMETER_SET_TYPE_PPS = 1, /* PPS (Picture Parameter Set) */ H264_PARAMETER_SET_TYPE_SPSEXT = 2, /* SPS Ext (Sequence Parameter Set Extension) */ /* The number of the NAL unit types defined for AVC Decoder Configuration Record */ H264_PARAMETER_SET_TYPE_NUM } lsmash_h264_parameter_set_type; typedef struct lsmash_h264_parameter_sets_tag lsmash_h264_parameter_sets_t; typedef struct { uint8_t AVCProfileIndication; /* profile_idc in sequence parameter sets * This field must indicate a profile to which the stream associated with * this configuration record conforms. * Note: there is no profile to which the entire stream conforms, then * the entire stream must be split into two or more sub-streams with * separate configuration records in which these rules can be met. */ uint8_t profile_compatibility; /* constraint_set_flags in sequence parameter sets * The each bit may only be set if all the included parameter sets set that flag. */ uint8_t AVCLevelIndication; /* level_idc in sequence parameter sets * This field must indicate a level of capability equal to or greater than * the highest level indicated in the included parameter sets. */ uint8_t lengthSizeMinusOne; /* the length in bytes of the NALUnitLength field prior to NAL unit * The value of this field shall be one of 0, 1, or 3 * corresponding to a length encoded with 1, 2, or 4 bytes, respectively. * NALUnitLength indicates the size of a NAL unit measured in bytes, * and includes the size of both the one byte NAL header and the EBSP payload * but does not include the length field itself. */ /* chroma format and bit depth information * These fields must be identical in all the parameter sets. */ uint8_t chroma_format; /* chroma_format_idc in sequence parameter sets */ uint8_t bit_depth_luma_minus8; /* bit_depth_luma_minus8 in sequence parameter sets */ uint8_t bit_depth_chroma_minus8; /* bit_depth_chroma_minus8 in sequence parameter sets */ /* a set of arrays to carry initialization NAL units * The NAL unit types are restricted to indicate SPS, PPS and SPS Ext NAL units only. */ lsmash_h264_parameter_sets_t *parameter_sets; } lsmash_h264_specific_parameters_t; int lsmash_setup_h264_specific_parameters_from_access_unit ( lsmash_h264_specific_parameters_t *param, uint8_t *data, uint32_t data_length ); void lsmash_destroy_h264_parameter_sets ( lsmash_h264_specific_parameters_t *param ); lsmash_dcr_nalu_appendable lsmash_check_h264_parameter_set_appendable ( lsmash_h264_specific_parameters_t *param, lsmash_h264_parameter_set_type ps_type, void *ps_data, uint32_t ps_length ); int lsmash_append_h264_parameter_set ( lsmash_h264_specific_parameters_t *param, lsmash_h264_parameter_set_type ps_type, void *ps_data, uint32_t ps_length ); uint8_t *lsmash_create_h264_specific_info ( lsmash_h264_specific_parameters_t *param, uint32_t *data_length ); /* H.265/HEVC Specific Information * Mandatory : * ISOM_CODEC_TYPE_HVC1_VIDEO * ISOM_CODEC_TYPE_HEV1_VIDEO * * All members in lsmash_hevc_specific_parameters_t except for avgFrameRate and lengthSizeMinusOne shall be * automatically set up when appending VPS and SPS NAL units by calling lsmash_append_hevc_dcr_nalu(). * It is recommended that you should append VPS, SPS and PPS in this order so that a parameter set can reference * another parameter set. */ typedef enum { /* Parameter sets * When the CODEC identifier ISOM_CODEC_TYPE_HVC1_VIDEO is used, at least one parameter set for each array * of parameter set shall be in the configuration record. */ HEVC_DCR_NALU_TYPE_VPS = 0, /* VPS (Video Parameter Set) */ HEVC_DCR_NALU_TYPE_SPS = 1, /* SPS (Sequence Parameter Set) */ HEVC_DCR_NALU_TYPE_PPS = 2, /* PPS (Picture Parameter Set) */ /* SEI (Supplemental Enhancement Information) * Only the 'declarative' SEI messages that provide information about the stream as * a whole are allowed because SEIs themselves basically have no identifier and * no one can reference dynamically in a configuration record. */ HEVC_DCR_NALU_TYPE_PREFIX_SEI = 3, /* Prefix SEI */ HEVC_DCR_NALU_TYPE_SUFFIX_SEI = 4, /* Suffix SEI */ /* The number of the NAL unit types defined for HEVC Decoder Configuration Record */ HEVC_DCR_NALU_TYPE_NUM } lsmash_hevc_dcr_nalu_type; typedef struct lsmash_hevc_parameter_arrays_tag lsmash_hevc_parameter_arrays_t; typedef struct { /* general profile, tier and level from VPS and/or SPS */ uint8_t general_profile_space; /* general_profile_space * The value in all the parameter sets must be identical. */ uint8_t general_tier_flag; /* general_tier_flag * The value must indicate a tier equal to or greater than the highest * tier indicated in all the parameter sets. */ uint8_t general_profile_idc; /* general_profile_idc * The value must indicate a profile to which the stream associated with * this configuration record conforms. * Note: there is no profile to which the entire stream conforms, then * the entire stream must be split into two or more sub-streams with * separate configuration records in which these rules can be met. */ uint32_t general_profile_compatibility_flags; /* general_profile_compatibility_flag[j] for j from 0 to 31 * The each bit may only be set if all the parameter sets set that bit. */ uint64_t general_constraint_indicator_flags; /* the 6 bytes starting with the byte containing the general_progressive_source_flag * The each bit may only be set if all the parameter sets set that bit. */ uint8_t general_level_idc; /* general_level_idc * The value must indicate a level of capability equal to or greater * than the highest level indicated for the highest tier in all the * parameter sets. */ /* */ uint16_t min_spatial_segmentation_idc; /* min_spatial_segmentation_idc in VUI (Video Usability Information) * The value must indicate a level of spatial segmentation equal to * or less than the lowest level of spatial segmentation indicated in * all the parameter sets. */ uint8_t parallelismType; /* parallelismType indicates the type of parallelism that is used to meet the * restrictions imposed by min_spatial_segmentation_idc when the value of * min_spatial_segmentation_idc is greater than 0. * For the stream to which this configuration record applies, * 0: mixed types of parallel decoding or parallelism type is unknown * 1: slice based parallel decoding * 2: tile based parallel decoding * 3: entropy coding synchronization based parallel decoding * (WPP: Wavefront Parallel Processing) */ /* chroma format and bit depth information * These fields must be identical in all the parameter sets. */ uint8_t chromaFormat; /* chroma_format_idc in sequence parameter sets */ uint8_t bitDepthLumaMinus8; /* bit_depth_luma_minus8 in sequence parameter sets */ uint8_t bitDepthChromaMinus8; /* bit_depth_chroma_minus8 in sequence parameter sets */ /* miscellaneous */ uint16_t avgFrameRate; /* the average frame rate in units of frames/(256 seconds) * Value 0 indicates an unspecified average frame rate. */ uint8_t constantFrameRate; /* 0: the stream may or may not be of constant frame rate. * 1: that the stream to which this configuration record applies is of * constant frame rate * 2: the representation of each temporal layer in the stream is of * constant frame rate. */ uint8_t numTemporalLayers; /* 0: it is unknown whether the stream is temporally scalable. * 1: the stream is not temporally scalable. * otherwise: the stream to which this configuration record applies is * temporally scalable and the contained number of temporal layers * (also referred to as temporal sublayer or sub-layer) is equal * is equal to numTemporalLayers. */ uint8_t temporalIdNested; /* 0: at least one of the SPSs that are activated when the stream to which * this configuration record applies is decoded has sps_temporal_id_nesting_flag * equal to 0. * 1: all SPSs that are activated when the stream to which this configuration * record applies is decoded have sps_temporal_id_nesting_flag equal to 1 * and temporal sub-layer up-switching to any higher temporal layer can be * performed at any sample. * Any step-wise temporal sub-layer access picture shall not be present in * the sequences to which this configuration record applies. */ uint8_t lengthSizeMinusOne; /* the length in bytes of the NALUnitLength field prior to NAL unit * The value of this field shall be one of 0, 1, or 3 * corresponding to a length encoded with 1, 2, or 4 bytes, respectively. * NALUnitLength indicates the size of a NAL unit measured in bytes, * and includes the size of both the one byte NAL header and the EBSP payload * but does not include the length field itself. */ /* a set of arrays to carry initialization NAL units * The NAL unit types are restricted to indicate VPS, SPS, PPS, and SEI NAL units only. */ lsmash_hevc_parameter_arrays_t *parameter_arrays; } lsmash_hevc_specific_parameters_t; int lsmash_setup_hevc_specific_parameters_from_access_unit ( lsmash_hevc_specific_parameters_t *param, uint8_t *data, uint32_t data_length ); void lsmash_destroy_hevc_parameter_arrays ( lsmash_hevc_specific_parameters_t *param ); lsmash_dcr_nalu_appendable lsmash_check_hevc_dcr_nalu_appendable ( lsmash_hevc_specific_parameters_t *param, lsmash_hevc_dcr_nalu_type ps_type, void *ps_data, uint32_t ps_length ); int lsmash_append_hevc_dcr_nalu ( lsmash_hevc_specific_parameters_t *param, lsmash_hevc_dcr_nalu_type ps_type, void *ps_data, uint32_t ps_length ); int lsmash_set_hevc_array_completeness ( lsmash_hevc_specific_parameters_t *param, lsmash_hevc_dcr_nalu_type ps_type, int array_completeness ); int lsmash_get_hevc_array_completeness ( lsmash_hevc_specific_parameters_t *param, lsmash_hevc_dcr_nalu_type ps_type, int *array_completeness ); uint8_t *lsmash_create_hevc_specific_info ( lsmash_hevc_specific_parameters_t *param, uint32_t *data_length ); /* VC-1 Specific Information * Mandatory : * ISOM_CODEC_TYPE_VC_1_VIDEO * * We support only advanced profile at present. */ typedef struct lsmash_vc1_header_tag lsmash_vc1_header_t; typedef struct { /* Note: multiple_sequence, multiple_entry, slice_present and bframe_present shall be decided through overall VC-1 bitstream. */ uint8_t profile; /* the encoding profile used in the VC-1 bitstream * 0: simple profile (not supported) * 4: main profile (not supported) * 12: advanced profile * Currently, only 12 for advanced profile is available. */ uint8_t level; /* the highest encoding level used in the VC-1 bitstream */ uint8_t cbr; /* 0: non-constant bitrate model * 1: constant bitrate model */ uint8_t interlaced; /* 0: interlaced coding of frames is not used. * 1: frames may use interlaced coding. */ uint8_t multiple_sequence; /* 0: the track contains no sequence headers (stored only in VC-1 specific info structure), * or * all sequence headers in the track are identical to the sequence header that is specified in the seqhdr field. * In this case, random access points are samples that contain an entry-point header. * 1: the track may contain Sequence headers that are different from the sequence header specified in the seqhdr field. * In this case, random access points are samples that contain both a sequence Header and an entry-point header. */ uint8_t multiple_entry; /* 0: all entry-point headers in the track are identical to the entry-point header that is specified in the ephdr field. * 1: the track may contain entry-point headers that are different from the entry-point header specified in the ephdr field. */ uint8_t slice_present; /* 0: frames are not coded as multiple slices. * 1: frames may be coded as multiple slices. */ uint8_t bframe_present; /* 0: neither B-frames nor BI-frames are present in the track. * 1: B-frames or BI-frames may be present in the track. */ uint32_t framerate; /* the rounded frame rate (frames per second) of the track * Should be set to 0xffffffff if the frame rate is not known, unspecified, or non-constant. */ lsmash_vc1_header_t *seqhdr; /* a sequence header EBDU (mandatory) */ lsmash_vc1_header_t *ephdr; /* an entry-point header EBDU (mandatory) */ } lsmash_vc1_specific_parameters_t; int lsmash_setup_vc1_specific_parameters_from_access_unit ( lsmash_vc1_specific_parameters_t *param, uint8_t *data, uint32_t data_length ); void lsmash_destroy_vc1_headers ( lsmash_vc1_specific_parameters_t *param ); int lsmash_put_vc1_header ( lsmash_vc1_specific_parameters_t *param, void *hdr_data, uint32_t hdr_length ); uint8_t *lsmash_create_vc1_specific_info ( lsmash_vc1_specific_parameters_t *param, uint32_t *data_length ); /* Sample scaling * Without this extension, video samples are scaled into the visual presentation region to fill it. */ typedef enum { ISOM_SCALE_METHOD_FILL = 1, ISOM_SCALE_METHOD_HIDDEN = 2, ISOM_SCALE_METHOD_MEET = 3, ISOM_SCALE_METHOD_SLICE_X = 4, ISOM_SCALE_METHOD_SLICE_Y = 5, } lsmash_scale_method; typedef struct { uint8_t constraint_flag; /* Upper 7-bits are reserved. * If this flag is set, all samples described by this sample entry shall be scaled * according to the method specified by the field 'scale_method'. */ lsmash_scale_method scale_method; /* The semantics of the values for scale_method are as specified for the 'fit' attribute of regions in SMIL 1.0. */ int16_t display_center_x; int16_t display_center_y; } lsmash_isom_sample_scale_t; /* QuickTime Video CODEC tools */ typedef enum { QT_COMPRESSION_QUALITY_LOSSLESS = 0x00000400, /* only valid for spatial compression */ QT_COMPRESSION_QUALITY_MAX = 0x000003FF, QT_COMPRESSION_QUALITY_MIN = 0x00000000, QT_COMPRESSION_QUALITY_LOW = 0x00000100, QT_COMPRESSION_QUALITY_NORMAL = 0x00000200, QT_COMPRESSION_QUALITY_HIGH = 0x00000300 } lsmash_qt_compression_quality; typedef struct { uint32_t seed; /* Must be set to 0. */ uint16_t flags; /* Must be set to 0x8000. */ uint16_t size; /* the number of colors in the following color array * This is a zero-relative value; * setting this field to 0 means that there is one color in the array. */ /* Color array * An array of colors. Each color is made of four unsigned 16-bit integers. * We support up to 256 elements. */ struct { uint16_t unused; /* Must be set to 0. */ /* true color */ uint16_t r; /* magnitude of red component */ uint16_t g; /* magnitude of green component */ uint16_t b; /* magnitude of blue component */ } array[256]; } lsmash_qt_color_table_t; typedef struct { int16_t revision_level; /* version of the CODEC */ int32_t vendor; /* whose CODEC */ lsmash_qt_compression_quality temporalQuality; /* the temporal quality factor (0-1023) */ lsmash_qt_compression_quality spatialQuality; /* the spatial quality factor (0-1024) */ uint32_t horizontal_resolution; /* a 16.16 fixed-point number containing the horizontal resolution of the image in pixels per inch. */ uint32_t vertical_resolution; /* a 16.16 fixed-point number containing the vertical resolution of the image in pixels per inch. */ uint32_t dataSize; /* if known, the size of data for this descriptor */ uint16_t frame_count; /* frame per sample */ int16_t color_table_ID; /* color table ID * If this field is set to -1, the default color table should be used for the specified depth * If the color table ID is set to 0, a color table is contained within the sample description itself. * The color table immediately follows the color table ID field. */ lsmash_qt_color_table_t color_table; /* a list of preferred colors for displaying the movie on devices that support only 256 colors */ } lsmash_qt_video_common_t; typedef struct { uint32_t level; /* A fixed-point 16.16 number indicating the gamma level at which the image was captured. */ } lsmash_qt_gamma_t; typedef enum { QT_FIELEDS_SCAN_PROGRESSIVE = 1, /* progressive scan */ QT_FIELEDS_SCAN_INTERLACED = 2, /* 2:1 interlaced */ } lsmash_qt_number_of_fields; /* field ordering for interlaced material */ typedef enum { QT_FIELD_ORDERINGS_UNKNOWN = 0, QT_FIELD_ORDERINGS_TEMPORAL_TOP_FIRST = 1, QT_FIELD_ORDERINGS_TEMPORAL_BOTTOM_FIRST = 6, QT_FIELD_ORDERINGS_SPATIAL_FIRST_LINE_EARLY = 9, QT_FIELD_ORDERINGS_SPATIAL_FIRST_LINE_LATE = 14 } lsmash_qt_field_orderings; typedef struct { lsmash_qt_number_of_fields fields; lsmash_qt_field_orderings detail; } lsmash_qt_field_info_t; /* the native pixel format */ typedef enum { QT_PIXEL_FORMAT_TYPE_1_MONOCHROME = 0x00000001, /* 1 bit indexed */ QT_PIXEL_FORMAT_TYPE_2_INDEXED = 0x00000002, /* 2 bit indexed */ QT_PIXEL_FORMAT_TYPE_4_INDEXED = 0x00000004, /* 4 bit indexed */ QT_PIXEL_FORMAT_TYPE_8_INDEXED = 0x00000008, /* 8 bit indexed */ QT_PIXEL_FORMAT_TYPE_1_INDEXED_GRAY_WHITE_IS_ZERO = 0x00000021, /* 1 bit indexed gray, white is zero */ QT_PIXEL_FORMAT_TYPE_2_INDEXED_GRAY_WHITE_IS_ZERO = 0x00000022, /* 2 bit indexed gray, white is zero */ QT_PIXEL_FORMAT_TYPE_4_INDEXED_GRAY_WHITE_IS_ZERO = 0x00000024, /* 4 bit indexed gray, white is zero */ QT_PIXEL_FORMAT_TYPE_8_INDEXED_GRAY_WHITE_IS_ZERO = 0x00000028, /* 8 bit indexed gray, white is zero */ QT_PIXEL_FORMAT_TYPE_16BE555 = 0x00000010, /* 16 bit BE RGB 555 */ QT_PIXEL_FORMAT_TYPE_16LE555 = LSMASH_4CC( 'L', '5', '5', '5' ), /* 16 bit LE RGB 555 */ QT_PIXEL_FORMAT_TYPE_16LE5551 = LSMASH_4CC( '5', '5', '5', '1' ), /* 16 bit LE RGB 5551 */ QT_PIXEL_FORMAT_TYPE_16BE565 = LSMASH_4CC( 'B', '5', '6', '5' ), /* 16 bit BE RGB 565 */ QT_PIXEL_FORMAT_TYPE_16LE565 = LSMASH_4CC( 'L', '5', '6', '5' ), /* 16 bit LE RGB 565 */ QT_PIXEL_FORMAT_TYPE_24RGB = 0x00000018, /* 24 bit RGB */ QT_PIXEL_FORMAT_TYPE_24BGR = LSMASH_4CC( '2', '4', 'B', 'G' ), /* 24 bit BGR */ QT_PIXEL_FORMAT_TYPE_32ARGB = 0x00000020, /* 32 bit ARGB */ QT_PIXEL_FORMAT_TYPE_32BGRA = LSMASH_4CC( 'B', 'G', 'R', 'A' ), /* 32 bit BGRA */ QT_PIXEL_FORMAT_TYPE_32ABGR = LSMASH_4CC( 'A', 'B', 'G', 'R' ), /* 32 bit ABGR */ QT_PIXEL_FORMAT_TYPE_32RGBA = LSMASH_4CC( 'R', 'G', 'B', 'A' ), /* 32 bit RGBA */ QT_PIXEL_FORMAT_TYPE_64ARGB = LSMASH_4CC( 'b', '6', '4', 'a' ), /* 64 bit ARGB, 16-bit big-endian samples */ QT_PIXEL_FORMAT_TYPE_48RGB = LSMASH_4CC( 'b', '4', '8', 'r' ), /* 48 bit RGB, 16-bit big-endian samples */ QT_PIXEL_FORMAT_TYPE_32_ALPHA_GRAY = LSMASH_4CC( 'b', '3', '2', 'a' ), /* 32 bit AlphaGray, 16-bit big-endian samples, black is zero */ QT_PIXEL_FORMAT_TYPE_16_GRAY = LSMASH_4CC( 'b', '1', '6', 'g' ), /* 16 bit Grayscale, 16-bit big-endian samples, black is zero */ QT_PIXEL_FORMAT_TYPE_30RGB = LSMASH_4CC( 'R', '1', '0', 'k' ), /* 30 bit RGB, 10-bit big-endian samples, 2 unused padding bits (at least significant end) */ QT_PIXEL_FORMAT_TYPE_422YpCbCr8 = LSMASH_4CC( '2', 'v', 'u', 'y' ), /* Component Y'CbCr 8-bit 4:2:2, ordered Cb Y'0 Cr Y'1 */ QT_PIXEL_FORMAT_TYPE_4444YpCbCrA8 = LSMASH_4CC( 'v', '4', '0', '8' ), /* Component Y'CbCrA 8-bit 4:4:4:4, ordered Cb Y' Cr A */ QT_PIXEL_FORMAT_TYPE_4444YpCbCrA8R = LSMASH_4CC( 'r', '4', '0', '8' ), /* Component Y'CbCrA 8-bit 4:4:4:4, rendering format. full range alpha, zero biased YUV, ordered A Y' Cb Cr */ QT_PIXEL_FORMAT_TYPE_4444AYpCbCr8 = LSMASH_4CC( 'y', '4', '0', '8' ), /* Component Y'CbCrA 8-bit 4:4:4:4, ordered A Y' Cb Cr, full range alpha, video range Y'CbCr */ QT_PIXEL_FORMAT_TYPE_4444AYpCbCr16 = LSMASH_4CC( 'y', '4', '1', '6' ), /* Component Y'CbCrA 16-bit 4:4:4:4, ordered A Y' Cb Cr, full range alpha, video range Y'CbCr, 16-bit little-endian samples */ QT_PIXEL_FORMAT_TYPE_444YpCbCr8 = LSMASH_4CC( 'v', '3', '0', '8' ), /* Component Y'CbCr 8-bit 4:4:4 */ QT_PIXEL_FORMAT_TYPE_422YpCbCr16 = LSMASH_4CC( 'v', '2', '1', '6' ), /* Component Y'CbCr 10,12,14,16-bit 4:2:2 */ QT_PIXEL_FORMAT_TYPE_422YpCbCr10 = LSMASH_4CC( 'v', '2', '1', '0' ), /* Component Y'CbCr 10-bit 4:2:2 */ QT_PIXEL_FORMAT_TYPE_444YpCbCr10 = LSMASH_4CC( 'v', '4', '1', '0' ), /* Component Y'CbCr 10-bit 4:4:4 */ QT_PIXEL_FORMAT_TYPE_420YpCbCr8_PLANAR = LSMASH_4CC( 'y', '4', '2', '0' ), /* Planar Component Y'CbCr 8-bit 4:2:0 */ QT_PIXEL_FORMAT_TYPE_420YpCbCr8_PLANAR_FULL_RANGE = LSMASH_4CC( 'f', '4', '2', '0' ), /* Planar Component Y'CbCr 8-bit 4:2:0, full range */ QT_PIXEL_FORMAT_TYPE_422YpCbCr_4A_8_BIPLANAR = LSMASH_4CC( 'a', '2', 'v', 'y' ), /* First plane: Video-range Component Y'CbCr 8-bit 4:2:2, ordered Cb Y'0 Cr Y'1; second plane: alpha 8-bit 0-255 */ QT_PIXEL_FORMAT_TYPE_420YpCbCr8_BIPLANAR_VIDEO_RANGE = LSMASH_4CC( '4', '2', '0', 'v' ), /* Bi-Planar Component Y'CbCr 8-bit 4:2:0, video-range (luma=[16,235] chroma=[16,240]) */ QT_PIXEL_FORMAT_TYPE_420YpCbCr8_BIPLANAR_FULL_RANGE = LSMASH_4CC( '4', '2', '0', 'f' ), /* Bi-Planar Component Y'CbCr 8-bit 4:2:0, full-range (luma=[0,255] chroma=[1,255]) */ QT_PIXEL_FORMAT_TYPE_422YpCbCr8_YUVS = LSMASH_4CC( 'y', 'u', 'v', 's' ), /* Component Y'CbCr 8-bit 4:2:2, ordered Y'0 Cb Y'1 Cr */ QT_PIXEL_FORMAT_TYPE_422YpCbCr8_FULL_RANGE = LSMASH_4CC( 'y', 'u', 'v', 'f' ), /* Component Y'CbCr 8-bit 4:2:2, full range, ordered Y'0 Cb Y'1 Cr */ /* Developer specific FourCCs (from dispatch 20) */ QT_PIXEL_FORMAT_TYPE_SOFTVOUT_SOFTCODEC = LSMASH_4CC( 's', 'o', 'f', 't' ), /* Intermediary pixel format used by SoftVout and SoftCodec */ QT_PIXEL_FORMAT_TYPE_VIEW_GRAPHICS = LSMASH_4CC( 'v', 'w', 'g', 'r' ), /* Intermediary pixel format used by View Graphics */ QT_PIXEL_FORMAT_TYPE_SGI = LSMASH_4CC( 'S', 'G', 'V', 'C' ), /* Intermediary pixel format used by SGI */ } lsmash_qt_pixel_format; typedef struct { lsmash_qt_pixel_format pixel_format; /* the native pixel format of an image */ } lsmash_qt_pixel_format_t; /* Significant Bits Extension * mandatory extension for 'v216' (Uncompressed Y'CbCr, 10, 12, 14, or 16-bit-per-component 4:2:2) */ typedef struct { uint8_t significantBits; /* the number of significant bits per component */ } lsmash_qt_significant_bits_t; /* QuickTime Audio CODEC tools */ typedef enum { QT_AUDIO_COMPRESSION_ID_NOT_COMPRESSED = 0, QT_AUDIO_COMPRESSION_ID_FIXED_COMPRESSION = -1, QT_AUDIO_COMPRESSION_ID_VARIABLE_COMPRESSION = -2, QT_AUDIO_COMPRESSION_ID_TWO_TO_ONE = 1, QT_AUDIO_COMPRESSION_ID_EIGHT_TO_THREE = 2, QT_AUDIO_COMPRESSION_ID_THREE_TO_ONE = 3, QT_AUDIO_COMPRESSION_ID_SIX_TO_ONE = 4, QT_AUDIO_COMPRESSION_ID_SIX_TO_ONE_PACKET_SIZE = 8, QT_AUDIO_COMPRESSION_ID_THREE_TO_ONE_PACKET_SIZE = 16, } lsmash_qt_audio_compression_id; typedef struct { int16_t revision_level; /* version of the CODEC */ int32_t vendor; /* whose CODEC */ lsmash_qt_audio_compression_id compression_ID; } lsmash_qt_audio_common_t; /* Audio Channel Layout * This CODEC specific extension is for * QuickTime Audio inside QuickTime file format * and * Apple Lossless Audio inside ISO Base Media file format. * When audio stream has 3 or more number of channels, this extension shall be present. */ typedef enum { QT_CHANNEL_LABEL_UNKNOWN = (signed)0xffffffff, /* unknown or unspecified other use */ QT_CHANNEL_LABEL_UNUSED = 0, /* channel is present, but has no intended use or destination */ QT_CHANNEL_LABEL_USE_COORDINATES = 100, /* channel is described by the coordinates fields. */ QT_CHANNEL_LABEL_LEFT = 1, QT_CHANNEL_LABEL_RIGHT = 2, QT_CHANNEL_LABEL_CENTER = 3, QT_CHANNEL_LABEL_LFE_SCREEN = 4, QT_CHANNEL_LABEL_LEFT_SURROUND = 5, /* WAVE: "Back Left" */ QT_CHANNEL_LABEL_RIGHT_SUROUND = 6, /* WAVE: "Back Right" */ QT_CHANNEL_LABEL_LEFT_CENTER = 7, QT_CHANNEL_LABEL_RIGHT_CENTER = 8, QT_CHANNEL_LABEL_CENTER_SURROUND = 9, /* WAVE: "Back Center" or plain "Rear Surround" */ QT_CHANNEL_LABEL_LEFT_SURROUND_DIRECT = 10, /* WAVE: "Side Left" */ QT_CHANNEL_LABEL_RIGHT_SURROUND_DIRECT = 11, /* WAVE: "Side Right" */ QT_CHANNEL_LABEL_TOP_CENTER_SURROUND = 12, QT_CHANNEL_LABEL_VERTICAL_HEIGHT_LEFT = 13, /* WAVE: "Top Front Left" */ QT_CHANNEL_LABEL_VERTICAL_HEIGHT_CENTER = 14, /* WAVE: "Top Front Center" */ QT_CHANNEL_LABEL_VERTICAL_HEIGHT_RIGHT = 15, /* WAVE: "Top Front Right" */ QT_CHANNEL_LABEL_TOP_BACK_LEFT = 16, QT_CHANNEL_LABEL_TOP_BACK_CENTER = 17, QT_CHANNEL_LABEL_TOP_BACK_RIGHT = 18, QT_CHANNEL_LABEL_REAR_SURROUND_LEFT = 33, QT_CHANNEL_LABEL_REAR_SURROUND_RIGHT = 34, QT_CHANNEL_LABEL_LEFT_WIDE = 35, QT_CHANNEL_LABEL_RIGHT_WIDE = 36, QT_CHANNEL_LABEL_LFE2 = 37, QT_CHANNEL_LABEL_LEFT_TOTAL = 38, /* matrix encoded 4 channels */ QT_CHANNEL_LABEL_RIGHT_TOTAL = 39, /* matrix encoded 4 channels */ QT_CHANNEL_LABEL_HEARING_IMPAIRED = 40, QT_CHANNEL_LABEL_NARRATION = 41, QT_CHANNEL_LABEL_MONO = 42, QT_CHANNEL_LABEL_DIALOG_CENTRIC_MIX = 43, QT_CHANNEL_LABEL_CENTER_SURROUND_DIRECT = 44, /* back center, non diffuse */ QT_CHANNEL_LABEL_HAPTIC = 45, /* first order ambisonic channels */ QT_CHANNEL_LABEL_AMBISONIC_W = 200, QT_CHANNEL_LABEL_AMBISONIC_X = 201, QT_CHANNEL_LABEL_AMBISONIC_Y = 202, QT_CHANNEL_LABEL_AMBISONIC_Z = 203, /* Mid/Side Recording */ QT_CHANNEL_LABEL_MS_MID = 204, QT_CHANNEL_LABEL_MS_SIDE = 205, /* X-Y Recording */ QT_CHANNEL_LABEL_XY_X = 206, QT_CHANNEL_LABEL_XY_Y = 207, /* other */ QT_CHANNEL_LABEL_HEADPHONES_LEFT = 301, QT_CHANNEL_LABEL_HEADPHONES_RIGHT = 302, QT_CHANNEL_LABEL_CLICK_TRACK = 304, QT_CHANNEL_LABEL_FOREIGN_LANGUAGE = 305, /* generic discrete channel */ QT_CHANNEL_LABEL_DISCRETE = 400, /* numbered discrete channel */ QT_CHANNEL_LABEL_DISCRETE_0 = (1<<16), QT_CHANNEL_LABEL_DISCRETE_1 = (1<<16) | 1, QT_CHANNEL_LABEL_DISCRETE_2 = (1<<16) | 2, QT_CHANNEL_LABEL_DISCRETE_3 = (1<<16) | 3, QT_CHANNEL_LABEL_DISCRETE_4 = (1<<16) | 4, QT_CHANNEL_LABEL_DISCRETE_5 = (1<<16) | 5, QT_CHANNEL_LABEL_DISCRETE_6 = (1<<16) | 6, QT_CHANNEL_LABEL_DISCRETE_7 = (1<<16) | 7, QT_CHANNEL_LABEL_DISCRETE_8 = (1<<16) | 8, QT_CHANNEL_LABEL_DISCRETE_9 = (1<<16) | 9, QT_CHANNEL_LABEL_DISCRETE_10 = (1<<16) | 10, QT_CHANNEL_LABEL_DISCRETE_11 = (1<<16) | 11, QT_CHANNEL_LABEL_DISCRETE_12 = (1<<16) | 12, QT_CHANNEL_LABEL_DISCRETE_13 = (1<<16) | 13, QT_CHANNEL_LABEL_DISCRETE_14 = (1<<16) | 14, QT_CHANNEL_LABEL_DISCRETE_15 = (1<<16) | 15, QT_CHANNEL_LABEL_DISCRETE_65535 = (1<<16) | 65535, } lsmash_channel_label; typedef enum { QT_CHANNEL_BIT_LEFT = 1, QT_CHANNEL_BIT_RIGHT = 1<<1, QT_CHANNEL_BIT_CENTER = 1<<2, QT_CHANNEL_BIT_LFE_SCREEN = 1<<3, QT_CHANNEL_BIT_LEFT_SURROUND = 1<<4, /* WAVE: "Back Left" */ QT_CHANNEL_BIT_RIGHT_SURROUND = 1<<5, /* WAVE: "Back Right" */ QT_CHANNEL_BIT_LEFT_CENTER = 1<<6, QT_CHANNEL_BIT_RIGHT_CENTER = 1<<7, QT_CHANNEL_BIT_CENTER_SURROUND = 1<<8, /* WAVE: "Back Center" */ QT_CHANNEL_BIT_LEFT_SURROUND_DIRECT = 1<<9, /* WAVE: "Side Left" */ QT_CHANNEL_BIT_RIGHT_SURROUND_DIRECT = 1<<10, /* WAVE: "Side Right" */ QT_CHANNEL_BIT_TOP_CENTER_SURROUND = 1<<11, QT_CHANNEL_BIT_VERTICAL_HEIGHT_LEFT = 1<<12, /* WAVE: "Top Front Left" */ QT_CHANNEL_BIT_VERTICAL_HEIGHT_CENTER = 1<<13, /* WAVE: "Top Front Center" */ QT_CHANNEL_BIT_VERTICAL_HEIGHT_RIGHT = 1<<14, /* WAVE: "Top Front Right" */ QT_CHANNEL_BIT_TOP_BACK_LEFT = 1<<15, QT_CHANNEL_BIT_TOP_BACK_CENTER = 1<<16, QT_CHANNEL_BIT_TOP_BACK_RIGHT = 1<<17, QT_CHANNEL_BIT_FULL = 0x3ffff, } lsmash_channel_bitmap; typedef enum { QT_CHANNEL_FLAGS_ALL_OFF = 0, QT_CHANNEL_FLAGS_RECTANGULAR_COORDINATES = 1, QT_CHANNEL_FLAGS_SPHERICAL_COORDINATES = 1<<1, QT_CHANNEL_FLAGS_METERS = 1<<2, } lsmash_channel_flags; typedef enum { /* indices for accessing the coordinates array in Channel Descriptions */ /* for rectangulare coordinates */ QT_CHANNEL_COORDINATES_LEFT_RIGHT = 0, /* Negative is left and positive is right. */ QT_CHANNEL_COORDINATES_BACK_FRONT = 1, /* Negative is back and positive is front. */ QT_CHANNEL_COORDINATES_DOWN_UP = 2, /* Negative is below ground level, 0 is ground level, and positive is above ground level. */ /* for spherical coordinates */ QT_CHANNEL_COORDINATES_AZIMUTH = 0, /* 0 is front center, positive is right, negative is left. This is measured in degrees. */ QT_CHANNEL_COORDINATES_ELEVATION = 1, /* +90 is zenith, 0 is horizontal, -90 is nadir. This is measured in degrees. */ QT_CHANNEL_COORDINATES_DISTANCE = 2, /* The units are described by flags. */ } lsmash_channel_coordinates_index; typedef enum { /* channel abbreviations: * L - left * R - right * C - center * Ls - left surround * Rs - right surround * Cs - center surround * Rls - rear left surround * Rrs - rear right surround * Lw - left wide * Rw - right wide * Lsd - left surround direct * Rsd - right surround direct * Lc - left center * Rc - right center * Ts - top surround * Vhl - vertical height left * Vhc - vertical height center * Vhr - vertical height right * Lt - left matrix total. for matrix encoded stereo. * Rt - right matrix total. for matrix encoded stereo. */ /* General layouts */ QT_CHANNEL_LAYOUT_USE_CHANNEL_DESCRIPTIONS = 0, /* use the array of Channel Descriptions to define the mapping. */ QT_CHANNEL_LAYOUT_USE_CHANNEL_BITMAP = 1<<16, /* use the bitmap to define the mapping. */ QT_CHANNEL_LAYOUT_MONO = (100<<16) | 1, /* a standard mono stream */ QT_CHANNEL_LAYOUT_STEREO = (101<<16) | 2, /* a standard stereo stream (L R) - implied playback */ QT_CHANNEL_LAYOUT_STEREO_HEADPHONES = (102<<16) | 2, /* a standard stereo stream (L R) - implied headphone playback */ QT_CHANNEL_LAYOUT_MATRIX_STEREO = (103<<16) | 2, /* a matrix encoded stereo stream (Lt, Rt) */ QT_CHANNEL_LAYOUT_MID_SIDE = (104<<16) | 2, /* mid/side recording */ QT_CHANNEL_LAYOUT_XY = (105<<16) | 2, /* coincident mic pair (often 2 figure 8's) */ QT_CHANNEL_LAYOUT_BINAURAL = (106<<16) | 2, /* binaural stereo (left, right) */ QT_CHANNEL_LAYOUT_AMBISONIC_B_FORMAT = (107<<16) | 4, /* W, X, Y, Z */ QT_CHANNEL_LAYOUT_QUADRAPHONIC = (108<<16) | 4, /* front left, front right, back left, back right */ QT_CHANNEL_LAYOUT_PENTAGONAL = (109<<16) | 5, /* left, right, rear left, rear right, center */ QT_CHANNEL_LAYOUT_HEXAGONAL = (110<<16) | 6, /* left, right, rear left, rear right, center, rear */ QT_CHANNEL_LAYOUT_OCTAGONAL = (111<<16) | 8, /* front left, front right, rear left, rear right, * front center, rear center, side left, side right */ QT_CHANNEL_LAYOUT_CUBE = (112<<16) | 8, /* left, right, rear left, rear right, * top left, top right, top rear left, top rear right */ /* MPEG defined layouts */ QT_CHANNEL_LAYOUT_MPEG_1_0 = QT_CHANNEL_LAYOUT_MONO, /* C */ QT_CHANNEL_LAYOUT_MPEG_2_0 = QT_CHANNEL_LAYOUT_STEREO, /* L R */ QT_CHANNEL_LAYOUT_MPEG_3_0_A = (113<<16) | 3, /* L R C */ QT_CHANNEL_LAYOUT_MPEG_3_0_B = (114<<16) | 3, /* C L R */ QT_CHANNEL_LAYOUT_MPEG_4_0_A = (115<<16) | 4, /* L R C Cs */ QT_CHANNEL_LAYOUT_MPEG_4_0_B = (116<<16) | 4, /* C L R Cs */ QT_CHANNEL_LAYOUT_MPEG_5_0_A = (117<<16) | 5, /* L R C Ls Rs */ QT_CHANNEL_LAYOUT_MPEG_5_0_B = (118<<16) | 5, /* L R Ls Rs C */ QT_CHANNEL_LAYOUT_MPEG_5_0_C = (119<<16) | 5, /* L C R Ls Rs */ QT_CHANNEL_LAYOUT_MPEG_5_0_D = (120<<16) | 5, /* C L R Ls Rs */ QT_CHANNEL_LAYOUT_MPEG_5_1_A = (121<<16) | 6, /* L R C LFE Ls Rs */ QT_CHANNEL_LAYOUT_MPEG_5_1_B = (122<<16) | 6, /* L R Ls Rs C LFE */ QT_CHANNEL_LAYOUT_MPEG_5_1_C = (123<<16) | 6, /* L C R Ls Rs LFE */ QT_CHANNEL_LAYOUT_MPEG_5_1_D = (124<<16) | 6, /* C L R Ls Rs LFE */ QT_CHANNEL_LAYOUT_MPEG_6_1_A = (125<<16) | 7, /* L R C LFE Ls Rs Cs */ QT_CHANNEL_LAYOUT_MPEG_7_1_A = (126<<16) | 8, /* L R C LFE Ls Rs Lc Rc */ QT_CHANNEL_LAYOUT_MPEG_7_1_B = (127<<16) | 8, /* C Lc Rc L R Ls Rs LFE (doc: IS-13818-7 MPEG2-AAC Table 3.1) */ QT_CHANNEL_LAYOUT_MPEG_7_1_C = (128<<16) | 8, /* L R C LFE Ls Rs Rls Rrs */ QT_CHANNEL_LAYOUT_EMAGIC_DEFAULT_7_1 = (129<<16) | 8, /* L R Ls Rs C LFE Lc Rc */ QT_CHANNEL_LAYOUT_SMPTE_DTV = (130<<16) | 8, /* L R C LFE Ls Rs Lt Rt */ /* ITU defined layouts */ QT_CHANNEL_LAYOUT_ITU_1_0 = QT_CHANNEL_LAYOUT_MONO, /* C */ QT_CHANNEL_LAYOUT_ITU_2_0 = QT_CHANNEL_LAYOUT_STEREO, /* L R */ QT_CHANNEL_LAYOUT_ITU_2_1 = (131<<16) | 3, /* L R Cs */ QT_CHANNEL_LAYOUT_ITU_2_2 = (132<<16) | 4, /* L R Ls Rs */ QT_CHANNEL_LAYOUT_ITU_3_0 = QT_CHANNEL_LAYOUT_MPEG_3_0_A, /* L R C */ QT_CHANNEL_LAYOUT_ITU_3_1 = QT_CHANNEL_LAYOUT_MPEG_4_0_A, /* L R C Cs */ QT_CHANNEL_LAYOUT_ITU_3_2 = QT_CHANNEL_LAYOUT_MPEG_5_0_A, /* L R C Ls Rs */ QT_CHANNEL_LAYOUT_ITU_3_2_1 = QT_CHANNEL_LAYOUT_MPEG_5_1_A, /* L R C LFE Ls Rs */ QT_CHANNEL_LAYOUT_ITU_3_4_1 = QT_CHANNEL_LAYOUT_MPEG_7_1_C, /* L R C LFE Ls Rs Rls Rrs */ /* DVD defined layouts */ QT_CHANNEL_LAYOUT_DVD_0 = QT_CHANNEL_LAYOUT_MONO, /* C (mono) */ QT_CHANNEL_LAYOUT_DVD_1 = QT_CHANNEL_LAYOUT_STEREO, /* L R */ QT_CHANNEL_LAYOUT_DVD_2 = QT_CHANNEL_LAYOUT_ITU_2_1, /* L R Cs */ QT_CHANNEL_LAYOUT_DVD_3 = QT_CHANNEL_LAYOUT_ITU_2_2, /* L R Ls Rs */ QT_CHANNEL_LAYOUT_DVD_4 = (133<<16) | 3, /* L R LFE */ QT_CHANNEL_LAYOUT_DVD_5 = (134<<16) | 4, /* L R LFE Cs */ QT_CHANNEL_LAYOUT_DVD_6 = (135<<16) | 5, /* L R LFE Ls Rs */ QT_CHANNEL_LAYOUT_DVD_7 = QT_CHANNEL_LAYOUT_MPEG_3_0_A, /* L R C */ QT_CHANNEL_LAYOUT_DVD_8 = QT_CHANNEL_LAYOUT_MPEG_4_0_A, /* L R C Cs */ QT_CHANNEL_LAYOUT_DVD_9 = QT_CHANNEL_LAYOUT_MPEG_5_0_A, /* L R C Ls Rs */ QT_CHANNEL_LAYOUT_DVD_10 = (136<<16) | 4, /* L R C LFE */ QT_CHANNEL_LAYOUT_DVD_11 = (137<<16) | 5, /* L R C LFE Cs */ QT_CHANNEL_LAYOUT_DVD_12 = QT_CHANNEL_LAYOUT_MPEG_5_1_A, /* L R C LFE Ls Rs */ /* 13 through 17 are duplicates of 8 through 12. */ QT_CHANNEL_LAYOUT_DVD_13 = QT_CHANNEL_LAYOUT_DVD_8, /* L R C Cs */ QT_CHANNEL_LAYOUT_DVD_14 = QT_CHANNEL_LAYOUT_DVD_9, /* L R C Ls Rs */ QT_CHANNEL_LAYOUT_DVD_15 = QT_CHANNEL_LAYOUT_DVD_10, /* L R C LFE */ QT_CHANNEL_LAYOUT_DVD_16 = QT_CHANNEL_LAYOUT_DVD_11, /* L R C LFE Cs */ QT_CHANNEL_LAYOUT_DVD_17 = QT_CHANNEL_LAYOUT_DVD_12, /* L R C LFE Ls Rs */ QT_CHANNEL_LAYOUT_DVD_18 = (138<<16) | 5, /* L R Ls Rs LFE */ QT_CHANNEL_LAYOUT_DVD_19 = QT_CHANNEL_LAYOUT_MPEG_5_0_B, /* L R Ls Rs C */ QT_CHANNEL_LAYOUT_DVD_20 = QT_CHANNEL_LAYOUT_MPEG_5_1_B, /* L R Ls Rs C LFE */ /* These are the symmetrical layouts. */ QT_CHANNEL_LAYOUT_AUDIO_UNIT_4 = QT_CHANNEL_LAYOUT_QUADRAPHONIC, QT_CHANNEL_LAYOUT_AUDIO_UNIT_5 = QT_CHANNEL_LAYOUT_PENTAGONAL, QT_CHANNEL_LAYOUT_AUDIO_UNIT_6 = QT_CHANNEL_LAYOUT_HEXAGONAL, QT_CHANNEL_LAYOUT_AUDIO_UNIT_8 = QT_CHANNEL_LAYOUT_OCTAGONAL, /* These are the surround-based layouts. */ QT_CHANNEL_LAYOUT_AUDIO_UNIT_5_0 = QT_CHANNEL_LAYOUT_MPEG_5_0_B, /* L R Ls Rs C */ QT_CHANNEL_LAYOUT_AUDIO_UNIT_6_0 = (139<<16) | 6, /* L R Ls Rs C Cs */ QT_CHANNEL_LAYOUT_AUDIO_UNIT_7_0 = (140<<16) | 7, /* L R Ls Rs C Rls Rrs */ QT_CHANNEL_LAYOUT_AUDIO_UNIT_7_0_FRONT = (148<<16) | 7, /* L R Ls Rs C Lc Rc */ QT_CHANNEL_LAYOUT_AUDIO_UNIT_5_1 = QT_CHANNEL_LAYOUT_MPEG_5_1_A, /* L R C LFE Ls Rs */ QT_CHANNEL_LAYOUT_AUDIO_UNIT_6_1 = QT_CHANNEL_LAYOUT_MPEG_6_1_A, /* L R C LFE Ls Rs Cs */ QT_CHANNEL_LAYOUT_AUDIO_UNIT_7_1 = QT_CHANNEL_LAYOUT_MPEG_7_1_C, /* L R C LFE Ls Rs Rls Rrs */ QT_CHANNEL_LAYOUT_AUDIO_UNIT_7_1_FRONT = QT_CHANNEL_LAYOUT_MPEG_7_1_A, /* L R C LFE Ls Rs Lc Rc */ QT_CHANNEL_LAYOUT_AAC_3_0 = QT_CHANNEL_LAYOUT_MPEG_3_0_B, /* C L R */ QT_CHANNEL_LAYOUT_AAC_QUADRAPHONIC = QT_CHANNEL_LAYOUT_QUADRAPHONIC, /* L R Ls Rs */ QT_CHANNEL_LAYOUT_AAC_4_0 = QT_CHANNEL_LAYOUT_MPEG_4_0_B, /* C L R Cs */ QT_CHANNEL_LAYOUT_AAC_5_0 = QT_CHANNEL_LAYOUT_MPEG_5_0_D, /* C L R Ls Rs */ QT_CHANNEL_LAYOUT_AAC_5_1 = QT_CHANNEL_LAYOUT_MPEG_5_1_D, /* C L R Ls Rs LFE */ QT_CHANNEL_LAYOUT_AAC_6_0 = (141<<16) | 6, /* C L R Ls Rs Cs */ QT_CHANNEL_LAYOUT_AAC_6_1 = (142<<16) | 7, /* C L R Ls Rs Cs LFE */ QT_CHANNEL_LAYOUT_AAC_7_0 = (143<<16) | 7, /* C L R Ls Rs Rls Rrs */ QT_CHANNEL_LAYOUT_AAC_7_1 = QT_CHANNEL_LAYOUT_MPEG_7_1_B, /* C Lc Rc L R Ls Rs LFE */ QT_CHANNEL_LAYOUT_AAC_OCTAGONAL = (144<<16) | 8, /* C L R Ls Rs Rls Rrs Cs */ QT_CHANNEL_LAYOUT_TMH_10_2_STD = (145<<16) | 16, /* L R C Vhc Lsd Rsd Ls Rs Vhl Vhr Lw Rw Csd Cs LFE1 LFE2 */ QT_CHANNEL_LAYOUT_TMH_10_2_FULL = (146<<16) | 21, /* TMH_10_2_std plus: Lc Rc HI VI Haptic */ QT_CHANNEL_LAYOUT_AC3_1_0_1 = (149<<16) | 2, /* C LFE */ QT_CHANNEL_LAYOUT_AC3_3_0 = (150<<16) | 3, /* L C R */ QT_CHANNEL_LAYOUT_AC3_3_1 = (151<<16) | 4, /* L C R Cs */ QT_CHANNEL_LAYOUT_AC3_3_0_1 = (152<<16) | 4, /* L C R LFE */ QT_CHANNEL_LAYOUT_AC3_2_1_1 = (153<<16) | 4, /* L R Cs LFE */ QT_CHANNEL_LAYOUT_AC3_3_1_1 = (154<<16) | 5, /* L C R Cs LFE */ QT_CHANNEL_LAYOUT_EAC_6_0_A = (155<<16) | 6, /* L C R Ls Rs Cs */ QT_CHANNEL_LAYOUT_EAC_7_0_A = (156<<16) | 7, /* L C R Ls Rs Rls Rrs */ QT_CHANNEL_LAYOUT_EAC3_6_1_A = (157<<16) | 7, /* L C R Ls Rs LFE Cs */ QT_CHANNEL_LAYOUT_EAC3_6_1_B = (158<<16) | 7, /* L C R Ls Rs LFE Ts */ QT_CHANNEL_LAYOUT_EAC3_6_1_C = (159<<16) | 7, /* L C R Ls Rs LFE Vhc */ QT_CHANNEL_LAYOUT_EAC3_7_1_A = (160<<16) | 8, /* L C R Ls Rs LFE Rls Rrs */ QT_CHANNEL_LAYOUT_EAC3_7_1_B = (161<<16) | 8, /* L C R Ls Rs LFE Lc Rc */ QT_CHANNEL_LAYOUT_EAC3_7_1_C = (162<<16) | 8, /* L C R Ls Rs LFE Lsd Rsd */ QT_CHANNEL_LAYOUT_EAC3_7_1_D = (163<<16) | 8, /* L C R Ls Rs LFE Lw Rw */ QT_CHANNEL_LAYOUT_EAC3_7_1_E = (164<<16) | 8, /* L C R Ls Rs LFE Vhl Vhr */ QT_CHANNEL_LAYOUT_EAC3_7_1_F = (165<<16) | 8, /* L C R Ls Rs LFE Cs Ts */ QT_CHANNEL_LAYOUT_EAC3_7_1_G = (166<<16) | 8, /* L C R Ls Rs LFE Cs Vhc */ QT_CHANNEL_LAYOUT_EAC3_7_1_H = (167<<16) | 8, /* L C R Ls Rs LFE Ts Vhc */ QT_CHANNEL_LAYOUT_DTS_3_1 = (168<<16) | 4, /* C L R LFE */ QT_CHANNEL_LAYOUT_DTS_4_1 = (169<<16) | 5, /* C L R Cs LFE */ QT_CHANNEL_LAYOUT_DTS_6_0_A = (170<<16) | 6, /* Lc Rc L R Ls Rs */ QT_CHANNEL_LAYOUT_DTS_6_0_B = (171<<16) | 6, /* C L R Rls Rrs Ts */ QT_CHANNEL_LAYOUT_DTS_6_0_C = (172<<16) | 6, /* C Cs L R Rls Rrs */ QT_CHANNEL_LAYOUT_DTS_6_1_A = (173<<16) | 7, /* Lc Rc L R Ls Rs LFE */ QT_CHANNEL_LAYOUT_DTS_6_1_B = (174<<16) | 7, /* C L R Rls Rrs Ts LFE */ QT_CHANNEL_LAYOUT_DTS_6_1_C = (175<<16) | 7, /* C Cs L R Rls Rrs LFE */ QT_CHANNEL_LAYOUT_DTS_7_0 = (176<<16) | 7, /* Lc C Rc L R Ls Rs */ QT_CHANNEL_LAYOUT_DTS_7_1 = (177<<16) | 8, /* Lc C Rc L R Ls Rs LFE */ QT_CHANNEL_LAYOUT_DTS_8_0_A = (178<<16) | 8, /* Lc Rc L R Ls Rs Rls Rrs */ QT_CHANNEL_LAYOUT_DTS_8_0_B = (179<<16) | 8, /* Lc C Rc L R Ls Cs Rs */ QT_CHANNEL_LAYOUT_DTS_8_1_A = (180<<16) | 9, /* Lc Rc L R Ls Rs Rls Rrs LFE */ QT_CHANNEL_LAYOUT_DTS_8_1_B = (181<<16) | 9, /* Lc C Rc L R Ls Cs Rs LFE */ QT_CHANNEL_LAYOUT_DTS_6_1_D = (182<<16) | 7, /* C L R Ls Rs LFE Cs */ QT_CHANNEL_LAYOUT_ALAC_MONO = QT_CHANNEL_LAYOUT_MONO, /* C */ QT_CHANNEL_LAYOUT_ALAC_STEREO = QT_CHANNEL_LAYOUT_STEREO, /* L R */ QT_CHANNEL_LAYOUT_ALAC_3_0 = QT_CHANNEL_LAYOUT_MPEG_3_0_B, /* C L R */ QT_CHANNEL_LAYOUT_ALAC_4_0 = QT_CHANNEL_LAYOUT_MPEG_4_0_B, /* C L R Cs */ QT_CHANNEL_LAYOUT_ALAC_5_0 = QT_CHANNEL_LAYOUT_MPEG_5_0_D, /* C L R Ls Rs */ QT_CHANNEL_LAYOUT_ALAC_5_1 = QT_CHANNEL_LAYOUT_MPEG_5_1_D, /* C L R Ls Rs LFE */ QT_CHANNEL_LAYOUT_ALAC_6_1 = QT_CHANNEL_LAYOUT_AAC_6_1, /* C L R Ls Rs Cs LFE */ QT_CHANNEL_LAYOUT_ALAC_7_1 = QT_CHANNEL_LAYOUT_MPEG_7_1_B, /* C Lc Rc L R Ls Rs LFE */ QT_CHANNEL_LAYOUT_DISCRETE_IN_ORDER = 147<<16, /* needs to be ORed with the actual number of channels */ QT_CHANNEL_LAYOUT_UNKNOWN = (signed)0xffff0000, /* needs to be ORed with the actual number of channels */ } lsmash_channel_layout_tag; typedef struct { lsmash_channel_layout_tag channelLayoutTag; /* channel layout */ lsmash_channel_bitmap channelBitmap; /* Only available when layout_tag is set to QT_CHANNEL_LAYOUT_USE_CHANNEL_BITMAP. */ } lsmash_qt_audio_channel_layout_t; /* QuickTime Audio Format Specific Flags * Some values are ignored i.e. as if treated as unspecified when you specify certain CODECs. * For instance, you specify QT_CODEC_TYPE_SOWT_AUDIO, then all these values are ignored. * These values are basically used for QT_CODEC_TYPE_LPCM_AUDIO. * The endiannes value can be used for QT_CODEC_TYPE_FL32_AUDIO, QT_CODEC_TYPE_FL64_AUDIO, QT_CODEC_TYPE_IN24_AUDIO and QT_CODEC_TYPE_IN32_AUDIO. */ typedef enum { QT_AUDIO_FORMAT_FLAG_FLOAT = 1, /* Set for floating point, clear for integer. */ QT_AUDIO_FORMAT_FLAG_BIG_ENDIAN = 1<<1, /* Set for big endian, clear for little endian. */ QT_AUDIO_FORMAT_FLAG_SIGNED_INTEGER = 1<<2, /* Set for signed integer, clear for unsigned integer. * This is only valid if QT_AUDIO_FORMAT_FLAG_FLOAT is clear. */ QT_AUDIO_FORMAT_FLAG_PACKED = 1<<3, /* Set if the sample bits occupy the entire available bits for the channel, * clear if they are high or low aligned within the channel. */ QT_AUDIO_FORMAT_FLAG_ALIGNED_HIGH = 1<<4, /* Set if the sample bits are placed into the high bits of the channel, clear for low bit placement. * This is only valid if QT_AUDIO_FORMAT_FLAG_PACKED is clear. */ QT_AUDIO_FORMAT_FLAG_NON_INTERLEAVED = 1<<5, /* Set if the samples for each channel are located contiguously and the channels are layed out end to end, * clear if the samples for each frame are layed out contiguously and the frames layed out end to end. */ QT_AUDIO_FORMAT_FLAG_NON_MIXABLE = 1<<6, /* Set to indicate when a format is non-mixable. * Note that this flag is only used when interacting with the HAL's stream format information. * It is not a valid flag for any other uses. */ QT_AUDIO_FORMAT_FLAG_ALL_CLEAR = 1<<31, /* Set if all the flags would be clear in order to preserve 0 as the wild card value. */ QT_LPCM_FORMAT_FLAG_FLOAT = QT_AUDIO_FORMAT_FLAG_FLOAT, QT_LPCM_FORMAT_FLAG_BIG_ENDIAN = QT_AUDIO_FORMAT_FLAG_BIG_ENDIAN, QT_LPCM_FORMAT_FLAG_SIGNED_INTEGER = QT_AUDIO_FORMAT_FLAG_SIGNED_INTEGER, QT_LPCM_FORMAT_FLAG_PACKED = QT_AUDIO_FORMAT_FLAG_PACKED, QT_LPCM_FORMAT_FLAG_ALIGNED_HIGH = QT_AUDIO_FORMAT_FLAG_ALIGNED_HIGH, QT_LPCM_FORMAT_FLAG_NON_INTERLEAVED = QT_AUDIO_FORMAT_FLAG_NON_INTERLEAVED, QT_LPCM_FORMAT_FLAG_NON_MIXABLE = QT_AUDIO_FORMAT_FLAG_NON_MIXABLE, QT_LPCM_FORMAT_FLAG_ALL_CLEAR = QT_AUDIO_FORMAT_FLAG_ALL_CLEAR, /* These flags are set for Apple Lossless data that was sourced from N bit native endian signed integer data. */ QT_ALAC_FORMAT_FLAG_16BIT_SOURCE_DATA = 1, QT_ALAC_FORMAT_FLAG_20BIT_SOURCE_DATA = 2, QT_ALAC_FORMAT_FLAG_24BIT_SOURCE_DATA = 3, QT_ALAC_FORMAT_FLAG_32BIT_SOURCE_DATA = 4, } lsmash_qt_audio_format_specific_flag; typedef struct { lsmash_qt_audio_format_specific_flag format_flags; } lsmash_qt_audio_format_specific_flags_t; /* Global Header * Ut Video inside QuickTime file format requires this extension for storing CODEC specific information. */ typedef struct { uint32_t header_size; uint8_t *header_data; } lsmash_codec_global_header_t; /**************************************************************************** * iTunes Metadata ****************************************************************************/ typedef enum { /* UTF String type */ ITUNES_METADATA_ITEM_ALBUM_NAME = LSMASH_4CC( 0xA9, 'a', 'l', 'b' ), /* Album Name */ ITUNES_METADATA_ITEM_ARTIST = LSMASH_4CC( 0xA9, 'A', 'R', 'T' ), /* Artist */ ITUNES_METADATA_ITEM_USER_COMMENT = LSMASH_4CC( 0xA9, 'c', 'm', 't' ), /* User Comment */ ITUNES_METADATA_ITEM_RELEASE_DATE = LSMASH_4CC( 0xA9, 'd', 'a', 'y' ), /* YYYY-MM-DD format string (may be incomplete, i.e. only year) */ ITUNES_METADATA_ITEM_ENCODED_BY = LSMASH_4CC( 0xA9, 'e', 'n', 'c' ), /* Person or company that encoded the recording */ ITUNES_METADATA_ITEM_USER_GENRE = LSMASH_4CC( 0xA9, 'g', 'e', 'n' ), /* User Genre user-specified string */ ITUNES_METADATA_ITEM_GROUPING = LSMASH_4CC( 0xA9, 'g', 'r', 'p' ), /* Grouping */ ITUNES_METADATA_ITEM_LYRICS = LSMASH_4CC( 0xA9, 'l', 'y', 'r' ), /* Lyrics */ ITUNES_METADATA_ITEM_TITLE = LSMASH_4CC( 0xA9, 'n', 'a', 'm' ), /* Title / Song Name */ ITUNES_METADATA_ITEM_TRACK_SUBTITLE = LSMASH_4CC( 0xA9, 's', 't', '3' ), /* Track Sub-Title */ ITUNES_METADATA_ITEM_ENCODING_TOOL = LSMASH_4CC( 0xA9, 't', 'o', 'o' ), /* Software which encoded the recording */ ITUNES_METADATA_ITEM_COMPOSER = LSMASH_4CC( 0xA9, 'w', 'r', 't' ), /* Composer */ ITUNES_METADATA_ITEM_ALBUM_ARTIST = LSMASH_4CC( 'a', 'A', 'R', 'T' ), /* Artist for the whole album (if different than the individual tracks) */ ITUNES_METADATA_ITEM_PODCAST_CATEGORY = LSMASH_4CC( 'c', 'a', 't', 'g' ), /* Podcast Category */ ITUNES_METADATA_ITEM_COPYRIGHT = LSMASH_4CC( 'c', 'p', 'r', 't' ), /* Copyright */ ITUNES_METADATA_ITEM_DESCRIPTION = LSMASH_4CC( 'd', 'e', 's', 'c' ), /* Description (limited to 255 bytes) */ ITUNES_METADATA_ITEM_GROUPING_DRAFT = LSMASH_4CC( 'g', 'r', 'u', 'p' ), /* Grouping * Note: This identifier is defined in * iTunes Metadata Format Specification (Preliminary draft), * but not used by iTunes actually it seems. * We recommend you use ITUNES_METADATA_ITEM_GROUPING instead of this. */ ITUNES_METADATA_ITEM_PODCAST_KEYWORD = LSMASH_4CC( 'k', 'e', 'y', 'w' ), /* Podcast Keywords */ ITUNES_METADATA_ITEM_LONG_DESCRIPTION = LSMASH_4CC( 'l', 'd', 'e', 's' ), /* Long Description */ ITUNES_METADATA_ITEM_PURCHASE_DATE = LSMASH_4CC( 'p', 'u', 'r', 'd' ), /* Purchase Date */ ITUNES_METADATA_ITEM_TV_EPISODE_ID = LSMASH_4CC( 't', 'v', 'e', 'n' ), /* TV Episode ID */ ITUNES_METADATA_ITEM_TV_NETWORK = LSMASH_4CC( 't', 'v', 'n', 'n' ), /* TV Network Name */ ITUNES_METADATA_ITEM_TV_SHOW_NAME = LSMASH_4CC( 't', 'v', 's', 'h' ), /* TV Show Name */ ITUNES_METADATA_ITEM_ITUNES_PURCHASE_ACCOUNT_ID = LSMASH_4CC( 'a', 'p', 'I', 'D' ), /* iTunes Account Used for Purchase */ ITUNES_METADATA_ITEM_ITUNES_SORT_ALBUM = LSMASH_4CC( 's', 'o', 'a', 'l' ), /* Sort Album */ ITUNES_METADATA_ITEM_ITUNES_SORT_ARTIST = LSMASH_4CC( 's', 'o', 'a', 'r' ), /* Sort Artist */ ITUNES_METADATA_ITEM_ITUNES_SORT_ALBUM_ARTIST = LSMASH_4CC( 's', 'o', 'a', 'a' ), /* Sort Album Artist */ ITUNES_METADATA_ITEM_ITUNES_SORT_COMPOSER = LSMASH_4CC( 's', 'o', 'c', 'o' ), /* Sort Composer */ ITUNES_METADATA_ITEM_ITUNES_SORT_NAME = LSMASH_4CC( 's', 'o', 'n', 'm' ), /* Sort Name */ ITUNES_METADATA_ITEM_ITUNES_SORT_SHOW = LSMASH_4CC( 's', 'o', 's', 'n' ), /* Sort Show */ /* Integer type * (X): X means length of bytes */ ITUNES_METADATA_ITEM_EPISODE_GLOBAL_ID = LSMASH_4CC( 'e', 'g', 'i', 'd' ), /* (1) Episode Global Unique ID */ ITUNES_METADATA_ITEM_PREDEFINED_GENRE = LSMASH_4CC( 'g', 'n', 'r', 'e' ), /* (2) Pre-defined Genre / Enumerated value from ID3 tag set, plus 1 */ ITUNES_METADATA_ITEM_PODCAST_URL = LSMASH_4CC( 'p', 'u', 'r', 'l' ), /* (?) Podcast URL */ ITUNES_METADATA_ITEM_CONTENT_RATING = LSMASH_4CC( 'r', 't', 'n', 'g' ), /* (1) Content Rating / Does song have explicit content? 0: none, 2: clean, 4: explicit */ ITUNES_METADATA_ITEM_MEDIA_TYPE = LSMASH_4CC( 's', 't', 'i', 'k' ), /* (1) Media Type */ ITUNES_METADATA_ITEM_BEATS_PER_MINUTE = LSMASH_4CC( 't', 'm', 'p', 'o' ), /* (2) Beats Per Minute */ ITUNES_METADATA_ITEM_TV_EPISODE = LSMASH_4CC( 't', 'v', 'e', 's' ), /* (4) TV Episode */ ITUNES_METADATA_ITEM_TV_SEASON = LSMASH_4CC( 't', 'v', 's', 'n' ), /* (4) TV Season */ ITUNES_METADATA_ITEM_ITUNES_ACCOUNT_TYPE = LSMASH_4CC( 'a', 'k', 'I', 'D' ), /* (1) iTunes Account Type / 0: iTunes, 1: AOL */ ITUNES_METADATA_ITEM_ITUNES_ARTIST_ID = LSMASH_4CC( 'a', 't', 'I', 'D' ), /* (4) iTunes Artist ID */ ITUNES_METADATA_ITEM_ITUNES_COMPOSER_ID = LSMASH_4CC( 'c', 'm', 'I', 'D' ), /* (4) iTunes Composer ID */ ITUNES_METADATA_ITEM_ITUNES_CATALOG_ID = LSMASH_4CC( 'c', 'n', 'I', 'D' ), /* (4) iTunes Catalog ID */ ITUNES_METADATA_ITEM_ITUNES_TV_GENRE_ID = LSMASH_4CC( 'g', 'e', 'I', 'D' ), /* (4) iTunes TV Genre ID */ ITUNES_METADATA_ITEM_ITUNES_PLAYLIST_ID = LSMASH_4CC( 'p', 'l', 'I', 'D' ), /* (8) iTunes Playlist ID */ ITUNES_METADATA_ITEM_ITUNES_COUNTRY_CODE = LSMASH_4CC( 's', 'f', 'I', 'D' ), /* (4) iTunes Country Code */ /* Boolean type */ ITUNES_METADATA_ITEM_DISC_COMPILATION = LSMASH_4CC( 'c', 'p', 'i', 'l' ), /* Disc Compilation / Is disc part of a compilation? 0: No, 1: Yes */ ITUNES_METADATA_ITEM_HIGH_DEFINITION_VIDEO = LSMASH_4CC( 'h', 'd', 'v', 'd' ), /* High Definition Video / 0: No, 1: Yes */ ITUNES_METADATA_ITEM_PODCAST = LSMASH_4CC( 'p', 'c', 's', 't' ), /* Podcast / 0: No, 1: Yes */ ITUNES_METADATA_ITEM_GAPLESS_PLAYBACK = LSMASH_4CC( 'p', 'g', 'a', 'p' ), /* Gapless Playback / 0: insert gap, 1: no gap */ /* Binary type */ ITUNES_METADATA_ITEM_COVER_ART = LSMASH_4CC( 'c', 'o', 'v', 'r' ), /* One or more cover art images (JPEG/PNG/BMP data) */ ITUNES_METADATA_ITEM_DISC_NUMBER = LSMASH_4CC( 'd', 'i', 's', 'k' ), /* Disc Number */ ITUNES_METADATA_ITEM_TRACK_NUMBER = LSMASH_4CC( 't', 'r', 'k', 'n' ), /* Track Number */ /* Custom type */ ITUNES_METADATA_ITEM_CUSTOM = LSMASH_4CC( '-', '-', '-', '-' ), /* Custom */ } lsmash_itunes_metadata_item; typedef enum { ITUNES_METADATA_TYPE_NONE = 0, ITUNES_METADATA_TYPE_STRING = 1, ITUNES_METADATA_TYPE_INTEGER = 2, ITUNES_METADATA_TYPE_BOOLEAN = 3, ITUNES_METADATA_TYPE_BINARY = 4, } lsmash_itunes_metadata_type; typedef enum { ITUNES_METADATA_SUBTYPE_IMPLICIT = 0, /* for use with tags for which no type needs to be indicated because only one type is allowed */ ITUNES_METADATA_SUBTYPE_UTF8 = 1, /* without any count or null terminator */ ITUNES_METADATA_SUBTYPE_UTF16 = 2, /* also known as UTF-16BE */ ITUNES_METADATA_SUBTYPE_SJIS = 3, /* deprecated unless it is needed for special Japanese characters */ ITUNES_METADATA_SUBTYPE_HTML = 6, /* the HTML file header specifies which HTML version */ ITUNES_METADATA_SUBTYPE_XML = 7, /* the XML header must identify the DTD or schemas */ ITUNES_METADATA_SUBTYPE_UUID = 8, /* also known as GUID; stored as 16 bytes in binary (valid as an ID) */ ITUNES_METADATA_SUBTYPE_ISRC = 9, /* stored as UTF-8 text (valid as an ID) */ ITUNES_METADATA_SUBTYPE_MI3P = 10, /* stored as UTF-8 text (valid as an ID) */ ITUNES_METADATA_SUBTYPE_GIF = 12, /* (deprecated) a GIF image */ ITUNES_METADATA_SUBTYPE_JPEG = 13, /* in a JFIF wrapper */ ITUNES_METADATA_SUBTYPE_PNG = 14, /* in a PNG wrapper */ ITUNES_METADATA_SUBTYPE_URL = 15, /* absolute, in UTF-8 characters */ ITUNES_METADATA_SUBTYPE_DURATION = 16, /* in milliseconds, a 32-bit integer */ ITUNES_METADATA_SUBTYPE_TIME = 17, /* in UTC, counting seconds since midnight on 1 January, 1904; 32 or 64 bits */ ITUNES_METADATA_SUBTYPE_GENRES = 18, /* a list of values from the enumerated set */ ITUNES_METADATA_SUBTYPE_INTEGER = 21, /* A signed big-endian integer in 1,2,3,4 or 8 bytes */ ITUNES_METADATA_SUBTYPE_RIAAPA = 24, /* RIAA Parental advisory; -1=no, 1=yes, 0=unspecified. 8-bit integer */ ITUNES_METADATA_SUBTYPE_UPC = 25, /* Universal Product Code, in text UTF-8 format (valid as an ID) */ ITUNES_METADATA_SUBTYPE_BMP = 27, /* Windows bitmap format graphics */ } lsmash_itunes_metadata_subtype; typedef union { char *string; /* for ITUNES_METADATA_TYPE_STRING (UTF-8 string) */ uint64_t integer; /* for ITUNES_METADATA_TYPE_INTEGER */ lsmash_boolean_t boolean; /* for ITUNES_METADATA_TYPE_BOOLEAN */ /* for ITUNES_METADATA_TYPE_BINARY */ struct { lsmash_itunes_metadata_subtype subtype; uint32_t size; uint8_t *data; } binary; } lsmash_itunes_metadata_value_t; typedef struct { /* When 'item' is specified as ITUNES_METADATA_ITEM_CUSTOM, 'type' and 'meaning' is mandatory while 'name' is optionally valid. * Otherwise 'type', 'meaning' and 'name' are just ignored. 'value' is always mandatory. */ lsmash_itunes_metadata_item item; lsmash_itunes_metadata_type type; lsmash_itunes_metadata_value_t value; char *meaning; char *name; } lsmash_itunes_metadata_t; /* Append an iTunes metadata to a movie. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_set_itunes_metadata ( lsmash_root_t *root, lsmash_itunes_metadata_t metadata ); /* Count the number of iTunes metadata in a movie. * * Return the number of iTunes metadata in a movie if successful. * Return 0 otherwise. */ uint32_t lsmash_count_itunes_metadata ( lsmash_root_t *root ); /* Get an iTunes metadata in a movie. * String and/or binary fields in 'metadata' are allocated if successful. * You can deallocate the allocated fields by lsmash_free(). * Also you can deallocate all of the allocated fields by lsmash_cleanup_itunes_metadata() at a time. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_get_itunes_metadata ( lsmash_root_t *root, uint32_t metadata_number, lsmash_itunes_metadata_t *metadata ); /* Deallocate all of allocated fields in a given iTunes metadata at a time. * The deallocated fields are set to NULL. * Note: the given iTunes metadata itself is NOT deallocated by this function. */ void lsmash_cleanup_itunes_metadata ( lsmash_itunes_metadata_t *metadata ); /**************************************************************************** * Others ****************************************************************************/ /* Set a copyright declaration to a track. * track_ID == 0 means copyright declaration applies to the entire presentation, not an entire track. * * Return 0 if successful. * Return a negative value otherwise. */ int lsmash_set_copyright ( lsmash_root_t *root, uint32_t track_ID, uint16_t ISO_language, char *notice ); int lsmash_create_object_descriptor ( lsmash_root_t *root ); #ifdef _WIN32 /* Convert string encoded by ACP (ANSI CODE PAGE) to UTF-8. * * Return the size of converted string (bytes) if successful. * Return 0 otherwise. */ int lsmash_convert_ansi_to_utf8 ( const char *string_ansi, /* string encoded by ACP */ char *string_utf8, /* buffer for converted string from ACP */ int max_length /* size of 'string_utf8' */ ); #endif #undef PRIVATE #endif
#!/bin/sh # This script regenerates the static js bindings for the dcrwallet .proto file. # You will need grpc-tools (which installs grpc_tools_node_protoc_plugin) # installed for this to run properly ./../../node_modules/grpc-tools/bin/protoc \ --js_out=import_style=commonjs_strict,binary:./walletrpc \ --grpc_out=generate_package_definition:./walletrpc \ --plugin=protoc-gen-grpc=./../../node_modules/grpc-tools/bin/grpc_node_plugin ./api.proto # commonjs_strict is broken (see https://github.com/grpc/grpc-node/issues/1445). # To fix it, we need to tweak the require at the top of the api_grpc_pb file # to account for the extra "walletrpc" package name. sed -i "s/require('.\/api_pb.js')/require('.\/api_pb.js').walletrpc/" walletrpc/api_grpc_pb.js
'use strict'; var DB = require('./lib/database'); var rc_util = require('./lib/utility.js'); var modelsFactory = require('./lib/models.js'); var selective = require('./program').selective; var Promise = require('bluebird'); module.exports = function(dbUrl, commander, lastCrawl) { return new Promise(function(resolve, reject) { function useLatestCrawl(latestCrawl) { var ipps = rc_util.getIpps(latestCrawl); if (ipps) { selective(ipps, commander) .then(resolve) .catch(reject); } } if (lastCrawl) { useLatestCrawl(lastCrawl); } else { rc_util.getLatestRow(dbUrl, commander.logsql) .then(function(row) { useLatestCrawl(JSON.parse(row.data)); }) .catch(reject); } }); };
.PHONY: translations install_precommit test_precommit fmt # Create the .po and .mo files used for i18n translations: cd src/cybersource && \ django-admin makemessages -a && \ django-admin compilemessages install_precommit: pre-commit install test_precommit: install_precommit pre-commit run --all-files fmt: black .
// // Created by 王耀 on 2017/11/14. // #include <gtest/gtest.h> #include "functable.h" TEST(FuncTableTest, FuncTableTest_OPERATION_Test) { Func func1(2, 3, 5, 9); FuncTable table; EXPECT_EQ(0, table.getSize()); table.append(func1); EXPECT_EQ(1, table.getSize()); EXPECT_EQ(0, table.getFunction(1).uiEntryPoint); EXPECT_EQ(9, table.getFunction(0).uiStackFrameSize); }
#include "ThinObject.h" #include "Object.h" #include "SnowString.h" #include "Exception.h" namespace snow { static volatile uintx global_object_id_counter = 1; void ThinObject::init() { m_Info.frozen = false; m_Info.gc_lock = false; // XXX: With multithreading, this will most certainly go wrong. #ifdef ARCH_IS_64_BIT ASSERT(global_object_id_counter < (1LU<<61)); #else ASSERT(global_object_id_counter < (1<<29)); #endif m_Info.id = global_object_id_counter++; } Value ThinObject::get_raw(Symbol name) const { return prototype()->get_raw(name); } Value ThinObject::set_raw(Symbol name, const Value&) { throw_exception(new String("Thin objects cannot have members assigned. Modify the prototype, or create a wrapper.")); return nil(); } Value ThinObject::set(const Value& self, Symbol member, const Value& val) { return prototype()->set(self, member, val); } Value ThinObject::get(const Value& self, Symbol member) const { return prototype()->get(self, member); } }
import {name as headerControlledName} from './controller/HeaderController'; function config($stateProvider, $urlRouterProvider) { $urlRouterProvider.otherwise('/'); $stateProvider .state('root', { url: "/", views: { header: { templateUrl: 'view/header.html', controller: headerControlledName }, items: { templateUrl: 'view/items.html', controller: require('./controller/ItemsController').name }, footer: { templateUrl: 'view/footer.html', controller: require('./controller/FooterController').name } } }); } export default config;
package keyring import ( "errors" "sync" ) var ( // ErrNotFound means the requested password was not found ErrNotFound = errors.New("keyring: Password not found") // ErrNoDefault means that no default keyring provider has been found ErrNoDefault = errors.New("keyring: No suitable keyring provider found (check your build flags)") providerInitOnce sync.Once defaultProvider provider providerInitError error ) // provider provides a simple interface to keychain sevice type provider interface { Get(service, username string) (string, error) Set(service, username, password string) error } func setupProvider() (provider, error) { providerInitOnce.Do(func() { defaultProvider, providerInitError = initializeProvider() }) if providerInitError != nil { return nil, providerInitError } else if defaultProvider == nil { return nil, ErrNoDefault } return defaultProvider, nil } // Get gets the password for a paricular Service and Username using the // default keyring provider. func Get(service, username string) (string, error) { p, err := setupProvider() if err != nil { return "", err } return p.Get(service, username) } // Set sets the password for a particular Service and Username using the // default keyring provider. func Set(service, username, password string) error { p, err := setupProvider() if err != nil { return err } return p.Set(service, username, password) }
# pulsesim Neural Network Accelerator Simulator
import {takeEvery} from 'redux-saga' import {call, put, take, fork, select, cancel} from 'redux-saga/effects' import * as Actions from './actions/actions' let ws = null const getUsername = state => state.username function* createWebSocket(url) { ws = new WebSocket(url) let deferred, open_deferred, close_deferred, error_deferred; ws.onopen = event => { if (open_deferred) { open_deferred.resolve(event) open_deferred = null } } ws.onmessage = event => { if (deferred) { deferred.resolve(JSON.parse(event.data)) deferred = null } } ws.onerror = event => { if (error_deferred) { error_deferred.resolve(JSON.parse(event.data)) error_deferred = null } } ws.onclose = event => { if (close_deferred) { close_deferred.resolve(event) close_deferred = null } } return { open: { nextMessage() { if (!open_deferred) { open_deferred = {} open_deferred.promise = new Promise(resolve => open_deferred.resolve = resolve) } return open_deferred.promise } }, message: { nextMessage() { if (!deferred) { deferred = {} deferred.promise = new Promise(resolve => deferred.resolve = resolve) } return deferred.promise } }, error: { nextMessage() { if (!error_deferred) { error_deferred = {} error_deferred.promise = new Promise(resolve => error_deferred.resolve = resolve) } return error_deferred.promise } }, close: { nextMessage() { if (!close_deferred) { close_deferred = {} close_deferred.promise = new Promise(resolve => close_deferred.resolve = resolve) } return close_deferred.promise } } } } function* watchOpen(ws) { let msg = yield call(ws.nextMessage) while (msg) { yield put(Actions.connected(msg.srcElement)) msg = yield call(ws.nextMessage) } } function* watchClose(ws) { let msg = yield call(ws.nextMessage) yield put(Actions.disconnected()) ws = null } function* watchErrors(ws) { let msg = yield call(ws.nextMessage) while (msg) { msg = yield call(ws.nextMessage) } } function* watchMessages(ws) { let msg = yield call(ws.nextMessage) while (msg) { yield put(msg) msg = yield call(ws.nextMessage) } } function* connect() { let openTask, msgTask, errTask, closeTask while (true) { const {ws_url} = yield take('connect') const ws = yield call(createWebSocket, ws_url) if (openTask) { yield cancel(openTask) yield cancel(msgTask) yield cancel(errTask) yield cancel(closeTask) } openTask = yield fork(watchOpen, ws.open) msgTask = yield fork(watchMessages, ws.message) errTask = yield fork(watchErrors, ws.error) closeTask = yield fork(watchClose, ws.close) } } const send = (data) => { try { ws.send(JSON.stringify(data)) } catch (error) { alert("Send error: " + error) } } function* login() { while (true) { const login_action = yield take('login') send(login_action) } } function* hello() { while (true) { const hello_action = yield take('hello') const username = yield select(getUsername) if (username) { send(Actions.login(username)) } } } function* disconnected() { while (true) { yield take('disconnected') } } export default function* rootSaga() { yield [ connect(), hello(), login(), disconnected() ] }
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.HttpsPolicy; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.SpaServices.AngularCli; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; namespace angular_portal_azure_2018_10 { public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; } public IConfiguration Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); // In production, the Angular files will be served from this directory services.AddSpaStaticFiles(configuration => { configuration.RootPath = "ClientApp/dist"; }); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Error"); app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseSpaStaticFiles(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller}/{action=Index}/{id?}"); }); app.UseSpa(spa => { // To learn more about options for serving an Angular SPA from ASP.NET Core, // see https://go.microsoft.com/fwlink/?linkid=864501 spa.Options.SourcePath = "ClientApp"; if (env.IsDevelopment()) { spa.UseAngularCliServer(npmScript: "start"); } }); } } }
import * as babylon from "@babylonjs/core" export const createCubeMesh = (scene: babylon.Scene): babylon.Mesh => { const material = new babylon.StandardMaterial("cube-material", scene) material.emissiveColor = new babylon.Color3(0.1, 0.6, 0.9) const mesh = babylon.Mesh.CreateBox("cube-mesh", 1, scene) mesh.material = material return mesh }
import React from 'react'; const isArray = x => Array.isArray(x); const isString = x => typeof x === 'string' && x.length > 0; const isSelector = x => isString(x) && (startsWith(x, '.') || startsWith(x, '#')); const isChildren = x => /string|number|boolean/.test(typeof x) || isArray(x); const startsWith = (string, start) => string.indexOf(start) === 0; const split = (string, separator) => string.split(separator); const subString = (string, start, end) => string.substring(start, end); const parseSelector = selector => { const classIdSplit = /([\.#]?[a-zA-Z0-9\u007F-\uFFFF_:-]+)/; const parts = split(selector, classIdSplit); return parts.reduce((acc, part) => { if (startsWith(part, '#')) { acc.id = subString(part, 1); } else if (startsWith(part, '.')) { acc.className = `${acc.className} ${subString(part, 1)}`.trim(); } return acc; }, { className: '' }); }; const createElement = (nameOrType, properties = {}, children = []) => { if (properties.isRendered !== undefined && !properties.isRendered) { return null; } const { isRendered, ...props } = properties; const args = [nameOrType, props]; if (!isArray(children)) { args.push(children); } else { args.push(...children); } return React.createElement.apply(React, args); }; export const hh = nameOrType => (first, second, third) => { if (isSelector(first)) { const selector = parseSelector(first); // selector, children if (isChildren(second)) { return createElement(nameOrType, selector, second); } // selector, props, children let { className = '' } = second || {}; className = `${selector.className} ${className} `.trim(); const props = { ...second, ...selector, className }; if (isChildren(third)) { return createElement(nameOrType, props, third); } return createElement(nameOrType, props); } // children if (isChildren(first)) { return createElement(nameOrType, {}, first); } // props, children if (isChildren(second)) { return createElement(nameOrType, first, second); } return createElement(nameOrType, first); }; const h = (nameOrType, ...rest) => hh(nameOrType)(...rest); const TAG_NAMES = [ 'a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'video', 'wbr', 'circle', 'clipPath', 'defs', 'ellipse', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan' ]; module.exports = TAG_NAMES.reduce((exported, type) => { exported[type] = hh(type); return exported; }, { h, hh });
/** * Created by Stefan on 9/19/2017 */ /** * Created by Stefan Endres on 08/16/2017. */ 'use strict' var http = require('http'), https = require('https'), url = require('url'), util = require('util'), fs = require('fs'), path = require('path'), sessions = require('./sessions'), EventEmitter = require('events').EventEmitter; function LHServer() { this.fnStack = []; this.defaultPort = 3000; this.options = {}; this.viewEngine = null; EventEmitter.call(this); } util.inherits(LHServer, EventEmitter); LHServer.prototype.use = function(path, options, fn) { if(typeof path === 'function') { fn = path; } if(typeof options === 'function') { fn = options; } if(!fn) return; var fnObj = { fn: fn, method: null, path: typeof path === 'string' ? path : null, options: typeof options === 'object' ? options : {}, } this.fnStack.push(fnObj); } LHServer.prototype.execute = function(req, res) { var self = this; var url_parts = url.parse(req.url); var callbackStack = this.getFunctionList(url_parts.pathname, req.method); if(callbackStack.length === 0) { return; } var func = callbackStack.shift(); // add session capabilities if(this.options['session']) { var session = sessions.lookupOrCreate(req,{ lifetime: this.options['session'].lifetime || 604800, secret: this.options['session'].secret || '', }); if(!res.finished) { res.setHeader('Set-Cookie', session.getSetCookieHeaderValue()); } req.session = session; } // add template rendering if(typeof this.options['view engine'] !== 'undefined') { res.render = render.bind(this,res); } res.statusCode = 200; res.send = send.bind(this,res); res.redirect = redirect.bind(this,res); res.status = status.bind(this,res); res.header = header.bind(this,res); try{ func.apply(this,[req,res, function(){self.callbackNextFunction(req,res,callbackStack)}]); } catch (e) { this.emit('error', e, res, req); } } LHServer.prototype.callbackNextFunction = function(req,res,callbackStack) { var self = this; if(callbackStack.length === 0) { return; } callbackStack[0] && callbackStack[0].apply && callbackStack[0].apply(this,[req,res,function() { callbackStack.shift(); self.callbackNextFunction(req,res,callbackStack) }]); } LHServer.prototype.listen = function(options, cb) { var opt = {}; if(typeof options === 'number' || typeof options === 'string'){ opt.port = options; } else { opt = Object.assign(opt,options) } var httpServer; if(opt.cert && opt.key) { httpServer = https.createServer(opt, this.execute.bind(this)).listen(opt.port || this.defaultPort); } else { httpServer = http.createServer(this.execute.bind(this)).listen(opt.port || this.defaultPort); } if(httpServer) { this.emit('ready'); }; cb && cb(httpServer); } LHServer.prototype.set = function(option, value) { this.options[option] = value; if(option === 'view engine' && value && value !== '') { try { this.viewEngine = require(value); } catch (err) { this.emit('error',err); } } } LHServer.prototype.getFunctionList = function(requestPath, method) { var ret = []; if(this.options['static']) { ret.push(readStaticFile.bind(this)); } for(var i in this.fnStack) { var pathMatch = ( this.fnStack[i].options && this.fnStack[i].options.partialPath ? this.fnStack[i].path === requestPath.substr(0, this.fnStack[i].path.length) : this.fnStack[i].path === requestPath ) || this.fnStack[i].path === null; if((this.fnStack[i].method === method || this.fnStack[i].method === null) && pathMatch) { if(this.fnStack[i].fn) { ret.push(this.fnStack[i].fn); } } } return ret; } LHServer.prototype.get = LHServer.prototype.post = LHServer.prototype.put = LHServer.prototype.delete = function() {}; var methods = ['get', 'put', 'post', 'delete',]; methods.map(function(method) { LHServer.prototype[method] = function(path, options, fn) { if(typeof path === 'function') { fn = path; } if(typeof options === 'function') { fn = options; } if(!fn) return; var fnObj = { fn: fn, method: method.toUpperCase(), path: typeof path === 'string' ? path : null, options: typeof options === 'object' ? options : {}, } this.fnStack.push(fnObj); } }) function readStaticFile(req,res,next) { if(res.finished){ return next && next(); } var self = this; var url_parts = url.parse(req.url); var requestPath = path.normalize(url_parts.pathname ).replace(/^(\.\.(\/|\\|$))+/, ''); if(requestPath === '/'){ requestPath = '/index.html' } var filePath = path.join(this.options['static'],requestPath); const contentTypes = { '.ico': 'image/x-icon', '.html': 'text/html', '.js': 'text/javascript', '.json': 'application/json', '.css': 'text/css', '.png': 'image/png', '.jpg': 'image/jpeg', '.wav': 'audio/wav', '.mp3': 'audio/mpeg', '.svg': 'image/svg+xml', '.pdf': 'application/pdf', '.doc': 'application/msword' }; var fExt = path.extname(filePath); var contentType; if(fExt && contentTypes.hasOwnProperty(fExt)) { contentType = contentTypes[fExt]; } else { return next && next(); } fs.readFile(filePath, function(err, content) { if (err) { return next && next(); } else { res.header('Content-Type', contentType); res.header('Content-Length', Buffer.byteLength(content)); res.writeHead( res.statusCode, res.headerValues ); res.end(content, 'utf-8'); return next && next(); } }); } function send(res, data) { if(res.finished){ return; } var contentType = 'text/html'; var responseBody = data; if(typeof data === 'object') { contentType = 'application/json' responseBody = JSON.stringify(data); } res.header('Content-Type', contentType) res.header('Content-Length', Buffer.byteLength(responseBody)) res.writeHead( res.statusCode, res.headerValues ); res.end(responseBody); } function render(res,template,options,callback){ if(res.finished){ return; } var self = this; if(typeof self.viewEngine === 'undefined') { return callback && callback(); } if(self.viewEngine.renderFile) { return self.viewEngine.renderFile( (self.options['views'] || '') + '/'+template+'.pug', options, function(err, result) { if(err){ self.emit('error',err); } if(result){ res.header('Content-Type', 'text/html') res.header('Content-Length', Buffer.byteLength(result)) res.writeHead( res.statusCode, res.headerValues ); res.end(result); } callback && callback(err,result); } ) } } function status(res,code) { res.statusCode = code; } function header(res, key, value) { if(typeof res.headerValues === 'undefined'){ res.headerValues = {}; } res.headerValues[key] = value } function redirect(res,url) { var address = url; var status = 302; if (arguments.length === 3) { if (typeof arguments[1] === 'number') { status = arguments[1]; address = arguments[2]; } } var responseBody = 'Redirecting to ' + address; res.header('Content-Type', 'text/html') res.header('Cache-Control', 'no-cache') res.header('Content-Length', Buffer.byteLength(responseBody)) res.header('Location', address) res.writeHead( status, res.headerValues ); res.end(responseBody); }; module.exports = new LHServer();
'use strict'; import path from 'path'; import webpack, { optimize, HotModuleReplacementPlugin, NoErrorsPlugin } from 'webpack'; export default { devtool: 'eval-cheap-module-source-map', entry: [ 'webpack-hot-middleware/client', './app/js/bootstrap' ], output: { path: path.join(__dirname, 'dist'), filename: 'bundle.js', publicPath: '/static/' }, plugins: [ new optimize.OccurenceOrderPlugin(), new HotModuleReplacementPlugin(), new NoErrorsPlugin() ], module: { loaders: [ { test: /\.js$/, loaders: ['babel'], exclude: path.resolve(__dirname, 'node_modules'), include: [ path.resolve(__dirname) ] } ] } };
/* Reset –––––––––––––––––––––––––––––––––––––––––––––––––– */ * { box-sizing: border-box; &:before, &:after { box-sizing: inherit; } } html, body { height: 100%; } body { display: flex; flex-direction: column; background-color: #fff; } a { text-decoration: none; } button { background: #bdbdbd; border: none; &:focus { outline: none; } &[disabled] { cursor: not-allowed; } } h1, h2, h3, h4, h5, h6 { margin: 0; } img { display: block; max-width: 100%; } input:not([type=checkbox]):not([type=radio]) { -webkit-appearance: none; } input[type=search] { box-sizing: border-box; } input, textarea, select { padding: 8px 0; border: none; border-bottom: 1px solid #bdbdbd; border-radius: 0; &:focus { outline: none; border-bottom: 1px solid var(--accent-color); box-shadow: 0 1px 0 0 var(--accent-color); } } textarea { max-width: 100%; border-top: 1px solid #bdbdbd; &:focus { border-top: 1px solid var(--accent-color); box-shadow: 0 -1px 0 0 var(--accent-color), 0 1px 0 0 var(--accent-color); } } select { -webkit-appearance: none; -moz-appearance: none; } /* FF hack, to prevent a sub-pixel rendering issue */ @-moz-document url-prefix() { select { padding: 0.4Em; } } ::placeholder { font-weight: 700; } p { margin: 0; } ul { margin: 0; padding-left: 0; list-style-type: none; }
using ReactiveUI; using System; using System.Diagnostics; using System.IO; using System.Reactive; using System.Reactive.Disposables; using System.Reactive.Linq; using Microsoft.Win32; namespace VisualStudioCleanup { static class OperatingSystemTasks { public static IObservable<Unit> TurnOffHyperV() { return Observable.Start(() => { using (var dism = Process.Start("dism.exe", "/Online /Disable-Feature:Microsoft-Hyper-V-All")) { dism?.WaitForExit(); } }, RxApp.TaskpoolScheduler); } public static IObservable<Unit> CleanSetupLogs() { return Observable.Start(() => { var tempDir = Path.GetTempPath(); Observable.Concat( Directory.EnumerateFiles(tempDir, "dd_*.*").ToObservable(), Directory.EnumerateFiles(tempDir, "VSIXInstaller_*.log").ToObservable(), Directory.EnumerateFiles(tempDir, "MSI*.LOG").ToObservable(), Directory.EnumerateFiles(tempDir, "sql*.*").ToObservable()) .Subscribe(file => File.Delete(file)); }, RxApp.TaskpoolScheduler); } public static IObservable<Unit> MovePackageCache(string destinationRoot) { return Observable.Start(() => { var dest = Path.Combine(destinationRoot, "Package Cache"); MoveDirectory(PackageCachePath, dest); Directory.Delete(PackageCachePath); CreateJunction(PackageCachePath, dest); }, RxApp.TaskpoolScheduler); } public static void Uninstall(string program) { ExecProg(program); } public static IObservable<Uninstallable> GetUninstallables() { return Observable.Create<Uninstallable>(o => { Observable.Start(() => { try { using (var localMachine = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Default)) { GetUninstallablesCore(localMachine, o); } if (Environment.Is64BitProcess) { using (var localMachine32 = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32)) { GetUninstallablesCore(localMachine32, o); } } o.OnCompleted(); } catch (Exception ex) { o.OnError(ex); } }, RxApp.TaskpoolScheduler); return Disposable.Create(() => { }); }); } private static void GetUninstallablesCore(RegistryKey baseKey, IObserver<Uninstallable> outcome) { using (var uninstallKey = baseKey.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Uninstall")) { if (uninstallKey == null) return; var subKeys = uninstallKey.GetSubKeyNames(); foreach(var subkeyName in subKeys) { using (var subkey = uninstallKey.OpenSubKey(subkeyName)) { if (subkey == null) continue; var name = (string)subkey.GetValue("DisplayName"); var command = (string)subkey.GetValue("UninstallString"); var source = (string)subkey.GetValue("InstallSource", ""); if (!string.IsNullOrEmpty(source) && source.IndexOf(PackageCachePath, StringComparison.OrdinalIgnoreCase) == 0) { var uninstallable = new Uninstallable(name, command); outcome.OnNext(uninstallable); } } } } } private static void CreateJunction(string sourceDir, string destDir) { ExecProg($"mklink /j \"{sourceDir}\" \"{destDir}\""); } private static void ExecProg(string program) { var psi = new ProcessStartInfo("cmd.exe", $"/c {program}") { WindowStyle = ProcessWindowStyle.Hidden }; using (var proc = Process.Start(psi)) { proc?.WaitForExit(); } } private static void MoveDirectory(string sourceDir, string destDir) { // Get the subdirectories for the specified directory. var dir = new DirectoryInfo(sourceDir); // create target dir (we may have just recursed into it if (!Directory.Exists(destDir)) { Directory.CreateDirectory(destDir); } // Move files foreach (var file in dir.GetFiles()) { file.MoveTo(Path.Combine(destDir, file.Name)); } // Move sub-dirs foreach (var subdir in dir.GetDirectories()) { var temp = Path.Combine(destDir, subdir.Name); MoveDirectory(subdir.FullName, temp); Directory.Delete(subdir.FullName); } } private static readonly string PackageCachePath = Path.Combine( Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Package Cache"); } }
<?php namespace Dictionary; //---------------------------------------------------------------------------- require_once __DIR__ . '/node_interface.php'; interface Node_With_Phrases extends Node_Interface { function add_phrase(); function get_phrase(); function get_phrases(); } //---------------------------------------------------------------------------- require_once __DIR__ . '/../phrase.php'; trait Has_Phrases { private $phrases = []; private $phrase_iterator = 0; //------------------------------------------------------------------------ // phrase management //------------------------------------------------------------------------ function add_phrase(){ $phrase = new Phrase($this->dictionary); $this->phrases[] = $phrase; return $phrase; } function get_phrase(){ if(!isset($this->phrases[$this->phrase_iterator])){ $this->phrase_iterator = 0; return false; } $phrase = $this->phrases[$this->phrase_iterator]; $this->phrase_iterator++; return $phrase; } function get_phrases(){ return $this->phrases; } }
'use strict'; var expect = chai.expect; function run(scope,done) { done(); } describe('SendCtrl', function(){ var rootScope, scope, controller_injector, dependencies, ctrl, sendForm, network, timeout, spy, stub, mock, res, transaction, data; beforeEach(module("rp")); beforeEach(inject(function($rootScope, $controller, $q, $timeout, rpNetwork) { network = rpNetwork; rootScope = rootScope; timeout = $timeout; scope = $rootScope.$new(); scope.currencies_all = [{ name: 'XRP - Ripples', value: 'XRP'}]; controller_injector = $controller; // Stub the sendForm, which should perhaps be tested using // End To End tests scope.sendForm = { send_destination: { $setValidity: function(){} }, $setPristine: function(){}, $setValidity: function(){} }; scope.$apply = function(func){func()}; scope.saveAddressForm = { $setPristine: function () {} } scope.check_dt_visibility = function () {}; dependencies = { $scope: scope, $element: null, $network: network, rpId: { loginStatus: true, account: 'r4EwBWxrx5HxYRyisfGzMto3AT8FZiYdWk' } } ctrl = controller_injector("SendCtrl", dependencies); })); it('should be initialized with defaults', function (done) { assert.equal(scope.mode, 'form'); assert.isObject(scope.send); assert.equal(scope.send.currency, 'XRP - Ripples'); assert.isFalse(scope.show_save_address_form); assert.isFalse(scope.addressSaved); assert.equal(scope.saveAddressName, ''); assert.isFalse(scope.addressSaving); done() }); it('should reset destination dependencies', function (done) { assert.isFunction(scope.reset_destination_deps); done(); }); describe('updating the destination', function (done) { beforeEach(function () { scope.send.recipient_address = 'r4EwBWxrx5HxYRyisfGzMto3AT8FZiYdWk'; }) it('should have a function to do so', function (done) { assert.isFunction(scope.update_destination); done(); }); describe('when the recipient is the same as last time', function (done) { beforeEach(function () { scope.send.last_recipient = scope.send.recipient_address; }); it('should not reset destination dependencies', function (done) { spy = sinon.spy(scope, 'reset_destination_deps'); scope.update_destination(); assert(spy.notCalled); done(); }); it('should not check destination tag visibility', function (done) { spy = sinon.spy(scope, 'check_dt_visibility'); scope.update_destination(); assert(spy.notCalled); done(); }); }); describe('when the recipient is new', function (done) { beforeEach(function () { scope.send.last_recipient = null; }); it('should reset destination dependencies', function (done) { spy = sinon.spy(scope, 'reset_destination_deps'); scope.update_destination(); assert(spy.called); done(); }); it('should check destination tag visibility', function (done) { spy = sinon.spy(scope, 'check_dt_visibility'); scope.update_destination(); assert(spy.called); done(); }); }); }) describe('updating the destination remote', function (done) { it('should have a function to do so', function (done) { assert.isFunction(scope.update_destination_remote); done(); }); it('should validate the federation field by default', function (done) { var setValiditySpy = sinon.spy( scope.sendForm.send_destination, '$setValidity'); scope.update_destination_remote(); assert(setValiditySpy.withArgs('federation', true).called); done(); }) describe('when it is not bitcoin', function (done) { beforeEach(function () { scope.send.bitcoin = null }) it('should check destination', function (done) { var spy = sinon.spy(scope, 'check_destination'); scope.update_destination_remote(); assert(spy.calledOnce); done(); }); }); describe('when it is bitcoin', function (done) { beforeEach(function () { scope.send.bitcoin = true; }); it('should update currency constraints', function (done) { var spy = sinon.spy(scope, 'update_currency_constraints'); scope.update_destination_remote(); spy.should.have.been.calledOnce; done(); }); it('should not check destination', function (done) { var spy = sinon.spy(scope, 'check_destination'); scope.update_destination_remote(); assert(!spy.called); done(); }); }) }) it('should check the destination', function (done) { assert.isFunction(scope.check_destination); done(); }) it('should handle paths', function (done) { assert.isFunction(scope.handle_paths); done(); }); it('should update paths', function (done) { assert.isFunction(scope.update_paths); done(); }); describe('updating currency constraints', function () { it('should have a function to do so', function (done) { assert.isFunction(scope.update_currency_constraints); done(); }); it('should update the currency', function (done) { stub = sinon.stub(scope, 'update_currency'); scope.update_currency_constraints(); assert(spy.called); done(); }); describe('when recipient info is not loaded', function () { it('should not update the currency', function (done) { stub = sinon.stub(scope, 'update_currency'); scope.send.recipient_info.loaded = false; scope.update_currency_constraints(); assert(spy.called); done(); }); }); }); it('should reset the currency dependencies', function (done) { assert.isFunction(scope.reset_currency_deps); var spy = sinon.spy(scope, 'reset_amount_deps'); scope.reset_currency_deps(); assert(spy.calledOnce); done(); }); it('should update the currency', function (done) { assert.isFunction(scope.update_currency); done(); }); describe('resetting the amount dependencies', function (done) { it('should have a function to do so', function (done) { assert.isFunction(scope.reset_amount_deps); done(); }); it('should set the quote to false', function (done) { scope.send.quote = true; scope.reset_amount_deps(); assert.isFalse(scope.send.quote); done(); }); it('should falsify the sender insufficient xrp flag', function (done) { scope.send.sender_insufficient_xrp = true; scope.reset_amount_deps(); assert.isFalse(scope.send.sender_insufficient_xrp); done(); }); it('should reset the paths', function (done) { spy = sinon.spy(scope, 'reset_paths'); scope.reset_amount_deps(); assert(spy.calledOnce); done(); }); }); it('should update the amount', function (done) { assert.isFunction(scope.update_amount); done(); }); it('should update the quote', function (done) { assert.isFunction(scope.update_quote); done(); }); describe('resetting paths', function (done) { it('should have a function to do so', function (done) { assert.isFunction(scope.reset_paths); done(); }); it('should set the send alternatives to an empty array', function (done) { scope.send.alternatives = ['not_an_empty_array']; scope.reset_paths(); assert(Array.isArray(scope.send.alternatives)); assert.equal(scope.send.alternatives.length, 0); done(); }); }); it('should rest the paths', function (done) { assert.isFunction(scope.reset_paths); done(); }); it('should cancel the form', function (done) { assert.isFunction(scope.cancelConfirm); scope.send.alt = ''; scope.mode = null; scope.cancelConfirm(); assert.equal(scope.mode, 'form'); assert.isNull(scope.send.alt); done(); }); describe('resetting the address form', function () { it('should have a function to do so', function (done) { assert.isFunction(scope.resetAddressForm); done(); }); it('should falsify show_save_address_form field', function (done) { scope.show_save_address_form = true scope.resetAddressForm(); assert.isFalse(scope.show_save_address_form); done(); }); it('should falsify the addressSaved field', function (done) { scope.addressSaved = true; scope.resetAddressForm(); assert.isFalse(scope.addressSaved); done(); }); it('should falsify the addressSaving field', function (done) { scope.saveAddressName = null; scope.resetAddressForm(); assert.equal(scope.saveAddressName, ''); done(); }); it('should empty the saveAddressName field', function (done) { scope.addressSaving = true; scope.resetAddressForm(); assert.isFalse(scope.addressSaving); done(); }); it('should set the form to pristine state', function (done) { spy = sinon.spy(scope.saveAddressForm, '$setPristine'); scope.resetAddressForm(); assert(spy.calledOnce); done(); }); }); describe('performing reset goto', function () { it('should have a function to do so', function (done) { assert.isFunction(scope.reset_goto); done(); }); it('should reset the scope', function (done) { spy = sinon.spy(scope, 'reset'); scope.reset_goto(); assert(spy.calledOnce); done(); }); it('should navigate the page to the tabname provide', function (done) { var tabName = 'someAwesomeTab'; scope.reset_goto(tabName); assert.equal(document.location.hash, '#' + tabName); done(); }); }) it('should perform a reset goto', function (done) { var mock = sinon.mock(scope); mock.expects('reset').once(); scope.reset_goto(); mock.verify(); done(); }); describe("handling when the send is prepared", function () { it('should have a function to do so', function (done) { assert.isFunction(scope.send_prepared); done(); }); it('should set confirm wait to true', function (done) { scope.send_prepared(); assert.isTrue(scope.confirm_wait); done(); }); it("should set the mode to 'confirm'", function (done) { assert.notEqual(scope.mode, 'confirm'); scope.send_prepared(); assert.equal(scope.mode, 'confirm'); done(); }) it('should set confirm_wait to false after a timeout', function (done) { scope.send_prepared(); assert.isTrue(scope.confirm_wait); // For some reason $timeout.flush() works but then raises an exception try { timeout.flush() } catch (e) {} assert.isFalse(scope.confirm_wait); done(); }); }); describe('handling when a transaction send is confirmed', function (done) { beforeEach(function () { scope.send.recipient_address = 'r4EwBWxrx5HxYRyisfGzMto3AT8FZiYdWk'; }); describe("handling a 'propose' event from ripple-lib", function (done) { beforeEach(function () { scope.send = { amount_feedback: { currency: function () { function to_human () { return 'somestring'; } return { to_human: to_human } } } } transaction = { hash: 'E64165A4ED2BF36E5922B11C4E192DF068E2ADC21836087DE5E0B1FDDCC9D82F' } res = { engine_result: 'arbitrary_engine_result', engine_result_message: 'arbitrary_engine_result_message' } }); it('should call send with the transaction hash', function (done) { spy = sinon.spy(scope, 'sent'); scope.onTransactionProposed(res, transaction); assert(spy.calledWith(transaction.hash)); done(); }); it('should set the engine status with the response', function (done) { spy = sinon.spy(scope, 'setEngineStatus'); scope.onTransactionProposed(res, transaction); assert(spy.called); done(); }); }); describe("handling errors from the server", function () { describe("any error", function (done) { it('should set the mode to error', function (done) { var res = { error: null }; scope.onTransactionError(res, null); setTimeout(function (){ assert.equal(scope.mode, "error"); done(); }, 10) }); }); }); it('should have a function to handle send confirmed', function (done) { assert.isFunction(scope.send_confirmed); done(); }); it('should create a transaction', function (done) { spy = sinon.spy(network.remote, 'transaction'); scope.send_confirmed(); assert(spy.called); done(); }); }) describe('saving an address', function () { beforeEach(function () { scope.userBlob = { data: { contacts: [] } }; }); it('should have a function to do so', function (done) { assert.isFunction(scope.saveAddress); done(); }); it("should set the addressSaving property to true", function (done) { assert.isFalse(scope.addressSaving); scope.saveAddress(); assert.isTrue(scope.addressSaving); done(); }) it("should listen for blobSave event", function (done) { var onBlobSaveSpy = sinon.spy(scope, '$on'); scope.saveAddress(); assert(onBlobSaveSpy.withArgs('$blobSave').calledOnce); done(); }); it("should add the contact to the blob's contacts", function (done) { assert(scope.userBlob.data.contacts.length == 0); scope.saveAddress(); assert(scope.userBlob.data.contacts.length == 1); done(); }); describe('handling a blobSave event', function () { describe('having called saveAddress', function () { beforeEach(function () { scope.saveAddress(); }); it('should set addressSaved to true', function (done) { assert.isFalse(scope.addressSaved); scope.$emit('$blobSave'); assert.isTrue(scope.addressSaved); done(); }); it("should set the contact as the scope's contact", function (done) { assert.isUndefined(scope.contact); scope.$emit('$blobSave'); assert.isObject(scope.contact); done(); }); }) describe('without having called saveAddress', function () { it('should not set addressSaved', function (done) { assert.isFalse(scope.addressSaved); scope.$emit('$blobSave'); assert.isFalse(scope.addressSaved); done(); }); }) }) }); describe('setting engine status', function () { beforeEach(function () { res = { engine_result: 'arbitrary_engine_result', engine_result_message: 'arbitrary_engine_result_message' } }); describe("when the response code is 'tes'", function() { beforeEach(function () { res.engine_result = 'tes'; }) describe('when the transaction is accepted', function () { it("should set the transaction result to cleared", function (done) { var accepted = true; scope.setEngineStatus(res, accepted); assert.equal(scope.tx_result, 'cleared'); done(); }); }); describe('when the transaction not accepted', function () { it("should set the transaction result to pending", function (done) { var accepted = false; scope.setEngineStatus(res, accepted); assert.equal(scope.tx_result, 'pending'); done(); }); }); }); describe("when the response code is 'tep'", function() { beforeEach(function () { res.engine_result = 'tep'; }) it("should set the transaction result to partial", function (done) { scope.setEngineStatus(res, true); assert.equal(scope.tx_result, 'partial'); done(); }); }); }); describe('handling sent transactions', function () { it('should update the mode to status', function (done) { assert.isFunction(scope.sent); assert.equal(scope.mode, 'form'); scope.sent(); assert.equal(scope.mode, 'status'); done(); }) it('should listen for transactions on the network', function (done) { var remoteListenerSpy = sinon.spy(network.remote, 'on'); scope.sent(); assert(remoteListenerSpy.calledWith('transaction')); done(); }) describe('handling a transaction event', function () { beforeEach(function () { var hash = 'testhash'; scope.sent(hash); data = { transaction: { hash: hash } } stub = sinon.stub(scope, 'setEngineStatus'); }); afterEach(function () { scope.setEngineStatus.restore(); }) it('should set the engine status', function (done) { network.remote.emit('transaction', data); assert(stub.called); done(); }); it('should stop listening for transactions', function (done) { spy = sinon.spy(network.remote, 'removeListener'); network.remote.emit('transaction', data); assert(spy.called); done(); }) }) }) });
<?php namespace Primus; /** * A quick and dirty dispatcher based on Aura.Dispatcher * Using this cheap dispatcher since we need to support PHP 5.3. If we ever move to PHP 5.4 we should swap this out * with Aura.Dispatcher * * @package Primus */ class Dispatcher { protected $methodParam = ''; protected $objects = array(); protected $objectParam = ''; public function dispatch($object, $params) { // Get the method from the params $method = $params[$this->methodParam]; // Invoke it if(is_callable(array($object, $method))) { $result = $object->$method(); } else if($object instanceof \Closure) { $result = $object($params); } else if(is_object($object) && is_callable($object)) { $result = $object->__invoke($params); } else { return $object; } $this->dispatch($result, $params); } public function setMethodParam($methodParam) { $this->methodParam = $methodParam; } public function setObject($identifier, $object) { $this->objects[$identifier] = $object; } public function setObjectParam($objectParam) { $this->objectParam = $objectParam; } public function __invoke($params = array()) { $identifier = $params[$this->objectParam]; if(isset($this->objects[$identifier])) { $object = $this->objects[$identifier]; $this->dispatch($object, $params); } } }
// ------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. // ------------------------------------------------------------------------------ // **NOTE** This file was generated by a tool and any changes will be overwritten. // Template Source: Templates\CSharp\Requests\IMethodRequest.cs.tt namespace Microsoft.Graph { using System; using System.Collections.Generic; using System.IO; using System.Net.Http; using System.Threading; /// <summary> /// The interface IWorkbookFunctionsDollarDeRequest. /// </summary> public partial interface IWorkbookFunctionsDollarDeRequest : IBaseRequest { /// <summary> /// Gets the request body. /// </summary> WorkbookFunctionsDollarDeRequestBody RequestBody { get; } /// <summary> /// Issues the POST request. /// </summary> System.Threading.Tasks.Task<WorkbookFunctionResult> PostAsync(); /// <summary> /// Issues the POST request. /// </summary> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The task to await for async call.</returns> System.Threading.Tasks.Task<WorkbookFunctionResult> PostAsync( CancellationToken cancellationToken); /// <summary> /// Adds the specified expand value to the request. /// </summary> /// <param name="value">The expand value.</param> /// <returns>The request object to send.</returns> IWorkbookFunctionsDollarDeRequest Expand(string value); /// <summary> /// Adds the specified select value to the request. /// </summary> /// <param name="value">The select value.</param> /// <returns>The request object to send.</returns> IWorkbookFunctionsDollarDeRequest Select(string value); } }
"use strict"; (function (ConflictType) { ConflictType[ConflictType["IndividualAttendeeConflict"] = 0] = "IndividualAttendeeConflict"; ConflictType[ConflictType["GroupConflict"] = 1] = "GroupConflict"; ConflictType[ConflictType["GroupTooBigConflict"] = 2] = "GroupTooBigConflict"; ConflictType[ConflictType["UnknownAttendeeConflict"] = 3] = "UnknownAttendeeConflict"; })(exports.ConflictType || (exports.ConflictType = {})); var ConflictType = exports.ConflictType;
<?php /* * This file is part of the Ivory Http Adapter package. * * (c) Eric GELOEN <geloen.eric@gmail.com> * * For the full copyright and license information, please read the LICENSE * file that was distributed with this source code. */ namespace Ivory\Tests\HttpAdapter; use GuzzleHttp\Handler\CurlHandler; /** * @author GeLo <geloen.eric@gmail.com> */ class Guzzle6CurlHttpAdapterTest extends AbstractGuzzle6CurlHttpAdapterTest { /** * {@inheritdoc} */ protected function setUp() { if (PHP_VERSION_ID < 50500) { $this->markTestSkipped(); } parent::setUp(); } /** * {@inheritdoc} */ protected function createHandler() { return new CurlHandler(); } }
// Package staticcheck contains a linter for Go source code. package staticcheck // import "honnef.co/go/tools/staticcheck" import ( "fmt" "go/ast" "go/constant" "go/token" "go/types" htmltemplate "html/template" "net/http" "regexp" "sort" "strconv" "strings" "sync" texttemplate "text/template" "honnef.co/go/tools/functions" "honnef.co/go/tools/internal/sharedcheck" "honnef.co/go/tools/lint" "honnef.co/go/tools/ssa" "honnef.co/go/tools/staticcheck/vrp" "golang.org/x/tools/go/ast/astutil" ) func validRegexp(call *Call) { arg := call.Args[0] err := ValidateRegexp(arg.Value) if err != nil { arg.Invalid(err.Error()) } } type runeSlice []rune func (rs runeSlice) Len() int { return len(rs) } func (rs runeSlice) Less(i int, j int) bool { return rs[i] < rs[j] } func (rs runeSlice) Swap(i int, j int) { rs[i], rs[j] = rs[j], rs[i] } func utf8Cutset(call *Call) { arg := call.Args[1] if InvalidUTF8(arg.Value) { arg.Invalid(MsgInvalidUTF8) } } func uniqueCutset(call *Call) { arg := call.Args[1] if !UniqueStringCutset(arg.Value) { arg.Invalid(MsgNonUniqueCutset) } } func unmarshalPointer(name string, arg int) CallCheck { return func(call *Call) { if !Pointer(call.Args[arg].Value) { call.Args[arg].Invalid(fmt.Sprintf("%s expects to unmarshal into a pointer, but the provided value is not a pointer", name)) } } } func pointlessIntMath(call *Call) { if ConvertedFromInt(call.Args[0].Value) { call.Invalid(fmt.Sprintf("calling %s on a converted integer is pointless", lint.CallName(call.Instr.Common()))) } } func checkValidHostPort(arg int) CallCheck { return func(call *Call) { if !ValidHostPort(call.Args[arg].Value) { call.Args[arg].Invalid(MsgInvalidHostPort) } } } var ( checkRegexpRules = map[string]CallCheck{ "regexp.MustCompile": validRegexp, "regexp.Compile": validRegexp, } checkTimeParseRules = map[string]CallCheck{ "time.Parse": func(call *Call) { arg := call.Args[0] err := ValidateTimeLayout(arg.Value) if err != nil { arg.Invalid(err.Error()) } }, } checkEncodingBinaryRules = map[string]CallCheck{ "encoding/binary.Write": func(call *Call) { arg := call.Args[2] if !CanBinaryMarshal(call.Job, arg.Value) { arg.Invalid(fmt.Sprintf("value of type %s cannot be used with binary.Write", arg.Value.Value.Type())) } }, } checkURLsRules = map[string]CallCheck{ "net/url.Parse": func(call *Call) { arg := call.Args[0] err := ValidateURL(arg.Value) if err != nil { arg.Invalid(err.Error()) } }, } checkSyncPoolValueRules = map[string]CallCheck{ "(*sync.Pool).Put": func(call *Call) { arg := call.Args[0] typ := arg.Value.Value.Type() if !lint.IsPointerLike(typ) { arg.Invalid("argument should be pointer-like to avoid allocations") } }, } checkRegexpFindAllRules = map[string]CallCheck{ "(*regexp.Regexp).FindAll": RepeatZeroTimes("a FindAll method", 1), "(*regexp.Regexp).FindAllIndex": RepeatZeroTimes("a FindAll method", 1), "(*regexp.Regexp).FindAllString": RepeatZeroTimes("a FindAll method", 1), "(*regexp.Regexp).FindAllStringIndex": RepeatZeroTimes("a FindAll method", 1), "(*regexp.Regexp).FindAllStringSubmatch": RepeatZeroTimes("a FindAll method", 1), "(*regexp.Regexp).FindAllStringSubmatchIndex": RepeatZeroTimes("a FindAll method", 1), "(*regexp.Regexp).FindAllSubmatch": RepeatZeroTimes("a FindAll method", 1), "(*regexp.Regexp).FindAllSubmatchIndex": RepeatZeroTimes("a FindAll method", 1), } checkUTF8CutsetRules = map[string]CallCheck{ "strings.IndexAny": utf8Cutset, "strings.LastIndexAny": utf8Cutset, "strings.ContainsAny": utf8Cutset, "strings.Trim": utf8Cutset, "strings.TrimLeft": utf8Cutset, "strings.TrimRight": utf8Cutset, } checkUniqueCutsetRules = map[string]CallCheck{ "strings.Trim": uniqueCutset, "strings.TrimLeft": uniqueCutset, "strings.TrimRight": uniqueCutset, } checkUnmarshalPointerRules = map[string]CallCheck{ "encoding/xml.Unmarshal": unmarshalPointer("xml.Unmarshal", 1), "(*encoding/xml.Decoder).Decode": unmarshalPointer("Decode", 0), "encoding/json.Unmarshal": unmarshalPointer("json.Unmarshal", 1), "(*encoding/json.Decoder).Decode": unmarshalPointer("Decode", 0), } checkUnbufferedSignalChanRules = map[string]CallCheck{ "os/signal.Notify": func(call *Call) { arg := call.Args[0] if UnbufferedChannel(arg.Value) { arg.Invalid("the channel used with signal.Notify should be buffered") } }, } checkMathIntRules = map[string]CallCheck{ "math.Ceil": pointlessIntMath, "math.Floor": pointlessIntMath, "math.IsNaN": pointlessIntMath, "math.Trunc": pointlessIntMath, "math.IsInf": pointlessIntMath, } checkStringsReplaceZeroRules = map[string]CallCheck{ "strings.Replace": RepeatZeroTimes("strings.Replace", 3), "bytes.Replace": RepeatZeroTimes("bytes.Replace", 3), } checkListenAddressRules = map[string]CallCheck{ "net/http.ListenAndServe": checkValidHostPort(0), "net/http.ListenAndServeTLS": checkValidHostPort(0), } checkBytesEqualIPRules = map[string]CallCheck{ "bytes.Equal": func(call *Call) { if ConvertedFrom(call.Args[0].Value, "net.IP") && ConvertedFrom(call.Args[1].Value, "net.IP") { call.Invalid("use net.IP.Equal to compare net.IPs, not bytes.Equal") } }, } checkRegexpMatchLoopRules = map[string]CallCheck{ "regexp.Match": loopedRegexp("regexp.Match"), "regexp.MatchReader": loopedRegexp("regexp.MatchReader"), "regexp.MatchString": loopedRegexp("regexp.MatchString"), } ) type Checker struct { CheckGenerated bool funcDescs *functions.Descriptions deprecatedObjs map[types.Object]string nodeFns map[ast.Node]*ssa.Function } func NewChecker() *Checker { return &Checker{} } func (c *Checker) Funcs() map[string]lint.Func { return map[string]lint.Func{ "SA1000": c.callChecker(checkRegexpRules), "SA1001": c.CheckTemplate, "SA1002": c.callChecker(checkTimeParseRules), "SA1003": c.callChecker(checkEncodingBinaryRules), "SA1004": c.CheckTimeSleepConstant, "SA1005": c.CheckExec, "SA1006": c.CheckUnsafePrintf, "SA1007": c.callChecker(checkURLsRules), "SA1008": c.CheckCanonicalHeaderKey, "SA1009": nil, "SA1010": c.callChecker(checkRegexpFindAllRules), "SA1011": c.callChecker(checkUTF8CutsetRules), "SA1012": c.CheckNilContext, "SA1013": c.CheckSeeker, "SA1014": c.callChecker(checkUnmarshalPointerRules), "SA1015": c.CheckLeakyTimeTick, "SA1016": c.CheckUntrappableSignal, "SA1017": c.callChecker(checkUnbufferedSignalChanRules), "SA1018": c.callChecker(checkStringsReplaceZeroRules), "SA1019": c.CheckDeprecated, "SA1020": c.callChecker(checkListenAddressRules), "SA1021": c.callChecker(checkBytesEqualIPRules), "SA1022": nil, "SA1023": c.CheckWriterBufferModified, "SA1024": c.callChecker(checkUniqueCutsetRules), "SA2000": c.CheckWaitgroupAdd, "SA2001": c.CheckEmptyCriticalSection, "SA2002": c.CheckConcurrentTesting, "SA2003": c.CheckDeferLock, "SA3000": c.CheckTestMainExit, "SA3001": c.CheckBenchmarkN, "SA4000": c.CheckLhsRhsIdentical, "SA4001": c.CheckIneffectiveCopy, "SA4002": c.CheckDiffSizeComparison, "SA4003": c.CheckUnsignedComparison, "SA4004": c.CheckIneffectiveLoop, "SA4005": c.CheckIneffectiveFieldAssignments, "SA4006": c.CheckUnreadVariableValues, // "SA4007": c.CheckPredeterminedBooleanExprs, "SA4007": nil, "SA4008": c.CheckLoopCondition, "SA4009": c.CheckArgOverwritten, "SA4010": c.CheckIneffectiveAppend, "SA4011": c.CheckScopedBreak, "SA4012": c.CheckNaNComparison, "SA4013": c.CheckDoubleNegation, "SA4014": c.CheckRepeatedIfElse, "SA4015": c.callChecker(checkMathIntRules), "SA4016": c.CheckSillyBitwiseOps, "SA4017": c.CheckPureFunctions, "SA4018": c.CheckSelfAssignment, "SA4019": c.CheckDuplicateBuildConstraints, "SA5000": c.CheckNilMaps, "SA5001": c.CheckEarlyDefer, "SA5002": c.CheckInfiniteEmptyLoop, "SA5003": c.CheckDeferInInfiniteLoop, "SA5004": c.CheckLoopEmptyDefault, "SA5005": c.CheckCyclicFinalizer, // "SA5006": c.CheckSliceOutOfBounds, "SA5007": c.CheckInfiniteRecursion, "SA6000": c.callChecker(checkRegexpMatchLoopRules), "SA6001": c.CheckMapBytesKey, "SA6002": c.callChecker(checkSyncPoolValueRules), "SA6003": c.CheckRangeStringRunes, "SA6004": nil, "SA9000": nil, "SA9001": c.CheckDubiousDeferInChannelRangeLoop, "SA9002": c.CheckNonOctalFileMode, "SA9003": c.CheckEmptyBranch, } } func (c *Checker) filterGenerated(files []*ast.File) []*ast.File { if c.CheckGenerated { return files } var out []*ast.File for _, f := range files { if !lint.IsGenerated(f) { out = append(out, f) } } return out } func (c *Checker) Init(prog *lint.Program) { c.funcDescs = functions.NewDescriptions(prog.SSA) c.deprecatedObjs = map[types.Object]string{} c.nodeFns = map[ast.Node]*ssa.Function{} for _, fn := range prog.AllFunctions { if fn.Blocks != nil { applyStdlibKnowledge(fn) ssa.OptimizeBlocks(fn) } } c.nodeFns = lint.NodeFns(prog.Packages) deprecated := []map[types.Object]string{} wg := &sync.WaitGroup{} for _, pkginfo := range prog.Prog.AllPackages { pkginfo := pkginfo scope := pkginfo.Pkg.Scope() names := scope.Names() wg.Add(1) m := map[types.Object]string{} deprecated = append(deprecated, m) go func(m map[types.Object]string) { for _, name := range names { obj := scope.Lookup(name) msg := c.deprecationMessage(pkginfo.Files, prog.SSA.Fset, obj) if msg != "" { m[obj] = msg } if typ, ok := obj.Type().Underlying().(*types.Struct); ok { n := typ.NumFields() for i := 0; i < n; i++ { // FIXME(dh): This code will not find deprecated // fields in anonymous structs. field := typ.Field(i) msg := c.deprecationMessage(pkginfo.Files, prog.SSA.Fset, field) if msg != "" { m[field] = msg } } } } wg.Done() }(m) } wg.Wait() for _, m := range deprecated { for k, v := range m { c.deprecatedObjs[k] = v } } } // TODO(adonovan): make this a method: func (*token.File) Contains(token.Pos) func tokenFileContainsPos(f *token.File, pos token.Pos) bool { p := int(pos) base := f.Base() return base <= p && p < base+f.Size() } func pathEnclosingInterval(files []*ast.File, fset *token.FileSet, start, end token.Pos) (path []ast.Node, exact bool) { for _, f := range files { if f.Pos() == token.NoPos { // This can happen if the parser saw // too many errors and bailed out. // (Use parser.AllErrors to prevent that.) continue } if !tokenFileContainsPos(fset.File(f.Pos()), start) { continue } if path, exact := astutil.PathEnclosingInterval(f, start, end); path != nil { return path, exact } } return nil, false } func (c *Checker) deprecationMessage(files []*ast.File, fset *token.FileSet, obj types.Object) (message string) { path, _ := pathEnclosingInterval(files, fset, obj.Pos(), obj.Pos()) if len(path) <= 2 { return "" } var docs []*ast.CommentGroup switch n := path[1].(type) { case *ast.FuncDecl: docs = append(docs, n.Doc) case *ast.Field: docs = append(docs, n.Doc) case *ast.ValueSpec: docs = append(docs, n.Doc) if len(path) >= 3 { if n, ok := path[2].(*ast.GenDecl); ok { docs = append(docs, n.Doc) } } case *ast.TypeSpec: docs = append(docs, n.Doc) if len(path) >= 3 { if n, ok := path[2].(*ast.GenDecl); ok { docs = append(docs, n.Doc) } } default: return "" } for _, doc := range docs { if doc == nil { continue } parts := strings.Split(doc.Text(), "\n\n") last := parts[len(parts)-1] if !strings.HasPrefix(last, "Deprecated: ") { continue } alt := last[len("Deprecated: "):] alt = strings.Replace(alt, "\n", " ", -1) return alt } return "" } func (c *Checker) isInLoop(b *ssa.BasicBlock) bool { sets := c.funcDescs.Get(b.Parent()).Loops for _, set := range sets { if set[b] { return true } } return false } func applyStdlibKnowledge(fn *ssa.Function) { if len(fn.Blocks) == 0 { return } // comma-ok receiving from a time.Tick channel will never return // ok == false, so any branching on the value of ok can be // replaced with an unconditional jump. This will primarily match // `for range time.Tick(x)` loops, but it can also match // user-written code. for _, block := range fn.Blocks { if len(block.Instrs) < 3 { continue } if len(block.Succs) != 2 { continue } var instrs []*ssa.Instruction for i, ins := range block.Instrs { if _, ok := ins.(*ssa.DebugRef); ok { continue } instrs = append(instrs, &block.Instrs[i]) } for i, ins := range instrs { unop, ok := (*ins).(*ssa.UnOp) if !ok || unop.Op != token.ARROW { continue } call, ok := unop.X.(*ssa.Call) if !ok { continue } if !lint.IsCallTo(call.Common(), "time.Tick") { continue } ex, ok := (*instrs[i+1]).(*ssa.Extract) if !ok || ex.Tuple != unop || ex.Index != 1 { continue } ifstmt, ok := (*instrs[i+2]).(*ssa.If) if !ok || ifstmt.Cond != ex { continue } *instrs[i+2] = ssa.NewJump(block) succ := block.Succs[1] block.Succs = block.Succs[0:1] succ.RemovePred(block) } } } func hasType(j *lint.Job, expr ast.Expr, name string) bool { return types.TypeString(j.Program.Info.TypeOf(expr), nil) == name } func (c *Checker) CheckUntrappableSignal(j *lint.Job) { fn := func(node ast.Node) bool { call, ok := node.(*ast.CallExpr) if !ok { return true } if !j.IsCallToAnyAST(call, "os/signal.Ignore", "os/signal.Notify", "os/signal.Reset") { return true } for _, arg := range call.Args { if conv, ok := arg.(*ast.CallExpr); ok && isName(j, conv.Fun, "os.Signal") { arg = conv.Args[0] } if isName(j, arg, "os.Kill") || isName(j, arg, "syscall.SIGKILL") { j.Errorf(arg, "%s cannot be trapped (did you mean syscall.SIGTERM?)", j.Render(arg)) } if isName(j, arg, "syscall.SIGSTOP") { j.Errorf(arg, "%s signal cannot be trapped", j.Render(arg)) } } return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func (c *Checker) CheckTemplate(j *lint.Job) { fn := func(node ast.Node) bool { call, ok := node.(*ast.CallExpr) if !ok { return true } var kind string if j.IsCallToAST(call, "(*text/template.Template).Parse") { kind = "text" } else if j.IsCallToAST(call, "(*html/template.Template).Parse") { kind = "html" } else { return true } sel := call.Fun.(*ast.SelectorExpr) if !j.IsCallToAST(sel.X, "text/template.New") && !j.IsCallToAST(sel.X, "html/template.New") { // TODO(dh): this is a cheap workaround for templates with // different delims. A better solution with less false // negatives would use data flow analysis to see where the // template comes from and where it has been return true } s, ok := j.ExprToString(call.Args[0]) if !ok { return true } var err error switch kind { case "text": _, err = texttemplate.New("").Parse(s) case "html": _, err = htmltemplate.New("").Parse(s) } if err != nil { // TODO(dominikh): whitelist other parse errors, if any if strings.Contains(err.Error(), "unexpected") { j.Errorf(call.Args[0], "%s", err) } } return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func (c *Checker) CheckTimeSleepConstant(j *lint.Job) { fn := func(node ast.Node) bool { call, ok := node.(*ast.CallExpr) if !ok { return true } if !j.IsCallToAST(call, "time.Sleep") { return true } lit, ok := call.Args[0].(*ast.BasicLit) if !ok { return true } n, err := strconv.Atoi(lit.Value) if err != nil { return true } if n == 0 || n > 120 { // time.Sleep(0) is a seldomly used pattern in concurrency // tests. >120 might be intentional. 120 was chosen // because the user could've meant 2 minutes. return true } recommendation := "time.Sleep(time.Nanosecond)" if n != 1 { recommendation = fmt.Sprintf("time.Sleep(%d * time.Nanosecond)", n) } j.Errorf(call.Args[0], "sleeping for %d nanoseconds is probably a bug. Be explicit if it isn't: %s", n, recommendation) return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func (c *Checker) CheckWaitgroupAdd(j *lint.Job) { fn := func(node ast.Node) bool { g, ok := node.(*ast.GoStmt) if !ok { return true } fun, ok := g.Call.Fun.(*ast.FuncLit) if !ok { return true } if len(fun.Body.List) == 0 { return true } stmt, ok := fun.Body.List[0].(*ast.ExprStmt) if !ok { return true } call, ok := stmt.X.(*ast.CallExpr) if !ok { return true } sel, ok := call.Fun.(*ast.SelectorExpr) if !ok { return true } fn, ok := j.Program.Info.ObjectOf(sel.Sel).(*types.Func) if !ok { return true } if fn.FullName() == "(*sync.WaitGroup).Add" { j.Errorf(sel, "should call %s before starting the goroutine to avoid a race", j.Render(stmt)) } return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func (c *Checker) CheckInfiniteEmptyLoop(j *lint.Job) { fn := func(node ast.Node) bool { loop, ok := node.(*ast.ForStmt) if !ok || len(loop.Body.List) != 0 || loop.Post != nil { return true } if loop.Init != nil { // TODO(dh): this isn't strictly necessary, it just makes // the check easier. return true } // An empty loop is bad news in two cases: 1) The loop has no // condition. In that case, it's just a loop that spins // forever and as fast as it can, keeping a core busy. 2) The // loop condition only consists of variable or field reads and // operators on those. The only way those could change their // value is with unsynchronised access, which constitutes a // data race. // // If the condition contains any function calls, its behaviour // is dynamic and the loop might terminate. Similarly for // channel receives. if loop.Cond != nil && hasSideEffects(loop.Cond) { return true } j.Errorf(loop, "this loop will spin, using 100%% CPU") if loop.Cond != nil { j.Errorf(loop, "loop condition never changes or has a race condition") } return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func (c *Checker) CheckDeferInInfiniteLoop(j *lint.Job) { fn := func(node ast.Node) bool { mightExit := false var defers []ast.Stmt loop, ok := node.(*ast.ForStmt) if !ok || loop.Cond != nil { return true } fn2 := func(node ast.Node) bool { switch stmt := node.(type) { case *ast.ReturnStmt: mightExit = true case *ast.BranchStmt: // TODO(dominikh): if this sees a break in a switch or // select, it doesn't check if it breaks the loop or // just the select/switch. This causes some false // negatives. if stmt.Tok == token.BREAK { mightExit = true } case *ast.DeferStmt: defers = append(defers, stmt) case *ast.FuncLit: // Don't look into function bodies return false } return true } ast.Inspect(loop.Body, fn2) if mightExit { return true } for _, stmt := range defers { j.Errorf(stmt, "defers in this infinite loop will never run") } return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func (c *Checker) CheckDubiousDeferInChannelRangeLoop(j *lint.Job) { fn := func(node ast.Node) bool { loop, ok := node.(*ast.RangeStmt) if !ok { return true } typ := j.Program.Info.TypeOf(loop.X) _, ok = typ.Underlying().(*types.Chan) if !ok { return true } fn2 := func(node ast.Node) bool { switch stmt := node.(type) { case *ast.DeferStmt: j.Errorf(stmt, "defers in this range loop won't run unless the channel gets closed") case *ast.FuncLit: // Don't look into function bodies return false } return true } ast.Inspect(loop.Body, fn2) return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func (c *Checker) CheckTestMainExit(j *lint.Job) { fn := func(node ast.Node) bool { if !isTestMain(j, node) { return true } arg := j.Program.Info.ObjectOf(node.(*ast.FuncDecl).Type.Params.List[0].Names[0]) callsRun := false fn2 := func(node ast.Node) bool { call, ok := node.(*ast.CallExpr) if !ok { return true } sel, ok := call.Fun.(*ast.SelectorExpr) if !ok { return true } ident, ok := sel.X.(*ast.Ident) if !ok { return true } if arg != j.Program.Info.ObjectOf(ident) { return true } if sel.Sel.Name == "Run" { callsRun = true return false } return true } ast.Inspect(node.(*ast.FuncDecl).Body, fn2) callsExit := false fn3 := func(node ast.Node) bool { if j.IsCallToAST(node, "os.Exit") { callsExit = true return false } return true } ast.Inspect(node.(*ast.FuncDecl).Body, fn3) if !callsExit && callsRun { j.Errorf(node, "TestMain should call os.Exit to set exit code") } return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func isTestMain(j *lint.Job, node ast.Node) bool { decl, ok := node.(*ast.FuncDecl) if !ok { return false } if decl.Name.Name != "TestMain" { return false } if len(decl.Type.Params.List) != 1 { return false } arg := decl.Type.Params.List[0] if len(arg.Names) != 1 { return false } typ := j.Program.Info.TypeOf(arg.Type) return typ != nil && typ.String() == "*testing.M" } func (c *Checker) CheckExec(j *lint.Job) { fn := func(node ast.Node) bool { call, ok := node.(*ast.CallExpr) if !ok { return true } if !j.IsCallToAST(call, "os/exec.Command") { return true } val, ok := j.ExprToString(call.Args[0]) if !ok { return true } if !strings.Contains(val, " ") || strings.Contains(val, `\`) || strings.Contains(val, "/") { return true } j.Errorf(call.Args[0], "first argument to exec.Command looks like a shell command, but a program name or path are expected") return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func (c *Checker) CheckLoopEmptyDefault(j *lint.Job) { fn := func(node ast.Node) bool { loop, ok := node.(*ast.ForStmt) if !ok || len(loop.Body.List) != 1 || loop.Cond != nil || loop.Init != nil { return true } sel, ok := loop.Body.List[0].(*ast.SelectStmt) if !ok { return true } for _, c := range sel.Body.List { if comm, ok := c.(*ast.CommClause); ok && comm.Comm == nil && len(comm.Body) == 0 { j.Errorf(comm, "should not have an empty default case in a for+select loop. The loop will spin.") } } return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func (c *Checker) CheckLhsRhsIdentical(j *lint.Job) { fn := func(node ast.Node) bool { op, ok := node.(*ast.BinaryExpr) if !ok { return true } switch op.Op { case token.EQL, token.NEQ: if basic, ok := j.Program.Info.TypeOf(op.X).(*types.Basic); ok { if kind := basic.Kind(); kind == types.Float32 || kind == types.Float64 { // f == f and f != f might be used to check for NaN return true } } case token.SUB, token.QUO, token.AND, token.REM, token.OR, token.XOR, token.AND_NOT, token.LAND, token.LOR, token.LSS, token.GTR, token.LEQ, token.GEQ: default: // For some ops, such as + and *, it can make sense to // have identical operands return true } if j.Render(op.X) != j.Render(op.Y) { return true } j.Errorf(op, "identical expressions on the left and right side of the '%s' operator", op.Op) return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func (c *Checker) CheckScopedBreak(j *lint.Job) { fn := func(node ast.Node) bool { var body *ast.BlockStmt switch node := node.(type) { case *ast.ForStmt: body = node.Body case *ast.RangeStmt: body = node.Body default: return true } for _, stmt := range body.List { var blocks [][]ast.Stmt switch stmt := stmt.(type) { case *ast.SwitchStmt: for _, c := range stmt.Body.List { blocks = append(blocks, c.(*ast.CaseClause).Body) } case *ast.SelectStmt: for _, c := range stmt.Body.List { blocks = append(blocks, c.(*ast.CommClause).Body) } default: continue } for _, body := range blocks { if len(body) == 0 { continue } lasts := []ast.Stmt{body[len(body)-1]} // TODO(dh): unfold all levels of nested block // statements, not just a single level if statement if ifs, ok := lasts[0].(*ast.IfStmt); ok { if len(ifs.Body.List) == 0 { continue } lasts[0] = ifs.Body.List[len(ifs.Body.List)-1] if block, ok := ifs.Else.(*ast.BlockStmt); ok { if len(block.List) != 0 { lasts = append(lasts, block.List[len(block.List)-1]) } } } for _, last := range lasts { branch, ok := last.(*ast.BranchStmt) if !ok || branch.Tok != token.BREAK || branch.Label != nil { continue } j.Errorf(branch, "ineffective break statement. Did you mean to break out of the outer loop?") } } } return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func (c *Checker) CheckUnsafePrintf(j *lint.Job) { fn := func(node ast.Node) bool { call, ok := node.(*ast.CallExpr) if !ok { return true } if !j.IsCallToAnyAST(call, "fmt.Printf", "fmt.Sprintf", "log.Printf") { return true } if len(call.Args) != 1 { return true } switch call.Args[0].(type) { case *ast.CallExpr, *ast.Ident: default: return true } j.Errorf(call.Args[0], "printf-style function with dynamic first argument and no further arguments should use print-style function instead") return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func (c *Checker) CheckEarlyDefer(j *lint.Job) { fn := func(node ast.Node) bool { block, ok := node.(*ast.BlockStmt) if !ok { return true } if len(block.List) < 2 { return true } for i, stmt := range block.List { if i == len(block.List)-1 { break } assign, ok := stmt.(*ast.AssignStmt) if !ok { continue } if len(assign.Rhs) != 1 { continue } if len(assign.Lhs) < 2 { continue } if lhs, ok := assign.Lhs[len(assign.Lhs)-1].(*ast.Ident); ok && lhs.Name == "_" { continue } call, ok := assign.Rhs[0].(*ast.CallExpr) if !ok { continue } sig, ok := j.Program.Info.TypeOf(call.Fun).(*types.Signature) if !ok { continue } if sig.Results().Len() < 2 { continue } last := sig.Results().At(sig.Results().Len() - 1) // FIXME(dh): check that it's error from universe, not // another type of the same name if last.Type().String() != "error" { continue } lhs, ok := assign.Lhs[0].(*ast.Ident) if !ok { continue } def, ok := block.List[i+1].(*ast.DeferStmt) if !ok { continue } sel, ok := def.Call.Fun.(*ast.SelectorExpr) if !ok { continue } ident, ok := selectorX(sel).(*ast.Ident) if !ok { continue } if ident.Obj != lhs.Obj { continue } if sel.Sel.Name != "Close" { continue } j.Errorf(def, "should check returned error before deferring %s", j.Render(def.Call)) } return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func selectorX(sel *ast.SelectorExpr) ast.Node { switch x := sel.X.(type) { case *ast.SelectorExpr: return selectorX(x) default: return x } } func (c *Checker) CheckEmptyCriticalSection(j *lint.Job) { // Initially it might seem like this check would be easier to // implement in SSA. After all, we're only checking for two // consecutive method calls. In reality, however, there may be any // number of other instructions between the lock and unlock, while // still constituting an empty critical section. For example, // given `m.x().Lock(); m.x().Unlock()`, there will be a call to // x(). In the AST-based approach, this has a tiny potential for a // false positive (the second call to x might be doing work that // is protected by the mutex). In an SSA-based approach, however, // it would miss a lot of real bugs. mutexParams := func(s ast.Stmt) (x ast.Expr, funcName string, ok bool) { expr, ok := s.(*ast.ExprStmt) if !ok { return nil, "", false } call, ok := expr.X.(*ast.CallExpr) if !ok { return nil, "", false } sel, ok := call.Fun.(*ast.SelectorExpr) if !ok { return nil, "", false } fn, ok := j.Program.Info.ObjectOf(sel.Sel).(*types.Func) if !ok { return nil, "", false } sig := fn.Type().(*types.Signature) if sig.Params().Len() != 0 || sig.Results().Len() != 0 { return nil, "", false } return sel.X, fn.Name(), true } fn := func(node ast.Node) bool { block, ok := node.(*ast.BlockStmt) if !ok { return true } if len(block.List) < 2 { return true } for i := range block.List[:len(block.List)-1] { sel1, method1, ok1 := mutexParams(block.List[i]) sel2, method2, ok2 := mutexParams(block.List[i+1]) if !ok1 || !ok2 || j.Render(sel1) != j.Render(sel2) { continue } if (method1 == "Lock" && method2 == "Unlock") || (method1 == "RLock" && method2 == "RUnlock") { j.Errorf(block.List[i+1], "empty critical section") } } return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } // cgo produces code like fn(&*_Cvar_kSomeCallbacks) which we don't // want to flag. var cgoIdent = regexp.MustCompile(`^_C(func|var)_.+$`) func (c *Checker) CheckIneffectiveCopy(j *lint.Job) { fn := func(node ast.Node) bool { if unary, ok := node.(*ast.UnaryExpr); ok { if star, ok := unary.X.(*ast.StarExpr); ok && unary.Op == token.AND { ident, ok := star.X.(*ast.Ident) if !ok || !cgoIdent.MatchString(ident.Name) { j.Errorf(unary, "&*x will be simplified to x. It will not copy x.") } } } if star, ok := node.(*ast.StarExpr); ok { if unary, ok := star.X.(*ast.UnaryExpr); ok && unary.Op == token.AND { j.Errorf(star, "*&x will be simplified to x. It will not copy x.") } } return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func (c *Checker) CheckDiffSizeComparison(j *lint.Job) { for _, ssafn := range j.Program.InitialFunctions { for _, b := range ssafn.Blocks { for _, ins := range b.Instrs { binop, ok := ins.(*ssa.BinOp) if !ok { continue } if binop.Op != token.EQL && binop.Op != token.NEQ { continue } _, ok1 := binop.X.(*ssa.Slice) _, ok2 := binop.Y.(*ssa.Slice) if !ok1 && !ok2 { continue } r := c.funcDescs.Get(ssafn).Ranges r1, ok1 := r.Get(binop.X).(vrp.StringInterval) r2, ok2 := r.Get(binop.Y).(vrp.StringInterval) if !ok1 || !ok2 { continue } if r1.Length.Intersection(r2.Length).Empty() { j.Errorf(binop, "comparing strings of different sizes for equality will always return false") } } } } } func (c *Checker) CheckCanonicalHeaderKey(j *lint.Job) { fn := func(node ast.Node) bool { assign, ok := node.(*ast.AssignStmt) if ok { // TODO(dh): This risks missing some Header reads, for // example in `h1["foo"] = h2["foo"]` – these edge // cases are probably rare enough to ignore for now. for _, expr := range assign.Lhs { op, ok := expr.(*ast.IndexExpr) if !ok { continue } if hasType(j, op.X, "net/http.Header") { return false } } return true } op, ok := node.(*ast.IndexExpr) if !ok { return true } if !hasType(j, op.X, "net/http.Header") { return true } s, ok := j.ExprToString(op.Index) if !ok { return true } if s == http.CanonicalHeaderKey(s) { return true } j.Errorf(op, "keys in http.Header are canonicalized, %q is not canonical; fix the constant or use http.CanonicalHeaderKey", s) return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func (c *Checker) CheckBenchmarkN(j *lint.Job) { fn := func(node ast.Node) bool { assign, ok := node.(*ast.AssignStmt) if !ok { return true } if len(assign.Lhs) != 1 || len(assign.Rhs) != 1 { return true } sel, ok := assign.Lhs[0].(*ast.SelectorExpr) if !ok { return true } if sel.Sel.Name != "N" { return true } if !hasType(j, sel.X, "*testing.B") { return true } j.Errorf(assign, "should not assign to %s", j.Render(sel)) return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func (c *Checker) CheckIneffectiveFieldAssignments(j *lint.Job) { for _, ssafn := range j.Program.InitialFunctions { // fset := j.Program.SSA.Fset // if fset.File(f.File.Pos()) != fset.File(ssafn.Pos()) { // continue // } if ssafn.Signature.Recv() == nil { continue } if len(ssafn.Blocks) == 0 { // External function continue } reads := map[*ssa.BasicBlock]map[ssa.Value]bool{} writes := map[*ssa.BasicBlock]map[ssa.Value]bool{} recv := ssafn.Params[0] if _, ok := recv.Type().Underlying().(*types.Struct); !ok { continue } recvPtrs := map[ssa.Value]bool{ recv: true, } if len(ssafn.Locals) == 0 || ssafn.Locals[0].Heap { continue } blocks := ssafn.DomPreorder() for _, block := range blocks { if writes[block] == nil { writes[block] = map[ssa.Value]bool{} } if reads[block] == nil { reads[block] = map[ssa.Value]bool{} } for _, ins := range block.Instrs { switch ins := ins.(type) { case *ssa.Store: if recvPtrs[ins.Val] { recvPtrs[ins.Addr] = true } fa, ok := ins.Addr.(*ssa.FieldAddr) if !ok { continue } if !recvPtrs[fa.X] { continue } writes[block][fa] = true case *ssa.UnOp: if ins.Op != token.MUL { continue } if recvPtrs[ins.X] { reads[block][ins] = true continue } fa, ok := ins.X.(*ssa.FieldAddr) if !ok { continue } if !recvPtrs[fa.X] { continue } reads[block][fa] = true } } } for block, writes := range writes { seen := map[*ssa.BasicBlock]bool{} var hasRead func(block *ssa.BasicBlock, write *ssa.FieldAddr) bool hasRead = func(block *ssa.BasicBlock, write *ssa.FieldAddr) bool { seen[block] = true for read := range reads[block] { switch ins := read.(type) { case *ssa.FieldAddr: if ins.Field == write.Field && read.Pos() > write.Pos() { return true } case *ssa.UnOp: if ins.Pos() >= write.Pos() { return true } } } for _, succ := range block.Succs { if !seen[succ] { if hasRead(succ, write) { return true } } } return false } for write := range writes { fa := write.(*ssa.FieldAddr) if !hasRead(block, fa) { name := recv.Type().Underlying().(*types.Struct).Field(fa.Field).Name() j.Errorf(fa, "ineffective assignment to field %s", name) } } } } } func (c *Checker) CheckUnreadVariableValues(j *lint.Job) { fn := func(node ast.Node) bool { switch node.(type) { case *ast.FuncDecl, *ast.FuncLit: default: return true } ssafn := c.nodeFns[node] if ssafn == nil { return true } if lint.IsExample(ssafn) { return true } ast.Inspect(node, func(node ast.Node) bool { assign, ok := node.(*ast.AssignStmt) if !ok { return true } if len(assign.Lhs) > 1 && len(assign.Rhs) == 1 { // Either a function call with multiple return values, // or a comma-ok assignment val, _ := ssafn.ValueForExpr(assign.Rhs[0]) if val == nil { return true } refs := val.Referrers() if refs == nil { return true } for _, ref := range *refs { ex, ok := ref.(*ssa.Extract) if !ok { continue } exrefs := ex.Referrers() if exrefs == nil { continue } if len(lint.FilterDebug(*exrefs)) == 0 { lhs := assign.Lhs[ex.Index] if ident, ok := lhs.(*ast.Ident); !ok || ok && ident.Name == "_" { continue } j.Errorf(lhs, "this value of %s is never used", lhs) } } return true } for i, lhs := range assign.Lhs { rhs := assign.Rhs[i] if ident, ok := lhs.(*ast.Ident); !ok || ok && ident.Name == "_" { continue } val, _ := ssafn.ValueForExpr(rhs) if val == nil { continue } refs := val.Referrers() if refs == nil { // TODO investigate why refs can be nil return true } if len(lint.FilterDebug(*refs)) == 0 { j.Errorf(lhs, "this value of %s is never used", lhs) } } return true }) return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func (c *Checker) CheckPredeterminedBooleanExprs(j *lint.Job) { for _, ssafn := range j.Program.InitialFunctions { for _, block := range ssafn.Blocks { for _, ins := range block.Instrs { ssabinop, ok := ins.(*ssa.BinOp) if !ok { continue } switch ssabinop.Op { case token.GTR, token.LSS, token.EQL, token.NEQ, token.LEQ, token.GEQ: default: continue } xs, ok1 := consts(ssabinop.X, nil, nil) ys, ok2 := consts(ssabinop.Y, nil, nil) if !ok1 || !ok2 || len(xs) == 0 || len(ys) == 0 { continue } trues := 0 for _, x := range xs { for _, y := range ys { if x.Value == nil { if y.Value == nil { trues++ } continue } if constant.Compare(x.Value, ssabinop.Op, y.Value) { trues++ } } } b := trues != 0 if trues == 0 || trues == len(xs)*len(ys) { j.Errorf(ssabinop, "binary expression is always %t for all possible values (%s %s %s)", b, xs, ssabinop.Op, ys) } } } } } func (c *Checker) CheckNilMaps(j *lint.Job) { for _, ssafn := range j.Program.InitialFunctions { for _, block := range ssafn.Blocks { for _, ins := range block.Instrs { mu, ok := ins.(*ssa.MapUpdate) if !ok { continue } c, ok := mu.Map.(*ssa.Const) if !ok { continue } if c.Value != nil { continue } j.Errorf(mu, "assignment to nil map") } } } } func (c *Checker) CheckUnsignedComparison(j *lint.Job) { fn := func(node ast.Node) bool { expr, ok := node.(*ast.BinaryExpr) if !ok { return true } tx := j.Program.Info.TypeOf(expr.X) basic, ok := tx.Underlying().(*types.Basic) if !ok { return true } if (basic.Info() & types.IsUnsigned) == 0 { return true } lit, ok := expr.Y.(*ast.BasicLit) if !ok || lit.Value != "0" { return true } switch expr.Op { case token.GEQ: j.Errorf(expr, "unsigned values are always >= 0") case token.LSS: j.Errorf(expr, "unsigned values are never < 0") } return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func consts(val ssa.Value, out []*ssa.Const, visitedPhis map[string]bool) ([]*ssa.Const, bool) { if visitedPhis == nil { visitedPhis = map[string]bool{} } var ok bool switch val := val.(type) { case *ssa.Phi: if visitedPhis[val.Name()] { break } visitedPhis[val.Name()] = true vals := val.Operands(nil) for _, phival := range vals { out, ok = consts(*phival, out, visitedPhis) if !ok { return nil, false } } case *ssa.Const: out = append(out, val) case *ssa.Convert: out, ok = consts(val.X, out, visitedPhis) if !ok { return nil, false } default: return nil, false } if len(out) < 2 { return out, true } uniq := []*ssa.Const{out[0]} for _, val := range out[1:] { if val.Value == uniq[len(uniq)-1].Value { continue } uniq = append(uniq, val) } return uniq, true } func (c *Checker) CheckLoopCondition(j *lint.Job) { fn := func(node ast.Node) bool { loop, ok := node.(*ast.ForStmt) if !ok { return true } if loop.Init == nil || loop.Cond == nil || loop.Post == nil { return true } init, ok := loop.Init.(*ast.AssignStmt) if !ok || len(init.Lhs) != 1 || len(init.Rhs) != 1 { return true } cond, ok := loop.Cond.(*ast.BinaryExpr) if !ok { return true } x, ok := cond.X.(*ast.Ident) if !ok { return true } lhs, ok := init.Lhs[0].(*ast.Ident) if !ok { return true } if x.Obj != lhs.Obj { return true } if _, ok := loop.Post.(*ast.IncDecStmt); !ok { return true } ssafn := c.nodeFns[cond] if ssafn == nil { return true } v, isAddr := ssafn.ValueForExpr(cond.X) if v == nil || isAddr { return true } switch v := v.(type) { case *ssa.Phi: ops := v.Operands(nil) if len(ops) != 2 { return true } _, ok := (*ops[0]).(*ssa.Const) if !ok { return true } sigma, ok := (*ops[1]).(*ssa.Sigma) if !ok { return true } if sigma.X != v { return true } case *ssa.UnOp: return true } j.Errorf(cond, "variable in loop condition never changes") return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func (c *Checker) CheckArgOverwritten(j *lint.Job) { fn := func(node ast.Node) bool { var typ *ast.FuncType var body *ast.BlockStmt switch fn := node.(type) { case *ast.FuncDecl: typ = fn.Type body = fn.Body case *ast.FuncLit: typ = fn.Type body = fn.Body } if body == nil { return true } ssafn := c.nodeFns[node] if ssafn == nil { return true } if len(typ.Params.List) == 0 { return true } for _, field := range typ.Params.List { for _, arg := range field.Names { obj := j.Program.Info.ObjectOf(arg) var ssaobj *ssa.Parameter for _, param := range ssafn.Params { if param.Object() == obj { ssaobj = param break } } if ssaobj == nil { continue } refs := ssaobj.Referrers() if refs == nil { continue } if len(lint.FilterDebug(*refs)) != 0 { continue } assigned := false ast.Inspect(body, func(node ast.Node) bool { assign, ok := node.(*ast.AssignStmt) if !ok { return true } for _, lhs := range assign.Lhs { ident, ok := lhs.(*ast.Ident) if !ok { continue } if j.Program.Info.ObjectOf(ident) == obj { assigned = true return false } } return true }) if assigned { j.Errorf(arg, "argument %s is overwritten before first use", arg) } } } return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func (c *Checker) CheckIneffectiveLoop(j *lint.Job) { // This check detects some, but not all unconditional loop exits. // We give up in the following cases: // // - a goto anywhere in the loop. The goto might skip over our // return, and we don't check that it doesn't. // // - any nested, unlabelled continue, even if it is in another // loop or closure. fn := func(node ast.Node) bool { var body *ast.BlockStmt switch fn := node.(type) { case *ast.FuncDecl: body = fn.Body case *ast.FuncLit: body = fn.Body default: return true } if body == nil { return true } labels := map[*ast.Object]ast.Stmt{} ast.Inspect(body, func(node ast.Node) bool { label, ok := node.(*ast.LabeledStmt) if !ok { return true } labels[label.Label.Obj] = label.Stmt return true }) ast.Inspect(body, func(node ast.Node) bool { var loop ast.Node var body *ast.BlockStmt switch node := node.(type) { case *ast.ForStmt: body = node.Body loop = node case *ast.RangeStmt: typ := j.Program.Info.TypeOf(node.X) if _, ok := typ.Underlying().(*types.Map); ok { // looping once over a map is a valid pattern for // getting an arbitrary element. return true } body = node.Body loop = node default: return true } if len(body.List) < 2 { // avoid flagging the somewhat common pattern of using // a range loop to get the first element in a slice, // or the first rune in a string. return true } var unconditionalExit ast.Node hasBranching := false for _, stmt := range body.List { switch stmt := stmt.(type) { case *ast.BranchStmt: switch stmt.Tok { case token.BREAK: if stmt.Label == nil || labels[stmt.Label.Obj] == loop { unconditionalExit = stmt } case token.CONTINUE: if stmt.Label == nil || labels[stmt.Label.Obj] == loop { unconditionalExit = nil return false } } case *ast.ReturnStmt: unconditionalExit = stmt case *ast.IfStmt, *ast.ForStmt, *ast.RangeStmt, *ast.SwitchStmt, *ast.SelectStmt: hasBranching = true } } if unconditionalExit == nil || !hasBranching { return false } ast.Inspect(body, func(node ast.Node) bool { if branch, ok := node.(*ast.BranchStmt); ok { switch branch.Tok { case token.GOTO: unconditionalExit = nil return false case token.CONTINUE: if branch.Label != nil && labels[branch.Label.Obj] != loop { return true } unconditionalExit = nil return false } } return true }) if unconditionalExit != nil { j.Errorf(unconditionalExit, "the surrounding loop is unconditionally terminated") } return true }) return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func (c *Checker) CheckNilContext(j *lint.Job) { fn := func(node ast.Node) bool { call, ok := node.(*ast.CallExpr) if !ok { return true } if len(call.Args) == 0 { return true } if typ, ok := j.Program.Info.TypeOf(call.Args[0]).(*types.Basic); !ok || typ.Kind() != types.UntypedNil { return true } sig, ok := j.Program.Info.TypeOf(call.Fun).(*types.Signature) if !ok { return true } if sig.Params().Len() == 0 { return true } if types.TypeString(sig.Params().At(0).Type(), nil) != "context.Context" { return true } j.Errorf(call.Args[0], "do not pass a nil Context, even if a function permits it; pass context.TODO if you are unsure about which Context to use") return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func (c *Checker) CheckSeeker(j *lint.Job) { fn := func(node ast.Node) bool { call, ok := node.(*ast.CallExpr) if !ok { return true } sel, ok := call.Fun.(*ast.SelectorExpr) if !ok { return true } if sel.Sel.Name != "Seek" { return true } if len(call.Args) != 2 { return true } arg0, ok := call.Args[0].(*ast.SelectorExpr) if !ok { return true } switch arg0.Sel.Name { case "SeekStart", "SeekCurrent", "SeekEnd": default: return true } pkg, ok := arg0.X.(*ast.Ident) if !ok { return true } if pkg.Name != "io" { return true } j.Errorf(call, "the first argument of io.Seeker is the offset, but an io.Seek* constant is being used instead") return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func (c *Checker) CheckIneffectiveAppend(j *lint.Job) { isAppend := func(ins ssa.Value) bool { call, ok := ins.(*ssa.Call) if !ok { return false } if call.Call.IsInvoke() { return false } if builtin, ok := call.Call.Value.(*ssa.Builtin); !ok || builtin.Name() != "append" { return false } return true } for _, ssafn := range j.Program.InitialFunctions { for _, block := range ssafn.Blocks { for _, ins := range block.Instrs { val, ok := ins.(ssa.Value) if !ok || !isAppend(val) { continue } isUsed := false visited := map[ssa.Instruction]bool{} var walkRefs func(refs []ssa.Instruction) walkRefs = func(refs []ssa.Instruction) { loop: for _, ref := range refs { if visited[ref] { continue } visited[ref] = true if _, ok := ref.(*ssa.DebugRef); ok { continue } switch ref := ref.(type) { case *ssa.Phi: walkRefs(*ref.Referrers()) case *ssa.Sigma: walkRefs(*ref.Referrers()) case ssa.Value: if !isAppend(ref) { isUsed = true } else { walkRefs(*ref.Referrers()) } case ssa.Instruction: isUsed = true break loop } } } refs := val.Referrers() if refs == nil { continue } walkRefs(*refs) if !isUsed { j.Errorf(ins, "this result of append is never used, except maybe in other appends") } } } } } func (c *Checker) CheckConcurrentTesting(j *lint.Job) { for _, ssafn := range j.Program.InitialFunctions { for _, block := range ssafn.Blocks { for _, ins := range block.Instrs { gostmt, ok := ins.(*ssa.Go) if !ok { continue } var fn *ssa.Function switch val := gostmt.Call.Value.(type) { case *ssa.Function: fn = val case *ssa.MakeClosure: fn = val.Fn.(*ssa.Function) default: continue } if fn.Blocks == nil { continue } for _, block := range fn.Blocks { for _, ins := range block.Instrs { call, ok := ins.(*ssa.Call) if !ok { continue } if call.Call.IsInvoke() { continue } callee := call.Call.StaticCallee() if callee == nil { continue } recv := callee.Signature.Recv() if recv == nil { continue } if types.TypeString(recv.Type(), nil) != "*testing.common" { continue } fn, ok := call.Call.StaticCallee().Object().(*types.Func) if !ok { continue } name := fn.Name() switch name { case "FailNow", "Fatal", "Fatalf", "SkipNow", "Skip", "Skipf": default: continue } j.Errorf(gostmt, "the goroutine calls T.%s, which must be called in the same goroutine as the test", name) } } } } } } func (c *Checker) CheckCyclicFinalizer(j *lint.Job) { for _, ssafn := range j.Program.InitialFunctions { node := c.funcDescs.CallGraph.CreateNode(ssafn) for _, edge := range node.Out { if edge.Callee.Func.RelString(nil) != "runtime.SetFinalizer" { continue } arg0 := edge.Site.Common().Args[0] if iface, ok := arg0.(*ssa.MakeInterface); ok { arg0 = iface.X } unop, ok := arg0.(*ssa.UnOp) if !ok { continue } v, ok := unop.X.(*ssa.Alloc) if !ok { continue } arg1 := edge.Site.Common().Args[1] if iface, ok := arg1.(*ssa.MakeInterface); ok { arg1 = iface.X } mc, ok := arg1.(*ssa.MakeClosure) if !ok { continue } for _, b := range mc.Bindings { if b == v { pos := j.Program.SSA.Fset.Position(mc.Fn.Pos()) j.Errorf(edge.Site, "the finalizer closes over the object, preventing the finalizer from ever running (at %s)", pos) } } } } } func (c *Checker) CheckSliceOutOfBounds(j *lint.Job) { for _, ssafn := range j.Program.InitialFunctions { for _, block := range ssafn.Blocks { for _, ins := range block.Instrs { ia, ok := ins.(*ssa.IndexAddr) if !ok { continue } if _, ok := ia.X.Type().Underlying().(*types.Slice); !ok { continue } sr, ok1 := c.funcDescs.Get(ssafn).Ranges[ia.X].(vrp.SliceInterval) idxr, ok2 := c.funcDescs.Get(ssafn).Ranges[ia.Index].(vrp.IntInterval) if !ok1 || !ok2 || !sr.IsKnown() || !idxr.IsKnown() || sr.Length.Empty() || idxr.Empty() { continue } if idxr.Lower.Cmp(sr.Length.Upper) >= 0 { j.Errorf(ia, "index out of bounds") } } } } } func (c *Checker) CheckDeferLock(j *lint.Job) { for _, ssafn := range j.Program.InitialFunctions { for _, block := range ssafn.Blocks { instrs := lint.FilterDebug(block.Instrs) if len(instrs) < 2 { continue } for i, ins := range instrs[:len(instrs)-1] { call, ok := ins.(*ssa.Call) if !ok { continue } if !lint.IsCallTo(call.Common(), "(*sync.Mutex).Lock") && !lint.IsCallTo(call.Common(), "(*sync.RWMutex).RLock") { continue } nins, ok := instrs[i+1].(*ssa.Defer) if !ok { continue } if !lint.IsCallTo(&nins.Call, "(*sync.Mutex).Lock") && !lint.IsCallTo(&nins.Call, "(*sync.RWMutex).RLock") { continue } if call.Common().Args[0] != nins.Call.Args[0] { continue } name := shortCallName(call.Common()) alt := "" switch name { case "Lock": alt = "Unlock" case "RLock": alt = "RUnlock" } j.Errorf(nins, "deferring %s right after having locked already; did you mean to defer %s?", name, alt) } } } } func (c *Checker) CheckNaNComparison(j *lint.Job) { isNaN := func(v ssa.Value) bool { call, ok := v.(*ssa.Call) if !ok { return false } return lint.IsCallTo(call.Common(), "math.NaN") } for _, ssafn := range j.Program.InitialFunctions { for _, block := range ssafn.Blocks { for _, ins := range block.Instrs { ins, ok := ins.(*ssa.BinOp) if !ok { continue } if isNaN(ins.X) || isNaN(ins.Y) { j.Errorf(ins, "no value is equal to NaN, not even NaN itself") } } } } } func (c *Checker) CheckInfiniteRecursion(j *lint.Job) { for _, ssafn := range j.Program.InitialFunctions { node := c.funcDescs.CallGraph.CreateNode(ssafn) for _, edge := range node.Out { if edge.Callee != node { continue } block := edge.Site.Block() canReturn := false for _, b := range ssafn.Blocks { if block.Dominates(b) { continue } if len(b.Instrs) == 0 { continue } if _, ok := b.Instrs[len(b.Instrs)-1].(*ssa.Return); ok { canReturn = true break } } if canReturn { continue } j.Errorf(edge.Site, "infinite recursive call") } } } func objectName(obj types.Object) string { if obj == nil { return "<nil>" } var name string if obj.Pkg() != nil && obj.Pkg().Scope().Lookup(obj.Name()) == obj { var s string s = obj.Pkg().Path() if s != "" { name += s + "." } } name += obj.Name() return name } func isName(j *lint.Job, expr ast.Expr, name string) bool { var obj types.Object switch expr := expr.(type) { case *ast.Ident: obj = j.Program.Info.ObjectOf(expr) case *ast.SelectorExpr: obj = j.Program.Info.ObjectOf(expr.Sel) } return objectName(obj) == name } func (c *Checker) CheckLeakyTimeTick(j *lint.Job) { for _, ssafn := range j.Program.InitialFunctions { if j.IsInMain(ssafn) || j.IsInTest(ssafn) { continue } for _, block := range ssafn.Blocks { for _, ins := range block.Instrs { call, ok := ins.(*ssa.Call) if !ok || !lint.IsCallTo(call.Common(), "time.Tick") { continue } if c.funcDescs.Get(call.Parent()).Infinite { continue } j.Errorf(call, "using time.Tick leaks the underlying ticker, consider using it only in endless functions, tests and the main package, and use time.NewTicker here") } } } } func (c *Checker) CheckDoubleNegation(j *lint.Job) { fn := func(node ast.Node) bool { unary1, ok := node.(*ast.UnaryExpr) if !ok { return true } unary2, ok := unary1.X.(*ast.UnaryExpr) if !ok { return true } if unary1.Op != token.NOT || unary2.Op != token.NOT { return true } j.Errorf(unary1, "negating a boolean twice has no effect; is this a typo?") return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func hasSideEffects(node ast.Node) bool { dynamic := false ast.Inspect(node, func(node ast.Node) bool { switch node := node.(type) { case *ast.CallExpr: dynamic = true return false case *ast.UnaryExpr: if node.Op == token.ARROW { dynamic = true return false } } return true }) return dynamic } func (c *Checker) CheckRepeatedIfElse(j *lint.Job) { seen := map[ast.Node]bool{} var collectConds func(ifstmt *ast.IfStmt, inits []ast.Stmt, conds []ast.Expr) ([]ast.Stmt, []ast.Expr) collectConds = func(ifstmt *ast.IfStmt, inits []ast.Stmt, conds []ast.Expr) ([]ast.Stmt, []ast.Expr) { seen[ifstmt] = true if ifstmt.Init != nil { inits = append(inits, ifstmt.Init) } conds = append(conds, ifstmt.Cond) if elsestmt, ok := ifstmt.Else.(*ast.IfStmt); ok { return collectConds(elsestmt, inits, conds) } return inits, conds } fn := func(node ast.Node) bool { ifstmt, ok := node.(*ast.IfStmt) if !ok { return true } if seen[ifstmt] { return true } inits, conds := collectConds(ifstmt, nil, nil) if len(inits) > 0 { return true } for _, cond := range conds { if hasSideEffects(cond) { return true } } counts := map[string]int{} for _, cond := range conds { s := j.Render(cond) counts[s]++ if counts[s] == 2 { j.Errorf(cond, "this condition occurs multiple times in this if/else if chain") } } return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func (c *Checker) CheckSillyBitwiseOps(j *lint.Job) { for _, ssafn := range j.Program.InitialFunctions { for _, block := range ssafn.Blocks { for _, ins := range block.Instrs { ins, ok := ins.(*ssa.BinOp) if !ok { continue } if c, ok := ins.Y.(*ssa.Const); !ok || c.Value == nil || c.Value.Kind() != constant.Int || c.Uint64() != 0 { continue } switch ins.Op { case token.AND, token.OR, token.XOR: default: // we do not flag shifts because too often, x<<0 is part // of a pattern, x<<0, x<<8, x<<16, ... continue } path, _ := astutil.PathEnclosingInterval(j.File(ins), ins.Pos(), ins.Pos()) if len(path) == 0 { continue } if node, ok := path[0].(*ast.BinaryExpr); !ok || !lint.IsZero(node.Y) { continue } switch ins.Op { case token.AND: j.Errorf(ins, "x & 0 always equals 0") case token.OR, token.XOR: j.Errorf(ins, "x %s 0 always equals x", ins.Op) } } } } } func (c *Checker) CheckNonOctalFileMode(j *lint.Job) { fn := func(node ast.Node) bool { call, ok := node.(*ast.CallExpr) if !ok { return true } sig, ok := j.Program.Info.TypeOf(call.Fun).(*types.Signature) if !ok { return true } n := sig.Params().Len() var args []int for i := 0; i < n; i++ { typ := sig.Params().At(i).Type() if types.TypeString(typ, nil) == "os.FileMode" { args = append(args, i) } } for _, i := range args { lit, ok := call.Args[i].(*ast.BasicLit) if !ok { continue } if len(lit.Value) == 3 && lit.Value[0] != '0' && lit.Value[0] >= '0' && lit.Value[0] <= '7' && lit.Value[1] >= '0' && lit.Value[1] <= '7' && lit.Value[2] >= '0' && lit.Value[2] <= '7' { v, err := strconv.ParseInt(lit.Value, 10, 64) if err != nil { continue } j.Errorf(call.Args[i], "file mode '%s' evaluates to %#o; did you mean '0%s'?", lit.Value, v, lit.Value) } } return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func (c *Checker) CheckPureFunctions(j *lint.Job) { fnLoop: for _, ssafn := range j.Program.InitialFunctions { if j.IsInTest(ssafn) { params := ssafn.Signature.Params() for i := 0; i < params.Len(); i++ { param := params.At(i) if types.TypeString(param.Type(), nil) == "*testing.B" { // Ignore discarded pure functions in code related // to benchmarks. Instead of matching BenchmarkFoo // functions, we match any function accepting a // *testing.B. Benchmarks sometimes call generic // functions for doing the actual work, and // checking for the parameter is a lot easier and // faster than analyzing call trees. continue fnLoop } } } for _, b := range ssafn.Blocks { for _, ins := range b.Instrs { ins, ok := ins.(*ssa.Call) if !ok { continue } refs := ins.Referrers() if refs == nil || len(lint.FilterDebug(*refs)) > 0 { continue } callee := ins.Common().StaticCallee() if callee == nil { continue } if c.funcDescs.Get(callee).Pure { j.Errorf(ins, "%s is a pure function but its return value is ignored", callee.Name()) continue } } } } } func enclosingFunction(j *lint.Job, node ast.Node) *ast.FuncDecl { f := j.File(node) path, _ := astutil.PathEnclosingInterval(f, node.Pos(), node.Pos()) for _, e := range path { fn, ok := e.(*ast.FuncDecl) if !ok { continue } if fn.Name == nil { continue } return fn } return nil } func (c *Checker) isDeprecated(j *lint.Job, ident *ast.Ident) (bool, string) { obj := j.Program.Info.ObjectOf(ident) if obj.Pkg() == nil { return false, "" } alt := c.deprecatedObjs[obj] return alt != "", alt } func (c *Checker) CheckDeprecated(j *lint.Job) { fn := func(node ast.Node) bool { sel, ok := node.(*ast.SelectorExpr) if !ok { return true } if fn := enclosingFunction(j, sel); fn != nil { if ok, _ := c.isDeprecated(j, fn.Name); ok { // functions that are deprecated may use deprecated // symbols return true } } obj := j.Program.Info.ObjectOf(sel.Sel) if obj.Pkg() == nil { return true } nodePkg := j.NodePackage(node).Pkg if nodePkg == obj.Pkg() || obj.Pkg().Path()+"_test" == nodePkg.Path() { // Don't flag stuff in our own package return true } if ok, alt := c.isDeprecated(j, sel.Sel); ok { j.Errorf(sel, "%s is deprecated: %s", j.Render(sel), alt) return true } return true } for _, f := range j.Program.Files { ast.Inspect(f, fn) } } func (c *Checker) callChecker(rules map[string]CallCheck) func(j *lint.Job) { return func(j *lint.Job) { c.checkCalls(j, rules) } } func (c *Checker) checkCalls(j *lint.Job, rules map[string]CallCheck) { for _, ssafn := range j.Program.InitialFunctions { node := c.funcDescs.CallGraph.CreateNode(ssafn) for _, edge := range node.Out { callee := edge.Callee.Func obj, ok := callee.Object().(*types.Func) if !ok { continue } r, ok := rules[obj.FullName()] if !ok { continue } var args []*Argument ssaargs := edge.Site.Common().Args if callee.Signature.Recv() != nil { ssaargs = ssaargs[1:] } for _, arg := range ssaargs { if iarg, ok := arg.(*ssa.MakeInterface); ok { arg = iarg.X } vr := c.funcDescs.Get(edge.Site.Parent()).Ranges[arg] args = append(args, &Argument{Value: Value{arg, vr}}) } call := &Call{ Job: j, Instr: edge.Site, Args: args, Checker: c, Parent: edge.Site.Parent(), } r(call) for idx, arg := range call.Args { _ = idx for _, e := range arg.invalids { // path, _ := astutil.PathEnclosingInterval(f.File, edge.Site.Pos(), edge.Site.Pos()) // if len(path) < 2 { // continue // } // astcall, ok := path[0].(*ast.CallExpr) // if !ok { // continue // } // j.Errorf(astcall.Args[idx], "%s", e) j.Errorf(edge.Site, "%s", e) } } for _, e := range call.invalids { j.Errorf(call.Instr.Common(), "%s", e) } } } } func unwrapFunction(val ssa.Value) *ssa.Function { switch val := val.(type) { case *ssa.Function: return val case *ssa.MakeClosure: return val.Fn.(*ssa.Function) default: return nil } } func shortCallName(call *ssa.CallCommon) string { if call.IsInvoke() { return "" } switch v := call.Value.(type) { case *ssa.Function: fn, ok := v.Object().(*types.Func) if !ok { return "" } return fn.Name() case *ssa.Builtin: return v.Name() } return "" } func hasCallTo(block *ssa.BasicBlock, name string) bool { for _, ins := range block.Instrs { call, ok := ins.(*ssa.Call) if !ok { continue } if lint.IsCallTo(call.Common(), name) { return true } } return false } // deref returns a pointer's element type; otherwise it returns typ. func deref(typ types.Type) types.Type { if p, ok := typ.Underlying().(*types.Pointer); ok { return p.Elem() } return typ } func (c *Checker) CheckWriterBufferModified(j *lint.Job) { // TODO(dh): this might be a good candidate for taint analysis. // Taint the argument as MUST_NOT_MODIFY, then propagate that // through functions like bytes.Split for _, ssafn := range j.Program.InitialFunctions { sig := ssafn.Signature if ssafn.Name() != "Write" || sig.Recv() == nil || sig.Params().Len() != 1 || sig.Results().Len() != 2 { continue } tArg, ok := sig.Params().At(0).Type().(*types.Slice) if !ok { continue } if basic, ok := tArg.Elem().(*types.Basic); !ok || basic.Kind() != types.Byte { continue } if basic, ok := sig.Results().At(0).Type().(*types.Basic); !ok || basic.Kind() != types.Int { continue } if named, ok := sig.Results().At(1).Type().(*types.Named); !ok || types.TypeString(named, nil) != "error" { continue } for _, block := range ssafn.Blocks { for _, ins := range block.Instrs { switch ins := ins.(type) { case *ssa.Store: addr, ok := ins.Addr.(*ssa.IndexAddr) if !ok { continue } if addr.X != ssafn.Params[1] { continue } j.Errorf(ins, "io.Writer.Write must not modify the provided buffer, not even temporarily") case *ssa.Call: if !lint.IsCallTo(ins.Common(), "append") { continue } if ins.Common().Args[0] != ssafn.Params[1] { continue } j.Errorf(ins, "io.Writer.Write must not modify the provided buffer, not even temporarily") } } } } } func loopedRegexp(name string) CallCheck { return func(call *Call) { if len(extractConsts(call.Args[0].Value.Value)) == 0 { return } if !call.Checker.isInLoop(call.Instr.Block()) { return } call.Invalid(fmt.Sprintf("calling %s in a loop has poor performance, consider using regexp.Compile", name)) } } func (c *Checker) CheckEmptyBranch(j *lint.Job) { fn := func(node ast.Node) bool { ifstmt, ok := node.(*ast.IfStmt) if !ok { return true } ssafn := c.nodeFns[node] if lint.IsExample(ssafn) { return true } if ifstmt.Else != nil { b, ok := ifstmt.Else.(*ast.BlockStmt) if !ok || len(b.List) != 0 { return true } j.Errorf(ifstmt.Else, "empty branch") } if len(ifstmt.Body.List) != 0 { return true } j.Errorf(ifstmt, "empty branch") return true } for _, f := range c.filterGenerated(j.Program.Files) { ast.Inspect(f, fn) } } func (c *Checker) CheckMapBytesKey(j *lint.Job) { for _, fn := range j.Program.InitialFunctions { for _, b := range fn.Blocks { insLoop: for _, ins := range b.Instrs { // find []byte -> string conversions conv, ok := ins.(*ssa.Convert) if !ok || conv.Type() != types.Universe.Lookup("string").Type() { continue } if s, ok := conv.X.Type().(*types.Slice); !ok || s.Elem() != types.Universe.Lookup("byte").Type() { continue } refs := conv.Referrers() // need at least two (DebugRef) references: the // conversion and the *ast.Ident if refs == nil || len(*refs) < 2 { continue } ident := false // skip first reference, that's the conversion itself for _, ref := range (*refs)[1:] { switch ref := ref.(type) { case *ssa.DebugRef: if _, ok := ref.Expr.(*ast.Ident); !ok { // the string seems to be used somewhere // unexpected; the default branch should // catch this already, but be safe continue insLoop } else { ident = true } case *ssa.Lookup: default: // the string is used somewhere else than a // map lookup continue insLoop } } // the result of the conversion wasn't assigned to an // identifier if !ident { continue } j.Errorf(conv, "m[string(key)] would be more efficient than k := string(key); m[k]") } } } } func (c *Checker) CheckRangeStringRunes(j *lint.Job) { sharedcheck.CheckRangeStringRunes(c.nodeFns, j) } func (c *Checker) CheckSelfAssignment(j *lint.Job) { fn := func(node ast.Node) bool { assign, ok := node.(*ast.AssignStmt) if !ok { return true } if assign.Tok != token.ASSIGN || len(assign.Lhs) != len(assign.Rhs) { return true } for i, stmt := range assign.Lhs { rlh := j.Render(stmt) rrh := j.Render(assign.Rhs[i]) if rlh == rrh { j.Errorf(assign, "self-assignment of %s to %s", rrh, rlh) } } return true } for _, f := range c.filterGenerated(j.Program.Files) { ast.Inspect(f, fn) } } func buildTagsIdentical(s1, s2 []string) bool { if len(s1) != len(s2) { return false } s1s := make([]string, len(s1)) copy(s1s, s1) sort.Strings(s1s) s2s := make([]string, len(s2)) copy(s2s, s2) sort.Strings(s2s) for i, s := range s1s { if s != s2s[i] { return false } } return true } func (c *Checker) CheckDuplicateBuildConstraints(job *lint.Job) { for _, f := range c.filterGenerated(job.Program.Files) { constraints := buildTags(f) for i, constraint1 := range constraints { for j, constraint2 := range constraints { if i >= j { continue } if buildTagsIdentical(constraint1, constraint2) { job.Errorf(f, "identical build constraints %q and %q", strings.Join(constraint1, " "), strings.Join(constraint2, " ")) } } } } }
import * as React from 'react' import { observer } from 'mobx-react' const DevTools = require('mobx-react-devtools').default @observer class App extends React.Component<any, any> { render() { return ( <div> <div>{this.props.appState.count}</div> <button onClick={this.onReset}> Seconds passed: {this.props.appState.count} </button> <button onClick={this.onAdd}>Class List Count: { this.props.appState.counts }</button> <div> {this.props.appState.item.added} </div> <div> <button onClick={this.onDate}>Date Test</button> {this.props.appState.date && this.props.appState.date.toLocaleString()} instanceof Date: {(this.props.appState instanceof Object).toString()} </div> <button onClick={this.onPut}>put</button> <button onClick={this.onArrayIndex}>index test {this.props.appState.objectList[0].test}, {this.props.appState.objectList[3][0].test}, {this.props.appState.objectList.length}</button> { this.props.appState.list.map((item: number, idx: number) => <div key={idx}>{item}</div>) } <DevTools /> </div> ); } onAdd = () => { this.props.appState.add() } onDate = () => { this.props.appState.date = new Date } onArrayIndex = () => { this.props.appState.objectList[0].test++ this.props.appState.objectList[3][0] = { test: 1 } this.props.appState.objectList.push({t: 1, v: 1}) } onPut = () => { this.props.appState.put() } onReset = () => { this.props.appState.resetTimer(); } }; export default App
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_55) on Thu Apr 24 20:55:48 UTC 2014 --> <meta http-equiv="Content-Type" content="text/html" charset="utf-8"> <title>Uses of Class org.apache.solr.core.SolrXMLSerializer.SolrXMLDef (Solr 4.8.0 API)</title> <meta name="date" content="2014-04-24"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.solr.core.SolrXMLSerializer.SolrXMLDef (Solr 4.8.0 API)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/apache/solr/core/SolrXMLSerializer.SolrXMLDef.html" title="class in org.apache.solr.core">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/apache/solr/core/class-use/SolrXMLSerializer.SolrXMLDef.html" target="_top">Frames</a></li> <li><a href="SolrXMLSerializer.SolrXMLDef.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class org.apache.solr.core.SolrXMLSerializer.SolrXMLDef" class="title">Uses of Class<br>org.apache.solr.core.SolrXMLSerializer.SolrXMLDef</h2> </div> <div class="classUseContainer">No usage of org.apache.solr.core.SolrXMLSerializer.SolrXMLDef</div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/apache/solr/core/SolrXMLSerializer.SolrXMLDef.html" title="class in org.apache.solr.core">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/apache/solr/core/class-use/SolrXMLSerializer.SolrXMLDef.html" target="_top">Frames</a></li> <li><a href="SolrXMLSerializer.SolrXMLDef.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small> <i>Copyright &copy; 2000-2014 Apache Software Foundation. All Rights Reserved.</i> <script src='../../../../../prettify.js' type='text/javascript'></script> <script type='text/javascript'> (function(){ var oldonload = window.onload; if (typeof oldonload != 'function') { window.onload = prettyPrint; } else { window.onload = function() { oldonload(); prettyPrint(); } } })(); </script> </small></p> </body> </html>
<?php /** * config.inc.php * * @auteur marc laville - polinux * @Copyleft 2014-2016 - polinux * @date 14/06/2014 * @version 0.2 * @revision $0$ * * @date revision 21/02/2016 Utilisation de constante par define * * Parametres de la connexion à la base de données * */ /** * Database configuration */ define('DB_USERNAME', 'root'); define('DB_PASSWORD', ''); define('DB_HOST', 'localhost'); define('DB_NAME', 'flotte'); $loginServeur = DB_HOST; $loginUsername = DB_USERNAME; $loginPassword = DB_PASSWORD; $nomBase = DB_NAME; ?>
package async import ( "reflect" ) /* Filter allows you to filter out information from a slice in Waterfall mode. You must call the Done function with false as its first argument if you do not want the data to be present in the results. No other arguments will affect the performance of this function. When calling the Done function, an error will cause the filtering to immediately exit. For example, take a look at one of the tests for this function: func TestFilterString(t *testing.T) { str := []string{ "test1", "test2", "test3", "test4", "test5", } expects := []string{ "test1", "test2", "test4", "test5", } mapper := func(done async.Done, args ...interface{}) { Status("Hit string") Status("Args: %+v\n", args) if args[0] == "test3" { done(nil, false) return } done(nil, true) } final := func(err error, results ...interface{}) { Status("Hit string end") Status("Results: %+v\n", results) for i := 0; i < len(results); i++ { if results[i] != expects[i] { t.Errorf("Did not filter correctly.") break } } } async.Filter(str, mapper, final) } Each Routine function will be passed the current value and its index the slice for its arguments. */ func Filter(data interface{}, routine Routine, callbacks ...Done) { var ( routines []Routine results []interface{} ) d := reflect.ValueOf(data) for i := 0; i < d.Len(); i++ { v := d.Index(i).Interface() routines = append(routines, func(id int) Routine { return func(done Done, args ...interface{}) { done = func(original Done) Done { return func(err error, args ...interface{}) { if args[0] != false { results = append(results, v) } if id == (d.Len() - 1) { original(err, results...) return } original(err, args...) } }(done) routine(done, v, id) } }(i)) } Waterfall(routines, callbacks...) } /* FilterParallel allows you to filter out information from a slice in Parallel mode. You must call the Done function with false as its first argument if you do not want the data to be present in the results. No other arguments will affect the performance of this function. If there is an error, any further results will be discarded but it will not immediately exit. It will continue to run all of the other Routine functions that were passed into it. This is because by the time the error is sent, the goroutines have already been started. At this current time, there is no way to cancel a sleep timer in Go. For example, take a look at one of the tests for this function: func TestFilterStringParallel(t *testing.T) { str := []string{ "test1", "test2", "test3", "test4", "test5", } expects := []string{ "test1", "test2", "test4", "test5", } mapper := func(done async.Done, args ...interface{}) { Status("Hit string") Status("Args: %+v\n", args) if args[0] == "test3" { done(nil, false) return } done(nil, true) } final := func(err error, results ...interface{}) { Status("Hit string end") Status("Results: %+v\n", results) for i := 0; i < len(results); i++ { if results[i] != expects[i] { t.Errorf("Did not filter correctly.") break } } } async.FilterParallel(str, mapper, final) } Each Routine function will be passed the current value and its index the slice for its arguments. The output of filtering in Parallel mode cannot be guaranteed to stay in the same order, due to the fact that it may take longer to process some things in your filter routine. If you need the data to stay in the order it is in, use Filter instead to ensure it stays in order. */ func FilterParallel(data interface{}, routine Routine, callbacks ...Done) { var routines []Routine d := reflect.ValueOf(data) for i := 0; i < d.Len(); i++ { v := d.Index(i).Interface() routines = append(routines, func(id int) Routine { return func(done Done, args ...interface{}) { done = func(original Done) Done { return func(err error, args ...interface{}) { if args[0] != false { original(err, v) return } original(err) } }(done) routine(done, v, id) } }(i)) } Parallel(routines, callbacks...) }
# -*- coding: utf-8 -*- """The initialization file for the Pywikibot framework.""" # # (C) Pywikibot team, 2008-2014 # # Distributed under the terms of the MIT license. # from __future__ import unicode_literals __release__ = '2.0rc4' __version__ = '$Id: e26392a530582f286edf2d99e729218b2e93405e $' import datetime import math import re import sys import threading import json if sys.version_info[0] > 2: from queue import Queue long = int else: from Queue import Queue from warnings import warn # Use pywikibot. prefix for all in-package imports; this is to prevent # confusion with similarly-named modules in version 1 framework, for users # who want to continue using both from pywikibot import config2 as config from pywikibot.bot import ( output, warning, error, critical, debug, stdout, exception, input, input_choice, input_yn, inputChoice, handle_args, showHelp, ui, log, calledModuleName, Bot, CurrentPageBot, WikidataBot, QuitKeyboardInterrupt, # the following are flagged as deprecated on usage handleArgs, ) from pywikibot.exceptions import ( Error, InvalidTitle, BadTitle, NoPage, SectionError, SiteDefinitionError, NoSuchSite, UnknownSite, UnknownFamily, UnknownExtension, NoUsername, UserBlocked, PageRelatedError, IsRedirectPage, IsNotRedirectPage, PageSaveRelatedError, PageNotSaved, OtherPageSaveError, LockedPage, CascadeLockedPage, LockedNoPage, NoCreateError, EditConflict, PageDeletedConflict, PageCreatedConflict, ServerError, FatalServerError, Server504Error, CaptchaError, SpamfilterError, CircularRedirect, InterwikiRedirectPage, WikiBaseError, CoordinateGlobeUnknownException, ) from pywikibot.tools import UnicodeMixin, redirect_func from pywikibot.i18n import translate from pywikibot.data.api import UploadWarning from pywikibot.diff import PatchManager import pywikibot.textlib as textlib import pywikibot.tools textlib_methods = ( 'unescape', 'replaceExcept', 'removeDisabledParts', 'removeHTMLParts', 'isDisabled', 'interwikiFormat', 'interwikiSort', 'getLanguageLinks', 'replaceLanguageLinks', 'removeLanguageLinks', 'removeLanguageLinksAndSeparator', 'getCategoryLinks', 'categoryFormat', 'replaceCategoryLinks', 'removeCategoryLinks', 'removeCategoryLinksAndSeparator', 'replaceCategoryInPlace', 'compileLinkR', 'extract_templates_and_params', 'TimeStripper', ) # pep257 doesn't understand when the first entry is on the next line __all__ = ('config', 'ui', 'UnicodeMixin', 'translate', 'Page', 'FilePage', 'Category', 'Link', 'User', 'ItemPage', 'PropertyPage', 'Claim', 'html2unicode', 'url2unicode', 'unicode2html', 'stdout', 'output', 'warning', 'error', 'critical', 'debug', 'exception', 'input_choice', 'input', 'input_yn', 'inputChoice', 'handle_args', 'handleArgs', 'showHelp', 'ui', 'log', 'calledModuleName', 'Bot', 'CurrentPageBot', 'WikidataBot', 'Error', 'InvalidTitle', 'BadTitle', 'NoPage', 'SectionError', 'SiteDefinitionError', 'NoSuchSite', 'UnknownSite', 'UnknownFamily', 'UnknownExtension', 'NoUsername', 'UserBlocked', 'UserActionRefuse', 'PageRelatedError', 'IsRedirectPage', 'IsNotRedirectPage', 'PageSaveRelatedError', 'PageNotSaved', 'OtherPageSaveError', 'LockedPage', 'CascadeLockedPage', 'LockedNoPage', 'NoCreateError', 'EditConflict', 'PageDeletedConflict', 'PageCreatedConflict', 'UploadWarning', 'ServerError', 'FatalServerError', 'Server504Error', 'CaptchaError', 'SpamfilterError', 'CircularRedirect', 'InterwikiRedirectPage', 'WikiBaseError', 'CoordinateGlobeUnknownException', 'QuitKeyboardInterrupt', ) # flake8 is unable to detect concatenation in the same operation # like: # ) + textlib_methods # pep257 also doesn't support __all__ multiple times in a document # so instead use this trick globals()['__all__'] = globals()['__all__'] + textlib_methods if sys.version_info[0] == 2: # T111615: Python 2 requires __all__ is bytes globals()['__all__'] = tuple(bytes(item) for item in __all__) for _name in textlib_methods: target = getattr(textlib, _name) wrapped_func = redirect_func(target) globals()[_name] = wrapped_func deprecated = redirect_func(pywikibot.tools.deprecated) deprecate_arg = redirect_func(pywikibot.tools.deprecate_arg) class Timestamp(datetime.datetime): """Class for handling MediaWiki timestamps. This inherits from datetime.datetime, so it can use all of the methods and operations of a datetime object. To ensure that the results of any operation are also a Timestamp object, be sure to use only Timestamp objects (and datetime.timedeltas) in any operation. Use Timestamp.fromISOformat() and Timestamp.fromtimestampformat() to create Timestamp objects from MediaWiki string formats. As these constructors are typically used to create objects using data passed provided by site and page methods, some of which return a Timestamp when previously they returned a MediaWiki string representation, these methods also accept a Timestamp object, in which case they return a clone. Use Site.getcurrenttime() for the current time; this is more reliable than using Timestamp.utcnow(). """ mediawikiTSFormat = "%Y%m%d%H%M%S" ISO8601Format = "%Y-%m-%dT%H:%M:%SZ" def clone(self): """Clone this instance.""" return self.replace(microsecond=self.microsecond) @classmethod def fromISOformat(cls, ts): """Convert an ISO 8601 timestamp to a Timestamp object.""" # If inadvertantly passed a Timestamp object, use replace() # to create a clone. if isinstance(ts, cls): return ts.clone() return cls.strptime(ts, cls.ISO8601Format) @classmethod def fromtimestampformat(cls, ts): """Convert a MediaWiki internal timestamp to a Timestamp object.""" # If inadvertantly passed a Timestamp object, use replace() # to create a clone. if isinstance(ts, cls): return ts.clone() return cls.strptime(ts, cls.mediawikiTSFormat) def isoformat(self): """ Convert object to an ISO 8601 timestamp accepted by MediaWiki. datetime.datetime.isoformat does not postfix the ISO formatted date with a 'Z' unless a timezone is included, which causes MediaWiki ~1.19 and earlier to fail. """ return self.strftime(self.ISO8601Format) toISOformat = redirect_func(isoformat, old_name='toISOformat', class_name='Timestamp') def totimestampformat(self): """Convert object to a MediaWiki internal timestamp.""" return self.strftime(self.mediawikiTSFormat) def __str__(self): """Return a string format recognized by the API.""" return self.isoformat() def __add__(self, other): """Perform addition, returning a Timestamp instead of datetime.""" newdt = super(Timestamp, self).__add__(other) if isinstance(newdt, datetime.datetime): return Timestamp(newdt.year, newdt.month, newdt.day, newdt.hour, newdt.minute, newdt.second, newdt.microsecond, newdt.tzinfo) else: return newdt def __sub__(self, other): """Perform substraction, returning a Timestamp instead of datetime.""" newdt = super(Timestamp, self).__sub__(other) if isinstance(newdt, datetime.datetime): return Timestamp(newdt.year, newdt.month, newdt.day, newdt.hour, newdt.minute, newdt.second, newdt.microsecond, newdt.tzinfo) else: return newdt class Coordinate(object): """ Class for handling and storing Coordinates. For now its just being used for DataSite, but in the future we can use it for the GeoData extension. """ def __init__(self, lat, lon, alt=None, precision=None, globe='earth', typ="", name="", dim=None, site=None, entity=''): """ Represent a geo coordinate. @param lat: Latitude @type lat: float @param lon: Longitude @type lon: float @param alt: Altitute? TODO FIXME @param precision: precision @type precision: float @param globe: Which globe the point is on @type globe: str @param typ: The type of coordinate point @type typ: str @param name: The name @type name: str @param dim: Dimension (in meters) @type dim: int @param entity: The URL entity of a Wikibase item @type entity: str """ self.lat = lat self.lon = lon self.alt = alt self._precision = precision if globe: globe = globe.lower() self.globe = globe self._entity = entity self.type = typ self.name = name self._dim = dim if not site: self.site = Site().data_repository() else: self.site = site def __repr__(self): string = 'Coordinate(%s, %s' % (self.lat, self.lon) if self.globe != 'earth': string += ', globe="%s"' % self.globe string += ')' return string @property def entity(self): if self._entity: return self._entity return self.site.globes()[self.globe] def toWikibase(self): """ Export the data to a JSON object for the Wikibase API. FIXME: Should this be in the DataSite object? """ if self.globe not in self.site.globes(): raise CoordinateGlobeUnknownException( u"%s is not supported in Wikibase yet." % self.globe) return {'latitude': self.lat, 'longitude': self.lon, 'altitude': self.alt, 'globe': self.entity, 'precision': self.precision, } @classmethod def fromWikibase(cls, data, site): """Constructor to create an object from Wikibase's JSON output.""" globes = {} for k in site.globes(): globes[site.globes()[k]] = k globekey = data['globe'] if globekey: globe = globes.get(data['globe']) else: # Default to earth or should we use None here? globe = 'earth' return cls(data['latitude'], data['longitude'], data['altitude'], data['precision'], globe, site=site, entity=data['globe']) @property def precision(self): u""" Return the precision of the geo coordinate. The biggest error (in degrees) will be given by the longitudinal error; the same error in meters becomes larger (in degrees) further up north. We can thus ignore the latitudinal error. The longitudinal can be derived as follows: In small angle approximation (and thus in radians): M{Δλ ≈ Δpos / r_φ}, where r_φ is the radius of earth at the given latitude. Δλ is the error in longitude. M{r_φ = r cos φ}, where r is the radius of earth, φ the latitude Therefore:: precision = math.degrees(self._dim/(radius*math.cos(math.radians(self.lat)))) """ if not self._precision: radius = 6378137 # TODO: Support other globes self._precision = math.degrees( self._dim / (radius * math.cos(math.radians(self.lat)))) return self._precision def precisionToDim(self): """Convert precision from Wikibase to GeoData's dim.""" raise NotImplementedError class WbTime(object): """A Wikibase time representation.""" PRECISION = {'1000000000': 0, '100000000': 1, '10000000': 2, '1000000': 3, '100000': 4, '10000': 5, 'millenia': 6, 'century': 7, 'decade': 8, 'year': 9, 'month': 10, 'day': 11, 'hour': 12, 'minute': 13, 'second': 14 } FORMATSTR = '{0:+012d}-{1:02d}-{2:02d}T{3:02d}:{4:02d}:{5:02d}Z' def __init__(self, year=None, month=None, day=None, hour=None, minute=None, second=None, precision=None, before=0, after=0, timezone=0, calendarmodel=None, site=None): """ Create a new WbTime object. The precision can be set by the Wikibase int value (0-14) or by a human readable string, e.g., 'hour'. If no precision is given, it is set according to the given time units. """ if year is None: raise ValueError('no year given') self.precision = self.PRECISION['second'] if second is None: self.precision = self.PRECISION['minute'] second = 0 if minute is None: self.precision = self.PRECISION['hour'] minute = 0 if hour is None: self.precision = self.PRECISION['day'] hour = 0 if day is None: self.precision = self.PRECISION['month'] day = 1 if month is None: self.precision = self.PRECISION['year'] month = 1 self.year = long(year) self.month = month self.day = day self.hour = hour self.minute = minute self.second = second self.after = after self.before = before self.timezone = timezone if calendarmodel is None: if site is None: site = Site().data_repository() calendarmodel = site.calendarmodel() self.calendarmodel = calendarmodel # if precision is given it overwrites the autodetection above if precision is not None: if (isinstance(precision, int) and precision in self.PRECISION.values()): self.precision = precision elif precision in self.PRECISION: self.precision = self.PRECISION[precision] else: raise ValueError('Invalid precision: "%s"' % precision) @classmethod def fromTimestr(cls, datetimestr, precision=14, before=0, after=0, timezone=0, calendarmodel=None, site=None): match = re.match(r'([-+]?\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+)Z', datetimestr) if not match: raise ValueError(u"Invalid format: '%s'" % datetimestr) t = match.groups() return cls(long(t[0]), int(t[1]), int(t[2]), int(t[3]), int(t[4]), int(t[5]), precision, before, after, timezone, calendarmodel, site) def toTimestr(self): """ Convert the data to a UTC date/time string. @return: str """ return self.FORMATSTR.format(self.year, self.month, self.day, self.hour, self.minute, self.second) def toWikibase(self): """ Convert the data to a JSON object for the Wikibase API. @return: dict """ json = {'time': self.toTimestr(), 'precision': self.precision, 'after': self.after, 'before': self.before, 'timezone': self.timezone, 'calendarmodel': self.calendarmodel } return json @classmethod def fromWikibase(cls, ts): return cls.fromTimestr(ts[u'time'], ts[u'precision'], ts[u'before'], ts[u'after'], ts[u'timezone'], ts[u'calendarmodel']) def __str__(self): return json.dumps(self.toWikibase(), indent=4, sort_keys=True, separators=(',', ': ')) def __eq__(self, other): return self.__dict__ == other.__dict__ def __repr__(self): return u"WbTime(year=%(year)d, month=%(month)d, day=%(day)d, " \ u"hour=%(hour)d, minute=%(minute)d, second=%(second)d, " \ u"precision=%(precision)d, before=%(before)d, after=%(after)d, " \ u"timezone=%(timezone)d, calendarmodel='%(calendarmodel)s')" \ % self.__dict__ class WbQuantity(object): """A Wikibase quantity representation.""" def __init__(self, amount, unit=None, error=None): u""" Create a new WbQuantity object. @param amount: number representing this quantity @type amount: float @param unit: not used (only unit-less quantities are supported) @param error: the uncertainty of the amount (e.g. ±1) @type error: float, or tuple of two floats, where the first value is the upper error and the second is the lower error value. """ if amount is None: raise ValueError('no amount given') if unit is None: unit = '1' self.amount = amount self.unit = unit upperError = lowerError = 0 if isinstance(error, tuple): upperError, lowerError = error elif error is not None: upperError = lowerError = error self.upperBound = self.amount + upperError self.lowerBound = self.amount - lowerError def toWikibase(self): """Convert the data to a JSON object for the Wikibase API.""" json = {'amount': self.amount, 'upperBound': self.upperBound, 'lowerBound': self.lowerBound, 'unit': self.unit } return json @classmethod def fromWikibase(cls, wb): """ Create a WbQuanity from the JSON data given by the Wikibase API. @param wb: Wikibase JSON """ amount = eval(wb['amount']) upperBound = eval(wb['upperBound']) lowerBound = eval(wb['lowerBound']) error = (upperBound - amount, amount - lowerBound) return cls(amount, wb['unit'], error) def __str__(self): return json.dumps(self.toWikibase(), indent=4, sort_keys=True, separators=(',', ': ')) def __eq__(self, other): return self.__dict__ == other.__dict__ def __repr__(self): return (u"WbQuantity(amount=%(amount)s, upperBound=%(upperBound)s, " u"lowerBound=%(lowerBound)s, unit=%(unit)s)" % self.__dict__) _sites = {} _url_cache = {} # The code/fam pair for each URL def Site(code=None, fam=None, user=None, sysop=None, interface=None, url=None): """A factory method to obtain a Site object. Site objects are cached and reused by this method. By default rely on config settings. These defaults may all be overridden using the method parameters. @param code: language code (override config.mylang) @type code: string @param fam: family name or object (override config.family) @type fam: string or Family @param user: bot user name to use on this site (override config.usernames) @type user: unicode @param sysop: sysop user to use on this site (override config.sysopnames) @type sysop: unicode @param interface: site class or name of class in pywikibot.site (override config.site_interface) @type interface: subclass of L{pywikibot.site.BaseSite} or string @param url: Instead of code and fam, does try to get a Site based on the URL. Still requires that the family supporting that URL exists. @type url: string """ # Either code and fam or only url assert(not url or (not code and not fam)) _logger = "wiki" if url: if url in _url_cache: cached = _url_cache[url] if cached: code = cached[0] fam = cached[1] else: raise SiteDefinitionError("Unknown URL '{0}'.".format(url)) else: # Iterate through all families and look, which does apply to # the given URL for fam in config.family_files: try: family = pywikibot.family.Family.load(fam) code = family.from_url(url) if code: _url_cache[url] = (code, fam) break except Exception as e: pywikibot.warning('Error in Family(%s).from_url: %s' % (fam, e)) else: _url_cache[url] = None # TODO: As soon as AutoFamily is ready, try and use an # AutoFamily raise SiteDefinitionError("Unknown URL '{0}'.".format(url)) else: # Fallback to config defaults code = code or config.mylang fam = fam or config.family interface = interface or config.site_interface # config.usernames is initialised with a dict for each family name family_name = str(fam) if family_name in config.usernames: user = user or config.usernames[family_name].get(code) \ or config.usernames[family_name].get('*') sysop = sysop or config.sysopnames[family_name].get(code) \ or config.sysopnames[family_name].get('*') if not isinstance(interface, type): # If it isnt a class, assume it is a string try: tmp = __import__('pywikibot.site', fromlist=[interface]) interface = getattr(tmp, interface) except ImportError: raise ValueError("Invalid interface name '%(interface)s'" % locals()) if not issubclass(interface, pywikibot.site.BaseSite): warning('Site called with interface=%s' % interface.__name__) user = pywikibot.tools.normalize_username(user) key = '%s:%s:%s:%s' % (interface.__name__, fam, code, user) if key not in _sites or not isinstance(_sites[key], interface): _sites[key] = interface(code=code, fam=fam, user=user, sysop=sysop) debug(u"Instantiated %s object '%s'" % (interface.__name__, _sites[key]), _logger) if _sites[key].code != code: warn('Site %s instantiated using different code "%s"' % (_sites[key], code), UserWarning, 2) return _sites[key] # alias for backwards-compability getSite = pywikibot.tools.redirect_func(Site, old_name='getSite') from .page import ( Page, FilePage, Category, Link, User, ItemPage, PropertyPage, Claim, ) from .page import html2unicode, url2unicode, unicode2html link_regex = re.compile(r'\[\[(?P<title>[^\]|[<>{}]*)(\|.*?)?\]\]') @pywikibot.tools.deprecated("comment parameter for page saving method") def setAction(s): """Set a summary to use for changed page submissions.""" config.default_edit_summary = s def showDiff(oldtext, newtext, context=0): """ Output a string showing the differences between oldtext and newtext. The differences are highlighted (only on compatible systems) to show which changes were made. """ PatchManager(oldtext, newtext, context=context).print_hunks() # Throttle and thread handling stopped = False def stopme(): """Drop this process from the throttle log, after pending threads finish. Can be called manually if desired, but if not, will be called automatically at Python exit. """ global stopped _logger = "wiki" if not stopped: debug(u"stopme() called", _logger) def remaining(): remainingPages = page_put_queue.qsize() - 1 # -1 because we added a None element to stop the queue remainingSeconds = datetime.timedelta( seconds=(remainingPages * config.put_throttle)) return (remainingPages, remainingSeconds) page_put_queue.put((None, [], {})) stopped = True if page_put_queue.qsize() > 1: num, sec = remaining() format_values = dict(num=num, sec=sec) output(u'\03{lightblue}' u'Waiting for %(num)i pages to be put. ' u'Estimated time remaining: %(sec)s' u'\03{default}' % format_values) while(_putthread.isAlive()): try: _putthread.join(1) except KeyboardInterrupt: if input_yn('There are %i pages remaining in the queue. ' 'Estimated time remaining: %s\nReally exit?' % remaining(), default=False, automatic_quit=False): return # only need one drop() call because all throttles use the same global pid try: list(_sites.values())[0].throttle.drop() log(u"Dropped throttle(s).") except IndexError: pass import atexit atexit.register(stopme) # Create a separate thread for asynchronous page saves (and other requests) def async_manager(): """Daemon; take requests from the queue and execute them in background.""" while True: (request, args, kwargs) = page_put_queue.get() if request is None: break request(*args, **kwargs) page_put_queue.task_done() def async_request(request, *args, **kwargs): """Put a request on the queue, and start the daemon if necessary.""" if not _putthread.isAlive(): try: page_put_queue.mutex.acquire() try: _putthread.start() except (AssertionError, RuntimeError): pass finally: page_put_queue.mutex.release() page_put_queue.put((request, args, kwargs)) # queue to hold pending requests page_put_queue = Queue(config.max_queue_size) # set up the background thread _putthread = threading.Thread(target=async_manager) # identification for debugging purposes _putthread.setName('Put-Thread') _putthread.setDaemon(True) wrapper = pywikibot.tools.ModuleDeprecationWrapper(__name__) wrapper._add_deprecated_attr('ImagePage', FilePage) wrapper._add_deprecated_attr( 'PageNotFound', pywikibot.exceptions.DeprecatedPageNotFoundError, warning_message=('{0}.{1} is deprecated, and no longer ' 'used by pywikibot; use http.fetch() instead.')) wrapper._add_deprecated_attr( 'UserActionRefuse', pywikibot.exceptions._EmailUserError, warning_message='UserActionRefuse is deprecated; ' 'use UserRightsError and/or NotEmailableError')
<?php namespace App\Test\TestCase\Model\Table; use App\Model\Table\ImpostosTable; use Cake\ORM\TableRegistry; use Cake\TestSuite\TestCase; /** * App\Model\Table\ImpostosTable Test Case */ class ImpostosTableTest extends TestCase { /** * Fixtures * * @var array */ public $fixtures = [ 'app.impostos' ]; /** * setUp method * * @return void */ public function setUp() { parent::setUp(); $config = TableRegistry::exists('Impostos') ? [] : ['className' => 'App\Model\Table\ImpostosTable']; $this->Impostos = TableRegistry::get('Impostos', $config); } /** * tearDown method * * @return void */ public function tearDown() { unset($this->Impostos); parent::tearDown(); } /** * Test initialize method * * @return void */ public function testInitialize() { $this->markTestIncomplete('Not implemented yet.'); } /** * Test validationDefault method * * @return void */ public function testValidationDefault() { $this->markTestIncomplete('Not implemented yet.'); } }
export default function applyLocationOffset(rect, location, isOffsetBody) { var top = rect.top; var left = rect.left; if (isOffsetBody) { left = 0; top = 0; } return { top: top + location.top, left: left + location.left, height: rect.height, width: rect.width }; } //# sourceMappingURL=apply-location-offset.js.map
<?php defined('BASEPATH') OR exit('No direct script access allowed'); /* | ------------------------------------------------------------------- | DATABASE CONNECTIVITY SETTINGS | ------------------------------------------------------------------- | This file will contain the settings needed to access your database. | | For complete instructions please consult the 'Database Connection' | page of the User Guide. | | ------------------------------------------------------------------- | EXPLANATION OF VARIABLES | ------------------------------------------------------------------- | | ['dsn'] The full DSN string describe a connection to the database. | ['hostname'] The hostname of your database server. | ['username'] The username used to connect to the database | ['password'] The password used to connect to the database | ['database'] The name of the database you want to connect to | ['dbdriver'] The database driver. e.g.: mysqli. | Currently supported: | cubrid, ibase, mssql, mysql, mysqli, oci8, | odbc, pdo, postgre, sqlite, sqlite3, sqlsrv | ['dbprefix'] You can add an optional prefix, which will be added | to the table name when using the Query Builder class | ['pconnect'] TRUE/FALSE - Whether to use a persistent connection | ['db_debug'] TRUE/FALSE - Whether database errors should be displayed. | ['cache_on'] TRUE/FALSE - Enables/disables query caching | ['cachedir'] The path to the folder where cache files should be stored | ['char_set'] The character set used in communicating with the database | ['dbcollat'] The character collation used in communicating with the database | NOTE: For MySQL and MySQLi databases, this setting is only used | as a backup if your server is running PHP < 5.2.3 or MySQL < 5.0.7 | (and in table creation queries made with DB Forge). | There is an incompatibility in PHP with mysql_real_escape_string() which | can make your site vulnerable to SQL injection if you are using a | multi-byte character set and are running versions lower than these. | Sites using Latin-1 or UTF-8 database character set and collation are unaffected. | ['swap_pre'] A default table prefix that should be swapped with the dbprefix | ['encrypt'] Whether or not to use an encrypted connection. | | 'mysql' (deprecated), 'sqlsrv' and 'pdo/sqlsrv' drivers accept TRUE/FALSE | 'mysqli' and 'pdo/mysql' drivers accept an array with the following options: | | 'ssl_key' - Path to the private key file | 'ssl_cert' - Path to the public key certificate file | 'ssl_ca' - Path to the certificate authority file | 'ssl_capath' - Path to a directory containing trusted CA certificats in PEM format | 'ssl_cipher' - List of *allowed* ciphers to be used for the encryption, separated by colons (':') | 'ssl_verify' - TRUE/FALSE; Whether verify the server certificate or not ('mysqli' only) | | ['compress'] Whether or not to use client compression (MySQL only) | ['stricton'] TRUE/FALSE - forces 'Strict Mode' connections | - good for ensuring strict SQL while developing | ['ssl_options'] Used to set various SSL options that can be used when making SSL connections. | ['failover'] array - A array with 0 or more data for connections if the main should fail. | ['save_queries'] TRUE/FALSE - Whether to "save" all executed queries. | NOTE: Disabling this will also effectively disable both | $this->db->last_query() and profiling of DB queries. | When you run a query, with this setting set to TRUE (default), | CodeIgniter will store the SQL statement for debugging purposes. | However, this may cause high memory usage, especially if you run | a lot of SQL queries ... disable this to avoid that problem. | | The $active_group variable lets you choose which connection group to | make active. By default there is only one group (the 'default' group). | | The $query_builder variables lets you determine whether or not to load | the query builder class. */ $active_group = 'default'; $query_builder = TRUE; $db['default'] = array( 'dsn' => '', 'hostname' => 'YOUT_HOST', 'username' => 'YOUR_USERNAME', 'password' => 'YOUR_PASSWORD', 'database' => 'YOUR_DATABASE_NAME', 'dbdriver' => 'mysqli', 'dbprefix' => '', 'pconnect' => FALSE, 'db_debug' => (ENVIRONMENT !== 'production'), 'cache_on' => FALSE, 'cachedir' => '', 'char_set' => 'utf8', 'dbcollat' => 'utf8_general_ci', 'swap_pre' => '', 'encrypt' => FALSE, 'compress' => FALSE, 'stricton' => FALSE, 'failover' => array(), 'save_queries' => TRUE );
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Vahl's boxwood factsheet on ARKive - Buxus vahlii</title> <link rel="canonical" href="http://www.arkive.org/vahls-boxwood/buxus-vahlii/" /> <link rel="stylesheet" type="text/css" media="screen,print" href="/rcss/factsheet.css" /> <link rel="icon" href="/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" /> </head> <body> <!-- onload="window.print()">--> <div id="container"> <div id="header"><a href="/"><img src="/rimg/factsheet/header_left.png" alt="" border="0" /><img src="/rimg/factsheet/header_logo.png" alt="" border="0" /><img src="/rimg/factsheet/header_right.png" alt="" border="0" /></a></div> <div id="content"> <h1>Vahl's boxwood (<i>Buxus vahlii</i>)</h1> <img alt="" src="/media/87/87C70488-5715-47C3-B616-6C0C658FD916/Presentation.Large/Vahls-boxwood-leaves.jpg"/> <table cellspacing="0" cellpadding="0" id="factList"> <tbody> <tr class="kingdom"><th align="left">Kingdom</th><td align="left">Plantae</td></tr> <tr class="phylum"><th align="left">Phylum</th><td align="left">Tracheophyta</td></tr> <tr class="class"><th align="left">Class</th><td align="left">Magnoliopsida</td></tr> <tr class="order"><th align="left">Order</th><td align="left">Euphorbiales</td></tr> <tr class="family"><th align="left">Family</th><td align="left">Buxaceae</td></tr> <tr class="genus"><th align="left">Genus</th><td align="left"><em>Buxus (1)</em></td></tr> </tbody> </table> <h2><img src="/rimg/factsheet/Status.png" class="heading" /></h2><p class="Status"><p>This species is classified as Critically Endangered (CR) on the IUCN Red List (1).</p></p><h2><img src="/rimg/factsheet/Description.png" class="heading" /></h2><p class="Description"><p>Information on Vahl's boxwood is currently being researched and written and will appear here shortly.</p></p><h2><img src="/rimg/factsheet/FurtherInformation.png" class="heading" /></h2><p class="Find out more"><p>For more information on the vahl's boxwood, see:</p> <ul> <li> Center for Plant Conservation: <br/><a href="http://www.centerforplantconservation.org/Collection/CPC_ViewProfile.asp?CPCNum=644" target="_blank">http://www.centerforplantconservation.org/Collection/CPC_ViewProfile.asp?CPCNum=644</a></li> </ul> </p><h2><img src="/rimg/factsheet/Authentication.png" class="heading" /></h2><p class="AuthenticatioModel"><p>This information is awaiting authentication by a species expert, and will be updated as soon as possible. If you are able to help please contact: <br/><a href="mailto:arkive@wildscreen.org.uk">arkive@wildscreen.org.uk</a></p></p><h2><img src="/rimg/factsheet/References.png" class="heading" /></h2> <ol id="references"> <li id="ref1"> <a id="reference_1" name="reference_1"></a> IUCN Red List (July, 2010) <br/><a href="http://www.iucnredlist.org" target="_blank">http://www.iucnredlist.org</a></li> </ol> </div> </div> </body> </html>
KB.component('task-move-position', function (containerElement, options) { function getSelectedValue(id) { var element = KB.dom(document).find('#' + id); if (element) { return parseInt(element.options[element.selectedIndex].value); } return null; } function getSwimlaneId() { var swimlaneId = getSelectedValue('form-swimlanes'); return swimlaneId === null ? options.board[0].id : swimlaneId; } function getColumnId() { var columnId = getSelectedValue('form-columns'); return columnId === null ? options.board[0].columns[0].id : columnId; } function getPosition() { var position = getSelectedValue('form-position'); return position === null ? 1 : position; } function getPositionChoice() { var element = KB.find('input[name=positionChoice]:checked'); if (element) { return element.value; } return 'before'; } function onSwimlaneChanged() { var columnSelect = KB.dom(document).find('#form-columns'); KB.dom(columnSelect).replace(buildColumnSelect()); var taskSection = KB.dom(document).find('#form-tasks'); KB.dom(taskSection).replace(buildTasks()); } function onColumnChanged() { var taskSection = KB.dom(document).find('#form-tasks'); KB.dom(taskSection).replace(buildTasks()); } function onError(message) { KB.trigger('modal.stop'); KB.find('#message-container') .replace(KB.dom('div') .attr('id', 'message-container') .attr('class', 'alert alert-error') .text(message) .build() ); } function onSubmit() { var position = getPosition(); var positionChoice = getPositionChoice(); if (positionChoice === 'after') { position++; } KB.find('#message-container').replace(KB.dom('div').attr('id', 'message-container').build()); KB.http.postJson(options.saveUrl, { "column_id": getColumnId(), "swimlane_id": getSwimlaneId(), "position": position }).success(function () { window.location.reload(true); }).error(function (response) { if (response) { onError(response.message); } }); } function buildSwimlaneSelect() { var swimlanes = []; options.board.forEach(function(swimlane) { swimlanes.push({'value': swimlane.id, 'text': swimlane.name}); }); return KB.dom('select') .attr('id', 'form-swimlanes') .change(onSwimlaneChanged) .for('option', swimlanes) .build(); } function buildColumnSelect() { var columns = []; var swimlaneId = getSwimlaneId(); options.board.forEach(function(swimlane) { if (swimlaneId === swimlane.id) { swimlane.columns.forEach(function(column) { columns.push({'value': column.id, 'text': column.title}); }); } }); return KB.dom('select') .attr('id', 'form-columns') .change(onColumnChanged) .for('option', columns) .build(); } function buildTasks() { var tasks = []; var swimlaneId = getSwimlaneId(); var columnId = getColumnId(); var container = KB.dom('div').attr('id', 'form-tasks'); options.board.forEach(function (swimlane) { if (swimlaneId === swimlane.id) { swimlane.columns.forEach(function (column) { if (columnId === column.id) { column.tasks.forEach(function (task) { tasks.push({'value': task.position, 'text': '#' + task.id + ' - ' + task.title}); }); } }); } }); if (tasks.length > 0) { container .add(KB.html.label(options.positionLabel, 'form-position')) .add(KB.dom('select').attr('id', 'form-position').for('option', tasks).build()) .add(KB.html.radio(options.beforeLabel, 'positionChoice', 'before')) .add(KB.html.radio(options.afterLabel, 'positionChoice', 'after')) ; } return container.build(); } this.render = function () { KB.on('modal.submit', onSubmit); var form = KB.dom('div') .on('submit', onSubmit) .add(KB.dom('div').attr('id', 'message-container').build()) .add(KB.html.label(options.swimlaneLabel, 'form-swimlanes')) .add(buildSwimlaneSelect()) .add(KB.html.label(options.columnLabel, 'form-columns')) .add(buildColumnSelect()) .add(buildTasks()) .build(); containerElement.appendChild(form); }; });
using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Reflection; using System.Text; using EOLib.IO.Pub; using EOLib.IO.Services; using NUnit.Framework; namespace EOLib.IO.Test.Pub { [TestFixture, ExcludeFromCodeCoverage] public class EIFRecordTest { [Test] public void EIFRecord_GetGlobalPropertyID_GetsRecordID() { const int expected = 44; var rec = new EIFRecord {ID = expected}; var actual = rec.Get<int>(PubRecordProperty.GlobalID); Assert.AreEqual(expected, actual); } [Test] public void EIFRecord_GetGlobalPropertyName_GetsRecordName() { const string expected = "some name"; var rec = new EIFRecord { Name = expected }; var actual = rec.Get<string>(PubRecordProperty.GlobalName); Assert.AreEqual(expected, actual); } [Test] public void EIFRecord_GetItemPropertiesComprehensive_NoException() { var itemProperties = Enum.GetNames(typeof (PubRecordProperty)) .Where(x => x.StartsWith("Item")) .Select(x => (PubRecordProperty) Enum.Parse(typeof (PubRecordProperty), x)) .ToArray(); Assert.AreNotEqual(0, itemProperties.Length); var record = new EIFRecord(); foreach (var property in itemProperties) { var dummy = record.Get<object>(property); Assert.IsNotNull(dummy); } } [Test] public void EIFRecord_GetNPCProperty_ThrowsArgumentOutOfRangeException() { const PubRecordProperty invalidProperty = PubRecordProperty.NPCAccuracy; var record = new EIFRecord(); Assert.Throws<ArgumentOutOfRangeException>(() => record.Get<object>(invalidProperty)); } [Test] public void EIFRecord_GetSpellProperty_ThrowsArgumentOutOfRangeException() { const PubRecordProperty invalidProperty = PubRecordProperty.SpellAccuracy; var record = new EIFRecord(); Assert.Throws<ArgumentOutOfRangeException>(() => record.Get<object>(invalidProperty)); } [Test] public void EIFRecord_GetClassProperty_ThrowsArgumentOutOfRangeException() { const PubRecordProperty invalidProperty = PubRecordProperty.ClassAgi; var record = new EIFRecord(); Assert.Throws<ArgumentOutOfRangeException>(() => record.Get<object>(invalidProperty)); } [Test] public void EIFRecord_InvalidPropertyReturnType_ThrowsInvalidCastException() { var rec = new EIFRecord {Name = ""}; Assert.Throws<InvalidCastException>(() => rec.Get<int>(PubRecordProperty.GlobalName)); } [Test] public void EIFRecord_SerializeToByteArray_WritesExpectedFormat() { var numberEncoderService = new NumberEncoderService(); var record = CreateRecordWithSomeGoodTestData(); var actualBytes = record.SerializeToByteArray(numberEncoderService); var expectedBytes = GetExpectedBytes(record, numberEncoderService); CollectionAssert.AreEqual(expectedBytes, actualBytes); } [Test] public void EIFRecord_DeserializeFromByteArray_HasCorrectData() { var numberEncoderService = new NumberEncoderService(); var sourceRecord = CreateRecordWithSomeGoodTestData(); var sourceRecordBytes = GetExpectedBytesWithoutName(sourceRecord, numberEncoderService); var record = new EIFRecord { ID = sourceRecord.ID, Name = sourceRecord.Name }; record.DeserializeFromByteArray(sourceRecordBytes, numberEncoderService); var properties = record.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance); Assert.IsTrue(properties.Length > 0); foreach (var property in properties) { var expectedValue = property.GetValue(sourceRecord); var actualValue = property.GetValue(record); Assert.AreEqual(expectedValue, actualValue, "Property: {0}", property.Name); } } [Test] public void EIFRecord_DeserializeFromByteArray_InvalidArrayLength_ThrowsException() { var record = new EIFRecord(); Assert.Throws<ArgumentOutOfRangeException>(() => record.DeserializeFromByteArray(new byte[] { 1, 2, 3 }, new NumberEncoderService())); } [Test] public void EIFRecord_GunOverride_ConvertsItemSubTypeToRanged() { var record = new EIFRecord {ID = 365, Name = "Gun", SubType = ItemSubType.Arrows}; record.DeserializeFromByteArray(Enumerable.Repeat((byte)128, EIFRecord.DATA_SIZE).ToArray(), new NumberEncoderService()); Assert.AreEqual(ItemSubType.Ranged, record.SubType); } [Test] public void EIFRecord_SharedValueSet1_HaveSameValue() { var properties = new[] { "ScrollMap", "DollGraphic", "ExpReward", "HairColor", "Effect", "Key" }; var record = new EIFRecord(); var value = new Random().Next(100); foreach (var prop in properties) { record.GetType().GetProperty(prop, BindingFlags.Instance | BindingFlags.Public) .SetValue(record, value); Assert.AreEqual(value, record.ScrollMap); Assert.AreEqual(value, record.DollGraphic); Assert.AreEqual(value, record.ExpReward); Assert.AreEqual(value, record.HairColor); Assert.AreEqual(value, record.Effect); Assert.AreEqual(value, record.Key); value++; } } [Test] public void EIFRecord_SharedValueSet2_HaveSameValue() { var properties = new[] { "Gender", "ScrollX" }; var record = new EIFRecord(); var value = new Random().Next(100); foreach (var prop in properties) { record.GetType().GetProperty(prop, BindingFlags.Instance | BindingFlags.Public) .SetValue(record, (byte)value); Assert.AreEqual(value, record.Gender); Assert.AreEqual(value, record.ScrollX); value++; } } [Test] public void EIFRecord_SharedValueSet3_HaveSameValue() { var properties = new[] { "ScrollY", "DualWieldDollGraphic" }; var record = new EIFRecord(); var value = new Random().Next(100); foreach (var prop in properties) { record.GetType().GetProperty(prop, BindingFlags.Instance | BindingFlags.Public) .SetValue(record, (byte)value); Assert.AreEqual(value, record.ScrollY); Assert.AreEqual(value, record.DualWieldDollGraphic); value++; } } private static EIFRecord CreateRecordWithSomeGoodTestData() { return new EIFRecord { ID = 1, Name = "TestName", Graphic = 123, Type = ItemType.Bracer, SubType = ItemSubType.Ranged, Special = ItemSpecial.Unique, HP = 456, TP = 654, MinDam = 33, MaxDam = 66, Accuracy = 100, Evade = 200, Armor = 300, Str = 40, Int = 50, Wis = 60, Agi = 70, Con = 80, Cha = 90, Light = 3, Dark = 6, Earth = 9, Air = 12, Water = 15, Fire = 18, ScrollMap = 33, Gender = 44, ScrollY = 55, LevelReq = 66, ClassReq = 77, StrReq = 88, IntReq = 99, WisReq = 30, AgiReq = 20, ConReq = 10, ChaReq = 5, Weight = 200, Size = ItemSize.Size2x3 }; } private static byte[] GetExpectedBytes(EIFRecord rec, INumberEncoderService nes) { var ret = new List<byte>(); ret.AddRange(nes.EncodeNumber(rec.Name.Length, 1)); ret.AddRange(Encoding.ASCII.GetBytes(rec.Name)); ret.AddRange(GetExpectedBytesWithoutName(rec, nes)); return ret.ToArray(); } private static byte[] GetExpectedBytesWithoutName(EIFRecord rec, INumberEncoderService nes) { var ret = new List<byte>(); ret.AddRange(nes.EncodeNumber(rec.Graphic, 2)); ret.AddRange(nes.EncodeNumber((byte)rec.Type, 1)); ret.AddRange(nes.EncodeNumber((byte)rec.SubType, 1)); ret.AddRange(nes.EncodeNumber((byte)rec.Special, 1)); ret.AddRange(nes.EncodeNumber(rec.HP, 2)); ret.AddRange(nes.EncodeNumber(rec.TP, 2)); ret.AddRange(nes.EncodeNumber(rec.MinDam, 2)); ret.AddRange(nes.EncodeNumber(rec.MaxDam, 2)); ret.AddRange(nes.EncodeNumber(rec.Accuracy, 2)); ret.AddRange(nes.EncodeNumber(rec.Evade, 2)); ret.AddRange(nes.EncodeNumber(rec.Armor, 2)); ret.AddRange(Enumerable.Repeat((byte)254, 1)); ret.AddRange(nes.EncodeNumber(rec.Str, 1)); ret.AddRange(nes.EncodeNumber(rec.Int, 1)); ret.AddRange(nes.EncodeNumber(rec.Wis, 1)); ret.AddRange(nes.EncodeNumber(rec.Agi, 1)); ret.AddRange(nes.EncodeNumber(rec.Con, 1)); ret.AddRange(nes.EncodeNumber(rec.Cha, 1)); ret.AddRange(nes.EncodeNumber(rec.Light, 1)); ret.AddRange(nes.EncodeNumber(rec.Dark, 1)); ret.AddRange(nes.EncodeNumber(rec.Earth, 1)); ret.AddRange(nes.EncodeNumber(rec.Air, 1)); ret.AddRange(nes.EncodeNumber(rec.Water, 1)); ret.AddRange(nes.EncodeNumber(rec.Fire, 1)); ret.AddRange(nes.EncodeNumber(rec.ScrollMap, 3)); ret.AddRange(nes.EncodeNumber(rec.ScrollX, 1)); ret.AddRange(nes.EncodeNumber(rec.ScrollY, 1)); ret.AddRange(nes.EncodeNumber(rec.LevelReq, 2)); ret.AddRange(nes.EncodeNumber(rec.ClassReq, 2)); ret.AddRange(nes.EncodeNumber(rec.StrReq, 2)); ret.AddRange(nes.EncodeNumber(rec.IntReq, 2)); ret.AddRange(nes.EncodeNumber(rec.WisReq, 2)); ret.AddRange(nes.EncodeNumber(rec.AgiReq, 2)); ret.AddRange(nes.EncodeNumber(rec.ConReq, 2)); ret.AddRange(nes.EncodeNumber(rec.ChaReq, 2)); ret.AddRange(Enumerable.Repeat((byte)254, 2)); ret.AddRange(nes.EncodeNumber(rec.Weight, 1)); ret.AddRange(Enumerable.Repeat((byte)254, 1)); ret.AddRange(nes.EncodeNumber((byte)rec.Size, 1)); return ret.ToArray(); } } }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>ramsey: 8 s</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.10.0 / ramsey - 8.10.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> ramsey <small> 8.10.0 <span class="label label-success">8 s</span> </small> </h1> <p><em><script>document.write(moment("2020-02-26 23:22:14 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-02-26 23:22:14 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils conf-m4 1 Virtual package relying on m4 coq 8.10.0 Formal proof management system num 1.3 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.09.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.09.0 Official release 4.09.0 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.8.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;Hugo.Herbelin@inria.fr&quot; homepage: &quot;https://github.com/coq-contribs/ramsey&quot; license: &quot;LGPL 2.1&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/Ramsey&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.10&quot; &amp; &lt; &quot;8.11~&quot;} ] tags: [ &quot;keyword: dimension one Ramsey theorem&quot; &quot;keyword: constructive mathematics&quot; &quot;keyword: almost full sets&quot; &quot;category: Mathematics/Logic/See also&quot; &quot;category: Mathematics/Combinatorics and Graph Theory&quot; &quot;category: Miscellaneous/Extracted Programs/Combinatorics&quot; ] authors: [ &quot;Marc Bezem&quot; ] bug-reports: &quot;https://github.com/coq-contribs/ramsey/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/ramsey.git&quot; synopsis: &quot;Ramsey Theory&quot; description: &quot;&quot;&quot; For dimension one, the Infinite Ramsey Theorem states that, for any subset A of the natural numbers nat, either A or nat\\A is infinite. This special case of the Pigeon Hole Principle is classically equivalent to: if A and B are both co-finite, then so is their intersection. None of these principles is constructively valid. In [VB] the notion of an almost full set is introduced, classically equivalent to co-finiteness, for which closure under finite intersection can be proved constructively. A is almost full if for every (strictly) increasing sequence f: nat -&gt; nat there exists an x in nat such that f(x) in A. The notion of almost full and its closure under finite intersection are generalized to all finite dimensions, yielding constructive Ramsey Theorems. The proofs for dimension two and higher essentially use Brouwer&#39;s Bar Theorem. In the proof development below we strengthen the notion of almost full for dimension one in the following sense. A: nat -&gt; Prop is called Y-full if for every (strictly) increasing sequence f: nat -&gt; nat we have (A (f (Y f))). Here of course Y : (nat -&gt; nat) -&gt; nat. Given YA-full A and YB-full B we construct X from YA and YB such that the intersection of A and B is X-full. This is essentially [VB, Th. 5.4], but now it can be done without using axioms, using only inductive types. The generalization to higher dimensions will be much more difficult and is not pursued here.&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/ramsey/archive/v8.10.0.tar.gz&quot; checksum: &quot;md5=4ac9988a8896338d3f8000c5832e39f0&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-ramsey.8.10.0 coq.8.10.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam list; echo; ulimit -Sv 4000000; timeout 2h opam install -y --deps-only coq-ramsey.8.10.0 coq.8.10.0</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>4 s</dd> </dl> <h2>Install</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam list; echo; ulimit -Sv 16000000; timeout 2h opam install -y -v coq-ramsey.8.10.0 coq.8.10.0</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>8 s</dd> </dl> <h2>Installation size</h2> <p>Total: 37 K</p> <ul> <li>16 K <code>../ocaml-base-compiler.4.09.0/lib/coq/user-contrib/Ramsey/Ramsey.vo</code></li> <li>13 K <code>../ocaml-base-compiler.4.09.0/lib/coq/user-contrib/Ramsey/Ramsey.glob</code></li> <li>8 K <code>../ocaml-base-compiler.4.09.0/lib/coq/user-contrib/Ramsey/Ramsey.v</code></li> </ul> <h2>Uninstall</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq-ramsey.8.10.0</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> <small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small> </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
# import libraries import urllib.request from feedgen.feed import FeedGenerator from post_parser import post_title, post_author, post_time, post_files_num from misc import is_number # info baseurl = 'http://phya.snu.ac.kr/xe/underbbs/' url ='http://phya.snu.ac.kr/xe/index.php?mid=underbbs&category=372' # notices + general f = open('srl_notices.txt','r') num_notices = f.read().split(',') f.close() g = open('srl_general.txt','r') num_general = g.read().split(',') g.close() g = open('srl_general.txt','a') response = urllib.request.urlopen(url) data = response.read() text = data.decode('utf-8') count_new = 0 srl_arr_general = [] text_splitted = text.split('document_srl=') for i in range(1,len(text_splitted)): srl = text_splitted[i].split('">')[0].split('#comment')[0] if(is_number(srl)): if(srl not in num_notices and srl not in srl_arr_general): # second statement : to prevent duplication srl_arr_general.append(srl) if(srl not in num_general): count_new += 1 g.write(',' + srl) print('New post found : ' + srl) g.close() if(count_new != 0): print('Started generating feed...') # make FeedGenerator fg = FeedGenerator() fg.id('asdf') fg.title('SNU Physics Board RSS feed - general') fg.author({'name':'Seungwon Park','email':'yyyyy at snu dot ac dot kr'}) fg.link(href='asdf') fg.subtitle('SNU Physics Board RSS - general') fg.language('ko') for srl in srl_arr_general: print('Parsing post #' + srl + '...') fe = fg.add_entry() fe.id(baseurl + srl) fe.title(post_title(srl)) fe.author({'name':post_author(srl),'email':'unknown'}) fe.link(href = baseurl + srl) atomfeed = fg.atom_str(pretty=True) fg.atom_file('general.xml') print('Added ' + str(count_new) + ' posts to feed.') else: print('Posts are up-to-date.')
<table width="90%" border="0"><tr><td><script>function openfile(url) {fullwin = window.open(url, "fulltext", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");}</script><div class="flayoutclass"><div class="flayoutclass_first"><table class="tableoutfmt2"><tr><th class="std1"><b>條目&nbsp;</b></th><td class="std2">撮科打哄</td></tr> <tr><th class="std1"><b>注音&nbsp;</b></th><td class="std2">ㄘㄨㄛ ㄎㄜ ㄉㄚ<sup class="subfont">ˇ</sup> ㄏㄨㄥ<sup class="subfont">ˇ</sup></td></tr> <tr><th class="std1"><b>漢語拼音&nbsp;</b></th><td class="std2"><font class="english_word">cuō kē dǎ hǒng</font></td></tr> <tr><th class="std1"><b>釋義&nbsp;</b></th><td class="std2">以詼諧的言詞及有趣的動作引人發笑。明˙湯顯祖˙南柯記˙第六齣:<img src=/cydic/dicword/fa40.gif border=0 alt=* class=fontimg valign=center>但是晦氣的人家,便請我撮科打哄;不管有趣的子弟,都與他鑽懶鬧閒。<img src=/cydic/dicword/fa41.gif border=0 alt=* class=fontimg valign=center></td></tr> <tr><th class="std1"><b><font class="fltypefont">附錄</font>&nbsp;</b></th><td class="std2">修訂本參考資料</td></tr> </td></tr></table></div> <!-- flayoutclass_first --><div class="flayoutclass_second"></div> <!-- flayoutclass_second --></div> <!-- flayoutclass --></td></tr></table>
/* Copyright 2017-2019 Igor Petrovic Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef __CORE_GENERAL_IO #define __CORE_GENERAL_IO #ifdef __AVR__ #include "../arch/avr/IO.h" #elif defined __STM32__ #include "../arch/stm32/IO.h" #else #include "../arch/stub/IO.h" #endif #endif
//this source code was auto-generated by tolua#, do not modify it using System; using System.Collections.Generic; using LuaInterface; public class DelegateFactory { public delegate Delegate DelegateCreate(LuaFunction func, LuaTable self, bool flag); public static Dictionary<Type, DelegateCreate> dict = new Dictionary<Type, DelegateCreate>(); static DelegateFactory factory = new DelegateFactory(); public static void Init() { Register(); } public static void Register() { dict.Clear(); dict.Add(typeof(System.Action), factory.System_Action); dict.Add(typeof(UnityEngine.Events.UnityAction), factory.UnityEngine_Events_UnityAction); dict.Add(typeof(System.Predicate<int>), factory.System_Predicate_int); dict.Add(typeof(System.Action<int>), factory.System_Action_int); dict.Add(typeof(System.Comparison<int>), factory.System_Comparison_int); dict.Add(typeof(System.Func<int,int>), factory.System_Func_int_int); dict.Add(typeof(UnityEngine.RectTransform.ReapplyDrivenProperties), factory.UnityEngine_RectTransform_ReapplyDrivenProperties); dict.Add(typeof(UnityEngine.Camera.CameraCallback), factory.UnityEngine_Camera_CameraCallback); dict.Add(typeof(UnityEngine.Application.LowMemoryCallback), factory.UnityEngine_Application_LowMemoryCallback); dict.Add(typeof(UnityEngine.Application.AdvertisingIdentifierCallback), factory.UnityEngine_Application_AdvertisingIdentifierCallback); dict.Add(typeof(UnityEngine.Application.LogCallback), factory.UnityEngine_Application_LogCallback); dict.Add(typeof(UnityEngine.AudioClip.PCMReaderCallback), factory.UnityEngine_AudioClip_PCMReaderCallback); dict.Add(typeof(UnityEngine.AudioClip.PCMSetPositionCallback), factory.UnityEngine_AudioClip_PCMSetPositionCallback); dict.Add(typeof(System.Action<UnityEngine.AsyncOperation>), factory.System_Action_UnityEngine_AsyncOperation); dict.Add(typeof(UnityEngine.Font.FontTextureRebuildCallback), factory.UnityEngine_Font_FontTextureRebuildCallback); dict.Add(typeof(System.Action<UnityEngine.Font>), factory.System_Action_UnityEngine_Font); dict.Add(typeof(System.Predicate<UnityEngine.UILineInfo>), factory.System_Predicate_UnityEngine_UILineInfo); dict.Add(typeof(System.Action<UnityEngine.UILineInfo>), factory.System_Action_UnityEngine_UILineInfo); dict.Add(typeof(System.Comparison<UnityEngine.UILineInfo>), factory.System_Comparison_UnityEngine_UILineInfo); dict.Add(typeof(ZipTool.DelegateZipCall), factory.ZipTool_DelegateZipCall); dict.Add(typeof(System.AsyncCallback), factory.System_AsyncCallback); dict.Add(typeof(ToLuaFramework.DelegateThreadFunc), factory.ToLuaFramework_DelegateThreadFunc); dict.Add(typeof(ToLuaFramework.DelegateThreadFuncCb), factory.ToLuaFramework_DelegateThreadFuncCb); dict.Add(typeof(System.Predicate<object>), factory.System_Predicate_object); dict.Add(typeof(System.Action<object>), factory.System_Action_object); dict.Add(typeof(System.Comparison<object>), factory.System_Comparison_object); dict.Add(typeof(Delegate_SocketEvent), factory.Delegate_SocketEvent); DelegateTraits<System.Action>.Init(factory.System_Action); DelegateTraits<UnityEngine.Events.UnityAction>.Init(factory.UnityEngine_Events_UnityAction); DelegateTraits<System.Predicate<int>>.Init(factory.System_Predicate_int); DelegateTraits<System.Action<int>>.Init(factory.System_Action_int); DelegateTraits<System.Comparison<int>>.Init(factory.System_Comparison_int); DelegateTraits<System.Func<int,int>>.Init(factory.System_Func_int_int); DelegateTraits<UnityEngine.RectTransform.ReapplyDrivenProperties>.Init(factory.UnityEngine_RectTransform_ReapplyDrivenProperties); DelegateTraits<UnityEngine.Camera.CameraCallback>.Init(factory.UnityEngine_Camera_CameraCallback); DelegateTraits<UnityEngine.Application.LowMemoryCallback>.Init(factory.UnityEngine_Application_LowMemoryCallback); DelegateTraits<UnityEngine.Application.AdvertisingIdentifierCallback>.Init(factory.UnityEngine_Application_AdvertisingIdentifierCallback); DelegateTraits<UnityEngine.Application.LogCallback>.Init(factory.UnityEngine_Application_LogCallback); DelegateTraits<UnityEngine.AudioClip.PCMReaderCallback>.Init(factory.UnityEngine_AudioClip_PCMReaderCallback); DelegateTraits<UnityEngine.AudioClip.PCMSetPositionCallback>.Init(factory.UnityEngine_AudioClip_PCMSetPositionCallback); DelegateTraits<System.Action<UnityEngine.AsyncOperation>>.Init(factory.System_Action_UnityEngine_AsyncOperation); DelegateTraits<UnityEngine.Font.FontTextureRebuildCallback>.Init(factory.UnityEngine_Font_FontTextureRebuildCallback); DelegateTraits<System.Action<UnityEngine.Font>>.Init(factory.System_Action_UnityEngine_Font); DelegateTraits<System.Predicate<UnityEngine.UILineInfo>>.Init(factory.System_Predicate_UnityEngine_UILineInfo); DelegateTraits<System.Action<UnityEngine.UILineInfo>>.Init(factory.System_Action_UnityEngine_UILineInfo); DelegateTraits<System.Comparison<UnityEngine.UILineInfo>>.Init(factory.System_Comparison_UnityEngine_UILineInfo); DelegateTraits<ZipTool.DelegateZipCall>.Init(factory.ZipTool_DelegateZipCall); DelegateTraits<System.AsyncCallback>.Init(factory.System_AsyncCallback); DelegateTraits<ToLuaFramework.DelegateThreadFunc>.Init(factory.ToLuaFramework_DelegateThreadFunc); DelegateTraits<ToLuaFramework.DelegateThreadFuncCb>.Init(factory.ToLuaFramework_DelegateThreadFuncCb); DelegateTraits<System.Predicate<object>>.Init(factory.System_Predicate_object); DelegateTraits<System.Action<object>>.Init(factory.System_Action_object); DelegateTraits<System.Comparison<object>>.Init(factory.System_Comparison_object); DelegateTraits<Delegate_SocketEvent>.Init(factory.Delegate_SocketEvent); TypeTraits<System.Action>.Init(factory.Check_System_Action); TypeTraits<UnityEngine.Events.UnityAction>.Init(factory.Check_UnityEngine_Events_UnityAction); TypeTraits<System.Predicate<int>>.Init(factory.Check_System_Predicate_int); TypeTraits<System.Action<int>>.Init(factory.Check_System_Action_int); TypeTraits<System.Comparison<int>>.Init(factory.Check_System_Comparison_int); TypeTraits<System.Func<int,int>>.Init(factory.Check_System_Func_int_int); TypeTraits<UnityEngine.RectTransform.ReapplyDrivenProperties>.Init(factory.Check_UnityEngine_RectTransform_ReapplyDrivenProperties); TypeTraits<UnityEngine.Camera.CameraCallback>.Init(factory.Check_UnityEngine_Camera_CameraCallback); TypeTraits<UnityEngine.Application.LowMemoryCallback>.Init(factory.Check_UnityEngine_Application_LowMemoryCallback); TypeTraits<UnityEngine.Application.AdvertisingIdentifierCallback>.Init(factory.Check_UnityEngine_Application_AdvertisingIdentifierCallback); TypeTraits<UnityEngine.Application.LogCallback>.Init(factory.Check_UnityEngine_Application_LogCallback); TypeTraits<UnityEngine.AudioClip.PCMReaderCallback>.Init(factory.Check_UnityEngine_AudioClip_PCMReaderCallback); TypeTraits<UnityEngine.AudioClip.PCMSetPositionCallback>.Init(factory.Check_UnityEngine_AudioClip_PCMSetPositionCallback); TypeTraits<System.Action<UnityEngine.AsyncOperation>>.Init(factory.Check_System_Action_UnityEngine_AsyncOperation); TypeTraits<UnityEngine.Font.FontTextureRebuildCallback>.Init(factory.Check_UnityEngine_Font_FontTextureRebuildCallback); TypeTraits<System.Action<UnityEngine.Font>>.Init(factory.Check_System_Action_UnityEngine_Font); TypeTraits<System.Predicate<UnityEngine.UILineInfo>>.Init(factory.Check_System_Predicate_UnityEngine_UILineInfo); TypeTraits<System.Action<UnityEngine.UILineInfo>>.Init(factory.Check_System_Action_UnityEngine_UILineInfo); TypeTraits<System.Comparison<UnityEngine.UILineInfo>>.Init(factory.Check_System_Comparison_UnityEngine_UILineInfo); TypeTraits<ZipTool.DelegateZipCall>.Init(factory.Check_ZipTool_DelegateZipCall); TypeTraits<System.AsyncCallback>.Init(factory.Check_System_AsyncCallback); TypeTraits<ToLuaFramework.DelegateThreadFunc>.Init(factory.Check_ToLuaFramework_DelegateThreadFunc); TypeTraits<ToLuaFramework.DelegateThreadFuncCb>.Init(factory.Check_ToLuaFramework_DelegateThreadFuncCb); TypeTraits<System.Predicate<object>>.Init(factory.Check_System_Predicate_object); TypeTraits<System.Action<object>>.Init(factory.Check_System_Action_object); TypeTraits<System.Comparison<object>>.Init(factory.Check_System_Comparison_object); TypeTraits<Delegate_SocketEvent>.Init(factory.Check_Delegate_SocketEvent); StackTraits<System.Action>.Push = factory.Push_System_Action; StackTraits<UnityEngine.Events.UnityAction>.Push = factory.Push_UnityEngine_Events_UnityAction; StackTraits<System.Predicate<int>>.Push = factory.Push_System_Predicate_int; StackTraits<System.Action<int>>.Push = factory.Push_System_Action_int; StackTraits<System.Comparison<int>>.Push = factory.Push_System_Comparison_int; StackTraits<System.Func<int,int>>.Push = factory.Push_System_Func_int_int; StackTraits<UnityEngine.RectTransform.ReapplyDrivenProperties>.Push = factory.Push_UnityEngine_RectTransform_ReapplyDrivenProperties; StackTraits<UnityEngine.Camera.CameraCallback>.Push = factory.Push_UnityEngine_Camera_CameraCallback; StackTraits<UnityEngine.Application.LowMemoryCallback>.Push = factory.Push_UnityEngine_Application_LowMemoryCallback; StackTraits<UnityEngine.Application.AdvertisingIdentifierCallback>.Push = factory.Push_UnityEngine_Application_AdvertisingIdentifierCallback; StackTraits<UnityEngine.Application.LogCallback>.Push = factory.Push_UnityEngine_Application_LogCallback; StackTraits<UnityEngine.AudioClip.PCMReaderCallback>.Push = factory.Push_UnityEngine_AudioClip_PCMReaderCallback; StackTraits<UnityEngine.AudioClip.PCMSetPositionCallback>.Push = factory.Push_UnityEngine_AudioClip_PCMSetPositionCallback; StackTraits<System.Action<UnityEngine.AsyncOperation>>.Push = factory.Push_System_Action_UnityEngine_AsyncOperation; StackTraits<UnityEngine.Font.FontTextureRebuildCallback>.Push = factory.Push_UnityEngine_Font_FontTextureRebuildCallback; StackTraits<System.Action<UnityEngine.Font>>.Push = factory.Push_System_Action_UnityEngine_Font; StackTraits<System.Predicate<UnityEngine.UILineInfo>>.Push = factory.Push_System_Predicate_UnityEngine_UILineInfo; StackTraits<System.Action<UnityEngine.UILineInfo>>.Push = factory.Push_System_Action_UnityEngine_UILineInfo; StackTraits<System.Comparison<UnityEngine.UILineInfo>>.Push = factory.Push_System_Comparison_UnityEngine_UILineInfo; StackTraits<ZipTool.DelegateZipCall>.Push = factory.Push_ZipTool_DelegateZipCall; StackTraits<System.AsyncCallback>.Push = factory.Push_System_AsyncCallback; StackTraits<ToLuaFramework.DelegateThreadFunc>.Push = factory.Push_ToLuaFramework_DelegateThreadFunc; StackTraits<ToLuaFramework.DelegateThreadFuncCb>.Push = factory.Push_ToLuaFramework_DelegateThreadFuncCb; StackTraits<System.Predicate<object>>.Push = factory.Push_System_Predicate_object; StackTraits<System.Action<object>>.Push = factory.Push_System_Action_object; StackTraits<System.Comparison<object>>.Push = factory.Push_System_Comparison_object; StackTraits<Delegate_SocketEvent>.Push = factory.Push_Delegate_SocketEvent; } public static Delegate CreateDelegate(Type t, LuaFunction func = null) { DelegateCreate Create = null; if (!dict.TryGetValue(t, out Create)) { throw new LuaException(string.Format("Delegate {0} not register", LuaMisc.GetTypeName(t))); } if (func != null) { LuaState state = func.GetLuaState(); LuaDelegate target = state.GetLuaDelegate(func); if (target != null) { return Delegate.CreateDelegate(t, target, target.method); } else { Delegate d = Create(func, null, false); target = d.Target as LuaDelegate; state.AddLuaDelegate(target, func); return d; } } return Create(null, null, false); } public static Delegate CreateDelegate(Type t, LuaFunction func, LuaTable self) { DelegateCreate Create = null; if (!dict.TryGetValue(t, out Create)) { throw new LuaException(string.Format("Delegate {0} not register", LuaMisc.GetTypeName(t))); } if (func != null) { LuaState state = func.GetLuaState(); LuaDelegate target = state.GetLuaDelegate(func, self); if (target != null) { return Delegate.CreateDelegate(t, target, target.method); } else { Delegate d = Create(func, self, true); target = d.Target as LuaDelegate; state.AddLuaDelegate(target, func, self); return d; } } return Create(null, null, true); } public static Delegate RemoveDelegate(Delegate obj, LuaFunction func) { LuaState state = func.GetLuaState(); Delegate[] ds = obj.GetInvocationList(); for (int i = 0; i < ds.Length; i++) { LuaDelegate ld = ds[i].Target as LuaDelegate; if (ld != null && ld.func == func) { obj = Delegate.Remove(obj, ds[i]); state.DelayDispose(ld.func); break; } } return obj; } public static Delegate RemoveDelegate(Delegate obj, Delegate dg) { LuaDelegate remove = dg.Target as LuaDelegate; if (remove == null) { obj = Delegate.Remove(obj, dg); return obj; } LuaState state = remove.func.GetLuaState(); Delegate[] ds = obj.GetInvocationList(); for (int i = 0; i < ds.Length; i++) { LuaDelegate ld = ds[i].Target as LuaDelegate; if (ld != null && ld == remove) { obj = Delegate.Remove(obj, ds[i]); state.DelayDispose(ld.func); state.DelayDispose(ld.self); break; } } return obj; } class System_Action_Event : LuaDelegate { public System_Action_Event(LuaFunction func) : base(func) { } public System_Action_Event(LuaFunction func, LuaTable self) : base(func, self) { } public void Call() { func.Call(); } public void CallWithSelf() { func.BeginPCall(); func.Push(self); func.PCall(); func.EndPCall(); } } public System.Action System_Action(LuaFunction func, LuaTable self, bool flag) { if (func == null) { System.Action fn = delegate() { }; return fn; } if(!flag) { System_Action_Event target = new System_Action_Event(func); System.Action d = target.Call; target.method = d.Method; return d; } else { System_Action_Event target = new System_Action_Event(func, self); System.Action d = target.CallWithSelf; target.method = d.Method; return d; } } bool Check_System_Action(IntPtr L, int pos) { return TypeChecker.CheckDelegateType(typeof(System.Action), L, pos); } void Push_System_Action(IntPtr L, System.Action o) { ToLua.Push(L, o); } class UnityEngine_Events_UnityAction_Event : LuaDelegate { public UnityEngine_Events_UnityAction_Event(LuaFunction func) : base(func) { } public UnityEngine_Events_UnityAction_Event(LuaFunction func, LuaTable self) : base(func, self) { } public void Call() { func.Call(); } public void CallWithSelf() { func.BeginPCall(); func.Push(self); func.PCall(); func.EndPCall(); } } public UnityEngine.Events.UnityAction UnityEngine_Events_UnityAction(LuaFunction func, LuaTable self, bool flag) { if (func == null) { UnityEngine.Events.UnityAction fn = delegate() { }; return fn; } if(!flag) { UnityEngine_Events_UnityAction_Event target = new UnityEngine_Events_UnityAction_Event(func); UnityEngine.Events.UnityAction d = target.Call; target.method = d.Method; return d; } else { UnityEngine_Events_UnityAction_Event target = new UnityEngine_Events_UnityAction_Event(func, self); UnityEngine.Events.UnityAction d = target.CallWithSelf; target.method = d.Method; return d; } } bool Check_UnityEngine_Events_UnityAction(IntPtr L, int pos) { return TypeChecker.CheckDelegateType(typeof(UnityEngine.Events.UnityAction), L, pos); } void Push_UnityEngine_Events_UnityAction(IntPtr L, UnityEngine.Events.UnityAction o) { ToLua.Push(L, o); } class System_Predicate_int_Event : LuaDelegate { public System_Predicate_int_Event(LuaFunction func) : base(func) { } public System_Predicate_int_Event(LuaFunction func, LuaTable self) : base(func, self) { } public bool Call(int param0) { func.BeginPCall(); func.Push(param0); func.PCall(); bool ret = func.CheckBoolean(); func.EndPCall(); return ret; } public bool CallWithSelf(int param0) { func.BeginPCall(); func.Push(self); func.Push(param0); func.PCall(); bool ret = func.CheckBoolean(); func.EndPCall(); return ret; } } public System.Predicate<int> System_Predicate_int(LuaFunction func, LuaTable self, bool flag) { if (func == null) { System.Predicate<int> fn = delegate(int param0) { return false; }; return fn; } if(!flag) { System_Predicate_int_Event target = new System_Predicate_int_Event(func); System.Predicate<int> d = target.Call; target.method = d.Method; return d; } else { System_Predicate_int_Event target = new System_Predicate_int_Event(func, self); System.Predicate<int> d = target.CallWithSelf; target.method = d.Method; return d; } } bool Check_System_Predicate_int(IntPtr L, int pos) { return TypeChecker.CheckDelegateType(typeof(System.Predicate<int>), L, pos); } void Push_System_Predicate_int(IntPtr L, System.Predicate<int> o) { ToLua.Push(L, o); } class System_Action_int_Event : LuaDelegate { public System_Action_int_Event(LuaFunction func) : base(func) { } public System_Action_int_Event(LuaFunction func, LuaTable self) : base(func, self) { } public void Call(int param0) { func.BeginPCall(); func.Push(param0); func.PCall(); func.EndPCall(); } public void CallWithSelf(int param0) { func.BeginPCall(); func.Push(self); func.Push(param0); func.PCall(); func.EndPCall(); } } public System.Action<int> System_Action_int(LuaFunction func, LuaTable self, bool flag) { if (func == null) { System.Action<int> fn = delegate(int param0) { }; return fn; } if(!flag) { System_Action_int_Event target = new System_Action_int_Event(func); System.Action<int> d = target.Call; target.method = d.Method; return d; } else { System_Action_int_Event target = new System_Action_int_Event(func, self); System.Action<int> d = target.CallWithSelf; target.method = d.Method; return d; } } bool Check_System_Action_int(IntPtr L, int pos) { return TypeChecker.CheckDelegateType(typeof(System.Action<int>), L, pos); } void Push_System_Action_int(IntPtr L, System.Action<int> o) { ToLua.Push(L, o); } class System_Comparison_int_Event : LuaDelegate { public System_Comparison_int_Event(LuaFunction func) : base(func) { } public System_Comparison_int_Event(LuaFunction func, LuaTable self) : base(func, self) { } public int Call(int param0, int param1) { func.BeginPCall(); func.Push(param0); func.Push(param1); func.PCall(); int ret = (int)func.CheckNumber(); func.EndPCall(); return ret; } public int CallWithSelf(int param0, int param1) { func.BeginPCall(); func.Push(self); func.Push(param0); func.Push(param1); func.PCall(); int ret = (int)func.CheckNumber(); func.EndPCall(); return ret; } } public System.Comparison<int> System_Comparison_int(LuaFunction func, LuaTable self, bool flag) { if (func == null) { System.Comparison<int> fn = delegate(int param0, int param1) { return 0; }; return fn; } if(!flag) { System_Comparison_int_Event target = new System_Comparison_int_Event(func); System.Comparison<int> d = target.Call; target.method = d.Method; return d; } else { System_Comparison_int_Event target = new System_Comparison_int_Event(func, self); System.Comparison<int> d = target.CallWithSelf; target.method = d.Method; return d; } } bool Check_System_Comparison_int(IntPtr L, int pos) { return TypeChecker.CheckDelegateType(typeof(System.Comparison<int>), L, pos); } void Push_System_Comparison_int(IntPtr L, System.Comparison<int> o) { ToLua.Push(L, o); } class System_Func_int_int_Event : LuaDelegate { public System_Func_int_int_Event(LuaFunction func) : base(func) { } public System_Func_int_int_Event(LuaFunction func, LuaTable self) : base(func, self) { } public int Call(int param0) { func.BeginPCall(); func.Push(param0); func.PCall(); int ret = (int)func.CheckNumber(); func.EndPCall(); return ret; } public int CallWithSelf(int param0) { func.BeginPCall(); func.Push(self); func.Push(param0); func.PCall(); int ret = (int)func.CheckNumber(); func.EndPCall(); return ret; } } public System.Func<int,int> System_Func_int_int(LuaFunction func, LuaTable self, bool flag) { if (func == null) { System.Func<int,int> fn = delegate(int param0) { return 0; }; return fn; } if(!flag) { System_Func_int_int_Event target = new System_Func_int_int_Event(func); System.Func<int,int> d = target.Call; target.method = d.Method; return d; } else { System_Func_int_int_Event target = new System_Func_int_int_Event(func, self); System.Func<int,int> d = target.CallWithSelf; target.method = d.Method; return d; } } bool Check_System_Func_int_int(IntPtr L, int pos) { return TypeChecker.CheckDelegateType(typeof(System.Func<int,int>), L, pos); } void Push_System_Func_int_int(IntPtr L, System.Func<int,int> o) { ToLua.Push(L, o); } class UnityEngine_RectTransform_ReapplyDrivenProperties_Event : LuaDelegate { public UnityEngine_RectTransform_ReapplyDrivenProperties_Event(LuaFunction func) : base(func) { } public UnityEngine_RectTransform_ReapplyDrivenProperties_Event(LuaFunction func, LuaTable self) : base(func, self) { } public void Call(UnityEngine.RectTransform param0) { func.BeginPCall(); func.PushSealed(param0); func.PCall(); func.EndPCall(); } public void CallWithSelf(UnityEngine.RectTransform param0) { func.BeginPCall(); func.Push(self); func.PushSealed(param0); func.PCall(); func.EndPCall(); } } public UnityEngine.RectTransform.ReapplyDrivenProperties UnityEngine_RectTransform_ReapplyDrivenProperties(LuaFunction func, LuaTable self, bool flag) { if (func == null) { UnityEngine.RectTransform.ReapplyDrivenProperties fn = delegate(UnityEngine.RectTransform param0) { }; return fn; } if(!flag) { UnityEngine_RectTransform_ReapplyDrivenProperties_Event target = new UnityEngine_RectTransform_ReapplyDrivenProperties_Event(func); UnityEngine.RectTransform.ReapplyDrivenProperties d = target.Call; target.method = d.Method; return d; } else { UnityEngine_RectTransform_ReapplyDrivenProperties_Event target = new UnityEngine_RectTransform_ReapplyDrivenProperties_Event(func, self); UnityEngine.RectTransform.ReapplyDrivenProperties d = target.CallWithSelf; target.method = d.Method; return d; } } bool Check_UnityEngine_RectTransform_ReapplyDrivenProperties(IntPtr L, int pos) { return TypeChecker.CheckDelegateType(typeof(UnityEngine.RectTransform.ReapplyDrivenProperties), L, pos); } void Push_UnityEngine_RectTransform_ReapplyDrivenProperties(IntPtr L, UnityEngine.RectTransform.ReapplyDrivenProperties o) { ToLua.Push(L, o); } class UnityEngine_Camera_CameraCallback_Event : LuaDelegate { public UnityEngine_Camera_CameraCallback_Event(LuaFunction func) : base(func) { } public UnityEngine_Camera_CameraCallback_Event(LuaFunction func, LuaTable self) : base(func, self) { } public void Call(UnityEngine.Camera param0) { func.BeginPCall(); func.PushSealed(param0); func.PCall(); func.EndPCall(); } public void CallWithSelf(UnityEngine.Camera param0) { func.BeginPCall(); func.Push(self); func.PushSealed(param0); func.PCall(); func.EndPCall(); } } public UnityEngine.Camera.CameraCallback UnityEngine_Camera_CameraCallback(LuaFunction func, LuaTable self, bool flag) { if (func == null) { UnityEngine.Camera.CameraCallback fn = delegate(UnityEngine.Camera param0) { }; return fn; } if(!flag) { UnityEngine_Camera_CameraCallback_Event target = new UnityEngine_Camera_CameraCallback_Event(func); UnityEngine.Camera.CameraCallback d = target.Call; target.method = d.Method; return d; } else { UnityEngine_Camera_CameraCallback_Event target = new UnityEngine_Camera_CameraCallback_Event(func, self); UnityEngine.Camera.CameraCallback d = target.CallWithSelf; target.method = d.Method; return d; } } bool Check_UnityEngine_Camera_CameraCallback(IntPtr L, int pos) { return TypeChecker.CheckDelegateType(typeof(UnityEngine.Camera.CameraCallback), L, pos); } void Push_UnityEngine_Camera_CameraCallback(IntPtr L, UnityEngine.Camera.CameraCallback o) { ToLua.Push(L, o); } class UnityEngine_Application_LowMemoryCallback_Event : LuaDelegate { public UnityEngine_Application_LowMemoryCallback_Event(LuaFunction func) : base(func) { } public UnityEngine_Application_LowMemoryCallback_Event(LuaFunction func, LuaTable self) : base(func, self) { } public void Call() { func.Call(); } public void CallWithSelf() { func.BeginPCall(); func.Push(self); func.PCall(); func.EndPCall(); } } public UnityEngine.Application.LowMemoryCallback UnityEngine_Application_LowMemoryCallback(LuaFunction func, LuaTable self, bool flag) { if (func == null) { UnityEngine.Application.LowMemoryCallback fn = delegate() { }; return fn; } if(!flag) { UnityEngine_Application_LowMemoryCallback_Event target = new UnityEngine_Application_LowMemoryCallback_Event(func); UnityEngine.Application.LowMemoryCallback d = target.Call; target.method = d.Method; return d; } else { UnityEngine_Application_LowMemoryCallback_Event target = new UnityEngine_Application_LowMemoryCallback_Event(func, self); UnityEngine.Application.LowMemoryCallback d = target.CallWithSelf; target.method = d.Method; return d; } } bool Check_UnityEngine_Application_LowMemoryCallback(IntPtr L, int pos) { return TypeChecker.CheckDelegateType(typeof(UnityEngine.Application.LowMemoryCallback), L, pos); } void Push_UnityEngine_Application_LowMemoryCallback(IntPtr L, UnityEngine.Application.LowMemoryCallback o) { ToLua.Push(L, o); } class UnityEngine_Application_AdvertisingIdentifierCallback_Event : LuaDelegate { public UnityEngine_Application_AdvertisingIdentifierCallback_Event(LuaFunction func) : base(func) { } public UnityEngine_Application_AdvertisingIdentifierCallback_Event(LuaFunction func, LuaTable self) : base(func, self) { } public void Call(string param0, bool param1, string param2) { func.BeginPCall(); func.Push(param0); func.Push(param1); func.Push(param2); func.PCall(); func.EndPCall(); } public void CallWithSelf(string param0, bool param1, string param2) { func.BeginPCall(); func.Push(self); func.Push(param0); func.Push(param1); func.Push(param2); func.PCall(); func.EndPCall(); } } public UnityEngine.Application.AdvertisingIdentifierCallback UnityEngine_Application_AdvertisingIdentifierCallback(LuaFunction func, LuaTable self, bool flag) { if (func == null) { UnityEngine.Application.AdvertisingIdentifierCallback fn = delegate(string param0, bool param1, string param2) { }; return fn; } if(!flag) { UnityEngine_Application_AdvertisingIdentifierCallback_Event target = new UnityEngine_Application_AdvertisingIdentifierCallback_Event(func); UnityEngine.Application.AdvertisingIdentifierCallback d = target.Call; target.method = d.Method; return d; } else { UnityEngine_Application_AdvertisingIdentifierCallback_Event target = new UnityEngine_Application_AdvertisingIdentifierCallback_Event(func, self); UnityEngine.Application.AdvertisingIdentifierCallback d = target.CallWithSelf; target.method = d.Method; return d; } } bool Check_UnityEngine_Application_AdvertisingIdentifierCallback(IntPtr L, int pos) { return TypeChecker.CheckDelegateType(typeof(UnityEngine.Application.AdvertisingIdentifierCallback), L, pos); } void Push_UnityEngine_Application_AdvertisingIdentifierCallback(IntPtr L, UnityEngine.Application.AdvertisingIdentifierCallback o) { ToLua.Push(L, o); } class UnityEngine_Application_LogCallback_Event : LuaDelegate { public UnityEngine_Application_LogCallback_Event(LuaFunction func) : base(func) { } public UnityEngine_Application_LogCallback_Event(LuaFunction func, LuaTable self) : base(func, self) { } public void Call(string param0, string param1, UnityEngine.LogType param2) { func.BeginPCall(); func.Push(param0); func.Push(param1); func.Push(param2); func.PCall(); func.EndPCall(); } public void CallWithSelf(string param0, string param1, UnityEngine.LogType param2) { func.BeginPCall(); func.Push(self); func.Push(param0); func.Push(param1); func.Push(param2); func.PCall(); func.EndPCall(); } } public UnityEngine.Application.LogCallback UnityEngine_Application_LogCallback(LuaFunction func, LuaTable self, bool flag) { if (func == null) { UnityEngine.Application.LogCallback fn = delegate(string param0, string param1, UnityEngine.LogType param2) { }; return fn; } if(!flag) { UnityEngine_Application_LogCallback_Event target = new UnityEngine_Application_LogCallback_Event(func); UnityEngine.Application.LogCallback d = target.Call; target.method = d.Method; return d; } else { UnityEngine_Application_LogCallback_Event target = new UnityEngine_Application_LogCallback_Event(func, self); UnityEngine.Application.LogCallback d = target.CallWithSelf; target.method = d.Method; return d; } } bool Check_UnityEngine_Application_LogCallback(IntPtr L, int pos) { return TypeChecker.CheckDelegateType(typeof(UnityEngine.Application.LogCallback), L, pos); } void Push_UnityEngine_Application_LogCallback(IntPtr L, UnityEngine.Application.LogCallback o) { ToLua.Push(L, o); } class UnityEngine_AudioClip_PCMReaderCallback_Event : LuaDelegate { public UnityEngine_AudioClip_PCMReaderCallback_Event(LuaFunction func) : base(func) { } public UnityEngine_AudioClip_PCMReaderCallback_Event(LuaFunction func, LuaTable self) : base(func, self) { } public void Call(float[] param0) { func.BeginPCall(); func.Push(param0); func.PCall(); func.EndPCall(); } public void CallWithSelf(float[] param0) { func.BeginPCall(); func.Push(self); func.Push(param0); func.PCall(); func.EndPCall(); } } public UnityEngine.AudioClip.PCMReaderCallback UnityEngine_AudioClip_PCMReaderCallback(LuaFunction func, LuaTable self, bool flag) { if (func == null) { UnityEngine.AudioClip.PCMReaderCallback fn = delegate(float[] param0) { }; return fn; } if(!flag) { UnityEngine_AudioClip_PCMReaderCallback_Event target = new UnityEngine_AudioClip_PCMReaderCallback_Event(func); UnityEngine.AudioClip.PCMReaderCallback d = target.Call; target.method = d.Method; return d; } else { UnityEngine_AudioClip_PCMReaderCallback_Event target = new UnityEngine_AudioClip_PCMReaderCallback_Event(func, self); UnityEngine.AudioClip.PCMReaderCallback d = target.CallWithSelf; target.method = d.Method; return d; } } bool Check_UnityEngine_AudioClip_PCMReaderCallback(IntPtr L, int pos) { return TypeChecker.CheckDelegateType(typeof(UnityEngine.AudioClip.PCMReaderCallback), L, pos); } void Push_UnityEngine_AudioClip_PCMReaderCallback(IntPtr L, UnityEngine.AudioClip.PCMReaderCallback o) { ToLua.Push(L, o); } class UnityEngine_AudioClip_PCMSetPositionCallback_Event : LuaDelegate { public UnityEngine_AudioClip_PCMSetPositionCallback_Event(LuaFunction func) : base(func) { } public UnityEngine_AudioClip_PCMSetPositionCallback_Event(LuaFunction func, LuaTable self) : base(func, self) { } public void Call(int param0) { func.BeginPCall(); func.Push(param0); func.PCall(); func.EndPCall(); } public void CallWithSelf(int param0) { func.BeginPCall(); func.Push(self); func.Push(param0); func.PCall(); func.EndPCall(); } } public UnityEngine.AudioClip.PCMSetPositionCallback UnityEngine_AudioClip_PCMSetPositionCallback(LuaFunction func, LuaTable self, bool flag) { if (func == null) { UnityEngine.AudioClip.PCMSetPositionCallback fn = delegate(int param0) { }; return fn; } if(!flag) { UnityEngine_AudioClip_PCMSetPositionCallback_Event target = new UnityEngine_AudioClip_PCMSetPositionCallback_Event(func); UnityEngine.AudioClip.PCMSetPositionCallback d = target.Call; target.method = d.Method; return d; } else { UnityEngine_AudioClip_PCMSetPositionCallback_Event target = new UnityEngine_AudioClip_PCMSetPositionCallback_Event(func, self); UnityEngine.AudioClip.PCMSetPositionCallback d = target.CallWithSelf; target.method = d.Method; return d; } } bool Check_UnityEngine_AudioClip_PCMSetPositionCallback(IntPtr L, int pos) { return TypeChecker.CheckDelegateType(typeof(UnityEngine.AudioClip.PCMSetPositionCallback), L, pos); } void Push_UnityEngine_AudioClip_PCMSetPositionCallback(IntPtr L, UnityEngine.AudioClip.PCMSetPositionCallback o) { ToLua.Push(L, o); } class System_Action_UnityEngine_AsyncOperation_Event : LuaDelegate { public System_Action_UnityEngine_AsyncOperation_Event(LuaFunction func) : base(func) { } public System_Action_UnityEngine_AsyncOperation_Event(LuaFunction func, LuaTable self) : base(func, self) { } public void Call(UnityEngine.AsyncOperation param0) { func.BeginPCall(); func.PushObject(param0); func.PCall(); func.EndPCall(); } public void CallWithSelf(UnityEngine.AsyncOperation param0) { func.BeginPCall(); func.Push(self); func.PushObject(param0); func.PCall(); func.EndPCall(); } } public System.Action<UnityEngine.AsyncOperation> System_Action_UnityEngine_AsyncOperation(LuaFunction func, LuaTable self, bool flag) { if (func == null) { System.Action<UnityEngine.AsyncOperation> fn = delegate(UnityEngine.AsyncOperation param0) { }; return fn; } if(!flag) { System_Action_UnityEngine_AsyncOperation_Event target = new System_Action_UnityEngine_AsyncOperation_Event(func); System.Action<UnityEngine.AsyncOperation> d = target.Call; target.method = d.Method; return d; } else { System_Action_UnityEngine_AsyncOperation_Event target = new System_Action_UnityEngine_AsyncOperation_Event(func, self); System.Action<UnityEngine.AsyncOperation> d = target.CallWithSelf; target.method = d.Method; return d; } } bool Check_System_Action_UnityEngine_AsyncOperation(IntPtr L, int pos) { return TypeChecker.CheckDelegateType(typeof(System.Action<UnityEngine.AsyncOperation>), L, pos); } void Push_System_Action_UnityEngine_AsyncOperation(IntPtr L, System.Action<UnityEngine.AsyncOperation> o) { ToLua.Push(L, o); } class UnityEngine_Font_FontTextureRebuildCallback_Event : LuaDelegate { public UnityEngine_Font_FontTextureRebuildCallback_Event(LuaFunction func) : base(func) { } public UnityEngine_Font_FontTextureRebuildCallback_Event(LuaFunction func, LuaTable self) : base(func, self) { } public void Call() { func.Call(); } public void CallWithSelf() { func.BeginPCall(); func.Push(self); func.PCall(); func.EndPCall(); } } public UnityEngine.Font.FontTextureRebuildCallback UnityEngine_Font_FontTextureRebuildCallback(LuaFunction func, LuaTable self, bool flag) { if (func == null) { UnityEngine.Font.FontTextureRebuildCallback fn = delegate() { }; return fn; } if(!flag) { UnityEngine_Font_FontTextureRebuildCallback_Event target = new UnityEngine_Font_FontTextureRebuildCallback_Event(func); UnityEngine.Font.FontTextureRebuildCallback d = target.Call; target.method = d.Method; return d; } else { UnityEngine_Font_FontTextureRebuildCallback_Event target = new UnityEngine_Font_FontTextureRebuildCallback_Event(func, self); UnityEngine.Font.FontTextureRebuildCallback d = target.CallWithSelf; target.method = d.Method; return d; } } bool Check_UnityEngine_Font_FontTextureRebuildCallback(IntPtr L, int pos) { return TypeChecker.CheckDelegateType(typeof(UnityEngine.Font.FontTextureRebuildCallback), L, pos); } void Push_UnityEngine_Font_FontTextureRebuildCallback(IntPtr L, UnityEngine.Font.FontTextureRebuildCallback o) { ToLua.Push(L, o); } class System_Action_UnityEngine_Font_Event : LuaDelegate { public System_Action_UnityEngine_Font_Event(LuaFunction func) : base(func) { } public System_Action_UnityEngine_Font_Event(LuaFunction func, LuaTable self) : base(func, self) { } public void Call(UnityEngine.Font param0) { func.BeginPCall(); func.PushSealed(param0); func.PCall(); func.EndPCall(); } public void CallWithSelf(UnityEngine.Font param0) { func.BeginPCall(); func.Push(self); func.PushSealed(param0); func.PCall(); func.EndPCall(); } } public System.Action<UnityEngine.Font> System_Action_UnityEngine_Font(LuaFunction func, LuaTable self, bool flag) { if (func == null) { System.Action<UnityEngine.Font> fn = delegate(UnityEngine.Font param0) { }; return fn; } if(!flag) { System_Action_UnityEngine_Font_Event target = new System_Action_UnityEngine_Font_Event(func); System.Action<UnityEngine.Font> d = target.Call; target.method = d.Method; return d; } else { System_Action_UnityEngine_Font_Event target = new System_Action_UnityEngine_Font_Event(func, self); System.Action<UnityEngine.Font> d = target.CallWithSelf; target.method = d.Method; return d; } } bool Check_System_Action_UnityEngine_Font(IntPtr L, int pos) { return TypeChecker.CheckDelegateType(typeof(System.Action<UnityEngine.Font>), L, pos); } void Push_System_Action_UnityEngine_Font(IntPtr L, System.Action<UnityEngine.Font> o) { ToLua.Push(L, o); } class System_Predicate_UnityEngine_UILineInfo_Event : LuaDelegate { public System_Predicate_UnityEngine_UILineInfo_Event(LuaFunction func) : base(func) { } public System_Predicate_UnityEngine_UILineInfo_Event(LuaFunction func, LuaTable self) : base(func, self) { } public bool Call(UnityEngine.UILineInfo param0) { func.BeginPCall(); func.PushValue(param0); func.PCall(); bool ret = func.CheckBoolean(); func.EndPCall(); return ret; } public bool CallWithSelf(UnityEngine.UILineInfo param0) { func.BeginPCall(); func.Push(self); func.PushValue(param0); func.PCall(); bool ret = func.CheckBoolean(); func.EndPCall(); return ret; } } public System.Predicate<UnityEngine.UILineInfo> System_Predicate_UnityEngine_UILineInfo(LuaFunction func, LuaTable self, bool flag) { if (func == null) { System.Predicate<UnityEngine.UILineInfo> fn = delegate(UnityEngine.UILineInfo param0) { return false; }; return fn; } if(!flag) { System_Predicate_UnityEngine_UILineInfo_Event target = new System_Predicate_UnityEngine_UILineInfo_Event(func); System.Predicate<UnityEngine.UILineInfo> d = target.Call; target.method = d.Method; return d; } else { System_Predicate_UnityEngine_UILineInfo_Event target = new System_Predicate_UnityEngine_UILineInfo_Event(func, self); System.Predicate<UnityEngine.UILineInfo> d = target.CallWithSelf; target.method = d.Method; return d; } } bool Check_System_Predicate_UnityEngine_UILineInfo(IntPtr L, int pos) { return TypeChecker.CheckDelegateType(typeof(System.Predicate<UnityEngine.UILineInfo>), L, pos); } void Push_System_Predicate_UnityEngine_UILineInfo(IntPtr L, System.Predicate<UnityEngine.UILineInfo> o) { ToLua.Push(L, o); } class System_Action_UnityEngine_UILineInfo_Event : LuaDelegate { public System_Action_UnityEngine_UILineInfo_Event(LuaFunction func) : base(func) { } public System_Action_UnityEngine_UILineInfo_Event(LuaFunction func, LuaTable self) : base(func, self) { } public void Call(UnityEngine.UILineInfo param0) { func.BeginPCall(); func.PushValue(param0); func.PCall(); func.EndPCall(); } public void CallWithSelf(UnityEngine.UILineInfo param0) { func.BeginPCall(); func.Push(self); func.PushValue(param0); func.PCall(); func.EndPCall(); } } public System.Action<UnityEngine.UILineInfo> System_Action_UnityEngine_UILineInfo(LuaFunction func, LuaTable self, bool flag) { if (func == null) { System.Action<UnityEngine.UILineInfo> fn = delegate(UnityEngine.UILineInfo param0) { }; return fn; } if(!flag) { System_Action_UnityEngine_UILineInfo_Event target = new System_Action_UnityEngine_UILineInfo_Event(func); System.Action<UnityEngine.UILineInfo> d = target.Call; target.method = d.Method; return d; } else { System_Action_UnityEngine_UILineInfo_Event target = new System_Action_UnityEngine_UILineInfo_Event(func, self); System.Action<UnityEngine.UILineInfo> d = target.CallWithSelf; target.method = d.Method; return d; } } bool Check_System_Action_UnityEngine_UILineInfo(IntPtr L, int pos) { return TypeChecker.CheckDelegateType(typeof(System.Action<UnityEngine.UILineInfo>), L, pos); } void Push_System_Action_UnityEngine_UILineInfo(IntPtr L, System.Action<UnityEngine.UILineInfo> o) { ToLua.Push(L, o); } class System_Comparison_UnityEngine_UILineInfo_Event : LuaDelegate { public System_Comparison_UnityEngine_UILineInfo_Event(LuaFunction func) : base(func) { } public System_Comparison_UnityEngine_UILineInfo_Event(LuaFunction func, LuaTable self) : base(func, self) { } public int Call(UnityEngine.UILineInfo param0, UnityEngine.UILineInfo param1) { func.BeginPCall(); func.PushValue(param0); func.PushValue(param1); func.PCall(); int ret = (int)func.CheckNumber(); func.EndPCall(); return ret; } public int CallWithSelf(UnityEngine.UILineInfo param0, UnityEngine.UILineInfo param1) { func.BeginPCall(); func.Push(self); func.PushValue(param0); func.PushValue(param1); func.PCall(); int ret = (int)func.CheckNumber(); func.EndPCall(); return ret; } } public System.Comparison<UnityEngine.UILineInfo> System_Comparison_UnityEngine_UILineInfo(LuaFunction func, LuaTable self, bool flag) { if (func == null) { System.Comparison<UnityEngine.UILineInfo> fn = delegate(UnityEngine.UILineInfo param0, UnityEngine.UILineInfo param1) { return 0; }; return fn; } if(!flag) { System_Comparison_UnityEngine_UILineInfo_Event target = new System_Comparison_UnityEngine_UILineInfo_Event(func); System.Comparison<UnityEngine.UILineInfo> d = target.Call; target.method = d.Method; return d; } else { System_Comparison_UnityEngine_UILineInfo_Event target = new System_Comparison_UnityEngine_UILineInfo_Event(func, self); System.Comparison<UnityEngine.UILineInfo> d = target.CallWithSelf; target.method = d.Method; return d; } } bool Check_System_Comparison_UnityEngine_UILineInfo(IntPtr L, int pos) { return TypeChecker.CheckDelegateType(typeof(System.Comparison<UnityEngine.UILineInfo>), L, pos); } void Push_System_Comparison_UnityEngine_UILineInfo(IntPtr L, System.Comparison<UnityEngine.UILineInfo> o) { ToLua.Push(L, o); } class ZipTool_DelegateZipCall_Event : LuaDelegate { public ZipTool_DelegateZipCall_Event(LuaFunction func) : base(func) { } public ZipTool_DelegateZipCall_Event(LuaFunction func, LuaTable self) : base(func, self) { } public void Call() { func.Call(); } public void CallWithSelf() { func.BeginPCall(); func.Push(self); func.PCall(); func.EndPCall(); } } public ZipTool.DelegateZipCall ZipTool_DelegateZipCall(LuaFunction func, LuaTable self, bool flag) { if (func == null) { ZipTool.DelegateZipCall fn = delegate() { }; return fn; } if(!flag) { ZipTool_DelegateZipCall_Event target = new ZipTool_DelegateZipCall_Event(func); ZipTool.DelegateZipCall d = target.Call; target.method = d.Method; return d; } else { ZipTool_DelegateZipCall_Event target = new ZipTool_DelegateZipCall_Event(func, self); ZipTool.DelegateZipCall d = target.CallWithSelf; target.method = d.Method; return d; } } bool Check_ZipTool_DelegateZipCall(IntPtr L, int pos) { return TypeChecker.CheckDelegateType(typeof(ZipTool.DelegateZipCall), L, pos); } void Push_ZipTool_DelegateZipCall(IntPtr L, ZipTool.DelegateZipCall o) { ToLua.Push(L, o); } class System_AsyncCallback_Event : LuaDelegate { public System_AsyncCallback_Event(LuaFunction func) : base(func) { } public System_AsyncCallback_Event(LuaFunction func, LuaTable self) : base(func, self) { } public void Call(System.IAsyncResult param0) { func.BeginPCall(); func.PushObject(param0); func.PCall(); func.EndPCall(); } public void CallWithSelf(System.IAsyncResult param0) { func.BeginPCall(); func.Push(self); func.PushObject(param0); func.PCall(); func.EndPCall(); } } public System.AsyncCallback System_AsyncCallback(LuaFunction func, LuaTable self, bool flag) { if (func == null) { System.AsyncCallback fn = delegate(System.IAsyncResult param0) { }; return fn; } if(!flag) { System_AsyncCallback_Event target = new System_AsyncCallback_Event(func); System.AsyncCallback d = target.Call; target.method = d.Method; return d; } else { System_AsyncCallback_Event target = new System_AsyncCallback_Event(func, self); System.AsyncCallback d = target.CallWithSelf; target.method = d.Method; return d; } } bool Check_System_AsyncCallback(IntPtr L, int pos) { return TypeChecker.CheckDelegateType(typeof(System.AsyncCallback), L, pos); } void Push_System_AsyncCallback(IntPtr L, System.AsyncCallback o) { ToLua.Push(L, o); } class ToLuaFramework_DelegateThreadFunc_Event : LuaDelegate { public ToLuaFramework_DelegateThreadFunc_Event(LuaFunction func) : base(func) { } public ToLuaFramework_DelegateThreadFunc_Event(LuaFunction func, LuaTable self) : base(func, self) { } public void Call() { func.Call(); } public void CallWithSelf() { func.BeginPCall(); func.Push(self); func.PCall(); func.EndPCall(); } } public ToLuaFramework.DelegateThreadFunc ToLuaFramework_DelegateThreadFunc(LuaFunction func, LuaTable self, bool flag) { if (func == null) { ToLuaFramework.DelegateThreadFunc fn = delegate() { }; return fn; } if(!flag) { ToLuaFramework_DelegateThreadFunc_Event target = new ToLuaFramework_DelegateThreadFunc_Event(func); ToLuaFramework.DelegateThreadFunc d = target.Call; target.method = d.Method; return d; } else { ToLuaFramework_DelegateThreadFunc_Event target = new ToLuaFramework_DelegateThreadFunc_Event(func, self); ToLuaFramework.DelegateThreadFunc d = target.CallWithSelf; target.method = d.Method; return d; } } bool Check_ToLuaFramework_DelegateThreadFunc(IntPtr L, int pos) { return TypeChecker.CheckDelegateType(typeof(ToLuaFramework.DelegateThreadFunc), L, pos); } void Push_ToLuaFramework_DelegateThreadFunc(IntPtr L, ToLuaFramework.DelegateThreadFunc o) { ToLua.Push(L, o); } class ToLuaFramework_DelegateThreadFuncCb_Event : LuaDelegate { public ToLuaFramework_DelegateThreadFuncCb_Event(LuaFunction func) : base(func) { } public ToLuaFramework_DelegateThreadFuncCb_Event(LuaFunction func, LuaTable self) : base(func, self) { } public void Call() { func.Call(); } public void CallWithSelf() { func.BeginPCall(); func.Push(self); func.PCall(); func.EndPCall(); } } public ToLuaFramework.DelegateThreadFuncCb ToLuaFramework_DelegateThreadFuncCb(LuaFunction func, LuaTable self, bool flag) { if (func == null) { ToLuaFramework.DelegateThreadFuncCb fn = delegate() { }; return fn; } if(!flag) { ToLuaFramework_DelegateThreadFuncCb_Event target = new ToLuaFramework_DelegateThreadFuncCb_Event(func); ToLuaFramework.DelegateThreadFuncCb d = target.Call; target.method = d.Method; return d; } else { ToLuaFramework_DelegateThreadFuncCb_Event target = new ToLuaFramework_DelegateThreadFuncCb_Event(func, self); ToLuaFramework.DelegateThreadFuncCb d = target.CallWithSelf; target.method = d.Method; return d; } } bool Check_ToLuaFramework_DelegateThreadFuncCb(IntPtr L, int pos) { return TypeChecker.CheckDelegateType(typeof(ToLuaFramework.DelegateThreadFuncCb), L, pos); } void Push_ToLuaFramework_DelegateThreadFuncCb(IntPtr L, ToLuaFramework.DelegateThreadFuncCb o) { ToLua.Push(L, o); } class System_Predicate_object_Event : LuaDelegate { public System_Predicate_object_Event(LuaFunction func) : base(func) { } public System_Predicate_object_Event(LuaFunction func, LuaTable self) : base(func, self) { } public bool Call(object param0) { func.BeginPCall(); func.Push(param0); func.PCall(); bool ret = func.CheckBoolean(); func.EndPCall(); return ret; } public bool CallWithSelf(object param0) { func.BeginPCall(); func.Push(self); func.Push(param0); func.PCall(); bool ret = func.CheckBoolean(); func.EndPCall(); return ret; } } public System.Predicate<object> System_Predicate_object(LuaFunction func, LuaTable self, bool flag) { if (func == null) { System.Predicate<object> fn = delegate(object param0) { return false; }; return fn; } if(!flag) { System_Predicate_object_Event target = new System_Predicate_object_Event(func); System.Predicate<object> d = target.Call; target.method = d.Method; return d; } else { System_Predicate_object_Event target = new System_Predicate_object_Event(func, self); System.Predicate<object> d = target.CallWithSelf; target.method = d.Method; return d; } } bool Check_System_Predicate_object(IntPtr L, int pos) { return TypeChecker.CheckDelegateType(typeof(System.Predicate<object>), L, pos); } void Push_System_Predicate_object(IntPtr L, System.Predicate<object> o) { ToLua.Push(L, o); } class System_Action_object_Event : LuaDelegate { public System_Action_object_Event(LuaFunction func) : base(func) { } public System_Action_object_Event(LuaFunction func, LuaTable self) : base(func, self) { } public void Call(object param0) { func.BeginPCall(); func.Push(param0); func.PCall(); func.EndPCall(); } public void CallWithSelf(object param0) { func.BeginPCall(); func.Push(self); func.Push(param0); func.PCall(); func.EndPCall(); } } public System.Action<object> System_Action_object(LuaFunction func, LuaTable self, bool flag) { if (func == null) { System.Action<object> fn = delegate(object param0) { }; return fn; } if(!flag) { System_Action_object_Event target = new System_Action_object_Event(func); System.Action<object> d = target.Call; target.method = d.Method; return d; } else { System_Action_object_Event target = new System_Action_object_Event(func, self); System.Action<object> d = target.CallWithSelf; target.method = d.Method; return d; } } bool Check_System_Action_object(IntPtr L, int pos) { return TypeChecker.CheckDelegateType(typeof(System.Action<object>), L, pos); } void Push_System_Action_object(IntPtr L, System.Action<object> o) { ToLua.Push(L, o); } class System_Comparison_object_Event : LuaDelegate { public System_Comparison_object_Event(LuaFunction func) : base(func) { } public System_Comparison_object_Event(LuaFunction func, LuaTable self) : base(func, self) { } public int Call(object param0, object param1) { func.BeginPCall(); func.Push(param0); func.Push(param1); func.PCall(); int ret = (int)func.CheckNumber(); func.EndPCall(); return ret; } public int CallWithSelf(object param0, object param1) { func.BeginPCall(); func.Push(self); func.Push(param0); func.Push(param1); func.PCall(); int ret = (int)func.CheckNumber(); func.EndPCall(); return ret; } } public System.Comparison<object> System_Comparison_object(LuaFunction func, LuaTable self, bool flag) { if (func == null) { System.Comparison<object> fn = delegate(object param0, object param1) { return 0; }; return fn; } if(!flag) { System_Comparison_object_Event target = new System_Comparison_object_Event(func); System.Comparison<object> d = target.Call; target.method = d.Method; return d; } else { System_Comparison_object_Event target = new System_Comparison_object_Event(func, self); System.Comparison<object> d = target.CallWithSelf; target.method = d.Method; return d; } } bool Check_System_Comparison_object(IntPtr L, int pos) { return TypeChecker.CheckDelegateType(typeof(System.Comparison<object>), L, pos); } void Push_System_Comparison_object(IntPtr L, System.Comparison<object> o) { ToLua.Push(L, o); } class Delegate_SocketEvent_Event : LuaDelegate { public Delegate_SocketEvent_Event(LuaFunction func) : base(func) { } public Delegate_SocketEvent_Event(LuaFunction func, LuaTable self) : base(func, self) { } public void Call(int param0, ByteBuffer param1) { func.BeginPCall(); func.Push(param0); func.PushObject(param1); func.PCall(); func.EndPCall(); } public void CallWithSelf(int param0, ByteBuffer param1) { func.BeginPCall(); func.Push(self); func.Push(param0); func.PushObject(param1); func.PCall(); func.EndPCall(); } } public Delegate_SocketEvent Delegate_SocketEvent(LuaFunction func, LuaTable self, bool flag) { if (func == null) { Delegate_SocketEvent fn = delegate(int param0, ByteBuffer param1) { }; return fn; } if(!flag) { Delegate_SocketEvent_Event target = new Delegate_SocketEvent_Event(func); Delegate_SocketEvent d = target.Call; target.method = d.Method; return d; } else { Delegate_SocketEvent_Event target = new Delegate_SocketEvent_Event(func, self); Delegate_SocketEvent d = target.CallWithSelf; target.method = d.Method; return d; } } bool Check_Delegate_SocketEvent(IntPtr L, int pos) { return TypeChecker.CheckDelegateType(typeof(Delegate_SocketEvent), L, pos); } void Push_Delegate_SocketEvent(IntPtr L, Delegate_SocketEvent o) { ToLua.Push(L, o); } }
const AES = require('./aesjs'); function encrypt(text, key) { key = new TextEncoder().encode(key); const textBytes = AES.utils.utf8.toBytes(text); const aesCtr = new AES.ModeOfOperation.ctr(key); const encryptedBytes = aesCtr.encrypt(textBytes); return AES.utils.hex.fromBytes(encryptedBytes); } function decrypt(encryptedHex, key) { key = new TextEncoder().encode(key); const encryptedBytes = AES.utils.hex.toBytes(encryptedHex); const aesCtr = new AES.ModeOfOperation.ctr(key); const decryptedBytes = aesCtr.decrypt(encryptedBytes); return AES.utils.utf8.fromBytes(decryptedBytes); } module.exports = { encrypt, decrypt, };
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.5.0_18) on Tue Nov 02 11:26:42 PDT 2010 --> <TITLE> All Classes </TITLE> <LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style"> </HEAD> <BODY BGCOLOR="white"> <FONT size="+1" CLASS="FrameHeadingFont"> <B>All Classes</B></FONT> <BR> <TABLE BORDER="0" WIDTH="100%" SUMMARY=""> <TR> <TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="edu/sdsc/inca/AgentClient.html" title="class in edu.sdsc.inca" target="classFrame">AgentClient</A> <BR> <A HREF="edu/sdsc/inca/util/CachedProperties.html" title="class in edu.sdsc.inca.util" target="classFrame">CachedProperties</A> <BR> <A HREF="edu/sdsc/inca/Client.html" title="class in edu.sdsc.inca" target="classFrame">Client</A> <BR> <A HREF="edu/sdsc/inca/Component.html" title="class in edu.sdsc.inca" target="classFrame">Component</A> <BR> <A HREF="edu/sdsc/inca/util/ConfigProperties.html" title="class in edu.sdsc.inca.util" target="classFrame">ConfigProperties</A> <BR> <A HREF="edu/sdsc/inca/util/ConfigPropertiesTest.html" title="class in edu.sdsc.inca.util" target="classFrame">ConfigPropertiesTest</A> <BR> <A HREF="edu/sdsc/inca/ConfigurationException.html" title="class in edu.sdsc.inca" target="classFrame">ConfigurationException</A> <BR> <A HREF="edu/sdsc/inca/util/Constants.html" title="class in edu.sdsc.inca.util" target="classFrame">Constants</A> <BR> <A HREF="edu/sdsc/inca/util/CronSchedule.html" title="class in edu.sdsc.inca.util" target="classFrame">CronSchedule</A> <BR> <A HREF="edu/sdsc/inca/util/CronScheduleTest.html" title="class in edu.sdsc.inca.util" target="classFrame">CronScheduleTest</A> <BR> <A HREF="edu/sdsc/inca/util/Crypter.html" title="class in edu.sdsc.inca.util" target="classFrame">Crypter</A> <BR> <A HREF="edu/sdsc/inca/util/CrypterException.html" title="class in edu.sdsc.inca.util" target="classFrame">CrypterException</A> <BR> <A HREF="edu/sdsc/inca/util/CrypterTest.html" title="class in edu.sdsc.inca.util" target="classFrame">CrypterTest</A> <BR> <A HREF="edu/sdsc/inca/DepotClient.html" title="class in edu.sdsc.inca" target="classFrame">DepotClient</A> <BR> <A HREF="edu/sdsc/inca/util/ExpandablePattern.html" title="class in edu.sdsc.inca.util" target="classFrame">ExpandablePattern</A> <BR> <A HREF="edu/sdsc/inca/util/ExpandablePatternTest.html" title="class in edu.sdsc.inca.util" target="classFrame">ExpandablePatternTest</A> <BR> <A HREF="edu/sdsc/inca/util/ExprEvaluator.html" title="class in edu.sdsc.inca.util" target="classFrame">ExprEvaluator</A> <BR> <A HREF="edu/sdsc/inca/util/ExprEvaluatorTest.html" title="class in edu.sdsc.inca.util" target="classFrame">ExprEvaluatorTest</A> <BR> <A HREF="edu/sdsc/inca/protocol/GetLog.html" title="class in edu.sdsc.inca.protocol" target="classFrame">GetLog</A> <BR> <A HREF="edu/sdsc/inca/protocol/LogConfig.html" title="class in edu.sdsc.inca.protocol" target="classFrame">LogConfig</A> <BR> <A HREF="edu/sdsc/inca/ManagerClient.html" title="class in edu.sdsc.inca" target="classFrame">ManagerClient</A> <BR> <A HREF="edu/sdsc/inca/protocol/MessageHandler.html" title="class in edu.sdsc.inca.protocol" target="classFrame">MessageHandler</A> <BR> <A HREF="edu/sdsc/inca/protocol/MessageHandler.Permittee.html" title="class in edu.sdsc.inca.protocol" target="classFrame">MessageHandler.Permittee</A> <BR> <A HREF="edu/sdsc/inca/protocol/MessageHandler.PermitteeGroup.html" title="enum in edu.sdsc.inca.protocol" target="classFrame">MessageHandler.PermitteeGroup</A> <BR> <A HREF="edu/sdsc/inca/protocol/MessageHandlerFactory.html" title="class in edu.sdsc.inca.protocol" target="classFrame">MessageHandlerFactory</A> <BR> <A HREF="edu/sdsc/inca/protocol/MessageHandlerFactoryTest.html" title="class in edu.sdsc.inca.protocol" target="classFrame">MessageHandlerFactoryTest</A> <BR> <A HREF="edu/sdsc/inca/protocol/Permit.html" title="class in edu.sdsc.inca.protocol" target="classFrame">Permit</A> <BR> <A HREF="edu/sdsc/inca/protocol/PermitTest.html" title="class in edu.sdsc.inca.protocol" target="classFrame">PermitTest</A> <BR> <A HREF="edu/sdsc/inca/protocol/Ping.html" title="class in edu.sdsc.inca.protocol" target="classFrame">Ping</A> <BR> <A HREF="edu/sdsc/inca/protocol/Protocol.html" title="class in edu.sdsc.inca.protocol" target="classFrame">Protocol</A> <BR> <A HREF="edu/sdsc/inca/protocol/ProtocolException.html" title="class in edu.sdsc.inca.protocol" target="classFrame">ProtocolException</A> <BR> <A HREF="edu/sdsc/inca/protocol/ProtocolReader.html" title="class in edu.sdsc.inca.protocol" target="classFrame">ProtocolReader</A> <BR> <A HREF="edu/sdsc/inca/protocol/ProtocolReaderTest.html" title="class in edu.sdsc.inca.protocol" target="classFrame">ProtocolReaderTest</A> <BR> <A HREF="edu/sdsc/inca/protocol/ProtocolWriter.html" title="class in edu.sdsc.inca.protocol" target="classFrame">ProtocolWriter</A> <BR> <A HREF="edu/sdsc/inca/protocol/ProtocolWriterTest.html" title="class in edu.sdsc.inca.protocol" target="classFrame">ProtocolWriterTest</A> <BR> <A HREF="edu/sdsc/inca/repository/ReporterPackage.html" title="class in edu.sdsc.inca.repository" target="classFrame">ReporterPackage</A> <BR> <A HREF="edu/sdsc/inca/repository/Repositories.html" title="class in edu.sdsc.inca.repository" target="classFrame">Repositories</A> <BR> <A HREF="edu/sdsc/inca/repository/RepositoriesTest.html" title="class in edu.sdsc.inca.repository" target="classFrame">RepositoriesTest</A> <BR> <A HREF="edu/sdsc/inca/repository/Repository.html" title="class in edu.sdsc.inca.repository" target="classFrame">Repository</A> <BR> <A HREF="edu/sdsc/inca/repository/RepositoryPackageTest.html" title="class in edu.sdsc.inca.repository" target="classFrame">RepositoryPackageTest</A> <BR> <A HREF="edu/sdsc/inca/util/ResourcesWrapper.html" title="class in edu.sdsc.inca.util" target="classFrame">ResourcesWrapper</A> <BR> <A HREF="edu/sdsc/inca/util/ResourcesWrapperTest.html" title="class in edu.sdsc.inca.util" target="classFrame">ResourcesWrapperTest</A> <BR> <A HREF="edu/sdsc/inca/protocol/Revoke.html" title="class in edu.sdsc.inca.protocol" target="classFrame">Revoke</A> <BR> <A HREF="edu/sdsc/inca/protocol/RevokeAll.html" title="class in edu.sdsc.inca.protocol" target="classFrame">RevokeAll</A> <BR> <A HREF="edu/sdsc/inca/util/RpmPackage.html" title="class in edu.sdsc.inca.util" target="classFrame">RpmPackage</A> <BR> <A HREF="edu/sdsc/inca/Server.html" title="class in edu.sdsc.inca" target="classFrame">Server</A> <BR> <A HREF="edu/sdsc/inca/ServerClientTest.html" title="class in edu.sdsc.inca" target="classFrame">ServerClientTest</A> <BR> <A HREF="edu/sdsc/inca/ServerInput.html" title="class in edu.sdsc.inca" target="classFrame">ServerInput</A> <BR> <A HREF="edu/sdsc/inca/ServerTest.html" title="class in edu.sdsc.inca" target="classFrame">ServerTest</A> <BR> <A HREF="edu/sdsc/inca/protocol/StandardMessageHandler.html" title="class in edu.sdsc.inca.protocol" target="classFrame">StandardMessageHandler</A> <BR> <A HREF="edu/sdsc/inca/protocol/Statement.html" title="class in edu.sdsc.inca.protocol" target="classFrame">Statement</A> <BR> <A HREF="edu/sdsc/inca/protocol/StatementTest.html" title="class in edu.sdsc.inca.protocol" target="classFrame">StatementTest</A> <BR> <A HREF="edu/sdsc/inca/util/StringMethods.html" title="class in edu.sdsc.inca.util" target="classFrame">StringMethods</A> <BR> <A HREF="edu/sdsc/inca/util/StringMethodsTest.html" title="class in edu.sdsc.inca.util" target="classFrame">StringMethodsTest</A> <BR> <A HREF="edu/sdsc/inca/util/SuiteModificationException.html" title="class in edu.sdsc.inca.util" target="classFrame">SuiteModificationException</A> <BR> <A HREF="edu/sdsc/inca/util/SuiteStagesWrapper.html" title="class in edu.sdsc.inca.util" target="classFrame">SuiteStagesWrapper</A> <BR> <A HREF="edu/sdsc/inca/util/SuiteStagesWrapperTest.html" title="class in edu.sdsc.inca.util" target="classFrame">SuiteStagesWrapperTest</A> <BR> <A HREF="edu/sdsc/inca/util/SuiteWrapper.html" title="class in edu.sdsc.inca.util" target="classFrame">SuiteWrapper</A> <BR> <A HREF="edu/sdsc/inca/util/SuiteWrapperTest.html" title="class in edu.sdsc.inca.util" target="classFrame">SuiteWrapperTest</A> <BR> <A HREF="edu/sdsc/inca/protocol/VerifyProtocolVersion.html" title="class in edu.sdsc.inca.protocol" target="classFrame">VerifyProtocolVersion</A> <BR> <A HREF="edu/sdsc/inca/protocol/VerifyProtocolVersionTest.html" title="class in edu.sdsc.inca.protocol" target="classFrame">VerifyProtocolVersionTest</A> <BR> <A HREF="edu/sdsc/inca/util/Worker.html" title="class in edu.sdsc.inca.util" target="classFrame">Worker</A> <BR> <A HREF="edu/sdsc/inca/util/WorkItem.html" title="interface in edu.sdsc.inca.util" target="classFrame"><I>WorkItem</I></A> <BR> <A HREF="edu/sdsc/inca/util/WorkQueue.html" title="class in edu.sdsc.inca.util" target="classFrame">WorkQueue</A> <BR> <A HREF="edu/sdsc/inca/util/WorkQueueTest.html" title="class in edu.sdsc.inca.util" target="classFrame">WorkQueueTest</A> <BR> <A HREF="edu/sdsc/inca/util/XmlWrapper.html" title="class in edu.sdsc.inca.util" target="classFrame">XmlWrapper</A> <BR> <A HREF="edu/sdsc/inca/util/XmlWrapperTest.html" title="class in edu.sdsc.inca.util" target="classFrame">XmlWrapperTest</A> <BR> </FONT></TD> </TR> </TABLE> </BODY> </HTML>
package headfirst.adapter.ducks; public class TurkeyTestDrive { public static void main(String[] args) { MallardDuck duck = new MallardDuck(); Turkey duckAdapter = new DuckAdapter(duck); for(int i=0;i<10;i++) { System.out.println("The DuckAdapter says..."); duckAdapter.gobble(); duckAdapter.fly(); } } }
#!/usr/bin/env python __version__= "$Version: $" __rcsid__="$Id: $" import matplotlib #matplotlib.use('WX') from wx import MilliSleep from wx import SplashScreen, SPLASH_CENTRE_ON_SCREEN, SPLASH_TIMEOUT import os import sys import warnings from . import zpickle from .utils import * from .dialogs.waxy import * from .dialogs import * from .run_sim import * import threading import pylab gray=pylab.cm.gray from matplotlib.backends.backend_wxagg import FigureCanvasWx as FigureCanvas from matplotlib.backends.backend_wx import FigureManager from matplotlib.figure import Figure from matplotlib.axes import Subplot class SimThread(threading.Thread): def __init__(self,params,parent): self.params=params self.parent=parent threading.Thread.__init__(self); def run(self): run_sim(self.params,self.parent) def subplot(*args): import pylab if len(args)==1: return pylab.subplot(args[0]) elif len(args)==3: return pylab.subplot(args[0],args[1],args[2]) elif len(args)==4: r=args[2] c=args[3] return pylab.subplot(args[0],args[1],c+(r-1)*args[1]); else: raise ValueError("invalid number of arguments") class MainFrame(Frame): def __init__(self,parent=None,title='',direction='H', size=(750,750),lfname=None,params=None): self.fig=None # turn off security warning on tmpnam. why is it here? warnings.filterwarnings('ignore') fname=os.tempnam() warnings.resetwarnings() self.base_dir=os.path.dirname(__file__) if not self.base_dir: self.base_dir='.' self.tmpfile=fname+"_plasticity.dat" self.modified=False self.running=False self.stopping=False self.quitting=False self.plot_first=False if not params: self.params=default_params() else: self.params=params for p in self.params['pattern_input']: if not os.path.exists(p['filename']): p['filename']=self.base_dir+"/"+p['filename'] if lfname: if not self.__load_sim__(lfname): self.plot_first=True Frame.__init__(self,parent,title,direction,size) def Body(self): self.CreateMenu() self.CenterOnScreen() self.ResetTitle() fname=self.base_dir+"/images/plasticity_small_icon.ico" self.SetIcon(fname) self.fig = Figure(figsize=(7,5),dpi=100) self.canvas = FigureCanvas(self, -1, self.fig) self.figmgr = FigureManager(self.canvas, 1, self) self.axes = [self.fig.add_subplot(221), self.fig.add_subplot(222), self.fig.add_subplot(223), self.fig.add_subplot(224)] if self.plot_first: sim=zpickle.load(self.tmpfile) sim['params']['display']=True self.Plot(sim) def Stopping(self): return self.stopping def Yield(self): wx.Yield() def ResetTitle(self): (root,sfname)=os.path.split(self.params['save_sim_file']) if self.modified: s=' (*)' else: s='' title='Plasticity: %s%s' % (sfname,s) self.SetTitle(title) def Plot(self,sim): if not sim['params']['display']: return if sim['params']['display_module']: try: module=__import__(sim['params']['display_module'],fromlist=['UserPlot']) except ImportError: sim['params']['display']=False dlg = MessageDialog(self, "Error","Error in Import: %s. Turning display off" % sim['params']['display_module'], icon='error') dlg.ShowModal() dlg.Destroy() return try: module.UserPlot(self,sim) return except ValueError: sim['params']['display']=False dlg = MessageDialog(self, "Error","Error in display. Turning display off", icon='error') dlg.ShowModal() dlg.Destroy() return try: im=weights2image(sim['params'],sim['weights']) self.axes[0].hold(False) self.axes[0].set_axis_bgcolor('k') self.axes[0].pcolor(im,cmap=gray,edgecolors='k') self.axes[0].set_aspect('equal') num_moments=sim['moments_mat'].shape[0] self.axes[1].hold(False) num_neurons=sim['moments_mat'].shape[1] for k in range(num_neurons): for i in range(num_moments): self.axes[1].plot(sim['moments_mat'][i,k,:],'-o') self.axes[1].hold(True) self.axes[2].hold(False) response_mat=sim['response_mat'] response_var_list=sim['response_var_list'] styles=['b-o','g-o'] for i,r in enumerate(response_var_list[-1]): x=r[1] y=r[2] self.axes[2].plot(x,y,styles[i]) self.axes[2].hold(True) self.axes[3].hold(False) styles=['b-o','g-o'] for i,r in enumerate(response_mat): self.axes[3].plot(r,styles[i]) self.axes[3].hold(True) self.canvas.draw() self.canvas.gui_repaint() except ValueError: sim['params']['display']=False dlg = MessageDialog(self, "Error","Error in display. Turning display off", icon='error') dlg.ShowModal() dlg.Destroy() def Run_Pause(self,event): if not self.running: # pylab.close() self.params['tmpfile']=self.tmpfile if os.path.exists(self.tmpfile): self.params['continue']=1 self.modified=True self.ResetTitle() self.running=True ## d={} ## d['params']=self.params ## zpickle.save(d,'plasticity_tmpparams.dat') ## cmd='./run_sim.py --paramfile plasticity_tmpparams.dat --from_gui 1' ## os.system(cmd) self.stopping=False run_sim(self.params,self) self.params['load_sim_file']=self.tmpfile self.running=False if self.quitting: self.Quit() else: self.stopping=True def __load_sim__(self,lfname): sim=zpickle.load(lfname) params=sim['params'] params['save_sim_file']=self.params['save_sim_file'] params['load_sim_file']='' params['continue']=False try: params['initial_weights']=sim['weights'] params['initial_moments']=sim['moments'] except KeyError: self.params=params return 1 params['load_sim_file']=self.tmpfile params['continue']=True sim['params']=params self.params=params zpickle.save(sim,self.tmpfile) return 0 def Reset_Simulation(self,event=None): if not os.path.exists(self.tmpfile): return self.canvas.Show(False) if self.modified: (root,sfname)=os.path.split(self.params['save_sim_file']) dlg=MessageDialog(self, text="Do you want to save the changes you made to %s?" % sfname, title="Reset", ok=0, yes_no=1,cancel=1) result=dlg.ShowModal() dlg.Destroy() if result == 'cancel': self.canvas.Show(True) return elif result == 'yes': filename=self.Save_Simulation() if not filename: # cancelled the save self.canvas.Show(True) return self.params['continue']=False self.params['load_sim_file']='' self.params['initial_weights']=[] self.params['initial_moments']=[] for a in self.axes: a.cla() self.canvas.draw() self.canvas.Show(True) def Restart(self,event=None): if not os.path.exists(self.tmpfile): return self.canvas.Show(False) if self.modified: (root,sfname)=os.path.split(self.params['save_sim_file']) dlg=MessageDialog(self, text="Do you want to save the changes you made to %s?" % sfname, title="Restart", ok=0, yes_no=1,cancel=1) result=dlg.ShowModal() dlg.Destroy() if result == 'cancel': self.canvas.Show(True) return elif result == 'yes': filename=self.Save_Simulation() if not filename: # cancelled the save self.canvas.Show(True) return self.__load_sim__(self.tmpfile) self.params['continue']=False self.canvas.Show(True) def Load_Simulation(self,event=None): self.canvas.Show(False) if self.modified: (root,sfname)=os.path.split(self.params['save_sim_file']) dlg=MessageDialog(self, text="Do you want to save the changes you made to %s?" % sfname, title="Load Simulation", ok=0, yes_no=1,cancel=1) result=dlg.ShowModal() dlg.Destroy() if result == 'cancel': pass elif result == 'yes': self.Save_Simulation() lfname='' dlg = FileDialog(self, "Load Simulation",default_dir=os.getcwd()+"/sims", wildcard='DAT Files|*.dat|All Files|*.*') result = dlg.ShowModal() if result == 'ok': lfname = dlg.GetPaths()[0] dlg.Destroy() if not lfname: self.canvas.Show(True) return self.__load_sim__(lfname) sim=zpickle.load(self.tmpfile) self.Plot(sim) self.canvas.Show(True) def Save_Simulation(self,event=None): if not self.modified: return sfname=self.params['save_sim_file'] def_sfname=default_params()['save_sim_file'] if sfname==def_sfname: filename=self.Save_Simulation_As() else: filename=sfname d=zpickle.load(self.tmpfile) d['params']=self.params zpickle.save(d,sfname) self.modified=False self.ResetTitle() return filename def Save_Simulation_As(self,event=None): self.canvas.Show(False) dlg = FileDialog(self, "Save Simulation As...",default_dir=os.getcwd()+"/sims/", wildcard='DAT Files|*.dat|All Files|*.*',save=1) result = dlg.ShowModal() if result == 'ok': filename = dlg.GetPaths()[0] else: filename=None dlg.Destroy() if filename: d=zpickle.load(self.tmpfile) self.params['save_sim_file']=filename d['params']=self.params zpickle.save(d,filename) self.modified=False self.ResetTitle() self.canvas.Show(True) return filename def Set_Simulation_Parameters(self,event): self.canvas.Show(False) set_simulation_parameters(self.params,self) self.canvas.Show(True) def Set_Input_Parameters(self,event): self.canvas.Show(False) set_input_parameters(self.params,self) self.canvas.Show(True) def Set_Output_Parameters(self,event): self.canvas.Show(False) set_output_parameters(self.params,self) self.canvas.Show(True) def Set_Weight_Parameters(self,event): self.canvas.Show(False) set_weight_parameters(self.params,self) self.canvas.Show(True) def Save_Parameters_As(self,event): save_parameters_as(self.params,self) def Set_Parameter_Structure(self,event): set_parameter_structure(self.params,self) def Load_Parameters(self,event): p=load_parameters(None,self) if p: self.params=p def CreateMenu(self): menubar = MenuBar() menu = Menu(self) menu.Append("L&oad State", self.Load_Simulation, "Load a Complete Simulation",hotkey="Ctrl+O") menu.Append("Load &Parameters", self.Load_Parameters, "Load Simulation Parameters") menu.AppendSeparator() menu.Append("Save Parameters As...", self.Save_Parameters_As, "Save Simulation Parameters") menu.Append("Save State As...", self.Save_Simulation_As, "Save a Complete Simulation") menu.Append("Save State", self.Save_Simulation, "Save a Complete Simulation",hotkey="Ctrl+S") menu.AppendSeparator() menu.Append("&Run/Pause", self.Run_Pause, "Run a Simulation",hotkey="Ctrl+P") menu.Append("Restart from Current State", self.Restart) menu.Append("Reset Simulation", self.Reset_Simulation,hotkey="Ctrl+R") menu.AppendSeparator() menu.Append("Export Figure...", self.Export, "Export the Screen") menu.Append("&Quit", self.Quit, "Quit",hotkey="Ctrl+Q") menubar.Append(menu, "&File") menu = Menu(self) menu.Append("&Simulation Parameters", self.Set_Simulation_Parameters) menu.Append("&Input Parameters", self.Set_Input_Parameters) menu.Append("&Output Neuron Parameters", self.Set_Output_Parameters) menu.Append("&Weight Parameters", self.Set_Weight_Parameters) menu.AppendSeparator() menu.Append("&Display", self.Display) menu.Append("Make &New Input Files", self.Nop) menu.Append("Parameter Structure", self.Set_Parameter_Structure) menubar.Append(menu, "&Edit") menu=Menu(self) menu.Append("&Help", self.Nop) menu.Append("&About", self.About) menubar.Append(menu, "&Help") self.SetMenuBar(menubar) self.CreateStatusBar() def Display(self,event=None): self.canvas.Show(False) dlg = FileDialog(self, "Choose Display Module",default_dir=os.getcwd()+"/", wildcard='Python Plot Files|plot*.py|All Files|*.*') result = dlg.ShowModal() dlg.Destroy() if result == 'ok': lfname = dlg.GetPaths()[0] modulename=os.path.splitext(os.path.split(lfname)[-1])[0] self.params['display_module']=modulename if os.path.exists(self.tmpfile): sim=zpickle.load(self.tmpfile) self.Plot(sim) self.canvas.Show(True) def About(self,event): win=AboutWindow() win.Show() def Nop(self,event): self.canvas.Show(False) dlg = MessageDialog(self, "Error","Function Not Implemented",icon='error') dlg.ShowModal() dlg.Destroy() self.canvas.Show(True) def Export(self,event=None): export_fig(self) def Quit(self,event=None): if self.running: self.quitting=True self.stopping=True return self.canvas.Show(False) if self.modified: (root,sfname)=os.path.split(self.params['save_sim_file']) dlg=MessageDialog(self, text="Do you want to save the changes you made to %s?" % sfname, title="Quit", ok=0, yes_no=1,cancel=1) result=dlg.ShowModal() dlg.Destroy() if result == 'cancel': self.canvas.Show(True) return elif result == 'yes': self.Save_Simulation() self.Close() if os.path.exists(self.tmpfile): os.remove(self.tmpfile) def run(lfname=None,params=None,use_splash=True): if use_splash: app1=Application(splash.SplashFrame) app1.Run() app = Application(MainFrame, title="Plasticity",lfname=lfname, params=params) app.Run() if __name__ == '__main__': from optparse import OptionParser parser = OptionParser() parser.add_option( "--nosplash", action="store_false", dest="splash", default=True, help="don't show the splash screen") (options, args) = parser.parse_args() if options.splash: app1=Application(splash.SplashFrame) app1.Run() if len(args)>=1: lfname=args[0] else: lfname=None run(lfname)
<!DOCTYPE html> <!--[if lt IE 9]><html class="no-js lt-ie9" lang="en" dir="ltr"><![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en" dir="ltr"> <!--<![endif]--> <!-- Usage: /eic/site/ccc-rec.nsf/tpl-eng/template-1col.html?Open&id=3 (optional: ?Open&page=filename.html&id=x) --> <!-- Created: ; Product Code: 536; Server: stratnotes2.ic.gc.ca --> <head> <!-- Title begins / Début du titre --> <title> Orbis Engineering Field Services Ltd. - Complete profile - Canadian Company Capabilities - Industries and Business - Industry Canada </title> <!-- Title ends / Fin du titre --> <!-- Meta-data begins / Début des métadonnées --> <meta charset="utf-8" /> <meta name="dcterms.language" title="ISO639-2" content="eng" /> <meta name="dcterms.title" content="" /> <meta name="description" content="" /> <meta name="dcterms.description" content="" /> <meta name="dcterms.type" content="report, data set" /> <meta name="dcterms.subject" content="businesses, industry" /> <meta name="dcterms.subject" content="businesses, industry" /> <meta name="dcterms.issued" title="W3CDTF" content="" /> <meta name="dcterms.modified" title="W3CDTF" content="" /> <meta name="keywords" content="" /> <meta name="dcterms.creator" content="" /> <meta name="author" content="" /> <meta name="dcterms.created" title="W3CDTF" content="" /> <meta name="dcterms.publisher" content="" /> <meta name="dcterms.audience" title="icaudience" content="" /> <meta name="dcterms.spatial" title="ISO3166-1" content="" /> <meta name="dcterms.spatial" title="gcgeonames" content="" /> <meta name="dcterms.format" content="HTML" /> <meta name="dcterms.identifier" title="ICsiteProduct" content="536" /> <!-- EPI-11240 --> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- MCG-202 --> <meta content="width=device-width,initial-scale=1" name="viewport"> <!-- EPI-11567 --> <meta name = "format-detection" content = "telephone=no"> <!-- EPI-12603 --> <meta name="robots" content="noarchive"> <!-- EPI-11190 - Webtrends --> <script> var startTime = new Date(); startTime = startTime.getTime(); </script> <!--[if gte IE 9 | !IE ]><!--> <link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="icon" type="image/x-icon"> <link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/wet-boew.min.css"> <!--<![endif]--> <link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/theme.min.css"> <!--[if lt IE 9]> <link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="shortcut icon" /> <link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/ie8-wet-boew.min.css" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/ie8-wet-boew.min.js"></script> <![endif]--> <!--[if lte IE 9]> <![endif]--> <noscript><link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/noscript.min.css" /></noscript> <!-- Google Tag Manager DO NOT REMOVE OR MODIFY - NE PAS SUPPRIMER OU MODIFIER --> <script>dataLayer1 = [];</script> <!-- End Google Tag Manager --> <!-- EPI-11235 --> <link rel="stylesheet" href="/eic/home.nsf/css/add_WET_4-0_Canada_Apps.css"> <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> <link href="/app/ccc/srch/css/print.css" media="print" rel="stylesheet" type="text/css" /> </head> <body class="home" vocab="http://schema.org/" typeof="WebPage"> <!-- EPIC HEADER BEGIN --> <!-- Google Tag Manager DO NOT REMOVE OR MODIFY - NE PAS SUPPRIMER OU MODIFIER --> <noscript><iframe title="Google Tag Manager" src="//www.googletagmanager.com/ns.html?id=GTM-TLGQ9K" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer1'?'&l='+l:'';j.async=true;j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer1','GTM-TLGQ9K');</script> <!-- End Google Tag Manager --> <!-- EPI-12801 --> <span typeof="Organization"><meta property="legalName" content="Department_of_Industry"></span> <ul id="wb-tphp"> <li class="wb-slc"> <a class="wb-sl" href="#wb-cont">Skip to main content</a> </li> <li class="wb-slc visible-sm visible-md visible-lg"> <a class="wb-sl" href="#wb-info">Skip to "About this site"</a> </li> </ul> <header role="banner"> <div id="wb-bnr" class="container"> <section id="wb-lng" class="visible-md visible-lg text-right"> <h2 class="wb-inv">Language selection</h2> <div class="row"> <div class="col-md-12"> <ul class="list-inline mrgn-bttm-0"> <li><a href="nvgt.do?V_TOKEN=1492233060630&V_SEARCH.docsCount=3&V_DOCUMENT.docRank=33974&V_SEARCH.docsStart=33973&V_SEARCH.command=navigate&V_SEARCH.resultsJSP=/prfl.do&lang=fra&redirectUrl=/app/scr/imbs/ccc/rgstrtn/rgstr.sec?_flId?_flxKy=e1s1&amp;estblmntNo=234567041301&amp;profileId=61&amp;_evId=bck&amp;lang=eng&amp;V_SEARCH.showStricts=false&amp;prtl=1&amp;_flId?_flId?_flxKy=e1s1" title="Français" lang="fr">Français</a></li> </ul> </div> </div> </section> <div class="row"> <div class="brand col-xs-8 col-sm-9 col-md-6"> <a href="http://www.canada.ca/en/index.html"><object type="image/svg+xml" tabindex="-1" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/sig-blk-en.svg"></object><span class="wb-inv"> Government of Canada</span></a> </div> <section class="wb-mb-links col-xs-4 col-sm-3 visible-sm visible-xs" id="wb-glb-mn"> <h2>Search and menus</h2> <ul class="list-inline text-right chvrn"> <li><a href="#mb-pnl" title="Search and menus" aria-controls="mb-pnl" class="overlay-lnk" role="button"><span class="glyphicon glyphicon-search"><span class="glyphicon glyphicon-th-list"><span class="wb-inv">Search and menus</span></span></span></a></li> </ul> <div id="mb-pnl"></div> </section> <!-- Site Search Removed --> </div> </div> <nav role="navigation" id="wb-sm" class="wb-menu visible-md visible-lg" data-trgt="mb-pnl" data-ajax-fetch="//cdn.canada.ca/gcweb-cdn-dev/sitemenu/sitemenu-en.html" typeof="SiteNavigationElement"> <h2 class="wb-inv">Topics menu</h2> <div class="container nvbar"> <div class="row"> <ul class="list-inline menu"> <li><a href="https://www.canada.ca/en/services/jobs.html">Jobs</a></li> <li><a href="http://www.cic.gc.ca/english/index.asp">Immigration</a></li> <li><a href="https://travel.gc.ca/">Travel</a></li> <li><a href="https://www.canada.ca/en/services/business.html">Business</a></li> <li><a href="https://www.canada.ca/en/services/benefits.html">Benefits</a></li> <li><a href="http://healthycanadians.gc.ca/index-eng.php">Health</a></li> <li><a href="https://www.canada.ca/en/services/taxes.html">Taxes</a></li> <li><a href="https://www.canada.ca/en/services.html">More services</a></li> </ul> </div> </div> </nav> <!-- EPIC BODY BEGIN --> <nav role="navigation" id="wb-bc" class="" property="breadcrumb"> <h2 class="wb-inv">You are here:</h2> <div class="container"> <div class="row"> <ol class="breadcrumb"> <li><a href="/eic/site/icgc.nsf/eng/home" title="Home">Home</a></li> <li><a href="/eic/site/icgc.nsf/eng/h_07063.html" title="Industries and Business">Industries and Business</a></li> <li><a href="/eic/site/ccc-rec.nsf/tpl-eng/../eng/home" >Canadian Company Capabilities</a></li> </ol> </div> </div> </nav> </header> <main id="wb-cont" role="main" property="mainContentOfPage" class="container"> <!-- End Header --> <!-- Begin Body --> <!-- Begin Body Title --> <!-- End Body Title --> <!-- Begin Body Head --> <!-- End Body Head --> <!-- Begin Body Content --> <br> <!-- Complete Profile --> <!-- Company Information above tabbed area--> <input id="showMore" type="hidden" value='more'/> <input id="showLess" type="hidden" value='less'/> <h1 id="wb-cont"> Company profile - Canadian Company Capabilities </h1> <div class="profileInfo hidden-print"> <ul class="list-inline"> <li><a href="cccSrch.do?lang=eng&profileId=&prtl=1&key.hitsPerPage=25&searchPage=%252Fapp%252Fccc%252Fsrch%252FcccBscSrch.do%253Flang%253Deng%2526amp%253Bprtl%253D1%2526amp%253Btagid%253D&V_SEARCH.scopeCategory=CCC.Root&V_SEARCH.depth=1&V_SEARCH.showStricts=false&V_SEARCH.sortSpec=title+asc&amp;rstBtn.x=" class="btn btn-link">New Search</a>&nbsp;|</li> <li><form name="searchForm" method="post" action="/app/ccc/srch/bscSrch.do"> <input type="hidden" name="lang" value="eng" /> <input type="hidden" name="profileId" value="" /> <input type="hidden" name="prtl" value="1" /> <input type="hidden" name="searchPage" value="%2Fapp%2Fccc%2Fsrch%2FcccBscSrch.do%3Flang%3Deng%26amp%3Bprtl%3D1%26amp%3Btagid%3D" /> <input type="hidden" name="V_SEARCH.scopeCategory" value="CCC.Root" /> <input type="hidden" name="V_SEARCH.depth" value="1" /> <input type="hidden" name="V_SEARCH.showStricts" value="false" /> <input id="repeatSearchBtn" class="btn btn-link" type="submit" value="Return to search results" /> </form></li> <li>|&nbsp;<a href="nvgt.do?V_SEARCH.docsStart=33972&amp;V_DOCUMENT.docRank=33973&amp;V_SEARCH.docsCount=3&amp;lang=eng&amp;prtl=1&amp;sbPrtl=&amp;profile=cmpltPrfl&amp;V_TOKEN=1492233093474&amp;V_SEARCH.command=navigate&amp;V_SEARCH.resultsJSP=%2fprfl.do&amp;estblmntNo=123456039805&amp;profileId=&amp;key.newSearchLabel=">Previous Company</a></li> <li>|&nbsp;<a href="nvgt.do?V_SEARCH.docsStart=33974&amp;V_DOCUMENT.docRank=33975&amp;V_SEARCH.docsCount=3&amp;lang=eng&amp;prtl=1&amp;sbPrtl=&amp;profile=cmpltPrfl&amp;V_TOKEN=1492233093474&amp;V_SEARCH.command=navigate&amp;V_SEARCH.resultsJSP=%2fprfl.do&amp;estblmntNo=234567118766&amp;profileId=&amp;key.newSearchLabel=">Next Company</a></li> </ul> </div> <details> <summary>Third-Party Information Liability Disclaimer</summary> <p>Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.</p> </details> <h2> Orbis Engineering Field Services Ltd. </h2> <div class="row"> <div class="col-md-5"> <h2 class="h5 mrgn-bttm-0">Legal/Operating Name:</h2> <p>Orbis Engineering Field Services Ltd.</p> <div class="mrgn-tp-md"></div> <p class="mrgn-bttm-0" ><a href="http://www.orbisengineering.net" target="_blank" title="Website URL">http://www.orbisengineering.net</a></p> <p><a href="mailto:info@orbisengineering.net" title="info@orbisengineering.net">info@orbisengineering.net</a></p> </div> <div class="col-md-4 mrgn-sm-sm"> <h2 class="h5 mrgn-bttm-0">Mailing Address:</h2> <address class="mrgn-bttm-md"> 300-9404 41 Ave NW<br/> EDMONTON, Alberta<br/> T6E 6G8 <br/> </address> <h2 class="h5 mrgn-bttm-0">Location Address:</h2> <address class="mrgn-bttm-md"> 300-9404 41 Ave NW<br/> EDMONTON, Alberta<br/> T6E 6G8 <br/> </address> <p class="mrgn-bttm-0"><abbr title="Telephone">Tel.</abbr>: (780) 988-1455 </p> <p class="mrgn-bttm-0"><abbr title="Telephone">Tel.</abbr>: (866) 886-7247</p> <p class="mrgn-bttm-lg"><abbr title="Facsimile">Fax</abbr>: (780) 988-0191</p> </div> <div class="col-md-3 mrgn-tp-md"> </div> </div> <div class="row mrgn-tp-md mrgn-bttm-md"> <div class="col-md-12"> <h2 class="wb-inv">Company Profile</h2> <br> Orbis Engineering Field Services specializes in field engineering for a range of industries including power generation, utilities, mining and pipelines. Services include power system field services, engineering services, maintenance planning, project management, automation services, mechanical engineering support services, training services, and thermographic scanning. <br> <br>Orbis safety protocols are meticulous, staff is experienced, and the culture is one of support. Orbis&#39; ability to service remote and restricted areas has made them the preferred engineering firm for many clients. <br> <br>Orbis started in 2001 with its head office located in Edmonton, AB. Other office locations include Vancouver, BC; Calgary, AB; Saskatoon, SK; and Santiago, Chile. Orbis is 100+ employees strong, boasts low employee turnover consistently well below the industry average, has a high percentage of repeat customers, and maintains an excellent safety rating.<br> </div> </div> <!-- <div class="wb-tabs ignore-session update-hash wb-eqht-off print-active"> --> <div class="wb-tabs ignore-session"> <div class="tabpanels"> <details id="details-panel1"> <summary> Full profile </summary> <!-- Tab 1 --> <h2 class="wb-invisible"> Full profile </h2> <!-- Contact Information --> <h3 class="page-header"> Contact information </h3> <section class="container-fluid"> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Amin Kassam </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> <!--if client gender is not null or empty we use gender based job title--> General Manager </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Area of Responsibility: </strong> </div> <div class="col-md-7"> Export Sales & Marketing, Domestic Sales & Marketing, Management Executive. </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (780) 988-1455 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Facsimile: </strong> </div> <div class="col-md-7"> (780) 988-0191 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> akassam@orbisengineering.net </div> </div> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Cody Zaitsoff </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> <!--if client gender is not null or empty we use gender based job title--> Controller </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Area of Responsibility: </strong> </div> <div class="col-md-7"> Domestic Sales & Marketing, Finance/Accounting, Management Executive, Export Sales & Marketing. </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (780) 988-1455 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Facsimile: </strong> </div> <div class="col-md-7"> (780) 988-0191 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> czaitsoff@orbisengineering.net </div> </div> </section> <p class="mrgn-tp-lg text-right small hidden-print"> <a href="#wb-cont">top of page</a> </p> <!-- Company Description --> <h3 class="page-header"> Company description </h3> <section class="container-fluid"> <div class="row"> <div class="col-md-5"> <strong> Exporting: </strong> </div> <div class="col-md-7"> No &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Industry (NAICS): </strong> </div> <div class="col-md-7"> 541330 - Engineering Services </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Business Activity: </strong> </div> <div class="col-md-7"> Services &nbsp; </div> </div> </section> <!-- Products / Services / Licensing --> <h3 class="page-header"> Product / Service / Licensing </h3> <section class="container-fluid"> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> Electrical Engineering and Electrical Field Services<br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-12"> Field Services Equipment Servicing (batteries, cables, circuit breakers, MCC, power transformers, protective relays, substation switchgears) <br> Engineering Design for Transmission, Distribution &amp; Generation, Substations, Industrial Plants, and Protection &amp; Controls <br> Power System Studies and Power System Modelling <br> Engineering Site Services (Project Management, Construction Scheduling, Equipment Evaluations) <br> Automation Services (RTU, PLC, SCADA, HMI, Utility Substation Telecontrol Commissioning) <br> Planning Services (Maintenance Planning, Master Data Support for SAP, Ellipse, Maximo, Project Management)<br> <br> </div> </div> </section> <p class="mrgn-tp-lg text-right small hidden-print"> <a href="#wb-cont">top of page</a> </p> <!-- Technology Profile --> <!-- Market Profile --> <!-- Sector Information --> <details class="mrgn-tp-md mrgn-bttm-md"> <summary> Third-Party Information Liability Disclaimer </summary> <p> Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements. </p> </details> </details> <details id="details-panel2"> <summary> Contacts </summary> <h2 class="wb-invisible"> Contact information </h2> <!-- Contact Information --> <section class="container-fluid"> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Amin Kassam </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> <!--if client gender is not null or empty we use gender based job title--> General Manager </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Area of Responsibility: </strong> </div> <div class="col-md-7"> Export Sales & Marketing, Domestic Sales & Marketing, Management Executive. </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (780) 988-1455 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Facsimile: </strong> </div> <div class="col-md-7"> (780) 988-0191 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> akassam@orbisengineering.net </div> </div> <div class="row mrgn-tp-lg"> <div class="col-md-3"> <strong> Cody Zaitsoff </strong></div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Title: </strong> </div> <div class="col-md-7"> <!--if client gender is not null or empty we use gender based job title--> Controller </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Area of Responsibility: </strong> </div> <div class="col-md-7"> Domestic Sales & Marketing, Finance/Accounting, Management Executive, Export Sales & Marketing. </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Telephone: </strong> </div> <div class="col-md-7"> (780) 988-1455 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Facsimile: </strong> </div> <div class="col-md-7"> (780) 988-0191 </div> </div> <div class="row mrgn-lft-md"> <div class="col-md-5"> <strong> Email: </strong> </div> <div class="col-md-7"> czaitsoff@orbisengineering.net </div> </div> </section> </details> <details id="details-panel3"> <summary> Description </summary> <h2 class="wb-invisible"> Company description </h2> <section class="container-fluid"> <div class="row"> <div class="col-md-5"> <strong> Exporting: </strong> </div> <div class="col-md-7"> No &nbsp; </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Industry (NAICS): </strong> </div> <div class="col-md-7"> 541330 - Engineering Services </div> </div> <div class="row"> <div class="col-md-5"> <strong> Primary Business Activity: </strong> </div> <div class="col-md-7"> Services &nbsp; </div> </div> </section> </details> <details id="details-panel4"> <summary> Products, services and licensing </summary> <h2 class="wb-invisible"> Product / Service / Licensing </h2> <section class="container-fluid"> <div class="row mrgn-bttm-md"> <div class="col-md-3"> <strong> Service Name: </strong> </div> <div class="col-md-9"> Electrical Engineering and Electrical Field Services<br> </div> </div> <div class="row mrgn-bttm-md"> <div class="col-md-12"> Field Services Equipment Servicing (batteries, cables, circuit breakers, MCC, power transformers, protective relays, substation switchgears) <br> Engineering Design for Transmission, Distribution &amp; Generation, Substations, Industrial Plants, and Protection &amp; Controls <br> Power System Studies and Power System Modelling <br> Engineering Site Services (Project Management, Construction Scheduling, Equipment Evaluations) <br> Automation Services (RTU, PLC, SCADA, HMI, Utility Substation Telecontrol Commissioning) <br> Planning Services (Maintenance Planning, Master Data Support for SAP, Ellipse, Maximo, Project Management)<br> <br> </div> </div> </section> </details> </div> </div> <div class="row"> <div class="col-md-12 text-right"> Last Update Date 2016-02-05 </div> </div> <!-- - Artifact ID: CBW - IMBS - CCC Search WAR - Group ID: ca.gc.ic.strategis.imbs.ccc.search - Version: 3.26 - Built-By: bamboo - Build Timestamp: 2017-03-02T21:29:28Z --> <!-- End Body Content --> <!-- Begin Body Foot --> <!-- End Body Foot --> <!-- END MAIN TABLE --> <!-- End body --> <!-- Begin footer --> <div class="row pagedetails"> <div class="col-sm-5 col-xs-12 datemod"> <dl id="wb-dtmd"> <dt class=" hidden-print">Date Modified:</dt> <dd class=" hidden-print"> <span><time>2017-03-02</time></span> </dd> </dl> </div> <div class="clear visible-xs"></div> <div class="col-sm-4 col-xs-6"> </div> <div class="col-sm-3 col-xs-6 text-right"> </div> <div class="clear visible-xs"></div> </div> </main> <footer role="contentinfo" id="wb-info"> <nav role="navigation" class="container wb-navcurr"> <h2 class="wb-inv">About government</h2> <!-- EPIC FOOTER BEGIN --> <!-- EPI-11638 Contact us --> <ul class="list-unstyled colcount-sm-2 colcount-md-3"> <li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07026.html#pageid=E048-H00000&amp;from=Industries">Contact us</a></li> <li><a href="https://www.canada.ca/en/government/dept.html">Departments and agencies</a></li> <li><a href="https://www.canada.ca/en/government/publicservice.html">Public service and military</a></li> <li><a href="https://www.canada.ca/en/news.html">News</a></li> <li><a href="https://www.canada.ca/en/government/system/laws.html">Treaties, laws and regulations</a></li> <li><a href="https://www.canada.ca/en/transparency/reporting.html">Government-wide reporting</a></li> <li><a href="http://pm.gc.ca/eng">Prime Minister</a></li> <li><a href="https://www.canada.ca/en/government/system.html">How government works</a></li> <li><a href="http://open.canada.ca/en/">Open government</a></li> </ul> </nav> <div class="brand"> <div class="container"> <div class="row"> <nav class="col-md-10 ftr-urlt-lnk"> <h2 class="wb-inv">About this site</h2> <ul> <li><a href="https://www.canada.ca/en/social.html">Social media</a></li> <li><a href="https://www.canada.ca/en/mobile.html">Mobile applications</a></li> <li><a href="http://www1.canada.ca/en/newsite.html">About Canada.ca</a></li> <li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07033.html">Terms and conditions</a></li> <li><a href="http://www.ic.gc.ca/eic/site/icgc.nsf/eng/h_07033.html#p1">Privacy</a></li> </ul> </nav> <div class="col-xs-6 visible-sm visible-xs tofpg"> <a href="#wb-cont">Top of Page <span class="glyphicon glyphicon-chevron-up"></span></a> </div> <div class="col-xs-6 col-md-2 text-right"> <object type="image/svg+xml" tabindex="-1" role="img" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/wmms-blk.svg" aria-label="Symbol of the Government of Canada"></object> </div> </div> </div> </div> </footer> <!--[if gte IE 9 | !IE ]><!--> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/wet-boew.min.js"></script> <!--<![endif]--> <!--[if lt IE 9]> <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/ie8-wet-boew2.min.js"></script> <![endif]--> <script src="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/js/theme.min.js"></script> <!-- EPI-10519 --> <span class="wb-sessto" data-wb-sessto='{"inactivity": 1800000, "reactionTime": 180000, "sessionalive": 1800000, "logouturl": "/app/ccc/srch/cccSrch.do?lang=eng&prtl=1"}'></span> <script src="/eic/home.nsf/js/jQuery.externalOpensInNewWindow.js"></script> <!-- EPI-11190 - Webtrends --> <script src="/eic/home.nsf/js/webtrends.js"></script> <script>var endTime = new Date();</script> <noscript> <div><img alt="" id="DCSIMG" width="1" height="1" src="//wt-sdc.ic.gc.ca/dcs6v67hwe0ei7wsv8g9fv50d_3k6i/njs.gif?dcsuri=/nojavascript&amp;WT.js=No&amp;WT.tv=9.4.0&amp;dcssip=www.ic.gc.ca"/></div> </noscript> <!-- /Webtrends --> <!-- JS deps --> <script src="/eic/home.nsf/js/jquery.imagesloaded.js"></script> <!-- EPI-11262 - Util JS --> <script src="/eic/home.nsf/js/_WET_4-0_utils_canada.min.js"></script> <!-- EPI-11383 --> <script src="/eic/home.nsf/js/jQuery.icValidationErrors.js"></script> <span style="display:none;" id='app-info' data-project-groupid='' data-project-artifactid='' data-project-version='' data-project-build-timestamp='' data-issue-tracking='' data-scm-sha1='' data-scm-sha1-abbrev='' data-scm-branch='' data-scm-commit-date=''></span> </body></html> <!-- End Footer --> <!-- - Artifact ID: CBW - IMBS - CCC Search WAR - Group ID: ca.gc.ic.strategis.imbs.ccc.search - Version: 3.26 - Built-By: bamboo - Build Timestamp: 2017-03-02T21:29:28Z -->
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _index = require('../../isSameWeek/index.js'); var _index2 = _interopRequireDefault(_index); var _index3 = require('../_lib/convertToFP/index.js'); var _index4 = _interopRequireDefault(_index3); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // This file is generated automatically by `scripts/build/fp.js`. Please, don't change it. var isSameWeekWithOptions = (0, _index4.default)(_index2.default, 3); exports.default = isSameWeekWithOptions; module.exports = exports['default'];
"丂", "丄", "丅", "丆", "丏", "丒", "丗", "丟", "丠", "両", "丣", "並", "丩", "丮", "丯", "丱", "丳", "丵", "丷", "井", "乀", "乁", "乂", "乄", "乆", "乊", "乑", "乕", "乗", "乚", "乛", "乢", "乣", "乤", "乥", "乧", "乨", "乪", "乫", "乬", "乭", "乮", "乯", "乲", "乴", "乵", "乶", "乷", "乸", "乹", "乺", "乻", "乼", "乽", "乿", "亀", "亁", "亂", "亃", "亄", "亅", "亇", "亊", "" , "亐", "亖", "亗", "亙", "亜", "亝", "亞", "亣", "亪", "亯", "亰", "亱", "亴", "亶", "亷", "亸", "亹", "亼", "亽", "亾", "仈", "仌", "仏", "仐", "仒", "仚", "仛", "仜", "仠", "仢", "仦", "仧", "仩", "仭", "仮", "仯", "仱", "仴", "仸", "仹", "仺", "仼", "仾", "伀", "伂", "伃", "伄", "伅", "伆", "伇", "伈", "伋", "伌", "伒", "伓", "伔", "夫", "伖", "伜", "伝", "伡", "伣", "伨", "伩", "伬", "伭", "伮", "伱", "伳", "伵", "伷", "伹", "伻", "伾", "伿", "佀", "佁", "佂", "佄", "佅", "佇", "布", "佉", "佊", "佋", "佌", "佒", "佔", "佖", "佡", "佢", "佦", "佨", "徊", "佫", "佭", "佮", "佱", "佲", "並", "佷", "佸", "佹", "佺", "佽", "侀", "侁", "侂", "侅", "來", "侇", "侊", "侌", "侎", "侐", "侒", "侓", "侕", "侖", "侘", "侙", "徇", "侜", "侞", "侟", "価", "侢", "" , "侤", "侫", "侭", "侰", "侱", "侲", "侳", "侴", "侶", "局", "侸", "侹", "侺", "侻", "侼", "侽", "侾", "俀", "俁", "系", "俆", "俇", "俈", "俉", "俋", "俌", "俍", "俒", "俓", "俔", "俕", "俖", "俙", "俛", "俠", "俢", "俤", "俥", "俧", "俫", "俬", "俰", "俲", "俴", "俵", "俶", "俷", "俹", "俻", "俼", "俽", "俿", "倀", "倁", "倂", "倃", "倄", "倅", "倆", "倇", "倈", "倉", "倊", "" , "個", "倎", "倐", "們", "倓", "倕", "幸", "倗", "倛", "倝", "倞", "倠", "倢", "仿", "値", "倧", "倫", "倯", "倰", "倱", "倲", "倳", "倴", "倵", "倶", "倷", "倸", "倹", "倻", "倽", "倿", "偀", "偁", "偂", "偄", "偅", "偆", "偉", "偊", "偋", "偍", "偐", "偑", "偒", "偓", "偔", "偖", "偗", "偘", "偙", "偛", "偝", "偞", "偟", "偠", "偡", "偢", "偣", "偤", "偦", "偧", "偨", "偩", "逼", "偫", "偭", "偮", "偯", "偰", "偱", "偲", "偳", "側", "偵", "偸", "偹", "咱", "偼", "偽", "傁", "傂", "傃", "傄", "傆", "傇", "傉", "傊", "傋", "傌", "傎", "傏", "傐", "傑", "傒", "傓", "傔", "傕", "傖", "傗", "傘", "備", "效", "傛", "傜", "傝", "傞", "傟", "傠", "傡", "家", "傤", "傦", "傪", "傫", "傭", "傮", "傯", "傰", "傱", "傳", "傴", "債", "傶", "傷", "傸", "傹", "傼", "" , "傽", "傾", "傿", "僀", "僁", "僂", "僃", "僄", "僅", "僆", "僇", "僈", "僉", "仙", "僋", "僌", "働", "僎", "僐", "僑", "僒", "僓", "僔", "僕", "僗", "僘", "僙", "僛", "僜", "僝", "偽", "僟", "僠", "僡", "僢", "僭", "僤", "僥", "僨", "僩", "僪", "僫", "僯", "僰", "雇", "僲", "僴", "僶", "僷", "僸", "價", "僺", "僼", "僽", "僾", "僿", "儀", "儁", "儂", "儃", "億", "當", "儈", "" , "儉", "儊", "儌", "儍", "儎", "儏", "儐", "儑", "儓", "儔", "儕", "儖", "儗", "盡", "儙", "儚", "儛", "儜", "儝", "儞", "償", "儠", "儢", "儣", "儤", "儥", "儦", "儧", "儨", "儩", "優", "儫", "儬", "儭", "儮", "儯", "儰", "儱", "儲", "儳", "儴", "儵", "儶", "儷", "羅", "儹", "儺", "儻", "儼", "儽", "儾", "兂", "凶", "兊", "兌", "兎", "兏", "児", "兒", "兓", "兗", "兘", "兙", "兛", "兝", "兞", "兟", "兠", "兡", "兣", "兤", "兦", "內", "兩", "兪", "兯", "兲", "兺", "兾", "兿", "冃", "冄", "円", "冇", "冊", "冋", "冎", "冏", "冐", "胄", "冓", "冔", "冘", "冚", "冝", "冞", "冟", "冡", "冣", "冦", "冧", "冨", "冩", "冪", "冭", "冮", "冴", "冸", "冹", "冺", "冾", "冿", "凁", "凂", "凃", "涸", "淨", "凊", "凍", "凎", "凐", "凒", "凓", "凔", "凕", "凖", "凗", "" , "凘", "凙", "凚", "凜", "凞", "凟", "凢", "凣", "凥", "處", "凧", "凨", "凩", "凪", "凬", "凮", "凱", "凲", "凴", "凷", "凾", "刄", "刅", "刉", "刋", "刌", "刏", "刐", "刓", "刔", "刕", "刜", "刞", "刟", "刡", "刢", "刣", "別", "刦", "刧", "刪", "剗", "刯", "刱", "刲", "刴", "刵", "刼", "刾", "剄", "剅", "剆", "則", "剈", "銼", "克", "剎", "剏", "剒", "剓", "剕", "剗", "剘", "" , "剙", "剚", "剛", "剝", "剟", "剠", "剢", "剣", "剤", "剦", "剨", "剫", "剬", "剭", "剮", "剰", "剱", "札", "剴", "創", "剶", "鏟", "剸", "剹", "剺", "剻", "剼", "剾", "劀", "劃", "札", "劅", "劆", "劇", "劉", "劊", "劋", "劌", "劍", "劎", "劏", "劑", "劒", "劔", "劕", "劖", "劗", "劘", "劙", "劚", "劜", "劤", "劥", "劦", "劧", "劮", "劯", "劰", "労", "劵", "劶", "劷", "劸", "効", "劺", "匡", "劼", "劽", "勀", "勁", "勂", "勄", "勅", "勆", "勈", "勊", "勌", "勍", "勎", "勏", "勑", "勓", "勔", "動", "勖", "務", "勩", "勳", "勜", "勝", "勞", "勠", "勡", "勢", "績", "勥", "剿", "勧", "勨", "勩", "勪", "勫", "勬", "勭", "勮", "勯", "勱", "勲", "勳", "勴", "勵", "勶", "勷", "勸", "勻", "勼", "勽", "匁", "匂", "匃", "匄", "匇", "匉", "匊", "陶", "匌", "匎", "" , "匑", "匒", "匓", "匔", "匘", "匛", "匜", "匞", "匟", "匢", "匤", "匥", "匧", "匨", "匩", "匫", "匬", "匭", "匯", "匰", "匱", "匲", "匳", "匴", "匵", "匶", "匷", "匸", "匼", "匽", "區", "卂", "廿", "卆", "卋", "卌", "卍", "卐", "協", "単", "卙", "卛", "卝", "卥", "卨", "卪", "昂", "卭", "卲", "卶", "恤", "卻", "卼", "卽", "卾", "厀", "厁", "厃", "厇", "厈", "厊", "厎", "厏", "" , "厐", "厑", "厒", "厓", "厔", "厖", "厗", "厙", "厛", "厜", "厞", "厠", "厡", "厤", "厧", "厪", "厫", "厬", "厭", "厯", "厰", "厱", "厲", "厳", "厴", "厵", "厷", "厸", "厹", "厺", "厼", "厽", "厾", "叀", "參", "叄", "叅", "靉", "靆", "収", "叏", "叐", "叒", "叓", "叕", "叚", "叜", "叝", "叞", "睿", "叢", "叧", "叴", "叺", "叾", "叿", "吀", "吂", "吅", "吇", "寸", "吔", "吘", "吙", "吚", "吜", "吢", "吤", "吥", "吪", "吰", "吳", "吶", "吷", "吺", "吽", "吿", "呁", "呂", "呄", "呅", "呇", "呉", "呌", "呍", "尺", "呏", "呑", "呚", "呝", "呞", "呟", "呠", "呡", "呣", "呥", "呧", "呩", "呪", "呫", "呬", "呭", "呮", "呯", "呰", "呴", "呹", "呺", "呾", "呿", "咁", "咃", "咅", "咇", "咈", "咉", "咊", "咍", "咑", "咓", "咗", "咘", "咜", "咞", "咟", "咠", "咡", "" , "咢", "咥", "咮", "咰", "咲", "咵", "咶", "啕", "咹", "咺", "咼", "咾", "哃", "哅", "哊", "哋", "哖", "哘", "哛", "哠", "員", "哢", "哣", "哤", "哫", "哬", "哯", "哰", "哱", "哴", "哵", "哶", "哷", "哸", "哹", "哻", "哾", "唀", "唂", "唃", "唄", "唅", "唈", "唊", "唋", "唌", "唍", "唎", "唒", "唓", "唕", "唖", "唗", "唘", "唙", "唚", "唜", "嗊", "唞", "唟", "啢", "唥", "唦", "" , "唨", "唩", "唫", "唭", "唲", "唴", "唵", "唶", "念", "唹", "唺", "唻", "唽", "啀", "啂", "啅", "啇", "啈", "啋", "啌", "啍", "啎", "問", "啑", "啒", "啟", "啔", "啖", "啘", "啙", "啚", "啛", "啝", "啞", "啟", "啠", "啢", "銜", "啨", "啩", "啫", "啯", "囉", "啱", "啲", "啳", "啴", "啹", "啺", "啽", "啿", "喅", "喆", "喌", "喍", "喎", "喐", "喒", "喓", "喕", "喖", "喗", "喚", "喛", "喞", "喠", "喡", "喢", "喣", "喤", "喥", "喦", "喨", "喩", "喪", "吃", "喬", "喭", "單", "喯", "喰", "喲", "喴", "営", "喸", "喺", "喼", "喿", "嗀", "嗁", "嗂", "嗃", "嗆", "嗇", "嗈", "嗊", "嗋", "嗎", "嗏", "嗐", "嗕", "嗗", "嗘", "嗙", "嗚", "嗛", "嗞", "嗠", "嗢", "嗧", "嗩", "嗭", "嗮", "嗰", "嗱", "嗴", "嗶", "嗸", "嗹", "嗺", "嗻", "嗼", "嗿", "嘂", "嘃", "嘄", "嘅", "" , "嘆", "嘇", "嘊", "嘋", "嘍", "嘐", "嘑", "嘒", "嘓", "嘔", "嘕", "嘖", "嘗", "嘙", "嘚", "嘜", "嘝", "嘠", "嘡", "嘢", "嘥", "嘦", "嘨", "嘩", "嘪", "嘫", "嘮", "嘯", "嘰", "嘳", "嘵", "嘷", "嘸", "嘺", "嘼", "嘽", "嘾", "噀", "惡", "噂", "噃", "噄", "噅", "噆", "噇", "噈", "噉", "噊", "噋", "噏", "噐", "噑", "噒", "噓", "噕", "噖", "噚", "噛", "噝", "噞", "噟", "噠", "噡", "" , "噣", "噥", "噦", "噧", "噭", "噮", "噯", "噰", "噲", "噳", "噴", "噵", "噷", "噸", "當", "噺", "噽", "噾", "噿", "嚀", "嚁", "嚂", "嚃", "嚄", "嚇", "嚈", "嚉", "嚊", "嚋", "嚌", "嚍", "嘗", "嚑", "嚒", "嚔", "嚕", "嚖", "嚗", "嚘", "齧", "嚚", "嚛", "嚜", "嚝", "嚞", "嚟", "嚠", "嚡", "嚢", "嚤", "咽", "嚦", "嚧", "嚨", "嚩", "嚪", "嚫", "嚬", "嚭", "向", "嚰", "嚱", "嚲", "嚳", "嚴", "嚵", "嚶", "嚸", "嚹", "嚺", "嚻", "嚽", "嚾", "嚿", "囀", "囁", "囂", "囃", "囄", "囅", "囆", "囇", "囈", "囉", "囋", "蘇", "囍", "囎", "囏", "囐", "囑", "囒", "齧", "囕", "囖", "囘", "囙", "囜", "団", "囥", "囦", "囧", "囨", "囩", "囪", "囬", "囮", "國", "囲", "図", "囶", "囷", "囸", "囻", "囼", "圀", "圁", "圂", "圅", "圇", "國", "圌", "圍", "圎", "圈", "圐", "圑", "" , "園", "圓", "圔", "圕", "圖", "圗", "團", "圙", "圚", "圛", "圝", "圞", "圠", "圡", "圢", "圤", "圥", "圦", "圧", "圫", "圱", "圲", "圴", "圵", "圶", "圷", "圸", "圼", "圽", "圿", "坁", "坃", "坄", "坅", "坆", "坈", "坉", "坋", "坒", "坓", "坔", "坕", "坖", "坘", "坙", "坢", "坣", "坥", "坧", "坬", "坮", "坰", "坱", "坲", "坴", "丘", "坸", "坹", "坺", "坽", "坾", "坿", "垀", "" , "垁", "垇", "垈", "垉", "垊", "垍", "垎", "垏", "垐", "垑", "垔", "垕", "垖", "垗", "垘", "垙", "垚", "垜", "垝", "垞", "垟", "垥", "垨", "垪", "垬", "垯", "垰", "垱", "垳", "垵", "垶", "垷", "垹", "垺", "垻", "垼", "垽", "垾", "垿", "埀", "埁", "埄", "埅", "埆", "埇", "埈", "埉", "埊", "埌", "埍", "埐", "埑", "埓", "埖", "埗", "埛", "野", "埞", "埡", "埢", "埣", "埥", "埦", "埧", "埨", "埩", "埪", "埫", "埬", "埮", "埰", "埱", "埲", "埳", "埵", "埶", "執", "埻", "崎", "埾", "埿", "堁", "堃", "堄", "堅", "堈", "堉", "堊", "堌", "堎", "堏", "堐", "堒", "堓", "堔", "堖", "堗", "堘", "堚", "堛", "堜", "堝", "堟", "堢", "堣", "堥", "堦", "堧", "堨", "堩", "堫", "堬", "堭", "堮", "堯", "報", "堲", "堳", "場", "堶", "堷", "堸", "堹", "堺", "堻", "堼", "堽", "" , "堾", "堿", "塀", "塁", "塂", "塃", "塅", "塆", "塇", "塈", "塉", "塊", "塋", "塎", "塏", "塐", "塒", "塓", "塕", "塖", "涂", "塙", "冢", "塛", "塜", "塝", "塟", "塠", "塡", "塢", "塣", "壎", "塦", "塧", "塨", "塩", "塪", "塭", "塮", "塯", "塰", "塱", "塲", "塳", "塴", "塵", "塶", "塷", "塸", "塹", "塺", "塻", "塼", "塽", "塿", "墂", "墄", "墆", "墇", "墈", "墊", "墋", "墌", "" , "墍", "墎", "墏", "墐", "墑", "墔", "墕", "墖", "増", "墘", "墛", "墜", "墝", "墠", "墡", "墢", "墣", "墤", "墥", "墦", "墧", "墪", "樽", "墬", "墭", "墮", "墯", "墰", "墱", "墲", "墳", "墴", "墵", "墶", "墷", "墸", "墹", "墺", "牆", "墽", "墾", "墿", "壀", "壂", "壃", "壄", "壆", "壇", "壈", "壉", "壊", "壋", "壌", "壍", "壎", "壏", "壐", "壒", "壓", "壔", "壖", "壗", "壘", "壙", "壚", "壛", "壜", "壝", "壞", "壟", "壠", "壡", "壢", "壣", "壥", "壦", "壧", "壨", "壩", "壪", "壭", "壯", "壱", "売", "壴", "壵", "壷", "壸", "壺", "壻", "壼", "壽", "壾", "壿", "夀", "夁", "夃", "夅", "夆", "夈", "変", "夊", "夋", "夌", "夎", "夐", "夑", "夒", "夓", "夗", "夘", "夛", "夝", "夞", "夠", "夡", "夢", "夣", "夦", "夨", "夬", "夰", "夲", "夳", "夵", "夶", "夻", "" , "夽", "夾", "夿", "奀", "奃", "奅", "奆", "奊", "奌", "奍", "奐", "奒", "奓", "奙", "奛", "奜", "奝", "奞", "奟", "奡", "奣", "奤", "奦", "奧", "奨", "奩", "奪", "奫", "獎", "奭", "奮", "奯", "奰", "奱", "奲", "奵", "奷", "奺", "奻", "奼", "奾", "奿", "妀", "妅", "妉", "妋", "妌", "妎", "妏", "妐", "妑", "妔", "妕", "妘", "妚", "妛", "妜", "妝", "妟", "妠", "妡", "妢", "妦", "" , "妧", "妬", "妭", "妰", "妱", "妳", "妴", "妵", "妶", "妷", "妸", "妺", "妼", "妽", "妿", "姀", "姁", "姂", "姃", "姄", "姅", "姇", "姈", "姉", "姌", "姍", "姎", "姏", "姕", "姖", "姙", "姛", "姞", "姟", "姠", "姡", "姢", "姤", "奸", "姧", "姩", "侄", "姫", "姭", "姮", "姯", "姰", "姱", "姲", "姳", "姴", "姵", "姶", "姷", "姸", "姺", "姼", "姽", "姾", "娀", "娂", "娊", "娋", "娍", "娎", "娏", "娐", "娒", "娔", "娕", "娖", "娗", "娙", "娚", "娛", "娝", "娞", "娡", "娢", "娤", "娦", "娧", "娨", "娪", "娫", "娬", "娭", "娮", "娯", "娰", "娳", "娵", "娷", "娸", "娹", "娺", "娻", "娽", "娾", "娿", "婁", "婂", "婃", "婄", "婅", "婇", "婈", "婋", "婌", "婍", "婎", "婏", "婐", "婑", "婒", "婓", "婔", "婖", "婗", "婘", "婙", "婛", "婜", "婝", "婞", "婟", "婠", "" , "婡", "婣", "婤", "婥", "婦", "婨", "婩", "婫", "淫", "婭", "婮", "婯", "婰", "婱", "婲", "嫿", "婸", "婹", "婻", "婼", "婽", "婾", "媀", "媁", "媂", "媃", "媄", "媅", "媆", "媇", "媈", "媉", "媊", "媋", "媌", "媍", "媎", "媏", "媐", "媑", "媓", "媔", "媕", "媖", "媗", "媘", "媙", "媜", "媝", "媞", "媟", "媠", "媡", "媢", "媣", "媤", "媥", "媦", "媧", "媨", "媩", "媫", "媬", "" , "媭", "偷", "媯", "媰", "媱", "媴", "媶", "媷", "媹", "媺", "媻", "媼", "媽", "愧", "嫀", "嫃", "嫄", "嫅", "嫆", "嫇", "嫈", "嫊", "裊", "嫍", "嫎", "嫏", "嫐", "嫑", "嫓", "嫕", "嫗", "嫙", "嫚", "嫛", "嫝", "嫞", "嫟", "嫢", "嫤", "嫥", "嫧", "嫨", "嫪", "嫬", "嫭", "嫮", "嫯", "嫰", "嫲", "嫳", "嫴", "嫵", "嫶", "嫷", "嫸", "嫹", "嫺", "嫻", "嫼", "嫽", "嫾", "嫿", "嬀", "嬁", "嬂", "嬃", "嬄", "嬅", "嬆", "嬇", "嬈", "嬊", "嬋", "嬌", "嬍", "嬎", "嬏", "嬐", "嬑", "嬒", "嬓", "嬔", "嬕", "嬘", "嬙", "嬚", "嬛", "嬜", "裊", "嬞", "嬟", "嬠", "嬡", "嬢", "嬣", "嬤", "嬥", "嬦", "嬧", "嬨", "嬩", "嬪", "嬫", "嬬", "奶", "嬮", "嬯", "嬰", "嬱", "嬳", "嬵", "嬶", "嬸", "嬹", "嬺", "嬻", "嬼", "嬽", "嬾", "嬿", "孁", "孂", "娘", "孄", "孅", "孆", "孇", "" , "孈", "孉", "孊", "孋", "孌", "孍", "孎", "孏", "孒", "孖", "孞", "孠", "孡", "孧", "孨", "孫", "孭", "孮", "孯", "孲", "孴", "孶", "孷", "學", "孹", "孻", "孼", "孾", "孿", "宂", "宆", "宊", "宍", "宎", "宐", "宑", "宒", "宔", "宖", "実", "宧", "宨", "宩", "宬", "宭", "宮", "宯", "宱", "宲", "宷", "宺", "宻", "宼", "采", "寁", "寃", "寈", "寉", "寊", "寋", "寍", "寎", "寏", "" , "寑", "寔", "寕", "寖", "寗", "置", "寙", "寚", "寛", "寜", "寠", "寢", "寣", "實", "寧", "審", "寪", "寫", "寬", "寭", "寯", "寱", "寲", "寳", "寴", "寵", "寶", "寷", "寽", "対", "尀", "専", "尃", "尅", "將", "專", "尋", "尌", "對", "導", "尐", "尒", "尓", "尗", "尙", "尛", "尞", "尟", "尠", "尡", "尣", "尦", "尨", "尩", "尪", "尫", "尭", "尮", "尯", "尰", "尲", "尳", "尵", "尶", "尷", "屃", "屄", "屆", "屇", "屌", "屍", "屒", "屓", "屔", "屖", "屗", "屘", "屚", "屛", "屜", "扉", "屟", "屢", "層", "屧", "屨", "屩", "屪", "屫", "屬", "屭", "屰", "屲", "屳", "屴", "屵", "屶", "屷", "屸", "屻", "屼", "屽", "屾", "岀", "岃", "岄", "岅", "岆", "岇", "岉", "岊", "岋", "岎", "岏", "岒", "岓", "岕", "岝", "岞", "岟", "岠", "岡", "岤", "岥", "岦", "岧", "岨", "" , "岪", "岮", "岯", "岰", "岲", "岴", "岶", "岹", "岺", "岻", "岼", "岾", "峀", "峂", "嶨", "峅", "峆", "峇", "峈", "峉", "峊", "峌", "峍", "峎", "峏", "峐", "峑", "峓", "峔", "峕", "峖", "峗", "峘", "峚", "峛", "峜", "峝", "峞", "峟", "峠", "峢", "嶢", "峧", "峩", "峫", "峬", "峮", "峰", "峱", "峲", "峳", "峴", "峵", "島", "峷", "峸", "峹", "峺", "峼", "峽", "峾", "峿", "崀", "" , "崁", "崄", "崅", "崈", "崉", "崊", "崋", "崌", "崍", "崏", "昆", "昆", "崒", "崓", "崕", "崗", "崘", "侖", "崚", "崜", "崝", "崟", "崠", "崡", "崢", "崣", "崥", "崨", "崪", "崫", "崬", "崯", "崰", "崱", "崲", "崳", "崵", "崶", "崷", "崸", "崹", "崺", "崻", "崼", "崿", "嵀", "嵁", "嵂", "嵃", "嵄", "嵅", "嵆", "嵈", "嵉", "嵍", "嵎", "嵏", "嵐", "嵑", "岩", "嵓", "嵔", "嵕", "嵖", "嵗", "嵙", "嶔", "嵜", "嵞", "嵟", "嵠", "嵡", "嵢", "嵣", "嵤", "嵥", "嵦", "嵧", "嵨", "嵪", "嵭", "嵮", "嵰", "嵱", "嵲", "嵳", "嵵", "嵶", "嵷", "嵸", "嵹", "嵺", "嵻", "嵼", "嵽", "嵾", "嵿", "嶀", "嶁", "嶃", "嶄", "嶅", "嶆", "嶇", "嶈", "嶉", "嶊", "嶋", "嶌", "嶍", "嶎", "嶏", "嶐", "嶑", "嶒", "嶓", "嶔", "嶕", "嶖", "嶗", "嶘", "嶚", "嶛", "嶜", "嶞", "嶟", "嶠", "" , "嶡", "嶢", "嶣", "嶤", "嶥", "嶦", "嶧", "嶨", "嶩", "嶪", "嶫", "嶬", "嶭", "嶮", "嶯", "嶰", "嶱", "嶲", "嶳", "嶴", "嶵", "嶶", "嶸", "嶹", "嶺", "嶻", "嶼", "岳", "嶾", "嶿", "巀", "巁", "巂", "巃", "巄", "巆", "巇", "巈", "巉", "巊", "巋", "岩", "巎", "巏", "巐", "巑", "巒", "巓", "巔", "巕", "岩", "巗", "巘", "巙", "巚", "巜", "巟", "巠", "巣", "巤", "巪", "巬", "巭", "" , "巰", "巵", "巶", "巸", "巹", "巺", "巻", "巼", "巿", "帀", "帄", "帇", "帉", "帊", "帋", "帍", "帎", "帒", "帓", "帗", "帞", "帟", "帠", "帡", "帢", "帣", "帤", "帥", "帨", "帩", "帪", "師", "帬", "帯", "帰", "帲", "帳", "帴", "帵", "帶", "帹", "帺", "帾", "帿", "幀", "幁", "幃", "幆", "幇", "幈", "幉", "幊", "幋", "幍", "幎", "幏", "幐", "幑", "幒", "幓", "幖", "幗", "幘", "幙", "幚", "幜", "幝", "幟", "幠", "幣", "幤", "幥", "幦", "幧", "幨", "幩", "幪", "幫", "幬", "幭", "幮", "幯", "幰", "幱", "開", "並", "干", "幾", "庁", "仄", "広", "庅", "庈", "庉", "庌", "庍", "庎", "庒", "庘", "庛", "庝", "庡", "庢", "庣", "庤", "庨", "庩", "庪", "庫", "庬", "庮", "庯", "庰", "庱", "庲", "庴", "庺", "庻", "廎", "庽", "庿", "廀", "廁", "廂", "廃", "廄", "廅", "" , "廆", "廇", "廈", "廋", "廌", "廍", "廎", "廏", "廐", "廔", "廕", "廗", "廘", "廙", "廚", "廜", "廝", "廞", "廟", "廠", "廡", "廢", "廣", "廤", "廥", "廦", "廧", "廩", "廫", "廬", "廭", "廮", "廯", "廰", "癰", "廲", "廳", "廵", "廸", "廹", "廻", "廼", "廽", "弅", "弆", "弇", "弉", "弌", "弍", "弎", "弐", "弒", "吊", "弖", "弙", "弚", "弜", "弝", "弞", "弡", "弢", "弣", "弤", "" , "弨", "弫", "弬", "弮", "弰", "弲", "弳", "弴", "張", "弶", "強", "弸", "弻", "弽", "弾", "弿", "彁", "彂", "彃", "彄", "彅", "別", "彇", "彈", "彉", "彊", "彋", "彌", "彍", "彎", "彏", "彑", "錄", "匯", "匯", "彛", "彜", "彞", "彟", "彠", "彣", "彥", "彧", "彨", "雕", "彮", "彯", "彲", "彴", "彵", "彶", "彸", "彺", "彽", "彾", "佛", "徃", "徆", "徍", "徎", "徏", "徑", "従", "徔", "徖", "徚", "徛", "徝", "從", "徟", "徠", "徢", "徣", "徤", "徥", "徦", "徧", "復", "徫", "旁", "徯", "徰", "徱", "徲", "徳", "徴", "徶", "徸", "徹", "徺", "徻", "徾", "徿", "忀", "忁", "忂", "忇", "忈", "忊", "忋", "忎", "忓", "忔", "忕", "忚", "忛", "応", "忞", "忟", "忢", "忣", "忥", "忦", "忨", "忩", "忬", "忯", "忰", "忲", "忳", "忴", "忶", "忷", "忹", "忺", "忼", "怇", "" , "怈", "怉", "怋", "怌", "怐", "怑", "怓", "怗", "怘", "怚", "怞", "怟", "怢", "怣", "怤", "怬", "怭", "怮", "怰", "怱", "怲", "怳", "怴", "怶", "怷", "怸", "怹", "怺", "怽", "怾", "恀", "恄", "恅", "恆", "恇", "恈", "恉", "恊", "恌", "恎", "恏", "恑", "恓", "恔", "恖", "恗", "恘", "恛", "恜", "恞", "恟", "恠", "恡", "恥", "恦", "恮", "恱", "恲", "恴", "恵", "恷", "恾", "悀", "" , "悁", "悂", "悅", "悆", "悇", "悈", "悊", "悋", "悎", "悏", "悐", "悑", "悓", "悕", "悗", "悘", "悙", "悜", "悞", "悡", "悢", "悤", "悥", "悧", "悩", "悪", "悮", "悰", "悳", "悵", "悶", "悷", "悹", "悺", "淒", "悾", "悿", "惀", "惁", "惂", "惃", "惄", "敦", "惈", "惉", "惌", "惍", "惎", "惏", "惐", "惒", "惓", "惔", "惖", "惗", "惙", "惛", "惞", "惡", "惢", "惣", "惤", "惥", "惪", "惱", "惲", "惵", "蠢", "惸", "惻", "惼", "惽", "惾", "惿", "愂", "愃", "愄", "愅", "愇", "愊", "愋", "愌", "愐", "愑", "愒", "愓", "愔", "愖", "愗", "愘", "愙", "愛", "愜", "愝", "愞", "愡", "愢", "愥", "愨", "愩", "愪", "愬", "愭", "愮", "愯", "愰", "愱", "愲", "愳", "愴", "愵", "愶", "愷", "愸", "愹", "愺", "愻", "愼", "愽", "愾", "慀", "慁", "慂", "慃", "栗", "慅", "慆", "" , "殷", "慉", "態", "慍", "慏", "慐", "慒", "慓", "慔", "慖", "慗", "慘", "慙", "慚", "慛", "慜", "慞", "慟", "慠", "慡", "慣", "慤", "慥", "慦", "慩", "慪", "慫", "慬", "慭", "慮", "慯", "慱", "慲", "慳", "慴", "慶", "慸", "慹", "慺", "慻", "戚", "慽", "欲", "慿", "憀", "憁", "憂", "憃", "憄", "憅", "憆", "憇", "憈", "憉", "憊", "憌", "憍", "憏", "憐", "憑", "憒", "憓", "憕", "" , "憖", "憗", "憘", "憙", "憚", "憛", "憜", "憞", "憟", "憠", "憡", "憢", "憣", "憤", "憥", "憦", "憪", "憫", "憭", "憮", "憯", "憰", "憱", "憲", "憳", "憴", "憵", "憶", "憸", "憹", "憺", "憻", "憼", "憽", "憿", "懀", "懁", "勤", "懄", "懅", "懆", "懇", "應", "懌", "懍", "懎", "懏", "懐", "懓", "懕", "懖", "懗", "懘", "懙", "懚", "懛", "懜", "懝", "蒙", "懟", "懠", "懡", "懢", "懣", "懤", "懥", "懧", "懨", "懩", "懪", "懫", "懬", "懭", "懮", "懯", "懰", "懱", "懲", "懳", "懴", "懶", "懷", "懸", "懹", "懺", "懻", "懼", "懽", "懾", "戀", "戁", "戂", "戃", "戄", "戅", "戇", "鉞", "戓", "戔", "戙", "戜", "戝", "戞", "戠", "戣", "戦", "戧", "戨", "戩", "戫", "戭", "戯", "戰", "戱", "戲", "戵", "戶", "戸", "戹", "戺", "戻", "戼", "扂", "扄", "扅", "扆", "扊", "" , "扏", "仂", "払", "扖", "扗", "扙", "扚", "扜", "扝", "捍", "扟", "扠", "扡", "扢", "扤", "扥", "扨", "插", "扲", "扴", "扵", "扷", "扸", "抵", "扻", "扽", "抁", "抂", "拚", "抅", "抆", "抇", "抈", "抋", "抌", "抍", "抎", "抏", "抐", "抱", "抙", "抜", "抝", "択", "抣", "抦", "抧", "抩", "抪", "抭", "抮", "抯", "抰", "抲", "抳", "曳", "抶", "抷", "抸", "抺", "抾", "拀", "拁", "" , "拃", "拋", "拏", "鉗", "拕", "拝", "拞", "拠", "拡", "拤", "拪", "拫", "拰", "拲", "拵", "拸", "拹", "拺", "拻", "挀", "挃", "挄", "挅", "挆", "挊", "挋", "格", "挍", "挏", "挐", "挒", "挓", "挔", "挕", "挗", "挘", "挙", "掗", "撏", "挧", "挩", "挬", "挭", "挮", "挰", "挱", "挳", "挴", "挵", "局", "挷", "挸", "挻", "挼", "挾", "挿", "捀", "捁", "捄", "捇", "捈", "捊", "捑", "捒", "捓", "捔", "捖", "捗", "捘", "捙", "捚", "捛", "搜", "捝", "捠", "捤", "捥", "捦", "舍", "捪", "捫", "捬", "捯", "捰", "卷", "捳", "捴", "捵", "捸", "捹", "捼", "捽", "捾", "捿", "掁", "掃", "掄", "掅", "掆", "掋", "掍", "掑", "掓", "掔", "掕", "掗", "掙", "掚", "掛", "掜", "掝", "掞", "掟", "采", "掤", "掦", "掫", "掯", "掱", "掲", "掵", "掶", "掹", "掻", "掽", "掿", "揀", "" , "揁", "揂", "揃", "揅", "揇", "揈", "揊", "揋", "揌", "揑", "揓", "揔", "揕", "揗", "揘", "揙", "揚", "換", "揜", "揝", "揟", "揢", "揤", "揥", "揦", "揧", "揨", "揫", "揬", "揮", "揯", "揰", "揱", "揳", "揵", "揷", "背", "揺", "揻", "揼", "揾", "搃", "搄", "構", "搇", "搈", "搉", "搊", "損", "搎", "搑", "搒", "搕", "搖", "搗", "搘", "搙", "搚", "搝", "搟", "搢", "搣", "搤", "" , "捶", "搧", "打", "搩", "搫", "搮", "掏", "搰", "搱", "搲", "搳", "搵", "搶", "搷", "搸", "搹", "搻", "搼", "榨", "捂", "摂", "扛", "摉", "摋", "摌", "摍", "摎", "摏", "摐", "摑", "摓", "摕", "摖", "摗", "摙", "摚", "摛", "摜", "摝", "摟", "摠", "摡", "摢", "摣", "摤", "摥", "摦", "摨", "摪", "摫", "摬", "摮", "摯", "摰", "摱", "摲", "摳", "摴", "摵", "摶", "摷", "摻", "摼", "摽", "摾", "摿", "撀", "撁", "撃", "撆", "撈", "撉", "撊", "撋", "撌", "撍", "撎", "撏", "撐", "撓", "撔", "撗", "撘", "拈", "撛", "撜", "撝", "撟", "撠", "撡", "撣", "撣", "撥", "扯", "撧", "撨", "撪", "撫", "撯", "撱", "撲", "撳", "撴", "撶", "撹", "撻", "撽", "撾", "撿", "擁", "擃", "擄", "擆", "擇", "擈", "擉", "擊", "擋", "擌", "擏", "擑", "擓", "擔", "擕", "擖", "擙", "據", "" , "擛", "擜", "擝", "擟", "擠", "抬", "搗", "擥", "擧", "擨", "擩", "擪", "擫", "擬", "擭", "擮", "擯", "擰", "擱", "擲", "擳", "擴", "擵", "擶", "擷", "擸", "擹", "擺", "擻", "擼", "擽", "擾", "擿", "攁", "攂", "攃", "攄", "攅", "攆", "攇", "攈", "攊", "攋", "攌", "攍", "攎", "攏", "攐", "攑", "攓", "攔", "攕", "攖", "攗", "攙", "攚", "攛", "攜", "攝", "攞", "攟", "攠", "攡", "" , "攢", "攣", "攤", "攦", "攧", "攨", "攩", "攪", "攬", "攭", "攰", "攱", "攲", "攳", "考", "攺", "攼", "攽", "敀", "敁", "敂", "敃", "敄", "敆", "敇", "敊", "敋", "敍", "敎", "敐", "敒", "敓", "敔", "敗", "敘", "敚", "敜", "敟", "敠", "敡", "敤", "敥", "敧", "敨", "敩", "敪", "敭", "敮", "敯", "敱", "敳", "敵", "敶", "數", "敹", "敺", "敻", "敼", "敽", "敾", "敿", "斀", "斁", "斂", "斃", "斄", "斅", "斆", "斈", "斉", "斊", "斍", "斎", "斏", "斒", "斔", "斕", "斖", "斘", "斚", "斝", "斞", "斠", "斢", "斣", "斦", "斨", "斪", "斬", "斮", "斱", "斲", "斳", "斴", "斵", "斶", "斷", "斸", "斺", "斻", "斾", "斿", "旀", "旗", "旇", "旈", "旉", "旊", "旍", "旐", "旑", "旓", "旔", "旕", "旘", "旙", "旚", "幡", "旜", "旝", "旞", "旟", "旡", "旣", "旤", "旪", "旫", "" , "旲", "旳", "旴", "旵", "陽", "旹", "旻", "旼", "旽", "旾", "旿", "昁", "昄", "昅", "升", "昈", "昉", "昋", "昍", "昐", "昑", "昒", "昖", "昗", "昘", "昚", "昛", "昜", "昞", "昡", "昢", "昣", "昤", "昦", "昩", "昪", "昫", "昬", "昮", "昰", "昲", "昳", "昷", "昸", "昹", "昺", "昻", "曨", "昿", "晀", "時", "晄", "晅", "晆", "晇", "晈", "晉", "晊", "晍", "晎", "晐", "晑", "晘", "" , "晙", "晛", "晜", "晝", "曦", "晠", "晰", "晣", "晥", "晧", "晩", "晪", "晫", "晬", "晭", "晱", "晲", "晰", "晵", "晸", "晹", "暗", "晼", "晽", "晿", "暀", "暁", "暃", "暅", "暆", "暈", "暉", "暊", "暋", "暍", "暎", "暏", "暐", "暒", "暓", "暔", "暕", "陽", "暙", "暚", "暛", "暜", "暞", "暟", "暠", "暡", "暢", "暣", "暤", "暥", "暦", "暩", "暪", "暫", "暬", "暭", "暯", "暰", "暱", "暲", "暳", "暵", "暶", "暷", "瞭", "暺", "暻", "暼", "暽", "暿", "曀", "曁", "曂", "曃", "曄", "曅", "歷", "曇", "曈", "曉", "曊", "曋", "曌", "曍", "曎", "向", "曐", "曑", "曒", "曓", "曔", "曕", "曖", "曗", "曘", "曚", "曞", "曟", "曠", "曡", "曢", "曣", "曤", "曥", "曧", "曨", "曪", "曫", "曬", "曭", "曮", "曯", "曱", "曵", "曶", "書", "曺", "曻", "曽", "朁", "朂", "會", "" , "朄", "朅", "朆", "朇", "朌", "朎", "朏", "朑", "朒", "朓", "朖", "朘", "朙", "朚", "朜", "朞", "朠", "朡", "望", "朣", "朤", "朥", "朧", "朩", "術", "朰", "朲", "朳", "朶", "朷", "朸", "朹", "朻", "朼", "朾", "朿", "杁", "杄", "杅", "圬", "杊", "杋", "杍", "杒", "杔", "杕", "杗", "杘", "杙", "杚", "杛", "杝", "杢", "杣", "杤", "杦", "杧", "杫", "杬", "杮", "東", "杴", "杶", "" , "杸", "杹", "杺", "杻", "杽", "枀", "枂", "枃", "枅", "枆", "枈", "枊", "枌", "枍", "枎", "枏", "枑", "枒", "枓", "枔", "枖", "枙", "枛", "枟", "枠", "枡", "枤", "枦", "枩", "枬", "枮", "枱", "枲", "拐", "枹", "枺", "枻", "枼", "枽", "枾", "枿", "柀", "柂", "柅", "柆", "柇", "柈", "柉", "柊", "柋", "柌", "柍", "柎", "柕", "柖", "柗", "柛", "柟", "柡", "柣", "柤", "柦", "柧", "柨", "柪", "柫", "柭", "柮", "柲", "柵", "柶", "柷", "柸", "柹", "拐", "査", "柼", "柾", "栁", "栂", "栃", "栄", "栆", "栍", "栐", "旬", "栔", "栕", "栘", "栙", "栚", "栛", "栜", "栞", "栟", "栠", "栢", "栣", "栤", "栥", "栦", "栧", "栨", "栫", "栬", "栭", "栮", "栯", "栰", "栱", "栴", "栵", "栶", "栺", "栻", "栿", "桇", "桋", "桍", "桏", "桒", "桖", "桗", "桘", "桙", "桚", "桛", "" , "桜", "桝", "桞", "桟", "桪", "桬", "桭", "杯", "桯", "桰", "桱", "桲", "桳", "桵", "桸", "桹", "桺", "桻", "桼", "桽", "桾", "桿", "梀", "梂", "梄", "梇", "梈", "梉", "梊", "梋", "梌", "梍", "梎", "梐", "梑", "梒", "梔", "梕", "梖", "梘", "梙", "梚", "梛", "梜", "條", "梞", "梟", "梠", "梡", "梣", "梤", "梥", "梩", "梪", "梫", "梬", "梮", "捆", "梲", "梴", "梶", "梷", "梸", "" , "梹", "梺", "梻", "梼", "梽", "梾", "梿", "棁", "棃", "棄", "棅", "棆", "棇", "棈", "棊", "棌", "棎", "棏", "棐", "棑", "棓", "棔", "棖", "棗", "棙", "棛", "棜", "棝", "棞", "棟", "棡", "棢", "棤", "棥", "棦", "棧", "棨", "棩", "棪", "棫", "棬", "棭", "棯", "棲", "棳", "棴", "棶", "棷", "棸", "棻", "棽", "棾", "棿", "椀", "椂", "椃", "椄", "椆", "椇", "椈", "椉", "椊", "椌", "椏", "椑", "椓", "椔", "椕", "椖", "椗", "椘", "椙", "椚", "椛", "検", "椝", "椞", "椡", "椢", "椣", "椥", "椦", "椧", "椨", "椩", "椪", "椫", "椬", "椮", "椯", "椱", "椲", "椳", "椵", "椶", "椷", "椸", "椺", "椻", "椼", "椾", "楀", "楁", "楃", "匾", "楅", "楆", "楇", "楈", "楉", "楊", "楋", "楌", "楍", "楎", "楏", "楐", "楑", "楒", "楓", "楕", "楖", "楘", "茂", "楛", "胡", "楟", "" , "楡", "楢", "楤", "楥", "楧", "楨", "楩", "楪", "楬", "業", "楯", "楰", "楲", "楳", "楴", "極", "楶", "楺", "楻", "楽", "楾", "楿", "榁", "榃", "榅", "榊", "榋", "榌", "榎", "榏", "榐", "榑", "榒", "榓", "榖", "榗", "榙", "榚", "榝", "榞", "榟", "榠", "榡", "榢", "榣", "榤", "榥", "干", "榩", "榪", "榬", "榮", "榯", "榰", "榲", "榳", "榵", "榶", "榸", "榹", "榺", "榼", "榽", "" , "榾", "榿", "槀", "槂", "盤", "槄", "槅", "槆", "槇", "槈", "槉", "構", "槍", "槏", "槑", "槒", "槓", "槕", "槖", "槗", "様", "槙", "檟", "槜", "槝", "槞", "槡", "槢", "槣", "槤", "槥", "槦", "槧", "槨", "槩", "槪", "槫", "槬", "槮", "槯", "槰", "槱", "槳", "槴", "槵", "槶", "槷", "槸", "槹", "槺", "槻", "規", "槾", "樀", "樁", "樂", "樃", "樄", "樅", "樆", "樇", "樈", "樉", "樋", "樌", "樍", "樎", "樏", "樐", "梁", "樒", "樓", "樔", "樕", "樖", "標", "樚", "樛", "樜", "樝", "樞", "樠", "樢", "樣", "樤", "樥", "樦", "樧", "権", "樫", "樬", "樭", "樮", "樰", "樲", "樳", "樴", "樶", "樷", "朴", "樹", "樺", "樻", "樼", "樿", "橀", "橁", "橂", "橃", "橅", "橆", "橈", "橉", "橊", "橋", "橌", "橍", "橎", "橏", "橑", "橒", "橓", "橔", "橕", "橖", "橗", "橚", "" , "橜", "橝", "橞", "機", "橠", "橢", "橣", "橤", "幢", "橧", "橨", "橩", "橪", "橫", "橬", "橭", "橮", "橯", "橰", "橲", "橳", "橴", "橵", "橶", "橷", "橸", "橺", "橻", "橽", "橾", "橿", "檁", "檂", "檃", "檅", "檆", "檇", "檈", "檉", "檊", "檋", "檌", "檍", "檏", "檒", "檓", "檔", "檕", "檖", "檘", "檙", "檚", "檛", "檜", "檝", "檞", "檟", "檡", "檢", "檣", "檤", "檥", "檦", "" , "檧", "檨", "檪", "檭", "檮", "台", "檰", "檱", "檲", "檳", "檴", "檵", "檶", "檷", "檸", "檹", "檺", "檻", "檼", "檽", "檾", "檿", "櫀", "櫁", "棹", "櫃", "櫄", "櫅", "櫆", "櫇", "櫈", "櫉", "櫊", "櫋", "櫌", "櫍", "櫎", "櫏", "累", "櫑", "櫒", "櫓", "櫔", "櫕", "櫖", "櫗", "櫘", "櫙", "櫚", "櫛", "櫜", "櫝", "櫞", "櫟", "櫠", "櫡", "櫢", "櫣", "櫤", "櫥", "櫦", "櫧", "櫨", "櫩", "櫪", "櫫", "櫬", "櫭", "櫮", "櫯", "櫰", "櫱", "櫲", "櫳", "櫴", "櫵", "櫶", "櫷", "櫸", "櫹", "櫺", "櫻", "櫼", "櫽", "櫾", "櫿", "欀", "欁", "欂", "欃", "欄", "欅", "欆", "欇", "欈", "欉", "權", "欋", "欌", "欍", "欎", "欏", "欐", "欑", "欒", "欓", "欔", "欕", "欖", "欗", "欘", "欙", "欚", "欛", "欜", "欝", "櫺", "欟", "欥", "欦", "欨", "欩", "欪", "欫", "欬", "欭", "欮", "" , "欯", "欰", "欱", "欳", "欴", "欵", "欶", "唉", "欻", "欼", "欽", "欿", "歀", "歁", "歂", "歄", "歅", "歈", "歊", "歋", "歍", "嘆", "歏", "歐", "歑", "歒", "歓", "歔", "歕", "歖", "歗", "歘", "歚", "歛", "歜", "歝", "歞", "歟", "歠", "歡", "歨", "歩", "歫", "歬", "歭", "歮", "歯", "歰", "歱", "歲", "歳", "歴", "歵", "歶", "歷", "歸", "歺", "歽", "歾", "歿", "夭", "殅", "殈", "" , "殌", "殎", "殏", "殐", "殑", "殔", "殕", "殗", "殘", "殙", "殜", "殝", "殞", "殟", "殠", "殢", "殣", "殤", "殥", "殦", "殧", "殨", "殩", "殫", "殬", "僵", "殮", "殯", "殰", "殱", "殲", "殶", "殸", "殹", "殺", "殻", "殼", "肴", "殾", "毀", "毃", "毄", "毆", "毇", "毈", "毉", "毊", "毋", "毎", "毐", "毑", "毗", "毚", "毜", "毝", "毞", "毟", "毠", "毢", "毣", "毤", "毥", "毦", "毧", "毨", "毩", "球", "毭", "毮", "毰", "毱", "毲", "毴", "毶", "毷", "毸", "毺", "毻", "毼", "毾", "毿", "氀", "氁", "氂", "氃", "氄", "氈", "氉", "氊", "氋", "氌", "氎", "氒", "気", "氜", "氝", "氞", "氠", "氣", "氥", "氫", "氬", "氭", "氱", "氳", "氶", "氷", "氹", "氺", "氻", "氼", "泛", "氿", "汃", "汄", "汅", "汈", "汋", "汌", "丸", "泛", "汏", "汑", "汒", "汓", "汖", "汘", "" , "污", "汚", "汢", "汣", "汥", "汦", "汧", "汫", "汬", "汭", "汮", "汯", "汱", "汳", "汵", "汷", "汸", "決", "汻", "汼", "汿", "沀", "沄", "沇", "沊", "沋", "冱", "沎", "沑", "沒", "沕", "沖", "沗", "沘", "沚", "沜", "沝", "沞", "沠", "沢", "渢", "沬", "沯", "沰", "沴", "沵", "沶", "沷", "沺", "泀", "況", "泂", "泃", "泆", "泇", "泈", "泋", "泍", "泎", "泏", "泑", "泒", "泘", "" , "泙", "泚", "泜", "溯", "泟", "泤", "泦", "泧", "泩", "泬", "泭", "泲", "泴", "泹", "泿", "洀", "洂", "洃", "洅", "洆", "洈", "洉", "洊", "洍", "洏", "洐", "洑", "洓", "洔", "洕", "洖", "洘", "洜", "洝", "涕", "洠", "洡", "洢", "洣", "洤", "洦", "洨", "洩", "洬", "洭", "洯", "洰", "洴", "洶", "洷", "洸", "洺", "洿", "浀", "浂", "浄", "溮", "浌", "滻", "濜", "浖", "浗", "浘", "浛", "浝", "浟", "浡", "浢", "浤", "浥", "浧", "浨", "浫", "裡", "浭", "浰", "浱", "浲", "浳", "浵", "浶", "浹", "浺", "浻", "浽", "浾", "浿", "涀", "涁", "涃", "涄", "涆", "涇", "涊", "涋", "涍", "涏", "涐", "涒", "涖", "涗", "涘", "涙", "涚", "涜", "溳", "涥", "涬", "涭", "涰", "涱", "涳", "涴", "涶", "涷", "涹", "涺", "涻", "涼", "涽", "涾", "淁", "淂", "淃", "淈", "淉", "淊", "" , "淍", "淎", "淏", "淐", "淒", "淓", "淔", "淕", "淗", "淚", "淛", "淜", "淟", "淢", "淣", "淥", "淧", "淨", "淩", "淪", "淭", "淯", "淰", "淲", "淴", "淵", "淶", "淸", "淺", "淽", "淾", "淿", "渀", "渁", "渂", "渃", "渄", "渆", "渇", "済", "渉", "渋", "渏", "渒", "渓", "渕", "渘", "渙", "減", "渜", "渞", "渟", "渢", "渦", "渧", "渨", "渪", "測", "渮", "渰", "渱", "渳", "渵", "" , "渶", "渷", "渹", "渻", "渼", "渽", "渾", "渿", "湀", "湁", "湂", "湅", "湆", "湇", "湈", "湉", "湊", "湋", "湌", "湏", "湐", "湑", "湒", "湕", "湗", "湙", "湚", "湜", "湝", "湞", "湠", "湡", "湢", "閔", "湤", "湥", "湦", "湧", "湨", "湩", "湪", "湬", "湭", "湯", "湰", "湱", "湲", "湳", "湴", "湵", "湶", "湷", "湸", "湹", "湺", "湻", "湼", "湽", "満", "溁", "溂", "溄", "漊", "溈", "溊", "溋", "溌", "溍", "溎", "溑", "溒", "溓", "溔", "溕", "准", "溗", "溙", "溚", "溛", "溝", "溞", "溠", "溡", "溣", "溤", "溦", "溨", "溩", "溫", "溬", "溭", "溮", "溰", "溳", "溵", "溸", "溹", "濕", "溾", "溿", "滀", "滃", "滄", "滅", "滆", "滈", "滉", "滊", "滌", "滍", "滎", "滐", "滒", "滖", "滘", "滙", "滛", "滜", "滝", "滣", "滧", "澦", "滫", "滬", "滭", "滮", "滯", "" , "滰", "滱", "滲", "滳", "滵", "滶", "鹵", "滸", "滺", "滻", "滼", "滽", "滾", "滿", "漀", "漁", "漃", "漄", "漅", "漇", "漈", "漊", "漋", "漌", "漍", "漎", "漐", "漑", "漒", "漖", "漗", "漘", "漙", "漚", "漛", "漜", "漝", "漞", "漟", "漡", "漢", "漣", "漥", "漦", "漧", "漨", "漬", "漮", "漰", "漲", "漴", "漵", "漷", "漸", "漹", "漺", "漻", "漼", "漽", "漿", "潀", "潁", "潂", "" , "潃", "潄", "潅", "潈", "潉", "潊", "潌", "潎", "潏", "潐", "潑", "潒", "潓", "潔", "潕", "潖", "潗", "潙", "潚", "潛", "潝", "舄", "潠", "潡", "潣", "潤", "潥", "潧", "潨", "潩", "潪", "潫", "潬", "潯", "潰", "潱", "潳", "潵", "潶", "潷", "潹", "潻", "潽", "潾", "潿", "澀", "澁", "澄", "澃", "澅", "澆", "澇", "澊", "澋", "澏", "澐", "澑", "澒", "澓", "浩", "澕", "澖", "澗", "澘", "澙", "澚", "澛", "澝", "澞", "澟", "澠", "澢", "澣", "澤", "澥", "澦", "澨", "澩", "澪", "澫", "澬", "澭", "澮", "澯", "澰", "淀", "澲", "澴", "澵", "澷", "澸", "澺", "澻", "澼", "澽", "澾", "澿", "濁", "濃", "濄", "濅", "濆", "濇", "濈", "濊", "濋", "濌", "濍", "濎", "濏", "濐", "濓", "濔", "濕", "濖", "濗", "濘", "濙", "濚", "蒙", "濜", "濝", "濟", "濢", "濣", "濤", "濥", "" , "濦", "濧", "濨", "濩", "濪", "濫", "浚", "濭", "濰", "濱", "濲", "濳", "濴", "濵", "濶", "濷", "濸", "濹", "濺", "濻", "濼", "濽", "濾", "濿", "瀀", "漾", "瀂", "瀃", "瀄", "瀅", "瀆", "瀇", "瀈", "瀉", "瀊", "沈", "瀌", "瀍", "瀎", "瀏", "瀐", "瀒", "瀓", "瀔", "瀕", "瀖", "瀗", "瀘", "瀙", "瀜", "瀝", "瀞", "瀟", "瀠", "瀡", "瀢", "瀤", "瀥", "瀦", "瀧", "瀨", "瀩", "瀪", "" , "瀫", "瀬", "瀭", "瀮", "瀯", "彌", "瀱", "瀲", "瀳", "瀴", "瀶", "瀷", "瀸", "瀺", "瀻", "瀼", "瀽", "瀾", "瀿", "灀", "灁", "灂", "灃", "灄", "灅", "灆", "灇", "灈", "灉", "灊", "灋", "灍", "灎", "灐", "灑", "灒", "灓", "灔", "漓", "灖", "灗", "灘", "灙", "灚", "灛", "灜", "灝", "灟", "灠", "灡", "灢", "灣", "灤", "灥", "灦", "灧", "灨", "灩", "灪", "灮", "灱", "灲", "灳", "灴", "灷", "灹", "灺", "灻", "災", "炁", "炂", "炃", "炄", "炆", "炇", "炈", "炋", "炌", "炍", "炏", "炐", "炑", "炓", "炗", "炘", "炚", "炛", "炞", "炟", "炠", "炡", "炢", "炣", "照", "炥", "炦", "炧", "炨", "炩", "炪", "炮", "炲", "炴", "炵", "炶", "為", "炾", "炿", "烄", "烅", "烆", "烇", "烉", "烋", "烌", "烍", "烎", "烏", "烐", "烑", "烒", "烓", "烔", "烕", "烖", "烗", "烚", "" , "烜", "烝", "烞", "烠", "烡", "烢", "烣", "烥", "烪", "烮", "烰", "烱", "烲", "烳", "烴", "烵", "烶", "烸", "烺", "烻", "烼", "烾", "烿", "焀", "焁", "焂", "焃", "焄", "焅", "焆", "焇", "焈", "焋", "焌", "焍", "焎", "焏", "焑", "焒", "焔", "焗", "焛", "焜", "焝", "焞", "焟", "焠", "無", "焢", "焣", "焤", "焥", "焧", "焨", "焩", "焪", "焫", "焬", "焭", "焮", "焲", "焳", "焴", "" , "焵", "焷", "焸", "焹", "焺", "焻", "焼", "焽", "焾", "焿", "煀", "煁", "煂", "煃", "煄", "煆", "煇", "煈", "煉", "煋", "煍", "煏", "煐", "煑", "煒", "煓", "煔", "煕", "暖", "煗", "煘", "煙", "煚", "煛", "煝", "煟", "煠", "煡", "煢", "煣", "煥", "煩", "煪", "煫", "煬", "煭", "煯", "煰", "煱", "煴", "煵", "煶", "煷", "煹", "煻", "煼", "煾", "煿", "熀", "熁", "熂", "熃", "熅", "熆", "熇", "熈", "熉", "熋", "熌", "熍", "熎", "熐", "熑", "熒", "熓", "熕", "熖", "熗", "熚", "熛", "熜", "熝", "熞", "熡", "熢", "熣", "熤", "熥", "熦", "熧", "熩", "熪", "熫", "熭", "熮", "熯", "熰", "熱", "熲", "熴", "熶", "熷", "熸", "熺", "熻", "熼", "熽", "熾", "熿", "燀", "燁", "燂", "焰", "燅", "燆", "燇", "燈", "燉", "燊", "燋", "燌", "燍", "燏", "磷", "燑", "燒", "燓", "" , "燖", "燗", "燘", "燙", "燚", "燛", "燜", "燝", "燞", "營", "燡", "燢", "燣", "燤", "燦", "燨", "燩", "燪", "燫", "毀", "燭", "燯", "燰", "燱", "燲", "燳", "燴", "燵", "燶", "燷", "燸", "燺", "熏", "燼", "燽", "燾", "耀", "爀", "爁", "爂", "爃", "爄", "爅", "爇", "爈", "爉", "爊", "爋", "爌", "爍", "爎", "爏", "爐", "爑", "爒", "爓", "爔", "爕", "爖", "爗", "爘", "爙", "爚", "" , "爛", "爜", "爞", "爟", "爠", "爡", "爢", "爣", "爤", "爥", "爦", "爧", "爩", "爫", "爭", "爮", "爯", "為", "爳", "爴", "爺", "爼", "爾", "床", "牁", "牂", "牃", "牄", "牅", "牆", "牉", "牊", "牋", "牎", "牏", "牐", "牑", "牓", "牔", "牕", "牗", "牘", "牚", "牜", "牞", "它", "牣", "牤", "牥", "牨", "牪", "牫", "牬", "牭", "牰", "牱", "牳", "抵", "牶", "牷", "牸", "牻", "牼", "牽", "犂", "犃", "犅", "犆", "犇", "犈", "犉", "犌", "犎", "犐", "犑", "犓", "犔", "犕", "犖", "犗", "犘", "犙", "犚", "犛", "犜", "犝", "犞", "犠", "犡", "犢", "犣", "犤", "犥", "犦", "犧", "犨", "犩", "犪", "犫", "犮", "犱", "犲", "犳", "犵", "犺", "犻", "犼", "犽", "犾", "犿", "狀", "狅", "狆", "狇", "狉", "狊", "狋", "狌", "狏", "狑", "狓", "狔", "狕", "狖", "狘", "旦", "狛", "" , "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" , "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", " ", "、", "。", "·", "ˉ", "ˇ", "¨", "〃", "々", "—", "~", "∥", "…", "『", "』", "「", "」", "〔", "〕", "〈", "〉", "《", "》", "「", "」", "『", "』", "【", "】", "【", "】", "±", "×", "÷", "︰", "︿", "﹀", "Σ", "Π", "∪", "∩", "∈", "∷", "√", "⊥", "∥", "∠", "⌒", "⊙", "∫", "∮", "≡", "≌", "≒", "∽", "∝", "≠", "≮", "≯", "≦", "≧", "∞", "∵", "∴", "♂", "♀", "°", "′", "〞", "℃", "$", "¤", "¢", "£", "‰", "§", "№", "☆", "★", "○", "●", "◎", "◇", "◆", "□", "■", "△", "▲", "※", "→", "←", "↑", "↓", "〓", "" , "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" , "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "ⅰ", "ⅱ", "ⅲ", "ⅳ", "ⅴ", "ⅵ", "ⅶ", "ⅷ", "ⅸ", "ⅹ", "", "", "", "", "", "", "⒈", "⒉", "⒊", "⒋", "⒌", "⒍", "⒎", "⒏", "⒐", "⒑", "⒒", "⒓", "⒔", "⒕", "⒖", "⒗", "⒘", "⒙", "⒚", "⒛", "⑴", "⑵", "⑶", "⑷", "⑸", "⑹", "⑺", "⑻", "⑼", "⑽", "⑾", "⑿", "⒀", "⒁", "⒂", "⒃", "⒄", "⒅", "⒆", "⒇", "①", "②", "③", "④", "⑤", "⑥", "⑦", "⑧", "⑨", "⑩", "€", "", "㈠", "㈡", "㈢", "㈣", "㈤", "㈥", "㈦", "㈧", "㈨", "㈩", "", "", "Ⅰ", "Ⅱ", "Ⅲ", "Ⅳ", "Ⅴ", "Ⅵ", "Ⅶ", "Ⅷ", "Ⅸ", "Ⅹ", "Ⅺ", "Ⅻ", "", "", "" , "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" , "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", " ", "!", """, "#", "¥", "%", "&", "'", "(", ")", "*", "+", ",", "-", ".", "/", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ":", ";", "<", "=", ">", "?", "@", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "[", "\", "]", "^", "_", "`", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "{", "|", "}", " ̄", "" , "", "", "", "", "", "", "", "", "", "", "", " ", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" , "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "ぁ", "あ", "ぃ", "い", "ぅ", "う", "ぇ", "え", "ぉ", "お", "か", "が", "き", "ぎ", "く", "ぐ", "け", "げ", "こ", "ご", "さ", "ざ", "し", "じ", "す", "ず", "せ", "ぜ", "そ", "ぞ", "た", "だ", "ち", "ぢ", "っ", "つ", "づ", "て", "で", "と", "ど", "な", "に", "ぬ", "ね", "の", "は", "ば", "ぱ", "ひ", "び", "ぴ", "ふ", "ぶ", "ぷ", "へ", "べ", "ぺ", "ほ", "ぼ", "ぽ", "ま", "み", "む", "め", "も", "ゃ", "や", "ゅ", "ゆ", "ょ", "よ", "ら", "り", "る", "れ", "ろ", "ゎ", "わ", "ゐ", "ゑ", "を", "ん", "", "", "", "", "", "", "", "", "", "", "", "" , "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" , "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "ァ", "ア", "ィ", "イ", "ゥ", "ウ", "ェ", "エ", "ォ", "オ", "カ", "ガ", "キ", "ギ", "ク", "グ", "ケ", "ゲ", "コ", "ゴ", "サ", "ザ", "シ", "ジ", "ス", "ズ", "セ", "ゼ", "ソ", "ゾ", "タ", "ダ", "チ", "ヂ", "ッ", "ツ", "ヅ", "テ", "デ", "ト", "ド", "ナ", "ニ", "ヌ", "ネ", "ノ", "ハ", "バ", "パ", "ヒ", "ビ", "ピ", "フ", "ブ", "プ", "ヘ", "ベ", "ペ", "ホ", "ボ", "ポ", "マ", "ミ", "ム", "メ", "モ", "ャ", "ヤ", "ュ", "ユ", "ョ", "ヨ", "ラ", "リ", "ル", "レ", "ロ", "ヮ", "ワ", "ヰ", "ヱ", "ヲ", "ン", "ヴ", "ヵ", "ヶ", "", "", "", "", "", "", "", "", "" , "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" , "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "Α", "Β", "Γ", "Δ", "Ε", "Ζ", "Η", "Θ", "Ι", "Κ", "Λ", "Μ", "Ν", "Ξ", "Ο", "Π", "Ρ", "Σ", "Τ", "Υ", "Φ", "Χ", "Ψ", "Ω", "", "", "", "", "", "", "", "", "α", "β", "γ", "δ", "ε", "ζ", "η", "θ", "ι", "κ", "λ", "μ", "ν", "ξ", "ο", "π", "ρ", "σ", "τ", "υ", "φ", "χ", "ψ", "ω", "", "", "", "", "", "", "", "︵", "︶", "︹", "︺", "︿", "﹀", "︽", "︾", "﹁", "﹂", "﹃", "﹄", "", "", "︻", "︼", "︷", "︸", "|", "", "|", "︴", "", "", "", "", "", "", "", "", "", "" , "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" , "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "А", "Б", "В", "Г", "Д", "Е", "Ё", "Ж", "З", "И", "Й", "К", "Л", "М", "Н", "О", "П", "Р", "С", "Т", "У", "Ф", "Х", "Ц", "Ч", "Ш", "Щ", "Ъ", "Ы", "Ь", "Э", "Ю", "Я", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "а", "б", "в", "г", "д", "е", "ё", "ж", "з", "и", "й", "к", "л", "м", "н", "о", "п", "р", "с", "т", "у", "ф", "х", "ц", "ч", "ш", "щ", "ъ", "ы", "ь", "э", "ю", "я", "", "", "", "", "", "", "", "", "", "", "", "", "", "" , "ˊ", "ˋ", "˙", "–", "─", "¨", "`", "℅", "℉", "↖", "↗", "↘", "↙", "∕", "∟", "∣", "≒", "≦", "≧", "⊿", "═", "║", "╒", "╓", "╔", "╕", "╖", "╗", "╘", "╙", "╚", "╛", "╜", "╝", "╞", "╟", "╠", "╡", "╢", "╣", "╤", "╥", "╦", "╧", "╨", "╩", "╪", "╫", "╬", "╭", "╮", "╯", "╰", "/", "\", "╳", "▁", "▂", "▃", "▄", "▅", "▆", "▇", "" , "█", "▉", "▊", "▋", "▌", "▍", "▎", "▏", "▓", "▔", "▕", "▼", "▽", "◢", "◣", "◤", "◥", "☉", "⊕", "〒", "〝", "〞", "", "", "", "", "", "", "", "", "", "", "", "ā", "á", "ǎ", "à", "ē", "é", "ě", "è", "ī", "í", "ǐ", "ì", "ō", "ó", "ǒ", "ò", "ū", "ú", "ǔ", "ù", "ǖ", "ǘ", "ǚ", "ǜ", "ü", "ê", "ɑ", "", "ń", "ň", "ǹ", "ɡ", "", "", "", "", "ㄅ", "ㄆ", "ㄇ", "ㄈ", "ㄉ", "ㄊ", "ㄋ", "ㄌ", "ㄍ", "ㄎ", "ㄏ", "ㄐ", "ㄑ", "ㄒ", "ㄓ", "ㄔ", "ㄕ", "ㄖ", "ㄗ", "ㄘ", "ㄙ", "ㄚ", "ㄛ", "ㄜ", "ㄝ", "ㄞ", "ㄟ", "ㄠ", "ㄡ", "ㄢ", "ㄣ", "ㄤ", "ㄥ", "ㄦ", "ㄧ", "ㄨ", "ㄩ", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" , "〡", "〢", "〣", "〤", "〥", "〦", "〧", "〨", "〩", "㊣", "㎎", "㎏", "㎜", "㎝", "㎞", "㎡", "㏄", "㏎", "㏑", "㏒", "㏕", "︰", "¬", "¦", "", "℡", "㈱", "", "‐", "", "", "", "ー", "゛", "゜", "ヽ", "ヾ", "〆", "ゝ", "ゞ", "﹉", "﹊", "﹋", "﹌", "﹍", "﹎", "﹏", ",", "、", ".", ";", ":", "?", "!", "(", ")", "{", "}", "[", "]", "#", "&", "*", "" , "+", "-", "<", ">", "=", "﹨", "$", "%", "@", "〾", "⿰", "⿱", "⿲", "⿳", "⿴", "⿵", "⿶", "⿷", "⿸", "⿹", "⿺", "⿻", "〇", "", "", "", "", "", "", "", "", "", "", "", "", "", "─", "─", "│", "│", "┄", "┅", "┆", "┇", "┈", "┉", "┊", "┋", "┌", "┍", "┎", "┌", "┐", "┑", "┒", "┐", "└", "┕", "┖", "└", "┘", "┙", "┚", "┘", "├", "┝", "┞", "┟", "┠", "┡", "┢", "├", "┤", "┥", "┦", "┧", "┨", "┩", "┪", "┤", "┬", "┭", "┮", "┯", "┰", "┱", "┲", "┬", "┴", "┵", "┶", "┷", "┸", "┹", "┺", "┴", "┼", "┽", "┾", "┿", "╀", "╁", "╂", "╃", "╄", "╅", "╆", "╇", "╈", "╉", "╊", "┼", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" , "狜", "獮", "狟", "狢", "狣", "狤", "狥", "狦", "狧", "狪", "狫", "狵", "狶", "狹", "狽", "狾", "狿", "猀", "猂", "猄", "猅", "猆", "猇", "猈", "猉", "猋", "猌", "猍", "猏", "猐", "猑", "猒", "猔", "猘", "猙", "猚", "猟", "猠", "猣", "猤", "猦", "猧", "猨", "猭", "猯", "猰", "猲", "猳", "猵", "猶", "猺", "猻", "猼", "猽", "獀", "獁", "獂", "呆", "獄", "獅", "獆", "獇", "獈", "" , "獉", "獊", "獋", "獌", "獎", "獏", "獑", "獓", "獔", "獕", "獖", "獘", "獙", "獚", "獛", "獜", "獝", "獞", "獟", "獡", "獢", "獣", "獤", "獥", "獦", "獧", "獨", "獩", "獪", "獫", "獮", "獰", "獱", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" , "獲", "獳", "獴", "獵", "獶", "獷", "獸", "獹", "獺", "獻", "獼", "獽", "獿", "玀", "玁", "玂", "玃", "妙", "茲", "玈", "玊", "玌", "玍", "玏", "玐", "玒", "玓", "玔", "玕", "玗", "玘", "玙", "玚", "玜", "玝", "玞", "玠", "玡", "玣", "玤", "玥", "玦", "玧", "玨", "玪", "玬", "玭", "瑲", "玴", "玵", "玶", "玸", "玹", "玼", "玽", "玾", "玿", "珁", "珃", "珄", "珅", "珆", "珇", "" , "珋", "珌", "珎", "珒", "珓", "珔", "珕", "珖", "珗", "珘", "珚", "珛", "珜", "珝", "珟", "珡", "珢", "珣", "珤", "珦", "珨", "圭", "珫", "珬", "佩", "珯", "珰", "珱", "珳", "珴", "珵", "珶", "珷", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" , "珸", "珹", "珺", "珻", "珼", "珽", "現", "珿", "琀", "琁", "琂", "琄", "琇", "琈", "琋", "琌", "琍", "璡", "琑", "琒", "琓", "琔", "琕", "琖", "琗", "琘", "琙", "琜", "琝", "琞", "琟", "琠", "琡", "琣", "琤", "琧", "琩", "琫", "琭", "管", "雕", "琲", "琷", "琸", "琹", "琺", "琻", "琽", "琾", "琿", "瑀", "瑂", "瑃", "瑄", "瑅", "瑆", "瑇", "瑈", "瑉", "瑊", "瑋", "瑌", "瑍", "" , "瑎", "瑏", "瑐", "瑑", "瑒", "瑓", "瑔", "瑖", "瑘", "瑝", "瑠", "瑡", "瑢", "瑣", "瑤", "瑥", "瑦", "瑧", "瑨", "瑩", "瑪", "瑫", "瑬", "瑮", "琅", "瑱", "瑲", "瑳", "瑴", "瑵", "瑸", "瑹", "瑺", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" , "瑻", "瑼", "瑽", "瑿", "璂", "璄", "璅", "璆", "璈", "璉", "璊", "璌", "璍", "璏", "璑", "璒", "璓", "璔", "璕", "璖", "璗", "璘", "璙", "璚", "璛", "璝", "璟", "璠", "璡", "璢", "璣", "璤", "璥", "璦", "璪", "璫", "璬", "璭", "璮", "璯", "環", "璱", "璲", "璳", "璴", "璵", "璶", "璷", "璸", "璹", "璻", "璼", "璽", "璾", "璇", "瓀", "瓁", "瓂", "瓃", "瓄", "瓅", "瓆", "瓇", "" , "瓈", "瓉", "瓊", "瓋", "瓌", "瓍", "瓎", "瓏", "瓐", "瓑", "瓓", "瓔", "瓕", "鑲", "瓗", "瓘", "瓙", "瓚", "瓛", "瓝", "瓟", "瓡", "瓥", "瓧", "瓨", "瓩", "瓪", "瓫", "瓬", "瓭", "瓰", "瓱", "瓲", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" , "瓳", "瓵", "瓸", "瓹", "瓺", "瓻", "瓼", "瓽", "瓾", "甀", "甁", "甂", "甃", "甅", "甆", "甇", "甈", "甉", "甊", "甋", "甌", "甎", "甐", "甒", "甔", "甕", "甖", "甗", "甛", "甝", "甞", "甠", "甡", "產", "產", "甤", "蘇", "甧", "角", "甮", "甴", "甶", "甹", "甼", "甽", "甿", "畁", "畂", "畃", "畄", "畆", "畇", "畉", "畊", "畍", "畐", "畑", "畒", "畓", "畕", "畖", "畗", "畘", "" , "畝", "畞", "畟", "畠", "畡", "畢", "畣", "畤", "畧", "畨", "畩", "畫", "畬", "畭", "畮", "畯", "異", "畱", "畳", "畵", "當", "畷", "畺", "畻", "畼", "畽", "畾", "疀", "疁", "疂", "疄", "疅", "疇", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" , "疈", "疉", "疊", "疌", "疍", "疎", "疐", "疓", "疕", "疘", "疛", "疜", "疞", "疢", "疦", "疧", "疨", "疩", "疪", "疭", "疶", "疷", "疺", "疻", "痱", "痀", "痁", "痆", "痋", "痌", "痎", "痏", "痐", "痑", "痓", "痗", "痙", "痚", "痜", "痝", "痟", "酸", "痡", "痥", "痩", "痬", "痭", "痮", "痯", "麻", "麻", "痵", "痶", "痷", "痸", "痺", "痻", "痽", "痾", "瘂", "瘄", "瘆", "瘇", "" , "瘈", "愈", "瘋", "瘍", "瘎", "瘏", "瘑", "瘒", "瘓", "瘔", "瘖", "瘚", "瘜", "瘝", "瘞", "瘡", "瘣", "瘧", "瘨", "瘬", "瘮", "瘯", "瘱", "瘲", "瘶", "瘷", "瘹", "瘻", "瘻", "瘽", "癁", "療", "癄", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" , "癅", "癆", "癇", "癈", "癉", "癊", "癋", "癎", "癏", "癐", "癑", "愈", "癓", "癕", "癗", "癘", "癙", "癚", "癛", "癝", "癟", "癠", "痴", "癢", "癤", "症", "癦", "癧", "癨", "癩", "癪", "癬", "癭", "癮", "癰", "癱", "癲", "癳", "癴", "癵", "癶", "癷", "癹", "発", "發", "癿", "皀", "皂", "皃", "皅", "皉", "皊", "皌", "皍", "皏", "皐", "皒", "皔", "皕", "皗", "皘", "皚", "皛", "" , "皜", "皝", "皞", "皟", "皠", "皡", "皢", "皣", "皥", "皦", "皧", "皨", "皩", "皪", "皫", "皬", "皭", "皯", "皰", "皳", "皵", "皶", "皷", "皸", "皹", "皺", "皻", "皼", "皽", "皾", "盀", "盁", "杯", "啊", "阿", "埃", "挨", "哎", "唉", "哀", "皚", "癌", "藹", "矮", "艾", "礙", "愛", "隘", "鞍", "氨", "安", "俺", "按", "暗", "岸", "胺", "案", "骯", "昂", "盎", "凹", "敖", "熬", "翱", "襖", "傲", "奧", "懊", "澳", "芭", "捌", "扒", "叭", "吧", "笆", "八", "疤", "巴", "拔", "跋", "靶", "把", "耙", "壩", "霸", "罷", "爸", "白", "柏", "百", "擺", "佰", "敗", "拜", "稗", "斑", "班", "搬", "扳", "般", "頒", "板", "版", "扮", "拌", "伴", "瓣", "半", "辦", "絆", "邦", "幫", "梆", "榜", "膀", "綁", "棒", "磅", "蚌", "鎊", "傍", "謗", "苞", "胞", "包", "褒", "剝", "" , "盄", "盇", "盉", "盋", "盌", "盓", "盕", "盙", "盚", "盜", "盝", "盞", "盠", "盡", "盢", "監", "盤", "盦", "盧", "盨", "盩", "蕩", "盫", "盬", "盭", "盰", "盳", "盵", "盶", "盷", "盺", "盻", "盽", "盿", "眀", "眂", "眃", "眅", "眆", "眊", "県", "視", "眏", "眐", "眑", "眒", "眓", "眔", "眕", "眖", "眗", "眘", "眛", "眜", "眝", "眞", "眡", "眣", "眤", "眥", "眧", "眪", "眫", "" , "矓", "眮", "眰", "眱", "眲", "眳", "眴", "眹", "眻", "眽", "眾", "眿", "睂", "睄", "睅", "睆", "睈", "睉", "睊", "睋", "睌", "睍", "睎", "困", "睒", "睓", "睔", "睕", "睖", "睗", "睘", "睙", "睜", "薄", "雹", "保", "堡", "飽", "寶", "抱", "報", "暴", "豹", "鮑", "爆", "杯", "碑", "悲", "卑", "北", "輩", "背", "貝", "鋇", "倍", "狽", "備", "憊", "焙", "被", "奔", "苯", "本", "笨", "崩", "繃", "甭", "泵", "蹦", "迸", "逼", "鼻", "比", "鄙", "筆", "彼", "碧", "蓖", "蔽", "畢", "斃", "毖", "幣", "庇", "痺", "閉", "敝", "弊", "必", "辟", "壁", "臂", "避", "陛", "鞭", "邊", "編", "貶", "扁", "便", "變", "卞", "辨", "辯", "辮", "遍", "標", "彪", "膘", "表", "鱉", "憋", "別", "癟", "彬", "斌", "瀕", "濱", "賓", "擯", "兵", "冰", "柄", "丙", "秉", "餅", "炳", "" , "睝", "睞", "睟", "睠", "睤", "睧", "睩", "睾", "睭", "睮", "睯", "睰", "睱", "睲", "睳", "睴", "睵", "睶", "睷", "睸", "睺", "睻", "睼", "瞁", "瞂", "瞃", "瞆", "眯", "瞈", "瞉", "瞊", "瞋", "瞏", "瞐", "瞓", "瞔", "瞕", "瞖", "瞗", "瞘", "瞙", "瞚", "瞛", "瞜", "瞝", "瞞", "瞡", "瞣", "瞤", "瞦", "瞨", "瞫", "瞭", "瞮", "瞯", "瞱", "瞲", "瞴", "瞶", "瞷", "瞸", "瞹", "瞺", "" , "瞼", "瞾", "矀", "矁", "矂", "矃", "矄", "矅", "矆", "蒙", "矈", "矉", "矊", "矋", "矌", "矎", "矏", "矐", "矑", "矒", "矓", "矔", "矕", "矖", "矘", "矙", "矚", "矝", "矞", "矟", "矠", "矡", "矤", "病", "並", "玻", "菠", "播", "撥", "缽", "波", "博", "勃", "搏", "鉑", "箔", "伯", "帛", "舶", "脖", "膊", "渤", "泊", "駁", "捕", "卜", "哺", "補", "埠", "不", "布", "步", "簿", "部", "怖", "擦", "猜", "裁", "材", "才", "財", "睬", "踩", "采", "彩", "菜", "蔡", "餐", "參", "蠶", "殘", "慚", "慘", "燦", "蒼", "艙", "倉", "滄", "藏", "操", "糙", "槽", "曹", "草", "廁", "策", "側", "冊", "測", "層", "蹭", "插", "叉", "茬", "茶", "查", "碴", "搽", "察", "岔", "差", "詫", "拆", "柴", "豺", "攙", "摻", "蟬", "饞", "讒", "纏", "鏟", "產", "闡", "顫", "昌", "猖", "" , "矦", "矨", "矪", "矯", "矰", "矱", "矲", "矴", "矵", "矷", "矹", "矺", "矻", "矼", "砃", "砄", "砅", "砆", "砇", "砈", "砊", "砋", "砎", "砏", "砐", "砓", "砕", "砙", "砛", "砞", "砠", "砡", "砢", "砤", "砨", "砪", "砫", "砮", "砯", "砱", "炮", "砳", "砵", "砶", "砽", "砿", "硁", "硂", "朱", "硄", "硆", "硈", "硉", "硊", "硋", "硍", "硏", "硑", "硓", "硔", "硘", "磑", "礄", "" , "硛", "硜", "硞", "硟", "硠", "硡", "硢", "硣", "硤", "硥", "硦", "硧", "硨", "硩", "硯", "硰", "硱", "硲", "硳", "硴", "硵", "硶", "硸", "硹", "硺", "硻", "硽", "硾", "硿", "碀", "碁", "碂", "碃", "場", "嘗", "常", "長", "償", "腸", "廠", "敞", "暢", "唱", "倡", "超", "抄", "鈔", "朝", "嘲", "潮", "巢", "吵", "炒", "車", "扯", "撤", "掣", "徹", "澈", "郴", "臣", "辰", "塵", "晨", "忱", "沉", "陳", "趁", "襯", "撐", "稱", "城", "橙", "成", "呈", "乘", "程", "懲", "澄", "誠", "承", "逞", "騁", "秤", "吃", "痴", "持", "匙", "池", "遲", "弛", "馳", "恥", "齒", "侈", "尺", "赤", "翅", "斥", "熾", "充", "沖", "蟲", "崇", "寵", "抽", "酬", "疇", "躊", "稠", "愁", "籌", "仇", "綢", "瞅", "丑", "臭", "初", "出", "櫥", "廚", "躇", "鋤", "雛", "滁", "除", "楚", "" , "碄", "碅", "碆", "碈", "碊", "碋", "碏", "碐", "碒", "碔", "崎", "碖", "碙", "碝", "碞", "碠", "碢", "碤", "碦", "碨", "碩", "砧", "碫", "碬", "碭", "碮", "碯", "碵", "碶", "碷", "碸", "確", "碻", "碼", "碽", "碿", "磀", "磂", "磃", "磄", "磆", "磇", "磈", "磌", "磍", "磎", "磏", "磑", "磒", "磓", "磖", "磗", "磘", "磚", "磛", "磜", "磝", "磞", "磟", "磠", "磡", "磢", "磣", "" , "磤", "磥", "磦", "磧", "磩", "磪", "磫", "磭", "磮", "磯", "磰", "磱", "磳", "磵", "磶", "磸", "磹", "磻", "磼", "磽", "磾", "磿", "礀", "礂", "礃", "礄", "礆", "礇", "礈", "礉", "礊", "礋", "礌", "礎", "儲", "矗", "搐", "觸", "處", "揣", "川", "穿", "椽", "傳", "船", "喘", "串", "瘡", "窗", "幢", "床", "闖", "創", "吹", "炊", "捶", "錘", "垂", "春", "椿", "醇", "唇", "淳", "純", "蠢", "戳", "綽", "疵", "茨", "磁", "雌", "辭", "慈", "瓷", "詞", "此", "刺", "賜", "次", "聰", "蔥", "囪", "匆", "從", "叢", "湊", "粗", "醋", "簇", "促", "躥", "篡", "竄", "摧", "崔", "催", "脆", "瘁", "粹", "淬", "翠", "村", "存", "寸", "磋", "撮", "搓", "措", "挫", "錯", "搭", "達", "答", "瘩", "打", "大", "呆", "歹", "傣", "戴", "帶", "殆", "代", "貸", "袋", "待", "逮", "" , "礍", "礎", "礏", "礐", "礑", "礒", "礔", "礕", "礖", "礗", "礘", "礙", "礚", "礛", "礜", "礝", "礟", "礠", "礴", "礢", "礣", "礥", "礦", "礧", "礨", "礩", "礪", "礫", "礬", "礭", "礮", "礯", "礰", "礱", "礲", "礳", "礵", "礶", "礷", "礸", "礹", "礽", "礿", "他", "祃", "祄", "祆", "只", "祊", "祋", "祌", "祍", "禕", "祏", "佑", "祑", "祒", "祔", "祕", "祘", "祙", "祡", "祣", "" , "祤", "祦", "祩", "祪", "祫", "祬", "祮", "祰", "祱", "祲", "祳", "祴", "祵", "祶", "祹", "祻", "裸", "祽", "祾", "祿", "禂", "禃", "禆", "禇", "禈", "禉", "禋", "禌", "禍", "禎", "禐", "禑", "禒", "怠", "耽", "擔", "丹", "單", "鄲", "撣", "膽", "旦", "氮", "但", "憚", "淡", "誕", "彈", "蛋", "當", "擋", "黨", "蕩", "檔", "刀", "搗", "蹈", "倒", "島", "禱", "導", "到", "稻", "悼", "道", "盜", "德", "得", "的", "蹬", "燈", "登", "等", "瞪", "凳", "鄧", "堤", "低", "滴", "迪", "敵", "笛", "狄", "滌", "翟", "嫡", "抵", "底", "地", "蒂", "第", "帝", "弟", "遞", "締", "顛", "掂", "滇", "碘", "點", "典", "靛", "墊", "電", "佃", "甸", "店", "惦", "奠", "淀", "殿", "碉", "叼", "雕", "凋", "刁", "掉", "吊", "釣", "調", "跌", "爹", "碟", "蝶", "迭", "諜", "疊", "" , "禓", "禔", "禕", "禖", "禗", "禘", "禙", "禛", "禜", "禝", "禞", "禟", "禠", "禡", "禢", "禣", "禤", "禥", "御", "禨", "禩", "禪", "禫", "禬", "禭", "禮", "禯", "祢", "禱", "禲", "禴", "禵", "禶", "禷", "禸", "禼", "禿", "秂", "秄", "秅", "秇", "秈", "秊", "秌", "秎", "耗", "秐", "秓", "秔", "秖", "秗", "秙", "秚", "秛", "秜", "秝", "秞", "秠", "秡", "秢", "秥", "秨", "秪", "" , "秬", "秮", "秱", "秲", "秳", "秴", "秵", "秶", "秷", "秹", "秺", "秼", "秾", "秿", "稁", "稄", "稅", "稇", "稈", "稉", "稊", "稌", "稏", "稐", "稑", "稒", "稓", "稕", "稖", "稘", "稙", "稛", "棱", "丁", "盯", "叮", "釘", "頂", "鼎", "錠", "定", "訂", "丟", "東", "冬", "董", "懂", "動", "棟", "侗", "恫", "凍", "洞", "兜", "抖", "斗", "陡", "豆", "逗", "痘", "都", "督", "毒", "犢", "獨", "讀", "堵", "睹", "賭", "杜", "鍍", "肚", "度", "渡", "妒", "端", "短", "鍛", "段", "斷", "緞", "堆", "兌", "隊", "對", "墩", "噸", "蹲", "敦", "頓", "囤", "鈍", "盾", "遁", "掇", "哆", "多", "奪", "垛", "躲", "朵", "跺", "舵", "剁", "惰", "墮", "蛾", "峨", "鵝", "俄", "額", "訛", "娥", "惡", "厄", "扼", "遏", "鄂", "餓", "恩", "而", "兒", "耳", "爾", "餌", "洱", "二", "" , "稝", "稟", "稡", "稢", "稤", "稥", "稦", "稧", "扁", "稩", "稪", "稫", "稬", "秸", "種", "稯", "稰", "稱", "稲", "稴", "稵", "稶", "稸", "稺", "稾", "谷", "穁", "穂", "穃", "穄", "穅", "穇", "穈", "穉", "穊", "穋", "穌", "積", "穎", "穏", "穐", "穒", "穓", "穔", "穕", "穖", "穘", "穙", "穚", "穛", "穜", "穝", "穞", "穟", "穠", "穡", "穢", "穣", "穤", "穥", "穦", "穧", "頹", "" , "穩", "穪", "獲", "穬", "穭", "穮", "穯", "穱", "穲", "穳", "穵", "穻", "穼", "穽", "穾", "窂", "窅", "窇", "窉", "窊", "窋", "窌", "窵", "窏", "窐", "窓", "窔", "窙", "窚", "窛", "窞", "窡", "窢", "貳", "發", "罰", "筏", "伐", "乏", "閥", "法", "琺", "藩", "帆", "番", "翻", "樊", "礬", "釩", "繁", "凡", "煩", "反", "返", "范", "販", "犯", "飯", "泛", "坊", "芳", "方", "肪", "房", "防", "妨", "仿", "訪", "紡", "放", "菲", "非", "啡", "飛", "肥", "匪", "誹", "吠", "肺", "廢", "沸", "費", "芬", "酚", "吩", "氛", "分", "紛", "墳", "焚", "汾", "粉", "奮", "份", "忿", "憤", "糞", "豐", "封", "楓", "蜂", "峰", "鋒", "風", "瘋", "烽", "逢", "馮", "縫", "諷", "奉", "鳳", "佛", "否", "夫", "敷", "膚", "孵", "扶", "拂", "輻", "幅", "氟", "符", "伏", "俘", "服", "" , "窣", "窤", "窧", "窩", "窪", "窫", "窮", "窯", "窰", "窱", "窲", "窴", "窵", "窶", "窷", "窸", "窹", "窺", "窻", "窼", "窽", "窾", "竀", "竁", "竂", "竃", "竄", "竅", "竆", "竇", "竈", "竉", "竊", "竌", "竍", "竎", "竏", "竐", "竑", "竒", "竓", "竔", "竕", "竗", "竘", "竚", "竛", "竜", "竝", "竡", "竢", "竤", "竧", "竨", "竩", "竪", "竫", "竬", "竮", "竰", "竱", "竲", "竳", "" , "竴", "竵", "競", "竷", "竸", "竻", "竼", "竾", "笀", "笁", "笂", "笅", "笇", "笉", "笌", "笍", "笎", "笐", "笒", "笓", "笖", "笗", "笘", "笚", "笜", "笝", "笟", "笡", "笢", "笣", "笧", "笩", "笭", "浮", "涪", "福", "袱", "弗", "甫", "撫", "輔", "俯", "釜", "斧", "脯", "腑", "府", "腐", "赴", "副", "覆", "賦", "復", "傅", "付", "阜", "父", "腹", "負", "富", "訃", "附", "婦", "縛", "咐", "噶", "嘎", "該", "改", "概", "鈣", "蓋", "溉", "干", "甘", "桿", "柑", "竿", "肝", "趕", "感", "稈", "敢", "贛", "岡", "剛", "鋼", "缸", "肛", "綱", "崗", "港", "槓", "篙", "皋", "高", "膏", "羔", "糕", "搞", "鎬", "稿", "告", "哥", "歌", "擱", "戈", "鴿", "胳", "疙", "割", "革", "葛", "格", "蛤", "閣", "隔", "鉻", "個", "各", "給", "根", "跟", "耕", "更", "庚", "羹", "" , "笯", "笰", "笲", "笴", "笵", "笶", "笷", "笹", "筇", "笽", "笿", "筀", "筁", "筂", "筃", "筄", "筆", "筈", "筊", "筍", "筎", "筓", "筕", "筗", "筙", "筜", "筞", "筟", "筡", "筣", "筤", "筥", "筦", "筧", "筨", "筩", "筪", "筫", "筬", "筭", "筯", "筰", "筳", "策", "筶", "筸", "筺", "筼", "筽", "筿", "箁", "箂", "箃", "箅", "箆", "個", "箈", "箉", "箊", "箋", "箌", "箎", "箏", "" , "箑", "箒", "籙", "箖", "箘", "箙", "箚", "箛", "箞", "箟", "棰", "箣", "箤", "箥", "箮", "箯", "箰", "箲", "箳", "箵", "箶", "箷", "箹", "箺", "箻", "箼", "箽", "箾", "箿", "節", "篂", "篃", "范", "埂", "耿", "梗", "工", "攻", "功", "恭", "龔", "供", "躬", "公", "宮", "弓", "鞏", "汞", "拱", "貢", "共", "鉤", "勾", "溝", "苟", "狗", "垢", "構", "購", "夠", "辜", "菇", "咕", "箍", "估", "沽", "孤", "姑", "鼓", "古", "蠱", "骨", "谷", "股", "故", "顧", "固", "雇", "刮", "瓜", "剮", "寡", "掛", "褂", "乖", "拐", "怪", "棺", "關", "官", "冠", "觀", "管", "館", "罐", "慣", "灌", "貫", "光", "廣", "逛", "瑰", "規", "圭", "硅", "歸", "龜", "閨", "軌", "鬼", "詭", "癸", "桂", "櫃", "跪", "貴", "劊", "輥", "滾", "棍", "鍋", "郭", "國", "果", "裹", "過", "哈", "" , "篅", "篈", "築", "篊", "篋", "篍", "篎", "篏", "篐", "篒", "篔", "篕", "篖", "篗", "篘", "箬", "篜", "篞", "篟", "筱", "篢", "篣", "篤", "篧", "篨", "篩", "篫", "篬", "篭", "篯", "篰", "彗", "篳", "篴", "篵", "篶", "篸", "篹", "篺", "篻", "篽", "篿", "簀", "簁", "簂", "簃", "簄", "簅", "簆", "簈", "簉", "簊", "簍", "簎", "簐", "蓑", "簒", "簓", "簔", "簕", "簗", "簘", "簙", "" , "簚", "簛", "簜", "簝", "簞", "簠", "簡", "簢", "簣", "簤", "簥", "簨", "簩", "簫", "簬", "簭", "簮", "簯", "簰", "簱", "簲", "簳", "簴", "簵", "簶", "簷", "簹", "簺", "簻", "簼", "簽", "簾", "籂", "骸", "孩", "海", "氦", "亥", "害", "駭", "酣", "憨", "邯", "韓", "含", "涵", "寒", "函", "喊", "罕", "翰", "撼", "捍", "旱", "憾", "悍", "焊", "汗", "漢", "夯", "杭", "航", "壕", "嚎", "豪", "毫", "郝", "好", "耗", "號", "浩", "呵", "喝", "荷", "菏", "核", "禾", "和", "何", "合", "盒", "貉", "閡", "河", "涸", "赫", "褐", "鶴", "賀", "嘿", "黑", "痕", "很", "狠", "恨", "哼", "亨", "橫", "衡", "恆", "轟", "哄", "烘", "虹", "鴻", "洪", "宏", "弘", "紅", "喉", "侯", "猴", "吼", "厚", "候", "後", "呼", "乎", "忽", "瑚", "壺", "葫", "胡", "蝴", "狐", "糊", "湖", "" , "籃", "籄", "籅", "籆", "籇", "籈", "籉", "籊", "籋", "籌", "籎", "籏", "藤", "籑", "籒", "籓", "籔", "籕", "籖", "籗", "籘", "籙", "籚", "籛", "籜", "籝", "籞", "籟", "籠", "籡", "籢", "籣", "簽", "龠", "籦", "籧", "籨", "籩", "籪", "籫", "籬", "籭", "籮", "籯", "籰", "籱", "籲", "籵", "籶", "籷", "籸", "籹", "籺", "籾", "籿", "粀", "粁", "粂", "粃", "粄", "粅", "粆", "粇", "" , "粈", "粊", "粋", "粌", "粍", "粎", "粏", "粐", "粓", "粔", "粖", "粙", "粚", "粛", "粠", "粡", "粣", "粦", "妝", "粨", "粩", "粫", "粬", "粭", "粯", "粰", "粴", "粵", "粶", "粷", "粸", "粺", "粻", "弧", "虎", "唬", "護", "互", "滬", "戶", "花", "嘩", "華", "猾", "滑", "畫", "劃", "化", "話", "槐", "徊", "懷", "淮", "壞", "歡", "環", "桓", "還", "緩", "換", "患", "喚", "瘓", "豢", "煥", "渙", "宦", "幻", "荒", "慌", "黃", "磺", "蝗", "簧", "皇", "凰", "惶", "煌", "晃", "幌", "恍", "謊", "灰", "揮", "輝", "徽", "恢", "蛔", "回", "毀", "悔", "慧", "卉", "惠", "晦", "賄", "穢", "會", "燴", "匯", "諱", "誨", "繪", "葷", "昏", "婚", "魂", "渾", "混", "豁", "活", "伙", "火", "獲", "或", "惑", "霍", "貨", "禍", "擊", "圾", "基", "機", "畸", "稽", "積", "箕", "" , "粿", "糀", "糂", "糃", "糄", "糆", "糉", "糋", "糎", "糏", "糐", "糑", "糒", "糓", "糔", "糘", "糚", "糛", "糝", "糞", "糡", "糢", "糣", "糤", "糥", "糦", "糧", "糩", "糪", "糫", "糬", "糭", "糮", "團", "糱", "糲", "糳", "糴", "糵", "糶", "糷", "糹", "糺", "糼", "糽", "糾", "糿", "紀", "紁", "紂", "紃", "約", "紅", "紆", "紇", "紈", "紉", "紋", "紌", "納", "紎", "紏", "紐", "" , "紑", "紒", "紓", "純", "紕", "紖", "紗", "紘", "紙", "級", "紛", "紜", "紝", "紞", "紟", "紡", "紣", "紤", "扎", "紦", "紨", "紩", "紪", "紬", "紭", "扎", "細", "紱", "紲", "紳", "紴", "紵", "紶", "肌", "飢", "跡", "激", "譏", "雞", "姬", "績", "緝", "吉", "極", "棘", "輯", "籍", "集", "及", "急", "疾", "汲", "即", "嫉", "級", "擠", "幾", "脊", "己", "薊", "技", "冀", "季", "伎", "祭", "劑", "悸", "濟", "寄", "寂", "計", "記", "既", "忌", "際", "妓", "繼", "紀", "嘉", "枷", "夾", "佳", "家", "加", "莢", "頰", "賈", "甲", "鉀", "假", "稼", "價", "架", "駕", "嫁", "殲", "監", "堅", "尖", "箋", "間", "煎", "兼", "肩", "艱", "奸", "緘", "繭", "檢", "柬", "鹼", "鹼", "揀", "撿", "簡", "儉", "剪", "減", "薦", "檻", "鑑", "踐", "賤", "見", "鍵", "箭", "件", "" , "紷", "紸", "紹", "紺", "紻", "紼", "紽", "紾", "紿", "絀", "絁", "終", "弦", "組", "絅", "絆", "絇", "絈", "絉", "絊", "絋", "経", "絍", "絎", "絏", "結", "絑", "絒", "絓", "絔", "絕", "絖", "絗", "絘", "絙", "絚", "絛", "絜", "絝", "絞", "絟", "絠", "絡", "絢", "絣", "絤", "絥", "給", "絧", "絨", "絩", "絪", "絫", "絬", "絭", "絯", "絰", "統", "絲", "絳", "絴", "絵", "絶", "" , "絸", "絹", "絺", "絻", "絼", "絽", "絾", "絿", "綀", "綁", "綂", "綃", "綄", "綅", "綆", "綇", "綈", "綉", "綊", "綋", "綌", "綍", "綎", "綏", "綐", "捆", "綒", "經", "綔", "綕", "綖", "綗", "綘", "健", "艦", "劍", "餞", "漸", "濺", "澗", "建", "僵", "姜", "將", "漿", "江", "疆", "蔣", "槳", "獎", "講", "匠", "醬", "降", "蕉", "椒", "礁", "焦", "膠", "交", "郊", "澆", "驕", "嬌", "嚼", "攪", "鉸", "矯", "僥", "腳", "狡", "角", "餃", "繳", "絞", "剿", "教", "酵", "轎", "較", "叫", "窖", "揭", "接", "皆", "秸", "街", "階", "截", "劫", "節", "橘", "傑", "捷", "睫", "竭", "潔", "結", "解", "姐", "戒", "藉", "芥", "界", "借", "介", "疥", "誡", "屆", "巾", "筋", "斤", "金", "今", "津", "襟", "緊", "錦", "僅", "謹", "進", "靳", "晉", "禁", "近", "燼", "浸", "" , "継", "続", "綛", "綜", "綝", "綞", "綟", "綠", "綡", "綢", "綣", "綤", "綥", "綧", "綨", "綩", "綪", "線", "綬", "維", "綯", "綰", "綱", "網", "綳", "綴", "彩", "綶", "綷", "綸", "綹", "綺", "綻", "綼", "綽", "綾", "綿", "緀", "緁", "緂", "緃", "緄", "緅", "緆", "緇", "緈", "緉", "緊", "緋", "緌", "緍", "緎", "総", "緐", "緑", "緒", "緓", "緔", "緕", "緖", "緗", "緘", "緙", "" , "線", "緛", "緜", "緝", "緞", "緟", "締", "緡", "緢", "緣", "緤", "緥", "緦", "緧", "編", "緩", "緪", "緫", "緬", "緭", "緮", "緯", "緰", "緱", "緲", "緳", "練", "緵", "緶", "緷", "緸", "緹", "緺", "盡", "勁", "荊", "兢", "莖", "睛", "晶", "鯨", "京", "驚", "精", "粳", "經", "井", "警", "景", "頸", "靜", "境", "敬", "鏡", "徑", "痙", "靖", "竟", "競", "淨", "炯", "窘", "揪", "究", "糾", "玖", "韭", "久", "灸", "九", "酒", "廄", "救", "舊", "臼", "舅", "咎", "就", "疚", "鞠", "拘", "狙", "疽", "居", "駒", "菊", "局", "咀", "矩", "舉", "沮", "聚", "拒", "據", "巨", "具", "距", "踞", "鋸", "俱", "句", "懼", "炬", "劇", "捐", "鵑", "娟", "倦", "眷", "卷", "絹", "撅", "攫", "抉", "掘", "倔", "爵", "覺", "決", "訣", "絕", "均", "菌", "鈞", "軍", "君", "峻", "" , "致", "緼", "緽", "緾", "緿", "縀", "縁", "縂", "縃", "縄", "縅", "縆", "縇", "縈", "縉", "縊", "縋", "縌", "縍", "縎", "縏", "縐", "縑", "縒", "縓", "縔", "縕", "縖", "縗", "縘", "縙", "絛", "縛", "縜", "縝", "縞", "縟", "縠", "縡", "縢", "縣", "縤", "縥", "縦", "縧", "縨", "縩", "縪", "縫", "縬", "縭", "縮", "演", "縰", "縱", "縲", "縛", "纖", "縵", "縶", "縷", "縸", "縹", "" , "縺", "縼", "總", "績", "縿", "繀", "繂", "繃", "繄", "繅", "繆", "襁", "繉", "繊", "繋", "繌", "繍", "繎", "繏", "繐", "繑", "繒", "繓", "織", "繕", "繖", "繗", "繘", "翻", "繚", "繛", "繜", "繝", "俊", "竣", "浚", "郡", "駿", "喀", "咖", "卡", "咯", "開", "揩", "楷", "凱", "慨", "刊", "堪", "勘", "坎", "砍", "看", "康", "慷", "糠", "扛", "抗", "亢", "炕", "考", "拷", "烤", "靠", "坷", "苛", "柯", "棵", "磕", "顆", "科", "殼", "咳", "可", "渴", "克", "刻", "客", "課", "肯", "啃", "墾", "懇", "坑", "吭", "空", "恐", "孔", "控", "摳", "口", "扣", "寇", "枯", "哭", "窟", "苦", "酷", "庫", "褲", "誇", "垮", "挎", "跨", "胯", "塊", "筷", "儈", "快", "寬", "款", "匡", "筐", "狂", "框", "礦", "眶", "曠", "況", "虧", "盔", "巋", "窺", "葵", "奎", "魁", "傀", "" , "繞", "繟", "繠", "繡", "繢", "繣", "繤", "繥", "繦", "繧", "繨", "繩", "繪", "系", "繬", "繭", "繮", "繯", "繰", "繱", "繲", "繳", "繴", "繵", "繶", "繷", "繸", "繹", "繺", "繻", "繼", "繽", "繾", "繿", "纀", "纁", "纃", "纄", "纅", "纆", "纇", "纈", "纉", "纊", "纋", "續", "累", "纎", "纏", "纐", "纑", "纒", "纓", "才", "纕", "纖", "纗", "纘", "纙", "纚", "纜", "纝", "纞", "" , "紘", "紝", "纻", "紖", "絰", "绤", "绬", "绹", "縕", "缐", "縗", "缷", "缹", "缻", "缼", "缽", "瓶", "缿", "罀", "罁", "罃", "罆", "罇", "壇", "罉", "罊", "罋", "罌", "罍", "壇", "罏", "罒", "罓", "饋", "愧", "潰", "坤", "昆", "捆", "困", "括", "擴", "廓", "闊", "垃", "拉", "喇", "蠟", "臘", "辣", "啦", "萊", "來", "賴", "藍", "婪", "欄", "攔", "籃", "闌", "蘭", "瀾", "讕", "攬", "覽", "懶", "纜", "爛", "濫", "琅", "榔", "狼", "廊", "郎", "朗", "浪", "撈", "勞", "牢", "老", "佬", "姥", "酪", "烙", "澇", "勒", "樂", "雷", "鐳", "蕾", "磊", "累", "儡", "壘", "擂", "肋", "類", "淚", "棱", "楞", "冷", "釐", "梨", "犁", "黎", "籬", "狸", "離", "漓", "理", "李", "裡", "鯉", "禮", "莉", "荔", "吏", "栗", "麗", "厲", "勵", "礫", "歷", "利", "傈", "例", "俐", "" , "罖", "罙", "罛", "罜", "罝", "罞", "罠", "罣", "罤", "罥", "罘", "罧", "罫", "罬", "罭", "罯", "罰", "罳", "罵", "罶", "罷", "罸", "罺", "罻", "罼", "罽", "罿", "羀", "羂", "羃", "羄", "羅", "羆", "羇", "羈", "羉", "羋", "羍", "羏", "羐", "羑", "羒", "羓", "羕", "羖", "羗", "羘", "羙", "羛", "羜", "羠", "羢", "羣", "羥", "羦", "羨", "義", "羪", "羫", "羬", "羭", "羮", "羱", "" , "羳", "羴", "羵", "羶", "羷", "羺", "羻", "羾", "翀", "翂", "翃", "翄", "翆", "翇", "翈", "翉", "翋", "翍", "翏", "翐", "翑", "習", "翓", "翖", "翗", "翙", "翬", "翛", "翜", "翝", "翞", "翢", "翣", "痢", "立", "粒", "瀝", "隸", "力", "璃", "哩", "倆", "聯", "蓮", "連", "鐮", "廉", "憐", "漣", "簾", "斂", "臉", "鏈", "戀", "煉", "練", "糧", "涼", "梁", "粱", "良", "兩", "輛", "量", "晾", "亮", "諒", "撩", "聊", "僚", "療", "燎", "寥", "遼", "潦", "了", "撂", "鐐", "廖", "料", "列", "裂", "烈", "劣", "獵", "琳", "林", "磷", "霖", "臨", "鄰", "鱗", "淋", "凜", "賃", "吝", "拎", "玲", "菱", "零", "齡", "鈴", "伶", "羚", "凌", "靈", "陵", "嶺", "領", "另", "令", "溜", "琉", "榴", "硫", "餾", "留", "劉", "瘤", "流", "柳", "六", "龍", "聾", "嚨", "籠", "窿", "" , "翤", "翧", "翨", "翪", "翫", "翬", "翭", "翯", "翲", "翴", "翵", "翶", "翷", "翸", "翹", "翺", "翽", "翾", "翿", "耂", "耇", "耈", "耉", "耊", "耎", "耏", "端", "耓", "耚", "耛", "耝", "耞", "耟", "助", "耣", "藉", "耫", "耬", "耭", "耮", "耯", "耰", "耲", "耴", "耹", "耺", "耼", "耾", "聀", "聁", "聄", "聅", "聇", "聈", "聉", "聎", "聏", "聐", "聑", "聓", "聕", "聖", "聗", "" , "聙", "聛", "聜", "聝", "聞", "聟", "聠", "聡", "聢", "聣", "聤", "聥", "聦", "聧", "聨", "聫", "聬", "聭", "聮", "聯", "聰", "聲", "聳", "聴", "聵", "聶", "職", "聸", "聹", "聺", "聻", "聼", "聽", "隆", "壟", "攏", "隴", "樓", "婁", "摟", "簍", "漏", "陋", "蘆", "盧", "顱", "廬", "爐", "擄", "鹵", "虜", "魯", "麓", "碌", "露", "路", "賂", "鹿", "潞", "祿", "錄", "陸", "戮", "驢", "呂", "鋁", "侶", "旅", "履", "屢", "縷", "慮", "氯", "律", "率", "濾", "綠", "巒", "攣", "孿", "灤", "卵", "亂", "掠", "略", "掄", "輪", "倫", "侖", "淪", "綸", "論", "蘿", "螺", "羅", "邏", "鑼", "籮", "騾", "裸", "落", "洛", "駱", "絡", "媽", "麻", "瑪", "碼", "螞", "馬", "罵", "嘛", "嗎", "埋", "買", "麥", "賣", "邁", "脈", "瞞", "饅", "蠻", "滿", "蔓", "曼", "慢", "漫", "" , "聾", "肁", "肂", "肅", "肈", "肊", "肍", "肎", "操", "胳", "肑", "肒", "肔", "肕", "肗", "肙", "肞", "肣", "肦", "肧", "肨", "肬", "肰", "肳", "肵", "肶", "肸", "肹", "肻", "胅", "肺", "胈", "胉", "朐", "胋", "胏", "胐", "胑", "胒", "胓", "胔", "胕", "胘", "胟", "胠", "胢", "胣", "胦", "胮", "胵", "胷", "胹", "胻", "胾", "胿", "脀", "脁", "脃", "脄", "脅", "脇", "脈", "脋", "" , "脌", "脕", "脗", "脙", "脛", "脜", "脝", "脟", "脠", "脡", "脢", "唇", "脤", "脥", "脦", "脧", "脨", "修", "脪", "脫", "脭", "脮", "脰", "脳", "脴", "脵", "脷", "脹", "脺", "脻", "脼", "脽", "脿", "謾", "芒", "茫", "盲", "氓", "忙", "莽", "貓", "茅", "錨", "毛", "矛", "鉚", "卯", "茂", "冒", "帽", "貌", "貿", "麼", "玫", "枚", "梅", "酶", "黴", "煤", "沒", "眉", "媒", "鎂", "每", "美", "昧", "寐", "妹", "媚", "門", "悶", "們", "萌", "蒙", "檬", "盟", "錳", "猛", "夢", "孟", "眯", "醚", "靡", "糜", "迷", "謎", "彌", "米", "秘", "覓", "泌", "蜜", "密", "冪", "棉", "眠", "綿", "冕", "免", "勉", "娩", "緬", "面", "苗", "描", "瞄", "藐", "秒", "渺", "廟", "妙", "蔑", "滅", "民", "抿", "皿", "敏", "憫", "閩", "明", "螟", "鳴", "銘", "名", "命", "謬", "摸", "" , "腀", "腁", "腂", "腃", "腄", "腅", "腇", "腉", "腍", "腎", "腏", "腒", "腖", "腗", "膕", "腛", "腜", "腝", "腞", "腟", "腡", "腢", "腣", "腤", "腦", "腨", "腪", "腫", "腬", "腯", "腲", "腳", "腵", "腶", "腷", "腸", "膁", "膃", "膄", "膅", "嗉", "膇", "膉", "膋", "膌", "膍", "膎", "膐", "膒", "膓", "膔", "膕", "膖", "膗", "膙", "膚", "膞", "膟", "膠", "膡", "膢", "膤", "膥", "" , "膧", "膩", "膫", "膬", "膭", "膮", "膯", "膰", "膱", "膲", "膴", "膵", "膶", "膷", "膸", "膹", "膼", "膽", "膾", "膿", "臄", "臅", "臇", "臈", "臉", "臋", "臍", "臎", "臏", "臐", "臑", "臒", "臓", "摹", "蘑", "模", "膜", "磨", "摩", "魔", "抹", "末", "莫", "墨", "默", "沫", "漠", "寞", "陌", "謀", "牟", "某", "拇", "牡", "畝", "姆", "母", "墓", "暮", "幕", "募", "慕", "木", "目", "睦", "牧", "穆", "拿", "哪", "吶", "鈉", "那", "娜", "納", "氖", "乃", "奶", "耐", "奈", "南", "男", "難", "囊", "撓", "腦", "惱", "鬧", "淖", "呢", "餒", "內", "嫩", "能", "妮", "霓", "倪", "泥", "尼", "擬", "你", "匿", "膩", "逆", "溺", "蔫", "拈", "年", "碾", "攆", "捻", "念", "娘", "釀", "鳥", "尿", "捏", "聶", "孽", "齧", "鑷", "鎳", "涅", "您", "檸", "獰", "凝", "寧", "" , "臔", "膘", "臖", "臗", "臘", "胭", "臚", "臛", "臢", "臝", "臞", "髒", "臠", "臡", "臢", "臤", "臥", "臦", "臨", "臩", "臫", "臮", "臯", "臰", "臱", "臲", "臵", "臶", "臷", "臸", "臹", "台", "臽", "臿", "舃", "與", "興", "舉", "舊", "釁", "舎", "舏", "舑", "舓", "舕", "鋪", "舗", "舘", "舙", "舚", "舝", "舠", "舤", "舥", "舦", "舧", "舩", "舮", "舲", "舺", "舼", "舽", "舿", "" , "艀", "艁", "艂", "艃", "艅", "艆", "艈", "艊", "艌", "艍", "艎", "艐", "艑", "艒", "艓", "艔", "艕", "艖", "艗", "艙", "艛", "艜", "艝", "艞", "艠", "艡", "艢", "櫓", "艤", "艥", "艦", "艧", "艩", "擰", "濘", "牛", "扭", "鈕", "紐", "膿", "濃", "農", "弄", "奴", "努", "怒", "女", "暖", "虐", "瘧", "挪", "懦", "糯", "諾", "哦", "歐", "鷗", "毆", "藕", "嘔", "偶", "漚", "啪", "趴", "爬", "帕", "怕", "琶", "拍", "排", "牌", "徘", "湃", "派", "攀", "潘", "盤", "磐", "盼", "畔", "判", "叛", "乓", "龐", "旁", "耪", "胖", "拋", "咆", "刨", "炮", "袍", "跑", "泡", "呸", "胚", "培", "裴", "賠", "陪", "配", "佩", "沛", "噴", "盆", "砰", "抨", "烹", "澎", "彭", "蓬", "棚", "硼", "篷", "膨", "朋", "鵬", "捧", "碰", "坯", "砒", "霹", "批", "披", "劈", "琵", "毗", "" , "艪", "艫", "艬", "艭", "艱", "艵", "艶", "豔", "艹", "艻", "艼", "芀", "芁", "芃", "芅", "芆", "芇", "芉", "芌", "芐", "芓", "芔", "芕", "芖", "芚", "芛", "芞", "芠", "芢", "芣", "芧", "芲", "芵", "芶", "芺", "芻", "芼", "芿", "苀", "苂", "苃", "苅", "苆", "苉", "苐", "苖", "苙", "苚", "苝", "苢", "苧", "苨", "苩", "苪", "苬", "苭", "苮", "苰", "苲", "苳", "苵", "苶", "苸", "" , "莓", "苼", "苽", "苾", "苿", "茀", "茊", "茋", "苟", "茐", "茒", "茓", "茖", "茘", "茙", "茝", "茞", "茟", "茠", "茡", "茢", "茣", "茤", "茥", "茦", "茩", "茪", "茮", "茰", "茲", "茷", "茻", "茽", "啤", "脾", "疲", "皮", "匹", "痞", "僻", "屁", "譬", "篇", "偏", "片", "騙", "飄", "漂", "瓢", "票", "撇", "瞥", "拼", "頻", "貧", "品", "聘", "乒", "坪", "蘋", "萍", "平", "憑", "瓶", "評", "屏", "坡", "潑", "頗", "婆", "破", "魄", "迫", "粕", "剖", "撲", "鋪", "僕", "莆", "葡", "菩", "蒲", "埔", "朴", "圃", "普", "浦", "譜", "曝", "瀑", "期", "欺", "棲", "戚", "妻", "七", "淒", "漆", "柒", "沏", "其", "棋", "奇", "歧", "畦", "崎", "臍", "齊", "旗", "祈", "祁", "騎", "起", "豈", "乞", "企", "啟", "契", "砌", "器", "氣", "迄", "棄", "汽", "泣", "訖", "掐", "" , "茾", "茿", "荁", "荂", "荄", "答", "荈", "荊", "荋", "荌", "荍", "荎", "荓", "荕", "荖", "荗", "荘", "荙", "荝", "荢", "荰", "荱", "荲", "豆", "荴", "荵", "荶", "荹", "荺", "荾", "荿", "莀", "莁", "莂", "莃", "莄", "莇", "莈", "莊", "莋", "莌", "莍", "莏", "莐", "莑", "莔", "莕", "莖", "莗", "莙", "莚", "莝", "莟", "莡", "莢", "莣", "莤", "莥", "莦", "莧", "莬", "莭", "莮", "" , "莯", "莵", "莻", "莾", "莿", "菂", "菃", "菄", "菆", "菈", "菉", "菋", "菍", "菎", "菐", "菑", "菒", "菓", "菕", "菗", "菙", "菚", "菛", "菞", "菢", "菣", "菤", "菦", "菧", "菨", "堇", "菬", "菭", "恰", "洽", "牽", "扦", "釺", "鉛", "千", "遷", "簽", "仟", "謙", "干", "黔", "錢", "鉗", "前", "潛", "遣", "淺", "譴", "塹", "嵌", "欠", "歉", "槍", "嗆", "腔", "羌", "牆", "薔", "強", "搶", "橇", "鍬", "敲", "悄", "橋", "瞧", "喬", "僑", "巧", "鞘", "撬", "翹", "峭", "俏", "竅", "切", "茄", "且", "怯", "竊", "欽", "侵", "親", "秦", "琴", "勤", "芹", "擒", "禽", "寢", "沁", "青", "輕", "氫", "傾", "卿", "清", "擎", "晴", "氰", "情", "頃", "請", "慶", "瓊", "窮", "秋", "丘", "邱", "球", "求", "囚", "酋", "泅", "趨", "區", "蛆", "曲", "軀", "屈", "驅", "渠", "" , "菮", "華", "菳", "庵", "菵", "菶", "菷", "菺", "菻", "菼", "菾", "菿", "萀", "萂", "萅", "萇", "萈", "萉", "萊", "萐", "萒", "萓", "萔", "萕", "萖", "萗", "萙", "蘀", "萛", "萞", "萟", "萠", "萡", "萢", "萣", "萩", "萪", "萫", "萬", "萭", "萮", "萯", "萰", "萲", "萳", "萴", "萵", "萶", "萷", "萹", "萺", "萻", "萾", "萿", "葀", "葁", "葂", "葃", "葄", "葅", "葇", "葈", "葉", "" , "葊", "葋", "葌", "葍", "葎", "葏", "葐", "葒", "葓", "葔", "葕", "葖", "葘", "葝", "葞", "葟", "葠", "葢", "葤", "葥", "葦", "葧", "葨", "葪", "葮", "藥", "葰", "葲", "葴", "葷", "葹", "葻", "葼", "取", "娶", "齲", "趣", "去", "圈", "顴", "權", "醛", "泉", "全", "痊", "拳", "犬", "券", "勸", "缺", "炔", "瘸", "卻", "鵲", "榷", "確", "雀", "裙", "群", "然", "燃", "冉", "染", "瓤", "壤", "攘", "嚷", "讓", "饒", "擾", "繞", "惹", "熱", "壬", "仁", "人", "忍", "韌", "任", "認", "刃", "妊", "紉", "扔", "仍", "日", "戎", "茸", "蓉", "榮", "融", "熔", "溶", "容", "絨", "冗", "揉", "柔", "肉", "茹", "蠕", "儒", "孺", "如", "辱", "乳", "汝", "入", "褥", "軟", "阮", "蕊", "瑞", "銳", "閏", "潤", "若", "弱", "撒", "灑", "薩", "腮", "鰓", "塞", "賽", "三", "參", "" , "葽", "葾", "葿", "蒀", "蒁", "蒃", "蒄", "蒅", "蒆", "蒊", "蒍", "蒏", "搜", "蒑", "蒒", "蒓", "蒔", "蒕", "蒖", "蒘", "蒚", "蒛", "蒝", "蒞", "蒟", "蒠", "蒢", "蒣", "蒤", "蒥", "蒦", "蒧", "蒨", "蒩", "蒪", "蒫", "蒬", "蒭", "蒮", "蒰", "蒱", "蒳", "蒵", "蒶", "蒷", "蒻", "蒼", "蒾", "蓀", "蓂", "蓃", "蓅", "席", "蓇", "蓈", "蓋", "蓌", "蓎", "蓏", "蓒", "蓔", "蓕", "蓗", "" , "蓘", "蓙", "蓚", "蓛", "蓜", "蓞", "蓡", "蓢", "蓤", "蓧", "蓨", "蓩", "蓪", "蓫", "蓭", "蓮", "蓯", "蓱", "蓲", "蓳", "蓴", "蓵", "蓶", "蓷", "蓸", "蓹", "蓺", "蓻", "蓽", "蓾", "蔀", "蔁", "蔂", "傘", "散", "桑", "嗓", "喪", "搔", "騷", "掃", "嫂", "瑟", "色", "澀", "森", "僧", "莎", "砂", "殺", "剎", "沙", "紗", "傻", "啥", "煞", "篩", "曬", "珊", "苫", "杉", "山", "刪", "煽", "衫", "閃", "陝", "擅", "贍", "膳", "善", "汕", "扇", "繕", "墑", "傷", "商", "賞", "晌", "上", "尚", "裳", "梢", "捎", "稍", "燒", "芍", "勺", "韶", "少", "哨", "邵", "紹", "奢", "賒", "蛇", "舌", "舍", "赦", "攝", "射", "懾", "涉", "社", "設", "砷", "申", "呻", "伸", "身", "深", "娠", "紳", "神", "沈", "審", "嬸", "甚", "腎", "慎", "滲", "聲", "生", "甥", "牲", "升", "繩", "" , "蔃", "蔄", "蔅", "菱", "蔇", "蔈", "蔉", "蔊", "蔋", "蔍", "蔎", "蔏", "蔐", "蔒", "卜", "蔕", "蔖", "蔘", "蔙", "蔛", "蔜", "蔝", "蔞", "蔠", "蔢", "蔣", "蔤", "蔥", "蔦", "蔧", "蔨", "蔩", "蔪", "蔭", "蔮", "蔯", "蔰", "蔱", "蔲", "蔳", "麻", "蔵", "蔶", "蔾", "蔿", "蕀", "蕁", "蕂", "蕄", "蕅", "蕆", "蕇", "蕋", "蕌", "蕍", "蕎", "蕏", "蕐", "蕑", "蕒", "蕓", "蕔", "蕕", "" , "蕗", "蕘", "蕚", "蕛", "蕜", "蕝", "蕟", "蕠", "蕡", "蕢", "蕣", "蕥", "蕦", "蕧", "蕩", "蕪", "蕫", "蕬", "蕭", "蕮", "蕯", "蕰", "蕱", "蕳", "蕵", "蕶", "蕷", "蕸", "蕼", "蕽", "蕿", "薀", "薁", "省", "盛", "剩", "勝", "聖", "師", "失", "獅", "施", "濕", "詩", "屍", "蝨", "十", "石", "拾", "時", "什", "食", "蝕", "實", "識", "史", "矢", "使", "屎", "駛", "始", "式", "示", "士", "世", "柿", "事", "拭", "誓", "逝", "勢", "是", "嗜", "噬", "適", "仕", "侍", "釋", "飾", "氏", "市", "恃", "室", "視", "試", "收", "手", "首", "守", "壽", "授", "售", "受", "瘦", "獸", "蔬", "樞", "梳", "殊", "抒", "輸", "叔", "舒", "淑", "疏", "書", "贖", "孰", "熟", "薯", "暑", "曙", "署", "蜀", "黍", "鼠", "屬", "術", "述", "樹", "束", "戍", "豎", "墅", "庶", "數", "漱", "" , "薂", "薃", "薆", "薈", "薉", "薊", "薋", "薌", "薍", "薎", "薐", "姜", "薒", "薓", "薔", "薕", "薖", "薗", "薘", "剃", "薚", "薝", "薞", "薟", "薠", "薡", "薢", "薣", "薥", "薦", "薧", "薩", "薫", "薬", "薭", "薱", "薲", "薳", "薴", "薵", "薶", "薸", "薺", "薻", "薼", "薽", "薾", "薿", "藀", "藂", "藃", "藄", "藅", "藆", "藇", "藈", "藊", "藋", "藌", "藍", "藎", "藑", "藒", "" , "藔", "藖", "藗", "藘", "藙", "藚", "藛", "藝", "藞", "藟", "藠", "藡", "藢", "藣", "藥", "藦", "藧", "藨", "藪", "藫", "藬", "藭", "藮", "藯", "藰", "藱", "藲", "藳", "藴", "藵", "藶", "薯", "藸", "恕", "刷", "耍", "摔", "衰", "甩", "帥", "栓", "拴", "霜", "雙", "爽", "誰", "水", "睡", "稅", "吮", "瞬", "順", "舜", "說", "碩", "朔", "爍", "斯", "撕", "嘶", "思", "私", "司", "絲", "死", "肆", "寺", "嗣", "四", "伺", "似", "飼", "巳", "松", "聳", "慫", "頌", "送", "宋", "訟", "誦", "搜", "艘", "擻", "嗽", "蘇", "酥", "俗", "素", "速", "粟", "僳", "塑", "溯", "宿", "訴", "肅", "酸", "蒜", "算", "雖", "隋", "隨", "綏", "髓", "碎", "歲", "穗", "遂", "隧", "祟", "孫", "損", "筍", "蓑", "梭", "唆", "縮", "瑣", "索", "鎖", "所", "塌", "他", "它", "她", "塔", "" , "藹", "藺", "藼", "藽", "藾", "蘀", "蘁", "蘂", "蘃", "蘄", "蘆", "蘇", "蘈", "蘉", "蘊", "蘋", "蘌", "蘍", "蘎", "蘏", "蘐", "蘒", "蘓", "蘔", "蘕", "蘗", "蘘", "蘙", "蘚", "蘛", "蘜", "蘝", "蘞", "蘟", "蘠", "蘡", "蘢", "蘣", "蘤", "蘥", "蘦", "蘨", "蘪", "蘫", "蘬", "蘭", "蘮", "蘯", "蘰", "蘱", "蘲", "蘳", "蘴", "蘵", "蘶", "蘷", "蘹", "蘺", "蘻", "蘽", "蘾", "蘿", "虀", "" , "虁", "虂", "虃", "虄", "虅", "虆", "虇", "虈", "虉", "虊", "虋", "虌", "虒", "虓", "處", "呼", "虗", "虘", "虙", "虛", "虜", "虝", "號", "虠", "虡", "虣", "虤", "虥", "虦", "虧", "虨", "虩", "虪", "獺", "撻", "蹋", "踏", "胎", "苔", "抬", "台", "泰", "酞", "太", "態", "汰", "坍", "攤", "貪", "癱", "灘", "壇", "檀", "痰", "潭", "譚", "談", "坦", "毯", "袒", "碳", "探", "嘆", "炭", "湯", "塘", "搪", "堂", "棠", "膛", "唐", "糖", "倘", "躺", "淌", "趟", "燙", "掏", "濤", "滔", "絛", "萄", "桃", "逃", "淘", "陶", "討", "套", "特", "藤", "騰", "疼", "謄", "梯", "剔", "踢", "銻", "提", "題", "蹄", "啼", "體", "替", "嚏", "惕", "涕", "剃", "屜", "天", "添", "填", "田", "甜", "恬", "舔", "腆", "挑", "條", "迢", "眺", "跳", "貼", "鐵", "帖", "廳", "聽", "烴", "" , "虭", "虯", "虰", "虲", "虳", "虴", "虵", "虶", "虷", "虸", "蚃", "蚄", "蚅", "蚆", "蚇", "蚈", "蚉", "蚎", "蚏", "蚐", "蚑", "蚒", "蚔", "蚖", "蚗", "蚘", "蚙", "蚚", "蚛", "蚞", "蚟", "蚠", "蚡", "蚢", "蚥", "蚦", "蚫", "蚭", "蚮", "蚲", "蚳", "蚷", "蚸", "蚹", "蚻", "蚼", "蚽", "蚾", "蚿", "蛁", "蛂", "蛃", "蛅", "蛈", "蛌", "蛍", "蛒", "蛓", "蛕", "蛖", "蛗", "蛚", "蛜", "" , "蛝", "蛠", "蛡", "蛢", "蛣", "蛥", "蛦", "蛧", "蛨", "蛪", "蛫", "蛬", "蛯", "蛵", "蛶", "蛷", "蛺", "蛻", "蛼", "蛽", "蛿", "蜁", "蜄", "蜅", "蜆", "蜋", "蜌", "蜎", "蜏", "蜐", "蜑", "蜔", "蜖", "汀", "廷", "停", "亭", "庭", "挺", "艇", "通", "桐", "酮", "瞳", "同", "銅", "彤", "童", "桶", "捅", "筒", "統", "痛", "偷", "投", "頭", "透", "凸", "禿", "突", "圖", "徒", "途", "涂", "屠", "土", "吐", "兔", "湍", "團", "推", "頹", "腿", "蛻", "褪", "退", "吞", "屯", "臀", "拖", "托", "脫", "鴕", "陀", "馱", "駝", "橢", "妥", "拓", "唾", "挖", "哇", "蛙", "窪", "娃", "瓦", "襪", "歪", "外", "豌", "彎", "灣", "玩", "頑", "丸", "烷", "完", "碗", "挽", "晚", "皖", "惋", "宛", "婉", "萬", "腕", "汪", "王", "亡", "枉", "網", "往", "旺", "望", "忘", "妄", "威", "" , "蜙", "蜛", "蜝", "蜟", "蜠", "蜤", "蜦", "蜧", "蜨", "蜪", "蜫", "蜬", "蜭", "蜯", "蜰", "蜲", "蜳", "蜵", "蜶", "蜸", "蜹", "霓", "蜼", "蜽", "蝀", "蝁", "蝂", "蝃", "蝄", "蝅", "蝆", "蝊", "蝋", "蝍", "蝏", "蝐", "蝑", "蝒", "蝔", "蝕", "蝖", "蝘", "蝚", "蝛", "蝜", "蝝", "蝞", "蝟", "蝡", "蝢", "蝦", "蝧", "蝨", "蝩", "蝪", "蝫", "蝬", "蝭", "蝯", "蝱", "蝲", "蝳", "蝵", "" , "蝷", "蝸", "蝹", "蝺", "蝿", "螀", "螁", "螄", "螆", "螇", "螉", "螊", "螌", "螎", "螏", "螐", "螑", "螒", "螔", "螕", "螖", "螘", "螙", "螚", "螛", "螜", "螝", "螞", "螠", "螡", "螢", "螣", "螤", "巍", "微", "危", "韋", "違", "桅", "圍", "唯", "惟", "為", "濰", "維", "葦", "萎", "委", "偉", "偽", "尾", "緯", "未", "蔚", "味", "畏", "胃", "喂", "魏", "位", "渭", "謂", "尉", "慰", "衛", "瘟", "溫", "蚊", "文", "聞", "紋", "吻", "穩", "紊", "問", "嗡", "翁", "甕", "撾", "蝸", "渦", "窩", "我", "斡", "臥", "握", "沃", "巫", "嗚", "鎢", "烏", "污", "誣", "屋", "無", "蕪", "梧", "吾", "吳", "毋", "武", "五", "捂", "午", "舞", "伍", "侮", "塢", "戊", "霧", "晤", "物", "勿", "務", "悟", "誤", "昔", "熙", "析", "西", "硒", "矽", "晰", "嘻", "吸", "錫", "犧", "" , "螥", "螦", "螧", "螩", "螪", "螮", "螰", "螱", "螲", "螴", "螶", "螷", "螸", "螹", "螻", "螼", "螾", "螿", "蟁", "蟂", "蟃", "蟄", "蟅", "蟇", "蟈", "蟉", "蟌", "蟍", "蟎", "蠨", "蟐", "蟔", "蟕", "蟖", "蟗", "蟘", "蟙", "蟚", "蟜", "蟝", "蟞", "蟟", "蟡", "蟢", "蟣", "蟤", "蟦", "蟧", "蟨", "蟩", "蟫", "蟬", "蟭", "蟯", "蟰", "蟱", "蟲", "蟳", "蟴", "蟵", "蟶", "蟷", "蟸", "" , "蟺", "蟻", "蟼", "蟽", "蟿", "蠀", "蠁", "蠂", "蠄", "蠅", "蠆", "蠇", "蠈", "蠉", "蠋", "蠌", "蠍", "蠎", "蠏", "蠐", "蠑", "蠒", "蚝", "蠗", "蠘", "蠙", "蠚", "蠜", "蠝", "蠞", "蠟", "蠠", "蠣", "稀", "息", "希", "悉", "膝", "夕", "惜", "熄", "烯", "溪", "汐", "犀", "檄", "襲", "席", "習", "媳", "喜", "銑", "洗", "系", "隙", "戲", "細", "瞎", "蝦", "匣", "霞", "轄", "暇", "峽", "俠", "狹", "下", "廈", "夏", "嚇", "掀", "鍁", "先", "仙", "鮮", "纖", "咸", "賢", "銜", "舷", "閒", "涎", "弦", "嫌", "顯", "險", "現", "獻", "縣", "腺", "餡", "羨", "憲", "陷", "限", "線", "相", "廂", "鑲", "香", "箱", "襄", "湘", "鄉", "翔", "祥", "詳", "想", "響", "享", "項", "巷", "橡", "像", "向", "象", "蕭", "硝", "霄", "削", "哮", "囂", "銷", "消", "宵", "淆", "曉", "" , "蠤", "蠥", "蠦", "蠧", "蠨", "蠩", "蠪", "蠫", "蠬", "蠭", "蠮", "蠯", "蠰", "蠱", "蠳", "蠴", "蠵", "蠶", "蠼", "蠸", "蠺", "蠻", "蠽", "蠾", "蠿", "衁", "衂", "衃", "眾", "衇", "衈", "衉", "蔑", "衋", "衎", "衏", "衐", "衑", "炫", "術", "衕", "衖", "衘", "胡", "衛", "衜", "沖", "衞", "衟", "衠", "衦", "衧", "衪", "衭", "衯", "衱", "衳", "衴", "衵", "衶", "衸", "只", "衺", "" , "衻", "衼", "袀", "袃", "袆", "袇", "袉", "袊", "袌", "袎", "袏", "袐", "袑", "袓", "袔", "袕", "袗", "袘", "袙", "袚", "袛", "袝", "袞", "袟", "袠", "袡", "袣", "袥", "袦", "袧", "袨", "袩", "祛", "小", "孝", "校", "肖", "嘯", "笑", "效", "楔", "些", "歇", "蠍", "鞋", "協", "挾", "攜", "邪", "斜", "脅", "諧", "寫", "械", "卸", "蟹", "懈", "洩", "瀉", "謝", "屑", "薪", "芯", "鋅", "欣", "辛", "新", "忻", "心", "信", "釁", "星", "腥", "猩", "惺", "興", "刑", "型", "形", "邢", "行", "醒", "幸", "杏", "性", "姓", "兄", "凶", "胸", "匈", "洶", "雄", "熊", "休", "修", "羞", "朽", "嗅", "鏽", "秀", "袖", "繡", "墟", "戌", "需", "虛", "噓", "須", "徐", "許", "蓄", "酗", "敘", "旭", "序", "畜", "恤", "絮", "婿", "緒", "續", "軒", "喧", "宣", "懸", "旋", "玄", "" , "袬", "袮", "袯", "袰", "袲", "袳", "袴", "袵", "袶", "袸", "袹", "袺", "袻", "袽", "袾", "袿", "裀", "裃", "裄", "裇", "裈", "裊", "裋", "裌", "裍", "裡", "裐", "裑", "裓", "裖", "裗", "裚", "裛", "補", "裝", "裞", "裠", "裡", "裦", "裧", "裩", "裪", "裫", "裬", "裭", "裮", "裯", "裲", "裵", "裶", "裷", "裺", "裻", "制", "裿", "褀", "褁", "褃", "褄", "褅", "褆", "復", "褈", "" , "褉", "褋", "褌", "褍", "袖", "褏", "褑", "褔", "褕", "褖", "褗", "褘", "褜", "褝", "褞", "褟", "褠", "褢", "褣", "褤", "褦", "褧", "褨", "褩", "褬", "褭", "褮", "褯", "褱", "褲", "褳", "褵", "褷", "選", "癬", "眩", "絢", "靴", "薛", "學", "穴", "雪", "血", "勳", "熏", "循", "旬", "詢", "尋", "馴", "巡", "殉", "汛", "訓", "訊", "遜", "迅", "壓", "押", "鴉", "鴨", "呀", "丫", "芽", "牙", "蚜", "崖", "衙", "涯", "雅", "啞", "亞", "訝", "焉", "咽", "閹", "煙", "淹", "鹽", "嚴", "研", "蜒", "岩", "延", "言", "顏", "閻", "炎", "沿", "奄", "掩", "眼", "衍", "演", "豔", "堰", "燕", "厭", "硯", "雁", "唁", "彥", "焰", "宴", "諺", "驗", "殃", "央", "鴦", "秧", "楊", "揚", "佯", "瘍", "羊", "洋", "陽", "氧", "仰", "癢", "養", "樣", "漾", "邀", "腰", "妖", "瑤", "" , "褸", "褹", "褺", "褻", "褼", "褽", "褾", "褿", "襀", "襂", "襃", "襅", "襆", "襇", "襈", "襉", "襊", "襋", "襌", "襍", "襎", "襏", "襐", "襑", "襒", "襓", "襔", "襕", "襖", "襗", "襘", "襙", "襚", "襛", "襜", "襝", "襠", "襡", "襢", "襣", "襤", "襥", "襧", "襨", "襩", "襪", "襫", "擺", "襭", "襮", "襯", "襰", "襱", "襲", "襳", "襴", "襵", "襶", "襷", "襸", "襹", "襺", "襼", "" , "襽", "西", "覀", "覂", "覄", "覅", "覇", "核", "覉", "覊", "見", "覌", "覍", "覎", "規", "覐", "覑", "覒", "覓", "覔", "覕", "視", "覗", "覘", "覙", "覚", "覛", "眺", "覝", "覞", "覟", "覠", "覡", "搖", "堯", "遙", "窯", "謠", "姚", "咬", "舀", "藥", "要", "耀", "椰", "噎", "耶", "爺", "野", "冶", "也", "頁", "掖", "業", "葉", "曳", "腋", "夜", "液", "一", "壹", "醫", "揖", "銥", "依", "伊", "衣", "頤", "夷", "遺", "移", "儀", "胰", "疑", "沂", "宜", "姨", "彝", "椅", "蟻", "倚", "已", "乙", "矣", "以", "藝", "抑", "易", "邑", "屹", "億", "役", "臆", "逸", "肄", "疫", "亦", "裔", "意", "毅", "憶", "義", "益", "溢", "詣", "議", "誼", "譯", "異", "翼", "翌", "繹", "茵", "蔭", "因", "殷", "音", "陰", "姻", "吟", "銀", "淫", "寅", "飲", "尹", "引", "隱", "" , "覢", "覣", "覤", "覥", "覦", "覧", "覨", "覩", "親", "覫", "覬", "覭", "覮", "覯", "覰", "覱", "覲", "観", "覴", "覵", "覶", "覷", "覸", "覹", "覺", "覻", "覼", "覽", "覾", "覿", "觀", "覎", "觍", "觓", "筋", "觕", "觗", "觘", "觙", "觛", "抵", "觟", "觠", "觡", "觢", "觤", "觧", "觨", "觩", "觪", "觬", "觭", "觮", "觰", "觱", "觲", "觴", "觵", "觶", "觷", "觸", "觹", "觺", "" , "觻", "觼", "觽", "觾", "觿", "訁", "訂", "訃", "訄", "訅", "訆", "計", "訉", "訊", "訋", "訌", "訍", "討", "訏", "訐", "訑", "訒", "訓", "訔", "訕", "訖", "托", "記", "訙", "訚", "訛", "訜", "訝", "印", "英", "櫻", "嬰", "鷹", "應", "纓", "瑩", "螢", "營", "熒", "蠅", "迎", "贏", "盈", "影", "穎", "硬", "映", "喲", "擁", "傭", "臃", "癰", "庸", "雍", "踴", "蛹", "詠", "泳", "湧", "永", "恿", "勇", "用", "幽", "優", "悠", "憂", "尤", "由", "郵", "鈾", "猶", "油", "游", "酉", "有", "友", "右", "佑", "釉", "誘", "又", "幼", "迂", "淤", "於", "盂", "榆", "虞", "愚", "輿", "余", "俞", "逾", "魚", "愉", "渝", "漁", "隅", "予", "娛", "雨", "與", "嶼", "禹", "宇", "語", "羽", "玉", "域", "芋", "郁", "籲", "遇", "喻", "峪", "御", "愈", "欲", "獄", "育", "譽", "" , "訞", "訟", "訠", "訡", "欣", "訣", "訤", "訥", "訦", "訧", "訨", "訩", "訪", "訫", "訬", "設", "訮", "訯", "訰", "許", "訲", "訳", "訴", "訵", "訶", "訷", "訸", "訹", "診", "注", "證", "訽", "訿", "詀", "詁", "詂", "詃", "詄", "詅", "詆", "詇", "詉", "詊", "詋", "詌", "詍", "詎", "詏", "詐", "詑", "詒", "詓", "詔", "評", "詖", "詗", "詘", "詙", "詚", "詛", "詜", "詝", "詞", "" , "詟", "詠", "詡", "詢", "詣", "詤", "詥", "試", "詧", "詨", "詩", "詪", "詫", "詬", "詭", "詮", "詯", "詰", "話", "該", "詳", "詴", "詵", "酬", "詷", "詸", "詺", "咯", "詼", "詽", "詾", "詿", "誀", "浴", "寓", "裕", "預", "豫", "馭", "鴛", "淵", "冤", "元", "垣", "袁", "原", "援", "轅", "園", "員", "圓", "猿", "源", "緣", "遠", "苑", "願", "怨", "院", "曰", "約", "越", "躍", "鑰", "岳", "粵", "月", "悅", "閱", "耘", "云", "鄖", "勻", "隕", "允", "運", "蘊", "醞", "暈", "韻", "孕", "匝", "砸", "雜", "栽", "哉", "災", "宰", "載", "再", "在", "咱", "攢", "暫", "贊", "贓", "髒", "葬", "遭", "糟", "鑿", "藻", "棗", "早", "澡", "蚤", "躁", "噪", "造", "皂", "灶", "燥", "責", "擇", "則", "澤", "賊", "怎", "增", "憎", "曾", "贈", "扎", "喳", "渣", "札", "軋", "" , "誁", "誂", "誃", "誄", "誅", "誆", "誇", "誈", "誋", "志", "認", "誎", "誏", "誐", "誑", "誒", "誔", "誕", "誖", "誗", "誘", "誙", "誚", "誛", "誜", "誝", "語", "誟", "誠", "誡", "誢", "誣", "誤", "誥", "誦", "誧", "誨", "誩", "說", "誫", "說", "読", "誮", "誯", "誰", "誱", "課", "誳", "誴", "誵", "誶", "誷", "誸", "誹", "誺", "誻", "誼", "誽", "誾", "調", "諀", "諁", "諂", "" , "諃", "諄", "諅", "諆", "談", "諈", "諉", "諊", "請", "諌", "諍", "諎", "諏", "諐", "諑", "諒", "諓", "諔", "諕", "論", "諗", "諘", "諙", "諚", "諛", "諜", "諝", "諞", "諟", "喧", "諡", "諢", "諣", "鍘", "閘", "眨", "柵", "榨", "咋", "乍", "炸", "詐", "摘", "齋", "宅", "窄", "債", "寨", "瞻", "氈", "詹", "粘", "沾", "盞", "斬", "輾", "嶄", "展", "蘸", "棧", "佔", "戰", "站", "湛", "綻", "樟", "章", "彰", "漳", "張", "掌", "漲", "杖", "丈", "帳", "賬", "仗", "脹", "瘴", "障", "招", "昭", "找", "沼", "趙", "照", "罩", "兆", "肇", "召", "遮", "折", "哲", "蟄", "轍", "者", "鍺", "蔗", "這", "浙", "珍", "斟", "真", "甄", "砧", "臻", "貞", "針", "偵", "枕", "疹", "診", "震", "振", "鎮", "陣", "蒸", "掙", "睜", "征", "猙", "爭", "怔", "整", "拯", "正", "政", "" , "諤", "諥", "諦", "諧", "諨", "諩", "諪", "諫", "諬", "諭", "諮", "諯", "諰", "諱", "諲", "諳", "諴", "諵", "諶", "諷", "諸", "諹", "諺", "諻", "諼", "諽", "諾", "諿", "謀", "謁", "謂", "謃", "謄", "謅", "謆", "謈", "謉", "謊", "謋", "謌", "謍", "謎", "謏", "謐", "謑", "謒", "謓", "謔", "謕", "謖", "謗", "謘", "謙", "謚", "講", "謜", "謝", "謞", "謟", "謠", "謡", "謢", "謣", "" , "謤", "謥", "謧", "謨", "謩", "謪", "謫", "謬", "謭", "謮", "謯", "謰", "謱", "謲", "謳", "謴", "謵", "謶", "謷", "謸", "謹", "謺", "謻", "呼", "謽", "謾", "謿", "譀", "嘩", "譂", "譃", "譄", "譅", "幀", "症", "鄭", "證", "芝", "枝", "支", "吱", "蜘", "知", "肢", "脂", "汁", "之", "織", "職", "直", "植", "殖", "執", "值", "侄", "址", "指", "止", "趾", "只", "旨", "紙", "志", "摯", "擲", "至", "致", "置", "幟", "峙", "制", "智", "秩", "稚", "質", "炙", "痔", "滯", "治", "窒", "中", "盅", "忠", "鐘", "衷", "終", "種", "腫", "重", "仲", "眾", "舟", "周", "州", "洲", "謅", "粥", "軸", "肘", "帚", "咒", "皺", "宙", "晝", "驟", "珠", "株", "蛛", "朱", "豬", "諸", "誅", "逐", "竹", "燭", "煮", "拄", "矚", "囑", "主", "著", "柱", "助", "蛀", "貯", "鑄", "築", "" , "嘻", "譇", "譈", "證", "譊", "譋", "譌", "譍", "譎", "譏", "譐", "譑", "譒", "譓", "撰", "譕", "譖", "譗", "識", "譙", "譚", "譛", "譜", "譝", "譞", "噪", "譠", "譡", "譢", "譣", "譤", "譥", "譧", "譨", "譩", "譪", "譫", "毀", "譮", "譯", "議", "譱", "譲", "譳", "譴", "譵", "譶", "護", "譸", "譹", "譺", "譻", "譼", "譽", "譾", "譿", "讀", "讁", "讂", "讃", "讄", "讅", "讆", "" , "讇", "讈", "讉", "變", "讋", "宴", "讍", "讎", "讏", "讐", "讑", "讒", "讓", "讔", "讕", "讖", "讗", "讘", "讙", "贊", "讛", "讜", "讝", "讞", "讟", "讬", "讱", "訩", "詗", "诐", "诪", "讅", "諝", "住", "注", "祝", "駐", "抓", "爪", "拽", "專", "磚", "轉", "撰", "賺", "篆", "樁", "莊", "裝", "妝", "撞", "壯", "狀", "椎", "錐", "追", "贅", "墜", "綴", "諄", "准", "捉", "拙", "卓", "桌", "琢", "茁", "酌", "啄", "著", "灼", "濁", "茲", "咨", "資", "姿", "滋", "淄", "孜", "紫", "仔", "籽", "滓", "子", "自", "漬", "字", "鬃", "棕", "蹤", "宗", "綜", "總", "縱", "鄒", "走", "奏", "揍", "租", "足", "卒", "族", "祖", "詛", "阻", "組", "鑽", "纂", "嘴", "醉", "最", "罪", "尊", "遵", "昨", "左", "佐", "柞", "做", "作", "坐", "座", "", "", "", "", "", "" , "谸", "谹", "谺", "谻", "谼", "谽", "谾", "溪", "豀", "豂", "豃", "豄", "豅", "豈", "豊", "豋", "豍", "豎", "豏", "豐", "豑", "豒", "豓", "豔", "亍", "豗", "豘", "豙", "豛", "豜", "豝", "豞", "豟", "豠", "豣", "豤", "豥", "豦", "豧", "豨", "豩", "豬", "豭", "豶", "豯", "豰", "豱", "豲", "豴", "豵", "豶", "豷", "豻", "豼", "豽", "豾", "豿", "貀", "貁", "貃", "貄", "貆", "貇", "" , "貈", "貋", "狸", "貎", "貏", "貐", "貑", "貒", "貓", "貕", "貖", "貗", "貙", "貚", "貛", "貜", "貝", "貞", "貟", "負", "財", "貢", "貣", "貤", "貥", "貦", "貧", "貨", "販", "貪", "貫", "責", "貭", "亍", "丌", "兀", "丐", "廿", "卅", "丕", "亙", "丞", "鬲", "孬", "噩", "丨", "禺", "丿", "匕", "乇", "夭", "爻", "卮", "氐", "囟", "胤", "馗", "毓", "睾", "鼗", "丶", "亟", "鼐", "乜", "乩", "亓", "羋", "孛", "嗇", "嘏", "仄", "厙", "厝", "厴", "厥", "廝", "靨", "贋", "匚", "叵", "匭", "匱", "匾", "賾", "卦", "卣", "刂", "刈", "刎", "剄", "刳", "劌", "剴", "剌", "剞", "剡", "剜", "蒯", "剽", "劂", "劁", "劐", "劓", "冂", "罔", "亻", "仃", "仉", "仂", "仨", "仡", "仫", "仞", "傴", "仳", "伢", "佤", "仵", "倀", "傖", "伉", "佇", "佞", "佧", "攸", "佚", "佝", "" , "貮", "貯", "貰", "貱", "貲", "貳", "貴", "貵", "貶", "買", "貸", "貹", "貺", "費", "貼", "貽", "貾", "貿", "賀", "賁", "賂", "賃", "賄", "賅", "賆", "資", "賈", "賉", "賊", "賋", "賌", "賍", "賎", "賏", "賐", "賑", "賒", "賓", "賔", "賕", "賖", "賗", "賘", "賙", "賚", "賛", "賜", "賝", "賞", "賟", "賠", "賡", "賢", "賣", "賤", "賥", "賦", "賧", "賨", "賩", "質", "賫", "賬", "" , "賭", "賮", "賯", "賰", "賱", "賲", "賳", "賴", "賵", "賶", "賷", "剩", "賹", "賺", "賻", "購", "賽", "賾", "賿", "贀", "贁", "贂", "贃", "贄", "贅", "贆", "贇", "贈", "贉", "贊", "贋", "贌", "贍", "佟", "佗", "你", "伽", "佶", "佴", "侑", "侉", "侃", "侏", "佾", "佻", "儕", "佼", "儂", "侔", "儔", "儼", "儷", "俅", "俚", "俁", "俜", "俑", "俟", "俸", "倩", "偌", "俳", "倬", "倏", "裸", "倭", "俾", "倜", "倌", "倥", "倨", "僨", "偃", "偕", "偈", "偎", "傯", "僂", "儻", "儐", "儺", "傺", "僖", "儆", "僭", "僬", "僦", "僮", "儇", "儋", "仝", "汆", "佘", "僉", "俎", "龠", "汆", "糴", "兮", "巽", "黌", "馘", "囅", "夔", "勹", "匍", "訇", "匐", "鳧", "夙", "兕", "亠", "兗", "亳", "袞", "袤", "褻", "臠", "裒", "稟", "嬴", "蠃", "羸", "冫", "冱", "冽", "冼", "" , "贎", "贏", "贐", "贑", "贒", "贓", "贔", "贕", "贖", "贗", "贘", "贙", "贚", "贛", "贓", "贠", "赑", "賙", "賵", "贇", "赥", "赨", "赩", "赪", "赬", "赮", "赯", "赱", "赲", "赸", "赹", "赺", "赻", "赼", "赽", "赾", "赿", "趀", "趂", "趃", "趆", "趇", "趈", "趉", "趌", "趍", "趎", "趏", "趐", "趒", "趓", "趕", "趖", "趗", "趘", "趙", "趚", "趛", "趜", "趝", "趞", "趠", "趡", "" , "趢", "趤", "趥", "趦", "趧", "趨", "趩", "趪", "趫", "趬", "趭", "趮", "趯", "趰", "趲", "趶", "趷", "趹", "趻", "趽", "跀", "跁", "跂", "跅", "跇", "跈", "跉", "跊", "跍", "跐", "跒", "跓", "跔", "淞", "冖", "冢", "冥", "讠", "訐", "訌", "訕", "謳", "詎", "訥", "詁", "訶", "詆", "詔", "詘", "詒", "誆", "誄", "詿", "詰", "詼", "詵", "詬", "詮", "諍", "諢", "詡", "誚", "誥", "誑", "誒", "諏", "諑", "諉", "諛", "諗", "諂", "誶", "諶", "諫", "謔", "謁", "諤", "諭", "諼", "諳", "諦", "諮", "諞", "謨", "讜", "謖", "謚", "謐", "謫", "譾", "譖", "譙", "譎", "讞", "譫", "讖", "卩", "巹", "阝", "阢", "阡", "阱", "阪", "阽", "阼", "陂", "陘", "陔", "陟", "隉", "陬", "陲", "陴", "隈", "隍", "隗", "隰", "邗", "邛", "鄺", "邙", "鄔", "邡", "邴", "邳", "邶", "鄴", "" , "跕", "跘", "跙", "跜", "跠", "跡", "跢", "跥", "跦", "跧", "跩", "跭", "跮", "跰", "跱", "跲", "跴", "跶", "局", "跾", "跿", "踀", "踁", "踂", "踃", "踄", "踆", "踇", "踈", "踋", "踍", "踎", "踐", "踑", "踒", "踓", "踕", "踖", "踗", "踘", "踙", "踚", "踛", "踜", "踠", "蜷", "踤", "踥", "踦", "踧", "踨", "碰", "踭", "逾", "踲", "踳", "踴", "踶", "踷", "踸", "踻", "踼", "踾", "" , "踿", "蹃", "蹅", "蹆", "蹌", "蹍", "蹎", "蹏", "蹐", "蹓", "蹔", "蹕", "蹖", "蹗", "蹘", "蹚", "蹛", "蹜", "蹝", "蹞", "跡", "跖", "蹡", "蹢", "蹣", "蹤", "蹥", "糟", "蹨", "蹪", "蹫", "蹮", "蹱", "邸", "邰", "郟", "郅", "邾", "鄶", "隙", "郇", "鄆", "酈", "郢", "郜", "郗", "郛", "郫", "郯", "郾", "鄄", "鄢", "鄞", "鄣", "鄱", "鄯", "鄹", "酃", "酆", "芻", "奐", "勱", "劬", "劭", "劾", "哿", "勐", "勖", "勰", "叟", "燮", "矍", "廴", "凵", "幽", "鬯", "厶", "弁", "畚", "巰", "坌", "堊", "垡", "塾", "墼", "壅", "壑", "圩", "圬", "圪", "圳", "壙", "圮", "圯", "壢", "圻", "阪", "坩", "壟", "坫", "壚", "坼", "坻", "坨", "坭", "坶", "坳", "埡", "垤", "垌", "塏", "埏", "垧", "堖", "垓", "垠", "埕", "塒", "堝", "壎", "埒", "垸", "埴", "埯", "埸", "埤", "埝", "" , "蹳", "蹵", "蹷", "蹸", "蹹", "蹺", "蹻", "蹽", "蹾", "躀", "躂", "躃", "躄", "躆", "躈", "躉", "躊", "躋", "躌", "躍", "躎", "躑", "躒", "躓", "躕", "躖", "躗", "躘", "躙", "躚", "躛", "躝", "躟", "躠", "躡", "躢", "躣", "躤", "躥", "躦", "躧", "躨", "躩", "躪", "躭", "躮", "體", "躱", "躳", "躴", "躵", "躶", "躷", "躸", "躹", "躻", "躼", "躽", "躾", "躿", "軀", "軁", "軂", "" , "軃", "軄", "軅", "軆", "軇", "軈", "軉", "車", "軋", "軌", "軍", "軏", "軐", "軑", "軒", "軓", "軔", "軕", "軖", "軗", "軘", "軙", "軚", "軛", "軜", "軝", "軞", "軟", "軠", "軡", "転", "軣", "軤", "堋", "堍", "埽", "埭", "堀", "堞", "堙", "塄", "堠", "塥", "塬", "墁", "墉", "墚", "墀", "馨", "鼙", "懿", "艹", "艽", "艿", "芏", "芊", "芨", "芄", "芎", "芑", "薌", "芙", "芫", "芸", "芾", "芰", "藶", "苊", "苣", "芘", "芷", "芮", "莧", "萇", "蓯", "芩", "芴", "芡", "芪", "芟", "苄", "苧", "芤", "苡", "茉", "苷", "苤", "蘢", "茇", "苜", "苴", "苒", "苘", "茌", "苻", "苓", "蔦", "茚", "茆", "塋", "煢", "苠", "苕", "茜", "荑", "蕘", "蓽", "茈", "莒", "茼", "茴", "茱", "莛", "蕎", "茯", "荏", "荇", "荃", "薈", "荀", "茗", "薺", "茭", "茺", "茳", "犖", "滎", "" , "軥", "軦", "軧", "軨", "軩", "軪", "軫", "軬", "軭", "軮", "軯", "軰", "軱", "軲", "軳", "軴", "軵", "軶", "軷", "軸", "軹", "軺", "軻", "軼", "軽", "軾", "軿", "輀", "輁", "輂", "較", "輄", "輅", "輆", "輇", "輈", "載", "輊", "輋", "輌", "輍", "輎", "輏", "輐", "輑", "輒", "挽", "輔", "輕", "輖", "輗", "輘", "輙", "輚", "輛", "輜", "輝", "輞", "輟", "輠", "輡", "輢", "輣", "" , "輤", "輥", "輦", "輧", "輨", "輩", "輪", "輫", "輬", "輭", "輮", "輯", "輰", "輱", "輲", "輳", "輴", "輵", "輶", "輷", "輸", "輹", "輺", "輻", "輼", "輽", "輾", "輿", "轀", "轁", "轂", "轃", "轄", "蕁", "茛", "藎", "蕒", "蓀", "葒", "葤", "莰", "荸", "蒔", "萵", "莠", "莪", "莓", "莜", "蒞", "荼", "薟", "莩", "荽", "蕕", "荻", "莘", "莞", "莨", "鶯", "蓴", "菁", "萁", "菥", "菘", "堇", "萘", "萋", "菝", "菽", "菖", "萜", "萸", "萑", "萆", "菔", "菟", "萏", "萃", "菸", "菹", "菪", "菅", "菀", "縈", "菰", "菡", "葜", "葑", "葚", "葙", "葳", "蕆", "蒈", "葺", "蕢", "葸", "萼", "葆", "葩", "葶", "蔞", "蒎", "萱", "葭", "蓁", "蓍", "蓐", "驀", "蒽", "蓓", "蓊", "蒿", "蒺", "蘺", "蒡", "蒹", "蒴", "蒗", "鎣", "蕷", "蔌", "甍", "蔸", "蓰", "蘞", "蔟", "藺", "" , "轅", "轆", "轇", "轈", "轉", "轊", "轋", "轌", "轍", "轎", "轏", "轐", "轑", "轒", "轓", "轔", "轕", "轖", "轗", "轘", "轙", "轚", "轛", "轜", "轝", "轞", "轟", "轠", "轡", "轢", "轣", "轤", "轥", "轪", "辀", "辌", "辒", "辝", "辠", "辡", "辢", "辤", "辥", "辦", "辧", "辪", "辬", "辭", "辮", "辯", "農", "辳", "辴", "辵", "辷", "辸", "辺", "辻", "込", "辿", "迀", "迃", "迤", "" , "迉", "迊", "迋", "迌", "迍", "迏", "迒", "迖", "迗", "迚", "迠", "迡", "迣", "迧", "迬", "迯", "迱", "迲", "回", "迵", "迶", "乃", "迻", "迼", "迾", "迿", "逇", "逈", "逌", "逎", "逓", "逕", "逘", "蕖", "蔻", "蓿", "蓼", "蕙", "蕈", "蕨", "蕤", "蕞", "蕺", "瞢", "蕃", "蘄", "蕻", "薤", "薨", "薇", "薏", "蕹", "藪", "薜", "薅", "薹", "薷", "薰", "蘚", "藁", "藜", "藿", "蘧", "蘅", "蘩", "蘗", "蘼", "廾", "弈", "夼", "奩", "耷", "奕", "奚", "奘", "匏", "尢", "尥", "尬", "尷", "扌", "捫", "摶", "抻", "拊", "拚", "拗", "拮", "撟", "拶", "挹", "捋", "捃", "掭", "揶", "捱", "捺", "掎", "摑", "捭", "掬", "掊", "捩", "掮", "摜", "揲", "揸", "揠", "撳", "揄", "揞", "揎", "摒", "揆", "掾", "攄", "摁", "搋", "搛", "搠", "搌", "搦", "搡", "摞", "攖", "摭", "撖", "" , "這", "逜", "連", "逤", "逥", "逧", "逨", "逩", "逪", "逫", "逬", "逰", "周", "進", "逳", "逴", "逷", "逹", "逺", "逽", "逿", "遀", "遃", "遅", "遆", "遈", "遉", "游", "運", "遌", "過", "達", "違", "遖", "遙", "遚", "遜", "遝", "遞", "遟", "遠", "遡", "遤", "遦", "遧", "適", "遪", "遫", "遬", "遯", "遰", "遱", "遲", "遳", "遶", "遷", "選", "遹", "遺", "遻", "遼", "遾", "邁", "" , "還", "邅", "邆", "邇", "邉", "邊", "邌", "邍", "邎", "邏", "邐", "邒", "邔", "邖", "邘", "邚", "邜", "邞", "邟", "邠", "邤", "邥", "邧", "邨", "邩", "邫", "邭", "邲", "邷", "邼", "邽", "邿", "郀", "摺", "擷", "擼", "撙", "攛", "搟", "擐", "擗", "擤", "擢", "攉", "攥", "攮", "弋", "忒", "甙", "弒", "卟", "叱", "嘰", "叩", "叨", "叻", "吒", "吖", "吆", "呋", "嘸", "囈", "呔", "嚦", "呃", "吡", "唄", "咼", "吣", "吲", "咂", "咔", "呷", "呱", "呤", "咚", "嚀", "咄", "呶", "呦", "噝", "哐", "咭", "哂", "咴", "噠", "咧", "咦", "嘵", "嗶", "呲", "咣", "噦", "咻", "咿", "呱", "噲", "哚", "嚌", "咩", "咪", "咤", "噥", "哏", "哞", "嘜", "哧", "嘮", "哽", "唔", "哳", "嗩", "唣", "唏", "唑", "唧", "唪", "嘖", "喏", "喵", "啉", "囀", "啁", "啕", "唿", "啐", "唼", "" , "郂", "合", "郆", "郈", "郉", "郋", "郌", "郍", "郒", "郔", "郕", "郖", "郘", "郙", "郚", "郞", "郟", "郠", "郣", "郤", "郥", "郩", "郪", "郬", "郮", "郰", "郱", "郲", "郳", "郵", "郶", "郷", "郹", "郺", "郻", "郼", "郿", "鄀", "鄁", "鄃", "鄅", "鄆", "鄇", "鄈", "鄉", "鄊", "鄋", "鄌", "鄍", "鄎", "鄏", "鄐", "鄑", "鄒", "鄓", "鄔", "鄕", "鄖", "鄗", "鄘", "鄚", "鄛", "鄜", "" , "鄝", "鄟", "鄠", "鄡", "鄤", "鄥", "鄦", "鄧", "鄨", "鄩", "鄪", "鄫", "鄬", "鄭", "鄮", "鄰", "鄲", "鄳", "鄴", "鄵", "鄶", "鄷", "鄸", "鄺", "鄻", "鄼", "鄽", "鄾", "鄿", "酀", "酁", "酂", "酄", "唷", "啖", "啵", "啶", "啷", "唳", "唰", "啜", "喋", "嗒", "喃", "喱", "喹", "喈", "喁", "喟", "啾", "嗖", "喑", "啻", "嗟", "嘍", "嚳", "喔", "喙", "嗪", "嗷", "嗉", "嘟", "嗑", "囁", "呵", "嗔", "嗦", "嗝", "嗄", "嗯", "嗥", "嗲", "噯", "嗌", "嗍", "嗨", "嗵", "嗤", "轡", "嘞", "嘈", "嘌", "嘁", "嚶", "嘣", "嗾", "嘀", "嘧", "嘭", "噘", "嘹", "噗", "嘬", "噍", "噢", "噙", "嚕", "噌", "噔", "嚆", "噤", "噱", "噫", "噻", "噼", "嚅", "嚓", "嚯", "囔", "囗", "囝", "囡", "圇", "囫", "囹", "囿", "圄", "圊", "圉", "圜", "幃", "帙", "帔", "帑", "幬", "幘", "幗", "" , "酅", "酇", "酈", "酑", "酓", "酔", "酕", "鴆", "酘", "酙", "酛", "酜", "酟", "酠", "酦", "酧", "酨", "酫", "酭", "酳", "酺", "酻", "酼", "醀", "醁", "醂", "醃", "醄", "盞", "醈", "醊", "醎", "醏", "醓", "醔", "醕", "醞", "醗", "醘", "醙", "丑", "醝", "醞", "醟", "醠", "醡", "醤", "醥", "醦", "醧", "醨", "醩", "醫", "醬", "醰", "發", "醲", "醳", "醶", "醷", "醸", "醹", "醻", "" , "宴", "醽", "醾", "醿", "釀", "釁", "釂", "釃", "釄", "釅", "采", "釈", "釋", "釐", "釒", "釓", "釔", "釕", "釖", "釗", "釘", "釙", "釚", "釛", "針", "釞", "釟", "釠", "釡", "釢", "釣", "釤", "釥", "帷", "幄", "幔", "幛", "幞", "幡", "岌", "屺", "岍", "岐", "嶇", "岈", "峴", "岙", "岑", "嵐", "岜", "岵", "岢", "崠", "岬", "岫", "岱", "岣", "峁", "岷", "嶧", "峒", "嶠", "峋", "崢", "嶗", "崍", "崧", "崦", "崮", "崤", "崞", "崆", "崛", "嶸", "崾", "崴", "崽", "嵬", "崳", "嵯", "嶁", "嵫", "嵋", "嵊", "嵩", "嵴", "嶂", "嶙", "嶝", "豳", "嶷", "巔", "彳", "彷", "徂", "徇", "徉", "後", "徠", "徙", "徜", "徨", "徭", "征", "徼", "衢", "彡", "犭", "犰", "犴", "獷", "獁", "狃", "狁", "狎", "狍", "狒", "狨", "獪", "狩", "猻", "狴", "狷", "猁", "狳", "獫", "狺", "" , "扣", "釧", "釨", "釩", "釪", "釫", "釬", "釭", "釮", "釯", "釰", "釱", "釲", "釳", "釴", "釵", "釶", "釷", "釸", "釹", "釺", "釻", "釼", "釽", "釾", "釿", "鈀", "鈁", "鈂", "鈃", "鈄", "鈅", "鈆", "鈇", "鈽", "鈉", "鈊", "鈋", "鈌", "鈍", "鈎", "鈏", "鈐", "鈑", "鈒", "鈓", "鈔", "鈕", "鈖", "鈗", "鈘", "鈙", "鈚", "鈛", "鈜", "鈝", "鈞", "鈟", "鈠", "鐘", "鈢", "鈣", "鈤", "" , "鈥", "鈦", "鈧", "鈨", "鈩", "鈪", "鈫", "鈬", "鈭", "鈮", "鈯", "鈰", "鈱", "鈲", "鈳", "鈴", "鈵", "鈶", "鈷", "鈸", "鈹", "鈺", "鈻", "鈼", "鈽", "鈾", "鈿", "鉀", "鉁", "鉂", "鉃", "鉄", "鉅", "狻", "猗", "猓", "玀", "猊", "猞", "猝", "獼", "猢", "猹", "猥", "蝟", "猸", "猱", "獐", "獍", "獗", "獠", "獬", "獯", "獾", "舛", "夥", "飧", "夤", "夂", "饣", "餳", "飩", "餼", "飪", "飫", "飭", "飴", "餉", "餑", "余", "餛", "餷", "餿", "饃", "饈", "饉", "饊", "饌", "饟", "庀", "廡", "庋", "庖", "庥", "庠", "庹", "庵", "庾", "庳", "賡", "廒", "廑", "廛", "廨", "廩", "膺", "忄", "忉", "忖", "懺", "憮", "忮", "慪", "忡", "忤", "愾", "悵", "愴", "忪", "忭", "忸", "怙", "怵", "怦", "怛", "怏", "怍", "怩", "怫", "怊", "懌", "怡", "慟", "懨", "惻", "愷", "恂", "" , "鑽", "鉇", "鉈", "鉉", "鉊", "刨", "鉌", "鉍", "鉎", "鉏", "鉐", "鉑", "鉒", "鉓", "鉔", "鉕", "鉖", "鉗", "鉘", "鉙", "鉚", "鉛", "鉜", "鉝", "鉞", "鉟", "鉠", "鉡", "缽", "鉣", "鉤", "鉥", "鉦", "鉧", "鉨", "鉩", "鉪", "鉫", "鉬", "鉭", "鉮", "鉯", "鉰", "鉱", "鉲", "鉳", "鉵", "鉶", "鉷", "鉸", "鉹", "鉺", "鉻", "鉼", "鉽", "鉾", "鉿", "銀", "銁", "銂", "銃", "銄", "銅", "" , "銆", "銇", "銈", "銉", "銊", "銋", "銌", "銍", "銏", "銐", "銑", "銒", "銓", "銔", "銕", "銖", "銗", "銘", "銙", "銚", "銛", "銜", "銝", "銞", "銟", "銠", "銡", "銢", "銣", "銤", "銥", "銦", "銧", "恪", "惲", "悖", "悚", "慳", "悝", "悃", "悒", "悌", "悛", "愜", "悻", "悱", "惝", "惘", "惆", "惚", "悴", "慍", "憒", "愕", "愣", "惴", "愀", "愎", "愫", "慊", "慵", "憬", "憔", "憧", "憷", "懍", "懵", "忝", "隳", "閂", "閆", "闈", "閎", "閔", "閌", "闥", "閭", "閫", "鬮", "閬", "閾", "閶", "鬩", "閿", "閽", "閼", "闃", "闋", "闔", "闐", "闕", "闞", "丬", "爿", "戕", "氵", "汔", "汜", "汊", "灃", "沅", "沐", "沔", "沌", "汨", "汩", "汴", "汶", "沆", "溈", "泐", "泔", "沭", "瀧", "瀘", "泱", "泗", "沱", "泠", "泖", "濼", "泫", "泮", "沱", "泓", "泯", "涇", "" , "銨", "銩", "銪", "銫", "銬", "銭", "銯", "銰", "銱", "焊", "銳", "銴", "銵", "銶", "銷", "銸", "鏽", "銺", "銻", "銼", "銽", "銾", "銿", "鋀", "鋁", "鋂", "鋃", "鋄", "鋅", "鋆", "鋇", "鋉", "鋊", "鋋", "鋌", "鋍", "鋎", "鋏", "鋐", "鋑", "鋒", "鋓", "鋔", "鋕", "鋖", "鋗", "鋘", "鋙", "鋚", "鋛", "鋜", "鋝", "鋞", "鋟", "鋠", "鋡", "鋢", "鋣", "鋤", "鋥", "鋦", "鋧", "鋨", "" , "鋩", "鋪", "鋫", "鋬", "鋭", "鋮", "鋯", "鋰", "鋱", "鋲", "鋳", "鋴", "鋵", "鋶", "鋷", "鋸", "鋹", "鋺", "鑑", "鋼", "鋽", "鋾", "鋿", "錀", "錁", "錂", "錃", "錄", "錅", "錆", "錇", "錈", "錉", "洹", "洧", "洌", "浹", "湞", "洇", "洄", "洙", "洎", "洫", "澮", "洮", "洵", "洚", "瀏", "滸", "潯", "洳", "涑", "浯", "淶", "潿", "浞", "涓", "涔", "濱", "浠", "浼", "浣", "渚", "淇", "淅", "淞", "瀆", "涿", "淠", "澠", "淦", "淝", "淙", "沈", "涫", "淥", "涮", "渫", "湮", "湎", "湫", "溲", "湟", "漵", "湓", "湔", "渲", "渥", "湄", "灩", "溱", "溘", "灄", "漭", "瀅", "溥", "溧", "溽", "溻", "溷", "潷", "溴", "滏", "溏", "滂", "溟", "潢", "瀠", "瀟", "漤", "漕", "滹", "漯", "漶", "瀲", "瀦", "漪", "漉", "漩", "澉", "澍", "澌", "潸", "潲", "潼", "潺", "瀨", "" , "錊", "錋", "錌", "錍", "錎", "錏", "錐", "錑", "錒", "錓", "錔", "錕", "錖", "錗", "錘", "錙", "錚", "錛", "錜", "錝", "錞", "錟", "錠", "錡", "錢", "錣", "錤", "錥", "錦", "錧", "錨", "錩", "錪", "錫", "錬", "錭", "錮", "錯", "錰", "錱", "錄", "錳", "錴", "錵", "表", "錷", "錸", "錹", "錺", "錻", "錼", "錽", "錿", "鍀", "鍁", "鍂", "鍃", "鍄", "鍅", "鍆", "鍇", "鍈", "鍉", "" , "煉", "鍋", "鍌", "鍍", "鍎", "鍏", "鍐", "鍑", "鍒", "鍓", "鍔", "鍕", "鍖", "鍗", "鍘", "鍙", "鍚", "鍛", "鍜", "鍝", "鍞", "鍟", "鍠", "鍡", "鍢", "鍣", "鍤", "鍥", "鍦", "鍧", "鍨", "鍩", "鍫", "濉", "澧", "澹", "澶", "濂", "濡", "濮", "濞", "濠", "濯", "瀚", "瀣", "瀛", "瀹", "瀵", "灝", "灞", "宀", "宄", "宕", "宓", "宥", "宸", "甯", "騫", "搴", "寤", "寮", "褰", "寰", "蹇", "謇", "辶", "迓", "迕", "迥", "迮", "迤", "邇", "迦", "逕", "迨", "逅", "逄", "逋", "邐", "逑", "逍", "逖", "逡", "逵", "逶", "逭", "逯", "遄", "遑", "遒", "遐", "遨", "遘", "遢", "遛", "暹", "遴", "遽", "邂", "邈", "邃", "邋", "彐", "彗", "彖", "彘", "尻", "咫", "屐", "屙", "孱", "屣", "屨", "羼", "弳", "弩", "弭", "艴", "弼", "鬻", "屮", "妁", "妃", "妍", "嫵", "嫗", "妣", "" , "鍬", "鍭", "鍮", "鍯", "鍰", "鍱", "鍲", "鍳", "鍴", "鍵", "鍶", "鍷", "鍸", "鍹", "鍺", "鍻", "針", "鍽", "鐘", "鍿", "鎀", "鎁", "鎂", "鎃", "鎄", "鎅", "鎆", "鎇", "鎈", "鎉", "鎊", "鎋", "鐮", "鎍", "鎎", "鎐", "鎑", "鎒", "鎓", "鎔", "鎕", "鎖", "槍", "鎘", "鎙", "錘", "鎛", "鎜", "鎝", "鎞", "鎟", "鎠", "鎡", "鎢", "鎣", "鎤", "鎥", "鎦", "鎧", "鎨", "鎩", "鎪", "鎫", "" , "鎬", "鎭", "鎮", "鎯", "鎰", "鎱", "鎲", "鎳", "鎴", "鎵", "鎶", "鎷", "鎸", "鎹", "鎺", "鎻", "鎼", "鎽", "鎾", "鎿", "鏀", "鏁", "鏂", "鏃", "鏄", "鏅", "鏆", "鏇", "鏈", "鏉", "鏋", "鏌", "鏍", "妗", "姊", "媯", "妞", "妤", "姒", "妲", "妯", "姍", "妾", "婭", "嬈", "姝", "孌", "姣", "姘", "姹", "娌", "娉", "媧", "嫻", "娑", "娣", "娓", "婀", "婧", "婊", "婕", "娼", "婢", "嬋", "胬", "媼", "媛", "婷", "婺", "媾", "嫫", "媲", "嬡", "嬪", "媸", "嫠", "嫣", "嬙", "嫖", "嫦", "嫘", "嫜", "嬉", "嬗", "嬖", "嬲", "嬤", "孀", "尕", "嘎", "孚", "孥", "孳", "孑", "孓", "孢", "駔", "駟", "駙", "騶", "驛", "駑", "駘", "驍", "驊", "駢", "驪", "騏", "騍", "騅", "驂", "騭", "騖", "驁", "騮", "騸", "驃", "驄", "驏", "驥", "驤", "纟", "紆", "紂", "紇", "紈", "纊", "" , "鏎", "鏏", "鏐", "鏑", "鏒", "鏓", "鏔", "鏕", "鏗", "鏘", "鏙", "鏚", "鏛", "鏜", "鏝", "鏞", "鏟", "鏠", "鏡", "鏢", "鏣", "鏤", "鏥", "鏦", "鏧", "鏨", "鏩", "鏪", "鏫", "鏬", "鏭", "鏮", "鏯", "鏰", "鏱", "鏲", "鏳", "鏴", "鏵", "鏶", "鏷", "鏸", "鏹", "鏺", "鏻", "鏼", "鏽", "鏾", "鏿", "鐀", "鐁", "鐂", "鐃", "鐄", "鐅", "鐆", "鐇", "鐈", "銑", "鐊", "鐋", "鐌", "鐍", "" , "鐎", "鐏", "鐐", "鐑", "鐒", "鐓", "鐔", "鐕", "鐖", "鐗", "鐘", "鐙", "鐚", "鐛", "鐜", "鐝", "鐞", "鐟", "鐠", "鐡", "鐢", "鐣", "鐤", "鐥", "鐦", "鐧", "鐨", "鐩", "鐪", "鐫", "鐬", "鐭", "鐮", "紜", "紕", "紓", "紺", "紲", "紱", "縐", "紼", "絀", "紿", "絝", "絎", "絳", "綆", "綃", "綈", "綾", "綺", "緋", "緔", "緄", "綞", "綬", "綹", "綣", "綰", "緇", "緙", "緗", "緹", "緲", "繢", "緦", "緶", "緱", "縋", "緡", "縉", "縝", "縟", "縞", "縭", "縊", "縑", "繽", "縹", "縵", "縲", "繆", "繅", "纈", "繚", "繒", "韁", "繾", "繰", "繯", "纘", "幺", "畿", "巛", "甾", "邕", "玎", "璣", "瑋", "玢", "玟", "玨", "珂", "瓏", "玷", "玳", "珀", "玟", "珈", "珥", "珙", "頊", "琊", "珩", "珧", "珞", "璽", "琿", "璉", "琪", "瑛", "琦", "琥", "琨", "琰", "琮", "琬", "" , "鐯", "鐰", "鐱", "鐲", "鐳", "鐴", "鐵", "鐶", "鐷", "鐸", "鐹", "鐺", "鐻", "鐼", "鐽", "鐿", "鑀", "鑁", "鑂", "鑃", "鑄", "鑅", "鑆", "鑇", "鑈", "鑉", "鑊", "鑋", "鑌", "鑍", "鑎", "鑏", "鑐", "鑑", "鑑", "鑓", "鑔", "鑕", "鑖", "鑗", "鑘", "鑙", "鑚", "鑛", "鑜", "鑝", "鑞", "鑟", "鑠", "鑡", "鑢", "鑣", "刨", "鑥", "鑦", "鑧", "鑨", "鑩", "爐", "鑬", "鑭", "鑮", "鑯", "" , "鑰", "鑱", "鑲", "鑳", "鑴", "罐", "鑶", "鑷", "鑸", "鑹", "鑺", "鑻", "鑼", "鑽", "鑾", "鑿", "钀", "钁", "钂", "钃", "钄", "钑", "鍚", "鈃", "铇", "鉶", "鋩", "铔", "铚", "铦", "铻", "錡", "锠", "琛", "琚", "瑁", "瑜", "瑗", "瑕", "瑙", "璦", "瑭", "瑾", "璜", "瓔", "璀", "璁", "璇", "璋", "璞", "璨", "璩", "璐", "璧", "瓚", "璺", "韙", "韞", "韜", "杌", "杓", "杞", "杈", "榪", "櫪", "枇", "杪", "杳", "枘", "梘", "杵", "棖", "樅", "梟", "枋", "杷", "杼", "柰", "櫛", "柘", "櫳", "柩", "枰", "櫨", "柙", "枵", "柚", "枳", "柝", "梔", "柃", "枸", "柢", "櫟", "柁", "檉", "栲", "栳", "椏", "橈", "桎", "楨", "桄", "榿", "梃", "栝", "桕", "樺", "桁", "檜", "桀", "欒", "桊", "桉", "栩", "梵", "梏", "桴", "桷", "梓", "桫", "櫺", "楮", "棼", "櫝", "槧", "棹", "" , "鑕", "锳", "锽", "鎡", "镈", "钂", "鎔", "鏰", "镠", "鐶", "鑞", "镵", "長", "镸", "镹", "镺", "镻", "镼", "镽", "镾", "門", "閁", "閂", "閃", "閄", "閅", "閆", "閇", "閈", "閉", "閊", "開", "閌", "閍", "閎", "閏", "閐", "閒", "閒", "間", "閔", "閕", "閖", "閗", "閘", "閙", "閚", "閛", "閜", "閝", "閞", "閟", "閠", "閡", "関", "閣", "合", "閥", "閦", "哄", "閨", "閩", "閪", "" , "閫", "閬", "閭", "閮", "閯", "閰", "閱", "閲", "閳", "閴", "閵", "閶", "閷", "閸", "閹", "閺", "閻", "閼", "閽", "閾", "閿", "闀", "闁", "闂", "闃", "闄", "闅", "板", "暗", "闈", "闉", "闊", "闋", "欏", "棰", "椋", "槨", "楗", "棣", "椐", "楱", "椹", "楠", "楂", "楝", "欖", "楫", "榀", "矩", "楸", "椴", "槌", "櫬", "櫚", "槎", "櫸", "楦", "楣", "楹", "榛", "榧", "榻", "榫", "榭", "槔", "榱", "槁", "槊", "檳", "榕", "櫧", "榍", "槿", "檣", "槭", "樗", "樘", "櫫", "槲", "橄", "樾", "檠", "橐", "橛", "樵", "檎", "櫓", "樽", "樨", "橘", "櫞", "檑", "簷", "檁", "檗", "檫", "猷", "獒", "歿", "殂", "殤", "殄", "殞", "殮", "殍", "殫", "殛", "殯", "殪", "軔", "軛", "軲", "軻", "轤", "軹", "軼", "軫", "軤", "轢", "軺", "軾", "輊", "輇", "輅", "輒", "輦", "輞", "" , "闌", "闍", "闎", "闏", "闐", "闑", "闒", "闓", "闔", "闕", "闖", "闗", "闘", "闙", "闚", "闛", "關", "闝", "闞", "闟", "闠", "闡", "辟", "闣", "闤", "闥", "闦", "闧", "闬", "闓", "阇", "阓", "阘", "阛", "阞", "阠", "阣", "阤", "阥", "阦", "阧", "厄", "阩", "阫", "坑", "阭", "址", "阰", "阷", "阸", "阹", "阺", "阾", "陁", "陃", "陊", "陎", "隋", "陑", "陒", "陓", "陖", "陗", "" , "陘", "陙", "陚", "陜", "陝", "升", "陠", "陣", "陥", "陦", "陫", "陭", "陮", "陯", "陰", "陱", "陳", "陸", "陹", "険", "陻", "陼", "陽", "陾", "陿", "隀", "隁", "隂", "隃", "堤", "隇", "隉", "隊", "輟", "輜", "輳", "轆", "轔", "軎", "戔", "戧", "戛", "戟", "戢", "戡", "戥", "戤", "戩", "臧", "甌", "瓴", "瓿", "甏", "甑", "甓", "攴", "旮", "旯", "旰", "昊", "曇", "杲", "昃", "昕", "昀", "炅", "曷", "昝", "昴", "昱", "昶", "暱", "耆", "晟", "曄", "晁", "晏", "暉", "晡", "晗", "晷", "暄", "暌", "曖", "暝", "暾", "曛", "曜", "曦", "曩", "賁", "貰", "貺", "貽", "贄", "貲", "賅", "贐", "賑", "賚", "賕", "齎", "賧", "賻", "覘", "覬", "覡", "覿", "覦", "覯", "覲", "覷", "牮", "犟", "牝", "犛", "牯", "牾", "牿", "犄", "犋", "犍", "犏", "犒", "挈", "挲", "掰", "" , "隌", "階", "隑", "隒", "隓", "隕", "隖", "隚", "際", "隝", "隞", "隟", "隠", "隡", "隢", "隣", "頹", "隥", "隦", "隨", "隩", "險", "隫", "隬", "隭", "隮", "隯", "隱", "隲", "隴", "隵", "隷", "隸", "隺", "只", "隿", "雂", "雃", "雈", "雊", "雋", "雐", "雑", "雓", "雔", "雖", "雗", "雘", "雙", "雚", "雛", "雜", "雝", "雞", "雟", "雡", "離", "難", "雤", "雥", "雦", "雧", "雫", "" , "雬", "雭", "雮", "雰", "雱", "云", "雴", "雵", "雸", "雺", "電", "雼", "雽", "雿", "霂", "霃", "霅", "霊", "霋", "霌", "霐", "霑", "霒", "霔", "霕", "霗", "霘", "霙", "霚", "霛", "霝", "霟", "霠", "搿", "擘", "耄", "毪", "毳", "毽", "毿", "毹", "氅", "氌", "氆", "氍", "氕", "氘", "氙", "氚", "氡", "氬", "氤", "氪", "氳", "攵", "敕", "敫", "牘", "牒", "牖", "爰", "虢", "刖", "肟", "肜", "肓", "肼", "朊", "肽", "肱", "肫", "肭", "肴", "肷", "朧", "腖", "胩", "臚", "胛", "胂", "胄", "胙", "胍", "胗", "朐", "胝", "脛", "胱", "胴", "胭", "膾", "脎", "胲", "胼", "朕", "脒", "豚", "腡", "脞", "脬", "脘", "脲", "腈", "醃", "腓", "腴", "腙", "腚", "腱", "腠", "腩", "靦", "膃", "顎", "腧", "塍", "媵", "膈", "膂", "臏", "滕", "膣", "膪", "臌", "朦", "臊", "羶", "" , "霡", "霢", "霣", "溜", "霥", "霦", "霧", "霨", "霩", "霫", "霬", "霮", "霯", "霱", "霳", "霴", "霵", "霶", "霷", "霺", "霻", "霼", "霽", "霿", "靀", "靁", "靂", "靃", "靄", "靅", "靆", "靇", "靈", "靉", "靊", "靋", "靌", "靍", "靎", "靏", "靐", "靑", "靔", "靕", "靗", "靘", "靚", "靜", "靝", "靟", "面", "靤", "靦", "靧", "靨", "靪", "靫", "靬", "靭", "靮", "靯", "靰", "靱", "" , "靲", "靵", "靷", "靸", "靹", "靺", "靻", "靽", "靾", "靿", "鞀", "鞁", "鞂", "鞃", "鞄", "鞆", "鞇", "鞈", "鞉", "鞊", "鞌", "鞎", "鞏", "鞐", "鞓", "鞕", "鞖", "鞗", "鞙", "鞚", "鞛", "鞜", "鞝", "臁", "膦", "歟", "欷", "欹", "歃", "歆", "歙", "颮", "颯", "颶", "颼", "飆", "飈", "殳", "彀", "轂", "觳", "斐", "齏", "斕", "於", "旆", "旄", "旃", "旌", "旎", "旒", "旖", "煬", "煒", "燉", "熗", "炻", "烀", "炷", "炫", "炱", "燁", "烊", "焐", "焓", "燜", "焯", "焱", "煳", "煜", "煨", "鍛", "煲", "煊", "煸", "煺", "熘", "熳", "熵", "熨", "熠", "燠", "燔", "燧", "燹", "爝", "爨", "灬", "燾", "煦", "熹", "戾", "戽", "扃", "扈", "扉", "礻", "祀", "祆", "祉", "祛", "祜", "祓", "祚", "祢", "祗", "祠", "禎", "祧", "祺", "禪", "禊", "禚", "禧", "禳", "忑", "忐", "" , "鞞", "鞟", "鞡", "鞢", "鞤", "鞥", "秋", "鞧", "鞨", "鞩", "鞪", "鞬", "鞮", "鞰", "鞱", "鞳", "鞵", "鞶", "鞷", "鞸", "鞹", "鞺", "鞻", "鞼", "鞽", "鞾", "鞿", "韀", "韁", "韂", "韃", "韄", "韅", "千", "韇", "韈", "韉", "韊", "韋", "韌", "韍", "韎", "韏", "韐", "韑", "韒", "韓", "韔", "韕", "韖", "韗", "韘", "韙", "韚", "韛", "韜", "韝", "韞", "韟", "韠", "韡", "韢", "韣", "" , "韤", "韥", "韍", "韮", "韯", "韰", "韱", "韲", "韴", "韷", "韸", "韹", "韺", "韻", "韼", "韽", "韾", "響", "頀", "頁", "頂", "頃", "頄", "項", "順", "頇", "須", "頉", "頊", "頋", "頌", "頍", "頎", "懟", "恝", "恚", "恧", "恁", "恙", "恣", "愨", "愆", "愍", "慝", "憩", "憝", "懋", "懣", "戇", "聿", "聿", "沓", "澩", "淼", "磯", "矸", "碭", "砉", "硨", "砘", "砑", "斫", "砭", "碸", "砝", "砹", "礪", "礱", "砟", "砼", "砥", "砬", "砣", "砩", "硎", "硭", "硤", "磽", "砦", "硐", "硇", "硌", "硪", "磧", "碓", "碚", "碇", "磣", "碡", "碣", "碲", "碹", "碥", "磔", "磙", "磉", "磬", "磲", "礅", "磴", "礓", "礤", "礞", "礴", "龕", "黹", "黻", "黼", "盱", "眄", "瞘", "盹", "眇", "眈", "眚", "眢", "眙", "眭", "眥", "眵", "眸", "睞", "瞼", "睇", "睃", "睚", "睨", "" , "頏", "預", "頑", "頒", "頓", "頔", "頕", "頖", "頗", "領", "頙", "頚", "頛", "頜", "頝", "頞", "頟", "頠", "頡", "頢", "頣", "頤", "頥", "頦", "頧", "頨", "頩", "頪", "俯", "頬", "頭", "頮", "頯", "頰", "頱", "頲", "頳", "頴", "頵", "頶", "頷", "頸", "頹", "頺", "頻", "頼", "頽", "頾", "頿", "顀", "顁", "顂", "顃", "顄", "顅", "顆", "顇", "顈", "顉", "顊", "顋", "題", "額", "" , "顎", "顏", "顐", "顑", "顒", "顓", "顏", "顕", "顖", "顗", "願", "顙", "顚", "顛", "顜", "顝", "類", "顟", "顠", "顡", "顢", "顣", "顤", "顥", "顦", "顧", "顨", "顩", "顪", "顫", "顬", "顭", "顮", "睢", "睥", "睿", "瞍", "睽", "瞀", "瞌", "瞑", "瞟", "瞠", "瞰", "瞵", "瞽", "町", "畀", "畎", "畋", "畈", "畛", "畬", "畹", "疃", "罘", "罡", "罟", "詈", "罨", "羆", "罱", "罹", "羈", "罾", "盍", "盥", "蠲", "钅", "釓", "釔", "釙", "釗", "釕", "釷", "釧", "釤", "鍆", "釵", "釹", "鈈", "鈦", "鉅", "鈑", "鈐", "鈁", "鈧", "鈄", "鈥", "鈀", "鈺", "鉦", "鈷", "鈳", "鉕", "鈽", "鈸", "鉞", "鉬", "鉭", "鈿", "鑠", "鈰", "鉉", "鉈", "鉍", "鈮", "鈹", "鐸", "銬", "銠", "鉺", "銪", "鋮", "鋏", "鐃", "鋣", "鐺", "銱", "銦", "鎧", "銖", "鋌", "銩", "鏵", "銓", "鉿", "" , "顯", "顰", "顱", "顲", "顳", "顴", "頲", "颎", "颒", "颕", "顒", "颣", "風", "颩", "颪", "颫", "颬", "颭", "颮", "颯", "颰", "台", "颲", "刮", "颴", "颵", "颶", "颷", "颸", "颹", "揚", "颻", "颼", "颽", "颾", "颿", "飀", "飁", "飂", "飃", "飄", "飅", "飆", "飇", "飈", "飉", "飊", "飋", "飌", "飍", "飏", "飐", "颸", "飖", "飀", "飛", "飜", "飝", "飠", "飡", "飢", "飣", "飤", "" , "飥", "飦", "飩", "飪", "飫", "飬", "飭", "飮", "飯", "飰", "飱", "飲", "飳", "飴", "飵", "飶", "飷", "飸", "飹", "飺", "飻", "飼", "飽", "飾", "飿", "餀", "餁", "餂", "餃", "餄", "餅", "餆", "餇", "鎩", "銚", "錚", "銫", "銃", "鐋", "銨", "銣", "鐒", "錸", "鋱", "鏗", "鋥", "鋰", "鋯", "鋨", "銼", "鋝", "鋶", "鐦", "鐧", "鋃", "鋟", "鋦", "錒", "錆", "鍩", "錛", "鍀", "錁", "錕", "錮", "鍃", "錇", "錈", "錟", "錙", "鍥", "鍇", "鍶", "鍔", "鍤", "鎪", "鍰", "鎄", "鏤", "鏘", "鐨", "鎇", "鏌", "鎘", "鐫", "鎿", "鎦", "鎰", "鎵", "鑌", "鏢", "鏜", "鏝", "鏍", "鏞", "鏃", "鏇", "鏑", "鐔", "鐝", "鏷", "鑥", "鐓", "鑭", "鐠", "鑹", "鏹", "鐙", "鑊", "鐲", "鐿", "鑔", "鑣", "鐘", "矧", "矬", "雉", "秕", "秭", "秣", "秫", "稆", "嵇", "稃", "稂", "稞", "稔", "" , "餈", "餉", "養", "餋", "餌", "餎", "餏", "餑", "餒", "餓", "哺", "餕", "餖", "餗", "余", "餙", "肴", "餛", "餜", "餝", "餞", "餟", "餠", "餡", "餢", "餣", "餤", "餥", "餦", "餧", "館", "餩", "餪", "餫", "糊", "餭", "餯", "餰", "餱", "餲", "餳", "餴", "喂", "餶", "餷", "餸", "餹", "餺", "餻", "餼", "饋", "餾", "餿", "饀", "饁", "饂", "饃", "饄", "饅", "饆", "饇", "饈", "饉", "" , "饊", "饋", "饌", "饍", "饎", "饏", "饐", "飢", "饒", "饓", "饖", "饗", "饘", "饙", "饚", "饛", "饜", "饝", "饞", "饟", "饠", "饡", "饢", "饤", "飥", "飿", "餄", "餎", "餏", "饾", "馂", "餜", "餶", "稹", "稷", "穡", "黏", "馥", "穰", "皈", "皎", "皓", "皙", "皤", "瓞", "瓠", "甬", "鳩", "鳶", "鴇", "鴆", "鴣", "鶇", "鸕", "鴝", "鴟", "鷥", "鴯", "鷙", "鴰", "鵂", "鸞", "鵓", "鸝", "鵠", "鵒", "鷴", "鵜", "鵡", "鶓", "鵪", "鵯", "鶉", "鶘", "鶚", "鶿", "鶥", "鶩", "鷂", "鶼", "鸚", "鷓", "鷚", "鷯", "鷦", "鷲", "鷸", "鸌", "鷺", "鸛", "疒", "疔", "癤", "癘", "疝", "癧", "疣", "疳", "痾", "疸", "痄", "皰", "疰", "痃", "痂", "瘂", "痍", "痣", "癆", "痦", "痤", "癇", "痧", "瘃", "痱", "痼", "痿", "瘐", "瘀", "癉", "瘌", "瘞", "瘊", "瘥", "瘻", "瘕", "瘙", "" , "馌", "餺", "馚", "馛", "馜", "馝", "馞", "馟", "馠", "馡", "馢", "馣", "馤", "馦", "馧", "馩", "馪", "馫", "馬", "馭", "馮", "馯", "馰", "馱", "馲", "馳", "馴", "馵", "馶", "馷", "馸", "馹", "馺", "馻", "馼", "馽", "馾", "馿", "駀", "駁", "駂", "駃", "駄", "駅", "駆", "駇", "駈", "駉", "駊", "駋", "駌", "駍", "駎", "駏", "駐", "駑", "駒", "駓", "駔", "駕", "駖", "駗", "駘", "" , "駙", "駚", "駛", "駜", "駝", "駞", "駟", "駠", "駡", "駢", "駣", "駤", "駥", "駦", "駧", "駨", "駩", "駪", "駫", "駬", "駭", "駁", "駯", "駰", "駱", "駲", "駳", "駴", "駵", "駶", "駷", "駸", "駹", "瘛", "瘼", "瘢", "瘠", "癀", "瘭", "瘰", "癭", "瘵", "癃", "癮", "瘳", "癍", "癩", "癔", "癜", "癖", "癲", "癯", "翊", "竦", "穸", "穹", "窀", "窆", "窈", "窕", "竇", "窠", "窬", "窨", "窶", "窳", "衤", "衩", "衲", "衽", "衿", "袂", "袢", "襠", "袷", "袼", "裉", "褳", "裎", "襝", "襉", "裱", "褚", "裼", "裨", "裾", "裰", "褡", "褙", "褓", "褸", "褊", "襤", "褫", "褶", "襁", "襦", "襻", "疋", "胥", "皸", "皴", "矜", "耒", "耔", "耖", "耜", "耠", "耮", "耥", "耦", "耬", "耩", "耨", "耱", "耋", "耵", "聃", "聆", "聹", "聒", "聵", "聱", "覃", "頇", "頎", "頏", "" , "駺", "駻", "駼", "駽", "駾", "駿", "騀", "騁", "騂", "呆", "騄", "騅", "騆", "騇", "騈", "騉", "騊", "騋", "騌", "騍", "騎", "騏", "騐", "騑", "騒", "験", "騔", "騕", "騖", "騗", "騘", "騙", "騚", "騛", "騜", "騝", "騞", "騟", "騠", "騡", "騢", "鬃", "騤", "騥", "騦", "騧", "騨", "騩", "騪", "騫", "騬", "騭", "騮", "騯", "騰", "騱", "騲", "騳", "騴", "騵", "騶", "騷", "騸", "" , "騹", "騺", "騻", "騼", "騽", "騾", "騿", "驀", "驁", "驂", "驃", "驄", "驅", "驆", "驇", "驈", "驉", "驊", "驋", "驌", "驍", "驎", "驏", "驐", "驑", "驒", "驓", "驔", "驕", "驖", "驗", "驘", "驙", "頡", "頜", "潁", "頦", "頷", "顎", "顓", "顳", "顢", "顙", "顥", "顬", "顰", "虍", "虔", "虯", "蟣", "蠆", "虺", "虼", "虻", "蚨", "蚍", "蚋", "蜆", "蚝", "蚧", "蚣", "蚪", "蚓", "蚩", "蚶", "蛄", "蚵", "蠣", "蚰", "蚺", "蚱", "蚯", "蛉", "蟶", "蚴", "蛩", "蛺", "蟯", "蛭", "螄", "蛐", "蜓", "蛞", "蠐", "蛟", "蛘", "蛑", "蜃", "蜇", "蛸", "蜈", "蜊", "蜍", "蜉", "蜣", "蜻", "蜞", "蜥", "蜮", "蜚", "蜾", "蟈", "蜴", "蜱", "蜩", "蜷", "蜿", "螂", "蜢", "蝽", "蠑", "蝻", "蝠", "虺", "蝌", "蝮", "螋", "蝓", "蝣", "螻", "蝤", "蝙", "蝥", "螓", "螯", "蟎", "蟒", "" , "驚", "驛", "驜", "驝", "驞", "驟", "驠", "驡", "驢", "驣", "驤", "驥", "驦", "驧", "驨", "驩", "驪", "驫", "驲", "骃", "骉", "骍", "駸", "骔", "骕", "骙", "骦", "骩", "骪", "骫", "骬", "骭", "骮", "骯", "骲", "骳", "骴", "骵", "骹", "骻", "骽", "骾", "骿", "髃", "髄", "髆", "髇", "髈", "髉", "髊", "髍", "髎", "髏", "髐", "髒", "體", "髕", "髖", "髗", "髙", "髚", "髛", "髜", "" , "髝", "髞", "髠", "髢", "仿", "髤", "髥", "髧", "髨", "髩", "髪", "髬", "發", "髰", "髱", "髲", "髳", "髴", "髵", "髶", "髷", "髸", "髺", "髼", "髽", "髾", "髿", "鬀", "鬁", "鬂", "鬄", "鬅", "松", "蟆", "螈", "螅", "螭", "螗", "螃", "螫", "蟥", "螬", "螵", "螳", "蟋", "蟓", "螽", "蟑", "蟀", "蟊", "蟛", "蟪", "蟠", "蟺", "蠖", "蠓", "蟾", "蠊", "蠛", "蠡", "蠹", "蠼", "缶", "罌", "罄", "罅", "舐", "竺", "竽", "笈", "篤", "笄", "筧", "笊", "笫", "笏", "筇", "笸", "笪", "笙", "笮", "笱", "笠", "笥", "笤", "笳", "籩", "笞", "筘", "篳", "筅", "筵", "筌", "箏", "筠", "筮", "筻", "筢", "筲", "筱", "箐", "簀", "篋", "箸", "箬", "箝", "籜", "箅", "簞", "箜", "箢", "簫", "箴", "簣", "篁", "篌", "篝", "篚", "篥", "篦", "篪", "簌", "篾", "篼", "簏", "籪", "簋", "" , "鬇", "鬉", "鬊", "鬋", "鬌", "胡", "鬎", "鬐", "鬑", "鬒", "鬔", "鬕", "鬖", "鬗", "鬘", "鬙", "須", "鬛", "鬜", "鬝", "鬞", "鬠", "鬡", "鬢", "鬤", "斗", "鬦", "鬧", "哄", "鬩", "鬪", "鬫", "鬬", "鬭", "鬮", "鬰", "郁", "鬳", "鬴", "鬵", "鬶", "鬷", "鬸", "鬹", "鬺", "鬽", "鬾", "鬿", "魀", "魆", "魊", "魋", "魌", "魎", "魐", "魒", "魓", "魕", "魖", "魗", "魘", "魙", "魚", "" , "魛", "魜", "魝", "魞", "魟", "魠", "魡", "魢", "魣", "魤", "魥", "魦", "魧", "豚", "魩", "魪", "魫", "魬", "魭", "魮", "魯", "魰", "魱", "魲", "魳", "魴", "魵", "魶", "魷", "魸", "魹", "魺", "魻", "簟", "簪", "簦", "簸", "籟", "籀", "臾", "舁", "舂", "舄", "臬", "衄", "舡", "舢", "艤", "舭", "舯", "舨", "舫", "舸", "艫", "舳", "舴", "舾", "艄", "艉", "艋", "艏", "艚", "艟", "艨", "衾", "裊", "袈", "裘", "裟", "襞", "羝", "羥", "羧", "羯", "羰", "羲", "秈", "敉", "粑", "糲", "糶", "粞", "粢", "粲", "粼", "粽", "糝", "餱", "糌", "餈", "糈", "糅", "糗", "糨", "艮", "暨", "羿", "翎", "翕", "翥", "翡", "翦", "翩", "翮", "翳", "糸", "縶", "綦", "綮", "繇", "纛", "麩", "麴", "赳", "趄", "趔", "趑", "趲", "赧", "赭", "豇", "豉", "酊", "酐", "酎", "酏", "酤", "" , "魼", "魽", "魾", "魿", "鮀", "鮁", "鮂", "鮃", "鮄", "鮅", "鮆", "鮇", "鮈", "鮉", "鮊", "鮋", "鮌", "鮍", "鮎", "鮏", "鮐", "鮑", "鮒", "鮓", "鮔", "鮕", "鮖", "鮗", "鮘", "鮙", "鮚", "鮛", "鮜", "鮝", "鮞", "鮟", "鮠", "鮡", "鮢", "鮣", "鮤", "鮥", "鮦", "鮧", "鮨", "鮩", "鮪", "鮫", "鮬", "鮭", "鮮", "鮯", "鮰", "鮱", "鮲", "鮳", "鮴", "鮵", "鮶", "鮷", "鮸", "鮹", "鮺", "" , "鮻", "鮼", "鮽", "鮾", "鮿", "鯀", "鯁", "鯂", "鯃", "鯄", "鯅", "鯆", "鯇", "鯈", "鯉", "鯊", "鯋", "鯌", "鯍", "鯎", "鯏", "鯐", "鯑", "鯒", "鯓", "鯔", "鯕", "鯖", "鯗", "鯘", "鯙", "鯚", "鯛", "酢", "酡", "酰", "酩", "酯", "釅", "釃", "酲", "酴", "酹", "醌", "醅", "醐", "醍", "醑", "醢", "醣", "醪", "醭", "醮", "醯", "醵", "醴", "醺", "豕", "鹺", "躉", "跫", "踅", "蹙", "蹩", "趵", "趿", "趼", "趺", "蹌", "跖", "跗", "跚", "躒", "跎", "跏", "跛", "跆", "跬", "蹺", "蹕", "跣", "躚", "躋", "跤", "踉", "跽", "踔", "踝", "踟", "躓", "踮", "踣", "躑", "踺", "蹀", "踹", "踵", "踽", "踱", "蹉", "蹁", "蹂", "躡", "蹣", "蹊", "躕", "蹶", "蹼", "蹯", "蹴", "躅", "躪", "躔", "躐", "躦", "躞", "豸", "貂", "貊", "貅", "貘", "貔", "斛", "觖", "觴", "觚", "觜", "" , "鯜", "鯝", "鯞", "鯟", "鯠", "鯡", "鯢", "鯣", "鯤", "鯥", "鯦", "鯧", "鯨", "鯩", "鯪", "鯫", "鯬", "鯭", "鯮", "鯯", "鯰", "鯱", "鯲", "鯳", "鯴", "鯵", "鯶", "鯷", "鯸", "鯹", "鯺", "鯻", "鯼", "鯽", "鯾", "鯿", "鰀", "鰁", "鰂", "鰃", "鰄", "鰅", "鰆", "鰇", "鰈", "鰉", "鰊", "鰋", "鰌", "鰍", "鰎", "鰏", "鰐", "鰑", "鰒", "鰓", "鰔", "鰕", "鰖", "鰗", "鰘", "鰙", "鰚", "" , "鰛", "鰜", "鰝", "鰞", "鰟", "鰠", "鰡", "鰢", "鰣", "鰤", "鰥", "鰦", "鰧", "鰨", "鰩", "鰪", "鰫", "鰬", "鰭", "鰮", "鰯", "鰰", "鰱", "鰲", "鰳", "鰴", "鰵", "鰶", "鰷", "鰸", "鰹", "鰺", "鰻", "觥", "觫", "觶", "訾", "謦", "靚", "雩", "靂", "雯", "霆", "霽", "霈", "霏", "霎", "霪", "靄", "霰", "霾", "齔", "齟", "齙", "齠", "齜", "齦", "齬", "齪", "齷", "黽", "黿", "鼉", "隹", "隼", "雋", "雎", "雒", "瞿", "讎", "銎", "鑾", "鋈", "鏨", "鍪", "鏊", "鎏", "鐾", "鑫", "魷", "魴", "鮁", "鮃", "鯰", "鱸", "穌", "鮒", "鱟", "鮐", "鮭", "鮚", "鮪", "鮞", "鱭", "鮫", "鯗", "鱘", "鯁", "鱺", "鰱", "鰹", "鰣", "鰷", "鯀", "鯊", "鯇", "鯽", "鯖", "鯪", "鯫", "鯡", "鯤", "鯧", "鯝", "鯢", "鯰", "鯛", "鯴", "鯔", "鱝", "鰈", "鱷", "鰍", "鰒", "鰉", "鯿", "鰠", "" , "鰼", "鰽", "鰾", "鰿", "鱀", "鱁", "鱂", "鱃", "鱄", "鱅", "鱆", "鱇", "鱈", "鱉", "鱊", "鱋", "鱌", "鱍", "鱎", "鱏", "鱐", "鱑", "鱒", "鱓", "鱔", "鱕", "鱖", "鱗", "鱘", "鱙", "鱚", "鱛", "鱜", "鱝", "鱞", "鱟", "鱠", "鱡", "鱢", "鱣", "鱤", "鱥", "鱦", "鱧", "鱨", "鱩", "鱪", "鱫", "鱬", "鱭", "鱮", "鱯", "鱰", "鱱", "鱲", "鱳", "鱴", "鱵", "鱶", "鱷", "鱸", "鱹", "鱺", "" , "鱻", "魛", "鱾", "鲀", "鲃", "鲄", "鲉", "鮓", "鲌", "鮍", "鲓", "鮦", "鰂", "鲘", "鱠", "鮺", "鲪", "鲬", "鲯", "鲹", "鲾", "鱨", "鳀", "鰛", "鳂", "鳈", "鳉", "鰟", "鰜", "鳚", "鰼", "鳠", "鳡", "鰲", "鰭", "鰨", "鰥", "鰩", "鰳", "鰾", "鱈", "鰻", "鰵", "鱅", "鱖", "鱔", "鱒", "鱧", "靼", "鞅", "韃", "橇", "鞔", "韉", "鞫", "鞣", "鞲", "鞴", "骱", "骰", "骷", "鶻", "骶", "骺", "骼", "髁", "髀", "髏", "髂", "髖", "髕", "髑", "魅", "魃", "魘", "魎", "魈", "魍", "魑", "饗", "饜", "餮", "饕", "饔", "髟", "髡", "髦", "髯", "髫", "髻", "髭", "髹", "鬈", "鬏", "鬢", "鬟", "鬣", "麼", "麾", "縻", "麂", "麇", "麈", "麋", "麒", "鏖", "麝", "麟", "黛", "黜", "黝", "黠", "黟", "黢", "黷", "黧", "黥", "黲", "黯", "鼢", "鼬", "鼯", "鼴", "鼷", "鼽", "鼾", "齄", "" , "鱣", "鳤", "鳥", "鳦", "鳧", "鳨", "鳩", "鳪", "鳫", "鳬", "鳭", "鳮", "鳯", "鳰", "鳱", "鳲", "鳳", "鳴", "鳵", "鳶", "鳷", "鳸", "鳹", "鳺", "鳻", "鳼", "鳽", "鳾", "鳿", "鴀", "鴁", "鴂", "鴃", "鴄", "鴅", "鴆", "鴇", "雁", "鴉", "鴊", "鴋", "鴌", "鴍", "鴎", "鴏", "鴐", "鴑", "鴒", "鴓", "鴔", "鴕", "鴖", "鴗", "鴘", "鴙", "鴚", "鴛", "鴜", "鴝", "鴞", "鴟", "鴠", "鴡", "" , "鴢", "鴣", "鴤", "鴥", "鴦", "鴧", "鴨", "鴩", "鴪", "鴫", "鴬", "鴭", "鴮", "鴯", "鴰", "鴱", "鴲", "鴳", "鴴", "鴵", "鴶", "鴷", "鴸", "鴹", "鴺", "鴻", "鴼", "鴽", "鴾", "鴿", "鵀", "鵁", "鵂", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" , "鵃", "鵄", "鵅", "鵆", "鵇", "鵈", "鵉", "鵊", "鵋", "鵌", "鵍", "鵎", "鵏", "鵐", "鵑", "鵒", "鵓", "鵔", "鵕", "鵖", "鵗", "鵘", "鵙", "鵚", "鵛", "鵜", "鵝", "鵞", "鵟", "鵠", "鵡", "鵢", "鵣", "鵤", "鵥", "鵦", "鵧", "鵨", "鵩", "鵪", "鵫", "鵬", "鵭", "鵮", "鵯", "雕", "鵱", "鵲", "鵳", "鵴", "鵵", "鵶", "鵷", "鵸", "鵹", "鵺", "鵻", "鵼", "鵽", "鵾", "鵿", "鶀", "鶁", "" , "鶂", "鶃", "鶄", "鶅", "鶆", "鶇", "鶈", "鶉", "鶊", "鶋", "鶌", "鶍", "鶎", "雞", "鶐", "鶑", "鶒", "鶓", "鶔", "鶕", "鶖", "鶗", "鶘", "鶙", "鶚", "鶛", "鶜", "鶝", "鶞", "鶟", "鶠", "鶡", "鶢", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" , "鶣", "鶤", "鶥", "鶦", "鶧", "鶨", "鶩", "鶪", "鶫", "鶬", "鶭", "鶮", "鶯", "鶰", "騫", "鶲", "鶳", "鶴", "鶵", "鶶", "鶷", "鶸", "鶹", "鶺", "鶻", "鶼", "鶽", "鶾", "鶿", "鷀", "鷁", "鷂", "鷃", "雞", "鷅", "鷆", "鷇", "鷈", "鷉", "鷊", "鷋", "鷌", "鷍", "鷎", "鷏", "鷐", "鷑", "鷒", "鷓", "鷔", "鷕", "鷖", "鷗", "鷘", "鷙", "鷚", "鷛", "鷜", "鷝", "鷞", "鷟", "鷠", "鷡", "" , "鷢", "鷣", "鷤", "鷥", "鷦", "鷧", "鷨", "鷩", "鷪", "鷫", "鷬", "鷭", "鷮", "鷯", "燕", "鷱", "鷲", "鷴", "鷴", "鷵", "鷶", "鷷", "鷸", "鷹", "鷺", "鷻", "鷼", "鷽", "鷾", "鷿", "鸀", "鸁", "鸂", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" , "鸃", "鸄", "鸅", "鸆", "鸇", "鸈", "鸉", "鸊", "鸋", "鸌", "鸍", "鸎", "鸏", "鸐", "鸑", "鸒", "鸓", "鸔", "鸕", "鸖", "鸗", "鸘", "鸙", "鸚", "鸛", "鸜", "鸝", "鸞", "鸤", "鶬", "鴞", "鴒", "鸴", "鴴", "鵃", "鹀", "鹍", "鵮", "鶊", "鹓", "鹔", "鶡", "鶖", "鹝", "鹟", "鹠", "鶺", "鹢", "鷖", "鹮", "鸇", "鹲", "鹴", "鹵", "鹶", "鹷", "鹸", "咸", "鹺", "鹻", "鹼", "鹽", "麀", "" , "麁", "麃", "麄", "麅", "麆", "麉", "麊", "麌", "麍", "麎", "麏", "麐", "麑", "麔", "麕", "麖", "麗", "麘", "麙", "麚", "麛", "麜", "麞", "麠", "麡", "麢", "麣", "麤", "麥", "麧", "麨", "麩", "麪", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" , "麫", "麬", "麭", "麮", "麯", "麰", "麱", "麲", "麳", "面", "麶", "麷", "麹", "麺", "麼", "麿", "黀", "黁", "黂", "黃", "黅", "黆", "黇", "黈", "黊", "黋", "黌", "黐", "黒", "黓", "黕", "黖", "黗", "黙", "黚", "點", "黶", "黣", "黤", "黦", "黨", "黫", "黬", "黭", "黮", "黰", "黱", "黲", "黳", "黴", "黵", "黶", "黷", "黸", "黺", "黽", "黿", "鼀", "鼁", "鼂", "鼃", "鼄", "鼅", "" , "鼆", "鰲", "鼈", "鼉", "鼊", "鼌", "鼏", "鼑", "鼒", "鼔", "冬", "鼖", "鼘", "鼚", "鼛", "鼜", "鼝", "鼞", "鼟", "鼡", "鼣", "鼤", "鼥", "鼦", "鼧", "鼨", "鼩", "鼪", "鼫", "鼭", "鼮", "鼰", "鼱", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" , "鼲", "鼳", "鼴", "鼵", "鼶", "鼸", "鼺", "鼼", "鼿", "齀", "齁", "齂", "齃", "齅", "齆", "齇", "齈", "齉", "齊", "齋", "齌", "齍", "齎", "齏", "齒", "齓", "齔", "齕", "齖", "齗", "齘", "齙", "齚", "齛", "齜", "齝", "齞", "齟", "齠", "齡", "齢", "出", "齤", "齥", "齦", "齧", "齨", "齩", "齪", "齫", "齬", "齭", "齮", "齯", "齰", "齱", "齲", "齳", "齴", "齵", "顎", "齷", "齸", "" , "齹", "齺", "齻", "齼", "齽", "齾", "龁", "龂", "龍", "龎", "龏", "龐", "龑", "龒", "龓", "龔", "龕", "龖", "龗", "龘", "龜", "龝", "龞", "龡", "龢", "龣", "龤", "龥", "郎", "凉", "秊", "裏", "隣", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" , "兀", "嗀", "﨎", "﨏", "﨑", "﨓", "﨔", "礼", "﨟", "蘒", "﨡", "﨣", "﨤", "﨧", "﨨", "﨩", "⺁", "", "", "", "⺄", "㑳", "㑳", "⺈", "⺋", "", "喎", "㘚", "㘚", "⺌", "⺗", "㥮", "㥮", "", "掆", "擓", "㩳", "㩳", "", "", "棡", "㱮", "澾", "⺧", "", "", "⺪", "瞜", "穇", "⺮", "紬", "⺳", "⺶", "⺷", "", "䎱", "䎱", "⺻", "膞", "藭", "䙡", "䙡", "", "" , "欣", "宴", "䝼", "䝼", "⻊", "䥇", "釾", "鏺", "䥇", "鐯", "鐥", "钁", "䦟", "䦛", "䦟", "䦛", "", "", "䱷", "鮣", "䲠", "鰌", "䱷", "鰧", "鳾", "鵁", "鴷", "鶄", "鶪", "鷉", "鸊", "龑", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" ,
package com.jeremiq.tictactoe.game.board; public class InvalidMoveException extends Exception { public InvalidMoveException(String message) { super(message); } }
angular.module('EggApp', ['ngRoute'], function($routeProvider) { $routeProvider .when('/', { templateUrl: '/app/view/search.html', controller: 'SearchController' }) .when('/show/:id', { templateUrl: '/app/view/show.html', controller: 'ShowController' }) .otherwise({ redirectTo: '/' }); });
import requests import json def test_api_endpoint_existence(todolist_app): with todolist_app.test_client() as client: resp = client.get('/tasks') assert resp.status_code == 200 def test_task_creation(todolist_app): with todolist_app.test_client() as client: resp = client.jpost( '/tasks', { "title": "First task" } ) assert resp['status'] == 'success' assert 'id' in resp['result'] assert resp['result']['id'] == 1 def test_task_updation(todolist_app): with todolist_app.test_client() as client: modified_title = "First task - modified" resp = client.jput( '/tasks/1', { "title": "First task - modified" } ) assert resp['status'] == 'success' assert 'id' in resp['result'] assert resp['result']['title'] == modified_title
using System; using System.Collections.Generic; using System.Linq; using System.Web.UI; using System.Data; using System.Globalization; using System.Web.UI.WebControls; public partial class Detail : Page { public const string KeyDropDownData = "KeyDropDownData"; public const string KeyData = "KeyData"; private bool _reload; private int? _id; private PageLoadInfo _dropDownData; private DetailData _data; private bool _saveClicked; protected override void OnInit(EventArgs e) { base.OnInit(e); var idString = Request.QueryString["id"]; int idValue; _id = null; if (!string.IsNullOrEmpty(idString) && int.TryParse(idString, out idValue)) { _id = idValue; } } protected override void LoadViewState(object savedState) { base.LoadViewState(savedState); _dropDownData = ViewState[KeyDropDownData] as PageLoadInfo ?? new PageLoadInfo(); _data = ViewState[KeyData] as DetailData ?? new DetailData(); } protected override object SaveViewState() { ViewState[KeyDropDownData] = _dropDownData; return base.SaveViewState(); } private void GenerateControls(List<Product> data) { lbProductsAvailable.Items.Clear(); foreach (var item in data.Where(x => !x.IsOrdered && (x.Available == null || x.NotOrdered > 0))) { var text = item.Name + ", €" + item.Price; if (item.Available != null) text += ", ostáva " + item.NotOrdered; lbProductsAvailable.Items.Add(new ListItem(text, item.Id.ToString())); } lbProductsAvailable.Rows = Math.Max(1, Math.Min(20, lbProductsAvailable.Items.Count)); lbProductsOrdered.Items.Clear(); foreach (var item in data.Where(x => x.IsOrdered)) { var text = item.Name + ", €" + item.Price; lbProductsOrdered.Items.Add(new ListItem(text, item.Id.ToString())); } lbProductsOrdered.Rows = Math.Max(1, lbProductsOrdered.Items.Count); } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { _dropDownData = Database.GetPageLoadInfo(); GenerateControls(_dropDownData.Products); Common.FillDropDown(ddlChurch, _dropDownData.Churches, new ListItem(Common.ChybaZbor, "0")); Common.FillJobs(ddlJob, _dropDownData.Jobs, true); LoadData(); } lblSuccess.Text = ""; } private void LoadData() { _reload = true; } protected void btnSave_Click(object sender, EventArgs e) { _saveClicked = true; } private void Transaction(int paymentToUs, int donationToUs) { float amount = 0; if (!string.IsNullOrWhiteSpace(txtAmount.Text)) { if (float.TryParse(txtAmount.Text, out amount)) { amount = Math.Abs(amount); if (amount >= 0.01) { try { if (paymentToUs != 0) { Database.AddPayment(_id.Value, paymentToUs * amount, (paymentToUs > 0 ? "Platba na mieste" : "Vratenie preplatku") + ", IP = " + Common.GetIpAddress()); LoadData(); } if (donationToUs != 0) { Database.AddDonation(_id.Value, donationToUs * amount); LoadData(); } } catch (Exception ex) { lblError.Text = ex.Message + ' ' + ex.InnerException; } } } } } protected void btnTheyDonatedToUs_Click(object sender, EventArgs e) { Transaction(0, 1); } protected void btnTheyPaidUs_Click(object sender, EventArgs e) { Transaction(1, 0); } protected void btnWePaidThem_Click(object sender, EventArgs e) { Transaction(-1, 0); } protected void btnWeDonatedToThem_Click(object sender, EventArgs e) { Transaction(0, -1); } protected void btnShowedUp_Click(object sender, EventArgs e) { Database.ShowedUp(_id.Value); LoadData(); } protected void btnAdd_Click(object sender, EventArgs e) { foreach (ListItem item in lbProductsAvailable.Items) { if (item.Selected) { var foundProduct = _dropDownData.Products.FirstOrDefault(x => x.Id.ToString() == item.Value); if (foundProduct != null) { foundProduct.IsOrdered = true; } } } GenerateControls(_dropDownData.Products); } protected void btnRemove_Click(object sender, EventArgs e) { foreach (ListItem item in lbProductsOrdered.Items) { if (item.Selected) { var foundProduct = _dropDownData.Products.FirstOrDefault(x => x.Id.ToString() == item.Value); if (foundProduct != null) { foundProduct.IsOrdered = false; } } } GenerateControls(_dropDownData.Products); } private List<int> GetOrderedProducts() { var result = new List<int>(); foreach (ListItem item in lbProductsOrdered.Items) { int idProduct; if (int.TryParse(item.Value, out idProduct)) { result.Add(idProduct); } } return result; } private DetailData GetDataFromPage() { var errors = new List<string>(); if (string.IsNullOrWhiteSpace(txtFirstName.Text)) errors.Add(Common.ChybaMeno); if (string.IsNullOrWhiteSpace(txtLastName.Text)) errors.Add(Common.ChybaPriezvisko); if (!string.IsNullOrWhiteSpace(txtEmail.Text) && !Common.ValidateEmail(txtEmail.Text.Trim())) errors.Add(Common.ChybaEmail); var idChurch = ddlChurch.SelectedValue.StringToInt(); if (idChurch == 0 || idChurch == -1) idChurch = null; var idJob = ddlJob.SelectedValue.StringToInt(); if (idJob == 0) idJob = null; lblError.Text = ""; if (errors.Count > 0) { lblError.Text = string.Join("<br/>", errors); return null; } float? extraFee = null; float tmp; if (!string.IsNullOrWhiteSpace(txtExtraFee.Text) && float.TryParse(txtExtraFee.Text, out tmp)) extraFee = tmp; float donation = 0; if (!string.IsNullOrWhiteSpace(txtDonation.Text)) { if (!float.TryParse(txtDonation.Text, out donation)) errors.Add(Common.ChybaSponzorskyDar); } var data = new DetailData() { Id = _id, FirstName = txtFirstName.Text, LastName = txtLastName.Text, Email = txtEmail.Text, PhoneNumber = txtPhoneNumber.Text, IdChurch = idChurch, OtherChurch = txtOtherChurch.Text, IdJob = idJob, Note = txtNote.Text, Donation = donation, ExtraFee = extraFee, OrderedProducts = GetOrderedProducts(), }; return data; } private void UpdatePageFromData(DetailData data) { lblId.Text = data.Id.ToString(); txtFirstName.Text = data.FirstName; txtLastName.Text = data.LastName; txtEmail.Text = data.Email; txtPhoneNumber.Text = data.PhoneNumber; ddlChurch.SelectedValue = (data.IdChurch ?? 0).ToString(); txtOtherChurch.Text = data.OtherChurch; ddlJob.SelectedValue = (data.IdJob ?? 0).ToString(); txtNote.Text = data.Note; lblRegistrationDate.Text = data.DtRegistered.HasValue ? data.DtRegistered.Value.ToString(new CultureInfo("sk-SK")) : ""; lblPaymentDate.Text = data.DtPlatba.HasValue ? data.DtPlatba.Value.Date.ToString("d.M.yyyy") : ""; lblArrivalDate.Text = data.DtShowedUp.HasValue ? data.DtShowedUp.Value.ToString(new CultureInfo("sk-SK")) : ""; lblPaid.Text = Currency(data.Paid); lblCosts.Text = Currency(data.Costs); lblDonation.Text = Currency(data.Donation); lblSurplus.Text = Currency(data.Surplus); var surplus = data.Surplus >= 0.01; var debt = data.Surplus <= -0.01; lblSurplus.CssClass = debt ? "negative" : "positive"; //btnDarovaliNam.Visible = surplus; //btnDarovaliSme.Visible = debt; btnTheyPaidUs.Visible = debt; btnWePaidThem.Visible = surplus; btnShowedUp.Visible = !data.DtShowedUp.HasValue; txtAmount.Text = Currency(Math.Abs(data.Surplus)); // lblRegistracnyPoplatok.Text = data.RegistraciaZadarmo ? "Zadarmo" : Currency(data.ExtraFee); // txtRegistrationOverride.Text = data.RegistrationOverride == null ? "" : string.Format("{0:0.00}", data.RegistrationOverride); if (data.Group.Count > 0) { lblGroup.Text = string.Join("<br/>", data.Group.Select(x => string.Format("<a href=\"/Detail.aspx?id={0}\" target=\"new\">{1}</a>", x.Id, x.Name))); } _dropDownData.Products = data.Products; GenerateControls(data.Products); } protected override void OnPreRender(EventArgs e) { if (_saveClicked) { var data = GetDataFromPage(); if (data != null) { try { if (!_id.HasValue) { _id = Database.RegisterNewUser(data); if (_id.HasValue) { // just created a user Response.Redirect(string.Format("/Detail.aspx?id={0}", _id.Value)); } else { lblError.Text = "Niečo sa pokazilo. Kontaktujte administrátora."; } } else { Database.UpdateUser(data); // updated a user _reload = true; lblSuccess.Text = "Zmeny boli úspešne uložené"; } } catch (Exception ex) { lblError.Text = ex.Message + "<br/>" + ex.InnerException; } } } if (_reload && _id.HasValue) { _data = Database.GetDetail(_id.Value); if (_data.Id.HasValue) { UpdatePageFromData(_data); } else { Response.Redirect("/Detail.aspx"); } } if (!_id.HasValue) { int idJob; if (int.TryParse(ddlJob.SelectedValue, out idJob)) { var foundJob = _dropDownData.Jobs.FirstOrDefault(x => x.Id == idJob); // foundJob. } lblTotalCost.Text = Currency( GetOrderedProducts() .Select(x => _dropDownData.Products.FirstOrDefault(y => y.Id == x)) .Aggregate(0f, (sum, product) => sum + (product != null ? product.Price : 0)) ); } trId.Visible = _id.HasValue; trGroup.Visible = _id.HasValue && _data.Group.Count > 0; trRegistrationDate.Visible = _id.HasValue; trPaymentDate.Visible = _id.HasValue; trArrivalDate.Visible = _id.HasValue; trPaid.Visible = _id.HasValue; trCosts.Visible = _id.HasValue; trDonation.Visible = _id.HasValue; trSurplus.Visible = _id.HasValue; txtAmount.Visible = _id.HasValue; btnTheyPaidUs.Visible = _id.HasValue; btnWePaidThem.Visible = _id.HasValue; btnTheyDonatedToUs.Visible = _id.HasValue; btnWeDonatedToThem.Visible = _id.HasValue; btnShowedUp.Visible = _id.HasValue; trTotalCost.Visible = !_id.HasValue; lblTitle.Text = _id.HasValue ? _data.FirstName + " " + _data.LastName : "Nový účastník / účastníčka"; btnSave.Text = _id.HasValue ? "Uložiť zmeny" : "Registrovať nového účastníka"; base.OnPreRender(e); } private string Currency(float f) { return string.Format("{0:0.00}", f); } }
Rails.application.routes.draw do root :to => redirect("/docs"), only_path: false mount Wordset::API => "/api" mount GrapeSwaggerRails::Engine, at: "/docs" end
namespace Esthar.Data { public enum JsmCommand { NOP, CAL, JMP, JPF, GJMP, LBL, RET, PSHN_L, PSHI_L, POPI_L, PSHM_B, POPM_B, PSHM_W, POPM_W, PSHM_L, POPM_L, PSHSM_B, PSHSM_W, PSHSM_L, PSHAC, REQ, REQSW, REQEW, PREQ, PREQSW, PREQEW, UNUSE, DEBUG, HALT, SET, SET3, IDLOCK, IDUNLOCK, EFFECTPLAY2, FOOTSTEP, JUMP, JUMP3, LADDERUP, LADDERDOWN, LADDERUP2, LADDERDOWN2, MAPJUMP, MAPJUMP3, SETMODEL, BASEANIME, ANIME, ANIMEKEEP, CANIME, CANIMEKEEP, RANIME, RANIMEKEEP, RCANIME, RCANIMEKEEP, RANIMELOOP, RCANIMELOOP, LADDERANIME, DISCJUMP, SETLINE, LINEON, LINEOFF, WAIT, MSPEED, MOVE, MOVEA, PMOVEA, CMOVE, FMOVE, PJUMPA, ANIMESYNC, ANIMESTOP, MESW, MES, MESSYNC, MESVAR, ASK, WINSIZE, WINCLOSE, UCON, UCOFF, MOVIE, MOVIESYNC, SETPC, DIR, DIRP, DIRA, PDIRA, SPUREADY, TALKON, TALKOFF, PUSHON, PUSHOFF, ISTOUCH, MAPJUMPO, MAPJUMPON, MAPJUMPOFF, SETMESSPEED, SHOW, HIDE, TALKRADIUS, PUSHRADIUS, AMESW, AMES, GETINFO, THROUGHON, THROUGHOFF, BATTLE, BATTLERESULT, BATTLEON, BATTLEOFF, KEYSCAN, KEYON, AASK, PGETINFO, DSCROLL, LSCROLL, CSCROLL, DSCROLLA, LSCROLLA, CSCROLLA, SCROLLSYNC, RMOVE, RMOVEA, RPMOVEA, RCMOVE, RFMOVE, MOVESYNC, CLEAR, DSCROLLP, LSCROLLP, CSCROLLP, LTURNR, LTURNL, CTURNR, CTURNL, ADDPARTY, SUBPARTY, CHANGEPARTY, REFRESHPARTY, SETPARTY, ISPARTY, ADDMEMBER, SUBMEMBER, ISMEMBER, LTURN, CTURN, PLTURN, PCTURN, JOIN, MESFORCUS, BGANIME, RBGANIME, RBGANIMELOOP, BGANIMESYNC, BGDRAW, BGOFF, BGANIMESPEED, SETTIMER, DISPTIMER, SHADETIMER, SETGETA, SETROOTTRANS, SETVIBRATE, STOPVIBRATE, MOVIEREADY, GETTIMER, FADEIN, FADEOUT, FADESYNC, SHAKE, SHAKEOFF, FADEBLACK, FOLLOWOFF, FOLLOWON, GAMEOVER, ENDING, SHADELEVEL, SHADEFORM, FMOVEA, FMOVEP, SHADESET, MUSICCHANGE, MUSICLOAD, FADENONE, POLYCOLOR, POLYCOLORALL, KILLTIMER, CROSSMUSIC, DUALMUSIC, EFFECTPLAY, EFFECTLOAD, LOADSYNC, MUSICSTOP, MUSICVOL, MUSICVOLTRANS, MUSICVOLFADE, ALLSEVOL, ALLSEVOLTRANS, ALLSEPOS, ALLSEPOSTRANS, SEVOL, SEVOLTRANS, SEPOS, SEPOSTRANS, SETBATTLEMUSIC, BATTLEMODE, SESTOP, BGANIMEFLAG, INITSOUND, BGSHADE, BGSHADESTOP, RBGSHADELOOP, DSCROLL2, LSCROLL2, CSCROLL2, DSCROLLA2, LSCROLLA2, CSCROLLA2, DSCROLLP2, LSCROLLP2, CSCROLLP2, SCROLLSYNC2, SCROLLMODE2, MENUENABLE, MENUDISABLE, FOOTSTEPON, FOOTSTEPOFF, FOOTSTEPOFFALL, FOOTSTEPCUT, PREMAPJUMP, USE, SPLIT, ANIMESPEED, RND, DCOLADD, DCOLSUB, TCOLADD, TCOLSUB, FCOLADD, FCOLSUB, COLSYNC, DOFFSET, LOFFSETS, COFFSETS, LOFFSET, COFFSET, OFFSETSYNC, RUNENABLE, RUNDISABLE, MAPFADEOFF, MAPFADEON, INITTRACE, SETDRESS, GETDRESS, FACEDIR, FACEDIRA, FACEDIRP, FACEDIRLIMIT, FACEDIROFF, SARALYOFF, SARALYON, SARALYDISPOFF, SARALYDISPON, MESMODE, FACEDIRINIT, FACEDIRI, JUNCTION, SETCAMERA, BATTLECUT, FOOTSTEPCOPY, WORLDMAPJUMP, RFACEDIRI, RFACEDIR, RFACEDIRA, RFACEDIRP, RFACEDIROFF, FACEDIRSYNC, COPYINFO, PCOPYINFO, RAMESW, BGSHADEOFF, AXIS, AXISSYNC, MENUNORMAL, MENUPHS, BGCLEAR, GETPARTY, MENUSHOP, DISC, DSCROLL3, LSCROLL3, CSCROLL3, MACCEL, MLIMIT, ADDITEM, SETWITCH, SETODIN, RESETGF, MENUNAME, REST, MOVECANCEL, PMOVECANCEL, ACTORMODE, MENUSAVE, SAVEENABLE, PHSENABLE, HOLD, MOVIECUT, SETPLACE, SETDCAMERA, CHOICEMUSIC, GETCARD, DRAWPOINT, PHSPOWER, KEY, CARDGAME, SETBAR, DISPBAR, KILLBAR, SCROLLRATIO2, WHOAMI, MUSICSTATUS, MUSICREPLAY, DOORLINEOFF, DOORLINEON, MUSICSKIP, DYING, SETHP, GETHP, MOVEFLUSH, MUSICVOLSYNC, PUSHANIME, POPANIME, KEYSCAN2, KEYON2, PARTICLEON, PARTICLEOFF, KEYSIGHNCHANGE, ADDGIL, ADDPASTGIL, ADDSEEDLEVEL, PARTICLESET, SETDRAWPOINT, MENUTIPS, LASTIN, LASTOUT, SEALEDOFF, MENUTUTO, OPENEYES, CLOSEEYES, BLINKEYES, SETCARD, HOWMANYCARD, WHERECARD, ADDMAGIC, SWAP, SETPARTY2, SPUSYNC, BROKEN, Unknown1, Unknown2, Unknown3, Unknown4, Unknown5, Unknown6, Unknown7, Unknown8, Unknown9, Unknown10, Unknown11, Unknown12, Unknown13, Unknown14, Unknown15, Unknown16, Unknown17, Unknown18 } }
import leon.lang._ object MergeSort { sealed abstract class List case class Cons(head:Int,tail:List) extends List case class Nil() extends List case class Pair(fst:List,snd:List) def contents(l: List): Set[Int] = l match { case Nil() => Set.empty case Cons(x,xs) => contents(xs) ++ Set(x) } def is_sorted(l: List): Boolean = l match { case Nil() => true case Cons(x,xs) => xs match { case Nil() => true case Cons(y, ys) => x <= y && is_sorted(Cons(y, ys)) } } def length(list:List): Int = list match { case Nil() => 0 case Cons(x,xs) => 1 + length(xs) } def splithelper(aList:List,bList:List,n:Int): Pair = if (n <= 0) Pair(aList,bList) else bList match { case Nil() => Pair(aList,bList) case Cons(x,xs) => splithelper(Cons(x,aList),xs,n-1) } def split(list:List,n:Int): Pair = splithelper(Nil(),list,n) def merge(aList:List, bList:List):List = (bList match { case Nil() => aList case Cons(x,xs) => aList match { case Nil() => bList case Cons(y,ys) => if (y < x) Cons(y,merge(ys, bList)) else Cons(x,merge(aList, xs)) } }) ensuring(res => contents(res) == contents(aList) ++ contents(bList)) def mergeSort(list:List):List = (list match { case Nil() => list case Cons(x,Nil()) => list case _ => val p = split(list,length(list)/2) merge(mergeSort(p.fst), mergeSort(p.snd)) }) ensuring(res => contents(res) == contents(list) && is_sorted(res)) def main(args: Array[String]): Unit = { val ls: List = Cons(5, Cons(2, Cons(4, Cons(5, Cons(1, Cons(8,Nil())))))) println(ls) println(mergeSort(ls)) } }
var Phaser = require('phaser-unofficial'); /** * Wall class. * @param {object} game * @param {number} x * @param {number} y */ Wall = function (game, x, y) { Phaser.Sprite.call(this, game, x, y, 'paddle'); this.game.physics.arcade.enable(this); this.width = 200; this.height = this.game.world.bounds.height; this.blendMode = Phaser.blendModes.ADD; this.body.bounce.setTo(1, 1); this.body.immovable = true; this.alpha = 0; }; Wall.prototype = Object.create(Phaser.Sprite.prototype); Wall.prototype.constructor = Wall; module.exports = Wall;
exports.definition = { /** * Add custom methods to your Model`s Records * just define a function: * ```js * this.function_name = function(){ * //this == Record * }; * ``` * This will automatically add the new method to your Record * * @class Definition * @name Custom Record Methods * */ mixinCallback: function() { var objKeys = [] var self = this this.use(function() { // get all current property names objKeys = Object.keys(this) }, 90) this.on('finished', function() { // an now search for new ones ==> instance methods for our new model class Object.keys(self).forEach(function(name) { if (objKeys.indexOf(name) === -1) { self.instanceMethods[name] = self[name] delete self[name] } }) }) } }