hexsha
stringlengths
40
40
size
int64
5
1.05M
ext
stringclasses
588 values
lang
stringclasses
305 values
max_stars_repo_path
stringlengths
3
363
max_stars_repo_name
stringlengths
5
118
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
10
max_stars_count
float64
1
191k
max_stars_repo_stars_event_min_datetime
stringdate
2015-01-01 00:00:35
2022-03-31 23:43:49
max_stars_repo_stars_event_max_datetime
stringdate
2015-01-01 12:37:38
2022-03-31 23:59:52
max_issues_repo_path
stringlengths
3
363
max_issues_repo_name
stringlengths
5
118
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
10
max_issues_count
float64
1
134k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
363
max_forks_repo_name
stringlengths
5
135
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
10
max_forks_count
float64
1
105k
max_forks_repo_forks_event_min_datetime
stringdate
2015-01-01 00:01:02
2022-03-31 23:27:27
max_forks_repo_forks_event_max_datetime
stringdate
2015-01-03 08:55:07
2022-03-31 23:59:24
content
stringlengths
5
1.05M
avg_line_length
float64
1.13
1.04M
max_line_length
int64
1
1.05M
alphanum_fraction
float64
0
1
5ce27adc024eaa6bdebb8c8d7e9e84409cfe80b1
2,342
h
C
src/cetlib/cetlib/assert_only_one_thread.h
JeffersonLab/ARIEL
49054ac62a84d48e269f7171daabb98e12a0be90
[ "BSD-3-Clause" ]
null
null
null
src/cetlib/cetlib/assert_only_one_thread.h
JeffersonLab/ARIEL
49054ac62a84d48e269f7171daabb98e12a0be90
[ "BSD-3-Clause" ]
null
null
null
src/cetlib/cetlib/assert_only_one_thread.h
JeffersonLab/ARIEL
49054ac62a84d48e269f7171daabb98e12a0be90
[ "BSD-3-Clause" ]
2
2020-09-26T01:37:11.000Z
2021-05-03T13:02:24.000Z
#ifndef cetlib_assert_only_one_thread_h #define cetlib_assert_only_one_thread_h // vim: set sw=2 expandtab : // =================================================================== // CET_ASSERT_ONLY_ONE_THREAD() // // This macro is a utility that can be called wherever it is expected // for only one thread to be accessing a particular block of code. // // It has similar semantics to the standard 'assert' macro: // // - It is disabled if NDEBUG is defined // - If more than one thread is accessing that block of code at one // time, std::abort is called. // - It is encouraged to be used whenever single-threaded execution // of a code block is a pre-condition. // // If the std::abort() is called, file, line-number, and function-name // information will be provided. // =================================================================== #include <atomic> #include <cstdlib> #include <iostream> #include <string> namespace cet::detail { class ThreadCounter { public: explicit ThreadCounter(char const* filename, unsigned const linenum, char const* funcname) : filename_{filename}, linenum_{linenum}, funcname_{funcname} {} class Sentry { public: ~Sentry() noexcept { --tc_.counter_; } Sentry(ThreadCounter& tc, bool const terminate = true) : tc_{tc} { if (++tc_.counter_ == 1u) { return; } std::cerr << "Failed assert--more than one thread accessing location:\n" << " " << tc_.filename_ << ':' << tc_.linenum_ << '\n' << " function: " << tc_.funcname_ << '\n'; if (terminate) { std::abort(); } } private: ThreadCounter& tc_; }; private: std::string const filename_; unsigned const linenum_; std::string const funcname_; std::atomic<unsigned> counter_{0u}; }; } // namespace cet::detail #ifdef NDEBUG #define CET_ASSERT_ONLY_ONE_THREAD() #else // NDEBUG #define CET_ASSERT_ONLY_ONE_THREAD() \ static cet::detail::ThreadCounter s_tc_{__FILE__, __LINE__, __func__}; \ cet::detail::ThreadCounter::Sentry sentry_tc_ { s_tc_ } #endif // NDEBUG #endif /* cetlib_assert_only_one_thread_h */ // Local variables: // mode: c++ // End:
29.275
80
0.584116
d0ca395acd59f4fc5246e64234ef43d52180a8e4
3,253
h
C
data_reader/stage_0/include/matchmaker/parts_of_speech.h
shtroizel/matchmaker
457521bd677f6e06e9f2b6552b1ff661f52788d3
[ "BSD-3-Clause" ]
null
null
null
data_reader/stage_0/include/matchmaker/parts_of_speech.h
shtroizel/matchmaker
457521bd677f6e06e9f2b6552b1ff661f52788d3
[ "BSD-3-Clause" ]
null
null
null
data_reader/stage_0/include/matchmaker/parts_of_speech.h
shtroizel/matchmaker
457521bd677f6e06e9f2b6552b1ff661f52788d3
[ "BSD-3-Clause" ]
null
null
null
#pragma once /* Copyright (c) 2020, Eric Hyer All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <matchable/matchable.h> MATCHABLE( pos_desc, Noun, Plural, Noun_spc_Phrase, Verb_spc__pl_usu_spc_participle_pr_, Verb_spc__pl_transitive_pr_, Verb_spc__pl_intransitive_pr_, Adjective, Adverb, Conjunction, Preposition, Interjection, Pronoun, Definite_spc_Article, Indefinite_spc_Article, Nominative ); PROPERTYx1_MATCHABLE( pos_desc::Type, pos_desc, parts_of_speech, N, p, h, V, t, i, A, v, C, P, n, // ! r, D, I, o ) SET_PROPERTY(parts_of_speech, N, pos_desc, pos_desc::Noun::grab()) SET_PROPERTY(parts_of_speech, p, pos_desc, pos_desc::Plural::grab()) SET_PROPERTY(parts_of_speech, h, pos_desc, pos_desc::Noun_spc_Phrase::grab()) SET_PROPERTY(parts_of_speech, V, pos_desc, pos_desc::Verb_spc__pl_usu_spc_participle_pr_::grab()) SET_PROPERTY(parts_of_speech, t, pos_desc, pos_desc::Verb_spc__pl_transitive_pr_::grab()) SET_PROPERTY(parts_of_speech, i, pos_desc, pos_desc::Verb_spc__pl_intransitive_pr_::grab()) SET_PROPERTY(parts_of_speech, A, pos_desc, pos_desc::Adjective::grab()) SET_PROPERTY(parts_of_speech, v, pos_desc, pos_desc::Adverb::grab()) SET_PROPERTY(parts_of_speech, C, pos_desc, pos_desc::Conjunction::grab()) SET_PROPERTY(parts_of_speech, P, pos_desc, pos_desc::Preposition::grab()) SET_PROPERTY(parts_of_speech, n, pos_desc, pos_desc::Interjection::grab()) SET_PROPERTY(parts_of_speech, r, pos_desc, pos_desc::Pronoun::grab()) SET_PROPERTY(parts_of_speech, D, pos_desc, pos_desc::Definite_spc_Article::grab()) SET_PROPERTY(parts_of_speech, I, pos_desc, pos_desc::Indefinite_spc_Article::grab()) SET_PROPERTY(parts_of_speech, o, pos_desc, pos_desc::Nominative::grab())
34.978495
97
0.768521
65888bfdb2d4682f0a5361225e2c7393ca442246
8,215
c
C
src/plugins/hexcode/hexcode.c
0003088/libelektra-qt-gui-test
f127a7bd4daba1b70e1ea0ce13d8ff650beda5b6
[ "BSD-3-Clause" ]
null
null
null
src/plugins/hexcode/hexcode.c
0003088/libelektra-qt-gui-test
f127a7bd4daba1b70e1ea0ce13d8ff650beda5b6
[ "BSD-3-Clause" ]
null
null
null
src/plugins/hexcode/hexcode.c
0003088/libelektra-qt-gui-test
f127a7bd4daba1b70e1ea0ce13d8ff650beda5b6
[ "BSD-3-Clause" ]
null
null
null
/*************************************************************************** hexcode.c - Skeleton of a plugin ------------------- begin : Fri May 21 2010 copyright : (C) 2010 by Markus Raab email : elektra@markus-raab.org ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the BSD License (revised). * * * ***************************************************************************/ /*************************************************************************** * * * This is the skeleton of the methods you'll have to implement in order * * to provide a valid plugin. * * Simple fill the empty functions with your code and you are * * ready to go. * * * ***************************************************************************/ #include "hexcode.h" #ifndef HAVE_KDBCONFIG # include "kdbconfig.h" #endif #include <stdlib.h> #include <string.h> /** * Gives the integer number 0-15 to a corresponding * hex character '0'-'9', 'a'-'f' or 'A'-'F'. */ static inline int elektraHexcodeConvFromHex(char c) { if (c == '0') return 0; else if (c=='1') return 1; else if (c=='2') return 2; else if (c=='3') return 3; else if (c=='4') return 4; else if (c=='5') return 5; else if (c=='6') return 6; else if (c=='7') return 7; else if (c=='8') return 8; else if (c=='9') return 9; else if (c=='a' || c=='A') return 10; else if (c=='b' || c=='B') return 11; else if (c=='c' || c=='C') return 12; else if (c=='d' || c=='D') return 13; else if (c=='e' || c=='E') return 14; else if (c=='f' || c=='F') return 15; else return 0; /* Unknown escape char */ } /** Reads the value of the key and decodes all escaping * codes into the buffer. * @pre the buffer needs to be as large as value's size. * @param cur the key holding the value to decode * @param buf the buffer to write to */ void elektraHexcodeDecode (Key *cur, CHexData *hd) { size_t valsize = keyGetValueSize(cur); const char *val = keyValue(cur); if (!val) return; size_t out=0; for (size_t in=0; in<valsize-1; ++in) { char c = val[in]; char *n = hd->buf+out; if (c == hd->escape) { in+=2; /* Advance twice (2 hex numbers) */ char first = val[in-1]; char second = val[in]; int res; res = elektraHexcodeConvFromHex(second); res += elektraHexcodeConvFromHex(first)*16; *n = res & 255; } else { *n = c; } ++out; /* Only one char is written */ } hd->buf[out] = 0; // null termination for keyString() keySetRaw(cur, hd->buf, out+1); } int elektraHexcodeGet(Plugin *handle, KeySet *returned, Key *parentKey) { /* get all keys */ if (!strcmp (keyName(parentKey), "system/elektra/modules/hexcode")) { KeySet *pluginConfig = ksNew (30, keyNew ("system/elektra/modules/hexcode", KEY_VALUE, "hexcode plugin waits for your orders", KEY_END), keyNew ("system/elektra/modules/hexcode/exports", KEY_END), keyNew ("system/elektra/modules/hexcode/exports/get", KEY_FUNC, elektraHexcodeGet, KEY_END), keyNew ("system/elektra/modules/hexcode/exports/set", KEY_FUNC, elektraHexcodeSet, KEY_END), keyNew ("system/elektra/modules/hexcode/exports/open", KEY_FUNC, elektraHexcodeOpen, KEY_END), keyNew ("system/elektra/modules/hexcode/exports/close", KEY_FUNC, elektraHexcodeClose, KEY_END), #include "readme_hexcode.c" keyNew ("system/elektra/modules/hexcode/infos/version", KEY_VALUE, PLUGINVERSION, KEY_END), KS_END); ksAppend (returned, pluginConfig); ksDel (pluginConfig); return 1; } CHexData *hd = elektraPluginGetData (handle); if (!hd->buf) { hd->buf = malloc (1000); hd->bufalloc = 1000; } Key *cur; ksRewind(returned); while ((cur = ksNext(returned)) != 0) { size_t valsize = keyGetValueSize(cur); if (valsize > hd->bufalloc) { hd->bufalloc = valsize; hd->buf = realloc (hd->buf, hd->bufalloc); } elektraHexcodeDecode (cur, hd); } return 1; /* success */ } /** * Gives the integer number 0-15 to a corresponding * hex character '0'-'9', 'a'-'f' or 'A'-'F'. */ static inline char elektraHexcodeConvToHex(int c) { switch (c) { case 0: return '0'; case 1: return '1'; case 2: return '2'; case 3: return '3'; case 4: return '4'; case 5: return '5'; case 6: return '6'; case 7: return '7'; case 8: return '8'; case 9: return '9'; case 10: return 'A'; case 11: return 'B'; case 12: return 'C'; case 13: return 'D'; case 14: return 'E'; case 15: return 'F'; default: return '0'; } } /** Reads the value of the key and encodes it in * c-style in the buffer. * * @param cur the key which value is to encode * @param buf the buffer * @pre the buffer needs to have thrice as much space as the value's size */ void elektraHexcodeEncode (Key *cur, CHexData *hd) { size_t valsize = keyGetValueSize(cur); const char *val = keyValue(cur); if (!val) return; size_t out=0; for (size_t in=0; in<valsize-1; ++in) { unsigned char c = val[in]; // need to encode char? if (hd->hd[c & 255]) { hd->buf[out] = hd->escape; out ++; hd->buf[out] = elektraHexcodeConvToHex(c/16); out ++; hd->buf[out] = elektraHexcodeConvToHex(c%16); out ++; } else { // just copy one character hd->buf[out] = val[in]; // advance out cursor out ++; } } hd->buf[out] = 0; // null termination for keyString() keySetRaw(cur, hd->buf, out+1); } int elektraHexcodeSet(Plugin *handle, KeySet *returned, Key *parentKey ELEKTRA_UNUSED) { /* set all keys */ CHexData *hd = elektraPluginGetData (handle); if (!hd->buf) { hd->buf = malloc (1000); hd->bufalloc = 1000; } Key *cur; ksRewind(returned); while ((cur = ksNext(returned)) != 0) { size_t valsize = keyGetValueSize(cur); if (valsize*3 > hd->bufalloc) { hd->bufalloc = valsize*3; hd->buf = realloc (hd->buf, hd->bufalloc); } elektraHexcodeEncode (cur, hd); } return 1; /* success */ } int elektraHexcodeOpen(Plugin *handle, Key *key ELEKTRA_UNUSED) { CHexData *hd = calloc (1, sizeof(CHexData)); /* Store for later use...*/ elektraPluginSetData (handle, hd); KeySet *config = elektraPluginGetConfig (handle); Key *escape = ksLookupByName (config, "/escape", 0); hd->escape = '\\'; if (escape && keyGetBaseNameSize(escape) && keyGetValueSize(escape) == 3) { int res; res = elektraHexcodeConvFromHex(keyString(escape)[1]); res += elektraHexcodeConvFromHex(keyString(escape)[0])*16; hd->escape = res & 255; } Key *root = ksLookupByName (config, "/chars", 0); Key *cur = 0; if (!root) { /* Some default config */ hd->hd['\0'] = 1; hd->hd['\n'] = 1; hd->hd['\\'] = 1; hd->hd[' '] = 1; } else { while ((cur = ksNext(config)) != 0) { /* ignore all keys not direct below */ if (keyRel (root, cur) == 1) { /* ignore invalid size */ if (keyGetBaseNameSize(cur) != 3) continue; int res; res = elektraHexcodeConvFromHex(keyBaseName(cur)[1]); res += elektraHexcodeConvFromHex(keyBaseName(cur)[0])*16; /* Hexencode this character! */ hd->hd [res & 255] = 1; } } } return 0; } int elektraHexcodeClose(Plugin *handle, Key *key ELEKTRA_UNUSED) { CHexData *hd = elektraPluginGetData (handle); free (hd->buf); free (hd); return 0; } Plugin *ELEKTRA_PLUGIN_EXPORT(hexcode) { return elektraPluginExport("hexcode", ELEKTRA_PLUGIN_GET, &elektraHexcodeGet, ELEKTRA_PLUGIN_SET, &elektraHexcodeSet, ELEKTRA_PLUGIN_OPEN, &elektraHexcodeOpen, ELEKTRA_PLUGIN_CLOSE, &elektraHexcodeClose, ELEKTRA_PLUGIN_END); }
25.5919
86
0.558734
e720f8801eb8f9cf6d9f8275ea5c86a17f5b7833
5,025
h
C
webrtc/include/third_party/blink/renderer/modules/webaudio/audio_node_input.h
yxlao/webrtc-cpp-sample
60bb1948f714693e7c8ade2fc6ffba218ea13859
[ "MIT" ]
575
2015-06-18T23:58:20.000Z
2022-03-23T09:32:39.000Z
webrtc/include/third_party/blink/renderer/modules/webaudio/audio_node_input.h
yxlao/webrtc-cpp-sample
60bb1948f714693e7c8ade2fc6ffba218ea13859
[ "MIT" ]
113
2015-05-04T09:58:14.000Z
2022-01-31T19:35:03.000Z
webrtc/include/third_party/blink/renderer/modules/webaudio/audio_node_input.h
yxlao/webrtc-cpp-sample
60bb1948f714693e7c8ade2fc6ffba218ea13859
[ "MIT" ]
52
2015-07-14T10:40:50.000Z
2022-03-15T01:11:49.000Z
/* * Copyright (C) 2010, Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. */ #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_WEBAUDIO_AUDIO_NODE_INPUT_H_ #define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBAUDIO_AUDIO_NODE_INPUT_H_ #include <memory> #include "third_party/blink/renderer/modules/modules_export.h" #include "third_party/blink/renderer/modules/webaudio/audio_node.h" #include "third_party/blink/renderer/modules/webaudio/audio_summing_junction.h" #include "third_party/blink/renderer/platform/audio/audio_bus.h" #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" #include "third_party/blink/renderer/platform/wtf/hash_set.h" namespace blink { class AudioNodeOutput; // An AudioNodeInput represents an input to an AudioNode and can be connected // from one or more AudioNodeOutputs. In the case of multiple connections, the // input will act as a unity-gain summing junction, mixing all the outputs. The // number of channels of the input's bus is the maximum of the number of // channels of all its connections. // // Use AudioNodeWiring to connect the AudioNodeOutput of another node to this, // and to disconnect, enable or disable that connection afterward. class MODULES_EXPORT AudioNodeInput final : public AudioSummingJunction { USING_FAST_MALLOC(AudioNodeInput); public: explicit AudioNodeInput(AudioHandler&); ~AudioNodeInput() override; // AudioSummingJunction void DidUpdate() override; // Can be called from any thread. AudioHandler& Handler() const { return handler_; } // pull() processes all of the AudioNodes connected to us. // In the case of multiple connections it sums the result into an internal // summing bus. In the single connection case, it allows in-place processing // where possible using inPlaceBus. It returns the bus which it rendered // into, returning inPlaceBus if in-place processing was performed. // Called from context's audio thread. scoped_refptr<AudioBus> Pull(AudioBus* in_place_bus, uint32_t frames_to_process); // bus() contains the rendered audio after pull() has been called for each // time quantum. // Called from context's audio thread. scoped_refptr<AudioBus> Bus(); // updateInternalBus() updates m_internalSummingBus appropriately for the // number of channels. This must be called when we own the context's graph // lock in the audio thread at the very start or end of the render quantum. void UpdateInternalBus(); // The number of channels of the connection with the largest number of // channels. unsigned NumberOfChannels() const; private: // This reference is safe because the AudioHandler owns this AudioNodeInput // object. AudioHandler& handler_; // m_disabledOutputs contains the AudioNodeOutputs which are disabled (will // not be processed) by the audio graph rendering. But, from JavaScript's // perspective, these outputs are still connected to us. // Generally, these represent disabled connections from "notes" which have // finished playing but are not yet garbage collected. // These raw pointers are safe. Owner AudioNodes of these AudioNodeOutputs // manage their lifetime, and AudioNode::dispose() disconnects all of // connections. HashSet<AudioNodeOutput*> disabled_outputs_; // Called from context's audio thread. scoped_refptr<AudioBus> InternalSummingBus(); void SumAllConnections(scoped_refptr<AudioBus> summing_bus, uint32_t frames_to_process); scoped_refptr<AudioBus> internal_summing_bus_; // Used to connect inputs and outputs together. friend class AudioNodeWiring; }; } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBAUDIO_AUDIO_NODE_INPUT_H_
44.078947
80
0.767761
108ad747855b18cfc6b10bf638b48f9a80e804cc
3,719
h
C
JietuFramework.framework/Headers/JTCaptureView.h
Vanyoo/MacScreenShot
8831c912398e4ede9b6616abb067d2d6bbc2b801
[ "MIT" ]
1
2021-09-24T14:17:24.000Z
2021-09-24T14:17:24.000Z
JietuFramework.framework/Headers/JTCaptureView.h
Vanyoo/MacScreenShot
8831c912398e4ede9b6616abb067d2d6bbc2b801
[ "MIT" ]
null
null
null
JietuFramework.framework/Headers/JTCaptureView.h
Vanyoo/MacScreenShot
8831c912398e4ede9b6616abb067d2d6bbc2b801
[ "MIT" ]
2
2021-03-04T06:44:16.000Z
2022-02-24T10:49:03.000Z
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "NSView.h" #import "JTCaptureViewSelectedItemDelegate.h" @class JTCaptureViewSelectedItem, JTCaptureWindowInfo, NSColor, NSString, NSTrackingArea; @interface JTCaptureView : NSView <JTCaptureViewSelectedItemDelegate> { BOOL _needScreenCapture; BOOL _selectComfirmed; BOOL _needDrawControlPoints; BOOL _needDrawSelectedItem; BOOL _postedSelectBeginNotification; id <JTCaptureViewDelegate> _delegate; NSColor *_backgroundMaskColor; NSTrackingArea *_trackingArea; JTCaptureViewSelectedItem *_selectedItem; unsigned long long _selectedItemType; JTCaptureWindowInfo *_activeWindowInfo; unsigned long long _captureType; unsigned long long _cursorType; struct CGPoint _startPoint; struct CGPoint _endPoint; } @property(nonatomic) BOOL postedSelectBeginNotification; // @synthesize postedSelectBeginNotification=_postedSelectBeginNotification; @property(nonatomic) unsigned long long cursorType; // @synthesize cursorType=_cursorType; @property(nonatomic) unsigned long long captureType; // @synthesize captureType=_captureType; @property(nonatomic) struct CGPoint endPoint; // @synthesize endPoint=_endPoint; @property(nonatomic) struct CGPoint startPoint; // @synthesize startPoint=_startPoint; @property(retain, nonatomic) JTCaptureWindowInfo *activeWindowInfo; // @synthesize activeWindowInfo=_activeWindowInfo; @property(nonatomic) unsigned long long selectedItemType; // @synthesize selectedItemType=_selectedItemType; @property(retain, nonatomic) JTCaptureViewSelectedItem *selectedItem; // @synthesize selectedItem=_selectedItem; @property(retain, nonatomic) NSTrackingArea *trackingArea; // @synthesize trackingArea=_trackingArea; @property(retain, nonatomic) NSColor *backgroundMaskColor; // @synthesize backgroundMaskColor=_backgroundMaskColor; @property(nonatomic) BOOL needDrawSelectedItem; // @synthesize needDrawSelectedItem=_needDrawSelectedItem; @property(nonatomic) BOOL needDrawControlPoints; // @synthesize needDrawControlPoints=_needDrawControlPoints; @property(nonatomic) BOOL selectComfirmed; // @synthesize selectComfirmed=_selectComfirmed; @property(nonatomic) BOOL needScreenCapture; // @synthesize needScreenCapture=_needScreenCapture; @property(nonatomic) __weak id <JTCaptureViewDelegate> delegate; // @synthesize delegate=_delegate; - (void).cxx_destruct; - (void)finishCapture; - (void)prepareForCapture; - (void)selectionDidChange; - (void)confirmSelectedItem; - (void)updateMouseLocation:(struct CGPoint)arg1 needShowMagnifier:(BOOL)arg2; - (void)handelMouseDraggedWithFixedPoint:(struct CGPoint)arg1 lastDraggedPoint:(struct CGPoint)arg2 draggedPoint:(struct CGPoint)arg3; - (void)updateCursorWithMousePoint:(struct CGPoint)arg1; - (BOOL)updateSelectedItemType:(unsigned long long *)arg1 cursorType:(unsigned long long *)arg2 fixedPoint:(struct CGPoint *)arg3 byMousePoint:(struct CGPoint)arg4; - (id)windowInfoAtPosition:(struct CGPoint)arg1; - (struct CGRect)pixelSelectedRectInWindow; - (void)drawRect:(struct CGRect)arg1; - (void)mouseExited:(id)arg1; - (void)mouseEntered:(id)arg1; - (void)mouseMoved:(id)arg1; - (void)mouseDown:(id)arg1; - (void)updateTrackingAreas; - (struct CGRect)selectedRect; - (void)cursorUpdate:(id)arg1; - (BOOL)acceptsFirstMouse:(id)arg1; - (void)configAppearanceAndLayout; - (void)dealloc; - (id)initWithFrame:(struct CGRect)arg1; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end
47.075949
164
0.802635
a100c93edee879393df3c9410a7be9f7cd7f3d0b
17,253
h
C
machine/qemu/sources/linux/drivers/net/ethernet/ti/cpsw_priv.h
muddessir/framework
5b802b2dd7ec9778794b078e748dd1f989547265
[ "MIT" ]
1
2021-11-21T19:56:29.000Z
2021-11-21T19:56:29.000Z
machine/qemu/sources/linux/drivers/net/ethernet/ti/cpsw_priv.h
muddessir/framework
5b802b2dd7ec9778794b078e748dd1f989547265
[ "MIT" ]
null
null
null
machine/qemu/sources/linux/drivers/net/ethernet/ti/cpsw_priv.h
muddessir/framework
5b802b2dd7ec9778794b078e748dd1f989547265
[ "MIT" ]
null
null
null
/* SPDX-License-Identifier: GPL-2.0 */ /* * Texas Instruments Ethernet Switch Driver */ #ifndef DRIVERS_NET_ETHERNET_TI_CPSW_PRIV_H_ #define DRIVERS_NET_ETHERNET_TI_CPSW_PRIV_H_ #include "davinci_cpdma.h" #define CPSW_DEBUG (NETIF_MSG_HW | NETIF_MSG_WOL | \ NETIF_MSG_DRV | NETIF_MSG_LINK | \ NETIF_MSG_IFUP | NETIF_MSG_INTR | \ NETIF_MSG_PROBE | NETIF_MSG_TIMER | \ NETIF_MSG_IFDOWN | NETIF_MSG_RX_ERR | \ NETIF_MSG_TX_ERR | NETIF_MSG_TX_DONE | \ NETIF_MSG_PKTDATA | NETIF_MSG_TX_QUEUED | \ NETIF_MSG_RX_STATUS) #define cpsw_info(priv, type, format, ...) \ do { \ if (netif_msg_##type(priv) && net_ratelimit()) \ dev_info(priv->dev, format, ## __VA_ARGS__); \ } while (0) #define cpsw_err(priv, type, format, ...) \ do { \ if (netif_msg_##type(priv) && net_ratelimit()) \ dev_err(priv->dev, format, ## __VA_ARGS__); \ } while (0) #define cpsw_dbg(priv, type, format, ...) \ do { \ if (netif_msg_##type(priv) && net_ratelimit()) \ dev_dbg(priv->dev, format, ## __VA_ARGS__); \ } while (0) #define cpsw_notice(priv, type, format, ...) \ do { \ if (netif_msg_##type(priv) && net_ratelimit()) \ dev_notice(priv->dev, format, ## __VA_ARGS__); \ } while (0) #define ALE_ALL_PORTS 0x7 #define CPSW_MAJOR_VERSION(reg) (reg >> 8 & 0x7) #define CPSW_MINOR_VERSION(reg) (reg & 0xff) #define CPSW_RTL_VERSION(reg) ((reg >> 11) & 0x1f) #define CPSW_VERSION_1 0x19010a #define CPSW_VERSION_2 0x19010c #define CPSW_VERSION_3 0x19010f #define CPSW_VERSION_4 0x190112 #define HOST_PORT_NUM 0 #define CPSW_ALE_PORTS_NUM 3 #define CPSW_SLAVE_PORTS_NUM 2 #define SLIVER_SIZE 0x40 #define CPSW1_HOST_PORT_OFFSET 0x028 #define CPSW1_SLAVE_OFFSET 0x050 #define CPSW1_SLAVE_SIZE 0x040 #define CPSW1_CPDMA_OFFSET 0x100 #define CPSW1_STATERAM_OFFSET 0x200 #define CPSW1_HW_STATS 0x400 #define CPSW1_CPTS_OFFSET 0x500 #define CPSW1_ALE_OFFSET 0x600 #define CPSW1_SLIVER_OFFSET 0x700 #define CPSW1_WR_OFFSET 0x900 #define CPSW2_HOST_PORT_OFFSET 0x108 #define CPSW2_SLAVE_OFFSET 0x200 #define CPSW2_SLAVE_SIZE 0x100 #define CPSW2_CPDMA_OFFSET 0x800 #define CPSW2_HW_STATS 0x900 #define CPSW2_STATERAM_OFFSET 0xa00 #define CPSW2_CPTS_OFFSET 0xc00 #define CPSW2_ALE_OFFSET 0xd00 #define CPSW2_SLIVER_OFFSET 0xd80 #define CPSW2_BD_OFFSET 0x2000 #define CPSW2_WR_OFFSET 0x1200 #define CPDMA_RXTHRESH 0x0c0 #define CPDMA_RXFREE 0x0e0 #define CPDMA_TXHDP 0x00 #define CPDMA_RXHDP 0x20 #define CPDMA_TXCP 0x40 #define CPDMA_RXCP 0x60 #define CPSW_POLL_WEIGHT 64 #define CPSW_RX_VLAN_ENCAP_HDR_SIZE 4 #define CPSW_MIN_PACKET_SIZE_VLAN (VLAN_ETH_ZLEN) #define CPSW_MIN_PACKET_SIZE (ETH_ZLEN) #define CPSW_MAX_PACKET_SIZE (VLAN_ETH_FRAME_LEN +\ ETH_FCS_LEN +\ CPSW_RX_VLAN_ENCAP_HDR_SIZE) #define RX_PRIORITY_MAPPING 0x76543210 #define TX_PRIORITY_MAPPING 0x33221100 #define CPDMA_TX_PRIORITY_MAP 0x76543210 #define CPSW_VLAN_AWARE BIT(1) #define CPSW_RX_VLAN_ENCAP BIT(2) #define CPSW_ALE_VLAN_AWARE 1 #define CPSW_FIFO_NORMAL_MODE (0 << 16) #define CPSW_FIFO_DUAL_MAC_MODE (1 << 16) #define CPSW_FIFO_RATE_LIMIT_MODE (2 << 16) #define CPSW_INTPACEEN (0x3f << 16) #define CPSW_INTPRESCALE_MASK (0x7FF << 0) #define CPSW_CMINTMAX_CNT 63 #define CPSW_CMINTMIN_CNT 2 #define CPSW_CMINTMAX_INTVL (1000 / CPSW_CMINTMIN_CNT) #define CPSW_CMINTMIN_INTVL ((1000 / CPSW_CMINTMAX_CNT) + 1) #define IRQ_NUM 2 #define CPSW_MAX_QUEUES 8 #define CPSW_CPDMA_DESCS_POOL_SIZE_DEFAULT 256 #define CPSW_ALE_AGEOUT_DEFAULT 10 /* sec */ #define CPSW_FIFO_QUEUE_TYPE_SHIFT 16 #define CPSW_FIFO_SHAPE_EN_SHIFT 16 #define CPSW_FIFO_RATE_EN_SHIFT 20 #define CPSW_TC_NUM 4 #define CPSW_FIFO_SHAPERS_NUM (CPSW_TC_NUM - 1) #define CPSW_PCT_MASK 0x7f #define CPSW_BD_RAM_SIZE 0x2000 #define CPSW_RX_VLAN_ENCAP_HDR_PRIO_SHIFT 29 #define CPSW_RX_VLAN_ENCAP_HDR_PRIO_MSK GENMASK(2, 0) #define CPSW_RX_VLAN_ENCAP_HDR_VID_SHIFT 16 #define CPSW_RX_VLAN_ENCAP_HDR_PKT_TYPE_SHIFT 8 #define CPSW_RX_VLAN_ENCAP_HDR_PKT_TYPE_MSK GENMASK(1, 0) enum { CPSW_RX_VLAN_ENCAP_HDR_PKT_VLAN_TAG = 0, CPSW_RX_VLAN_ENCAP_HDR_PKT_RESERV, CPSW_RX_VLAN_ENCAP_HDR_PKT_PRIO_TAG, CPSW_RX_VLAN_ENCAP_HDR_PKT_UNTAG, }; struct cpsw_wr_regs { u32 id_ver; u32 soft_reset; u32 control; u32 int_control; u32 rx_thresh_en; u32 rx_en; u32 tx_en; u32 misc_en; u32 mem_allign1[8]; u32 rx_thresh_stat; u32 rx_stat; u32 tx_stat; u32 misc_stat; u32 mem_allign2[8]; u32 rx_imax; u32 tx_imax; }; struct cpsw_ss_regs { u32 id_ver; u32 control; u32 soft_reset; u32 stat_port_en; u32 ptype; u32 soft_idle; u32 thru_rate; u32 gap_thresh; u32 tx_start_wds; u32 flow_control; u32 vlan_ltype; u32 ts_ltype; u32 dlr_ltype; }; /* CPSW_PORT_V1 */ #define CPSW1_MAX_BLKS 0x00 /* Maximum FIFO Blocks */ #define CPSW1_BLK_CNT 0x04 /* FIFO Block Usage Count (Read Only) */ #define CPSW1_TX_IN_CTL 0x08 /* Transmit FIFO Control */ #define CPSW1_PORT_VLAN 0x0c /* VLAN Register */ #define CPSW1_TX_PRI_MAP 0x10 /* Tx Header Priority to Switch Pri Mapping */ #define CPSW1_TS_CTL 0x14 /* Time Sync Control */ #define CPSW1_TS_SEQ_LTYPE 0x18 /* Time Sync Sequence ID Offset and Msg Type */ #define CPSW1_TS_VLAN 0x1c /* Time Sync VLAN1 and VLAN2 */ /* CPSW_PORT_V2 */ #define CPSW2_CONTROL 0x00 /* Control Register */ #define CPSW2_MAX_BLKS 0x08 /* Maximum FIFO Blocks */ #define CPSW2_BLK_CNT 0x0c /* FIFO Block Usage Count (Read Only) */ #define CPSW2_TX_IN_CTL 0x10 /* Transmit FIFO Control */ #define CPSW2_PORT_VLAN 0x14 /* VLAN Register */ #define CPSW2_TX_PRI_MAP 0x18 /* Tx Header Priority to Switch Pri Mapping */ #define CPSW2_TS_SEQ_MTYPE 0x1c /* Time Sync Sequence ID Offset and Msg Type */ /* CPSW_PORT_V1 and V2 */ #define SA_LO 0x20 /* CPGMAC_SL Source Address Low */ #define SA_HI 0x24 /* CPGMAC_SL Source Address High */ #define SEND_PERCENT 0x28 /* Transmit Queue Send Percentages */ /* CPSW_PORT_V2 only */ #define RX_DSCP_PRI_MAP0 0x30 /* Rx DSCP Priority to Rx Packet Mapping */ #define RX_DSCP_PRI_MAP1 0x34 /* Rx DSCP Priority to Rx Packet Mapping */ #define RX_DSCP_PRI_MAP2 0x38 /* Rx DSCP Priority to Rx Packet Mapping */ #define RX_DSCP_PRI_MAP3 0x3c /* Rx DSCP Priority to Rx Packet Mapping */ #define RX_DSCP_PRI_MAP4 0x40 /* Rx DSCP Priority to Rx Packet Mapping */ #define RX_DSCP_PRI_MAP5 0x44 /* Rx DSCP Priority to Rx Packet Mapping */ #define RX_DSCP_PRI_MAP6 0x48 /* Rx DSCP Priority to Rx Packet Mapping */ #define RX_DSCP_PRI_MAP7 0x4c /* Rx DSCP Priority to Rx Packet Mapping */ /* Bit definitions for the CPSW2_CONTROL register */ #define PASS_PRI_TAGGED BIT(24) /* Pass Priority Tagged */ #define VLAN_LTYPE2_EN BIT(21) /* VLAN LTYPE 2 enable */ #define VLAN_LTYPE1_EN BIT(20) /* VLAN LTYPE 1 enable */ #define DSCP_PRI_EN BIT(16) /* DSCP Priority Enable */ #define TS_107 BIT(15) /* Tyme Sync Dest IP Address 107 */ #define TS_320 BIT(14) /* Time Sync Dest Port 320 enable */ #define TS_319 BIT(13) /* Time Sync Dest Port 319 enable */ #define TS_132 BIT(12) /* Time Sync Dest IP Addr 132 enable */ #define TS_131 BIT(11) /* Time Sync Dest IP Addr 131 enable */ #define TS_130 BIT(10) /* Time Sync Dest IP Addr 130 enable */ #define TS_129 BIT(9) /* Time Sync Dest IP Addr 129 enable */ #define TS_TTL_NONZERO BIT(8) /* Time Sync Time To Live Non-zero enable */ #define TS_ANNEX_F_EN BIT(6) /* Time Sync Annex F enable */ #define TS_ANNEX_D_EN BIT(4) /* Time Sync Annex D enable */ #define TS_LTYPE2_EN BIT(3) /* Time Sync LTYPE 2 enable */ #define TS_LTYPE1_EN BIT(2) /* Time Sync LTYPE 1 enable */ #define TS_TX_EN BIT(1) /* Time Sync Transmit Enable */ #define TS_RX_EN BIT(0) /* Time Sync Receive Enable */ #define CTRL_V2_TS_BITS \ (TS_320 | TS_319 | TS_132 | TS_131 | TS_130 | TS_129 |\ TS_TTL_NONZERO | TS_ANNEX_D_EN | TS_LTYPE1_EN | VLAN_LTYPE1_EN) #define CTRL_V2_ALL_TS_MASK (CTRL_V2_TS_BITS | TS_TX_EN | TS_RX_EN) #define CTRL_V2_TX_TS_BITS (CTRL_V2_TS_BITS | TS_TX_EN) #define CTRL_V2_RX_TS_BITS (CTRL_V2_TS_BITS | TS_RX_EN) #define CTRL_V3_TS_BITS \ (TS_107 | TS_320 | TS_319 | TS_132 | TS_131 | TS_130 | TS_129 |\ TS_TTL_NONZERO | TS_ANNEX_F_EN | TS_ANNEX_D_EN |\ TS_LTYPE1_EN | VLAN_LTYPE1_EN) #define CTRL_V3_ALL_TS_MASK (CTRL_V3_TS_BITS | TS_TX_EN | TS_RX_EN) #define CTRL_V3_TX_TS_BITS (CTRL_V3_TS_BITS | TS_TX_EN) #define CTRL_V3_RX_TS_BITS (CTRL_V3_TS_BITS | TS_RX_EN) /* Bit definitions for the CPSW2_TS_SEQ_MTYPE register */ #define TS_SEQ_ID_OFFSET_SHIFT (16) /* Time Sync Sequence ID Offset */ #define TS_SEQ_ID_OFFSET_MASK (0x3f) #define TS_MSG_TYPE_EN_SHIFT (0) /* Time Sync Message Type Enable */ #define TS_MSG_TYPE_EN_MASK (0xffff) /* The PTP event messages - Sync, Delay_Req, Pdelay_Req, and Pdelay_Resp. */ #define EVENT_MSG_BITS ((1<<0) | (1<<1) | (1<<2) | (1<<3)) /* Bit definitions for the CPSW1_TS_CTL register */ #define CPSW_V1_TS_RX_EN BIT(0) #define CPSW_V1_TS_TX_EN BIT(4) #define CPSW_V1_MSG_TYPE_OFS 16 /* Bit definitions for the CPSW1_TS_SEQ_LTYPE register */ #define CPSW_V1_SEQ_ID_OFS_SHIFT 16 #define CPSW_MAX_BLKS_TX 15 #define CPSW_MAX_BLKS_TX_SHIFT 4 #define CPSW_MAX_BLKS_RX 5 struct cpsw_host_regs { u32 max_blks; u32 blk_cnt; u32 tx_in_ctl; u32 port_vlan; u32 tx_pri_map; u32 cpdma_tx_pri_map; u32 cpdma_rx_chan_map; }; struct cpsw_slave_data { struct device_node *slave_node; struct device_node *phy_node; char phy_id[MII_BUS_ID_SIZE]; phy_interface_t phy_if; u8 mac_addr[ETH_ALEN]; u16 dual_emac_res_vlan; /* Reserved VLAN for DualEMAC */ struct phy *ifphy; bool disabled; }; struct cpsw_platform_data { struct cpsw_slave_data *slave_data; u32 ss_reg_ofs; /* Subsystem control register offset */ u32 channels; /* number of cpdma channels (symmetric) */ u32 slaves; /* number of slave cpgmac ports */ u32 active_slave;/* time stamping, ethtool and SIOCGMIIPHY slave */ u32 bd_ram_size; /*buffer descriptor ram size */ u32 mac_control; /* Mac control register */ u16 default_vlan; /* Def VLAN for ALE lookup in VLAN aware mode*/ bool dual_emac; /* Enable Dual EMAC mode */ }; struct cpsw_slave { void __iomem *regs; int slave_num; u32 mac_control; struct cpsw_slave_data *data; struct phy_device *phy; struct net_device *ndev; u32 port_vlan; struct cpsw_sl *mac_sl; }; static inline u32 slave_read(struct cpsw_slave *slave, u32 offset) { return readl_relaxed(slave->regs + offset); } static inline void slave_write(struct cpsw_slave *slave, u32 val, u32 offset) { writel_relaxed(val, slave->regs + offset); } struct cpsw_vector { struct cpdma_chan *ch; int budget; }; struct cpsw_common { struct device *dev; struct cpsw_platform_data data; struct napi_struct napi_rx; struct napi_struct napi_tx; struct cpsw_ss_regs __iomem *regs; struct cpsw_wr_regs __iomem *wr_regs; u8 __iomem *hw_stats; struct cpsw_host_regs __iomem *host_port_regs; u32 version; u32 coal_intvl; u32 bus_freq_mhz; int rx_packet_max; int descs_pool_size; struct cpsw_slave *slaves; struct cpdma_ctlr *dma; struct cpsw_vector txv[CPSW_MAX_QUEUES]; struct cpsw_vector rxv[CPSW_MAX_QUEUES]; struct cpsw_ale *ale; bool quirk_irq; bool rx_irq_disabled; bool tx_irq_disabled; u32 irqs_table[IRQ_NUM]; int misc_irq; struct cpts *cpts; struct devlink *devlink; int rx_ch_num, tx_ch_num; int speed; int usage_count; struct page_pool *page_pool[CPSW_MAX_QUEUES]; u8 br_members; struct net_device *hw_bridge_dev; bool ale_bypass; u8 base_mac[ETH_ALEN]; }; struct cpsw_priv { struct net_device *ndev; struct device *dev; u32 msg_enable; u8 mac_addr[ETH_ALEN]; bool rx_pause; bool tx_pause; bool mqprio_hw; int fifo_bw[CPSW_TC_NUM]; int shp_cfg_speed; int tx_ts_enabled; int rx_ts_enabled; struct bpf_prog *xdp_prog; struct xdp_rxq_info xdp_rxq[CPSW_MAX_QUEUES]; struct xdp_attachment_info xdpi; u32 emac_port; struct cpsw_common *cpsw; int offload_fwd_mark; u32 tx_packet_min; }; #define ndev_to_cpsw(ndev) (((struct cpsw_priv *)netdev_priv(ndev))->cpsw) #define napi_to_cpsw(napi) container_of(napi, struct cpsw_common, napi) extern int (*cpsw_slave_index)(struct cpsw_common *cpsw, struct cpsw_priv *priv); struct addr_sync_ctx { struct net_device *ndev; const u8 *addr; /* address to be synched */ int consumed; /* number of address instances */ int flush; /* flush flag */ }; #define CPSW_XMETA_OFFSET ALIGN(sizeof(struct xdp_frame), sizeof(long)) #define CPSW_XDP_CONSUMED 1 #define CPSW_XDP_PASS 0 struct __aligned(sizeof(long)) cpsw_meta_xdp { struct net_device *ndev; int ch; }; /* The buf includes headroom compatible with both skb and xdpf */ #define CPSW_HEADROOM_NA (max(XDP_PACKET_HEADROOM, NET_SKB_PAD) + NET_IP_ALIGN) #define CPSW_HEADROOM ALIGN(CPSW_HEADROOM_NA, sizeof(long)) static inline int cpsw_is_xdpf_handle(void *handle) { return (unsigned long)handle & BIT(0); } static inline void *cpsw_xdpf_to_handle(struct xdp_frame *xdpf) { return (void *)((unsigned long)xdpf | BIT(0)); } static inline struct xdp_frame *cpsw_handle_to_xdpf(void *handle) { return (struct xdp_frame *)((unsigned long)handle & ~BIT(0)); } int cpsw_init_common(struct cpsw_common *cpsw, void __iomem *ss_regs, int ale_ageout, phys_addr_t desc_mem_phys, int descs_pool_size); void cpsw_split_res(struct cpsw_common *cpsw); int cpsw_fill_rx_channels(struct cpsw_priv *priv); void cpsw_intr_enable(struct cpsw_common *cpsw); void cpsw_intr_disable(struct cpsw_common *cpsw); void cpsw_tx_handler(void *token, int len, int status); int cpsw_create_xdp_rxqs(struct cpsw_common *cpsw); void cpsw_destroy_xdp_rxqs(struct cpsw_common *cpsw); int cpsw_ndo_bpf(struct net_device *ndev, struct netdev_bpf *bpf); int cpsw_xdp_tx_frame(struct cpsw_priv *priv, struct xdp_frame *xdpf, struct page *page, int port); int cpsw_run_xdp(struct cpsw_priv *priv, int ch, struct xdp_buff *xdp, struct page *page, int port); irqreturn_t cpsw_tx_interrupt(int irq, void *dev_id); irqreturn_t cpsw_rx_interrupt(int irq, void *dev_id); irqreturn_t cpsw_misc_interrupt(int irq, void *dev_id); int cpsw_tx_mq_poll(struct napi_struct *napi_tx, int budget); int cpsw_tx_poll(struct napi_struct *napi_tx, int budget); int cpsw_rx_mq_poll(struct napi_struct *napi_rx, int budget); int cpsw_rx_poll(struct napi_struct *napi_rx, int budget); void cpsw_rx_vlan_encap(struct sk_buff *skb); void soft_reset(const char *module, void __iomem *reg); void cpsw_set_slave_mac(struct cpsw_slave *slave, struct cpsw_priv *priv); void cpsw_ndo_tx_timeout(struct net_device *ndev, unsigned int txqueue); int cpsw_need_resplit(struct cpsw_common *cpsw); int cpsw_ndo_ioctl(struct net_device *dev, struct ifreq *req, int cmd); int cpsw_ndo_set_tx_maxrate(struct net_device *ndev, int queue, u32 rate); int cpsw_ndo_setup_tc(struct net_device *ndev, enum tc_setup_type type, void *type_data); bool cpsw_shp_is_off(struct cpsw_priv *priv); void cpsw_cbs_resume(struct cpsw_slave *slave, struct cpsw_priv *priv); void cpsw_mqprio_resume(struct cpsw_slave *slave, struct cpsw_priv *priv); /* ethtool */ u32 cpsw_get_msglevel(struct net_device *ndev); void cpsw_set_msglevel(struct net_device *ndev, u32 value); int cpsw_get_coalesce(struct net_device *ndev, struct ethtool_coalesce *coal); int cpsw_set_coalesce(struct net_device *ndev, struct ethtool_coalesce *coal); int cpsw_get_sset_count(struct net_device *ndev, int sset); void cpsw_get_strings(struct net_device *ndev, u32 stringset, u8 *data); void cpsw_get_ethtool_stats(struct net_device *ndev, struct ethtool_stats *stats, u64 *data); void cpsw_get_pauseparam(struct net_device *ndev, struct ethtool_pauseparam *pause); void cpsw_get_wol(struct net_device *ndev, struct ethtool_wolinfo *wol); int cpsw_set_wol(struct net_device *ndev, struct ethtool_wolinfo *wol); int cpsw_get_regs_len(struct net_device *ndev); void cpsw_get_regs(struct net_device *ndev, struct ethtool_regs *regs, void *p); int cpsw_ethtool_op_begin(struct net_device *ndev); void cpsw_ethtool_op_complete(struct net_device *ndev); void cpsw_get_channels(struct net_device *ndev, struct ethtool_channels *ch); int cpsw_get_link_ksettings(struct net_device *ndev, struct ethtool_link_ksettings *ecmd); int cpsw_set_link_ksettings(struct net_device *ndev, const struct ethtool_link_ksettings *ecmd); int cpsw_get_eee(struct net_device *ndev, struct ethtool_eee *edata); int cpsw_set_eee(struct net_device *ndev, struct ethtool_eee *edata); int cpsw_nway_reset(struct net_device *ndev); void cpsw_get_ringparam(struct net_device *ndev, struct ethtool_ringparam *ering); int cpsw_set_ringparam(struct net_device *ndev, struct ethtool_ringparam *ering); int cpsw_set_channels_common(struct net_device *ndev, struct ethtool_channels *chs, cpdma_handler_fn rx_handler); int cpsw_get_ts_info(struct net_device *ndev, struct ethtool_ts_info *info); #endif /* DRIVERS_NET_ETHERNET_TI_CPSW_PRIV_H_ */
34.57515
80
0.752913
a2806d744b97a77705d6f380576cef77b4940181
1,064
h
C
src/base/hash/md5_constexpr.h
Chilledheart/naiveproxy
9d28da89b325a90d33add830f4202c8b17c7c3e3
[ "BSD-3-Clause" ]
null
null
null
src/base/hash/md5_constexpr.h
Chilledheart/naiveproxy
9d28da89b325a90d33add830f4202c8b17c7c3e3
[ "BSD-3-Clause" ]
null
null
null
src/base/hash/md5_constexpr.h
Chilledheart/naiveproxy
9d28da89b325a90d33add830f4202c8b17c7c3e3
[ "BSD-3-Clause" ]
null
null
null
// Copyright 2019 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef BASE_HASH_MD5_CONSTEXPR_H_ #define BASE_HASH_MD5_CONSTEXPR_H_ #include "base/hash/md5_constexpr_internal.h" namespace base { // Calculates the first 32/64 bits of the MD5 digest of the provided data, // returned as a uint32_t/uint64_t. When passing |string| with no explicit // length the terminating null will not be processed. This abstracts away // endianness so that the integer will read as the first 4 or 8 bytes of the // MD5 sum, ensuring that the following outputs are equivalent for // convenience: // // printf("%08x\n", MD5Hash32Constexpr("foo")); constexpr uint64_t MD5Hash64Constexpr(const char* string); constexpr uint64_t MD5Hash64Constexpr(const char* data, uint32_t length); constexpr uint32_t MD5Hash32Constexpr(const char* string); constexpr uint32_t MD5Hash32Constexpr(const char* data, uint32_t length); } // namespace base #endif // BASE_HASH_MD5_CONSTEXPR_H_
38
76
0.784774
c87a6f0bb31ef2aabc51b1bb3d08946e62738687
88,728
c
C
src/pixafunc2.c
wangdongxun/leptonica
3e12c41810d0e37c22564f392ab62996c6aa0214
[ "BSD-2-Clause" ]
3
2018-02-03T17:54:15.000Z
2020-05-19T03:01:59.000Z
src/pixafunc2.c
wangdongxun/leptonica
3e12c41810d0e37c22564f392ab62996c6aa0214
[ "BSD-2-Clause" ]
null
null
null
src/pixafunc2.c
wangdongxun/leptonica
3e12c41810d0e37c22564f392ab62996c6aa0214
[ "BSD-2-Clause" ]
3
2019-06-08T12:26:59.000Z
2020-05-23T06:19:53.000Z
/*====================================================================* - Copyright (C) 2001 Leptonica. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANY - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *====================================================================*/ /*! * \file pixafunc2.c * <pre> * * Pixa display (render into a pix) * PIX *pixaDisplay() * PIX *pixaDisplayOnColor() * PIX *pixaDisplayRandomCmap() * PIX *pixaDisplayLinearly() * PIX *pixaDisplayOnLattice() * PIX *pixaDisplayUnsplit() * PIX *pixaDisplayTiled() * PIX *pixaDisplayTiledInRows() * PIX *pixaDisplayTiledInColumns() * PIX *pixaDisplayTiledAndScaled() * PIX *pixaDisplayTiledWithText() * PIX *pixaDisplayTiledByIndex() * * Pixaa display (render into a pix) * PIX *pixaaDisplay() * PIX *pixaaDisplayByPixa() * PIXA *pixaaDisplayTiledAndScaled() * * Conversion of all pix to specified type (e.g., depth) * PIXA *pixaConvertTo1() * PIXA *pixaConvertTo8() * PIXA *pixaConvertTo8Colormap() * PIXA *pixaConvertTo32() * * Pixa constrained selection and pdf generation * PIXA *pixaConstrainedSelect() * l_int32 pixaSelectToPdf() * * Pixa display into multiple tiles * PIXA *pixaDisplayMultiTiled() * * Split pixa into files * l_int32 pixaSplitIntoFiles() * * Tile N-Up * l_int32 convertToNUpFiles() * PIXA *convertToNUpPixa() * PIXA *pixaConvertToNUpPixa() * * Render two pixa side-by-side for comparison * * l_int32 pixaCompareInPdf() * * We give twelve pixaDisplay*() methods for tiling a pixa in a pix. * Some work for 1 bpp input; others for any input depth. * Some give an output depth that depends on the input depth; * others give a different output depth or allow you to choose it. * Some use a boxes to determine where each pix goes; others tile * onto a regular lattice; others tile onto an irregular lattice; * one uses an associated index array to determine which column * each pix goes into. * * Here is a brief description of what the pixa display functions do. * * pixaDisplay() * This uses the boxes in the pixa to lay out each pix. This * can be used to reconstruct a pix that has been broken into * components, if the boxes represents the positions of the * components in the original image. * pixaDisplayOnColor() * pixaDisplay() with choice of background color. * pixaDisplayRandomCmap() * This also uses the boxes to lay out each pix. However, it creates * a colormapped dest, where each 1 bpp pix is given a randomly * generated color (up to 256 are used). * pixaDisplayLinearly() * This puts each pix, sequentially, in a line, either horizontally * or vertically. * pixaDisplayOnLattice() * This puts each pix, sequentially, onto a regular lattice, * omitting any pix that are too big for the lattice size. * This is useful, for example, to store bitmapped fonts, * where all the characters are stored in a single image. * pixaDisplayUnsplit() * This lays out a mosaic of tiles (the pix in the pixa) that * are all of equal size. (Don't use this for unequal sized pix!) * For example, it can be used to invert the action of * pixaSplitPix(). * pixaDisplayTiled() * Like pixaDisplayOnLattice(), this places each pix on a regular * lattice, but here the lattice size is determined by the * largest component, and no components are omitted. This is * dangerous if there are thousands of small components and * one or more very large one, because the size of the resulting * pix can be huge! * pixaDisplayTiledInRows() * This puts each pix down in a series of rows, where the upper * edges of each pix in a row are aligned and there is a uniform * spacing between the pix. The height of each row is determined * by the tallest pix that was put in the row. This function * is a reasonably efficient way to pack the subimages. * A boxa of the locations of each input pix is stored in the output. * pixaDisplayTiledInColumns() * This puts each pix down in a series of rows, each row having * a specified number of pix. The upper edges of each pix in a * row are aligned and there is a uniform spacing between the pix. * The height of each row is determined by the tallest pix that * was put in the row. A boxa of the locations of each input * pix is stored in the output. * pixaDisplayTiledAndScaled() * This scales each pix to a given width and output depth, and then * tiles them in rows with a given number placed in each row. * This is useful for presenting a sequence of images that can be * at different resolutions, but which are derived from the same * initial image. * pixaDisplayTiledWithText() * This is a version of pixaDisplayTiledInRows() that prints, below * each pix, the text in the pix text field. It renders a pixa * to an image with white background that does not exceed a * given value in width. * pixaDisplayTiledByIndex() * This scales each pix to a given width and output depth, * and then tiles them in columns corresponding to the value * in an associated numa. All pix with the same index value are * rendered in the same column. Text in the pix text field are * rendered below the pix. * </pre> */ #include <string.h> #include <math.h> /* for sqrt() */ #include "allheaders.h" /*---------------------------------------------------------------------* * Pixa Display * *---------------------------------------------------------------------*/ /*! * \brief pixaDisplay() * * \param[in] pixa * \param[in] w, h if set to 0, the size is determined from the * bounding box of the components in pixa * \return pix, or NULL on error * * <pre> * Notes: * (1) This uses the boxes to place each pix in the rendered composite. * (2) Set w = h = 0 to use the b.b. of the components to determine * the size of the returned pix. * (3) Uses the first pix in pixa to determine the depth. * (4) The background is written "white". On 1 bpp, each successive * pix is "painted" (adding foreground), whereas for grayscale * or color each successive pix is blitted with just the src. * (5) If the pixa is empty, returns an empty 1 bpp pix. * </pre> */ PIX * pixaDisplay(PIXA *pixa, l_int32 w, l_int32 h) { l_int32 i, n, d, xb, yb, wb, hb, res; BOXA *boxa; PIX *pix1, *pixd; PROCNAME("pixaDisplay"); if (!pixa) return (PIX *)ERROR_PTR("pixa not defined", procName, NULL); n = pixaGetCount(pixa); if (n == 0 && w == 0 && h == 0) return (PIX *)ERROR_PTR("no components; no size", procName, NULL); if (n == 0) { L_WARNING("no components; returning empty 1 bpp pix\n", procName); return pixCreate(w, h, 1); } /* If w and h not input, determine the minimum size required * to contain the origin and all c.c. */ if (w == 0 || h == 0) { boxa = pixaGetBoxa(pixa, L_CLONE); boxaGetExtent(boxa, &w, &h, NULL); boxaDestroy(&boxa); if (w == 0 || h == 0) return (PIX *)ERROR_PTR("no associated boxa", procName, NULL); } /* Use the first pix in pixa to determine depth and resolution */ pix1 = pixaGetPix(pixa, 0, L_CLONE); d = pixGetDepth(pix1); res = pixGetXRes(pix1); pixDestroy(&pix1); if ((pixd = pixCreate(w, h, d)) == NULL) return (PIX *)ERROR_PTR("pixd not made", procName, NULL); pixSetResolution(pixd, res, res); if (d > 1) pixSetAll(pixd); for (i = 0; i < n; i++) { if (pixaGetBoxGeometry(pixa, i, &xb, &yb, &wb, &hb)) { L_WARNING("no box found!\n", procName); continue; } pix1 = pixaGetPix(pixa, i, L_CLONE); if (d == 1) pixRasterop(pixd, xb, yb, wb, hb, PIX_PAINT, pix1, 0, 0); else pixRasterop(pixd, xb, yb, wb, hb, PIX_SRC, pix1, 0, 0); pixDestroy(&pix1); } return pixd; } /*! * \brief pixaDisplayOnColor() * * \param[in] pixa * \param[in] w, h if set to 0, the size is determined from the * bounding box of the components in pixa * \param[in] bgcolor background color to use * \return pix, or NULL on error * * <pre> * Notes: * (1) This uses the boxes to place each pix in the rendered composite. * (2) Set w = h = 0 to use the b.b. of the components to determine * the size of the returned pix. * (3) If any pix in %pixa are colormapped, or if the pix have * different depths, it returns a 32 bpp pix. Otherwise, * the depth of the returned pixa equals that of the pix in %pixa. * (4) If the pixa is empty, return null. * </pre> */ PIX * pixaDisplayOnColor(PIXA *pixa, l_int32 w, l_int32 h, l_uint32 bgcolor) { l_int32 i, n, xb, yb, wb, hb, hascmap, maxdepth, same, res; BOXA *boxa; PIX *pix1, *pix2, *pixd; PIXA *pixat; PROCNAME("pixaDisplayOnColor"); if (!pixa) return (PIX *)ERROR_PTR("pixa not defined", procName, NULL); if ((n = pixaGetCount(pixa)) == 0) return (PIX *)ERROR_PTR("no components", procName, NULL); /* If w and h are not input, determine the minimum size * required to contain the origin and all c.c. */ if (w == 0 || h == 0) { boxa = pixaGetBoxa(pixa, L_CLONE); boxaGetExtent(boxa, &w, &h, NULL); boxaDestroy(&boxa); } /* If any pix have colormaps, or if they have different depths, * generate rgb */ pixaAnyColormaps(pixa, &hascmap); pixaGetDepthInfo(pixa, &maxdepth, &same); if (hascmap || !same) { maxdepth = 32; pixat = pixaCreate(n); for (i = 0; i < n; i++) { pix1 = pixaGetPix(pixa, i, L_CLONE); pix2 = pixConvertTo32(pix1); pixaAddPix(pixat, pix2, L_INSERT); pixDestroy(&pix1); } } else { pixat = pixaCopy(pixa, L_CLONE); } /* Make the output pix and set the background color */ if ((pixd = pixCreate(w, h, maxdepth)) == NULL) { pixaDestroy(&pixat); return (PIX *)ERROR_PTR("pixd not made", procName, NULL); } if ((maxdepth == 1 && bgcolor > 0) || (maxdepth == 2 && bgcolor >= 0x3) || (maxdepth == 4 && bgcolor >= 0xf) || (maxdepth == 8 && bgcolor >= 0xff) || (maxdepth == 16 && bgcolor >= 0xffff) || (maxdepth == 32 && bgcolor >= 0xffffff00)) { pixSetAll(pixd); } else if (bgcolor > 0) { pixSetAllArbitrary(pixd, bgcolor); } /* Blit each pix into its place */ for (i = 0; i < n; i++) { if (pixaGetBoxGeometry(pixat, i, &xb, &yb, &wb, &hb)) { L_WARNING("no box found!\n", procName); continue; } pix1 = pixaGetPix(pixat, i, L_CLONE); if (i == 0) res = pixGetXRes(pix1); pixRasterop(pixd, xb, yb, wb, hb, PIX_SRC, pix1, 0, 0); pixDestroy(&pix1); } pixSetResolution(pixd, res, res); pixaDestroy(&pixat); return pixd; } /*! * \brief pixaDisplayRandomCmap() * * \param[in] pixa 1 bpp regions, with boxa delineating those regions * \param[in] w, h if set to 0, the size is determined from the * bounding box of the components in pixa * \return pix 8 bpp, cmapped, with random colors assigned to each region, * or NULL on error. * * <pre> * Notes: * (1) This uses the boxes to place each pix in the rendered composite. * The fg of each pix in %pixa, such as a single connected * component or a line of text, is given a random color. * (2) By default, the background color is black (cmap index 0). * This can be changed by pixcmapResetColor() * </pre> */ PIX * pixaDisplayRandomCmap(PIXA *pixa, l_int32 w, l_int32 h) { l_int32 i, n, maxdepth, index, xb, yb, wb, hb, res; BOXA *boxa; PIX *pixs, *pix1, *pixd; PIXCMAP *cmap; PROCNAME("pixaDisplayRandomCmap"); if (!pixa) return (PIX *)ERROR_PTR("pixa not defined", procName, NULL); if ((n = pixaGetCount(pixa)) == 0) return (PIX *)ERROR_PTR("no components", procName, NULL); pixaVerifyDepth(pixa, &maxdepth); if (maxdepth != 1) return (PIX *)ERROR_PTR("not all components are 1 bpp", procName, NULL); /* If w and h are not input, determine the minimum size required * to contain the origin and all c.c. */ if (w == 0 || h == 0) { boxa = pixaGetBoxa(pixa, L_CLONE); boxaGetExtent(boxa, &w, &h, NULL); boxaDestroy(&boxa); } /* Set up an 8 bpp dest pix, with a colormap with 254 random colors */ if ((pixd = pixCreate(w, h, 8)) == NULL) return (PIX *)ERROR_PTR("pixd not made", procName, NULL); cmap = pixcmapCreateRandom(8, 1, 1); pixSetColormap(pixd, cmap); /* Color each component and blit it in */ for (i = 0; i < n; i++) { index = 1 + (i % 254); pixaGetBoxGeometry(pixa, i, &xb, &yb, &wb, &hb); pixs = pixaGetPix(pixa, i, L_CLONE); if (i == 0) res = pixGetXRes(pixs); pix1 = pixConvert1To8(NULL, pixs, 0, index); pixRasterop(pixd, xb, yb, wb, hb, PIX_PAINT, pix1, 0, 0); pixDestroy(&pixs); pixDestroy(&pix1); } pixSetResolution(pixd, res, res); return pixd; } /*! * \brief pixaDisplayLinearly() * * \param[in] pixas * \param[in] direction L_HORIZ or L_VERT * \param[in] scalefactor applied to every pix; use 1.0 for no scaling * \param[in] background 0 for white, 1 for black; this is the color * of the spacing between the images * \param[in] spacing between images, and on outside * \param[in] border width of black border added to each image; * use 0 for no border * \param[out] pboxa [optional] location of images in output pix * \return pix of composite images, or NULL on error * * <pre> * Notes: * (1) This puts each pix, sequentially, in a line, either horizontally * or vertically. * (2) If any pix has a colormap, all pix are rendered in rgb. * (3) The boxa gives the location of each image. * </pre> */ PIX * pixaDisplayLinearly(PIXA *pixas, l_int32 direction, l_float32 scalefactor, l_int32 background, /* not used */ l_int32 spacing, l_int32 border, BOXA **pboxa) { l_int32 i, n, x, y, w, h, size, depth, bordval; BOX *box; PIX *pix1, *pix2, *pix3, *pixd; PIXA *pixa1, *pixa2; PROCNAME("pixaDisplayLinearly"); if (pboxa) *pboxa = NULL; if (!pixas) return (PIX *)ERROR_PTR("pixas not defined", procName, NULL); if (direction != L_HORIZ && direction != L_VERT) return (PIX *)ERROR_PTR("invalid direction", procName, NULL); /* Make sure all pix are at the same depth */ pixa1 = pixaConvertToSameDepth(pixas); pixaGetDepthInfo(pixa1, &depth, NULL); /* Scale and add border if requested */ n = pixaGetCount(pixa1); pixa2 = pixaCreate(n); bordval = (depth == 1) ? 1 : 0; size = (n - 1) * spacing; x = y = 0; for (i = 0; i < n; i++) { if ((pix1 = pixaGetPix(pixa1, i, L_CLONE)) == NULL) { L_WARNING("missing pix at index %d\n", procName, i); continue; } if (scalefactor != 1.0) pix2 = pixScale(pix1, scalefactor, scalefactor); else pix2 = pixClone(pix1); if (border) pix3 = pixAddBorder(pix2, border, bordval); else pix3 = pixClone(pix2); pixGetDimensions(pix3, &w, &h, NULL); box = boxCreate(x, y, w, h); if (direction == L_HORIZ) { size += w; x += w + spacing; } else { /* vertical */ size += h; y += h + spacing; } pixaAddPix(pixa2, pix3, L_INSERT); pixaAddBox(pixa2, box, L_INSERT); pixDestroy(&pix1); pixDestroy(&pix2); } pixd = pixaDisplay(pixa2, 0, 0); if (pboxa) *pboxa = pixaGetBoxa(pixa2, L_COPY); pixaDestroy(&pixa1); pixaDestroy(&pixa2); return pixd; } /*! * \brief pixaDisplayOnLattice() * * \param[in] pixa * \param[in] cellw lattice cell width * \param[in] cellh lattice cell height * \param[out] pncols [optional] number of columns in output lattice * \param[out] pboxa [optional] location of images in lattice * \return pix of composite images, or NULL on error * * <pre> * Notes: * (1) This places each pix on sequentially on a regular lattice * in the rendered composite. If a pix is too large to fit in the * allocated lattice space, it is not rendered. * (2) If any pix has a colormap, all pix are rendered in rgb. * (3) This is useful when putting bitmaps of components, * such as characters, into a single image. * (4) The boxa gives the location of each image. The UL corner * of each image is on a lattice cell corner. Omitted images * (due to size) are assigned an invalid width and height of 0. * </pre> */ PIX * pixaDisplayOnLattice(PIXA *pixa, l_int32 cellw, l_int32 cellh, l_int32 *pncols, BOXA **pboxa) { l_int32 n, nw, nh, w, h, d, wt, ht, res; l_int32 index, i, j, hascmap; BOX *box; BOXA *boxa; PIX *pix1, *pix2, *pixd; PIXA *pixa1; PROCNAME("pixaDisplayOnLattice"); if (pncols) *pncols = 0; if (pboxa) *pboxa = NULL; if (!pixa) return (PIX *)ERROR_PTR("pixa not defined", procName, NULL); /* If any pix have colormaps, generate rgb */ if ((n = pixaGetCount(pixa)) == 0) return (PIX *)ERROR_PTR("no components", procName, NULL); pix1 = pixaGetPix(pixa, 0, L_CLONE); res = pixGetXRes(pix1); pixDestroy(&pix1); pixaAnyColormaps(pixa, &hascmap); if (hascmap) { pixa1 = pixaCreate(n); for (i = 0; i < n; i++) { pix1 = pixaGetPix(pixa, i, L_CLONE); pix2 = pixConvertTo32(pix1); pixaAddPix(pixa1, pix2, L_INSERT); pixDestroy(&pix1); } } else { pixa1 = pixaCopy(pixa, L_CLONE); } boxa = boxaCreate(n); /* Have number of rows and columns approximately equal */ nw = (l_int32)sqrt((l_float64)n); nh = (n + nw - 1) / nw; w = cellw * nw; h = cellh * nh; /* Use the first pix in pixa to determine the output depth. */ pixaGetPixDimensions(pixa1, 0, NULL, NULL, &d); if ((pixd = pixCreate(w, h, d)) == NULL) { pixaDestroy(&pixa1); return (PIX *)ERROR_PTR("pixd not made", procName, NULL); } pixSetBlackOrWhite(pixd, L_SET_WHITE); pixSetResolution(pixd, res, res); /* Tile the output */ index = 0; for (i = 0; i < nh; i++) { for (j = 0; j < nw && index < n; j++, index++) { pix1 = pixaGetPix(pixa1, index, L_CLONE); pixGetDimensions(pix1, &wt, &ht, NULL); if (wt > cellw || ht > cellh) { L_INFO("pix(%d) omitted; size %dx%x\n", procName, index, wt, ht); box = boxCreate(0, 0, 0, 0); boxaAddBox(boxa, box, L_INSERT); pixDestroy(&pix1); continue; } pixRasterop(pixd, j * cellw, i * cellh, wt, ht, PIX_SRC, pix1, 0, 0); box = boxCreate(j * cellw, i * cellh, wt, ht); boxaAddBox(boxa, box, L_INSERT); pixDestroy(&pix1); } } if (pncols) *pncols = nw; if (pboxa) *pboxa = boxa; else boxaDestroy(&boxa); pixaDestroy(&pixa1); return pixd; } /*! * \brief pixaDisplayUnsplit() * * \param[in] pixa * \param[in] nx number of mosaic cells horizontally * \param[in] ny number of mosaic cells vertically * \param[in] borderwidth of added border on all sides * \param[in] bordercolor in our RGBA format: 0xrrggbbaa * \return pix of tiled images, or NULL on error * * <pre> * Notes: * (1) This is a logical inverse of pixaSplitPix(). It * constructs a pix from a mosaic of tiles, all of equal size. * (2) For added generality, a border of arbitrary color can * be added to each of the tiles. * (3) In use, pixa will typically have either been generated * from pixaSplitPix() or will derived from a pixa that * was so generated. * (4) All pix in the pixa must be of equal depth, and, if * colormapped, have the same colormap. * </pre> */ PIX * pixaDisplayUnsplit(PIXA *pixa, l_int32 nx, l_int32 ny, l_int32 borderwidth, l_uint32 bordercolor) { l_int32 w, h, d, wt, ht; l_int32 i, j, k, x, y, n; PIX *pix1, *pixd; PROCNAME("pixaDisplayUnsplit"); if (!pixa) return (PIX *)ERROR_PTR("pixa not defined", procName, NULL); if (nx <= 0 || ny <= 0) return (PIX *)ERROR_PTR("nx and ny must be > 0", procName, NULL); if ((n = pixaGetCount(pixa)) == 0) return (PIX *)ERROR_PTR("no components", procName, NULL); if (n != nx * ny) return (PIX *)ERROR_PTR("n != nx * ny", procName, NULL); borderwidth = L_MAX(0, borderwidth); pixaGetPixDimensions(pixa, 0, &wt, &ht, &d); w = nx * (wt + 2 * borderwidth); h = ny * (ht + 2 * borderwidth); if ((pixd = pixCreate(w, h, d)) == NULL) return (PIX *)ERROR_PTR("pixd not made", procName, NULL); pix1 = pixaGetPix(pixa, 0, L_CLONE); pixCopyColormap(pixd, pix1); pixDestroy(&pix1); if (borderwidth > 0) pixSetAllArbitrary(pixd, bordercolor); y = borderwidth; for (i = 0, k = 0; i < ny; i++) { x = borderwidth; for (j = 0; j < nx; j++, k++) { pix1 = pixaGetPix(pixa, k, L_CLONE); pixRasterop(pixd, x, y, wt, ht, PIX_SRC, pix1, 0, 0); pixDestroy(&pix1); x += wt + 2 * borderwidth; } y += ht + 2 * borderwidth; } return pixd; } /*! * \brief pixaDisplayTiled() * * \param[in] pixa * \param[in] maxwidth of output image * \param[in] background 0 for white, 1 for black * \param[in] spacing * \return pix of tiled images, or NULL on error * * <pre> * Notes: * (1) This renders a pixa to a single image of width not to * exceed maxwidth, with background color either white or black, * and with each subimage spaced on a regular lattice. * (2) The lattice size is determined from the largest width and height, * separately, of all pix in the pixa. * (3) All pix in the pixa must be of equal depth. * (4) If any pix has a colormap, all pix are rendered in rgb. * (5) Careful: because no components are omitted, this is * dangerous if there are thousands of small components and * one or more very large one, because the size of the * resulting pix can be huge! * </pre> */ PIX * pixaDisplayTiled(PIXA *pixa, l_int32 maxwidth, l_int32 background, l_int32 spacing) { l_int32 wmax, hmax, wd, hd, d, hascmap, res, same; l_int32 i, j, n, ni, ncols, nrows; l_int32 ystart, xstart, wt, ht; PIX *pix1, *pix2, *pixd; PIXA *pixa1; PROCNAME("pixaDisplayTiled"); if (!pixa) return (PIX *)ERROR_PTR("pixa not defined", procName, NULL); /* If any pix have colormaps, generate rgb */ if ((n = pixaGetCount(pixa)) == 0) return (PIX *)ERROR_PTR("no components", procName, NULL); pixaAnyColormaps(pixa, &hascmap); if (hascmap) { pixa1 = pixaCreate(n); for (i = 0; i < n; i++) { pix1 = pixaGetPix(pixa, i, L_CLONE); pix2 = pixConvertTo32(pix1); pixaAddPix(pixa1, pix2, L_INSERT); pixDestroy(&pix1); } } else { pixa1 = pixaCopy(pixa, L_CLONE); } /* Find the max dimensions and depth subimages */ pixaGetDepthInfo(pixa1, &d, &same); if (!same) { pixaDestroy(&pixa1); return (PIX *)ERROR_PTR("depths not equal", procName, NULL); } pixaSizeRange(pixa1, NULL, NULL, &wmax, &hmax); /* Get the number of rows and columns and the output image size */ spacing = L_MAX(spacing, 0); ncols = (l_int32)((l_float32)(maxwidth - spacing) / (l_float32)(wmax + spacing)); nrows = (n + ncols - 1) / ncols; wd = wmax * ncols + spacing * (ncols + 1); hd = hmax * nrows + spacing * (nrows + 1); if ((pixd = pixCreate(wd, hd, d)) == NULL) { pixaDestroy(&pixa1); return (PIX *)ERROR_PTR("pixd not made", procName, NULL); } /* Reset the background color if necessary */ if ((background == 1 && d == 1) || (background == 0 && d != 1)) pixSetAll(pixd); /* Blit the images to the dest */ for (i = 0, ni = 0; i < nrows; i++) { ystart = spacing + i * (hmax + spacing); for (j = 0; j < ncols && ni < n; j++, ni++) { xstart = spacing + j * (wmax + spacing); pix1 = pixaGetPix(pixa1, ni, L_CLONE); if (ni == 0) res = pixGetXRes(pix1); pixGetDimensions(pix1, &wt, &ht, NULL); pixRasterop(pixd, xstart, ystart, wt, ht, PIX_SRC, pix1, 0, 0); pixDestroy(&pix1); } } pixSetResolution(pixd, res, res); pixaDestroy(&pixa1); return pixd; } /*! * \brief pixaDisplayTiledInRows() * * \param[in] pixa * \param[in] outdepth output depth: 1, 8 or 32 bpp * \param[in] maxwidth of output image * \param[in] scalefactor applied to every pix; use 1.0 for no scaling * \param[in] background 0 for white, 1 for black; this is the color * of the spacing between the images * \param[in] spacing between images, and on outside * \param[in] border width of black border added to each image; * use 0 for no border * \return pixd of tiled images, or NULL on error * * <pre> * Notes: * (1) This renders a pixa to a single image of width not to * exceed maxwidth, with background color either white or black, * and with each row tiled such that the top of each pix is * aligned and separated by 'spacing' from the next one. * A black border can be added to each pix. * (2) All pix are converted to outdepth; existing colormaps are removed. * (3) This does a reasonably spacewise-efficient job of laying * out the individual pix images into a tiled composite. * (4) A serialized boxa giving the location in pixd of each input * pix (without added border) is stored in the text string of pixd. * This allows, e.g., regeneration of a pixa from pixd, using * pixaCreateFromBoxa(). If there is no scaling and the depth of * each input pix in the pixa is the same, this tiling operation * can be inverted using the boxa (except for loss of text in * each of the input pix): * pix1 = pixaDisplayTiledInRows(pixa1, 1, 1500, 1.0, 0, 30, 0); * char *boxatxt = pixGetText(pix1); * boxa1 = boxaReadMem((l_uint8 *)boxatxt, strlen(boxatxt)); * pixa2 = pixaCreateFromBoxa(pix1, boxa1, NULL); * </pre> */ PIX * pixaDisplayTiledInRows(PIXA *pixa, l_int32 outdepth, l_int32 maxwidth, l_float32 scalefactor, l_int32 background, l_int32 spacing, l_int32 border) { l_int32 h; /* cumulative height over all the rows */ l_int32 w; /* cumulative height in the current row */ l_int32 bordval, wtry, wt, ht; l_int32 irow; /* index of current pix in current row */ l_int32 wmaxrow; /* width of the largest row */ l_int32 maxh; /* max height in row */ l_int32 i, j, index, n, x, y, nrows, ninrow, res; size_t size; l_uint8 *data; BOXA *boxa; NUMA *nainrow; /* number of pix in the row */ NUMA *namaxh; /* height of max pix in the row */ PIX *pix, *pixn, *pix1, *pixd; PIXA *pixan; PROCNAME("pixaDisplayTiledInRows"); if (!pixa) return (PIX *)ERROR_PTR("pixa not defined", procName, NULL); if (outdepth != 1 && outdepth != 8 && outdepth != 32) return (PIX *)ERROR_PTR("outdepth not in {1, 8, 32}", procName, NULL); if (border < 0) border = 0; if (scalefactor <= 0.0) scalefactor = 1.0; if ((n = pixaGetCount(pixa)) == 0) return (PIX *)ERROR_PTR("no components", procName, NULL); /* Normalize depths, scale, remove colormaps; optionally add border */ pixan = pixaCreate(n); bordval = (outdepth == 1) ? 1 : 0; for (i = 0; i < n; i++) { if ((pix = pixaGetPix(pixa, i, L_CLONE)) == NULL) continue; if (outdepth == 1) pixn = pixConvertTo1(pix, 128); else if (outdepth == 8) pixn = pixConvertTo8(pix, FALSE); else /* outdepth == 32 */ pixn = pixConvertTo32(pix); pixDestroy(&pix); if (scalefactor != 1.0) pix1 = pixScale(pixn, scalefactor, scalefactor); else pix1 = pixClone(pixn); if (border) pixd = pixAddBorder(pix1, border, bordval); else pixd = pixClone(pix1); pixDestroy(&pixn); pixDestroy(&pix1); pixaAddPix(pixan, pixd, L_INSERT); } if (pixaGetCount(pixan) != n) { n = pixaGetCount(pixan); L_WARNING("only got %d components\n", procName, n); if (n == 0) { pixaDestroy(&pixan); return (PIX *)ERROR_PTR("no components", procName, NULL); } } /* Compute parameters for layout */ nainrow = numaCreate(0); namaxh = numaCreate(0); wmaxrow = 0; w = h = spacing; maxh = 0; /* max height in row */ for (i = 0, irow = 0; i < n; i++, irow++) { pixaGetPixDimensions(pixan, i, &wt, &ht, NULL); wtry = w + wt + spacing; if (wtry > maxwidth) { /* end the current row and start next one */ numaAddNumber(nainrow, irow); numaAddNumber(namaxh, maxh); wmaxrow = L_MAX(wmaxrow, w); h += maxh + spacing; irow = 0; w = wt + 2 * spacing; maxh = ht; } else { w = wtry; maxh = L_MAX(maxh, ht); } } /* Enter the parameters for the last row */ numaAddNumber(nainrow, irow); numaAddNumber(namaxh, maxh); wmaxrow = L_MAX(wmaxrow, w); h += maxh + spacing; if ((pixd = pixCreate(wmaxrow, h, outdepth)) == NULL) { numaDestroy(&nainrow); numaDestroy(&namaxh); pixaDestroy(&pixan); return (PIX *)ERROR_PTR("pixd not made", procName, NULL); } /* Reset the background color if necessary */ if ((background == 1 && outdepth == 1) || (background == 0 && outdepth != 1)) pixSetAll(pixd); /* Blit the images to the dest, and save the boxa identifying * the image regions that do not include the borders. */ nrows = numaGetCount(nainrow); y = spacing; boxa = boxaCreate(n); for (i = 0, index = 0; i < nrows; i++) { /* over rows */ numaGetIValue(nainrow, i, &ninrow); numaGetIValue(namaxh, i, &maxh); x = spacing; for (j = 0; j < ninrow; j++, index++) { /* over pix in row */ pix = pixaGetPix(pixan, index, L_CLONE); if (index == 0) { res = pixGetXRes(pix); pixSetResolution(pixd, res, res); } pixGetDimensions(pix, &wt, &ht, NULL); boxaAddBox(boxa, boxCreate(x + border, y + border, wt - 2 * border, ht - 2 *border), L_INSERT); pixRasterop(pixd, x, y, wt, ht, PIX_SRC, pix, 0, 0); pixDestroy(&pix); x += wt + spacing; } y += maxh + spacing; } boxaWriteMem(&data, &size, boxa); pixSetText(pixd, (char *)data); /* data is ascii */ LEPT_FREE(data); boxaDestroy(&boxa); numaDestroy(&nainrow); numaDestroy(&namaxh); pixaDestroy(&pixan); return pixd; } /*! * \brief pixaDisplayTiledInColumns() * * \param[in] pixas * \param[in] nx number of columns in output image * \param[in] scalefactor applied to every pix; use 1.0 for no scaling * \param[in] spacing between images, and on outside * \param[in] border width of black border added to each image; * use 0 for no border * \return pixd of tiled images, or NULL on error * * <pre> * Notes: * (1) This renders a pixa to a single image with &nx columns of * subimages. The background color is white, and each row * is tiled such that the top of each pix is aligned and * each pix is separated by 'spacing' from the next one. * A black border can be added to each pix. * (2) The output depth is determined by the largest depth * required by the pix in the pixa. Colormaps are removed. * (3) A serialized boxa giving the location in pixd of each input * pix (without added border) is stored in the text string of pixd. * This allows, e.g., regeneration of a pixa from pixd, using * pixaCreateFromBoxa(). If there is no scaling and the depth of * each input pix in the pixa is the same, this tiling operation * can be inverted using the boxa (except for loss of text in * each of the input pix): * pix1 = pixaDisplayTiledInColumns(pixa1, 3, 1.0, 0, 30, 2); * char *boxatxt = pixGetText(pix1); * boxa1 = boxaReadMem((l_uint8 *)boxatxt, strlen(boxatxt)); * pixa2 = pixaCreateFromBoxa(pix1, boxa1, NULL); * </pre> */ PIX * pixaDisplayTiledInColumns(PIXA *pixas, l_int32 nx, l_float32 scalefactor, l_int32 spacing, l_int32 border) { l_int32 i, j, index, n, x, y, nrows, wb, hb, w, h, maxd, maxh, bordval, res; size_t size; l_uint8 *data; BOX *box; BOXA *boxa; PIX *pix1, *pix2, *pix3, *pixd; PIXA *pixa1, *pixa2; PROCNAME("pixaDisplayTiledInColumns"); if (!pixas) return (PIX *)ERROR_PTR("pixas not defined", procName, NULL); if (border < 0) border = 0; if (scalefactor <= 0.0) scalefactor = 1.0; if ((n = pixaGetCount(pixas)) == 0) return (PIX *)ERROR_PTR("no components", procName, NULL); /* Convert to same depth, if necessary */ pixa1 = pixaConvertToSameDepth(pixas); pixaGetDepthInfo(pixa1, &maxd, NULL); /* Scale and optionally add border */ pixa2 = pixaCreate(n); bordval = (maxd == 1) ? 1 : 0; for (i = 0; i < n; i++) { if ((pix1 = pixaGetPix(pixa1, i, L_CLONE)) == NULL) continue; if (scalefactor != 1.0) pix2 = pixScale(pix1, scalefactor, scalefactor); else pix2 = pixClone(pix1); if (border) pix3 = pixAddBorder(pix2, border, bordval); else pix3 = pixClone(pix2); if (i == 0) res = pixGetXRes(pix3); pixaAddPix(pixa2, pix3, L_INSERT); pixDestroy(&pix1); pixDestroy(&pix2); } pixaDestroy(&pixa1); if (pixaGetCount(pixa2) != n) { n = pixaGetCount(pixa2); L_WARNING("only got %d components\n", procName, n); if (n == 0) { pixaDestroy(&pixa2); return (PIX *)ERROR_PTR("no components", procName, NULL); } } /* Compute layout parameters and save as a boxa */ boxa = boxaCreate(n); nrows = (n + nx - 1) / nx; y = spacing; for (i = 0, index = 0; i < nrows; i++) { x = spacing; maxh = 0; for (j = 0; j < nx && index < n; j++) { pixaGetPixDimensions(pixa2, index, &wb, &hb, NULL); box = boxCreate(x, y, wb, hb); boxaAddBox(boxa, box, L_INSERT); maxh = L_MAX(maxh, hb + spacing); x += wb + spacing; index++; } y += maxh; } pixaSetBoxa(pixa2, boxa, L_INSERT); /* Render the output pix */ boxaGetExtent(boxa, &w, &h, NULL); pixd = pixaDisplay(pixa2, w + spacing, h + spacing); pixSetResolution(pixd, res, res); /* Save the boxa in the text field of the output pix */ boxaWriteMem(&data, &size, boxa); pixSetText(pixd, (char *)data); /* data is ascii */ LEPT_FREE(data); pixaDestroy(&pixa2); return pixd; } /*! * \brief pixaDisplayTiledAndScaled() * * \param[in] pixa * \param[in] outdepth output depth: 1, 8 or 32 bpp * \param[in] tilewidth each pix is scaled to this width * \param[in] ncols number of tiles in each row * \param[in] background 0 for white, 1 for black; this is the color * of the spacing between the images * \param[in] spacing between images, and on outside * \param[in] border width of additional black border on each image; * use 0 for no border * \return pix of tiled images, or NULL on error * * <pre> * Notes: * (1) This can be used to tile a number of renderings of * an image that are at different scales and depths. * (2) Each image, after scaling and optionally adding the * black border, has width 'tilewidth'. Thus, the border does * not affect the spacing between the image tiles. The * maximum allowed border width is tilewidth / 5. * </pre> */ PIX * pixaDisplayTiledAndScaled(PIXA *pixa, l_int32 outdepth, l_int32 tilewidth, l_int32 ncols, l_int32 background, l_int32 spacing, l_int32 border) { l_int32 x, y, w, h, wd, hd, d, res; l_int32 i, n, nrows, maxht, ninrow, irow, bordval; l_int32 *rowht; l_float32 scalefact; PIX *pix, *pixn, *pix1, *pixb, *pixd; PIXA *pixan; PROCNAME("pixaDisplayTiledAndScaled"); if (!pixa) return (PIX *)ERROR_PTR("pixa not defined", procName, NULL); if (outdepth != 1 && outdepth != 8 && outdepth != 32) return (PIX *)ERROR_PTR("outdepth not in {1, 8, 32}", procName, NULL); if (border < 0 || border > tilewidth / 5) border = 0; if ((n = pixaGetCount(pixa)) == 0) return (PIX *)ERROR_PTR("no components", procName, NULL); /* Normalize scale and depth for each pix; optionally add border */ pixan = pixaCreate(n); bordval = (outdepth == 1) ? 1 : 0; for (i = 0; i < n; i++) { if ((pix = pixaGetPix(pixa, i, L_CLONE)) == NULL) continue; pixGetDimensions(pix, &w, &h, &d); scalefact = (l_float32)(tilewidth - 2 * border) / (l_float32)w; if (d == 1 && outdepth > 1 && scalefact < 1.0) pix1 = pixScaleToGray(pix, scalefact); else pix1 = pixScale(pix, scalefact, scalefact); if (outdepth == 1) pixn = pixConvertTo1(pix1, 128); else if (outdepth == 8) pixn = pixConvertTo8(pix1, FALSE); else /* outdepth == 32 */ pixn = pixConvertTo32(pix1); pixDestroy(&pix1); if (border) pixb = pixAddBorder(pixn, border, bordval); else pixb = pixClone(pixn); pixaAddPix(pixan, pixb, L_INSERT); pixDestroy(&pix); pixDestroy(&pixn); } if ((n = pixaGetCount(pixan)) == 0) { /* should not have changed! */ pixaDestroy(&pixan); return (PIX *)ERROR_PTR("no components", procName, NULL); } /* Determine the size of each row and of pixd */ wd = tilewidth * ncols + spacing * (ncols + 1); nrows = (n + ncols - 1) / ncols; if ((rowht = (l_int32 *)LEPT_CALLOC(nrows, sizeof(l_int32))) == NULL) { pixaDestroy(&pixan); return (PIX *)ERROR_PTR("rowht array not made", procName, NULL); } maxht = 0; ninrow = 0; irow = 0; for (i = 0; i < n; i++) { pix = pixaGetPix(pixan, i, L_CLONE); ninrow++; pixGetDimensions(pix, &w, &h, NULL); maxht = L_MAX(h, maxht); if (ninrow == ncols) { rowht[irow] = maxht; maxht = ninrow = 0; /* reset */ irow++; } pixDestroy(&pix); } if (ninrow > 0) { /* last fencepost */ rowht[irow] = maxht; irow++; /* total number of rows */ } nrows = irow; hd = spacing * (nrows + 1); for (i = 0; i < nrows; i++) hd += rowht[i]; pixd = pixCreate(wd, hd, outdepth); if ((background == 1 && outdepth == 1) || (background == 0 && outdepth != 1)) pixSetAll(pixd); /* Now blit images to pixd */ x = y = spacing; irow = 0; for (i = 0; i < n; i++) { pix = pixaGetPix(pixan, i, L_CLONE); if (i == 0) { res = pixGetXRes(pix); pixSetResolution(pixd, res, res); } pixGetDimensions(pix, &w, &h, NULL); if (i && ((i % ncols) == 0)) { /* start new row */ x = spacing; y += spacing + rowht[irow]; irow++; } pixRasterop(pixd, x, y, w, h, PIX_SRC, pix, 0, 0); x += tilewidth + spacing; pixDestroy(&pix); } pixaDestroy(&pixan); LEPT_FREE(rowht); return pixd; } /*! * \brief pixaDisplayTiledWithText() * * \param[in] pixa * \param[in] maxwidth of output image * \param[in] scalefactor applied to every pix; use 1.0 for no scaling * \param[in] spacing between images, and on outside * \param[in] border width of black border added to each image; * use 0 for no border * \param[in] fontsize 4, 6, ... 20 * \param[in] textcolor 0xrrggbb00 * \return pixd of tiled images, or NULL on error * * <pre> * Notes: * (1) This is a version of pixaDisplayTiledInRows() that prints, below * each pix, the text in the pix text field. Up to 127 chars * of text in the pix text field are rendered below each pix. * (2) It renders a pixa to a single image of width not to * exceed %maxwidth, with white background color, with each row * tiled such that the top of each pix is aligned and separated * by %spacing from the next one. * (3) All pix are converted to 32 bpp. * (4) This does a reasonably spacewise-efficient job of laying * out the individual pix images into a tiled composite. * </pre> */ PIX * pixaDisplayTiledWithText(PIXA *pixa, l_int32 maxwidth, l_float32 scalefactor, l_int32 spacing, l_int32 border, l_int32 fontsize, l_uint32 textcolor) { char buf[128]; char *textstr; l_int32 i, n, maxw; L_BMF *bmf; PIX *pix1, *pix2, *pix3, *pix4, *pixd; PIXA *pixad; PROCNAME("pixaDisplayTiledWithText"); if (!pixa) return (PIX *)ERROR_PTR("pixa not defined", procName, NULL); if ((n = pixaGetCount(pixa)) == 0) return (PIX *)ERROR_PTR("no components", procName, NULL); if (maxwidth <= 0) return (PIX *)ERROR_PTR("invalid maxwidth", procName, NULL); if (border < 0) border = 0; if (scalefactor <= 0.0) { L_WARNING("invalid scalefactor; setting to 1.0\n", procName); scalefactor = 1.0; } if (fontsize < 4 || fontsize > 20 || (fontsize & 1)) { l_int32 fsize = L_MAX(L_MIN(fontsize, 20), 4); if (fsize & 1) fsize--; L_WARNING("changed fontsize from %d to %d\n", procName, fontsize, fsize); fontsize = fsize; } /* Be sure the width can accommodate a single column of images */ pixaSizeRange(pixa, NULL, NULL, &maxw, NULL); maxwidth = L_MAX(maxwidth, scalefactor * (maxw + 2 * spacing + 2 * border)); bmf = bmfCreate(NULL, fontsize); pixad = pixaCreate(n); for (i = 0; i < n; i++) { pix1 = pixaGetPix(pixa, i, L_CLONE); pix2 = pixConvertTo32(pix1); pix3 = pixAddBorderGeneral(pix2, spacing, spacing, spacing, spacing, 0xffffff00); textstr = pixGetText(pix1); if (textstr && strlen(textstr) > 0) { snprintf(buf, sizeof(buf), "%s", textstr); pix4 = pixAddSingleTextblock(pix3, bmf, buf, textcolor, L_ADD_BELOW, NULL); } else { pix4 = pixClone(pix3); } pixaAddPix(pixad, pix4, L_INSERT); pixDestroy(&pix1); pixDestroy(&pix2); pixDestroy(&pix3); } bmfDestroy(&bmf); pixd = pixaDisplayTiledInRows(pixad, 32, maxwidth, scalefactor, 0, 10, border); pixaDestroy(&pixad); return pixd; } /*! * \brief pixaDisplayTiledByIndex() * * \param[in] pixa * \param[in] na numa with indices corresponding to the pix in pixa * \param[in] width each pix is scaled to this width * \param[in] spacing between images, and on outside * \param[in] border width of black border added to each image; * use 0 for no border * \param[in] fontsize 4, 6, ... 20 * \param[in] textcolor 0xrrggbb00 * \return pixd of tiled images, or NULL on error * * <pre> * Notes: * (1) This renders a pixa to a single image with white * background color, where the pix are placed in columns * given by the index value in the numa. Each pix * is separated by %spacing from the adjacent ones, and * an optional border is placed around them. * (2) Up to 127 chars of text in the pix text field are rendered * below each pix. Use newlines in the text field to write * the text in multiple lines that fit within the pix width. * (3) To avoid having empty columns, if there are N different * index values, they should be in [0 ... N-1]. * (4) All pix are converted to 32 bpp. * </pre> */ PIX * pixaDisplayTiledByIndex(PIXA *pixa, NUMA *na, l_int32 width, l_int32 spacing, l_int32 border, l_int32 fontsize, l_uint32 textcolor) { char buf[128]; char *textstr; l_int32 i, n, x, y, w, h, yval, index; l_float32 maxindex; L_BMF *bmf; BOX *box; NUMA *nay; /* top of the next pix to add in that column */ PIX *pix1, *pix2, *pix3, *pix4, *pix5, *pixd; PIXA *pixad; PROCNAME("pixaDisplayTiledByIndex"); if (!pixa) return (PIX *)ERROR_PTR("pixa not defined", procName, NULL); if (!na) return (PIX *)ERROR_PTR("na not defined", procName, NULL); if ((n = pixaGetCount(pixa)) == 0) return (PIX *)ERROR_PTR("no pixa components", procName, NULL); if (n != numaGetCount(na)) return (PIX *)ERROR_PTR("pixa and na counts differ", procName, NULL); if (width <= 0) return (PIX *)ERROR_PTR("invalid width", procName, NULL); if (width < 20) L_WARNING("very small width: %d\n", procName, width); if (border < 0) border = 0; if (fontsize < 4 || fontsize > 20 || (fontsize & 1)) { l_int32 fsize = L_MAX(L_MIN(fontsize, 20), 4); if (fsize & 1) fsize--; L_WARNING("changed fontsize from %d to %d\n", procName, fontsize, fsize); fontsize = fsize; } /* The pix will be rendered in the order they occupy in pixa. */ bmf = bmfCreate(NULL, fontsize); pixad = pixaCreate(n); numaGetMax(na, &maxindex, NULL); nay = numaMakeConstant(spacing, lept_roundftoi(maxindex) + 1); for (i = 0; i < n; i++) { numaGetIValue(na, i, &index); numaGetIValue(nay, index, &yval); pix1 = pixaGetPix(pixa, i, L_CLONE); pix2 = pixConvertTo32(pix1); pix3 = pixScaleToSize(pix2, width, 0); pix4 = pixAddBorderGeneral(pix3, border, border, border, border, 0); textstr = pixGetText(pix1); if (textstr && strlen(textstr) > 0) { snprintf(buf, sizeof(buf), "%s", textstr); pix5 = pixAddTextlines(pix4, bmf, textstr, textcolor, L_ADD_BELOW); } else { pix5 = pixClone(pix4); } pixaAddPix(pixad, pix5, L_INSERT); x = spacing + border + index * (2 * border + width + spacing); y = yval; pixGetDimensions(pix5, &w, &h, NULL); yval += h + spacing; numaSetValue(nay, index, yval); box = boxCreate(x, y, w, h); pixaAddBox(pixad, box, L_INSERT); pixDestroy(&pix1); pixDestroy(&pix2); pixDestroy(&pix3); pixDestroy(&pix4); } numaDestroy(&nay); bmfDestroy(&bmf); pixd = pixaDisplay(pixad, 0, 0); pixaDestroy(&pixad); return pixd; } /*---------------------------------------------------------------------* * Pixaa Display * *---------------------------------------------------------------------*/ /*! * \brief pixaaDisplay() * * \param[in] paa * \param[in] w, h if set to 0, the size is determined from the * bounding box of the components in pixa * \return pix, or NULL on error * * <pre> * Notes: * (1) Each pix of the paa is displayed at the location given by * its box, translated by the box of the containing pixa * if it exists. * </pre> */ PIX * pixaaDisplay(PIXAA *paa, l_int32 w, l_int32 h) { l_int32 i, j, n, nbox, na, d, wmax, hmax, x, y, xb, yb, wb, hb; BOXA *boxa1; /* top-level boxa */ BOXA *boxa; PIX *pix1, *pixd; PIXA *pixa; PROCNAME("pixaaDisplay"); if (!paa) return (PIX *)ERROR_PTR("paa not defined", procName, NULL); n = pixaaGetCount(paa, NULL); if (n == 0) return (PIX *)ERROR_PTR("no components", procName, NULL); /* If w and h not input, determine the minimum size required * to contain the origin and all c.c. */ boxa1 = pixaaGetBoxa(paa, L_CLONE); nbox = boxaGetCount(boxa1); if (w == 0 || h == 0) { if (nbox == n) { boxaGetExtent(boxa1, &w, &h, NULL); } else { /* have to use the lower-level boxa for each pixa */ wmax = hmax = 0; for (i = 0; i < n; i++) { pixa = pixaaGetPixa(paa, i, L_CLONE); boxa = pixaGetBoxa(pixa, L_CLONE); boxaGetExtent(boxa, &w, &h, NULL); wmax = L_MAX(wmax, w); hmax = L_MAX(hmax, h); pixaDestroy(&pixa); boxaDestroy(&boxa); } w = wmax; h = hmax; } } /* Get depth from first pix */ pixa = pixaaGetPixa(paa, 0, L_CLONE); pix1 = pixaGetPix(pixa, 0, L_CLONE); d = pixGetDepth(pix1); pixaDestroy(&pixa); pixDestroy(&pix1); if ((pixd = pixCreate(w, h, d)) == NULL) { boxaDestroy(&boxa1); return (PIX *)ERROR_PTR("pixd not made", procName, NULL); } x = y = 0; for (i = 0; i < n; i++) { pixa = pixaaGetPixa(paa, i, L_CLONE); if (nbox == n) boxaGetBoxGeometry(boxa1, i, &x, &y, NULL, NULL); na = pixaGetCount(pixa); for (j = 0; j < na; j++) { pixaGetBoxGeometry(pixa, j, &xb, &yb, &wb, &hb); pix1 = pixaGetPix(pixa, j, L_CLONE); pixRasterop(pixd, x + xb, y + yb, wb, hb, PIX_PAINT, pix1, 0, 0); pixDestroy(&pix1); } pixaDestroy(&pixa); } boxaDestroy(&boxa1); return pixd; } /*! * \brief pixaaDisplayByPixa() * * \param[in] paa with pix that may have different depths * \param[in] xspace between pix in pixa * \param[in] yspace between pixa * \param[in] maxw max width of output pix * \return pixd, or NULL on error * * <pre> * Notes: * (1) Displays each pixa on a line (or set of lines), * in order from top to bottom. Within each pixa, * the pix are displayed in order from left to right. * (2) The sizes and depths of each pix can differ. The output pix * has a depth equal to the max depth of all the pix. * (3) This ignores the boxa of the paa. * </pre> */ PIX * pixaaDisplayByPixa(PIXAA *paa, l_int32 xspace, l_int32 yspace, l_int32 maxw) { l_int32 i, j, npixa, npix, same, use_maxw, x, y, w, h, hindex; l_int32 maxwidth, maxdepth, width, lmaxh, lmaxw; l_int32 *harray; NUMA *nah; PIX *pix, *pix1, *pixd; PIXA *pixa; PROCNAME("pixaaDisplayByPixa"); if (!paa) return (PIX *)ERROR_PTR("paa not defined", procName, NULL); if ((npixa = pixaaGetCount(paa, NULL)) == 0) return (PIX *)ERROR_PTR("no components", procName, NULL); same = pixaaVerifyDepth(paa, &maxdepth); if (!same && maxdepth < 8) return (PIX *)ERROR_PTR("depths differ; max < 8", procName, NULL); /* Be sure the widest box fits in the output pix */ pixaaSizeRange(paa, NULL, NULL, &maxwidth, NULL); if (maxwidth > maxw) { L_WARNING("maxwidth > maxw; using maxwidth\n", procName); maxw = maxwidth; } /* Get size of output pix. The width is the minimum of the * maxw and the largest pixa line width. The height is whatever * it needs to be to accommodate all pixa. */ lmaxw = 0; /* widest line found */ use_maxw = FALSE; nah = numaCreate(0); /* store height of each line */ y = yspace; for (i = 0; i < npixa; i++) { pixa = pixaaGetPixa(paa, i, L_CLONE); npix = pixaGetCount(pixa); if (npix == 0) { pixaDestroy(&pixa); continue; } x = xspace; lmaxh = 0; /* max height found in the line */ for (j = 0; j < npix; j++) { pix = pixaGetPix(pixa, j, L_CLONE); pixGetDimensions(pix, &w, &h, NULL); if (x + w >= maxw) { /* start new line */ x = xspace; y += lmaxh + yspace; numaAddNumber(nah, lmaxh); lmaxh = 0; use_maxw = TRUE; } x += w + xspace; lmaxh = L_MAX(h, lmaxh); lmaxw = L_MAX(lmaxw, x); pixDestroy(&pix); } y += lmaxh + yspace; numaAddNumber(nah, lmaxh); pixaDestroy(&pixa); } width = (use_maxw) ? maxw : lmaxw; if ((pixd = pixCreate(width, y, maxdepth)) == NULL) { numaDestroy(&nah); return (PIX *)ERROR_PTR("pixd not made", procName, NULL); } /* Now layout the pix by pixa */ y = yspace; harray = numaGetIArray(nah); hindex = 0; for (i = 0; i < npixa; i++) { x = xspace; pixa = pixaaGetPixa(paa, i, L_CLONE); npix = pixaGetCount(pixa); if (npix == 0) { pixaDestroy(&pixa); continue; } for (j = 0; j < npix; j++) { pix = pixaGetPix(pixa, j, L_CLONE); if (pixGetDepth(pix) != maxdepth) { if (maxdepth == 8) pix1 = pixConvertTo8(pix, 0); else /* 32 bpp */ pix1 = pixConvertTo32(pix); } else { pix1 = pixClone(pix); } pixGetDimensions(pix1, &w, &h, NULL); if (x + w >= maxw) { /* start new line */ x = xspace; y += harray[hindex++] + yspace; } pixRasterop(pixd, x, y, w, h, PIX_PAINT, pix1, 0, 0); pixDestroy(&pix); pixDestroy(&pix1); x += w + xspace; } y += harray[hindex++] + yspace; pixaDestroy(&pixa); } LEPT_FREE(harray); numaDestroy(&nah); return pixd; } /*! * \brief pixaaDisplayTiledAndScaled() * * \param[in] paa * \param[in] outdepth output depth: 1, 8 or 32 bpp * \param[in] tilewidth each pix is scaled to this width * \param[in] ncols number of tiles in each row * \param[in] background 0 for white, 1 for black; this is the color * of the spacing between the images * \param[in] spacing between images, and on outside * \param[in] border width of additional black border on each image; * use 0 for no border * \return pixa of tiled images, one image for each pixa in * the paa, or NULL on error * * <pre> * Notes: * (1) For each pixa, this generates from all the pix a * tiled/scaled output pix, and puts it in the output pixa. * (2) See comments in pixaDisplayTiledAndScaled(). * </pre> */ PIXA * pixaaDisplayTiledAndScaled(PIXAA *paa, l_int32 outdepth, l_int32 tilewidth, l_int32 ncols, l_int32 background, l_int32 spacing, l_int32 border) { l_int32 i, n; PIX *pix; PIXA *pixa, *pixad; PROCNAME("pixaaDisplayTiledAndScaled"); if (!paa) return (PIXA *)ERROR_PTR("paa not defined", procName, NULL); if (outdepth != 1 && outdepth != 8 && outdepth != 32) return (PIXA *)ERROR_PTR("outdepth not in {1, 8, 32}", procName, NULL); if (border < 0 || border > tilewidth / 5) border = 0; if ((n = pixaaGetCount(paa, NULL)) == 0) return (PIXA *)ERROR_PTR("no components", procName, NULL); pixad = pixaCreate(n); for (i = 0; i < n; i++) { pixa = pixaaGetPixa(paa, i, L_CLONE); pix = pixaDisplayTiledAndScaled(pixa, outdepth, tilewidth, ncols, background, spacing, border); pixaAddPix(pixad, pix, L_INSERT); pixaDestroy(&pixa); } return pixad; } /*---------------------------------------------------------------------* * Conversion of all pix to specified type (e.g., depth) * *---------------------------------------------------------------------*/ /*! * \brief pixaConvertTo1() * * \param[in] pixas * \param[in] thresh threshold for final binarization from 8 bpp gray * \return pixad, or NULL on error */ PIXA * pixaConvertTo1(PIXA *pixas, l_int32 thresh) { l_int32 i, n; BOXA *boxa; PIX *pix1, *pix2; PIXA *pixad; PROCNAME("pixaConvertTo1"); if (!pixas) return (PIXA *)ERROR_PTR("pixas not defined", procName, NULL); n = pixaGetCount(pixas); pixad = pixaCreate(n); for (i = 0; i < n; i++) { pix1 = pixaGetPix(pixas, i, L_CLONE); pix2 = pixConvertTo1(pix1, thresh); pixaAddPix(pixad, pix2, L_INSERT); pixDestroy(&pix1); } boxa = pixaGetBoxa(pixas, L_COPY); pixaSetBoxa(pixad, boxa, L_INSERT); return pixad; } /*! * \brief pixaConvertTo8() * * \param[in] pixas * \param[in] cmapflag 1 to give pixd a colormap; 0 otherwise * \return pixad each pix is 8 bpp, or NULL on error * * <pre> * Notes: * (1) See notes for pixConvertTo8(), applied to each pix in pixas. * </pre> */ PIXA * pixaConvertTo8(PIXA *pixas, l_int32 cmapflag) { l_int32 i, n; BOXA *boxa; PIX *pix1, *pix2; PIXA *pixad; PROCNAME("pixaConvertTo8"); if (!pixas) return (PIXA *)ERROR_PTR("pixas not defined", procName, NULL); n = pixaGetCount(pixas); pixad = pixaCreate(n); for (i = 0; i < n; i++) { pix1 = pixaGetPix(pixas, i, L_CLONE); pix2 = pixConvertTo8(pix1, cmapflag); pixaAddPix(pixad, pix2, L_INSERT); pixDestroy(&pix1); } boxa = pixaGetBoxa(pixas, L_COPY); pixaSetBoxa(pixad, boxa, L_INSERT); return pixad; } /*! * \brief pixaConvertTo8Colormap() * * \param[in] pixas * \param[in] dither 1 to dither if necessary; 0 otherwise * \return pixad each pix is 8 bpp, or NULL on error * * <pre> * Notes: * (1) See notes for pixConvertTo8Colormap(), applied to each pix in pixas. * </pre> */ PIXA * pixaConvertTo8Colormap(PIXA *pixas, l_int32 dither) { l_int32 i, n; BOXA *boxa; PIX *pix1, *pix2; PIXA *pixad; PROCNAME("pixaConvertTo8Colormap"); if (!pixas) return (PIXA *)ERROR_PTR("pixas not defined", procName, NULL); n = pixaGetCount(pixas); pixad = pixaCreate(n); for (i = 0; i < n; i++) { pix1 = pixaGetPix(pixas, i, L_CLONE); pix2 = pixConvertTo8Colormap(pix1, dither); pixaAddPix(pixad, pix2, L_INSERT); pixDestroy(&pix1); } boxa = pixaGetBoxa(pixas, L_COPY); pixaSetBoxa(pixad, boxa, L_INSERT); return pixad; } /*! * \brief pixaConvertTo32() * * \param[in] pixas * \return pixad 32 bpp rgb, or NULL on error * * <pre> * Notes: * (1) See notes for pixConvertTo32(), applied to each pix in pixas. * (2) This can be used to allow 1 bpp pix in a pixa to be displayed * with color. * </pre> */ PIXA * pixaConvertTo32(PIXA *pixas) { l_int32 i, n; BOXA *boxa; PIX *pix1, *pix2; PIXA *pixad; PROCNAME("pixaConvertTo32"); if (!pixas) return (PIXA *)ERROR_PTR("pixas not defined", procName, NULL); n = pixaGetCount(pixas); pixad = pixaCreate(n); for (i = 0; i < n; i++) { pix1 = pixaGetPix(pixas, i, L_CLONE); pix2 = pixConvertTo32(pix1); pixaAddPix(pixad, pix2, L_INSERT); pixDestroy(&pix1); } boxa = pixaGetBoxa(pixas, L_COPY); pixaSetBoxa(pixad, boxa, L_INSERT); return pixad; } /*---------------------------------------------------------------------* * Pixa constrained selection * *---------------------------------------------------------------------*/ /*! * \brief pixaConstrainedSelect() * * \param[in] pixas * \param[in] first first index to choose; >= 0 * \param[in] last biggest possible index to reach; * use -1 to go to the end; otherwise, last >= first * \param[in] nmax maximum number of pix to select; > 0 * \param[in] use_pairs 1 = select pairs of adjacent pix; * 0 = select individual pix * \param[in] copyflag L_COPY, L_CLONE * \return pixad if OK, NULL on error * * <pre> * Notes: * (1) See notes in genConstrainedNumaInRange() for how selection * is made. * (2) This returns a selection of the pix in the input pixa. * (3) Use copyflag == L_COPY if you don't want changes in the pix * in the returned pixa to affect those in the input pixa. * </pre> */ PIXA * pixaConstrainedSelect(PIXA *pixas, l_int32 first, l_int32 last, l_int32 nmax, l_int32 use_pairs, l_int32 copyflag) { l_int32 i, n, nselect, index; NUMA *na; PIX *pix1; PIXA *pixad; PROCNAME("pixaConstrainedSelect"); if (!pixas) return (PIXA *)ERROR_PTR("pixas not defined", procName, NULL); n = pixaGetCount(pixas); first = L_MAX(0, first); last = (last < 0) ? n - 1 : L_MIN(n - 1, last); if (last < first) return (PIXA *)ERROR_PTR("last < first!", procName, NULL); if (nmax < 1) return (PIXA *)ERROR_PTR("nmax < 1!", procName, NULL); na = genConstrainedNumaInRange(first, last, nmax, use_pairs); nselect = numaGetCount(na); pixad = pixaCreate(nselect); for (i = 0; i < nselect; i++) { numaGetIValue(na, i, &index); pix1 = pixaGetPix(pixas, index, copyflag); pixaAddPix(pixad, pix1, L_INSERT); } numaDestroy(&na); return pixad; } /*! * \brief pixaSelectToPdf() * * \param[in] pixas * \param[in] first first index to choose; >= 0 * \param[in] last biggest possible index to reach; * use -1 to go to the end; otherwise, last >= first * \param[in] res override the resolution of each input image, in ppi; * use 0 to respect the resolution embedded in the input * \param[in] scalefactor scaling factor applied to each image; > 0.0 * \param[in] type encoding type (L_JPEG_ENCODE, L_G4_ENCODE, * L_FLATE_ENCODE, or 0 for default * \param[in] quality used for JPEG only; 0 for default (75) * \param[in] color of numbers added to each image (e.g., 0xff000000) * \param[in] fontsize to print number below each image. The valid set * is {4,6,8,10,12,14,16,18,20}. Use 0 to disable. * \param[in] fileout pdf file of all images * \return 0 if OK, 1 on error * * <pre> * Notes: * (1) This writes a pdf of the selected images from %pixas, one to * a page. They are optionally scaled and annotated with the * index printed to the left of the image. * (2) If the input images are 1 bpp and you want the numbers to be * in color, first promote each pix to 8 bpp with a colormap: * pixa1 = pixaConvertTo8(pixas, 1); * and then call this function with the specified color * </pre> */ l_int32 pixaSelectToPdf(PIXA *pixas, l_int32 first, l_int32 last, l_int32 res, l_float32 scalefactor, l_int32 type, l_int32 quality, l_uint32 color, l_int32 fontsize, const char *fileout) { l_int32 n; L_BMF *bmf; NUMA *na; PIXA *pixa1, *pixa2; PROCNAME("pixaSelectToPdf"); if (!pixas) return ERROR_INT("pixas not defined", procName, 1); if (type < 0 || type > L_FLATE_ENCODE) { L_WARNING("invalid compression type; using default\n", procName); type = 0; } if (!fileout) return ERROR_INT("fileout not defined", procName, 1); /* Select from given range */ n = pixaGetCount(pixas); first = L_MAX(0, first); last = (last < 0) ? n - 1 : L_MIN(n - 1, last); if (first > last) { L_ERROR("first = %d > last = %d\n", procName, first, last); return 1; } pixa1 = pixaSelectRange(pixas, first, last, L_CLONE); /* Optionally add index numbers */ bmf = (fontsize <= 0) ? NULL : bmfCreate(NULL, fontsize); if (bmf) { na = numaMakeSequence(first, 1.0, last - first + 1); pixa2 = pixaAddTextNumber(pixa1, bmf, na, color, L_ADD_LEFT); numaDestroy(&na); } else { pixa2 = pixaCopy(pixa1, L_CLONE); } pixaDestroy(&pixa1); bmfDestroy(&bmf); pixaConvertToPdf(pixa2, res, scalefactor, type, quality, NULL, fileout); pixaDestroy(&pixa2); return 0; } /*---------------------------------------------------------------------* * Pixa display into multiple tiles * *---------------------------------------------------------------------*/ /*! * \brief pixaDisplayMultiTiled() * * \param[in] pixas * \param[in] nx, ny in [1, ... 50], tiling factors in each direction * \param[in] maxw, maxh max sizes to keep * \param[in] scalefactor scale each image by this * \param[in] spacing between images, and on outside * \param[in] border width of additional black border on each image; * use 0 for no border * \return pixad if OK, NULL on error * * <pre> * Notes: * (1) Each set of %nx * %ny images is optionally scaled and saved * into a new pix, and then aggregated. * (2) Set %maxw = %maxh = 0 if you want to include all pix from %pixs. * (3) This is useful for generating a pdf from the output pixa, where * each page is a tile of (%nx * %ny) images from the input pixa. * </pre> */ PIXA * pixaDisplayMultiTiled(PIXA *pixas, l_int32 nx, l_int32 ny, l_int32 maxw, l_int32 maxh, l_float32 scalefactor, l_int32 spacing, l_int32 border) { l_int32 n, i, j, ntile, nout, index; PIX *pix1, *pix2; PIXA *pixa1, *pixa2, *pixad; PROCNAME("pixaDisplayMultiTiled"); if (!pixas) return (PIXA *)ERROR_PTR("pixas not defined", procName, NULL); if (nx < 1 || ny < 1 || nx > 50 || ny > 50) return (PIXA *)ERROR_PTR("invalid tiling factor(s)", procName, NULL); if ((n = pixaGetCount(pixas)) == 0) return (PIXA *)ERROR_PTR("pixas is empty", procName, NULL); /* Filter out large ones if requested */ if (maxw == 0 && maxh == 0) { pixa1 = pixaCopy(pixas, L_CLONE); } else { maxw = (maxw == 0) ? 1000000 : maxw; maxh = (maxh == 0) ? 1000000 : maxh; pixa1 = pixaSelectBySize(pixas, maxw, maxh, L_SELECT_IF_BOTH, L_SELECT_IF_LTE, NULL); n = pixaGetCount(pixa1); } ntile = nx * ny; nout = L_MAX(1, (n + ntile - 1) / ntile); pixad = pixaCreate(nout); for (i = 0, index = 0; i < nout; i++) { /* over tiles */ pixa2 = pixaCreate(ntile); for (j = 0; j < ntile && index < n; j++, index++) { pix1 = pixaGetPix(pixa1, index, L_COPY); pixaAddPix(pixa2, pix1, L_INSERT); } pix2 = pixaDisplayTiledInColumns(pixa2, nx, scalefactor, spacing, border); pixaAddPix(pixad, pix2, L_INSERT); pixaDestroy(&pixa2); } pixaDestroy(&pixa1); return pixad; } /*---------------------------------------------------------------------* * Split pixa into files * *---------------------------------------------------------------------*/ /*! * \brief pixaSplitIntoFiles() * * \param[in] pixas * \param[in] nsplit split pixas into this number of pixa; >= 2 * \param[in] scale scalefactor applied to each pix * \param[in] outwidth the maxwidth parameter of tiled images * for write_pix * \param[in] write_pixa 1 to write the split pixa as separate files * \param[in] write_pix 1 to write tiled images of the split pixa * \param[in] write_pdf 1 to write pdfs of the split pixa * \return 0 if OK, 1 on error * * <pre> * Notes: * (1) For each requested output, %nsplit files are written into * directory /tmp/lept/split/. * (2) This is useful when a pixa is so large that the images * are not conveniently displayed as a single tiled image at * full resolution. * </pre> */ l_int32 pixaSplitIntoFiles(PIXA *pixas, l_int32 nsplit, l_float32 scale, l_int32 outwidth, l_int32 write_pixa, l_int32 write_pix, l_int32 write_pdf) { char buf[64]; l_int32 i, j, index, n, nt; PIX *pix1, *pix2; PIXA *pixa1; PROCNAME("pixaSplitIntoFiles"); if (!pixas) return ERROR_INT("pixas not defined", procName, 1); if (nsplit <= 1) return ERROR_INT("nsplit must be >= 2", procName, 1); if ((nt = pixaGetCount(pixas)) == 0) return ERROR_INT("pixas is empty", procName, 1); if (!write_pixa && !write_pix && !write_pdf) return ERROR_INT("no output is requested", procName, 1); lept_mkdir("lept/split"); n = (nt + nsplit - 1) / nsplit; fprintf(stderr, "nt = %d, n = %d, nsplit = %d\n", nt, n, nsplit); for (i = 0, index = 0; i < nsplit; i++) { pixa1 = pixaCreate(n); for (j = 0; j < n && index < nt; j++, index++) { pix1 = pixaGetPix(pixas, index, L_CLONE); pix2 = pixScale(pix1, scale, scale); pixaAddPix(pixa1, pix2, L_INSERT); pixDestroy(&pix1); } if (write_pixa) { snprintf(buf, sizeof(buf), "/tmp/lept/split/split%d.pa", i + 1); pixaWrite(buf, pixa1); } if (write_pix) { snprintf(buf, sizeof(buf), "/tmp/lept/split/split%d.tif", i + 1); pix1 = pixaDisplayTiledInRows(pixa1, 1, outwidth, 1.0, 0, 20, 2); pixWrite(buf, pix1, IFF_TIFF_G4); pixDestroy(&pix1); } if (write_pdf) { snprintf(buf, sizeof(buf), "/tmp/lept/split/split%d.pdf", i + 1); pixaConvertToPdf(pixa1, 0, 1.0, L_G4_ENCODE, 0, buf, buf); } pixaDestroy(&pixa1); } return 0; } /*---------------------------------------------------------------------* * Tile N-Up * *---------------------------------------------------------------------*/ /*! * \brief convertToNUpFiles() * * \param[in] dir full path to directory of images * \param[in] substr [optional] can be null * \param[in] nx, ny in [1, ... 50], tiling factors in each direction * \param[in] tw target width, in pixels; must be >= 20 * \param[in] spacing between images, and on outside * \param[in] border width of additional black border on each image; * use 0 for no border * \param[in] fontsize to print tail of filename with image. Valid set is * {4,6,8,10,12,14,16,18,20}. Use 0 to disable. * \param[in] outdir subdirectory of /tmp to put N-up tiled images * \return 0 if OK, 1 on error * * <pre> * Notes: * (1) Each set of %nx * %ny images is scaled and tiled into a single * image, that is written out to %outdir. * (2) All images in each %nx * %ny set are scaled to the same * width, %tw. This is typically used when all images are * roughly the same size. * (3) This is useful for generating a pdf from the set of input * files, where each page is a tile of (%nx * %ny) input images. * Typical values for %nx and %ny are in the range [2 ... 5]. * (4) If %fontsize != 0, each image has the tail of its filename * rendered below it. * </pre> */ l_int32 convertToNUpFiles(const char *dir, const char *substr, l_int32 nx, l_int32 ny, l_int32 tw, l_int32 spacing, l_int32 border, l_int32 fontsize, const char *outdir) { l_int32 d, format; char rootpath[256]; PIXA *pixa; PROCNAME("convertToNUpFiles"); if (!dir) return ERROR_INT("dir not defined", procName, 1); if (nx < 1 || ny < 1 || nx > 50 || ny > 50) return ERROR_INT("invalid tiling N-factor", procName, 1); if (fontsize < 0 || fontsize > 20 || fontsize & 1 || fontsize == 2) return ERROR_INT("invalid fontsize", procName, 1); if (!outdir) return ERROR_INT("outdir not defined", procName, 1); pixa = convertToNUpPixa(dir, substr, nx, ny, tw, spacing, border, fontsize); if (!pixa) return ERROR_INT("pixa not made", procName, 1); lept_rmdir(outdir); lept_mkdir(outdir); pixaGetRenderingDepth(pixa, &d); format = (d == 1) ? IFF_TIFF_G4 : IFF_JFIF_JPEG; makeTempDirname(rootpath, 256, outdir); modifyTrailingSlash(rootpath, 256, L_ADD_TRAIL_SLASH); pixaWriteFiles(rootpath, pixa, format); pixaDestroy(&pixa); return 0; } /*! * \brief convertToNUpPixa() * * \param[in] dir full path to directory of images * \param[in] substr [optional] can be null * \param[in] nx, ny in [1, ... 50], tiling factors in each direction * \param[in] tw target width, in pixels; must be >= 20 * \param[in] spacing between images, and on outside * \param[in] border width of additional black border on each image; * use 0 for no border * \param[in] fontsize to print tail of filename with image. Valid set is * {4,6,8,10,12,14,16,18,20}. Use 0 to disable. * \return pixad, or NULL on error * * <pre> * Notes: * (1) See notes for convertToNUpFiles() * </pre> */ PIXA * convertToNUpPixa(const char *dir, const char *substr, l_int32 nx, l_int32 ny, l_int32 tw, l_int32 spacing, l_int32 border, l_int32 fontsize) { l_int32 i, n; char *fname, *tail; PIXA *pixa1, *pixa2; SARRAY *sa1, *sa2; PROCNAME("convertToNUpPixa"); if (!dir) return (PIXA *)ERROR_PTR("dir not defined", procName, NULL); if (nx < 1 || ny < 1 || nx > 50 || ny > 50) return (PIXA *)ERROR_PTR("invalid tiling N-factor", procName, NULL); if (tw < 20) return (PIXA *)ERROR_PTR("tw must be >= 20", procName, NULL); if (fontsize < 0 || fontsize > 20 || fontsize & 1 || fontsize == 2) return (PIXA *)ERROR_PTR("invalid fontsize", procName, NULL); sa1 = getSortedPathnamesInDirectory(dir, substr, 0, 0); pixa1 = pixaReadFilesSA(sa1); n = sarrayGetCount(sa1); sa2 = sarrayCreate(n); for (i = 0; i < n; i++) { fname = sarrayGetString(sa1, i, L_NOCOPY); splitPathAtDirectory(fname, NULL, &tail); sarrayAddString(sa2, tail, L_INSERT); } sarrayDestroy(&sa1); pixa2 = pixaConvertToNUpPixa(pixa1, sa2, nx, ny, tw, spacing, border, fontsize); pixaDestroy(&pixa1); sarrayDestroy(&sa2); return pixa2; } /*! * \brief pixaConvertToNUpPixa() * * \param[in] pixas * \param[in] sa [optional] array of strings associated with each pix * \param[in] nx, ny in [1, ... 50], tiling factors in each direction * \param[in] tw target width, in pixels; must be >= 20 * \param[in] spacing between images, and on outside * \param[in] border width of additional black border on each image; * use 0 for no border * \param[in] fontsize to print string with each image. Valid set is * {4,6,8,10,12,14,16,18,20}. Use 0 to disable. * \return pixad, or NULL on error * * <pre> * Notes: * (1) This takes an input pixa and an optional array of strings, and * generates a pixa of NUp tiles from the input, labeled with * the strings if they exist and %fontsize != 0. * (2) See notes for convertToNUpFiles() * </pre> */ PIXA * pixaConvertToNUpPixa(PIXA *pixas, SARRAY *sa, l_int32 nx, l_int32 ny, l_int32 tw, l_int32 spacing, l_int32 border, l_int32 fontsize) { l_int32 i, j, k, nt, n2, nout, d; char *str; L_BMF *bmf; PIX *pix1, *pix2, *pix3, *pix4; PIXA *pixa1, *pixad; PROCNAME("pixaConvertToNUpPixa"); if (!pixas) return (PIXA *)ERROR_PTR("pixas not defined", procName, NULL); if (nx < 1 || ny < 1 || nx > 50 || ny > 50) return (PIXA *)ERROR_PTR("invalid tiling N-factor", procName, NULL); if (tw < 20) return (PIXA *)ERROR_PTR("tw must be >= 20", procName, NULL); if (fontsize < 0 || fontsize > 20 || fontsize & 1 || fontsize == 2) return (PIXA *)ERROR_PTR("invalid fontsize", procName, NULL); nt = pixaGetCount(pixas); if (sa && (sarrayGetCount(sa) != nt)) { L_WARNING("pixa size %d not equal to sarray size %d\n", procName, nt, sarrayGetCount(sa)); } n2 = nx * ny; nout = (nt + n2 - 1) / n2; pixad = pixaCreate(nout); bmf = (fontsize == 0) ? NULL : bmfCreate(NULL, fontsize); for (i = 0, j = 0; i < nout; i++) { pixa1 = pixaCreate(n2); for (k = 0; k < n2 && j < nt; j++, k++) { pix1 = pixaGetPix(pixas, j, L_CLONE); pix2 = pixScaleToSize(pix1, tw, 0); /* all images have width tw */ if (bmf && sa) { str = sarrayGetString(sa, j, L_NOCOPY); pix3 = pixAddTextlines(pix2, bmf, str, 0xff000000, L_ADD_BELOW); } else { pix3 = pixClone(pix2); } pixaAddPix(pixa1, pix3, L_INSERT); pixDestroy(&pix1); pixDestroy(&pix2); } if (pixaGetCount(pixa1) == 0) { /* probably won't happen */ pixaDestroy(&pixa1); continue; } /* Add 2 * border to image width to prevent scaling */ pixaGetRenderingDepth(pixa1, &d); pix4 = pixaDisplayTiledAndScaled(pixa1, d, tw + 2 * border, nx, 0, spacing, border); pixaAddPix(pixad, pix4, L_INSERT); pixaDestroy(&pixa1); } bmfDestroy(&bmf); return pixad; } /*---------------------------------------------------------------------* * Render two pixa side-by-side for comparison * *---------------------------------------------------------------------*/ /*! * \brief pixaCompareInPdf() * * \param[in] pixa1 * \param[in] pixa2 * \param[in] nx, ny in [1, ... 20], tiling factors in each direction * \param[in] tw target width, in pixels; must be >= 20 * \param[in] spacing between images, and on outside * \param[in] border width of additional black border on each image * and on each pair; use 0 for no border * \param[in] fontsize to print index of each pair of images. Valid set * is {4,6,8,10,12,14,16,18,20}. Use 0 to disable. * \param[in] fileout output pdf file * \return 0 if OK, 1 on error * * <pre> * Notes: * (1) This takes two pixa and renders them interleaved, side-by-side * in a pdf. A warning is issued if the input pixa arrays * have different lengths. * (2) %nx and %ny specify how many side-by-side pairs are displayed * on each pdf page. For example, if %nx = 1 and %ny = 2, then * two pairs are shown, one above the other, on each page. * (3) The input pix are scaled to a target width of %tw, and * then paired with optional %spacing between and optional * black border of width %border. * (4) After a pixa is generated of these tiled images, it is * written to %fileout as a pdf. * (5) Typical numbers for the input parameters are: * %nx = small integer (1 - 4) * %ny = 2 * %nx * %tw = 200 - 500 pixels * %spacing = 10 * %border = 2 * %fontsize = 10 * (6) If %fontsize != 0, the index of the pix pair in their pixa * is printed out below each pair. * </pre> */ l_int32 pixaCompareInPdf(PIXA *pixa1, PIXA *pixa2, l_int32 nx, l_int32 ny, l_int32 tw, l_int32 spacing, l_int32 border, l_int32 fontsize, const char *fileout) { l_int32 n1, n2, npairs; PIXA *pixa3, *pixa4, *pixa5; SARRAY *sa; PROCNAME("pixaCompareInPdf"); if (!pixa1 || !pixa2) return ERROR_INT("pixa1 and pixa2 not both defined", procName, 1); if (nx < 1 || ny < 1 || nx > 20 || ny > 20) return ERROR_INT("invalid tiling factors", procName, 1); if (tw < 20) return ERROR_INT("invalid tw; tw must be >= 20", procName, 1); if (fontsize < 0 || fontsize > 20 || fontsize & 1 || fontsize == 2) return ERROR_INT("invalid fontsize", procName, 1); if (!fileout) return ERROR_INT("fileout not defined", procName, 1); n1 = pixaGetCount(pixa1); n2 = pixaGetCount(pixa2); if (n1 == 0 || n2 == 0) return ERROR_INT("at least one pixa is empty", procName, 1); if (n1 != n2) L_WARNING("sizes (%d, %d) differ; using the minimum in interleave\n", procName, n1, n2); /* Interleave the input pixa */ if ((pixa3 = pixaInterleave(pixa1, pixa2, L_CLONE)) == NULL) return ERROR_INT("pixa3 not made", procName, 1); /* Scale the images if necessary and pair them up side/by/side */ pixa4 = pixaConvertToNUpPixa(pixa3, NULL, 2, 1, tw, spacing, border, 0); pixaDestroy(&pixa3); /* Label the pairs and mosaic into pages without further scaling */ npairs = pixaGetCount(pixa4); sa = (fontsize > 0) ? sarrayGenerateIntegers(npairs) : NULL; pixa5 = pixaConvertToNUpPixa(pixa4, sa, nx, ny, 2 * tw + 4 * border + spacing, spacing, border, fontsize); pixaDestroy(&pixa4); sarrayDestroy(&sa); /* Output as pdf without scaling */ pixaConvertToPdf(pixa5, 0, 1.0, 0, 0, NULL, fileout); pixaDestroy(&pixa5); return 0; }
34.808945
80
0.544236
ec6a6105ec6abcd64b1a22e38b1c8f7ab0618b83
2,799
c
C
d/avatars/bane/zrikk1.c
gesslar/shadowgate
97ce5d33a2275bb75c0cf6556602564b7870bc77
[ "MIT" ]
13
2019-07-19T05:24:44.000Z
2021-11-18T04:08:19.000Z
d/avatars/bane/zrikk1.c
gesslar/shadowgate
97ce5d33a2275bb75c0cf6556602564b7870bc77
[ "MIT" ]
null
null
null
d/avatars/bane/zrikk1.c
gesslar/shadowgate
97ce5d33a2275bb75c0cf6556602564b7870bc77
[ "MIT" ]
13
2019-09-12T06:22:38.000Z
2022-01-31T01:15:12.000Z
#include <std.h> inherit WEAPON; void create(){ ::create(); set_name("%^BOLD%^%^BLACK%^B%^RESET%^%^BLUE%^a%^BOLD%^%^BLACK%^r%^RESET%^%^BLUE%^b%^BOLD%^%^BLACK%^e%^RESET%^%^BLUE%^d %^BOLD%^%^BLACK%^short sword%^RESET%^"); set_id(({ "sword", "Sword", "short sword", "Short sword", "Short Sword", "barbed sword", "Barbed sword", "Barbed Sword", "barbed short sword", "Barbed short sword" })); set_short("%^BOLD%^%^BLACK%^B%^RESET%^%^BLUE%^a%^BOLD%^%^BLACK%^r%^RESET%^%^BLUE%^b%^BOLD%^%^BLACK%^e%^RESET%^%^BLUE%^d %^BOLD%^%^BLACK%^short sword%^RESET%^"); set_obvious_short("short sword"); set_long( @AVATAR %^BOLD%^%^BLACK%^This is one nasty looking short sword. The blade is roughly two feet long with another six inches for the handle, there is no crossguard between the blade and handle. The handle is made up of some smaller %^BOLD%^%^WHITE%^bones %^BOLD%^%^BLACK%^that were tied tightly together, the grip is some rough %^RESET%^%^ORANGE%^leather %^BOLD%^%^BLACK%^wrapped around the bones. The blade is a %^RESET%^%^BLUE%^dark black color %^BOLD%^%^BLACK%^with little b%^RESET%^%^BLUE%^a%^BOLD%^%^BLACK%^rbs covering it in some random design. No matter which direction the blade was swung the b%^RESET%^%^BLUE%^a%^BOLD%^%^BLACK%^rbs would tear and rip the skin and muscle from the victim.%^RESET%^ AVATAR ); set_weight(6); set_value(100); set_property("lore difficulty",0); set_type("piercing"); set_prof_type("small blades"); set_size(1); set_wc(1,6); set_large_wc(1,8); set_property("enchantment",1); set_ac(0); set_wield((:TO,"wield_func":)); set_unwield((:TO,"unwield_func":)); set_hit((:TO,"hit_func":)); } int wield_func(){ tell_room(environment(ETO),"%^RESET%^%^BLUE%^"+ETOQCN+"'s light up while gripping the blade tightly.%^RESET%^",ETO); tell_object(ETO,"%^RESET%^%^BLUE%^Your eyes light up as you grasp the blade tightly in your hand!%^RESET%^"); return 1; } int unwield_func(){ tell_room(environment(ETO),"%^RESET%^%^BLUE%^"+ETOQCN+" gets a look of sadness while letting go of the blade.%^RESET%^",ETO); tell_object(ETO,"%^RESET%^%^BLUE%^You feel like you've lost a part of yourself as you release the blade.%^RESET%^"); return 1; } int hit_func(object targ){ if(random(1000) < 250){ tell_room(environment(query_wielded()),"%^RESET%^%^BLUE%^The barbs on "+ETOQCN+"'s sword %^RESET%^%^RED%^rip %^RESET%^%^BLUE%^the flesh from %^BOLD%^%^BLUE%^"+targ->QCN+"%^RESET%^%^BLUE%^!%^RESET%^",({ETO,targ})); tell_object(ETO,"%^RESET%^%^BLUE%^As you slice into %^BOLD%^%^BLUE%^"+targ->QCN+" %^RESET%^%^BLUE%^the barbs %^RESET%^%^RED%^rip %^RESET%^%^BLUE%^their flesh apart!%^RESET%^"); tell_object(targ,"%^RESET%^%^BLUE%^As "+ETOQCN+" slashes you, the barbs on the blade %^RESET%^%^RED%^rip %^RESET%^%^BLUE%^your flesh away!%^RESET%^"); return roll_dice(1,4)+1; } }
60.847826
695
0.668096
bd1d89f04bc12b9ffcc5b4376ffc0b2b93718bda
1,354
h
C
llvm/lib/Target/Mips/MipsFrameLowering.h
clairechingching/ScaffCC
737ae90f85d9fe79819d66219747d27efa4fa5b9
[ "BSD-2-Clause" ]
3
2019-02-12T04:14:39.000Z
2020-11-05T08:46:20.000Z
llvm/lib/Target/Mips/MipsFrameLowering.h
clairechingching/ScaffCC
737ae90f85d9fe79819d66219747d27efa4fa5b9
[ "BSD-2-Clause" ]
1
2020-02-22T09:59:21.000Z
2020-02-22T09:59:21.000Z
llvm/lib/Target/Mips/MipsFrameLowering.h
clairechingching/ScaffCC
737ae90f85d9fe79819d66219747d27efa4fa5b9
[ "BSD-2-Clause" ]
1
2022-02-05T23:42:06.000Z
2022-02-05T23:42:06.000Z
//===-- MipsFrameLowering.h - Define frame lowering for Mips ----*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // // //===----------------------------------------------------------------------===// #ifndef MIPS_FRAMEINFO_H #define MIPS_FRAMEINFO_H #include "Mips.h" #include "MipsSubtarget.h" #include "llvm/Target/TargetFrameLowering.h" namespace llvm { class MipsSubtarget; class MipsFrameLowering : public TargetFrameLowering { protected: const MipsSubtarget &STI; public: explicit MipsFrameLowering(const MipsSubtarget &sti) : TargetFrameLowering(StackGrowsDown, sti.hasMips64() ? 16 : 8, 0), STI(sti) { } bool targetHandlesStackFrameRounding() const; /// emitProlog/emitEpilog - These methods insert prolog and epilog code into /// the function. void emitPrologue(MachineFunction &MF) const; void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const; bool hasFP(const MachineFunction &MF) const; void processFunctionBeforeCalleeSavedScan(MachineFunction &MF, RegScavenger *RS) const; }; } // End llvm namespace #endif
27.08
80
0.615214
035575bdca55da8d45603c799cdd26459704651d
633
h
C
FlyCoreAnimation/HXF/Map/XFMapModel/XFAnnotation.h
linxuanzhao/shareFun
23e6c4bb6086cc310d8746e234763b31bf411ddf
[ "Apache-2.0" ]
1
2017-05-05T05:58:31.000Z
2017-05-05T05:58:31.000Z
FlyCoreAnimation/HXF/Map/XFMapModel/XFAnnotation.h
linxuanzhao/shareFun
23e6c4bb6086cc310d8746e234763b31bf411ddf
[ "Apache-2.0" ]
null
null
null
FlyCoreAnimation/HXF/Map/XFMapModel/XFAnnotation.h
linxuanzhao/shareFun
23e6c4bb6086cc310d8746e234763b31bf411ddf
[ "Apache-2.0" ]
null
null
null
// // XFAnnotation.h // FlyCoreAnimation // // Created by lanou on 16/8/9. // Copyright © 2016年 he. All rights reserved. // #import <Foundation/Foundation.h> #import <BaiduMapAPI_Map/BMKMapComponent.h> typedef NSUInteger BMKPinAnnotationColor; ///提供类似大头针效果的annotation view @interface XFAnnotation : BMKActionPaopaoView { @private BMKPinAnnotationColor _pinColor; BOOL _animatesDrop; } ///大头针的颜色,有BMKPinAnnotationColorRed, BMKPinAnnotationColorGreen, BMKPinAnnotationColorPurple三种 @property (nonatomic) BMKPinAnnotationColor pinColor; ///动画效果 @property (nonatomic) BOOL animatesDrop; -(instancetype)init; @end
17.583333
94
0.774092
eabdb8143cb8aac6e28f9d1aa855f625a50b6a4b
10,930
h
C
headers/libxml2/libxml/xmlwriter.h
mwichmann/lsb-buildenv
7a7eb64b5960172e0032e7202aeb454e076880fa
[ "BSD-3-Clause" ]
null
null
null
headers/libxml2/libxml/xmlwriter.h
mwichmann/lsb-buildenv
7a7eb64b5960172e0032e7202aeb454e076880fa
[ "BSD-3-Clause" ]
null
null
null
headers/libxml2/libxml/xmlwriter.h
mwichmann/lsb-buildenv
7a7eb64b5960172e0032e7202aeb454e076880fa
[ "BSD-3-Clause" ]
null
null
null
#if (__LSB_VERSION__ >= 31 ) #ifndef _LIBXML2_LIBXML_XMLWRITER_H_ #define _LIBXML2_LIBXML_XMLWRITER_H_ #include <stdarg.h> #include <libxml2/libxml/xmlstring.h> #include <libxml2/libxml/tree.h> #include <libxml2/libxml/xmlerror.h> #include <libxml2/libxml/dict.h> #include <libxml2/libxml/xmlregexp.h> #include <libxml2/libxml/hash.h> #include <libxml2/libxml/SAX2.h> #include <libxml2/libxml/xmlIO.h> #ifdef __cplusplus extern "C" { #endif #define xmlTextWriterWriteDocType xmlTextWriterWriteDTD #define xmlTextWriterWriteProcessingInstruction xmlTextWriterWritePI typedef struct _xmlTextWriter xmlTextWriter; typedef xmlTextWriter *xmlTextWriterPtr; /* Function prototypes */ extern void xmlFreeTextWriter(xmlTextWriterPtr writer); extern xmlTextWriterPtr xmlNewTextWriter(xmlOutputBufferPtr out); extern xmlTextWriterPtr xmlNewTextWriterDoc(xmlDocPtr * doc, int compression); extern xmlTextWriterPtr xmlNewTextWriterFilename(const char *uri, int compression); extern xmlTextWriterPtr xmlNewTextWriterMemory(xmlBufferPtr buf, int compression); extern xmlTextWriterPtr xmlNewTextWriterPushParser(xmlParserCtxtPtr ctxt, int compression); extern xmlTextWriterPtr xmlNewTextWriterTree(xmlDocPtr doc, xmlNodePtr node, int compression); extern int xmlTextWriterEndAttribute(xmlTextWriterPtr writer); extern int xmlTextWriterEndCDATA(xmlTextWriterPtr writer); extern int xmlTextWriterEndComment(xmlTextWriterPtr writer); extern int xmlTextWriterEndDTD(xmlTextWriterPtr writer); extern int xmlTextWriterEndDTDAttlist(xmlTextWriterPtr writer); extern int xmlTextWriterEndDTDElement(xmlTextWriterPtr writer); extern int xmlTextWriterEndDTDEntity(xmlTextWriterPtr writer); extern int xmlTextWriterEndDocument(xmlTextWriterPtr writer); extern int xmlTextWriterEndElement(xmlTextWriterPtr writer); extern int xmlTextWriterEndPI(xmlTextWriterPtr writer); extern int xmlTextWriterFlush(xmlTextWriterPtr writer); extern int xmlTextWriterFullEndElement(xmlTextWriterPtr writer); extern int xmlTextWriterSetIndent(xmlTextWriterPtr writer, int indent); extern int xmlTextWriterSetIndentString(xmlTextWriterPtr writer, const xmlChar * str); extern int xmlTextWriterStartAttribute(xmlTextWriterPtr writer, const xmlChar * name); extern int xmlTextWriterStartAttributeNS(xmlTextWriterPtr writer, const xmlChar * prefix, const xmlChar * name, const xmlChar * namespaceURI); extern int xmlTextWriterStartCDATA(xmlTextWriterPtr writer); extern int xmlTextWriterStartComment(xmlTextWriterPtr writer); extern int xmlTextWriterStartDTD(xmlTextWriterPtr writer, const xmlChar * name, const xmlChar * pubid, const xmlChar * sysid); extern int xmlTextWriterStartDTDAttlist(xmlTextWriterPtr writer, const xmlChar * name); extern int xmlTextWriterStartDTDElement(xmlTextWriterPtr writer, const xmlChar * name); extern int xmlTextWriterStartDTDEntity(xmlTextWriterPtr writer, int pe, const xmlChar * name); extern int xmlTextWriterStartDocument(xmlTextWriterPtr writer, const char *version, const char *encoding, const char *standalone); extern int xmlTextWriterStartElement(xmlTextWriterPtr writer, const xmlChar * name); extern int xmlTextWriterStartElementNS(xmlTextWriterPtr writer, const xmlChar * prefix, const xmlChar * name, const xmlChar * namespaceURI); extern int xmlTextWriterStartPI(xmlTextWriterPtr writer, const xmlChar * target); extern int xmlTextWriterWriteAttribute(xmlTextWriterPtr writer, const xmlChar * name, const xmlChar * content); extern int xmlTextWriterWriteAttributeNS(xmlTextWriterPtr writer, const xmlChar * prefix, const xmlChar * name, const xmlChar * namespaceURI, const xmlChar * content); extern int xmlTextWriterWriteBase64(xmlTextWriterPtr writer, const char *data, int start, int len); extern int xmlTextWriterWriteBinHex(xmlTextWriterPtr writer, const char *data, int start, int len); extern int xmlTextWriterWriteCDATA(xmlTextWriterPtr writer, const xmlChar * content); extern int xmlTextWriterWriteComment(xmlTextWriterPtr writer, const xmlChar * content); extern int xmlTextWriterWriteDTD(xmlTextWriterPtr writer, const xmlChar * name, const xmlChar * pubid, const xmlChar * sysid, const xmlChar * subset); extern int xmlTextWriterWriteDTDAttlist(xmlTextWriterPtr writer, const xmlChar * name, const xmlChar * content); extern int xmlTextWriterWriteDTDElement(xmlTextWriterPtr writer, const xmlChar * name, const xmlChar * content); extern int xmlTextWriterWriteDTDEntity(xmlTextWriterPtr writer, int pe, const xmlChar * name, const xmlChar * pubid, const xmlChar * sysid, const xmlChar * ndataid, const xmlChar * content); extern int xmlTextWriterWriteDTDExternalEntity(xmlTextWriterPtr writer, int pe, const xmlChar * name, const xmlChar * pubid, const xmlChar * sysid, const xmlChar * ndataid); extern int xmlTextWriterWriteDTDExternalEntityContents(xmlTextWriterPtr writer, const xmlChar * pubid, const xmlChar * sysid, const xmlChar * ndataid); extern int xmlTextWriterWriteDTDInternalEntity(xmlTextWriterPtr writer, int pe, const xmlChar * name, const xmlChar * content); extern int xmlTextWriterWriteDTDNotation(xmlTextWriterPtr writer, const xmlChar * name, const xmlChar * pubid, const xmlChar * sysid); extern int xmlTextWriterWriteElement(xmlTextWriterPtr writer, const xmlChar * name, const xmlChar * content); extern int xmlTextWriterWriteElementNS(xmlTextWriterPtr writer, const xmlChar * prefix, const xmlChar * name, const xmlChar * namespaceURI, const xmlChar * content); extern int xmlTextWriterWriteFormatAttribute(xmlTextWriterPtr writer, const xmlChar * name, const char *format, ...); extern int xmlTextWriterWriteFormatAttributeNS(xmlTextWriterPtr writer, const xmlChar * prefix, const xmlChar * name, const xmlChar * namespaceURI, const char *format, ...); extern int xmlTextWriterWriteFormatCDATA(xmlTextWriterPtr writer, const char *format, ...); extern int xmlTextWriterWriteFormatComment(xmlTextWriterPtr writer, const char *format, ...); extern int xmlTextWriterWriteFormatDTD(xmlTextWriterPtr writer, const xmlChar * name, const xmlChar * pubid, const xmlChar * sysid, const char *format, ...); extern int xmlTextWriterWriteFormatDTDAttlist(xmlTextWriterPtr writer, const xmlChar * name, const char *format, ...); extern int xmlTextWriterWriteFormatDTDElement(xmlTextWriterPtr writer, const xmlChar * name, const char *format, ...); extern int xmlTextWriterWriteFormatDTDInternalEntity(xmlTextWriterPtr writer, int pe, const xmlChar * name, const char *format, ...); extern int xmlTextWriterWriteFormatElement(xmlTextWriterPtr writer, const xmlChar * name, const char *format, ...); extern int xmlTextWriterWriteFormatElementNS(xmlTextWriterPtr writer, const xmlChar * prefix, const xmlChar * name, const xmlChar * namespaceURI, const char *format, ...); extern int xmlTextWriterWriteFormatPI(xmlTextWriterPtr writer, const xmlChar * target, const char *format, ...); extern int xmlTextWriterWriteFormatRaw(xmlTextWriterPtr writer, const char *format, ...); extern int xmlTextWriterWriteFormatString(xmlTextWriterPtr writer, const char *format, ...); extern int xmlTextWriterWritePI(xmlTextWriterPtr writer, const xmlChar * target, const xmlChar * content); extern int xmlTextWriterWriteRaw(xmlTextWriterPtr writer, const xmlChar * content); extern int xmlTextWriterWriteRawLen(xmlTextWriterPtr writer, const xmlChar * content, int len); extern int xmlTextWriterWriteString(xmlTextWriterPtr writer, const xmlChar * content); extern int xmlTextWriterWriteVFormatAttribute(xmlTextWriterPtr writer, const xmlChar * name, const char *format, va_list argptr); extern int xmlTextWriterWriteVFormatAttributeNS(xmlTextWriterPtr writer, const xmlChar * prefix, const xmlChar * name, const xmlChar * namespaceURI, const char *format, va_list argptr); extern int xmlTextWriterWriteVFormatCDATA(xmlTextWriterPtr writer, const char *format, va_list argptr); extern int xmlTextWriterWriteVFormatComment(xmlTextWriterPtr writer, const char *format, va_list argptr); extern int xmlTextWriterWriteVFormatDTD(xmlTextWriterPtr writer, const xmlChar * name, const xmlChar * pubid, const xmlChar * sysid, const char *format, va_list argptr); extern int xmlTextWriterWriteVFormatDTDAttlist(xmlTextWriterPtr writer, const xmlChar * name, const char *format, va_list argptr); extern int xmlTextWriterWriteVFormatDTDElement(xmlTextWriterPtr writer, const xmlChar * name, const char *format, va_list argptr); extern int xmlTextWriterWriteVFormatDTDInternalEntity(xmlTextWriterPtr writer, int pe, const xmlChar * name, const char *format, va_list argptr); extern int xmlTextWriterWriteVFormatElement(xmlTextWriterPtr writer, const xmlChar * name, const char *format, va_list argptr); extern int xmlTextWriterWriteVFormatElementNS(xmlTextWriterPtr writer, const xmlChar * prefix, const xmlChar * name, const xmlChar * namespaceURI, const char *format, va_list argptr); extern int xmlTextWriterWriteVFormatPI(xmlTextWriterPtr writer, const xmlChar * target, const char *format, va_list argptr); extern int xmlTextWriterWriteVFormatRaw(xmlTextWriterPtr writer, const char *format, va_list argptr); extern int xmlTextWriterWriteVFormatString(xmlTextWriterPtr writer, const char *format, va_list argptr); #ifdef __cplusplus } #endif #endif /* protection */ #endif /* LSB version */
39.316547
75
0.698353
c1108c0589e5e2eee9365952974b7c50e1cb8d14
37,807
h
C
src/graph/test/TraverseTestBase.h
Wang-2019/nebulalala
3321a8b4001c0f9990bf95f042ab92d123b6f002
[ "Apache-2.0" ]
null
null
null
src/graph/test/TraverseTestBase.h
Wang-2019/nebulalala
3321a8b4001c0f9990bf95f042ab92d123b6f002
[ "Apache-2.0" ]
null
null
null
src/graph/test/TraverseTestBase.h
Wang-2019/nebulalala
3321a8b4001c0f9990bf95f042ab92d123b6f002
[ "Apache-2.0" ]
null
null
null
/* Copyright (c) 2019 vesoft inc. All rights reserved. * * This source code is licensed under Apache 2.0 License, * attached with Common Clause Condition 1.0, found in the LICENSES directory. */ #ifndef GRAPH_TEST_TRAVERSETESTBASE_H_ #define GRAPH_TEST_TRAVERSETESTBASE_H_ #include "base/Base.h" #include "graph/test/TestEnv.h" #include "graph/test/TestBase.h" #include "meta/test/TestUtils.h" #include "storage/test/TestUtils.h" DECLARE_int32(load_data_interval_secs); namespace nebula { namespace graph { class TraverseTestBase : public TestBase { protected: void SetUp() override { TestBase::SetUp(); // ... } void TearDown() override { // ... TestBase::TearDown(); } static void SetUpTestCase() { client_ = gEnv->getClient(); storagePort_ = gEnv->storageServerPort(); ASSERT_NE(nullptr, client_); ASSERT_TRUE(prepareSchema()); ASSERT_TRUE(prepareData()); } static void TearDownTestCase() { ASSERT_TRUE(removeData()); client_.reset(); } AssertionResult verifyPath(const cpp2::ExecutionResponse &resp, std::vector<std::string> &expected) { if (resp.get_error_code() != cpp2::ErrorCode::SUCCEEDED) { auto *errmsg = resp.get_error_msg(); return TestError() << "Query failed with `" << static_cast<int32_t>(resp.get_error_code()) << (errmsg == nullptr ? "'" : "': " + *errmsg); } if (resp.get_rows() == nullptr && expected.empty()) { return TestOK(); } auto rows = buildPathString(*resp.get_rows()); if (expected.size() != rows.size()) { return TestError() << "Rows' count not match: " << rows.size() << " vs. " << expected.size(); } std::sort(rows.begin(), rows.end()); std::sort(expected.begin(), expected.end()); for (decltype(rows.size()) i = 0; i < rows.size(); ++i) { VLOG(2) << rows[i]; } for (decltype(rows.size()) i = 0; i < rows.size(); ++i) { if (rows[i] != expected[i]) { return TestError() << rows[i] << " vs. " << expected[i]; } } return TestOK(); } static std::vector<std::string> buildPathString(std::vector<cpp2::RowValue> rows) { std::vector<std::string> paths; for (auto &row : rows) { auto &pathValue = row.get_columns().back().get_path(); auto &cols = pathValue.get_entry_list(); std::string pathStr; auto iter = cols.begin(); while (iter < (cols.end() - 1)) { pathStr += folly::stringPrintf("%ld<%s,%ld>", iter->get_vertex().get_id(), (iter + 1)->get_edge().get_type().c_str(), (iter + 1)->get_edge().get_ranking()); iter = iter + 2; } pathStr += folly::to<std::string>(iter->get_vertex().get_id()); paths.emplace_back(std::move(pathStr)); } return paths; } static AssertionResult prepareSchema(); static AssertionResult prepareData(); static AssertionResult removeData(); class Player final { public: Player(std::string name, int64_t age) { name_ = std::move(name); age_ = age; vid_ = std::hash<std::string>()(name_); } Player(const Player&) = default; Player(Player&&) = default; Player& operator=(const Player&) = default; Player& operator=(Player&&) = default; const std::string& name() const { return name_; } int64_t vid() const { return vid_; } int64_t age() const { return age_; } Player& serve(std::string team, int64_t startYear, int64_t endYear) { serves_.emplace_back(std::move(team), startYear, endYear); return *this; } Player& like(std::string player, int64_t likeness) { likes_.emplace_back(std::move(player), likeness); return *this; } Player& teammate(std::string player, int64_t startYear, int64_t endYear) { teammates_.emplace_back(std::move(player), startYear, endYear); return *this; } const auto& serves() const { return serves_; } const auto& likes() const { return likes_; } const auto& teammates() const { return teammates_; } private: using Serve = std::tuple<std::string, int64_t, int64_t>; using Like = std::tuple<std::string, int64_t>; using TeamMate = std::tuple<std::string, int64_t, int64_t>; std::string name_; int64_t vid_{0}; int64_t age_{0}; std::vector<Serve> serves_; std::vector<Like> likes_; std::vector<TeamMate> teammates_; }; template <typename Vertex, typename Key = std::string> class VertexHolder final { public: using KeyGetter = std::function<Key(const Vertex&)>; using Container = std::unordered_map<Key, Vertex>; using InternalIterator = typename Container::iterator; VertexHolder(KeyGetter getter, std::initializer_list<Vertex> vertices) { getter_ = std::move(getter); for (auto &vertex : vertices) { vertices_.emplace(getter_(vertex), std::move(vertex)); } } const Vertex& operator[](const Key &key) const { auto iter = vertices_.find(key); CHECK(iter != vertices_.end()) << "Vertex not exist, key: " << key;; return iter->second; } Vertex& operator[](const Key &key) { auto iter = vertices_.find(key); CHECK(iter != vertices_.end()) << "Vertex not exist, key: " << key; return iter->second; } class Iterator final { public: explicit Iterator(InternalIterator iter) { iter_ = iter; } Iterator& operator++() { ++iter_; return *this; } Vertex& operator*() { return iter_->second; } Vertex* operator->() { return &iter_->second; } bool operator==(const Iterator &rhs) const { return iter_ == rhs.iter_; } bool operator!=(const Iterator &rhs) const { return !(*this == rhs); } private: InternalIterator iter_; }; Iterator begin() { return Iterator(vertices_.begin()); } Iterator end() { return Iterator(vertices_.end()); } private: KeyGetter getter_; Container vertices_; }; class Team final { public: explicit Team(std::string name) { name_ = std::move(name); vid_ = std::hash<std::string>()(name_); } const std::string& name() const { return name_; } int64_t vid() const { return vid_; } private: std::string name_; int64_t vid_{0}; }; protected: static uint16_t storagePort_; static std::unique_ptr<GraphClient> client_; static VertexHolder<Player> players_; static VertexHolder<Team> teams_; }; uint16_t TraverseTestBase::storagePort_ = 0; std::unique_ptr<GraphClient> TraverseTestBase::client_; TraverseTestBase::VertexHolder<TraverseTestBase::Player> TraverseTestBase::players_ = { [] (const auto &player) { return player.name(); }, { Player{"Tim Duncan", 42/*, 1997*/}, Player{"Tony Parker", 36}, Player{"LaMarcus Aldridge", 33}, Player{"Rudy Gay", 32}, Player{"Marco Belinelli", 32}, Player{"Danny Green", 31}, Player{"Kyle Anderson", 25}, Player{"Aron Baynes", 32}, Player{"Boris Diaw", 36}, Player{"Tiago Splitter", 34}, Player{"Cory Joseph", 27}, Player{"David West", 38}, Player{"Jonathon Simmons", 29}, Player{"Dejounte Murray", 29}, Player{"Tracy McGrady", 39}, Player{"Kobe Bryant", 40}, Player{"LeBron James", 34}, Player{"Stephen Curry", 31}, Player{"Russell Westbrook", 30}, Player{"Kevin Durant", 30}, Player{"James Harden", 29}, Player{"Chris Paul", 33}, Player{"DeAndre Jordan", 30}, Player{"Ricky Rubio", 28}, Player{"Rajon Rondo", 33}, Player{"Manu Ginobili", 41}, Player{"Kyrie Irving", 26}, Player{"Vince Carter", 42}, Player{"Carmelo Anthony", 34}, Player{"Dwyane Wade", 37}, Player{"Joel Embiid", 25}, Player{"Paul George", 28}, Player{"Giannis Antetokounmpo", 24}, Player{"Yao Ming", 38}, Player{"Blake Griffin", 30}, Player{"Damian Lillard", 28}, Player{"Steve Nash", 45}, Player{"Dirk Nowitzki", 40}, Player{"Paul Gasol", 38}, Player{"Marc Gasol", 34}, Player{"Grant Hill", 46}, Player{"Ray Allen", 43}, Player{"Klay Thompson", 29}, Player{"Kristaps Porzingis", 23}, Player{"Shaquile O'Neal", 47}, Player{"JaVale McGee", 31}, Player{"Dwight Howard", 33}, Player{"Amar'e Stoudemire", 36}, Player{"Jason Kidd", 45}, Player{"Ben Simmons", 22}, Player{"Luka Doncic", 20}, Player{"Nobody", 0}, } }; TraverseTestBase::VertexHolder<TraverseTestBase::Team> TraverseTestBase::teams_ = { [] (const auto &team) { return team.name(); }, { Team{"Warriors"}, Team{"Nuggets"}, Team{"Rockets"}, Team{"Trail Blazers"}, Team{"Spurs"}, Team{"Thunders"}, Team{"Jazz"}, Team{"Clippers"}, Team{"Kings"}, Team{"Timberwolves"}, Team{"Lakers"}, Team{"Pelicans"}, Team{"Grizzlies"}, Team{"Mavericks"}, Team{"Suns"}, Team{"Hornets"}, Team{"Cavaliers"}, Team{"Celtics"}, Team{"Raptors"}, Team{"76ers"}, Team{"Pacers"}, Team{"Bulls"}, Team{"Hawks"}, Team{"Knicks"}, Team{"Pistons"}, Team{"Bucks"}, Team{"Magic"}, Team{"Nets"}, Team{"Wizards"}, Team{"Heat"}, } }; // static AssertionResult TraverseTestBase::prepareSchema() { { cpp2::ExecutionResponse resp; std::string cmd = "CREATE SPACE nba(partition_num=1, replica_factor=1)"; auto code = client_->execute(cmd, resp); if (cpp2::ErrorCode::SUCCEEDED != code) { return TestError() << "Do cmd:" << cmd << " failed"; } } // fix UTs failed sometimes auto kvstore = gEnv->storageServer()->kvStore_.get(); GraphSpaceID spaceId = 1; // default_space id is 1 nebula::storage::TestUtils::waitUntilAllElected(kvstore, spaceId, 1); { cpp2::ExecutionResponse resp; std::string cmd = "USE nba"; auto code = client_->execute(cmd, resp); if (cpp2::ErrorCode::SUCCEEDED != code) { return TestError() << "Do cmd:" << cmd << " failed"; } } { cpp2::ExecutionResponse resp; std::string cmd = "CREATE TAG player(name string, age int)"; auto code = client_->execute(cmd, resp); if (cpp2::ErrorCode::SUCCEEDED != code) { return TestError() << "Do cmd:" << cmd << " failed"; } } { cpp2::ExecutionResponse resp; std::string cmd = "CREATE TAG team(name string)"; auto code = client_->execute(cmd, resp); if (cpp2::ErrorCode::SUCCEEDED != code) { return TestError() << "Do cmd:" << cmd << " failed"; } } { cpp2::ExecutionResponse resp; std::string cmd = "CREATE EDGE serve(start_year int, end_year int)"; auto code = client_->execute(cmd, resp); if (cpp2::ErrorCode::SUCCEEDED != code) { return TestError() << "Do cmd:" << cmd << " failed"; } } { cpp2::ExecutionResponse resp; std::string cmd = "CREATE EDGE like(likeness int)"; auto code = client_->execute(cmd, resp); if (cpp2::ErrorCode::SUCCEEDED != code) { return TestError() << "Do cmd:" << cmd << " failed"; } } { cpp2::ExecutionResponse resp; std::string cmd = "CREATE EDGE teammate(start_year int, end_year int)"; auto code = client_->execute(cmd, resp); if (cpp2::ErrorCode::SUCCEEDED != code) { return TestError() << "Do cmd:" << cmd << " failed"; } } sleep(FLAGS_load_data_interval_secs + 3); return TestOK(); } AssertionResult TraverseTestBase::prepareData() { // TODO(dutor) Maybe we should move these data into some kind of testing resources, later. players_["Tim Duncan"].serve("Spurs", 1997, 2016) .like("Tony Parker", 95) .like("Manu Ginobili", 95) .teammate("Tony Parker", 2001, 2016) .teammate("Manu Ginobili", 2002, 2016) .teammate("LaMarcus Aldridge", 2015, 2016) .teammate("Danny Green", 2010, 2016); players_["Tony Parker"].serve("Spurs", 1999, 2018) .serve("Hornets", 2018, 2019) .like("Tim Duncan", 95) .like("Manu Ginobili", 95) .like("LaMarcus Aldridge", 90) .teammate("Tim Duncan", 2001, 2016) .teammate("Manu Ginobili", 2002, 2018) .teammate("LaMarcus Aldridge", 2015, 2018) .teammate("Kyle Anderson", 2014, 2016); players_["Manu Ginobili"].serve("Spurs", 2002, 2018) .like("Tim Duncan", 90) .teammate("Tim Duncan", 2002, 2016) .teammate("Tony Parker", 2002, 2016); players_["LaMarcus Aldridge"].serve("Trail Blazers", 2006, 2015) .serve("Spurs", 2015, 2019) .like("Tony Parker", 75) .like("Tim Duncan", 75); players_["Rudy Gay"].serve("Grizzlies", 2006, 2013) .serve("Raptors", 2013, 2013) .serve("Kings", 2013, 2017) .serve("Spurs", 2017, 2019) .like("LaMarcus Aldridge", 70); players_["Marco Belinelli"].serve("Warriors", 2007, 2009) .serve("Raptors", 2009, 2010) .serve("Hornets", 2010, 2012) .serve("Bulls", 2012, 2013) .serve("Spurs", 2013, 2015) .serve("Kings", 2015, 2016) .serve("Hornets", 2016, 2017) .serve("Hawks", 2017, 2018) .serve("76ers", 2018, 2018) .serve("Spurs", 2018, 2019) .like("Tony Parker", 50) .like("Tim Duncan", 55) .like("Danny Green", 60); players_["Danny Green"].serve("Cavaliers", 2009, 2010) .serve("Spurs", 2010, 2018) .serve("Raptors", 2018, 2019) .like("Marco Belinelli", 83) .like("Tim Duncan", 70) .like("LeBron James", 80); players_["Kyle Anderson"].serve("Spurs", 2014, 2018) .serve("Grizzlies", 2018, 2019); players_["Aron Baynes"].serve("Spurs", 2013, 2015) .serve("Pistons", 2015, 2017) .serve("Celtics", 2017, 2019) .like("Tim Duncan", 80); players_["Boris Diaw"].serve("Hawks", 2003, 2005) .serve("Suns", 2005, 2008) .serve("Hornets", 2008, 2012) .serve("Spurs", 2012, 2016) .serve("Jazz", 2016, 2017) .like("Tony Parker", 80) .like("Tim Duncan", 80); players_["Tiago Splitter"].serve("Spurs", 2010, 2015) .serve("Hawks", 2015, 2017) .serve("76ers", 2017, 2017) .like("Tim Duncan", 80) .like("Manu Ginobili", 90); players_["Cory Joseph"].serve("Spurs", 2011, 2015) .serve("Raptors", 2015, 2017) .serve("Pacers", 2017, 2019); players_["David West"].serve("Hornets", 2003, 2011) .serve("Pacers", 2011, 2015) .serve("Spurs", 2015, 2016) .serve("Warriors", 2016, 2018); players_["Jonathon Simmons"].serve("Spurs", 2015, 2017) .serve("Magic", 2017, 2019) .serve("76ers", 2019, 2019); players_["Dejounte Murray"].serve("Spurs", 2016, 2019) .like("Tim Duncan", 99) .like("Tony Parker", 99) .like("Manu Ginobili", 99) .like("Marco Belinelli", 99) .like("Danny Green", 99) .like("LeBron James", 99) .like("Russell Westbrook", 99) .like("Chris Paul", 99) .like("Kyle Anderson", 99) .like("Kevin Durant", 99) .like("James Harden", 99) .like("Tony Parker", 99); players_["Tracy McGrady"].serve("Raptors", 1997, 2000) .serve("Magic", 2000, 2004) .serve("Rockets", 2004, 2010) .serve("Spurs", 2013, 2013) .like("Kobe Bryant", 90) .like("Grant Hill", 90) .like("Rudy Gay", 90); players_["Kobe Bryant"].serve("Lakers", 1996, 2016); players_["LeBron James"].serve("Cavaliers", 2003, 2010) .serve("Heat", 2010, 2014) .serve("Cavaliers", 2014, 2018) .serve("Lakers", 2018, 2019) .like("Ray Allen", 100); players_["Stephen Curry"].serve("Warriors", 2009, 2019); players_["Russell Westbrook"].serve("Thunders", 2008, 2019) .like("Paul George", 90) .like("James Harden", 90); players_["Kevin Durant"].serve("Thunders", 2007, 2016) .serve("Warriors", 2016, 2019); players_["James Harden"].serve("Thunders", 2009, 2012) .serve("Rockets", 2012, 2019) .like("Russell Westbrook", 80); players_["Chris Paul"].serve("Hornets", 2005, 2011) .serve("Clippers", 2011, 2017) .serve("Rockets", 2017, 2021) .like("LeBron James", 90) .like("Carmelo Anthony", 90) .like("Dwyane Wade", 90); players_["DeAndre Jordan"].serve("Clippers", 2008, 2018) .serve("Mavericks", 2018, 2019) .serve("Knicks", 2019, 2019); players_["Ricky Rubio"].serve("Timberwolves", 2011, 2017) .serve("Jazz", 2017, 2019); players_["Rajon Rondo"].serve("Celtics", 2006, 2014) .serve("Mavericks", 2014, 2015) .serve("Kings", 2015, 2016) .serve("Bulls", 2016, 2017) .serve("Pelicans", 2017, 2018) .serve("Lakers", 2018, 2019) .like("Ray Allen", -1); players_["Kyrie Irving"].serve("Cavaliers", 2011, 2017) .serve("Celtics", 2017, 2019) .like("LeBron James", 13); players_["Vince Carter"].serve("Raptors", 1998, 2004) .serve("Nets", 2004, 2009) .serve("Magic", 2009, 2010) .serve("Suns", 2010, 2011) .serve("Mavericks", 2011, 2014) .serve("Grizzlies", 2014, 2017) .serve("Kings", 2017, 2018) .serve("Hawks", 2018, 2019) .like("Tracy McGrady", 90) .like("Jason Kidd", 70); players_["Carmelo Anthony"].serve("Nuggets", 2003, 2011) .serve("Knicks", 2011, 2017) .serve("Thunders", 2017, 2018) .serve("Rockets", 2018, 2019) .like("LeBron James", 90) .like("Chris Paul", 90) .like("Dwyane Wade", 90); players_["Dwyane Wade"].serve("Heat", 2003, 2016) .serve("Bulls", 2016, 2017) .serve("Cavaliers", 2017, 2018) .serve("Heat", 2018, 2019) .like("LeBron James", 90) .like("Chris Paul", 90) .like("Carmelo Anthony", 90); players_["Joel Embiid"].serve("76ers", 2014, 2019) .like("Ben Simmons", 80); players_["Paul George"].serve("Pacers", 2010, 2017) .serve("Thunders", 2017, 2019) .like("Russell Westbrook", 95); players_["Giannis Antetokounmpo"].serve("Bucks", 2013, 2019); players_["Yao Ming"].serve("Rockets", 2002, 2011) .like("Tracy McGrady", 90) .like("Shaquile O'Neal", 90); players_["Blake Griffin"].serve("Clippers", 2009, 2018) .serve("Pistons", 2018, 2019) .like("Chris Paul", -1); players_["Damian Lillard"].serve("Trail Blazers", 2012, 2019) .like("LaMarcus Aldridge", 80); players_["Steve Nash"].serve("Suns", 1996, 1998) .serve("Mavericks", 1998, 2004) .serve("Suns", 2004, 2012) .serve("Lakers", 2012, 2015) .like("Amar'e Stoudemire", 90) .like("Dirk Nowitzki", 88) .like("Stephen Curry", 90) .like("Jason Kidd", 85); players_["Dirk Nowitzki"].serve("Mavericks", 1998, 2019) .like("Steve Nash", 80) .like("Jason Kidd", 80) .like("Dwyane Wade", 10); players_["Paul Gasol"].serve("Grizzlies", 2001, 2008) .serve("Lakers", 2008, 2014) .serve("Bulls", 2014, 2016) .serve("Spurs", 2016, 2019) .serve("Bucks", 2019, 2020) .like("Kobe Bryant", 90) .like("Marc Gasol", 99); players_["Marc Gasol"].serve("Grizzlies", 2008, 2019) .serve("Raptors", 2019, 2019) .like("Paul Gasol", 99); players_["Grant Hill"].serve("Pistons", 1994, 2000) .serve("Magic", 2000, 2007) .serve("Suns", 2007, 2012) .serve("Clippers", 2012, 2013) .like("Tracy McGrady", 90); players_["Ray Allen"].serve("Bucks", 1996, 2003) .serve("Thunders", 2003, 2007) .serve("Celtics", 2007, 2012) .serve("Heat", 2012, 2014) .like("Rajon Rondo", 9); players_["Klay Thompson"].serve("Warriors", 2011, 2019) .like("Stephen Curry", 90); players_["Kristaps Porzingis"].serve("Knicks", 2015, 2019) .serve("Mavericks", 2019, 2020) .like("Luka Doncic", 90); players_["Shaquile O'Neal"].serve("Magic", 1992, 1996) .serve("Lakers", 1996, 2004) .serve("Heat", 2004, 2008) .serve("Suns", 2008, 2009) .serve("Cavaliers", 2009, 2010) .serve("Celtics", 2010, 2011) .like("JaVale McGee", 100) .like("Tim Duncan", 80); players_["JaVale McGee"].serve("Wizards", 2008, 2012) .serve("Nuggets", 2012, 2015) .serve("Mavericks", 2015, 2016) .serve("Warriors", 2016, 2018) .serve("Lakers", 2018, 2019); players_["Dwight Howard"].serve("Magic", 2004, 2012) .serve("Lakers", 2012, 2013) .serve("Rockets", 2013, 2016) .serve("Hawks", 2016, 2017) .serve("Hornets", 2017, 2018) .serve("Wizards", 2018, 2019); players_["Amar'e Stoudemire"].serve("Suns", 2002, 2010) .serve("Knicks", 2010, 2015) .serve("Heat", 2015, 2016) .like("Steve Nash", 90); players_["Jason Kidd"].serve("Mavericks", 1994, 1996) .serve("Suns", 1996, 2001) .serve("Nets", 2001, 2008) .serve("Mavericks", 2008, 2012) .serve("Knicks", 2012, 2013) .like("Vince Carter", 80) .like("Steve Nash", 90) .like("Dirk Nowitzki", 85); players_["Ben Simmons"].serve("76ers", 2016, 2019) .like("Joel Embiid", 80); players_["Luka Doncic"].serve("Mavericks", 2018, 2019) .like("Dirk Nowitzki", 90) .like("Kristaps Porzingis", 90) .like("James Harden", 80); { cpp2::ExecutionResponse resp; std::string query = "USE nba"; auto code = client_->execute(query, resp); if (code != cpp2::ErrorCode::SUCCEEDED) { return TestError() << "USE nba failed" << static_cast<int32_t>(code); } } { // Insert vertices `player' cpp2::ExecutionResponse resp; std::string query; query.reserve(1024); query += "INSERT VERTEX player(name, age) VALUES "; for (auto &player : players_) { query += std::to_string(player.vid()); query += ": "; query += "("; query += "\""; query += player.name(); query += "\""; query += ","; query += std::to_string(player.age()); query += "),\n\t"; } query.resize(query.size() - 3); auto code = client_->execute(query, resp); if (code != cpp2::ErrorCode::SUCCEEDED) { return TestError() << "Insert `players' failed: " << static_cast<int32_t>(code); } } { // Insert vertices `player' with uuid cpp2::ExecutionResponse resp; std::string query; query.reserve(1024); query += "INSERT VERTEX player(name, age) VALUES "; for (auto &player : players_) { query += "uuid(\""; query += player.name(); query += "\"): "; query += "("; query += "\""; query += player.name(); query += "\""; query += ","; query += std::to_string(player.age()); query += "),\n\t"; } query.resize(query.size() - 3); auto code = client_->execute(query, resp); if (code != cpp2::ErrorCode::SUCCEEDED) { return TestError() << "Insert `players' failed: " << static_cast<int32_t>(code); } } { // Insert vertices `team' cpp2::ExecutionResponse resp; std::string query; query.reserve(1024); query += "INSERT VERTEX team(name) VALUES "; for (auto &team : teams_) { query += std::to_string(team.vid()); query += ": "; query += "("; query += "\""; query += team.name(); query += "\""; query += "),\n\t"; } query.resize(query.size() - 3); auto code = client_->execute(query, resp); if (code != cpp2::ErrorCode::SUCCEEDED) { return TestError() << "Insert `teams' failed: " << static_cast<int32_t>(code); } } { // Insert vertices `team' with uuid cpp2::ExecutionResponse resp; std::string query; query.reserve(1024); query += "INSERT VERTEX team(name) VALUES "; for (auto &team : teams_) { query += "uuid(\""; query += team.name(); query += "\"): "; query += "("; query += "\""; query += team.name(); query += "\""; query += "),\n\t"; } query.resize(query.size() - 3); auto code = client_->execute(query, resp); if (code != cpp2::ErrorCode::SUCCEEDED) { return TestError() << "Insert `teams' failed: " << static_cast<int32_t>(code); } } { // Insert edges `serve' cpp2::ExecutionResponse resp; std::string query; query.reserve(1024); query += "INSERT EDGE serve(start_year, end_year) VALUES "; for (auto &player : players_) { for (auto &serve : player.serves()) { auto &team = std::get<0>(serve); auto startYear = std::get<1>(serve); auto endYear = std::get<2>(serve); query += std::to_string(player.vid()); query += " -> "; query += std::to_string(teams_[team].vid()); query += ": "; query += "("; query += std::to_string(startYear); query += ", "; query += std::to_string(endYear); query += "),\n\t"; } } query.resize(query.size() - 3); auto code = client_->execute(query, resp); if (code != cpp2::ErrorCode::SUCCEEDED) { return TestError() << "Insert `serve' failed: " << static_cast<int32_t>(code); } } { // Insert edges `serve' with uuid cpp2::ExecutionResponse resp; std::string query; query.reserve(1024); query += "INSERT EDGE serve(start_year, end_year) VALUES "; for (auto &player : players_) { for (auto &serve : player.serves()) { auto &team = std::get<0>(serve); auto startYear = std::get<1>(serve); auto endYear = std::get<2>(serve); query += "uuid(\""; query += player.name(); query += "\") -> uuid(\""; query += teams_[team].name(); query += "\"): "; query += "("; query += std::to_string(startYear); query += ", "; query += std::to_string(endYear); query += "),\n\t"; } } query.resize(query.size() - 3); auto code = client_->execute(query, resp); if (code != cpp2::ErrorCode::SUCCEEDED) { return TestError() << "Insert `serve' failed: " << static_cast<int32_t>(code); } } { // Insert edges `like' cpp2::ExecutionResponse resp; std::string query; query.reserve(1024); query += "INSERT EDGE like(likeness) VALUES "; for (auto &player : players_) { for (auto &like : player.likes()) { auto &other = std::get<0>(like); auto likeness = std::get<1>(like); query += std::to_string(player.vid()); query += " -> "; query += std::to_string(players_[other].vid()); query += ": "; query += "("; query += std::to_string(likeness); query += "),\n\t"; } } query.resize(query.size() - 3); auto code = client_->execute(query, resp); if (code != cpp2::ErrorCode::SUCCEEDED) { return TestError() << "Insert `like' failed: " << static_cast<int32_t>(code); } } { // Insert edges `like' with uuid cpp2::ExecutionResponse resp; std::string query; query.reserve(1024); query += "INSERT EDGE like(likeness) VALUES "; for (auto &player : players_) { for (auto &like : player.likes()) { auto &other = std::get<0>(like); auto likeness = std::get<1>(like); query += "uuid(\""; query += player.name(); query += "\") -> uuid(\""; query += players_[other].name(); query += "\"): "; query += "("; query += std::to_string(likeness); query += "),\n\t"; } } query.resize(query.size() - 3); auto code = client_->execute(query, resp); if (code != cpp2::ErrorCode::SUCCEEDED) { return TestError() << "Insert `like' failed: " << static_cast<int32_t>(code); } } { // Insert edges `teammate' cpp2::ExecutionResponse resp; std::string query; query.reserve(1024); query += "INSERT EDGE teammate(start_year, end_year) VALUES "; for (auto &player : players_) { for (auto &tm : player.teammates()) { auto &other = std::get<0>(tm); auto startYear = std::get<1>(tm); auto endYear = std::get<2>(tm); query += std::to_string(player.vid()) + " -> "; query += std::to_string(players_[other].vid()) + ": ("; query += std::to_string(startYear) + ", "; query += std::to_string(endYear) + "),\n\t"; } } query.resize(query.size() - 3); auto code = client_->execute(query, resp); if (code != cpp2::ErrorCode::SUCCEEDED) { return TestError() << "Insert `teammate' failed: " << static_cast<int32_t>(code); } } { // Insert edges `teammate' with uuid cpp2::ExecutionResponse resp; std::string query; query.reserve(1024); query += "INSERT EDGE teammate(start_year, end_year) VALUES "; for (auto &player : players_) { for (auto &tm : player.teammates()) { auto &other = std::get<0>(tm); auto startYear = std::get<1>(tm); auto endYear = std::get<2>(tm); query += "uuid(\""; query += player.name(); query += "\") -> uuid(\""; query += players_[other].name(); query += "\"): ("; query += std::to_string(startYear) + ", "; query += std::to_string(endYear); query += "),\n\t"; } } query.resize(query.size() - 3); auto code = client_->execute(query, resp); if (code != cpp2::ErrorCode::SUCCEEDED) { return TestError() << "Insert `teammate' failed: " << static_cast<int32_t>(code); } } return TestOK(); } AssertionResult TraverseTestBase::removeData() { { cpp2::ExecutionResponse resp; std::string cmd = "DROP SPACE nba"; auto code = client_->execute(cmd, resp); if (cpp2::ErrorCode::SUCCEEDED != code) { return TestError() << "Do cmd:" << cmd << " failed"; } } return TestOK(); } } // namespace graph } // namespace nebula #endif // GRAPH_TEST_TRAVERSETESTBASE_H
36.993151
94
0.456714
26ce6f96521d4dc3be274ad44c531195fdf06871
334
h
C
AMDaliy/AMDaliy/AMModules/AMHTTPServer/AMHTTPConnection.h
Limingming2/test
4a753f386d8e82f875fce92909be90f09d57e9fe
[ "MIT" ]
null
null
null
AMDaliy/AMDaliy/AMModules/AMHTTPServer/AMHTTPConnection.h
Limingming2/test
4a753f386d8e82f875fce92909be90f09d57e9fe
[ "MIT" ]
null
null
null
AMDaliy/AMDaliy/AMModules/AMHTTPServer/AMHTTPConnection.h
Limingming2/test
4a753f386d8e82f875fce92909be90f09d57e9fe
[ "MIT" ]
null
null
null
// // AMHTTPConnection.h // AMDaliy // // Created by limingming on 2018/11/22. // Copyright © 2018年 limingming. All rights reserved. // #import "HTTPConnection.h" @class WebSocket; NS_ASSUME_NONNULL_BEGIN @interface AMHTTPConnection : HTTPConnection @property (nonatomic, strong) WebSocket *ws; @end NS_ASSUME_NONNULL_END
15.181818
54
0.745509
fcfe2d2ccf4abe72c63dbb9e23fece383043d835
205
h
C
HeartMate/Controllers/Record/RecordVC.h
appdev-support/HeartMate
75354eb697a066f3fe187411b23cb8fc51d687e1
[ "MIT" ]
4
2019-06-14T01:01:21.000Z
2021-07-29T07:18:25.000Z
HeartMate/Controllers/Record/RecordVC.h
appdev-support/HeartMate
75354eb697a066f3fe187411b23cb8fc51d687e1
[ "MIT" ]
null
null
null
HeartMate/Controllers/Record/RecordVC.h
appdev-support/HeartMate
75354eb697a066f3fe187411b23cb8fc51d687e1
[ "MIT" ]
1
2019-06-14T01:22:23.000Z
2019-06-14T01:22:23.000Z
// // RecordVC.h // HeartMate // // Created by xaoxuu on 04/03/2018. // Copyright © 2018 xaoxuu. All rights reserved. // #import "BaseViewController.h" @interface RecordVC : BaseViewController @end
14.642857
49
0.692683
142c129b1c750a9e186e28a5867e2dc18747e5ee
2,209
h
C
libraries/data/include/mcrl2/data/detail/rewrite/nfs_array.h
wiegerw/mcrl3
15260c92ab35930398d6dfb34d31351b05101ca9
[ "BSL-1.0" ]
1
2021-02-22T09:16:39.000Z
2021-02-22T09:16:39.000Z
libraries/data/include/mcrl2/data/detail/rewrite/nfs_array.h
wiegerw/mcrl3
15260c92ab35930398d6dfb34d31351b05101ca9
[ "BSL-1.0" ]
null
null
null
libraries/data/include/mcrl2/data/detail/rewrite/nfs_array.h
wiegerw/mcrl3
15260c92ab35930398d6dfb34d31351b05101ca9
[ "BSL-1.0" ]
null
null
null
// Author(s): Sjoerd Cranen, Jan Friso Groote // Copyright: see the accompanying file COPYING or copy at // https://svn.win.tue.nl/trac/MCRL2/browser/trunk/COPYING // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // /// \file mcrl2/data/detail/rewrite/nfs_array.h /// \brief This is an array in which it is recorded which arguments /// are normal forms and which are not. #ifndef MCRL2_DATA_NFS_ARRAY_H #define MCRL2_DATA_NFS_ARRAY_H #include <cstddef> #include <cstring> #include <cassert> #include <vector> namespace mcrl2 { namespace data { namespace detail { class nfs_array : public std::vector<bool> { public: nfs_array(std::size_t size) : std::vector<bool>(size, false) { } void fill(bool val = true) { assign(size(), val); } /// /// \brief next iterates to the next combination of booleans (in terms of bit vectors: /// if the nfs_array represents integer i, it computes i + 1). /// \return true if the operation was successful, false if an overflow occurred (i.e., /// if the bit vector was is_filled(), in which case after calling next(), it is /// is_clear(). /// bool next() { std::size_t index = 0; while (index < size()) { if (at(index)) { at(index) = false; ++index; } else { at(index) = true; return true; } } return false; } operator std::size_t() const { assert(8 * sizeof(std::size_t) > size()); std::size_t result = 0; std::size_t mask = 1; for (std::size_t i = 0; i < size(); ++i, mask <<= 1) { if (at(i)) { result |= mask; } } return result; } bool is_clear() const { for(std::vector<bool>::const_iterator i=begin(); i!=end(); ++i) { if (*i) { return false; } } return true; } bool is_filled() const { for(std::vector<bool>::const_iterator i=begin(); i!=end(); ++i) { if (!*i) { return false; } } return true; } }; } } } #endif // MCRL2_DATA_NFS_ARRAY_H
19.723214
89
0.581258
cadf10a175558da1b764c2d9adbcf27ba50e4f0d
14,499
c
C
kernel/drivers/devkit/lcdkit/lcdkit3.0/kernel/mtk/src/backlight/sgm37603a.c
wonderful666/marx-10.1.0
a8be8880fe31bff4f94d6e3fad17c455666ff60f
[ "MIT" ]
null
null
null
kernel/drivers/devkit/lcdkit/lcdkit3.0/kernel/mtk/src/backlight/sgm37603a.c
wonderful666/marx-10.1.0
a8be8880fe31bff4f94d6e3fad17c455666ff60f
[ "MIT" ]
null
null
null
kernel/drivers/devkit/lcdkit/lcdkit3.0/kernel/mtk/src/backlight/sgm37603a.c
wonderful666/marx-10.1.0
a8be8880fe31bff4f94d6e3fad17c455666ff60f
[ "MIT" ]
null
null
null
/* Copyright (c) 2019-2019, Huawei terminal Tech. Co., Ltd. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program 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. * */ #include "sgm37603a.h" #include "lcd_kit_common.h" #include "lcd_kit_utils.h" #include "lcm_drv.h" #include "lcd_kit_disp.h" static char *sgm37603a_dts_string[SGM37603A_RW_REG_MAX] = { "sgm37603a_reg_leds_config", "sgm37603a_reg_brightness_conctrol", "sgm37603a_reg_lsb", "sgm37603a_reg_msb" }; static unsigned int sgm37603a_reg_addr[SGM37603A_RW_REG_MAX] = { SGM37603A_REG_LEDS_CONFIG, SGM37603A_REG_BRIGHTNESS_CONTROL, SGM37603A_REG_RATIO_LSB, SGM37603A_REG_RATIO_MSB }; static struct sgm37603a_backlight_information sgm37603a_bl_info; struct class *sgm37603a_class = NULL; struct sgm37603a_chip_data *sgm37603a_g_chip = NULL; static bool sgm37603a_init_status = true; extern struct LCM_DRIVER lcdkit_mtk_common_panel; static int sgm37603a_parse_dts(struct device_node *np) { int ret; int i; struct mtk_panel_info *panel_info = NULL; if (np == NULL) { LCD_KIT_ERR("np is null pointer\n"); return SGM_FAIL; } for (i = 0; i < SGM37603A_RW_REG_MAX; i++) { ret = of_property_read_u32(np, sgm37603a_dts_string[i], &sgm37603a_bl_info.sgm37603a_reg[i]); if (ret < 0) { /* init to invalid data */ sgm37603a_bl_info.sgm37603a_reg[i] = SGM37603A_INVALID_VAL; LCD_KIT_INFO("can not find config:%s\n", sgm37603a_dts_string[i]); } } ret = of_property_read_u32(np, SGM37603A_HW_ENABLE, &sgm37603a_bl_info.sgm37603a_hw_en); if (ret < 0) { LCD_KIT_ERR("sgm37603a_hw_enable use default value\n"); sgm37603a_bl_info.sgm37603a_hw_en = 0; } ret = of_property_read_u32(np, SGM37603A_HW_EN_GPIO, &sgm37603a_bl_info.sgm37603a_hw_en_gpio); if (ret < 0) { LCD_KIT_ERR("get sgm37603a_hw_en_gpio dts config fail\n"); return ret; } /* gpio number offset */ panel_info = lcdkit_mtk_common_panel.panel_info; if (!panel_info) { LCD_KIT_ERR("panel_info is NULL\n"); return SGM_FAIL; } sgm37603a_bl_info.sgm37603a_hw_en_gpio += panel_info->gpio_offset; ret = of_property_read_u32(np, SGM37603A_HW_EN_DELAY, &sgm37603a_bl_info.bl_on_lk_mdelay); if (ret < 0) { LCD_KIT_ERR("get bl_on_kernel_mdelay dts config fail\n"); return ret; } ret = of_property_read_u32(np, SGM37603A_BL_LEVEL, &sgm37603a_bl_info.bl_level); if (ret < 0) { LCD_KIT_ERR("get bl_level dts config fail\n"); return ret; } return ret; } static int sgm37603a_config_write( struct sgm37603a_chip_data *pchip, unsigned int reg[], unsigned int val[], unsigned int size) { int ret = SGM_FAIL; unsigned int i; if ((pchip == NULL) || (reg == NULL) || (val == NULL)) { LCD_KIT_ERR("pchip or reg or val is null pointer\n"); return ret; } for (i = 0; i < size; i++) { /* judge reg is valid */ if (val[i] != SGM37603A_INVALID_VAL) { ret = regmap_write(pchip->regmap, reg[i], val[i]); LCD_KIT_INFO("sgm37603a write 0x%x = 0x%x", reg[i], val[i]); if (ret < 0) { LCD_KIT_ERR("write sgm37603a 0x%x fail\n", reg[i]); return ret; } } } return ret; } static int sgm37603a_config_read( struct sgm37603a_chip_data *pchip, unsigned int reg[], unsigned int val[], unsigned int size) { int ret = 0; unsigned int i; if ((pchip == NULL) || (reg == NULL) || (val == NULL)) { LCD_KIT_ERR("pchip or reg or val is null pointer\n"); return SGM_FAIL; } for (i = 0; i < size; i++) { ret = regmap_read(pchip->regmap, reg[i], &val[i]); if (ret < 0) { LCD_KIT_ERR("read sgm37603a 0x%x fail", reg[i]); return ret; } else { LCD_KIT_INFO("read 0x%x value 0x%x\n", reg[i], val[i]); } } return ret; } /* initialize chip */ static int sgm37603a_chip_init(struct sgm37603a_chip_data *pchip) { int ret = SGM_FAIL; LCD_KIT_INFO("%s in!\n", __func__); if (pchip == NULL) { LCD_KIT_ERR("pchip is null pointer\n"); return ret; } ret = sgm37603a_config_write(pchip, sgm37603a_reg_addr, sgm37603a_bl_info.sgm37603a_reg, SGM37603A_RW_REG_MAX); if (ret < 0) { LCD_KIT_ERR("sgm37603a config register fail"); return ret; } LCD_KIT_INFO("%s ok!\n", __func__); return ret; } static ssize_t sgm37603a_reg_show( struct device *dev, struct device_attribute *attr, char *buf) { struct sgm37603a_chip_data *pchip = NULL; struct i2c_client *client = NULL; unsigned int sgm37603a_reg_info[SGM37603A_RW_REG_MAX] = {0}; ssize_t ret = SGM_FAIL; if (!buf) { LCD_KIT_ERR("buf is null\n"); return ret; } if (!dev) { ret = snprintf(buf, PAGE_SIZE, "dev is null\n"); return ret; } pchip = dev_get_drvdata(dev); if (!pchip) { ret = snprintf(buf, PAGE_SIZE, "data is null\n"); return ret; } client = pchip->client; if (!client) { ret = snprintf(buf, PAGE_SIZE, "client is null\n"); return ret; } ret = sgm37603a_config_read(pchip, sgm37603a_reg_addr, sgm37603a_reg_info, SGM37603A_RW_REG_MAX); if (ret < 0) { LCD_KIT_ERR("sgm37603a config read fail"); ret = snprintf(buf, PAGE_SIZE, "%s: i2c access fail to register\n", __func__); return ret; } ret = snprintf(buf, PAGE_SIZE, "0x10 = 0x%x 0x11 = 0x%x\n \ \r0x1A = 0x%x 0x19 = 0x%x\n ", sgm37603a_reg_info[0], sgm37603a_reg_info[1], sgm37603a_reg_info[2], sgm37603a_reg_info[3]); return ret; } static ssize_t sgm37603a_reg_store( struct device *dev, struct device_attribute *dev_attr, const char *buf, size_t size) { ssize_t ret = SGM_FAIL; struct sgm37603a_chip_data *pchip = NULL; unsigned int reg = 0; unsigned int mask = 0; unsigned int val = 0; if (!buf) { LCD_KIT_ERR("buf is null\n"); return ret; } if (!dev) { LCD_KIT_ERR("dev is null\n"); return ret; } pchip = dev_get_drvdata(dev); if (!pchip) { LCD_KIT_ERR("pchip is null\n"); return ret; } ret = sscanf(buf, "reg=0x%x, mask=0x%x, val=0x%x", &reg, &mask, &val); if (ret < 0) { LCD_KIT_INFO("check your input!!!\n"); goto out_input; } LCD_KIT_INFO("%s: reg=0x%x,mask=0x%x,val=0x%x\n", __func__, reg, mask, val); ret = regmap_update_bits(pchip->regmap, reg, mask, val); if (ret < 0) goto i2c_error; return size; i2c_error: dev_err(pchip->dev, "%s:i2c access fail to register\n", __func__); ret = snprintf((char *)buf, PAGE_SIZE, "%s: i2c access reg fail\n", __func__); return ret; out_input: dev_err(pchip->dev, "%s:input conversion fail\n", __func__); ret = snprintf((char *)buf, PAGE_SIZE, "%s: input conversion fail\n", __func__); return ret; } static DEVICE_ATTR(reg, (S_IRUGO|S_IWUSR), sgm37603a_reg_show, sgm37603a_reg_store); /* pointers to created device attributes */ static struct attribute *sgm37603a_attributes[] = { &dev_attr_reg.attr, NULL, }; static const struct attribute_group sgm37603a_group = { .attrs = sgm37603a_attributes, }; /* set default reg value */ static const struct regmap_config sgm37603a_regmap = { .reg_bits = 8, .val_bits = 8, .reg_stride = 1, }; static void sgm37603a_check_fault(int last_level, int level) { unsigned int val = 0; int ret; int i; LCD_KIT_INFO("check REG_FAULT_FLAG!\n"); ret = regmap_read(sgm37603a_g_chip->regmap, SGM37603A_REG_FAULT_FLAG, &val); if (ret) { LCD_KIT_ERR("sgm37603a read REG_FAULT_FLAG fail !\n"); return; } for (i = 0; i < SGM37603A_FLAG_CHECK_NUM; i++) { if (!(err_table[i].flag & val)) continue; LCD_KIT_ERR("last_bkl:%d, cur_bkl:%d, FAULT_FLAG:0x%x!\n", last_level, level, val); #if defined(CONFIG_HUAWEI_DSM) ret = dsm_client_ocuppy(lcd_dclient); if (!ret) { dsm_client_record(lcd_dclient, "sgm37603a last_bkl:%d, cur_bkl:%d\n" "FAULT_FLAG:0x%x!\n", last_level, level, err_table[i].flag); dsm_client_notify(lcd_dclient, err_table[i].err_no); } else { dev_err(&sgm37603a_g_chip->client->dev, "dsm_client_ocuppy fail: ret=%d!\n", ret); } #endif } } static void sgm37603a_enable(void) { int ret; /* chip initialize */ ret = sgm37603a_chip_init(sgm37603a_g_chip); if (ret < 0) { LCD_KIT_ERR("sgm37603a_chip_init fail!\n"); return ; } sgm37603a_init_status = true; } static void sgm37603a_disable(void) { int ret; ret = regmap_write(sgm37603a_g_chip->regmap, SGM37603A_REG_LEDS_CONFIG, SGM37603A_REG_LEDS_CONFIG_DISABLE); if (ret < 0) LCD_KIT_ERR("write sgm37603a 0x%x fail\n", SGM37603A_REG_LEDS_CONFIG); sgm37603a_init_status = false; } int sgm37603a_set_backlight(unsigned int bl_level) { static int last_bl_level; int bl_msb; int bl_lsb; int ret; unsigned int bl_max_level = lcm_get_panel_backlight_max_level(); if (!sgm37603a_g_chip) { LCD_KIT_ERR("sgm37603a_g_chip is null\n"); return SGM_FAIL; } if (down_trylock(&(sgm37603a_g_chip->test_sem))) { LCD_KIT_INFO("Now in test mode\n"); return SGM_SUCC; } /* first set backlight, enable sgm37603a */ if ((sgm37603a_init_status == false) && (bl_level > 0)) { sgm37603a_enable(); sgm37603a_check_fault(last_bl_level, bl_level); } if (!bl_max_level) bl_max_level = SGM37603A_BL_DEFAULT_LEVEL; if (bl_level > bl_max_level) bl_level = bl_max_level; bl_level = bl_level * sgm37603a_bl_info.bl_level / bl_max_level; /* set backlight level */ bl_msb = (bl_level >> SGM37603A_MSB_LEN) & 0xFF; bl_lsb = bl_level & 0x0F; ret = regmap_write(sgm37603a_g_chip->regmap, SGM37603A_REG_RATIO_LSB, bl_lsb); if (ret < 0) LCD_KIT_ERR("write sgm37603a backlight level lsb:0x%x fail\n", bl_lsb); ret = regmap_write(sgm37603a_g_chip->regmap, SGM37603A_REG_RATIO_MSB, bl_msb); if (ret < 0) LCD_KIT_ERR("write sgm37603a backlight level msb:0x%x fail\n", bl_msb); LCD_KIT_INFO("write sgm37603a backlight %u success\n", bl_level); /* if set backlight level 0, disable sgm37603a */ if ((sgm37603a_init_status == true) && (bl_level == 0)) { sgm37603a_check_fault(last_bl_level, bl_level); sgm37603a_disable(); } up(&(sgm37603a_g_chip->test_sem)); last_bl_level = bl_level; return ret; } static struct lcd_kit_bl_ops bl_ops = { .set_backlight = sgm37603a_set_backlight, }; static int sgm37603a_probe( struct i2c_client *client, const struct i2c_device_id *id) { struct i2c_adapter *adapter = NULL; struct sgm37603a_chip_data *pchip = NULL; int ret = SGM_FAIL; struct device_node *np = NULL; #if defined(CONFIG_HUAWEI_DSM) unsigned int val = 0; #endif LCD_KIT_INFO("in %s!\n", __func__); if (!client) { LCD_KIT_ERR("client is null pointer\n"); return ret; } adapter = client->adapter; if (!adapter) { LCD_KIT_ERR("adapter is null pointer\n"); return ret; } np = client->dev.of_node; if (!np) { LCD_KIT_ERR("np is null pointer\n"); return ret; } if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) { LCD_KIT_ERR("i2c functionality check fail\n"); return -EOPNOTSUPP; } pchip = devm_kzalloc(&client->dev, sizeof(struct sgm37603a_chip_data), GFP_KERNEL); if (!pchip) { LCD_KIT_ERR("devm_kzalloc fail\n"); return -ENOMEM; } #ifdef CONFIG_REGMAP_I2C pchip->regmap = devm_regmap_init_i2c(client, &sgm37603a_regmap); if (IS_ERR(pchip->regmap)) { ret = PTR_ERR(pchip->regmap); LCD_KIT_ERR("allocate register map fail: %d\n", ret); goto err_out; } #endif sgm37603a_g_chip = pchip; pchip->client = client; i2c_set_clientdata(client, pchip); sema_init(&(pchip->test_sem), 1); pchip->dev = device_create(sgm37603a_class, NULL, 0, "%s", client->name); if (IS_ERR(pchip->dev)) { /* Not fatal */ LCD_KIT_ERR("Unable to create device; errno = %ld\n", PTR_ERR(pchip->dev)); pchip->dev = NULL; } else { dev_set_drvdata(pchip->dev, pchip); ret = sysfs_create_group(&pchip->dev->kobj, &sgm37603a_group); if (ret) goto err_sysfs; } ret = sgm37603a_parse_dts(np); if (ret < 0) { LCD_KIT_ERR("parse sgm37603a dts fail"); goto err_sysfs; } if (sgm37603a_bl_info.sgm37603a_hw_en) { ret = gpio_request(sgm37603a_bl_info.sgm37603a_hw_en_gpio, NULL); if (ret) { LCD_KIT_ERR("sgm37603a Could not request hw_en_gpio\n"); goto err_sysfs; } } lcd_kit_bl_register(&bl_ops); #if defined(CONFIG_HUAWEI_DSM) ret = regmap_read(sgm37603a_g_chip->regmap, SGM37603A_REG_FAULT_FLAG, &val); if (ret) { LCD_KIT_ERR("sgm37603a read REG_FAULT_FLAG fail !\n"); goto err_sysfs; } if (val != SGM37603A_DEVICE_FAULT_OCCUR) { ret = dsm_client_ocuppy(lcd_dclient); if (!ret) { dev_err(&sgm37603a_g_chip->client->dev, "fail : REG_FAULT_FLAG statues 0X1F=%u!\n", val); dsm_client_record(lcd_dclient, "REG_FAULT_FLAG statues error 0X1F=%u!\n", val); dsm_client_notify(lcd_dclient, DSM_LCD_OVP_ERROR_NO); } else { dev_err(&sgm37603a_g_chip->client->dev, "dsm_client_ocuppy fail: ret=%d!\n", ret); } } #endif return ret; err_sysfs: LCD_KIT_ERR("sysfs error!\n"); device_destroy(sgm37603a_class, 0); err_out: devm_kfree(&client->dev, pchip); return ret; } static int sgm37603a_remove(struct i2c_client *client) { if (!client) { LCD_KIT_ERR("client is null pointer\n"); return SGM_FAIL; } sysfs_remove_group(&client->dev.kobj, &sgm37603a_group); devm_kfree(&client->dev, sgm37603a_g_chip); return SGM_SUCC; } static const struct i2c_device_id sgm37603a_id[] = { { SGM37603A_NAME, 0 }, {}, }; static const struct of_device_id sgm37603a_of_id_table[] = { { .compatible = "sgm,sgm37603a" }, {}, }; MODULE_DEVICE_TABLE(i2c, sgm37603a_id); static struct i2c_driver sgm37603a_i2c_driver = { .driver = { .name = "sgm37603a", .owner = THIS_MODULE, .of_match_table = sgm37603a_of_id_table, }, .probe = sgm37603a_probe, .remove = sgm37603a_remove, .id_table = sgm37603a_id, }; static int __init sgm37603a_init(void) { int ret; LCD_KIT_INFO("%s init\n", __func__); sgm37603a_class = class_create(THIS_MODULE, "sgm37603a"); if (IS_ERR(sgm37603a_class)) { LCD_KIT_ERR("Unable to create sgm37603a class; errno = %ld\n", PTR_ERR(sgm37603a_class)); sgm37603a_class = NULL; } ret = i2c_add_driver(&sgm37603a_i2c_driver); if (ret) LCD_KIT_ERR("Unable to register sgm37603a driver\n"); LCD_KIT_INFO("%s ok\n", __func__); return ret; } static void __exit sgm37603a_exit(void) { i2c_del_driver(&sgm37603a_i2c_driver); } module_init(sgm37603a_init); module_exit(sgm37603a_exit); MODULE_AUTHOR("Huawei Technologies Co., Ltd"); MODULE_LICENSE("GPL");
23.807882
80
0.709014
532b0acb53fca86416579b92c2b1101252d874a8
370
h
C
ios/source/courses/skutarenko/iOSDevCourse-Objective-C/HW/iOSDev4501_ClientServerAPIsHW/iOSDev4501_ClientServerAPIsHW/Controllers/OLTVWallTableViewController.h
oltv00/knowledge
25d9507d529c494e0d6d9c1d7f643d3249624b65
[ "MIT" ]
null
null
null
ios/source/courses/skutarenko/iOSDevCourse-Objective-C/HW/iOSDev4501_ClientServerAPIsHW/iOSDev4501_ClientServerAPIsHW/Controllers/OLTVWallTableViewController.h
oltv00/knowledge
25d9507d529c494e0d6d9c1d7f643d3249624b65
[ "MIT" ]
null
null
null
ios/source/courses/skutarenko/iOSDevCourse-Objective-C/HW/iOSDev4501_ClientServerAPIsHW/iOSDev4501_ClientServerAPIsHW/Controllers/OLTVWallTableViewController.h
oltv00/knowledge
25d9507d529c494e0d6d9c1d7f643d3249624b65
[ "MIT" ]
null
null
null
// // OLTVWallTableViewController.h // iOSDev4501_ClientServerAPIsHW // // Created by Oleg Tverdokhleb on 08/06/16. // Copyright © 2016 oltv00. All rights reserved. // #import <UIKit/UIKit.h> @interface OLTVWallTableViewController : UIViewController @property (weak, nonatomic) IBOutlet UITableView *tableView; @property (strong, nonatomic) NSString *userID; @end
24.666667
60
0.764865
9d1782c7b03db4bb645b89af4110967a063eb131
1,177
h
C
AliPayForDebug/AliPayForDebug/AlipayWallet_Headers/H5ErrorViewController.h
ceekay1991/AliPayForDebug
5795e5db31e5b649d4758469b752585e63e84d94
[ "MIT" ]
5
2020-03-29T12:08:37.000Z
2021-05-26T05:20:11.000Z
AliPayForDebug/AliPayForDebug/AlipayWallet_Headers/H5ErrorViewController.h
ceekay1991/AliPayForDebug
5795e5db31e5b649d4758469b752585e63e84d94
[ "MIT" ]
null
null
null
AliPayForDebug/AliPayForDebug/AlipayWallet_Headers/H5ErrorViewController.h
ceekay1991/AliPayForDebug
5795e5db31e5b649d4758469b752585e63e84d94
[ "MIT" ]
5
2020-04-17T03:24:04.000Z
2022-03-30T05:42:17.000Z
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 17 2017 16:24:48). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import "DTViewController.h" @class NSString, NSURL, UILabel, UIScrollView; @interface H5ErrorViewController : DTViewController { NSURL *_url; NSString *_errorCode; NSString *_spdyStatus; NSString *_reason; UIScrollView *_scrollView; UILabel *_ipLabel; } @property(retain) UILabel *ipLabel; // @synthesize ipLabel=_ipLabel; @property(retain, nonatomic) UIScrollView *scrollView; // @synthesize scrollView=_scrollView; @property(retain, nonatomic) NSString *reason; // @synthesize reason=_reason; @property(retain, nonatomic) NSString *spdyStatus; // @synthesize spdyStatus=_spdyStatus; @property(retain, nonatomic) NSString *errorCode; // @synthesize errorCode=_errorCode; @property(retain, nonatomic) NSURL *url; // @synthesize url=_url; - (void).cxx_destruct; - (id)addContent:(id)arg1 fontSize:(id)arg2 relative:(id)arg3; - (id)addTitle:(id)arg1 relative:(id)arg2; - (void)renderScrollView:(id)arg1; - (void)getDNSIP; - (void)render; - (void)viewDidLoad; @end
31.810811
93
0.731521
4f6f643611e6d341cf1bacf79cf65dd715bc4e66
2,325
c
C
code/bluey-common/bluey_gpio.c
Pathak94/ElectronutLabs-bluey
1a2d594980601a398fe25d9ae2c93544ab219349
[ "CC-BY-4.0" ]
89
2017-02-24T14:35:00.000Z
2022-03-23T11:56:52.000Z
code/bluey-common/bluey_gpio.c
Pathak94/ElectronutLabs-bluey
1a2d594980601a398fe25d9ae2c93544ab219349
[ "CC-BY-4.0" ]
8
2017-05-10T04:47:07.000Z
2020-12-23T10:45:49.000Z
code/bluey-common/bluey_gpio.c
Pathak94/ElectronutLabs-bluey
1a2d594980601a398fe25d9ae2c93544ab219349
[ "CC-BY-4.0" ]
59
2017-04-22T11:36:53.000Z
2022-03-24T19:39:15.000Z
/** * RGB LED * * nRF52 gpio configuration for LED test.. * * Electronut Labs * electronut.in * */ #include "bluey_gpio.h" #include "nrf_delay.h" /** * @brief function to configure RGB LED */ void rgb_led_config(void) { nrf_gpio_pin_dir_set(led_R, NRF_GPIO_PIN_DIR_OUTPUT); nrf_gpio_pin_dir_set(led_G, NRF_GPIO_PIN_DIR_OUTPUT); nrf_gpio_pin_dir_set(led_B, NRF_GPIO_PIN_DIR_OUTPUT); rgb_led_off(); } /** * @brief function to turn all LEDs off */ void rgb_led_off(void) { nrf_gpio_pin_set(led_R); nrf_gpio_pin_set(led_G); nrf_gpio_pin_set(led_B); } /** * @brief function to turn all LEDs on */ void rgb_led_set_white(void) { nrf_gpio_pin_clear(led_R); nrf_gpio_pin_clear(led_G); nrf_gpio_pin_clear(led_B); } /** * @brief function to turn LED on - RED */ void rgb_led_set_red(void) { nrf_gpio_pin_clear(led_R); nrf_gpio_pin_set(led_G); nrf_gpio_pin_set(led_B); } /** * @brief function to turn LED on - GREEN */ void rgb_led_set_green(void) { nrf_gpio_pin_set(led_R); nrf_gpio_pin_clear(led_G); nrf_gpio_pin_set(led_B); } /** * @brief function to turn LED on - BLUE */ void rgb_led_set_blue(void) { nrf_gpio_pin_set(led_R); nrf_gpio_pin_set(led_G); nrf_gpio_pin_clear(led_B); } /** * @brief function to turn LED on - YELLOW */ void rgb_led_set_yellow(void) { nrf_gpio_pin_clear(led_R); nrf_gpio_pin_clear(led_G); nrf_gpio_pin_set(led_B); } /** * @brief function to turn LED on - CYAN */ void rgb_led_set_cyan(void) { nrf_gpio_pin_set(led_R); nrf_gpio_pin_clear(led_G); nrf_gpio_pin_clear(led_B); } /** * @brief function to turn LED on - MAGENTA */ void rgb_led_set_magenta(void) { nrf_gpio_pin_clear(led_R); nrf_gpio_pin_set(led_G); nrf_gpio_pin_clear(led_B); } /** * @brief function to test on-board gpio pins */ void cycle_gpio(void) { uint8_t gpio[] = {26, 2, 27, 3, 28, 4, 29, 22, 30, 23, 31, 24, 25}; // gpio pins uint8_t i; static bool gpio_config = false; // configure gpio pins as output if(gpio_config == false) { for(i = 0; i < 13; i++) { nrf_gpio_pin_dir_set(gpio[i], NRF_GPIO_PIN_DIR_OUTPUT); } gpio_config = true; } // toggle gpio pins for(i = 0; i < 13; i++) { nrf_gpio_pin_set(gpio[i]); nrf_delay_ms(200); nrf_gpio_pin_clear(gpio[i]); nrf_delay_ms(200); } }
17.748092
88
0.686882
ae60f9bcafa72065bb1c4c736e7a9564e5c10bfe
3,735
h
C
XtractCom/XtractCom/XtractC/include/State.h
ADozois/GPA789_Lab2
c8504f3df5a0fc16eb27a9f21857b71551596ba5
[ "MIT" ]
null
null
null
XtractCom/XtractCom/XtractC/include/State.h
ADozois/GPA789_Lab2
c8504f3df5a0fc16eb27a9f21857b71551596ba5
[ "MIT" ]
null
null
null
XtractCom/XtractCom/XtractC/include/State.h
ADozois/GPA789_Lab2
c8504f3df5a0fc16eb27a9f21857b71551596ba5
[ "MIT" ]
null
null
null
//! \file State.h //! //! \brief Définition de la classe State. //! \details Ce fichier fait partie du laboratoire 1 donné dans le cadre du cours //! GPA789 : Analyse et conception orientées objet. //! //! \version 1.0 //! //! \author Tony Wong, Ph.D.\n //! Département de génie de production automatisée\n //! École de technologie supérieure\n //! tony.wong@etsmtl.ca //! \author JC Demers //! //! \date 2016 //! \copyright Copyleft #ifndef STATE_H #define STATE_H #include <string> #include <list> using namespace std; #include "Symbol.h" class Transition; class FiniteStateMachine; //! \brief Classe représentant les états d'un automate fini. //! \details Cette classe fait partie du module FSM (Finite State Machine). //! //! Elle permet de créer une interface commune pour tous //! états de l'AF. Cette interface réside principalement dans : //! - gestion des transitions //! //! Chaque état possède un nom en plus de son état acceptant. Cet //! état acceptant permet de valider si le déroulement du //! traitement valide la chaîne de symboles donnée. //! //! La fonction addTransition permet d'ajouter autant de //! transition que nécessaire. C'est la fonction isTransiting qui //! valide si l'état courant passe vers un nouvel état. //! //! Tous les états sont propriétaires des transitions qui leurs //! sont ajoutées. Ainsi, c'est lors de la suppression des états que les //! transitions sont libérées. Il est important de ne pas libérer la //! mémoire des objets `Transition` ailleurs dans le programme. Il est d'un //! mauvais usage d'accéder aux transitions après qu'elles aient été //! assignées (ajoutées) à un état. Chaque transition doit être créée //! dynamiquement et assignée à un seul état. L'assignation à deux états //! produira une erreure de désallocation de mémoire. //! //! \author Tony Wong, Ph.D. //! \author JC Demers //! \version 1.0 //! \date 2016 //! \copyright Copyleft class State { friend FiniteStateMachine; public: //! Construit un état. //! \param[in] name Le nom d'affichage de l'état. Le nom est obligatoire. //! \param[in] accepting Détermine si l'état est un état acceptant. State(string const & name, bool accepting = false); //! Détruit l'état et libère toutes les transitions qu'il possède. virtual ~State(); //! Ajoute une transition à l'état. La transition passée devient la //! propriété de cet état. L'ordre des insertions est important //! car il détermine l'ordre de résolution. //! \param[in] transition La transition, allouée dynamiquement, qui doit //! être lié à l'état. void addTransition(Transition * transition); //! Retourne le nombre de transition que possède un état. size_t transitionCount() const { return mTransitions.size(); } //! Retourne le nom de l'état. string const & name() const { return mName; } //! Retourne le nom de l'état. string name() { return mName; } //! Retourne si l'état est un état acceptant ou non. bool isAccepting() const { return mAccepting; } //! Retourne la liste de transitions. list<Transition*> const & transitions() const { return mTransitions; } //! Fonction évaluant si l'état courant passe de cet état vers un //! prochain état. Cette fonction retourne nullptr lorsqu'aucune //! transition n'est effective. Si la transition est effective, //! un pointeur vers cette transition est retourné. La première //! transition valide rencontrée dans la liste des transitions est //! celle retournée. Transition * isTransiting(symbol_t curSymbol) const; protected: //! La liste de transition que possède l'état. list<Transition*> mTransitions; private: string mName; bool mAccepting; static void deleteTransition(Transition * & transition); }; #endif // STATE_H
33.954545
82
0.721553
3e5a7bf04f004cd458b277ddf0dc59433f056d75
2,083
h
C
System/Library/PrivateFrameworks/HealthDaemon.framework/_HDStaticSyncStore.h
zhangkn/iOS14Header
4323e9459ed6f6f5504ecbea2710bfd6c3d7c946
[ "MIT" ]
1
2020-11-04T15:43:01.000Z
2020-11-04T15:43:01.000Z
System/Library/PrivateFrameworks/HealthDaemon.framework/_HDStaticSyncStore.h
zhangkn/iOS14Header
4323e9459ed6f6f5504ecbea2710bfd6c3d7c946
[ "MIT" ]
null
null
null
System/Library/PrivateFrameworks/HealthDaemon.framework/_HDStaticSyncStore.h
zhangkn/iOS14Header
4323e9459ed6f6f5504ecbea2710bfd6c3d7c946
[ "MIT" ]
null
null
null
/* * This header is generated by classdump-dyld 1.0 * on Sunday, September 27, 2020 at 11:44:45 AM Mountain Standard Time * Operating System: Version 14.0 (Build 18A373) * Image Source: /System/Library/PrivateFrameworks/HealthDaemon.framework/HealthDaemon * classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos. */ #import <libobjc.A.dylib/HDSyncStore.h> @class HDProfile, NSUUID, NSString; @interface _HDStaticSyncStore : NSObject <HDSyncStore> { long long _syncProvenance; HDProfile* _profile; NSUUID* _storeIdentifier; } @property (nonatomic,copy,readonly) NSUUID * storeIdentifier; //@synthesize storeIdentifier=_storeIdentifier - In the implementation block @property (nonatomic,__weak,readonly) HDProfile * profile; //@synthesize profile=_profile - In the implementation block @property (readonly) int protocolVersion; @property (readonly) long long syncStoreType; @property (readonly) unsigned long long hash; @property (readonly) Class superclass; @property (copy,readonly) NSString * description; @property (copy,readonly) NSString * debugDescription; -(int)protocolVersion; -(id)syncStoreIdentifier; -(HDProfile *)profile; -(NSUUID *)storeIdentifier; -(NSString *)description; -(id)orderedSyncEntities; -(id)databaseIdentifier; -(BOOL)replacePersistedAnchorMap:(id)arg1 error:(id*)arg2 ; -(long long)syncProvenance; -(BOOL)supportsSpeculativeChangesForSyncEntityClass:(Class)arg1 ; -(id)initWithProfile:(id)arg1 storeIdentifier:(id)arg2 error:(id*)arg3 ; -(BOOL)resetReceivedSyncAnchorMapWithError:(id*)arg1 ; -(long long)syncEpoch; -(id)syncStoreDefaultSourceBundleIdentifier; -(id)syncEntityDependenciesForSyncEntity:(Class)arg1 ; -(BOOL)canRecieveSyncObjectsForEntityClass:(Class)arg1 ; -(BOOL)enforceSyncEntityOrdering; -(BOOL)shouldContinueAfterAnchorValidationError:(id)arg1 ; -(BOOL)shouldEnforceSequenceOrdering; -(long long)expectedSequenceNumberForSyncEntityClass:(Class)arg1 ; -(void)setExpectedSequenceNumber:(long long)arg1 forSyncEntityClass:(Class)arg2 ; -(long long)syncStoreType; @end
39.301887
151
0.785886
1647d63822d67d06fc00e47f32286b13b9269647
30,316
c
C
firehose/sahara_protocol.c
VoiceGateway/qflash
e28aeda8e1d190b7f85474d2201770d614a412b2
[ "MIT" ]
4
2020-11-06T08:08:25.000Z
2021-11-29T02:23:18.000Z
firehose/sahara_protocol.c
VoiceGateway/qflash
e28aeda8e1d190b7f85474d2201770d614a412b2
[ "MIT" ]
null
null
null
firehose/sahara_protocol.c
VoiceGateway/qflash
e28aeda8e1d190b7f85474d2201770d614a412b2
[ "MIT" ]
1
2020-11-12T02:23:43.000Z
2020-11-12T02:23:43.000Z
#include <string.h> #include <stdio.h> #include <errno.h> #include <time.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <stdlib.h> #include <stdint.h> #include <termios.h> #include <dirent.h> #include <sys/time.h> #include <sys/ioctl.h> #include <sys/select.h> #include <unistd.h> #include <getopt.h> #include <ctype.h> #include <malloc.h> #include <stdbool.h> #include <inttypes.h> unsigned int inet_addr(const char *cp); #define MIN(a,b) ((a) < (b)? (a) : (b)) #include "sahara_protocol.h" extern void dbg_time (const char *fmt, ...); static sahara_data_t sahara_data = { NULL, // rx_buffer NULL, // tx_buffer NULL, // misc_buffer SAHARA_WAIT_HELLO, // state 0, // timed_data_size -1, // fd -1, // ram_dump_image 5, // max_ram_dump_retries SAHARA_RAW_BUFFER_SIZE, // max_ram_dump_read SAHARA_MODE_LAST, // mode SAHARA_MODE_LAST, // prev_mode 0, // command false // ram_dump_64bit }; typedef struct { char *port_name; int port_fd; int rx_timeout; } com_port_t; static com_port_t com_port = { "/dev/ttyUSB0", // port_name -1, // port_fd 5, // rx_timeout }; static const char *sahara_firehose_dir = NULL; typedef struct { char *path_to_save_files; int verbose; int do_reset; } kickstart_options_t; static kickstart_options_t kickstart_options = { NULL, // path_to_save_files 1, // verbose 1, }; #define dbg( log_level, fmt, arg... ) do {if (kickstart_options.verbose) dbg_time(fmt "\n", ## arg);} while (0) int qusb_open(char *port_name); int qusb_close(int fd); ssize_t qusb_read(int fd, void* pbuf, size_t size); ssize_t qusb_write(int fd, const void*pbuf, size_t size, int need_zlp); static void port_disconnect (void) { dbg (LOG_INFO, "Disconnecting from com port"); if (com_port.port_fd != -1) { qusb_close (com_port.port_fd); } } static bool port_connect (char *port_name) { com_port.port_fd = qusb_open(port_name); return (com_port.port_fd > 0); return true; } static bool port_tx_data (void *buffer, size_t bytes_to_send) { int temp_bytes_sent; size_t bytes_sent = 0; while (bytes_sent < bytes_to_send) { temp_bytes_sent = qusb_write (com_port.port_fd, buffer + bytes_sent, bytes_to_send - bytes_sent, 1); if (temp_bytes_sent <= 0) { dbg(LOG_ERROR, "Write returned failure %d, errno %d, System error code: %s", temp_bytes_sent, errno, strerror (errno)); return false; } else { bytes_sent += temp_bytes_sent; } } return true; } static bool port_rx_data(void *buffer, size_t bytes_to_read, size_t *bytes_read) { fd_set rfds; struct timeval tv; int retval; // Init read file descriptor FD_ZERO (&rfds); FD_SET (com_port.port_fd, &rfds); // time out initializtion. tv.tv_sec = com_port.rx_timeout >= 0 ? com_port.rx_timeout : 0; tv.tv_usec = 0; retval = select (com_port.port_fd + 1, &rfds, NULL, NULL, ((com_port.rx_timeout >= 0) ? (&tv) : (NULL))); if (retval <= 0) { dbg(LOG_ERROR, "select returned error: %s", strerror (errno)); return false; } retval = qusb_read (com_port.port_fd, buffer, bytes_to_read); if (retval <= 0) { dbg(LOG_ERROR, "Read/Write File descriptor returned error: %s, error code %d", strerror (errno), retval); return false; } if (NULL != bytes_read) *bytes_read = retval; return true; } static bool sahara_tx_data (size_t bytes_to_send) { return port_tx_data(sahara_data.tx_buffer, bytes_to_send); } static bool sahara_rx_data(size_t bytes_to_read) { sahara_packet_header* command_packet_header = NULL; size_t temp_bytes_read = 0, bytes_read = 0; const char *boot_sahara_cmd_id_str[SAHARA_LAST_CMD_ID] = { "SAHARA_NO_CMD_ID", // = 0x00, " SAHARA_HELLO_ID", // = 0x01, // sent from target to host "SAHARA_HELLO_RESP_ID", // = 0x02, // sent from host to target "SAHARA_READ_DATA_ID", // = 0x03, // sent from target to host "SAHARA_END_IMAGE_TX_ID", // = 0x04, // sent from target to host "SAHARA_DONE_ID", // = 0x05, // sent from host to target "SAHARA_DONE_RESP_ID", // = 0x06, // sent from target to host "SAHARA_RESET_ID", // = 0x07, // sent from host to target "SAHARA_RESET_RESP_ID", // = 0x08, // sent from target to host "SAHARA_MEMORY_DEBUG_ID", // = 0x09, // sent from target to host "SAHARA_MEMORY_READ_ID", // = 0x0A, // sent from host to target "SAHARA_CMD_READY_ID", // = 0x0B, // sent from target to host "SAHARA_CMD_SWITCH_MODE_ID", // = 0x0C, // sent from host to target "SAHARA_CMD_EXEC_ID", // = 0x0D, // sent from host to target "SAHARA_CMD_EXEC_RESP_ID", // = 0x0E, // sent from target to host "SAHARA_CMD_EXEC_DATA_ID", // = 0x0F, // sent from host to target "SAHARA_64_BITS_MEMORY_DEBUG_ID", // = 0x10, // sent from target to host "SAHARA_64_BITS_MEMORY_READ_ID", // = 0x11, // sent from host to target "SAHARA_64_BITS_READ_DATA_ID", // = 0x12, }; if (0 == bytes_to_read) { if (false == port_rx_data(sahara_data.rx_buffer, sahara_data.max_ram_dump_read, &temp_bytes_read)) return false; command_packet_header = (sahara_packet_header *) sahara_data.rx_buffer; dbg(LOG_INFO, "Read %zd bytes, Header indicates command %d and packet length %d bytes", temp_bytes_read,command_packet_header->command,command_packet_header->length); if (temp_bytes_read != command_packet_header->length) return false; if (command_packet_header->command < SAHARA_LAST_CMD_ID) { dbg(LOG_EVENT, "RECEIVED <-- %s", boot_sahara_cmd_id_str[command_packet_header->command]); } else { dbg(LOG_EVENT, "RECEIVED <-- SAHARA_CMD_UNKONOW_%d", command_packet_header->command); return false; } } else { while (bytes_read < bytes_to_read) { if (false == port_rx_data(sahara_data.rx_buffer + bytes_read, bytes_to_read - bytes_read, &temp_bytes_read)) { dbg(LOG_ERROR, "bytes_read = %zd, bytes_to_read = %zd", bytes_read, bytes_to_read); return false; } else bytes_read += temp_bytes_read; } } return true; } static int timeval_subtract (struct timeval *result, struct timeval *x, struct timeval *y) { // Perform the carry for the later subtraction by updating y. if (x->tv_usec < y->tv_usec) { int nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1; y->tv_usec -= 1000000 * nsec; y->tv_sec += nsec; } if (x->tv_usec - y->tv_usec > 1000000) { int nsec = (x->tv_usec - y->tv_usec) / 1000000; y->tv_usec += 1000000 * nsec; y->tv_sec -= nsec; } // Compute the time remaining to wait. tv_usec is certainly positive. */ result->tv_sec = x->tv_sec - y->tv_sec; result->tv_usec = x->tv_usec - y->tv_usec; // Return 1 if result is negative. return x->tv_sec < y->tv_sec; } static void time_throughput_calculate(struct timeval *start_time, struct timeval *end_time, size_t size_bytes) { struct timeval result; double TP = 0.0; if (size_bytes == 0) { dbg(LOG_INFO, "Cannot calculate throughput, size is 0"); return; } timeval_subtract(&result, end_time, start_time); TP = (double)result.tv_usec/1000000.0; TP += (double)result.tv_sec; if(TP>0.0) { TP = (double)((double)size_bytes/TP)/(1024.0*1024.0); dbg(LOG_STATUS, "%zd bytes transferred in %ld.%06ld seconds (%.4fMBps)", size_bytes, result.tv_sec, result.tv_usec,TP); } else dbg(LOG_STATUS, "%zd bytes transferred in %ld.%06ld seconds", size_bytes, result.tv_sec, result.tv_usec); } static bool send_reset_command (void) { sahara_packet_reset *sahara_reset = (sahara_packet_reset *)sahara_data.tx_buffer; sahara_reset->header.command = SAHARA_RESET_ID; sahara_reset->header.length = sizeof(sahara_packet_reset); /* Send the Reset Request */ dbg(LOG_EVENT, "SENDING --> SAHARA_RESET"); if (false == sahara_tx_data (sizeof(sahara_packet_reset))) { dbg(LOG_ERROR, "Sending RESET packet failed"); return false; } return true; } static bool send_done_packet (void) { sahara_packet_done *sahara_done = (sahara_packet_done *)sahara_data.tx_buffer; sahara_done->header.command = SAHARA_DONE_ID; sahara_done->header.length = sizeof(sahara_packet_done); // Send the image data dbg(LOG_EVENT, "SENDING --> SAHARA_DONE"); if (false == sahara_tx_data (sizeof(sahara_packet_done))) { dbg(LOG_ERROR, "Sending DONE packet failed"); return false; } return true; } static bool send_memory_read_packet (uint64_t memory_table_address, uint64_t memory_table_length) { sahara_packet_memory_read *sahara_memory_read = (sahara_packet_memory_read *)sahara_data.tx_buffer; sahara_packet_memory_read_64bit *sahara_memory_read_64bit = (sahara_packet_memory_read_64bit *)sahara_data.tx_buffer; dbg(LOG_EVENT, "SENDING --> SAHARA_MEMORY_READ, address 0x%08"PRIX64", length 0x%08"PRIX64, memory_table_address, memory_table_length); if (true == sahara_data.ram_dump_64bit) { sahara_memory_read_64bit->header.command = SAHARA_64_BITS_MEMORY_READ_ID; sahara_memory_read_64bit->header.length = sizeof(sahara_packet_memory_read_64bit); sahara_memory_read_64bit->memory_addr = memory_table_address; sahara_memory_read_64bit->memory_length = memory_table_length; /* Send the Memory Read packet */ if (false == sahara_tx_data (sizeof(sahara_packet_memory_read_64bit))) { dbg(LOG_ERROR, "Sending MEMORY_READ packet failed"); return false; } } else { sahara_memory_read->header.command = SAHARA_MEMORY_READ_ID; sahara_memory_read->header.length = sizeof(sahara_packet_memory_read); sahara_memory_read->memory_addr = (uint32_t)memory_table_address; sahara_memory_read->memory_length = (uint32_t)memory_table_length; /* Send the Memory Read packet */ if (false == sahara_tx_data (sizeof(sahara_packet_memory_read))) { dbg(LOG_ERROR, "Sending MEMORY_READ packet failed"); return false; } } return true; } static bool is_valid_memory_table(uint64_t memory_table_size) { if (true == sahara_data.ram_dump_64bit && memory_table_size % sizeof(dload_debug_type_64bit) == 0) { return true; } else if (false == sahara_data.ram_dump_64bit && memory_table_size % sizeof(dload_debug_type) == 0) { return true; } else { return false; } } static int retrieve_prog_nand_firehose_filename(const char* path, char** xmlfile) { DIR *pdir; struct dirent* ent = NULL; pdir = opendir(path); if(pdir) { while((ent = readdir(pdir)) != NULL) { if(!strncmp(ent->d_name, "prog_nand_firehose", 4)) { *xmlfile = strdup(ent->d_name); closedir(pdir); return 0; } } }else { return 1; } return 1; } static bool start_image_transfer(const sahara_packet_read_data *sahara_read_data) { int retval = 0; uint32_t bytes_read = 0, bytes_to_read_next; uint64_t DataOffset = 0; uint64_t DataLength = 0; char* prog_nand_firehose_filename = NULL; if(retrieve_prog_nand_firehose_filename(sahara_firehose_dir, &prog_nand_firehose_filename) != 0) { dbg(LOG_ERROR, "retrieve prog nand firehose failed."); return false; } dbg(LOG_INFO, "prog_nand_firehose_filename = %s\n", prog_nand_firehose_filename); dbg(LOG_INFO, "0x%08x 0x%08x 0x%08x", sahara_read_data->image_id, sahara_read_data->data_offset, sahara_read_data->data_length); if (sahara_data.fd <= 0) { char full_path[255]; snprintf(full_path, sizeof(full_path), "%s/%s", sahara_firehose_dir, prog_nand_firehose_filename); sahara_data.fd = open(full_path, O_RDONLY); if (sahara_data.fd < 0) { dbg(LOG_INFO, "%s %d %s errno: %d (%s)", __func__, __LINE__, full_path, errno, strerror(errno)); return false; } } DataOffset = (uint64_t)sahara_read_data->data_offset; DataLength = (uint64_t)sahara_read_data->data_length; if (lseek(sahara_data.fd, (long)DataOffset, SEEK_SET) != DataOffset) { dbg(LOG_INFO, "%d errno: %d (%s)", __LINE__, errno, strerror(errno)); return false; } while (bytes_read < (uint32_t)DataLength) { bytes_to_read_next = MIN((uint32_t)DataLength - bytes_read, SAHARA_RAW_BUFFER_SIZE); retval = read(sahara_data.fd, sahara_data.tx_buffer, bytes_to_read_next); if (retval < 0) { dbg(LOG_ERROR, "file read failed: %s", strerror(errno)); return false; } if ((uint32_t) retval != bytes_to_read_next) { dbg(LOG_ERROR, "Read %d bytes, but was asked for 0x%08"PRIX64" bytes", retval, DataLength); return false; } /*send the image data*/ if (false == sahara_tx_data (bytes_to_read_next)) { dbg(LOG_ERROR, "Tx Sahara Image Failed"); return false; } bytes_read += bytes_to_read_next; } sahara_data.timed_data_size += (uint32_t)DataLength; return true; } static bool sahara_start(void) { int retval = 0; int num_debug_entries = -1; int i = 0; uint64_t memory_table_addr = 0; uint64_t memory_table_length = 0; uint32_t image_id = 0; struct timeval time_start, time_end; unsigned char tx[] = {0x4b, 0x65, 0x01, 0x00, 0x54, 0x0f, 0x7e}; unsigned char rx[] = {0x4b, 0x65, 0x01, 0x00, 0x54, 0x0f, 0x7e}; //enter emegenery mode sahara_packet_header* sahara_cmd = (sahara_packet_header *)sahara_data.rx_buffer; sahara_packet_hello *sahara_hello = (sahara_packet_hello *)sahara_data.rx_buffer; sahara_packet_hello_resp *sahara_hello_resp = (sahara_packet_hello_resp *)sahara_data.tx_buffer; sahara_packet_read_data *sahara_read_data = (sahara_packet_read_data *)sahara_data.rx_buffer; sahara_packet_memory_debug *sahara_memory_debug = (sahara_packet_memory_debug *)sahara_data.rx_buffer; sahara_packet_memory_debug_64bit *sahara_memory_debug_64bit = (sahara_packet_memory_debug_64bit *)sahara_data.rx_buffer; dload_debug_type *sahara_memory_table_rx = (dload_debug_type *)sahara_data.rx_buffer; dload_debug_type_64bit *sahara_memory_table = (dload_debug_type_64bit *)sahara_data.misc_buffer; sahara_packet_reset_resp *sahara_reset_resp = (sahara_packet_reset_resp *)sahara_data.rx_buffer; sahara_data.state = SAHARA_WAIT_HELLO; kickstart_options.verbose = 1; while (1) { switch (sahara_data.state) { case SAHARA_WAIT_HELLO: dbg(LOG_EVENT, "STATE <-- SAHARA_WAIT_HELLO"); if (false == sahara_rx_data(0)) // size 0 means we don't know what to expect. So we'll just try to read the 8 byte header { sahara_tx_data(1); if (false == sahara_rx_data(0)) return false; } //Check if the received command is a hello command if (SAHARA_HELLO_ID != sahara_hello->header.command) { dbg(LOG_ERROR, "Received a different command: %x while waiting for hello packet", sahara_hello->header.command); if (false == send_reset_command ()) { return false; } // set the state to SAHARA_WAIT_RESET_RESP dbg(LOG_EVENT, "STATE <-- SAHARA_WAIT_RESET_RESP\n"); sahara_data.state = SAHARA_WAIT_RESET_RESP; } else { // Recieved hello, send the hello response // Create a Hello request sahara_hello_resp->header.command = SAHARA_HELLO_RESP_ID; sahara_hello_resp->header.length = sizeof(sahara_packet_hello_resp); sahara_hello_resp->version = sahara_hello->version; //SAHARA_VERSION; sahara_hello_resp->version_supported = sahara_hello->version_supported; //SAHARA_VERSION_SUPPORTED; sahara_hello_resp->status = SAHARA_STATUS_SUCCESS; sahara_hello_resp->mode = sahara_hello->mode; sahara_hello_resp->reserved0 = 1; sahara_hello_resp->reserved1 = 2; sahara_hello_resp->reserved2 = 3; sahara_hello_resp->reserved3 = 4; sahara_hello_resp->reserved4 = 5; sahara_hello_resp->reserved5 = 6; switch (sahara_hello->mode) { case SAHARA_MODE_IMAGE_TX_PENDING: dbg(LOG_EVENT, "RECEIVED <-- SAHARA_MODE_IMAGE_TX_PENDING"); break; case SAHARA_MODE_IMAGE_TX_COMPLETE: dbg(LOG_EVENT, "RECEIVED <-- SAHARA_MODE_IMAGE_TX_COMPLETE"); break; case SAHARA_MODE_MEMORY_DEBUG: dbg(LOG_EVENT, "RECEIVED <-- SAHARA_MODE_MEMORY_DEBUG"); break; case SAHARA_MODE_COMMAND: dbg(LOG_EVENT, "RECEIVED <-- SAHARA_MODE_COMMAND"); break; default: dbg(LOG_EVENT, "RECEIVED <-- SAHARA_MODE_0x%x", sahara_hello->mode); break; } /*Send the Hello Resonse Request*/ dbg(LOG_EVENT, "SENDING --> SAHARA_HELLO_RESPONSE"); if (false == sahara_tx_data (sizeof(sahara_packet_hello_resp))) { dbg(LOG_ERROR, "Tx Sahara Data Failed "); return false; } sahara_data.state = SAHARA_WAIT_COMMAND; } break; case SAHARA_WAIT_COMMAND: dbg(LOG_INFO, "STATE <-- SAHARA_WAIT_COMMAND"); if (false == sahara_rx_data(0)) return false; // Check if it is an end of image Tx if (SAHARA_MEMORY_DEBUG_ID == sahara_cmd->command || SAHARA_64_BITS_MEMORY_DEBUG_ID == sahara_cmd->command) { dbg(LOG_EVENT, "RECEIVED <-- SAHARA_MEMORY_DEBUG"); if (SAHARA_64_BITS_MEMORY_DEBUG_ID == ((sahara_packet_header *)sahara_data.rx_buffer)->command) { sahara_data.ram_dump_64bit = true; dbg(LOG_EVENT, "Using 64 bit RAM dump mode"); memory_table_addr = sahara_memory_debug_64bit->memory_table_addr; memory_table_length = sahara_memory_debug_64bit->memory_table_length; } else { sahara_data.ram_dump_64bit = false; memory_table_addr = sahara_memory_debug->memory_table_addr; memory_table_length = sahara_memory_debug->memory_table_length; } dbg(LOG_INFO, "Memory Table Address: 0x%08"PRIX64", Memory Table Length: 0x%08"PRIX64, memory_table_addr, memory_table_length); if (false == is_valid_memory_table(memory_table_length)) { dbg(LOG_ERROR, "Invalid memory table received"); if (false == send_reset_command ()) { return false; } sahara_data.state = SAHARA_WAIT_RESET_RESP; break; } if (memory_table_length > 0) { if (false == send_memory_read_packet(memory_table_addr, memory_table_length)) { return false; } if (memory_table_length > SAHARA_RAW_BUFFER_SIZE) { dbg(LOG_ERROR, "Memory table length is greater than size of intermediate buffer"); return false; } } dbg(LOG_EVENT, "STATE <-- SAHARA_WAIT_MEMORY_TABLE"); sahara_data.state = SAHARA_WAIT_MEMORY_TABLE; } else if (SAHARA_READ_DATA_ID == sahara_cmd->command) { start_image_transfer(sahara_read_data); } // end of SAHARA_READ_DATA_ID else if (SAHARA_END_IMAGE_TX_ID == sahara_cmd->command) { sahara_packet_end_image_tx *sahara_end_image_tx = (sahara_packet_end_image_tx *)sahara_cmd; dbg(LOG_EVENT, "image_id = %d, status = %d", sahara_end_image_tx->image_id, sahara_end_image_tx->status); if (sahara_end_image_tx->status == SAHARA_STATUS_SUCCESS) { image_id = sahara_end_image_tx->image_id; send_done_packet (); sahara_data.state = SAHARA_WAIT_DONE_RESP; } else { return false; } } else { dbg(LOG_ERROR, "Received an unknown command: %d ", sahara_cmd->command); if (false == send_reset_command ()) { return false; } // set the state to SAHARA_WAIT_RESET_RESP dbg(LOG_EVENT, "STATE <-- SAHARA_WAIT_RESET_RESP"); sahara_data.state = SAHARA_WAIT_RESET_RESP; } break; case SAHARA_WAIT_MEMORY_TABLE: dbg(LOG_INFO, "STATE <-- SAHARA_WAIT_MEMORY_TABLE"); num_debug_entries = 0; if (memory_table_length > 0) { if (false == sahara_rx_data((size_t)memory_table_length)) { return false; } dbg(LOG_INFO, "Memory Debug table received"); if (true == sahara_data.ram_dump_64bit) { memcpy (sahara_data.misc_buffer, sahara_data.rx_buffer, (size_t)memory_table_length); num_debug_entries = (int)(memory_table_length/sizeof(dload_debug_type_64bit)); } else { num_debug_entries = (int)(memory_table_length/sizeof(dload_debug_type)); if (num_debug_entries * sizeof(dload_debug_type_64bit) > SAHARA_RAW_BUFFER_SIZE) { dbg(LOG_ERROR, "Length of memory table converted to 64-bit entries is greater than size of intermediate buffer"); return false; } for (i = 0; i < num_debug_entries; ++i) { sahara_memory_table[i].save_pref = (uint64_t) sahara_memory_table_rx[i].save_pref; sahara_memory_table[i].mem_base = (uint64_t) sahara_memory_table_rx[i].mem_base; sahara_memory_table[i].length = (uint64_t) sahara_memory_table_rx[i].length; strncpy(sahara_memory_table[i].filename, sahara_memory_table_rx[i].filename, DLOAD_DEBUG_STRLEN_BYTES); strncpy(sahara_memory_table[i].desc, sahara_memory_table_rx[i].desc, DLOAD_DEBUG_STRLEN_BYTES); } // end for (i = 0; i < num_debug_entries; ++i) } } for(i = 0; i < num_debug_entries; i++) { dbg(LOG_EVENT, "Base 0x%08"PRIX64" Len 0x%08"PRIX64", '%s', '%s'", sahara_memory_table[i].mem_base, sahara_memory_table[i].length, sahara_memory_table[i].filename, sahara_memory_table[i].desc); } sahara_data.state = SAHARA_WAIT_MEMORY_REGION; break; case SAHARA_WAIT_MEMORY_REGION: dbg(LOG_INFO, "STATE <-- SAHARA_WAIT_MEMORY_REGION"); for(i = 0; i < num_debug_entries; i++) { uint64_t cur = 0; int fd = -1; fd = open(sahara_memory_table[i].filename, O_CREAT | O_WRONLY | O_TRUNC, 0444); if (fd==-1) { dbg_time("ERROR: Your file '%s' does not exist or cannot be created\n\n",sahara_memory_table[num_debug_entries].filename); exit(0); } gettimeofday(&time_start, NULL); while (cur < sahara_memory_table[i].length) { uint64_t len = MIN(sahara_memory_table[i].length - cur, sahara_data.max_ram_dump_read); if (len < sahara_data.max_ram_dump_read || cur == 0 || (cur%(32*1024*1024)) == 0) kickstart_options.verbose = 1; else kickstart_options.verbose = 0; retval = send_memory_read_packet(sahara_memory_table[i].mem_base + cur, len); if (false == retval) { return false; } retval = sahara_rx_data((size_t)len); if (false == retval) { if ( sahara_data.max_ram_dump_read > (16*1024)) { sahara_data.max_ram_dump_read = sahara_data.max_ram_dump_read / 2; continue; } return false; } cur += len; retval = write(fd, sahara_data.rx_buffer, (unsigned int)len); if (retval < 0) { dbg(LOG_ERROR, "file write failed: %s", strerror(errno)); return false; } if ((uint32_t) retval != len) { dbg(LOG_WARN, "Wrote only %d of 0x%08"PRIX64" bytes", retval, memory_table_length); } } kickstart_options.verbose = 1; dbg(LOG_STATUS, "Received file '%s'", sahara_memory_table[i].filename); close(fd); gettimeofday(&time_end, NULL); time_throughput_calculate(&time_start, &time_end, sahara_memory_table[i].length); } if ( kickstart_options.do_reset) { if (false == send_reset_command ()) { return false; } sahara_data.state = SAHARA_WAIT_RESET_RESP; } else { return true; } break; case SAHARA_WAIT_DONE_RESP: { sahara_packet_done_resp *sahara_done_resp = (sahara_packet_done_resp *)sahara_data.rx_buffer; dbg(LOG_EVENT, "STATE <-- SAHARA_WAIT_DONE_RESP"); if (false == sahara_rx_data(0)) return false; dbg(LOG_INFO, "image_tx_status = %d", sahara_done_resp->image_tx_status); if (SAHARA_MODE_IMAGE_TX_PENDING == sahara_done_resp->image_tx_status) { if (image_id == 13) //prog_nand_firehose_9x07.mbn return true; sahara_data.state = SAHARA_WAIT_HELLO; } else if (SAHARA_MODE_IMAGE_TX_COMPLETE == sahara_done_resp->image_tx_status) { dbg(LOG_EVENT,"\n\nSuccessfully uploaded all images\n"); //delete_file_from_list(id_mapped_file); // taken care of in destroy_input_file_list() return true; } else { dbg(LOG_ERROR, "Received unrecognized status %d at SAHARA_WAIT_DONE_RESP state", sahara_done_resp->image_tx_status); return false; } } break; case SAHARA_WAIT_RESET_RESP: dbg(LOG_EVENT, "STATE <-- SAHARA_WAIT_RESET_RESP"); if (true == sahara_rx_data(0)) { if (SAHARA_RESET_RESP_ID != sahara_reset_resp->header.command) { dbg(LOG_INFO,"Waiting for reset response code %i, received %i instead.", SAHARA_RESET_RESP_ID, sahara_reset_resp->header.command); continue; } } else{ dbg(LOG_ERROR, "read failed: Linux system error: %s", strerror(errno)); return false; } return true; break; default: dbg(LOG_ERROR, "Unrecognized state %d", sahara_data.state); return false; } /* end switch */ } /* end while (1) */ } int sahara_main(const char *firehose_dir) { bool retval = false; sahara_firehose_dir = firehose_dir; sahara_data.mode = SAHARA_MODE_MEMORY_DEBUG; com_port.port_name = "/dev/ttyUSB0"; sahara_data.rx_buffer = malloc (SAHARA_RAW_BUFFER_SIZE); sahara_data.tx_buffer = malloc (SAHARA_RAW_BUFFER_SIZE); sahara_data.misc_buffer = malloc (2048); if (NULL == sahara_data.rx_buffer || NULL == sahara_data.tx_buffer || NULL == sahara_data.misc_buffer) { dbg(LOG_ERROR, "Failed to allocate sahara buffers"); return false; } if (port_connect(com_port.port_name)) { retval = sahara_start(); port_disconnect(); if (false == retval) { dbg(LOG_ERROR, "Sahara protocol error"); } else { dbg(LOG_STATUS, "Sahara protocol completed"); } } free(sahara_data.rx_buffer); free(sahara_data.tx_buffer); free(sahara_data.misc_buffer); sahara_data.rx_buffer = sahara_data.tx_buffer = sahara_data.misc_buffer = NULL; if (retval) return 0; return __LINE__; }
39.889474
210
0.588006
87ed46ff0a899c8ac72effaea89d3ddf07ebd357
2,844
c
C
evb9064x/c-code/src/MLX90641_I2C_Driver_evb9064x.c
melexis-fir/mlx90641-driver-evb9064x-py
06245aadb8d549c794913d8d394f7dd0353dcb19
[ "Apache-2.0" ]
null
null
null
evb9064x/c-code/src/MLX90641_I2C_Driver_evb9064x.c
melexis-fir/mlx90641-driver-evb9064x-py
06245aadb8d549c794913d8d394f7dd0353dcb19
[ "Apache-2.0" ]
null
null
null
evb9064x/c-code/src/MLX90641_I2C_Driver_evb9064x.c
melexis-fir/mlx90641-driver-evb9064x-py
06245aadb8d549c794913d8d394f7dd0353dcb19
[ "Apache-2.0" ]
null
null
null
#define _DEFAULT_SOURCE #include <stdio.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #include "evb9064x.h" #include "MLX90641_I2C_Driver_evb9064x.h" static struct Evb9064x_t *g_handle; struct MLX90641DriverRegister_t * MLX90641_get_register_evb9064x(void) { static struct MLX90641DriverRegister_t reg; strcpy(reg.name_, "mlx://evb:9064x/"); reg.MLX90641_get_i2c_handle_ = MLX90641_get_i2c_handle_evb9064x; reg.MLX90641_set_i2c_handle_ = MLX90641_set_i2c_handle_evb9064x; reg.MLX90641_I2CInit_ = MLX90641_I2CInit_evb9064x; reg.MLX90641_I2CClose_ = MLX90641_I2CClose_evb9064x; reg.MLX90641_I2CRead_ = MLX90641_I2CRead_evb9064x; reg.MLX90641_I2CFreqSet_ = MLX90641_I2CFreqSet_evb9064x; reg.MLX90641_I2CGeneralReset_ = MLX90641_I2CGeneralReset_evb9064x; reg.MLX90641_I2CWrite_ = MLX90641_I2CWrite_evb9064x; return &reg; } void * MLX90641_get_i2c_handle_evb9064x(void) { return (void *)g_handle; } void MLX90641_set_i2c_handle_evb9064x(void *handle) { g_handle = (struct Evb9064x_t *)handle; } void MLX90641_I2CInit_evb9064x(const char *port) { const char *start = "mlx://evb:9064x/"; if (strncmp(port, start, strlen(start)) != 0) { printf("ERROR: '%s' is not a valid port\n", port); return; } const char *port_id = &port[strlen(start)]; if (strstr(port_id, "dev/tty") == port_id) { port_id--; // move the pointer one up, to include the '/' character. } printf ("using comport: '%s'\n", port_id); g_handle = evb9064x_open(port_id); if (g_handle == NULL) { return; } // char buffer[256]; // evb9064x_get_hardware_id(g_handle, buffer, sizeof(buffer)); // printf ("evb9064x_get_hardware_id: '%s'\n", (char *)buffer); evb9064x_set_vdd(g_handle, 3.3); usleep(100000); evb9064x_i2c_init(g_handle); evb9064x_begin_conversion(g_handle, 0x33); } void MLX90641_I2CClose_evb9064x(void) { evb9064x_close(g_handle); g_handle = NULL; } int MLX90641_I2CRead_evb9064x(uint8_t slaveAddr, uint16_t startAddr, uint16_t nMemAddressRead, uint16_t *data) { return evb9064x_i2c_read(g_handle, slaveAddr, startAddr, data, nMemAddressRead); } void MLX90641_I2CFreqSet_evb9064x(int freq) { if (freq){} } int MLX90641_I2CGeneralReset_evb9064x(void) { return evb9064x_i2c_sent_general_reset(g_handle); } int MLX90641_I2CWrite_evb9064x(uint8_t slaveAddr, uint16_t writeAddress, uint16_t data) { int delay_ms = 0; int16_t mem_section = writeAddress & 0xFF00; if ((mem_section == 0x2400) || (mem_section == 0x2500) || (mem_section == 0x2600) || (mem_section == 0x2700)) { delay_ms = 10; // 10ms for EEPROM write! } int r = evb9064x_i2c_write(g_handle, slaveAddr, writeAddress, &data, 1); if (delay_ms > 0) { usleep(delay_ms * 1000); } return r; }
22.571429
110
0.717651
3f08b351acaf3b4618c300d1a195370bd3517abc
1,047
h
C
model/net/quic/core/crypto/crypto_message_parser.h
jianwel/quic-ns3-module
f9d7b7f339803170d75f119d5dcf6d0d96c0b022
[ "MIT" ]
5
2018-07-12T06:46:46.000Z
2021-11-01T00:53:42.000Z
model/net/quic/core/crypto/crypto_message_parser.h
sarsanaee/quic-ns3-module
ee505c16ce6d6cdeeccf9d3c2820d49659f4d578
[ "MIT" ]
null
null
null
model/net/quic/core/crypto/crypto_message_parser.h
sarsanaee/quic-ns3-module
ee505c16ce6d6cdeeccf9d3c2820d49659f4d578
[ "MIT" ]
2
2018-02-27T17:33:38.000Z
2019-01-17T12:59:06.000Z
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef NET_QUIC_CORE_CRYPTO_CRYPTO_MESSAGE_PARSER_H_ #define NET_QUIC_CORE_CRYPTO_CRYPTO_MESSAGE_PARSER_H_ #include "net/quic/core/quic_error_codes.h" #include "net/quic/core/quic_types.h" #include "net/quic/platform/api/quic_string_piece.h" namespace net { class QUIC_EXPORT_PRIVATE CryptoMessageParser { public: virtual ~CryptoMessageParser() {} virtual QuicErrorCode error() const = 0; virtual const std::string& error_detail() const = 0; // Processes input data, which must be delivered in order. Returns // false if there was an error, and true otherwise. virtual bool ProcessInput(QuicStringPiece input, Perspective perspective) = 0; // Returns the number of bytes of buffered input data remaining to be // parsed. virtual size_t InputBytesRemaining() const = 0; }; } // namespace net #endif // NET_QUIC_CORE_CRYPTO_CRYPTO_MESSAGE_PARSER_H_
31.727273
80
0.772684
3f370be67e01310f44254143b1cb57d010ca8dc6
7,162
c
C
contrib/libs/clapack/claqr1.c
HeyLey/catboost
f472aed90604ebe727537d9d4a37147985e10ec2
[ "Apache-2.0" ]
6,989
2017-07-18T06:23:18.000Z
2022-03-31T15:58:36.000Z
contrib/libs/clapack/claqr1.c
HeyLey/catboost
f472aed90604ebe727537d9d4a37147985e10ec2
[ "Apache-2.0" ]
1,978
2017-07-18T09:17:58.000Z
2022-03-31T14:28:43.000Z
ExternalCode/lapack/SRC/claqr1.c
daniel-anavaino/tinkercell
7896a7f809a0373ab3c848d25e3691d10a648437
[ "BSD-3-Clause" ]
1,228
2017-07-18T09:03:13.000Z
2022-03-29T05:57:40.000Z
/* claqr1.f -- translated by f2c (version 20061008). You must link the resulting object file with libf2c: on Microsoft Windows system, link with libf2c.lib; on Linux or Unix systems, link with .../path/to/libf2c.a -lm or, if you install libf2c.a in a standard place, with -lf2c -lm -- in that order, at the end of the command line, as in cc *.o -lf2c -lm Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., http://www.netlib.org/f2c/libf2c.zip */ #include "f2c.h" #include "blaswrap.h" /* Subroutine */ int claqr1_(integer *n, complex *h__, integer *ldh, complex * s1, complex *s2, complex *v) { /* System generated locals */ integer h_dim1, h_offset, i__1, i__2, i__3, i__4; real r__1, r__2, r__3, r__4, r__5, r__6; complex q__1, q__2, q__3, q__4, q__5, q__6, q__7, q__8; /* Builtin functions */ double r_imag(complex *); /* Local variables */ real s; complex h21s, h31s; /* -- LAPACK auxiliary routine (version 3.2) -- */ /* Univ. of Tennessee, Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd.. */ /* November 2006 */ /* .. Scalar Arguments .. */ /* .. */ /* .. Array Arguments .. */ /* .. */ /* Given a 2-by-2 or 3-by-3 matrix H, CLAQR1 sets v to a */ /* scalar multiple of the first column of the product */ /* (*) K = (H - s1*I)*(H - s2*I) */ /* scaling to avoid overflows and most underflows. */ /* This is useful for starting double implicit shift bulges */ /* in the QR algorithm. */ /* N (input) integer */ /* Order of the matrix H. N must be either 2 or 3. */ /* H (input) COMPLEX array of dimension (LDH,N) */ /* The 2-by-2 or 3-by-3 matrix H in (*). */ /* LDH (input) integer */ /* The leading dimension of H as declared in */ /* the calling procedure. LDH.GE.N */ /* S1 (input) COMPLEX */ /* S2 S1 and S2 are the shifts defining K in (*) above. */ /* V (output) COMPLEX array of dimension N */ /* A scalar multiple of the first column of the */ /* matrix K in (*). */ /* ================================================================ */ /* Based on contributions by */ /* Karen Braman and Ralph Byers, Department of Mathematics, */ /* University of Kansas, USA */ /* ================================================================ */ /* .. Parameters .. */ /* .. */ /* .. Local Scalars .. */ /* .. */ /* .. Intrinsic Functions .. */ /* .. */ /* .. Statement Functions .. */ /* .. */ /* .. Statement Function definitions .. */ /* .. */ /* .. Executable Statements .. */ /* Parameter adjustments */ h_dim1 = *ldh; h_offset = 1 + h_dim1; h__ -= h_offset; --v; /* Function Body */ if (*n == 2) { i__1 = h_dim1 + 1; q__2.r = h__[i__1].r - s2->r, q__2.i = h__[i__1].i - s2->i; q__1.r = q__2.r, q__1.i = q__2.i; i__2 = h_dim1 + 2; s = (r__1 = q__1.r, dabs(r__1)) + (r__2 = r_imag(&q__1), dabs(r__2)) + ((r__3 = h__[i__2].r, dabs(r__3)) + (r__4 = r_imag(&h__[ h_dim1 + 2]), dabs(r__4))); if (s == 0.f) { v[1].r = 0.f, v[1].i = 0.f; v[2].r = 0.f, v[2].i = 0.f; } else { i__1 = h_dim1 + 2; q__1.r = h__[i__1].r / s, q__1.i = h__[i__1].i / s; h21s.r = q__1.r, h21s.i = q__1.i; i__1 = (h_dim1 << 1) + 1; q__2.r = h21s.r * h__[i__1].r - h21s.i * h__[i__1].i, q__2.i = h21s.r * h__[i__1].i + h21s.i * h__[i__1].r; i__2 = h_dim1 + 1; q__4.r = h__[i__2].r - s1->r, q__4.i = h__[i__2].i - s1->i; i__3 = h_dim1 + 1; q__6.r = h__[i__3].r - s2->r, q__6.i = h__[i__3].i - s2->i; q__5.r = q__6.r / s, q__5.i = q__6.i / s; q__3.r = q__4.r * q__5.r - q__4.i * q__5.i, q__3.i = q__4.r * q__5.i + q__4.i * q__5.r; q__1.r = q__2.r + q__3.r, q__1.i = q__2.i + q__3.i; v[1].r = q__1.r, v[1].i = q__1.i; i__1 = h_dim1 + 1; i__2 = (h_dim1 << 1) + 2; q__4.r = h__[i__1].r + h__[i__2].r, q__4.i = h__[i__1].i + h__[ i__2].i; q__3.r = q__4.r - s1->r, q__3.i = q__4.i - s1->i; q__2.r = q__3.r - s2->r, q__2.i = q__3.i - s2->i; q__1.r = h21s.r * q__2.r - h21s.i * q__2.i, q__1.i = h21s.r * q__2.i + h21s.i * q__2.r; v[2].r = q__1.r, v[2].i = q__1.i; } } else { i__1 = h_dim1 + 1; q__2.r = h__[i__1].r - s2->r, q__2.i = h__[i__1].i - s2->i; q__1.r = q__2.r, q__1.i = q__2.i; i__2 = h_dim1 + 2; i__3 = h_dim1 + 3; s = (r__1 = q__1.r, dabs(r__1)) + (r__2 = r_imag(&q__1), dabs(r__2)) + ((r__3 = h__[i__2].r, dabs(r__3)) + (r__4 = r_imag(&h__[ h_dim1 + 2]), dabs(r__4))) + ((r__5 = h__[i__3].r, dabs(r__5)) + (r__6 = r_imag(&h__[h_dim1 + 3]), dabs(r__6))); if (s == 0.f) { v[1].r = 0.f, v[1].i = 0.f; v[2].r = 0.f, v[2].i = 0.f; v[3].r = 0.f, v[3].i = 0.f; } else { i__1 = h_dim1 + 2; q__1.r = h__[i__1].r / s, q__1.i = h__[i__1].i / s; h21s.r = q__1.r, h21s.i = q__1.i; i__1 = h_dim1 + 3; q__1.r = h__[i__1].r / s, q__1.i = h__[i__1].i / s; h31s.r = q__1.r, h31s.i = q__1.i; i__1 = h_dim1 + 1; q__4.r = h__[i__1].r - s1->r, q__4.i = h__[i__1].i - s1->i; i__2 = h_dim1 + 1; q__6.r = h__[i__2].r - s2->r, q__6.i = h__[i__2].i - s2->i; q__5.r = q__6.r / s, q__5.i = q__6.i / s; q__3.r = q__4.r * q__5.r - q__4.i * q__5.i, q__3.i = q__4.r * q__5.i + q__4.i * q__5.r; i__3 = (h_dim1 << 1) + 1; q__7.r = h__[i__3].r * h21s.r - h__[i__3].i * h21s.i, q__7.i = h__[i__3].r * h21s.i + h__[i__3].i * h21s.r; q__2.r = q__3.r + q__7.r, q__2.i = q__3.i + q__7.i; i__4 = h_dim1 * 3 + 1; q__8.r = h__[i__4].r * h31s.r - h__[i__4].i * h31s.i, q__8.i = h__[i__4].r * h31s.i + h__[i__4].i * h31s.r; q__1.r = q__2.r + q__8.r, q__1.i = q__2.i + q__8.i; v[1].r = q__1.r, v[1].i = q__1.i; i__1 = h_dim1 + 1; i__2 = (h_dim1 << 1) + 2; q__5.r = h__[i__1].r + h__[i__2].r, q__5.i = h__[i__1].i + h__[ i__2].i; q__4.r = q__5.r - s1->r, q__4.i = q__5.i - s1->i; q__3.r = q__4.r - s2->r, q__3.i = q__4.i - s2->i; q__2.r = h21s.r * q__3.r - h21s.i * q__3.i, q__2.i = h21s.r * q__3.i + h21s.i * q__3.r; i__3 = h_dim1 * 3 + 2; q__6.r = h__[i__3].r * h31s.r - h__[i__3].i * h31s.i, q__6.i = h__[i__3].r * h31s.i + h__[i__3].i * h31s.r; q__1.r = q__2.r + q__6.r, q__1.i = q__2.i + q__6.i; v[2].r = q__1.r, v[2].i = q__1.i; i__1 = h_dim1 + 1; i__2 = h_dim1 * 3 + 3; q__5.r = h__[i__1].r + h__[i__2].r, q__5.i = h__[i__1].i + h__[ i__2].i; q__4.r = q__5.r - s1->r, q__4.i = q__5.i - s1->i; q__3.r = q__4.r - s2->r, q__3.i = q__4.i - s2->i; q__2.r = h31s.r * q__3.r - h31s.i * q__3.i, q__2.i = h31s.r * q__3.i + h31s.i * q__3.r; i__3 = (h_dim1 << 1) + 3; q__6.r = h21s.r * h__[i__3].r - h21s.i * h__[i__3].i, q__6.i = h21s.r * h__[i__3].i + h21s.i * h__[i__3].r; q__1.r = q__2.r + q__6.r, q__1.i = q__2.i + q__6.i; v[3].r = q__1.r, v[3].i = q__1.i; } } return 0; } /* claqr1_ */
36.171717
98
0.500838
5fd1cb273d3bf8f4f9e4628049fbe2a7340f145e
2,096
h
C
extern/gtk/gsk/ngl/gskngliconlibraryprivate.h
PableteProgramming/download
013e35bb5c085e5dfdb57a3a0a39cdf2fd3064b8
[ "MIT" ]
null
null
null
extern/gtk/gsk/ngl/gskngliconlibraryprivate.h
PableteProgramming/download
013e35bb5c085e5dfdb57a3a0a39cdf2fd3064b8
[ "MIT" ]
null
null
null
extern/gtk/gsk/ngl/gskngliconlibraryprivate.h
PableteProgramming/download
013e35bb5c085e5dfdb57a3a0a39cdf2fd3064b8
[ "MIT" ]
null
null
null
/* gskngliconlibraryprivate.h * * Copyright 2020 Christian Hergert <chergert@redhat.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program. If not, see <http://www.gnu.org/licenses/>. * * SPDX-License-Identifier: LGPL-2.1-or-later */ #ifndef __GSK_NGL_ICON_LIBRARY_PRIVATE_H__ #define __GSK_NGL_ICON_LIBRARY_PRIVATE_H__ #include <pango/pango.h> #include "gskngltexturelibraryprivate.h" G_BEGIN_DECLS #define GSK_TYPE_GL_ICON_LIBRARY (gsk_ngl_icon_library_get_type()) typedef struct _GskNglIconData { GskNglTextureAtlasEntry entry; GdkTexture *source_texture; } GskNglIconData; G_DECLARE_FINAL_TYPE (GskNglIconLibrary, gsk_ngl_icon_library, GSK, NGL_ICON_LIBRARY, GskNglTextureLibrary) GskNglIconLibrary *gsk_ngl_icon_library_new (GskNglDriver *driver); void gsk_ngl_icon_library_add (GskNglIconLibrary *self, GdkTexture *key, const GskNglIconData **out_value); static inline void gsk_ngl_icon_library_lookup_or_add (GskNglIconLibrary *self, GdkTexture *key, const GskNglIconData **out_value) { GskNglTextureAtlasEntry *entry; if G_LIKELY (gsk_ngl_texture_library_lookup ((GskNglTextureLibrary *)self, key, &entry)) *out_value = (GskNglIconData *)entry; else gsk_ngl_icon_library_add (self, key, out_value); } G_END_DECLS #endif /* __GSK_NGL_ICON_LIBRARY_PRIVATE_H__ */
34.360656
107
0.709924
75557e399a53631b3600b28c5230be8fa7ce05ca
1,402
c
C
srcs/utils/ko_utils.c
pgomez-a/minishell
f17a66188a091af41c37bfc37fea7916d2965120
[ "MIT" ]
null
null
null
srcs/utils/ko_utils.c
pgomez-a/minishell
f17a66188a091af41c37bfc37fea7916d2965120
[ "MIT" ]
null
null
null
srcs/utils/ko_utils.c
pgomez-a/minishell
f17a66188a091af41c37bfc37fea7916d2965120
[ "MIT" ]
null
null
null
#include "../../inc/koala.h" /** ** Deletes the d positoned character in the string **/ char *ko_delete_ch(const char *str, int d) { char *new_str; int i; int j; i = 0; j = 0; new_str = malloc(ft_strlen(str)); while (str[i]) { if (i != d) new_str[j++] = str[i]; i++; } new_str[j] = 0; return (new_str); } /** ** Check if there are close quotes or not **/ int close_quotes(int x, char *line) { char quot; quot = line[x++]; while (line[x]) { if (line[x] == quot) return (1); x++; } return (0); } char *get_errorvar(int exit_status, int ret) { static char *error = 0; if (ret) { if (error) return (error); else return ("0"); } if (error) free(error); if (exit_status) error = ft_itoa(exit_status); else error = 0; return (0); } char *koala_getenv(char *env_var, char **envp) { int i; i = 0; while (envp[i]) { if (!ft_strcmp(env_var, "?")) return (get_errorvar(0, 1)); if (!compare_env_var(envp[i], env_var)) { if (ft_strchr(envp[i], '=')) return (ft_strchr(envp[i], '=') + 1); else return (0); } i++; } return (0); } char *koala_getcwd(void) { int size; char *string; size = 10; string = malloc(sizeof(char) * 16); if (!string) exit(1); while (!getcwd(string, size)) { free(string); size *= 2; string = malloc(sizeof(char) * size); if (!string) exit(1); } return (string); }
13.480769
51
0.564194
be03f42da9dcd180365979b01a845c839b0e4949
513
h
C
Game/Cards/Magic/DarkLight.h
CrusaderCrab/YugiohPhantomRealm
79bd1e9948d2d2d29acf042fd412804c30562a8e
[ "Zlib" ]
13
2018-04-13T22:10:00.000Z
2022-01-01T08:26:23.000Z
Game/Cards/Magic/DarkLight.h
CrusaderCrab/YugiohPhantomRealm
79bd1e9948d2d2d29acf042fd412804c30562a8e
[ "Zlib" ]
null
null
null
Game/Cards/Magic/DarkLight.h
CrusaderCrab/YugiohPhantomRealm
79bd1e9948d2d2d29acf042fd412804c30562a8e
[ "Zlib" ]
3
2017-02-22T16:35:06.000Z
2019-12-21T20:39:23.000Z
#pragma once #include <vector> #include <Game\Cards\Magic\MagicSource.h> #include <Game\Cards\CardData.h> #include <Game\WaitUnit.h> #include <Game\ModelLoader.h> namespace Card{ class DarkLight : public MagicSource, public Game::WaitUnit { public: int chain; Game::ModelLoader centreGlow; float time; float speed; void startup(); void cleanup(); void update(); void render(); void startUpdate(); void glowUpdate(); void flashUpdate(); void fadeUpdate(); void finishUpdate(); }; }
18.321429
60
0.701754
e1dca237385cff89f7aa4737102b17bfe954f9bf
7,524
c
C
musicplayer/plugins/sc68plugin/file68/src/init68.c
Osmose/moseamp
8357daf2c93bc903c8041cc82bf3567e8d085a60
[ "MIT" ]
6
2017-04-19T19:06:03.000Z
2022-01-11T14:44:14.000Z
plugins/sc68plugin/file68/src/init68.c
sasq64/musicplayer
372852c2f4e3231a09db2628fc4b7e7c2bfeec67
[ "MIT" ]
4
2018-04-04T20:27:32.000Z
2020-04-25T10:46:21.000Z
musicplayer/plugins/sc68plugin/file68/src/init68.c
Osmose/moseamp
8357daf2c93bc903c8041cc82bf3567e8d085a60
[ "MIT" ]
2
2018-06-08T15:20:48.000Z
2020-08-19T14:24:21.000Z
/* * @file init68.c * @brief library initialization * @author http://sourceforge.net/users/benjihan * * Copyright (C) 2001-2011 Benjamin Gerard * * Time-stamp: <2012-01-28 16:45:05 ben> * * 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 3 of the * License, or (at your option) any later version. * * This program 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. * * You should have received a copy of the GNU General Public License * along with this program. * * If not, see <http://www.gnu.org/licenses/>. * */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "file68_api.h" #include "file68.h" #include "option68.h" #include "msg68.h" #include "error68.h" #include "alloc68.h" #include "registry68.h" #include "istream68_curl.h" #include "rsc68.h" #include "string68.h" #include <stdlib.h> #include <string.h> static volatile int init; extern int aSIDify; /* defined in file68.c */ void istream68_ao_shutdown(void); /* defined in istream68_ao.c */ int istream68_z_init(void); /* defined in istream68_z.c */ void istream68_z_shutdown(void); /* defined in istream68_z.c */ int option68_init(void); /* defined in option68.c */ void option68_shutdown(void); /* defined in option68.c */ int file68_loader_init(void); /* defined in file68.c */ void file68_loader_shutdown(void); /* defined in file68.c */ int istream68_ao_init(void); /* defined in istream68_ao.c */ static char * mygetenv(const char *name) { #ifndef HAVE_GETENV return 0; #else return getenv(name); #endif } /* Get path from registry, converts '\' to '/' and adds missing trailing '/'. * * @return pointer to the end of string * @retval 0 error */ static char * get_reg_path(registry68_key_t key, char * kname, char * buffer, int buflen) { char * e = 0; if (registry68_support()) { int i = registry68_gets(key,kname,buffer,buflen); buffer[buflen-1] = 0; if (i >= 0) { for (e=buffer; *e; ++e) { if (*e == '\\') *e = '/'; } if (e > buffer && e[-1] != '/') { *e++ = '/'; *e = 0; } } } if (!e) buffer[0] = 0; return e; } static const char dbgcat[] = "debug"; static const char rsccat[] = "files"; static const char prefix[] = "sc68-"; /* list of options / envvars * * "debug" is a string to be evaluted as an integer later in the * process (once debug features have been defined). * */ static option68_t opts[] = { { option68_BOL,prefix,"no-debug",dbgcat,"disable all debug output" }, { option68_STR,prefix,"debug" ,dbgcat,"set debug features" }, { option68_STR,prefix,"data" ,rsccat,"shared (system) resource path" }, { option68_STR,prefix,"home" ,rsccat,"private (user) resource path" }, { option68_STR,prefix,"music" ,rsccat,"music database path" }, { option68_STR,prefix,"rmusic" ,rsccat,"online music base URI" }, { option68_STR,prefix,"asid" ,rsccat,"create aSID tracks [no*|safe|force]" } }; int file68_init(int argc, char **argv) { char tmp[1024]; option68_t * opt; if (init) { const int i = init & 3; const char *message[4] = { "clean","initialized","shutdowning","initializing" }; error68("file68: init error -- *%s*", message[i]); argc = -1; goto out_no_init; } init = 3; /* Options */ option68_init(); /* Zlib */ istream68_z_init(); /* Curl */ istream68_curl_init(); /* Xiph AO */ istream68_ao_init(); /* Init resource */ rsc68_init(); /* Loader */ file68_loader_init(); option68_append(opts,sizeof(opts)/sizeof(*opts)); argc = option68_parse(argc, argv, 1); /* Check for --sc68-no-debug */ opt = option68_get("no-debug", 1); if (opt && opt->val.num) { /* Remove all debug messages whatsoever. */ msg68_set_handler(0); } /* Check for --sc68-asid=off|safe|force */ if (opt = option68_get("asid",1), opt) { if (!strcmp68(opt->val.str,"no")) aSIDify = 0; else if (!strcmp68(opt->val.str,"safe")) aSIDify = 1; else if (!strcmp68(opt->val.str,"force")) aSIDify = 2; else msg68_notice("file68: ignore invalid mode for --sc68-asid -- *%s*\n", opt->val.str); } /* Check for --sc68-debug= */ /* postpone: at this point most debug features have not been created yet. it is pretty much useless to set the mask right now. It will be done after all inits. */ #if 0 opt = option68_get("debug", 1); if (op) { debugmsg68_mask = opt->val.num; } #endif /* Get share path from registry */ opt = option68_get("data", 0); if (opt) { /* Get data path from registry */ if (!option68_isset(opt)) { char * e; const char path[] = "Resources"; e = get_reg_path(registry68_rootkey(REGISTRY68_LMK), "SOFTWARE/sashipa/sc68/Install_Dir", tmp, sizeof(tmp)); if (e && (e+sizeof(path) < tmp+sizeof(tmp))) { memcpy(e, path, sizeof(path)); option68_set(opt,tmp); } } /* Setup new data path */ if (option68_isset(opt)) { rsc68_set_share(opt->val.str); #if 0 /* not needed anynore since option68 properly alloc strings */ if (opt->val.str == tmp) option68_unset(opt); /* Must release tmp ! */ #endif } } /* Get user path */ opt = option68_get("home", 0); if (opt) { /* Get user path from HOME */ if (!option68_isset(opt)) { const char path[] = "/.sc68"; const char * env = mygetenv("HOME"); if(env && strlen(env)+sizeof(path) < sizeof(tmp)) { strncpy(tmp,env,sizeof(tmp)); strcat68(tmp,path,sizeof(tmp)); /* $$$ We should test if this directory actually exists */ option68_set(opt,tmp); } } /* Get user path from registry */ if (!option68_isset(opt)) { char * e; const char path[] = "sc68"; e = get_reg_path(registry68_rootkey(REGISTRY68_CUK), "Volatile Environment/APPDATA", tmp, sizeof(tmp)); if (e && (e+sizeof(path) < tmp+sizeof(tmp))) { memcpy(e, path, sizeof(path)); option68_set(opt,tmp); } } /* Setup new user path */ if (option68_isset(opt)) { rsc68_set_user(opt->val.str); if (opt->val.str == tmp) option68_unset(opt); /* Must release tmp ! */ } } /* Setup new music path */ opt = option68_get("music", 1); if (opt) { rsc68_set_music(opt->val.str); } /* Setup new remote path */ opt = option68_get("remote", 1); if (opt) { rsc68_set_remote_music(opt->val.str); } init = 1; out_no_init: return argc; } void file68_shutdown(void) { if (init == 1) { init = 2; /* Options */ option68_shutdown(); /* Loader */ file68_loader_shutdown(); /* Shutdown resource */ rsc68_shutdown(); /* Xiph AO */ istream68_ao_shutdown(); /* Curl */ istream68_curl_shutdown(); /* Zlib */ istream68_z_shutdown(); init = 0; } } int file68_version(void) { return PACKAGE_VERNUM; } const char * file68_versionstr() { return PACKAGE_STRING; }
24.831683
90
0.602472
e1f6e718f19bc43d4221779e1b58b156f0693c3a
2,531
h
C
VideoEdit_GPUImage/MyTools/MHVideoTool.h
531464049/VideoEdit_GPUImage
596a950ab9c654981bb53c73f42557efd443013c
[ "Apache-2.0" ]
22
2019-03-19T02:38:59.000Z
2022-03-19T06:50:26.000Z
VideoEdit_GPUImage/MyTools/MHVideoTool.h
531464049/VideoEdit_GPUImage
596a950ab9c654981bb53c73f42557efd443013c
[ "Apache-2.0" ]
1
2019-03-05T12:43:21.000Z
2019-03-05T12:43:21.000Z
VideoEdit_GPUImage/MyTools/MHVideoTool.h
531464049/VideoEdit_GPUImage
596a950ab9c654981bb53c73f42557efd443013c
[ "Apache-2.0" ]
5
2019-04-16T03:25:00.000Z
2021-07-21T08:37:03.000Z
// // MHVideoTool.h // MHShortVideo // // Created by 马浩 on 2018/11/14. // Copyright © 2018年 mh. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #import <AVFoundation/AVFoundation.h> #import <AssetsLibrary/AssetsLibrary.h> @interface MHVideoTool : NSObject /** 相册视频保存本地路径 @return 相册视频保存到本地的路径 */ +(NSString *)mh_albumVideoOutTempPath; /** 获取视频的缩略图方法 @param videoUrl 视频的路径 @param time 时间 @return 视频截图 */ + (UIImage *)mh_getVideoTempImageFromVideo:(NSURL *)videoUrl withTime:(CGFloat)time; /** 获取视频长度 @param videoUrl 视频地址 @return 视频长度 */ +(CGFloat)mh_getVideolength:(NSURL *)videoUrl; /** 视频的旋转角度 @param url 视频 @return 角度 */ + (NSUInteger)mh_getDegressFromVideoWithURL:(NSURL *)url; /** 获取视频尺寸 @param videoUrl 视频地址 @return 视频尺寸 */ +(CGSize)mh_getVideoSize:(NSURL *)videoUrl; /** 根据比例调整视频输出的尺寸,width=480 @param nomSize 原始尺寸 @return 调整后的尺寸 */ +(CGSize)mh_fixVideoOutPutSize:(CGSize)nomSize; /** 将视频保存到相册 @param videoUrl 要保存的视频地址 @param callBack 保存回调 */ +(void)mh_writeVideoToPhotosAlbum:(NSURL *)videoUrl callBack:(void(^)(BOOL success))callBack; /** 修改视频速度 @param videoUrl 原始视频地址 @param speed 要改变的速度 speed越大,视频修改后时间越长 最终时间=原始时间*speed @param outPutUrl 改变后的视频地址 @param callBack 回调-是否成功 */ +(void)changeVideoSpeed:(NSURL *)videoUrl speed:(CGFloat)speed outPutUrl:(NSURL *)outPutUrl callBack:(void(^)(BOOL success))callBack; /** 将多个视频合成一个视频 @param paths 待合成的视频路径 @param outPutUrl 输入路径 @param callBack 回调-是否成功,输入路径 */ +(void)mergeVideosWithPaths:(NSArray *)paths outPutUrl:(NSURL *)outPutUrl callBack:(void(^)(BOOL success,NSURL * outPurUrl))callBack; /** 音频bgm裁剪 @param bgmUrl 待裁剪的音频路径 @param startTime 裁剪开始时间 @param length 裁剪长度 @param callBack 回调 */ +(void)crapMusicWithUrl:(NSURL *)bgmUrl startTime:(CGFloat)startTime length:(CGFloat)length callBack:(void(^)(BOOL success,NSURL * outPurUrl))callBack; /** 合并视频+背景音乐 同时调整原始视频的音频和背景音乐的音量 @param videoUrl 要合并的视频地址 @param originalAudioTrackVideoUrl 原始视频地址-从里边获取原始视频的音频轨道 @param bgmUrl 背景音乐地址 @param originalVolume 原始视频音频轨道音量 @param bgmVolume 背景音乐音量 @param outPutUrl 输出地址 @param callBack 回调 */ +(void)mergevideoWithVideoUrl:(NSURL *)videoUrl originalAudioTrackVideoUrl:(NSURL *)originalAudioTrackVideoUrl bgmUrl:(NSURL *)bgmUrl originalVolume:(CGFloat)originalVolume bgmVolume:(CGFloat)bgmVolume outPutUrl:(NSURL *)outPutUrl callBack:(void(^)(BOOL success,NSURL * outPurUrl))callBack; +(NSString *)test_getAVideoUrl:(NSInteger)index; +(NSString *)t_videoPreImage:(NSInteger)index; @end
23.654206
290
0.755433
a8083bbe4e901aa158a08876c9b5e2cb9f1e6f4d
5,199
c
C
src/level3/dsymm.c
hzhangxyz/ulmBLAS
cb3481ce242c88bcf9bfcb51c185ed002752c6e4
[ "BSD-3-Clause" ]
null
null
null
src/level3/dsymm.c
hzhangxyz/ulmBLAS
cb3481ce242c88bcf9bfcb51c185ed002752c6e4
[ "BSD-3-Clause" ]
null
null
null
src/level3/dsymm.c
hzhangxyz/ulmBLAS
cb3481ce242c88bcf9bfcb51c185ed002752c6e4
[ "BSD-3-Clause" ]
null
null
null
#include <ulmblas.h> #include <auxiliary/xerbla.h> #include <math.h> void ULMBLAS(dsymm)(const enum Side side, const enum UpLo upLo, const int m, const int n, const double alpha, const double *A, const int ldA, const double *B, const int ldB, const double beta, double *C, const int ldC) { // // Local scalars // int i, j, k; double tmp1, tmp2; // // Quick return if possible. // if (m==0 || n==0 || (alpha==0.0 && beta==1.0)) { return; } // // And when alpha is exactly zero // if (alpha==0.0) { if (beta==0.0) { for (j=0; j<n; ++j) { for (i=0; i<m; ++i) { C[i+j*ldC] = 0.0; } } } else { for (j=0; j<n; ++j) { for (i=0; i<m; ++i) { C[i+j*ldC] *= beta; } } } return; } // // Start the operations. // if (side==Left) { // // Form C := alpha*A*B + beta*C. // if (upLo==Upper) { for (j=0; j<n; ++j) { for (i=0; i<m; ++i) { tmp1 = alpha*B[i+j*ldB]; tmp2 = 0.0; for (k=0; k<i; ++k) { C[k+j*ldC] += tmp1*A[k+i*ldA]; tmp2 += B[k+j*ldB]*A[k+i*ldA]; } if (beta==0.0) { C[i+j*ldC] = tmp1*A[i+i*ldA] + alpha*tmp2; } else { C[i+j*ldC] = beta*C[i+j*ldC] + tmp1*A[i+i*ldA] + alpha*tmp2; } } } } else { for (j=0; j<n; ++j) { for (i=m-1; i>=0; --i) { tmp1 = alpha*B[i+j*ldB]; tmp2 = 0.0; for (k=i+1; k<m; ++k) { C[k+j*ldC] += tmp1*A[k+i*ldA]; tmp2 += B[k+j*ldB]*A[k+i*ldA]; } if (beta==0.0) { C[i+j*ldC] = tmp1*A[i+i*ldA] + alpha*tmp2; } else { C[i+j*ldC] = beta*C[i+j*ldC] + tmp1*A[i+i*ldA] + alpha*tmp2; } } } } } else { // // Form C := alpha*B*A + beta*C. // for (j=0; j<n; ++j) { tmp1 = alpha*A[j+j*ldA]; if (beta==0.0) { for (i=0; i<m; ++i) { C[i+j*ldC] = tmp1*B[i+j*ldB]; } } else { for (i=0; i<m; ++i) { C[i+j*ldC] = beta*C[i+j*ldC] + tmp1*B[i+j*ldB]; } } for (k=0; k<j; ++k) { if (upLo==Upper) { tmp1 = alpha*A[k+j*ldA]; } else { tmp1 = alpha*A[j+k*ldA]; } for (i=0; i<m; ++i) { C[i+j*ldC] += tmp1*B[i+k*ldB]; } } for (k=j+1; k<n; ++k) { if (upLo==Upper) { tmp1 = alpha*A[j+k*ldA]; } else { tmp1 = alpha*A[k+j*ldA]; } for (i=0; i<m; ++i) { C[i+j*ldC] += tmp1*B[i+k*ldB]; } } } } } void F77BLAS(dsymm)(const char *_side, const char *_upLo, const int *_m, const int *_n, const double *_alpha, const double *A, const int *_ldA, const double *B, const int *_ldB, const double *_beta, double *C, const int *_ldC) { // // Dereference scalar parameters // enum Side side = charToSide(*_side); enum UpLo upLo = charToUpLo(*_upLo); int m = *_m; int n = *_n; double alpha = *_alpha; int ldA = *_ldA; int ldB = *_ldB; double beta = *_beta; int ldC = *_ldC; // // Set numRowsA as the number of rows of A // int numRowsA = (side==Left) ? m : n; // // Test the input parameters // int info = 0; if (side==0) { info = 1; } else if (upLo==0) { info = 2; } else if (m<0) { info = 3; } else if (n<0) { info = 4; } else if (ldA<max(1,numRowsA)) { info = 7; } else if (ldB<m) { info = 9; } else if (ldC<m) { info = 12; } if (info!=0) { F77BLAS(xerbla)("DSYMM ", &info); } ULMBLAS(dsymm)(side, upLo, m, n, alpha, A, ldA, B, ldB, beta, C, ldC); }
26.257576
67
0.308906
6d8c9db4d9f1bdf2af37881e55e95180e380fa93
1,028
h
C
include/sp2/graphics/font/bitmap.h
daid/SeriousProton2
6cc9c2291ea63ffc82427ed82f51a84611f7f45c
[ "MIT" ]
8
2018-01-26T20:21:08.000Z
2021-08-30T20:28:43.000Z
include/sp2/graphics/font/bitmap.h
daid/SeriousProton2
6cc9c2291ea63ffc82427ed82f51a84611f7f45c
[ "MIT" ]
7
2018-10-28T14:52:25.000Z
2020-12-28T19:59:04.000Z
include/sp2/graphics/font/bitmap.h
daid/SeriousProton2
6cc9c2291ea63ffc82427ed82f51a84611f7f45c
[ "MIT" ]
7
2017-05-27T16:33:37.000Z
2022-02-18T14:07:17.000Z
#ifndef SP2_GRAPHICS_FONT_BITMAP_H #define SP2_GRAPHICS_FONT_BITMAP_H #include <sp2/graphics/font.h> namespace sp { class BitmapFont : public Font { public: BitmapFont(const string& name, io::ResourceStreamPtr stream); virtual Texture* getTexture(int pixel_size) override; protected: virtual CharacterInfo getCharacterInfo(const char* str) override; virtual bool getGlyphInfo(int char_code, int pixel_size, GlyphInfo& info) override; virtual float getLineSpacing(int pixel_size) override; virtual float getBaseline(int pixel_size) override; virtual float getKerning(int previous_char_code, int current_char_code) override; private: static constexpr int special_mask = 0x100; string name; Texture* texture = nullptr; Vector2f glyph_size; Vector2f glyph_advance; float aspect_ratio; std::unordered_map<int, Vector2f> glyphs; std::unordered_map<string, int> specials; }; }//namespace sp #endif//SP2_GRAPHICS_FONT_BITMAP_H
26.358974
88
0.736381
ed716c7b329e0cedd9010a6abd8886ce45cb58c3
3,206
c
C
d/barriermnts/bpeak/mon/orcc.c
Dbevan/SunderingShadows
6c15ec56cef43c36361899bae6dc08d0ee907304
[ "MIT" ]
13
2019-07-19T05:24:44.000Z
2021-11-18T04:08:19.000Z
d/barriermnts/bpeak/mon/orcc.c
Dbevan/SunderingShadows
6c15ec56cef43c36361899bae6dc08d0ee907304
[ "MIT" ]
4
2021-03-15T18:56:39.000Z
2021-08-17T17:08:22.000Z
d/barriermnts/bpeak/mon/orcc.c
Dbevan/SunderingShadows
6c15ec56cef43c36361899bae6dc08d0ee907304
[ "MIT" ]
13
2019-09-12T06:22:38.000Z
2022-01-31T01:15:12.000Z
#include <std.h> #include "../bpeak.h" inherit MONSTER; object obj,ob; void create (){ ::create (); set_name("Orc captain"); set_id(({"orc","orc captain"})); set_short("%^RESET%^%^ORANGE%^A large orc%^RESET%^"); set_long("%^RESET%^%^GREEN%^This ugly creature has %^BOLD%^%^BLACK%^scraggly" " black hair %^RESET%^%^GREEN%^that falls over his primitive face. He has a" " low forehead, pig-like nose and prominent lower %^RESET%^teeth %^GREEN%^that curve" " up over his upper lip. His posture is huanched and his skin is an ugly" " %^BOLD%^%^BLACK%^grey %^RESET%^%^GREEN%^in color. Two weapon sheaths are" " strapped to his sides and large boots adorn his feet. Crude armor is worn for" " protection.%^RESET%^"); set_race("orc"); set_gender("male"); set_body_type("humanoid"); set_hd(20,2); set_overall_ac(-7); set_size(2); set_stats("intelligence",8); set_stats("strength",17); set_stats("wisdom",7); set_stats("dexterity",11); set_stats("constitution",12); set_stats("charisma",6); set_exp(3000); set_alignment(9); set_hp(random(250)+200); set_max_hp(query_hp()); add_search_path("/cmds/fighter"); set_max_level(45); set_property("full attacks",1); set_func_chance(20); set_funcs(({"parry"})); command("pose standing on guard"); set("aggressive","aggfunc"); set("aggressive",19); set_moving(1); set_speed(12); set_nogo(({INRMS+"ce1",INRMS+"bledge","/d/barriermnts/bforest/rooms/fpath1"})); ob=new("/d/common/obj/weapon/khopesh.c"); ob->set_property("enchantment",random(3)+1); ob->set_long("%^BOLD%^%^WHITE%^The blade of this sword curves into an elegant arch that extends out from a" " battered, silver hilt. Soft, supple %^RESET%^%^ORANGE%^leather %^BOLD%^%^WHITE%^loosely wraps the" " %^RESET%^%^ORANGE%^grip, %^BOLD%^%^WHITE%^from which a %^RED%^j%^YELLOW%^e%^CYAN%^w%^GREEN%^" "e%^BLUE%^l %^WHITE%^encrusted pommel" " extends. Small depictions of moons, stars and suns have been crudely etched along the length of the blade," " making this blade look as though perhaps it either has been altered, or was a poor attempt at replicating a" " nicer sword.%^RESET%^"); ob->move(TO); command("wield sword"); //obj=new("/d/common/obj/potion/healing"); //obj->move(TO); //obj->set_uses(20); set_property("add kits",15); set_emotes(1, ({"%^RESET%^ The orc captain glances around nervously.", "%^RESET%^%^ORANGE%^The orc captain absently rests his hand on the hilt of his sword.%^RESET%^"}), 0); } int aggfunc() { force_me("emoteat %^BOLD%^%^RED%^"+TPQN+ " turns to $N and draws his sword.%^RESET%^"); call_out("force_me",1,"rush "+TPQN+ ""); } void parry(object target) { force_me("parry"); return 1; } void heart_beat(){ ::heart_beat(); if (!objectp(TO)) return; if (!objectp(ETO)) return; /*if(query_hp()<150 && present("vial",TO)){ command("open vial"); command("drink vial"); command("drink vial"); command("drink vial"); command("drink vial"); command("drink vial"); command("offer bottle"); command("offer bottle"); command("offer bottle"); command("offer bottle"); command("offer bottle"); }*/ }
35.230769
110
0.649095
63ae8559cc6187425266aab6fe865bb0e6091c0a
1,049
h
C
rcbasic_edit/rc_closeProjectSavePrompt_dialog.h
pancakevirus/RCBASIC3
50f866b70d8b4c0ad50573d758bc605d69c2fb8b
[ "Zlib" ]
null
null
null
rcbasic_edit/rc_closeProjectSavePrompt_dialog.h
pancakevirus/RCBASIC3
50f866b70d8b4c0ad50573d758bc605d69c2fb8b
[ "Zlib" ]
null
null
null
rcbasic_edit/rc_closeProjectSavePrompt_dialog.h
pancakevirus/RCBASIC3
50f866b70d8b4c0ad50573d758bc605d69c2fb8b
[ "Zlib" ]
null
null
null
#ifndef __rcbasic_editrc_closeProjectSavePrompt_dialog__ #define __rcbasic_editrc_closeProjectSavePrompt_dialog__ /** @file Subclass of rc_closeProjectSavePrompt_dialog, which is generated by wxFormBuilder. */ #include "rcbasic_edit.h" //// end generated include #define projectCloseFlag_CANCEL 0 #define projectCloseFlag_DONT_SAVE 1 #define projectCloseFlag_SAVE 2 /** Implementing rc_closeProjectSavePrompt_dialog */ class rcbasic_edit_closeProjectSavePrompt_dialog : public rc_closeProjectSavePrompt_dialog { private: int projectCloseFlag; protected: // Handlers for rc_closeProjectSavePrompt_dialog events. void onCloseProjectSaveCancel( wxCommandEvent& event ); void onCloseProjectSaveDontSave( wxCommandEvent& event ); void onCloseProjectSaveOk( wxCommandEvent& event ); public: /** Constructor */ rcbasic_edit_closeProjectSavePrompt_dialog( wxWindow* parent, const wxString& title ); int getProjectCloseFlag(); //// end generated class members }; #endif // __rcbasic_editrc_closeProjectSavePrompt_dialog__
29.138889
90
0.816969
5baf72e34146bfd945d5541f04ff44b317a089d3
1,381
h
C
chrome/browser/ui/views/apps/native_app_window_frame_view_mac.h
Yannic/chromium
ab32e8aacb08c9fce0dc4bf09eec456ba46e3710
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
76
2020-09-02T03:05:41.000Z
2022-03-30T04:40:55.000Z
chrome/browser/ui/views/apps/native_app_window_frame_view_mac.h
blueboxd/chromium-legacy
07223bc94bd97499909c9ed3c3f5769d718fe2e0
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
45
2020-09-02T03:21:37.000Z
2022-03-31T22:19:45.000Z
chrome/browser/ui/views/apps/native_app_window_frame_view_mac.h
Yannic/chromium
ab32e8aacb08c9fce0dc4bf09eec456ba46e3710
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
8
2020-07-22T18:49:18.000Z
2022-02-08T10:27:16.000Z
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_UI_VIEWS_APPS_NATIVE_APP_WINDOW_FRAME_VIEW_MAC_H_ #define CHROME_BROWSER_UI_VIEWS_APPS_NATIVE_APP_WINDOW_FRAME_VIEW_MAC_H_ #include "base/macros.h" #include "ui/views/window/native_frame_view.h" namespace extensions { class NativeAppWindow; } class Widget; // Provides metrics consistent with a native frame on Mac. The actual frame is // drawn by NSWindow. class NativeAppWindowFrameViewMac : public views::NativeFrameView { public: NativeAppWindowFrameViewMac(views::Widget* frame, extensions::NativeAppWindow* window); NativeAppWindowFrameViewMac(const NativeAppWindowFrameViewMac&) = delete; NativeAppWindowFrameViewMac& operator=(const NativeAppWindowFrameViewMac&) = delete; ~NativeAppWindowFrameViewMac() override; // NonClientFrameView: gfx::Rect GetWindowBoundsForClientBounds( const gfx::Rect& client_bounds) const override; int NonClientHitTest(const gfx::Point& point) override; private: // Weak. Owned by extensions::AppWindow (which manages our Widget via its // WebContents). extensions::NativeAppWindow* native_app_window_; }; #endif // CHROME_BROWSER_UI_VIEWS_APPS_NATIVE_APP_WINDOW_FRAME_VIEW_MAC_H_
32.880952
78
0.784938
6fa266a1efce165b1f7c2b169f83396b74eae590
385
h
C
tools/level_editor/src/scene/callbacks/CameraMotionCallback.h
filipwasil/fillwave
65f5eeebf8ca4a8ce2d25293874b051c2a4c0550
[ "MIT" ]
27
2015-09-26T23:29:48.000Z
2021-03-06T08:54:46.000Z
tools/level_editor/src/scene/callbacks/CameraMotionCallback.h
filipwasil/fillwave
65f5eeebf8ca4a8ce2d25293874b051c2a4c0550
[ "MIT" ]
83
2015-09-28T22:20:16.000Z
2018-05-16T13:25:28.000Z
tools/level_editor/src/scene/callbacks/CameraMotionCallback.h
filipwasil/fillwave
65f5eeebf8ca4a8ce2d25293874b051c2a4c0550
[ "MIT" ]
8
2015-11-03T22:29:29.000Z
2018-11-17T08:49:07.000Z
#pragma once #include <flw/Framework.h> namespace flw { class Engine; namespace flf { class CameraMotionCallback { public: explicit CameraMotionCallback(Engine* engine); virtual ~CameraMotionCallback() = default; void perform(const Event& event); glm::vec3 calculateNewPosition(float time); private: float mTimePassed; Engine* mEngine; }; } /* flf */ } /* flw */
14.807692
48
0.711688
9d4129c707fab38120536f89bc585a1b7e315a01
819
h
C
src/nodes/nodebase.h
marcobambini/c-ray
a510a6f8987e1158f9c63522c91f078c0c3942b8
[ "MIT" ]
360
2020-06-11T05:49:13.000Z
2022-03-28T06:22:21.000Z
src/nodes/nodebase.h
marcobambini/c-ray
a510a6f8987e1158f9c63522c91f078c0c3942b8
[ "MIT" ]
21
2020-06-11T15:29:54.000Z
2022-03-17T10:43:05.000Z
src/nodes/nodebase.h
marcobambini/c-ray
a510a6f8987e1158f9c63522c91f078c0c3942b8
[ "MIT" ]
21
2020-06-28T22:23:52.000Z
2021-12-21T15:43:21.000Z
// // nodebase.h // C-Ray // // Created by Valtteri Koskivuori on 07/12/2020. // Copyright © 2020 Valtteri Koskivuori. All rights reserved. // #pragma once #include "../utils/logging.h" // Magic for comparing two nodes struct nodeBase { bool (*compare)(const void *, const void *); }; bool compareNodes(const void *A, const void *B); #define HASH_CONS(hashtable, hash, T, ...) \ { \ const T candidate = __VA_ARGS__; \ const uint32_t h = hash(&candidate); \ const T *existing = findInHashtable(hashtable, &candidate, h); \ if (existing) {\ logr(debug, "Reusing existing %s.\n", __FUNCTION__);\ return (void *)existing; \ } \ logr(debug, "Inserting %s.\n", __FUNCTION__); \ insertInHashtable(hashtable, &candidate, sizeof(T), h); \ return findInHashtable(hashtable, &candidate, h); \ }
24.088235
66
0.663004
a0506c47dbfda1143cbae07cde200db7f5b8153a
1,085
h
C
include/ctypedef.h
makefriend8/sdk
7bbf9f1e1403871b75bca4192639f4cecd28c475
[ "MIT" ]
289
2017-02-27T02:31:21.000Z
2022-03-29T16:34:12.000Z
include/ctypedef.h
makefriend8/sdk
7bbf9f1e1403871b75bca4192639f4cecd28c475
[ "MIT" ]
23
2017-09-09T02:26:24.000Z
2021-12-08T09:01:17.000Z
include/ctypedef.h
makefriend8/sdk
7bbf9f1e1403871b75bca4192639f4cecd28c475
[ "MIT" ]
209
2015-07-17T04:49:18.000Z
2022-03-31T08:11:49.000Z
#ifndef _ctypedef_h_ #define _ctypedef_h_ #include <stddef.h> // size_t/ptrdiff_t/nullptr_t/max_align_t #if defined(OS_WINDOWS) #if defined(_MSC_VER) && _MSC_VER < 1900 typedef char int8_t; typedef short int16_t; typedef int int32_t; typedef __int64 int64_t; typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; typedef unsigned __int64 uint64_t; #define PRId64 "I64d" #define PRIu64 "I64u" #define INT64_MIN (-9223372036854775807i64 - 1) #else #include <inttypes.h> #include <stdint.h> #endif #define PRIsize_t "Iu" // MSDN: Size Specification #define PRIptrdiff_t "Ix" // MSDN: Size Specification #else /* The ISO C99 standard specifies that these macros must only be defined if explicitly requested. */ #define __STDC_FORMAT_MACROS #define __STDC_LIMIT_MACROS #include <inttypes.h> #include <stdint.h> #define PRIsize_t "zu" // C99 #define PRIptrdiff_t "tx" // C99 #endif #define bool_true 1 #define bool_false 0 typedef unsigned char bool_t; #endif /* !_ctypedef_h_ */
24.111111
102
0.729954
85fd1c7b63da505906131fe43c1ebe6c6584065a
23,285
h
C
stapl_release/benchmarks/fmm/include/build_tree.h
parasol-ppl/PPL_utils
92728bb89692fda1705a0dee436592d97922a6cb
[ "BSD-3-Clause" ]
null
null
null
stapl_release/benchmarks/fmm/include/build_tree.h
parasol-ppl/PPL_utils
92728bb89692fda1705a0dee436592d97922a6cb
[ "BSD-3-Clause" ]
null
null
null
stapl_release/benchmarks/fmm/include/build_tree.h
parasol-ppl/PPL_utils
92728bb89692fda1705a0dee436592d97922a6cb
[ "BSD-3-Clause" ]
null
null
null
/* // Copyright (c) 2000-2009, Texas Engineering Experiment Station (TEES), a // component of the Texas A&M University System. // All rights reserved. // The information and source code contained herein is the exclusive // property of TEES and may not be disclosed, examined or reproduced // in whole or in part without explicit written authorization from TEES. */ #ifndef STAPL_BENCHMARKS_FMM_BUILD_TREE_H #define STAPL_BENCHMARKS_FMM_BUILD_TREE_H #include "logger.h" #include "thread.h" #include "types.h" class BuildTree { private: /// Vector of 8 integer types typedef vec<8,int> ivec8; /// Binary tree is used for counting number of bodies with a recursive /// approach. struct BinaryTreeNode { /// Number of descendant bodies ivec8 NBODY; /// Pointer to left child BinaryTreeNode * LEFT; /// Pointer to right child BinaryTreeNode * RIGHT; /// Pointer to beginning of memory space BinaryTreeNode * BEGIN; /// Pointer to end of memory space BinaryTreeNode * END; }; /// Octree is used for building the FMM tree structure as "nodes", then /// transformed to "cells" data structure. struct OctreeNode { /// Index offset for first body in node int IBODY; /// Number of descendant bodies int NBODY; /// Number of descendant nodes int NNODE; /// Pointer to child node OctreeNode * CHILD[8]; /// Coordinate at center vec3 X; }; /// Number of bodies per leaf cell const int ncrit; /// Threshold of NBODY for spawning new threads const int nspawn; /// Maximum level of tree int maxlevel; /// Iterator of first body B_iter B0; /// Pointer to octree root node OctreeNode * N0; private: /// Recursive functor for counting bodies in each octant using binary tree struct CountBodies { /// Vector of bodies Bodies & bodies; /// Body begin index int begin; /// Body end index int end; /// Coordinate of node center vec3 X; /// Pointer to binary tree node BinaryTreeNode * binNode; /// Threshold of NBODY for spawning new threads int nspawn; CountBodies(Bodies & a_bodies, int a_begin, int a_end, vec3 a_X, BinaryTreeNode * a_binNode, int a_nspawn) : bodies(a_bodies), begin(a_begin), end(a_end), X(a_X), binNode(a_binNode), nspawn(a_nspawn) { } /// Get number of binary tree nodes for a given number of bodies inline int getNumBinNode(int n) const { // If less then threshold, use only one node if (n <= nspawn) return 1; // Else estimate number of binary tree nodes else return 4 * ((n - 1) / nspawn) - 1; } void operator()() { assert(getNumBinNode(end - begin) <= binNode->END - binNode->BEGIN + 1); // If number of bodies is less than threshold if (end - begin <= nspawn) { // Initialize number of bodies in octant for (int i=0; i<8; i++) binNode->NBODY[i] = 0; // Initialize pointers to left and right child node binNode->LEFT = binNode->RIGHT = NULL; // Loop over bodies in node for (int i=begin; i<end; i++) { // Coordinates of body vec3 x = bodies[i].X; // Which octant body belongs to int octant = (x[0] > X[0]) + ((x[1] > X[1]) << 1) + ((x[2] > X[2]) << 2); // Increment body count in octant binNode->NBODY[octant]++; } } // Else if number of bodies is larger than threshold else { // Split range of bodies in half int mid = (begin + end) / 2; // Number of binary tree nodes on left branch int numLeftNode = getNumBinNode(mid - begin); // Number of binary tree nodes on right branch int numRightNode = getNumBinNode(end - mid); // Bounds checking for node count assert(numLeftNode + numRightNode <= binNode->END - binNode->BEGIN); // Assign first memory address to left node pointer binNode->LEFT = binNode->BEGIN; // Assign next memory address to left begin pointer binNode->LEFT->BEGIN = binNode->LEFT + 1; // Keep track of last memory address used by left binNode->LEFT->END = binNode->LEFT + numLeftNode; // Assign that same address to right node pointer binNode->RIGHT = binNode->LEFT->END; // Assign next memory address to right begin pointer binNode->RIGHT->BEGIN = binNode->RIGHT + 1; // Keep track of last memory address used by right binNode->RIGHT->END = binNode->RIGHT + numRightNode; // Initialize tasks mk_task_group; // Recursion for left branch CountBodies leftBranch(bodies, begin, mid, X, binNode->LEFT, nspawn); // Create new task for left branch create_taskc(leftBranch); // Recursion for right branch CountBodies rightBranch(bodies, mid, end, X, binNode->RIGHT, nspawn); // Use old task for right branch rightBranch(); // Synchronize tasks wait_tasks; // Sum contribution from both branches binNode->NBODY = binNode->LEFT->NBODY + binNode->RIGHT->NBODY; } } }; /// Recursive functor for sorting bodies according to octant (Morton order) struct MoveBodies { /// Vector of bodies Bodies & bodies; /// Buffer for bodies Bodies & buffer; /// Body begin index int begin; /// Body end index int end; /// Pointer to binary tree node BinaryTreeNode * binNode; /// Offset of octant ivec8 octantOffset; /// Coordinates of node center vec3 X; MoveBodies(Bodies & a_bodies, Bodies & a_buffer, int a_begin, int a_end, BinaryTreeNode * a_binNode, ivec8 a_octantOffset, vec3 a_X) : bodies(a_bodies), buffer(a_buffer), begin(a_begin), end(a_end), binNode(a_binNode), octantOffset(a_octantOffset), X(a_X) { } void operator()() { // If there are no more child nodes if (binNode->LEFT == NULL) { // Loop over bodies for (int i=begin; i<end; i++) { // Coordinates of body vec3 x = bodies[i].X; // Which octant body belongs to` int octant = (x[0] > X[0]) + ((x[1] > X[1]) << 1) + ((x[2] > X[2]) << 2); // Permute bodies out-of-place according to octant buffer[octantOffset[octant]] = bodies[i]; // Increment body count in octant octantOffset[octant]++; } } // Else if there are child nodes else { // Split range of bodies in half int mid = (begin + end) / 2; // Initialize tasks mk_task_group; // Recursion for left branch MoveBodies leftBranch(bodies, buffer, begin, mid, binNode->LEFT, octantOffset, X); // Create new task for left branch create_taskc(leftBranch); // Increment the octant offset for right branch octantOffset += binNode->LEFT->NBODY; // Recursion for right branch MoveBodies rightBranch(bodies, buffer, mid, end, binNode->RIGHT, octantOffset, X); // Use old task for right branch rightBranch(); // Synchronize tasks wait_tasks; } } }; /// Recursive functor for building nodes of an octree adaptively using a /// top-down approach struct BuildNodes { /// Reference to a double pointer of an octree node OctreeNode *& octNode; /// Vector of bodies Bodies & bodies; /// Buffer for bodies Bodies & buffer; /// Body begin index int begin; /// Body end index int end; /// Pointer to binary tree node BinaryTreeNode * binNode; /// Coordinate of node center vec3 X; /// Radius of root cell real_t R0; /// Number of bodies per leaf cell int ncrit; /// Threshold of NBODY for spawning new threads int nspawn; logger::Timer & timer; /// Current tree level int level; /// Direction of buffer copying bool direction; BuildNodes(OctreeNode *& a_octNode, Bodies & a_bodies, Bodies & a_buffer, int a_begin, int a_end, BinaryTreeNode * a_binNode, vec3 a_X, real_t a_R0, int a_ncrit, int a_nspawn, logger::Timer & a_timer, int a_level=0, bool a_direction=false) : octNode(a_octNode), bodies(a_bodies), buffer(a_buffer), begin(a_begin), end(a_end), binNode(a_binNode), X(a_X), R0(a_R0), ncrit(a_ncrit), nspawn(a_nspawn), timer(a_timer), level(a_level), direction(a_direction) { } /// Create an octree node OctreeNode * makeOctNode(int begin, int end, vec3 X, bool nochild) const { // Allocate memory for single node OctreeNode * octNode = new OctreeNode(); // Index of first body in node octNode->IBODY = begin; // Number of bodies in node octNode->NBODY = end - begin; // Initialize counter for decendant nodes octNode->NNODE = 1; // Center coordinates of node octNode->X = X; // If node has no children if (nochild) { // Initialize pointers to children for (int i=0; i<8; i++) octNode->CHILD[i] = NULL; } return octNode; } /// Exclusive scan with offset inline ivec8 exclusiveScan(ivec8 input, int offset) const { // Output vector ivec8 output; // Loop over elements for (int i=0; i<8; i++) { // Set value output[i] = offset; // Increment offset offset += input[i]; } // Return output vector return output; } /// Get maximum number of binary tree nodes for a given number of bodies inline int getMaxBinNode(int n) const { // Conservative estimate of number of binary tree nodes return (4 * n) / nspawn; } void operator()() { double tic = logger::get_time(); // Bounds checking for node range assert(getMaxBinNode(end - begin) <= binNode->END - binNode->BEGIN); // If no bodies are left if (begin == end) { // Assign null pointer octNode = NULL; // End buildNodes() return; } // If number of bodies is less than threshold if (end - begin <= ncrit) { // If direction of data is from bodies to buffer if (direction) // Copy bodies to buffer for (int i=begin; i<end; i++) buffer[i] = bodies[i]; // Create an octree node and assign it's pointer octNode = makeOctNode(begin, end, X, true); // End buildNodes() return; // End if for number of bodies } // Create an octree node with child nodes octNode = makeOctNode(begin, end, X, false); double toc = logger::get_time(); timer["Make node"] += toc - tic; // Instantiate recursive functor CountBodies countBodies(bodies, begin, end, X, binNode, nspawn); // Count bodies in each octant using binary recursion countBodies(); tic = logger::get_time(); timer["Count bodies"] += tic - toc; // Exclusive scan to obtain offset from octant count ivec8 octantOffset = exclusiveScan(binNode->NBODY, begin); toc = logger::get_time(); timer["Exclusive scan"] += toc - tic; // Instantiate recursive functor MoveBodies moveBodies(bodies, buffer, begin, end, binNode, octantOffset, X); // Sort bodies according to octant moveBodies(); tic = logger::get_time(); timer["Move bodies"] += tic - toc; // Initialize pointer offset for binary tree nodes BinaryTreeNode * binNodeOffset = binNode->BEGIN; // Initialize tasks mk_task_group; // Allocate new root for this branch BinaryTreeNode binNodeChild[8]; // Loop over children for (int i=0; i<8; i++) { toc = logger::get_time(); // Get maximum number of binary tree nodes int maxBinNode = getMaxBinNode(binNode->NBODY[i]); // Bounds checking for node count assert(binNodeOffset + maxBinNode <= binNode->END); // Initialize center coordinates of child node vec3 Xchild = X; // Radius of cells for child's level real_t r = R0 / (1 << (level + 1)); // Loop over dimensions for (int d=0; d<3; d++) { // Shift center coordinates to that of child node Xchild[d] += r * (((i & 1 << d) >> d) * 2 - 1); // End loop over dimensions } // Assign first memory address from offset binNodeChild[i].BEGIN = binNodeOffset; // Keep track of last memory address binNodeChild[i].END = binNodeOffset + maxBinNode; tic = logger::get_time(); timer["Get node range"] += tic - toc; // Instantiate recursive functor BuildNodes buildNodes(octNode->CHILD[i], buffer, bodies, octantOffset[i], octantOffset[i] + binNode->NBODY[i], &binNodeChild[i], Xchild, R0, ncrit, nspawn, timer, level+1, !direction); // Create new task for recursive call create_taskc(buildNodes); // Increment offset for binNode memory address binNodeOffset += maxBinNode; } // Synchronize tasks wait_tasks; // Loop over children for (int i=0; i<8; i++) { // If child exists increment child node count if (octNode->CHILD[i]) octNode->NNODE += octNode->CHILD[i]->NNODE; } } }; /// Recursive functor for creating cell data structure from nodes struct Nodes2cells { /// Pointer to octree node OctreeNode * octNode; /// Iterator of first body B_iter B0; /// Iterator of current cell C_iter C; /// Iterator of first cell C_iter C0; /// Iterator of cell counter C_iter CN; /// Coordinate of root cell center vec3 X0; /// Radius of root cell real_t R0; /// Threshold of NNODE for spawning new threads int nspawn; /// Maximum tree level int & maxlevel; /// Current tree level int level; /// Index of parent cell int iparent; Nodes2cells(OctreeNode * a_octNode, B_iter a_B0, C_iter a_C, C_iter a_C0, C_iter a_CN, vec3 a_X0, real_t a_R0, int a_nspawn, int & a_maxlevel, int a_level=0, int a_iparent=0) : octNode(a_octNode), B0(a_B0), C(a_C), C0(a_C0), CN(a_CN), X0(a_X0), R0(a_R0), nspawn(a_nspawn), maxlevel(a_maxlevel), level(a_level), iparent(a_iparent) { } /// Get cell index uint64_t getKey(vec3 X, vec3 Xmin, real_t diameter, int level) { // Initialize 3-D index int iX[3] = {0, 0, 0}; // 3-D index for (int d=0; d<3; d++) iX[d] = int((X[d] - Xmin[d]) / diameter); // Levelwise offset uint64_t index = ((1 << 3 * level) - 1) / 7; // Loop over levels for (int l=0; l<level; l++) { // Interleave bits into Morton key for (int d=0; d<3; d++) index += (iX[d] & 1) << (3 * l + d); // Bitshift 3-D index for (int d=0; d<3; d++) iX[d] >>= 1; } // Return Morton key return index; } void operator()() { // Index of parent cell C->IPARENT = iparent; // Cell radius C->R = R0 / (1 << level); // Cell center C->X = octNode->X; // Number of decendant bodies C->NBODY = octNode->NBODY; // Index of first body in cell C->IBODY = octNode->IBODY; // Iterator of first body in cell C->BODY = B0 + C->IBODY; // Get Morton key C->ICELL = getKey(C->X, X0-R0, 2*C->R, level); // If node has no children if (octNode->NNODE == 1) { // Set index of first child cell to zero C->ICHILD = 0; // Number of child cells C->NCHILD = 0; // Check for empty leaf cells assert(C->NBODY > 0); // Update maximum level of tree maxlevel = std::max(maxlevel, level); } // Else if node has children else { // Initialize number of child cells int nchild = 0; // Map of child index to octants int octants[8]; // Loop over octants for (int i=0; i<8; i++) { // If child exists for that octant if (octNode->CHILD[i]) { // Map octant to child index octants[nchild] = i; // Increment child cell counter nchild++; } } // CN points to the next free memory address C_iter Ci = CN; // Set Index of first child cell C->ICHILD = Ci - C0; // Number of child cells C->NCHILD = nchild; // Check for childless non-leaf cells assert(C->NCHILD > 0); // Increment next free memory address CN += nchild; // Initialize tasks mk_task_group; // Loop over children for (int i=0; i<nchild; i++) { // Get octant from child index int octant = octants[i]; // Instantiate recursive functor Nodes2cells nodes2cells(octNode->CHILD[octant], B0, Ci, C0, CN, X0, R0, nspawn, maxlevel, level+1, C-C0); // Spawn task if number of sub-nodes is large create_taskc_if (octNode->NNODE > nspawn, // Recursive call for each child nodes2cells); // Increment cell iterator Ci++; // Increment next free memory address CN += octNode->CHILD[octant]->NNODE - 1; } // Synchronize tasks wait_tasks; // Loop over children for (int i=0; i<nchild; i++) { // Get octant from child index int octant = octants[i]; // Free child pointer to avoid memory leak delete octNode->CHILD[octant]; } // Update maximum level of tree maxlevel = std::max(maxlevel, level+1); } } }; /// Transform Xmin & Xmax to X (center) & R (radius) Box bounds2box(Bounds bounds) { // Set local Xmin vec3 Xmin = bounds.Xmin; // Set local Xmax vec3 Xmax = bounds.Xmax; // Bounding box Box box; // Calculate center of domain for (int d=0; d<3; d++) box.X[d] = (Xmax[d] + Xmin[d]) / 2; // Initialize localRadius box.R = 0; // Loop over dimensions for (int d=0; d<3; d++) { // Calculate min distance from center box.R = std::max(box.X[d] - Xmin[d], box.R); // Calculate max distance from center box.R = std::max(Xmax[d] - box.X[d], box.R); } // Add some leeway to radius box.R *= 1.00001; // Return box.X and box.R return box; } /// Grow tree structure top down void growTree(Bodies & bodies, Bodies & buffer, Box box) { // Check for bounds validity assert(box.R > 0); // Start timer logger::startTimer("Grow tree"); // Bodies iterator B0 = bodies.begin(); // Allocate root node of binary tree BinaryTreeNode binNode[1]; // Get maximum size of binary tree int maxBinNode = (4 * bodies.size()) / nspawn; // Allocate array for binary tree nodes binNode->BEGIN = new BinaryTreeNode[maxBinNode]; // Set end pointer binNode->END = binNode->BEGIN + maxBinNode; logger::Timer timer; BuildNodes buildNodes(N0, bodies, buffer, 0, bodies.size(), // Instantiate recursive functor binNode, box.X, box.R, ncrit, nspawn, timer); // Recursively build octree nodes buildNodes(); // Deallocate binary tree array delete[] binNode->BEGIN; #if 0 //Removing the guards results in printing detailed timings of tree building logger::printTitle("Grow tree"); std::cout << std::setw(logger::stringLength) << std::left << "Make node" << " : " << timer["Make node"] << " s\n" << std::setw(logger::stringLength) << std::left << "Count bodies" << " : " << timer["Count bodies"] << " s\n" << std::setw(logger::stringLength) << std::left << "Exclusive scan" << " : " << timer["Exclusive scan"] << " s\n" << std::setw(logger::stringLength) << std::left << "Move bodies" << " : " << timer["Move bodies"] << " s\n" << std::setw(logger::stringLength) << std::left << "Get node range" << " : " << timer["Get node range"] << " s\n" << std::setw(logger::stringLength) << std::left << "Total grow tree" << " : " << timer["Make node"] + timer["Count bodies"] + timer["Exclusive scan"] + timer["Move bodies"] + timer["Get node range"] << " s" << std::endl; #endif // Stop timer logger::stopTimer("Grow tree"); } // ! Link tree structure Cells linkTree(Box box) { // Start timer logger::startTimer("Link tree"); // Initialize cell array Cells cells; // If the node tree is not empty if (N0 != NULL) { // Allocate cells array cells.resize(N0->NNODE); // Cell begin iterator C_iter C0 = cells.begin(); // Instantiate recursive functor Nodes2cells nodes2cells(N0, B0, C0, C0, C0+1, box.X, box.R, nspawn, maxlevel); // Convert nodes to cells recursively nodes2cells(); // Deallocate nodes delete N0; } // Stop timer logger::stopTimer("Link tree"); // Return cells array return cells; } public: BuildTree(int a_ncrit, int a_nspawn) : ncrit(a_ncrit), nspawn(a_nspawn), maxlevel(0) { } /// Build tree structure top down Cells buildTree(Bodies & bodies, Bounds bounds) { // Get box from bounds Box box = bounds2box(bounds); Bodies buffer(bodies.size()); std::copy(bodies.begin(),bodies.end(),buffer.begin()); // If bodies vector is empty if (bodies.empty()) { // Reinitialize N0 with NULL N0 = NULL; } // If bodies vector is not empty else { // Enlarge buffer if necessary if (bodies.size() > buffer.size()) buffer.resize(bodies.size()); // Grow tree from root growTree(bodies, buffer, box); } // Form parent-child links in tree return linkTree(box); } /// Print tree structure statistics void printTreeData(Cells & cells) { // If verbose flag is true if (logger::verbose && !cells.empty()) { // Print title logger::printTitle("Tree stats"); // Set format std::cout << std::setw(logger::stringLength) << std::left // Print number of bodies << "Bodies" << " : " << cells.front().NBODY << std::endl // Set format << std::setw(logger::stringLength) << std::left // Print number of cells << "Cells" << " : " << cells.size() << std::endl // Set format << std::setw(logger::stringLength) << std::left // Print number of levels << "Tree depth" << " : " << maxlevel << std::endl; } } }; #endif // STAPL_BENCHMARKS_FMM_BUILD_TREE_H
33.45546
79
0.575048
85116e6a1a645fe06609852c48e1ce3f5b8b04cd
1,826
h
C
board.h
Ctorum/Triforce_Chess
dc2c9f4a13be3333c40c05fa5a9f8f7695f95b75
[ "BSD-3-Clause" ]
2
2021-05-18T23:59:13.000Z
2021-05-19T15:37:17.000Z
board.h
Ctorum/Triforce_Chess
dc2c9f4a13be3333c40c05fa5a9f8f7695f95b75
[ "BSD-3-Clause" ]
1
2021-05-22T00:56:04.000Z
2021-05-22T00:56:04.000Z
board.h
Ctorum/Triforce_Chess
dc2c9f4a13be3333c40c05fa5a9f8f7695f95b75
[ "BSD-3-Clause" ]
null
null
null
#ifndef BOARD_H_ #define BOARD_H_ class Board { private: int true_check_a[8]; int true_check_b[8]; int true_check_g[8]; int true_check_h[8]; void check_a() { for (unsigned int i = 0; i < 8; i++) { if (coordinates[i] == "A%d", i) { true_check_a[i] = 1; } else { true_check_a[i] = 0; } } } void check_b() { for (unsigned int i = 8; i < 16; i++) { if (coordinates[i] == "B%d", i) { true_check_b[i-8] = 1; } else { true_check_b[i-8] = 0; } } } void check_g() { for (unsigned int i = 16; i < 24; i++) { if (coordinates[i] == "G%d", i) { true_check_g[i-16] = 1; } else { true_check_g[i-16] = 0; } } } void check_h() { for (unsigned int i = 24; i < 32; i++) { if (coordinates[i] == "H%d", i) { true_check_h[i-24] = 1; } else { true_check_h[i-24] = 0; } } } public: String coordinates[32]; Board(String x[32]); ~Board(); boolean check_to_initalize() { for (auto && i: true_check_a) { if (i == 0) { return false; } } for (auto && j: true_check_b) { if (j == 0) { return false; } } for (auto && y: true_check_g) { if (y == 0) { return false; } } for (auto && z: true_check_h) { if (z == 0) { return false; } } return true; } void set_board(String x[32]) { for (unsigned int i = 0; i < 32; i++) { coordinates[i] = x[i]; } } void get_board(String x[32]) { for (unsigned int i = 0; i < 32; i++) { Serial.println(coordinates[i]); } } }; Board::Board(String x[32]) { for (unsigned int i = 0; i < 32; i++) { coordinates[i] = x[i]; } } Board::~Board() {} #endif
18.079208
44
0.465498
e97ebe0a67b766efb2b800d8083743f8f5e8f460
3,242
c
C
firmware/greatfet_usb/usb_api_spi.c
wchill/greatfet
a76e0ccc2794686407840b11093d460a0ba29825
[ "BSD-3-Clause" ]
null
null
null
firmware/greatfet_usb/usb_api_spi.c
wchill/greatfet
a76e0ccc2794686407840b11093d460a0ba29825
[ "BSD-3-Clause" ]
null
null
null
firmware/greatfet_usb/usb_api_spi.c
wchill/greatfet
a76e0ccc2794686407840b11093d460a0ba29825
[ "BSD-3-Clause" ]
null
null
null
/* * This file is part of GreatFET */ #include "usb_api_spi.h" #include "usb_queue.h" #include <stddef.h> #include <greatfet_core.h> #include <spi_bus.h> #include <gpio_lpc.h> #include <libopencm3/lpc43xx/scu.h> #include <pins.h> uint8_t spi_buffer[256U]; /* SSP1 SSEL (CS) pin, used as GPIO so that we control * it rather than the SSP. */ static struct gpio_t gpio_spi_select = GPIO(0, 15); static spi_target_t spi1_target = { .bus = &spi_bus_ssp1, .gpio_select = &gpio_spi_select, }; void spi1_init(spi_target_t* const target) { /* configure SSP pins */ scu_pinmux(SCU_SSP1_MISO, (SCU_SSP_IO | SCU_CONF_FUNCTION5)); scu_pinmux(SCU_SSP1_MOSI, (SCU_SSP_IO | SCU_CONF_FUNCTION5)); scu_pinmux(SCU_SSP1_SCK, (SCU_SSP_IO | SCU_CONF_FUNCTION1)); scu_pinmux(SCU_SSP1_SSEL, (SCU_GPIO_FAST | SCU_CONF_FUNCTION0)); (void) target; } static spiflash_driver_t spi1_target_drv = { .target = &spi1_target, .target_init = spi1_init, }; usb_request_status_t usb_vendor_request_spi_init( usb_endpoint_t* const endpoint, const usb_transfer_stage_t stage) { static ssp_config_t local_spi_config; ssp_config_t *config; if ((stage == USB_TRANSFER_STAGE_SETUP)) { uint8_t scr = endpoint->setup.value_h; uint8_t cpsdvsr = endpoint->setup.value_l; config = (ssp_config_t *)&ssp1_config_spi; if (cpsdvsr != 0) { local_spi_config.data_bits = SSP_DATA_8BITS; local_spi_config.clock_prescale_rate = cpsdvsr; local_spi_config.serial_clock_rate = scr; config = &local_spi_config; } spi_bus_start(spi1_target_drv.target, config); spi1_init(spi1_target_drv.target); usb_transfer_schedule_ack(endpoint->in); } return USB_REQUEST_STATUS_OK; } usb_request_status_t usb_vendor_request_spi_write( usb_endpoint_t* const endpoint, const usb_transfer_stage_t stage) { if (stage == USB_TRANSFER_STAGE_SETUP) { usb_transfer_schedule_block(endpoint->out, &spi_buffer[0], endpoint->setup.length, NULL, NULL); } else if (stage == USB_TRANSFER_STAGE_DATA) { spi_bus_transfer(&spi1_target, spi_buffer, endpoint->setup.length); usb_transfer_schedule_ack(endpoint->in); } return USB_REQUEST_STATUS_OK; } usb_request_status_t usb_vendor_request_spi_read( usb_endpoint_t* const endpoint, const usb_transfer_stage_t stage) { if (stage == USB_TRANSFER_STAGE_SETUP) { usb_transfer_schedule_block(endpoint->in, &spi_buffer, endpoint->setup.length, NULL, NULL); } else if (stage == USB_TRANSFER_STAGE_DATA) { usb_transfer_schedule_ack(endpoint->out); } return USB_REQUEST_STATUS_OK; } usb_request_status_t usb_vendor_request_spi_dump_flash( usb_endpoint_t* const endpoint, const usb_transfer_stage_t stage) { uint32_t addr; if (stage == USB_TRANSFER_STAGE_SETUP) { spi1_target_drv.page_len = 256; spi1_target_drv.num_pages = 8192; spi1_target_drv.num_bytes = 256*8192; spi1_target_drv.device_id = 0x14; addr = (endpoint->setup.value << 16) | endpoint->setup.index; spiflash_read(&spi1_target_drv, addr, endpoint->setup.length, spi_buffer); usb_transfer_schedule_block(endpoint->in, &spi_buffer[0], endpoint->setup.length, NULL, NULL); } else if (stage == USB_TRANSFER_STAGE_DATA) { usb_transfer_schedule_ack(endpoint->out); } return USB_REQUEST_STATUS_OK; }
28.946429
76
0.762492
6ad8ab327d7b1aae6da42d25009fe90a41dc7925
18,225
c
C
src/dungeon/dungeon_gen.c
VirusRushTheater/pmd_test
45a931d6088a0bbb81675cca446537403a8243a7
[ "MIT" ]
null
null
null
src/dungeon/dungeon_gen.c
VirusRushTheater/pmd_test
45a931d6088a0bbb81675cca446537403a8243a7
[ "MIT" ]
null
null
null
src/dungeon/dungeon_gen.c
VirusRushTheater/pmd_test
45a931d6088a0bbb81675cca446537403a8243a7
[ "MIT" ]
null
null
null
// Copyright(c) <2015> <Purpasmart> // The MIT License // // 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. #include "dungeon/dungeon_gen.h" #include "common/rand_num.h" int xmax = 80; // 80 int ymax = 32; // 25 int xsize = 0; int ysize = 0; int objects = 0; int chanceRoom = 80; int chanceCorridor = 20; int *dungeon_map; u64 oldseed; void setCell(int x, int y, int celltype) { dungeon_map[x + xsize * y] = celltype; } int GetCell(int x, int y) { return dungeon_map[x + xsize * y]; } int getRand(int min, int max) { time_t seed; seed = time(NULL) + oldseed; oldseed = seed; srand(seed); int n = max - min + 1; int i = rand() % n; if (i < 0) i = -i; return min + i; } bool makeCorridor(int x, int y, int lenght, Direction direction) { int len = getRand(2, lenght); int floor = tileCorridor; Direction dir = North; if (direction > 0 && direction < 4) dir = direction; int xtemp = 0; int ytemp = 0; switch (dir) { case North: { if (x < 0 || x > xsize) return false; else xtemp = x; for (ytemp = y; ytemp > (y - len); ytemp--) { if (ytemp < 0 || ytemp > ysize) return false; if (GetCell(xtemp, ytemp) != tileUnused) return false; } for (ytemp = y; ytemp > (y - len); ytemp--) { setCell(xtemp, ytemp, floor); } break; } case East: { if (y < 0 || y > ysize) return false; else ytemp = y; for (xtemp = x; xtemp < (x + len); xtemp++) { if (xtemp < 0 || xtemp > xsize) return false; if (GetCell(xtemp, ytemp) != tileUnused) return false; } for (xtemp = x; xtemp < (x + len); xtemp++) { setCell(xtemp, ytemp, floor); } break; } case South: { if (x < 0 || x > xsize) return false; else xtemp = x; for (ytemp = y; ytemp < (y + len); ytemp++) { if (ytemp < 0 || ytemp > ysize) return false; if (GetCell(xtemp, ytemp) != tileUnused) return false; } for (ytemp = y; ytemp < (y + len); ytemp++) { setCell(xtemp, ytemp, floor); } break; } case West: { if (ytemp < 0 || ytemp > ysize) return false; else ytemp = y; for (xtemp = x; xtemp > (x - len); xtemp--) { if (xtemp < 0 || xtemp > xsize) return false; if (GetCell(xtemp, ytemp) != tileUnused) return false; } for (xtemp = x; xtemp > (x - len); xtemp--) { setCell(xtemp, ytemp, floor); } break; } } // woot, we're still here! let's tell the other guys we're done!! return true; } bool makeRoom(int x, int y, int xlength, int ylength, Direction direction) { // define the dimensions of the room, it should be at least 8x8 tiles (4x4 for walking on, the rest is walls) int xlen = getRand(4, xlength); int ylen = getRand(4, ylength); // the tile type it's going to be filled with int floor = tileDirtFloor; int wall = tileDirtWall; // choose the way it's pointing at Direction dir = North; if (direction > 0 && direction < 4) { dir = direction; } switch (dir) { case North: //north //Check if there's enough space left for it for (int ytemp = y; ytemp >(y - ylen); ytemp--) { if (ytemp < 0 || ytemp > ysize) return false; for (int xtemp = (x - xlen / 2); xtemp < (x + (xlen + 1) / 2); xtemp++) { if (xtemp < 0 || xtemp > xsize) return false; if (GetCell(xtemp, ytemp) != tileUnused) return false; //no space left... } } //we're still here, build for (int ytemp = y; ytemp >(y - ylen); ytemp--) { for (int xtemp = (x - xlen / 2); xtemp < (x + (xlen + 1) / 2); xtemp++) { //start with the walls if (xtemp == (x - xlen / 2)) setCell(xtemp, ytemp, wall); else if (xtemp == (x + (xlen - 1) / 2)) setCell(xtemp, ytemp, wall); else if (ytemp == y) setCell(xtemp, ytemp, wall); else if (ytemp == (y - ylen + 1)) setCell(xtemp, ytemp, wall); //and then fill with the floor else setCell(xtemp, ytemp, floor); } } break; case East: for (int ytemp = (y - ylen / 2); ytemp < (y + (ylen + 1) / 2); ytemp++) { if (ytemp < 0 || ytemp > ysize) return false; for (int xtemp = x; xtemp < (x + xlen); xtemp++) { if (xtemp < 0 || xtemp > xsize) return false; if (GetCell(xtemp, ytemp) != tileUnused) return false; } } for (int ytemp = (y - ylen / 2); ytemp < (y + (ylen + 1) / 2); ytemp++) { for (int xtemp = x; xtemp < (x + xlen); xtemp++){ if (xtemp == x) setCell(xtemp, ytemp, wall); else if (xtemp == (x + xlen - 1)) setCell(xtemp, ytemp, wall); else if (ytemp == (y - ylen / 2)) setCell(xtemp, ytemp, wall); else if (ytemp == (y + (ylen - 1) / 2)) setCell(xtemp, ytemp, wall); else setCell(xtemp, ytemp, floor); } } break; case South: for (int ytemp = y; ytemp < (y + ylen); ytemp++) { if (ytemp < 0 || ytemp > ysize) return false; for (int xtemp = (x - xlen / 2); xtemp < (x + (xlen + 1) / 2); xtemp++) { if (xtemp < 0 || xtemp > xsize) return false; if (GetCell(xtemp, ytemp) != tileUnused) return false; } } for (int ytemp = y; ytemp < (y + ylen); ytemp++) { for (int xtemp = (x - xlen / 2); xtemp < (x + (xlen + 1) / 2); xtemp++) { if (xtemp == (x - xlen / 2)) setCell(xtemp, ytemp, wall); else if (xtemp == (x + (xlen - 1) / 2)) setCell(xtemp, ytemp, wall); else if (ytemp == y) setCell(xtemp, ytemp, wall); else if (ytemp == (y + ylen - 1)) setCell(xtemp, ytemp, wall); else setCell(xtemp, ytemp, floor); } } break; case West: for (int ytemp = (y - ylen / 2); ytemp < (y + (ylen + 1) / 2); ytemp++) { if (ytemp < 0 || ytemp > ysize) return false; for (int xtemp = x; xtemp >(x - xlen); xtemp--) { if (xtemp < 0 || xtemp > xsize) return false; if (GetCell(xtemp, ytemp) != tileUnused) return false; } } for (int ytemp = (y - ylen / 2); ytemp < (y + (ylen + 1) / 2); ytemp++) { for (int xtemp = x; xtemp >(x - xlen); xtemp--) { if (xtemp == x) setCell(xtemp, ytemp, wall); else if (xtemp == (x - xlen + 1)) setCell(xtemp, ytemp, wall); else if (ytemp == (y - ylen / 2)) setCell(xtemp, ytemp, wall); else if (ytemp == (y + (ylen - 1) / 2)) setCell(xtemp, ytemp, wall); else setCell(xtemp, ytemp, floor); } } break; } //yay, all done return true; } void showDungeon() { for (int y = 0; y < ysize; y++) { for (int x = 0; x < xsize; x++) { switch (GetCell(x, y)) { case tileUnused: printf("#"); break; case tileDirtWall: printf("#"); break; case tileDirtFloor: printf("."); break; case tileStoneWall: printf("X"); break; case tileCorridor: printf("."); break; case tileDoor: printf("."); break; case tileUpStairs: printf("<"); break; case tileDownStairs: printf("."); break; case tileChest: printf("."); break; }; } //if (xsize <= xmax) printf("\n"); } } bool createDungeon(int inx, int iny, int inobj) { if (inobj < 1) objects = 10; else objects = inobj; //adjust the size of the map, if it's smaller or bigger than the limits if (inx < 3) xsize = 3; else if (inx > xmax) xsize = xmax; else xsize = inx; if (iny < 3) ysize = 3; else if (iny > ymax) ysize = ymax; else ysize = iny; //printf("%s %d\n", msgXSize, xsize); //printf("%s %d\n", msgYSize.c_str(), + ysize); //printf("%s %d\n", msgMaxObjects.c_str(), objects); //redefine the map var, so it's adjusted to our new map size // dungeon_map = new int[xsize * ysize]; dungeon_map = malloc(sizeof(int) * (xsize * ysize)); //start with making the "standard stuff" on the map for (int y = 0; y < ysize; y++) { for (int x = 0; x < xsize; x++) { //ie, making the borders of unwalkable walls if (y == 0) setCell(x, y, tileStoneWall); else if (y == ysize - 1) setCell(x, y, tileStoneWall); else if (x == 0) setCell(x, y, tileStoneWall); else if (x == xsize - 1) setCell(x, y, tileStoneWall); //and fill the rest with dirt else setCell(x, y, tileUnused); } } // And now the code of the random-map-generation-algorithm begins! //start with making a room in the middle, which we can start building upon makeRoom(xsize / 2, ysize / 2, 8, 6, getRand(0, 3)); //keep count of the number of "objects" we've made int currentFeatures = 1; //+1 for the first room we just made //then we sart the main loop for (int countingTries = 0; countingTries < 1000; countingTries++) { //check if we've reached our quota if (currentFeatures == objects) { break; } //start with a random wall int newx = 0; int xmod = 0; int newy = 0; int ymod = 0; int validTile = -1; //1000 chances to find a suitable object (room or corridor).. //(yea, i know it's kinda ugly with a for-loop... -_-') for (int testing = 0; testing < 1000; testing++) { newx = getRand(1, xsize - 1); newy = getRand(1, ysize - 1); validTile = -1; if (GetCell(newx, newy) == tileDirtWall || GetCell(newx, newy) == tileCorridor) { //check if we can reach the place if (GetCell(newx, newy + 1) == tileDirtFloor || GetCell(newx, newy + 1) == tileCorridor) { validTile = 0; // xmod = 0; ymod = -1; } else if (GetCell(newx - 1, newy) == tileDirtFloor || GetCell(newx - 1, newy) == tileCorridor) { validTile = 1; // xmod = +1; ymod = 0; } else if (GetCell(newx, newy - 1) == tileDirtFloor || GetCell(newx, newy - 1) == tileCorridor) { validTile = 2; // xmod = 0; ymod = +1; } else if (GetCell(newx + 1, newy) == tileDirtFloor || GetCell(newx + 1, newy) == tileCorridor) { validTile = 3; // xmod = -1; ymod = 0; } //check that we haven't got another door nearby, so we won't get alot of openings besides //each other if (validTile > -1) { if (GetCell(newx, newy + 1) == tileDoor) //north validTile = -1; else if (GetCell(newx - 1, newy) == tileDoor)//east validTile = -1; else if (GetCell(newx, newy - 1) == tileDoor)//south validTile = -1; else if (GetCell(newx + 1, newy) == tileDoor)//west validTile = -1; } //if we can, jump out of the loop and continue with the rest if (validTile > -1) break; } } if (validTile > -1) { //choose what to build now at our newly found place, and at what direction int feature = getRand(0, 100); if (feature <= chanceRoom) { //a new room if (makeRoom((newx + xmod), (newy + ymod), 8, 6, validTile)) { currentFeatures++; //add to our quota //then we mark the wall opening with a door setCell(newx, newy, tileDoor); //clean up infront of the door so we can reach it setCell((newx + xmod), (newy + ymod), tileDirtFloor); } } else if (feature >= chanceRoom) { //new corridor if (makeCorridor((newx + xmod), (newy + ymod), 6, validTile)) { //same thing here, add to the quota and a door currentFeatures++; setCell(newx, newy, tileDoor); } } } } /******************************************************************************* All done with the building, let's finish this one off *******************************************************************************/ //sprinkle out the bonusstuff (stairs, chests etc.) over the map int newx = 0; int newy = 0; int ways = 0; //from how many directions we can reach the random spot from int state = 0; //the state the loop is in, start with the stairs while (state != 10) { for (int testing = 0; testing < 1000; testing++) { newx = getRand(1, xsize - 1); newy = getRand(1, ysize - 2); //cheap bugfix, pulls down newy to 0<y<24, from 0<y<25 //System.out.println("x: " + newx + "\ty: " + newy); ways = 4; //the lower the better //check if we can reach the spot if (GetCell(newx, newy + 1) == tileDirtFloor || GetCell(newx, newy + 1) == tileCorridor) { //north if (GetCell(newx, newy + 1) != tileDoor) ways--; } if (GetCell(newx - 1, newy) == tileDirtFloor || GetCell(newx - 1, newy) == tileCorridor) { //east if (GetCell(newx - 1, newy) != tileDoor) ways--; } if (GetCell(newx, newy - 1) == tileDirtFloor || GetCell(newx, newy - 1) == tileCorridor) { //south if (GetCell(newx, newy - 1) != tileDoor) ways--; } if (GetCell(newx + 1, newy) == tileDirtFloor || GetCell(newx + 1, newy) == tileCorridor) { //west if (GetCell(newx + 1, newy) != tileDoor) ways--; } if (state == 0) { if (ways == 0) { //we're in state 0, let's place a "upstairs" thing setCell(newx, newy, tileUpStairs); state = 1; break; } } else if (state == 1) { if (ways == 0) { //state 1, place a "downstairs" setCell(newx, newy, tileDownStairs); state = 10; break; } } } } return true; } void dungeon_main() { int x = 80; int y = 32; int dungeon_objects = 150; dungeon_map = malloc(sizeof(int) * (x * y)); if (createDungeon(x, y, dungeon_objects)); showDungeon(); } void dungeon_free() { free(dungeon_map); }
30.274086
113
0.44631
3aaa228e5f5aed8569989aac4fa8dcb46d3518b4
1,317
c
C
d/ptalkin/items/highelfsign.c
Dbevan/SunderingShadows
6c15ec56cef43c36361899bae6dc08d0ee907304
[ "MIT" ]
13
2019-07-19T05:24:44.000Z
2021-11-18T04:08:19.000Z
d/ptalkin/items/highelfsign.c
Dbevan/SunderingShadows
6c15ec56cef43c36361899bae6dc08d0ee907304
[ "MIT" ]
4
2021-03-15T18:56:39.000Z
2021-08-17T17:08:22.000Z
d/ptalkin/items/highelfsign.c
Dbevan/SunderingShadows
6c15ec56cef43c36361899bae6dc08d0ee907304
[ "MIT" ]
13
2019-09-12T06:22:38.000Z
2022-01-31T01:15:12.000Z
#include <std.h> inherit OBJECT; void create() { ::create(); set_name("sign"); set_short("%^ORANGE%^a wooden sign"); set_long("%^ORANGE%^The sign is a highly polished one with words carved into it. Someone has take a great deal of time and effort. Maybe you should read it."); set_weight (1000); set_value (0); } void init () { ::init (); add_action("read", "read"); } int read(string str) { if(str!="sign") return 0; write("%^ORANGE%^You have reached the Ptalkin Forest. All are welcome here as long as they respect the land. The first area you will travel through is the Grasslands. The High Elves make their homes here, but they can be found travelling all through the area. The high elf is the most commonly seen of the elves. They are open and friendly. Most high elves are pale as their skin simply does not tan. Their hair is fair and their eyes blue, or they many have dark hair and green eyes. The high elves prefer light pastel shades and often wear a travelling cloak in deep green as they rely on hunting and woodmanship. Their preferred weapon is the bow, but they are also adept with long and short swords. Freedom, nature and the sheer viatality of being alive comprimise the daily existence of a high elf.", TP); tell_room(environment(TP), TPQCN+" reads the wooden sign", TP); return 1; }
48.777778
491
0.743356
5c870880d6ff2a0f3bb9b344ce07b2d14f405ec3
3,904
h
C
src/humblenet/humblepeer/humblepeer.h
kosmigramma/HumbleNet
368de8d66ad31b91d0f97a413db6eab7f0c33e3a
[ "BSD-3-Clause" ]
598
2017-06-29T17:02:45.000Z
2022-03-22T16:57:13.000Z
src/humblenet/humblepeer/humblepeer.h
kosmigramma/HumbleNet
368de8d66ad31b91d0f97a413db6eab7f0c33e3a
[ "BSD-3-Clause" ]
26
2017-07-22T20:30:06.000Z
2021-08-03T08:16:59.000Z
src/humblenet/humblepeer/humblepeer.h
kosmigramma/HumbleNet
368de8d66ad31b91d0f97a413db6eab7f0c33e3a
[ "BSD-3-Clause" ]
54
2017-06-30T03:40:56.000Z
2021-12-16T11:28:33.000Z
#ifndef HUMBLEPEER_H #define HUMBLEPEER_H // HumbleNet internal, do not include #include <string> #include <unordered_map> #include <unordered_set> #include <vector> #include <map> #include "humblepeer_generated.h" #ifdef __GNUC__ #define WARN_UNUSED_RESULT __attribute__ ((warn_unused_result)) #else #define WARN_UNUSED_RESULT #endif namespace humblenet { // Ice Server definition struct ICEServer { HumblePeer::ICEServerType type; std::string server; std::string username; std::string password; ICEServer(const std::string& _server) : type(HumblePeer::ICEServerType::STUNServer), server(_server) {} ICEServer(const std::string& _server, const std::string& _username, const std::string& _password) : type(HumblePeer::ICEServerType::TURNServer), server(_server), username(_username), password(_password) {} }; // abstract type for P2P signaling connection // we could use C++ classes and inheritance // but since there's only ever one type of connection in any binary // we opt for static dispatch instead struct P2PSignalConnection; ha_bool sendP2PMessage(P2PSignalConnection *conn, const uint8_t *buff, size_t length) WARN_UNUSED_RESULT; /* P2POffer contains PeerID client->server who want to connect to server->client who wants to connect to us connectionOffer generated by the browser (stringified JSON) P2PAnswer contains PeerID connectionOffer generated by the other browser (also str JSON) HelloServer auth token which allows server to look up client details in database HelloClient PeerID this is who you are IP address? https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Architecture/Connectivity peer1 server peer2 P2POffer -> P2POffer -> <- P2PAnswer <- P2PAnswer ICECandidate -> ICECandidate -> <- ICECandidate <- ICECandidate */ typedef ha_bool(*ProcessMsgFunc) (const HumblePeer::Message* msg, void *data); /* returns true if all went wel false if something is wrong, sync is lost and channel should be closed TODO: should this be a tristate (process, noprocess, error)? does anyone care if progress happened or not? */ ha_bool parseMessage(std::vector<uint8_t> &recvBuf, ProcessMsgFunc processFunc, void *user_data); // Peer server connection ha_bool sendHelloServer(humblenet::P2PSignalConnection *conn, uint8_t flags, const std::string& gametoken, const std::string& gamesecret, const std::string& authToken, const std::string& reconnectToken, const std::map<std::string, std::string>& attributes); ha_bool sendHelloClient(humblenet::P2PSignalConnection *conn, PeerId peerId, const std::string& reconnectToken, const std::vector<ICEServer>& iceServers); // P2P Handling ha_bool sendNoSuchPeer(humblenet::P2PSignalConnection *conn, PeerId peerId); ha_bool sendPeerRefused(humblenet::P2PSignalConnection *conn, PeerId peerId); ha_bool sendP2PConnect(P2PSignalConnection *conn, PeerId peerId, uint8_t flags, const char* offer); ha_bool sendP2PResponse(P2PSignalConnection *conn, PeerId peerId, const char* offer); ha_bool sendICECandidate(humblenet::P2PSignalConnection *conn, PeerId peerId, const char* offer); ha_bool sendP2PDisconnect(humblenet::P2PSignalConnection *conn, PeerId peer); ha_bool sendP2PRelayData(humblenet::P2PSignalConnection *conn, PeerId peer, const void* data, uint16_t length); // Name Alias ha_bool sendAliasRegister(P2PSignalConnection *conn, const std::string& alias); ha_bool sendAliasUnregister(P2PSignalConnection *conn, const std::string& alias); ha_bool sendAliasLookup(P2PSignalConnection *conn, const std::string& alias); ha_bool sendAliasResolved(P2PSignalConnection *conn, const std::string& alias, PeerId peer); } // namespace humblenet #endif // HUMBLEPEER_H
32.806723
112
0.742572
388c99a4ca39618a82579ed74f8020e7bfe3a0aa
130
h
C
vex/include/avl_tostr.h
AdvancedVEXLibrary/Advanced-VEX-Library
514f92f10c1f4b2c8ba72369116b25e05db9e979
[ "Apache-2.0" ]
8
2019-05-23T08:50:14.000Z
2020-02-21T15:13:00.000Z
vex/include/avl_tostr.h
AdvancedVEXLibrary/Advanced-VEX-Library
514f92f10c1f4b2c8ba72369116b25e05db9e979
[ "Apache-2.0" ]
40
2018-10-01T04:57:08.000Z
2019-04-08T19:56:08.000Z
vex/include/avl_tostr.h
anvdev/Advanced-VEX-Library
514f92f10c1f4b2c8ba72369116b25e05db9e979
[ "Apache-2.0" ]
2
2019-05-23T08:50:19.000Z
2020-02-13T15:20:06.000Z
#pragma once #ifndef _AVL_TOSTR_H_ #define _AVL_TOSTR_H_ #define avl_tostr(VALUE) sprintf('%g', VALUE) #endif // _AVL_TOSTR_H_
16.25
45
0.761538
8de23669c8b800d8fdd3dd2f2e230179c91b8889
4,992
h
C
aws-cpp-sdk-greengrass/include/aws/greengrass/model/GroupCertificateAuthorityProperties.h
ploki/aws-sdk-cpp
17074e3e48c7411f81294e2ee9b1550c4dde842c
[ "Apache-2.0" ]
2
2019-03-11T15:50:55.000Z
2020-02-27T11:40:27.000Z
aws-cpp-sdk-greengrass/include/aws/greengrass/model/GroupCertificateAuthorityProperties.h
ploki/aws-sdk-cpp
17074e3e48c7411f81294e2ee9b1550c4dde842c
[ "Apache-2.0" ]
null
null
null
aws-cpp-sdk-greengrass/include/aws/greengrass/model/GroupCertificateAuthorityProperties.h
ploki/aws-sdk-cpp
17074e3e48c7411f81294e2ee9b1550c4dde842c
[ "Apache-2.0" ]
1
2019-01-18T13:03:55.000Z
2019-01-18T13:03:55.000Z
/* * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #pragma once #include <aws/greengrass/Greengrass_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace Greengrass { namespace Model { /** * Information about a certificate authority for a group.<p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GroupCertificateAuthorityProperties">AWS * API Reference</a></p> */ class AWS_GREENGRASS_API GroupCertificateAuthorityProperties { public: GroupCertificateAuthorityProperties(); GroupCertificateAuthorityProperties(Aws::Utils::Json::JsonView jsonValue); GroupCertificateAuthorityProperties& operator=(Aws::Utils::Json::JsonView jsonValue); Aws::Utils::Json::JsonValue Jsonize() const; /** * The ARN of the certificate authority for the group. */ inline const Aws::String& GetGroupCertificateAuthorityArn() const{ return m_groupCertificateAuthorityArn; } /** * The ARN of the certificate authority for the group. */ inline void SetGroupCertificateAuthorityArn(const Aws::String& value) { m_groupCertificateAuthorityArnHasBeenSet = true; m_groupCertificateAuthorityArn = value; } /** * The ARN of the certificate authority for the group. */ inline void SetGroupCertificateAuthorityArn(Aws::String&& value) { m_groupCertificateAuthorityArnHasBeenSet = true; m_groupCertificateAuthorityArn = std::move(value); } /** * The ARN of the certificate authority for the group. */ inline void SetGroupCertificateAuthorityArn(const char* value) { m_groupCertificateAuthorityArnHasBeenSet = true; m_groupCertificateAuthorityArn.assign(value); } /** * The ARN of the certificate authority for the group. */ inline GroupCertificateAuthorityProperties& WithGroupCertificateAuthorityArn(const Aws::String& value) { SetGroupCertificateAuthorityArn(value); return *this;} /** * The ARN of the certificate authority for the group. */ inline GroupCertificateAuthorityProperties& WithGroupCertificateAuthorityArn(Aws::String&& value) { SetGroupCertificateAuthorityArn(std::move(value)); return *this;} /** * The ARN of the certificate authority for the group. */ inline GroupCertificateAuthorityProperties& WithGroupCertificateAuthorityArn(const char* value) { SetGroupCertificateAuthorityArn(value); return *this;} /** * The ID of the certificate authority for the group. */ inline const Aws::String& GetGroupCertificateAuthorityId() const{ return m_groupCertificateAuthorityId; } /** * The ID of the certificate authority for the group. */ inline void SetGroupCertificateAuthorityId(const Aws::String& value) { m_groupCertificateAuthorityIdHasBeenSet = true; m_groupCertificateAuthorityId = value; } /** * The ID of the certificate authority for the group. */ inline void SetGroupCertificateAuthorityId(Aws::String&& value) { m_groupCertificateAuthorityIdHasBeenSet = true; m_groupCertificateAuthorityId = std::move(value); } /** * The ID of the certificate authority for the group. */ inline void SetGroupCertificateAuthorityId(const char* value) { m_groupCertificateAuthorityIdHasBeenSet = true; m_groupCertificateAuthorityId.assign(value); } /** * The ID of the certificate authority for the group. */ inline GroupCertificateAuthorityProperties& WithGroupCertificateAuthorityId(const Aws::String& value) { SetGroupCertificateAuthorityId(value); return *this;} /** * The ID of the certificate authority for the group. */ inline GroupCertificateAuthorityProperties& WithGroupCertificateAuthorityId(Aws::String&& value) { SetGroupCertificateAuthorityId(std::move(value)); return *this;} /** * The ID of the certificate authority for the group. */ inline GroupCertificateAuthorityProperties& WithGroupCertificateAuthorityId(const char* value) { SetGroupCertificateAuthorityId(value); return *this;} private: Aws::String m_groupCertificateAuthorityArn; bool m_groupCertificateAuthorityArnHasBeenSet; Aws::String m_groupCertificateAuthorityId; bool m_groupCertificateAuthorityIdHasBeenSet; }; } // namespace Model } // namespace Greengrass } // namespace Aws
37.533835
172
0.74379
cee254302bcee95bd84f84ef03baa1b79699a0e0
2,531
c
C
lib/proto/err.c
38/plumber
30fead11cddd6352025dcac0c16065172744c0f9
[ "BSD-2-Clause" ]
39
2017-05-22T04:23:41.000Z
2021-11-15T20:19:20.000Z
lib/proto/err.c
38/plumber
30fead11cddd6352025dcac0c16065172744c0f9
[ "BSD-2-Clause" ]
10
2017-05-27T14:36:11.000Z
2018-04-26T20:46:51.000Z
lib/proto/err.c
38/plumber
30fead11cddd6352025dcac0c16065172744c0f9
[ "BSD-2-Clause" ]
2
2017-06-09T21:36:51.000Z
2019-01-27T01:30:58.000Z
/** * Copyright (C) 2017, Hao Hou **/ #include <stdint.h> #include <stdlib.h> #include <string.h> #include <stdio.h> #include <errno.h> #include <utils/static_assertion.h> #include <proto/err.h> /** * @brief error description of error code **/ static char* _err_desc[] = { [PROTO_ERR_CODE_ALLOC] = "Allocate memory error", [PROTO_ERR_CODE_OPEN] = "Open file error", [PROTO_ERR_CODE_READ] = "Read file error", [PROTO_ERR_CODE_WRITE] = "Write file error", [PROTO_ERR_CODE_FORMAT] = "File format error", [PROTO_ERR_CODE_FILEOP] = "File operation error", [PROTO_ERR_CODE_ARGUMENT] = "Invalid arguemnts", [PROTO_ERR_CODE_FAIL] = "Secondary error", [PROTO_ERR_CODE_DISALLOWED] = "Not allowed", [PROTO_ERR_CODE_NOT_FOUND] = "Type not found", [PROTO_ERR_CODE_CIRULAR_DEP] = "Cirular dependency in protodb", [PROTO_ERR_CODE_NAME_EXPR] = "Invalid name expression", [PROTO_ERR_CODE_BUG] = "Code bug!", [PROTO_ERR_CODE_UNDEFINED] = "Undefined symbol", [PROTO_ERR_CODE_DIM] = "Dimensional error", [PROTO_ERR_CODE_OUT_OF_BOUND] = "Index out of boundary", [PROTO_ERR_CODE_VERSION] = "Unsupported version" }; STATIC_ASSERTION_FIRST(proto_err_t, child); /** * @brief the thread local state that is used to tracking the error code **/ static __thread proto_err_t* _stack = NULL; const proto_err_t* proto_err_stack() { return _stack; } void proto_err_clear() { for(;NULL != _stack;) { proto_err_t* next = *(proto_err_t**)_stack; free(_stack); _stack = next; } } void proto_err_raise(proto_err_code_t code, uint32_t line, const char* file) { proto_err_t* err = (proto_err_t*)malloc(sizeof(proto_err_t)); if(NULL == err) fprintf(stderr, "Cannot allocate memory for error info: %s", strerror(errno)); err->code = code; err->line = line; err->file = file; err->errnum = _stack == NULL ? errno : 0; err->child = _stack; _stack = err; } const char* proto_err_str(const proto_err_t* error, char* buffer, size_t bufsize) { if(NULL == error || NULL == buffer || error->code >= PROTO_ERR_CODE_COUNT) return NULL; if(error->errnum != 0) snprintf(buffer, bufsize, "%s: %s (line: %d, file: %s)", _err_desc[error->code], strerror(error->errnum), error->line, error->file == NULL ? "unknown" : error->file); else snprintf(buffer, bufsize, "%s (line: %d, file: %s)", _err_desc[error->code], error->line, error->file == NULL ? "unknown" : error->file); return buffer; }
28.438202
95
0.66693
dbbbaf4ed434b0943c05100238347cb092e20466
228
h
C
YBL365/Class/Profile/Section3/MyJoin/OrderMMMyDeposit/ViewModel/YBLOrderMMMyDepositViewModel.h
740326093/-
160c85a4e5e4c1ecaae951782b98a2e831119108
[ "MIT" ]
313
2017-09-25T04:10:27.000Z
2022-01-31T22:18:51.000Z
YBL365/Class/Profile/Section3/MyJoin/OrderMMMyDeposit/ViewModel/YBLOrderMMMyDepositViewModel.h
740326093/-
160c85a4e5e4c1ecaae951782b98a2e831119108
[ "MIT" ]
17
2017-09-26T03:16:23.000Z
2020-12-07T16:01:49.000Z
YBL365/Class/Profile/Section3/MyJoin/OrderMMMyDeposit/ViewModel/YBLOrderMMMyDepositViewModel.h
740326093/-
160c85a4e5e4c1ecaae951782b98a2e831119108
[ "MIT" ]
158
2017-09-25T06:55:34.000Z
2021-04-12T07:16:57.000Z
// // YBLOrderMMMyDepositViewModel.h // YBL365 // // Created by 乔同新 on 2017/1/7. // Copyright © 2017年 乔同新. All rights reserved. // #import <Foundation/Foundation.h> @interface YBLOrderMMMyDepositViewModel : NSObject @end
16.285714
50
0.719298
4bd638804fceda0221f4da67b9fb01136a70e140
53,335
c
C
Platform Software/myriad/apps/OpenCV_examples/leon/main.c
EyesOfThings/Software
8932c2bf78c729c285853e51c8875a863496b561
[ "MIT" ]
38
2016-06-08T19:47:43.000Z
2021-07-02T15:14:13.000Z
Platform Software/myriad/apps/OpenCV_examples/leon/main.c
MAVProxyUser/Software
8932c2bf78c729c285853e51c8875a863496b561
[ "MIT" ]
3
2017-07-24T03:41:53.000Z
2021-02-23T16:48:05.000Z
Platform Software/myriad/apps/OpenCV_examples/leon/main.c
MAVProxyUser/Software
8932c2bf78c729c285853e51c8875a863496b561
[ "MIT" ]
18
2016-02-18T08:34:17.000Z
2021-07-11T17:57:28.000Z
#include <stdlib.h> #include <stdio.h> #include <string.h> #include <errno.h> #include <rtems.h> #include <semaphore.h> #include <pthread.h> #include <sched.h> #include <fcntl.h> #include <mv_types.h> #include <rtems/cpuuse.h> #include <bsp.h> #include "rtems_config.h" //#include "WifiFunctions.h" //#include "PulgaMQTTBrokerControl.h" #include <SDCardIO.h> #include <cv.h> #include <highgui.h> #include <math.h> // 2: Source Specific #defines and types (typedef, enum, struct) // ---------------------------------------------------------------------------- // 3: Global Data (Only if absolutely necessary) // ---------------------------------------------------------------------------- static int rc1; static pthread_t thread1; static sem_t sem; // 4: Static Local Data // ---------------------------------------------------------------------------- void *mainFunction(void *arg); // 5: Static Function Prototypes // ---------------------------------------------------------------------------- // 6: Functions Implementation // ---------------------------------------------------------------------------- void POSIX_Init (void *args) { int result; pthread_attr_t attr; initClocksAndMemory(); printk ("\n"); printk ("RTEMS connectToAP started\n"); /* initialise variables */ if(pthread_attr_init(&attr) !=0) { printk("pthread_attr_init error"); } if(pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED) != 0) { printk("pthread_attr_setinheritsched error"); } if(pthread_attr_setschedpolicy(&attr, SCHED_RR) != 0) { printk("pthread_attr_setschedpolicy error"); } if(sem_init(&sem, 0, 0) == -1) { printk("sem_init error\n"); } if ((rc1=pthread_create(&thread1, &attr, &mainFunction, NULL))) { printk("Thread 1 creation failed: %d\n", rc1); } else { printk("Thread 1 created\n"); } // wait for thread to finish result = pthread_join( thread1, NULL); if(result != 0) { printk("pthread_join error (%d)!\n", result); } exit(0); return; } void myassert(int a, int b){ if(a==b){ printf("Test passed: OK\n"); }else{ printf("Test passed: Error\n"); } } // edge.c int testCanny(char* src, char* dst){ IplImage* image = cvLoadImage("/mnt/sdcard/OpenCVTests/data/nature.png",CV_LOAD_IMAGE_COLOR); if(!image) return -1; // Create the output image IplImage* cedge = cvCreateImage(cvSize(image->width,image->height), IPL_DEPTH_8U, 3); cvShowImage("Canny", image); // Convert to grayscale IplImage* gray = cvCreateImage(cvSize(image->width,image->height), IPL_DEPTH_8U, 1); IplImage* edge = cvCreateImage(cvSize(image->width,image->height), IPL_DEPTH_8U, 1); cvCvtColor(image, gray, CV_BGR2GRAY); cvSmooth( gray, edge, CV_BLUR, 3, 3, 0, 0 ); cvNot( gray, edge ); // Run the edge detector on grayscale int edge_thresh = 1; cvCanny(gray, edge, (float)edge_thresh, (float)edge_thresh*3, 3); cvZero( cedge ); // copy edge points cvCopy( image, cedge, edge ); int res = cvSaveImage("/mnt/sdcard/OpenCVTests/results/resultEdge.png", cedge); if(res<=0) return -1; // Wait for a key stroke; the same function arranges events processing cvReleaseImage(&image); cvReleaseImage(&gray); cvReleaseImage(&edge); return 0; } //delaunay.c /* the script demostrates iterative construction of delaunay triangulation and voronoi tesselation */ CvSubdiv2D* init_delaunay( CvMemStorage* storage, CvRect rect ) { CvSubdiv2D* subdiv; subdiv = cvCreateSubdiv2D( CV_SEQ_KIND_SUBDIV2D, sizeof(*subdiv), sizeof(CvSubdiv2DPoint), sizeof(CvQuadEdge2D), storage ); cvInitSubdivDelaunay2D( subdiv, rect ); return subdiv; } void draw_subdiv_point( IplImage* img, CvPoint2D32f fp, CvScalar color ) { cvCircle( img, cvPoint(cvRound(fp.x), cvRound(fp.y)), 3, color, CV_FILLED, 8, 0 ); } void draw_subdiv_edge( IplImage* img, CvSubdiv2DEdge edge, CvScalar color ) { CvSubdiv2DPoint* org_pt; CvSubdiv2DPoint* dst_pt; CvPoint2D32f org; CvPoint2D32f dst; CvPoint iorg, idst; org_pt = cvSubdiv2DEdgeOrg(edge); dst_pt = cvSubdiv2DEdgeDst(edge); if( org_pt && dst_pt ) { org = org_pt->pt; dst = dst_pt->pt; iorg = cvPoint( cvRound( org.x ), cvRound( org.y )); idst = cvPoint( cvRound( dst.x ), cvRound( dst.y )); cvLine( img, iorg, idst, color, 1, CV_AA, 0 ); } } void draw_subdiv( IplImage* img, CvSubdiv2D* subdiv, CvScalar delaunay_color, CvScalar voronoi_color ) { CvSeqReader reader; int i, total = subdiv->edges->total; int elem_size = subdiv->edges->elem_size; cvStartReadSeq( (CvSeq*)(subdiv->edges), &reader, 0 ); for( i = 0; i < total; i++ ) { CvQuadEdge2D* edge = (CvQuadEdge2D*)(reader.ptr); if( CV_IS_SET_ELEM( edge )) { draw_subdiv_edge( img, (CvSubdiv2DEdge)edge + 1, voronoi_color ); draw_subdiv_edge( img, (CvSubdiv2DEdge)edge, delaunay_color ); } CV_NEXT_SEQ_ELEM( elem_size, reader ); } } void locate_point( CvSubdiv2D* subdiv, CvPoint2D32f fp, IplImage* img, CvScalar active_color ) { CvSubdiv2DEdge e; CvSubdiv2DEdge e0 = 0; CvSubdiv2DPoint* p = 0; cvSubdiv2DLocate( subdiv, fp, &e0, &p ); if( e0 ) { e = e0; do { draw_subdiv_edge( img, e, active_color ); e = cvSubdiv2DGetEdge(e,CV_NEXT_AROUND_LEFT); } while( e != e0 ); } draw_subdiv_point( img, fp, active_color ); } void draw_subdiv_facet( IplImage* img, CvSubdiv2DEdge edge ) { CvSubdiv2DEdge t = edge; int i, count = 0; CvPoint* buf = 0; // count number of edges in facet do { count++; t = cvSubdiv2DGetEdge( t, CV_NEXT_AROUND_LEFT ); } while (t != edge ); buf = (CvPoint*)malloc( count * sizeof(buf[0])); // gather points t = edge; for( i = 0; i < count; i++ ) { CvSubdiv2DPoint* pt = cvSubdiv2DEdgeOrg( t ); if( !pt ) break; buf[i] = cvPoint( cvRound(pt->pt.x), cvRound(pt->pt.y)); t = cvSubdiv2DGetEdge( t, CV_NEXT_AROUND_LEFT ); } if( i == count ) { CvSubdiv2DPoint* pt = cvSubdiv2DEdgeDst( cvSubdiv2DRotateEdge( edge, 1 )); cvFillConvexPoly( img, buf, count, CV_RGB(rand()&255,rand()&255,rand()&255), CV_AA, 0 ); cvPolyLine( img, &buf, &count, 1, 1, CV_RGB(0,0,0), 1, CV_AA, 0); draw_subdiv_point( img, pt->pt, CV_RGB(0,0,0)); } free( buf ); } void paint_voronoi( CvSubdiv2D* subdiv, IplImage* img ) { CvSeqReader reader; int i, total = subdiv->edges->total; int elem_size = subdiv->edges->elem_size; cvCalcSubdivVoronoi2D( subdiv ); cvStartReadSeq( (CvSeq*)(subdiv->edges), &reader, 0 ); for( i = 0; i < total; i++ ) { CvQuadEdge2D* edge = (CvQuadEdge2D*)(reader.ptr); if( CV_IS_SET_ELEM( edge )) { CvSubdiv2DEdge e = (CvSubdiv2DEdge)edge; // left draw_subdiv_facet( img, cvSubdiv2DRotateEdge( e, 1 )); // right draw_subdiv_facet( img, cvSubdiv2DRotateEdge( e, 3 )); } CV_NEXT_SEQ_ELEM( elem_size, reader ); } } int delaunay(void) { int i; CvRect rect = { 0, 0, 600, 600 }; CvMemStorage* storage; CvSubdiv2D* subdiv; IplImage* img; CvScalar active_facet_color, delaunay_color, voronoi_color, bkgnd_color; active_facet_color = CV_RGB( 255, 0, 0 ); delaunay_color = CV_RGB( 0,0,0); voronoi_color = CV_RGB(0, 180, 0); bkgnd_color = CV_RGB(255,255,255); img = cvCreateImage( cvSize(rect.width,rect.height), 8, 3 ); cvSet( img, bkgnd_color, 0 ); storage = cvCreateMemStorage(0); subdiv = init_delaunay( storage, rect ); //printf("Delaunay triangulation...\n"); for( i = 0; i < 3; i++ ) { CvPoint2D32f fp = cvPoint2D32f( (float)(rand()%(rect.width-10)+5), (float)(rand()%(rect.height-10)+5)); locate_point( subdiv, fp, img, active_facet_color ); char* file = (char*)malloc(150*sizeof(char)); sprintf(file,"/mnt/sdcard/OpenCVTests/results/delaunay/delaunay%d.png",i); int res1 = cvSaveImage(file, img); if(res1<=0) return -1; cvSubdivDelaunay2DInsert( subdiv, fp ); cvCalcSubdivVoronoi2D( subdiv ); cvSet( img, bkgnd_color, 0 ); draw_subdiv( img, subdiv, delaunay_color, voronoi_color ); sprintf(file,"/mnt/sdcard/OpenCVTests/results/delaunay/delaunay%d_s.png",i); res1 = cvSaveImage(file, img); if(res1<=0) return -1; } cvSet( img, bkgnd_color, 0 ); paint_voronoi( subdiv, img ); int res1 = cvSaveImage("/mnt/sdcard/OpenCVTests/results/delaunay/voronoi.png", img); if(res1<=0) return -1; cvReleaseMemStorage( &storage ); cvReleaseImage(&img); return 0; } int testFaceDetectHaarCascade(char* src, char* cascade_name, char* dst){ IplImage* img = cvLoadImage(src, 1); CvMemStorage* storage = 0; CvHaarClassifierCascade* cascade = 0; cascade = (CvHaarClassifierCascade*)cvLoad( cascade_name, storage, 0, 0); storage = cvCreateMemStorage(0); static CvScalar colors[] = { {{0,0,255}}, {{0,128,255}}, {{0,255,255}}, {{0,255,0}}, {{255,128,0}}, {{255,255,0}}, {{255,0,0}}, {{255,0,255}} }; double scale = 1.3; IplImage* gray = cvCreateImage( cvSize(img->width,img->height), 8, 1 ); IplImage* small_img = cvCreateImage( cvSize( cvRound (img->width/scale), cvRound (img->height/scale)), 8, 1 ); int i; cvCvtColor( img, gray, CV_BGR2GRAY ); cvResize( gray, small_img, CV_INTER_LINEAR ); cvEqualizeHist( small_img, small_img ); cvClearMemStorage( storage ); if( cascade ) { //double t = (double)cvGetTickCount(); CvSeq* faces = cvHaarDetectObjects( small_img, cascade, storage, 1.1, 2, 0/*CV_HAAR_DO_CANNY_PRUNING*/, cvSize(30, 30) ); //t = (double)cvGetTickCount() - t; //printf( "detection time = %gms\n", t/((double)cvGetTickFrequency()*1000.) ); for( i = 0; i < (faces ? faces->total : 0); i++ ) { CvRect* r = (CvRect*)cvGetSeqElem( faces, i ); CvPoint center; int radius; center.x = cvRound((r->x + r->width*0.5)*scale); center.y = cvRound((r->y + r->height*0.5)*scale); radius = cvRound((r->width + r->height)*0.25*scale); cvCircle( img, center, radius, colors[i%8], 3, 8, 0 ); } } //cvShowImage( "result", img ); int res = cvSaveImage(dst, img); if(res<=0) return -1; cvReleaseImage( &gray ); cvReleaseImage( &small_img ); cvReleaseImage(&img); return 0; } // kmeans.c int testKmeans(char* dst){ #define MAX_CLUSTERS 5 CvScalar color_tab[MAX_CLUSTERS]; IplImage* img = cvCreateImage( cvSize( 500, 500 ), 8, 3 ); CvRNG rng = cvRNG(-1); CvPoint ipt; color_tab[0] = CV_RGB(255,0,0); color_tab[1] = CV_RGB(0,255,0); color_tab[2] = CV_RGB(100,100,255); color_tab[3] = CV_RGB(255,0,255); color_tab[4] = CV_RGB(255,255,0); //cvNamedWindow( "clusters", 1 ); char key; int k, cluster_count = cvRandInt(&rng)%MAX_CLUSTERS + 1; int i, sample_count = cvRandInt(&rng)%1000 + 1; CvMat* points = cvCreateMat( sample_count, 1, CV_32FC2 ); CvMat* clusters = cvCreateMat( sample_count, 1, CV_32SC1 ); /* generate random sample from multigaussian distribution */ for( k = 0; k < cluster_count; k++ ) { CvPoint center; CvMat point_chunk; center.x = cvRandInt(&rng)%img->width; center.y = cvRandInt(&rng)%img->height; cvGetRows( points, &point_chunk, k*sample_count/cluster_count, k == cluster_count - 1 ? sample_count : (k+1)*sample_count/cluster_count, 1 ); cvRandArr( &rng, &point_chunk, CV_RAND_NORMAL, cvScalar(center.x,center.y,0,0), cvScalar(img->width*0.1,img->height*0.1,0,0)); } /* shuffle samples */ for( i = 0; i < sample_count/2; i++ ) { CvPoint2D32f* pt1 = (CvPoint2D32f*)points->data.fl + cvRandInt(&rng)%sample_count; CvPoint2D32f* pt2 = (CvPoint2D32f*)points->data.fl + cvRandInt(&rng)%sample_count; CvPoint2D32f temp; CV_SWAP( *pt1, *pt2, temp ); } cvKMeans2( points, cluster_count, clusters, cvTermCriteria( CV_TERMCRIT_EPS+CV_TERMCRIT_ITER, 10, 1.0 )); cvZero( img ); for( i = 0; i < sample_count; i++ ) { int cluster_idx = clusters->data.i[i]; ipt.x = (int)points->data.fl[i*2]; ipt.y = (int)points->data.fl[i*2+1]; cvCircle( img, ipt, 2, color_tab[cluster_idx], CV_FILLED, CV_AA, 0 ); } cvReleaseMat( &points ); cvReleaseMat( &clusters ); int res = cvSaveImage(dst, img); //cvShowImage( "clusters", img ); //key = (char) cvWaitKey(0); //if( key == 27 || key == 'q' || key == 'Q' ) // 'ESC' // break; //cvDestroyWindow( "clusters" ); return 0; } // contours.c int testContours(char* pic, char* pic_contours){ int levels = 3; CvSeq* contours = 0; int i, j; CvMemStorage* storage = cvCreateMemStorage(0); IplImage* img = cvCreateImage( cvSize(500,500), 8, 1 ); cvZero( img ); for( i=0; i < 6; i++ ) { int dx = (i%2)*250 - 30; int dy = (i/2)*150; CvScalar white = cvRealScalar(255); CvScalar black = cvRealScalar(0); if( i == 0 ) { for( j = 0; j <= 10; j++ ) { double angle = (j+5)*CV_PI/21; cvLine(img, cvPoint(cvRound(dx+100+j*10-80*cos(angle)), cvRound(dy+100-90*sin(angle))), cvPoint(cvRound(dx+100+j*10-30*cos(angle)), cvRound(dy+100-30*sin(angle))), white, 1, 8, 0); } } cvEllipse( img, cvPoint(dx+150, dy+100), cvSize(100,70), 0, 0, 360, white, -1, 8, 0 ); cvEllipse( img, cvPoint(dx+115, dy+70), cvSize(30,20), 0, 0, 360, black, -1, 8, 0 ); cvEllipse( img, cvPoint(dx+185, dy+70), cvSize(30,20), 0, 0, 360, black, -1, 8, 0 ); cvEllipse( img, cvPoint(dx+115, dy+70), cvSize(15,15), 0, 0, 360, white, -1, 8, 0 ); cvEllipse( img, cvPoint(dx+185, dy+70), cvSize(15,15), 0, 0, 360, white, -1, 8, 0 ); cvEllipse( img, cvPoint(dx+115, dy+70), cvSize(5,5), 0, 0, 360, black, -1, 8, 0 ); cvEllipse( img, cvPoint(dx+185, dy+70), cvSize(5,5), 0, 0, 360, black, -1, 8, 0 ); cvEllipse( img, cvPoint(dx+150, dy+100), cvSize(10,5), 0, 0, 360, black, -1, 8, 0 ); cvEllipse( img, cvPoint(dx+150, dy+150), cvSize(40,10), 0, 0, 360, black, -1, 8, 0 ); cvEllipse( img, cvPoint(dx+27, dy+100), cvSize(20,35), 0, 0, 360, white, -1, 8, 0 ); cvEllipse( img, cvPoint(dx+273, dy+100), cvSize(20,35), 0, 0, 360, white, -1, 8, 0 ); } //cvNamedWindow( "image", 1 ); //cvShowImage( "image", img ); int res = cvSaveImage(pic, img); cvFindContours( img, storage, &contours, sizeof(CvContour), CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, cvPoint(0,0) ); // comment this out if you do not want approximation contours = cvApproxPoly( contours, sizeof(CvContour), storage, CV_POLY_APPROX_DP, 3, 1 ); //cvNamedWindow( "contours", 1 ); //cvCreateTrackbar( "levels+3", "contours", &levels, 7, on_trackbar ); IplImage* cnt_img = cvCreateImage( cvSize(500,500), 8, 3 ); CvSeq* _contours = contours; int _levels = levels - 3; if( _levels <= 0 ) // get to the nearest face to make it look more funny _contours = _contours->h_next->h_next->h_next; cvZero( cnt_img ); cvDrawContours( cnt_img, _contours, CV_RGB(255,0,0), CV_RGB(0,255,0), _levels, 3, CV_AA, cvPoint(0,0) ); //cvShowImage( "contours", cnt_img ); res = cvSaveImage(pic_contours, cnt_img); cvReleaseImage( &cnt_img ); //cvWaitKey(0); cvReleaseMemStorage( &storage ); cvReleaseImage( &img ); return 0; } // demhist.c int testDemHist(char* filename, char* result){ int _brightness = 100; int _contrast = 100; int hist_size = 64; float range_0[] = {0, 256}; float* ranges[] = {range_0}; IplImage *src_image = 0, *dst_image = 0, *hist_image = 0; CvHistogram *hist; uchar lut[256]; CvMat* lut_mat; // Load the source image. HighGUI use. src_image = cvLoadImage( filename, 0 ); if( !src_image ) { printf("Image was not loaded.\n"); return -1; } dst_image = cvCloneImage(src_image); hist_image = cvCreateImage(cvSize(320,200), 8, 1); hist = cvCreateHist(1, &hist_size, CV_HIST_ARRAY, ranges, 1); lut_mat = cvCreateMatHeader( 1, 256, CV_8UC1 ); cvSetData( lut_mat, lut, 0 ); //cvNamedWindow("image", 0); //cvNamedWindow("histogram", 0); //cvCreateTrackbar("brightness", "image", &_brightness, 200, update_brightcont); //cvCreateTrackbar("contrast", "image", &_contrast, 200, update_brightcont); int brightness = _brightness - 100; int contrast = _contrast - 100; int i, bin_w; float max_value = 0; /* * The algorithm is by Werner D. Streidt * (http://visca.com/ffactory/archives/5-99/msg00021.html) */ if( contrast > 0 ) { double delta = 127.*contrast/100; double a = 255./(255. - delta*2); double b = a*(brightness - delta); for( i = 0; i < 256; i++ ) { int v = cvRound(a*i + b); if( v < 0 ) v = 0; if( v > 255 ) v = 255; lut[i] = (uchar)v; } } else { double delta = -128.*contrast/100; double a = (256.-delta*2)/255.; double b = a*brightness + delta; for( i = 0; i < 256; i++ ) { int v = cvRound(a*i + b); if( v < 0 ) v = 0; if( v > 255 ) v = 255; lut[i] = (uchar)v; } } cvLUT( src_image, dst_image, lut_mat ); //cvShowImage( "image", dst_image ); cvCalcHist( &dst_image, hist, 0, NULL ); cvZero( dst_image ); cvGetMinMaxHistValue( hist, 0, &max_value, 0, 0 ); cvScale( hist->bins, hist->bins, ((double)hist_image->height)/max_value, 0 ); //cvNormalizeHist( hist, 1000 ); cvSet( hist_image, cvScalarAll(255), 0 ); bin_w = cvRound((double)hist_image->width/hist_size); for( i = 0; i < hist_size; i++ ) cvRectangle( hist_image, cvPoint(i*bin_w, hist_image->height), cvPoint((i+1)*bin_w, hist_image->height - cvRound(cvGetReal1D(hist->bins,i))), cvScalarAll(0), -1, 8, 0 ); //cvShowImage( "histogram", hist_image ); int res = cvSaveImage(result, hist_image); //cvWaitKey(0); cvReleaseImage(&src_image); cvReleaseImage(&dst_image); cvReleaseHist(&hist); return 0; } //pyramid_segmentation.c int testPyramidSegmentation(char* filename, char* result) { IplImage * image[2] = {0, 0}, *image0 = 0, *image1 = 0; CvSize size; int w0, h0, i; int threshold1, threshold2; int l, level = 4; int sthreshold1, sthreshold2; int l_comp; int block_size = 1000; float parameter; double threshold; double rezult, min_rezult; CvFilter filter = CV_GAUSSIAN_5x5; CvConnectedComp *cur_comp, min_comp; CvSeq *comp; CvMemStorage *storage; CvPoint pt1, pt2; if( (image[0] = cvLoadImage( filename, 1)) == 0 ) return -1; //cvNamedWindow("Source", 0); //cvShowImage("Source", image[0]); //cvNamedWindow("Segmentation", 0); storage = cvCreateMemStorage ( block_size ); image[0]->width &= -(1<<level); image[0]->height &= -(1<<level); image0 = cvCloneImage( image[0] ); image1 = cvCloneImage( image[0] ); // segmentation of the color image l = 1; threshold1 =255; threshold2 =30; cvPyrSegmentation(image0, image1, storage, &comp, level, threshold1+1, threshold2+1); //cvShowImage("Segmentation", image1); int res = cvSaveImage(result, image1); //cvDestroyWindow("Segmentation"); //cvDestroyWindow("Source"); cvReleaseMemStorage(&storage ); cvReleaseImage(&image[0]); cvReleaseImage(&image0); cvReleaseImage(&image1); return 0; } //squares.c // helper function: // finds a cosine of angle between vectors // from pt0->pt1 and from pt0->pt2 double angle( CvPoint* pt1, CvPoint* pt2, CvPoint* pt0 ) { double dx1 = pt1->x - pt0->x; double dy1 = pt1->y - pt0->y; double dx2 = pt2->x - pt0->x; double dy2 = pt2->y - pt0->y; return (dx1*dx2 + dy1*dy2)/sqrt((dx1*dx1 + dy1*dy1)*(dx2*dx2 + dy2*dy2) + 1e-10); } // returns sequence of squares detected on the image. // the sequence is stored in the specified memory storage CvSeq* findSquares4( IplImage* img, CvMemStorage* storage ) { CvSeq* contours; int i, c, l, N = 11; CvSize sz = cvSize( img->width & -2, img->height & -2 ); IplImage* timg = cvCloneImage( img ); // make a copy of input image IplImage* gray = cvCreateImage( sz, 8, 1 ); IplImage* pyr = cvCreateImage( cvSize(sz.width/2, sz.height/2), 8, 3 ); IplImage* tgray; CvSeq* result; double s, t; int thresh = 50; // create empty sequence that will contain points - // 4 points per square (the square's vertices) CvSeq* squares = cvCreateSeq( 0, sizeof(CvSeq), sizeof(CvPoint), storage ); // select the maximum ROI in the image // with the width and height divisible by 2 cvSetImageROI( timg, cvRect( 0, 0, sz.width, sz.height )); // down-scale and upscale the image to filter out the noise cvPyrDown( timg, pyr, 7 ); cvPyrUp( pyr, timg, 7 ); tgray = cvCreateImage( sz, 8, 1 ); // find squares in every color plane of the image for( c = 0; c < 3; c++ ) { // extract the c-th color plane cvSetImageCOI( timg, c+1 ); cvCopy( timg, tgray, 0 ); // try several threshold levels for( l = 0; l < N; l++ ) { // hack: use Canny instead of zero threshold level. // Canny helps to catch squares with gradient shading if( l == 0 ) { // apply Canny. Take the upper threshold from slider // and set the lower to 0 (which forces edges merging) cvCanny( tgray, gray, 0, thresh, 5 ); // dilate canny output to remove potential // holes between edge segments cvDilate( gray, gray, 0, 1 ); } else { // apply threshold if l!=0: // tgray(x,y) = gray(x,y) < (l+1)*255/N ? 255 : 0 cvThreshold( tgray, gray, (l+1)*255/N, 255, CV_THRESH_BINARY ); } // find contours and store them all as a list cvFindContours( gray, storage, &contours, sizeof(CvContour), CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE, cvPoint(0,0) ); // test each contour while( contours ) { // approximate contour with accuracy proportional // to the contour perimeter result = cvApproxPoly( contours, sizeof(CvContour), storage, CV_POLY_APPROX_DP, cvContourPerimeter(contours)*0.02, 0 ); // square contours should have 4 vertices after approximation // relatively large area (to filter out noisy contours) // and be convex. // Note: absolute value of an area is used because // area may be positive or negative - in accordance with the // contour orientation if( result->total == 4 && fabs(cvContourArea(result,CV_WHOLE_SEQ)) > 1000 && cvCheckContourConvexity(result) ) { s = 0; for( i = 0; i < 5; i++ ) { // find minimum angle between joint // edges (maximum of cosine) if( i >= 2 ) { t = fabs(angle( (CvPoint*)cvGetSeqElem( result, i ), (CvPoint*)cvGetSeqElem( result, i-2 ), (CvPoint*)cvGetSeqElem( result, i-1 ))); s = s > t ? s : t; } } // if cosines of all angles are small // (all angles are ~90 degree) then write quandrange // vertices to resultant sequence if( s < 0.3 ) for( i = 0; i < 4; i++ ) cvSeqPush( squares, (CvPoint*)cvGetSeqElem( result, i )); } // take the next contour contours = contours->h_next; } } } // release all the temporary images cvReleaseImage( &gray ); cvReleaseImage( &pyr ); cvReleaseImage( &tgray ); cvReleaseImage( &timg ); return squares; } // the function draws all the squares in the image void drawSquares( IplImage* img, CvSeq* squares, int pos_img ) { char* resultsSquares[] = {"/mnt/sdcard/OpenCVTests/results/squares/ResultSquarespic1.png", "/mnt/sdcard/OpenCVTests/results/squares/ResultSquarespic2.png", "/mnt/sdcard/OpenCVTests/results/squares/ResultSquarespic3.png", "/mnt/sdcard/OpenCVTests/results/squares/ResultSquarespic4.png", "/mnt/sdcard/OpenCVTests/results/squares/ResultSquarespic5.png", "/mnt/sdcard/OpenCVTests/results/squares/ResultSquarespic6.png", 0}; CvSeqReader reader; IplImage* cpy = cvCloneImage( img ); int i; // initialize reader of the sequence cvStartReadSeq( squares, &reader, 0 ); // read 4 sequence elements at a time (all vertices of a square) for( i = 0; i < squares->total; i += 4 ) { CvPoint pt[4], *rect = pt; int count = 4; // read 4 vertices CV_READ_SEQ_ELEM( pt[0], reader ); CV_READ_SEQ_ELEM( pt[1], reader ); CV_READ_SEQ_ELEM( pt[2], reader ); CV_READ_SEQ_ELEM( pt[3], reader ); // draw the square as a closed polyline cvPolyLine( cpy, &rect, &count, 1, 1, CV_RGB(0,255,0), 3, CV_AA, 0 ); } // show the resultant image //cvShowImage( wndname, cpy ); int res = cvSaveImage(resultsSquares[pos_img], cpy); cvReleaseImage( &cpy ); } int testSquareDetector(){ char* namesSquares[] = {"/mnt/sdcard/OpenCVTests/data/pic1.png", "/mnt/sdcard/OpenCVTests/data/pic2.png", "/mnt/sdcard/OpenCVTests/data/pic3.png", "/mnt/sdcard/OpenCVTests/data/pic4.png", "/mnt/sdcard/OpenCVTests/data/pic5.png", "/mnt/sdcard/OpenCVTests/data/pic6.png", 0}; int i, c; int thresh = 50; IplImage* img = 0; IplImage* img0 = 0; CvMemStorage* storage = 0; //const char* wndname = "Square Detection Demo"; // create memory storage that will contain all the dynamic data storage = cvCreateMemStorage(0); for( i = 0; namesSquares[i] != 0; i++ ) { // load i-th image img0 = cvLoadImage( namesSquares[i], 1 ); if( !img0 ) { printf("Couldn't load %s\n", namesSquares[i] ); continue; } img = cvCloneImage( img0 ); // create window and a trackbar (slider) with parent "image" and set callback // (the slider regulates upper threshold, passed to Canny edge detector) //cvNamedWindow( wndname, 1 ); // find and draw the squares drawSquares( img, findSquares4( img, storage ), i ); // wait for key. // Also the function cvWaitKey takes care of event processing //c = cvWaitKey(0); // release both images cvReleaseImage( &img ); cvReleaseImage( &img0 ); // clear memory storage - reset free space position cvClearMemStorage( storage ); //if( (char)c == 27 ) // break; } //cvDestroyWindow( wndname ); return 0; } int testWatershed(char* filename, char* result){ IplImage* marker_mask = 0; IplImage* markers = 0; IplImage* img0 = 0, *img = 0, *img_gray = 0, *wshed = 0; CvPoint prev_pt = {1,1}; CvRNG rng = cvRNG(-1); if( (img0 = cvLoadImage(filename,1)) == 0 ) return 0; img = cvCloneImage( img0 ); img_gray = cvCloneImage( img0 ); wshed = cvCloneImage( img0 ); marker_mask = cvCreateImage( cvGetSize(img), 8, 1 ); markers = cvCreateImage( cvGetSize(img), IPL_DEPTH_32S, 1 ); cvCvtColor( img, marker_mask, CV_BGR2GRAY ); cvCvtColor( marker_mask, img_gray, CV_GRAY2BGR ); //cvZero( marker_mask ); //cvZero( wshed ); //cvShowImage( "image", img ); //cvShowImage( "watershed transform", wshed ); CvMemStorage* storage = cvCreateMemStorage(0); CvSeq* contours = 0; CvMat* color_tab; int i, j, comp_count = 0; //cvSaveImage( "wshed_mask.png", marker_mask ); //marker_mask = cvLoadImage( "wshed_mask.png", 0 ); cvFindContours( marker_mask, storage, &contours, sizeof(CvContour), CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE, cvPoint(0,0) ); cvZero( markers ); for( ; contours != 0; contours = contours->h_next, comp_count++ ) { cvDrawContours( markers, contours, cvScalarAll(comp_count+1), cvScalarAll(comp_count+1), -1, -1, 8, cvPoint(0,0) ); } color_tab = cvCreateMat( 1, comp_count, CV_8UC3 ); for( i = 0; i < comp_count; i++ ) { uchar* ptr = color_tab->data.ptr + i*3; ptr[0] = (uchar)(cvRandInt(&rng)%180 + 50); ptr[1] = (uchar)(cvRandInt(&rng)%180 + 50); ptr[2] = (uchar)(cvRandInt(&rng)%180 + 50); } { //double t = (double)cvGetTickCount(); cvWatershed( img0, markers ); //t = (double)cvGetTickCount() - t; //printf( "exec time = %gms\n", t/(cvGetTickFrequency()*1000.) ); } // paint the watershed image for( i = 0; i < markers->height; i++ ) for( j = 0; j < markers->width; j++ ) { int idx = CV_IMAGE_ELEM( markers, int, i, j ); uchar* dst = &CV_IMAGE_ELEM( wshed, uchar, i, j*3 ); if( idx == -1 ) dst[0] = dst[1] = dst[2] = (uchar)255; else if( idx <= 0 || idx > comp_count ) dst[0] = dst[1] = dst[2] = (uchar)0; // should not get here else { uchar* ptr = color_tab->data.ptr + (idx-1)*3; dst[0] = ptr[0]; dst[1] = ptr[1]; dst[2] = ptr[2]; } } cvAddWeighted( wshed, 0.5, img_gray, 0.5, 0, wshed ); //cvShowImage( "watershed transform", wshed ); int res = cvSaveImage(result, wshed); cvReleaseMemStorage( &storage ); cvReleaseMat( &color_tab ); //} return 0; } // morphology.c void OpenClose(int pos, IplImage* src, IplImage* dst,int element_shape) { //the address of variable which receives trackbar position update int max_iters = 10; int open_close_pos = 0; int erode_dilate_pos = 0; open_close_pos = erode_dilate_pos = max_iters/2.0; int n = open_close_pos - max_iters; int an = n > 0 ? n : -n; IplConvKernel* element = cvCreateStructuringElementEx( an*2+1, an*2+1, an, an, element_shape, 0 ); if( n < 0 ) { cvErode(src,dst,element,1); cvDilate(dst,dst,element,1); } else { cvDilate(src,dst,element,1); cvErode(dst,dst,element,1); } cvReleaseStructuringElement(&element); } void ErodeDilate(int pos, IplImage* src, IplImage* dst, int element_shape) { //the address of variable which receives trackbar position update int max_iters = 10; int open_close_pos = 0; int erode_dilate_pos = 0; open_close_pos = erode_dilate_pos = max_iters/2.0; int n = erode_dilate_pos - max_iters; int an = n > 0 ? n : -n; IplConvKernel* element = cvCreateStructuringElementEx( an*2+1, an*2+1, an, an, element_shape, 0 ); if( n < 0 ) { cvErode(src,dst,element,1); } else { cvDilate(src,dst,element,1); } cvReleaseStructuringElement(&element); } int morphology( ) { char* filename = (char*)"/mnt/sdcard/OpenCVTests/data/baboon.png"; IplImage* src = 0; if( (src = cvLoadImage(filename,1)) == 0 ) return -1; IplImage* dst = cvCloneImage(src); //the address of variable which receives trackbar position update int max_iters = 10; int open_close_pos = 0; int erode_dilate_pos = 0; open_close_pos = erode_dilate_pos = max_iters/2.0; int element_shape = CV_SHAPE_ELLIPSE; OpenClose(open_close_pos,src,dst,element_shape); int res1 = cvSaveImage("/mnt/sdcard/OpenCVTests/results/morphology/baboon_E_OC.png", dst); if(res1<=0) return -1; ErodeDilate(erode_dilate_pos,src,dst,element_shape); res1 = cvSaveImage("/mnt/sdcard/OpenCVTests/results/morphology/baboon_E_ED.png", dst); if(res1<=0) return -1; element_shape = CV_SHAPE_RECT; OpenClose(open_close_pos,src,dst,element_shape); res1 = cvSaveImage("/mnt/sdcard/OpenCVTests/results/morphology/baboon_R_OC.png", dst); if(res1<=0) return -1; ErodeDilate(erode_dilate_pos,src,dst,element_shape); res1 = cvSaveImage("/mnt/sdcard/OpenCVTests/results/morphology/baboon_R_ED.png", dst); if(res1<=0) return -1; element_shape = CV_SHAPE_CROSS; OpenClose(open_close_pos,src,dst,element_shape); res1 = cvSaveImage("/mnt/sdcard/OpenCVTests/results/morphology/baboon_C_OC.png", dst); if(res1<=0) return -1; ErodeDilate(erode_dilate_pos,src,dst,element_shape); res1 = cvSaveImage("/mnt/sdcard/OpenCVTests/results/morphology/baboon_C_ED.png", dst); if(res1<=0) return -1; //release images cvReleaseImage(&src); cvReleaseImage(&dst); return 0; } // dft.c // Rearrange the quadrants of Fourier image so that the origin is at // the image center // src & dst arrays of equal size & type void cvShiftDFT(CvArr * src_arr, CvArr * dst_arr ) { CvMat * tmp; CvMat q1stub, q2stub; CvMat q3stub, q4stub; CvMat d1stub, d2stub; CvMat d3stub, d4stub; CvMat * q1, * q2, * q3, * q4; CvMat * d1, * d2, * d3, * d4; CvSize size = cvGetSize(src_arr); CvSize dst_size = cvGetSize(dst_arr); int cx, cy; if(dst_size.width != size.width || dst_size.height != size.height){ cvError( CV_StsUnmatchedSizes, "cvShiftDFT", "Source and Destination arrays must have equal sizes", __FILE__, __LINE__ ); } if(src_arr==dst_arr){ tmp = cvCreateMat(size.height/2, size.width/2, cvGetElemType(src_arr)); } cx = size.width/2; cy = size.height/2; // image center q1 = cvGetSubRect( src_arr, &q1stub, cvRect(0,0,cx, cy) ); q2 = cvGetSubRect( src_arr, &q2stub, cvRect(cx,0,cx,cy) ); q3 = cvGetSubRect( src_arr, &q3stub, cvRect(cx,cy,cx,cy) ); q4 = cvGetSubRect( src_arr, &q4stub, cvRect(0,cy,cx,cy) ); d1 = cvGetSubRect( src_arr, &d1stub, cvRect(0,0,cx,cy) ); d2 = cvGetSubRect( src_arr, &d2stub, cvRect(cx,0,cx,cy) ); d3 = cvGetSubRect( src_arr, &d3stub, cvRect(cx,cy,cx,cy) ); d4 = cvGetSubRect( src_arr, &d4stub, cvRect(0,cy,cx,cy) ); if(src_arr!=dst_arr){ if( !CV_ARE_TYPES_EQ( q1, d1 )){ cvError( CV_StsUnmatchedFormats, "cvShiftDFT", "Source and Destination arrays must have the same format", __FILE__, __LINE__ ); } cvCopy(q3, d1, 0); cvCopy(q4, d2, 0); cvCopy(q1, d3, 0); cvCopy(q2, d4, 0); } else{ cvCopy(q3, tmp, 0); cvCopy(q1, q3, 0); cvCopy(tmp, q1, 0); cvCopy(q4, tmp, 0); cvCopy(q2, q4, 0); cvCopy(tmp, q2, 0); } } int dft() { const char* filename = "/mnt/sdcard/OpenCVTests/data/suit.png"; IplImage * im; IplImage * realInput; IplImage * imaginaryInput; IplImage * complexInput; int dft_M, dft_N; CvMat* dft_A, tmp; IplImage * image_Re; IplImage * image_Im; double m, M; im = cvLoadImage( filename, CV_LOAD_IMAGE_GRAYSCALE ); if( !im ) return -1; realInput = cvCreateImage( cvGetSize(im), IPL_DEPTH_32F, 1); imaginaryInput = cvCreateImage( cvGetSize(im), IPL_DEPTH_32F, 1); complexInput = cvCreateImage( cvGetSize(im), IPL_DEPTH_32F, 2); cvScale(im, realInput, 1.0, 0.0); cvZero(imaginaryInput); cvMerge(realInput, imaginaryInput, NULL, NULL, complexInput); dft_M = cvGetOptimalDFTSize( im->height - 1 ); dft_N = cvGetOptimalDFTSize( im->width - 1 ); dft_A = cvCreateMat( dft_M, dft_N, CV_32FC2 ); image_Re = cvCreateImage( cvSize(dft_N, dft_M), IPL_DEPTH_32F, 1); image_Im = cvCreateImage( cvSize(dft_N, dft_M), IPL_DEPTH_32F, 1); // copy A to dft_A and pad dft_A with zeros cvGetSubRect( dft_A, &tmp, cvRect(0,0, im->width, im->height)); cvCopy( complexInput, &tmp, NULL ); if( dft_A->cols > im->width ) { cvGetSubRect( dft_A, &tmp, cvRect(im->width,0, dft_A->cols - im->width, im->height)); cvZero( &tmp ); } // no need to pad bottom part of dft_A with zeros because of // use nonzero_rows parameter in cvDFT() call below cvDFT( dft_A, dft_A, CV_DXT_FORWARD, complexInput->height ); // Split Fourier in real and imaginary parts cvSplit( dft_A, image_Re, image_Im, 0, 0 ); // Compute the magnitude of the spectrum Mag = sqrt(Re^2 + Im^2) cvPow( image_Re, image_Re, 2.0); cvPow( image_Im, image_Im, 2.0); cvAdd( image_Re, image_Im, image_Re, NULL); cvPow( image_Re, image_Re, 0.5 ); // Rearrange the quadrants of Fourier image so that the origin is at // the image center cvShiftDFT( image_Re, image_Re ); cvMinMaxLoc(image_Re, &m, &M, NULL, NULL, NULL); cvScale(image_Re, image_Re, 1.0/(M-m), 1.0*(-m)/(M-m)); cvMinMaxLoc(image_Re, &m, &M, NULL, NULL, NULL); cvAbs(image_Re, image_Re); IplImage * re = cvCreateImage( cvGetSize(image_Re), IPL_DEPTH_8U, 1); int i; for(i=0;i<cvGetSize(image_Re).height*cvGetSize(image_Re).width;i++){ re->imageData[i]=image_Re->imageData[i]; } int res1 = cvSaveImage("/mnt/sdcard/OpenCVTests/results/dftres2.png", re); if(res1<=0) return -1; return 0; } // inpaint.cpp int inpaint( ) { char* filename = "/mnt/sdcard/OpenCVTests/data/lena.png"; IplImage* img0 = cvLoadImage(filename,-1); if( !img0 ) return -1; IplImage* img = cvCloneImage( img0 ); IplImage* inpainted = cvCloneImage( img0 ); IplImage* inpaint_mask = cvCreateImage( cvGetSize(img), 8, 1 ); cvZero( inpaint_mask ); cvZero( inpainted ); CvPoint prev_pt = {0,0}; CvPoint pt = {cvGetSize(img).height,cvGetSize(img).width}; cvLine( inpaint_mask, prev_pt, pt, cvScalarAll(255), 5, 8, 0 ); cvLine( img, prev_pt, pt, cvScalarAll(255), 5, 8, 0 ); cvInpaint( img, inpaint_mask, inpainted, 3, CV_INPAINT_TELEA ); int res1 = cvSaveImage("/mnt/sdcard/OpenCVTests/results/inpainted.png", inpainted); if(res1<=0) return -1; return 0; } // minarea.c int minarea( ) { IplImage* img = cvCreateImage( cvSize( 500, 500 ), 8, 3 ); char key; int i, count = rand()%100 + 1; CvPoint pt0, pt; CvBox2D box; CvPoint2D32f box_vtx[4]; CvPoint2D32f center; CvPoint icenter; float radius; CvPoint* points = (CvPoint*)malloc( count * sizeof(points[0])); CvMat pointMat = cvMat( 1, count, CV_32SC2, points ); for( i = 0; i < count; i++ ) { pt0.x = rand() % (img->width/2) + img->width/4; pt0.y = rand() % (img->height/2) + img->height/4; points[i] = pt0; } box = cvMinAreaRect2( &pointMat, 0 ); cvMinEnclosingCircle( &pointMat, &center, &radius ); cvBoxPoints( box, box_vtx ); cvZero( img ); for( i = 0; i < count; i++ ) { pt0 = points[i]; cvCircle( img, pt0, 2, CV_RGB( 255, 0, 0 ), CV_FILLED, CV_AA, 0 ); } pt0.x = cvRound(box_vtx[3].x); pt0.y = cvRound(box_vtx[3].y); for( i = 0; i < 4; i++ ) { pt.x = cvRound(box_vtx[i].x); pt.y = cvRound(box_vtx[i].y); cvLine(img, pt0, pt, CV_RGB(0, 255, 0), 1, CV_AA, 0); pt0 = pt; } icenter.x = cvRound(center.x); icenter.y = cvRound(center.y); cvCircle( img, icenter, cvRound(radius), CV_RGB(255, 255, 0), 1, CV_AA, 0 ); int res1 = cvSaveImage("/mnt/sdcard/OpenCVTests/results/rectCircle.png", img); if(res1<=0) return -1; free( points ); return 0; } //lkdemo.c int testLKdemo(char* filename) { IplImage *image = 0, *grey = 0, *prev_grey = 0, *pyramid = 0, *prev_pyramid = 0, *swap_temp; int win_size = 10; const int MAX_COUNT = 500; CvPoint2D32f * points[2] = {0, 0}, *swap_points; char* status = 0; int count = 0; int need_to_init = 1; int night_mode = 0; int flags = 0; int add_remove_pt = 0; CvPoint pt; int run_algorithm = 1; while (run_algorithm) { IplImage* frame = 0; int i, k, c; frame = cvLoadImage(filename, 1); //if (!frame) // break; if (!image) { //printf("1\n"); /* allocate all the buffers */ image = cvCreateImage(cvGetSize(frame), 8, 3); image->origin = frame->origin; grey = cvCreateImage(cvGetSize(frame), 8, 1); prev_grey = cvCreateImage(cvGetSize(frame), 8, 1); pyramid = cvCreateImage(cvGetSize(frame), 8, 1); prev_pyramid = cvCreateImage(cvGetSize(frame), 8, 1); points[0] = (CvPoint2D32f*) cvAlloc(MAX_COUNT * sizeof (points[0][0])); points[1] = (CvPoint2D32f*) cvAlloc(MAX_COUNT * sizeof (points[0][0])); status = (char*) cvAlloc(MAX_COUNT); flags = 0; } cvCopy(frame, image, 0); cvCvtColor(image, grey, CV_BGR2GRAY); if (night_mode) cvZero(image); if (need_to_init) { //printf("2\n"); /* automatic initialization */ IplImage* eig = cvCreateImage(cvGetSize(grey), 32, 1); IplImage* temp = cvCreateImage(cvGetSize(grey), 32, 1); double quality = 0.01; double min_distance = 10; count = MAX_COUNT; cvGoodFeaturesToTrack(grey, eig, temp, points[1], &count, quality, min_distance, 0, 3, 0, 0.04); cvFindCornerSubPix(grey, points[1], count, cvSize(win_size, win_size), cvSize(-1, -1), cvTermCriteria(CV_TERMCRIT_ITER | CV_TERMCRIT_EPS, 20, 0.03)); cvReleaseImage(&eig); cvReleaseImage(&temp); add_remove_pt = 0; } else if (count > 0) { //printf("3\n"); cvCalcOpticalFlowPyrLK(prev_grey, grey, prev_pyramid, pyramid, points[0], points[1], count, cvSize(win_size, win_size), 3, status, 0, cvTermCriteria(CV_TERMCRIT_ITER | CV_TERMCRIT_EPS, 20, 0.03), flags); flags |= CV_LKFLOW_PYR_A_READY; for (i = k = 0; i < count; i++) { if (add_remove_pt) { double dx = pt.x - points[1][i].x; double dy = pt.y - points[1][i].y; if (dx * dx + dy * dy <= 25) { add_remove_pt = 0; continue; } } if (!status[i]) continue; points[1][k++] = points[1][i]; cvCircle(image, cvPointFrom32f(points[1][i]), 3, CV_RGB(0, 255, 0), -1, 8, 0); } count = k; run_algorithm=0; } if (add_remove_pt && count < MAX_COUNT) { points[1][count++] = cvPointTo32f(pt); cvFindCornerSubPix(grey, points[1] + count - 1, 1, cvSize(win_size, win_size), cvSize(-1, -1), cvTermCriteria(CV_TERMCRIT_ITER | CV_TERMCRIT_EPS, 20, 0.03)); add_remove_pt = 0; } CV_SWAP(prev_grey, grey, swap_temp); CV_SWAP(prev_pyramid, pyramid, swap_temp); CV_SWAP(points[0], points[1], swap_points); need_to_init = 0; } //cvShowImage("LkDemo", image); int res1 = cvSaveImage("/mnt/sdcard/OpenCVTests/results/LKDemo.png", image); return 0; } void dogCam(IplImage* src, IplImage* dst) { // Difference-Of-Gaussians (DOG) works by performing two different Gaussian blurs on the image, // with a different blurring radius for each, and subtracting them to yield the result. // http://en.wikipedia.org/wiki/Difference_of_Gaussians // http://docs.gimp.org/en/plug-in-dog.html IplImage *dog_1 = cvCreateImage(cvGetSize(src), src->depth, src->nChannels); IplImage *dog_2 = cvCreateImage(cvGetSize(src), src->depth, src->nChannels); cvSmooth(src, dog_2, CV_GAUSSIAN, 3, 0, 0, 0); // Gaussian blur cvSmooth(src, dog_1, CV_GAUSSIAN, 7, 0, 0, 0); cvSub(dog_2, dog_1, dst, 0); } // dogCam() void dilateBenchmark(IplImage* src, IplImage* dst) { cvDilate(src,dst,NULL,5); } void cornerHarrisBenchmark(IplImage* src, IplImage* dst) { IplImage* gray = cvCreateImage(cvGetSize(src), IPL_DEPTH_8U, 1); cvCvtColor(src, gray, CV_RGB2GRAY); dst = cvCreateImage(cvGetSize(src), IPL_DEPTH_32F, 1); cvCornerHarris(gray, dst, 3, 5, 0.07); } void medianFilterBenchmark(IplImage* src, IplImage* dst) { dst = cvCreateImage(cvGetSize(src), src->depth, src->nChannels); cvSmooth(src, dst, CV_MEDIAN, 3, 0, 0, 0); // } void *mainFunction(void *arg) { printf("Starting run\n"); int result=SDCardMount(); printf("SD card mounted? %d\n",result); int res; res = testCanny("/mnt/sdcard/OpenCVTests/data/nature.png","/mnt/sdcard/OpenCVTests/results/resultEdge.png"); assert(res==0); printf("+ Test 1 passed. OK\n"); res = testFaceDetectHaarCascade("/mnt/sdcard/OpenCVTests/data/lena.png","/mnt/sdcard/OpenCVTests/data/haarface.xml","/mnt/sdcard/OpenCVTests/results/resultFaceDetection.png"); assert(res==0); printf("+ Test 2 passed. OK\n"); res = testKmeans("/mnt/sdcard/OpenCVTests/results/resultTestKmeans.png"); assert(res==0); printf("+ Test 3 passed. OK\n"); res = testContours("/mnt/sdcard/OpenCVTests/results/resultTestContours_1.png","/mnt/sdcard/OpenCVTests/results/resultTestContours_2.png"); assert(res==0); printf("+ Test 4 passed. OK\n"); res = testDemHist("/mnt/sdcard/OpenCVTests/data/baboon.png","/mnt/sdcard/OpenCVTests/results/resultDemHist.png"); assert(res==0); printf("+ Test 5 passed. OK\n"); res = delaunay(); assert(res==0); printf("+ Test 6 passed. OK\n"); res=testPyramidSegmentation("/mnt/sdcard/OpenCVTests/data/fruits.png", "/mnt/sdcard/OpenCVTests/results/resultPyramidSegmentation.png"); assert(res==0); printf("+ Test 7 passed. OK\n"); res=testSquareDetector(); assert(res==0); printf("+ Test 8 passed. OK\n"); res=testWatershed("/mnt/sdcard/OpenCVTests/data/fruits.png", "/mnt/sdcard/OpenCVTests/results/resultWatershed.png"); assert(res==0); printf("+ Test 9 passed. OK\n"); res = morphology(); assert(res==0); printf("+ Test 10 passed. OK\n"); res = dft(); assert(res==0); printf("+ Test 11 passed. OK\n"); res = inpaint(); assert(res==0); printf("+ Test 12 passed. OK\n"); res = minarea(); assert(res==0); printf("+ Test 13 passed. OK\n"); res = testLKdemo("/mnt/sdcard/OpenCVTests/data/suit.png"); assert(res==0); printf("+ Test 14 passed. OK\n"); //BENCHMARKS// struct timeval currentTime; struct timeval previousTime; int previousUsec = 0; int currentUsec = 0; IplImage* src; IplImage* dst; int res1; //TEST 15 src = cvLoadImage("/mnt/sdcard/OpenCVTests/data/DunLoghaire_320x240.png", 1); dst = cvCreateImage(cvGetSize(src), src->depth, src->nChannels); if( !src ) { printf("Image was not loaded.\n"); return -1; } gettimeofday(&previousTime, NULL); previousUsec = previousTime.tv_sec * 1000000 + previousTime.tv_usec; dogCam(src,dst); gettimeofday(&currentTime,NULL); currentUsec = currentTime.tv_sec*1000000+currentTime.tv_usec; printf("TEST 15 Usec CPU time: %d \n",currentUsec - previousUsec); res1 = cvSaveImage("/mnt/sdcard/OpenCVTests/results/DOG.png", dst); //TEST 16 src = cvLoadImage("/mnt/sdcard/OpenCVTests/data/lena_512x512_luma.png", 1); dst = cvCreateImage(cvGetSize(src), src->depth, src->nChannels); if( !src ) { printf("Image was not loaded.\n"); return -1; } gettimeofday(&previousTime, NULL); previousUsec = previousTime.tv_sec * 1000000 + previousTime.tv_usec; dilateBenchmark(src,dst); gettimeofday(&currentTime,NULL); currentUsec = currentTime.tv_sec*1000000+currentTime.tv_usec; printf("TEST 16 Usec CPU time: %d \n",currentUsec - previousUsec); res1 = cvSaveImage("/mnt/sdcard/OpenCVTests/results/dilate2.png", dst); //TEST 17 src = cvLoadImage("/mnt/sdcard/OpenCVTests/data/lena_512x512_luma.png", 1); dst = cvCreateImage(cvGetSize(src), src->depth, src->nChannels); if( !src ) { printf("Image was not loaded.\n"); return -1; } gettimeofday(&previousTime, NULL); previousUsec = previousTime.tv_sec * 1000000 + previousTime.tv_usec; cornerHarrisBenchmark(src,dst); gettimeofday(&currentTime,NULL); currentUsec = currentTime.tv_sec*1000000+currentTime.tv_usec; printf("TEST 17 Usec CPU time: %d \n",currentUsec - previousUsec); res1 = cvSaveImage("/mnt/sdcard/OpenCVTests/results/cornerharris.png", dst); //TEST 18 src = cvLoadImage("/mnt/sdcard/OpenCVTests/data/ref_chroma_median_out_512x512_P444_8bpp.png", 1); dst = cvCreateImage(cvGetSize(src), src->depth, src->nChannels); if( !src ) { printf("Image was not loaded.\n"); return -1; } gettimeofday(&previousTime, NULL); previousUsec = previousTime.tv_sec * 1000000 + previousTime.tv_usec; medianFilterBenchmark(src,dst); gettimeofday(&currentTime,NULL); currentUsec = currentTime.tv_sec*1000000+currentTime.tv_usec; printf("TEST 18 Usec CPU time: %d \n",currentUsec - previousUsec); res1 = cvSaveImage("/mnt/sdcard/OpenCVTests/results/medianfilter.png", dst); printf("Unmounting SD card...\n"); SDCardUnmount(); printf("Tests ended \n"); pthread_exit(0); } static void Fatal_extension( Internal_errors_Source the_source, bool is_internal, uint32_t the_error ) { if (the_source != RTEMS_FATAL_SOURCE_EXIT) printk ("\nSource %d Internal %d Error %d\n", the_source, is_internal, the_error); if (the_source == RTEMS_FATAL_SOURCE_EXCEPTION) rtems_exception_frame_print((void *) the_error); }
31.263189
224
0.570301
7712afdbb44c25b7db5267cd8712f95aee6a6723
103
h
C
compiler/cmd.h
Kai-Builder/SDKL
64068c2fe998af4086737d87b0bf2a4413d30a92
[ "Apache-2.0", "MIT" ]
2
2021-04-09T00:44:40.000Z
2021-04-22T22:47:50.000Z
compiler/cmd.h
Kai-Builder/SDKL
64068c2fe998af4086737d87b0bf2a4413d30a92
[ "Apache-2.0", "MIT" ]
null
null
null
compiler/cmd.h
Kai-Builder/SDKL
64068c2fe998af4086737d87b0bf2a4413d30a92
[ "Apache-2.0", "MIT" ]
null
null
null
// // Created by seymo on 3/31/2021. // #ifndef SDK_L_CMD_H #define SDK_L_CMD_H #endif //SDK_L_CMD_H
11.444444
33
0.708738
47081ce3443133cbc3cd1407998b24dd42f9e36a
2,599
h
C
src/resource/state_machine_resource.h
ValtoForks/crown
0d273f352de01f0adac8a29db7f520979540b916
[ "MIT" ]
null
null
null
src/resource/state_machine_resource.h
ValtoForks/crown
0d273f352de01f0adac8a29db7f520979540b916
[ "MIT" ]
null
null
null
src/resource/state_machine_resource.h
ValtoForks/crown
0d273f352de01f0adac8a29db7f520979540b916
[ "MIT" ]
null
null
null
/* * Copyright (c) 2012-2018 Daniele Bartolini and individual contributors. * License: https://github.com/dbartolini/crown/blob/master/LICENSE */ #pragma once #include "core/filesystem/types.h" #include "core/memory/types.h" #include "core/strings/string_id.h" #include "core/types.h" #include "resource/types.h" namespace crown { struct StateMachineResource { u32 version; u32 initial_state_offset; u32 num_variables; u32 variables_offset; u32 bytecode_size; u32 bytecode_offset; // State[...] // StringId32[num_variables] // f32[num_variables] // u32 bytecode[bytecode_size] }; struct AnimationArray { u32 num; }; struct Animation { StringId64 name; u32 bytecode_entry; u32 pad; }; struct TransitionArray { u32 num; }; struct Transition { StringId32 event; u32 state_offset; u32 mode; // TransitionMode::Enum }; struct State { u32 speed_bytecode; u32 loop; TransitionArray ta; // Transition[num_transitions] // AnimationArray // Animation[num_animations] }; struct TransitionMode { enum Enum { IMMEDIATE, WAIT_UNTIL_END, COUNT }; }; namespace state_machine_internal { void compile(CompileOptions& opts); } // namespace state_machine_internal namespace state_machine { /// Returns the initial state. const State* initial_state(const StateMachineResource* smr); /// Returns the state pointed to by transition @a t. const State* state(const StateMachineResource* smr, const Transition* t); /// Triggers the transition *event* in the state *s* and returns the resulting state. /// If no transition with *event* is found it returns the state *s*. const State* trigger(const StateMachineResource* smr, const State* s, StringId32 event, const Transition** transition_out); /// Returns the transitions for the state @a s. const TransitionArray* state_transitions(const State* s); /// Returns the transition with given @a index. const Transition* transition(const TransitionArray* ta, u32 index); /// Returns the animations for the state @a s. const AnimationArray* state_animations(const State* s); /// Returns the animation with the given @a index. const Animation* animation(const AnimationArray* aa, u32 index); /// Returns the variables of the state machine. const f32* variables(const StateMachineResource* smr); /// Returns the index of the variable @a name or UINT32_MAX if not found. u32 variable_index(const StateMachineResource* smr, StringId32 name); /// Returns the byte code of the state machine. const u32* byte_code(const StateMachineResource* smr); } // namespace state_machine } // namespace crown
22.213675
124
0.746441
e4dc4ffd2f07dc9318263953d31b4abf05209adc
206
h
C
QQMusic/QQMusic/Controller/XCViewController.h
suifengqjn/QQMusic
90ddb8b625b8165a8024e355fe08487724b47214
[ "Apache-2.0" ]
null
null
null
QQMusic/QQMusic/Controller/XCViewController.h
suifengqjn/QQMusic
90ddb8b625b8165a8024e355fe08487724b47214
[ "Apache-2.0" ]
null
null
null
QQMusic/QQMusic/Controller/XCViewController.h
suifengqjn/QQMusic
90ddb8b625b8165a8024e355fe08487724b47214
[ "Apache-2.0" ]
null
null
null
// // XCViewController.h // QQMusic // // Created by qianjn on 2017/3/29. // Copyright © 2017年 SF. All rights reserved. // #import <UIKit/UIKit.h> @interface XCViewController : UIViewController @end
14.714286
46
0.68932
6990c7b96d7d4e5f9049f8b60ba47fe6d0ba9e9c
67,454
c
C
src/barectf.c
bohemondcouka/ctf_plugin
ca5a230c6c95167e315190d52b0b092eef4525df
[ "MIT" ]
null
null
null
src/barectf.c
bohemondcouka/ctf_plugin
ca5a230c6c95167e315190d52b0b092eef4525df
[ "MIT" ]
null
null
null
src/barectf.c
bohemondcouka/ctf_plugin
ca5a230c6c95167e315190d52b0b092eef4525df
[ "MIT" ]
null
null
null
/* * The MIT License (MIT) * * Copyright (c) 2015-2020 Philippe Proulx <pproulx@efficios.com> * * 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. * * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * * The following code was generated by barectf v3.0.1 * on 2021-03-08T10:59:05.109874. * * For more details, see <https://barectf.org/>. */ #include <stdint.h> #include <string.h> #include <assert.h> #include "barectf.h" #include "barectf-bitfield.h" #define _ALIGN(_at_var, _align) \ do { \ (_at_var) = ((_at_var) + ((_align) - 1)) & -(_align); \ } while (0) #ifdef __cplusplus # define _TO_VOID_PTR(_value) static_cast<void *>(_value) # define _FROM_VOID_PTR(_type, _value) static_cast<_type *>(_value) #else # define _TO_VOID_PTR(_value) ((void *) (_value)) # define _FROM_VOID_PTR(_type, _value) ((_type *) (_value)) #endif #define _BITS_TO_BYTES(_x) ((_x) >> 3) #define _BYTES_TO_BITS(_x) ((_x) << 3) union _f2u { float f; uint32_t u; }; union _d2u { double f; uint64_t u; }; uint32_t barectf_packet_size(const void * const vctx) { return _FROM_VOID_PTR(const struct barectf_ctx, vctx)->packet_size; } int barectf_packet_is_full(const void * const vctx) { const struct barectf_ctx * const ctx = _FROM_VOID_PTR(const struct barectf_ctx, vctx); return ctx->at == ctx->packet_size; } int barectf_packet_is_empty(const void * const vctx) { const struct barectf_ctx * const ctx = _FROM_VOID_PTR(const struct barectf_ctx, vctx); return ctx->at <= ctx->off_content; } uint32_t barectf_packet_events_discarded(const void * const vctx) { return _FROM_VOID_PTR(const struct barectf_ctx, vctx)->events_discarded; } uint32_t barectf_discarded_event_records_count(const void * const vctx) { return barectf_packet_events_discarded(vctx); } uint8_t *barectf_packet_buf(const void * const vctx) { return _FROM_VOID_PTR(const struct barectf_ctx, vctx)->buf; } uint8_t *barectf_packet_buf_addr(const void * const vctx) { return barectf_packet_buf(vctx); } uint32_t barectf_packet_buf_size(const void * const vctx) { const struct barectf_ctx * const ctx = _FROM_VOID_PTR(const struct barectf_ctx, vctx); return _BITS_TO_BYTES(ctx->packet_size); } void barectf_packet_set_buf(void * const vctx, uint8_t * const buf, const uint32_t buf_size) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); ctx->buf = buf; if (ctx->at == ctx->packet_size) { /* Keep full packet state */ ctx->at = _BYTES_TO_BITS(buf_size); } ctx->packet_size = _BYTES_TO_BITS(buf_size); } int barectf_packet_is_open(const void * const vctx) { return _FROM_VOID_PTR(const struct barectf_ctx, vctx)->packet_is_open; } int barectf_is_in_tracing_section(const void * const vctx) { return _FROM_VOID_PTR(const struct barectf_ctx, vctx)->in_tracing_section; } volatile const int *barectf_is_in_tracing_section_ptr(const void * const vctx) { return &_FROM_VOID_PTR(const struct barectf_ctx, vctx)->in_tracing_section; } int barectf_is_tracing_enabled(const void * const vctx) { return _FROM_VOID_PTR(const struct barectf_ctx, vctx)->is_tracing_enabled; } void barectf_enable_tracing(void * const vctx, const int enable) { _FROM_VOID_PTR(struct barectf_ctx, vctx)->is_tracing_enabled = enable; } static void _write_c_str(struct barectf_ctx * const ctx, const char * const src) { const uint32_t sz = strlen(src) + 1; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], src, sz); ctx->at += _BYTES_TO_BITS(sz); } static int _reserve_er_space(void * const vctx, const uint32_t er_size) { int ret; struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); /* Event _cannot_ fit? */ if (er_size > (ctx->packet_size - ctx->off_content)) { goto no_space; } /* Packet is full? */ if (barectf_packet_is_full(ctx)) { /* Yes: is the back end full? */ if (ctx->cbs.is_backend_full(ctx->data)) { /* Yes: discard event record */ goto no_space; } /* Back-end is _not_ full: open new packet */ ctx->use_cur_last_event_ts = 1; ctx->cbs.open_packet(ctx->data); ctx->use_cur_last_event_ts = 0; } /* Event fits the current packet? */ if (er_size > (ctx->packet_size - ctx->at)) { /* No: close packet now */ ctx->use_cur_last_event_ts = 1; ctx->cbs.close_packet(ctx->data); ctx->use_cur_last_event_ts = 0; /* Is the back end full? */ if (ctx->cbs.is_backend_full(ctx->data)) { /* Yes: discard event record */ goto no_space; } /* Back-end is _not_ full: open new packet */ ctx->use_cur_last_event_ts = 1; ctx->cbs.open_packet(ctx->data); ctx->use_cur_last_event_ts = 0; assert(er_size <= (ctx->packet_size - ctx->at)); } ret = 1; goto end; no_space: ctx->events_discarded++; ret = 0; end: return ret; } static void _commit_er(void * const vctx) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); /* Is the packet full? */ if (barectf_packet_is_full(ctx)) { /* Yes: close it now */ ctx->cbs.close_packet(ctx->data); } } /* Initialize context */ void barectf_init(void *vctx, uint8_t * const buf, const uint32_t buf_size, const struct barectf_platform_callbacks cbs, void * const data) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); ctx->cbs = cbs; ctx->data = data; ctx->buf = buf; ctx->packet_size = _BYTES_TO_BITS(buf_size); ctx->at = 0; ctx->events_discarded = 0; ctx->packet_is_open = 0; ctx->in_tracing_section = 0; ctx->is_tracing_enabled = 1; ctx->use_cur_last_event_ts = 0; } /* Open packet for data stream type `default` */ void barectf_default_open_packet( struct barectf_default_ctx * const sctx) { struct barectf_ctx * const ctx = &sctx->parent; const uint64_t ts = ctx->use_cur_last_event_ts ? sctx->cur_last_event_ts : ctx->cbs.default_clock_get_value(ctx->data); const int saved_in_tracing_section = ctx->in_tracing_section; /* * This function is either called by a tracing function, or * directly by the platform. * * If it's called by a tracing function, then * `ctx->in_tracing_section` is 1, so it's safe to open * the packet here (alter the packet), even if tracing was * disabled in the meantime because we're already in a tracing * section (which finishes at the end of the tracing function * call). * * If it's called directly by the platform, then if tracing is * disabled, we don't want to alter the packet, and return * immediately. */ if (!ctx->is_tracing_enabled && !saved_in_tracing_section) { ctx->in_tracing_section = 0; goto end; } /* We can alter the packet */ ctx->in_tracing_section = 1; /* Do not open a packet that is already open */ if (ctx->packet_is_open) { ctx->in_tracing_section = saved_in_tracing_section; goto end; } ctx->at = 0; /* Write packet header structure */ { /* Align for packet header structure */ _ALIGN(ctx->at, 8); /* Align for `magic` field */ _ALIGN(ctx->at, 8); /* Write magic number field */ { const uint32_t tmp_val = (uint32_t) 0xc1fc1fc1UL; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `stream_id` field */ _ALIGN(ctx->at, 8); /* Write data stream type ID field */ { const uint64_t tmp_val = (uint64_t) 0; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 64; } } /* Write packet context structure */ { /* Align for packet context structure */ _ALIGN(ctx->at, 8); /* Align for `packet_size` field */ _ALIGN(ctx->at, 8); /* Write packet total size field */ { const uint64_t tmp_val = (uint64_t) ctx->packet_size; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 64; } /* Align for `content_size` field */ _ALIGN(ctx->at, 8); /* Do not write `content_size` field; save its offset */ sctx->off_pc_content_size = ctx->at; ctx->at += 64; /* Align for `timestamp_begin` field */ _ALIGN(ctx->at, 8); /* Write beginning timestamp field */ { const uint64_t tmp_val = (uint64_t) ts; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 64; } /* Align for `timestamp_end` field */ _ALIGN(ctx->at, 8); /* Do not write `timestamp_end` field; save its offset */ sctx->off_pc_timestamp_end = ctx->at; ctx->at += 64; /* Align for `events_discarded` field */ _ALIGN(ctx->at, 8); /* Do not write `events_discarded` field; save its offset */ sctx->off_pc_events_discarded = ctx->at; ctx->at += 64; } /* Save content beginning's offset */ ctx->off_content = ctx->at; /* Mark current packet as open */ ctx->packet_is_open = 1; /* Not tracing anymore */ ctx->in_tracing_section = saved_in_tracing_section; end: return; } /* Close packet for data stream type `default` */ void barectf_default_close_packet(struct barectf_default_ctx * const sctx) { struct barectf_ctx * const ctx = &sctx->parent; const uint64_t ts = ctx->use_cur_last_event_ts ? sctx->cur_last_event_ts : ctx->cbs.default_clock_get_value(ctx->data); const int saved_in_tracing_section = ctx->in_tracing_section; /* * This function is either called by a tracing function, or * directly by the platform. * * If it's called by a tracing function, then * `ctx->in_tracing_section` is 1, so it's safe to close * the packet here (alter the packet), even if tracing was * disabled in the meantime, because we're already in a tracing * section (which finishes at the end of the tracing function * call). * * If it's called directly by the platform, then if tracing is * disabled, we don't want to alter the packet, and return * immediately. */ if (!ctx->is_tracing_enabled && !saved_in_tracing_section) { ctx->in_tracing_section = 0; goto end; } /* We can alter the packet */ ctx->in_tracing_section = 1; /* Do not close a packet that is not open */ if (!ctx->packet_is_open) { ctx->in_tracing_section = saved_in_tracing_section; goto end; } /* Save content size */ ctx->content_size = ctx->at; /* Go back to `timestamp_end` field offset */ ctx->at = sctx->off_pc_timestamp_end; /* Write `timestamp_end` field */ { const uint64_t tmp_val = (uint64_t) ts; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 64; } /* Go back to `content_size` field offset */ ctx->at = sctx->off_pc_content_size; /* Write `content_size` field */ { const uint64_t tmp_val = (uint64_t) ctx->content_size; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 64; } /* Go back to `events_discarded` field offset */ ctx->at = sctx->off_pc_events_discarded; /* Write `events_discarded` field */ { const uint64_t tmp_val = (uint64_t) ctx->events_discarded; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 64; } /* Go back to end of packet */ ctx->at = ctx->packet_size; /* Mark packet as closed */ ctx->packet_is_open = 0; /* Not tracing anymore */ ctx->in_tracing_section = saved_in_tracing_section; end: return; } static void _serialize_er_header_default(void * const vctx, const uint32_t ert_id) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); struct barectf_default_ctx * const sctx = _FROM_VOID_PTR(struct barectf_default_ctx, vctx); const uint64_t ts = sctx->cur_last_event_ts; /* Write header structure */ { /* Align for header structure */ _ALIGN(ctx->at, 8); /* Align for `id` field */ _ALIGN(ctx->at, 8); /* Write event record type ID field */ { const uint64_t tmp_val = (uint64_t) ert_id; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 64; } /* Align for `timestamp` field */ _ALIGN(ctx->at, 8); /* Write timestamp field */ { const uint64_t tmp_val = (uint64_t) ts; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 64; } } } static void _serialize_er_default_hip_activity_begin(void * const vctx, const uint32_t p_device_id, const uint64_t p_queue_id, const char * const p_name, const uint64_t p_correlation_id, const uint32_t p_pid) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); /* Serialize header */ _serialize_er_header_default(ctx, 0); /* Write payload structure */ { /* Align for payload structure */ _ALIGN(ctx->at, 64); /* Align for `device_id` field */ _ALIGN(ctx->at, 32); /* Write `device_id` field */ { const uint32_t tmp_val = (uint32_t) p_device_id; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `queue_id` field */ _ALIGN(ctx->at, 64); /* Write `queue_id` field */ { const uint64_t tmp_val = (uint64_t) p_queue_id; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 64; } /* Align for `name` field */ _ALIGN(ctx->at, 8); /* Write `name` field */ _write_c_str(ctx, p_name); /* Align for `correlation_id` field */ _ALIGN(ctx->at, 64); /* Write `correlation_id` field */ { const uint64_t tmp_val = (uint64_t) p_correlation_id; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 64; } /* Align for `pid` field */ _ALIGN(ctx->at, 32); /* Write `pid` field */ { const uint32_t tmp_val = (uint32_t) p_pid; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } } } static void _serialize_er_default_hip_activity_end(void * const vctx, const uint64_t p_correlation_id) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); /* Serialize header */ _serialize_er_header_default(ctx, 1); /* Write payload structure */ { /* Align for payload structure */ _ALIGN(ctx->at, 64); /* Align for `correlation_id` field */ _ALIGN(ctx->at, 64); /* Write `correlation_id` field */ { const uint64_t tmp_val = (uint64_t) p_correlation_id; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 64; } } } static void _serialize_er_default_hip_api_begin(void * const vctx, const uint32_t p_cid, const uint32_t p_pid, const uint32_t p_tid, const char * const p_args) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); /* Serialize header */ _serialize_er_header_default(ctx, 2); /* Write payload structure */ { /* Align for payload structure */ _ALIGN(ctx->at, 32); /* Align for `cid` field */ _ALIGN(ctx->at, 32); /* Write `cid` field */ { const uint32_t tmp_val = (uint32_t) p_cid; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `pid` field */ _ALIGN(ctx->at, 32); /* Write `pid` field */ { const uint32_t tmp_val = (uint32_t) p_pid; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `tid` field */ _ALIGN(ctx->at, 32); /* Write `tid` field */ { const uint32_t tmp_val = (uint32_t) p_tid; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `args` field */ _ALIGN(ctx->at, 8); /* Write `args` field */ _write_c_str(ctx, p_args); } } static void _serialize_er_default_hip_api_end(void * const vctx, const uint32_t p_tid) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); /* Serialize header */ _serialize_er_header_default(ctx, 3); /* Write payload structure */ { /* Align for payload structure */ _ALIGN(ctx->at, 32); /* Align for `tid` field */ _ALIGN(ctx->at, 32); /* Write `tid` field */ { const uint32_t tmp_val = (uint32_t) p_tid; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } } } static void _serialize_er_default_hip_api_table(void * const vctx, const uint32_t p___api_table_len, const char * const * const p_api_table) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); /* Serialize header */ _serialize_er_header_default(ctx, 4); /* Write payload structure */ { /* Align for payload structure */ _ALIGN(ctx->at, 8); /* Align for `__api_table_len` field */ _ALIGN(ctx->at, 8); /* Write `__api_table_len` field */ { const uint32_t tmp_val = (uint32_t) p___api_table_len; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `api_table` field */ _ALIGN(ctx->at, 8); /* Write `api_table` field */ { uint32_t i; for (i = 0; i < (uint32_t) p___api_table_len; ++i) { /* Align for `[i]` field */ _ALIGN(ctx->at, 8); /* Write `[i]` field */ _write_c_str(ctx, p_api_table[i]); } } } } static void _serialize_er_default_hsa_activity(void * const vctx, const uint32_t p_pid, const uint64_t p_index) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); /* Serialize header */ _serialize_er_header_default(ctx, 5); /* Write payload structure */ { /* Align for payload structure */ _ALIGN(ctx->at, 64); /* Align for `pid` field */ _ALIGN(ctx->at, 32); /* Write `pid` field */ { const uint32_t tmp_val = (uint32_t) p_pid; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `index` field */ _ALIGN(ctx->at, 64); /* Write `index` field */ { const uint64_t tmp_val = (uint64_t) p_index; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 64; } } } static void _serialize_er_default_hsa_api_table(void * const vctx, const uint32_t p___api_table_len, const char * const * const p_api_table) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); /* Serialize header */ _serialize_er_header_default(ctx, 6); /* Write payload structure */ { /* Align for payload structure */ _ALIGN(ctx->at, 8); /* Align for `__api_table_len` field */ _ALIGN(ctx->at, 8); /* Write `__api_table_len` field */ { const uint32_t tmp_val = (uint32_t) p___api_table_len; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `api_table` field */ _ALIGN(ctx->at, 8); /* Write `api_table` field */ { uint32_t i; for (i = 0; i < (uint32_t) p___api_table_len; ++i) { /* Align for `[i]` field */ _ALIGN(ctx->at, 8); /* Write `[i]` field */ _write_c_str(ctx, p_api_table[i]); } } } } static void _serialize_er_default_hsa_begin(void * const vctx, const uint32_t p_cid, const uint32_t p_pid, const uint32_t p_tid, const char * const p_args, const char * const p_retval) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); /* Serialize header */ _serialize_er_header_default(ctx, 7); /* Write payload structure */ { /* Align for payload structure */ _ALIGN(ctx->at, 32); /* Align for `cid` field */ _ALIGN(ctx->at, 32); /* Write `cid` field */ { const uint32_t tmp_val = (uint32_t) p_cid; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `pid` field */ _ALIGN(ctx->at, 32); /* Write `pid` field */ { const uint32_t tmp_val = (uint32_t) p_pid; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `tid` field */ _ALIGN(ctx->at, 32); /* Write `tid` field */ { const uint32_t tmp_val = (uint32_t) p_tid; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `args` field */ _ALIGN(ctx->at, 8); /* Write `args` field */ _write_c_str(ctx, p_args); /* Align for `retval` field */ _ALIGN(ctx->at, 8); /* Write `retval` field */ _write_c_str(ctx, p_retval); } } static void _serialize_er_default_hsa_end(void * const vctx, const uint32_t p_tid) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); /* Serialize header */ _serialize_er_header_default(ctx, 8); /* Write payload structure */ { /* Align for payload structure */ _ALIGN(ctx->at, 32); /* Align for `tid` field */ _ALIGN(ctx->at, 32); /* Write `tid` field */ { const uint32_t tmp_val = (uint32_t) p_tid; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } } } static void _serialize_er_default_kernel_event_begin(void * const vctx, const uint32_t p_dispatch, const uint32_t p_gpu_id, const uint32_t p_queue_id, const uint64_t p_queue_index, const uint32_t p_pid, const uint32_t p_tid, const uint32_t p_grd, const uint32_t p_wgr, const uint32_t p_lds, const uint32_t p_scr, const uint32_t p_vgpr, const uint32_t p_sgpr, const uint32_t p_fbar, const uint64_t p_sig, const uint64_t p_obj, const char * const p_kernel_name, const uint64_t p_dispatch_time, const uint64_t p_complete_time) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); /* Serialize header */ _serialize_er_header_default(ctx, 9); /* Write payload structure */ { /* Align for payload structure */ _ALIGN(ctx->at, 64); /* Align for `dispatch` field */ _ALIGN(ctx->at, 32); /* Write `dispatch` field */ { const uint32_t tmp_val = (uint32_t) p_dispatch; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `gpu_id` field */ _ALIGN(ctx->at, 32); /* Write `gpu_id` field */ { const uint32_t tmp_val = (uint32_t) p_gpu_id; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `queue_id` field */ _ALIGN(ctx->at, 32); /* Write `queue_id` field */ { const uint32_t tmp_val = (uint32_t) p_queue_id; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `queue_index` field */ _ALIGN(ctx->at, 64); /* Write `queue_index` field */ { const uint64_t tmp_val = (uint64_t) p_queue_index; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 64; } /* Align for `pid` field */ _ALIGN(ctx->at, 32); /* Write `pid` field */ { const uint32_t tmp_val = (uint32_t) p_pid; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `tid` field */ _ALIGN(ctx->at, 32); /* Write `tid` field */ { const uint32_t tmp_val = (uint32_t) p_tid; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `grd` field */ _ALIGN(ctx->at, 32); /* Write `grd` field */ { const uint32_t tmp_val = (uint32_t) p_grd; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `wgr` field */ _ALIGN(ctx->at, 32); /* Write `wgr` field */ { const uint32_t tmp_val = (uint32_t) p_wgr; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `lds` field */ _ALIGN(ctx->at, 32); /* Write `lds` field */ { const uint32_t tmp_val = (uint32_t) p_lds; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `scr` field */ _ALIGN(ctx->at, 32); /* Write `scr` field */ { const uint32_t tmp_val = (uint32_t) p_scr; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `vgpr` field */ _ALIGN(ctx->at, 32); /* Write `vgpr` field */ { const uint32_t tmp_val = (uint32_t) p_vgpr; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `sgpr` field */ _ALIGN(ctx->at, 32); /* Write `sgpr` field */ { const uint32_t tmp_val = (uint32_t) p_sgpr; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `fbar` field */ _ALIGN(ctx->at, 32); /* Write `fbar` field */ { const uint32_t tmp_val = (uint32_t) p_fbar; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `sig` field */ _ALIGN(ctx->at, 8); /* Write `sig` field */ { const uint64_t tmp_val = (uint64_t) p_sig; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 64; } /* Align for `obj` field */ _ALIGN(ctx->at, 8); /* Write `obj` field */ { const uint64_t tmp_val = (uint64_t) p_obj; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 64; } /* Align for `kernel_name` field */ _ALIGN(ctx->at, 8); /* Write `kernel_name` field */ _write_c_str(ctx, p_kernel_name); /* Align for `dispatch_time` field */ _ALIGN(ctx->at, 64); /* Write `dispatch_time` field */ { const uint64_t tmp_val = (uint64_t) p_dispatch_time; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 64; } /* Align for `complete_time` field */ _ALIGN(ctx->at, 64); /* Write `complete_time` field */ { const uint64_t tmp_val = (uint64_t) p_complete_time; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 64; } } } static void _serialize_er_default_kernel_event_end(void * const vctx, const uint32_t p_dispatch, const uint32_t p_gpu_id) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); /* Serialize header */ _serialize_er_header_default(ctx, 10); /* Write payload structure */ { /* Align for payload structure */ _ALIGN(ctx->at, 32); /* Align for `dispatch` field */ _ALIGN(ctx->at, 32); /* Write `dispatch` field */ { const uint32_t tmp_val = (uint32_t) p_dispatch; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `gpu_id` field */ _ALIGN(ctx->at, 32); /* Write `gpu_id` field */ { const uint32_t tmp_val = (uint32_t) p_gpu_id; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } } } static void _serialize_er_default_kfd_api_table(void * const vctx, const uint32_t p___api_table_len, const char * const * const p_api_table) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); /* Serialize header */ _serialize_er_header_default(ctx, 11); /* Write payload structure */ { /* Align for payload structure */ _ALIGN(ctx->at, 8); /* Align for `__api_table_len` field */ _ALIGN(ctx->at, 8); /* Write `__api_table_len` field */ { const uint32_t tmp_val = (uint32_t) p___api_table_len; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `api_table` field */ _ALIGN(ctx->at, 8); /* Write `api_table` field */ { uint32_t i; for (i = 0; i < (uint32_t) p___api_table_len; ++i) { /* Align for `[i]` field */ _ALIGN(ctx->at, 8); /* Write `[i]` field */ _write_c_str(ctx, p_api_table[i]); } } } } static void _serialize_er_default_kfd_begin(void * const vctx, const uint32_t p_cid, const uint32_t p_pid, const uint32_t p_tid, const char * const p_args, const char * const p_retval) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); /* Serialize header */ _serialize_er_header_default(ctx, 12); /* Write payload structure */ { /* Align for payload structure */ _ALIGN(ctx->at, 32); /* Align for `cid` field */ _ALIGN(ctx->at, 32); /* Write `cid` field */ { const uint32_t tmp_val = (uint32_t) p_cid; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `pid` field */ _ALIGN(ctx->at, 32); /* Write `pid` field */ { const uint32_t tmp_val = (uint32_t) p_pid; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `tid` field */ _ALIGN(ctx->at, 32); /* Write `tid` field */ { const uint32_t tmp_val = (uint32_t) p_tid; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `args` field */ _ALIGN(ctx->at, 8); /* Write `args` field */ _write_c_str(ctx, p_args); /* Align for `retval` field */ _ALIGN(ctx->at, 8); /* Write `retval` field */ _write_c_str(ctx, p_retval); } } static void _serialize_er_default_kfd_end(void * const vctx, const uint32_t p_tid) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); /* Serialize header */ _serialize_er_header_default(ctx, 13); /* Write payload structure */ { /* Align for payload structure */ _ALIGN(ctx->at, 32); /* Align for `tid` field */ _ALIGN(ctx->at, 32); /* Write `tid` field */ { const uint32_t tmp_val = (uint32_t) p_tid; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } } } static void _serialize_er_default_metrics_table(void * const vctx, const uint32_t p___metrics_names_len, const char * const * const p_metrics_names) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); /* Serialize header */ _serialize_er_header_default(ctx, 14); /* Write payload structure */ { /* Align for payload structure */ _ALIGN(ctx->at, 8); /* Align for `__metrics_names_len` field */ _ALIGN(ctx->at, 8); /* Write `__metrics_names_len` field */ { const uint32_t tmp_val = (uint32_t) p___metrics_names_len; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `metrics_names` field */ _ALIGN(ctx->at, 8); /* Write `metrics_names` field */ { uint32_t i; for (i = 0; i < (uint32_t) p___metrics_names_len; ++i) { /* Align for `[i]` field */ _ALIGN(ctx->at, 8); /* Write `[i]` field */ _write_c_str(ctx, p_metrics_names[i]); } } } } static void _serialize_er_default_metrics_values(void * const vctx, const uint32_t p_dispatch, const uint32_t p_gpu_id, const uint32_t p___metrics_len, const uint64_t * const p_metrics) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); /* Serialize header */ _serialize_er_header_default(ctx, 15); /* Write payload structure */ { /* Align for payload structure */ _ALIGN(ctx->at, 64); /* Align for `dispatch` field */ _ALIGN(ctx->at, 32); /* Write `dispatch` field */ { const uint32_t tmp_val = (uint32_t) p_dispatch; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `gpu_id` field */ _ALIGN(ctx->at, 32); /* Write `gpu_id` field */ { const uint32_t tmp_val = (uint32_t) p_gpu_id; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `__metrics_len` field */ _ALIGN(ctx->at, 8); /* Write `__metrics_len` field */ { const uint32_t tmp_val = (uint32_t) p___metrics_len; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 32; } /* Align for `metrics` field */ _ALIGN(ctx->at, 64); /* Write `metrics` field */ { uint32_t i; for (i = 0; i < (uint32_t) p___metrics_len; ++i) { /* Align for `[i]` field */ _ALIGN(ctx->at, 64); /* Write `[i]` field */ { const uint64_t tmp_val = (uint64_t) p_metrics[i]; memcpy(&ctx->buf[_BITS_TO_BYTES(ctx->at)], &tmp_val, sizeof(tmp_val)); ctx->at += 64; } } } } } static uint32_t _er_size_default_hip_activity_begin(void * const vctx, const char * const p_name) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); uint32_t at = ctx->at; /* Add header structure size */ { /* Align for header structure */ _ALIGN(at, 8); /* Align for `id` field */ _ALIGN(at, 8); /* Add `id` bit array field's size */ at += 64; /* Align for `timestamp` field */ _ALIGN(at, 8); /* Add `timestamp` bit array field's size */ at += 64; } /* Add payload structure size */ { /* Align for payload structure */ _ALIGN(at, 64); /* Align for `device_id` field */ _ALIGN(at, 32); /* Add `device_id` bit array field's size */ at += 32; /* Align for `queue_id` field */ _ALIGN(at, 64); /* Add `queue_id` bit array field's size */ at += 64; /* Align for `name` field */ _ALIGN(at, 8); /* Add `name` string field's size */ at += _BYTES_TO_BITS(strlen(p_name) + 1); /* Align for `correlation_id` field */ _ALIGN(at, 64); /* Add `correlation_id` bit array field's size */ at += 64; /* Align for `pid` field */ _ALIGN(at, 32); /* Add `pid` bit array field's size */ at += 32; } return at - ctx->at; } static uint32_t _er_size_default_hip_activity_end(void * const vctx) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); uint32_t at = ctx->at; /* Add header structure size */ { /* Align for header structure */ _ALIGN(at, 8); /* Align for `id` field */ _ALIGN(at, 8); /* Add `id` bit array field's size */ at += 64; /* Align for `timestamp` field */ _ALIGN(at, 8); /* Add `timestamp` bit array field's size */ at += 64; } /* Add payload structure size */ { /* Align for payload structure */ _ALIGN(at, 64); /* Align for `correlation_id` field */ _ALIGN(at, 64); /* Add `correlation_id` bit array field's size */ at += 64; } return at - ctx->at; } static uint32_t _er_size_default_hip_api_begin(void * const vctx, const char * const p_args) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); uint32_t at = ctx->at; /* Add header structure size */ { /* Align for header structure */ _ALIGN(at, 8); /* Align for `id` field */ _ALIGN(at, 8); /* Add `id` bit array field's size */ at += 64; /* Align for `timestamp` field */ _ALIGN(at, 8); /* Add `timestamp` bit array field's size */ at += 64; } /* Add payload structure size */ { /* Align for payload structure */ _ALIGN(at, 32); /* Align for `cid` field */ _ALIGN(at, 32); /* Add `cid` bit array field's size */ at += 32; /* Align for `pid` field */ _ALIGN(at, 32); /* Add `pid` bit array field's size */ at += 32; /* Align for `tid` field */ _ALIGN(at, 32); /* Add `tid` bit array field's size */ at += 32; /* Align for `args` field */ _ALIGN(at, 8); /* Add `args` string field's size */ at += _BYTES_TO_BITS(strlen(p_args) + 1); } return at - ctx->at; } static uint32_t _er_size_default_hip_api_end(void * const vctx) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); uint32_t at = ctx->at; /* Add header structure size */ { /* Align for header structure */ _ALIGN(at, 8); /* Align for `id` field */ _ALIGN(at, 8); /* Add `id` bit array field's size */ at += 64; /* Align for `timestamp` field */ _ALIGN(at, 8); /* Add `timestamp` bit array field's size */ at += 64; } /* Add payload structure size */ { /* Align for payload structure */ _ALIGN(at, 32); /* Align for `tid` field */ _ALIGN(at, 32); /* Add `tid` bit array field's size */ at += 32; } return at - ctx->at; } static uint32_t _er_size_default_hip_api_table(void * const vctx, const uint32_t p___api_table_len, const char * const * const p_api_table) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); uint32_t at = ctx->at; /* Add header structure size */ { /* Align for header structure */ _ALIGN(at, 8); /* Align for `id` field */ _ALIGN(at, 8); /* Add `id` bit array field's size */ at += 64; /* Align for `timestamp` field */ _ALIGN(at, 8); /* Add `timestamp` bit array field's size */ at += 64; } /* Add payload structure size */ { /* Align for payload structure */ _ALIGN(at, 8); /* Align for `__api_table_len` field */ _ALIGN(at, 8); /* Add `__api_table_len` bit array field's size */ at += 32; /* Align for `api_table` field */ _ALIGN(at, 8); /* Write `api_table` field */ { uint32_t i; for (i = 0; i < (uint32_t) p___api_table_len; ++i) { /* Align for `[i]` field */ _ALIGN(at, 8); /* Add `[i]` string field's size */ at += _BYTES_TO_BITS(strlen(p_api_table[i]) + 1); } } } return at - ctx->at; } static uint32_t _er_size_default_hsa_activity(void * const vctx) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); uint32_t at = ctx->at; /* Add header structure size */ { /* Align for header structure */ _ALIGN(at, 8); /* Align for `id` field */ _ALIGN(at, 8); /* Add `id` bit array field's size */ at += 64; /* Align for `timestamp` field */ _ALIGN(at, 8); /* Add `timestamp` bit array field's size */ at += 64; } /* Add payload structure size */ { /* Align for payload structure */ _ALIGN(at, 64); /* Align for `pid` field */ _ALIGN(at, 32); /* Add `pid` bit array field's size */ at += 32; /* Align for `index` field */ _ALIGN(at, 64); /* Add `index` bit array field's size */ at += 64; } return at - ctx->at; } static uint32_t _er_size_default_hsa_api_table(void * const vctx, const uint32_t p___api_table_len, const char * const * const p_api_table) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); uint32_t at = ctx->at; /* Add header structure size */ { /* Align for header structure */ _ALIGN(at, 8); /* Align for `id` field */ _ALIGN(at, 8); /* Add `id` bit array field's size */ at += 64; /* Align for `timestamp` field */ _ALIGN(at, 8); /* Add `timestamp` bit array field's size */ at += 64; } /* Add payload structure size */ { /* Align for payload structure */ _ALIGN(at, 8); /* Align for `__api_table_len` field */ _ALIGN(at, 8); /* Add `__api_table_len` bit array field's size */ at += 32; /* Align for `api_table` field */ _ALIGN(at, 8); /* Write `api_table` field */ { uint32_t i; for (i = 0; i < (uint32_t) p___api_table_len; ++i) { /* Align for `[i]` field */ _ALIGN(at, 8); /* Add `[i]` string field's size */ at += _BYTES_TO_BITS(strlen(p_api_table[i]) + 1); } } } return at - ctx->at; } static uint32_t _er_size_default_hsa_begin(void * const vctx, const char * const p_args, const char * const p_retval) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); uint32_t at = ctx->at; /* Add header structure size */ { /* Align for header structure */ _ALIGN(at, 8); /* Align for `id` field */ _ALIGN(at, 8); /* Add `id` bit array field's size */ at += 64; /* Align for `timestamp` field */ _ALIGN(at, 8); /* Add `timestamp` bit array field's size */ at += 64; } /* Add payload structure size */ { /* Align for payload structure */ _ALIGN(at, 32); /* Align for `cid` field */ _ALIGN(at, 32); /* Add `cid` bit array field's size */ at += 32; /* Align for `pid` field */ _ALIGN(at, 32); /* Add `pid` bit array field's size */ at += 32; /* Align for `tid` field */ _ALIGN(at, 32); /* Add `tid` bit array field's size */ at += 32; /* Align for `args` field */ _ALIGN(at, 8); /* Add `args` string field's size */ at += _BYTES_TO_BITS(strlen(p_args) + 1); /* Align for `retval` field */ _ALIGN(at, 8); /* Add `retval` string field's size */ at += _BYTES_TO_BITS(strlen(p_retval) + 1); } return at - ctx->at; } static uint32_t _er_size_default_hsa_end(void * const vctx) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); uint32_t at = ctx->at; /* Add header structure size */ { /* Align for header structure */ _ALIGN(at, 8); /* Align for `id` field */ _ALIGN(at, 8); /* Add `id` bit array field's size */ at += 64; /* Align for `timestamp` field */ _ALIGN(at, 8); /* Add `timestamp` bit array field's size */ at += 64; } /* Add payload structure size */ { /* Align for payload structure */ _ALIGN(at, 32); /* Align for `tid` field */ _ALIGN(at, 32); /* Add `tid` bit array field's size */ at += 32; } return at - ctx->at; } static uint32_t _er_size_default_kernel_event_begin(void * const vctx, const char * const p_kernel_name) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); uint32_t at = ctx->at; /* Add header structure size */ { /* Align for header structure */ _ALIGN(at, 8); /* Align for `id` field */ _ALIGN(at, 8); /* Add `id` bit array field's size */ at += 64; /* Align for `timestamp` field */ _ALIGN(at, 8); /* Add `timestamp` bit array field's size */ at += 64; } /* Add payload structure size */ { /* Align for payload structure */ _ALIGN(at, 64); /* Align for `dispatch` field */ _ALIGN(at, 32); /* Add `dispatch` bit array field's size */ at += 32; /* Align for `gpu_id` field */ _ALIGN(at, 32); /* Add `gpu_id` bit array field's size */ at += 32; /* Align for `queue_id` field */ _ALIGN(at, 32); /* Add `queue_id` bit array field's size */ at += 32; /* Align for `queue_index` field */ _ALIGN(at, 64); /* Add `queue_index` bit array field's size */ at += 64; /* Align for `pid` field */ _ALIGN(at, 32); /* Add `pid` bit array field's size */ at += 32; /* Align for `tid` field */ _ALIGN(at, 32); /* Add `tid` bit array field's size */ at += 32; /* Align for `grd` field */ _ALIGN(at, 32); /* Add `grd` bit array field's size */ at += 32; /* Align for `wgr` field */ _ALIGN(at, 32); /* Add `wgr` bit array field's size */ at += 32; /* Align for `lds` field */ _ALIGN(at, 32); /* Add `lds` bit array field's size */ at += 32; /* Align for `scr` field */ _ALIGN(at, 32); /* Add `scr` bit array field's size */ at += 32; /* Align for `vgpr` field */ _ALIGN(at, 32); /* Add `vgpr` bit array field's size */ at += 32; /* Align for `sgpr` field */ _ALIGN(at, 32); /* Add `sgpr` bit array field's size */ at += 32; /* Align for `fbar` field */ _ALIGN(at, 32); /* Add `fbar` bit array field's size */ at += 32; /* Align for `sig` field */ _ALIGN(at, 8); /* Add `sig` bit array field's size */ at += 64; /* Align for `obj` field */ _ALIGN(at, 8); /* Add `obj` bit array field's size */ at += 64; /* Align for `kernel_name` field */ _ALIGN(at, 8); /* Add `kernel_name` string field's size */ at += _BYTES_TO_BITS(strlen(p_kernel_name) + 1); /* Align for `dispatch_time` field */ _ALIGN(at, 64); /* Add `dispatch_time` bit array field's size */ at += 64; /* Align for `complete_time` field */ _ALIGN(at, 64); /* Add `complete_time` bit array field's size */ at += 64; } return at - ctx->at; } static uint32_t _er_size_default_kernel_event_end(void * const vctx) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); uint32_t at = ctx->at; /* Add header structure size */ { /* Align for header structure */ _ALIGN(at, 8); /* Align for `id` field */ _ALIGN(at, 8); /* Add `id` bit array field's size */ at += 64; /* Align for `timestamp` field */ _ALIGN(at, 8); /* Add `timestamp` bit array field's size */ at += 64; } /* Add payload structure size */ { /* Align for payload structure */ _ALIGN(at, 32); /* Align for `dispatch` field */ _ALIGN(at, 32); /* Add `dispatch` bit array field's size */ at += 32; /* Align for `gpu_id` field */ _ALIGN(at, 32); /* Add `gpu_id` bit array field's size */ at += 32; } return at - ctx->at; } static uint32_t _er_size_default_kfd_api_table(void * const vctx, const uint32_t p___api_table_len, const char * const * const p_api_table) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); uint32_t at = ctx->at; /* Add header structure size */ { /* Align for header structure */ _ALIGN(at, 8); /* Align for `id` field */ _ALIGN(at, 8); /* Add `id` bit array field's size */ at += 64; /* Align for `timestamp` field */ _ALIGN(at, 8); /* Add `timestamp` bit array field's size */ at += 64; } /* Add payload structure size */ { /* Align for payload structure */ _ALIGN(at, 8); /* Align for `__api_table_len` field */ _ALIGN(at, 8); /* Add `__api_table_len` bit array field's size */ at += 32; /* Align for `api_table` field */ _ALIGN(at, 8); /* Write `api_table` field */ { uint32_t i; for (i = 0; i < (uint32_t) p___api_table_len; ++i) { /* Align for `[i]` field */ _ALIGN(at, 8); /* Add `[i]` string field's size */ at += _BYTES_TO_BITS(strlen(p_api_table[i]) + 1); } } } return at - ctx->at; } static uint32_t _er_size_default_kfd_begin(void * const vctx, const char * const p_args, const char * const p_retval) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); uint32_t at = ctx->at; /* Add header structure size */ { /* Align for header structure */ _ALIGN(at, 8); /* Align for `id` field */ _ALIGN(at, 8); /* Add `id` bit array field's size */ at += 64; /* Align for `timestamp` field */ _ALIGN(at, 8); /* Add `timestamp` bit array field's size */ at += 64; } /* Add payload structure size */ { /* Align for payload structure */ _ALIGN(at, 32); /* Align for `cid` field */ _ALIGN(at, 32); /* Add `cid` bit array field's size */ at += 32; /* Align for `pid` field */ _ALIGN(at, 32); /* Add `pid` bit array field's size */ at += 32; /* Align for `tid` field */ _ALIGN(at, 32); /* Add `tid` bit array field's size */ at += 32; /* Align for `args` field */ _ALIGN(at, 8); /* Add `args` string field's size */ at += _BYTES_TO_BITS(strlen(p_args) + 1); /* Align for `retval` field */ _ALIGN(at, 8); /* Add `retval` string field's size */ at += _BYTES_TO_BITS(strlen(p_retval) + 1); } return at - ctx->at; } static uint32_t _er_size_default_kfd_end(void * const vctx) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); uint32_t at = ctx->at; /* Add header structure size */ { /* Align for header structure */ _ALIGN(at, 8); /* Align for `id` field */ _ALIGN(at, 8); /* Add `id` bit array field's size */ at += 64; /* Align for `timestamp` field */ _ALIGN(at, 8); /* Add `timestamp` bit array field's size */ at += 64; } /* Add payload structure size */ { /* Align for payload structure */ _ALIGN(at, 32); /* Align for `tid` field */ _ALIGN(at, 32); /* Add `tid` bit array field's size */ at += 32; } return at - ctx->at; } static uint32_t _er_size_default_metrics_table(void * const vctx, const uint32_t p___metrics_names_len, const char * const * const p_metrics_names) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); uint32_t at = ctx->at; /* Add header structure size */ { /* Align for header structure */ _ALIGN(at, 8); /* Align for `id` field */ _ALIGN(at, 8); /* Add `id` bit array field's size */ at += 64; /* Align for `timestamp` field */ _ALIGN(at, 8); /* Add `timestamp` bit array field's size */ at += 64; } /* Add payload structure size */ { /* Align for payload structure */ _ALIGN(at, 8); /* Align for `__metrics_names_len` field */ _ALIGN(at, 8); /* Add `__metrics_names_len` bit array field's size */ at += 32; /* Align for `metrics_names` field */ _ALIGN(at, 8); /* Write `metrics_names` field */ { uint32_t i; for (i = 0; i < (uint32_t) p___metrics_names_len; ++i) { /* Align for `[i]` field */ _ALIGN(at, 8); /* Add `[i]` string field's size */ at += _BYTES_TO_BITS(strlen(p_metrics_names[i]) + 1); } } } return at - ctx->at; } static uint32_t _er_size_default_metrics_values(void * const vctx, const uint32_t p___metrics_len, const uint64_t * const p_metrics) { struct barectf_ctx * const ctx = _FROM_VOID_PTR(struct barectf_ctx, vctx); uint32_t at = ctx->at; /* Add header structure size */ { /* Align for header structure */ _ALIGN(at, 8); /* Align for `id` field */ _ALIGN(at, 8); /* Add `id` bit array field's size */ at += 64; /* Align for `timestamp` field */ _ALIGN(at, 8); /* Add `timestamp` bit array field's size */ at += 64; } /* Add payload structure size */ { /* Align for payload structure */ _ALIGN(at, 64); /* Align for `dispatch` field */ _ALIGN(at, 32); /* Add `dispatch` bit array field's size */ at += 32; /* Align for `gpu_id` field */ _ALIGN(at, 32); /* Add `gpu_id` bit array field's size */ at += 32; /* Align for `__metrics_len` field */ _ALIGN(at, 8); /* Add `__metrics_len` bit array field's size */ at += 32; /* Align for `metrics` field */ _ALIGN(at, 64); /* Write `metrics` field */ { uint32_t i; for (i = 0; i < (uint32_t) p___metrics_len; ++i) { /* Align for `[i]` field */ _ALIGN(at, 64); /* Add `[i]` bit array field's size */ at += 64; } } } return at - ctx->at; } /* Trace (data stream type `default`, event record type `hip_activity_begin`) */ void barectf_default_trace_hip_activity_begin(struct barectf_default_ctx * const sctx, const uint32_t p_device_id, const uint64_t p_queue_id, const char * const p_name, const uint64_t p_correlation_id, const uint32_t p_pid) { struct barectf_ctx * const ctx = &sctx->parent; uint32_t er_size; /* Save timestamp */ sctx->cur_last_event_ts = ctx->cbs.default_clock_get_value(ctx->data); if (!ctx->is_tracing_enabled) { goto end; } /* We can alter the packet */ ctx->in_tracing_section = 1; /* Compute event record size */ er_size = _er_size_default_hip_activity_begin(_TO_VOID_PTR(ctx), p_name); /* Is there enough space to serialize? */ if (!_reserve_er_space(_TO_VOID_PTR(ctx), er_size)) { /* no: forget this */ ctx->in_tracing_section = 0; goto end; } /* Serialize event record */ _serialize_er_default_hip_activity_begin(_TO_VOID_PTR(ctx), p_device_id, p_queue_id, p_name, p_correlation_id, p_pid); /* Commit event record */ _commit_er(_TO_VOID_PTR(ctx)); /* Not tracing anymore */ ctx->in_tracing_section = 0; end: return; } /* Trace (data stream type `default`, event record type `hip_activity_end`) */ void barectf_default_trace_hip_activity_end(struct barectf_default_ctx * const sctx, const uint64_t p_correlation_id) { struct barectf_ctx * const ctx = &sctx->parent; uint32_t er_size; /* Save timestamp */ sctx->cur_last_event_ts = ctx->cbs.default_clock_get_value(ctx->data); if (!ctx->is_tracing_enabled) { goto end; } /* We can alter the packet */ ctx->in_tracing_section = 1; /* Compute event record size */ er_size = _er_size_default_hip_activity_end(_TO_VOID_PTR(ctx)); /* Is there enough space to serialize? */ if (!_reserve_er_space(_TO_VOID_PTR(ctx), er_size)) { /* no: forget this */ ctx->in_tracing_section = 0; goto end; } /* Serialize event record */ _serialize_er_default_hip_activity_end(_TO_VOID_PTR(ctx), p_correlation_id); /* Commit event record */ _commit_er(_TO_VOID_PTR(ctx)); /* Not tracing anymore */ ctx->in_tracing_section = 0; end: return; } /* Trace (data stream type `default`, event record type `hip_api_begin`) */ void barectf_default_trace_hip_api_begin(struct barectf_default_ctx * const sctx, const uint32_t p_cid, const uint32_t p_pid, const uint32_t p_tid, const char * const p_args) { struct barectf_ctx * const ctx = &sctx->parent; uint32_t er_size; /* Save timestamp */ sctx->cur_last_event_ts = ctx->cbs.default_clock_get_value(ctx->data); if (!ctx->is_tracing_enabled) { goto end; } /* We can alter the packet */ ctx->in_tracing_section = 1; /* Compute event record size */ er_size = _er_size_default_hip_api_begin(_TO_VOID_PTR(ctx), p_args); /* Is there enough space to serialize? */ if (!_reserve_er_space(_TO_VOID_PTR(ctx), er_size)) { /* no: forget this */ ctx->in_tracing_section = 0; goto end; } /* Serialize event record */ _serialize_er_default_hip_api_begin(_TO_VOID_PTR(ctx), p_cid, p_pid, p_tid, p_args); /* Commit event record */ _commit_er(_TO_VOID_PTR(ctx)); /* Not tracing anymore */ ctx->in_tracing_section = 0; end: return; } /* Trace (data stream type `default`, event record type `hip_api_end`) */ void barectf_default_trace_hip_api_end(struct barectf_default_ctx * const sctx, const uint32_t p_tid) { struct barectf_ctx * const ctx = &sctx->parent; uint32_t er_size; /* Save timestamp */ sctx->cur_last_event_ts = ctx->cbs.default_clock_get_value(ctx->data); if (!ctx->is_tracing_enabled) { goto end; } /* We can alter the packet */ ctx->in_tracing_section = 1; /* Compute event record size */ er_size = _er_size_default_hip_api_end(_TO_VOID_PTR(ctx)); /* Is there enough space to serialize? */ if (!_reserve_er_space(_TO_VOID_PTR(ctx), er_size)) { /* no: forget this */ ctx->in_tracing_section = 0; goto end; } /* Serialize event record */ _serialize_er_default_hip_api_end(_TO_VOID_PTR(ctx), p_tid); /* Commit event record */ _commit_er(_TO_VOID_PTR(ctx)); /* Not tracing anymore */ ctx->in_tracing_section = 0; end: return; } /* Trace (data stream type `default`, event record type `hip_api_table`) */ void barectf_default_trace_hip_api_table(struct barectf_default_ctx * const sctx, const uint32_t p___api_table_len, const char * const * const p_api_table) { struct barectf_ctx * const ctx = &sctx->parent; uint32_t er_size; /* Save timestamp */ sctx->cur_last_event_ts = ctx->cbs.default_clock_get_value(ctx->data); if (!ctx->is_tracing_enabled) { goto end; } /* We can alter the packet */ ctx->in_tracing_section = 1; /* Compute event record size */ er_size = _er_size_default_hip_api_table(_TO_VOID_PTR(ctx), p___api_table_len, p_api_table); /* Is there enough space to serialize? */ if (!_reserve_er_space(_TO_VOID_PTR(ctx), er_size)) { /* no: forget this */ ctx->in_tracing_section = 0; goto end; } /* Serialize event record */ _serialize_er_default_hip_api_table(_TO_VOID_PTR(ctx), p___api_table_len, p_api_table); /* Commit event record */ _commit_er(_TO_VOID_PTR(ctx)); /* Not tracing anymore */ ctx->in_tracing_section = 0; end: return; } /* Trace (data stream type `default`, event record type `hsa_activity`) */ void barectf_default_trace_hsa_activity(struct barectf_default_ctx * const sctx, const uint32_t p_pid, const uint64_t p_index) { struct barectf_ctx * const ctx = &sctx->parent; uint32_t er_size; /* Save timestamp */ sctx->cur_last_event_ts = ctx->cbs.default_clock_get_value(ctx->data); if (!ctx->is_tracing_enabled) { goto end; } /* We can alter the packet */ ctx->in_tracing_section = 1; /* Compute event record size */ er_size = _er_size_default_hsa_activity(_TO_VOID_PTR(ctx)); /* Is there enough space to serialize? */ if (!_reserve_er_space(_TO_VOID_PTR(ctx), er_size)) { /* no: forget this */ ctx->in_tracing_section = 0; goto end; } /* Serialize event record */ _serialize_er_default_hsa_activity(_TO_VOID_PTR(ctx), p_pid, p_index); /* Commit event record */ _commit_er(_TO_VOID_PTR(ctx)); /* Not tracing anymore */ ctx->in_tracing_section = 0; end: return; } /* Trace (data stream type `default`, event record type `hsa_api_table`) */ void barectf_default_trace_hsa_api_table(struct barectf_default_ctx * const sctx, const uint32_t p___api_table_len, const char * const * const p_api_table) { struct barectf_ctx * const ctx = &sctx->parent; uint32_t er_size; /* Save timestamp */ sctx->cur_last_event_ts = ctx->cbs.default_clock_get_value(ctx->data); if (!ctx->is_tracing_enabled) { goto end; } /* We can alter the packet */ ctx->in_tracing_section = 1; /* Compute event record size */ er_size = _er_size_default_hsa_api_table(_TO_VOID_PTR(ctx), p___api_table_len, p_api_table); /* Is there enough space to serialize? */ if (!_reserve_er_space(_TO_VOID_PTR(ctx), er_size)) { /* no: forget this */ ctx->in_tracing_section = 0; goto end; } /* Serialize event record */ _serialize_er_default_hsa_api_table(_TO_VOID_PTR(ctx), p___api_table_len, p_api_table); /* Commit event record */ _commit_er(_TO_VOID_PTR(ctx)); /* Not tracing anymore */ ctx->in_tracing_section = 0; end: return; } /* Trace (data stream type `default`, event record type `hsa_begin`) */ void barectf_default_trace_hsa_begin(struct barectf_default_ctx * const sctx, const uint32_t p_cid, const uint32_t p_pid, const uint32_t p_tid, const char * const p_args, const char * const p_retval) { struct barectf_ctx * const ctx = &sctx->parent; uint32_t er_size; /* Save timestamp */ sctx->cur_last_event_ts = ctx->cbs.default_clock_get_value(ctx->data); if (!ctx->is_tracing_enabled) { goto end; } /* We can alter the packet */ ctx->in_tracing_section = 1; /* Compute event record size */ er_size = _er_size_default_hsa_begin(_TO_VOID_PTR(ctx), p_args, p_retval); /* Is there enough space to serialize? */ if (!_reserve_er_space(_TO_VOID_PTR(ctx), er_size)) { /* no: forget this */ ctx->in_tracing_section = 0; goto end; } /* Serialize event record */ _serialize_er_default_hsa_begin(_TO_VOID_PTR(ctx), p_cid, p_pid, p_tid, p_args, p_retval); /* Commit event record */ _commit_er(_TO_VOID_PTR(ctx)); /* Not tracing anymore */ ctx->in_tracing_section = 0; end: return; } /* Trace (data stream type `default`, event record type `hsa_end`) */ void barectf_default_trace_hsa_end(struct barectf_default_ctx * const sctx, const uint32_t p_tid) { struct barectf_ctx * const ctx = &sctx->parent; uint32_t er_size; /* Save timestamp */ sctx->cur_last_event_ts = ctx->cbs.default_clock_get_value(ctx->data); if (!ctx->is_tracing_enabled) { goto end; } /* We can alter the packet */ ctx->in_tracing_section = 1; /* Compute event record size */ er_size = _er_size_default_hsa_end(_TO_VOID_PTR(ctx)); /* Is there enough space to serialize? */ if (!_reserve_er_space(_TO_VOID_PTR(ctx), er_size)) { /* no: forget this */ ctx->in_tracing_section = 0; goto end; } /* Serialize event record */ _serialize_er_default_hsa_end(_TO_VOID_PTR(ctx), p_tid); /* Commit event record */ _commit_er(_TO_VOID_PTR(ctx)); /* Not tracing anymore */ ctx->in_tracing_section = 0; end: return; } /* Trace (data stream type `default`, event record type `kernel_event_begin`) */ void barectf_default_trace_kernel_event_begin(struct barectf_default_ctx * const sctx, const uint32_t p_dispatch, const uint32_t p_gpu_id, const uint32_t p_queue_id, const uint64_t p_queue_index, const uint32_t p_pid, const uint32_t p_tid, const uint32_t p_grd, const uint32_t p_wgr, const uint32_t p_lds, const uint32_t p_scr, const uint32_t p_vgpr, const uint32_t p_sgpr, const uint32_t p_fbar, const uint64_t p_sig, const uint64_t p_obj, const char * const p_kernel_name, const uint64_t p_dispatch_time, const uint64_t p_complete_time) { struct barectf_ctx * const ctx = &sctx->parent; uint32_t er_size; /* Save timestamp */ sctx->cur_last_event_ts = ctx->cbs.default_clock_get_value(ctx->data); if (!ctx->is_tracing_enabled) { goto end; } /* We can alter the packet */ ctx->in_tracing_section = 1; /* Compute event record size */ er_size = _er_size_default_kernel_event_begin(_TO_VOID_PTR(ctx), p_kernel_name); /* Is there enough space to serialize? */ if (!_reserve_er_space(_TO_VOID_PTR(ctx), er_size)) { /* no: forget this */ ctx->in_tracing_section = 0; goto end; } /* Serialize event record */ _serialize_er_default_kernel_event_begin(_TO_VOID_PTR(ctx), p_dispatch, p_gpu_id, p_queue_id, p_queue_index, p_pid, p_tid, p_grd, p_wgr, p_lds, p_scr, p_vgpr, p_sgpr, p_fbar, p_sig, p_obj, p_kernel_name, p_dispatch_time, p_complete_time); /* Commit event record */ _commit_er(_TO_VOID_PTR(ctx)); /* Not tracing anymore */ ctx->in_tracing_section = 0; end: return; } /* Trace (data stream type `default`, event record type `kernel_event_end`) */ void barectf_default_trace_kernel_event_end(struct barectf_default_ctx * const sctx, const uint32_t p_dispatch, const uint32_t p_gpu_id) { struct barectf_ctx * const ctx = &sctx->parent; uint32_t er_size; /* Save timestamp */ sctx->cur_last_event_ts = ctx->cbs.default_clock_get_value(ctx->data); if (!ctx->is_tracing_enabled) { goto end; } /* We can alter the packet */ ctx->in_tracing_section = 1; /* Compute event record size */ er_size = _er_size_default_kernel_event_end(_TO_VOID_PTR(ctx)); /* Is there enough space to serialize? */ if (!_reserve_er_space(_TO_VOID_PTR(ctx), er_size)) { /* no: forget this */ ctx->in_tracing_section = 0; goto end; } /* Serialize event record */ _serialize_er_default_kernel_event_end(_TO_VOID_PTR(ctx), p_dispatch, p_gpu_id); /* Commit event record */ _commit_er(_TO_VOID_PTR(ctx)); /* Not tracing anymore */ ctx->in_tracing_section = 0; end: return; } /* Trace (data stream type `default`, event record type `kfd_api_table`) */ void barectf_default_trace_kfd_api_table(struct barectf_default_ctx * const sctx, const uint32_t p___api_table_len, const char * const * const p_api_table) { struct barectf_ctx * const ctx = &sctx->parent; uint32_t er_size; /* Save timestamp */ sctx->cur_last_event_ts = ctx->cbs.default_clock_get_value(ctx->data); if (!ctx->is_tracing_enabled) { goto end; } /* We can alter the packet */ ctx->in_tracing_section = 1; /* Compute event record size */ er_size = _er_size_default_kfd_api_table(_TO_VOID_PTR(ctx), p___api_table_len, p_api_table); /* Is there enough space to serialize? */ if (!_reserve_er_space(_TO_VOID_PTR(ctx), er_size)) { /* no: forget this */ ctx->in_tracing_section = 0; goto end; } /* Serialize event record */ _serialize_er_default_kfd_api_table(_TO_VOID_PTR(ctx), p___api_table_len, p_api_table); /* Commit event record */ _commit_er(_TO_VOID_PTR(ctx)); /* Not tracing anymore */ ctx->in_tracing_section = 0; end: return; } /* Trace (data stream type `default`, event record type `kfd_begin`) */ void barectf_default_trace_kfd_begin(struct barectf_default_ctx * const sctx, const uint32_t p_cid, const uint32_t p_pid, const uint32_t p_tid, const char * const p_args, const char * const p_retval) { struct barectf_ctx * const ctx = &sctx->parent; uint32_t er_size; /* Save timestamp */ sctx->cur_last_event_ts = ctx->cbs.default_clock_get_value(ctx->data); if (!ctx->is_tracing_enabled) { goto end; } /* We can alter the packet */ ctx->in_tracing_section = 1; /* Compute event record size */ er_size = _er_size_default_kfd_begin(_TO_VOID_PTR(ctx), p_args, p_retval); /* Is there enough space to serialize? */ if (!_reserve_er_space(_TO_VOID_PTR(ctx), er_size)) { /* no: forget this */ ctx->in_tracing_section = 0; goto end; } /* Serialize event record */ _serialize_er_default_kfd_begin(_TO_VOID_PTR(ctx), p_cid, p_pid, p_tid, p_args, p_retval); /* Commit event record */ _commit_er(_TO_VOID_PTR(ctx)); /* Not tracing anymore */ ctx->in_tracing_section = 0; end: return; } /* Trace (data stream type `default`, event record type `kfd_end`) */ void barectf_default_trace_kfd_end(struct barectf_default_ctx * const sctx, const uint32_t p_tid) { struct barectf_ctx * const ctx = &sctx->parent; uint32_t er_size; /* Save timestamp */ sctx->cur_last_event_ts = ctx->cbs.default_clock_get_value(ctx->data); if (!ctx->is_tracing_enabled) { goto end; } /* We can alter the packet */ ctx->in_tracing_section = 1; /* Compute event record size */ er_size = _er_size_default_kfd_end(_TO_VOID_PTR(ctx)); /* Is there enough space to serialize? */ if (!_reserve_er_space(_TO_VOID_PTR(ctx), er_size)) { /* no: forget this */ ctx->in_tracing_section = 0; goto end; } /* Serialize event record */ _serialize_er_default_kfd_end(_TO_VOID_PTR(ctx), p_tid); /* Commit event record */ _commit_er(_TO_VOID_PTR(ctx)); /* Not tracing anymore */ ctx->in_tracing_section = 0; end: return; } /* Trace (data stream type `default`, event record type `metrics_table`) */ void barectf_default_trace_metrics_table(struct barectf_default_ctx * const sctx, const uint32_t p___metrics_names_len, const char * const * const p_metrics_names) { struct barectf_ctx * const ctx = &sctx->parent; uint32_t er_size; /* Save timestamp */ sctx->cur_last_event_ts = ctx->cbs.default_clock_get_value(ctx->data); if (!ctx->is_tracing_enabled) { goto end; } /* We can alter the packet */ ctx->in_tracing_section = 1; /* Compute event record size */ er_size = _er_size_default_metrics_table(_TO_VOID_PTR(ctx), p___metrics_names_len, p_metrics_names); /* Is there enough space to serialize? */ if (!_reserve_er_space(_TO_VOID_PTR(ctx), er_size)) { /* no: forget this */ ctx->in_tracing_section = 0; goto end; } /* Serialize event record */ _serialize_er_default_metrics_table(_TO_VOID_PTR(ctx), p___metrics_names_len, p_metrics_names); /* Commit event record */ _commit_er(_TO_VOID_PTR(ctx)); /* Not tracing anymore */ ctx->in_tracing_section = 0; end: return; } /* Trace (data stream type `default`, event record type `metrics_values`) */ void barectf_default_trace_metrics_values(struct barectf_default_ctx * const sctx, const uint32_t p_dispatch, const uint32_t p_gpu_id, const uint32_t p___metrics_len, const uint64_t * const p_metrics) { struct barectf_ctx * const ctx = &sctx->parent; uint32_t er_size; /* Save timestamp */ sctx->cur_last_event_ts = ctx->cbs.default_clock_get_value(ctx->data); if (!ctx->is_tracing_enabled) { goto end; } /* We can alter the packet */ ctx->in_tracing_section = 1; /* Compute event record size */ er_size = _er_size_default_metrics_values(_TO_VOID_PTR(ctx), p___metrics_len, p_metrics); /* Is there enough space to serialize? */ if (!_reserve_er_space(_TO_VOID_PTR(ctx), er_size)) { /* no: forget this */ ctx->in_tracing_section = 0; goto end; } /* Serialize event record */ _serialize_er_default_metrics_values(_TO_VOID_PTR(ctx), p_dispatch, p_gpu_id, p___metrics_len, p_metrics); /* Commit event record */ _commit_er(_TO_VOID_PTR(ctx)); /* Not tracing anymore */ ctx->in_tracing_section = 0; end: return; }
22.439787
239
0.663519
508954fb1828964ffda84b11b01c0ff2605f0015
320
h
C
venv/include/warnings.h
edu-rinaldi/Maze-Explorer
0291f4a7c3b83b9047d07baa43b8381ab621c285
[ "MIT" ]
10
2018-12-18T18:04:28.000Z
2021-04-23T07:31:13.000Z
venv/include/warnings.h
edu-rinaldi/Maze-Explorer
0291f4a7c3b83b9047d07baa43b8381ab621c285
[ "MIT" ]
1
2022-02-22T00:59:49.000Z
2022-02-22T00:59:49.000Z
venv/include/warnings.h
edu-rinaldi/Maze-Explorer
0291f4a7c3b83b9047d07baa43b8381ab621c285
[ "MIT" ]
3
2019-06-22T14:16:57.000Z
2021-12-29T22:04:42.000Z
#ifndef Py_WARNINGS_H #define Py_WARNINGS_H #ifdef __cplusplus extern "C" { #endif #define PyErr_WarnPy3k(msg, stacklevel) 0 PyAPI_FUNC(int) PyErr_WarnFormat(PyObject *category, Py_ssize_t stack_level, const char *format, ...); #ifdef __cplusplus } #endif #endif /* !Py_WARNINGS_H */
20
76
0.6875
daece4739fabdf9f179d2ce218dde6f12c56df38
407
c
C
problem-solving/time-conversion/solution.c
PreethiPrakashA/hackerrank
edb22065a5753c533654f7c57a51237d735808fb
[ "MIT" ]
4
2019-09-20T14:40:09.000Z
2019-09-26T09:04:16.000Z
problem-solving/time-conversion/solution.c
PreethiPrakashA/hackerrank
edb22065a5753c533654f7c57a51237d735808fb
[ "MIT" ]
null
null
null
problem-solving/time-conversion/solution.c
PreethiPrakashA/hackerrank
edb22065a5753c533654f7c57a51237d735808fb
[ "MIT" ]
2
2019-09-17T17:34:20.000Z
2020-05-04T18:23:35.000Z
char* timeConversion(char* s) { int hh,mm,ss; char period[3]; sscanf(s, " %d:%d:%d%s ",&hh , &mm ,&ss, period); if(strcmp(period,"PM")==0) { if(hh==12) hh=12; else hh = hh + 12; } else { if(hh==12) hh=0; } static char time[9] = "\0"; sprintf(time,"%02d:%02d:%02d", hh, mm, ss); return time; }
16.958333
53
0.412776
74f34ed47df0f5fea751a8d948b76d80aa82d16c
8,735
c
C
pkgs/apps/vips/src/libvips/format/im_tile_cache.c
manggoguy/parsec-modified
d14edfb62795805c84a4280d67b50cca175b95af
[ "BSD-3-Clause" ]
64
2015-03-06T00:30:56.000Z
2022-03-24T13:26:53.000Z
pkgs/apps/vips/src/libvips/format/im_tile_cache.c
manggoguy/parsec-modified
d14edfb62795805c84a4280d67b50cca175b95af
[ "BSD-3-Clause" ]
12
2020-12-15T08:30:19.000Z
2022-03-13T03:54:24.000Z
pkgs/apps/vips/src/libvips/format/im_tile_cache.c
manggoguy/parsec-modified
d14edfb62795805c84a4280d67b50cca175b95af
[ "BSD-3-Clause" ]
40
2015-02-26T15:31:16.000Z
2022-03-03T23:23:37.000Z
/* Tile tile cache from tiff2vips ... broken out so it can be shared with * openexr read. * * This isn't the same as im_cache(): we don't sub-divide, and we * single-thread our callee. * * 23/8/06 * - take ownership of reused tiles in case the cache is being shared * 13/2/07 * - release ownership after fillng with pixels in case we read across * threads * 4/2/10 * - gtkdoc */ /* This file is part of VIPS. VIPS is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* These files are distributed with VIPS - http://www.vips.ecs.soton.ac.uk */ /* Turn on debugging output. #define DEBUG */ #ifdef HAVE_CONFIG_H #include <config.h> #endif /*HAVE_CONFIG_H*/ #include <vips/intl.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <assert.h> #include <vips/vips.h> #include <vips/thread.h> #ifdef WITH_DMALLOC #include <dmalloc.h> #endif /*WITH_DMALLOC*/ /* Lower and upper bounds for tile cache size. Choose an exact number based on * tile size. */ #define IM_MAX_TILE_CACHE (250) #define IM_MIN_TILE_CACHE (5) /* A tile in our cache. */ typedef struct { struct _Read *read; REGION *region; /* REGION with private mem for data */ int time; /* Time of last use for flush */ int x; /* xy pos in VIPS image cods */ int y; } Tile; /* Stuff we track during a read. */ typedef struct _Read { /* Parameters. */ IMAGE *in; IMAGE *out; int tile_width; int tile_height; int max_tiles; /* Cache. */ int time; /* Update ticks for LRU here */ int ntiles; /* Current cache size */ GMutex *lock; /* Lock everything here */ GSList *cache; /* List of tiles */ } Read; static void tile_destroy( Tile *tile ) { Read *read = tile->read; read->cache = g_slist_remove( read->cache, tile ); read->ntiles -= 1; assert( read->ntiles >= 0 ); tile->read = NULL; IM_FREEF( im_region_free, tile->region ); im_free( tile ); } static void read_destroy( Read *read ) { IM_FREEF( g_mutex_free, read->lock ); while( read->cache ) { Tile *tile = (Tile *) read->cache->data; tile_destroy( tile ); } im_free( read ); } static Read * read_new( IMAGE *in, IMAGE *out, int tile_width, int tile_height, int max_tiles ) { Read *read; if( !(read = IM_NEW( NULL, Read )) ) return( NULL ); read->in = in; read->out = out; read->tile_width = tile_width; read->tile_height = tile_height; read->max_tiles = max_tiles; read->time = 0; read->ntiles = 0; read->lock = g_mutex_new(); read->cache = NULL; if( im_add_close_callback( out, (im_callback_fn) read_destroy, read, NULL ) ) { read_destroy( read ); return( NULL ); } return( read ); } static Tile * tile_new( Read *read ) { Tile *tile; if( !(tile = IM_NEW( NULL, Tile )) ) return( NULL ); tile->read = read; tile->region = NULL; tile->time = read->time; tile->x = -1; tile->y = -1; read->cache = g_slist_prepend( read->cache, tile ); assert( read->ntiles >= 0 ); read->ntiles += 1; if( !(tile->region = im_region_create( read->in )) ) { tile_destroy( tile ); return( NULL ); } return( tile ); } /* Do we have a tile in the cache? */ static Tile * tile_search( Read *read, int x, int y ) { GSList *p; for( p = read->cache; p; p = p->next ) { Tile *tile = (Tile *) p->data; if( tile->x == x && tile->y == y ) return( tile ); } return( NULL ); } static void tile_touch( Tile *tile ) { assert( tile->read->ntiles >= 0 ); tile->time = tile->read->time++; } /* Fill a tile with pixels. */ static int tile_fill( Tile *tile, int x, int y ) { Rect area; tile->x = x; tile->y = y; #ifdef DEBUG printf( "im_tile_cache: filling tile %d x %d\n", tile->x, tile->y ); #endif /*DEBUG*/ area.left = x; area.top = y; area.width = tile->read->tile_width; area.height = tile->read->tile_height; if( im_prepare( tile->region, &area ) ) return( -1 ); /* Make sure these pixels aren't part of this thread's buffer cache * ... they may be read out by another thread. */ im__region_no_ownership( tile->region ); tile_touch( tile ); return( 0 ); } /* Find existing tile, make a new tile, or if we have a full set of tiles, * reuse LRU. */ static Tile * tile_find( Read *read, int x, int y ) { Tile *tile; int oldest; GSList *p; /* In cache already? */ if( (tile = tile_search( read, x, y )) ) { tile_touch( tile ); return( tile ); } /* Cache not full? */ if( read->max_tiles == -1 || read->ntiles < read->max_tiles ) { if( !(tile = tile_new( read )) || tile_fill( tile, x, y ) ) return( NULL ); return( tile ); } /* Reuse an old one. */ oldest = read->time; tile = NULL; for( p = read->cache; p; p = p->next ) { Tile *t = (Tile *) p->data; if( t->time < oldest ) { oldest = t->time; tile = t; } } assert( tile ); /* The tile may have been created by another thread if we are sharing * the tile cache between several readers. Take ownership of the tile * to stop assert() failures in im_prepare(). This is safe, since we * are in a mutex. */ im__region_take_ownership( tile->region ); #ifdef DEBUG printf( "im_tile_cache: reusing tile %d x %d\n", tile->x, tile->y ); #endif /*DEBUG*/ if( tile_fill( tile, x, y ) ) return( NULL ); return( tile ); } /* Copy rect from from to to. */ static void copy_region( REGION *from, REGION *to, Rect *area ) { int y; /* Area should be inside both from and to. */ assert( im_rect_includesrect( &from->valid, area ) ); assert( im_rect_includesrect( &to->valid, area ) ); /* Loop down common area, copying. */ for( y = area->top; y < IM_RECT_BOTTOM( area ); y++ ) { PEL *p = (PEL *) IM_REGION_ADDR( from, area->left, y ); PEL *q = (PEL *) IM_REGION_ADDR( to, area->left, y ); memcpy( q, p, IM_IMAGE_SIZEOF_PEL( from->im ) * area->width ); } } /* Loop over the output region, filling with data from cache. */ static int fill_region( REGION *out, void *seq, void *a, void *b ) { Read *read = (Read *) a; const int tw = read->tile_width; const int th = read->tile_height; Rect *r = &out->valid; /* Find top left of tiles we need. */ int xs = (r->left / tw) * tw; int ys = (r->top / th) * th; int x, y; g_mutex_lock( read->lock ); for( y = ys; y < IM_RECT_BOTTOM( r ); y += th ) for( x = xs; x < IM_RECT_RIGHT( r ); x += tw ) { Tile *tile; Rect tarea; Rect hit; if( !(tile = tile_find( read, x, y )) ) { g_mutex_unlock( read->lock ); return( -1 ); } /* The area of the tile. */ tarea.left = x; tarea.top = y; tarea.width = tw; tarea.height = th; /* The part of the tile that we need. */ im_rect_intersectrect( &tarea, r, &hit ); copy_region( tile->region, out, &hit ); } g_mutex_unlock( read->lock ); return( 0 ); } /** * im_tile_cache: * @in: input image * @out: output image * @tile_width: tile width * @tile_height: tile height * @max_tiles: maximum number of tiles to cache * * This operation behaves rather like im_copy() between images * @in and @out, except that it keeps a cache of computed pixels. * This cache is made of up to @max_tiles tiles (a value of -1 for * means any number of tiles), and each tile is of size @tile_width * by @tile_height pixels. Each cache tile is made with a single call to * im_prepare(). * * This is a lower-level operation than im_cache() since it does no * subdivision. It is suitable for caching the output of operations like * im_exr2vips() on tiled images. * * See also: im_cache(). * * Returns: 0 on success, -1 on error. */ int im_tile_cache( IMAGE *in, IMAGE *out, int tile_width, int tile_height, int max_tiles ) { Read *read; if( tile_width <= 0 || tile_height <= 0 || max_tiles < -1 ) { im_error( "im_tile_cache", "%s", _( "bad parameters" ) ); return( -1 ); } if( im_piocheck( in, out ) || im_cp_desc( out, in ) || im_demand_hint( out, IM_SMALLTILE, in, NULL ) || !(read = read_new( in, out, tile_width, tile_height, max_tiles )) || im_generate( out, NULL, fill_region, NULL, read, NULL ) ) return( -1 ); return( 0 ); }
21.150121
79
0.633429
975a8989ab535eb27b07298117167b5fa8892f3b
13,300
c
C
src/lib/twix/v2/fork.c
EIRNf/twizzler
794383026ce605789c6cfc62093d79f0b01fe1d5
[ "BSD-3-Clause" ]
23
2021-07-09T22:11:58.000Z
2022-03-24T04:19:44.000Z
src/lib/twix/v2/fork.c
EIRNf/twizzler
794383026ce605789c6cfc62093d79f0b01fe1d5
[ "BSD-3-Clause" ]
38
2021-07-10T02:50:30.000Z
2022-03-16T01:22:46.000Z
src/lib/twix/v2/fork.c
EIRNf/twizzler
794383026ce605789c6cfc62093d79f0b01fe1d5
[ "BSD-3-Clause" ]
6
2021-07-03T04:15:06.000Z
2022-03-15T00:33:32.000Z
/* * SPDX-FileCopyrightText: 2021 Daniel Bittman <danielbittman1@gmail.com> * * SPDX-License-Identifier: BSD-3-Clause */ #include <twix/twix.h> #include <twz/obj.h> #include <twz/sys/obj.h> #include <twz/sys/thread.h> #include <twz/sys/view.h> #include "../syscalls.h" #include "v2.h" asm(".global __return_from_clone_v2\n" "__return_from_clone_v2:" "movq $1, %rdi;" "callq resetup_queue;" "popq %r15;" "popq %r14;" "popq %r13;" "popq %r12;" "popq %r11;" "popq %r10;" "popq %r9;" "popq %r8;" "popq %rbp;" "popq %rsi;" "popq %rdi;" "popq %rdx;" "popq %rbx;" "popq %rax;" /* ignore the old rsp */ "movq $0, %rax;" "ret;"); asm(".global __return_from_fork_v2\n" "__return_from_fork_v2:" "movq $0, %rdi;" "callq resetup_queue;" "popq %r15;" "popq %r14;" "popq %r13;" "popq %r12;" "popq %r11;" "popq %r10;" "popq %r9;" "popq %r8;" "popq %rbp;" "popq %rsi;" "popq %rdi;" "popq %rdx;" "popq %rbx;" "popq %rsp;" "movq $0, %rax;" "ret;"); #define _GNU_SOURCE #include <sched.h> extern uint64_t __return_from_clone_v2(void); long hook_clone(struct syscall_args *args) { unsigned long flags = args->a0; void *child_stack = (void *)args->a1; int *ptid = (int *)args->a2; int *ctid = (int *)args->a3; unsigned long newtls = args->a4; if(flags != 0x7d0f00) { return -ENOSYS; } struct twix_register_frame *frame = args->frame; memcpy((void *)((uintptr_t)child_stack - sizeof(struct twix_register_frame)), frame, sizeof(struct twix_register_frame)); child_stack = (void *)((uintptr_t)child_stack - sizeof(struct twix_register_frame)); int r; twzobj thread; if((r = twz_object_new(&thread, NULL, NULL, OBJ_VOLATILE, TWZ_OC_DFL_READ | TWZ_OC_DFL_WRITE | TWZ_OC_TIED_NONE))) { return r; } struct twzthread_repr *newrepr = twz_object_base(&thread); newrepr->reprid = twz_object_guid(&thread); struct twix_queue_entry tqe = build_tqe( TWIX_CMD_CLONE, 0, 0, 3, ID_LO(twz_object_guid(&thread)), ID_HI(twz_object_guid(&thread)), 0); twix_sync_command(&tqe); if((r = tqe.ret) < 0) { return r; } if(flags & CLONE_CHILD_SETTID) { *ctid = tqe.ret; } struct sys_thrd_spawn_args sa = { .target_view = 0, .start_func = (void *)__return_from_clone_v2, .arg = NULL, .stack_base = (void *)child_stack, // twz_ptr_rebase(TWZSLOT_STACK, soff), .stack_size = 8, .tls_base = (void *)newtls, .thrd_ctrl = TWZSLOT_THRD, }; if((r = sys_thrd_spawn(twz_object_guid(&thread), &sa, 0, NULL))) { return r; } void *arg = NULL; if(flags & CLONE_CHILD_CLEARTID) { /* TODO */ arg = ctid; } if(flags & CLONE_PARENT_SETTID) { *ptid = tqe.ret; } twz_object_delete(&thread, 0); twz_object_release(&thread); return tqe.ret; } #include <sys/mman.h> struct mmap_slot { twzobj obj; int prot; int flags; size_t slot; struct mmap_slot *next; }; extern uint64_t __return_from_clone(void); extern uint64_t __return_from_fork_v2(void); static bool __fork_view_clone(twzobj *nobj, size_t i, objid_t oid, uint32_t oflags, objid_t *nid, uint32_t *nflags) { (void)nobj; if(i == 0 || (i >= TWZSLOT_ALLOC_START && i <= TWZSLOT_ALLOC_MAX)) { *nid = oid; *nflags = oflags; return true; } return false; } /* TODO: handle cleanup */ long hook_fork(struct syscall_args *args) { /* fork() is a multi-stage process. We need to: * 1) Create a new thread, ready to execute. * 2) Register that thread as a client with the unix-server, indicating that we are * forking. 3) Clone our view object, creating new objects as necessary 4) Setup the * thread to execute a call to the unix-server that registers it as a client, and then * returns using the parent's frame. 5) Spawn the thread. * * The unix-server will recall that we are forking, and will then clone a process * internally, and keep it ready for the new thread. */ int r; twzobj current_view, new_view, new_stack; twz_view_object_init(&current_view); if((r = twz_object_new(&new_view, &current_view, NULL, OBJ_VOLATILE, TWZ_OC_DFL_READ | TWZ_OC_DFL_WRITE | TWZ_OC_DFL_USE | TWZ_OC_TIED_NONE))) { return r; } if((r = twz_view_clone(NULL, &new_view, 0, __fork_view_clone))) { goto cleanup_view; } twzobj thread; if((r = twz_object_new(&thread, NULL, NULL, OBJ_VOLATILE, TWZ_OC_DFL_READ | TWZ_OC_DFL_WRITE | TWZ_OC_TIED_NONE))) { goto cleanup_view; } twz_object_tie(&new_view, &thread, 0); twz_object_delete(&thread, 0); struct twzthread_repr *newrepr = twz_object_base(&thread); newrepr->reprid = twz_object_guid(&thread); twz_view_fixedset( &thread, TWZSLOT_THRD, twz_object_guid(&thread), VE_READ | VE_WRITE | VE_FIXED); twz_view_set(&new_view, TWZSLOT_CVIEW, twz_object_guid(&new_view), VE_READ | VE_WRITE); void *rsp; asm volatile("mov %%rsp, %0" : "=r"(rsp)::"memory"); twzobj curstack; twz_object_init_ptr(&curstack, rsp); if((r = twz_object_new(&new_stack, &curstack, NULL, OBJ_VOLATILE, TWZ_OC_DFL_READ | TWZ_OC_DFL_WRITE | TWZ_OC_TIED_NONE))) { goto cleanup_thread; } twz_view_set(&new_view, TWZSLOT_STACK, twz_object_guid(&new_stack), VE_READ | VE_WRITE); twz_object_tie(&thread, &new_stack, 0); twz_object_delete(&new_stack, 0); size_t slots_to_copy[] = { 1, TWZSLOT_UNIX, 0x10004, 0x10006 /* mmap */ }; size_t slots_to_tie[] = { 0, 0x10003 }; /* TODO: move this all to just mmap */ for(size_t j = 0; j < sizeof(slots_to_tie) / sizeof(slots_to_tie[0]); j++) { size_t i = slots_to_tie[j]; objid_t id; uint32_t flags; twz_view_get(NULL, i, &id, &flags); if(!(flags & VE_VALID)) { continue; } if(twz_object_wire_guid(&new_view, id) < 0) abort(); } for(size_t j = 0; j < sizeof(slots_to_copy) / sizeof(slots_to_copy[0]); j++) { size_t i = slots_to_copy[j]; objid_t id; uint32_t flags; twz_view_get(NULL, i, &id, &flags); if(!(flags & VE_VALID)) { continue; } // twix_log("FORK COPY-DERIVE %lx\n", i); /* Copy-derive */ objid_t nid; if((r = twz_object_create( TWZ_OC_DFL_READ | TWZ_OC_DFL_WRITE | TWZ_OC_DFL_EXEC /* TODO */ | TWZ_OC_TIED_NONE, 0, id, &nid))) { /* TODO: cleanup */ return r; } // twix_log("FORK COPY-DERIVE %lx: " IDFMT " --> " IDFMT "\n", i, IDPR(id), // IDPR(nid)); if(flags & VE_FIXED) { } // twz_view_fixedset(&pds[pid].thrd.obj, i, nid, flags); else twz_view_set(&new_view, i, nid, flags); if(twz_object_wire_guid(&new_view, nid) < 0) abort(); twz_object_delete_guid(nid, 0); // if(twz_object_delete_guid(nid, 0) < 0) // abort(); } for(size_t j = TWZSLOT_MMAP_BASE; j < TWZSLOT_MMAP_BASE + TWZSLOT_MMAP_NUM; j++) { size_t i = j; objid_t id; uint32_t flags; twz_view_get(NULL, i, &id, &flags); if(!(flags & VE_VALID) || !(flags & VE_WRITE)) { if(flags & VE_VALID) { if(twz_object_wire_guid(&new_view, id) < 0) abort(); } continue; } /* Copy-derive */ objid_t nid; if((r = twz_object_create( TWZ_OC_DFL_READ | TWZ_OC_DFL_WRITE | TWZ_OC_DFL_EXEC /* TODO */ | TWZ_OC_TIED_NONE, 0, id, &nid))) { /* TODO: cleanup */ return r; } // twix_log("FORK COPY-DERIVE %lx: " IDFMT " --> " IDFMT "\n", i, IDPR(id), // IDPR(nid)); if(flags & VE_FIXED) { } // twz_view_fixedset(&pds[pid].thrd.obj, i, nid, flags); else twz_view_set(&new_view, i, nid, flags); if(twz_object_wire_guid(&new_view, nid) < 0) abort(); if(twz_object_delete_guid(nid, 0) < 0) abort(); } struct twix_queue_entry tqe = build_tqe(TWIX_CMD_CLONE, 0, 0, 3, ID_LO(twz_object_guid(&thread)), ID_HI(twz_object_guid(&thread)), TWIX_FLAGS_CLONE_PROCESS); twix_sync_command(&tqe); if((r = tqe.ret) < 0) { goto cleanup_stack; } uint64_t fs; asm volatile("rdfsbase %%rax" : "=a"(fs)); struct sys_thrd_spawn_args sa = { .target_view = twz_object_guid(&new_view), .start_func = (void *)__return_from_fork_v2, .arg = NULL, .stack_base = (void *)args->frame, // twz_ptr_rebase(TWZSLOT_STACK, soff), .stack_size = 8, .tls_base = (void *)fs, .thrd_ctrl = TWZSLOT_THRD, }; if((r = sys_thrd_spawn(twz_object_guid(&thread), &sa, 0, NULL))) { goto cleanup_stack; } struct twix_queue_entry tqe2 = build_tqe(TWIX_CMD_WAIT_READY, 0, 0, 1, tqe.ret); twix_sync_command(&tqe2); // debug_printf(":: NEW VIEW IS " IDFMT "\n", IDPR(twz_object_guid(&new_view))); twz_object_delete(&new_view, 0); twz_object_release(&thread); twz_object_release(&new_view); twz_object_release(&new_stack); return tqe.ret; cleanup_stack: twz_object_delete(&new_view, 0); cleanup_thread: twz_object_release(&thread); cleanup_view: twz_object_delete(&new_view, 0); return r; #if 0 int r; twzobj view, cur_view; twz_view_object_init(&cur_view); // debug_printf("== creating view\n"); if((r = twz_object_new( &view, &cur_view, NULL, TWZ_OC_DFL_READ | TWZ_OC_DFL_WRITE | TWZ_OC_DFL_USE))) { return r; } objid_t vid = twz_object_guid(&view); /*if((r = twz_object_wire(NULL, &view))) return r; if((r = twz_object_delete(&view, 0))) return r;*/ // debug_printf("== creating thread\n"); if(twz_thread_create(&pds[pid].thrd) < 0) abort(); if(twz_view_clone(NULL, &view, 0, __fork_view_clone) < 0) abort(); objid_t sid; twzobj stack; twz_view_fixedset( &pds[pid].thrd.obj, TWZSLOT_THRD, pds[pid].thrd.tid, VE_READ | VE_WRITE | VE_FIXED); /* TODO: handle these */ if(twz_object_wire_guid(&view, pds[pid].thrd.tid) < 0) abort(); twz_view_set(&view, TWZSLOT_CVIEW, vid, VE_READ | VE_WRITE); // debug_printf("== creating stack\n"); if((r = twz_object_new(&stack, twz_stdstack, NULL, TWZ_OC_DFL_READ | TWZ_OC_DFL_WRITE))) { twix_log(":: fork create stack returned %d\n", r); abort(); } if(twz_object_tie(&pds[pid].thrd.obj, &stack, 0) < 0) abort(); sid = twz_object_guid(&stack); twz_view_set(&view, TWZSLOT_STACK, sid, VE_READ | VE_WRITE); // twz_object_wire_guid(&view, sid); // twix_log("FORK view = " IDFMT ", stack = " IDFMT "\n", // IDPR(twz_object_guid(&view)), // IDPR(twz_object_guid(&stack))); size_t slots_to_copy[] = { 1, TWZSLOT_UNIX, 0x10004, 0x10006 /* mmap */ }; size_t slots_to_tie[] = { 0, 0x10003 }; /* TODO: move this all to just mmap */ for(size_t j = 0; j < sizeof(slots_to_tie) / sizeof(slots_to_tie[0]); j++) { size_t i = slots_to_tie[j]; objid_t id; uint32_t flags; twz_view_get(NULL, i, &id, &flags); if(!(flags & VE_VALID)) { continue; } if(twz_object_wire_guid(&view, id) < 0) abort(); } for(size_t j = 0; j < sizeof(slots_to_copy) / sizeof(slots_to_copy[0]); j++) { size_t i = slots_to_copy[j]; objid_t id; uint32_t flags; twz_view_get(NULL, i, &id, &flags); if(!(flags & VE_VALID)) { continue; } // twix_log("FORK COPY-DERIVE %lx\n", i); /* Copy-derive */ objid_t nid; if((r = twz_object_create( TWZ_OC_DFL_READ | TWZ_OC_DFL_WRITE | TWZ_OC_DFL_EXEC /* TODO */ | TWZ_OC_TIED_NONE, 0, id, &nid))) { /* TODO: cleanup */ return r; } // twix_log("FORK COPY-DERIVE %lx: " IDFMT " --> " IDFMT "\n", i, IDPR(id), IDPR(nid)); if(flags & VE_FIXED) { } // twz_view_fixedset(&pds[pid].thrd.obj, i, nid, flags); else twz_view_set(&view, i, nid, flags); if(twz_object_wire_guid(&view, nid) < 0) abort(); if(twz_object_delete_guid(nid, 0) < 0) abort(); } for(size_t j = TWZSLOT_MMAP_BASE; j < TWZSLOT_MMAP_BASE + TWZSLOT_MMAP_NUM; j++) { size_t i = j; objid_t id; uint32_t flags; twz_view_get(NULL, i, &id, &flags); if(!(flags & VE_VALID) || !(flags & VE_WRITE)) { if(flags & VE_VALID) { if(twz_object_wire_guid(&view, id) < 0) abort(); } continue; } /* Copy-derive */ objid_t nid; if((r = twz_object_create( TWZ_OC_DFL_READ | TWZ_OC_DFL_WRITE | TWZ_OC_DFL_EXEC /* TODO */ | TWZ_OC_TIED_NONE, 0, id, &nid))) { /* TODO: cleanup */ return r; } // twix_log("FORK COPY-DERIVE %lx: " IDFMT " --> " IDFMT "\n", i, IDPR(id), IDPR(nid)); if(flags & VE_FIXED) { } // twz_view_fixedset(&pds[pid].thrd.obj, i, nid, flags); else twz_view_set(&view, i, nid, flags); if(twz_object_wire_guid(&view, nid) < 0) abort(); if(twz_object_delete_guid(nid, 0) < 0) abort(); } // twz_object_wire(NULL, &stack); // twz_object_delete(&stack, 0); // size_t soff = (uint64_t)twz_ptr_local(frame) - 1024; // void *childstack = twz_object_lea(&stack, (void *)soff); // memcpy(childstack, frame, sizeof(struct twix_register_frame)); uint64_t fs; asm volatile("rdfsbase %%rax" : "=a"(fs)); struct sys_thrd_spawn_args sa = { .target_view = vid, .start_func = (void *)__return_from_fork, .arg = NULL, .stack_base = (void *)frame, // twz_ptr_rebase(TWZSLOT_STACK, soff), .stack_size = 8, .tls_base = (void *)fs, .thrd_ctrl = TWZSLOT_THRD, }; // debug_printf("== spawning\n"); if((r = sys_thrd_spawn(pds[pid].thrd.tid, &sa, 0, NULL))) { return r; } if(twz_object_tie(NULL, &view, TIE_UNTIE) < 0) abort(); if(twz_object_tie(NULL, &stack, TIE_UNTIE) < 0) abort(); twz_object_release(&view); twz_object_release(&stack); return pid; #endif }
25.047081
97
0.645489
97afa2702207defd1cdb0efc7c75e3b1c417f9a4
108
h
C
include/cpuid.h
beltoforion/math-parser-benchmark-project
dcdb8cf290d580c564c9e57d21c6c4454e702363
[ "Apache-2.0", "Zlib", "MIT" ]
1
2021-03-07T13:17:37.000Z
2021-03-07T13:17:37.000Z
include/cpuid.h
beltoforion/math-parser-benchmark-project
dcdb8cf290d580c564c9e57d21c6c4454e702363
[ "Apache-2.0", "Zlib", "MIT" ]
null
null
null
include/cpuid.h
beltoforion/math-parser-benchmark-project
dcdb8cf290d580c564c9e57d21c6c4454e702363
[ "Apache-2.0", "Zlib", "MIT" ]
null
null
null
#ifndef CPUID_H #define CPUID_H #include <cstdio> #include <fstream> void dump_cpuid(FILE* file); #endif
10.8
28
0.740741
ee145584bd2e563aadac6b671a6ad9e13ddcaebe
884
h
C
rela/context.h
ravihammond/hanabi-convention-adaptation
5dafa91742de8e8d5810e8213e0e2771818b2f54
[ "MIT" ]
1
2022-03-24T19:41:22.000Z
2022-03-24T19:41:22.000Z
rela/context.h
ravihammond/hanabi-convention-adaptation
5dafa91742de8e8d5810e8213e0e2771818b2f54
[ "MIT" ]
null
null
null
rela/context.h
ravihammond/hanabi-convention-adaptation
5dafa91742de8e8d5810e8213e0e2771818b2f54
[ "MIT" ]
null
null
null
// Copyright (c) Facebook, Inc. and its affiliates. // All rights reserved. // // This source code is licensed under the license found in the // LICENSE file in the root directory of this source tree. // #pragma once #include <atomic> #include <cassert> #include <memory> #include <thread> #include <vector> #include "rela/thread_loop.h" namespace rela { class Context { public: Context() : started_(false) , numTerminatedThread_(0) { } Context(const Context&) = delete; Context& operator=(const Context&) = delete; ~Context(); int pushThreadLoop(std::shared_ptr<ThreadLoop> env); void start(); void pause(); void resume(); void join(); bool terminated(); private: bool started_; std::atomic<int> numTerminatedThread_; std::vector<std::shared_ptr<ThreadLoop>> loops_; std::vector<std::thread> threads_; }; } // namespace rela
17.68
62
0.684389
eee9d8ac462ef55de5ba1573ce13a5e5bd0a6f46
1,839
h
C
include/cool/ng/impl/platform.h
leon-m/cool.ng
fc079d61a9196b48ca3f20c719d73e8a8274ce5f
[ "Apache-2.0" ]
null
null
null
include/cool/ng/impl/platform.h
leon-m/cool.ng
fc079d61a9196b48ca3f20c719d73e8a8274ce5f
[ "Apache-2.0" ]
null
null
null
include/cool/ng/impl/platform.h
leon-m/cool.ng
fc079d61a9196b48ca3f20c719d73e8a8274ce5f
[ "Apache-2.0" ]
1
2018-04-25T13:15:07.000Z
2018-04-25T13:15:07.000Z
/* * Copyright (c) 2017 Leon Mlakar. * Copyright (c) 2017 Digiverse d.o.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. The * license should be included in the source distribution of the Software; * if not, you may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * The above copyright notice and licensing terms 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. */ #if !defined(cool_ng_f36a3cb0_dda1_4de1_b25a_912f5951523a) #define cool_ng_f36a3cb0_dda1_4de1_b25a_912f5951523a #if defined(WINDOWS_TARGET) && !defined(COOL_NG_STATIC_LIBRARY) # if defined(COOL_NG_BUILD) # define dlldecl __declspec( dllexport ) # else # define dlldecl __declspec( dllimport ) # endif #else # define dlldecl #endif #if defined(WINDOWS_TARGET) // MS compilers don't allow explicit virtual conversion operators!!! #define EXPLICIT_ #define INETADDR_STORAGE_ // Visual Studio 2013 does not support c++11 specifiers noexcept // and constexpr # if _MSC_VER == 1800 # define NOEXCEPT_ # define CONSTEXPR_ # else # define NOEXCEPT_ noexcept # define CONSTEXPR_ constexpr # endif #else #define EXPLICIT_ explicit #define NOEXCEPT_ noexcept #define CONSTEXPR_ constexpr #endif #endif
28.292308
79
0.755846
86fe22b0fd49e42b2f6d2b3d843ce64f8860c8ac
53,154
c
C
testsuite/EXP_4/test685.c
ishiura-compiler/CF3
0718aa176d0303a4ea8a46bd6c794997cbb8fabb
[ "MIT" ]
34
2017-07-04T14:16:12.000Z
2021-04-22T21:04:43.000Z
testsuite/EXP_4/test685.c
ishiura-compiler/CF3
0718aa176d0303a4ea8a46bd6c794997cbb8fabb
[ "MIT" ]
1
2017-07-06T03:43:44.000Z
2017-07-06T03:43:44.000Z
testsuite/EXP_4/test685.c
ishiura-compiler/CF3
0718aa176d0303a4ea8a46bd6c794997cbb8fabb
[ "MIT" ]
6
2017-07-04T16:30:42.000Z
2019-10-16T05:37:29.000Z
/* CF3 Copyright (c) 2015 ishiura-lab. Released under the MIT license. https://github.com/ishiura-compiler/CF3/MIT-LICENSE.md */ #include<stdio.h> #include<stdint.h> #include<stdlib.h> #include"test1.h" static volatile int32_t x1 = -12611; volatile int64_t t2 = 184375580830363654LL; uint64_t x13 = 528077572022LLU; volatile int16_t x14 = INT16_MIN; int32_t x17 = 249; uint16_t x20 = UINT16_MAX; uint64_t t5 = 22531352778075LLU; int64_t x29 = 0LL; volatile int8_t x30 = INT8_MIN; int32_t x31 = -782704; volatile int64_t t7 = 19971082LL; int16_t x34 = 2120; int64_t x38 = -92940540LL; volatile int16_t x42 = -99; int64_t x46 = INT64_MAX; int32_t x52 = INT32_MIN; int64_t x59 = 14093536LL; static volatile uint64_t x63 = 203034970549820LLU; volatile uint64_t t16 = 78LLU; int32_t x69 = -1; int32_t x72 = INT32_MAX; static int64_t x75 = INT64_MIN; static volatile int32_t t20 = 2287; int32_t x91 = INT32_MAX; uint32_t x92 = UINT32_MAX; static volatile int32_t x96 = 70068; int64_t x99 = INT64_MAX; int64_t t25 = INT64_MAX; volatile int32_t t29 = 13; int16_t x133 = -3; int32_t x139 = INT32_MIN; int32_t x143 = 5992575; volatile int8_t x146 = 7; uint32_t x148 = UINT32_MAX; int32_t t35 = 1; volatile int8_t x154 = INT8_MIN; uint8_t x162 = UINT8_MAX; int16_t x164 = INT16_MIN; volatile int32_t t39 = 1839376; static volatile int32_t t40 = 1785902; uint8_t x174 = 1U; static uint16_t x178 = 402U; volatile int16_t x180 = INT16_MIN; int64_t t43 = 612141961259722LL; int64_t x192 = -1LL; volatile int64_t x200 = -91637145943803136LL; int16_t x203 = -1; int32_t t49 = 9258; static int16_t x212 = 847; uint64_t x214 = 54727623339142472LLU; int16_t x222 = INT16_MAX; static volatile int64_t x224 = INT64_MAX; int16_t x229 = INT16_MIN; uint8_t x231 = 98U; volatile uint32_t x236 = UINT32_MAX; int32_t x242 = 15910; volatile int64_t x243 = INT64_MAX; int16_t x244 = 26; volatile int32_t t60 = 3551; uint64_t x249 = 2699592881571LLU; int32_t x252 = -41787; uint64_t t61 = 22394989746156648LLU; static uint32_t x259 = UINT32_MAX; int32_t t68 = -1826; volatile int8_t x282 = INT8_MIN; int16_t x283 = INT16_MAX; int64_t x289 = INT64_MIN; uint32_t x301 = 117141347U; static uint64_t x310 = 202587021463522LLU; volatile int8_t x312 = 1; int8_t x318 = INT8_MIN; static volatile int32_t t79 = -231; int8_t x332 = INT8_MAX; volatile int32_t t81 = 175261274; uint32_t x340 = 477847046U; volatile int32_t t82 = -4078; volatile int32_t x341 = INT32_MIN; int64_t x342 = -1LL; volatile uint16_t x343 = 81U; volatile int32_t t84 = INT32_MAX; int8_t x358 = -1; uint32_t x359 = UINT32_MAX; volatile int32_t t86 = -48; static uint8_t x361 = 76U; int16_t x365 = INT16_MIN; volatile int32_t t89 = 13162708; uint32_t x373 = UINT32_MAX; uint32_t t90 = UINT32_MAX; uint16_t x377 = UINT16_MAX; int16_t x380 = -1; int8_t x383 = -1; int32_t x390 = 14; volatile int32_t t94 = 238; int64_t x393 = INT64_MIN; int16_t x395 = INT16_MIN; volatile uint64_t t96 = 30191876074011977LLU; uint8_t x401 = 28U; volatile int64_t x405 = INT64_MAX; static int32_t x409 = INT32_MIN; uint32_t x410 = 509U; uint64_t x416 = UINT64_MAX; uint16_t x417 = 1783U; volatile int16_t x419 = INT16_MAX; static volatile int32_t t103 = -121; int32_t x432 = 265085579; static uint8_t x433 = 6U; int64_t x451 = INT64_MIN; static volatile int32_t t107 = 57827702; uint64_t x462 = 21210LLU; int32_t x465 = -1; int32_t t111 = -223030; volatile int64_t x472 = -2LL; int16_t x477 = INT16_MAX; volatile int8_t x478 = INT8_MAX; volatile int64_t x485 = -1LL; int32_t t118 = INT32_MAX; int16_t x505 = -1; volatile int64_t x507 = INT64_MIN; static volatile int64_t x524 = INT64_MAX; static uint64_t x525 = UINT64_MAX; uint64_t x534 = 77821541624LLU; int16_t x536 = INT16_MAX; volatile int8_t x538 = INT8_MAX; volatile int32_t x542 = -624095; uint8_t x546 = 3U; volatile uint8_t x547 = UINT8_MAX; int8_t x548 = INT8_MAX; int32_t x551 = INT32_MAX; static int64_t x552 = -391LL; int32_t x557 = 12106929; static volatile int64_t x559 = -1LL; int32_t x563 = -30222833; volatile int64_t t133 = 2648233332070021571LL; uint8_t x567 = UINT8_MAX; volatile int32_t x569 = -380837409; int16_t x572 = INT16_MIN; int32_t t135 = -1; int16_t x574 = INT16_MIN; uint32_t t136 = UINT32_MAX; volatile int64_t t137 = 2069324162798LL; volatile uint16_t x591 = 0U; uint8_t x592 = 2U; int64_t t139 = -25125369370913070LL; uint64_t x596 = 688889146LLU; int32_t x602 = INT32_MAX; volatile uint64_t x612 = 1577LLU; volatile int32_t x613 = 330; int16_t x614 = INT16_MAX; static volatile int32_t t145 = 0; int64_t x622 = 52839340009LL; int64_t x626 = -1LL; uint64_t x628 = 230LLU; int8_t x630 = INT8_MAX; volatile int32_t x633 = INT32_MIN; uint64_t x642 = 23489966837688785LLU; int16_t x647 = 5; static int8_t x652 = INT8_MIN; uint64_t x655 = 72076163788LLU; static volatile int32_t t156 = -15103; volatile int32_t x662 = -1; int64_t t160 = -88470216575LL; static int16_t x684 = INT16_MIN; int32_t x686 = 0; volatile uint32_t x691 = 191828U; uint8_t x696 = 69U; volatile int8_t x698 = 0; volatile int32_t t166 = -3515296; int32_t x707 = -31282151; int64_t x723 = INT64_MIN; int16_t x724 = -3; volatile uint64_t x728 = UINT64_MAX; uint32_t x730 = 46584277U; int32_t x738 = INT32_MIN; int16_t x739 = -1; int8_t x740 = INT8_MAX; volatile int64_t t175 = 67LL; static int32_t x742 = -1; int64_t x745 = 0LL; int16_t x747 = -1; volatile int64_t t177 = -250426584791819633LL; int8_t x753 = INT8_MIN; int16_t x754 = 893; volatile uint16_t x755 = UINT16_MAX; int32_t t180 = -3; int32_t x761 = INT32_MAX; int64_t x762 = INT64_MIN; volatile int64_t t182 = 4282104605LL; int8_t x769 = INT8_MAX; int32_t t185 = 2047894; int64_t x784 = -1LL; volatile int32_t t186 = 1; int32_t x786 = INT32_MIN; int8_t x789 = INT8_MIN; uint8_t x808 = 4U; static uint8_t x810 = UINT8_MAX; int8_t x813 = INT8_MIN; uint8_t x815 = 4U; int32_t x819 = -1; int8_t x821 = INT8_MIN; static int8_t x822 = -43; int32_t x827 = INT32_MIN; volatile int32_t t197 = -3803; int8_t x833 = INT8_MAX; static int32_t x836 = INT32_MIN; uint64_t x839 = 6348670LLU; volatile uint8_t x840 = 10U; void f0(void) { int32_t x2 = INT32_MAX; int8_t x3 = INT8_MAX; volatile int8_t x4 = INT8_MIN; volatile int32_t t0 = 539180631; t0 = (x1|(x2!=(x3/x4))); if (t0 != -12611) { NG(); } else { ; } } void f1(void) { uint32_t x5 = UINT32_MAX; volatile uint8_t x6 = UINT8_MAX; uint16_t x7 = 10943U; volatile uint8_t x8 = 14U; volatile uint32_t t1 = UINT32_MAX; t1 = (x5|(x6!=(x7/x8))); if (t1 != UINT32_MAX) { NG(); } else { ; } } void f2(void) { int64_t x9 = INT64_MIN; uint16_t x10 = 29U; static uint32_t x11 = 81383U; uint64_t x12 = 8167643685788LLU; t2 = (x9|(x10!=(x11/x12))); if (t2 != -9223372036854775807LL) { NG(); } else { ; } } void f3(void) { int32_t x15 = INT32_MIN; int64_t x16 = INT64_MIN; static uint64_t t3 = 33242458575139LLU; t3 = (x13|(x14!=(x15/x16))); if (t3 != 528077572023LLU) { NG(); } else { ; } } void f4(void) { static volatile int16_t x18 = -1; volatile int16_t x19 = INT16_MIN; volatile int32_t t4 = -2047476; t4 = (x17|(x18!=(x19/x20))); if (t4 != 249) { NG(); } else { ; } } void f5(void) { static uint64_t x21 = 61405357328569LLU; volatile int8_t x22 = INT8_MIN; int8_t x23 = INT8_MIN; int32_t x24 = -1; t5 = (x21|(x22!=(x23/x24))); if (t5 != 61405357328569LLU) { NG(); } else { ; } } void f6(void) { uint32_t x25 = UINT32_MAX; uint64_t x26 = 8449940565095LLU; int16_t x27 = INT16_MIN; int8_t x28 = INT8_MAX; volatile uint32_t t6 = UINT32_MAX; t6 = (x25|(x26!=(x27/x28))); if (t6 != UINT32_MAX) { NG(); } else { ; } } void f7(void) { int32_t x32 = 1268; t7 = (x29|(x30!=(x31/x32))); if (t7 != 1LL) { NG(); } else { ; } } void f8(void) { int8_t x33 = 26; volatile int64_t x35 = INT64_MIN; int16_t x36 = INT16_MAX; int32_t t8 = -22; t8 = (x33|(x34!=(x35/x36))); if (t8 != 27) { NG(); } else { ; } } void f9(void) { uint64_t x37 = 144456935LLU; int64_t x39 = INT64_MAX; volatile uint64_t x40 = 4123055415486621352LLU; static uint64_t t9 = 28305927184LLU; t9 = (x37|(x38!=(x39/x40))); if (t9 != 144456935LLU) { NG(); } else { ; } } void f10(void) { static int32_t x41 = INT32_MAX; int8_t x43 = INT8_MAX; int32_t x44 = -211924; volatile int32_t t10 = INT32_MAX; t10 = (x41|(x42!=(x43/x44))); if (t10 != INT32_MAX) { NG(); } else { ; } } void f11(void) { int32_t x45 = 3451; int16_t x47 = -1; uint8_t x48 = UINT8_MAX; static int32_t t11 = -770951; t11 = (x45|(x46!=(x47/x48))); if (t11 != 3451) { NG(); } else { ; } } void f12(void) { int16_t x49 = -1; volatile int32_t x50 = INT32_MIN; uint32_t x51 = UINT32_MAX; int32_t t12 = -1062818509; t12 = (x49|(x50!=(x51/x52))); if (t12 != -1) { NG(); } else { ; } } void f13(void) { volatile uint64_t x53 = 4649416018616662959LLU; int32_t x54 = INT32_MAX; static int32_t x55 = -178352; static uint64_t x56 = UINT64_MAX; uint64_t t13 = 25676LLU; t13 = (x53|(x54!=(x55/x56))); if (t13 != 4649416018616662959LLU) { NG(); } else { ; } } void f14(void) { uint8_t x57 = UINT8_MAX; uint64_t x58 = UINT64_MAX; uint64_t x60 = 849271LLU; int32_t t14 = 78659; t14 = (x57|(x58!=(x59/x60))); if (t14 != 255) { NG(); } else { ; } } void f15(void) { volatile uint32_t x61 = 287U; int16_t x62 = 1; uint64_t x64 = 1575217570LLU; uint32_t t15 = 2261U; t15 = (x61|(x62!=(x63/x64))); if (t15 != 287U) { NG(); } else { ; } } void f16(void) { static uint64_t x65 = 4504355LLU; int64_t x66 = INT64_MIN; int16_t x67 = INT16_MIN; int16_t x68 = INT16_MIN; t16 = (x65|(x66!=(x67/x68))); if (t16 != 4504355LLU) { NG(); } else { ; } } void f17(void) { int8_t x70 = 7; int16_t x71 = INT16_MIN; static int32_t t17 = 23; t17 = (x69|(x70!=(x71/x72))); if (t17 != -1) { NG(); } else { ; } } void f18(void) { static uint16_t x73 = 1283U; int16_t x74 = INT16_MAX; static uint32_t x76 = UINT32_MAX; int32_t t18 = 357; t18 = (x73|(x74!=(x75/x76))); if (t18 != 1283) { NG(); } else { ; } } void f19(void) { volatile int16_t x77 = -1; static int32_t x78 = -1; static int64_t x79 = INT64_MIN; static int32_t x80 = INT32_MAX; int32_t t19 = 1585; t19 = (x77|(x78!=(x79/x80))); if (t19 != -1) { NG(); } else { ; } } void f20(void) { int32_t x81 = INT32_MIN; static int16_t x82 = INT16_MAX; static volatile int16_t x83 = -1; uint16_t x84 = 379U; t20 = (x81|(x82!=(x83/x84))); if (t20 != -2147483647) { NG(); } else { ; } } void f21(void) { uint8_t x85 = 36U; int32_t x86 = INT32_MIN; uint64_t x87 = 95232109009444LLU; static int16_t x88 = INT16_MAX; volatile int32_t t21 = 136; t21 = (x85|(x86!=(x87/x88))); if (t21 != 37) { NG(); } else { ; } } void f22(void) { int32_t x89 = INT32_MAX; uint8_t x90 = 18U; static volatile int32_t t22 = INT32_MAX; t22 = (x89|(x90!=(x91/x92))); if (t22 != INT32_MAX) { NG(); } else { ; } } void f23(void) { uint8_t x93 = 1U; uint32_t x94 = UINT32_MAX; static int16_t x95 = INT16_MAX; int32_t t23 = -16487; t23 = (x93|(x94!=(x95/x96))); if (t23 != 1) { NG(); } else { ; } } void f24(void) { uint64_t x97 = 60LLU; static int32_t x98 = INT32_MAX; uint8_t x100 = 9U; uint64_t t24 = 365368574238560LLU; t24 = (x97|(x98!=(x99/x100))); if (t24 != 61LLU) { NG(); } else { ; } } void f25(void) { int64_t x105 = INT64_MAX; uint32_t x106 = UINT32_MAX; volatile int16_t x107 = INT16_MAX; int8_t x108 = INT8_MAX; t25 = (x105|(x106!=(x107/x108))); if (t25 != INT64_MAX) { NG(); } else { ; } } void f26(void) { uint32_t x109 = 479455274U; volatile uint8_t x110 = 7U; int64_t x111 = -1LL; int64_t x112 = INT64_MAX; volatile uint32_t t26 = 2396320U; t26 = (x109|(x110!=(x111/x112))); if (t26 != 479455275U) { NG(); } else { ; } } void f27(void) { static uint16_t x113 = 14U; uint16_t x114 = UINT16_MAX; static int64_t x115 = INT64_MIN; int16_t x116 = INT16_MAX; int32_t t27 = 62; t27 = (x113|(x114!=(x115/x116))); if (t27 != 15) { NG(); } else { ; } } void f28(void) { uint16_t x117 = 13U; volatile int64_t x118 = -1LL; uint16_t x119 = 3628U; uint16_t x120 = 30U; int32_t t28 = 61325; t28 = (x117|(x118!=(x119/x120))); if (t28 != 13) { NG(); } else { ; } } void f29(void) { volatile int32_t x121 = INT32_MIN; int32_t x122 = -471; int32_t x123 = INT32_MIN; uint16_t x124 = 14U; t29 = (x121|(x122!=(x123/x124))); if (t29 != -2147483647) { NG(); } else { ; } } void f30(void) { int64_t x125 = 20869105LL; int16_t x126 = -1; int16_t x127 = INT16_MAX; int64_t x128 = INT64_MIN; volatile int64_t t30 = -899LL; t30 = (x125|(x126!=(x127/x128))); if (t30 != 20869105LL) { NG(); } else { ; } } void f31(void) { static int32_t x129 = INT32_MAX; uint16_t x130 = 13U; static int64_t x131 = 630665LL; volatile int32_t x132 = INT32_MIN; volatile int32_t t31 = INT32_MAX; t31 = (x129|(x130!=(x131/x132))); if (t31 != INT32_MAX) { NG(); } else { ; } } void f32(void) { uint64_t x134 = 8456796002831945678LLU; int32_t x135 = INT32_MIN; uint32_t x136 = 477495U; volatile int32_t t32 = 1; t32 = (x133|(x134!=(x135/x136))); if (t32 != -3) { NG(); } else { ; } } void f33(void) { int64_t x137 = INT64_MAX; uint32_t x138 = 0U; int8_t x140 = INT8_MIN; volatile int64_t t33 = INT64_MAX; t33 = (x137|(x138!=(x139/x140))); if (t33 != INT64_MAX) { NG(); } else { ; } } void f34(void) { int8_t x141 = -1; int8_t x142 = INT8_MIN; uint64_t x144 = UINT64_MAX; static int32_t t34 = 170302; t34 = (x141|(x142!=(x143/x144))); if (t34 != -1) { NG(); } else { ; } } void f35(void) { int8_t x145 = INT8_MAX; static int8_t x147 = 3; t35 = (x145|(x146!=(x147/x148))); if (t35 != 127) { NG(); } else { ; } } void f36(void) { uint32_t x149 = UINT32_MAX; volatile int64_t x150 = INT64_MAX; int8_t x151 = INT8_MAX; int8_t x152 = INT8_MIN; volatile uint32_t t36 = UINT32_MAX; t36 = (x149|(x150!=(x151/x152))); if (t36 != UINT32_MAX) { NG(); } else { ; } } void f37(void) { uint8_t x153 = 61U; uint16_t x155 = 1U; static int16_t x156 = INT16_MIN; int32_t t37 = -66; t37 = (x153|(x154!=(x155/x156))); if (t37 != 61) { NG(); } else { ; } } void f38(void) { int8_t x157 = INT8_MAX; int64_t x158 = INT64_MAX; int64_t x159 = INT64_MIN; volatile uint64_t x160 = 584289335503LLU; volatile int32_t t38 = -7; t38 = (x157|(x158!=(x159/x160))); if (t38 != 127) { NG(); } else { ; } } void f39(void) { int32_t x161 = INT32_MIN; int8_t x163 = INT8_MIN; t39 = (x161|(x162!=(x163/x164))); if (t39 != -2147483647) { NG(); } else { ; } } void f40(void) { int32_t x165 = -1; volatile uint16_t x166 = 10636U; uint64_t x167 = UINT64_MAX; static uint8_t x168 = 1U; t40 = (x165|(x166!=(x167/x168))); if (t40 != -1) { NG(); } else { ; } } void f41(void) { uint32_t x169 = 100575U; int16_t x170 = INT16_MIN; volatile uint8_t x171 = 10U; int16_t x172 = -1; volatile uint32_t t41 = 965U; t41 = (x169|(x170!=(x171/x172))); if (t41 != 100575U) { NG(); } else { ; } } void f42(void) { int8_t x173 = INT8_MIN; uint64_t x175 = 10002902875448LLU; uint32_t x176 = 133831649U; int32_t t42 = -147661; t42 = (x173|(x174!=(x175/x176))); if (t42 != -127) { NG(); } else { ; } } void f43(void) { int64_t x177 = -1LL; int32_t x179 = -1; t43 = (x177|(x178!=(x179/x180))); if (t43 != -1LL) { NG(); } else { ; } } void f44(void) { int16_t x181 = -1; int8_t x182 = 0; int16_t x183 = INT16_MIN; uint64_t x184 = 1913LLU; int32_t t44 = 28602747; t44 = (x181|(x182!=(x183/x184))); if (t44 != -1) { NG(); } else { ; } } void f45(void) { static volatile uint32_t x185 = 29932675U; volatile int8_t x186 = INT8_MAX; int8_t x187 = 0; static int16_t x188 = -852; volatile uint32_t t45 = 2U; t45 = (x185|(x186!=(x187/x188))); if (t45 != 29932675U) { NG(); } else { ; } } void f46(void) { int64_t x189 = INT64_MAX; uint32_t x190 = UINT32_MAX; volatile int32_t x191 = 0; volatile int64_t t46 = INT64_MAX; t46 = (x189|(x190!=(x191/x192))); if (t46 != INT64_MAX) { NG(); } else { ; } } void f47(void) { uint16_t x193 = 244U; volatile int64_t x194 = INT64_MIN; int64_t x195 = -1LL; static volatile int8_t x196 = INT8_MAX; int32_t t47 = -1; t47 = (x193|(x194!=(x195/x196))); if (t47 != 245) { NG(); } else { ; } } void f48(void) { uint32_t x197 = 893U; volatile uint8_t x198 = 50U; int16_t x199 = INT16_MIN; static uint32_t t48 = 0U; t48 = (x197|(x198!=(x199/x200))); if (t48 != 893U) { NG(); } else { ; } } void f49(void) { int32_t x201 = INT32_MIN; int16_t x202 = INT16_MIN; int64_t x204 = 45507290421LL; t49 = (x201|(x202!=(x203/x204))); if (t49 != -2147483647) { NG(); } else { ; } } void f50(void) { int32_t x205 = INT32_MAX; int16_t x206 = INT16_MAX; int16_t x207 = INT16_MIN; int32_t x208 = -1; volatile int32_t t50 = INT32_MAX; t50 = (x205|(x206!=(x207/x208))); if (t50 != INT32_MAX) { NG(); } else { ; } } void f51(void) { int16_t x209 = INT16_MIN; uint64_t x210 = UINT64_MAX; uint32_t x211 = 13U; static volatile int32_t t51 = -15; t51 = (x209|(x210!=(x211/x212))); if (t51 != -32767) { NG(); } else { ; } } void f52(void) { int32_t x213 = INT32_MIN; volatile uint8_t x215 = 3U; int8_t x216 = INT8_MIN; int32_t t52 = 104; t52 = (x213|(x214!=(x215/x216))); if (t52 != -2147483647) { NG(); } else { ; } } void f53(void) { int64_t x217 = -1LL; int16_t x218 = INT16_MIN; static int64_t x219 = -1LL; static volatile int16_t x220 = INT16_MIN; static int64_t t53 = -25885311LL; t53 = (x217|(x218!=(x219/x220))); if (t53 != -1LL) { NG(); } else { ; } } void f54(void) { uint64_t x221 = 2752213863962215696LLU; static uint16_t x223 = 701U; uint64_t t54 = 7809742521LLU; t54 = (x221|(x222!=(x223/x224))); if (t54 != 2752213863962215697LLU) { NG(); } else { ; } } void f55(void) { static uint8_t x225 = 12U; uint32_t x226 = 102366681U; volatile uint64_t x227 = 1684361611043205005LLU; volatile uint64_t x228 = UINT64_MAX; volatile int32_t t55 = -28; t55 = (x225|(x226!=(x227/x228))); if (t55 != 13) { NG(); } else { ; } } void f56(void) { static uint16_t x230 = UINT16_MAX; uint8_t x232 = 9U; static volatile int32_t t56 = -770081; t56 = (x229|(x230!=(x231/x232))); if (t56 != -32767) { NG(); } else { ; } } void f57(void) { static uint16_t x233 = 180U; int32_t x234 = -1; int8_t x235 = -7; static int32_t t57 = 506; t57 = (x233|(x234!=(x235/x236))); if (t57 != 181) { NG(); } else { ; } } void f58(void) { uint8_t x237 = 1U; int16_t x238 = INT16_MIN; volatile int32_t x239 = -1; volatile int32_t x240 = 1; int32_t t58 = 76; t58 = (x237|(x238!=(x239/x240))); if (t58 != 1) { NG(); } else { ; } } void f59(void) { volatile uint64_t x241 = 2248715084816LLU; uint64_t t59 = 21860529299320LLU; t59 = (x241|(x242!=(x243/x244))); if (t59 != 2248715084817LLU) { NG(); } else { ; } } void f60(void) { int16_t x245 = INT16_MIN; int64_t x246 = -1LL; uint8_t x247 = 7U; int32_t x248 = INT32_MAX; t60 = (x245|(x246!=(x247/x248))); if (t60 != -32767) { NG(); } else { ; } } void f61(void) { int64_t x250 = -8221736776LL; volatile int8_t x251 = INT8_MIN; t61 = (x249|(x250!=(x251/x252))); if (t61 != 2699592881571LLU) { NG(); } else { ; } } void f62(void) { int32_t x253 = INT32_MAX; static uint16_t x254 = 2U; uint64_t x255 = 28628638782828714LLU; static int64_t x256 = INT64_MIN; static int32_t t62 = INT32_MAX; t62 = (x253|(x254!=(x255/x256))); if (t62 != INT32_MAX) { NG(); } else { ; } } void f63(void) { static int32_t x257 = -198376; int16_t x258 = -1; static int8_t x260 = INT8_MIN; int32_t t63 = 464101; t63 = (x257|(x258!=(x259/x260))); if (t63 != -198375) { NG(); } else { ; } } void f64(void) { volatile int16_t x261 = INT16_MIN; uint64_t x262 = UINT64_MAX; int16_t x263 = -1; uint8_t x264 = 1U; volatile int32_t t64 = 50; t64 = (x261|(x262!=(x263/x264))); if (t64 != -32768) { NG(); } else { ; } } void f65(void) { int32_t x265 = -25; uint8_t x266 = UINT8_MAX; int32_t x267 = INT32_MAX; int64_t x268 = -12936LL; static volatile int32_t t65 = -531; t65 = (x265|(x266!=(x267/x268))); if (t65 != -25) { NG(); } else { ; } } void f66(void) { uint32_t x269 = 4U; uint64_t x270 = 791797812643411LLU; uint8_t x271 = 2U; int64_t x272 = INT64_MIN; uint32_t t66 = 20825902U; t66 = (x269|(x270!=(x271/x272))); if (t66 != 5U) { NG(); } else { ; } } void f67(void) { volatile int64_t x273 = -254015926901LL; uint32_t x274 = 2745U; int32_t x275 = -1; int16_t x276 = INT16_MIN; int64_t t67 = -9303199976LL; t67 = (x273|(x274!=(x275/x276))); if (t67 != -254015926901LL) { NG(); } else { ; } } void f68(void) { static int8_t x277 = -1; uint8_t x278 = 14U; static uint8_t x279 = 69U; int64_t x280 = INT64_MIN; t68 = (x277|(x278!=(x279/x280))); if (t68 != -1) { NG(); } else { ; } } void f69(void) { static int32_t x281 = INT32_MIN; volatile uint32_t x284 = UINT32_MAX; static volatile int32_t t69 = -1; t69 = (x281|(x282!=(x283/x284))); if (t69 != -2147483647) { NG(); } else { ; } } void f70(void) { int8_t x285 = 0; uint64_t x286 = 1LLU; uint16_t x287 = 891U; static uint32_t x288 = 23U; int32_t t70 = -47445; t70 = (x285|(x286!=(x287/x288))); if (t70 != 1) { NG(); } else { ; } } void f71(void) { static int32_t x290 = INT32_MIN; int16_t x291 = 11; uint16_t x292 = 17U; static int64_t t71 = -561301662885026806LL; t71 = (x289|(x290!=(x291/x292))); if (t71 != -9223372036854775807LL) { NG(); } else { ; } } void f72(void) { uint16_t x293 = 5U; volatile uint32_t x294 = 13573U; static volatile int8_t x295 = -1; static int64_t x296 = INT64_MIN; volatile int32_t t72 = 0; t72 = (x293|(x294!=(x295/x296))); if (t72 != 5) { NG(); } else { ; } } void f73(void) { volatile int8_t x302 = INT8_MIN; static int8_t x303 = INT8_MAX; static uint8_t x304 = 7U; uint32_t t73 = 12U; t73 = (x301|(x302!=(x303/x304))); if (t73 != 117141347U) { NG(); } else { ; } } void f74(void) { uint32_t x305 = 29079U; int8_t x306 = 1; int8_t x307 = 62; static int16_t x308 = -1; volatile uint32_t t74 = 71480U; t74 = (x305|(x306!=(x307/x308))); if (t74 != 29079U) { NG(); } else { ; } } void f75(void) { uint64_t x309 = 505808LLU; static int8_t x311 = -10; volatile uint64_t t75 = 122LLU; t75 = (x309|(x310!=(x311/x312))); if (t75 != 505809LLU) { NG(); } else { ; } } void f76(void) { uint8_t x313 = 2U; volatile int64_t x314 = 1604705711777LL; int16_t x315 = -1; uint32_t x316 = UINT32_MAX; static volatile int32_t t76 = -90250; t76 = (x313|(x314!=(x315/x316))); if (t76 != 3) { NG(); } else { ; } } void f77(void) { int32_t x317 = INT32_MAX; uint16_t x319 = UINT16_MAX; static int32_t x320 = -1; volatile int32_t t77 = INT32_MAX; t77 = (x317|(x318!=(x319/x320))); if (t77 != INT32_MAX) { NG(); } else { ; } } void f78(void) { uint32_t x321 = UINT32_MAX; uint8_t x322 = UINT8_MAX; int64_t x323 = 221480168LL; static int32_t x324 = INT32_MIN; uint32_t t78 = UINT32_MAX; t78 = (x321|(x322!=(x323/x324))); if (t78 != UINT32_MAX) { NG(); } else { ; } } void f79(void) { int32_t x325 = INT32_MIN; int32_t x326 = 57078; volatile int64_t x327 = INT64_MIN; int32_t x328 = -152982224; t79 = (x325|(x326!=(x327/x328))); if (t79 != -2147483647) { NG(); } else { ; } } void f80(void) { static int64_t x329 = INT64_MIN; int16_t x330 = INT16_MIN; int8_t x331 = 1; int64_t t80 = -1LL; t80 = (x329|(x330!=(x331/x332))); if (t80 != -9223372036854775807LL) { NG(); } else { ; } } void f81(void) { uint16_t x333 = UINT16_MAX; int32_t x334 = INT32_MIN; int8_t x335 = -6; static volatile int32_t x336 = 4240778; t81 = (x333|(x334!=(x335/x336))); if (t81 != 65535) { NG(); } else { ; } } void f82(void) { int32_t x337 = INT32_MIN; int16_t x338 = INT16_MIN; static volatile int8_t x339 = INT8_MIN; t82 = (x337|(x338!=(x339/x340))); if (t82 != -2147483647) { NG(); } else { ; } } void f83(void) { int64_t x344 = -1LL; volatile int32_t t83 = -2101; t83 = (x341|(x342!=(x343/x344))); if (t83 != -2147483647) { NG(); } else { ; } } void f84(void) { int32_t x345 = INT32_MAX; int32_t x346 = INT32_MAX; int64_t x347 = INT64_MIN; int16_t x348 = INT16_MIN; t84 = (x345|(x346!=(x347/x348))); if (t84 != INT32_MAX) { NG(); } else { ; } } void f85(void) { int32_t x349 = -3120; int32_t x350 = -1; static uint8_t x351 = 33U; int64_t x352 = INT64_MIN; int32_t t85 = 4; t85 = (x349|(x350!=(x351/x352))); if (t85 != -3119) { NG(); } else { ; } } void f86(void) { int32_t x357 = INT32_MIN; uint32_t x360 = 11367U; t86 = (x357|(x358!=(x359/x360))); if (t86 != -2147483647) { NG(); } else { ; } } void f87(void) { uint8_t x362 = 1U; int32_t x363 = 9701; int8_t x364 = INT8_MAX; static int32_t t87 = -14; t87 = (x361|(x362!=(x363/x364))); if (t87 != 77) { NG(); } else { ; } } void f88(void) { uint8_t x366 = UINT8_MAX; int32_t x367 = -1; static uint64_t x368 = UINT64_MAX; volatile int32_t t88 = 4964; t88 = (x365|(x366!=(x367/x368))); if (t88 != -32767) { NG(); } else { ; } } void f89(void) { static uint16_t x369 = 0U; static int16_t x370 = INT16_MIN; uint8_t x371 = 6U; uint64_t x372 = UINT64_MAX; t89 = (x369|(x370!=(x371/x372))); if (t89 != 1) { NG(); } else { ; } } void f90(void) { static int8_t x374 = INT8_MIN; volatile int16_t x375 = -1; int8_t x376 = INT8_MIN; t90 = (x373|(x374!=(x375/x376))); if (t90 != UINT32_MAX) { NG(); } else { ; } } void f91(void) { volatile int64_t x378 = -1LL; static volatile uint64_t x379 = UINT64_MAX; static volatile int32_t t91 = 226; t91 = (x377|(x378!=(x379/x380))); if (t91 != 65535) { NG(); } else { ; } } void f92(void) { volatile uint32_t x381 = 448895233U; uint64_t x382 = 11852LLU; int64_t x384 = -231064609019646LL; uint32_t t92 = 1966445506U; t92 = (x381|(x382!=(x383/x384))); if (t92 != 448895233U) { NG(); } else { ; } } void f93(void) { int32_t x385 = -1; uint16_t x386 = 26U; int32_t x387 = 1; int16_t x388 = -1; volatile int32_t t93 = 46423; t93 = (x385|(x386!=(x387/x388))); if (t93 != -1) { NG(); } else { ; } } void f94(void) { volatile int32_t x389 = INT32_MIN; static int8_t x391 = INT8_MIN; int64_t x392 = INT64_MAX; t94 = (x389|(x390!=(x391/x392))); if (t94 != -2147483647) { NG(); } else { ; } } void f95(void) { volatile int16_t x394 = INT16_MIN; static int32_t x396 = 1083; int64_t t95 = 4925229LL; t95 = (x393|(x394!=(x395/x396))); if (t95 != -9223372036854775807LL) { NG(); } else { ; } } void f96(void) { uint64_t x397 = 42491505701LLU; int32_t x398 = 2; int16_t x399 = INT16_MIN; static volatile int32_t x400 = -1; t96 = (x397|(x398!=(x399/x400))); if (t96 != 42491505701LLU) { NG(); } else { ; } } void f97(void) { static uint16_t x402 = 2U; volatile uint32_t x403 = 76U; int8_t x404 = INT8_MAX; int32_t t97 = 22588; t97 = (x401|(x402!=(x403/x404))); if (t97 != 29) { NG(); } else { ; } } void f98(void) { static int16_t x406 = INT16_MIN; uint64_t x407 = 2211721913173402LLU; int32_t x408 = 3588774; volatile int64_t t98 = INT64_MAX; t98 = (x405|(x406!=(x407/x408))); if (t98 != INT64_MAX) { NG(); } else { ; } } void f99(void) { volatile int8_t x411 = INT8_MAX; static uint16_t x412 = 3U; int32_t t99 = 496470; t99 = (x409|(x410!=(x411/x412))); if (t99 != -2147483647) { NG(); } else { ; } } void f100(void) { int8_t x413 = INT8_MIN; static int64_t x414 = INT64_MIN; volatile uint32_t x415 = 26U; int32_t t100 = -1859; t100 = (x413|(x414!=(x415/x416))); if (t100 != -127) { NG(); } else { ; } } void f101(void) { int8_t x418 = INT8_MIN; int32_t x420 = INT32_MIN; int32_t t101 = -239328; t101 = (x417|(x418!=(x419/x420))); if (t101 != 1783) { NG(); } else { ; } } void f102(void) { int64_t x421 = -182869LL; uint16_t x422 = 34U; int8_t x423 = INT8_MAX; uint16_t x424 = 4344U; static volatile int64_t t102 = 580LL; t102 = (x421|(x422!=(x423/x424))); if (t102 != -182869LL) { NG(); } else { ; } } void f103(void) { int8_t x425 = INT8_MIN; volatile int8_t x426 = 15; int64_t x427 = -1LL; int32_t x428 = INT32_MIN; t103 = (x425|(x426!=(x427/x428))); if (t103 != -127) { NG(); } else { ; } } void f104(void) { static int8_t x429 = INT8_MAX; int64_t x430 = 104786610770LL; volatile uint8_t x431 = 67U; int32_t t104 = 822738568; t104 = (x429|(x430!=(x431/x432))); if (t104 != 127) { NG(); } else { ; } } void f105(void) { uint64_t x434 = UINT64_MAX; uint64_t x435 = UINT64_MAX; int32_t x436 = INT32_MAX; volatile int32_t t105 = -525; t105 = (x433|(x434!=(x435/x436))); if (t105 != 7) { NG(); } else { ; } } void f106(void) { int16_t x441 = -1; static int16_t x442 = INT16_MAX; int32_t x443 = 123835113; int16_t x444 = -18; static volatile int32_t t106 = 206; t106 = (x441|(x442!=(x443/x444))); if (t106 != -1) { NG(); } else { ; } } void f107(void) { int16_t x449 = -1; static volatile int16_t x450 = -1; volatile int16_t x452 = INT16_MIN; t107 = (x449|(x450!=(x451/x452))); if (t107 != -1) { NG(); } else { ; } } void f108(void) { static int64_t x453 = -1LL; int16_t x454 = INT16_MAX; int32_t x455 = -9; int64_t x456 = INT64_MAX; static volatile int64_t t108 = -3323966619232833LL; t108 = (x453|(x454!=(x455/x456))); if (t108 != -1LL) { NG(); } else { ; } } void f109(void) { uint32_t x457 = 2U; static uint32_t x458 = 164U; int16_t x459 = 8379; volatile int16_t x460 = -1; static volatile uint32_t t109 = 7U; t109 = (x457|(x458!=(x459/x460))); if (t109 != 3U) { NG(); } else { ; } } void f110(void) { uint8_t x461 = 10U; int16_t x463 = -11; volatile int64_t x464 = -1LL; int32_t t110 = -34; t110 = (x461|(x462!=(x463/x464))); if (t110 != 11) { NG(); } else { ; } } void f111(void) { uint16_t x466 = UINT16_MAX; int32_t x467 = -1; uint8_t x468 = 53U; t111 = (x465|(x466!=(x467/x468))); if (t111 != -1) { NG(); } else { ; } } void f112(void) { int64_t x469 = -1LL; int16_t x470 = -1; int64_t x471 = INT64_MIN; volatile int64_t t112 = 1390LL; t112 = (x469|(x470!=(x471/x472))); if (t112 != -1LL) { NG(); } else { ; } } void f113(void) { int8_t x473 = -1; int8_t x474 = -1; int16_t x475 = -1; int64_t x476 = -16234671694205LL; int32_t t113 = -157393127; t113 = (x473|(x474!=(x475/x476))); if (t113 != -1) { NG(); } else { ; } } void f114(void) { uint32_t x479 = 2118U; int16_t x480 = 13932; volatile int32_t t114 = -44; t114 = (x477|(x478!=(x479/x480))); if (t114 != 32767) { NG(); } else { ; } } void f115(void) { int64_t x486 = INT64_MIN; int64_t x487 = INT64_MAX; int32_t x488 = INT32_MIN; int64_t t115 = 7304620332527LL; t115 = (x485|(x486!=(x487/x488))); if (t115 != -1LL) { NG(); } else { ; } } void f116(void) { uint32_t x493 = 425U; int64_t x494 = -379140695LL; int64_t x495 = -1LL; volatile uint32_t x496 = 53553U; uint32_t t116 = 894037688U; t116 = (x493|(x494!=(x495/x496))); if (t116 != 425U) { NG(); } else { ; } } void f117(void) { uint16_t x497 = UINT16_MAX; uint16_t x498 = 18245U; int64_t x499 = -1579087058LL; int16_t x500 = INT16_MAX; static int32_t t117 = 20; t117 = (x497|(x498!=(x499/x500))); if (t117 != 65535) { NG(); } else { ; } } void f118(void) { int32_t x501 = INT32_MAX; int64_t x502 = INT64_MAX; static uint16_t x503 = 1U; int32_t x504 = INT32_MIN; t118 = (x501|(x502!=(x503/x504))); if (t118 != INT32_MAX) { NG(); } else { ; } } void f119(void) { int32_t x506 = -15999929; static int16_t x508 = 217; int32_t t119 = -29312; t119 = (x505|(x506!=(x507/x508))); if (t119 != -1) { NG(); } else { ; } } void f120(void) { int64_t x509 = INT64_MIN; int16_t x510 = -1; int64_t x511 = INT64_MAX; int16_t x512 = -1; volatile int64_t t120 = -4LL; t120 = (x509|(x510!=(x511/x512))); if (t120 != -9223372036854775807LL) { NG(); } else { ; } } void f121(void) { static uint64_t x513 = 41069494659LLU; volatile int32_t x514 = 2024; int32_t x515 = INT32_MAX; uint8_t x516 = UINT8_MAX; volatile uint64_t t121 = 143556562254LLU; t121 = (x513|(x514!=(x515/x516))); if (t121 != 41069494659LLU) { NG(); } else { ; } } void f122(void) { int32_t x517 = -1; volatile int64_t x518 = 1009092LL; int16_t x519 = 0; int64_t x520 = -8177LL; int32_t t122 = 55; t122 = (x517|(x518!=(x519/x520))); if (t122 != -1) { NG(); } else { ; } } void f123(void) { int32_t x521 = -338486; volatile int64_t x522 = INT64_MAX; int64_t x523 = INT64_MAX; int32_t t123 = 6596; t123 = (x521|(x522!=(x523/x524))); if (t123 != -338485) { NG(); } else { ; } } void f124(void) { int32_t x526 = 940; int32_t x527 = 111424; uint8_t x528 = UINT8_MAX; static uint64_t t124 = UINT64_MAX; t124 = (x525|(x526!=(x527/x528))); if (t124 != UINT64_MAX) { NG(); } else { ; } } void f125(void) { int16_t x529 = -3098; uint16_t x530 = UINT16_MAX; uint8_t x531 = 1U; int64_t x532 = -1LL; static int32_t t125 = -5070; t125 = (x529|(x530!=(x531/x532))); if (t125 != -3097) { NG(); } else { ; } } void f126(void) { volatile uint16_t x533 = 450U; int8_t x535 = -15; volatile int32_t t126 = -9159; t126 = (x533|(x534!=(x535/x536))); if (t126 != 451) { NG(); } else { ; } } void f127(void) { static int32_t x537 = -206339; int64_t x539 = INT64_MAX; int16_t x540 = 4649; volatile int32_t t127 = -21698; t127 = (x537|(x538!=(x539/x540))); if (t127 != -206339) { NG(); } else { ; } } void f128(void) { int8_t x541 = -1; int64_t x543 = INT64_MAX; int8_t x544 = 1; volatile int32_t t128 = -26; t128 = (x541|(x542!=(x543/x544))); if (t128 != -1) { NG(); } else { ; } } void f129(void) { uint8_t x545 = 7U; int32_t t129 = -310769; t129 = (x545|(x546!=(x547/x548))); if (t129 != 7) { NG(); } else { ; } } void f130(void) { static uint16_t x549 = 15U; int64_t x550 = INT64_MIN; int32_t t130 = -241; t130 = (x549|(x550!=(x551/x552))); if (t130 != 15) { NG(); } else { ; } } void f131(void) { volatile int64_t x553 = INT64_MIN; volatile int64_t x554 = INT64_MIN; uint8_t x555 = 5U; static volatile uint64_t x556 = UINT64_MAX; static volatile int64_t t131 = -2131277LL; t131 = (x553|(x554!=(x555/x556))); if (t131 != -9223372036854775807LL) { NG(); } else { ; } } void f132(void) { int64_t x558 = -1LL; int32_t x560 = -1877061; volatile int32_t t132 = 48652953; t132 = (x557|(x558!=(x559/x560))); if (t132 != 12106929) { NG(); } else { ; } } void f133(void) { int64_t x561 = 15LL; int64_t x562 = INT64_MIN; static uint32_t x564 = 51541U; t133 = (x561|(x562!=(x563/x564))); if (t133 != 15LL) { NG(); } else { ; } } void f134(void) { volatile uint16_t x565 = 12761U; static uint64_t x566 = 31683552LLU; volatile int64_t x568 = 1LL; int32_t t134 = 207; t134 = (x565|(x566!=(x567/x568))); if (t134 != 12761) { NG(); } else { ; } } void f135(void) { int16_t x570 = 154; uint64_t x571 = UINT64_MAX; t135 = (x569|(x570!=(x571/x572))); if (t135 != -380837409) { NG(); } else { ; } } void f136(void) { uint32_t x573 = UINT32_MAX; int64_t x575 = INT64_MAX; int64_t x576 = -1196943862151LL; t136 = (x573|(x574!=(x575/x576))); if (t136 != UINT32_MAX) { NG(); } else { ; } } void f137(void) { static int64_t x581 = INT64_MIN; static volatile int16_t x582 = INT16_MIN; static int8_t x583 = INT8_MAX; int64_t x584 = INT64_MIN; t137 = (x581|(x582!=(x583/x584))); if (t137 != -9223372036854775807LL) { NG(); } else { ; } } void f138(void) { uint64_t x585 = 2966667794LLU; int8_t x586 = 7; volatile int8_t x587 = 1; int32_t x588 = -3; uint64_t t138 = 4096481528851432199LLU; t138 = (x585|(x586!=(x587/x588))); if (t138 != 2966667795LLU) { NG(); } else { ; } } void f139(void) { int64_t x589 = INT64_MIN; static int8_t x590 = INT8_MAX; t139 = (x589|(x590!=(x591/x592))); if (t139 != -9223372036854775807LL) { NG(); } else { ; } } void f140(void) { int64_t x593 = -1LL; static int32_t x594 = INT32_MIN; int8_t x595 = 2; static volatile int64_t t140 = 2633867897990747LL; t140 = (x593|(x594!=(x595/x596))); if (t140 != -1LL) { NG(); } else { ; } } void f141(void) { int64_t x597 = INT64_MAX; static int32_t x598 = INT32_MAX; static int64_t x599 = -1LL; int64_t x600 = INT64_MIN; static volatile int64_t t141 = INT64_MAX; t141 = (x597|(x598!=(x599/x600))); if (t141 != INT64_MAX) { NG(); } else { ; } } void f142(void) { static int32_t x601 = 9; static int32_t x603 = INT32_MIN; static int32_t x604 = 78303; volatile int32_t t142 = 1; t142 = (x601|(x602!=(x603/x604))); if (t142 != 9) { NG(); } else { ; } } void f143(void) { static volatile int64_t x605 = -315738554880LL; static int16_t x606 = -1; uint8_t x607 = 2U; int16_t x608 = INT16_MIN; int64_t t143 = 84479799215LL; t143 = (x605|(x606!=(x607/x608))); if (t143 != -315738554879LL) { NG(); } else { ; } } void f144(void) { int32_t x609 = -1; uint32_t x610 = 37681814U; uint8_t x611 = UINT8_MAX; int32_t t144 = -1; t144 = (x609|(x610!=(x611/x612))); if (t144 != -1) { NG(); } else { ; } } void f145(void) { int8_t x615 = -1; int8_t x616 = -1; t145 = (x613|(x614!=(x615/x616))); if (t145 != 331) { NG(); } else { ; } } void f146(void) { volatile int64_t x617 = -1LL; int32_t x618 = -231825; int16_t x619 = INT16_MAX; static uint32_t x620 = 32368U; static volatile int64_t t146 = -23051065LL; t146 = (x617|(x618!=(x619/x620))); if (t146 != -1LL) { NG(); } else { ; } } void f147(void) { uint64_t x621 = 8624592971LLU; volatile uint32_t x623 = 483663609U; int64_t x624 = INT64_MIN; volatile uint64_t t147 = 53631178LLU; t147 = (x621|(x622!=(x623/x624))); if (t147 != 8624592971LLU) { NG(); } else { ; } } void f148(void) { static int8_t x625 = INT8_MAX; int32_t x627 = -1; volatile int32_t t148 = -136135620; t148 = (x625|(x626!=(x627/x628))); if (t148 != 127) { NG(); } else { ; } } void f149(void) { static volatile int64_t x629 = -1LL; int32_t x631 = INT32_MAX; int64_t x632 = -1LL; static volatile int64_t t149 = -4045666838LL; t149 = (x629|(x630!=(x631/x632))); if (t149 != -1LL) { NG(); } else { ; } } void f150(void) { int16_t x634 = 81; volatile uint8_t x635 = UINT8_MAX; volatile uint16_t x636 = 219U; int32_t t150 = -1346; t150 = (x633|(x634!=(x635/x636))); if (t150 != -2147483647) { NG(); } else { ; } } void f151(void) { volatile uint32_t x637 = UINT32_MAX; int16_t x638 = 4; uint16_t x639 = 391U; int8_t x640 = INT8_MAX; uint32_t t151 = UINT32_MAX; t151 = (x637|(x638!=(x639/x640))); if (t151 != UINT32_MAX) { NG(); } else { ; } } void f152(void) { int8_t x641 = 11; volatile int16_t x643 = -1; static int32_t x644 = INT32_MIN; int32_t t152 = 0; t152 = (x641|(x642!=(x643/x644))); if (t152 != 11) { NG(); } else { ; } } void f153(void) { uint32_t x645 = 2045439U; uint64_t x646 = 140027110450LLU; int8_t x648 = INT8_MIN; volatile uint32_t t153 = 746500U; t153 = (x645|(x646!=(x647/x648))); if (t153 != 2045439U) { NG(); } else { ; } } void f154(void) { static int8_t x649 = -1; uint32_t x650 = 5849996U; int16_t x651 = INT16_MAX; int32_t t154 = 1785301; t154 = (x649|(x650!=(x651/x652))); if (t154 != -1) { NG(); } else { ; } } void f155(void) { uint8_t x653 = 6U; uint64_t x654 = 32227136LLU; int16_t x656 = INT16_MIN; static int32_t t155 = -262; t155 = (x653|(x654!=(x655/x656))); if (t155 != 7) { NG(); } else { ; } } void f156(void) { int32_t x657 = -1; uint64_t x658 = 16612645793365003LLU; uint16_t x659 = 1U; int16_t x660 = -34; t156 = (x657|(x658!=(x659/x660))); if (t156 != -1) { NG(); } else { ; } } void f157(void) { volatile int64_t x661 = -1LL; int8_t x663 = -2; int32_t x664 = INT32_MIN; int64_t t157 = -17312020023452607LL; t157 = (x661|(x662!=(x663/x664))); if (t157 != -1LL) { NG(); } else { ; } } void f158(void) { volatile int16_t x665 = -2965; static volatile int16_t x666 = INT16_MAX; int32_t x667 = INT32_MIN; volatile int16_t x668 = INT16_MIN; int32_t t158 = 506; t158 = (x665|(x666!=(x667/x668))); if (t158 != -2965) { NG(); } else { ; } } void f159(void) { static int64_t x669 = INT64_MIN; uint32_t x670 = UINT32_MAX; int32_t x671 = -1; uint32_t x672 = 11950465U; volatile int64_t t159 = 124686LL; t159 = (x669|(x670!=(x671/x672))); if (t159 != -9223372036854775807LL) { NG(); } else { ; } } void f160(void) { int64_t x673 = INT64_MIN; static uint8_t x674 = 25U; int32_t x675 = INT32_MIN; volatile uint64_t x676 = UINT64_MAX; t160 = (x673|(x674!=(x675/x676))); if (t160 != -9223372036854775807LL) { NG(); } else { ; } } void f161(void) { uint32_t x677 = 5U; int32_t x678 = 7129978; int64_t x679 = -1LL; uint16_t x680 = UINT16_MAX; volatile uint32_t t161 = 15U; t161 = (x677|(x678!=(x679/x680))); if (t161 != 5U) { NG(); } else { ; } } void f162(void) { volatile int8_t x681 = -57; int64_t x682 = -1LL; uint32_t x683 = UINT32_MAX; volatile int32_t t162 = -165564673; t162 = (x681|(x682!=(x683/x684))); if (t162 != -57) { NG(); } else { ; } } void f163(void) { static int16_t x685 = -7685; volatile uint16_t x687 = 7U; uint64_t x688 = 128742185LLU; static int32_t t163 = 375; t163 = (x685|(x686!=(x687/x688))); if (t163 != -7685) { NG(); } else { ; } } void f164(void) { volatile uint8_t x689 = 2U; int8_t x690 = 19; static uint32_t x692 = UINT32_MAX; int32_t t164 = 11; t164 = (x689|(x690!=(x691/x692))); if (t164 != 3) { NG(); } else { ; } } void f165(void) { int64_t x693 = 32300LL; int8_t x694 = -1; uint32_t x695 = UINT32_MAX; volatile int64_t t165 = -4356LL; t165 = (x693|(x694!=(x695/x696))); if (t165 != 32301LL) { NG(); } else { ; } } void f166(void) { int8_t x697 = INT8_MIN; uint64_t x699 = UINT64_MAX; volatile int64_t x700 = INT64_MIN; t166 = (x697|(x698!=(x699/x700))); if (t166 != -127) { NG(); } else { ; } } void f167(void) { static int64_t x701 = INT64_MIN; uint8_t x702 = 0U; uint8_t x703 = UINT8_MAX; int32_t x704 = INT32_MIN; int64_t t167 = INT64_MIN; t167 = (x701|(x702!=(x703/x704))); if (t167 != INT64_MIN) { NG(); } else { ; } } void f168(void) { volatile int16_t x705 = INT16_MIN; int8_t x706 = -1; int32_t x708 = 123659; int32_t t168 = 628152702; t168 = (x705|(x706!=(x707/x708))); if (t168 != -32767) { NG(); } else { ; } } void f169(void) { int16_t x709 = -1; uint64_t x710 = UINT64_MAX; int16_t x711 = -1; int64_t x712 = INT64_MIN; static int32_t t169 = 0; t169 = (x709|(x710!=(x711/x712))); if (t169 != -1) { NG(); } else { ; } } void f170(void) { static uint16_t x713 = 584U; static int8_t x714 = 1; static uint8_t x715 = UINT8_MAX; volatile int32_t x716 = INT32_MAX; volatile int32_t t170 = 195970963; t170 = (x713|(x714!=(x715/x716))); if (t170 != 585) { NG(); } else { ; } } void f171(void) { uint8_t x721 = 2U; volatile int64_t x722 = INT64_MIN; static int32_t t171 = 5374; t171 = (x721|(x722!=(x723/x724))); if (t171 != 3) { NG(); } else { ; } } void f172(void) { uint8_t x725 = UINT8_MAX; uint32_t x726 = 304U; int32_t x727 = 5821307; volatile int32_t t172 = 1145; t172 = (x725|(x726!=(x727/x728))); if (t172 != 255) { NG(); } else { ; } } void f173(void) { static uint8_t x729 = 2U; int32_t x731 = INT32_MIN; int32_t x732 = INT32_MIN; int32_t t173 = -5127; t173 = (x729|(x730!=(x731/x732))); if (t173 != 3) { NG(); } else { ; } } void f174(void) { static int8_t x733 = INT8_MIN; uint32_t x734 = 55089U; uint16_t x735 = UINT16_MAX; int64_t x736 = INT64_MIN; int32_t t174 = -26954800; t174 = (x733|(x734!=(x735/x736))); if (t174 != -127) { NG(); } else { ; } } void f175(void) { int64_t x737 = -50737707777187LL; t175 = (x737|(x738!=(x739/x740))); if (t175 != -50737707777187LL) { NG(); } else { ; } } void f176(void) { uint32_t x741 = UINT32_MAX; volatile uint16_t x743 = 10622U; int64_t x744 = INT64_MAX; uint32_t t176 = UINT32_MAX; t176 = (x741|(x742!=(x743/x744))); if (t176 != UINT32_MAX) { NG(); } else { ; } } void f177(void) { int8_t x746 = 12; volatile uint8_t x748 = 7U; t177 = (x745|(x746!=(x747/x748))); if (t177 != 1LL) { NG(); } else { ; } } void f178(void) { volatile int64_t x749 = INT64_MAX; int16_t x750 = 252; uint16_t x751 = UINT16_MAX; static uint8_t x752 = UINT8_MAX; volatile int64_t t178 = INT64_MAX; t178 = (x749|(x750!=(x751/x752))); if (t178 != INT64_MAX) { NG(); } else { ; } } void f179(void) { uint8_t x756 = 120U; int32_t t179 = -5797573; t179 = (x753|(x754!=(x755/x756))); if (t179 != -127) { NG(); } else { ; } } void f180(void) { int16_t x757 = INT16_MIN; uint16_t x758 = 44U; uint32_t x759 = 42137U; volatile int64_t x760 = -1LL; t180 = (x757|(x758!=(x759/x760))); if (t180 != -32767) { NG(); } else { ; } } void f181(void) { uint64_t x763 = 1123289LLU; uint64_t x764 = 176396178218451LLU; volatile int32_t t181 = INT32_MAX; t181 = (x761|(x762!=(x763/x764))); if (t181 != INT32_MAX) { NG(); } else { ; } } void f182(void) { int64_t x765 = INT64_MIN; int16_t x766 = 9729; uint8_t x767 = 1U; uint16_t x768 = 277U; t182 = (x765|(x766!=(x767/x768))); if (t182 != -9223372036854775807LL) { NG(); } else { ; } } void f183(void) { uint32_t x770 = 0U; volatile int8_t x771 = 3; static uint16_t x772 = UINT16_MAX; volatile int32_t t183 = 2005; t183 = (x769|(x770!=(x771/x772))); if (t183 != 127) { NG(); } else { ; } } void f184(void) { uint16_t x773 = UINT16_MAX; uint64_t x774 = 3LLU; int8_t x775 = 0; int64_t x776 = -1LL; volatile int32_t t184 = -216581056; t184 = (x773|(x774!=(x775/x776))); if (t184 != 65535) { NG(); } else { ; } } void f185(void) { static volatile int8_t x777 = INT8_MIN; int8_t x778 = -1; static uint8_t x779 = 51U; uint64_t x780 = 61041LLU; t185 = (x777|(x778!=(x779/x780))); if (t185 != -127) { NG(); } else { ; } } void f186(void) { static int8_t x781 = INT8_MAX; int8_t x782 = INT8_MAX; volatile uint16_t x783 = UINT16_MAX; t186 = (x781|(x782!=(x783/x784))); if (t186 != 127) { NG(); } else { ; } } void f187(void) { uint16_t x785 = 90U; volatile uint64_t x787 = 1337391187LLU; uint16_t x788 = UINT16_MAX; volatile int32_t t187 = 24219531; t187 = (x785|(x786!=(x787/x788))); if (t187 != 91) { NG(); } else { ; } } void f188(void) { uint8_t x790 = 2U; static int32_t x791 = -2; volatile int32_t x792 = INT32_MAX; volatile int32_t t188 = 282790; t188 = (x789|(x790!=(x791/x792))); if (t188 != -127) { NG(); } else { ; } } void f189(void) { int64_t x793 = INT64_MIN; static int64_t x794 = 78LL; uint16_t x795 = UINT16_MAX; int64_t x796 = -8814579306177134LL; volatile int64_t t189 = -3015401966937047LL; t189 = (x793|(x794!=(x795/x796))); if (t189 != -9223372036854775807LL) { NG(); } else { ; } } void f190(void) { int16_t x801 = INT16_MIN; volatile uint32_t x802 = UINT32_MAX; int16_t x803 = 5; static volatile int8_t x804 = INT8_MIN; int32_t t190 = -11443008; t190 = (x801|(x802!=(x803/x804))); if (t190 != -32767) { NG(); } else { ; } } void f191(void) { int64_t x805 = 1279818541247LL; static int32_t x806 = 1; static int8_t x807 = INT8_MIN; int64_t t191 = 659279481173LL; t191 = (x805|(x806!=(x807/x808))); if (t191 != 1279818541247LL) { NG(); } else { ; } } void f192(void) { int64_t x809 = -1LL; static int8_t x811 = -1; int64_t x812 = -1LL; volatile int64_t t192 = 722LL; t192 = (x809|(x810!=(x811/x812))); if (t192 != -1LL) { NG(); } else { ; } } void f193(void) { volatile uint16_t x814 = 0U; int16_t x816 = INT16_MIN; volatile int32_t t193 = 487695642; t193 = (x813|(x814!=(x815/x816))); if (t193 != -128) { NG(); } else { ; } } void f194(void) { int32_t x817 = -1; int16_t x818 = -1; static int16_t x820 = INT16_MIN; int32_t t194 = -63; t194 = (x817|(x818!=(x819/x820))); if (t194 != -1) { NG(); } else { ; } } void f195(void) { int8_t x823 = -1; uint32_t x824 = UINT32_MAX; volatile int32_t t195 = 16; t195 = (x821|(x822!=(x823/x824))); if (t195 != -127) { NG(); } else { ; } } void f196(void) { static volatile int8_t x825 = -1; int32_t x826 = -1; volatile int32_t x828 = INT32_MAX; volatile int32_t t196 = 66700441; t196 = (x825|(x826!=(x827/x828))); if (t196 != -1) { NG(); } else { ; } } void f197(void) { volatile int16_t x829 = -13223; static uint8_t x830 = 1U; static volatile int32_t x831 = 0; int64_t x832 = 10726438129LL; t197 = (x829|(x830!=(x831/x832))); if (t197 != -13223) { NG(); } else { ; } } void f198(void) { uint32_t x834 = 45U; int8_t x835 = INT8_MIN; int32_t t198 = 90805121; t198 = (x833|(x834!=(x835/x836))); if (t198 != 127) { NG(); } else { ; } } void f199(void) { static uint32_t x837 = UINT32_MAX; int8_t x838 = INT8_MIN; static volatile uint32_t t199 = UINT32_MAX; t199 = (x837|(x838!=(x839/x840))); if (t199 != UINT32_MAX) { NG(); } else { ; } } int main(void) { f0(); f1(); f2(); f3(); f4(); f5(); f6(); f7(); f8(); f9(); f10(); f11(); f12(); f13(); f14(); f15(); f16(); f17(); f18(); f19(); f20(); f21(); f22(); f23(); f24(); f25(); f26(); f27(); f28(); f29(); f30(); f31(); f32(); f33(); f34(); f35(); f36(); f37(); f38(); f39(); f40(); f41(); f42(); f43(); f44(); f45(); f46(); f47(); f48(); f49(); f50(); f51(); f52(); f53(); f54(); f55(); f56(); f57(); f58(); f59(); f60(); f61(); f62(); f63(); f64(); f65(); f66(); f67(); f68(); f69(); f70(); f71(); f72(); f73(); f74(); f75(); f76(); f77(); f78(); f79(); f80(); f81(); f82(); f83(); f84(); f85(); f86(); f87(); f88(); f89(); f90(); f91(); f92(); f93(); f94(); f95(); f96(); f97(); f98(); f99(); f100(); f101(); f102(); f103(); f104(); f105(); f106(); f107(); f108(); f109(); f110(); f111(); f112(); f113(); f114(); f115(); f116(); f117(); f118(); f119(); f120(); f121(); f122(); f123(); f124(); f125(); f126(); f127(); f128(); f129(); f130(); f131(); f132(); f133(); f134(); f135(); f136(); f137(); f138(); f139(); f140(); f141(); f142(); f143(); f144(); f145(); f146(); f147(); f148(); f149(); f150(); f151(); f152(); f153(); f154(); f155(); f156(); f157(); f158(); f159(); f160(); f161(); f162(); f163(); f164(); f165(); f166(); f167(); f168(); f169(); f170(); f171(); f172(); f173(); f174(); f175(); f176(); f177(); f178(); f179(); f180(); f181(); f182(); f183(); f184(); f185(); f186(); f187(); f188(); f189(); f190(); f191(); f192(); f193(); f194(); f195(); f196(); f197(); f198(); f199(); return 0; }
18.822238
60
0.5891
1bb1767f229fa9f16de4e46a3550fd51fca8f2d3
2,650
c
C
include/cjdns/benc/serialization/standard/test/benc_serializeString_test.c
coyotama/fennec
bd94c631dab6b88881c3cb1a36e2cbe0874aa2bb
[ "WTFPL" ]
2
2016-02-04T05:43:18.000Z
2016-09-12T05:44:19.000Z
include/cjdns/benc/serialization/standard/test/benc_serializeString_test.c
coyotama/fennec
bd94c631dab6b88881c3cb1a36e2cbe0874aa2bb
[ "WTFPL" ]
null
null
null
include/cjdns/benc/serialization/standard/test/benc_serializeString_test.c
coyotama/fennec
bd94c631dab6b88881c3cb1a36e2cbe0874aa2bb
[ "WTFPL" ]
null
null
null
/* vim: set expandtab ts=4 sw=4: */ /* * You may redistribute this program and/or modify it under the terms of * the GNU General Public License as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. * * This program 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. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #define string_strcmp #include "util/platform/libc/string.h" #include "memory/Allocator.h" #include "memory/MallocAllocator.h" #include "memory/CanaryAllocator.h" #include "io/Reader.h" #include "io/ArrayReader.h" #include "io/Writer.h" #include "io/ArrayWriter.h" #include "benc/Object.h" #include "benc/serialization/BencSerializer.h" #include "benc/serialization/standard/StandardBencSerializer.h" #include "util/Assert.h" #include <stdio.h> int expect(char* str, struct Writer* writer, struct Reader* reader) { int ret = 0; char buffer[32]; writer->write("\0", 1, writer); reader->read(buffer, strlen(str) + 1, reader); if (strcmp(str, buffer) != 0) { printf("Expected %s\n Got %s\n", str, buffer); return -1; } return ret; } void testSerialize(struct Writer* writer, struct Reader* reader) { Assert_always(!StandardBencSerializer_get()->serializeString(writer, String_CONST("hello"))); Assert_always(!expect("5:hello", writer, reader)); Assert_always(!StandardBencSerializer_get()->serializeString(writer, String_CONST(""))); Assert_always(!expect("0:", writer, reader)); } void testParse(struct Writer* w, struct Reader* r, struct Allocator* alloc) { char* badBenc = "d2:aq21:RouterModule_pingNode4:argsd4:path39:fcd9:6a75:6c9c7:timeouti4000ee" "6:cookie0:4:hash64:09c6bcd1482df339757c99bbc5e796192968a28562f701fb53a57ed6" "e26b15511:q4:auth4:txid19:43866780dc455e15619e"; Writer_write(w, badBenc, strlen(badBenc)+1); Dict dict; Assert_always(StandardBencSerializer_get()->parseDictionary(r, alloc, &dict)); } int main() { char out[512]; struct Allocator* alloc = CanaryAllocator_new(MallocAllocator_new(1<<20), NULL); struct Writer* writer = ArrayWriter_new(out, 512, alloc); struct Reader* reader = ArrayReader_new(out, 512, alloc); testSerialize(writer, reader); testParse(writer, reader, alloc); Allocator_free(alloc); }
34.415584
97
0.713585
7158e48ab49912e1cbf99b657d84b2e5134b9cde
200
h
C
svc/src/utils.h
klsecservices/rpc2socks
bd492b22c9839766dadc2fada57c15a13f552198
[ "BSD-3-Clause" ]
109
2020-10-06T09:32:04.000Z
2022-02-23T00:23:23.000Z
svc/src/utils.h
klsecservices/rpc2socks
bd492b22c9839766dadc2fada57c15a13f552198
[ "BSD-3-Clause" ]
1
2021-02-26T12:02:21.000Z
2021-03-04T10:07:04.000Z
svc/src/utils.h
klsecservices/rpc2socks
bd492b22c9839766dadc2fada57c15a13f552198
[ "BSD-3-Clause" ]
15
2020-10-06T10:54:56.000Z
2021-08-29T00:34:08.000Z
// Copyright (c) Lexfo // SPDX-License-Identifier: BSD-3-Clause #pragma once namespace utils { std::wstring module_path(HMODULE hmodule); } // namespace utils #include "utils.inl.h"
15.384615
43
0.675
21edeaf1f0f6a24f31f74254503401193c1ee221
1,787
h
C
Firmware/lib/ros_lib/frontier_exploration/GetNextFrontier.h
ibaranov-cp/Turtlebot_Euclid
e71580f6b80e18b1e2c32e5d586a7f3dcc36e2c1
[ "BSD-3-Clause" ]
null
null
null
Firmware/lib/ros_lib/frontier_exploration/GetNextFrontier.h
ibaranov-cp/Turtlebot_Euclid
e71580f6b80e18b1e2c32e5d586a7f3dcc36e2c1
[ "BSD-3-Clause" ]
null
null
null
Firmware/lib/ros_lib/frontier_exploration/GetNextFrontier.h
ibaranov-cp/Turtlebot_Euclid
e71580f6b80e18b1e2c32e5d586a7f3dcc36e2c1
[ "BSD-3-Clause" ]
null
null
null
#ifndef _ROS_SERVICE_GetNextFrontier_h #define _ROS_SERVICE_GetNextFrontier_h #include <stdint.h> #include <string.h> #include <stdlib.h> #include "ros/msg.h" #include "geometry_msgs/PoseStamped.h" namespace frontier_exploration { static const char GETNEXTFRONTIER[] = "frontier_exploration/GetNextFrontier"; class GetNextFrontierRequest : public ros::Msg { public: geometry_msgs::PoseStamped start_pose; GetNextFrontierRequest(): start_pose() { } virtual int serialize(unsigned char *outbuffer) const { int offset = 0; offset += this->start_pose.serialize(outbuffer + offset); return offset; } virtual int deserialize(unsigned char *inbuffer) { int offset = 0; offset += this->start_pose.deserialize(inbuffer + offset); return offset; } const char * getType(){ return GETNEXTFRONTIER; }; const char * getMD5(){ return "5b059506b52a2ec83de1e33422377a1b"; }; }; class GetNextFrontierResponse : public ros::Msg { public: geometry_msgs::PoseStamped next_frontier; GetNextFrontierResponse(): next_frontier() { } virtual int serialize(unsigned char *outbuffer) const { int offset = 0; offset += this->next_frontier.serialize(outbuffer + offset); return offset; } virtual int deserialize(unsigned char *inbuffer) { int offset = 0; offset += this->next_frontier.deserialize(inbuffer + offset); return offset; } const char * getType(){ return GETNEXTFRONTIER; }; const char * getMD5(){ return "df2ac5789785e819aa300966fa36644e"; }; }; class GetNextFrontier { public: typedef GetNextFrontierRequest Request; typedef GetNextFrontierResponse Response; }; } #endif
22.3375
77
0.678791
bc55e52440ed6caba3a4032bfba70342877f1bef
2,351
c
C
mqsend_receive.c
TAAPArthur/mqbus
be1451b6a31441811b7a4da84315c6902f638eb1
[ "MIT" ]
3
2021-05-06T08:47:07.000Z
2021-12-31T01:20:43.000Z
mqsend_receive.c
TAAPArthur/mqbus
be1451b6a31441811b7a4da84315c6902f638eb1
[ "MIT" ]
null
null
null
mqsend_receive.c
TAAPArthur/mqbus
be1451b6a31441811b7a4da84315c6902f638eb1
[ "MIT" ]
1
2021-12-31T01:20:45.000Z
2021-12-31T01:20:45.000Z
#include <fcntl.h> #include <poll.h> #include <mqueue.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include "mqhelper.h" #define MAX_MSG_SIZE 255 const struct mq_attr attr = { .mq_maxmsg = MAX_MESSAGES, .mq_msgsize = MAX_MSG_SIZE }; void receive(mqd_t mqd) { char buffer[MAX_MSG_SIZE]; struct pollfd fds[2] = {{.fd = mqd, .events = POLLIN}, {.fd = STDOUT_FILENO} }; while(1){ int ret = poll(fds, 2, -1); if(fds[0].revents & POLLIN) { ret = mq_receive(mqd,(char*) &buffer, MAX_MSG_SIZE, NULL); if(ret == -1) { die("mq_receive failed to retrieve message"); } if(write(STDOUT_FILENO, buffer, ret)==-1) { die("failed to echo message out to stdout"); } } else exit(2); // die on STDOUT hangup } } int readAll(int fd, char* buffer, size_t bufferSize) { int size = 0; while(size < bufferSize) { int ret = read(fd, buffer + size, bufferSize - size); if (ret == -1) return -1; if(ret == 0) return size; size += ret; } return size; } void send(mqd_t mqd, int priority, const char* message) { char buffer[MAX_MSG_SIZE]; int size; if(!message) { size = readAll(STDIN_FILENO, buffer, sizeof(buffer)); if (size == -1) die("failed to read stdin"); message = buffer; } else { size = MIN(MAX_MSG_SIZE, strlen(message)); } if(mq_send(mqd, message, size, priority) == -1) die("mq_send failed to send message"); } void usage(void) { printf("mq: (-s|-r) [-p PRIORITY] [ -m MASK ] name [MESSAGE]\n"); printf("mqsend: [-p PRIORITY] name [ -m MASK ] [MESSAGE]\n"); printf("mqreceive: [-p PRIORITY] [ -m MASK ] name\n"); } int main(int argc, const char* argv[]) { int receiveFlag; int priority = 0; char name[255] = {0}; int mask = DEFAULT_CREATION_MASK; const char* message = parseArgs(argv, &receiveFlag, &priority, &mask, name); mqd_t mqd = mq_open(name, (!receiveFlag?O_WRONLY:O_RDONLY)|O_CLOEXEC|O_CREAT, mask, &attr); if(mqd == -1) die("mq_open failed to open message queue"); if(!receiveFlag) send(mqd, priority, message); else receive(mqd); }
27.988095
95
0.568269
424dcc8b07260ec03197dc3b6d4b8ed1a0808ad1
39
h
C
OpenGLParticleSystem/Main.h
Co3us/OpenGLParticleSystem
65a19510b5e03106cbb78624aeea0e24f9d94200
[ "MIT" ]
2
2020-02-17T20:06:42.000Z
2021-03-31T08:01:38.000Z
OpenGLParticleSystem/Main.h
Co3us/OpenGLParticleSystem
65a19510b5e03106cbb78624aeea0e24f9d94200
[ "MIT" ]
null
null
null
OpenGLParticleSystem/Main.h
Co3us/OpenGLParticleSystem
65a19510b5e03106cbb78624aeea0e24f9d94200
[ "MIT" ]
null
null
null
#pragma once void initParticles(int n);
19.5
26
0.794872
5e9b40202a0a4f1bd89c70018901a5379bed047e
20,360
h
C
cpp/lib/include/Enhedron/CommandLine/Parameters.h
julian-becker/moskito
fce92dec01a6015b4ea887fb416eb149d9117580
[ "BSL-1.0" ]
1
2015-11-11T12:54:32.000Z
2015-11-11T12:54:32.000Z
cpp/lib/include/Enhedron/CommandLine/Parameters.h
julian-becker/moskito
fce92dec01a6015b4ea887fb416eb149d9117580
[ "BSL-1.0" ]
3
2015-11-12T14:06:00.000Z
2015-11-12T14:06:40.000Z
cpp/lib/include/Enhedron/CommandLine/Parameters.h
simon-bourne/CppUnitTest
d8347f3b4cfe84f12893107757b4d26f8d6a6116
[ "BSL-1.0" ]
null
null
null
// // Copyright Simon Bourne 2015. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // #pragma once #include "Enhedron/Util.h" #include "Enhedron/Util/MetaProgramming.h" #include "Enhedron/Util/Optional.h" #include "Enhedron/Util/Math.h" #include <string> #include <ostream> #include <vector> #include <set> #include <map> #include <algorithm> #include <iterator> #include <stdexcept> #include <utility> #include <iostream> #include <sstream> #include <iterator> namespace Enhedron { namespace CommandLine { namespace Impl { namespace Impl_Parameters { using Util::bindFirst; using Util::optional; using Util::mapParameterPack; using Util::makeDivisibleByRoundingUp; using std::string; using std::ostream; using std::vector; using std::set; using std::map; using std::string; using std::move; using std::back_inserter; using std::logic_error; using std::index_sequence_for; using std::forward; using std::cout; using std::cerr; using std::runtime_error; using std::exception; using std::ostringstream; using std::min; using std::max; using std::fill_n; using std::ostream_iterator; using std::copy; enum class ExitStatus { OK, USAGE = 64, // command line usage error DATAERR = 65, // data format error NOINPUT = 66, // cannot open input NOUSER = 67, // addressee unknown NOHOST = 68, // host name unknown UNAVAILABLE = 69, // service unavailable SOFTWARE = 70, // internal software error OSERR = 71, // system error (e.g., can't fork) OSFILE = 72, // critical OS file missing CANTCREAT = 73, // can't create (user) output file IOERR = 74, // input/output error TEMPFAIL = 75, // temp failure; user is invited to retry PROTOCOL = 76, // remote error in protocol NOPERM = 77, // permission denied CONFIG = 78 // configuration error }; class Name: public NoCopy { optional<string> shortName_; string longName_; optional<string> description_; public: Name(string longName) : longName_("--" + longName) {} Name(string longName, string description) : longName_("--" + longName), description_(move(description)) {} Name(char shortName, string longName) : shortName_("-"), longName_("--" + longName) { shortName_->push_back(shortName); } Name(char shortName, string longName, string description) : shortName_("-"), longName_("--" + longName), description_(move(description)) { shortName_->push_back(shortName); } template<typename Functor> void forEachName(Functor&& functor) const { if (shortName_) { functor(*shortName_); } functor(longName_); } bool anyMatch(const char* arg) const { if (shortName_) { if (arg == *shortName_) { return true; } } return arg == longName_; } const string& longName() const { return longName_; } string makeNamesString() const { string result(" "); if (shortName_) { result += *shortName_ + ", "; } return result + longName_; } bool multiLineDescription(size_t width) const { return description_ && description_->size() > width; } void showDescription(Out<ostream> output, size_t width, size_t padding) const { width = max(width, static_cast<size_t>(10u)); if (description_) { auto current = description_->begin(); while (static_cast<size_t>(description_->end() - current) > width) { auto currentEnd = current + static_cast<string::difference_type>(width); auto breakAt = currentEnd; while (true) { --breakAt; if (breakAt == current) { // We didn't find a space - hyphenate. --currentEnd; copy(current, currentEnd, ostream_iterator<char>(*output)); *output << "-"; current = currentEnd; break; } if (*breakAt == ' ') { copy(current, breakAt, ostream_iterator<char>(*output)); current = breakAt; break; } } *output << "\n"; fill_n(ostream_iterator<char>(*output), padding, ' '); while (*current == ' ') { ++current; } } copy(current, description_->end(), ostream_iterator<char>(*output)); } *output << "\n"; } }; template<typename ValueType> class Option final { Name name_; string valueName_; optional<string> defaultValue_; public: using Value = ValueType; Option(Name name, string valueName) : name_(move(name)), valueName_(move(valueName)) {} Option(Name name, string valueName, string defaultValue) : name_(move(name)), valueName_(move(valueName)), defaultValue_(move(defaultValue)) {} template<typename Functor> void forEachName(Functor&& functor) const { name_.forEachName(forward<Functor>(functor)); } bool anyMatch(const char* arg) const { return name_.anyMatch(arg); } const string& longName() const { return name_.longName(); } string makeNamesString() const { return name_.makeNamesString() + " <" + valueName_ + ">"; } bool multiLineDescription(size_t width) const { return name_.multiLineDescription(width); } void showDescription(Out<ostream> output, size_t width, size_t padding) const { name_.showDescription(output, width, padding); } optional<string> defaultValue() const { return defaultValue_; } }; class Flag final: public Name { public: using Name::Name; }; enum class ParamType { OPTION, FLAG }; class Arguments final : public NoCopy { Out<ostream> helpOut_; Out<ostream> errorOut_; string description_; string notes_; string version_; string positionalDescription_; size_t terminalWidth_; static const Flag& helpFlag() { static const Flag instance{"help", "Display this help message."}; return instance; } static const Flag& versionFlag() { static const Flag instance{"version", "Display version information."}; return instance; } template <typename... Params> void displayHelp( const char *exeName, Params&&... params ) { *helpOut_ << "Usage: " << exeName << " [OPTION]..."; if ( ! positionalDescription_.empty()) { *helpOut_ << " [" << positionalDescription_ << "]..."; } *helpOut_ << "\n\n"; if ( ! description_.empty()) { *helpOut_ << description_ << "\n\n"; } size_t padding = 0; mapParameterPack( [this, &padding](const auto &arg) { padding = max(arg.makeNamesString().size(), padding); }, params..., helpFlag(), versionFlag() ); constexpr const size_t tabWidth = 4; padding += tabWidth; padding = makeDivisibleByRoundingUp(padding, tabWidth); padding = min(terminalWidth_ / 2, padding); mapParameterPack( [this, padding, tabWidth](const auto &arg) { auto nameString = arg.makeNamesString(); *helpOut_ << nameString; size_t currentPadding = padding; bool descriptionOnNewline = nameString.size() + tabWidth > padding; if (descriptionOnNewline) { *helpOut_ << "\n"; } else { currentPadding -= nameString.size(); } fill_n(ostream_iterator<char>(*helpOut_), currentPadding, ' '); auto descriptionWidth = terminalWidth_ - padding; arg.showDescription(helpOut_, descriptionWidth, padding); if (descriptionOnNewline || arg.multiLineDescription(descriptionWidth)) { *helpOut_ << "\n"; } }, params..., helpFlag(), versionFlag() ); *helpOut_ << "\n"; if ( ! notes_.empty()) { *helpOut_ << notes_ << "\n\n"; } } template<typename Functor> ExitStatus runImpl( map<string, vector<string>> optionValues, vector<string> positionalArgs, set<string> setFlags, Functor&& functor ) { return functor(move(positionalArgs)); } template<typename Functor, typename... ParamTail> ExitStatus runImpl( map<string, vector<string>> optionValues, vector<string> positionalArgs, set<string> setFlags, Functor&& functor, Option<string>&& param, ParamTail&&... paramTail ) { vector<string> paramValues; param.forEachName([&] (const string& name) { const auto& newValues = optionValues[name]; paramValues.insert(paramValues.end(), newValues.begin(), newValues.end()); }); string value; if (paramValues.empty()) { if (param.defaultValue()) { value = *param.defaultValue(); } else { *errorOut_ << "Error: No value for " + param.longName() << "\n"; return ExitStatus::CONFIG; } } else { value = paramValues.front(); } if (paramValues.size() > 1) { *errorOut_ << "Error: Multiple values for " + param.longName() << "\n"; return ExitStatus::CONFIG; } return runImpl( move(optionValues), move(positionalArgs), move(setFlags), bindFirst( forward<Functor>(functor), move(value), index_sequence_for<Option<string>, ParamTail...>() ), forward<ParamTail>(paramTail)... ); } template<typename Functor, typename... ParamTail> ExitStatus runImpl( map<string, vector<string>> optionValues, vector<string> positionalArgs, set<string> setFlags, Functor&& functor, Option<vector<string>>&& param, ParamTail&&... paramTail ) { vector<string> paramValues; param.forEachName([&] (const string& name) { const auto& newValues = optionValues[name]; paramValues.insert(paramValues.end(), newValues.begin(), newValues.end()); }); return runImpl( move(optionValues), move(positionalArgs), move(setFlags), bindFirst( forward<Functor>(functor), move(paramValues), index_sequence_for<Option<string>, ParamTail...>() ), forward<ParamTail>(paramTail)... ); } template<typename Functor, typename... ParamTail> ExitStatus runImpl( map<string, vector<string>> optionValues, vector<string> positionalArgs, set<string> setFlags, Functor&& functor, Flag&& flag, ParamTail&&... paramTail ) { bool flagValue = false; flag.forEachName([&] (const string& name) { flagValue |= setFlags.count(name) > 0; }); return runImpl( move(optionValues), move(positionalArgs), move(setFlags), bindFirst( forward<Functor>(functor), flagValue, index_sequence_for<Flag, ParamTail...>() ), forward<ParamTail>(paramTail)... ); } template<typename OptionType, typename... ParamsTail> void readNamesImpl( Out<set<string>> optionNames, Out<set<string>> allNames, const Option<OptionType>& option, const ParamsTail&... paramsTail ) { option.forEachName([&] (const string& name) { optionNames->emplace(name); }); readNames(optionNames, allNames, paramsTail...); } template<typename... ParamsTail> void readNamesImpl( Out<set<string>> optionNames, Out<set<string>> allNames, const Flag& flag, const ParamsTail&... paramsTail ) { readNames(optionNames, allNames, paramsTail...); } void readNames(Out<set<string>> optionNames, Out<set<string>> allNames) {} template<typename ParamType, typename... ParamsTail> void readNames( Out<set<string>> optionNames, Out<set<string>> allNames, const ParamType& param, const ParamsTail&... paramsTail ) { param.forEachName([&] (const string& name) { if ( ! allNames->emplace(name).second) { throw logic_error("Duplicate name " + name); } }); readNamesImpl(optionNames, allNames, param, paramsTail...); } enum class StandardArg { NONE, HELP, VERSION }; StandardArg checkArgs(int argc, const char* const argv[]) { if (argc <= 0) { throw runtime_error("argc is 0."); } else if (argv == nullptr) { throw runtime_error("argv is null."); } else { for (int index = 0; index < argc; ++index) { if (argv[index] == nullptr) { throw runtime_error("argv has null value."); } else { if (helpFlag().anyMatch(argv[index])) { return StandardArg::HELP; } if (versionFlag().anyMatch(argv[index])) { return StandardArg::VERSION; } } } } return StandardArg::NONE; } template<typename Functor, typename... Params> ExitStatus runImpl( int argc, const char* const argv[], Functor &&functor, Params&&... params ) { auto standardArg = checkArgs(argc, argv); if (standardArg == StandardArg::HELP) { displayHelp(argv[0], forward<Params>(params)...); return ExitStatus::OK; } if (standardArg == StandardArg::VERSION) { *helpOut_ << version_ << "\n"; return ExitStatus::OK; } set<string> optionNames; set<string> allNames; readNames(out(optionNames), out(allNames), params...); map<string, vector<string>> optionValues; vector<string> positionalArgs; set<string> setFlags; for (int index = 1; index < argc; ++index) { string currentArg(argv[index]); if (currentArg == "--") { positionalArgs.insert(positionalArgs.end(), argv + index, argv + argc); break; } if ( ! currentArg.empty() && currentArg[0] == '-') { if (allNames.count(currentArg) == 0) { *errorOut_<< "Error: Unknown option " << currentArg << "\n"; return ExitStatus::USAGE; } if (optionNames.count(currentArg)) { ++index; if (index == argc) { *errorOut_<< "Error: No value supplied for option " << currentArg << "\n"; return ExitStatus::USAGE; } optionValues[currentArg].emplace_back(argv[index]); } else { setFlags.emplace(currentArg); } } else { positionalArgs.emplace_back(currentArg); } } return runImpl( move(optionValues), move(positionalArgs), move(setFlags), forward<Functor>(functor), forward<Params>(params)... ); } const char* exeName(int argc, const char* const argv[]) { if (argv && argc > 0 && argv[0]) { return argv[0]; } return "unknown"; } public: Arguments(Out<ostream> helpOut, Out<ostream> errorOut, string version, size_t terminalWidth = 80) : helpOut_(helpOut), errorOut_(errorOut), version_(move(version)), terminalWidth_(terminalWidth) {} void setDescription(string description) { description_ = move(description); } void setNotes(string notes) { notes_ = move(notes); } void setPositionalDescription(string positionalDescription) { positionalDescription_ = move(positionalDescription); } Arguments(string version, size_t terminalWidth = 80) : Arguments(out(cout), out(cerr), move(version), terminalWidth) {} template<typename Functor, typename... Params> int run( int argc, const char* const argv[], Functor &&functor, Params&&... params ) { try { return static_cast<int>(runImpl(argc, argv, forward<Functor>(functor), forward<Params>(params)...)); } catch (const exception& e) { *errorOut_ << exeName(argc, argv) << ": " << e.what() << "\n"; } return static_cast<int>(ExitStatus::SOFTWARE); } }; }}}} namespace Enhedron { namespace CommandLine { using Impl::Impl_Parameters::ExitStatus; using Impl::Impl_Parameters::Arguments; using Impl::Impl_Parameters::Option; using Impl::Impl_Parameters::Flag; using Impl::Impl_Parameters::Name; }}
32.31746
116
0.481827
824046cd9cfb95066aef2f4a46919daad0e0ee68
84,340
c
C
vnet/vnet/lisp-cp/control.c
muharif/vpp
74436ed67d8cfa1f5cf18563b6060e298bfd64b9
[ "Apache-2.0" ]
null
null
null
vnet/vnet/lisp-cp/control.c
muharif/vpp
74436ed67d8cfa1f5cf18563b6060e298bfd64b9
[ "Apache-2.0" ]
null
null
null
vnet/vnet/lisp-cp/control.c
muharif/vpp
74436ed67d8cfa1f5cf18563b6060e298bfd64b9
[ "Apache-2.0" ]
null
null
null
/* * Copyright (c) 2016 Cisco and/or its affiliates. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <vnet/lisp-cp/control.h> #include <vnet/lisp-cp/packets.h> #include <vnet/lisp-cp/lisp_msg_serdes.h> #include <vnet/lisp-gpe/lisp_gpe.h> ip_interface_address_t * ip_interface_get_first_interface_address (ip_lookup_main_t *lm, u32 sw_if_index, u8 loop) { vnet_main_t *vnm = vnet_get_main (); vnet_sw_interface_t * swif = vnet_get_sw_interface (vnm, sw_if_index); if (loop && swif->flags & VNET_SW_INTERFACE_FLAG_UNNUMBERED) sw_if_index = swif->unnumbered_sw_if_index; u32 ia = (vec_len((lm)->if_address_pool_index_by_sw_if_index) > (sw_if_index)) ? vec_elt((lm)->if_address_pool_index_by_sw_if_index, (sw_if_index)) : (u32) ~0; return pool_elt_at_index((lm)->if_address_pool, ia); } void * ip_interface_get_first_address (ip_lookup_main_t * lm, u32 sw_if_index, u8 version) { ip_interface_address_t * ia; ia = ip_interface_get_first_interface_address (lm, sw_if_index, 1); if (!ia) return 0; return ip_interface_address_get_address (lm, ia); } int ip_interface_get_first_ip_address (lisp_cp_main_t * lcm, u32 sw_if_index, u8 version, ip_address_t * result) { ip_lookup_main_t * lm; void * addr; lm = (version == IP4) ? &lcm->im4->lookup_main : &lcm->im6->lookup_main; addr = ip_interface_get_first_address (lm, sw_if_index, version); if (!addr) return 0; ip_address_set (result, addr, version); return 1; } static u32 ip_fib_lookup_with_table (lisp_cp_main_t * lcm, u32 fib_index, ip_address_t * dst) { if (ip_addr_version (dst) == IP4) return ip4_fib_lookup_with_table (lcm->im4, fib_index, &ip_addr_v4(dst), 0); else return ip6_fib_lookup_with_table (lcm->im6, fib_index, &ip_addr_v6(dst)); } u32 ip_fib_get_egress_iface_for_dst_with_lm (lisp_cp_main_t * lcm, ip_address_t * dst, ip_lookup_main_t * lm) { u32 adj_index; ip_adjacency_t * adj; adj_index = ip_fib_lookup_with_table (lcm, 0, dst); adj = ip_get_adjacency (lm, adj_index); if (adj == 0) return ~0; /* we only want outgoing routes */ if (adj->lookup_next_index != IP_LOOKUP_NEXT_ARP && adj->lookup_next_index != IP_LOOKUP_NEXT_REWRITE) return ~0; return adj->rewrite_header.sw_if_index; } /** * Find the sw_if_index of the interface that would be used to egress towards * dst. */ u32 ip_fib_get_egress_iface_for_dst (lisp_cp_main_t * lcm, ip_address_t * dst) { ip_lookup_main_t * lm; lm = ip_addr_version (dst) == IP4 ? &lcm->im4->lookup_main : &lcm->im6->lookup_main; return ip_fib_get_egress_iface_for_dst_with_lm (lcm, dst, lm); } /** * Find first IP of the interface that would be used to egress towards dst. * Returns 1 if the address is found 0 otherwise. */ int ip_fib_get_first_egress_ip_for_dst (lisp_cp_main_t * lcm, ip_address_t * dst, ip_address_t * result) { u32 si; ip_lookup_main_t * lm; void * addr = 0; u8 ipver; ASSERT(result != 0); ipver = ip_addr_version(dst); lm = (ipver == IP4) ? &lcm->im4->lookup_main : &lcm->im6->lookup_main; si = ip_fib_get_egress_iface_for_dst_with_lm (lcm, dst, lm); if ((u32) ~0 == si) return 0; /* find the first ip address */ addr = ip_interface_get_first_address (lm, si, ipver); if (0 == addr) return 0; ip_address_set (result, addr, ipver); return 1; } static int dp_add_del_iface (lisp_cp_main_t * lcm, u32 vni, u8 is_add) { uword * table_id, * intf; vnet_lisp_gpe_add_del_iface_args_t _ai, *ai = &_ai; table_id = hash_get(lcm->table_id_by_vni, vni); if (!table_id) { clib_warning ("vni %d not associated to a vrf!", vni); return VNET_API_ERROR_INVALID_VALUE; } intf = hash_get(lcm->dp_intf_by_vni, vni); /* enable/disable data-plane interface */ if (is_add) { /* create interface */ if (!intf) { ai->is_add = 1; ai->vni = vni; ai->table_id = table_id[0]; vnet_lisp_gpe_add_del_iface (ai, 0); /* keep track of vnis for which interfaces have been created */ hash_set(lcm->dp_intf_by_vni, vni, 1); } } else { if (intf == 0) { clib_warning("interface for vni %d doesn't exist!", vni); return VNET_API_ERROR_INVALID_VALUE; } ai->is_add = 0; ai->vni = vni; ai->table_id = table_id[0]; vnet_lisp_gpe_add_del_iface (ai, 0); hash_unset(lcm->dp_intf_by_vni, vni); } return 0; } static void dp_del_fwd_entry (lisp_cp_main_t * lcm, u32 src_map_index, u32 dst_map_index) { vnet_lisp_gpe_add_del_fwd_entry_args_t _a, * a = &_a; fwd_entry_t * fe = 0; uword * feip = 0; memset(a, 0, sizeof(*a)); feip = hash_get(lcm->fwd_entry_by_mapping_index, dst_map_index); if (!feip) return; fe = pool_elt_at_index(lcm->fwd_entry_pool, feip[0]); /* delete dp fwd entry */ u32 sw_if_index; a->is_add = 0; a->dlocator = fe->dst_loc; a->slocator = fe->src_loc; a->vni = gid_address_vni(&a->deid); gid_address_copy(&a->deid, &fe->deid); vnet_lisp_gpe_add_del_fwd_entry (a, &sw_if_index); /* delete entry in fwd table */ hash_unset(lcm->fwd_entry_by_mapping_index, dst_map_index); pool_put(lcm->fwd_entry_pool, fe); } /** * Finds first remote locator with best (lowest) priority that has a local * peer locator with an underlying route to it. * */ static u32 get_locator_pair (lisp_cp_main_t* lcm, mapping_t * lcl_map, mapping_t * rmt_map, ip_address_t * lcl_loc, ip_address_t * rmt_loc) { u32 i, minp = ~0, limitp = 0, li, check_index = 0, done = 0, esi; locator_set_t * rmt_ls, * lcl_ls; ip_address_t _lcl, * lcl = &_lcl; locator_t * l, * rmt = 0; uword * checked = 0; rmt_ls = pool_elt_at_index(lcm->locator_set_pool, rmt_map->locator_set_index); lcl_ls = pool_elt_at_index(lcm->locator_set_pool, lcl_map->locator_set_index); if (!rmt_ls || vec_len(rmt_ls->locator_indices) == 0) return 0; while (!done) { rmt = 0; /* find unvisited remote locator with best priority */ for (i = 0; i < vec_len(rmt_ls->locator_indices); i++) { if (0 != hash_get(checked, i)) continue; li = vec_elt(rmt_ls->locator_indices, i); l = pool_elt_at_index(lcm->locator_pool, li); /* we don't support non-IP locators for now */ if (gid_address_type(&l->address) != GID_ADDR_IP_PREFIX) continue; if (l->priority < minp && l->priority >= limitp) { minp = l->priority; rmt = l; check_index = i; } } /* check if a local locator with a route to remote locator exists */ if (rmt != 0) { esi = ip_fib_get_egress_iface_for_dst ( lcm, &gid_address_ip(&rmt->address)); if ((u32) ~0 == esi) continue; for (i = 0; i < vec_len(lcl_ls->locator_indices); i++) { li = vec_elt (lcl_ls->locator_indices, i); locator_t * sl = pool_elt_at_index (lcm->locator_pool, li); /* found local locator */ if (sl->sw_if_index == esi) { if (0 == ip_interface_get_first_ip_address (lcm, sl->sw_if_index, gid_address_ip_version(&rmt->address), lcl)) continue; ip_address_copy(rmt_loc, &gid_address_ip(&rmt->address)); ip_address_copy(lcl_loc, lcl); done = 2; } } /* skip this remote locator in next searches */ limitp = minp; hash_set(checked, check_index, 1); } else done = 1; } hash_free(checked); return (done == 2) ? 1 : 0; } static void dp_add_fwd_entry (lisp_cp_main_t* lcm, u32 src_map_index, u32 dst_map_index) { mapping_t * src_map, * dst_map; u32 sw_if_index; uword * feip = 0, * tidp; fwd_entry_t* fe; vnet_lisp_gpe_add_del_fwd_entry_args_t _a, * a = &_a; memset (a, 0, sizeof(*a)); /* remove entry if it already exists */ feip = hash_get (lcm->fwd_entry_by_mapping_index, dst_map_index); if (feip) dp_del_fwd_entry (lcm, src_map_index, dst_map_index); src_map = pool_elt_at_index (lcm->mapping_pool, src_map_index); dst_map = pool_elt_at_index (lcm->mapping_pool, dst_map_index); gid_address_copy (&a->deid, &dst_map->eid); a->vni = gid_address_vni(&a->deid); tidp = hash_get(lcm->table_id_by_vni, a->vni); if (!tidp) { clib_warning("vni %d not associated to a vrf!", a->vni); return; } a->table_id = tidp[0]; /* insert data plane forwarding entry */ a->is_add = 1; /* find best locator pair that 1) verifies LISP policy 2) are connected */ if (0 == get_locator_pair (lcm, src_map, dst_map, &a->slocator, &a->dlocator)) { /* negative entry */ a->is_negative = 1; a->action = dst_map->action; } /* TODO remove */ u8 ipver = ip_prefix_version(&gid_address_ippref(&a->deid)); a->decap_next_index = (ipver == IP4) ? LISP_GPE_INPUT_NEXT_IP4_INPUT : LISP_GPE_INPUT_NEXT_IP6_INPUT; vnet_lisp_gpe_add_del_fwd_entry (a, &sw_if_index); /* add tunnel to fwd entry table XXX check return value from DP insertion */ pool_get (lcm->fwd_entry_pool, fe); fe->dst_loc = a->dlocator; fe->src_loc = a->slocator; gid_address_copy (&fe->deid, &a->deid); hash_set (lcm->fwd_entry_by_mapping_index, dst_map_index, fe - lcm->fwd_entry_pool); } /** * Add/remove mapping to/from map-cache. Overwriting not allowed. */ int vnet_lisp_map_cache_add_del (vnet_lisp_add_del_mapping_args_t * a, u32 * map_index_result) { lisp_cp_main_t * lcm = vnet_lisp_cp_get_main(); u32 mi, * map_indexp, map_index, i; mapping_t * m, * old_map; u32 ** eid_indexes; mi = gid_dictionary_lookup (&lcm->mapping_index_by_gid, &a->eid); old_map = mi != ~0 ? pool_elt_at_index (lcm->mapping_pool, mi) : 0; if (a->is_add) { /* TODO check if overwriting and take appropriate actions */ if (mi != GID_LOOKUP_MISS && !gid_address_cmp (&old_map->eid, &a->eid)) { clib_warning ("eid %U found in the eid-table", format_gid_address, &a->eid); return VNET_API_ERROR_VALUE_EXIST; } pool_get(lcm->mapping_pool, m); gid_address_copy (&m->eid, &a->eid); m->locator_set_index = a->locator_set_index; m->ttl = a->ttl; m->action = a->action; m->local = a->local; map_index = m - lcm->mapping_pool; gid_dictionary_add_del (&lcm->mapping_index_by_gid, &a->eid, map_index, 1); if (pool_is_free_index(lcm->locator_set_pool, a->locator_set_index)) { clib_warning("Locator set with index %d doesn't exist", a->locator_set_index); return VNET_API_ERROR_INVALID_VALUE; } /* add eid to list of eids supported by locator-set */ vec_validate (lcm->locator_set_to_eids, a->locator_set_index); eid_indexes = vec_elt_at_index(lcm->locator_set_to_eids, a->locator_set_index); vec_add1(eid_indexes[0], map_index); if (a->local) { /* mark as local */ vec_add1(lcm->local_mappings_indexes, map_index); } map_index_result[0] = map_index; } else { if (mi == GID_LOOKUP_MISS) { clib_warning("eid %U not found in the eid-table", format_gid_address, &a->eid); return VNET_API_ERROR_INVALID_VALUE; } /* clear locator-set to eids binding */ eid_indexes = vec_elt_at_index(lcm->locator_set_to_eids, a->locator_set_index); for (i = 0; i < vec_len(eid_indexes[0]); i++) { map_indexp = vec_elt_at_index(eid_indexes[0], i); if (map_indexp[0] == mi) break; } vec_del1(eid_indexes[0], i); /* remove local mark if needed */ m = pool_elt_at_index(lcm->mapping_pool, mi); if (m->local) { u32 k, * lm_indexp; for (k = 0; k < vec_len(lcm->local_mappings_indexes); k++) { lm_indexp = vec_elt_at_index(lcm->local_mappings_indexes, k); if (lm_indexp[0] == mi) break; } vec_del1(lcm->local_mappings_indexes, k); } /* remove mapping from dictionary */ gid_dictionary_add_del (&lcm->mapping_index_by_gid, &a->eid, 0, 0); gid_address_free (&m->eid); pool_put_index (lcm->mapping_pool, mi); } return 0; } /** * Add/update/delete mapping to/in/from map-cache. */ int vnet_lisp_add_del_local_mapping (vnet_lisp_add_del_mapping_args_t * a, u32 * map_index_result) { uword * table_id; u32 vni; lisp_cp_main_t * lcm = vnet_lisp_cp_get_main (); if (vnet_lisp_enable_disable_status () == 0) { clib_warning ("LISP is disabled!"); return VNET_API_ERROR_LISP_DISABLED; } vni = gid_address_vni(&a->eid); table_id = hash_get(lcm->table_id_by_vni, vni); if (!table_id) { clib_warning ("vni %d not associated to a vrf!", vni); return VNET_API_ERROR_INVALID_VALUE; } /* store/remove mapping from map-cache */ return vnet_lisp_map_cache_add_del (a, map_index_result); } static clib_error_t * lisp_add_del_local_eid_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { lisp_cp_main_t * lcm = vnet_lisp_cp_get_main(); unformat_input_t _line_input, * line_input = &_line_input; u8 is_add = 1; gid_address_t eid; ip_prefix_t * prefp = &gid_address_ippref(&eid); u8 * mac = gid_address_mac(&eid); gid_address_t * eids = 0; clib_error_t * error = 0; u8 * locator_set_name = 0; u32 locator_set_index = 0, map_index = 0; uword * p; vnet_lisp_add_del_mapping_args_t _a, * a = &_a; int rv = 0; u32 vni = 0; memset (&eid, 0, sizeof (eid)); /* Get a line of input. */ if (! unformat_user (input, unformat_line_input, line_input)) return 0; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { if (unformat (line_input, "add")) is_add = 1; else if (unformat (line_input, "del")) is_add = 0; else if (unformat (line_input, "vni %d", &vni)) gid_address_vni (&eid) = vni; else if (unformat (line_input, "eid %U", unformat_ip_prefix, prefp)) { gid_address_type (&eid) = GID_ADDR_IP_PREFIX; vec_add1(eids, eid); } else if (unformat (line_input, "eid %U", unformat_mac_address, mac)) { gid_address_type (&eid) = GID_ADDR_MAC; vec_add1(eids, eid); } else if (unformat (line_input, "locator-set %_%v%_", &locator_set_name)) { p = hash_get_mem(lcm->locator_set_index_by_name, locator_set_name); if (!p) { error = clib_error_return(0, "locator-set %s doesn't exist", locator_set_name); goto done; } locator_set_index = p[0]; } else { error = unformat_parse_error(line_input); goto done; } } /* XXX treat batch configuration */ a->eid = eid; a->is_add = is_add; a->locator_set_index = locator_set_index; a->local = 1; rv = vnet_lisp_add_del_local_mapping (a, &map_index); if (0 != rv) { error = clib_error_return(0, "failed to %s local mapping!", is_add ? "add" : "delete"); } done: vec_free(eids); if (locator_set_name) vec_free (locator_set_name); gid_address_free (&a->eid); return error; } VLIB_CLI_COMMAND (lisp_add_del_local_eid_command) = { .path = "lisp eid-table", .short_help = "lisp eid-table add/del [vni <vni>] eid <eid> " "locator-set <locator-set>", .function = lisp_add_del_local_eid_command_fn, }; int vnet_lisp_eid_table_map (u32 vni, u32 vrf, u8 is_add) { lisp_cp_main_t * lcm = vnet_lisp_cp_get_main (); uword * table_id, * vnip; if (vnet_lisp_enable_disable_status () == 0) { clib_warning ("LISP is disabled!"); return -1; } if (vni == 0 || vrf == 0) { clib_warning ("can't add/del default vni-vrf mapping!"); return -1; } table_id = hash_get (lcm->table_id_by_vni, vni); vnip = hash_get (lcm->vni_by_table_id, vrf); if (is_add) { if (table_id || vnip) { clib_warning ("vni %d or vrf %d already used in any vrf/vni " "mapping!", vni, vrf); return -1; } hash_set (lcm->table_id_by_vni, vni, vrf); hash_set (lcm->vni_by_table_id, vrf, vni); /* create dp iface */ dp_add_del_iface (lcm, vni, 1); } else { if (!table_id || !vnip) { clib_warning ("vni %d or vrf %d not used in any vrf/vni! " "mapping!", vni, vrf); return -1; } hash_unset (lcm->table_id_by_vni, vni); hash_unset (lcm->vni_by_table_id, vrf); /* remove dp iface */ dp_add_del_iface (lcm, vni, 0); } return 0; } static clib_error_t * lisp_eid_table_map_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { u8 is_add = 1; u32 vni = 0, vrf = 0; unformat_input_t _line_input, * line_input = &_line_input; /* Get a line of input. */ if (! unformat_user (input, unformat_line_input, line_input)) return 0; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { if (unformat (line_input, "del")) is_add = 0; else if (unformat (line_input, "vni %d", &vni)) ; else if (unformat (line_input, "vrf %d", &vrf)) ; else { return unformat_parse_error (line_input); } } vnet_lisp_eid_table_map (vni, vrf, is_add); return 0; } VLIB_CLI_COMMAND (lisp_eid_table_map_command) = { .path = "lisp eid-table map", .short_help = "lisp eid-table map [del] vni <vni> vrf <vrf>", .function = lisp_eid_table_map_command_fn, }; /* return 0 if the two locator sets are identical 1 otherwise */ static u8 compare_locators (lisp_cp_main_t *lcm, u32 * old_ls_indexes, locator_t * new_locators) { u32 i, old_li; locator_t * old_loc, * new_loc; if (vec_len (old_ls_indexes) != vec_len(new_locators)) return 1; for (i = 0; i < vec_len(new_locators); i++) { old_li = vec_elt(old_ls_indexes, i); old_loc = pool_elt_at_index(lcm->locator_pool, old_li); new_loc = vec_elt_at_index(new_locators, i); if (locator_cmp (old_loc, new_loc)) return 1; } return 0; } /** * Adds/removes/updates mapping. Does not program forwarding. * * @param eid end-host identifier * @param rlocs vector of remote locators * @param action action for negative map-reply * @param is_add add mapping if non-zero, delete otherwise * @param res_map_index the map-index that was created/updated/removed. It is * set to ~0 if no action is taken. * @return return code */ int vnet_lisp_add_del_mapping (gid_address_t * eid, locator_t * rlocs, u8 action, u8 authoritative, u32 ttl, u8 is_add, u32 * res_map_index) { vnet_lisp_add_del_mapping_args_t _m_args, * m_args = &_m_args; vnet_lisp_add_del_locator_set_args_t _ls_args, * ls_args = &_ls_args; lisp_cp_main_t * lcm = vnet_lisp_cp_get_main (); u32 mi, ls_index = 0, dst_map_index; mapping_t * old_map; if (vnet_lisp_enable_disable_status() == 0) { clib_warning ("LISP is disabled!"); return VNET_API_ERROR_LISP_DISABLED; } if (res_map_index) res_map_index[0] = ~0; memset (m_args, 0, sizeof (m_args[0])); memset (ls_args, 0, sizeof (ls_args[0])); ls_args->locators = rlocs; mi = gid_dictionary_lookup (&lcm->mapping_index_by_gid, eid); old_map = ((u32) ~0 != mi) ? pool_elt_at_index(lcm->mapping_pool, mi) : 0; if (is_add) { /* overwrite: if mapping already exists, decide if locators should be * updated and be done */ if (old_map && gid_address_cmp (&old_map->eid, eid) == 0) { locator_set_t * old_ls; /* update mapping attributes */ old_map->action = action; old_map->authoritative = authoritative; old_map->ttl = ttl; old_ls = pool_elt_at_index(lcm->locator_set_pool, old_map->locator_set_index); if (compare_locators (lcm, old_ls->locator_indices, ls_args->locators)) { /* set locator-set index to overwrite */ ls_args->is_add = 1; ls_args->index = old_map->locator_set_index; vnet_lisp_add_del_locator_set (ls_args, 0); if (res_map_index) res_map_index[0] = mi; } } /* new mapping */ else { ls_args->is_add = 1; ls_args->index = ~0; vnet_lisp_add_del_locator_set (ls_args, &ls_index); /* add mapping */ gid_address_copy (&m_args->eid, eid); m_args->is_add = 1; m_args->action = action; m_args->locator_set_index = ls_index; vnet_lisp_map_cache_add_del (m_args, &dst_map_index); if (res_map_index) res_map_index[0] = dst_map_index; } } else { if (old_map == 0 || gid_address_cmp (&old_map->eid, eid) != 0) { clib_warning("cannot delete mapping for eid %U", format_gid_address, eid); return -1; } m_args->is_add = 0; gid_address_copy (&m_args->eid, eid); m_args->locator_set_index = old_map->locator_set_index; /* delete mapping associated from map-cache */ vnet_lisp_map_cache_add_del (m_args, 0); ls_args->is_add = 0; ls_args->index = old_map->locator_set_index; /* delete locator set */ vnet_lisp_add_del_locator_set (ls_args, 0); /* return old mapping index */ res_map_index[0] = mi; } /* success */ return 0; } int vnet_lisp_clear_all_remote_adjacencies (void) { int rv = 0; u32 mi, * map_indices = 0, * map_indexp; lisp_cp_main_t * lcm = vnet_lisp_cp_get_main (); vnet_lisp_add_del_mapping_args_t _dm_args, * dm_args = &_dm_args; vnet_lisp_add_del_locator_set_args_t _ls, * ls = &_ls; pool_foreach_index (mi, lcm->mapping_pool, ({ vec_add1 (map_indices, mi); })); vec_foreach (map_indexp, map_indices) { mapping_t * map = pool_elt_at_index (lcm->mapping_pool, map_indexp[0]); if (!map->local) { dp_del_fwd_entry (lcm, 0, map_indexp[0]); dm_args->is_add = 0; gid_address_copy (&dm_args->eid, &map->eid); dm_args->locator_set_index = map->locator_set_index; /* delete mapping associated to fwd entry */ vnet_lisp_map_cache_add_del (dm_args, 0); ls->is_add = 0; ls->local = 0; ls->index = map->locator_set_index; /* delete locator set */ rv = vnet_lisp_add_del_locator_set (ls, 0); if (rv != 0) goto cleanup; } } cleanup: if (map_indices) vec_free (map_indices); return rv; } /** * Adds adjacency or removes forwarding entry associated to remote mapping. * Note that adjacencies are not stored, they only result in forwarding entries * being created. */ int lisp_add_del_adjacency (lisp_cp_main_t * lcm, gid_address_t * local_eid, gid_address_t * remote_eid, u8 is_add) { u32 local_mi, remote_mi = ~0; if (vnet_lisp_enable_disable_status () == 0) { clib_warning ("LISP is disabled!"); return VNET_API_ERROR_LISP_DISABLED; } remote_mi = gid_dictionary_lookup (&lcm->mapping_index_by_gid, remote_eid); if (GID_LOOKUP_MISS == remote_mi) { clib_warning("Remote eid %U not found. Cannot add adjacency!", format_gid_address, remote_eid); return -1; } if (is_add) { /* TODO 1) check if src/dst 2) once we have src/dst working, use it in * delete*/ /* check if source eid has an associated mapping. If pitr mode is on, * just use the pitr's mapping */ local_mi = lcm->lisp_pitr ? lcm->pitr_map_index : gid_dictionary_lookup (&lcm->mapping_index_by_gid, local_eid); if (GID_LOOKUP_MISS == local_mi) { clib_warning("Local eid %U not found. Cannot add adjacency!", format_gid_address, local_eid); return -1; } /* update forwarding */ dp_add_fwd_entry (lcm, local_mi, remote_mi); } else dp_del_fwd_entry (lcm, 0, remote_mi); return 0; } int vnet_lisp_add_del_adjacency (vnet_lisp_add_del_adjacency_args_t * a) { lisp_cp_main_t * lcm = vnet_lisp_cp_get_main (); return lisp_add_del_adjacency(lcm, &a->seid, &a->deid, a->is_add); } /** * Handler for add/del remote mapping CLI. * * @param vm vlib context * @param input input from user * @param cmd cmd * @return pointer to clib error structure */ static clib_error_t * lisp_add_del_remote_mapping_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { clib_error_t * error = 0; unformat_input_t _line_input, * line_input = &_line_input; u8 is_add = 1, del_all = 0; locator_t rloc, * rlocs = 0, * curr_rloc = 0; ip_prefix_t * deid_ippref, * seid_ippref; gid_address_t seid, deid; u8 * dmac = gid_address_mac (&deid); u8 * smac = gid_address_mac (&seid); u8 deid_set = 0, seid_set = 0; u8 * s = 0; u32 vni, action = ~0, p, w; int rv; /* Get a line of input. */ if (! unformat_user (input, unformat_line_input, line_input)) return 0; memset(&deid, 0, sizeof(deid)); memset(&seid, 0, sizeof(seid)); memset(&rloc, 0, sizeof(rloc)); seid_ippref = &gid_address_ippref(&seid); deid_ippref = &gid_address_ippref(&deid); while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { if (unformat (line_input, "del-all")) del_all = 1; else if (unformat (line_input, "del")) is_add = 0; else if (unformat (line_input, "add")) ; else if (unformat (line_input, "deid %U", unformat_ip_prefix, deid_ippref)) { gid_address_type (&deid) = GID_ADDR_IP_PREFIX; deid_set = 1; } else if (unformat (line_input, "deid %U", unformat_mac_address, dmac)) { gid_address_type (&deid) = GID_ADDR_MAC; deid_set = 1; } else if (unformat (line_input, "vni %u", &vni)) { gid_address_vni (&seid) = vni; gid_address_vni (&deid) = vni; } else if (unformat (line_input, "seid %U", unformat_ip_prefix, seid_ippref)) { gid_address_type (&seid) = GID_ADDR_IP_PREFIX; seid_set = 1; } else if (unformat (line_input, "seid %U", unformat_mac_address, smac)) { gid_address_type (&seid) = GID_ADDR_MAC; seid_set = 1; } else if (unformat (line_input, "p %d w %d", &p, &w)) { if (!curr_rloc) { clib_warning ("No RLOC configured for setting priority/weight!"); goto done; } curr_rloc->priority = p; curr_rloc->weight = w; } else if (unformat (line_input, "rloc %U", unformat_ip_address, &rloc.address)) { vec_add1 (rlocs, rloc); curr_rloc = &rlocs[vec_len (rlocs) - 1]; } else if (unformat (line_input, "action %s", &s)) { if (!strcmp ((char *)s, "no-action")) action = ACTION_NONE; if (!strcmp ((char *)s, "natively-forward")) action = ACTION_NATIVELY_FORWARDED; if (!strcmp ((char *)s, "send-map-request")) action = ACTION_SEND_MAP_REQUEST; else if (!strcmp ((char *)s, "drop")) action = ACTION_DROP; else { clib_warning ("invalid action: '%s'", s); goto done; } } else { clib_warning ("parse error"); goto done; } } if (!del_all) { if (!deid_set) { clib_warning ("missing deid!"); goto done; } if (GID_ADDR_IP_PREFIX == gid_address_type (&deid)) { /* if seid not set, make sure the ip version is the same as that * of the deid. This ensures the seid to be configured will be * either 0/0 or ::/0 */ if (!seid_set) ip_prefix_version(seid_ippref) = ip_prefix_version(deid_ippref); if (is_add && (ip_prefix_version (deid_ippref) != ip_prefix_version(seid_ippref))) { clib_warning ("source and destination EIDs are not" " in the same IP family!"); goto done; } } if (is_add && (~0 == action) && 0 == vec_len (rlocs)) { clib_warning ("no action set for negative map-reply!"); goto done; } } else { vnet_lisp_clear_all_remote_adjacencies (); goto done; } /* TODO build src/dst with seid*/ /* if it's a delete, clean forwarding */ if (!is_add) { lisp_cp_main_t * lcm = vnet_lisp_cp_get_main (); rv = lisp_add_del_adjacency (lcm, 0, &deid, /* is_add */ 0); } else { /* add as static remote mapping, i.e., not authoritative and infinite * ttl */ rv = vnet_lisp_add_del_mapping (&deid, rlocs, action, 0, ~0, is_add, 0); } if (rv) clib_warning("failed to %s remote mapping!", is_add ? "add" : "delete"); done: vec_free (rlocs); unformat_free (line_input); if (s) vec_free (s); return error; } VLIB_CLI_COMMAND (lisp_add_del_remote_mapping_command) = { .path = "lisp remote-mapping", .short_help = "lisp remote-mapping add|del [del-all] vni <vni>" "deid <dest-eid> seid <src-eid> [action <no-action|natively-forward|" "send-map-request|drop>] rloc <dst-locator> [rloc <dst-locator> ... ]", .function = lisp_add_del_remote_mapping_command_fn, }; /** * Handler for add/del adjacency CLI. */ static clib_error_t * lisp_add_del_adjacency_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { clib_error_t * error = 0; unformat_input_t _line_input, * line_input = &_line_input; vnet_lisp_add_del_adjacency_args_t _a, * a = &_a; u8 is_add = 1; locator_t rloc, * rlocs = 0; ip_prefix_t * deid_ippref, * seid_ippref; gid_address_t seid, deid; u8 * dmac = gid_address_mac (&deid); u8 * smac = gid_address_mac (&seid); u8 deid_set = 0, seid_set = 0; u8 * s = 0; u32 vni, action = ~0; int rv; /* Get a line of input. */ if (! unformat_user (input, unformat_line_input, line_input)) return 0; memset(&deid, 0, sizeof(deid)); memset(&seid, 0, sizeof(seid)); memset(&rloc, 0, sizeof(rloc)); seid_ippref = &gid_address_ippref(&seid); deid_ippref = &gid_address_ippref(&deid); while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { if (unformat (line_input, "del")) is_add = 0; else if (unformat (line_input, "add")) ; else if (unformat (line_input, "deid %U", unformat_ip_prefix, deid_ippref)) { gid_address_type (&deid) = GID_ADDR_IP_PREFIX; deid_set = 1; } else if (unformat (line_input, "deid %U", unformat_mac_address, dmac)) { gid_address_type (&deid) = GID_ADDR_MAC; deid_set = 1; } else if (unformat (line_input, "vni %u", &vni)) { gid_address_vni (&seid) = vni; gid_address_vni (&deid) = vni; } else if (unformat (line_input, "seid %U", unformat_ip_prefix, seid_ippref)) { gid_address_type (&seid) = GID_ADDR_IP_PREFIX; seid_set = 1; } else if (unformat (line_input, "seid %U", unformat_mac_address, smac)) { gid_address_type (&seid) = GID_ADDR_MAC; seid_set = 1; } else { clib_warning ("parse error"); goto done; } } if (!deid_set) { clib_warning ("missing deid!"); goto done; } if (GID_ADDR_IP_PREFIX == gid_address_type (&deid)) { /* if seid not set, make sure the ip version is the same as that * of the deid. This ensures the seid to be configured will be * either 0/0 or ::/0 */ if (!seid_set) ip_prefix_version(seid_ippref) = ip_prefix_version(deid_ippref); if (is_add && (ip_prefix_version (deid_ippref) != ip_prefix_version(seid_ippref))) { clib_warning ("source and destination EIDs are not" " in the same IP family!"); goto done; } } if (is_add && (~0 == action) && 0 == vec_len (rlocs)) { clib_warning ("no action set for negative map-reply!"); goto done; } memset(a, 0, sizeof(a[0])); gid_address_copy (&a->seid, &deid); gid_address_copy (&a->deid, &seid); a->is_add = is_add; rv = vnet_lisp_add_del_adjacency (a); if (rv) clib_warning("failed to %s adjacency!", is_add ? "add" : "delete"); done: unformat_free (line_input); if (s) vec_free (s); return error; } VLIB_CLI_COMMAND (lisp_add_del_adjacency_command) = { .path = "lisp adjacency", .short_help = "lisp adjacency add|del vni <vni>" "deid <dest-eid> seid <src-eid> [action <no-action|natively-forward|" "send-map-request|drop>] rloc <dst-locator> [rloc <dst-locator> ... ]", .function = lisp_add_del_adjacency_command_fn, }; static clib_error_t * lisp_show_map_resolvers_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { ip_address_t * addr; lisp_cp_main_t * lcm = vnet_lisp_cp_get_main (); vec_foreach (addr, lcm->map_resolvers) { vlib_cli_output (vm, "%U", format_ip_address, addr); } return 0; } VLIB_CLI_COMMAND (lisp_show_map_resolvers_command) = { .path = "show lisp map-resolvers", .short_help = "show lisp map-resolvers", .function = lisp_show_map_resolvers_command_fn, }; int vnet_lisp_pitr_set_locator_set (u8 * locator_set_name, u8 is_add) { lisp_cp_main_t * lcm = vnet_lisp_cp_get_main (); u32 locator_set_index = ~0; mapping_t * m; uword * p; if (vnet_lisp_enable_disable_status () == 0) { clib_warning ("LISP is disabled!"); return VNET_API_ERROR_LISP_DISABLED; } p = hash_get_mem (lcm->locator_set_index_by_name, locator_set_name); if (!p) { clib_warning ("locator-set %v doesn't exist", locator_set_name); return -1; } locator_set_index = p[0]; if (is_add) { pool_get (lcm->mapping_pool, m); m->locator_set_index = locator_set_index; m->local = 1; lcm->pitr_map_index = m - lcm->mapping_pool; /* enable pitr mode */ lcm->lisp_pitr = 1; } else { /* remove pitr mapping */ pool_put_index (lcm->mapping_pool, lcm->pitr_map_index); /* disable pitr mode */ lcm->lisp_pitr = 0; } return 0; } static clib_error_t * lisp_pitr_set_locator_set_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { u8 locator_name_set = 0; u8 * locator_set_name = 0; u8 is_add = 1; unformat_input_t _line_input, * line_input = &_line_input; clib_error_t * error = 0; int rv = 0; /* Get a line of input. */ if (! unformat_user (input, unformat_line_input, line_input)) return 0; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { if (unformat (line_input, "ls %_%v%_", &locator_set_name)) locator_name_set = 1; else if (unformat (line_input, "disable")) is_add = 0; else return clib_error_return (0, "parse error"); } if (!locator_name_set) { clib_warning ("No locator set specified!"); goto done; } rv = vnet_lisp_pitr_set_locator_set (locator_set_name, is_add); if (0 != rv) { error = clib_error_return(0, "failed to %s pitr!", is_add ? "add" : "delete"); } done: if (locator_set_name) vec_free (locator_set_name); return error; } VLIB_CLI_COMMAND (lisp_pitr_set_locator_set_command) = { .path = "lisp pitr", .short_help = "lisp pitr [disable] ls <locator-set-name>", .function = lisp_pitr_set_locator_set_command_fn, }; static u8 * format_eid_entry (u8 * s, va_list * args) { vnet_main_t * vnm = va_arg (*args, vnet_main_t *); lisp_cp_main_t * lcm = va_arg (*args, lisp_cp_main_t *); gid_address_t * gid = va_arg (*args, gid_address_t *); locator_set_t * ls = va_arg (*args, locator_set_t *); u32 * loc_index; u8 first_line = 1; u8 * loc; u8 * type = ls->local ? format(0, "local(%s)", ls->name) : format(0, "remote"); if (vec_len (ls->locator_indices) == 0) { s = format (s, "%-35U%-20s", format_gid_address, gid, type); } else { vec_foreach (loc_index, ls->locator_indices) { locator_t * l = pool_elt_at_index (lcm->locator_pool, loc_index[0]); if (l->local) loc = format (0, "%U", format_vnet_sw_if_index_name, vnm, l->sw_if_index); else loc = format (0, "%U", format_ip_address, &gid_address_ip (&l->address)); if (first_line) { s = format (s, "%-35U%-20s%-v\n", format_gid_address, gid, type, loc); first_line = 0; } else s = format (s, "%55s%v\n", "", loc); } } return s; } static clib_error_t * lisp_show_eid_table_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { lisp_cp_main_t * lcm = vnet_lisp_cp_get_main(); mapping_t * mapit; unformat_input_t _line_input, * line_input = &_line_input; u32 mi; gid_address_t eid; u8 print_all = 1; memset (&eid, 0, sizeof(eid)); /* Get a line of input. */ if (!unformat_user (input, unformat_line_input, line_input)) return 0; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { if (unformat (line_input, "eid %U", unformat_gid_address, &eid)) print_all = 0; else return clib_error_return (0, "parse error: '%U'", format_unformat_error, line_input); } vlib_cli_output (vm, "%-35s%-20s%-s", "EID", "type", "locators"); if (print_all) { pool_foreach (mapit, lcm->mapping_pool, ({ locator_set_t * ls = pool_elt_at_index (lcm->locator_set_pool, mapit->locator_set_index); vlib_cli_output (vm, "%U", format_eid_entry, lcm->vnet_main, lcm, &mapit->eid, ls); })); } else { mi = gid_dictionary_lookup (&lcm->mapping_index_by_gid, &eid); if ((u32)~0 == mi) return 0; mapit = pool_elt_at_index (lcm->mapping_pool, mi); locator_set_t * ls = pool_elt_at_index (lcm->locator_set_pool, mapit->locator_set_index); vlib_cli_output (vm, "%U", format_eid_entry, lcm->vnet_main, lcm, &mapit->eid, ls); } return 0; } VLIB_CLI_COMMAND (lisp_cp_show_eid_table_command) = { .path = "show lisp eid-table", .short_help = "Shows EID table", .function = lisp_show_eid_table_command_fn, }; /* cleans locator to locator-set data and removes locators not part of * any locator-set */ static void clean_locator_to_locator_set (lisp_cp_main_t * lcm, u32 lsi) { u32 i, j, *loc_indexp, *ls_indexp, **ls_indexes, *to_be_deleted = 0; locator_set_t * ls = pool_elt_at_index(lcm->locator_set_pool, lsi); for (i = 0; i < vec_len(ls->locator_indices); i++) { loc_indexp = vec_elt_at_index(ls->locator_indices, i); ls_indexes = vec_elt_at_index(lcm->locator_to_locator_sets, loc_indexp[0]); for (j = 0; j < vec_len(ls_indexes[0]); j++) { ls_indexp = vec_elt_at_index(ls_indexes[0], j); if (ls_indexp[0] == lsi) break; } /* delete index for removed locator-set*/ vec_del1(ls_indexes[0], j); /* delete locator if it's part of no locator-set */ if (vec_len (ls_indexes[0]) == 0) { pool_put_index (lcm->locator_pool, loc_indexp[0]); vec_add1 (to_be_deleted, i); } } if (to_be_deleted) { for (i = 0; i < vec_len (to_be_deleted); i++) { loc_indexp = vec_elt_at_index (to_be_deleted, i); vec_del1 (ls->locator_indices, loc_indexp[0]); } vec_free (to_be_deleted); } } static inline uword * get_locator_set_index (vnet_lisp_add_del_locator_set_args_t * a, uword * p) { lisp_cp_main_t * lcm = vnet_lisp_cp_get_main(); ASSERT(a != NULL); ASSERT(p != NULL); /* find locator-set */ if (a->local) { p = hash_get_mem(lcm->locator_set_index_by_name, a->name); } else { *p = a->index; } return p; } static inline int is_locator_in_locator_set (lisp_cp_main_t * lcm, locator_set_t * ls, locator_t * loc) { locator_t * itloc; u32 * locit; ASSERT(ls != NULL); ASSERT(loc != NULL); vec_foreach(locit, ls->locator_indices) { itloc = pool_elt_at_index(lcm->locator_pool, locit[0]); if (itloc->sw_if_index == loc->sw_if_index || !gid_address_cmp(&itloc->address, &loc->address)) { clib_warning("Duplicate locator"); return VNET_API_ERROR_VALUE_EXIST; } } return 0; } static inline void remove_locator_from_locator_set (locator_set_t * ls, u32 * locit, u32 ls_index, u32 loc_id) { lisp_cp_main_t * lcm = vnet_lisp_cp_get_main(); u32 ** ls_indexes = NULL; ASSERT(ls != NULL); ASSERT(locit != NULL); ls_indexes = vec_elt_at_index(lcm->locator_to_locator_sets, locit[0]); pool_put_index(lcm->locator_pool, locit[0]); vec_del1(ls->locator_indices, loc_id); vec_del1(ls_indexes[0], ls_index); } int vnet_lisp_add_del_locator (vnet_lisp_add_del_locator_set_args_t * a, locator_set_t * ls, u32 * ls_result) { lisp_cp_main_t * lcm = vnet_lisp_cp_get_main(); locator_t * loc = NULL, *itloc = NULL; uword _p = (u32)~0, * p = &_p; u32 loc_index = ~0, ls_index = ~0, * locit = NULL, ** ls_indexes = NULL; u32 loc_id = ~0; int ret = 0; ASSERT(a != NULL); if (vnet_lisp_enable_disable_status () == 0) { clib_warning ("LISP is disabled!"); return VNET_API_ERROR_LISP_DISABLED; } p = get_locator_set_index(a, p); if (!p) { clib_warning("locator-set %v doesn't exist", a->name); return VNET_API_ERROR_INVALID_ARGUMENT; } if (ls == 0) { ls = pool_elt_at_index(lcm->locator_set_pool, p[0]); if (!ls) { clib_warning("locator-set %d to be overwritten doesn't exist!", p[0]); return VNET_API_ERROR_INVALID_ARGUMENT; } } if (a->is_add) { if (ls_result) ls_result[0] = p[0]; /* allocate locators */ vec_foreach (itloc, a->locators) { ret = is_locator_in_locator_set(lcm, ls, itloc); if (0 != ret) { return ret; } pool_get(lcm->locator_pool, loc); loc[0] = itloc[0]; loc_index = loc - lcm->locator_pool; vec_add1(ls->locator_indices, loc_index); vec_validate (lcm->locator_to_locator_sets, loc_index); ls_indexes = vec_elt_at_index(lcm->locator_to_locator_sets, loc_index); vec_add1(ls_indexes[0], ls_index); } } else { ls_index = p[0]; itloc = a->locators; loc_id = 0; vec_foreach (locit, ls->locator_indices) { loc = pool_elt_at_index(lcm->locator_pool, locit[0]); if (loc->local && loc->sw_if_index == itloc->sw_if_index) { remove_locator_from_locator_set(ls, locit, ls_index, loc_id); } if (0 == loc->local && !gid_address_cmp(&loc->address, &itloc->address)) { remove_locator_from_locator_set(ls, locit, ls_index, loc_id); } loc_id++; } } return 0; } int vnet_lisp_add_del_locator_set (vnet_lisp_add_del_locator_set_args_t * a, u32 * ls_result) { lisp_cp_main_t * lcm = vnet_lisp_cp_get_main(); locator_set_t * ls; uword _p = (u32)~0, * p = &_p; u32 ls_index; u32 ** eid_indexes; int ret = 0; if (vnet_lisp_enable_disable_status () == 0) { clib_warning ("LISP is disabled!"); return VNET_API_ERROR_LISP_DISABLED; } if (a->is_add) { p = get_locator_set_index(a, p); /* overwrite */ if (p && p[0] != (u32)~0) { ls = pool_elt_at_index(lcm->locator_set_pool, p[0]); if (!ls) { clib_warning("locator-set %d to be overwritten doesn't exist!", p[0]); return -1; } /* clean locator to locator-set vectors and remove locators if * they're not part of another locator-set */ clean_locator_to_locator_set (lcm, p[0]); /* remove locator indices from locator set */ vec_free(ls->locator_indices); ls_index = p[0]; if (ls_result) ls_result[0] = p[0]; } /* new locator-set */ else { pool_get(lcm->locator_set_pool, ls); memset(ls, 0, sizeof(*ls)); ls_index = ls - lcm->locator_set_pool; if (a->local) { ls->name = vec_dup(a->name); if (!lcm->locator_set_index_by_name) lcm->locator_set_index_by_name = hash_create_vec( /* size */0, sizeof(ls->name[0]), sizeof(uword)); hash_set_mem(lcm->locator_set_index_by_name, ls->name, ls_index); /* mark as local locator-set */ vec_add1(lcm->local_locator_set_indexes, ls_index); } ls->local = a->local; if (ls_result) ls_result[0] = ls_index; } ret = vnet_lisp_add_del_locator(a, ls, NULL); if (0 != ret) { return ret; } } else { p = get_locator_set_index(a, p); if (!p) { clib_warning("locator-set %v doesn't exists", a->name); return -1; } ls = pool_elt_at_index(lcm->locator_set_pool, p[0]); if (!ls) { clib_warning("locator-set with index %d doesn't exists", p[0]); return -1; } if (lcm->mreq_itr_rlocs == p[0]) { clib_warning ("Can't delete the locator-set used to constrain " "the itr-rlocs in map-requests!"); return -1; } if (vec_len(lcm->locator_set_to_eids) != 0) { eid_indexes = vec_elt_at_index(lcm->locator_set_to_eids, p[0]); if (vec_len(eid_indexes[0]) != 0) { clib_warning ("Can't delete a locator that supports a mapping!"); return -1; } } /* clean locator to locator-sets data */ clean_locator_to_locator_set (lcm, p[0]); if (ls->local) { u32 it, lsi; vec_foreach_index(it, lcm->local_locator_set_indexes) { lsi = vec_elt(lcm->local_locator_set_indexes, it); if (lsi == p[0]) { vec_del1(lcm->local_locator_set_indexes, it); break; } } hash_unset_mem(lcm->locator_set_index_by_name, ls->name); } vec_free(ls->name); vec_free(ls->locator_indices); pool_put(lcm->locator_set_pool, ls); } return 0; } clib_error_t * vnet_lisp_enable_disable (u8 is_enable) { u32 vni, table_id; clib_error_t * error = 0; lisp_cp_main_t * lcm = vnet_lisp_cp_get_main (); vnet_lisp_gpe_enable_disable_args_t _a, * a = &_a; a->is_en = is_enable; error = vnet_lisp_gpe_enable_disable (a); if (error) { return clib_error_return (0, "failed to %s data-plane!", a->is_en ? "enable" : "disable"); } if (is_enable) { /* enable all ifaces */ hash_foreach(vni, table_id, lcm->table_id_by_vni, ({ dp_add_del_iface(lcm, vni, 1); })); } else { /* clear interface table */ hash_free(lcm->dp_intf_by_vni); hash_free(lcm->fwd_entry_by_mapping_index); pool_free(lcm->fwd_entry_pool); } /* update global flag */ lcm->is_enabled = is_enable; return 0; } static clib_error_t * lisp_enable_disable_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { unformat_input_t _line_input, * line_input = &_line_input; u8 is_enabled = 0; u8 is_set = 0; /* Get a line of input. */ if (! unformat_user (input, unformat_line_input, line_input)) return 0; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { if (unformat (line_input, "enable")) { is_set = 1; is_enabled = 1; } else if (unformat (line_input, "disable")) is_set = 1; else { return clib_error_return (0, "parse error: '%U'", format_unformat_error, line_input); } } if (!is_set) return clib_error_return (0, "state not set"); return vnet_lisp_enable_disable (is_enabled); } VLIB_CLI_COMMAND (lisp_cp_enable_disable_command) = { .path = "lisp", .short_help = "lisp [enable|disable]", .function = lisp_enable_disable_command_fn, }; u8 vnet_lisp_enable_disable_status (void) { lisp_cp_main_t * lcm = vnet_lisp_cp_get_main (); return lcm->is_enabled; } static u8 * format_lisp_status (u8 * s, va_list * args) { lisp_cp_main_t * lcm = vnet_lisp_cp_get_main (); return format (s, "%s", lcm->is_enabled ? "enabled" : "disabled"); } static clib_error_t * lisp_show_status_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { u8 * msg = 0; msg = format (msg, "feature: %U\ngpe: %U\n", format_lisp_status, format_vnet_lisp_gpe_status); vlib_cli_output (vm, "%v", msg); vec_free (msg); return 0; } VLIB_CLI_COMMAND (lisp_show_status_command) = { .path = "show lisp status", .short_help = "show lisp status", .function = lisp_show_status_command_fn, }; static clib_error_t * lisp_show_eid_table_map_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { hash_pair_t * p; lisp_cp_main_t * lcm = vnet_lisp_cp_get_main (); vlib_cli_output (vm, "%=10s%=10s", "VNI", "VRF"); hash_foreach_pair (p, lcm->table_id_by_vni, { vlib_cli_output (vm, "%=10d%=10d", p->key, p->value[0]); }); return 0; } VLIB_CLI_COMMAND (lisp_show_eid_table_map_command) = { .path = "show lisp eid-table map", .short_help = "show lisp eid-table vni to vrf mappings", .function = lisp_show_eid_table_map_command_fn, }; static clib_error_t * lisp_add_del_locator_set_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { lisp_gpe_main_t * lgm = &lisp_gpe_main; vnet_main_t * vnm = lgm->vnet_main; unformat_input_t _line_input, * line_input = &_line_input; u8 is_add = 1; clib_error_t * error = 0; u8 * locator_set_name = 0; locator_t locator, * locators = 0; vnet_lisp_add_del_locator_set_args_t _a, * a = &_a; u32 ls_index = 0; int rv = 0; memset(&locator, 0, sizeof(locator)); memset(a, 0, sizeof(a[0])); /* Get a line of input. */ if (! unformat_user (input, unformat_line_input, line_input)) return 0; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { if (unformat (line_input, "add %_%v%_", &locator_set_name)) is_add = 1; else if (unformat (line_input, "del %_%v%_", &locator_set_name)) is_add = 0; else if (unformat (line_input, "iface %U p %d w %d", unformat_vnet_sw_interface, vnm, &locator.sw_if_index, &locator.priority, &locator.weight)) { locator.local = 1; vec_add1(locators, locator); } else { error = unformat_parse_error(line_input); goto done; } } a->name = locator_set_name; a->locators = locators; a->is_add = is_add; a->local = 1; rv = vnet_lisp_add_del_locator_set(a, &ls_index); if (0 != rv) { error = clib_error_return(0, "failed to %s locator-set!", is_add ? "add" : "delete"); } done: vec_free(locators); if (locator_set_name) vec_free (locator_set_name); return error; } VLIB_CLI_COMMAND (lisp_cp_add_del_locator_set_command) = { .path = "lisp locator-set", .short_help = "lisp locator-set add/del <name> [iface <iface-name> " "p <priority> w <weight>]", .function = lisp_add_del_locator_set_command_fn, }; static clib_error_t * lisp_add_del_locator_in_set_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { lisp_gpe_main_t * lgm = &lisp_gpe_main; vnet_main_t * vnm = lgm->vnet_main; unformat_input_t _line_input, * line_input = &_line_input; u8 is_add = 1; clib_error_t * error = 0; u8 * locator_set_name = 0; u8 locator_set_name_set = 0; locator_t locator, * locators = 0; vnet_lisp_add_del_locator_set_args_t _a, * a = &_a; u32 ls_index = 0; memset(&locator, 0, sizeof(locator)); memset(a, 0, sizeof(a[0])); /* Get a line of input. */ if (! unformat_user (input, unformat_line_input, line_input)) return 0; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { if (unformat (line_input, "add")) is_add = 1; else if (unformat (line_input, "del")) is_add = 0; else if (unformat(line_input, "locator-set %_%v%_", &locator_set_name)) locator_set_name_set = 1; else if (unformat (line_input, "iface %U p %d w %d", unformat_vnet_sw_interface, vnm, &locator.sw_if_index, &locator.priority, &locator.weight)) { locator.local = 1; vec_add1(locators, locator); } else { error = unformat_parse_error(line_input); goto done; } } if (!locator_set_name_set) { error = clib_error_return(0, "locator_set name not set!"); goto done; } a->name = locator_set_name; a->locators = locators; a->is_add = is_add; a->local = 1; vnet_lisp_add_del_locator(a, 0, &ls_index); done: vec_free(locators); vec_free (locator_set_name); return error; } VLIB_CLI_COMMAND (lisp_cp_add_del_locator_in_set_command) = { .path = "lisp locator", .short_help = "lisp locator add/del locator-set <name> iface <iface-name> " "p <priority> w <weight>", .function = lisp_add_del_locator_in_set_command_fn, }; static clib_error_t * lisp_cp_show_locator_sets_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { locator_set_t * lsit; locator_t * loc; u32 * locit; lisp_cp_main_t * lcm = vnet_lisp_cp_get_main(); vlib_cli_output (vm, "%=20s%=16s%=16s%=16s", "Locator-set", "Locator", "Priority", "Weight"); pool_foreach (lsit, lcm->locator_set_pool, ({ u8 * msg = 0; int next_line = 0; msg = format (msg, "%=16v", lsit->name); vec_foreach (locit, lsit->locator_indices) { if (next_line) { msg = format (msg, "%16s", " "); } loc = pool_elt_at_index (lcm->locator_pool, locit[0]); if (loc->local) msg = format (msg, "%16d%16d%16d\n", loc->sw_if_index, loc->priority, loc->weight); else msg = format (msg, "%16U%16d%16d\n", format_ip_address, &gid_address_ip(&loc->address), loc->priority, loc->weight); next_line = 1; } vlib_cli_output (vm, "%v", msg); vec_free (msg); })); return 0; } VLIB_CLI_COMMAND (lisp_cp_show_locator_sets_command) = { .path = "show lisp locator-set", .short_help = "Shows locator-sets", .function = lisp_cp_show_locator_sets_command_fn, }; int vnet_lisp_add_del_map_resolver (vnet_lisp_add_del_map_resolver_args_t * a) { lisp_cp_main_t * lcm = vnet_lisp_cp_get_main(); ip_address_t * addr; u32 i; if (vnet_lisp_enable_disable_status () == 0) { clib_warning ("LISP is disabled!"); return VNET_API_ERROR_LISP_DISABLED; } if (a->is_add) { vec_foreach(addr, lcm->map_resolvers) { if (!ip_address_cmp (addr, &a->address)) { clib_warning("map-resolver %U already exists!", format_ip_address, &a->address); return -1; } } vec_add1(lcm->map_resolvers, a->address); } else { for (i = 0; i < vec_len(lcm->map_resolvers); i++) { addr = vec_elt_at_index(lcm->map_resolvers, i); if (!ip_address_cmp (addr, &a->address)) { vec_delete(lcm->map_resolvers, 1, i); break; } } } return 0; } static clib_error_t * lisp_add_del_map_resolver_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { unformat_input_t _line_input, * line_input = &_line_input; u8 is_add = 1; ip_address_t ip_addr; clib_error_t * error = 0; int rv = 0; vnet_lisp_add_del_map_resolver_args_t _a, * a = &_a; /* Get a line of input. */ if (! unformat_user (input, unformat_line_input, line_input)) return 0; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { if (unformat (line_input, "add")) is_add = 1; else if (unformat (line_input, "del")) is_add = 0; else if (unformat (line_input, "%U", unformat_ip_address, &ip_addr)) ; else { error = unformat_parse_error(line_input); goto done; } } a->is_add = is_add; a->address = ip_addr; rv = vnet_lisp_add_del_map_resolver (a); if (0 != rv) { error = clib_error_return(0, "failed to %s map-resolver!", is_add ? "add" : "delete"); } done: return error; } VLIB_CLI_COMMAND (lisp_add_del_map_resolver_command) = { .path = "lisp map-resolver", .short_help = "lisp map-resolver add/del <ip_address>", .function = lisp_add_del_map_resolver_command_fn, }; int vnet_lisp_add_del_mreq_itr_rlocs (vnet_lisp_add_del_mreq_itr_rloc_args_t * a) { lisp_cp_main_t * lcm = vnet_lisp_cp_get_main(); uword * p = 0; if (vnet_lisp_enable_disable_status () == 0) { clib_warning("LISP is disabled!"); return VNET_API_ERROR_LISP_DISABLED; } if (a->is_add) { p = hash_get_mem(lcm->locator_set_index_by_name, a->locator_set_name); if (!p) { clib_warning("locator-set %v doesn't exist", a->locator_set_name); return VNET_API_ERROR_INVALID_ARGUMENT; } lcm->mreq_itr_rlocs = p[0]; } else { lcm->mreq_itr_rlocs = ~0; } return 0; } static clib_error_t * lisp_add_del_mreq_itr_rlocs_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { unformat_input_t _line_input, * line_input = &_line_input; u8 is_add = 1; u8 * locator_set_name = 0; clib_error_t * error = 0; int rv = 0; vnet_lisp_add_del_mreq_itr_rloc_args_t _a, * a = &_a; /* Get a line of input. */ if (! unformat_user (input, unformat_line_input, line_input)) return 0; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { if (unformat (line_input, "del")) is_add = 0; else if (unformat (line_input, "add %s", &locator_set_name)) is_add = 1; else { error = unformat_parse_error(line_input); goto done; } } a->is_add = is_add; a->locator_set_name = locator_set_name; rv = vnet_lisp_add_del_mreq_itr_rlocs (a); if (0 != rv) { error = clib_error_return(0, "failed to %s map-request itr-rlocs!", is_add ? "add" : "delete"); } vec_free(locator_set_name); done: return error; } VLIB_CLI_COMMAND (lisp_add_del_map_request_command) = { .path = "lisp map-request itr-rlocs", .short_help = "lisp map-request itr-rlocs add/del <locator_set_name>", .function = lisp_add_del_mreq_itr_rlocs_command_fn, }; static clib_error_t * lisp_show_mreq_itr_rlocs_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { lisp_cp_main_t * lcm = vnet_lisp_cp_get_main(); locator_set_t * loc_set; vlib_cli_output (vm, "%=20s", "itr-rlocs"); if (~0 == lcm->mreq_itr_rlocs) { return 0; } loc_set = pool_elt_at_index (lcm->locator_set_pool, lcm->mreq_itr_rlocs); vlib_cli_output (vm, "%=20s", loc_set->name); return 0; } VLIB_CLI_COMMAND (lisp_show_map_request_command) = { .path = "show lisp map-request itr-rlocs", .short_help = "Shows map-request itr-rlocs", .function = lisp_show_mreq_itr_rlocs_command_fn, }; /* Statistics (not really errors) */ #define foreach_lisp_cp_lookup_error \ _(DROP, "drop") \ _(MAP_REQUESTS_SENT, "map-request sent") static char * lisp_cp_lookup_error_strings[] = { #define _(sym,string) string, foreach_lisp_cp_lookup_error #undef _ }; typedef enum { #define _(sym,str) LISP_CP_LOOKUP_ERROR_##sym, foreach_lisp_cp_lookup_error #undef _ LISP_CP_LOOKUP_N_ERROR, } lisp_cp_lookup_error_t; typedef enum { LISP_CP_LOOKUP_NEXT_DROP, LISP_CP_LOOKUP_NEXT_IP4_LOOKUP, LISP_CP_LOOKUP_NEXT_IP6_LOOKUP, LISP_CP_LOOKUP_N_NEXT, } lisp_cp_lookup_next_t; typedef struct { gid_address_t dst_eid; ip_address_t map_resolver_ip; } lisp_cp_lookup_trace_t; u8 * format_lisp_cp_lookup_trace (u8 * s, va_list * args) { CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *); CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *); lisp_cp_lookup_trace_t * t = va_arg (*args, lisp_cp_lookup_trace_t *); s = format (s, "LISP-CP-LOOKUP: map-resolver: %U destination eid %U", format_ip_address, &t->map_resolver_ip, format_gid_address, &t->dst_eid); return s; } int get_mr_and_local_iface_ip (lisp_cp_main_t * lcm, ip_address_t * mr_ip, ip_address_t * sloc) { ip_address_t * mrit; if (vec_len(lcm->map_resolvers) == 0) { clib_warning("No map-resolver configured"); return 0; } /* find the first mr ip we have a route to and the ip of the * iface that has a route to it */ vec_foreach(mrit, lcm->map_resolvers) { if (0 != ip_fib_get_first_egress_ip_for_dst (lcm, mrit, sloc)) { ip_address_copy(mr_ip, mrit); return 1; } } clib_warning("Can't find map-resolver and local interface ip!"); return 0; } static gid_address_t * build_itr_rloc_list (lisp_cp_main_t * lcm, locator_set_t * loc_set) { void * addr; u32 i; locator_t * loc; u32 * loc_indexp; ip_interface_address_t * ia = 0; gid_address_t gid_data, * gid = &gid_data; gid_address_t * rlocs = 0; ip_prefix_t * ippref = &gid_address_ippref (gid); ip_address_t * rloc = &ip_prefix_addr (ippref); memset (gid, 0, sizeof (gid[0])); gid_address_type (gid) = GID_ADDR_IP_PREFIX; for (i = 0; i < vec_len(loc_set->locator_indices); i++) { loc_indexp = vec_elt_at_index(loc_set->locator_indices, i); loc = pool_elt_at_index (lcm->locator_pool, loc_indexp[0]); /* Add ipv4 locators first TODO sort them */ foreach_ip_interface_address (&lcm->im4->lookup_main, ia, loc->sw_if_index, 1 /* unnumbered */, ({ addr = ip_interface_address_get_address (&lcm->im4->lookup_main, ia); ip_address_set (rloc, addr, IP4); ip_prefix_len (ippref) = 32; vec_add1 (rlocs, gid[0]); })); /* Add ipv6 locators */ foreach_ip_interface_address (&lcm->im6->lookup_main, ia, loc->sw_if_index, 1 /* unnumbered */, ({ addr = ip_interface_address_get_address (&lcm->im6->lookup_main, ia); ip_address_set (rloc, addr, IP6); ip_prefix_len (ippref) = 128; vec_add1 (rlocs, gid[0]); })); } return rlocs; } static vlib_buffer_t * build_encapsulated_map_request (vlib_main_t * vm, lisp_cp_main_t *lcm, gid_address_t * seid, gid_address_t * deid, locator_set_t * loc_set, ip_address_t * mr_ip, ip_address_t * sloc, u8 is_smr_invoked, u64 *nonce_res, u32 * bi_res) { vlib_buffer_t * b; u32 bi; gid_address_t * rlocs = 0; if (vlib_buffer_alloc (vm, &bi, 1) != 1) { clib_warning ("Can't allocate buffer for Map-Request!"); return 0; } b = vlib_get_buffer (vm, bi); /* leave some space for the encap headers */ vlib_buffer_make_headroom (b, MAX_LISP_MSG_ENCAP_LEN); /* get rlocs */ rlocs = build_itr_rloc_list (lcm, loc_set); /* put lisp msg */ lisp_msg_put_mreq (lcm, b, seid, deid, rlocs, is_smr_invoked, nonce_res); /* push ecm: udp-ip-lisp */ lisp_msg_push_ecm (vm, b, LISP_CONTROL_PORT, LISP_CONTROL_PORT, seid, deid); /* push outer ip header */ pkt_push_udp_and_ip (vm, b, LISP_CONTROL_PORT, LISP_CONTROL_PORT, sloc, mr_ip); bi_res[0] = bi; vec_free(rlocs); return b; } static void send_encapsulated_map_request (vlib_main_t * vm, lisp_cp_main_t *lcm, gid_address_t * seid, gid_address_t * deid, u8 is_smr_invoked) { u32 next_index, bi = 0, * to_next, map_index; vlib_buffer_t * b; vlib_frame_t * f; u64 nonce = 0; locator_set_t * loc_set; mapping_t * map; pending_map_request_t * pmr; ip_address_t mr_ip, sloc; u32 ls_index; /* get locator-set for seid */ if (!lcm->lisp_pitr) { map_index = gid_dictionary_lookup (&lcm->mapping_index_by_gid, seid); if (map_index == ~0) { clib_warning("No local mapping found in eid-table for %U!", format_gid_address, seid); return; } map = pool_elt_at_index (lcm->mapping_pool, map_index); if (!map->local) { clib_warning("Mapping found for src eid %U is not marked as local!", format_gid_address, seid); return; } ls_index = map->locator_set_index; } else { map_index = lcm->pitr_map_index; map = pool_elt_at_index (lcm->mapping_pool, lcm->pitr_map_index); ls_index = map->locator_set_index; } /* overwrite locator set if map-request itr-rlocs configured */ if (~0 != lcm->mreq_itr_rlocs) { ls_index = lcm->mreq_itr_rlocs; } loc_set = pool_elt_at_index (lcm->locator_set_pool, ls_index); /* get local iface ip to use in map-request */ if (0 == get_mr_and_local_iface_ip (lcm, &mr_ip, &sloc)) return; /* build the encapsulated map request */ b = build_encapsulated_map_request (vm, lcm, seid, deid, loc_set, &mr_ip, &sloc, is_smr_invoked, &nonce, &bi); if (!b) return; /* set fib index to default and lookup node */ vnet_buffer(b)->sw_if_index[VLIB_TX] = 0; next_index = (ip_addr_version(&mr_ip) == IP4) ? ip4_lookup_node.index : ip6_lookup_node.index; f = vlib_get_frame_to_node (vm, next_index); /* Enqueue the packet */ to_next = vlib_frame_vector_args (f); to_next[0] = bi; f->n_vectors = 1; vlib_put_frame_to_node (vm, next_index, f); /* add map-request to pending requests table */ pool_get(lcm->pending_map_requests_pool, pmr); gid_address_copy (&pmr->src, seid); gid_address_copy (&pmr->dst, deid); hash_set(lcm->pending_map_requests_by_nonce, nonce, pmr - lcm->pending_map_requests_pool); } static void get_src_and_dst (void *hdr, ip_address_t * src, ip_address_t *dst) { ip4_header_t * ip4 = hdr; ip6_header_t * ip6; if ((ip4->ip_version_and_header_length & 0xF0) == 0x40) { ip_address_set(src, &ip4->src_address, IP4); ip_address_set(dst, &ip4->dst_address, IP4); } else { ip6 = hdr; ip_address_set(src, &ip6->src_address, IP6); ip_address_set(dst, &ip6->dst_address, IP6); } } static u32 lisp_get_vni_from_buffer (vlib_buffer_t * b, u8 version) { uword * vnip; u32 vni = ~0, table_id = ~0, fib_index; lisp_cp_main_t * lcm = vnet_lisp_cp_get_main (); if (version == IP4) { ip4_fib_t * fib; ip4_main_t * im4 = &ip4_main; fib_index = vec_elt (im4->fib_index_by_sw_if_index, vnet_buffer (b)->sw_if_index[VLIB_RX]); fib = find_ip4_fib_by_table_index_or_id (im4, fib_index, IP4_ROUTE_FLAG_FIB_INDEX); table_id = fib->table_id; } else { ip6_fib_t * fib; ip6_main_t * im6 = &ip6_main; fib_index = vec_elt (im6->fib_index_by_sw_if_index, vnet_buffer (b)->sw_if_index[VLIB_RX]); fib = find_ip6_fib_by_table_index_or_id (im6, fib_index, IP6_ROUTE_FLAG_FIB_INDEX); table_id = fib->table_id; } vnip = hash_get (lcm->vni_by_table_id, table_id); if (vnip) vni = vnip[0]; else clib_warning ("vrf %d is not mapped to any vni!", table_id); return vni; } static uword lisp_cp_lookup (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * from_frame) { u32 * from, * to_next_drop, di, si; lisp_cp_main_t *lcm = vnet_lisp_cp_get_main(); u32 pkts_mapped = 0; uword n_left_from, n_left_to_next_drop; from = vlib_frame_vector_args (from_frame); n_left_from = from_frame->n_vectors; while (n_left_from > 0) { vlib_get_next_frame (vm, node, LISP_CP_LOOKUP_NEXT_DROP, to_next_drop, n_left_to_next_drop); while (n_left_from > 0 && n_left_to_next_drop > 0) { u32 pi0, vni; vlib_buffer_t * p0; ip4_header_t * ip0; gid_address_t src, dst; ip_prefix_t * spref, * dpref; gid_address_type (&src) = GID_ADDR_IP_PREFIX; spref = &gid_address_ippref(&src); gid_address_type (&dst) = GID_ADDR_IP_PREFIX; dpref = &gid_address_ippref(&dst); pi0 = from[0]; from += 1; n_left_from -= 1; to_next_drop[0] = pi0; to_next_drop += 1; n_left_to_next_drop -= 1; p0 = vlib_get_buffer (vm, pi0); p0->error = node->errors[LISP_CP_LOOKUP_ERROR_DROP]; /* src/dst eid pair */ ip0 = vlib_buffer_get_current (p0); get_src_and_dst (ip0, &ip_prefix_addr(spref), &ip_prefix_addr(dpref)); ip_prefix_len(spref) = ip_address_max_len (ip_prefix_version(spref)); ip_prefix_len(dpref) = ip_address_max_len (ip_prefix_version(dpref)); vni = lisp_get_vni_from_buffer (p0, ip_prefix_version (spref)); gid_address_vni (&dst) = vni; gid_address_vni (&src) = vni; /* if we have remote mapping for destination already in map-chache add forwarding tunnel directly. If not send a map-request */ di = gid_dictionary_lookup (&lcm->mapping_index_by_gid, &dst); if (~0 != di) { mapping_t * m = vec_elt_at_index (lcm->mapping_pool, di); /* send a map-request also in case of negative mapping entry with corresponding action */ if (m->action == ACTION_SEND_MAP_REQUEST) { /* send map-request */ send_encapsulated_map_request (vm, lcm, &src, &dst, 0); pkts_mapped++; } else { si = gid_dictionary_lookup (&lcm->mapping_index_by_gid, &src); if (~0 != si) { dp_add_fwd_entry (lcm, si, di); } } } else { /* send map-request */ send_encapsulated_map_request (vm, lcm, &src, &dst, 0); pkts_mapped++; } if (PREDICT_FALSE(p0->flags & VLIB_BUFFER_IS_TRACED)) { lisp_cp_lookup_trace_t *tr = vlib_add_trace (vm, node, p0, sizeof(*tr)); memset(tr, 0, sizeof(*tr)); gid_address_copy (&tr->dst_eid, &dst); if (vec_len(lcm->map_resolvers) > 0) { clib_memcpy (&tr->map_resolver_ip, vec_elt_at_index(lcm->map_resolvers, 0), sizeof(ip_address_t)); } } gid_address_free (&dst); gid_address_free (&src); } vlib_put_next_frame (vm, node, LISP_CP_LOOKUP_NEXT_DROP, n_left_to_next_drop); } vlib_node_increment_counter (vm, node->node_index, LISP_CP_LOOKUP_ERROR_MAP_REQUESTS_SENT, pkts_mapped); return from_frame->n_vectors; } VLIB_REGISTER_NODE (lisp_cp_lookup_node) = { .function = lisp_cp_lookup, .name = "lisp-cp-lookup", .vector_size = sizeof (u32), .format_trace = format_lisp_cp_lookup_trace, .type = VLIB_NODE_TYPE_INTERNAL, .n_errors = LISP_CP_LOOKUP_N_ERROR, .error_strings = lisp_cp_lookup_error_strings, .n_next_nodes = LISP_CP_LOOKUP_N_NEXT, .next_nodes = { [LISP_CP_LOOKUP_NEXT_DROP] = "error-drop", [LISP_CP_LOOKUP_NEXT_IP4_LOOKUP] = "ip4-lookup", [LISP_CP_LOOKUP_NEXT_IP6_LOOKUP] = "ip6-lookup", }, }; /* lisp_cp_input statistics */ #define foreach_lisp_cp_input_error \ _(DROP, "drop") \ _(MAP_REPLIES_RECEIVED, "map-replies received") static char * lisp_cp_input_error_strings[] = { #define _(sym,string) string, foreach_lisp_cp_input_error #undef _ }; typedef enum { #define _(sym,str) LISP_CP_INPUT_ERROR_##sym, foreach_lisp_cp_input_error #undef _ LISP_CP_INPUT_N_ERROR, } lisp_cp_input_error_t; typedef enum { LISP_CP_INPUT_NEXT_DROP, LISP_CP_INPUT_N_NEXT, } lisp_cp_input_next_t; typedef struct { gid_address_t dst_eid; ip4_address_t map_resolver_ip; } lisp_cp_input_trace_t; u8 * format_lisp_cp_input_trace (u8 * s, va_list * args) { CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *); CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *); CLIB_UNUSED(lisp_cp_input_trace_t * t) = va_arg (*args, lisp_cp_input_trace_t *); s = format (s, "LISP-CP-INPUT: TODO"); return s; } void process_map_reply (lisp_cp_main_t * lcm, vlib_buffer_t * b) { u32 len = 0, i, ttl, dst_map_index = 0; void * h; pending_map_request_t * pmr; locator_t probed; map_reply_hdr_t * mrep_hdr; u64 nonce; gid_address_t deid; uword * pmr_index; u8 authoritative, action; locator_t * locators = 0, * loc; mrep_hdr = vlib_buffer_get_current (b); /* Check pending requests table and nonce */ nonce = MREP_NONCE(mrep_hdr); pmr_index = hash_get(lcm->pending_map_requests_by_nonce, nonce); if (!pmr_index) { clib_warning("No pending map-request entry with nonce %lu!", nonce); return; } pmr = pool_elt_at_index(lcm->pending_map_requests_pool, pmr_index[0]); vlib_buffer_pull (b, sizeof(*mrep_hdr)); for (i = 0; i < MREP_REC_COUNT(mrep_hdr); i++) { h = vlib_buffer_get_current (b); ttl = clib_net_to_host_u32 (MAP_REC_TTL(h)); action = MAP_REC_ACTION(h); authoritative = MAP_REC_AUTH(h); len = lisp_msg_parse_mapping_record (b, &deid, &locators, &probed); if (len == ~0) { clib_warning ("Failed to parse mapping record!"); vec_foreach (loc, locators) { locator_free (loc); } vec_free(locators); return; } /* insert/update mappings cache */ vnet_lisp_add_del_mapping (&deid, locators, action, authoritative, ttl, 1, &dst_map_index); /* try to program forwarding only if mapping saved or updated*/ if ((u32) ~0 != dst_map_index) lisp_add_del_adjacency (lcm, &pmr->src, &deid, 1); vec_free(locators); } /* remove pending map request entry */ hash_unset(lcm->pending_map_requests_by_nonce, nonce); pool_put(lcm->pending_map_requests_pool, pmr); } void process_map_request (vlib_main_t * vm, lisp_cp_main_t * lcm, vlib_buffer_t * b) { map_request_hdr_t * mreq_hdr; gid_address_t src, dst; // u64 nonce; u32 i, len = 0; gid_address_t * itr_rlocs = 0, * rloc; mreq_hdr = vlib_buffer_get_current (b); vlib_buffer_pull (b, sizeof(*mreq_hdr)); // nonce = MREQ_NONCE(mreq_hdr); if (!MREQ_SMR(mreq_hdr)) { clib_warning("Only SMR Map-Requests supported for now!"); return; } /* parse src eid */ len = lisp_msg_parse_addr (b, &src); if (len == ~0) return; /* for now we don't do anything with the itr's rlocs */ len = lisp_msg_parse_itr_rlocs (b, &itr_rlocs, MREQ_ITR_RLOC_COUNT(mreq_hdr) + 1); if (len == ~0) return; /* TODO: RLOCs are currently unused, so free them for now */ vec_foreach (rloc, itr_rlocs) { gid_address_free (rloc); } /* parse eid records and send SMR-invoked map-requests */ for (i = 0; i < MREQ_REC_COUNT(mreq_hdr); i++) { memset(&dst, 0, sizeof(dst)); len = lisp_msg_parse_eid_rec (b, &dst); if (len == ~0) { clib_warning("Can't parse map-request EID-record"); return; } /* send SMR-invoked map-requests */ send_encapsulated_map_request (vm, lcm, &dst, &src, /* invoked */ 1); } } static uword lisp_cp_input (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * from_frame) { u32 n_left_from, * from, * to_next_drop; lisp_msg_type_e type; lisp_cp_main_t * lcm = vnet_lisp_cp_get_main(); from = vlib_frame_vector_args (from_frame); n_left_from = from_frame->n_vectors; while (n_left_from > 0) { u32 n_left_to_next_drop; vlib_get_next_frame (vm, node, LISP_CP_INPUT_NEXT_DROP, to_next_drop, n_left_to_next_drop); while (n_left_from > 0 && n_left_to_next_drop > 0) { u32 bi0; vlib_buffer_t * b0; bi0 = from[0]; from += 1; n_left_from -= 1; to_next_drop[0] = bi0; to_next_drop += 1; n_left_to_next_drop -= 1; b0 = vlib_get_buffer (vm, bi0); type = lisp_msg_type(vlib_buffer_get_current (b0)); switch (type) { case LISP_MAP_REPLY: process_map_reply (lcm, b0); break; case LISP_MAP_REQUEST: process_map_request(vm, lcm, b0); break; default: clib_warning("Unsupported LISP message type %d", type); break; } b0->error = node->errors[LISP_CP_INPUT_ERROR_DROP]; if (PREDICT_FALSE(b0->flags & VLIB_BUFFER_IS_TRACED)) { } } vlib_put_next_frame (vm, node, LISP_CP_INPUT_NEXT_DROP, n_left_to_next_drop); } return from_frame->n_vectors; } VLIB_REGISTER_NODE (lisp_cp_input_node) = { .function = lisp_cp_input, .name = "lisp-cp-input", .vector_size = sizeof (u32), .format_trace = format_lisp_cp_input_trace, .type = VLIB_NODE_TYPE_INTERNAL, .n_errors = LISP_CP_INPUT_N_ERROR, .error_strings = lisp_cp_input_error_strings, .n_next_nodes = LISP_CP_INPUT_N_NEXT, .next_nodes = { [LISP_CP_INPUT_NEXT_DROP] = "error-drop", }, }; clib_error_t * lisp_cp_init (vlib_main_t *vm) { lisp_cp_main_t * lcm = vnet_lisp_cp_get_main(); clib_error_t * error = 0; if ((error = vlib_call_init_function (vm, lisp_gpe_init))) return error; lcm->im4 = &ip4_main; lcm->im6 = &ip6_main; lcm->vlib_main = vm; lcm->vnet_main = vnet_get_main(); lcm->mreq_itr_rlocs = ~0; lcm->lisp_pitr = 0; gid_dictionary_init (&lcm->mapping_index_by_gid); /* default vrf mapped to vni 0 */ hash_set(lcm->table_id_by_vni, 0, 0); hash_set(lcm->vni_by_table_id, 0, 0); udp_register_dst_port (vm, UDP_DST_PORT_lisp_cp, lisp_cp_input_node.index, 1 /* is_ip4 */); udp_register_dst_port (vm, UDP_DST_PORT_lisp_cp6, lisp_cp_input_node.index, 0 /* is_ip4 */); return 0; } VLIB_INIT_FUNCTION(lisp_cp_init);
28.387748
84
0.593408
5eddbdd86ce72b6efb386246ff50ef8a8ea757c7
5,789
h
C
parallel/benchmarks/parallel-matching/utils/List.h
sualehasif/maximum-matching
bf1b5cddcef3fcdbde6cfee73f3d99268101cf5b
[ "MIT" ]
null
null
null
parallel/benchmarks/parallel-matching/utils/List.h
sualehasif/maximum-matching
bf1b5cddcef3fcdbde6cfee73f3d99268101cf5b
[ "MIT" ]
null
null
null
parallel/benchmarks/parallel-matching/utils/List.h
sualehasif/maximum-matching
bf1b5cddcef3fcdbde6cfee73f3d99268101cf5b
[ "MIT" ]
null
null
null
// // Created by sualehasif on 5/16/21. // #ifndef MAXIMUM_MATCHING_LIST_H #define MAXIMUM_MATCHING_LIST_H namespace maxmatching { template<class T> class List; /* Basic implementation of elements in a doubly connected list */ template<class T> class ListElement { public: List<T> *containingList; ListElement<T> *prvElem; ListElement<T> *nxtElem; T *value; ListElement(); explicit ListElement(T *value); ~ListElement(); void deleteFull(); }; template<class T> ListElement<T>::ListElement() : containingList(nullptr), prvElem(nullptr), nxtElem(nullptr), value(nullptr) {} template<class T> ListElement<T>::ListElement(T *value) : containingList(nullptr), prvElem(nullptr), nxtElem(nullptr), value(value) {} template<class T> ListElement<T>::~ListElement() { if (this->containingList != nullptr) { this->containingList->remove(this); } } template<class T> void ListElement<T>::deleteFull() { delete (this->value); delete (this); } template<class T> class List { private: ListElement<T> *firstElem; ListElement<T> *lastElem; unsigned int size; public: List(); ~List(); void push(T *elem); void push(ListElement<T> *elem); void append(T *elem); void append(ListElement<T> *elem); T *pop(); ListElement<T> *popElem(); void remove(ListElement<T> *elem); void clear(); void deleteStructure(); void deleteFull(); ListElement<T> *getFirstElement(); ListElement<T> *getLastElement(); unsigned int getSize(); bool isEmpty(); }; template<class T> List<T>::List() : firstElem(nullptr), lastElem(nullptr), size(0) {} template<class T> List<T>::~List() { while (this->firstElem != nullptr) { this->popElem(); } } template<class T> void List<T>::push(T *elem) { auto *le = new ListElement<T>(elem); this->push(le); } template<class T> void List<T>::push(ListElement<T> *elem) { elem->containingList = this; elem->prvElem = nullptr; elem->nxtElem = this->firstElem; if (this->firstElem != nullptr) { this->firstElem->prvElem = elem; } else { this->lastElem = elem; } this->firstElem = elem; this->size++; } template<class T> void List<T>::append(T *elem) { auto *le = new ListElement<T>(elem); this->append(le); } template<class T> void List<T>::append(ListElement<T> *elem) { elem->containingList = this; elem->prvElem = this->lastElem; elem->nxtElem = nullptr; if (this->lastElem != nullptr) { this->lastElem->nxtElem = elem; } else { this->firstElem = elem; } this->lastElem = elem; this->size++; } template<class T> T *List<T>::pop() { ListElement<T> *buffer = this->popElem(); if (buffer == nullptr) { return nullptr; } else { T *ret = buffer->value; delete (buffer); return ret; } } template<class T> ListElement<T> *List<T>::popElem() { if (this->firstElem == nullptr) { return nullptr; } else { ListElement<T> *ret = this->firstElem; this->firstElem = ret->nxtElem; if (this->firstElem != nullptr) { this->firstElem->prvElem = nullptr; } if (this->lastElem == ret) { this->lastElem = nullptr; } ret->containingList = nullptr; ret->nxtElem = nullptr; this->size--; return ret; } } template<class T> void List<T>::remove(ListElement<T> *elem) { if (elem->containingList != this) { return; } if (elem->prvElem != nullptr) { elem->prvElem->nxtElem = elem->nxtElem; } else if (elem == this->firstElem) { this->firstElem = elem->nxtElem; } if (elem->nxtElem != nullptr) { elem->nxtElem->prvElem = elem->prvElem; } else if (elem == this->lastElem) { this->lastElem = elem->prvElem; } elem->containingList = nullptr; elem->nxtElem = elem->prvElem = nullptr; this->size--; } template<class T> void List<T>::clear() { while (this->size > 0) { (void) this->popElem(); } } template<class T> void List<T>::deleteStructure() { ListElement<T> *iter = this->firstElem; while (iter != nullptr) { ListElement<T> *buffer = iter->nxtElem; delete (iter); iter = buffer; } delete (this); } template<class T> void List<T>::deleteFull() { ListElement<T> *iter = this->firstElem; while (iter != nullptr) { ListElement<T> *buffer = iter->nxtElem; iter->deleteFull(); iter = buffer; } delete (this); } template<class T> ListElement<T> *List<T>::getFirstElement() { return this->firstElem; } template<class T> ListElement<T> *List<T>::getLastElement() { return this->lastElem; } template<class T> unsigned int List<T>::getSize() { return this->size; } template<class T> bool List<T>::isEmpty() { return this->size == 0; } } #endif //MAXIMUM_MATCHING_LIST_H
23.248996
92
0.519433
95a673f057de75cdeb6b20e00f7c6977aa5ce875
5,394
c
C
src/modules/sysinfo.c
technosaurus/donky
56819f591ebca5dadc7d1740161a723fe4cef0e1
[ "CC0-1.0" ]
1
2022-01-13T20:15:55.000Z
2022-01-13T20:15:55.000Z
src/modules/sysinfo.c
technosaurus/donky
56819f591ebca5dadc7d1740161a723fe4cef0e1
[ "CC0-1.0" ]
null
null
null
src/modules/sysinfo.c
technosaurus/donky
56819f591ebca5dadc7d1740161a723fe4cef0e1
[ "CC0-1.0" ]
null
null
null
/** * The CC0 1.0 Universal is applied to this work. * * To the extent possible under law, Matt Hayes and Jake LeMaster have * waived all copyright and related or neighboring rights to donky. * This work is published from the United States. * * Please see the copy of the CC0 included with this program for complete * information including limitations and disclaimers. If no such copy * exists, see <http://creativecommons.org/publicdomain/zero/1.0/legalcode>. */ #include <stdio.h> #include <sys/sysinfo.h> #include "../mem.h" #include "../module.h" #include "../util.h" char module_name[] = "sysinfo"; /* Up to 63 characters, any more and it will be truncated! Doesn't matter though, just needs to be a some-what unique name. */ /* Globals. */ static char *ret = NULL; static struct sysinfo info; /** * @brief This is run on module initialization. */ void module_init(struct module *mod) { module_var_add(mod, "uptime", "get_uptime", 1.0, VARIABLE_STR); module_var_add(mod, "loadavg", "get_loadavg", 30.0, VARIABLE_STR); module_var_add(mod, "totalram", "get_totalram", 0.0, VARIABLE_STR); module_var_add(mod, "freeram", "get_freeram", 15.0, VARIABLE_STR); module_var_add(mod, "usedram", "get_usedram", 15.0, VARIABLE_STR); module_var_add(mod, "sharedram", "get_sharedram", 15.0, VARIABLE_STR); module_var_add(mod, "bufferram", "get_bufferram", 15.0, VARIABLE_STR); module_var_add(mod, "totalswap", "get_totalswap", 0.0, VARIABLE_STR); module_var_add(mod, "freeswap", "get_freeswap", 15.0, VARIABLE_STR); module_var_add(mod, "usedswap", "get_usedswap", 15.0, VARIABLE_STR); module_var_add(mod, "procs", "get_procs", 10.0, VARIABLE_STR); module_var_add(mod, "totalhigh", "get_totalhigh", 0.0, VARIABLE_STR); module_var_add(mod, "freehigh", "get_freehigh", 15.0, VARIABLE_STR); module_var_add(mod, "usedhigh", "get_usedhigh", 15.0, VARIABLE_STR); } /** * @brief This is run when the module is about to be unloaded. */ void module_destroy(void) { } char *get_uptime(void) { unsigned long cur_up; int days, hours, mins, secs; cur_up = info.uptime; days = cur_up / 86400; cur_up -= days * 86400; hours = cur_up / 3600; cur_up -= hours * 3600; mins = cur_up / 60; cur_up -= mins * 60; secs = cur_up; if (sysinfo(&info) == -1) return "n/a"; ret = m_malloc(32 * sizeof(char)); snprintf(ret, 32, "%d day%s, %02d:%02d:%02d", days, (days != 1) ? "s" : "", hours, mins, secs); return ret; } char *get_loadavg(void) { float load0, load1, load2; if (sysinfo(&info) == -1) return "n/a"; load0 = info.loads[0] / 65536.0; load1 = info.loads[1] / 65536.0; load2 = info.loads[2] / 65536.0; ret = m_malloc(32 * sizeof(char)); snprintf(ret, 32, "%2.2f, %2.2f, %2.2f", load0, load1, load2); return ret; } char *get_totalram(void) { if (sysinfo(&info) == -1) return "n/a"; return m_freelater(bytes_to_bigger(info.totalram * info.mem_unit)); } char *get_freeram(void) { if (sysinfo(&info) == -1) return "n/a"; return m_freelater(bytes_to_bigger(info.freeram * info.mem_unit)); } char *get_usedram(void) { if (sysinfo(&info) == -1) return "n/a"; return m_freelater(bytes_to_bigger((info.totalram - info.freeram) * info.mem_unit)); } char *get_sharedram(void) { if (sysinfo(&info) == -1) return "n/a"; return m_freelater(bytes_to_bigger(info.sharedram * info.mem_unit)); } char *get_bufferram(char *args) { if (sysinfo(&info) == -1) return "n/a"; return m_freelater(bytes_to_bigger(info.bufferram * info.mem_unit)); } char *get_totalswap(void) { if (sysinfo(&info) == -1) return "n/a"; return m_freelater(bytes_to_bigger(info.totalswap * info.mem_unit)); } char *get_freeswap(void) { if (sysinfo(&info) == -1) return "n/a"; return m_freelater(bytes_to_bigger(info.freeswap * info.mem_unit)); } char *get_usedswap(void) { if (sysinfo(&info) == -1) return "n/a"; return m_freelater(bytes_to_bigger((info.totalswap - info.freeswap) * info.mem_unit)); } char *get_procs(void) { if (sysinfo(&info) == -1) return "n/a"; ret = m_malloc(8 * sizeof(char)); snprintf(ret, 8, "%d", info.procs); return ret; } char *get_totalhigh(void) { if (sysinfo(&info) == -1) return "n/a"; return m_freelater(bytes_to_bigger(info.totalhigh * info.mem_unit)); } char *get_freehigh(void) { if (sysinfo(&info) == -1) return "n/a"; return m_freelater(bytes_to_bigger(info.freehigh * info.mem_unit)); } char *get_usedhigh(void) { if (sysinfo(&info) == -1) return "n/a"; return m_freelater(bytes_to_bigger((info.totalhigh - info.freehigh) * info.mem_unit)); }
26.835821
94
0.577494
c7e11e268c3250be5c1e8be98fe157e958aa033e
9,323
c
C
sdk-6.5.20/libs/sdklt/bcmlrd/chip/bcm56880_a0/bcm56880_a0_lrd_dlb_control_map.c
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
sdk-6.5.20/libs/sdklt/bcmlrd/chip/bcm56880_a0/bcm56880_a0_lrd_dlb_control_map.c
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
sdk-6.5.20/libs/sdklt/bcmlrd/chip/bcm56880_a0/bcm56880_a0_lrd_dlb_control_map.c
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
/******************************************************************************* * * DO NOT EDIT THIS FILE! * This file is auto-generated by fltg from * INTERNAL/fltg/xgs/dlb/bcm56880_a0/bcm56880_a0_DLB_CONTROL.map.ltl for * bcm56880_a0 * * Tool: $SDK/INTERNAL/fltg/bin/fltg * * Edits to this file will be lost when it is regenerated. * * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. * * Copyright 2007-2020 Broadcom Inc. All rights reserved. */ #include <bcmlrd/bcmlrd_internal.h> #include <bcmlrd/chip/bcmlrd_id.h> #include <bcmlrd/chip/bcm56880_a0/bcm56880_a0_lrd_field_data.h> #include <bcmlrd/chip/bcm56880_a0/bcm56880_a0_lrd_ltm_intf.h> #include <bcmlrd/chip/bcm56880_a0/bcm56880_a0_lrd_xfrm_field_desc.h> #include <bcmdrd/chip/bcm56880_a0_enum.h> #include "bcmltd/chip/bcmltd_common_enumpool.h" #include "bcm56880_a0_lrd_enumpool.h" /* DLB_CONTROL field init */ static const bcmlrd_field_data_t bcm56880_a0_lrd_dlb_control_map_field_data_mmd[] = { { /* 0 SAMPLING_PERIOD */ .flags = 0, .min = &bcm56880_a0_lrd_ifd_u32_0x0, .def = &bcm56880_a0_lrd_ifd_u32_0x0, .max = &bcm56880_a0_lrd_ifd_u32_0xff, .depth = 0, .width = 8, .edata = NULL, }, { /* 1 PORT_LOAD_WEIGHT */ .flags = 0, .min = &bcm56880_a0_lrd_ifd_u8_0x0, .def = &bcm56880_a0_lrd_ifd_u8_0x0, .max = &bcm56880_a0_lrd_ifd_u8_0xf, .depth = 0, .width = 4, .edata = NULL, }, { /* 2 PORT_QUEUE_SIZE_WEIGHT */ .flags = 0, .min = &bcm56880_a0_lrd_ifd_u8_0x0, .def = &bcm56880_a0_lrd_ifd_u8_0x0, .max = &bcm56880_a0_lrd_ifd_u8_0xf, .depth = 0, .width = 4, .edata = NULL, }, { /* 3 TM_QUEUE_SIZE_WEIGHT */ .flags = 0, .min = &bcm56880_a0_lrd_ifd_u8_0x0, .def = &bcm56880_a0_lrd_ifd_u8_0x0, .max = &bcm56880_a0_lrd_ifd_u8_0xf, .depth = 0, .width = 4, .edata = NULL, }, { /* 4 CAP_PORT_LOAD */ .flags = 0, .min = &bcm56880_a0_lrd_ifd_is_true_0x0, .def = &bcm56880_a0_lrd_ifd_is_true_0x0, .max = &bcm56880_a0_lrd_ifd_is_true_0x1, .depth = 0, .width = 1, .edata = NULL, }, { /* 5 CAP_PORT_QUEUE_SIZE */ .flags = 0, .min = &bcm56880_a0_lrd_ifd_is_true_0x0, .def = &bcm56880_a0_lrd_ifd_is_true_0x0, .max = &bcm56880_a0_lrd_ifd_is_true_0x1, .depth = 0, .width = 1, .edata = NULL, }, { /* 6 CAP_TM_QUEUE_SIZE */ .flags = 0, .min = &bcm56880_a0_lrd_ifd_is_true_0x0, .def = &bcm56880_a0_lrd_ifd_is_true_0x0, .max = &bcm56880_a0_lrd_ifd_is_true_0x1, .depth = 0, .width = 1, .edata = NULL, }, { /* 7 ETHERTYPE_ELIGIBILITY */ .flags = BCMLRD_FIELD_F_UNMAPPED, .min = &bcm56880_a0_lrd_ifd_is_true_0x0, .def = &bcm56880_a0_lrd_ifd_is_true_0x0, .max = &bcm56880_a0_lrd_ifd_is_true_0x0, .depth = 0, .width = 0, .edata = NULL, }, { /* 8 LB_HASH_USE_FLOW_DLB_ECMP */ .flags = BCMLRD_FIELD_F_UNMAPPED, .min = &bcm56880_a0_lrd_ifd_is_true_0x0, .def = &bcm56880_a0_lrd_ifd_is_true_0x0, .max = &bcm56880_a0_lrd_ifd_is_true_0x0, .depth = 0, .width = 0, .edata = NULL, }, }; const bcmlrd_map_field_data_t bcm56880_a0_lrd_dlb_control_map_field_data = { .fields = 9, .field = bcm56880_a0_lrd_dlb_control_map_field_data_mmd }; static const bcmlrd_map_table_attr_t bcm56880_a0_lrd_dlb_controlt_attr_entry[] = { { /* 0 */ .key = BCMLRD_MAP_TABLE_ATTRIBUTE_INTERACTIVE, .value = FALSE, }, }; static const bcmlrd_map_attr_t bcm56880_a0_lrd_dlb_controlt_attr_group = { .attributes = 1, .attr = bcm56880_a0_lrd_dlb_controlt_attr_entry, }; static const bcmlrd_map_entry_t bcm56880_a0_lrd_dlb_controlt_dlb_ecmp_quality_measure_control_map_entry[] = { { /* 0 */ .entry_type = BCMLRD_MAP_ENTRY_MAPPED_VALUE, .desc = { .field_id = PORT_LOADING_WEIGHTf, .field_idx = 0, .minbit = 8, .maxbit = 11, .entry_idx = 0, .reserved = 0 }, .u = { .mapped = { .src = { .field_id = DLB_CONTROLt_PORT_LOAD_WEIGHTf, .field_idx = 0, .minbit = 0, .maxbit = 3, .entry_idx = 0, .reserved = 0 } } }, }, { /* 1 */ .entry_type = BCMLRD_MAP_ENTRY_MAPPED_VALUE, .desc = { .field_id = TOTAL_QSIZE_WEIGHTf, .field_idx = 0, .minbit = 12, .maxbit = 15, .entry_idx = 0, .reserved = 0 }, .u = { .mapped = { .src = { .field_id = DLB_CONTROLt_PORT_QUEUE_SIZE_WEIGHTf, .field_idx = 0, .minbit = 0, .maxbit = 3, .entry_idx = 0, .reserved = 0 } } }, }, { /* 2 */ .entry_type = BCMLRD_MAP_ENTRY_MAPPED_VALUE, .desc = { .field_id = ITM_PORT_QSIZE_WEIGHTf, .field_idx = 0, .minbit = 16, .maxbit = 19, .entry_idx = 0, .reserved = 0 }, .u = { .mapped = { .src = { .field_id = DLB_CONTROLt_TM_QUEUE_SIZE_WEIGHTf, .field_idx = 0, .minbit = 0, .maxbit = 3, .entry_idx = 0, .reserved = 0 } } }, }, { /* 3 */ .entry_type = BCMLRD_MAP_ENTRY_MAPPED_VALUE, .desc = { .field_id = CAP_PORT_LOADING_AVERAGEf, .field_idx = 0, .minbit = 20, .maxbit = 20, .entry_idx = 0, .reserved = 0 }, .u = { .mapped = { .src = { .field_id = DLB_CONTROLt_CAP_PORT_LOADf, .field_idx = 0, .minbit = 0, .maxbit = 0, .entry_idx = 0, .reserved = 0 } } }, }, { /* 4 */ .entry_type = BCMLRD_MAP_ENTRY_MAPPED_VALUE, .desc = { .field_id = CAP_TOTAL_PORT_QSIZE_AVERAGEf, .field_idx = 0, .minbit = 21, .maxbit = 21, .entry_idx = 0, .reserved = 0 }, .u = { .mapped = { .src = { .field_id = DLB_CONTROLt_CAP_PORT_QUEUE_SIZEf, .field_idx = 0, .minbit = 0, .maxbit = 0, .entry_idx = 0, .reserved = 0 } } }, }, { /* 5 */ .entry_type = BCMLRD_MAP_ENTRY_MAPPED_VALUE, .desc = { .field_id = CAP_ITM_PORT_QSIZE_AVERAGEf, .field_idx = 0, .minbit = 22, .maxbit = 22, .entry_idx = 0, .reserved = 0 }, .u = { .mapped = { .src = { .field_id = DLB_CONTROLt_CAP_TM_QUEUE_SIZEf, .field_idx = 0, .minbit = 0, .maxbit = 0, .entry_idx = 0, .reserved = 0 } } }, }, { /* 6 */ .entry_type = BCMLRD_MAP_ENTRY_MAPPED_VALUE, .desc = { .field_id = SAMPLING_PERIODf, .field_idx = 0, .minbit = 0, .maxbit = 7, .entry_idx = 0, .reserved = 0 }, .u = { .mapped = { .src = { .field_id = DLB_CONTROLt_SAMPLING_PERIODf, .field_idx = 0, .minbit = 0, .maxbit = 7, .entry_idx = 0, .reserved = 0 } } }, }, }; static const bcmlrd_map_group_t bcm56880_a0_lrd_dlb_control_map_group[] = { { .dest = { .kind = BCMLRD_MAP_PHYSICAL, .id = DLB_ECMP_QUALITY_MEASURE_CONTROLr, }, .entries = 7, .entry = bcm56880_a0_lrd_dlb_controlt_dlb_ecmp_quality_measure_control_map_entry }, }; const bcmlrd_map_t bcm56880_a0_lrd_dlb_control_map = { .src_id = DLB_CONTROLt, .field_data = &bcm56880_a0_lrd_dlb_control_map_field_data, .groups = 1, .group = bcm56880_a0_lrd_dlb_control_map_group, .table_attr = &bcm56880_a0_lrd_dlb_controlt_attr_group, .entry_ops = BCMLRD_MAP_TABLE_ENTRY_OPERATION_LOOKUP | BCMLRD_MAP_TABLE_ENTRY_OPERATION_TRAVERSE | BCMLRD_MAP_TABLE_ENTRY_OPERATION_INSERT | BCMLRD_MAP_TABLE_ENTRY_OPERATION_UPDATE | BCMLRD_MAP_TABLE_ENTRY_OPERATION_DELETE };
30.46732
226
0.502842
fe2d346eaeedbb89242b0ed74afce6b2da987fea
3,436
c
C
netbsd/sys/arch/next68k/stand/boot/rtc.c
MarginC/kame
2ef74fe29e4cca9b4a87a1d5041191a9e2e8be30
[ "BSD-3-Clause" ]
91
2015-01-05T15:18:31.000Z
2022-03-11T16:43:28.000Z
netbsd/sys/arch/next68k/stand/boot/rtc.c
MarginC/kame
2ef74fe29e4cca9b4a87a1d5041191a9e2e8be30
[ "BSD-3-Clause" ]
1
2016-02-25T15:57:55.000Z
2016-02-25T16:01:02.000Z
netbsd/sys/arch/next68k/stand/boot/rtc.c
MarginC/kame
2ef74fe29e4cca9b4a87a1d5041191a9e2e8be30
[ "BSD-3-Clause" ]
21
2015-02-07T08:23:07.000Z
2021-12-14T06:01:49.000Z
/* $NetBSD: rtc.c,v 1.2 1999/03/26 06:54:40 dbj Exp $ */ /* * Copyright (c) 1997 Rolf Grossmann * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Rolf Grossmann. * 4. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <sys/param.h> #include <next68k/dev/clockreg.h> #include <machine/cpu.h> #include <stand.h> u_char rtc_read __P((u_char reg)); void rtc_init __P((void)); time_t getsecs __P((void)); /* ### where shall I put this definition? */ #define DELAY(n) { register int N = (n); while (--N > 0); } static volatile u_int *scr2 = (u_int *)NEXT_P_SCR2_CON; static u_char new_clock; u_char rtc_read(u_char reg) { int i; u_int tmp; u_char val; *scr2 = (*scr2 & ~(SCR2_RTDATA | SCR2_RTCLK)) | SCR2_RTCE; DELAY(1); val = reg; for (i=0; i<8; i++) { tmp = *scr2 & ~(SCR2_RTDATA | SCR2_RTCLK); if (val & 0x80) tmp |= SCR2_RTDATA; *scr2 = tmp; DELAY(1); *scr2 = tmp | SCR2_RTCLK; DELAY(1); *scr2 = tmp; DELAY(1); val <<= 1; } val = 0; /* should be anyway */ for (i=0; i<8; i++) { val <<= 1; tmp = *scr2 & ~(SCR2_RTDATA | SCR2_RTCLK); *scr2 = tmp | SCR2_RTCLK; DELAY(1); *scr2 = tmp; DELAY(1); if (*scr2 & SCR2_RTDATA) val |= 1; } *scr2 &= ~(SCR2_RTDATA|SCR2_RTCLK|SCR2_RTCE); DELAY(1); return val; } void rtc_init(void) { u_char val; val = rtc_read(RTC_STATUS); new_clock = (val & RTC_NEW_CLOCK) ? 1 : 0; } time_t getsecs(void) { u_int secs; if (new_clock) { secs = rtc_read(RTC_CNTR3) << 24 | rtc_read(RTC_CNTR2) << 16 | rtc_read(RTC_CNTR1) << 8 | rtc_read(RTC_CNTR0); } else { u_char d,h,m,s; #define BCD_DECODE(x) (((x) >> 4) * 10 + ((x) & 0xf)) d = rtc_read(RTC_DAY); h = rtc_read(RTC_HRS); m = rtc_read(RTC_MIN); s = rtc_read(RTC_SEC); secs = BCD_DECODE(d) * (60*60*24) + BCD_DECODE(h) * (60*60) + BCD_DECODE(m) * 60 + BCD_DECODE(s); } return secs; }
26.430769
76
0.669383
27920797a4ff01f3361bf6fe57e0b62730f0c4ab
5,579
c
C
src/libxpeccy/hardware/msx.c
asve79/Xpeccy
b20562ccfbd3a9065b02241c09b00b1d3371d8d5
[ "MIT" ]
null
null
null
src/libxpeccy/hardware/msx.c
asve79/Xpeccy
b20562ccfbd3a9065b02241c09b00b1d3371d8d5
[ "MIT" ]
null
null
null
src/libxpeccy/hardware/msx.c
asve79/Xpeccy
b20562ccfbd3a9065b02241c09b00b1d3371d8d5
[ "MIT" ]
null
null
null
#include "hardware.h" typedef struct { int type; int num; } mPageNr; static mPageNr msxMemTab[4][4] = { {{MEM_ROM, 0}, {MEM_ROM, 1}, {MEM_RAM, 1}, {MEM_RAM, 0}}, {{MEM_SLOT,0},{MEM_SLOT,0},{MEM_SLOT,0},{MEM_SLOT,0}}, {{MEM_SLOT,1},{MEM_SLOT,1},{MEM_SLOT,1},{MEM_SLOT,1}}, {{MEM_RAM, 3},{MEM_RAM, 2},{MEM_RAM, 1},{MEM_RAM, 0}} }; unsigned char msxSlotRd(unsigned short adr, void* data) { xCartridge* slot = (xCartridge*)data; return sltRead(slot, SLT_PRG, adr); } void msxSlotWr(unsigned short adr, unsigned char val, void* data) { xCartridge* slot = (xCartridge*)data; sltWrite(slot, SLT_PRG, adr, val); } void msxSetMem(Computer* comp, int bank, unsigned char slot) { mPageNr pg = msxMemTab[slot][bank]; switch(pg.type) { case MEM_SLOT: memSetBank(comp->mem, bank << 6, MEM_SLOT, comp->slot->memMap[bank], MEM_16K, msxSlotRd, msxSlotWr, comp->slot); break; case MEM_RAM: memSetBank(comp->mem, bank << 6, MEM_RAM, comp->msx.memMap[bank & 3] & 7, MEM_16K, NULL, NULL, NULL); break; case MEM_ROM: memSetBank(comp->mem, bank << 6, MEM_ROM, pg.num, MEM_16K, NULL, NULL, NULL); break; } } void msxMapMem(Computer* comp) { msxSetMem(comp, 0, comp->msx.pA8 & 0x03); msxSetMem(comp, 1, (comp->msx.pA8 & 0x0c) >> 2); msxSetMem(comp, 2, (comp->msx.pA8 & 0x30) >> 4); msxSetMem(comp, 3, (comp->msx.pA8 & 0xc0) >> 6); } void msxResetSlot(xCartridge* slot) { slot->memMap[0] = 0; slot->memMap[1] = 0; slot->memMap[2] = 0; slot->memMap[3] = 0; } void msxReset(Computer* comp) { kbdSetMode(comp->keyb, KBD_MSX); comp->msx.pA8 = 0x00; comp->msx.memMap[0] = 3; comp->msx.memMap[1] = 2; comp->msx.memMap[2] = 1; comp->msx.memMap[3] = 0; vidSetMode(comp->vid, VDP_TEXT1); msxResetSlot(comp->slot); vdpReset(comp->vid); msxMapMem(comp); } // AY void msxAYIdxOut(Computer* comp, unsigned short port, unsigned char val) { tsOut(comp->ts, 0xfffd, val); } void msxAYDataOut(Computer* comp, unsigned short port, unsigned char val) { tsOut(comp->ts, 0xbffd, val); } unsigned char msxAYDataIn(Computer* comp, unsigned short port) { return tsIn(comp->ts, 0xbffd); } // 8255A unsigned char msxA9In(Computer* comp, unsigned short port) { return comp->keyb->msxMap[comp->msx.keyLine]; //return kbdRead(comp->keyb, comp->msx.keyLine); } void msxAAOut(Computer* comp, unsigned short port, unsigned char val) { comp->msx.pAA = val; comp->msx.keyLine = val & 0x0f; if (val & 0x10) { tapStop(comp->tape); } else { tapPlay(comp->tape); } comp->tape->levRec = (val & 0x20) ? 1 : 0; comp->beep->lev = (val & 0x80) ? 1 : 0; } unsigned char msxAAIn(Computer* comp, unsigned short port) { return comp->msx.pAA; } void msxABOut(Computer* comp, unsigned short port, unsigned char val) { if (val & 0x80) { comp->msx.ppi.regC = val; } else { unsigned char mask = 0x01 << ((val >> 1) & 7); if (val & 1) { comp->msx.ppi.regC |= mask; } else { comp->msx.ppi.regC &= ~mask; } } } // memory void msxA8Out(Computer* comp, unsigned short port, unsigned char val) { comp->msx.pA8 = val; msxMapMem(comp); } unsigned char msxA8In(Computer* comp, unsigned short port) { return comp->msx.pA8; } void msxMemOut(Computer* comp, unsigned short port, unsigned char val) { comp->msx.memMap[port & 3] = val; } unsigned char msxMemIn(Computer* comp, unsigned short port) { return comp->msx.memMap[port & 3]; } // v9938 void msx9938wr(Computer* comp, unsigned short adr, unsigned char val) { vdpWrite(comp->vid, adr & 3, val); } unsigned char msx9938rd(Computer* comp, unsigned short adr) { return vdpRead(comp->vid, adr & 3); } // Port map static xPort msxPortMap[] = { {0xff,0x90,2,2,2,dummyIn, dummyOut}, // 90 RW ULA5RA087 Centronic BUSY state (bit 1=1) / ULA5RA087 Centronic STROBE output (bit 0=0) {0xff,0x91,2,2,2,NULL, dummyOut}, // 91 W ULA5RA087 Centronic Printer Data {0xfe,0x98,2,2,2,msx9938rd, msx9938wr}, // 98/99 VDP {0xff,0xa0,2,2,2,NULL, msxAYIdxOut}, // A0 W I AY-3-8910 PSG Sound Generator Index {0xff,0xa1,2,2,2,NULL, msxAYDataOut}, // A1 W I AY-3-8910 PSG Sound Generator Data write {0xff,0xa2,2,2,2,msxAYDataIn, NULL}, // A2 R I AY-3-8910 PSG Sound Generator Data read {0xff,0xa8,2,2,2,msxA8In, msxA8Out}, // A8 RW I 8255A/ULA9RA041 PPI Port A Memory PSLOT Register (RAM/ROM) {0xff,0xa9,2,2,2,msxA9In, NULL}, // A9 R I 8255A/ULA9RA041 PPI Port B Keyboard column inputs {0xff,0xaa,2,2,2,msxAAIn, msxAAOut}, // AA RW I 8255A/ULA9RA041 PPI Port C Kbd Row sel,LED,CASo,CASm {0xff,0xab,2,2,2,NULL, msxABOut}, // AB W I 8255A/ULA9RA041 Mode select and I/O setup of A,B,C {0xfc,0xfc,2,2,2,msxMemIn, msxMemOut}, // FC..FF RW RAM pages for memBanks // {0x00,0x00,2,2,2,brkIn,brkOut} {0x00,0x00,2,2,2,dummyIn,dummyOut}, }; unsigned char msxIn(Computer* comp, unsigned short port, int dos) { return hwIn(msxPortMap, comp, port, dos); } void msxOut(Computer* comp, unsigned short port, unsigned char val, int dos) { hwOut(msxPortMap,comp, port, val, dos); } void msx_sync(Computer* comp, int ns) { int irq = (comp->vid->inth || comp->vid->intf) ? 1 : 0; if (irq && !(comp->cpu->intrq & Z80_INT)) { // 0->1 : TESTED 20ms | NOTE : sometimes iff1=0 ? comp->cpu->intrq |= Z80_INT; comp->intVector = 0xff; } else if (!irq && (comp->cpu->intrq & Z80_INT)) { // 1->0 : clear comp->cpu->intrq &= ~Z80_INT; } } void msx_keyp(Computer* comp, keyEntry ent) { kbdPress(comp->keyb, ent); } void msx_keyr(Computer* comp, keyEntry ent) { kbdRelease(comp->keyb, ent); } sndPair msx_vol(Computer* comp, sndVolume* sv) { sndPair vol = aymGetVolume(comp->ts->chipA); return vol; }
27.895
133
0.668399
7e6f5bc53614bd064caf3807bd2f2dc8fcfc3674
7,926
h
C
motor-controller-nucleo/tmc/ic/TMC4361A/TMC4361A_Register.h
HEEV/motor-controller-2018-sw
7bc22e4c7ba330d9130cda98a54a56066df2200b
[ "MIT" ]
3
2018-12-29T13:33:32.000Z
2019-09-14T15:45:26.000Z
motor-controller-nucleo/tmc/ic/TMC4361A/TMC4361A_Register.h
HEEV/motor-controller-2018-sw
7bc22e4c7ba330d9130cda98a54a56066df2200b
[ "MIT" ]
null
null
null
motor-controller-nucleo/tmc/ic/TMC4361A/TMC4361A_Register.h
HEEV/motor-controller-2018-sw
7bc22e4c7ba330d9130cda98a54a56066df2200b
[ "MIT" ]
1
2019-06-06T03:28:05.000Z
2019-06-06T03:28:05.000Z
/* * TMC4361A_Register.h * * Created on: 18.07.2017 * Author: LK */ #ifndef TMC4361A_REGISTER_H #define TMC4361A_REGISTER_H #define TMC4361A_GENERAL_CONF 0x00 #define TMC4361A_REFERENCE_CONF 0x01 #define TMC4361A_START_CONF 0x02 #define TMC4361A_INPUT_FILT_CONF 0x03 #define TMC4361A_SPIOUT_CONF 0x04 #define TMC4361A_CURRENT_CONF 0x05 #define TMC4361A_SCALE_VALUES 0x06 #define TMC4361A_ENC_IN_CONF 0x07 #define TMC4361A_ENC_IN_DATA 0x08 #define TMC4361A_ENC_OUT_DATA 0x09 #define TMC4361A_STEP_CONF 0x0A #define TMC4361A_SPI_STATUS_SELECTION 0x0B #define TMC4361A_EVENT_CLEAR_CONF 0x0C #define TMC4361A_INTR_CONF 0x0D #define TMC4361A_EVENTS 0x0E #define TMC4361A_STATUS 0x0F #define TMC4361A_STP_LENGTH_ADD 0x10 #define TMC4361A_DIR_SETUP_TIME 0x10 #define TMC4361A_START_OUT_ADD 0x11 #define TMC4361A_GEAR_RATIO 0x12 #define TMC4361A_START_DELAY 0x13 #define TMC4361A_CLK_GATING_DELAY 0x14 #define TMC4361A_STDBY_DELAY 0x15 #define TMC4361A_FREEWHEEL_DELAY 0x16 #define TMC4361A_VDRV_SCALE_LIMIT 0x17 #define TMC4361A_PWM_VMAX 0x17 #define TMC4361A_UP_SCALE_DELAY 0x18 #define TMC4361A_CL_UPSCALE_DELAY 0x18 #define TMC4361A_HOLD_SCALE_DELAY 0x19 #define TMC4361A_CL_DOWNSCALE_DELAY 0x19 #define TMC4361A_DRV_SCALE_DELAY 0x1A #define TMC4361A_BOOST_TIME 0x1B #define TMC4361A_CL_BETA 0x1C #define TMC4361A_CL_GAMMA 0x1C #define TMC4361A_DAC_ADDR_A 0x1D #define TMC4361A_DAC_ADDR_B 0x1D #define TMC4361A_SPI_SWITCH_VEL 0x1D #define TMC4361A_HOME_SAFETY_MARGIN 0x1E #define TMC4361A_PWM_FREQ 0x1F #define TMC4361A_CHOPSYNC_DIV 0x1F #define TMC4361A_RAMPMODE 0x20 #define TMC4361A_XACTUAL 0x21 #define TMC4361A_VACTUAL 0x22 #define TMC4361A_AACTUAL 0x23 #define TMC4361A_VMAX 0x24 #define TMC4361A_VSTART 0x25 #define TMC4361A_VSTOP 0x26 #define TMC4361A_VBREAK 0x27 #define TMC4361A_AMAX 0x28 #define TMC4361A_DMAX 0x29 #define TMC4361A_ASTART 0x2A #define TMC4361A_SIGN_AACT 0x2A #define TMC4361A_DFINAL 0x2B #define TMC4361A_DSTOP 0x2C #define TMC4361A_BOW1 0x2D #define TMC4361A_BOW2 0x2E #define TMC4361A_BOW3 0x2F #define TMC4361A_BOW4 0x30 #define TMC4361A_CLK_FREQ 0x31 #define TMC4361A_POS_COMP 0x32 #define TMC4361A_VIRT_STOP_LEFT 0x33 #define TMC4361A_VIRT_STOP_RIGHT 0x34 #define TMC4361A_X_HOME 0x35 #define TMC4361A_X_LATCH_RD 0x36 #define TMC4361A_REV_CNT_RD 0x36 #define TMC4361A_X_RANGE_WR 0x36 #define TMC4361A_X_TARGET 0x37 #define TMC4361A_X_PIPE0 0x38 #define TMC4361A_X_PIPE1 0x39 #define TMC4361A_X_PIPE2 0x3A #define TMC4361A_X_PIPE3 0x3B #define TMC4361A_X_PIPE4 0x3C #define TMC4361A_X_PIPE5 0x3D #define TMC4361A_X_PIPE6 0x3E #define TMC4361A_X_PIPE7 0x3F #define TMC4361A_SH_REG0 0x40 #define TMC4361A_SH_REG1 0x41 #define TMC4361A_SH_REG2 0x42 #define TMC4361A_SH_REG3 0x43 #define TMC4361A_SH_REG4 0x44 #define TMC4361A_SH_REG5 0x45 #define TMC4361A_SH_REG6 0x46 #define TMC4361A_SH_REG7 0x47 #define TMC4361A_SH_REG8 0x48 #define TMC4361A_SH_REG9 0x49 #define TMC4361A_SH_REG10 0x4A #define TMC4361A_SH_REG11 0x4B #define TMC4361A_SH_REG12 0x4C #define TMC4361A_SH_REG13 0x4D #define TMC4361A_DFREEZE 0x4E #define TMC4361A_IFREEZE 0x4E #define TMC4361A_CLK_GATING_REG 0x4F #define TMC4361A_RESET_REG 0x4F #define TMC4361A_ENC_POS 0x50 #define TMC4361A_ENC_LATCH_RD 0x51 #define TMC4361A_ENC_RESET_VAL_WR 0x51 #define TMC4361A_ENC_POS_DEV_RD 0x52 #define TMC4361A_CL_TR_TOLERANCE_WR 0x52 #define TMC4361A_ENC_POS_DEV_TOL_WR 0x53 #define TMC4361A_ENC_IN_RES_WR 0x54 #define TMC4361A_ENC_CONST_RD 0x54 #define TMC4361A_MANUAL_ENC_CONST0 0x54 #define TMC4361A_ENC_OUT_RES 0x55 #define TMC4361A_SER_CLK_IN_HIGH_WR 0x56 #define TMC4361A_SER_CLK_IN_LOW_WR 0x56 #define TMC4361A_SSI_IN_CLK_DELAY_WR 0x57 #define TMC4361A_SSI_IN_WTIME_WR 0x57 #define TMC4361A_SER_PTIME_WR 0x58 #define TMC4361A_CL_OFFSET 0x59 #define TMC4361A_PID_P_WR 0x5A #define TMC4361A_CL_VMAX_CALC_P_WR 0x5A #define TMC4361A_PID_VEL_RD 0x5A #define TMC4361A_PID_I_WR 0x5B #define TMC4361A_CL_VMAX_CALC_I_WR 0x5B #define TMC4361A_PID_ISUM_RD 0x5B #define TMC4361A_PID_D_WR 0x5C #define TMC4361A_CL_DELTA_P_WR 0x5C #define TMC4361A_PID_I_CLIP_WR 0x5D #define TMC4361A_PID_D_CLKDIV_WR 0x5D #define TMC4361A_PID_E_RD 0x5D #define TMC4361A_PID_DV_CLIP_WR 0x5E #define TMC4361A_PID_TOLERANCE_WR 0x5F #define TMC4361A_CL_TOLERANCE_WR 0x5F #define TMC4361A_FS_VEL_WR 0x60 #define TMC4361A_DC_VEL_WR 0x60 #define TMC4361A_CL_VMIN_EMF_WR 0x60 #define TMC4361A_DC_TIME_WR 0x61 #define TMC4361A_DC_SG_WR 0x61 #define TMC4361A_DC_BLKTIME_WR 0x61 #define TMC4361A_CL_VADD_EMF 0x61 #define TMC4361A_DC_LSPTM_WR 0x62 #define TMC4361A_ENC_VEL_ZERO_WR 0x62 #define TMC4361A_ENC_VMEAN_WAIT_WR 0x63 #define TMC4361A_ENC_VMEAN_FILTER_WR 0x63 #define TMC4361A_ENC_VMEAN_INT_WR 0x63 #define TMC4361A_SER_ENC_VARIATION_WR 0x63 #define TMC4361A_CL_CYCLE_WR 0x63 #define TMC4361A_SYNCHRO_SET 0x64 #define TMC4361A_V_ENC_RD 0x65 #define TMC4361A_V_ENC_MEAN_RD 0x66 #define TMC4361A_VSTALL_LIMIT_WR 0x67 #define TMC4361A_ADDR_TO_ENC 0x68 #define TMC4361A_DATA_TO_ENC 0x69 #define TMC4361A_ADDR_FROM_ENC 0x6A #define TMC4361A_DATA_FROM_ENC 0x6B #define TMC4361A_COVER_LOW_WR 0x6C #define TMC4361A_POLLING_STATUS_RD 0x6C #define TMC4361A_COVER_HIGH_WR 0x6D #define TMC4361A_POLLING_REG_WR 0x6D #define TMC4361A_COVER_DRV_LOW_RD 0x6E #define TMC4361A_COVER_DRV_HIGH_RD 0x6F #define TMC4361A_MSLUT_0_WR 0x70 #define TMC4361A_MSLUT_1_WR 0x71 #define TMC4361A_MSLUT_2_WR 0x72 #define TMC4361A_MSLUT_3_WR 0x73 #define TMC4361A_MSLUT_4_WR 0x74 #define TMC4361A_MSLUT_5_WR 0x75 #define TMC4361A_MSLUT_6_WR 0x76 #define TMC4361A_MSLUT_7_WR 0x77 #define TMC4361A_MSLUTSEL_WR 0x78 #define TMC4361A_MSCNT_RD 0x79 #define TMC4361A_MSOFFSET_WR 0x79 #define TMC4361A_CURRENTA_RD 0x7A #define TMC4361A_CURRENTB_RD 0x7A #define TMC4361A_CURRENTA_SPI_RD 0x7B #define TMC4361A_CURRENTB_SPI_RD 0x7B #define TMC4361A_TZEROWAIT_WR 0x7B #define TMC4361A_SCALE_PARAM_RD 0x7C #define TMC4361A_CIRCULAR_DEC_WR 0x7C #define TMC4361A_ENC_COMP_XOFFSET 0x7D #define TMC4361A_ENC_COMP_YOFFSET 0x7D #define TMC4361A_ENC_COMP_AMPL 0x7D #define TMC4361A_START_SIN_WR 0x7E #define TMC4361A_START_SIN90_120_WR 0x7E #define TMC4361A_DAC_OFFSET_WR 0x7E #define TMC4361A_VERSION_NO_RD 0x7F #endif /* TMC4361A_REGISTER_H */
39.63
43
0.682185
e0f4fef967285eb57858211e192b2ee9cdbb2c56
635
c
C
Attiny13/LED/main.c
nkieffer/AVR
029b035020a1a9d7bfe5f843a5d7af7b705849d1
[ "Unlicense" ]
null
null
null
Attiny13/LED/main.c
nkieffer/AVR
029b035020a1a9d7bfe5f843a5d7af7b705849d1
[ "Unlicense" ]
null
null
null
Attiny13/LED/main.c
nkieffer/AVR
029b035020a1a9d7bfe5f843a5d7af7b705849d1
[ "Unlicense" ]
null
null
null
#include <avr/io.h> #include <util/delay.h> #include <avr/interrupt.h> volatile uint16_t analog = 0; ISR(TIM0_COMPA_vect){ PORTB ^= _BV(PB3); } ISR(ADC_vect){ analog = ((ADCH << 8) | ADCL); // PORTB ^= _BV(PB4); } void setup(void){ ADMUX |= _BV(MUX0); ADCSRA = _BV(ADEN) | _BV(ADATE) | _BV(ADIE); DIDR0 |= _BV(ADC1D); DDRB |= _BV(PB4) | _BV(PB3); PORTB = _BV(PB3); TCCR0A = _BV(WGM01); TCCR0B = _BV(CS02) | _BV(CS00); TIMSK0 |= _BV(OCIE0A); sei(); ADCSRA |= _BV(ADSC); OCR0A = 0; } void loop(void){ OCR0A = 255 - (uint8_t)((analog / 1023.0) * 255.0); } int main(void){ setup(); while(1) loop(); }
18.142857
53
0.584252
7a59aad80daa6f7dab107fd4316e4c715eddb5b9
11,298
h
C
trace_server/connection.h
mojmir-svoboda/DbgToolkit
590887987d0856032be906068a3103b6ce31d21c
[ "MIT" ]
null
null
null
trace_server/connection.h
mojmir-svoboda/DbgToolkit
590887987d0856032be906068a3103b6ce31d21c
[ "MIT" ]
null
null
null
trace_server/connection.h
mojmir-svoboda/DbgToolkit
590887987d0856032be906068a3103b6ce31d21c
[ "MIT" ]
null
null
null
/** * Copyright (C) 2011 Mojmir Svoboda * * 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. **/ #pragma once #include <QThread> #include <widgets/logs/logwidget.h> #include <widgets/plot/plotwidget.h> #include <widgets/table/tablewidget.h> #include <widgets/gantt/ganttdata.h> #include <widgets/gantt/ganttwidget.h> #include <widgets/gantt/frameview.h> #include <dock/dockedwidgets.h> #include "constants.h" #include "connectionconfig.h" #include "types.h" #include "config.h" #include "wavetableconfig.h" #include "stats.h" #include <trace_proto/decoder_alloc.h> // #include <QtMultimedia/QAudioOutput> // #include <QtMultimedia/QAudioDeviceInfo> class MainWindow; class Server; class QFile; class QDataStream; class QTextStream; class QTcpSocket; class ControlBarCommon; struct Mixer; class ControlWidgetData; struct WaveTable; char const * const g_fileTags[] = { g_LogTag , g_PlotTag , g_TableTag , g_GanttTag , g_FrameTag }; char const * const g_fileNames[] = { g_LogFile, g_PlotFile, g_TableFile, g_GanttFile, g_FrameFile }; typedef DockedWidgets< logs::LogWidget, logs::LogConfig > datalogs_t; typedef DockedWidgets< plot::PlotWidget, plot::PlotConfig > dataplots_t; typedef DockedWidgets< table::TableWidget, table::TableConfig > datatables_t; typedef DockedWidgets< gantt::GanttWidget, gantt::GanttConfig > datagantts_t; typedef DockedWidgets< FrameView, FrameViewConfig > dataframes_t; typedef boost::tuple<datalogs_t, dataplots_t, datatables_t, datagantts_t, dataframes_t> data_widgets_t; template <int TypeN> struct SelectWidget { typedef typename boost::tuples::element<TypeN, data_widgets_t>::type::widget_t type; }; template <int TypeN> struct SelectConfig { typedef typename boost::tuples::element<TypeN, data_widgets_t>::type::config_t type; }; template <int TypeN> struct SelectIterator { typedef typename boost::tuples::element<TypeN, data_widgets_t>::type::iterator type; }; /**@class Connection * @brief represents incoming connection (or file stream) */ class Connection : public QThread, ActionAble { Q_OBJECT public: explicit Connection (QString const & app_name, QObject * parent = 0); ~Connection (); MainWindow const * getMainWindow () const { return m_main_window; } MainWindow * getMainWindow () { return m_main_window; } GlobalConfig const & getGlobalConfig () const; QString const & getAppName () const { return m_app_name; } QString const & getCurrPreset () const { return m_curr_preset; } AppData const & appData () const { return m_app_data; } E_SrcProtocol protocol () const { return m_src_protocol; } //QString const & separator () const { return m_config.m_csv_separator; } // csv void run (); void saveConfigs (QString const & path); void loadConfigs (QString const & path); void loadConfig (QString const & preset_name); void saveConfig (QString const & preset_name); void applyConfigs (); bool loadWaveTable (WaveTableConfig & cfg); WaveTable * waveTable () { return m_wavetable.get(); } WaveTable const * waveTable () const { return m_wavetable.get(); } //@TODO: old call!! void requestTableSynchronization (int sync_group, unsigned long long time); void requestTableWheelEventSync (int sync_group, QWheelEvent * ev, QTableView const * source); void requestTableActionSync (int sync_group, unsigned long long t, int cursorAction, Qt::KeyboardModifiers modifiers, QTableView const * source); // data widget creation functions: template <int TypeN> bool dataWidgetConfigPreload (QString const tag, typename SelectConfig<TypeN>::type & config); QString getClosestPresetName (); E_FeatureStates getClosestFeatureState (E_DataWidgetType type) const; void mkWidgetPath (E_DataWidgetType type, QString const tag, QStringList & path); template <int TypeN> typename SelectIterator<TypeN>::type dataWidgetFactory (QString const tag); template <int TypeN> typename SelectIterator<TypeN>::type dataWidgetFactoryFrom (QString const tag, typename SelectConfig<TypeN>::type const & config); template <int TypeN> void removeDockedWidget (DockedWidgetBase * ptr); void destroyDockedWidget (DockedWidgetBase * dwb); // control widget void setPresetAsCurrent (QString const & pname); void mentionInPresetHistory (QString const & str); QString getCurrentPresetName () const; void clearAllData (); signals: void readyForUse (); void newMessage (QString const & from, QString const & message); void handleCommands (); void dictionaryArrived (int type, Dict const & d); public slots: void onHandleCommands (); void onHandleCommandsStart (); void onHandleCommandsCommit (); bool tryHandleCommand (DecodedCommand const & cmd, E_ReceiveMode mode); // control widget //void onLevelValueChanged (int i); void onMixerChanged (MixerConfig const & config); void onMixerApplied (); void onMixerButton (); void onDataControlButton (); void onDataControlClosed (); void onMixerClosed (); void onBufferingStateChanged (int state); void onPresetChanged (int idx); void onPresetApply (); void onPresetSave (); void onPresetAdd (); void onPresetRm (); void onPresetReset (); void onLogsStateChanged (int state); void onPlotsStateChanged (int state); void onTablesStateChanged (int state); void onGanttsStateChanged (int state); void onPresetApply (QString const & preset_name); void onPresetSave (QString const & preset_name); void setMixerUI (MixerConfig const & cfg); void setBufferedUI (int state); void setLogsUI (int state); void setPlotsUI (int state); void setTablesUI (int state); void setGanttsUI (int state); void onClearAllData (); void onSaveData (QString const & dir); void onExportDataToCSV (QString const & dir); private slots: void processReadyRead (); void processTailCSVStream (); void handleCSVSetup (QString const & fname); void onDisconnected (); protected: friend class Server; friend class MainWindow; friend struct DataLog; friend class gantt::GanttWidget; enum { e_data_ok = 0, e_data_pipe_full, e_data_need_more, e_data_decode_oor, e_data_decode_lnerr, e_data_decode_captain_failure, e_data_decode_general_failure, e_data_decode_error, }; void setMainWindow (MainWindow * w) { m_main_window = w; } template <class T, typename T_Ret, typename T_Arg0, typename T_Arg1> int processStream (T *, T_Ret (T::*read_member_t)(T_Arg0, T_Arg1)); bool enqueueCommand (DecodedCommand const & cmd); bool dequeueCommand (DecodedCommand & cmd); //void preparseCommand (DecodedCommand & cmd); bool handleConfigCommand (DecodedCommand const & cmd); bool handlePingCommand (DecodedCommand const & cmd); bool handleShutdownCommand (DecodedCommand const & cmd); bool handleDictionary (DecodedCommand const & cmd); bool handleCSVStreamCommand (DecodedCommand const & cmd); bool handleExportCSVCommand (DecodedCommand const & cmd); bool handleSaveTLVCommand (DecodedCommand const & cmd); bool handleLogCommand (DecodedCommand const & cmd, E_ReceiveMode mode); bool handleLogClearCommand (DecodedCommand const & cmd, E_ReceiveMode mode); bool handleTableCommand (DecodedCommand const & cmd, E_ReceiveMode mode); bool handlePlotCommand (DecodedCommand const & cmd, E_ReceiveMode mode); bool handleSoundCommand (DecodedCommand const & cmd, E_ReceiveMode mode); bool handleGanttBgnCommand (DecodedCommand const & cmd, E_ReceiveMode mode); bool handleGanttEndCommand (DecodedCommand const & cmd, E_ReceiveMode mode); bool handleGanttFrameBgnCommand (DecodedCommand const & cmd, E_ReceiveMode mode); bool handleGanttFrameEndCommand (DecodedCommand const & cmd, E_ReceiveMode mode); bool handleGanttClearCommand (DecodedCommand const & cmd, E_ReceiveMode mode); bool sendConfigCommand (ConnectionConfig const & config); virtual bool handleAction (Action * a, E_ActionHandleType sync); virtual QWidget * controlWidget (); void registerDataMaps (); datalogs_t::iterator findOrCreateLog (QString const & tag); dataplots_t::iterator findOrCreatePlot (QString const & tag); datatables_t::iterator findOrCreateTable (QString const & tag); void appendTableXY (int x, int y, QString const & time, QString const & fgc, QString const & bgc, QString const & tag); void appendTableSetup (int x, int y, QString const & time, QString const & fgc, QString const & bgc, QString const & hhdr, QString const & tag); datagantts_t::iterator findOrCreateGantt (QString const & tag); void appendGantt (gantt::DecodedData &); dataframes_t::iterator findOrCreateFrame (QString const & tag); void appendFrames (gantt::DecodedData &); //void tryLoadMatchingPreset (QString const & appname); bool setupStorage (QString const & name); QString createStorageName () const; void processDataStream (QDataStream & stream); void copyStorageTo (QString const & filename); void closeStorage (); void setSocketDescriptor (int sd); void setImportFile (QString const & fname); void setTailFile (QString const & fname); void findTableIndexInFilters (QModelIndex const & row_index, bool scroll_to_item, bool expand); void setConfigValuesToUI (ConnectionConfig const & cfg); void setUIValuesToConfig (ConnectionConfig & cfg); void setupColumnSizes (bool force_setup = false); bool dumpModeEnabled () const; bool initSound (); void destroySound (); private: QString m_app_name; MainWindow * m_main_window; E_SrcStream m_src_stream; E_SrcProtocol m_src_protocol; QString m_src_name; ConnectionConfig m_config; AppData m_app_data; QString m_pid; int m_storage_idx; bool m_marked_for_close; QString m_curr_preset; std::unique_ptr<ControlBarCommon> m_control_bar; std::unique_ptr<Mixer> m_mixer; std::unique_ptr<ControlWidgetData> m_data_control; QDataStream * m_file_tlv_stream; QTextStream * m_file_csv_stream; qint64 m_file_size; // data receiving stuff DecodedCommand m_current_cmd; DecodingContext m_dcd_ctx; Asn1Allocator m_asn1_allocator; std::unique_ptr<QFile> m_storage; // QList<QAudioDeviceInfo> m_availableAudioOutputDevices; // QAudioDeviceInfo m_audioOutputDevice; // QAudioFormat m_audioFormat; // QAudioOutput * m_audioOutput; std::unique_ptr<WaveTable> m_wavetable; QDataStream * m_tcp_dump_stream; QTcpSocket * m_tcpstream; // std::unique_ptr< ? data_widgets_t m_data_widgets; }; #include "connection.inl"
39.365854
146
0.769782
1aa3f40c6c0920f9f98dcb2bfcb585960d15b47f
329,293
h
C
ch05_EXAMPLES/Resources/lowPolyAxesAndModels2.h
pangers/opengl-es-on-ios-examples
27171faeba9d3cb4dd7a1a7b58616205658a465e
[ "MIT" ]
37
2017-05-03T02:18:37.000Z
2022-03-08T03:41:15.000Z
ch05_EXAMPLES/Resources/lowPolyAxesAndModels2.h
pangers/opengl-es-on-ios-examples
27171faeba9d3cb4dd7a1a7b58616205658a465e
[ "MIT" ]
1
2019-08-05T20:42:25.000Z
2019-08-05T20:42:25.000Z
ch05_EXAMPLES/Resources/lowPolyAxesAndModels2.h
pangers/opengl-es-on-ios-examples
27171faeba9d3cb4dd7a1a7b58616205658a465e
[ "MIT" ]
15
2017-11-20T09:28:06.000Z
2020-10-17T03:33:51.000Z
/* created with obj2opengl.pl source file : lowPolyAxesAndModels2.obj vertices : 429 faces : 802 normals : 381 texture coords : 0 */ unsigned int lowPolyAxesAndModels2NumVerts = 2406; float lowPolyAxesAndModels2Verts [] = { // f 1//1 15//2 14//3 0, 0.102064779411765, -0.294117647058824, 0.0365781323529412, 0.0935426764705882, -0.287283470588235, 0.0371866323529412, 0.0951133970588235, -0.294117647058824, // f 1//1 2//4 15//2 0, 0.102064779411765, -0.294117647058824, 0, 0.100380308823529, -0.287283470588235, 0.0365781323529412, 0.0935426764705882, -0.287283470588235, // f 2//4 16//5 15//2 0, 0.100380308823529, -0.287283470588235, 0.0348920294117647, 0.0891903382352941, -0.282014955882353, 0.0365781323529412, 0.0935426764705882, -0.287283470588235, // f 2//4 3//6 16//5 0, 0.100380308823529, -0.287283470588235, 0, 0.0957127941176471, -0.282014955882353, 0.0348920294117647, 0.0891903382352941, -0.282014955882353, // f 3//6 17//7 16//5 0, 0.0957127941176471, -0.282014955882353, 0.0325146029411765, 0.0830534705882353, -0.279519, 0.0348920294117647, 0.0891903382352941, -0.282014955882353, // f 3//6 4//8 17//7 0, 0.0957127941176471, -0.282014955882353, 0, 0.0891315, -0.279519, 0.0325146029411765, 0.0830534705882353, -0.279519, // f 4//8 18//9 17//7 0, 0.0891315, -0.279519, 0.0299904705882353, 0.0765379264705882, -0.280367397058824, 0.0325146029411765, 0.0830534705882353, -0.279519, // f 4//8 5//10 18//9 0, 0.0891315, -0.279519, 0, 0.0821441323529412, -0.280367397058824, 0.0299904705882353, 0.0765379264705882, -0.280367397058824, // f 5//10 19//11 18//9 0, 0.0821441323529412, -0.280367397058824, 0.0278978823529412, 0.0711363676470588, -0.284365852941176, 0.0299904705882353, 0.0765379264705882, -0.280367397058824, // f 5//10 6//12 19//11 0, 0.0821441323529412, -0.280367397058824, 0, 0.0763513823529412, -0.284365852941176, 0.0278978823529412, 0.0711363676470588, -0.284365852941176, // f 6//12 20//13 19//11 0, 0.0763513823529412, -0.284365852941176, 0.02671625, 0.0680862058823529, -0.290598308823529, 0.0278978823529412, 0.0711363676470588, -0.284365852941176, // f 6//12 7//14 20//13 0, 0.0763513823529412, -0.284365852941176, 0, 0.0730803382352941, -0.290598308823529, 0.02671625, 0.0680862058823529, -0.290598308823529, // f 7//14 21//15 20//13 0, 0.0730803382352941, -0.290598308823529, 0.02671625, 0.0680862058823529, -0.297637014705882, 0.02671625, 0.0680862058823529, -0.290598308823529, // f 7//14 8//16 21//15 0, 0.0730803382352941, -0.290598308823529, 0, 0.0730803382352941, -0.297637014705882, 0.02671625, 0.0680862058823529, -0.297637014705882, // f 8//16 22//17 21//15 0, 0.0730803382352941, -0.297637014705882, 0.0278978823529412, 0.0711363676470588, -0.303869441176471, 0.02671625, 0.0680862058823529, -0.297637014705882, // f 8//16 9//18 22//17 0, 0.0730803382352941, -0.297637014705882, 0, 0.0763513823529412, -0.303869441176471, 0.0278978823529412, 0.0711363676470588, -0.303869441176471, // f 9//18 23//19 22//17 0, 0.0763513823529412, -0.303869441176471, 0.0299904705882353, 0.0765379411764706, -0.307867897058824, 0.0278978823529412, 0.0711363676470588, -0.303869441176471, // f 9//18 10//20 23//19 0, 0.0763513823529412, -0.303869441176471, 0, 0.0821441323529412, -0.307867897058824, 0.0299904705882353, 0.0765379411764706, -0.307867897058824, // f 10//20 24//21 23//19 0, 0.0821441323529412, -0.307867897058824, 0.0325146029411765, 0.0830534705882353, -0.308716294117647, 0.0299904705882353, 0.0765379411764706, -0.307867897058824, // f 10//20 11//22 24//21 0, 0.0821441323529412, -0.307867897058824, 0, 0.0891315, -0.308716323529412, 0.0325146029411765, 0.0830534705882353, -0.308716294117647, // f 11//22 25//23 24//21 0, 0.0891315, -0.308716323529412, 0.0348920294117647, 0.0891903382352941, -0.306220367647059, 0.0325146029411765, 0.0830534705882353, -0.308716294117647, // f 11//22 12//24 25//23 0, 0.0891315, -0.308716323529412, 0, 0.0957127941176471, -0.306220367647059, 0.0348920294117647, 0.0891903382352941, -0.306220367647059, // f 12//24 26//25 25//23 0, 0.0957127941176471, -0.306220367647059, 0.0365781323529412, 0.0935426764705882, -0.300951823529412, 0.0348920294117647, 0.0891903382352941, -0.306220367647059, // f 12//24 13//26 26//25 0, 0.0957127941176471, -0.306220367647059, 0, 0.100380308823529, -0.300951823529412, 0.0365781323529412, 0.0935426764705882, -0.300951823529412, // f 13//26 14//3 26//25 0, 0.100380308823529, -0.300951823529412, 0.0371866323529412, 0.0951133970588235, -0.294117647058824, 0.0365781323529412, 0.0935426764705882, -0.300951823529412, // f 13//26 1//1 14//3 0, 0.100380308823529, -0.300951823529412, 0, 0.102064779411765, -0.294117647058824, 0.0371866323529412, 0.0951133970588235, -0.294117647058824, // f 14//3 28//27 27//28 0.0371866323529412, 0.0951133970588235, -0.294117647058824, 0.0682161911764706, 0.0739532205882353, -0.287283470588235, 0.0693510147058823, 0.0751980588235294, -0.294117647058824, // f 14//3 15//2 28//27 0.0371866323529412, 0.0951133970588235, -0.294117647058824, 0.0365781323529412, 0.0935426764705882, -0.287283470588235, 0.0682161911764706, 0.0739532205882353, -0.287283470588235, // f 15//2 29//29 28//27 0.0365781323529412, 0.0935426764705882, -0.287283470588235, 0.0650717205882353, 0.0705038823529412, -0.282014955882353, 0.0682161911764706, 0.0739532205882353, -0.287283470588235, // f 15//2 16//5 29//29 0.0365781323529412, 0.0935426764705882, -0.287283470588235, 0.0348920294117647, 0.0891903382352941, -0.282014955882353, 0.0650717205882353, 0.0705038823529412, -0.282014955882353, // f 16//5 30//30 29//29 0.0348920294117647, 0.0891903382352941, -0.282014955882353, 0.0606379264705882, 0.06564025, -0.279519, 0.0650717205882353, 0.0705038823529412, -0.282014955882353, // f 16//5 17//7 30//30 0.0348920294117647, 0.0891903382352941, -0.282014955882353, 0.0325146029411765, 0.0830534705882353, -0.279519, 0.0606379264705882, 0.06564025, -0.279519, // f 17//7 31//31 30//30 0.0325146029411765, 0.0830534705882353, -0.279519, 0.0559305588235294, 0.0604765147058823, -0.280367397058824, 0.0606379264705882, 0.06564025, -0.279519, // f 17//7 18//9 31//31 0.0325146029411765, 0.0830534705882353, -0.279519, 0.0299904705882353, 0.0765379264705882, -0.280367397058824, 0.0559305588235294, 0.0604765147058823, -0.280367397058824, // f 18//9 32//32 31//31 0.0299904705882353, 0.0765379264705882, -0.280367397058824, 0.0520280147058823, 0.0561956323529412, -0.284365852941176, 0.0559305588235294, 0.0604765147058823, -0.280367397058824, // f 18//9 19//11 32//32 0.0299904705882353, 0.0765379264705882, -0.280367397058824, 0.0278978823529412, 0.0711363676470588, -0.284365852941176, 0.0520280147058823, 0.0561956323529412, -0.284365852941176, // f 19//11 33//33 32//32 0.0278978823529412, 0.0711363676470588, -0.284365852941176, 0.0498243235294118, 0.0537783088235294, -0.290598308823529, 0.0520280147058823, 0.0561956323529412, -0.284365852941176, // f 19//11 20//13 33//33 0.0278978823529412, 0.0711363676470588, -0.284365852941176, 0.02671625, 0.0680862058823529, -0.290598308823529, 0.0498243235294118, 0.0537783088235294, -0.290598308823529, // f 20//13 34//34 33//33 0.02671625, 0.0680862058823529, -0.290598308823529, 0.0498243382352941, 0.0537783088235294, -0.297637014705882, 0.0498243235294118, 0.0537783088235294, -0.290598308823529, // f 20//13 21//15 34//34 0.02671625, 0.0680862058823529, -0.290598308823529, 0.02671625, 0.0680862058823529, -0.297637014705882, 0.0498243382352941, 0.0537783088235294, -0.297637014705882, // f 21//15 35//35 34//34 0.02671625, 0.0680862058823529, -0.297637014705882, 0.0520280147058823, 0.0561956323529412, -0.303869441176471, 0.0498243382352941, 0.0537783088235294, -0.297637014705882, // f 21//15 22//17 35//35 0.02671625, 0.0680862058823529, -0.297637014705882, 0.0278978823529412, 0.0711363676470588, -0.303869441176471, 0.0520280147058823, 0.0561956323529412, -0.303869441176471, // f 22//17 36//36 35//35 0.0278978823529412, 0.0711363676470588, -0.303869441176471, 0.0559305588235294, 0.0604765147058823, -0.307867897058824, 0.0520280147058823, 0.0561956323529412, -0.303869441176471, // f 22//17 23//19 36//36 0.0278978823529412, 0.0711363676470588, -0.303869441176471, 0.0299904705882353, 0.0765379411764706, -0.307867897058824, 0.0559305588235294, 0.0604765147058823, -0.307867897058824, // f 23//19 37//37 36//36 0.0299904705882353, 0.0765379411764706, -0.307867897058824, 0.0606379264705882, 0.06564025, -0.308716294117647, 0.0559305588235294, 0.0604765147058823, -0.307867897058824, // f 23//19 24//21 37//37 0.0299904705882353, 0.0765379411764706, -0.307867897058824, 0.0325146029411765, 0.0830534705882353, -0.308716294117647, 0.0606379264705882, 0.06564025, -0.308716294117647, // f 24//21 38//38 37//37 0.0325146029411765, 0.0830534705882353, -0.308716294117647, 0.0650717205882353, 0.0705038823529412, -0.306220367647059, 0.0606379264705882, 0.06564025, -0.308716294117647, // f 24//21 25//23 38//38 0.0325146029411765, 0.0830534705882353, -0.308716294117647, 0.0348920294117647, 0.0891903382352941, -0.306220367647059, 0.0650717205882353, 0.0705038823529412, -0.306220367647059, // f 25//23 39//39 38//38 0.0348920294117647, 0.0891903382352941, -0.306220367647059, 0.0682161911764706, 0.0739532205882353, -0.300951823529412, 0.0650717205882353, 0.0705038823529412, -0.306220367647059, // f 25//23 26//25 39//39 0.0348920294117647, 0.0891903382352941, -0.306220367647059, 0.0365781323529412, 0.0935426764705882, -0.300951823529412, 0.0682161911764706, 0.0739532205882353, -0.300951823529412, // f 26//25 27//28 39//39 0.0365781323529412, 0.0935426764705882, -0.300951823529412, 0.0693510147058823, 0.0751980588235294, -0.294117647058824, 0.0682161911764706, 0.0739532205882353, -0.300951823529412, // f 26//25 14//3 27//28 0.0365781323529412, 0.0935426764705882, -0.300951823529412, 0.0371866323529412, 0.0951133970588235, -0.294117647058824, 0.0693510147058823, 0.0751980588235294, -0.294117647058824, // f 27//28 41//40 40//41 0.0693510147058823, 0.0751980588235294, -0.294117647058824, 0.0906412941176471, 0.0442576176470588, -0.287283470588235, 0.0921491617647059, 0.0450084411764706, -0.294117647058824, // f 27//28 28//27 41//40 0.0693510147058823, 0.0751980588235294, -0.294117647058824, 0.0682161911764706, 0.0739532205882353, -0.287283470588235, 0.0906412941176471, 0.0442576176470588, -0.287283470588235, // f 28//27 42//42 41//40 0.0682161911764706, 0.0739532205882353, -0.287283470588235, 0.0864630882352941, 0.0421771176470588, -0.282014955882353, 0.0906412941176471, 0.0442576176470588, -0.287283470588235, // f 28//27 29//29 42//42 0.0682161911764706, 0.0739532205882353, -0.287283470588235, 0.0650717205882353, 0.0705038823529412, -0.282014955882353, 0.0864630882352941, 0.0421771176470588, -0.282014955882353, // f 29//29 43//43 42//42 0.0650717205882353, 0.0705038823529412, -0.282014955882353, 0.0805717647058824, 0.0392435882352941, -0.279519, 0.0864630882352941, 0.0421771176470588, -0.282014955882353, // f 29//29 30//30 43//43 0.0650717205882353, 0.0705038823529412, -0.282014955882353, 0.0606379264705882, 0.06564025, -0.279519, 0.0805717647058824, 0.0392435882352941, -0.279519, // f 30//30 44//44 43//43 0.0606379264705882, 0.06564025, -0.279519, 0.0743169117647059, 0.0361290441176471, -0.280367397058824, 0.0805717647058824, 0.0392435882352941, -0.279519, // f 30//30 31//31 44//44 0.0606379264705882, 0.06564025, -0.279519, 0.0559305588235294, 0.0604765147058823, -0.280367397058824, 0.0743169117647059, 0.0361290441176471, -0.280367397058824, // f 31//31 45//45 44//44 0.0559305588235294, 0.0604765147058823, -0.280367397058824, 0.0691314852941177, 0.033547, -0.284365852941176, 0.0743169117647059, 0.0361290441176471, -0.280367397058824, // f 31//31 32//32 45//45 0.0559305588235294, 0.0604765147058823, -0.280367397058824, 0.0520280147058823, 0.0561956323529412, -0.284365852941176, 0.0691314852941177, 0.033547, -0.284365852941176, // f 32//32 46//46 45//45 0.0520280147058823, 0.0561956323529412, -0.284365852941176, 0.0662033529411765, 0.0320889705882353, -0.290598308823529, 0.0691314852941177, 0.033547, -0.284365852941176, // f 32//32 33//33 46//46 0.0520280147058823, 0.0561956323529412, -0.284365852941176, 0.0498243235294118, 0.0537783088235294, -0.290598308823529, 0.0662033529411765, 0.0320889705882353, -0.290598308823529, // f 33//33 47//47 46//46 0.0498243235294118, 0.0537783088235294, -0.290598308823529, 0.0662033529411765, 0.0320889705882353, -0.297636985294118, 0.0662033529411765, 0.0320889705882353, -0.290598308823529, // f 33//33 34//34 47//47 0.0498243235294118, 0.0537783088235294, -0.290598308823529, 0.0498243382352941, 0.0537783088235294, -0.297637014705882, 0.0662033529411765, 0.0320889705882353, -0.297636985294118, // f 34//34 48//48 47//47 0.0498243382352941, 0.0537783088235294, -0.297637014705882, 0.0691314852941177, 0.033547, -0.303869441176471, 0.0662033529411765, 0.0320889705882353, -0.297636985294118, // f 34//34 35//35 48//48 0.0498243382352941, 0.0537783088235294, -0.297637014705882, 0.0520280147058823, 0.0561956323529412, -0.303869441176471, 0.0691314852941177, 0.033547, -0.303869441176471, // f 35//35 49//49 48//48 0.0520280147058823, 0.0561956323529412, -0.303869441176471, 0.0743169264705882, 0.0361290441176471, -0.307867897058824, 0.0691314852941177, 0.033547, -0.303869441176471, // f 35//35 36//36 49//49 0.0520280147058823, 0.0561956323529412, -0.303869441176471, 0.0559305588235294, 0.0604765147058823, -0.307867897058824, 0.0743169264705882, 0.0361290441176471, -0.307867897058824, // f 36//36 50//50 49//49 0.0559305588235294, 0.0604765147058823, -0.307867897058824, 0.0805717647058824, 0.0392435882352941, -0.308716294117647, 0.0743169264705882, 0.0361290441176471, -0.307867897058824, // f 36//36 37//37 50//50 0.0559305588235294, 0.0604765147058823, -0.307867897058824, 0.0606379264705882, 0.06564025, -0.308716294117647, 0.0805717647058824, 0.0392435882352941, -0.308716294117647, // f 37//37 51//51 50//50 0.0606379264705882, 0.06564025, -0.308716294117647, 0.0864631029411765, 0.0421771176470588, -0.306220367647059, 0.0805717647058824, 0.0392435882352941, -0.308716294117647, // f 37//37 38//38 51//51 0.0606379264705882, 0.06564025, -0.308716294117647, 0.0650717205882353, 0.0705038823529412, -0.306220367647059, 0.0864631029411765, 0.0421771176470588, -0.306220367647059, // f 38//38 52//52 51//51 0.0650717205882353, 0.0705038823529412, -0.306220367647059, 0.0906412941176471, 0.0442576176470588, -0.300951823529412, 0.0864631029411765, 0.0421771176470588, -0.306220367647059, // f 38//38 39//39 52//52 0.0650717205882353, 0.0705038823529412, -0.306220367647059, 0.0682161911764706, 0.0739532205882353, -0.300951823529412, 0.0906412941176471, 0.0442576176470588, -0.300951823529412, // f 39//39 40//41 52//52 0.0682161911764706, 0.0739532205882353, -0.300951823529412, 0.0921491617647059, 0.0450084411764706, -0.294117647058824, 0.0906412941176471, 0.0442576176470588, -0.300951823529412, // f 39//39 27//28 40//41 0.0682161911764706, 0.0739532205882353, -0.300951823529412, 0.0693510147058823, 0.0751980588235294, -0.294117647058824, 0.0921491617647059, 0.0450084411764706, -0.294117647058824, // f 40//41 54//53 53//54 0.0921491617647059, 0.0450084411764706, -0.294117647058824, 0.100824764705882, 0.00846641176470588, -0.287283470588235, 0.102502044117647, 0.00862183823529412, -0.294117647058824, // f 40//41 41//40 54//53 0.0921491617647059, 0.0450084411764706, -0.294117647058824, 0.0906412941176471, 0.0442576176470588, -0.287283470588235, 0.100824764705882, 0.00846641176470588, -0.287283470588235, // f 41//40 55//55 54//53 0.0906412941176471, 0.0442576176470588, -0.287283470588235, 0.0961771470588235, 0.00803575, -0.282014926470588, 0.100824764705882, 0.00846641176470588, -0.287283470588235, // f 41//40 42//42 55//55 0.0906412941176471, 0.0442576176470588, -0.287283470588235, 0.0864630882352941, 0.0421771176470588, -0.282014955882353, 0.0961771470588235, 0.00803575, -0.282014926470588, // f 42//42 56//56 55//55 0.0864630882352941, 0.0421771176470588, -0.282014955882353, 0.0896239411764706, 0.0074285, -0.279519, 0.0961771470588235, 0.00803575, -0.282014926470588, // f 42//42 43//43 56//56 0.0864630882352941, 0.0421771176470588, -0.282014955882353, 0.0805717647058824, 0.0392435882352941, -0.279519, 0.0896239411764706, 0.0074285, -0.279519, // f 43//43 57//57 56//56 0.0805717647058824, 0.0392435882352941, -0.279519, 0.0826663676470588, 0.00678377941176471, -0.280367397058824, 0.0896239411764706, 0.0074285, -0.279519, // f 43//43 44//44 57//57 0.0805717647058824, 0.0392435882352941, -0.279519, 0.0743169117647059, 0.0361290441176471, -0.280367397058824, 0.0826663676470588, 0.00678377941176471, -0.280367397058824, // f 44//44 58//58 57//57 0.0743169117647059, 0.0361290441176471, -0.280367397058824, 0.0768983382352941, 0.00624929411764706, -0.284365852941176, 0.0826663676470588, 0.00678377941176471, -0.280367397058824, // f 44//44 45//45 58//58 0.0743169117647059, 0.0361290441176471, -0.280367397058824, 0.0691314852941177, 0.033547, -0.284365852941176, 0.0768983382352941, 0.00624929411764706, -0.284365852941176, // f 45//45 59//59 58//58 0.0691314852941177, 0.033547, -0.284365852941176, 0.07364125, 0.00594748529411765, -0.290598308823529, 0.0768983382352941, 0.00624929411764706, -0.284365852941176, // f 45//45 46//46 59//59 0.0691314852941177, 0.033547, -0.284365852941176, 0.0662033529411765, 0.0320889705882353, -0.290598308823529, 0.07364125, 0.00594748529411765, -0.290598308823529, // f 46//46 60//60 59//59 0.0662033529411765, 0.0320889705882353, -0.290598308823529, 0.07364125, 0.00594748529411765, -0.297636985294118, 0.07364125, 0.00594748529411765, -0.290598308823529, // f 46//46 47//47 60//60 0.0662033529411765, 0.0320889705882353, -0.290598308823529, 0.0662033529411765, 0.0320889705882353, -0.297636985294118, 0.07364125, 0.00594748529411765, -0.297636985294118, // f 47//47 61//61 60//60 0.0662033529411765, 0.0320889705882353, -0.297636985294118, 0.0768983382352941, 0.00624929411764706, -0.303869441176471, 0.07364125, 0.00594748529411765, -0.297636985294118, // f 47//47 48//48 61//61 0.0662033529411765, 0.0320889705882353, -0.297636985294118, 0.0691314852941177, 0.033547, -0.303869441176471, 0.0768983382352941, 0.00624929411764706, -0.303869441176471, // f 48//48 62//62 61//61 0.0691314852941177, 0.033547, -0.303869441176471, 0.0826663676470588, 0.00678377941176471, -0.307867897058824, 0.0768983382352941, 0.00624929411764706, -0.303869441176471, // f 48//48 49//49 62//62 0.0691314852941177, 0.033547, -0.303869441176471, 0.0743169264705882, 0.0361290441176471, -0.307867897058824, 0.0826663676470588, 0.00678377941176471, -0.307867897058824, // f 49//49 63//63 62//62 0.0743169264705882, 0.0361290441176471, -0.307867897058824, 0.0896239411764706, 0.0074285, -0.308716294117647, 0.0826663676470588, 0.00678377941176471, -0.307867897058824, // f 49//49 50//50 63//63 0.0743169264705882, 0.0361290441176471, -0.307867897058824, 0.0805717647058824, 0.0392435882352941, -0.308716294117647, 0.0896239411764706, 0.0074285, -0.308716294117647, // f 50//50 64//64 63//63 0.0805717647058824, 0.0392435882352941, -0.308716294117647, 0.0961771617647059, 0.00803575, -0.306220338235294, 0.0896239411764706, 0.0074285, -0.308716294117647, // f 50//50 51//51 64//64 0.0805717647058824, 0.0392435882352941, -0.308716294117647, 0.0864631029411765, 0.0421771176470588, -0.306220367647059, 0.0961771617647059, 0.00803575, -0.306220338235294, // f 51//51 65//65 64//64 0.0864631029411765, 0.0421771176470588, -0.306220367647059, 0.100824764705882, 0.00846641176470588, -0.300951823529412, 0.0961771617647059, 0.00803575, -0.306220338235294, // f 51//51 52//52 65//65 0.0864631029411765, 0.0421771176470588, -0.306220367647059, 0.0906412941176471, 0.0442576176470588, -0.300951823529412, 0.100824764705882, 0.00846641176470588, -0.300951823529412, // f 52//52 53//54 65//65 0.0906412941176471, 0.0442576176470588, -0.300951823529412, 0.102502044117647, 0.00862183823529412, -0.294117647058824, 0.100824764705882, 0.00846641176470588, -0.300951823529412, // f 52//52 40//41 53//54 0.0906412941176471, 0.0442576176470588, -0.300951823529412, 0.0921491617647059, 0.0450084411764706, -0.294117647058824, 0.102502044117647, 0.00862183823529412, -0.294117647058824, // f 53//54 67//66 66//67 0.102502044117647, 0.00862183823529412, -0.294117647058824, 0.097391294117647, -0.0285865882352941, -0.287283470588235, 0.0990114705882353, -0.0290475735294118, -0.294117647058824, // f 53//54 54//53 67//66 0.102502044117647, 0.00862183823529412, -0.294117647058824, 0.100824764705882, 0.00846641176470588, -0.287283470588235, 0.097391294117647, -0.0285865882352941, -0.287283470588235, // f 54//53 68//68 67//66 0.100824764705882, 0.00846641176470588, -0.287283470588235, 0.0929019558823529, -0.0273092647058824, -0.282014926470588, 0.097391294117647, -0.0285865882352941, -0.287283470588235, // f 54//53 55//55 68//68 0.100824764705882, 0.00846641176470588, -0.287283470588235, 0.0961771470588235, 0.00803575, -0.282014926470588, 0.0929019558823529, -0.0273092647058824, -0.282014926470588, // f 55//55 69//69 68//68 0.0961771470588235, 0.00803575, -0.282014926470588, 0.0865718970588235, -0.0255082058823529, -0.279519, 0.0929019558823529, -0.0273092647058824, -0.282014926470588, // f 55//55 56//56 69//69 0.0961771470588235, 0.00803575, -0.282014926470588, 0.0896239411764706, 0.0074285, -0.279519, 0.0865718970588235, -0.0255082058823529, -0.279519, // f 56//56 70//70 69//69 0.0896239411764706, 0.0074285, -0.279519, 0.0798512647058823, -0.0235960147058824, -0.280367397058824, 0.0865718970588235, -0.0255082058823529, -0.279519, // f 56//56 57//57 70//70 0.0896239411764706, 0.0074285, -0.279519, 0.0826663676470588, 0.00678377941176471, -0.280367397058824, 0.0798512647058823, -0.0235960147058824, -0.280367397058824, // f 57//57 71//71 70//70 0.0826663676470588, 0.00678377941176471, -0.280367397058824, 0.0742796617647059, -0.0220107647058824, -0.284365852941176, 0.0798512647058823, -0.0235960147058824, -0.280367397058824, // f 57//57 58//58 71//71 0.0826663676470588, 0.00678377941176471, -0.280367397058824, 0.0768983382352941, 0.00624929411764706, -0.284365852941176, 0.0742796617647059, -0.0220107647058824, -0.284365852941176, // f 58//58 72//72 71//71 0.0768983382352941, 0.00624929411764706, -0.284365852941176, 0.0711334852941176, -0.0211156029411765, -0.290598308823529, 0.0742796617647059, -0.0220107647058824, -0.284365852941176, // f 58//58 59//59 72//72 0.0768983382352941, 0.00624929411764706, -0.284365852941176, 0.07364125, 0.00594748529411765, -0.290598308823529, 0.0711334852941176, -0.0211156029411765, -0.290598308823529, // f 59//59 73//73 72//72 0.07364125, 0.00594748529411765, -0.290598308823529, 0.0711334852941176, -0.0211156029411765, -0.297636985294118, 0.0711334852941176, -0.0211156029411765, -0.290598308823529, // f 59//59 60//60 73//73 0.07364125, 0.00594748529411765, -0.290598308823529, 0.07364125, 0.00594748529411765, -0.297636985294118, 0.0711334852941176, -0.0211156029411765, -0.297636985294118, // f 60//60 74//74 73//73 0.07364125, 0.00594748529411765, -0.297636985294118, 0.0742796617647059, -0.0220107647058824, -0.303869441176471, 0.0711334852941176, -0.0211156029411765, -0.297636985294118, // f 60//60 61//61 74//74 0.07364125, 0.00594748529411765, -0.297636985294118, 0.0768983382352941, 0.00624929411764706, -0.303869441176471, 0.0742796617647059, -0.0220107647058824, -0.303869441176471, // f 61//61 75//75 74//74 0.0768983382352941, 0.00624929411764706, -0.303869441176471, 0.0798512647058823, -0.0235960294117647, -0.307867897058824, 0.0742796617647059, -0.0220107647058824, -0.303869441176471, // f 61//61 62//62 75//75 0.0768983382352941, 0.00624929411764706, -0.303869441176471, 0.0826663676470588, 0.00678377941176471, -0.307867897058824, 0.0798512647058823, -0.0235960294117647, -0.307867897058824, // f 62//62 76//76 75//75 0.0826663676470588, 0.00678377941176471, -0.307867897058824, 0.0865718970588235, -0.0255082058823529, -0.308716294117647, 0.0798512647058823, -0.0235960294117647, -0.307867897058824, // f 62//62 63//63 76//76 0.0826663676470588, 0.00678377941176471, -0.307867897058824, 0.0896239411764706, 0.0074285, -0.308716294117647, 0.0865718970588235, -0.0255082058823529, -0.308716294117647, // f 63//63 77//77 76//76 0.0896239411764706, 0.0074285, -0.308716294117647, 0.0929019558823529, -0.0273092647058824, -0.306220338235294, 0.0865718970588235, -0.0255082058823529, -0.308716294117647, // f 63//63 64//64 77//77 0.0896239411764706, 0.0074285, -0.308716294117647, 0.0961771617647059, 0.00803575, -0.306220338235294, 0.0929019558823529, -0.0273092647058824, -0.306220338235294, // f 64//64 78//78 77//77 0.0961771617647059, 0.00803575, -0.306220338235294, 0.0973913088235294, -0.0285865882352941, -0.300951823529412, 0.0929019558823529, -0.0273092647058824, -0.306220338235294, // f 64//64 65//65 78//78 0.0961771617647059, 0.00803575, -0.306220338235294, 0.100824764705882, 0.00846641176470588, -0.300951823529412, 0.0973913088235294, -0.0285865882352941, -0.300951823529412, // f 65//65 66//67 78//78 0.100824764705882, 0.00846641176470588, -0.300951823529412, 0.0990114705882353, -0.0290475735294118, -0.294117647058824, 0.0973913088235294, -0.0285865882352941, -0.300951823529412, // f 65//65 53//54 66//67 0.100824764705882, 0.00846641176470588, -0.300951823529412, 0.102502044117647, 0.00862183823529412, -0.294117647058824, 0.0990114705882353, -0.0290475735294118, -0.294117647058824, // f 66//67 80//79 79//80 0.0990114705882353, -0.0290475735294118, -0.294117647058824, 0.0808046029411765, -0.0618971764705882, -0.287283470588235, 0.0821488382352941, -0.0629122941176471, -0.294117647058824, // f 66//67 67//66 80//79 0.0990114705882353, -0.0290475735294118, -0.294117647058824, 0.097391294117647, -0.0285865882352941, -0.287283470588235, 0.0808046029411765, -0.0618971764705882, -0.287283470588235, // f 67//66 81//81 80//79 0.097391294117647, -0.0285865882352941, -0.287283470588235, 0.0770798382352941, -0.0590843676470588, -0.282014926470588, 0.0808046029411765, -0.0618971764705882, -0.287283470588235, // f 67//66 68//68 81//81 0.097391294117647, -0.0285865882352941, -0.287283470588235, 0.0929019558823529, -0.0273092647058824, -0.282014926470588, 0.0770798382352941, -0.0590843676470588, -0.282014926470588, // f 68//68 82//82 81//81 0.0929019558823529, -0.0273092647058824, -0.282014926470588, 0.0718278529411765, -0.05511825, -0.279519, 0.0770798382352941, -0.0590843676470588, -0.282014926470588, // f 68//68 69//69 82//82 0.0929019558823529, -0.0273092647058824, -0.282014926470588, 0.0865718970588235, -0.0255082058823529, -0.279519, 0.0718278529411765, -0.05511825, -0.279519, // f 69//69 83//83 82//82 0.0865718970588235, -0.0255082058823529, -0.279519, 0.0662518088235294, -0.0509074117647059, -0.280367397058824, 0.0718278529411765, -0.05511825, -0.279519, // f 69//69 70//70 83//83 0.0865718970588235, -0.0255082058823529, -0.279519, 0.0798512647058823, -0.0235960147058824, -0.280367397058824, 0.0662518088235294, -0.0509074117647059, -0.280367397058824, // f 70//70 84//84 83//83 0.0798512647058823, -0.0235960147058824, -0.280367397058824, 0.0616291029411765, -0.0474165147058824, -0.284365852941176, 0.0662518088235294, -0.0509074117647059, -0.280367397058824, // f 70//70 71//71 84//84 0.0798512647058823, -0.0235960147058824, -0.280367397058824, 0.0742796617647059, -0.0220107647058824, -0.284365852941176, 0.0616291029411765, -0.0474165147058824, -0.284365852941176, // f 71//71 85//85 84//84 0.0742796617647059, -0.0220107647058824, -0.284365852941176, 0.05901875, -0.0454452647058824, -0.290598308823529, 0.0616291029411765, -0.0474165147058824, -0.284365852941176, // f 71//71 72//72 85//85 0.0742796617647059, -0.0220107647058824, -0.284365852941176, 0.0711334852941176, -0.0211156029411765, -0.290598308823529, 0.05901875, -0.0454452647058824, -0.290598308823529, // f 72//72 86//86 85//85 0.0711334852941176, -0.0211156029411765, -0.290598308823529, 0.05901875, -0.0454452647058824, -0.297636985294118, 0.05901875, -0.0454452647058824, -0.290598308823529, // f 72//72 73//73 86//86 0.0711334852941176, -0.0211156029411765, -0.290598308823529, 0.0711334852941176, -0.0211156029411765, -0.297636985294118, 0.05901875, -0.0454452647058824, -0.297636985294118, // f 73//73 87//87 86//86 0.0711334852941176, -0.0211156029411765, -0.297636985294118, 0.0616291029411765, -0.0474165147058824, -0.303869441176471, 0.05901875, -0.0454452647058824, -0.297636985294118, // f 73//73 74//74 87//87 0.0711334852941176, -0.0211156029411765, -0.297636985294118, 0.0742796617647059, -0.0220107647058824, -0.303869441176471, 0.0616291029411765, -0.0474165147058824, -0.303869441176471, // f 74//74 88//88 87//87 0.0742796617647059, -0.0220107647058824, -0.303869441176471, 0.0662518088235294, -0.0509074264705882, -0.307867897058824, 0.0616291029411765, -0.0474165147058824, -0.303869441176471, // f 74//74 75//75 88//88 0.0742796617647059, -0.0220107647058824, -0.303869441176471, 0.0798512647058823, -0.0235960294117647, -0.307867897058824, 0.0662518088235294, -0.0509074264705882, -0.307867897058824, // f 75//75 89//89 88//88 0.0798512647058823, -0.0235960294117647, -0.307867897058824, 0.0718278529411765, -0.05511825, -0.308716294117647, 0.0662518088235294, -0.0509074264705882, -0.307867897058824, // f 75//75 76//76 89//89 0.0798512647058823, -0.0235960294117647, -0.307867897058824, 0.0865718970588235, -0.0255082058823529, -0.308716294117647, 0.0718278529411765, -0.05511825, -0.308716294117647, // f 76//76 90//90 89//89 0.0865718970588235, -0.0255082058823529, -0.308716294117647, 0.0770798382352941, -0.0590843676470588, -0.306220338235294, 0.0718278529411765, -0.05511825, -0.308716294117647, // f 76//76 77//77 90//90 0.0865718970588235, -0.0255082058823529, -0.308716294117647, 0.0929019558823529, -0.0273092647058824, -0.306220338235294, 0.0770798382352941, -0.0590843676470588, -0.306220338235294, // f 77//77 91//91 90//90 0.0929019558823529, -0.0273092647058824, -0.306220338235294, 0.0808046029411765, -0.0618971764705882, -0.300951823529412, 0.0770798382352941, -0.0590843676470588, -0.306220338235294, // f 77//77 78//78 91//91 0.0929019558823529, -0.0273092647058824, -0.306220338235294, 0.0973913088235294, -0.0285865882352941, -0.300951823529412, 0.0808046029411765, -0.0618971764705882, -0.300951823529412, // f 78//78 79//80 91//91 0.0973913088235294, -0.0285865882352941, -0.300951823529412, 0.0821488382352941, -0.0629122941176471, -0.294117647058824, 0.0808046029411765, -0.0618971764705882, -0.300951823529412, // f 78//78 66//67 79//80 0.0973913088235294, -0.0285865882352941, -0.300951823529412, 0.0990114705882353, -0.0290475735294118, -0.294117647058824, 0.0821488382352941, -0.0629122941176471, -0.294117647058824, // f 79//80 93//92 92//93 0.0821488382352941, -0.0629122941176471, -0.294117647058824, 0.0533047941176471, -0.0869665588235294, -0.287283470588235, 0.0541915441176471, -0.0883987352941177, -0.294117647058824, // f 79//80 80//79 93//92 0.0821488382352941, -0.0629122941176471, -0.294117647058824, 0.0808046029411765, -0.0618971764705882, -0.287283470588235, 0.0533047941176471, -0.0869665588235294, -0.287283470588235, // f 80//79 94//94 93//92 0.0808046029411765, -0.0618971764705882, -0.287283470588235, 0.0508476617647059, -0.0829981617647059, -0.282014926470588, 0.0533047941176471, -0.0869665588235294, -0.287283470588235, // f 80//79 81//81 94//94 0.0808046029411765, -0.0618971764705882, -0.287283470588235, 0.0770798382352941, -0.0590843676470588, -0.282014926470588, 0.0508476617647059, -0.0829981617647059, -0.282014926470588, // f 81//81 95//95 94//94 0.0770798382352941, -0.0590843676470588, -0.282014926470588, 0.0473830588235294, -0.0774026323529412, -0.279519, 0.0508476617647059, -0.0829981617647059, -0.282014926470588, // f 81//81 82//82 95//95 0.0770798382352941, -0.0590843676470588, -0.282014926470588, 0.0718278529411765, -0.05511825, -0.279519, 0.0473830588235294, -0.0774026323529412, -0.279519, // f 82//82 96//96 95//95 0.0718278529411765, -0.05511825, -0.279519, 0.0437046764705882, -0.0714618382352941, -0.280367397058824, 0.0473830588235294, -0.0774026323529412, -0.279519, // f 82//82 83//83 96//96 0.0718278529411765, -0.05511825, -0.279519, 0.0662518088235294, -0.0509074117647059, -0.280367397058824, 0.0437046764705882, -0.0714618382352941, -0.280367397058824, // f 83//83 97//97 96//96 0.0662518088235294, -0.0509074117647059, -0.280367397058824, 0.0406551911764706, -0.06653675, -0.284365852941176, 0.0437046764705882, -0.0714618382352941, -0.280367397058824, // f 83//83 84//84 97//97 0.0662518088235294, -0.0509074117647059, -0.280367397058824, 0.0616291029411765, -0.0474165147058824, -0.284365852941176, 0.0406551911764706, -0.06653675, -0.284365852941176, // f 84//84 98//98 97//97 0.0616291029411765, -0.0474165147058824, -0.284365852941176, 0.0389332058823529, -0.0637556617647059, -0.290598308823529, 0.0406551911764706, -0.06653675, -0.284365852941176, // f 84//84 85//85 98//98 0.0616291029411765, -0.0474165147058824, -0.284365852941176, 0.05901875, -0.0454452647058824, -0.290598308823529, 0.0389332058823529, -0.0637556617647059, -0.290598308823529, // f 85//85 99//99 98//98 0.05901875, -0.0454452647058824, -0.290598308823529, 0.0389332058823529, -0.0637556617647059, -0.297636985294118, 0.0389332058823529, -0.0637556617647059, -0.290598308823529, // f 85//85 86//86 99//99 0.05901875, -0.0454452647058824, -0.290598308823529, 0.05901875, -0.0454452647058824, -0.297636985294118, 0.0389332058823529, -0.0637556617647059, -0.297636985294118, // f 86//86 100//100 99//99 0.05901875, -0.0454452647058824, -0.297636985294118, 0.0406551911764706, -0.0665367647058824, -0.303869441176471, 0.0389332058823529, -0.0637556617647059, -0.297636985294118, // f 86//86 87//87 100//100 0.05901875, -0.0454452647058824, -0.297636985294118, 0.0616291029411765, -0.0474165147058824, -0.303869441176471, 0.0406551911764706, -0.0665367647058824, -0.303869441176471, // f 87//87 101//101 100//100 0.0616291029411765, -0.0474165147058824, -0.303869441176471, 0.0437046764705882, -0.0714618529411765, -0.307867897058824, 0.0406551911764706, -0.0665367647058824, -0.303869441176471, // f 87//87 88//88 101//101 0.0616291029411765, -0.0474165147058824, -0.303869441176471, 0.0662518088235294, -0.0509074264705882, -0.307867897058824, 0.0437046764705882, -0.0714618529411765, -0.307867897058824, // f 88//88 102//102 101//101 0.0662518088235294, -0.0509074264705882, -0.307867897058824, 0.0473830588235294, -0.0774026323529412, -0.308716294117647, 0.0437046764705882, -0.0714618529411765, -0.307867897058824, // f 88//88 89//89 102//102 0.0662518088235294, -0.0509074264705882, -0.307867897058824, 0.0718278529411765, -0.05511825, -0.308716294117647, 0.0473830588235294, -0.0774026323529412, -0.308716294117647, // f 89//89 103//103 102//102 0.0718278529411765, -0.05511825, -0.308716294117647, 0.0508476617647059, -0.0829981617647059, -0.306220338235294, 0.0473830588235294, -0.0774026323529412, -0.308716294117647, // f 89//89 90//90 103//103 0.0718278529411765, -0.05511825, -0.308716294117647, 0.0770798382352941, -0.0590843676470588, -0.306220338235294, 0.0508476617647059, -0.0829981617647059, -0.306220338235294, // f 90//90 104//104 103//103 0.0770798382352941, -0.0590843676470588, -0.306220338235294, 0.0533047941176471, -0.0869665588235294, -0.300951794117647, 0.0508476617647059, -0.0829981617647059, -0.306220338235294, // f 90//90 91//91 104//104 0.0770798382352941, -0.0590843676470588, -0.306220338235294, 0.0808046029411765, -0.0618971764705882, -0.300951823529412, 0.0533047941176471, -0.0869665588235294, -0.300951794117647, // f 91//91 92//93 104//104 0.0808046029411765, -0.0618971764705882, -0.300951823529412, 0.0541915441176471, -0.0883987352941177, -0.294117647058824, 0.0533047941176471, -0.0869665588235294, -0.300951794117647, // f 91//91 79//80 92//93 0.0808046029411765, -0.0618971764705882, -0.300951823529412, 0.0821488382352941, -0.0629122941176471, -0.294117647058824, 0.0541915441176471, -0.0883987352941177, -0.294117647058824, // f 92//93 106//105 105//106 0.0541915441176471, -0.0883987352941177, -0.294117647058824, 0.0186058823529412, -0.100409, -0.287283470588235, 0.0189153970588235, -0.102064779411765, -0.294117647058824, // f 92//93 93//92 106//105 0.0541915441176471, -0.0883987352941177, -0.294117647058824, 0.0533047941176471, -0.0869665588235294, -0.287283470588235, 0.0186058823529412, -0.100409, -0.287283470588235, // f 93//92 107//107 106//105 0.0533047941176471, -0.0869665588235294, -0.287283470588235, 0.0177482205882353, -0.0958209558823529, -0.282014926470588, 0.0186058823529412, -0.100409, -0.287283470588235, // f 93//92 94//94 107//107 0.0533047941176471, -0.0869665588235294, -0.287283470588235, 0.0508476617647059, -0.0829981617647059, -0.282014926470588, 0.0177482205882353, -0.0958209558823529, -0.282014926470588, // f 94//94 108//108 107//107 0.0508476617647059, -0.0829981617647059, -0.282014926470588, 0.0165389117647059, -0.0893517205882353, -0.279518970588235, 0.0177482205882353, -0.0958209558823529, -0.282014926470588, // f 94//94 95//95 108//108 0.0508476617647059, -0.0829981617647059, -0.282014926470588, 0.0473830588235294, -0.0774026323529412, -0.279519, 0.0165389117647059, -0.0893517205882353, -0.279518970588235, // f 95//95 109//109 108//108 0.0473830588235294, -0.0774026323529412, -0.279519, 0.0152549852941176, -0.0824833088235294, -0.280367397058824, 0.0165389117647059, -0.0893517205882353, -0.279518970588235, // f 95//95 96//96 109//109 0.0473830588235294, -0.0774026323529412, -0.279519, 0.0437046764705882, -0.0714618382352941, -0.280367397058824, 0.0152549852941176, -0.0824833088235294, -0.280367397058824, // f 96//96 110//110 109//109 0.0437046764705882, -0.0714618382352941, -0.280367397058824, 0.0141905735294118, -0.0767892058823529, -0.284365852941176, 0.0152549852941176, -0.0824833088235294, -0.280367397058824, // f 96//96 97//97 110//110 0.0437046764705882, -0.0714618382352941, -0.280367397058824, 0.0406551911764706, -0.06653675, -0.284365852941176, 0.0141905735294118, -0.0767892058823529, -0.284365852941176, // f 97//97 111//111 110//110 0.0406551911764706, -0.06653675, -0.284365852941176, 0.0135895147058824, -0.0735738676470588, -0.290598308823529, 0.0141905735294118, -0.0767892058823529, -0.284365852941176, // f 97//97 98//98 111//111 0.0406551911764706, -0.06653675, -0.284365852941176, 0.0389332058823529, -0.0637556617647059, -0.290598308823529, 0.0135895147058824, -0.0735738676470588, -0.290598308823529, // f 98//98 112//112 111//111 0.0389332058823529, -0.0637556617647059, -0.290598308823529, 0.0135895147058824, -0.0735738676470588, -0.297636985294118, 0.0135895147058824, -0.0735738676470588, -0.290598308823529, // f 98//98 99//99 112//112 0.0389332058823529, -0.0637556617647059, -0.290598308823529, 0.0389332058823529, -0.0637556617647059, -0.297636985294118, 0.0135895147058824, -0.0735738676470588, -0.297636985294118, // f 99//99 113//113 112//112 0.0389332058823529, -0.0637556617647059, -0.297636985294118, 0.0141905735294118, -0.0767892058823529, -0.303869441176471, 0.0135895147058824, -0.0735738676470588, -0.297636985294118, // f 99//99 100//100 113//113 0.0389332058823529, -0.0637556617647059, -0.297636985294118, 0.0406551911764706, -0.0665367647058824, -0.303869441176471, 0.0141905735294118, -0.0767892058823529, -0.303869441176471, // f 100//100 114//114 113//113 0.0406551911764706, -0.0665367647058824, -0.303869441176471, 0.0152549852941176, -0.0824833088235294, -0.307867897058824, 0.0141905735294118, -0.0767892058823529, -0.303869441176471, // f 100//100 101//101 114//114 0.0406551911764706, -0.0665367647058824, -0.303869441176471, 0.0437046764705882, -0.0714618529411765, -0.307867897058824, 0.0152549852941176, -0.0824833088235294, -0.307867897058824, // f 101//101 115//115 114//114 0.0437046764705882, -0.0714618529411765, -0.307867897058824, 0.0165389117647059, -0.0893517205882353, -0.308716294117647, 0.0152549852941176, -0.0824833088235294, -0.307867897058824, // f 101//101 102//102 115//115 0.0437046764705882, -0.0714618529411765, -0.307867897058824, 0.0473830588235294, -0.0774026323529412, -0.308716294117647, 0.0165389117647059, -0.0893517205882353, -0.308716294117647, // f 102//102 116//116 115//115 0.0473830588235294, -0.0774026323529412, -0.308716294117647, 0.0177482205882353, -0.0958209558823529, -0.306220338235294, 0.0165389117647059, -0.0893517205882353, -0.308716294117647, // f 102//102 103//103 116//116 0.0473830588235294, -0.0774026323529412, -0.308716294117647, 0.0508476617647059, -0.0829981617647059, -0.306220338235294, 0.0177482205882353, -0.0958209558823529, -0.306220338235294, // f 103//103 117//117 116//116 0.0508476617647059, -0.0829981617647059, -0.306220338235294, 0.0186058823529412, -0.100409, -0.300951794117647, 0.0177482205882353, -0.0958209558823529, -0.306220338235294, // f 103//103 104//104 117//117 0.0508476617647059, -0.0829981617647059, -0.306220338235294, 0.0533047941176471, -0.0869665588235294, -0.300951794117647, 0.0186058823529412, -0.100409, -0.300951794117647, // f 104//104 105//106 117//117 0.0533047941176471, -0.0869665588235294, -0.300951794117647, 0.0189153970588235, -0.102064779411765, -0.294117647058824, 0.0186058823529412, -0.100409, -0.300951794117647, // f 104//104 92//93 105//106 0.0533047941176471, -0.0869665588235294, -0.300951794117647, 0.0541915441176471, -0.0883987352941177, -0.294117647058824, 0.0189153970588235, -0.102064779411765, -0.294117647058824, // f 105//106 119//118 118//119 0.0189153970588235, -0.102064779411765, -0.294117647058824, -0.0186058676470588, -0.100409, -0.287283470588235, -0.0189153823529412, -0.102064779411765, -0.294117647058824, // f 105//106 106//105 119//118 0.0189153970588235, -0.102064779411765, -0.294117647058824, 0.0186058823529412, -0.100409, -0.287283470588235, -0.0186058676470588, -0.100409, -0.287283470588235, // f 106//105 120//120 119//118 0.0186058823529412, -0.100409, -0.287283470588235, -0.0177482058823529, -0.0958209558823529, -0.282014926470588, -0.0186058676470588, -0.100409, -0.287283470588235, // f 106//105 107//107 120//120 0.0186058823529412, -0.100409, -0.287283470588235, 0.0177482205882353, -0.0958209558823529, -0.282014926470588, -0.0177482058823529, -0.0958209558823529, -0.282014926470588, // f 107//107 121//121 120//120 0.0177482205882353, -0.0958209558823529, -0.282014926470588, -0.0165388970588235, -0.0893517205882353, -0.279518970588235, -0.0177482058823529, -0.0958209558823529, -0.282014926470588, // f 107//107 108//108 121//121 0.0177482205882353, -0.0958209558823529, -0.282014926470588, 0.0165389117647059, -0.0893517205882353, -0.279518970588235, -0.0165388970588235, -0.0893517205882353, -0.279518970588235, // f 108//108 122//122 121//121 0.0165389117647059, -0.0893517205882353, -0.279518970588235, -0.0152549705882353, -0.0824833088235294, -0.280367397058824, -0.0165388970588235, -0.0893517205882353, -0.279518970588235, // f 108//108 109//109 122//122 0.0165389117647059, -0.0893517205882353, -0.279518970588235, 0.0152549852941176, -0.0824833088235294, -0.280367397058824, -0.0152549705882353, -0.0824833088235294, -0.280367397058824, // f 109//109 123//123 122//122 0.0152549852941176, -0.0824833088235294, -0.280367397058824, -0.0141905588235294, -0.0767892058823529, -0.284365852941176, -0.0152549705882353, -0.0824833088235294, -0.280367397058824, // f 109//109 110//110 123//123 0.0152549852941176, -0.0824833088235294, -0.280367397058824, 0.0141905735294118, -0.0767892058823529, -0.284365852941176, -0.0141905588235294, -0.0767892058823529, -0.284365852941176, // f 110//110 124//124 123//123 0.0141905735294118, -0.0767892058823529, -0.284365852941176, -0.0135895147058824, -0.0735738676470588, -0.290598308823529, -0.0141905588235294, -0.0767892058823529, -0.284365852941176, // f 110//110 111//111 124//124 0.0141905735294118, -0.0767892058823529, -0.284365852941176, 0.0135895147058824, -0.0735738676470588, -0.290598308823529, -0.0135895147058824, -0.0735738676470588, -0.290598308823529, // f 111//111 125//125 124//124 0.0135895147058824, -0.0735738676470588, -0.290598308823529, -0.0135895147058824, -0.0735738676470588, -0.297636985294118, -0.0135895147058824, -0.0735738676470588, -0.290598308823529, // f 111//111 112//112 125//125 0.0135895147058824, -0.0735738676470588, -0.290598308823529, 0.0135895147058824, -0.0735738676470588, -0.297636985294118, -0.0135895147058824, -0.0735738676470588, -0.297636985294118, // f 112//112 126//126 125//125 0.0135895147058824, -0.0735738676470588, -0.297636985294118, -0.0141905588235294, -0.0767892058823529, -0.303869441176471, -0.0135895147058824, -0.0735738676470588, -0.297636985294118, // f 112//112 113//113 126//126 0.0135895147058824, -0.0735738676470588, -0.297636985294118, 0.0141905735294118, -0.0767892058823529, -0.303869441176471, -0.0141905588235294, -0.0767892058823529, -0.303869441176471, // f 113//113 127//127 126//126 0.0141905735294118, -0.0767892058823529, -0.303869441176471, -0.0152549705882353, -0.0824833088235294, -0.307867897058824, -0.0141905588235294, -0.0767892058823529, -0.303869441176471, // f 113//113 114//114 127//127 0.0141905735294118, -0.0767892058823529, -0.303869441176471, 0.0152549852941176, -0.0824833088235294, -0.307867897058824, -0.0152549705882353, -0.0824833088235294, -0.307867897058824, // f 114//114 128//128 127//127 0.0152549852941176, -0.0824833088235294, -0.307867897058824, -0.0165388970588235, -0.0893517205882353, -0.308716294117647, -0.0152549705882353, -0.0824833088235294, -0.307867897058824, // f 114//114 115//115 128//128 0.0152549852941176, -0.0824833088235294, -0.307867897058824, 0.0165389117647059, -0.0893517205882353, -0.308716294117647, -0.0165388970588235, -0.0893517205882353, -0.308716294117647, // f 115//115 129//129 128//128 0.0165389117647059, -0.0893517205882353, -0.308716294117647, -0.0177482058823529, -0.0958209558823529, -0.306220338235294, -0.0165388970588235, -0.0893517205882353, -0.308716294117647, // f 115//115 116//116 129//129 0.0165389117647059, -0.0893517205882353, -0.308716294117647, 0.0177482205882353, -0.0958209558823529, -0.306220338235294, -0.0177482058823529, -0.0958209558823529, -0.306220338235294, // f 116//116 130//130 129//129 0.0177482205882353, -0.0958209558823529, -0.306220338235294, -0.0186058676470588, -0.100409, -0.300951794117647, -0.0177482058823529, -0.0958209558823529, -0.306220338235294, // f 116//116 117//117 130//130 0.0177482205882353, -0.0958209558823529, -0.306220338235294, 0.0186058823529412, -0.100409, -0.300951794117647, -0.0186058676470588, -0.100409, -0.300951794117647, // f 117//117 118//119 130//130 0.0186058823529412, -0.100409, -0.300951794117647, -0.0189153823529412, -0.102064779411765, -0.294117647058824, -0.0186058676470588, -0.100409, -0.300951794117647, // f 117//117 105//106 118//119 0.0186058823529412, -0.100409, -0.300951794117647, 0.0189153970588235, -0.102064779411765, -0.294117647058824, -0.0189153823529412, -0.102064779411765, -0.294117647058824, // f 118//119 132//131 131//132 -0.0189153823529412, -0.102064779411765, -0.294117647058824, -0.0533047794117647, -0.0869665588235294, -0.287283470588235, -0.0541915441176471, -0.0883987352941177, -0.294117647058824, // f 118//119 119//118 132//131 -0.0189153823529412, -0.102064779411765, -0.294117647058824, -0.0186058676470588, -0.100409, -0.287283470588235, -0.0533047794117647, -0.0869665588235294, -0.287283470588235, // f 119//118 133//133 132//131 -0.0186058676470588, -0.100409, -0.287283470588235, -0.0508476470588235, -0.0829981617647059, -0.282014926470588, -0.0533047794117647, -0.0869665588235294, -0.287283470588235, // f 119//118 120//120 133//133 -0.0186058676470588, -0.100409, -0.287283470588235, -0.0177482058823529, -0.0958209558823529, -0.282014926470588, -0.0508476470588235, -0.0829981617647059, -0.282014926470588, // f 120//120 134//134 133//133 -0.0177482058823529, -0.0958209558823529, -0.282014926470588, -0.0473830441176471, -0.0774026323529412, -0.279519, -0.0508476470588235, -0.0829981617647059, -0.282014926470588, // f 120//120 121//121 134//134 -0.0177482058823529, -0.0958209558823529, -0.282014926470588, -0.0165388970588235, -0.0893517205882353, -0.279518970588235, -0.0473830441176471, -0.0774026323529412, -0.279519, // f 121//121 135//135 134//134 -0.0165388970588235, -0.0893517205882353, -0.279518970588235, -0.0437046617647059, -0.0714618529411765, -0.280367397058824, -0.0473830441176471, -0.0774026323529412, -0.279519, // f 121//121 122//122 135//135 -0.0165388970588235, -0.0893517205882353, -0.279518970588235, -0.0152549705882353, -0.0824833088235294, -0.280367397058824, -0.0437046617647059, -0.0714618529411765, -0.280367397058824, // f 122//122 136//136 135//135 -0.0152549705882353, -0.0824833088235294, -0.280367397058824, -0.0406551764705882, -0.0665367647058824, -0.284365852941176, -0.0437046617647059, -0.0714618529411765, -0.280367397058824, // f 122//122 123//123 136//136 -0.0152549705882353, -0.0824833088235294, -0.280367397058824, -0.0141905588235294, -0.0767892058823529, -0.284365852941176, -0.0406551764705882, -0.0665367647058824, -0.284365852941176, // f 123//123 137//137 136//136 -0.0141905588235294, -0.0767892058823529, -0.284365852941176, -0.0389332058823529, -0.0637556617647059, -0.290598308823529, -0.0406551764705882, -0.0665367647058824, -0.284365852941176, // f 123//123 124//124 137//137 -0.0141905588235294, -0.0767892058823529, -0.284365852941176, -0.0135895147058824, -0.0735738676470588, -0.290598308823529, -0.0389332058823529, -0.0637556617647059, -0.290598308823529, // f 124//124 138//138 137//137 -0.0135895147058824, -0.0735738676470588, -0.290598308823529, -0.0389332058823529, -0.0637556617647059, -0.297636985294118, -0.0389332058823529, -0.0637556617647059, -0.290598308823529, // f 124//124 125//125 138//138 -0.0135895147058824, -0.0735738676470588, -0.290598308823529, -0.0135895147058824, -0.0735738676470588, -0.297636985294118, -0.0389332058823529, -0.0637556617647059, -0.297636985294118, // f 125//125 139//139 138//138 -0.0135895147058824, -0.0735738676470588, -0.297636985294118, -0.0406551911764706, -0.0665367647058824, -0.303869441176471, -0.0389332058823529, -0.0637556617647059, -0.297636985294118, // f 125//125 126//126 139//139 -0.0135895147058824, -0.0735738676470588, -0.297636985294118, -0.0141905588235294, -0.0767892058823529, -0.303869441176471, -0.0406551911764706, -0.0665367647058824, -0.303869441176471, // f 126//126 140//140 139//139 -0.0141905588235294, -0.0767892058823529, -0.303869441176471, -0.0437046617647059, -0.0714618529411765, -0.307867897058824, -0.0406551911764706, -0.0665367647058824, -0.303869441176471, // f 126//126 127//127 140//140 -0.0141905588235294, -0.0767892058823529, -0.303869441176471, -0.0152549705882353, -0.0824833088235294, -0.307867897058824, -0.0437046617647059, -0.0714618529411765, -0.307867897058824, // f 127//127 141//141 140//140 -0.0152549705882353, -0.0824833088235294, -0.307867897058824, -0.0473830441176471, -0.0774026323529412, -0.308716294117647, -0.0437046617647059, -0.0714618529411765, -0.307867897058824, // f 127//127 128//128 141//141 -0.0152549705882353, -0.0824833088235294, -0.307867897058824, -0.0165388970588235, -0.0893517205882353, -0.308716294117647, -0.0473830441176471, -0.0774026323529412, -0.308716294117647, // f 128//128 142//142 141//141 -0.0165388970588235, -0.0893517205882353, -0.308716294117647, -0.0508476470588235, -0.0829981617647059, -0.306220338235294, -0.0473830441176471, -0.0774026323529412, -0.308716294117647, // f 128//128 129//129 142//142 -0.0165388970588235, -0.0893517205882353, -0.308716294117647, -0.0177482058823529, -0.0958209558823529, -0.306220338235294, -0.0508476470588235, -0.0829981617647059, -0.306220338235294, // f 129//129 143//143 142//142 -0.0177482058823529, -0.0958209558823529, -0.306220338235294, -0.0533047794117647, -0.0869665735294118, -0.300951794117647, -0.0508476470588235, -0.0829981617647059, -0.306220338235294, // f 129//129 130//130 143//143 -0.0177482058823529, -0.0958209558823529, -0.306220338235294, -0.0186058676470588, -0.100409, -0.300951794117647, -0.0533047794117647, -0.0869665735294118, -0.300951794117647, // f 130//130 131//132 143//143 -0.0186058676470588, -0.100409, -0.300951794117647, -0.0541915441176471, -0.0883987352941177, -0.294117647058824, -0.0533047794117647, -0.0869665735294118, -0.300951794117647, // f 130//130 118//119 131//132 -0.0186058676470588, -0.100409, -0.300951794117647, -0.0189153823529412, -0.102064779411765, -0.294117647058824, -0.0541915441176471, -0.0883987352941177, -0.294117647058824, // f 131//132 145//144 144//145 -0.0541915441176471, -0.0883987352941177, -0.294117647058824, -0.0808045882352941, -0.0618971764705882, -0.287283470588235, -0.0821488382352941, -0.0629123088235294, -0.294117647058824, // f 131//132 132//131 145//144 -0.0541915441176471, -0.0883987352941177, -0.294117647058824, -0.0533047794117647, -0.0869665588235294, -0.287283470588235, -0.0808045882352941, -0.0618971764705882, -0.287283470588235, // f 132//131 146//146 145//144 -0.0533047794117647, -0.0869665588235294, -0.287283470588235, -0.0770798382352941, -0.0590843676470588, -0.282014926470588, -0.0808045882352941, -0.0618971764705882, -0.287283470588235, // f 132//131 133//133 146//146 -0.0533047794117647, -0.0869665588235294, -0.287283470588235, -0.0508476470588235, -0.0829981617647059, -0.282014926470588, -0.0770798382352941, -0.0590843676470588, -0.282014926470588, // f 133//133 147//147 146//146 -0.0508476470588235, -0.0829981617647059, -0.282014926470588, -0.0718278529411765, -0.05511825, -0.279519, -0.0770798382352941, -0.0590843676470588, -0.282014926470588, // f 133//133 134//134 147//147 -0.0508476470588235, -0.0829981617647059, -0.282014926470588, -0.0473830441176471, -0.0774026323529412, -0.279519, -0.0718278529411765, -0.05511825, -0.279519, // f 134//134 148//148 147//147 -0.0473830441176471, -0.0774026323529412, -0.279519, -0.0662517941176471, -0.0509074264705882, -0.280367397058824, -0.0718278529411765, -0.05511825, -0.279519, // f 134//134 135//135 148//148 -0.0473830441176471, -0.0774026323529412, -0.279519, -0.0437046617647059, -0.0714618529411765, -0.280367397058824, -0.0662517941176471, -0.0509074264705882, -0.280367397058824, // f 135//135 149//149 148//148 -0.0437046617647059, -0.0714618529411765, -0.280367397058824, -0.0616291029411765, -0.0474165147058824, -0.284365852941176, -0.0662517941176471, -0.0509074264705882, -0.280367397058824, // f 135//135 136//136 149//149 -0.0437046617647059, -0.0714618529411765, -0.280367397058824, -0.0406551764705882, -0.0665367647058824, -0.284365852941176, -0.0616291029411765, -0.0474165147058824, -0.284365852941176, // f 136//136 150//150 149//149 -0.0406551764705882, -0.0665367647058824, -0.284365852941176, -0.05901875, -0.0454452794117647, -0.290598308823529, -0.0616291029411765, -0.0474165147058824, -0.284365852941176, // f 136//136 137//137 150//150 -0.0406551764705882, -0.0665367647058824, -0.284365852941176, -0.0389332058823529, -0.0637556617647059, -0.290598308823529, -0.05901875, -0.0454452794117647, -0.290598308823529, // f 137//137 151//151 150//150 -0.0389332058823529, -0.0637556617647059, -0.290598308823529, -0.05901875, -0.0454452794117647, -0.297636985294118, -0.05901875, -0.0454452794117647, -0.290598308823529, // f 137//137 138//138 151//151 -0.0389332058823529, -0.0637556617647059, -0.290598308823529, -0.0389332058823529, -0.0637556617647059, -0.297636985294118, -0.05901875, -0.0454452794117647, -0.297636985294118, // f 138//138 152//152 151//151 -0.0389332058823529, -0.0637556617647059, -0.297636985294118, -0.0616291029411765, -0.0474165294117647, -0.303869441176471, -0.05901875, -0.0454452794117647, -0.297636985294118, // f 138//138 139//139 152//152 -0.0389332058823529, -0.0637556617647059, -0.297636985294118, -0.0406551911764706, -0.0665367647058824, -0.303869441176471, -0.0616291029411765, -0.0474165294117647, -0.303869441176471, // f 139//139 153//153 152//152 -0.0406551911764706, -0.0665367647058824, -0.303869441176471, -0.0662518088235294, -0.0509074264705882, -0.307867897058824, -0.0616291029411765, -0.0474165294117647, -0.303869441176471, // f 139//139 140//140 153//153 -0.0406551911764706, -0.0665367647058824, -0.303869441176471, -0.0437046617647059, -0.0714618529411765, -0.307867897058824, -0.0662518088235294, -0.0509074264705882, -0.307867897058824, // f 140//140 154//154 153//153 -0.0437046617647059, -0.0714618529411765, -0.307867897058824, -0.0718278529411765, -0.0551182647058824, -0.308716294117647, -0.0662518088235294, -0.0509074264705882, -0.307867897058824, // f 140//140 141//141 154//154 -0.0437046617647059, -0.0714618529411765, -0.307867897058824, -0.0473830441176471, -0.0774026323529412, -0.308716294117647, -0.0718278529411765, -0.0551182647058824, -0.308716294117647, // f 141//141 155//155 154//154 -0.0473830441176471, -0.0774026323529412, -0.308716294117647, -0.0770798382352941, -0.0590843823529412, -0.306220338235294, -0.0718278529411765, -0.0551182647058824, -0.308716294117647, // f 141//141 142//142 155//155 -0.0473830441176471, -0.0774026323529412, -0.308716294117647, -0.0508476470588235, -0.0829981617647059, -0.306220338235294, -0.0770798382352941, -0.0590843823529412, -0.306220338235294, // f 142//142 156//156 155//155 -0.0508476470588235, -0.0829981617647059, -0.306220338235294, -0.0808045882352941, -0.0618971911764706, -0.300951823529412, -0.0770798382352941, -0.0590843823529412, -0.306220338235294, // f 142//142 143//143 156//156 -0.0508476470588235, -0.0829981617647059, -0.306220338235294, -0.0533047794117647, -0.0869665735294118, -0.300951794117647, -0.0808045882352941, -0.0618971911764706, -0.300951823529412, // f 143//143 144//145 156//156 -0.0533047794117647, -0.0869665735294118, -0.300951794117647, -0.0821488382352941, -0.0629123088235294, -0.294117647058824, -0.0808045882352941, -0.0618971911764706, -0.300951823529412, // f 143//143 131//132 144//145 -0.0533047794117647, -0.0869665735294118, -0.300951794117647, -0.0541915441176471, -0.0883987352941177, -0.294117647058824, -0.0821488382352941, -0.0629123088235294, -0.294117647058824, // f 144//145 158//157 157//158 -0.0821488382352941, -0.0629123088235294, -0.294117647058824, -0.097391294117647, -0.0285866029411765, -0.287283470588235, -0.0990114705882353, -0.0290475735294118, -0.294117647058824, // f 144//145 145//144 158//157 -0.0821488382352941, -0.0629123088235294, -0.294117647058824, -0.0808045882352941, -0.0618971764705882, -0.287283470588235, -0.097391294117647, -0.0285866029411765, -0.287283470588235, // f 145//144 159//159 158//157 -0.0808045882352941, -0.0618971764705882, -0.287283470588235, -0.0929019558823529, -0.0273092794117647, -0.282014926470588, -0.097391294117647, -0.0285866029411765, -0.287283470588235, // f 145//144 146//146 159//159 -0.0808045882352941, -0.0618971764705882, -0.287283470588235, -0.0770798382352941, -0.0590843676470588, -0.282014926470588, -0.0929019558823529, -0.0273092794117647, -0.282014926470588, // f 146//146 160//160 159//159 -0.0770798382352941, -0.0590843676470588, -0.282014926470588, -0.0865718970588235, -0.0255082205882353, -0.279519, -0.0929019558823529, -0.0273092794117647, -0.282014926470588, // f 146//146 147//147 160//160 -0.0770798382352941, -0.0590843676470588, -0.282014926470588, -0.0718278529411765, -0.05511825, -0.279519, -0.0865718970588235, -0.0255082205882353, -0.279519, // f 147//147 161//161 160//160 -0.0718278529411765, -0.05511825, -0.279519, -0.07985125, -0.0235960294117647, -0.280367397058824, -0.0865718970588235, -0.0255082205882353, -0.279519, // f 147//147 148//148 161//161 -0.0718278529411765, -0.05511825, -0.279519, -0.0662517941176471, -0.0509074264705882, -0.280367397058824, -0.07985125, -0.0235960294117647, -0.280367397058824, // f 148//148 162//162 161//161 -0.0662517941176471, -0.0509074264705882, -0.280367397058824, -0.0742796617647059, -0.0220107794117647, -0.284365852941176, -0.07985125, -0.0235960294117647, -0.280367397058824, // f 148//148 149//149 162//162 -0.0662517941176471, -0.0509074264705882, -0.280367397058824, -0.0616291029411765, -0.0474165147058824, -0.284365852941176, -0.0742796617647059, -0.0220107794117647, -0.284365852941176, // f 149//149 163//163 162//162 -0.0616291029411765, -0.0474165147058824, -0.284365852941176, -0.0711334852941176, -0.0211156029411765, -0.290598308823529, -0.0742796617647059, -0.0220107794117647, -0.284365852941176, // f 149//149 150//150 163//163 -0.0616291029411765, -0.0474165147058824, -0.284365852941176, -0.05901875, -0.0454452794117647, -0.290598308823529, -0.0711334852941176, -0.0211156029411765, -0.290598308823529, // f 150//150 164//164 163//163 -0.05901875, -0.0454452794117647, -0.290598308823529, -0.0711334852941176, -0.0211156176470588, -0.297636985294118, -0.0711334852941176, -0.0211156029411765, -0.290598308823529, // f 150//150 151//151 164//164 -0.05901875, -0.0454452794117647, -0.290598308823529, -0.05901875, -0.0454452794117647, -0.297636985294118, -0.0711334852941176, -0.0211156176470588, -0.297636985294118, // f 151//151 165//165 164//164 -0.05901875, -0.0454452794117647, -0.297636985294118, -0.0742796617647059, -0.0220107794117647, -0.303869441176471, -0.0711334852941176, -0.0211156176470588, -0.297636985294118, // f 151//151 152//152 165//165 -0.05901875, -0.0454452794117647, -0.297636985294118, -0.0616291029411765, -0.0474165294117647, -0.303869441176471, -0.0742796617647059, -0.0220107794117647, -0.303869441176471, // f 152//152 166//166 165//165 -0.0616291029411765, -0.0474165294117647, -0.303869441176471, -0.0798512647058823, -0.0235960294117647, -0.307867897058824, -0.0742796617647059, -0.0220107794117647, -0.303869441176471, // f 152//152 153//153 166//166 -0.0616291029411765, -0.0474165294117647, -0.303869441176471, -0.0662518088235294, -0.0509074264705882, -0.307867897058824, -0.0798512647058823, -0.0235960294117647, -0.307867897058824, // f 153//153 167//167 166//166 -0.0662518088235294, -0.0509074264705882, -0.307867897058824, -0.0865718970588235, -0.0255082205882353, -0.308716294117647, -0.0798512647058823, -0.0235960294117647, -0.307867897058824, // f 153//153 154//154 167//167 -0.0662518088235294, -0.0509074264705882, -0.307867897058824, -0.0718278529411765, -0.0551182647058824, -0.308716294117647, -0.0865718970588235, -0.0255082205882353, -0.308716294117647, // f 154//154 168//168 167//167 -0.0718278529411765, -0.0551182647058824, -0.308716294117647, -0.0929019558823529, -0.0273092794117647, -0.306220338235294, -0.0865718970588235, -0.0255082205882353, -0.308716294117647, // f 154//154 155//155 168//168 -0.0718278529411765, -0.0551182647058824, -0.308716294117647, -0.0770798382352941, -0.0590843823529412, -0.306220338235294, -0.0929019558823529, -0.0273092794117647, -0.306220338235294, // f 155//155 169//169 168//168 -0.0770798382352941, -0.0590843823529412, -0.306220338235294, -0.097391294117647, -0.0285866029411765, -0.300951823529412, -0.0929019558823529, -0.0273092794117647, -0.306220338235294, // f 155//155 156//156 169//169 -0.0770798382352941, -0.0590843823529412, -0.306220338235294, -0.0808045882352941, -0.0618971911764706, -0.300951823529412, -0.097391294117647, -0.0285866029411765, -0.300951823529412, // f 156//156 157//158 169//169 -0.0808045882352941, -0.0618971911764706, -0.300951823529412, -0.0990114705882353, -0.0290475735294118, -0.294117647058824, -0.097391294117647, -0.0285866029411765, -0.300951823529412, // f 156//156 144//145 157//158 -0.0808045882352941, -0.0618971911764706, -0.300951823529412, -0.0821488382352941, -0.0629123088235294, -0.294117647058824, -0.0990114705882353, -0.0290475735294118, -0.294117647058824, // f 157//158 171//170 170//171 -0.0990114705882353, -0.0290475735294118, -0.294117647058824, -0.100824764705882, 0.00846639705882353, -0.287283470588235, -0.102502044117647, 0.00862182352941177, -0.294117647058824, // f 157//158 158//157 171//170 -0.0990114705882353, -0.0290475735294118, -0.294117647058824, -0.097391294117647, -0.0285866029411765, -0.287283470588235, -0.100824764705882, 0.00846639705882353, -0.287283470588235, // f 158//157 172//172 171//170 -0.097391294117647, -0.0285866029411765, -0.287283470588235, -0.0961771470588235, 0.00803573529411765, -0.282014926470588, -0.100824764705882, 0.00846639705882353, -0.287283470588235, // f 158//157 159//159 172//172 -0.097391294117647, -0.0285866029411765, -0.287283470588235, -0.0929019558823529, -0.0273092794117647, -0.282014926470588, -0.0961771470588235, 0.00803573529411765, -0.282014926470588, // f 159//159 173//173 172//172 -0.0929019558823529, -0.0273092794117647, -0.282014926470588, -0.0896239411764706, 0.00742848529411765, -0.279519, -0.0961771470588235, 0.00803573529411765, -0.282014926470588, // f 159//159 160//160 173//173 -0.0929019558823529, -0.0273092794117647, -0.282014926470588, -0.0865718970588235, -0.0255082205882353, -0.279519, -0.0896239411764706, 0.00742848529411765, -0.279519, // f 160//160 174//174 173//173 -0.0865718970588235, -0.0255082205882353, -0.279519, -0.0826663676470588, 0.00678377941176471, -0.280367397058824, -0.0896239411764706, 0.00742848529411765, -0.279519, // f 160//160 161//161 174//174 -0.0865718970588235, -0.0255082205882353, -0.279519, -0.07985125, -0.0235960294117647, -0.280367397058824, -0.0826663676470588, 0.00678377941176471, -0.280367397058824, // f 161//161 175//175 174//174 -0.07985125, -0.0235960294117647, -0.280367397058824, -0.0768983382352941, 0.00624929411764706, -0.284365852941176, -0.0826663676470588, 0.00678377941176471, -0.280367397058824, // f 161//161 162//162 175//175 -0.07985125, -0.0235960294117647, -0.280367397058824, -0.0742796617647059, -0.0220107794117647, -0.284365852941176, -0.0768983382352941, 0.00624929411764706, -0.284365852941176, // f 162//162 176//176 175//175 -0.0742796617647059, -0.0220107794117647, -0.284365852941176, -0.07364125, 0.00594747058823529, -0.290598308823529, -0.0768983382352941, 0.00624929411764706, -0.284365852941176, // f 162//162 163//163 176//176 -0.0742796617647059, -0.0220107794117647, -0.284365852941176, -0.0711334852941176, -0.0211156029411765, -0.290598308823529, -0.07364125, 0.00594747058823529, -0.290598308823529, // f 163//163 177//177 176//176 -0.0711334852941176, -0.0211156029411765, -0.290598308823529, -0.07364125, 0.00594747058823529, -0.297636985294118, -0.07364125, 0.00594747058823529, -0.290598308823529, // f 163//163 164//164 177//177 -0.0711334852941176, -0.0211156029411765, -0.290598308823529, -0.0711334852941176, -0.0211156176470588, -0.297636985294118, -0.07364125, 0.00594747058823529, -0.297636985294118, // f 164//164 178//178 177//177 -0.0711334852941176, -0.0211156176470588, -0.297636985294118, -0.0768983382352941, 0.00624929411764706, -0.303869441176471, -0.07364125, 0.00594747058823529, -0.297636985294118, // f 164//164 165//165 178//178 -0.0711334852941176, -0.0211156176470588, -0.297636985294118, -0.0742796617647059, -0.0220107794117647, -0.303869441176471, -0.0768983382352941, 0.00624929411764706, -0.303869441176471, // f 165//165 179//179 178//178 -0.0742796617647059, -0.0220107794117647, -0.303869441176471, -0.0826663676470588, 0.00678377941176471, -0.307867897058824, -0.0768983382352941, 0.00624929411764706, -0.303869441176471, // f 165//165 166//166 179//179 -0.0742796617647059, -0.0220107794117647, -0.303869441176471, -0.0798512647058823, -0.0235960294117647, -0.307867897058824, -0.0826663676470588, 0.00678377941176471, -0.307867897058824, // f 166//166 180//180 179//179 -0.0798512647058823, -0.0235960294117647, -0.307867897058824, -0.0896239411764706, 0.00742848529411765, -0.308716294117647, -0.0826663676470588, 0.00678377941176471, -0.307867897058824, // f 166//166 167//167 180//180 -0.0798512647058823, -0.0235960294117647, -0.307867897058824, -0.0865718970588235, -0.0255082205882353, -0.308716294117647, -0.0896239411764706, 0.00742848529411765, -0.308716294117647, // f 167//167 181//181 180//180 -0.0865718970588235, -0.0255082205882353, -0.308716294117647, -0.0961771617647059, 0.00803573529411765, -0.306220338235294, -0.0896239411764706, 0.00742848529411765, -0.308716294117647, // f 167//167 168//168 181//181 -0.0865718970588235, -0.0255082205882353, -0.308716294117647, -0.0929019558823529, -0.0273092794117647, -0.306220338235294, -0.0961771617647059, 0.00803573529411765, -0.306220338235294, // f 168//168 182//182 181//181 -0.0929019558823529, -0.0273092794117647, -0.306220338235294, -0.100824764705882, 0.00846639705882353, -0.300951823529412, -0.0961771617647059, 0.00803573529411765, -0.306220338235294, // f 168//168 169//169 182//182 -0.0929019558823529, -0.0273092794117647, -0.306220338235294, -0.097391294117647, -0.0285866029411765, -0.300951823529412, -0.100824764705882, 0.00846639705882353, -0.300951823529412, // f 169//169 170//171 182//182 -0.097391294117647, -0.0285866029411765, -0.300951823529412, -0.102502044117647, 0.00862182352941177, -0.294117647058824, -0.100824764705882, 0.00846639705882353, -0.300951823529412, // f 169//169 157//158 170//171 -0.097391294117647, -0.0285866029411765, -0.300951823529412, -0.0990114705882353, -0.0290475735294118, -0.294117647058824, -0.102502044117647, 0.00862182352941177, -0.294117647058824, // f 170//171 184//183 183//184 -0.102502044117647, 0.00862182352941177, -0.294117647058824, -0.0906412941176471, 0.0442576029411765, -0.287283470588235, -0.0921491617647059, 0.0450084411764706, -0.294117647058824, // f 170//171 171//170 184//183 -0.102502044117647, 0.00862182352941177, -0.294117647058824, -0.100824764705882, 0.00846639705882353, -0.287283470588235, -0.0906412941176471, 0.0442576029411765, -0.287283470588235, // f 171//170 185//185 184//183 -0.100824764705882, 0.00846639705882353, -0.287283470588235, -0.0864630882352941, 0.0421771029411765, -0.282014955882353, -0.0906412941176471, 0.0442576029411765, -0.287283470588235, // f 171//170 172//172 185//185 -0.100824764705882, 0.00846639705882353, -0.287283470588235, -0.0961771470588235, 0.00803573529411765, -0.282014926470588, -0.0864630882352941, 0.0421771029411765, -0.282014955882353, // f 172//172 186//186 185//185 -0.0961771470588235, 0.00803573529411765, -0.282014926470588, -0.0805717647058824, 0.0392435735294118, -0.279519, -0.0864630882352941, 0.0421771029411765, -0.282014955882353, // f 172//172 173//173 186//186 -0.0961771470588235, 0.00803573529411765, -0.282014926470588, -0.0896239411764706, 0.00742848529411765, -0.279519, -0.0805717647058824, 0.0392435735294118, -0.279519, // f 173//173 187//187 186//186 -0.0896239411764706, 0.00742848529411765, -0.279519, -0.0743169117647059, 0.0361290294117647, -0.280367397058824, -0.0805717647058824, 0.0392435735294118, -0.279519, // f 173//173 174//174 187//187 -0.0896239411764706, 0.00742848529411765, -0.279519, -0.0826663676470588, 0.00678377941176471, -0.280367397058824, -0.0743169117647059, 0.0361290294117647, -0.280367397058824, // f 174//174 188//188 187//187 -0.0826663676470588, 0.00678377941176471, -0.280367397058824, -0.0691314852941177, 0.033547, -0.284365852941176, -0.0743169117647059, 0.0361290294117647, -0.280367397058824, // f 174//174 175//175 188//188 -0.0826663676470588, 0.00678377941176471, -0.280367397058824, -0.0768983382352941, 0.00624929411764706, -0.284365852941176, -0.0691314852941177, 0.033547, -0.284365852941176, // f 175//175 189//189 188//188 -0.0768983382352941, 0.00624929411764706, -0.284365852941176, -0.0662033529411765, 0.0320889558823529, -0.290598308823529, -0.0691314852941177, 0.033547, -0.284365852941176, // f 175//175 176//176 189//189 -0.0768983382352941, 0.00624929411764706, -0.284365852941176, -0.07364125, 0.00594747058823529, -0.290598308823529, -0.0662033529411765, 0.0320889558823529, -0.290598308823529, // f 176//176 190//190 189//189 -0.07364125, 0.00594747058823529, -0.290598308823529, -0.0662033529411765, 0.0320889558823529, -0.297636985294118, -0.0662033529411765, 0.0320889558823529, -0.290598308823529, // f 176//176 177//177 190//190 -0.07364125, 0.00594747058823529, -0.290598308823529, -0.07364125, 0.00594747058823529, -0.297636985294118, -0.0662033529411765, 0.0320889558823529, -0.297636985294118, // f 177//177 191//191 190//190 -0.07364125, 0.00594747058823529, -0.297636985294118, -0.0691314852941177, 0.0335469852941176, -0.303869441176471, -0.0662033529411765, 0.0320889558823529, -0.297636985294118, // f 177//177 178//178 191//191 -0.07364125, 0.00594747058823529, -0.297636985294118, -0.0768983382352941, 0.00624929411764706, -0.303869441176471, -0.0691314852941177, 0.0335469852941176, -0.303869441176471, // f 178//178 192//192 191//191 -0.0768983382352941, 0.00624929411764706, -0.303869441176471, -0.0743169264705882, 0.0361290294117647, -0.307867897058824, -0.0691314852941177, 0.0335469852941176, -0.303869441176471, // f 178//178 179//179 192//192 -0.0768983382352941, 0.00624929411764706, -0.303869441176471, -0.0826663676470588, 0.00678377941176471, -0.307867897058824, -0.0743169264705882, 0.0361290294117647, -0.307867897058824, // f 179//179 193//193 192//192 -0.0826663676470588, 0.00678377941176471, -0.307867897058824, -0.0805717647058824, 0.0392435735294118, -0.308716294117647, -0.0743169264705882, 0.0361290294117647, -0.307867897058824, // f 179//179 180//180 193//193 -0.0826663676470588, 0.00678377941176471, -0.307867897058824, -0.0896239411764706, 0.00742848529411765, -0.308716294117647, -0.0805717647058824, 0.0392435735294118, -0.308716294117647, // f 180//180 194//194 193//193 -0.0896239411764706, 0.00742848529411765, -0.308716294117647, -0.0864631029411765, 0.0421771176470588, -0.306220367647059, -0.0805717647058824, 0.0392435735294118, -0.308716294117647, // f 180//180 181//181 194//194 -0.0896239411764706, 0.00742848529411765, -0.308716294117647, -0.0961771617647059, 0.00803573529411765, -0.306220338235294, -0.0864631029411765, 0.0421771176470588, -0.306220367647059, // f 181//181 195//195 194//194 -0.0961771617647059, 0.00803573529411765, -0.306220338235294, -0.0906412941176471, 0.0442576029411765, -0.300951823529412, -0.0864631029411765, 0.0421771176470588, -0.306220367647059, // f 181//181 182//182 195//195 -0.0961771617647059, 0.00803573529411765, -0.306220338235294, -0.100824764705882, 0.00846639705882353, -0.300951823529412, -0.0906412941176471, 0.0442576029411765, -0.300951823529412, // f 182//182 183//184 195//195 -0.100824764705882, 0.00846639705882353, -0.300951823529412, -0.0921491617647059, 0.0450084411764706, -0.294117647058824, -0.0906412941176471, 0.0442576029411765, -0.300951823529412, // f 182//182 170//171 183//184 -0.100824764705882, 0.00846639705882353, -0.300951823529412, -0.102502044117647, 0.00862182352941177, -0.294117647058824, -0.0921491617647059, 0.0450084411764706, -0.294117647058824, // f 183//184 197//196 196//197 -0.0921491617647059, 0.0450084411764706, -0.294117647058824, -0.0682162058823529, 0.0739532058823529, -0.287283470588235, -0.0693510294117647, 0.0751980441176471, -0.294117647058824, // f 183//184 184//183 197//196 -0.0921491617647059, 0.0450084411764706, -0.294117647058824, -0.0906412941176471, 0.0442576029411765, -0.287283470588235, -0.0682162058823529, 0.0739532058823529, -0.287283470588235, // f 184//183 198//198 197//196 -0.0906412941176471, 0.0442576029411765, -0.287283470588235, -0.0650717205882353, 0.0705038823529412, -0.282014955882353, -0.0682162058823529, 0.0739532058823529, -0.287283470588235, // f 184//183 185//185 198//198 -0.0906412941176471, 0.0442576029411765, -0.287283470588235, -0.0864630882352941, 0.0421771029411765, -0.282014955882353, -0.0650717205882353, 0.0705038823529412, -0.282014955882353, // f 185//185 199//199 198//198 -0.0864630882352941, 0.0421771029411765, -0.282014955882353, -0.0606379264705882, 0.06564025, -0.279519, -0.0650717205882353, 0.0705038823529412, -0.282014955882353, // f 185//185 186//186 199//199 -0.0864630882352941, 0.0421771029411765, -0.282014955882353, -0.0805717647058824, 0.0392435735294118, -0.279519, -0.0606379264705882, 0.06564025, -0.279519, // f 186//186 200//200 199//199 -0.0805717647058824, 0.0392435735294118, -0.279519, -0.0559305588235294, 0.0604765147058823, -0.280367397058824, -0.0606379264705882, 0.06564025, -0.279519, // f 186//186 187//187 200//200 -0.0805717647058824, 0.0392435735294118, -0.279519, -0.0743169117647059, 0.0361290294117647, -0.280367397058824, -0.0559305588235294, 0.0604765147058823, -0.280367397058824, // f 187//187 201//201 200//200 -0.0743169117647059, 0.0361290294117647, -0.280367397058824, -0.0520280294117647, 0.0561956323529412, -0.284365852941176, -0.0559305588235294, 0.0604765147058823, -0.280367397058824, // f 187//187 188//188 201//201 -0.0743169117647059, 0.0361290294117647, -0.280367397058824, -0.0691314852941177, 0.033547, -0.284365852941176, -0.0520280294117647, 0.0561956323529412, -0.284365852941176, // f 188//188 202//202 201//201 -0.0691314852941177, 0.033547, -0.284365852941176, -0.0498243382352941, 0.0537782941176471, -0.290598308823529, -0.0520280294117647, 0.0561956323529412, -0.284365852941176, // f 188//188 189//189 202//202 -0.0691314852941177, 0.033547, -0.284365852941176, -0.0662033529411765, 0.0320889558823529, -0.290598308823529, -0.0498243382352941, 0.0537782941176471, -0.290598308823529, // f 189//189 203//203 202//202 -0.0662033529411765, 0.0320889558823529, -0.290598308823529, -0.0498243382352941, 0.0537782941176471, -0.297637014705882, -0.0498243382352941, 0.0537782941176471, -0.290598308823529, // f 189//189 190//190 203//203 -0.0662033529411765, 0.0320889558823529, -0.290598308823529, -0.0662033529411765, 0.0320889558823529, -0.297636985294118, -0.0498243382352941, 0.0537782941176471, -0.297637014705882, // f 190//190 204//204 203//203 -0.0662033529411765, 0.0320889558823529, -0.297636985294118, -0.0520280294117647, 0.0561956323529412, -0.303869441176471, -0.0498243382352941, 0.0537782941176471, -0.297637014705882, // f 190//190 191//191 204//204 -0.0662033529411765, 0.0320889558823529, -0.297636985294118, -0.0691314852941177, 0.0335469852941176, -0.303869441176471, -0.0520280294117647, 0.0561956323529412, -0.303869441176471, // f 191//191 205//205 204//204 -0.0691314852941177, 0.0335469852941176, -0.303869441176471, -0.0559305588235294, 0.0604765, -0.307867897058824, -0.0520280294117647, 0.0561956323529412, -0.303869441176471, // f 191//191 192//192 205//205 -0.0691314852941177, 0.0335469852941176, -0.303869441176471, -0.0743169264705882, 0.0361290294117647, -0.307867897058824, -0.0559305588235294, 0.0604765, -0.307867897058824, // f 192//192 206//206 205//205 -0.0743169264705882, 0.0361290294117647, -0.307867897058824, -0.0606379264705882, 0.0656402352941177, -0.308716294117647, -0.0559305588235294, 0.0604765, -0.307867897058824, // f 192//192 193//193 206//206 -0.0743169264705882, 0.0361290294117647, -0.307867897058824, -0.0805717647058824, 0.0392435735294118, -0.308716294117647, -0.0606379264705882, 0.0656402352941177, -0.308716294117647, // f 193//193 207//207 206//206 -0.0805717647058824, 0.0392435735294118, -0.308716294117647, -0.0650717205882353, 0.0705038676470588, -0.306220367647059, -0.0606379264705882, 0.0656402352941177, -0.308716294117647, // f 193//193 194//194 207//207 -0.0805717647058824, 0.0392435735294118, -0.308716294117647, -0.0864631029411765, 0.0421771176470588, -0.306220367647059, -0.0650717205882353, 0.0705038676470588, -0.306220367647059, // f 194//194 208//208 207//207 -0.0864631029411765, 0.0421771176470588, -0.306220367647059, -0.0682162058823529, 0.0739532058823529, -0.300951823529412, -0.0650717205882353, 0.0705038676470588, -0.306220367647059, // f 194//194 195//195 208//208 -0.0864631029411765, 0.0421771176470588, -0.306220367647059, -0.0906412941176471, 0.0442576029411765, -0.300951823529412, -0.0682162058823529, 0.0739532058823529, -0.300951823529412, // f 195//195 196//197 208//208 -0.0906412941176471, 0.0442576029411765, -0.300951823529412, -0.0693510294117647, 0.0751980441176471, -0.294117647058824, -0.0682162058823529, 0.0739532058823529, -0.300951823529412, // f 195//195 183//184 196//197 -0.0906412941176471, 0.0442576029411765, -0.300951823529412, -0.0921491617647059, 0.0450084411764706, -0.294117647058824, -0.0693510294117647, 0.0751980441176471, -0.294117647058824, // f 196//197 210//209 209//210 -0.0693510294117647, 0.0751980441176471, -0.294117647058824, -0.0365781470588235, 0.0935426764705882, -0.287283470588235, -0.0371866470588235, 0.0951133970588235, -0.294117647058824, // f 196//197 197//196 210//209 -0.0693510294117647, 0.0751980441176471, -0.294117647058824, -0.0682162058823529, 0.0739532058823529, -0.287283470588235, -0.0365781470588235, 0.0935426764705882, -0.287283470588235, // f 197//196 211//211 210//209 -0.0682162058823529, 0.0739532058823529, -0.287283470588235, -0.0348920441176471, 0.0891903382352941, -0.282014955882353, -0.0365781470588235, 0.0935426764705882, -0.287283470588235, // f 197//196 198//198 211//211 -0.0682162058823529, 0.0739532058823529, -0.287283470588235, -0.0650717205882353, 0.0705038823529412, -0.282014955882353, -0.0348920441176471, 0.0891903382352941, -0.282014955882353, // f 198//198 212//212 211//211 -0.0650717205882353, 0.0705038823529412, -0.282014955882353, -0.0325146029411765, 0.0830534705882353, -0.279519, -0.0348920441176471, 0.0891903382352941, -0.282014955882353, // f 198//198 199//199 212//212 -0.0650717205882353, 0.0705038823529412, -0.282014955882353, -0.0606379264705882, 0.06564025, -0.279519, -0.0325146029411765, 0.0830534705882353, -0.279519, // f 199//199 213//213 212//212 -0.0606379264705882, 0.06564025, -0.279519, -0.0299904705882353, 0.0765379264705882, -0.280367397058824, -0.0325146029411765, 0.0830534705882353, -0.279519, // f 199//199 200//200 213//213 -0.0606379264705882, 0.06564025, -0.279519, -0.0559305588235294, 0.0604765147058823, -0.280367397058824, -0.0299904705882353, 0.0765379264705882, -0.280367397058824, // f 200//200 214//214 213//213 -0.0559305588235294, 0.0604765147058823, -0.280367397058824, -0.0278978970588235, 0.0711363676470588, -0.284365852941176, -0.0299904705882353, 0.0765379264705882, -0.280367397058824, // f 200//200 201//201 214//214 -0.0559305588235294, 0.0604765147058823, -0.280367397058824, -0.0520280294117647, 0.0561956323529412, -0.284365852941176, -0.0278978970588235, 0.0711363676470588, -0.284365852941176, // f 201//201 215//215 214//214 -0.0520280294117647, 0.0561956323529412, -0.284365852941176, -0.0267162647058824, 0.0680862058823529, -0.290598308823529, -0.0278978970588235, 0.0711363676470588, -0.284365852941176, // f 201//201 202//202 215//215 -0.0520280294117647, 0.0561956323529412, -0.284365852941176, -0.0498243382352941, 0.0537782941176471, -0.290598308823529, -0.0267162647058824, 0.0680862058823529, -0.290598308823529, // f 202//202 216//216 215//215 -0.0498243382352941, 0.0537782941176471, -0.290598308823529, -0.0267162647058824, 0.0680862058823529, -0.297637014705882, -0.0267162647058824, 0.0680862058823529, -0.290598308823529, // f 202//202 203//203 216//216 -0.0498243382352941, 0.0537782941176471, -0.290598308823529, -0.0498243382352941, 0.0537782941176471, -0.297637014705882, -0.0267162647058824, 0.0680862058823529, -0.297637014705882, // f 203//203 217//217 216//216 -0.0498243382352941, 0.0537782941176471, -0.297637014705882, -0.0278978970588235, 0.0711363676470588, -0.303869441176471, -0.0267162647058824, 0.0680862058823529, -0.297637014705882, // f 203//203 204//204 217//217 -0.0498243382352941, 0.0537782941176471, -0.297637014705882, -0.0520280294117647, 0.0561956323529412, -0.303869441176471, -0.0278978970588235, 0.0711363676470588, -0.303869441176471, // f 204//204 218//218 217//217 -0.0520280294117647, 0.0561956323529412, -0.303869441176471, -0.0299904705882353, 0.0765379411764706, -0.307867897058824, -0.0278978970588235, 0.0711363676470588, -0.303869441176471, // f 204//204 205//205 218//218 -0.0520280294117647, 0.0561956323529412, -0.303869441176471, -0.0559305588235294, 0.0604765, -0.307867897058824, -0.0299904705882353, 0.0765379411764706, -0.307867897058824, // f 205//205 219//219 218//218 -0.0559305588235294, 0.0604765, -0.307867897058824, -0.0325146029411765, 0.0830534705882353, -0.308716294117647, -0.0299904705882353, 0.0765379411764706, -0.307867897058824, // f 205//205 206//206 219//219 -0.0559305588235294, 0.0604765, -0.307867897058824, -0.0606379264705882, 0.0656402352941177, -0.308716294117647, -0.0325146029411765, 0.0830534705882353, -0.308716294117647, // f 206//206 220//220 219//219 -0.0606379264705882, 0.0656402352941177, -0.308716294117647, -0.0348920441176471, 0.0891903382352941, -0.306220367647059, -0.0325146029411765, 0.0830534705882353, -0.308716294117647, // f 206//206 207//207 220//220 -0.0606379264705882, 0.0656402352941177, -0.308716294117647, -0.0650717205882353, 0.0705038676470588, -0.306220367647059, -0.0348920441176471, 0.0891903382352941, -0.306220367647059, // f 207//207 221//221 220//220 -0.0650717205882353, 0.0705038676470588, -0.306220367647059, -0.0365781470588235, 0.0935426764705882, -0.300951823529412, -0.0348920441176471, 0.0891903382352941, -0.306220367647059, // f 207//207 208//208 221//221 -0.0650717205882353, 0.0705038676470588, -0.306220367647059, -0.0682162058823529, 0.0739532058823529, -0.300951823529412, -0.0365781470588235, 0.0935426764705882, -0.300951823529412, // f 208//208 209//210 221//221 -0.0682162058823529, 0.0739532058823529, -0.300951823529412, -0.0371866470588235, 0.0951133970588235, -0.294117647058824, -0.0365781470588235, 0.0935426764705882, -0.300951823529412, // f 208//208 196//197 209//210 -0.0682162058823529, 0.0739532058823529, -0.300951823529412, -0.0693510294117647, 0.0751980441176471, -0.294117647058824, -0.0371866470588235, 0.0951133970588235, -0.294117647058824, // f 2//4 1//1 209//210 0, 0.100380308823529, -0.287283470588235, 0, 0.102064779411765, -0.294117647058824, -0.0371866470588235, 0.0951133970588235, -0.294117647058824, // f 209//210 210//209 2//4 -0.0371866470588235, 0.0951133970588235, -0.294117647058824, -0.0365781470588235, 0.0935426764705882, -0.287283470588235, 0, 0.100380308823529, -0.287283470588235, // f 210//209 3//6 2//4 -0.0365781470588235, 0.0935426764705882, -0.287283470588235, 0, 0.0957127941176471, -0.282014955882353, 0, 0.100380308823529, -0.287283470588235, // f 210//209 211//211 3//6 -0.0365781470588235, 0.0935426764705882, -0.287283470588235, -0.0348920441176471, 0.0891903382352941, -0.282014955882353, 0, 0.0957127941176471, -0.282014955882353, // f 211//211 4//8 3//6 -0.0348920441176471, 0.0891903382352941, -0.282014955882353, 0, 0.0891315, -0.279519, 0, 0.0957127941176471, -0.282014955882353, // f 211//211 212//212 4//8 -0.0348920441176471, 0.0891903382352941, -0.282014955882353, -0.0325146029411765, 0.0830534705882353, -0.279519, 0, 0.0891315, -0.279519, // f 212//212 5//10 4//8 -0.0325146029411765, 0.0830534705882353, -0.279519, 0, 0.0821441323529412, -0.280367397058824, 0, 0.0891315, -0.279519, // f 212//212 213//213 5//10 -0.0325146029411765, 0.0830534705882353, -0.279519, -0.0299904705882353, 0.0765379264705882, -0.280367397058824, 0, 0.0821441323529412, -0.280367397058824, // f 213//213 6//12 5//10 -0.0299904705882353, 0.0765379264705882, -0.280367397058824, 0, 0.0763513823529412, -0.284365852941176, 0, 0.0821441323529412, -0.280367397058824, // f 213//213 214//214 6//12 -0.0299904705882353, 0.0765379264705882, -0.280367397058824, -0.0278978970588235, 0.0711363676470588, -0.284365852941176, 0, 0.0763513823529412, -0.284365852941176, // f 214//214 7//14 6//12 -0.0278978970588235, 0.0711363676470588, -0.284365852941176, 0, 0.0730803382352941, -0.290598308823529, 0, 0.0763513823529412, -0.284365852941176, // f 214//214 215//215 7//14 -0.0278978970588235, 0.0711363676470588, -0.284365852941176, -0.0267162647058824, 0.0680862058823529, -0.290598308823529, 0, 0.0730803382352941, -0.290598308823529, // f 215//215 8//16 7//14 -0.0267162647058824, 0.0680862058823529, -0.290598308823529, 0, 0.0730803382352941, -0.297637014705882, 0, 0.0730803382352941, -0.290598308823529, // f 215//215 216//216 8//16 -0.0267162647058824, 0.0680862058823529, -0.290598308823529, -0.0267162647058824, 0.0680862058823529, -0.297637014705882, 0, 0.0730803382352941, -0.297637014705882, // f 216//216 9//18 8//16 -0.0267162647058824, 0.0680862058823529, -0.297637014705882, 0, 0.0763513823529412, -0.303869441176471, 0, 0.0730803382352941, -0.297637014705882, // f 216//216 217//217 9//18 -0.0267162647058824, 0.0680862058823529, -0.297637014705882, -0.0278978970588235, 0.0711363676470588, -0.303869441176471, 0, 0.0763513823529412, -0.303869441176471, // f 217//217 10//20 9//18 -0.0278978970588235, 0.0711363676470588, -0.303869441176471, 0, 0.0821441323529412, -0.307867897058824, 0, 0.0763513823529412, -0.303869441176471, // f 217//217 218//218 10//20 -0.0278978970588235, 0.0711363676470588, -0.303869441176471, -0.0299904705882353, 0.0765379411764706, -0.307867897058824, 0, 0.0821441323529412, -0.307867897058824, // f 218//218 11//22 10//20 -0.0299904705882353, 0.0765379411764706, -0.307867897058824, 0, 0.0891315, -0.308716323529412, 0, 0.0821441323529412, -0.307867897058824, // f 218//218 219//219 11//22 -0.0299904705882353, 0.0765379411764706, -0.307867897058824, -0.0325146029411765, 0.0830534705882353, -0.308716294117647, 0, 0.0891315, -0.308716323529412, // f 219//219 12//24 11//22 -0.0325146029411765, 0.0830534705882353, -0.308716294117647, 0, 0.0957127941176471, -0.306220367647059, 0, 0.0891315, -0.308716323529412, // f 219//219 220//220 12//24 -0.0325146029411765, 0.0830534705882353, -0.308716294117647, -0.0348920441176471, 0.0891903382352941, -0.306220367647059, 0, 0.0957127941176471, -0.306220367647059, // f 220//220 13//26 12//24 -0.0348920441176471, 0.0891903382352941, -0.306220367647059, 0, 0.100380308823529, -0.300951823529412, 0, 0.0957127941176471, -0.306220367647059, // f 220//220 221//221 13//26 -0.0348920441176471, 0.0891903382352941, -0.306220367647059, -0.0365781470588235, 0.0935426764705882, -0.300951823529412, 0, 0.100380308823529, -0.300951823529412, // f 221//221 1//1 13//26 -0.0365781470588235, 0.0935426764705882, -0.300951823529412, 0, 0.102064779411765, -0.294117647058824, 0, 0.100380308823529, -0.300951823529412, // f 209//210 1//1 221//221 -0.0371866470588235, 0.0951133970588235, -0.294117647058824, 0, 0.102064779411765, -0.294117647058824, -0.0365781470588235, 0.0935426764705882, -0.300951823529412, // f 222//222 224//222 225//222 0.132352941176471, -0.0147058823529412, -0.132352941176471, 0.132352941176471, -0.0147058823529412, -0.161764705882353, 0.161764705882353, -0.0147058823529412, -0.161764705882353, // f 223//222 222//222 225//222 0.161764705882353, -0.0147058823529412, -0.132352941176471, 0.132352941176471, -0.0147058823529412, -0.132352941176471, 0.161764705882353, -0.0147058823529412, -0.161764705882353, // f 226//1 227//1 229//1 0.132352941176471, 0.0147058823529412, -0.132352941176471, 0.161764705882353, 0.0147058823529412, -0.132352941176471, 0.161764705882353, 0.0147058823529412, -0.161764705882353, // f 229//1 228//1 226//1 0.161764705882353, 0.0147058823529412, -0.161764705882353, 0.132352941176471, 0.0147058823529412, -0.161764705882353, 0.132352941176471, 0.0147058823529412, -0.132352941176471, // f 222//223 223//223 227//223 0.132352941176471, -0.0147058823529412, -0.132352941176471, 0.161764705882353, -0.0147058823529412, -0.132352941176471, 0.161764705882353, 0.0147058823529412, -0.132352941176471, // f 226//223 222//223 227//223 0.132352941176471, 0.0147058823529412, -0.132352941176471, 0.132352941176471, -0.0147058823529412, -0.132352941176471, 0.161764705882353, 0.0147058823529412, -0.132352941176471, // f 223//224 225//224 229//224 0.161764705882353, -0.0147058823529412, -0.132352941176471, 0.161764705882353, -0.0147058823529412, -0.161764705882353, 0.161764705882353, 0.0147058823529412, -0.161764705882353, // f 229//224 227//224 223//224 0.161764705882353, 0.0147058823529412, -0.161764705882353, 0.161764705882353, 0.0147058823529412, -0.132352941176471, 0.161764705882353, -0.0147058823529412, -0.132352941176471, // f 225//225 224//225 228//225 0.161764705882353, -0.0147058823529412, -0.161764705882353, 0.132352941176471, -0.0147058823529412, -0.161764705882353, 0.132352941176471, 0.0147058823529412, -0.161764705882353, // f 228//225 229//225 225//225 0.132352941176471, 0.0147058823529412, -0.161764705882353, 0.161764705882353, 0.0147058823529412, -0.161764705882353, 0.161764705882353, -0.0147058823529412, -0.161764705882353, // f 224//226 222//226 226//226 0.132352941176471, -0.0147058823529412, -0.161764705882353, 0.132352941176471, -0.0147058823529412, -0.132352941176471, 0.132352941176471, 0.0147058823529412, -0.132352941176471, // f 226//226 228//226 224//226 0.132352941176471, 0.0147058823529412, -0.132352941176471, 0.132352941176471, 0.0147058823529412, -0.161764705882353, 0.132352941176471, -0.0147058823529412, -0.161764705882353, // f 230//222 232//222 233//222 -0.0735294117647059, -0.0367647058823529, 0.0367647058823529, -0.0735294117647059, -0.0367647058823529, -0.0367647058823529, 0, -0.0367647058823529, -0.0367647058823529, // f 231//222 230//222 233//222 0, -0.0367647058823529, 0.0367647058823529, -0.0735294117647059, -0.0367647058823529, 0.0367647058823529, 0, -0.0367647058823529, -0.0367647058823529, // f 234//1 235//1 237//1 -0.0735294117647059, 0.0367647058823529, 0.0367647058823529, 0, 0.0367647058823529, 0.0367647058823529, 0, 0.0367647058823529, -0.0367647058823529, // f 237//1 236//1 234//1 0, 0.0367647058823529, -0.0367647058823529, -0.0735294117647059, 0.0367647058823529, -0.0367647058823529, -0.0735294117647059, 0.0367647058823529, 0.0367647058823529, // f 230//223 231//223 235//223 -0.0735294117647059, -0.0367647058823529, 0.0367647058823529, 0, -0.0367647058823529, 0.0367647058823529, 0, 0.0367647058823529, 0.0367647058823529, // f 234//223 230//223 235//223 -0.0735294117647059, 0.0367647058823529, 0.0367647058823529, -0.0735294117647059, -0.0367647058823529, 0.0367647058823529, 0, 0.0367647058823529, 0.0367647058823529, // f 231//224 233//224 237//224 0, -0.0367647058823529, 0.0367647058823529, 0, -0.0367647058823529, -0.0367647058823529, 0, 0.0367647058823529, -0.0367647058823529, // f 237//224 235//224 231//224 0, 0.0367647058823529, -0.0367647058823529, 0, 0.0367647058823529, 0.0367647058823529, 0, -0.0367647058823529, 0.0367647058823529, // f 233//225 232//225 236//225 0, -0.0367647058823529, -0.0367647058823529, -0.0735294117647059, -0.0367647058823529, -0.0367647058823529, -0.0735294117647059, 0.0367647058823529, -0.0367647058823529, // f 236//225 237//225 233//225 -0.0735294117647059, 0.0367647058823529, -0.0367647058823529, 0, 0.0367647058823529, -0.0367647058823529, 0, -0.0367647058823529, -0.0367647058823529, // f 232//226 230//226 234//226 -0.0735294117647059, -0.0367647058823529, -0.0367647058823529, -0.0735294117647059, -0.0367647058823529, 0.0367647058823529, -0.0735294117647059, 0.0367647058823529, 0.0367647058823529, // f 234//226 236//226 232//226 -0.0735294117647059, 0.0367647058823529, 0.0367647058823529, -0.0735294117647059, 0.0367647058823529, -0.0367647058823529, -0.0735294117647059, -0.0367647058823529, -0.0367647058823529, // f 238//222 240//227 239//228 -0.000728176470588235, 0, 0, 0.00156407352941176, -0, -0.00287438235294118, 0.00294829411764706, 0, 0, // f 238//222 241//229 240//227 -0.000728176470588235, 0, 0, -0.00154626470588235, -0, -0.00358429411764706, 0.00156407352941176, -0, -0.00287438235294118, // f 238//222 242//230 241//229 -0.000728176470588235, 0, 0, -0.00404055882352941, -0, -0.00159516176470588, -0.00154626470588235, -0, -0.00358429411764706, // f 238//222 243//231 242//230 -0.000728176470588235, 0, 0, -0.00404055882352941, 0, 0.00159516176470588, -0.00404055882352941, -0, -0.00159516176470588, // f 238//222 244//232 243//231 -0.000728176470588235, 0, 0, -0.00154626470588235, 0, 0.00358429411764706, -0.00404055882352941, 0, 0.00159516176470588, // f 238//222 245//233 244//232 -0.000728176470588235, 0, 0, 0.00156407352941176, 0, 0.00287438235294118, -0.00154626470588235, 0, 0.00358429411764706, // f 238//222 239//228 245//233 -0.000728176470588235, 0, 0, 0.00294829411764706, 0, 0, 0.00156407352941176, 0, 0.00287438235294118, // f 239//228 247//234 246//235 0.00294829411764706, 0, 0, 0.00156407352941176, 0.441176470588235, -0.00287439705882353, 0.00294829411764706, 0.441176470588235, -1.47058823529412e-08, // f 239//228 240//227 247//234 0.00294829411764706, 0, 0, 0.00156407352941176, -0, -0.00287438235294118, 0.00156407352941176, 0.441176470588235, -0.00287439705882353, // f 240//227 248//236 247//234 0.00156407352941176, -0, -0.00287438235294118, -0.00154626470588235, 0.441176470588235, -0.00358430882352941, 0.00156407352941176, 0.441176470588235, -0.00287439705882353, // f 240//227 241//229 248//236 0.00156407352941176, -0, -0.00287438235294118, -0.00154626470588235, -0, -0.00358429411764706, -0.00154626470588235, 0.441176470588235, -0.00358430882352941, // f 241//229 249//237 248//236 -0.00154626470588235, -0, -0.00358429411764706, -0.00404055882352941, 0.441176470588235, -0.00159517647058824, -0.00154626470588235, 0.441176470588235, -0.00358430882352941, // f 241//229 242//230 249//237 -0.00154626470588235, -0, -0.00358429411764706, -0.00404055882352941, -0, -0.00159516176470588, -0.00404055882352941, 0.441176470588235, -0.00159517647058824, // f 242//230 250//238 249//237 -0.00404055882352941, -0, -0.00159516176470588, -0.00404055882352941, 0.441176470588235, 0.00159514705882353, -0.00404055882352941, 0.441176470588235, -0.00159517647058824, // f 242//230 243//231 250//238 -0.00404055882352941, -0, -0.00159516176470588, -0.00404055882352941, 0, 0.00159516176470588, -0.00404055882352941, 0.441176470588235, 0.00159514705882353, // f 243//231 251//239 250//238 -0.00404055882352941, 0, 0.00159516176470588, -0.00154626470588235, 0.441176470588235, 0.00358427941176471, -0.00404055882352941, 0.441176470588235, 0.00159514705882353, // f 243//231 244//232 251//239 -0.00404055882352941, 0, 0.00159516176470588, -0.00154626470588235, 0, 0.00358429411764706, -0.00154626470588235, 0.441176470588235, 0.00358427941176471, // f 244//232 252//240 251//239 -0.00154626470588235, 0, 0.00358429411764706, 0.00156407352941176, 0.441176470588235, 0.00287436764705882, -0.00154626470588235, 0.441176470588235, 0.00358427941176471, // f 244//232 245//233 252//240 -0.00154626470588235, 0, 0.00358429411764706, 0.00156407352941176, 0, 0.00287438235294118, 0.00156407352941176, 0.441176470588235, 0.00287436764705882, // f 245//233 246//235 252//240 0.00156407352941176, 0, 0.00287438235294118, 0.00294829411764706, 0.441176470588235, -1.47058823529412e-08, 0.00156407352941176, 0.441176470588235, 0.00287436764705882, // f 245//233 239//228 246//235 0.00156407352941176, 0, 0.00287438235294118, 0.00294829411764706, 0, 0, 0.00294829411764706, 0.441176470588235, -1.47058823529412e-08, // f 253//1 246//235 247//234 -0.000728176470588235, 0.441176470588235, -1.47058823529412e-08, 0.00294829411764706, 0.441176470588235, -1.47058823529412e-08, 0.00156407352941176, 0.441176470588235, -0.00287439705882353, // f 253//1 247//234 248//236 -0.000728176470588235, 0.441176470588235, -1.47058823529412e-08, 0.00156407352941176, 0.441176470588235, -0.00287439705882353, -0.00154626470588235, 0.441176470588235, -0.00358430882352941, // f 253//1 248//236 249//237 -0.000728176470588235, 0.441176470588235, -1.47058823529412e-08, -0.00154626470588235, 0.441176470588235, -0.00358430882352941, -0.00404055882352941, 0.441176470588235, -0.00159517647058824, // f 253//1 249//237 250//238 -0.000728176470588235, 0.441176470588235, -1.47058823529412e-08, -0.00404055882352941, 0.441176470588235, -0.00159517647058824, -0.00404055882352941, 0.441176470588235, 0.00159514705882353, // f 253//1 250//238 251//239 -0.000728176470588235, 0.441176470588235, -1.47058823529412e-08, -0.00404055882352941, 0.441176470588235, 0.00159514705882353, -0.00154626470588235, 0.441176470588235, 0.00358427941176471, // f 253//1 251//239 252//240 -0.000728176470588235, 0.441176470588235, -1.47058823529412e-08, -0.00154626470588235, 0.441176470588235, 0.00358427941176471, 0.00156407352941176, 0.441176470588235, 0.00287436764705882, // f 253//1 252//240 246//235 -0.000728176470588235, 0.441176470588235, -1.47058823529412e-08, 0.00156407352941176, 0.441176470588235, 0.00287436764705882, 0.00294829411764706, 0.441176470588235, -1.47058823529412e-08, // f 254//222 256//241 255//242 -0.000728176470588235, 0.441176470588235, -1.47058823529412e-08, 0.00844079411764706, 0.441176470588235, -0.0114975441176471, 0.0139777058823529, 0.441176470588235, -1.47058823529412e-08, // f 254//222 257//243 256//241 -0.000728176470588235, 0.441176470588235, -1.47058823529412e-08, -0.00400054411764706, 0.441176470588235, -0.0143371911764706, 0.00844079411764706, 0.441176470588235, -0.0114975441176471, // f 254//222 258//244 257//243 -0.000728176470588235, 0.441176470588235, -1.47058823529412e-08, -0.0139777058823529, 0.441176470588235, -0.00638066176470588, -0.00400054411764706, 0.441176470588235, -0.0143371911764706, // f 254//222 259//245 258//244 -0.000728176470588235, 0.441176470588235, -1.47058823529412e-08, -0.0139777058823529, 0.441176470588235, 0.00638063235294118, -0.0139777058823529, 0.441176470588235, -0.00638066176470588, // f 254//222 260//246 259//245 -0.000728176470588235, 0.441176470588235, -1.47058823529412e-08, -0.00400052941176471, 0.441176470588235, 0.0143371617647059, -0.0139777058823529, 0.441176470588235, 0.00638063235294118, // f 254//222 261//247 260//246 -0.000728176470588235, 0.441176470588235, -1.47058823529412e-08, 0.00844079411764706, 0.441176470588235, 0.0114975, -0.00400052941176471, 0.441176470588235, 0.0143371617647059, // f 254//222 255//242 261//247 -0.000728176470588235, 0.441176470588235, -1.47058823529412e-08, 0.0139777058823529, 0.441176470588235, -1.47058823529412e-08, 0.00844079411764706, 0.441176470588235, 0.0114975, // f 255//242 263//248 262//249 0.0139777058823529, 0.441176470588235, -1.47058823529412e-08, -0.000728176470588235, 0.5, -1.47058823529412e-08, -0.000728176470588235, 0.5, -1.47058823529412e-08, // f 255//242 256//241 263//248 0.0139777058823529, 0.441176470588235, -1.47058823529412e-08, 0.00844079411764706, 0.441176470588235, -0.0114975441176471, -0.000728176470588235, 0.5, -1.47058823529412e-08, // f 256//241 264//250 263//248 0.00844079411764706, 0.441176470588235, -0.0114975441176471, -0.000728176470588235, 0.5, -1.47058823529412e-08, -0.000728176470588235, 0.5, -1.47058823529412e-08, // f 256//241 257//243 264//250 0.00844079411764706, 0.441176470588235, -0.0114975441176471, -0.00400054411764706, 0.441176470588235, -0.0143371911764706, -0.000728176470588235, 0.5, -1.47058823529412e-08, // f 257//243 265//251 264//250 -0.00400054411764706, 0.441176470588235, -0.0143371911764706, -0.000728176470588235, 0.5, -1.47058823529412e-08, -0.000728176470588235, 0.5, -1.47058823529412e-08, // f 257//243 258//244 265//251 -0.00400054411764706, 0.441176470588235, -0.0143371911764706, -0.0139777058823529, 0.441176470588235, -0.00638066176470588, -0.000728176470588235, 0.5, -1.47058823529412e-08, // f 258//244 266//252 265//251 -0.0139777058823529, 0.441176470588235, -0.00638066176470588, -0.000728176470588235, 0.5, -1.47058823529412e-08, -0.000728176470588235, 0.5, -1.47058823529412e-08, // f 258//244 259//245 266//252 -0.0139777058823529, 0.441176470588235, -0.00638066176470588, -0.0139777058823529, 0.441176470588235, 0.00638063235294118, -0.000728176470588235, 0.5, -1.47058823529412e-08, // f 259//245 267//253 266//252 -0.0139777058823529, 0.441176470588235, 0.00638063235294118, -0.000728176470588235, 0.5, -1.47058823529412e-08, -0.000728176470588235, 0.5, -1.47058823529412e-08, // f 259//245 260//246 267//253 -0.0139777058823529, 0.441176470588235, 0.00638063235294118, -0.00400052941176471, 0.441176470588235, 0.0143371617647059, -0.000728176470588235, 0.5, -1.47058823529412e-08, // f 260//246 268//254 267//253 -0.00400052941176471, 0.441176470588235, 0.0143371617647059, -0.000728176470588235, 0.5, -1.47058823529412e-08, -0.000728176470588235, 0.5, -1.47058823529412e-08, // f 260//246 261//247 268//254 -0.00400052941176471, 0.441176470588235, 0.0143371617647059, 0.00844079411764706, 0.441176470588235, 0.0114975, -0.000728176470588235, 0.5, -1.47058823529412e-08, // f 261//247 262//249 268//254 0.00844079411764706, 0.441176470588235, 0.0114975, -0.000728176470588235, 0.5, -1.47058823529412e-08, -0.000728176470588235, 0.5, -1.47058823529412e-08, // f 261//247 255//242 262//249 0.00844079411764706, 0.441176470588235, 0.0114975, 0.0139777058823529, 0.441176470588235, -1.47058823529412e-08, -0.000728176470588235, 0.5, -1.47058823529412e-08, // f 269//255 262//249 263//248 -0.000728176470588235, 0.5, -1.47058823529412e-08, -0.000728176470588235, 0.5, -1.47058823529412e-08, -0.000728176470588235, 0.5, -1.47058823529412e-08, // f 269//255 263//248 264//250 -0.000728176470588235, 0.5, -1.47058823529412e-08, -0.000728176470588235, 0.5, -1.47058823529412e-08, -0.000728176470588235, 0.5, -1.47058823529412e-08, // f 269//255 264//250 265//251 -0.000728176470588235, 0.5, -1.47058823529412e-08, -0.000728176470588235, 0.5, -1.47058823529412e-08, -0.000728176470588235, 0.5, -1.47058823529412e-08, // f 269//255 265//251 266//252 -0.000728176470588235, 0.5, -1.47058823529412e-08, -0.000728176470588235, 0.5, -1.47058823529412e-08, -0.000728176470588235, 0.5, -1.47058823529412e-08, // f 269//255 266//252 267//253 -0.000728176470588235, 0.5, -1.47058823529412e-08, -0.000728176470588235, 0.5, -1.47058823529412e-08, -0.000728176470588235, 0.5, -1.47058823529412e-08, // f 269//255 267//253 268//254 -0.000728176470588235, 0.5, -1.47058823529412e-08, -0.000728176470588235, 0.5, -1.47058823529412e-08, -0.000728176470588235, 0.5, -1.47058823529412e-08, // f 269//255 268//254 262//249 -0.000728176470588235, 0.5, -1.47058823529412e-08, -0.000728176470588235, 0.5, -1.47058823529412e-08, -0.000728176470588235, 0.5, -1.47058823529412e-08, // f 270//1 272//240 271//235 -0.000728176470588235, 0, 0, 0.00156407352941176, 0, 0.00287438235294118, 0.00294829411764706, 0, 0, // f 270//1 273//239 272//240 -0.000728176470588235, 0, 0, -0.00154626470588235, 0, 0.00358429411764706, 0.00156407352941176, 0, 0.00287438235294118, // f 270//1 274//238 273//239 -0.000728176470588235, 0, 0, -0.00404055882352941, 0, 0.00159516176470588, -0.00154626470588235, 0, 0.00358429411764706, // f 270//1 275//237 274//238 -0.000728176470588235, 0, 0, -0.00404055882352941, -0, -0.00159516176470588, -0.00404055882352941, 0, 0.00159516176470588, // f 270//1 276//256 275//237 -0.000728176470588235, 0, 0, -0.00154626470588235, -0, -0.00358429411764706, -0.00404055882352941, -0, -0.00159516176470588, // f 270//1 277//234 276//256 -0.000728176470588235, 0, 0, 0.00156407352941176, -0, -0.00287438235294118, -0.00154626470588235, -0, -0.00358429411764706, // f 270//1 271//235 277//234 -0.000728176470588235, 0, 0, 0.00294829411764706, 0, 0, 0.00156407352941176, -0, -0.00287438235294118, // f 271//235 279//233 278//228 0.00294829411764706, 0, 0, 0.00156407352941176, -0.441176470588235, 0.00287432352941176, 0.00294829411764706, -0.441176470588235, -5.88235294117647e-08, // f 271//235 272//240 279//233 0.00294829411764706, 0, 0, 0.00156407352941176, 0, 0.00287438235294118, 0.00156407352941176, -0.441176470588235, 0.00287432352941176, // f 272//240 280//232 279//233 0.00156407352941176, 0, 0.00287438235294118, -0.00154626470588235, -0.441176470588235, 0.00358423529411765, 0.00156407352941176, -0.441176470588235, 0.00287432352941176, // f 272//240 273//239 280//232 0.00156407352941176, 0, 0.00287438235294118, -0.00154626470588235, 0, 0.00358429411764706, -0.00154626470588235, -0.441176470588235, 0.00358423529411765, // f 273//239 281//257 280//232 -0.00154626470588235, 0, 0.00358429411764706, -0.00404055882352941, -0.441176470588235, 0.00159510294117647, -0.00154626470588235, -0.441176470588235, 0.00358423529411765, // f 273//239 274//238 281//257 -0.00154626470588235, 0, 0.00358429411764706, -0.00404055882352941, 0, 0.00159516176470588, -0.00404055882352941, -0.441176470588235, 0.00159510294117647, // f 274//238 282//230 281//257 -0.00404055882352941, 0, 0.00159516176470588, -0.00404055882352941, -0.441176470588235, -0.00159520588235294, -0.00404055882352941, -0.441176470588235, 0.00159510294117647, // f 274//238 275//237 282//230 -0.00404055882352941, 0, 0.00159516176470588, -0.00404055882352941, -0, -0.00159516176470588, -0.00404055882352941, -0.441176470588235, -0.00159520588235294, // f 275//237 283//258 282//230 -0.00404055882352941, -0, -0.00159516176470588, -0.00154626470588235, -0.441176470588235, -0.00358435294117647, -0.00404055882352941, -0.441176470588235, -0.00159520588235294, // f 275//237 276//256 283//258 -0.00404055882352941, -0, -0.00159516176470588, -0.00154626470588235, -0, -0.00358429411764706, -0.00154626470588235, -0.441176470588235, -0.00358435294117647, // f 276//256 284//259 283//258 -0.00154626470588235, -0, -0.00358429411764706, 0.00156407352941176, -0.441176470588235, -0.00287442647058824, -0.00154626470588235, -0.441176470588235, -0.00358435294117647, // f 276//256 277//234 284//259 -0.00154626470588235, -0, -0.00358429411764706, 0.00156407352941176, -0, -0.00287438235294118, 0.00156407352941176, -0.441176470588235, -0.00287442647058824, // f 277//234 278//228 284//259 0.00156407352941176, -0, -0.00287438235294118, 0.00294829411764706, -0.441176470588235, -5.88235294117647e-08, 0.00156407352941176, -0.441176470588235, -0.00287442647058824, // f 277//234 271//235 278//228 0.00156407352941176, -0, -0.00287438235294118, 0.00294829411764706, 0, 0, 0.00294829411764706, -0.441176470588235, -5.88235294117647e-08, // f 285//222 278//228 279//233 -0.000728176470588235, -0.441176470588235, -5.88235294117647e-08, 0.00294829411764706, -0.441176470588235, -5.88235294117647e-08, 0.00156407352941176, -0.441176470588235, 0.00287432352941176, // f 285//222 279//233 280//232 -0.000728176470588235, -0.441176470588235, -5.88235294117647e-08, 0.00156407352941176, -0.441176470588235, 0.00287432352941176, -0.00154626470588235, -0.441176470588235, 0.00358423529411765, // f 285//222 280//232 281//257 -0.000728176470588235, -0.441176470588235, -5.88235294117647e-08, -0.00154626470588235, -0.441176470588235, 0.00358423529411765, -0.00404055882352941, -0.441176470588235, 0.00159510294117647, // f 285//222 281//257 282//230 -0.000728176470588235, -0.441176470588235, -5.88235294117647e-08, -0.00404055882352941, -0.441176470588235, 0.00159510294117647, -0.00404055882352941, -0.441176470588235, -0.00159520588235294, // f 285//222 282//230 283//258 -0.000728176470588235, -0.441176470588235, -5.88235294117647e-08, -0.00404055882352941, -0.441176470588235, -0.00159520588235294, -0.00154626470588235, -0.441176470588235, -0.00358435294117647, // f 285//222 283//258 284//259 -0.000728176470588235, -0.441176470588235, -5.88235294117647e-08, -0.00154626470588235, -0.441176470588235, -0.00358435294117647, 0.00156407352941176, -0.441176470588235, -0.00287442647058824, // f 285//222 284//259 278//228 -0.000728176470588235, -0.441176470588235, -5.88235294117647e-08, 0.00156407352941176, -0.441176470588235, -0.00287442647058824, 0.00294829411764706, -0.441176470588235, -5.88235294117647e-08, // f 286//1 288//260 287//261 -0.000728176470588235, -0.441176470588235, -5.88235294117647e-08, 0.00844079411764706, -0.441176470588235, 0.0114974705882353, 0.0139777058823529, -0.441176470588235, -5.88235294117647e-08, // f 286//1 289//262 288//260 -0.000728176470588235, -0.441176470588235, -5.88235294117647e-08, -0.00400054411764706, -0.441176470588235, 0.0143371176470588, 0.00844079411764706, -0.441176470588235, 0.0114974705882353, // f 286//1 290//263 289//262 -0.000728176470588235, -0.441176470588235, -5.88235294117647e-08, -0.0139777058823529, -0.441176470588235, 0.00638058823529412, -0.00400054411764706, -0.441176470588235, 0.0143371176470588, // f 286//1 291//264 290//263 -0.000728176470588235, -0.441176470588235, -5.88235294117647e-08, -0.0139777058823529, -0.441176470588235, -0.00638069117647059, -0.0139777058823529, -0.441176470588235, 0.00638058823529412, // f 286//1 292//265 291//264 -0.000728176470588235, -0.441176470588235, -5.88235294117647e-08, -0.00400052941176471, -0.441176470588235, -0.0143372205882353, -0.0139777058823529, -0.441176470588235, -0.00638069117647059, // f 286//1 293//266 292//265 -0.000728176470588235, -0.441176470588235, -5.88235294117647e-08, 0.00844079411764706, -0.441176470588235, -0.0114975735294118, -0.00400052941176471, -0.441176470588235, -0.0143372205882353, // f 286//1 287//261 293//266 -0.000728176470588235, -0.441176470588235, -5.88235294117647e-08, 0.0139777058823529, -0.441176470588235, -5.88235294117647e-08, 0.00844079411764706, -0.441176470588235, -0.0114975735294118, // f 287//261 295//267 294//268 0.0139777058823529, -0.441176470588235, -5.88235294117647e-08, -0.000728176470588235, -0.5, -5.88235294117647e-08, -0.000728176470588235, -0.5, -5.88235294117647e-08, // f 287//261 288//260 295//267 0.0139777058823529, -0.441176470588235, -5.88235294117647e-08, 0.00844079411764706, -0.441176470588235, 0.0114974705882353, -0.000728176470588235, -0.5, -5.88235294117647e-08, // f 288//260 296//269 295//267 0.00844079411764706, -0.441176470588235, 0.0114974705882353, -0.000728176470588235, -0.5, -5.88235294117647e-08, -0.000728176470588235, -0.5, -5.88235294117647e-08, // f 288//260 289//262 296//269 0.00844079411764706, -0.441176470588235, 0.0114974705882353, -0.00400054411764706, -0.441176470588235, 0.0143371176470588, -0.000728176470588235, -0.5, -5.88235294117647e-08, // f 289//262 297//270 296//269 -0.00400054411764706, -0.441176470588235, 0.0143371176470588, -0.000728176470588235, -0.5, -5.88235294117647e-08, -0.000728176470588235, -0.5, -5.88235294117647e-08, // f 289//262 290//263 297//270 -0.00400054411764706, -0.441176470588235, 0.0143371176470588, -0.0139777058823529, -0.441176470588235, 0.00638058823529412, -0.000728176470588235, -0.5, -5.88235294117647e-08, // f 290//263 298//271 297//270 -0.0139777058823529, -0.441176470588235, 0.00638058823529412, -0.000728176470588235, -0.5, -5.88235294117647e-08, -0.000728176470588235, -0.5, -5.88235294117647e-08, // f 290//263 291//264 298//271 -0.0139777058823529, -0.441176470588235, 0.00638058823529412, -0.0139777058823529, -0.441176470588235, -0.00638069117647059, -0.000728176470588235, -0.5, -5.88235294117647e-08, // f 291//264 299//272 298//271 -0.0139777058823529, -0.441176470588235, -0.00638069117647059, -0.000728176470588235, -0.5, -5.88235294117647e-08, -0.000728176470588235, -0.5, -5.88235294117647e-08, // f 291//264 292//265 299//272 -0.0139777058823529, -0.441176470588235, -0.00638069117647059, -0.00400052941176471, -0.441176470588235, -0.0143372205882353, -0.000728176470588235, -0.5, -5.88235294117647e-08, // f 292//265 300//273 299//272 -0.00400052941176471, -0.441176470588235, -0.0143372205882353, -0.000728176470588235, -0.5, -5.88235294117647e-08, -0.000728176470588235, -0.5, -5.88235294117647e-08, // f 292//265 293//266 300//273 -0.00400052941176471, -0.441176470588235, -0.0143372205882353, 0.00844079411764706, -0.441176470588235, -0.0114975735294118, -0.000728176470588235, -0.5, -5.88235294117647e-08, // f 293//266 294//268 300//273 0.00844079411764706, -0.441176470588235, -0.0114975735294118, -0.000728176470588235, -0.5, -5.88235294117647e-08, -0.000728176470588235, -0.5, -5.88235294117647e-08, // f 293//266 287//261 294//268 0.00844079411764706, -0.441176470588235, -0.0114975735294118, 0.0139777058823529, -0.441176470588235, -5.88235294117647e-08, -0.000728176470588235, -0.5, -5.88235294117647e-08, // f 301//274 294//268 295//267 -0.000728176470588235, -0.5, -5.88235294117647e-08, -0.000728176470588235, -0.5, -5.88235294117647e-08, -0.000728176470588235, -0.5, -5.88235294117647e-08, // f 301//274 295//267 296//269 -0.000728176470588235, -0.5, -5.88235294117647e-08, -0.000728176470588235, -0.5, -5.88235294117647e-08, -0.000728176470588235, -0.5, -5.88235294117647e-08, // f 301//274 296//269 297//270 -0.000728176470588235, -0.5, -5.88235294117647e-08, -0.000728176470588235, -0.5, -5.88235294117647e-08, -0.000728176470588235, -0.5, -5.88235294117647e-08, // f 301//274 297//270 298//271 -0.000728176470588235, -0.5, -5.88235294117647e-08, -0.000728176470588235, -0.5, -5.88235294117647e-08, -0.000728176470588235, -0.5, -5.88235294117647e-08, // f 301//274 298//271 299//272 -0.000728176470588235, -0.5, -5.88235294117647e-08, -0.000728176470588235, -0.5, -5.88235294117647e-08, -0.000728176470588235, -0.5, -5.88235294117647e-08, // f 301//274 299//272 300//273 -0.000728176470588235, -0.5, -5.88235294117647e-08, -0.000728176470588235, -0.5, -5.88235294117647e-08, -0.000728176470588235, -0.5, -5.88235294117647e-08, // f 301//274 300//273 294//268 -0.000728176470588235, -0.5, -5.88235294117647e-08, -0.000728176470588235, -0.5, -5.88235294117647e-08, -0.000728176470588235, -0.5, -5.88235294117647e-08, // f 302//275 304//276 303//277 0, 0.000728176470588235, 2.5e-07, -0.00287438235294118, -0.00156407352941176, -5.44117647058824e-07, 0, -0.00294829411764706, -1.01470588235294e-06, // f 302//275 305//278 304//276 0, 0.000728176470588235, 2.5e-07, -0.00358429411764706, 0.00154626470588235, 5.29411764705882e-07, -0.00287438235294118, -0.00156407352941176, -5.44117647058824e-07, // f 302//275 306//279 305//278 0, 0.000728176470588235, 2.5e-07, -0.00159516176470588, 0.00404055882352941, 1.39705882352941e-06, -0.00358429411764706, 0.00154626470588235, 5.29411764705882e-07, // f 302//275 307//280 306//279 0, 0.000728176470588235, 2.5e-07, 0.00159516176470588, 0.00404055882352941, 1.39705882352941e-06, -0.00159516176470588, 0.00404055882352941, 1.39705882352941e-06, // f 302//275 308//281 307//280 0, 0.000728176470588235, 2.5e-07, 0.00358429411764706, 0.00154626470588235, 5.29411764705882e-07, 0.00159516176470588, 0.00404055882352941, 1.39705882352941e-06, // f 302//275 309//282 308//281 0, 0.000728176470588235, 2.5e-07, 0.00287438235294118, -0.00156407352941176, -5.44117647058824e-07, 0.00358429411764706, 0.00154626470588235, 5.29411764705882e-07, // f 302//275 303//277 309//282 0, 0.000728176470588235, 2.5e-07, 0, -0.00294829411764706, -1.01470588235294e-06, 0.00287438235294118, -0.00156407352941176, -5.44117647058824e-07, // f 303//277 311//283 310//284 0, -0.00294829411764706, -1.01470588235294e-06, -0.00287436764705882, -0.00141177941176471, -0.441177, 1.47058823529412e-08, -0.00279601470588235, -0.441177485294118, // f 303//277 304//276 311//283 0, -0.00294829411764706, -1.01470588235294e-06, -0.00287438235294118, -0.00156407352941176, -5.44117647058824e-07, -0.00287436764705882, -0.00141177941176471, -0.441177, // f 304//276 312//285 311//283 -0.00287438235294118, -0.00156407352941176, -5.44117647058824e-07, -0.00358427941176471, 0.00169855882352941, -0.441175941176471, -0.00287436764705882, -0.00141177941176471, -0.441177, // f 304//276 305//278 312//285 -0.00287438235294118, -0.00156407352941176, -5.44117647058824e-07, -0.00358429411764706, 0.00154626470588235, 5.29411764705882e-07, -0.00358427941176471, 0.00169855882352941, -0.441175941176471, // f 305//278 313//286 312//285 -0.00358429411764706, 0.00154626470588235, 5.29411764705882e-07, -0.00159514705882353, 0.00419285294117647, -0.441175073529412, -0.00358427941176471, 0.00169855882352941, -0.441175941176471, // f 305//278 306//279 313//286 -0.00358429411764706, 0.00154626470588235, 5.29411764705882e-07, -0.00159516176470588, 0.00404055882352941, 1.39705882352941e-06, -0.00159514705882353, 0.00419285294117647, -0.441175073529412, // f 306//279 314//287 313//286 -0.00159516176470588, 0.00404055882352941, 1.39705882352941e-06, 0.00159517647058824, 0.00419285294117647, -0.441175073529412, -0.00159514705882353, 0.00419285294117647, -0.441175073529412, // f 306//279 307//280 314//287 -0.00159516176470588, 0.00404055882352941, 1.39705882352941e-06, 0.00159516176470588, 0.00404055882352941, 1.39705882352941e-06, 0.00159517647058824, 0.00419285294117647, -0.441175073529412, // f 307//280 315//288 314//287 0.00159516176470588, 0.00404055882352941, 1.39705882352941e-06, 0.00358430882352941, 0.00169855882352941, -0.441175941176471, 0.00159517647058824, 0.00419285294117647, -0.441175073529412, // f 307//280 308//281 315//288 0.00159516176470588, 0.00404055882352941, 1.39705882352941e-06, 0.00358429411764706, 0.00154626470588235, 5.29411764705882e-07, 0.00358430882352941, 0.00169855882352941, -0.441175941176471, // f 308//281 316//289 315//288 0.00358429411764706, 0.00154626470588235, 5.29411764705882e-07, 0.00287439705882353, -0.00141177941176471, -0.441177, 0.00358430882352941, 0.00169855882352941, -0.441175941176471, // f 308//281 309//282 316//289 0.00358429411764706, 0.00154626470588235, 5.29411764705882e-07, 0.00287438235294118, -0.00156407352941176, -5.44117647058824e-07, 0.00287439705882353, -0.00141177941176471, -0.441177, // f 309//282 310//284 316//289 0.00287438235294118, -0.00156407352941176, -5.44117647058824e-07, 1.47058823529412e-08, -0.00279601470588235, -0.441177485294118, 0.00287439705882353, -0.00141177941176471, -0.441177, // f 309//282 303//277 310//284 0.00287438235294118, -0.00156407352941176, -5.44117647058824e-07, 0, -0.00294829411764706, -1.01470588235294e-06, 1.47058823529412e-08, -0.00279601470588235, -0.441177485294118, // f 317//290 310//284 311//283 1.47058823529412e-08, 0.000880455882352941, -0.441176220588235, 1.47058823529412e-08, -0.00279601470588235, -0.441177485294118, -0.00287436764705882, -0.00141177941176471, -0.441177, // f 317//290 311//283 312//285 1.47058823529412e-08, 0.000880455882352941, -0.441176220588235, -0.00287436764705882, -0.00141177941176471, -0.441177, -0.00358427941176471, 0.00169855882352941, -0.441175941176471, // f 317//290 312//285 313//286 1.47058823529412e-08, 0.000880455882352941, -0.441176220588235, -0.00358427941176471, 0.00169855882352941, -0.441175941176471, -0.00159514705882353, 0.00419285294117647, -0.441175073529412, // f 317//290 313//286 314//287 1.47058823529412e-08, 0.000880455882352941, -0.441176220588235, -0.00159514705882353, 0.00419285294117647, -0.441175073529412, 0.00159517647058824, 0.00419285294117647, -0.441175073529412, // f 317//290 314//287 315//288 1.47058823529412e-08, 0.000880455882352941, -0.441176220588235, 0.00159517647058824, 0.00419285294117647, -0.441175073529412, 0.00358430882352941, 0.00169855882352941, -0.441175941176471, // f 317//290 315//288 316//289 1.47058823529412e-08, 0.000880455882352941, -0.441176220588235, 0.00358430882352941, 0.00169855882352941, -0.441175941176471, 0.00287439705882353, -0.00141177941176471, -0.441177, // f 317//290 316//289 310//284 1.47058823529412e-08, 0.000880455882352941, -0.441176220588235, 0.00287439705882353, -0.00141177941176471, -0.441177, 1.47058823529412e-08, -0.00279601470588235, -0.441177485294118, // f 318//275 320//291 319//292 1.47058823529412e-08, 0.000880455882352941, -0.441176220588235, -0.0114975147058824, -0.0082885, -0.441179382352941, 1.47058823529412e-08, -0.0138254117647059, -0.441181294117647, // f 318//275 321//293 320//291 1.47058823529412e-08, 0.000880455882352941, -0.441176220588235, -0.0143371617647059, 0.00415282352941176, -0.441175102941176, -0.0114975147058824, -0.0082885, -0.441179382352941, // f 318//275 322//294 321//293 1.47058823529412e-08, 0.000880455882352941, -0.441176220588235, -0.00638063235294118, 0.01413, -0.441171647058824, -0.0143371617647059, 0.00415282352941176, -0.441175102941176, // f 318//275 323//295 322//294 1.47058823529412e-08, 0.000880455882352941, -0.441176220588235, 0.00638066176470588, 0.01413, -0.441171647058824, -0.00638063235294118, 0.01413, -0.441171647058824, // f 318//275 324//296 323//295 1.47058823529412e-08, 0.000880455882352941, -0.441176220588235, 0.0143371911764706, 0.00415282352941176, -0.441175102941176, 0.00638066176470588, 0.01413, -0.441171647058824, // f 318//275 325//297 324//296 1.47058823529412e-08, 0.000880455882352941, -0.441176220588235, 0.0114975294117647, -0.0082885, -0.441179382352941, 0.0143371911764706, 0.00415282352941176, -0.441175102941176, // f 318//275 319//292 325//297 1.47058823529412e-08, 0.000880455882352941, -0.441176220588235, 1.47058823529412e-08, -0.0138254117647059, -0.441181294117647, 0.0114975294117647, -0.0082885, -0.441179382352941, // f 319//292 327//298 326//299 1.47058823529412e-08, -0.0138254117647059, -0.441181294117647, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, // f 319//292 320//291 327//298 1.47058823529412e-08, -0.0138254117647059, -0.441181294117647, -0.0114975147058824, -0.0082885, -0.441179382352941, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, // f 320//291 328//300 327//298 -0.0114975147058824, -0.0082885, -0.441179382352941, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, // f 320//291 321//293 328//300 -0.0114975147058824, -0.0082885, -0.441179382352941, -0.0143371617647059, 0.00415282352941176, -0.441175102941176, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, // f 321//293 329//301 328//300 -0.0143371617647059, 0.00415282352941176, -0.441175102941176, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, // f 321//293 322//294 329//301 -0.0143371617647059, 0.00415282352941176, -0.441175102941176, -0.00638063235294118, 0.01413, -0.441171647058824, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, // f 322//294 330//302 329//301 -0.00638063235294118, 0.01413, -0.441171647058824, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, // f 322//294 323//295 330//302 -0.00638063235294118, 0.01413, -0.441171647058824, 0.00638066176470588, 0.01413, -0.441171647058824, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, // f 323//295 331//303 330//302 0.00638066176470588, 0.01413, -0.441171647058824, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, // f 323//295 324//296 331//303 0.00638066176470588, 0.01413, -0.441171647058824, 0.0143371911764706, 0.00415282352941176, -0.441175102941176, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, // f 324//296 332//304 331//303 0.0143371911764706, 0.00415282352941176, -0.441175102941176, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, // f 324//296 325//297 332//304 0.0143371911764706, 0.00415282352941176, -0.441175102941176, 0.0114975294117647, -0.0082885, -0.441179382352941, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, // f 325//297 326//299 332//304 0.0114975294117647, -0.0082885, -0.441179382352941, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, // f 325//297 319//292 326//299 0.0114975294117647, -0.0082885, -0.441179382352941, 1.47058823529412e-08, -0.0138254117647059, -0.441181294117647, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, // f 333//305 326//299 327//298 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, // f 333//305 327//298 328//300 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, // f 333//305 328//300 329//301 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, // f 333//305 329//301 330//302 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, // f 333//305 330//302 331//303 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, // f 333//305 331//303 332//304 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, // f 333//305 332//304 326//299 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, 1.47058823529412e-08, 0.000900764705882353, -0.499999779411765, // f 334//225 336//306 335//307 0, 0.000728176470588235, -0, 0.00287438235294118, -0.00156407352941176, 0, 0, -0.00294829411764706, 0, // f 334//225 337//308 336//306 0, 0.000728176470588235, -0, 0.00358429411764706, 0.00154626470588235, -0, 0.00287438235294118, -0.00156407352941176, 0, // f 334//225 338//309 337//308 0, 0.000728176470588235, -0, 0.00159516176470588, 0.00404055882352941, -0, 0.00358429411764706, 0.00154626470588235, -0, // f 334//225 339//310 338//309 0, 0.000728176470588235, -0, -0.00159516176470588, 0.00404055882352941, -0, 0.00159516176470588, 0.00404055882352941, -0, // f 334//225 340//311 339//310 0, 0.000728176470588235, -0, -0.00358429411764706, 0.00154626470588235, -0, -0.00159516176470588, 0.00404055882352941, -0, // f 334//225 341//312 340//311 0, 0.000728176470588235, -0, -0.00287438235294118, -0.00156407352941176, 0, -0.00358429411764706, 0.00154626470588235, -0, // f 334//225 335//307 341//312 0, 0.000728176470588235, -0, 0, -0.00294829411764706, 0, -0.00287438235294118, -0.00156407352941176, 0, // f 335//307 343//313 342//314 0, -0.00294829411764706, 0, 0.00287444117647059, -0.00156398529411765, 0.441176470588235, 5.88235294117647e-08, -0.00294820588235294, 0.441176470588235, // f 335//307 336//306 343//313 0, -0.00294829411764706, 0, 0.00287438235294118, -0.00156407352941176, 0, 0.00287444117647059, -0.00156398529411765, 0.441176470588235, // f 336//306 344//315 343//313 0.00287438235294118, -0.00156407352941176, 0, 0.00358435294117647, 0.00154635294117647, 0.441176470588235, 0.00287444117647059, -0.00156398529411765, 0.441176470588235, // f 336//306 337//308 344//315 0.00287438235294118, -0.00156407352941176, 0, 0.00358429411764706, 0.00154626470588235, -0, 0.00358435294117647, 0.00154635294117647, 0.441176470588235, // f 337//308 345//316 344//315 0.00358429411764706, 0.00154626470588235, -0, 0.00159522058823529, 0.00404064705882353, 0.441176470588235, 0.00358435294117647, 0.00154635294117647, 0.441176470588235, // f 337//308 338//309 345//316 0.00358429411764706, 0.00154626470588235, -0, 0.00159516176470588, 0.00404055882352941, -0, 0.00159522058823529, 0.00404064705882353, 0.441176470588235, // f 338//309 346//317 345//316 0.00159516176470588, 0.00404055882352941, -0, -0.00159508823529412, 0.00404064705882353, 0.441176470588235, 0.00159522058823529, 0.00404064705882353, 0.441176470588235, // f 338//309 339//310 346//317 0.00159516176470588, 0.00404055882352941, -0, -0.00159516176470588, 0.00404055882352941, -0, -0.00159508823529412, 0.00404064705882353, 0.441176470588235, // f 339//310 347//318 346//317 -0.00159516176470588, 0.00404055882352941, -0, -0.00358423529411765, 0.00154635294117647, 0.441176470588235, -0.00159508823529412, 0.00404064705882353, 0.441176470588235, // f 339//310 340//311 347//318 -0.00159516176470588, 0.00404055882352941, -0, -0.00358429411764706, 0.00154626470588235, -0, -0.00358423529411765, 0.00154635294117647, 0.441176470588235, // f 340//311 348//319 347//318 -0.00358429411764706, 0.00154626470588235, -0, -0.00287430882352941, -0.00156398529411765, 0.441176470588235, -0.00358423529411765, 0.00154635294117647, 0.441176470588235, // f 340//311 341//312 348//319 -0.00358429411764706, 0.00154626470588235, -0, -0.00287438235294118, -0.00156407352941176, 0, -0.00287430882352941, -0.00156398529411765, 0.441176470588235, // f 341//312 342//314 348//319 -0.00287438235294118, -0.00156407352941176, 0, 5.88235294117647e-08, -0.00294820588235294, 0.441176470588235, -0.00287430882352941, -0.00156398529411765, 0.441176470588235, // f 341//312 335//307 342//314 -0.00287438235294118, -0.00156407352941176, 0, 0, -0.00294829411764706, 0, 5.88235294117647e-08, -0.00294820588235294, 0.441176470588235, // f 349//223 342//314 343//313 5.88235294117647e-08, 0.000728264705882353, 0.441176470588235, 5.88235294117647e-08, -0.00294820588235294, 0.441176470588235, 0.00287444117647059, -0.00156398529411765, 0.441176470588235, // f 349//223 343//313 344//315 5.88235294117647e-08, 0.000728264705882353, 0.441176470588235, 0.00287444117647059, -0.00156398529411765, 0.441176470588235, 0.00358435294117647, 0.00154635294117647, 0.441176470588235, // f 349//223 344//315 345//316 5.88235294117647e-08, 0.000728264705882353, 0.441176470588235, 0.00358435294117647, 0.00154635294117647, 0.441176470588235, 0.00159522058823529, 0.00404064705882353, 0.441176470588235, // f 349//223 345//316 346//317 5.88235294117647e-08, 0.000728264705882353, 0.441176470588235, 0.00159522058823529, 0.00404064705882353, 0.441176470588235, -0.00159508823529412, 0.00404064705882353, 0.441176470588235, // f 349//223 346//317 347//318 5.88235294117647e-08, 0.000728264705882353, 0.441176470588235, -0.00159508823529412, 0.00404064705882353, 0.441176470588235, -0.00358423529411765, 0.00154635294117647, 0.441176470588235, // f 349//223 347//318 348//319 5.88235294117647e-08, 0.000728264705882353, 0.441176470588235, -0.00358423529411765, 0.00154635294117647, 0.441176470588235, -0.00287430882352941, -0.00156398529411765, 0.441176470588235, // f 349//223 348//319 342//314 5.88235294117647e-08, 0.000728264705882353, 0.441176470588235, -0.00287430882352941, -0.00156398529411765, 0.441176470588235, 5.88235294117647e-08, -0.00294820588235294, 0.441176470588235, // f 350//225 352//320 351//321 5.88235294117647e-08, 0.000728264705882353, 0.441176470588235, 0.0114975882352941, -0.00844070588235294, 0.441176470588235, 7.35294117647059e-08, -0.0139776176470588, 0.441176470588235, // f 350//225 353//322 352//320 5.88235294117647e-08, 0.000728264705882353, 0.441176470588235, 0.0143372352941176, 0.00400063235294118, 0.441176470588235, 0.0114975882352941, -0.00844070588235294, 0.441176470588235, // f 350//225 354//323 353//322 5.88235294117647e-08, 0.000728264705882353, 0.441176470588235, 0.00638070588235294, 0.0139778088235294, 0.441176470588235, 0.0143372352941176, 0.00400063235294118, 0.441176470588235, // f 350//225 355//324 354//323 5.88235294117647e-08, 0.000728264705882353, 0.441176470588235, -0.00638057352941176, 0.0139778088235294, 0.441176470588235, 0.00638070588235294, 0.0139778088235294, 0.441176470588235, // f 350//225 356//325 355//324 5.88235294117647e-08, 0.000728264705882353, 0.441176470588235, -0.0143371029411765, 0.00400063235294118, 0.441176470588235, -0.00638057352941176, 0.0139778088235294, 0.441176470588235, // f 350//225 357//326 356//325 5.88235294117647e-08, 0.000728264705882353, 0.441176470588235, -0.0114974558823529, -0.00844070588235294, 0.441176470588235, -0.0143371029411765, 0.00400063235294118, 0.441176470588235, // f 350//225 351//321 357//326 5.88235294117647e-08, 0.000728264705882353, 0.441176470588235, 7.35294117647059e-08, -0.0139776176470588, 0.441176470588235, -0.0114974558823529, -0.00844070588235294, 0.441176470588235, // f 351//321 359//327 358//328 7.35294117647059e-08, -0.0139776176470588, 0.441176470588235, 7.35294117647059e-08, 0.000728279411764706, 0.5, 7.35294117647059e-08, 0.000728279411764706, 0.5, // f 351//321 352//320 359//327 7.35294117647059e-08, -0.0139776176470588, 0.441176470588235, 0.0114975882352941, -0.00844070588235294, 0.441176470588235, 7.35294117647059e-08, 0.000728279411764706, 0.5, // f 352//320 360//329 359//327 0.0114975882352941, -0.00844070588235294, 0.441176470588235, 7.35294117647059e-08, 0.000728279411764706, 0.5, 7.35294117647059e-08, 0.000728279411764706, 0.5, // f 352//320 353//322 360//329 0.0114975882352941, -0.00844070588235294, 0.441176470588235, 0.0143372352941176, 0.00400063235294118, 0.441176470588235, 7.35294117647059e-08, 0.000728279411764706, 0.5, // f 353//322 361//330 360//329 0.0143372352941176, 0.00400063235294118, 0.441176470588235, 7.35294117647059e-08, 0.000728279411764706, 0.5, 7.35294117647059e-08, 0.000728279411764706, 0.5, // f 353//322 354//323 361//330 0.0143372352941176, 0.00400063235294118, 0.441176470588235, 0.00638070588235294, 0.0139778088235294, 0.441176470588235, 7.35294117647059e-08, 0.000728279411764706, 0.5, // f 354//323 362//331 361//330 0.00638070588235294, 0.0139778088235294, 0.441176470588235, 7.35294117647059e-08, 0.000728279411764706, 0.5, 7.35294117647059e-08, 0.000728279411764706, 0.5, // f 354//323 355//324 362//331 0.00638070588235294, 0.0139778088235294, 0.441176470588235, -0.00638057352941176, 0.0139778088235294, 0.441176470588235, 7.35294117647059e-08, 0.000728279411764706, 0.5, // f 355//324 363//332 362//331 -0.00638057352941176, 0.0139778088235294, 0.441176470588235, 7.35294117647059e-08, 0.000728279411764706, 0.5, 7.35294117647059e-08, 0.000728279411764706, 0.5, // f 355//324 356//325 363//332 -0.00638057352941176, 0.0139778088235294, 0.441176470588235, -0.0143371029411765, 0.00400063235294118, 0.441176470588235, 7.35294117647059e-08, 0.000728279411764706, 0.5, // f 356//325 364//333 363//332 -0.0143371029411765, 0.00400063235294118, 0.441176470588235, 7.35294117647059e-08, 0.000728279411764706, 0.5, 7.35294117647059e-08, 0.000728279411764706, 0.5, // f 356//325 357//326 364//333 -0.0143371029411765, 0.00400063235294118, 0.441176470588235, -0.0114974558823529, -0.00844070588235294, 0.441176470588235, 7.35294117647059e-08, 0.000728279411764706, 0.5, // f 357//326 358//328 364//333 -0.0114974558823529, -0.00844070588235294, 0.441176470588235, 7.35294117647059e-08, 0.000728279411764706, 0.5, 7.35294117647059e-08, 0.000728279411764706, 0.5, // f 357//326 351//321 358//328 -0.0114974558823529, -0.00844070588235294, 0.441176470588235, 7.35294117647059e-08, -0.0139776176470588, 0.441176470588235, 7.35294117647059e-08, 0.000728279411764706, 0.5, // f 365//334 358//328 359//327 7.35294117647059e-08, 0.000728279411764706, 0.5, 7.35294117647059e-08, 0.000728279411764706, 0.5, 7.35294117647059e-08, 0.000728279411764706, 0.5, // f 365//334 359//327 360//329 7.35294117647059e-08, 0.000728279411764706, 0.5, 7.35294117647059e-08, 0.000728279411764706, 0.5, 7.35294117647059e-08, 0.000728279411764706, 0.5, // f 365//334 360//329 361//330 7.35294117647059e-08, 0.000728279411764706, 0.5, 7.35294117647059e-08, 0.000728279411764706, 0.5, 7.35294117647059e-08, 0.000728279411764706, 0.5, // f 365//334 361//330 362//331 7.35294117647059e-08, 0.000728279411764706, 0.5, 7.35294117647059e-08, 0.000728279411764706, 0.5, 7.35294117647059e-08, 0.000728279411764706, 0.5, // f 365//334 362//331 363//332 7.35294117647059e-08, 0.000728279411764706, 0.5, 7.35294117647059e-08, 0.000728279411764706, 0.5, 7.35294117647059e-08, 0.000728279411764706, 0.5, // f 365//334 363//332 364//333 7.35294117647059e-08, 0.000728279411764706, 0.5, 7.35294117647059e-08, 0.000728279411764706, 0.5, 7.35294117647059e-08, 0.000728279411764706, 0.5, // f 365//334 364//333 358//328 7.35294117647059e-08, 0.000728279411764706, 0.5, 7.35294117647059e-08, 0.000728279411764706, 0.5, 7.35294117647059e-08, 0.000728279411764706, 0.5, // f 366//335 368//336 367//337 -2.5e-07, 0.000728176470588235, -0, 5.44117647058824e-07, -0.00156407352941176, -0.00287438235294118, 1.02941176470588e-06, -0.00294829411764706, 0, // f 366//335 369//338 368//336 -2.5e-07, 0.000728176470588235, -0, -5.44117647058824e-07, 0.00154626470588235, -0.00358429411764706, 5.44117647058824e-07, -0.00156407352941176, -0.00287438235294118, // f 366//335 370//339 369//338 -2.5e-07, 0.000728176470588235, -0, -1.41176470588235e-06, 0.00404055882352941, -0.00159516176470588, -5.44117647058824e-07, 0.00154626470588235, -0.00358429411764706, // f 366//335 371//340 370//339 -2.5e-07, 0.000728176470588235, -0, -1.41176470588235e-06, 0.00404055882352941, 0.00159516176470588, -1.41176470588235e-06, 0.00404055882352941, -0.00159516176470588, // f 366//335 372//341 371//340 -2.5e-07, 0.000728176470588235, -0, -5.44117647058824e-07, 0.00154626470588235, 0.00358429411764706, -1.41176470588235e-06, 0.00404055882352941, 0.00159516176470588, // f 366//335 373//342 372//341 -2.5e-07, 0.000728176470588235, -0, 5.44117647058824e-07, -0.00156407352941176, 0.00287438235294118, -5.44117647058824e-07, 0.00154626470588235, 0.00358429411764706, // f 366//335 367//337 373//342 -2.5e-07, 0.000728176470588235, -0, 1.02941176470588e-06, -0.00294829411764706, 0, 5.44117647058824e-07, -0.00156407352941176, 0.00287438235294118, // f 367//337 375//343 374//344 1.02941176470588e-06, -0.00294829411764706, 0, 0.441177, -0.00141010294117647, -0.00287438235294118, 0.441177485294118, -0.00279433823529412, 0, // f 367//337 368//336 375//343 1.02941176470588e-06, -0.00294829411764706, 0, 5.44117647058824e-07, -0.00156407352941176, -0.00287438235294118, 0.441177, -0.00141010294117647, -0.00287438235294118, // f 368//336 376//345 375//343 5.44117647058824e-07, -0.00156407352941176, -0.00287438235294118, 0.441175911764706, 0.00170022058823529, -0.00358429411764706, 0.441177, -0.00141010294117647, -0.00287438235294118, // f 368//336 369//338 376//345 5.44117647058824e-07, -0.00156407352941176, -0.00287438235294118, -5.44117647058824e-07, 0.00154626470588235, -0.00358429411764706, 0.441175911764706, 0.00170022058823529, -0.00358429411764706, // f 369//338 377//346 376//345 -5.44117647058824e-07, 0.00154626470588235, -0.00358429411764706, 0.441175044117647, 0.00419451470588235, -0.00159516176470588, 0.441175911764706, 0.00170022058823529, -0.00358429411764706, // f 369//338 370//339 377//346 -5.44117647058824e-07, 0.00154626470588235, -0.00358429411764706, -1.41176470588235e-06, 0.00404055882352941, -0.00159516176470588, 0.441175044117647, 0.00419451470588235, -0.00159516176470588, // f 370//339 378//347 377//346 -1.41176470588235e-06, 0.00404055882352941, -0.00159516176470588, 0.441175044117647, 0.00419451470588235, 0.00159516176470588, 0.441175044117647, 0.00419451470588235, -0.00159516176470588, // f 370//339 371//340 378//347 -1.41176470588235e-06, 0.00404055882352941, -0.00159516176470588, -1.41176470588235e-06, 0.00404055882352941, 0.00159516176470588, 0.441175044117647, 0.00419451470588235, 0.00159516176470588, // f 371//340 379//348 378//347 -1.41176470588235e-06, 0.00404055882352941, 0.00159516176470588, 0.441175911764706, 0.00170022058823529, 0.00358429411764706, 0.441175044117647, 0.00419451470588235, 0.00159516176470588, // f 371//340 372//341 379//348 -1.41176470588235e-06, 0.00404055882352941, 0.00159516176470588, -5.44117647058824e-07, 0.00154626470588235, 0.00358429411764706, 0.441175911764706, 0.00170022058823529, 0.00358429411764706, // f 372//341 380//349 379//348 -5.44117647058824e-07, 0.00154626470588235, 0.00358429411764706, 0.441177, -0.00141010294117647, 0.00287438235294118, 0.441175911764706, 0.00170022058823529, 0.00358429411764706, // f 372//341 373//342 380//349 -5.44117647058824e-07, 0.00154626470588235, 0.00358429411764706, 5.44117647058824e-07, -0.00156407352941176, 0.00287438235294118, 0.441177, -0.00141010294117647, 0.00287438235294118, // f 373//342 374//344 380//349 5.44117647058824e-07, -0.00156407352941176, 0.00287438235294118, 0.441177485294118, -0.00279433823529412, 0, 0.441177, -0.00141010294117647, 0.00287438235294118, // f 373//342 367//337 374//344 5.44117647058824e-07, -0.00156407352941176, 0.00287438235294118, 1.02941176470588e-06, -0.00294829411764706, 0, 0.441177485294118, -0.00279433823529412, 0, // f 381//350 374//344 375//343 0.441176191176471, 0.000882132352941176, -0, 0.441177485294118, -0.00279433823529412, 0, 0.441177, -0.00141010294117647, -0.00287438235294118, // f 381//350 375//343 376//345 0.441176191176471, 0.000882132352941176, -0, 0.441177, -0.00141010294117647, -0.00287438235294118, 0.441175911764706, 0.00170022058823529, -0.00358429411764706, // f 381//350 376//345 377//346 0.441176191176471, 0.000882132352941176, -0, 0.441175911764706, 0.00170022058823529, -0.00358429411764706, 0.441175044117647, 0.00419451470588235, -0.00159516176470588, // f 381//350 377//346 378//347 0.441176191176471, 0.000882132352941176, -0, 0.441175044117647, 0.00419451470588235, -0.00159516176470588, 0.441175044117647, 0.00419451470588235, 0.00159516176470588, // f 381//350 378//347 379//348 0.441176191176471, 0.000882132352941176, -0, 0.441175044117647, 0.00419451470588235, 0.00159516176470588, 0.441175911764706, 0.00170022058823529, 0.00358429411764706, // f 381//350 379//348 380//349 0.441176191176471, 0.000882132352941176, -0, 0.441175911764706, 0.00170022058823529, 0.00358429411764706, 0.441177, -0.00141010294117647, 0.00287438235294118, // f 381//350 380//349 374//344 0.441176191176471, 0.000882132352941176, -0, 0.441177, -0.00141010294117647, 0.00287438235294118, 0.441177485294118, -0.00279433823529412, 0, // f 382//335 384//351 383//352 0.441176191176471, 0.000882132352941176, -0, 0.441179382352941, -0.00828683823529412, -0.0114975294117647, 0.441181323529412, -0.01382375, 0, // f 382//335 385//353 384//351 0.441176191176471, 0.000882132352941176, -0, 0.441175044117647, 0.0041545, -0.0143371764705882, 0.441179382352941, -0.00828683823529412, -0.0114975294117647, // f 382//335 386//354 385//353 0.441176191176471, 0.000882132352941176, -0, 0.441171558823529, 0.0141316764705882, -0.00638064705882353, 0.441175044117647, 0.0041545, -0.0143371764705882, // f 382//335 387//355 386//354 0.441176191176471, 0.000882132352941176, -0, 0.441171558823529, 0.0141316764705882, 0.00638064705882353, 0.441171558823529, 0.0141316764705882, -0.00638064705882353, // f 382//335 388//356 387//355 0.441176191176471, 0.000882132352941176, -0, 0.441175044117647, 0.0041545, 0.0143371764705882, 0.441171558823529, 0.0141316764705882, 0.00638064705882353, // f 382//335 389//357 388//356 0.441176191176471, 0.000882132352941176, -0, 0.441179382352941, -0.00828683823529412, 0.0114975147058824, 0.441175044117647, 0.0041545, 0.0143371764705882, // f 382//335 383//352 389//357 0.441176191176471, 0.000882132352941176, -0, 0.441181323529412, -0.01382375, 0, 0.441179382352941, -0.00828683823529412, 0.0114975147058824, // f 383//352 391//358 390//359 0.441181323529412, -0.01382375, 0, 0.499999720588235, 0.000902661764705882, -0, 0.499999720588235, 0.000902661764705882, -0, // f 383//352 384//351 391//358 0.441181323529412, -0.01382375, 0, 0.441179382352941, -0.00828683823529412, -0.0114975294117647, 0.499999720588235, 0.000902661764705882, -0, // f 384//351 392//360 391//358 0.441179382352941, -0.00828683823529412, -0.0114975294117647, 0.499999720588235, 0.000902661764705882, -0, 0.499999720588235, 0.000902661764705882, -0, // f 384//351 385//353 392//360 0.441179382352941, -0.00828683823529412, -0.0114975294117647, 0.441175044117647, 0.0041545, -0.0143371764705882, 0.499999720588235, 0.000902661764705882, -0, // f 385//353 393//361 392//360 0.441175044117647, 0.0041545, -0.0143371764705882, 0.499999720588235, 0.000902661764705882, -0, 0.499999720588235, 0.000902661764705882, -0, // f 385//353 386//354 393//361 0.441175044117647, 0.0041545, -0.0143371764705882, 0.441171558823529, 0.0141316764705882, -0.00638064705882353, 0.499999720588235, 0.000902661764705882, -0, // f 386//354 394//362 393//361 0.441171558823529, 0.0141316764705882, -0.00638064705882353, 0.499999720588235, 0.000902661764705882, -0, 0.499999720588235, 0.000902661764705882, -0, // f 386//354 387//355 394//362 0.441171558823529, 0.0141316764705882, -0.00638064705882353, 0.441171558823529, 0.0141316764705882, 0.00638064705882353, 0.499999720588235, 0.000902661764705882, -0, // f 387//355 395//363 394//362 0.441171558823529, 0.0141316764705882, 0.00638064705882353, 0.499999720588235, 0.000902661764705882, -0, 0.499999720588235, 0.000902661764705882, -0, // f 387//355 388//356 395//363 0.441171558823529, 0.0141316764705882, 0.00638064705882353, 0.441175044117647, 0.0041545, 0.0143371764705882, 0.499999720588235, 0.000902661764705882, -0, // f 388//356 396//364 395//363 0.441175044117647, 0.0041545, 0.0143371764705882, 0.499999720588235, 0.000902661764705882, -0, 0.499999720588235, 0.000902661764705882, -0, // f 388//356 389//357 396//364 0.441175044117647, 0.0041545, 0.0143371764705882, 0.441179382352941, -0.00828683823529412, 0.0114975147058824, 0.499999720588235, 0.000902661764705882, -0, // f 389//357 390//359 396//364 0.441179382352941, -0.00828683823529412, 0.0114975147058824, 0.499999720588235, 0.000902661764705882, -0, 0.499999720588235, 0.000902661764705882, -0, // f 389//357 383//352 390//359 0.441179382352941, -0.00828683823529412, 0.0114975147058824, 0.441181323529412, -0.01382375, 0, 0.499999720588235, 0.000902661764705882, -0, // f 397//365 390//359 391//358 0.499999720588235, 0.000902661764705882, -0, 0.499999720588235, 0.000902661764705882, -0, 0.499999720588235, 0.000902661764705882, -0, // f 397//365 391//358 392//360 0.499999720588235, 0.000902661764705882, -0, 0.499999720588235, 0.000902661764705882, -0, 0.499999720588235, 0.000902661764705882, -0, // f 397//365 392//360 393//361 0.499999720588235, 0.000902661764705882, -0, 0.499999720588235, 0.000902661764705882, -0, 0.499999720588235, 0.000902661764705882, -0, // f 397//365 393//361 394//362 0.499999720588235, 0.000902661764705882, -0, 0.499999720588235, 0.000902661764705882, -0, 0.499999720588235, 0.000902661764705882, -0, // f 397//365 394//362 395//363 0.499999720588235, 0.000902661764705882, -0, 0.499999720588235, 0.000902661764705882, -0, 0.499999720588235, 0.000902661764705882, -0, // f 397//365 395//363 396//364 0.499999720588235, 0.000902661764705882, -0, 0.499999720588235, 0.000902661764705882, -0, 0.499999720588235, 0.000902661764705882, -0, // f 397//365 396//364 390//359 0.499999720588235, 0.000902661764705882, -0, 0.499999720588235, 0.000902661764705882, -0, 0.499999720588235, 0.000902661764705882, -0, // f 398//350 400//349 399//344 -2.5e-07, 0.000728176470588235, -0, 5.44117647058824e-07, -0.00156407352941176, 0.00287438235294118, 1.02941176470588e-06, -0.00294829411764706, 0, // f 398//350 401//348 400//349 -2.5e-07, 0.000728176470588235, -0, -5.44117647058824e-07, 0.00154626470588235, 0.00358429411764706, 5.44117647058824e-07, -0.00156407352941176, 0.00287438235294118, // f 398//350 402//347 401//348 -2.5e-07, 0.000728176470588235, -0, -1.41176470588235e-06, 0.00404055882352941, 0.00159516176470588, -5.44117647058824e-07, 0.00154626470588235, 0.00358429411764706, // f 398//350 403//346 402//347 -2.5e-07, 0.000728176470588235, -0, -1.41176470588235e-06, 0.00404055882352941, -0.00159516176470588, -1.41176470588235e-06, 0.00404055882352941, 0.00159516176470588, // f 398//350 404//345 403//346 -2.5e-07, 0.000728176470588235, -0, -5.44117647058824e-07, 0.00154626470588235, -0.00358429411764706, -1.41176470588235e-06, 0.00404055882352941, -0.00159516176470588, // f 398//350 405//343 404//345 -2.5e-07, 0.000728176470588235, -0, 5.44117647058824e-07, -0.00156407352941176, -0.00287438235294118, -5.44117647058824e-07, 0.00154626470588235, -0.00358429411764706, // f 398//350 399//344 405//343 -2.5e-07, 0.000728176470588235, -0, 1.02941176470588e-06, -0.00294829411764706, 0, 5.44117647058824e-07, -0.00156407352941176, -0.00287438235294118, // f 399//344 407//342 406//337 1.02941176470588e-06, -0.00294829411764706, 0, -0.441175911764706, -0.00171795588235294, 0.00287433823529412, -0.441175411764706, -0.00310219117647059, -4.41176470588235e-08, // f 399//344 400//349 407//342 1.02941176470588e-06, -0.00294829411764706, 0, 5.44117647058824e-07, -0.00156407352941176, 0.00287438235294118, -0.441175911764706, -0.00171795588235294, 0.00287433823529412, // f 400//349 408//366 407//342 5.44117647058824e-07, -0.00156407352941176, 0.00287438235294118, -0.441176970588235, 0.00139238235294118, 0.00358425, -0.441175911764706, -0.00171795588235294, 0.00287433823529412, // f 400//349 401//348 408//366 5.44117647058824e-07, -0.00156407352941176, 0.00287438235294118, -5.44117647058824e-07, 0.00154626470588235, 0.00358429411764706, -0.441176970588235, 0.00139238235294118, 0.00358425, // f 401//348 409//340 408//366 -5.44117647058824e-07, 0.00154626470588235, 0.00358429411764706, -0.441177838235294, 0.00388667647058823, 0.00159511764705882, -0.441176970588235, 0.00139238235294118, 0.00358425, // f 401//348 402//347 409//340 -5.44117647058824e-07, 0.00154626470588235, 0.00358429411764706, -1.41176470588235e-06, 0.00404055882352941, 0.00159516176470588, -0.441177838235294, 0.00388667647058823, 0.00159511764705882, // f 402//347 410//339 409//340 -1.41176470588235e-06, 0.00404055882352941, 0.00159516176470588, -0.441177838235294, 0.00388667647058823, -0.00159520588235294, -0.441177838235294, 0.00388667647058823, 0.00159511764705882, // f 402//347 403//346 410//339 -1.41176470588235e-06, 0.00404055882352941, 0.00159516176470588, -1.41176470588235e-06, 0.00404055882352941, -0.00159516176470588, -0.441177838235294, 0.00388667647058823, -0.00159520588235294, // f 403//346 411//338 410//339 -1.41176470588235e-06, 0.00404055882352941, -0.00159516176470588, -0.441176970588235, 0.00139238235294118, -0.00358433823529412, -0.441177838235294, 0.00388667647058823, -0.00159520588235294, // f 403//346 404//345 411//338 -1.41176470588235e-06, 0.00404055882352941, -0.00159516176470588, -5.44117647058824e-07, 0.00154626470588235, -0.00358429411764706, -0.441176970588235, 0.00139238235294118, -0.00358433823529412, // f 404//345 412//336 411//338 -5.44117647058824e-07, 0.00154626470588235, -0.00358429411764706, -0.441175911764706, -0.00171795588235294, -0.00287441176470588, -0.441176970588235, 0.00139238235294118, -0.00358433823529412, // f 404//345 405//343 412//336 -5.44117647058824e-07, 0.00154626470588235, -0.00358429411764706, 5.44117647058824e-07, -0.00156407352941176, -0.00287438235294118, -0.441175911764706, -0.00171795588235294, -0.00287441176470588, // f 405//343 406//337 412//336 5.44117647058824e-07, -0.00156407352941176, -0.00287438235294118, -0.441175411764706, -0.00310219117647059, -4.41176470588235e-08, -0.441175911764706, -0.00171795588235294, -0.00287441176470588, // f 405//343 399//344 406//337 5.44117647058824e-07, -0.00156407352941176, -0.00287438235294118, 1.02941176470588e-06, -0.00294829411764706, 0, -0.441175411764706, -0.00310219117647059, -4.41176470588235e-08, // f 413//335 406//337 407//342 -0.441176691176471, 0.000574279411764706, -4.41176470588235e-08, -0.441175411764706, -0.00310219117647059, -4.41176470588235e-08, -0.441175911764706, -0.00171795588235294, 0.00287433823529412, // f 413//335 407//342 408//366 -0.441176691176471, 0.000574279411764706, -4.41176470588235e-08, -0.441175911764706, -0.00171795588235294, 0.00287433823529412, -0.441176970588235, 0.00139238235294118, 0.00358425, // f 413//335 408//366 409//340 -0.441176691176471, 0.000574279411764706, -4.41176470588235e-08, -0.441176970588235, 0.00139238235294118, 0.00358425, -0.441177838235294, 0.00388667647058823, 0.00159511764705882, // f 413//335 409//340 410//339 -0.441176691176471, 0.000574279411764706, -4.41176470588235e-08, -0.441177838235294, 0.00388667647058823, 0.00159511764705882, -0.441177838235294, 0.00388667647058823, -0.00159520588235294, // f 413//335 410//339 411//338 -0.441176691176471, 0.000574279411764706, -4.41176470588235e-08, -0.441177838235294, 0.00388667647058823, -0.00159520588235294, -0.441176970588235, 0.00139238235294118, -0.00358433823529412, // f 413//335 411//338 412//336 -0.441176691176471, 0.000574279411764706, -4.41176470588235e-08, -0.441176970588235, 0.00139238235294118, -0.00358433823529412, -0.441175911764706, -0.00171795588235294, -0.00287441176470588, // f 413//335 412//336 406//337 -0.441176691176471, 0.000574279411764706, -4.41176470588235e-08, -0.441175911764706, -0.00171795588235294, -0.00287441176470588, -0.441175411764706, -0.00310219117647059, -4.41176470588235e-08, // f 414//350 416//367 415//368 -0.441176691176471, 0.000574279411764706, -4.41176470588235e-08, -0.4411735, -0.00859467647058824, 0.0114974852941176, -0.441171558823529, -0.0141316029411765, -4.41176470588235e-08, // f 414//350 417//369 416//367 -0.441176691176471, 0.000574279411764706, -4.41176470588235e-08, -0.441177838235294, 0.00384664705882353, 0.0143371323529412, -0.4411735, -0.00859467647058824, 0.0114974852941176, // f 414//350 418//370 417//369 -0.441176691176471, 0.000574279411764706, -4.41176470588235e-08, -0.441181323529412, 0.0138238235294118, 0.00638060294117647, -0.441177838235294, 0.00384664705882353, 0.0143371323529412, // f 414//350 419//371 418//370 -0.441176691176471, 0.000574279411764706, -4.41176470588235e-08, -0.441181323529412, 0.0138238235294118, -0.00638067647058824, -0.441181323529412, 0.0138238235294118, 0.00638060294117647, // f 414//350 420//372 419//371 -0.441176691176471, 0.000574279411764706, -4.41176470588235e-08, -0.441177838235294, 0.00384664705882353, -0.0143372205882353, -0.441181323529412, 0.0138238235294118, -0.00638067647058824, // f 414//350 421//373 420//372 -0.441176691176471, 0.000574279411764706, -4.41176470588235e-08, -0.4411735, -0.00859467647058824, -0.0114975588235294, -0.441177838235294, 0.00384664705882353, -0.0143372205882353, // f 414//350 415//368 421//373 -0.441176691176471, 0.000574279411764706, -4.41176470588235e-08, -0.441171558823529, -0.0141316029411765, -4.41176470588235e-08, -0.4411735, -0.00859467647058824, -0.0114975588235294, // f 415//368 423//374 422//375 -0.441171558823529, -0.0141316029411765, -4.41176470588235e-08, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, // f 415//368 416//367 423//374 -0.441171558823529, -0.0141316029411765, -4.41176470588235e-08, -0.4411735, -0.00859467647058824, 0.0114974852941176, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, // f 416//367 424//376 423//374 -0.4411735, -0.00859467647058824, 0.0114974852941176, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, // f 416//367 417//369 424//376 -0.4411735, -0.00859467647058824, 0.0114974852941176, -0.441177838235294, 0.00384664705882353, 0.0143371323529412, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, // f 417//369 425//377 424//376 -0.441177838235294, 0.00384664705882353, 0.0143371323529412, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, // f 417//369 418//370 425//377 -0.441177838235294, 0.00384664705882353, 0.0143371323529412, -0.441181323529412, 0.0138238235294118, 0.00638060294117647, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, // f 418//370 426//378 425//377 -0.441181323529412, 0.0138238235294118, 0.00638060294117647, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, // f 418//370 419//371 426//378 -0.441181323529412, 0.0138238235294118, 0.00638060294117647, -0.441181323529412, 0.0138238235294118, -0.00638067647058824, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, // f 419//371 427//379 426//378 -0.441181323529412, 0.0138238235294118, -0.00638067647058824, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, // f 419//371 420//372 427//379 -0.441181323529412, 0.0138238235294118, -0.00638067647058824, -0.441177838235294, 0.00384664705882353, -0.0143372205882353, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, // f 420//372 428//380 427//379 -0.441177838235294, 0.00384664705882353, -0.0143372205882353, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, // f 420//372 421//373 428//380 -0.441177838235294, 0.00384664705882353, -0.0143372205882353, -0.4411735, -0.00859467647058824, -0.0114975588235294, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, // f 421//373 422//375 428//380 -0.4411735, -0.00859467647058824, -0.0114975588235294, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, // f 421//373 415//368 422//375 -0.4411735, -0.00859467647058824, -0.0114975588235294, -0.441171558823529, -0.0141316029411765, -4.41176470588235e-08, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, // f 429//381 422//375 423//374 -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, // f 429//381 423//374 424//376 -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, // f 429//381 424//376 425//377 -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, // f 429//381 425//377 426//378 -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, // f 429//381 426//378 427//379 -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, // f 429//381 427//379 428//380 -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, // f 429//381 428//380 422//375 -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, -0.500000220588235, 0.000553764705882353, -4.41176470588235e-08, }; float lowPolyAxesAndModels2Normals [] = { // f 1//1 15//2 14//3 0, 1, 0, 0.313221781776378, 0.827812495110252, 0.465423020874742, 0.361223327341109, 0.932479333703765, 0, // f 1//1 2//4 15//2 0, 1, 0, -0.00692820035189495, 0.885062594520792, 0.465420459176439, 0.313221781776378, 0.827812495110252, 0.465423020874742, // f 2//4 16//5 15//2 -0.00692820035189495, 0.885062594520792, 0.465420459176439, 0.193248102518277, 0.533478085942623, 0.823441742136067, 0.313221781776378, 0.827812495110252, 0.465423020874742, // f 2//4 3//6 16//5 -0.00692820035189495, 0.885062594520792, 0.465420459176439, -0.01248233334374, 0.567263148900001, 0.823441990218103, 0.193248102518277, 0.533478085942623, 0.823441742136067, // f 3//6 17//7 16//5 -0.01248233334374, 0.567263148900001, 0.823441990218103, 0.0292372831996172, 0.117650139588595, 0.992624614809591, 0.193248102518277, 0.533478085942623, 0.823441742136067, // f 3//6 4//8 17//7 -0.01248233334374, 0.567263148900001, 0.823441990218103, -0.0152291366425567, 0.12027407915229, 0.992623906261174, 0.0292372831996172, 0.117650139588595, 0.992624614809591, // f 4//8 18//9 17//7 -0.0152291366425567, 0.12027407915229, 0.992623906261174, -0.141180848856854, -0.324874254443834, 0.935160246543672, 0.0292372831996172, 0.117650139588595, 0.992624614809591, // f 4//8 5//10 18//9 -0.0152291366425567, 0.12027407915229, 0.992623906261174, -0.0142832337047389, -0.353928791044059, 0.935163301303589, -0.141180848856854, -0.324874254443834, 0.935160246543672, // f 5//10 19//11 18//9 -0.0142832337047389, -0.353928791044059, 0.935163301303589, -0.279466649455617, -0.693707470153901, 0.663828545405156, -0.141180848856854, -0.324874254443834, 0.935160246543672, // f 5//10 6//12 19//11 -0.0142832337047389, -0.353928791044059, 0.935163301303589, -0.00998007790708764, -0.747831837770113, 0.663813181898601, -0.279466649455617, -0.693707470153901, 0.663828545405156, // f 6//12 20//13 19//11 -0.00998007790708764, -0.747831837770113, 0.663813181898601, -0.354026717997172, -0.903987921266859, 0.23973093489947, -0.279466649455617, -0.693707470153901, 0.663828545405156, // f 6//12 7//14 20//13 -0.00998007790708764, -0.747831837770113, 0.663813181898601, -0.00354003737006189, -0.970834248517786, 0.239725530639363, -0.354026717997172, -0.903987921266859, 0.23973093489947, // f 7//14 21//15 20//13 -0.00354003737006189, -0.970834248517786, 0.239725530639363, -0.347368251907211, -0.906568316347171, -0.23972731459386, -0.354026717997172, -0.903987921266859, 0.23973093489947, // f 7//14 8//16 21//15 -0.00354003737006189, -0.970834248517786, 0.239725530639363, 0.00354003737006189, -0.970834248517786, -0.239725530639363, -0.347368251907211, -0.906568316347171, -0.23972731459386, // f 8//16 22//17 21//15 0.00354003737006189, -0.970834248517786, -0.239725530639363, -0.260817405343863, -0.700936214102224, -0.663824302680865, -0.347368251907211, -0.906568316347171, -0.23972731459386, // f 8//16 9//18 22//17 0.00354003737006189, -0.970834248517786, -0.239725530639363, 0.00998007790708764, -0.747831837770113, -0.663813181898601, -0.260817405343863, -0.700936214102224, -0.663824302680865, // f 9//18 23//19 22//17 0.00998007790708764, -0.747831837770113, -0.663813181898601, -0.114507166430012, -0.33519134168677, -0.935165692962692, -0.260817405343863, -0.700936214102224, -0.663824302680865, // f 9//18 10//20 23//19 0.00998007790708764, -0.747831837770113, -0.663813181898601, 0.0142832337047389, -0.353928791044059, -0.935163301303589, -0.114507166430012, -0.33519134168677, -0.935165692962692, // f 10//20 24//21 23//19 0.0142832337047389, -0.353928791044059, -0.935163301303589, 0.0576496246702162, 0.106633155437813, -0.992625755729096, -0.114507166430012, -0.33519134168677, -0.935165692962692, // f 10//20 11//22 24//21 0.0142832337047389, -0.353928791044059, -0.935163301303589, 0.0152291366425567, 0.12027407915229, -0.992623906261174, 0.0576496246702162, 0.106633155437813, -0.992625755729096, // f 11//22 25//23 24//21 0.0152291366425567, 0.12027407915229, -0.992623906261174, 0.216564942430698, 0.524444390484491, -0.823442594841522, 0.0576496246702162, 0.106633155437813, -0.992625755729096, // f 11//22 12//24 25//23 0.0152291366425567, 0.12027407915229, -0.992623906261174, 0.01248233334374, 0.567263148900001, -0.823441990218103, 0.216564942430698, 0.524444390484491, -0.823442594841522, // f 12//24 26//25 25//23 0.01248233334374, 0.567263148900001, -0.823441990218103, 0.326187927603834, 0.822793952106354, -0.465415457696371, 0.216564942430698, 0.524444390484491, -0.823442594841522, // f 12//24 13//26 26//25 0.01248233334374, 0.567263148900001, -0.823441990218103, 0.00692820035189495, 0.885062594520792, -0.465420459176439, 0.326187927603834, 0.822793952106354, -0.465415457696371, // f 13//26 14//3 26//25 0.00692820035189495, 0.885062594520792, -0.465420459176439, 0.361223327341109, 0.932479333703765, 0, 0.326187927603834, 0.822793952106354, -0.465415457696371, // f 13//26 1//1 14//3 0.00692820035189495, 0.885062594520792, -0.465420459176439, 0, 1, 0, 0.361223327341109, 0.932479333703765, 0, // f 14//3 28//27 27//28 0.361223327341109, 0.932479333703765, 0, 0.591125036320287, 0.658755413390838, 0.465416476678259, 0.673680906166071, 0.739022351940225, 0, // f 14//3 15//2 28//27 0.361223327341109, 0.932479333703765, 0, 0.313221781776378, 0.827812495110252, 0.465423020874742, 0.591125036320287, 0.658755413390838, 0.465416476678259, // f 15//2 29//29 28//27 0.313221781776378, 0.827812495110252, 0.465423020874742, 0.372916717433467, 0.427637290074405, 0.823443665344793, 0.591125036320287, 0.658755413390838, 0.465416476678259, // f 15//2 16//5 29//29 0.313221781776378, 0.827812495110252, 0.465423020874742, 0.193248102518277, 0.533478085942623, 0.823441742136067, 0.372916717433467, 0.427637290074405, 0.823443665344793, // f 16//5 30//30 29//29 0.193248102518277, 0.533478085942623, 0.823441742136067, 0.0697655787959561, 0.0991558226261453, 0.992623235097082, 0.372916717433467, 0.427637290074405, 0.823443665344793, // f 16//5 17//7 30//30 0.193248102518277, 0.533478085942623, 0.823441742136067, 0.0292372831996172, 0.117650139588595, 0.992624614809591, 0.0697655787959561, 0.0991558226261453, 0.992623235097082, // f 17//7 31//31 30//30 0.0292372831996172, 0.117650139588595, 0.992624614809591, -0.249004485488958, -0.251933526488782, 0.935161090100152, 0.0697655787959561, 0.0991558226261453, 0.992623235097082, // f 17//7 18//9 31//31 0.0292372831996172, 0.117650139588595, 0.992624614809591, -0.141180848856854, -0.324874254443834, 0.935160246543672, -0.249004485488958, -0.251933526488782, 0.935161090100152, // f 18//9 32//32 31//31 -0.141180848856854, -0.324874254443834, 0.935160246543672, -0.511199927686784, -0.54590094100042, 0.663827384602264, -0.249004485488958, -0.251933526488782, 0.935161090100152, // f 18//9 19//11 32//32 -0.141180848856854, -0.324874254443834, 0.935160246543672, -0.279466649455617, -0.693707470153901, 0.663828545405156, -0.511199927686784, -0.54590094100042, 0.663827384602264, // f 19//11 33//33 32//32 -0.279466649455617, -0.693707470153901, 0.663828545405156, -0.656675622857979, -0.715058389486566, 0.239726147862438, -0.511199927686784, -0.54590094100042, 0.663827384602264, // f 19//11 20//13 33//33 -0.279466649455617, -0.693707470153901, 0.663828545405156, -0.354026717997172, -0.903987921266859, 0.23973093489947, -0.656675622857979, -0.715058389486566, 0.239726147862438, // f 20//13 34//34 33//33 -0.354026717997172, -0.903987921266859, 0.23973093489947, -0.651405967231767, -0.719860960461469, -0.239729980307714, -0.656675622857979, -0.715058389486566, 0.239726147862438, // f 20//13 21//15 34//34 -0.354026717997172, -0.903987921266859, 0.23973093489947, -0.347368251907211, -0.906568316347171, -0.23972731459386, -0.651405967231767, -0.719860960461469, -0.239729980307714, // f 21//15 35//35 34//34 -0.347368251907211, -0.906568316347171, -0.23972731459386, -0.496422143341875, -0.559383176158847, -0.663818889329235, -0.651405967231767, -0.719860960461469, -0.239729980307714, // f 21//15 22//17 35//35 -0.347368251907211, -0.906568316347171, -0.23972731459386, -0.260817405343863, -0.700936214102224, -0.663824302680865, -0.496422143341875, -0.559383176158847, -0.663818889329235, // f 22//17 36//36 35//35 -0.260817405343863, -0.700936214102224, -0.663824302680865, -0.22788491958948, -0.271190474406545, -0.935159980973763, -0.496422143341875, -0.559383176158847, -0.663818889329235, // f 22//17 23//19 36//36 -0.260817405343863, -0.700936214102224, -0.663824302680865, -0.114507166430012, -0.33519134168677, -0.935165692962692, -0.22788491958948, -0.271190474406545, -0.935159980973763, // f 23//19 37//37 36//36 -0.114507166430012, -0.33519134168677, -0.935165692962692, 0.092288826513591, 0.0786167040697867, -0.992623889669168, -0.22788491958948, -0.271190474406545, -0.935159980973763, // f 23//19 24//21 37//37 -0.114507166430012, -0.33519134168677, -0.935165692962692, 0.0576496246702162, 0.106633155437813, -0.992625755729096, 0.092288826513591, 0.0786167040697867, -0.992623889669168, // f 24//21 38//38 37//37 0.0576496246702162, 0.106633155437813, -0.992625755729096, 0.391409033190445, 0.410788480441844, -0.823439003857118, 0.092288826513591, 0.0786167040697867, -0.992623889669168, // f 24//21 25//23 38//38 0.0576496246702162, 0.106633155437813, -0.992625755729096, 0.216564942430698, 0.524444390484491, -0.823442594841522, 0.391409033190445, 0.410788480441844, -0.823439003857118, // f 25//23 39//39 38//38 0.216564942430698, 0.524444390484491, -0.823442594841522, 0.601407465271149, 0.649383220339146, -0.465414324938642, 0.391409033190445, 0.410788480441844, -0.823439003857118, // f 25//23 26//25 39//39 0.216564942430698, 0.524444390484491, -0.823442594841522, 0.326187927603834, 0.822793952106354, -0.465415457696371, 0.601407465271149, 0.649383220339146, -0.465414324938642, // f 26//25 27//28 39//39 0.326187927603834, 0.822793952106354, -0.465415457696371, 0.673680906166071, 0.739022351940225, 0, 0.601407465271149, 0.649383220339146, -0.465414324938642, // f 26//25 14//3 27//28 0.326187927603834, 0.822793952106354, -0.465415457696371, 0.361223327341109, 0.932479333703765, 0, 0.673680906166071, 0.739022351940225, 0, // f 27//28 41//40 40//41 0.673680906166071, 0.739022351940225, 0, 0.789177538356504, 0.400722998778123, 0.465424420506528, 0.89516439351768, 0.445736142328759, 0, // f 27//28 28//27 41//40 0.673680906166071, 0.739022351940225, 0, 0.591125036320287, 0.658755413390838, 0.465416476678259, 0.789177538356504, 0.400722998778123, 0.465424420506528, // f 28//27 42//42 41//40 0.591125036320287, 0.658755413390838, 0.465416476678259, 0.502227353354359, 0.264023545633435, 0.823443533518738, 0.789177538356504, 0.400722998778123, 0.465424420506528, // f 28//27 29//29 42//42 0.591125036320287, 0.658755413390838, 0.465416476678259, 0.372916717433467, 0.427637290074405, 0.823443665344793, 0.502227353354359, 0.264023545633435, 0.823443533518738, // f 29//29 43//43 42//42 0.372916717433467, 0.427637290074405, 0.823443665344793, 0.100865098096815, 0.0672327319484161, 0.992625806505489, 0.502227353354359, 0.264023545633435, 0.823443533518738, // f 29//29 30//30 43//43 0.372916717433467, 0.427637290074405, 0.823443665344793, 0.0697655787959561, 0.0991558226261453, 0.992623235097082, 0.100865098096815, 0.0672327319484161, 0.992625806505489, // f 30//30 44//44 43//43 0.0697655787959561, 0.0991558226261453, 0.992623235097082, -0.32319609429674, -0.144965284978661, 0.935162740266307, 0.100865098096815, 0.0672327319484161, 0.992625806505489, // f 30//30 31//31 44//44 0.0697655787959561, 0.0991558226261453, 0.992623235097082, -0.249004485488958, -0.251933526488782, 0.935161090100152, -0.32319609429674, -0.144965284978661, 0.935162740266307, // f 31//31 45//45 44//44 -0.249004485488958, -0.251933526488782, 0.935161090100152, -0.673886749517774, -0.324384730337828, 0.66381563370263, -0.32319609429674, -0.144965284978661, 0.935162740266307, // f 31//31 32//32 45//45 -0.249004485488958, -0.251933526488782, 0.935161090100152, -0.511199927686784, -0.54590094100042, 0.663827384602264, -0.673886749517774, -0.324384730337828, 0.66381563370263, // f 32//32 46//46 45//45 -0.511199927686784, -0.54590094100042, 0.663827384602264, -0.870652500417476, -0.429528113685591, 0.239728644659947, -0.673886749517774, -0.324384730337828, 0.66381563370263, // f 32//32 33//33 46//46 -0.511199927686784, -0.54590094100042, 0.663827384602264, -0.656675622857979, -0.715058389486566, 0.239726147862438, -0.870652500417476, -0.429528113685591, 0.239728644659947, // f 33//33 47//47 46//46 -0.656675622857979, -0.715058389486566, 0.239726147862438, -0.867477162214392, -0.435905628976394, -0.239728295499633, -0.870652500417476, -0.429528113685591, 0.239728644659947, // f 33//33 34//34 47//47 -0.656675622857979, -0.715058389486566, 0.239726147862438, -0.651405967231767, -0.719860960461469, -0.239729980307714, -0.867477162214392, -0.435905628976394, -0.239728295499633, // f 34//34 48//48 47//47 -0.651405967231767, -0.719860960461469, -0.239729980307714, -0.664978363065988, -0.342270333963109, -0.663818344988191, -0.867477162214392, -0.435905628976394, -0.239728295499633, // f 34//34 35//35 48//48 -0.651405967231767, -0.719860960461469, -0.239729980307714, -0.496422143341875, -0.559383176158847, -0.663818889329235, -0.664978363065988, -0.342270333963109, -0.663818344988191, // f 35//35 49//49 48//48 -0.496422143341875, -0.559383176158847, -0.663818889329235, -0.310467523994339, -0.170569386670531, -0.935155602493865, -0.664978363065988, -0.342270333963109, -0.663818344988191, // f 35//35 36//36 49//49 -0.496422143341875, -0.559383176158847, -0.663818889329235, -0.22788491958948, -0.271190474406545, -0.935159980973763, -0.310467523994339, -0.170569386670531, -0.935155602493865, // f 36//36 50//50 49//49 -0.22788491958948, -0.271190474406545, -0.935159980973763, 0.114445265201575, 0.0399494416442776, -0.992625973559654, -0.310467523994339, -0.170569386670531, -0.935155602493865, // f 36//36 37//37 50//50 -0.22788491958948, -0.271190474406545, -0.935159980973763, 0.092288826513591, 0.0786167040697867, -0.992623889669168, 0.114445265201575, 0.0399494416442776, -0.992625973559654, // f 37//37 51//51 50//50 0.092288826513591, 0.0786167040697867, -0.992623889669168, 0.513366486990845, 0.241652819343043, -0.823443237229038, 0.114445265201575, 0.0399494416442776, -0.992625973559654, // f 37//37 38//38 51//51 0.092288826513591, 0.0786167040697867, -0.992623889669168, 0.391409033190445, 0.410788480441844, -0.823439003857118, 0.513366486990845, 0.241652819343043, -0.823443237229038, // f 38//38 52//52 51//51 0.391409033190445, 0.410788480441844, -0.823439003857118, 0.795387075964759, 0.388262871087871, -0.46541523645325, 0.513366486990845, 0.241652819343043, -0.823443237229038, // f 38//38 39//39 52//52 0.391409033190445, 0.410788480441844, -0.823439003857118, 0.601407465271149, 0.649383220339146, -0.465414324938642, 0.795387075964759, 0.388262871087871, -0.46541523645325, // f 39//39 40//41 52//52 0.601407465271149, 0.649383220339146, -0.465414324938642, 0.89516439351768, 0.445736142328759, 0, 0.795387075964759, 0.388262871087871, -0.46541523645325, // f 39//39 27//28 40//41 0.601407465271149, 0.649383220339146, -0.465414324938642, 0.673680906166071, 0.739022351940225, 0, 0.89516439351768, 0.445736142328759, 0, // f 40//41 54//53 53//54 0.89516439351768, 0.445736142328759, 0, 0.880651789803303, 0.0885659845475568, 0.465412173774344, 0.995735158799549, 0.0922577559364866, 0, // f 40//41 41//40 54//53 0.89516439351768, 0.445736142328759, 0, 0.789177538356504, 0.400722998778123, 0.465424420506528, 0.880651789803303, 0.0885659845475568, 0.465412173774344, // f 41//40 55//55 54//53 0.789177538356504, 0.400722998778123, 0.465424420506528, 0.563691055696157, 0.0647926156107305, 0.823440532576866, 0.880651789803303, 0.0885659845475568, 0.465412173774344, // f 41//40 42//42 55//55 0.789177538356504, 0.400722998778123, 0.465424420506528, 0.502227353354359, 0.264023545633435, 0.823443533518738, 0.563691055696157, 0.0647926156107305, 0.823440532576866, // f 42//42 56//56 55//55 0.502227353354359, 0.264023545633435, 0.823443533518738, 0.118352162819144, 0.0262462578715115, 0.992624752614891, 0.563691055696157, 0.0647926156107305, 0.823440532576866, // f 42//42 43//43 56//56 0.502227353354359, 0.264023545633435, 0.823443533518738, 0.100865098096815, 0.0672327319484161, 0.992625806505489, 0.118352162819144, 0.0262462578715115, 0.992624752614891, // f 43//43 57//57 56//56 0.100865098096815, 0.0672327319484161, 0.992625806505489, -0.353744874653347, -0.0184032535993825, 0.935160886646487, 0.118352162819144, 0.0262462578715115, 0.992624752614891, // f 43//43 44//44 57//57 0.100865098096815, 0.0672327319484161, 0.992625806505489, -0.32319609429674, -0.144965284978661, 0.935162740266307, -0.353744874653347, -0.0184032535993825, 0.935160886646487, // f 44//44 58//58 57//57 -0.32319609429674, -0.144965284978661, 0.935162740266307, -0.745555566890193, -0.059024469911701, 0.663824531507149, -0.353744874653347, -0.0184032535993825, 0.935160886646487, // f 44//44 45//45 58//58 -0.32319609429674, -0.144965284978661, 0.935162740266307, -0.673886749517774, -0.324384730337828, 0.66381563370263, -0.745555566890193, -0.059024469911701, 0.663824531507149, // f 45//45 59//59 58//58 -0.673886749517774, -0.324384730337828, 0.66381563370263, -0.967023653028303, -0.0860023031678992, 0.239726632507974, -0.745555566890193, -0.059024469911701, 0.663824531507149, // f 45//45 46//46 59//59 -0.673886749517774, -0.324384730337828, 0.66381563370263, -0.870652500417476, -0.429528113685591, 0.239728644659947, -0.967023653028303, -0.0860023031678992, 0.239726632507974, // f 46//46 60//60 59//59 -0.870652500417476, -0.429528113685591, 0.239728644659947, -0.966364047960982, -0.0931145098648123, -0.239729461812896, -0.967023653028303, -0.0860023031678992, 0.239726632507974, // f 46//46 47//47 60//60 -0.870652500417476, -0.429528113685591, 0.239728644659947, -0.867477162214392, -0.435905628976394, -0.239728295499633, -0.966364047960982, -0.0931145098648123, -0.239729461812896, // f 47//47 61//61 60//60 -0.867477162214392, -0.435905628976394, -0.239728295499633, -0.743716064145061, -0.0789520683984218, -0.663816982931433, -0.966364047960982, -0.0931145098648123, -0.239729461812896, // f 47//47 48//48 61//61 -0.867477162214392, -0.435905628976394, -0.239728295499633, -0.664978363065988, -0.342270333963109, -0.663818344988191, -0.743716064145061, -0.0789520683984218, -0.663816982931433, // f 48//48 62//62 61//61 -0.664978363065988, -0.342270333963109, -0.663818344988191, -0.351118355916626, -0.0468764480353951, -0.9351569380366, -0.743716064145061, -0.0789520683984218, -0.663816982931433, // f 48//48 49//49 62//62 -0.664978363065988, -0.342270333963109, -0.663818344988191, -0.310467523994339, -0.170569386670531, -0.935155602493865, -0.351118355916626, -0.0468764480353951, -0.9351569380366, // f 49//49 63//63 62//62 -0.310467523994339, -0.170569386670531, -0.935155602493865, 0.121159194958444, -0.00405904003314949, -0.992624789974052, -0.351118355916626, -0.0468764480353951, -0.9351569380366, // f 49//49 50//50 63//63 -0.310467523994339, -0.170569386670531, -0.935155602493865, 0.114445265201575, 0.0399494416442776, -0.992625973559654, 0.121159194958444, -0.00405904003314949, -0.992624789974052, // f 50//50 64//64 63//63 0.114445265201575, 0.0399494416442776, -0.992625973559654, 0.565986774924437, 0.0398584630316367, -0.823450225293181, 0.121159194958444, -0.00405904003314949, -0.992624789974052, // f 50//50 51//51 64//64 0.114445265201575, 0.0399494416442776, -0.992625973559654, 0.513366486990845, 0.241652819343043, -0.823443237229038, 0.565986774924437, 0.0398584630316367, -0.823450225293181, // f 51//51 65//65 64//64 0.513366486990845, 0.241652819343043, -0.823443237229038, 0.881935001279079, 0.0747099319335438, -0.465412805570879, 0.565986774924437, 0.0398584630316367, -0.823450225293181, // f 51//51 52//52 65//65 0.513366486990845, 0.241652819343043, -0.823443237229038, 0.795387075964759, 0.388262871087871, -0.46541523645325, 0.881935001279079, 0.0747099319335438, -0.465412805570879, // f 52//52 53//54 65//65 0.795387075964759, 0.388262871087871, -0.46541523645325, 0.995735158799549, 0.0922577559364866, 0, 0.881935001279079, 0.0747099319335438, -0.465412805570879, // f 52//52 40//41 53//54 0.795387075964759, 0.388262871087871, -0.46541523645325, 0.89516439351768, 0.445736142328759, 0, 0.995735158799549, 0.0922577559364866, 0, // f 53//54 67//66 66//67 0.995735158799549, 0.0922577559364866, 0, 0.853184945039769, -0.235513745235457, 0.465412425019631, 0.961826345690831, -0.273660520965343, 0, // f 53//54 54//53 67//66 0.995735158799549, 0.0922577559364866, 0, 0.880651789803303, 0.0885659845475568, 0.465412173774344, 0.853184945039769, -0.235513745235457, 0.465412425019631, // f 54//53 68//68 67//66 0.880651789803303, 0.0885659845475568, 0.465412173774344, 0.549018291985136, -0.143198553515279, 0.823451935049555, 0.853184945039769, -0.235513745235457, 0.465412425019631, // f 54//53 55//55 68//68 0.880651789803303, 0.0885659845475568, 0.465412173774344, 0.563691055696157, 0.0647926156107305, 0.823440532576866, 0.549018291985136, -0.143198553515279, 0.823451935049555, // f 55//55 69//69 68//68 0.563691055696157, 0.0647926156107305, 0.823440532576866, 0.119847158661504, -0.0182501764395345, 0.992624596522114, 0.549018291985136, -0.143198553515279, 0.823451935049555, // f 55//55 56//56 69//69 0.563691055696157, 0.0647926156107305, 0.823440532576866, 0.118352162819144, 0.0262462578715115, 0.992624752614891, 0.119847158661504, -0.0182501764395345, 0.992624596522114, // f 56//56 70//70 69//69 0.118352162819144, 0.0262462578715115, 0.992624752614891, -0.336503031582514, 0.110600982445592, 0.935164762177151, 0.119847158661504, -0.0182501764395345, 0.992624596522114, // f 56//56 57//57 70//70 0.118352162819144, 0.0262462578715115, 0.992624752614891, -0.353744874653347, -0.0184032535993825, 0.935160886646487, -0.336503031582514, 0.110600982445592, 0.935164762177151, // f 57//57 71//71 70//70 -0.353744874653347, -0.0184032535993825, 0.935160886646487, -0.716538308738006, 0.21424726839117, 0.663830520613356, -0.336503031582514, 0.110600982445592, 0.935164762177151, // f 57//57 58//58 71//71 -0.353744874653347, -0.0184032535993825, 0.935160886646487, -0.745555566890193, -0.059024469911701, 0.663824531507149, -0.716538308738006, 0.21424726839117, 0.663830520613356, // f 58//58 72//72 71//71 -0.745555566890193, -0.059024469911701, 0.663824531507149, -0.932801403620762, 0.269091636172212, 0.239731584788693, -0.716538308738006, 0.21424726839117, 0.663830520613356, // f 58//58 59//59 72//72 -0.745555566890193, -0.059024469911701, 0.663824531507149, -0.967023653028303, -0.0860023031678992, 0.239726632507974, -0.932801403620762, 0.269091636172212, 0.239731584788693, // f 59//59 73//73 72//72 -0.967023653028303, -0.0860023031678992, 0.239726632507974, -0.934747440132465, 0.262253418062693, -0.239729780962314, -0.932801403620762, 0.269091636172212, 0.239731584788693, // f 59//59 60//60 73//73 -0.967023653028303, -0.0860023031678992, 0.239726632507974, -0.966364047960982, -0.0931145098648123, -0.239729461812896, -0.934747440132465, 0.262253418062693, -0.239729780962314, // f 60//60 74//74 73//73 -0.966364047960982, -0.0931145098648123, -0.239729461812896, -0.722019549140227, 0.195016389503818, -0.663819537588522, -0.934747440132465, 0.262253418062693, -0.239729780962314, // f 60//60 61//61 74//74 -0.966364047960982, -0.0931145098648123, -0.239729461812896, -0.743716064145061, -0.0789520683984218, -0.663816982931433, -0.722019549140227, 0.195016389503818, -0.663819537588522, // f 61//61 75//75 74//74 -0.743716064145061, -0.0789520683984218, -0.663816982931433, -0.34434382914051, 0.083102924113477, -0.935158399062234, -0.722019549140227, 0.195016389503818, -0.663819537588522, // f 61//61 62//62 75//75 -0.743716064145061, -0.0789520683984218, -0.663816982931433, -0.351118355916626, -0.0468764480353951, -0.9351569380366, -0.34434382914051, 0.083102924113477, -0.935158399062234, // f 62//62 76//76 75//75 -0.351118355916626, -0.0468764480353951, -0.9351569380366, 0.111516062432304, -0.0475484530021181, -0.992624456900342, -0.34434382914051, 0.083102924113477, -0.935158399062234, // f 62//62 63//63 76//76 -0.351118355916626, -0.0468764480353951, -0.9351569380366, 0.121159194958444, -0.00405904003314949, -0.992624789974052, 0.111516062432304, -0.0475484530021181, -0.992624456900342, // f 63//63 77//77 76//76 0.121159194958444, -0.00405904003314949, -0.992624789974052, 0.542180356617463, -0.167246970957079, -0.823449398326238, 0.111516062432304, -0.0475484530021181, -0.992624456900342, // f 63//63 64//64 77//77 0.121159194958444, -0.00405904003314949, -0.992624789974052, 0.565986774924437, 0.0398584630316367, -0.823450225293181, 0.542180356617463, -0.167246970957079, -0.823449398326238, // f 64//64 78//78 77//77 0.565986774924437, 0.0398584630316367, -0.823450225293181, 0.849378818942468, -0.248883221269594, -0.465416763881974, 0.542180356617463, -0.167246970957079, -0.823449398326238, // f 64//64 65//65 78//78 0.565986774924437, 0.0398584630316367, -0.823450225293181, 0.881935001279079, 0.0747099319335438, -0.465412805570879, 0.849378818942468, -0.248883221269594, -0.465416763881974, // f 65//65 66//67 78//78 0.881935001279079, 0.0747099319335438, -0.465412805570879, 0.961826345690831, -0.273660520965343, 0, 0.849378818942468, -0.248883221269594, -0.465416763881974, // f 65//65 53//54 66//67 0.881935001279079, 0.0747099319335438, -0.465412805570879, 0.995735158799549, 0.0922577559364866, 0, 0.961826345690831, -0.273660520965343, 0, // f 66//67 80//79 79//80 0.961826345690831, -0.273660520965343, 0, 0.710495215915964, -0.527804989257322, 0.465422863077875, 0.798017764285871, -0.602633925268218, 0, // f 66//67 67//66 80//79 0.961826345690831, -0.273660520965343, 0, 0.853184945039769, -0.235513745235457, 0.465412425019631, 0.710495215915964, -0.527804989257322, 0.465422863077875, // f 67//66 81//81 80//79 0.853184945039769, -0.235513745235457, 0.465412425019631, 0.460206454975866, -0.331870587379057, 0.823451232333297, 0.710495215915964, -0.527804989257322, 0.465422863077875, // f 67//66 68//68 81//81 0.853184945039769, -0.235513745235457, 0.465412425019631, 0.549018291985136, -0.143198553515279, 0.823451935049555, 0.460206454975866, -0.331870587379057, 0.823451232333297, // f 68//68 82//82 81//81 0.549018291985136, -0.143198553515279, 0.823451935049555, 0.105167981792968, -0.0603055629810198, 0.992624266618108, 0.460206454975866, -0.331870587379057, 0.823451232333297, // f 68//68 69//69 82//82 0.549018291985136, -0.143198553515279, 0.823451935049555, 0.119847158661504, -0.0182501764395345, 0.992624596522114, 0.105167981792968, -0.0603055629810198, 0.992624266618108, // f 69//69 83//83 82//82 0.119847158661504, -0.0182501764395345, 0.992624596522114, -0.273816315582862, 0.224711541648992, 0.935162738976677, 0.105167981792968, -0.0603055629810198, 0.992624266618108, // f 69//69 70//70 83//83 0.119847158661504, -0.0182501764395345, 0.992624596522114, -0.336503031582514, 0.110600982445592, 0.935164762177151, -0.273816315582862, 0.224711541648992, 0.935162738976677, // f 70//70 84//84 83//83 -0.336503031582514, 0.110600982445592, 0.935164762177151, -0.590756927665859, 0.458639707436937, 0.663819155476065, -0.273816315582862, 0.224711541648992, 0.935162738976677, // f 70//70 71//71 84//84 -0.336503031582514, 0.110600982445592, 0.935164762177151, -0.716538308738006, 0.21424726839117, 0.663830520613356, -0.590756927665859, 0.458639707436937, 0.663819155476065, // f 71//71 85//85 84//84 -0.716538308738006, 0.21424726839117, 0.663830520613356, -0.772598662432371, 0.587895244575831, 0.239730031937667, -0.590756927665859, 0.458639707436937, 0.663819155476065, // f 71//71 72//72 85//85 -0.716538308738006, 0.21424726839117, 0.663830520613356, -0.932801403620762, 0.269091636172212, 0.239731584788693, -0.772598662432371, 0.587895244575831, 0.239730031937667, // f 72//72 86//86 85//85 -0.932801403620762, 0.269091636172212, 0.239731584788693, -0.776891715423174, 0.582211529083426, -0.239726923621812, -0.772598662432371, 0.587895244575831, 0.239730031937667, // f 72//72 73//73 86//86 -0.932801403620762, 0.269091636172212, 0.239731584788693, -0.934747440132465, 0.262253418062693, -0.239729780962314, -0.776891715423174, 0.582211529083426, -0.239726923621812, // f 73//73 87//87 86//86 -0.934747440132465, 0.262253418062693, -0.239729780962314, -0.602811365859816, 0.442677877871225, -0.663818313722702, -0.776891715423174, 0.582211529083426, -0.239726923621812, // f 73//73 74//74 87//87 -0.934747440132465, 0.262253418062693, -0.239729780962314, -0.722019549140227, 0.195016389503818, -0.663819537588522, -0.602811365859816, 0.442677877871225, -0.663818313722702, // f 74//74 88//88 87//87 -0.722019549140227, 0.195016389503818, -0.663819537588522, -0.291059317994663, 0.201882995024179, -0.935161873543051, -0.602811365859816, 0.442677877871225, -0.663818313722702, // f 74//74 75//75 88//88 -0.722019549140227, 0.195016389503818, -0.663819537588522, -0.34434382914051, 0.083102924113477, -0.935158399062234, -0.291059317994663, 0.201882995024179, -0.935161873543051, // f 75//75 89//89 88//88 -0.34434382914051, 0.083102924113477, -0.935158399062234, 0.0867958762680758, -0.0846288543903994, -0.992625021278139, -0.291059317994663, 0.201882995024179, -0.935161873543051, // f 75//75 76//76 89//89 -0.34434382914051, 0.083102924113477, -0.935158399062234, 0.111516062432304, -0.0475484530021181, -0.992624456900342, 0.0867958762680758, -0.0846288543903994, -0.992625021278139, // f 76//76 90//90 89//89 0.111516062432304, -0.0475484530021181, -0.992624456900342, 0.445154576765226, -0.351826149650363, -0.823441414556721, 0.0867958762680758, -0.0846288543903994, -0.992625021278139, // f 76//76 77//77 90//90 0.111516062432304, -0.0475484530021181, -0.992624456900342, 0.542180356617463, -0.167246970957079, -0.823449398326238, 0.445154576765226, -0.351826149650363, -0.823441414556721, // f 77//77 91//91 90//90 0.542180356617463, -0.167246970957079, -0.823449398326238, 0.702103945835893, -0.538915915318782, -0.465424199475907, 0.445154576765226, -0.351826149650363, -0.823441414556721, // f 77//77 78//78 91//91 0.542180356617463, -0.167246970957079, -0.823449398326238, 0.849378818942468, -0.248883221269594, -0.465416763881974, 0.702103945835893, -0.538915915318782, -0.465424199475907, // f 78//78 79//80 91//91 0.849378818942468, -0.248883221269594, -0.465416763881974, 0.798017764285871, -0.602633925268218, 0, 0.702103945835893, -0.538915915318782, -0.465424199475907, // f 78//78 66//67 79//80 0.849378818942468, -0.248883221269594, -0.465416763881974, 0.961826345690831, -0.273660520965343, 0, 0.798017764285871, -0.602633925268218, 0, // f 79//80 93//92 92//93 0.798017764285871, -0.602633925268218, 0, 0.471835239778737, -0.748832534752526, 0.46542597843164, 0.526419989214044, -0.850224673222252, 0, // f 79//80 80//79 93//92 0.798017764285871, -0.602633925268218, 0, 0.710495215915964, -0.527804989257322, 0.465422863077875, 0.471835239778737, -0.748832534752526, 0.46542597843164, // f 80//79 94//94 93//92 0.710495215915964, -0.527804989257322, 0.465422863077875, 0.309254015848302, -0.475707406794992, 0.82344666906976, 0.471835239778737, -0.748832534752526, 0.46542597843164, // f 80//79 81//81 94//94 0.710495215915964, -0.527804989257322, 0.465422863077875, 0.460206454975866, -0.331870587379057, 0.823451232333297, 0.309254015848302, -0.475707406794992, 0.82344666906976, // f 81//81 95//95 94//94 0.460206454975866, -0.331870587379057, 0.823451232333297, 0.0762666708803568, -0.0942418289989734, 0.992623731622288, 0.309254015848302, -0.475707406794992, 0.82344666906976, // f 81//81 82//82 95//95 0.460206454975866, -0.331870587379057, 0.823451232333297, 0.105167981792968, -0.0603055629810198, 0.992624266618108, 0.0762666708803568, -0.0942418289989734, 0.992623731622288, // f 82//82 96//96 95//95 0.105167981792968, -0.0603055629810198, 0.992624266618108, -0.174170859992215, 0.308454294021661, 0.93515798666812, 0.0762666708803568, -0.0942418289989734, 0.992623731622288, // f 82//82 83//83 96//96 0.105167981792968, -0.0603055629810198, 0.992624266618108, -0.273816315582862, 0.224711541648992, 0.935162738976677, -0.174170859992215, 0.308454294021661, 0.93515798666812, // f 83//83 97//97 96//96 -0.273816315582862, 0.224711541648992, 0.935162738976677, -0.385179126705895, 0.641080532734821, 0.663816835353339, -0.174170859992215, 0.308454294021661, 0.93515798666812, // f 83//83 84//84 97//97 -0.273816315582862, 0.224711541648992, 0.935162738976677, -0.590756927665859, 0.458639707436937, 0.663819155476065, -0.385179126705895, 0.641080532734821, 0.663816835353339, // f 84//84 98//98 97//97 -0.590756927665859, 0.458639707436937, 0.663819155476065, -0.508056944532428, 0.82728933477669, 0.23973005167712, -0.385179126705895, 0.641080532734821, 0.663816835353339, // f 84//84 85//85 98//98 -0.590756927665859, 0.458639707436937, 0.663819155476065, -0.772598662432371, 0.587895244575831, 0.239730031937667, -0.508056944532428, 0.82728933477669, 0.23973005167712, // f 85//85 99//99 98//98 -0.772598662432371, 0.587895244575831, 0.239730031937667, -0.514104604978491, 0.823544007108647, -0.239732608327158, -0.508056944532428, 0.82728933477669, 0.23973005167712, // f 85//85 86//86 99//99 -0.772598662432371, 0.587895244575831, 0.239730031937667, -0.776891715423174, 0.582211529083426, -0.239726923621812, -0.514104604978491, 0.823544007108647, -0.239732608327158, // f 86//86 100//100 99//99 -0.776891715423174, 0.582211529083426, -0.239726923621812, -0.402179302673228, 0.630552881584505, -0.663818402898529, -0.514104604978491, 0.823544007108647, -0.239732608327158, // f 86//86 87//87 100//100 -0.776891715423174, 0.582211529083426, -0.239726923621812, -0.602811365859816, 0.442677877871225, -0.663818313722702, -0.402179302673228, 0.630552881584505, -0.663818402898529, // f 87//87 101//101 100//100 -0.602811365859816, 0.442677877871225, -0.663818313722702, -0.198464437022003, 0.293408602878339, -0.93515948318697, -0.402179302673228, 0.630552881584505, -0.663818402898529, // f 87//87 88//88 101//101 -0.602811365859816, 0.442677877871225, -0.663818313722702, -0.291059317994663, 0.201882995024179, -0.935161873543051, -0.198464437022003, 0.293408602878339, -0.93515948318697, // f 88//88 102//102 101//101 -0.291059317994663, 0.201882995024179, -0.935161873543051, 0.050356549037174, -0.110264202209983, -0.992625822593822, -0.198464437022003, 0.293408602878339, -0.93515948318697, // f 88//88 89//89 102//102 -0.291059317994663, 0.201882995024179, -0.935161873543051, 0.0867958762680758, -0.0846288543903994, -0.992625021278139, 0.050356549037174, -0.110264202209983, -0.992625822593822, // f 89//89 103//103 102//102 0.0867958762680758, -0.0846288543903994, -0.992625021278139, 0.28798038844691, -0.488888542961915, -0.823441126268625, 0.050356549037174, -0.110264202209983, -0.992625822593822, // f 89//89 90//90 103//103 0.0867958762680758, -0.0846288543903994, -0.992625021278139, 0.445154576765226, -0.351826149650363, -0.823441414556721, 0.28798038844691, -0.488888542961915, -0.823441126268625, // f 90//90 104//104 103//103 0.445154576765226, -0.351826149650363, -0.823441414556721, 0.460019648224169, -0.756151077820451, -0.465421820243402, 0.28798038844691, -0.488888542961915, -0.823441126268625, // f 90//90 91//91 104//104 0.445154576765226, -0.351826149650363, -0.823441414556721, 0.702103945835893, -0.538915915318782, -0.465424199475907, 0.460019648224169, -0.756151077820451, -0.465421820243402, // f 91//91 92//93 104//104 0.702103945835893, -0.538915915318782, -0.465424199475907, 0.526419989214044, -0.850224673222252, 0, 0.460019648224169, -0.756151077820451, -0.465421820243402, // f 91//91 79//80 92//93 0.702103945835893, -0.538915915318782, -0.465424199475907, 0.798017764285871, -0.602633925268218, 0, 0.526419989214044, -0.850224673222252, 0, // f 92//93 106//105 105//106 0.526419989214044, -0.850224673222252, 0, 0.169441662199269, -0.868722649020972, 0.465414312402546, 0.183722341850236, -0.982978179363645, 0, // f 92//93 93//92 106//105 0.526419989214044, -0.850224673222252, 0, 0.471835239778737, -0.748832534752526, 0.46542597843164, 0.169441662199269, -0.868722649020972, 0.465414312402546, // f 93//92 107//107 106//105 0.471835239778737, -0.748832534752526, 0.46542597843164, 0.116523628167866, -0.555301290281198, 0.823445639426571, 0.169441662199269, -0.868722649020972, 0.465414312402546, // f 93//92 94//94 107//107 0.471835239778737, -0.748832534752526, 0.46542597843164, 0.309254015848302, -0.475707406794992, 0.82344666906976, 0.116523628167866, -0.555301290281198, 0.823445639426571, // f 94//94 108//108 107//107 0.309254015848302, -0.475707406794992, 0.82344666906976, 0.0370803435163779, -0.115422069282736, 0.992624195779651, 0.116523628167866, -0.555301290281198, 0.823445639426571, // f 94//94 95//95 108//108 0.309254015848302, -0.475707406794992, 0.82344666906976, 0.0762666708803568, -0.0942418289989734, 0.992623731622288, 0.0370803435163779, -0.115422069282736, 0.992624195779651, // f 95//95 109//109 108//108 0.0762666708803568, -0.0942418289989734, 0.992623731622288, -0.0509666421236971, 0.350540416424131, 0.935159781985855, 0.0370803435163779, -0.115422069282736, 0.992624195779651, // f 95//95 96//96 109//109 0.0762666708803568, -0.0942418289989734, 0.992623731622288, -0.174170859992215, 0.308454294021661, 0.93515798666812, -0.0509666421236971, 0.350540416424131, 0.935159781985855, // f 96//96 110//110 109//109 -0.174170859992215, 0.308454294021661, 0.93515798666812, -0.127568261321282, 0.736937286410219, 0.663814563414971, -0.0509666421236971, 0.350540416424131, 0.935159781985855, // f 96//96 97//97 110//110 -0.174170859992215, 0.308454294021661, 0.93515798666812, -0.385179126705895, 0.641080532734821, 0.663816835353339, -0.127568261321282, 0.736937286410219, 0.663814563414971, // f 97//97 111//111 110//110 -0.385179126705895, 0.641080532734821, 0.663816835353339, -0.174877398081322, 0.954958938219649, 0.239731770849648, -0.127568261321282, 0.736937286410219, 0.663814563414971, // f 97//97 98//98 111//111 -0.385179126705895, 0.641080532734821, 0.663816835353339, -0.508056944532428, 0.82728933477669, 0.23973005167712, -0.174877398081322, 0.954958938219649, 0.239731770849648, // f 98//98 112//112 111//111 -0.508056944532428, 0.82728933477669, 0.23973005167712, -0.181891441223181, 0.953649556275533, -0.239724899468605, -0.174877398081322, 0.954958938219649, 0.239731770849648, // f 98//98 99//99 112//112 -0.508056944532428, 0.82728933477669, 0.23973005167712, -0.514104604978491, 0.823544007108647, -0.239732608327158, -0.181891441223181, 0.953649556275533, -0.239724899468605, // f 99//99 113//113 112//112 -0.514104604978491, 0.823544007108647, -0.239732608327158, -0.147224456256214, 0.733255213973509, -0.663823583989546, -0.181891441223181, 0.953649556275533, -0.239724899468605, // f 99//99 100//100 113//113 -0.514104604978491, 0.823544007108647, -0.239732608327158, -0.402179302673228, 0.630552881584505, -0.663818402898529, -0.147224456256214, 0.733255213973509, -0.663823583989546, // f 100//100 114//114 113//113 -0.402179302673228, 0.630552881584505, -0.663818402898529, -0.0790739195152728, 0.345290015223281, -0.93515887454464, -0.147224456256214, 0.733255213973509, -0.663823583989546, // f 100//100 101//101 114//114 -0.402179302673228, 0.630552881584505, -0.663818402898529, -0.198464437022003, 0.293408602878339, -0.93515948318697, -0.0790739195152728, 0.345290015223281, -0.93515887454464, // f 101//101 115//115 114//114 -0.198464437022003, 0.293408602878339, -0.93515948318697, 0.00711105398077743, -0.1210369188043, -0.992622535104681, -0.0790739195152728, 0.345290015223281, -0.93515887454464, // f 101//101 102//102 115//115 -0.198464437022003, 0.293408602878339, -0.93515948318697, 0.050356549037174, -0.110264202209983, -0.992625822593822, 0.00711105398077743, -0.1210369188043, -0.992622535104681, // f 102//102 116//116 115//115 0.050356549037174, -0.110264202209983, -0.992625822593822, 0.0919242833387116, -0.559906907719167, -0.823440453719044, 0.00711105398077743, -0.1210369188043, -0.992622535104681, // f 102//102 103//103 116//116 0.050356549037174, -0.110264202209983, -0.992625822593822, 0.28798038844691, -0.488888542961915, -0.823441126268625, 0.0919242833387116, -0.559906907719167, -0.823440453719044, // f 103//103 117//117 116//116 0.28798038844691, -0.488888542961915, -0.823441126268625, 0.155771503117398, -0.871272780446364, -0.465423442544323, 0.0919242833387116, -0.559906907719167, -0.823440453719044, // f 103//103 104//104 117//117 0.28798038844691, -0.488888542961915, -0.823441126268625, 0.460019648224169, -0.756151077820451, -0.465421820243402, 0.155771503117398, -0.871272780446364, -0.465423442544323, // f 104//104 105//106 117//117 0.460019648224169, -0.756151077820451, -0.465421820243402, 0.183722341850236, -0.982978179363645, 0, 0.155771503117398, -0.871272780446364, -0.465423442544323, // f 104//104 92//93 105//106 0.460019648224169, -0.756151077820451, -0.465421820243402, 0.526419989214044, -0.850224673222252, 0, 0.183722341850236, -0.982978179363645, 0, // f 105//106 119//118 118//119 0.183722341850236, -0.982978179363645, 0, -0.155771503117398, -0.871272780446364, 0.465423442544323, -0.183722341850236, -0.982978179363645, 0, // f 105//106 106//105 119//118 0.183722341850236, -0.982978179363645, 0, 0.169441662199269, -0.868722649020972, 0.465414312402546, -0.155771503117398, -0.871272780446364, 0.465423442544323, // f 106//105 120//120 119//118 0.169441662199269, -0.868722649020972, 0.465414312402546, -0.0919242833387116, -0.559906907719167, 0.823440453719044, -0.155771503117398, -0.871272780446364, 0.465423442544323, // f 106//105 107//107 120//120 0.169441662199269, -0.868722649020972, 0.465414312402546, 0.116523628167866, -0.555301290281198, 0.823445639426571, -0.0919242833387116, -0.559906907719167, 0.823440453719044, // f 107//107 121//121 120//120 0.116523628167866, -0.555301290281198, 0.823445639426571, -0.00711105398077743, -0.1210369188043, 0.992622535104681, -0.0919242833387116, -0.559906907719167, 0.823440453719044, // f 107//107 108//108 121//121 0.116523628167866, -0.555301290281198, 0.823445639426571, 0.0370803435163779, -0.115422069282736, 0.992624195779651, -0.00711105398077743, -0.1210369188043, 0.992622535104681, // f 108//108 122//122 121//121 0.0370803435163779, -0.115422069282736, 0.992624195779651, 0.0790739195152728, 0.345290015223281, 0.93515887454464, -0.00711105398077743, -0.1210369188043, 0.992622535104681, // f 108//108 109//109 122//122 0.0370803435163779, -0.115422069282736, 0.992624195779651, -0.0509666421236971, 0.350540416424131, 0.935159781985855, 0.0790739195152728, 0.345290015223281, 0.93515887454464, // f 109//109 123//123 122//122 -0.0509666421236971, 0.350540416424131, 0.935159781985855, 0.147224456256214, 0.733255213973509, 0.663823583989546, 0.0790739195152728, 0.345290015223281, 0.93515887454464, // f 109//109 110//110 123//123 -0.0509666421236971, 0.350540416424131, 0.935159781985855, -0.127568261321282, 0.736937286410219, 0.663814563414971, 0.147224456256214, 0.733255213973509, 0.663823583989546, // f 110//110 124//124 123//123 -0.127568261321282, 0.736937286410219, 0.663814563414971, 0.181891441223181, 0.953649556275533, 0.239724899468605, 0.147224456256214, 0.733255213973509, 0.663823583989546, // f 110//110 111//111 124//124 -0.127568261321282, 0.736937286410219, 0.663814563414971, -0.174877398081322, 0.954958938219649, 0.239731770849648, 0.181891441223181, 0.953649556275533, 0.239724899468605, // f 111//111 125//125 124//124 -0.174877398081322, 0.954958938219649, 0.239731770849648, 0.174877398081322, 0.954958938219649, -0.239731770849648, 0.181891441223181, 0.953649556275533, 0.239724899468605, // f 111//111 112//112 125//125 -0.174877398081322, 0.954958938219649, 0.239731770849648, -0.181891441223181, 0.953649556275533, -0.239724899468605, 0.174877398081322, 0.954958938219649, -0.239731770849648, // f 112//112 126//126 125//125 -0.181891441223181, 0.953649556275533, -0.239724899468605, 0.127568261321282, 0.736937286410219, -0.663814563414971, 0.174877398081322, 0.954958938219649, -0.239731770849648, // f 112//112 113//113 126//126 -0.181891441223181, 0.953649556275533, -0.239724899468605, -0.147224456256214, 0.733255213973509, -0.663823583989546, 0.127568261321282, 0.736937286410219, -0.663814563414971, // f 113//113 127//127 126//126 -0.147224456256214, 0.733255213973509, -0.663823583989546, 0.0509666421236971, 0.350540416424131, -0.935159781985855, 0.127568261321282, 0.736937286410219, -0.663814563414971, // f 113//113 114//114 127//127 -0.147224456256214, 0.733255213973509, -0.663823583989546, -0.0790739195152728, 0.345290015223281, -0.93515887454464, 0.0509666421236971, 0.350540416424131, -0.935159781985855, // f 114//114 128//128 127//127 -0.0790739195152728, 0.345290015223281, -0.93515887454464, -0.0370803435163779, -0.115422069282736, -0.992624195779651, 0.0509666421236971, 0.350540416424131, -0.935159781985855, // f 114//114 115//115 128//128 -0.0790739195152728, 0.345290015223281, -0.93515887454464, 0.00711105398077743, -0.1210369188043, -0.992622535104681, -0.0370803435163779, -0.115422069282736, -0.992624195779651, // f 115//115 129//129 128//128 0.00711105398077743, -0.1210369188043, -0.992622535104681, -0.116523628167866, -0.555301290281198, -0.823445639426571, -0.0370803435163779, -0.115422069282736, -0.992624195779651, // f 115//115 116//116 129//129 0.00711105398077743, -0.1210369188043, -0.992622535104681, 0.0919242833387116, -0.559906907719167, -0.823440453719044, -0.116523628167866, -0.555301290281198, -0.823445639426571, // f 116//116 130//130 129//129 0.0919242833387116, -0.559906907719167, -0.823440453719044, -0.169441662199269, -0.868722649020972, -0.465414312402546, -0.116523628167866, -0.555301290281198, -0.823445639426571, // f 116//116 117//117 130//130 0.0919242833387116, -0.559906907719167, -0.823440453719044, 0.155771503117398, -0.871272780446364, -0.465423442544323, -0.169441662199269, -0.868722649020972, -0.465414312402546, // f 117//117 118//119 130//130 0.155771503117398, -0.871272780446364, -0.465423442544323, -0.183722341850236, -0.982978179363645, 0, -0.169441662199269, -0.868722649020972, -0.465414312402546, // f 117//117 105//106 118//119 0.155771503117398, -0.871272780446364, -0.465423442544323, 0.183722341850236, -0.982978179363645, 0, -0.183722341850236, -0.982978179363645, 0, // f 118//119 132//131 131//132 -0.183722341850236, -0.982978179363645, 0, -0.460009212709368, -0.756163924858812, 0.465411262180691, -0.526419989214044, -0.850224673222252, 0, // f 118//119 119//118 132//131 -0.183722341850236, -0.982978179363645, 0, -0.155771503117398, -0.871272780446364, 0.465423442544323, -0.460009212709368, -0.756163924858812, 0.465411262180691, // f 119//118 133//133 132//131 -0.155771503117398, -0.871272780446364, 0.465423442544323, -0.28798038844691, -0.488888542961915, 0.823441126268625, -0.460009212709368, -0.756163924858812, 0.465411262180691, // f 119//118 120//120 133//133 -0.155771503117398, -0.871272780446364, 0.465423442544323, -0.0919242833387116, -0.559906907719167, 0.823440453719044, -0.28798038844691, -0.488888542961915, 0.823441126268625, // f 120//120 134//134 133//133 -0.0919242833387116, -0.559906907719167, 0.823440453719044, -0.050356549037174, -0.110264202209983, 0.992625822593822, -0.28798038844691, -0.488888542961915, 0.823441126268625, // f 120//120 121//121 134//134 -0.0919242833387116, -0.559906907719167, 0.823440453719044, -0.00711105398077743, -0.1210369188043, 0.992622535104681, -0.050356549037174, -0.110264202209983, 0.992625822593822, // f 121//121 135//135 134//134 -0.00711105398077743, -0.1210369188043, 0.992622535104681, 0.198464437022003, 0.293408602878339, 0.93515948318697, -0.050356549037174, -0.110264202209983, 0.992625822593822, // f 121//121 122//122 135//135 -0.00711105398077743, -0.1210369188043, 0.992622535104681, 0.0790739195152728, 0.345290015223281, 0.93515887454464, 0.198464437022003, 0.293408602878339, 0.93515948318697, // f 122//122 136//136 135//135 0.0790739195152728, 0.345290015223281, 0.93515887454464, 0.402179302673228, 0.630552881584505, 0.663818402898529, 0.198464437022003, 0.293408602878339, 0.93515948318697, // f 122//122 123//123 136//136 0.0790739195152728, 0.345290015223281, 0.93515887454464, 0.147224456256214, 0.733255213973509, 0.663823583989546, 0.402179302673228, 0.630552881584505, 0.663818402898529, // f 123//123 137//137 136//136 0.147224456256214, 0.733255213973509, 0.663823583989546, 0.514104604978491, 0.823544007108647, 0.239732608327158, 0.402179302673228, 0.630552881584505, 0.663818402898529, // f 123//123 124//124 137//137 0.147224456256214, 0.733255213973509, 0.663823583989546, 0.181891441223181, 0.953649556275533, 0.239724899468605, 0.514104604978491, 0.823544007108647, 0.239732608327158, // f 124//124 138//138 137//137 0.181891441223181, 0.953649556275533, 0.239724899468605, 0.508056944532428, 0.82728933477669, -0.23973005167712, 0.514104604978491, 0.823544007108647, 0.239732608327158, // f 124//124 125//125 138//138 0.181891441223181, 0.953649556275533, 0.239724899468605, 0.174877398081322, 0.954958938219649, -0.239731770849648, 0.508056944532428, 0.82728933477669, -0.23973005167712, // f 125//125 139//139 138//138 0.174877398081322, 0.954958938219649, -0.239731770849648, 0.385179126705895, 0.641080532734821, -0.663816835353339, 0.508056944532428, 0.82728933477669, -0.23973005167712, // f 125//125 126//126 139//139 0.174877398081322, 0.954958938219649, -0.239731770849648, 0.127568261321282, 0.736937286410219, -0.663814563414971, 0.385179126705895, 0.641080532734821, -0.663816835353339, // f 126//126 140//140 139//139 0.127568261321282, 0.736937286410219, -0.663814563414971, 0.174170859992215, 0.308454294021661, -0.93515798666812, 0.385179126705895, 0.641080532734821, -0.663816835353339, // f 126//126 127//127 140//140 0.127568261321282, 0.736937286410219, -0.663814563414971, 0.0509666421236971, 0.350540416424131, -0.935159781985855, 0.174170859992215, 0.308454294021661, -0.93515798666812, // f 127//127 141//141 140//140 0.0509666421236971, 0.350540416424131, -0.935159781985855, -0.0762666708803568, -0.0942418289989734, -0.992623731622288, 0.174170859992215, 0.308454294021661, -0.93515798666812, // f 127//127 128//128 141//141 0.0509666421236971, 0.350540416424131, -0.935159781985855, -0.0370803435163779, -0.115422069282736, -0.992624195779651, -0.0762666708803568, -0.0942418289989734, -0.992623731622288, // f 128//128 142//142 141//141 -0.0370803435163779, -0.115422069282736, -0.992624195779651, -0.309254015848302, -0.475707406794992, -0.82344666906976, -0.0762666708803568, -0.0942418289989734, -0.992623731622288, // f 128//128 129//129 142//142 -0.0370803435163779, -0.115422069282736, -0.992624195779651, -0.116523628167866, -0.555301290281198, -0.823445639426571, -0.309254015848302, -0.475707406794992, -0.82344666906976, // f 129//129 143//143 142//142 -0.116523628167866, -0.555301290281198, -0.823445639426571, -0.471835239778737, -0.748832534752526, -0.46542597843164, -0.309254015848302, -0.475707406794992, -0.82344666906976, // f 129//129 130//130 143//143 -0.116523628167866, -0.555301290281198, -0.823445639426571, -0.169441662199269, -0.868722649020972, -0.465414312402546, -0.471835239778737, -0.748832534752526, -0.46542597843164, // f 130//130 131//132 143//143 -0.169441662199269, -0.868722649020972, -0.465414312402546, -0.526419989214044, -0.850224673222252, 0, -0.471835239778737, -0.748832534752526, -0.46542597843164, // f 130//130 118//119 131//132 -0.169441662199269, -0.868722649020972, -0.465414312402546, -0.183722341850236, -0.982978179363645, 0, -0.526419989214044, -0.850224673222252, 0, // f 131//132 145//144 144//145 -0.526419989214044, -0.850224673222252, 0, -0.702103945835893, -0.538915915318782, 0.465424199475907, -0.798017764285871, -0.602633925268218, 0, // f 131//132 132//131 145//144 -0.526419989214044, -0.850224673222252, 0, -0.460009212709368, -0.756163924858812, 0.465411262180691, -0.702103945835893, -0.538915915318782, 0.465424199475907, // f 132//131 146//146 145//144 -0.460009212709368, -0.756163924858812, 0.465411262180691, -0.445154576765226, -0.351826149650363, 0.823441414556721, -0.702103945835893, -0.538915915318782, 0.465424199475907, // f 132//131 133//133 146//146 -0.460009212709368, -0.756163924858812, 0.465411262180691, -0.28798038844691, -0.488888542961915, 0.823441126268625, -0.445154576765226, -0.351826149650363, 0.823441414556721, // f 133//133 147//147 146//146 -0.28798038844691, -0.488888542961915, 0.823441126268625, -0.0867958762680758, -0.0846288543903994, 0.992625021278139, -0.445154576765226, -0.351826149650363, 0.823441414556721, // f 133//133 134//134 147//147 -0.28798038844691, -0.488888542961915, 0.823441126268625, -0.050356549037174, -0.110264202209983, 0.992625822593822, -0.0867958762680758, -0.0846288543903994, 0.992625021278139, // f 134//134 148//148 147//147 -0.050356549037174, -0.110264202209983, 0.992625822593822, 0.291059317994663, 0.201882995024179, 0.935161873543051, -0.0867958762680758, -0.0846288543903994, 0.992625021278139, // f 134//134 135//135 148//148 -0.050356549037174, -0.110264202209983, 0.992625822593822, 0.198464437022003, 0.293408602878339, 0.93515948318697, 0.291059317994663, 0.201882995024179, 0.935161873543051, // f 135//135 149//149 148//148 0.198464437022003, 0.293408602878339, 0.93515948318697, 0.602811365859816, 0.442677877871225, 0.663818313722702, 0.291059317994663, 0.201882995024179, 0.935161873543051, // f 135//135 136//136 149//149 0.198464437022003, 0.293408602878339, 0.93515948318697, 0.402179302673228, 0.630552881584505, 0.663818402898529, 0.602811365859816, 0.442677877871225, 0.663818313722702, // f 136//136 150//150 149//149 0.402179302673228, 0.630552881584505, 0.663818402898529, 0.776891715423174, 0.582211529083426, 0.239726923621812, 0.602811365859816, 0.442677877871225, 0.663818313722702, // f 136//136 137//137 150//150 0.402179302673228, 0.630552881584505, 0.663818402898529, 0.514104604978491, 0.823544007108647, 0.239732608327158, 0.776891715423174, 0.582211529083426, 0.239726923621812, // f 137//137 151//151 150//150 0.514104604978491, 0.823544007108647, 0.239732608327158, 0.772598662432371, 0.587895244575831, -0.239730031937667, 0.776891715423174, 0.582211529083426, 0.239726923621812, // f 137//137 138//138 151//151 0.514104604978491, 0.823544007108647, 0.239732608327158, 0.508056944532428, 0.82728933477669, -0.23973005167712, 0.772598662432371, 0.587895244575831, -0.239730031937667, // f 138//138 152//152 151//151 0.508056944532428, 0.82728933477669, -0.23973005167712, 0.590756927665859, 0.458639707436937, -0.663819155476065, 0.772598662432371, 0.587895244575831, -0.239730031937667, // f 138//138 139//139 152//152 0.508056944532428, 0.82728933477669, -0.23973005167712, 0.385179126705895, 0.641080532734821, -0.663816835353339, 0.590756927665859, 0.458639707436937, -0.663819155476065, // f 139//139 153//153 152//152 0.385179126705895, 0.641080532734821, -0.663816835353339, 0.273816315582862, 0.224711541648992, -0.935162738976677, 0.590756927665859, 0.458639707436937, -0.663819155476065, // f 139//139 140//140 153//153 0.385179126705895, 0.641080532734821, -0.663816835353339, 0.174170859992215, 0.308454294021661, -0.93515798666812, 0.273816315582862, 0.224711541648992, -0.935162738976677, // f 140//140 154//154 153//153 0.174170859992215, 0.308454294021661, -0.93515798666812, -0.105167981792968, -0.0603055629810198, -0.992624266618108, 0.273816315582862, 0.224711541648992, -0.935162738976677, // f 140//140 141//141 154//154 0.174170859992215, 0.308454294021661, -0.93515798666812, -0.0762666708803568, -0.0942418289989734, -0.992623731622288, -0.105167981792968, -0.0603055629810198, -0.992624266618108, // f 141//141 155//155 154//154 -0.0762666708803568, -0.0942418289989734, -0.992623731622288, -0.460206454975866, -0.331870587379057, -0.823451232333297, -0.105167981792968, -0.0603055629810198, -0.992624266618108, // f 141//141 142//142 155//155 -0.0762666708803568, -0.0942418289989734, -0.992623731622288, -0.309254015848302, -0.475707406794992, -0.82344666906976, -0.460206454975866, -0.331870587379057, -0.823451232333297, // f 142//142 156//156 155//155 -0.309254015848302, -0.475707406794992, -0.82344666906976, -0.710495215915964, -0.527804989257322, -0.465422863077875, -0.460206454975866, -0.331870587379057, -0.823451232333297, // f 142//142 143//143 156//156 -0.309254015848302, -0.475707406794992, -0.82344666906976, -0.471835239778737, -0.748832534752526, -0.46542597843164, -0.710495215915964, -0.527804989257322, -0.465422863077875, // f 143//143 144//145 156//156 -0.471835239778737, -0.748832534752526, -0.46542597843164, -0.798017764285871, -0.602633925268218, 0, -0.710495215915964, -0.527804989257322, -0.465422863077875, // f 143//143 131//132 144//145 -0.471835239778737, -0.748832534752526, -0.46542597843164, -0.526419989214044, -0.850224673222252, 0, -0.798017764285871, -0.602633925268218, 0, // f 144//145 158//157 157//158 -0.798017764285871, -0.602633925268218, 0, -0.849378818942468, -0.248883221269594, 0.465416763881974, -0.961826345690831, -0.273660520965343, 0, // f 144//145 145//144 158//157 -0.798017764285871, -0.602633925268218, 0, -0.702103945835893, -0.538915915318782, 0.465424199475907, -0.849378818942468, -0.248883221269594, 0.465416763881974, // f 145//144 159//159 158//157 -0.702103945835893, -0.538915915318782, 0.465424199475907, -0.542180356617463, -0.167246970957079, 0.823449398326238, -0.849378818942468, -0.248883221269594, 0.465416763881974, // f 145//144 146//146 159//159 -0.702103945835893, -0.538915915318782, 0.465424199475907, -0.445154576765226, -0.351826149650363, 0.823441414556721, -0.542180356617463, -0.167246970957079, 0.823449398326238, // f 146//146 160//160 159//159 -0.445154576765226, -0.351826149650363, 0.823441414556721, -0.111516062432304, -0.0475484530021181, 0.992624456900342, -0.542180356617463, -0.167246970957079, 0.823449398326238, // f 146//146 147//147 160//160 -0.445154576765226, -0.351826149650363, 0.823441414556721, -0.0867958762680758, -0.0846288543903994, 0.992625021278139, -0.111516062432304, -0.0475484530021181, 0.992624456900342, // f 147//147 161//161 160//160 -0.0867958762680758, -0.0846288543903994, 0.992625021278139, 0.34434382914051, 0.083102924113477, 0.935158399062234, -0.111516062432304, -0.0475484530021181, 0.992624456900342, // f 147//147 148//148 161//161 -0.0867958762680758, -0.0846288543903994, 0.992625021278139, 0.291059317994663, 0.201882995024179, 0.935161873543051, 0.34434382914051, 0.083102924113477, 0.935158399062234, // f 148//148 162//162 161//161 0.291059317994663, 0.201882995024179, 0.935161873543051, 0.722019549140227, 0.195016389503818, 0.663819537588522, 0.34434382914051, 0.083102924113477, 0.935158399062234, // f 148//148 149//149 162//162 0.291059317994663, 0.201882995024179, 0.935161873543051, 0.602811365859816, 0.442677877871225, 0.663818313722702, 0.722019549140227, 0.195016389503818, 0.663819537588522, // f 149//149 163//163 162//162 0.602811365859816, 0.442677877871225, 0.663818313722702, 0.934747440132465, 0.262253418062693, 0.239729780962314, 0.722019549140227, 0.195016389503818, 0.663819537588522, // f 149//149 150//150 163//163 0.602811365859816, 0.442677877871225, 0.663818313722702, 0.776891715423174, 0.582211529083426, 0.239726923621812, 0.934747440132465, 0.262253418062693, 0.239729780962314, // f 150//150 164//164 163//163 0.776891715423174, 0.582211529083426, 0.239726923621812, 0.932801403620762, 0.269091636172212, -0.239731584788693, 0.934747440132465, 0.262253418062693, 0.239729780962314, // f 150//150 151//151 164//164 0.776891715423174, 0.582211529083426, 0.239726923621812, 0.772598662432371, 0.587895244575831, -0.239730031937667, 0.932801403620762, 0.269091636172212, -0.239731584788693, // f 151//151 165//165 164//164 0.772598662432371, 0.587895244575831, -0.239730031937667, 0.716538308738006, 0.21424726839117, -0.663830520613356, 0.932801403620762, 0.269091636172212, -0.239731584788693, // f 151//151 152//152 165//165 0.772598662432371, 0.587895244575831, -0.239730031937667, 0.590756927665859, 0.458639707436937, -0.663819155476065, 0.716538308738006, 0.21424726839117, -0.663830520613356, // f 152//152 166//166 165//165 0.590756927665859, 0.458639707436937, -0.663819155476065, 0.336503031582514, 0.110600982445592, -0.935164762177151, 0.716538308738006, 0.21424726839117, -0.663830520613356, // f 152//152 153//153 166//166 0.590756927665859, 0.458639707436937, -0.663819155476065, 0.273816315582862, 0.224711541648992, -0.935162738976677, 0.336503031582514, 0.110600982445592, -0.935164762177151, // f 153//153 167//167 166//166 0.273816315582862, 0.224711541648992, -0.935162738976677, -0.119847158661504, -0.0182501764395345, -0.992624596522114, 0.336503031582514, 0.110600982445592, -0.935164762177151, // f 153//153 154//154 167//167 0.273816315582862, 0.224711541648992, -0.935162738976677, -0.105167981792968, -0.0603055629810198, -0.992624266618108, -0.119847158661504, -0.0182501764395345, -0.992624596522114, // f 154//154 168//168 167//167 -0.105167981792968, -0.0603055629810198, -0.992624266618108, -0.549018291985136, -0.143198553515279, -0.823451935049555, -0.119847158661504, -0.0182501764395345, -0.992624596522114, // f 154//154 155//155 168//168 -0.105167981792968, -0.0603055629810198, -0.992624266618108, -0.460206454975866, -0.331870587379057, -0.823451232333297, -0.549018291985136, -0.143198553515279, -0.823451935049555, // f 155//155 169//169 168//168 -0.460206454975866, -0.331870587379057, -0.823451232333297, -0.853184945039769, -0.235513745235457, -0.465412425019631, -0.549018291985136, -0.143198553515279, -0.823451935049555, // f 155//155 156//156 169//169 -0.460206454975866, -0.331870587379057, -0.823451232333297, -0.710495215915964, -0.527804989257322, -0.465422863077875, -0.853184945039769, -0.235513745235457, -0.465412425019631, // f 156//156 157//158 169//169 -0.710495215915964, -0.527804989257322, -0.465422863077875, -0.961826345690831, -0.273660520965343, 0, -0.853184945039769, -0.235513745235457, -0.465412425019631, // f 156//156 144//145 157//158 -0.710495215915964, -0.527804989257322, -0.465422863077875, -0.798017764285871, -0.602633925268218, 0, -0.961826345690831, -0.273660520965343, 0, // f 157//158 171//170 170//171 -0.961826345690831, -0.273660520965343, 0, -0.881935001279079, 0.0747099319335438, 0.465412805570879, -0.995735158799549, 0.0922577559364866, 0, // f 157//158 158//157 171//170 -0.961826345690831, -0.273660520965343, 0, -0.849378818942468, -0.248883221269594, 0.465416763881974, -0.881935001279079, 0.0747099319335438, 0.465412805570879, // f 158//157 172//172 171//170 -0.849378818942468, -0.248883221269594, 0.465416763881974, -0.565986075287836, 0.0398894148607535, 0.823449207396752, -0.881935001279079, 0.0747099319335438, 0.465412805570879, // f 158//157 159//159 172//172 -0.849378818942468, -0.248883221269594, 0.465416763881974, -0.542180356617463, -0.167246970957079, 0.823449398326238, -0.565986075287836, 0.0398894148607535, 0.823449207396752, // f 159//159 173//173 172//172 -0.542180356617463, -0.167246970957079, 0.823449398326238, -0.121159194958444, -0.00405904003314949, 0.992624789974052, -0.565986075287836, 0.0398894148607535, 0.823449207396752, // f 159//159 160//160 173//173 -0.542180356617463, -0.167246970957079, 0.823449398326238, -0.111516062432304, -0.0475484530021181, 0.992624456900342, -0.121159194958444, -0.00405904003314949, 0.992624789974052, // f 160//160 174//174 173//173 -0.111516062432304, -0.0475484530021181, 0.992624456900342, 0.351118355916626, -0.0468764480353951, 0.9351569380366, -0.121159194958444, -0.00405904003314949, 0.992624789974052, // f 160//160 161//161 174//174 -0.111516062432304, -0.0475484530021181, 0.992624456900342, 0.34434382914051, 0.083102924113477, 0.935158399062234, 0.351118355916626, -0.0468764480353951, 0.9351569380366, // f 161//161 175//175 174//174 0.34434382914051, 0.083102924113477, 0.935158399062234, 0.743716064145061, -0.0789520683984218, 0.663816982931433, 0.351118355916626, -0.0468764480353951, 0.9351569380366, // f 161//161 162//162 175//175 0.34434382914051, 0.083102924113477, 0.935158399062234, 0.722019549140227, 0.195016389503818, 0.663819537588522, 0.743716064145061, -0.0789520683984218, 0.663816982931433, // f 162//162 176//176 175//175 0.722019549140227, 0.195016389503818, 0.663819537588522, 0.966364047960982, -0.0931145098648123, 0.239729461812896, 0.743716064145061, -0.0789520683984218, 0.663816982931433, // f 162//162 163//163 176//176 0.722019549140227, 0.195016389503818, 0.663819537588522, 0.934747440132465, 0.262253418062693, 0.239729780962314, 0.966364047960982, -0.0931145098648123, 0.239729461812896, // f 163//163 177//177 176//176 0.934747440132465, 0.262253418062693, 0.239729780962314, 0.967023653028303, -0.0860023031678992, -0.239726632507974, 0.966364047960982, -0.0931145098648123, 0.239729461812896, // f 163//163 164//164 177//177 0.934747440132465, 0.262253418062693, 0.239729780962314, 0.932801403620762, 0.269091636172212, -0.239731584788693, 0.967023653028303, -0.0860023031678992, -0.239726632507974, // f 164//164 178//178 177//177 0.932801403620762, 0.269091636172212, -0.239731584788693, 0.745555566890193, -0.059024469911701, -0.663824531507149, 0.967023653028303, -0.0860023031678992, -0.239726632507974, // f 164//164 165//165 178//178 0.932801403620762, 0.269091636172212, -0.239731584788693, 0.716538308738006, 0.21424726839117, -0.663830520613356, 0.745555566890193, -0.059024469911701, -0.663824531507149, // f 165//165 179//179 178//178 0.716538308738006, 0.21424726839117, -0.663830520613356, 0.353744874653347, -0.0184032535993825, -0.935160886646487, 0.745555566890193, -0.059024469911701, -0.663824531507149, // f 165//165 166//166 179//179 0.716538308738006, 0.21424726839117, -0.663830520613356, 0.336503031582514, 0.110600982445592, -0.935164762177151, 0.353744874653347, -0.0184032535993825, -0.935160886646487, // f 166//166 180//180 179//179 0.336503031582514, 0.110600982445592, -0.935164762177151, -0.118352162819144, 0.0262462578715115, -0.992624752614891, 0.353744874653347, -0.0184032535993825, -0.935160886646487, // f 166//166 167//167 180//180 0.336503031582514, 0.110600982445592, -0.935164762177151, -0.119847158661504, -0.0182501764395345, -0.992624596522114, -0.118352162819144, 0.0262462578715115, -0.992624752614891, // f 167//167 181//181 180//180 -0.119847158661504, -0.0182501764395345, -0.992624596522114, -0.563691055696157, 0.0647926156107305, -0.823440532576866, -0.118352162819144, 0.0262462578715115, -0.992624752614891, // f 167//167 168//168 181//181 -0.119847158661504, -0.0182501764395345, -0.992624596522114, -0.549018291985136, -0.143198553515279, -0.823451935049555, -0.563691055696157, 0.0647926156107305, -0.823440532576866, // f 168//168 182//182 181//181 -0.549018291985136, -0.143198553515279, -0.823451935049555, -0.880651789803303, 0.0885659845475568, -0.465412173774344, -0.563691055696157, 0.0647926156107305, -0.823440532576866, // f 168//168 169//169 182//182 -0.549018291985136, -0.143198553515279, -0.823451935049555, -0.853184945039769, -0.235513745235457, -0.465412425019631, -0.880651789803303, 0.0885659845475568, -0.465412173774344, // f 169//169 170//171 182//182 -0.853184945039769, -0.235513745235457, -0.465412425019631, -0.995735158799549, 0.0922577559364866, 0, -0.880651789803303, 0.0885659845475568, -0.465412173774344, // f 169//169 157//158 170//171 -0.853184945039769, -0.235513745235457, -0.465412425019631, -0.961826345690831, -0.273660520965343, 0, -0.995735158799549, 0.0922577559364866, 0, // f 170//171 184//183 183//184 -0.995735158799549, 0.0922577559364866, 0, -0.795387075964759, 0.388262871087871, 0.46541523645325, -0.89516439351768, 0.445736142328759, 0, // f 170//171 171//170 184//183 -0.995735158799549, 0.0922577559364866, 0, -0.881935001279079, 0.0747099319335438, 0.465412805570879, -0.795387075964759, 0.388262871087871, 0.46541523645325, // f 171//170 185//185 184//183 -0.881935001279079, 0.0747099319335438, 0.465412805570879, -0.513366486990845, 0.241652819343043, 0.823443237229038, -0.795387075964759, 0.388262871087871, 0.46541523645325, // f 171//170 172//172 185//185 -0.881935001279079, 0.0747099319335438, 0.465412805570879, -0.565986075287836, 0.0398894148607535, 0.823449207396752, -0.513366486990845, 0.241652819343043, 0.823443237229038, // f 172//172 186//186 185//185 -0.565986075287836, 0.0398894148607535, 0.823449207396752, -0.114445265201575, 0.0399494416442776, 0.992625973559654, -0.513366486990845, 0.241652819343043, 0.823443237229038, // f 172//172 173//173 186//186 -0.565986075287836, 0.0398894148607535, 0.823449207396752, -0.121159194958444, -0.00405904003314949, 0.992624789974052, -0.114445265201575, 0.0399494416442776, 0.992625973559654, // f 173//173 187//187 186//186 -0.121159194958444, -0.00405904003314949, 0.992624789974052, 0.310467523994339, -0.170569386670531, 0.935155602493865, -0.114445265201575, 0.0399494416442776, 0.992625973559654, // f 173//173 174//174 187//187 -0.121159194958444, -0.00405904003314949, 0.992624789974052, 0.351118355916626, -0.0468764480353951, 0.9351569380366, 0.310467523994339, -0.170569386670531, 0.935155602493865, // f 174//174 188//188 187//187 0.351118355916626, -0.0468764480353951, 0.9351569380366, 0.664978363065988, -0.342270333963109, 0.663818344988191, 0.310467523994339, -0.170569386670531, 0.935155602493865, // f 174//174 175//175 188//188 0.351118355916626, -0.0468764480353951, 0.9351569380366, 0.743716064145061, -0.0789520683984218, 0.663816982931433, 0.664978363065988, -0.342270333963109, 0.663818344988191, // f 175//175 189//189 188//188 0.743716064145061, -0.0789520683984218, 0.663816982931433, 0.867477162214392, -0.435905628976394, 0.239728295499633, 0.664978363065988, -0.342270333963109, 0.663818344988191, // f 175//175 176//176 189//189 0.743716064145061, -0.0789520683984218, 0.663816982931433, 0.966364047960982, -0.0931145098648123, 0.239729461812896, 0.867477162214392, -0.435905628976394, 0.239728295499633, // f 176//176 190//190 189//189 0.966364047960982, -0.0931145098648123, 0.239729461812896, 0.870652500417476, -0.429528113685591, -0.239728644659947, 0.867477162214392, -0.435905628976394, 0.239728295499633, // f 176//176 177//177 190//190 0.966364047960982, -0.0931145098648123, 0.239729461812896, 0.967023653028303, -0.0860023031678992, -0.239726632507974, 0.870652500417476, -0.429528113685591, -0.239728644659947, // f 177//177 191//191 190//190 0.967023653028303, -0.0860023031678992, -0.239726632507974, 0.673886749517774, -0.324384730337828, -0.66381563370263, 0.870652500417476, -0.429528113685591, -0.239728644659947, // f 177//177 178//178 191//191 0.967023653028303, -0.0860023031678992, -0.239726632507974, 0.745555566890193, -0.059024469911701, -0.663824531507149, 0.673886749517774, -0.324384730337828, -0.66381563370263, // f 178//178 192//192 191//191 0.745555566890193, -0.059024469911701, -0.663824531507149, 0.32319609429674, -0.144965284978661, -0.935162740266307, 0.673886749517774, -0.324384730337828, -0.66381563370263, // f 178//178 179//179 192//192 0.745555566890193, -0.059024469911701, -0.663824531507149, 0.353744874653347, -0.0184032535993825, -0.935160886646487, 0.32319609429674, -0.144965284978661, -0.935162740266307, // f 179//179 193//193 192//192 0.353744874653347, -0.0184032535993825, -0.935160886646487, -0.100865098096815, 0.0672327319484161, -0.992625806505489, 0.32319609429674, -0.144965284978661, -0.935162740266307, // f 179//179 180//180 193//193 0.353744874653347, -0.0184032535993825, -0.935160886646487, -0.118352162819144, 0.0262462578715115, -0.992624752614891, -0.100865098096815, 0.0672327319484161, -0.992625806505489, // f 180//180 194//194 193//193 -0.118352162819144, 0.0262462578715115, -0.992624752614891, -0.502227353354359, 0.264023545633435, -0.823443533518738, -0.100865098096815, 0.0672327319484161, -0.992625806505489, // f 180//180 181//181 194//194 -0.118352162819144, 0.0262462578715115, -0.992624752614891, -0.563691055696157, 0.0647926156107305, -0.823440532576866, -0.502227353354359, 0.264023545633435, -0.823443533518738, // f 181//181 195//195 194//194 -0.563691055696157, 0.0647926156107305, -0.823440532576866, -0.789177538356504, 0.400722998778123, -0.465424420506528, -0.502227353354359, 0.264023545633435, -0.823443533518738, // f 181//181 182//182 195//195 -0.563691055696157, 0.0647926156107305, -0.823440532576866, -0.880651789803303, 0.0885659845475568, -0.465412173774344, -0.789177538356504, 0.400722998778123, -0.465424420506528, // f 182//182 183//184 195//195 -0.880651789803303, 0.0885659845475568, -0.465412173774344, -0.89516439351768, 0.445736142328759, 0, -0.789177538356504, 0.400722998778123, -0.465424420506528, // f 182//182 170//171 183//184 -0.880651789803303, 0.0885659845475568, -0.465412173774344, -0.995735158799549, 0.0922577559364866, 0, -0.89516439351768, 0.445736142328759, 0, // f 183//184 197//196 196//197 -0.89516439351768, 0.445736142328759, 0, -0.601407465271149, 0.649383220339146, 0.465414324938642, -0.673680906166071, 0.739022351940225, 0, // f 183//184 184//183 197//196 -0.89516439351768, 0.445736142328759, 0, -0.795387075964759, 0.388262871087871, 0.46541523645325, -0.601407465271149, 0.649383220339146, 0.465414324938642, // f 184//183 198//198 197//196 -0.795387075964759, 0.388262871087871, 0.46541523645325, -0.391409033190445, 0.410788480441844, 0.823439003857118, -0.601407465271149, 0.649383220339146, 0.465414324938642, // f 184//183 185//185 198//198 -0.795387075964759, 0.388262871087871, 0.46541523645325, -0.513366486990845, 0.241652819343043, 0.823443237229038, -0.391409033190445, 0.410788480441844, 0.823439003857118, // f 185//185 199//199 198//198 -0.513366486990845, 0.241652819343043, 0.823443237229038, -0.092288826513591, 0.0786167040697867, 0.992623889669168, -0.391409033190445, 0.410788480441844, 0.823439003857118, // f 185//185 186//186 199//199 -0.513366486990845, 0.241652819343043, 0.823443237229038, -0.114445265201575, 0.0399494416442776, 0.992625973559654, -0.092288826513591, 0.0786167040697867, 0.992623889669168, // f 186//186 200//200 199//199 -0.114445265201575, 0.0399494416442776, 0.992625973559654, 0.22788491958948, -0.271190474406545, 0.935159980973763, -0.092288826513591, 0.0786167040697867, 0.992623889669168, // f 186//186 187//187 200//200 -0.114445265201575, 0.0399494416442776, 0.992625973559654, 0.310467523994339, -0.170569386670531, 0.935155602493865, 0.22788491958948, -0.271190474406545, 0.935159980973763, // f 187//187 201//201 200//200 0.310467523994339, -0.170569386670531, 0.935155602493865, 0.496422143341875, -0.559383176158847, 0.663818889329235, 0.22788491958948, -0.271190474406545, 0.935159980973763, // f 187//187 188//188 201//201 0.310467523994339, -0.170569386670531, 0.935155602493865, 0.664978363065988, -0.342270333963109, 0.663818344988191, 0.496422143341875, -0.559383176158847, 0.663818889329235, // f 188//188 202//202 201//201 0.664978363065988, -0.342270333963109, 0.663818344988191, 0.651405967231767, -0.719860960461469, 0.239729980307714, 0.496422143341875, -0.559383176158847, 0.663818889329235, // f 188//188 189//189 202//202 0.664978363065988, -0.342270333963109, 0.663818344988191, 0.867477162214392, -0.435905628976394, 0.239728295499633, 0.651405967231767, -0.719860960461469, 0.239729980307714, // f 189//189 203//203 202//202 0.867477162214392, -0.435905628976394, 0.239728295499633, 0.656690179621407, -0.7150432393474, -0.239731461957709, 0.651405967231767, -0.719860960461469, 0.239729980307714, // f 189//189 190//190 203//203 0.867477162214392, -0.435905628976394, 0.239728295499633, 0.870652500417476, -0.429528113685591, -0.239728644659947, 0.656690179621407, -0.7150432393474, -0.239731461957709, // f 190//190 204//204 203//203 0.870652500417476, -0.429528113685591, -0.239728644659947, 0.511199927686784, -0.54590094100042, -0.663827384602264, 0.656690179621407, -0.7150432393474, -0.239731461957709, // f 190//190 191//191 204//204 0.870652500417476, -0.429528113685591, -0.239728644659947, 0.673886749517774, -0.324384730337828, -0.66381563370263, 0.511199927686784, -0.54590094100042, -0.663827384602264, // f 191//191 205//205 204//204 0.673886749517774, -0.324384730337828, -0.66381563370263, 0.249004485488958, -0.251933526488782, -0.935161090100152, 0.511199927686784, -0.54590094100042, -0.663827384602264, // f 191//191 192//192 205//205 0.673886749517774, -0.324384730337828, -0.66381563370263, 0.32319609429674, -0.144965284978661, -0.935162740266307, 0.249004485488958, -0.251933526488782, -0.935161090100152, // f 192//192 206//206 205//205 0.32319609429674, -0.144965284978661, -0.935162740266307, -0.0697655787959561, 0.0991558226261453, -0.992623235097082, 0.249004485488958, -0.251933526488782, -0.935161090100152, // f 192//192 193//193 206//206 0.32319609429674, -0.144965284978661, -0.935162740266307, -0.100865098096815, 0.0672327319484161, -0.992625806505489, -0.0697655787959561, 0.0991558226261453, -0.992623235097082, // f 193//193 207//207 206//206 -0.100865098096815, 0.0672327319484161, -0.992625806505489, -0.372916717433467, 0.427637290074405, -0.823443665344793, -0.0697655787959561, 0.0991558226261453, -0.992623235097082, // f 193//193 194//194 207//207 -0.100865098096815, 0.0672327319484161, -0.992625806505489, -0.502227353354359, 0.264023545633435, -0.823443533518738, -0.372916717433467, 0.427637290074405, -0.823443665344793, // f 194//194 208//208 207//207 -0.502227353354359, 0.264023545633435, -0.823443533518738, -0.591125036320287, 0.658755413390838, -0.465416476678259, -0.372916717433467, 0.427637290074405, -0.823443665344793, // f 194//194 195//195 208//208 -0.502227353354359, 0.264023545633435, -0.823443533518738, -0.789177538356504, 0.400722998778123, -0.465424420506528, -0.591125036320287, 0.658755413390838, -0.465416476678259, // f 195//195 196//197 208//208 -0.789177538356504, 0.400722998778123, -0.465424420506528, -0.673680906166071, 0.739022351940225, 0, -0.591125036320287, 0.658755413390838, -0.465416476678259, // f 195//195 183//184 196//197 -0.789177538356504, 0.400722998778123, -0.465424420506528, -0.89516439351768, 0.445736142328759, 0, -0.673680906166071, 0.739022351940225, 0, // f 196//197 210//209 209//210 -0.673680906166071, 0.739022351940225, 0, -0.326187927603834, 0.822793952106354, 0.465415457696371, -0.361223327341109, 0.932479333703765, 0, // f 196//197 197//196 210//209 -0.673680906166071, 0.739022351940225, 0, -0.601407465271149, 0.649383220339146, 0.465414324938642, -0.326187927603834, 0.822793952106354, 0.465415457696371, // f 197//196 211//211 210//209 -0.601407465271149, 0.649383220339146, 0.465414324938642, -0.216564942430698, 0.524444390484491, 0.823442594841522, -0.326187927603834, 0.822793952106354, 0.465415457696371, // f 197//196 198//198 211//211 -0.601407465271149, 0.649383220339146, 0.465414324938642, -0.391409033190445, 0.410788480441844, 0.823439003857118, -0.216564942430698, 0.524444390484491, 0.823442594841522, // f 198//198 212//212 211//211 -0.391409033190445, 0.410788480441844, 0.823439003857118, -0.0576496246702162, 0.106633155437813, 0.992625755729096, -0.216564942430698, 0.524444390484491, 0.823442594841522, // f 198//198 199//199 212//212 -0.391409033190445, 0.410788480441844, 0.823439003857118, -0.092288826513591, 0.0786167040697867, 0.992623889669168, -0.0576496246702162, 0.106633155437813, 0.992625755729096, // f 199//199 213//213 212//212 -0.092288826513591, 0.0786167040697867, 0.992623889669168, 0.114506014919744, -0.335217971191843, 0.935156288722491, -0.0576496246702162, 0.106633155437813, 0.992625755729096, // f 199//199 200//200 213//213 -0.092288826513591, 0.0786167040697867, 0.992623889669168, 0.22788491958948, -0.271190474406545, 0.935159980973763, 0.114506014919744, -0.335217971191843, 0.935156288722491, // f 200//200 214//214 213//213 0.22788491958948, -0.271190474406545, 0.935159980973763, 0.260817405343863, -0.700936214102224, 0.663824302680865, 0.114506014919744, -0.335217971191843, 0.935156288722491, // f 200//200 201//201 214//214 0.22788491958948, -0.271190474406545, 0.935159980973763, 0.496422143341875, -0.559383176158847, 0.663818889329235, 0.260817405343863, -0.700936214102224, 0.663824302680865, // f 201//201 215//215 214//214 0.496422143341875, -0.559383176158847, 0.663818889329235, 0.347368251907211, -0.906568316347171, 0.23972731459386, 0.260817405343863, -0.700936214102224, 0.663824302680865, // f 201//201 202//202 215//215 0.496422143341875, -0.559383176158847, 0.663818889329235, 0.651405967231767, -0.719860960461469, 0.239729980307714, 0.347368251907211, -0.906568316347171, 0.23972731459386, // f 202//202 216//216 215//215 0.651405967231767, -0.719860960461469, 0.239729980307714, 0.354026717997172, -0.903987921266859, -0.23973093489947, 0.347368251907211, -0.906568316347171, 0.23972731459386, // f 202//202 203//203 216//216 0.651405967231767, -0.719860960461469, 0.239729980307714, 0.656690179621407, -0.7150432393474, -0.239731461957709, 0.354026717997172, -0.903987921266859, -0.23973093489947, // f 203//203 217//217 216//216 0.656690179621407, -0.7150432393474, -0.239731461957709, 0.279466649455617, -0.693707470153901, -0.663828545405156, 0.354026717997172, -0.903987921266859, -0.23973093489947, // f 203//203 204//204 217//217 0.656690179621407, -0.7150432393474, -0.239731461957709, 0.511199927686784, -0.54590094100042, -0.663827384602264, 0.279466649455617, -0.693707470153901, -0.663828545405156, // f 204//204 218//218 217//217 0.511199927686784, -0.54590094100042, -0.663827384602264, 0.141180848856854, -0.324874254443834, -0.935160246543672, 0.279466649455617, -0.693707470153901, -0.663828545405156, // f 204//204 205//205 218//218 0.511199927686784, -0.54590094100042, -0.663827384602264, 0.249004485488958, -0.251933526488782, -0.935161090100152, 0.141180848856854, -0.324874254443834, -0.935160246543672, // f 205//205 219//219 218//218 0.249004485488958, -0.251933526488782, -0.935161090100152, -0.0292372831996172, 0.117650139588595, -0.992624614809591, 0.141180848856854, -0.324874254443834, -0.935160246543672, // f 205//205 206//206 219//219 0.249004485488958, -0.251933526488782, -0.935161090100152, -0.0697655787959561, 0.0991558226261453, -0.992623235097082, -0.0292372831996172, 0.117650139588595, -0.992624614809591, // f 206//206 220//220 219//219 -0.0697655787959561, 0.0991558226261453, -0.992623235097082, -0.193248102518277, 0.533478085942623, -0.823441742136067, -0.0292372831996172, 0.117650139588595, -0.992624614809591, // f 206//206 207//207 220//220 -0.0697655787959561, 0.0991558226261453, -0.992623235097082, -0.372916717433467, 0.427637290074405, -0.823443665344793, -0.193248102518277, 0.533478085942623, -0.823441742136067, // f 207//207 221//221 220//220 -0.372916717433467, 0.427637290074405, -0.823443665344793, -0.313221781776378, 0.827812495110252, -0.465423020874742, -0.193248102518277, 0.533478085942623, -0.823441742136067, // f 207//207 208//208 221//221 -0.372916717433467, 0.427637290074405, -0.823443665344793, -0.591125036320287, 0.658755413390838, -0.465416476678259, -0.313221781776378, 0.827812495110252, -0.465423020874742, // f 208//208 209//210 221//221 -0.591125036320287, 0.658755413390838, -0.465416476678259, -0.361223327341109, 0.932479333703765, 0, -0.313221781776378, 0.827812495110252, -0.465423020874742, // f 208//208 196//197 209//210 -0.591125036320287, 0.658755413390838, -0.465416476678259, -0.673680906166071, 0.739022351940225, 0, -0.361223327341109, 0.932479333703765, 0, // f 2//4 1//1 209//210 -0.00692820035189495, 0.885062594520792, 0.465420459176439, 0, 1, 0, -0.361223327341109, 0.932479333703765, 0, // f 209//210 210//209 2//4 -0.361223327341109, 0.932479333703765, 0, -0.326187927603834, 0.822793952106354, 0.465415457696371, -0.00692820035189495, 0.885062594520792, 0.465420459176439, // f 210//209 3//6 2//4 -0.326187927603834, 0.822793952106354, 0.465415457696371, -0.01248233334374, 0.567263148900001, 0.823441990218103, -0.00692820035189495, 0.885062594520792, 0.465420459176439, // f 210//209 211//211 3//6 -0.326187927603834, 0.822793952106354, 0.465415457696371, -0.216564942430698, 0.524444390484491, 0.823442594841522, -0.01248233334374, 0.567263148900001, 0.823441990218103, // f 211//211 4//8 3//6 -0.216564942430698, 0.524444390484491, 0.823442594841522, -0.0152291366425567, 0.12027407915229, 0.992623906261174, -0.01248233334374, 0.567263148900001, 0.823441990218103, // f 211//211 212//212 4//8 -0.216564942430698, 0.524444390484491, 0.823442594841522, -0.0576496246702162, 0.106633155437813, 0.992625755729096, -0.0152291366425567, 0.12027407915229, 0.992623906261174, // f 212//212 5//10 4//8 -0.0576496246702162, 0.106633155437813, 0.992625755729096, -0.0142832337047389, -0.353928791044059, 0.935163301303589, -0.0152291366425567, 0.12027407915229, 0.992623906261174, // f 212//212 213//213 5//10 -0.0576496246702162, 0.106633155437813, 0.992625755729096, 0.114506014919744, -0.335217971191843, 0.935156288722491, -0.0142832337047389, -0.353928791044059, 0.935163301303589, // f 213//213 6//12 5//10 0.114506014919744, -0.335217971191843, 0.935156288722491, -0.00998007790708764, -0.747831837770113, 0.663813181898601, -0.0142832337047389, -0.353928791044059, 0.935163301303589, // f 213//213 214//214 6//12 0.114506014919744, -0.335217971191843, 0.935156288722491, 0.260817405343863, -0.700936214102224, 0.663824302680865, -0.00998007790708764, -0.747831837770113, 0.663813181898601, // f 214//214 7//14 6//12 0.260817405343863, -0.700936214102224, 0.663824302680865, -0.00354003737006189, -0.970834248517786, 0.239725530639363, -0.00998007790708764, -0.747831837770113, 0.663813181898601, // f 214//214 215//215 7//14 0.260817405343863, -0.700936214102224, 0.663824302680865, 0.347368251907211, -0.906568316347171, 0.23972731459386, -0.00354003737006189, -0.970834248517786, 0.239725530639363, // f 215//215 8//16 7//14 0.347368251907211, -0.906568316347171, 0.23972731459386, 0.00354003737006189, -0.970834248517786, -0.239725530639363, -0.00354003737006189, -0.970834248517786, 0.239725530639363, // f 215//215 216//216 8//16 0.347368251907211, -0.906568316347171, 0.23972731459386, 0.354026717997172, -0.903987921266859, -0.23973093489947, 0.00354003737006189, -0.970834248517786, -0.239725530639363, // f 216//216 9//18 8//16 0.354026717997172, -0.903987921266859, -0.23973093489947, 0.00998007790708764, -0.747831837770113, -0.663813181898601, 0.00354003737006189, -0.970834248517786, -0.239725530639363, // f 216//216 217//217 9//18 0.354026717997172, -0.903987921266859, -0.23973093489947, 0.279466649455617, -0.693707470153901, -0.663828545405156, 0.00998007790708764, -0.747831837770113, -0.663813181898601, // f 217//217 10//20 9//18 0.279466649455617, -0.693707470153901, -0.663828545405156, 0.0142832337047389, -0.353928791044059, -0.935163301303589, 0.00998007790708764, -0.747831837770113, -0.663813181898601, // f 217//217 218//218 10//20 0.279466649455617, -0.693707470153901, -0.663828545405156, 0.141180848856854, -0.324874254443834, -0.935160246543672, 0.0142832337047389, -0.353928791044059, -0.935163301303589, // f 218//218 11//22 10//20 0.141180848856854, -0.324874254443834, -0.935160246543672, 0.0152291366425567, 0.12027407915229, -0.992623906261174, 0.0142832337047389, -0.353928791044059, -0.935163301303589, // f 218//218 219//219 11//22 0.141180848856854, -0.324874254443834, -0.935160246543672, -0.0292372831996172, 0.117650139588595, -0.992624614809591, 0.0152291366425567, 0.12027407915229, -0.992623906261174, // f 219//219 12//24 11//22 -0.0292372831996172, 0.117650139588595, -0.992624614809591, 0.01248233334374, 0.567263148900001, -0.823441990218103, 0.0152291366425567, 0.12027407915229, -0.992623906261174, // f 219//219 220//220 12//24 -0.0292372831996172, 0.117650139588595, -0.992624614809591, -0.193248102518277, 0.533478085942623, -0.823441742136067, 0.01248233334374, 0.567263148900001, -0.823441990218103, // f 220//220 13//26 12//24 -0.193248102518277, 0.533478085942623, -0.823441742136067, 0.00692820035189495, 0.885062594520792, -0.465420459176439, 0.01248233334374, 0.567263148900001, -0.823441990218103, // f 220//220 221//221 13//26 -0.193248102518277, 0.533478085942623, -0.823441742136067, -0.313221781776378, 0.827812495110252, -0.465423020874742, 0.00692820035189495, 0.885062594520792, -0.465420459176439, // f 221//221 1//1 13//26 -0.313221781776378, 0.827812495110252, -0.465423020874742, 0, 1, 0, 0.00692820035189495, 0.885062594520792, -0.465420459176439, // f 209//210 1//1 221//221 -0.361223327341109, 0.932479333703765, 0, 0, 1, 0, -0.313221781776378, 0.827812495110252, -0.465423020874742, // f 222//222 224//222 225//222 0, -1, 0, 0, -1, 0, 0, -1, 0, // f 223//222 222//222 225//222 0, -1, 0, 0, -1, 0, 0, -1, 0, // f 226//1 227//1 229//1 0, 1, 0, 0, 1, 0, 0, 1, 0, // f 229//1 228//1 226//1 0, 1, 0, 0, 1, 0, 0, 1, 0, // f 222//223 223//223 227//223 0, 0, 1, 0, 0, 1, 0, 0, 1, // f 226//223 222//223 227//223 0, 0, 1, 0, 0, 1, 0, 0, 1, // f 223//224 225//224 229//224 1, 0, 0, 1, 0, 0, 1, 0, 0, // f 229//224 227//224 223//224 1, 0, 0, 1, 0, 0, 1, 0, 0, // f 225//225 224//225 228//225 0, 0, -1, 0, 0, -1, 0, 0, -1, // f 228//225 229//225 225//225 0, 0, -1, 0, 0, -1, 0, 0, -1, // f 224//226 222//226 226//226 -1, 0, 0, -1, 0, 0, -1, 0, 0, // f 226//226 228//226 224//226 -1, 0, 0, -1, 0, 0, -1, 0, 0, // f 230//222 232//222 233//222 0, -1, 0, 0, -1, 0, 0, -1, 0, // f 231//222 230//222 233//222 0, -1, 0, 0, -1, 0, 0, -1, 0, // f 234//1 235//1 237//1 0, 1, 0, 0, 1, 0, 0, 1, 0, // f 237//1 236//1 234//1 0, 1, 0, 0, 1, 0, 0, 1, 0, // f 230//223 231//223 235//223 0, 0, 1, 0, 0, 1, 0, 0, 1, // f 234//223 230//223 235//223 0, 0, 1, 0, 0, 1, 0, 0, 1, // f 231//224 233//224 237//224 1, 0, 0, 1, 0, 0, 1, 0, 0, // f 237//224 235//224 231//224 1, 0, 0, 1, 0, 0, 1, 0, 0, // f 233//225 232//225 236//225 0, 0, -1, 0, 0, -1, 0, 0, -1, // f 236//225 237//225 233//225 0, 0, -1, 0, 0, -1, 0, 0, -1, // f 232//226 230//226 234//226 -1, 0, 0, -1, 0, 0, -1, 0, 0, // f 234//226 236//226 232//226 -1, 0, 0, -1, 0, 0, -1, 0, 0, // f 238//222 240//227 239//228 0, -1, 0, 0.397023223750481, -0.589935219637935, -0.703099563670407, 0.797262505159876, -0.589912351682715, -0.127968414846662, // f 238//222 241//229 240//227 0, -1, 0, -0.302173796248903, -0.589911124478289, -0.748796275416276, 0.397023223750481, -0.589935219637935, -0.703099563670407, // f 238//222 242//230 241//229 0, -1, 0, -0.773843933748934, -0.589904908677296, -0.230603046203656, -0.302173796248903, -0.589911124478289, -0.748796275416276, // f 238//222 243//231 242//230 0, -1, 0, -0.66279041592285, -0.589910170993801, 0.461210206650806, -0.773843933748934, -0.589904908677296, -0.230603046203656, // f 238//222 244//232 243//231 0, -1, 0, -0.0526160017712207, -0.589914443243793, 0.805749654675679, -0.66279041592285, -0.589910170993801, 0.461210206650806, // f 238//222 245//233 244//232 0, -1, 0, 0.597135745682814, -0.589933616077777, 0.543513780735344, -0.0526160017712207, -0.589914443243793, 0.805749654675679, // f 238//222 239//228 245//233 0, -1, 0, 0.797262505159876, -0.589912351682715, -0.127968414846662, 0.597135745682814, -0.589933616077777, 0.543513780735344, // f 239//228 247//234 246//235 0.797262505159876, -0.589912351682715, -0.127968414846662, 0.597135745682814, 0.589933616077777, -0.543513780735344, 0.797262505159876, 0.589912351682715, 0.127968414846662, // f 239//228 240//227 247//234 0.797262505159876, -0.589912351682715, -0.127968414846662, 0.397023223750481, -0.589935219637935, -0.703099563670407, 0.597135745682814, 0.589933616077777, -0.543513780735344, // f 240//227 248//236 247//234 0.397023223750481, -0.589935219637935, -0.703099563670407, -0.0526160017712207, 0.589914443243793, -0.805749654675679, 0.597135745682814, 0.589933616077777, -0.543513780735344, // f 240//227 241//229 248//236 0.397023223750481, -0.589935219637935, -0.703099563670407, -0.302173796248903, -0.589911124478289, -0.748796275416276, -0.0526160017712207, 0.589914443243793, -0.805749654675679, // f 241//229 249//237 248//236 -0.302173796248903, -0.589911124478289, -0.748796275416276, -0.66279041592285, 0.589910170993801, -0.461210206650806, -0.0526160017712207, 0.589914443243793, -0.805749654675679, // f 241//229 242//230 249//237 -0.302173796248903, -0.589911124478289, -0.748796275416276, -0.773843933748934, -0.589904908677296, -0.230603046203656, -0.66279041592285, 0.589910170993801, -0.461210206650806, // f 242//230 250//238 249//237 -0.773843933748934, -0.589904908677296, -0.230603046203656, -0.773843933748934, 0.589904908677296, 0.230603046203656, -0.66279041592285, 0.589910170993801, -0.461210206650806, // f 242//230 243//231 250//238 -0.773843933748934, -0.589904908677296, -0.230603046203656, -0.66279041592285, -0.589910170993801, 0.461210206650806, -0.773843933748934, 0.589904908677296, 0.230603046203656, // f 243//231 251//239 250//238 -0.66279041592285, -0.589910170993801, 0.461210206650806, -0.302173796248903, 0.589911124478289, 0.748796275416276, -0.773843933748934, 0.589904908677296, 0.230603046203656, // f 243//231 244//232 251//239 -0.66279041592285, -0.589910170993801, 0.461210206650806, -0.0526160017712207, -0.589914443243793, 0.805749654675679, -0.302173796248903, 0.589911124478289, 0.748796275416276, // f 244//232 252//240 251//239 -0.0526160017712207, -0.589914443243793, 0.805749654675679, 0.397023223750481, 0.589935219637935, 0.703099563670407, -0.302173796248903, 0.589911124478289, 0.748796275416276, // f 244//232 245//233 252//240 -0.0526160017712207, -0.589914443243793, 0.805749654675679, 0.597135745682814, -0.589933616077777, 0.543513780735344, 0.397023223750481, 0.589935219637935, 0.703099563670407, // f 245//233 246//235 252//240 0.597135745682814, -0.589933616077777, 0.543513780735344, 0.797262505159876, 0.589912351682715, 0.127968414846662, 0.397023223750481, 0.589935219637935, 0.703099563670407, // f 245//233 239//228 246//235 0.597135745682814, -0.589933616077777, 0.543513780735344, 0.797262505159876, -0.589912351682715, -0.127968414846662, 0.797262505159876, 0.589912351682715, 0.127968414846662, // f 253//1 246//235 247//234 0, 1, 0, 0.797262505159876, 0.589912351682715, 0.127968414846662, 0.597135745682814, 0.589933616077777, -0.543513780735344, // f 253//1 247//234 248//236 0, 1, 0, 0.597135745682814, 0.589933616077777, -0.543513780735344, -0.0526160017712207, 0.589914443243793, -0.805749654675679, // f 253//1 248//236 249//237 0, 1, 0, -0.0526160017712207, 0.589914443243793, -0.805749654675679, -0.66279041592285, 0.589910170993801, -0.461210206650806, // f 253//1 249//237 250//238 0, 1, 0, -0.66279041592285, 0.589910170993801, -0.461210206650806, -0.773843933748934, 0.589904908677296, 0.230603046203656, // f 253//1 250//238 251//239 0, 1, 0, -0.773843933748934, 0.589904908677296, 0.230603046203656, -0.302173796248903, 0.589911124478289, 0.748796275416276, // f 253//1 251//239 252//240 0, 1, 0, -0.302173796248903, 0.589911124478289, 0.748796275416276, 0.397023223750481, 0.589935219637935, 0.703099563670407, // f 253//1 252//240 246//235 0, 1, 0, 0.397023223750481, 0.589935219637935, 0.703099563670407, 0.797262505159876, 0.589912351682715, 0.127968414846662, // f 254//222 256//241 255//242 0, -1, 0, 0.46626992943496, -0.663880290017325, -0.584683943196006, 0.747838797337513, -0.663880360604817, 0, // f 254//222 257//243 256//241 0, -1, 0, -0.166389118438228, -0.663877452375893, -0.729096282731055, 0.46626992943496, -0.663880290017325, -0.584683943196006, // f 254//222 258//244 257//243 0, -1, 0, -0.673772742230803, -0.663884511199172, -0.324480581262763, -0.166389118438228, -0.663877452375893, -0.729096282731055, // f 254//222 259//245 258//244 0, -1, 0, -0.673772742230803, -0.663884511199172, 0.324480581262763, -0.673772742230803, -0.663884511199172, -0.324480581262763, // f 254//222 260//246 259//245 0, -1, 0, -0.166389118438228, -0.663877452375893, 0.729096282731055, -0.673772742230803, -0.663884511199172, 0.324480581262763, // f 254//222 261//247 260//246 0, -1, 0, 0.46626992943496, -0.663880290017325, 0.584683943196006, -0.166389118438228, -0.663877452375893, 0.729096282731055, // f 254//222 255//242 261//247 0, -1, 0, 0.747838797337513, -0.663880360604817, 0, 0.46626992943496, -0.663880290017325, 0.584683943196006, // f 255//242 263//248 262//249 0.747838797337513, -0.663880360604817, 0, 0.878952476089131, 0.219737869016743, -0.423270378950343, 0.878952476089131, 0.219737869016743, 0.423270378950343, // f 255//242 256//241 263//248 0.747838797337513, -0.663880360604817, 0, 0.46626992943496, -0.663880290017325, -0.584683943196006, 0.878952476089131, 0.219737869016743, -0.423270378950343, // f 256//241 264//250 263//248 0.46626992943496, -0.663880290017325, -0.584683943196006, 0.217082698413584, 0.219737755878127, -0.951099585054647, 0.878952476089131, 0.219737869016743, -0.423270378950343, // f 256//241 257//243 264//250 0.46626992943496, -0.663880290017325, -0.584683943196006, -0.166389118438228, -0.663877452375893, -0.729096282731055, 0.217082698413584, 0.219737755878127, -0.951099585054647, // f 257//243 265//251 264//250 -0.166389118438228, -0.663877452375893, -0.729096282731055, -0.608242678770754, 0.219736135326756, -0.762729883086692, 0.217082698413584, 0.219737755878127, -0.951099585054647, // f 257//243 258//244 265//251 -0.166389118438228, -0.663877452375893, -0.729096282731055, -0.673772742230803, -0.663884511199172, -0.324480581262763, -0.608242678770754, 0.219736135326756, -0.762729883086692, // f 258//244 266//252 265//251 -0.673772742230803, -0.663884511199172, -0.324480581262763, -0.97555980497849, 0.219734082268389, 0, -0.608242678770754, 0.219736135326756, -0.762729883086692, // f 258//244 259//245 266//252 -0.673772742230803, -0.663884511199172, -0.324480581262763, -0.673772742230803, -0.663884511199172, 0.324480581262763, -0.97555980497849, 0.219734082268389, 0, // f 259//245 267//253 266//252 -0.673772742230803, -0.663884511199172, 0.324480581262763, -0.608242678770754, 0.219736135326756, 0.762729883086692, -0.97555980497849, 0.219734082268389, 0, // f 259//245 260//246 267//253 -0.673772742230803, -0.663884511199172, 0.324480581262763, -0.166389118438228, -0.663877452375893, 0.729096282731055, -0.608242678770754, 0.219736135326756, 0.762729883086692, // f 260//246 268//254 267//253 -0.166389118438228, -0.663877452375893, 0.729096282731055, 0.217082698413584, 0.219737755878127, 0.951099585054647, -0.608242678770754, 0.219736135326756, 0.762729883086692, // f 260//246 261//247 268//254 -0.166389118438228, -0.663877452375893, 0.729096282731055, 0.46626992943496, -0.663880290017325, 0.584683943196006, 0.217082698413584, 0.219737755878127, 0.951099585054647, // f 261//247 262//249 268//254 0.46626992943496, -0.663880290017325, 0.584683943196006, 0.878952476089131, 0.219737869016743, 0.423270378950343, 0.217082698413584, 0.219737755878127, 0.951099585054647, // f 261//247 255//242 262//249 0.46626992943496, -0.663880290017325, 0.584683943196006, 0.747838797337513, -0.663880360604817, 0, 0.878952476089131, 0.219737869016743, 0.423270378950343, // f 269//255 262//249 263//248 -0.00143404298083601, 0.999998971759836, 0, 0.878952476089131, 0.219737869016743, 0.423270378950343, 0.878952476089131, 0.219737869016743, -0.423270378950343, // f 269//255 263//248 264//250 -0.00143404298083601, 0.999998971759836, 0, 0.878952476089131, 0.219737869016743, -0.423270378950343, 0.217082698413584, 0.219737755878127, -0.951099585054647, // f 269//255 264//250 265//251 -0.00143404298083601, 0.999998971759836, 0, 0.217082698413584, 0.219737755878127, -0.951099585054647, -0.608242678770754, 0.219736135326756, -0.762729883086692, // f 269//255 265//251 266//252 -0.00143404298083601, 0.999998971759836, 0, -0.608242678770754, 0.219736135326756, -0.762729883086692, -0.97555980497849, 0.219734082268389, 0, // f 269//255 266//252 267//253 -0.00143404298083601, 0.999998971759836, 0, -0.97555980497849, 0.219734082268389, 0, -0.608242678770754, 0.219736135326756, 0.762729883086692, // f 269//255 267//253 268//254 -0.00143404298083601, 0.999998971759836, 0, -0.608242678770754, 0.219736135326756, 0.762729883086692, 0.217082698413584, 0.219737755878127, 0.951099585054647, // f 269//255 268//254 262//249 -0.00143404298083601, 0.999998971759836, 0, 0.217082698413584, 0.219737755878127, 0.951099585054647, 0.878952476089131, 0.219737869016743, 0.423270378950343, // f 270//1 272//240 271//235 0, 1, 0, 0.397023223750481, 0.589935219637935, 0.703099563670407, 0.797262505159876, 0.589912351682715, 0.127968414846662, // f 270//1 273//239 272//240 0, 1, 0, -0.302173796248903, 0.589911124478289, 0.748796275416276, 0.397023223750481, 0.589935219637935, 0.703099563670407, // f 270//1 274//238 273//239 0, 1, 0, -0.773843933748934, 0.589904908677296, 0.230603046203656, -0.302173796248903, 0.589911124478289, 0.748796275416276, // f 270//1 275//237 274//238 0, 1, 0, -0.66279041592285, 0.589910170993801, -0.461210206650806, -0.773843933748934, 0.589904908677296, 0.230603046203656, // f 270//1 276//256 275//237 0, 1, 0, -0.0526150395286041, 0.589934655487755, -0.805734919107983, -0.66279041592285, 0.589910170993801, -0.461210206650806, // f 270//1 277//234 276//256 0, 1, 0, 0.597135745682814, 0.589933616077777, -0.543513780735344, -0.0526150395286041, 0.589934655487755, -0.805734919107983, // f 270//1 271//235 277//234 0, 1, 0, 0.797262505159876, 0.589912351682715, 0.127968414846662, 0.597135745682814, 0.589933616077777, -0.543513780735344, // f 271//235 279//233 278//228 0.797262505159876, 0.589912351682715, 0.127968414846662, 0.597135745682814, -0.589933616077777, 0.543513780735344, 0.797262505159876, -0.589912351682715, -0.127968414846662, // f 271//235 272//240 279//233 0.797262505159876, 0.589912351682715, 0.127968414846662, 0.397023223750481, 0.589935219637935, 0.703099563670407, 0.597135745682814, -0.589933616077777, 0.543513780735344, // f 272//240 280//232 279//233 0.397023223750481, 0.589935219637935, 0.703099563670407, -0.0526160017712207, -0.589914443243793, 0.805749654675679, 0.597135745682814, -0.589933616077777, 0.543513780735344, // f 272//240 273//239 280//232 0.397023223750481, 0.589935219637935, 0.703099563670407, -0.302173796248903, 0.589911124478289, 0.748796275416276, -0.0526160017712207, -0.589914443243793, 0.805749654675679, // f 273//239 281//257 280//232 -0.302173796248903, 0.589911124478289, 0.748796275416276, -0.662778294972468, -0.589930383247647, 0.461201772150403, -0.0526160017712207, -0.589914443243793, 0.805749654675679, // f 273//239 274//238 281//257 -0.302173796248903, 0.589911124478289, 0.748796275416276, -0.773843933748934, 0.589904908677296, 0.230603046203656, -0.662778294972468, -0.589930383247647, 0.461201772150403, // f 274//238 282//230 281//257 -0.773843933748934, 0.589904908677296, 0.230603046203656, -0.773843933748934, -0.589904908677296, -0.230603046203656, -0.662778294972468, -0.589930383247647, 0.461201772150403, // f 274//238 275//237 282//230 -0.773843933748934, 0.589904908677296, 0.230603046203656, -0.66279041592285, 0.589910170993801, -0.461210206650806, -0.773843933748934, -0.589904908677296, -0.230603046203656, // f 275//237 283//258 282//230 -0.66279041592285, 0.589910170993801, -0.461210206650806, -0.302168270149939, -0.589931336729929, -0.748782581567328, -0.773843933748934, -0.589904908677296, -0.230603046203656, // f 275//237 276//256 283//258 -0.66279041592285, 0.589910170993801, -0.461210206650806, -0.0526150395286041, 0.589934655487755, -0.805734919107983, -0.302168270149939, -0.589931336729929, -0.748782581567328, // f 276//256 284//259 283//258 -0.0526150395286041, 0.589934655487755, -0.805734919107983, 0.397030484666747, -0.589915007395279, -0.703112422230696, -0.302168270149939, -0.589931336729929, -0.748782581567328, // f 276//256 277//234 284//259 -0.0526150395286041, 0.589934655487755, -0.805734919107983, 0.597135745682814, 0.589933616077777, -0.543513780735344, 0.397030484666747, -0.589915007395279, -0.703112422230696, // f 277//234 278//228 284//259 0.597135745682814, 0.589933616077777, -0.543513780735344, 0.797262505159876, -0.589912351682715, -0.127968414846662, 0.397030484666747, -0.589915007395279, -0.703112422230696, // f 277//234 271//235 278//228 0.597135745682814, 0.589933616077777, -0.543513780735344, 0.797262505159876, 0.589912351682715, 0.127968414846662, 0.797262505159876, -0.589912351682715, -0.127968414846662, // f 285//222 278//228 279//233 0, -1, 0, 0.797262505159876, -0.589912351682715, -0.127968414846662, 0.597135745682814, -0.589933616077777, 0.543513780735344, // f 285//222 279//233 280//232 0, -1, 0, 0.597135745682814, -0.589933616077777, 0.543513780735344, -0.0526160017712207, -0.589914443243793, 0.805749654675679, // f 285//222 280//232 281//257 0, -1, 0, -0.0526160017712207, -0.589914443243793, 0.805749654675679, -0.662778294972468, -0.589930383247647, 0.461201772150403, // f 285//222 281//257 282//230 0, -1, 0, -0.662778294972468, -0.589930383247647, 0.461201772150403, -0.773843933748934, -0.589904908677296, -0.230603046203656, // f 285//222 282//230 283//258 0, -1, 0, -0.773843933748934, -0.589904908677296, -0.230603046203656, -0.302168270149939, -0.589931336729929, -0.748782581567328, // f 285//222 283//258 284//259 0, -1, 0, -0.302168270149939, -0.589931336729929, -0.748782581567328, 0.397030484666747, -0.589915007395279, -0.703112422230696, // f 285//222 284//259 278//228 0, -1, 0, 0.397030484666747, -0.589915007395279, -0.703112422230696, 0.797262505159876, -0.589912351682715, -0.127968414846662, // f 286//1 288//260 287//261 0, 1, 0, 0.46626992943496, 0.663880290017325, 0.584683943196006, 0.747838797337513, 0.663880360604817, 0, // f 286//1 289//262 288//260 0, 1, 0, -0.166389118438228, 0.663877452375893, 0.729096282731055, 0.46626992943496, 0.663880290017325, 0.584683943196006, // f 286//1 290//263 289//262 0, 1, 0, -0.673772742230803, 0.663884511199172, 0.324480581262763, -0.166389118438228, 0.663877452375893, 0.729096282731055, // f 286//1 291//264 290//263 0, 1, 0, -0.673772742230803, 0.663884511199172, -0.324480581262763, -0.673772742230803, 0.663884511199172, 0.324480581262763, // f 286//1 292//265 291//264 0, 1, 0, -0.166389118438228, 0.663877452375893, -0.729096282731055, -0.673772742230803, 0.663884511199172, -0.324480581262763, // f 286//1 293//266 292//265 0, 1, 0, 0.46626992943496, 0.663880290017325, -0.584683943196006, -0.166389118438228, 0.663877452375893, -0.729096282731055, // f 286//1 287//261 293//266 0, 1, 0, 0.747838797337513, 0.663880360604817, 0, 0.46626992943496, 0.663880290017325, -0.584683943196006, // f 287//261 295//267 294//268 0.747838797337513, 0.663880360604817, 0, 0.878952476089131, -0.219737869016743, 0.423270378950343, 0.878952476089131, -0.219737869016743, -0.423270378950343, // f 287//261 288//260 295//267 0.747838797337513, 0.663880360604817, 0, 0.46626992943496, 0.663880290017325, 0.584683943196006, 0.878952476089131, -0.219737869016743, 0.423270378950343, // f 288//260 296//269 295//267 0.46626992943496, 0.663880290017325, 0.584683943196006, 0.217082698413584, -0.219737755878127, 0.951099585054647, 0.878952476089131, -0.219737869016743, 0.423270378950343, // f 288//260 289//262 296//269 0.46626992943496, 0.663880290017325, 0.584683943196006, -0.166389118438228, 0.663877452375893, 0.729096282731055, 0.217082698413584, -0.219737755878127, 0.951099585054647, // f 289//262 297//270 296//269 -0.166389118438228, 0.663877452375893, 0.729096282731055, -0.608242678770754, -0.219736135326756, 0.762729883086692, 0.217082698413584, -0.219737755878127, 0.951099585054647, // f 289//262 290//263 297//270 -0.166389118438228, 0.663877452375893, 0.729096282731055, -0.673772742230803, 0.663884511199172, 0.324480581262763, -0.608242678770754, -0.219736135326756, 0.762729883086692, // f 290//263 298//271 297//270 -0.673772742230803, 0.663884511199172, 0.324480581262763, -0.97555980497849, -0.219734082268389, 0, -0.608242678770754, -0.219736135326756, 0.762729883086692, // f 290//263 291//264 298//271 -0.673772742230803, 0.663884511199172, 0.324480581262763, -0.673772742230803, 0.663884511199172, -0.324480581262763, -0.97555980497849, -0.219734082268389, 0, // f 291//264 299//272 298//271 -0.673772742230803, 0.663884511199172, -0.324480581262763, -0.608242678770754, -0.219736135326756, -0.762729883086692, -0.97555980497849, -0.219734082268389, 0, // f 291//264 292//265 299//272 -0.673772742230803, 0.663884511199172, -0.324480581262763, -0.166389118438228, 0.663877452375893, -0.729096282731055, -0.608242678770754, -0.219736135326756, -0.762729883086692, // f 292//265 300//273 299//272 -0.166389118438228, 0.663877452375893, -0.729096282731055, 0.217082698413584, -0.219737755878127, -0.951099585054647, -0.608242678770754, -0.219736135326756, -0.762729883086692, // f 292//265 293//266 300//273 -0.166389118438228, 0.663877452375893, -0.729096282731055, 0.46626992943496, 0.663880290017325, -0.584683943196006, 0.217082698413584, -0.219737755878127, -0.951099585054647, // f 293//266 294//268 300//273 0.46626992943496, 0.663880290017325, -0.584683943196006, 0.878952476089131, -0.219737869016743, -0.423270378950343, 0.217082698413584, -0.219737755878127, -0.951099585054647, // f 293//266 287//261 294//268 0.46626992943496, 0.663880290017325, -0.584683943196006, 0.747838797337513, 0.663880360604817, 0, 0.878952476089131, -0.219737869016743, -0.423270378950343, // f 301//274 294//268 295//267 -0.00143404298083601, -0.999998971759836, 0, 0.878952476089131, -0.219737869016743, -0.423270378950343, 0.878952476089131, -0.219737869016743, 0.423270378950343, // f 301//274 295//267 296//269 -0.00143404298083601, -0.999998971759836, 0, 0.878952476089131, -0.219737869016743, 0.423270378950343, 0.217082698413584, -0.219737755878127, 0.951099585054647, // f 301//274 296//269 297//270 -0.00143404298083601, -0.999998971759836, 0, 0.217082698413584, -0.219737755878127, 0.951099585054647, -0.608242678770754, -0.219736135326756, 0.762729883086692, // f 301//274 297//270 298//271 -0.00143404298083601, -0.999998971759836, 0, -0.608242678770754, -0.219736135326756, 0.762729883086692, -0.97555980497849, -0.219734082268389, 0, // f 301//274 298//271 299//272 -0.00143404298083601, -0.999998971759836, 0, -0.97555980497849, -0.219734082268389, 0, -0.608242678770754, -0.219736135326756, -0.762729883086692, // f 301//274 299//272 300//273 -0.00143404298083601, -0.999998971759836, 0, -0.608242678770754, -0.219736135326756, -0.762729883086692, 0.217082698413584, -0.219737755878127, -0.951099585054647, // f 301//274 300//273 294//268 -0.00143404298083601, -0.999998971759836, 0, 0.217082698413584, -0.219737755878127, -0.951099585054647, 0.878952476089131, -0.219737869016743, -0.423270378950343, // f 302//275 304//276 303//277 0, -0.000336010397354616, 0.999999943548505, -0.70311192220371, -0.39721320932102, 0.58979258319845, -0.127967258163307, -0.797469304297079, 0.589633012595207, // f 302//275 305//278 304//276 0, -0.000336010397354616, 0.999999943548505, -0.748790783397803, 0.301957574598098, 0.590028800857499, -0.70311192220371, -0.39721320932102, 0.58979258319845, // f 302//275 306//279 305//278 0, -0.000336010397354616, 0.999999943548505, -0.230603632967358, 0.773632897572442, 0.590181416393234, -0.748790783397803, 0.301957574598098, 0.590028800857499, // f 302//275 307//280 306//279 0, -0.000336010397354616, 0.999999943548505, 0.461208907766594, 0.662575543376592, 0.590152516487017, -0.230603632967358, 0.773632897572442, 0.590181416393234, // f 302//275 308//281 307//280 0, -0.000336010397354616, 0.999999943548505, 0.805742663941522, 0.0524325398968101, 0.589940326019834, 0.461208907766594, 0.662575543376592, 0.590152516487017, // f 302//275 309//282 308//281 0, -0.000336010397354616, 0.999999943548505, 0.543512918136938, -0.597348801493642, 0.589718676296063, 0.805742663941522, 0.0524325398968101, 0.589940326019834, // f 302//275 303//277 309//282 0, -0.000336010397354616, 0.999999943548505, -0.127967258163307, -0.797469304297079, 0.589633012595207, 0.543512918136938, -0.597348801493642, 0.589718676296063, // f 303//277 311//283 310//284 -0.127967258163307, -0.797469304297079, 0.589633012595207, -0.543524212683583, -0.596934198904484, -0.590127945792227, 0.127967214669843, -0.797041022501427, -0.590211826736403, // f 303//277 304//276 311//283 -0.127967258163307, -0.797469304297079, 0.589633012595207, -0.70311192220371, -0.39721320932102, 0.58979258319845, -0.543524212683583, -0.596934198904484, -0.590127945792227, // f 304//276 312//285 311//283 -0.70311192220371, -0.39721320932102, 0.58979258319845, -0.805740563433302, 0.0528294138341711, -0.589907787261809, -0.543524212683583, -0.596934198904484, -0.590127945792227, // f 304//276 305//278 312//285 -0.70311192220371, -0.39721320932102, 0.58979258319845, -0.748790783397803, 0.301957574598098, 0.590028800857499, -0.805740563433302, 0.0528294138341711, -0.589907787261809, // f 305//278 313//286 312//285 -0.748790783397803, 0.301957574598098, 0.590028800857499, -0.461211893734182, 0.662976846717342, -0.589699321514668, -0.805740563433302, 0.0528294138341711, -0.589907787261809, // f 305//278 306//279 313//286 -0.748790783397803, 0.301957574598098, 0.590028800857499, -0.230603632967358, 0.773632897572442, 0.590181416393234, -0.461211893734182, 0.662976846717342, -0.589699321514668, // f 306//279 314//287 313//286 -0.230603632967358, 0.773632897572442, 0.590181416393234, 0.230603571264176, 0.774028700136969, -0.589662245937861, -0.461211893734182, 0.662976846717342, -0.589699321514668, // f 306//279 307//280 314//287 -0.230603632967358, 0.773632897572442, 0.590181416393234, 0.461208907766594, 0.662575543376592, 0.590152516487017, 0.230603571264176, 0.774028700136969, -0.589662245937861, // f 307//280 315//288 314//287 0.461208907766594, 0.662575543376592, 0.590152516487017, 0.748788257225413, 0.302383565164094, -0.589813805670893, 0.230603571264176, 0.774028700136969, -0.589662245937861, // f 307//280 308//281 315//288 0.461208907766594, 0.662575543376592, 0.590152516487017, 0.805742663941522, 0.0524325398968101, 0.589940326019834, 0.748788257225413, 0.302383565164094, -0.589813805670893, // f 308//281 316//289 315//288 0.805742663941522, 0.0524325398968101, 0.589940326019834, 0.703108397567844, -0.396815204949211, -0.590064635773653, 0.748788257225413, 0.302383565164094, -0.589813805670893, // f 308//281 309//282 316//289 0.805742663941522, 0.0524325398968101, 0.589940326019834, 0.543512918136938, -0.597348801493642, 0.589718676296063, 0.703108397567844, -0.396815204949211, -0.590064635773653, // f 309//282 310//284 316//289 0.543512918136938, -0.597348801493642, 0.589718676296063, 0.127967214669843, -0.797041022501427, -0.590211826736403, 0.703108397567844, -0.396815204949211, -0.590064635773653, // f 309//282 303//277 310//284 0.543512918136938, -0.597348801493642, 0.589718676296063, -0.127967258163307, -0.797469304297079, 0.589633012595207, 0.127967214669843, -0.797041022501427, -0.590211826736403, // f 317//290 310//284 311//283 0, 0.000336010397354616, -0.999999943548505, 0.127967214669843, -0.797041022501427, -0.590211826736403, -0.543524212683583, -0.596934198904484, -0.590127945792227, // f 317//290 311//283 312//285 0, 0.000336010397354616, -0.999999943548505, -0.543524212683583, -0.596934198904484, -0.590127945792227, -0.805740563433302, 0.0528294138341711, -0.589907787261809, // f 317//290 312//285 313//286 0, 0.000336010397354616, -0.999999943548505, -0.805740563433302, 0.0528294138341711, -0.589907787261809, -0.461211893734182, 0.662976846717342, -0.589699321514668, // f 317//290 313//286 314//287 0, 0.000336010397354616, -0.999999943548505, -0.461211893734182, 0.662976846717342, -0.589699321514668, 0.230603571264176, 0.774028700136969, -0.589662245937861, // f 317//290 314//287 315//288 0, 0.000336010397354616, -0.999999943548505, 0.230603571264176, 0.774028700136969, -0.589662245937861, 0.748788257225413, 0.302383565164094, -0.589813805670893, // f 317//290 315//288 316//289 0, 0.000336010397354616, -0.999999943548505, 0.748788257225413, 0.302383565164094, -0.589813805670893, 0.703108397567844, -0.396815204949211, -0.590064635773653, // f 317//290 316//289 310//284 0, 0.000336010397354616, -0.999999943548505, 0.703108397567844, -0.396815204949211, -0.590064635773653, 0.127967214669843, -0.797041022501427, -0.590211826736403, // f 318//275 320//291 319//292 0, -0.000336010397354616, 0.999999943548505, -0.58469688592341, -0.466493259254084, 0.663711978694048, 0, -0.748082821600103, 0.663605373717565, // f 318//275 321//293 320//291 0, -0.000336010397354616, 0.999999943548505, -0.729092699923919, 0.16617429912268, 0.663935190533486, -0.58469688592341, -0.466493259254084, 0.663711978694048, // f 318//275 322//294 321//293 0, -0.000336010397354616, 0.999999943548505, -0.324481034484485, 0.673560678055856, 0.664099443785955, -0.729092699923919, 0.16617429912268, 0.663935190533486, // f 318//275 323//295 322//294 0, -0.000336010397354616, 0.999999943548505, 0.324481034484485, 0.673560678055856, 0.664099443785955, -0.324481034484485, 0.673560678055856, 0.664099443785955, // f 318//275 324//296 323//295 0, -0.000336010397354616, 0.999999943548505, 0.729092699923919, 0.16617429912268, 0.663935190533486, 0.324481034484485, 0.673560678055856, 0.664099443785955, // f 318//275 325//297 324//296 0, -0.000336010397354616, 0.999999943548505, 0.58469688592341, -0.466493259254084, 0.663711978694048, 0.729092699923919, 0.16617429912268, 0.663935190533486, // f 318//275 319//292 325//297 0, -0.000336010397354616, 0.999999943548505, 0, -0.748082821600103, 0.663605373717565, 0.58469688592341, -0.466493259254084, 0.663711978694048, // f 319//292 327//298 326//299 0, -0.748082821600103, 0.663605373717565, -0.423264684969181, -0.878879651581966, -0.220039915681456, 0.423264684969181, -0.878879651581966, -0.220039915681456, // f 319//292 320//291 327//298 0, -0.748082821600103, 0.663605373717565, -0.58469688592341, -0.466493259254084, 0.663711978694048, -0.423264684969181, -0.878879651581966, -0.220039915681456, // f 320//291 328//300 327//298 -0.58469688592341, -0.466493259254084, 0.663711978694048, -0.951105619514274, -0.216993073195333, -0.21980015175976, -0.423264684969181, -0.878879651581966, -0.220039915681456, // f 320//291 321//293 328//300 -0.58469688592341, -0.466493259254084, 0.663711978694048, -0.729092699923919, 0.16617429912268, 0.663935190533486, -0.951105619514274, -0.216993073195333, -0.21980015175976, // f 321//293 329//301 328//300 -0.729092699923919, 0.16617429912268, 0.663935190533486, -0.762723344108516, 0.608328464748896, -0.219521250288378, -0.951105619514274, -0.216993073195333, -0.21980015175976, // f 321//293 322//294 329//301 -0.729092699923919, 0.16617429912268, 0.663935190533486, -0.324481034484485, 0.673560678055856, 0.664099443785955, -0.762723344108516, 0.608328464748896, -0.219521250288378, // f 322//294 330//302 329//301 -0.324481034484485, 0.673560678055856, 0.664099443785955, 0, 0.975634507054791, -0.219402161894441, -0.762723344108516, 0.608328464748896, -0.219521250288378, // f 322//294 323//295 330//302 -0.324481034484485, 0.673560678055856, 0.664099443785955, 0.324481034484485, 0.673560678055856, 0.664099443785955, 0, 0.975634507054791, -0.219402161894441, // f 323//295 331//303 330//302 0.324481034484485, 0.673560678055856, 0.664099443785955, 0.762723344108516, 0.608328464748896, -0.219521250288378, 0, 0.975634507054791, -0.219402161894441, // f 323//295 324//296 331//303 0.324481034484485, 0.673560678055856, 0.664099443785955, 0.729092699923919, 0.16617429912268, 0.663935190533486, 0.762723344108516, 0.608328464748896, -0.219521250288378, // f 324//296 332//304 331//303 0.729092699923919, 0.16617429912268, 0.663935190533486, 0.951105619514274, -0.216993073195333, -0.21980015175976, 0.762723344108516, 0.608328464748896, -0.219521250288378, // f 324//296 325//297 332//304 0.729092699923919, 0.16617429912268, 0.663935190533486, 0.58469688592341, -0.466493259254084, 0.663711978694048, 0.951105619514274, -0.216993073195333, -0.21980015175976, // f 325//297 326//299 332//304 0.58469688592341, -0.466493259254084, 0.663711978694048, 0.423264684969181, -0.878879651581966, -0.220039915681456, 0.951105619514274, -0.216993073195333, -0.21980015175976, // f 325//297 319//292 326//299 0.58469688592341, -0.466493259254084, 0.663711978694048, 0, -0.748082821600103, 0.663605373717565, 0.423264684969181, -0.878879651581966, -0.220039915681456, // f 333//305 326//299 327//298 0, 0.00180105291160356, -0.99999837810289, 0.423264684969181, -0.878879651581966, -0.220039915681456, -0.423264684969181, -0.878879651581966, -0.220039915681456, // f 333//305 327//298 328//300 0, 0.00180105291160356, -0.99999837810289, -0.423264684969181, -0.878879651581966, -0.220039915681456, -0.951105619514274, -0.216993073195333, -0.21980015175976, // f 333//305 328//300 329//301 0, 0.00180105291160356, -0.99999837810289, -0.951105619514274, -0.216993073195333, -0.21980015175976, -0.762723344108516, 0.608328464748896, -0.219521250288378, // f 333//305 329//301 330//302 0, 0.00180105291160356, -0.99999837810289, -0.762723344108516, 0.608328464748896, -0.219521250288378, 0, 0.975634507054791, -0.219402161894441, // f 333//305 330//302 331//303 0, 0.00180105291160356, -0.99999837810289, 0, 0.975634507054791, -0.219402161894441, 0.762723344108516, 0.608328464748896, -0.219521250288378, // f 333//305 331//303 332//304 0, 0.00180105291160356, -0.99999837810289, 0.762723344108516, 0.608328464748896, -0.219521250288378, 0.951105619514274, -0.216993073195333, -0.21980015175976, // f 333//305 332//304 326//299 0, 0.00180105291160356, -0.99999837810289, 0.951105619514274, -0.216993073195333, -0.21980015175976, 0.423264684969181, -0.878879651581966, -0.220039915681456, // f 334//225 336//306 335//307 0, 0, -1, 0.703099563670407, -0.397023223750481, -0.589935219637935, 0.127968414846662, -0.797262505159876, -0.589912351682715, // f 334//225 337//308 336//306 0, 0, -1, 0.748796275416276, 0.302173796248903, -0.589911124478289, 0.703099563670407, -0.397023223750481, -0.589935219637935, // f 334//225 338//309 337//308 0, 0, -1, 0.230598829066312, 0.773829782131228, -0.589925120943312, 0.748796275416276, 0.302173796248903, -0.589911124478289, // f 334//225 339//310 338//309 0, 0, -1, -0.461210206650806, 0.66279041592285, -0.589910170993801, 0.230598829066312, 0.773829782131228, -0.589925120943312, // f 334//225 340//311 339//310 0, 0, -1, -0.805734919107983, 0.0526150395286041, -0.589934655487755, -0.461210206650806, 0.66279041592285, -0.589910170993801, // f 334//225 341//312 340//311 0, 0, -1, -0.543523720674271, -0.597146666275913, -0.58991340383141, -0.805734919107983, 0.0526150395286041, -0.589934655487755, // f 334//225 335//307 341//312 0, 0, -1, 0.127968414846662, -0.797262505159876, -0.589912351682715, -0.543523720674271, -0.597146666275913, -0.58991340383141, // f 335//307 343//313 342//314 0.127968414846662, -0.797262505159876, -0.589912351682715, 0.543513780735344, -0.597135745682814, 0.589933616077777, -0.127968414846662, -0.797262505159876, 0.589912351682715, // f 335//307 336//306 343//313 0.127968414846662, -0.797262505159876, -0.589912351682715, 0.703099563670407, -0.397023223750481, -0.589935219637935, 0.543513780735344, -0.597135745682814, 0.589933616077777, // f 336//306 344//315 343//313 0.703099563670407, -0.397023223750481, -0.589935219637935, 0.805749654675679, 0.0526160017712207, 0.589914443243793, 0.543513780735344, -0.597135745682814, 0.589933616077777, // f 336//306 337//308 344//315 0.703099563670407, -0.397023223750481, -0.589935219637935, 0.748796275416276, 0.302173796248903, -0.589911124478289, 0.805749654675679, 0.0526160017712207, 0.589914443243793, // f 337//308 345//316 344//315 0.748796275416276, 0.302173796248903, -0.589911124478289, 0.461210206650806, 0.66279041592285, 0.589910170993801, 0.805749654675679, 0.0526160017712207, 0.589914443243793, // f 337//308 338//309 345//316 0.748796275416276, 0.302173796248903, -0.589911124478289, 0.230598829066312, 0.773829782131228, -0.589925120943312, 0.461210206650806, 0.66279041592285, 0.589910170993801, // f 338//309 346//317 345//316 0.230598829066312, 0.773829782131228, -0.589925120943312, -0.230603046203656, 0.773843933748934, 0.589904908677296, 0.461210206650806, 0.66279041592285, 0.589910170993801, // f 338//309 339//310 346//317 0.230598829066312, 0.773829782131228, -0.589925120943312, -0.461210206650806, 0.66279041592285, -0.589910170993801, -0.230603046203656, 0.773843933748934, 0.589904908677296, // f 339//310 347//318 346//317 -0.461210206650806, 0.66279041592285, -0.589910170993801, -0.748782581567328, 0.302168270149939, 0.589931336729929, -0.230603046203656, 0.773843933748934, 0.589904908677296, // f 339//310 340//311 347//318 -0.461210206650806, 0.66279041592285, -0.589910170993801, -0.805734919107983, 0.0526150395286041, -0.589934655487755, -0.748782581567328, 0.302168270149939, 0.589931336729929, // f 340//311 348//319 347//318 -0.805734919107983, 0.0526150395286041, -0.589934655487755, -0.703099563670407, -0.397023223750481, 0.589935219637935, -0.748782581567328, 0.302168270149939, 0.589931336729929, // f 340//311 341//312 348//319 -0.805734919107983, 0.0526150395286041, -0.589934655487755, -0.543523720674271, -0.597146666275913, -0.58991340383141, -0.703099563670407, -0.397023223750481, 0.589935219637935, // f 341//312 342//314 348//319 -0.543523720674271, -0.597146666275913, -0.58991340383141, -0.127968414846662, -0.797262505159876, 0.589912351682715, -0.703099563670407, -0.397023223750481, 0.589935219637935, // f 341//312 335//307 342//314 -0.543523720674271, -0.597146666275913, -0.58991340383141, 0.127968414846662, -0.797262505159876, -0.589912351682715, -0.127968414846662, -0.797262505159876, 0.589912351682715, // f 349//223 342//314 343//313 0, 0, 1, -0.127968414846662, -0.797262505159876, 0.589912351682715, 0.543513780735344, -0.597135745682814, 0.589933616077777, // f 349//223 343//313 344//315 0, 0, 1, 0.543513780735344, -0.597135745682814, 0.589933616077777, 0.805749654675679, 0.0526160017712207, 0.589914443243793, // f 349//223 344//315 345//316 0, 0, 1, 0.805749654675679, 0.0526160017712207, 0.589914443243793, 0.461210206650806, 0.66279041592285, 0.589910170993801, // f 349//223 345//316 346//317 0, 0, 1, 0.461210206650806, 0.66279041592285, 0.589910170993801, -0.230603046203656, 0.773843933748934, 0.589904908677296, // f 349//223 346//317 347//318 0, 0, 1, -0.230603046203656, 0.773843933748934, 0.589904908677296, -0.748782581567328, 0.302168270149939, 0.589931336729929, // f 349//223 347//318 348//319 0, 0, 1, -0.748782581567328, 0.302168270149939, 0.589931336729929, -0.703099563670407, -0.397023223750481, 0.589935219637935, // f 349//223 348//319 342//314 0, 0, 1, -0.703099563670407, -0.397023223750481, 0.589935219637935, -0.127968414846662, -0.797262505159876, 0.589912351682715, // f 350//225 352//320 351//321 0, 0, -1, 0.584683943196006, -0.46626992943496, -0.663880290017325, 0, -0.747838797337513, -0.663880360604817, // f 350//225 353//322 352//320 0, 0, -1, 0.729096282731055, 0.166389118438228, -0.663877452375893, 0.584683943196006, -0.46626992943496, -0.663880290017325, // f 350//225 354//323 353//322 0, 0, -1, 0.324480581262763, 0.673772742230803, -0.663884511199172, 0.729096282731055, 0.166389118438228, -0.663877452375893, // f 350//225 355//324 354//323 0, 0, -1, -0.324480581262763, 0.673772742230803, -0.663884511199172, 0.324480581262763, 0.673772742230803, -0.663884511199172, // f 350//225 356//325 355//324 0, 0, -1, -0.729096282731055, 0.166389118438228, -0.663877452375893, -0.324480581262763, 0.673772742230803, -0.663884511199172, // f 350//225 357//326 356//325 0, 0, -1, -0.584683943196006, -0.46626992943496, -0.663880290017325, -0.729096282731055, 0.166389118438228, -0.663877452375893, // f 350//225 351//321 357//326 0, 0, -1, 0, -0.747838797337513, -0.663880360604817, -0.584683943196006, -0.46626992943496, -0.663880290017325, // f 351//321 359//327 358//328 0, -0.747838797337513, -0.663880360604817, 0.423270378950343, -0.878952476089131, 0.219737869016743, -0.423270378950343, -0.878952476089131, 0.219737869016743, // f 351//321 352//320 359//327 0, -0.747838797337513, -0.663880360604817, 0.584683943196006, -0.46626992943496, -0.663880290017325, 0.423270378950343, -0.878952476089131, 0.219737869016743, // f 352//320 360//329 359//327 0.584683943196006, -0.46626992943496, -0.663880290017325, 0.951099585054647, -0.217082698413584, 0.219737755878127, 0.423270378950343, -0.878952476089131, 0.219737869016743, // f 352//320 353//322 360//329 0.584683943196006, -0.46626992943496, -0.663880290017325, 0.729096282731055, 0.166389118438228, -0.663877452375893, 0.951099585054647, -0.217082698413584, 0.219737755878127, // f 353//322 361//330 360//329 0.729096282731055, 0.166389118438228, -0.663877452375893, 0.762729883086692, 0.608242678770754, 0.219736135326756, 0.951099585054647, -0.217082698413584, 0.219737755878127, // f 353//322 354//323 361//330 0.729096282731055, 0.166389118438228, -0.663877452375893, 0.324480581262763, 0.673772742230803, -0.663884511199172, 0.762729883086692, 0.608242678770754, 0.219736135326756, // f 354//323 362//331 361//330 0.324480581262763, 0.673772742230803, -0.663884511199172, 0, 0.97555980497849, 0.219734082268389, 0.762729883086692, 0.608242678770754, 0.219736135326756, // f 354//323 355//324 362//331 0.324480581262763, 0.673772742230803, -0.663884511199172, -0.324480581262763, 0.673772742230803, -0.663884511199172, 0, 0.97555980497849, 0.219734082268389, // f 355//324 363//332 362//331 -0.324480581262763, 0.673772742230803, -0.663884511199172, -0.762729883086692, 0.608242678770754, 0.219736135326756, 0, 0.97555980497849, 0.219734082268389, // f 355//324 356//325 363//332 -0.324480581262763, 0.673772742230803, -0.663884511199172, -0.729096282731055, 0.166389118438228, -0.663877452375893, -0.762729883086692, 0.608242678770754, 0.219736135326756, // f 356//325 364//333 363//332 -0.729096282731055, 0.166389118438228, -0.663877452375893, -0.951099585054647, -0.217082698413584, 0.219737755878127, -0.762729883086692, 0.608242678770754, 0.219736135326756, // f 356//325 357//326 364//333 -0.729096282731055, 0.166389118438228, -0.663877452375893, -0.584683943196006, -0.46626992943496, -0.663880290017325, -0.951099585054647, -0.217082698413584, 0.219737755878127, // f 357//326 358//328 364//333 -0.584683943196006, -0.46626992943496, -0.663880290017325, -0.423270378950343, -0.878952476089131, 0.219737869016743, -0.951099585054647, -0.217082698413584, 0.219737755878127, // f 357//326 351//321 358//328 -0.584683943196006, -0.46626992943496, -0.663880290017325, 0, -0.747838797337513, -0.663880360604817, -0.423270378950343, -0.878952476089131, 0.219737869016743, // f 365//334 358//328 359//327 0, 0.00143404298083601, 0.999998971759836, -0.423270378950343, -0.878952476089131, 0.219737869016743, 0.423270378950343, -0.878952476089131, 0.219737869016743, // f 365//334 359//327 360//329 0, 0.00143404298083601, 0.999998971759836, 0.423270378950343, -0.878952476089131, 0.219737869016743, 0.951099585054647, -0.217082698413584, 0.219737755878127, // f 365//334 360//329 361//330 0, 0.00143404298083601, 0.999998971759836, 0.951099585054647, -0.217082698413584, 0.219737755878127, 0.762729883086692, 0.608242678770754, 0.219736135326756, // f 365//334 361//330 362//331 0, 0.00143404298083601, 0.999998971759836, 0.762729883086692, 0.608242678770754, 0.219736135326756, 0, 0.97555980497849, 0.219734082268389, // f 365//334 362//331 363//332 0, 0.00143404298083601, 0.999998971759836, 0, 0.97555980497849, 0.219734082268389, -0.762729883086692, 0.608242678770754, 0.219736135326756, // f 365//334 363//332 364//333 0, 0.00143404298083601, 0.999998971759836, -0.762729883086692, 0.608242678770754, 0.219736135326756, -0.951099585054647, -0.217082698413584, 0.219737755878127, // f 365//334 364//333 358//328 0, 0.00143404298083601, 0.999998971759836, -0.951099585054647, -0.217082698413584, 0.219737755878127, -0.423270378950343, -0.878952476089131, 0.219737869016743, // f 366//335 368//336 367//337 -0.999999943548505, -0.000336010397354616, 0, -0.58979258319845, -0.39721320932102, -0.70311192220371, -0.589633012595207, -0.797469304297079, -0.127967258163307, // f 366//335 369//338 368//336 -0.999999943548505, -0.000336010397354616, 0, -0.590028800857499, 0.301957574598098, -0.748790783397803, -0.58979258319845, -0.39721320932102, -0.70311192220371, // f 366//335 370//339 369//338 -0.999999943548505, -0.000336010397354616, 0, -0.590181416393234, 0.773632897572442, -0.230603632967358, -0.590028800857499, 0.301957574598098, -0.748790783397803, // f 366//335 371//340 370//339 -0.999999943548505, -0.000336010397354616, 0, -0.590152516487017, 0.662575543376592, 0.461208907766594, -0.590181416393234, 0.773632897572442, -0.230603632967358, // f 366//335 372//341 371//340 -0.999999943548505, -0.000336010397354616, 0, -0.589941284661011, 0.0524016241377891, 0.805743973257162, -0.590152516487017, 0.662575543376592, 0.461208907766594, // f 366//335 373//342 372//341 -0.999999943548505, -0.000336010397354616, 0, -0.589718676296063, -0.597348801493642, 0.543512918136938, -0.589941284661011, 0.0524016241377891, 0.805743973257162, // f 366//335 367//337 373//342 -0.999999943548505, -0.000336010397354616, 0, -0.589633012595207, -0.797469304297079, -0.127967258163307, -0.589718676296063, -0.597348801493642, 0.543512918136938, // f 367//337 375//343 374//344 -0.589633012595207, -0.797469304297079, -0.127967258163307, 0.590127945792227, -0.596934198904484, -0.543524212683583, 0.590211826736403, -0.797041022501427, 0.127967214669843, // f 367//337 368//336 375//343 -0.589633012595207, -0.797469304297079, -0.127967258163307, -0.58979258319845, -0.39721320932102, -0.70311192220371, 0.590127945792227, -0.596934198904484, -0.543524212683583, // f 368//336 376//345 375//343 -0.58979258319845, -0.39721320932102, -0.70311192220371, 0.589907787261809, 0.0528294138341711, -0.805740563433302, 0.590127945792227, -0.596934198904484, -0.543524212683583, // f 368//336 369//338 376//345 -0.58979258319845, -0.39721320932102, -0.70311192220371, -0.590028800857499, 0.301957574598098, -0.748790783397803, 0.589907787261809, 0.0528294138341711, -0.805740563433302, // f 369//338 377//346 376//345 -0.590028800857499, 0.301957574598098, -0.748790783397803, 0.589699321514668, 0.662976846717342, -0.461211893734182, 0.589907787261809, 0.0528294138341711, -0.805740563433302, // f 369//338 370//339 377//346 -0.590028800857499, 0.301957574598098, -0.748790783397803, -0.590181416393234, 0.773632897572442, -0.230603632967358, 0.589699321514668, 0.662976846717342, -0.461211893734182, // f 370//339 378//347 377//346 -0.590181416393234, 0.773632897572442, -0.230603632967358, 0.589662245937861, 0.774028700136969, 0.230603571264176, 0.589699321514668, 0.662976846717342, -0.461211893734182, // f 370//339 371//340 378//347 -0.590181416393234, 0.773632897572442, -0.230603632967358, -0.590152516487017, 0.662575543376592, 0.461208907766594, 0.589662245937861, 0.774028700136969, 0.230603571264176, // f 371//340 379//348 378//347 -0.590152516487017, 0.662575543376592, 0.461208907766594, 0.589813805670893, 0.302383565164094, 0.748788257225413, 0.589662245937861, 0.774028700136969, 0.230603571264176, // f 371//340 372//341 379//348 -0.590152516487017, 0.662575543376592, 0.461208907766594, -0.589941284661011, 0.0524016241377891, 0.805743973257162, 0.589813805670893, 0.302383565164094, 0.748788257225413, // f 372//341 380//349 379//348 -0.589941284661011, 0.0524016241377891, 0.805743973257162, 0.590064635773653, -0.396815204949211, 0.703108397567844, 0.589813805670893, 0.302383565164094, 0.748788257225413, // f 372//341 373//342 380//349 -0.589941284661011, 0.0524016241377891, 0.805743973257162, -0.589718676296063, -0.597348801493642, 0.543512918136938, 0.590064635773653, -0.396815204949211, 0.703108397567844, // f 373//342 374//344 380//349 -0.589718676296063, -0.597348801493642, 0.543512918136938, 0.590211826736403, -0.797041022501427, 0.127967214669843, 0.590064635773653, -0.396815204949211, 0.703108397567844, // f 373//342 367//337 374//344 -0.589718676296063, -0.597348801493642, 0.543512918136938, -0.589633012595207, -0.797469304297079, -0.127967258163307, 0.590211826736403, -0.797041022501427, 0.127967214669843, // f 381//350 374//344 375//343 0.999999943548505, 0.000336010397354616, 0, 0.590211826736403, -0.797041022501427, 0.127967214669843, 0.590127945792227, -0.596934198904484, -0.543524212683583, // f 381//350 375//343 376//345 0.999999943548505, 0.000336010397354616, 0, 0.590127945792227, -0.596934198904484, -0.543524212683583, 0.589907787261809, 0.0528294138341711, -0.805740563433302, // f 381//350 376//345 377//346 0.999999943548505, 0.000336010397354616, 0, 0.589907787261809, 0.0528294138341711, -0.805740563433302, 0.589699321514668, 0.662976846717342, -0.461211893734182, // f 381//350 377//346 378//347 0.999999943548505, 0.000336010397354616, 0, 0.589699321514668, 0.662976846717342, -0.461211893734182, 0.589662245937861, 0.774028700136969, 0.230603571264176, // f 381//350 378//347 379//348 0.999999943548505, 0.000336010397354616, 0, 0.589662245937861, 0.774028700136969, 0.230603571264176, 0.589813805670893, 0.302383565164094, 0.748788257225413, // f 381//350 379//348 380//349 0.999999943548505, 0.000336010397354616, 0, 0.589813805670893, 0.302383565164094, 0.748788257225413, 0.590064635773653, -0.396815204949211, 0.703108397567844, // f 381//350 380//349 374//344 0.999999943548505, 0.000336010397354616, 0, 0.590064635773653, -0.396815204949211, 0.703108397567844, 0.590211826736403, -0.797041022501427, 0.127967214669843, // f 382//335 384//351 383//352 -0.999999943548505, -0.000336010397354616, 0, -0.663711978694048, -0.466493259254084, -0.58469688592341, -0.663605373717565, -0.748082821600103, 0, // f 382//335 385//353 384//351 -0.999999943548505, -0.000336010397354616, 0, -0.663935190533486, 0.16617429912268, -0.729092699923919, -0.663711978694048, -0.466493259254084, -0.58469688592341, // f 382//335 386//354 385//353 -0.999999943548505, -0.000336010397354616, 0, -0.664099443785955, 0.673560678055856, -0.324481034484485, -0.663935190533486, 0.16617429912268, -0.729092699923919, // f 382//335 387//355 386//354 -0.999999943548505, -0.000336010397354616, 0, -0.664099443785955, 0.673560678055856, 0.324481034484485, -0.664099443785955, 0.673560678055856, -0.324481034484485, // f 382//335 388//356 387//355 -0.999999943548505, -0.000336010397354616, 0, -0.663935190533486, 0.16617429912268, 0.729092699923919, -0.664099443785955, 0.673560678055856, 0.324481034484485, // f 382//335 389//357 388//356 -0.999999943548505, -0.000336010397354616, 0, -0.663711978694048, -0.466493259254084, 0.58469688592341, -0.663935190533486, 0.16617429912268, 0.729092699923919, // f 382//335 383//352 389//357 -0.999999943548505, -0.000336010397354616, 0, -0.663605373717565, -0.748082821600103, 0, -0.663711978694048, -0.466493259254084, 0.58469688592341, // f 383//352 391//358 390//359 -0.663605373717565, -0.748082821600103, 0, 0.220045717520539, -0.878872824135764, -0.423275845278819, 0.220045717520539, -0.878872824135764, 0.423275845278819, // f 383//352 384//351 391//358 -0.663605373717565, -0.748082821600103, 0, -0.663711978694048, -0.466493259254084, -0.58469688592341, 0.220045717520539, -0.878872824135764, -0.423275845278819, // f 384//351 392//360 391//358 -0.663711978694048, -0.466493259254084, -0.58469688592341, 0.21980015175976, -0.216993073195333, -0.951105619514274, 0.220045717520539, -0.878872824135764, -0.423275845278819, // f 384//351 385//353 392//360 -0.663711978694048, -0.466493259254084, -0.58469688592341, -0.663935190533486, 0.16617429912268, -0.729092699923919, 0.21980015175976, -0.216993073195333, -0.951105619514274, // f 385//353 393//361 392//360 -0.663935190533486, 0.16617429912268, -0.729092699923919, 0.219521250288378, 0.608328464748896, -0.762723344108516, 0.21980015175976, -0.216993073195333, -0.951105619514274, // f 385//353 386//354 393//361 -0.663935190533486, 0.16617429912268, -0.729092699923919, -0.664099443785955, 0.673560678055856, -0.324481034484485, 0.219521250288378, 0.608328464748896, -0.762723344108516, // f 386//354 394//362 393//361 -0.664099443785955, 0.673560678055856, -0.324481034484485, 0.219372653290214, 0.975641142525474, 0, 0.219521250288378, 0.608328464748896, -0.762723344108516, // f 386//354 387//355 394//362 -0.664099443785955, 0.673560678055856, -0.324481034484485, -0.664099443785955, 0.673560678055856, 0.324481034484485, 0.219372653290214, 0.975641142525474, 0, // f 387//355 395//363 394//362 -0.664099443785955, 0.673560678055856, 0.324481034484485, 0.219521250288378, 0.608328464748896, 0.762723344108516, 0.219372653290214, 0.975641142525474, 0, // f 387//355 388//356 395//363 -0.664099443785955, 0.673560678055856, 0.324481034484485, -0.663935190533486, 0.16617429912268, 0.729092699923919, 0.219521250288378, 0.608328464748896, 0.762723344108516, // f 388//356 396//364 395//363 -0.663935190533486, 0.16617429912268, 0.729092699923919, 0.21980015175976, -0.216993073195333, 0.951105619514274, 0.219521250288378, 0.608328464748896, 0.762723344108516, // f 388//356 389//357 396//364 -0.663935190533486, 0.16617429912268, 0.729092699923919, -0.663711978694048, -0.466493259254084, 0.58469688592341, 0.21980015175976, -0.216993073195333, 0.951105619514274, // f 389//357 390//359 396//364 -0.663711978694048, -0.466493259254084, 0.58469688592341, 0.220045717520539, -0.878872824135764, 0.423275845278819, 0.21980015175976, -0.216993073195333, 0.951105619514274, // f 389//357 383//352 390//359 -0.663711978694048, -0.466493259254084, 0.58469688592341, -0.663605373717565, -0.748082821600103, 0, 0.220045717520539, -0.878872824135764, 0.423275845278819, // f 397//365 390//359 391//358 0.99999837810289, 0.00180105291160356, 0, 0.220045717520539, -0.878872824135764, 0.423275845278819, 0.220045717520539, -0.878872824135764, -0.423275845278819, // f 397//365 391//358 392//360 0.99999837810289, 0.00180105291160356, 0, 0.220045717520539, -0.878872824135764, -0.423275845278819, 0.21980015175976, -0.216993073195333, -0.951105619514274, // f 397//365 392//360 393//361 0.99999837810289, 0.00180105291160356, 0, 0.21980015175976, -0.216993073195333, -0.951105619514274, 0.219521250288378, 0.608328464748896, -0.762723344108516, // f 397//365 393//361 394//362 0.99999837810289, 0.00180105291160356, 0, 0.219521250288378, 0.608328464748896, -0.762723344108516, 0.219372653290214, 0.975641142525474, 0, // f 397//365 394//362 395//363 0.99999837810289, 0.00180105291160356, 0, 0.219372653290214, 0.975641142525474, 0, 0.219521250288378, 0.608328464748896, 0.762723344108516, // f 397//365 395//363 396//364 0.99999837810289, 0.00180105291160356, 0, 0.219521250288378, 0.608328464748896, 0.762723344108516, 0.21980015175976, -0.216993073195333, 0.951105619514274, // f 397//365 396//364 390//359 0.99999837810289, 0.00180105291160356, 0, 0.21980015175976, -0.216993073195333, 0.951105619514274, 0.220045717520539, -0.878872824135764, 0.423275845278819, // f 398//350 400//349 399//344 0.999999943548505, 0.000336010397354616, 0, 0.590064635773653, -0.396815204949211, 0.703108397567844, 0.590211826736403, -0.797041022501427, 0.127967214669843, // f 398//350 401//348 400//349 0.999999943548505, 0.000336010397354616, 0, 0.589813805670893, 0.302383565164094, 0.748788257225413, 0.590064635773653, -0.396815204949211, 0.703108397567844, // f 398//350 402//347 401//348 0.999999943548505, 0.000336010397354616, 0, 0.589662245937861, 0.774028700136969, 0.230603571264176, 0.589813805670893, 0.302383565164094, 0.748788257225413, // f 398//350 403//346 402//347 0.999999943548505, 0.000336010397354616, 0, 0.589699321514668, 0.662976846717342, -0.461211893734182, 0.589662245937861, 0.774028700136969, 0.230603571264176, // f 398//350 404//345 403//346 0.999999943548505, 0.000336010397354616, 0, 0.589907787261809, 0.0528294138341711, -0.805740563433302, 0.589699321514668, 0.662976846717342, -0.461211893734182, // f 398//350 405//343 404//345 0.999999943548505, 0.000336010397354616, 0, 0.590127945792227, -0.596934198904484, -0.543524212683583, 0.589907787261809, 0.0528294138341711, -0.805740563433302, // f 398//350 399//344 405//343 0.999999943548505, 0.000336010397354616, 0, 0.590211826736403, -0.797041022501427, 0.127967214669843, 0.590127945792227, -0.596934198904484, -0.543524212683583, // f 399//344 407//342 406//337 0.590211826736403, -0.797041022501427, 0.127967214669843, -0.589718676296063, -0.597348801493642, 0.543512918136938, -0.589633012595207, -0.797469304297079, -0.127967258163307, // f 399//344 400//349 407//342 0.590211826736403, -0.797041022501427, 0.127967214669843, 0.590064635773653, -0.396815204949211, 0.703108397567844, -0.589718676296063, -0.597348801493642, 0.543512918136938, // f 400//349 408//366 407//342 0.590064635773653, -0.396815204949211, 0.703108397567844, -0.589940326019834, 0.0524325398968101, 0.805742663941522, -0.589718676296063, -0.597348801493642, 0.543512918136938, // f 400//349 401//348 408//366 0.590064635773653, -0.396815204949211, 0.703108397567844, 0.589813805670893, 0.302383565164094, 0.748788257225413, -0.589940326019834, 0.0524325398968101, 0.805742663941522, // f 401//348 409//340 408//366 0.589813805670893, 0.302383565164094, 0.748788257225413, -0.590152516487017, 0.662575543376592, 0.461208907766594, -0.589940326019834, 0.0524325398968101, 0.805742663941522, // f 401//348 402//347 409//340 0.589813805670893, 0.302383565164094, 0.748788257225413, 0.589662245937861, 0.774028700136969, 0.230603571264176, -0.590152516487017, 0.662575543376592, 0.461208907766594, // f 402//347 410//339 409//340 0.589662245937861, 0.774028700136969, 0.230603571264176, -0.590181416393234, 0.773632897572442, -0.230603632967358, -0.590152516487017, 0.662575543376592, 0.461208907766594, // f 402//347 403//346 410//339 0.589662245937861, 0.774028700136969, 0.230603571264176, 0.589699321514668, 0.662976846717342, -0.461211893734182, -0.590181416393234, 0.773632897572442, -0.230603632967358, // f 403//346 411//338 410//339 0.589699321514668, 0.662976846717342, -0.461211893734182, -0.590028800857499, 0.301957574598098, -0.748790783397803, -0.590181416393234, 0.773632897572442, -0.230603632967358, // f 403//346 404//345 411//338 0.589699321514668, 0.662976846717342, -0.461211893734182, 0.589907787261809, 0.0528294138341711, -0.805740563433302, -0.590028800857499, 0.301957574598098, -0.748790783397803, // f 404//345 412//336 411//338 0.589907787261809, 0.0528294138341711, -0.805740563433302, -0.58979258319845, -0.39721320932102, -0.70311192220371, -0.590028800857499, 0.301957574598098, -0.748790783397803, // f 404//345 405//343 412//336 0.589907787261809, 0.0528294138341711, -0.805740563433302, 0.590127945792227, -0.596934198904484, -0.543524212683583, -0.58979258319845, -0.39721320932102, -0.70311192220371, // f 405//343 406//337 412//336 0.590127945792227, -0.596934198904484, -0.543524212683583, -0.589633012595207, -0.797469304297079, -0.127967258163307, -0.58979258319845, -0.39721320932102, -0.70311192220371, // f 405//343 399//344 406//337 0.590127945792227, -0.596934198904484, -0.543524212683583, 0.590211826736403, -0.797041022501427, 0.127967214669843, -0.589633012595207, -0.797469304297079, -0.127967258163307, // f 413//335 406//337 407//342 -0.999999943548505, -0.000336010397354616, 0, -0.589633012595207, -0.797469304297079, -0.127967258163307, -0.589718676296063, -0.597348801493642, 0.543512918136938, // f 413//335 407//342 408//366 -0.999999943548505, -0.000336010397354616, 0, -0.589718676296063, -0.597348801493642, 0.543512918136938, -0.589940326019834, 0.0524325398968101, 0.805742663941522, // f 413//335 408//366 409//340 -0.999999943548505, -0.000336010397354616, 0, -0.589940326019834, 0.0524325398968101, 0.805742663941522, -0.590152516487017, 0.662575543376592, 0.461208907766594, // f 413//335 409//340 410//339 -0.999999943548505, -0.000336010397354616, 0, -0.590152516487017, 0.662575543376592, 0.461208907766594, -0.590181416393234, 0.773632897572442, -0.230603632967358, // f 413//335 410//339 411//338 -0.999999943548505, -0.000336010397354616, 0, -0.590181416393234, 0.773632897572442, -0.230603632967358, -0.590028800857499, 0.301957574598098, -0.748790783397803, // f 413//335 411//338 412//336 -0.999999943548505, -0.000336010397354616, 0, -0.590028800857499, 0.301957574598098, -0.748790783397803, -0.58979258319845, -0.39721320932102, -0.70311192220371, // f 413//335 412//336 406//337 -0.999999943548505, -0.000336010397354616, 0, -0.58979258319845, -0.39721320932102, -0.70311192220371, -0.589633012595207, -0.797469304297079, -0.127967258163307, // f 414//350 416//367 415//368 0.999999943548505, 0.000336010397354616, 0, 0.664041364032642, -0.46603158989275, 0.584691050107408, 0.664138427581023, -0.747609623406632, 0, // f 414//350 417//369 416//367 0.999999943548505, 0.000336010397354616, 0, 0.663816362614058, 0.166633099207516, 0.729096184995052, 0.664041364032642, -0.46603158989275, 0.584691050107408, // f 414//350 418//370 417//369 0.999999943548505, 0.000336010397354616, 0, 0.663638864770199, 0.674015081550542, 0.324479779044763, 0.663816362614058, 0.166633099207516, 0.729096184995052, // f 414//350 419//371 418//370 0.999999943548505, 0.000336010397354616, 0, 0.663638864770199, 0.674015081550542, -0.324479779044763, 0.663638864770199, 0.674015081550542, 0.324479779044763, // f 414//350 420//372 419//371 0.999999943548505, 0.000336010397354616, 0, 0.663816362614058, 0.166633099207516, -0.729096184995052, 0.663638864770199, 0.674015081550542, -0.324479779044763, // f 414//350 421//373 420//372 0.999999943548505, 0.000336010397354616, 0, 0.664041364032642, -0.46603158989275, -0.584691050107408, 0.663816362614058, 0.166633099207516, -0.729096184995052, // f 414//350 415//368 421//373 0.999999943548505, 0.000336010397354616, 0, 0.664138427581023, -0.747609623406632, 0, 0.664041364032642, -0.46603158989275, -0.584691050107408, // f 415//368 423//374 422//375 0.664138427581023, -0.747609623406632, 0, -0.219429813383151, -0.879032264383416, 0.423264497887078, -0.219429813383151, -0.879032264383416, -0.423264497887078, // f 415//368 416//367 423//374 0.664138427581023, -0.747609623406632, 0, 0.664041364032642, -0.46603158989275, 0.584691050107408, -0.219429813383151, -0.879032264383416, 0.423264497887078, // f 416//367 424//376 423//374 0.664041364032642, -0.46603158989275, 0.584691050107408, -0.219648236151691, -0.217145165085649, 0.951106003364177, -0.219429813383151, -0.879032264383416, 0.423264497887078, // f 416//367 417//369 424//376 0.664041364032642, -0.46603158989275, 0.584691050107408, 0.663816362614058, 0.166633099207516, 0.729096184995052, -0.219648236151691, -0.217145165085649, 0.951106003364177, // f 417//369 425//377 424//376 0.663816362614058, 0.166633099207516, 0.729096184995052, -0.219947950870149, 0.608175629240459, 0.762722297370409, -0.219648236151691, -0.217145165085649, 0.951106003364177, // f 417//369 418//370 425//377 0.663816362614058, 0.166633099207516, 0.729096184995052, 0.663638864770199, 0.674015081550542, 0.324479779044763, -0.219947950870149, 0.608175629240459, 0.762722297370409, // f 418//370 426//378 425//377 0.663638864770199, 0.674015081550542, 0.324479779044763, -0.220073574372516, 0.975483276054953, 0, -0.219947950870149, 0.608175629240459, 0.762722297370409, // f 418//370 419//371 426//378 0.663638864770199, 0.674015081550542, 0.324479779044763, 0.663638864770199, 0.674015081550542, -0.324479779044763, -0.220073574372516, 0.975483276054953, 0, // f 419//371 427//379 426//378 0.663638864770199, 0.674015081550542, -0.324479779044763, -0.219947950870149, 0.608175629240459, -0.762722297370409, -0.220073574372516, 0.975483276054953, 0, // f 419//371 420//372 427//379 0.663638864770199, 0.674015081550542, -0.324479779044763, 0.663816362614058, 0.166633099207516, -0.729096184995052, -0.219947950870149, 0.608175629240459, -0.762722297370409, // f 420//372 428//380 427//379 0.663816362614058, 0.166633099207516, -0.729096184995052, -0.219648236151691, -0.217145165085649, -0.951106003364177, -0.219947950870149, 0.608175629240459, -0.762722297370409, // f 420//372 421//373 428//380 0.663816362614058, 0.166633099207516, -0.729096184995052, 0.664041364032642, -0.46603158989275, -0.584691050107408, -0.219648236151691, -0.217145165085649, -0.951106003364177, // f 421//373 422//375 428//380 0.664041364032642, -0.46603158989275, -0.584691050107408, -0.219429813383151, -0.879032264383416, -0.423264497887078, -0.219648236151691, -0.217145165085649, -0.951106003364177, // f 421//373 415//368 422//375 0.664041364032642, -0.46603158989275, -0.584691050107408, 0.664138427581023, -0.747609623406632, 0, -0.219429813383151, -0.879032264383416, -0.423264497887078, // f 429//381 422//375 423//374 -0.999999396062604, 0.0010990334063084, 0, -0.219429813383151, -0.879032264383416, -0.423264497887078, -0.219429813383151, -0.879032264383416, 0.423264497887078, // f 429//381 423//374 424//376 -0.999999396062604, 0.0010990334063084, 0, -0.219429813383151, -0.879032264383416, 0.423264497887078, -0.219648236151691, -0.217145165085649, 0.951106003364177, // f 429//381 424//376 425//377 -0.999999396062604, 0.0010990334063084, 0, -0.219648236151691, -0.217145165085649, 0.951106003364177, -0.219947950870149, 0.608175629240459, 0.762722297370409, // f 429//381 425//377 426//378 -0.999999396062604, 0.0010990334063084, 0, -0.219947950870149, 0.608175629240459, 0.762722297370409, -0.220073574372516, 0.975483276054953, 0, // f 429//381 426//378 427//379 -0.999999396062604, 0.0010990334063084, 0, -0.220073574372516, 0.975483276054953, 0, -0.219947950870149, 0.608175629240459, -0.762722297370409, // f 429//381 427//379 428//380 -0.999999396062604, 0.0010990334063084, 0, -0.219947950870149, 0.608175629240459, -0.762722297370409, -0.219648236151691, -0.217145165085649, -0.951106003364177, // f 429//381 428//380 422//375 -0.999999396062604, 0.0010990334063084, 0, -0.219648236151691, -0.217145165085649, -0.951106003364177, -0.219429813383151, -0.879032264383416, -0.423264497887078, };
51.164232
68
0.744963
1ad25bd29588079de5e46d5e2141671eee747c1b
208
h
C
c/employee-sortnator/employee.h
mateusKoppe/UFFS-Algs
6e75ea64a9354036eebfd841c64ffff4becc9e3a
[ "MIT" ]
5
2019-09-20T22:36:22.000Z
2021-09-13T14:11:42.000Z
c/employee-sortnator/employee.h
mateusKoppe/UFFS-Algs
6e75ea64a9354036eebfd841c64ffff4becc9e3a
[ "MIT" ]
1
2019-10-03T00:57:38.000Z
2020-12-13T23:04:39.000Z
c/employee-sortnator/employee.h
mateusKoppe/uffs-algorithms
6e75ea64a9354036eebfd841c64ffff4becc9e3a
[ "MIT" ]
null
null
null
#ifndef _EMPLOYEE #define _EMPLOYEE typedef struct employee employee; struct employee { char name[85]; float salary; }; void employee_init (employee *empl); void employee_print (employee *empl); #endif
16
37
0.759615
2b707f686f750ba7e4678e96b69c1d9ccec801f7
144
h
C
ext/rbzmq/rbzmq.h
aomega08/rbzmq
14e8a449cfb3acb2d0ea39b581f93e32ff7a8b70
[ "MIT" ]
null
null
null
ext/rbzmq/rbzmq.h
aomega08/rbzmq
14e8a449cfb3acb2d0ea39b581f93e32ff7a8b70
[ "MIT" ]
null
null
null
ext/rbzmq/rbzmq.h
aomega08/rbzmq
14e8a449cfb3acb2d0ea39b581f93e32ff7a8b70
[ "MIT" ]
null
null
null
#pragma once void init_rbzmq_context(); struct rbzmq_context { void *ctx; VALUE socks[256]; }; struct rbzmq_socket { void *socket; };
10.285714
26
0.6875
d88ac7a5b3f470d54e8312482808914855170f29
2,600
h
C
sdk-6.5.20/include/bcm_int/ltsw/range_int.h
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
sdk-6.5.20/include/bcm_int/ltsw/range_int.h
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
sdk-6.5.20/include/bcm_int/ltsw/range_int.h
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
/* * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. * * Copyright 2007-2020 Broadcom Inc. All rights reserved. */ /*! \file range_int.h * * Range internal management header file. * This file contains the management for RANGE module. */ #ifndef BCMINT_LTSW_RANGE_INT_H #define BCMINT_LTSW_RANGE_INT_H #include <bcm/range.h> #include <bcm_int/ltsw/lt_intf.h> #include <sal/sal_mutex.h> #include <shr/shr_bitop.h> #define _RANGE_ID_MAX (0x000000FF) #define _RANGE_GRP_ID_MAX (0x0000000F) /* * Typedef: * bcmint_range_id_bmp_t * Purpose: * Entry bit map for tracking allocation of range ids. */ typedef struct bcmint_range_id_bmp_s{ SHR_BITDCL w[_SHR_BITDCLSIZE(_RANGE_ID_MAX)]; } bcmint_range_id_bmp_t; /* * Typedef: * bcmint_range_id_bmp_t * Purpose: * Entry bit map for tracking allocation of range ids. */ typedef struct bcmint_range_grp_id_bmp_s{ SHR_BITDCL w[_SHR_BITDCLSIZE(_RANGE_GRP_ID_MAX)]; } bcmint_range_grp_id_bmp_t; /* Different RANGE LT and key fields. */ typedef struct bcmint_range_tbls_info_s { /*! Range SID */ char *range_sid; /*! Range Key FID */ char *range_key_fid; /*! Range Max Value */ char *range_max; /*! Range Min Value */ char *range_min; /*! Range type */ char *range_type; /*! Range Group SID */ char *range_grp_sid; /*! Range Group Key FID */ char *range_grp_key_fid; /*! Range Group Key Type FID */ char *range_grp_key_type_fid; /*! Range Operational Mode SID */ char *oper_mode_sid; /*! Range Operational Mode FID */ char *oper_mode_fid; } bcmint_range_tbls_info_t; /*! * \brief Range Module Information */ typedef struct bcmint_range_info_s { /*! Bitmap of Range IDs */ bcmint_range_id_bmp_t range_id_bmp; /*! Bitmap of Range Group IDs */ bcmint_range_grp_id_bmp_t range_grp_id_bmp; /*! LT table and key field names */ bcmint_range_tbls_info_t *tbls_info; } bcmint_range_info_t; /*! * \brief Range Module control Information */ typedef struct bcmint_range_control_info_s { bcmint_range_info_t range_info; } bcmint_range_control_info_t; /*! * \brief Range Module database. */ typedef struct bcmi_ltsw_range_db_s { /*! Range module lock. */ sal_mutex_t lock; /*! Range control database. */ bcmint_range_control_info_t control_db; } bcmi_ltsw_range_db_t; extern int bcm_ltsw_range_init(int unit); extern int bcm_ltsw_range_detach(int unit); #endif /* BCMINT_LTSW_RANGE_INT_H */
22.608696
134
0.71
d8a8d9de5b4cee8031467cbb64e491fdfe209bc9
9,652
c
C
test/basic/drivers/tesic_apb/tesic_apb_slave_emu.c
sebastien-riou/SATL
b95d0e784d2e8e1384381d4d5b8b448d3d1798cf
[ "Apache-2.0" ]
4
2020-05-13T10:13:55.000Z
2021-10-20T04:43:07.000Z
test/basic/drivers/tesic_apb/tesic_apb_slave_emu.c
TiempoSecure/SATL
b95d0e784d2e8e1384381d4d5b8b448d3d1798cf
[ "Apache-2.0" ]
4
2020-07-22T16:06:31.000Z
2021-07-25T19:51:41.000Z
test/basic/drivers/tesic_apb/tesic_apb_slave_emu.c
TiempoSecure/SATL
b95d0e784d2e8e1384381d4d5b8b448d3d1798cf
[ "Apache-2.0" ]
2
2019-05-12T21:15:00.000Z
2020-09-23T09:05:24.000Z
//#include <sys/socket.h> //#include <sys/types.h> //#include <netinet/in.h> //#include <netdb.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> //#include <arpa/inet.h> #include <stdint.h> #include <assert.h> #define SATL_SOCKET_ONLY_CUSTOM_FUNCS #include "../../../../implementations/c99/basic/drivers/socket/satl_socket.h" #include "../../../../implementations/c99/basic/drivers/tesic_apb/tesic_apb.h" extern int sockfd; typedef enum emu_state_enum_t { CTPDU_HDR=0, CTPDU_DAT=1, CTPDU_FINAL_DAT=2, RTPDU_HDR=10, RTPDU_DAT=11, RTPDU_FINAL_DAT=12 } emu_state_t; emu_state_t emu_state; //#define EMU_APB_OVER_SOCKET #ifdef EMU_APB_OVER_SOCKET //here we communicate with the other side of the APB emu void get_updated_state(TESIC_APB_t*ctx){ uint8_t buf[1024]; int ret = recv(sockfd, buf, sizeof(buf), MSG_PEEK); assert(ret <= TESIC_APB_BUF_LEN+8); if(ret>0){//get updated state recv(sockfd, ctx, sizeof(TESIC_APB_t),MSG_WAITALL);//note: if we use signals this will be broken } } void set_updated_state(TESIC_APB_t*ctx){ send(sockfd, ctx, sizeof(TESIC_APB_t),0); } #else //here we communicate with whatever SATL implementation with compatible parameters uint32_t emu_fl=0; uint32_t emu_remaining=0; unsigned int emu_rx_pos=0; uint32_t emu_CFG=0; void get_ack(TESIC_APB_t*ctx){ uint8_t buf[1024]; //printf("wait ack");fflush(stdout); recv(sockfd, buf, 1,MSG_WAITALL); //printf(", received\n"); ctx->CNT=0; ctx->CFG &= ~TESIC_APB_CFG_SLAVE_STS_MASK; ctx->CFG |= TESIC_APB_CFG_MASTER_STS_MASK; ctx->CFG |= TESIC_APB_CFG_OWNER_MASK;//only master can change this bit } //#include <sys/ioctl.h> //#include <linux/sockios.h> //assume we are slave void get_updated_state(TESIC_APB_t*ctx){ uint8_t buf[1024]; int ret; ret=rx_bytes_available(sockfd); //ioctl(sockfd, SIOCINQ, &ret); assert(ret <= TESIC_APB_BUF_LEN); if(ret>0){//get updated state //printf("receiving at least %u bytes, state=%u\n",ret,emu_state); switch(emu_state){ case RTPDU_DAT: case RTPDU_FINAL_DAT:{ get_ack(ctx); return; } } uint8_t*b8 = (uint8_t*)ctx->BUF; int already_received = recv(sockfd, b8, 4,MSG_WAITALL); //printf("already_received=%d\n",already_received); //printf("received %u bytes\n",already_received); //for(unsigned int i=0;i<already_received;i++){ // printf("%02X ",b8[i]); //} //printf("\n"); unsigned int expected_len=0; switch(emu_state){ case CTPDU_HDR:{ assert(already_received>=4); emu_fl = ctx->BUF[0]; //printf("CTPDU_HDR fl = %u\n",emu_fl ); emu_rx_pos=0; emu_remaining = emu_fl; expected_len = emu_fl; if(expected_len>TESIC_APB_BUF_LEN){ expected_len = TESIC_APB_BUF_LEN; } break; } case CTPDU_DAT:{ //printf("CTPDU_DAT\n"); expected_len = TESIC_APB_BUF_LEN; break; } case CTPDU_FINAL_DAT:{ //printf("CTPDU_FINAL_DAT\n"); expected_len = emu_remaining; break; } } unsigned int remaining = expected_len - already_received; if(remaining % 4) remaining += 4-(remaining%4); if(remaining){ //printf("waiting for %u bytes\n",remaining); ret = recv(sockfd, b8+already_received, remaining,MSG_WAITALL); assert(remaining==ret); //printf("received %u bytes\n",expected_len); //for(unsigned int i=0;i<expected_len;i++){ // printf("%02X ",b8[i]); //} //printf("\n"); } ctx->CNT = expected_len; ctx->CFG &= ~TESIC_APB_CFG_SLAVE_STS_MASK; ctx->CFG |= TESIC_APB_CFG_MASTER_STS_MASK; ctx->CFG |= TESIC_APB_CFG_OWNER_MASK;//only master can change this bit switch(emu_state){ case CTPDU_HDR:{ assert(ctx->CNT>=12); emu_remaining = emu_fl - ctx->CNT; if(0==emu_remaining){ emu_state = RTPDU_HDR; }else { if(emu_remaining<=TESIC_APB_BUF_LEN){ emu_state = CTPDU_FINAL_DAT; }else{ emu_state = CTPDU_DAT; } } break; } case CTPDU_DAT:{ assert(TESIC_APB_BUF_LEN==ctx->CNT); emu_remaining -= ctx->CNT; if(0==emu_remaining){ emu_state = RTPDU_HDR; }else { if(emu_remaining<=TESIC_APB_BUF_LEN){ emu_state = CTPDU_FINAL_DAT; }else{ emu_state = CTPDU_DAT; } } break; } case CTPDU_FINAL_DAT:{ assert(emu_remaining == ctx->CNT); emu_state = RTPDU_HDR; break; } } } emu_CFG = ctx->CFG; } //assume we are slave void set_updated_state(TESIC_APB_t*ctx){ if(ctx->CFG & TESIC_APB_CFG_SLAVE_STS_MASK){ if(0==(emu_CFG & TESIC_APB_CFG_SLAVE_STS_MASK)){//send data unsigned int padded_len = ((ctx->CNT + 3) / 4)*4; uint8_t *b8 = (uint8_t*)ctx->BUF; //printf("sending %u bytes\n",padded_len); //for(unsigned int i=0;i<padded_len;i++){ // printf("%02X ",b8[i]); //} //printf("\n"); assert(padded_len<=TESIC_APB_BUF_LEN); if(0==padded_len) { //printf("emu_state=%u\n",emu_state); assert((RTPDU_DAT==emu_state)||(CTPDU_DAT==emu_state)||(CTPDU_FINAL_DAT==emu_state)); padded_len = 1;//sending ack, generic socket impl expect a payload } switch(emu_state){ case RTPDU_HDR:{ //printf("RTPDU_HDR\n"); assert(ctx->CNT>=6); emu_fl = ctx->BUF[0]; //printf("fl=%u\n",emu_fl); emu_remaining = emu_fl - ctx->CNT; if(0==emu_remaining){ emu_state = CTPDU_HDR; }else { if(emu_remaining<=TESIC_APB_BUF_LEN){ emu_state = RTPDU_FINAL_DAT; }else{ emu_state = RTPDU_DAT; } } break; } case RTPDU_DAT:{ //printf("RTPDU_DAT\n"); assert(TESIC_APB_BUF_LEN==ctx->CNT); emu_remaining -= ctx->CNT; if(0==emu_remaining){ emu_state = CTPDU_HDR; }else { if(emu_remaining<=TESIC_APB_BUF_LEN){ emu_state = RTPDU_FINAL_DAT; }else{ emu_state = RTPDU_DAT; } } break; } case RTPDU_FINAL_DAT:{ //printf("RTPDU_FINAL_DAT %u, %u\n",emu_remaining,ctx->CNT); assert(emu_remaining == ctx->CNT); emu_state = CTPDU_HDR; break; } } //printf("write %u bytes\n",padded_len); send(sockfd, (uint8_t*)ctx->BUF, padded_len,0); ctx->CFG&=~TESIC_APB_CFG_OWNER_MASK;//only master can change this bit } } emu_CFG = ctx->CFG; } #endif void emu_init(TESIC_APB_t*ctx){ emu_state = CTPDU_HDR; ctx->CFG = 0x0D000AAB; ctx->CNT = 0; for(unsigned int i=0;i<TESIC_APB_BUF_DWORDS;i++){ ctx->BUF[i]=0; } } uint32_t emu_rd_cfg(TESIC_APB_t*ctx){ get_updated_state(ctx); //printf("read CFG=0x%08X\n",ctx->CFG); return ctx->CFG; } uint32_t emu_rd_cnt(TESIC_APB_t*ctx){ //assert(ctx->CFG & TESIC_APB_CFG_OWNER_MASK);//slave shall have ownership get_updated_state(ctx); //printf("read CNT=0x%08X\n",ctx->CNT); return ctx->CNT; } uint32_t emu_rd_buf(TESIC_APB_t*ctx, unsigned int idx){ assert(ctx->CFG & TESIC_APB_CFG_OWNER_MASK);//slave shall have ownership //printf("read BUF[%u]=",idx); get_updated_state(ctx); //printf("read BUF[%u]=0x%08X\n",idx,ctx->BUF[idx]); return ctx->BUF[idx]; } void emu_wr_cfg(TESIC_APB_t*ctx,uint32_t val){ uint32_t old=ctx->CFG; //printf("write CFG=0x%08X over 0x%08X\n",val,old);//NOTE that OWNER is changed 'instantly' when slave set SLAVE_STS ctx->CFG = (val & 0xFFFE0000) | 0x0AAB | (old & TESIC_APB_CFG_OWNER_MASK); set_updated_state(ctx); } void emu_wr_cnt(TESIC_APB_t*ctx,uint32_t val){ assert(ctx->CFG & TESIC_APB_CFG_OWNER_MASK);//slave shall have ownership //printf("write CNT=0x%08X\n",val); assert(val < 1<<16); ctx->CNT = val; set_updated_state(ctx); } void emu_wr_buf(TESIC_APB_t*ctx, unsigned int idx, uint32_t val){ assert(ctx->CFG & TESIC_APB_CFG_OWNER_MASK);//slave shall have ownership ctx->BUF[idx] = val; //printf("write BUF[%u]=0x%08X\n",idx,ctx->BUF[idx]); set_updated_state(ctx); }
33.630662
120
0.536366
faf9d4aceb938dc6e62f8340b3fd218ddf7f39ed
584
c
C
player/src/util/list/mx_pop_index.c
drrost/mupmp3
78b470c729a94a29e1669e07723f2e93b8026e71
[ "Apache-2.0" ]
null
null
null
player/src/util/list/mx_pop_index.c
drrost/mupmp3
78b470c729a94a29e1669e07723f2e93b8026e71
[ "Apache-2.0" ]
null
null
null
player/src/util/list/mx_pop_index.c
drrost/mupmp3
78b470c729a94a29e1669e07723f2e93b8026e71
[ "Apache-2.0" ]
null
null
null
// // Created by Rostyslav Druzhchenko on 22.04.2020. // #include "list.h" #include <stdlib.h> void mx_pop_index(t_list **list, int index) { if (list == 0 || *list == 0) { return; } t_list *node = *list; // 1 if (node->next == 0 || index <= 0) { mx_pop_front(list); return; } t_list *prev = node; for (int i = 0; node; i++) { if (index == i) { prev->next = node->next; free(node); return; } prev = node; node = node->next; } mx_pop_back(list); }
17.176471
50
0.464041
4f2f77931af2bb7b65ef10f171e35985e3abbb82
428
h
C
BusInfoCollector.h
michaelrockhold/TransitScope
75b55fdd0a298d2668767a2c2a21b28660bfffeb
[ "MIT" ]
null
null
null
BusInfoCollector.h
michaelrockhold/TransitScope
75b55fdd0a298d2668767a2c2a21b28660bfffeb
[ "MIT" ]
null
null
null
BusInfoCollector.h
michaelrockhold/TransitScope
75b55fdd0a298d2668767a2c2a21b28660bfffeb
[ "MIT" ]
null
null
null
#import <Foundation/Foundation.h> #import "Model.h" #import <XPathQuery.h> @protocol BusInfoCollectionOwner; @interface BusInfoCollector : NSOperation <XPathNodeHandler> { NSObject<BusInfoCollectionOwner>* m_collectionOwner; NSSet* m_routeIDs; } + (void)initialize; - (id)initWithCollectionOwner:(NSObject<BusInfoCollectionOwner>*)owner routeIDs:(NSSet*)routeIDs; - (void)queueRoute:(NSNumber*)routeID; - (void)main; @end
22.526316
97
0.78271
9afb11e83a83157209a98f95c9eb05d70af1f9b3
333
h
C
test/unit-tests/device/unvme/unvme_cmd_mock.h
YongJin-Cho/poseidonos
c07a0240316d4536aa09f22d7977604f3650d752
[ "BSD-3-Clause" ]
null
null
null
test/unit-tests/device/unvme/unvme_cmd_mock.h
YongJin-Cho/poseidonos
c07a0240316d4536aa09f22d7977604f3650d752
[ "BSD-3-Clause" ]
null
null
null
test/unit-tests/device/unvme/unvme_cmd_mock.h
YongJin-Cho/poseidonos
c07a0240316d4536aa09f22d7977604f3650d752
[ "BSD-3-Clause" ]
null
null
null
#include <gmock/gmock.h> #include <list> #include <string> #include <vector> #include "src/device/unvme/unvme_cmd.h" namespace pos { class MockAbortContext : public AbortContext { public: using AbortContext::AbortContext; }; class MockUnvmeCmd : public UnvmeCmd { public: using UnvmeCmd::UnvmeCmd; }; } // namespace pos
13.875
44
0.726727
3d20dff8eff80e1cccbadf4010cbb14cee55117f
6,207
c
C
src/lc_minfo.c
op3/libmfile
a18a06616fcdabf6e4989f2410680f6724f44762
[ "BSD-2-Clause" ]
null
null
null
src/lc_minfo.c
op3/libmfile
a18a06616fcdabf6e4989f2410680f6724f44762
[ "BSD-2-Clause" ]
null
null
null
src/lc_minfo.c
op3/libmfile
a18a06616fcdabf6e4989f2410680f6724f44762
[ "BSD-2-Clause" ]
null
null
null
/* * lc_minfo.c */ /* * Copyright (c) 1992-2008, Stefan Esser <se@ikp.uni-koeln.de> * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <stdlib.h> #include <memory.h> #include "mfile.h" #include "maccess.h" #include "sys_endian.h" #include "getputint.h" #include "lc_minfo.h" #include "lc_getput.h" #include "lc_c1.h" #include "lc_c2.h" static int32_t init_lci(MFILE *mat, uint32_t freepos, uint32_t freelistpos, uint32_t poslentablepos); /* static int32_t lc_updateheader(MFILE *mat); */ static void free_lci(MFILE *mat); static int32_t lc_flush(MFILE *mat); static int32_t init_lci(MFILE *mat, uint32_t freepos, uint32_t freelistpos, uint32_t poslentablepos) { uint32_t n = mat->lines * mat->levels; lc_minfo *lci = (lc_minfo *)malloc (sizeof (lc_minfo)); mat->specinfo.p = (void *)lci; if (lci) { lci->version = mat->version; lci->cachedline = -1; lci->cachedcomprline = -1; lci->comprlinelen = 0; lci->cachedlinedirty = 0; lci->linebuf = NULL; lci->comprlinebuf = NULL; switch (lci->version) { case LC_C1_VERSION: lci->comprf = lc1_compress; lci->uncomprf = lc1_uncompress; lci->comprlinebuf = (void *)malloc (lc1_comprlinelenmax (mat->columns)); break; case LC_C2_VERSION: lci->comprf = lc2_compress; lci->uncomprf = lc2_uncompress; lci->comprlinebuf = (void *)malloc (lc2_comprlinelenmax (mat->columns)); break; } lci->linebuf = (int32_t *)malloc (mat->columns * sizeof(int32_t)); lci->poslentableptr = (lc_poslen *)malloc (n * sizeof(lc_poslen)); if (lci->poslentableptr && lci->linebuf && lci->comprlinebuf) { if (freepos != 0) { lci->poslentablepos = poslentablepos; lci->freepos = freepos; lci->freelistpos = freelistpos; if (getle4 (mat->ap, (int32_t *)lci->poslentableptr, poslentablepos, 2 * n) == 2 * n) { lc_poslen lpc; lpc.len = lci->poslentableptr[0].len; lpc.pos = lci->poslentableptr[0].pos; if (lpc.len && lpc.pos < sizeof (lc_header) + n * sizeof(lc_poslen)) return -1; return 0; } } else { lci->poslentablepos = sizeof (lc_header); lci->freepos = lci->poslentablepos + n * sizeof(lc_poslen); lci->freelistpos = 0; memset (lci->poslentableptr, 0, n * sizeof(lc_poslen)); return 0; } } } return -1; } void lc_probe(MFILE *mat) { lc_header lch; if (_get (mat->ap, &lch, 0, sizeof(lch)) != sizeof(lch)) return; if (lch.magic != GETLE4((unsigned)MAGIC_LC)) return; mat->status |=MST_DIMSFIXED; mat->filetype = MAT_LC; mat->version = GETLE4(lch.version); mat->levels = GETLE4(lch.levels); mat->lines = GETLE4(lch.lines); mat->columns = GETLE4(lch.columns); mat->mgeti4f = lc_get; mat->mputi4f = lc_put; mat->mflushf = lc_flush; mat->muninitf = lc_uninit; if (init_lci (mat, GETLE4(lch.freepos), GETLE4(lch.freelistpos), GETLE4(lch.poslentablepos)) != 0) free_lci (mat); if (mat->specinfo.p) mat->status |= (MST_INITIALIZED | MST_DIMSFIXED); } void lc_init(MFILE *mat) { if (mat->status & MST_INITIALIZED) return; if (mat->version == 0) { mat->version = LC_STD_VERSION; } if (init_lci (mat, 0, 0, 0) != 0) { free_lci (mat); mat->filetype = MAT_INVALID; return; } mat->mgeti4f = lc_get; mat->mputi4f = lc_put; mat->mflushf = lc_flush; mat->muninitf = lc_uninit; } #ifdef undef int32_t lc_putinfo(MFILE *mat, minfo *info) { return 0; } #endif int32_t lc_uninit(MFILE *mat) { int32_t status; status = lc_flush (mat); free_lci (mat); return status; } static int32_t lc_flush(MFILE *mat) { if (mat->status & MST_DIRTY) { lc_header lch; lc_minfo *lci = (lc_minfo *)mat->specinfo.p; uint32_t n; if (lc_flushcache (mat) !=0) return -1; lch.magic = GETLE4((unsigned)MAGIC_LC); lch.levels = GETLE4(mat->levels); lch.lines = GETLE4(mat->lines); lch.columns = GETLE4(mat->columns); lch.version = GETLE4(lci->version); lch.poslentablepos = GETLE4(lci->poslentablepos); lch.freepos = GETLE4(lci->freepos); lch.freelistpos = GETLE4(lci->freelistpos); lch.used = 0; /* not yet implemented */ lch.free = 0; lch.status = 0; if (_put (mat->ap, &lch, 0, sizeof(lch)) != sizeof(lch)) return -1; n = mat->levels * mat->lines; if (putle4 (mat->ap, (int32_t *)lci->poslentableptr, lci->poslentablepos, 2*n) != 2*n) return -1; if (_flush (mat->ap) != 0) return -1; mat->status &= ~MST_DIRTY; } return 0; } static void free_lci(MFILE *mat) { if (mat != NULL) { lc_minfo *lci = (lc_minfo *)mat->specinfo.p; if (lci->linebuf != NULL) free (lci->linebuf); if (lci->comprlinebuf != NULL) free (lci->comprlinebuf); if (lci->poslentableptr != NULL) free (lci->poslentableptr); free (lci); } mat->filetype = MAT_INVALID; }
27.709821
101
0.657806
2c5d55d256926ae786737130289310b34c0f8ff2
1,880
h
C
src/ghtree/clustering.h
mithro/TritonCTS
caddecff508a8feee6265a9403026f6a03a591bf
[ "BSD-3-Clause" ]
20
2019-07-23T12:29:21.000Z
2022-02-17T09:53:12.000Z
src/ghtree/clustering.h
mithro/TritonCTS
caddecff508a8feee6265a9403026f6a03a591bf
[ "BSD-3-Clause" ]
12
2019-06-28T02:37:06.000Z
2020-12-21T22:43:00.000Z
src/ghtree/clustering.h
mithro/TritonCTS
caddecff508a8feee6265a9403026f6a03a591bf
[ "BSD-3-Clause" ]
10
2019-07-28T20:52:22.000Z
2022-01-27T15:04:51.000Z
#include <vector> #include <cmath> #include "tree.h" namespace CKMeans { using namespace std; class flop { public: // location float x, y; unsigned x_idx, y_idx; vector<float> dists; unsigned idx; vector<pair<int, int>> match_idx; vector<float> silhs; pin* p; flop(const float x, const float y, pin* p) : x(x), y(y), p(p) {}; }; class clustering { vector<flop*> flops; vector<vector<flop*>> clusters; //map<unsigned, vector<pair<float, float>>> shifts; // relative x- and y-shifts of slots w.r.t tray int verbose = 1; int TEST_LAYOUT = 1; int TEST_ITER = 1; std::string plotFile; //std::pair<float,float> branchPoint; //float minDist; //float maxDist; float segmentLength; std::pair<float, float> branchingPoint; public: clustering(const vector<pin*>&, float, float); ~clustering(); float Kmeans(unsigned, unsigned, unsigned, vector<pair<float, float>>&, unsigned); void iterKmeans(unsigned, unsigned, unsigned, unsigned, vector<pair<float, float>>&, unsigned MAX = 15); float calcSilh(const vector<pair<float,float>>&, unsigned, unsigned); void minCostFlow (const vector<pair<float, float>>&, unsigned, unsigned, float); void setPlotFileName(const std::string fileName) { plotFile = fileName; } void getClusters(vector<vector<pin*>>&); void fixSegmentLengths(vector<pair<float, float>>&); void fixSegment(const pair<float, float>& fixedPoint, pair<float, float>& movablePoint, float targetDist); inline float calcDist (const pair<float, float>& loc, flop * f) const { return (fabs(loc.first - f->x) + fabs(loc.second - f->y)); } inline float calcDist (const pair<float, float>& loc1, pair<float, float>& loc2) const { return (fabs(loc1.first - loc2.first) + fabs(loc1.second - loc2.second)); } void plotClusters(const vector<vector<flop*>>&, const vector<pair<float, float>>&) const; }; }
29.84127
107
0.689362
2caf00f2d0f026256be6a15473a54ba556ca22b8
1,011
c
C
libft/ft_lstadd.c
VincentMatthys/42_GNL
a5c1dd566a6bd7c67b7b352f50dfb1a94a1273ac
[ "MIT" ]
null
null
null
libft/ft_lstadd.c
VincentMatthys/42_GNL
a5c1dd566a6bd7c67b7b352f50dfb1a94a1273ac
[ "MIT" ]
1
2017-08-02T07:27:03.000Z
2017-08-05T20:55:35.000Z
libft/ft_lstadd.c
VincentMatthys/42_GNL
a5c1dd566a6bd7c67b7b352f50dfb1a94a1273ac
[ "MIT" ]
2
2017-08-09T08:35:10.000Z
2019-05-14T22:27:28.000Z
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_lstadd.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: vmatthys <vmatthys@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/11 10:27:47 by vmatthys #+# #+# */ /* Updated: 2016/11/11 18:49:02 by vmatthys ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" void ft_lstadd(t_list **alst, t_list *new) { if (new) { new->next = *alst; *alst = new; } }
43.956522
80
0.169139
d2abced97a6d4f71eefffcab12ac5c71618c3f99
1,080
c
C
src/core/util.c
ChristophHaag/lovr
394759c1ab1c4bfebaff61b29d353688b3c8963a
[ "MIT" ]
2
2021-02-20T02:08:46.000Z
2021-02-25T16:49:56.000Z
src/core/util.c
ChristophHaag/lovr
394759c1ab1c4bfebaff61b29d353688b3c8963a
[ "MIT" ]
null
null
null
src/core/util.c
ChristophHaag/lovr
394759c1ab1c4bfebaff61b29d353688b3c8963a
[ "MIT" ]
1
2021-04-16T06:12:46.000Z
2021-04-16T06:12:46.000Z
#include "util.h" #include <stdlib.h> #include <stdio.h> // Error handling static void defaultErrorCallback(void* p, const char* format, va_list args) { fprintf(stderr, "Error: "); vfprintf(stderr, format, args); fprintf(stderr, "\n"); } LOVR_THREAD_LOCAL errorFn* lovrErrorCallback = defaultErrorCallback; LOVR_THREAD_LOCAL void* lovrErrorUserdata = NULL; void lovrSetErrorCallback(errorFn* callback, void* userdata) { lovrErrorCallback = callback ? callback : defaultErrorCallback; lovrErrorUserdata = userdata; } void lovrThrow(const char* format, ...) { va_list args; va_start(args, format); lovrErrorCallback(lovrErrorUserdata, format, args); va_end(args); exit(EXIT_FAILURE); } // Logging logFn* lovrLogCallback; void* lovrLogUserdata; void lovrSetLogCallback(logFn* callback, void* userdata) { lovrLogCallback = callback; lovrLogUserdata = userdata; } void lovrLog(int level, const char* tag, const char* format, ...) { va_list args; va_start(args, format); lovrLogCallback(lovrLogUserdata, level, tag, format, args); va_end(args); }
25.116279
77
0.740741
d2f0d46d7b9aaf1ae6ea13465d3ba873a08a67f1
2,991
h
C
System/Library/PrivateFrameworks/Accessibility.framework/Frameworks/AXPineBoardServerInstance.framework/AXPineBoardServerInstance-Class.h
lechium/tvOS10Headers
f0c99993da6cc502d36fdc5cb4ff90d94b12bf67
[ "MIT" ]
4
2017-03-23T00:01:54.000Z
2018-08-04T20:16:32.000Z
System/Library/PrivateFrameworks/Accessibility.framework/Frameworks/AXPineBoardServerInstance.framework/AXPineBoardServerInstance-Class.h
lechium/tvOS10Headers
f0c99993da6cc502d36fdc5cb4ff90d94b12bf67
[ "MIT" ]
null
null
null
System/Library/PrivateFrameworks/Accessibility.framework/Frameworks/AXPineBoardServerInstance.framework/AXPineBoardServerInstance-Class.h
lechium/tvOS10Headers
f0c99993da6cc502d36fdc5cb4ff90d94b12bf67
[ "MIT" ]
4
2017-05-14T16:23:26.000Z
2019-12-21T15:07:59.000Z
/* * This header is generated by classdump-dyld 1.0 * on Wednesday, March 22, 2017 at 9:08:08 AM Mountain Standard Time * Operating System: Version 10.1 (Build 14U593) * Image Source: /System/Library/PrivateFrameworks/Accessibility.framework/Frameworks/AXPineBoardServerInstance.framework/AXPineBoardServerInstance * classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos. */ @class AXSpeechAssetMonitorHelper, AXPineBoardServiceProvider, AXIPCServer, AXIPCClient, AXFrontBoardProcessWatcher; @interface AXPineBoardServerInstance : NSObject { AXSpeechAssetMonitorHelper* _assetMonitor; BOOL _systemAppServerRunning; AXPineBoardServiceProvider* _serviceProvider; id _axEnabledNotificationObserverToken; AXIPCServer* _server; AXIPCClient* _client; AXFrontBoardProcessWatcher* _processWatcher; } @property (assign,getter=isSystemAppServerRunning,nonatomic) BOOL systemAppServerRunning; //@synthesize systemAppServerRunning=_systemAppServerRunning - In the implementation block @property (nonatomic,retain) id axEnabledNotificationObserverToken; //@synthesize axEnabledNotificationObserverToken=_axEnabledNotificationObserverToken - In the implementation block @property (nonatomic,retain) AXIPCServer * server; //@synthesize server=_server - In the implementation block @property (nonatomic,retain) AXIPCClient * client; //@synthesize client=_client - In the implementation block @property (nonatomic,retain) AXPineBoardServiceProvider * serviceProvider; //@synthesize serviceProvider=_serviceProvider - In the implementation block @property (nonatomic,retain) AXFrontBoardProcessWatcher * processWatcher; //@synthesize processWatcher=_processWatcher - In the implementation block +(id)sharedInstance; +(void)initialize; -(void)setClient:(AXIPCClient *)arg1 ; -(void)dealloc; -(id)init; -(AXIPCServer *)server; -(AXPineBoardServiceProvider *)serviceProvider; -(AXIPCClient *)client; -(void)setServer:(AXIPCServer *)arg1 ; -(void)_updateAccessibilityProductStatus; -(void)_startSystemAppServerIfNeeded; -(void)setProcessWatcher:(AXFrontBoardProcessWatcher *)arg1 ; -(void)setAxEnabledNotificationObserverToken:(id)arg1 ; -(id)axEnabledNotificationObserverToken; -(id)_openSiri:(id)arg1 ; -(id)_dismissSiri:(id)arg1 ; -(id)_isSiriVisible:(id)arg1 ; -(id)_isAppSwitcherVisible:(id)arg1 ; -(id)_sytemAppPID:(id)arg1 ; -(id)_isScreenSaverVisible:(id)arg1 ; -(id)_isNowPlayingUIVisible:(id)arg1 ; -(id)_isSoftwareUpdateUIVisible:(id)arg1 ; -(id)_isSiriTalkingOrListening:(id)arg1 ; -(id)_isReceivingAirPlay:(id)arg1 ; -(id)_wakeUpDeviceIfNecessary:(id)arg1 ; -(BOOL)isSystemAppServerRunning; -(void)setSystemAppServerRunning:(BOOL)arg1 ; -(AXFrontBoardProcessWatcher *)processWatcher; -(void)setServiceProvider:(AXPineBoardServiceProvider *)arg1 ; @end
49.032787
217
0.760281
c54e9474b7af44d238e3d9cf13d4f668b548312d
11,269
h
C
external/libtorch/libtorch/include/caffe2/core/workspace.h
yngtodd/metaltorch
823a2e56526c34d8687992ed4feae992e79ebbac
[ "MIT" ]
15
2019-08-10T02:36:38.000Z
2021-07-14T13:45:32.000Z
external/libtorch/libtorch/include/caffe2/core/workspace.h
yngtodd/metaltorch
823a2e56526c34d8687992ed4feae992e79ebbac
[ "MIT" ]
7
2019-10-21T03:08:51.000Z
2022-03-11T23:54:28.000Z
pytorch/caffe2/core/workspace.h
raghavnauhria/whatmt
c20483a437c82936cb0fb8080925e37b9c4bba87
[ "MIT" ]
5
2019-09-27T02:41:40.000Z
2021-11-05T20:40:49.000Z
#ifndef CAFFE2_CORE_WORKSPACE_H_ #define CAFFE2_CORE_WORKSPACE_H_ #include "caffe2/core/common.h" #include "caffe2/core/observer.h" #include <climits> #include <cstddef> #include <mutex> #include <typeinfo> #include <unordered_set> #include <vector> #include "c10/util/Registry.h" #include "caffe2/core/blob.h" #include "caffe2/core/net.h" #include "caffe2/proto/caffe2_pb.h" #include "caffe2/utils/signal_handler.h" #include "caffe2/utils/threadpool/ThreadPool.h" C10_DECLARE_bool(caffe2_print_blob_sizes_at_exit); namespace caffe2 { class NetBase; struct CAFFE2_API StopOnSignal { StopOnSignal() : handler_(std::make_shared<SignalHandler>( SignalHandler::Action::STOP, SignalHandler::Action::STOP)) {} StopOnSignal(const StopOnSignal& other) : handler_(other.handler_) {} bool operator()(int /*iter*/) { return handler_->CheckForSignals() != SignalHandler::Action::STOP; } std::shared_ptr<SignalHandler> handler_; }; /** * Workspace is a class that holds all the related objects created during * runtime: (1) all blobs, and (2) all instantiated networks. It is the owner of * all these objects and deals with the scaffolding logistics. */ class CAFFE2_API Workspace { public: typedef std::function<bool(int)> ShouldContinue; typedef CaffeMap<string, unique_ptr<Blob> > BlobMap; typedef CaffeMap<string, unique_ptr<NetBase> > NetMap; /** * Initializes an empty workspace. */ Workspace() : Workspace(".", nullptr) {} /** * Initializes an empty workspace with the given root folder. * * For any operators that are going to interface with the file system, such * as load operators, they will write things under this root folder given * by the workspace. */ explicit Workspace(const string& root_folder) : Workspace(root_folder, nullptr) {} /** * Initializes a workspace with a shared workspace. * * When we access a Blob, we will first try to access the blob that exists * in the local workspace, and if not, access the blob that exists in the * shared workspace. The caller keeps the ownership of the shared workspace * and is responsible for making sure that its lifetime is longer than the * created workspace. */ explicit Workspace(const Workspace* shared) : Workspace(".", shared) {} /** * Initializes workspace with parent workspace, blob name remapping * (new name -> parent blob name), no other blobs are inherited from * parent workspace */ Workspace( const Workspace* shared, const std::unordered_map<string, string>& forwarded_blobs) : Workspace(".", nullptr) { CAFFE_ENFORCE(shared, "Parent workspace must be specified"); for (const auto& forwarded : forwarded_blobs) { CAFFE_ENFORCE( shared->HasBlob(forwarded.second), "Invalid parent workspace blob: ", forwarded.second); forwarded_blobs_[forwarded.first] = std::make_pair(shared, forwarded.second); } } /** * Initializes a workspace with a root folder and a shared workspace. */ Workspace(const string& root_folder, const Workspace* shared) : root_folder_(root_folder), shared_(shared), bookkeeper_(bookkeeper()) { std::lock_guard<std::mutex> guard(bookkeeper_->wsmutex); bookkeeper_->workspaces.insert(this); } ~Workspace() { if (FLAGS_caffe2_print_blob_sizes_at_exit) { PrintBlobSizes(); } // This is why we have a bookkeeper_ shared_ptr instead of a naked static! A // naked static makes us vulnerable to out-of-order static destructor bugs. std::lock_guard<std::mutex> guard(bookkeeper_->wsmutex); bookkeeper_->workspaces.erase(this); } /** * Adds blob mappings from workspace to the blobs from parent workspace. * Creates blobs under possibly new names that redirect read/write operations * to the blobs in the parent workspace. * Arguments: * parent - pointer to parent workspace * forwarded_blobs - map from new blob name to blob name in parent's * workspace skip_defined_blob - if set skips blobs with names that already * exist in the workspace, otherwise throws exception */ void AddBlobMapping( const Workspace* parent, const std::unordered_map<string, string>& forwarded_blobs, bool skip_defined_blobs = false); /** * Converts previously mapped tensor blobs to local blobs, copies values from * parent workspace blobs into new local blobs. Ignores undefined blobs. */ template <class Context> void CopyForwardedTensors(const std::unordered_set<std::string>& blobs) { for (const auto& blob : blobs) { if (!forwarded_blobs_.count(blob)) { continue; } const auto& ws_blob = forwarded_blobs_[blob]; const auto* parent_ws = ws_blob.first; auto* from_blob = parent_ws->GetBlob(ws_blob.second); CAFFE_ENFORCE(from_blob); CAFFE_ENFORCE( from_blob->template IsType<Tensor>(), "Expected blob with tensor value", ws_blob.second); forwarded_blobs_.erase(blob); auto* to_blob = CreateBlob(blob); CAFFE_ENFORCE(to_blob); const auto& from_tensor = from_blob->template Get<Tensor>(); auto* to_tensor = BlobGetMutableTensor(to_blob, Context::GetDeviceType()); to_tensor->CopyFrom(from_tensor); } } /** * Return list of blobs owned by this Workspace, not including blobs * shared from parent workspace. */ vector<string> LocalBlobs() const; /** * Return a list of blob names. This may be a bit slow since it will involve * creation of multiple temp variables. For best performance, simply use * HasBlob() and GetBlob(). */ vector<string> Blobs() const; /** * Return the root folder of the workspace. */ const string& RootFolder() { return root_folder_; } /** * Checks if a blob with the given name is present in the current workspace. */ inline bool HasBlob(const string& name) const { // First, check the local workspace, // Then, check the forwarding map, then the parent workspace if (blob_map_.count(name)) { return true; } else if (forwarded_blobs_.count(name)) { const auto parent_ws = forwarded_blobs_.at(name).first; const auto& parent_name = forwarded_blobs_.at(name).second; return parent_ws->HasBlob(parent_name); } else if (shared_) { return shared_->HasBlob(name); } return false; } void PrintBlobSizes(); /** * Creates a blob of the given name. The pointer to the blob is returned, but * the workspace keeps ownership of the pointer. If a blob of the given name * already exists, the creation is skipped and the existing blob is returned. */ Blob* CreateBlob(const string& name); /** * Similar to CreateBlob(), but it creates a blob in the local workspace even * if another blob with the same name already exists in the parent workspace * -- in such case the new blob hides the blob in parent workspace. If a blob * of the given name already exists in the local workspace, the creation is * skipped and the existing blob is returned. */ Blob* CreateLocalBlob(const string& name); /** * Remove the blob of the given name. Return true if removed and false if * not exist. * Will NOT remove from the shared workspace. */ bool RemoveBlob(const string& name); /** * Gets the blob with the given name as a const pointer. If the blob does not * exist, a nullptr is returned. */ const Blob* GetBlob(const string& name) const; /** * Gets the blob with the given name as a mutable pointer. If the blob does * not exist, a nullptr is returned. */ Blob* GetBlob(const string& name); /** * Renames a local workspace blob. If blob is not found in the local blob list * or if the target name is already present in local or any parent blob list * the function will throw. */ Blob* RenameBlob(const string& old_name, const string& new_name); /** * Creates a network with the given NetDef, and returns the pointer to the * network. If there is anything wrong during the creation of the network, a * nullptr is returned. The Workspace keeps ownership of the pointer. * * If there is already a net created in the workspace with the given name, * CreateNet will overwrite it if overwrite=true is specified. Otherwise, an * exception is thrown. */ NetBase* CreateNet(const NetDef& net_def, bool overwrite = false); NetBase* CreateNet( const std::shared_ptr<const NetDef>& net_def, bool overwrite = false); /** * Gets the pointer to a created net. The workspace keeps ownership of the * network. */ NetBase* GetNet(const string& net_name); /** * Deletes the instantiated network with the given name. */ void DeleteNet(const string& net_name); /** * Finds and runs the instantiated network with the given name. If the network * does not exist or there are errors running the network, the function * returns false. */ bool RunNet(const string& net_name); /** * Returns a list of names of the currently instantiated networks. */ vector<string> Nets() const { vector<string> names; for (auto& entry : net_map_) { names.push_back(entry.first); } return names; } /** * Runs a plan that has multiple nets and execution steps. */ bool RunPlan(const PlanDef& plan_def, ShouldContinue should_continue = StopOnSignal{}); /* * Returns a CPU threadpool instace for parallel execution of * work. The threadpool is created lazily; if no operators use it, * then no threadpool will be created. */ ThreadPool* GetThreadPool(); // RunOperatorOnce and RunNetOnce runs an operator or net once. The difference // between RunNet and RunNetOnce lies in the fact that RunNet allows you to // have a persistent net object, while RunNetOnce creates a net and discards // it on the fly - this may make things like database read and random number // generators repeat the same thing over multiple calls. bool RunOperatorOnce(const OperatorDef& op_def); bool RunNetOnce(const NetDef& net_def); /** * Applies a function f on each workspace that currently exists. * * This function is thread safe and there is no race condition between * workspaces being passed to f in this thread and destroyed in another. */ template <typename F> static void ForEach(F f) { auto bk = bookkeeper(); std::lock_guard<std::mutex> guard(bk->wsmutex); for (Workspace* ws : bk->workspaces) { f(ws); } } public: std::atomic<int> last_failed_op_net_position{}; private: struct Bookkeeper { std::mutex wsmutex; std::unordered_set<Workspace*> workspaces; }; static std::shared_ptr<Bookkeeper> bookkeeper(); BlobMap blob_map_; NetMap net_map_; const string root_folder_; const Workspace* shared_; std::unordered_map<string, std::pair<const Workspace*, string>> forwarded_blobs_; std::unique_ptr<ThreadPool> thread_pool_; std::mutex thread_pool_creation_mutex_; std::shared_ptr<Bookkeeper> bookkeeper_; C10_DISABLE_COPY_AND_ASSIGN(Workspace); }; } // namespace caffe2 #endif // CAFFE2_CORE_WORKSPACE_H_
33.439169
80
0.697045
5ca193f7f68563e3ce98d44b701f666b7f06fbdc
865
h
C
ionGraphicsGL/CRenderTarget.h
iondune/ionEngine
7ce3394dafbabf0e0bb9f5d07dbfae31161800d4
[ "MIT" ]
36
2015-06-28T14:53:06.000Z
2021-10-31T04:26:53.000Z
ionGraphicsGL/CRenderTarget.h
iondune/ionEngine
7ce3394dafbabf0e0bb9f5d07dbfae31161800d4
[ "MIT" ]
90
2015-05-01T07:21:43.000Z
2017-08-30T01:16:41.000Z
ionGraphicsGL/CRenderTarget.h
iondune/ionEngine
7ce3394dafbabf0e0bb9f5d07dbfae31161800d4
[ "MIT" ]
9
2016-04-08T07:48:02.000Z
2019-07-22T15:13:53.000Z
#pragma once #include <ionCore.h> #include <ionMath.h> #include <ionGraphics.h> #include <ionWindow.h> namespace ion { namespace Graphics { namespace GL { class CRenderTarget : public virtual IRenderTarget { public: CRenderTarget(CWindow * Window); void ClearColor(); void ClearDepth(); void ClearColorAndDepth(); void SetClearColor(color4f const & Color); virtual CImage * ReadImage(); virtual void Bind(); virtual IRenderTarget * GetCurrentlyBound(); CWindow * Window = nullptr; color4f Color; vec2i ViewportMin; vec2i ViewportMax; bool SpecifiedViewport = false; virtual void SetViewport(vec2i const & Min, vec2i const & Max); virtual void ClearViewport(); static CRenderTarget * CurrentlyBound; }; } } }
16.960784
68
0.630058
6841bc4185cd32dfe3949b30e3a7fe1632b16e31
1,017
c
C
tools/discoverer_acceptance_tests.c
oniboni/cgreen
21b03e016343896b1a574db26542c4fc98818cc8
[ "0BSD" ]
167
2015-08-31T22:35:28.000Z
2022-03-02T15:48:06.000Z
tools/discoverer_acceptance_tests.c
oniboni/cgreen
21b03e016343896b1a574db26542c4fc98818cc8
[ "0BSD" ]
246
2015-09-01T23:46:59.000Z
2022-03-28T13:50:55.000Z
tools/discoverer_acceptance_tests.c
oniboni/cgreen
21b03e016343896b1a574db26542c4fc98818cc8
[ "0BSD" ]
63
2015-09-01T03:23:02.000Z
2022-02-12T19:05:42.000Z
#include <cgreen/cgreen.h> #include "discoverer.h" #include <stdio.h> Describe(Discoverer); BeforeEach(Discoverer) {} AfterEach(Discoverer) {} static bool verbose = false; static int count_tests_in(const char *filename) { char command[1000]; sprintf(command, "/usr/bin/nm '%s'", filename); FILE *nm_output = popen(command, "r"); char line[10000]; int count = 0; while (fgets(line, sizeof(line), nm_output) != 0) { if (strstr(line, CGREEN_SPEC_PREFIX CGREEN_SEPARATOR) != NULL) count++; } return count; } Ensure(Discoverer, reads_a_library_and_finds_the_tests) { char filename[] = "libdiscoverer_unit_tests.so"; CgreenVector *tests = discover_tests_in(filename, verbose); assert_that(cgreen_vector_size(tests), is_equal_to(count_tests_in(filename))); } TestSuite *discoverer_acceptance_tests(void) { TestSuite *suite = create_test_suite(); add_test_with_context(suite, Discoverer, reads_a_library_and_finds_the_tests); return suite; }
27.486486
82
0.709931
e709a46e3aa6a8b99013ac366b6d0c366be279ef
7,318
c
C
hmi_sdk/hmi_sdk/Tools/ffmpeg-2.6.2/libavcodec/h264chroma_template.c
APCVSRepo/android_packet
5d4237234656b777cd9b0cae4731afea51986582
[ "BSD-3-Clause" ]
4
2016-09-21T12:36:24.000Z
2020-10-29T01:45:03.000Z
hmi_sdk/hmi_sdk/Tools/ffmpeg-2.6.2/libavcodec/h264chroma_template.c
APCVSRepo/android_packet
5d4237234656b777cd9b0cae4731afea51986582
[ "BSD-3-Clause" ]
7
2016-06-01T01:21:44.000Z
2017-11-03T08:18:23.000Z
hmi_sdk/hmi_sdk/Tools/ffmpeg-2.6.2/libavcodec/h264chroma_template.c
APCVSRepo/android_packet
5d4237234656b777cd9b0cae4731afea51986582
[ "BSD-3-Clause" ]
8
2017-08-29T10:51:50.000Z
2021-03-24T10:19:11.000Z
/* * Copyright (c) 2000, 2001 Fabrice Bellard * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at> * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "libavutil/avassert.h" #include "bit_depth_template.c" #define H264_CHROMA_MC(OPNAME, OP)\ static void FUNCC(OPNAME ## h264_chroma_mc1)(uint8_t *_dst/*align 8*/, uint8_t *_src/*align 1*/, int stride, int h, int x, int y){\ pixel *dst = (pixel*)_dst;\ pixel *src = (pixel*)_src;\ const int A=(8-x)*(8-y);\ const int B=( x)*(8-y);\ const int C=(8-x)*( y);\ const int D=( x)*( y);\ int i;\ stride >>= sizeof(pixel)-1;\ \ av_assert2(x<8 && y<8 && x>=0 && y>=0);\ \ if(D){\ for(i=0; i<h; i++){\ OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\ dst+= stride;\ src+= stride;\ }\ } else if (B + C) {\ const int E= B+C;\ const int step= C ? stride : 1;\ for(i=0; i<h; i++){\ OP(dst[0], (A*src[0] + E*src[step+0]));\ dst+= stride;\ src+= stride;\ }\ } else {\ for(i=0; i<h; i++){\ OP(dst[0], (A*src[0]));\ dst+= stride;\ src+= stride;\ }\ }\ }\ static void FUNCC(OPNAME ## h264_chroma_mc2)(uint8_t *_dst/*align 8*/, uint8_t *_src/*align 1*/, int stride, int h, int x, int y){\ pixel *dst = (pixel*)_dst;\ pixel *src = (pixel*)_src;\ const int A=(8-x)*(8-y);\ const int B=( x)*(8-y);\ const int C=(8-x)*( y);\ const int D=( x)*( y);\ int i;\ stride >>= sizeof(pixel)-1;\ \ av_assert2(x<8 && y<8 && x>=0 && y>=0);\ \ if(D){\ for(i=0; i<h; i++){\ OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\ OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\ dst+= stride;\ src+= stride;\ }\ } else if (B + C) {\ const int E= B+C;\ const int step= C ? stride : 1;\ for(i=0; i<h; i++){\ OP(dst[0], (A*src[0] + E*src[step+0]));\ OP(dst[1], (A*src[1] + E*src[step+1]));\ dst+= stride;\ src+= stride;\ }\ } else {\ for ( i = 0; i < h; i++){\ OP(dst[0], A * src[0]);\ OP(dst[1], A * src[1]);\ dst += stride;\ src += stride;\ }\ }\ }\ \ static void FUNCC(OPNAME ## h264_chroma_mc4)(uint8_t *_dst/*align 8*/, uint8_t *_src/*align 1*/, int stride, int h, int x, int y){\ pixel *dst = (pixel*)_dst;\ pixel *src = (pixel*)_src;\ const int A=(8-x)*(8-y);\ const int B=( x)*(8-y);\ const int C=(8-x)*( y);\ const int D=( x)*( y);\ int i;\ stride >>= sizeof(pixel)-1;\ \ av_assert2(x<8 && y<8 && x>=0 && y>=0);\ \ if(D){\ for(i=0; i<h; i++){\ OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\ OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\ OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3]));\ OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4]));\ dst+= stride;\ src+= stride;\ }\ } else if (B + C) {\ const int E= B+C;\ const int step= C ? stride : 1;\ for(i=0; i<h; i++){\ OP(dst[0], (A*src[0] + E*src[step+0]));\ OP(dst[1], (A*src[1] + E*src[step+1]));\ OP(dst[2], (A*src[2] + E*src[step+2]));\ OP(dst[3], (A*src[3] + E*src[step+3]));\ dst+= stride;\ src+= stride;\ }\ } else {\ for ( i = 0; i < h; i++){\ OP(dst[0], A * src[0]);\ OP(dst[1], A * src[1]);\ OP(dst[2], A * src[2]);\ OP(dst[3], A * src[3]);\ dst += stride;\ src += stride;\ }\ }\ }\ \ static void FUNCC(OPNAME ## h264_chroma_mc8)(uint8_t *_dst/*align 8*/, uint8_t *_src/*align 1*/, int stride, int h, int x, int y){\ pixel *dst = (pixel*)_dst;\ pixel *src = (pixel*)_src;\ const int A=(8-x)*(8-y);\ const int B=( x)*(8-y);\ const int C=(8-x)*( y);\ const int D=( x)*( y);\ int i;\ stride >>= sizeof(pixel)-1;\ \ av_assert2(x<8 && y<8 && x>=0 && y>=0);\ \ if(D){\ for(i=0; i<h; i++){\ OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\ OP(dst[1], (A*src[1] + B*src[2] + C*src[stride+1] + D*src[stride+2]));\ OP(dst[2], (A*src[2] + B*src[3] + C*src[stride+2] + D*src[stride+3]));\ OP(dst[3], (A*src[3] + B*src[4] + C*src[stride+3] + D*src[stride+4]));\ OP(dst[4], (A*src[4] + B*src[5] + C*src[stride+4] + D*src[stride+5]));\ OP(dst[5], (A*src[5] + B*src[6] + C*src[stride+5] + D*src[stride+6]));\ OP(dst[6], (A*src[6] + B*src[7] + C*src[stride+6] + D*src[stride+7]));\ OP(dst[7], (A*src[7] + B*src[8] + C*src[stride+7] + D*src[stride+8]));\ dst+= stride;\ src+= stride;\ }\ } else if (B + C) {\ const int E= B+C;\ const int step= C ? stride : 1;\ for(i=0; i<h; i++){\ OP(dst[0], (A*src[0] + E*src[step+0]));\ OP(dst[1], (A*src[1] + E*src[step+1]));\ OP(dst[2], (A*src[2] + E*src[step+2]));\ OP(dst[3], (A*src[3] + E*src[step+3]));\ OP(dst[4], (A*src[4] + E*src[step+4]));\ OP(dst[5], (A*src[5] + E*src[step+5]));\ OP(dst[6], (A*src[6] + E*src[step+6]));\ OP(dst[7], (A*src[7] + E*src[step+7]));\ dst+= stride;\ src+= stride;\ }\ } else {\ for ( i = 0; i < h; i++){\ OP(dst[0], A * src[0]);\ OP(dst[1], A * src[1]);\ OP(dst[2], A * src[2]);\ OP(dst[3], A * src[3]);\ OP(dst[4], A * src[4]);\ OP(dst[5], A * src[5]);\ OP(dst[6], A * src[6]);\ OP(dst[7], A * src[7]);\ dst += stride;\ src += stride;\ }\ }\ } #define op_avg(a, b) a = (((a)+(((b) + 32)>>6)+1)>>1) #define op_put(a, b) a = (((b) + 32)>>6) H264_CHROMA_MC(put_ , op_put) H264_CHROMA_MC(avg_ , op_avg) #undef op_avg #undef op_put
35.524272
132
0.440558
a600232b3aca661e62e606c9837285ddb15f5f7a
80,956
c
C
projects/renesas/vendors/renesas/rx_driver_package/v125/r_usb_basic/src/driver/r_usb_usbif_api.c
renesas/rx72n-envision-kit
313cf0c314e20d7e573df712d284d1fea9fec808
[ "MIT" ]
7
2020-05-31T15:53:27.000Z
2022-03-08T00:12:23.000Z
vendors/renesas/boards/rx72n-envision-kit/aws_demos/src/smc_gen/r_usb_basic/src/driver/r_usb_usbif_api.c
renesas/rx72n-envision-kit
313cf0c314e20d7e573df712d284d1fea9fec808
[ "MIT" ]
4
2020-09-15T05:55:48.000Z
2021-05-13T10:39:26.000Z
vendors/renesas/boards/rx72n-envision-kit/aws_demos/src/smc_gen/r_usb_basic/src/driver/r_usb_usbif_api.c
renesas/rx72n-envision-kit
313cf0c314e20d7e573df712d284d1fea9fec808
[ "MIT" ]
2
2020-08-01T14:55:33.000Z
2020-09-11T23:27:28.000Z
/*********************************************************************************************************************** * DISCLAIMER * This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No * other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all * applicable laws, including copyright laws. * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM * EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES * SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS * SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. * Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of * this software. By using this software, you agree to the additional terms and conditions found by accessing the * following link: * http://www.renesas.com/disclaimer * * Copyright (C) 2016(2020) Renesas Electronics Corporation. All rights reserved. ***********************************************************************************************************************/ /*********************************************************************************************************************** * File Name : r_usb_usbif_api.c * Description : USB Host and Peripheral Driver API code. HCD(Host Control Driver) PCD (Peripheral Control Driver) ***********************************************************************************************************************/ /********************************************************************************************************************** * History : DD.MM.YYYY Version Description * : 30.09.2015 1.00 First Release * : 30.09.2017 1.22 Update Argument Checking * : 31.03.2018 1.23 Supporting Smart Configurator * : 16.11.2018 1.24 Supporting RTOS Thread safe * : 31.05.2019 1.26 Added support for GNUC and ICCRX. * : 30.07.2019 1.27 RX72M is added. * : 01.03.2020 1.30 RX72N/RX66N is added and uITRON is supported. ***********************************************************************************************************************/ /*********************************************************************************************************************** Includes <System Includes> , "Project Includes" ***********************************************************************************************************************/ #include <string.h> #include "r_usb_basic_if.h" #include "r_usb_typedef.h" #include "r_usb_extern.h" #include "r_usb_bitdefine.h" #include "r_usb_reg_access.h" #include "r_usb_basic_config.h" #if (BSP_CFG_RTOS_USED == 4) /* Renesas RI600V4 & RI600PX */ #include "r_usb_cstd_rtos.h" #endif /* (BSP_CFG_RTOS_USED == 4) */ #if defined(USB_CFG_HCDC_USE) #include "r_usb_hcdc_if.h" #endif /* defined(USB_CFG_HCDC_USE) */ #if defined(USB_CFG_HHID_USE) #include "r_usb_hhid_if.h" #endif /* defined(USB_CFG_HHID_USE) */ #if defined(USB_CFG_HMSC_USE) #include "r_usb_hmsc_if.h" #endif /* defined(USB_CFG_HMSC_USE) */ #if defined(USB_CFG_PHID_USE) #include "r_usb_phid_if.h" #endif /* defined(USB_CFG_PHID_USE) */ #if defined(USB_CFG_PCDC_USE) #include "r_usb_pcdc_if.h" #endif /* defined(USB_CFG_PCDC_USE) */ /*********************************************************************************************************************** Exported global variables (to be accessed by other files) ***********************************************************************************************************************/ #if (BSP_CFG_RTOS_USED == 0) /* Non-OS */ usb_event_t g_usb_cstd_event; uint16_t g_usb_change_device_state[USB_NUM_USBIP]; #else /*(BSP_CFG_RTOS_USED == 0)*/ usb_ctrl_t g_usb_cstd_event[USB_EVENT_MAX]; usb_callback_t *g_usb_apl_callback; #endif /*(BSP_CFG_RTOS_USED == 0)*/ #if ((USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST) usb_utr_t g_usb_hdata[USB_NUM_USBIP][USB_MAXPIPE_NUM + 1]; #endif /* (USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST */ #if ((USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI) usb_utr_t g_usb_pdata[USB_MAXPIPE_NUM + 1]; #endif /* (USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI */ uint16_t g_usb_usbmode; uint16_t g_usb_open_class[USB_NUM_USBIP]; /*********************************************************************************************************************** Private global variables and functions ***********************************************************************************************************************/ static uint8_t is_init[USB_NUM_USBIP] = { USB_NO, #if USB_NUM_USBIP == 2 USB_NO, #endif }; #if (BSP_CFG_RTOS_USED != 0) /* Use RTOS */ #if ((USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST) static uint8_t gs_usb_suspend_ing[USB_NUM_USBIP] = { USB_NO, #if USB_NUM_USBIP == 2 USB_NO, #endif }; #endif /* (USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST */ static uint8_t gs_usb_resume_ing[USB_NUM_USBIP] = { USB_NO, #if USB_NUM_USBIP == 2 USB_NO, #endif }; #endif /*(BSP_CFG_RTOS_USED != 0)*/ /*********************************************************************************************************************** Renesas Abstracted Peripheral Driver API functions ***********************************************************************************************************************/ /*********************************************************************************************************************** * Function Name: R_USB_GetVersion *******************************************************************************************************************//** * @brief Return API version number * @retval Version number * @details The version number of the USB driver is returned. */ uint32_t R_USB_GetVersion(void) { uint32_t version = 0; version = (USB_VERSION_MAJOR << 16) | USB_VERSION_MINOR; return version; } /*********************************************************************************************************************** End of function R_USB_GetVersion ***********************************************************************************************************************/ #if (BSP_CFG_RTOS_USED == 0) /* Non-OS */ /*********************************************************************************************************************** * Function Name : R_USB_GetEvent *******************************************************************************************************************//** * @brief Get completed USB-related events (Non-OS only) * @param[in] p_ctrl Pointer to usb_ctrl_t structure area * @retval Value of completed USB-related events * @details This function obtains completed USB-related events. * In USB host mode, the device address value of the USB device that completed * an event is specified in the usb_ctrl_t structure member (address) specified * by the event's argument. In USB peripheral mode, USB_NULL is specified in member (address). */ usb_status_t R_USB_GetEvent(usb_ctrl_t *p_ctrl) { usb_status_t event = USB_STS_NONE; usb_cstd_usb_task(); if ( g_usb_cstd_event.write_pointer != g_usb_cstd_event.read_pointer ) { *p_ctrl = g_usb_cstd_event.ctrl[g_usb_cstd_event.read_pointer]; event = g_usb_cstd_event.code[g_usb_cstd_event.read_pointer]; g_usb_cstd_event.read_pointer++; if (g_usb_cstd_event.read_pointer >= USB_EVENT_MAX) { g_usb_cstd_event.read_pointer = 0; } } return event; } /* End of function R_USB_GetEvent() */ #endif /*********************************************************************************************************************** End of function R_USB_GetEvent ***********************************************************************************************************************/ #if (BSP_CFG_RTOS_USED != 0) /* Use RTOS */ /*********************************************************************************************************************** * Function Name : R_USB_Callback *******************************************************************************************************************//** * @brief Register a callback function to be called upon completion of a USB-related event. (RTOS only) * @param[in] p_callback Pointer to the callback function * @details This function registers a callback function to be called when a USB-related event has completed. * When a USB-related event has completed, the USB driver will call the callback function that has been registered * using this API. * @note This API is not supported when using RX100/RX200 series MCU. */ void R_USB_Callback(usb_callback_t *p_callback) { g_usb_apl_callback = p_callback; } /* End of function R_USB_Callback() */ #endif /* (BSP_CFG_RTOS_USED != 0)*/ /*********************************************************************************************************************** * Function Name : R_USB_Open *******************************************************************************************************************//** * @brief Power on the USB module and initialize the USB driver. * (This is a function to be used first when using the USB module.) * @param[in] ctrl Pointer to usb_ctrl_t structure area * @param[in] cfg Pointer to usb_cfg_t structure area * @retval USB_SUCCESS Success * @retval USB_ERR_PARA Parameter error * @retval USB_ERR_BUSY Specified USB module now in use * @details This function applies power to the USB module specified in the argument (p_ctrl). */ usb_err_t R_USB_Open( usb_ctrl_t *ctrl, usb_cfg_t *cfg ) { usb_err_t err; #if ((USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST) usb_utr_t utr; #endif /* (USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST */ #if (BSP_CFG_RTOS_USED > 1) usb_rtos_configuration(); #endif /* (BSP_CFG_RTOS_USED > 1) */ #if USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE /* Argument Checking */ if ((USB_IP0 != ctrl->module) && (USB_IP1 != ctrl->module)) { return USB_ERR_PARA; } if ((( USB_HS != cfg->usb_speed ) && ( USB_FS != cfg->usb_speed )) && ( USB_LS != cfg->usb_speed ) && (USB_HOST != cfg->usb_mode)) { return USB_ERR_PARA; } #if defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX630) || defined(BSP_MCU_RX63T) || defined(BSP_MCU_RX72T)\ || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) if (USB_IP1 == ctrl->module) { return USB_ERR_PARA; } #endif /* #if defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX630) || defined(BSP_MCU_RX63T) || defined(BSP_MCU_RX72T)\ || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) */ #if defined(BSP_MCU_RX63N) if ((USB_IP1 == ctrl->module) && (USB_HOST == cfg->usb_mode)) { return USB_ERR_PARA; } #endif /* #if defined(BSP_MCU_RX63N) */ switch (ctrl->type) { case USB_PCDC: case USB_PHID: case USB_PVND: case USB_PMSC: if (USB_PERI != cfg->usb_mode) { return USB_ERR_PARA; } if ( (USB_LS == cfg->usb_speed) || (USB_NULL == cfg->p_usb_reg) ) { return USB_ERR_PARA; } #if defined(BSP_MCU_RX71M) #if USB_IP0 == USB_CFG_USE_USBIP if (USB_HS == cfg->usb_speed) { return USB_ERR_PARA; } #endif /* USB_IP0 == USB_CFG_USE_USBIP */ #else /* defined(BSP_MCU_RX71M) */ if ( USB_HS == cfg->usb_speed ) { return USB_ERR_PARA; } #endif /* defined(BSP_MCU_RX71M) */ break; /* Host */ case USB_HCDC: case USB_HHID: case USB_HVND: case USB_HMSC: #if defined(BSP_MCU_RX630) return USB_ERR_PARA; #else /* defined(BSP_MCU_RX630) */ if (USB_HOST != cfg->usb_mode) { return USB_ERR_PARA; } #if defined(BSP_MCU_RX71M) if ((USB_HS == cfg->usb_speed) && (USB_IP1 != ctrl->module)) { return USB_ERR_PARA; } #else /* defined(BSP_MCU_RX71M) */ if ( USB_HS == cfg->usb_speed ) { return USB_ERR_PARA; } #endif /* defined(BSP_MCU_RX71M) */ #endif /* defined(BSP_MCU_RX630) */ break; default: return USB_ERR_PARA; break; } #endif /* USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE */ if (USB_YES == is_init[ctrl->module]) { return USB_ERR_BUSY; } #if USB_NUM_USBIP == 2 if ((USB_NO == is_init[USB_IP0]) && (USB_NO == is_init[USB_IP1])) { #endif /* USB_NUM_USBIP == 2 */ memset((void *)&g_usb_cstd_event, 0, sizeof(g_usb_cstd_event)); #if USB_NUM_USBIP == 2 } #endif /* USB_NUM_USBIP == 2 */ is_init[ctrl->module] = USB_YES; g_usb_open_class[ctrl->module] = 0; #if (BSP_CFG_RTOS_USED == 0) g_usb_change_device_state[ctrl->module] = 0; #endif /* BSP_CFG_RTOS_USED == 0 */ #if ((USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST) g_usb_hstd_use_pipe[ctrl->module] = 0; memset((void *)&g_usb_hdata[ctrl->module], 0, sizeof(usb_utr_t)); #endif /* (USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST */ #if ((USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI) memset((void *)&g_usb_pdata, 0, ((USB_MAXPIPE_NUM+1) * sizeof(usb_utr_t))); #endif /* (USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_REPI */ if (USB_HOST == cfg->usb_mode) { #if ((USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST) g_usb_usbmode = USB_HOST; utr.ip = ctrl->module; utr.ipp = usb_hstd_get_usb_ip_adr( (uint8_t)ctrl->module ); /* Get the USB IP base address. */ err = usb_module_start( (uint8_t)utr.ip ); if (USB_SUCCESS == err) { /* USB driver initialization */ usb_hdriver_init( &utr, cfg ); /* Setting MCU(USB interrupt init) register */ usb_cpu_usbint_init((uint8_t)utr.ip); /* Setting USB relation register */ hw_usb_hmodule_init(ctrl); /* MCU */ #if defined(USB_CFG_HHID_USE) if (USB_HHID == ctrl->type) { hw_usb_hset_trnensel(&utr); } #endif /* defined(USB_CFG_HHID_USE) */ #if USB_CFG_TYPEC == USB_CFG_DISABLE usb_hstd_vbus_control(&utr, (uint16_t)USB_VBON); #if USB_CFG_BC == USB_CFG_DISABLE usb_cpu_delay_xms((uint16_t)100); /* 100ms wait */ #endif /* USB_CFG_BC == USB_CFG_DISABLE */ #else /* USB_CFG_TYPEC == USB_CFG_DISABLE */ usb_hstd_vbus_control(&utr, (uint16_t)USB_VBOFF); #endif /* USB_CFG_TYPEC == USB_CFG_DISABLE */ } #endif /* (USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST */ } else { #if ((USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI) g_usb_usbmode = USB_PERI; ctrl->module = USB_CFG_USE_USBIP; /* USB module start setting */ err = usb_module_start(USB_CFG_USE_USBIP); if (USB_SUCCESS == err) { /* USB driver initialization */ usb_pdriver_init( ctrl, cfg ); /* Setting MCU(USB interrupt init) register */ usb_cpu_usbint_init(USB_CFG_USE_USBIP); /* Setting USB relation register */ hw_usb_pmodule_init(); #if defined(BSP_MCU_RX64M) || defined(BSP_MCU_RX71M) if (USB_HS == cfg->usb_speed) { hw_usb_set_hse(USB_NULL); } #endif /* defined(BSP_MCU_RX64M) || defined(BSP_MCU_RX71M) */ if ( USB_ATTACH == usb_pstd_chk_vbsts() ) { #if defined(BSP_MCU_RX64M) || defined(BSP_MCU_RX71M) hw_usb_set_cnen(); #endif /* defined(BSP_MCU_RX64M) || defined(BSP_MCU_RX71M) */ usb_cpu_delay_xms((uint16_t)10); hw_usb_pset_dprpu(); } } #endif /* (USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_REPI */ } if (USB_SUCCESS == err) { g_usb_open_class[ctrl->module] |= (1 << ctrl->type); /* Set USB Open device class */ if (USB_PCDC == ctrl->type) { g_usb_open_class[ctrl->module] |= (1 << USB_PCDCC); /* Set USB Open device class */ } if (USB_HCDC == ctrl->type) { g_usb_open_class[ctrl->module] |= (1 << USB_HCDCC); /* Set USB Open device class */ } } return err; } /*********************************************************************************************************************** End of function R_USB_Open ***********************************************************************************************************************/ /*********************************************************************************************************************** * Function Name : R_USB_Close *******************************************************************************************************************//** * @brief Power off USB module. * @param[in] p_ctrl Pointer to usb_ctrl_t structure area * @retval USB_SUCCESS Success * @retval USB_ERR_PARA Parameter error * @retval USB_ERR_NOT_OPEN USB module is not open. * @details This function applies power to the USB module specified in the argument (p_ctrl). * @note The argument (p_ctrl) is not supported when using RX100/RX200 series MCU. */ usb_err_t R_USB_Close(usb_ctrl_t *p_ctrl) { usb_err_t ret_code; #if ((USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST) usb_utr_t utr; uint8_t class_code = (uint8_t)USB_IFCLS_VEN; #endif /* (USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST */ #if (BSP_CFG_RTOS_USED > 1) usb_rtos_unconfiguration(); #endif /* #if (BSP_CFG_RTOS_USED > 1) */ #if ((USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI) if (USB_PERI == g_usb_usbmode) { p_ctrl->module = USB_CFG_USE_USBIP; } #endif /* USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI */ #if USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE if (USB_NULL == p_ctrl) { return USB_ERR_PARA; } /* Argument Checking */ if ((USB_IP0 != p_ctrl->module) && (USB_IP1 != p_ctrl->module)) { return USB_ERR_PARA; } #if defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX630) || defined(BSP_MCU_RX63T) || defined(BSP_MCU_RX72T)\ || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) if (USB_IP1 == p_ctrl->module) { return USB_ERR_PARA; } #endif /* #if defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX630) || defined(BSP_MCU_RX63T) || defined(BSP_MCU_RX72T)\ || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) */ #if defined(BSP_MCU_RX63N) if ((USB_IP1 == p_ctrl->module) && (USB_HOST == g_usb_usbmode)) { return USB_ERR_PARA; } #endif /* defined(BSP_MCU_RX63N) */ if (USB_HOST == g_usb_usbmode) { #if ((USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST) switch(p_ctrl->type) { case USB_HCDC: class_code = (uint8_t)USB_IFCLS_CDC; break; case USB_HHID: class_code = (uint8_t)USB_IFCLS_HID; break; case USB_HMSC: class_code = (uint8_t)USB_IFCLS_MAS; break; case USB_HVND: class_code = (uint8_t)USB_IFCLS_VEN; break; default: return USB_ERR_PARA; break; } #endif /* (USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST */ } #endif /* USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE */ ret_code = usb_module_stop(p_ctrl->module); if (USB_SUCCESS == ret_code) { is_init[p_ctrl->module] = USB_NO; if (USB_HOST == g_usb_usbmode) { #if ((USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST) utr.ip = p_ctrl->module; utr.ipp = usb_hstd_get_usb_ip_adr(utr.ip); usb_hstd_driver_release(&utr, class_code); #endif /* (USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST */ } else { #if ((USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI) usb_pstd_driver_release(); /* Clear the information registered in the structure usb_pcdreg_t. */ usb_pstd_clr_pipe_table(); #endif /* (USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI */ } #if ((USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI) g_usb_open_class[p_ctrl->module] &= (~(1 << p_ctrl->type)); /* Clear USB Open device class */ if (USB_PCDC == p_ctrl->type) { g_usb_open_class[p_ctrl->module] &= (~(1 << USB_PCDCC)); /* Clear USB Open device class */ } #endif /* USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI */ #if ((USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST) if (USB_HCDC == p_ctrl->type) { g_usb_open_class[p_ctrl->module] &= (~(1 << USB_HCDCC)); /* Clear USB Open device class */ } #endif /* (USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST */ } else { ret_code = USB_ERR_NOT_OPEN; } return ret_code; } /*********************************************************************************************************************** End of function R_USB_Close ***********************************************************************************************************************/ /*********************************************************************************************************************** * Function Name : R_USB_Read *******************************************************************************************************************//** * @brief USB data read request. * @param[in] p_ctrl Pointer to usb_ctrl_t structure area * @param[out] p_buf Pointer to area that stores read data * @param[in] size Read request size * @retval USB_SUCCESS Successfully completed (Data read request completed) * @retval USB_ERR_PARA Parameter error * @retval USB_ERR_BUSY Data receive request already in process for USB device with same device address * @retval USB_ERR_NG Other error * @details Requests USB data read.The read data is stored in the area specified by argument (p_buf) */ usb_err_t R_USB_Read(usb_ctrl_t *p_ctrl, uint8_t *p_buf, uint32_t size) { usb_info_t info; usb_er_t err; usb_err_t result = USB_ERR_NG; #if ((USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI) if (USB_PERI == g_usb_usbmode) { p_ctrl->module = USB_CFG_USE_USBIP; } #endif /* USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI */ #if USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE if (((USB_NULL == p_ctrl) || (USB_NULL == p_buf)) || (USB_NULL == size)) { return USB_ERR_PARA; } /* Argument Checking */ if ((USB_IP0 != p_ctrl->module) && (USB_IP1 != p_ctrl->module) && ( USB_HOST == g_usb_usbmode)) { return USB_ERR_PARA; } #if defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX630) || defined(BSP_MCU_RX63T) || defined(BSP_MCU_RX72T)\ || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) if (USB_IP1 == p_ctrl->module) { return USB_ERR_PARA; } #endif /* defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX630) || defined(BSP_MCU_RX63T) || defined(BSP_MCU_RX72T)\ || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) */ #if defined(BSP_MCU_RX63N) if (USB_IP1 == p_ctrl->module && ( USB_HOST == g_usb_usbmode)) { return USB_ERR_PARA; } #endif if ((USB_PCDCC == p_ctrl->type) || (USB_PVND == p_ctrl->type) || (USB_HVND == p_ctrl->type) || (USB_HMSC == p_ctrl->type) || (USB_PMSC == p_ctrl->type)) { return USB_ERR_PARA; } if (USB_REQUEST != p_ctrl->type) { if (USB_NULL == (g_usb_open_class[p_ctrl->module] & (1 << p_ctrl->type))) /* Check USB Open device class */ { return USB_ERR_PARA; } } #endif /* USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE */ R_USB_GetInformation(p_ctrl, &info); if (USB_STS_CONFIGURED == info.status) { if (USB_REQUEST == p_ctrl->type) { err = usb_ctrl_read( p_ctrl, p_buf, size ); } else { err = usb_data_read( p_ctrl, p_buf, size ); } if (USB_OK == err) { result = USB_SUCCESS; } else if (USB_QOVR == err) { result = USB_ERR_BUSY; } else { /* Noting */ } } return result; } /*********************************************************************************************************************** End of function R_USB_Read ***********************************************************************************************************************/ /*********************************************************************************************************************** * Function Name : R_USB_Write *******************************************************************************************************************//** * @brief USB data write request. * @param[in] p_ctrl Pointer to usb_ctrl_t structure area * @param[in] p_buf Pointer to area that stores read data * @param[in] size Write request size * @retval USB_SUCCESS Successfully completed (Data write request completed) * @retval USB_ERR_PARA Parameter error * @retval USB_ERR_BUSY Data write request already in process for USB device with same device address * @retval USB_ERR_NG Other error * @details Requests USB data write.Stores write data in area specified by argument (p_buf). */ usb_err_t R_USB_Write(usb_ctrl_t *p_ctrl, uint8_t *p_buf, uint32_t size) { usb_info_t info; usb_er_t err; usb_err_t result = USB_ERR_NG; #if ((USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI) if (USB_PERI == g_usb_usbmode) { p_ctrl->module = USB_CFG_USE_USBIP; } #endif /* USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI */ #if USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE if ((USB_NULL == p_ctrl) || ((USB_NULL == p_buf) && (0 != size))) { return USB_ERR_PARA; } /* Argument Checking */ if ((USB_IP0 != p_ctrl->module) && (USB_IP1 != p_ctrl->module) && ( USB_HOST == g_usb_usbmode)) { return USB_ERR_PARA; } #if defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX630) || defined(BSP_MCU_RX63T) || defined(BSP_MCU_RX72T)\ || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) if (USB_IP1 == p_ctrl->module) { return USB_ERR_PARA; } #endif /* defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX630) || defined(BSP_MCU_RX63T) || defined(BSP_MCU_RX72T)\ || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) */ #if defined(BSP_MCU_RX63N) if (USB_IP1 == p_ctrl->module && ( USB_HOST == g_usb_usbmode)) { return USB_ERR_PARA; } #endif if ((USB_HCDCC == p_ctrl->type) || (USB_PVND == p_ctrl->type) || (USB_HVND == p_ctrl->type) || (USB_HMSC == p_ctrl->type) || (USB_PMSC == p_ctrl->type)) { return USB_ERR_PARA; } if (USB_REQUEST != p_ctrl->type) { if (USB_NULL == (g_usb_open_class[p_ctrl->module] & (1 << p_ctrl->type))) /* Check USB Open device class */ { return USB_ERR_PARA; } } #endif /* USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE */ R_USB_GetInformation(p_ctrl, &info); if (USB_STS_CONFIGURED == info.status) { if (USB_REQUEST == p_ctrl->type) { err = usb_ctrl_write( p_ctrl, p_buf, size ); } else { err = usb_data_write( p_ctrl, p_buf, size ); } if (USB_OK == err) { result = USB_SUCCESS; } else if (USB_QOVR == err) { result = USB_ERR_BUSY; } else { /* error */ } } return result; } /*********************************************************************************************************************** End of function R_USB_Write ***********************************************************************************************************************/ /*********************************************************************************************************************** * Function Name : R_USB_Stop *******************************************************************************************************************//** * @brief USB data read/write stop request * @param[in] p_ctrl Pointer to usb_ctrl_t structure area * @param[in] type Receive (USB_READ) or send (USB_WRITE) * @retval USB_SUCCESS Successfully completed (stop completed) * @retval USB_ERR_PARA Parameter error * @retval USB_ERR_NG Other error * @details This function is used to request a data read/write transfer be terminated when a data read/write transfer * is performing. To stop a data read, set USB_READ as the argument (type); to stop a data write, * specify USB_WRITE as the argument (type). */ usb_err_t R_USB_Stop(usb_ctrl_t *p_ctrl, uint16_t type) { usb_info_t info; usb_er_t err; #if ((USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI) if (USB_PERI == g_usb_usbmode) { p_ctrl->module = USB_CFG_USE_USBIP; } #endif /* USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI */ #if USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE if (USB_NULL == p_ctrl) { return USB_ERR_PARA; } if ((USB_WRITE != type) && (USB_READ != type)) { return USB_ERR_PARA; } /* Argument Checking */ if ((USB_IP0 != p_ctrl->module) && (USB_IP1 != p_ctrl->module) && ( USB_HOST == g_usb_usbmode)) { return USB_ERR_PARA; } #if defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX630) || defined(BSP_MCU_RX63T) || defined(BSP_MCU_RX72T)\ || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) if (USB_IP1 == p_ctrl->module) { return USB_ERR_PARA; } #endif /* defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX630) || defined(BSP_MCU_RX63T) || defined(BSP_MCU_RX72T)\ || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) */ #if defined(BSP_MCU_RX63N) if (USB_IP1 == p_ctrl->module && ( USB_HOST == g_usb_usbmode)) { return USB_ERR_PARA; } #endif if ((USB_PVND == p_ctrl->type) || (USB_HVND == p_ctrl->type) || (USB_HMSC == p_ctrl->type) || (USB_PMSC == p_ctrl->type)) { return USB_ERR_PARA; } if (((USB_HCDCC == p_ctrl->type) && (USB_WRITE == type)) || ((USB_PCDCC == p_ctrl->type ) && (USB_READ == type))) { return USB_ERR_PARA; } #endif /* USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE */ err = R_USB_GetInformation(p_ctrl, &info); if (USB_STS_CONFIGURED != info.status) { return USB_ERR_NG; } if (USB_REQUEST == p_ctrl->type) { err = usb_ctrl_stop( p_ctrl); } else { err = usb_data_stop( p_ctrl, type); } if (USB_OK == err) { return USB_SUCCESS; } else if (USB_QOVR == err) { return USB_ERR_BUSY; } else { /* error */ } return USB_ERR_NG; } /*********************************************************************************************************************** End of function R_USB_Stop ***********************************************************************************************************************/ /*********************************************************************************************************************** * Function Name : R_USB_Suspend *******************************************************************************************************************//** * @brief Suspend signal transmission * @param[in] p_ctrl Pointer to usb_ctrl_t structure area * @retval USB_SUCCESS Successfully completed * @retval USB_ERR_PARA Parameter error * @retval USB_ERR_BUSY During a suspend request to the specified USB module, or when the USB module is already * in the suspended state * @retval USB_ERR_NG Other error * @details This function sends a SUSPEND signal from the USB module assigned to the member (module) * of the usb_crtl_t structure. * @note The argument (p_ctrl) is not supported when using RX100/RX200 series MCU. */ usb_err_t R_USB_Suspend(usb_ctrl_t *p_ctrl) { #if USB_CFG_MODE == USB_CFG_PERI return USB_ERR_NG; /* Support Host only. */ #else /* USB_CFG_MODE == USB_CFG_PERI */ usb_err_t ret_code = USB_SUCCESS; #if ((USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST) usb_utr_t utr; usb_info_t info; usb_er_t err; #endif /* (USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST */ if (USB_PERI == g_usb_usbmode) { return USB_ERR_NG; /* Support Host only. */ } #if USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE /* Argument Checking */ if ((USB_IP0 != p_ctrl->module) && (USB_IP1 != p_ctrl->module)) { return USB_ERR_PARA; } #if defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX630) || defined(BSP_MCU_RX63T) || defined(BSP_MCU_RX72T)\ || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) if (USB_IP1 == p_ctrl->module) { return USB_ERR_PARA; } #endif /* defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX630) || defined(BSP_MCU_RX63T) || defined(BSP_MCU_RX72T)\ || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) */ #if defined(BSP_MCU_RX63N) if ((USB_IP1 == p_ctrl->module) && (USB_HOST == g_usb_usbmode)) { return USB_ERR_PARA; } #endif #endif /* USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE */ #if ((USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST) #if USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE if (USB_NULL == p_ctrl) { return USB_ERR_PARA; } #endif /* USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE */ p_ctrl->address = USB_DEVICEADDR; R_USB_GetInformation(p_ctrl, &info); if (USB_STS_CONFIGURED != info.status) { return USB_ERR_NG; } utr.ip = p_ctrl->module; utr.ipp = usb_hstd_get_usb_ip_adr(utr.ip); #if (BSP_CFG_RTOS_USED == 0) /* Non-OS */ if (USB_NULL != (g_usb_change_device_state[p_ctrl->module] & (1 << USB_STS_SUSPEND))) { return USB_ERR_BUSY; } err = usb_hstd_change_device_state(&utr, (usb_cb_t)&usb_hstd_suspend_complete, USB_DO_GLOBAL_SUSPEND, USB_DEVICEADDR); if (USB_OK == err) { g_usb_change_device_state[p_ctrl->module] |= (1 << USB_STS_SUSPEND); } else { ret_code = USB_ERR_NG; } #else /* (BSP_CFG_RTOS_USED == 0) */ if (USB_YES == gs_usb_suspend_ing[p_ctrl->module]) { return USB_ERR_BUSY; } else { gs_usb_suspend_ing[p_ctrl->module] = USB_YES; } err = usb_hstd_change_device_state(&utr, (usb_cb_t)&usb_hstd_suspend_complete, USB_DO_GLOBAL_SUSPEND, USB_DEVICEADDR); if (USB_OK != err) { ret_code = USB_ERR_NG; } gs_usb_suspend_ing[p_ctrl->module] = USB_NO; #endif /* (BSP_CFG_RTOS_USED == 0) */ #endif /* (USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST */ return ret_code; #endif /* USB_CFG_MODE == USB_CFG_PERI */ } /*********************************************************************************************************************** End of function R_USB_Suspend ***********************************************************************************************************************/ /*********************************************************************************************************************** * Function Name : R_USB_Resume *******************************************************************************************************************//** * @brief Resume signal transmission * @param[in] p_ctrl Pointer to usb_ctrl_t structure area * @retval USB_SUCCESS Successfully completed * @retval USB_ERR_PARA Parameter error * @retval USB_ERR_BUSY During a resume request processing * @retval USB_ERR_NOT_SUSPEND USB device is not in the SUSPEND state * @retval USB_ERR_NG USB device is not in a state that can request the remote wakeup (USB peripheral mode only) * @details This function sends a RESUME signal from the USB module assigned to the member (module) of * the usb_ctrl_t structure. * @note The argument (p_ctrl) is not supported when using RX100/RX200 series MCU. */ usb_err_t R_USB_Resume(usb_ctrl_t *p_ctrl) { #if ((USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST) usb_utr_t utr; usb_er_t err; #endif /* (USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST */ usb_err_t ret_code = USB_SUCCESS; usb_info_t info; #if ((USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI) if (USB_PERI == g_usb_usbmode) { p_ctrl->module = USB_CFG_USE_USBIP; } #endif /* USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI */ #if USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE if (USB_NULL == p_ctrl) { return USB_ERR_PARA; } /* Argument Checking */ if ((USB_IP0 != p_ctrl->module) && (USB_IP1 != p_ctrl->module) && ( USB_HOST == g_usb_usbmode)) { return USB_ERR_PARA; } #if defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX630) || defined(BSP_MCU_RX63T) || defined(BSP_MCU_RX72T)\ || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) if (USB_IP1 == p_ctrl->module) { return USB_ERR_PARA; } #endif /* defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX630) || defined(BSP_MCU_RX63T) || defined(BSP_MCU_RX72T)\ || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) */ #if defined(BSP_MCU_RX63N) if ((USB_IP1 == p_ctrl->module) && (USB_HOST == g_usb_usbmode)) { return USB_ERR_PARA; } #endif if (USB_HOST == g_usb_usbmode) { p_ctrl->address = USB_DEVICEADDR; } else { if (USB_PHID != p_ctrl->type) { return USB_ERR_PARA; } } #endif /* USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE */ R_USB_GetInformation(p_ctrl, &info); if (USB_STS_SUSPEND != info.status) { return USB_ERR_NOT_SUSPEND; } if (USB_HOST == g_usb_usbmode) { #if ((USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST) utr.ip = p_ctrl->module; utr.ipp = usb_hstd_get_usb_ip_adr(utr.ip); #if (BSP_CFG_RTOS_USED == 0) /* Non-OS */ if (USB_NULL != (g_usb_change_device_state[p_ctrl->module] & (1 << USB_STS_RESUME))) { return USB_ERR_BUSY; } err = usb_hstd_change_device_state(&utr, (usb_cb_t)&usb_hstd_resume_complete, USB_DO_GLOBAL_RESUME, p_ctrl->address); if (USB_OK == err) { g_usb_change_device_state[p_ctrl->module] |= (1 << USB_STS_RESUME); } else { ret_code = USB_ERR_NG; } #else /* (BSP_CFG_RTOS_USED == 0) */ if (USB_YES == gs_usb_resume_ing[p_ctrl->module]) { return USB_ERR_BUSY; } else { gs_usb_resume_ing[p_ctrl->module] = USB_YES; } err = usb_hstd_change_device_state(&utr, (usb_cb_t)&usb_hstd_resume_complete, USB_DO_GLOBAL_RESUME, p_ctrl->address); if (USB_OK != err) { ret_code = USB_ERR_NG; } gs_usb_resume_ing[p_ctrl->module] = USB_NO; #endif /* (BSP_CFG_RTOS_USED == 0) */ #endif /* (USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST */ } else { #if ((USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI) #if (BSP_CFG_RTOS_USED == 0) /* Non-OS */ /* Support remote wakeup ? */ if (USB_TRUE == g_usb_pstd_remote_wakeup) { usb_pstd_change_device_state(USB_DO_REMOTEWAKEUP, USB_NULL, (usb_cb_t)usb_pstd_dummy_function); switch (g_usb_pstd_remote_wakeup_state) { case USB_OK: ret_code = USB_SUCCESS; break; case USB_QOVR: ret_code = USB_ERR_NOT_SUSPEND; break; case USB_ERROR: default: ret_code = USB_ERR_NG; break; } } else { ret_code = USB_ERR_NG; } #else /* (BSP_CFG_RTOS_USED == 0) */ if (USB_YES == gs_usb_resume_ing[USB_CFG_USE_USBIP]) { return USB_ERR_BUSY; } else { gs_usb_resume_ing[USB_CFG_USE_USBIP] = USB_YES; } /* Support remote wakeup ? */ if (USB_TRUE == g_usb_pstd_remote_wakeup) { usb_pstd_change_device_state(USB_DO_REMOTEWAKEUP, USB_NULL, (usb_cb_t)usb_pstd_dummy_function); switch (g_usb_pstd_remote_wakeup_state) { case USB_OK: ret_code = USB_SUCCESS; break; case USB_QOVR: ret_code = USB_ERR_NOT_SUSPEND; break; case USB_ERROR: default: ret_code = USB_ERR_NG; break; } } else { ret_code = USB_ERR_NG; } gs_usb_resume_ing[USB_CFG_USE_USBIP] = USB_NO; #endif /* (BSP_CFG_RTOS_USED == 0) */ #else /* (USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI */ ret_code = USB_ERR_NG; #endif /* (USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI */ } return ret_code; } /*********************************************************************************************************************** End of function R_USB_Resume ***********************************************************************************************************************/ /*********************************************************************************************************************** * Function Name : R_USB_VbusSetting *******************************************************************************************************************//** * @brief VBUS Supply Start/Stop Specification * @param[in] p_ctrl Pointer to usb_ctrl_t structure area * @param[in] state VBUS supply start/stop specification * @retval USB_SUCCESS Successful completion (VBUS supply start/stop completed) * @retval USB_ERR_PARA Parameter error * @retval USB_ERR_NG Other Error * @details Specifies starting or stopping the VBUS supply. * @note The argument (p_ctrl) is not supported when using RX100/RX200 series MCU. */ usb_err_t R_USB_VbusSetting( usb_ctrl_t *p_ctrl, uint16_t state ) { #if (USB_CFG_MODE == USB_CFG_PERI) return USB_ERR_NG; #else usb_utr_t utr; if (USB_PERI == g_usb_usbmode) { return USB_ERR_NG; /* Support Host only. */ } #if USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE /* Argument Checking */ if ((USB_IP0 != p_ctrl->module) && (USB_IP1 != p_ctrl->module)) { return USB_ERR_PARA; } #if defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX63N) || defined(BSP_MCU_RX63T) || defined(BSP_MCU_RX72T)\ || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) if (USB_IP1 == p_ctrl->module) { return USB_ERR_PARA; } #endif /* defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX63N) || defined(BSP_MCU_RX63T) || defined(BSP_MCU_RX72T)\ || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) */ if (USB_NULL == p_ctrl) { return USB_ERR_PARA; } if ((USB_ON != state) && (USB_OFF != state)) { return USB_ERR_PARA; } #if defined(BSP_MCU_RX63N) if (USB_IP1 == p_ctrl->module && ( USB_HOST == g_usb_usbmode)) { return USB_ERR_PARA; } #endif #endif /* USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE */ utr.ip = p_ctrl->module; utr.ipp = usb_hstd_get_usb_ip_adr(utr.ip); if (USB_ON == state) { usb_hstd_vbus_control(&utr, (uint16_t)USB_VBON); } else { usb_hstd_vbus_control(&utr, (uint16_t)USB_VBOFF); } return USB_SUCCESS; #endif /* (USB_CFG_MODE == USB_CFG_PERI) */ } /*********************************************************************************************************************** End of function R_USB_VbusSetting ***********************************************************************************************************************/ /*********************************************************************************************************************** * Function Name : R_USB_GetInformation *******************************************************************************************************************//** * @brief Get USB device information * @param[in] p_ctrl Pointer to usb_ctrl_t structure area * @param[in] p_info Pointer to usb_info_t structure area * @retval USB_SUCCESS Successful completion * @retval USB_ERR_PARA Parameter error * @retval USB_ERR_NG Other Error * @details This function gets the USB device information. * @note The argument (p_ctrl) is not supported when using RX100/RX200 series MCU. */ usb_err_t R_USB_GetInformation( usb_ctrl_t *p_ctrl, usb_info_t *p_info) { #if ((USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST) usb_utr_t utr; #endif /* (USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST */ #if ((USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI) uint16_t status; if (USB_PERI == g_usb_usbmode) { p_ctrl->module = USB_CFG_USE_USBIP; } #endif /* USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI */ if (0 == g_usb_open_class[p_ctrl->module]) { return USB_ERR_NG; } #if USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE /* Argument Checking */ if ((USB_IP0 != p_ctrl->module) && (USB_IP1 != p_ctrl->module) && ( USB_HOST == g_usb_usbmode)) { return USB_ERR_PARA; } #if defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX630) || defined(BSP_MCU_RX63T) || defined(BSP_MCU_RX72T)\ || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) if (USB_IP1 == p_ctrl->module) { return USB_ERR_PARA; } #endif /* defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX630) || defined(BSP_MCU_RX63T) || defined(BSP_MCU_RX72T)\ || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) */ #if defined(BSP_MCU_RX63N) if ((USB_IP1 == p_ctrl->module) && (USB_HOST == g_usb_usbmode)) { return USB_ERR_PARA; } #endif if (USB_NULL == p_info) { return USB_ERR_PARA; } #endif /* USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE */ if (USB_HOST == g_usb_usbmode) { #if ((USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST) #if USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE if (USB_NULL == p_ctrl) { return USB_ERR_PARA; } #endif /* USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE */ utr.ip = p_ctrl->module; utr.ipp = usb_hstd_get_usb_ip_adr(utr.ip); /* Set USB Device class */ switch (g_usb_hstd_device_info[utr.ip][p_ctrl->address][3]) { case USB_IFCLS_CDC: p_info->type = USB_PCDC; break; case USB_IFCLS_HID: p_info->type = USB_PHID; break; case USB_IFCLS_MAS: p_info->type = USB_PMSC; break; case USB_IFCLS_VEN: p_info->type = USB_PVND; break; default: p_info->type = USB_NULL; break; } /* Set USB connect speed */ switch(g_usb_hstd_device_info[utr.ip][p_ctrl->address][4]) { case USB_NOCONNECT: p_info->speed = USB_NULL; break; case USB_HSCONNECT: p_info->speed = USB_HS; break; case USB_FSCONNECT: p_info->speed = USB_FS; break; case USB_LSCONNECT: p_info->speed = USB_LS; break; default: p_info->speed = USB_NULL; break; } /* Set USB device state */ switch (g_usb_hstd_device_info[utr.ip][p_ctrl->address][1]) { case USB_POWERED: /* Power state */ p_info->status = USB_STS_POWERED; break; case USB_DEFAULT: /* Default state */ p_info->status = USB_STS_DEFAULT; break; case USB_ADDRESS: /* Address state */ p_info->status = USB_STS_ADDRESS; break; case USB_CONFIGURED: /* Configured state */ p_info->status = USB_STS_CONFIGURED; break; case USB_SUSPENDED: /* Suspend state */ p_info->status = USB_STS_SUSPEND; break; case USB_DETACHED: /* Disconnect(VBUSon) state */ p_info->status = USB_STS_DETACH; break; default: /* Error */ p_info->status = USB_NULL; break; } /* Set USB Peri BC port state */ #if USB_CFG_BC == USB_CFG_ENABLE if (USB_DEVICEADDR == p_ctrl->address) /* Check Root port address */ { if (USB_BC_STATE_CDP == g_usb_hstd_bc[utr.ip].state) { p_info->port = USB_CDP; } else { p_info->port = USB_SDP; /* USB_SDP/USB_CDP/USB_DCP */ } } else { p_info->port = USB_SDP; /* USB_SDP/USB_CDP/USB_DCP */ } #else /* #if USB_CFG_BC == USB_CFG_ENABLE */ p_info->port = USB_SDP; /* USB_SDP/USB_CDP/USB_DCP */ #endif /* #if USB_CFG_BC == USB_CFG_ENABLE */ #endif /* (USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST */ } else { #if ((USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI) p_info->type = USB_NULL; /* Device class */ switch(usb_cstd_port_speed(USB_NULL)) { case USB_NOCONNECT: p_info->speed = USB_NULL; break; case USB_HSCONNECT: p_info->speed = USB_HS; break; case USB_FSCONNECT: p_info->speed = USB_FS; break; case USB_LSCONNECT: p_info->speed = USB_LS; break; default: p_info->speed = USB_NULL; break; } status = hw_usb_read_intsts(); switch ((uint16_t)(status & USB_DVSQ)) { case USB_DS_POWR: /* Power state */ p_info->status = USB_STS_DETACH; break; case USB_DS_DFLT: /* Default state */ p_info->status = USB_STS_DEFAULT; break; case USB_DS_ADDS: /* Address state */ p_info->status = USB_STS_ADDRESS; break; case USB_DS_CNFG: /* Configured state */ p_info->status = USB_STS_CONFIGURED; break; case USB_DS_SPD_POWR: /* Power suspend state */ case USB_DS_SPD_DFLT: /* Default suspend state */ case USB_DS_SPD_ADDR: /* Address suspend state */ case USB_DS_SPD_CNFG: /* Configured Suspend state */ p_info->status = USB_STS_SUSPEND; break; default: /* Error */ break; /* p_info->status = USB_STS_ERROR; */ } #if USB_CFG_BC == USB_CFG_ENABLE p_info->port = g_usb_bc_detect; /* USB_SDP/USB_CDP/USB_DCP */ #else /* USB_CFG_BC == USB_CFG_ENABLE */ p_info->port = USB_SDP; /* USB_SDP */ #endif /* USB_CFG_BC == USB_CFG_ENABLE */ #endif /* (USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI */ } return USB_SUCCESS; } /*********************************************************************************************************************** End of function R_USB_GetInformation ***********************************************************************************************************************/ /*********************************************************************************************************************** * Function Name : R_USB_PipeRead *******************************************************************************************************************//** * @brief Request data read via specified pipe * @param[in] p_ctrl Pointer to usb_ctrl_t structure area * @param[out] p_buf Pointer to area that stores data * @param[in] size Read request size * @retval USB_SUCCESS Successful completion * @retval USB_ERR_PARA Parameter error * @retval USB_ERR_BUSY Specifed pipe now handling data receive/send request * @retval USB_ERR_NG Other Error * @details This function requests a data read via the pipe specified in the argument. * The read data is stored in the area specified in the argument (p_buf). */ usb_err_t R_USB_PipeRead(usb_ctrl_t *p_ctrl, uint8_t *p_buf, uint32_t size) { #if !defined(USB_CFG_HVND_USE) && !defined(USB_CFG_PVND_USE) return USB_ERR_NG; #else /* !defined(USB_CFG_HVND_USE) && !defined(USB_CFG_PVND_USE) */ usb_err_t ret_code = USB_ERR_NG; usb_utr_t *p_tran_data; #if (BSP_CFG_RTOS_USED != 0) /* Use RTOS */ usb_utr_t tran_data; #endif /* BSP_CFG_RTOS_USED != 0 */ usb_er_t err; usb_info_t info; #if ((USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI) if (USB_PERI == g_usb_usbmode) { p_ctrl->module = USB_CFG_USE_USBIP; } #endif /* USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI */ #if USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE if (((USB_NULL == p_ctrl) || (USB_PIPE0 == p_ctrl->pipe)) || (USB_MAXPIPE_NUM < p_ctrl->pipe)) { return USB_ERR_PARA; } if ((USB_NULL == p_buf) || (USB_NULL == size)) { return USB_ERR_PARA; } /* Argument Checking */ if ((USB_IP0 != p_ctrl->module) && (USB_IP1 != p_ctrl->module) && ( USB_HOST == g_usb_usbmode)) { return USB_ERR_PARA; } #if defined(BSP_MCU_RX63N) || defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX630) || defined(BSP_MCU_RX63T)\ || defined(BSP_MCU_RX72T) || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) if ((USB_IP1 == p_ctrl->module) && (USB_HOST == g_usb_usbmode)) { return USB_ERR_PARA; } #endif /* #if defined(BSP_MCU_RX63N) || defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX630) || defined(BSP_MCU_RX63T)\ || defined(BSP_MCU_RX72T) || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) */ if (USB_NULL == (g_usb_open_class[p_ctrl->module] & (1 << p_ctrl->type))) /* Check USB Open device class */ { return USB_ERR_PARA; } #if defined(BSP_MCU_RX63N) if (USB_IP1 == p_ctrl->module && ( USB_HOST == g_usb_usbmode)) { return USB_ERR_PARA; } #endif #endif /* USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE */ R_USB_GetInformation(p_ctrl, &info); if (USB_STS_CONFIGURED == info.status) { /* PIPE Transfer set */ if (USB_HOST == g_usb_usbmode) { #if defined(USB_CFG_HVND_USE) #if ((USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST) #if (BSP_CFG_RTOS_USED != 0) /* Use RTOS */ p_tran_data = (usb_utr_t *)&tran_data; #else /* BSP_CFG_RTOS_USED != 0 */ p_tran_data = (usb_utr_t *)&g_usb_hdata[p_ctrl->module][p_ctrl->pipe]; #endif /* BSP_CFG_RTOS_USED != 0 */ p_tran_data->ip = p_ctrl->module; p_tran_data->ipp = usb_hstd_get_usb_ip_adr(p_tran_data->ip); p_tran_data->keyword = p_ctrl->pipe; /* Pipe No */ p_tran_data->p_tranadr = p_buf; /* Data address */ p_tran_data->tranlen = size; /* Data Size */ p_tran_data->p_setup = 0; p_tran_data->complete = usb_hvnd_read_complete; /* Callback function */ p_tran_data->segment = USB_TRAN_END; *(uint32_t *)p_tran_data->p_usr_data = p_ctrl->address; p_tran_data->read_req_len= size; /* Data Size */ err = usb_hstd_transfer_start(p_tran_data); /* USB Transfer Start */ if (USB_OK == err) { ret_code = USB_SUCCESS; } else if (USB_QOVR == err) { ret_code = USB_ERR_BUSY; } else { } #endif /* (USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST */ #endif /* #if defined(USB_CFG_HVND_USE) */ } else { #if defined(USB_CFG_PVND_USE) #if ((USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI) #if (BSP_CFG_RTOS_USED != 0) /* Use RTOS */ p_tran_data = (usb_utr_t *)&tran_data; #else /* BSP_CFG_RTOS_USED != 0 */ p_tran_data = (usb_utr_t *)&g_usb_pdata[p_ctrl->pipe]; #endif /* BSP_CFG_RTOS_USED != 0 */ p_tran_data->keyword = p_ctrl->pipe; /* Pipe No */ p_tran_data->p_tranadr = p_buf; /* Data address */ p_tran_data->tranlen = size; /* Data Size */ p_tran_data->complete = (usb_cb_t)&usb_pvnd_read_complete; /* Callback function */ p_tran_data->read_req_len= size; /* Data Size */ err = usb_pstd_transfer_start(p_tran_data); /* USB Transfer Start */ if (USB_OK == err) { ret_code = USB_SUCCESS; } else if (USB_QOVR == err) { ret_code = USB_ERR_BUSY; } else { } #endif /* (USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI */ #endif /* defined(USB_CFG_PVND_USE) */ } } return ret_code; #endif /* !defined(USB_CFG_HVND_USE) && !defined(USB_CFG_PVND_USE) */ } /*********************************************************************************************************************** End of function R_USB_PipeRead ***********************************************************************************************************************/ /*********************************************************************************************************************** * Function Name : R_USB_PipeWrite *******************************************************************************************************************//** * @brief Request data write to specified pipe * @param[in] p_ctrl Pointer to usb_ctrl_t structure area * @param[in] p_buf Pointer to area that write stores data * @param[in] size Write request size * @retval USB_SUCCESS Successful completion * @retval USB_ERR_PARA Parameter error * @retval USB_ERR_BUSY Specifed pipe now handling data receive/send request * @retval USB_ERR_NG Other Error * @details This function requests a data write. The write data is stored in the area specified in the argument (p_buf). */ usb_err_t R_USB_PipeWrite(usb_ctrl_t *p_ctrl, uint8_t *p_buf, uint32_t size) { #if !defined(USB_CFG_HVND_USE) && !defined(USB_CFG_PVND_USE) return USB_ERR_NG; #else /* !defined(USB_CFG_HVND_USE) && !defined(USB_CFG_PVND_USE) */ usb_er_t err; usb_err_t ret_code = USB_ERR_NG; usb_info_t info; usb_utr_t *p_tran_data; #if (BSP_CFG_RTOS_USED != 0) /* Use RTOS */ usb_utr_t tran_data; #endif /* BSP_CFG_RTOS_USED != 0 */ #if ((USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI) if (USB_PERI == g_usb_usbmode) { p_ctrl->module = USB_CFG_USE_USBIP; } #endif /* USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI */ #if USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE /* Argument Checking */ if ((USB_IP0 != p_ctrl->module) && (USB_IP1 != p_ctrl->module) && ( USB_HOST == g_usb_usbmode)) { return USB_ERR_PARA; } #if defined(BSP_MCU_RX63N) || defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX630) || defined(BSP_MCU_RX63T)\ || defined(BSP_MCU_RX72T) || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) if (USB_IP1 == p_ctrl->module) { return USB_ERR_PARA; } #endif /* defined(BSP_MCU_RX63N) || defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX630) || defined(BSP_MCU_RX63T)\ || defined(BSP_MCU_RX72T) || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) */ if (((USB_NULL == p_ctrl) || (USB_NULL == p_buf) || (USB_PIPE0 == p_ctrl->pipe)) || (USB_MAXPIPE_NUM < p_ctrl->pipe)) { return USB_ERR_PARA; } if (USB_NULL == (g_usb_open_class[p_ctrl->module] & (1 << p_ctrl->type))) /* Check USB Open device class */ { return USB_ERR_PARA; } #if defined(BSP_MCU_RX63N) if (USB_IP1 == p_ctrl->module && ( USB_HOST == g_usb_usbmode)) { return USB_ERR_PARA; } #endif #endif /* USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE */ R_USB_GetInformation(p_ctrl, &info); if (USB_STS_CONFIGURED == info.status) { /* PIPE Transfer set */ if (USB_HOST == g_usb_usbmode) { #if ((USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST) #if defined(USB_CFG_HVND_USE) #if (BSP_CFG_RTOS_USED != 0) /* Use RTOS */ p_tran_data = (usb_utr_t *)&tran_data; #else /* BSP_CFG_RTOS_USED != 0 */ p_tran_data = (usb_utr_t *)&g_usb_hdata[p_ctrl->module][p_ctrl->pipe]; #endif /* BSP_CFG_RTOS_USED != 0 */ p_tran_data->ip = p_ctrl->module; p_tran_data->ipp = usb_hstd_get_usb_ip_adr((uint8_t) p_ctrl->module); p_tran_data->keyword = p_ctrl->pipe; /* Pipe No */ p_tran_data->p_tranadr = p_buf; /* Data address */ p_tran_data->tranlen = size; /* Data Size */ p_tran_data->complete = usb_hvnd_write_complete; /* Callback function */ p_tran_data->segment = USB_TRAN_END; err = usb_hstd_transfer_start(p_tran_data); if (USB_OK == err) { ret_code = USB_SUCCESS; } else if (USB_QOVR == err) { ret_code = USB_ERR_BUSY; } else { } #endif /* defined(USB_CFG_HVND_USE) */ #endif /* (USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST */ } else { #if ((USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI) #if defined(USB_CFG_PVND_USE) #if (BSP_CFG_RTOS_USED != 0) /* Use RTOS */ p_tran_data = (usb_utr_t *)&tran_data; #else /* BSP_CFG_RTOS_USED != 0 */ p_tran_data = (usb_utr_t *)&g_usb_pdata[p_ctrl->pipe]; #endif /* BSP_CFG_RTOS_USED != 0 */ p_tran_data->keyword = p_ctrl->pipe; /* Pipe No */ p_tran_data->p_tranadr = p_buf; /* Data address */ p_tran_data->tranlen = size; /* Data Size */ p_tran_data->complete = usb_pvnd_write_complete; /* Callback function */ err = usb_pstd_transfer_start(p_tran_data); if (USB_OK == err) { ret_code = USB_SUCCESS; } else if (USB_QOVR == err) { ret_code = USB_ERR_BUSY; } else { } #endif /* defined(USB_CFG_PVND_USE) */ #endif /* (USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI */ } } return ret_code; #endif /* #if !defined(USB_CFG_HVND_USE) && !defined(USB_CFG_PVND_USE) */ } /*********************************************************************************************************************** End of function R_USB_PipeWrite ***********************************************************************************************************************/ /*********************************************************************************************************************** * Function Name : R_USB_PipeStop *******************************************************************************************************************//** * @brief Stop data read/write via specified pipe * @param[in] p_ctrl Pointer to usb_ctrl_t structure area * @retval USB_SUCCESS Successful completed (stop request completed) * @retval USB_ERR_PARA Parameter error * @retval USB_ERR_NG Other Error * @details This function is used to terminate a data read/write operation. */ usb_err_t R_USB_PipeStop(usb_ctrl_t *p_ctrl) { #if !defined(USB_CFG_HVND_USE) && !defined(USB_CFG_PVND_USE) return USB_ERR_NG; #else usb_er_t err = USB_ERR_NG; usb_err_t ret_code = USB_ERR_NG; usb_info_t info; #if ((USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST) usb_utr_t utr; if (USB_HOST == g_usb_usbmode) { utr.ip = p_ctrl->module; utr.ipp = usb_hstd_get_usb_ip_adr(utr.ip); } #endif /* (USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST */ #if ((USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI) if (USB_PERI == g_usb_usbmode) { p_ctrl->module = USB_CFG_USE_USBIP; } #endif /* USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI */ #if USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE /* Argument Checking */ if ((USB_IP0 != p_ctrl->module) && (USB_IP1 != p_ctrl->module) && ( USB_HOST == g_usb_usbmode)) { return USB_ERR_PARA; } #if defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX630) || defined(BSP_MCU_RX63T) || defined(BSP_MCU_RX72T)\ || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) if (USB_IP1 == p_ctrl->module) { return USB_ERR_PARA; } #endif /* defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX630) || defined(BSP_MCU_RX63T) || defined(BSP_MCU_RX72T)\ || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) */ #if defined(BSP_MCU_RX63N) if ((USB_IP1 == p_ctrl->module) && (USB_HOST == g_usb_usbmode)) { return USB_ERR_PARA; } #endif if ((USB_NULL == p_ctrl) || (USB_PIPE0 == p_ctrl->pipe) || (USB_MAXPIPE_NUM < p_ctrl->pipe)) { return USB_ERR_PARA; } if (USB_NULL == (g_usb_open_class[p_ctrl->module] & (1 << p_ctrl->type))) /* Check USB Open device class */ { return USB_ERR_PARA; } #endif /* USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE */ err = R_USB_GetInformation(p_ctrl, &info); if (USB_STS_CONFIGURED != info.status) { return USB_ERR_NG; } if (USB_HOST == g_usb_usbmode) { #if ((USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST) err = usb_hstd_transfer_end(&utr, p_ctrl->pipe, (uint16_t)USB_DATA_STOP); #endif /* (USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST */ } else { #if ((USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI) err = usb_pstd_transfer_end(p_ctrl->pipe); #endif /* (USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI */ } if (USB_OK == err) { ret_code = USB_SUCCESS; } return ret_code; #endif /* !defined(USB_CFG_HVND_USE) && !defined(USB_CFG_PVND_USE) */ } /*********************************************************************************************************************** End of function R_USB_PipeStop ***********************************************************************************************************************/ /*********************************************************************************************************************** * Function Name : R_USB_GetUsePipe *******************************************************************************************************************//** * @brief Get used pipe number from bit map * @param[in] p_ctrl Pointer to usb_ctrl_t structure area * @param[out] p_pipe Pointer to area that stores the selected pipe number (bit map information) * @retval USB_SUCCESS Successful completed (stop request completed) * @retval USB_ERR_PARA Parameter error * @retval USB_ERR_NG Other Error * @details Get the selected pipe number (number of the pipe that has completed initalization) via bit map information. * The bit map information is stored in the area specified in argument (p_pipe). * Based on the information (module member and address member) assigned to the usb_ctrl_t structure, * obtains the PIPE information of that USB device. * @note The argument (p_ctrl) is not supported when using RX100/RX200 series MCU. */ usb_err_t R_USB_GetUsePipe(usb_ctrl_t *p_ctrl, uint16_t *p_pipe) { usb_info_t info; uint16_t pipe_no; #if ((USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST) usb_utr_t utr; #endif /* ( (USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST ) */ #if USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE if (USB_NULL == p_pipe) { return USB_ERR_PARA; } if ((USB_NULL == p_ctrl) && (USB_HOST == g_usb_usbmode)) { return USB_ERR_PARA; } /* Argument Checking */ if ((USB_IP0 != p_ctrl->module) && (USB_IP1 != p_ctrl->module) && (USB_HOST == g_usb_usbmode)) { return USB_ERR_PARA; } #if defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX630) || defined(BSP_MCU_RX63T) || defined(BSP_MCU_RX72T)\ || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) if (USB_IP1 == p_ctrl->module) { return USB_ERR_PARA; } #endif /*defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX630) || defined(BSP_MCU_RX63T) || defined(BSP_MCU_RX72T)\ || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) */ #if defined(BSP_MCU_RX63N) if ((USB_IP1 == p_ctrl->module) && (USB_HOST == g_usb_usbmode)) { return USB_ERR_PARA; } #endif /* defined(BSP_MCU_RX63N) */ #endif /* USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE */ #if ((USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST) utr.ip = p_ctrl->module; utr.ipp = usb_hstd_get_usb_ip_adr(utr.ip); #endif /* ( (USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST ) */ R_USB_GetInformation(p_ctrl, &info); if (USB_STS_CONFIGURED != info.status) { return USB_ERR_NG; } /* Get PIPE Number from Endpoint address */ *p_pipe = ((uint16_t)1 << USB_PIPE0); if (USB_HOST == g_usb_usbmode) { #if ((USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST) /* WAIT_LOOP */ for (pipe_no = USB_MIN_PIPE_NO; pipe_no < (USB_MAX_PIPE_NO +1); pipe_no++) { if (USB_TRUE == g_usb_pipe_table[utr.ip][pipe_no].use_flag) { if ((p_ctrl->address << USB_DEVADDRBIT) == (g_usb_pipe_table[utr.ip][pipe_no].pipe_maxp & USB_DEVSEL)) { (*p_pipe) |= ((uint16_t)1 << pipe_no); } } } #endif /* (USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST */ } else { #if ((USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI) /* WAIT_LOOP */ for (pipe_no = USB_MIN_PIPE_NO; pipe_no < (USB_MAX_PIPE_NO +1); pipe_no++) { if (USB_TRUE == g_usb_pipe_table[USB_CFG_USE_USBIP][pipe_no].use_flag) { (*p_pipe) |= ((uint16_t)1 << pipe_no); } } #endif /* (USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI */ } return USB_SUCCESS; } /*********************************************************************************************************************** End of function R_USB_GetUsePipe ***********************************************************************************************************************/ /*********************************************************************************************************************** * Function Name : R_USB_GetPipeInfo *******************************************************************************************************************//** * @brief Get pipe information for specified pipe * @param[in] p_ctrl Pointer to usb_ctrl_t structure area * @param[out] p_info Pointer to usb_pipe_t structure area * @retval USB_SUCCESS Successful completed (stop request completed) * @retval USB_ERR_PARA Parameter error * @retval USB_ERR_NG Other Error * @details This function gets the following pipe information regarding the pipe specified * in the argument (p_ctrl) member (pipe): endpoint number, transfer type, transfer direction and maximum packet size. * The obtained pipe information is stored in the area specified in the argument (p_info). */ usb_err_t R_USB_GetPipeInfo(usb_ctrl_t *p_ctrl, usb_pipe_t *p_info) { usb_info_t info; uint16_t pipe_type; #if ((USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST) usb_utr_t utr; #endif /* #if ((USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST) */ #if USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE /* Argument Checking */ if ((USB_IP0 != p_ctrl->module) && (USB_IP1 != p_ctrl->module) && (USB_HOST == g_usb_usbmode)) { return USB_ERR_PARA; } if (((USB_NULL == p_ctrl) || (0 == p_ctrl->pipe)) || (USB_MAXPIPE_NUM < p_ctrl->pipe)) { return USB_ERR_PARA; } #if defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX630) || defined(BSP_MCU_RX63T) || defined(BSP_MCU_RX72T)\ || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) if (USB_IP1 == p_ctrl->module) { return USB_ERR_PARA; } #endif /* defined(BSP_MCU_RX65N) || defined(BSP_MCU_RX630) || defined(BSP_MCU_RX63T) || defined(BSP_MCU_RX72T)\ || defined (BSP_MCU_RX72M) || defined (BSP_MCU_RX72N) || defined (BSP_MCU_RX66N) */ #if defined(BSP_MCU_RX63N) if ((USB_IP1 == p_ctrl->module) && (USB_HOST == g_usb_usbmode)) { return USB_ERR_PARA; } #endif /* defined(BSP_MCU_RX63N) */ #endif /* USB_CFG_PARAM_CHECKING == USB_CFG_ENABLE */ #if ((USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST) if (USB_HOST == g_usb_usbmode) { utr.ip = p_ctrl->module; utr.ipp = usb_hstd_get_usb_ip_adr(utr.ip); } #endif /* (USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST */ R_USB_GetInformation(p_ctrl, &info); if (USB_STS_CONFIGURED != info.status) { return USB_ERR_NG; } if (USB_HOST == g_usb_usbmode) { #if ((USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST) p_info->ep = usb_hstd_pipe_to_epadr(&utr, p_ctrl->pipe); pipe_type = usb_cstd_get_pipe_type(&utr, p_ctrl->pipe); switch (pipe_type) { case USB_TYPFIELD_ISO: p_info->type = USB_ISO; /* Set Isochronous */ break; case USB_TYPFIELD_BULK: p_info->type = USB_BULK; /* Set Bulk */ break; case USB_TYPFIELD_INT: p_info->type = USB_INT; /* Set Interrupt */ break; default: return USB_ERR_NG; break; } p_info->mxps = usb_cstd_get_maxpacket_size(&utr, p_ctrl->pipe); /* Set Max packet size */ return USB_SUCCESS; #endif /* (USB_CFG_MODE & USB_CFG_HOST) == USB_CFG_HOST */ } else { #if ((USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI) /* Get PIPE Number from Endpoint address */ p_info->ep = (uint8_t)(g_usb_pipe_table[USB_CFG_USE_USBIP][p_ctrl->pipe].pipe_cfg & USB_EPNUMFIELD); /* Set EP num. */ if (USB_DIR_P_IN == (g_usb_pipe_table[USB_CFG_USE_USBIP][p_ctrl->pipe].pipe_cfg & USB_DIRFIELD)) /* Check dir */ { p_info->ep |= USB_EP_DIR_IN; /* Set DIR IN */ } pipe_type = usb_cstd_get_pipe_type(USB_NULL, p_ctrl->pipe); switch (pipe_type) { case USB_TYPFIELD_ISO: p_info->type = USB_ISO; /* Set Isochronous */ break; case USB_TYPFIELD_BULK: p_info->type = USB_BULK; /* Set Bulk */ break; case USB_TYPFIELD_INT: p_info->type = USB_INT; /* Set Interrupt */ break; default: return USB_ERR_NG; break; } p_info->mxps = usb_cstd_get_maxpacket_size(USB_NULL, p_ctrl->pipe); /* Set Max packet size */ return USB_SUCCESS; #endif /* (USB_CFG_MODE & USB_CFG_PERI) == USB_CFG_PERI */ } return USB_ERR_NG; } /*********************************************************************************************************************** End of function R_USB_GetPipeInfo ***********************************************************************************************************************/ /*********************************************************************************************************************** * Function Name : R_USB_PullUp *******************************************************************************************************************//** * @brief Pull-up enable/disable setting of D+/D- line * @param[in] state Pull-up enable/disable setting * @retval USB_SUCCESS Successful completion (Pull-up enable/disable setting completed) * @retval USB_ERR_PARA Parameter error * @retval USB_ERR_NG Other Error * @details This API enables or disables pull-up of D+/D- line. */ usb_err_t R_USB_PullUp(uint8_t state) { #if (USB_CFG_MODE == USB_CFG_HOST) return USB_ERR_NG; #else /* USB_CFG_MODE == USB_CFG_HOST */ if (USB_HOST == g_usb_usbmode) { return USB_ERR_NG; /* Support Host only. */ } /* Argument Checking */ if ((USB_ON != state) && (USB_OFF != state)) { return USB_ERR_PARA; } if (USB_ON == state) { hw_usb_pset_dprpu(); } else { hw_usb_pclear_dprpu(); } return USB_SUCCESS; #endif /* USB_CFG_MODE == USB_CFG_HOST */ } /* End of function R_USB_GetPipeInfo */ /*********************************************************************************************************************** End of function R_USB_PullUp ***********************************************************************************************************************/ /*********************************************************************************************************************** End Of File ***********************************************************************************************************************/
36.205725
129
0.522803
c8d21956ab52346dfe6a74b670eeb62cb590bdb6
3,415
c
C
linux-3.0.1/sound/soc/kirkwood/kirkwood-t5325.c
tonghua209/samsun6410_linux_3_0_0_1_for_aws
31aa0dc27c4aab51a92309a74fd84ca65e8c6a58
[ "Apache-2.0" ]
4
2016-07-01T04:50:02.000Z
2021-11-14T21:29:42.000Z
linux-3.0/sound/soc/kirkwood/kirkwood-t5325.c
spartan263/vizio_oss
74270002d874391148119b48882db6816e7deedc
[ "Linux-OpenIB" ]
null
null
null
linux-3.0/sound/soc/kirkwood/kirkwood-t5325.c
spartan263/vizio_oss
74270002d874391148119b48882db6816e7deedc
[ "Linux-OpenIB" ]
1
2020-04-03T14:00:39.000Z
2020-04-03T14:00:39.000Z
/* * kirkwood-t5325.c * * (c) 2010 Arnaud Patard <arnaud.patard@rtp-net.org> * * 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. */ #include <linux/module.h> #include <linux/moduleparam.h> #include <linux/interrupt.h> #include <linux/platform_device.h> #include <linux/slab.h> #include <sound/soc.h> #include <mach/kirkwood.h> #include <plat/audio.h> #include <asm/mach-types.h> #include "../codecs/alc5623.h" static int t5325_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) { struct snd_soc_pcm_runtime *rtd = substream->private_data; struct snd_soc_dai *codec_dai = rtd->codec_dai; struct snd_soc_dai *cpu_dai = rtd->cpu_dai; int ret; unsigned int freq, fmt; fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBS_CFS; ret = snd_soc_dai_set_fmt(cpu_dai, fmt); if (ret < 0) return ret; ret = snd_soc_dai_set_fmt(codec_dai, fmt); if (ret < 0) return ret; freq = params_rate(params) * 256; return snd_soc_dai_set_sysclk(codec_dai, 0, freq, SND_SOC_CLOCK_IN); } static struct snd_soc_ops t5325_ops = { .hw_params = t5325_hw_params, }; static const struct snd_soc_dapm_widget t5325_dapm_widgets[] = { SND_SOC_DAPM_HP("Headphone Jack", NULL), SND_SOC_DAPM_SPK("Speaker", NULL), SND_SOC_DAPM_MIC("Mic Jack", NULL), }; static const struct snd_soc_dapm_route t5325_route[] = { { "Headphone Jack", NULL, "HPL" }, { "Headphone Jack", NULL, "HPR" }, {"Speaker", NULL, "SPKOUT"}, {"Speaker", NULL, "SPKOUTN"}, { "MIC1", NULL, "Mic Jack" }, { "MIC2", NULL, "Mic Jack" }, }; static int t5325_dai_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_codec *codec = rtd->codec; struct snd_soc_dapm_context *dapm = &codec->dapm; snd_soc_dapm_new_controls(dapm, t5325_dapm_widgets, ARRAY_SIZE(t5325_dapm_widgets)); snd_soc_dapm_add_routes(dapm, t5325_route, ARRAY_SIZE(t5325_route)); snd_soc_dapm_enable_pin(dapm, "Mic Jack"); snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); snd_soc_dapm_enable_pin(dapm, "Speaker"); snd_soc_dapm_sync(dapm); return 0; } static struct snd_soc_dai_link t5325_dai[] = { { .name = "ALC5621", .stream_name = "ALC5621 HiFi", .cpu_dai_name = "kirkwood-i2s", .platform_name = "kirkwood-pcm-audio", .codec_dai_name = "alc5621-hifi", .codec_name = "alc562x-codec.0-001a", .ops = &t5325_ops, .init = t5325_dai_init, }, }; static struct snd_soc_card t5325 = { .name = "t5325", .dai_link = t5325_dai, .num_links = ARRAY_SIZE(t5325_dai), }; static struct platform_device *t5325_snd_device; static int __init t5325_init(void) { int ret; if (!machine_is_t5325()) return 0; t5325_snd_device = platform_device_alloc("soc-audio", -1); if (!t5325_snd_device) return -ENOMEM; platform_set_drvdata(t5325_snd_device, &t5325); ret = platform_device_add(t5325_snd_device); if (ret) { printk(KERN_ERR "%s: platform_device_add failed\n", __func__); platform_device_put(t5325_snd_device); } return ret; } module_init(t5325_init); static void __exit t5325_exit(void) { platform_device_unregister(t5325_snd_device); } module_exit(t5325_exit); MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>"); MODULE_DESCRIPTION("ALSA SoC t5325 audio client"); MODULE_LICENSE("GPL");
24.049296
76
0.731772
0c26143700460774cb3d1666c2d44d71e2a4c2e6
2,280
h
C
GreenJuiceTeam/GreenJuiceTeam.Shared/game/Easing.h
valdirSalgueiro/hotasphalt
a74116843ee3737f435109a28313a55c2450a941
[ "MIT" ]
null
null
null
GreenJuiceTeam/GreenJuiceTeam.Shared/game/Easing.h
valdirSalgueiro/hotasphalt
a74116843ee3737f435109a28313a55c2450a941
[ "MIT" ]
null
null
null
GreenJuiceTeam/GreenJuiceTeam.Shared/game/Easing.h
valdirSalgueiro/hotasphalt
a74116843ee3737f435109a28313a55c2450a941
[ "MIT" ]
null
null
null
class Easing { public: // back static float BackEaseIn(float t,float b , float c, float d); static float BackEaseOut(float t,float b , float c, float d); static float BackEaseInOut(float t,float b , float c, float d); // bounce static float BounceEaseIn(float t,float b , float c, float d); static float BounceEaseOut(float t,float b , float c, float d); static float BounceEaseInOut(float t,float b , float c, float d); // circ static float CircEaseIn(float t,float b , float c, float d); static float CircEaseOut(float t,float b , float c, float d); static float CircEaseInOut(float t,float b , float c, float d); // cubic static float CubicEaseIn(float t,float b , float c, float d); static float CubicEaseOut(float t,float b , float c, float d); static float CubicEaseInOut(float t,float b , float c, float d); // elastic static float ElasticEaseIn(float t,float b , float c, float d); static float ElasticEaseOut(float t,float b , float c, float d); static float ElasticEaseInOut(float t,float b , float c, float d); // expo static float ExpoEaseIn(float t,float b , float c, float d); static float ExpoEaseOut(float t,float b , float c, float d); static float ExpoEaseInOut(float t,float b , float c, float d); // linear static float LinearEaseIn(float t,float b , float c, float d); static float LinearEaseOut(float t,float b , float c, float d); static float LinearEaseInOut(float t,float b , float c, float d); // quad static float QuadEaseIn(float t,float b , float c, float d); static float QuadEaseOut(float t,float b , float c, float d); static float QuadEaseInOut(float t,float b , float c, float d); // quart static float QuartEaseIn(float t,float b , float c, float d); static float QuartEaseOut(float t,float b , float c, float d); static float QuartEaseInOut(float t,float b , float c, float d); // quint static float QuintEaseIn(float t,float b , float c, float d); static float QuintEaseOut(float t,float b , float c, float d); static float QuintEaseInOut(float t,float b , float c, float d); // sine static float SineEaseIn(float t,float b , float c, float d); static float SineEaseOut(float t,float b , float c, float d); static float SineEaseInOut(float t,float b , float c, float d); };
38.644068
67
0.714912
aebad7e565cf7391b753cd482405356974f5b4b6
11,214
c
C
linsched-linsched-alpha/arch/arm/mach-prima2/clock.c
usenixatc2021/SoftRefresh_Scheduling
589ba06c8ae59538973c22edf28f74a59d63aa14
[ "MIT" ]
47
2015-03-10T23:21:52.000Z
2022-02-17T01:04:14.000Z
linsched-linsched-alpha/arch/arm/mach-prima2/clock.c
usenixatc2021/SoftRefresh_Scheduling
589ba06c8ae59538973c22edf28f74a59d63aa14
[ "MIT" ]
1
2020-06-30T18:01:37.000Z
2020-06-30T18:01:37.000Z
linsched-linsched-alpha/arch/arm/mach-prima2/clock.c
usenixatc2021/SoftRefresh_Scheduling
589ba06c8ae59538973c22edf28f74a59d63aa14
[ "MIT" ]
19
2015-02-25T19:50:05.000Z
2021-10-05T14:35:54.000Z
/* * Clock tree for CSR SiRFprimaII * * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company. * * Licensed under GPLv2 or later. */ #include <linux/module.h> #include <linux/bitops.h> #include <linux/err.h> #include <linux/errno.h> #include <linux/io.h> #include <linux/clkdev.h> #include <linux/clk.h> #include <linux/spinlock.h> #include <linux/of.h> #include <linux/of_address.h> #include <asm/mach/map.h> #include <mach/map.h> #define SIRFSOC_CLKC_CLK_EN0 0x0000 #define SIRFSOC_CLKC_CLK_EN1 0x0004 #define SIRFSOC_CLKC_REF_CFG 0x0014 #define SIRFSOC_CLKC_CPU_CFG 0x0018 #define SIRFSOC_CLKC_MEM_CFG 0x001c #define SIRFSOC_CLKC_SYS_CFG 0x0020 #define SIRFSOC_CLKC_IO_CFG 0x0024 #define SIRFSOC_CLKC_DSP_CFG 0x0028 #define SIRFSOC_CLKC_GFX_CFG 0x002c #define SIRFSOC_CLKC_MM_CFG 0x0030 #define SIRFSOC_LKC_LCD_CFG 0x0034 #define SIRFSOC_CLKC_MMC_CFG 0x0038 #define SIRFSOC_CLKC_PLL1_CFG0 0x0040 #define SIRFSOC_CLKC_PLL2_CFG0 0x0044 #define SIRFSOC_CLKC_PLL3_CFG0 0x0048 #define SIRFSOC_CLKC_PLL1_CFG1 0x004c #define SIRFSOC_CLKC_PLL2_CFG1 0x0050 #define SIRFSOC_CLKC_PLL3_CFG1 0x0054 #define SIRFSOC_CLKC_PLL1_CFG2 0x0058 #define SIRFSOC_CLKC_PLL2_CFG2 0x005c #define SIRFSOC_CLKC_PLL3_CFG2 0x0060 #define SIRFSOC_CLOCK_VA_BASE SIRFSOC_VA(0x005000) #define KHZ 1000 #define MHZ (KHZ * KHZ) struct clk_ops { unsigned long (*get_rate)(struct clk *clk); long (*round_rate)(struct clk *clk, unsigned long rate); int (*set_rate)(struct clk *clk, unsigned long rate); int (*enable)(struct clk *clk); int (*disable)(struct clk *clk); struct clk *(*get_parent)(struct clk *clk); int (*set_parent)(struct clk *clk, struct clk *parent); }; struct clk { struct clk *parent; /* parent clk */ unsigned long rate; /* clock rate in Hz */ signed char usage; /* clock enable count */ signed char enable_bit; /* enable bit: 0 ~ 63 */ unsigned short regofs; /* register offset */ struct clk_ops *ops; /* clock operation */ }; static DEFINE_SPINLOCK(clocks_lock); static inline unsigned long clkc_readl(unsigned reg) { return readl(SIRFSOC_CLOCK_VA_BASE + reg); } static inline void clkc_writel(u32 val, unsigned reg) { writel(val, SIRFSOC_CLOCK_VA_BASE + reg); } /* * osc_rtc - real time oscillator - 32.768KHz * osc_sys - high speed oscillator - 26MHz */ static struct clk clk_rtc = { .rate = 32768, }; static struct clk clk_osc = { .rate = 26 * MHZ, }; /* * std pll */ static unsigned long std_pll_get_rate(struct clk *clk) { unsigned long fin = clk_get_rate(clk->parent); u32 regcfg2 = clk->regofs + SIRFSOC_CLKC_PLL1_CFG2 - SIRFSOC_CLKC_PLL1_CFG0; if (clkc_readl(regcfg2) & BIT(2)) { /* pll bypass mode */ clk->rate = fin; } else { /* fout = fin * nf / nr / od */ u32 cfg0 = clkc_readl(clk->regofs); u32 nf = (cfg0 & (BIT(13) - 1)) + 1; u32 nr = ((cfg0 >> 13) & (BIT(6) - 1)) + 1; u32 od = ((cfg0 >> 19) & (BIT(4) - 1)) + 1; WARN_ON(fin % MHZ); clk->rate = fin / MHZ * nf / nr / od * MHZ; } return clk->rate; } static int std_pll_set_rate(struct clk *clk, unsigned long rate) { unsigned long fin, nf, nr, od, reg; /* * fout = fin * nf / (nr * od); * set od = 1, nr = fin/MHz, so fout = nf * MHz */ nf = rate / MHZ; if (unlikely((rate % MHZ) || nf > BIT(13) || nf < 1)) return -EINVAL; fin = clk_get_rate(clk->parent); BUG_ON(fin < MHZ); nr = fin / MHZ; BUG_ON((fin % MHZ) || nr > BIT(6)); od = 1; reg = (nf - 1) | ((nr - 1) << 13) | ((od - 1) << 19); clkc_writel(reg, clk->regofs); reg = clk->regofs + SIRFSOC_CLKC_PLL1_CFG1 - SIRFSOC_CLKC_PLL1_CFG0; clkc_writel((nf >> 1) - 1, reg); reg = clk->regofs + SIRFSOC_CLKC_PLL1_CFG2 - SIRFSOC_CLKC_PLL1_CFG0; while (!(clkc_readl(reg) & BIT(6))) cpu_relax(); clk->rate = 0; /* set to zero will force recalculation */ return 0; } static struct clk_ops std_pll_ops = { .get_rate = std_pll_get_rate, .set_rate = std_pll_set_rate, }; static struct clk clk_pll1 = { .parent = &clk_osc, .regofs = SIRFSOC_CLKC_PLL1_CFG0, .ops = &std_pll_ops, }; static struct clk clk_pll2 = { .parent = &clk_osc, .regofs = SIRFSOC_CLKC_PLL2_CFG0, .ops = &std_pll_ops, }; static struct clk clk_pll3 = { .parent = &clk_osc, .regofs = SIRFSOC_CLKC_PLL3_CFG0, .ops = &std_pll_ops, }; /* * clock domains - cpu, mem, sys/io */ static struct clk clk_mem; static struct clk *dmn_get_parent(struct clk *clk) { struct clk *clks[] = { &clk_osc, &clk_rtc, &clk_pll1, &clk_pll2, &clk_pll3 }; u32 cfg = clkc_readl(clk->regofs); WARN_ON((cfg & (BIT(3) - 1)) > 4); return clks[cfg & (BIT(3) - 1)]; } static int dmn_set_parent(struct clk *clk, struct clk *parent) { const struct clk *clks[] = { &clk_osc, &clk_rtc, &clk_pll1, &clk_pll2, &clk_pll3 }; u32 cfg = clkc_readl(clk->regofs); int i; for (i = 0; i < ARRAY_SIZE(clks); i++) { if (clks[i] == parent) { cfg &= ~(BIT(3) - 1); clkc_writel(cfg | i, clk->regofs); /* BIT(3) - switching status: 1 - busy, 0 - done */ while (clkc_readl(clk->regofs) & BIT(3)) cpu_relax(); return 0; } } return -EINVAL; } static unsigned long dmn_get_rate(struct clk *clk) { unsigned long fin = clk_get_rate(clk->parent); u32 cfg = clkc_readl(clk->regofs); if (cfg & BIT(24)) { /* fcd bypass mode */ clk->rate = fin; } else { /* * wait count: bit[19:16], hold count: bit[23:20] */ u32 wait = (cfg >> 16) & (BIT(4) - 1); u32 hold = (cfg >> 20) & (BIT(4) - 1); clk->rate = fin / (wait + hold + 2); } return clk->rate; } static int dmn_set_rate(struct clk *clk, unsigned long rate) { unsigned long fin; unsigned ratio, wait, hold, reg; unsigned bits = (clk == &clk_mem) ? 3 : 4; fin = clk_get_rate(clk->parent); ratio = fin / rate; if (unlikely(ratio < 2 || ratio > BIT(bits + 1))) return -EINVAL; WARN_ON(fin % rate); wait = (ratio >> 1) - 1; hold = ratio - wait - 2; reg = clkc_readl(clk->regofs); reg &= ~(((BIT(bits) - 1) << 16) | ((BIT(bits) - 1) << 20)); reg |= (wait << 16) | (hold << 20) | BIT(25); clkc_writel(reg, clk->regofs); /* waiting FCD been effective */ while (clkc_readl(clk->regofs) & BIT(25)) cpu_relax(); clk->rate = 0; /* set to zero will force recalculation */ return 0; } /* * cpu clock has no FCD register in Prima2, can only change pll */ static int cpu_set_rate(struct clk *clk, unsigned long rate) { int ret1, ret2; struct clk *cur_parent, *tmp_parent; cur_parent = dmn_get_parent(clk); BUG_ON(cur_parent == NULL || cur_parent->usage > 1); /* switch to tmp pll before setting parent clock's rate */ tmp_parent = cur_parent == &clk_pll1 ? &clk_pll2 : &clk_pll1; ret1 = dmn_set_parent(clk, tmp_parent); BUG_ON(ret1); ret2 = clk_set_rate(cur_parent, rate); ret1 = dmn_set_parent(clk, cur_parent); clk->rate = 0; /* set to zero will force recalculation */ return ret2 ? ret2 : ret1; } static struct clk_ops cpu_ops = { .get_parent = dmn_get_parent, .set_parent = dmn_set_parent, .set_rate = cpu_set_rate, }; static struct clk clk_cpu = { .parent = &clk_pll1, .regofs = SIRFSOC_CLKC_CPU_CFG, .ops = &cpu_ops, }; static struct clk_ops msi_ops = { .set_rate = dmn_set_rate, .get_rate = dmn_get_rate, .set_parent = dmn_set_parent, .get_parent = dmn_get_parent, }; static struct clk clk_mem = { .parent = &clk_pll2, .regofs = SIRFSOC_CLKC_MEM_CFG, .ops = &msi_ops, }; static struct clk clk_sys = { .parent = &clk_pll3, .regofs = SIRFSOC_CLKC_SYS_CFG, .ops = &msi_ops, }; static struct clk clk_io = { .parent = &clk_pll3, .regofs = SIRFSOC_CLKC_IO_CFG, .ops = &msi_ops, }; /* * on-chip clock sets */ static struct clk_lookup onchip_clks[] = { { .dev_id = "rtc", .clk = &clk_rtc, }, { .dev_id = "osc", .clk = &clk_osc, }, { .dev_id = "pll1", .clk = &clk_pll1, }, { .dev_id = "pll2", .clk = &clk_pll2, }, { .dev_id = "pll3", .clk = &clk_pll3, }, { .dev_id = "cpu", .clk = &clk_cpu, }, { .dev_id = "mem", .clk = &clk_mem, }, { .dev_id = "sys", .clk = &clk_sys, }, { .dev_id = "io", .clk = &clk_io, }, }; int clk_enable(struct clk *clk) { unsigned long flags; if (unlikely(IS_ERR_OR_NULL(clk))) return -EINVAL; if (clk->parent) clk_enable(clk->parent); spin_lock_irqsave(&clocks_lock, flags); if (!clk->usage++ && clk->ops && clk->ops->enable) clk->ops->enable(clk); spin_unlock_irqrestore(&clocks_lock, flags); return 0; } EXPORT_SYMBOL(clk_enable); void clk_disable(struct clk *clk) { unsigned long flags; if (unlikely(IS_ERR_OR_NULL(clk))) return; WARN_ON(!clk->usage); spin_lock_irqsave(&clocks_lock, flags); if (--clk->usage == 0 && clk->ops && clk->ops->disable) clk->ops->disable(clk); spin_unlock_irqrestore(&clocks_lock, flags); if (clk->parent) clk_disable(clk->parent); } EXPORT_SYMBOL(clk_disable); unsigned long clk_get_rate(struct clk *clk) { if (unlikely(IS_ERR_OR_NULL(clk))) return 0; if (clk->rate) return clk->rate; if (clk->ops && clk->ops->get_rate) return clk->ops->get_rate(clk); return clk_get_rate(clk->parent); } EXPORT_SYMBOL(clk_get_rate); long clk_round_rate(struct clk *clk, unsigned long rate) { if (unlikely(IS_ERR_OR_NULL(clk))) return 0; if (clk->ops && clk->ops->round_rate) return clk->ops->round_rate(clk, rate); return 0; } EXPORT_SYMBOL(clk_round_rate); int clk_set_rate(struct clk *clk, unsigned long rate) { if (unlikely(IS_ERR_OR_NULL(clk))) return -EINVAL; if (!clk->ops || !clk->ops->set_rate) return -EINVAL; return clk->ops->set_rate(clk, rate); } EXPORT_SYMBOL(clk_set_rate); int clk_set_parent(struct clk *clk, struct clk *parent) { int ret; unsigned long flags; if (unlikely(IS_ERR_OR_NULL(clk))) return -EINVAL; if (!clk->ops || !clk->ops->set_parent) return -EINVAL; spin_lock_irqsave(&clocks_lock, flags); ret = clk->ops->set_parent(clk, parent); if (!ret) { parent->usage += clk->usage; clk->parent->usage -= clk->usage; BUG_ON(clk->parent->usage < 0); clk->parent = parent; } spin_unlock_irqrestore(&clocks_lock, flags); return ret; } EXPORT_SYMBOL(clk_set_parent); struct clk *clk_get_parent(struct clk *clk) { unsigned long flags; if (unlikely(IS_ERR_OR_NULL(clk))) return NULL; if (!clk->ops || !clk->ops->get_parent) return clk->parent; spin_lock_irqsave(&clocks_lock, flags); clk->parent = clk->ops->get_parent(clk); spin_unlock_irqrestore(&clocks_lock, flags); return clk->parent; } EXPORT_SYMBOL(clk_get_parent); static void __init sirfsoc_clk_init(void) { clkdev_add_table(onchip_clks, ARRAY_SIZE(onchip_clks)); } static struct of_device_id clkc_ids[] = { { .compatible = "sirf,prima2-clkc" }, {}, }; void __init sirfsoc_of_clk_init(void) { struct device_node *np; struct resource res; struct map_desc sirfsoc_clkc_iodesc = { .virtual = SIRFSOC_CLOCK_VA_BASE, .type = MT_DEVICE, }; np = of_find_matching_node(NULL, clkc_ids); if (!np) panic("unable to find compatible clkc node in dtb\n"); if (of_address_to_resource(np, 0, &res)) panic("unable to find clkc range in dtb"); of_node_put(np); sirfsoc_clkc_iodesc.pfn = __phys_to_pfn(res.start); sirfsoc_clkc_iodesc.length = 1 + res.end - res.start; iotable_init(&sirfsoc_clkc_iodesc, 1); sirfsoc_clk_init(); }
21.945205
79
0.668629
64bc53653bd4ed122845f5d9176539f93dadf123
5,109
c
C
hw/mcu/dialog/da1469x/src/hal_os_tick.c
tinocyngn/mynewt-core
98cb07656920a360f141a38dc32c97f9f2d042e9
[ "Apache-2.0" ]
535
2017-07-01T10:26:14.000Z
2022-03-25T20:45:29.000Z
hw/mcu/dialog/da1469x/src/hal_os_tick.c
tinocyngn/mynewt-core
98cb07656920a360f141a38dc32c97f9f2d042e9
[ "Apache-2.0" ]
1,178
2017-06-29T21:43:17.000Z
2022-03-30T12:53:16.000Z
hw/mcu/dialog/da1469x/src/hal_os_tick.c
tinocyngn/mynewt-core
98cb07656920a360f141a38dc32c97f9f2d042e9
[ "Apache-2.0" ]
316
2017-07-02T23:48:11.000Z
2022-03-27T13:37:09.000Z
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include <assert.h> #include "mcu/da1469x_clock.h" #include "mcu/da1469x_hal.h" #include "mcu/cmsis_nvic.h" #include "hal/hal_os_tick.h" #include "hal/hal_system.h" #include "os/os_trace_api.h" #include "da1469x_priv.h" #include "mcu/mcu.h" struct hal_os_tick { int ticks_per_ostick; os_time_t max_idle_ticks; uint32_t last_trigger_val; }; struct hal_os_tick g_hal_os_tick; /* * Implement (x - y) where the range of both 'x' and 'y' is limited to 24-bits. * * For example: * * sub24(0, 0xffffff) = 1 * sub24(0xffffff, 0xfffffe) = 1 * sub24(0xffffff, 0) = -1 * sub24(0x7fffff, 0) = 8388607 * sub24(0x800000, 0) = -8388608 */ static inline int sub24(uint32_t x, uint32_t y) { int result; assert(x <= 0xffffff); assert(y <= 0xffffff); result = x - y; if (result & 0x800000) { return (result | 0xff800000); } else { return (result & 0x007fffff); } } static inline uint32_t hal_os_tick_get_timer_val(void) { return TIMER2->TIMER2_TIMER_VAL_REG; } static inline void hal_os_tick_set_timer_trigger_val(uint32_t trigger_val) { uint32_t timer_val; int delta; while (1) { trigger_val &= 0xffffff; TIMER2->TIMER2_RELOAD_REG = trigger_val; timer_val = hal_os_tick_get_timer_val(); /* XXX Not sure what happens if we set TIMER2_RELOAD_REG to the same * value as TIMER2_TIMER_VAL_REG, so just in case this does not * trigger interrupt let's just move to next tick. */ delta = sub24(trigger_val, timer_val); if (delta > 0) { break; } trigger_val += g_hal_os_tick.ticks_per_ostick; } } static void hal_os_tick_handler(void) { uint32_t primask; uint32_t timer_val; int delta; int ticks; __HAL_DISABLE_INTERRUPTS(primask); /* Calculate elapsed ticks and advance OS time. */ timer_val = hal_os_tick_get_timer_val(); delta = sub24(timer_val, g_hal_os_tick.last_trigger_val); ticks = delta / g_hal_os_tick.ticks_per_ostick; os_time_advance(ticks); /* Clear timer interrupt */ TIMER2->TIMER2_CLEAR_IRQ_REG = 1; /* Update the time associated with the most recent tick */ g_hal_os_tick.last_trigger_val = (g_hal_os_tick.last_trigger_val + (ticks * g_hal_os_tick.ticks_per_ostick)) & 0xffffff; /* Update timer trigger value for interrupt at the next tick */ hal_os_tick_set_timer_trigger_val(g_hal_os_tick.last_trigger_val + g_hal_os_tick.ticks_per_ostick); __HAL_ENABLE_INTERRUPTS(primask); } static void hal_os_tick_timer2_isr(void) { os_trace_isr_enter(); hal_os_tick_handler(); os_trace_isr_exit(); } void os_tick_idle(os_time_t ticks) { uint32_t new_trigger_val; OS_ASSERT_CRITICAL(); if (ticks > 0) { if (ticks > g_hal_os_tick.max_idle_ticks) { ticks = g_hal_os_tick.max_idle_ticks; } new_trigger_val = g_hal_os_tick.last_trigger_val + (ticks * g_hal_os_tick.ticks_per_ostick); hal_os_tick_set_timer_trigger_val(new_trigger_val); } da1469x_sleep(ticks); if (ticks > 0) { hal_os_tick_handler(); } } void os_tick_init(uint32_t os_ticks_per_sec, int prio) { uint32_t primask; g_hal_os_tick.last_trigger_val = 0; #if MYNEWT_VAL_CHOICE(MCU_LPCLK_SOURCE, RCX) g_hal_os_tick.ticks_per_ostick = da1469x_clock_lp_rcx_freq_get() / os_ticks_per_sec; #else g_hal_os_tick.ticks_per_ostick = 32768 / os_ticks_per_sec; #endif g_hal_os_tick.max_idle_ticks = (1UL << 22) / g_hal_os_tick.ticks_per_ostick; TIMER2->TIMER2_CTRL_REG = 0; TIMER2->TIMER2_PRESCALER_REG = 0; TIMER2->TIMER2_CTRL_REG |= TIMER2_TIMER2_CTRL_REG_TIM_CLK_EN_Msk; TIMER2->TIMER2_CTRL_REG |= (TIMER2_TIMER2_CTRL_REG_TIM_FREE_RUN_MODE_EN_Msk | TIMER2_TIMER2_CTRL_REG_TIM_IRQ_EN_Msk | TIMER2_TIMER2_CTRL_REG_TIM_EN_Msk); __HAL_DISABLE_INTERRUPTS(primask); NVIC_SetPriority(TIMER2_IRQn, prio); NVIC_SetVector(TIMER2_IRQn, (uint32_t)hal_os_tick_timer2_isr); NVIC_EnableIRQ(TIMER2_IRQn); __HAL_ENABLE_INTERRUPTS(primask); }
27.031746
88
0.683695
26a79761edb93a9fec8e6c1e02da39da1c11b95a
233
h
C
src/hash_table_functions.h
codefootmen/hash-linear-probing
34793f9c6a87f5d1b188e8e48dac13198361092a
[ "MIT" ]
2
2019-06-25T12:06:30.000Z
2019-06-25T22:34:22.000Z
src/hash_table_functions.h
codefootmen/hash-linear-probing
34793f9c6a87f5d1b188e8e48dac13198361092a
[ "MIT" ]
null
null
null
src/hash_table_functions.h
codefootmen/hash-linear-probing
34793f9c6a87f5d1b188e8e48dac13198361092a
[ "MIT" ]
null
null
null
void print_hash_table(); int hash(int key); int delete_key(int key); int update_table(int value, int pos); void change(int pos, int previous); int get_next_position(int pos); int get_previous_position(int pos); void search(int key);
25.888889
37
0.772532