hexsha
stringlengths
40
40
size
int64
7
1.05M
ext
stringclasses
13 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
269
max_stars_repo_name
stringlengths
5
108
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
9
max_stars_count
float64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
4
269
max_issues_repo_name
stringlengths
5
116
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
9
max_issues_count
float64
1
77k
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
4
269
max_forks_repo_name
stringlengths
5
116
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
9
max_forks_count
float64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
7
1.05M
avg_line_length
float64
1.21
653k
max_line_length
int64
6
990k
alphanum_fraction
float64
0.01
1
671ca6f6fe06b1edc73fc3aaed7937d9f7a7399a
543
cpp
C++
TAO/tao/Storable_Factory.cpp
cflowe/ACE
5ff60b41adbe1772372d1a43bcc1f2726ff8f810
[ "DOC" ]
36
2015-01-10T07:27:33.000Z
2022-03-07T03:32:08.000Z
TAO/tao/Storable_Factory.cpp
cflowe/ACE
5ff60b41adbe1772372d1a43bcc1f2726ff8f810
[ "DOC" ]
2
2018-08-13T07:30:51.000Z
2019-02-25T03:04:31.000Z
TAO/tao/Storable_Factory.cpp
cflowe/ACE
5ff60b41adbe1772372d1a43bcc1f2726ff8f810
[ "DOC" ]
38
2015-01-08T14:12:06.000Z
2022-01-19T08:33:00.000Z
// -*- C++ -*- //============================================================================= /** * @file Storable_Factory.cpp * * $Id: Storable_Factory.cpp 96760 2013-02-05 21:11:03Z stanleyk $ * * @author Byron Harris <harrisb@ociweb.com> */ //============================================================================= #include "tao/Storable_Factory.h" TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO::Storable_Factory::Storable_Factory (void) { } TAO::Storable_Factory::~Storable_Factory (void) { } TAO_END_VERSIONED_NAMESPACE_DECL
20.884615
79
0.510129
671fb22bf156d02ccdb16b73138f40f99f753d9b
1,042
cpp
C++
course1/laba4/L_pairosochetatie_max_weight/main.cpp
flydzen/ITMO_algo
ea251dca0fddb0d4d212377c6785cdc3667ece89
[ "MIT" ]
null
null
null
course1/laba4/L_pairosochetatie_max_weight/main.cpp
flydzen/ITMO_algo
ea251dca0fddb0d4d212377c6785cdc3667ece89
[ "MIT" ]
null
null
null
course1/laba4/L_pairosochetatie_max_weight/main.cpp
flydzen/ITMO_algo
ea251dca0fddb0d4d212377c6785cdc3667ece89
[ "MIT" ]
null
null
null
#include <iostream> #include <vector> #include <fstream> using namespace std; vector<vector<pair<int, int>>> ss; vector<long long> a; vector<long long> b; vector<long long> c; void discrete_finger_simulation(int i, int from) { for (pair<int, int> p : ss[i]) { if (p.first == from) continue; discrete_finger_simulation(p.first, i); a[i] = max(a[i], b[p.first] + p.second - c[p.first]); b[i] += c[p.first]; } a[i] += b[i]; c[i] = max(a[i], b[i]); } int main() { ifstream fin("matching.in"); ofstream fout("matching.out"); int n; fin >> n; ss = vector<vector<pair<int, int>>>(n, vector<pair<int, int>>()); a = vector<long long>(n); b = vector<long long>(n); c = vector<long long>(n); for (int i = 0; i < n - 1; i++) { int f, t, w; fin >> f >> t >> w; ss[f - 1].push_back(make_pair(t - 1, w)); ss[t - 1].push_back(make_pair(f - 1, w)); } discrete_finger_simulation(0, -1); fout << c[0]; return 0; }
24.809524
69
0.52975
6720bd6af8045487c67d1df89445c5c7e2a4de00
819
cpp
C++
elf/strlen/jni/test_strlen.cpp
martinkro/doc-2017
6c8121b72786b7a2563a00dad78e481186643cd7
[ "MIT" ]
null
null
null
elf/strlen/jni/test_strlen.cpp
martinkro/doc-2017
6c8121b72786b7a2563a00dad78e481186643cd7
[ "MIT" ]
null
null
null
elf/strlen/jni/test_strlen.cpp
martinkro/doc-2017
6c8121b72786b7a2563a00dad78e481186643cd7
[ "MIT" ]
null
null
null
#include <jni.h> #include <string.h> #include <stdio.h> typedef int (*strlen_fun)(const char *); strlen_fun global_strlen1 = (strlen_fun)strlen; strlen_fun global_strlen2 = (strlen_fun)strlen; #define SHOW(x) printf("%s is %d", #x, x) jint Java_com_example_allhookinone_HookUtils_elfhook(JNIEnv* env,jobject thiz){ const char *str = "helloworld"; strlen_fun local_strlen1 = (strlen_fun)strlen; strlen_fun local_strlen2 = (strlen_fun)strlen; int len0 = global_strlen1(str); int len1 = global_strlen2(str); int len2 = local_strlen1(str); int len3 = local_strlen2(str); int len4 = strlen(str); int len5 = strlen(str); SHOW(len0); SHOW(len1); SHOW(len2); SHOW(len3); SHOW(len4); SHOW(len5); return 0; }
25.59375
79
0.637363
67218a76893c678f78f19e84b5a049d78bc74795
6,944
cc
C++
physicalrobots/player/examples/libplayerc++/goto.cc
parasol-ppl/PPL_utils
92728bb89692fda1705a0dee436592d97922a6cb
[ "BSD-3-Clause" ]
null
null
null
physicalrobots/player/examples/libplayerc++/goto.cc
parasol-ppl/PPL_utils
92728bb89692fda1705a0dee436592d97922a6cb
[ "BSD-3-Clause" ]
null
null
null
physicalrobots/player/examples/libplayerc++/goto.cc
parasol-ppl/PPL_utils
92728bb89692fda1705a0dee436592d97922a6cb
[ "BSD-3-Clause" ]
null
null
null
/* Copyright (c) 2005, Brad Kratochvil, Toby Collett, Brian Gerkey, Andrew Howard, ... 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. * Neither the name of the Player Project 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. */ /* * goto.cc - a simple (and bad) goto program * * but, it demonstrates one multi-threaded structure * * @todo: this has been ported to libplayerc++, but not tested AT ALL */ #include <libplayerc++/playerc++.h> #include <iostream> #include <stdlib.h> // for atof() #if !defined (WIN32) #include <unistd.h> #endif #include <math.h> #include <string> #include <boost/signal.hpp> #include <boost/bind.hpp> #define USAGE \ "USAGE: goto [-x <x>] [-y <y>] [-h <host>] [-p <port>] [-m]\n" \ " -x <x>: set the X coordinate of the target to <x>\n"\ " -y <y>: set the Y coordinate of the target to <y>\n"\ " -h <host>: connect to Player on this host\n" \ " -p <port>: connect to Player on this TCP port\n" \ " -m : turn on motors (be CAREFUL!)" PlayerCc::PlayerClient* robot; PlayerCc::Position2dProxy* pp; PlayerCc::SonarProxy* sp; bool gMotorEnable(false); bool gGotoDone(false); std::string gHostname(PlayerCc::PLAYER_HOSTNAME); uint32_t gPort(PlayerCc::PLAYER_PORTNUM); uint32_t gIndex(0); uint32_t gDebug(0); uint32_t gFrequency(10); // Hz player_pose2d_t gTarget = {0, 0, 0}; void print_usage(int argc, char** argv) { std::cout << USAGE << std::endl; } int parse_args(int argc, char** argv) { const char* optflags = "h:p:i:d:u:x:y:m"; int ch; while(-1 != (ch = getopt(argc, argv, optflags))) { switch(ch) { /* case values must match long_options */ case 'h': gHostname = optarg; break; case 'p': gPort = atoi(optarg); break; case 'i': gIndex = atoi(optarg); break; case 'd': gDebug = atoi(optarg); break; case 'u': gFrequency = atoi(optarg); break; case 'x': gTarget.px = atof(optarg); break; case 'y': gTarget.py = atof(optarg); break; case 'm': gMotorEnable = true; break; case '?': case ':': default: print_usage(argc, argv); return (-1); } } return (0); } /* * very bad goto. target is arg (as pos_t*) * * sets global 'gGotoDone' when it's done */ void position_goto(player_pose2d_t target) { using namespace PlayerCc; double dist, angle; dist = sqrt((target.px - pp->GetXPos())* (target.px - pp->GetXPos()) + (target.py - pp->GetYPos())* (target.py - pp->GetYPos())); angle = atan2(target.py - pp->GetYPos(), target.px - pp->GetXPos()); double newturnrate = 0; double newspeed = 0; if (fabs(rtod(angle)) > 10.0) { newturnrate = limit((angle/M_PI) * 40.0, -40.0, 40.0); newturnrate = dtor(newturnrate); } else newturnrate = 0.0; if (dist > 0.05) { newspeed = limit(dist * 0.200, -0.2, 0.2); } else newspeed = 0.0; if (fabs(newspeed) < 0.01) gGotoDone = true; pp->SetSpeed(newspeed, newturnrate); } /* * sonar avoid. * policy: * if(object really close in front) * backup and turn away; * else if(object close in front) * stop and turn away */ void sonar_avoid(void) { double min_front_dist = 0.500; double really_min_front_dist = 0.300; bool avoid = false; double newturnrate = 10.0; double newspeed = 10.0; if ((sp->GetScan(2) < really_min_front_dist) || (sp->GetScan(3) < really_min_front_dist) || (sp->GetScan(4) < really_min_front_dist) || (sp->GetScan(5) < really_min_front_dist)) { avoid = true; std::cerr << "really avoiding" << std::endl; newspeed = -0.100; } else if((sp->GetScan(2) < min_front_dist) || (sp->GetScan(3) < min_front_dist) || (sp->GetScan(4) < min_front_dist) || (sp->GetScan(5) < min_front_dist)) { avoid = true; std::cerr << "avoiding" << std::endl; newspeed = 0; } if(avoid) { if ((sp->GetScan(0) + sp->GetScan(1)) < (sp->GetScan(6) + sp->GetScan(7))) newturnrate = PlayerCc::dtor(30); else newturnrate = PlayerCc::dtor(-30); } if(newspeed < 10.0 && newturnrate < 10.0) pp->SetSpeed(newspeed, newturnrate); } template<typename T> void Print(T t) { std::cout << *t << std::endl; } int main(int argc, char **argv) { try { using namespace PlayerCc; parse_args(argc,argv); // Connect to Player server robot = new PlayerClient(gHostname, gPort); // Request sensor data pp = new Position2dProxy(robot, gIndex); sp = new SonarProxy(robot, gIndex); if(gMotorEnable) pp->SetMotorEnable(true); // output the data pp->ConnectReadSignal(boost::bind(&Print<Position2dProxy*>, pp)); sp->ConnectReadSignal(boost::bind(&Print<SonarProxy*>, sp)); // callback to avoid obstacles whenever we have new sonar data sp->ConnectReadSignal(&sonar_avoid); // start the read thread robot->StartThread(); std::cout << "goto starting, target: " << gTarget.px << ", " << gTarget.py << std::endl; for (;;) { position_goto(gTarget); if (gGotoDone) robot->StopThread(); timespec sleep = {0, 100000000}; // 100 ms nanosleep(&sleep, NULL); } } catch (PlayerCc::PlayerError & e) { std::cerr << e << std::endl; return -1; } return(0); }
25.068592
83
0.618952
67230243b18fae2b57fa419b50760d3f68cd775c
1,943
cpp
C++
base/crts/crtw32/misc/dbgdel.cpp
npocmaka/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
17
2020-11-13T13:42:52.000Z
2021-09-16T09:13:13.000Z
base/crts/crtw32/misc/dbgdel.cpp
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
2
2020-10-19T08:02:06.000Z
2020-10-19T08:23:18.000Z
base/crts/crtw32/misc/dbgdel.cpp
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
14
2020-11-14T09:43:20.000Z
2021-08-28T08:59:57.000Z
/*** *dbgnew.cpp - defines C++ scalar delete routine, debug version * * Copyright (c) 1995-2001, Microsoft Corporation. All rights reserved. * *Purpose: * Defines C++ scalar delete() routine. * *Revision History: * 12-28-95 JWM Split from dbgnew.cpp for granularity. * 05-22-98 JWM Support for KFrei's RTC work, and operator delete[]. * 07-28-98 JWM RTC update. * 05-26-99 KBF Updated RTC_Allocate_hook params * 10-21-99 PML Get rid of delete[], use heap\delete2.cpp for both * debug and release builds (vs7#53440). * 04-29-02 GB Added try-finally arounds lock-unlock. * *******************************************************************************/ #ifdef _DEBUG #include <cruntime.h> #include <malloc.h> #include <mtdll.h> #include <dbgint.h> #include <rtcsup.h> /*** *void operator delete() - delete a block in the debug heap * *Purpose: * Deletes any type of block. * *Entry: * void *pUserData - pointer to a (user portion) of memory block in the * debug heap * *Return: * <void> * *******************************************************************************/ void operator delete( void *pUserData ) { _CrtMemBlockHeader * pHead; RTCCALLBACK(_RTC_Free_hook, (pUserData, 0)); if (pUserData == NULL) return; _mlock(_HEAP_LOCK); /* block other threads */ __TRY /* get a pointer to memory block header */ pHead = pHdr(pUserData); /* verify block type */ _ASSERTE(_BLOCK_TYPE_IS_VALID(pHead->nBlockUse)); _free_dbg( pUserData, pHead->nBlockUse ); __FINALLY _munlock(_HEAP_LOCK); /* release other threads */ __END_TRY_FINALLY return; } #endif /* _DEBUG */
26.616438
81
0.519815
6725b0780abb7d9c0419b517fcf07d347c0c3a45
1,771
hpp
C++
asteria/src/reference.hpp
MaskRay/asteria
56a9251f5bb80b92e5aff25eac145f8cd2495096
[ "BSD-3-Clause" ]
null
null
null
asteria/src/reference.hpp
MaskRay/asteria
56a9251f5bb80b92e5aff25eac145f8cd2495096
[ "BSD-3-Clause" ]
null
null
null
asteria/src/reference.hpp
MaskRay/asteria
56a9251f5bb80b92e5aff25eac145f8cd2495096
[ "BSD-3-Clause" ]
null
null
null
// This file is part of Asteria. // Copyleft 2018, LH_Mouse. All wrongs reserved. #ifndef ASTERIA_REFERENCE_HPP_ #define ASTERIA_REFERENCE_HPP_ #include "fwd.hpp" #include "reference_root.hpp" #include "reference_modifier.hpp" namespace Asteria { class Reference { private: Reference_root m_root; Vector<Reference_modifier> m_mods; public: Reference() noexcept : m_root(), m_mods() { } // This constructor does not accept lvalues. template<typename XrootT, typename std::enable_if<(Reference_root::Variant::index_of<XrootT>::value || true)>::type * = nullptr> Reference(XrootT &&xroot) : m_root(std::forward<XrootT>(xroot)), m_mods() { } // This assignment operator does not accept lvalues. template<typename XrootT, typename std::enable_if<(Reference_root::Variant::index_of<XrootT>::value || true)>::type * = nullptr> Reference & operator=(XrootT &&xroot) { this->m_root = std::forward<XrootT>(xroot); this->m_mods.clear(); return *this; } ~Reference(); Reference(const Reference &) noexcept; Reference & operator=(const Reference &) noexcept; Reference(Reference &&) noexcept; Reference & operator=(Reference &&) noexcept; public: bool is_constant() const noexcept { return this->m_root.index() == Reference_root::index_constant; } Value read() const; Value & write(Value value) const; Value unset() const; Reference & zoom_in(Reference_modifier mod); Reference & zoom_out(); Reference & convert_to_temporary(); Reference & convert_to_variable(Global_context &global); void enumerate_variables(const Abstract_variable_callback &callback) const; }; } #endif
26.432836
132
0.671937
672705ff65970239683ce82be68db76924118ba7
1,160
cpp
C++
search_algorithms/coding_problems/search_sorted_rotated.cpp
sky-lynx/Algorithms
95592a73dcd1dc04be7df3ce3157e63230fac27b
[ "MIT" ]
null
null
null
search_algorithms/coding_problems/search_sorted_rotated.cpp
sky-lynx/Algorithms
95592a73dcd1dc04be7df3ce3157e63230fac27b
[ "MIT" ]
null
null
null
search_algorithms/coding_problems/search_sorted_rotated.cpp
sky-lynx/Algorithms
95592a73dcd1dc04be7df3ce3157e63230fac27b
[ "MIT" ]
null
null
null
// searches an element in an array which is sorted and then rotated #include <iostream> using namespace std; int binary_search(int* arr, int l, int r, int key) { int m; while(l != r) { m = (l + r) / 2; if(arr[m] == key) return m; else if(arr[m] > key) r = m - 1; else l = m + 1; } return -1; } int pivot_search(int* arr, int l, int r) { if(l < r) return -1; if(l == r) return l; int m = (l+r)/2; if(m < r && arr[m] > arr[m+1]) return m; if(m > l && arr[m] < arr[m-1]) return m-1; if(arr[l] >= arr[m]) return pivot_search(arr, l, m-1); return pivot_search(arr, m+1, r); } int pivoted_binary(int* arr, int l, int r, int key) { int pivot = pivot_search(arr, l, r); if(pivot == -1) return binary_search(arr, l, r, key); if(arr[pivot] == key) return pivot; if(arr[0] <= key) return binary_search(arr, l, pivot-1, key); return binary_search(arr, pivot+1, r, key); } int main(void) { int array[] = {4,5,6,7,8,1,2,3}; int left = 0; int right = (sizeof(array) / sizeof(*array)) - 1; cout<<pivoted_binary(array, left, right, 7)<<'\n'; return 0; }
17.575758
67
0.551724
672b1c0d09b5b2ffa2f2bddaf4536ef544fc227b
2,516
cpp
C++
kernel/main.cpp
ethan4984/rock
751b9af1009b622bedf384c1f80970b333c436c3
[ "BSD-2-Clause" ]
207
2020-05-27T21:57:28.000Z
2022-02-26T15:17:27.000Z
kernel/main.cpp
ethan4984/crepOS
751b9af1009b622bedf384c1f80970b333c436c3
[ "BSD-2-Clause" ]
3
2020-07-26T18:14:05.000Z
2020-12-09T05:32:07.000Z
kernel/main.cpp
ethan4984/rock
751b9af1009b622bedf384c1f80970b333c436c3
[ "BSD-2-Clause" ]
17
2020-07-05T19:08:48.000Z
2021-10-13T12:30:13.000Z
#include <mm/vmm.hpp> #include <mm/pmm.hpp> #include <mm/slab.hpp> #include <int/idt.hpp> #include <int/gdt.hpp> #include <int/apic.hpp> #include <fs/dev.hpp> #include <fs/vfs.hpp> #include <fs/fd.hpp> #include <drivers/hpet.hpp> #include <drivers/tty.hpp> #include <drivers/pci.hpp> #include <sched/smp.hpp> #include <sched/scheduler.hpp> #include <debug.hpp> #include <stivale.hpp> #include <font.hpp> static stivale *stivale_virt = NULL; extern "C" void _init(); extern "C" void __cxa_pure_virtual() { for(;;); } extern "C" int main(size_t stivale_phys) { cpuid_state cpu_id = cpuid(7, 0); if(cpu_id.rcx & (1 << 16)) { vmm::high_vma = 0xff00000000000000; } stivale_virt = reinterpret_cast<stivale*>(stivale_phys + vmm::high_vma); pmm::init(stivale_virt); kmm::cache(NULL, 0, 32); kmm::cache(NULL, 0, 64); kmm::cache(NULL, 0, 128); kmm::cache(NULL, 0, 256); kmm::cache(NULL, 0, 512); kmm::cache(NULL, 0, 1024); kmm::cache(NULL, 0, 2048); kmm::cache(NULL, 0, 4096); kmm::cache(NULL, 0, 8192); kmm::cache(NULL, 0, 16384); kmm::cache(NULL, 0, 32768); kmm::cache(NULL, 0, 65536); kmm::cache(NULL, 0, 131072); kmm::cache(NULL, 0, 262144); vmm::init(); _init(); x86::gdt_init(); x86::idt_init(); new x86::tss; acpi::rsdp_ptr = (acpi::rsdp*)(stivale_virt->rsdp + vmm::high_vma); if(acpi::rsdp_ptr->xsdt_addr) { acpi::xsdt_ptr = (acpi::xsdt*)(acpi::rsdp_ptr->xsdt_addr + vmm::high_vma); print("[ACPI] xsdt found at {x}\n", (size_t)(acpi::xsdt_ptr)); } else { acpi::rsdt_ptr = (acpi::rsdt*)(acpi::rsdp_ptr->rsdt_addr + vmm::high_vma); print("[ACPI] rsdt found at {x}\n", (size_t)(acpi::rsdt_ptr)); } lib::vector<vmm::region> region_list; cpu_init_features(); init_hpet(); apic::init(); smp::boot_aps(); dev::init(); tty::screen screen(stivale_virt); new tty::tty(screen, (uint8_t*)font_bitmap, 16, 8); asm ("sti"); pci::init(); apic::timer_calibrate(100); vfs::mount("sd0-0", "/"); const char *argv[] = { "/usr/bin/bash", NULL }; const char *envp[] = { "HOME=/", "PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin", "TERM=linux", NULL }; sched::arguments args(argv, envp); sched::task *new_task = new sched::task(-1); new_task->exec("/usr/bin/bash", 0x23, args, vfs::root_cluster->root_node); for(;;) asm ("pause"); }
22.666667
82
0.589825
6731e47e88a5f57bc5899ec39faf39129f015d54
154
cpp
C++
fastbuild-v1.02/Code/Tools/FBuild/FBuildTest/Data/TestObject/SourceMapping/File.cpp
jj4jj/TurboBuildUE4
497f0944c8d04d70e3656a34c145d21f431366a5
[ "MIT" ]
11
2020-08-28T02:11:22.000Z
2021-09-11T11:29:53.000Z
fastbuild-v1.02/Code/Tools/FBuild/FBuildTest/Data/TestObject/SourceMapping/File.cpp
jj4jj/TurboBuildUE4
497f0944c8d04d70e3656a34c145d21f431366a5
[ "MIT" ]
1
2020-11-23T13:35:00.000Z
2020-11-23T13:35:00.000Z
fastbuild-v1.02/Code/Tools/FBuild/FBuildTest/Data/TestObject/SourceMapping/File.cpp
jj4jj/TurboBuildUE4
497f0944c8d04d70e3656a34c145d21f431366a5
[ "MIT" ]
5
2020-10-22T11:16:11.000Z
2021-04-01T10:20:09.000Z
const char * Function() { // .obj file will contain filename, surrounded by these tokens return "FILE_MACRO_START(" __FILE__ ")FILE_MACRO_END"; }
25.666667
66
0.714286
6734e3cce0853a205bac21e8fbc28cf2dd7466a9
4,588
hpp
C++
src/core/NEON/kernels/arm_gemm/gemm_implementation.hpp
elenita1221/ComputeLibrary
3d2d44ef55ab6b08afda8be48301ce3c55c7bc67
[ "MIT" ]
2
2020-07-25T20:27:14.000Z
2021-08-22T17:20:59.000Z
src/core/NEON/kernels/arm_gemm/gemm_implementation.hpp
elenita1221/ComputeLibrary
3d2d44ef55ab6b08afda8be48301ce3c55c7bc67
[ "MIT" ]
null
null
null
src/core/NEON/kernels/arm_gemm/gemm_implementation.hpp
elenita1221/ComputeLibrary
3d2d44ef55ab6b08afda8be48301ce3c55c7bc67
[ "MIT" ]
1
2021-08-22T17:09:09.000Z
2021-08-22T17:09:09.000Z
/* * Copyright (c) 2018 ARM Limited. * * SPDX-License-Identifier: MIT * * 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 "gemv_batched.hpp" namespace arm_gemm { template<typename Top, typename Tret> class GemmImplementation { public: /* Is this implementation compatible with the args as provided? */ virtual bool is_supported(const GemmArgs<Tret> &args) { return true; } /* Is this implementation "recommended" for these args (heuristic)? */ virtual bool is_recommended(const GemmArgs<Tret> &args) { return true; } /* Instantiate this method please. */ virtual UniqueGemmCommon<Top, Tret> instantiate(const GemmArgs<Tret> &args) = 0; /* Indicate the "GemmMethod" for use as a selector */ const GemmMethod method; virtual ~GemmImplementation() { } GemmImplementation(GemmMethod method) : method(method) { } }; /* "gemv_batched" implementation is type-agnostic, so template it here. */ template<typename Top, typename Tret> class GemmImpl_gemv_batched : public GemmImplementation<Top, Tret> { public: bool is_supported(const GemmArgs<Tret> &args) override { return (args._Msize==1 && args._nbatches > 1); } UniqueGemmCommon<Top, Tret> instantiate(const GemmArgs<Tret> &args) override { return UniqueGemmCommon<Top, Tret> (new GemvBatched<Top, Tret>(args)); } GemmImpl_gemv_batched() : GemmImplementation<Top, Tret>(GemmMethod::GEMV_BATCHED) { } }; /* "Master" function implemented for each valid combination of types. * Returns a list of GEMM implementation descriptors for processing by the * other functions. */ template<typename Top, typename Tret> std::vector<GemmImplementation<Top, Tret> *> &gemm_implementation_list(); template<typename Top, typename Tret> GemmImplementation<Top, Tret> *find_implementation(GemmArgs<Tret> &args, GemmConfig *cfg) { auto gemms = gemm_implementation_list<Top, Tret>(); for(auto &&i : gemms) { /* Skip if this implementation doesn't support these args. */ if (!i->is_supported(args)) { continue; } /* Skip if a specific method is requested and this is a different one. */ if (cfg && cfg->method != GemmMethod::DEFAULT && i->method != cfg->method) { continue; } /* If no specific method is requested, check that this method recommends itself. */ if ((!cfg || cfg->method == GemmMethod::DEFAULT) && !i->is_recommended(args)) { continue; } return i; } return nullptr; } template<typename Top, typename Tret> UniqueGemmCommon<Top, Tret> gemm(GemmArgs<Tret> &args, GemmConfig *cfg) { auto impl = find_implementation<Top, Tret>(args, cfg); if (impl) { return impl->instantiate(args); } return UniqueGemmCommon<Top, Tret>(nullptr); } template<typename Top, typename Tret> GemmMethod get_gemm_method(GemmArgs<Tret> &args) { auto impl = find_implementation<Top, Tret>(args, nullptr); if (impl) { return impl->method; } /* This shouldn't happen - there should always be at least one valid implementation. */ return GemmMethod::DEFAULT; } template<typename Top, typename Tret> bool method_is_compatible(GemmMethod method, GemmArgs<Tret> &args) { /* Determine if the method is valid by attempting to obtain an implementation specifying this method. */ GemmConfig cfg(method); auto impl = find_implementation<Top, Tret>(args, &cfg); if (impl) { return true; } return false; } } // namespace arm_gemm
34.757576
108
0.700523
6736e6775cf4db401229a62885c84877683c0d0b
2,498
cpp
C++
Jan-3/src/ofApp.cpp
Lywa/Genuary
865ef0515eb986a175c565faa1fa56529a70f599
[ "MIT" ]
1
2022-01-06T09:34:03.000Z
2022-01-06T09:34:03.000Z
Jan-3/src/ofApp.cpp
Lywa/Genuary
865ef0515eb986a175c565faa1fa56529a70f599
[ "MIT" ]
null
null
null
Jan-3/src/ofApp.cpp
Lywa/Genuary
865ef0515eb986a175c565faa1fa56529a70f599
[ "MIT" ]
1
2022-01-06T09:34:04.000Z
2022-01-06T09:34:04.000Z
#include "ofApp.h" //-------------------------------------------------------------- void ofApp::setup(){ smileys.load("images/face_tiny.png"); smileysIcon.load("images/smileys_q.png"); smileysIcon.setImageType(OF_IMAGE_GRAYSCALE); } //-------------------------------------------------------------- void ofApp::update(){ ofBackground(255); } //-------------------------------------------------------------- void ofApp::draw(){ //smileys.draw(0, 0); // Code based on OF example: imageLoaderExample ofPixels & pixels = smileysIcon.getPixels(); ofSetColor(0, 0, 0); int w = smileysIcon.getWidth(); int h = smileysIcon.getHeight(); float diameter = 10; for(int y = 0; y < h; y++) { for(int x = 0; x < w; x++) { int index = y * w + x; unsigned char cur = pixels[index]; float size = 1 - ((float) cur / 255); int xPos = 30 + x * diameter; int yPos = 30 + y * diameter; int radius = 0.5 + size * diameter /2 ; ofDrawCircle(xPos, yPos, radius); //ofDrawRectangle(xPos, yPos, radius, radius); } } //ofSetColor(255); //smileysIcon.draw(100, 100, 20, 20); } //-------------------------------------------------------------- void ofApp::keyPressed(int key){ } //-------------------------------------------------------------- void ofApp::keyReleased(int key){ } //-------------------------------------------------------------- void ofApp::mouseMoved(int x, int y ){ } //-------------------------------------------------------------- void ofApp::mouseDragged(int x, int y, int button){ } //-------------------------------------------------------------- void ofApp::mousePressed(int x, int y, int button){ } //-------------------------------------------------------------- void ofApp::mouseReleased(int x, int y, int button){ } //-------------------------------------------------------------- void ofApp::mouseEntered(int x, int y){ } //-------------------------------------------------------------- void ofApp::mouseExited(int x, int y){ } //-------------------------------------------------------------- void ofApp::windowResized(int w, int h){ } //-------------------------------------------------------------- void ofApp::gotMessage(ofMessage msg){ } //-------------------------------------------------------------- void ofApp::dragEvent(ofDragInfo dragInfo){ }
23.790476
64
0.367894
6737d72ca34672087a62f5cb6b3721a688c9b01d
798
cc
C++
P1945.cc
daily-boj/kiwiyou
ceca96ddfee95708871af67d1682048e0bed0257
[ "Unlicense" ]
6
2020-04-08T09:04:57.000Z
2021-11-16T07:30:24.000Z
P1945.cc
daily-boj/kiwiyou
ceca96ddfee95708871af67d1682048e0bed0257
[ "Unlicense" ]
null
null
null
P1945.cc
daily-boj/kiwiyou
ceca96ddfee95708871af67d1682048e0bed0257
[ "Unlicense" ]
2
2020-04-16T05:32:06.000Z
2020-05-28T13:40:56.000Z
#include <bits/stdc++.h> using namespace std; struct Frac { long long u, d; bool operator<(const Frac& x) const { return u * x.d < d * x.u; } }; int main() { cin.tie(0)->sync_with_stdio(0); int n; cin >> n; vector<pair<Frac, bool>> segs; segs.reserve(n * 2); for (int i = 0; i < n; ++i) { int top, left, bottom, right; cin >> left >> bottom >> right >> top; segs.emplace_back(Frac { .u = bottom, .d = right }, false); segs.emplace_back(Frac { .u = top, .d = left }, true); } sort(segs.begin(), segs.end()); int max_depth = 0; int depth = 0; for (auto& [_, is_close] : segs) { if (is_close) --depth; else ++depth; max_depth = max(max_depth, depth); } cout << max_depth; }
26.6
67
0.518797
6738afa2382e2938dc55950d5d36183df773df51
6,465
cpp
C++
src/enclave/Enclave/Enclave.cpp
TaraMirmira/opaque
c909f47afa80e8306157c4213b4a7755b0c5f0fe
[ "Apache-2.0" ]
null
null
null
src/enclave/Enclave/Enclave.cpp
TaraMirmira/opaque
c909f47afa80e8306157c4213b4a7755b0c5f0fe
[ "Apache-2.0" ]
null
null
null
src/enclave/Enclave/Enclave.cpp
TaraMirmira/opaque
c909f47afa80e8306157c4213b4a7755b0c5f0fe
[ "Apache-2.0" ]
1
2020-09-27T06:43:42.000Z
2020-09-27T06:43:42.000Z
#include "Enclave_t.h" #include <cstdint> #include <cassert> #include "Aggregate.h" #include "Crypto.h" #include "Filter.h" #include "Join.h" #include "Project.h" #include "Sort.h" #include "isv_enclave.h" void ecall_encrypt(uint8_t *plaintext, uint32_t plaintext_length, uint8_t *ciphertext, uint32_t cipher_length) { // IV (12 bytes) + ciphertext + mac (16 bytes) assert(cipher_length >= plaintext_length + SGX_AESGCM_IV_SIZE + SGX_AESGCM_MAC_SIZE); (void)cipher_length; (void)plaintext_length; encrypt(plaintext, plaintext_length, ciphertext); } void ecall_decrypt(uint8_t *ciphertext, uint32_t ciphertext_length, uint8_t *plaintext, uint32_t plaintext_length) { // IV (12 bytes) + ciphertext + mac (16 bytes) assert(ciphertext_length >= plaintext_length + SGX_AESGCM_IV_SIZE + SGX_AESGCM_MAC_SIZE); (void)ciphertext_length; (void)plaintext_length; decrypt(ciphertext, ciphertext_length, plaintext); } void ecall_project(uint8_t *condition, size_t condition_length, uint8_t *input_rows, size_t input_rows_length, uint8_t **output_rows, size_t *output_rows_length) { project(condition, condition_length, input_rows, input_rows_length, output_rows, output_rows_length); } void ecall_filter(uint8_t *condition, size_t condition_length, uint8_t *input_rows, size_t input_rows_length, uint8_t **output_rows, size_t *output_rows_length) { filter(condition, condition_length, input_rows, input_rows_length, output_rows, output_rows_length); } void ecall_sample(uint8_t *input_rows, size_t input_rows_length, uint8_t **output_rows, size_t *output_rows_length) { sample(input_rows, input_rows_length, output_rows, output_rows_length); } void ecall_find_range_bounds(uint8_t *sort_order, size_t sort_order_length, uint32_t num_partitions, uint8_t *input_rows, size_t input_rows_length, uint8_t **output_rows, size_t *output_rows_length) { find_range_bounds(sort_order, sort_order_length, num_partitions, input_rows, input_rows_length, output_rows, output_rows_length); } void ecall_partition_for_sort(uint8_t *sort_order, size_t sort_order_length, uint32_t num_partitions, uint8_t *input_rows, size_t input_rows_length, uint8_t *boundary_rows, size_t boundary_rows_length, uint8_t **output_partitions, size_t *output_partition_lengths) { partition_for_sort(sort_order, sort_order_length, num_partitions, input_rows, input_rows_length, boundary_rows, boundary_rows_length, output_partitions, output_partition_lengths); } void ecall_external_sort(uint8_t *sort_order, size_t sort_order_length, uint8_t *input_rows, size_t input_rows_length, uint8_t **output_rows, size_t *output_rows_length) { external_sort(sort_order, sort_order_length, input_rows, input_rows_length, output_rows, output_rows_length); } void ecall_scan_collect_last_primary(uint8_t *join_expr, size_t join_expr_length, uint8_t *input_rows, size_t input_rows_length, uint8_t **output_rows, size_t *output_rows_length) { scan_collect_last_primary(join_expr, join_expr_length, input_rows, input_rows_length, output_rows, output_rows_length); } void ecall_non_oblivious_sort_merge_join(uint8_t *join_expr, size_t join_expr_length, uint8_t *input_rows, size_t input_rows_length, uint8_t *join_row, size_t join_row_length, uint8_t **output_rows, size_t *output_rows_length) { non_oblivious_sort_merge_join(join_expr, join_expr_length, input_rows, input_rows_length, join_row, join_row_length, output_rows, output_rows_length); } void ecall_non_oblivious_aggregate_step1( uint8_t *agg_op, size_t agg_op_length, uint8_t *input_rows, size_t input_rows_length, uint8_t **first_row, size_t *first_row_length, uint8_t **last_group, size_t *last_group_length, uint8_t **last_row, size_t *last_row_length) { non_oblivious_aggregate_step1( agg_op, agg_op_length, input_rows, input_rows_length, first_row, first_row_length, last_group, last_group_length, last_row, last_row_length); } void ecall_non_oblivious_aggregate_step2( uint8_t *agg_op, size_t agg_op_length, uint8_t *input_rows, size_t input_rows_length, uint8_t *next_partition_first_row, size_t next_partition_first_row_length, uint8_t *prev_partition_last_group, size_t prev_partition_last_group_length, uint8_t *prev_partition_last_row, size_t prev_partition_last_row_length, uint8_t **output_rows, size_t *output_rows_length) { non_oblivious_aggregate_step2( agg_op, agg_op_length, input_rows, input_rows_length, next_partition_first_row, next_partition_first_row_length, prev_partition_last_group, prev_partition_last_group_length, prev_partition_last_row, prev_partition_last_row_length, output_rows, output_rows_length); } sgx_status_t ecall_enclave_init_ra(int b_pse, sgx_ra_context_t *p_context) { return enclave_init_ra(b_pse, p_context); } void ecall_enclave_ra_close(sgx_ra_context_t context) { enclave_ra_close(context); } sgx_status_t ecall_verify_att_result_mac(sgx_ra_context_t context, uint8_t* message, size_t message_size, uint8_t* mac, size_t mac_size) { return verify_att_result_mac(context, message, message_size, mac, mac_size); } sgx_status_t ecall_put_secret_data(sgx_ra_context_t context, uint8_t* p_secret, uint32_t secret_size, uint8_t* gcm_mac) { return put_secret_data(context, p_secret, secret_size, gcm_mac); }
41.178344
94
0.670998
673d4e691c78287353086652ae0a2ba79d09840e
2,247
cpp
C++
src/animation_widget.cpp
CourrierGui/plotcpp
00b5a94e4c9804cbc441a0bcede67f70cef08a0c
[ "MIT" ]
null
null
null
src/animation_widget.cpp
CourrierGui/plotcpp
00b5a94e4c9804cbc441a0bcede67f70cef08a0c
[ "MIT" ]
null
null
null
src/animation_widget.cpp
CourrierGui/plotcpp
00b5a94e4c9804cbc441a0bcede67f70cef08a0c
[ "MIT" ]
null
null
null
#include <animation_widget.hpp> #include <plotwidget.hpp> #include <iostream> #include <QElapsedTimer> #include <QTimer> namespace pcpp { AnimationWidget::AnimationWidget( int rows, int cols, QWidget* parent) : _plot{rows, cols, parent}, _actions{}, _continue{true}, _qtime{new QElapsedTimer} { } void AnimationWidget::init(const std::function<void(PlotWrapper&)>& setup) { setup(_plot); } void AnimationWidget::add(int msec, const Action& action) { auto* timer = new QTimer{_plot.context().get()}; timer->setInterval(msec); _actions.push_back({timer, action}); } void AnimationWidget::start() { if (!_actions.empty()) { auto action_it = _actions.begin(); while (action_it != _actions.end()) { auto action = action_it->second; auto* timer = action_it->first; if ((action_it+1) != _actions.end()) { auto* next_timer = (action_it+1)->first; QObject::connect( timer, &QTimer::timeout, [this, action, timer, next_timer]() { if (_continue) { int64_t time = _qtime->elapsed(); _continue = action(time, _plot); } else { timer->stop(); _qtime->start(); _continue = true; next_timer->start(); } } ); } else { QObject::connect( timer, &QTimer::timeout, [this, action, timer]() { if (_continue) { int64_t time = _qtime->elapsed(); _continue = action(time, _plot); } else { timer->stop(); _continue = true; } } ); } ++action_it; } auto* first_timer = new QTimer{_plot.context().get()}; first_timer->setInterval(5); QObject::connect( first_timer, &QTimer::timeout, [first_timer, this]() { first_timer->stop(); _actions.front().first->start(); _qtime->start(); } ); first_timer->start(); } _plot.show(); } } /* end of namespace pcpp */
25.827586
78
0.503783
673f96702ef633f29305647846c1175b933abcae
7,963
cpp
C++
cpp/opendnp3/src/opendnp3/master/Master.cpp
tarm/dnp3_orig
87c639b3462c980fba255e85793f6ec663abe981
[ "Apache-2.0" ]
null
null
null
cpp/opendnp3/src/opendnp3/master/Master.cpp
tarm/dnp3_orig
87c639b3462c980fba255e85793f6ec663abe981
[ "Apache-2.0" ]
null
null
null
cpp/opendnp3/src/opendnp3/master/Master.cpp
tarm/dnp3_orig
87c639b3462c980fba255e85793f6ec663abe981
[ "Apache-2.0" ]
3
2016-07-13T18:54:13.000Z
2021-04-12T13:30:39.000Z
/** * Licensed to Green Energy Corp (www.greenenergycorp.com) under one or * more contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright ownership. * Green Energy Corp 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. * * This project was forked on 01/01/2013 by Automatak, LLC and modifications * may have been made to this file. Automatak, LLC licenses these modifications * to you under the terms of the License. */ #include "Master.h" #include "opendnp3/master/MasterStates.h" #include "opendnp3/master/MeasurementHandler.h" #include "opendnp3/master/ConstantCommandProcessor.h" #include "opendnp3/master/AsyncTaskInterfaces.h" #include "opendnp3/master/AsyncTaskGroup.h" #include "opendnp3/master/AsyncTaskBase.h" #include "opendnp3/master/AsyncTaskPeriodic.h" #include "opendnp3/master/AsyncTaskNonPeriodic.h" #include "opendnp3/master/AsyncTaskContinuous.h" #include "opendnp3/app/APDUParser.h" #include "opendnp3/app/APDURequest.h" #include "opendnp3/LogLevels.h" #include <openpal/IExecutor.h> #include <openpal/LogMacros.h> using namespace openpal; namespace opendnp3 { Master::Master(LogRoot& root, MasterConfig aCfg, IAppLayer* apAppLayer, ISOEHandler* apSOEHandler, AsyncTaskGroup* apTaskGroup, openpal::IExecutor* apExecutor, IUTCTimeSource* apTimeSrc) : IAppUser(root), pExecutor(apExecutor), mpAppLayer(apAppLayer), mpSOEHandler(apSOEHandler), mpTaskGroup(apTaskGroup), mpTimeSrc(apTimeSrc), mpState(AMS_Closed::Inst()), mpTask(nullptr), mpScheduledTask(nullptr), mSchedule(apTaskGroup, this, aCfg), mClassPoll(logger, apSOEHandler), mClearRestart(logger), mConfigureUnsol(logger), mTimeSync(logger, apTimeSrc), mCommandTask(logger), mCommandQueue(apExecutor, mSchedule.mpCommandTask) { } void Master::ProcessIIN(const IINField& iin) { mLastIIN = iin; bool check_state = false; //The clear IIN task only happens in response to detecting an IIN bit. if(mLastIIN.IsSet(IINBit::NEED_TIME)) { SIMPLE_LOG_BLOCK(logger, flags::INFO, "Need time detected"); mSchedule.mpTimeTask->SilentEnable(); check_state = true; } if (mLastIIN.IsSet(IINBit::DEVICE_TROUBLE)) { SIMPLE_LOG_BLOCK(logger, flags::WARN, "IIN Device trouble detected"); } if (mLastIIN.IsSet(IINBit::EVENT_BUFFER_OVERFLOW)) { SIMPLE_LOG_BLOCK(logger, flags::WARN, "Event buffer overflow detected"); } // If this is detected, we need to reset the startup tasks if(mLastIIN.IsSet(IINBit::DEVICE_RESTART)) { SIMPLE_LOG_BLOCK(logger, flags::WARN, "Device restart detected"); mSchedule.ResetStartupTasks(); mSchedule.mpClearRestartTask->SilentEnable(); check_state = true; } if(check_state) mpTaskGroup->CheckState(); } void Master::ProcessCommand(ITask* apTask) { if(mpState == AMS_Closed::Inst()) //we're closed { ConstantCommandProcessor ccp(pExecutor, CommandResponse(CommandResult::NO_COMMS)); while(mCommandQueue.Dispatch(&ccp)); apTask->Disable(); } else { if(mCommandQueue.Dispatch(this)) { mpState->StartTask(this, apTask, &mCommandTask); } else apTask->Disable(); } } void Master::SelectAndOperate(const ControlRelayOutputBlock& command, uint16_t index, ICommandCallback* pCallback) { this->mCommandTask.ConfigureSBO(command, index, pCallback); } void Master::SelectAndOperate(const AnalogOutputInt32& command, uint16_t index, ICommandCallback* pCallback) { this->mCommandTask.ConfigureSBO(command, index, pCallback); } void Master::SelectAndOperate(const AnalogOutputInt16& command, uint16_t index, ICommandCallback* pCallback) { this->mCommandTask.ConfigureSBO(command, index, pCallback); } void Master::SelectAndOperate(const AnalogOutputFloat32& command, uint16_t index, ICommandCallback* pCallback) { this->mCommandTask.ConfigureSBO(command, index, pCallback); } void Master::SelectAndOperate(const AnalogOutputDouble64& command, uint16_t index, ICommandCallback* pCallback) { this->mCommandTask.ConfigureSBO(command, index, pCallback); } void Master::DirectOperate(const ControlRelayOutputBlock& command, uint16_t index, ICommandCallback* pCallback) { this->mCommandTask.ConfigureDO(command, index, pCallback); } void Master::DirectOperate(const AnalogOutputInt32& command, uint16_t index, ICommandCallback* pCallback) { this->mCommandTask.ConfigureDO(command, index, pCallback); } void Master::DirectOperate(const AnalogOutputInt16& command, uint16_t index, ICommandCallback* pCallback) { this->mCommandTask.ConfigureDO(command, index, pCallback); } void Master::DirectOperate(const AnalogOutputFloat32& command, uint16_t index, ICommandCallback* pCallback) { this->mCommandTask.ConfigureDO(command, index, pCallback); } void Master::DirectOperate(const AnalogOutputDouble64& command, uint16_t index, ICommandCallback* pCallback) { this->mCommandTask.ConfigureDO(command, index, pCallback); } void Master::StartTask(MasterTaskBase* apMasterTask, bool aInit) { if(aInit) apMasterTask->Init(); APDURequest request(this->requestBuffer.GetWriteBuffer()); request.SetControl(AppControlField(true, true, false, false).ToByte()); apMasterTask->ConfigureRequest(request); mpAppLayer->SendRequest(request); } /* Tasks */ void Master::SyncTime(ITask* apTask) { if(mLastIIN.IsSet(IINBit::NEED_TIME)) { mpState->StartTask(this, apTask, &mTimeSync); } else apTask->Disable(); } void Master::WriteIIN(ITask* apTask) { if(mLastIIN.IsSet(IINBit::DEVICE_RESTART)) { mpState->StartTask(this, apTask, &mClearRestart); } else apTask->Disable(); } void Master::IntegrityPoll(ITask* apTask) { mClassPoll.Set(CLASS_1 | CLASS_2 | CLASS_3 | CLASS_0); mpState->StartTask(this, apTask, &mClassPoll); } void Master::EventPoll(ITask* apTask, int aClassMask) { mClassPoll.Set(aClassMask); mpState->StartTask(this, apTask, &mClassPoll); } void Master::ChangeUnsol(ITask* apTask, bool aEnable, int aClassMask) { mConfigureUnsol.Set(aEnable, aClassMask); mpState->StartTask(this, apTask, &mConfigureUnsol); } MasterScan Master::GetIntegrityScan() { return MasterScan(pExecutor, mSchedule.mpIntegrityPoll); } MasterScan Master::AddClassScan(int aClassMask, openpal::TimeDuration aScanRate, openpal::TimeDuration aRetryRate) { auto pTask = mSchedule.AddClassScan(aClassMask, aScanRate, aRetryRate); return MasterScan(pExecutor, pTask); } /* Implement IAppUser */ void Master::OnLowerLayerUp() { mpState->OnLowerLayerUp(this); mSchedule.EnableOnlineTasks(); } void Master::OnLowerLayerDown() { mpState->OnLowerLayerDown(this); mSchedule.DisableOnlineTasks(); } void Master::OnSolSendSuccess() { mpState->OnSendSuccess(this); } void Master::OnSolFailure() { mpState->OnFailure(this); } void Master::OnUnsolSendSuccess() { SIMPLE_LOG_BLOCK(logger, flags::ERR, "Master can't send unsol"); } void Master::OnUnsolFailure() { SIMPLE_LOG_BLOCK(logger, flags::ERR, "Master can't send unsol"); } void Master::OnPartialResponse(const APDUResponseRecord& aRecord) { mpState->OnPartialResponse(this, aRecord); } void Master::OnFinalResponse(const APDUResponseRecord& aRecord) { mpState->OnFinalResponse(this, aRecord); } void Master::OnUnsolResponse(const APDUResponseRecord& aRecord) { mpState->OnUnsolResponse(this, aRecord); } /* Private functions */ void Master::ProcessDataResponse(const APDUResponseRecord& record) { MeasurementHandler handler(logger, this->mpSOEHandler); APDUParser::ParseTwoPass(record.objects, &handler, &logger); } } //end ns
27.364261
188
0.771317
67441b108ccb6440a5e7333e0263e018224a5db1
6,086
cpp
C++
Sankore-3.1/src/domain/UBGraphicsEllipseItem.cpp
eaglezzb/rsdc
cce881f6542ff206bf286cf798c8ec8da3b51d50
[ "MIT" ]
null
null
null
Sankore-3.1/src/domain/UBGraphicsEllipseItem.cpp
eaglezzb/rsdc
cce881f6542ff206bf286cf798c8ec8da3b51d50
[ "MIT" ]
null
null
null
Sankore-3.1/src/domain/UBGraphicsEllipseItem.cpp
eaglezzb/rsdc
cce881f6542ff206bf286cf798c8ec8da3b51d50
[ "MIT" ]
null
null
null
/* * Copyright (C) 2010-2013 Groupement d'Intérêt Public pour l'Education Numérique en Afrique (GIP ENA) * * This file is part of Open-Sankoré. * * Open-Sankoré 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, version 3 of the License, * with a specific linking exception for the OpenSSL project's * "OpenSSL" library (or with modified versions of it that use the * same license as the "OpenSSL" library). * * Open-Sankoré 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 Open-Sankoré. If not, see <http://www.gnu.org/licenses/>. */ #include "UBGraphicsEllipseItem.h" UB3HEditableGraphicsEllipseItem::UB3HEditableGraphicsEllipseItem(QGraphicsItem* parent): UB3HEditablesGraphicsBasicShapeItem(parent) { // Ellipse has Stroke and Fill capabilities : initializeStrokeProperty(); initializeFillingProperty(); mRadiusX = 0; mRadiusY = 0; } UB3HEditableGraphicsEllipseItem::~UB3HEditableGraphicsEllipseItem() { } UBItem *UB3HEditableGraphicsEllipseItem::deepCopy() const { UB3HEditableGraphicsEllipseItem* copy = new UB3HEditableGraphicsEllipseItem(); copyItemParameters(copy); return copy; } void UB3HEditableGraphicsEllipseItem::copyItemParameters(UBItem *copy) const { UB3HEditablesGraphicsBasicShapeItem::copyItemParameters(copy); UB3HEditableGraphicsEllipseItem *cp = dynamic_cast<UB3HEditableGraphicsEllipseItem*>(copy); if(cp){ cp->mRadiusX = mRadiusX; cp->mRadiusY = mRadiusY; } } QPointF UB3HEditableGraphicsEllipseItem::center() const { QPointF centre; centre.setX(pos().x() + mRadiusX); centre.setY(pos().y() + mRadiusY); return centre; } void UB3HEditableGraphicsEllipseItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { Q_UNUSED(option) Q_UNUSED(widget) setStyle(painter); int rx = (mRadiusX < 0 ? -mRadiusX : mRadiusX); int ry = (mRadiusY < 0 ? -mRadiusY : mRadiusY); int x = (mRadiusX < 0 ? mRadiusX : 0); int y = (mRadiusY < 0 ? mRadiusY : 0); //N/C - NNE - 20140312 : Litle work around for avoid crash under MacOs 10.9 QPainterPath path; path.addEllipse(QRectF(x*2, y*2, rx*2, ry*2)); painter->drawPath(path); if(isInEditMode()){ QPen p; p.setColor(QColor(128, 128, 200)); p.setStyle(Qt::DotLine); p.setWidth(pen().width()); painter->setPen(p); painter->setBrush(QBrush()); painter->drawRect(0, 0, mRadiusX*2, mRadiusY*2); } } QRectF UB3HEditableGraphicsEllipseItem::boundingRect() const { int x = (mRadiusX < 0 ? mRadiusX : 0); int y = (mRadiusY < 0 ? mRadiusY : 0); int rx = (mRadiusX < 0 ? -mRadiusX : mRadiusX); int ry = (mRadiusY < 0 ? -mRadiusY : mRadiusY); rx *= 2; ry *= 2; x *= 2; y *= 2; QRectF rect(x, y, rx, ry); rect = adjustBoundingRect(rect); return rect; } void UB3HEditableGraphicsEllipseItem::onActivateEditionMode() { verticalHandle()->setPos(mRadiusX, mRadiusY*2); horizontalHandle()->setPos(mRadiusX*2, mRadiusY); diagonalHandle()->setPos(mRadiusX*2, mRadiusY*2); } void UB3HEditableGraphicsEllipseItem::updateHandle(UBAbstractHandle *handle) { prepareGeometryChange(); qreal maxSize = handle->radius() * 4; if(handle->getId() == 1){ //it's the vertical handle if(handle->pos().y() >= maxSize){ mRadiusY = handle->pos().y() / 2; } }else if(handle->getId() == 0){ //it's the horizontal handle if(handle->pos().x() >= maxSize){ mRadiusX = handle->pos().x() / 2; } }else{ //it's the diagonal handle if(handle->pos().x() >= maxSize && handle->pos().y() >= maxSize){ float ratio = mRadiusY / mRadiusX; if(mRadiusX > mRadiusY){ mRadiusX = handle->pos().x() / 2; mRadiusY = ratio * mRadiusX; }else{ mRadiusY = handle->pos().y() / 2; mRadiusX = 1/ratio * mRadiusY; } } } verticalHandle()->setPos(mRadiusX, mRadiusY*2); horizontalHandle()->setPos(mRadiusX*2, mRadiusY); diagonalHandle()->setPos(mRadiusX*2, mRadiusY*2); if(hasGradient()){ QLinearGradient g(QPointF(), QPointF(mRadiusX*2, 0)); g.setColorAt(0, brush().gradient()->stops().at(0).second); g.setColorAt(1, brush().gradient()->stops().at(1).second); setBrush(g); } } QPainterPath UB3HEditableGraphicsEllipseItem::shape() const { QPainterPath path; if(isInEditMode()){ path.addRect(boundingRect()); }else{ path.addEllipse(boundingRect()); } return path; } void UB3HEditableGraphicsEllipseItem::setRadiusX(qreal radius) { prepareGeometryChange(); mRadiusX = radius; } void UB3HEditableGraphicsEllipseItem::setRadiusY(qreal radius) { prepareGeometryChange(); mRadiusY = radius; } void UB3HEditableGraphicsEllipseItem::setRect(QRectF rect){ prepareGeometryChange(); setPos(rect.topLeft()); mRadiusX = rect.width()/2; mRadiusY = rect.height()/2; if(hasGradient()){ QLinearGradient g(QPointF(), QPointF(mRadiusX*2, 0)); g.setColorAt(0, brush().gradient()->stops().at(0).second); g.setColorAt(1, brush().gradient()->stops().at(1).second); setBrush(g); } } QRectF UB3HEditableGraphicsEllipseItem::rect() const { QRectF r; r.setTopLeft(pos()); r.setWidth(mRadiusX*2); r.setHeight(mRadiusY*2); return r; } qreal UB3HEditableGraphicsEllipseItem::radiusX() const { return mRadiusX; } qreal UB3HEditableGraphicsEllipseItem::radiusY() const { return mRadiusY; }
25.464435
119
0.651002
674773b616afc8e7d9f9b0fb29de3211aa0096cc
19,627
cpp
C++
TransferLogManager.cpp
agomez0207/wdt
d85fd11b14ae835e88cfffe970284fcf42866b18
[ "BSD-3-Clause" ]
1
2020-07-19T21:21:11.000Z
2020-07-19T21:21:11.000Z
TransferLogManager.cpp
agomez0207/wdt
d85fd11b14ae835e88cfffe970284fcf42866b18
[ "BSD-3-Clause" ]
null
null
null
TransferLogManager.cpp
agomez0207/wdt
d85fd11b14ae835e88cfffe970284fcf42866b18
[ "BSD-3-Clause" ]
null
null
null
/** * Copyright (c) 2014-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ #include "TransferLogManager.h" #include <wdt/WdtConfig.h> #include "ErrorCodes.h" #include "WdtOptions.h" #include "SerializationUtil.h" #include "Reporting.h" #include <folly/Range.h> #include <folly/ScopeGuard.h> #include <folly/Bits.h> #include <fcntl.h> #include <sys/stat.h> #include <map> #include <ctime> #include <iomanip> namespace facebook { namespace wdt { void TransferLogManager::setRootDir(const std::string &rootDir) { rootDir_ = rootDir; } std::string TransferLogManager::getFullPath(const std::string &relPath) { WDT_CHECK(!rootDir_.empty()) << "Root directory not set"; std::string fullPath = rootDir_; if (fullPath.back() != '/') { fullPath.push_back('/'); } fullPath.append(relPath); return fullPath; } int TransferLogManager::open() { WDT_CHECK(!rootDir_.empty()) << "Root directory not set"; auto openFlags = O_CREAT | O_WRONLY | O_APPEND; int fd = ::open(getFullPath(LOG_NAME).c_str(), openFlags, 0644); if (fd < 0) { PLOG(ERROR) << "Could not open wdt log"; } return fd; } bool TransferLogManager::openAndStartWriter() { WDT_CHECK(fd_ == -1) << "Trying to open wdt log multiple times"; fd_ = open(); if (fd_ < 0) { return false; } else { writerThread_ = std::move(std::thread(&TransferLogManager::writeEntriesToDisk, this)); LOG(INFO) << "Log writer thread started " << fd_; return true; } } void TransferLogManager::enableLogging() { loggingEnabled_ = true; } int64_t TransferLogManager::timestampInMicroseconds() const { auto timestamp = Clock::now(); return std::chrono::duration_cast<std::chrono::microseconds>( timestamp.time_since_epoch()).count(); } std::string TransferLogManager::getFormattedTimestamp(int64_t timestampMicros) { // This assumes Clock's epoch is Posix's epoch (1970/1/1) // to_time_t is unfortunately only on the system_clock and not // on high_resolution_clock (on MacOS at least it isn't) time_t seconds = timestampMicros / kMicroToSec; int microseconds = timestampMicros - seconds * kMicroToSec; // need 25 bytes to encode date in format mm/dd/yy HH:MM:SS.MMMMMM char buf[25]; struct tm tm; localtime_r(&seconds, &tm); snprintf(buf, sizeof(buf), "%02d/%02d/%02d %02d:%02d:%02d.%06d", tm.tm_mon + 1, tm.tm_mday, (tm.tm_year % 100), tm.tm_hour, tm.tm_min, tm.tm_sec, microseconds); return buf; } void TransferLogManager::addLogHeader(const std::string &recoveryId) { if (!loggingEnabled_ || fd_ < 0) { return; } VLOG(1) << "Adding log header " << LOG_VERSION << " " << recoveryId; char buf[kMaxEntryLength]; // increment by 2 bytes to later store the total length char *ptr = buf + sizeof(int16_t); int64_t size = 0; ptr[size++] = HEADER; encodeInt(ptr, size, timestampInMicroseconds()); encodeInt(ptr, size, LOG_VERSION); encodeString(ptr, size, recoveryId); folly::storeUnaligned<int16_t>(buf, size); std::lock_guard<std::mutex> lock(mutex_); entries_.emplace_back(buf, size + sizeof(int16_t)); } void TransferLogManager::addFileCreationEntry(const std::string &fileName, int64_t seqId, int64_t fileSize) { if (!loggingEnabled_ || fd_ < 0) { return; } VLOG(1) << "Adding file entry to log " << fileName << " " << seqId << " " << fileSize; char buf[kMaxEntryLength]; // increment by 2 bytes to later store the total length char *ptr = buf + sizeof(int16_t); int64_t size = 0; ptr[size++] = FILE_CREATION; encodeInt(ptr, size, timestampInMicroseconds()); encodeString(ptr, size, fileName); encodeInt(ptr, size, seqId); encodeInt(ptr, size, fileSize); folly::storeUnaligned<int16_t>(buf, size); std::lock_guard<std::mutex> lock(mutex_); entries_.emplace_back(buf, size + sizeof(int16_t)); } void TransferLogManager::addBlockWriteEntry(int64_t seqId, int64_t offset, int64_t blockSize) { if (!loggingEnabled_ || fd_ < 0) { return; } VLOG(1) << "Adding block entry to log " << seqId << " " << offset << " " << blockSize; char buf[kMaxEntryLength]; // increment by 2 bytes to later store the total length char *ptr = buf + sizeof(int16_t); int64_t size = 0; ptr[size++] = BLOCK_WRITE; encodeInt(ptr, size, timestampInMicroseconds()); encodeInt(ptr, size, seqId); encodeInt(ptr, size, offset); encodeInt(ptr, size, blockSize); folly::storeUnaligned<int16_t>(buf, size); std::lock_guard<std::mutex> lock(mutex_); entries_.emplace_back(buf, size + sizeof(int16_t)); } void TransferLogManager::addInvalidationEntry(int64_t seqId) { if (!loggingEnabled_ || fd_ < 0) { return; } VLOG(1) << "Adding invalidation entry " << seqId; char buf[kMaxEntryLength]; int64_t size = 0; encodeInvalidationEntry(buf, size, seqId); std::lock_guard<std::mutex> lock(mutex_); entries_.emplace_back(buf, size + sizeof(int16_t)); } bool TransferLogManager::close() { if (fd_ < 0) { return false; } if (::close(fd_) != 0) { PLOG(ERROR) << "Failed to close wdt log " << fd_; fd_ = -1; return false; } LOG(INFO) << "wdt log closed"; fd_ = -1; return true; } bool TransferLogManager::unlink() { std::string fullLogName = getFullPath(LOG_NAME); if (::unlink(fullLogName.c_str()) != 0) { PLOG(ERROR) << "Could not unlink " << fullLogName; return false; } return true; } bool TransferLogManager::closeAndStopWriter() { if (fd_ < 0) { return false; } { std::lock_guard<std::mutex> lock(mutex_); finished_ = true; conditionFinished_.notify_all(); } writerThread_.join(); WDT_CHECK(entries_.empty()); if (!close()) { return false; } return true; } void TransferLogManager::writeEntriesToDisk() { WDT_CHECK(fd_ >= 0) << "Writer thread started before the log is opened"; auto &options = WdtOptions::get(); WDT_CHECK(options.transfer_log_write_interval_ms >= 0); auto waitingTime = std::chrono::milliseconds(options.transfer_log_write_interval_ms); std::vector<std::string> entries; bool finished = false; while (!finished) { { std::unique_lock<std::mutex> lock(mutex_); conditionFinished_.wait_for(lock, waitingTime); finished = finished_; // make a copy of all the entries so that we do not need to hold lock // during writing entries = entries_; entries_.clear(); } std::string buffer; // write entries to disk for (const auto &entry : entries) { buffer.append(entry); } int toWrite = buffer.size(); int written = ::write(fd_, buffer.c_str(), toWrite); if (written != toWrite) { PLOG(ERROR) << "Disk write error while writing transfer log " << written << " " << toWrite; close(); return; } } } bool TransferLogManager::parseLogHeader(char *buf, int16_t entrySize, int64_t &timestamp, int &version, std::string &recoveryId) { folly::ByteRange br((uint8_t *)buf, entrySize); try { timestamp = decodeInt(br); version = decodeInt(br); if (!decodeString(br, buf, entrySize, recoveryId)) { return false; } } catch (const std::exception &ex) { LOG(ERROR) << "got exception " << folly::exceptionStr(ex); return false; } return checkForOverflow(br.start() - (uint8_t *)buf, entrySize); } bool TransferLogManager::parseFileCreationEntry(char *buf, int16_t entrySize, int64_t &timestamp, std::string &fileName, int64_t &seqId, int64_t &fileSize) { folly::ByteRange br((uint8_t *)buf, entrySize); try { timestamp = decodeInt(br); if (!decodeString(br, buf, entrySize, fileName)) { return false; } seqId = decodeInt(br); fileSize = decodeInt(br); } catch (const std::exception &ex) { LOG(ERROR) << "got exception " << folly::exceptionStr(ex); return false; } return checkForOverflow(br.start() - (uint8_t *)buf, entrySize); } bool TransferLogManager::parseBlockWriteEntry(char *buf, int16_t entrySize, int64_t &timestamp, int64_t &seqId, int64_t &offset, int64_t &blockSize) { folly::ByteRange br((uint8_t *)buf, entrySize); try { timestamp = decodeInt(br); seqId = decodeInt(br); offset = decodeInt(br); blockSize = decodeInt(br); } catch (const std::exception &ex) { LOG(ERROR) << "got exception " << folly::exceptionStr(ex); return false; } return checkForOverflow(br.start() - (uint8_t *)buf, entrySize); } bool TransferLogManager::parseInvalidationEntry(char *buf, int16_t entrySize, int64_t &timestamp, int64_t &seqId) { folly::ByteRange br((uint8_t *)buf, entrySize); try { timestamp = decodeInt(br); seqId = decodeInt(br); } catch (const std::exception &ex) { LOG(ERROR) << "got exception " << folly::exceptionStr(ex); return false; } return checkForOverflow(br.start() - (uint8_t *)buf, entrySize); } void TransferLogManager::encodeInvalidationEntry(char *dest, int64_t &off, int64_t seqId) { int64_t oldOffset = off; char *ptr = dest + off + sizeof(int16_t); ptr[off++] = ENTRY_INVALIDATION; encodeInt(ptr, off, timestampInMicroseconds()); encodeInt(ptr, off, seqId); folly::storeUnaligned<int16_t>(dest, off - oldOffset); } bool TransferLogManager::writeInvalidationEntries( const std::set<int64_t> &seqIds) { int fd = open(); if (fd < 0) { return false; } char buf[kMaxEntryLength]; for (auto seqId : seqIds) { int64_t size = 0; encodeInvalidationEntry(buf, size, seqId); int toWrite = size + sizeof(int16_t); int written = ::write(fd, buf, toWrite); if (written != toWrite) { PLOG(ERROR) << "Disk write error while writing transfer log " << written << " " << toWrite; ::close(fd); return false; } } if (::fsync(fd) != 0) { PLOG(ERROR) << "fsync() failed for fd " << fd; ::close(fd); return false; } if (::close(fd) != 0) { PLOG(ERROR) << "close() failed for fd " << fd; } return true; } bool TransferLogManager::truncateExtraBytesAtEnd(int fd, int extraBytes) { LOG(INFO) << "Removing extra " << extraBytes << " bytes from the end of transfer log"; struct stat statBuffer; if (fstat(fd, &statBuffer) != 0) { PLOG(ERROR) << "fstat failed on fd " << fd; return false; } off_t fileSize = statBuffer.st_size; if (::ftruncate(fd, fileSize - extraBytes) != 0) { PLOG(ERROR) << "ftruncate failed for fd " << fd; return false; } return true; } bool TransferLogManager::parseAndPrint() { std::vector<FileChunksInfo> parsedInfo; return parseVerifyAndFix("", true, parsedInfo); } std::vector<FileChunksInfo> TransferLogManager::parseAndMatch( const std::string &recoveryId) { std::vector<FileChunksInfo> parsedInfo; parseVerifyAndFix(recoveryId, false, parsedInfo); return parsedInfo; } bool TransferLogManager::parseVerifyAndFix( const std::string &recoveryId, bool parseOnly, std::vector<FileChunksInfo> &parsedInfo) { WDT_CHECK(parsedInfo.empty()) << "parsedInfo vector must be empty"; std::string fullLogName = getFullPath(LOG_NAME); int logFd = ::open(fullLogName.c_str(), O_RDONLY); if (logFd < 0) { PLOG(ERROR) << "Unable to open transfer log " << fullLogName; return false; } auto errorGuard = folly::makeGuard([&] { if (logFd >= 0) { ::close(logFd); } if (!parseOnly) { if (::rename(getFullPath(LOG_NAME).c_str(), getFullPath(BUGGY_LOG_NAME).c_str()) != 0) { PLOG(ERROR) << "log rename failed " << LOG_NAME << " " << BUGGY_LOG_NAME; } } }); std::map<int64_t, FileChunksInfo> fileInfoMap; std::map<int64_t, int64_t> seqIdToSizeMap; std::string fileName, logRecoveryId; int64_t timestamp, seqId, fileSize, offset, blockSize; int logVersion; std::set<int64_t> invalidSeqIds; char entry[kMaxEntryLength]; while (true) { int16_t entrySize; int toRead = sizeof(entrySize); int numRead = ::read(logFd, &entrySize, toRead); if (numRead < 0) { PLOG(ERROR) << "Error while reading transfer log " << numRead << " " << toRead; return false; } if (numRead == 0) { break; } if (numRead != toRead) { // extra bytes at the end, most likely part of the previous write // succeeded partially if (parseOnly) { LOG(INFO) << "Extra " << numRead << " bytes at the end of the log"; } else if (!truncateExtraBytesAtEnd(logFd, numRead)) { return false; } break; } if (entrySize < 0 || entrySize > kMaxEntryLength) { LOG(ERROR) << "Transfer log parse error, invalid entry length " << entrySize; return false; } numRead = ::read(logFd, entry, entrySize); if (numRead < 0) { PLOG(ERROR) << "Error while reading transfer log " << numRead << " " << entrySize; return false; } if (numRead == 0) { break; } if (numRead != entrySize) { if (parseOnly) { LOG(INFO) << "Extra " << numRead << " bytes at the end of the log"; } else if (!truncateExtraBytesAtEnd(logFd, numRead)) { return false; } break; } EntryType type = (EntryType)entry[0]; switch (type) { case HEADER: { if (!parseLogHeader(entry + 1, entrySize - 1, timestamp, logVersion, logRecoveryId)) { return false; } if (logVersion != LOG_VERSION) { LOG(ERROR) << "Can not parse log version " << logVersion << ", parser version " << LOG_VERSION; return false; } if (!parseOnly && recoveryId != logRecoveryId) { LOG(ERROR) << "Current recovery-id does not match with log recovery-id " << recoveryId << " " << logRecoveryId; return false; } if (parseOnly) { std::cout << getFormattedTimestamp(timestamp) << " New transfer started, log-version " << logVersion << " recovery-id " << logRecoveryId << std::endl; } break; } case FILE_CREATION: { if (!parseFileCreationEntry(entry + 1, entrySize - 1, timestamp, fileName, seqId, fileSize)) { return false; } if (fileInfoMap.find(seqId) != fileInfoMap.end() || invalidSeqIds.find(seqId) != invalidSeqIds.end()) { LOG(ERROR) << "Multiple FILE_CREATION entry for same sequence-id " << fileName << " " << seqId << " " << fileSize; return false; } if (parseOnly) { std::cout << getFormattedTimestamp(timestamp) << " File created " << fileName << " seq-id " << seqId << " file-size " << fileSize << std::endl; fileInfoMap.emplace(seqId, FileChunksInfo(seqId, fileName, fileSize)); break; } // verify size bool sizeVerificationSuccess = false; struct stat buffer; if (stat(getFullPath(fileName).c_str(), &buffer) != 0) { PLOG(ERROR) << "stat failed for " << fileName; } else { #ifdef HAS_POSIX_FALLOCATE sizeVerificationSuccess = (buffer.st_size == fileSize); #else sizeVerificationSuccess = (buffer.st_size <= fileSize); #endif } if (sizeVerificationSuccess) { fileInfoMap.emplace(seqId, FileChunksInfo(seqId, fileName, fileSize)); seqIdToSizeMap.emplace(seqId, buffer.st_size); } else { LOG(INFO) << "Sanity check failed for " << fileName << " seq-id " << seqId << " file-size " << fileSize; invalidSeqIds.insert(seqId); } break; } case BLOCK_WRITE: { if (!parseBlockWriteEntry(entry + 1, entrySize - 1, timestamp, seqId, offset, blockSize)) { return false; } if (invalidSeqIds.find(seqId) != invalidSeqIds.end()) { LOG(INFO) << "Block entry for an invalid sequence-id " << seqId << ", ignoring"; continue; } auto it = fileInfoMap.find(seqId); if (it == fileInfoMap.end()) { LOG(ERROR) << "Block entry for unknown sequence-id " << seqId << " " << offset << " " << blockSize; return false; } FileChunksInfo &chunksInfo = it->second; if (parseOnly) { std::cout << getFormattedTimestamp(timestamp) << " Block written " << chunksInfo.getFileName() << " seq-id " << seqId << " offset " << offset << " block-size " << blockSize << std::endl; } else { auto sizeIt = seqIdToSizeMap.find(seqId); WDT_CHECK(sizeIt != seqIdToSizeMap.end()); if (offset + blockSize > sizeIt->second) { LOG(ERROR) << "Block end point is greater than file size in disk " << chunksInfo.getFileName() << " seq-id " << seqId << " offset " << offset << " block-size " << blockSize << " file size in disk " << sizeIt->second; return false; } } chunksInfo.addChunk(Interval(offset, offset + blockSize)); break; } case ENTRY_INVALIDATION: { if (!parseInvalidationEntry(entry + 1, entrySize - 1, timestamp, seqId)) { return false; } if (fileInfoMap.find(seqId) == fileInfoMap.end() && invalidSeqIds.find(seqId) == invalidSeqIds.end()) { LOG(ERROR) << "Invalidation entry for an unknown sequence id " << seqId; return false; } if (parseOnly) { std::cout << getFormattedTimestamp(timestamp) << " Invalidation entry for seq-id " << seqId << std::endl; } fileInfoMap.erase(seqId); invalidSeqIds.erase(seqId); break; } default: { LOG(ERROR) << "Invalid entry type found " << type; return false; } } } if (parseOnly) { // no need to add invalidation entries in case of invocation from cmd line return true; } if (::close(logFd) != 0) { PLOG(ERROR) << "close() failed for fd " << logFd; } logFd = -1; if (!invalidSeqIds.empty()) { if (!writeInvalidationEntries(invalidSeqIds)) { return false; } } errorGuard.dismiss(); for (auto &pair : fileInfoMap) { FileChunksInfo &fileInfo = pair.second; fileInfo.mergeChunks(); parsedInfo.emplace_back(std::move(fileInfo)); } return true; } } }
32.657238
80
0.590972
6747f49a6dc5ecbcf0091a7a9277dedd1823e63a
929
cpp
C++
platforms/gfg/0097_diagonal_traversal_of_binary_tree.cpp
idfumg/algorithms
06f85c5a1d07a965df44219b5a6bf0d43a129256
[ "MIT" ]
2
2020-09-17T09:04:00.000Z
2020-11-20T19:43:18.000Z
platforms/gfg/0097_diagonal_traversal_of_binary_tree.cpp
idfumg/algorithms
06f85c5a1d07a965df44219b5a6bf0d43a129256
[ "MIT" ]
null
null
null
platforms/gfg/0097_diagonal_traversal_of_binary_tree.cpp
idfumg/algorithms
06f85c5a1d07a965df44219b5a6bf0d43a129256
[ "MIT" ]
null
null
null
#include "../../template.hpp" ostream& operator<<(ostream& os, Node* root) { print_inorder(root); return os; } void preorder(Node* root, map<int, vi>& tab, int diagonal) { if (not root) return; tab[diagonal].push_back(root->value); preorder(root->left, tab, diagonal + 1); preorder(root->right, tab, diagonal); } void DiagonalPrint(Node* root) { map<int, vi> tab; preorder(root, tab, 0); for (const auto& [diagonal, nodes] : tab) { cout << nodes << endl; } } int main() { TimeMeasure _; __x(); Node* root = new Node(8); root->left = new Node(3); root->right = new Node(10); root->left->left = new Node(1); root->left->right = new Node(6); root->right->right = new Node(14); root->right->right->left = new Node(13); root->left->right->left = new Node(4); root->left->right->right = new Node(7); DiagonalPrint(root); /* 8 10 14 3 6 7 13 1 4 */ }
24.447368
80
0.595264
6748cabbd113ed004698fdb04af485f3e4f6acf6
2,186
cpp
C++
src/status.cpp
Nakeib/RonClient
9e816c580ec2a6f1b15fdefd8e15ad62647ca29f
[ "MIT" ]
11
2020-11-07T19:35:24.000Z
2021-08-19T12:25:27.000Z
src/status.cpp
Nakeib/RonClient
9e816c580ec2a6f1b15fdefd8e15ad62647ca29f
[ "MIT" ]
null
null
null
src/status.cpp
Nakeib/RonClient
9e816c580ec2a6f1b15fdefd8e15ad62647ca29f
[ "MIT" ]
5
2020-11-06T20:52:11.000Z
2021-02-25T11:02:31.000Z
/* -------------------------------------------------------------------------- */ /* ------------- RonClient --- Oficial client for RonOTS servers ------------ */ /* -------------------------------------------------------------------------- */ #include "status.h" #include "allocator.h" #include "icons.h" #include "window.h" // ---- Status ---- // MUTEX Status::lockStatus; Status::Status() { icons = 0; container = NULL; } Status::~Status() { } void Status::SetIcons(unsigned short icons) { this->icons = icons; } unsigned short Status::GetIcons() { return icons; } void Status::SetPeriod(unsigned char id, unsigned int period) { LOCKCLASS lockClass(lockStatus); time_lt now = RealTime::getTime(); std::map<unsigned char, StatusTime>::iterator it = times.find(id); if (it != times.end()) { StatusTime stime = it->second; if (abs((long)(stime.first + stime.second) - (long)(now + period)) > 1000) times[id] = StatusTime(now, period); } else times[id] = StatusTime(now, period); } void Status::SetContainer(WindowElementContainer* container) { LOCKCLASS lockClass(lockStatus); this->container = container; } void Status::UpdateContainer() { LOCKCLASS lockClass1(Windows::lockWindows); LOCKCLASS lockClass2(lockStatus); if (!container) return; container->DeleteAllElements(); Window* window = container->GetWindow(); WindowTemplate* wndTemplate = window->GetWindowTemplate(); window->SetActiveElement(NULL); POINT size_int = window->GetWindowContainer()->GetIntSize(); POINT size_ext = container->GetIntSize(); int num = 0; for (int i = 0; i < 15; i++) { if (icons & (1 << i)) { StatusTime stime(0, 0); std::map<unsigned char, StatusTime>::iterator it = times.find(i + 1); if (it != times.end()) stime = it->second; AD2D_Image* image = Icons::GetStatusIcon(i + 1); WindowElementCooldown* wstatus = new(M_PLACE) WindowElementCooldown; wstatus->Create(0, 0, num * 32, 32, 32, wndTemplate); wstatus->SetCast(stime.first, stime.second); wstatus->SetIcon(image); container->AddElement(wstatus); num++; } } container->SetPosition(0, size_int.y - num * 32); container->SetSize(32, num * 32); }
23.505376
80
0.618939
674a7eb21be0415058f79fdae32ac00ef058376d
1,664
hpp
C++
Router/Data/Route_Stop_Data.hpp
kravitz/transims4
ea0848bf3dc71440d54724bb3ecba3947b982215
[ "NASA-1.3" ]
2
2018-04-27T11:07:02.000Z
2020-04-24T06:53:21.000Z
Router/Data/Route_Stop_Data.hpp
idkravitz/transims4
ea0848bf3dc71440d54724bb3ecba3947b982215
[ "NASA-1.3" ]
null
null
null
Router/Data/Route_Stop_Data.hpp
idkravitz/transims4
ea0848bf3dc71440d54724bb3ecba3947b982215
[ "NASA-1.3" ]
null
null
null
//********************************************************* // Route_Stop_Data.hpp - transit route stop data classes //********************************************************* #ifndef ROUTE_STOP_DATA_HPP #define ROUTE_STOP_DATA_HPP #include "Data_Array.hpp" //--------------------------------------------------------- // Route_Stop_Data class definition //--------------------------------------------------------- class Route_Stop_Data { public: Route_Stop_Data (void); int Route (void) { return (route); } int Stop (void) { return (stop); } int List (void) { return (list); } void Route (int value) { route = (short) value; } void Stop (int value) { stop = (short) value; } void List (int value) { list = value; } private: short route; short stop; int list; }; //--------------------------------------------------------- // Route_Stop_Array //--------------------------------------------------------- class Route_Stop_Array : public Data_Array { public: Route_Stop_Array (int max_records = 0); bool Add (Route_Stop_Data *data) { return (Data_Array::Add ((void *) data)); } Route_Stop_Data * First (void) { return ((Route_Stop_Data *) Data_Array::First ()); } Route_Stop_Data * Next (void) { return ((Route_Stop_Data *) Data_Array::Next ()); } Route_Stop_Data * Last (void) { return ((Route_Stop_Data *) Data_Array::Last ()); } Route_Stop_Data * Previous (void) { return ((Route_Stop_Data *) Data_Array::Previous ()); } Route_Stop_Data * operator[] (int index) { return ((Route_Stop_Data *) Record (index)); } }; #endif
30.814815
100
0.497596
674cc6352b2fd0e6c122e527457aa0a2f14c39da
138
hpp
C++
externals/numeric_bindings/libs/numeric/bindings/tools/templates/driver/stev.hpp
ljktest/siconos
85b60e62beca46e6bf06bfbd65670089e86607c7
[ "Apache-2.0" ]
137
2015-06-16T15:55:28.000Z
2022-03-26T06:01:59.000Z
externals/numeric_bindings/libs/numeric/bindings/tools/templates/driver/stev.hpp
ljktest/siconos
85b60e62beca46e6bf06bfbd65670089e86607c7
[ "Apache-2.0" ]
381
2015-09-22T15:31:08.000Z
2022-02-14T09:05:23.000Z
externals/numeric_bindings/libs/numeric/bindings/tools/templates/driver/stev.hpp
ljktest/siconos
85b60e62beca46e6bf06bfbd65670089e86607c7
[ "Apache-2.0" ]
30
2015-08-06T22:57:51.000Z
2022-03-02T20:30:20.000Z
$TEMPLATE[stev.real.min_size_work.args] N $TEMPLATE[stev.real.min_size_work] return std::max< $INTEGER_TYPE >( 1, 2*n-2 ); $TEMPLATE[end]
23
45
0.73913
6750116edd11d113a2610814ba8adbaca4bcf5b5
4,518
cpp
C++
src/main.cpp
scaryrawr/tofi
15b3757c4d492d5bbc7f57aef94f582549d2bef3
[ "MIT" ]
1
2020-08-03T18:57:01.000Z
2020-08-03T18:57:01.000Z
src/main.cpp
scaryrawr/tofi
15b3757c4d492d5bbc7f57aef94f582549d2bef3
[ "MIT" ]
1
2021-03-07T21:32:10.000Z
2021-03-08T13:56:10.000Z
src/main.cpp
scaryrawr/tofi
15b3757c4d492d5bbc7f57aef94f582549d2bef3
[ "MIT" ]
null
null
null
#include <TofiConfig.h> #include "tofi.h" #include "modes/dmenu.h" #ifdef GIOMM_FOUND #include "modes/drun.h" #endif #ifdef I3IPC_FOUND #include "modes/i3wm.h" #endif #ifdef GTKMM_FOUND #include "modes/recent.h" #endif #include "modes/run.h" #include "modes/script.h" #include <getopt.h> #include <ftxui/component/screen_interactive.hpp> #include <mtl/string.hpp> struct LaunchMode { std::string_view mode; std::optional<std::string_view> script; }; struct LaunchOptions { bool dmenu{}; std::vector<LaunchMode> modes; }; void help() { std::cout << "tofi usage:" << std::endl << "\ttofi [--options]" << std::endl << "Options:" << std::endl; std::cout << "\t-d, --dmenu\tRun in dmenu mode" << std::endl; std::cout << "\t-m, --modes\tStart with modes enabled [drun,run,i3wm]" << std::endl << "\t-h, --help \tDisplay this message" << std::endl << "Modes:" << std::endl; #ifdef GIOMM_FOUND std::cout << "\tdrun\tRun from list of desktop installed applications" << std::endl; #endif #ifdef GTKMM_FOUND std::cout << "\recent\tOpen a recently opened file" << std::endl; #endif std::cout << "\trun \tRun from binaries on $PATH" << std::endl; #ifdef I3IPC_FOUND std::cout << "\ti3wm\tSwitch between active windows using i3ipc" << std::endl; #endif std::cout << "Script:" << std::endl << "\tPass a custom command disp:command" << std::endl << "\t\t -m list:ls" << std::endl << std::endl << "\tcommand will be called with selected result" << std::endl << "\ttofi will stay open as long as command prints output" << std::endl; exit(-1); } LaunchOptions parse_args(int argc, char **argv) { LaunchOptions launch{}; enum class Option { modes, dmenu, help, }; static option options[] = { {"modes", required_argument, nullptr, 0}, {"dmenu", no_argument, nullptr, 0}, {"help", no_argument, nullptr, 0}, }; for (int index{}, code{getopt_long(argc, argv, "m:dh", options, &index)}; code >= 0; code = getopt_long(argc, argv, "m:dh", options, &index)) { switch (code) { case 'd': index = static_cast<int>(Option::dmenu); break; case 'm': index = static_cast<int>(Option::modes); break; case 'h': index = static_cast<int>(Option::help); break; } switch (static_cast<Option>(index)) { case Option::dmenu: { launch.dmenu = true; break; } case Option::modes: { std::vector<std::string_view> modes; mtl::string::split(optarg, ",", std::back_inserter(modes)); launch.modes.reserve(modes.size()); std::transform(std::begin(modes), std::end(modes), std::back_inserter(launch.modes), [](std::string_view mode) { std::vector<std::string_view> parts; parts.reserve(2); mtl::string::split(mode, ":", std::back_inserter(parts)); return parts.size() == 1 ? LaunchMode{parts[0], std::nullopt} : LaunchMode{parts[0], parts[1]}; }); break; } case Option::help: { help(); break; } } } return launch; } int main(int argc, char **argv) { LaunchOptions options{parse_args(argc, argv)}; tofi::Modes modes; // If we're in dmenu mode, other modes might break, so... just dmenu if (options.dmenu) { modes.emplace_back(std::make_unique<tofi::modes::dmenu>()); } else { std::transform(std::begin(options.modes), std::end(options.modes), std::back_inserter(modes), [](const LaunchMode &mode) -> std::unique_ptr<tofi::Mode> { if (mode.script.has_value()) { return std::make_unique<tofi::modes::script>(mode.mode, mode.script.value()); } #ifdef I3IPC_FOUND if ("i3wm" == mode.mode) { return std::make_unique<tofi::modes::i3wm>("tofi"); } #endif if ("run" == mode.mode) { return std::make_unique<tofi::modes::run>(); } #ifdef GIOMM_FOUND if ("drun" == mode.mode) { return std::make_unique<tofi::modes::drun>(); } #endif #ifdef GTKMM_FOUND if ("recent" == mode.mode) { return std::make_unique<tofi::modes::recent>(); } #endif return nullptr; }); } modes.erase(std::remove(std::begin(modes), std::end(modes), nullptr), std::end(modes)); if (modes.empty()) { // We don't have any modes, so show user help. help(); } // Use active wal theme if available system("[ -f $HOME/.cache/wal/sequences ] && cat $HOME/.cache/wal/sequences"); tofi::Tofi tofi{std::move(modes)}; int exit{}; auto screen = ftxui::ScreenInteractive::TerminalOutput(); tofi.on_exit = [&exit, &screen](int code) { exit = code; screen.ExitLoopClosure()(); }; screen.Loop(&tofi); return exit; }
22.366337
155
0.634794
67510af1134b5530b703475985ce9f9b695fc754
3,147
cpp
C++
SceneServer/SSBattleMgr/SSProfileStatics.cpp
tsymiar/----
90e21cbfe7b3bc730c998e9f5ef87aa3581e357a
[ "Unlicense" ]
6
2019-07-15T23:55:15.000Z
2020-09-07T15:07:54.000Z
SceneServer/SSBattleMgr/SSProfileStatics.cpp
j1527156/BattleServer
68c9146bf35e93dfd5a175b46e9761ee3c7c0d04
[ "Unlicense" ]
null
null
null
SceneServer/SSBattleMgr/SSProfileStatics.cpp
j1527156/BattleServer
68c9146bf35e93dfd5a175b46e9761ee3c7c0d04
[ "Unlicense" ]
7
2019-07-15T23:55:24.000Z
2021-08-10T07:49:05.000Z
#include "StdAfx.h" #include "SSProfileStatics.h" #include <iostream> #include <fstream> #include "SSWorkThreadMgr.h" #include <iomanip> namespace SceneServer{ CSSProfileStatics::CSSProfileStatics(void):m_LastMsgShow(0) { } CSSProfileStatics::~CSSProfileStatics(void) { } void CSSProfileStatics::Begin(StaticsType aType){ auto iter = m_ProfileMap.find(aType); TIME_MILSEC now = GetWinMiliseconds(); if (iter == m_ProfileMap.end()){ ProfileData lProfileData; lProfileData.beginTime = now; switch(aType){ case StaticsType_NPCLookEnemy: lProfileData.debugString = "NPCLookEnemy"; break; case StaticsType_Move: lProfileData.debugString = "Move"; break; case StaticsType_Sight: lProfileData.debugString = "Sight"; break; } m_ProfileMap.insert(std::make_pair(aType, lProfileData)); } else{ iter->second.beginTime = now; } } void CSSProfileStatics::End(StaticsType aType){ auto iter = m_ProfileMap.find(aType); TIME_MILSEC now = GetWinMiliseconds(); if (iter != m_ProfileMap.end()){ iter->second.tottime += now - iter->second.beginTime; iter->second.beginTime = 0; } } CSSProfileStatics& CSSProfileStatics::GetInstance(){ static CSSProfileStatics lCSSProfileStatics; return lCSSProfileStatics; } void CSSProfileStatics::GetProfileReport(wstringstream &report){ if (!CSSWorkThreadMgr::GetInstance().m_IfStatics){ return; } //if (CSSWorkThreadMgr::GetInstance().GetKernel()->GetHeartBeatUTCMilsec() - m_LastMsgShow < CSSWorkThreadMgr::GetInstance().m_MsgStaticsInterval){ // return; //} stringstream lTestStream; //m_LastMsgShow = CSSWorkThreadMgr::GetInstance().GetKernel()->GetHeartBeatUTCMilsec(); //for (auto iter = m_ProfileMap.begin(); iter != m_ProfileMap.end(); ++iter){ // ProfileData& lProfileData = iter->second; // if (lProfileData.tottime != 0){ // lTestStream << " " << setw(7) << lProfileData.debugString.c_str() << ":" << lProfileData.tottime; // lProfileData.tottime = 0; // } //} int i = 0; set<MsgInterval> tempSet; for (auto iter = m_TotNumForPerMsg.begin(); iter != m_TotNumForPerMsg.end(); ++iter){ MsgInterval lMsgInterval(iter->first, iter->second); tempSet.insert(lMsgInterval); } int max = CSSWorkThreadMgr::GetInstance().m_MaxStatisMsgToShow; for (auto iter = tempSet.begin(); iter != tempSet.end(); ++iter){ if (i > max){ break; } ++i; lTestStream << " " << setw(7) << iter->msgid << "," << iter->msgnum; } if (!lTestStream.str().empty()){ ELOG(LOG_SpecialDebug, "%s", lTestStream.str().c_str()); } } void CSSProfileStatics::AddMsg(int Msgid){ if (!CSSWorkThreadMgr::GetInstance().m_IfStatics){ return; } auto iter = m_TotNumForPerMsg.find(Msgid); if (iter == m_TotNumForPerMsg.end()){ m_TotNumForPerMsg.insert(std::make_pair(Msgid, 1)); } else{ ++iter->second; } } ProfileInScope::ProfileInScope(StaticsType aType):m_Type(aType){ if (!CSSWorkThreadMgr::GetInstance().m_IfStatics){ return; } CSSProfileStatics::GetInstance().Begin(m_Type); } ProfileInScope::~ProfileInScope(){ if (!CSSWorkThreadMgr::GetInstance().m_IfStatics){ return; } CSSProfileStatics::GetInstance().End(m_Type); } }
24.779528
148
0.71306
675e2a110fefc2b8916753461909761463c1ded6
1,108
cpp
C++
Graph/Dijkstra.cpp
XitizVerma/Data-Structures-and-Algorithms-Advanced
610225eeb7e0b4ade229ec86355901ad1ca38784
[ "MIT" ]
1
2020-08-27T06:59:52.000Z
2020-08-27T06:59:52.000Z
Graph/Dijkstra.cpp
XitizVerma/Data-Structures-and-Algorithms-Advanced
610225eeb7e0b4ade229ec86355901ad1ca38784
[ "MIT" ]
null
null
null
Graph/Dijkstra.cpp
XitizVerma/Data-Structures-and-Algorithms-Advanced
610225eeb7e0b4ade229ec86355901ad1ca38784
[ "MIT" ]
null
null
null
//author : Avishkar A. Hande #include<bits/stdc++.h> #define ll long long using namespace std; const int maxS = 1e5+10; vector<pair<ll, ll>> adj[maxS]; // represents adjacency list to store weight and destination node as a pair vector<ll> dist(maxS, 1e9); // distance array initialised assuming 1e9 as infinity void dijkstra(ll source){ priority_queue<pair<ll, ll>, vector<pair<ll, ll>>, greater<pair<ll, ll>>> pq; pq.push({0, source}); // pair of distance and node dist[source] = 0; // source node has 0 distance while(!pq.empty()){ pair<ll, ll> top = pq.top(); pq.pop(); for(pair<ll, ll> child: adj[top.second]){ if(dist[top.second] + child.first < dist[child.second]){ dist[child.second] = dist[top.second] + child.first; pq.push(child); } } } } int main() { ll nodes, edges; cin >> nodes >> edges; while(edges--){ ll from, to, weight; cin >> from >> to >> weight; adj[from].push_back({weight, to}); adj[to].push_back({weight, from}); } dijkstra(1); // replace 1 with source node. for(int i = 0; i < nodes; i++){ cout << dist[i] << " "; }cout << endl; }
25.767442
107
0.635379
676352821a79db365176c13e0272c408c971072d
1,166
cpp
C++
src/io.cpp
tiberius1900/ino-fix
369b76875c3b9d51b526f0c4de82cc1405da8eb5
[ "MIT" ]
null
null
null
src/io.cpp
tiberius1900/ino-fix
369b76875c3b9d51b526f0c4de82cc1405da8eb5
[ "MIT" ]
null
null
null
src/io.cpp
tiberius1900/ino-fix
369b76875c3b9d51b526f0c4de82cc1405da8eb5
[ "MIT" ]
null
null
null
#include "io.h" #include <fstream> #include "stdfilesystem.h" //replace this with <filesystem> when MSVC stops //being awful or if you don't care about compiling //this using MSVC #include <ios> #include <iostream> #include <string> using std::string; using std::filesystem::exists; using std::filesystem::path; string get_name(string message) { std::cout << message; getline(std::cin, message); return message; } path get_input_file_name() { string answer = get_name("Input file name : "); while (answer.length() == 0 || !exists(static_cast<path>(answer))) get_name("Please input the name of an existing file: "); return static_cast<path>(answer); } bool can_exist(string answer) //also creates/empties the file { std::ofstream file(answer.c_str()); if (file.is_open()) return true; else return false; } path get_output_file_name() { string answer = get_name("Output file name : "); while (answer.length() == 0 || !can_exist(answer)) get_name("Please input a valid file name: "); return static_cast<path>(answer); }
23.32
77
0.636364
67635a72614c96245d14753a30f9db84a551520f
2,788
cpp
C++
src/robotican_demos_upgrade/src/depth_to_base_foot.cpp
aosbgu/ROSPlan-ExperimentPDDL
09de0ba980362606dd1269c6689cb59d6f8776c6
[ "MIT" ]
null
null
null
src/robotican_demos_upgrade/src/depth_to_base_foot.cpp
aosbgu/ROSPlan-ExperimentPDDL
09de0ba980362606dd1269c6689cb59d6f8776c6
[ "MIT" ]
null
null
null
src/robotican_demos_upgrade/src/depth_to_base_foot.cpp
aosbgu/ROSPlan-ExperimentPDDL
09de0ba980362606dd1269c6689cb59d6f8776c6
[ "MIT" ]
null
null
null
#include "ros/ros.h" #include "tf/message_filter.h" #include "message_filters/subscriber.h" #include <ar_track_alvar_msgs/AlvarMarkers.h> tf::TransformListener *listener_ptr; int object_id = 1; ros::Publisher object_pub; ros::Publisher object_pub1; void obj_msgCallback(const boost::shared_ptr<const geometry_msgs::PoseStamped>& point_ptr) { //ROS_INFO_STREAM("Received pose x: " << point_ptr->pose.position.x); //get object location msg try { geometry_msgs::PoseStamped base_object_pose; listener_ptr->transformPose("base_footprint", *point_ptr, base_object_pose); base_object_pose.pose.orientation= tf::createQuaternionMsgFromRollPitchYaw(0.0,0.0,0.0); //simulate alvar msgs, to get tf ar_track_alvar_msgs::AlvarMarkers msg; msg.header.stamp=base_object_pose.header.stamp; msg.header.frame_id="base_footprint"; ar_track_alvar_msgs::AlvarMarker m; m.id=object_id; m.header.stamp=base_object_pose.header.stamp; m.header.frame_id="base_footprint"; m.pose=base_object_pose; msg.markers.push_back(m); m.pose.pose.position.z-=0.1; m.id=2; msg.markers.push_back(m); object_pub.publish(msg); geometry_msgs::PoseStamped base_object_pose1; listener_ptr->transformPose("base_footprint", *point_ptr, base_object_pose1); base_object_pose1.pose.orientation= tf::createQuaternionMsgFromRollPitchYaw(M_PI,0.0,0.0); //ROS_INFO("Did the transformation"); //printf("X: %lf Y: %lf Z: %lf\n",base_object_pose1.pose.position.x,base_object_pose1.pose.position.y,base_object_pose1.pose.position.z); object_pub1.publish(base_object_pose1); } catch (tf::TransformException &ex) { printf ("Failure %s\n", ex.what()); //Print exception which was caught } } int main(int argc, char **argv) { ros::init(argc, argv, "detected_objects"); ros::NodeHandle n; object_pub=n.advertise<ar_track_alvar_msgs::AlvarMarkers>("detected_objects", 2, true); object_pub1=n.advertise<geometry_msgs::PoseStamped>("detected_object1", 2, true); //convert depth cam tf to base foot print tf (moveit work with base foot print tf) tf::TransformListener listener; listener_ptr=&listener; message_filters::Subscriber<geometry_msgs::PoseStamped> point_sub_; point_sub_.subscribe(n, "my_find_object/object_pose", 10); //message_filters::Subscriber<geometry_msgs::PoseStamped> point_sub_(n, "object_pose", 10); tf::MessageFilter<geometry_msgs::PoseStamped> tf_filter(point_sub_, listener, "base_footprint", 10); tf_filter.registerCallback( boost::bind(obj_msgCallback, _1) ); ros::Rate r(10); while (ros::ok()) { ros::spinOnce(); r.sleep(); } return 0; }
30.637363
145
0.707317
676bedc2a1426fa6553a239fb79db1ce5a428d87
4,291
hpp
C++
Read_Instance.hpp
SergioBarretoJr/SteinerForestGraph
e8ecb34cc1728e9a927af7dcb215ff813da1c974
[ "MIT" ]
null
null
null
Read_Instance.hpp
SergioBarretoJr/SteinerForestGraph
e8ecb34cc1728e9a927af7dcb215ff813da1c974
[ "MIT" ]
null
null
null
Read_Instance.hpp
SergioBarretoJr/SteinerForestGraph
e8ecb34cc1728e9a927af7dcb215ff813da1c974
[ "MIT" ]
null
null
null
// // Forest_Steiner.hpp // Steiner_Tree // // Created by sergio junior on 12/11/19. // Copyright © 2019 sergio junior. All rights reserved. // #ifndef Read_Instance_hpp #define Read_Instance_hpp #include<iostream> #include <list> #include <limits.h> #include <fstream> #include <cstdlib> #include <vector> #include <cstring> #include <stdio.h> #include <iomanip> #include <sstream> #include <list> #include <algorithm> // função find #include <stack> // pilha para usar na DFS #include <dirent.h> #include <sstream> #include <sstream> #include <ostream> #include "Forest_Steiner.hpp" int n_terminals(const char *path){ std::ifstream file(path); int nterminals=0; int lines=0; if (file.is_open()){ std::string line; while (getline(file, line)){ if(lines>1){ vector<string> sep = split(line, ' '); if(strncmp(sep[0].c_str(),"S",1)==0){ nterminals++; } } lines++; } file.close(); }else{ printf("Solution file with error!\n"); } return nterminals; } int n_edges(const char *path){ std::ifstream file(path); int edges=0; if (file.is_open()){ std::string line; while (getline(file, line)){ vector<string> sep = split(line, ' '); if(strncmp(sep[0].c_str(),"E",1)==0){ edges++; } } file.close(); }else{ printf("Solution file with error!\n"); } return edges; } void split_file_Instance(const char *path,const char *path2, int V,int terminals){ for(int i=0;i<terminals;i++){ std::ifstream file(path); ofstream myfile; std::string buf(string(path2)+"T_"+ to_string(i)+".txt"); myfile.open (buf, std::ios_base::app); int lines=0; if (file.is_open()){ std::string line; while (getline(file, line)){ if (lines==0){ vector<string> sep = split(line, ' '); myfile << "Nodes "+sep[1]+"\n"; }else{ if(lines==1){ string str= to_string(V-1); myfile << "Edges "+str+"\n"; }else{ if(lines<V+1){ vector<string> sep = split(line, ' '); myfile << "E "+to_string(std::atoi(sep[1].c_str())+1)+" "+to_string(std::atoi(sep[2].c_str())+1)+" "+to_string(std::atoi(sep[3].c_str()))+"\n"; }else{ vector<string> sep = split(line, ' '); if(strncmp(sep[0].c_str(),"S",1)==0){ if(i==0){ myfile << "\n"; myfile << "Terminals "+ to_string(sep.size()-1) +"\n"; int cont=1; while(cont<sep.size()){ myfile << "T "+to_string(std::atoi(sep[cont].c_str())+1)+"\n"; cont++; } break; }else{ if(lines==V+1+i){ myfile << "\n"; myfile << "Terminals "+ to_string(sep.size()-1) +"\n"; int cont=1; while(cont<sep.size()){ myfile << "T "+to_string(std::atoi(sep[cont].c_str())+1)+"\n"; cont++; } break; } } } } } } lines++; } myfile.close(); file.close(); }else{ printf("Solution file with error!\n"); } } } #endif /* Forest_Steiner_hpp */
30.65
171
0.393848
676c451ada470463a8f272b17b02d6618daac4cb
29,791
cpp
C++
fitp/pan/link_layer/link.cpp
BeeeOn/fitplib
71f8ab7ca2a35d97a9f56a9c8aac3b25fde0cb9f
[ "BSD-3-Clause" ]
null
null
null
fitp/pan/link_layer/link.cpp
BeeeOn/fitplib
71f8ab7ca2a35d97a9f56a9c8aac3b25fde0cb9f
[ "BSD-3-Clause" ]
null
null
null
fitp/pan/link_layer/link.cpp
BeeeOn/fitplib
71f8ab7ca2a35d97a9f56a9c8aac3b25fde0cb9f
[ "BSD-3-Clause" ]
null
null
null
/** * @file link.cc */ #include "common/phy_layer/phy.h" #include "pan/link_layer/link.h" #include <stdio.h> #include "common/log/log.h" /*! bit mask of data transfer from coordinator to end device */ #define LINK_COORD_TO_ED 0x20 /*! bit mask of data transfer from end device to coordinator */ #define LINK_ED_TO_COORD 0x10 /*! bit mask of device busyness */ #define LINK_BUSY 0x08 /*! RX buffer size */ #define LINK_RX_BUFFER_SIZE 4 /*! TX buffer size */ #define LINK_TX_BUFFER_SIZE 4 /*! maximum number of channels */ #define MAX_CHANNEL 31 /*! broadcast address */ #define LINK_COORD_ALL 0xfc /** @enum LINK_packet_type * Packet types. */ enum LINK_packet_type_pan { LINK_DATA_TYPE = 0, /**< DATA. */ LINK_COMMIT_TYPE = 1, /**< COMMIT. */ LINK_ACK_TYPE = 2, /**< ACK. */ LINK_COMMIT_ACK_TYPE = 3 /**< COMMIT ACK. */ }; /** * Packet states during four-way handshake. */ enum LINK_tx_packet_state_pan { DATA_SENT = 0, /**< DATA were sent. */ COMMIT_SENT = 1 /**< COMMIT was sent. */ }; /** * Structure for coordinator RX buffer record (used during four-way handshake). */ typedef struct { uint8_t data[MAX_PHY_PAYLOAD_SIZE]; /**< Data. */ uint8_t address_type:1; /**< Address type: 0 - coordinator, 1 - end device. */ uint8_t empty:1; /**< Flag if record is empty. */ uint8_t len:6; /**< Data length. */ uint8_t expiration_time; /**< Packet expiration time. */ uint8_t transfer_type; /**< Transfer type. */ union { uint8_t coord; /**< Coordinator address. */ uint8_t ed[EDID_LENGTH]; /**< End device address. */ } address; } LINK_rx_buffer_record_t; /** * Structure for coordinator TX buffer record (used during four-way handshake). */ typedef struct { uint8_t data[MAX_PHY_PAYLOAD_SIZE]; /**< Data. */ uint8_t address_type:1; /**< Address type: 0 - coordinator, 1 - end device. */ uint8_t empty:1; /**< Flag if record is empty. */ uint8_t len:6; /**< Data length. */ uint8_t state:1; /**< Packet states: 0 - DATA were sent, 1 - COMMIT was sent. */ uint8_t expiration_time; /**< Packet expiration time. */ uint8_t transmits_to_error; /**< Maximum number of packet retransmissions. */ uint8_t transfer_type; /**< Transfer type. */ union { uint8_t coord; /**< Coordinator address. */ uint8_t ed[EDID_LENGTH]; /**< End device address. */ } address; } LINK_tx_buffer_record_t; /** * Structure for link layer. */ struct LINK_storage_t { uint8_t tx_max_retries; /**< Maximum number of packet retransmissions. */ uint8_t timer_counter; /**< Timer for packet expiration time setting. */ LINK_rx_buffer_record_t rx_buffer[LINK_RX_BUFFER_SIZE]; /**< Array of RX buffer records for coordinator. */ LINK_tx_buffer_record_t tx_buffer[LINK_TX_BUFFER_SIZE]; /**< Array of TX buffer records for coordinator. */ } LINK_STORAGE; extern void delay_ms (uint16_t t); uint8_t LINK_cid_mask (uint8_t address); /** * Checks if identifier of end device equals to zeros. * @param edid Identifier of end device (EDID). * @return Returns true if EDID equals to zeros, false otherwise. */ bool zero_address (uint8_t* edid) { for (uint8_t i = 0; i < EDID_LENGTH; i++) { if (edid[i] != 0) return false; } return true; } /** * Compares two arrays (4 B). * @param array1 The first array. * @param array2 The second array. * @return Returns true if arrays are equal, false otherwise. */ bool array_cmp (uint8_t* array1, uint8_t* array2) { for (uint8_t i = 0; i < EDID_LENGTH; i++) { if (array1[i] != array2[i]) return false; } return true; } /** * Copies source array to destination array. * @param src Source array. * @param dst Destination array. * @param size Array size. */ void array_copy (uint8_t* src, uint8_t* dst, uint8_t size) { for (uint8_t i = 0; i < size; i++) { dst[i] = src[i]; } } /** * Searches a free index in TX buffer. * @return Returns a free index in TX buffer or invalid index in case of * full TX buffer. */ uint8_t get_free_index_tx () { uint8_t free_index = LINK_TX_BUFFER_SIZE; for (uint8_t i = 0; i < LINK_TX_BUFFER_SIZE; i++) { if (LINK_STORAGE.tx_buffer[i].empty) { free_index = i; break; } } return free_index; } /** * Searches a free index in RX buffer. * @return Returns a free index in RX buffer or invalid index in case of * full RX buffer. */ uint8_t get_free_index_rx () { uint8_t free_index = LINK_RX_BUFFER_SIZE; for (uint8_t i = 0; i < LINK_RX_BUFFER_SIZE; i++) { if (LINK_STORAGE.rx_buffer[i].empty) { free_index = i; break; } } return free_index; } /** * Generates packet header. * @param header Array for link packet header. * @param as_ed True if device sends packet as end device, false otherwise. * @param to_ed True if device sends packet to end device, false otherwise. * @param address Destination coordinator ID or end device ID. * @param packet_type Packet type. * @param transfer_type Transfer type on link layer. */ void gen_header (uint8_t* header, bool as_ed, bool to_ed, uint8_t* address, uint8_t packet_type, uint8_t transfer_type) { if (as_ed && to_ed) { // communication between EDs is not allowed return; } uint8_t header_index = 0; // packet type (2 b), dst (1 b), src (1 b), transfer type (4 b) header[header_index++] = packet_type << 6 | (to_ed ? 1 : 0) << 5 | (as_ed ? 1 : 0) << 4 | (transfer_type & 0x0f); // NID for (uint8_t i = 0; i < EDID_LENGTH; i++) { header[header_index++] = GLOBAL_STORAGE.nid[i]; } // data sending to ED if (to_ed) { for (uint8_t i = 0; i < EDID_LENGTH; i++) // ED address - dst header[header_index++] = address[i]; // COORD address - src header[header_index++] = GLOBAL_STORAGE.cid; } // data sending to COORD else { if (as_ed) { // COORD address - dst // ED can send packet to its descendant header[header_index++] = *address; // ED adress - src for (uint8_t i = 0; i < EDID_LENGTH; i++) header[header_index++] = GLOBAL_STORAGE.edid[i]; } else { // COORD address - dst header[header_index++] = *address; // COORD address - src header[header_index++] = GLOBAL_STORAGE.cid; } } } /** * Sends DATA. * @param as_ed True if device sends packet as end device ID, false otherwise. * @param to_ed True if device sends packet to end device ID, false otherwise. * @param address Destination coordinator ID or end device ID. * @param payload Payload. * @param len Payload length. * @param transfer_type Transfer type on link layer. */ void send_data (bool as_ed, bool to_ed, uint8_t* address, uint8_t* payload, uint8_t len, uint8_t transfer_type) { uint8_t packet[MAX_PHY_PAYLOAD_SIZE]; gen_header (packet, as_ed, to_ed, address, LINK_DATA_TYPE, transfer_type); // size of link header uint8_t packet_index = LINK_HEADER_SIZE; for (uint8_t i = 0; i < len; i++) packet[packet_index++] = payload[i]; D_LINK printf ("send_data()\n"); PHY_send_with_cca (packet, packet_index); } /** * Sends ACK. * @param as_ed True if device sends packet as end device ID, false otherwise. * @param to_ed True if device sends packet to end device ID, false otherwise. * @param address Destination coordinator ID or end device ID. * @param transfer_type Transfer type on link layer. */ void send_ack (bool as_ed, bool to_ed, uint8_t* address, uint8_t transfer_type) { uint8_t ack_packet[LINK_HEADER_SIZE]; gen_header (ack_packet, as_ed, to_ed, address, LINK_ACK_TYPE, transfer_type); D_LINK printf ("send_ack()\n"); PHY_send_with_cca (ack_packet, LINK_HEADER_SIZE); } /** * Sends COMMIT. * @param as_ed True if device sends packet as end device ID, false otherwise. * @param to_ed True if device sends packet to end device ID, false otherwise. * @param address Destination coordinator ID or end device ID. */ void send_commit (bool as_ed, bool to_ed, uint8_t* address) { uint8_t commit_packet[LINK_HEADER_SIZE]; gen_header (commit_packet, as_ed, to_ed, address, LINK_COMMIT_TYPE, LINK_DATA_HS4); D_LINK printf ("send_commit()\n"); PHY_send_with_cca (commit_packet, LINK_HEADER_SIZE); } /** * Sends COMMIT ACK. * @param as_ed True if device sends packet as end device ID, false otherwise. * @param to_ed True if device sends packet to end device ID, false otherwise. * @param address Destination coordinator ID or end device ID. */ void send_commit_ack (bool as_ed, bool to_ed, uint8_t* address) { uint8_t commit_ack_packet[LINK_HEADER_SIZE]; gen_header (commit_ack_packet, as_ed, to_ed, address, LINK_COMMIT_ACK_TYPE, LINK_DATA_HS4); D_LINK printf ("send_commit_ack()\n"); PHY_send_with_cca (commit_ack_packet, LINK_HEADER_SIZE); } /** * Sends BUSY ACK. * @param as_ed True if device sends packet as end device ID, false otherwise. * @param to_ed True if device sends packet to end device ID, false otherwise. * @param address Destination coordinator ID or end device ID. */ void send_busy_ack (bool as_ed, bool to_ed, uint8_t* address) { uint8_t ack_packet[LINK_HEADER_SIZE]; gen_header (ack_packet, as_ed, to_ed, address, LINK_ACK_TYPE, LINK_BUSY); D_LINK printf ("send_busy_ack()\n"); PHY_send_with_cca (ack_packet, LINK_HEADER_SIZE); } /** * Processes packet for coordinator and routes it towards destination. * @param data Data. * @param len Data length. * @return Returns false if packet is BUSY ACK, * if the packet has been already stored in RX buffer * or if the packet is not successfully sent, true otherwise. */ bool router_process_packet (uint8_t* data, uint8_t len) { uint8_t packet_type = data[0] >> 6; uint8_t transfer_type = data[0] & 0x0f; D_LINK printf("router_process_packet()\n"); // processing of ACK packet if (packet_type == LINK_ACK_TYPE) { D_LINK printf ("ACK\n"); if (data[0] & LINK_ED_TO_COORD) { D_LINK printf ("R: ACK to COORD\n"); for (uint8_t i = 0; i < LINK_TX_BUFFER_SIZE; i++) { // if some DATA message for ED is in TX buffer and address is the same, // COMMIT message can be sent if (!LINK_STORAGE.tx_buffer[i].empty) { if (LINK_STORAGE.tx_buffer[i].address_type == 1 && array_cmp (LINK_STORAGE.tx_buffer[i].address.ed, data + 6)) { // it is not BUSY ACK packet, switch state and send COMMIT packet if (transfer_type != LINK_BUSY) { LINK_STORAGE.tx_buffer[i].state = COMMIT_SENT; LINK_STORAGE.tx_buffer[i].transmits_to_error = LINK_STORAGE.tx_max_retries; LINK_STORAGE.tx_buffer[i].expiration_time = LINK_STORAGE.timer_counter + 2; D_LINK printf ("S: COMMIT to ED\n"); send_commit (false, true, LINK_STORAGE.tx_buffer[i].address.ed); break; } else { // it is BUSY ACK packet, set retransmission count again and set // longer timeout (receiving device is busy) LINK_STORAGE.tx_buffer[i].transmits_to_error = LINK_STORAGE.tx_max_retries; LINK_STORAGE.tx_buffer[i].expiration_time = LINK_STORAGE.timer_counter + 3; return false; } } } } } else { for (uint8_t i = 0; i < LINK_TX_BUFFER_SIZE; i++) { // if some DATA message for COORD is in buffer and address is the same, // COMMIT packet can be sent if (!LINK_STORAGE.tx_buffer[i].empty) { if (LINK_STORAGE.tx_buffer[i].address_type == 0 && LINK_STORAGE.tx_buffer[i].address.coord == data[6]) { // it is not BUSY ACK packet, switch state and send COMMIT packet if(transfer_type != LINK_BUSY) { LINK_STORAGE.tx_buffer[i].state = COMMIT_SENT;; LINK_STORAGE.tx_buffer[i].transmits_to_error = LINK_STORAGE.tx_max_retries; LINK_STORAGE.tx_buffer[i].expiration_time = LINK_STORAGE.timer_counter + 2; if(data[0] & LINK_COORD_TO_ED) { D_LINK printf ("R: ACK to ED\n"); D_LINK printf ("S: COMMIT to COORD\n"); send_commit (true, false, &LINK_STORAGE.tx_buffer[i].address.coord); break; } else { D_LINK printf ("R: ACK to COORD\n"); D_LINK printf ("S: COMMIT to COORD\n"); send_commit (false, false, &LINK_STORAGE.tx_buffer[i].address.coord); break; } } else { // it is BUSY ACK packet, set retransmission count again and set // longer timeout (receiving device is busy) LINK_STORAGE.tx_buffer[i].transmits_to_error = LINK_STORAGE.tx_max_retries; LINK_STORAGE.tx_buffer[i].expiration_time = LINK_STORAGE.timer_counter + 3; return false; } } } } } } // processing of COMMIT ACK packet else if (packet_type == LINK_COMMIT_ACK_TYPE) { D_LINK printf ("COMMIT ACK\n"); if (data[0] & LINK_ED_TO_COORD) { D_LINK printf ("R: COMMIT ACK to COORD\n"); for (uint8_t i = 0; i < LINK_TX_BUFFER_SIZE; i++) { if (!LINK_STORAGE.tx_buffer[i].empty) { if (LINK_STORAGE.tx_buffer[i].address_type == 1 && array_cmp (LINK_STORAGE.tx_buffer[i].address.ed, data + 6)) { // packet can be accepted LINK_STORAGE.tx_buffer[i].empty = 1; break; } } } } else { for (uint8_t i = 0; i < LINK_TX_BUFFER_SIZE; i++) { if (!LINK_STORAGE.tx_buffer[i].empty) { if (LINK_STORAGE.tx_buffer[i].address_type == 0 && LINK_STORAGE.tx_buffer[i].address.coord == data[6]) { // packet can be accepted LINK_STORAGE.tx_buffer[i].empty = 1; D_LINK printf ("R: COMMIT ACK to ED or COORD\n"); LINK_notify_send_done(); break; } } } } } // processing of DATA packet else if (packet_type == LINK_DATA_TYPE) { D_LINK printf ("DATA\n"); if (transfer_type == LINK_DATA_WITHOUT_ACK) { return LINK_route (data + LINK_HEADER_SIZE, len - LINK_HEADER_SIZE, transfer_type); } else if (transfer_type == LINK_DATA_HS4) { for(uint8_t i = 0; i < LINK_RX_BUFFER_SIZE; i++) { // some DATA are in RX buffer, verify if received packet has not been // already stored in RX buffer if(!LINK_STORAGE.rx_buffer[i].empty) { if (LINK_STORAGE.rx_buffer[i].address_type == 1) { if (array_cmp (LINK_STORAGE.tx_buffer[i].address.ed, data + 6)) { D_LINK printf("ED -> COORD: DATA has been already stored!\n"); send_ack (false, LINK_STORAGE.rx_buffer[i].address_type, data + 6, LINK_STORAGE.rx_buffer[i].transfer_type); return false; } } else { if ((LINK_STORAGE.rx_buffer[i].address.coord == data[6])) { if (data[0] & LINK_COORD_TO_ED) { D_LINK printf("COORD -> ED: DATA has been already stored!\n"); send_ack (true, LINK_STORAGE.rx_buffer[i].address_type, data + 6, LINK_STORAGE.rx_buffer[i].transfer_type); return false; } else { D_LINK printf("COORD -> COORD: DATA has been already stored!\n"); send_ack (false, LINK_STORAGE.rx_buffer[i].address_type, data + 6, LINK_STORAGE.rx_buffer[i].transfer_type); return false; } } } } } uint8_t sender_address_type = (data[0] & LINK_ED_TO_COORD) ? 1 : 0; uint8_t empty_index = get_free_index_rx (); if (empty_index < LINK_RX_BUFFER_SIZE) { // RX buffer is not full, save information about DATA packet uint8_t data_index = 0; for (; data_index < len && data_index < MAX_PHY_PAYLOAD_SIZE; data_index++) { LINK_STORAGE.rx_buffer[empty_index].data[data_index] = data[data_index]; } LINK_STORAGE.rx_buffer[empty_index].len = data_index; LINK_STORAGE.rx_buffer[empty_index].transfer_type = transfer_type; LINK_STORAGE.rx_buffer[empty_index].empty = 0; LINK_STORAGE.rx_buffer[empty_index].address_type = sender_address_type; if (sender_address_type) { for (uint8_t i = 0; i < EDID_LENGTH; i++) LINK_STORAGE.rx_buffer[empty_index].address.ed[i] = data[6 + i]; } else { LINK_STORAGE.rx_buffer[empty_index].address.coord = LINK_cid_mask (data[6]); } } else { // RX buffer is full, send BUSY ACK packet send_busy_ack (false, sender_address_type, data + 6); return true; } if (sender_address_type) { D_LINK printf("R: DATA to COORD\n"); for (uint8_t i = 0; i < LINK_RX_BUFFER_SIZE; i++) { // if some DATA message for COORD from ED is in RX buffer // and address is the same, ACK packet can be sent if (!LINK_STORAGE.rx_buffer[i].empty) { if (LINK_STORAGE.rx_buffer[i].address_type == 1 && array_cmp (LINK_STORAGE.rx_buffer[i].address.ed, data + 6)) { D_LINK printf("S: ACK to ED\n"); send_ack (false, sender_address_type, data + 6, LINK_STORAGE.rx_buffer[i].transfer_type); } } } } else { for (uint8_t i = 0; i < LINK_RX_BUFFER_SIZE; i++) { // if some DATA message for ED or COORD from COORD is in RX buffer // and address is the same, ACK packet can be sent if (!LINK_STORAGE.rx_buffer[i].empty) { if (LINK_STORAGE.rx_buffer[i].address_type == 0 && LINK_STORAGE.rx_buffer[i].address.coord == data[6]) { if (data[0] & LINK_COORD_TO_ED) { D_LINK printf("R: DATA to ED\n"); D_LINK printf("S: ACK to COORD\n"); send_ack (true, sender_address_type, data + 6, LINK_STORAGE.rx_buffer[i].transfer_type); } else { D_LINK printf("R: DATA to COORD\n"); D_LINK printf("S: ACK to COORD\n"); send_ack (false, sender_address_type, data + 6, LINK_STORAGE.rx_buffer[i].transfer_type); } } } } } } } // processing of COMMIT packet else if (packet_type == LINK_COMMIT_TYPE) { D_LINK printf ("COMMIT\n"); if (data[0] & LINK_ED_TO_COORD) { D_LINK printf ("R: COMMIT to COORD\n"); uint8_t i = 0; for (; i < LINK_RX_BUFFER_SIZE; i++) { // if some DATA message for COORD from ED is in RX buffer // and address is the same, COMMIT ACK packet can be sent if (!LINK_STORAGE.rx_buffer[i].empty) { if (LINK_STORAGE.rx_buffer[i].address_type == 1 && array_cmp (LINK_STORAGE.rx_buffer[i].address.ed, data + 6)) { D_LINK printf("S: COMMIT ACK to ED\n"); send_commit_ack (false, data[0] & LINK_ED_TO_COORD, data + 6); bool result = LINK_route (LINK_STORAGE.rx_buffer[i].data + LINK_HEADER_SIZE, LINK_STORAGE.rx_buffer[i].len - LINK_HEADER_SIZE, LINK_STORAGE.rx_buffer[i].transfer_type); LINK_STORAGE.rx_buffer[i].empty = 1; return result; } } } // in case of multiple receiving of COMMIT packet send COMMIT ACK // packet (COMMIT packet was not received by sender) send_commit_ack (false, data[0] & LINK_ED_TO_COORD, data + 6); } else { uint8_t i = 0; for (; i < LINK_RX_BUFFER_SIZE; i++) { if (!LINK_STORAGE.rx_buffer[i].empty) { // if some DATA message for ED or COORD from COORD is in RX buffer // and address is the same, COMMIT ACK packet can be sent if (LINK_STORAGE.rx_buffer[i].address_type == 0 && LINK_STORAGE.rx_buffer[i].address.coord == LINK_cid_mask (data[6])) { if(data[0] & LINK_COORD_TO_ED) { D_LINK printf ("R: COMMIT to ED\n"); D_LINK printf ("S: COMMIT ACK to COORD\n"); send_commit_ack (true, data[0] & LINK_ED_TO_COORD, data + 6); } else { D_LINK printf ("R: COMMIT to COORD\n"); D_LINK printf ("S: COMMIT ACK to COORD\n"); send_commit_ack (false, data[0] & LINK_ED_TO_COORD, data + 6); } bool result = LINK_route (LINK_STORAGE.rx_buffer[i].data + LINK_HEADER_SIZE, LINK_STORAGE.rx_buffer[i].len - LINK_HEADER_SIZE, LINK_STORAGE.rx_buffer[i].transfer_type); LINK_STORAGE.rx_buffer[i].empty = 1; return result; } } } // in case of multiple receiving of COMMIT packet send COMMIT ACK // packet (COMMIT packet was not received by sender) if(data[0] & LINK_COORD_TO_ED) { send_commit_ack (true, data[0] & LINK_ED_TO_COORD, data + 6); } else { send_commit_ack (false, data[0] & LINK_ED_TO_COORD, data + 6); } } } return true; } /* * Checks TX and RX buffers periodically. * Ensures packet retransmission during four-way handshake and detects * unsuccessful four-way handshake. */ void check_buffers_state () { // check the COORD buffers for (uint8_t i = 0; i < LINK_TX_BUFFER_SIZE; i++) { if ((!LINK_STORAGE.tx_buffer[i].empty) && LINK_STORAGE.tx_buffer[i].expiration_time == LINK_STORAGE.timer_counter) { if ((LINK_STORAGE.tx_buffer[i].transmits_to_error--) == 0) { // multiple unsuccessful packet sending, network reinitialization starts if (LINK_STORAGE.tx_buffer[i].address_type) { LINK_error_handler_coord (); // delete all messages for unavailable ED for (uint8_t j = 0; j < LINK_TX_BUFFER_SIZE; j++) { if(!LINK_STORAGE.tx_buffer[j].empty && array_cmp(LINK_STORAGE.tx_buffer[i].address.ed, LINK_STORAGE.tx_buffer[j].address.ed)){ LINK_STORAGE.tx_buffer[j].empty = 1; } } } else { LINK_error_handler_coord (); // delete all messages for unavailable COORD for (uint8_t j = 0; j < LINK_TX_BUFFER_SIZE; j++) { if(!LINK_STORAGE.tx_buffer[j].empty && LINK_STORAGE.tx_buffer[i].address.coord == LINK_STORAGE.tx_buffer[j].address.coord){ LINK_STORAGE.tx_buffer[j].empty = 1; } } } } else { // try to resend packet if (LINK_STORAGE.tx_buffer[i].state) { D_LINK printf("COMMIT again!\n"); if (LINK_STORAGE.tx_buffer[i].address_type) { send_commit (false, true, LINK_STORAGE.tx_buffer[i].address.ed); } else { send_commit (false, false, &LINK_STORAGE.tx_buffer[i].address.coord); } } else { D_LINK printf("DATA again!\n"); if (LINK_STORAGE.tx_buffer[i].address_type) { send_data (false, true, LINK_STORAGE.tx_buffer[i].address.ed, LINK_STORAGE.tx_buffer[i].data, LINK_STORAGE.tx_buffer[i].len, LINK_STORAGE.tx_buffer[i].transfer_type); } else { send_data (false, false, &LINK_STORAGE.tx_buffer[i].address.coord, LINK_STORAGE.tx_buffer[i].data, LINK_STORAGE.tx_buffer[i].len, LINK_STORAGE.tx_buffer[i].transfer_type); } } LINK_STORAGE.tx_buffer[i].expiration_time = LINK_STORAGE.timer_counter + 2; } } } } /** * Processes received packet. * @param data Data. * @param len Data length. */ void PHY_process_packet (uint8_t* data, uint8_t len) { /*printf("RAW: "); for(uint8_t i = 0; i < len; i++) printf("%02x ",data[i]); printf("\n");*/ D_LINK printf ("PHY_process_packet()!\n"); // packet is too short if (len < LINK_HEADER_SIZE) return; uint8_t packet_type = data[0] >> 6; uint8_t transfer_type = data[0] & 0x0f; // JOIN packet processing before NID check if (transfer_type == LINK_DATA_JOIN_REQUEST && packet_type == LINK_DATA_TYPE) { D_LINK printf("JOIN REQUEST received\n"); // JOIN REQUEST message, send ACK JOIN REQUEST message if(!NET_is_set_pair_mode()) { D_LINK printf("Not in a PAIR MODE!\n"); return; } LINK_save_msg_info(data + 10, len - 10); uint8_t ack_packet[LINK_HEADER_SIZE]; gen_header (ack_packet, false, true, data + 6, LINK_ACK_TYPE, LINK_ACK_JOIN_REQUEST); D_LINK printf("ACK JOIN REQUEST\n"); PHY_send_with_cca (ack_packet, LINK_HEADER_SIZE); // send JOIN REQUEST ROUTE message with RSSI uint8_t RSSI = PHY_get_measured_noise(); LINK_join_request_received (RSSI, data + LINK_HEADER_SIZE, len - LINK_HEADER_SIZE); return; } // packet is not in my network if (!array_cmp (data + 1, GLOBAL_STORAGE.nid)) return; LINK_save_msg_info(data + 10, len - 10); if (transfer_type == LINK_DATA_BROADCAST) { D_LINK printf("BROADCAST received\n"); LINK_route (data + LINK_HEADER_SIZE, len - LINK_HEADER_SIZE, LINK_DATA_BROADCAST); return; } // packets to PAN are sent only as to COORD, not to ED if (data[0] & LINK_COORD_TO_ED) return; // packet for another COORD if (LINK_cid_mask (data[5]) != GLOBAL_STORAGE.cid) return; // if routing is disabled and four-way handshake is not finished // do not process next packets if (!GLOBAL_STORAGE.routing_enabled && ((transfer_type == LINK_DATA_HS4) && packet_type != LINK_COMMIT_ACK_TYPE)) { D_LINK printf ("Routing disabled\n"); return; } // packet is from COORD if (!(data[0] & LINK_ED_TO_COORD)) { uint8_t sender_cid = LINK_cid_mask (data[6]); // packet has to be from my child if (GLOBAL_STORAGE.routing_tree[sender_cid] != GLOBAL_STORAGE.cid) { D_LINK printf ("Not my child!\n"); return; } } // packet processing and routing router_process_packet (data, len); } /** * Checks buffers, increments counter periodically and * alternatively sends JOIN RESPONSE (ROUTE) and MOVE RESPONSE (ROUTE) messages. */ void PHY_timer_interrupt () { LINK_STORAGE.timer_counter++; LINK_timer_counter(); /*if(GLOBAL_STORAGE.pair_mode) NET_joining(); NET_moving();*/ check_buffers_state (); } /** * Gets address of coordinator (CID). * @param byte Byte containing coordinator ID. * @return Returns coordinator ID (6 bits). */ uint8_t LINK_cid_mask (uint8_t address) { return address & 0x3f; } /** * Initializes link layer and ensures initialization of physical layer. * @param phy_params Parameters of physical layer. * @param link_params Parameters of link layer. */ void LINK_init (struct PHY_init_t* phy_params, struct LINK_init_t* link_params) { D_LINK printf("LINK_init\n"); PHY_init(phy_params); LINK_STORAGE.tx_max_retries = link_params->tx_max_retries; for (uint8_t i = 0; i < LINK_RX_BUFFER_SIZE; i++) { LINK_STORAGE.rx_buffer[i].empty = 1; } for (uint8_t i = 0; i < LINK_TX_BUFFER_SIZE; i++) { LINK_STORAGE.tx_buffer[i].empty = 1; } LINK_STORAGE.timer_counter = 0; } void LINK_send_join_response (uint8_t* edid, uint8_t* payload, uint8_t len) { // JOIN RESPONSE length is 25 bytes uint8_t packet[25]; uint8_t packet_index = LINK_HEADER_SIZE; gen_header (packet, false, true, edid, LINK_DATA_TYPE, LINK_DATA_JOIN_RESPONSE); for (uint8_t i = 0; i < len && packet_index < MAX_PHY_PAYLOAD_SIZE; i++) { packet[packet_index++] = payload[i]; } PHY_send_with_cca (packet, packet_index); } /** * Broadcasts packet. * @param payload Payload. * @param len Payload length. */ bool LINK_send_broadcast (uint8_t * payload, uint8_t len) { uint8_t packet[MAX_PHY_PAYLOAD_SIZE]; uint8_t packet_index = LINK_HEADER_SIZE; // size of link header uint8_t address_next_coord = LINK_COORD_ALL; gen_header (packet, true, false, &address_next_coord, LINK_DATA_TYPE, LINK_DATA_BROADCAST); for (uint8_t index = 0; index < len; index++) { packet[packet_index++] = payload[index]; } PHY_send_with_cca (packet, packet_index); return true; } /** * Sends packet. * @param to_ed True if destination device is ED, false otherwise. * @param address Destination address. * @param payload Payload. * @param len Payload length. * @param transfer_type Transfer type on link layer. * @return Returns false if no space is in TX buffer, true otherwise. */ bool LINK_send_coord (bool to_ed, uint8_t * address, uint8_t * payload, uint8_t len, uint8_t transfer_type) { D_LINK printf("LINK_send_coord()\n"); if(transfer_type == LINK_DATA_HS4) { // send data using four-way handshake uint8_t free_index = get_free_index_tx (); if (free_index >= LINK_TX_BUFFER_SIZE) return false; for (uint8_t i = 0; i < len; i++) LINK_STORAGE.tx_buffer[free_index].data[i] = payload[i]; LINK_STORAGE.tx_buffer[free_index].len = len; if (to_ed) { for (uint8_t i = 0; i < EDID_LENGTH; i++) LINK_STORAGE.tx_buffer[free_index].address.ed[i] = address[i]; } else { LINK_STORAGE.tx_buffer[free_index].address.coord = *address; } // 0 - packet is for ED, 1- packet is for COORD LINK_STORAGE.tx_buffer[free_index].address_type = to_ed ? 1 : 0; LINK_STORAGE.tx_buffer[free_index].state = DATA_SENT; LINK_STORAGE.tx_buffer[free_index].transmits_to_error = LINK_STORAGE.tx_max_retries; LINK_STORAGE.tx_buffer[free_index].expiration_time = LINK_STORAGE.timer_counter + 2; LINK_STORAGE.tx_buffer[free_index].transfer_type = transfer_type; LINK_STORAGE.tx_buffer[free_index].empty = 0; if (LINK_STORAGE.tx_buffer[free_index].address_type) send_data (false, true, LINK_STORAGE.tx_buffer[free_index].address.ed, LINK_STORAGE.tx_buffer[free_index].data, LINK_STORAGE.tx_buffer[free_index].len, transfer_type); else send_data (false, false, &LINK_STORAGE.tx_buffer[free_index].address.coord, LINK_STORAGE.tx_buffer[free_index].data, LINK_STORAGE.tx_buffer[free_index].len, transfer_type); } else if (transfer_type == LINK_DATA_WITHOUT_ACK) { // send data without waiting for ACK message uint8_t packet[MAX_PHY_PAYLOAD_SIZE]; //size of link header uint8_t packet_index = LINK_HEADER_SIZE; if(to_ed) gen_header (packet, false, true, address, LINK_DATA_TYPE, LINK_DATA_WITHOUT_ACK); else gen_header (packet, false, false, address, LINK_DATA_TYPE, LINK_DATA_WITHOUT_ACK); for (uint8_t index = 0; index < len; index++) { packet[packet_index++] = payload[index]; } PHY_send_with_cca (packet, packet_index); } else if (transfer_type == LINK_DATA_BROADCAST) { // send broadcast message D_LINK printf("BROADCAST sent!\n"); LINK_send_broadcast(payload, len); } return true; } /** * Gets RSSI value. * @return Returns RSSI value. */ uint8_t LINK_get_measured_noise() { return PHY_get_measured_noise(); } void LINK_stop() { PHY_stop(); }
34.007991
132
0.669934
677683951ea683a30b3a06aa27a6d6031be6b75e
77,473
cpp
C++
source/game/gamesys/SysCvar.cpp
JasonHutton/QWTA
7f42dc70eb230cf69a8048fc98d647a486e752f1
[ "MIT" ]
2
2021-05-02T18:37:48.000Z
2021-07-18T16:18:14.000Z
source/game/gamesys/SysCvar.cpp
JasonHutton/QWTA
7f42dc70eb230cf69a8048fc98d647a486e752f1
[ "MIT" ]
null
null
null
source/game/gamesys/SysCvar.cpp
JasonHutton/QWTA
7f42dc70eb230cf69a8048fc98d647a486e752f1
[ "MIT" ]
null
null
null
// Copyright (C) 2007 Id Software, Inc. // #include "../precompiled.h" #pragma hdrstop #if defined( _DEBUG ) && !defined( ID_REDIRECT_NEWDELETE ) #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif #include "../../framework/BuildVersion.h" #include "../../framework/BuildDefines.h" #include "../../framework/Licensee.h" #include "../rules/GameRules.h" #if defined( _DEBUG ) #define BUILD_DEBUG "(debug)" #else #define BUILD_DEBUG "" #endif /* All game cvars should be defined here. */ struct gameVersion_t { static const int strSize = 256; gameVersion_t( void ) { idStr::snPrintf( string, strSize, "%s %d.%d.%d.%d %s %s %s %s", GAME_NAME, ENGINE_VERSION_MAJOR, ENGINE_VERSION_MINOR, ENGINE_SRC_REVISION, ENGINE_MEDIA_REVISION, BUILD_DEBUG, BUILD_STRING, __DATE__, __TIME__ ); string[ strSize - 1 ] = '\0'; } char string[strSize]; } gameVersion; #define MOD_NAME "QWTA" #define MOD_VERSION_MAJOR 0 #define MOD_VERSION_MINOR 3 #define MOD_VERSION_REVISION 5 struct modVersion_t { static const int strSize = 256; modVersion_t( void ) { idStr::snPrintf( string, strSize, "%s %d.%d.%d", MOD_NAME, MOD_VERSION_MAJOR, MOD_VERSION_MINOR, MOD_VERSION_REVISION ); } char string[strSize]; } modVersion; idCVar g_version( "g_version", gameVersion.string, CVAR_GAME | CVAR_ROM, "game version" ); idCVar g_modVersion( "g_modVersion", modVersion.string, CVAR_GAME | CVAR_ROM, "mod version" ); // noset vars idCVar gamename( "gamename", GAME_VERSION, CVAR_GAME | CVAR_SERVERINFO | CVAR_ROM, "" ); idCVar gamedate( "gamedate", __DATE__, CVAR_GAME | CVAR_ROM, "" ); // server info idCVar si_name( "si_name", GAME_NAME " Server", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE, "name of the server" ); idCVar si_maxPlayers( "si_maxPlayers", "24", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_INTEGER | CVAR_RANKLOCKED, "max number of players allowed on the server", 1, static_cast< float >( MAX_CLIENTS ) ); idCVar si_privateClients( "si_privateClients", "0", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_INTEGER, "max number of private players allowed on the server", 0, static_cast< float >( MAX_CLIENTS ) ); idCVar si_teamDamage( "si_teamDamage", "1", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_BOOL | CVAR_RANKLOCKED, "enable team damage" ); idCVar si_needPass( "si_needPass", "0", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_BOOL | CVAR_RANKLOCKED, "enable client password checking" ); idCVar si_pure( "si_pure", "1", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_BOOL | CVAR_RANKLOCKED, "server is pure and does not allow modified data" ); idCVar si_spectators( "si_spectators", "1", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_BOOL, "allow spectators or require all clients to play" ); idCVar si_rules( "si_rules", "sdGameRulesCampaign", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_RANKLOCKED, "ruleset for game", sdGameRules::ArgCompletion_RuleTypes ); idCVar si_timeLimit( "si_timelimit", "20", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_FLOAT | CVAR_RANKLOCKED, "time limit (mins)" ); idCVar si_map( "si_map", "", CVAR_GAME | CVAR_SERVERINFO | CVAR_ROM, "current active map" ); idCVar si_campaign( "si_campaign", "", CVAR_GAME | CVAR_SERVERINFO | CVAR_ROM, "current active campaign" ); idCVar si_campaignInfo( "si_campaignInfo", "", CVAR_GAME | CVAR_SERVERINFO | CVAR_ROM, "current campaign map info" ); idCVar si_tactical( "si_tactical", "", CVAR_GAME | CVAR_SERVERINFO | CVAR_ROM, "current active tactical" ); idCVar si_tacticalInfo( "si_tacticalInfo", "", CVAR_GAME | CVAR_SERVERINFO | CVAR_ROM, "current tactical map info" ); idCVar si_teamForceBalance( "si_teamForceBalance", "1", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_BOOL | CVAR_RANKLOCKED, "Stop players from unbalancing teams" ); idCVar si_website( "si_website", "", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE, "website info" ); idCVar si_adminname( "si_adminname", "", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE, "admin name(s)" ); idCVar si_email( "si_email", "", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE, "contact email address" ); idCVar si_irc( "si_irc", "", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE, "IRC channel" ); idCVar si_motd_1( "si_motd_1", "", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE, "motd line 1" ); idCVar si_motd_2( "si_motd_2", "", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE, "motd line 2" ); idCVar si_motd_3( "si_motd_3", "", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE, "motd line 3" ); idCVar si_motd_4( "si_motd_4", "", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE, "motd line 4" ); idCVar si_adminStart( "si_adminStart", "0", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_RANKLOCKED, "admin required to start the match" ); idCVar si_disableVoting( "si_disableVoting", "0", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE, "disable/enable all voting" ); idCVar si_readyPercent( "si_readyPercent", "51", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_INTEGER | CVAR_RANKLOCKED, "percentage of players that need to ready up to start a match" ); idCVar si_minPlayers( "si_minPlayers", "6", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_INTEGER | CVAR_RANKLOCKED, "minimum players before a game can be started" ); idCVar si_allowLateJoin( "si_allowLateJoin", "1", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_BOOL, "Enable/disable players joining a match in progress" ); idCVar si_noProficiency( "si_noProficiency", "0", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_BOOL | CVAR_RANKLOCKED, "enable/disable XP" ); idCVar si_disableGlobalChat( "si_disableGlobalChat", "0", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_BOOL | CVAR_RANKLOCKED, "disable global text communication" ); idCVar si_gameReviewReadyWait( "si_gameReviewReadyWait", "0", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE | CVAR_BOOL, "wait for players to ready up before going to the next map" ); idCVar si_serverURL( "si_serverURL", "", CVAR_GAME | CVAR_SERVERINFO | CVAR_ARCHIVE, "server information page" ); idCVar* si_motd_cvars[] = { &si_motd_1, &si_motd_2, &si_motd_3, &si_motd_4, }; // user info idCVar ui_name( "ui_name", "Player", CVAR_GAME | CVAR_PROFILE | CVAR_USERINFO | CVAR_ARCHIVE, "player name" ); idCVar ui_clanTag( "ui_clanTag", "", CVAR_GAME | CVAR_PROFILE | CVAR_USERINFO | CVAR_ARCHIVE, "player clan tag" ); idCVar ui_clanTagPosition( "ui_clanTagPosition", "0", CVAR_GAME | CVAR_PROFILE | CVAR_USERINFO | CVAR_ARCHIVE | CVAR_INTEGER, "positioning of player clan tag. 0 is before their name, 1 is after" ); idCVar ui_showGun( "ui_showGun", "1", CVAR_GAME | CVAR_PROFILE | CVAR_USERINFO | CVAR_ARCHIVE | CVAR_BOOL, "show gun" ); idCVar ui_autoSwitchEmptyWeapons( "ui_autoSwitchEmptyWeapons", "1", CVAR_GAME | CVAR_PROFILE | CVAR_USERINFO | CVAR_ARCHIVE | CVAR_BOOL, "if true, will switch to the next usable weapon when the current weapon runs out of ammo" ); idCVar ui_ignoreExplosiveWeapons( "ui_ignoreExplosiveWeapons", "1", CVAR_GAME | CVAR_PROFILE | CVAR_USERINFO | CVAR_ARCHIVE | CVAR_BOOL, "if true, weapons marked as explosive will be ignored during auto-switches" ); idCVar ui_postArmFindBestWeapon( "ui_postArmFindBestWeapon", "0", CVAR_GAME | CVAR_PROFILE | CVAR_USERINFO | CVAR_ARCHIVE | CVAR_BOOL, "if true, after arming players' best weapon will be selected" ); idCVar ui_advancedFlightControls( "ui_advancedFlightControls", "0", CVAR_GAME | CVAR_PROFILE | CVAR_USERINFO | CVAR_ARCHIVE | CVAR_BOOL, "if true, advanced flight controls are activated" ); idCVar ui_rememberCameraMode( "ui_rememberCameraMode", "0", CVAR_GAME | CVAR_PROFILE | CVAR_USERINFO | CVAR_ARCHIVE | CVAR_BOOL, "use same camera mode as was previously used when re-entering a vehicle" ); idCVar ui_drivingCameraFreelook( "ui_drivingCameraFreelook", "0", CVAR_GAME | CVAR_PROFILE | CVAR_USERINFO | CVAR_ARCHIVE | CVAR_BOOL, "if true, driving cameras where there is no weapon defaults to freelook" ); idCVar ui_voipReceiveGlobal( "ui_voipReceiveGlobal", "0", CVAR_GAME | CVAR_PROFILE | CVAR_USERINFO | CVAR_ARCHIVE | CVAR_BOOL, "if true, receive voice chat sent to the global channel" ); idCVar ui_voipReceiveTeam( "ui_voipReceiveTeam", "1", CVAR_GAME | CVAR_PROFILE | CVAR_USERINFO | CVAR_ARCHIVE | CVAR_BOOL, "if true, receive voice chat sent to the team channel" ); idCVar ui_voipReceiveFireTeam( "ui_voipReceiveFireTeam", "1", CVAR_GAME | CVAR_PROFILE | CVAR_USERINFO | CVAR_ARCHIVE | CVAR_BOOL, "if true, receive voice chat sent to the fireteam channel" ); idCVar ui_showComplaints( "ui_showComplaints", "1", CVAR_GAME | CVAR_PROFILE | CVAR_USERINFO | CVAR_ARCHIVE | CVAR_BOOL, "if true, receive complaints popups for team kills" ); idCVar ui_swapFlightYawAndRoll( "ui_swapFlightYawAndRoll", "0", CVAR_GAME | CVAR_PROFILE | CVAR_USERINFO | CVAR_ARCHIVE | CVAR_BOOL, "if true, swaps the yaw & roll controls for flying vehicles - mouse becomes yaw and keys become roll" ); // change anytime vars idCVar g_decals( "g_decals", "1", CVAR_GAME | CVAR_PROFILE | CVAR_ARCHIVE | CVAR_BOOL, "show decals such as bullet holes" ); idCVar g_knockback( "g_knockback", "1", CVAR_GAME | CVAR_FLOAT, "" ); idCVar g_gravity( "g_gravity", DEFAULT_GRAVITY_STRING, CVAR_GAME | CVAR_FLOAT, "" ); idCVar g_disasm( "g_disasm", "0", CVAR_GAME | CVAR_BOOL, "disassemble script into base/script/disasm.txt on the local drive when script is compiled" ); idCVar g_debugBounds( "g_debugBounds", "0", CVAR_GAME | CVAR_BOOL, "checks for models with bounds > 2048" ); idCVar g_debugAnim( "g_debugAnim", "-1", CVAR_GAME | CVAR_INTEGER, "displays information on which animations are playing on the specified entity number. set to -1 to disable." ); idCVar g_debugAnimStance( "g_debugAnimStance", "-1", CVAR_GAME | CVAR_INTEGER, "displays information on which stances are set on the specified entity number. set to -1 to disable." ); idCVar g_debugDamage( "g_debugDamage", "0", CVAR_GAME | CVAR_BOOL, "" ); idCVar g_debugWeapon( "g_debugWeapon", "0", CVAR_GAME | CVAR_BOOL, "" ); idCVar g_debugWeaponSpread( "g_debugWeaponSpread", "0", CVAR_GAME | CVAR_BOOL, "displays the current spread value for the weapon" ); idCVar g_debugScript( "g_debugScript", "0", CVAR_GAME | CVAR_BOOL, "" ); idCVar g_debugCinematic( "g_debugCinematic", "0", CVAR_GAME | CVAR_BOOL, "" ); idCVar g_debugPlayerList( "g_debugPlayerList", "0", CVAR_GAME | CVAR_INTEGER, "fills UI lists with fake players" ); idCVar g_showPVS( "g_showPVS", "0", CVAR_GAME | CVAR_INTEGER, "", 0, 2 ); idCVar g_showTargets( "g_showTargets", "0", CVAR_GAME | CVAR_BOOL, "draws entities and their targets. hidden entities are drawn grey." ); idCVar g_showTriggers( "g_showTriggers", "0", CVAR_GAME | CVAR_BOOL, "draws trigger entities (orange) and their targets (green). disabled triggers are drawn grey." ); idCVar g_showCollisionWorld( "g_showCollisionWorld", "0", CVAR_GAME | CVAR_INTEGER, "" ); idCVar g_showVehiclePathNodes( "g_showVehiclePathNodes", "0", CVAR_GAME | CVAR_INTEGER, "" ); idCVar g_showCollisionModels( "g_showCollisionModels", "0", CVAR_GAME | CVAR_BOOL, "" ); idCVar g_showRenderModelBounds( "g_showRenderModelBounds", "0", CVAR_GAME | CVAR_BOOL, "" ); idCVar g_collisionModelMask( "g_collisionModelMask", "-1", CVAR_GAME | CVAR_INTEGER, "" ); idCVar g_showCollisionTraces( "g_showCollisionTraces", "0", CVAR_GAME | CVAR_BOOL, "" ); idCVar g_showClipSectors( "g_showClipSectors", "0", CVAR_GAME | CVAR_BOOL, "" ); idCVar g_showClipSectorFilter( "g_showClipSectorFilter", "0", CVAR_GAME, "" ); idCVar g_showAreaClipSectors( "g_showAreaClipSectors", "0", CVAR_GAME | CVAR_FLOAT, "" ); idCVar g_maxShowDistance( "g_maxShowDistance", "128", CVAR_GAME | CVAR_FLOAT, "" ); idCVar g_showEntityInfo( "g_showEntityInfo", "0", CVAR_GAME | CVAR_BOOL, "" ); idCVar g_showcamerainfo( "g_showcamerainfo", "0", CVAR_GAME, "displays the current frame # for the camera when playing cinematics" ); idCVar g_showTestModelFrame( "g_showTestModelFrame", "0", CVAR_GAME | CVAR_BOOL, "displays the current animation and frame # for testmodels" ); idCVar g_showActiveEntities( "g_showActiveEntities", "0", CVAR_GAME | CVAR_BOOL, "draws boxes around thinking entities. " ); idCVar g_debugMask( "g_debugMask", "", CVAR_GAME, "debugs a deployment mask" ); idCVar g_debugLocations( "g_debugLocations", "0", CVAR_GAME | CVAR_BOOL, "" ); idCVar g_showActiveDeployZones( "g_showActiveDeployZones", "0", CVAR_GAME | CVAR_BOOL, "" ); idCVar g_disableVehicleSpawns( "g_disableVehicleSpawns", "1", CVAR_GAME | CVAR_BOOL | CVAR_NOCHEAT | CVAR_RANKLOCKED, "disables vehicles spawning from construction pads" ); idCVar g_frametime( "g_frametime", "0", CVAR_GAME | CVAR_BOOL, "displays timing information for each game frame" ); //idCVar g_timeentities( "g_timeEntities", "0", CVAR_GAME | CVAR_FLOAT, "when non-zero, shows entities whose think functions exceeded the # of milliseconds specified" ); //idCVar g_timetypeentities( "g_timeTypeEntities", "", CVAR_GAME, "" ); idCVar ai_debugScript( "ai_debugScript", "-1", CVAR_GAME | CVAR_INTEGER, "displays script calls for the specified monster entity number" ); idCVar ai_debugAnimState( "ai_debugAnimState", "-1", CVAR_GAME | CVAR_INTEGER, "displays animState changes for the specified monster entity number" ); idCVar ai_debugMove( "ai_debugMove", "0", CVAR_GAME | CVAR_BOOL, "draws movement information for monsters" ); idCVar ai_debugTrajectory( "ai_debugTrajectory", "0", CVAR_GAME | CVAR_BOOL, "draws trajectory tests for monsters" ); idCVar g_kickTime( "g_kickTime", "1", CVAR_GAME | CVAR_FLOAT, "" ); idCVar g_kickAmplitude( "g_kickAmplitude", "0.0001", CVAR_GAME | CVAR_FLOAT, "" ); //idCVar g_blobTime( "g_blobTime", "1", CVAR_GAME | CVAR_FLOAT, "" ); //idCVar g_blobSize( "g_blobSize", "1", CVAR_GAME | CVAR_FLOAT, "" ); idCVar g_editEntityMode( "g_editEntityMode", "0", CVAR_GAME | CVAR_INTEGER, "0 = off\n" "1 = lights\n" "2 = sounds\n" "3 = articulated figures\n" "4 = particle systems\n" "5 = monsters\n" "6 = entity names\n" "7 = entity models", 0, 7, idCmdSystem::ArgCompletion_Integer<0,7> ); idCVar g_dragEntity( "g_dragEntity", "0", CVAR_GAME | CVAR_BOOL, "allows dragging physics objects around by placing the crosshair over them and holding the fire button" ); idCVar g_dragDamping( "g_dragDamping", "0.5", CVAR_GAME | CVAR_FLOAT, "" ); idCVar g_dragMaxforce( "g_dragMaxforce", "5000000", CVAR_GAME | CVAR_FLOAT, "" ); idCVar g_dragShowSelection( "g_dragShowSelection", "0", CVAR_GAME | CVAR_BOOL, "" ); idCVar g_vehicleVelocity( "g_vehicleVelocity", "1000", CVAR_GAME | CVAR_FLOAT, "" ); idCVar g_vehicleForce( "g_vehicleForce", "50000", CVAR_GAME | CVAR_FLOAT, "" ); idCVar g_vehicleSuspensionUp( "g_vehicleSuspensionUp", "32", CVAR_GAME | CVAR_FLOAT, "" ); idCVar g_vehicleSuspensionDown( "g_vehicleSuspensionDown", "20", CVAR_GAME | CVAR_FLOAT, "" ); idCVar g_vehicleSuspensionKCompress("g_vehicleSuspensionKCompress","200", CVAR_GAME | CVAR_FLOAT, "" ); idCVar g_vehicleSuspensionDamping( "g_vehicleSuspensionDamping","400", CVAR_GAME | CVAR_FLOAT, "" ); idCVar g_vehicleTireFriction( "g_vehicleTireFriction", "0.8", CVAR_GAME | CVAR_FLOAT, "" ); idCVar g_commandMapZoomStep( "g_commandMapZoomStep", "0.125", CVAR_GAME | CVAR_PROFILE | CVAR_ARCHIVE | CVAR_FLOAT | CVAR_NOCHEAT, "percent to increase/decrease command map zoom by" ); idCVar g_commandMapZoom( "g_commandMapZoom", "0.25", CVAR_GAME | CVAR_PROFILE | CVAR_ARCHIVE | CVAR_FLOAT | CVAR_NOCHEAT, "command map zoom level", 0.125f, 0.75f ); idCVar g_showPlayerSpeed( "g_showPlayerSpeed", "0", CVAR_GAME | CVAR_BOOL, "displays player movement speed" ); idCVar m_helicopterPitch( "m_helicopterPitch", "-0.022", CVAR_GAME | CVAR_PROFILE | CVAR_ARCHIVE | CVAR_FLOAT | CVAR_NOCHEAT, "helicopter mouse pitch scale" ); idCVar m_helicopterYaw( "m_helicopterYaw", "0.022", CVAR_GAME | CVAR_PROFILE | CVAR_ARCHIVE | CVAR_FLOAT | CVAR_NOCHEAT, "helicopter mouse yaw scale" ); idCVar m_helicopterPitchScale( "m_helicopterPitchScale", "1", CVAR_GAME | CVAR_PROFILE | CVAR_ARCHIVE | CVAR_FLOAT | CVAR_NOCHEAT, "sensitivity scale (over base) for Anansi/Tormentor pitch" ); idCVar m_helicopterYawScale( "m_helicopterYawScale", "1", CVAR_GAME | CVAR_PROFILE | CVAR_ARCHIVE | CVAR_FLOAT | CVAR_NOCHEAT, "sensitivity scale (over base) for Anansi/Tormentor yaw" ); idCVar m_bumblebeePitchScale( "m_bumblebeePitchScale", "1", CVAR_GAME | CVAR_PROFILE | CVAR_ARCHIVE | CVAR_FLOAT | CVAR_NOCHEAT, "sensitivity scale (over base) for Bumblebee pitch" ); idCVar m_bumblebeeYawScale( "m_bumblebeeYawScale", "1", CVAR_GAME | CVAR_PROFILE | CVAR_ARCHIVE | CVAR_FLOAT | CVAR_NOCHEAT, "sensitivity scale (over base) for Bumblebee yaw" ); idCVar m_lightVehiclePitchScale( "m_lightVehiclePitchScale", "1", CVAR_GAME | CVAR_PROFILE | CVAR_ARCHIVE | CVAR_FLOAT | CVAR_NOCHEAT, "sensitivity scale (over base) for Husky/Armadillo/Hog/Trojan pitch" ); idCVar m_lightVehicleYawScale( "m_lightVehicleYawScale", "1", CVAR_GAME | CVAR_PROFILE | CVAR_ARCHIVE | CVAR_FLOAT | CVAR_NOCHEAT, "sensitivity scale (over base) for Husky/Armadillo/Hog/Trojan yaw" ); idCVar m_heavyVehiclePitchScale( "m_heavyVehiclePitchScale", "1", CVAR_GAME | CVAR_PROFILE | CVAR_ARCHIVE | CVAR_FLOAT | CVAR_NOCHEAT, "sensitivity scale (over base) for Titan/Cyclops pitch" ); idCVar m_heavyVehicleYawScale( "m_heavyVehicleYawScale", "1", CVAR_GAME | CVAR_PROFILE | CVAR_ARCHIVE | CVAR_FLOAT | CVAR_NOCHEAT, "sensitivity scale (over base) for Titan/Cyclops yaw" ); idCVar m_playerPitchScale( "m_playerPitchScale", "1", CVAR_GAME | CVAR_PROFILE | CVAR_ARCHIVE | CVAR_FLOAT | CVAR_NOCHEAT, "sensitivity scale (over base) for player pitch" ); idCVar m_playerYawScale( "m_playerYawScale", "1", CVAR_GAME | CVAR_PROFILE | CVAR_ARCHIVE | CVAR_FLOAT | CVAR_NOCHEAT, "sensitivity scale (over base) for player yaw" ); idCVar ik_enable( "ik_enable", "1", CVAR_GAME | CVAR_BOOL, "enable IK" ); idCVar ik_debug( "ik_debug", "0", CVAR_GAME | CVAR_BOOL, "show IK debug lines" ); idCVar af_useLinearTime( "af_useLinearTime", "1", CVAR_GAME | CVAR_BOOL, "use linear time algorithm for tree-like structures" ); idCVar af_useImpulseFriction( "af_useImpulseFriction", "0", CVAR_GAME | CVAR_BOOL, "use impulse based contact friction" ); idCVar af_useJointImpulseFriction( "af_useJointImpulseFriction","0", CVAR_GAME | CVAR_BOOL, "use impulse based joint friction" ); idCVar af_useSymmetry( "af_useSymmetry", "1", CVAR_GAME | CVAR_BOOL, "use constraint matrix symmetry" ); idCVar af_skipSelfCollision( "af_skipSelfCollision", "0", CVAR_GAME | CVAR_BOOL, "skip self collision detection" ); idCVar af_skipLimits( "af_skipLimits", "0", CVAR_GAME | CVAR_BOOL, "skip joint limits" ); idCVar af_skipFriction( "af_skipFriction", "0", CVAR_GAME | CVAR_BOOL, "skip friction" ); idCVar af_forceFriction( "af_forceFriction", "-1", CVAR_GAME | CVAR_FLOAT, "force the given friction value" ); idCVar af_maxLinearVelocity( "af_maxLinearVelocity", "128", CVAR_GAME | CVAR_FLOAT, "maximum linear velocity" ); idCVar af_maxAngularVelocity( "af_maxAngularVelocity", "1.57", CVAR_GAME | CVAR_FLOAT, "maximum angular velocity" ); idCVar af_timeScale( "af_timeScale", "1", CVAR_GAME | CVAR_FLOAT, "scales the time" ); idCVar af_jointFrictionScale( "af_jointFrictionScale", "0", CVAR_GAME | CVAR_FLOAT, "scales the joint friction" ); idCVar af_contactFrictionScale( "af_contactFrictionScale", "0", CVAR_GAME | CVAR_FLOAT, "scales the contact friction" ); idCVar af_highlightBody( "af_highlightBody", "", CVAR_GAME, "name of the body to highlight" ); idCVar af_highlightConstraint( "af_highlightConstraint", "", CVAR_GAME, "name of the constraint to highlight" ); idCVar af_showTimings( "af_showTimings", "0", CVAR_GAME | CVAR_BOOL, "show articulated figure cpu usage" ); idCVar af_showConstraints( "af_showConstraints", "0", CVAR_GAME | CVAR_BOOL, "show constraints" ); idCVar af_showConstraintNames( "af_showConstraintNames", "0", CVAR_GAME | CVAR_BOOL, "show constraint names" ); idCVar af_showConstrainedBodies( "af_showConstrainedBodies", "0", CVAR_GAME | CVAR_BOOL, "show the two bodies contrained by the highlighted constraint" ); idCVar af_showPrimaryOnly( "af_showPrimaryOnly", "0", CVAR_GAME | CVAR_BOOL, "show primary constraints only" ); idCVar af_showTrees( "af_showTrees", "0", CVAR_GAME | CVAR_BOOL, "show tree-like structures" ); idCVar af_showLimits( "af_showLimits", "0", CVAR_GAME | CVAR_BOOL, "show joint limits" ); idCVar af_showBodies( "af_showBodies", "0", CVAR_GAME | CVAR_BOOL, "show bodies" ); idCVar af_showBodyNames( "af_showBodyNames", "0", CVAR_GAME | CVAR_BOOL, "show body names" ); idCVar af_showMass( "af_showMass", "0", CVAR_GAME | CVAR_BOOL, "show the mass of each body" ); idCVar af_showTotalMass( "af_showTotalMass", "0", CVAR_GAME | CVAR_BOOL, "show the total mass of each articulated figure" ); idCVar af_showInertia( "af_showInertia", "0", CVAR_GAME | CVAR_BOOL, "show the inertia tensor of each body" ); idCVar af_showVelocity( "af_showVelocity", "0", CVAR_GAME | CVAR_BOOL, "show the velocity of each body" ); idCVar af_showActive( "af_showActive", "0", CVAR_GAME | CVAR_BOOL, "show tree-like structures of articulated figures not at rest" ); idCVar af_testSolid( "af_testSolid", "1", CVAR_GAME | CVAR_BOOL, "test for bodies initially stuck in solid" ); idCVar rb_showTimings( "rb_showTimings", "0", CVAR_GAME | CVAR_INTEGER, "show rigid body cpu usage" ); idCVar rb_showBodies( "rb_showBodies", "0", CVAR_GAME | CVAR_BOOL, "show rigid bodies" ); idCVar rb_showMass( "rb_showMass", "0", CVAR_GAME | CVAR_BOOL, "show the mass of each rigid body" ); idCVar rb_showInertia( "rb_showInertia", "0", CVAR_GAME | CVAR_BOOL, "show the inertia tensor of each rigid body" ); idCVar rb_showVelocity( "rb_showVelocity", "0", CVAR_GAME | CVAR_BOOL, "show the velocity of each rigid body" ); idCVar rb_showActive( "rb_showActive", "0", CVAR_GAME | CVAR_BOOL, "show rigid bodies that are not at rest" ); idCVar rb_showContacts( "rb_showContacts", "0", CVAR_GAME | CVAR_BOOL, "show contact points on rigid bodies" ); idCVar pm_friction( "pm_friction", "4", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_RANKLOCKED, "friction applied to player on the ground" ); idCVar pm_jumpheight( "pm_jumpheight", "68", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_RANKLOCKED, "approximate height the player can jump" ); idCVar pm_stepsize( "pm_stepsize", "16", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_RANKLOCKED, "maximum height the player can step up without jumping" ); idCVar pm_pronespeed( "pm_pronespeed", "60", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_RANKLOCKED, "speed the player can move while prone" ); idCVar pm_crouchspeed( "pm_crouchspeed", "80", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_RANKLOCKED, "speed the player can move while crouched" ); idCVar pm_walkspeed( "pm_walkspeed", "128", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_RANKLOCKED, "speed the player can move while walking" ); idCVar pm_runspeedforward( "pm_runspeedforward", "256", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_RANKLOCKED, "speed the player can move forwards while running" ); idCVar pm_runspeedback( "pm_runspeedback", "160", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_RANKLOCKED, "speed the player can move backwards while running" ); idCVar pm_runspeedstrafe( "pm_runspeedstrafe", "212", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_RANKLOCKED, "speed the player can move sideways while running" ); idCVar pm_sprintspeedforward( "pm_sprintspeedforward", "352", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_RANKLOCKED, "speed the player can move forwards while sprinting" ); idCVar pm_sprintspeedstrafe( "pm_sprintspeedstrafe", "176", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_RANKLOCKED, "speed the player can move sideways while sprinting" ); idCVar pm_noclipspeed( "pm_noclipspeed", "480", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "speed the player can move while in noclip" ); idCVar pm_noclipspeedsprint( "pm_noclipspeedsprint", "960", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "speed the player can move while in noclip and sprinting" ); idCVar pm_noclipspeedwalk( "pm_noclipspeedwalk", "256", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "speed the player can move while in noclip and walking" ); idCVar pm_democamspeed( "pm_democamspeed", "200", CVAR_GAME | CVAR_FLOAT | CVAR_NOCHEAT, "speed the player can move while flying around in a demo" ); idCVar pm_spectatespeed( "pm_spectatespeed", "450", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "speed the player can move while spectating" ); idCVar pm_spectatespeedsprint( "pm_spectatespeedsprint", "1024", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "speed the player can move while spectating and sprinting" ); idCVar pm_spectatespeedwalk( "pm_spectatespeedwalk", "256", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT, "speed the player can move while spectating and walking" ); idCVar pm_spectatebbox( "pm_spectatebbox", "16", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_RANKLOCKED, "size of the spectator bounding box" ); idCVar pm_minviewpitch( "pm_minviewpitch", "-89", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_RANKLOCKED, "amount player's view can look up (negative values are up)" ); idCVar pm_maxviewpitch( "pm_maxviewpitch", "88", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_RANKLOCKED, "amount player's view can look down" ); idCVar pm_minproneviewpitch( "pm_minproneviewpitch", "-45", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_RANKLOCKED, "amount player's view can look up when prone(negative values are up)" ); idCVar pm_maxproneviewpitch( "pm_maxproneviewpitch", "89", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_RANKLOCKED, "amount player's view can look down when prone" ); idCVar pm_proneheight( "pm_proneheight", "20", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_RANKLOCKED, "height of player's bounding box while prone" ); idCVar pm_proneviewheight( "pm_proneviewheight", "16", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_RANKLOCKED, "height of player's view while prone" ); idCVar pm_proneviewdistance( "pm_proneviewdistance", "10", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_RANKLOCKED, "distance in front of the player's view while prone" ); idCVar pm_crouchheight( "pm_crouchheight", "56", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_RANKLOCKED, "height of player's bounding box while crouched" ); idCVar pm_crouchviewheight( "pm_crouchviewheight", "48", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_RANKLOCKED, "height of player's view while crouched" ); idCVar pm_normalheight( "pm_normalheight", "79", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_RANKLOCKED, "height of player's bounding box while standing" ); idCVar pm_normalviewheight( "pm_normalviewheight", "72", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_RANKLOCKED, "height of player's view while standing" ); idCVar pm_deadheight( "pm_deadheight", "20", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_RANKLOCKED, "height of player's bounding box while dead" ); idCVar pm_deadviewheight( "pm_deadviewheight", "10", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_RANKLOCKED, "height of player's view while dead" ); idCVar pm_crouchrate( "pm_crouchrate", "180", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_RANKLOCKED, "time it takes for player's view to change from standing to crouching" ); idCVar pm_bboxwidth( "pm_bboxwidth", "32", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_FLOAT | CVAR_RANKLOCKED, "x/y size of player's bounding box" ); idCVar pm_crouchbob( "pm_crouchbob", "0.23", CVAR_GAME | CVAR_FLOAT | CVAR_ARCHIVE | CVAR_PROFILE, "bob much faster when crouched" ); idCVar pm_walkbob( "pm_walkbob", "0.3", CVAR_GAME | CVAR_FLOAT | CVAR_ARCHIVE | CVAR_PROFILE, "bob slowly when walking" ); idCVar pm_runbob( "pm_runbob", "0.4", CVAR_GAME | CVAR_FLOAT | CVAR_ARCHIVE | CVAR_PROFILE, "bob faster when running" ); idCVar pm_runpitch( "pm_runpitch", "0.002", CVAR_GAME | CVAR_FLOAT | CVAR_ARCHIVE | CVAR_PROFILE, "" ); idCVar pm_runroll( "pm_runroll", "0.005", CVAR_GAME | CVAR_FLOAT | CVAR_ARCHIVE | CVAR_PROFILE, "" ); idCVar pm_bobup( "pm_bobup", "0.005", CVAR_GAME | CVAR_FLOAT | CVAR_ARCHIVE | CVAR_PROFILE, "" ); idCVar pm_bobpitch( "pm_bobpitch", "0.002", CVAR_GAME | CVAR_FLOAT | CVAR_ARCHIVE | CVAR_PROFILE, "" ); idCVar pm_bobroll( "pm_bobroll", "0.002", CVAR_GAME | CVAR_FLOAT | CVAR_ARCHIVE | CVAR_PROFILE, "" ); idCVar pm_skipBob( "pm_skipBob", "0", CVAR_GAME | CVAR_BOOL | CVAR_ARCHIVE | CVAR_PROFILE, "Disable all bobbing" ); idCVar pm_thirdPersonRange( "pm_thirdPersonRange", "80", CVAR_GAME | CVAR_FLOAT, "camera distance from player in 3rd person" ); idCVar pm_thirdPersonHeight( "pm_thirdPersonHeight", "0", CVAR_GAME | CVAR_FLOAT, "height of camera from normal view height in 3rd person" ); idCVar pm_thirdPersonAngle( "pm_thirdPersonAngle", "0", CVAR_GAME | CVAR_FLOAT, "direction of camera from player in 3rd person in degrees (0 = behind player, 180 = in front)" ); idCVar pm_thirdPersonOrbit( "pm_thirdPersonOrbit", "0", CVAR_GAME | CVAR_FLOAT, "if set, will automatically increment pm_thirdPersonAngle every frame" ); idCVar pm_thirdPersonNoPitch( "pm_thirdPersonNoPitch", "0", CVAR_GAME | CVAR_BOOL, "ignore camera pitch when in third person mode" ); idCVar pm_thirdPersonClip( "pm_thirdPersonClip", "1", CVAR_GAME | CVAR_BOOL, "clip third person view into world space" ); idCVar pm_thirdPerson( "pm_thirdPerson", "0", CVAR_GAME | CVAR_BOOL, "enables third person view" ); idCVar pm_pausePhysics( "pm_pausePhysics", "0", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_BOOL | CVAR_RANKLOCKED, "pauses physics" ); idCVar pm_deployThirdPersonRange( "pm_deployThirdPersonRange","200", CVAR_GAME | CVAR_FLOAT, "camera distance from player in 3rd person" ); idCVar pm_deployThirdPersonHeight( "pm_deployThirdPersonHeight","100", CVAR_GAME | CVAR_FLOAT, "height of camera from normal view height in 3rd person" ); idCVar pm_deployThirdPersonAngle( "pm_deployThirdPersonAngle","0", CVAR_GAME | CVAR_FLOAT, "direction of camera from player in 3rd person in degrees (0 = behind player, 180 = in front)" ); idCVar pm_deathThirdPersonRange( "pm_deathThirdPersonRange", "100", CVAR_GAME | CVAR_FLOAT, "camera distance from player in 3rd person" ); idCVar pm_deathThirdPersonHeight( "pm_deathThirdPersonHeight","20", CVAR_GAME | CVAR_FLOAT, "height of camera from normal view height in 3rd person" ); idCVar pm_deathThirdPersonAngle( "pm_deathThirdPersonAngle", "0", CVAR_GAME | CVAR_FLOAT, "direction of camera from player in 3rd person in degrees (0 = behind player, 180 = in front)" ); idCVar pm_slidevelocity( "pm_slidevelocity", "1", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC | CVAR_RANKLOCKED, "what to do with velocity when hitting a surface at an angle. 0: use horizontal speed, 1: keep some of the impact speed to push along the slide" ); idCVar pm_powerslide( "pm_powerslide", "0.09", CVAR_GAME | CVAR_FLOAT | CVAR_NETWORKSYNC, "adjust the push when pm_slidevelocity == 1, set power < 1 -> more speed, > 1 -> closer to pm_slidevelocity 0", 0, 4 ); idCVar g_showPlayerArrows( "g_showPlayerArrows", "2", CVAR_GAME | CVAR_INTEGER | CVAR_NETWORKSYNC, "enable/disable arrows above the heads of players (0=off,1=all,2=friendly only)" ); idCVar g_showPlayerClassIcon( "g_showPlayerClassIcon", "0", CVAR_GAME | CVAR_BOOL | CVAR_ARCHIVE, "Force drawing of player class icon above players in the fireteam." ); idCVar g_showPlayerShadow( "g_showPlayerShadow", "1", CVAR_GAME | CVAR_PROFILE | CVAR_ARCHIVE | CVAR_BOOL, "enables shadow of player model" ); idCVar g_showHud( "g_showHud", "1", CVAR_GAME | CVAR_BOOL | CVAR_NOCHEAT, "draw the hud gui" ); idCVar g_advancedHud( "g_advancedHud", "0", CVAR_GAME | CVAR_BOOL | CVAR_ARCHIVE | CVAR_PROFILE, "Draw advanced HUD" ); idCVar g_skipPostProcess( "g_skipPostProcess", "0", CVAR_GAME | CVAR_BOOL, "draw the post process gui" ); idCVar g_gun_x( "g_gunX", "0", CVAR_GAME | CVAR_FLOAT, "" ); idCVar g_gun_y( "g_gunY", "0", CVAR_GAME | CVAR_FLOAT, "" ); idCVar g_gun_z( "g_gunZ", "0", CVAR_GAME | CVAR_FLOAT, "" ); idCVar g_fov( "g_fov", "90", CVAR_GAME | CVAR_INTEGER | CVAR_NOCHEAT, "", 1.0f, 179.0f ); idCVar g_skipViewEffects( "g_skipViewEffects", "0", CVAR_GAME | CVAR_BOOL, "skip damage and other view effects" ); idCVar g_forceClear( "g_forceClear", "1", CVAR_GAME | CVAR_BOOL, "forces clearing of color buffer on main game draw (faster)" ); idCVar g_testParticle( "g_testParticle", "0", CVAR_GAME | CVAR_INTEGER, "test particle visualization, set by the particle editor" ); idCVar g_testParticleName( "g_testParticleName", "", CVAR_GAME, "name of the particle being tested by the particle editor" ); idCVar g_testModelRotate( "g_testModelRotate", "0", CVAR_GAME, "test model rotation speed" ); idCVar g_testPostProcess( "g_testPostProcess", "", CVAR_GAME, "name of material to draw over screen" ); idCVar g_testViewSkin( "g_testViewSkin", "", CVAR_GAME, "name of skin to use for the view" ); idCVar g_testModelAnimate( "g_testModelAnimate", "0", CVAR_GAME | CVAR_INTEGER, "test model animation,\n" "0 = cycle anim with origin reset\n" "1 = cycle anim with fixed origin\n" "2 = cycle anim with continuous origin\n" "3 = frame by frame with continuous origin\n" "4 = play anim once", 0, 4, idCmdSystem::ArgCompletion_Integer<0,4> ); idCVar g_disableGlobalAudio( "g_disableGlobalAudio", "0", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_BOOL, "disable global VOIP communication" ); idCVar g_maxPlayerWarnings( "g_maxPlayerWarnings", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_INTEGER | CVAR_RANKLOCKED, "maximum warnings before player is kicked" ); idCVar g_testModelBlend( "g_testModelBlend", "0", CVAR_GAME | CVAR_INTEGER, "number of frames to blend" ); idCVar g_exportMask( "g_exportMask", "", CVAR_GAME, "" ); idCVar password( "password", "", CVAR_GAME | CVAR_PROFILE | CVAR_ARCHIVE | CVAR_RANKLOCKED, "client password used when connecting" ); idCVar net_useAOR( "net_useAOR", "1", CVAR_GAME | CVAR_BOOL, "Enable/Disable Area of Relevance" ); idCVar net_aorPVSScale( "net_aorPVSScale", "4", CVAR_GAME | CVAR_FLOAT, "AoR scale for outside of PVS" ); idCVar pm_vehicleSoundLerpScale( "pm_vehicleSoundLerpScale", "10", CVAR_GAME | CVAR_PROFILE | CVAR_ARCHIVE | CVAR_FLOAT, "" ); idCVar pm_waterSpeed( "pm_waterSpeed", "400", CVAR_GAME | CVAR_FLOAT | CVAR_RANKLOCKED, "speed player will be pushed up in water when totally under water" ); idCVar pm_realisticMovement( "pm_realisticMovement", "2", CVAR_GAME | CVAR_NETWORKSYNC | CVAR_INTEGER, "Which player movement physics to use: 0=Quake-style, 1=Realistic-style 2=Realistic for players, Quake-style for bots" ); idCVar g_ignorePersistentRanks( "g_ignorePersistentRanks", "0", CVAR_GAME | CVAR_BOOL | CVAR_INIT, "Whether or not persistent ranks are ignored for use in game purposes. 0=Use persistent ranks, 1=Ignore persistent ranks" ); idCVar g_debugNetworkWrite( "g_debugNetworkWrite", "0", CVAR_GAME | CVAR_BOOL, "" ); idCVar g_debugProficiency( "g_debugProficiency", "0", CVAR_GAME | CVAR_BOOL, "" ); idCVar g_weaponSwitchTimeout( "g_weaponSwitchTimeout", "1.5", CVAR_GAME | CVAR_PROFILE | CVAR_ARCHIVE | CVAR_FLOAT, "" ); idCVar g_hitBeep( "g_hitBeep", "1", CVAR_GAME | CVAR_PROFILE | CVAR_ARCHIVE | CVAR_INTEGER, "play hit beep sound when you inflict damage.\n 0 = do nothing\n 1 = beep/flash cross-hair\n 2 = beep\n 3 = flash cross-hair" ); idCVar g_allowHitBeep( "g_allowHitBeep", "0", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Allow or disallow players' use of hitbeep damage feedbck." ); idCVar fs_debug( "fs_debug", "0", CVAR_SYSTEM | CVAR_INTEGER, "", 0, 2, idCmdSystem::ArgCompletion_Integer<0,2> ); #if !defined( _XENON ) && !defined( MONOLITHIC ) idCVar r_aspectRatio( "r_aspectRatio", "0", CVAR_RENDERER | CVAR_INTEGER | CVAR_ARCHIVE, "aspect ratio. 0 is 4:3, 1 is 16:9, 2 is 16:10, 3 is 5:4. -1 uses r_customAspectRatioH and r_customAspectRatioV" ); idCVar r_customAspectRatioH( "r_customAspectRatioH", "16", CVAR_RENDERER | CVAR_FLOAT | CVAR_ARCHIVE, "horizontal custom aspect ratio" ); idCVar r_customAspectRatioV( "r_customAspectRatioV", "10", CVAR_RENDERER | CVAR_FLOAT | CVAR_ARCHIVE, "vertical custom aspect ratio" ); #endif idCVar anim_showMissingAnims( "anim_showMissingAnims", "0", CVAR_BOOL, "Show warnings for missing animations" ); const char *aas_types[] = { "aas_player", "aas_vehicle", NULL }; idCVar aas_test( "aas_test", "0", CVAR_GAME, "select which AAS to test", aas_types, idCmdSystem::ArgCompletion_String<aas_types> ); idCVar aas_showEdgeNums( "aas_showEdgeNums", "0", CVAR_GAME | CVAR_BOOL, "show edge nums" ); idCVar aas_showAreas( "aas_showAreas", "0", CVAR_GAME | CVAR_INTEGER, "show the areas in the selected aas", 0, 2, idCmdSystem::ArgCompletion_Integer<0,2> ); idCVar aas_showAreaNumber( "aas_showAreaNumber", "0", CVAR_GAME | CVAR_INTEGER, "show the specific area number set" ); idCVar aas_showPath( "aas_showPath", "0", CVAR_GAME, "show the path to the walk specified area" ); idCVar aas_showHopPath( "aas_showHopPath", "0", CVAR_GAME, "show hop path to specified area" ); idCVar aas_showWallEdges( "aas_showWallEdges", "0", CVAR_GAME | CVAR_INTEGER, "show the edges of walls, 2 = project all to same height, 3 = project onscreen", 0, 3, idCmdSystem::ArgCompletion_Integer<0,3> ); idCVar aas_showWallEdgeNums( "aas_showWallEdgeNums", "0", CVAR_GAME | CVAR_BOOL, "show the number of the edges of walls" ); idCVar aas_showNearestCoverArea( "aas_showNearestCoverArea", "0", CVAR_GAME | CVAR_INTEGER, "show the nearest area with cover from the selected area (aas_showHideArea 4 will show the nearest area in cover from area 4)" ); idCVar aas_showNearestInsideArea( "aas_showNearestInsideArea", "0", CVAR_GAME | CVAR_BOOL, "show the nearest area that is inside" ); idCVar aas_showTravelTime( "aas_showTravelTime", "0", CVAR_GAME | CVAR_INTEGER, "print the travel time to the specified goal area (only when aas_showAreas is set)" ); idCVar aas_showPushIntoArea( "aas_showPushIntoArea", "0", CVAR_GAME | CVAR_BOOL, "show an arrow going to the closest area" ); idCVar aas_showFloorTrace( "aas_showFloorTrace", "0", CVAR_GAME | CVAR_BOOL, "show floor trace" ); idCVar aas_showObstaclePVS( "aas_showObstaclePVS", "0", CVAR_GAME | CVAR_INTEGER, "show obstacle PVS for the given area" ); idCVar aas_showManualReachabilities("aas_showManualReachabilities", "0", CVAR_GAME | CVAR_BOOL, "show manually placed reachabilities" ); idCVar aas_showFuncObstacles( "aas_showFuncObstacles", "0", CVAR_GAME | CVAR_BOOL, "show the AAS func_obstacles on the map" ); idCVar aas_showBadAreas( "aas_showBadAreas", "0", CVAR_GAME | CVAR_INTEGER, "show bad AAS areas", 0, 3, idCmdSystem::ArgCompletion_Integer<0,3> ); idCVar aas_locationMemory( "aas_locationMemory", "0", CVAR_GAME, "used to remember a particular location, set to 'current' to store the current x,y,z location" ); idCVar aas_pullPlayer( "aas_pullPlayer", "0", CVAR_GAME, "pull the player to the specified area" ); idCVar aas_randomPullPlayer( "aas_randomPullPlayer", "0", CVAR_GAME | CVAR_INTEGER, "pull the player to a random area" ); idCVar bot_threading( "bot_threading", "1", CVAR_GAME | CVAR_BOOL | CVAR_NOCHEAT, "enable running the bot AI in a separate thread" ); idCVar bot_threadMinFrameDelay( "bot_threadMinFrameDelay", "1", CVAR_GAME | CVAR_INTEGER | CVAR_NOCHEAT, "minimum number of game frames the bot AI trails behind", 0, 4, idCmdSystem::ArgCompletion_Integer<0,4> ); idCVar bot_threadMaxFrameDelay( "bot_threadMaxFrameDelay", "4", CVAR_GAME | CVAR_INTEGER | CVAR_NOCHEAT, "maximum number of game frames the bot AI can trail behind", 0, 4, idCmdSystem::ArgCompletion_Integer<0,4> ); idCVar bot_pause( "bot_pause", "0", CVAR_GAME | CVAR_BOOL, "Pause the bot's thinking - useful for screenshots/debugging/etc" ); idCVar bot_drawClientNumbers( "bot_drawClientNumbers", "0", CVAR_GAME | CVAR_BOOL, "Draw every clients number above their head" ); idCVar bot_drawActions( "bot_drawActions", "0", CVAR_GAME | CVAR_BOOL, "Draw the bot's actions." ); idCVar bot_drawBadIcarusActions( "bot_drawBadIcarusActions", "0", CVAR_GAME | CVAR_BOOL, "Draw actions with an icarus flag, that aren't in a valid vehicle AAS area." ); idCVar bot_drawIcarusActions( "bot_drawIcarusActions", "0", CVAR_GAME | CVAR_BOOL, "Draw actions with an icarus flag, that appear valid to the AAS." ); idCVar bot_drawActionRoutesOnly( "bot_drawActionRoutesOnly", "-1", CVAR_GAME | CVAR_INTEGER, "Draw only the bot actions that have the defined route." ); idCVar bot_drawNodes( "bot_drawNodes", "0", CVAR_BOOL | CVAR_GAME, "draw vehicle path nodes" ); idCVar bot_drawNodeNumber( "bot_drawNodeNumber", "-1", CVAR_INTEGER | CVAR_GAME, "draw a specific vehicle path node" ); idCVar bot_drawDefuseHints( "bot_drawDefuseHints", "0", CVAR_BOOL | CVAR_GAME, "draw the bot's defuse hints." ); idCVar bot_drawActionNumber( "bot_drawActionNumber", "-1", CVAR_GAME | CVAR_INTEGER, "Draw a specific bot action only. -1 = disable" ); idCVar bot_drawActionVehicleType( "bot_drawActionVehicleType", "-1", CVAR_GAME | CVAR_INTEGER, "Draw only the actions that have this vehicleType set. -1 = disable" ); idCVar bot_drawActiveActionsOnly( "bot_drawActiveActionsOnly", "0", CVAR_GAME | CVAR_INTEGER, "Draw only active bot actions. 1 = all active actions. 2 = only GDF active actions. 3 = only Strogg active actions. Combo actions, that have both GDF and strogg goals, will still show up." ); idCVar bot_drawActionWithClasses( "bot_drawActionWithClasses", "0", CVAR_GAME | CVAR_BOOL, "Draw only actions that have a validClass set to anything other then 0 ( 0 = any class )." ); idCVar bot_drawActionTypeOnly( "bot_drawActionTypeOnly", "-1", CVAR_GAME | CVAR_INTEGER, "Draw only actions that have a gdf/strogg goal number matching the cvar value. Check the bot manual for goal numbers. -1 = disabled." ); idCVar bot_drawRoutes( "bot_drawRoutes", "0", CVAR_GAME | CVAR_BOOL, "Draw the routes on the map." ); idCVar bot_drawActiveRoutesOnly( "bot_drawActiveRoutesOnly", "0", CVAR_GAME | CVAR_BOOL, "Only draw the active routes on the map." ); idCVar bot_drawRouteGroupOnly( "bot_drawRouteGroupOnly", "-1", CVAR_GAME | CVAR_INTEGER, "Only draw routes that have the groupID specified." ); idCVar bot_drawActionSize( "bot_drawActionSize", "0.2", CVAR_GAME | CVAR_FLOAT, "How big to draw the bot action info. Default is 0.2" ); idCVar bot_drawActionGroupNum( "bot_drawActionGroupNum", "-1", CVAR_GAME | CVAR_INTEGER, "Filter what action groups to draw with the bot_drawAction cmd. -1 = disabled." ); idCVar bot_drawActionDist( "bot_drawActionDist", "4092", CVAR_GAME | CVAR_FLOAT, "How far away to draw the bot action info. Default is 2048" ); idCVar bot_drawObstacles( "bot_drawObstacles", "0", CVAR_GAME | CVAR_BOOL, "Draw the bot's dynamic obstacles in the world" ); idCVar bot_drawRearSpawnLocations( "bot_drawRearSpawnLocations", "0", CVAR_GAME | CVAR_BOOL, "Draw the rear spawn locations for each team" ); idCVar bot_enable( "bot_enable", "1", CVAR_GAME | CVAR_BOOL | CVAR_SERVERINFO, "0 = bots will not be loaded in the game. 1 = bots are loaded." ); idCVar bot_doObjectives( "bot_doObjectives", "1", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC | CVAR_NOCHEAT, "0 = bots let the player play the hero, with the bots filling a supporting role, 1 = bots do all the major objectives along with the player" ); idCVar bot_ignoreGoals( "bot_ignoreGoals", "0", CVAR_GAME | CVAR_INTEGER | CVAR_CHEAT, "If set to 1, bots will ignore all map objectives. Useful for debugging bot behavior" ); idCVar bot_useVehicles( "bot_useVehicles", "1", CVAR_GAME | CVAR_BOOL | CVAR_NOCHEAT, "0 = bots dont use vehicles, 1 = bots do use vehicles" ); idCVar bot_useVehicleDrops( "bot_useVehicleDrops", "1", CVAR_GAME | CVAR_BOOL | CVAR_NOCHEAT, "0 = bots don't use vehicle drops, 1 = bots do use vehicle drops" ); idCVar bot_stayInVehicles( "bot_stayInVehicles", "0", CVAR_GAME | CVAR_BOOL, "1 = bots will never leave their vehicle. Only useful for debugging. Default is 0" ); idCVar bot_useStrafeJump( "bot_useStrafeJump", "0", CVAR_GAME | CVAR_BOOL | CVAR_NOCHEAT, "0 = bots can't strafe jump, 1 = bots CAN strafe jump to goal locations that are far away" ); idCVar bot_useSuicideWhenStuck( "bot_useSuicideWhenStuck", "1", CVAR_GAME | CVAR_BOOL, "0 = bots never suicide when stuck. 1 = bots suicide if they detect that they're stuck" ); idCVar bot_useDeployables( "bot_useDeployables", "1", CVAR_GAME | CVAR_BOOL | CVAR_NOCHEAT, "0 = bots dont drop deployables of any kind, 1 = bots can drop all deployables" ); idCVar bot_useMines( "bot_useMines", "1", CVAR_GAME | CVAR_BOOL | CVAR_NOCHEAT, "0 = bots dont use mines, 1 = bots can use mines. Default = 1" ); idCVar bot_sillyWarmup( "bot_sillyWarmup", "0", CVAR_GAME | CVAR_BOOL | CVAR_NOCHEAT, "0 = bots play the game like normal, 1 = bots shoot each other and act silly during warmup" ); idCVar bot_useSpawnHosts( "bot_useSpawnHosts", "1", CVAR_GAME | CVAR_BOOL | CVAR_NOCHEAT, "0 = strogg bots can't use spawn host bodies, 1 = bots can use spawnhosts" ); idCVar bot_useUniforms( "bot_useUniforms", "1", CVAR_GAME | CVAR_BOOL | CVAR_NOCHEAT, "0 = bots won't steal uniforms, 1 = bots take uniforms" ); idCVar bot_noChat( "bot_noChat", "0", CVAR_GAME | CVAR_BOOL | CVAR_NOCHEAT, "0 = bots chat, 1 = bots never chat" ); idCVar bot_noTaunt( "bot_noTaunt", "1", CVAR_GAME | CVAR_BOOL | CVAR_NOCHEAT, "0 = bots taunt, 1 = bots never taunt" ); idCVar bot_aimSkill( "bot_aimSkill", "1", CVAR_GAME | CVAR_INTEGER | CVAR_NETWORKSYNC | CVAR_NOCHEAT, "Sets the bot's default aiming skill. 0 = EASY, 1 = MEDIUM, 2 = EXPERT, 3 = MASTER", 0, 3, idCmdSystem::ArgCompletion_Integer<0,3> ); idCVar bot_skill( "bot_skill", "3", CVAR_GAME | CVAR_INTEGER | CVAR_NETWORKSYNC | CVAR_NOCHEAT, "Sets the bot's default AI skill. 0 = EASY, 1 = NORMAL, 2 = EXPERT, 3 = TRAINING MODE - this mode is useful for learning about the game", 0, 3, idCmdSystem::ArgCompletion_Integer<0,3> ); idCVar bot_knifeOnly( "bot_knifeOnly", "0", CVAR_GAME | CVAR_BOOL, "goofy mode where the bots only use their knifes in combat." ); idCVar bot_ignoreEnemies( "bot_ignoreEnemies", "0", CVAR_GAME | CVAR_INTEGER, "If set to 1, bots will ignore all enemies. 2 = Ignore Strogg. 3 = Ignore GDF. Useful for debugging bot behavior" ); idCVar bot_debug( "bot_debug", "0", CVAR_GAME | CVAR_BOOL, "Debug various bot subsystems. Many bot debugging features are disabled if this is not set to 1" ); idCVar bot_debugActionGoalNumber( "bot_debugActionGoalNumber", "-1", CVAR_GAME | CVAR_INTEGER, "Set to any action number on the map to have the bot ALWAYS do that action, for debugging. -1 = disabled. NOTE: The bot will treat the goal as a camp goal. This is useful for path testing." ); idCVar bot_debugSpeed( "bot_debugSpeed", "-1", CVAR_GAME | CVAR_INTEGER, "Debug bot's move speed. -1 = disable" ); idCVar bot_debugGroundVehicles( "bot_debugGroundVehicles", "-1", CVAR_GAME | CVAR_INTEGER, "Debug bot ground vehicle usage. -1 = disable" ); idCVar bot_debugAirVehicles( "bot_debugAirVehicles", "-1", CVAR_GAME | CVAR_INTEGER, "Debug bot air vehicle usage. -1 = disable" ); idCVar bot_debugObstacles( "bot_debugObstacles", "0", CVAR_GAME | CVAR_BOOL, "Debug bot obstacles in the world" ); idCVar bot_spectateDebug( "bot_spectateDebug", "0", CVAR_GAME | CVAR_BOOL, "If enabled, automatically sets the debug hud to the bot being spectated" ); idCVar bot_followMe( "bot_followMe", "0", CVAR_GAME | CVAR_INTEGER, "Have the bots follow you in debug mode" ); idCVar bot_breakPoint( "bot_breakPoint", "0", CVAR_GAME | CVAR_BOOL, "Cause a program break to occur inside the bot's AI" ); idCVar bot_useShotguns( "bot_useShotguns", "0", CVAR_GAME | CVAR_BOOL | CVAR_NOCHEAT, "0 = bots wont use shotguns/nailguns. 1 = bots will use shotguns/nailguns." ); idCVar bot_useSniperWeapons( "bot_useSniperWeapons", "1", CVAR_GAME | CVAR_BOOL | CVAR_NOCHEAT, "0 = bots wont use sniper rifles. 1 = bots will use sniper rifles." ); idCVar bot_minClients( "bot_minClients", "-1", CVAR_GAME | CVAR_INTEGER | CVAR_NETWORKSYNC | CVAR_NOCHEAT, "Keep a minimum number of clients on the server with bots and humans. -1 to disable", -1, MAX_CLIENTS ); idCVar bot_minClientsMax( "bot_minClientsMax", "16", CVAR_GAME | CVAR_INTEGER | CVAR_NETWORKSYNC | CVAR_INIT, "Maximum allowed value of bot_minClients. Only affects the in-game UI.", -1, MAX_CLIENTS ); idCVar bot_debugPersonalVehicles( "bot_debugPersonalVehicles", "0", CVAR_GAME | CVAR_BOOL, "Only used for debugging the use of the husky/icarus." ); idCVar bot_debugWeapons( "bot_debugWeapons", "0", CVAR_GAME | CVAR_BOOL, "Only used for debugging bots weapons." ); idCVar bot_uiNumStrogg( "bot_uiNumStrogg", "-1", CVAR_GAME | CVAR_INTEGER | CVAR_NETWORKSYNC | CVAR_NOCHEAT, "The number of strogg bots to add to the server. -1 to disable" ); idCVar bot_uiNumGDF( "bot_uiNumGDF", "-1", CVAR_GAME | CVAR_INTEGER | CVAR_NETWORKSYNC | CVAR_NOCHEAT, "The number of gdf bots to add to the server. -1 to disable" ); idCVar bot_uiSkill( "bot_uiSkill", "5", CVAR_GAME | CVAR_INTEGER | CVAR_NETWORKSYNC | CVAR_NOCHEAT, "The overall skill the bots should play at in the game. 0 = EASY, 1 = MEDIUM, 2 = EXPERT, 3 = MASTER, 4 = CUSTOM, 5 = TRAINING" ); idCVar bot_showPath( "bot_showPath", "-1", CVAR_GAME | CVAR_INTEGER, "Show the path for the bot's client number. -1 = disable." ); idCVar bot_skipThinkClient( "bot_skipThinkClient", "-1", CVAR_GAME | CVAR_INTEGER, "A debug only cvar that skips thinking for a particular bot with the client number entered. -1 = disabled." ); idCVar bot_debugMapScript( "bot_debugMapScript", "0", CVAR_GAME | CVAR_BOOL, "Allows you to debug the bot script." ); idCVar bot_useTKRevive( "bot_useTKRevive", "1", CVAR_GAME | CVAR_BOOL, "Allows the bots to use the advanced tactic of TK reviving if their teammate is weak. 0 = disabled. Default is 1" ); idCVar bot_debugObstacleAvoidance( "bot_debugObstacleAvoidance", "0", CVAR_GAME | CVAR_BOOL, "Debug obstacle avoidance" ); idCVar bot_testObstacleQuery( "bot_testObstacleQuery", "", CVAR_GAME, "test a previously recorded obstacle avoidance query" ); idCVar bot_balanceCriticalClass( "bot_balanceCriticalClass", "1", CVAR_GAME | CVAR_BOOL, "Have the bots try to keep someone playing the critical class at all times. 0 = keep the class they spawn in as. Default = 1." ); idCVar bot_useAltRoutes( "bot_useAltRoutes", "1", CVAR_GAME | CVAR_BOOL, "Debug the bot's alternate path use." ); idCVar bot_godMode( "bot_godMode", "-1", CVAR_GAME | CVAR_INTEGER, "Set to the bot client you want to enter god mode. -1 = disable." ); idCVar bot_useRearSpawn( "bot_useRearSpawn", "1", CVAR_BOOL | CVAR_GAME, "debug bots using rear spawn points" ); idCVar bot_sleepWhenServerEmpty( "bot_sleepWhenServerEmpty", "1", CVAR_BOOL | CVAR_GAME | CVAR_NOCHEAT, "has the bots stop thinking when the server is idle and there are no humans playing, to conserve CPU." ); idCVar bot_allowObstacleDecay( "bot_allowObstacleDecay", "1", CVAR_BOOL | CVAR_GAME, "0 = dont allow obstacle decay. 1 = allow obstacle decay." ); idCVar bot_allowClassChanges( "bot_allowClassChanges", "1", CVAR_GAME | CVAR_BOOL | CVAR_NOCHEAT, "0 = bots won't ever change their class. 1 = Bots can change their class thru script/code." ); idCVar bot_testPathToBotAction( "bot_testPathToBotAction", "-1", CVAR_GAME | CVAR_INTEGER, "based on which aas type aas_test is set to, will test to see if a path is available from the players current origin, to the bot action in question. You need to join a team for this to work properly! -1 = disabled." ); idCVar bot_pauseInVehicleTime( "bot_pauseInVehicleTime", "7", CVAR_GAME | CVAR_INTEGER, "Time the bots will pause when first enter a vehicle ( in seconds ) to allow others to jump in. Default is 7 seconds." ); idCVar bot_doObjsInTrainingMode( "bot_doObjsInTrainingMode", "1", CVAR_GAME | CVAR_BOOL, "Controls whether or not bots will do objectives in training mode, if the human isn't the correct class to do the objective. 0 = bots won't do primary or secondary objecitives in training mode. 1 = bots will do objectives. Default = 1. " ); idCVar bot_doObjsDelayTimeInMins( "bot_doObjsDelayTimeInMins", "3", CVAR_GAME | CVAR_INTEGER, "How long of a delay in time the bots will have before they start considering objectives while in Training mode. Default is 3 minutes. " ); idCVar bot_useAirVehicles( "bot_useAirVehicles", "1", CVAR_GAME | CVAR_BOOL | CVAR_NOCHEAT, "0 = bots dont use air vehicles, 1 = bots do use air vehicles. Useful for debugging ground vehicles only." ); idCVar g_showCrosshairInfo( "g_showCrosshairInfo", "1", CVAR_INTEGER | CVAR_GAME, "shows information about the entity under your crosshair" ); idCVar g_banner_1( "g_banner_1", "", CVAR_GAME | CVAR_NOCHEAT, "banner message 1" ); idCVar g_banner_2( "g_banner_2", "", CVAR_GAME | CVAR_NOCHEAT, "banner message 2" ); idCVar g_banner_3( "g_banner_3", "", CVAR_GAME | CVAR_NOCHEAT, "banner message 3" ); idCVar g_banner_4( "g_banner_4", "", CVAR_GAME | CVAR_NOCHEAT, "banner message 4" ); idCVar g_banner_5( "g_banner_5", "", CVAR_GAME | CVAR_NOCHEAT, "banner message 5" ); idCVar g_banner_6( "g_banner_6", "", CVAR_GAME | CVAR_NOCHEAT, "banner message 6" ); idCVar g_banner_7( "g_banner_7", "", CVAR_GAME | CVAR_NOCHEAT, "banner message 7" ); idCVar g_banner_8( "g_banner_8", "", CVAR_GAME | CVAR_NOCHEAT, "banner message 8" ); idCVar g_banner_9( "g_banner_9", "", CVAR_GAME | CVAR_NOCHEAT, "banner message 9" ); idCVar g_banner_10( "g_banner_10", "", CVAR_GAME | CVAR_NOCHEAT, "banner message 10" ); idCVar g_banner_11( "g_banner_11", "", CVAR_GAME | CVAR_NOCHEAT, "banner message 11" ); idCVar g_banner_12( "g_banner_12", "", CVAR_GAME | CVAR_NOCHEAT, "banner message 12" ); idCVar g_banner_13( "g_banner_13", "", CVAR_GAME | CVAR_NOCHEAT, "banner message 13" ); idCVar g_banner_14( "g_banner_14", "", CVAR_GAME | CVAR_NOCHEAT, "banner message 14" ); idCVar g_banner_15( "g_banner_15", "", CVAR_GAME | CVAR_NOCHEAT, "banner message 15" ); idCVar g_banner_16( "g_banner_16", "", CVAR_GAME | CVAR_NOCHEAT, "banner message 16" ); idCVar g_bannerDelay( "g_banner_delay", "1", CVAR_GAME | CVAR_NOCHEAT | CVAR_INTEGER, "delay in seconds between banner messages" ); idCVar g_bannerLoopDelay( "g_banner_loopdelay", "0", CVAR_GAME | CVAR_NOCHEAT | CVAR_INTEGER, "delay in seconds before banner messages repeat, 0 = off" ); idCVar* g_bannerCvars[ NUM_BANNER_MESSAGES ] = { &g_banner_1, &g_banner_2, &g_banner_3, &g_banner_4, &g_banner_5, &g_banner_6, &g_banner_7, &g_banner_8, &g_banner_9, &g_banner_10, &g_banner_11, &g_banner_12, &g_banner_13, &g_banner_14, &g_banner_15, &g_banner_16, }; idCVar g_allowComplaintFiresupport( "g_allowComplaint_firesupport", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "Allow complaints for teamkills with fire support" ); idCVar g_allowComplaintCharge( "g_allowComplaint_charge", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "Allow complaints for teamkills with charges" ); idCVar g_allowComplaintExplosives( "g_allowComplaint_explosives", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "Allow complaints for teamkills with explosive weapons and items" ); idCVar g_allowComplaintVehicles( "g_allowComplaint_vehicles", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "Allow complaints for teamkills with vehicle" ); idCVar g_complaintLimit( "g_complaintLimit", "6", CVAR_GAME | CVAR_ARCHIVE | CVAR_INTEGER | CVAR_RANKLOCKED, "Total complaints at which a player will be kicked" ); idCVar g_complaintGUIDLimit( "g_complaintGUIDLimit", "4", CVAR_GAME | CVAR_ARCHIVE | CVAR_INTEGER | CVAR_RANKLOCKED, "Total unique complaints at which a player will be kicked" ); idCVar g_execMapConfigs( "g_execMapConfigs", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "Execute map cfg with same name" ); idCVar g_teamSwitchDelay( "g_teamSwitchDelay", "5", CVAR_GAME | CVAR_ARCHIVE | CVAR_INTEGER | CVAR_RANKLOCKED, "Delay (in seconds) before player can change teams again" ); idCVar g_warmupDamage( "g_warmupDamage", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "Enable/disable players taking damage during warmup" ); idCVar g_muteSpecs( "g_muteSpecs", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL | CVAR_RANKLOCKED, "Send all spectator global chat to team chat" ); idCVar g_warmup( "g_warmup", "0.5", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT | CVAR_RANKLOCKED, "Length (in minutes) of warmup period" ); idCVar g_gameReviewPause( "g_gameReviewPause", "0.5", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT | CVAR_RANKLOCKED, "Time (in minutes) for scores review time" ); idCVar g_password( "g_password", "", CVAR_GAME | CVAR_ARCHIVE | CVAR_RANKLOCKED, "game password" ); idCVar g_privatePassword( "g_privatePassword", "", CVAR_GAME | CVAR_ARCHIVE, "game password for private slots" ); idCVar g_xpSave( "g_xpSave", "1", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL | CVAR_RANKLOCKED, "stores xp for disconnected players which will be given back if they reconnect" ); idCVar g_kickBanLength( "g_kickBanLength", "2", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT | CVAR_RANKLOCKED, "length of time a kicked player will be banned for" ); idCVar g_maxSpectateTime( "g_maxSpectateTime", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT | CVAR_RANKLOCKED, "maximum length of time a player may spectate for" ); idCVar g_unlock_updateAngles( "g_unlock_updateAngles", "1", CVAR_GAME | CVAR_PROFILE | CVAR_ARCHIVE | CVAR_BOOL, "update view angles in fps unlock mode" ); idCVar g_unlock_updateViewpos( "g_unlock_updateViewpos", "1", CVAR_GAME | CVAR_PROFILE | CVAR_ARCHIVE | CVAR_BOOL, "update view origin in fps unlock mode" ); idCVar g_unlock_interpolateMoving( "g_unlock_interpolateMoving", "1", CVAR_GAME | CVAR_PROFILE | CVAR_ARCHIVE | CVAR_BOOL, "interpolate moving objects in fps unlock mode" ); idCVar g_unlock_viewStyle( "g_unlock_viewStyle", "1", CVAR_GAME | CVAR_PROFILE | CVAR_ARCHIVE | CVAR_INTEGER, "0: extrapolate view origin, 1: interpolate view origin" ); idCVar g_voteWait( "g_voteWait", "2.5", CVAR_GAME | CVAR_ARCHIVE | CVAR_FLOAT | CVAR_RANKLOCKED, "Delay (in minutes) before player may perform a callvote again" ); idCVar g_useTraceCollection( "g_useTraceCollection", "1", CVAR_GAME | CVAR_BOOL, "Use optimized trace collections" ); idCVar g_removeStaticEntities( "g_removeStaticEntities", "1", CVAR_GAME | CVAR_BOOL, "Remove non-dynamic entities on map spawn when they aren't needed" ); idCVar g_maxVoiceChats( "g_maxVoiceChats", "4", CVAR_GAME | CVAR_ARCHIVE | CVAR_INTEGER, "maximum number of voice chats a player may do in a period of time" ); idCVar g_maxVoiceChatsOver( "g_maxVoiceChatsOver", "30", CVAR_GAME | CVAR_ARCHIVE | CVAR_INTEGER, "time over which the maximum number of voice chat limit is applied" ); idCVar g_profileEntityThink( "g_profileEntityThink", "0", CVAR_GAME | CVAR_BOOL, "Enable entity think profiling" ); idCVar g_timeoutToSpec( "g_timeoutToSpec", "0", CVAR_GAME | CVAR_FLOAT | CVAR_NOCHEAT, "Timeout in minutes for players who are AFK to go into spectator mode (0=disabled)" ); idCVar g_autoReadyPercent( "g_autoReadyPercent", "50", CVAR_GAME | CVAR_FLOAT | CVAR_ARCHIVE, "Percentage of a full server that must be in game for auto ready to start" ); idCVar g_autoReadyWait( "g_autoReadyWait", "1", CVAR_GAME | CVAR_FLOAT | CVAR_ARCHIVE, "Length of time in minutes auto ready will wait before starting the countdown" ); idCVar g_useBotsInPlayerTotal( "g_useBotsInPlayerTotal", "1", CVAR_GAME | CVAR_BOOL | CVAR_ARCHIVE, "Should bots count towards the number of players required to start the game?" ); idCVar g_playTooltipSound( "g_playTooltipSound", "2", CVAR_GAME | CVAR_INTEGER | CVAR_ARCHIVE | CVAR_PROFILE, "0: no sound 1: play tooltip sound in single player only 2: Always play tooltip sound" ); idCVar g_tooltipTimeScale( "g_tooltipTimeScale", "1", CVAR_GAME | CVAR_FLOAT | CVAR_ARCHIVE | CVAR_PROFILE, "Scale the amount of time that a tooltip is visible. 0 will disable all tooltips." ); idCVar g_tooltipVolumeScale( "g_tooltipVolumeScale", "-20", CVAR_GAME | CVAR_FLOAT | CVAR_ARCHIVE | CVAR_PROFILE, "Change the game volume while playing a tooltip with VO." ); idCVar g_allowSpecPauseFreeFly( "g_allowSpecPauseFreeFly", "1", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Allow spectators to free fly when the game is paused" ); idCVar g_smartTeamBalance( "g_smartTeamBalance", "1", CVAR_GAME | CVAR_BOOL | CVAR_RANKLOCKED, "Encourages players to balance teams themselves by giving rewards." ); idCVar g_smartTeamBalanceReward( "g_smartTeamBalanceReward", "10", CVAR_GAME | CVAR_INTEGER | CVAR_RANKLOCKED, "The amount of XP to give people who switch teams when asked to." ); idCVar g_keepFireTeamList( "g_keepFireTeamList", "0", CVAR_GAME | CVAR_BOOL | CVAR_ARCHIVE | CVAR_PROFILE, "Always show the fireteam list on the HUD." ); idCVar net_serverDownload( "net_serverDownload", "0", CVAR_GAME | CVAR_INTEGER | CVAR_ARCHIVE, "enable server download redirects. 0: off 1: client exits and opens si_serverURL in web browser 2: client downloads pak files from an URL and connects again. See net_serverDl* cvars for configuration" ); idCVar net_serverDlBaseURL( "net_serverDlBaseURL", "", CVAR_GAME | CVAR_ARCHIVE, "base URL for the download redirection" ); idCVar net_serverDlTable( "net_serverDlTable", "", CVAR_GAME | CVAR_ARCHIVE, "pak names for which download is provided, seperated by ; - use a * to mark all paks" ); idCVar g_drawMineIcons( "g_drawMineIcons", "1", CVAR_GAME | CVAR_BOOL | CVAR_ARCHIVE | CVAR_PROFILE, "Draw icons on the HUD for mines." ); idCVar g_allowMineIcons( "g_allowMineIcons", "0", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC | CVAR_RANKLOCKED, "Allow clients to draw icons on the HUD for mines." ); idCVar g_mineIconSize( "g_mineIconSize", "10", CVAR_FLOAT | CVAR_GAME | CVAR_ARCHIVE | CVAR_PROFILE, "Size of the screen space mine icons. NOTE: Will only take effect for new mines, not those already existing.", 0, 20 ); idCVar g_mineIconAlphaScale( "g_mineIconAlphaScale", "1", CVAR_GAME | CVAR_FLOAT | CVAR_ARCHIVE | CVAR_PROFILE, "Alpha scale to apply to mine icons. NOTE: Will only take effect for new mines, not those already existing." ); idCVar g_drawVehicleIcons( "g_drawVehicleIcons", "1", CVAR_GAME | CVAR_BOOL | CVAR_ARCHIVE | CVAR_PROFILE, "Draw icons on the HUD for vehicles (eg spawn invulnerability)." ); #ifdef SD_SUPPORT_REPEATER idCVar ri_useViewerPass( "ri_useViewerPass", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_REPEATERINFO | CVAR_BOOL, "use g_viewerPassword for viewers/repeaters" ); idCVar g_viewerPassword( "g_viewerPassword", "", CVAR_GAME | CVAR_ARCHIVE, "password for viewers" ); idCVar g_repeaterPassword( "g_repeaterPassword", "", CVAR_GAME | CVAR_ARCHIVE, "password for repeaters" ); idCVar ri_privateViewers( "ri_privateViewers", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_REPEATERINFO | CVAR_INTEGER, "number of private viewer slots" ); idCVar g_privateViewerPassword( "g_privateViewerPassword", "", CVAR_GAME | CVAR_ARCHIVE, "privatePassword for private viewer slots" ); idCVar ri_name( "ri_name", "", CVAR_GAME | CVAR_ARCHIVE | CVAR_REPEATERINFO, "override the server's si_name with this for relays" ); idCVar g_noTVChat( "g_noTVChat", "0", CVAR_GAME | CVAR_ARCHIVE | CVAR_BOOL, "Server enable/disable flag for viewer chat on ETQW:TV" ); #endif // SD_SUPPORT_REPEATER idCVar g_drawHudMessages( "g_drawHudMessages", "1", CVAR_GAME | CVAR_INTEGER | CVAR_ARCHIVE | CVAR_PROFILE, "Draw task, task success and objective text on HUD." ); idCVar g_allowMineTriggerWarning( "g_allowMineTriggerWarning", "0", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC | CVAR_RANKLOCKED, "Allow clients to draw warning text on the HUD for mine triggering." ); idCVar g_mineTriggerWarning( "g_mineTriggerWarning", "1", CVAR_GAME | CVAR_BOOL | CVAR_ARCHIVE | CVAR_PROFILE, "Show warning message on HUD when triggering a proximity mine." ); idCVar g_allowAPTWarning( "g_allowAPTWarning", "0", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC | CVAR_RANKLOCKED, "Allow clients to draw warning text on the HUD for APT lock ons." ); idCVar g_aptWarning( "g_aptWarning", "3", CVAR_GAME | CVAR_INTEGER | CVAR_ARCHIVE | CVAR_PROFILE, "Show warning message on HUD when APT is locking on. 0: Off 1: Visual warning only 2: Beep only 3: Visual and beep" ); idCVar g_useBaseETQW12Shotguns( "g_useBaseETQW12Shotguns", "1", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Use BaseETQW v1.2 behaviour for shotgun and nailgun." ); idCVar g_useQuake4DarkMatter( "g_useQuake4DarkMatter", "1", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Use Quake 4-style Dark Matter weaponry." ); idCVar g_artilleryWarning( "g_artilleryWarning", "0", CVAR_GAME | CVAR_BOOL | CVAR_ARCHIVE, "Notify players of the launch of Hammer or DMC artillery." ); idCVar g_useDeathFading( "g_useDeathFading", "1", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Use screen fading effects when dead or unconscious?" ); idCVar g_useReverseAirstrikes( "g_useReverseAirstrikes", "1", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Use reversed airstrikes on the altfire of the Vampire and Violator?" ); idCVar g_useShieldAbsorber( "g_useShieldAbsorber", "1", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Use the shield absorber as the altfire of the Tactical Shield?" ); idCVar g_useNuclearHammer( "g_useNuclearHammer", "1", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Make the Hammer and SSM missiles behave more like tactical nukes?" ); idCVar g_useQuake4Hyperblaster( "g_useQuake4Hyperblaster", "1", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Use Quake 4-style Hyperblaster weaponry?" ); idCVar g_useQuake4Railgun( "g_useQuake4Railgun", "1", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Use Quake 4-style Railgun weaponry?" ); idCVar g_useClassLimits( "g_useClassLimits", "1", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Enables or disables class number limitations." ); idCVar g_useGibKills( "g_useGibKills", "1", CVAR_GAME | CVAR_BOOL | CVAR_ARCHIVE, "Enables or disables certain attacks that don't normally gib, to do so." ); idCVar g_useAwardJackOfAllTrades( "g_useAwardJackOfAllTrades", "1", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Enables or disables the new Jack of All Trades after-mission award." ); idCVar g_advancedVehicleDrops( "g_advancedVehicleDrops", "-1", CVAR_GAME | CVAR_INTEGER | CVAR_NETWORKSYNC, "Bitfield that specifies which vehicles may be dropped in via quickchat commands." ); idCVar g_useSpecificRadar( "g_useSpecificRadar", "1", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Should players(but not vehicles) be invisible to radar? (3rd eye and MCP exempt.)" ); idCVar g_vehicleDropsUseFE( "g_vehicleDropsUseFE", "1", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Should vehicle drops have Force Escalation requirements for their use?" ); idCVar g_vehicleDropsUseLP( "g_vehicleDropsUseLP", "1", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Should vehicle drops have Logistics Points requirements for their use?" ); idCVar g_huskyIcarusDropsIgnoreFE( "g_huskyIcarusDropsIgnoreFE", "0", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Should the Husky and Icarus ignore FE requirements? (Treat them as costing 0 FE.)" ); idCVar g_huskyIcarusDropsIgnoreLP( "g_huskyIcarusDropsIgnoreLP", "0", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Should the Husky and Icarus ignore LP requirements? (Treat them as costing 0 LP.)" ); idCVar g_useBaseETQWVehicleCredits("g_useBaseETQWVehicleCredits", "0", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Should the Icarus and Husky use BaseETQW vehicle credit costs?" ); idCVar g_useBaseETQWProficiencies( "g_useBaseETQWProficiencies", "0", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Should BaseETQW proficiencies be used? (QWTA gives free Vehicle Drops otherwise.)" ); idCVar g_useBaseETQWVehicleCharge( "g_useBaseETQWVehicleCharge", "0", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Should the BaseETQW vehicle credit charge timer duration be used?" ); idCVar g_vehicleSpawnsUseFE( "g_vehicleSpawnsUseFE", "1", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Do vehicle spawns have Force Escalation requirements?" ); idCVar g_disableVehicleRespawns( "g_disableVehicleRespawns", "0", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Are vehicles permitted to respawn after being destroyed?" ); idCVar g_disablePlayerRespawns( "g_disablePlayerRespawns", "0", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Are players permitted to respawn after being killed?" ); idCVar g_allowCrosshairs( "g_allowCrosshairs", "0", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Allow or disallow player's crosshairs." ); //idCVar g_allowTimerCircles( "g_allowTimerCircles", "0", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Allow or disallow the timer circles that normally surround the crosshairs." ); //idCVar g_useStraightRockets( "g_useStraightRockets", "1", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Use Rocket Launcher projectiles that fly straight, or keep the flight arc of the BaseETQW Rocket Launcher?" ); idCVar g_useBaseETQW12SniperTrail( "g_useBaseETQW12SniperTrail", "1", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Use the BaseETQW 1.2 sniper rifle's trail-tracer effect?" ); //idCVar g_hideHud( "g_hideHud", "1", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Disables most aspects of the HUD, revealing them only when they're accessed in some way." ); idCVar g_useRealisticWeapons( "g_useRealisticWeapons", "1", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Should weapons behave in a realistic manner, or more game-oriented?" ); idCVar g_useVehicleAmmo( "g_useVehicleAmmo", "1", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Should vehicle weapons consume ammunition or not?" ); idCVar g_useVehicleDecoyAmmo( "g_useVehicleDecoyAmmo", "1", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Should vehicle decoys consume ammunition or not?" ); idCVar g_allowEMPFriendlyFire( "g_allowEMPFriendlyFire", "1", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Allow or disallow EMP effects from affecting friendly units." ); idCVar g_allowRadFriendlyFire( "g_allowRadFriendlyFire", "1", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Allow or disallow radiation effects from affecting friendly units." ); idCVar g_forgivingBotMatch( "g_forgivingBotMatch", "0", CVAR_GAME | CVAR_BOOL | CVAR_NETWORKSYNC, "Make BotMatches be more forgiving for a player." ); idCVar g_blood( "g_blood", "1", CVAR_GAME | CVAR_PROFILE | CVAR_ARCHIVE | CVAR_BOOL, "Show blood" ); idCVar g_trainingMode( "g_trainingMode", "0", CVAR_GAME | CVAR_BOOL | CVAR_NOCHEAT, "whether the game is in training mode or not" ); idCVar g_objectiveDecayTime( "g_objectiveDecayTime", "5", CVAR_GAME | CVAR_FLOAT | CVAR_RANKLOCKED, "Length of time in seconds that it takes a construct/hack objective to decay once after the initial timeout is complete" ); idCVar g_noQuickChats( "g_noQuickChats", "0", CVAR_GAME | CVAR_BOOL | CVAR_ARCHIVE | CVAR_PROFILE, "disables sound and text of quickchats" ); idCVar g_maxProficiency( "g_maxProficiency", "0", CVAR_GAME | CVAR_BOOL | CVAR_RANKLOCKED, "" ); idCVar g_vehicleSpawnMinPlayersHusky( "g_vehicleSpawnMinPlayersHusky", "0", CVAR_GAME | CVAR_NETWORKSYNC, "The minimum players that have to be on server before this vehicle will spawn."); idCVar g_vehicleSpawnMinPlayersPlatypus( "g_vehicleSpawnMinPlayersPlatypus", "0", CVAR_GAME | CVAR_NETWORKSYNC, "The minimum players that have to be on server before this vehicle will spawn."); idCVar g_vehicleSpawnMinPlayersArmadillo( "g_vehicleSpawnMinPlayersArmadillo", "0", CVAR_GAME | CVAR_NETWORKSYNC, "The minimum players that have to be on server before this vehicle will spawn."); idCVar g_vehicleSpawnMinPlayersTrojan( "g_vehicleSpawnMinPlayersTrojan", "0", CVAR_GAME | CVAR_NETWORKSYNC, "The minimum players that have to be on server before this vehicle will spawn."); idCVar g_vehicleSpawnMinPlayersBumblebee( "g_vehicleSpawnMinPlayersBumblebee", "0", CVAR_GAME | CVAR_NETWORKSYNC, "The minimum players that have to be on server before this vehicle will spawn."); idCVar g_vehicleSpawnMinPlayersTitan( "g_vehicleSpawnMinPlayersTitan", "0", CVAR_GAME | CVAR_NETWORKSYNC, "The minimum players that have to be on server before this vehicle will spawn."); idCVar g_vehicleSpawnMinPlayersAnansi( "g_vehicleSpawnMinPlayersAnansi", "0", CVAR_GAME | CVAR_NETWORKSYNC, "The minimum players that have to be on server before this vehicle will spawn."); idCVar g_vehicleSpawnMinPlayersIcarus( "g_vehicleSpawnMinPlayersIcarus", "0", CVAR_GAME | CVAR_NETWORKSYNC, "The minimum players that have to be on server before this vehicle will spawn."); idCVar g_vehicleSpawnMinPlayersHog( "g_vehicleSpawnMinPlayersHog", "0", CVAR_GAME | CVAR_NETWORKSYNC, "The minimum players that have to be on server before this vehicle will spawn."); idCVar g_vehicleSpawnMinPlayersDesecrator( "g_vehicleSpawnMinPlayersDesecrator", "0", CVAR_GAME | CVAR_NETWORKSYNC, "The minimum players that have to be on server before this vehicle will spawn."); idCVar g_vehicleSpawnMinPlayersCyclops( "g_vehicleSpawnMinPlayersCyclops", "0", CVAR_GAME | CVAR_NETWORKSYNC, "The minimum players that have to be on server before this vehicle will spawn."); idCVar g_vehicleSpawnMinPlayersTormentor( "g_vehicleSpawnMinPlayersTormentor", "0", CVAR_GAME | CVAR_NETWORKSYNC, "The minimum players that have to be on server before this vehicle will spawn."); idCVar g_vehicleSpawnMinPlayersJupiter( "g_vehicleSpawnMinPlayersJupiter", "0", CVAR_GAME | CVAR_NETWORKSYNC, "The minimum players that have to be on server before this vehicle will spawn."); idCVar g_vehicleSpawnMinPlayersAbaddon( "g_vehicleSpawnMinPlayersAbaddon", "0", CVAR_GAME | CVAR_NETWORKSYNC, "The minimum players that have to be on server before this vehicle will spawn.");
116.325826
337
0.722832
677f46fc06e7d13606731f6f380c3030e3e2c04e
4,986
cpp
C++
Server/GameServer/SealHandler.cpp
APistole/KnightOnline
80268e2fa971389a3e94c430966a7943c2631dbf
[ "MIT" ]
191
2016-03-05T16:44:15.000Z
2022-03-09T00:52:31.000Z
Server/GameServer/SealHandler.cpp
APistole/KnightOnline
80268e2fa971389a3e94c430966a7943c2631dbf
[ "MIT" ]
128
2016-08-31T04:09:06.000Z
2022-01-14T13:42:56.000Z
Server/GameServer/SealHandler.cpp
APistole/KnightOnline
80268e2fa971389a3e94c430966a7943c2631dbf
[ "MIT" ]
165
2016-03-05T16:43:59.000Z
2022-01-22T00:52:25.000Z
#include "stdafx.h" using std::string; #define ITEM_SEAL_PRICE 1000000 enum { SEAL_TYPE_SEAL = 1, SEAL_TYPE_UNSEAL = 2, SEAL_TYPE_KROWAZ = 3 }; enum SealErrorCodes { SealErrorNone = 0, // no error, success! SealErrorFailed = 2, // "Seal Failed." SealErrorNeedCoins = 3, // "Not enough coins." SealErrorInvalidCode = 4, // "Invalid Citizen Registry Number" (i.e. invalid code/password) SealErrorPremiumOnly = 5, // "Only available to premium users" SealErrorFailed2 = 6, // "Seal Failed." SealErrorTooSoon = 7, // "Please try again. You may not repeat this function instantly." }; /** * @brief Packet handler for the item sealing system. * * @param pkt The packet. */ void CUser::ItemSealProcess(Packet & pkt) { // Seal type uint8_t opcode = pkt.read<uint8_t>(); Packet result(WIZ_ITEM_UPGRADE); result << uint8_t(ITEM_SEAL) << opcode; switch (opcode) { // Used when sealing an item. case SEAL_TYPE_SEAL: { string strPasswd; uint32_t nItemID; int16_t unk0; // set to -1 in this case uint8_t bSrcPos, bResponse = SealErrorNone; pkt >> unk0 >> nItemID >> bSrcPos >> strPasswd; /* Most of these checks are handled client-side, so we shouldn't need to provide error messages. Also, item sealing requires certain premium types (gold, platinum, etc) - need to double-check these before implementing this check. */ // is this a valid position? (need to check if it can be taken from new slots) if (bSrcPos >= HAVE_MAX // does the item exist where the client says it does? || GetItem(SLOT_MAX + bSrcPos)->nNum != nItemID // i ain't be allowin' no stealth items to be sealed! || GetItem(SLOT_MAX + bSrcPos)->nSerialNum == 0) bResponse = SealErrorFailed; // is the password valid by client limits? else if (strPasswd.empty() || strPasswd.length() > 8) bResponse = SealErrorInvalidCode; // do we have enough coins? else if (!hasCoins(ITEM_SEAL_PRICE)) bResponse = SealErrorNeedCoins; _ITEM_TABLE* pItem = g_pMain->m_ItemtableArray.GetData(nItemID); if(pItem == nullptr) return; #if 0 // this doesn't look right // If the item's not equippable we not be lettin' you seal no moar! if (pItem->m_bSlot >= SLOT_MAX) bResponse = SealErrorFailed; #endif // If no error, pass it along to the database. if (bResponse == SealErrorNone) { result << nItemID << bSrcPos << strPasswd << bResponse; g_pMain->AddDatabaseRequest(result, this); } // If there's an error, tell the client. // From memory though, there was no need -- it handled all of these conditions itself // so there was no need to differentiate (just ignore the packet). Need to check this. else { result << bResponse; Send(&result); } } break; // Used when unsealing an item. case SEAL_TYPE_UNSEAL: { string strPasswd; uint32_t nItemID; int16_t unk0; // set to -1 in this case uint8_t bSrcPos, bResponse = SealErrorNone; pkt >> unk0 >> nItemID >> bSrcPos >> strPasswd; if (bSrcPos >= HAVE_MAX || GetItem(SLOT_MAX+bSrcPos)->bFlag != ITEM_FLAG_SEALED || GetItem(SLOT_MAX+bSrcPos)->nNum != nItemID) bResponse = SealErrorFailed; else if (strPasswd.empty() || strPasswd.length() > 8) bResponse = SealErrorInvalidCode; // If no error, pass it along to the database. if (bResponse == SealErrorNone) { result << nItemID << bSrcPos << strPasswd << bResponse; g_pMain->AddDatabaseRequest(result, this); } // If there's an error, tell the client. // From memory though, there was no need -- it handled all of these conditions itself // so there was no need to differentiate (just ignore the packet). Need to check this. else { result << bResponse; Send(&result); } } break; // Used when binding a Krowaz item (used to take it from not bound -> bound) case SEAL_TYPE_KROWAZ: { string strPasswd = "0"; //Dummy, not actually used. uint32_t nItemID; uint8_t bSrcPos = 0 , unk3, bResponse = SealErrorNone; uint16_t unk1, unk2; pkt >> unk1 >> nItemID >> bSrcPos >> unk3 >> unk2; if (bSrcPos >= HAVE_MAX || GetItem(SLOT_MAX+bSrcPos)->bFlag != ITEM_FLAG_NONE || GetItem(SLOT_MAX+bSrcPos)->nNum != nItemID) bResponse = SealErrorFailed; if (bResponse == SealErrorNone) { result << nItemID << bSrcPos << strPasswd << bResponse; g_pMain->AddDatabaseRequest(result, this); } } break; } } void CUser::SealItem(uint8_t bSealType, uint8_t bSrcPos) { _ITEM_DATA * pItem = GetItem(SLOT_MAX + bSrcPos); if (pItem == nullptr) return; switch (bSealType) { case SEAL_TYPE_SEAL: pItem->bFlag = ITEM_FLAG_SEALED; GoldLose(ITEM_SEAL_PRICE); break; case SEAL_TYPE_UNSEAL: pItem->bFlag = 0; break; case SEAL_TYPE_KROWAZ: pItem->bFlag = ITEM_FLAG_BOUND; break; } } /** * @brief Packet handler for the character sealing system. * * @param pkt The packet. */ void CUser::CharacterSealProcess(Packet & pkt) { }
27.546961
98
0.676093
677f4c58a0957dd00800731a89c97b4a7d44ce20
13,771
cpp
C++
vs2017/screenshot/GeneratedFiles/moc_FullScreenWidget.cpp
cheechang/cppcc
0292e9a9b27e0579970c83b4f6a75dcdae1558bf
[ "MIT" ]
null
null
null
vs2017/screenshot/GeneratedFiles/moc_FullScreenWidget.cpp
cheechang/cppcc
0292e9a9b27e0579970c83b4f6a75dcdae1558bf
[ "MIT" ]
null
null
null
vs2017/screenshot/GeneratedFiles/moc_FullScreenWidget.cpp
cheechang/cppcc
0292e9a9b27e0579970c83b4f6a75dcdae1558bf
[ "MIT" ]
null
null
null
/**************************************************************************** ** Meta object code from reading C++ file 'FullScreenWidget.h' ** ** Created by: The Qt Meta Object Compiler version 67 (Qt 5.12.1) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ #include "../FullScreenWidget.h" #include <QtCore/qbytearray.h> #include <QtCore/qmetatype.h> #if !defined(Q_MOC_OUTPUT_REVISION) #error "The header file 'FullScreenWidget.h' doesn't include <QObject>." #elif Q_MOC_OUTPUT_REVISION != 67 #error "This file was generated using the moc from 5.12.1. It" #error "cannot be used with the include files from this version of Qt." #error "(The moc has changed too much.)" #endif QT_BEGIN_MOC_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED struct qt_meta_stringdata_fullScreenWidget_t { QByteArrayData data[37]; char stringdata0[541]; }; #define QT_MOC_LITERAL(idx, ofs, len) \ Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ qptrdiff(offsetof(qt_meta_stringdata_fullScreenWidget_t, stringdata0) + ofs \ - idx * sizeof(QByteArrayData)) \ ) static const qt_meta_stringdata_fullScreenWidget_t qt_meta_stringdata_fullScreenWidget = { { QT_MOC_LITERAL(0, 0, 16), // "fullScreenWidget" QT_MOC_LITERAL(1, 17, 12), // "finishPixmap" QT_MOC_LITERAL(2, 30, 0), // "" QT_MOC_LITERAL(3, 31, 10), // "exitPixmap" QT_MOC_LITERAL(4, 42, 12), // "finishedshot" QT_MOC_LITERAL(5, 55, 3), // "cmd" QT_MOC_LITERAL(6, 59, 24), // "signalChangeCurrentShape" QT_MOC_LITERAL(7, 84, 11), // "Shape::Code" QT_MOC_LITERAL(8, 96, 3), // "pen" QT_MOC_LITERAL(9, 100, 20), // "signalDeleteLastDraw" QT_MOC_LITERAL(10, 121, 22), // "signalSelectPenChanged" QT_MOC_LITERAL(11, 144, 23), // "signalSelectFontChanged" QT_MOC_LITERAL(12, 168, 19), // "signalAddTextToView" QT_MOC_LITERAL(13, 188, 20), // "loadBackgroundPixmap" QT_MOC_LITERAL(14, 209, 8), // "bgPixmap" QT_MOC_LITERAL(15, 218, 1), // "x" QT_MOC_LITERAL(16, 220, 1), // "y" QT_MOC_LITERAL(17, 222, 5), // "width" QT_MOC_LITERAL(18, 228, 6), // "height" QT_MOC_LITERAL(19, 235, 14), // "exitShotScreen" QT_MOC_LITERAL(20, 250, 8), // "iscancel" QT_MOC_LITERAL(21, 259, 10), // "savePixmap" QT_MOC_LITERAL(22, 270, 16), // "finishScreenShot" QT_MOC_LITERAL(23, 287, 19), // "slotDrawRectClicked" QT_MOC_LITERAL(24, 307, 22), // "slotDrawEllipseClicked" QT_MOC_LITERAL(25, 330, 20), // "slotDrawArrowClicked" QT_MOC_LITERAL(26, 351, 19), // "slotDrawTextClicked" QT_MOC_LITERAL(27, 371, 19), // "slotDrawPathClicked" QT_MOC_LITERAL(28, 391, 17), // "slotRevokeClicked" QT_MOC_LITERAL(29, 409, 20), // "slotSelectPenChanged" QT_MOC_LITERAL(30, 430, 21), // "slotSelectFontChanged" QT_MOC_LITERAL(31, 452, 4), // "font" QT_MOC_LITERAL(32, 457, 27), // "slotSceneTextLeftBtnPressed" QT_MOC_LITERAL(33, 485, 3), // "pos" QT_MOC_LITERAL(34, 489, 10), // "bIsPressed" QT_MOC_LITERAL(35, 500, 19), // "slotEditTextChanged" QT_MOC_LITERAL(36, 520, 20) // "slotBtnCancelClicked" }, "fullScreenWidget\0finishPixmap\0\0" "exitPixmap\0finishedshot\0cmd\0" "signalChangeCurrentShape\0Shape::Code\0" "pen\0signalDeleteLastDraw\0" "signalSelectPenChanged\0signalSelectFontChanged\0" "signalAddTextToView\0loadBackgroundPixmap\0" "bgPixmap\0x\0y\0width\0height\0exitShotScreen\0" "iscancel\0savePixmap\0finishScreenShot\0" "slotDrawRectClicked\0slotDrawEllipseClicked\0" "slotDrawArrowClicked\0slotDrawTextClicked\0" "slotDrawPathClicked\0slotRevokeClicked\0" "slotSelectPenChanged\0slotSelectFontChanged\0" "font\0slotSceneTextLeftBtnPressed\0pos\0" "bIsPressed\0slotEditTextChanged\0" "slotBtnCancelClicked" }; #undef QT_MOC_LITERAL static const uint qt_meta_data_fullScreenWidget[] = { // content: 8, // revision 0, // classname 0, 0, // classinfo 25, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 8, // signalCount // signals: name, argc, parameters, tag, flags 1, 1, 139, 2, 0x06 /* Public */, 3, 0, 142, 2, 0x06 /* Public */, 4, 1, 143, 2, 0x06 /* Public */, 6, 2, 146, 2, 0x06 /* Public */, 9, 0, 151, 2, 0x06 /* Public */, 10, 1, 152, 2, 0x06 /* Public */, 11, 2, 155, 2, 0x06 /* Public */, 12, 1, 160, 2, 0x06 /* Public */, // slots: name, argc, parameters, tag, flags 13, 1, 163, 2, 0x0a /* Public */, 13, 5, 166, 2, 0x0a /* Public */, 19, 1, 177, 2, 0x0a /* Public */, 19, 0, 180, 2, 0x2a /* Public | MethodCloned */, 21, 0, 181, 2, 0x0a /* Public */, 22, 0, 182, 2, 0x0a /* Public */, 23, 0, 183, 2, 0x0a /* Public */, 24, 0, 184, 2, 0x0a /* Public */, 25, 0, 185, 2, 0x0a /* Public */, 26, 0, 186, 2, 0x0a /* Public */, 27, 0, 187, 2, 0x0a /* Public */, 28, 0, 188, 2, 0x0a /* Public */, 29, 1, 189, 2, 0x0a /* Public */, 30, 2, 192, 2, 0x0a /* Public */, 32, 2, 197, 2, 0x0a /* Public */, 35, 0, 202, 2, 0x0a /* Public */, 36, 0, 203, 2, 0x0a /* Public */, // signals: parameters QMetaType::Void, QMetaType::QPixmap, 1, QMetaType::Void, QMetaType::Void, QMetaType::QString, 5, QMetaType::Void, 0x80000000 | 7, QMetaType::QPen, 2, 8, QMetaType::Void, QMetaType::Void, QMetaType::QPen, 2, QMetaType::Void, QMetaType::QPen, QMetaType::QFont, 2, 2, QMetaType::Void, QMetaType::QString, 2, // slots: parameters QMetaType::Void, QMetaType::QPixmap, 14, QMetaType::Void, QMetaType::QPixmap, QMetaType::Int, QMetaType::Int, QMetaType::Int, QMetaType::Int, 14, 15, 16, 17, 18, QMetaType::Void, QMetaType::Bool, 20, QMetaType::Void, QMetaType::Void, QMetaType::Void, QMetaType::Void, QMetaType::Void, QMetaType::Void, QMetaType::Void, QMetaType::Void, QMetaType::Void, QMetaType::Void, QMetaType::QPen, 8, QMetaType::Void, QMetaType::QPen, QMetaType::QFont, 8, 31, QMetaType::Void, QMetaType::QPointF, QMetaType::Bool, 33, 34, QMetaType::Void, QMetaType::Void, 0 // eod }; void fullScreenWidget::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) { if (_c == QMetaObject::InvokeMetaMethod) { auto *_t = static_cast<fullScreenWidget *>(_o); Q_UNUSED(_t) switch (_id) { case 0: _t->finishPixmap((*reinterpret_cast< const QPixmap(*)>(_a[1]))); break; case 1: _t->exitPixmap(); break; case 2: _t->finishedshot((*reinterpret_cast< QString(*)>(_a[1]))); break; case 3: _t->signalChangeCurrentShape((*reinterpret_cast< Shape::Code(*)>(_a[1])),(*reinterpret_cast< QPen(*)>(_a[2]))); break; case 4: _t->signalDeleteLastDraw(); break; case 5: _t->signalSelectPenChanged((*reinterpret_cast< QPen(*)>(_a[1]))); break; case 6: _t->signalSelectFontChanged((*reinterpret_cast< QPen(*)>(_a[1])),(*reinterpret_cast< QFont(*)>(_a[2]))); break; case 7: _t->signalAddTextToView((*reinterpret_cast< QString(*)>(_a[1]))); break; case 8: _t->loadBackgroundPixmap((*reinterpret_cast< const QPixmap(*)>(_a[1]))); break; case 9: _t->loadBackgroundPixmap((*reinterpret_cast< const QPixmap(*)>(_a[1])),(*reinterpret_cast< int(*)>(_a[2])),(*reinterpret_cast< int(*)>(_a[3])),(*reinterpret_cast< int(*)>(_a[4])),(*reinterpret_cast< int(*)>(_a[5]))); break; case 10: _t->exitShotScreen((*reinterpret_cast< bool(*)>(_a[1]))); break; case 11: _t->exitShotScreen(); break; case 12: _t->savePixmap(); break; case 13: _t->finishScreenShot(); break; case 14: _t->slotDrawRectClicked(); break; case 15: _t->slotDrawEllipseClicked(); break; case 16: _t->slotDrawArrowClicked(); break; case 17: _t->slotDrawTextClicked(); break; case 18: _t->slotDrawPathClicked(); break; case 19: _t->slotRevokeClicked(); break; case 20: _t->slotSelectPenChanged((*reinterpret_cast< QPen(*)>(_a[1]))); break; case 21: _t->slotSelectFontChanged((*reinterpret_cast< QPen(*)>(_a[1])),(*reinterpret_cast< QFont(*)>(_a[2]))); break; case 22: _t->slotSceneTextLeftBtnPressed((*reinterpret_cast< QPointF(*)>(_a[1])),(*reinterpret_cast< bool(*)>(_a[2]))); break; case 23: _t->slotEditTextChanged(); break; case 24: _t->slotBtnCancelClicked(); break; default: ; } } else if (_c == QMetaObject::IndexOfMethod) { int *result = reinterpret_cast<int *>(_a[0]); { using _t = void (fullScreenWidget::*)(const QPixmap ); if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&fullScreenWidget::finishPixmap)) { *result = 0; return; } } { using _t = void (fullScreenWidget::*)(); if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&fullScreenWidget::exitPixmap)) { *result = 1; return; } } { using _t = void (fullScreenWidget::*)(QString ); if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&fullScreenWidget::finishedshot)) { *result = 2; return; } } { using _t = void (fullScreenWidget::*)(Shape::Code , QPen ); if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&fullScreenWidget::signalChangeCurrentShape)) { *result = 3; return; } } { using _t = void (fullScreenWidget::*)(); if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&fullScreenWidget::signalDeleteLastDraw)) { *result = 4; return; } } { using _t = void (fullScreenWidget::*)(QPen ); if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&fullScreenWidget::signalSelectPenChanged)) { *result = 5; return; } } { using _t = void (fullScreenWidget::*)(QPen , QFont ); if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&fullScreenWidget::signalSelectFontChanged)) { *result = 6; return; } } { using _t = void (fullScreenWidget::*)(QString ); if (*reinterpret_cast<_t *>(_a[1]) == static_cast<_t>(&fullScreenWidget::signalAddTextToView)) { *result = 7; return; } } } } QT_INIT_METAOBJECT const QMetaObject fullScreenWidget::staticMetaObject = { { &QWidget::staticMetaObject, qt_meta_stringdata_fullScreenWidget.data, qt_meta_data_fullScreenWidget, qt_static_metacall, nullptr, nullptr } }; const QMetaObject *fullScreenWidget::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; } void *fullScreenWidget::qt_metacast(const char *_clname) { if (!_clname) return nullptr; if (!strcmp(_clname, qt_meta_stringdata_fullScreenWidget.stringdata0)) return static_cast<void*>(this); return QWidget::qt_metacast(_clname); } int fullScreenWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QWidget::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 25) qt_static_metacall(this, _c, _id, _a); _id -= 25; } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { if (_id < 25) *reinterpret_cast<int*>(_a[0]) = -1; _id -= 25; } return _id; } // SIGNAL 0 void fullScreenWidget::finishPixmap(const QPixmap _t1) { void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) }; QMetaObject::activate(this, &staticMetaObject, 0, _a); } // SIGNAL 1 void fullScreenWidget::exitPixmap() { QMetaObject::activate(this, &staticMetaObject, 1, nullptr); } // SIGNAL 2 void fullScreenWidget::finishedshot(QString _t1) { void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) }; QMetaObject::activate(this, &staticMetaObject, 2, _a); } // SIGNAL 3 void fullScreenWidget::signalChangeCurrentShape(Shape::Code _t1, QPen _t2) { void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)) }; QMetaObject::activate(this, &staticMetaObject, 3, _a); } // SIGNAL 4 void fullScreenWidget::signalDeleteLastDraw() { QMetaObject::activate(this, &staticMetaObject, 4, nullptr); } // SIGNAL 5 void fullScreenWidget::signalSelectPenChanged(QPen _t1) { void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) }; QMetaObject::activate(this, &staticMetaObject, 5, _a); } // SIGNAL 6 void fullScreenWidget::signalSelectFontChanged(QPen _t1, QFont _t2) { void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)) }; QMetaObject::activate(this, &staticMetaObject, 6, _a); } // SIGNAL 7 void fullScreenWidget::signalAddTextToView(QString _t1) { void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) }; QMetaObject::activate(this, &staticMetaObject, 7, _a); } QT_WARNING_POP QT_END_MOC_NAMESPACE
38.90113
239
0.609469
67800f90ec79ad1afddbd9c4cf721fc8a405b323
752
hpp
C++
src/math/mat2.hpp
simonfxr/gl
11705f718d27657fc76243d59a251f49c0a41486
[ "MIT" ]
null
null
null
src/math/mat2.hpp
simonfxr/gl
11705f718d27657fc76243d59a251f49c0a41486
[ "MIT" ]
null
null
null
src/math/mat2.hpp
simonfxr/gl
11705f718d27657fc76243d59a251f49c0a41486
[ "MIT" ]
null
null
null
#ifndef MATH_MAT2_HPP #define MATH_MAT2_HPP #include "math/genmat.hpp" namespace math { using mat2_t = genmat<real, 2>; constexpr mat2_t mat2() { return mat2_t::identity(); } constexpr mat2_t mat2(real x) { return mat2_t::fill(x); } template<typename T> constexpr mat2_t mat2(const genmat<T, 2> &A) { return mat2_t::convert(A); } constexpr mat2_t mat2(mat2_t::buffer b) { return mat2_t::load(b); } constexpr mat2_t mat2(const genvec<real, 2> &c1, const genvec<real, 2> &c2) { return mat2_t::make(c1, c2); } constexpr mat2_t mat2(const genmat<real, 3> &A) { mat2_t B{}; for (size_t i = 0; i < 2; ++i) for (size_t j = 0; j < 2; ++j) B[i][j] = A[i][j]; return B; } } // namespace math #endif
13.925926
58
0.62367
6783defb9c837966b097ecad6ae9876a83d5ce20
43,237
hpp
C++
task-movement/Koala/container/assoctab.hpp
miloszc/task-movement
26b40595b590b0fcc3c226fbe8576faa3b5c1244
[ "MIT" ]
null
null
null
task-movement/Koala/container/assoctab.hpp
miloszc/task-movement
26b40595b590b0fcc3c226fbe8576faa3b5c1244
[ "MIT" ]
19
2019-02-15T09:04:22.000Z
2020-06-23T21:42:29.000Z
task-movement/Koala/container/assoctab.hpp
miloszc/task-movement
26b40595b590b0fcc3c226fbe8576faa3b5c1244
[ "MIT" ]
1
2019-05-04T16:12:25.000Z
2019-05-04T16:12:25.000Z
// AssocTabConstInterface template< class K, class V > V AssocTabConstInterface< std::map< K,V > >::operator[]( K arg ) const { koalaAssert( !Privates::ZeroAssocKey<K>::isZero(arg),ContExcOutpass ); typename std::map< K,V >::const_iterator i; i = cont.find( arg ); if (i == cont.end()) return V(); else return i->second; } template< class K, class V > V &AssocTabConstInterface< std::map< K,V > >::get( K arg ) { koalaAssert( !Privates::ZeroAssocKey<K>::isZero(arg),ContExcOutpass ); return (_cont())[arg]; } template< class K, class V > typename AssocTabConstInterface< std::map< K,V > >::ValType *AssocTabConstInterface< std::map< K,V > >::valPtr( K arg ) { koalaAssert( !Privates::ZeroAssocKey<K>::isZero(arg),ContExcOutpass ); typename std::map< K,V >::iterator i = _cont().find( arg ); if (i == _cont().end()) return NULL; else return &(_cont())[arg]; } template< class K, class V > bool AssocTabConstInterface< std::map< K,V > >::delKey( K arg ) { typename std::map< K,V >::iterator pos = _cont().find( arg ); if (pos == _cont().end()) return false; _cont().erase( pos ); return true; } template< class K, class V > K AssocTabConstInterface<std::map< K,V > >::firstKey() const { if (cont.begin() == cont.end()) return Privates::ZeroAssocKey<K>::zero(); return cont.begin()->first; } template< class K, class V > K AssocTabConstInterface<std::map< K,V > >::lastKey() const { typename std::map< K,V >::const_iterator pos; if (cont.begin() == (pos = cont.end())) return Privates::ZeroAssocKey<K>::zero(); pos--; return pos->first; } template< class K, class V > K AssocTabConstInterface<std::map< K,V > >::prevKey( K arg ) const { if (Privates::ZeroAssocKey<K>::isZero(arg)) return lastKey(); typename std::map< K,V >::const_iterator pos = cont.find( arg ); koalaAssert( pos != cont.end(),ContExcOutpass ); if (pos == cont.begin()) return Privates::ZeroAssocKey<K>::zero(); pos--; return pos->first; } template< class K, class V > K AssocTabConstInterface<std::map< K,V > >::nextKey( K arg ) const { if (Privates::ZeroAssocKey<K>::isZero(arg)) return firstKey(); typename std::map< K,V >::const_iterator pos = cont.find( arg ); koalaAssert( pos != cont.end(),ContExcOutpass ); pos++; if (pos == cont.end()) return Privates::ZeroAssocKey<K>::zero(); return pos->first; } template< class K, class V > template< class Iterator > int AssocTabConstInterface< std::map< K,V > >::getKeys( Iterator iter ) const { for( K key = firstKey(); !Privates::ZeroAssocKey<K>::isZero(key); key = nextKey( key ) ) { *iter = key; iter++; } return size(); } // AssocTabInterface template< class T > AssocTabInterface< T > &AssocTabInterface< T >::operator=( const AssocTabInterface< T > &arg ) { if (&arg.cont == &cont) return *this; clear(); for( KeyType k = arg.firstKey(); !Privates::ZeroAssocKey<KeyType>::isZero(k); k = arg.nextKey( k ) ) operator[]( k ) = arg[k]; return *this; } template< class T > AssocTabInterface< T > &AssocTabInterface< T >::operator=( const AssocTabConstInterface< T > &arg ) { if (&arg.cont == &cont) return *this; clear(); for( KeyType k = arg.firstKey(); !Privates::ZeroAssocKey<KeyType>::isZero(k); k = arg.nextKey( k ) ) operator[]( k )=arg[k]; return *this; } template< class T > template< class AssocCont > AssocTabInterface< T > &AssocTabInterface< T >::operator=( const AssocCont &arg ) { Privates::AssocTabTag< KeyType >::operator=( arg ); clear(); for( KeyType k = arg.firstKey(); !Privates::ZeroAssocKey<KeyType>::isZero(k); k = arg.nextKey( k ) ) operator[]( k )=arg[k]; return *this; } // AssocTable template< class T > AssocTable< T > &AssocTable< T >::operator=( const AssocTable< T > &X ) { if (this == &X) return *this; cont = X.cont; return *this; } template< class T > AssocTable< T > &AssocTable< T >::operator=( const T &X ) { if (&cont == &X) return *this; cont = X; return *this; } template< class T > template< class AssocCont > AssocTable< T > &AssocTable< T >::operator=( const AssocCont &arg ) { Privates::AssocTabTag< typename AssocTabInterface< T >::KeyType >::operator=( arg ); if (Privates::asssocTabInterfTest( arg ) == &cont) return *this; clear(); for( typename AssocTabInterface< T >::KeyType k = arg.firstKey(); !Privates::ZeroAssocKey<KeyType>::isZero(k); k = arg.nextKey( k ) ) operator[]( k ) = arg[k]; return *this; } // AssocContReg AssocKeyContReg &AssocKeyContReg::operator=( const AssocKeyContReg &X ) { if (&X != this) next = 0; return *this; } AssocContReg *AssocKeyContReg::find( AssocContBase *cont ) { AssocContReg *res; for( res = this; res->next; res= &(res->next->getReg( res->nextPos )) ) if (res->next == cont) return res; return NULL; } void AssocKeyContReg::deregister() { std::pair< AssocContBase *,int > a = std::pair< AssocContBase *,int >( next,nextPos ), n; next = 0; while (a.first) { AssocContReg *p = &a.first->getReg( a.second ); n = std::pair< AssocContBase *,int >( p->next,p->nextPos ); a.first->DelPosCommand( a.second ); a = n; } } // AssocArray template< class Klucz, class Elem, class Container > template< class AssocCont > AssocArray< Klucz,Elem,Container > &AssocArray< Klucz,Elem,Container >::operator=( const AssocCont &arg ) { Privates::AssocTabTag< Klucz >::operator=( arg ); clear(); for( Klucz k = arg.firstKey(); k; k = arg.nextKey( k ) ) operator[]( k ) = arg[k]; return *this; } template< class Klucz, class Elem, class Container > Elem *AssocArray< Klucz,Elem,Container >::valPtr( Klucz v ) { int x = keyPos( v ); if (x == -1) return NULL; else return &tab[x].val; } template< class Klucz, class Elem, class Container > AssocArray< Klucz,Elem,Container >::AssocArray( const AssocArray< Klucz,Elem,Container > &X ): tab(X.tab) { for( int i = tab.firstPos(); i != -1; i = tab.nextPos( i ) ) { tab[i].assocReg = tab[i].key->assocReg; tab[i].key->assocReg.next = this; tab[i].key->assocReg.nextPos = i; } } template< class Klucz, class Elem, class Container > AssocArray< Klucz,Elem,Container > &AssocArray< Klucz,Elem,Container >::operator=( const AssocArray< Klucz,Elem,Container > &X ) { if (&X == this) return *this; clear(); tab = X.tab; for( int i = tab.firstPos(); i != -1; i = tab.nextPos( i ) ) { tab[i].assocReg = tab[i].key->assocReg; tab[i].key->assocReg.next = this; tab[i].key->assocReg.nextPos = i; } return *this; } template< class Klucz, class Elem, class Container > int AssocArray< Klucz,Elem,Container >::keyPos( Klucz v ) const { if (!v) return -1; AssocContReg *preg = v->assocReg.find( const_cast<AssocArray< Klucz,Elem,Container > * > (this) ); if (preg) return preg->nextPos; else return -1; } template< class Klucz, class Elem, class Container > bool AssocArray< Klucz,Elem,Container >::delKey( Klucz v ) { int x; if (!v) return false; AssocContReg *preg = v->assocReg.find( this ); if (!preg) return false; x = preg->nextPos; *preg = tab[x].assocReg; tab.delPos( x ); return true; } template< class Klucz, class Elem, class Container > Klucz AssocArray< Klucz,Elem,Container >::firstKey() const { if (tab.empty()) return 0; else return tab[tab.firstPos()].key; } template< class Klucz, class Elem, class Container > Klucz AssocArray< Klucz,Elem,Container >::lastKey() const { if (tab.empty()) return 0; else return tab[tab.lastPos()].key; } template< class Klucz, class Elem, class Container > Klucz AssocArray< Klucz,Elem,Container >::nextKey( Klucz v ) const { if (!v) return firstKey(); int x= keyPos( v ); koalaAssert( x != -1,ContExcOutpass ); if ((x = tab.nextPos( x )) == -1) return 0; return tab[x].key; } template< class Klucz, class Elem, class Container > Klucz AssocArray< Klucz,Elem,Container >::prevKey( Klucz v ) const { if (!v) return lastKey(); int x = keyPos( v ); koalaAssert( x != -1,ContExcOutpass ); if ((x = tab.prevPos( x )) == -1) return 0; return tab[x].key; } template< class Klucz, class Elem, class Container > Elem &AssocArray< Klucz,Elem,Container >::operator[]( Klucz v ) { koalaAssert( v,ContExcWrongArg ); int x = keyPos( v ); if (x == -1) { x = tab.newPos(); tab[x].key = v; tab[x].assocReg = v->assocReg; v->assocReg.next = this; v->assocReg.nextPos = x; } return tab[x].val; } template< class Klucz, class Elem, class Container > Elem AssocArray< Klucz,Elem,Container >::operator[]( Klucz v ) const { koalaAssert( v,ContExcWrongArg ); int x = keyPos( v ); if (x == -1) return Elem(); return tab[x].val; } template< class Klucz, class Elem, class Container > void AssocArray< Klucz,Elem,Container >::defrag() { tab.defrag(); for( int i = 0; i < tab.size(); i++ ) tab[i].key->assocReg.find( this )->nextPos = i; } template< class Klucz, class Elem, class Container > void AssocArray< Klucz,Elem,Container >::clear() { for( Klucz v = firstKey(); v; v = firstKey() ) delKey( v ); } template< class Klucz, class Elem, class Container > template< class Iterator > int AssocArray< Klucz,Elem,Container >::getKeys( Iterator iter ) const { for( Klucz key = firstKey(); key; key = nextKey( key ) ) { *iter = key; iter++; } return size(); } namespace Privates { // PseudoAssocArray template< class Klucz, class Elem, class AssocCont, class Container > template< class AssocCont2 > PseudoAssocArray< Klucz,Elem,AssocCont,Container > &PseudoAssocArray< Klucz,Elem,AssocCont,Container >::operator=( const AssocCont2 &arg ) { Privates::AssocTabTag< Klucz >::operator=( arg ); clear(); for( Klucz k = arg.firstKey(); k; k = arg.nextKey( k ) ) operator[]( k ) = arg[k]; return *this; } template< class Klucz, class Elem, class AssocCont, class Container > int PseudoAssocArray< Klucz,Elem,AssocCont,Container >::keyPos( Klucz v ) const { if (!v) return -1; if (!assocTab.hasKey( v )) return -1; return assocTab[v]; } template< class Klucz, class Elem, class AssocCont, class Container > bool PseudoAssocArray< Klucz,Elem,AssocCont,Container >::delKey( Klucz v ) { if (!v) return false; if (!assocTab.hasKey( v )) return false; tab.delPos( assocTab[v] ); assocTab.delKey( v ); return true; } template< class Klucz, class Elem, class AssocCont, class Container > Klucz PseudoAssocArray< Klucz,Elem,AssocCont,Container >::firstKey() const { if (tab.empty()) return 0; else return tab[tab.firstPos()].key; } template< class Klucz, class Elem, class AssocCont, class Container > Klucz PseudoAssocArray< Klucz,Elem,AssocCont,Container >::lastKey() const { if (tab.empty()) return 0; else return tab[tab.lastPos()].key; } template< class Klucz, class Elem, class AssocCont, class Container > Klucz PseudoAssocArray< Klucz,Elem,AssocCont,Container >::nextKey( Klucz v ) const { if (!v) return firstKey(); int x = keyPos( v ); koalaAssert( x != -1,ContExcOutpass ); if ((x = tab.nextPos( x )) == -1) return 0; return tab[x].key; } template< class Klucz, class Elem, class AssocCont, class Container > Klucz PseudoAssocArray< Klucz,Elem,AssocCont,Container >::prevKey( Klucz v ) const { if (!v) return lastKey(); int x = keyPos( v ); koalaAssert( x != -1,ContExcOutpass ); if ((x = tab.prevPos( x )) == -1) return 0; return tab[x].key; } template< class Klucz, class Elem, class AssocCont, class Container > Elem &PseudoAssocArray< Klucz,Elem,AssocCont,Container >::operator[]( Klucz v ) { koalaAssert( v,ContExcWrongArg ); int x = keyPos( v ); if (x == -1) { tab[x = tab.newPos()].key = v; assocTab[v] = x; } return tab[x].val; } template< class Klucz, class Elem, class AssocCont, class Container > Elem PseudoAssocArray< Klucz,Elem,AssocCont,Container >::operator[]( Klucz v ) const { koalaAssert( v,ContExcOutpass ); int x = keyPos( v ); if (x == -1) return Elem(); return tab[x].val; } template< class Klucz, class Elem, class AssocCont, class Container > void PseudoAssocArray< Klucz,Elem,AssocCont,Container >::defrag() { tab.defrag(); for( int i = 0; i < tab.size(); i++ ) assocTab[tab[i].key] = i; } template< class Klucz, class Elem, class AssocCont, class Container > template< class Iterator > int PseudoAssocArray< Klucz,Elem,AssocCont,Container >::getKeys( Iterator iter ) const { for( Klucz key = firstKey(); key; key = nextKey( key ) ) { *iter = key; iter++; } return size(); } template< class Klucz, class Elem, class AssocCont, class Container > void PseudoAssocArray< Klucz,Elem,AssocCont,Container >::reserve( int arg ) { tab.reserve( arg ); assocTab.reserve( arg ); } template< class Klucz, class Elem, class AssocCont, class Container > Elem *PseudoAssocArray< Klucz,Elem,AssocCont,Container >::valPtr( Klucz v ) { int x = keyPos( v ); if (x == -1) return NULL; else return &tab[x].val; } template< class Klucz, class Elem, class AssocCont, class Container > void PseudoAssocArray< Klucz,Elem,AssocCont,Container >::clear() { tab.clear(); assocTab.clear(); } } // Assoc2DimTabAddr inline int Assoc2DimTabAddr< AMatrFull >::wsp2pos( std::pair< int,int > w ) const { int mfs = std::max( w.first,w.second ); return mfs * mfs + mfs + w.second - w.first; } inline std::pair< int,int > Assoc2DimTabAddr< AMatrFull >::pos2wsp( int pos ) const { int x = (int)sqrt( (double)pos ); if (x * x + x - pos > 0) return std::pair< int,int >( x,pos - x * x ); else return std::pair< int,int >( x * x + 2 * x - pos,x ); } inline int Assoc2DimTabAddr< AMatrNoDiag >::wsp2pos( std::pair< int,int > w ) const { int mfs = std::max( w.first,w.second ); return mfs * mfs + w.second - w.first - ((w.first > w.second) ? 0 : 1); } inline std::pair< int,int > Assoc2DimTabAddr< AMatrNoDiag >::pos2wsp( int pos ) const { int x = (int)sqrt( (double)pos ); if (pos - x * x - x >= 0) return std::pair< int,int >( x + 1,pos - x * x - x ); else return std::pair< int,int >( x * x + x - 1 - pos,x ); } inline int Assoc2DimTabAddr< AMatrClTriangle >::wsp2pos( std::pair< int,int > w ) const { if (w.first < w.second) { int z = w.first; w.first = w.second; w.second = z; } return w.first * (w.first + 1) / 2 + w.second; } inline std::pair< int,int > Assoc2DimTabAddr< AMatrClTriangle >::pos2wsp( int pos ) const { int x = (int)sqrt( (double)2 * pos ), xx = pos - x * (x + 1) / 2; if (xx >= 0) return std::pair< int,int >( x,xx ); else return std::pair< int,int >( x - 1,xx + x ); } inline int Assoc2DimTabAddr< AMatrTriangle >::wsp2pos( std::pair< int,int > w ) const { if (w.first < w.second) { int z = w.first; w.first = w.second; w.second = z; } return w.first * (w.first - 1) / 2 + w.second; } inline std::pair< int,int > Assoc2DimTabAddr< AMatrTriangle >::pos2wsp( int pos ) const { int x = (int)sqrt( (double)2 * pos ), xx = pos - x * (x + 1) / 2; if (xx >= 0) return std::pair< int,int >( x + 1,xx ); else return std::pair< int,int >( x,xx + x ); } // AssocMatrix template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > Klucz AssocMatrix< Klucz,Elem,aType,Container,IndexContainer >::AssocIndex::pos2klucz( int arg ) { if (arg == -1) return 0; return IndexContainer::tab[arg].key; } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > void AssocMatrix< Klucz,Elem,aType,Container,IndexContainer >::AssocIndex::DelPosCommand( int pos ) { int LOCALARRAY( tabpos,IndexContainer::size() ); int l = 0; int i = IndexContainer::tab.firstPos(); for( ; i != -1; i = IndexContainer::tab.nextPos( i ) ) tabpos[l++] = i; for( l--; l >= 0; l-- ) { owner->delPos( std::pair< int,int >( pos,tabpos[l] ) ); if ((aType == AMatrNoDiag || aType == AMatrFull) && (pos != tabpos[l])) owner->delPos( std::pair< int,int >( tabpos[l],pos ) ); } IndexContainer::tab.delPos( pos ); Klucz LOCALARRAY(keytab,IndexContainer::size() ); int res=this->getKeys(keytab); for( int j=0;j<res;j++) if (!this->operator[]( keytab[j] )) IndexContainer::delKey( keytab[j] ); } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > void AssocMatrix< Klucz,Elem,aType,Container,IndexContainer >::delPos( std::pair< int,int > wsp ) { if (!Assoc2DimTabAddr< aType >::correctPos( wsp.first,wsp.second )) return; int x; if (!bufor[x = Assoc2DimTabAddr< aType >::wsp2pos( wsp )].present()) return; if (bufor[x].next != -1) bufor[bufor[x].next].prev = bufor[x].prev; else last = bufor[x].prev; if (bufor[x].prev != -1) bufor[bufor[x].prev].next = bufor[x].next; else first = bufor[x].next; bufor[x] = Privates::BlockOfAssocMatrix< Elem >(); siz--; --index.tab[wsp.first].val; --index.tab[wsp.second].val; } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > AssocMatrix< Klucz,Elem,aType,Container,IndexContainer >::AssocMatrix( int asize): index( asize ), siz( 0 ), first( -1 ), last( -1 ) { bufor.clear(); bufor.reserve( Assoc2DimTabAddr< aType >::bufLen( asize ) ); index.owner = this; } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > AssocMatrix< Klucz,Elem,aType,Container,IndexContainer > &AssocMatrix< Klucz,Elem,aType,Container,IndexContainer >::operator=( const AssocMatrix< Klucz,Elem,aType,Container,IndexContainer > &X ) { if (&X == this) return *this; index = X.index; bufor = X.bufor; siz = X.siz; first = X.first; last = X.last; index.owner = this; return *this; } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > bool AssocMatrix< Klucz,Elem,aType,Container,IndexContainer >::delInd( Klucz v ) { if (!hasInd( v )) return false; Klucz LOCALARRAY( tab,index.size() ); int i = 0; for( Klucz x = index.firstKey(); x; x = index.nextKey( x ) ) tab[i++] = x; for( i--; i >= 0; i-- ) { delKey( v,tab[i] ); if ((aType == AMatrNoDiag || aType == AMatrFull) && (v != tab[i])) delKey( tab[i],v ); } index.delKey( v ); return true; } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > template <class ExtCont> int AssocMatrix< Klucz,Elem,aType,Container,IndexContainer >::slice1( Klucz v, ExtCont &tab ) const { if (!index.hasKey( v )) return 0; int licz = 0; for( Klucz x = index.firstKey(); x; x = index.nextKey( x ) ) if (hasKey( v,x )) { tab[x] = this->operator()( v,x ); licz++; } return licz; } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > template<class ExtCont > int AssocMatrix< Klucz,Elem,aType,Container,IndexContainer >::slice2( Klucz v, ExtCont &tab ) const { if (!index.hasKey( v )) return 0; int licz = 0; for( Klucz x = index.firstKey(); x; x = index.nextKey( x ) ) if (hasKey( x,v )) { tab[x] = this->operator()( x,v ); licz++; } return licz; } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > bool AssocMatrix< Klucz,Elem,aType,Container,IndexContainer >::hasKey( Klucz u, Klucz v ) const { if (!u || !v) return false; if (!Assoc2DimTabAddr< aType >::correctPos( u,v )) return false; std::pair< int,int > wsp = std::pair< int,int >( index.klucz2pos( u ),index.klucz2pos( v ) ); if (wsp.first == -1 || wsp.second == -1) return false; return bufor[Assoc2DimTabAddr< aType >::wsp2pos( wsp )].present(); } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > bool AssocMatrix< Klucz,Elem,aType,Container,IndexContainer >::delKey( Klucz u, Klucz v ) { if (!u || !v) return false; if (!Assoc2DimTabAddr< aType >::correctPos( u,v )) return false; std::pair< int,int > wsp = std::pair< int,int >( index.klucz2pos( u ),index.klucz2pos( v ) ); if (wsp.first == -1 || wsp.second == -1) return false; int x; if (bufor[x = Assoc2DimTabAddr< aType >::wsp2pos( wsp )].present()) { if (bufor[x].next != -1) bufor[bufor[x].next].prev = bufor[x].prev; else last = bufor[x].prev; if (bufor[x].prev != -1) bufor[bufor[x].prev].next = bufor[x].next; else first = bufor[x].next; bufor[x] = Privates::BlockOfAssocMatrix< Elem >(); siz--; if (--index[u] == 0) index.delKey( u ); if (--index[v] == 0) index.delKey( v ); return true; } return false; } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > Elem &AssocMatrix< Klucz,Elem,aType,Container,IndexContainer >::operator()( Klucz u, Klucz v ) { koalaAssert( u && v && Assoc2DimTabAddr< aType >::correctPos( u,v ),ContExcWrongArg ); std::pair< int,int > wsp = std::pair< int,int >( index.klucz2pos( u ),index.klucz2pos( v ) ); if (wsp.first == -1) { index[u] = 0; wsp.first = index.klucz2pos( u ); } if (wsp.second == -1) { index[v] = 0; wsp.second = index.klucz2pos( v ); } bufor.resize( std::max( (int)bufor.size(),Assoc2DimTabAddr< aType >::bufLen( index.size() ) ) ); int x = Assoc2DimTabAddr< aType >::wsp2pos( wsp ); if (!bufor[x].present()) { if ((bufor[x].prev = last) == -1) first = x; else bufor[bufor[x].prev].next = x; bufor[x].next = -1; last = x; index[u]++; index[v]++; siz++; } return bufor[x].val; } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > Elem AssocMatrix< Klucz,Elem,aType,Container,IndexContainer >::operator()( Klucz u, Klucz v ) const { koalaAssert( u && v && Assoc2DimTabAddr< aType >::correctPos( u,v ),ContExcWrongArg ); std::pair< int,int > wsp = std::pair< int,int >( index.klucz2pos( u ),index.klucz2pos( v ) ); if (wsp.first == -1 || wsp.second == -1) return Elem(); int x = Assoc2DimTabAddr< aType >::wsp2pos( wsp ); if (!bufor[x].present()) return Elem(); return bufor[x].val; } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > Elem* AssocMatrix< Klucz,Elem,aType,Container,IndexContainer >::valPtr( Klucz u, Klucz v ) { koalaAssert( u && v && Assoc2DimTabAddr< aType >::correctPos( u,v ),ContExcWrongArg ); std::pair< int,int > wsp = std::pair< int,int >( index.klucz2pos( u ),index.klucz2pos( v ) ); if (wsp.first == -1 || wsp.second == -1) return NULL; int pos; if (!bufor[pos = Assoc2DimTabAddr< aType >::wsp2pos( wsp )].present()) return NULL; return &bufor[pos].val; } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > std::pair< Klucz,Klucz > AssocMatrix< Klucz,Elem,aType,Container,IndexContainer >::firstKey() const { if (!siz) return std::pair< Klucz,Klucz >( (Klucz)0,(Klucz)0 ); std::pair< int,int > wsp = Assoc2DimTabAddr< aType >::pos2wsp( first ); return Assoc2DimTabAddr< aType >::key( std::pair< Klucz,Klucz >( index.pos2klucz( wsp.first ), index.pos2klucz( wsp.second ) ) ); } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > std::pair< Klucz,Klucz > AssocMatrix< Klucz,Elem,aType,Container,IndexContainer >::lastKey() const { if (!siz) return std::pair< Klucz,Klucz >( (Klucz)0,(Klucz)0 ); std::pair< int,int > wsp = Assoc2DimTabAddr< aType >::pos2wsp( last ); return Assoc2DimTabAddr< aType >::key( std::pair< Klucz,Klucz >( index.pos2klucz( wsp.first ), index.pos2klucz( wsp.second ) ) ); } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > std::pair< Klucz,Klucz > AssocMatrix< Klucz,Elem,aType,Container,IndexContainer >::nextKey( Klucz u, Klucz v ) const { if (!u || !v) return firstKey(); koalaAssert( Assoc2DimTabAddr< aType >::correctPos( u,v ),ContExcWrongArg ); std::pair< int,int > wsp = std::pair< int,int >( index.klucz2pos( u ),index.klucz2pos( v ) ); koalaAssert( wsp.first != -1 && wsp.second != -1,ContExcOutpass ); int x = Assoc2DimTabAddr< aType >::wsp2pos( wsp ); koalaAssert( bufor[x].present(),ContExcOutpass ); x = bufor[x].next; if (x == -1) return std::pair< Klucz,Klucz >( (Klucz)0,(Klucz)0 ); wsp = Assoc2DimTabAddr< aType >::pos2wsp( x ); return Assoc2DimTabAddr< aType >::key( std::pair< Klucz,Klucz >( index.pos2klucz( wsp.first ), index.pos2klucz( wsp.second ) ) ); } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > template< class MatrixContainer > AssocMatrix< Klucz,Elem,aType,Container,IndexContainer > &AssocMatrix< Klucz,Elem,aType,Container,IndexContainer >::operator=( const MatrixContainer &X ) { Privates::Assoc2DimTabTag< Klucz,aType >::operator=( X ); this->clear(); int rozm; std::pair<Klucz,Klucz> LOCALARRAY(tab,rozm=X.size()); X.getKeys(tab); for( int i=0;i<rozm;i++ ) this->operator()( tab[i] )=X( tab[i] ); return *this; } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > std::pair< Klucz,Klucz > AssocMatrix< Klucz,Elem,aType,Container,IndexContainer >::prevKey( Klucz u, Klucz v ) const { if (!u || !v) return lastKey(); koalaAssert( Assoc2DimTabAddr< aType >::correctPos( u,v ),ContExcWrongArg ); std::pair< int,int > wsp = std::pair< int,int >( index.klucz2pos( u ),index.klucz2pos( v ) ); koalaAssert( wsp.first != -1 && wsp.second != -1,ContExcOutpass ); int x = Assoc2DimTabAddr< aType >::wsp2pos( wsp ); koalaAssert( bufor[x].present(),ContExcOutpass ); x = bufor[x].prev; if (x == -1) return std::pair< Klucz,Klucz >( (Klucz)0,(Klucz)0 ); wsp = Assoc2DimTabAddr< aType >::pos2wsp( x ); return Assoc2DimTabAddr< aType >::key( std::pair< Klucz,Klucz >(index.pos2klucz( wsp.first ), index.pos2klucz( wsp.second ) ) ); } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > void AssocMatrix< Klucz,Elem,aType,Container,IndexContainer >::clear() { index.clear(); int in; for( int i = first; i != -1; i = in ) { in = bufor[i].next; bufor[i] = Privates::BlockOfAssocMatrix< Elem >(); } siz = 0; first = last = -1; } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > void AssocMatrix< Klucz,Elem,aType,Container,IndexContainer >::reserve( int arg ) { index.reserve( arg ); bufor.reserve( Assoc2DimTabAddr< aType >::bufLen( arg ) ); } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > void AssocMatrix< Klucz,Elem,aType,Container,IndexContainer >::defrag() { DefragMatrixPom LOCALARRAY( tab,siz ); int i=0; for( int pos = first; pos != -1; pos = bufor[pos].next ) { tab[i].val = bufor[pos].val; std::pair< int,int > wsp = Assoc2DimTabAddr< aType >::pos2wsp( pos ); tab[i].u = index.pos2klucz( wsp.first ); tab[i].v = index.pos2klucz( wsp.second ); i++; } bufor.clear(); index.clear(); index.defrag(); { Container tmp; bufor.swap(tmp); } siz = 0; first = last = -1; for( int ii = 0; ii < i ; ii++ ) this->operator()( tab[ii].u,tab[ii].v ) = tab[ii].val; } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > template< class Iterator > int AssocMatrix< Klucz,Elem,aType,Container,IndexContainer >::getKeys( Iterator iter ) const { for( std::pair< Klucz,Klucz > key = firstKey(); key.first; key = nextKey( key ) ) { *iter = key; iter++; } return size(); } //template<class Klucz, class Elem, AssocMatrixType aType, class C, class IC > // std::ostream &operator<<( std::ostream &out, const AssocMatrix< Klucz,Elem,aType,C,IC > &cont ) //{ // out << '{'; // int siz = cont.size(); // std::pair< typename AssocMatrix< Klucz,Elem,aType,C,IC >::KeyType,typename AssocMatrix< Klucz,Elem,aType,C,IC >::KeyType > // key = cont.firstKey(); // for( ; siz; siz-- ) // { // out << '(' << key.first << ',' << key.second << ':'<< cont(key) << ')'; // if (siz>1) // { // key = cont.nextKey( key ); // out << ','; // } // } // out << '}'; // return out; //} // AssocInserter template< class T > template< class K, class V > AssocInserter< T > &AssocInserter< T >::operator=( const std::pair< K,V > &pair ) { (*container)[(typename T::KeyType)pair.first] = (typename T::ValType)pair.second; return *this; } template< class T, class Fun > template< class K > AssocFunctorInserter< T,Fun > &AssocFunctorInserter< T,Fun >::operator=( const K &arg ) { (*container)[(typename T::KeyType)arg] = (typename T::ValType)functor( arg ); return *this; } template< class Cont,class K > std::ostream &Privates::printAssoc( std::ostream &out, const Cont &cont,Privates::AssocTabTag< K > ) { out << '{'; int siz = cont.size(); typename Cont::KeyType key = cont.firstKey(); for( ; siz; siz-- ) { out << '(' << key << ',' << cont[key] << ')'; if (key != cont.lastKey()) { key = cont.nextKey( key ); out << ','; } } out << '}'; return out; } template< class Cont,class K,AssocMatrixType aType > std::ostream &Privates::printAssoc( std::ostream &out, const Cont &cont, Privates::Assoc2DimTabTag< K,aType > ) { out << '{'; int siz = cont.size(); std::pair< typename Cont::KeyType,typename Cont::KeyType > key = cont.firstKey(); for( ; siz; siz-- ) { out << '(' << key.first << ',' << key.second << ':'<< cont(key) << ')'; if (siz>1) { key = cont.nextKey( key ); out << ','; } } out << '}'; return out; } template< AssocMatrixType aType, class Container> Assoc2DimTable< aType,Container > &Assoc2DimTable< aType,Container >::operator=(const Assoc2DimTable< aType,Container > &X) { if (this==&X) return *this; acont=X.acont; return *this; } template< AssocMatrixType aType, class Container> template< class MatrixContainer > Assoc2DimTable< aType,Container > &Assoc2DimTable< aType,Container >::operator=( const MatrixContainer &X ) { Privates::Assoc2DimTabTag< KeyType,aType >::operator=( X ); this->clear(); int rozm; std::pair<KeyType,KeyType> LOCALARRAY(tab,rozm=X.size()); X.getKeys(tab); for( int i=0;i<rozm;i++ ) this->operator()( tab[i] )=X( tab[i] ); return *this; } template< AssocMatrixType aType, class Container> bool Assoc2DimTable< aType,Container >::hasKey( typename Assoc2DimTable< aType,Container >::KeyType u, typename Assoc2DimTable< aType,Container >::KeyType v ) const { if (!u || !v) return false; if (!Assoc2DimTabAddr< aType >::correctPos( u,v )) return false; return interf.hasKey(Assoc2DimTabAddr< aType >::key(u,v)); } template< AssocMatrixType aType, class Container> bool Assoc2DimTable< aType,Container >::delKey( typename Assoc2DimTable< aType,Container >::KeyType u, typename Assoc2DimTable< aType,Container >::KeyType v) { if (!u || !v) return false; if (!Assoc2DimTabAddr< aType >::correctPos( u,v )) return false; return interf.delKey(Assoc2DimTabAddr< aType >::key(u,v)); } template< AssocMatrixType aType, class Container> std::pair< typename Assoc2DimTable< aType,Container >::KeyType,typename Assoc2DimTable< aType,Container >::KeyType > Assoc2DimTable< aType,Container >::nextKey( typename Assoc2DimTable< aType,Container >::KeyType u, typename Assoc2DimTable< aType,Container >::KeyType v) const { if (!u || !v) return firstKey(); koalaAssert( Assoc2DimTabAddr< aType >::correctPos( u,v ),ContExcWrongArg ); return interf.nextKey(Assoc2DimTabAddr< aType >::key(u,v)); } template< AssocMatrixType aType, class Container> std::pair< typename Assoc2DimTable< aType,Container >::KeyType,typename Assoc2DimTable< aType,Container >::KeyType > Assoc2DimTable< aType,Container >::prevKey( typename Assoc2DimTable< aType,Container >::KeyType u, typename Assoc2DimTable< aType,Container >::KeyType v) const { if (!u || !v) return lastKey(); koalaAssert( Assoc2DimTabAddr< aType >::correctPos( u,v ),ContExcWrongArg ); return interf.prevKey(Assoc2DimTabAddr< aType >::key(u,v)); } template< AssocMatrixType aType, class Container> bool Assoc2DimTable< aType,Container >::hasInd( typename Assoc2DimTable< aType,Container >::KeyType v ) const { for(std::pair< KeyType,KeyType> key=this->firstKey(); !Privates::ZeroAssocKey<std::pair< KeyType,KeyType> >::isZero(key); key=this->nextKey(key)) if (key.first==v || key.second==v) return true; return false; } template< AssocMatrixType aType, class Container> bool Assoc2DimTable< aType,Container >::delInd( typename Assoc2DimTable< aType,Container >::KeyType v ) { bool flag=false; std::pair< KeyType,KeyType> key,key2; for(std::pair< KeyType,KeyType> key=this->firstKey(); !Privates::ZeroAssocKey<std::pair< KeyType,KeyType> >::isZero(key);key=key2) { key2=this->nextKey(key); if (key.first==v || key.second==v) { flag=true; this->delKey(key); } } return flag; } template< AssocMatrixType aType, class Container> template<class DefaultStructs, class Iterator > int Assoc2DimTable< aType,Container >::getInds( Iterator iter ) const { typename DefaultStructs:: template AssocCont< KeyType, char >::Type inds(2*this->size()); for(std::pair< KeyType,KeyType> key=this->firstKey(); !Privates::ZeroAssocKey<std::pair< KeyType,KeyType> >::isZero(key); key=this->nextKey(key)) inds[key.first]=inds[key.second]='A'; return inds.getKeys(iter); } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > inline void SimpleAssocMatrix<Klucz,Elem,aType,Container,IndexContainer>::AssocIndex::DelPosCommand( int pos ) { int LOCALARRAY( tabpos,IndexContainer::size() ); int l = 0; int i = IndexContainer::tab.firstPos(); for( ; i != -1; i = IndexContainer::tab.nextPos( i ) ) tabpos[l++] = i; for( l--; l >= 0; l-- ) { owner->delPos( std::pair< int,int >( pos,tabpos[l] ) ); if ((aType == AMatrNoDiag || aType == AMatrFull) && (pos != tabpos[l])) owner->delPos( std::pair< int,int >( tabpos[l],pos ) ); } IndexContainer::tab.delPos( pos ); Klucz LOCALARRAY(keytab,IndexContainer::size() ); int res=this->getKeys(keytab); for( int j=0;j<res;j++) if (!this->operator[]( keytab[j] )) IndexContainer::delKey( keytab[j] ); } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > void SimpleAssocMatrix<Klucz,Elem,aType,Container,IndexContainer>::delPos( std::pair< int,int > wsp ) { if (!Assoc2DimTabAddr< aType >::correctPos( wsp.first,wsp.second )) return; std::pair< int,int > x=Assoc2DimTabAddr< aType >::wsp2pos2( wsp ); if (!bufor.operator[](x.first).operator[](x.second).present) return; bufor.operator[](x.first).operator[](x.second) = Privates::BlockOfSimpleAssocMatrix< Elem >(); siz--; --index.tab[wsp.first].val; --index.tab[wsp.second].val; } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > void SimpleAssocMatrix<Klucz,Elem,aType,Container,IndexContainer>::resizeBuf( int asize ) { asize=std::max((int)bufor.size(),asize ); bufor.resize(asize); for(int i=0;i<asize;i++) bufor.operator[](i).resize ( std::max(Assoc2DimTabAddr< aType >::colSize( i,asize ),(int)bufor.operator[](i).size()) ); } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > SimpleAssocMatrix< Klucz,Elem,aType,Container,IndexContainer > &SimpleAssocMatrix<Klucz,Elem,aType,Container,IndexContainer>::operator=( const SimpleAssocMatrix< Klucz,Elem,aType,Container,IndexContainer > & X) { if (&X == this) return *this; index = X.index; bufor = X.bufor; siz = X.siz; index.owner = this; return *this; } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > template< class MatrixContainer > SimpleAssocMatrix<Klucz,Elem,aType,Container,IndexContainer> &SimpleAssocMatrix<Klucz,Elem,aType,Container,IndexContainer>::operator=( const MatrixContainer &X ) { Privates::Assoc2DimTabTag< Klucz,aType >::operator=( X ); this->clear(); int rozm; std::pair<Klucz,Klucz> LOCALARRAY(tab,rozm=X.size()); X.getKeys(tab); for( int i=0;i<rozm;i++ ) this->operator()( tab[i] )=X( tab[i] ); return *this; } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > void SimpleAssocMatrix<Klucz,Elem,aType,Container,IndexContainer>::reserve( int asize ) { index.reserve( asize ); bufor.resize( asize=std::max((int)bufor.size(),asize )); for(int i=0;i<asize;i++) bufor.operator[](i).reserve( Assoc2DimTabAddr< aType >::colSize( i,asize ) ); } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > void SimpleAssocMatrix<Klucz,Elem,aType,Container,IndexContainer>::clear() { index.clear(); int bufsize=bufor.size(); bufor.clear(); this->resizeBuf(bufsize); siz = 0; } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > template <class ExtCont> int SimpleAssocMatrix<Klucz,Elem,aType,Container,IndexContainer>::slice1( Klucz v, ExtCont &tab ) const { if (!index.hasKey( v )) return 0; int licz = 0; for( Klucz x = index.firstKey(); x; x = index.nextKey( x ) ) if (hasKey( v,x )) { tab[x] = this->operator()( v,x ); licz++; } return licz; } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > template <class ExtCont> int SimpleAssocMatrix<Klucz,Elem,aType,Container,IndexContainer>::slice2( Klucz v, ExtCont &tab ) const { if (!index.hasKey( v )) return 0; int licz = 0; for( Klucz x = index.firstKey(); x; x = index.nextKey( x ) ) if (hasKey( x,v )) { tab[x] = this->operator()( x,v ); licz++; } return licz; } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > bool SimpleAssocMatrix<Klucz,Elem,aType,Container,IndexContainer>::delInd( Klucz v ) { if (!hasInd( v )) return false; Klucz LOCALARRAY( tab,index.size() ); int i = 0; for( Klucz x = index.firstKey(); x; x = index.nextKey( x ) ) tab[i++] = x; for( i--; i >= 0; i-- ) { delKey( v,tab[i] ); if ((aType == AMatrNoDiag || aType == AMatrFull) && (v != tab[i])) delKey( tab[i],v ); } index.delKey( v ); return true; } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > bool SimpleAssocMatrix<Klucz,Elem,aType,Container,IndexContainer>::hasKey( Klucz u, Klucz v ) const { if (!u || !v) return false; if (!Assoc2DimTabAddr< aType >::correctPos( u,v )) return false; std::pair< int,int > wsp = std::pair< int,int >( index.klucz2pos( u ),index.klucz2pos( v ) ); if (wsp.first == -1 || wsp.second == -1) return false; wsp=Assoc2DimTabAddr< aType >::wsp2pos2( wsp ); return bufor.operator[](wsp.first).operator[](wsp.second).present; } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > bool SimpleAssocMatrix<Klucz,Elem,aType,Container,IndexContainer>::delKey( Klucz u, Klucz v) { if (!u || !v) return false; if (!Assoc2DimTabAddr< aType >::correctPos( u,v )) return false; std::pair< int,int > wsp = std::pair< int,int >( index.klucz2pos( u ),index.klucz2pos( v ) ); if (wsp.first == -1 || wsp.second == -1) return false; std::pair< int,int > x=Assoc2DimTabAddr< aType >::wsp2pos2( wsp ); if (bufor.operator[](x.first).operator[](x.second).present) { bufor.operator[](x.first).operator[](x.second) = Privates::BlockOfSimpleAssocMatrix< Elem >(); siz--; if (--index[u] == 0) index.delKey( u ); if (--index[v] == 0) index.delKey( v ); return true; } return false; } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > Elem &SimpleAssocMatrix<Klucz,Elem,aType,Container,IndexContainer>::operator()( Klucz u, Klucz v ) { koalaAssert( u && v && Assoc2DimTabAddr< aType >::correctPos( u,v ),ContExcWrongArg ); std::pair< int,int > wsp = std::pair< int,int >( index.klucz2pos( u ),index.klucz2pos( v ) ); if (wsp.first == -1) { index[u] = 0; wsp.first = index.klucz2pos( u ); } if (wsp.second == -1) { index[v] = 0; wsp.second = index.klucz2pos( v ); } int q,qq; this->resizeBuf( q=std::max( qq=(int)bufor.size(), index.size() ) ); std::pair< int,int > x = Assoc2DimTabAddr< aType >::wsp2pos2( wsp ); if (!bufor.operator[](x.first).operator[](x.second).present) { bufor.operator[](x.first).operator[](x.second).present=true; index[u]++; index[v]++; siz++; } return bufor.operator[](x.first).operator[](x.second).val; } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > Elem SimpleAssocMatrix<Klucz,Elem,aType,Container,IndexContainer>::operator()( Klucz u, Klucz v) const { koalaAssert( u && v && Assoc2DimTabAddr< aType >::correctPos( u,v ),ContExcWrongArg ); std::pair< int,int > wsp = std::pair< int,int >( index.klucz2pos( u ),index.klucz2pos( v ) ); if (wsp.first == -1 || wsp.second == -1) return Elem(); std::pair< int,int > x = Assoc2DimTabAddr< aType >::wsp2pos2( wsp ); if (!bufor.operator[](x.first).operator[](x.second).present) return Elem(); return bufor.operator[](x.first).operator[](x.second).val; } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > Elem *SimpleAssocMatrix<Klucz,Elem,aType,Container,IndexContainer>::valPtr(Klucz u, Klucz v) { koalaAssert( u && v && Assoc2DimTabAddr< aType >::correctPos( u,v ),ContExcWrongArg ); std::pair< int,int > wsp = std::pair< int,int >( index.klucz2pos( u ),index.klucz2pos( v ) ); if (wsp.first == -1 || wsp.second == -1) return NULL; std::pair< int,int > pos=Assoc2DimTabAddr< aType >::wsp2pos2( wsp ); if (!bufor.operator[](pos.first).operator[](pos.second).present) return NULL; return &bufor.operator[](pos.first).operator[](pos.second).val; } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > template< class Iterator > int SimpleAssocMatrix<Klucz,Elem,aType,Container,IndexContainer>::getKeys( Iterator iter ) const { for(Klucz x=this->firstInd();x;x=this->nextInd(x)) for(Klucz y=(aType==AMatrFull || aType==AMatrNoDiag) ? this->firstInd() : x; y;y=this->nextInd(y)) if (this->hasKey(x,y)) { *iter=Assoc2DimTabAddr<aType>::key(std::pair<Klucz,Klucz>(x,y)); ++iter; } return siz; } template< class Klucz, class Elem, AssocMatrixType aType, class Container, class IndexContainer > void SimpleAssocMatrix<Klucz,Elem,aType,Container,IndexContainer>::defrag() { int n; std::pair<Klucz,Klucz> LOCALARRAY(keys,n=this->size()); ValType LOCALARRAY(vals,n); this->getKeys(keys); for(int i=0;i<n;i++) vals[i]=this->operator()(keys[i].first,keys[i].second); index.clear(); index.defrag(); siz=0; { Container tmp; bufor.swap(tmp); } for(int i=0;i<n;i++) this->operator()(keys[i].first,keys[i].second)=vals[i]; }
35.009717
164
0.660568
6787d8c779a3ba6a702a7af7db4f78c9d5b97891
8,821
cxx
C++
Hybrid/Testing/Cxx/TestKWEGPUArrayCalculator.cxx
wuzhuobin/vtkEdge
ed13af68a72cec79e3645f7e842d6074592abfa2
[ "BSD-3-Clause" ]
1
2021-01-09T16:06:14.000Z
2021-01-09T16:06:14.000Z
Hybrid/Testing/Cxx/TestKWEGPUArrayCalculator.cxx
wuzhuobin/vtkEdge
ed13af68a72cec79e3645f7e842d6074592abfa2
[ "BSD-3-Clause" ]
null
null
null
Hybrid/Testing/Cxx/TestKWEGPUArrayCalculator.cxx
wuzhuobin/vtkEdge
ed13af68a72cec79e3645f7e842d6074592abfa2
[ "BSD-3-Clause" ]
null
null
null
//============================================================================= // This file is part of VTKEdge. See vtkedge.org for more information. // // Copyright (c) 2010 Kitware, Inc. // // VTKEdge may be used under the terms of the BSD License // Please see the file Copyright.txt in the root directory of // VTKEdge for further information. // // Alternatively, you may see: // // http://www.vtkedge.org/vtkedge/project/license.html // // // For custom extensions, consulting services, or training for // this or any other Kitware supported open source project, please // contact Kitware at sales@kitware.com. // // //============================================================================= // This test covers vtkKWEGPUArrayCalulator, compare to vtkArrayCalculator. // The command line arguments are: // -I => run in interactive mode; unless this is used, the program will // not allow interaction and exit // An image data is first created with a raw array. // Some computation on the data array is performed // IF THIS TEST TIMEOUT, IT IS PROBABLY ON VISTA WITH A NOT-FAST-ENOUGH // GRAPHICS CARD: // Depending on how fast/slow is the graphics card, the computation on the GPU // can take more than 2 seconds. On Vista, after a 2 seconds timeout, the // Windows Vista's Timeout Detection and Recovery (TDR) kills all the graphics // contexts, resets the graphics chip and recovers the graphics driver, in // order to keep the operating system responsive. // ref: http://www.opengl.org/pipeline/article/vol003_7/ // This reset actually freezes the test. And it really times out this time... // Example of pathological case: dash1vista32.kitware/Win32Vista-vs80 #include "vtkTestUtilities.h" #include "vtkRegressionTestImage.h" #include "vtkArrayCalculator.h" #include "vtkKWEGPUArrayCalculator.h" #include "vtkRenderWindowInteractor.h" #include "vtkRenderWindow.h" #include "vtkPolyDataMapper.h" #include "vtkActor.h" #include "vtkRenderer.h" #include "vtkOutlineFilter.h" #include "vtkImageData.h" #include "vtkPointData.h" #include "vtkImageImport.h" #include <assert.h> #include "vtkTimerLog.h" #include "vtkDoubleArray.h" #include "vtkXYPlotWidget.h" #include "vtkXYPlotActor.h" // On a nVidia Quadro FX 3600M (~GeForce8), // GL_MAX_TEXTURE_SIZE = 8192, GL_MAX_3D_TEXTURE_SIZE = 2048 // GL_MAX_VIEWPORT_DIMS = 8192, 8192 // The following size matches two complete full 2D textures, one 2D texture // with one complete row and one 2D texture with just one pixel. //const vtkIdType TestNumberOfPoints=2*(8192*8192)+8192+1; const vtkIdType TestNumberOfPoints=(2*(8192*8192)+8192+1)/10; // 2*(8192*8192)+8192+1; //4096*4096; const int TestNumberOfComponents=1; // 1 or 3 void ComputeAndDisplayMeanErrorAndStandardDeviation(vtkDoubleArray *c, vtkDoubleArray *g) { assert("pre: c_exists" && c!=0); assert("pre: g_exists" && g!=0); assert("pre: same_size" && c->GetNumberOfTuples()==g->GetNumberOfTuples()); assert("pre: same_components" && c->GetNumberOfComponents()==g->GetNumberOfComponents()); assert("pre: not_empty" && c->GetNumberOfTuples()>0); vtkIdType n=c->GetNumberOfTuples()*c->GetNumberOfComponents(); double *a=static_cast<double *>(c->GetVoidPointer(0)); double *b=static_cast<double *>(g->GetVoidPointer(0)); vtkIdType i; // mean error double meanError=0.0; double maxError=0.0; i=0; while(i<n) { double delta=fabs(a[i]-b[i]); if(delta>maxError) { maxError=delta; } meanError+=delta; ++i; } meanError/=static_cast<double>(n); // std deviation double stdDeviation=0.0; i=0; while(i<n) { double delta=fabs(a[i]-b[i])-meanError; stdDeviation+=delta*delta; ++i; } stdDeviation=sqrt(stdDeviation/static_cast<double>(n)); cout<<" number of values="<<n<<endl; cout<<" mean error="<<meanError<<endl; cout<<" standard deviation="<<stdDeviation<<endl; cout<<" maxError="<<maxError<<endl; } vtkImageImport *CreateSource(vtkIdType numberOfPoints, int numberOfComponents) { assert("pre: valid_number_of_points" && numberOfPoints>0); vtkImageImport *im=vtkImageImport::New(); float *ptr=new float[numberOfPoints*numberOfComponents]; vtkIdType i=0; while(i<numberOfPoints*numberOfComponents) { ptr[i]=static_cast<float>(i); // 2.0 ++i; } im->SetDataScalarTypeToFloat(); im->SetImportVoidPointer(ptr,0); // let the importer delete it. im->SetNumberOfScalarComponents(numberOfComponents); im->SetDataExtent(0,static_cast<int>(numberOfPoints-1),0,0,0,0); im->SetWholeExtent(0,static_cast<int>(numberOfPoints-1),0,0,0,0); im->SetScalarArrayName("values"); return im; } int TestKWEGPUArrayCalculator(int vtkNotUsed(argc), char *vtkNotUsed(argv)[]) { vtkRenderWindowInteractor *iren=vtkRenderWindowInteractor::New(); vtkRenderWindow *renWin = vtkRenderWindow::New(); renWin->SetSize(101,99); renWin->SetAlphaBitPlanes(1); renWin->SetReportGraphicErrors(1); iren->SetRenderWindow(renWin); renWin->Delete(); // Useful when looking at the test output in CDash: cout << "IF THIS TEST TIMEOUT, IT IS PROBABLY ON VISTA WITH" << " A NOT-FAST-ENOUGH GRAPHICS CARD."<<endl; cout<<"numPoints="<<TestNumberOfPoints<<endl; vtkImageImport *im=CreateSource(TestNumberOfPoints,TestNumberOfComponents); im->Update(); double range[2]; vtkImageData *image=vtkImageData::SafeDownCast(im->GetOutputDataObject(0)); image->GetPointData()->GetScalars()->GetRange(range); cout<<"range[2]="<<range[0]<<" "<<range[1]<<endl; vtkArrayCalculator *calc=vtkArrayCalculator::New(); calc->SetInputConnection(0,im->GetOutputPort(0)); // reader or source calc->AddScalarArrayName("values"); calc->SetResultArrayName("Result"); calc->SetFunction("values+10.0"); // calc->SetFunction("sin(norm(values))+cos(norm(values))+10.0"); // calc->SetFunction("sin(values)*cos(values)+10.0"); // calc->SetFunction("exp(sqrt(sin(values)*cos(values)+10.0))"); vtkTimerLog *timer=vtkTimerLog::New(); timer->StartTimer(); calc->Update(); timer->StopTimer(); cout<<"Elapsed time with CPU version:"<<timer->GetElapsedTime()<<" seconds."<<endl; image=vtkImageData::SafeDownCast(calc->GetOutputDataObject(0)); image->GetPointData()->GetScalars()->GetRange(range); cout<<"range2[2]="<<range[0]<<" "<<range[1]<<endl; vtkKWEGPUArrayCalculator *calc2=vtkKWEGPUArrayCalculator::New(); calc2->SetContext(renWin); calc2->SetInputConnection(0,im->GetOutputPort(0)); // reader or source calc2->AddScalarArrayName("values"); calc2->SetResultArrayName("Result"); calc2->SetFunction("values+10"); // calc2->SetFunction("sin(norm(values))+cos(norm(values))+10.0"); // calc2->SetFunction("sin(values)*cos(values)+10.0"); // calc2->SetFunction("exp(sqrt(sin(values)*cos(values)+10.0))"); // my nVidia Quadro FX 3600M has 512MB // esimatation of 28MB already taken for screen+current context // at 1600*1200: 512-28=484 // calc2->SetMaxGPUMemorySizeInBytes(512*1024*1024); calc2->SetMaxGPUMemorySizeInBytes(128*1024*1024); timer->StartTimer(); calc2->Update(); timer->StopTimer(); cout<<"Elapsed time with GPU version:"<<timer->GetElapsedTime()<<" seconds."<<endl; vtkImageData *image2; image2=vtkImageData::SafeDownCast(calc2->GetOutputDataObject(0)); image2->GetPointData()->GetScalars()->GetRange(range); cout<<"range3[2]="<<range[0]<<" "<<range[1]<<endl; ComputeAndDisplayMeanErrorAndStandardDeviation( vtkDoubleArray::SafeDownCast(image->GetPointData()->GetScalars()), vtkDoubleArray::SafeDownCast(image2->GetPointData()->GetScalars())); timer->Delete(); calc2->Calibrate(); cout<<"Calibrated size threshold="<<calc2->GetCalibratedSizeThreshold()<<endl; #if 0 vtkRenderer *renderer=vtkRenderer::New(); renderer->SetBackground(0.0,0.0,0.3); renWin->AddRenderer(renderer); renderer->Delete(); vtkXYPlotActor *actor=vtkXYPlotActor::New(); renderer->AddViewProp(actor); actor->Delete(); actor->AddInput(image,"Result",0); actor->SetPlotColor(0,1.0,0.0,0.0); actor->AddInput(image2,"Result",0); actor->SetPlotColor(1,0.0,1.0,0.0); renWin->Render(); vtkXYPlotWidget *w=vtkXYPlotWidget::New(); w->SetInteractor(iren); w->SetXYPlotActor(actor); w->SetEnabled(1); int retVal = vtkRegressionTestImage(renWin); if ( retVal == vtkRegressionTester::DO_INTERACTOR) { iren->Start(); } w->Delete(); #endif calc2->Delete(); // need context iren->Delete(); im->Delete(); calc->Delete(); return 0; // !retVal; 0: passed, 1: failed }
33.796935
117
0.677247
6787f8c55a86572359a8d1c112817aa47613cec8
4,365
hpp
C++
src/items/SpatialItem.hpp
maltewi/envire-envire_core
549b64ed30ba8afc4d91ae67b216a78b40cee016
[ "BSD-2-Clause" ]
9
2017-05-13T12:33:46.000Z
2021-01-27T18:50:40.000Z
src/items/SpatialItem.hpp
maltewi/envire-envire_core
549b64ed30ba8afc4d91ae67b216a78b40cee016
[ "BSD-2-Clause" ]
37
2016-02-11T17:34:41.000Z
2021-10-04T10:14:18.000Z
src/items/SpatialItem.hpp
maltewi/envire-envire_core
549b64ed30ba8afc4d91ae67b216a78b40cee016
[ "BSD-2-Clause" ]
11
2016-07-11T14:49:34.000Z
2021-06-04T08:23:39.000Z
// // Copyright (c) 2015, Deutsches Forschungszentrum für Künstliche Intelligenz GmbH. // 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 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. // #ifndef __ENVIRE_CORE_SPATIAL_ITEM__ #define __ENVIRE_CORE_SPATIAL_ITEM__ #include <envire_core/items/Item.hpp> #include <envire_core/items/BoundingVolume.hpp> #include <boost/shared_ptr.hpp> #include <Eigen/Geometry> namespace envire { namespace core { /**@class SpatialItem * * SpatialItem class */ template<class _ItemData> class SpatialItem : public Item<_ItemData> { public: typedef boost::shared_ptr< SpatialItem<_ItemData> > Ptr; protected: boost::shared_ptr<BoundingVolume> boundary; public: SpatialItem() : Item<_ItemData>() { }; virtual ~SpatialItem() {} void setBoundary(const boost::shared_ptr<BoundingVolume>& boundary) {this->boundary = boundary;} boost::shared_ptr<BoundingVolume> getBoundary() {return boundary;} const boost::shared_ptr<BoundingVolume>& getBoundary() const {return boundary;} void extendBoundary(const Eigen::Vector3d& point) { checkBoundingVolume(); boundary->extend(point); } template<typename _Data> void extendBoundary(const SpatialItem<_Data>& spatial_item) { checkBoundingVolume(); boundary->extend(spatial_item.getBoundary()); } template<typename _Data> bool intersects(const SpatialItem<_Data>& spatial_item) const { checkBoundingVolume(); return boundary->intersects(spatial_item.getBoundary()); } template<typename _Data> boost::shared_ptr<BoundingVolume> intersection(const SpatialItem<_Data>& spatial_item) const { checkBoundingVolume(); return boundary->intersection(spatial_item.getBoundary()); } bool contains(const Eigen::Vector3d& point) const { checkBoundingVolume(); return boundary->contains(point); } template<typename _Data> bool contains(const SpatialItem<_Data>& spatial_item) const { checkBoundingVolume(); return boundary->contains(spatial_item.getBoundary()); } double exteriorDistance(const Eigen::Vector3d& point) const { checkBoundingVolume(); return boundary->exteriorDistance(point); } template<typename _Data> double exteriorDistance(const SpatialItem<_Data>& spatial_item) const { checkBoundingVolume(); return boundary->exteriorDistance(spatial_item.getBoundary()); } Eigen::Vector3d centerOfBoundary() const { checkBoundingVolume(); return boundary->center(); } protected: void checkBoundingVolume() const { if(boundary.get() == NULL) throw std::runtime_error("BoundingVolume is not available!"); } }; }} #endif
31.630435
104
0.666208
678bb6abe6ce6d9516ab5d5f4f07267b9aa57239
3,817
cpp
C++
released_plugins/v3d_plugins/hierachical_labeling/hier_label_func.cpp
zzhmark/vaa3d_tools
3ca418add85a59ac7e805d55a600b78330d7e53d
[ "MIT" ]
1
2021-12-27T19:14:03.000Z
2021-12-27T19:14:03.000Z
released_plugins/v3d_plugins/hierachical_labeling/hier_label_func.cpp
zzhmark/vaa3d_tools
3ca418add85a59ac7e805d55a600b78330d7e53d
[ "MIT" ]
1
2016-12-03T05:33:13.000Z
2016-12-03T05:33:13.000Z
released_plugins/v3d_plugins/hierachical_labeling/hier_label_func.cpp
zzhmark/vaa3d_tools
3ca418add85a59ac7e805d55a600b78330d7e53d
[ "MIT" ]
null
null
null
/* hier_label_func.cpp * This plugin heirachically segments the input neuron tree and label the nodes as features in eswc file. * 2012-05-04 : by Yinan Wan */ #include <v3d_interface.h> #include "v3d_message.h" #include "hier_label_func.h" #include "hierachical_labeling.h" #include "customary_structs/vaa3d_neurontoolbox_para.h" #include <vector> #include <iostream> using namespace std; const QString title = QObject::tr("Hierachical Labeling"); int hierachical_labeling_io(V3DPluginCallback2 &callback, QWidget *parent) { QString fileOpenName; fileOpenName = QFileDialog::getOpenFileName(0, QObject::tr("Open File"), "", QObject::tr("Supported file (*.swc)" ";;Neuron structure (*.swc)" )); if(fileOpenName.isEmpty()) return -1; NeuronTree nt = readSWC_file(fileOpenName); if (!hierachical_labeling(nt)) { v3d_msg("Error in consensus skeleton!"); return -1; } QString fileSaveName; QString defaultSaveName = fileOpenName + "_hier.eswc"; fileSaveName = QFileDialog::getSaveFileName(0, QObject::tr("Save merged neuron to file:"), defaultSaveName, QObject::tr("Supported file (*.eswc)" ";;Neuron structure (*.eswc)" )); if (!writeESWC_file(fileSaveName, nt)) { v3d_msg("Unable to save file"); return -1; } return 1; } bool hierachical_labeling_io(const V3DPluginArgList & input, V3DPluginArgList & output) { cout<<"Welcome to hierachical_labeling"<<endl; if(input.size() != 1) { cerr<<"please specify only 1 input neuron without parameter"<<endl; return true; } vector<char*> * inlist = (vector<char*> *)(input.at(0).p); if (inlist->size()!=1) { cerr<<"please specify only 1 input neuron"<<endl; return false; } QString fileOpenName(inlist->at(0)); if (output.size()!=1) return false; QString fileSaveName; vector<char*> * outlist = (vector<char*> *)(output.at(0).p); if (outlist->size()==0) fileSaveName = fileOpenName + "_hier.eswc"; else if (outlist->size()==1) fileSaveName = QString(outlist->at(0)); else { cerr<<"please specify only 1 input neuron"<<endl; return false; } NeuronTree nt = readSWC_file(fileOpenName); if (!hierachical_labeling(nt)) { cerr<<"Error in consensus skeleton!"<<endl;; return false; } if (!writeESWC_file(fileSaveName, nt)) { cerr<<"Unable to save file"<<endl; return false; } return true; } bool hierachical_labeling_toolbox(const V3DPluginArgList & input) { vaa3d_neurontoolbox_paras * paras = (vaa3d_neurontoolbox_paras *)(input.at(0).p); NeuronTree neuron = paras->nt; QString fileOpenName = neuron.file; if (!hierachical_labeling(neuron)) { v3d_msg("Error in consensus skeleton!"); return -1; } QString fileSaveName; QString defaultSaveName = fileOpenName + "_hier.eswc"; fileSaveName = QFileDialog::getSaveFileName(0, QObject::tr("Save merged neuron to file:"), defaultSaveName, QObject::tr("Supported file (*.eswc)" ";;Neuron structure (*.eswc)" )); if (!writeESWC_file(fileSaveName, neuron)) { v3d_msg("Unable to save file"); return -1; } return 1; } void printHelp() { cout<<"\nHierachical Labeling: a plugin that hierachically segments the neuron structure and save it as eswc (Enhanced SWC) format. 12-05-04 by Yinan Wan"<<endl; cout<<"Usage: v3d -x hier_label -f hierachical_labeling -i <input_neuron> -o <output_eswc>"<<endl; cout<<"Parameters"<<endl; cout<<"\t-i <input_neuron>: input neuron structure, in .swc or .eswc format"<<endl; cout<<"\t[-o] <output_eswc> : output eswc file, with hierachy stored in the fea_val row"<<endl; cout<<"\t not required. DEFAULT file should be generated under the same folder with input neuron with a name of inputFileName_hier.eswc"<<endl; cout<<"Example: v3d-x hier_label -f hierachical_labeling -i input.swc -o input_labeled.swc\n"<<endl; }
27.861314
165
0.703432
678cf958b2fa6c02ad42f430b91df752c6f7a2c8
1,061
cpp
C++
tau/TauEngine/src/dx/dxgi/DXGI11GraphicsDisplay.cpp
hyfloac/TauEngine
1559b2a6e6d1887b8ee02932fe0aa6e5b9d5652c
[ "MIT" ]
1
2020-04-22T04:07:01.000Z
2020-04-22T04:07:01.000Z
tau/TauEngine/src/dx/dxgi/DXGI11GraphicsDisplay.cpp
hyfloac/TauEngine
1559b2a6e6d1887b8ee02932fe0aa6e5b9d5652c
[ "MIT" ]
null
null
null
tau/TauEngine/src/dx/dxgi/DXGI11GraphicsDisplay.cpp
hyfloac/TauEngine
1559b2a6e6d1887b8ee02932fe0aa6e5b9d5652c
[ "MIT" ]
null
null
null
#include "dx/dxgi/DXGI11GraphicsDisplay.hpp" #ifdef _WIN32 NullableRef<DXGI11GraphicsDisplay> DXGI11GraphicsDisplay::build(IDXGIOutput* const dxgiOutput) noexcept { UINT numDisplayModes; HRESULT res = dxgiOutput->GetDisplayModeList(DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_ENUM_MODES_INTERLACED, &numDisplayModes, nullptr); if(FAILED(res)) { return null; } DynArray<DXGI_MODE_DESC> dxgiDisplayModes(numDisplayModes); res = dxgiOutput->GetDisplayModeList(DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_ENUM_MODES_INTERLACED, &numDisplayModes, dxgiDisplayModes); RefDynArray<IGraphicsDisplay::GraphicsDisplayMode> displayModes(numDisplayModes); if(FAILED(res)) { return null; } for(uSys i = 0; i < numDisplayModes; ++i) { const auto& mode = dxgiDisplayModes[i]; displayModes[i] = { mode.Width, mode.Height, mode.RefreshRate.Numerator, mode.RefreshRate.Denominator }; } return NullableRef<DXGI11GraphicsDisplay>(DefaultTauAllocator::Instance(), dxgiOutput, displayModes); } #endif
35.366667
134
0.737983
6790d2017a223d244fde06f4fd43c86abecc4182
1,419
hpp
C++
deeplab/code/include/caffe/layers/graphcut_layer.hpp
dmitrii-marin/adm-seg
e730b79bcd2b30cee66efac0ce961090c2cd4e62
[ "MIT" ]
10
2019-05-28T22:00:08.000Z
2021-11-27T04:00:11.000Z
deeplab/code/include/caffe/layers/graphcut_layer.hpp
dmitrii-marin/adm-seg
e730b79bcd2b30cee66efac0ce961090c2cd4e62
[ "MIT" ]
2
2019-09-10T09:47:13.000Z
2019-10-26T02:58:03.000Z
deeplab/code/include/caffe/layers/graphcut_layer.hpp
dmitrii-marin/adm-seg
e730b79bcd2b30cee66efac0ce961090c2cd4e62
[ "MIT" ]
2
2019-12-26T01:58:20.000Z
2020-03-11T02:22:08.000Z
#ifndef CAFFE_GRAPHCUT_LAYER_HPP_ #define CAFFE_GRAPHCUT_LAYER_HPP_ #include <vector> #include "caffe/blob.hpp" #include "caffe/layer.hpp" #include "caffe/proto/caffe.pb.h" #include "caffe/filterrgbxy.hpp" #include "gco-v3.0/GCoptimization.h" #include <cstddef> namespace caffe{ template <typename Dtype> class GraphCutLayer : public Layer<Dtype>{ public: virtual ~GraphCutLayer(); explicit GraphCutLayer(const LayerParameter & param) : Layer<Dtype>(param) {} virtual void LayerSetUp(const vector<Blob<Dtype>*>& bottom, const vector<Blob<Dtype>*>& top); virtual void Reshape(const vector<Blob<Dtype>*> & bottom, const vector<Blob<Dtype>*> & top); virtual inline const char* type() const { return "GraphCut";} virtual inline int ExactNumBottomBlobs() const {return 2;} virtual inline int ExactNumTopBlobs() const {return 2;} protected: void runGraphCut(const Dtype * image, const Dtype * unary, Dtype * gc_segmentation, bool * ROI); virtual void Forward_cpu(const vector<Blob<Dtype>*> & bottom, const vector<Blob<Dtype>*> & top); virtual void Backward_cpu(const vector<Blob<Dtype>*> & top, const vector<bool> & propagate_down, const vector<Blob<Dtype>*> & bottom); int N, C, H, W; float sigma; int max_iter; float potts_weight; Blob<Dtype> * unaries; bool * ROI_allimages; }; } // namespace caffe #endif // CAFFE_GRAPHCUT_LAYER_HPP_
26.277778
98
0.711769
09649f973e8094042707dd1d686a901ca1295560
6,729
cpp
C++
Cores/FCEU/FCEU/drivers/win/keyboard.cpp
werminghoff/Provenance
de61b4a64a3eb8e2774e0a8ed53488c6c7aa6cb2
[ "BSD-3-Clause" ]
3,459
2015-01-07T14:07:09.000Z
2022-03-25T03:51:10.000Z
Cores/FCEU/FCEU/drivers/win/keyboard.cpp
werminghoff/Provenance
de61b4a64a3eb8e2774e0a8ed53488c6c7aa6cb2
[ "BSD-3-Clause" ]
1,046
2018-03-24T17:56:16.000Z
2022-03-23T08:13:09.000Z
Cores/FCEU/FCEU/drivers/win/keyboard.cpp
werminghoff/Provenance
de61b4a64a3eb8e2774e0a8ed53488c6c7aa6cb2
[ "BSD-3-Clause" ]
549
2015-01-07T14:07:15.000Z
2022-01-07T16:13:05.000Z
/* FCE Ultra - NES/Famicom Emulator * * Copyright notice for this file: * Copyright (C) 2002 Xodnizel * * 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. * * 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, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "common.h" #include "dinput.h" #include "input.h" #include "keyboard.h" static HRESULT ddrval; //mbg merge 7/17/06 made static static int background = 0; static LPDIRECTINPUTDEVICE7 lpdid=0; void KeyboardClose(void) { if(lpdid) IDirectInputDevice7_Unacquire(lpdid); lpdid=0; } static unsigned int keys[256] = {0,}; // with repeat static unsigned int keys_nr[256] = {0,}; // non-repeating static unsigned int keys_jd[256] = {0,}; // just-down static unsigned int keys_jd_lock[256] = {0,}; // just-down released lock int autoHoldKey = 0, autoHoldClearKey = 0; int ctr=0; void KeyboardUpdateState(void) { unsigned char tk[256]; ddrval=IDirectInputDevice7_GetDeviceState(lpdid,256,tk); if (tk[0]) tk[0] = 0; //adelikat: HACK. If a keyboard key is recognized as this, the effect is that all non assigned hotkeys are run. This prevents the key from being used, but also prevent "hotkey explosion". Also, they essentially couldn't use it anyway since FCEUX doesn't know it is a shift key, and it can't be assigned in the hotkeys // HACK because DirectInput is totally wacky about recognizing the PAUSE/BREAK key if(GetAsyncKeyState(VK_PAUSE)) // normally this should have & 0x8000, but apparently this key is too special for that to work tk[0xC5] = 0x80; switch(ddrval) { case DI_OK: //memcpy(keys,tk,256);break; break; //mbg 10/8/2008 //previously only these two cases were handled. this made dwedit's laptop volume keys freak out. //we're trying this instead default: //case DIERR_INPUTLOST: //case DIERR_NOTACQUIRED: memset(tk,0,256); IDirectInputDevice7_Acquire(lpdid); break; } //process keys extern int soundoptions; #define SO_OLDUP 32 extern int soundo; extern int32 fps_scale; int notAlternateThrottle = !(soundoptions&SO_OLDUP) && soundo && ((NoWaiting&1)?(256*16):fps_scale) >= 64; #define KEY_REPEAT_INITIAL_DELAY ((!notAlternateThrottle) ? (16) : (64)) // must be >= 0 and <= 255 #define KEY_REPEAT_REPEATING_DELAY (6) // must be >= 1 and <= 255 #define KEY_JUST_DOWN_DURATION (1) // must be >= 1 and <= 255 // AnS: changed to 1 to disallow unwanted hits of e.g. F1 after pressing Shift+F1 and quickly releasing Shift for(int i = 0 ; i < 256 ; i++) if(tk[i]) if(keys_nr[i] < 255) keys_nr[i]++; // activate key, and count up for repeat else keys_nr[i] = 255 - KEY_REPEAT_REPEATING_DELAY; // oscillate for repeat else keys_nr[i] = 0; // deactivate key memcpy(keys,keys_nr,sizeof(keys)); // key-down detection for(int i = 0 ; i < 256 ; i++) if(!keys_nr[i]) { keys_jd[i] = 0; keys_jd_lock[i] = 0; } else if(keys_jd_lock[i]) {} else if(keys_jd[i] /*&& (i != 0x2A && i != 0x36 && i != 0x1D && i != 0x38)*/) { if(++keys_jd[i] > KEY_JUST_DOWN_DURATION) { keys_jd[i] = 0; keys_jd_lock[i] = 1; } } else keys_jd[i] = 1; // key repeat for(int i = 0 ; i < 256 ; i++) if((int)keys[i] >= KEY_REPEAT_INITIAL_DELAY && !(keys[i]%KEY_REPEAT_REPEATING_DELAY)) keys[i] = 0; extern uint8 autoHoldOn, autoHoldReset; autoHoldOn = autoHoldKey && keys[autoHoldKey] != 0; autoHoldReset = autoHoldClearKey && keys[autoHoldClearKey] != 0; } unsigned int *GetKeyboard(void) { return(keys); } unsigned int *GetKeyboard_nr(void) { return(keys_nr); } unsigned int *GetKeyboard_jd(void) { return(keys_jd); } int KeyboardInitialize(void) { if(lpdid) return(1); //mbg merge 7/17/06 changed: ddrval=IDirectInput7_CreateDeviceEx(lpDI, GUID_SysKeyboard,IID_IDirectInputDevice7, (LPVOID *)&lpdid,0); //ddrval=IDirectInput7_CreateDeviceEx(lpDI, &GUID_SysKeyboard,&IID_IDirectInputDevice7, (LPVOID *)&lpdid,0); if(ddrval != DI_OK) { FCEUD_PrintError("DirectInput: Error creating keyboard device."); return 0; } ddrval=IDirectInputDevice7_SetCooperativeLevel(lpdid, hAppWnd,(background?DISCL_BACKGROUND:DISCL_FOREGROUND)|DISCL_NONEXCLUSIVE); if(ddrval != DI_OK) { FCEUD_PrintError("DirectInput: Error setting keyboard cooperative level."); return 0; } ddrval=IDirectInputDevice7_SetDataFormat(lpdid,&c_dfDIKeyboard); if(ddrval != DI_OK) { FCEUD_PrintError("DirectInput: Error setting keyboard data format."); return 0; } ////--set to buffered mode //DIPROPDWORD dipdw; //dipdw.diph.dwSize = sizeof(DIPROPDWORD); //dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER); //dipdw.diph.dwObj = 0; //dipdw.diph.dwHow = DIPH_DEVICE; //dipdw.dwData = 64; //ddrval = IDirectInputDevice7_SetProperty(lpdid,DIPROP_BUFFERSIZE, &dipdw.diph); ////-------- ddrval=IDirectInputDevice7_Acquire(lpdid); /* Not really a fatal error. */ //if(ddrval != DI_OK) //{ // FCEUD_PrintError("DirectInput: Error acquiring keyboard."); // return 0; //} return 1; } static bool curr = false; static void UpdateBackgroundAccess(bool on) { if(curr == on) return; curr = on; if(!lpdid) return; ddrval=IDirectInputDevice7_Unacquire(lpdid); if(on) ddrval=IDirectInputDevice7_SetCooperativeLevel(lpdid, hAppWnd,DISCL_BACKGROUND|DISCL_NONEXCLUSIVE); else ddrval=IDirectInputDevice7_SetCooperativeLevel(lpdid, hAppWnd,DISCL_FOREGROUND|DISCL_NONEXCLUSIVE); if(ddrval != DI_OK) { FCEUD_PrintError("DirectInput: Error setting keyboard cooperative level."); return; } ddrval=IDirectInputDevice7_Acquire(lpdid); return; } void KeyboardSetBackgroundAccessBit(int bit) { background |= (1<<bit); UpdateBackgroundAccess(background != 0); } void KeyboardClearBackgroundAccessBit(int bit) { background &= ~(1<<bit); UpdateBackgroundAccess(background != 0); } void KeyboardSetBackgroundAccess(bool on) { if(on) KeyboardSetBackgroundAccessBit(KEYBACKACCESS_OLDSTYLE); else KeyboardClearBackgroundAccessBit(KEYBACKACCESS_OLDSTYLE); }
29.384279
344
0.696983
0965c5446ac766b60de9408cc4e71f3c7dc6ced4
8,639
cc
C++
instrument.cc
eryjus/instrumentation
82c6e211b4b263c0beece904b615a8817681f6ac
[ "Beerware" ]
null
null
null
instrument.cc
eryjus/instrumentation
82c6e211b4b263c0beece904b615a8817681f6ac
[ "Beerware" ]
null
null
null
instrument.cc
eryjus/instrumentation
82c6e211b4b263c0beece904b615a8817681f6ac
[ "Beerware" ]
null
null
null
//=================================================================================================================== // // instrument.cc -- Bochs instrumentation for CenuryOS // ///////////////////////////////////////////////////////////////////////// // $Id: instrument.cc 12655 2015-02-19 20:23:08Z sshwarts $ ///////////////////////////////////////////////////////////////////////// // // Copyright (c) 2006-2015 Stanislav Shwartsman // Written by Stanislav Shwartsman [sshwarts at sourceforge net] // // 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 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 library; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // // ----------------------------------------------------------------------------------------------------------------- // // Date Tracker Version Pgmr Description // ----------- ------- ------- ---- --------------------------------------------------------------------------- // 2020-Jan-11 Initial v0.0.1 ADCL Initial version -- copied from bochs-2.6.11/instrument/example1 // //=================================================================================================================== #include <stdint.h> #include <assert.h> #include "bochs.h" #include "cpu/cpu.h" #include "disasm/disasm.h" bxInstrumentation *icpu = NULL; static disassembler bx_disassembler; static logfunctions *instrument_log = new logfunctions (); #define LOG_THIS instrument_log-> void bx_instr_init_env(void) {} void bx_instr_exit_env(void) {} void bx_instr_initialize(unsigned cpu) { assert(cpu < BX_SMP_PROCESSORS); if (icpu == NULL) icpu = new bxInstrumentation[BX_SMP_PROCESSORS]; icpu[cpu].set_cpu_id(cpu); BX_INFO(("Initialize cpu %u", cpu)); } void bxInstrumentation::bx_instr_reset(unsigned type) { ready = is_branch = 0; num_data_accesses = 0; active = 0; } void bxInstrumentation::bx_print_instruction(void) { char disasm_tbuf[512]; // buffer for instruction disassembly char opcode_hex[100] = {0}; // buffer for the instruction hex char buf[5]; // buffer for sprintf bx_disassembler.disasm(is32, is64, 0, 0, opcode, disasm_tbuf); if(opcode_length != 0) { unsigned n; BX_INFO(("----------------------------------------------------------")); BX_INFO(("CPU %d at %p: %s (reg results):", cpu_id, eipSave, disasm_tbuf)); for(n=0;n < opcode_length;n++) { sprintf(buf, "%02x", opcode[n]); strcat(opcode_hex, buf); } BX_INFO(("LEN %d\tBYTES: %s", opcode_length, opcode_hex)); BX_INFO((" EAX: 0x%08.8x; EBX: 0x%08.8x; ECX 0x%08.8x; EDX: 0x%08.8x", BX_CPU(cpu_id)->gen_reg[0].dword.erx, BX_CPU(cpu_id)->gen_reg[3].dword.erx, BX_CPU(cpu_id)->gen_reg[1].dword.erx, BX_CPU(cpu_id)->gen_reg[2].dword.erx)); BX_INFO((" ESP: 0x%08.8x; EBP: 0x%08.8x; ESI 0x%08.8x; EDI: 0x%08.8x", BX_CPU(cpu_id)->gen_reg[4].dword.erx, BX_CPU(cpu_id)->gen_reg[5].dword.erx, BX_CPU(cpu_id)->gen_reg[6].dword.erx, BX_CPU(cpu_id)->gen_reg[7].dword.erx)); BX_INFO((" CS: 0x%04.4x; DS: 0x%04.4x; ES: 0x%04.4x; FS: 0x%04.4x; GS: 0x%04.4x; SS: 0x%04.4x; ", BX_CPU(cpu_id)->sregs[BX_SEG_REG_CS].selector.value, BX_CPU(cpu_id)->sregs[BX_SEG_REG_DS].selector.value, BX_CPU(cpu_id)->sregs[BX_SEG_REG_ES].selector.value, BX_CPU(cpu_id)->sregs[BX_SEG_REG_FS].selector.value, BX_CPU(cpu_id)->sregs[BX_SEG_REG_GS].selector.value, BX_CPU(cpu_id)->sregs[BX_SEG_REG_SS].selector.value)); uint32_t flags = BX_CPU(cpu_id)->eflags; BX_INFO((" EFLAGS: %08.8p (%s %s %s %s %s %s %s IOPL=%d %s %s %s %s %s %s %s %s %s)", flags, (flags&(1<<21)?"ID":"id"), (flags&(1<<20)?"VIP":"vip"), (flags&(1<<19)?"VIF":"vif"), (flags&(1<<18)?"AC":"ac"), (flags&(1<<17)?"VM":"vm"), (flags&(1<<16)?"RF":"rf"), (flags&(1<<14)?"NT":"nt"), (flags>>12) & 3, (flags&(1<<11)?"OF":"of"), (flags&(1<<10)?"DF":"df"), (flags&(1<< 9)?"IF":"if"), (flags&(1<< 8)?"TF":"tf"), (flags&(1<< 7)?"SF":"sf"), (flags&(1<< 6)?"ZF":"zf"), (flags&(1<< 4)?"AF":"af"), (flags&(1<< 2)?"PF":"pf"), (flags&(1<< 0)?"CF":"cf") )); if(is_branch) { if(is_taken) BX_INFO(("\tBRANCH TARGET " FMT_ADDRX " (TAKEN)", target_linear)); else BX_INFO(("\tBRANCH (NOT TAKEN)")); } for(n=0;n < num_data_accesses;n++) { BX_INFO(("MEM ACCESS[%u]: 0x" FMT_ADDRX " (linear) 0x" FMT_PHY_ADDRX " (physical) %s SIZE: %d", n, data_access[n].laddr, data_access[n].paddr, data_access[n].rw == BX_READ ? "RD":"WR", data_access[n].size)); } } } void bxInstrumentation::bx_instr_before_execution(bxInstruction_c *i) { eipSave = BX_CPU(cpu_id)->gen_reg[BX_32BIT_REG_EIP].dword.erx; // // -- check if we have `xchg edx,edx` and if so we will toggle the active flag // ------------------------------------------------------------------------ if (i->get_opcode_bytes()[0] == 0x87 && i->get_opcode_bytes()[1] == 0xd2) { toggle_active(); if (is_active()) { BX_INFO(("Instrumentation is now ON")); } else { BX_INFO(("Instrumentation is now off")); } } if (!active) return; if (ready) bx_print_instruction(); // prepare instruction_t structure for new instruction ready = 1; num_data_accesses = 0; is_branch = 0; is32 = BX_CPU(cpu_id)->sregs[BX_SEG_REG_CS].cache.u.segment.d_b; is64 = BX_CPU(cpu_id)->long64_mode(); opcode_length = i->ilen(); memcpy(opcode, i->get_opcode_bytes(), opcode_length); } void bxInstrumentation::bx_instr_after_execution(bxInstruction_c *i) { if (!active) return; if (ready) { bx_print_instruction(); ready = 0; } } void bxInstrumentation::branch_taken(bx_address new_eip) { if (!active || !ready) return; is_branch = 1; is_taken = 1; // find linear address target_linear = BX_CPU(cpu_id)->get_laddr(BX_SEG_REG_CS, new_eip); } void bxInstrumentation::bx_instr_cnear_branch_taken(bx_address branch_eip, bx_address new_eip) { branch_taken(new_eip); } void bxInstrumentation::bx_instr_cnear_branch_not_taken(bx_address branch_eip) { if (!active || !ready) return; is_branch = 1; is_taken = 0; } void bxInstrumentation::bx_instr_ucnear_branch(unsigned what, bx_address branch_eip, bx_address new_eip) { branch_taken(new_eip); } void bxInstrumentation::bx_instr_far_branch(unsigned what, Bit16u prev_cs, bx_address prev_eip, Bit16u new_cs, bx_address new_eip) { branch_taken(new_eip); } void bxInstrumentation::bx_instr_interrupt(unsigned vector) { if(active) { BX_INFO(("CPU %u: interrupt %02xh", cpu_id, vector)); } } void bxInstrumentation::bx_instr_exception(unsigned vector, unsigned error_code) { if(active) { BX_INFO(("CPU %u: exception %02xh error_code=%x", cpu_id, vector, error_code)); BX_CPU_C *cpu; #if BX_SUPPORT_SMP cpu = bx_cpu_array[cpu_id]; #else cpu = &bx_cpu; #endif cpu->debug(0); } } void bxInstrumentation::bx_instr_hwinterrupt(unsigned vector, Bit16u cs, bx_address eip) { if(active) { BX_INFO(("CPU %u: hardware interrupt %02xh", cpu_id, vector)); } } void bxInstrumentation::bx_instr_lin_access(bx_address lin, bx_phy_address phy, unsigned len, unsigned memtype, unsigned rw) { if(!active || !ready) return; if (num_data_accesses < MAX_DATA_ACCESSES) { data_access[num_data_accesses].laddr = lin; data_access[num_data_accesses].paddr = phy; data_access[num_data_accesses].rw = rw; data_access[num_data_accesses].size = len; data_access[num_data_accesses].memtype = memtype; num_data_accesses++; } }
31.878229
130
0.573793
09661d776586905743293e00b25c523c21f0b200
3,792
cpp
C++
RTIDPRR/Source/Graphics/Core/Buffer.cpp
brunosegiu/RTIDPRR
d7daef7611899db4e23ba6a2b5a91135c57e0871
[ "MIT" ]
3
2020-12-06T02:22:48.000Z
2021-06-24T13:52:10.000Z
RTIDPRR/Source/Graphics/Core/Buffer.cpp
brunosegiu/RTIDPRR
d7daef7611899db4e23ba6a2b5a91135c57e0871
[ "MIT" ]
null
null
null
RTIDPRR/Source/Graphics/Core/Buffer.cpp
brunosegiu/RTIDPRR
d7daef7611899db4e23ba6a2b5a91135c57e0871
[ "MIT" ]
1
2021-10-13T10:36:36.000Z
2021-10-13T10:36:36.000Z
#include "Buffer.h" #include "Command.h" #include "Context.h" #include "DeviceMemory.h" using namespace RTIDPRR::Graphics; Buffer::Buffer(const vk::DeviceSize& size, const vk::BufferUsageFlags& usage, const vk::MemoryPropertyFlags& memoryProperties) : mSize(size) { const Device& device = Context::get().getDevice(); vk::BufferCreateInfo bufferCreateInfo = vk::BufferCreateInfo().setSize(size).setUsage(usage).setSharingMode( vk::SharingMode::eExclusive); mBuffer = RTIDPRR_ASSERT_VK( device.getLogicalDeviceHandle().createBuffer(bufferCreateInfo)); vk::MemoryRequirements memRequirements = device.getLogicalDeviceHandle().getBufferMemoryRequirements(mBuffer); vk::MemoryAllocateInfo memAllocInfo = vk::MemoryAllocateInfo() .setAllocationSize(memRequirements.size) .setMemoryTypeIndex(DeviceMemory::findMemoryIndex( memRequirements.memoryTypeBits, memoryProperties)); mMemory = RTIDPRR_ASSERT_VK( device.getLogicalDeviceHandle().allocateMemory(memAllocInfo)); RTIDPRR_ASSERT_VK( device.getLogicalDeviceHandle().bindBufferMemory(mBuffer, mMemory, 0)); mPMapped = nullptr; } Buffer::Buffer(Buffer&& other) : mBuffer(std::move(other.mBuffer)), mMemory(std::move(other.mMemory)), mSize(std::move(other.mSize)) { other.mBuffer = nullptr; other.mMemory = nullptr; } const vk::DeviceSize Buffer::sInvalidSize = static_cast<vk::DeviceSize>(-1); void Buffer::update(const void* value, const vk::DeviceSize& offset, const vk::DeviceSize& size) { const Device& device = Context::get().getDevice(); vk::DeviceSize effectiveSize = size == Buffer::sInvalidSize ? mSize : size; void* data = RTIDPRR_ASSERT_VK(device.getLogicalDeviceHandle().mapMemory( mMemory, offset, effectiveSize, vk::MemoryMapFlags{})); memcpy(data, value, effectiveSize); device.getLogicalDeviceHandle().unmapMemory(mMemory); } void* Buffer::map() { if (!mPMapped) { const Device& device = Context::get().getDevice(); mPMapped = RTIDPRR_ASSERT_VK(device.getLogicalDeviceHandle().mapMemory( mMemory, 0, mSize, vk::MemoryMapFlags{})); } return mPMapped; } void Buffer::unmap() { const Device& device = Context::get().getDevice(); device.getLogicalDeviceHandle().unmapMemory(mMemory); mPMapped = nullptr; } void Buffer::copyInto(Buffer& other) { const Device& device = Context::get().getDevice(); const Queue& graphicsQueue = device.getGraphicsQueue(); Command* command = Context::get().getCommandPool().allocateGraphicsCommand(); // Copy vk::CommandBufferBeginInfo commandBeginInfo = vk::CommandBufferBeginInfo().setFlags( vk::CommandBufferUsageFlagBits::eOneTimeSubmit); RTIDPRR_ASSERT_VK(command->begin(commandBeginInfo)); vk::BufferCopy copyRegion = vk::BufferCopy().setSrcOffset(0).setDstOffset(0).setSize(mSize); command->copyBuffer(mBuffer, other.mBuffer, copyRegion); RTIDPRR_ASSERT_VK(command->end()); vk::SubmitInfo submitInfo = vk::SubmitInfo().setCommandBuffers( *static_cast<vk::CommandBuffer*>(command)); vk::FenceCreateInfo fenceCreateInfo = vk::FenceCreateInfo(); vk::Fence waitFence = RTIDPRR_ASSERT_VK( device.getLogicalDeviceHandle().createFence(fenceCreateInfo)); graphicsQueue.submit(submitInfo, waitFence); vk::Result copyRes = device.getLogicalDeviceHandle().waitForFences( waitFence, true, std::numeric_limits<uint64_t>::max()); RTIDPRR_ASSERT(copyRes == vk::Result::eSuccess); device.getLogicalDeviceHandle().destroyFence(waitFence); } Buffer::~Buffer() { const Device& device = Context::get().getDevice(); device.getLogicalDeviceHandle().destroyBuffer(mBuffer); device.getLogicalDeviceHandle().freeMemory(mMemory); }
36.461538
79
0.726002
096a3969d7f748663f63ee71124263026f3bfee6
513
cpp
C++
codeshef/CIN011.cpp
sonuKumar03/data-structure-and-algorithm
d1fd3cad494cbcc91ce7ff37ec611752369b50b6
[ "MIT" ]
null
null
null
codeshef/CIN011.cpp
sonuKumar03/data-structure-and-algorithm
d1fd3cad494cbcc91ce7ff37ec611752369b50b6
[ "MIT" ]
null
null
null
codeshef/CIN011.cpp
sonuKumar03/data-structure-and-algorithm
d1fd3cad494cbcc91ce7ff37ec611752369b50b6
[ "MIT" ]
null
null
null
#include<iostream> #include<queue> #include<vector> #include<algorithm> #include<fstream> #include<climits> #include<math.h> using namespace std; typedef long long ll ; void solve(){ ll n ; cin>>n; ll *roses = new ll[n]; for(int i =0;i<n;i++){ cin>>roses[i]; } ll happiness = -1; for(int i =0;i<n;i++){ int t = roses[i] + happiness; if(t>happiness){ happiness = t; } } cout<<happiness<<endl; } int main() { ll t; cin>>t; while(t--){ solve(); } return 0; }
14.25
33
0.569201
096f6455e70034e7bad0407873ba591b77351925
18,237
cpp
C++
PersistentStore/SqliteStore.cpp
MFransen69/rdkservices
ce13efeb95779bc04c20e69be5fe86fd8565a6c6
[ "BSD-2-Clause" ]
null
null
null
PersistentStore/SqliteStore.cpp
MFransen69/rdkservices
ce13efeb95779bc04c20e69be5fe86fd8565a6c6
[ "BSD-2-Clause" ]
null
null
null
PersistentStore/SqliteStore.cpp
MFransen69/rdkservices
ce13efeb95779bc04c20e69be5fe86fd8565a6c6
[ "BSD-2-Clause" ]
null
null
null
/* * If not stated otherwise in this file or this component's LICENSE file the * following copyright and licenses apply: * * Copyright 2022 RDK Management * * 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 "SqliteStore.h" #include "UtilsLogging.h" #include <sqlite3.h> #if defined(USE_PLABELS) #include "pbnj_utils.hpp" #include <glib.h> #endif #ifndef SQLITE_FILE_HEADER #define SQLITE_FILE_HEADER "SQLite format 3" #endif #define SQLITE *(sqlite3**)&_data #define SQLITE_IS_ERROR_DBWRITE(rc) (rc == SQLITE_READONLY || rc == SQLITE_CORRUPT) namespace { #if defined(USE_PLABELS) bool GenerateKey(const char *key, std::vector<uint8_t> &pKey) { // NOTE: pbnj_utils stores the nonce under XDG_DATA_HOME/data. // If the dir doesn't exist it will fail auto path = g_build_filename(g_get_user_data_dir(), "data", nullptr); if (!Core::File(string(path)).Exists()) g_mkdir_with_parents(path, 0755); g_free(path); return pbnj_utils::prepareBufferForOrigin(key, [&pKey](const std::vector<uint8_t> &buffer) { pKey = buffer; }); } #endif } namespace WPEFramework { namespace Plugin { SqliteStore::SqliteStore() : _data(nullptr), _path(), _key(), _maxSize(0), _maxValue(0), _clients(), _clientLock(), _lock() { } uint32_t SqliteStore::Register(Exchange::IStore::INotification *notification) { Core::SafeSyncType<Core::CriticalSection> lock(_clientLock); ASSERT(std::find(_clients.begin(), _clients.end(), notification) == _clients.end()); notification->AddRef(); _clients.push_back(notification); return Core::ERROR_NONE; } uint32_t SqliteStore::Unregister(Exchange::IStore::INotification *notification) { Core::SafeSyncType<Core::CriticalSection> lock(_clientLock); std::list<Exchange::IStore::INotification *>::iterator index(std::find(_clients.begin(), _clients.end(), notification)); ASSERT(index != _clients.end()); if (index != _clients.end()) { notification->Release(); _clients.erase(index); } return Core::ERROR_NONE; } uint32_t SqliteStore::Open(const string &path, const string &key, uint32_t maxSize, uint32_t maxValue) { CountingLockSync lock(_lock, 0); if (IsOpen()) { // Seems open! return Core::ERROR_ILLEGAL_STATE; } Close(); _path = path; _key = key; _maxSize = maxSize; _maxValue = maxValue; #if defined(SQLITE_HAS_CODEC) bool shouldEncrypt = !key.empty(); bool shouldReKey = shouldEncrypt && IsValid() && !IsEncrypted(); std::vector<uint8_t> pKey; if (shouldEncrypt) { #if defined(USE_PLABELS) if (!GenerateKey(key.c_str(), pKey)) { LOGERR("pbnj_utils fail"); Close(); return Core::ERROR_GENERAL; } #else LOGWARN("Key is not secure"); pKey = std::vector<uint8_t>(key.begin(), key.end()); #endif } #endif sqlite3* &db = SQLITE; int rc = sqlite3_open(path.c_str(), &db); if (rc != SQLITE_OK) { LOGERR("%d : %s", rc, sqlite3_errstr(rc)); Close(); return Core::ERROR_OPENING_FAILED; } #if defined(SQLITE_HAS_CODEC) if (shouldEncrypt) { rc = Encrypt(pKey); if (rc != SQLITE_OK) { LOGERR("Failed to attach key - %s", sqlite3_errstr(rc)); Close(); return Core::ERROR_GENERAL; } } #endif rc = CreateTables(); #if defined(SQLITE_HAS_CODEC) if (rc == SQLITE_NOTADB && shouldEncrypt && !shouldReKey // re-key should never fail ) { LOGWARN("The key doesn't work"); Close(); if (!Core::File(path).Destroy() || IsValid()) { LOGERR("Can't remove file"); return Core::ERROR_DESTRUCTION_FAILED; } sqlite3* &db = SQLITE; rc = sqlite3_open(path.c_str(), &db); if (rc != SQLITE_OK) { LOGERR("Can't create file"); return Core::ERROR_OPENING_FAILED; } LOGWARN("SQLite database has been reset, trying re-key"); rc = Encrypt(pKey); if (rc != SQLITE_OK) { LOGERR("Failed to attach key - %s", sqlite3_errstr(rc)); Close(); return Core::ERROR_GENERAL; } rc = CreateTables(); } #endif return Core::ERROR_NONE; } uint32_t SqliteStore::SetValue(const string &ns, const string &key, const string &value) { if (ns.size() > _maxValue || key.size() > _maxValue || value.size() > _maxValue) { return Core::ERROR_INVALID_INPUT_LENGTH; } uint32_t result = Core::ERROR_GENERAL; int retry = 0; int rc; do { CountingLockSync lock(_lock); sqlite3* &db = SQLITE; if (!db) break; sqlite3_stmt *stmt; sqlite3_prepare_v2(db, "SELECT sum(s) FROM (" " SELECT sum(length(key)+length(value)) s FROM item" " UNION ALL" " SELECT sum(length(name)) s FROM namespace" ");", -1, &stmt, nullptr); rc = sqlite3_step(stmt); if (rc == SQLITE_ROW) { int64_t size = sqlite3_column_int64(stmt, 0); if (size > _maxSize) { LOGWARN("max size exceeded: %ld", size); result = Core::ERROR_WRITE_ERROR; } else { result = Core::ERROR_NONE; } } else LOGERR("ERROR getting size: %s", sqlite3_errstr(rc)); sqlite3_finalize(stmt); if (result == Core::ERROR_NONE) { sqlite3_stmt *stmt; sqlite3_prepare_v2(db, "INSERT OR IGNORE INTO namespace (name) values (?);", -1, &stmt, nullptr); sqlite3_bind_text(stmt, 1, ns.c_str(), -1, SQLITE_TRANSIENT); rc = sqlite3_step(stmt); if (rc != SQLITE_DONE) { LOGERR("ERROR inserting data: %s", sqlite3_errstr(rc)); result = Core::ERROR_GENERAL; } sqlite3_finalize(stmt); } if (result == Core::ERROR_NONE) { sqlite3_stmt *stmt; sqlite3_prepare_v2(db, "INSERT INTO item (ns,key,value)" " SELECT id, ?, ?" " FROM namespace" " WHERE name = ?" ";", -1, &stmt, nullptr); sqlite3_bind_text(stmt, 1, key.c_str(), -1, SQLITE_TRANSIENT); sqlite3_bind_text(stmt, 2, value.c_str(), -1, SQLITE_TRANSIENT); sqlite3_bind_text(stmt, 3, ns.c_str(), -1, SQLITE_TRANSIENT); rc = sqlite3_step(stmt); if (rc != SQLITE_DONE) { LOGERR("ERROR inserting data: %s", sqlite3_errstr(rc)); result = Core::ERROR_GENERAL; } else { ValueChanged(ns, key, value); } sqlite3_finalize(stmt); } } while ((result != Core::ERROR_NONE) && SQLITE_IS_ERROR_DBWRITE(rc) && (++retry < 2) && (Open(_path, _key, _maxSize, _maxValue) == Core::ERROR_NONE)); if (result == Core::ERROR_NONE) { CountingLockSync lock(_lock); sqlite3* &db = SQLITE; sqlite3_stmt *stmt; sqlite3_prepare_v2(db, "SELECT sum(s) FROM (" " SELECT sum(length(key)+length(value)) s FROM item" " UNION ALL" " SELECT sum(length(name)) s FROM namespace" ");", -1, &stmt, nullptr); rc = sqlite3_step(stmt); if (rc == SQLITE_ROW) { int64_t size = sqlite3_column_int64(stmt, 0); if (size > _maxSize) { LOGWARN("max size exceeded: %ld", size); StorageExceeded(); } } else LOGERR("ERROR getting size: %s", sqlite3_errstr(rc)); sqlite3_finalize(stmt); } return result; } uint32_t SqliteStore::GetValue(const string &ns, const string &key, string &value) { uint32_t result = Core::ERROR_GENERAL; CountingLockSync lock(_lock); sqlite3* &db = SQLITE; if (db) { sqlite3_stmt *stmt; sqlite3_prepare_v2(db, "SELECT value" " FROM item" " INNER JOIN namespace ON namespace.id = item.ns" " where name = ? and key = ?" ";", -1, &stmt, nullptr); sqlite3_bind_text(stmt, 1, ns.c_str(), -1, SQLITE_TRANSIENT); sqlite3_bind_text(stmt, 2, key.c_str(), -1, SQLITE_TRANSIENT); int rc = sqlite3_step(stmt); if (rc == SQLITE_ROW) { value = (const char *) sqlite3_column_text(stmt, 0); result = Core::ERROR_NONE; } else LOGWARN("not found: %d", rc); sqlite3_finalize(stmt); } return result; } uint32_t SqliteStore::DeleteKey(const string &ns, const string &key) { uint32_t result = Core::ERROR_GENERAL; int retry = 0; int rc; do { CountingLockSync lock(_lock); sqlite3* &db = SQLITE; if (!db) break; sqlite3_stmt *stmt; sqlite3_prepare_v2(db, "DELETE FROM item" " where ns in (select id from namespace where name = ?)" " and key = ?" ";", -1, &stmt, NULL); sqlite3_bind_text(stmt, 1, ns.c_str(), -1, SQLITE_TRANSIENT); sqlite3_bind_text(stmt, 2, key.c_str(), -1, SQLITE_TRANSIENT); rc = sqlite3_step(stmt); if (rc != SQLITE_DONE) LOGERR("ERROR removing data: %s", sqlite3_errstr(rc)); else result = Core::ERROR_NONE; sqlite3_finalize(stmt); } while ((result != Core::ERROR_NONE) && SQLITE_IS_ERROR_DBWRITE(rc) && (++retry < 2) && (Open(_path, _key, _maxSize, _maxValue) == Core::ERROR_NONE)); return result; } uint32_t SqliteStore::DeleteNamespace(const string &ns) { uint32_t result = Core::ERROR_GENERAL; int retry = 0; int rc; do { CountingLockSync lock(_lock); sqlite3* &db = SQLITE; if (!db) break; sqlite3_stmt *stmt; sqlite3_prepare_v2(db, "DELETE FROM namespace where name = ?;", -1, &stmt, NULL); sqlite3_bind_text(stmt, 1, ns.c_str(), -1, SQLITE_TRANSIENT); rc = sqlite3_step(stmt); if (rc != SQLITE_DONE) LOGERR("ERROR removing data: %s", sqlite3_errstr(rc)); else result = Core::ERROR_NONE; sqlite3_finalize(stmt); } while ((result != Core::ERROR_NONE) && SQLITE_IS_ERROR_DBWRITE(rc) && (++retry < 2) && (Open(_path, _key, _maxSize, _maxValue) == Core::ERROR_NONE)); return result; } uint32_t SqliteStore::GetKeys(const string &ns, std::vector<string> &keys) { uint32_t result = Core::ERROR_GENERAL; CountingLockSync lock(_lock); sqlite3* &db = SQLITE; keys.clear(); if (db) { sqlite3_stmt *stmt; sqlite3_prepare_v2(db, "SELECT key" " FROM item" " where ns in (select id from namespace where name = ?)" ";", -1, &stmt, NULL); sqlite3_bind_text(stmt, 1, ns.c_str(), -1, SQLITE_TRANSIENT); while (sqlite3_step(stmt) == SQLITE_ROW) keys.push_back((const char *) sqlite3_column_text(stmt, 0)); sqlite3_finalize(stmt); result = Core::ERROR_NONE; } return result; } uint32_t SqliteStore::GetNamespaces(std::vector<string> &namespaces) { uint32_t result = Core::ERROR_GENERAL; CountingLockSync lock(_lock); sqlite3* &db = SQLITE; namespaces.clear(); if (db) { sqlite3_stmt *stmt; sqlite3_prepare_v2(db, "SELECT name FROM namespace;", -1, &stmt, NULL); while (sqlite3_step(stmt) == SQLITE_ROW) namespaces.push_back((const char *) sqlite3_column_text(stmt, 0)); sqlite3_finalize(stmt); result = Core::ERROR_NONE; } return result; } uint32_t SqliteStore::GetStorageSize(std::map<string, uint64_t> &namespaceSizes) { uint32_t result = Core::ERROR_GENERAL; CountingLockSync lock(_lock); sqlite3* &db = SQLITE; namespaceSizes.clear(); if (db) { sqlite3_stmt *stmt; sqlite3_prepare_v2(db, "SELECT name, sum(length(key)+length(value))" " FROM item" " INNER JOIN namespace ON namespace.id = item.ns" " GROUP BY name" ";", -1, &stmt, NULL); while (sqlite3_step(stmt) == SQLITE_ROW) namespaceSizes[(const char *) sqlite3_column_text(stmt, 0)] = sqlite3_column_int(stmt, 1); sqlite3_finalize(stmt); result = Core::ERROR_NONE; } return result; } uint32_t SqliteStore::FlushCache() { uint32_t result = Core::ERROR_GENERAL; CountingLockSync lock(_lock); sqlite3* &db = SQLITE; if (db) { int rc = sqlite3_db_cacheflush(db); if (rc != SQLITE_OK) { LOGERR("Error while flushing sqlite database cache: %d", rc); } else { result = Core::ERROR_NONE; } } sync(); return result; } uint32_t SqliteStore::Term() { CountingLockSync lock(_lock, 0); Close(); return Core::ERROR_NONE; } void SqliteStore::ValueChanged(const string &ns, const string &key, const string &value) { Core::SafeSyncType<Core::CriticalSection> lock(_clientLock); std::list<Exchange::IStore::INotification *>::iterator index(_clients.begin()); while (index != _clients.end()) { (*index)->ValueChanged(ns, key, value); index++; } } void SqliteStore::StorageExceeded() { Core::SafeSyncType<Core::CriticalSection> lock(_clientLock); std::list<Exchange::IStore::INotification *>::iterator index(_clients.begin()); while (index != _clients.end()) { (*index)->StorageExceeded(); index++; } } int SqliteStore::Encrypt(const std::vector<uint8_t> &key) { int rc = SQLITE_OK; #if defined(SQLITE_HAS_CODEC) sqlite3* &db = SQLITE; bool shouldReKey = !IsEncrypted(); if (!shouldReKey) { rc = sqlite3_key_v2(db, nullptr, key.data(), key.size()); } else { rc = sqlite3_rekey_v2(db, nullptr, key.data(), key.size()); if (rc == SQLITE_OK) Vacuum(); } if (shouldReKey && !IsEncrypted()) { LOGERR("SQLite database file is clear after re-key"); } #endif return rc; } int SqliteStore::CreateTables() { sqlite3* &db = SQLITE; char *errmsg; int rc = sqlite3_exec(db, "CREATE TABLE if not exists namespace (" "id INTEGER PRIMARY KEY," "name TEXT UNIQUE" ");", 0, 0, &errmsg); if (rc != SQLITE_OK || errmsg) { if (errmsg) { LOGERR("%d : %s", rc, errmsg); sqlite3_free(errmsg); } else LOGERR("%d", rc); return rc; } rc = sqlite3_exec(db, "CREATE TABLE if not exists item (" "ns INTEGER," "key TEXT," "value TEXT," "FOREIGN KEY(ns) REFERENCES namespace(id) ON DELETE CASCADE ON UPDATE NO ACTION," "UNIQUE(ns,key) ON CONFLICT REPLACE" ");", 0, 0, &errmsg); if (rc != SQLITE_OK || errmsg) { if (errmsg) { LOGERR("%d : %s", rc, errmsg); sqlite3_free(errmsg); } else LOGERR("%d", rc); return rc; } rc = sqlite3_exec(db, "PRAGMA foreign_keys = ON;", 0, 0, &errmsg); if (rc != SQLITE_OK || errmsg) { if (errmsg) { LOGERR("%d : %s", rc, errmsg); sqlite3_free(errmsg); } else LOGERR("%d", rc); return rc; } return SQLITE_OK; } int SqliteStore::Vacuum() { sqlite3* &db = SQLITE; char *errmsg; int rc = sqlite3_exec(db, "VACUUM", 0, 0, &errmsg); if (rc != SQLITE_OK || errmsg) { if (errmsg) { LOGERR("%s", errmsg); sqlite3_free(errmsg); } else { LOGERR("%d", rc); } return rc; } return SQLITE_OK; } int SqliteStore::Close() { sqlite3* &db = SQLITE; if (db) { int rc = sqlite3_db_cacheflush(db); if (rc != SQLITE_OK) { LOGERR("Error while flushing sqlite database cache: %d", rc); } sqlite3_close_v2(db); } db = nullptr; return SQLITE_OK; } bool SqliteStore::IsOpen() const { sqlite3* &db = SQLITE; return (db && IsValid()); } bool SqliteStore::IsValid() const { return (Core::File(_path).Exists()); } bool SqliteStore::IsEncrypted() const { bool result = false; Core::File file(_path); if (file.Exists() && file.Open(true)) { const uint32_t bufLen = strlen(SQLITE_FILE_HEADER); char buffer[bufLen]; result = (file.Read(reinterpret_cast<uint8_t *>(buffer), bufLen) != bufLen) || (::memcmp(buffer, SQLITE_FILE_HEADER, bufLen) != 0); } return result; } } // namespace Plugin } // namespace WPEFramework
25.119835
109
0.551132
09705a8a905f583738cbc53fc70fa2e3c0205846
136
cpp
C++
test/llvm_test_code/linear_constant/call_10.cpp
janniclas/phasar
324302ae96795e6f0a065c14d4f7756b1addc2a4
[ "MIT" ]
1
2022-02-15T07:56:29.000Z
2022-02-15T07:56:29.000Z
test/llvm_test_code/linear_constant/call_10.cpp
fabianbs96/phasar
5b8acd046d8676f72ce0eb85ca20fdb0724de444
[ "MIT" ]
null
null
null
test/llvm_test_code/linear_constant/call_10.cpp
fabianbs96/phasar
5b8acd046d8676f72ce0eb85ca20fdb0724de444
[ "MIT" ]
null
null
null
void bar(int b) {} void foo(int a) { // clang-format off bar(a); } // clang-format on int main() { int i; foo(2); return 0; }
11.333333
37
0.551471
097198218d7ba6feaff553a04757aefc9ada1651
5,030
cc
C++
topside/qgc/src/AutoPilotPlugins/AutoPilotPluginManager.cc
slicht-uri/Sandshark-Beta-Lab-
6cff36b227b49b776d13187c307e648d2a52bdae
[ "MIT" ]
null
null
null
topside/qgc/src/AutoPilotPlugins/AutoPilotPluginManager.cc
slicht-uri/Sandshark-Beta-Lab-
6cff36b227b49b776d13187c307e648d2a52bdae
[ "MIT" ]
null
null
null
topside/qgc/src/AutoPilotPlugins/AutoPilotPluginManager.cc
slicht-uri/Sandshark-Beta-Lab-
6cff36b227b49b776d13187c307e648d2a52bdae
[ "MIT" ]
1
2019-10-18T06:25:14.000Z
2019-10-18T06:25:14.000Z
/*===================================================================== QGroundControl Open Source Ground Control Station (c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org> This file is part of the QGROUNDCONTROL project QGROUNDCONTROL 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. QGROUNDCONTROL 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 QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>. ======================================================================*/ /// @file /// @author Don Gagne <don@thegagnes.com> #include "AutoPilotPluginManager.h" #include "PX4/PX4AutoPilotPlugin.h" #include "Generic/GenericAutoPilotPlugin.h" #include "QGCApplication.h" #include "UASManager.h" IMPLEMENT_QGC_SINGLETON(AutoPilotPluginManager, AutoPilotPluginManager) AutoPilotPluginManager::AutoPilotPluginManager(QObject* parent) : QGCSingleton(parent) { UASManagerInterface* uasMgr = UASManager::instance(); Q_ASSERT(uasMgr); // We need to track uas coming and going so that we can instantiate plugins for each uas connect(uasMgr, &UASManagerInterface::UASCreated, this, &AutoPilotPluginManager::_uasCreated); connect(uasMgr, &UASManagerInterface::UASDeleted, this, &AutoPilotPluginManager::_uasDeleted); } AutoPilotPluginManager::~AutoPilotPluginManager() { #ifdef QT_DEBUG foreach(MAV_AUTOPILOT mavType, _pluginMap.keys()) { Q_ASSERT_X(_pluginMap[mavType].count() == 0, "AutoPilotPluginManager", "LinkManager::_shutdown should have already closed all uas"); } #endif _pluginMap.clear(); PX4AutoPilotPlugin::clearStaticData(); GenericAutoPilotPlugin::clearStaticData(); } /// Create the plugin for this uas void AutoPilotPluginManager::_uasCreated(UASInterface* uas) { Q_ASSERT(uas); MAV_AUTOPILOT autopilotType = static_cast<MAV_AUTOPILOT>(uas->getAutopilotType()); int uasId = uas->getUASID(); Q_ASSERT(uasId != 0); if (_pluginMap.contains(autopilotType)) { Q_ASSERT_X(!_pluginMap[autopilotType].contains(uasId), "AutoPilotPluginManager", "Either we have duplicate UAS ids, or a UAS was not removed correctly."); } AutoPilotPlugin* plugin; switch (autopilotType) { case MAV_AUTOPILOT_PX4: plugin = new PX4AutoPilotPlugin(uas, this); Q_CHECK_PTR(plugin); _pluginMap[MAV_AUTOPILOT_PX4][uasId] = plugin; break; case MAV_AUTOPILOT_GENERIC: default: plugin = new GenericAutoPilotPlugin(uas, this); Q_CHECK_PTR(plugin); _pluginMap[MAV_AUTOPILOT_GENERIC][uasId] = plugin; } } /// Destroy the plugin associated with this uas void AutoPilotPluginManager::_uasDeleted(UASInterface* uas) { Q_ASSERT(uas); MAV_AUTOPILOT autopilotType = _installedAutopilotType(static_cast<MAV_AUTOPILOT>(uas->getAutopilotType())); int uasId = uas->getUASID(); Q_ASSERT(uasId != 0); Q_ASSERT(_pluginMap.contains(autopilotType)); Q_ASSERT(_pluginMap[autopilotType].contains(uasId)); delete _pluginMap[autopilotType][uasId]; _pluginMap[autopilotType].remove(uasId); } AutoPilotPlugin* AutoPilotPluginManager::getInstanceForAutoPilotPlugin(UASInterface* uas) { Q_ASSERT(uas); MAV_AUTOPILOT autopilotType = _installedAutopilotType(static_cast<MAV_AUTOPILOT>(uas->getAutopilotType())); int uasId = uas->getUASID(); Q_ASSERT(uasId != 0); Q_ASSERT(_pluginMap.contains(autopilotType)); Q_ASSERT(_pluginMap[autopilotType].contains(uasId)); return _pluginMap[autopilotType][uasId]; } QList<AutoPilotPluginManager::FullMode_t> AutoPilotPluginManager::getModes(int autopilotType) const { switch (autopilotType) { case MAV_AUTOPILOT_PX4: return PX4AutoPilotPlugin::getModes(); case MAV_AUTOPILOT_GENERIC: default: return GenericAutoPilotPlugin::getModes(); } } QString AutoPilotPluginManager::getShortModeText(uint8_t baseMode, uint32_t customMode, int autopilotType) const { switch (autopilotType) { case MAV_AUTOPILOT_PX4: return PX4AutoPilotPlugin::getShortModeText(baseMode, customMode); case MAV_AUTOPILOT_GENERIC: default: return GenericAutoPilotPlugin::getShortModeText(baseMode, customMode); } } /// If autopilot is not an installed plugin, returns MAV_AUTOPILOT_GENERIC MAV_AUTOPILOT AutoPilotPluginManager::_installedAutopilotType(MAV_AUTOPILOT autopilot) { return _pluginMap.contains(autopilot) ? autopilot : MAV_AUTOPILOT_GENERIC; }
35.174825
162
0.712326
0973942ad6b4dc43319155d9cb62b01f3c1675d2
4,551
cpp
C++
Source/BlackWolf.Lupus.Core/Cookie.cpp
chronos38/lupus-core
ea5196b1b8663999f0a6fcfb5ee3dc5c01d48f32
[ "MIT" ]
null
null
null
Source/BlackWolf.Lupus.Core/Cookie.cpp
chronos38/lupus-core
ea5196b1b8663999f0a6fcfb5ee3dc5c01d48f32
[ "MIT" ]
null
null
null
Source/BlackWolf.Lupus.Core/Cookie.cpp
chronos38/lupus-core
ea5196b1b8663999f0a6fcfb5ee3dc5c01d48f32
[ "MIT" ]
1
2020-10-03T05:05:03.000Z
2020-10-03T05:05:03.000Z
/** * Copyright (C) 2014 David Wolf <d.wolf@live.at> * * This file is part of Lupus. * 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 "Cookie.h" #include "Version.h" #include <iomanip> #include <sstream> using namespace std; using namespace std::chrono; namespace Lupus { namespace Net { Cookie::Cookie(String name, String value) : mName(name), mValue(value) { } Cookie::Cookie(String name, String value, String path) : mName(name), mValue(value), mPath(path) { } Cookie::Cookie(String name, String value, String path, String domain) : mName(name), mValue(value), mPath(path), mDomain(domain) { } String Cookie::Name() const { return mName; } void Cookie::Name(String value) { mName = value; } String Cookie::Value() const { return mValue; } void Cookie::Value(String value) { mValue = value; } String Cookie::Path() const { return mPath; } void Cookie::Path(String value) { mPath = value; } String Cookie::Domain() const { return mDomain; } void Cookie::Domain(String value) { mDomain = value; } bool Cookie::Expired() const { return mExpired; } void Cookie::Expired(bool value) { mExpired = value; } bool Cookie::HttpOnly() const { return mHttpOnly; } void Cookie::HttpOnly(bool value) { mHttpOnly = value; } bool Cookie::Secure() const { return mSecure; } void Cookie::Secure(bool value) { mSecure = value; } TimePoint Cookie::Expires() const { return mExpires; } void Cookie::Expires(const TimePoint& value) { mExpires = value; } String Cookie::ToString() const { String expires; if (mExpired) { stringstream ss; time_t time = Clock::to_time_t(Clock::now()); tm timetm; memset(&timetm, 0, sizeof(timetm)); localtime_s(&timetm, &time); ss << put_time(&timetm, "%a, %Y-%b-%d %T GMT"); expires += ss.str(); } else if (mExpires != TimePoint::min()) { stringstream ss; time_t time = Clock::to_time_t(mExpires); tm timetm; memset(&timetm, 0, sizeof(timetm)); localtime_s(&timetm, &time); ss << put_time(&timetm, "%a, %Y-%b-%d %T GMT"); expires += ss.str(); } String result = mName + "=" + mValue; result += (expires.IsEmpty() ? "" : ("; expires=" + expires)); result += (mDomain.IsEmpty() ? "" : ("; domain=" + mDomain)); result += (mPath.IsEmpty() ? "" : ("; path=" + mPath)); result += (mSecure ? "; secure" : ""); result += (mHttpOnly ? "; httponly" : ""); return result; } } }
28.267081
80
0.513733
0973f6e50c45617b6a11bd2d0a2cf3d767047959
2,811
cpp
C++
Actions/AddCircAction.cpp
OmarKimo/PaintForKids
21e41401e40d64880679f53efa4bf92fec06e783
[ "MIT" ]
2
2022-01-19T20:39:14.000Z
2022-01-20T08:41:45.000Z
Actions/AddCircAction.cpp
OmarKimo/PaintForKids
21e41401e40d64880679f53efa4bf92fec06e783
[ "MIT" ]
null
null
null
Actions/AddCircAction.cpp
OmarKimo/PaintForKids
21e41401e40d64880679f53efa4bf92fec06e783
[ "MIT" ]
null
null
null
#include "AddCircAction.h" #include "..\Figures\CCircle.h" #include "..\ApplicationManager.h" #include "..\GUI\input.h" #include "..\GUI\Output.h" AddCircAction::AddCircAction(ApplicationManager * pApp):Action(pApp) {} void AddCircAction::ReadActionParameters() { //Get a Pointer to the Input / Output Interfaces Output* pOut = pManager->GetOutput(); Input* pIn = pManager->GetInput(); pOut->PrintMessage("New Circle: Click at Center"); //Read center and store in point Center pIn->GetPointClicked(Center.x, Center.y); pOut->PrintMessage("New Circle: Click at a point on the circle"); //Read a point on the circle and store in point P pIn->GetPointClicked(P.x, P.y); ////////////////// Center.x = (int)((Center.x - pOut->getZoomPoint().x) / pow(2, pOut->getZoomScale()) + pOut->getZoomPoint().x); Center.y = (int)((Center.y - pOut->getZoomPoint().y) / pow(2, pOut->getZoomScale()) + pOut->getZoomPoint().y); P.x = (int)((P.x - pOut->getZoomPoint().x) / pow(2, pOut->getZoomScale()) + pOut->getZoomPoint().x); P.y = (int)((P.y - pOut->getZoomPoint().y) / pow(2, pOut->getZoomScale()) + pOut->getZoomPoint().y); CircGfxInfo.isFilled = pManager->getDefaultFillStatus(); //default is not filled //get drawing, filling colors and pen width from the interface CircGfxInfo.DrawClr = pOut->getCrntDrawColor(); CircGfxInfo.FillClr = pOut->getCrntFillColor(); CircGfxInfo.BorderWdth = pOut->getCrntPenWidth(); pOut->ClearStatusBar(); } //Execute the action void AddCircAction::Execute() { //This action needs to read some parameters first ReadActionParameters(); const int radius = sqrt(pow((P.x-Center.x),2) + pow((P.y-Center.y),2)); //Create a circle with the parameters read from the user CCircle *C = new CCircle(Center, radius, CircGfxInfo); if(!(C->checkLimits())) pManager->GetOutput()->PrintMessage("Error!! You exceeded the limits of drawing area!"); else{ id = pManager->getNextID(); C->setID(id); if(!pManager->AddFigure(C)) pManager->GetOutput()->PrintMessage("Error! You exceeded the number of MAX Figures (200)!"); //Add the circle to the list of figures } } //bool AddCircAction::CanUndo() const //{ // return true; //} // //void AddCircAction::Undo() //{ // pManager->DeleteFigureByID(id); //} // //void AddCircAction::Redo() //{ // //ReadActionParameters(); // // const int radius = sqrt(pow((P.x-Center.x),2) + pow((P.y-Center.y),2)); // // //Create a circle with the parameters read from the user // CCircle *C = new CCircle(Center, radius, CircGfxInfo); // // if(!(C->checkLimits())){ // Output* pOut = pManager->GetOutput(); // pOut->PrintMessage("Error!! You exceeded the limits of drawing area!"); // } // else{ // id = pManager->getNextID(); // C->setID(id); // pManager->AddFigure(C); //Add the circle to the list of figures // } //}
30.225806
162
0.67556
0974d99e8a28272abcf0c40696a6e2b5552958ad
26,425
cpp
C++
src/ARVRInterface.cpp
litiecheng/godot_oculus
c31cd938cbcc12da63ce185158be821b04f1e57c
[ "MIT" ]
1
2020-07-20T13:44:45.000Z
2020-07-20T13:44:45.000Z
src/ARVRInterface.cpp
litiecheng/godot_oculus
c31cd938cbcc12da63ce185158be821b04f1e57c
[ "MIT" ]
null
null
null
src/ARVRInterface.cpp
litiecheng/godot_oculus
c31cd938cbcc12da63ce185158be821b04f1e57c
[ "MIT" ]
null
null
null
//////////////////////////////////////////////////////////////////////////////////////////////// // Our main ARVRInterface code for our Oculus GDNative module // Note, even though this is pure C code, we're using the C++ compiler as // Microsoft never updated their C compiler to understand more modern dialects // and openvr uses pesky things such as namespaces #include "ARVRInterface.h" /////////////////////////////////////////////////////////////////////////////////////////// // first some stuff from the oculus SDK samples... :) static ovrGraphicsLuid GetDefaultAdapterLuid() { ovrGraphicsLuid luid = ovrGraphicsLuid(); #if defined(_WIN32) IDXGIFactory* factory = nullptr; if (SUCCEEDED(CreateDXGIFactory(IID_PPV_ARGS(&factory)))) { IDXGIAdapter* adapter = nullptr; if (SUCCEEDED(factory->EnumAdapters(0, &adapter))) { DXGI_ADAPTER_DESC desc; adapter->GetDesc(&desc); memcpy(&luid, &desc.AdapterLuid, sizeof(luid)); adapter->Release(); } factory->Release(); } #endif return luid; }; static int Compare(const ovrGraphicsLuid& lhs, const ovrGraphicsLuid& rhs) { return memcmp(&lhs, &rhs, sizeof(ovrGraphicsLuid)); } TextureBuffer::TextureBuffer(ovrSession p_session, int p_width, int p_height) : Session(p_session), TextureChain(nullptr), texId(0), fboId(0) { width = p_width; height = p_height; ovrTextureSwapChainDesc desc = {}; desc.Type = ovrTexture_2D; desc.ArraySize = 1; desc.Width = width; desc.Height = height; desc.MipLevels = 1; desc.Format = OVR_FORMAT_R8G8B8A8_UNORM_SRGB; desc.SampleCount = 1; desc.StaticImage = ovrFalse; ovrResult result = ovr_CreateTextureSwapChainGL(Session, &desc, &TextureChain); int length = 0; ovr_GetTextureSwapChainLength(Session, TextureChain, &length); if(OVR_SUCCESS(result)) { for (int i = 0; i < length; ++i) { GLuint chainTexId; ovr_GetTextureSwapChainBufferGL(Session, TextureChain, i, &chainTexId); glBindTexture(GL_TEXTURE_2D, chainTexId); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); } } glGenFramebuffers(1, &fboId); } TextureBuffer::~TextureBuffer() { if (TextureChain) { ovr_DestroyTextureSwapChain(Session, TextureChain); TextureChain = nullptr; } if (texId) { glDeleteTextures(1, &texId); texId = 0; } if (fboId) { glDeleteFramebuffers(1, &fboId); fboId = 0; } } ovrRecti TextureBuffer::GetViewport() { ovrRecti ret; ret.Pos.x = 0; ret.Pos.y = 0; ret.Size.w = width; ret.Size.h = height; return ret; } void TextureBuffer::SetRenderSurface() { GLuint curTexId; if (TextureChain) { int curIndex; ovr_GetTextureSwapChainCurrentIndex(Session, TextureChain, &curIndex); ovr_GetTextureSwapChainBufferGL(Session, TextureChain, curIndex, &curTexId); } else { curTexId = texId; } glBindFramebuffer(GL_FRAMEBUFFER, fboId); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, curTexId, 0); glViewport(0, 0, width, height); // glClear(GL_COLOR_BUFFER_BIT); // don't waste your time, we're overwriting the entire buffer // Enabling SRGB ensures we get a conversion from linear colour space to standard RGB colour space // Looks like Godot already renders using standard RGB colour space (or atleast when HDR is used) so lets not do this. // glEnable(GL_FRAMEBUFFER_SRGB); } void TextureBuffer::UnsetRenderSurface() { glBindFramebuffer(GL_FRAMEBUFFER, fboId); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0); glBindFramebuffer(GL_FRAMEBUFFER, 0); } void TextureBuffer::Commit() { if (TextureChain) { ovr_CommitTextureSwapChain(Session, TextureChain); } } /////////////////////////////////////////////////////////////////////////////////////////// // our ARVR interface godot_string godot_arvr_get_name(const void *p_data) { godot_string ret; char name[] = "Oculus"; api->godot_string_new(&ret); api->godot_string_parse_utf8(&ret, name); return ret; } godot_int godot_arvr_get_capabilities(const void *p_data) { godot_int ret; ret = 2 + 8; // 2 = ARVR_STEREO, 8 = ARVR_EXTERNAL return ret; } godot_bool godot_arvr_get_anchor_detection_is_enabled(const void *p_data) { godot_bool ret; ret = false; // does not apply here return ret; } void godot_arvr_set_anchor_detection_is_enabled(void *p_data, bool p_enable){ // we ignore this, not supported in this interface! } godot_bool godot_arvr_is_stereo(const void *p_data) { godot_bool ret; ret = true; return ret; } godot_bool godot_arvr_is_initialized(const void *p_data) { godot_bool ret; arvr_data_struct *arvr_data = (arvr_data_struct *)p_data; ret = arvr_data->oculus_is_initialized; return ret; } godot_bool godot_arvr_initialize(void *p_data) { arvr_data_struct *arvr_data = (arvr_data_struct *)p_data; if (!arvr_data->oculus_is_initialized) { // initialise this interface, so initialize any 3rd party libraries, open up // HMD window if required, etc. printf("Oculus - initializing...\n"); ovrResult result = ovr_Create(&arvr_data->session, &arvr_data->luid); if (!OVR_SUCCESS(result)) { printf("Oculus - Couldn''t initialize Oculus SDK\n"); return false; } if (Compare(arvr_data->luid, GetDefaultAdapterLuid())) { // If luid that the Rift is on is not the default adapter LUID... printf("Oculus - Oculus SDK is on a different adapter. If you have multiple graphics cards make sure Godot and the Oculus client are set to use the same GPU!!\n"); return false; } arvr_data->hmdDesc = ovr_GetHmdDesc(arvr_data->session); // Make eye render buffers bool success = true; for (int eye = 0; eye < 2 && success; ++eye) { ovrSizei idealTextureSize = ovr_GetFovTextureSize(arvr_data->session, ovrEyeType(eye), arvr_data->hmdDesc.DefaultEyeFov[eye], 1); arvr_data->eyeRenderTexture[eye] = new TextureBuffer(arvr_data->session, idealTextureSize.w, idealTextureSize.h); if (!arvr_data->eyeRenderTexture[eye]->TextureChain) { printf("Oculus - couldn''t create render texture for eye %i\n", eye+1); success = false; } else { // Could these textures possibly have different sizes?!?! We assume not or else we use the size of our right eye... arvr_data->width = idealTextureSize.w; arvr_data->height = idealTextureSize.h; printf("Oculus - created buffer for eye %i (%i,%i)\n", eye+1, arvr_data->width, arvr_data->height); } } if (success) { // Assuming standing, Godot can handle sitting ovr_SetTrackingOriginType(arvr_data->session, ovrTrackingOrigin_FloorLevel); arvr_data->frameIndex = 0; arvr_data->oculus_is_initialized = true; printf("Oculus - successfully initialized\n"); } else { // cleanup... for (int eye = 0; eye < 2; ++eye) { if (arvr_data->eyeRenderTexture[eye] != NULL) { delete arvr_data->eyeRenderTexture[eye]; arvr_data->eyeRenderTexture[eye] = NULL; } } ovr_Destroy(arvr_data->session); } } // and return our result return arvr_data->oculus_is_initialized; } void godot_arvr_uninitialize(void *p_data) { arvr_data_struct *arvr_data = (arvr_data_struct *)p_data; if (arvr_data->oculus_is_initialized != NULL) { // note, this will already be removed as the primary interface by // ARVRInterfaceGDNative for (int tracker = 0; tracker < MAX_TRACKERS; tracker++) { if (arvr_data->trackers[tracker] != 0) { // if we previously had our left touch controller, clean up arvr_api->godot_arvr_remove_controller(arvr_data->trackers[tracker]); arvr_data->trackers[tracker] = 0; } } for (int eye = 0; eye < 2; ++eye) { if (arvr_data->eyeRenderTexture[eye] != NULL) { delete arvr_data->eyeRenderTexture[eye]; arvr_data->eyeRenderTexture[eye] = NULL; } } ovr_Destroy(arvr_data->session); arvr_data->oculus_is_initialized = false; }; }; godot_vector2 godot_arvr_get_render_targetsize(const void *p_data) { arvr_data_struct *arvr_data = (arvr_data_struct *)p_data; godot_vector2 size; if (arvr_data->oculus_is_initialized) { api->godot_vector2_new(&size, arvr_data->width, arvr_data->height); } else { api->godot_vector2_new(&size, 500, 500); } return size; }; void oculus_transform_from_pose(godot_transform *p_dest, ovrPosef *p_pose , float p_world_scale) { godot_quat q; godot_basis basis; godot_vector3 origin; api->godot_quat_new(&q, p_pose->Orientation.x, p_pose->Orientation.y, p_pose->Orientation.z, p_pose->Orientation.w); api->godot_basis_new_with_euler_quat(&basis, &q); api->godot_vector3_new(&origin, p_pose->Position.x * p_world_scale, p_pose->Position.y * p_world_scale, p_pose->Position.z * p_world_scale); api->godot_transform_new(p_dest, &basis, &origin); } void oculus_transform_from_poses(godot_transform *p_dest, ovrPosef *p_pose_a, ovrPosef *p_pose_b , float p_world_scale) { godot_quat q; godot_basis basis; godot_vector3 origin; // assume both poses are oriented the same api->godot_quat_new(&q, p_pose_a->Orientation.x, p_pose_a->Orientation.y, p_pose_a->Orientation.z, p_pose_a->Orientation.w); api->godot_basis_new_with_euler_quat(&basis, &q); // find center api->godot_vector3_new(&origin , 0.5 * (p_pose_a->Position.x + p_pose_b->Position.x) * p_world_scale , 0.5 * (p_pose_a->Position.y + p_pose_b->Position.y) * p_world_scale , 0.5 * (p_pose_a->Position.z + p_pose_b->Position.z) * p_world_scale); api->godot_transform_new(p_dest, &basis, &origin); } godot_transform godot_arvr_get_transform_for_eye(void *p_data, godot_int p_eye, godot_transform *p_cam_transform) { arvr_data_struct *arvr_data = (arvr_data_struct *)p_data; godot_transform transform_for_eye; godot_transform reference_frame = arvr_api->godot_arvr_get_reference_frame(); godot_transform ret; godot_vector3 offset; godot_real world_scale = arvr_api->godot_arvr_get_worldscale(); if (p_eye == 0) { // ok, we actually get our left and right eye position from tracking data, not our head center with eye offsets // so lets find the center :) oculus_transform_from_poses(&transform_for_eye, &arvr_data->EyeRenderPose[0], &arvr_data->EyeRenderPose[1], world_scale); } else if (arvr_data->oculus_is_initialized) { oculus_transform_from_pose(&transform_for_eye, &arvr_data->EyeRenderPose[p_eye == 2 ? 1 : 0], world_scale); } else { // really not needed, just being paranoid.. godot_vector3 offset; api->godot_transform_new_identity(&transform_for_eye); if (p_eye == 1) { api->godot_vector3_new(&offset, -0.035 * world_scale, 0.0, 0.0); } else { api->godot_vector3_new(&offset, 0.035 * world_scale, 0.0, 0.0); }; api->godot_transform_translated(&transform_for_eye, &offset); }; // Now construct our full transform, the order may be in reverse, have to test // :) ret = *p_cam_transform; ret = api->godot_transform_operator_multiply(&ret, &reference_frame); // ret = api->godot_transform_operator_multiply(&ret, &arvr_data->hmd_transform); ret = api->godot_transform_operator_multiply(&ret, &transform_for_eye); return ret; }; void godot_arvr_fill_projection_for_eye(void *p_data, godot_real *p_projection, godot_int p_eye, godot_real p_aspect, godot_real p_z_near, godot_real p_z_far) { arvr_data_struct *arvr_data = (arvr_data_struct *)p_data; if (arvr_data->oculus_is_initialized) { // Based on code from OVR_StereoProjection.cpp ovrFovPort tanHalfFov = arvr_data->hmdDesc.DefaultEyeFov[p_eye == 2 ? 1 : 0]; float projXScale = 2.0f / (tanHalfFov.LeftTan + tanHalfFov.RightTan); float projXOffset = (tanHalfFov.LeftTan - tanHalfFov.RightTan) * projXScale * 0.5f; float projYScale = 2.0f / (tanHalfFov.UpTan + tanHalfFov.DownTan); float projYOffset = (tanHalfFov.UpTan - tanHalfFov.DownTan) * projYScale * 0.5f; // Produces X result, mapping clip edges to [-w,+w] p_projection[0] = projXScale; p_projection[4] = 0.0f; p_projection[8] = -projXOffset; p_projection[12] = 0.0f; // Produces Y result, mapping clip edges to [-w,+w] // Hey - why is that YOffset negated? // It's because a projection matrix transforms from world coords with Y=up, // whereas this is derived from an NDC scaling, which is Y=down. p_projection[1] = 0.0f; p_projection[5] = projYScale; p_projection[9] = projYOffset; p_projection[13] = 0.0f; // Produces Z-buffer result - app needs to fill this in with whatever Z range it wants. // We'll just use some defaults for now. p_projection[2] = 0.0f; p_projection[6] = 0.0f; p_projection[10] = -(p_z_near + p_z_far) / (p_z_far - p_z_near); p_projection[14] = -2.0f * p_z_near * p_z_far / (p_z_far - p_z_near); // Produces W result (= Z in) p_projection[3] = 0.0f; p_projection[7] = 0.0f; p_projection[11] = -1.0; p_projection[15] = 0.0f; } else { // uhm, should do something here really.. }; }; void godot_arvr_commit_for_eye(void *p_data, godot_int p_eye, godot_rid *p_render_target, godot_rect2 *p_screen_rect) { arvr_data_struct *arvr_data = (arvr_data_struct *)p_data; // This function is responsible for outputting the final render buffer for // each eye. // p_screen_rect will only have a value when we're outputting to the main // viewport. // For an interface that must output to the main viewport (such as with mobile // VR) we should give an error when p_screen_rect is not set // For an interface that outputs to an external device we should render a copy // of one of the eyes to the main viewport if p_screen_rect is set, and only // output to the external device if not. godot_rect2 screen_rect = *p_screen_rect; godot_vector2 render_size = godot_arvr_get_render_targetsize(p_data); if (p_eye == 1 && !api->godot_rect2_has_no_area(&screen_rect)) { // blit as mono, attempt to keep our aspect ratio and center our render buffer float new_height = screen_rect.size.x * (render_size.y / render_size.x); if (new_height > screen_rect.size.y) { screen_rect.position.y = (0.5 * screen_rect.size.y) - (0.5 * new_height); screen_rect.size.y = new_height; } else { float new_width = screen_rect.size.y * (render_size.x / render_size.y); screen_rect.position.x = (0.5 * screen_rect.size.x) - (0.5 * new_width); screen_rect.size.x = new_width; }; // printf("Blit: %0.2f, %0.2f - %0.2f, %0.2f\n",screen_rect.position.x,screen_rect.position.y,screen_rect.size.x,screen_rect.size.y); arvr_api->godot_arvr_blit(0, p_render_target, &screen_rect); }; if (arvr_data->oculus_is_initialized) { uint32_t texid = arvr_api->godot_arvr_get_texid(p_render_target); int eye = p_eye == 2 ? 1 : 0; // blit to OVRs buffers // Switch to eye render target arvr_data->eyeRenderTexture[eye]->SetRenderSurface(); // copy our buffer...Unfortunately, at this time Godot can't render directly into Oculus' // buffers. Something to discuss with Juan some day but I think this is posing serious // problem with the way our forward renderer handles several effects... // Worth further investigation though as this is wasteful... blit_render(&arvr_data->shader, texid); // Avoids an error when calling SetAndClearRenderSurface during next iteration. // Without this, during the next while loop iteration SetAndClearRenderSurface // would bind a framebuffer with an invalid COLOR_ATTACHMENT0 because the texture ID // associated with COLOR_ATTACHMENT0 had been unlocked by calling wglDXUnlockObjectsNV. arvr_data->eyeRenderTexture[eye]->UnsetRenderSurface(); // Commit changes to the textures so they get picked up frame arvr_data->eyeRenderTexture[eye]->Commit(); if (p_eye == 2) { // both eyes are rendered, time to output... ovrLayerEyeFov ld; ld.Header.Type = ovrLayerType_EyeFov; ld.Header.Flags = ovrLayerFlag_TextureOriginAtBottomLeft; // Because OpenGL. for (int eye = 0; eye < 2; ++eye) { ld.ColorTexture[eye] = arvr_data->eyeRenderTexture[eye]->TextureChain; ld.Viewport[eye] = arvr_data->eyeRenderTexture[eye]->GetViewport(); ld.Fov[eye] = arvr_data->hmdDesc.DefaultEyeFov[eye]; ld.RenderPose[eye] = arvr_data->EyeRenderPose[eye]; ld.SensorSampleTime = arvr_data->sensorSampleTime; } ovrLayerHeader* layers = &ld.Header; ovrResult result = ovr_SubmitFrame(arvr_data->session, arvr_data->frameIndex, nullptr, &layers, 1); // exit the rendering loop if submit returns an error, will retry on ovrError_DisplayLost if (!OVR_SUCCESS(result)) { // need to do something here... } arvr_data->frameIndex++; } } } void oculus_update_touch_controller(arvr_data_struct *p_arvr_data, int p_which) { int hand = p_which == TRACKER_LEFT_TOUCH ? 0 : 1; if (p_arvr_data->trackers[p_which] == 0) { // need to init a new tracker if (p_which == TRACKER_LEFT_TOUCH) { p_arvr_data->trackers[p_which] = arvr_api->godot_arvr_add_controller("Left Oculus Touch Controller", 1, true, true); } else { p_arvr_data->trackers[p_which] = arvr_api->godot_arvr_add_controller("Right Oculus Touch Controller", 2, true, true); } p_arvr_data->handTriggerPressed[hand] = false; p_arvr_data->indexTriggerPressed[hand] = false; } // note that I'm keeping the button assignments the same as we're currently using in OpenVR // update button and touch states, note that godot will ignore buttons that didn't change if (p_which == TRACKER_LEFT_TOUCH) { arvr_api->godot_arvr_set_controller_button(p_arvr_data->trackers[p_which], 1, p_arvr_data->inputState.Buttons & ovrButton_Y); arvr_api->godot_arvr_set_controller_button(p_arvr_data->trackers[p_which], 3, p_arvr_data->inputState.Buttons & ovrButton_Enter); // menu button arvr_api->godot_arvr_set_controller_button(p_arvr_data->trackers[p_which], 5, p_arvr_data->inputState.Touches & ovrTouch_X); arvr_api->godot_arvr_set_controller_button(p_arvr_data->trackers[p_which], 6, p_arvr_data->inputState.Touches & ovrTouch_Y); arvr_api->godot_arvr_set_controller_button(p_arvr_data->trackers[p_which], 7, p_arvr_data->inputState.Buttons & ovrButton_X); arvr_api->godot_arvr_set_controller_button(p_arvr_data->trackers[p_which], 9, p_arvr_data->inputState.Touches & ovrTouch_LThumbRest); arvr_api->godot_arvr_set_controller_button(p_arvr_data->trackers[p_which], 10, p_arvr_data->inputState.Touches & ovrTouch_LThumbUp); arvr_api->godot_arvr_set_controller_button(p_arvr_data->trackers[p_which], 11, p_arvr_data->inputState.Touches & ovrTouch_LIndexTrigger); arvr_api->godot_arvr_set_controller_button(p_arvr_data->trackers[p_which], 12, p_arvr_data->inputState.Touches & ovrTouch_LIndexPointing); arvr_api->godot_arvr_set_controller_button(p_arvr_data->trackers[p_which], 14, p_arvr_data->inputState.Buttons & ovrButton_LThumb); } else { arvr_api->godot_arvr_set_controller_button(p_arvr_data->trackers[p_which], 1, p_arvr_data->inputState.Buttons & ovrButton_B); arvr_api->godot_arvr_set_controller_button(p_arvr_data->trackers[p_which], 3, p_arvr_data->inputState.Buttons & ovrButton_Home); // oculus button arvr_api->godot_arvr_set_controller_button(p_arvr_data->trackers[p_which], 5, p_arvr_data->inputState.Touches & ovrTouch_A); arvr_api->godot_arvr_set_controller_button(p_arvr_data->trackers[p_which], 6, p_arvr_data->inputState.Touches & ovrTouch_Y); arvr_api->godot_arvr_set_controller_button(p_arvr_data->trackers[p_which], 7, p_arvr_data->inputState.Buttons & ovrButton_A); arvr_api->godot_arvr_set_controller_button(p_arvr_data->trackers[p_which], 9, p_arvr_data->inputState.Touches & ovrTouch_RThumbRest); arvr_api->godot_arvr_set_controller_button(p_arvr_data->trackers[p_which], 10, p_arvr_data->inputState.Touches & ovrTouch_RThumbUp); arvr_api->godot_arvr_set_controller_button(p_arvr_data->trackers[p_which], 11, p_arvr_data->inputState.Touches & ovrTouch_RIndexTrigger); arvr_api->godot_arvr_set_controller_button(p_arvr_data->trackers[p_which], 12, p_arvr_data->inputState.Touches & ovrTouch_RIndexPointing); arvr_api->godot_arvr_set_controller_button(p_arvr_data->trackers[p_which], 14, p_arvr_data->inputState.Buttons & ovrButton_RThumb); } if (p_arvr_data->handTriggerPressed[hand] && p_arvr_data->inputState.HandTrigger[hand] < 0.4) { p_arvr_data->handTriggerPressed[hand] = false; } else if (!p_arvr_data->handTriggerPressed[hand] && p_arvr_data->inputState.HandTrigger[hand] > 0.6) { p_arvr_data->handTriggerPressed[hand] = true; } arvr_api->godot_arvr_set_controller_button(p_arvr_data->trackers[p_which], 2, p_arvr_data->handTriggerPressed[hand]); if (p_arvr_data->indexTriggerPressed[hand] && p_arvr_data->inputState.IndexTrigger[hand] < 0.4) { p_arvr_data->indexTriggerPressed[hand] = false; } else if (!p_arvr_data->indexTriggerPressed[hand] && p_arvr_data->inputState.IndexTrigger[hand] > 0.6) { p_arvr_data->indexTriggerPressed[hand] = true; } arvr_api->godot_arvr_set_controller_button(p_arvr_data->trackers[p_which], 15, p_arvr_data->indexTriggerPressed[hand]); // update axis states arvr_api->godot_arvr_set_controller_axis(p_arvr_data->trackers[p_which], 0, p_arvr_data->inputState.Thumbstick[hand].x, true); arvr_api->godot_arvr_set_controller_axis(p_arvr_data->trackers[p_which], 1, p_arvr_data->inputState.Thumbstick[hand].y, true); arvr_api->godot_arvr_set_controller_axis(p_arvr_data->trackers[p_which], 2, p_arvr_data->inputState.IndexTrigger[hand], true); arvr_api->godot_arvr_set_controller_axis(p_arvr_data->trackers[p_which], 3, p_arvr_data->inputState.HandTrigger[hand], true); // update orientation and position godot_transform transform; oculus_transform_from_pose(&transform, &p_arvr_data->trackState.HandPoses[hand].ThePose , 1.0); arvr_api->godot_arvr_set_controller_transform(p_arvr_data->trackers[p_which], &transform, true, true); } void godot_arvr_process(void *p_data) { arvr_data_struct *arvr_data = (arvr_data_struct *)p_data; // this method gets called before every frame is rendered, here is where you // should update tracking data, update controllers, etc. // first check if Oculus wants us to react to something if (arvr_data->oculus_is_initialized) { ovrSessionStatus sessionStatus; ovr_GetSessionStatus(arvr_data->session, &sessionStatus); if (sessionStatus.ShouldQuit) { // bye bye oculus.. We possibly need to signal Godot that its time to exit completely.. godot_arvr_uninitialize(p_data); } else { if (sessionStatus.ShouldRecenter) ovr_RecenterTrackingOrigin(arvr_data->session); // Call ovr_GetRenderDesc each frame to get the ovrEyeRenderDesc, as the returned values (e.g. HmdToEyePose) may change at runtime. arvr_data->eyeRenderDesc[0] = ovr_GetRenderDesc(arvr_data->session, ovrEye_Left, arvr_data->hmdDesc.DefaultEyeFov[0]); arvr_data->eyeRenderDesc[1] = ovr_GetRenderDesc(arvr_data->session, ovrEye_Right, arvr_data->hmdDesc.DefaultEyeFov[1]); // Get eye poses, feeding in correct IPD offset arvr_data->HmdToEyePose[0] = arvr_data->eyeRenderDesc[0].HmdToEyePose; arvr_data->HmdToEyePose[1] = arvr_data->eyeRenderDesc[1].HmdToEyePose; ovr_GetEyePoses(arvr_data->session, arvr_data->frameIndex, ovrTrue, arvr_data->HmdToEyePose, arvr_data->EyeRenderPose, &arvr_data->sensorSampleTime); // update our controller state double frame_timing = 1.0; // need to do something with this.. arvr_data->trackState = ovr_GetTrackingState(arvr_data->session, frame_timing, ovrFalse); ovr_GetInputState(arvr_data->session, ovrControllerType_Active, &arvr_data->inputState); // and now handle our controllers, not that Godot is perfectly capable of handling the XBox controller, no need to add double support unsigned int which_controllers_do_we_have = ovr_GetConnectedControllerTypes(arvr_data->session); if (which_controllers_do_we_have & ovrControllerType_LTouch) { oculus_update_touch_controller(arvr_data, TRACKER_LEFT_TOUCH); } else if (arvr_data->trackers[TRACKER_LEFT_TOUCH] != 0) { // if we previously had our left touch controller, clean up arvr_api->godot_arvr_remove_controller(arvr_data->trackers[TRACKER_LEFT_TOUCH]); arvr_data->trackers[TRACKER_LEFT_TOUCH] = 0; } if (which_controllers_do_we_have & ovrControllerType_RTouch) { oculus_update_touch_controller(arvr_data, TRACKER_RIGHT_TOUCH); } else if (arvr_data->trackers[TRACKER_RIGHT_TOUCH] != 0) { // if we previously had our right touch controller, clean up arvr_api->godot_arvr_remove_controller(arvr_data->trackers[TRACKER_RIGHT_TOUCH]); arvr_data->trackers[TRACKER_RIGHT_TOUCH] = 0; } if (which_controllers_do_we_have & ovrControllerType_Remote) { // should add support for our remote... } else { // if we previously had our remote, clean up } } } } void *godot_arvr_constructor(godot_object *p_instance) { godot_string ret; arvr_data_struct *arvr_data = (arvr_data_struct *)api->godot_alloc(sizeof(arvr_data_struct)); arvr_data->oculus_is_initialized = false; arvr_data->eyeRenderTexture[0] = NULL; arvr_data->eyeRenderTexture[1] = NULL; for (int tracker = 0; tracker < MAX_TRACKERS; tracker++) { arvr_data->trackers[tracker] = 0; } // Initializes LibOVR, and the Rift ovrInitParams initParams = { ovrInit_RequestVersion, OVR_MINOR_VERSION, NULL, 0, 0 }; ovrResult result = ovr_Initialize(&initParams); if (!OVR_SUCCESS(result)) { printf("Failed to initialize libOVR.\n"); } // we should have only one so should be pretty safe arvr_data->shader = blit_shader_init(); return arvr_data; }; void godot_arvr_destructor(void *p_data) { if (p_data != NULL) { arvr_data_struct *arvr_data = (arvr_data_struct *)p_data; if (arvr_data->oculus_is_initialized) { // this should have already been called... But just in case... godot_arvr_uninitialize(p_data); } blit_shader_cleanup(&arvr_data->shader); api->godot_free(p_data); }; }; const godot_arvr_interface_gdnative interface_struct = { GODOTVR_API_MAJOR, GODOTVR_API_MINOR, godot_arvr_constructor, godot_arvr_destructor, godot_arvr_get_name, godot_arvr_get_capabilities, godot_arvr_get_anchor_detection_is_enabled, godot_arvr_set_anchor_detection_is_enabled, godot_arvr_is_stereo, godot_arvr_is_initialized, godot_arvr_initialize, godot_arvr_uninitialize, godot_arvr_get_render_targetsize, godot_arvr_get_transform_for_eye, godot_arvr_fill_projection_for_eye, godot_arvr_commit_for_eye, godot_arvr_process };
38.860294
166
0.744598
0975c8e52cf2a7a3ea23ce38e36b92ffcf6843b4
517
cc
C++
gearbox/t/core/config_file.t.cc
coryb/gearbox
88027f2f101c2d1fab16093928963052b9d3294d
[ "Artistic-1.0-Perl", "BSD-3-Clause" ]
3
2015-06-26T15:37:40.000Z
2016-05-22T07:42:39.000Z
gearbox/t/core/config_file.t.cc
coryb/gearbox
88027f2f101c2d1fab16093928963052b9d3294d
[ "Artistic-1.0-Perl", "BSD-3-Clause" ]
null
null
null
gearbox/t/core/config_file.t.cc
coryb/gearbox
88027f2f101c2d1fab16093928963052b9d3294d
[ "Artistic-1.0-Perl", "BSD-3-Clause" ]
null
null
null
// Copyright (c) 2012, Yahoo! Inc. All rights reserved. // Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. #include <tap/trivial.h> #include <gearbox/core/ConfigFile.h> using namespace Gearbox; int main() { chdir(TESTDIR); TEST_START(5); ConfigFile cfg("cfg/2.cfg"); Json a; NOTHROW( a = cfg.get_json( "json" ) ); IS( a.empty(), true ); IS( a.length(), 0 ); IS( a.typeName(), "array" ); IS( a.serialize(), "[]" ); TEST_END; }
21.541667
94
0.617021
097678ae1ef604a6f07542e23a230b58a61679e4
3,944
cpp
C++
Drivers/GranularJet/dec13_A254_Hi0075_RC06_MU05.cpp
gustavo-castillo-bautista/Mercury
eeb402ccec8e487652229d4595c46ec84f6aefbb
[ "BSD-3-Clause" ]
null
null
null
Drivers/GranularJet/dec13_A254_Hi0075_RC06_MU05.cpp
gustavo-castillo-bautista/Mercury
eeb402ccec8e487652229d4595c46ec84f6aefbb
[ "BSD-3-Clause" ]
null
null
null
Drivers/GranularJet/dec13_A254_Hi0075_RC06_MU05.cpp
gustavo-castillo-bautista/Mercury
eeb402ccec8e487652229d4595c46ec84f6aefbb
[ "BSD-3-Clause" ]
null
null
null
//Copyright (c) 2013-2020, The MercuryDPM Developers Team. All rights reserved. //For the list of developers, see <http://www.MercuryDPM.org/Team>. // //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. // * Neither the name MercuryDPM 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 MERCURYDPM DEVELOPERS TEAM 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 <sstream> #include <iostream> #include <iomanip> #include <cmath> #include <Species/LinearViscoelasticSlidingFrictionSpecies.h> #include "Funnel.h" int main(int argc UNUSED, char *argv[] UNUSED) { Funnel problem; // Problem parameters problem.setName("dec13_A254_Hi0075_RC06_MU05"); auto species = problem.speciesHandler.copyAndAddObject(LinearViscoelasticSlidingFrictionSpecies()); species->setSlidingFrictionCoefficient(0.5); species->setDensity(1442.0); //problem.set_HGRID_max_levels(2); //problem.set_HGRID_num_buckets(1e6); // Particle properties problem.setFixedParticleRadius(300e-6); problem.setInflowParticleRadius(300e-6); species->setCollisionTimeAndRestitutionCoefficient(4e-4, 0.6, species->getMassFromRadius(problem.getFixedParticleRadius())); //problem.setStiffness(1e5*4/3*pi*problem.getInflowParticleRadius()*9.81*problem.getDensity()); //problem.set_disp(50*sqrt(9.81/(2*problem.getInflowParticleRadius()); std::cout << "Setting k to " << species->getStiffness() << " and disp to " << species->getDissipation() << std::endl; species->setSlidingStiffness(species->getStiffness()*2.0/7.0); species->setSlidingDissipation(species->getDissipation()*2.0/7.0); double mass = species->getMassFromRadius(0.5 * (problem.getMinInflowParticleRadius() + problem.getMaxInflowParticleRadius())); problem.setTimeStep(0.02 * species->getCollisionTime(mass)); problem.setTimeMax(3); problem.setSaveCount(100); problem.setChuteLength(0.6); problem.setChuteWidth(0.25); problem.setChuteAngle(25.4); problem.setRoughBottomType(MONOLAYER_DISORDERED); double funx = problem.getXMin()+0.5*(problem.getXMax()-problem.getXMin()); problem.set_funa(60.0); problem.set_funD(0.015); problem.set_funHf(0.075+(problem.getXMax()-funx)*sin(problem.getChuteAngle())); problem.set_funnz(50.0); problem.set_funO(-funx, 0.5*(problem.getYMax()-problem.getYMin())); problem.set_funfr(0.3); problem.setInflowVelocity(0); problem.setInflowVelocityVariance(0.01); problem.setMaxFailed(1); //solve //cout << "Maximum allowed speed of particles: " << problem.getMaximumVelocity() << endl; // speed allowed before particles move through each other! std::cout << "dt=" << problem.getTimeStep() << std::endl; problem.solve(); problem.writeRestartFile(); }
40.659794
149
0.761663
097d29910f58bf15984a871e201ddf64e159f4b3
3,105
cpp
C++
tests/mapping/Map2DTest.cpp
jonahbardos/PY2020
af4f61b86ae5013e58faf4842bf20863b3de3957
[ "Apache-2.0" ]
11
2019-10-03T01:17:16.000Z
2020-10-25T02:38:32.000Z
tests/mapping/Map2DTest.cpp
jonahbardos/PY2020
af4f61b86ae5013e58faf4842bf20863b3de3957
[ "Apache-2.0" ]
53
2019-10-03T02:11:04.000Z
2021-06-05T03:11:55.000Z
tests/mapping/Map2DTest.cpp
jonahbardos/PY2020
af4f61b86ae5013e58faf4842bf20863b3de3957
[ "Apache-2.0" ]
3
2019-09-20T04:09:29.000Z
2020-08-18T22:25:20.000Z
#define CATCH_CONFIG_MAIN #include "mapping/Map2D.h" #include <iostream> #include <cmath> #include <chrono> #include <ctime> #include <thread> constexpr int test_iterations = 100; constexpr int vertex_count = 1000; constexpr int sparsity_factor = 2; #include <catch2/catch.hpp> namespace Mapping { // creates a map with given number of vertices // when connecting neighbors, the probability that any node will be connected to any other node // is 1 / sparse_factor // thus if sparse_factor is 1, each node is connected to each other node std::shared_ptr<Map2D> CreateRandMap(int vertices, int sparse_factor) { Map2D map; for (int i = 0; i < vertices; i++) { Point2D p; p.id = i; p.x = (float)(rand() % vertices); p.y = (float)(rand() % vertices); std::shared_ptr<Point2D> p_ptr = std::make_shared<Point2D>(p); for (int j = 0; j < map.vertices.size(); j++) { if (rand() % sparse_factor == 0) { Connect(p_ptr, map.vertices.at(j)); } } map.vertices.push_back(p_ptr); } return std::make_shared<Map2D>(map); } // randomly picks a start and end vertex, making sure they are different nodes // returns average time of shortest path computation, in seconds double TimeShortestPath(std::shared_ptr<Map2D> map, int num_iterations) { double avg = 0; for (int i = 0; i < num_iterations; i++) { int start_ind = rand() % map->vertices.size(); int target_ind = rand() % map->vertices.size(); while (target_ind == start_ind) { target_ind = rand() % map->vertices.size(); } auto start = std::chrono::system_clock::now(); ComputePath(map, map->vertices[start_ind], map->vertices[target_ind]); auto end = std::chrono::system_clock::now(); std::chrono::duration<double> elapsed_seconds = end - start; avg += elapsed_seconds.count() / num_iterations; } return avg; } bool verifyCorrectPath() { Map2D map; float x_pts[10] = {0, -1, 2, -3, 4, -5, 6, -7, 8, -9}; float y_pts[10] = {0, -1, 2, -3, 4, -5, 6, -7, 8, -9}; for (int i = 0; i < 10; i++) { Point2D p; p.id = i; p.x = x_pts[i]; p.y = y_pts[i]; map.vertices.push_back(std::make_shared<Point2D>(p)); if (i > 0) { Connect(map.vertices[i], map.vertices[i - 1]); } } Connect(map.vertices[9], map.vertices[2]); std::vector<std::shared_ptr<Point2D>> actual = ComputePath(std::make_shared<Map2D>(map), map.vertices[9], map.vertices[0]); int expected[3] = {0, 1, 2}; for (int i = 0; i < actual.size(); i++) { if (expected[i] != actual[i]->id) { return false; } } return true; } } // namespace Mapping TEST_CASE("computes correct path") { REQUIRE(Mapping::verifyCorrectPath()); }
29.571429
98
0.554267
09807f83c5fd4e83dddd8cef01b63649a688bc23
1,520
cpp
C++
attacker/SSL/sslPublic.cpp
satadriver/attacker
24e4434d8a836e040e48df195f2ca8919ab52609
[ "Apache-2.0" ]
null
null
null
attacker/SSL/sslPublic.cpp
satadriver/attacker
24e4434d8a836e040e48df195f2ca8919ab52609
[ "Apache-2.0" ]
null
null
null
attacker/SSL/sslPublic.cpp
satadriver/attacker
24e4434d8a836e040e48df195f2ca8919ab52609
[ "Apache-2.0" ]
1
2022-03-20T03:21:00.000Z
2022-03-20T03:21:00.000Z
#include "sslPublic.h" #include "../attacker.h" #include "../FileOper.h" #include <vector> #include <iostream> #include <string> using namespace std; WORKERCONTROL gWorkControl; vector <string> gHostAttackList; char G_USERNAME[64]; SSLPublic::SSLPublic(vector<string>list) { if (mInstance) { return; } mInstance = this; gHostAttackList = list; } SSLPublic::~SSLPublic() { } int SSLPublic::isTargetHost(string host) { unsigned int targetlen = gHostAttackList.size(); for (unsigned int i = 0; i < targetlen; i++) { if (strstr(host.c_str(), gHostAttackList[i].c_str())) { return TRUE; } } return FALSE; } int SSLPublic::prepareCertChain(string certname) { int ret = 0; string curpath = gLocalPath + CA_CERT_PATH +"\\"; string crtname = curpath + certname + ".crt"; string midcrtname = curpath+ certname + ".mid.crt"; string crtchainname = curpath+ certname + ".chain.crt"; string cafn = curpath + DIGICERTCA; if (FileOper::isFileExist(crtchainname)) { DeleteFileA(crtchainname.c_str()); } string cmd = "cmd /c type " + crtname + " >> " + crtchainname; ret = system(cmd.c_str()); cmd = "cmd /c echo.>> " + crtchainname; ret = system(cmd.c_str()); cmd = "cmd /c type " + midcrtname + " >> " + crtchainname; ret = system(cmd.c_str()); cmd = "cmd /c echo.>> " + crtchainname; ret = system(cmd.c_str()); cmd = "cmd /c type " + cafn + " >> " + crtchainname; ret = system(cmd.c_str()); cmd = "cmd /c echo.>> " + crtchainname; ret = system(cmd.c_str()); return 0; }
19.74026
63
0.651316
09817f55dee6853da4cc8fcc42feaf934082197f
119
cpp
C++
src/IModel.cpp
soraphis/Boids-MPI
87ce64b6bfa5f8f9dba94a641046979621e7a71c
[ "MIT" ]
null
null
null
src/IModel.cpp
soraphis/Boids-MPI
87ce64b6bfa5f8f9dba94a641046979621e7a71c
[ "MIT" ]
1
2017-05-30T14:59:29.000Z
2017-05-30T14:59:29.000Z
src/IModel.cpp
soraphis/Boids-MPI
87ce64b6bfa5f8f9dba94a641046979621e7a71c
[ "MIT" ]
null
null
null
/* * IModel.cpp * * Created on: 29.06.2014 * Author: oliver */ #include "IModel.h" IModel::~IModel(){ }
8.5
26
0.537815
098189c807f15834fdc770132fb6df986d492496
203,441
cpp
C++
ds/ds/src/util/ldp/ldpdoc.cpp
npocmaka/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
17
2020-11-13T13:42:52.000Z
2021-09-16T09:13:13.000Z
ds/ds/src/util/ldp/ldpdoc.cpp
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
2
2020-10-19T08:02:06.000Z
2020-10-19T08:23:18.000Z
ds/ds/src/util/ldp/ldpdoc.cpp
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
14
2020-11-14T09:43:20.000Z
2021-08-28T08:59:57.000Z
//+------------------------------------------------------------------------- // // Microsoft Windows // // Copyright (C) Microsoft Corporation, 1996 - 1999 // // File: ldpdoc.cpp // //-------------------------------------------------------------------------- /******************************************************************* * * File : ldpdoc.cpp * Author : Eyal Schwartz * Copyrights : Microsoft Corp (C) 1996 * Date : 10/21/1996 * Description : implementation of class CldpDoc * * Revisions : <date> <name> <description> *******************************************************************/ // includes #include "stdafx.h" #include "Ldp.h" #include "LdpDoc.h" #include "LdpView.h" #include "CnctDlg.h" #include "MainFrm.h" #include "string.h" #include <rpc.h> // for SEC_WINNT_AUTH_IDENTITY #include <drs.h> #include <mdglobal.h> #include <ntldap.h> #include <sddl.h> #include <schnlsp.h> extern "C" { #include <dsutil.h> #include <x_list.h> // BAS_TODO // These are some silly. typedef DWORD ULONG ; SEC_WINNT_AUTH_IDENTITY_W gCreds = { 0 }; SEC_WINNT_AUTH_IDENTITY_W * gpCreds = NULL; } #if(_WIN32_WINNT < 0x0500) // Currently due to some MFC issues, even on a 5.0 system this is left as a 4.0 #undef _WIN32_WINNT #define _WIN32_WINNT 0x500 #endif #include <aclapi.h> // for Security Stuff #include <aclapip.h> // for Security Stuff #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif // // Server stat info // #define PARSE_THREADCOUNT 1 #define PARSE_CALLTIME 3 #define PARSE_RETURNED 5 #define PARSE_VISITED 6 #define PARSE_FILTER 7 #define PARSE_INDEXES 8 #define MAXSVRSTAT 32 ///////////////////////////////////////////////////////////////////////////// // CLdpDoc // Message maps IMPLEMENT_DYNCREATE(CLdpDoc, CDocument) BEGIN_MESSAGE_MAP(CLdpDoc, CDocument) //{{AFX_MSG_MAP(CLdpDoc) ON_COMMAND(ID_CONNECTION_BIND, OnConnectionBind) ON_COMMAND(ID_CONNECTION_CONNECT, OnConnectionConnect) ON_COMMAND(ID_CONNECTION_DISCONNECT, OnConnectionDisconnect) ON_COMMAND(ID_BROWSE_SEARCH, OnBrowseSearch) ON_UPDATE_COMMAND_UI(ID_BROWSE_SEARCH, OnUpdateBrowseSearch) ON_COMMAND(ID_BROWSE_ADD, OnBrowseAdd) ON_UPDATE_COMMAND_UI(ID_BROWSE_ADD, OnUpdateBrowseAdd) ON_COMMAND(ID_BROWSE_DELETE, OnBrowseDelete) ON_UPDATE_COMMAND_UI(ID_BROWSE_DELETE, OnUpdateBrowseDelete) ON_COMMAND(ID_BROWSE_MODIFYRDN, OnBrowseModifyrdn) ON_UPDATE_COMMAND_UI(ID_BROWSE_MODIFYRDN, OnUpdateBrowseModifyrdn) ON_COMMAND(ID_BROWSE_MODIFY, OnBrowseModify) ON_UPDATE_COMMAND_UI(ID_BROWSE_MODIFY, OnUpdateBrowseModify) ON_COMMAND(ID_OPTIONS_SEARCH, OnOptionsSearch) ON_COMMAND(ID_BROWSE_PENDING, OnBrowsePending) ON_UPDATE_COMMAND_UI(ID_BROWSE_PENDING, OnUpdateBrowsePending) ON_COMMAND(ID_OPTIONS_PEND, OnOptionsPend) ON_UPDATE_COMMAND_UI(ID_CONNECTION_CONNECT, OnUpdateConnectionConnect) ON_UPDATE_COMMAND_UI(ID_CONNECTION_DISCONNECT, OnUpdateConnectionDisconnect) ON_COMMAND(ID_VIEW_SOURCE, OnViewSource) ON_UPDATE_COMMAND_UI(ID_VIEW_SOURCE, OnUpdateViewSource) ON_COMMAND(ID_OPTIONS_BIND, OnOptionsBind) ON_COMMAND(ID_OPTIONS_PROTECTIONS, OnOptionsProtections) ON_UPDATE_COMMAND_UI(ID_OPTIONS_PROTECTIONS, OnUpdateOptionsProtections) ON_COMMAND(ID_OPTIONS_GENERAL, OnOptionsGeneral) ON_COMMAND(ID_BROWSE_COMPARE, OnBrowseCompare) ON_UPDATE_COMMAND_UI(ID_BROWSE_COMPARE, OnUpdateBrowseCompare) ON_COMMAND(ID_OPTIONS_DEBUG, OnOptionsDebug) ON_COMMAND(ID_VIEW_TREE, OnViewTree) ON_UPDATE_COMMAND_UI(ID_VIEW_TREE, OnUpdateViewTree) ON_COMMAND(ID_OPTIONS_SERVEROPTIONS, OnOptionsServeroptions) ON_COMMAND(ID_OPTIONS_CONTROLS, OnOptionsControls) ON_COMMAND(ID_OPTIONS_SORTKEYS, OnOptionsSortkeys) ON_COMMAND(ID_OPTIONS_SETFONT, OnOptionsSetFont) ON_COMMAND(ID_BROWSE_SECURITY_SD, OnBrowseSecuritySd) ON_COMMAND(ID_BROWSE_SECURITY_EFFECTIVE, OnBrowseSecurityEffective) ON_UPDATE_COMMAND_UI(ID_BROWSE_SECURITY_SD, OnUpdateBrowseSecuritySd) ON_UPDATE_COMMAND_UI(ID_BROWSE_SECURITY_EFFECTIVE, OnUpdateBrowseSecurityEffective) ON_COMMAND(ID_BROWSE_REPLICATION_VIEWMETADATA, OnBrowseReplicationViewmetadata) ON_UPDATE_COMMAND_UI(ID_BROWSE_REPLICATION_VIEWMETADATA, OnUpdateBrowseReplicationViewmetadata) ON_COMMAND(ID_BROWSE_EXTENDEDOP, OnBrowseExtendedop) ON_UPDATE_COMMAND_UI(ID_BROWSE_EXTENDEDOP, OnUpdateBrowseExtendedop) ON_COMMAND(ID_VIEW_LIVEENTERPRISE, OnViewLiveEnterprise) ON_UPDATE_COMMAND_UI(ID_VIEW_LIVEENTERPRISE, OnUpdateViewLiveEnterprise) ON_COMMAND(ID_BROWSE_VLVSEARCH, OnBrowseVlvsearch) ON_UPDATE_COMMAND_UI(ID_BROWSE_VLVSEARCH, OnUpdateBrowseVlvsearch) ON_COMMAND(ID_EDIT_COPYDN, OnEditCopy) ON_COMMAND(ID_OPTIONS_START_TLS, OnOptionsStartTls) ON_COMMAND(ID_OPTIONS_STOP_TLS, OnOptionsStopTls) ON_COMMAND(ID_BROWSE_GetError, OnGetLastError) //}}AFX_MSG_MAP ON_COMMAND(ID_SRCHEND, OnSrchEnd) ON_COMMAND(ID_SRCHGO, OnSrchGo) ON_COMMAND(ID_ADDGO, OnAddGo) ON_COMMAND(ID_ADDEND, OnAddEnd) ON_COMMAND(ID_MODGO, OnModGo) ON_COMMAND(ID_MODEND, OnModEnd) ON_COMMAND(ID_MODRDNGO, OnModRdnGo) ON_COMMAND(ID_MODRDNEND, OnModRdnEnd) ON_COMMAND(ID_PENDEND, OnPendEnd) ON_COMMAND(ID_PROCPEND, OnProcPend) ON_COMMAND(ID_PENDANY, OnPendAny) ON_COMMAND(ID_PENDABANDON, OnPendAbandon) ON_COMMAND(ID_COMPGO, OnCompGo) ON_COMMAND(ID_COMPEND, OnCompEnd) ON_COMMAND(ID_BIND_OPT_OK, OnBindOptOK) ON_COMMAND(ID_SSPI_DOMAIN_SHORTCUT, OnSSPIDomainShortcut) ON_COMMAND(ID_EXTOPGO, OnExtOpGo) ON_COMMAND(ID_EXTOPEND, OnExtOpEnd) ON_COMMAND(ID_ENT_TREE_END, OnLiveEntTreeEnd) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CLdpDoc construction/destruction /*+++ Function : CLdpDoc Description: Constructor Parameters : Return : Remarks : none. ---*/ CLdpDoc::CLdpDoc() { CLdpApp *app = (CLdpApp*)AfxGetApp(); SetSecurityPrivilege(); // // registry // HKEY hUserRegKey = NULL; char szAppDataPath[MAX_PATH]; char szAppDataIni[MAX_PATH]; DWORD dwBufLen; RegOpenKeyEx( HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", 0, KEY_QUERY_VALUE, &hUserRegKey); dwBufLen = sizeof(szAppDataPath); RegQueryValueEx( hUserRegKey, "AppData", NULL, NULL, (LPBYTE) szAppDataPath, &dwBufLen); RegCloseKey( hUserRegKey); strcat( szAppDataPath, "\\Microsoft\\ldp"); CreateDirectory( szAppDataPath, NULL); //First free the string allocated by MFC at CWinApp startup. //The string is allocated before InitInstance is called. free((void*)app->m_pszProfileName); //Change the name of the .INI file. //The CWinApp destructor will free the memory. strcpy( szAppDataIni, szAppDataPath); strcat( szAppDataIni, "\\ldp.ini"); app->m_pszProfileName=_tcsdup(_T(szAppDataIni)); Svr = app->GetProfileString("Connection", "Server"); BindDn = app->GetProfileString("Connection", "BindDn"); BindPwd.Empty(); // BindPwd = app->GetProfileString("Connection", "BindPwd"); BindDomain = app->GetProfileString("Connection", "BindDomain"); // // init flags dialogs & params // hLdap = NULL; m_SrcMode = FALSE; m_bCnctless = FALSE; m_bProtect = TRUE; // disabled in the UI. Forced TRUE forever. bConnected = FALSE; bSrch = FALSE; bAdd = FALSE; bLiveEnterprise = FALSE; bExtOp = FALSE; bMod = FALSE; bModRdn = FALSE; bPndDlg = FALSE; bCompDlg = FALSE; SearchDlg = new SrchDlg(this); m_EntTreeDlg = new CEntTree; m_AddDlg = new AddDlg; m_ModDlg = new ModDlg; m_ModRdnDlg = new ModRDNDlg; m_PndDlg = new PndDlg(&m_PendList); m_GenOptDlg = new CGenOpt; m_CompDlg = new CCompDlg; m_BndOpt = new CBndOpt; m_TreeViewDlg = new TreeVwDlg(this); m_CtrlDlg = new ctrldlg; m_SKDlg = new SortKDlg; m_ExtOpDlg = new ExtOpDlg; m_vlvDlg = NULL; #ifdef WINLDAP ldap_set_dbg_flags(m_DbgDlg.ulDbgFlags); #endif // // Initial search info struct // for(int i=0; i<MAXLIST; i++) SrchInfo.attrList[i] = NULL; // // setup default attributes to retrieve // const TCHAR pszDefaultAttrList[] = "objectClass;name;cn;ou;dc;distinguishedName;description;canonicalName"; SrchInfo.lTlimit = 0; SrchInfo.lSlimit = 0; SrchInfo.lToutSec = 0; SrchInfo.lToutMs = 0; SrchInfo.bChaseReferrals = FALSE; SrchInfo.bAttrOnly = FALSE; SrchInfo.fCall = CALL_SYNC; SrchInfo.lPageSize = 16; SrchInfo.fCall = app->GetProfileInt("Search_Operations", "SearchSync", SrchInfo.fCall); SrchInfo.bAttrOnly = app->GetProfileInt("Search_Operations", "SearchAttrOnly", SrchInfo.bAttrOnly ); SrchInfo.bChaseReferrals = app->GetProfileInt("Search_Operations", "ChaseReferrals", SrchInfo.bChaseReferrals); SrchInfo.lToutMs = app->GetProfileInt("Search_Operations", "SearchToutMs", SrchInfo.lToutMs ); SrchInfo.lToutSec = app->GetProfileInt("Search_Operations", "SearchToutSec", SrchInfo.lToutSec ); SrchInfo.lTlimit = app->GetProfileInt("Search_Operations", "SearchTlimit", SrchInfo.lTlimit ); SrchInfo.lSlimit = app->GetProfileInt("Search_Operations", "SearchSlimit", SrchInfo.lSlimit ); SrchInfo.lPageSize = app->GetProfileInt("Search_Operations", "SearchPageSize", SrchInfo.lPageSize ); LPTSTR pAttrList = _strdup(app->GetProfileString("Search_Operations", "SearchAttrList", pszDefaultAttrList)); for(i=0, SrchInfo.attrList[i] = strtok(pAttrList, ";"); SrchInfo.attrList[i] != NULL; SrchInfo.attrList[++i] = strtok(NULL, ";")); SrchOptDlg.UpdateSrchInfo(SrchInfo, FALSE); hPage = NULL; bPagedMode = FALSE; bServerVLVcapable = FALSE; m_ServerSupportedControls = NULL; // // init pending info struct // PndInfo.All = TRUE; PndInfo.bBlock = TRUE; PndInfo.tv.tv_sec = 0; PndInfo.tv.tv_usec = 0; DefaultContext.Empty(); cNCList = 0; NCList = NULL; // // more registry update (passed default settings) // m_bProtect = app->GetProfileInt("Environment", "Protections", m_bProtect); } /*+++ Function : ~CLdapDoc Description: Destructor Parameters : Return : Remarks : none. ---*/ CLdpDoc::~CLdpDoc() { CLdpApp *app = (CLdpApp*)AfxGetApp(); INT i=0; SetSecurityPrivilege(FALSE); // // register // app->WriteProfileString("Connection", "Server", Svr); app->WriteProfileString("Connection", "BindDn", BindDn); // app->WriteProfileString("Connection", "BindPwd", BindPwd); app->WriteProfileString("Connection", "BindDomain", BindDomain); m_bProtect = app->WriteProfileInt("Environment", "Protections", m_bProtect); app->WriteProfileInt("Search_Operations", "SearchSync", SrchInfo.fCall); app->WriteProfileInt("Search_Operations", "SearchAttrOnly", SrchInfo.bAttrOnly ); app->WriteProfileInt("Search_Operations", "SearchToutMs", SrchInfo.lToutMs ); app->WriteProfileInt("Search_Operations", "SearchToutSec", SrchInfo.lToutSec ); app->WriteProfileInt("Search_Operations", "SearchTlimit", SrchInfo.lTlimit ); app->WriteProfileInt("Search_Operations", "SearchSlimit", SrchInfo.lSlimit ); app->WriteProfileInt("Search_Operations", "ChaseReferrals", SrchInfo.bChaseReferrals); app->WriteProfileInt("Search_Operations", "SearchPageSize", SrchInfo.lPageSize); // // extract attribute list to write to ini file // INT cbAttrList=0; LPTSTR pAttrList = NULL; for(i=0; SrchInfo.attrList != NULL && SrchInfo.attrList[i] != NULL; i++){ cbAttrList+= strlen(SrchInfo.attrList[i]) + 1; } if(cbAttrList != 0){ pAttrList = new TCHAR[cbAttrList+1]; strcpy(pAttrList, SrchInfo.attrList[0]); for(i=1; SrchInfo.attrList[i] != NULL; i++){ pAttrList = strcat(pAttrList, ";"); pAttrList = strcat(pAttrList, SrchInfo.attrList[i]); } } app->WriteProfileString("Search_Operations", "SearchAttrList", !pAttrList?"":pAttrList); delete pAttrList; if(NULL != hLdap) ldap_unbind(hLdap); // // cleanup mem // delete SearchDlg; delete m_AddDlg; delete m_EntTreeDlg; delete m_ModDlg; delete m_ModRdnDlg; delete m_PndDlg; delete m_GenOptDlg; delete m_BndOpt; delete m_CompDlg; delete m_TreeViewDlg; delete m_CtrlDlg; delete m_SKDlg; delete m_ExtOpDlg; if (m_vlvDlg) delete m_vlvDlg; if(SrchInfo.attrList[0] != NULL) free(SrchInfo.attrList[0]); } BOOL CLdpDoc::SetSecurityPrivilege(BOOL bOn){ HANDLE hToken; LUID seSecVal; TOKEN_PRIVILEGES tkp; BOOL bRet = FALSE; /* Retrieve a handle of the access token. */ if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken)) { if (LookupPrivilegeValue((LPSTR)NULL, SE_SECURITY_NAME, &seSecVal)) { tkp.PrivilegeCount = 1; tkp.Privileges[0].Luid = seSecVal; tkp.Privileges[0].Attributes = bOn? SE_PRIVILEGE_ENABLED: 0L; AdjustTokenPrivileges(hToken, FALSE, &tkp, sizeof(TOKEN_PRIVILEGES), (PTOKEN_PRIVILEGES) NULL, (PDWORD) NULL); } if (GetLastError() == ERROR_SUCCESS) { bRet = TRUE; } } return bRet; } /*+++ Function : OnNewDocument Description: Automatic MFC code Parameters : Return : Remarks : none. ---*/ BOOL CLdpDoc::OnNewDocument() { if (!CDocument::OnNewDocument()) return FALSE; // // set a clean buffer // ((CEditView*)m_viewList.GetHead())->SetWindowText(NULL); return TRUE; } ///////////////////////////////////////////////////////////////////////////// // CLdpDoc serialization /*+++ Function : Serialize Description: Automatic MFC code Parameters : Return : Remarks : none. ---*/ void CLdpDoc::Serialize(CArchive& ar) { // CEditView contains an edit control which handles all serialization ((CEditView*)m_viewList.GetHead())->SerializeRaw(ar); } ///////////////////////////////////////////////////////////////////////////// // CLdpDoc diagnostics /*+++ Functionis : Diagnostics Description: Automatic MFC Code Parameters : Return : Remarks : none. ---*/ #ifdef _DEBUG void CLdpDoc::AssertValid() const { CDocument::AssertValid(); } void CLdpDoc::Dump(CDumpContext& dc) const { CDocument::Dump(dc); } #endif //_DEBUG ////////////////////////////////////////////////////// // Utilty functions /*+++ Function : Print Description: Interface for text pane output Parameters : Return : Remarks : none. ---*/ void CLdpDoc::Print(CString str){ POSITION pos; CView *pTmpVw; INT iLineSize=m_GenOptDlg->MaxLineSize(); pos = GetFirstViewPosition(); while(pos != NULL){ pTmpVw = GetNextView(pos); if((CString)(pTmpVw->GetRuntimeClass()->m_lpszClassName) == _T("CLdpView")){ CLdpView* pView = (CLdpView* )pTmpVw; if(str.GetLength() > iLineSize){ CString tmp; tmp = str.GetBufferSetLength(iLineSize); tmp += "..."; pView->Print(tmp); } else pView->Print(str); break; } } } /*+++ Function : CodePrint Description: Used for code generation Parameters : Return : Remarks : unsupported anymore. ---*/ void CLdpDoc::CodePrint(CString str, int type){ type &= ~CP_ONLY; switch (type){ case CP_SRC: Print(str); break; case CP_CMT: Print(CString("// ") + str); break; case CP_PRN: Print(CString("\tprintf(\"") + str + _T("\");")); break; case CP_NON: break; default: AfxMessageBox("Unknown switch in CLdpDoc::CodePrint()"); } } /*+++ Function : Out Description: Used for interfacing w/ text pane Parameters : Return : Remarks : none. ---*/ void CLdpDoc::Out(CString str, int type){ if(m_SrcMode) CodePrint(str, type); else if(!(type & CP_ONLY)) Print(str); } ///////////////////////////////////////////////////////////////////////////// // CLdpDoc commands /*+++ Function : Cldp::OnConnectionBind Description: response to UI bind request Parameters : Return : Remarks : none. ---*/ void CLdpDoc::OnConnectionBind() { int res; CString str; LPTSTR dn, pwd, domain; ULONG ulMethod; SEC_WINNT_AUTH_IDENTITY AuthI; // // init dialog props // m_BindDlg.m_BindDn = BindDn; // Storing the password is a security violation. //m_BindDlg.m_Pwd = BindPwd; m_BindDlg.m_Domain = BindDomain; // // execute dialog request // // sync SSPI domain checkbox w/ bind options OnBindOptOK(); // Execute bind dialog if (IDOK == m_BindDlg.DoModal()) { // // sync dialog info // BindDn = m_BindDlg.m_BindDn; BindPwd = m_BindDlg.m_Pwd; BindDomain = m_BindDlg.m_Domain; ulMethod = m_BndOpt->GetAuthMethod(); // // automatically connect if we're not connected & we're in auto mode. // if (NULL == hLdap && m_GenOptDlg->m_initTree) { Connect(Svr); } // // If we have a connection // BeginWaitCursor(); if (NULL != hLdap || !m_bProtect) { // // map bind dlg info into local: // user, pwd, domain dn = BindDn.IsEmpty()? NULL: (LPTSTR)LPCTSTR(BindDn); // // Password rules: // - non-empty-- use what we have // - empty pwd: // - if user's name is NULL --> // treat as currently logged on user (pwd == NULL) // - otherwise // treat as empty pwd for user. // // if ( !BindPwd.IsEmpty() ) { // non-empty password pwd = (LPTSTR)LPCTSTR(BindPwd); } else if ( !dn ) { // pwd is empty & user dn is empty // --> treat as currently logged on pwd = NULL; } else { // pwd is empty but user isn't NULL (treat as NULL pwd) pwd = _T(""); } /* old pwd way. rm later // special case empty string "" if(!BindPwd.IsEmpty() && BindPwd == _T("\"\"")) pwd = _T(""); else pwd = BindPwd.IsEmpty()? NULL: (LPTSTR)LPCTSTR(BindPwd); */ domain = m_BindDlg.m_Domain.IsEmpty()? NULL: (LPTSTR)LPCTSTR(m_BindDlg.m_Domain); if (m_BndOpt->m_API == CBndOpt::BND_SIMPLE_API) { // // Do a simple bind // if (!m_BndOpt->m_bSync) { // // Async simple bind // str.Format(_T("res = ldap_simple_bind(ld, '%s', <unavailable>); // v.%d"), dn == NULL?_T("NULL"): dn, m_GenOptDlg->GetLdapVer()); Out(str); res = ldap_simple_bind(hLdap, dn, pwd); if (res == -1) { str.Format(_T("Error <%ld>: ldap_simple_bind() failed: %s"), res, ldap_err2string(res)); Out(str, CP_CMT); ShowErrorInfo(res); } else { // // append to pending list // CPend pnd; pnd.mID = res; pnd.OpType = CPend::P_BIND; pnd.ld = hLdap; str.Format(_T("%4d: ldap_simple_bind: dn=\"%s\"."), res, dn == NULL ? _T("NULL") : dn); pnd.strMsg = str; m_PendList.AddTail(pnd); m_PndDlg->Refresh(&m_PendList); } } else { // // Sync simple // str.Format(_T("res = ldap_simple_bind_s(ld, '%s', <unavailable>); // v.%d"), dn == NULL?_T("NULL"): dn, m_GenOptDlg->GetLdapVer()); Out(str); res = ldap_simple_bind_s(hLdap, dn, pwd); if (res != LDAP_SUCCESS) { str.Format(_T("Error <%ld>: ldap_simple_bind_s() failed: %s"), res, ldap_err2string(res)); Out(str, CP_CMT); ShowErrorInfo(res); } else { str.Format(_T("Authenticated as dn:'%s'."), dn == NULL ? _T("NULL") : dn); Out(str, CP_CMT); } } } else if (m_BndOpt->m_API == CBndOpt::BND_GENERIC_API) { // // generic bind // // // Fill in NT_Authority_Identity struct in case we use it // if (m_BndOpt->UseAuthI()) { AuthI.User = (PUCHAR) dn; AuthI.UserLength = dn == NULL ? 0 : strlen(dn); AuthI.Domain = (PUCHAR) domain; AuthI.DomainLength = domain == NULL ? 0 : strlen(domain); AuthI.Password = (PUCHAR) pwd; AuthI.PasswordLength = pwd == NULL ? 0 : strlen(pwd); AuthI.Flags = SEC_WINNT_AUTH_IDENTITY_ANSI; } if (m_BndOpt->m_bSync) { // // generic sync // if (m_BndOpt->UseAuthI()) { str.Format(_T("res = ldap_bind_s(ld, NULL, &NtAuthIdentity, %d); // v.%d"), ulMethod, m_GenOptDlg->GetLdapVer()); Out(str); str.Format(_T("\t{NtAuthIdentity: User='%s'; Pwd= <unavailable>; domain = '%s'.}"), dn == NULL ? _T("NULL") : dn, domain == NULL ? _T("NULL"): domain); Out(str); res = ldap_bind_s(hLdap, NULL, (char*)(&AuthI), ulMethod); } else { str.Format(_T("res = ldap_bind_s(ld, '%s', <unavailable>, %d); // v.%d"), dn == NULL?_T("NULL"): dn, ulMethod, m_GenOptDlg->GetLdapVer()); Out(str); res = ldap_bind_s(hLdap, dn, pwd, ulMethod); } if (res != LDAP_SUCCESS) { str.Format(_T("Error <%ld>: ldap_bind_s() failed: %s."), res, ldap_err2string(res)); Out(str, CP_CMT); ShowErrorInfo(res); } else { str.Format(_T("Authenticated as dn:'%s'."), dn == NULL ? _T("NULL") : dn); Out(str, CP_CMT); } } else { // // Async generic // if (m_BndOpt->UseAuthI()) { str.Format(_T("res = ldap_bind(ld, NULL, &NtAuthIdentity, %d); // v.%d"), ulMethod, m_GenOptDlg->GetLdapVer()); Out(str); str.Format(_T("\t{NtAuthIdentity: User='%s'; Pwd= <unavailable>; domain = '%s'}"), dn == NULL ? _T("NULL") : dn, domain == NULL ? _T("NULL"): domain); Out(str); res = ldap_bind(hLdap, NULL, (char*)(&AuthI), ulMethod); } else { str.Format("res = ldap_bind(ld, '%s', <unavailable, %d); // v.%d", dn == NULL?"NULL": dn, ulMethod, m_GenOptDlg->GetLdapVer()); Out(str); res = ldap_bind(hLdap, dn, pwd, ulMethod); } res = ldap_bind(hLdap, dn, pwd, ulMethod); if (res == -1) { str.Format(_T("Error <%ld>: ldap_bind() failed: %s"), res, ldap_err2string(res)); Out(str, CP_CMT); ShowErrorInfo(res); } else { // // append to pending list // CPend pnd; pnd.mID = res; pnd.OpType = CPend::P_BIND; pnd.ld = hLdap; str.Format(_T("%4d: ldap_bind: dn=\"%s\",method=%d"), res, dn == NULL ? _T("NULL") : dn, ulMethod); pnd.strMsg = str; m_PendList.AddTail(pnd); m_PndDlg->Refresh(&m_PendList); } } } else if (m_BndOpt->m_API == CBndOpt::BND_EXTENDED_API) { /***************** Extensions not implemented yet in wldap32.dll *********************** **** Add new NT_AUTH_IDENTITY format to extensions when implemented **** // // extended api bind // if(m_BndOpt->m_bSync){ // // generic sync // str.Format("res = ldap_bind_extended_s(ld, \"%s\", \"%s\", %d, \"%s\");", dn == NULL?"NULL": dn, pwd == NULL ?"NULL": pwd, ulMethod, m_BndOpt->GetExtendedString()); Out(str); res = ldap_bind_extended_s(hLdap, dn, pwd, ulMethod, (LPTSTR)m_BndOpt->GetExtendedString()); if(res != LDAP_SUCCESS){ str.Format("Error <%ld>: ldap_bind_extended_s() failed: %s", res, ldap_err2string(res)); Out(str, CP_CMT); } else{ str.Format("Authenticated as dn:'%s', pwd:'%s'.", dn == NULL ? "NULL" : dn, pwd == NULL ? "NULL" : pwd); Out(str, CP_CMT); } } else{ // // Async extended // str.Format("res = ldap_bind_extended(ld, \"%s\", \"%s\", %d, \"%s\");", dn == NULL?"NULL": dn, pwd == NULL ?"NULL": pwd, ulMethod, m_BndOpt->GetExtendedString()); Out(str); res = ldap_bind_extended(hLdap, dn, pwd, ulMethod, (LPTSTR)m_BndOpt->GetExtendedString()); if(res == -1){ str.Format("Error <%ld>: ldap_extended_bind() failed: %s", res, ldap_err2string(res)); Out(str, CP_CMT); } else{ CPend pnd; pnd.mID = res; pnd.OpType = CPend::P_BIND; pnd.ld = hLdap; str.Format("%4d: ldap_bind_ext: dn=\"%s\",pwd=\"%s\",method=%d", res, dn == NULL ? "NULL" : dn, pwd == NULL ? "NULL" : pwd, ulMethod); pnd.strMsg = str; m_PendList.AddTail(pnd); m_PndDlg->Refresh(&m_PendList); } } *****************************************************************************/ AfxMessageBox("Ldap_bind extensions are not implemented yet. Sorry"); } } EndWaitCursor(); // // Overwrite the memory that is storing the password, then set it to 0 length. // if ( !BindPwd.IsEmpty() ) { RtlSecureZeroMemory( pwd, strlen(pwd)); } BindPwd.Empty(); } } void CLdpDoc::AutoConnect(CString srv) { SEC_WINNT_AUTH_IDENTITY AuthI; CString str; ULONG ulMethod = LDAP_AUTH_SSPI; int res; int port = -1; PCHAR srvName, pColon; BOOL fIsSsl = FALSE; BOOL fIsGc = FALSE; BeginWaitCursor(); // parse srv string srvName = (LPTSTR)LPCTSTR(srv); // does it start with ldap:// ssl:// gc:// or gcssl:// ? if (_strnicmp(srvName, "ldap://", 7) == 0) { fIsSsl = FALSE; fIsGc = FALSE; srvName += 7; } else if (_strnicmp(srvName, "gc://", 5) == 0) { fIsSsl = FALSE; fIsGc = TRUE; srvName += 5; } else if (_strnicmp(srvName, "ssl://", 6) == 0) { fIsSsl = TRUE; fIsGc = FALSE; srvName += 6; } else if (_strnicmp(srvName, "gcssl://", 8) == 0) { fIsSsl = TRUE; fIsGc = TRUE; srvName += 8; } pColon = strchr(srvName, ':'); if (pColon) { *pColon = L'\0'; port = atoi(pColon+1); if (port == 0) port = -1; } if (port == -1) { // set default port if (fIsSsl) { port = fIsGc ? LDAP_SSL_GC_PORT : LDAP_SSL_PORT; } else { port = fIsGc ? LDAP_GC_PORT : LDAP_PORT; } } Connect(CString(srvName), port, fIsSsl); if (!hLdap) { goto finish; } AuthI.User = NULL; AuthI.UserLength = 0; AuthI.Domain = NULL; AuthI.DomainLength = 0; AuthI.Password = NULL; AuthI.PasswordLength = 0; AuthI.Flags = SEC_WINNT_AUTH_IDENTITY_ANSI; str.Format(_T("res = ldap_bind_s(ld, NULL, &NtAuthIdentity, %d); // v.%d"), ulMethod, m_GenOptDlg->GetLdapVer()); Out(str); str.Format(_T("\t{NtAuthIdentity: User='NULL'; Pwd=<unavailable>; domain = 'NULL'.}")); Out(str); res = ldap_bind_s(hLdap, NULL, (char*)(&AuthI), ulMethod); if (res != LDAP_SUCCESS) { str.Format(_T("Error <%ld>: ldap_bind_s() failed: %s."), res, ldap_err2string(res)); Out(str, CP_CMT); ShowErrorInfo(res); } else { str.Format(_T("Authenticated as dn:'NULL'.")); Out(str, CP_CMT); } finish: EndWaitCursor(); } void CLdpDoc::Connect(CString Svr, INT port, BOOL ssl){ CString str; #ifndef WINLDAP if(m_bCnctless){ AfxMessageBox("Connectionless protocol is not " "implemented for U. of Michigan API." "Continuing with ldap_open()."); m_bCnctless = FALSE; } #endif BeginWaitCursor(); // // Unsupported automatic code generation // PrintHeader(); if(m_bCnctless){ // // connectionless // #ifdef WINLDAP str.Format(_T("ld = cldap_open(\"%s\", %d);"), LPCTSTR(Svr), port); Out(str); hLdap = cldap_open(Svr.IsEmpty() ? NULL : (LPTSTR)LPCTSTR(Svr), port); #endif } else if (ssl) { ULONG version = LDAP_VERSION3; LONG lv = 0; SecPkgContext_ConnectionInfo sslInfo; int res; // Open SSL connection str.Format(_T("ld = ldap_sslinit(\"%s\", %d, 1);"), LPCTSTR(Svr), port); Out(str); hLdap = ldap_sslinit(Svr.IsEmpty() ? NULL : (LPTSTR)LPCTSTR(Svr), port, 1); if (hLdap == NULL) { goto NoConnection; } res = ldap_set_option(hLdap, LDAP_OPT_PROTOCOL_VERSION, (void*)&version); str.Format(_T("Error <0x%X> = ldap_set_option(hLdap, LDAP_OPT_PROTOCOL_VERSION, LDAP_VERSION3);"), LdapGetLastError()); Out(str); if (res != LDAP_SUCCESS) { ShowErrorInfo(res); goto NoConnection; } res = ldap_connect(hLdap, NULL); str.Format(_T("Error <0x%X> = ldap_connect(hLdap, NULL);"), LdapGetLastError()); Out(str); if (res != LDAP_SUCCESS) { ShowErrorInfo(res); goto NoConnection; } // Check for SSL support (returns LDAP_OPT_ON/_OFF) res = ldap_get_option(hLdap,LDAP_OPT_SSL,(void*)&lv); str.Format(_T("Error <0x%X> = ldap_get_option(hLdap,LDAP_OPT_SSL,(void*)&lv);"), LdapGetLastError()); Out(str); if (res != LDAP_SUCCESS) { ShowErrorInfo(res); goto NoConnection; } if (lv) { // Retrieve the SSL cipher strength res = ldap_get_option(hLdap, LDAP_OPT_SSL_INFO, &sslInfo); if (res != LDAP_SUCCESS) { str.Format(_T("Error <0x%X> = ldap_get_option(hLdap, LDAP_OPT_SSL_INFO, &sslInfo);"), LdapGetLastError()); Out(str, CP_PRN); str.Format(_T("Host supports SSL, SSL cipher strength = ? bits")); } else { str.Format(_T("Host supports SSL, SSL cipher strength = %d bits"), sslInfo.dwCipherStrength); } } else { str.Format(_T("SSL not enabled on host")); } Out(str); NoConnection: if (res != LDAP_SUCCESS && hLdap != NULL) { ldap_unbind_s(hLdap); hLdap = NULL; } // fall through } else{ // // Tcp std connection // str.Format(_T("ld = ldap_open(\"%s\", %d);"), LPCTSTR(Svr), port); Out(str); hLdap = ldap_open(Svr.IsEmpty() ? NULL : (LPTSTR)LPCTSTR(Svr), port); } EndWaitCursor(); // // If connected init flags & show base // if(hLdap != NULL){ int err; str.Format(_T("Established connection to %s."), Svr); Out(str, CP_PRN); bConnected = TRUE; // // Now that we have a valid handle we can set version // to whatever specified in general options dialog. // hLdap->ld_version = m_GenOptDlg->GetLdapVer(); m_GenOptDlg->DisableVersionUI(); // // Attempt to show base DSA info & get default context // if(m_GenOptDlg->m_initTree){ Out(_T("Retrieving base DSA information..."), CP_PRN); LDAPMessage *res = NULL; BeginWaitCursor(); err = ldap_search_s(hLdap, NULL, LDAP_SCOPE_BASE, _T("objectClass=*"), NULL, FALSE, &res); ShowErrorInfo(err); // // Get default context // if(1 == ldap_count_entries(hLdap, res)){ char **val; LDAPMessage *baseEntry; // // Get entry // baseEntry = ldap_first_entry(hLdap, res); // // Get default naming context // val = ldap_get_values(hLdap, baseEntry, LDAP_OPATT_DEFAULT_NAMING_CONTEXT); if(0 < ldap_count_values(val)) DefaultContext = (CString)val[0]; ldap_value_free(val); // get the schema naming context // val = ldap_get_values(hLdap, baseEntry, LDAP_OPATT_SCHEMA_NAMING_CONTEXT); if(0 < ldap_count_values(val)) SchemaNC = (CString)val[0]; ldap_value_free(val); // get the config naming context // val = ldap_get_values(hLdap, baseEntry, LDAP_OPATT_CONFIG_NAMING_CONTEXT); if(0 < ldap_count_values(val)) ConfigNC = (CString)val[0]; ldap_value_free(val); // get the all naming contexts // val = ldap_get_values(hLdap, baseEntry, LDAP_OPATT_NAMING_CONTEXTS); cNCList = ldap_count_values(val); if (cNCList > 0) { NCList = new CString[cNCList]; } for (DWORD i = 0; i < cNCList; i++) { NCList[i] = (CString)val[i]; } ldap_value_free(val); // get server name val = ldap_get_values(hLdap, baseEntry, LDAP_OPATT_DNS_HOST_NAME); if(0 < ldap_count_values(val)){ // // Try to extract server name: could be full DN format or just a name // so try both. // CString TitleString; if(val[0] == NULL){ Out("Error: ldap internal error: val[0] == NULL"); } else{ // // Prepare window title from dns string // char* connectionType; switch(port) { case 636: connectionType = "ssl"; break; case 3268: connectionType = "gc"; break; case 3269: connectionType = "gcssl"; break; default: connectionType = ssl ? "ssl" : "ldap"; break; } TitleString.Format("%s://%s/%s", connectionType, val[0], DefaultContext); AfxGetMainWnd()->SetWindowText(TitleString); ldap_value_free(val); } } // try to read supporteControls int cnt; val = ldap_get_values(hLdap, baseEntry, LDAP_OPATT_SUPPORTED_CONTROL); if(0 < (cnt = ldap_count_values(val)) ) { SetSupportedServerControls (cnt, val); } else { SetSupportedServerControls (0, NULL); } ldap_value_free(val); } // // Display search results // DisplaySearchResults(res); EndWaitCursor(); } else{ CString TitleString; TitleString.Format("%s - connected", AfxGetAppName()); AfxGetMainWnd()->SetWindowText(TitleString); } } else{ str.Format(_T("Error <0x%X>: Fail to connect to %s."), LdapGetLastError(), Svr); Out(str, CP_PRN); AfxMessageBox(_T("Cannot open connection.")); } } void CLdpDoc::SetSupportedServerControls (int cnt, char **val) { int i; // free existing controls if (m_ServerSupportedControls) { for (i=0; m_ServerSupportedControls[i]; i++) { free (m_ServerSupportedControls[i]); } free (m_ServerSupportedControls); m_ServerSupportedControls = NULL; } bServerVLVcapable = FALSE; if (cnt && val) { m_ServerSupportedControls = (char **)malloc (sizeof (char *) * (cnt + 1)); if (m_ServerSupportedControls) { for (i=0; i < cnt; i++) { char *pCtrl = m_ServerSupportedControls[i] = _strdup (val[i]); if (pCtrl && (strcmp (pCtrl, LDAP_CONTROL_VLVREQUEST) == 0)) { bServerVLVcapable = TRUE; } } m_ServerSupportedControls[cnt]=NULL; } } } void CLdpDoc::ShowVLVDialog (const char *strDN, BOOL runQuery) { if (!m_vlvDlg) { m_vlvDlg = new CVLVDialog; if (!m_vlvDlg) { return; } m_vlvDlg->pldpdoc = this; m_vlvDlg->Create(IDD_VLV_DLG); } else { m_vlvDlg->ShowWindow(SW_SHOW); } if (strDN) { m_vlvDlg->m_BaseDN = strDN; } m_vlvDlg->UpdateData(FALSE); if (runQuery) { m_vlvDlg->RunQuery(); } } /*+++ Function : CLdp::OnConnectionConnect Description: response to UI connect request Parameters : Return : Remarks : none. ---*/ void CLdpDoc::OnConnectionConnect() { CnctDlg dlg; CString str; int port; BOOL ssl; dlg.m_Svr = Svr; if(IDOK == dlg.DoModal()){ Svr = dlg.m_Svr; m_bCnctless = dlg.m_bCnctless; port = dlg.m_Port; ssl = dlg.m_bSsl; Connect(Svr, port, ssl); } } /*+++ Function : OnConnectionDisconnect Description: response to UI disconnect request Parameters : Return : Remarks : none. ---*/ void CLdpDoc::OnConnectionDisconnect() { CString str; // // Close connection/less session // ldap_unbind(hLdap); str.Format(_T("0x%x = ldap_unbind(ld);"), LdapGetLastError()); Out(str); // // reset connection handle // hLdap = NULL; Out(_T("Disconnected."), CP_PRN | CP_ONLY); Out(_T("}"), CP_SRC | CP_ONLY); bConnected = FALSE; DefaultContext.Empty(); cNCList = 0; if (NCList != NULL) { delete[] NCList; NCList = NULL; } m_TreeViewDlg->m_BaseDn.Empty(); m_GenOptDlg->EnableVersionUI(); CString TitleString; TitleString.Format("%s - disconnected", AfxGetAppName()); AfxGetMainWnd()->SetWindowText(TitleString); } /*+++ Function : OnBrowseSearch Description: Create modeless search diag Parameters : Return : Remarks : none. ---*/ void CLdpDoc::OnBrowseSearch() { bSrch = TRUE; if(GetContextActivation()){ SearchDlg->m_BaseDN = TreeView()->GetDn(); TreeView()->SetContextActivation(FALSE); } else if (m_vlvDlg && m_vlvDlg->GetContextActivation()) { SearchDlg->m_BaseDN = m_vlvDlg->GetDN(); m_vlvDlg->SetContextActivation(FALSE); } SearchDlg->Create(IDD_SRCH); } /*+++ Function : Description: a few UI utils Parameters : Return : Remarks : none. ---*/ void CLdpDoc::OnUpdateConnectionConnect(CCmdUI* pCmdUI) { pCmdUI->Enable(!bConnected || !m_bProtect); } void CLdpDoc::OnUpdateConnectionDisconnect(CCmdUI* pCmdUI) { pCmdUI->Enable(bConnected || !m_bProtect); } void CLdpDoc::OnUpdateBrowseSearch(CCmdUI* pCmdUI) { pCmdUI->Enable((!bSrch && bConnected) || !m_bProtect); } void CLdpDoc::OnEditCopy() { CString copyStr; if(GetContextActivation()){ copyStr = TreeView()->GetDn(); TreeView()->SetContextActivation(FALSE); } else if (m_vlvDlg && m_vlvDlg->GetContextActivation()) { copyStr = m_vlvDlg->GetDN(); m_vlvDlg->SetContextActivation(FALSE); } else { return; } if ( !OpenClipboard(HWND (AfxGetApp()->m_pActiveWnd)) ) { AfxMessageBox( "Cannot open the Clipboard" ); return; } EmptyClipboard(); HANDLE hData = GlobalAlloc (GMEM_MOVEABLE, copyStr.GetLength()+2); if (hData) { char *pStr = (char *)GlobalLock (hData); strcpy (pStr, LPCTSTR (copyStr)); GlobalUnlock (hData); if ( ::SetClipboardData( CF_TEXT, hData ) == NULL ) { AfxMessageBox( "Unable to set Clipboard data" ); CloseClipboard(); return; } } else { AfxMessageBox( "Out of memory" ); } CloseClipboard(); } void CLdpDoc::OnBrowseVlvsearch() { const char *baseDN = NULL; if(GetContextActivation()){ baseDN = LPCTSTR (TreeView()->GetDn()); TreeView()->SetContextActivation(FALSE); } ShowVLVDialog (baseDN); } void CLdpDoc::OnUpdateBrowseVlvsearch(CCmdUI* pCmdUI) { pCmdUI->Enable( (( !m_vlvDlg || (m_vlvDlg && !m_vlvDlg->GetState())) && bConnected && bServerVLVcapable) || !m_bProtect); } void CLdpDoc::OnSrchEnd(){ bSrch = FALSE; // dialog is closed. CString str; // // if in paged mode, mark end of page session // if(bPagedMode){ str.Format("ldap_search_abandon_page(ld, hPage)"); Out(str); ldap_search_abandon_page(hLdap, hPage); bPagedMode = FALSE; } } /*+++ Function : OnSrchGo Description: Response to UI search request Parameters : Return : Remarks : none. ---*/ void CLdpDoc::OnSrchGo(){ CString str; LPTSTR dn; LPTSTR filter; LDAP_TIMEVAL tm; int i; static LDAPMessage *msg; ULONG err, MsgId; ULONG ulEntryCount=0; PLDAPSortKey *SortKeys = m_SKDlg->KList; PLDAPControl *SvrCtrls; PLDAPControl *ClntCtrls; LDAPControl SortCtrl; // PLDAPControl SortCtrl=NULL; PLDAPControl *CombinedCtrl = NULL; INT cbCombined; if(!bConnected && m_bProtect) { AfxMessageBox("Please re-connect session first"); return; } // // init local time struct // tm.tv_sec = SrchInfo.lToutSec; tm.tv_usec = SrchInfo.lToutMs; // // If we're in paged mode, then run means next page, & close is abandon (see onsrchEnd) // if(bPagedMode) { ulEntryCount=0; BeginWaitCursor(); err = ldap_get_next_page_s(hLdap, hPage, &tm, SrchInfo.lPageSize, &ulEntryCount, &msg); EndWaitCursor(); str.Format("0x%X = ldap_get_next_page_s(ld, hPage, %ld, &timeout, %ld, 0x%X);", err, SrchInfo.lPageSize,ulEntryCount, msg); Out(str); if(err != LDAP_SUCCESS) { ShowErrorInfo(err); str.Format("ldap_search_abandon_page(ld, hPage)"); Out(str); ldap_search_abandon_page(hLdap, hPage); bPagedMode = FALSE; } else { bPagedMode = TRUE; } DisplaySearchResults(msg); if(err == LDAP_SUCCESS) { Out(" -=>> 'Run' for more, 'Close' to abandon <<=-"); } return; } Out("***Searching...", CP_PRN); // // set scope // int scope = SearchDlg->m_Scope == 0 ? LDAP_SCOPE_BASE : SearchDlg->m_Scope == 1 ? LDAP_SCOPE_ONELEVEL : LDAP_SCOPE_SUBTREE; // // Set time/size limits only if connected & hLdap is valid // if(bConnected) { hLdap->ld_timelimit = SrchInfo.lTlimit; hLdap->ld_sizelimit = SrchInfo.lSlimit; ULONG ulVal = SrchInfo.bChaseReferrals ? 1 : 0; ldap_set_option(hLdap, LDAP_OPT_REFERRALS, (LPVOID)&ulVal); } // // set base DN // dn = SearchDlg->m_BaseDN.IsEmpty()? NULL : (LPTSTR)LPCTSTR(SearchDlg->m_BaseDN); if(SearchDlg->m_Filter.IsEmpty() && m_bProtect) { AfxMessageBox("Please enter a valid filter string (such as objectclass=*). Empty string is invalid."); return; } // // & filter // filter = (LPTSTR)LPCTSTR(SearchDlg->m_Filter); // controls SvrCtrls = m_CtrlDlg->AllocCtrlList(ctrldlg::CT_SVR); ClntCtrls = m_CtrlDlg->AllocCtrlList(ctrldlg::CT_CLNT); // // execute search call // switch(SrchInfo.fCall) { case CALL_ASYNC: str.Format("ldap_search_ext(ld, \"%s\", %d, \"%s\", %s, %d ...)", dn, scope, filter, SrchInfo.attrList[0] != NULL ? "attrList" : "NULL", SrchInfo.bAttrOnly); Out(str); // // Combine sort & server controls // if(SortKeys != NULL) { err = ldap_encode_sort_controlA(hLdap, SortKeys, &SortCtrl, TRUE); if(err != LDAP_SUCCESS) { // str.Format("Error <0x%X>: ldap_create_create_control returned: %s", err, ldap_err2string(err)); str.Format("Error <0x%X>: ldap_create_encode_control returned: %s", err, ldap_err2string(err)); SortKeys = NULL; } } CombinedCtrl = NULL; // // count total controls // for(i=0, cbCombined=0; SvrCtrls != NULL && SvrCtrls[i] != NULL; i++) cbCombined++; CombinedCtrl = new PLDAPControl[cbCombined+2]; // // set combined // for(i=0; SvrCtrls != NULL && SvrCtrls[i] != NULL; i++) CombinedCtrl[i] = SvrCtrls[i]; if(SortKeys != NULL) CombinedCtrl[i++] = &SortCtrl; CombinedCtrl[i] = NULL; BeginWaitCursor(); err = ldap_search_ext(hLdap, dn, scope, filter, SrchInfo.attrList[0] != NULL ? SrchInfo.attrList : NULL, SrchInfo.bAttrOnly, CombinedCtrl, ClntCtrls, SrchInfo.lToutSec, SrchInfo.lSlimit, &MsgId); EndWaitCursor(); // // cleanup // if(SortKeys != NULL) { ldap_memfree(SortCtrl.ldctl_value.bv_val); ldap_memfree(SortCtrl.ldctl_oid); } delete CombinedCtrl; if(err != LDAP_SUCCESS || (DWORD)MsgId <= 0) { str.Format("Error<%lu>: %s. (msg = %lu).", err, ldap_err2string(err), MsgId); Out(str, CP_PRN); ShowErrorInfo(err); } else { // // add to pending requests // CPend pnd; pnd.mID = MsgId; pnd.OpType = CPend::P_SRCH; pnd.ld = hLdap; str.Format("%4d: ldap_search: base=\"%s\",filter=\"%s\"", MsgId, dn, filter); pnd.strMsg = str; m_PendList.AddTail(pnd); m_PndDlg->Refresh(&m_PendList); } break; case CALL_SYNC: str.Format("ldap_search_s(ld, \"%s\", %d, \"%s\", %s, %d, &msg)", dn, scope, filter, SrchInfo.attrList[0] != NULL ? "attrList" : "NULL", SrchInfo.bAttrOnly); Print(str); BeginWaitCursor(); err = ldap_search_s(hLdap, dn, scope, filter, SrchInfo.attrList[0] != NULL ? SrchInfo.attrList : NULL, SrchInfo.bAttrOnly, &msg); EndWaitCursor(); if(err != LDAP_SUCCESS) { str.Format("Error: Search: %s. <%ld>", ldap_err2string(err), err); Out(str, CP_PRN); ShowErrorInfo(err); } // // display results even if res is unsuccessfull (specs) // DisplaySearchResults(msg); break; case CALL_EXTS: str.Format("ldap_search_ext_s(ld, \"%s\", %d, \"%s\", %s, %d, svrCtrls, ClntCtrls, %ld, %ld ,&msg)", dn, scope, filter, SrchInfo.attrList[0] != NULL ? "attrList" : "NULL", SrchInfo.bAttrOnly, SrchInfo.lToutSec, SrchInfo.lSlimit); Out(str); // // Combine sort & server controls // if(SortKeys != NULL) { err = ldap_encode_sort_controlA(hLdap, SortKeys, &SortCtrl, TRUE); if(err != LDAP_SUCCESS) { str.Format("Error <0x%X>: ldap_create_encode_control returned: %s", err, ldap_err2string(err)); Out(str, CP_PRN); SortKeys = NULL; } } CombinedCtrl = NULL; // // count total controls // for(i=0, cbCombined=0; SvrCtrls != NULL && SvrCtrls[i] != NULL; i++) cbCombined++; CombinedCtrl = new PLDAPControl[cbCombined+2]; // // set combined // for(i=0; SvrCtrls != NULL && SvrCtrls[i] != NULL; i++) CombinedCtrl[i] = SvrCtrls[i]; if(SortKeys != NULL) CombinedCtrl[i++] = &SortCtrl; CombinedCtrl[i] = NULL; // // call search // BeginWaitCursor(); err = ldap_search_ext_s(hLdap, dn, scope, filter, SrchInfo.attrList[0] != NULL ? SrchInfo.attrList : NULL, SrchInfo.bAttrOnly, CombinedCtrl, ClntCtrls, &tm, SrchInfo.lSlimit, &msg); EndWaitCursor(); // // cleanup // if(SortKeys != NULL) { ldap_memfree(SortCtrl.ldctl_value.bv_val); ldap_memfree(SortCtrl.ldctl_oid); } delete CombinedCtrl; if(err != LDAP_SUCCESS) { str.Format("Error: Search: %s. <%ld>", ldap_err2string(err), err); Out(str, CP_PRN); ShowErrorInfo(err); } // // display results even if res is unsuccessfull (specs) // DisplaySearchResults(msg); break; case CALL_PAGED: str.Format("ldap_search_init_page(ld, \"%s\", %d, \"%s\", %s, %d, svrCtrls, ClntCtrls, %ld, %ld ,SortKeys)", dn, scope, filter, SrchInfo.attrList[0] != NULL ? "attrList" : "NULL", SrchInfo.bAttrOnly, SrchInfo.lTlimit, SrchInfo.lSlimit); Print(str); BeginWaitCursor(); hPage = ldap_search_init_page(hLdap, dn, scope, filter, SrchInfo.attrList[0] != NULL ? SrchInfo.attrList : NULL, SrchInfo.bAttrOnly, SvrCtrls, ClntCtrls, SrchInfo.lTlimit, SrchInfo.lSlimit, SortKeys); EndWaitCursor(); if(hPage == NULL) { err = LdapGetLastError(); str.Format("Error: Search: %s. <%ld>", ldap_err2string(err), err); Out(str, CP_PRN); ShowErrorInfo(err); } // // display results even if res is unsuccessfull (specs) // ulEntryCount=0; BeginWaitCursor(); err = ldap_get_next_page_s(hLdap, hPage, &tm, SrchInfo.lPageSize, &ulEntryCount, &msg); EndWaitCursor(); str.Format("0x%X = ldap_get_next_page_s(ld, hPage, %lu, &timeout, %ld, 0x%X);", err, SrchInfo.lPageSize,ulEntryCount, msg); Out(str); if(err != LDAP_SUCCESS) { ShowErrorInfo(err); str.Format("ldap_search_abandon_page(ld, hPage)"); Out(str); ldap_search_abandon_page(hLdap, hPage); bPagedMode = FALSE; } else { bPagedMode = TRUE; } DisplaySearchResults(msg); if(err == LDAP_SUCCESS) { Out(" -=>> 'Run' for more, 'Close' to abandon <<=-"); } break; case CALL_TSYNC: str.Format("ldap_search_st(ld, \"%s\", %d, \"%s\", %s,%d, &tm, &msg)", dn, scope, filter, SrchInfo.attrList[0] != NULL ? "attrList" : "NULL", SrchInfo.bAttrOnly); Out(str); tm.tv_sec = SrchInfo.lToutSec; tm.tv_usec = SrchInfo.lToutMs; BeginWaitCursor(); err = ldap_search_st(hLdap, dn, scope, filter, SrchInfo.attrList[0] != NULL ? SrchInfo.attrList : NULL, SrchInfo.bAttrOnly, &tm, &msg); EndWaitCursor(); if(err != LDAP_SUCCESS) { str.Format("Error: Search: %s. <%ld>", ldap_err2string(err), err); Out(str, CP_PRN); ShowErrorInfo(err); } // // display search even if res is unsuccessfull (specs) // DisplaySearchResults(msg); break; } // // Cleanup // FreeControls(SvrCtrls); FreeControls(ClntCtrls); } /*+++ Function : DisplaySearchResults Description: Display results Parameters : Return : Remarks : none. ---*/ void CLdpDoc::DisplaySearchResults(LDAPMessage *msg){ // // Parse results // CString str, strDN; char *dn; void *ptr; char *attr; LDAPMessage *nxt; ULONG nEntries; CLdpView *pView; pView = (CLdpView*)GetOwnView(_T("CLdpView")); ParseResults(msg); Out("", CP_ONLY|CP_SRC); str.Format("Getting %lu entries:", ldap_count_entries(hLdap, msg)); Out(str, CP_PRN); if(!SrchOptDlg.m_bDispResults) Out(_T("<Skipping search results display (search options)...>")); // // disable redraw // pView->SetRedraw(FALSE); pView->CacheStart(); // // traverse entries // for(nxt = ldap_first_entry(hLdap, msg)/*, Out("nxt = ldap_first_entry(ld, msg);", CP_ONLY|CP_SRC)*/, nEntries = 0; nxt != NULL; nxt = ldap_next_entry(hLdap, nxt)/*, Out("nxt = ldap_next_entry(ld,nxt);", CP_ONLY|CP_SRC)*/, nEntries++){ // // get dn text & process // // Out("dn = ldap_get_dn(ld,nxt);", CP_ONLY|CP_SRC); dn = ldap_get_dn(hLdap, nxt); strDN = DNProcess(dn); if(m_SrcMode){ str = "\tprintf(\"Dn: %%s\\n\", dn);"; } else{ str = CString(">> Dn: ") + strDN; } if(SrchOptDlg.m_bDispResults) Out(str); // // traverse attributes // for(attr = ldap_first_attribute(hLdap, nxt, (BERPTRTYPE)&ptr)/*, Out("attr = ldap_first_attribute(ld, nxt, (BERPTRTYPE)&ptr);", CP_ONLY|CP_SRC)*/; attr != NULL; attr = ldap_next_attribute(hLdap, nxt, (struct berelement*)ptr)/*, Out("attr = ldap_next_attribute(ld, nxt, (struct berelement*)ptr);", CP_ONLY|CP_SRC) */){ // Out("\tprintf(\"\\t%%s: \", attr);", CP_ONLY|CP_SRC); // // display values // if(m_GenOptDlg->m_ValProc == STRING_VAL_PROC){ DisplayValues(nxt, attr); } else{ DisplayBERValues(nxt, attr); } } // Out("", CP_ONLY|CP_SRC); } // // verify consistency // if(nEntries != ldap_count_entries(hLdap, msg)){ str.Format("Error: ldap_count_entries reports %lu entries. Parsed %lu.", ldap_count_entries(hLdap, msg), nEntries); Out(str, CP_PRN); } Out("ldap_msgfree(msg);", CP_ONLY|CP_SRC); ldap_msgfree(msg); Out("-----------", CP_PRN); Out("", CP_ONLY|CP_SRC); // // now allow refresh // pView->CacheEnd(); pView->SetRedraw(); } DWORD AsciiStrToWideStr( const char * szIn, WCHAR ** pwszOut ) /*++ Routine Description: Converts an ASCI or UTF-8 string into a wide char string. Arguments: szIn - null terminated ASCII string in. pwszOut - malloc'd (and null terminated) string out. Return Value: Win32 Error code --*/ { DWORD dwRet = ERROR_SUCCESS; LPWSTR lpWStr = NULL; if (szIn == NULL || pwszOut == NULL) { ASSERT(!"Invalid parameter"); return(ERROR_INVALID_PARAMETER); } *pwszOut = NULL; // // Get UNICODE str size // int cblpWStr = MultiByteToWideChar(CP_ACP, // code page MB_ERR_INVALID_CHARS, // return err (LPCSTR)szIn, // input -1, // null terminated lpWStr, // converted 0); // calc size if(cblpWStr == 0){ dwRet = GetLastError(); ASSERT(dwRet); dwRet = dwRet ? dwRet : ERROR_INVALID_PARAMETER; return(dwRet); } else { // // Get UNICODE str // lpWStr = (LPWSTR)malloc(sizeof(WCHAR)*cblpWStr); cblpWStr = MultiByteToWideChar(CP_ACP, // code page MB_ERR_INVALID_CHARS, // return err (LPCSTR)szIn, // input -1, // null terminated lpWStr, // converted cblpWStr); // size if(cblpWStr == 0){ free(lpWStr); dwRet = GetLastError(); ASSERT(dwRet); dwRet = dwRet ? dwRet : ERROR_INVALID_PARAMETER; return(dwRet); } } *pwszOut = lpWStr; return(dwRet); } // // Global ObjDump options for ldp. // OBJ_DUMP_OPTIONS ObjDumpOptions = { OBJ_DUMP_VAL_FRIENDLY_KNOWN_BLOBS, NULL, NULL, NULL, NULL }; // FUTURE-2002/08/18-BrettSh - In the future it would be nice to improve // this so ldp could set these dump options, and furthure integrate the // xlist\obj_dump.c routines with ldp such that ldp could have the option // of dumping say all values if it wanted to. /*+++ Function : FormatValue Description: generates a string from a berval value this provides a tiny substitute to loading the schema dynamically & provide some minimal value parsing for most important/requested attributes Parameters : pbval: a ptr to berval value str: result Return : Remarks : none. ---*/ VOID CLdpDoc::FormatValue( IN CString attr, IN PLDAP_BERVAL pbval, IN PWCHAR* objClassVal, IN CString& str){ DWORD err; CString tstr; BOOL bValid; WCHAR * szAttrTemp = NULL; WCHAR * szValTemp = NULL; // BAS_TODO ... add comment about not adding new clauses here ... // BAS_TODO assert's aren't firing in ldp ... should make them fire. ASSERT(!"BAS_TODO We're in here"); if (!pbval) { tstr = "<value format error>"; } else { // // New string formating routine ... // err = AsciiStrToWideStr(attr, &szAttrTemp); if (err == 0) { ASSERT(szAttrTemp); err = ValueToString(szAttrTemp, objClassVal, (PBYTE) pbval->bv_val, pbval->bv_len, &ObjDumpOptions, &szValTemp); if (err == 0) { // AaronN basically ... I have this function ValueToString() that takes some params and gives a nice // Unicode/wide char string representation of those params ... then I need to merge this string // into the resulting string in such a way as if instead attr = "objectGuid" (follow this path) to // then end to get an idea of how it's handled ... // So is the right thing going to happen here? because szValTemp is a WCHAR *, and below // w/ pszGuid it's a CHAR * ... is this going to be a cool C++ constructor thing? tstr = szValTemp; str += tstr; LocalFree(szValTemp); // can I free this? free(szAttrTemp); return; } else { xListClearErrors(); // BAS_TODO } free(szAttrTemp); } if ( 0 == _stricmp(attr, "objectGuid") || 0 == _stricmp(attr, "invocationId") || 0 == _stricmp(attr, "attributeSecurityGUID") || 0 == _stricmp(attr, "schemaIDGUID") || 0 == _stricmp(attr, "serviceClassID") ) { // // format as a guid // PUCHAR pszGuid = NULL; ASSERT(!"Why wasn't this handled in ValueToString()?"); err = UuidToString((GUID*)pbval->bv_val, &pszGuid); if(err != RPC_S_OK){ tstr.Format("<ldp error %lu: UuidFromString failure>", err); } if ( pszGuid ) { tstr = pszGuid; RpcStringFree(&pszGuid); } else { tstr = "<invalid Guid>"; } } else if ( 0 == _stricmp(attr, "objectSid") || 0 == _stricmp(attr, "sidHistory") ) { // // format as object sid // PSID psid = pbval->bv_val; LPSTR pszTmp = NULL; ASSERT(!"Why wasn't this handled in ValueToString()?"); if ( ConvertSidToStringSidA(psid, &pszTmp) && pszTmp ) { tstr = pszTmp; LocalFree(pszTmp); } else { tstr = "<ldp error: invalid sid>"; } } else if (( 0 == _stricmp(attr, "whenChanged") || 0 == _stricmp(attr, "whenCreated") || 0 == _stricmp(attr, "dSCorePropagationData") || 0 == _stricmp(attr, "msDS-Entry-Time-To-Die") || 0 == _stricmp(attr, "schemaUpdate") || 0 == _stricmp(attr, "modifyTimeStamp") || 0 == _stricmp(attr, "createTimeStamp") || 0 == _stricmp(attr, "currentTime")) && (atoi (pbval->bv_val) != 0)) { // // print in time format // SYSTEMTIME sysTime, localTime; ASSERT(!"Why wasn't this handled in ValueToString()?"); err = GeneralizedTimeToSystemTime(pbval->bv_val, &sysTime); if( ERROR_SUCCESS == err) { TIME_ZONE_INFORMATION tz; BOOL bstatus; err = GetTimeZoneInformation(&tz); if ( err == TIME_ZONE_ID_INVALID ) { tstr.Format("<ldp error <%lu>: cannot format time field>", GetLastError()); } else { bstatus = SystemTimeToTzSpecificLocalTime( (err == TIME_ZONE_ID_UNKNOWN) ? NULL : &tz, &sysTime, &localTime ); if ( bstatus ) { tstr.Format("%d/%d/%d %d:%d:%d %S %S", localTime.wMonth, localTime.wDay, localTime.wYear, localTime.wHour, localTime.wMinute, localTime.wSecond, tz.StandardName, tz.DaylightName); } else { tstr.Format("%d/%d/%d %d:%d:%d UNC", localTime.wMonth, localTime.wDay, localTime.wYear, localTime.wHour, localTime.wMinute, localTime.wSecond); } } } else { tstr.Format("<ldp error <0x%x>: Time processing failed in GeneralizedTimeToSystemTime>", err); } } else if ((0 == _stricmp(attr, "accountExpires") || 0 == _stricmp(attr, "badPasswordTime") || 0 == _stricmp(attr, "creationTime") || 0 == _stricmp(attr, "lastLogon") || 0 == _stricmp(attr, "lastLogoff") || 0 == _stricmp(attr, "lastLogonTimestamp") || 0 == _stricmp(attr, "pwdLastSet") || 0 == _stricmp(attr, "msDS-Cached-Membership-Time-Stamp")) && (atoi (pbval->bv_val) != 0)) { // // print in time format // SYSTEMTIME sysTime, localTime; ASSERT(!"Why wasn't this handled in ValueToString()?"); err = DSTimeToSystemTime(pbval->bv_val, &sysTime); if( ERROR_SUCCESS == err) { TIME_ZONE_INFORMATION tz; BOOL bstatus; err = GetTimeZoneInformation(&tz); if ( err != TIME_ZONE_ID_INVALID && err != TIME_ZONE_ID_UNKNOWN ) { bstatus = SystemTimeToTzSpecificLocalTime(&tz, &sysTime, &localTime); if ( bstatus ) { tstr.Format("%d/%d/%d %d:%d:%d %S %S", localTime.wMonth, localTime.wDay, localTime.wYear, localTime.wHour, localTime.wMinute, localTime.wSecond, tz.StandardName, tz.DaylightName); } else { tstr.Format("%d/%d/%d %d:%d:%d UNC", localTime.wMonth, localTime.wDay, localTime.wYear, localTime.wHour, localTime.wMinute, localTime.wSecond); } } else { tstr.Format("<ldp error <0x%x>: cannot format time field", err); } } else { tstr.Format("<ldp error <0x%x>: cannot format time field", err); } } else if (0 == _stricmp(attr, "lockoutDuration") || 0 == _stricmp(attr, "lockoutObservationWindow") || 0 == _stricmp(attr, "forceLogoff") || 0 == _stricmp(attr, "minPwdAge") || 0 == _stricmp(attr, "maxPwdAge")) { // // Caculate the duration for this value // it's stored as a negitive value in nanoseconds. // a value of -9223372036854775808 is never __int64 lTemp; ASSERT(!"Why wasn't this handled in ValueToString()?"); lTemp = _atoi64 (pbval->bv_val); if (lTemp > 0x8000000000000000){ lTemp = lTemp * -1; lTemp = lTemp / 10000000; tstr.Format("%ld", lTemp); } else tstr.Format("%s (none)", pbval->bv_val); } else if (0 == _stricmp(attr, "userAccountControl") || 0 == _stricmp(attr, "groupType") || 0 == _stricmp(attr, "systemFlags") ) { ASSERT(!"Why wasn't this handled in ValueToString()?"); tstr.Format("0x%x", atoi (pbval->bv_val)); } else if ( 0 == _stricmp(attr, "dnsRecord") ) { // Taken from \nt\private\net\sockets\dns\server\server\record.h // // DS Record // typedef struct _DsRecord { WORD wDataLength; WORD wType; //DWORD dwFlags; BYTE Version; BYTE Rank; WORD wFlags; DWORD dwSerial; DWORD dwTtlSeconds; DWORD dwTimeout; DWORD dwStartRefreshHr; union _DataUnion { struct { LONGLONG EntombedTime; } Tombstone; } Data; } DS_RECORD, *PDS_RECORD; // // foramt as a dns record // PDS_RECORD pDnsRecord = (PDS_RECORD)pbval->bv_val; DWORD cbDnsRecord = pbval->bv_len; bValid=TRUE; if ( cbDnsRecord < sizeof(DS_RECORD) ) { tstr.Format("<ldp error: cannot format DS_DNSRECORD field"); // // Weird way to store info...but this is still valid // bValid = cbDnsRecord == sizeof(DS_RECORD)-4 ? TRUE : FALSE; } // // ready to print // if ( bValid ) { PBYTE pData = ((PBYTE)pDnsRecord+sizeof(DS_RECORD)-sizeof(LONGLONG)); DWORD cbData = pDnsRecord->wDataLength; CString sData; tstr.Format("wDataLength: %d " "wType: %d; " "Version: %d " "Rank: %d " "wFlags: %d " "dwSerial: %lu " "dwTtlSeconds: %lu " "dwTimeout: %lu " "dwStartRefreshHr: %lu " "Data: ", pDnsRecord->wDataLength, pDnsRecord->wType, pDnsRecord->Version, pDnsRecord->Rank, pDnsRecord->wFlags, pDnsRecord->dwSerial, pDnsRecord->dwTtlSeconds, pDnsRecord->dwTimeout, pDnsRecord->dwStartRefreshHr); DumpBuffer(pData, cbData, sData); tstr += sData; } } else if ( 0 == _stricmp(attr, "replUpToDateVector") ) { // // foramt as Uptodatevector /* typedef struct _UPTODATE_VECTOR { DWORD dwVersion; DWORD dwReserved1; SWITCH_IS(dwVersion) union { CASE(1) UPTODATE_VECTOR_V1 V1; }; } UPTODATE_VECTOR; typedef struct _UPTODATE_VECTOR_V1 { DWORD cNumCursors; DWORD dwReserved2; #ifdef MIDL_PASS [size_is(cNumCursors)] UPTODATE_CURSOR rgCursors[]; #else UPTODATE_CURSOR rgCursors[1]; #endif } UPTODATE_VECTOR_V1; etc... */ // UPTODATE_VECTOR *pUtdVec = (UPTODATE_VECTOR *)pbval->bv_val; DWORD cbUtdVec = pbval->bv_len; if ( pUtdVec->dwVersion != 1 ) { tstr.Format("<ldp error: cannot process UPDATE_VECTOR v.%lu>", pUtdVec->dwVersion ); } else { tstr.Format("dwVersion: %lu, dwReserved1: %lu, V1.cNumCursors: %lu, V1.dwReserved2: %lu,rgCursors: ", pUtdVec->dwVersion, pUtdVec->dwReserved1, pUtdVec->V1.cNumCursors, pUtdVec->V1.dwReserved2 ); bValid = TRUE; for (INT i=0; bValid && i < pUtdVec->V1.cNumCursors; i++) { PUCHAR pszGuid = NULL; err = UuidToString(&(pUtdVec->V1.rgCursors[i].uuidDsa), &pszGuid); if(err != RPC_S_OK || !pszGuid){ tstr.Format("<ldp error %lu: UuidFromString failure>", err); bValid = FALSE; } else { CString strCursor; strCursor.Format("{uuidDsa: %s, usnHighPropUpdate: %I64d}, ", pszGuid, pUtdVec->V1.rgCursors[i].usnHighPropUpdate); RpcStringFree(&pszGuid); tstr += strCursor; } } } } else if ( 0 == _stricmp(attr, "repsFrom") || 0 == _stricmp(attr, "repsTo") ) { // // format as REPLICA_LINK /* typedef struct _ReplicaLink_V1 { ULONG cb; // total size of this structure ULONG cConsecutiveFailures; // * number of consecutive call failures along // this link; used by the KCC to route around // servers that are temporarily down DSTIME timeLastSuccess; // (Reps-From) time of last successful replication or // (Reps-To) time at which Reps-To was added or updated DSTIME timeLastAttempt; // * time of last replication attempt ULONG ulResultLastAttempt; // * result of last replication attempt (DRSERR_*) ULONG cbOtherDraOffset; // offset (from struct *) of other-dra MTX_ADDR ULONG cbOtherDra; // size of other-dra MTX_ADDR ULONG ulReplicaFlags; // zero or more DRS_* flags REPLTIMES rtSchedule; // * periodic replication schedule // (valid only if ulReplicaFlags & DRS_PER_SYNC) USN_VECTOR usnvec; // * propagation state UUID uuidDsaObj; // objectGUID of other-dra's ntdsDSA object UUID uuidInvocId; // * invocation id of other-dra UUID uuidTransportObj; // * objectGUID of interSiteTransport object // corresponding to the transport by which we // communicate with the source DSA DWORD dwReserved1; // * unused // and it assumes max size of DWORD rather then the extensible // DRS_EXTENSIONS. We would filter only those props we're interested in // storing in RepsFrom so it should last for a while (32 exts) ULONG cbPASDataOffset; // * offset from beginning of struct to PAS_DATA section BYTE rgb[]; // storage for the rest of the structure // * indicates valid only on Reps-From } REPLICA_LINK_V1; typedef struct _ReplicaLink { DWORD dwVersion; union { REPLICA_LINK_V1 V1; }; } REPLICA_LINK; etc... */ // REPLICA_LINK *pReplink = (REPLICA_LINK *)pbval->bv_val; DWORD cbReplink = pbval->bv_len; // See what generation did we read BOOL fShowExtended = pReplink->V1.cbOtherDraOffset == offsetof(REPLICA_LINK, V1.rgb); BOOL fUsePasData = fShowExtended && pReplink->V1.cbPASDataOffset; PPAS_DATA pPasData = fUsePasData ? RL_PPAS_DATA(pReplink) : NULL; if ( pReplink->dwVersion != 1 ) { tstr.Format("<ldp error: cannot process REPLICA_LINK v.%lu>", pReplink->dwVersion ); } else { PUCHAR pszUuidDsaObj=NULL, pszUuidInvocId=NULL, pszUuidTransportObj=NULL; // Workaround CString inability to convert several longlong in a sequence (eyals) CString strLastSuccess, strLastAttempt, strUsnHighObj, strUsnHighProp; strLastSuccess.Format("%I64d", pReplink->V1.timeLastSuccess); strLastAttempt.Format("%I64d", pReplink->V1.timeLastAttempt); strUsnHighObj.Format("%I64d", pReplink->V1.usnvec.usnHighObjUpdate); strUsnHighProp.Format("%I64d", pReplink->V1.usnvec.usnHighPropUpdate); (VOID)UuidToString(&(pReplink->V1.uuidDsaObj), &pszUuidDsaObj); (VOID)UuidToString(&(pReplink->V1.uuidInvocId), &pszUuidInvocId); (VOID)UuidToString(&(pReplink->V1.uuidTransportObj), &pszUuidTransportObj); tstr.Format("dwVersion = 1, " \ "V1.cb: %lu, " \ "V1.cConsecutiveFailures: %lu " \ "V1.timeLastSuccess: %s " \ "V1.timeLastAttempt: %s " \ "V1.ulResultLastAttempt: 0x%X " \ "V1.cbOtherDraOffset: %lu " \ "V1.cbOtherDra: %lu " \ "V1.ulReplicaFlags: 0x%x " \ "V1.rtSchedule: <ldp:skipped> " \ "V1.usnvec.usnHighObjUpdate: %s " \ "V1.usnvec.usnHighPropUpdate: %s " \ "V1.uuidDsaObj: %s " \ "V1.uuidInvocId: %s " \ "V1.uuidTransportObj: %s " \ "V1~mtx_address: %s " \ "V1.cbPASDataOffset: %lu " \ "V1~PasData: version = %d, size = %d, flag = %d ", pReplink->V1.cb, pReplink->V1.cConsecutiveFailures, strLastSuccess, strLastAttempt, pReplink->V1.ulResultLastAttempt, pReplink->V1.cbOtherDraOffset, pReplink->V1.cbOtherDra, pReplink->V1.ulReplicaFlags, strUsnHighObj, strUsnHighProp, pszUuidDsaObj ? (PCHAR)pszUuidDsaObj : "<Invalid Uuid>", pszUuidInvocId ? (PCHAR)pszUuidInvocId : "<Invalid Uuid>", pszUuidTransportObj ? (PCHAR)pszUuidTransportObj : "<Invalid Uuid>", RL_POTHERDRA(pReplink)->mtx_name, fUsePasData ? pReplink->V1.cbPASDataOffset : 0, pPasData ? pPasData->version : -1, pPasData ? pPasData->size : -1, pPasData ? pPasData->flag : -1); if (pszUuidDsaObj) { RpcStringFree(&pszUuidDsaObj); } if (pszUuidInvocId) { RpcStringFree(&pszUuidInvocId); } if (pszUuidTransportObj) { RpcStringFree(&pszUuidTransportObj); } } } else if ( 0 == _stricmp(attr, "schedule") ) { // // foramt as Schedule /* typedef struct _repltimes { UCHAR rgTimes[84]; } REPLTIMES; */ // // // Hack: // Note that we're reding rgtimes[168] (see SCHEDULE_DATA_ENTRIES) but storing // in rgtimes[84]. We're ok here but this is ugly & not maintainable & for sure will // break sometimes soon. // The problem is due to inconsistency due to storing the schedule in 1 byte == 1 hour // whereas the internal format is using 1 byte == 2 hours. (hence 84 to 168). // CString strSched; PBYTE pTimes; PSCHEDULE pSched = (PSCHEDULE)pbval->bv_val;; DWORD cbSched = pbval->bv_len; if ( cbSched != sizeof(SCHEDULE)+SCHEDULE_DATA_ENTRIES ) { tstr.Format("<ldp: cannot format schedule. sizeof(REPLTIMES) = %d>", cbSched ); } else { INT bitCount=0; tstr.Format("Size: %lu, Bandwidth: %lu, NumberOfSchedules: %lu, Schedules[0].Type: %lu, " \ "Schedules[0].Offset: %lu ", pSched->Size, pSched->Bandwidth, pSched->NumberOfSchedules, pSched->Schedules[0].Type, pSched->Schedules[0].Offset ); pTimes = (BYTE*)((PBYTE)pSched + pSched->Schedules[0].Offset); // traverse schedule blob strSched = " "; for ( INT i=0; i<168;i++ ) { BYTE byte = *(pTimes+i); for ( INT j=0; j<=3;j++ ) { // traverse bits & mark on/off strSched += (byte & (1 << j))? "1" : "0"; if( (++bitCount % 4) == 0 ) { // hour boundary strSched += "."; } if ( (bitCount % 96) == 0) { // a day boundary strSched += " "; } } } tstr += strSched; } } else if ( 0 == _stricmp(attr, "partialAttributeSet") ) { // // foramt as PARTIAL_ATTR_VECTOR /* // PARTIAL_ATTR_VECTOR - represents the partial attribute set. This is an array of // sorted attids that make the partial set. typedef struct _PARTIAL_ATTR_VECTOR_V1 { DWORD cAttrs; // count of partial attributes in the array #ifdef MIDL_PASS [size_is(cAttrs)] ATTRTYP rgPartialAttr[]; #else ATTRTYP rgPartialAttr[1]; #endif } PARTIAL_ATTR_VECTOR_V1; // We need to make sure the start of the union is aligned at an 8 byte // boundary so that we can freely cast between internal and external // formats. typedef struct _PARTIAL_ATTR_VECTOR_INTERNAL { DWORD dwVersion; DWORD dwFlag; SWITCH_IS(dwVersion) union { CASE(1) PARTIAL_ATTR_VECTOR_V1 V1; }; } PARTIAL_ATTR_VECTOR_INTERNAL; typedef PARTIAL_ATTR_VECTOR_INTERNAL PARTIAL_ATTR_VECTOR; */ // CString strPAS; PARTIAL_ATTR_VECTOR *pPAS = (PARTIAL_ATTR_VECTOR*)pbval->bv_val;; DWORD cbPAS = pbval->bv_len; if ( cbPAS < sizeof(PARTIAL_ATTR_VECTOR)) { tstr.Format("<ldp: cannot format partialAttributeSet. sizeof(PARTIAL_ATTR_VECTOR) = %d>", cbPAS ); } else { tstr.Format("dwVersion: %lu, dwFlag: %lu, V1.cAttrs: %lu, V1.rgPartialAttr: ", pPAS->dwVersion, pPAS->dwReserved1, pPAS->V1.cAttrs); // traverse partial attr list for ( INT i=0; i<pPAS->V1.cAttrs; i++ ) { strPAS.Format("%X ", pPAS->V1.rgPartialAttr[i]); tstr += strPAS; } } } else { // // unknown attribute. // try to find if it's printable // BOOL bPrintable=TRUE; for (INT i=0; i<pbval->bv_len; i++) { if (!isalpha(pbval->bv_val[i]) && !isspace(pbval->bv_val[i]) && !isdigit(pbval->bv_val[i]) && !isgraph(pbval->bv_val[i]) && pbval->bv_val[i] != 0 // accept Null terminated strings ) { bPrintable = FALSE; break; } } if (bPrintable) { tstr = pbval->bv_val; } else { tstr = "<ldp: Binary blob>"; } } } str += tstr; } /*+++ Function : DisplayValues Description: printout the values of a dn Parameters : Return : Remarks : none. ---*/ void CLdpDoc::DisplayValues(LDAPMessage *entry, char *attr){ LDAP_BERVAL **bval; unsigned long i; CString str; PWCHAR* objClassVal = NULL; // do we have an objectClass in among the values? objClassVal = ldap_get_valuesW(hLdap, entry, L"objectClass"); // // get & traverse values // bval = ldap_get_values_len(hLdap, entry, attr); // Out("val = ldap_get_values(ld, nxt, attr);", CP_ONLY|CP_SRC); str.Format("\t%lu> %s: ", ldap_count_values_len(bval), attr); for(i=0/*, Out("i=0;", CP_ONLY|CP_SRC)*/; bval != NULL && bval[i] != NULL; i++/*, Out("i++;", CP_ONLY|CP_SRC)*/){ FormatValue(attr, bval[i], objClassVal, str); str += "; "; // Out("\tprintf(\"\\t\\t%%s; \",val[i]);", CP_ONLY|CP_SRC); } // Out("\\n", CP_ONLY|CP_PRN); if(SrchOptDlg.m_bDispResults) Out(str, CP_CMT); // Out("", CP_ONLY|CP_SRC); if(i != ldap_count_values_len(bval)){ str.Format("Error: ldap_count_values_len reports %lu values. Parsed %lu", ldap_count_values_len(bval), i); Out(str, CP_PRN); } // // free up mem // if(bval != NULL){ ldap_value_free_len(bval); // Out("ldap_value_free(val);", CP_ONLY|CP_SRC); } if (objClassVal != NULL) { ldap_value_freeW(objClassVal); } } /*+++ Function : DisplayBERValues Description: Display values using BER interface Parameters : Return : Remarks : none. ---*/ void CLdpDoc::DisplayBERValues(LDAPMessage *entry, char *attr){ struct berval **val; unsigned long i; CString str, tmpStr; // // get & traverse values // val = ldap_get_values_len(hLdap, entry, attr); // Out("val = ldap_get_values_len(ld, nxt, attr);", CP_ONLY|CP_SRC); str.Format("\t%lu> %s: ", ldap_count_values_len(val), attr); for(i=0/*, Out("i=0;", CP_ONLY|CP_SRC)*/; val != NULL && val[i] != NULL; i++/*, Out("i++;", CP_ONLY|CP_SRC)*/){ DumpBuffer(val[i]->bv_val, val[i]->bv_len, tmpStr); str += tmpStr; // Out("\tprintf(\"\\t\\t%%s; \",val[i]);", CP_ONLY|CP_SRC); } // Out("\\n", CP_ONLY|CP_PRN); if(SrchOptDlg.m_bDispResults) Out(str, CP_CMT); // Out("", CP_ONLY|CP_SRC); // // verify consistency // if(i != ldap_count_values_len(val)){ str.Format("Error: ldap_count_values reports %lu values. Parsed %lu", ldap_count_values_len(val), i); Out(str, CP_PRN); } // // free up // if(val != NULL){ ldap_value_free_len(val); // Out("ldap_value_free(val);", CP_ONLY|CP_SRC); } } /*+++ Function : DNProcess Description: process DN format for display (types etc) Parameters : Return : Remarks : none. ---*/ CString CLdpDoc::DNProcess(PCHAR dn){ CString strDN; PCHAR *DNs; int i; // // pre-process dn before displaying // switch(m_GenOptDlg->m_DnProc){ case CGenOpt::GEN_DN_NONE: strDN = dn; break; case CGenOpt::GEN_DN_EXPLD: DNs = ldap_explode_dn(dn, FALSE); strDN.Empty(); for(i=0; DNs!= NULL && DNs[i] != NULL; i++){ strDN += CString(DNs[i]) + "; "; } ldap_value_free(DNs); break; case CGenOpt::GEN_DN_NOTYPE: DNs = ldap_explode_dn(dn, TRUE); strDN.Empty(); for(i=0; DNs!= NULL && DNs[i] != NULL; i++){ strDN += CString(DNs[i]) + "; "; } ldap_value_free(DNs); break; case CGenOpt::GEN_DN_UFN: strDN = ldap_dn2ufn(dn); break; default: strDN.Empty(); } return strDN; } /*+++ Function : Description: UI handlers Parameters : Return : Remarks : none. ---*/ void CLdpDoc::OnBrowseAdd() { bAdd = TRUE; if(GetContextActivation()){ m_AddDlg->m_Dn = TreeView()->GetDn(); TreeView()->SetContextActivation(FALSE); } else if (m_vlvDlg && m_vlvDlg->GetContextActivation()) { m_AddDlg->m_Dn = m_vlvDlg->GetDN(); m_vlvDlg->SetContextActivation(FALSE); } m_AddDlg->Create(IDD_ADD); } void CLdpDoc::OnUpdateBrowseAdd(CCmdUI* pCmdUI) { pCmdUI->Enable((!bAdd && bConnected) || !m_bProtect); } void CLdpDoc::OnAddEnd(){ bAdd = FALSE; } /*+++ Function : OnAddGo Description: Response to ADd request Parameters : Return : Remarks : none. ---*/ void CLdpDoc::OnAddGo(){ if(!bConnected && m_bProtect){ AfxMessageBox("Please re-connect session first"); return; } Out("***Calling Add...", CP_PRN); int nMaxEnt = m_AddDlg->GetEntryCount(); int res; LDAPMod *attr[MAXLIST]; char *p[MAXLIST], *pTok; int i, j; CString str; LPTSTR dn, lpBERVals; // // traverse & setup attributes // for(i = 0, Out("i=0;", CP_ONLY|CP_SRC); i<nMaxEnt; i++, Out("i++;", CP_ONLY | CP_SRC)){ attr[i] = (LDAPMod *)malloc(sizeof(LDAPMod)); ASSERT(attr[i] != NULL); Out("mods[i] = (struct ldapmod*)malloc(sizeof(LDAPMod));", CP_ONLY|CP_SRC); // // add a std value // if(NULL == (lpBERVals = strstr(LPCTSTR(m_AddDlg->GetEntry(i)), "\\BER(")) && NULL == (lpBERVals = strstr(LPCTSTR(m_AddDlg->GetEntry(i)), "\\SDDL:")) && NULL == (lpBERVals = strstr(LPCTSTR(m_AddDlg->GetEntry(i)), "\\UNI"))){ attr[i]->mod_values = (char**)malloc(sizeof(char*)*MAXLIST); ASSERT(attr[i]->mod_values != NULL); Out("mods[i]->mod_values = (char**)malloc(sizeof(char*)*MAXLIST);", CP_ONLY|CP_SRC); attr[i]->mod_op = 0; Out("mods[i]->mod_op = 0;", CP_ONLY|CP_SRC); p[i] = _strdup(LPCTSTR(m_AddDlg->GetEntry(i))); ASSERT(p[i] != NULL); attr[i]->mod_type = strtok(p[i], ":\n"); str.Format("mods[i]->mod_type = _strdup(\"%s\");", attr[i]->mod_type); Out(str, CP_ONLY|CP_SRC); for(j=0, pTok = strtok(NULL, ";\n"); pTok; pTok= strtok(NULL, ";\n"), j++){ attr[i]->mod_values[j] = pTok; str.Format("mods[i]->mod_values[%d] = _strdup(\"%s\");", j, pTok); Out(str, CP_ONLY|CP_SRC); } attr[i]->mod_values[j] = NULL; str.Format("mods[i]->mod_values[%d] = NULL", j); Out(str, CP_ONLY|CP_SRC); } else{ // // Add BER values // // // allocate value array buffer // attr[i]->mod_bvalues = (struct berval**)malloc(sizeof(struct berval*)*MAXLIST); // // prefast bug 653640, check that malloc did not retun null // if(NULL == attr[i]->mod_bvalues){ AfxMessageBox("Error: Out of memory", MB_ICONHAND); ASSERT( attr[i]->mod_bvalues != NULL); return; } // // initialize operand // attr[i]->mod_op = LDAP_MOD_BVALUES; Out("mods[i]->mod_op = LDAP_MOD_BVALUES;", CP_ONLY|CP_SRC); // // set entry attribute // p[i] = _strdup(LPCTSTR(m_AddDlg->GetEntry(i))); ASSERT(p[i] != NULL); attr[i]->mod_type = strtok(p[i], ":\n"); str.Format("mods[i]->mod_type = _strdup(\"%s\");", attr[i]->mod_type); Out(str, CP_ONLY|CP_SRC); // point to the beginning of the value pTok = p[i] + strlen(attr[i]->mod_type) + 1; if (_strnicmp(pTok, "\\SDDL:", 6) == 0) { // special case: value is in SDDL format (most likely, a security descriptor) // we can not use ';' as a separator because it is used in SDDL. So, assume // there's just one value (which is always the case for NTSD) PSECURITY_DESCRIPTOR pSD; DWORD cbSD; pTok += 6; j = 0; if (ConvertStringSecurityDescriptorToSecurityDescriptor( pTok, SDDL_REVISION_1, &pSD, &cbSD)) { // value is good. Copy it. attr[i]->mod_bvalues[j] = (struct berval*)malloc(sizeof(struct berval)); // // prefast bug 653638, check that malloc did not retun null // if(NULL == attr[i]->mod_bvalues[j]){ AfxMessageBox("Error: Out of memory", MB_ICONHAND); ASSERT( attr[i]->mod_bvalues[j] != NULL); return; } attr[i]->mod_bvalues[j]->bv_len = cbSD; attr[i]->mod_bvalues[j]->bv_val = (PCHAR)malloc(cbSD); ASSERT(attr[i]->mod_bvalues[j]->bv_val); memcpy(attr[i]->mod_bvalues[j]->bv_val, pSD, cbSD); LocalFree(pSD); j++; } else { str.Format(_T("Invalid SDDL value: %lu"), GetLastError()); Out(str, CP_CMT); } } else { // // parse values // for(j=0, pTok = strtok(NULL, ";\n"); pTok; pTok= strtok(NULL, ";\n"), j++){ char fName[MAXSTR]; char szVal[MAXSTR]; attr[i]->mod_bvalues[j] = (struct berval*)malloc(sizeof(struct berval)); ASSERT(attr[i]->mod_bvalues[j] != NULL); if(1 == sscanf(pTok, "\\UNI:%s", szVal)){ // // UNICODE // LPWSTR lpWStr=NULL; // // Get UNICODE str size // int cblpWStr = MultiByteToWideChar(CP_ACP, // code page MB_ERR_INVALID_CHARS, // return err (LPCSTR)szVal, // input -1, // null terminated lpWStr, // converted 0); // calc size if(cblpWStr == 0){ attr[i]->mod_bvalues[j]->bv_len = 0; attr[i]->mod_bvalues[j]->bv_val = NULL; Out("Internal Error: MultiByteToWideChar(1): %lu", GetLastError()); } else{ // // Get UNICODE str // lpWStr = (LPWSTR)malloc(sizeof(WCHAR)*cblpWStr); cblpWStr = MultiByteToWideChar(CP_ACP, // code page MB_ERR_INVALID_CHARS, // return err (LPCSTR)szVal, // input -1, // null terminated lpWStr, // converted cblpWStr); // size if(cblpWStr == 0){ free(lpWStr); attr[i]->mod_bvalues[j]->bv_len = 0; attr[i]->mod_bvalues[j]->bv_val = NULL; Out("Internal Error: MultiByteToWideChar(2): %lu", GetLastError()); } else{ // // assign unicode to mods. // attr[i]->mod_bvalues[j]->bv_len = (cblpWStr-1)*2; attr[i]->mod_bvalues[j]->bv_val = (LPTSTR)lpWStr; } } } // // if improper format, just get the string value // else if(1 != sscanf(pTok, "\\BER(%*lu): %s", fName)){ attr[i]->mod_bvalues[j]->bv_len = strlen(pTok); attr[i]->mod_bvalues[j]->bv_val = _strdup(pTok); } else{ // // Get contents from file // HANDLE hFile; DWORD dwLength, dwRead; LPVOID ptr; hFile = CreateFile(fName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_SEQUENTIAL_SCAN, NULL); if(hFile == INVALID_HANDLE_VALUE){ str.Format("Error <%lu>: Cannot open %s value file. " "BER Value %s set to zero.", GetLastError(), fName, attr[i]->mod_type); AfxMessageBox(str); attr[i]->mod_bvalues[j]->bv_len = 0; attr[i]->mod_bvalues[j]->bv_val = NULL; } else{ // // Read file in // dwLength = GetFileSize(hFile, NULL); ptr = malloc(dwLength * sizeof(BYTE)); ASSERT(p != NULL); if(!ReadFile(hFile, ptr, dwLength, &dwRead, NULL)){ str.Format("Error <%lu>: Cannot read %s value file. " "BER Value %s set to zero.", GetLastError(), fName, attr[i]->mod_type); AfxMessageBox(str); free(ptr); ptr = NULL; attr[i]->mod_bvalues[j]->bv_len = 0; attr[i]->mod_bvalues[j]->bv_val = NULL; } else{ attr[i]->mod_bvalues[j]->bv_len = dwRead; attr[i]->mod_bvalues[j]->bv_val = (PCHAR)ptr; } CloseHandle(hFile); } str.Format("mods[i]->mod_bvalues.bv_len = %lu", attr[i]->mod_bvalues[j]->bv_len); Out(str, CP_ONLY|CP_CMT); } } } // // finalize values array // attr[i]->mod_bvalues[j] = NULL; str.Format("mods[i]->mod_bvalues[%d] = NULL", j); Out(str, CP_ONLY|CP_SRC); } } // // Finalize attribute array // attr[i] = NULL; str.Format("mods[%d] = NULL", i); Out(str, CP_ONLY|CP_SRC); // // prepare dn // dn = m_AddDlg->m_Dn.IsEmpty() ? NULL : (char*)LPCTSTR(m_AddDlg->m_Dn); if(dn != NULL){ str.Format("dn = _strdup(\"%s\");", dn); } else str = "dn = NULL;"; Out(str, CP_ONLY|CP_SRC); // // Execute ldap_add & friends // if(m_AddDlg->m_Sync){ // // Sync add // BeginWaitCursor(); if(m_AddDlg->m_bExtended){ PLDAPControl *SvrCtrls = m_CtrlDlg->AllocCtrlList(ctrldlg::CT_SVR); PLDAPControl *ClntCtrls = m_CtrlDlg->AllocCtrlList(ctrldlg::CT_CLNT); str.Format("ldap_add_ext_s(ld, '%s',[%d] attrs, SvrCtrls, ClntCtrls);", dn, i); Out(str); res = ldap_add_ext_s(hLdap, dn, attr, SvrCtrls, ClntCtrls); FreeControls(SvrCtrls); FreeControls(ClntCtrls); } else{ str.Format("ldap_add_s(ld, \"%s\", [%d] attrs)", dn, i); Out(str); res = ldap_add_s(hLdap, dn, attr); } EndWaitCursor(); if(res != LDAP_SUCCESS){ str.Format("Error: Add: %s. <%ld>", ldap_err2string(res), res); Out(str, CP_CMT); ShowErrorInfo(res); Out(CString("Expected: ") + str, CP_PRN|CP_ONLY); } else{ str.Format("Added {%s}.", dn); Out(str, CP_PRN); } } else{ // // Async add // res = ldap_add(hLdap, dn, attr); Out("ldap_add(ld, dn, mods);", CP_ONLY|CP_SRC); if(res == -1){ str.Format("Error: ldap_add(\"%s\"): %s. <%d>", dn, ldap_err2string(res), res); Out(str, CP_CMT); Out(CString("Expected: ") + str, CP_PRN|CP_ONLY); ShowErrorInfo(res); } else{ // // add to pending list // CPend pnd; pnd.mID = res; pnd.OpType = CPend::P_ADD; pnd.ld = hLdap; str.Format("%4d: ldap_add: dn={%s}", res, dn); Out(str, CP_PRN|CP_ONLY); pnd.strMsg = str; m_PendList.AddTail(pnd); m_PndDlg->Refresh(&m_PendList); Out("\tPending.", CP_PRN); } } // // restore memory // for(i=0; i<nMaxEnt; i++){ int k; free(p[i]); if(attr[i]->mod_op & LDAP_MOD_BVALUES){ for(k=0; attr[i]->mod_bvalues[k] != NULL; k++){ if(attr[i]->mod_bvalues[k]->bv_len != 0L) free(&(attr[i]->mod_bvalues[k]->bv_val[0])); free(attr[i]->mod_bvalues[k]); str.Format("free(mods[%d]->mod_bvalues[%d]);", i,k); Out(str, CP_ONLY|CP_SRC); } } else{ for(k=0; attr[i]->mod_values[k] != NULL; k++){ str.Format("free(mods[%d]->mod_values[%d]);", i,k); Out(str, CP_ONLY|CP_SRC); } } if(attr[i]->mod_op & LDAP_MOD_BVALUES){ free(attr[i]->mod_bvalues); } else{ free(attr[i]->mod_values); str.Format("free(mods[%d]->mod_values);", i); Out(str, CP_ONLY|CP_SRC); } free(attr[i]); str.Format("free(mods[%d]);", i); Out(str, CP_ONLY|CP_SRC); } Out("-----------", CP_PRN); } /*+++ Function : OnBrowseDelete Description: response to delete request Parameters : Return : Remarks : none. ---*/ void CLdpDoc::OnBrowseDelete() { DelDlg dlg; char *dn; CString str; int res; if(!bConnected && m_bProtect){ AfxMessageBox("Please re-connect session first"); return; } if(GetContextActivation()){ dlg.m_Dn = TreeView()->GetDn(); TreeView()->SetContextActivation(FALSE); } else if (m_vlvDlg && m_vlvDlg->GetContextActivation()) { dlg.m_Dn = m_vlvDlg->GetDN(); m_vlvDlg->SetContextActivation(FALSE); } if(IDOK == dlg.DoModal()){ // Try to delete entry dn = dlg.m_Dn.IsEmpty() ? NULL : (char*)LPCTSTR(dlg.m_Dn); // // RM: remove for invalid validation // if(dn == NULL && m_bProtect){ AfxMessageBox("Cannot execute ldap_delete() on a NULL dn." "Please specify a valid dn."); return; } if(dlg.m_Recursive){ str.Format("deleting \"%s\"...", dn); Out(str); m_ulDeleted = 0; BeginWaitCursor(); RecursiveDelete(hLdap, dn); EndWaitCursor(); str.Format("\tdeleted %lu entries", m_ulDeleted); Out(str); } else if(dlg.m_Sync){ // // sync delete // BeginWaitCursor(); if(dlg.m_bExtended){ // // get controls // PLDAPControl *SvrCtrls = m_CtrlDlg->AllocCtrlList(ctrldlg::CT_SVR); PLDAPControl *ClntCtrls = m_CtrlDlg->AllocCtrlList(ctrldlg::CT_CLNT); str.Format("ldap_delete_ext_s(ld, '%s', SvrCtrls, ClntCtrls);", dn); Out(str); // do ext delete res = ldap_delete_ext_s(hLdap, dn, SvrCtrls, ClntCtrls); FreeControls(SvrCtrls); FreeControls(ClntCtrls); } else{ str.Format("ldap_delete_s(ld, \"%s\");", dn); Out(str); // do delete res = ldap_delete_s(hLdap, dn); } EndWaitCursor(); if(res != LDAP_SUCCESS){ str.Format("Error: Delete: %s. <%ld>", ldap_err2string(res), res); Out(str, CP_CMT); Out(CString("Expected: ") + str, CP_PRN|CP_ONLY); ShowErrorInfo(res); } else{ str.Format("Deleted \"%s\"", dn); Print(str); } } else{ // // async delete // res = ldap_delete(hLdap, dn); str.Format("ldap_delete(ld, \"%s\");", dn); Out(str, CP_SRC); if(res == -1){ str.Format("Error: ldap_delete(\"%s\"): %s. <%d>", dn, ldap_err2string(res), res); Out(str, CP_CMT); Out(CString("Expected: ") + str, CP_PRN|CP_ONLY); ShowErrorInfo(res); } else{ // // add to pending // CPend pnd; pnd.mID = res; pnd.OpType = CPend::P_DEL; pnd.ld = hLdap; str.Format("%4d: ldap_delete: dn= {%s}", res, dn); Out(str, CP_PRN|CP_ONLY); pnd.strMsg = str; m_PendList.AddTail(pnd); m_PndDlg->Refresh(&m_PendList); Out("\tPending.", CP_PRN); } } } Out("-----------", CP_PRN); } void CLdpDoc::OnUpdateBrowseDelete(CCmdUI* pCmdUI) { pCmdUI->Enable(bConnected || !m_bProtect); } /*+++ Function : RecursiveDelete Description: delete a subtree based on lpszDN Parameters : ld: a bound ldap handle, lpszDN: base from which to start deletion Return : Remarks : none. ---*/ BOOL CLdpDoc::RecursiveDelete(LDAP* ld, LPTSTR lpszDN){ ULONG err; PCHAR attrs[] = { "Arbitrary Invalid Attribute", NULL }; PLDAPMessage result; PLDAPMessage entry; CString str; BOOL bRet = TRUE; // // get entry's immediate children // err = ldap_search_s(ld, lpszDN, LDAP_SCOPE_ONELEVEL, "objectClass=*", attrs, FALSE, &result); if(LDAP_SUCCESS != err){ // // report failure // str.Format("Error <%lu>: failed to search '%s'. {%s}.\n", err, lpszDN, ldap_err2string(err)); Out(str); ShowErrorInfo(err); return FALSE; } // // recursion end point and actual deletion // if(0 == ldap_count_entries(ld, result)){ // // delete entry // err = ldap_delete_s(ld, lpszDN); if(err != LDAP_SUCCESS){ // // report failure // str.Format("Error <%lu>: failed to delete '%s'. {%s}.", err, lpszDN, ldap_err2string(err)); Out(str); ShowErrorInfo(err); } else{ m_ulDeleted++; if((m_ulDeleted % 10) == 0 && m_ulDeleted != 0){ str.Format("\t>> %lu...", m_ulDeleted); Out(str); } } // // done // ldap_msgfree(result); return TRUE; } // // proceeding down the subtree recursively // traverse children // for(entry = ldap_first_entry(ld, result); entry != NULL; entry = ldap_next_entry(ld, entry)){ if(!RecursiveDelete(ld, ldap_get_dn(ld, entry))){ ldap_msgfree(result); return FALSE; } } // // now delete current node // err = ldap_delete_s(ld, lpszDN); if(err != LDAP_SUCCESS){ // // report failure // str.Format("Error <%lu>: failed to delete '%s'. {%s}.\n", err, lpszDN, ldap_err2string(err)); Out(str); ShowErrorInfo(err); } else{ m_ulDeleted++; if((m_ulDeleted % 10) == 0 && m_ulDeleted != 0){ str.Format("\t>> %lu...", m_ulDeleted); Out(str); } } ldap_msgfree(result); return TRUE; } /*+++ Function : OnModRdnEnd Description: UI response Parameters : Return : Remarks : none. ---*/ void CLdpDoc::OnModRdnEnd(){ bModRdn = FALSE; } /*+++ Function : OnModRdnGo Description: response to modRDN request Parameters : Return : Remarks : none. ---*/ void CLdpDoc::OnModRdnGo(){ if((m_ModRdnDlg->m_Old.IsEmpty() || m_ModRdnDlg->m_Old.IsEmpty()) && !m_bProtect){ AfxMessageBox("Please enter a valid dn for both fields. Empty strings are invalid"); return; } // // get DNs to process // char *oldDn = (char*)LPCTSTR(m_ModRdnDlg->m_Old); char * newDn = (char*)LPCTSTR(m_ModRdnDlg->m_New); BOOL bRename = m_ModRdnDlg->m_rename; int res; CString str; if(!bConnected && m_bProtect){ AfxMessageBox("Please re-connect session first"); return; } if(m_ModRdnDlg->m_Sync){ // // do sync // BeginWaitCursor(); if(bRename){ // // parse new DN & break into RDN & new parent // LPTSTR szParentDn = strchr(newDn, ','); for (;;) { if (NULL == szParentDn) { // There are no comma's break; } if (szParentDn == newDn) { // The first character is a comma. // This shouldn't happen. break; } if ('\\' != *(szParentDn - 1)) { // // Found it! And it's not escaped either. // break; } // // Must have been an escaped comma, continue // looking. // szParentDn = strchr(szParentDn + 1, ','); } if(szParentDn != NULL){ LPTSTR p = szParentDn; if(&(szParentDn[1]) != NULL && szParentDn[1] != '\0') szParentDn++; *p = '\0'; } LPTSTR szRdn = newDn; // // get controls // PLDAPControl *SvrCtrls = m_CtrlDlg->AllocCtrlList(ctrldlg::CT_SVR); PLDAPControl *ClntCtrls = m_CtrlDlg->AllocCtrlList(ctrldlg::CT_CLNT); // execute res = ldap_rename_ext_s(hLdap, oldDn, szRdn, szParentDn, m_ModRdnDlg->m_bDelOld, SvrCtrls, ClntCtrls); str.Format("0x%x = ldap_rename_ext_s(ld, %s, %s, %s, %s, svrCtrls, ClntCtrls)", res, oldDn, szRdn, szParentDn, m_ModRdnDlg->m_bDelOld?"TRUE":FALSE); Out(str); ShowErrorInfo(res); FreeControls(SvrCtrls); FreeControls(ClntCtrls); } else{ res = ldap_modrdn2_s(hLdap, oldDn, newDn, m_ModRdnDlg->m_bDelOld); str.Format("0x%x = ldap_modrdn2_s(ld, %s, %s, %s)", res, oldDn, newDn, m_ModRdnDlg->m_bDelOld?"TRUE":FALSE); Out(str); } EndWaitCursor(); if(res != LDAP_SUCCESS){ str.Format("Error: ModifyRDN: %s. <%ld>", ldap_err2string(res), res); Print(str);\ ShowErrorInfo(res); } else{ str.Format("Rdn \"%s\" modified to \"%s\"", oldDn, newDn); Print(str); } } else{ // // do async // if(bRename){ // // parse new DN & break into RDN & new parent // LPTSTR szParentDn = strchr(newDn, ','); for (;;) { if (NULL == szParentDn) { // There are no comma's break; } if (szParentDn == newDn) { // The first character is a comma. // This shouldn't happen. break; } if ('\\' != *(szParentDn - 1)) { // // Found it! And it's not escaped either. // break; } // // Must have been an escaped comma, continue // looking. // szParentDn = strchr(szParentDn + 1, ','); } if(szParentDn != NULL){ LPTSTR p = szParentDn; if(&(szParentDn[1]) != NULL && szParentDn[1] != '\0') szParentDn++; *p = '\0'; } LPTSTR szRdn = newDn; // // get controls // PLDAPControl *SvrCtrls = m_CtrlDlg->AllocCtrlList(ctrldlg::CT_SVR); PLDAPControl *ClntCtrls = m_CtrlDlg->AllocCtrlList(ctrldlg::CT_CLNT); ULONG ulMsgId=0; // execute res = ldap_rename_ext(hLdap, oldDn, szRdn, szParentDn, m_ModRdnDlg->m_bDelOld, SvrCtrls, ClntCtrls, &ulMsgId); str.Format("0x%x = ldap_rename_ext(ld, %s, %s, %s, %s, svrCtrls, ClntCtrls, 0x%x)", res, oldDn, szRdn, szParentDn, m_ModRdnDlg->m_bDelOld?"TRUE":FALSE, ulMsgId); Out(str); FreeControls(SvrCtrls); FreeControls(ClntCtrls); if(res == -1){ ULONG err = LdapGetLastError(); str.Format("Error: ldap_rename_ext(\"%s\", \"%s\", %d): %s. <%d>", oldDn, newDn, m_ModRdnDlg->m_bDelOld, ldap_err2string(err), err); Print(str); ShowErrorInfo(res); } else res = (int)ulMsgId; } else{ res = ldap_modrdn2(hLdap, oldDn, newDn, m_ModRdnDlg->m_bDelOld); str.Format("0x%x = ldap_modrdn2(ld, %s, %s, )", res, oldDn, newDn, m_ModRdnDlg->m_bDelOld?"TRUE":FALSE); Out(str); if(res == -1){ ULONG err = LdapGetLastError(); str.Format("Error: ldap_modrdn2(\"%s\", \"%s\", %d): %s. <%d>", oldDn, newDn, m_ModRdnDlg->m_bDelOld, ldap_err2string(err), err); Print(str); ShowErrorInfo(res); } } // // insert into pending list // if(res != -1){ CPend pnd; pnd.mID = res; pnd.OpType = CPend::P_MODRDN; pnd.ld = hLdap; str.Format("%4d: ldap_modrdn: dn=\"%s\"", res, oldDn); pnd.strMsg = str; m_PendList.AddTail(pnd); m_PndDlg->Refresh(&m_PendList); Print("\tPending."); } } Print("-----------"); } /*+++ Function : UI handlers Description: Parameters : Return : Remarks : none. ---*/ void CLdpDoc::OnBrowseModifyrdn() { bModRdn = TRUE; if(GetContextActivation()){ m_ModRdnDlg->m_Old = TreeView()->GetDn(); TreeView()->SetContextActivation(FALSE); } else if (m_vlvDlg && m_vlvDlg->GetContextActivation()) { m_ModRdnDlg->m_Old = m_vlvDlg->GetDN(); m_vlvDlg->SetContextActivation(FALSE); } m_ModRdnDlg->Create(IDD_MODRDN); } void CLdpDoc::OnUpdateBrowseModifyrdn(CCmdUI* pCmdUI) { pCmdUI->Enable((!bModRdn && bConnected) || !m_bProtect); } void CLdpDoc::OnModEnd(){ bMod = FALSE; } /*+++ Function : OnModGo Description: Handle Modify request Parameters : Return : Remarks : none. ---*/ void CLdpDoc::OnModGo(){ if(!bConnected && m_bProtect){ AfxMessageBox("Please re-connect session first"); return; } Print("***Call Modify..."); int nMaxEnt = m_ModDlg->GetEntryCount(); LDAPMod *attr[MAXLIST]; char *p[MAXLIST], *pTok; int i, j, k; CString str; CString sAttr, sVals; int Op, res; LPTSTR dn; // // traverse entries // for(i = 0; i<nMaxEnt; i++){ // // fix to fit document format (as opposed to dialog format) // m_ModDlg->FormatListString(i, sAttr, sVals, Op); // // alloc mem // attr[i] = (LDAPMod *)malloc(sizeof(LDAPMod)); if(NULL == attr[i]){ AfxMessageBox("Error: Out of memory", MB_ICONHAND); ASSERT(attr[i] != NULL); return; } // // add string values // if(NULL == strstr(LPCTSTR(m_ModDlg->GetEntry(i)), "\\BER(") && NULL == strstr(LPCTSTR(m_ModDlg->GetEntry(i)), "\\SDDL:") && NULL == strstr(LPCTSTR(m_ModDlg->GetEntry(i)), "\\UNI")){ attr[i]->mod_values = (char**)malloc(sizeof(char*)*MAXLIST); ASSERT(attr[i]->mod_values != NULL); attr[i]->mod_op = Op == MOD_OP_ADD ? LDAP_MOD_ADD : Op == MOD_OP_DELETE ? LDAP_MOD_DELETE : LDAP_MOD_REPLACE; attr[i]->mod_type = _strdup(LPCTSTR(sAttr)); if(sVals.IsEmpty()) p[i] = NULL; else{ p[i] = _strdup(LPCTSTR(sVals)); ASSERT(p[i] != NULL); } if(p[i] == NULL){ free(attr[i]->mod_values); attr[i]->mod_values = NULL; } else{ int len = strlen(p[i]); if (len >= 2 && p[i][0] == '"' && p[i][len-1] == '"') { // quoted value p[i][len-1] = '\0'; attr[i]->mod_values[0] = p[i]+1; j = 1; } else { for(j=0, pTok = strtok(p[i], ";\n"); pTok; pTok= strtok(NULL, ";\n"), j++){ attr[i]->mod_values[j] = pTok; } } attr[i]->mod_values[j] = NULL; } } else{ // // BER values // // // allocate value array buffer // attr[i]->mod_bvalues = (struct berval**)malloc(sizeof(struct berval*)*MAXLIST); // // prefast bug 653621, Check that malloc did not return NULL. // if(NULL == attr[i]->mod_bvalues){ AfxMessageBox("Error: Out of memory", MB_ICONHAND); ASSERT( attr[i]->mod_bvalues != NULL); return; } // // initialize operand // attr[i]->mod_op = Op == MOD_OP_ADD ? LDAP_MOD_ADD : Op == MOD_OP_DELETE ? LDAP_MOD_DELETE : LDAP_MOD_REPLACE; attr[i]->mod_op |= LDAP_MOD_BVALUES; str.Format("mods[i]->mod_op = %d;", attr[i]->mod_op); Out(str, CP_ONLY|CP_SRC); // // Fill attribute type // attr[i]->mod_type = _strdup(LPCTSTR(sAttr)); // // Null out values if empty // if(sVals.IsEmpty()) p[i] = NULL; else{ p[i] = _strdup(LPCTSTR(sVals)); ASSERT(p[i] != NULL); } if(p[i] == NULL){ free(attr[i]->mod_bvalues); attr[i]->mod_bvalues = NULL; } else{ if (_strnicmp(p[i], "\\SDDL:", 6) == 0) { // special case: value is in SDDL format (most likely, a security descriptor) // we can not use ';' as a separator because it is used in SDDL. So, assume // there's just one value (which is always the case for NTSD) PSECURITY_DESCRIPTOR pSD; DWORD cbSD; pTok = p[i] + 6; j = 0; if (ConvertStringSecurityDescriptorToSecurityDescriptor( pTok, SDDL_REVISION_1, &pSD, &cbSD)) { // value is good. Copy it. attr[i]->mod_bvalues[j] = (struct berval*)malloc(sizeof(struct berval)); ASSERT(attr[i]->mod_bvalues[j] != NULL); attr[i]->mod_bvalues[j]->bv_len = cbSD; attr[i]->mod_bvalues[j]->bv_val = (PCHAR)malloc(cbSD); ASSERT(attr[i]->mod_bvalues[j]->bv_val); memcpy(attr[i]->mod_bvalues[j]->bv_val, pSD, cbSD); LocalFree(pSD); j++; } else { str.Format(_T("Invalid SDDL value: %lu"), GetLastError()); Out(str, CP_CMT); } } else { for(j=0, pTok = strtok(p[i], ";\n"); pTok; pTok= strtok(NULL, ";\n"), j++){ attr[i]->mod_values[j] = pTok; char fName[MAXSTR]; char szVal[MAXSTR]; attr[i]->mod_bvalues[j] = (struct berval*)malloc(sizeof(struct berval)); // // prefast bug 653622, check that malloc did not retun null // if(NULL == attr[i]->mod_bvalues[j]){ AfxMessageBox("Error: Out of memory", MB_ICONHAND); ASSERT( attr[i]->mod_bvalues[j] != NULL); return; } if(1 == sscanf(pTok, "\\UNI:%s", szVal)){ // // UNICODE? // LPWSTR lpWStr=NULL; // // Get UNICODE str size // int cblpWStr = MultiByteToWideChar(CP_ACP, // code page MB_ERR_INVALID_CHARS, // return err (LPCSTR)szVal, // input -1, // null terminated lpWStr, // converted 0); // calc size if(cblpWStr == 0){ attr[i]->mod_bvalues[j]->bv_len = 0; attr[i]->mod_bvalues[j]->bv_val = NULL; Out("Internal Error: MultiByteToWideChar(1): %lu", GetLastError()); } else{ // // Get UNICODE str // lpWStr = (LPWSTR)malloc(sizeof(WCHAR)*cblpWStr); cblpWStr = MultiByteToWideChar(CP_ACP, // code page MB_ERR_INVALID_CHARS, // return err (LPCSTR)szVal, // input -1, // null terminated lpWStr, // converted cblpWStr); // size if(cblpWStr == 0){ free(lpWStr); attr[i]->mod_bvalues[j]->bv_len = 0; attr[i]->mod_bvalues[j]->bv_val = NULL; Out("Internal Error: MultiByteToWideChar(2): %lu", GetLastError()); } else{ // // assign unicode to mods. // attr[i]->mod_bvalues[j]->bv_len = (cblpWStr-1)*2; attr[i]->mod_bvalues[j]->bv_val = (LPTSTR)lpWStr; } } } // // if improper format get string equiv // else if(1 != sscanf(pTok, "\\BER(%*lu): %s", fName)){ attr[i]->mod_bvalues[j]->bv_len = strlen(pTok); attr[i]->mod_bvalues[j]->bv_val = _strdup(pTok); } else{ // // open file // HANDLE hFile; DWORD dwLength, dwRead; LPVOID ptr; hFile = CreateFile(fName, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_SEQUENTIAL_SCAN, NULL); if(hFile == INVALID_HANDLE_VALUE){ str.Format("Error <%lu>: Cannot open %s value file. " "BER Value %s set to zero.", GetLastError(), fName, attr[i]->mod_type); AfxMessageBox(str); attr[i]->mod_bvalues[j]->bv_len = 0; attr[i]->mod_bvalues[j]->bv_val = NULL; } else{ // // read file // dwLength = GetFileSize(hFile, NULL); ptr = malloc(dwLength * sizeof(BYTE)); ASSERT(p != NULL); if(!ReadFile(hFile, ptr, dwLength, &dwRead, NULL)){ str.Format("Error <%lu>: Cannot read %s value file. " "BER Value %s set to zero.", GetLastError(), fName, attr[i]->mod_type); AfxMessageBox(str); free(ptr); ptr = NULL; attr[i]->mod_bvalues[j]->bv_len = 0; attr[i]->mod_bvalues[j]->bv_val = NULL; } else{ attr[i]->mod_bvalues[j]->bv_len = dwRead; attr[i]->mod_bvalues[j]->bv_val = (PCHAR)ptr; } CloseHandle(hFile); } str.Format("mods[i]->mod_bvalues.bv_len = %lu", attr[i]->mod_bvalues[j]->bv_len); Out(str, CP_ONLY|CP_CMT); } } // for all values loop } // // finalize values array // attr[i]->mod_bvalues[j] = NULL; str.Format("mods[i]->mod_bvalues[%d] = NULL", j); Out(str, CP_ONLY|CP_SRC); } // else of empty attr spec } // BER values } // for all attributes // // finalize attribute array // attr[i] = NULL; // // Execute modify calls // dn = m_ModDlg->m_Dn.IsEmpty() ? NULL : (char*)LPCTSTR(m_ModDlg->m_Dn); if(m_ModDlg->m_Sync){ BeginWaitCursor(); if(m_ModDlg->m_bExtended){ // // get controls // PLDAPControl *SvrCtrls = m_CtrlDlg->AllocCtrlList(ctrldlg::CT_SVR); PLDAPControl *ClntCtrls = m_CtrlDlg->AllocCtrlList(ctrldlg::CT_CLNT); str.Format("ldap_modify_ext_s(ld, '%s',[%d] attrs, SvrCtrls, ClntCtrls);", dn, i); Out(str); res = ldap_modify_ext_s(hLdap, dn, attr, SvrCtrls, ClntCtrls); FreeControls(SvrCtrls); FreeControls(ClntCtrls); } else{ str.Format("ldap_modify_s(ld, '%s',[%d] attrs);", dn, i); Print(str); res = ldap_modify_s(hLdap,dn,attr); } EndWaitCursor(); if(res != LDAP_SUCCESS){ str.Format("Error: Modify: %s. <%ld>", ldap_err2string(res), res); Print(str); ShowErrorInfo(res); } else{ str.Format("Modified \"%s\".", m_ModDlg->m_Dn); Print(str); } } else{ // // async call // res = ldap_modify(hLdap, dn, attr); if(res == -1){ str.Format("Error: ldap_modify(\"%s\"): %s. <%d>", dn, ldap_err2string(res), res); Print(str); ShowErrorInfo(res); } else{ // // add to pending // CPend pnd; pnd.mID = res; pnd.OpType = CPend::P_MOD; pnd.ld = hLdap; str.Format("%4d: ldap_modify: dn=\"%s\"", res, dn); pnd.strMsg = str; m_PendList.AddTail(pnd); m_PndDlg->Refresh(&m_PendList); Print("\tPending."); } } // // restore memory // for(i=0; i<nMaxEnt; i++){ if(p[i] != NULL) free(p[i]); if(attr[i]->mod_type != NULL) free(attr[i]->mod_type ); if(attr[i]->mod_op & LDAP_MOD_BVALUES){ for(k=0; attr[i]->mod_bvalues[k] != NULL; k++){ if(attr[i]->mod_bvalues[k]->bv_len != 0L) free(&(attr[i]->mod_bvalues[k]->bv_val[0])); free(attr[i]->mod_bvalues[k]); str.Format("free(mods[%d]->mod_bvalues[%d]);", i,k); Out(str, CP_ONLY|CP_SRC); } free(attr[i]->mod_bvalues); } else{ if(attr[i]->mod_values != NULL) free(attr[i]->mod_values); } free(attr[i]); } Print("-----------"); } /*+++ Function : Description: UI handlers Parameters : Return : Remarks : none. ---*/ void CLdpDoc::OnBrowseModify() { bMod = TRUE; if(GetContextActivation()){ m_ModDlg->m_Dn = TreeView()->GetDn(); TreeView()->SetContextActivation(FALSE); } else if (m_vlvDlg && m_vlvDlg->GetContextActivation()) { m_ModDlg->m_Dn = m_vlvDlg->GetDN(); m_vlvDlg->SetContextActivation(FALSE); } m_ModDlg->Create(IDD_MODIFY); } void CLdpDoc::OnUpdateBrowseModify(CCmdUI* pCmdUI) { pCmdUI->Enable((!bMod && bConnected) || !m_bProtect); } void CLdpDoc::OnOptionsSearch() { if(IDOK == SrchOptDlg.DoModal()) SrchOptDlg.UpdateSrchInfo(SrchInfo, TRUE); } void CLdpDoc::OnBrowsePending() { bPndDlg = TRUE; m_PndDlg->Create(IDD_PEND); } void CLdpDoc::OnUpdateBrowsePending(CCmdUI* pCmdUI) { pCmdUI->Enable((!bPndDlg && (bConnected || !m_BndOpt->m_bSync)) || !m_bProtect); } void CLdpDoc::OnPendEnd(){ bPndDlg = FALSE; } void CLdpDoc::OnOptionsPend() { PndOpt dlg; if(IDOK == dlg.DoModal()){ PndInfo.All = dlg.m_bAllSearch; PndInfo.bBlock = dlg.m_bBlock; PndInfo.tv.tv_sec = dlg.m_Tlimit_sec; PndInfo.tv.tv_usec = dlg.m_Tlimit_usec; } } /*+++ Function : OnProcPend Description: Process pending requests Parameters : Return : Remarks : none. ---*/ void CLdpDoc::OnProcPend(){ Out("*** Processing Pending...", CP_CMT); if(m_PndDlg->posPending != NULL){ // // Get current pending from dialog storage // CPend pnd = m_PendList.GetAt(m_PndDlg->posPending); CString str; int res; LDAPMessage *msg; str.Format("ldap_result(ld, %d, %d, &tv, &msg)", pnd.mID, PndInfo.All); Out(str, CP_SRC); // // execute ldap result // BeginWaitCursor(); res = ldap_result(hLdap, pnd.mID, PndInfo.All, &PndInfo.tv, &msg); EndWaitCursor(); // // process result // HandleProcResult(res, msg, &pnd); } else{ AfxMessageBox("Error: Tried to process an invalid pending request"); } } /*+++ Function : OnPendAny Description: Process any pending result Parameters : Return : Remarks : none. ---*/ void CLdpDoc::OnPendAny() { CString str; int res; LDAPMessage *msg; Out("*** Processing Pending...", CP_CMT); str.Format("ldap_result(ld, %d, %d, &tv, &msg)", LDAP_RES_ANY, PndInfo.All); Out(str, CP_SRC); BeginWaitCursor(); res = ldap_result(hLdap, (ULONG)LDAP_RES_ANY, PndInfo.All, &PndInfo.tv, &msg); EndWaitCursor(); HandleProcResult(res, msg); } /*+++ Function : OnPendAbandon Description: execute abandon request Parameters : Return : Remarks : none. ---*/ void CLdpDoc::OnPendAbandon(){ Out("*** Abandon pending", CP_CMT); CPend pnd; CString str; int mId; int res; if(m_PndDlg->posPending == NULL) mId = 0; else{ pnd = m_PendList.GetAt(m_PndDlg->posPending); mId = pnd.mID; } str.Format("ldap_abandon(ld, %d)", mId); Out(str); res = ldap_abandon(hLdap, mId); if (LDAP_SUCCESS != res) { ShowErrorInfo(res); AfxMessageBox("ldap_abandon() failed!"); } } /*+++ Function : HandleProcResults Description: Process executed pending request Parameters : Return : Remarks : none. ---*/ void CLdpDoc::HandleProcResult(int res, LDAPMessage *msg, CPend *pnd){ CString str; ParseResults(msg); switch(res){ case 0: Out(">Timeout", CP_PRN); ldap_msgfree(msg); break; case -1: res = ldap_result2error(hLdap, msg, TRUE); str.Format("Error: ldap_result: %s <%X>", ldap_err2string(res), res); Out(str); ShowErrorInfo(res); break; default: str.Format("result code: %s <%X>", res == LDAP_RES_BIND ? "LDAP_RES_BIND" : res == LDAP_RES_SEARCH_ENTRY ? "LDAP_RES_SEARCH_ENTRY" : res == LDAP_RES_SEARCH_RESULT ? "LDAP_RES_SEARCH_RESULT" : res == LDAP_RES_MODIFY ? "LDAP_RES_MODIFY" : res == LDAP_RES_ADD ? "LDAP_RES_ADD" : res == LDAP_RES_DELETE ? "LDAP_RES_DELETE" : res == LDAP_RES_MODRDN ? "LDAP_RES_MODRDN" : res == LDAP_RES_COMPARE ? "LDAP_RES_COMPARE": "UNKNOWN!", res); Out(str, CP_PRN); switch(res){ case LDAP_RES_BIND: res = ldap_result2error(hLdap, msg, TRUE); if(res != LDAP_SUCCESS){ str.Format("Error: %s <%d>", ldap_err2string(res), res); Out(str, CP_PRN); ShowErrorInfo(res); } else{ str.Format("Authenticated bind request #%lu.", pnd != NULL ? pnd->mID : LDAP_RES_ANY); Out(str, CP_PRN); // AfxMessageBox("Connection established."); } break; case LDAP_RES_SEARCH_ENTRY: case LDAP_RES_SEARCH_RESULT: DisplaySearchResults(msg); break; case LDAP_RES_ADD: res = ldap_result2error(hLdap, msg, TRUE); if(res != LDAP_SUCCESS){ str.Format("Error: %s <%d>", ldap_err2string(res), res); Out(str, CP_PRN); ShowErrorInfo(res); } str.Format(">completed: %s", pnd != NULL ? pnd->strMsg : "ANY"); Print(str); break; case LDAP_RES_DELETE: res = ldap_result2error(hLdap, msg, TRUE); if(res != LDAP_SUCCESS){ str.Format("Error: %s <%d>", ldap_err2string(res), res); Out(str, CP_PRN); ShowErrorInfo(res); } str.Format(">completed: %s", pnd != NULL ? pnd->strMsg : "ANY"); Out(str, CP_PRN); break; case LDAP_RES_MODIFY: res = ldap_result2error(hLdap, msg, TRUE); if(res != LDAP_SUCCESS){ str.Format("Error: %s <%d>", ldap_err2string(res), res); Out(str, CP_PRN); ShowErrorInfo(res); } str.Format(">completed: %s", pnd != NULL ? pnd->strMsg : "ANY"); Out(str, CP_PRN); break; case LDAP_RES_MODRDN: res = ldap_result2error(hLdap, msg, TRUE); if(res != LDAP_SUCCESS){ str.Format("Error: %s <%d>", ldap_err2string(res), res); Out(str, CP_PRN); ShowErrorInfo(res); } str.Format(">completed: %s", pnd != NULL ? pnd->strMsg : "ANY"); Out(str, CP_PRN); break; case LDAP_RES_COMPARE: res = ldap_result2error(hLdap, msg, TRUE); if(res == LDAP_COMPARE_TRUE){ str.Format("Results: TRUE. <%lu>", res); Out(str, CP_PRN); } else if(res == LDAP_COMPARE_FALSE){ str.Format("Results: FALSE. <%lu>", res); Out(str, CP_PRN); } else{ str.Format("Error: ldap_compare(): %s. <%lu>", ldap_err2string(res), res); Out(str, CP_PRN); ShowErrorInfo(res); } break; } } } /*+++ Function : PrintHeader Description: Print C header for source view Parameters : Return : Remarks : Source view is unsupported anymore ---*/ void CLdpDoc::PrintHeader(void){ if(m_SrcMode){ Out("/**********************************************/"); Out("/* Ldap Automated Scenario Recording */"); Out("/**********************************************/"); Out(""); Out("includes", CP_CMT); Out("#include <stdio.h>"); Out("#include \"lber.h\""); Out("#include \"ldap.h\""); Out(""); Out("definitions", CP_CMT); Out("#define MAXSTR\t\t512"); Out(""); Out("Global Variables", CP_CMT); Out("LDAP *ld;\t\t//ldap connection handle"); Out("int res;\t\t//generic return variable"); Out("char *attrList[MAXSTR];\t//generic attributes list (search)"); Out("LDAPMessage *msg;\t//generic ldap message place holder"); Out("struct timeval tm;\t//for time limit on search"); Out("char *dn;\t//generic 'dn' place holder"); Out("void *ptr;\t//generic pointer"); Out("char *attr, **val;\t//a pointer to list of attributes, & values traversal helper"); Out("LDAPMessage *nxt;\t//result traversal helper"); Out("int i;\t//generic index traversal"); Out("LDAPMod *mods[MAXLIST];\t//global LDAPMod space"); Out(""); Out(""); Out("int main(void){"); Out(""); } } /*+++ Function : UI handlers Description: Parameters : Return : Remarks : none. ---*/ void CLdpDoc::OnViewSource() { m_SrcMode = ~m_SrcMode; } void CLdpDoc::OnUpdateViewSource(CCmdUI* pCmdUI) { pCmdUI->SetCheck(m_SrcMode ? 1 : 0); } void CLdpDoc::OnOptionsBind() { m_BndOpt->DoModal(); } void CLdpDoc::OnOptionsProtections() { m_bProtect = !m_bProtect; } void CLdpDoc::OnUpdateOptionsProtections(CCmdUI* pCmdUI) { pCmdUI->SetCheck(m_bProtect ? 1 : 0); } void CLdpDoc::OnOptionsGeneral() { m_GenOptDlg->DoModal(); } void CLdpDoc::OnCompEnd(){ bCompDlg = FALSE; } /*+++ Function : OnCompGo Description: ldap_compare execution Parameters : Return : Remarks : none. ---*/ void CLdpDoc::OnCompGo(){ if(!bConnected && m_bProtect){ AfxMessageBox("Please re-connect session first"); return; } PCHAR dn, attr, val; ULONG res; CString str; // // get properties from dialog // dn = m_CompDlg->m_dn.IsEmpty() ? NULL : (char*)LPCTSTR(m_CompDlg->m_dn); attr = m_CompDlg->m_attr.IsEmpty() ? NULL : (char*)LPCTSTR(m_CompDlg->m_attr); val = m_CompDlg->m_val.IsEmpty() ? NULL : (char*)LPCTSTR(m_CompDlg->m_val); if(m_CompDlg->m_sync){ // // do sync // str.Format("ldap_compare_s(0x%x, \"%s\", \"%s\", \"%s\")", hLdap, dn, attr, val); Print(str); BeginWaitCursor(); res = ldap_compare_s(hLdap, dn, attr, val); EndWaitCursor(); if(res == LDAP_COMPARE_TRUE){ str.Format("Results: TRUE. <%lu>", res); Out(str, CP_PRN); } else if(res == LDAP_COMPARE_FALSE){ str.Format("Results: FALSE. <%lu>", res); Out(str, CP_PRN); } else{ str.Format("Error: ldap_compare(): %s. <%lu>", ldap_err2string(res), res); Out(str, CP_PRN); ShowErrorInfo(res); } } else{ // // async call // str.Format("ldap_compare(0x%x, \"%s\", \"%s\", \"%s\")", hLdap, dn, attr, val); Print(str); res = ldap_compare(hLdap, dn, attr, val); if(res == -1){ str.Format("Error: ldap_compare(): %s. <%lu>", ldap_err2string(res), res); Out(str, CP_PRN); ShowErrorInfo(res); } else{ // // add to pending // CPend pnd; pnd.mID = res; pnd.OpType = CPend::P_COMP; pnd.ld = hLdap; str.Format("%4d: ldap_comp: dn=\"%s\"", res, dn); pnd.strMsg = str; m_PendList.AddTail(pnd); m_PndDlg->Refresh(&m_PendList); Out("\tCompare Pending...", CP_PRN); } } Out("-----------", CP_PRN); } void CLdpDoc::OnBrowseCompare() { bCompDlg = TRUE; if(GetContextActivation()){ m_CompDlg->m_dn = TreeView()->GetDn(); TreeView()->SetContextActivation(FALSE); } else if (m_vlvDlg && m_vlvDlg->GetContextActivation()) { m_CompDlg->m_dn = m_vlvDlg->GetDN(); m_vlvDlg->SetContextActivation(FALSE); } m_CompDlg->Create(IDD_COMPARE); } void CLdpDoc::OnUpdateBrowseCompare(CCmdUI* pCmdUI) { pCmdUI->Enable((!bCompDlg && bConnected) || !m_bProtect); } void CLdpDoc::OnOptionsDebug() { CString str; if(IDOK == m_DbgDlg.DoModal()){ #ifdef WINLDAP ldap_set_dbg_flags(m_DbgDlg.ulDbgFlags); str.Format("ldap_set_dbg_flags(0x%x);", m_DbgDlg.ulDbgFlags); Out(str); #endif } } void CLdpDoc::OnViewTree() { if(IDOK == m_TreeViewDlg->DoModal()){ UpdateAllViews(NULL); } } void CLdpDoc::OnUpdateViewTree(CCmdUI* pCmdUI) { pCmdUI->Enable(bConnected); } void CLdpDoc::OnViewLiveEnterprise() { bLiveEnterprise = TRUE; m_EntTreeDlg->SetLd(hLdap); Out(_T("* Use the Refresh button to load currently live enterprise configuration")); Out(_T("* Attention: This may take several minutes!")); m_EntTreeDlg->Create(IDD_ENTERPRISE_TREE); } void CLdpDoc::OnUpdateViewLiveEnterprise(CCmdUI* pCmdUI) { pCmdUI->Enable((!bLiveEnterprise && bConnected) || !m_bProtect); } void CLdpDoc::OnLiveEntTreeEnd(){ bLiveEnterprise = FALSE; } /*+++ Function : GetOwnView Description: get requested pane Parameters : Return : Remarks : none. ---*/ CView* CLdpDoc::GetOwnView(LPCTSTR rtszName) { POSITION pos; CView *pTmpVw = NULL; pos = GetFirstViewPosition(); while(pos != NULL){ pTmpVw = GetNextView(pos); if((CString)pTmpVw->GetRuntimeClass()->m_lpszClassName == rtszName) break; } // ASSERT(pTmpVw != NULL); return pTmpVw; } /*+++ Function : GetTreeView Description: Get a pointer to the DSTree view pane Parameters : Return : Remarks : none. ---*/ CDSTree *CLdpDoc::TreeView(void){ return (CDSTree*)GetOwnView(_T("CDSTree")); } BOOL CLdpDoc::GetContextActivation(void){ CDSTree* tv = TreeView(); if (tv) { return tv->GetContextActivation(); } else{ // see bug 447444 ASSERT(tv); AfxMessageBox("Internal Error in CLdpDoc::GetContextActivation", MB_ICONHAND); return FALSE; } } void CLdpDoc::SetContextActivation(BOOL bFlag){ CDSTree* tv = TreeView(); ASSERT(tv); if ( tv ) { // prefix is happier with this check. tv->SetContextActivation(bFlag); } } /*+++ Function : OnBindOptOK Description: UI response to closing bind options Parameters : Return : Remarks : none. ---*/ void CLdpDoc::OnBindOptOK(){ if((m_BndOpt->GetAuthMethod() == LDAP_AUTH_SSPI || m_BndOpt->GetAuthMethod() == LDAP_AUTH_NTLM || m_BndOpt->GetAuthMethod() == LDAP_AUTH_DIGEST) && m_BndOpt->m_API == CBndOpt::BND_GENERIC_API) m_BindDlg.m_bSSPIdomain = TRUE; else m_BindDlg.m_bSSPIdomain = FALSE; if(NULL != m_BindDlg.m_hWnd && ::IsWindow(m_BindDlg.m_hWnd)) m_BindDlg.UpdateData(FALSE); } /*+++ Function : OnSSPIDomainShortcut Description: response to novice user shortcut UI checkbox Parameters : Return : Remarks : none. ---*/ void CLdpDoc::OnSSPIDomainShortcut(){ // // sync bind & bind options dialog info such that advanced options // map to novice user usage. Triggered by Bind dlg shortcut checkbox // if(m_BindDlg.m_bSSPIdomain){ m_BndOpt->m_Auth = BIND_OPT_AUTH_SSPI; m_BndOpt->m_API = CBndOpt::BND_GENERIC_API; m_BndOpt->m_bAuthIdentity = TRUE; m_BndOpt->m_bSync = TRUE; } else{ m_BndOpt->m_Auth = BIND_OPT_AUTH_SIMPLE; m_BndOpt->m_API = CBndOpt::BND_SIMPLE_API; m_BndOpt->m_bAuthIdentity = FALSE; m_BndOpt->m_bSync = TRUE; } } /*+++ Function : ParseResults Description: shells ldap_parse_result Parameters : LDAPMessage to pass on to ldap call Return : nothing. output to screen ---*/ void CLdpDoc::ParseResults(LDAPMessage *msg){ PLDAPControl *pResultControls = NULL; BOOL bstatus; CString str; DWORD TimeCore=0, TimeCall=0, Threads=0; PSVRSTATENTRY pStats=NULL; if(hLdap->ld_version == LDAP_VERSION3){ ULONG ulRetCode=0; PCHAR pMatchedDNs=NULL; PCHAR pErrMsg=NULL; ULONG err = ldap_parse_result(hLdap, msg, &ulRetCode, &pMatchedDNs, &pErrMsg, NULL, &pResultControls, FALSE); if(err != LDAP_SUCCESS){ str.Format("Error<%lu>: ldap_parse_result failed: %s", err, ldap_err2string(err)); Out(str); } else{ str.Format("Result <%lu>: %s", ulRetCode, pErrMsg); Out(str); str.Format("Matched DNs: %s", pMatchedDNs); Out(str); if (pResultControls && pResultControls[0]) { // // If we requested stats, get it // pStats = GetServerStatsFromControl ( pResultControls[0] ); if ( pStats) { Out("Stats:"); for (INT i=0; i < MAXSVRSTAT; i++) { switch (pStats[i].index) { case 0: break; case PARSE_THREADCOUNT: #ifdef DBG str.Format("\tThread Count:\t%lu", pStats[i].val); Out(str); #endif break; case PARSE_CALLTIME: str.Format("\tCall Time:\t%lu (ms)", pStats[i].val); Out(str); break; case PARSE_RETURNED: str.Format("\tEntries Returned:\t%lu", pStats[i].val); Out(str); break; case PARSE_VISITED: str.Format("\tEntries Visited:\t%lu", pStats[i].val); Out(str); break; case PARSE_FILTER: str.Format("\tUsed Filter:\t%s", pStats[i].val_str); free (pStats[i].val_str); pStats[i].val_str = 0; Out(str); break; case PARSE_INDEXES: str.Format("\tUsed Indexes:\t%s", pStats[i].val_str); free (pStats[i].val_str); pStats[i].val_str = 0; Out(str); break; default: break; } } } ldap_controls_free(pResultControls); } ldap_memfree(pErrMsg); ldap_memfree(pMatchedDNs); } } } CLdpDoc::PSVRSTATENTRY CLdpDoc::GetServerStatsFromControl( PLDAPControl pControl ) { BYTE *pVal, Tag; DWORD len, tmp; DWORD val; BOOL bstatus=TRUE; INT i; static SVRSTATENTRY pStats[MAXSVRSTAT]; char *pszFilter = NULL; char *pszIndexes = NULL; PDWORD pdwRet=NULL; BYTE *pVal_str; DWORD val_str_len; // // init stats // for (i=0;i<MAXSVRSTAT;i++) { pStats[i].index = 0; pStats[i].val = 0; pStats[i].val_str = NULL; } pVal = (PBYTE)pControl->ldctl_value.bv_val; len = pControl->ldctl_value.bv_len; // Parse out the ber value if(strcmp(pControl->ldctl_oid, "1.2.840.113556.1.4.970")) { return NULL; } if (!GetBerTagLen (&pVal,&len,&Tag,&tmp)) { return NULL; } if (Tag != 0x30) { return NULL; } for (i=0; i<MAXSVRSTAT && len; i++) { // // get stat index // if ( !GetBerDword(&pVal,&len,&val) ) return NULL; // // get stat value // if (val == PARSE_FILTER || val == PARSE_INDEXES) { bstatus = GetBerOctetString ( &pVal, &len, &pVal_str, &val_str_len); if (!bstatus) { return NULL; } pStats[i].val_str = (LPSTR) malloc (val_str_len + 1); if (pStats[i].val_str) { memcpy (pStats[i].val_str, pVal_str, val_str_len); pStats[i].val_str[val_str_len] = '\0'; } } else { bstatus = GetBerDword(&pVal, &len, &(pStats[i].val)); if (!bstatus) { return NULL; } } pStats[i].index = val; } return (PSVRSTATENTRY)pStats; } BOOL CLdpDoc::GetBerTagLen ( BYTE **ppVal, DWORD *pLen, BYTE *Tag, DWORD *pObjLen) { BYTE *pVal = *ppVal; DWORD Len = *pLen; BYTE sizeLen; DWORD i; if (!Len) { return FALSE; } // Get the tag. *Tag = *pVal++; Len--; if (!Len) { return FALSE; } // Get the Length. if (*pVal < 0x7f) { *pObjLen = *pVal++; Len--; } else { if (*pVal > 0x84) { // We don't handle lengths bigger than a DWORD. return FALSE; } sizeLen = *pVal & 0xf; *pVal++; Len--; if (Len < sizeLen) { return FALSE; } *pObjLen = *pVal++; Len--; for (i = 1; i < sizeLen; i++) { *pObjLen = (*pObjLen << 8) | *pVal++; Len--; } } *ppVal = pVal; *pLen = Len; return TRUE; } BOOL CLdpDoc::GetBerOctetString ( BYTE **ppVal, DWORD *pLen, BYTE **ppOctetString, DWORD *cbOctetString) { BYTE *pVal = *ppVal; BYTE Tag; DWORD Len = *pLen; if (!GetBerTagLen(&pVal, &Len, &Tag, cbOctetString)) { return FALSE; } if (Len < *cbOctetString || Tag != 0x04) { return FALSE; } *ppOctetString = pVal; pVal += *cbOctetString; Len -= *cbOctetString; *ppVal = pVal; *pLen = Len; return TRUE; } BOOL CLdpDoc::GetBerDword ( BYTE **ppVal, DWORD *pLen, DWORD *pRetVal) { BYTE *pVal = *ppVal; DWORD i, num; *pRetVal = 0; if(! (*pLen)) { return FALSE; } // We are expecting to parse a number. Next byte is magic byte saying this // is a number. if(*pVal != 2) { return FALSE; } pVal++; *pLen = *pLen - 1; if(! (*pLen)) { return FALSE; } // Next is the number of bytes the number contains. i=*pVal; pVal++; if((*pLen) < (i + 1)) { return FALSE; } *pLen = *pLen - i - 1; num = 0; while(i) { num = (num << 8) | *pVal; pVal++; i--; } *pRetVal = num; *ppVal = pVal; return TRUE; } /*++ Routine Description: Dumps the buffer content on to the debugger output. Arguments: Buffer: buffer pointer. BufferSize: size of the buffer. Return Value: none Author: borrowed from MikeSw --*/ VOID CLdpDoc::DumpBuffer(PVOID Buffer, DWORD BufferSize, CString &outStr){ #define NUM_CHARS 16 DWORD i, limit; CHAR TextBuffer[NUM_CHARS + 1]; LPBYTE BufferPtr = (LPBYTE)Buffer; CString tmp; outStr.FormatMessage("%n%t%t"); // // Hex dump of the bytes // limit = ((BufferSize - 1) / NUM_CHARS + 1) * NUM_CHARS; for (i = 0; i < limit; i++) { if (i < BufferSize) { tmp.Format("%02x ", BufferPtr[i]); outStr += tmp; if (BufferPtr[i] < 31 ) { TextBuffer[i % NUM_CHARS] = '.'; } else if (BufferPtr[i] == '\0') { TextBuffer[i % NUM_CHARS] = ' '; } else { TextBuffer[i % NUM_CHARS] = (CHAR) BufferPtr[i]; } } else { tmp.Format(" "); outStr += tmp; TextBuffer[i % NUM_CHARS] = ' '; } if ((i + 1) % NUM_CHARS == 0) { TextBuffer[NUM_CHARS] = 0; tmp.FormatMessage(" %1!s!%n%t%t", TextBuffer); outStr += tmp; } } tmp.FormatMessage("------------------------------------%n"); outStr += tmp; } void CLdpDoc::OnOptionsServeroptions() { SvrOpt dlg(this); dlg.DoModal(); } void CLdpDoc::OnOptionsControls() { if(IDOK == m_CtrlDlg->DoModal()){ } } void CLdpDoc::FreeControls(PLDAPControl *ctrl){ if(ctrl == NULL) return; for(INT i=0; ctrl[i] != NULL; i++){ PLDAPControl c = ctrl[i]; // for convinience delete c->ldctl_oid; delete c->ldctl_value.bv_val; delete c; } delete ctrl; } void CLdpDoc::OnOptionsSortkeys() { if(IDOK == m_SKDlg->DoModal()){ } } void CLdpDoc::OnOptionsSetFont() { POSITION pos; CView *pTmpVw; pos = GetFirstViewPosition(); while(pos != NULL){ pTmpVw = GetNextView(pos); if((CString)(pTmpVw->GetRuntimeClass()->m_lpszClassName) == _T("CLdpView")){ CLdpView* pView = (CLdpView* )pTmpVw; pView->SelectFont(); } } } void CLdpDoc::OnBrowseExtendedop() { bExtOp = TRUE; m_ExtOpDlg->Create( IDD_EXT_OPT ); } void CLdpDoc::OnUpdateBrowseExtendedop(CCmdUI* pCmdUI) { pCmdUI->Enable((!bExtOp && bConnected) || !m_bProtect); } void CLdpDoc::OnExtOpEnd(){ bExtOp = FALSE; } void CLdpDoc::OnExtOpGo(){ ULONG ulMid=0, ulErr; struct berval data; DWORD dwVal=0; CString str= m_ExtOpDlg->m_strData; PCHAR pOid = (PCHAR) LPCTSTR(m_ExtOpDlg->m_strOid); PLDAPControl *SvrCtrls = m_CtrlDlg->AllocCtrlList(ctrldlg::CT_SVR); PLDAPControl *ClntCtrls = m_CtrlDlg->AllocCtrlList(ctrldlg::CT_CLNT); // data.bv_len = pStr == NULL ? 0 : (strlen(pStr) * sizeof(TCHAR)); // data.bv_val = pStr; if(0 != (dwVal = atol(str)) || (!str.IsEmpty() && str[0] == '0')){ data.bv_val = (PCHAR)&dwVal; data.bv_len = sizeof(DWORD); } else if(str.IsEmpty()){ data.bv_val = NULL; data.bv_len = 0; } else{ data.bv_val = (PCHAR) LPCTSTR(str); data.bv_len = str.GetLength()+1; } BeginWaitCursor(); ulErr = ldap_extended_operation(hLdap, pOid, &data, NULL, NULL, &ulMid); EndWaitCursor(); str.Format("0x%X = ldap_extended_operation(ld, '%s', &data, svrCtrl, clntCtrl, %lu);", ulErr, pOid, ulMid); Out(str); if(LDAP_SUCCESS == ulErr){ // // add to pending // CPend pnd; pnd.mID = ulMid; pnd.OpType = CPend::P_EXTOP; pnd.ld = hLdap; str.Format("%4d: ldap_extended_op: Oid=\"%s\"", ulMid, pOid); pnd.strMsg = str; m_PendList.AddTail(pnd); m_PndDlg->Refresh(&m_PendList); Print("\tPending."); } else{ str.Format("Error <0x%X>: %s", ulErr, ldap_err2string(ulErr)); Out(str); } FreeControls(SvrCtrls); FreeControls(ClntCtrls); } /////////////////////// SECURITY EXTENSIONS HANDLER & FRIENDS ////////////////////////// void CLdpDoc::OnBrowseSecuritySd() { SecDlg dlg; char *dn; CString str; int res; if(!bConnected && m_bProtect){ AfxMessageBox("Please re-connect session first"); return; } if(GetContextActivation()){ dlg.m_Dn = TreeView()->GetDn(); TreeView()->SetContextActivation(FALSE); } else if (m_vlvDlg && m_vlvDlg->GetContextActivation()) { dlg.m_Dn = m_vlvDlg->GetDN(); m_vlvDlg->SetContextActivation(FALSE); } Out("***Calling Security...", CP_PRN); if (IDOK == dlg.DoModal()) { // Try to query security for entry dn = dlg.m_Dn.IsEmpty() ? NULL : (char*)LPCTSTR(dlg.m_Dn); // // RM: remove for invalid validation // if (dn == NULL && m_bProtect){ AfxMessageBox("Cannot query security on a NULL dn." "Please specify a valid dn."); return; } /* & we execute only in synchronous mode */ BeginWaitCursor(); res = SecDlgGetSecurityData( dn, dlg.m_Sacl, NULL, // No account, we just want a security descriptor dump str ); EndWaitCursor(); // str.Format("ldap_delete_s(ld, \"%s\");", dn); // Out(str, CP_SRC); if (res != LDAP_SUCCESS) { str.Format("Error: Security: %s. <%ld>", ldap_err2string(res), res); Out(str, CP_CMT); Out(CString("Expected: ") + str, CP_PRN|CP_ONLY); ShowErrorInfo(res); } else { str.Format("Security for \"%s\"", dn); Print(str); } } Out("-----------", CP_PRN); } void CLdpDoc::OnBrowseSecurityEffective() { RightDlg dlg; char *dn, *account; CString str; int res; TRUSTEE t; TRUSTEE_ACCESS ta = { 0 }; // ENOUGH for our use if(!bConnected && m_bProtect){ AfxMessageBox("Please re-connect session first"); return; } AfxMessageBox("Not implemented yet"); return; Out("***Calling EffectiveRights...", CP_PRN); if (IDOK == dlg.DoModal()) { // Try to find the effective rights for an entry dn = dlg.m_Dn.IsEmpty() ? NULL : (char*)LPCTSTR(dlg.m_Dn); // // RM: remove for invalid validation // if (dn == NULL && m_bProtect){ AfxMessageBox("Cannot query security on a NULL dn." "Please specify a valid dn."); return; } account = dlg.m_Account.IsEmpty() ? NULL : (char*)LPCTSTR(dlg.m_Account); // // RM: remove for invalid validation // if (account == NULL && m_bProtect){ AfxMessageBox("Cannot query security for a NULL account." "Please specify a valid account."); return; } /* & we execute only in synchronous mode */ // BeginWaitCursor(); #if 0 res = SecDlgGetSecurityData( dn, FALSE, // Dont bother about SACL account, str ); #endif t.pMultipleTrustee = NULL; t.MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE; t.TrusteeForm = TRUSTEE_IS_NAME; t.TrusteeType = TRUSTEE_IS_UNKNOWN; // could be a group, alias, user etc. t.ptstrName = account; ta.fAccessFlags = TRUSTEE_ACCESS_ALLOWED; res = TrusteeAccessToObject( dn, SE_DS_OBJECT_ALL, NULL, // Provider &t, 1, & ta ); if (res) { str.Format("TrusteeAccessToObject Failed %d", res); } else { str.Format("Access Rights %s has to %s are:", account, dn); Print(str); DebugBreak(); } // EndWaitCursor(); } Out("-----------", CP_PRN); } void CLdpDoc::OnUpdateBrowseSecuritySd(CCmdUI* pCmdUI) { pCmdUI->Enable(bConnected); } void CLdpDoc::OnUpdateBrowseSecurityEffective(CCmdUI* pCmdUI) { pCmdUI->Enable(bConnected); } /////////////////////// REPLICATION METADATA HANDLER & FRIENDS ////////////////////////// void CLdpDoc::OnUpdateBrowseReplicationViewmetadata(CCmdUI* pCmdUI) { pCmdUI->Enable(bConnected); } void CLdpDoc::OnBrowseReplicationViewmetadata() { CString str; metadlg dlg; CLdpView *pView; pView = (CLdpView*)GetOwnView(_T("CLdpView")); if(!bConnected && m_bProtect){ AfxMessageBox("Please re-connect session first"); return; } if(GetContextActivation()){ dlg.m_ObjectDn = TreeView()->GetDn(); TreeView()->SetContextActivation(FALSE); } else if (m_vlvDlg && m_vlvDlg->GetContextActivation()) { dlg.m_ObjectDn = m_vlvDlg->GetDN(); m_vlvDlg->SetContextActivation(FALSE); } if (IDOK == dlg.DoModal()) { LPTSTR dn = dlg.m_ObjectDn.IsEmpty() ? NULL : (LPTSTR)LPCTSTR(dlg.m_ObjectDn); if(!dn){ AfxMessageBox("Please enter a valid object DN string"); return; } str.Format("Getting '%s' metadata...", dn); Out(str); BeginWaitCursor(); int ldStatus; LDAPMessage * pldmResults; LDAPMessage * pldmEntry; LPSTR rgpszRootAttrsToRead[] = { "replPropertyMetaData", NULL }; LDAPControl ctrlShowDeleted = { LDAP_SERVER_SHOW_DELETED_OID }; LDAPControl * rgpctrlServerCtrls[] = { &ctrlShowDeleted, NULL }; ldStatus = ldap_search_ext_s( hLdap, dn, LDAP_SCOPE_BASE, "(objectClass=*)", rgpszRootAttrsToRead, 0, rgpctrlServerCtrls, NULL, NULL, 0, &pldmResults ); if ( LDAP_SUCCESS == ldStatus ) { pldmEntry = ldap_first_entry( hLdap, pldmResults ); // // disable redraw // pView->SetRedraw(FALSE); pView->CacheStart(); if ( NULL == pldmEntry ) { ldStatus = hLdap->ld_errno; } else { struct berval ** ppberval; int cVals; ppberval = ldap_get_values_len( hLdap, pldmEntry, "replPropertyMetaData" ); cVals = ldap_count_values_len( ppberval ); if ( 1 != cVals ) { str.Format( "%d values returned for replPropertyMetaData attribute; 1 expected.\n", cVals ); Out( str ); ldStatus = LDAP_OTHER; } else { DWORD iprop; PROPERTY_META_DATA_VECTOR * pmetavec = (PROPERTY_META_DATA_VECTOR *) ppberval[ 0 ]->bv_val; if (VERSION_V1 != pmetavec->dwVersion) { str.Format("Meta Data Version is not %d!! Format unrecognizable!", VERSION_V1); Out(str); } else { str.Format( "%d entries.", pmetavec->V1.cNumProps ); Out( str ); str.Format( "%6s\t%6s\t%8s\t%33s\t\t\t%8s\t%18s", "AttID", "Ver", "Loc.USN", "Originating DSA", "Org.USN", "Org.Time/Date" ); Out( str ); str.Format( "%6s\t%6s\t%8s\t%33s\t\t%8s\t%18s", "=====", "===", "=======", "===============", "=======", "=============" ); Out( str ); for ( iprop = 0; iprop < pmetavec->V1.cNumProps; iprop++ ) { CHAR szTime[ SZDSTIME_LEN ]; struct tm * ptm; UCHAR * pszUUID = NULL; UuidToString(&pmetavec->V1.rgMetaData[ iprop ].uuidDsaOriginating, &pszUUID); str.Format( "%6x\t%6x\t%8I64d\t%33s\t%8I64d\t%18s", pmetavec->V1.rgMetaData[ iprop ].attrType, pmetavec->V1.rgMetaData[ iprop ].dwVersion, pmetavec->V1.rgMetaData[ iprop ].usnProperty, pszUUID ? pszUUID : (UCHAR *) "<conv err>", pmetavec->V1.rgMetaData[ iprop ].usnOriginating, DSTimeToDisplayString(pmetavec->V1.rgMetaData[iprop].timeChanged, szTime) ); Out( str ); if (NULL != pszUUID) { RpcStringFree(&pszUUID); } } } } ldap_value_free_len( ppberval ); } ldap_msgfree( pldmResults ); // // now allow refresh // pView->CacheEnd(); pView->SetRedraw(); } EndWaitCursor(); if ( LDAP_SUCCESS != ldStatus ) { str.Format( "Error: %s. <%ld>", ldap_err2string( ldStatus ), ldStatus ); Out( str ); ShowErrorInfo(ldStatus); } Out("-----------", CP_PRN); } } // // Functions to process GeneralizedTime for DS time values (whenChanged kinda strings) // Mostly taken & sometimes modified from \nt\private\ds\src\dsamain\src\dsatools.c // // // MemAtoi - takes a pointer to a non null terminated string representing // an ascii number and a character count and returns an integer // int CLdpDoc::MemAtoi(BYTE *pb, ULONG cb) { #if (1) int res = 0; int fNeg = FALSE; if (*pb == '-') { fNeg = TRUE; pb++; } while (cb--) { res *= 10; res += *pb - '0'; pb++; } return (fNeg ? -res : res); #else char ach[20]; if (cb >= 20) return(INT_MAX); memcpy(ach, pb, cb); ach[cb] = 0; return atoi(ach); #endif } DWORD CLdpDoc::GeneralizedTimeStringToValue(LPSTR IN szTime, PLONGLONG OUT pllTime) /*++ Function : GeneralizedTimeStringToValue Description: converts Generalized time string to equiv DWORD value Parameters : szTime: G time string pdwTime: returned value Return : Success or failure Remarks : none. --*/ { DWORD status = ERROR_SUCCESS; SYSTEMTIME tmConvert; FILETIME fileTime; LONGLONG tempTime; ULONG cb; int sign = 1; DWORD timeDifference = 0; char *pLastChar; int len=0; // // param sanity // if (!szTime || !pllTime) { return STATUS_INVALID_PARAMETER; } // Intialize pLastChar to point to last character in the string // We will use this to keep track so that we don't reference // beyond the string len = strlen(szTime); pLastChar = szTime + len - 1; if( len < 15 || szTime[14] != '.') { return STATUS_INVALID_PARAMETER; } // initialize memset(&tmConvert, 0, sizeof(SYSTEMTIME)); *pllTime = 0; // Set up and convert all time fields // year field cb=4; tmConvert.wYear = (USHORT)MemAtoi((LPBYTE)szTime, cb) ; szTime += cb; // month field tmConvert.wMonth = (USHORT)MemAtoi((LPBYTE)szTime, (cb=2)); szTime += cb; // day of month field tmConvert.wDay = (USHORT)MemAtoi((LPBYTE)szTime, (cb=2)); szTime += cb; // hours tmConvert.wHour = (USHORT)MemAtoi((LPBYTE)szTime, (cb=2)); szTime += cb; // minutes tmConvert.wMinute = (USHORT)MemAtoi((LPBYTE)szTime, (cb=2)); szTime += cb; // seconds tmConvert.wSecond = (USHORT)MemAtoi((LPBYTE)szTime, (cb=2)); szTime += cb; // Ignore the 1/10 seconds part of GENERALISED_TIME_STRING szTime += 2; // Treat the possible deferential, if any if (szTime <= pLastChar) { switch (*szTime++) { case '-': // negative differential - fall through sign = -1; case '+': // positive differential // Must have at least 4 more chars in string // starting at pb if ( (szTime+3) > pLastChar) { // not enough characters in string return STATUS_INVALID_PARAMETER; } // hours (convert to seconds) timeDifference = (MemAtoi((LPBYTE)szTime, (cb=2))* 3600); szTime += cb; // minutes (convert to seconds) timeDifference += (MemAtoi((LPBYTE)szTime, (cb=2)) * 60); szTime += cb; break; case 'Z': // no differential default: break; } } if (SystemTimeToFileTime(&tmConvert, &fileTime)) { *pllTime = (LONGLONG) fileTime.dwLowDateTime; tempTime = (LONGLONG) fileTime.dwHighDateTime; *pllTime |= (tempTime << 32); // this is 100ns blocks since 1601. Now convert to // seconds *pllTime = *pllTime/(10*1000*1000L); } else { return GetLastError(); } if(timeDifference) { // add/subtract the time difference switch (sign) { case 1: // We assume that adding in a timeDifference will never overflow // (since generalised time strings allow for only 4 year digits, our // maximum date is December 31, 9999 at 23:59. Our maximum // difference is 99 hours and 99 minutes. So, it won't wrap) *pllTime += timeDifference; break; case -1: if(*pllTime < timeDifference) { // differential took us back before the beginning of the world. status = STATUS_INVALID_PARAMETER; } else { *pllTime -= timeDifference; } break; default: status = STATUS_INVALID_PARAMETER; } } return status; } DWORD CLdpDoc::GeneralizedTimeToSystemTime(LPSTR IN szTime, PSYSTEMTIME OUT psysTime) /*++ Function : GeneralizedTimeStringToValue Description: converts Generalized time string to equiv DWORD value Parameters : szTime: G time string pdwTime: returned value Return : Success or failure Remarks : none. --*/ { DWORD status = ERROR_SUCCESS; ULONG cb; ULONG len; // // param sanity // if (!szTime || !psysTime) { return STATUS_INVALID_PARAMETER; } // Intialize pLastChar to point to last character in the string // We will use this to keep track so that we don't reference // beyond the string len = strlen(szTime); if( len < 15 || szTime[14] != '.') { return STATUS_INVALID_PARAMETER; } // initialize memset(psysTime, 0, sizeof(SYSTEMTIME)); // Set up and convert all time fields // year field cb=4; psysTime->wYear = (USHORT)MemAtoi((LPBYTE)szTime, cb) ; szTime += cb; // month field psysTime->wMonth = (USHORT)MemAtoi((LPBYTE)szTime, (cb=2)); szTime += cb; // day of month field psysTime->wDay = (USHORT)MemAtoi((LPBYTE)szTime, (cb=2)); szTime += cb; // hours psysTime->wHour = (USHORT)MemAtoi((LPBYTE)szTime, (cb=2)); szTime += cb; // minutes psysTime->wMinute = (USHORT)MemAtoi((LPBYTE)szTime, (cb=2)); szTime += cb; // seconds psysTime->wSecond = (USHORT)MemAtoi((LPBYTE)szTime, (cb=2)); return status; } DWORD CLdpDoc::DSTimeToSystemTime(LPSTR IN szTime, PSYSTEMTIME OUT psysTime) /*++ Function : DSTimeStringToValue Description: converts UTC time string to equiv DWORD value Parameters : szTime: G time string pdwTime: returned value Return : Success or failure Remarks : none. --*/ { ULONGLONG ull; FILETIME filetime; BOOL ok; ull = _atoi64 (szTime); filetime.dwLowDateTime = (DWORD) (ull & 0xFFFFFFFF); filetime.dwHighDateTime = (DWORD) (ull >> 32); // Convert FILETIME to SYSTEMTIME, if (!FileTimeToSystemTime(&filetime, psysTime)) { return !ERROR_SUCCESS; } return ERROR_SUCCESS; } /*++ Function : OnOptionsStartTLS Description: initiate Transport Level Security on an LDAP connection. Parameters : none Return : none Remarks : none. --*/ void CLdpDoc::OnOptionsStartTls() { ULONG retValue, err; CString str; PLDAPControl *SvrCtrls; PLDAPControl *ClntCtrls; PLDAPMessage result = NULL; str.Format("ldap_start_tls_s(ld, &retValue, result, SvrCtrls, ClntCtrls)"); Out(str); // controls SvrCtrls = m_CtrlDlg->AllocCtrlList(ctrldlg::CT_SVR); ClntCtrls = m_CtrlDlg->AllocCtrlList(ctrldlg::CT_CLNT); err = ldap_start_tls_s(hLdap, &retValue, &result, SvrCtrls, ClntCtrls); if(err == 0){ str.Format("result <0>"); Out(str); } else{ str.Format("Error <0x%X>:ldap_start_tls_s() failed: %s", err, ldap_err2string(err)); Out(str); str.Format("Server Returned: 0x%X: %s", retValue, ldap_err2string(retValue)); Out(str); ShowErrorInfo(err); // If the server returned a referal, check the returned message and print. if(result != NULL){ str.Format("Checking return message for referal..."); Out(str); // if there was a referal then the referal will be in the message. DisplaySearchResults(result); } } ldap_msgfree(result); } /*++ Function : OnOptionsStopTLS Description: Terminate Transport Level Security on an LDAP connection. Parameters : none Return : none Remarks : none. --*/ void CLdpDoc::OnOptionsStopTls() { ULONG retValue, err; CString str; str.Format("ldap_stop_tls_s( ld )"); Out(str); err = ldap_stop_tls_s( hLdap ); if(err == 0){ str.Format("result <0>"); Out(str); } else{ str.Format("Error <0x%X>:ldap_stop_tls_s() failed:%s", err, ldap_err2string(err)); Out(str); ShowErrorInfo(err); } } /* */ void CLdpDoc::OnGetLastError() { CString str; str.Format(_T("0x%X=LdapGetLastError() %s"), LdapGetLastError(), ldap_err2string(LdapGetLastError()) ); Out(str, CP_CMT); } void CLdpDoc::ShowErrorInfo(int res) { int err; LPTSTR pStr = NULL; CString str; if (hLdap == NULL || res == 0 || !m_GenOptDlg->m_extErrorInfo) { return; } err = ldap_get_option(hLdap, LDAP_OPT_SERVER_ERROR, (LPVOID)&pStr); if (err == 0) { // success str.Format("Server error: %s", pStr?pStr:"<empty>"); } else { str.Format("Error <0x%X>:ldap_get_option(hLdap, LDAP_OPT_SERVER_ERROR, &pStr) failed:%s", err, ldap_err2string(err)); } Out(str); }
30.68029
145
0.435571
098225952388ba074e560ffa576c15afc2ebe0c4
2,258
cpp
C++
TestApps/Rosetta/BNN/Sources/utils/DataIO.cpp
stephenneuendorffer/hls_tuner
fa7de78f0e2bb4b8f9f2e0a0368ed071b379c875
[ "MIT" ]
1
2021-02-21T12:13:09.000Z
2021-02-21T12:13:09.000Z
TestApps/Rosetta/BNN/Sources/utils/DataIO.cpp
stephenneuendorffer/hls_tuner
fa7de78f0e2bb4b8f9f2e0a0368ed071b379c875
[ "MIT" ]
null
null
null
TestApps/Rosetta/BNN/Sources/utils/DataIO.cpp
stephenneuendorffer/hls_tuner
fa7de78f0e2bb4b8f9f2e0a0368ed071b379c875
[ "MIT" ]
1
2019-09-10T16:45:27.000Z
2019-09-10T16:45:27.000Z
#include "DataIO.h" #ifdef RUN_STANDALONE #include <ff.h> #endif Cifar10TestInputs::Cifar10TestInputs(const std::string & filename, unsigned n) : m_size(n*CHANNELS*ROWS*COLS) { #ifdef RUN_STANDALONE data = new float[m_size]; DB_PRINT(2, "Opening data file %s\n", filename.c_str()); FIL File; if (f_open(&File, filename.c_str(), FA_READ) != FR_OK) { printf("Cannot open file %s\n", filename.c_str()); exit(1); } unsigned Size; if (f_read(&File, data, m_size * 4, &Size) != FR_OK || Size != m_size * 4) { printf("Cannot read file %s\n", filename.c_str()); exit(1); } if (f_close(&File) != FR_OK) { printf("Cannot close file %s\n", filename.c_str()); exit(1); } #else data = new float[m_size]; DB_PRINT(2, "Opening data archive %s\n", filename.c_str()); unzFile ar = open_unzip(filename.c_str()); unsigned nfiles = get_nfiles_in_unzip(ar); assert(nfiles == 1); // We read m_size*4 bytes from the archive unsigned fsize = get_current_file_size(ar); assert(m_size*4 <= fsize); DB_PRINT(2, "Reading %u bytes\n", m_size*4); read_current_file(ar, (void*)data, m_size*4); unzClose(ar); #endif } Cifar10TestLabels::Cifar10TestLabels(const std::string & filename, unsigned n) : m_size(n) { #ifdef RUN_STANDALONE data = new float[m_size]; DB_PRINT(2, "Opening data file %s\n", filename.c_str()); FIL File; if (f_open(&File, filename.c_str(), FA_READ) != FR_OK) { printf("Cannot open file %s\n", filename.c_str()); exit(1); } unsigned Size; if (f_read(&File, data, m_size * 4, &Size) != FR_OK || Size != m_size * 4) { printf("Cannot read file %s\n", filename.c_str()); exit(1); } if (f_close(&File) != FR_OK) { printf("Cannot close file %s\n", filename.c_str()); exit(1); } #else data = new float[m_size]; DB_PRINT(2, "Opening data archive %s\n", filename.c_str()); unzFile ar = open_unzip(filename.c_str()); unsigned nfiles = get_nfiles_in_unzip(ar); assert(nfiles == 1); // We read n*4 bytes from the archive unsigned fsize = get_current_file_size(ar); assert(m_size*4 <= fsize); DB_PRINT(2, "Reading %u bytes\n", m_size*4); read_current_file(ar, (void*)data, m_size*4); unzClose(ar); #endif }
23.520833
78
0.641718
0982fc2f50f944be4581a3e21cd40ce1d769102d
1,273
cpp
C++
src/trade_book/TradeBook.cpp
karelhala-cz/BitstampTax
361b94a8acf233082badc21da256b4089aad2188
[ "MIT" ]
null
null
null
src/trade_book/TradeBook.cpp
karelhala-cz/BitstampTax
361b94a8acf233082badc21da256b4089aad2188
[ "MIT" ]
null
null
null
src/trade_book/TradeBook.cpp
karelhala-cz/BitstampTax
361b94a8acf233082badc21da256b4089aad2188
[ "MIT" ]
null
null
null
//********************************************************************************************************************* // Author: Karel Hala, hala.karel@gmail.com // Copyright: (c) 2021-2022 Karel Hala // License: MIT //********************************************************************************************************************* #include "TradeBook.h" #include "TradeItem.h" #include "TradeItemMarket.h" C_TradeBook::C_TradeBook() { } void C_TradeBook::Reserve(size_t const count) { m_TradeItems.reserve(count); } void C_TradeBook::AddItem(std::unique_ptr<C_TradeItem> && item) { m_TradeItems.emplace_back(std::move(item)); } void C_TradeBook::SetTradeItems(T_TradeItems && items) { m_TradeItems = std::move(items); } T_CurrencyType C_TradeBook::AssessUserCurrency() const { T_CurrencyType userCurrency; for (T_TradeItemUniquePtr const & item : m_TradeItems) { C_TradeItemMarket const * const itemMarket (dynamic_cast<C_TradeItemMarket const *>(item.get())); if (itemMarket != nullptr) { userCurrency = itemMarket->GetValue().GetType(); break; } } return userCurrency; } void C_TradeBook::PrintData(std::ostringstream & str) { for (T_TradeItemUniquePtr & item : m_TradeItems) { item->PrintData(str); str << std::endl; } }
23.574074
119
0.586803
09839fb928a67e869b7b8cf5c6a1129430fd171f
796
cpp
C++
src/gamelib/utils/LifetimeTracker.cpp
mall0c/GameLib
df4116b53c39be7b178dd87f7eb0fe32a94d00d3
[ "MIT" ]
1
2020-02-17T09:53:36.000Z
2020-02-17T09:53:36.000Z
src/gamelib/utils/LifetimeTracker.cpp
mall0c/GameLib
df4116b53c39be7b178dd87f7eb0fe32a94d00d3
[ "MIT" ]
null
null
null
src/gamelib/utils/LifetimeTracker.cpp
mall0c/GameLib
df4116b53c39be7b178dd87f7eb0fe32a94d00d3
[ "MIT" ]
null
null
null
#include "gamelib/utils/LifetimeTracker.hpp" namespace gamelib { SlotMapShort<void*> LifetimeTrackerManager::_data; LifetimeTrackerManager::LifetimeTrackerManager() { } auto LifetimeTrackerManager::add(void* ptr) -> LifetimeHandle { auto h = _data.acquire(); _data[h] = ptr; return h; } auto LifetimeTrackerManager::del(LifetimeHandle handle) -> void { _data.destroy(handle); } auto LifetimeTrackerManager::get(LifetimeHandle handle) -> void* { if (_data.isValid(handle)) return _data[handle]; return nullptr; } auto LifetimeTrackerManager::update(LifetimeHandle handle, void* newptr) -> void { if (_data.isValid(handle)) _data[handle] = newptr; } }
22.742857
84
0.628141
0988cb9ad208ef6d58ccf6001e8cd49c540a41e6
2,410
cpp
C++
VoDTCPServer/VoDTCPServerView.cpp
ckaraca/VoD
415590649053eb560ef094768bec210c4c0fe19f
[ "MIT" ]
3
2021-11-26T21:26:32.000Z
2022-01-09T20:54:49.000Z
VoDTCPServer/VoDTCPServerView.cpp
ckaraca/VoD
415590649053eb560ef094768bec210c4c0fe19f
[ "MIT" ]
null
null
null
VoDTCPServer/VoDTCPServerView.cpp
ckaraca/VoD
415590649053eb560ef094768bec210c4c0fe19f
[ "MIT" ]
null
null
null
// VoDTCPServerView.cpp : implementation of the CVoDTCPServerView class // #include "stdafx.h" #include "VoDTCPServer.h" #include "VoDTCPServerDoc.h" #include "VoDTCPServerView.h" #ifdef _DEBUG #define new DEBUG_NEW #endif #define WSA_VERSION MAKEWORD(2,0) extern TCHAR ServerPathName[]; extern TCHAR ServerPath[]; // CVoDTCPServerView IMPLEMENT_DYNCREATE(CVoDTCPServerView, CListView) BEGIN_MESSAGE_MAP(CVoDTCPServerView, CListView) ON_MESSAGE(WM_SETLIST,SetListEx) ON_MESSAGE(WM_SETLISTS,SetListSuccessEx) END_MESSAGE_MAP() // CVoDTCPServerView construction/destruction extern HWND hWnd; CVoDTCPServerView::CVoDTCPServerView() { index = 0; } CVoDTCPServerView::~CVoDTCPServerView() { } BOOL CVoDTCPServerView::PreCreateWindow(CREATESTRUCT& cs) { cs.style &= ~LVS_TYPEMASK; cs.style |= LVS_REPORT; return CListView::PreCreateWindow(cs); } void CVoDTCPServerView::OnInitialUpdate() { CListView::OnInitialUpdate(); RECT rc; GetClientRect(&rc); GetListCtrl ().InsertColumn (0, _T ("Status ID"), LVCFMT_LEFT, 100); GetListCtrl ().InsertColumn (1, _T ("Event"), LVCFMT_LEFT, 300); GetListCtrl ().InsertColumn (2, _T ("Success"), LVCFMT_LEFT,rc.right-400); // begin adding here SetList("002","Starting Windows sockets"); SetListSuccess("OK!"); SetList("003","Starting TCP Listener thread"); //Listen = new CTCPListener; hWnd = this->m_hWnd; AfxBeginThread(TCPListener,(LPVOID)0); SetListSuccess("OK!"); } void CVoDTCPServerView::SetList(TCHAR *Code,TCHAR *Event) { GetListCtrl ().InsertItem (index,Code); GetListCtrl ().SetItemText (index, 1, Event); } void CVoDTCPServerView::SetListSuccess(TCHAR *Success) { GetListCtrl ().SetItemText (index++, 2, Success); } LONG CVoDTCPServerView::SetListEx(WPARAM wParam,LPARAM lParam) { SetList((TCHAR *)wParam,(TCHAR *)lParam); return 0; } LONG CVoDTCPServerView::SetListSuccessEx(WPARAM wParam,LPARAM /*lParam*/) { SetListSuccess((TCHAR *)wParam); return 0; } // CVoDTCPServerView diagnostics #ifdef _DEBUG void CVoDTCPServerView::AssertValid() const { CListView::AssertValid(); } void CVoDTCPServerView::Dump(CDumpContext& dc) const { CListView::Dump(dc); } CVoDTCPServerDoc* CVoDTCPServerView::GetDocument() const // non-debug version is inline { ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CVoDTCPServerDoc))); return (CVoDTCPServerDoc*)m_pDocument; } #endif //_DEBUG // CVoDTCPServerView message handlers
21.327434
87
0.755602
09899356e00cbb258e99c61dd65dd32b225df382
2,492
cpp
C++
plugins/builtin.cpp
iotbzh/DEPRECATED_afb-signal-composer
ee50d58c38e4a8f2dafd40b6cdf3aa6c7612e866
[ "Apache-2.0" ]
null
null
null
plugins/builtin.cpp
iotbzh/DEPRECATED_afb-signal-composer
ee50d58c38e4a8f2dafd40b6cdf3aa6c7612e866
[ "Apache-2.0" ]
null
null
null
plugins/builtin.cpp
iotbzh/DEPRECATED_afb-signal-composer
ee50d58c38e4a8f2dafd40b6cdf3aa6c7612e866
[ "Apache-2.0" ]
null
null
null
/* * Copyright (C) 2016 "IoT.bzh" * Author Romain Forlot <romain.forlot@iot.bzh> * * 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. * */ #define AFB_BINDING_VERSION 2 #include <afb/afb-binding.h> #include <systemd/sd-event.h> #include <json-c/json_object.h> #include <stdbool.h> #include <string.h> #include "signal-composer.hpp" #include "ctl-config.h" #include "wrap-json.h" extern "C" { CTLP_LUA_REGISTER("builtin"); static struct signalCBT* pluginCtx = NULL; // Call at initialisation time /*CTLP_ONLOAD(plugin, handle) { pluginCtx = (struct signalCBT*)calloc (1, sizeof(struct signalCBT)); pluginCtx = (struct signalCBT*)handle; AFB_NOTICE ("Signal Composer builtin plugin: label='%s' info='%s'", plugin->uid, plugin->info); return (void*)pluginCtx; }*/ CTLP_CAPI (defaultOnReceived, source, argsJ, eventJ) { struct signalCBT* ctx = (struct signalCBT*)source->context; AFB_NOTICE("source: %s argj: %s, eventJ %s", source->uid, json_object_to_json_string(argsJ), json_object_to_json_string(eventJ)); void* sig = ctx->aSignal; json_object* valueJ = nullptr; json_object* timestampJ = nullptr; double value = 0; uint64_t timestamp = 0; if(json_object_object_get_ex(eventJ, "value", &valueJ)) {value = json_object_get_double(valueJ);} if(json_object_object_get_ex(eventJ, "timestamp", &timestampJ)) {timestamp = json_object_get_int64(timestampJ);} struct signalValue v = value; ctx->setSignalValue(sig, timestamp, v); return 0; } CTLP_LUA2C (setSignalValueWrap, source, argsJ, responseJ) { const char* name = nullptr; double resultNum; uint64_t timestamp; if(! wrap_json_unpack(argsJ, "{ss, sF, sI? !}", "name", &name, "value", &resultNum, "timestamp", &timestamp)) { AFB_ERROR("Fail to set value for uid: %s, argsJ: %s", source->uid, json_object_to_json_string(argsJ)); return -1; } struct signalValue result = resultNum; pluginCtx->searchNsetSignalValue(name, timestamp*MICRO, result); return 0; } // extern "C" closure }
27.688889
104
0.725522
09914911c663a26bded7882603c949dbd05b885a
650
cpp
C++
include/L298/L298.cpp
baz-snow-ss/PU-Winder
78775f91ec5416918057ad33208052f787c7e61a
[ "MIT" ]
null
null
null
include/L298/L298.cpp
baz-snow-ss/PU-Winder
78775f91ec5416918057ad33208052f787c7e61a
[ "MIT" ]
null
null
null
include/L298/L298.cpp
baz-snow-ss/PU-Winder
78775f91ec5416918057ad33208052f787c7e61a
[ "MIT" ]
null
null
null
/* L298.cpp - Library to control the L298 motor driver (c). */ #include "L298.h" L298::L298(uint8_t IN1,uint8_t IN2,uint8_t EN1){ _IN1 = IN1; _IN2 = IN2; _EN1 = EN1; pinMode(_IN1, OUTPUT); pinMode(_IN2, OUTPUT); pinMode(_EN1, OUTPUT); } void L298::Forward(uint8_t pwm){ digitalWrite(_IN1,1); digitalWrite(_IN2,0); analogWrite(_EN1,pwm); } void L298::Reverse(uint8_t pwm){ digitalWrite(_IN1,0); digitalWrite(_IN2,1); analogWrite(_EN1,pwm); } void L298::Disable(){ digitalWrite(_IN1,1); digitalWrite(_IN2,1); } void L298::Stop(){ analogWrite(_IN1,0); analogWrite(_IN2,0); }
17.105263
59
0.632308
0995a4bfc97cf2bc46e173bd52b113ce0b119b86
2,190
cpp
C++
src/libs/utilities/testharness/play.cpp
suggitpe/RPMS
7a12da0128f79b8b0339fd7146105ba955079b8c
[ "Apache-2.0" ]
null
null
null
src/libs/utilities/testharness/play.cpp
suggitpe/RPMS
7a12da0128f79b8b0339fd7146105ba955079b8c
[ "Apache-2.0" ]
null
null
null
src/libs/utilities/testharness/play.cpp
suggitpe/RPMS
7a12da0128f79b8b0339fd7146105ba955079b8c
[ "Apache-2.0" ]
null
null
null
#include <stdio.h> #include <sys/resource.h> #include <sys/time.h> #include <unistd.h> #include <iostream> void print_cpu_time() { struct rusage usage; getrusage (RUSAGE_SELF, &usage); printf ("CPU time: %ld.%06ld sec user, %ld.%06ld sec system\n", usage.ru_utime.tv_sec, usage.ru_utime.tv_usec, usage.ru_stime.tv_sec, usage.ru_stime.tv_usec); std::cout << "user (" << usage.ru_utime.tv_sec << ") secs, (" << usage.ru_utime.tv_usec << ")" << std::endl; } void debug() // just somewhere safe to keep the info { /*cout << "Description ...............................................: " << setw(20) << "Latest" << setw(20) << "Baseline" << setw(20) << "Diff" << endl; cout << "-----------------------------------------------------------: " << setw(20) << "------" << setw(20) << "--------" << setw(20) << "----" << endl; cout << "Total amount of user time used (secs) .....................: " << setw(20) << mLatestData.ru_utime.tv_sec << setw(20) << mBaselineData.ru_utime.tv_sec << setw(20) << (mLatestData.ru_utime.tv_sec - mBaselineData.ru_utime.tv_sec) << endl; cout << "Total amount of user time used (u_secs) ...................: " << setw(20) << mLatestData.ru_utime.tv_usec << setw(20) << mBaselineData.ru_utime.tv_usec << setw(20) << (mLatestData.ru_utime.tv_usec - mBaselineData.ru_utime.tv_usec) << endl; cout << "Total amount of system time used (secs) ...................: " << setw(20) << mLatestData.ru_stime.tv_sec << setw(20) << mBaselineData.ru_stime.tv_sec << setw(20) << (mLatestData.ru_stime.tv_sec - mBaselineData.ru_stime.tv_sec) << endl; cout << "Total amount of system time used (usecs) ..................: " << setw(20) << mLatestData.ru_stime.tv_usec << setw(20) << mBaselineData.ru_stime.tv_usec << setw(20) << (mLatestData.ru_stime.tv_usec - mBaselineData.ru_stime.tv_usec) << endl; cout << "Maximum resident set size (in kilobytes) ..................: " << setw(20) << mLatestData.ru_maxrss << setw(20) << mBaselineData.ru_maxrss << setw(20) << (mLatestData.ru_maxrss - mBaselineData.ru_maxrss) << endl;*/ } int main() { print_cpu_time(); return 0; }
66.363636
256
0.574886
0998a6a1c67e59ff7263fff32514f9b73af3fa9b
1,583
cpp
C++
modules/cudaimgproc/samples/connected_components.cpp
pccvlab/opencv_contrib
f6a39c5d01a7b2d2bb223a2a67beb9736fce7d93
[ "Apache-2.0" ]
null
null
null
modules/cudaimgproc/samples/connected_components.cpp
pccvlab/opencv_contrib
f6a39c5d01a7b2d2bb223a2a67beb9736fce7d93
[ "Apache-2.0" ]
null
null
null
modules/cudaimgproc/samples/connected_components.cpp
pccvlab/opencv_contrib
f6a39c5d01a7b2d2bb223a2a67beb9736fce7d93
[ "Apache-2.0" ]
null
null
null
#include <iostream> #include <opencv2/core/utility.hpp> #include "opencv2/imgproc.hpp" #include "opencv2/imgcodecs.hpp" #include "opencv2/highgui.hpp" #include "opencv2/cudaimgproc.hpp" using namespace cv; using namespace std; using namespace cv::cuda; void colorLabels(const Mat1i& labels, Mat3b& colors) { colors.create(labels.size()); for (int r = 0; r < labels.rows; ++r) { int const* labels_row = labels.ptr<int>(r); Vec3b* colors_row = colors.ptr<Vec3b>(r); for (int c = 0; c < labels.cols; ++c) { colors_row[c] = Vec3b(labels_row[c] * 131 % 255, labels_row[c] * 241 % 255, labels_row[c] * 251 % 255); } } } int main(int argc, const char** argv) { CommandLineParser parser(argc, argv, "{@image|stuff.jpg|image for converting to a grayscale}"); parser.about("This program finds connected components in a binary image and assign each of them a different color.\n" "The connected components labeling is performed in GPU.\n"); parser.printMessage(); String inputImage = parser.get<string>(0); Mat1b img = imread(samples::findFile(inputImage), IMREAD_GRAYSCALE); Mat1i labels; if (img.empty()) { cout << "Could not read input image file: " << inputImage << endl; return EXIT_FAILURE; } GpuMat d_img, d_labels; d_img.upload(img); cuda::connectedComponents(d_img, d_labels, 8, CV_32S); d_labels.download(labels); Mat3b colors; colorLabels(labels, colors); imshow("Labels", colors); waitKey(0); return EXIT_SUCCESS; }
26.830508
121
0.655085
099a548581f12d5b5a3a2a36c45dd14ccf4a8336
176
cpp
C++
src/world/health.cpp
louiz/batajelo
4d8edce8da9d3b17dbad68eb4881d7f6fee2f76e
[ "BSL-1.0", "BSD-2-Clause", "Zlib", "MIT" ]
7
2015-01-28T09:17:08.000Z
2020-04-21T13:51:16.000Z
src/world/health.cpp
louiz/batajelo
4d8edce8da9d3b17dbad68eb4881d7f6fee2f76e
[ "BSL-1.0", "BSD-2-Clause", "Zlib", "MIT" ]
null
null
null
src/world/health.cpp
louiz/batajelo
4d8edce8da9d3b17dbad68eb4881d7f6fee2f76e
[ "BSL-1.0", "BSD-2-Clause", "Zlib", "MIT" ]
1
2020-07-11T09:20:25.000Z
2020-07-11T09:20:25.000Z
#include <world/health.hpp> const ComponentType Health::component_type; Health::Health(const Quantity::type max): Quantity(max) { } void Health::tick(Entity*, World*) { }
13.538462
43
0.721591
099a85de008229877140cca914f025843039871f
372
cpp
C++
05_bits/digits_demo.cpp
anton0xf/stepik_cpp
fe87fff8523bc62c92b13dc8c0908b6d984aec43
[ "MIT" ]
null
null
null
05_bits/digits_demo.cpp
anton0xf/stepik_cpp
fe87fff8523bc62c92b13dc8c0908b6d984aec43
[ "MIT" ]
null
null
null
05_bits/digits_demo.cpp
anton0xf/stepik_cpp
fe87fff8523bc62c92b13dc8c0908b6d984aec43
[ "MIT" ]
null
null
null
#include <stdio.h> #include "digits.hpp" int main() { init_digits(); printf("values: \n"); for (int i=0; i < VALUES_COUNT; i++) { if (values[i] == UNUSED) continue; printf("%c -> %lld\n", (char)i, values[i]); } printf("digits: "); for (int i=0; i < DIGITS_COUNT; i++) { printf("%c, ", digits[i]); } printf("\n"); }
21.882353
51
0.491935
099fbb7c121449c95fb9f56489000d921c612477
814
hpp
C++
Kuplung/kuplung/utilities/consumption/WindowsCPUUsage.hpp
supudo/Kuplung
f0e11934fde0675fa531e6dc263bedcc20a5ea1a
[ "Unlicense" ]
14
2017-02-17T17:12:40.000Z
2021-12-22T01:55:06.000Z
Kuplung/kuplung/utilities/consumption/WindowsCPUUsage.hpp
supudo/Kuplung
f0e11934fde0675fa531e6dc263bedcc20a5ea1a
[ "Unlicense" ]
null
null
null
Kuplung/kuplung/utilities/consumption/WindowsCPUUsage.hpp
supudo/Kuplung
f0e11934fde0675fa531e6dc263bedcc20a5ea1a
[ "Unlicense" ]
1
2019-10-15T08:10:10.000Z
2019-10-15T08:10:10.000Z
// // WindowsCPUUsage.hpp // Kuplung // // Created by Sergey Petrov on 12/16/15. // Copyright © 2015 supudo.net. All rights reserved. // #ifndef WindowsCPUUsage_hpp #define WindowsCPUUsage_hpp namespace KuplungApp { namespace Utilities { namespace Consumption { #include <windows.h> class WindowsCPUUsage { public: WindowsCPUUsage(); short GetUsage(); private: ULONGLONG SubtractTimes(const FILETIME& ftA, const FILETIME& ftB); bool EnoughTimePassed(); inline bool IsFirstRun() const { return (m_dwLastRun == 0); } //system total times FILETIME m_ftPrevSysKernel; FILETIME m_ftPrevSysUser; //process times FILETIME m_ftPrevProcKernel; FILETIME m_ftPrevProcUser; short m_nCpuUsage; ULONGLONG m_dwLastRun; volatile LONG m_lRunCount; }; }}} #endif /* WindowsCPUUsage_hpp */
18.930233
68
0.739558
09a0d8fbc646e7ed4bca93c50809b96655e90b06
787
cpp
C++
assingment/32.cpp
aditya1k2/CPP-SEM-2-KIIT
1afceeb39458201b6dafe33422d7de8e613d96de
[ "MIT" ]
null
null
null
assingment/32.cpp
aditya1k2/CPP-SEM-2-KIIT
1afceeb39458201b6dafe33422d7de8e613d96de
[ "MIT" ]
null
null
null
assingment/32.cpp
aditya1k2/CPP-SEM-2-KIIT
1afceeb39458201b6dafe33422d7de8e613d96de
[ "MIT" ]
null
null
null
/* Name:- Aditya Kumar Gupta Roll No.:- 1706291 Sec:- B-19 Ques No.:-32 */ #include<iostream> #include<stdio.h> using namespace std; int main() { char str[100],pat[20],new_str[100],rep_pat[50]; int i=0,j=0,k,n=0,copy_loop=0, rep_index=0; cout<<"Enter the string:\n"; gets(str); cout<<"\nEnter the pattern: "; gets(pat); cout<<"\nEnter the replace pattern:"; gets(rep_pat); while(str[i]!='\0') { j=0,k=i; while(str[k]==pat[j] && pat[j]!='\0') { k++; j++; } if(pat[j]=='\0') { copy_loop=k; while(rep_pat[rep_index]!='\0') { new_str[n]=rep_pat[rep_index]; rep_index++; n++; } } new_str[n]=str[copy_loop]; i++; copy_loop++; n++; } new_str[n]='\0'; cout<<"\nThe new string is: "; puts(new_str); return 0; }
18.738095
48
0.556544
09a191ad3902e2287e28eccae3b07851957fe736
2,035
cpp
C++
cpp/HeapStack/HeapStack_v1/main.cpp
ArboreusSystems/arboreus_examples
17d39e18f4b2511c19f97d4e6c07ec9d7087fae8
[ "BSD-3-Clause" ]
17
2019-02-19T21:29:22.000Z
2022-01-29T11:03:45.000Z
cpp/HeapStack/HeapStack_v1/main.cpp
MbohBless/arboreus_examples
97f0e25182bbc4b5ffab37c6157514332002aeee
[ "BSD-3-Clause" ]
null
null
null
cpp/HeapStack/HeapStack_v1/main.cpp
MbohBless/arboreus_examples
97f0e25182bbc4b5ffab37c6157514332002aeee
[ "BSD-3-Clause" ]
9
2021-02-21T05:32:23.000Z
2022-02-26T07:51:52.000Z
/* ------------------------------------------------------------------- * @doc * @notice Template file wizards/projects/plaincpp/main.cpp * * @copyright Arboreus (http://arboreus.systems) * @author Alexandr Kirilov (http://alexandr.kirilov.me) * @created 19/07/2020 at 13:12:12 * */// -------------------------------------------------------------- // System includes #include <iostream> // Application includes #include "maindatamodels.h" #include "alogger.h" // Constants #define A_MAX_LOOP_COUNT 10000000 // Namespace using namespace std; // Application int main(int inCounter, char *inArguments[]) { int oStackInteger = 10; int oStackArray[10]; oStackArray[0] = 0; oStackArray[1] = 1; oStackArray[2] = 2; oStackArray[3] = 3; oStackArray[4] = 4; oStackArray[5] = 5; oStackArray[6] = 6; oStackArray[7] = 7; oStackArray[8] = 8; oStackArray[9] = 9; ACordinates oStackCordinates; oStackCordinates.pX = 100; oStackCordinates.pY = 100; int* oHeapInteger = new int; *oHeapInteger = 5; int* oHeapArray = new int[10]; oHeapArray[0] = 0; oHeapArray[1] = 1; oHeapArray[2] = 2; oHeapArray[3] = 3; oHeapArray[4] = 4; oHeapArray[5] = 5; oHeapArray[6] = 6; oHeapArray[7] = 7; oHeapArray[8] = 8; oHeapArray[9] = 9; ACordinates* oHeapCordinates = new ACordinates(); oHeapCordinates->pX = 20; oHeapCordinates->pY = 20; delete oHeapInteger; delete[] oHeapArray; delete oHeapCordinates; clock_t oStackAllocStart = clock(); for (int i = 0; i < A_MAX_LOOP_COUNT; ++i) { ACordinates iStackCordinates1 = ACordinates(); } clock_t oStackAllocDuartion = clock() - oStackAllocStart; ALOG << "Stack allocation duration: " << oStackAllocDuartion << endl; clock_t oHeapAllocStart = clock(); for (int i = 0; i < A_MAX_LOOP_COUNT; ++i) { ACordinates* iHeapCordinates1 = new ACordinates(); // delete iHeapCordinates1; } clock_t oHeapAllocDuartion = clock() - oHeapAllocStart; ALOG << "Heap allocation duration: " << oHeapAllocDuartion << endl; ALOG << "Heap and stack demo OK" << endl; return 0; }
26.776316
70
0.648649
09a1db3d62886f85788529fe56a696428bd6d4d2
11,674
cpp
C++
vm/external_libs/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
marnen/rubinius
05b3f9789d01bada0604a7f09921c956bc9487e7
[ "BSD-3-Clause" ]
1
2016-05-08T16:58:14.000Z
2016-05-08T16:58:14.000Z
vm/external_libs/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
taf2/rubinius
493bfa2351fc509ca33d3bb03991c2e9c2b6dafa
[ "BSD-3-Clause" ]
null
null
null
vm/external_libs/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp
taf2/rubinius
493bfa2351fc509ca33d3bb03991c2e9c2b6dafa
[ "BSD-3-Clause" ]
null
null
null
//===-- ValueEnumerator.cpp - Number values and types for bitcode writer --===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file implements the ValueEnumerator class. // //===----------------------------------------------------------------------===// #include "ValueEnumerator.h" #include "llvm/Constants.h" #include "llvm/DerivedTypes.h" #include "llvm/Module.h" #include "llvm/TypeSymbolTable.h" #include "llvm/ValueSymbolTable.h" #include "llvm/Instructions.h" #include <algorithm> using namespace llvm; static bool isFirstClassType(const std::pair<const llvm::Type*, unsigned int> &P) { return P.first->isFirstClassType(); } static bool isIntegerValue(const std::pair<const Value*, unsigned> &V) { return isa<IntegerType>(V.first->getType()); } static bool CompareByFrequency(const std::pair<const llvm::Type*, unsigned int> &P1, const std::pair<const llvm::Type*, unsigned int> &P2) { return P1.second > P2.second; } /// ValueEnumerator - Enumerate module-level information. ValueEnumerator::ValueEnumerator(const Module *M) { // Enumerate the global variables. for (Module::const_global_iterator I = M->global_begin(), E = M->global_end(); I != E; ++I) EnumerateValue(I); // Enumerate the functions. for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I) { EnumerateValue(I); EnumerateParamAttrs(cast<Function>(I)->getParamAttrs()); } // Enumerate the aliases. for (Module::const_alias_iterator I = M->alias_begin(), E = M->alias_end(); I != E; ++I) EnumerateValue(I); // Remember what is the cutoff between globalvalue's and other constants. unsigned FirstConstant = Values.size(); // Enumerate the global variable initializers. for (Module::const_global_iterator I = M->global_begin(), E = M->global_end(); I != E; ++I) if (I->hasInitializer()) EnumerateValue(I->getInitializer()); // Enumerate the aliasees. for (Module::const_alias_iterator I = M->alias_begin(), E = M->alias_end(); I != E; ++I) EnumerateValue(I->getAliasee()); // Enumerate types used by the type symbol table. EnumerateTypeSymbolTable(M->getTypeSymbolTable()); // Insert constants that are named at module level into the slot pool so that // the module symbol table can refer to them... EnumerateValueSymbolTable(M->getValueSymbolTable()); // Enumerate types used by function bodies and argument lists. for (Module::const_iterator F = M->begin(), E = M->end(); F != E; ++F) { for (Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I) EnumerateType(I->getType()); for (Function::const_iterator BB = F->begin(), E = F->end(); BB != E; ++BB) for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I!=E;++I){ for (User::const_op_iterator OI = I->op_begin(), E = I->op_end(); OI != E; ++OI) EnumerateOperandType(*OI); EnumerateType(I->getType()); if (const CallInst *CI = dyn_cast<CallInst>(I)) EnumerateParamAttrs(CI->getParamAttrs()); else if (const InvokeInst *II = dyn_cast<InvokeInst>(I)) EnumerateParamAttrs(II->getParamAttrs()); } } // Optimize constant ordering. OptimizeConstants(FirstConstant, Values.size()); // Sort the type table by frequency so that most commonly used types are early // in the table (have low bit-width). std::stable_sort(Types.begin(), Types.end(), CompareByFrequency); // Partition the Type ID's so that the first-class types occur before the // aggregate types. This allows the aggregate types to be dropped from the // type table after parsing the global variable initializers. std::partition(Types.begin(), Types.end(), isFirstClassType); // Now that we rearranged the type table, rebuild TypeMap. for (unsigned i = 0, e = Types.size(); i != e; ++i) TypeMap[Types[i].first] = i+1; } // Optimize constant ordering. struct CstSortPredicate { ValueEnumerator &VE; CstSortPredicate(ValueEnumerator &ve) : VE(ve) {} bool operator()(const std::pair<const Value*, unsigned> &LHS, const std::pair<const Value*, unsigned> &RHS) { // Sort by plane. if (LHS.first->getType() != RHS.first->getType()) return VE.getTypeID(LHS.first->getType()) < VE.getTypeID(RHS.first->getType()); // Then by frequency. return LHS.second > RHS.second; } }; /// OptimizeConstants - Reorder constant pool for denser encoding. void ValueEnumerator::OptimizeConstants(unsigned CstStart, unsigned CstEnd) { if (CstStart == CstEnd || CstStart+1 == CstEnd) return; CstSortPredicate P(*this); std::stable_sort(Values.begin()+CstStart, Values.begin()+CstEnd, P); // Ensure that integer constants are at the start of the constant pool. This // is important so that GEP structure indices come before gep constant exprs. std::partition(Values.begin()+CstStart, Values.begin()+CstEnd, isIntegerValue); // Rebuild the modified portion of ValueMap. for (; CstStart != CstEnd; ++CstStart) ValueMap[Values[CstStart].first] = CstStart+1; } /// EnumerateTypeSymbolTable - Insert all of the types in the specified symbol /// table. void ValueEnumerator::EnumerateTypeSymbolTable(const TypeSymbolTable &TST) { for (TypeSymbolTable::const_iterator TI = TST.begin(), TE = TST.end(); TI != TE; ++TI) EnumerateType(TI->second); } /// EnumerateValueSymbolTable - Insert all of the values in the specified symbol /// table into the values table. void ValueEnumerator::EnumerateValueSymbolTable(const ValueSymbolTable &VST) { for (ValueSymbolTable::const_iterator VI = VST.begin(), VE = VST.end(); VI != VE; ++VI) EnumerateValue(VI->getValue()); } void ValueEnumerator::EnumerateValue(const Value *V) { assert(V->getType() != Type::VoidTy && "Can't insert void values!"); // Check to see if it's already in! unsigned &ValueID = ValueMap[V]; if (ValueID) { // Increment use count. Values[ValueID-1].second++; return; } // Enumerate the type of this value. EnumerateType(V->getType()); if (const Constant *C = dyn_cast<Constant>(V)) { if (isa<GlobalValue>(C)) { // Initializers for globals are handled explicitly elsewhere. } else if (isa<ConstantArray>(C) && cast<ConstantArray>(C)->isString()) { // Do not enumerate the initializers for an array of simple characters. // The initializers just polute the value table, and we emit the strings // specially. } else if (C->getNumOperands()) { // If a constant has operands, enumerate them. This makes sure that if a // constant has uses (for example an array of const ints), that they are // inserted also. // We prefer to enumerate them with values before we enumerate the user // itself. This makes it more likely that we can avoid forward references // in the reader. We know that there can be no cycles in the constants // graph that don't go through a global variable. for (User::const_op_iterator I = C->op_begin(), E = C->op_end(); I != E; ++I) EnumerateValue(*I); // Finally, add the value. Doing this could make the ValueID reference be // dangling, don't reuse it. Values.push_back(std::make_pair(V, 1U)); ValueMap[V] = Values.size(); return; } } // Add the value. Values.push_back(std::make_pair(V, 1U)); ValueID = Values.size(); } void ValueEnumerator::EnumerateType(const Type *Ty) { unsigned &TypeID = TypeMap[Ty]; if (TypeID) { // If we've already seen this type, just increase its occurrence count. Types[TypeID-1].second++; return; } // First time we saw this type, add it. Types.push_back(std::make_pair(Ty, 1U)); TypeID = Types.size(); // Enumerate subtypes. for (Type::subtype_iterator I = Ty->subtype_begin(), E = Ty->subtype_end(); I != E; ++I) EnumerateType(*I); } // Enumerate the types for the specified value. If the value is a constant, // walk through it, enumerating the types of the constant. void ValueEnumerator::EnumerateOperandType(const Value *V) { EnumerateType(V->getType()); if (const Constant *C = dyn_cast<Constant>(V)) { // If this constant is already enumerated, ignore it, we know its type must // be enumerated. if (ValueMap.count(V)) return; // This constant may have operands, make sure to enumerate the types in // them. for (unsigned i = 0, e = C->getNumOperands(); i != e; ++i) EnumerateOperandType(C->getOperand(i)); } } void ValueEnumerator::EnumerateParamAttrs(const PAListPtr &PAL) { if (PAL.isEmpty()) return; // null is always 0. // Do a lookup. unsigned &Entry = ParamAttrMap[PAL.getRawPointer()]; if (Entry == 0) { // Never saw this before, add it. ParamAttrs.push_back(PAL); Entry = ParamAttrs.size(); } } /// PurgeAggregateValues - If there are any aggregate values at the end of the /// value list, remove them and return the count of the remaining values. If /// there are none, return -1. int ValueEnumerator::PurgeAggregateValues() { // If there are no aggregate values at the end of the list, return -1. if (Values.empty() || Values.back().first->getType()->isFirstClassType()) return -1; // Otherwise, remove aggregate values... while (!Values.empty() && !Values.back().first->getType()->isFirstClassType()) Values.pop_back(); // ... and return the new size. return Values.size(); } void ValueEnumerator::incorporateFunction(const Function &F) { NumModuleValues = Values.size(); // Adding function arguments to the value table. for(Function::const_arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I) EnumerateValue(I); FirstFuncConstantID = Values.size(); // Add all function-level constants to the value table. for (Function::const_iterator BB = F.begin(), E = F.end(); BB != E; ++BB) { for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I!=E; ++I) for (User::const_op_iterator OI = I->op_begin(), E = I->op_end(); OI != E; ++OI) { if ((isa<Constant>(*OI) && !isa<GlobalValue>(*OI)) || isa<InlineAsm>(*OI)) EnumerateValue(*OI); } BasicBlocks.push_back(BB); ValueMap[BB] = BasicBlocks.size(); } // Optimize the constant layout. OptimizeConstants(FirstFuncConstantID, Values.size()); // Add the function's parameter attributes so they are available for use in // the function's instruction. EnumerateParamAttrs(F.getParamAttrs()); FirstInstID = Values.size(); // Add all of the instructions. for (Function::const_iterator BB = F.begin(), E = F.end(); BB != E; ++BB) { for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I!=E; ++I) { if (I->getType() != Type::VoidTy) EnumerateValue(I); } } } void ValueEnumerator::purgeFunction() { /// Remove purged values from the ValueMap. for (unsigned i = NumModuleValues, e = Values.size(); i != e; ++i) ValueMap.erase(Values[i].first); for (unsigned i = 0, e = BasicBlocks.size(); i != e; ++i) ValueMap.erase(BasicBlocks[i]); Values.resize(NumModuleValues); BasicBlocks.clear(); }
35.591463
80
0.640569
09a3ffc1941a8251858d718e4c97e3e9aa166202
533
cpp
C++
competitive_programming/programming_contests/spoj_br/bafo.cpp
LeandroTk/Algorithms
569ed68eba3eeff902f8078992099c28ce4d7cd6
[ "MIT" ]
205
2018-12-01T17:49:49.000Z
2021-12-22T07:02:27.000Z
competitive_programming/programming_contests/spoj_br/bafo.cpp
LeandroTk/Algorithms
569ed68eba3eeff902f8078992099c28ce4d7cd6
[ "MIT" ]
2
2020-01-01T16:34:29.000Z
2020-04-26T19:11:13.000Z
competitive_programming/programming_contests/spoj_br/bafo.cpp
LeandroTk/Algorithms
569ed68eba3eeff902f8078992099c28ce4d7cd6
[ "MIT" ]
50
2018-11-28T20:51:36.000Z
2021-11-29T04:08:25.000Z
// BAFO #include <iostream> #include <string> using namespace std; int main() { int n, t_beto=0, t_aldo=0, x, y, counter=1; string result; cin >> n; if(n == 0) return 0; while(n != 0) { for (int i = 0; i < n; i++) { cin >> x >> y; t_aldo += x; t_beto += y; } if (t_aldo > t_beto) result = "Aldo"; else result = "Beto"; cout << "Teste " << counter << endl; cout << result << endl << endl; cin >> n; counter++; t_beto = 0; t_aldo = 0; } }
13.666667
45
0.467167
09a7bbef2734479c32e47415b0af0ef5556fa88e
209
cpp
C++
ACTCTRL/RedNet/SerialCommand.cpp
SabreSense/ACTCTRL
859cbe80b26a7c46146650a0db01ad9b0ffcf9ef
[ "MIT" ]
null
null
null
ACTCTRL/RedNet/SerialCommand.cpp
SabreSense/ACTCTRL
859cbe80b26a7c46146650a0db01ad9b0ffcf9ef
[ "MIT" ]
11
2017-12-03T23:25:05.000Z
2017-12-03T23:57:05.000Z
ACTCTRL/RedNet/SerialCommand.cpp
SabreSense/ACTCTRL
859cbe80b26a7c46146650a0db01ad9b0ffcf9ef
[ "MIT" ]
1
2017-12-08T14:18:42.000Z
2017-12-08T14:18:42.000Z
// // // #include "SerialCommand.h" SerialCommand::SerialCommand(int type, float value) { Type = type; Value = value; if (Type != NULL) { notEmpty = true; } } //SerialCommandClass SerialCommand;
11.611111
53
0.645933
09a8566cd7aedd03a946c8ae8ae2735ad5971a41
3,898
cxx
C++
src/delegate/HttpRequest.cxx
CM4all/beng-proxy
ce5a81f7969bc5cb6c5985cdc98f61ef8b5c6159
[ "BSD-2-Clause" ]
35
2017-08-16T06:52:26.000Z
2022-03-27T21:49:01.000Z
src/delegate/HttpRequest.cxx
nn6n/beng-proxy
2cf351da656de6fbace3048ee90a8a6a72f6165c
[ "BSD-2-Clause" ]
2
2017-12-22T15:34:23.000Z
2022-03-08T04:15:23.000Z
src/delegate/HttpRequest.cxx
nn6n/beng-proxy
2cf351da656de6fbace3048ee90a8a6a72f6165c
[ "BSD-2-Clause" ]
8
2017-12-22T15:11:47.000Z
2022-03-15T22:54:04.000Z
/* * Copyright 2007-2021 CM4all GmbH * All rights reserved. * * author: Max Kellermann <mk@cm4all.com> * * 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 * FOUNDATION 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 "HttpRequest.hxx" #include "Handler.hxx" #include "Glue.hxx" #include "file/Headers.hxx" #include "http/ResponseHandler.hxx" #include "strmap.hxx" #include "istream/UnusedPtr.hxx" #include "istream/FileIstream.hxx" #include "pool/pool.hxx" #include "system/Error.hxx" #include "io/UniqueFileDescriptor.hxx" #include "AllocatorPtr.hxx" #include <fcntl.h> #include <sys/stat.h> class DelegateHttpRequest final : DelegateHandler { EventLoop &event_loop; struct pool &pool; const char *const path; const char *const content_type; HttpResponseHandler &handler; public: DelegateHttpRequest(EventLoop &_event_loop, struct pool &_pool, const char *_path, const char *_content_type, HttpResponseHandler &_handler) :event_loop(_event_loop), pool(_pool), path(_path), content_type(_content_type), handler(_handler) {} void Open(StockMap &stock, const char *helper, const ChildOptions &options, CancellablePointer &cancel_ptr) { delegate_stock_open(&stock, pool, helper, options, path, *this, cancel_ptr); } private: /* virtual methods from class DelegateHandler */ void OnDelegateSuccess(UniqueFileDescriptor fd) override; void OnDelegateError(std::exception_ptr ep) override { handler.InvokeError(ep); } }; void DelegateHttpRequest::OnDelegateSuccess(UniqueFileDescriptor fd) { struct statx st; if (statx(fd.Get(), "", AT_EMPTY_PATH, STATX_TYPE|STATX_MTIME|STATX_INO|STATX_SIZE, &st) < 0) { handler.InvokeError(std::make_exception_ptr(FormatErrno("Failed to stat %s: ", path))); return; } if (!S_ISREG(st.stx_mode)) { handler.InvokeResponse(pool, HTTP_STATUS_NOT_FOUND, "Not a regular file"); return; } /* XXX handle if-modified-since, ... */ auto response_headers = static_response_headers(pool, fd, st, content_type); handler.InvokeResponse(HTTP_STATUS_OK, std::move(response_headers), istream_file_fd_new(event_loop, pool, path, std::move(fd), 0, st.stx_size)); } void delegate_stock_request(EventLoop &event_loop, StockMap &stock, struct pool &pool, const char *helper, const ChildOptions &options, const char *path, const char *content_type, HttpResponseHandler &handler, CancellablePointer &cancel_ptr) { auto get = NewFromPool<DelegateHttpRequest>(pool, event_loop, pool, path, content_type, handler); get->Open(stock, helper, options, cancel_ptr); }
31.691057
89
0.729861
09a93f4f2ec3d6e761c821efe40a8908d8d0a2a0
1,632
hpp
C++
include/foundation/gameobject.hpp
namelessvoid/qrwar
bbc4036cd3bab6b0edcaccbc95286379ef51f12b
[ "MIT" ]
3
2015-03-28T02:51:58.000Z
2018-11-08T16:49:53.000Z
include/foundation/gameobject.hpp
namelessvoid/qrwar
bbc4036cd3bab6b0edcaccbc95286379ef51f12b
[ "MIT" ]
39
2015-05-18T08:29:16.000Z
2020-07-18T21:17:44.000Z
include/foundation/gameobject.hpp
namelessvoid/qrwar
bbc4036cd3bab6b0edcaccbc95286379ef51f12b
[ "MIT" ]
null
null
null
#ifndef QRW_GAMEOBJECT_HPP #define QRW_GAMEOBJECT_HPP #include <map> #include <typeinfo> #include <typeindex> #include <cassert> #include <functional> #include <foundation/gamecomponent.hpp> #include "meta/reflectable.hpp" namespace qrw { class GameComponent; class GameObject : public Reflectable { public: GameObject(); ~GameObject() override; // Called by Scene::destroy(GameObject*). // This is useful to clean up resources which have to call other game objects in the cleanup process. // The GameObject is not destroyed immediately but is scheduled for deletion on the // next frame. virtual void onDestroy(); // Called by Scene::addtoScene(GameObject*). virtual void onAddToScene() {} // Called by Scene::update() right before the GameObject's update method would // be called for the first time. // This is useful for e.g. initializing resources which depend on other game objects and therefore // cannot be initialized in the constructor since not all scene objects my be created yet. virtual void initialize() { initialized_ = true; } bool isInitialized() { return initialized_; } void addComponent(GameComponent* component); void removeComponent(GameComponent* component); virtual void update(float elapsedTimeInSeconds) {} template<class T> T* getFirstComponent(); private: bool initialized_; std::multimap<std::type_index, GameComponent*> components_; }; template<class T> T* GameObject::getFirstComponent() { assert(components_.find(typeid(T))!=components_.end()); return dynamic_cast<T*>(components_.find(typeid(T))->second); } } // namespace qrw #endif // QRW_GAMEOBJECT_HPP
24.727273
102
0.756127
09a994f79ffde40a6455a8f05ceb83d9f5aa9c8a
421
cpp
C++
CodeFourses/A.HelpfulMaths.cpp
Rafat97/RafatProgtammingContest
f39ef6a71511abb91d42c6af469e4b24959be226
[ "Apache-2.0" ]
null
null
null
CodeFourses/A.HelpfulMaths.cpp
Rafat97/RafatProgtammingContest
f39ef6a71511abb91d42c6af469e4b24959be226
[ "Apache-2.0" ]
null
null
null
CodeFourses/A.HelpfulMaths.cpp
Rafat97/RafatProgtammingContest
f39ef6a71511abb91d42c6af469e4b24959be226
[ "Apache-2.0" ]
null
null
null
#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int main(void) { char str[500],str1[500]; int i = 0; gets(str); for(int j = 0;j<strlen(str);i++,j = j + 2 ) str1[i] = str[j]; str1[i] = '\0'; sort(str1,str1+strlen(str1)); for(int j = 0,i = 0;j<strlen(str);i++,j = j + 2 ) str[j] = str1[i]; puts(str); return 0; }
13.580645
53
0.524941
09acab92de7bc049d3b6f4ac9b00aa0877acd311
174
cpp
C++
unsafe_coerce/unsafe-coerce.cpp
mikesol/purescript-native-cpp-ffi
3805115716e7f5dfe3b046c2e2967bfbdf2ce19f
[ "MIT" ]
11
2019-07-28T14:19:04.000Z
2021-06-11T11:40:43.000Z
unsafe_coerce/unsafe-coerce.cpp
andyarvanitis/purescript-cpp-ffi
268567879eed9a1da8450f07277382a76c658a90
[ "MIT" ]
4
2018-11-16T07:59:01.000Z
2019-05-19T01:03:06.000Z
unsafe_coerce/unsafe-coerce.cpp
andyarvanitis/purescript-cpp-ffi
268567879eed9a1da8450f07277382a76c658a90
[ "MIT" ]
4
2019-12-22T05:36:30.000Z
2021-11-08T09:49:59.000Z
#include "purescript.h" // Tested with package v4.0.0 FOREIGN_BEGIN( Unsafe_Coerce ) exports["unsafeCoerce"] = [](const boxed& x) -> boxed { return x; }; FOREIGN_END
14.5
55
0.678161
09ad28d0d52ed20c83b23d6d45647ed5aafc88b4
6,374
cpp
C++
apps/Viewer/src/Preferences.cpp
asuessenbach/pipeline
2e49968cc3b9948a57f7ee6c4cc3258925c92ab2
[ "BSD-3-Clause" ]
217
2015-01-06T09:26:53.000Z
2022-03-23T14:03:18.000Z
apps/Viewer/src/Preferences.cpp
asuessenbach/pipeline
2e49968cc3b9948a57f7ee6c4cc3258925c92ab2
[ "BSD-3-Clause" ]
10
2015-01-25T12:42:05.000Z
2017-11-28T16:10:16.000Z
apps/Viewer/src/Preferences.cpp
asuessenbach/pipeline
2e49968cc3b9948a57f7ee6c4cc3258925c92ab2
[ "BSD-3-Clause" ]
44
2015-01-13T01:19:41.000Z
2022-02-21T21:35:08.000Z
// Copyright (c) 2009-2015, NVIDIA CORPORATION. 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. // * Neither the name of NVIDIA CORPORATION 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 ``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 "Preferences.h" #include "Viewer.h" #include <QMetaProperty> #include <QProcessEnvironment> #include <QSettings> #include <dp/fx/EffectLibrary.h> #include <dp/util/File.h> Preferences::Preferences( QObject * parent ) : QObject( parent ) , m_environmentEnabled( true ) , m_normalsLineLength( 1.f ) , m_transparencyMode( static_cast<unsigned int>(dp::sg::renderer::rix::gl::TransparencyMode::ORDER_INDEPENDENT_ALL) ) { load(); QProcessEnvironment pe = QProcessEnvironment::systemEnvironment(); QString home = pe.contains( "DPHOME" ) ? pe.value( "DPHOME" ) : QString( "." ); // Add the DPHOME media folders if m_searchPath is empty // which is the case on the very first program run. // Different paths can be added inside the Preferences Dialog. if ( !m_searchPaths.count() ) { m_searchPaths.append( home + QString( "/media/dpfx" ) ); m_searchPaths.append( home + QString("/media/effects") ); m_searchPaths.append( home + QString("/media/effects/xml") ); m_searchPaths.append( home + QString("/media/textures") ); m_searchPaths.append( home + QString("/media/textures/maxbench") ); } if ( m_environmentTextureName.isEmpty() ) { m_environmentTextureName = home + "/media/textures/spheremaps/spherical_checker.png"; } if ( m_materialCatalogPath.isEmpty() ) { m_materialCatalogPath = home + "/media/effects"; } if ( m_sceneSelectionPath.isEmpty() ) { m_sceneSelectionPath = home + QString( "/media/scenes" ); } if ( m_textureSelectionPath.isEmpty() ) { m_textureSelectionPath = home + QString( "/media/textures" ); } } Preferences::~Preferences() { save(); } void Preferences::load() { QSettings settings( VIEWER_APPLICATION_VENDOR, VIEWER_APPLICATION_NAME ); const QMetaObject * mo = metaObject(); for( int i = 0; i < mo->propertyCount(); i ++ ) { QMetaProperty mp = mo->property( i ); if( settings.contains( mp.name() ) ) { mp.write( this, settings.value( mp.name() ) ); } } } void Preferences::save() const { QSettings settings( VIEWER_APPLICATION_VENDOR, VIEWER_APPLICATION_NAME ); const QMetaObject * mo = metaObject(); for( int i = 0; i < mo->propertyCount(); i ++ ) { QMetaProperty mp = mo->property( i ); settings.setValue( mp.name(), mp.read(this) ); } } void Preferences::setDepthPass( bool enabled ) { if ( m_depthPassEnabled != enabled ) { m_depthPassEnabled = enabled; emit depthPassEnabled( enabled ); } } bool Preferences::getDepthPass() const { return( m_depthPassEnabled ); } void Preferences::setEnvironmentEnabled( bool enabled ) { if ( m_environmentEnabled != enabled ) { m_environmentEnabled = enabled; emit environmentEnabledChanged(); } } bool Preferences::getEnvironmentEnabled() const { return( m_environmentEnabled ); } void Preferences::setEnvironmentTextureName( const QString & name ) { if ( m_environmentTextureName != name ) { m_environmentTextureName = name; emit environmentTextureNameChanged( name ); } } QString Preferences::getEnvironmentTextureName() const { return( m_environmentTextureName ); } void Preferences::setMaterialCatalogPath( QString const& name ) { if ( m_materialCatalogPath != name ) { m_materialCatalogPath = name; emit materialCatalogPathChanged( name ); } } QString Preferences::getMaterialCatalogPath() const { return( m_materialCatalogPath ); } void Preferences::setNormalsLineLength( float len ) { if( len != m_normalsLineLength ) { m_normalsLineLength = len; emit normalsLineLengthChanged( len ); } } float Preferences::getNormalsLineLength() const { return m_normalsLineLength; } void Preferences::setSceneSelectionPath( QString const& path ) { m_sceneSelectionPath = path; } QString Preferences::getSceneSelectionPath() const { return( m_sceneSelectionPath ); } void Preferences::setSearchPaths( const QStringList & paths ) { if( paths != m_searchPaths ) { m_searchPaths = paths; emit searchPathsChanged( paths ); } } QStringList Preferences::getSearchPaths() const { return m_searchPaths; } std::vector<std::string> Preferences::getSearchPathsAsStdVector() const { std::vector< std::string > searchPaths; for( int i = 0; i < m_searchPaths.count(); i ++ ) { searchPaths.push_back( m_searchPaths.at(i).toStdString() ); dp::util::convertPath( searchPaths.back() ); } return searchPaths; } void Preferences::setTextureSelectionPath( QString const& path ) { m_textureSelectionPath = path; } QString Preferences::getTextureSelectionPath() const { return( m_textureSelectionPath ); } void Preferences::setTransparencyMode( unsigned int tm ) { m_transparencyMode = tm; } unsigned int Preferences::getTransparencyMode() const { return( m_transparencyMode ); }
27.239316
119
0.720427
09add7639eb5ac4f02e6860c199f00c18a66e76e
834
cc
C++
chrome/browser/lite_video/lite_video_navigation_metrics.cc
mghgroup/Glide-Browser
6a4c1eaa6632ec55014fee87781c6bbbb92a2af5
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
chrome/browser/lite_video/lite_video_navigation_metrics.cc
mghgroup/Glide-Browser
6a4c1eaa6632ec55014fee87781c6bbbb92a2af5
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
chrome/browser/lite_video/lite_video_navigation_metrics.cc
mghgroup/Glide-Browser
6a4c1eaa6632ec55014fee87781c6bbbb92a2af5
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
2
2021-01-05T23:43:46.000Z
2021-01-07T23:36:34.000Z
// Copyright 2020 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. #include "chrome/browser/lite_video/lite_video_navigation_metrics.h" namespace lite_video { LiteVideoNavigationMetrics::LiteVideoNavigationMetrics( int64_t nav_id, LiteVideoDecision decision, LiteVideoBlocklistReason blocklist_reason, LiteVideoThrottleResult throttle_result) : nav_id_(nav_id), decision_(decision), blocklist_reason_(blocklist_reason), throttle_result_(throttle_result) {} LiteVideoNavigationMetrics::~LiteVideoNavigationMetrics() = default; void LiteVideoNavigationMetrics::SetThrottleResult( LiteVideoThrottleResult throttle_result) { throttle_result_ = throttle_result; } } // namespace lite_video
30.888889
73
0.791367
09b0ad0b6b27c21c962625822124d58e14ea0684
1,701
cpp
C++
src/main/zsystem/Backtrace.cpp
SLukasDE/zsystem
d75d361e5e0226416d1f143051195a30530bc128
[ "MIT" ]
null
null
null
src/main/zsystem/Backtrace.cpp
SLukasDE/zsystem
d75d361e5e0226416d1f143051195a30530bc128
[ "MIT" ]
null
null
null
src/main/zsystem/Backtrace.cpp
SLukasDE/zsystem
d75d361e5e0226416d1f143051195a30530bc128
[ "MIT" ]
null
null
null
/* MIT License Copyright (c) 2019-2021 Sven Lukas 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 <zsystem/Backtrace.h> #include <execinfo.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> namespace zsystem { Backtrace::Backtrace() { constexpr int SIZE = 100; void *buffer[SIZE]; int stackSize; char **stack; stackSize = backtrace(buffer, SIZE); stack = backtrace_symbols(buffer, stackSize); if (stack != nullptr) { int skipLines = 1; for(int i = skipLines; i < stackSize; i++) { elements.push_back(stack[i]); } free(stack); } } const std::vector<std::string>& Backtrace::getElements() const { return elements; } } /* namespace zsystem */
31.5
78
0.741329
09b188ab2977012c024f7d11d6a5061d0ddb63f5
3,873
cpp
C++
src/shader_gl.cpp
google/fplbase
57c83296659469cf51db142baec3039edd347476
[ "Apache-2.0" ]
233
2015-11-18T23:24:26.000Z
2022-01-20T20:44:07.000Z
src/shader_gl.cpp
google/fplbase
57c83296659469cf51db142baec3039edd347476
[ "Apache-2.0" ]
10
2017-04-10T00:57:19.000Z
2022-01-20T20:46:17.000Z
src/shader_gl.cpp
google/fplbase
57c83296659469cf51db142baec3039edd347476
[ "Apache-2.0" ]
56
2016-01-04T09:55:19.000Z
2022-01-20T20:44:14.000Z
// Copyright 2014 Google Inc. 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. // 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 "precompiled.h" #include "fplbase/internal/type_conversions_gl.h" #include "fplbase/preprocessor.h" #include "fplbase/renderer.h" #include "fplbase/shader.h" #include "shader_generated.h" #ifdef _WIN32 #define snprintf(buffer, count, format, ...) \ _snprintf_s(buffer, count, count, format, __VA_ARGS__) #endif // _WIN32 namespace fplbase { //static ShaderImpl *Shader::CreateShaderImpl() { return nullptr; } // static void Shader::DestroyShaderImpl(ShaderImpl *impl) { (void)impl; } void Shader::Clear() { if (ValidShaderHandle(vs_)) { GL_CALL(glDeleteShader(GlShaderHandle(vs_))); vs_ = InvalidShaderHandle(); } if (ValidShaderHandle(ps_)) { GL_CALL(glDeleteShader(GlShaderHandle(ps_))); ps_ = InvalidShaderHandle(); } if (ValidShaderHandle(program_)) { GL_CALL(glDeleteProgram(GlShaderHandle(program_))); program_ = InvalidShaderHandle(); } if (data_ != nullptr) { delete reinterpret_cast<const ShaderSourcePair *>(data_); data_ = nullptr; } } UniformHandle Shader::FindUniform(const char *uniform_name) { auto program = GlShaderHandle(program_); GL_CALL(glUseProgram(program)); return UniformHandleFromGl(glGetUniformLocation(program, uniform_name)); } void Shader::SetUniform(UniformHandle uniform_loc, const float *value, size_t num_components) { // clang-format off auto uniform_loc_gl = GlUniformHandle(uniform_loc); switch (num_components) { case 1: GL_CALL(glUniform1f(uniform_loc_gl, *value)); break; case 2: GL_CALL(glUniform2fv(uniform_loc_gl, 1, value)); break; case 3: GL_CALL(glUniform3fv(uniform_loc_gl, 1, value)); break; case 4: GL_CALL(glUniform4fv(uniform_loc_gl, 1, value)); break; case 16: GL_CALL(glUniformMatrix4fv(uniform_loc_gl, 1, false, value)); break; default: assert(0); break; } // clang-format on } void Shader::InitializeUniforms() { auto program = GlShaderHandle(program_); // Look up variables that are standard, but still optionally present in a // shader. uniform_model_view_projection_ = UniformHandleFromGl( glGetUniformLocation(program, "model_view_projection")); uniform_model_ = UniformHandleFromGl(glGetUniformLocation(program, "model")); uniform_color_ = UniformHandleFromGl(glGetUniformLocation(program, "color")); uniform_light_pos_ = UniformHandleFromGl(glGetUniformLocation(program, "light_pos")); uniform_camera_pos_ = UniformHandleFromGl(glGetUniformLocation(program, "camera_pos")); uniform_time_ = UniformHandleFromGl(glGetUniformLocation(program, "time")); // An array of vec4's. Three vec4's compose one affine transform. // The i'th affine transform is the translation, rotation, and // orientation of the i'th bone. uniform_bone_transforms_ = UniformHandleFromGl(glGetUniformLocation(program, "bone_transforms")); // Set up the uniforms the shader uses for texture access. char texture_unit_name[] = "texture_unit_#####"; for (int i = 0; i < kMaxTexturesPerShader; i++) { snprintf(texture_unit_name, sizeof(texture_unit_name), "texture_unit_%d", i); auto loc = glGetUniformLocation(program, texture_unit_name); if (loc >= 0) GL_CALL(glUniform1i(loc, i)); } } } // namespace fplbase
34.891892
81
0.731991
09b1d686c973d57dbff589cd1f60935d614eb813
631
cpp
C++
platform/android/CCStorePaymentTransactionWrapper.cpp
kpkhxlgy0/cocos2dh-js
d84f76b505ad0f2fdb799721352a4f510795a096
[ "MIT" ]
2
2017-11-17T02:54:32.000Z
2018-11-26T08:17:23.000Z
platform/android/CCStorePaymentTransactionWrapper.cpp
kpkhxlgy0/cocos2dh-js
d84f76b505ad0f2fdb799721352a4f510795a096
[ "MIT" ]
null
null
null
platform/android/CCStorePaymentTransactionWrapper.cpp
kpkhxlgy0/cocos2dh-js
d84f76b505ad0f2fdb799721352a4f510795a096
[ "MIT" ]
null
null
null
#include "../../quick/store/CCStorePaymentTransactionWrapper.h" // #import <StoreKit/StoreKit.h> NS_CC_H_BEGIN CCStorePaymentTransactionWrapper* CCStorePaymentTransactionWrapper::createWithTransaction(void* transactionObj) { // CCStorePaymentTransactionWrapper* transaction = new CCStorePaymentTransactionWrapper(); // transaction->m_transactionObj = transactionObj; // [(SKPaymentTransaction *)transactionObj retain]; // return transaction; return NULL; } CCStorePaymentTransactionWrapper::~CCStorePaymentTransactionWrapper(void) { // [(SKPaymentTransaction *)m_transactionObj release]; } NS_CC_H_END
28.681818
111
0.787639
09b245f9822725804c1bba279af9c48adcf4197a
7,300
cpp
C++
src/software/simulation/physics/simulation_contact_listener.cpp
EvanMorcom/Software
586fb3cf8dc2d93de194d9815af5de63caa7e318
[ "MIT" ]
null
null
null
src/software/simulation/physics/simulation_contact_listener.cpp
EvanMorcom/Software
586fb3cf8dc2d93de194d9815af5de63caa7e318
[ "MIT" ]
null
null
null
src/software/simulation/physics/simulation_contact_listener.cpp
EvanMorcom/Software
586fb3cf8dc2d93de194d9815af5de63caa7e318
[ "MIT" ]
null
null
null
#include "software/simulation/physics/simulation_contact_listener.h" void SimulationContactListener::BeginContact(b2Contact *contact) { if (contact->IsTouching()) { auto fixture_a = contact->GetFixtureA(); auto fixture_b = contact->GetFixtureB(); PhysicsObjectUserData *user_data_a = static_cast<PhysicsObjectUserData *>(fixture_a->GetUserData()); PhysicsObjectUserData *user_data_b = static_cast<PhysicsObjectUserData *>(fixture_b->GetUserData()); if (auto ball_chicker_pair = isBallChickerContact(user_data_a, user_data_b)) { PhysicsBall *ball = ball_chicker_pair->first; PhysicsRobot *robot = ball_chicker_pair->second; for (auto contact_callback : robot->getChickerBallStartContactCallbacks()) { contact_callback(robot, ball); } } if (auto ball_dribbler_pair = isBallDribblerContact(user_data_a, user_data_b)) { PhysicsBall *ball = ball_dribbler_pair->first; PhysicsRobot *robot = ball_dribbler_pair->second; for (auto contact_callback : robot->getDribblerBallStartContactCallbacks()) { contact_callback(robot, ball); } } } } void SimulationContactListener::PreSolve(b2Contact *contact, const b2Manifold *oldManifold) { if (contact->IsTouching()) { auto fixture_a = contact->GetFixtureA(); auto fixture_b = contact->GetFixtureB(); PhysicsObjectUserData *user_data_a = static_cast<PhysicsObjectUserData *>(fixture_a->GetUserData()); PhysicsObjectUserData *user_data_b = static_cast<PhysicsObjectUserData *>(fixture_b->GetUserData()); if (auto ball_dribbler_pair = isBallDribblerContact(user_data_a, user_data_b)) { // We always disable contacts between the ball and the dribbler so that the // ball can pass through the dribbler area. This is needed so that the ball // can exist inside the dribbling "zone", as well as pass through the dribbler // to make contact with the robot chicker contact->SetEnabled(false); PhysicsBall *ball = ball_dribbler_pair->first; PhysicsRobot *robot = ball_dribbler_pair->second; for (auto contact_callback : robot->getDribblerBallContactCallbacks()) { contact_callback(robot, ball); } } if (auto ball_chicker_pair = isBallChickerContact(user_data_a, user_data_b)) { // Ensure that the ball is perfectly damped if it collides with the chicker. // This helps the robot keep the ball while dribbling. contact->SetRestitution(0.0); } if (auto ball = isBallContact(user_data_a, user_data_b)) { // Disable collisions with the ball if it is in flight. This is how we // simulate the ball being chipped any flying over other objects // in a 2D simulation if (ball->isInFlight()) { contact->SetEnabled(false); } } } } void SimulationContactListener::EndContact(b2Contact *contact) { auto fixture_a = contact->GetFixtureA(); auto fixture_b = contact->GetFixtureB(); PhysicsObjectUserData *user_data_a = static_cast<PhysicsObjectUserData *>(fixture_a->GetUserData()); PhysicsObjectUserData *user_data_b = static_cast<PhysicsObjectUserData *>(fixture_b->GetUserData()); if (auto ball_dribbler_pair = isBallDribblerContact(user_data_a, user_data_b)) { PhysicsBall *ball = ball_dribbler_pair->first; PhysicsRobot *robot = ball_dribbler_pair->second; for (auto contact_callback : robot->getDribblerBallEndContactCallbacks()) { contact_callback(robot, ball); } } } std::optional<std::pair<PhysicsBall *, PhysicsRobot *>> SimulationContactListener::isBallChickerContact(PhysicsObjectUserData *user_data_a, PhysicsObjectUserData *user_data_b) { if (!user_data_a || !user_data_b) { return std::nullopt; } // NOTE: Box2D intelligently reports only one contact when 2 objects collide // (ie. Does not report a contact for ObjectA touching ObjectB, and another // contact for ObjectB touching ObjectA), which is why we do not need to worry // about only detecting one contact per pair of colliding objects. PhysicsBall *ball = nullptr; if (user_data_a->type == PhysicsObjectType::BALL) { ball = static_cast<PhysicsBall *>(user_data_a->physics_object); } if (user_data_b->type == PhysicsObjectType::BALL) { ball = static_cast<PhysicsBall *>(user_data_b->physics_object); } PhysicsRobot *robot = nullptr; if (user_data_a->type == PhysicsObjectType::ROBOT_CHICKER) { robot = static_cast<PhysicsRobot *>(user_data_a->physics_object); } if (user_data_b->type == PhysicsObjectType::ROBOT_CHICKER) { robot = static_cast<PhysicsRobot *>(user_data_b->physics_object); } if (ball && robot) { return std::make_pair(ball, robot); } return std::nullopt; } std::optional<std::pair<PhysicsBall *, PhysicsRobot *>> SimulationContactListener::isBallDribblerContact(PhysicsObjectUserData *user_data_a, PhysicsObjectUserData *user_data_b) { if (!user_data_a || !user_data_b) { return std::nullopt; } // NOTE: Box2D intelligently reports only one contact when 2 objects collide // (ie. Does not report a contact for ObjectA touching ObjectB, and another // contact for ObjectB touching ObjectA), which is why we do not need to worry // about only detecting one contact per pair of colliding objects. PhysicsBall *ball = nullptr; if (user_data_a->type == PhysicsObjectType::BALL) { ball = static_cast<PhysicsBall *>(user_data_a->physics_object); } if (user_data_b->type == PhysicsObjectType::BALL) { ball = static_cast<PhysicsBall *>(user_data_b->physics_object); } PhysicsRobot *robot = nullptr; if (user_data_a->type == PhysicsObjectType::ROBOT_DRIBBLER) { robot = static_cast<PhysicsRobot *>(user_data_a->physics_object); } if (user_data_b->type == PhysicsObjectType::ROBOT_DRIBBLER) { robot = static_cast<PhysicsRobot *>(user_data_b->physics_object); } if (ball && robot) { return std::make_pair(ball, robot); } return std::nullopt; } PhysicsBall *SimulationContactListener::isBallContact(PhysicsObjectUserData *user_data_a, PhysicsObjectUserData *user_data_b) { PhysicsBall *ball = nullptr; if (user_data_a && user_data_a->type == PhysicsObjectType::BALL) { ball = static_cast<PhysicsBall *>(user_data_a->physics_object); } if (user_data_b && user_data_b->type == PhysicsObjectType::BALL) { ball = static_cast<PhysicsBall *>(user_data_b->physics_object); } return ball; }
36.5
90
0.64137
09b4c813e5c3ad608ea37ed0d4b5b8c93ea9edb8
582
cpp
C++
6 - User defined functions/6.2 - Paramaters/activity/multiple_parameters.cpp
aTonyXiao/Zybook
36cd05a436c6ca007cdd14638cf5ee2a7724b889
[ "MIT" ]
11
2017-11-17T07:31:44.000Z
2020-12-05T14:46:56.000Z
6 - User defined functions/6.2 - Paramaters/activity/multiple_parameters.cpp
aTonyXiao/Zybook
36cd05a436c6ca007cdd14638cf5ee2a7724b889
[ "MIT" ]
null
null
null
6 - User defined functions/6.2 - Paramaters/activity/multiple_parameters.cpp
aTonyXiao/Zybook
36cd05a436c6ca007cdd14638cf5ee2a7724b889
[ "MIT" ]
1
2019-10-15T20:58:51.000Z
2019-10-15T20:58:51.000Z
#include <iostream> /* Modify PrintFace() to have three parameters: char eyeChar, char noseChar, char mouthChar. Call the function with arguments 'o', '*', and '#', which should draw this face: */ using namespace std; void PrintFace(char eye, char nose, char mouth) { // FIXME: Support 3 parameters cout << " " << eye << " " << eye << endl; // Eyes cout << " " << nose << endl; // Nose cout << " " << mouth << mouth << mouth << endl; // Mouth return; } int main() { PrintFace('*','o','_'); // FIXME: Pass 3 arguments return 0; }
32.333333
171
0.568729
09b5be6958269c0c89eb66cd5aa7d56479d2f59a
15,550
cpp
C++
CONTRIB/LLVM/_Demo/Lib_GZ/Gpu/ShaderModel/GzModel/GzShModel.cpp
Cwc-Test/CpcdosOS2.1
d52c170be7f11cc50de38ef536d4355743d21706
[ "Apache-2.0" ]
1
2021-05-05T20:42:24.000Z
2021-05-05T20:42:24.000Z
CONTRIB/LLVM/_Demo/Lib_GZ/Gpu/ShaderModel/GzModel/GzShModel.cpp
Cwc-Test/CpcdosOS2.1
d52c170be7f11cc50de38ef536d4355743d21706
[ "Apache-2.0" ]
null
null
null
CONTRIB/LLVM/_Demo/Lib_GZ/Gpu/ShaderModel/GzModel/GzShModel.cpp
Cwc-Test/CpcdosOS2.1
d52c170be7f11cc50de38ef536d4355743d21706
[ "Apache-2.0" ]
null
null
null
//This file is part of "GZE - GroundZero Engine" //The permisive licence allow to use GZE for free or commercial project (Apache License, Version 2.0). //For conditions of distribution and use, see copyright notice in Licence.txt, this license must be included with any distribution of the code. //Though not required by the license agreement, please consider the following will be greatly appreciated: //- We would like to hear about projects where GZE is used. //- Include an attribution statement somewhere in your project. //- If you want to see GZE evolve please help us with a donation. #include "Lib_GZ/Gpu/ShaderModel/GzModel/GzShModel.h" #include "Lib_GZ/Gpu/ShaderBase/FragmentShader.h" #include "Lib_GZ/Gpu/ShaderBase/VertexShader.h" #include "Lib_GZ/Gpu/ShaderBase/ProgramShader.h" #include "Lib_GZ/Gpu/Base/Attribute.h" #include "Lib_GZ/Gpu/Base/Uniform.h" #include "Lib_GZ/Gpu/Base/UnVec2.h" #include "Lib_GZ/Gpu/ShaderBase/Vbo.h" #include "Lib_GZ/Gpu/GpuObj/GpuBatch.h" #include "Lib_GZ/Base/Perspective.h" #include "Lib_GZ/Base/TestPod.h" #include "Lib_GZ/Base/TestPod2.h" #include "Lib_GZ/Sys/Debug.h" #include "Lib_GZ/Class.h" #include "Lib_GZ/ThreadMsg.h" //Sub Class include #include "Lib_GZ/Base/Vec2.h" namespace Lib_GZ{namespace Gpu{namespace ShaderModel{namespace GzModel{namespace GzShModel{ ////// Current Lib Access //// //// Current Static Access //// #undef _ #define _ GzShModel void Ini_Class(){ } #ifdef GZ_tHaveCallStack gzFuncStack zFuncName[] = {{0,"GzShModel"},{0,"fLoad"},{0,"fPod"},{0,"fDraw"}}; #endif /////////////////////////////// } GZ_mCppClass(GzShModel) cGzShModel::cGzShModel(Lib_GZ::cBase* _parent) : Lib_GZ::cClass(_parent){ } void cGzShModel::Ini_cGzShModel(){ gz_(0) Lib_GZ::Sys::Debug::Get(thread)->fTrace1(gzStrL("--- GzShModel Created!! ---")); fLoad(); } gzBool cGzShModel::fLoad(){ gz_(1) oVertex = gzSCast<Lib_GZ::Gpu::ShaderBase::cVertexShader>((Lib_GZ::Gpu::ShaderBase::VertexShader::Get(thread)->New(this))); oFragement = gzSCast<Lib_GZ::Gpu::ShaderBase::cFragmentShader>((Lib_GZ::Gpu::ShaderBase::FragmentShader::Get(thread)->New(this))); oProgram = gzSCast<Lib_GZ::Gpu::ShaderBase::cProgramShader>((Lib_GZ::Gpu::ShaderBase::ProgramShader::Get(thread)->New(this))); // --- Tag Glsl oVertex->fAddLine(gzStrL("in vec4 atObjPos;")); oVertex->fAddLine(gzStrL("xflat out vec4 vColor;")); oVertex->fAddLine(gzStrL("out vec2 ioTexture;")); oVertex->fAddLine(gzStrL("void main(){")); oVertex->fAddLine(gzStrL("if (nVertexID < 2){")); oVertex->fAddLine(gzStrL("if(nVertexID == 0){")); oVertex->fAddLine(gzStrL("gl_Position.x = -1.0;")); oVertex->fAddLine(gzStrL("gl_Position.y = -1.0;")); oVertex->fAddLine(gzStrL("}else{")); oVertex->fAddLine(gzStrL("gl_Position.x = 1.0;")); oVertex->fAddLine(gzStrL("gl_Position.y = -1.0;")); oVertex->fAddLine(gzStrL("}")); oVertex->fAddLine(gzStrL("}else{")); oVertex->fAddLine(gzStrL("if(nVertexID == 2){")); oVertex->fAddLine(gzStrL("gl_Position.x = 1.0;")); oVertex->fAddLine(gzStrL("gl_Position.y = 1.0;")); oVertex->fAddLine(gzStrL("}else{")); oVertex->fAddLine(gzStrL("gl_Position.x = -1.0;")); oVertex->fAddLine(gzStrL("gl_Position.y = 1.0;")); oVertex->fAddLine(gzStrL("}")); oVertex->fAddLine(gzStrL("}")); oVertex->fAddLine(gzStrL("gl_Position.z = 0.5;")); oVertex->fAddLine(gzStrL("gl_Position.w = 1.0;")); oVertex->fAddLine(gzStrL("//gl_Position.xy = atObjPos.xy; //Temp")); oVertex->fAddLine(gzStrL("vColor = atObjPos;")); oVertex->fAddLine(gzStrL("//vColor = vec4(atObjPos.y, 0.0,1.0,1.0 );")); oVertex->fAddLine(gzStrL("// vColor = vec4(1.0,0.0,0.0,1.0);")); oVertex->fAddLine(gzStrL("}")); // --- End Tag Glsl oVertex->fLoad(); if (oVertex->fCompile() == false){ Lib_GZ::Sys::Debug::Get(thread)->fError(gzStrL("Vertex Shader: ") + oVertex->fGetErrorLine()); Lib_GZ::Sys::Debug::Get(thread)->fTrace1(gzStrL(" -->") + oVertex->fGetLog()); }else{ Lib_GZ::Sys::Debug::Get(thread)->fPass(gzStrL("Vertex Success")); } // --- Tag Glsl oFragement->fAddLine(gzStrL("uniform vec2 vTexDim;")); oFragement->fAddLine(gzStrL("uniform vec2 vWinDim;")); oFragement->fAddLine(gzStrL("uniform vec2 vMouse;")); oFragement->fAddLine(gzStrL("xflat in vec4 vColor;")); oFragement->fAddLine(gzStrL("xflat in vec2 ioTexture;")); oFragement->fAddLine(gzStrL("vec3 cam_pos = vec3(0,0,0);")); oFragement->fAddLine(gzStrL("float PI=3.14159265;")); oFragement->fAddLine(gzStrL("///////////////////////// OBJ /////////////////")); oFragement->fAddLine(gzStrL("//Sol")); oFragement->fAddLine(gzStrL("vec2 obj_floor( vec3 p){")); oFragement->fAddLine(gzStrL("return vec2(p.y+10.0,0);")); oFragement->fAddLine(gzStrL("}")); oFragement->fAddLine(gzStrL("//Sphere")); oFragement->fAddLine(gzStrL("vec2 obj_sphere( vec3 p){")); oFragement->fAddLine(gzStrL("float d = length(p)-1.9;")); oFragement->fAddLine(gzStrL("return vec2(d,1);")); oFragement->fAddLine(gzStrL("}")); oFragement->fAddLine(gzStrL("//Tore")); oFragement->fAddLine(gzStrL("vec2 obj_torus( vec3 p){")); oFragement->fAddLine(gzStrL("vec2 r = vec2(1.4,1.2);")); oFragement->fAddLine(gzStrL("vec2 q = vec2(length(p.xz)-r.x,p.y);")); oFragement->fAddLine(gzStrL("float d = length(q)-r.y;")); oFragement->fAddLine(gzStrL("return vec2(d,1);")); oFragement->fAddLine(gzStrL("}")); oFragement->fAddLine(gzStrL("//Box")); oFragement->fAddLine(gzStrL("vec2 obj_round_box(vec3 p){")); oFragement->fAddLine(gzStrL("float d = length(max(abs(p)-vec3(0.3,0.15,1.0),0.0))-0.2;")); oFragement->fAddLine(gzStrL("return vec2(d,1);")); oFragement->fAddLine(gzStrL("}")); oFragement->fAddLine(gzStrL("/*")); oFragement->fAddLine(gzStrL("vec2 obj_round_box(vec3 p){")); oFragement->fAddLine(gzStrL("float d= length(max(abs(p)-vec3(1.0,0.5,2.0),0.0))-0.08;")); oFragement->fAddLine(gzStrL("// float d = length(max(abs(p)-vec3(2.0,0.5,2.0),0.0))-0.2;")); oFragement->fAddLine(gzStrL("return vec2(d,1);")); oFragement->fAddLine(gzStrL("}*/")); oFragement->fAddLine(gzStrL("///////////////////////////////////////////////////////")); oFragement->fAddLine(gzStrL("/// Operator ////////")); oFragement->fAddLine(gzStrL("vec2 op_union(vec2 a, vec2 b){")); oFragement->fAddLine(gzStrL("float d = min(a.x, b.x);")); oFragement->fAddLine(gzStrL("return vec2(d,1);")); oFragement->fAddLine(gzStrL("}")); oFragement->fAddLine(gzStrL("vec2 op_rep(vec3 p, vec3 c){")); oFragement->fAddLine(gzStrL("vec3 q = mod(p,c)-0.5*c;")); oFragement->fAddLine(gzStrL("return obj_round_box(q);")); oFragement->fAddLine(gzStrL("}")); oFragement->fAddLine(gzStrL("vec2 op_sub(vec2 a, vec2 b) {")); oFragement->fAddLine(gzStrL("float d = max(a.x, -b.x);")); oFragement->fAddLine(gzStrL("return vec2(d,1);")); oFragement->fAddLine(gzStrL("}")); oFragement->fAddLine(gzStrL("vec2 op_blend(vec3 p, vec2 a, vec2 b){")); oFragement->fAddLine(gzStrL("float s = smoothstep(length(p), 0.0, 1.0);")); oFragement->fAddLine(gzStrL("float d = mix(a.x, b.x, s);")); oFragement->fAddLine(gzStrL("return vec2(d,1);")); oFragement->fAddLine(gzStrL("}")); oFragement->fAddLine(gzStrL("/////////// Union ////////////////////")); oFragement->fAddLine(gzStrL("vec2 obj_union( vec2 obj0, vec2 obj1){")); oFragement->fAddLine(gzStrL("if (obj0.x < obj1.x){")); oFragement->fAddLine(gzStrL("return obj0;")); oFragement->fAddLine(gzStrL("}else{")); oFragement->fAddLine(gzStrL("return obj1;")); oFragement->fAddLine(gzStrL("}")); oFragement->fAddLine(gzStrL("}")); oFragement->fAddLine(gzStrL("// Union d'objets")); oFragement->fAddLine(gzStrL("vec2 distance_to_obj( vec3 p){")); oFragement->fAddLine(gzStrL("//return obj_floor(p);")); oFragement->fAddLine(gzStrL("//return obj_union(obj_floor(p), obj_round_box(p));")); oFragement->fAddLine(gzStrL("//return obj_union(obj_floor(p), op_union(obj_round_box(p), obj_sphere(p)));")); oFragement->fAddLine(gzStrL("//return obj_union(obj_floor(p), op_sub(obj_round_box(p), obj_sphere(p)));")); oFragement->fAddLine(gzStrL("//return obj_union(obj_floor(p), op_blend(p, obj_round_box(p), obj_torus(p)) ) ;")); oFragement->fAddLine(gzStrL("//return obj_union(obj_floor(p), op_blend(p, obj_round_box(p), obj_torus(p)) ) ;")); oFragement->fAddLine(gzStrL("return obj_union(obj_floor(p), op_rep(p , vec3(3.0, 2.0, 6.0)));")); oFragement->fAddLine(gzStrL("}")); oFragement->fAddLine(gzStrL("//// Couleur du sol (damier)")); oFragement->fAddLine(gzStrL("vec3 floor_color( vec3 p){")); oFragement->fAddLine(gzStrL("vec3 c = vec3(8.0, 5.0, 9.0);")); oFragement->fAddLine(gzStrL("vec3 q = mod(p,c) - 0.5 * c;")); oFragement->fAddLine(gzStrL("return q ;")); oFragement->fAddLine(gzStrL("// return vec3( smoothstep(length(p), fract(p.x*0.2), fract(p.y*0.2)),1,1);")); oFragement->fAddLine(gzStrL("/*")); oFragement->fAddLine(gzStrL("if (fract(p.x*0.2)>0.2){")); oFragement->fAddLine(gzStrL("if (fract(p.z*0.2)>0.2){")); oFragement->fAddLine(gzStrL("return vec3(0,0.1,0.2);")); oFragement->fAddLine(gzStrL("}else{")); oFragement->fAddLine(gzStrL("return vec3(1,1,1);")); oFragement->fAddLine(gzStrL("}")); oFragement->fAddLine(gzStrL("}else{")); oFragement->fAddLine(gzStrL("if (fract(p.z*.2)>.2){")); oFragement->fAddLine(gzStrL("return vec3(1,1,1);")); oFragement->fAddLine(gzStrL("}else{")); oFragement->fAddLine(gzStrL("return vec3(0.3,0,0);")); oFragement->fAddLine(gzStrL("}")); oFragement->fAddLine(gzStrL("}*/")); oFragement->fAddLine(gzStrL("}")); oFragement->fAddLine(gzStrL("//// Couleur de la primitive")); oFragement->fAddLine(gzStrL("vec3 prim_c( vec3 p){")); oFragement->fAddLine(gzStrL("return vec3(0.9137,0.83,0.70);")); oFragement->fAddLine(gzStrL("}")); oFragement->fAddLine(gzStrL("void main(){")); oFragement->fAddLine(gzStrL("vec2 q = ( gl_FragCoord.xy / vec2(800.0,800.0) );")); oFragement->fAddLine(gzStrL("//FragColor = vec4(0,q.y,0,1.0);")); oFragement->fAddLine(gzStrL("//return;")); oFragement->fAddLine(gzStrL("float _nMove = 2.5 * vMouse.x;")); oFragement->fAddLine(gzStrL("//vec2 q = vec2(1.0, 0.5);")); oFragement->fAddLine(gzStrL("vec2 vPos = -1.0 + 2.0 * q;")); oFragement->fAddLine(gzStrL("// Inclinaison de la caméra.")); oFragement->fAddLine(gzStrL("vec3 vuv = vec3(0,1.5,0.0);")); oFragement->fAddLine(gzStrL("// Direction de la caméra.")); oFragement->fAddLine(gzStrL("vec3 vrp = vec3(0.5,0.5,1.0);")); oFragement->fAddLine(gzStrL("//vec3 vrp = vec3(0.0, _nMove, 0.0) * 6.0;")); oFragement->fAddLine(gzStrL("// Position de la caméra.")); oFragement->fAddLine(gzStrL("vec2 mouse = vec2(0.5, 0.5);")); oFragement->fAddLine(gzStrL("float mx = mouse.x* PI * 2.0;")); oFragement->fAddLine(gzStrL("float my = mouse.y* PI / 2.01;")); oFragement->fAddLine(gzStrL("//vec3 prp = vec3( cos(my)*cos(mx), sin(my), cos(my)*sin(mx) ) * 6.0;")); oFragement->fAddLine(gzStrL("vec3 prp = vec3( _nMove * 1.5 - 0.2 , _nMove - 0.3- 1.0, -0.6 ) * 6.0 ;")); oFragement->fAddLine(gzStrL("//vec3 prp = cam_pos;")); oFragement->fAddLine(gzStrL("vec3 vpn = normalize(vrp-prp);")); oFragement->fAddLine(gzStrL("vec3 u = normalize(cross(vuv , vpn));")); oFragement->fAddLine(gzStrL("vec3 v = cross(vpn , u);")); oFragement->fAddLine(gzStrL("vec3 vcv = (prp + vpn);")); oFragement->fAddLine(gzStrL("//vec3 scrCoord=vcv+vPos.x*u*resolution.x/resolution.y+vPos.y*v;")); oFragement->fAddLine(gzStrL("vec3 scrCoord = vcv + vPos.x * u * 0.8 + vPos.y * v * 0.8;")); oFragement->fAddLine(gzStrL("vec3 scp = normalize(scrCoord - prp);")); oFragement->fAddLine(gzStrL("// Raymarching.")); oFragement->fAddLine(gzStrL("const vec3 e = vec3(0.02, 0, 0);")); oFragement->fAddLine(gzStrL("const float maxd = 100.0;")); oFragement->fAddLine(gzStrL("vec2 d = vec2(0.02,0.0);")); oFragement->fAddLine(gzStrL("vec3 c,p,N;")); oFragement->fAddLine(gzStrL("float f = 1.0;")); oFragement->fAddLine(gzStrL("for(int i = 0; i< 260; i++){")); oFragement->fAddLine(gzStrL("if ((abs(d.x) < .001) || (f > maxd)) {")); oFragement->fAddLine(gzStrL("break;")); oFragement->fAddLine(gzStrL("}")); oFragement->fAddLine(gzStrL("f += d.x;")); oFragement->fAddLine(gzStrL("p = prp + scp * f;")); oFragement->fAddLine(gzStrL("d = distance_to_obj(p);")); oFragement->fAddLine(gzStrL("}")); oFragement->fAddLine(gzStrL("if (f < maxd){")); oFragement->fAddLine(gzStrL("if (d.y==0.0){")); oFragement->fAddLine(gzStrL("c=floor_color(p);")); oFragement->fAddLine(gzStrL("}else{")); oFragement->fAddLine(gzStrL("c=prim_c(p);")); oFragement->fAddLine(gzStrL("}")); oFragement->fAddLine(gzStrL("vec3 n = vec3(d.x-distance_to_obj(p-e.xyy).x, d.x-distance_to_obj(p-e.yxy).x, d.x-distance_to_obj(p-e.yyx).x);")); oFragement->fAddLine(gzStrL("N = normalize(n);")); oFragement->fAddLine(gzStrL("float b=dot(N,normalize(prp-p));")); oFragement->fAddLine(gzStrL("// Simple éclairage Phong, LightPosition = CameraPosition")); oFragement->fAddLine(gzStrL("FragColor = vec4((b*c+pow(b,16.0))*(1.0-f*.01),1.0);")); oFragement->fAddLine(gzStrL("}else{")); oFragement->fAddLine(gzStrL("FragColor = vec4(0.0 + vColor.x,0,0,1.0);")); oFragement->fAddLine(gzStrL("//FragColor = vec4(0 ,0,0,1.0);")); oFragement->fAddLine(gzStrL("}")); oFragement->fAddLine(gzStrL("}")); // --- End Tag Glsl oFragement->fLoad(); if (oFragement->fCompile() == false){ Lib_GZ::Sys::Debug::Get(thread)->fError(gzStrL("Fragment Shader: ") + oFragement->fGetErrorLine()); Lib_GZ::Sys::Debug::Get(thread)->fTrace1(gzStrL(" -->") + oFragement->fGetLog()); }else{ Lib_GZ::Sys::Debug::Get(thread)->fPass(gzStrL("Fragement Shader Success")); } oProgram->fAttachShader((Lib_GZ::Gpu::ShaderBase::cShaderBase*)(oVertex.get())); oProgram->fAttachShader((Lib_GZ::Gpu::ShaderBase::cShaderBase*)(oFragement.get())); if (oProgram->fLink() != 0){ Lib_GZ::Sys::Debug::Get(thread)->fPass(gzStrL("Link Success")); } oProgram->fUse(); oProgram->fSetDefaultAttribDivisor(1); oVboBatch = gzSCast<Lib_GZ::Gpu::ShaderBase::cVbo>(oProgram->fAddVbo()); oGpuBatch = gzSCast<Lib_GZ::Gpu::GpuObj::cGpuBatch>((Lib_GZ::Gpu::GpuObj::GpuBatch::Get(thread)->New(this))); gzSp<Lib_GZ::Gpu::Base::cAttribute> _oAtObjPos = gzSCast<Lib_GZ::Gpu::Base::cAttribute>(oProgram->fAddAttribute(gzStrL("atObjPos"))); gzSp<Lib_GZ::Gpu::Base::cAttribute> _oAtVertexID = gzSCast<Lib_GZ::Gpu::Base::cAttribute>(oProgram->fAddAttribute(gzStrL("atVertexID"))); oUvMouse = gzSCast<Lib_GZ::Gpu::Base::cUnVec2>((Lib_GZ::Gpu::Base::UnVec2::Get(thread)->New(this, (Lib_GZ::Gpu::ShaderBase::cProgramShader*)(oProgram.get()), gzStrL("vMouse")))); gzSp<Lib_GZ::Base::cPerspective> _oPersv = gzSCast<Lib_GZ::Base::cPerspective>((Lib_GZ::Base::Perspective::Get(thread)->New(this))); gzPod<Lib_GZ::Base::cTestPod> _oPod = (Lib_GZ::Base::TestPod::Get(thread)->New(this, gzFloat(5), gzFloat(5))); gzPod<Lib_GZ::Base::cTestPod2> _oPod2 = (Lib_GZ::Base::TestPod2::Get(thread)->New(this, gzFloat(1), 2.5, gzFloat(3), gzFloat(4))); fPod((Lib_GZ::Base::cTestPod2*)(_oPod2.get())); return false; } void cGzShModel::fPod(Lib_GZ::Base::cTestPod2* _oPod){ gz_(2) Lib_GZ::Sys::Debug::Get(thread)->fTrace1(gzStrL("PodsX:") + gzStrF(_oPod->nW)); } void cGzShModel::fDraw(){ gz_(3) oUvMouse->oVal->nX += 0.01; oUvMouse->fSend(); oVboBatch->fSendData(); oGpuBatch->fDraw(); } gzAny cGzShModel::MemCopy(){ return (gzAny)new cGzShModel(*this); } gzAny cGzShModel::DeepCopy(){ return (gzAny)new cGzShModel(*this, true); } cGzShModel::~cGzShModel(){ } }}}}
51.490066
179
0.668746
09b681e2e346b95e8f5cf0197356b2b9a8c9b28e
23,151
cpp
C++
source/directxtk/src/skinnedeffect.cpp
mechasource/mechcommander2
b2c7cecf001cec1f535aa8d29c31bdc30d9aa983
[ "BSD-2-Clause" ]
38
2015-04-10T13:31:03.000Z
2021-09-03T22:34:05.000Z
source/directxtk/src/skinnedeffect.cpp
mechasource/mechcommander2
b2c7cecf001cec1f535aa8d29c31bdc30d9aa983
[ "BSD-2-Clause" ]
1
2020-07-09T09:48:44.000Z
2020-07-12T12:41:43.000Z
source/directxtk/src/skinnedeffect.cpp
mechasource/mechcommander2
b2c7cecf001cec1f535aa8d29c31bdc30d9aa983
[ "BSD-2-Clause" ]
12
2015-06-29T08:06:57.000Z
2021-10-13T13:11:41.000Z
//-------------------------------------------------------------------------------------- // File: SkinnedEffect.cpp // // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // // http://go.microsoft.com/fwlink/?LinkID=615561 //-------------------------------------------------------------------------------------- #include "stdinc.h" #include "effectcommon.h" using namespace directxtk; namespace { // Constant buffer layout. Must match the shader! struct SkinnedEffectConstants { DirectX::XMVECTOR diffuseColor; DirectX::XMVECTOR emissiveColor; DirectX::XMVECTOR specularColorAndPower; DirectX::XMVECTOR lightDirection[IEffectLights::MaxDirectionalLights]; DirectX::XMVECTOR lightDiffuseColor[IEffectLights::MaxDirectionalLights]; DirectX::XMVECTOR lightSpecularColor[IEffectLights::MaxDirectionalLights]; DirectX::XMVECTOR eyePosition; DirectX::XMVECTOR fogColor; DirectX::XMVECTOR fogVector; DirectX::XMMATRIX world; DirectX::XMVECTOR worldInverseTranspose[3]; DirectX::XMMATRIX worldViewProj; DirectX::XMVECTOR bones[SkinnedEffect::MaxBones][3]; }; static_assert((sizeof(SkinnedEffectConstants) % 16) == 0, "CB size not padded correctly"); // Traits type describes our characteristics to the EffectBase template. struct SkinnedEffectTraits { using ConstantBufferType = SkinnedEffectConstants; static constexpr int32_t VertexShaderCount = 12; static constexpr int32_t PixelShaderCount = 3; static constexpr int32_t ShaderPermutationCount = 24; static constexpr int32_t RootSignatureCount = 1; }; } // Internal SkinnedEffect implementation class. class SkinnedEffect::Impl : public EffectBase<SkinnedEffectTraits> { public: Impl(_In_ ID3D12Device* device, uint32_t effectFlags, const EffectPipelineStateDescription& pipelineDescription, int32_t weightsPerVertex); enum RootParameterIndex { ConstantBuffer, TextureSRV, TextureSampler, RootParameterCount }; D3D12_GPU_DESCRIPTOR_HANDLE texture; D3D12_GPU_DESCRIPTOR_HANDLE sampler; EffectLights lights; int32_t GetPipelineStatePermutation(bool preferPerPixelLighting, int32_t weightsPerVertex, bool biasedVertexNormals) const noexcept; void Apply(_In_ ID3D12GraphicsCommandList* commandList); }; // Include the precompiled shader code. namespace { #if defined(_XBOX_ONE) && defined(_TITLE) #include "Shaders/Compiled/XboxOneSkinnedEffect_VSSkinnedVertexLightingOneBone.inc" #include "Shaders/Compiled/XboxOneSkinnedEffect_VSSkinnedVertexLightingTwoBones.inc" #include "Shaders/Compiled/XboxOneSkinnedEffect_VSSkinnedVertexLightingFourBones.inc" #include "Shaders/Compiled/XboxOneSkinnedEffect_VSSkinnedPixelLightingOneBone.inc" #include "Shaders/Compiled/XboxOneSkinnedEffect_VSSkinnedPixelLightingTwoBones.inc" #include "Shaders/Compiled/XboxOneSkinnedEffect_VSSkinnedPixelLightingFourBones.inc" #include "Shaders/Compiled/XboxOneSkinnedEffect_VSSkinnedVertexLightingOneBoneBn.inc" #include "Shaders/Compiled/XboxOneSkinnedEffect_VSSkinnedVertexLightingTwoBonesBn.inc" #include "Shaders/Compiled/XboxOneSkinnedEffect_VSSkinnedVertexLightingFourBonesBn.inc" #include "Shaders/Compiled/XboxOneSkinnedEffect_VSSkinnedPixelLightingOneBoneBn.inc" #include "Shaders/Compiled/XboxOneSkinnedEffect_VSSkinnedPixelLightingTwoBonesBn.inc" #include "Shaders/Compiled/XboxOneSkinnedEffect_VSSkinnedPixelLightingFourBonesBn.inc" #include "Shaders/Compiled/XboxOneSkinnedEffect_PSSkinnedVertexLighting.inc" #include "Shaders/Compiled/XboxOneSkinnedEffect_PSSkinnedVertexLightingNoFog.inc" #include "Shaders/Compiled/XboxOneSkinnedEffect_PSSkinnedPixelLighting.inc" #else #include "Shaders/Compiled/SkinnedEffect_VSSkinnedVertexLightingOneBone.inc" #include "Shaders/Compiled/SkinnedEffect_VSSkinnedVertexLightingTwoBones.inc" #include "Shaders/Compiled/SkinnedEffect_VSSkinnedVertexLightingFourBones.inc" #include "Shaders/Compiled/SkinnedEffect_VSSkinnedPixelLightingOneBone.inc" #include "Shaders/Compiled/SkinnedEffect_VSSkinnedPixelLightingTwoBones.inc" #include "Shaders/Compiled/SkinnedEffect_VSSkinnedPixelLightingFourBones.inc" #include "Shaders/Compiled/SkinnedEffect_VSSkinnedVertexLightingOneBoneBn.inc" #include "Shaders/Compiled/SkinnedEffect_VSSkinnedVertexLightingTwoBonesBn.inc" #include "Shaders/Compiled/SkinnedEffect_VSSkinnedVertexLightingFourBonesBn.inc" #include "Shaders/Compiled/SkinnedEffect_VSSkinnedPixelLightingOneBoneBn.inc" #include "Shaders/Compiled/SkinnedEffect_VSSkinnedPixelLightingTwoBonesBn.inc" #include "Shaders/Compiled/SkinnedEffect_VSSkinnedPixelLightingFourBonesBn.inc" #include "Shaders/Compiled/SkinnedEffect_PSSkinnedVertexLighting.inc" #include "Shaders/Compiled/SkinnedEffect_PSSkinnedVertexLightingNoFog.inc" #include "Shaders/Compiled/SkinnedEffect_PSSkinnedPixelLighting.inc" #endif } template<> const D3D12_SHADER_BYTECODE EffectBase<SkinnedEffectTraits>::VertexShaderBytecode[] = { { SkinnedEffect_VSSkinnedVertexLightingOneBone, sizeof(SkinnedEffect_VSSkinnedVertexLightingOneBone) }, { SkinnedEffect_VSSkinnedVertexLightingTwoBones, sizeof(SkinnedEffect_VSSkinnedVertexLightingTwoBones) }, { SkinnedEffect_VSSkinnedVertexLightingFourBones, sizeof(SkinnedEffect_VSSkinnedVertexLightingFourBones) }, { SkinnedEffect_VSSkinnedPixelLightingOneBone, sizeof(SkinnedEffect_VSSkinnedPixelLightingOneBone) }, { SkinnedEffect_VSSkinnedPixelLightingTwoBones, sizeof(SkinnedEffect_VSSkinnedPixelLightingTwoBones) }, { SkinnedEffect_VSSkinnedPixelLightingFourBones, sizeof(SkinnedEffect_VSSkinnedPixelLightingFourBones) }, { SkinnedEffect_VSSkinnedVertexLightingOneBoneBn, sizeof(SkinnedEffect_VSSkinnedVertexLightingOneBoneBn) }, { SkinnedEffect_VSSkinnedVertexLightingTwoBonesBn, sizeof(SkinnedEffect_VSSkinnedVertexLightingTwoBonesBn) }, { SkinnedEffect_VSSkinnedVertexLightingFourBonesBn, sizeof(SkinnedEffect_VSSkinnedVertexLightingFourBonesBn) }, { SkinnedEffect_VSSkinnedPixelLightingOneBoneBn, sizeof(SkinnedEffect_VSSkinnedPixelLightingOneBoneBn) }, { SkinnedEffect_VSSkinnedPixelLightingTwoBonesBn, sizeof(SkinnedEffect_VSSkinnedPixelLightingTwoBonesBn) }, { SkinnedEffect_VSSkinnedPixelLightingFourBonesBn, sizeof(SkinnedEffect_VSSkinnedPixelLightingFourBonesBn) }, }; template<> const int32_t EffectBase<SkinnedEffectTraits>::VertexShaderIndices[] = { 0, // vertex lighting, one bone 0, // vertex lighting, one bone, no fog 1, // vertex lighting, two bones 1, // vertex lighting, two bones, no fog 2, // vertex lighting, four bones 2, // vertex lighting, four bones, no fog 3, // pixel lighting, one bone 3, // pixel lighting, one bone, no fog 4, // pixel lighting, two bones 4, // pixel lighting, two bones, no fog 5, // pixel lighting, four bones 5, // pixel lighting, four bones, no fog 6, // vertex lighting (biased vertex normals), one bone 6, // vertex lighting (biased vertex normals), one bone, no fog 7, // vertex lighting (biased vertex normals), two bones 7, // vertex lighting (biased vertex normals), two bones, no fog 8, // vertex lighting (biased vertex normals), four bones 8, // vertex lighting (biased vertex normals), four bones, no fog 9, // pixel lighting (biased vertex normals), one bone 9, // pixel lighting (biased vertex normals), one bone, no fog 10, // pixel lighting (biased vertex normals), two bones 10, // pixel lighting (biased vertex normals), two bones, no fog 11, // pixel lighting (biased vertex normals), four bones 11, // pixel lighting (biased vertex normals), four bones, no fog }; template<> const D3D12_SHADER_BYTECODE EffectBase<SkinnedEffectTraits>::PixelShaderBytecode[] = { { SkinnedEffect_PSSkinnedVertexLighting, sizeof(SkinnedEffect_PSSkinnedVertexLighting) }, { SkinnedEffect_PSSkinnedVertexLightingNoFog, sizeof(SkinnedEffect_PSSkinnedVertexLightingNoFog) }, { SkinnedEffect_PSSkinnedPixelLighting, sizeof(SkinnedEffect_PSSkinnedPixelLighting) }, }; template<> const int32_t EffectBase<SkinnedEffectTraits>::PixelShaderIndices[] = { 0, // vertex lighting, one bone 1, // vertex lighting, one bone, no fog 0, // vertex lighting, two bones 1, // vertex lighting, two bones, no fog 0, // vertex lighting, four bones 1, // vertex lighting, four bones, no fog 2, // pixel lighting, one bone 2, // pixel lighting, one bone, no fog 2, // pixel lighting, two bones 2, // pixel lighting, two bones, no fog 2, // pixel lighting, four bones 2, // pixel lighting, four bones, no fog 0, // vertex lighting (biased vertex normals), one bone 1, // vertex lighting (biased vertex normals), one bone, no fog 0, // vertex lighting (biased vertex normals), two bones 1, // vertex lighting (biased vertex normals), two bones, no fog 0, // vertex lighting (biased vertex normals), four bones 1, // vertex lighting (biased vertex normals), four bones, no fog 2, // pixel lighting (biased vertex normals), one bone 2, // pixel lighting (biased vertex normals), one bone, no fog 2, // pixel lighting (biased vertex normals), two bones 2, // pixel lighting (biased vertex normals), two bones, no fog 2, // pixel lighting (biased vertex normals), four bones 2, // pixel lighting (biased vertex normals), four bones, no fog }; // Global pool of per-device SkinnedEffect resources. template<> SharedResourcePool<ID3D12Device*, EffectBase<SkinnedEffectTraits>::DeviceResources> EffectBase<SkinnedEffectTraits>::deviceResourcesPool = {}; // Constructor. SkinnedEffect::Impl::Impl( _In_ ID3D12Device* device, uint32_t effectFlags, const EffectPipelineStateDescription& pipelineDescription, int32_t weightsPerVertex) : EffectBase(device), texture{}, sampler{} { static_assert(_countof(EffectBase<SkinnedEffectTraits>::VertexShaderIndices) == SkinnedEffectTraits::ShaderPermutationCount, "array/max mismatch"); static_assert(_countof(EffectBase<SkinnedEffectTraits>::VertexShaderBytecode) == SkinnedEffectTraits::VertexShaderCount, "array/max mismatch"); static_assert(_countof(EffectBase<SkinnedEffectTraits>::PixelShaderBytecode) == SkinnedEffectTraits::PixelShaderCount, "array/max mismatch"); static_assert(_countof(EffectBase<SkinnedEffectTraits>::PixelShaderIndices) == SkinnedEffectTraits::ShaderPermutationCount, "array/max mismatch"); if ((weightsPerVertex != 1) && (weightsPerVertex != 2) && (weightsPerVertex != 4)) { DebugTrace("ERROR: SkinnedEffect's weightsPerVertex parameter must be 1, 2, or 4"); throw std::out_of_range("weightsPerVertex must be 1, 2, or 4"); } lights.InitializeConstants(constants.specularColorAndPower, constants.lightDirection, constants.lightDiffuseColor, constants.lightSpecularColor); for (int32_t i = 0; i < MaxBones; i++) { constants.bones[i][0] = DirectX::g_XMIdentityR0; constants.bones[i][1] = DirectX::g_XMIdentityR1; constants.bones[i][2] = DirectX::g_XMIdentityR2; } // Create root signature. { D3D12_ROOT_SIGNATURE_FLAGS rootSignatureFlags = D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT | D3D12_ROOT_SIGNATURE_FLAG_DENY_DOMAIN_SHADER_ROOT_ACCESS | D3D12_ROOT_SIGNATURE_FLAG_DENY_GEOMETRY_SHADER_ROOT_ACCESS | D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS; CD3DX12_DESCRIPTOR_RANGE textureSrvDescriptorRange(D3D12_DESCRIPTOR_RANGE_TYPE_SRV, 1, 0); CD3DX12_DESCRIPTOR_RANGE textureSamplerDescriptorRange(D3D12_DESCRIPTOR_RANGE_TYPE_SAMPLER, 1, 0); CD3DX12_ROOT_PARAMETER rootParameters[RootParameterIndex::RootParameterCount] = {}; rootParameters[RootParameterIndex::TextureSRV].InitAsDescriptorTable(1, &textureSrvDescriptorRange, D3D12_SHADER_VISIBILITY_PIXEL); rootParameters[RootParameterIndex::TextureSampler].InitAsDescriptorTable(1, &textureSamplerDescriptorRange, D3D12_SHADER_VISIBILITY_PIXEL); rootParameters[RootParameterIndex::ConstantBuffer].InitAsConstantBufferView(0, 0, D3D12_SHADER_VISIBILITY_ALL); CD3DX12_ROOT_SIGNATURE_DESC rsigDesc = {}; rsigDesc.Init(_countof(rootParameters), rootParameters, 0, nullptr, rootSignatureFlags); m_prootsignature = GetRootSignature(0, rsigDesc); } assert(m_prootsignature != nullptr); fog.enabled = (effectFlags & EffectFlags::Fog) != 0; if (effectFlags & EffectFlags::VertexColor) { DebugTrace("ERROR: SkinnedEffect does not implement EffectFlags::VertexColor\n"); throw std::invalid_argument("SkinnedEffect"); } // Create pipeline state. int32_t sp = GetPipelineStatePermutation( (effectFlags & EffectFlags::PerPixelLightingBit) != 0, weightsPerVertex, (effectFlags & EffectFlags::BiasedVertexNormals) != 0); assert(sp >= 0 && sp < SkinnedEffectTraits::ShaderPermutationCount); _Analysis_assume_(sp >= 0 && sp < SkinnedEffectTraits::ShaderPermutationCount); int32_t vi = EffectBase<SkinnedEffectTraits>::VertexShaderIndices[sp]; assert(vi >= 0 && vi < SkinnedEffectTraits::VertexShaderCount); _Analysis_assume_(vi >= 0 && vi < SkinnedEffectTraits::VertexShaderCount); int32_t pi = EffectBase<SkinnedEffectTraits>::PixelShaderIndices[sp]; assert(pi >= 0 && pi < SkinnedEffectTraits::PixelShaderCount); _Analysis_assume_(pi >= 0 && pi < SkinnedEffectTraits::PixelShaderCount); pipelineDescription.CreatePipelineState( device, m_prootsignature, EffectBase<SkinnedEffectTraits>::VertexShaderBytecode[vi], EffectBase<SkinnedEffectTraits>::PixelShaderBytecode[pi], m_ppipelinestate.addressof()); SetDebugObjectName(m_ppipelinestate.get(), L"SkinnedEffect"); } int32_t SkinnedEffect::Impl::GetPipelineStatePermutation(bool preferPerPixelLighting, int32_t weightsPerVertex, bool biasedVertexNormals) const noexcept { int32_t permutation = 0; // Use optimized shaders if fog is disabled. if (!fog.enabled) { permutation += 1; } // Evaluate 1, 2, or 4 weights per vertex? if (weightsPerVertex == 2) { permutation += 2; } else if (weightsPerVertex == 4) { permutation += 4; } if (preferPerPixelLighting) { // Do lighting in the pixel shader. permutation += 6; } if (biasedVertexNormals) { // Compressed normals need to be scaled and biased in the vertex shader. permutation += 12; } return permutation; } // Sets our state onto the D3D device. void SkinnedEffect::Impl::Apply(_In_ ID3D12GraphicsCommandList* commandList) { // Compute derived parameter values. matrices.SetConstants(dirtyFlags, constants.worldViewProj); fog.SetConstants(dirtyFlags, matrices.worldView, constants.fogVector); lights.SetConstants(dirtyFlags, matrices, constants.world, constants.worldInverseTranspose, constants.eyePosition, constants.diffuseColor, constants.emissiveColor, true); UpdateConstants(); // Set the root signature commandList->SetGraphicsRootSignature(m_prootsignature); // Set the texture if (!texture.ptr || !sampler.ptr) { DebugTrace("ERROR: Missing texture or sampler for SkinnedEffect (texture %llu, sampler %llu)\n", texture.ptr, sampler.ptr); throw std::exception("SkinnedEffect"); } // **NOTE** If D3D asserts or crashes here, you probably need to call commandList->SetDescriptorHeaps() with the required descriptor heaps. commandList->SetGraphicsRootDescriptorTable(RootParameterIndex::TextureSRV, texture); commandList->SetGraphicsRootDescriptorTable(RootParameterIndex::TextureSampler, sampler); // Set constants commandList->SetGraphicsRootConstantBufferView(RootParameterIndex::ConstantBuffer, GetConstantBufferGpuAddress()); // Set the pipeline state commandList->SetPipelineState(EffectBase::m_ppipelinestate.get()); } // Public constructor. SkinnedEffect::SkinnedEffect( _In_ ID3D12Device* device, uint32_t effectFlags, const EffectPipelineStateDescription& pipelineDescription, int32_t weightsPerVertex) : pimpl(std::make_unique<Impl>(device, effectFlags, pipelineDescription, weightsPerVertex)) { } // Move constructor. SkinnedEffect::SkinnedEffect(SkinnedEffect&& moveFrom) noexcept : pimpl(std::move(moveFrom.pimpl)) { } // Move assignment. SkinnedEffect& SkinnedEffect::operator= (SkinnedEffect&& moveFrom) noexcept { pimpl = std::move(moveFrom.pimpl); return *this; } // Public destructor. SkinnedEffect::~SkinnedEffect() { } // IEffect methods. void SkinnedEffect::Apply(_In_ ID3D12GraphicsCommandList* commandList) { pimpl->Apply(commandList); } // Camera settings. void XM_CALLCONV SkinnedEffect::SetWorld(DirectX::FXMMATRIX value) { pimpl->matrices.world = value; pimpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj | EffectDirtyFlags::WorldInverseTranspose | EffectDirtyFlags::FogVector; } void XM_CALLCONV SkinnedEffect::SetView(DirectX::FXMMATRIX value) { pimpl->matrices.view = value; pimpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj | EffectDirtyFlags::EyePosition | EffectDirtyFlags::FogVector; } void XM_CALLCONV SkinnedEffect::SetProjection(DirectX::FXMMATRIX value) { pimpl->matrices.projection = value; pimpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj; } void XM_CALLCONV SkinnedEffect::SetMatrices(DirectX::FXMMATRIX world, DirectX::CXMMATRIX view, DirectX::CXMMATRIX projection) { pimpl->matrices.world = world; pimpl->matrices.view = view; pimpl->matrices.projection = projection; pimpl->dirtyFlags |= EffectDirtyFlags::WorldViewProj | EffectDirtyFlags::WorldInverseTranspose | EffectDirtyFlags::EyePosition | EffectDirtyFlags::FogVector; } // Material settings. void XM_CALLCONV SkinnedEffect::SetDiffuseColor(DirectX::FXMVECTOR value) { pimpl->lights.diffuseColor = value; pimpl->dirtyFlags |= EffectDirtyFlags::MaterialColor; } void XM_CALLCONV SkinnedEffect::SetEmissiveColor(DirectX::FXMVECTOR value) { pimpl->lights.emissiveColor = value; pimpl->dirtyFlags |= EffectDirtyFlags::MaterialColor; } void XM_CALLCONV SkinnedEffect::SetSpecularColor(DirectX::FXMVECTOR value) { // Set xyz to new value, but preserve existing w (specular power). pimpl->constants.specularColorAndPower = DirectX::XMVectorSelect(pimpl->constants.specularColorAndPower, value, DirectX::g_XMSelect1110); pimpl->dirtyFlags |= EffectDirtyFlags::ConstantBuffer; } void SkinnedEffect::SetSpecularPower(float value) { // Set w to new value, but preserve existing xyz (specular color). pimpl->constants.specularColorAndPower = DirectX::XMVectorSetW(pimpl->constants.specularColorAndPower, value); pimpl->dirtyFlags |= EffectDirtyFlags::ConstantBuffer; } void SkinnedEffect::DisableSpecular() { // Set specular color to black, power to 1 // Note: Don't use a power of 0 or the shader will generate strange highlights on non-specular materials pimpl->constants.specularColorAndPower = DirectX::g_XMIdentityR3; pimpl->dirtyFlags |= EffectDirtyFlags::ConstantBuffer; } void SkinnedEffect::SetAlpha(float value) { pimpl->lights.alpha = value; pimpl->dirtyFlags |= EffectDirtyFlags::MaterialColor; } void XM_CALLCONV SkinnedEffect::SetColorAndAlpha(DirectX::FXMVECTOR value) { pimpl->lights.diffuseColor = value; pimpl->lights.alpha = DirectX::XMVectorGetW(value); pimpl->dirtyFlags |= EffectDirtyFlags::MaterialColor; } // Light settings. void XM_CALLCONV SkinnedEffect::SetAmbientLightColor(DirectX::FXMVECTOR value) { pimpl->lights.ambientLightColor = value; pimpl->dirtyFlags |= EffectDirtyFlags::MaterialColor; } void SkinnedEffect::SetLightEnabled(int32_t whichLight, bool value) { pimpl->dirtyFlags |= pimpl->lights.SetLightEnabled(whichLight, value, pimpl->constants.lightDiffuseColor, pimpl->constants.lightSpecularColor); } void XM_CALLCONV SkinnedEffect::SetLightDirection(int32_t whichLight, DirectX::FXMVECTOR value) { EffectLights::ValidateLightIndex(whichLight); pimpl->constants.lightDirection[whichLight] = value; pimpl->dirtyFlags |= EffectDirtyFlags::ConstantBuffer; } void XM_CALLCONV SkinnedEffect::SetLightDiffuseColor(int32_t whichLight, DirectX::FXMVECTOR value) { pimpl->dirtyFlags |= pimpl->lights.SetLightDiffuseColor(whichLight, value, pimpl->constants.lightDiffuseColor); } void XM_CALLCONV SkinnedEffect::SetLightSpecularColor(int32_t whichLight, DirectX::FXMVECTOR value) { pimpl->dirtyFlags |= pimpl->lights.SetLightSpecularColor(whichLight, value, pimpl->constants.lightSpecularColor); } void SkinnedEffect::EnableDefaultLighting() { EffectLights::EnableDefaultLighting(this); } // Fog settings. void SkinnedEffect::SetFogStart(float value) { pimpl->fog.start = value; pimpl->dirtyFlags |= EffectDirtyFlags::FogVector; } void SkinnedEffect::SetFogEnd(float value) { pimpl->fog.end = value; pimpl->dirtyFlags |= EffectDirtyFlags::FogVector; } void XM_CALLCONV SkinnedEffect::SetFogColor(DirectX::FXMVECTOR value) { pimpl->constants.fogColor = value; pimpl->dirtyFlags |= EffectDirtyFlags::ConstantBuffer; } // Texture settings. void SkinnedEffect::SetTexture(D3D12_GPU_DESCRIPTOR_HANDLE srvDescriptor, D3D12_GPU_DESCRIPTOR_HANDLE samplerDescriptor) { pimpl->texture = srvDescriptor; pimpl->sampler = samplerDescriptor; } // Animation settings. void SkinnedEffect::SetBoneTransforms(_In_reads_(count) DirectX::XMMATRIX const* value, size_t count) { if (count > MaxBones) throw std::out_of_range("count parameter out of range"); auto boneConstant = pimpl->constants.bones; for (auto i = 0u; i < count; i++) { DirectX::XMMATRIX boneMatrix = XMMatrixTranspose(value[i]); boneConstant[i][0] = boneMatrix.r[0]; boneConstant[i][1] = boneMatrix.r[1]; boneConstant[i][2] = boneMatrix.r[2]; } pimpl->dirtyFlags |= EffectDirtyFlags::ConstantBuffer; } void SkinnedEffect::ResetBoneTransforms() { auto boneConstant = pimpl->constants.bones; for(auto i = 0u; i < MaxBones; ++i) { boneConstant[i][0] = DirectX::g_XMIdentityR0; boneConstant[i][1] = DirectX::g_XMIdentityR1; boneConstant[i][2] = DirectX::g_XMIdentityR2; } pimpl->dirtyFlags |= EffectDirtyFlags::ConstantBuffer; }
36.515773
174
0.735951
09b73349df2ba20e88ad4f8b2f8c93915cb63fad
4,788
cpp
C++
qt-creator-opensource-src-4.6.1/src/plugins/qmlprofiler/tests/debugmessagesmodel_test.cpp
kevinlq/Qt-Creator-Opensource-Study
b8cadff1f33f25a5d4ef33ed93f661b788b1ba0f
[ "MIT" ]
5
2018-12-22T14:49:13.000Z
2022-01-13T07:21:46.000Z
qt-creator-opensource-src-4.6.1/src/plugins/qmlprofiler/tests/debugmessagesmodel_test.cpp
kevinlq/Qt-Creator-Opensource-Study
b8cadff1f33f25a5d4ef33ed93f661b788b1ba0f
[ "MIT" ]
null
null
null
qt-creator-opensource-src-4.6.1/src/plugins/qmlprofiler/tests/debugmessagesmodel_test.cpp
kevinlq/Qt-Creator-Opensource-Study
b8cadff1f33f25a5d4ef33ed93f661b788b1ba0f
[ "MIT" ]
8
2018-07-17T03:55:48.000Z
2021-12-22T06:37:53.000Z
/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 as published by the Free Software ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ****************************************************************************/ #include "debugmessagesmodel_test.h" #include <timeline/timelineformattime.h> #include <QtTest> namespace QmlProfiler { namespace Internal { DebugMessagesModelTest::DebugMessagesModelTest(QObject *parent) : QObject(parent), manager(nullptr), model(&manager) { } void DebugMessagesModelTest::initTestCase() { manager.startAcquiring(); QmlEvent event; event.setTypeIndex(-1); for (int i = 0; i < 10; ++i) { event.setTimestamp(i); event.setString(QString::fromLatin1("message %1").arg(i)); QmlEventType type(DebugMessage, MaximumRangeType, i % (QtMsgType::QtInfoMsg + 1), QmlEventLocation("somefile.js", i, 10 - i)); event.setTypeIndex(manager.numLoadedEventTypes()); manager.addEventType(type); manager.addEvent(event); } manager.acquiringDone(); QCOMPARE(manager.state(), QmlProfilerModelManager::Done); } void DebugMessagesModelTest::testTypeId() { // Each event should have a different type and they should be the only ones for (int i = 0; i < 10; ++i) QCOMPARE(model.typeId(i), i); } void DebugMessagesModelTest::testColor() { // TimelineModel::colorBySelectionId ... for (int i = 0; i < 10; ++i) { QCOMPARE(model.color(i), QColor::fromHsl((i % (QtMsgType::QtInfoMsg + 1) * 25) % 360, 150, 166).rgb()); } } static const char *messageTypes[] = { QT_TRANSLATE_NOOP("DebugMessagesModel", "Debug Message"), QT_TRANSLATE_NOOP("DebugMessagesModel", "Warning Message"), QT_TRANSLATE_NOOP("DebugMessagesModel", "Critical Message"), QT_TRANSLATE_NOOP("DebugMessagesModel", "Fatal Message"), QT_TRANSLATE_NOOP("DebugMessagesModel", "Info Message"), }; void DebugMessagesModelTest::testLabels() { QVariantList labels = model.labels(); for (int i = 0; i <= QtMsgType::QtInfoMsg; ++i) { QVariantMap element = labels[i].toMap(); QCOMPARE(element[QLatin1String("description")].toString(), model.tr(messageTypes[i])); QCOMPARE(element[QLatin1String("id")].toInt(), i); } } void DebugMessagesModelTest::testDetails() { for (int i = 0; i < 10; ++i) { QVariantMap details = model.details(i); QCOMPARE(details.value(QLatin1String("displayName")).toString(), model.tr(messageTypes[i % (QtMsgType::QtInfoMsg + 1)])); QCOMPARE(details.value(model.tr("Timestamp")).toString(), Timeline::formatTime(i)); QCOMPARE(details.value(model.tr("Message")).toString(), QString::fromLatin1("message %1").arg(i)); QCOMPARE(details.value(model.tr("Location")).toString(), QString::fromLatin1("somefile.js:%1").arg(i)); } } void DebugMessagesModelTest::testExpandedRow() { for (int i = 0; i < 10; ++i) QCOMPARE(model.expandedRow(i), (i % (QtMsgType::QtInfoMsg + 1) + 1)); } void DebugMessagesModelTest::testCollapsedRow() { for (int i = 0; i < 10; ++i) QCOMPARE(model.collapsedRow(i), 1); } void DebugMessagesModelTest::testLocation() { QVariantMap expected; expected[QLatin1String("file")] = QLatin1String("somefile.js"); for (int i = 0; i < 10; ++i) { expected[QLatin1String("line")] = i; expected[QLatin1String("column")] = 10 - i; QCOMPARE(model.location(i), expected); } } void DebugMessagesModelTest::cleanupTestCase() { model.clear(); QCOMPARE(model.count(), 0); QCOMPARE(model.expandedRowCount(), 1); QCOMPARE(model.collapsedRowCount(), 1); } } // namespace Internal } // namespace QmlProfiler
33.71831
95
0.648496
09b7f1f42ab823cf89e9aaf5c5d453e051582626
3,155
cpp
C++
Drivers/Driver_Lagrange/src/Utils/utilities.cpp
matteofrigo5/HPC_ReverseAugmentedConstrained
d4beca47750177b34da7289f10865fb7043c76e7
[ "MIT" ]
null
null
null
Drivers/Driver_Lagrange/src/Utils/utilities.cpp
matteofrigo5/HPC_ReverseAugmentedConstrained
d4beca47750177b34da7289f10865fb7043c76e7
[ "MIT" ]
null
null
null
Drivers/Driver_Lagrange/src/Utils/utilities.cpp
matteofrigo5/HPC_ReverseAugmentedConstrained
d4beca47750177b34da7289f10865fb7043c76e7
[ "MIT" ]
null
null
null
#include <iostream> #include <mpi.h> #include "utilities.hpp" #define PRINTVALS true namespace { bool compareChar( char const & c1, char const & c2 ) { if( c1 == c2 ) { return true; } else if( std::toupper( c1 ) == std::toupper( c2 ) ) { return true; } return false; } void mpi_print( char const * const str ) { int rank; MPI_Comm_rank( MPI_COMM_WORLD, &rank ); if( rank == 0 ) { std::cout << std::string( str ) << std::endl; } } }; bool stringCompare( std::string const & str1, std::string const & str2) { return ( ( str1.size() == str2.size() ) && std::equal( str1.begin(), str1.end(), str2.begin(), &compareChar ) ); } int get_int_value( pugi::xml_node const & node, std::string const & name, int & val ) { pugi::xml_attribute const attr = node.attribute( name.c_str() ); if( attr != NULL ) { val = attr.as_int(); #if PRINTVALS char buf[200]; std::snprintf( buf, 200, "%20s %15i", name.c_str(), val ); mpi_print( buf ); #endif return 0; } else { return -1; } }; int get_dbl_value( pugi::xml_node const & node, std::string const & name, double & val ) { pugi::xml_attribute const attr = node.attribute( name.c_str() ); if( attr != NULL ) { val = attr.as_double(); #if PRINTVALS char buf[200]; std::snprintf( buf, 200, "%20s %15.6e", name.c_str(), val ); mpi_print( buf ); #endif return 0; } else { return -1; } }; int get_lgl_value( pugi::xml_node const & node, std::string const & name, bool & val ) { pugi::xml_attribute const attr = node.attribute( name.c_str() ); if( attr != NULL ) { val = attr.as_bool(); #if PRINTVALS char buf[200]; std::snprintf( buf, 200, "%20s %15i", name.c_str(), val ); mpi_print( buf ); #endif return 0; } else { return -1; } }; int get_string( pugi::xml_node const & node, std::string const & name, std::string & val ) { pugi::xml_attribute const attr = node.attribute( name.c_str() ); if( attr != NULL ) { val = attr.as_string(); #if PRINTVALS char buf[200]; std::snprintf( buf, 200, "%20s %50s", name.c_str(), val.c_str() ); mpi_print( buf ); #endif return 0; } else { return -1; } }; void warning::push( std::string const & level ) { m_levels.push_back( level ); } void warning::print() { int rank; MPI_Comm_rank( MPI_COMM_WORLD, &rank ); if( rank == 0 ) { std::cout << "Warning: "; for( size_t i = 0; i < m_levels.size()-1; ++i ) { std::cout << m_levels[i] << ":"; } std::cout << m_levels[m_levels.size()-1]; std::cout << " not provided. Default used.\n"; } } void warning::print( std::string const & level ) { int rank; MPI_Comm_rank( MPI_COMM_WORLD, &rank ); if( rank == 0 ) { std::cout << "Warning: "; for( size_t i = 0; i < m_levels.size(); ++i ) { std::cout << m_levels[i] << ":"; } std::cout << level; std::cout << " not provided. Default used.\n"; } } void errorMsg( std::string const & message ) { int rank; MPI_Comm_rank( MPI_COMM_WORLD, &rank ); if( rank == 0 ) { std::cout << message << std::endl; } }
18.892216
114
0.575594
09b8036e41919e4437ddc07e990ee625613ba8d3
24,309
cpp
C++
ref.neo/tools/compilers/roqvq/roq.cpp
Grimace1975/bclcontrib-scriptsharp
8c1b05024404e9115be96a328c79a8555eca2e4a
[ "MIT" ]
null
null
null
ref.neo/tools/compilers/roqvq/roq.cpp
Grimace1975/bclcontrib-scriptsharp
8c1b05024404e9115be96a328c79a8555eca2e4a
[ "MIT" ]
null
null
null
ref.neo/tools/compilers/roqvq/roq.cpp
Grimace1975/bclcontrib-scriptsharp
8c1b05024404e9115be96a328c79a8555eca2e4a
[ "MIT" ]
null
null
null
/* =========================================================================== Doom 3 GPL Source Code Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company. This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?). Doom 3 Source Code 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. Doom 3 Source Code 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 Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>. In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. =========================================================================== */ #include "../../../idlib/precompiled.h" #pragma hdrstop #include "roq.h" #include "codec.h" roq *theRoQ; // current roq file roq::roq( void ) { image = 0; quietMode = false; encoder = 0; previousSize = 0; lastFrame = false; dataStuff=false; } roq::~roq( void ) { if (image) delete image; if (encoder) delete encoder; return; } void roq::EncodeQuietly( bool which ) { quietMode = which; } bool roq::IsQuiet( void ) { return quietMode; } bool roq::IsLastFrame( void ) { return lastFrame; } bool roq::Scaleable( void ) { return paramFile->IsScaleable(); } bool roq::ParamNoAlpha( void ) { return paramFile->NoAlpha(); } bool roq::MakingVideo( void ) { return true; //paramFile->timecode]; } bool roq::SearchType( void ) { return paramFile->SearchType(); } bool roq::HasSound( void ) { return paramFile->HasSound(); } int roq::PreviousFrameSize( void ) { return previousSize; } int roq::FirstFrameSize( void ) { return paramFile->FirstFrameSize(); } int roq::NormalFrameSize( void ) { return paramFile->NormalFrameSize(); } const char * roq::CurrentFilename( void ) { return currentFile.c_str(); } void roq::EncodeStream( const char *paramInputFile ) { int onFrame; idStr f0, f1, f2; int morestuff; onFrame = 1; encoder = new codec; paramFile = new roqParam; paramFile->numInputFiles = 0; paramFile->InitFromFile( paramInputFile ); if (!paramFile->NumberOfFrames()) { return; } InitRoQFile( paramFile->outputFilename); numberOfFrames = paramFile->NumberOfFrames(); if (paramFile->NoAlpha()==true) common->Printf("encodeStream: eluding alpha\n"); f0 = ""; f1 = paramFile->GetNextImageFilename(); if (( paramFile->MoreFrames() == true )) { f2 = paramFile->GetNextImageFilename(); } morestuff = numberOfFrames; while( morestuff ) { LoadAndDisplayImage( f1 ); if (onFrame==1) { encoder->SparseEncode(); // WriteLossless(); } else { if (!strcmp( f0, f1 ) && strcmp( f1, f2) ) { WriteHangFrame(); } else { encoder->SparseEncode(); } } onFrame++; f0 = f1; f1 = f2; if (paramFile->MoreFrames() == true) { f2 = paramFile->GetNextImageFilename(); } morestuff--; session->UpdateScreen(); } // if (numberOfFrames != 1) { // if (image->hasAlpha() && paramFile->NoAlpha()==false) { // lastFrame = true; // encoder->SparseEncode(); // } else { // WriteLossless(); // } // } CloseRoQFile(); } void roq::Write16Word( word *aWord, idFile *stream ) { byte a, b; a = *aWord & 0xff; b = *aWord >> 8; stream->Write( &a, 1 ); stream->Write( &b, 1 ); } void roq::Write32Word( unsigned int *aWord, idFile *stream ) { byte a, b, c, d; a = *aWord & 0xff; b = (*aWord >> 8) & 0xff; c = (*aWord >> 16) & 0xff; d = (*aWord >> 24) & 0xff; stream->Write( &a, 1 ); stream->Write( &b, 1 ); stream->Write( &c, 1 ); stream->Write( &d, 1 ); } int roq::SizeFile( idFile *ftosize ) { return ftosize->Length(); } /* Expanded data destination object for stdio output */ typedef struct { struct jpeg_destination_mgr pub; /* public fields */ byte* outfile; /* target stream */ int size; } my_destination_mgr; typedef my_destination_mgr * my_dest_ptr; /* * Initialize destination --- called by jpeg_start_compress * before any data is actually written. */ void roq::JPEGInitDestination (j_compress_ptr cinfo) { my_dest_ptr dest = (my_dest_ptr) cinfo->dest; dest->pub.next_output_byte = dest->outfile; dest->pub.free_in_buffer = dest->size; } /* * Empty the output buffer --- called whenever buffer fills up. * * In typical applications, this should write the entire output buffer * (ignoring the current state of next_output_byte & free_in_buffer), * reset the pointer & count to the start of the buffer, and return true * indicating that the buffer has been dumped. * * In applications that need to be able to suspend compression due to output * overrun, a FALSE return indicates that the buffer cannot be emptied now. * In this situation, the compressor will return to its caller (possibly with * an indication that it has not accepted all the supplied scanlines). The * application should resume compression after it has made more room in the * output buffer. Note that there are substantial restrictions on the use of * suspension --- see the documentation. * * When suspending, the compressor will back up to a convenient restart point * (typically the start of the current MCU). next_output_byte & free_in_buffer * indicate where the restart point will be if the current call returns FALSE. * Data beyond this point will be regenerated after resumption, so do not * write it out when emptying the buffer externally. */ boolean roq::JPEGEmptyOutputBuffer (j_compress_ptr cinfo) { return true; } /* * Compression initialization. * Before calling this, all parameters and a data destination must be set up. * * We require a write_all_tables parameter as a failsafe check when writing * multiple datastreams from the same compression object. Since prior runs * will have left all the tables marked sent_table=true, a subsequent run * would emit an abbreviated stream (no tables) by default. This may be what * is wanted, but for safety's sake it should not be the default behavior: * programmers should have to make a deliberate choice to emit abbreviated * images. Therefore the documentation and examples should encourage people * to pass write_all_tables=true; then it will take active thought to do the * wrong thing. */ void roq::JPEGStartCompress (j_compress_ptr cinfo, bool write_all_tables) { if (cinfo->global_state != CSTATE_START) ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); if (write_all_tables) jpeg_suppress_tables(cinfo, FALSE); /* mark all tables to be written */ /* (Re)initialize error mgr and destination modules */ (*cinfo->err->reset_error_mgr) ((j_common_ptr) cinfo); (*cinfo->dest->init_destination) (cinfo); /* Perform master selection of active modules */ jinit_compress_master(cinfo); /* Set up for the first pass */ (*cinfo->master->prepare_for_pass) (cinfo); /* Ready for application to drive first pass through jpeg_write_scanlines * or jpeg_write_raw_data. */ cinfo->next_scanline = 0; cinfo->global_state = (cinfo->raw_data_in ? CSTATE_RAW_OK : CSTATE_SCANNING); } /* * Write some scanlines of data to the JPEG compressor. * * The return value will be the number of lines actually written. * This should be less than the supplied num_lines only in case that * the data destination module has requested suspension of the compressor, * or if more than image_height scanlines are passed in. * * Note: we warn about excess calls to jpeg_write_scanlines() since * this likely signals an application programmer error. However, * excess scanlines passed in the last valid call are *silently* ignored, * so that the application need not adjust num_lines for end-of-image * when using a multiple-scanline buffer. */ JDIMENSION roq::JPEGWriteScanlines (j_compress_ptr cinfo, JSAMPARRAY scanlines, JDIMENSION num_lines) { JDIMENSION row_ctr, rows_left; if (cinfo->global_state != CSTATE_SCANNING) ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state); if (cinfo->next_scanline >= cinfo->image_height) WARNMS(cinfo, JWRN_TOO_MUCH_DATA); /* Call progress monitor hook if present */ if (cinfo->progress != NULL) { cinfo->progress->pass_counter = (long) cinfo->next_scanline; cinfo->progress->pass_limit = (long) cinfo->image_height; (*cinfo->progress->progress_monitor) ((j_common_ptr) cinfo); } /* Give master control module another chance if this is first call to * jpeg_write_scanlines. This lets output of the frame/scan headers be * delayed so that application can write COM, etc, markers between * jpeg_start_compress and jpeg_write_scanlines. */ if (cinfo->master->call_pass_startup) (*cinfo->master->pass_startup) (cinfo); /* Ignore any extra scanlines at bottom of image. */ rows_left = cinfo->image_height - cinfo->next_scanline; if (num_lines > rows_left) num_lines = rows_left; row_ctr = 0; (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, num_lines); cinfo->next_scanline += row_ctr; return row_ctr; } /* * Terminate destination --- called by jpeg_finish_compress * after all data has been written. Usually needs to flush buffer. * * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding * application must deal with any cleanup that should happen even * for error exit. */ static int hackSize; void roq::JPEGTermDestination (j_compress_ptr cinfo) { my_dest_ptr dest = (my_dest_ptr) cinfo->dest; size_t datacount = dest->size - dest->pub.free_in_buffer; hackSize = datacount; } /* * Prepare for output to a stdio stream. * The caller must have already opened the stream, and is responsible * for closing it after finishing compression. */ void roq::JPEGDest (j_compress_ptr cinfo, byte* outfile, int size) { my_dest_ptr dest; /* The destination object is made permanent so that multiple JPEG images * can be written to the same file without re-executing jpeg_stdio_dest. * This makes it dangerous to use this manager and a different destination * manager serially with the same JPEG object, because their private object * sizes may be different. Caveat programmer. */ if (cinfo->dest == NULL) { /* first time for this JPEG object? */ cinfo->dest = (struct jpeg_destination_mgr *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, sizeof(my_destination_mgr)); } dest = (my_dest_ptr) cinfo->dest; dest->pub.init_destination = JPEGInitDestination; dest->pub.empty_output_buffer = JPEGEmptyOutputBuffer; dest->pub.term_destination = JPEGTermDestination; dest->outfile = outfile; dest->size = size; } void roq::WriteLossless( void ) { word direct; uint directdw; if (!dataStuff) { InitRoQPatterns(); dataStuff=true; } direct = RoQ_QUAD_JPEG; Write16Word( &direct, RoQFile); /* This struct contains the JPEG compression parameters and pointers to * working space (which is allocated as needed by the JPEG library). * It is possible to have several such structures, representing multiple * compression/decompression processes, in existence at once. We refer * to any one struct (and its associated working data) as a "JPEG object". */ struct jpeg_compress_struct cinfo; /* This struct represents a JPEG error handler. It is declared separately * because applications often want to supply a specialized error handler * (see the second half of this file for an example). But here we just * take the easy way out and use the standard error handler, which will * print a message on stderr and call exit() if compression fails. * Note that this struct must live as long as the main JPEG parameter * struct, to avoid dangling-pointer problems. */ struct jpeg_error_mgr jerr; /* More stuff */ JSAMPROW row_pointer[1]; /* pointer to JSAMPLE row[s] */ int row_stride; /* physical row width in image buffer */ byte *out; /* Step 1: allocate and initialize JPEG compression object */ /* We have to set up the error handler first, in case the initialization * step fails. (Unlikely, but it could happen if you are out of memory.) * This routine fills in the contents of struct jerr, and returns jerr's * address which we place into the link field in cinfo. */ cinfo.err = jpeg_std_error(&jerr); /* Now we can initialize the JPEG compression object. */ jpeg_create_compress(&cinfo); /* Step 2: specify data destination (eg, a file) */ /* Note: steps 2 and 3 can be done in either order. */ /* Here we use the library-supplied code to send compressed data to a * stdio stream. You can also write your own code to do something else. * VERY IMPORTANT: use "b" option to fopen() if you are on a machine that * requires it in order to write binary files. */ out = (byte *)Mem_Alloc(image->pixelsWide()*image->pixelsHigh()*4); JPEGDest(&cinfo, out, image->pixelsWide()*image->pixelsHigh()*4); /* Step 3: set parameters for compression */ /* First we supply a description of the input image. * Four fields of the cinfo struct must be filled in: */ cinfo.image_width = image->pixelsWide(); /* image width and height, in pixels */ cinfo.image_height = image->pixelsHigh(); cinfo.input_components = 4; /* # of color components per pixel */ cinfo.in_color_space = JCS_RGB; /* colorspace of input image */ /* Now use the library's routine to set default compression parameters. * (You must set at least cinfo.in_color_space before calling this, * since the defaults depend on the source color space.) */ jpeg_set_defaults(&cinfo); /* Now you can set any non-default parameters you wish to. * Here we just illustrate the use of quality (quantization table) scaling: */ jpeg_set_quality(&cinfo, paramFile->JpegQuality(), true /* limit to baseline-JPEG values */); /* Step 4: Start compressor */ /* true ensures that we will write a complete interchange-JPEG file. * Pass true unless you are very sure of what you're doing. */ JPEGStartCompress(&cinfo, true); /* Step 5: while (scan lines remain to be written) */ /* jpeg_write_scanlines(...); */ /* Here we use the library's state variable cinfo.next_scanline as the * loop counter, so that we don't have to keep track ourselves. * To keep things simple, we pass one scanline per call; you can pass * more if you wish, though. */ row_stride = image->pixelsWide() * 4; /* JSAMPLEs per row in image_buffer */ byte *pixbuf = image->bitmapData(); while (cinfo.next_scanline < cinfo.image_height) { /* jpeg_write_scanlines expects an array of pointers to scanlines. * Here the array is only one element long, but you could pass * more than one scanline at a time if that's more convenient. */ row_pointer[0] = &pixbuf[((cinfo.image_height-1)*row_stride)-cinfo.next_scanline * row_stride]; (void) JPEGWriteScanlines(&cinfo, row_pointer, 1); } /* Step 6: Finish compression */ jpeg_finish_compress(&cinfo); /* After finish_compress, we can close the output file. */ directdw = hackSize; common->Printf("writeLossless: writing %d bytes to RoQ_QUAD_JPEG\n", hackSize); Write32Word( &directdw, RoQFile ); direct = 0; // flags Write16Word( &direct, RoQFile ); RoQFile->Write( out, hackSize ); Mem_Free(out); /* Step 7: release JPEG compression object */ /* This is an important step since it will release a good deal of memory. */ jpeg_destroy_compress(&cinfo); /* And we're done! */ encoder->SetPreviousImage( "first frame", image ); } void roq::InitRoQFile( const char *RoQFilename ) { word i; static int finit = 0; if (!finit) { finit++; common->Printf("initRoQFile: %s\n", RoQFilename); RoQFile = fileSystem->OpenFileWrite( RoQFilename ); // chmod(RoQFilename, S_IREAD|S_IWRITE|S_ISUID|S_ISGID|0070|0007 ); if ( !RoQFile ) { common->Error("Unable to open output file %s.\n", RoQFilename); } i = RoQ_ID; Write16Word( &i, RoQFile ); i = 0xffff; Write16Word( &i, RoQFile ); Write16Word( &i, RoQFile ); // to retain exact file format write out 32 for new roq's // on loading this will be noted and converted to 1000 / 30 // as with any new sound dump avi demos we need to playback // at the speed the sound engine dumps the audio i = 30; // framerate Write16Word( &i, RoQFile ); } roqOutfile = RoQFilename; } void roq::InitRoQPatterns( void ) { uint j; word direct; direct = RoQ_QUAD_INFO; Write16Word( &direct, RoQFile ); j = 8; Write32Word( &j, RoQFile ); common->Printf("initRoQPatterns: outputting %d bytes to RoQ_INFO\n", j); direct = image->hasAlpha(); if (ParamNoAlpha() == true) direct = 0; Write16Word( &direct, RoQFile ); direct = image->pixelsWide(); Write16Word( &direct, RoQFile ); direct = image->pixelsHigh(); Write16Word( &direct, RoQFile ); direct = 8; Write16Word( &direct, RoQFile ); direct = 4; Write16Word( &direct, RoQFile ); } void roq::CloseRoQFile( void ) { common->Printf("closeRoQFile: closing RoQ file\n"); fileSystem->CloseFile( RoQFile ); } void roq::WriteHangFrame( void ) { uint j; word direct; common->Printf("*******************************************************************\n"); direct = RoQ_QUAD_HANG; Write16Word( &direct, RoQFile); j = 0; Write32Word( &j, RoQFile); direct = 0; Write16Word( &direct, RoQFile); } void roq::WriteCodeBookToStream( byte *codebook, int csize, word cflags ) { uint j; word direct; if (!csize) { common->Printf("writeCodeBook: false VQ DATA!!!!\n"); return; } direct = RoQ_QUAD_CODEBOOK; Write16Word( &direct, RoQFile); j = csize; Write32Word( &j, RoQFile); common->Printf("writeCodeBook: outputting %d bytes to RoQ_QUAD_CODEBOOK\n", j); direct = cflags; Write16Word( &direct, RoQFile); RoQFile->Write( codebook, j ); } void roq::WriteCodeBook( byte *codebook ) { memcpy( codes, codebook, 4096 ); } void roq::WriteFrame( quadcel *pquad ) { word action, direct; int onCCC, onAction, i, code; uint j; byte *cccList; bool *use2, *use4; int dx,dy,dxMean,dyMean,index2[256],index4[256], dimension; cccList = (byte *)Mem_Alloc( numQuadCels * 8); // maximum length use2 = (bool *)Mem_Alloc(256*sizeof(bool)); use4 = (bool *)Mem_Alloc(256*sizeof(bool)); for(i=0;i<256;i++) { use2[i] = false; use4[i] = false; } action = 0; j = onAction = 0; onCCC = 2; // onAction going to go at zero dxMean = encoder->MotMeanX(); dyMean = encoder->MotMeanY(); if (image->hasAlpha()) dimension = 10; else dimension = 6; for (i=0; i<numQuadCels; i++) { if ( pquad[i].size && pquad[i].size < 16 ) { switch( pquad[i].status ) { case SLD: use4[pquad[i].patten[0]] = true; use2[codes[dimension*256+(pquad[i].patten[0]*4)+0]] = true; use2[codes[dimension*256+(pquad[i].patten[0]*4)+1]] = true; use2[codes[dimension*256+(pquad[i].patten[0]*4)+2]] = true; use2[codes[dimension*256+(pquad[i].patten[0]*4)+3]] = true; break; case PAT: use4[pquad[i].patten[0]] = true; use2[codes[dimension*256+(pquad[i].patten[0]*4)+0]] = true; use2[codes[dimension*256+(pquad[i].patten[0]*4)+1]] = true; use2[codes[dimension*256+(pquad[i].patten[0]*4)+2]] = true; use2[codes[dimension*256+(pquad[i].patten[0]*4)+3]] = true; break; case CCC: use2[pquad[i].patten[1]] = true; use2[pquad[i].patten[2]] = true; use2[pquad[i].patten[3]] = true; use2[pquad[i].patten[4]] = true; } } } if (!dataStuff) { dataStuff=true; InitRoQPatterns(); if (image->hasAlpha()) i = 3584; else i = 2560; WriteCodeBookToStream( codes, i, 0 ); for(i=0;i<256;i++) { index2[i] = i; index4[i] = i; } } else { j = 0; for(i=0;i<256;i++) { if (use2[i]) { index2[i] = j; for(dx=0;dx<dimension;dx++) cccList[j*dimension+dx] = codes[i*dimension+dx]; j++; } } code = j*dimension; direct = j; common->Printf("writeFrame: really used %d 2x2 cels\n", j); j = 0; for(i=0;i<256;i++) { if (use4[i]) { index4[i] = j; for(dx=0;dx<4;dx++) cccList[j*4+code+dx] = index2[codes[i*4+(dimension*256)+dx]]; j++; } } code += j*4; direct = (direct<<8) + j; common->Printf("writeFrame: really used %d 4x4 cels\n", j); if (image->hasAlpha()) i = 3584; else i = 2560; if ( code == i || j == 256) { WriteCodeBookToStream( codes, i, 0 ); } else { WriteCodeBookToStream( cccList, code, direct ); } } action = 0; j = onAction = 0; for (i=0; i<numQuadCels; i++) { if ( pquad[i].size && pquad[i].size < 16 ) { code = -1; switch( pquad[i].status ) { case DEP: code = 3; break; case SLD: code = 2; cccList[onCCC++] = index4[pquad[i].patten[0]]; break; case MOT: code = 0; break; case FCC: code = 1; dx = ((pquad[i].domain >> 8 )) - 128 - dxMean + 8; dy = ((pquad[i].domain & 0xff)) - 128 - dyMean + 8; if (dx>15 || dx<0 || dy>15 || dy<0 ) { common->Error("writeFrame: FCC error %d,%d mean %d,%d at %d,%d,%d rmse %f\n", dx,dy, dxMean, dyMean,pquad[i].xat,pquad[i].yat,pquad[i].size, pquad[i].snr[FCC] ); } cccList[onCCC++] = (dx<<4)+dy; break; case PAT: code = 2; cccList[onCCC++] = index4[pquad[i].patten[0]]; break; case CCC: code = 3; cccList[onCCC++] = index2[pquad[i].patten[1]]; cccList[onCCC++] = index2[pquad[i].patten[2]]; cccList[onCCC++] = index2[pquad[i].patten[3]]; cccList[onCCC++] = index2[pquad[i].patten[4]]; break; case DEAD: common->Error("dead cels in picture\n"); break; } if (code == -1) { common->Error( "writeFrame: an error occurred writing the frame\n"); } action = (action<<2)|code; j++; if (j == 8) { j = 0; cccList[onAction+0] = (action & 0xff); cccList[onAction+1] = ((action >> 8) & 0xff); onAction = onCCC; onCCC += 2; } } } if (j) { action <<= ((8-j)*2); cccList[onAction+0] = (action & 0xff); cccList[onAction+1] = ((action >> 8) & 0xff); } direct = RoQ_QUAD_VQ; Write16Word( &direct, RoQFile); j = onCCC; Write32Word( &j, RoQFile); direct = dyMean; direct &= 0xff; direct += (dxMean<<8); // flags Write16Word( &direct, RoQFile); common->Printf("writeFrame: outputting %d bytes to RoQ_QUAD_VQ\n", j); previousSize = j; RoQFile->Write( cccList, onCCC ); Mem_Free( cccList ); Mem_Free( use2 ); Mem_Free( use4 ); } // // load a frame, create a window (if neccesary) and display the frame // void roq::LoadAndDisplayImage( const char * filename ) { if (image) delete image; common->Printf("loadAndDisplayImage: %s\n", filename); currentFile = filename; image = new NSBitmapImageRep( filename ); numQuadCels = ((image->pixelsWide() & 0xfff0)*(image->pixelsHigh() & 0xfff0))/(MINSIZE*MINSIZE); numQuadCels += numQuadCels/4 + numQuadCels/16; // if (paramFile->deltaFrames] == true && cleared == false && [image isPlanar] == false) { // cleared = true; // imageData = [image data]; // memset( imageData, 0, image->pixelsWide()*image->pixelsHigh()*[image samplesPerPixel]); // } if (!quietMode) common->Printf("loadAndDisplayImage: %dx%d\n", image->pixelsWide(), image->pixelsHigh()); } void roq::MarkQuadx( int xat, int yat, int size, float cerror, int choice ) { } NSBitmapImageRep* roq::CurrentImage( void ) { return image; } int roq::NumberOfFrames( void ) { return numberOfFrames; } void RoQFileEncode_f( const idCmdArgs &args ) { if ( args.Argc() != 2 ) { common->Printf( "Usage: roq <paramfile>\n" ); return; } theRoQ = new roq; int startMsec = Sys_Milliseconds(); theRoQ->EncodeStream( args.Argv( 1 ) ); int stopMsec = Sys_Milliseconds(); common->Printf( "total encoding time: %i second\n", ( stopMsec - startMsec ) / 1000 ); }
28.398364
342
0.679378
09b8eb1a11c791f4a277c56baaa67b3eedd10a97
6,621
cpp
C++
sys/sync/mutex.cpp
apexrtos/apex
9538ab2f5b974035ca30ca8750479bdefe153047
[ "0BSD" ]
15
2020-05-08T06:21:58.000Z
2021-12-11T18:10:43.000Z
sys/sync/mutex.cpp
apexrtos/apex
9538ab2f5b974035ca30ca8750479bdefe153047
[ "0BSD" ]
11
2020-05-08T06:46:37.000Z
2021-03-30T05:46:03.000Z
sys/sync/mutex.cpp
apexrtos/apex
9538ab2f5b974035ca30ca8750479bdefe153047
[ "0BSD" ]
5
2020-08-31T17:05:03.000Z
2021-12-08T07:09:00.000Z
/*- * Copyright (c) 2005-2007, Kohsuke Ohtani * 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 author nor the names of any co-contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. */ /* * mutex.c - mutual exclusion service. */ /* * A mutex is used to protect un-sharable resources. A thread * can use mutex_lock() to ensure that global resource is not * accessed by other thread. * * TODO: remove recursive mutex support. * SMP: spin before going to sleep. */ #include <sync.h> #include <arch/interrupt.h> #include <atomic> #include <cassert> #include <debug.h> #include <errno.h> #include <event.h> #include <sch.h> #include <sig.h> #include <thread.h> struct mutex_private { std::atomic_intptr_t owner; /* owner thread locking this mutex */ spinlock lock; /* lock to protect struct mutex contents */ unsigned count; /* counter for recursive lock */ struct event event; /* event */ }; static_assert(sizeof(mutex_private) == sizeof(mutex)); static_assert(alignof(mutex_private) == alignof(mutex)); /* * mutex_init - Initialize a mutex. */ void mutex_init(mutex *m) { mutex_private *mp = (mutex_private*)m->storage; atomic_store_explicit(&mp->owner, 0, std::memory_order_relaxed); spinlock_init(&mp->lock); mp->count = 0; event_init(&mp->event, "mutex", event::ev_LOCK); } /* * mutex_lock - Lock a mutex. * * The current thread is blocked if the mutex has already been * locked. If current thread receives any exception while * waiting mutex, this routine returns EINTR. */ static int __attribute__((noinline)) mutex_lock_slowpath(mutex *m) { int r; mutex_private *mp = (mutex_private*)m->storage; spinlock_lock(&mp->lock); /* check if we already hold the mutex */ if (mutex_owner(m) == thread_cur()) { atomic_fetch_or_explicit( &mp->owner, MUTEX_RECURSIVE, std::memory_order_relaxed ); ++mp->count; spinlock_unlock(&mp->lock); return 0; } /* mutex was freed since atomic test */ intptr_t expected = 0; if (atomic_compare_exchange_strong_explicit( &mp->owner, &expected, (intptr_t)thread_cur(), std::memory_order_acquire, std::memory_order_relaxed)) { mp->count = 1; spinlock_unlock(&mp->lock); return 0; } atomic_fetch_or_explicit( &mp->owner, MUTEX_WAITERS, std::memory_order_relaxed ); /* wait for unlock */ r = sch_prepare_sleep(&mp->event, 0); spinlock_unlock(&mp->lock); if (r == 0) r = sch_continue_sleep(); #if defined(CONFIG_DEBUG) if (r < 0) --thread_cur()->mutex_locks; #endif return r; } static int mutex_lock_s(mutex *m, bool block_signals) { assert(!sch_locks()); assert(!interrupt_running()); mutex_private *mp = (mutex_private*)m->storage; if (!block_signals && sig_unblocked_pending(thread_cur())) return -EINTR; #if defined(CONFIG_DEBUG) ++thread_cur()->mutex_locks; #endif intptr_t expected = 0; if (atomic_compare_exchange_strong_explicit( &mp->owner, &expected, (intptr_t)thread_cur(), std::memory_order_acquire, std::memory_order_relaxed)) { mp->count = 1; return 0; } k_sigset_t sig_mask; if (block_signals) sig_mask = sig_block_all(); const int ret = mutex_lock_slowpath(m); if (block_signals) sig_restore(&sig_mask); return ret; } int mutex_lock_interruptible(mutex *m) { return mutex_lock_s(m, false); } int mutex_lock(mutex *m) { return mutex_lock_s(m, true); } /* * mutex_unlock - Unlock a mutex. */ static int __attribute__((noinline)) mutex_unlock_slowpath(mutex *m) { /* can't unlock if we don't hold */ if (mutex_owner(m) != thread_cur()) return DERR(-EINVAL); mutex_private *mp = (mutex_private*)m->storage; spinlock_lock(&mp->lock); /* check recursive lock */ if (--mp->count != 0) { spinlock_unlock(&mp->lock); return 0; } if (!(atomic_load_explicit( &mp->owner, std::memory_order_relaxed) & MUTEX_WAITERS)) { atomic_store_explicit(&mp->owner, 0, std::memory_order_release); spinlock_unlock(&mp->lock); return 0; } /* wake up one waiter and set new owner */ thread *waiter = sch_wakeone(&mp->event); atomic_store_explicit( &mp->owner, (intptr_t)waiter | (event_waiting(&mp->event) ? MUTEX_WAITERS : 0), std::memory_order_relaxed ); /* waiter can be interrupted */ if (waiter) mp->count = 1; spinlock_unlock(&mp->lock); return 0; } int mutex_unlock(mutex *m) { assert(!interrupt_running()); mutex_private *mp = (mutex_private*)m->storage; #if defined(CONFIG_DEBUG) assert(thread_cur()->mutex_locks > 0); --thread_cur()->mutex_locks; #endif intptr_t expected = (intptr_t)thread_cur(); const intptr_t zero = 0; if (atomic_compare_exchange_strong_explicit( &mp->owner, &expected, zero, std::memory_order_release, std::memory_order_relaxed)) return 0; return mutex_unlock_slowpath(m); } /* * mutex_owner - get owner of mutex */ thread* mutex_owner(const mutex *m) { const mutex_private *mp = (const mutex_private*)m->storage; return (thread *)(atomic_load_explicit( &mp->owner, std::memory_order_relaxed) & MUTEX_TID_MASK); } /* * mutex_assert_locked - ensure that current thread owns mutex */ void mutex_assert_locked(const mutex *m) { assert(mutex_owner(m) == thread_cur()); }
24.164234
77
0.70518
09bdec9cac21096c77cf1a697bb159786bbd6dd9
3,803
cxx
C++
src/translation/AddressSuffixRegistry.cxx
CM4all/beng-proxy
ce5a81f7969bc5cb6c5985cdc98f61ef8b5c6159
[ "BSD-2-Clause" ]
35
2017-08-16T06:52:26.000Z
2022-03-27T21:49:01.000Z
src/translation/AddressSuffixRegistry.cxx
nn6n/beng-proxy
2cf351da656de6fbace3048ee90a8a6a72f6165c
[ "BSD-2-Clause" ]
2
2017-12-22T15:34:23.000Z
2022-03-08T04:15:23.000Z
src/translation/AddressSuffixRegistry.cxx
nn6n/beng-proxy
2cf351da656de6fbace3048ee90a8a6a72f6165c
[ "BSD-2-Clause" ]
8
2017-12-22T15:11:47.000Z
2022-03-15T22:54:04.000Z
/* * Copyright 2007-2021 CM4all GmbH * All rights reserved. * * author: Max Kellermann <mk@cm4all.com> * * 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 * FOUNDATION 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 "AddressSuffixRegistry.hxx" #include "SuffixRegistry.hxx" #include "ResourceAddress.hxx" #include "file/Address.hxx" #include "nfs/Address.hxx" #include "util/ConstBuffer.hxx" #include "util/CharUtil.hxx" #include "AllocatorPtr.hxx" #include <string.h> [[gnu::pure]] static const char * get_suffix(const char *path) noexcept { const char *slash = strrchr(path, '/'); if (slash != nullptr) path = slash + 1; while (*path == '.') ++path; const char *dot = strrchr(path, '.'); if (dot == nullptr || dot[1] == 0) return nullptr; return dot + 1; } struct AddressSuffixInfo { const char *path; ConstBuffer<void> content_type_lookup; }; [[gnu::pure]] static AddressSuffixInfo GetAddressSuffixInfo(const ResourceAddress &address) noexcept { switch (address.type) { case ResourceAddress::Type::NONE: case ResourceAddress::Type::HTTP: case ResourceAddress::Type::LHTTP: case ResourceAddress::Type::PIPE: case ResourceAddress::Type::CGI: case ResourceAddress::Type::FASTCGI: case ResourceAddress::Type::WAS: return {nullptr, nullptr}; case ResourceAddress::Type::LOCAL: return {address.GetFile().path, address.GetFile().content_type_lookup}; case ResourceAddress::Type::NFS: return {address.GetNfs().path, address.GetNfs().content_type_lookup}; } gcc_unreachable(); } bool suffix_registry_lookup(AllocatorPtr alloc, TranslationService &service, const ResourceAddress &address, const StopwatchPtr &parent_stopwatch, SuffixRegistryHandler &handler, CancellablePointer &cancel_ptr) noexcept { const auto info = GetAddressSuffixInfo(address); if (info.content_type_lookup.IsNull()) return false; const char *suffix = get_suffix(info.path); if (suffix == nullptr) return false; const size_t length = strlen(suffix); if (length > 5) return false; /* duplicate the suffix, convert to lower case, check for "illegal" characters (non-alphanumeric) */ char *buffer = alloc.Dup(suffix); for (char *p = buffer; *p != 0; ++p) { const char ch = *p; if (IsUpperAlphaASCII(ch)) /* convert to lower case */ *p += 'a' - 'A'; else if (!IsLowerAlphaASCII(ch) && !IsDigitASCII(ch)) /* no, we won't look this up */ return false; } suffix_registry_lookup(alloc, service, info.content_type_lookup, buffer, parent_stopwatch, handler, cancel_ptr); return true; }
29.48062
73
0.723639
09c285942f2d4692bb2914a9e6586c04daa43b61
2,703
cpp
C++
Code/Games/SampleGamePlugin/Components/RedursiveGrowthComponent.cpp
fereeh/ezEngine
14e46cb2a1492812888602796db7ddd66e2b7110
[ "MIT" ]
null
null
null
Code/Games/SampleGamePlugin/Components/RedursiveGrowthComponent.cpp
fereeh/ezEngine
14e46cb2a1492812888602796db7ddd66e2b7110
[ "MIT" ]
null
null
null
Code/Games/SampleGamePlugin/Components/RedursiveGrowthComponent.cpp
fereeh/ezEngine
14e46cb2a1492812888602796db7ddd66e2b7110
[ "MIT" ]
null
null
null
#include <SampleGamePluginPCH.h> #include <Core/WorldSerializer/WorldReader.h> #include <Core/WorldSerializer/WorldWriter.h> #include <SampleGamePlugin/Components/RedursiveGrowthComponent.h> // clang-format off EZ_BEGIN_COMPONENT_TYPE(RecursiveGrowthComponent, 2, ezComponentMode::Static) { EZ_BEGIN_PROPERTIES { EZ_MEMBER_PROPERTY("Children", m_uiNumChildren)->AddAttributes(new ezDefaultValueAttribute(2), new ezClampValueAttribute(0, 200)), EZ_MEMBER_PROPERTY("RecursionDepth", m_uiRecursionDepth)->AddAttributes(new ezDefaultValueAttribute(2), new ezClampValueAttribute(0, 5)), } EZ_END_PROPERTIES; EZ_BEGIN_ATTRIBUTES { new ezCategoryAttribute("SampleGame"), } EZ_END_ATTRIBUTES; } EZ_END_COMPONENT_TYPE // clang-format on RecursiveGrowthComponent::RecursiveGrowthComponent() = default; RecursiveGrowthComponent::~RecursiveGrowthComponent() = default; void RecursiveGrowthComponent::SerializeComponent(ezWorldWriter& stream) const { SUPER::SerializeComponent(stream); auto& s = stream.GetStream(); // Version 1 s << m_uiNumChildren; // Version 2 s << m_uiRecursionDepth; } void RecursiveGrowthComponent::DeserializeComponent(ezWorldReader& stream) { SUPER::DeserializeComponent(stream); const ezUInt32 uiVersion = stream.GetComponentTypeVersion(GetStaticRTTI()); auto& s = stream.GetStream(); s >> m_uiNumChildren; if (uiVersion >= 2) // version number given in EZ_BEGIN_COMPONENT_TYPE above { s >> m_uiRecursionDepth; } } void RecursiveGrowthComponent::OnSimulationStarted() { RecursiveGrowthComponentManager* pManager = GetWorld()->GetComponentManager<RecursiveGrowthComponentManager>(); EZ_LOG_BLOCK("RecursiveGrowthComponent::OnSimulationStarted"); if (m_uiRecursionDepth > 0) { ezLog::Debug("Recursion Depth: {0}, Creating {1} children", m_uiRecursionDepth, m_uiNumChildren); for (ezUInt32 i = 0; i < m_uiNumChildren; ++i) { ezGameObjectDesc gd; gd.m_hParent = GetOwner()->GetHandle(); gd.m_LocalPosition.Set(i * 2.0f, 0, 0); ezGameObject* pChild; GetWorld()->CreateObject(gd, pChild); RecursiveGrowthComponent* pChildComp = nullptr; ezComponentHandle hChildComp = pManager->CreateComponent(pChild, pChildComp); pChildComp->m_uiNumChildren = m_uiNumChildren; pChildComp->m_uiRecursionDepth = m_uiRecursionDepth - 1; pChildComp->m_uiChild = i; // TODO: Add more components (e.g. mesh) if desired } } } void RecursiveGrowthComponent::Update() { // do stuff } void RecursiveGrowthComponent::Initialize() { ezLog::Info("RecursiveGrowthComponent::Initialize: Child {0}, Recursions: {1}", m_uiChild, m_uiRecursionDepth); }
27.865979
141
0.748428
09c3d51599805cfb434d2f62d15b02449c598599
1,581
cpp
C++
emulator/src/mame/video/ac1.cpp
rjw57/tiw-computer
5ef1c79893165b8622d1114d81cd0cded58910f0
[ "MIT" ]
1
2022-01-15T21:38:38.000Z
2022-01-15T21:38:38.000Z
emulator/src/mame/video/ac1.cpp
rjw57/tiw-computer
5ef1c79893165b8622d1114d81cd0cded58910f0
[ "MIT" ]
null
null
null
emulator/src/mame/video/ac1.cpp
rjw57/tiw-computer
5ef1c79893165b8622d1114d81cd0cded58910f0
[ "MIT" ]
null
null
null
// license:BSD-3-Clause // copyright-holders:Miodrag Milanovic /*************************************************************************** AC1 video driver by Miodrag Milanovic 15/01/2009 Preliminary driver. ****************************************************************************/ #include "emu.h" #include "includes/ac1.h" #define AC1_VIDEO_MEMORY 0x1000 const gfx_layout ac1_charlayout = { 6, 8, /* 6x8 characters */ 256, /* 256 characters */ 1, /* 1 bits per pixel */ {0}, /* no bitplanes; 1 bit per pixel */ {7, 6, 5, 4, 3, 2}, {0 * 8, 1 * 8, 2 * 8, 3 * 8, 4 * 8, 5 * 8, 6 * 8, 7 * 8}, 8*8 /* size of one char */ }; void ac1_state::video_start() { } uint32_t ac1_state::screen_update_ac1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y; address_space &space = m_maincpu->space(AS_PROGRAM); for(y = 0; y < 16; y++ ) { for(x = 0; x < 64; x++ ) { int code = space.read_byte(AC1_VIDEO_MEMORY + x + y*64); m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, code , 0, 0,0, 63*6-x*6,15*8-y*8); } } return 0; } uint32_t ac1_state::screen_update_ac1_32(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int x,y; address_space &space = m_maincpu->space(AS_PROGRAM); for(y = 0; y < 32; y++ ) { for(x = 0; x < 64; x++ ) { int code = space.read_byte(AC1_VIDEO_MEMORY + x + y*64); m_gfxdecode->gfx(0)->opaque(bitmap,cliprect, code , 0, 0,0, 63*6-x*6,31*8-y*8); } } return 0; }
25.5
112
0.532574
09caa4186487020a4c01fbf8e2ed0fe02792e90b
506
hpp
C++
sources/Notebook.hpp
sandler2806/cpp-Task2b
9c656c86044e6b67cb1dae58c09d7757cc752a83
[ "MIT" ]
null
null
null
sources/Notebook.hpp
sandler2806/cpp-Task2b
9c656c86044e6b67cb1dae58c09d7757cc752a83
[ "MIT" ]
null
null
null
sources/Notebook.hpp
sandler2806/cpp-Task2b
9c656c86044e6b67cb1dae58c09d7757cc752a83
[ "MIT" ]
null
null
null
#include "Direction.hpp" #include <string> // for string class #include <unordered_map> using namespace std; namespace ariel{ class Notebook { unordered_map<string, array<char,100>> map; public: void write( int page,int row, int column, Direction dir, string str); string read( int page, int row, int column,Direction dir, int length); void erase( int page, int row, int column,Direction dir, int length); void show( int page); }; }
28.111111
79
0.636364
09cc031771e3558dd8d02235bbd5e81a05d66429
460,760
cpp
C++
Procedural Terrain_BackUpThisFolder_ButDontShipItWithYourGame/il2cppOutput/Bulk_mscorlib_17.cpp
bsgbryan/MinTuts
a1bb11ccee0ff10e6a9594bdeb02d41f965df169
[ "MIT" ]
1
2021-06-04T18:35:56.000Z
2021-06-04T18:35:56.000Z
Procedural Terrain_BackUpThisFolder_ButDontShipItWithYourGame/il2cppOutput/Bulk_mscorlib_17.cpp
bsgbryan/MinTuts
a1bb11ccee0ff10e6a9594bdeb02d41f965df169
[ "MIT" ]
null
null
null
Procedural Terrain_BackUpThisFolder_ButDontShipItWithYourGame/il2cppOutput/Bulk_mscorlib_17.cpp
bsgbryan/MinTuts
a1bb11ccee0ff10e6a9594bdeb02d41f965df169
[ "MIT" ]
null
null
null
#include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <cstring> #include <string.h> #include <stdio.h> #include <cmath> #include <limits> #include <assert.h> #include <stdint.h> #include "il2cpp-class-internals.h" #include "codegen/il2cpp-codegen.h" #include "il2cpp-object-internals.h" template <typename T1, typename T2> struct VirtActionInvoker2 { typedef void (*Action)(void*, T1, T2, const RuntimeMethod*); static inline void Invoke (Il2CppMethodSlot slot, RuntimeObject* obj, T1 p1, T2 p2) { const VirtualInvokeData& invokeData = il2cpp_codegen_get_virtual_invoke_data(slot, obj); ((Action)invokeData.methodPtr)(obj, p1, p2, invokeData.method); } }; template <typename T1> struct VirtActionInvoker1 { typedef void (*Action)(void*, T1, const RuntimeMethod*); static inline void Invoke (Il2CppMethodSlot slot, RuntimeObject* obj, T1 p1) { const VirtualInvokeData& invokeData = il2cpp_codegen_get_virtual_invoke_data(slot, obj); ((Action)invokeData.methodPtr)(obj, p1, invokeData.method); } }; template <typename R> struct VirtFuncInvoker0 { typedef R (*Func)(void*, const RuntimeMethod*); static inline R Invoke (Il2CppMethodSlot slot, RuntimeObject* obj) { const VirtualInvokeData& invokeData = il2cpp_codegen_get_virtual_invoke_data(slot, obj); return ((Func)invokeData.methodPtr)(obj, invokeData.method); } }; template <typename R, typename T1> struct VirtFuncInvoker1 { typedef R (*Func)(void*, T1, const RuntimeMethod*); static inline R Invoke (Il2CppMethodSlot slot, RuntimeObject* obj, T1 p1) { const VirtualInvokeData& invokeData = il2cpp_codegen_get_virtual_invoke_data(slot, obj); return ((Func)invokeData.methodPtr)(obj, p1, invokeData.method); } }; template <typename R, typename T1, typename T2, typename T3> struct VirtFuncInvoker3 { typedef R (*Func)(void*, T1, T2, T3, const RuntimeMethod*); static inline R Invoke (Il2CppMethodSlot slot, RuntimeObject* obj, T1 p1, T2 p2, T3 p3) { const VirtualInvokeData& invokeData = il2cpp_codegen_get_virtual_invoke_data(slot, obj); return ((Func)invokeData.methodPtr)(obj, p1, p2, p3, invokeData.method); } }; template <typename T1, typename T2> struct GenericVirtActionInvoker2 { typedef void (*Action)(void*, T1, T2, const RuntimeMethod*); static inline void Invoke (const RuntimeMethod* method, RuntimeObject* obj, T1 p1, T2 p2) { VirtualInvokeData invokeData; il2cpp_codegen_get_generic_virtual_invoke_data(method, obj, &invokeData); ((Action)invokeData.methodPtr)(obj, p1, p2, invokeData.method); } }; template <typename T1> struct GenericVirtActionInvoker1 { typedef void (*Action)(void*, T1, const RuntimeMethod*); static inline void Invoke (const RuntimeMethod* method, RuntimeObject* obj, T1 p1) { VirtualInvokeData invokeData; il2cpp_codegen_get_generic_virtual_invoke_data(method, obj, &invokeData); ((Action)invokeData.methodPtr)(obj, p1, invokeData.method); } }; template <typename T1, typename T2> struct InterfaceActionInvoker2 { typedef void (*Action)(void*, T1, T2, const RuntimeMethod*); static inline void Invoke (Il2CppMethodSlot slot, RuntimeClass* declaringInterface, RuntimeObject* obj, T1 p1, T2 p2) { const VirtualInvokeData& invokeData = il2cpp_codegen_get_interface_invoke_data(slot, obj, declaringInterface); ((Action)invokeData.methodPtr)(obj, p1, p2, invokeData.method); } }; template <typename T1> struct InterfaceActionInvoker1 { typedef void (*Action)(void*, T1, const RuntimeMethod*); static inline void Invoke (Il2CppMethodSlot slot, RuntimeClass* declaringInterface, RuntimeObject* obj, T1 p1) { const VirtualInvokeData& invokeData = il2cpp_codegen_get_interface_invoke_data(slot, obj, declaringInterface); ((Action)invokeData.methodPtr)(obj, p1, invokeData.method); } }; template <typename T1, typename T2> struct GenericInterfaceActionInvoker2 { typedef void (*Action)(void*, T1, T2, const RuntimeMethod*); static inline void Invoke (const RuntimeMethod* method, RuntimeObject* obj, T1 p1, T2 p2) { VirtualInvokeData invokeData; il2cpp_codegen_get_generic_interface_invoke_data(method, obj, &invokeData); ((Action)invokeData.methodPtr)(obj, p1, p2, invokeData.method); } }; template <typename T1> struct GenericInterfaceActionInvoker1 { typedef void (*Action)(void*, T1, const RuntimeMethod*); static inline void Invoke (const RuntimeMethod* method, RuntimeObject* obj, T1 p1) { VirtualInvokeData invokeData; il2cpp_codegen_get_generic_interface_invoke_data(method, obj, &invokeData); ((Action)invokeData.methodPtr)(obj, p1, invokeData.method); } }; // System.String struct String_t; // System.ArgumentException struct ArgumentException_t132251570; // System.Globalization.NumberFormatInfo struct NumberFormatInfo_t435877138; // System.IFormatProvider struct IFormatProvider_t2518567562; // System.Object[] struct ObjectU5BU5D_t2843939325; // System.InvalidCastException struct InvalidCastException_t3927145244; // System.Type struct Type_t; // System.IConvertible struct IConvertible_t2977365677; // System.Runtime.Serialization.SerializationInfo struct SerializationInfo_t950877179; // System.ArgumentNullException struct ArgumentNullException_t1615371798; // System.UnauthorizedAccessException struct UnauthorizedAccessException_t490705335; // System.SystemException struct SystemException_t176217640; // System.Exception struct Exception_t; // System.UnhandledExceptionEventArgs struct UnhandledExceptionEventArgs_t2886101344; // System.EventArgs struct EventArgs_t3591816995; // System.UnhandledExceptionEventHandler struct UnhandledExceptionEventHandler_t3101989324; // System.Delegate struct Delegate_t1188392813; // System.IAsyncResult struct IAsyncResult_t767004451; // System.AsyncCallback struct AsyncCallback_t3962456242; // System.Reflection.Missing struct Missing_t508514592; // System.RuntimeType struct RuntimeType_t3636489352; // System.Collections.Generic.List`1<System.Int32> struct List_1_t128053199; // System.Int32[] struct Int32U5BU5D_t385246372; // System.UnitySerializationHolder struct UnitySerializationHolder_t431912834; // System.Reflection.RuntimeAssembly struct RuntimeAssembly_t1451753063; // System.Reflection.Assembly struct Assembly_t; // System.Runtime.Serialization.SerializationException struct SerializationException_t3941511869; // System.NotSupportedException struct NotSupportedException_t1314879016; // System.Reflection.MethodBase struct MethodBase_t; // System.Reflection.Module struct Module_t2987026101; // System.IndexOutOfRangeException struct IndexOutOfRangeException_t1578797820; // System.Collections.IEqualityComparer struct IEqualityComparer_t1493878338; // System.Collections.IComparer struct IComparer_t1540313114; // System.ValueType struct ValueType_t3640485471; // System.Version struct Version_t3456873960; // System.ArgumentOutOfRangeException struct ArgumentOutOfRangeException_t777629997; // System.Text.StringBuilder struct StringBuilder_t; // System.WeakReference struct WeakReference_t1334886716; // System.WindowsConsoleDriver struct WindowsConsoleDriver_t3991887195; // System.InvalidOperationException struct InvalidOperationException_t56020091; // System.InputRecord struct InputRecord_t2660212290; // System.Byte[] struct ByteU5BU5D_t4116647657; // System.Char[] struct CharU5BU5D_t3528271667; // System.Type[] struct TypeU5BU5D_t3940880105; // System.Collections.IDictionary struct IDictionary_t1363984059; // System.Runtime.Serialization.SafeSerializationManager struct SafeSerializationManager_t2481557153; // System.Diagnostics.StackTrace[] struct StackTraceU5BU5D_t1169129676; // System.IntPtr[] struct IntPtrU5BU5D_t4013366056; // System.String[] struct StringU5BU5D_t1281789340; // System.Collections.Generic.Dictionary`2<System.String,System.Int32> struct Dictionary_2_t2736202052; // System.Runtime.Serialization.IFormatterConverter struct IFormatterConverter_t2171992254; // System.Void struct Void_t1185182177; // System.Char struct Char_t3634460470; // System.UInt32[] struct UInt32U5BU5D_t2770800703; // System.Reflection.Assembly/ResolveEventHolder struct ResolveEventHolder_t2120639521; // System.Security.Policy.Evidence struct Evidence_t2008144148; // System.Security.PermissionSet struct PermissionSet_t223948603; // System.Reflection.MethodInfo struct MethodInfo_t; // System.DelegateData struct DelegateData_t1677132599; // System.Delegate[] struct DelegateU5BU5D_t1703627840; // System.Reflection.MemberFilter struct MemberFilter_t426314064; // System.Reflection.Binder struct Binder_t2999457153; // System.Reflection.TypeFilter struct TypeFilter_t2356120900; // System.MonoTypeInfo struct MonoTypeInfo_t3366989025; // System.Reflection.RuntimeConstructorInfo struct RuntimeConstructorInfo_t1806616898; // System.Collections.Generic.Dictionary`2<System.Guid,System.Type> struct Dictionary_2_t1532962293; // System.Reflection.Emit.AssemblyBuilder struct AssemblyBuilder_t359885250; extern RuntimeClass* UInt32_t2560061978_il2cpp_TypeInfo_var; extern RuntimeClass* ArgumentException_t132251570_il2cpp_TypeInfo_var; extern const RuntimeMethod* UInt32_CompareTo_m362578384_RuntimeMethod_var; extern String_t* _stringLiteral1622425596; extern const uint32_t UInt32_CompareTo_m362578384_MetadataUsageId; extern const uint32_t UInt32_Equals_m351935437_MetadataUsageId; extern RuntimeClass* Convert_t2465617642_il2cpp_TypeInfo_var; extern const uint32_t UInt32_System_IConvertible_ToBoolean_m1763673183_MetadataUsageId; extern const uint32_t UInt32_System_IConvertible_ToChar_m1873050533_MetadataUsageId; extern const uint32_t UInt32_System_IConvertible_ToSByte_m1061556466_MetadataUsageId; extern const uint32_t UInt32_System_IConvertible_ToByte_m4072781199_MetadataUsageId; extern const uint32_t UInt32_System_IConvertible_ToInt16_m1659441601_MetadataUsageId; extern const uint32_t UInt32_System_IConvertible_ToUInt16_m3125657960_MetadataUsageId; extern const uint32_t UInt32_System_IConvertible_ToInt32_m220754611_MetadataUsageId; extern const uint32_t UInt32_System_IConvertible_ToInt64_m2261037378_MetadataUsageId; extern const uint32_t UInt32_System_IConvertible_ToUInt64_m1094958903_MetadataUsageId; extern const uint32_t UInt32_System_IConvertible_ToSingle_m1272823424_MetadataUsageId; extern const uint32_t UInt32_System_IConvertible_ToDouble_m940039456_MetadataUsageId; extern const uint32_t UInt32_System_IConvertible_ToDecimal_m675004071_MetadataUsageId; extern RuntimeClass* ObjectU5BU5D_t2843939325_il2cpp_TypeInfo_var; extern RuntimeClass* InvalidCastException_t3927145244_il2cpp_TypeInfo_var; extern const RuntimeMethod* UInt32_System_IConvertible_ToDateTime_m2767723441_RuntimeMethod_var; extern String_t* _stringLiteral4287968739; extern String_t* _stringLiteral2789887848; extern String_t* _stringLiteral3798051137; extern const uint32_t UInt32_System_IConvertible_ToDateTime_m2767723441_MetadataUsageId; extern const uint32_t UInt32_System_IConvertible_ToType_m922356584_MetadataUsageId; extern RuntimeClass* UInt64_t4134040092_il2cpp_TypeInfo_var; extern const RuntimeMethod* UInt64_CompareTo_m3619843473_RuntimeMethod_var; extern String_t* _stringLiteral2814066682; extern const uint32_t UInt64_CompareTo_m3619843473_MetadataUsageId; extern const uint32_t UInt64_Equals_m1879425698_MetadataUsageId; extern const uint32_t UInt64_System_IConvertible_ToBoolean_m3071416000_MetadataUsageId; extern const uint32_t UInt64_System_IConvertible_ToChar_m2074245892_MetadataUsageId; extern const uint32_t UInt64_System_IConvertible_ToSByte_m30962591_MetadataUsageId; extern const uint32_t UInt64_System_IConvertible_ToByte_m1501504925_MetadataUsageId; extern const uint32_t UInt64_System_IConvertible_ToInt16_m3895479143_MetadataUsageId; extern const uint32_t UInt64_System_IConvertible_ToUInt16_m4165747038_MetadataUsageId; extern const uint32_t UInt64_System_IConvertible_ToInt32_m949522652_MetadataUsageId; extern const uint32_t UInt64_System_IConvertible_ToUInt32_m2784653358_MetadataUsageId; extern const uint32_t UInt64_System_IConvertible_ToInt64_m4241475606_MetadataUsageId; extern const uint32_t UInt64_System_IConvertible_ToSingle_m925613075_MetadataUsageId; extern const uint32_t UInt64_System_IConvertible_ToDouble_m602078108_MetadataUsageId; extern const uint32_t UInt64_System_IConvertible_ToDecimal_m806594027_MetadataUsageId; extern const RuntimeMethod* UInt64_System_IConvertible_ToDateTime_m3434604642_RuntimeMethod_var; extern String_t* _stringLiteral2789494635; extern const uint32_t UInt64_System_IConvertible_ToDateTime_m3434604642_MetadataUsageId; extern const uint32_t UInt64_System_IConvertible_ToType_m4049257834_MetadataUsageId; extern RuntimeClass* UIntPtr_t_il2cpp_TypeInfo_var; extern const uint32_t UIntPtr_Equals_m1316671746_MetadataUsageId; extern const uint32_t UIntPtr_ToString_m984583492_MetadataUsageId; extern RuntimeClass* ArgumentNullException_t1615371798_il2cpp_TypeInfo_var; extern const RuntimeMethod* UIntPtr_System_Runtime_Serialization_ISerializable_GetObjectData_m1767630151_RuntimeMethod_var; extern String_t* _stringLiteral79347; extern String_t* _stringLiteral1363226343; extern const uint32_t UIntPtr_System_Runtime_Serialization_ISerializable_GetObjectData_m1767630151_MetadataUsageId; extern const uint32_t UIntPtr__cctor_m3513964473_MetadataUsageId; extern String_t* _stringLiteral2994918982; extern const uint32_t UnauthorizedAccessException__ctor_m246605039_MetadataUsageId; extern RuntimeClass* EventArgs_t3591816995_il2cpp_TypeInfo_var; extern const uint32_t UnhandledExceptionEventArgs__ctor_m224348470_MetadataUsageId; extern const RuntimeType* UnitySerializationHolder_t431912834_0_0_0_var; extern RuntimeClass* Type_t_il2cpp_TypeInfo_var; extern String_t* _stringLiteral3283586028; extern const uint32_t UnitySerializationHolder_GetUnitySerializationInfo_m927411785_MetadataUsageId; extern const RuntimeType* Int32U5BU5D_t385246372_0_0_0_var; extern RuntimeClass* List_1_t128053199_il2cpp_TypeInfo_var; extern RuntimeClass* RuntimeType_t3636489352_il2cpp_TypeInfo_var; extern const RuntimeMethod* List_1__ctor_m1204004817_RuntimeMethod_var; extern const RuntimeMethod* List_1_Add_m2080863212_RuntimeMethod_var; extern const RuntimeMethod* List_1_ToArray_m1469074435_RuntimeMethod_var; extern String_t* _stringLiteral3927933503; extern const uint32_t UnitySerializationHolder_AddElementTypes_m2711578409_MetadataUsageId; extern const RuntimeType* MethodBase_t_0_0_0_var; extern const RuntimeType* Type_t_0_0_0_var; extern const RuntimeType* TypeU5BU5D_t3940880105_0_0_0_var; extern String_t* _stringLiteral3378664767; extern String_t* _stringLiteral98117656; extern String_t* _stringLiteral2725392681; extern String_t* _stringLiteral1245918466; extern const uint32_t UnitySerializationHolder_GetUnitySerializationInfo_m3060468266_MetadataUsageId; extern const RuntimeType* String_t_0_0_0_var; extern RuntimeClass* String_t_il2cpp_TypeInfo_var; extern String_t* _stringLiteral2037252898; extern String_t* _stringLiteral209558951; extern const uint32_t UnitySerializationHolder_GetUnitySerializationInfo_m3966690610_MetadataUsageId; extern RuntimeClass* MethodBase_t_il2cpp_TypeInfo_var; extern RuntimeClass* Int32U5BU5D_t385246372_il2cpp_TypeInfo_var; extern RuntimeClass* TypeU5BU5D_t3940880105_il2cpp_TypeInfo_var; extern const RuntimeMethod* UnitySerializationHolder__ctor_m3869442095_RuntimeMethod_var; extern const uint32_t UnitySerializationHolder__ctor_m3869442095_MetadataUsageId; extern RuntimeClass* SerializationException_t3941511869_il2cpp_TypeInfo_var; extern const RuntimeMethod* UnitySerializationHolder_ThrowInsufficientInformation_m1747464776_RuntimeMethod_var; extern String_t* _stringLiteral3245515088; extern const uint32_t UnitySerializationHolder_ThrowInsufficientInformation_m1747464776_MetadataUsageId; extern RuntimeClass* NotSupportedException_t1314879016_il2cpp_TypeInfo_var; extern const RuntimeMethod* UnitySerializationHolder_GetObjectData_m3377455907_RuntimeMethod_var; extern String_t* _stringLiteral532335187; extern const uint32_t UnitySerializationHolder_GetObjectData_m3377455907_MetadataUsageId; extern RuntimeClass* Empty_t4129602447_il2cpp_TypeInfo_var; extern RuntimeClass* DBNull_t3725197148_il2cpp_TypeInfo_var; extern RuntimeClass* Missing_t508514592_il2cpp_TypeInfo_var; extern RuntimeClass* Module_t2987026101_il2cpp_TypeInfo_var; extern const RuntimeMethod* UnitySerializationHolder_GetRealObject_m1624354633_RuntimeMethod_var; extern String_t* _stringLiteral1313207612; extern String_t* _stringLiteral1498318814; extern String_t* _stringLiteral3407159193; extern const uint32_t UnitySerializationHolder_GetRealObject_m1624354633_MetadataUsageId; extern RuntimeClass* IndexOutOfRangeException_t1578797820_il2cpp_TypeInfo_var; extern const RuntimeMethod* UnSafeCharBuffer_AppendString_m2223303597_RuntimeMethod_var; extern const uint32_t UnSafeCharBuffer_AppendString_m2223303597_MetadataUsageId; extern RuntimeClass* ValueTuple_t3168505507_il2cpp_TypeInfo_var; extern const uint32_t ValueTuple_Equals_m3777586424_MetadataUsageId; extern const uint32_t ValueTuple_System_Collections_IStructuralEquatable_Equals_m1158377527_MetadataUsageId; extern const RuntimeMethod* ValueTuple_System_IComparable_CompareTo_m3152321575_RuntimeMethod_var; extern String_t* _stringLiteral4055290125; extern String_t* _stringLiteral2432405111; extern const uint32_t ValueTuple_System_IComparable_CompareTo_m3152321575_MetadataUsageId; extern const RuntimeMethod* ValueTuple_System_Collections_IStructuralComparable_CompareTo_m1147772089_RuntimeMethod_var; extern const uint32_t ValueTuple_System_Collections_IStructuralComparable_CompareTo_m1147772089_MetadataUsageId; extern String_t* _stringLiteral3450976136; extern const uint32_t ValueTuple_ToString_m2213345710_MetadataUsageId; extern RuntimeClass* HashHelpers_t1653534276_il2cpp_TypeInfo_var; extern const uint32_t ValueTuple_CombineHashCodes_m2782652282_MetadataUsageId; extern const uint32_t ValueType_DefaultEquals_m2927252100_MetadataUsageId; extern RuntimeClass* Marshal_t1757017490_il2cpp_TypeInfo_var; extern RuntimeClass* IntPtr_t_il2cpp_TypeInfo_var; extern const uint32_t Variant_Clear_m3388694274_MetadataUsageId; extern RuntimeClass* ArgumentOutOfRangeException_t777629997_il2cpp_TypeInfo_var; extern const RuntimeMethod* Version__ctor_m417728625_RuntimeMethod_var; extern String_t* _stringLiteral419133523; extern String_t* _stringLiteral2448690427; extern String_t* _stringLiteral2762033855; extern String_t* _stringLiteral437191301; extern String_t* _stringLiteral3187820736; extern const uint32_t Version__ctor_m417728625_MetadataUsageId; extern const RuntimeMethod* Version__ctor_m3537335798_RuntimeMethod_var; extern const uint32_t Version__ctor_m3537335798_MetadataUsageId; extern RuntimeClass* Version_t3456873960_il2cpp_TypeInfo_var; extern const uint32_t Version_Clone_m1749041863_MetadataUsageId; extern const RuntimeMethod* Version_CompareTo_m1662919407_RuntimeMethod_var; extern String_t* _stringLiteral1182144617; extern const uint32_t Version_CompareTo_m1662919407_MetadataUsageId; extern const uint32_t Version_CompareTo_m3146217210_MetadataUsageId; extern const uint32_t Version_Equals_m3073813696_MetadataUsageId; extern const uint32_t Version_Equals_m1564427710_MetadataUsageId; extern const RuntimeMethod* Version_ToString_m3654989516_RuntimeMethod_var; extern String_t* _stringLiteral3104458722; extern String_t* _stringLiteral3452614544; extern String_t* _stringLiteral3452614542; extern String_t* _stringLiteral3976682977; extern String_t* _stringLiteral3452614541; extern String_t* _stringLiteral3452614540; extern const uint32_t Version_ToString_m3654989516_MetadataUsageId; extern const uint32_t Version_op_Inequality_m1696193441_MetadataUsageId; extern const RuntimeMethod* Version_op_LessThan_m3745610070_RuntimeMethod_var; extern String_t* _stringLiteral3451500490; extern const uint32_t Version_op_LessThan_m3745610070_MetadataUsageId; extern const RuntimeMethod* Version_op_LessThanOrEqual_m666140174_RuntimeMethod_var; extern const uint32_t Version_op_LessThanOrEqual_m666140174_MetadataUsageId; extern const uint32_t Version_op_GreaterThanOrEqual_m474945801_MetadataUsageId; extern RuntimeClass* CharU5BU5D_t3528271667_il2cpp_TypeInfo_var; extern const uint32_t Version__cctor_m3568671087_MetadataUsageId; extern const RuntimeType* RuntimeObject_0_0_0_var; extern const RuntimeMethod* WeakReference__ctor_m1244067698_RuntimeMethod_var; extern String_t* _stringLiteral3234942771; extern String_t* _stringLiteral2922588279; extern const uint32_t WeakReference__ctor_m1244067698_MetadataUsageId; extern RuntimeClass* Exception_t_il2cpp_TypeInfo_var; extern const RuntimeMethod* WeakReference_GetObjectData_m2192383095_RuntimeMethod_var; extern const uint32_t WeakReference_GetObjectData_m2192383095_MetadataUsageId; extern RuntimeClass* Int32_t2950945753_il2cpp_TypeInfo_var; extern RuntimeClass* InvalidOperationException_t56020091_il2cpp_TypeInfo_var; extern const RuntimeMethod* WindowsConsoleDriver_ReadKey_m209631140_RuntimeMethod_var; extern String_t* _stringLiteral1071424308; extern const uint32_t WindowsConsoleDriver_ReadKey_m209631140_MetadataUsageId; struct InputRecord_t2660212290_marshaled_pinvoke; struct InputRecord_t2660212290;; struct InputRecord_t2660212290_marshaled_pinvoke;; extern const uint32_t CFHelpers_FetchString_m1875874129_MetadataUsageId; extern RuntimeClass* ByteU5BU5D_t4116647657_il2cpp_TypeInfo_var; extern const uint32_t CFHelpers_FetchDataBuffer_m2260522698_MetadataUsageId; extern const uint32_t CFHelpers_CreateCertificateFromData_m702581168_MetadataUsageId; struct Exception_t_marshaled_pinvoke; struct Exception_t_marshaled_com; struct Assembly_t_marshaled_pinvoke; struct Assembly_t_marshaled_com; struct ObjectU5BU5D_t2843939325; struct DelegateU5BU5D_t1703627840; struct Int32U5BU5D_t385246372; struct TypeU5BU5D_t3940880105; struct CharU5BU5D_t3528271667; struct ByteU5BU5D_t4116647657; #ifndef RUNTIMEOBJECT_H #define RUNTIMEOBJECT_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Object #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // RUNTIMEOBJECT_H struct Il2CppArrayBounds; #ifndef RUNTIMEARRAY_H #define RUNTIMEARRAY_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Array #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // RUNTIMEARRAY_H #ifndef VALUETYPE_T3640485471_H #define VALUETYPE_T3640485471_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.ValueType struct ValueType_t3640485471 : public RuntimeObject { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif // Native definition for P/Invoke marshalling of System.ValueType struct ValueType_t3640485471_marshaled_pinvoke { }; // Native definition for COM marshalling of System.ValueType struct ValueType_t3640485471_marshaled_com { }; #endif // VALUETYPE_T3640485471_H #ifndef DBNULL_T3725197148_H #define DBNULL_T3725197148_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.DBNull struct DBNull_t3725197148 : public RuntimeObject { public: public: }; struct DBNull_t3725197148_StaticFields { public: // System.DBNull System.DBNull::Value DBNull_t3725197148 * ___Value_0; public: inline static int32_t get_offset_of_Value_0() { return static_cast<int32_t>(offsetof(DBNull_t3725197148_StaticFields, ___Value_0)); } inline DBNull_t3725197148 * get_Value_0() const { return ___Value_0; } inline DBNull_t3725197148 ** get_address_of_Value_0() { return &___Value_0; } inline void set_Value_0(DBNull_t3725197148 * value) { ___Value_0 = value; Il2CppCodeGenWriteBarrier((&___Value_0), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // DBNULL_T3725197148_H #ifndef EMPTY_T4129602447_H #define EMPTY_T4129602447_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Empty struct Empty_t4129602447 : public RuntimeObject { public: public: }; struct Empty_t4129602447_StaticFields { public: // System.Empty System.Empty::Value Empty_t4129602447 * ___Value_0; public: inline static int32_t get_offset_of_Value_0() { return static_cast<int32_t>(offsetof(Empty_t4129602447_StaticFields, ___Value_0)); } inline Empty_t4129602447 * get_Value_0() const { return ___Value_0; } inline Empty_t4129602447 ** get_address_of_Value_0() { return &___Value_0; } inline void set_Value_0(Empty_t4129602447 * value) { ___Value_0 = value; Il2CppCodeGenWriteBarrier((&___Value_0), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // EMPTY_T4129602447_H #ifndef VERSION_T3456873960_H #define VERSION_T3456873960_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Version struct Version_t3456873960 : public RuntimeObject { public: // System.Int32 System.Version::_Major int32_t ____Major_0; // System.Int32 System.Version::_Minor int32_t ____Minor_1; // System.Int32 System.Version::_Build int32_t ____Build_2; // System.Int32 System.Version::_Revision int32_t ____Revision_3; public: inline static int32_t get_offset_of__Major_0() { return static_cast<int32_t>(offsetof(Version_t3456873960, ____Major_0)); } inline int32_t get__Major_0() const { return ____Major_0; } inline int32_t* get_address_of__Major_0() { return &____Major_0; } inline void set__Major_0(int32_t value) { ____Major_0 = value; } inline static int32_t get_offset_of__Minor_1() { return static_cast<int32_t>(offsetof(Version_t3456873960, ____Minor_1)); } inline int32_t get__Minor_1() const { return ____Minor_1; } inline int32_t* get_address_of__Minor_1() { return &____Minor_1; } inline void set__Minor_1(int32_t value) { ____Minor_1 = value; } inline static int32_t get_offset_of__Build_2() { return static_cast<int32_t>(offsetof(Version_t3456873960, ____Build_2)); } inline int32_t get__Build_2() const { return ____Build_2; } inline int32_t* get_address_of__Build_2() { return &____Build_2; } inline void set__Build_2(int32_t value) { ____Build_2 = value; } inline static int32_t get_offset_of__Revision_3() { return static_cast<int32_t>(offsetof(Version_t3456873960, ____Revision_3)); } inline int32_t get__Revision_3() const { return ____Revision_3; } inline int32_t* get_address_of__Revision_3() { return &____Revision_3; } inline void set__Revision_3(int32_t value) { ____Revision_3 = value; } }; struct Version_t3456873960_StaticFields { public: // System.Char[] System.Version::SeparatorsArray CharU5BU5D_t3528271667* ___SeparatorsArray_4; public: inline static int32_t get_offset_of_SeparatorsArray_4() { return static_cast<int32_t>(offsetof(Version_t3456873960_StaticFields, ___SeparatorsArray_4)); } inline CharU5BU5D_t3528271667* get_SeparatorsArray_4() const { return ___SeparatorsArray_4; } inline CharU5BU5D_t3528271667** get_address_of_SeparatorsArray_4() { return &___SeparatorsArray_4; } inline void set_SeparatorsArray_4(CharU5BU5D_t3528271667* value) { ___SeparatorsArray_4 = value; Il2CppCodeGenWriteBarrier((&___SeparatorsArray_4), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // VERSION_T3456873960_H #ifndef STRINGBUILDER_T_H #define STRINGBUILDER_T_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Text.StringBuilder struct StringBuilder_t : public RuntimeObject { public: // System.Char[] System.Text.StringBuilder::m_ChunkChars CharU5BU5D_t3528271667* ___m_ChunkChars_0; // System.Text.StringBuilder System.Text.StringBuilder::m_ChunkPrevious StringBuilder_t * ___m_ChunkPrevious_1; // System.Int32 System.Text.StringBuilder::m_ChunkLength int32_t ___m_ChunkLength_2; // System.Int32 System.Text.StringBuilder::m_ChunkOffset int32_t ___m_ChunkOffset_3; // System.Int32 System.Text.StringBuilder::m_MaxCapacity int32_t ___m_MaxCapacity_4; public: inline static int32_t get_offset_of_m_ChunkChars_0() { return static_cast<int32_t>(offsetof(StringBuilder_t, ___m_ChunkChars_0)); } inline CharU5BU5D_t3528271667* get_m_ChunkChars_0() const { return ___m_ChunkChars_0; } inline CharU5BU5D_t3528271667** get_address_of_m_ChunkChars_0() { return &___m_ChunkChars_0; } inline void set_m_ChunkChars_0(CharU5BU5D_t3528271667* value) { ___m_ChunkChars_0 = value; Il2CppCodeGenWriteBarrier((&___m_ChunkChars_0), value); } inline static int32_t get_offset_of_m_ChunkPrevious_1() { return static_cast<int32_t>(offsetof(StringBuilder_t, ___m_ChunkPrevious_1)); } inline StringBuilder_t * get_m_ChunkPrevious_1() const { return ___m_ChunkPrevious_1; } inline StringBuilder_t ** get_address_of_m_ChunkPrevious_1() { return &___m_ChunkPrevious_1; } inline void set_m_ChunkPrevious_1(StringBuilder_t * value) { ___m_ChunkPrevious_1 = value; Il2CppCodeGenWriteBarrier((&___m_ChunkPrevious_1), value); } inline static int32_t get_offset_of_m_ChunkLength_2() { return static_cast<int32_t>(offsetof(StringBuilder_t, ___m_ChunkLength_2)); } inline int32_t get_m_ChunkLength_2() const { return ___m_ChunkLength_2; } inline int32_t* get_address_of_m_ChunkLength_2() { return &___m_ChunkLength_2; } inline void set_m_ChunkLength_2(int32_t value) { ___m_ChunkLength_2 = value; } inline static int32_t get_offset_of_m_ChunkOffset_3() { return static_cast<int32_t>(offsetof(StringBuilder_t, ___m_ChunkOffset_3)); } inline int32_t get_m_ChunkOffset_3() const { return ___m_ChunkOffset_3; } inline int32_t* get_address_of_m_ChunkOffset_3() { return &___m_ChunkOffset_3; } inline void set_m_ChunkOffset_3(int32_t value) { ___m_ChunkOffset_3 = value; } inline static int32_t get_offset_of_m_MaxCapacity_4() { return static_cast<int32_t>(offsetof(StringBuilder_t, ___m_MaxCapacity_4)); } inline int32_t get_m_MaxCapacity_4() const { return ___m_MaxCapacity_4; } inline int32_t* get_address_of_m_MaxCapacity_4() { return &___m_MaxCapacity_4; } inline void set_m_MaxCapacity_4(int32_t value) { ___m_MaxCapacity_4 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // STRINGBUILDER_T_H #ifndef MEMBERINFO_T_H #define MEMBERINFO_T_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Reflection.MemberInfo struct MemberInfo_t : public RuntimeObject { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // MEMBERINFO_T_H #ifndef LIST_1_T128053199_H #define LIST_1_T128053199_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Collections.Generic.List`1<System.Int32> struct List_1_t128053199 : public RuntimeObject { public: // T[] System.Collections.Generic.List`1::_items Int32U5BU5D_t385246372* ____items_1; // System.Int32 System.Collections.Generic.List`1::_size int32_t ____size_2; // System.Int32 System.Collections.Generic.List`1::_version int32_t ____version_3; // System.Object System.Collections.Generic.List`1::_syncRoot RuntimeObject * ____syncRoot_4; public: inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_t128053199, ____items_1)); } inline Int32U5BU5D_t385246372* get__items_1() const { return ____items_1; } inline Int32U5BU5D_t385246372** get_address_of__items_1() { return &____items_1; } inline void set__items_1(Int32U5BU5D_t385246372* value) { ____items_1 = value; Il2CppCodeGenWriteBarrier((&____items_1), value); } inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_t128053199, ____size_2)); } inline int32_t get__size_2() const { return ____size_2; } inline int32_t* get_address_of__size_2() { return &____size_2; } inline void set__size_2(int32_t value) { ____size_2 = value; } inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_t128053199, ____version_3)); } inline int32_t get__version_3() const { return ____version_3; } inline int32_t* get_address_of__version_3() { return &____version_3; } inline void set__version_3(int32_t value) { ____version_3 = value; } inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_t128053199, ____syncRoot_4)); } inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; } inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; } inline void set__syncRoot_4(RuntimeObject * value) { ____syncRoot_4 = value; Il2CppCodeGenWriteBarrier((&____syncRoot_4), value); } }; struct List_1_t128053199_StaticFields { public: // T[] System.Collections.Generic.List`1::_emptyArray Int32U5BU5D_t385246372* ____emptyArray_5; public: inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_t128053199_StaticFields, ____emptyArray_5)); } inline Int32U5BU5D_t385246372* get__emptyArray_5() const { return ____emptyArray_5; } inline Int32U5BU5D_t385246372** get_address_of__emptyArray_5() { return &____emptyArray_5; } inline void set__emptyArray_5(Int32U5BU5D_t385246372* value) { ____emptyArray_5 = value; Il2CppCodeGenWriteBarrier((&____emptyArray_5), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // LIST_1_T128053199_H #ifndef MISSING_T508514592_H #define MISSING_T508514592_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Reflection.Missing struct Missing_t508514592 : public RuntimeObject { public: public: }; struct Missing_t508514592_StaticFields { public: // System.Reflection.Missing System.Reflection.Missing::Value Missing_t508514592 * ___Value_0; public: inline static int32_t get_offset_of_Value_0() { return static_cast<int32_t>(offsetof(Missing_t508514592_StaticFields, ___Value_0)); } inline Missing_t508514592 * get_Value_0() const { return ___Value_0; } inline Missing_t508514592 ** get_address_of_Value_0() { return &___Value_0; } inline void set_Value_0(Missing_t508514592 * value) { ___Value_0 = value; Il2CppCodeGenWriteBarrier((&___Value_0), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // MISSING_T508514592_H #ifndef UNITYSERIALIZATIONHOLDER_T431912834_H #define UNITYSERIALIZATIONHOLDER_T431912834_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.UnitySerializationHolder struct UnitySerializationHolder_t431912834 : public RuntimeObject { public: // System.Type[] System.UnitySerializationHolder::m_instantiation TypeU5BU5D_t3940880105* ___m_instantiation_0; // System.Int32[] System.UnitySerializationHolder::m_elementTypes Int32U5BU5D_t385246372* ___m_elementTypes_1; // System.Int32 System.UnitySerializationHolder::m_genericParameterPosition int32_t ___m_genericParameterPosition_2; // System.Type System.UnitySerializationHolder::m_declaringType Type_t * ___m_declaringType_3; // System.Reflection.MethodBase System.UnitySerializationHolder::m_declaringMethod MethodBase_t * ___m_declaringMethod_4; // System.String System.UnitySerializationHolder::m_data String_t* ___m_data_5; // System.String System.UnitySerializationHolder::m_assemblyName String_t* ___m_assemblyName_6; // System.Int32 System.UnitySerializationHolder::m_unityType int32_t ___m_unityType_7; public: inline static int32_t get_offset_of_m_instantiation_0() { return static_cast<int32_t>(offsetof(UnitySerializationHolder_t431912834, ___m_instantiation_0)); } inline TypeU5BU5D_t3940880105* get_m_instantiation_0() const { return ___m_instantiation_0; } inline TypeU5BU5D_t3940880105** get_address_of_m_instantiation_0() { return &___m_instantiation_0; } inline void set_m_instantiation_0(TypeU5BU5D_t3940880105* value) { ___m_instantiation_0 = value; Il2CppCodeGenWriteBarrier((&___m_instantiation_0), value); } inline static int32_t get_offset_of_m_elementTypes_1() { return static_cast<int32_t>(offsetof(UnitySerializationHolder_t431912834, ___m_elementTypes_1)); } inline Int32U5BU5D_t385246372* get_m_elementTypes_1() const { return ___m_elementTypes_1; } inline Int32U5BU5D_t385246372** get_address_of_m_elementTypes_1() { return &___m_elementTypes_1; } inline void set_m_elementTypes_1(Int32U5BU5D_t385246372* value) { ___m_elementTypes_1 = value; Il2CppCodeGenWriteBarrier((&___m_elementTypes_1), value); } inline static int32_t get_offset_of_m_genericParameterPosition_2() { return static_cast<int32_t>(offsetof(UnitySerializationHolder_t431912834, ___m_genericParameterPosition_2)); } inline int32_t get_m_genericParameterPosition_2() const { return ___m_genericParameterPosition_2; } inline int32_t* get_address_of_m_genericParameterPosition_2() { return &___m_genericParameterPosition_2; } inline void set_m_genericParameterPosition_2(int32_t value) { ___m_genericParameterPosition_2 = value; } inline static int32_t get_offset_of_m_declaringType_3() { return static_cast<int32_t>(offsetof(UnitySerializationHolder_t431912834, ___m_declaringType_3)); } inline Type_t * get_m_declaringType_3() const { return ___m_declaringType_3; } inline Type_t ** get_address_of_m_declaringType_3() { return &___m_declaringType_3; } inline void set_m_declaringType_3(Type_t * value) { ___m_declaringType_3 = value; Il2CppCodeGenWriteBarrier((&___m_declaringType_3), value); } inline static int32_t get_offset_of_m_declaringMethod_4() { return static_cast<int32_t>(offsetof(UnitySerializationHolder_t431912834, ___m_declaringMethod_4)); } inline MethodBase_t * get_m_declaringMethod_4() const { return ___m_declaringMethod_4; } inline MethodBase_t ** get_address_of_m_declaringMethod_4() { return &___m_declaringMethod_4; } inline void set_m_declaringMethod_4(MethodBase_t * value) { ___m_declaringMethod_4 = value; Il2CppCodeGenWriteBarrier((&___m_declaringMethod_4), value); } inline static int32_t get_offset_of_m_data_5() { return static_cast<int32_t>(offsetof(UnitySerializationHolder_t431912834, ___m_data_5)); } inline String_t* get_m_data_5() const { return ___m_data_5; } inline String_t** get_address_of_m_data_5() { return &___m_data_5; } inline void set_m_data_5(String_t* value) { ___m_data_5 = value; Il2CppCodeGenWriteBarrier((&___m_data_5), value); } inline static int32_t get_offset_of_m_assemblyName_6() { return static_cast<int32_t>(offsetof(UnitySerializationHolder_t431912834, ___m_assemblyName_6)); } inline String_t* get_m_assemblyName_6() const { return ___m_assemblyName_6; } inline String_t** get_address_of_m_assemblyName_6() { return &___m_assemblyName_6; } inline void set_m_assemblyName_6(String_t* value) { ___m_assemblyName_6 = value; Il2CppCodeGenWriteBarrier((&___m_assemblyName_6), value); } inline static int32_t get_offset_of_m_unityType_7() { return static_cast<int32_t>(offsetof(UnitySerializationHolder_t431912834, ___m_unityType_7)); } inline int32_t get_m_unityType_7() const { return ___m_unityType_7; } inline int32_t* get_address_of_m_unityType_7() { return &___m_unityType_7; } inline void set_m_unityType_7(int32_t value) { ___m_unityType_7 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // UNITYSERIALIZATIONHOLDER_T431912834_H #ifndef EVENTARGS_T3591816995_H #define EVENTARGS_T3591816995_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.EventArgs struct EventArgs_t3591816995 : public RuntimeObject { public: public: }; struct EventArgs_t3591816995_StaticFields { public: // System.EventArgs System.EventArgs::Empty EventArgs_t3591816995 * ___Empty_0; public: inline static int32_t get_offset_of_Empty_0() { return static_cast<int32_t>(offsetof(EventArgs_t3591816995_StaticFields, ___Empty_0)); } inline EventArgs_t3591816995 * get_Empty_0() const { return ___Empty_0; } inline EventArgs_t3591816995 ** get_address_of_Empty_0() { return &___Empty_0; } inline void set_Empty_0(EventArgs_t3591816995 * value) { ___Empty_0 = value; Il2CppCodeGenWriteBarrier((&___Empty_0), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // EVENTARGS_T3591816995_H #ifndef EXCEPTION_T_H #define EXCEPTION_T_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Exception struct Exception_t : public RuntimeObject { public: // System.String System.Exception::_className String_t* ____className_1; // System.String System.Exception::_message String_t* ____message_2; // System.Collections.IDictionary System.Exception::_data RuntimeObject* ____data_3; // System.Exception System.Exception::_innerException Exception_t * ____innerException_4; // System.String System.Exception::_helpURL String_t* ____helpURL_5; // System.Object System.Exception::_stackTrace RuntimeObject * ____stackTrace_6; // System.String System.Exception::_stackTraceString String_t* ____stackTraceString_7; // System.String System.Exception::_remoteStackTraceString String_t* ____remoteStackTraceString_8; // System.Int32 System.Exception::_remoteStackIndex int32_t ____remoteStackIndex_9; // System.Object System.Exception::_dynamicMethods RuntimeObject * ____dynamicMethods_10; // System.Int32 System.Exception::_HResult int32_t ____HResult_11; // System.String System.Exception::_source String_t* ____source_12; // System.Runtime.Serialization.SafeSerializationManager System.Exception::_safeSerializationManager SafeSerializationManager_t2481557153 * ____safeSerializationManager_13; // System.Diagnostics.StackTrace[] System.Exception::captured_traces StackTraceU5BU5D_t1169129676* ___captured_traces_14; // System.IntPtr[] System.Exception::native_trace_ips IntPtrU5BU5D_t4013366056* ___native_trace_ips_15; public: inline static int32_t get_offset_of__className_1() { return static_cast<int32_t>(offsetof(Exception_t, ____className_1)); } inline String_t* get__className_1() const { return ____className_1; } inline String_t** get_address_of__className_1() { return &____className_1; } inline void set__className_1(String_t* value) { ____className_1 = value; Il2CppCodeGenWriteBarrier((&____className_1), value); } inline static int32_t get_offset_of__message_2() { return static_cast<int32_t>(offsetof(Exception_t, ____message_2)); } inline String_t* get__message_2() const { return ____message_2; } inline String_t** get_address_of__message_2() { return &____message_2; } inline void set__message_2(String_t* value) { ____message_2 = value; Il2CppCodeGenWriteBarrier((&____message_2), value); } inline static int32_t get_offset_of__data_3() { return static_cast<int32_t>(offsetof(Exception_t, ____data_3)); } inline RuntimeObject* get__data_3() const { return ____data_3; } inline RuntimeObject** get_address_of__data_3() { return &____data_3; } inline void set__data_3(RuntimeObject* value) { ____data_3 = value; Il2CppCodeGenWriteBarrier((&____data_3), value); } inline static int32_t get_offset_of__innerException_4() { return static_cast<int32_t>(offsetof(Exception_t, ____innerException_4)); } inline Exception_t * get__innerException_4() const { return ____innerException_4; } inline Exception_t ** get_address_of__innerException_4() { return &____innerException_4; } inline void set__innerException_4(Exception_t * value) { ____innerException_4 = value; Il2CppCodeGenWriteBarrier((&____innerException_4), value); } inline static int32_t get_offset_of__helpURL_5() { return static_cast<int32_t>(offsetof(Exception_t, ____helpURL_5)); } inline String_t* get__helpURL_5() const { return ____helpURL_5; } inline String_t** get_address_of__helpURL_5() { return &____helpURL_5; } inline void set__helpURL_5(String_t* value) { ____helpURL_5 = value; Il2CppCodeGenWriteBarrier((&____helpURL_5), value); } inline static int32_t get_offset_of__stackTrace_6() { return static_cast<int32_t>(offsetof(Exception_t, ____stackTrace_6)); } inline RuntimeObject * get__stackTrace_6() const { return ____stackTrace_6; } inline RuntimeObject ** get_address_of__stackTrace_6() { return &____stackTrace_6; } inline void set__stackTrace_6(RuntimeObject * value) { ____stackTrace_6 = value; Il2CppCodeGenWriteBarrier((&____stackTrace_6), value); } inline static int32_t get_offset_of__stackTraceString_7() { return static_cast<int32_t>(offsetof(Exception_t, ____stackTraceString_7)); } inline String_t* get__stackTraceString_7() const { return ____stackTraceString_7; } inline String_t** get_address_of__stackTraceString_7() { return &____stackTraceString_7; } inline void set__stackTraceString_7(String_t* value) { ____stackTraceString_7 = value; Il2CppCodeGenWriteBarrier((&____stackTraceString_7), value); } inline static int32_t get_offset_of__remoteStackTraceString_8() { return static_cast<int32_t>(offsetof(Exception_t, ____remoteStackTraceString_8)); } inline String_t* get__remoteStackTraceString_8() const { return ____remoteStackTraceString_8; } inline String_t** get_address_of__remoteStackTraceString_8() { return &____remoteStackTraceString_8; } inline void set__remoteStackTraceString_8(String_t* value) { ____remoteStackTraceString_8 = value; Il2CppCodeGenWriteBarrier((&____remoteStackTraceString_8), value); } inline static int32_t get_offset_of__remoteStackIndex_9() { return static_cast<int32_t>(offsetof(Exception_t, ____remoteStackIndex_9)); } inline int32_t get__remoteStackIndex_9() const { return ____remoteStackIndex_9; } inline int32_t* get_address_of__remoteStackIndex_9() { return &____remoteStackIndex_9; } inline void set__remoteStackIndex_9(int32_t value) { ____remoteStackIndex_9 = value; } inline static int32_t get_offset_of__dynamicMethods_10() { return static_cast<int32_t>(offsetof(Exception_t, ____dynamicMethods_10)); } inline RuntimeObject * get__dynamicMethods_10() const { return ____dynamicMethods_10; } inline RuntimeObject ** get_address_of__dynamicMethods_10() { return &____dynamicMethods_10; } inline void set__dynamicMethods_10(RuntimeObject * value) { ____dynamicMethods_10 = value; Il2CppCodeGenWriteBarrier((&____dynamicMethods_10), value); } inline static int32_t get_offset_of__HResult_11() { return static_cast<int32_t>(offsetof(Exception_t, ____HResult_11)); } inline int32_t get__HResult_11() const { return ____HResult_11; } inline int32_t* get_address_of__HResult_11() { return &____HResult_11; } inline void set__HResult_11(int32_t value) { ____HResult_11 = value; } inline static int32_t get_offset_of__source_12() { return static_cast<int32_t>(offsetof(Exception_t, ____source_12)); } inline String_t* get__source_12() const { return ____source_12; } inline String_t** get_address_of__source_12() { return &____source_12; } inline void set__source_12(String_t* value) { ____source_12 = value; Il2CppCodeGenWriteBarrier((&____source_12), value); } inline static int32_t get_offset_of__safeSerializationManager_13() { return static_cast<int32_t>(offsetof(Exception_t, ____safeSerializationManager_13)); } inline SafeSerializationManager_t2481557153 * get__safeSerializationManager_13() const { return ____safeSerializationManager_13; } inline SafeSerializationManager_t2481557153 ** get_address_of__safeSerializationManager_13() { return &____safeSerializationManager_13; } inline void set__safeSerializationManager_13(SafeSerializationManager_t2481557153 * value) { ____safeSerializationManager_13 = value; Il2CppCodeGenWriteBarrier((&____safeSerializationManager_13), value); } inline static int32_t get_offset_of_captured_traces_14() { return static_cast<int32_t>(offsetof(Exception_t, ___captured_traces_14)); } inline StackTraceU5BU5D_t1169129676* get_captured_traces_14() const { return ___captured_traces_14; } inline StackTraceU5BU5D_t1169129676** get_address_of_captured_traces_14() { return &___captured_traces_14; } inline void set_captured_traces_14(StackTraceU5BU5D_t1169129676* value) { ___captured_traces_14 = value; Il2CppCodeGenWriteBarrier((&___captured_traces_14), value); } inline static int32_t get_offset_of_native_trace_ips_15() { return static_cast<int32_t>(offsetof(Exception_t, ___native_trace_ips_15)); } inline IntPtrU5BU5D_t4013366056* get_native_trace_ips_15() const { return ___native_trace_ips_15; } inline IntPtrU5BU5D_t4013366056** get_address_of_native_trace_ips_15() { return &___native_trace_ips_15; } inline void set_native_trace_ips_15(IntPtrU5BU5D_t4013366056* value) { ___native_trace_ips_15 = value; Il2CppCodeGenWriteBarrier((&___native_trace_ips_15), value); } }; struct Exception_t_StaticFields { public: // System.Object System.Exception::s_EDILock RuntimeObject * ___s_EDILock_0; public: inline static int32_t get_offset_of_s_EDILock_0() { return static_cast<int32_t>(offsetof(Exception_t_StaticFields, ___s_EDILock_0)); } inline RuntimeObject * get_s_EDILock_0() const { return ___s_EDILock_0; } inline RuntimeObject ** get_address_of_s_EDILock_0() { return &___s_EDILock_0; } inline void set_s_EDILock_0(RuntimeObject * value) { ___s_EDILock_0 = value; Il2CppCodeGenWriteBarrier((&___s_EDILock_0), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif // Native definition for P/Invoke marshalling of System.Exception struct Exception_t_marshaled_pinvoke { char* ____className_1; char* ____message_2; RuntimeObject* ____data_3; Exception_t_marshaled_pinvoke* ____innerException_4; char* ____helpURL_5; Il2CppIUnknown* ____stackTrace_6; char* ____stackTraceString_7; char* ____remoteStackTraceString_8; int32_t ____remoteStackIndex_9; Il2CppIUnknown* ____dynamicMethods_10; int32_t ____HResult_11; char* ____source_12; SafeSerializationManager_t2481557153 * ____safeSerializationManager_13; StackTraceU5BU5D_t1169129676* ___captured_traces_14; intptr_t* ___native_trace_ips_15; }; // Native definition for COM marshalling of System.Exception struct Exception_t_marshaled_com { Il2CppChar* ____className_1; Il2CppChar* ____message_2; RuntimeObject* ____data_3; Exception_t_marshaled_com* ____innerException_4; Il2CppChar* ____helpURL_5; Il2CppIUnknown* ____stackTrace_6; Il2CppChar* ____stackTraceString_7; Il2CppChar* ____remoteStackTraceString_8; int32_t ____remoteStackIndex_9; Il2CppIUnknown* ____dynamicMethods_10; int32_t ____HResult_11; Il2CppChar* ____source_12; SafeSerializationManager_t2481557153 * ____safeSerializationManager_13; StackTraceU5BU5D_t1169129676* ___captured_traces_14; intptr_t* ___native_trace_ips_15; }; #endif // EXCEPTION_T_H #ifndef CFHELPERS_T2851749608_H #define CFHELPERS_T2851749608_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // XamMac.CoreFoundation.CFHelpers struct CFHelpers_t2851749608 : public RuntimeObject { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CFHELPERS_T2851749608_H #ifndef SERIALIZATIONINFO_T950877179_H #define SERIALIZATIONINFO_T950877179_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Serialization.SerializationInfo struct SerializationInfo_t950877179 : public RuntimeObject { public: // System.String[] System.Runtime.Serialization.SerializationInfo::m_members StringU5BU5D_t1281789340* ___m_members_0; // System.Object[] System.Runtime.Serialization.SerializationInfo::m_data ObjectU5BU5D_t2843939325* ___m_data_1; // System.Type[] System.Runtime.Serialization.SerializationInfo::m_types TypeU5BU5D_t3940880105* ___m_types_2; // System.Collections.Generic.Dictionary`2<System.String,System.Int32> System.Runtime.Serialization.SerializationInfo::m_nameToIndex Dictionary_2_t2736202052 * ___m_nameToIndex_3; // System.Int32 System.Runtime.Serialization.SerializationInfo::m_currMember int32_t ___m_currMember_4; // System.Runtime.Serialization.IFormatterConverter System.Runtime.Serialization.SerializationInfo::m_converter RuntimeObject* ___m_converter_5; // System.String System.Runtime.Serialization.SerializationInfo::m_fullTypeName String_t* ___m_fullTypeName_6; // System.String System.Runtime.Serialization.SerializationInfo::m_assemName String_t* ___m_assemName_7; // System.Type System.Runtime.Serialization.SerializationInfo::objectType Type_t * ___objectType_8; // System.Boolean System.Runtime.Serialization.SerializationInfo::isFullTypeNameSetExplicit bool ___isFullTypeNameSetExplicit_9; // System.Boolean System.Runtime.Serialization.SerializationInfo::isAssemblyNameSetExplicit bool ___isAssemblyNameSetExplicit_10; // System.Boolean System.Runtime.Serialization.SerializationInfo::requireSameTokenInPartialTrust bool ___requireSameTokenInPartialTrust_11; public: inline static int32_t get_offset_of_m_members_0() { return static_cast<int32_t>(offsetof(SerializationInfo_t950877179, ___m_members_0)); } inline StringU5BU5D_t1281789340* get_m_members_0() const { return ___m_members_0; } inline StringU5BU5D_t1281789340** get_address_of_m_members_0() { return &___m_members_0; } inline void set_m_members_0(StringU5BU5D_t1281789340* value) { ___m_members_0 = value; Il2CppCodeGenWriteBarrier((&___m_members_0), value); } inline static int32_t get_offset_of_m_data_1() { return static_cast<int32_t>(offsetof(SerializationInfo_t950877179, ___m_data_1)); } inline ObjectU5BU5D_t2843939325* get_m_data_1() const { return ___m_data_1; } inline ObjectU5BU5D_t2843939325** get_address_of_m_data_1() { return &___m_data_1; } inline void set_m_data_1(ObjectU5BU5D_t2843939325* value) { ___m_data_1 = value; Il2CppCodeGenWriteBarrier((&___m_data_1), value); } inline static int32_t get_offset_of_m_types_2() { return static_cast<int32_t>(offsetof(SerializationInfo_t950877179, ___m_types_2)); } inline TypeU5BU5D_t3940880105* get_m_types_2() const { return ___m_types_2; } inline TypeU5BU5D_t3940880105** get_address_of_m_types_2() { return &___m_types_2; } inline void set_m_types_2(TypeU5BU5D_t3940880105* value) { ___m_types_2 = value; Il2CppCodeGenWriteBarrier((&___m_types_2), value); } inline static int32_t get_offset_of_m_nameToIndex_3() { return static_cast<int32_t>(offsetof(SerializationInfo_t950877179, ___m_nameToIndex_3)); } inline Dictionary_2_t2736202052 * get_m_nameToIndex_3() const { return ___m_nameToIndex_3; } inline Dictionary_2_t2736202052 ** get_address_of_m_nameToIndex_3() { return &___m_nameToIndex_3; } inline void set_m_nameToIndex_3(Dictionary_2_t2736202052 * value) { ___m_nameToIndex_3 = value; Il2CppCodeGenWriteBarrier((&___m_nameToIndex_3), value); } inline static int32_t get_offset_of_m_currMember_4() { return static_cast<int32_t>(offsetof(SerializationInfo_t950877179, ___m_currMember_4)); } inline int32_t get_m_currMember_4() const { return ___m_currMember_4; } inline int32_t* get_address_of_m_currMember_4() { return &___m_currMember_4; } inline void set_m_currMember_4(int32_t value) { ___m_currMember_4 = value; } inline static int32_t get_offset_of_m_converter_5() { return static_cast<int32_t>(offsetof(SerializationInfo_t950877179, ___m_converter_5)); } inline RuntimeObject* get_m_converter_5() const { return ___m_converter_5; } inline RuntimeObject** get_address_of_m_converter_5() { return &___m_converter_5; } inline void set_m_converter_5(RuntimeObject* value) { ___m_converter_5 = value; Il2CppCodeGenWriteBarrier((&___m_converter_5), value); } inline static int32_t get_offset_of_m_fullTypeName_6() { return static_cast<int32_t>(offsetof(SerializationInfo_t950877179, ___m_fullTypeName_6)); } inline String_t* get_m_fullTypeName_6() const { return ___m_fullTypeName_6; } inline String_t** get_address_of_m_fullTypeName_6() { return &___m_fullTypeName_6; } inline void set_m_fullTypeName_6(String_t* value) { ___m_fullTypeName_6 = value; Il2CppCodeGenWriteBarrier((&___m_fullTypeName_6), value); } inline static int32_t get_offset_of_m_assemName_7() { return static_cast<int32_t>(offsetof(SerializationInfo_t950877179, ___m_assemName_7)); } inline String_t* get_m_assemName_7() const { return ___m_assemName_7; } inline String_t** get_address_of_m_assemName_7() { return &___m_assemName_7; } inline void set_m_assemName_7(String_t* value) { ___m_assemName_7 = value; Il2CppCodeGenWriteBarrier((&___m_assemName_7), value); } inline static int32_t get_offset_of_objectType_8() { return static_cast<int32_t>(offsetof(SerializationInfo_t950877179, ___objectType_8)); } inline Type_t * get_objectType_8() const { return ___objectType_8; } inline Type_t ** get_address_of_objectType_8() { return &___objectType_8; } inline void set_objectType_8(Type_t * value) { ___objectType_8 = value; Il2CppCodeGenWriteBarrier((&___objectType_8), value); } inline static int32_t get_offset_of_isFullTypeNameSetExplicit_9() { return static_cast<int32_t>(offsetof(SerializationInfo_t950877179, ___isFullTypeNameSetExplicit_9)); } inline bool get_isFullTypeNameSetExplicit_9() const { return ___isFullTypeNameSetExplicit_9; } inline bool* get_address_of_isFullTypeNameSetExplicit_9() { return &___isFullTypeNameSetExplicit_9; } inline void set_isFullTypeNameSetExplicit_9(bool value) { ___isFullTypeNameSetExplicit_9 = value; } inline static int32_t get_offset_of_isAssemblyNameSetExplicit_10() { return static_cast<int32_t>(offsetof(SerializationInfo_t950877179, ___isAssemblyNameSetExplicit_10)); } inline bool get_isAssemblyNameSetExplicit_10() const { return ___isAssemblyNameSetExplicit_10; } inline bool* get_address_of_isAssemblyNameSetExplicit_10() { return &___isAssemblyNameSetExplicit_10; } inline void set_isAssemblyNameSetExplicit_10(bool value) { ___isAssemblyNameSetExplicit_10 = value; } inline static int32_t get_offset_of_requireSameTokenInPartialTrust_11() { return static_cast<int32_t>(offsetof(SerializationInfo_t950877179, ___requireSameTokenInPartialTrust_11)); } inline bool get_requireSameTokenInPartialTrust_11() const { return ___requireSameTokenInPartialTrust_11; } inline bool* get_address_of_requireSameTokenInPartialTrust_11() { return &___requireSameTokenInPartialTrust_11; } inline void set_requireSameTokenInPartialTrust_11(bool value) { ___requireSameTokenInPartialTrust_11 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // SERIALIZATIONINFO_T950877179_H #ifndef HASHHELPERS_T1653534276_H #define HASHHELPERS_T1653534276_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Numerics.Hashing.HashHelpers struct HashHelpers_t1653534276 : public RuntimeObject { public: public: }; struct HashHelpers_t1653534276_StaticFields { public: // System.Int32 System.Numerics.Hashing.HashHelpers::RandomSeed int32_t ___RandomSeed_0; public: inline static int32_t get_offset_of_RandomSeed_0() { return static_cast<int32_t>(offsetof(HashHelpers_t1653534276_StaticFields, ___RandomSeed_0)); } inline int32_t get_RandomSeed_0() const { return ___RandomSeed_0; } inline int32_t* get_address_of_RandomSeed_0() { return &___RandomSeed_0; } inline void set_RandomSeed_0(int32_t value) { ___RandomSeed_0 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // HASHHELPERS_T1653534276_H #ifndef STRING_T_H #define STRING_T_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.String struct String_t : public RuntimeObject { public: // System.Int32 System.String::m_stringLength int32_t ___m_stringLength_0; // System.Char System.String::m_firstChar Il2CppChar ___m_firstChar_1; public: inline static int32_t get_offset_of_m_stringLength_0() { return static_cast<int32_t>(offsetof(String_t, ___m_stringLength_0)); } inline int32_t get_m_stringLength_0() const { return ___m_stringLength_0; } inline int32_t* get_address_of_m_stringLength_0() { return &___m_stringLength_0; } inline void set_m_stringLength_0(int32_t value) { ___m_stringLength_0 = value; } inline static int32_t get_offset_of_m_firstChar_1() { return static_cast<int32_t>(offsetof(String_t, ___m_firstChar_1)); } inline Il2CppChar get_m_firstChar_1() const { return ___m_firstChar_1; } inline Il2CppChar* get_address_of_m_firstChar_1() { return &___m_firstChar_1; } inline void set_m_firstChar_1(Il2CppChar value) { ___m_firstChar_1 = value; } }; struct String_t_StaticFields { public: // System.String System.String::Empty String_t* ___Empty_5; public: inline static int32_t get_offset_of_Empty_5() { return static_cast<int32_t>(offsetof(String_t_StaticFields, ___Empty_5)); } inline String_t* get_Empty_5() const { return ___Empty_5; } inline String_t** get_address_of_Empty_5() { return &___Empty_5; } inline void set_Empty_5(String_t* value) { ___Empty_5 = value; Il2CppCodeGenWriteBarrier((&___Empty_5), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // STRING_T_H #ifndef INT64_T3736567304_H #define INT64_T3736567304_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Int64 struct Int64_t3736567304 { public: // System.Int64 System.Int64::m_value int64_t ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Int64_t3736567304, ___m_value_0)); } inline int64_t get_m_value_0() const { return ___m_value_0; } inline int64_t* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(int64_t value) { ___m_value_0 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // INT64_T3736567304_H #ifndef GCHANDLE_T3351438187_H #define GCHANDLE_T3351438187_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.InteropServices.GCHandle struct GCHandle_t3351438187 { public: // System.Int32 System.Runtime.InteropServices.GCHandle::handle int32_t ___handle_0; public: inline static int32_t get_offset_of_handle_0() { return static_cast<int32_t>(offsetof(GCHandle_t3351438187, ___handle_0)); } inline int32_t get_handle_0() const { return ___handle_0; } inline int32_t* get_address_of_handle_0() { return &___handle_0; } inline void set_handle_0(int32_t value) { ___handle_0 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // GCHANDLE_T3351438187_H #ifndef SMALLRECT_T2930836963_H #define SMALLRECT_T2930836963_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.SmallRect struct SmallRect_t2930836963 { public: // System.Int16 System.SmallRect::Left int16_t ___Left_0; // System.Int16 System.SmallRect::Top int16_t ___Top_1; // System.Int16 System.SmallRect::Right int16_t ___Right_2; // System.Int16 System.SmallRect::Bottom int16_t ___Bottom_3; public: inline static int32_t get_offset_of_Left_0() { return static_cast<int32_t>(offsetof(SmallRect_t2930836963, ___Left_0)); } inline int16_t get_Left_0() const { return ___Left_0; } inline int16_t* get_address_of_Left_0() { return &___Left_0; } inline void set_Left_0(int16_t value) { ___Left_0 = value; } inline static int32_t get_offset_of_Top_1() { return static_cast<int32_t>(offsetof(SmallRect_t2930836963, ___Top_1)); } inline int16_t get_Top_1() const { return ___Top_1; } inline int16_t* get_address_of_Top_1() { return &___Top_1; } inline void set_Top_1(int16_t value) { ___Top_1 = value; } inline static int32_t get_offset_of_Right_2() { return static_cast<int32_t>(offsetof(SmallRect_t2930836963, ___Right_2)); } inline int16_t get_Right_2() const { return ___Right_2; } inline int16_t* get_address_of_Right_2() { return &___Right_2; } inline void set_Right_2(int16_t value) { ___Right_2 = value; } inline static int32_t get_offset_of_Bottom_3() { return static_cast<int32_t>(offsetof(SmallRect_t2930836963, ___Bottom_3)); } inline int16_t get_Bottom_3() const { return ___Bottom_3; } inline int16_t* get_address_of_Bottom_3() { return &___Bottom_3; } inline void set_Bottom_3(int16_t value) { ___Bottom_3 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // SMALLRECT_T2930836963_H #ifndef VOID_T1185182177_H #define VOID_T1185182177_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Void struct Void_t1185182177 { public: union { struct { }; uint8_t Void_t1185182177__padding[1]; }; public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // VOID_T1185182177_H #ifndef COORD_T397375283_H #define COORD_T397375283_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Coord struct Coord_t397375283 { public: // System.Int16 System.Coord::X int16_t ___X_0; // System.Int16 System.Coord::Y int16_t ___Y_1; public: inline static int32_t get_offset_of_X_0() { return static_cast<int32_t>(offsetof(Coord_t397375283, ___X_0)); } inline int16_t get_X_0() const { return ___X_0; } inline int16_t* get_address_of_X_0() { return &___X_0; } inline void set_X_0(int16_t value) { ___X_0 = value; } inline static int32_t get_offset_of_Y_1() { return static_cast<int32_t>(offsetof(Coord_t397375283, ___Y_1)); } inline int16_t get_Y_1() const { return ___Y_1; } inline int16_t* get_address_of_Y_1() { return &___Y_1; } inline void set_Y_1(int16_t value) { ___Y_1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // COORD_T397375283_H #ifndef INT32_T2950945753_H #define INT32_T2950945753_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Int32 struct Int32_t2950945753 { public: // System.Int32 System.Int32::m_value int32_t ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Int32_t2950945753, ___m_value_0)); } inline int32_t get_m_value_0() const { return ___m_value_0; } inline int32_t* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(int32_t value) { ___m_value_0 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // INT32_T2950945753_H #ifndef UINT16_T2177724958_H #define UINT16_T2177724958_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.UInt16 struct UInt16_t2177724958 { public: // System.UInt16 System.UInt16::m_value uint16_t ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(UInt16_t2177724958, ___m_value_0)); } inline uint16_t get_m_value_0() const { return ___m_value_0; } inline uint16_t* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(uint16_t value) { ___m_value_0 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // UINT16_T2177724958_H #ifndef INTPTR_T_H #define INTPTR_T_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.IntPtr struct IntPtr_t { public: // System.Void* System.IntPtr::m_value void* ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(IntPtr_t, ___m_value_0)); } inline void* get_m_value_0() const { return ___m_value_0; } inline void** get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(void* value) { ___m_value_0 = value; } }; struct IntPtr_t_StaticFields { public: // System.IntPtr System.IntPtr::Zero intptr_t ___Zero_1; public: inline static int32_t get_offset_of_Zero_1() { return static_cast<int32_t>(offsetof(IntPtr_t_StaticFields, ___Zero_1)); } inline intptr_t get_Zero_1() const { return ___Zero_1; } inline intptr_t* get_address_of_Zero_1() { return &___Zero_1; } inline void set_Zero_1(intptr_t value) { ___Zero_1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // INTPTR_T_H #ifndef INPUTRECORD_T2660212290_H #define INPUTRECORD_T2660212290_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.InputRecord struct InputRecord_t2660212290 { public: // System.Int16 System.InputRecord::EventType int16_t ___EventType_0; // System.Boolean System.InputRecord::KeyDown bool ___KeyDown_1; // System.Int16 System.InputRecord::RepeatCount int16_t ___RepeatCount_2; // System.Int16 System.InputRecord::VirtualKeyCode int16_t ___VirtualKeyCode_3; // System.Int16 System.InputRecord::VirtualScanCode int16_t ___VirtualScanCode_4; // System.Char System.InputRecord::Character Il2CppChar ___Character_5; // System.Int32 System.InputRecord::ControlKeyState int32_t ___ControlKeyState_6; // System.Int32 System.InputRecord::pad1 int32_t ___pad1_7; // System.Boolean System.InputRecord::pad2 bool ___pad2_8; public: inline static int32_t get_offset_of_EventType_0() { return static_cast<int32_t>(offsetof(InputRecord_t2660212290, ___EventType_0)); } inline int16_t get_EventType_0() const { return ___EventType_0; } inline int16_t* get_address_of_EventType_0() { return &___EventType_0; } inline void set_EventType_0(int16_t value) { ___EventType_0 = value; } inline static int32_t get_offset_of_KeyDown_1() { return static_cast<int32_t>(offsetof(InputRecord_t2660212290, ___KeyDown_1)); } inline bool get_KeyDown_1() const { return ___KeyDown_1; } inline bool* get_address_of_KeyDown_1() { return &___KeyDown_1; } inline void set_KeyDown_1(bool value) { ___KeyDown_1 = value; } inline static int32_t get_offset_of_RepeatCount_2() { return static_cast<int32_t>(offsetof(InputRecord_t2660212290, ___RepeatCount_2)); } inline int16_t get_RepeatCount_2() const { return ___RepeatCount_2; } inline int16_t* get_address_of_RepeatCount_2() { return &___RepeatCount_2; } inline void set_RepeatCount_2(int16_t value) { ___RepeatCount_2 = value; } inline static int32_t get_offset_of_VirtualKeyCode_3() { return static_cast<int32_t>(offsetof(InputRecord_t2660212290, ___VirtualKeyCode_3)); } inline int16_t get_VirtualKeyCode_3() const { return ___VirtualKeyCode_3; } inline int16_t* get_address_of_VirtualKeyCode_3() { return &___VirtualKeyCode_3; } inline void set_VirtualKeyCode_3(int16_t value) { ___VirtualKeyCode_3 = value; } inline static int32_t get_offset_of_VirtualScanCode_4() { return static_cast<int32_t>(offsetof(InputRecord_t2660212290, ___VirtualScanCode_4)); } inline int16_t get_VirtualScanCode_4() const { return ___VirtualScanCode_4; } inline int16_t* get_address_of_VirtualScanCode_4() { return &___VirtualScanCode_4; } inline void set_VirtualScanCode_4(int16_t value) { ___VirtualScanCode_4 = value; } inline static int32_t get_offset_of_Character_5() { return static_cast<int32_t>(offsetof(InputRecord_t2660212290, ___Character_5)); } inline Il2CppChar get_Character_5() const { return ___Character_5; } inline Il2CppChar* get_address_of_Character_5() { return &___Character_5; } inline void set_Character_5(Il2CppChar value) { ___Character_5 = value; } inline static int32_t get_offset_of_ControlKeyState_6() { return static_cast<int32_t>(offsetof(InputRecord_t2660212290, ___ControlKeyState_6)); } inline int32_t get_ControlKeyState_6() const { return ___ControlKeyState_6; } inline int32_t* get_address_of_ControlKeyState_6() { return &___ControlKeyState_6; } inline void set_ControlKeyState_6(int32_t value) { ___ControlKeyState_6 = value; } inline static int32_t get_offset_of_pad1_7() { return static_cast<int32_t>(offsetof(InputRecord_t2660212290, ___pad1_7)); } inline int32_t get_pad1_7() const { return ___pad1_7; } inline int32_t* get_address_of_pad1_7() { return &___pad1_7; } inline void set_pad1_7(int32_t value) { ___pad1_7 = value; } inline static int32_t get_offset_of_pad2_8() { return static_cast<int32_t>(offsetof(InputRecord_t2660212290, ___pad2_8)); } inline bool get_pad2_8() const { return ___pad2_8; } inline bool* get_address_of_pad2_8() { return &___pad2_8; } inline void set_pad2_8(bool value) { ___pad2_8 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif // Native definition for P/Invoke marshalling of System.InputRecord struct InputRecord_t2660212290_marshaled_pinvoke { int16_t ___EventType_0; int32_t ___KeyDown_1; int16_t ___RepeatCount_2; int16_t ___VirtualKeyCode_3; int16_t ___VirtualScanCode_4; uint8_t ___Character_5; int32_t ___ControlKeyState_6; int32_t ___pad1_7; int32_t ___pad2_8; }; // Native definition for COM marshalling of System.InputRecord struct InputRecord_t2660212290_marshaled_com { int16_t ___EventType_0; int32_t ___KeyDown_1; int16_t ___RepeatCount_2; int16_t ___VirtualKeyCode_3; int16_t ___VirtualScanCode_4; uint8_t ___Character_5; int32_t ___ControlKeyState_6; int32_t ___pad1_7; int32_t ___pad2_8; }; #endif // INPUTRECORD_T2660212290_H #ifndef CHAR_T3634460470_H #define CHAR_T3634460470_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Char struct Char_t3634460470 { public: // System.Char System.Char::m_value Il2CppChar ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Char_t3634460470, ___m_value_0)); } inline Il2CppChar get_m_value_0() const { return ___m_value_0; } inline Il2CppChar* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(Il2CppChar value) { ___m_value_0 = value; } }; struct Char_t3634460470_StaticFields { public: // System.Byte[] System.Char::categoryForLatin1 ByteU5BU5D_t4116647657* ___categoryForLatin1_3; public: inline static int32_t get_offset_of_categoryForLatin1_3() { return static_cast<int32_t>(offsetof(Char_t3634460470_StaticFields, ___categoryForLatin1_3)); } inline ByteU5BU5D_t4116647657* get_categoryForLatin1_3() const { return ___categoryForLatin1_3; } inline ByteU5BU5D_t4116647657** get_address_of_categoryForLatin1_3() { return &___categoryForLatin1_3; } inline void set_categoryForLatin1_3(ByteU5BU5D_t4116647657* value) { ___categoryForLatin1_3 = value; Il2CppCodeGenWriteBarrier((&___categoryForLatin1_3), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CHAR_T3634460470_H #ifndef UNHANDLEDEXCEPTIONEVENTARGS_T2886101344_H #define UNHANDLEDEXCEPTIONEVENTARGS_T2886101344_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.UnhandledExceptionEventArgs struct UnhandledExceptionEventArgs_t2886101344 : public EventArgs_t3591816995 { public: // System.Object System.UnhandledExceptionEventArgs::_Exception RuntimeObject * ____Exception_1; // System.Boolean System.UnhandledExceptionEventArgs::_IsTerminating bool ____IsTerminating_2; public: inline static int32_t get_offset_of__Exception_1() { return static_cast<int32_t>(offsetof(UnhandledExceptionEventArgs_t2886101344, ____Exception_1)); } inline RuntimeObject * get__Exception_1() const { return ____Exception_1; } inline RuntimeObject ** get_address_of__Exception_1() { return &____Exception_1; } inline void set__Exception_1(RuntimeObject * value) { ____Exception_1 = value; Il2CppCodeGenWriteBarrier((&____Exception_1), value); } inline static int32_t get_offset_of__IsTerminating_2() { return static_cast<int32_t>(offsetof(UnhandledExceptionEventArgs_t2886101344, ____IsTerminating_2)); } inline bool get__IsTerminating_2() const { return ____IsTerminating_2; } inline bool* get_address_of__IsTerminating_2() { return &____IsTerminating_2; } inline void set__IsTerminating_2(bool value) { ____IsTerminating_2 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // UNHANDLEDEXCEPTIONEVENTARGS_T2886101344_H #ifndef METHODBASE_T_H #define METHODBASE_T_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Reflection.MethodBase struct MethodBase_t : public MemberInfo_t { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // METHODBASE_T_H #ifndef SBYTE_T1669577662_H #define SBYTE_T1669577662_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.SByte struct SByte_t1669577662 { public: // System.SByte System.SByte::m_value int8_t ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(SByte_t1669577662, ___m_value_0)); } inline int8_t get_m_value_0() const { return ___m_value_0; } inline int8_t* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(int8_t value) { ___m_value_0 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // SBYTE_T1669577662_H #ifndef UNSAFECHARBUFFER_T2176740272_H #define UNSAFECHARBUFFER_T2176740272_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.UnSafeCharBuffer struct UnSafeCharBuffer_t2176740272 { public: // System.Char* System.UnSafeCharBuffer::m_buffer Il2CppChar* ___m_buffer_0; // System.Int32 System.UnSafeCharBuffer::m_totalSize int32_t ___m_totalSize_1; // System.Int32 System.UnSafeCharBuffer::m_length int32_t ___m_length_2; public: inline static int32_t get_offset_of_m_buffer_0() { return static_cast<int32_t>(offsetof(UnSafeCharBuffer_t2176740272, ___m_buffer_0)); } inline Il2CppChar* get_m_buffer_0() const { return ___m_buffer_0; } inline Il2CppChar** get_address_of_m_buffer_0() { return &___m_buffer_0; } inline void set_m_buffer_0(Il2CppChar* value) { ___m_buffer_0 = value; } inline static int32_t get_offset_of_m_totalSize_1() { return static_cast<int32_t>(offsetof(UnSafeCharBuffer_t2176740272, ___m_totalSize_1)); } inline int32_t get_m_totalSize_1() const { return ___m_totalSize_1; } inline int32_t* get_address_of_m_totalSize_1() { return &___m_totalSize_1; } inline void set_m_totalSize_1(int32_t value) { ___m_totalSize_1 = value; } inline static int32_t get_offset_of_m_length_2() { return static_cast<int32_t>(offsetof(UnSafeCharBuffer_t2176740272, ___m_length_2)); } inline int32_t get_m_length_2() const { return ___m_length_2; } inline int32_t* get_address_of_m_length_2() { return &___m_length_2; } inline void set_m_length_2(int32_t value) { ___m_length_2 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif // Native definition for P/Invoke marshalling of System.UnSafeCharBuffer struct UnSafeCharBuffer_t2176740272_marshaled_pinvoke { Il2CppChar* ___m_buffer_0; int32_t ___m_totalSize_1; int32_t ___m_length_2; }; // Native definition for COM marshalling of System.UnSafeCharBuffer struct UnSafeCharBuffer_t2176740272_marshaled_com { Il2CppChar* ___m_buffer_0; int32_t ___m_totalSize_1; int32_t ___m_length_2; }; #endif // UNSAFECHARBUFFER_T2176740272_H #ifndef VALUETUPLE_T3168505507_H #define VALUETUPLE_T3168505507_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.ValueTuple struct ValueTuple_t3168505507 { public: union { struct { }; uint8_t ValueTuple_t3168505507__padding[1]; }; public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // VALUETUPLE_T3168505507_H #ifndef BYTE_T1134296376_H #define BYTE_T1134296376_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Byte struct Byte_t1134296376 { public: // System.Byte System.Byte::m_value uint8_t ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Byte_t1134296376, ___m_value_0)); } inline uint8_t get_m_value_0() const { return ___m_value_0; } inline uint8_t* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(uint8_t value) { ___m_value_0 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // BYTE_T1134296376_H #ifndef INT16_T2552820387_H #define INT16_T2552820387_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Int16 struct Int16_t2552820387 { public: // System.Int16 System.Int16::m_value int16_t ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Int16_t2552820387, ___m_value_0)); } inline int16_t get_m_value_0() const { return ___m_value_0; } inline int16_t* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(int16_t value) { ___m_value_0 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // INT16_T2552820387_H #ifndef UINTPTR_T_H #define UINTPTR_T_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.UIntPtr struct UIntPtr_t { public: // System.Void* System.UIntPtr::_pointer void* ____pointer_1; public: inline static int32_t get_offset_of__pointer_1() { return static_cast<int32_t>(offsetof(UIntPtr_t, ____pointer_1)); } inline void* get__pointer_1() const { return ____pointer_1; } inline void** get_address_of__pointer_1() { return &____pointer_1; } inline void set__pointer_1(void* value) { ____pointer_1 = value; } }; struct UIntPtr_t_StaticFields { public: // System.UIntPtr System.UIntPtr::Zero uintptr_t ___Zero_0; public: inline static int32_t get_offset_of_Zero_0() { return static_cast<int32_t>(offsetof(UIntPtr_t_StaticFields, ___Zero_0)); } inline uintptr_t get_Zero_0() const { return ___Zero_0; } inline uintptr_t* get_address_of_Zero_0() { return &___Zero_0; } inline void set_Zero_0(uintptr_t value) { ___Zero_0 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // UINTPTR_T_H #ifndef UINT32_T2560061978_H #define UINT32_T2560061978_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.UInt32 struct UInt32_t2560061978 { public: // System.UInt32 System.UInt32::m_value uint32_t ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(UInt32_t2560061978, ___m_value_0)); } inline uint32_t get_m_value_0() const { return ___m_value_0; } inline uint32_t* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(uint32_t value) { ___m_value_0 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // UINT32_T2560061978_H #ifndef ENUM_T4135868527_H #define ENUM_T4135868527_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Enum struct Enum_t4135868527 : public ValueType_t3640485471 { public: public: }; struct Enum_t4135868527_StaticFields { public: // System.Char[] System.Enum::enumSeperatorCharArray CharU5BU5D_t3528271667* ___enumSeperatorCharArray_0; public: inline static int32_t get_offset_of_enumSeperatorCharArray_0() { return static_cast<int32_t>(offsetof(Enum_t4135868527_StaticFields, ___enumSeperatorCharArray_0)); } inline CharU5BU5D_t3528271667* get_enumSeperatorCharArray_0() const { return ___enumSeperatorCharArray_0; } inline CharU5BU5D_t3528271667** get_address_of_enumSeperatorCharArray_0() { return &___enumSeperatorCharArray_0; } inline void set_enumSeperatorCharArray_0(CharU5BU5D_t3528271667* value) { ___enumSeperatorCharArray_0 = value; Il2CppCodeGenWriteBarrier((&___enumSeperatorCharArray_0), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif // Native definition for P/Invoke marshalling of System.Enum struct Enum_t4135868527_marshaled_pinvoke { }; // Native definition for COM marshalling of System.Enum struct Enum_t4135868527_marshaled_com { }; #endif // ENUM_T4135868527_H #ifndef DATETIME_T3738529785_H #define DATETIME_T3738529785_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.DateTime struct DateTime_t3738529785 { public: // System.UInt64 System.DateTime::dateData uint64_t ___dateData_44; public: inline static int32_t get_offset_of_dateData_44() { return static_cast<int32_t>(offsetof(DateTime_t3738529785, ___dateData_44)); } inline uint64_t get_dateData_44() const { return ___dateData_44; } inline uint64_t* get_address_of_dateData_44() { return &___dateData_44; } inline void set_dateData_44(uint64_t value) { ___dateData_44 = value; } }; struct DateTime_t3738529785_StaticFields { public: // System.Int32[] System.DateTime::DaysToMonth365 Int32U5BU5D_t385246372* ___DaysToMonth365_29; // System.Int32[] System.DateTime::DaysToMonth366 Int32U5BU5D_t385246372* ___DaysToMonth366_30; // System.DateTime System.DateTime::MinValue DateTime_t3738529785 ___MinValue_31; // System.DateTime System.DateTime::MaxValue DateTime_t3738529785 ___MaxValue_32; public: inline static int32_t get_offset_of_DaysToMonth365_29() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___DaysToMonth365_29)); } inline Int32U5BU5D_t385246372* get_DaysToMonth365_29() const { return ___DaysToMonth365_29; } inline Int32U5BU5D_t385246372** get_address_of_DaysToMonth365_29() { return &___DaysToMonth365_29; } inline void set_DaysToMonth365_29(Int32U5BU5D_t385246372* value) { ___DaysToMonth365_29 = value; Il2CppCodeGenWriteBarrier((&___DaysToMonth365_29), value); } inline static int32_t get_offset_of_DaysToMonth366_30() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___DaysToMonth366_30)); } inline Int32U5BU5D_t385246372* get_DaysToMonth366_30() const { return ___DaysToMonth366_30; } inline Int32U5BU5D_t385246372** get_address_of_DaysToMonth366_30() { return &___DaysToMonth366_30; } inline void set_DaysToMonth366_30(Int32U5BU5D_t385246372* value) { ___DaysToMonth366_30 = value; Il2CppCodeGenWriteBarrier((&___DaysToMonth366_30), value); } inline static int32_t get_offset_of_MinValue_31() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___MinValue_31)); } inline DateTime_t3738529785 get_MinValue_31() const { return ___MinValue_31; } inline DateTime_t3738529785 * get_address_of_MinValue_31() { return &___MinValue_31; } inline void set_MinValue_31(DateTime_t3738529785 value) { ___MinValue_31 = value; } inline static int32_t get_offset_of_MaxValue_32() { return static_cast<int32_t>(offsetof(DateTime_t3738529785_StaticFields, ___MaxValue_32)); } inline DateTime_t3738529785 get_MaxValue_32() const { return ___MaxValue_32; } inline DateTime_t3738529785 * get_address_of_MaxValue_32() { return &___MaxValue_32; } inline void set_MaxValue_32(DateTime_t3738529785 value) { ___MaxValue_32 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // DATETIME_T3738529785_H #ifndef DECIMAL_T2948259380_H #define DECIMAL_T2948259380_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Decimal struct Decimal_t2948259380 { public: // System.Int32 System.Decimal::flags int32_t ___flags_14; // System.Int32 System.Decimal::hi int32_t ___hi_15; // System.Int32 System.Decimal::lo int32_t ___lo_16; // System.Int32 System.Decimal::mid int32_t ___mid_17; public: inline static int32_t get_offset_of_flags_14() { return static_cast<int32_t>(offsetof(Decimal_t2948259380, ___flags_14)); } inline int32_t get_flags_14() const { return ___flags_14; } inline int32_t* get_address_of_flags_14() { return &___flags_14; } inline void set_flags_14(int32_t value) { ___flags_14 = value; } inline static int32_t get_offset_of_hi_15() { return static_cast<int32_t>(offsetof(Decimal_t2948259380, ___hi_15)); } inline int32_t get_hi_15() const { return ___hi_15; } inline int32_t* get_address_of_hi_15() { return &___hi_15; } inline void set_hi_15(int32_t value) { ___hi_15 = value; } inline static int32_t get_offset_of_lo_16() { return static_cast<int32_t>(offsetof(Decimal_t2948259380, ___lo_16)); } inline int32_t get_lo_16() const { return ___lo_16; } inline int32_t* get_address_of_lo_16() { return &___lo_16; } inline void set_lo_16(int32_t value) { ___lo_16 = value; } inline static int32_t get_offset_of_mid_17() { return static_cast<int32_t>(offsetof(Decimal_t2948259380, ___mid_17)); } inline int32_t get_mid_17() const { return ___mid_17; } inline int32_t* get_address_of_mid_17() { return &___mid_17; } inline void set_mid_17(int32_t value) { ___mid_17 = value; } }; struct Decimal_t2948259380_StaticFields { public: // System.UInt32[] System.Decimal::Powers10 UInt32U5BU5D_t2770800703* ___Powers10_6; // System.Decimal System.Decimal::Zero Decimal_t2948259380 ___Zero_7; // System.Decimal System.Decimal::One Decimal_t2948259380 ___One_8; // System.Decimal System.Decimal::MinusOne Decimal_t2948259380 ___MinusOne_9; // System.Decimal System.Decimal::MaxValue Decimal_t2948259380 ___MaxValue_10; // System.Decimal System.Decimal::MinValue Decimal_t2948259380 ___MinValue_11; // System.Decimal System.Decimal::NearNegativeZero Decimal_t2948259380 ___NearNegativeZero_12; // System.Decimal System.Decimal::NearPositiveZero Decimal_t2948259380 ___NearPositiveZero_13; public: inline static int32_t get_offset_of_Powers10_6() { return static_cast<int32_t>(offsetof(Decimal_t2948259380_StaticFields, ___Powers10_6)); } inline UInt32U5BU5D_t2770800703* get_Powers10_6() const { return ___Powers10_6; } inline UInt32U5BU5D_t2770800703** get_address_of_Powers10_6() { return &___Powers10_6; } inline void set_Powers10_6(UInt32U5BU5D_t2770800703* value) { ___Powers10_6 = value; Il2CppCodeGenWriteBarrier((&___Powers10_6), value); } inline static int32_t get_offset_of_Zero_7() { return static_cast<int32_t>(offsetof(Decimal_t2948259380_StaticFields, ___Zero_7)); } inline Decimal_t2948259380 get_Zero_7() const { return ___Zero_7; } inline Decimal_t2948259380 * get_address_of_Zero_7() { return &___Zero_7; } inline void set_Zero_7(Decimal_t2948259380 value) { ___Zero_7 = value; } inline static int32_t get_offset_of_One_8() { return static_cast<int32_t>(offsetof(Decimal_t2948259380_StaticFields, ___One_8)); } inline Decimal_t2948259380 get_One_8() const { return ___One_8; } inline Decimal_t2948259380 * get_address_of_One_8() { return &___One_8; } inline void set_One_8(Decimal_t2948259380 value) { ___One_8 = value; } inline static int32_t get_offset_of_MinusOne_9() { return static_cast<int32_t>(offsetof(Decimal_t2948259380_StaticFields, ___MinusOne_9)); } inline Decimal_t2948259380 get_MinusOne_9() const { return ___MinusOne_9; } inline Decimal_t2948259380 * get_address_of_MinusOne_9() { return &___MinusOne_9; } inline void set_MinusOne_9(Decimal_t2948259380 value) { ___MinusOne_9 = value; } inline static int32_t get_offset_of_MaxValue_10() { return static_cast<int32_t>(offsetof(Decimal_t2948259380_StaticFields, ___MaxValue_10)); } inline Decimal_t2948259380 get_MaxValue_10() const { return ___MaxValue_10; } inline Decimal_t2948259380 * get_address_of_MaxValue_10() { return &___MaxValue_10; } inline void set_MaxValue_10(Decimal_t2948259380 value) { ___MaxValue_10 = value; } inline static int32_t get_offset_of_MinValue_11() { return static_cast<int32_t>(offsetof(Decimal_t2948259380_StaticFields, ___MinValue_11)); } inline Decimal_t2948259380 get_MinValue_11() const { return ___MinValue_11; } inline Decimal_t2948259380 * get_address_of_MinValue_11() { return &___MinValue_11; } inline void set_MinValue_11(Decimal_t2948259380 value) { ___MinValue_11 = value; } inline static int32_t get_offset_of_NearNegativeZero_12() { return static_cast<int32_t>(offsetof(Decimal_t2948259380_StaticFields, ___NearNegativeZero_12)); } inline Decimal_t2948259380 get_NearNegativeZero_12() const { return ___NearNegativeZero_12; } inline Decimal_t2948259380 * get_address_of_NearNegativeZero_12() { return &___NearNegativeZero_12; } inline void set_NearNegativeZero_12(Decimal_t2948259380 value) { ___NearNegativeZero_12 = value; } inline static int32_t get_offset_of_NearPositiveZero_13() { return static_cast<int32_t>(offsetof(Decimal_t2948259380_StaticFields, ___NearPositiveZero_13)); } inline Decimal_t2948259380 get_NearPositiveZero_13() const { return ___NearPositiveZero_13; } inline Decimal_t2948259380 * get_address_of_NearPositiveZero_13() { return &___NearPositiveZero_13; } inline void set_NearPositiveZero_13(Decimal_t2948259380 value) { ___NearPositiveZero_13 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // DECIMAL_T2948259380_H #ifndef DOUBLE_T594665363_H #define DOUBLE_T594665363_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Double struct Double_t594665363 { public: // System.Double System.Double::m_value double ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Double_t594665363, ___m_value_0)); } inline double get_m_value_0() const { return ___m_value_0; } inline double* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(double value) { ___m_value_0 = value; } }; struct Double_t594665363_StaticFields { public: // System.Double System.Double::NegativeZero double ___NegativeZero_7; public: inline static int32_t get_offset_of_NegativeZero_7() { return static_cast<int32_t>(offsetof(Double_t594665363_StaticFields, ___NegativeZero_7)); } inline double get_NegativeZero_7() const { return ___NegativeZero_7; } inline double* get_address_of_NegativeZero_7() { return &___NegativeZero_7; } inline void set_NegativeZero_7(double value) { ___NegativeZero_7 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // DOUBLE_T594665363_H #ifndef SINGLE_T1397266774_H #define SINGLE_T1397266774_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Single struct Single_t1397266774 { public: // System.Single System.Single::m_value float ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Single_t1397266774, ___m_value_0)); } inline float get_m_value_0() const { return ___m_value_0; } inline float* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(float value) { ___m_value_0 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // SINGLE_T1397266774_H #ifndef UINT64_T4134040092_H #define UINT64_T4134040092_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.UInt64 struct UInt64_t4134040092 { public: // System.UInt64 System.UInt64::m_value uint64_t ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(UInt64_t4134040092, ___m_value_0)); } inline uint64_t get_m_value_0() const { return ___m_value_0; } inline uint64_t* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(uint64_t value) { ___m_value_0 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // UINT64_T4134040092_H #ifndef SYSTEMEXCEPTION_T176217640_H #define SYSTEMEXCEPTION_T176217640_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.SystemException struct SystemException_t176217640 : public Exception_t { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // SYSTEMEXCEPTION_T176217640_H #ifndef BOOLEAN_T97287965_H #define BOOLEAN_T97287965_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Boolean struct Boolean_t97287965 { public: // System.Boolean System.Boolean::m_value bool ___m_value_0; public: inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Boolean_t97287965, ___m_value_0)); } inline bool get_m_value_0() const { return ___m_value_0; } inline bool* get_address_of_m_value_0() { return &___m_value_0; } inline void set_m_value_0(bool value) { ___m_value_0 = value; } }; struct Boolean_t97287965_StaticFields { public: // System.String System.Boolean::TrueString String_t* ___TrueString_5; // System.String System.Boolean::FalseString String_t* ___FalseString_6; public: inline static int32_t get_offset_of_TrueString_5() { return static_cast<int32_t>(offsetof(Boolean_t97287965_StaticFields, ___TrueString_5)); } inline String_t* get_TrueString_5() const { return ___TrueString_5; } inline String_t** get_address_of_TrueString_5() { return &___TrueString_5; } inline void set_TrueString_5(String_t* value) { ___TrueString_5 = value; Il2CppCodeGenWriteBarrier((&___TrueString_5), value); } inline static int32_t get_offset_of_FalseString_6() { return static_cast<int32_t>(offsetof(Boolean_t97287965_StaticFields, ___FalseString_6)); } inline String_t* get_FalseString_6() const { return ___FalseString_6; } inline String_t** get_address_of_FalseString_6() { return &___FalseString_6; } inline void set_FalseString_6(String_t* value) { ___FalseString_6 = value; Il2CppCodeGenWriteBarrier((&___FalseString_6), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // BOOLEAN_T97287965_H #ifndef WEAKREFERENCE_T1334886716_H #define WEAKREFERENCE_T1334886716_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.WeakReference struct WeakReference_t1334886716 : public RuntimeObject { public: // System.Boolean System.WeakReference::isLongReference bool ___isLongReference_0; // System.Runtime.InteropServices.GCHandle System.WeakReference::gcHandle GCHandle_t3351438187 ___gcHandle_1; public: inline static int32_t get_offset_of_isLongReference_0() { return static_cast<int32_t>(offsetof(WeakReference_t1334886716, ___isLongReference_0)); } inline bool get_isLongReference_0() const { return ___isLongReference_0; } inline bool* get_address_of_isLongReference_0() { return &___isLongReference_0; } inline void set_isLongReference_0(bool value) { ___isLongReference_0 = value; } inline static int32_t get_offset_of_gcHandle_1() { return static_cast<int32_t>(offsetof(WeakReference_t1334886716, ___gcHandle_1)); } inline GCHandle_t3351438187 get_gcHandle_1() const { return ___gcHandle_1; } inline GCHandle_t3351438187 * get_address_of_gcHandle_1() { return &___gcHandle_1; } inline void set_gcHandle_1(GCHandle_t3351438187 value) { ___gcHandle_1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // WEAKREFERENCE_T1334886716_H #ifndef CONSOLESCREENBUFFERINFO_T3095351730_H #define CONSOLESCREENBUFFERINFO_T3095351730_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.ConsoleScreenBufferInfo struct ConsoleScreenBufferInfo_t3095351730 { public: // System.Coord System.ConsoleScreenBufferInfo::Size Coord_t397375283 ___Size_0; // System.Coord System.ConsoleScreenBufferInfo::CursorPosition Coord_t397375283 ___CursorPosition_1; // System.Int16 System.ConsoleScreenBufferInfo::Attribute int16_t ___Attribute_2; // System.SmallRect System.ConsoleScreenBufferInfo::Window SmallRect_t2930836963 ___Window_3; // System.Coord System.ConsoleScreenBufferInfo::MaxWindowSize Coord_t397375283 ___MaxWindowSize_4; public: inline static int32_t get_offset_of_Size_0() { return static_cast<int32_t>(offsetof(ConsoleScreenBufferInfo_t3095351730, ___Size_0)); } inline Coord_t397375283 get_Size_0() const { return ___Size_0; } inline Coord_t397375283 * get_address_of_Size_0() { return &___Size_0; } inline void set_Size_0(Coord_t397375283 value) { ___Size_0 = value; } inline static int32_t get_offset_of_CursorPosition_1() { return static_cast<int32_t>(offsetof(ConsoleScreenBufferInfo_t3095351730, ___CursorPosition_1)); } inline Coord_t397375283 get_CursorPosition_1() const { return ___CursorPosition_1; } inline Coord_t397375283 * get_address_of_CursorPosition_1() { return &___CursorPosition_1; } inline void set_CursorPosition_1(Coord_t397375283 value) { ___CursorPosition_1 = value; } inline static int32_t get_offset_of_Attribute_2() { return static_cast<int32_t>(offsetof(ConsoleScreenBufferInfo_t3095351730, ___Attribute_2)); } inline int16_t get_Attribute_2() const { return ___Attribute_2; } inline int16_t* get_address_of_Attribute_2() { return &___Attribute_2; } inline void set_Attribute_2(int16_t value) { ___Attribute_2 = value; } inline static int32_t get_offset_of_Window_3() { return static_cast<int32_t>(offsetof(ConsoleScreenBufferInfo_t3095351730, ___Window_3)); } inline SmallRect_t2930836963 get_Window_3() const { return ___Window_3; } inline SmallRect_t2930836963 * get_address_of_Window_3() { return &___Window_3; } inline void set_Window_3(SmallRect_t2930836963 value) { ___Window_3 = value; } inline static int32_t get_offset_of_MaxWindowSize_4() { return static_cast<int32_t>(offsetof(ConsoleScreenBufferInfo_t3095351730, ___MaxWindowSize_4)); } inline Coord_t397375283 get_MaxWindowSize_4() const { return ___MaxWindowSize_4; } inline Coord_t397375283 * get_address_of_MaxWindowSize_4() { return &___MaxWindowSize_4; } inline void set_MaxWindowSize_4(Coord_t397375283 value) { ___MaxWindowSize_4 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CONSOLESCREENBUFFERINFO_T3095351730_H #ifndef BRECORD_T3470580684_H #define BRECORD_T3470580684_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.BRECORD struct BRECORD_t3470580684 { public: // System.IntPtr System.BRECORD::pvRecord intptr_t ___pvRecord_0; // System.IntPtr System.BRECORD::pRecInfo intptr_t ___pRecInfo_1; public: inline static int32_t get_offset_of_pvRecord_0() { return static_cast<int32_t>(offsetof(BRECORD_t3470580684, ___pvRecord_0)); } inline intptr_t get_pvRecord_0() const { return ___pvRecord_0; } inline intptr_t* get_address_of_pvRecord_0() { return &___pvRecord_0; } inline void set_pvRecord_0(intptr_t value) { ___pvRecord_0 = value; } inline static int32_t get_offset_of_pRecInfo_1() { return static_cast<int32_t>(offsetof(BRECORD_t3470580684, ___pRecInfo_1)); } inline intptr_t get_pRecInfo_1() const { return ___pRecInfo_1; } inline intptr_t* get_address_of_pRecInfo_1() { return &___pRecInfo_1; } inline void set_pRecInfo_1(intptr_t value) { ___pRecInfo_1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // BRECORD_T3470580684_H #ifndef WINDOWSCONSOLEDRIVER_T3991887195_H #define WINDOWSCONSOLEDRIVER_T3991887195_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.WindowsConsoleDriver struct WindowsConsoleDriver_t3991887195 : public RuntimeObject { public: // System.IntPtr System.WindowsConsoleDriver::inputHandle intptr_t ___inputHandle_0; // System.IntPtr System.WindowsConsoleDriver::outputHandle intptr_t ___outputHandle_1; // System.Int16 System.WindowsConsoleDriver::defaultAttribute int16_t ___defaultAttribute_2; public: inline static int32_t get_offset_of_inputHandle_0() { return static_cast<int32_t>(offsetof(WindowsConsoleDriver_t3991887195, ___inputHandle_0)); } inline intptr_t get_inputHandle_0() const { return ___inputHandle_0; } inline intptr_t* get_address_of_inputHandle_0() { return &___inputHandle_0; } inline void set_inputHandle_0(intptr_t value) { ___inputHandle_0 = value; } inline static int32_t get_offset_of_outputHandle_1() { return static_cast<int32_t>(offsetof(WindowsConsoleDriver_t3991887195, ___outputHandle_1)); } inline intptr_t get_outputHandle_1() const { return ___outputHandle_1; } inline intptr_t* get_address_of_outputHandle_1() { return &___outputHandle_1; } inline void set_outputHandle_1(intptr_t value) { ___outputHandle_1 = value; } inline static int32_t get_offset_of_defaultAttribute_2() { return static_cast<int32_t>(offsetof(WindowsConsoleDriver_t3991887195, ___defaultAttribute_2)); } inline int16_t get_defaultAttribute_2() const { return ___defaultAttribute_2; } inline int16_t* get_address_of_defaultAttribute_2() { return &___defaultAttribute_2; } inline void set_defaultAttribute_2(int16_t value) { ___defaultAttribute_2 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // WINDOWSCONSOLEDRIVER_T3991887195_H #ifndef STREAMINGCONTEXTSTATES_T3580100459_H #define STREAMINGCONTEXTSTATES_T3580100459_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Serialization.StreamingContextStates struct StreamingContextStates_t3580100459 { public: // System.Int32 System.Runtime.Serialization.StreamingContextStates::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(StreamingContextStates_t3580100459, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // STREAMINGCONTEXTSTATES_T3580100459_H #ifndef BINDINGFLAGS_T2721792723_H #define BINDINGFLAGS_T2721792723_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Reflection.BindingFlags struct BindingFlags_t2721792723 { public: // System.Int32 System.Reflection.BindingFlags::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(BindingFlags_t2721792723, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // BINDINGFLAGS_T2721792723_H #ifndef HANDLES_T3280152003_H #define HANDLES_T3280152003_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Handles struct Handles_t3280152003 { public: // System.Int32 System.Handles::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(Handles_t3280152003, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // HANDLES_T3280152003_H #ifndef CONSOLEKEY_T4097401472_H #define CONSOLEKEY_T4097401472_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.ConsoleKey struct ConsoleKey_t4097401472 { public: // System.Int32 System.ConsoleKey::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(ConsoleKey_t4097401472, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CONSOLEKEY_T4097401472_H #ifndef CFRANGE_T1233619878_H #define CFRANGE_T1233619878_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // XamMac.CoreFoundation.CFHelpers/CFRange struct CFRange_t1233619878 { public: // System.IntPtr XamMac.CoreFoundation.CFHelpers/CFRange::loc intptr_t ___loc_0; // System.IntPtr XamMac.CoreFoundation.CFHelpers/CFRange::len intptr_t ___len_1; public: inline static int32_t get_offset_of_loc_0() { return static_cast<int32_t>(offsetof(CFRange_t1233619878, ___loc_0)); } inline intptr_t get_loc_0() const { return ___loc_0; } inline intptr_t* get_address_of_loc_0() { return &___loc_0; } inline void set_loc_0(intptr_t value) { ___loc_0 = value; } inline static int32_t get_offset_of_len_1() { return static_cast<int32_t>(offsetof(CFRange_t1233619878, ___len_1)); } inline intptr_t get_len_1() const { return ___len_1; } inline intptr_t* get_address_of_len_1() { return &___len_1; } inline void set_len_1(intptr_t value) { ___len_1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CFRANGE_T1233619878_H #ifndef GCHANDLETYPE_T3432586689_H #define GCHANDLETYPE_T3432586689_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.InteropServices.GCHandleType struct GCHandleType_t3432586689 { public: // System.Int32 System.Runtime.InteropServices.GCHandleType::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(GCHandleType_t3432586689, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // GCHANDLETYPE_T3432586689_H #ifndef INVALIDOPERATIONEXCEPTION_T56020091_H #define INVALIDOPERATIONEXCEPTION_T56020091_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.InvalidOperationException struct InvalidOperationException_t56020091 : public SystemException_t176217640 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // INVALIDOPERATIONEXCEPTION_T56020091_H #ifndef CONSOLEMODIFIERS_T1471011467_H #define CONSOLEMODIFIERS_T1471011467_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.ConsoleModifiers struct ConsoleModifiers_t1471011467 { public: // System.Int32 System.ConsoleModifiers::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(ConsoleModifiers_t1471011467, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // CONSOLEMODIFIERS_T1471011467_H #ifndef UNAUTHORIZEDACCESSEXCEPTION_T490705335_H #define UNAUTHORIZEDACCESSEXCEPTION_T490705335_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.UnauthorizedAccessException struct UnauthorizedAccessException_t490705335 : public SystemException_t176217640 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // UNAUTHORIZEDACCESSEXCEPTION_T490705335_H #ifndef ARGUMENTEXCEPTION_T132251570_H #define ARGUMENTEXCEPTION_T132251570_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.ArgumentException struct ArgumentException_t132251570 : public SystemException_t176217640 { public: // System.String System.ArgumentException::m_paramName String_t* ___m_paramName_17; public: inline static int32_t get_offset_of_m_paramName_17() { return static_cast<int32_t>(offsetof(ArgumentException_t132251570, ___m_paramName_17)); } inline String_t* get_m_paramName_17() const { return ___m_paramName_17; } inline String_t** get_address_of_m_paramName_17() { return &___m_paramName_17; } inline void set_m_paramName_17(String_t* value) { ___m_paramName_17 = value; Il2CppCodeGenWriteBarrier((&___m_paramName_17), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // ARGUMENTEXCEPTION_T132251570_H #ifndef NOTSUPPORTEDEXCEPTION_T1314879016_H #define NOTSUPPORTEDEXCEPTION_T1314879016_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.NotSupportedException struct NotSupportedException_t1314879016 : public SystemException_t176217640 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // NOTSUPPORTEDEXCEPTION_T1314879016_H #ifndef SERIALIZATIONEXCEPTION_T3941511869_H #define SERIALIZATIONEXCEPTION_T3941511869_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Serialization.SerializationException struct SerializationException_t3941511869 : public SystemException_t176217640 { public: public: }; struct SerializationException_t3941511869_StaticFields { public: // System.String System.Runtime.Serialization.SerializationException::_nullMessage String_t* ____nullMessage_17; public: inline static int32_t get_offset_of__nullMessage_17() { return static_cast<int32_t>(offsetof(SerializationException_t3941511869_StaticFields, ____nullMessage_17)); } inline String_t* get__nullMessage_17() const { return ____nullMessage_17; } inline String_t** get_address_of__nullMessage_17() { return &____nullMessage_17; } inline void set__nullMessage_17(String_t* value) { ____nullMessage_17 = value; Il2CppCodeGenWriteBarrier((&____nullMessage_17), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // SERIALIZATIONEXCEPTION_T3941511869_H #ifndef ASSEMBLY_T_H #define ASSEMBLY_T_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Reflection.Assembly struct Assembly_t : public RuntimeObject { public: // System.IntPtr System.Reflection.Assembly::_mono_assembly intptr_t ____mono_assembly_0; // System.Reflection.Assembly/ResolveEventHolder System.Reflection.Assembly::resolve_event_holder ResolveEventHolder_t2120639521 * ___resolve_event_holder_1; // System.Security.Policy.Evidence System.Reflection.Assembly::_evidence Evidence_t2008144148 * ____evidence_2; // System.Security.PermissionSet System.Reflection.Assembly::_minimum PermissionSet_t223948603 * ____minimum_3; // System.Security.PermissionSet System.Reflection.Assembly::_optional PermissionSet_t223948603 * ____optional_4; // System.Security.PermissionSet System.Reflection.Assembly::_refuse PermissionSet_t223948603 * ____refuse_5; // System.Security.PermissionSet System.Reflection.Assembly::_granted PermissionSet_t223948603 * ____granted_6; // System.Security.PermissionSet System.Reflection.Assembly::_denied PermissionSet_t223948603 * ____denied_7; // System.Boolean System.Reflection.Assembly::fromByteArray bool ___fromByteArray_8; // System.String System.Reflection.Assembly::assemblyName String_t* ___assemblyName_9; public: inline static int32_t get_offset_of__mono_assembly_0() { return static_cast<int32_t>(offsetof(Assembly_t, ____mono_assembly_0)); } inline intptr_t get__mono_assembly_0() const { return ____mono_assembly_0; } inline intptr_t* get_address_of__mono_assembly_0() { return &____mono_assembly_0; } inline void set__mono_assembly_0(intptr_t value) { ____mono_assembly_0 = value; } inline static int32_t get_offset_of_resolve_event_holder_1() { return static_cast<int32_t>(offsetof(Assembly_t, ___resolve_event_holder_1)); } inline ResolveEventHolder_t2120639521 * get_resolve_event_holder_1() const { return ___resolve_event_holder_1; } inline ResolveEventHolder_t2120639521 ** get_address_of_resolve_event_holder_1() { return &___resolve_event_holder_1; } inline void set_resolve_event_holder_1(ResolveEventHolder_t2120639521 * value) { ___resolve_event_holder_1 = value; Il2CppCodeGenWriteBarrier((&___resolve_event_holder_1), value); } inline static int32_t get_offset_of__evidence_2() { return static_cast<int32_t>(offsetof(Assembly_t, ____evidence_2)); } inline Evidence_t2008144148 * get__evidence_2() const { return ____evidence_2; } inline Evidence_t2008144148 ** get_address_of__evidence_2() { return &____evidence_2; } inline void set__evidence_2(Evidence_t2008144148 * value) { ____evidence_2 = value; Il2CppCodeGenWriteBarrier((&____evidence_2), value); } inline static int32_t get_offset_of__minimum_3() { return static_cast<int32_t>(offsetof(Assembly_t, ____minimum_3)); } inline PermissionSet_t223948603 * get__minimum_3() const { return ____minimum_3; } inline PermissionSet_t223948603 ** get_address_of__minimum_3() { return &____minimum_3; } inline void set__minimum_3(PermissionSet_t223948603 * value) { ____minimum_3 = value; Il2CppCodeGenWriteBarrier((&____minimum_3), value); } inline static int32_t get_offset_of__optional_4() { return static_cast<int32_t>(offsetof(Assembly_t, ____optional_4)); } inline PermissionSet_t223948603 * get__optional_4() const { return ____optional_4; } inline PermissionSet_t223948603 ** get_address_of__optional_4() { return &____optional_4; } inline void set__optional_4(PermissionSet_t223948603 * value) { ____optional_4 = value; Il2CppCodeGenWriteBarrier((&____optional_4), value); } inline static int32_t get_offset_of__refuse_5() { return static_cast<int32_t>(offsetof(Assembly_t, ____refuse_5)); } inline PermissionSet_t223948603 * get__refuse_5() const { return ____refuse_5; } inline PermissionSet_t223948603 ** get_address_of__refuse_5() { return &____refuse_5; } inline void set__refuse_5(PermissionSet_t223948603 * value) { ____refuse_5 = value; Il2CppCodeGenWriteBarrier((&____refuse_5), value); } inline static int32_t get_offset_of__granted_6() { return static_cast<int32_t>(offsetof(Assembly_t, ____granted_6)); } inline PermissionSet_t223948603 * get__granted_6() const { return ____granted_6; } inline PermissionSet_t223948603 ** get_address_of__granted_6() { return &____granted_6; } inline void set__granted_6(PermissionSet_t223948603 * value) { ____granted_6 = value; Il2CppCodeGenWriteBarrier((&____granted_6), value); } inline static int32_t get_offset_of__denied_7() { return static_cast<int32_t>(offsetof(Assembly_t, ____denied_7)); } inline PermissionSet_t223948603 * get__denied_7() const { return ____denied_7; } inline PermissionSet_t223948603 ** get_address_of__denied_7() { return &____denied_7; } inline void set__denied_7(PermissionSet_t223948603 * value) { ____denied_7 = value; Il2CppCodeGenWriteBarrier((&____denied_7), value); } inline static int32_t get_offset_of_fromByteArray_8() { return static_cast<int32_t>(offsetof(Assembly_t, ___fromByteArray_8)); } inline bool get_fromByteArray_8() const { return ___fromByteArray_8; } inline bool* get_address_of_fromByteArray_8() { return &___fromByteArray_8; } inline void set_fromByteArray_8(bool value) { ___fromByteArray_8 = value; } inline static int32_t get_offset_of_assemblyName_9() { return static_cast<int32_t>(offsetof(Assembly_t, ___assemblyName_9)); } inline String_t* get_assemblyName_9() const { return ___assemblyName_9; } inline String_t** get_address_of_assemblyName_9() { return &___assemblyName_9; } inline void set_assemblyName_9(String_t* value) { ___assemblyName_9 = value; Il2CppCodeGenWriteBarrier((&___assemblyName_9), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif // Native definition for P/Invoke marshalling of System.Reflection.Assembly struct Assembly_t_marshaled_pinvoke { intptr_t ____mono_assembly_0; ResolveEventHolder_t2120639521 * ___resolve_event_holder_1; Evidence_t2008144148 * ____evidence_2; PermissionSet_t223948603 * ____minimum_3; PermissionSet_t223948603 * ____optional_4; PermissionSet_t223948603 * ____refuse_5; PermissionSet_t223948603 * ____granted_6; PermissionSet_t223948603 * ____denied_7; int32_t ___fromByteArray_8; char* ___assemblyName_9; }; // Native definition for COM marshalling of System.Reflection.Assembly struct Assembly_t_marshaled_com { intptr_t ____mono_assembly_0; ResolveEventHolder_t2120639521 * ___resolve_event_holder_1; Evidence_t2008144148 * ____evidence_2; PermissionSet_t223948603 * ____minimum_3; PermissionSet_t223948603 * ____optional_4; PermissionSet_t223948603 * ____refuse_5; PermissionSet_t223948603 * ____granted_6; PermissionSet_t223948603 * ____denied_7; int32_t ___fromByteArray_8; Il2CppChar* ___assemblyName_9; }; #endif // ASSEMBLY_T_H #ifndef RUNTIMETYPEHANDLE_T3027515415_H #define RUNTIMETYPEHANDLE_T3027515415_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.RuntimeTypeHandle struct RuntimeTypeHandle_t3027515415 { public: // System.IntPtr System.RuntimeTypeHandle::value intptr_t ___value_0; public: inline static int32_t get_offset_of_value_0() { return static_cast<int32_t>(offsetof(RuntimeTypeHandle_t3027515415, ___value_0)); } inline intptr_t get_value_0() const { return ___value_0; } inline intptr_t* get_address_of_value_0() { return &___value_0; } inline void set_value_0(intptr_t value) { ___value_0 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // RUNTIMETYPEHANDLE_T3027515415_H #ifndef NUMBERSTYLES_T617258130_H #define NUMBERSTYLES_T617258130_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Globalization.NumberStyles struct NumberStyles_t617258130 { public: // System.Int32 System.Globalization.NumberStyles::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(NumberStyles_t617258130, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // NUMBERSTYLES_T617258130_H #ifndef DELEGATE_T1188392813_H #define DELEGATE_T1188392813_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Delegate struct Delegate_t1188392813 : public RuntimeObject { public: // System.IntPtr System.Delegate::method_ptr Il2CppMethodPointer ___method_ptr_0; // System.IntPtr System.Delegate::invoke_impl intptr_t ___invoke_impl_1; // System.Object System.Delegate::m_target RuntimeObject * ___m_target_2; // System.IntPtr System.Delegate::method intptr_t ___method_3; // System.IntPtr System.Delegate::delegate_trampoline intptr_t ___delegate_trampoline_4; // System.IntPtr System.Delegate::extra_arg intptr_t ___extra_arg_5; // System.IntPtr System.Delegate::method_code intptr_t ___method_code_6; // System.Reflection.MethodInfo System.Delegate::method_info MethodInfo_t * ___method_info_7; // System.Reflection.MethodInfo System.Delegate::original_method_info MethodInfo_t * ___original_method_info_8; // System.DelegateData System.Delegate::data DelegateData_t1677132599 * ___data_9; // System.Boolean System.Delegate::method_is_virtual bool ___method_is_virtual_10; public: inline static int32_t get_offset_of_method_ptr_0() { return static_cast<int32_t>(offsetof(Delegate_t1188392813, ___method_ptr_0)); } inline Il2CppMethodPointer get_method_ptr_0() const { return ___method_ptr_0; } inline Il2CppMethodPointer* get_address_of_method_ptr_0() { return &___method_ptr_0; } inline void set_method_ptr_0(Il2CppMethodPointer value) { ___method_ptr_0 = value; } inline static int32_t get_offset_of_invoke_impl_1() { return static_cast<int32_t>(offsetof(Delegate_t1188392813, ___invoke_impl_1)); } inline intptr_t get_invoke_impl_1() const { return ___invoke_impl_1; } inline intptr_t* get_address_of_invoke_impl_1() { return &___invoke_impl_1; } inline void set_invoke_impl_1(intptr_t value) { ___invoke_impl_1 = value; } inline static int32_t get_offset_of_m_target_2() { return static_cast<int32_t>(offsetof(Delegate_t1188392813, ___m_target_2)); } inline RuntimeObject * get_m_target_2() const { return ___m_target_2; } inline RuntimeObject ** get_address_of_m_target_2() { return &___m_target_2; } inline void set_m_target_2(RuntimeObject * value) { ___m_target_2 = value; Il2CppCodeGenWriteBarrier((&___m_target_2), value); } inline static int32_t get_offset_of_method_3() { return static_cast<int32_t>(offsetof(Delegate_t1188392813, ___method_3)); } inline intptr_t get_method_3() const { return ___method_3; } inline intptr_t* get_address_of_method_3() { return &___method_3; } inline void set_method_3(intptr_t value) { ___method_3 = value; } inline static int32_t get_offset_of_delegate_trampoline_4() { return static_cast<int32_t>(offsetof(Delegate_t1188392813, ___delegate_trampoline_4)); } inline intptr_t get_delegate_trampoline_4() const { return ___delegate_trampoline_4; } inline intptr_t* get_address_of_delegate_trampoline_4() { return &___delegate_trampoline_4; } inline void set_delegate_trampoline_4(intptr_t value) { ___delegate_trampoline_4 = value; } inline static int32_t get_offset_of_extra_arg_5() { return static_cast<int32_t>(offsetof(Delegate_t1188392813, ___extra_arg_5)); } inline intptr_t get_extra_arg_5() const { return ___extra_arg_5; } inline intptr_t* get_address_of_extra_arg_5() { return &___extra_arg_5; } inline void set_extra_arg_5(intptr_t value) { ___extra_arg_5 = value; } inline static int32_t get_offset_of_method_code_6() { return static_cast<int32_t>(offsetof(Delegate_t1188392813, ___method_code_6)); } inline intptr_t get_method_code_6() const { return ___method_code_6; } inline intptr_t* get_address_of_method_code_6() { return &___method_code_6; } inline void set_method_code_6(intptr_t value) { ___method_code_6 = value; } inline static int32_t get_offset_of_method_info_7() { return static_cast<int32_t>(offsetof(Delegate_t1188392813, ___method_info_7)); } inline MethodInfo_t * get_method_info_7() const { return ___method_info_7; } inline MethodInfo_t ** get_address_of_method_info_7() { return &___method_info_7; } inline void set_method_info_7(MethodInfo_t * value) { ___method_info_7 = value; Il2CppCodeGenWriteBarrier((&___method_info_7), value); } inline static int32_t get_offset_of_original_method_info_8() { return static_cast<int32_t>(offsetof(Delegate_t1188392813, ___original_method_info_8)); } inline MethodInfo_t * get_original_method_info_8() const { return ___original_method_info_8; } inline MethodInfo_t ** get_address_of_original_method_info_8() { return &___original_method_info_8; } inline void set_original_method_info_8(MethodInfo_t * value) { ___original_method_info_8 = value; Il2CppCodeGenWriteBarrier((&___original_method_info_8), value); } inline static int32_t get_offset_of_data_9() { return static_cast<int32_t>(offsetof(Delegate_t1188392813, ___data_9)); } inline DelegateData_t1677132599 * get_data_9() const { return ___data_9; } inline DelegateData_t1677132599 ** get_address_of_data_9() { return &___data_9; } inline void set_data_9(DelegateData_t1677132599 * value) { ___data_9 = value; Il2CppCodeGenWriteBarrier((&___data_9), value); } inline static int32_t get_offset_of_method_is_virtual_10() { return static_cast<int32_t>(offsetof(Delegate_t1188392813, ___method_is_virtual_10)); } inline bool get_method_is_virtual_10() const { return ___method_is_virtual_10; } inline bool* get_address_of_method_is_virtual_10() { return &___method_is_virtual_10; } inline void set_method_is_virtual_10(bool value) { ___method_is_virtual_10 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif // Native definition for P/Invoke marshalling of System.Delegate struct Delegate_t1188392813_marshaled_pinvoke { intptr_t ___method_ptr_0; intptr_t ___invoke_impl_1; Il2CppIUnknown* ___m_target_2; intptr_t ___method_3; intptr_t ___delegate_trampoline_4; intptr_t ___extra_arg_5; intptr_t ___method_code_6; MethodInfo_t * ___method_info_7; MethodInfo_t * ___original_method_info_8; DelegateData_t1677132599 * ___data_9; int32_t ___method_is_virtual_10; }; // Native definition for COM marshalling of System.Delegate struct Delegate_t1188392813_marshaled_com { intptr_t ___method_ptr_0; intptr_t ___invoke_impl_1; Il2CppIUnknown* ___m_target_2; intptr_t ___method_3; intptr_t ___delegate_trampoline_4; intptr_t ___extra_arg_5; intptr_t ___method_code_6; MethodInfo_t * ___method_info_7; MethodInfo_t * ___original_method_info_8; DelegateData_t1677132599 * ___data_9; int32_t ___method_is_virtual_10; }; #endif // DELEGATE_T1188392813_H #ifndef TYPECODE_T2987224087_H #define TYPECODE_T2987224087_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.TypeCode struct TypeCode_t2987224087 { public: // System.Int32 System.TypeCode::value__ int32_t ___value___2; public: inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(TypeCode_t2987224087, ___value___2)); } inline int32_t get_value___2() const { return ___value___2; } inline int32_t* get_address_of_value___2() { return &___value___2; } inline void set_value___2(int32_t value) { ___value___2 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // TYPECODE_T2987224087_H #ifndef INVALIDCASTEXCEPTION_T3927145244_H #define INVALIDCASTEXCEPTION_T3927145244_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.InvalidCastException struct InvalidCastException_t3927145244 : public SystemException_t176217640 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // INVALIDCASTEXCEPTION_T3927145244_H #ifndef INDEXOUTOFRANGEEXCEPTION_T1578797820_H #define INDEXOUTOFRANGEEXCEPTION_T1578797820_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.IndexOutOfRangeException struct IndexOutOfRangeException_t1578797820 : public SystemException_t176217640 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // INDEXOUTOFRANGEEXCEPTION_T1578797820_H #ifndef NUMBERFORMATINFO_T435877138_H #define NUMBERFORMATINFO_T435877138_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Globalization.NumberFormatInfo struct NumberFormatInfo_t435877138 : public RuntimeObject { public: // System.Int32[] System.Globalization.NumberFormatInfo::numberGroupSizes Int32U5BU5D_t385246372* ___numberGroupSizes_1; // System.Int32[] System.Globalization.NumberFormatInfo::currencyGroupSizes Int32U5BU5D_t385246372* ___currencyGroupSizes_2; // System.Int32[] System.Globalization.NumberFormatInfo::percentGroupSizes Int32U5BU5D_t385246372* ___percentGroupSizes_3; // System.String System.Globalization.NumberFormatInfo::positiveSign String_t* ___positiveSign_4; // System.String System.Globalization.NumberFormatInfo::negativeSign String_t* ___negativeSign_5; // System.String System.Globalization.NumberFormatInfo::numberDecimalSeparator String_t* ___numberDecimalSeparator_6; // System.String System.Globalization.NumberFormatInfo::numberGroupSeparator String_t* ___numberGroupSeparator_7; // System.String System.Globalization.NumberFormatInfo::currencyGroupSeparator String_t* ___currencyGroupSeparator_8; // System.String System.Globalization.NumberFormatInfo::currencyDecimalSeparator String_t* ___currencyDecimalSeparator_9; // System.String System.Globalization.NumberFormatInfo::currencySymbol String_t* ___currencySymbol_10; // System.String System.Globalization.NumberFormatInfo::ansiCurrencySymbol String_t* ___ansiCurrencySymbol_11; // System.String System.Globalization.NumberFormatInfo::nanSymbol String_t* ___nanSymbol_12; // System.String System.Globalization.NumberFormatInfo::positiveInfinitySymbol String_t* ___positiveInfinitySymbol_13; // System.String System.Globalization.NumberFormatInfo::negativeInfinitySymbol String_t* ___negativeInfinitySymbol_14; // System.String System.Globalization.NumberFormatInfo::percentDecimalSeparator String_t* ___percentDecimalSeparator_15; // System.String System.Globalization.NumberFormatInfo::percentGroupSeparator String_t* ___percentGroupSeparator_16; // System.String System.Globalization.NumberFormatInfo::percentSymbol String_t* ___percentSymbol_17; // System.String System.Globalization.NumberFormatInfo::perMilleSymbol String_t* ___perMilleSymbol_18; // System.String[] System.Globalization.NumberFormatInfo::nativeDigits StringU5BU5D_t1281789340* ___nativeDigits_19; // System.Int32 System.Globalization.NumberFormatInfo::m_dataItem int32_t ___m_dataItem_20; // System.Int32 System.Globalization.NumberFormatInfo::numberDecimalDigits int32_t ___numberDecimalDigits_21; // System.Int32 System.Globalization.NumberFormatInfo::currencyDecimalDigits int32_t ___currencyDecimalDigits_22; // System.Int32 System.Globalization.NumberFormatInfo::currencyPositivePattern int32_t ___currencyPositivePattern_23; // System.Int32 System.Globalization.NumberFormatInfo::currencyNegativePattern int32_t ___currencyNegativePattern_24; // System.Int32 System.Globalization.NumberFormatInfo::numberNegativePattern int32_t ___numberNegativePattern_25; // System.Int32 System.Globalization.NumberFormatInfo::percentPositivePattern int32_t ___percentPositivePattern_26; // System.Int32 System.Globalization.NumberFormatInfo::percentNegativePattern int32_t ___percentNegativePattern_27; // System.Int32 System.Globalization.NumberFormatInfo::percentDecimalDigits int32_t ___percentDecimalDigits_28; // System.Int32 System.Globalization.NumberFormatInfo::digitSubstitution int32_t ___digitSubstitution_29; // System.Boolean System.Globalization.NumberFormatInfo::isReadOnly bool ___isReadOnly_30; // System.Boolean System.Globalization.NumberFormatInfo::m_useUserOverride bool ___m_useUserOverride_31; // System.Boolean System.Globalization.NumberFormatInfo::m_isInvariant bool ___m_isInvariant_32; // System.Boolean System.Globalization.NumberFormatInfo::validForParseAsNumber bool ___validForParseAsNumber_33; // System.Boolean System.Globalization.NumberFormatInfo::validForParseAsCurrency bool ___validForParseAsCurrency_34; public: inline static int32_t get_offset_of_numberGroupSizes_1() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___numberGroupSizes_1)); } inline Int32U5BU5D_t385246372* get_numberGroupSizes_1() const { return ___numberGroupSizes_1; } inline Int32U5BU5D_t385246372** get_address_of_numberGroupSizes_1() { return &___numberGroupSizes_1; } inline void set_numberGroupSizes_1(Int32U5BU5D_t385246372* value) { ___numberGroupSizes_1 = value; Il2CppCodeGenWriteBarrier((&___numberGroupSizes_1), value); } inline static int32_t get_offset_of_currencyGroupSizes_2() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___currencyGroupSizes_2)); } inline Int32U5BU5D_t385246372* get_currencyGroupSizes_2() const { return ___currencyGroupSizes_2; } inline Int32U5BU5D_t385246372** get_address_of_currencyGroupSizes_2() { return &___currencyGroupSizes_2; } inline void set_currencyGroupSizes_2(Int32U5BU5D_t385246372* value) { ___currencyGroupSizes_2 = value; Il2CppCodeGenWriteBarrier((&___currencyGroupSizes_2), value); } inline static int32_t get_offset_of_percentGroupSizes_3() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___percentGroupSizes_3)); } inline Int32U5BU5D_t385246372* get_percentGroupSizes_3() const { return ___percentGroupSizes_3; } inline Int32U5BU5D_t385246372** get_address_of_percentGroupSizes_3() { return &___percentGroupSizes_3; } inline void set_percentGroupSizes_3(Int32U5BU5D_t385246372* value) { ___percentGroupSizes_3 = value; Il2CppCodeGenWriteBarrier((&___percentGroupSizes_3), value); } inline static int32_t get_offset_of_positiveSign_4() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___positiveSign_4)); } inline String_t* get_positiveSign_4() const { return ___positiveSign_4; } inline String_t** get_address_of_positiveSign_4() { return &___positiveSign_4; } inline void set_positiveSign_4(String_t* value) { ___positiveSign_4 = value; Il2CppCodeGenWriteBarrier((&___positiveSign_4), value); } inline static int32_t get_offset_of_negativeSign_5() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___negativeSign_5)); } inline String_t* get_negativeSign_5() const { return ___negativeSign_5; } inline String_t** get_address_of_negativeSign_5() { return &___negativeSign_5; } inline void set_negativeSign_5(String_t* value) { ___negativeSign_5 = value; Il2CppCodeGenWriteBarrier((&___negativeSign_5), value); } inline static int32_t get_offset_of_numberDecimalSeparator_6() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___numberDecimalSeparator_6)); } inline String_t* get_numberDecimalSeparator_6() const { return ___numberDecimalSeparator_6; } inline String_t** get_address_of_numberDecimalSeparator_6() { return &___numberDecimalSeparator_6; } inline void set_numberDecimalSeparator_6(String_t* value) { ___numberDecimalSeparator_6 = value; Il2CppCodeGenWriteBarrier((&___numberDecimalSeparator_6), value); } inline static int32_t get_offset_of_numberGroupSeparator_7() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___numberGroupSeparator_7)); } inline String_t* get_numberGroupSeparator_7() const { return ___numberGroupSeparator_7; } inline String_t** get_address_of_numberGroupSeparator_7() { return &___numberGroupSeparator_7; } inline void set_numberGroupSeparator_7(String_t* value) { ___numberGroupSeparator_7 = value; Il2CppCodeGenWriteBarrier((&___numberGroupSeparator_7), value); } inline static int32_t get_offset_of_currencyGroupSeparator_8() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___currencyGroupSeparator_8)); } inline String_t* get_currencyGroupSeparator_8() const { return ___currencyGroupSeparator_8; } inline String_t** get_address_of_currencyGroupSeparator_8() { return &___currencyGroupSeparator_8; } inline void set_currencyGroupSeparator_8(String_t* value) { ___currencyGroupSeparator_8 = value; Il2CppCodeGenWriteBarrier((&___currencyGroupSeparator_8), value); } inline static int32_t get_offset_of_currencyDecimalSeparator_9() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___currencyDecimalSeparator_9)); } inline String_t* get_currencyDecimalSeparator_9() const { return ___currencyDecimalSeparator_9; } inline String_t** get_address_of_currencyDecimalSeparator_9() { return &___currencyDecimalSeparator_9; } inline void set_currencyDecimalSeparator_9(String_t* value) { ___currencyDecimalSeparator_9 = value; Il2CppCodeGenWriteBarrier((&___currencyDecimalSeparator_9), value); } inline static int32_t get_offset_of_currencySymbol_10() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___currencySymbol_10)); } inline String_t* get_currencySymbol_10() const { return ___currencySymbol_10; } inline String_t** get_address_of_currencySymbol_10() { return &___currencySymbol_10; } inline void set_currencySymbol_10(String_t* value) { ___currencySymbol_10 = value; Il2CppCodeGenWriteBarrier((&___currencySymbol_10), value); } inline static int32_t get_offset_of_ansiCurrencySymbol_11() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___ansiCurrencySymbol_11)); } inline String_t* get_ansiCurrencySymbol_11() const { return ___ansiCurrencySymbol_11; } inline String_t** get_address_of_ansiCurrencySymbol_11() { return &___ansiCurrencySymbol_11; } inline void set_ansiCurrencySymbol_11(String_t* value) { ___ansiCurrencySymbol_11 = value; Il2CppCodeGenWriteBarrier((&___ansiCurrencySymbol_11), value); } inline static int32_t get_offset_of_nanSymbol_12() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___nanSymbol_12)); } inline String_t* get_nanSymbol_12() const { return ___nanSymbol_12; } inline String_t** get_address_of_nanSymbol_12() { return &___nanSymbol_12; } inline void set_nanSymbol_12(String_t* value) { ___nanSymbol_12 = value; Il2CppCodeGenWriteBarrier((&___nanSymbol_12), value); } inline static int32_t get_offset_of_positiveInfinitySymbol_13() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___positiveInfinitySymbol_13)); } inline String_t* get_positiveInfinitySymbol_13() const { return ___positiveInfinitySymbol_13; } inline String_t** get_address_of_positiveInfinitySymbol_13() { return &___positiveInfinitySymbol_13; } inline void set_positiveInfinitySymbol_13(String_t* value) { ___positiveInfinitySymbol_13 = value; Il2CppCodeGenWriteBarrier((&___positiveInfinitySymbol_13), value); } inline static int32_t get_offset_of_negativeInfinitySymbol_14() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___negativeInfinitySymbol_14)); } inline String_t* get_negativeInfinitySymbol_14() const { return ___negativeInfinitySymbol_14; } inline String_t** get_address_of_negativeInfinitySymbol_14() { return &___negativeInfinitySymbol_14; } inline void set_negativeInfinitySymbol_14(String_t* value) { ___negativeInfinitySymbol_14 = value; Il2CppCodeGenWriteBarrier((&___negativeInfinitySymbol_14), value); } inline static int32_t get_offset_of_percentDecimalSeparator_15() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___percentDecimalSeparator_15)); } inline String_t* get_percentDecimalSeparator_15() const { return ___percentDecimalSeparator_15; } inline String_t** get_address_of_percentDecimalSeparator_15() { return &___percentDecimalSeparator_15; } inline void set_percentDecimalSeparator_15(String_t* value) { ___percentDecimalSeparator_15 = value; Il2CppCodeGenWriteBarrier((&___percentDecimalSeparator_15), value); } inline static int32_t get_offset_of_percentGroupSeparator_16() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___percentGroupSeparator_16)); } inline String_t* get_percentGroupSeparator_16() const { return ___percentGroupSeparator_16; } inline String_t** get_address_of_percentGroupSeparator_16() { return &___percentGroupSeparator_16; } inline void set_percentGroupSeparator_16(String_t* value) { ___percentGroupSeparator_16 = value; Il2CppCodeGenWriteBarrier((&___percentGroupSeparator_16), value); } inline static int32_t get_offset_of_percentSymbol_17() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___percentSymbol_17)); } inline String_t* get_percentSymbol_17() const { return ___percentSymbol_17; } inline String_t** get_address_of_percentSymbol_17() { return &___percentSymbol_17; } inline void set_percentSymbol_17(String_t* value) { ___percentSymbol_17 = value; Il2CppCodeGenWriteBarrier((&___percentSymbol_17), value); } inline static int32_t get_offset_of_perMilleSymbol_18() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___perMilleSymbol_18)); } inline String_t* get_perMilleSymbol_18() const { return ___perMilleSymbol_18; } inline String_t** get_address_of_perMilleSymbol_18() { return &___perMilleSymbol_18; } inline void set_perMilleSymbol_18(String_t* value) { ___perMilleSymbol_18 = value; Il2CppCodeGenWriteBarrier((&___perMilleSymbol_18), value); } inline static int32_t get_offset_of_nativeDigits_19() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___nativeDigits_19)); } inline StringU5BU5D_t1281789340* get_nativeDigits_19() const { return ___nativeDigits_19; } inline StringU5BU5D_t1281789340** get_address_of_nativeDigits_19() { return &___nativeDigits_19; } inline void set_nativeDigits_19(StringU5BU5D_t1281789340* value) { ___nativeDigits_19 = value; Il2CppCodeGenWriteBarrier((&___nativeDigits_19), value); } inline static int32_t get_offset_of_m_dataItem_20() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___m_dataItem_20)); } inline int32_t get_m_dataItem_20() const { return ___m_dataItem_20; } inline int32_t* get_address_of_m_dataItem_20() { return &___m_dataItem_20; } inline void set_m_dataItem_20(int32_t value) { ___m_dataItem_20 = value; } inline static int32_t get_offset_of_numberDecimalDigits_21() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___numberDecimalDigits_21)); } inline int32_t get_numberDecimalDigits_21() const { return ___numberDecimalDigits_21; } inline int32_t* get_address_of_numberDecimalDigits_21() { return &___numberDecimalDigits_21; } inline void set_numberDecimalDigits_21(int32_t value) { ___numberDecimalDigits_21 = value; } inline static int32_t get_offset_of_currencyDecimalDigits_22() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___currencyDecimalDigits_22)); } inline int32_t get_currencyDecimalDigits_22() const { return ___currencyDecimalDigits_22; } inline int32_t* get_address_of_currencyDecimalDigits_22() { return &___currencyDecimalDigits_22; } inline void set_currencyDecimalDigits_22(int32_t value) { ___currencyDecimalDigits_22 = value; } inline static int32_t get_offset_of_currencyPositivePattern_23() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___currencyPositivePattern_23)); } inline int32_t get_currencyPositivePattern_23() const { return ___currencyPositivePattern_23; } inline int32_t* get_address_of_currencyPositivePattern_23() { return &___currencyPositivePattern_23; } inline void set_currencyPositivePattern_23(int32_t value) { ___currencyPositivePattern_23 = value; } inline static int32_t get_offset_of_currencyNegativePattern_24() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___currencyNegativePattern_24)); } inline int32_t get_currencyNegativePattern_24() const { return ___currencyNegativePattern_24; } inline int32_t* get_address_of_currencyNegativePattern_24() { return &___currencyNegativePattern_24; } inline void set_currencyNegativePattern_24(int32_t value) { ___currencyNegativePattern_24 = value; } inline static int32_t get_offset_of_numberNegativePattern_25() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___numberNegativePattern_25)); } inline int32_t get_numberNegativePattern_25() const { return ___numberNegativePattern_25; } inline int32_t* get_address_of_numberNegativePattern_25() { return &___numberNegativePattern_25; } inline void set_numberNegativePattern_25(int32_t value) { ___numberNegativePattern_25 = value; } inline static int32_t get_offset_of_percentPositivePattern_26() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___percentPositivePattern_26)); } inline int32_t get_percentPositivePattern_26() const { return ___percentPositivePattern_26; } inline int32_t* get_address_of_percentPositivePattern_26() { return &___percentPositivePattern_26; } inline void set_percentPositivePattern_26(int32_t value) { ___percentPositivePattern_26 = value; } inline static int32_t get_offset_of_percentNegativePattern_27() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___percentNegativePattern_27)); } inline int32_t get_percentNegativePattern_27() const { return ___percentNegativePattern_27; } inline int32_t* get_address_of_percentNegativePattern_27() { return &___percentNegativePattern_27; } inline void set_percentNegativePattern_27(int32_t value) { ___percentNegativePattern_27 = value; } inline static int32_t get_offset_of_percentDecimalDigits_28() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___percentDecimalDigits_28)); } inline int32_t get_percentDecimalDigits_28() const { return ___percentDecimalDigits_28; } inline int32_t* get_address_of_percentDecimalDigits_28() { return &___percentDecimalDigits_28; } inline void set_percentDecimalDigits_28(int32_t value) { ___percentDecimalDigits_28 = value; } inline static int32_t get_offset_of_digitSubstitution_29() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___digitSubstitution_29)); } inline int32_t get_digitSubstitution_29() const { return ___digitSubstitution_29; } inline int32_t* get_address_of_digitSubstitution_29() { return &___digitSubstitution_29; } inline void set_digitSubstitution_29(int32_t value) { ___digitSubstitution_29 = value; } inline static int32_t get_offset_of_isReadOnly_30() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___isReadOnly_30)); } inline bool get_isReadOnly_30() const { return ___isReadOnly_30; } inline bool* get_address_of_isReadOnly_30() { return &___isReadOnly_30; } inline void set_isReadOnly_30(bool value) { ___isReadOnly_30 = value; } inline static int32_t get_offset_of_m_useUserOverride_31() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___m_useUserOverride_31)); } inline bool get_m_useUserOverride_31() const { return ___m_useUserOverride_31; } inline bool* get_address_of_m_useUserOverride_31() { return &___m_useUserOverride_31; } inline void set_m_useUserOverride_31(bool value) { ___m_useUserOverride_31 = value; } inline static int32_t get_offset_of_m_isInvariant_32() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___m_isInvariant_32)); } inline bool get_m_isInvariant_32() const { return ___m_isInvariant_32; } inline bool* get_address_of_m_isInvariant_32() { return &___m_isInvariant_32; } inline void set_m_isInvariant_32(bool value) { ___m_isInvariant_32 = value; } inline static int32_t get_offset_of_validForParseAsNumber_33() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___validForParseAsNumber_33)); } inline bool get_validForParseAsNumber_33() const { return ___validForParseAsNumber_33; } inline bool* get_address_of_validForParseAsNumber_33() { return &___validForParseAsNumber_33; } inline void set_validForParseAsNumber_33(bool value) { ___validForParseAsNumber_33 = value; } inline static int32_t get_offset_of_validForParseAsCurrency_34() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138, ___validForParseAsCurrency_34)); } inline bool get_validForParseAsCurrency_34() const { return ___validForParseAsCurrency_34; } inline bool* get_address_of_validForParseAsCurrency_34() { return &___validForParseAsCurrency_34; } inline void set_validForParseAsCurrency_34(bool value) { ___validForParseAsCurrency_34 = value; } }; struct NumberFormatInfo_t435877138_StaticFields { public: // System.Globalization.NumberFormatInfo modreq(System.Runtime.CompilerServices.IsVolatile) System.Globalization.NumberFormatInfo::invariantInfo NumberFormatInfo_t435877138 * ___invariantInfo_0; public: inline static int32_t get_offset_of_invariantInfo_0() { return static_cast<int32_t>(offsetof(NumberFormatInfo_t435877138_StaticFields, ___invariantInfo_0)); } inline NumberFormatInfo_t435877138 * get_invariantInfo_0() const { return ___invariantInfo_0; } inline NumberFormatInfo_t435877138 ** get_address_of_invariantInfo_0() { return &___invariantInfo_0; } inline void set_invariantInfo_0(NumberFormatInfo_t435877138 * value) { ___invariantInfo_0 = value; Il2CppCodeGenWriteBarrier((&___invariantInfo_0), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // NUMBERFORMATINFO_T435877138_H #ifndef MULTICASTDELEGATE_T_H #define MULTICASTDELEGATE_T_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.MulticastDelegate struct MulticastDelegate_t : public Delegate_t1188392813 { public: // System.Delegate[] System.MulticastDelegate::delegates DelegateU5BU5D_t1703627840* ___delegates_11; public: inline static int32_t get_offset_of_delegates_11() { return static_cast<int32_t>(offsetof(MulticastDelegate_t, ___delegates_11)); } inline DelegateU5BU5D_t1703627840* get_delegates_11() const { return ___delegates_11; } inline DelegateU5BU5D_t1703627840** get_address_of_delegates_11() { return &___delegates_11; } inline void set_delegates_11(DelegateU5BU5D_t1703627840* value) { ___delegates_11 = value; Il2CppCodeGenWriteBarrier((&___delegates_11), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif // Native definition for P/Invoke marshalling of System.MulticastDelegate struct MulticastDelegate_t_marshaled_pinvoke : public Delegate_t1188392813_marshaled_pinvoke { DelegateU5BU5D_t1703627840* ___delegates_11; }; // Native definition for COM marshalling of System.MulticastDelegate struct MulticastDelegate_t_marshaled_com : public Delegate_t1188392813_marshaled_com { DelegateU5BU5D_t1703627840* ___delegates_11; }; #endif // MULTICASTDELEGATE_T_H #ifndef TYPE_T_H #define TYPE_T_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Type struct Type_t : public MemberInfo_t { public: // System.RuntimeTypeHandle System.Type::_impl RuntimeTypeHandle_t3027515415 ____impl_9; public: inline static int32_t get_offset_of__impl_9() { return static_cast<int32_t>(offsetof(Type_t, ____impl_9)); } inline RuntimeTypeHandle_t3027515415 get__impl_9() const { return ____impl_9; } inline RuntimeTypeHandle_t3027515415 * get_address_of__impl_9() { return &____impl_9; } inline void set__impl_9(RuntimeTypeHandle_t3027515415 value) { ____impl_9 = value; } }; struct Type_t_StaticFields { public: // System.Reflection.MemberFilter System.Type::FilterAttribute MemberFilter_t426314064 * ___FilterAttribute_0; // System.Reflection.MemberFilter System.Type::FilterName MemberFilter_t426314064 * ___FilterName_1; // System.Reflection.MemberFilter System.Type::FilterNameIgnoreCase MemberFilter_t426314064 * ___FilterNameIgnoreCase_2; // System.Object System.Type::Missing RuntimeObject * ___Missing_3; // System.Char System.Type::Delimiter Il2CppChar ___Delimiter_4; // System.Type[] System.Type::EmptyTypes TypeU5BU5D_t3940880105* ___EmptyTypes_5; // System.Reflection.Binder System.Type::defaultBinder Binder_t2999457153 * ___defaultBinder_6; public: inline static int32_t get_offset_of_FilterAttribute_0() { return static_cast<int32_t>(offsetof(Type_t_StaticFields, ___FilterAttribute_0)); } inline MemberFilter_t426314064 * get_FilterAttribute_0() const { return ___FilterAttribute_0; } inline MemberFilter_t426314064 ** get_address_of_FilterAttribute_0() { return &___FilterAttribute_0; } inline void set_FilterAttribute_0(MemberFilter_t426314064 * value) { ___FilterAttribute_0 = value; Il2CppCodeGenWriteBarrier((&___FilterAttribute_0), value); } inline static int32_t get_offset_of_FilterName_1() { return static_cast<int32_t>(offsetof(Type_t_StaticFields, ___FilterName_1)); } inline MemberFilter_t426314064 * get_FilterName_1() const { return ___FilterName_1; } inline MemberFilter_t426314064 ** get_address_of_FilterName_1() { return &___FilterName_1; } inline void set_FilterName_1(MemberFilter_t426314064 * value) { ___FilterName_1 = value; Il2CppCodeGenWriteBarrier((&___FilterName_1), value); } inline static int32_t get_offset_of_FilterNameIgnoreCase_2() { return static_cast<int32_t>(offsetof(Type_t_StaticFields, ___FilterNameIgnoreCase_2)); } inline MemberFilter_t426314064 * get_FilterNameIgnoreCase_2() const { return ___FilterNameIgnoreCase_2; } inline MemberFilter_t426314064 ** get_address_of_FilterNameIgnoreCase_2() { return &___FilterNameIgnoreCase_2; } inline void set_FilterNameIgnoreCase_2(MemberFilter_t426314064 * value) { ___FilterNameIgnoreCase_2 = value; Il2CppCodeGenWriteBarrier((&___FilterNameIgnoreCase_2), value); } inline static int32_t get_offset_of_Missing_3() { return static_cast<int32_t>(offsetof(Type_t_StaticFields, ___Missing_3)); } inline RuntimeObject * get_Missing_3() const { return ___Missing_3; } inline RuntimeObject ** get_address_of_Missing_3() { return &___Missing_3; } inline void set_Missing_3(RuntimeObject * value) { ___Missing_3 = value; Il2CppCodeGenWriteBarrier((&___Missing_3), value); } inline static int32_t get_offset_of_Delimiter_4() { return static_cast<int32_t>(offsetof(Type_t_StaticFields, ___Delimiter_4)); } inline Il2CppChar get_Delimiter_4() const { return ___Delimiter_4; } inline Il2CppChar* get_address_of_Delimiter_4() { return &___Delimiter_4; } inline void set_Delimiter_4(Il2CppChar value) { ___Delimiter_4 = value; } inline static int32_t get_offset_of_EmptyTypes_5() { return static_cast<int32_t>(offsetof(Type_t_StaticFields, ___EmptyTypes_5)); } inline TypeU5BU5D_t3940880105* get_EmptyTypes_5() const { return ___EmptyTypes_5; } inline TypeU5BU5D_t3940880105** get_address_of_EmptyTypes_5() { return &___EmptyTypes_5; } inline void set_EmptyTypes_5(TypeU5BU5D_t3940880105* value) { ___EmptyTypes_5 = value; Il2CppCodeGenWriteBarrier((&___EmptyTypes_5), value); } inline static int32_t get_offset_of_defaultBinder_6() { return static_cast<int32_t>(offsetof(Type_t_StaticFields, ___defaultBinder_6)); } inline Binder_t2999457153 * get_defaultBinder_6() const { return ___defaultBinder_6; } inline Binder_t2999457153 ** get_address_of_defaultBinder_6() { return &___defaultBinder_6; } inline void set_defaultBinder_6(Binder_t2999457153 * value) { ___defaultBinder_6 = value; Il2CppCodeGenWriteBarrier((&___defaultBinder_6), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // TYPE_T_H #ifndef VARIANT_T2753289927_H #define VARIANT_T2753289927_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Variant struct Variant_t2753289927 { public: union { #pragma pack(push, tp, 1) struct { // System.Int16 System.Variant::vt int16_t ___vt_0; }; #pragma pack(pop, tp) struct { int16_t ___vt_0_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___wReserved1_1_OffsetPadding[2]; // System.UInt16 System.Variant::wReserved1 uint16_t ___wReserved1_1; }; #pragma pack(pop, tp) struct { char ___wReserved1_1_OffsetPadding_forAlignmentOnly[2]; uint16_t ___wReserved1_1_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___wReserved2_2_OffsetPadding[4]; // System.UInt16 System.Variant::wReserved2 uint16_t ___wReserved2_2; }; #pragma pack(pop, tp) struct { char ___wReserved2_2_OffsetPadding_forAlignmentOnly[4]; uint16_t ___wReserved2_2_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___wReserved3_3_OffsetPadding[6]; // System.UInt16 System.Variant::wReserved3 uint16_t ___wReserved3_3; }; #pragma pack(pop, tp) struct { char ___wReserved3_3_OffsetPadding_forAlignmentOnly[6]; uint16_t ___wReserved3_3_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___llVal_4_OffsetPadding[8]; // System.Int64 System.Variant::llVal int64_t ___llVal_4; }; #pragma pack(pop, tp) struct { char ___llVal_4_OffsetPadding_forAlignmentOnly[8]; int64_t ___llVal_4_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___lVal_5_OffsetPadding[8]; // System.Int32 System.Variant::lVal int32_t ___lVal_5; }; #pragma pack(pop, tp) struct { char ___lVal_5_OffsetPadding_forAlignmentOnly[8]; int32_t ___lVal_5_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___bVal_6_OffsetPadding[8]; // System.Byte System.Variant::bVal uint8_t ___bVal_6; }; #pragma pack(pop, tp) struct { char ___bVal_6_OffsetPadding_forAlignmentOnly[8]; uint8_t ___bVal_6_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___iVal_7_OffsetPadding[8]; // System.Int16 System.Variant::iVal int16_t ___iVal_7; }; #pragma pack(pop, tp) struct { char ___iVal_7_OffsetPadding_forAlignmentOnly[8]; int16_t ___iVal_7_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___fltVal_8_OffsetPadding[8]; // System.Single System.Variant::fltVal float ___fltVal_8; }; #pragma pack(pop, tp) struct { char ___fltVal_8_OffsetPadding_forAlignmentOnly[8]; float ___fltVal_8_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___dblVal_9_OffsetPadding[8]; // System.Double System.Variant::dblVal double ___dblVal_9; }; #pragma pack(pop, tp) struct { char ___dblVal_9_OffsetPadding_forAlignmentOnly[8]; double ___dblVal_9_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___boolVal_10_OffsetPadding[8]; // System.Int16 System.Variant::boolVal int16_t ___boolVal_10; }; #pragma pack(pop, tp) struct { char ___boolVal_10_OffsetPadding_forAlignmentOnly[8]; int16_t ___boolVal_10_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___bstrVal_11_OffsetPadding[8]; // System.IntPtr System.Variant::bstrVal intptr_t ___bstrVal_11; }; #pragma pack(pop, tp) struct { char ___bstrVal_11_OffsetPadding_forAlignmentOnly[8]; intptr_t ___bstrVal_11_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___cVal_12_OffsetPadding[8]; // System.SByte System.Variant::cVal int8_t ___cVal_12; }; #pragma pack(pop, tp) struct { char ___cVal_12_OffsetPadding_forAlignmentOnly[8]; int8_t ___cVal_12_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___uiVal_13_OffsetPadding[8]; // System.UInt16 System.Variant::uiVal uint16_t ___uiVal_13; }; #pragma pack(pop, tp) struct { char ___uiVal_13_OffsetPadding_forAlignmentOnly[8]; uint16_t ___uiVal_13_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___ulVal_14_OffsetPadding[8]; // System.UInt32 System.Variant::ulVal uint32_t ___ulVal_14; }; #pragma pack(pop, tp) struct { char ___ulVal_14_OffsetPadding_forAlignmentOnly[8]; uint32_t ___ulVal_14_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___ullVal_15_OffsetPadding[8]; // System.UInt64 System.Variant::ullVal uint64_t ___ullVal_15; }; #pragma pack(pop, tp) struct { char ___ullVal_15_OffsetPadding_forAlignmentOnly[8]; uint64_t ___ullVal_15_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___intVal_16_OffsetPadding[8]; // System.Int32 System.Variant::intVal int32_t ___intVal_16; }; #pragma pack(pop, tp) struct { char ___intVal_16_OffsetPadding_forAlignmentOnly[8]; int32_t ___intVal_16_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___uintVal_17_OffsetPadding[8]; // System.UInt32 System.Variant::uintVal uint32_t ___uintVal_17; }; #pragma pack(pop, tp) struct { char ___uintVal_17_OffsetPadding_forAlignmentOnly[8]; uint32_t ___uintVal_17_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___pdispVal_18_OffsetPadding[8]; // System.IntPtr System.Variant::pdispVal intptr_t ___pdispVal_18; }; #pragma pack(pop, tp) struct { char ___pdispVal_18_OffsetPadding_forAlignmentOnly[8]; intptr_t ___pdispVal_18_forAlignmentOnly; }; #pragma pack(push, tp, 1) struct { char ___bRecord_19_OffsetPadding[8]; // System.BRECORD System.Variant::bRecord BRECORD_t3470580684 ___bRecord_19; }; #pragma pack(pop, tp) struct { char ___bRecord_19_OffsetPadding_forAlignmentOnly[8]; BRECORD_t3470580684 ___bRecord_19_forAlignmentOnly; }; }; public: inline static int32_t get_offset_of_vt_0() { return static_cast<int32_t>(offsetof(Variant_t2753289927, ___vt_0)); } inline int16_t get_vt_0() const { return ___vt_0; } inline int16_t* get_address_of_vt_0() { return &___vt_0; } inline void set_vt_0(int16_t value) { ___vt_0 = value; } inline static int32_t get_offset_of_wReserved1_1() { return static_cast<int32_t>(offsetof(Variant_t2753289927, ___wReserved1_1)); } inline uint16_t get_wReserved1_1() const { return ___wReserved1_1; } inline uint16_t* get_address_of_wReserved1_1() { return &___wReserved1_1; } inline void set_wReserved1_1(uint16_t value) { ___wReserved1_1 = value; } inline static int32_t get_offset_of_wReserved2_2() { return static_cast<int32_t>(offsetof(Variant_t2753289927, ___wReserved2_2)); } inline uint16_t get_wReserved2_2() const { return ___wReserved2_2; } inline uint16_t* get_address_of_wReserved2_2() { return &___wReserved2_2; } inline void set_wReserved2_2(uint16_t value) { ___wReserved2_2 = value; } inline static int32_t get_offset_of_wReserved3_3() { return static_cast<int32_t>(offsetof(Variant_t2753289927, ___wReserved3_3)); } inline uint16_t get_wReserved3_3() const { return ___wReserved3_3; } inline uint16_t* get_address_of_wReserved3_3() { return &___wReserved3_3; } inline void set_wReserved3_3(uint16_t value) { ___wReserved3_3 = value; } inline static int32_t get_offset_of_llVal_4() { return static_cast<int32_t>(offsetof(Variant_t2753289927, ___llVal_4)); } inline int64_t get_llVal_4() const { return ___llVal_4; } inline int64_t* get_address_of_llVal_4() { return &___llVal_4; } inline void set_llVal_4(int64_t value) { ___llVal_4 = value; } inline static int32_t get_offset_of_lVal_5() { return static_cast<int32_t>(offsetof(Variant_t2753289927, ___lVal_5)); } inline int32_t get_lVal_5() const { return ___lVal_5; } inline int32_t* get_address_of_lVal_5() { return &___lVal_5; } inline void set_lVal_5(int32_t value) { ___lVal_5 = value; } inline static int32_t get_offset_of_bVal_6() { return static_cast<int32_t>(offsetof(Variant_t2753289927, ___bVal_6)); } inline uint8_t get_bVal_6() const { return ___bVal_6; } inline uint8_t* get_address_of_bVal_6() { return &___bVal_6; } inline void set_bVal_6(uint8_t value) { ___bVal_6 = value; } inline static int32_t get_offset_of_iVal_7() { return static_cast<int32_t>(offsetof(Variant_t2753289927, ___iVal_7)); } inline int16_t get_iVal_7() const { return ___iVal_7; } inline int16_t* get_address_of_iVal_7() { return &___iVal_7; } inline void set_iVal_7(int16_t value) { ___iVal_7 = value; } inline static int32_t get_offset_of_fltVal_8() { return static_cast<int32_t>(offsetof(Variant_t2753289927, ___fltVal_8)); } inline float get_fltVal_8() const { return ___fltVal_8; } inline float* get_address_of_fltVal_8() { return &___fltVal_8; } inline void set_fltVal_8(float value) { ___fltVal_8 = value; } inline static int32_t get_offset_of_dblVal_9() { return static_cast<int32_t>(offsetof(Variant_t2753289927, ___dblVal_9)); } inline double get_dblVal_9() const { return ___dblVal_9; } inline double* get_address_of_dblVal_9() { return &___dblVal_9; } inline void set_dblVal_9(double value) { ___dblVal_9 = value; } inline static int32_t get_offset_of_boolVal_10() { return static_cast<int32_t>(offsetof(Variant_t2753289927, ___boolVal_10)); } inline int16_t get_boolVal_10() const { return ___boolVal_10; } inline int16_t* get_address_of_boolVal_10() { return &___boolVal_10; } inline void set_boolVal_10(int16_t value) { ___boolVal_10 = value; } inline static int32_t get_offset_of_bstrVal_11() { return static_cast<int32_t>(offsetof(Variant_t2753289927, ___bstrVal_11)); } inline intptr_t get_bstrVal_11() const { return ___bstrVal_11; } inline intptr_t* get_address_of_bstrVal_11() { return &___bstrVal_11; } inline void set_bstrVal_11(intptr_t value) { ___bstrVal_11 = value; } inline static int32_t get_offset_of_cVal_12() { return static_cast<int32_t>(offsetof(Variant_t2753289927, ___cVal_12)); } inline int8_t get_cVal_12() const { return ___cVal_12; } inline int8_t* get_address_of_cVal_12() { return &___cVal_12; } inline void set_cVal_12(int8_t value) { ___cVal_12 = value; } inline static int32_t get_offset_of_uiVal_13() { return static_cast<int32_t>(offsetof(Variant_t2753289927, ___uiVal_13)); } inline uint16_t get_uiVal_13() const { return ___uiVal_13; } inline uint16_t* get_address_of_uiVal_13() { return &___uiVal_13; } inline void set_uiVal_13(uint16_t value) { ___uiVal_13 = value; } inline static int32_t get_offset_of_ulVal_14() { return static_cast<int32_t>(offsetof(Variant_t2753289927, ___ulVal_14)); } inline uint32_t get_ulVal_14() const { return ___ulVal_14; } inline uint32_t* get_address_of_ulVal_14() { return &___ulVal_14; } inline void set_ulVal_14(uint32_t value) { ___ulVal_14 = value; } inline static int32_t get_offset_of_ullVal_15() { return static_cast<int32_t>(offsetof(Variant_t2753289927, ___ullVal_15)); } inline uint64_t get_ullVal_15() const { return ___ullVal_15; } inline uint64_t* get_address_of_ullVal_15() { return &___ullVal_15; } inline void set_ullVal_15(uint64_t value) { ___ullVal_15 = value; } inline static int32_t get_offset_of_intVal_16() { return static_cast<int32_t>(offsetof(Variant_t2753289927, ___intVal_16)); } inline int32_t get_intVal_16() const { return ___intVal_16; } inline int32_t* get_address_of_intVal_16() { return &___intVal_16; } inline void set_intVal_16(int32_t value) { ___intVal_16 = value; } inline static int32_t get_offset_of_uintVal_17() { return static_cast<int32_t>(offsetof(Variant_t2753289927, ___uintVal_17)); } inline uint32_t get_uintVal_17() const { return ___uintVal_17; } inline uint32_t* get_address_of_uintVal_17() { return &___uintVal_17; } inline void set_uintVal_17(uint32_t value) { ___uintVal_17 = value; } inline static int32_t get_offset_of_pdispVal_18() { return static_cast<int32_t>(offsetof(Variant_t2753289927, ___pdispVal_18)); } inline intptr_t get_pdispVal_18() const { return ___pdispVal_18; } inline intptr_t* get_address_of_pdispVal_18() { return &___pdispVal_18; } inline void set_pdispVal_18(intptr_t value) { ___pdispVal_18 = value; } inline static int32_t get_offset_of_bRecord_19() { return static_cast<int32_t>(offsetof(Variant_t2753289927, ___bRecord_19)); } inline BRECORD_t3470580684 get_bRecord_19() const { return ___bRecord_19; } inline BRECORD_t3470580684 * get_address_of_bRecord_19() { return &___bRecord_19; } inline void set_bRecord_19(BRECORD_t3470580684 value) { ___bRecord_19 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // VARIANT_T2753289927_H #ifndef ARGUMENTNULLEXCEPTION_T1615371798_H #define ARGUMENTNULLEXCEPTION_T1615371798_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.ArgumentNullException struct ArgumentNullException_t1615371798 : public ArgumentException_t132251570 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // ARGUMENTNULLEXCEPTION_T1615371798_H #ifndef CONSOLEKEYINFO_T1802691652_H #define CONSOLEKEYINFO_T1802691652_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.ConsoleKeyInfo struct ConsoleKeyInfo_t1802691652 { public: // System.Char System.ConsoleKeyInfo::_keyChar Il2CppChar ____keyChar_0; // System.ConsoleKey System.ConsoleKeyInfo::_key int32_t ____key_1; // System.ConsoleModifiers System.ConsoleKeyInfo::_mods int32_t ____mods_2; public: inline static int32_t get_offset_of__keyChar_0() { return static_cast<int32_t>(offsetof(ConsoleKeyInfo_t1802691652, ____keyChar_0)); } inline Il2CppChar get__keyChar_0() const { return ____keyChar_0; } inline Il2CppChar* get_address_of__keyChar_0() { return &____keyChar_0; } inline void set__keyChar_0(Il2CppChar value) { ____keyChar_0 = value; } inline static int32_t get_offset_of__key_1() { return static_cast<int32_t>(offsetof(ConsoleKeyInfo_t1802691652, ____key_1)); } inline int32_t get__key_1() const { return ____key_1; } inline int32_t* get_address_of__key_1() { return &____key_1; } inline void set__key_1(int32_t value) { ____key_1 = value; } inline static int32_t get_offset_of__mods_2() { return static_cast<int32_t>(offsetof(ConsoleKeyInfo_t1802691652, ____mods_2)); } inline int32_t get__mods_2() const { return ____mods_2; } inline int32_t* get_address_of__mods_2() { return &____mods_2; } inline void set__mods_2(int32_t value) { ____mods_2 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif // Native definition for P/Invoke marshalling of System.ConsoleKeyInfo struct ConsoleKeyInfo_t1802691652_marshaled_pinvoke { uint8_t ____keyChar_0; int32_t ____key_1; int32_t ____mods_2; }; // Native definition for COM marshalling of System.ConsoleKeyInfo struct ConsoleKeyInfo_t1802691652_marshaled_com { uint8_t ____keyChar_0; int32_t ____key_1; int32_t ____mods_2; }; #endif // CONSOLEKEYINFO_T1802691652_H #ifndef RUNTIMEASSEMBLY_T1451753063_H #define RUNTIMEASSEMBLY_T1451753063_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Reflection.RuntimeAssembly struct RuntimeAssembly_t1451753063 : public Assembly_t { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // RUNTIMEASSEMBLY_T1451753063_H #ifndef ARGUMENTOUTOFRANGEEXCEPTION_T777629997_H #define ARGUMENTOUTOFRANGEEXCEPTION_T777629997_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.ArgumentOutOfRangeException struct ArgumentOutOfRangeException_t777629997 : public ArgumentException_t132251570 { public: // System.Object System.ArgumentOutOfRangeException::m_actualValue RuntimeObject * ___m_actualValue_19; public: inline static int32_t get_offset_of_m_actualValue_19() { return static_cast<int32_t>(offsetof(ArgumentOutOfRangeException_t777629997, ___m_actualValue_19)); } inline RuntimeObject * get_m_actualValue_19() const { return ___m_actualValue_19; } inline RuntimeObject ** get_address_of_m_actualValue_19() { return &___m_actualValue_19; } inline void set_m_actualValue_19(RuntimeObject * value) { ___m_actualValue_19 = value; Il2CppCodeGenWriteBarrier((&___m_actualValue_19), value); } }; struct ArgumentOutOfRangeException_t777629997_StaticFields { public: // System.String modreq(System.Runtime.CompilerServices.IsVolatile) System.ArgumentOutOfRangeException::_rangeMessage String_t* ____rangeMessage_18; public: inline static int32_t get_offset_of__rangeMessage_18() { return static_cast<int32_t>(offsetof(ArgumentOutOfRangeException_t777629997_StaticFields, ____rangeMessage_18)); } inline String_t* get__rangeMessage_18() const { return ____rangeMessage_18; } inline String_t** get_address_of__rangeMessage_18() { return &____rangeMessage_18; } inline void set__rangeMessage_18(String_t* value) { ____rangeMessage_18 = value; Il2CppCodeGenWriteBarrier((&____rangeMessage_18), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // ARGUMENTOUTOFRANGEEXCEPTION_T777629997_H #ifndef MODULE_T2987026101_H #define MODULE_T2987026101_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Reflection.Module struct Module_t2987026101 : public RuntimeObject { public: // System.IntPtr System.Reflection.Module::_impl intptr_t ____impl_2; // System.Reflection.Assembly System.Reflection.Module::assembly Assembly_t * ___assembly_3; // System.String System.Reflection.Module::fqname String_t* ___fqname_4; // System.String System.Reflection.Module::name String_t* ___name_5; // System.String System.Reflection.Module::scopename String_t* ___scopename_6; // System.Boolean System.Reflection.Module::is_resource bool ___is_resource_7; // System.Int32 System.Reflection.Module::token int32_t ___token_8; public: inline static int32_t get_offset_of__impl_2() { return static_cast<int32_t>(offsetof(Module_t2987026101, ____impl_2)); } inline intptr_t get__impl_2() const { return ____impl_2; } inline intptr_t* get_address_of__impl_2() { return &____impl_2; } inline void set__impl_2(intptr_t value) { ____impl_2 = value; } inline static int32_t get_offset_of_assembly_3() { return static_cast<int32_t>(offsetof(Module_t2987026101, ___assembly_3)); } inline Assembly_t * get_assembly_3() const { return ___assembly_3; } inline Assembly_t ** get_address_of_assembly_3() { return &___assembly_3; } inline void set_assembly_3(Assembly_t * value) { ___assembly_3 = value; Il2CppCodeGenWriteBarrier((&___assembly_3), value); } inline static int32_t get_offset_of_fqname_4() { return static_cast<int32_t>(offsetof(Module_t2987026101, ___fqname_4)); } inline String_t* get_fqname_4() const { return ___fqname_4; } inline String_t** get_address_of_fqname_4() { return &___fqname_4; } inline void set_fqname_4(String_t* value) { ___fqname_4 = value; Il2CppCodeGenWriteBarrier((&___fqname_4), value); } inline static int32_t get_offset_of_name_5() { return static_cast<int32_t>(offsetof(Module_t2987026101, ___name_5)); } inline String_t* get_name_5() const { return ___name_5; } inline String_t** get_address_of_name_5() { return &___name_5; } inline void set_name_5(String_t* value) { ___name_5 = value; Il2CppCodeGenWriteBarrier((&___name_5), value); } inline static int32_t get_offset_of_scopename_6() { return static_cast<int32_t>(offsetof(Module_t2987026101, ___scopename_6)); } inline String_t* get_scopename_6() const { return ___scopename_6; } inline String_t** get_address_of_scopename_6() { return &___scopename_6; } inline void set_scopename_6(String_t* value) { ___scopename_6 = value; Il2CppCodeGenWriteBarrier((&___scopename_6), value); } inline static int32_t get_offset_of_is_resource_7() { return static_cast<int32_t>(offsetof(Module_t2987026101, ___is_resource_7)); } inline bool get_is_resource_7() const { return ___is_resource_7; } inline bool* get_address_of_is_resource_7() { return &___is_resource_7; } inline void set_is_resource_7(bool value) { ___is_resource_7 = value; } inline static int32_t get_offset_of_token_8() { return static_cast<int32_t>(offsetof(Module_t2987026101, ___token_8)); } inline int32_t get_token_8() const { return ___token_8; } inline int32_t* get_address_of_token_8() { return &___token_8; } inline void set_token_8(int32_t value) { ___token_8 = value; } }; struct Module_t2987026101_StaticFields { public: // System.Reflection.TypeFilter System.Reflection.Module::FilterTypeName TypeFilter_t2356120900 * ___FilterTypeName_0; // System.Reflection.TypeFilter System.Reflection.Module::FilterTypeNameIgnoreCase TypeFilter_t2356120900 * ___FilterTypeNameIgnoreCase_1; public: inline static int32_t get_offset_of_FilterTypeName_0() { return static_cast<int32_t>(offsetof(Module_t2987026101_StaticFields, ___FilterTypeName_0)); } inline TypeFilter_t2356120900 * get_FilterTypeName_0() const { return ___FilterTypeName_0; } inline TypeFilter_t2356120900 ** get_address_of_FilterTypeName_0() { return &___FilterTypeName_0; } inline void set_FilterTypeName_0(TypeFilter_t2356120900 * value) { ___FilterTypeName_0 = value; Il2CppCodeGenWriteBarrier((&___FilterTypeName_0), value); } inline static int32_t get_offset_of_FilterTypeNameIgnoreCase_1() { return static_cast<int32_t>(offsetof(Module_t2987026101_StaticFields, ___FilterTypeNameIgnoreCase_1)); } inline TypeFilter_t2356120900 * get_FilterTypeNameIgnoreCase_1() const { return ___FilterTypeNameIgnoreCase_1; } inline TypeFilter_t2356120900 ** get_address_of_FilterTypeNameIgnoreCase_1() { return &___FilterTypeNameIgnoreCase_1; } inline void set_FilterTypeNameIgnoreCase_1(TypeFilter_t2356120900 * value) { ___FilterTypeNameIgnoreCase_1 = value; Il2CppCodeGenWriteBarrier((&___FilterTypeNameIgnoreCase_1), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif // Native definition for P/Invoke marshalling of System.Reflection.Module struct Module_t2987026101_marshaled_pinvoke { intptr_t ____impl_2; Assembly_t_marshaled_pinvoke* ___assembly_3; char* ___fqname_4; char* ___name_5; char* ___scopename_6; int32_t ___is_resource_7; int32_t ___token_8; }; // Native definition for COM marshalling of System.Reflection.Module struct Module_t2987026101_marshaled_com { intptr_t ____impl_2; Assembly_t_marshaled_com* ___assembly_3; Il2CppChar* ___fqname_4; Il2CppChar* ___name_5; Il2CppChar* ___scopename_6; int32_t ___is_resource_7; int32_t ___token_8; }; #endif // MODULE_T2987026101_H #ifndef STREAMINGCONTEXT_T3711869237_H #define STREAMINGCONTEXT_T3711869237_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Runtime.Serialization.StreamingContext struct StreamingContext_t3711869237 { public: // System.Object System.Runtime.Serialization.StreamingContext::m_additionalContext RuntimeObject * ___m_additionalContext_0; // System.Runtime.Serialization.StreamingContextStates System.Runtime.Serialization.StreamingContext::m_state int32_t ___m_state_1; public: inline static int32_t get_offset_of_m_additionalContext_0() { return static_cast<int32_t>(offsetof(StreamingContext_t3711869237, ___m_additionalContext_0)); } inline RuntimeObject * get_m_additionalContext_0() const { return ___m_additionalContext_0; } inline RuntimeObject ** get_address_of_m_additionalContext_0() { return &___m_additionalContext_0; } inline void set_m_additionalContext_0(RuntimeObject * value) { ___m_additionalContext_0 = value; Il2CppCodeGenWriteBarrier((&___m_additionalContext_0), value); } inline static int32_t get_offset_of_m_state_1() { return static_cast<int32_t>(offsetof(StreamingContext_t3711869237, ___m_state_1)); } inline int32_t get_m_state_1() const { return ___m_state_1; } inline int32_t* get_address_of_m_state_1() { return &___m_state_1; } inline void set_m_state_1(int32_t value) { ___m_state_1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif // Native definition for P/Invoke marshalling of System.Runtime.Serialization.StreamingContext struct StreamingContext_t3711869237_marshaled_pinvoke { Il2CppIUnknown* ___m_additionalContext_0; int32_t ___m_state_1; }; // Native definition for COM marshalling of System.Runtime.Serialization.StreamingContext struct StreamingContext_t3711869237_marshaled_com { Il2CppIUnknown* ___m_additionalContext_0; int32_t ___m_state_1; }; #endif // STREAMINGCONTEXT_T3711869237_H #ifndef UNHANDLEDEXCEPTIONEVENTHANDLER_T3101989324_H #define UNHANDLEDEXCEPTIONEVENTHANDLER_T3101989324_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.UnhandledExceptionEventHandler struct UnhandledExceptionEventHandler_t3101989324 : public MulticastDelegate_t { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // UNHANDLEDEXCEPTIONEVENTHANDLER_T3101989324_H #ifndef ASYNCCALLBACK_T3962456242_H #define ASYNCCALLBACK_T3962456242_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.AsyncCallback struct AsyncCallback_t3962456242 : public MulticastDelegate_t { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // ASYNCCALLBACK_T3962456242_H #ifndef TYPEINFO_T1690786683_H #define TYPEINFO_T1690786683_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Reflection.TypeInfo struct TypeInfo_t1690786683 : public Type_t { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // TYPEINFO_T1690786683_H #ifndef RUNTIMETYPE_T3636489352_H #define RUNTIMETYPE_T3636489352_H #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.RuntimeType struct RuntimeType_t3636489352 : public TypeInfo_t1690786683 { public: // System.MonoTypeInfo System.RuntimeType::type_info MonoTypeInfo_t3366989025 * ___type_info_26; // System.Object System.RuntimeType::GenericCache RuntimeObject * ___GenericCache_27; // System.Reflection.RuntimeConstructorInfo System.RuntimeType::m_serializationCtor RuntimeConstructorInfo_t1806616898 * ___m_serializationCtor_28; public: inline static int32_t get_offset_of_type_info_26() { return static_cast<int32_t>(offsetof(RuntimeType_t3636489352, ___type_info_26)); } inline MonoTypeInfo_t3366989025 * get_type_info_26() const { return ___type_info_26; } inline MonoTypeInfo_t3366989025 ** get_address_of_type_info_26() { return &___type_info_26; } inline void set_type_info_26(MonoTypeInfo_t3366989025 * value) { ___type_info_26 = value; Il2CppCodeGenWriteBarrier((&___type_info_26), value); } inline static int32_t get_offset_of_GenericCache_27() { return static_cast<int32_t>(offsetof(RuntimeType_t3636489352, ___GenericCache_27)); } inline RuntimeObject * get_GenericCache_27() const { return ___GenericCache_27; } inline RuntimeObject ** get_address_of_GenericCache_27() { return &___GenericCache_27; } inline void set_GenericCache_27(RuntimeObject * value) { ___GenericCache_27 = value; Il2CppCodeGenWriteBarrier((&___GenericCache_27), value); } inline static int32_t get_offset_of_m_serializationCtor_28() { return static_cast<int32_t>(offsetof(RuntimeType_t3636489352, ___m_serializationCtor_28)); } inline RuntimeConstructorInfo_t1806616898 * get_m_serializationCtor_28() const { return ___m_serializationCtor_28; } inline RuntimeConstructorInfo_t1806616898 ** get_address_of_m_serializationCtor_28() { return &___m_serializationCtor_28; } inline void set_m_serializationCtor_28(RuntimeConstructorInfo_t1806616898 * value) { ___m_serializationCtor_28 = value; Il2CppCodeGenWriteBarrier((&___m_serializationCtor_28), value); } }; struct RuntimeType_t3636489352_StaticFields { public: // System.RuntimeType System.RuntimeType::ValueType RuntimeType_t3636489352 * ___ValueType_10; // System.RuntimeType System.RuntimeType::EnumType RuntimeType_t3636489352 * ___EnumType_11; // System.RuntimeType System.RuntimeType::ObjectType RuntimeType_t3636489352 * ___ObjectType_12; // System.RuntimeType System.RuntimeType::StringType RuntimeType_t3636489352 * ___StringType_13; // System.RuntimeType System.RuntimeType::DelegateType RuntimeType_t3636489352 * ___DelegateType_14; // System.Type[] System.RuntimeType::s_SICtorParamTypes TypeU5BU5D_t3940880105* ___s_SICtorParamTypes_15; // System.RuntimeType System.RuntimeType::s_typedRef RuntimeType_t3636489352 * ___s_typedRef_25; // System.Collections.Generic.Dictionary`2<System.Guid,System.Type> System.RuntimeType::clsid_types Dictionary_2_t1532962293 * ___clsid_types_29; // System.Reflection.Emit.AssemblyBuilder System.RuntimeType::clsid_assemblybuilder AssemblyBuilder_t359885250 * ___clsid_assemblybuilder_30; public: inline static int32_t get_offset_of_ValueType_10() { return static_cast<int32_t>(offsetof(RuntimeType_t3636489352_StaticFields, ___ValueType_10)); } inline RuntimeType_t3636489352 * get_ValueType_10() const { return ___ValueType_10; } inline RuntimeType_t3636489352 ** get_address_of_ValueType_10() { return &___ValueType_10; } inline void set_ValueType_10(RuntimeType_t3636489352 * value) { ___ValueType_10 = value; Il2CppCodeGenWriteBarrier((&___ValueType_10), value); } inline static int32_t get_offset_of_EnumType_11() { return static_cast<int32_t>(offsetof(RuntimeType_t3636489352_StaticFields, ___EnumType_11)); } inline RuntimeType_t3636489352 * get_EnumType_11() const { return ___EnumType_11; } inline RuntimeType_t3636489352 ** get_address_of_EnumType_11() { return &___EnumType_11; } inline void set_EnumType_11(RuntimeType_t3636489352 * value) { ___EnumType_11 = value; Il2CppCodeGenWriteBarrier((&___EnumType_11), value); } inline static int32_t get_offset_of_ObjectType_12() { return static_cast<int32_t>(offsetof(RuntimeType_t3636489352_StaticFields, ___ObjectType_12)); } inline RuntimeType_t3636489352 * get_ObjectType_12() const { return ___ObjectType_12; } inline RuntimeType_t3636489352 ** get_address_of_ObjectType_12() { return &___ObjectType_12; } inline void set_ObjectType_12(RuntimeType_t3636489352 * value) { ___ObjectType_12 = value; Il2CppCodeGenWriteBarrier((&___ObjectType_12), value); } inline static int32_t get_offset_of_StringType_13() { return static_cast<int32_t>(offsetof(RuntimeType_t3636489352_StaticFields, ___StringType_13)); } inline RuntimeType_t3636489352 * get_StringType_13() const { return ___StringType_13; } inline RuntimeType_t3636489352 ** get_address_of_StringType_13() { return &___StringType_13; } inline void set_StringType_13(RuntimeType_t3636489352 * value) { ___StringType_13 = value; Il2CppCodeGenWriteBarrier((&___StringType_13), value); } inline static int32_t get_offset_of_DelegateType_14() { return static_cast<int32_t>(offsetof(RuntimeType_t3636489352_StaticFields, ___DelegateType_14)); } inline RuntimeType_t3636489352 * get_DelegateType_14() const { return ___DelegateType_14; } inline RuntimeType_t3636489352 ** get_address_of_DelegateType_14() { return &___DelegateType_14; } inline void set_DelegateType_14(RuntimeType_t3636489352 * value) { ___DelegateType_14 = value; Il2CppCodeGenWriteBarrier((&___DelegateType_14), value); } inline static int32_t get_offset_of_s_SICtorParamTypes_15() { return static_cast<int32_t>(offsetof(RuntimeType_t3636489352_StaticFields, ___s_SICtorParamTypes_15)); } inline TypeU5BU5D_t3940880105* get_s_SICtorParamTypes_15() const { return ___s_SICtorParamTypes_15; } inline TypeU5BU5D_t3940880105** get_address_of_s_SICtorParamTypes_15() { return &___s_SICtorParamTypes_15; } inline void set_s_SICtorParamTypes_15(TypeU5BU5D_t3940880105* value) { ___s_SICtorParamTypes_15 = value; Il2CppCodeGenWriteBarrier((&___s_SICtorParamTypes_15), value); } inline static int32_t get_offset_of_s_typedRef_25() { return static_cast<int32_t>(offsetof(RuntimeType_t3636489352_StaticFields, ___s_typedRef_25)); } inline RuntimeType_t3636489352 * get_s_typedRef_25() const { return ___s_typedRef_25; } inline RuntimeType_t3636489352 ** get_address_of_s_typedRef_25() { return &___s_typedRef_25; } inline void set_s_typedRef_25(RuntimeType_t3636489352 * value) { ___s_typedRef_25 = value; Il2CppCodeGenWriteBarrier((&___s_typedRef_25), value); } inline static int32_t get_offset_of_clsid_types_29() { return static_cast<int32_t>(offsetof(RuntimeType_t3636489352_StaticFields, ___clsid_types_29)); } inline Dictionary_2_t1532962293 * get_clsid_types_29() const { return ___clsid_types_29; } inline Dictionary_2_t1532962293 ** get_address_of_clsid_types_29() { return &___clsid_types_29; } inline void set_clsid_types_29(Dictionary_2_t1532962293 * value) { ___clsid_types_29 = value; Il2CppCodeGenWriteBarrier((&___clsid_types_29), value); } inline static int32_t get_offset_of_clsid_assemblybuilder_30() { return static_cast<int32_t>(offsetof(RuntimeType_t3636489352_StaticFields, ___clsid_assemblybuilder_30)); } inline AssemblyBuilder_t359885250 * get_clsid_assemblybuilder_30() const { return ___clsid_assemblybuilder_30; } inline AssemblyBuilder_t359885250 ** get_address_of_clsid_assemblybuilder_30() { return &___clsid_assemblybuilder_30; } inline void set_clsid_assemblybuilder_30(AssemblyBuilder_t359885250 * value) { ___clsid_assemblybuilder_30 = value; Il2CppCodeGenWriteBarrier((&___clsid_assemblybuilder_30), value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif #endif // RUNTIMETYPE_T3636489352_H // System.Object[] struct ObjectU5BU5D_t2843939325 : public RuntimeArray { public: ALIGN_FIELD (8) RuntimeObject * m_Items[1]; public: inline RuntimeObject * GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline RuntimeObject ** GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, RuntimeObject * value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } inline RuntimeObject * GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline RuntimeObject ** GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, RuntimeObject * value) { m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } }; // System.Delegate[] struct DelegateU5BU5D_t1703627840 : public RuntimeArray { public: ALIGN_FIELD (8) Delegate_t1188392813 * m_Items[1]; public: inline Delegate_t1188392813 * GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline Delegate_t1188392813 ** GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, Delegate_t1188392813 * value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } inline Delegate_t1188392813 * GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline Delegate_t1188392813 ** GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, Delegate_t1188392813 * value) { m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } }; // System.Int32[] struct Int32U5BU5D_t385246372 : public RuntimeArray { public: ALIGN_FIELD (8) int32_t m_Items[1]; public: inline int32_t GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline int32_t* GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, int32_t value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; } inline int32_t GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline int32_t* GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, int32_t value) { m_Items[index] = value; } }; // System.Type[] struct TypeU5BU5D_t3940880105 : public RuntimeArray { public: ALIGN_FIELD (8) Type_t * m_Items[1]; public: inline Type_t * GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline Type_t ** GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, Type_t * value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } inline Type_t * GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline Type_t ** GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, Type_t * value) { m_Items[index] = value; Il2CppCodeGenWriteBarrier(m_Items + index, value); } }; // System.Char[] struct CharU5BU5D_t3528271667 : public RuntimeArray { public: ALIGN_FIELD (8) Il2CppChar m_Items[1]; public: inline Il2CppChar GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline Il2CppChar* GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, Il2CppChar value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; } inline Il2CppChar GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline Il2CppChar* GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, Il2CppChar value) { m_Items[index] = value; } }; // System.Byte[] struct ByteU5BU5D_t4116647657 : public RuntimeArray { public: ALIGN_FIELD (8) uint8_t m_Items[1]; public: inline uint8_t GetAt(il2cpp_array_size_t index) const { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items[index]; } inline uint8_t* GetAddressAt(il2cpp_array_size_t index) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); return m_Items + index; } inline void SetAt(il2cpp_array_size_t index, uint8_t value) { IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length); m_Items[index] = value; } inline uint8_t GetAtUnchecked(il2cpp_array_size_t index) const { return m_Items[index]; } inline uint8_t* GetAddressAtUnchecked(il2cpp_array_size_t index) { return m_Items + index; } inline void SetAtUnchecked(il2cpp_array_size_t index, uint8_t value) { m_Items[index] = value; } }; extern "C" void InputRecord_t2660212290_marshal_pinvoke(const InputRecord_t2660212290& unmarshaled, InputRecord_t2660212290_marshaled_pinvoke& marshaled); extern "C" void InputRecord_t2660212290_marshal_pinvoke_back(const InputRecord_t2660212290_marshaled_pinvoke& marshaled, InputRecord_t2660212290& unmarshaled); extern "C" void InputRecord_t2660212290_marshal_pinvoke_cleanup(InputRecord_t2660212290_marshaled_pinvoke& marshaled); // System.Void System.Collections.Generic.List`1<System.Int32>::.ctor() extern "C" void List_1__ctor_m1204004817_gshared (List_1_t128053199 * __this, const RuntimeMethod* method); // System.Void System.Collections.Generic.List`1<System.Int32>::Add(T) extern "C" void List_1_Add_m2080863212_gshared (List_1_t128053199 * __this, int32_t p0, const RuntimeMethod* method); // T[] System.Collections.Generic.List`1<System.Int32>::ToArray() extern "C" Int32U5BU5D_t385246372* List_1_ToArray_m1469074435_gshared (List_1_t128053199 * __this, const RuntimeMethod* method); // System.String System.Environment::GetResourceString(System.String) extern "C" String_t* Environment_GetResourceString_m2063689938 (RuntimeObject * __this /* static, unused */, String_t* ___key0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.ArgumentException::.ctor(System.String) extern "C" void ArgumentException__ctor_m1312628991 (ArgumentException_t132251570 * __this, String_t* ___message0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int32 System.UInt32::CompareTo(System.Object) extern "C" int32_t UInt32_CompareTo_m362578384 (uint32_t* __this, RuntimeObject * ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int32 System.UInt32::CompareTo(System.UInt32) extern "C" int32_t UInt32_CompareTo_m2218823230 (uint32_t* __this, uint32_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.UInt32::Equals(System.Object) extern "C" bool UInt32_Equals_m351935437 (uint32_t* __this, RuntimeObject * ___obj0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.UInt32::Equals(System.UInt32) extern "C" bool UInt32_Equals_m4250336581 (uint32_t* __this, uint32_t ___obj0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int32 System.UInt32::GetHashCode() extern "C" int32_t UInt32_GetHashCode_m3722548385 (uint32_t* __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Globalization.NumberFormatInfo System.Globalization.NumberFormatInfo::get_CurrentInfo() extern "C" NumberFormatInfo_t435877138 * NumberFormatInfo_get_CurrentInfo_m2605582008 (RuntimeObject * __this /* static, unused */, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.String System.Number::FormatUInt32(System.UInt32,System.String,System.Globalization.NumberFormatInfo) extern "C" String_t* Number_FormatUInt32_m2486347252 (RuntimeObject * __this /* static, unused */, uint32_t ___value0, String_t* ___format1, NumberFormatInfo_t435877138 * ___info2, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.String System.UInt32::ToString() extern "C" String_t* UInt32_ToString_m2574561716 (uint32_t* __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Globalization.NumberFormatInfo System.Globalization.NumberFormatInfo::GetInstance(System.IFormatProvider) extern "C" NumberFormatInfo_t435877138 * NumberFormatInfo_GetInstance_m2833078205 (RuntimeObject * __this /* static, unused */, RuntimeObject* ___formatProvider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.String System.UInt32::ToString(System.IFormatProvider) extern "C" String_t* UInt32_ToString_m4293943134 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.String System.UInt32::ToString(System.String,System.IFormatProvider) extern "C" String_t* UInt32_ToString_m2420423038 (uint32_t* __this, String_t* ___format0, RuntimeObject* ___provider1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.UInt32 System.Number::ParseUInt32(System.String,System.Globalization.NumberStyles,System.Globalization.NumberFormatInfo) extern "C" uint32_t Number_ParseUInt32_m4237573864 (RuntimeObject * __this /* static, unused */, String_t* ___value0, int32_t ___options1, NumberFormatInfo_t435877138 * ___numfmt2, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.Globalization.NumberFormatInfo::ValidateParseStyleInteger(System.Globalization.NumberStyles) extern "C" void NumberFormatInfo_ValidateParseStyleInteger_m957858295 (RuntimeObject * __this /* static, unused */, int32_t ___style0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.Number::TryParseUInt32(System.String,System.Globalization.NumberStyles,System.Globalization.NumberFormatInfo,System.UInt32&) extern "C" bool Number_TryParseUInt32_m2802499845 (RuntimeObject * __this /* static, unused */, String_t* ___s0, int32_t ___style1, NumberFormatInfo_t435877138 * ___info2, uint32_t* ___result3, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.TypeCode System.UInt32::GetTypeCode() extern "C" int32_t UInt32_GetTypeCode_m88917904 (uint32_t* __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.Convert::ToBoolean(System.UInt32) extern "C" bool Convert_ToBoolean_m2807110707 (RuntimeObject * __this /* static, unused */, uint32_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.UInt32::System.IConvertible.ToBoolean(System.IFormatProvider) extern "C" bool UInt32_System_IConvertible_ToBoolean_m1763673183 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Char System.Convert::ToChar(System.UInt32) extern "C" Il2CppChar Convert_ToChar_m2796006345 (RuntimeObject * __this /* static, unused */, uint32_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Char System.UInt32::System.IConvertible.ToChar(System.IFormatProvider) extern "C" Il2CppChar UInt32_System_IConvertible_ToChar_m1873050533 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.SByte System.Convert::ToSByte(System.UInt32) extern "C" int8_t Convert_ToSByte_m2486156346 (RuntimeObject * __this /* static, unused */, uint32_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.SByte System.UInt32::System.IConvertible.ToSByte(System.IFormatProvider) extern "C" int8_t UInt32_System_IConvertible_ToSByte_m1061556466 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Byte System.Convert::ToByte(System.UInt32) extern "C" uint8_t Convert_ToByte_m1993550870 (RuntimeObject * __this /* static, unused */, uint32_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Byte System.UInt32::System.IConvertible.ToByte(System.IFormatProvider) extern "C" uint8_t UInt32_System_IConvertible_ToByte_m4072781199 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int16 System.Convert::ToInt16(System.UInt32) extern "C" int16_t Convert_ToInt16_m571189957 (RuntimeObject * __this /* static, unused */, uint32_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int16 System.UInt32::System.IConvertible.ToInt16(System.IFormatProvider) extern "C" int16_t UInt32_System_IConvertible_ToInt16_m1659441601 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.UInt16 System.Convert::ToUInt16(System.UInt32) extern "C" uint16_t Convert_ToUInt16_m1480956416 (RuntimeObject * __this /* static, unused */, uint32_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.UInt16 System.UInt32::System.IConvertible.ToUInt16(System.IFormatProvider) extern "C" uint16_t UInt32_System_IConvertible_ToUInt16_m3125657960 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int32 System.Convert::ToInt32(System.UInt32) extern "C" int32_t Convert_ToInt32_m3956995719 (RuntimeObject * __this /* static, unused */, uint32_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int32 System.UInt32::System.IConvertible.ToInt32(System.IFormatProvider) extern "C" int32_t UInt32_System_IConvertible_ToInt32_m220754611 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.UInt32 System.UInt32::System.IConvertible.ToUInt32(System.IFormatProvider) extern "C" uint32_t UInt32_System_IConvertible_ToUInt32_m1744564280 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int64 System.Convert::ToInt64(System.UInt32) extern "C" int64_t Convert_ToInt64_m3392013556 (RuntimeObject * __this /* static, unused */, uint32_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int64 System.UInt32::System.IConvertible.ToInt64(System.IFormatProvider) extern "C" int64_t UInt32_System_IConvertible_ToInt64_m2261037378 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.UInt64 System.Convert::ToUInt64(System.UInt32) extern "C" uint64_t Convert_ToUInt64_m1745056470 (RuntimeObject * __this /* static, unused */, uint32_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.UInt64 System.UInt32::System.IConvertible.ToUInt64(System.IFormatProvider) extern "C" uint64_t UInt32_System_IConvertible_ToUInt64_m1094958903 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Single System.Convert::ToSingle(System.UInt32) extern "C" float Convert_ToSingle_m3983149863 (RuntimeObject * __this /* static, unused */, uint32_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Single System.UInt32::System.IConvertible.ToSingle(System.IFormatProvider) extern "C" float UInt32_System_IConvertible_ToSingle_m1272823424 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Double System.Convert::ToDouble(System.UInt32) extern "C" double Convert_ToDouble_m2222536920 (RuntimeObject * __this /* static, unused */, uint32_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Double System.UInt32::System.IConvertible.ToDouble(System.IFormatProvider) extern "C" double UInt32_System_IConvertible_ToDouble_m940039456 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Decimal System.Convert::ToDecimal(System.UInt32) extern "C" Decimal_t2948259380 Convert_ToDecimal_m889385228 (RuntimeObject * __this /* static, unused */, uint32_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Decimal System.UInt32::System.IConvertible.ToDecimal(System.IFormatProvider) extern "C" Decimal_t2948259380 UInt32_System_IConvertible_ToDecimal_m675004071 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.String System.Environment::GetResourceString(System.String,System.Object[]) extern "C" String_t* Environment_GetResourceString_m479507158 (RuntimeObject * __this /* static, unused */, String_t* ___key0, ObjectU5BU5D_t2843939325* ___values1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.InvalidCastException::.ctor(System.String) extern "C" void InvalidCastException__ctor_m318645277 (InvalidCastException_t3927145244 * __this, String_t* ___message0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.DateTime System.UInt32::System.IConvertible.ToDateTime(System.IFormatProvider) extern "C" DateTime_t3738529785 UInt32_System_IConvertible_ToDateTime_m2767723441 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Object System.Convert::DefaultToType(System.IConvertible,System.Type,System.IFormatProvider) extern "C" RuntimeObject * Convert_DefaultToType_m1860037989 (RuntimeObject * __this /* static, unused */, RuntimeObject* ___value0, Type_t * ___targetType1, RuntimeObject* ___provider2, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Object System.UInt32::System.IConvertible.ToType(System.Type,System.IFormatProvider) extern "C" RuntimeObject * UInt32_System_IConvertible_ToType_m922356584 (uint32_t* __this, Type_t * ___type0, RuntimeObject* ___provider1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int32 System.UInt64::CompareTo(System.Object) extern "C" int32_t UInt64_CompareTo_m3619843473 (uint64_t* __this, RuntimeObject * ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int32 System.UInt64::CompareTo(System.UInt64) extern "C" int32_t UInt64_CompareTo_m1614517204 (uint64_t* __this, uint64_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.UInt64::Equals(System.Object) extern "C" bool UInt64_Equals_m1879425698 (uint64_t* __this, RuntimeObject * ___obj0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.UInt64::Equals(System.UInt64) extern "C" bool UInt64_Equals_m367573732 (uint64_t* __this, uint64_t ___obj0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int32 System.UInt64::GetHashCode() extern "C" int32_t UInt64_GetHashCode_m4209760355 (uint64_t* __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.String System.Number::FormatUInt64(System.UInt64,System.String,System.Globalization.NumberFormatInfo) extern "C" String_t* Number_FormatUInt64_m792080283 (RuntimeObject * __this /* static, unused */, uint64_t ___value0, String_t* ___format1, NumberFormatInfo_t435877138 * ___info2, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.String System.UInt64::ToString() extern "C" String_t* UInt64_ToString_m1529093114 (uint64_t* __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.String System.UInt64::ToString(System.IFormatProvider) extern "C" String_t* UInt64_ToString_m2623377370 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.String System.UInt64::ToString(System.String) extern "C" String_t* UInt64_ToString_m2177233542 (uint64_t* __this, String_t* ___format0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.String System.UInt64::ToString(System.String,System.IFormatProvider) extern "C" String_t* UInt64_ToString_m1695188334 (uint64_t* __this, String_t* ___format0, RuntimeObject* ___provider1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.UInt64 System.Number::ParseUInt64(System.String,System.Globalization.NumberStyles,System.Globalization.NumberFormatInfo) extern "C" uint64_t Number_ParseUInt64_m2694014565 (RuntimeObject * __this /* static, unused */, String_t* ___value0, int32_t ___options1, NumberFormatInfo_t435877138 * ___numfmt2, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.Number::TryParseUInt64(System.String,System.Globalization.NumberStyles,System.Globalization.NumberFormatInfo,System.UInt64&) extern "C" bool Number_TryParseUInt64_m782753458 (RuntimeObject * __this /* static, unused */, String_t* ___s0, int32_t ___style1, NumberFormatInfo_t435877138 * ___info2, uint64_t* ___result3, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.TypeCode System.UInt64::GetTypeCode() extern "C" int32_t UInt64_GetTypeCode_m844217172 (uint64_t* __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.Convert::ToBoolean(System.UInt64) extern "C" bool Convert_ToBoolean_m3613483153 (RuntimeObject * __this /* static, unused */, uint64_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.UInt64::System.IConvertible.ToBoolean(System.IFormatProvider) extern "C" bool UInt64_System_IConvertible_ToBoolean_m3071416000 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Char System.Convert::ToChar(System.UInt64) extern "C" Il2CppChar Convert_ToChar_m1604365259 (RuntimeObject * __this /* static, unused */, uint64_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Char System.UInt64::System.IConvertible.ToChar(System.IFormatProvider) extern "C" Il2CppChar UInt64_System_IConvertible_ToChar_m2074245892 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.SByte System.Convert::ToSByte(System.UInt64) extern "C" int8_t Convert_ToSByte_m1679390684 (RuntimeObject * __this /* static, unused */, uint64_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.SByte System.UInt64::System.IConvertible.ToSByte(System.IFormatProvider) extern "C" int8_t UInt64_System_IConvertible_ToSByte_m30962591 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Byte System.Convert::ToByte(System.UInt64) extern "C" uint8_t Convert_ToByte_m3567528984 (RuntimeObject * __this /* static, unused */, uint64_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Byte System.UInt64::System.IConvertible.ToByte(System.IFormatProvider) extern "C" uint8_t UInt64_System_IConvertible_ToByte_m1501504925 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int16 System.Convert::ToInt16(System.UInt64) extern "C" int16_t Convert_ToInt16_m1733792763 (RuntimeObject * __this /* static, unused */, uint64_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int16 System.UInt64::System.IConvertible.ToInt16(System.IFormatProvider) extern "C" int16_t UInt64_System_IConvertible_ToInt16_m3895479143 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.UInt16 System.Convert::ToUInt16(System.UInt64) extern "C" uint16_t Convert_ToUInt16_m2672597498 (RuntimeObject * __this /* static, unused */, uint64_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.UInt16 System.UInt64::System.IConvertible.ToUInt16(System.IFormatProvider) extern "C" uint16_t UInt64_System_IConvertible_ToUInt16_m4165747038 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int32 System.Convert::ToInt32(System.UInt64) extern "C" int32_t Convert_ToInt32_m825155517 (RuntimeObject * __this /* static, unused */, uint64_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int32 System.UInt64::System.IConvertible.ToInt32(System.IFormatProvider) extern "C" int32_t UInt64_System_IConvertible_ToInt32_m949522652 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.UInt32 System.Convert::ToUInt32(System.UInt64) extern "C" uint32_t Convert_ToUInt32_m1767593911 (RuntimeObject * __this /* static, unused */, uint64_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.UInt32 System.UInt64::System.IConvertible.ToUInt32(System.IFormatProvider) extern "C" uint32_t UInt64_System_IConvertible_ToUInt32_m2784653358 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int64 System.Convert::ToInt64(System.UInt64) extern "C" int64_t Convert_ToInt64_m260173354 (RuntimeObject * __this /* static, unused */, uint64_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int64 System.UInt64::System.IConvertible.ToInt64(System.IFormatProvider) extern "C" int64_t UInt64_System_IConvertible_ToInt64_m4241475606 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.UInt64 System.UInt64::System.IConvertible.ToUInt64(System.IFormatProvider) extern "C" uint64_t UInt64_System_IConvertible_ToUInt64_m2135047981 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Single System.Convert::ToSingle(System.UInt64) extern "C" float Convert_ToSingle_m2791508777 (RuntimeObject * __this /* static, unused */, uint64_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Single System.UInt64::System.IConvertible.ToSingle(System.IFormatProvider) extern "C" float UInt64_System_IConvertible_ToSingle_m925613075 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Double System.Convert::ToDouble(System.UInt64) extern "C" double Convert_ToDouble_m1030895834 (RuntimeObject * __this /* static, unused */, uint64_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Double System.UInt64::System.IConvertible.ToDouble(System.IFormatProvider) extern "C" double UInt64_System_IConvertible_ToDouble_m602078108 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Decimal System.Convert::ToDecimal(System.UInt64) extern "C" Decimal_t2948259380 Convert_ToDecimal_m1695757674 (RuntimeObject * __this /* static, unused */, uint64_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Decimal System.UInt64::System.IConvertible.ToDecimal(System.IFormatProvider) extern "C" Decimal_t2948259380 UInt64_System_IConvertible_ToDecimal_m806594027 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.DateTime System.UInt64::System.IConvertible.ToDateTime(System.IFormatProvider) extern "C" DateTime_t3738529785 UInt64_System_IConvertible_ToDateTime_m3434604642 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Object System.UInt64::System.IConvertible.ToType(System.Type,System.IFormatProvider) extern "C" RuntimeObject * UInt64_System_IConvertible_ToType_m4049257834 (uint64_t* __this, Type_t * ___type0, RuntimeObject* ___provider1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.UIntPtr::.ctor(System.UInt32) extern "C" void UIntPtr__ctor_m4250165422 (uintptr_t* __this, uint32_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.UIntPtr::Equals(System.Object) extern "C" bool UIntPtr_Equals_m1316671746 (uintptr_t* __this, RuntimeObject * ___obj0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int32 System.UIntPtr::GetHashCode() extern "C" int32_t UIntPtr_GetHashCode_m3482152298 (uintptr_t* __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int32 System.UIntPtr::get_Size() extern "C" int32_t UIntPtr_get_Size_m703595701 (RuntimeObject * __this /* static, unused */, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.String System.UIntPtr::ToString() extern "C" String_t* UIntPtr_ToString_m984583492 (uintptr_t* __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.ArgumentNullException::.ctor(System.String) extern "C" void ArgumentNullException__ctor_m1170824041 (ArgumentNullException_t1615371798 * __this, String_t* ___paramName0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.Runtime.Serialization.SerializationInfo::AddValue(System.String,System.UInt64) extern "C" void SerializationInfo_AddValue_m2020653395 (SerializationInfo_t950877179 * __this, String_t* ___name0, uint64_t ___value1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.UIntPtr::System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) extern "C" void UIntPtr_System_Runtime_Serialization_ISerializable_GetObjectData_m1767630151 (uintptr_t* __this, SerializationInfo_t950877179 * ___info0, StreamingContext_t3711869237 ___context1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.SystemException::.ctor(System.String) extern "C" void SystemException__ctor_m3298527747 (SystemException_t176217640 * __this, String_t* ___message0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.Exception::SetErrorCode(System.Int32) extern "C" void Exception_SetErrorCode_m4269507377 (Exception_t * __this, int32_t ___hr0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.SystemException::.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) extern "C" void SystemException__ctor_m1515048899 (SystemException_t176217640 * __this, SerializationInfo_t950877179 * ___info0, StreamingContext_t3711869237 ___context1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.EventArgs::.ctor() extern "C" void EventArgs__ctor_m32674013 (EventArgs_t3591816995 * __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Type System.Type::GetTypeFromHandle(System.RuntimeTypeHandle) extern "C" Type_t * Type_GetTypeFromHandle_m1620074514 (RuntimeObject * __this /* static, unused */, RuntimeTypeHandle_t3027515415 ___handle0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.Runtime.Serialization.SerializationInfo::SetType(System.Type) extern "C" void SerializationInfo_SetType_m3923964808 (SerializationInfo_t950877179 * __this, Type_t * ___type0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.Runtime.Serialization.SerializationInfo::AddValue(System.String,System.Int32) extern "C" void SerializationInfo_AddValue_m412754688 (SerializationInfo_t950877179 * __this, String_t* ___name0, int32_t ___value1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.Collections.Generic.List`1<System.Int32>::.ctor() #define List_1__ctor_m1204004817(__this, method) (( void (*) (List_1_t128053199 *, const RuntimeMethod*))List_1__ctor_m1204004817_gshared)(__this, method) // System.Void System.Collections.Generic.List`1<System.Int32>::Add(T) #define List_1_Add_m2080863212(__this, p0, method) (( void (*) (List_1_t128053199 *, int32_t, const RuntimeMethod*))List_1_Add_m2080863212_gshared)(__this, p0, method) // System.Boolean System.Type::get_IsArray() extern "C" bool Type_get_IsArray_m2591212821 (Type_t * __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.Type::get_IsPointer() extern "C" bool Type_get_IsPointer_m4067542339 (Type_t * __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.Type::get_IsByRef() extern "C" bool Type_get_IsByRef_m1262524108 (Type_t * __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.Type::get_HasElementType() extern "C" bool Type_get_HasElementType_m710151977 (Type_t * __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // T[] System.Collections.Generic.List`1<System.Int32>::ToArray() #define List_1_ToArray_m1469074435(__this, method) (( Int32U5BU5D_t385246372* (*) (List_1_t128053199 *, const RuntimeMethod*))List_1_ToArray_m1469074435_gshared)(__this, method) // System.Void System.Runtime.Serialization.SerializationInfo::AddValue(System.String,System.Object,System.Type) extern "C" void SerializationInfo_AddValue_m3906743584 (SerializationInfo_t950877179 * __this, String_t* ___name0, RuntimeObject * ___value1, Type_t * ___type2, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Type System.Type::GetRootElementType() extern "C" Type_t * Type_GetRootElementType_m2028550026 (Type_t * __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.RuntimeType System.UnitySerializationHolder::AddElementTypes(System.Runtime.Serialization.SerializationInfo,System.RuntimeType) extern "C" RuntimeType_t3636489352 * UnitySerializationHolder_AddElementTypes_m2711578409 (RuntimeObject * __this /* static, unused */, SerializationInfo_t950877179 * ___info0, RuntimeType_t3636489352 * ___type1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Reflection.RuntimeAssembly System.RuntimeType::GetRuntimeAssembly() extern "C" RuntimeAssembly_t1451753063 * RuntimeType_GetRuntimeAssembly_m2955606119 (RuntimeType_t3636489352 * __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.UnitySerializationHolder::GetUnitySerializationInfo(System.Runtime.Serialization.SerializationInfo,System.Int32,System.String,System.Reflection.RuntimeAssembly) extern "C" void UnitySerializationHolder_GetUnitySerializationInfo_m3966690610 (RuntimeObject * __this /* static, unused */, SerializationInfo_t950877179 * ___info0, int32_t ___unityType1, String_t* ___data2, RuntimeAssembly_t1451753063 * ___assembly3, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.Reflection.Assembly::op_Equality(System.Reflection.Assembly,System.Reflection.Assembly) extern "C" bool Assembly_op_Equality_m3828289814 (RuntimeObject * __this /* static, unused */, Assembly_t * ___left0, Assembly_t * ___right1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.Runtime.Serialization.SerializationInfo::AddValue(System.String,System.Object) extern "C" void SerializationInfo_AddValue_m2872281893 (SerializationInfo_t950877179 * __this, String_t* ___name0, RuntimeObject * ___value1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.Object::.ctor() extern "C" void Object__ctor_m297566312 (RuntimeObject * __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int32 System.Runtime.Serialization.SerializationInfo::GetInt32(System.String) extern "C" int32_t SerializationInfo_GetInt32_m2640574809 (SerializationInfo_t950877179 * __this, String_t* ___name0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Object System.Runtime.Serialization.SerializationInfo::GetValue(System.String,System.Type) extern "C" RuntimeObject * SerializationInfo_GetValue_m42271953 (SerializationInfo_t950877179 * __this, String_t* ___name0, Type_t * ___type1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.String System.Runtime.Serialization.SerializationInfo::GetString(System.String) extern "C" String_t* SerializationInfo_GetString_m3155282843 (SerializationInfo_t950877179 * __this, String_t* ___name0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.Runtime.Serialization.SerializationException::.ctor(System.String) extern "C" void SerializationException__ctor_m3862484944 (SerializationException_t3941511869 * __this, String_t* ___message0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.NotSupportedException::.ctor(System.String) extern "C" void NotSupportedException__ctor_m2494070935 (NotSupportedException_t1314879016 * __this, String_t* ___message0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.Type::op_Equality(System.Type,System.Type) extern "C" bool Type_op_Equality_m2683486427 (RuntimeObject * __this /* static, unused */, Type_t * ___left0, Type_t * ___right1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Type System.UnitySerializationHolder::MakeElementTypes(System.Type) extern "C" Type_t * UnitySerializationHolder_MakeElementTypes_m672301684 (UnitySerializationHolder_t431912834 * __this, Type_t * ___type0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.Reflection.MethodBase::op_Equality(System.Reflection.MethodBase,System.Reflection.MethodBase) extern "C" bool MethodBase_op_Equality_m2405991987 (RuntimeObject * __this /* static, unused */, MethodBase_t * ___left0, MethodBase_t * ___right1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.UnitySerializationHolder::ThrowInsufficientInformation(System.String) extern "C" void UnitySerializationHolder_ThrowInsufficientInformation_m1747464776 (UnitySerializationHolder_t431912834 * __this, String_t* ___field0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.Reflection.MethodBase::op_Inequality(System.Reflection.MethodBase,System.Reflection.MethodBase) extern "C" bool MethodBase_op_Inequality_m736913402 (RuntimeObject * __this /* static, unused */, MethodBase_t * ___left0, MethodBase_t * ___right1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int32 System.String::get_Length() extern "C" int32_t String_get_Length_m3847582255 (String_t* __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Type System.Type::GetType(System.String,System.Boolean,System.Boolean) extern "C" Type_t * Type_GetType_m3971160356 (RuntimeObject * __this /* static, unused */, String_t* ___typeName0, bool ___throwOnError1, bool ___ignoreCase2, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Reflection.Assembly System.Reflection.Assembly::Load(System.String) extern "C" Assembly_t * Assembly_Load_m3487507613 (RuntimeObject * __this /* static, unused */, String_t* ___assemblyString0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.Reflection.Module::op_Equality(System.Reflection.Module,System.Reflection.Module) extern "C" bool Module_op_Equality_m1102431980 (RuntimeObject * __this /* static, unused */, Module_t2987026101 * ___left0, Module_t2987026101 * ___right1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.UnSafeCharBuffer::.ctor(System.Char*,System.Int32) extern "C" void UnSafeCharBuffer__ctor_m1145239641 (UnSafeCharBuffer_t2176740272 * __this, Il2CppChar* ___buffer0, int32_t ___bufferSize1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.String::IsNullOrEmpty(System.String) extern "C" bool String_IsNullOrEmpty_m2969720369 (RuntimeObject * __this /* static, unused */, String_t* ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.IndexOutOfRangeException::.ctor() extern "C" void IndexOutOfRangeException__ctor_m2441337274 (IndexOutOfRangeException_t1578797820 * __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int32 System.Runtime.CompilerServices.RuntimeHelpers::get_OffsetToStringData() extern "C" int32_t RuntimeHelpers_get_OffsetToStringData_m2192601476 (RuntimeObject * __this /* static, unused */, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.Buffer::Memcpy(System.Byte*,System.Byte*,System.Int32) extern "C" void Buffer_Memcpy_m2035854300 (RuntimeObject * __this /* static, unused */, uint8_t* ___dest0, uint8_t* ___src1, int32_t ___size2, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.UnSafeCharBuffer::AppendString(System.String) extern "C" void UnSafeCharBuffer_AppendString_m2223303597 (UnSafeCharBuffer_t2176740272 * __this, String_t* ___stringToAppend0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.ValueTuple::Equals(System.Object) extern "C" bool ValueTuple_Equals_m3777586424 (ValueTuple_t3168505507 * __this, RuntimeObject * ___obj0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.ValueTuple::Equals(System.ValueTuple) extern "C" bool ValueTuple_Equals_m3868013840 (ValueTuple_t3168505507 * __this, ValueTuple_t3168505507 ___other0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.ValueTuple::System.Collections.IStructuralEquatable.Equals(System.Object,System.Collections.IEqualityComparer) extern "C" bool ValueTuple_System_Collections_IStructuralEquatable_Equals_m1158377527 (ValueTuple_t3168505507 * __this, RuntimeObject * ___other0, RuntimeObject* ___comparer1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Type System.Object::GetType() extern "C" Type_t * Object_GetType_m88164663 (RuntimeObject * __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.String SR::Format(System.String,System.Object) extern "C" String_t* SR_Format_m1749913990 (RuntimeObject * __this /* static, unused */, String_t* ___resourceFormat0, RuntimeObject * ___p11, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.ArgumentException::.ctor(System.String,System.String) extern "C" void ArgumentException__ctor_m1216717135 (ArgumentException_t132251570 * __this, String_t* ___message0, String_t* ___paramName1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int32 System.ValueTuple::System.IComparable.CompareTo(System.Object) extern "C" int32_t ValueTuple_System_IComparable_CompareTo_m3152321575 (ValueTuple_t3168505507 * __this, RuntimeObject * ___other0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int32 System.ValueTuple::CompareTo(System.ValueTuple) extern "C" int32_t ValueTuple_CompareTo_m2936302085 (ValueTuple_t3168505507 * __this, ValueTuple_t3168505507 ___other0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int32 System.ValueTuple::System.Collections.IStructuralComparable.CompareTo(System.Object,System.Collections.IComparer) extern "C" int32_t ValueTuple_System_Collections_IStructuralComparable_CompareTo_m1147772089 (ValueTuple_t3168505507 * __this, RuntimeObject * ___other0, RuntimeObject* ___comparer1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int32 System.ValueTuple::GetHashCode() extern "C" int32_t ValueTuple_GetHashCode_m2158739460 (ValueTuple_t3168505507 * __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int32 System.ValueTuple::System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer) extern "C" int32_t ValueTuple_System_Collections_IStructuralEquatable_GetHashCode_m3160204034 (ValueTuple_t3168505507 * __this, RuntimeObject* ___comparer0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.String System.ValueTuple::ToString() extern "C" String_t* ValueTuple_ToString_m2213345710 (ValueTuple_t3168505507 * __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int32 System.Numerics.Hashing.HashHelpers::Combine(System.Int32,System.Int32) extern "C" int32_t HashHelpers_Combine_m3459330122 (RuntimeObject * __this /* static, unused */, int32_t ___h10, int32_t ___h21, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.RuntimeType::op_Inequality(System.RuntimeType,System.RuntimeType) extern "C" bool RuntimeType_op_Inequality_m287584116 (RuntimeObject * __this /* static, unused */, RuntimeType_t3636489352 * ___left0, RuntimeType_t3636489352 * ___right1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.ValueType::InternalEquals(System.Object,System.Object,System.Object[]&) extern "C" bool ValueType_InternalEquals_m1384040357 (RuntimeObject * __this /* static, unused */, RuntimeObject * ___o10, RuntimeObject * ___o21, ObjectU5BU5D_t2843939325** ___fields2, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.ValueType::DefaultEquals(System.Object,System.Object) extern "C" bool ValueType_DefaultEquals_m2927252100 (RuntimeObject * __this /* static, unused */, RuntimeObject * ___o10, RuntimeObject * ___o21, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int32 System.ValueType::InternalGetHashCode(System.Object,System.Object[]&) extern "C" int32_t ValueType_InternalGetHashCode_m58786863 (RuntimeObject * __this /* static, unused */, RuntimeObject * ___o0, ObjectU5BU5D_t2843939325** ___fields1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.Runtime.InteropServices.Marshal::FreeBSTR(System.IntPtr) extern "C" void Marshal_FreeBSTR_m2788901813 (RuntimeObject * __this /* static, unused */, intptr_t ___ptr0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.IntPtr::op_Inequality(System.IntPtr,System.IntPtr) extern "C" bool IntPtr_op_Inequality_m3063970704 (RuntimeObject * __this /* static, unused */, intptr_t ___value10, intptr_t ___value21, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int32 System.Runtime.InteropServices.Marshal::Release(System.IntPtr) extern "C" int32_t Marshal_Release_m3880542832 (RuntimeObject * __this /* static, unused */, intptr_t ___pUnk0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.Variant::Clear() extern "C" void Variant_Clear_m3388694274 (Variant_t2753289927 * __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.ArgumentOutOfRangeException::.ctor(System.String,System.String) extern "C" void ArgumentOutOfRangeException__ctor_m282481429 (ArgumentOutOfRangeException_t777629997 * __this, String_t* ___paramName0, String_t* ___message1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.Version::.ctor() extern "C" void Version__ctor_m872301635 (Version_t3456873960 * __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.Version::op_Equality(System.Version,System.Version) extern "C" bool Version_op_Equality_m3804852517 (RuntimeObject * __this /* static, unused */, Version_t3456873960 * ___v10, Version_t3456873960 * ___v21, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.String System.Version::ToString(System.Int32) extern "C" String_t* Version_ToString_m3654989516 (Version_t3456873960 * __this, int32_t ___fieldCount0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.String System.Int32::ToString() extern "C" String_t* Int32_ToString_m141394615 (int32_t* __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Text.StringBuilder System.Text.StringBuilderCache::Acquire(System.Int32) extern "C" StringBuilder_t * StringBuilderCache_Acquire_m4169564332 (RuntimeObject * __this /* static, unused */, int32_t ___capacity0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.Version::AppendPositiveNumber(System.Int32,System.Text.StringBuilder) extern "C" void Version_AppendPositiveNumber_m308762805 (RuntimeObject * __this /* static, unused */, int32_t ___num0, StringBuilder_t * ___sb1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Text.StringBuilder System.Text.StringBuilder::Append(System.Char) extern "C" StringBuilder_t * StringBuilder_Append_m2383614642 (StringBuilder_t * __this, Il2CppChar ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.String System.Text.StringBuilderCache::GetStringAndRelease(System.Text.StringBuilder) extern "C" String_t* StringBuilderCache_GetStringAndRelease_m1110745745 (RuntimeObject * __this /* static, unused */, StringBuilder_t * ___sb0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int32 System.Text.StringBuilder::get_Length() extern "C" int32_t StringBuilder_get_Length_m3238060835 (StringBuilder_t * __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Text.StringBuilder System.Text.StringBuilder::Insert(System.Int32,System.Char) extern "C" StringBuilder_t * StringBuilder_Insert_m1076119876 (StringBuilder_t * __this, int32_t ___index0, Il2CppChar ___value1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.Version::Equals(System.Version) extern "C" bool Version_Equals_m1564427710 (Version_t3456873960 * __this, Version_t3456873960 * ___obj0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int32 System.Version::CompareTo(System.Version) extern "C" int32_t Version_CompareTo_m3146217210 (Version_t3456873960 * __this, Version_t3456873960 * ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.Version::op_LessThanOrEqual(System.Version,System.Version) extern "C" bool Version_op_LessThanOrEqual_m666140174 (RuntimeObject * __this /* static, unused */, Version_t3456873960 * ___v10, Version_t3456873960 * ___v21, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Runtime.InteropServices.GCHandle System.Runtime.InteropServices.GCHandle::Alloc(System.Object,System.Runtime.InteropServices.GCHandleType) extern "C" GCHandle_t3351438187 GCHandle_Alloc_m3823409740 (RuntimeObject * __this /* static, unused */, RuntimeObject * ___value0, int32_t ___type1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.WeakReference::.ctor(System.Object,System.Boolean) extern "C" void WeakReference__ctor_m1054065938 (WeakReference_t1334886716 * __this, RuntimeObject * ___target0, bool ___trackResurrection1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.WeakReference::AllocateHandle(System.Object) extern "C" void WeakReference_AllocateHandle_m1478975559 (WeakReference_t1334886716 * __this, RuntimeObject * ___target0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.Runtime.Serialization.SerializationInfo::GetBoolean(System.String) extern "C" bool SerializationInfo_GetBoolean_m1756153320 (SerializationInfo_t950877179 * __this, String_t* ___name0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.Runtime.InteropServices.GCHandle::get_IsAllocated() extern "C" bool GCHandle_get_IsAllocated_m1058226959 (GCHandle_t3351438187 * __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Object System.Runtime.InteropServices.GCHandle::get_Target() extern "C" RuntimeObject * GCHandle_get_Target_m1824973883 (GCHandle_t3351438187 * __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.Runtime.InteropServices.GCHandle::Free() extern "C" void GCHandle_Free_m1457699368 (GCHandle_t3351438187 * __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.Object::Finalize() extern "C" void Object_Finalize_m3076187857 (RuntimeObject * __this, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.Runtime.Serialization.SerializationInfo::AddValue(System.String,System.Boolean) extern "C" void SerializationInfo_AddValue_m3427199315 (SerializationInfo_t950877179 * __this, String_t* ___name0, bool ___value1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.IntPtr System.WindowsConsoleDriver::GetStdHandle(System.Handles) extern "C" intptr_t WindowsConsoleDriver_GetStdHandle_m23119533 (RuntimeObject * __this /* static, unused */, int32_t ___handle0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.WindowsConsoleDriver::GetConsoleScreenBufferInfo(System.IntPtr,System.ConsoleScreenBufferInfo&) extern "C" bool WindowsConsoleDriver_GetConsoleScreenBufferInfo_m3609341087 (RuntimeObject * __this /* static, unused */, intptr_t ___handle0, ConsoleScreenBufferInfo_t3095351730 * ___info1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.WindowsConsoleDriver::ReadConsoleInput(System.IntPtr,System.InputRecord&,System.Int32,System.Int32&) extern "C" bool WindowsConsoleDriver_ReadConsoleInput_m1790694890 (RuntimeObject * __this /* static, unused */, intptr_t ___handle0, InputRecord_t2660212290 * ___record1, int32_t ___length2, int32_t* ___nread3, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int32 System.Runtime.InteropServices.Marshal::GetLastWin32Error() extern "C" int32_t Marshal_GetLastWin32Error_m1272610344 (RuntimeObject * __this /* static, unused */, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.String System.String::Concat(System.Object,System.Object) extern "C" String_t* String_Concat_m904156431 (RuntimeObject * __this /* static, unused */, RuntimeObject * ___arg00, RuntimeObject * ___arg11, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.InvalidOperationException::.ctor(System.String) extern "C" void InvalidOperationException__ctor_m237278729 (InvalidOperationException_t56020091 * __this, String_t* ___message0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.WindowsConsoleDriver::IsModifierKey(System.Int16) extern "C" bool WindowsConsoleDriver_IsModifierKey_m1974886538 (RuntimeObject * __this /* static, unused */, int16_t ___virtualKeyCode0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.ConsoleKeyInfo::.ctor(System.Char,System.ConsoleKey,System.Boolean,System.Boolean,System.Boolean) extern "C" void ConsoleKeyInfo__ctor_m535940175 (ConsoleKeyInfo_t1802691652 * __this, Il2CppChar ___keyChar0, int32_t ___key1, bool ___shift2, bool ___alt3, bool ___control4, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Boolean System.IntPtr::op_Equality(System.IntPtr,System.IntPtr) extern "C" bool IntPtr_op_Equality_m408849716 (RuntimeObject * __this /* static, unused */, intptr_t ___value10, intptr_t ___value21, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.IntPtr XamMac.CoreFoundation.CFHelpers::CFStringGetLength(System.IntPtr) extern "C" intptr_t CFHelpers_CFStringGetLength_m1003035781 (RuntimeObject * __this /* static, unused */, intptr_t ___handle0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Int32 System.IntPtr::op_Explicit(System.IntPtr) extern "C" int32_t IntPtr_op_Explicit_m4220076518 (RuntimeObject * __this /* static, unused */, intptr_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.IntPtr XamMac.CoreFoundation.CFHelpers::CFStringGetCharactersPtr(System.IntPtr) extern "C" intptr_t CFHelpers_CFStringGetCharactersPtr_m1790634856 (RuntimeObject * __this /* static, unused */, intptr_t ___handle0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void XamMac.CoreFoundation.CFHelpers/CFRange::.ctor(System.Int32,System.Int32) extern "C" void CFRange__ctor_m1242434219 (CFRange_t1233619878 * __this, int32_t ___loc0, int32_t ___len1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.IntPtr System.Runtime.InteropServices.Marshal::AllocCoTaskMem(System.Int32) extern "C" intptr_t Marshal_AllocCoTaskMem_m1327939722 (RuntimeObject * __this /* static, unused */, int32_t ___cb0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.IntPtr XamMac.CoreFoundation.CFHelpers::CFStringGetCharacters(System.IntPtr,XamMac.CoreFoundation.CFHelpers/CFRange,System.IntPtr) extern "C" intptr_t CFHelpers_CFStringGetCharacters_m1195295518 (RuntimeObject * __this /* static, unused */, intptr_t ___handle0, CFRange_t1233619878 ___range1, intptr_t ___buffer2, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void* System.IntPtr::op_Explicit(System.IntPtr) extern "C" void* IntPtr_op_Explicit_m2520637223 (RuntimeObject * __this /* static, unused */, intptr_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.String System.String::CreateString(System.Char*,System.Int32,System.Int32) extern "C" String_t* String_CreateString_m3400201881 (String_t* __this, Il2CppChar* ___value0, int32_t ___startIndex1, int32_t ___length2, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.Runtime.InteropServices.Marshal::FreeCoTaskMem(System.IntPtr) extern "C" void Marshal_FreeCoTaskMem_m3753155979 (RuntimeObject * __this /* static, unused */, intptr_t ___ptr0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.IntPtr XamMac.CoreFoundation.CFHelpers::CFDataGetLength(System.IntPtr) extern "C" intptr_t CFHelpers_CFDataGetLength_m3730685275 (RuntimeObject * __this /* static, unused */, intptr_t ___handle0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.IntPtr XamMac.CoreFoundation.CFHelpers::CFDataGetBytePtr(System.IntPtr) extern "C" intptr_t CFHelpers_CFDataGetBytePtr_m1648767664 (RuntimeObject * __this /* static, unused */, intptr_t ___handle0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.Runtime.InteropServices.Marshal::Copy(System.IntPtr,System.Byte[],System.Int32,System.Int32) extern "C" void Marshal_Copy_m1222846562 (RuntimeObject * __this /* static, unused */, intptr_t ___source0, ByteU5BU5D_t4116647657* ___destination1, int32_t ___startIndex2, int32_t ___length3, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.IntPtr System.IntPtr::op_Explicit(System.Void*) extern "C" intptr_t IntPtr_op_Explicit_m536245531 (RuntimeObject * __this /* static, unused */, void* ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void System.IntPtr::.ctor(System.Int32) extern "C" void IntPtr__ctor_m987082960 (intptr_t* __this, int32_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.IntPtr XamMac.CoreFoundation.CFHelpers::CFDataCreate(System.IntPtr,System.IntPtr,System.IntPtr) extern "C" intptr_t CFHelpers_CFDataCreate_m3875740957 (RuntimeObject * __this /* static, unused */, intptr_t ___allocator0, intptr_t ___bytes1, intptr_t ___length2, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.IntPtr XamMac.CoreFoundation.CFHelpers::SecCertificateCreateWithData(System.IntPtr,System.IntPtr) extern "C" intptr_t CFHelpers_SecCertificateCreateWithData_m1682200427 (RuntimeObject * __this /* static, unused */, intptr_t ___allocator0, intptr_t ___cfData1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void XamMac.CoreFoundation.CFHelpers::CFRelease(System.IntPtr) extern "C" void CFHelpers_CFRelease_m3206817372 (RuntimeObject * __this /* static, unused */, intptr_t ___obj0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.Void XamMac.CoreFoundation.CFHelpers/CFRange::.ctor(System.Int64,System.Int64) extern "C" void CFRange__ctor_m3401693388 (CFRange_t1233619878 * __this, int64_t ___l0, int64_t ___len1, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; // System.IntPtr System.IntPtr::op_Explicit(System.Int64) extern "C" intptr_t IntPtr_op_Explicit_m1593085246 (RuntimeObject * __this /* static, unused */, int64_t ___value0, const RuntimeMethod* method) IL2CPP_METHOD_ATTR; #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Int32 System.UInt32::CompareTo(System.Object) extern "C" int32_t UInt32_CompareTo_m362578384 (uint32_t* __this, RuntimeObject * ___value0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt32_CompareTo_m362578384_MetadataUsageId); s_Il2CppMethodInitialized = true; } uint32_t V_0 = 0; { RuntimeObject * L_0 = ___value0; if (L_0) { goto IL_0005; } } { return 1; } IL_0005: { RuntimeObject * L_1 = ___value0; if (!((RuntimeObject *)IsInstSealed((RuntimeObject*)L_1, UInt32_t2560061978_il2cpp_TypeInfo_var))) { goto IL_0024; } } { RuntimeObject * L_2 = ___value0; V_0 = ((*(uint32_t*)((uint32_t*)UnBox(L_2, UInt32_t2560061978_il2cpp_TypeInfo_var)))); uint32_t L_3 = V_0; if ((!(((uint32_t)(*((uint32_t*)__this))) < ((uint32_t)L_3)))) { goto IL_001b; } } { return (-1); } IL_001b: { uint32_t L_4 = V_0; if ((!(((uint32_t)(*((uint32_t*)__this))) > ((uint32_t)L_4)))) { goto IL_0022; } } { return 1; } IL_0022: { return 0; } IL_0024: { String_t* L_5 = Environment_GetResourceString_m2063689938(NULL /*static, unused*/, _stringLiteral1622425596, /*hidden argument*/NULL); ArgumentException_t132251570 * L_6 = (ArgumentException_t132251570 *)il2cpp_codegen_object_new(ArgumentException_t132251570_il2cpp_TypeInfo_var); ArgumentException__ctor_m1312628991(L_6, L_5, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_6, NULL, UInt32_CompareTo_m362578384_RuntimeMethod_var); } } extern "C" int32_t UInt32_CompareTo_m362578384_AdjustorThunk (RuntimeObject * __this, RuntimeObject * ___value0, const RuntimeMethod* method) { uint32_t* _thisAdjusted = reinterpret_cast<uint32_t*>(__this + 1); return UInt32_CompareTo_m362578384(_thisAdjusted, ___value0, method); } // System.Int32 System.UInt32::CompareTo(System.UInt32) extern "C" int32_t UInt32_CompareTo_m2218823230 (uint32_t* __this, uint32_t ___value0, const RuntimeMethod* method) { { uint32_t L_0 = ___value0; if ((!(((uint32_t)(*((uint32_t*)__this))) < ((uint32_t)L_0)))) { goto IL_0007; } } { return (-1); } IL_0007: { uint32_t L_1 = ___value0; if ((!(((uint32_t)(*((uint32_t*)__this))) > ((uint32_t)L_1)))) { goto IL_000e; } } { return 1; } IL_000e: { return 0; } } extern "C" int32_t UInt32_CompareTo_m2218823230_AdjustorThunk (RuntimeObject * __this, uint32_t ___value0, const RuntimeMethod* method) { uint32_t* _thisAdjusted = reinterpret_cast<uint32_t*>(__this + 1); return UInt32_CompareTo_m2218823230(_thisAdjusted, ___value0, method); } // System.Boolean System.UInt32::Equals(System.Object) extern "C" bool UInt32_Equals_m351935437 (uint32_t* __this, RuntimeObject * ___obj0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt32_Equals_m351935437_MetadataUsageId); s_Il2CppMethodInitialized = true; } { RuntimeObject * L_0 = ___obj0; if (((RuntimeObject *)IsInstSealed((RuntimeObject*)L_0, UInt32_t2560061978_il2cpp_TypeInfo_var))) { goto IL_000a; } } { return (bool)0; } IL_000a: { RuntimeObject * L_1 = ___obj0; return (bool)((((int32_t)(*((uint32_t*)__this))) == ((int32_t)((*(uint32_t*)((uint32_t*)UnBox(L_1, UInt32_t2560061978_il2cpp_TypeInfo_var))))))? 1 : 0); } } extern "C" bool UInt32_Equals_m351935437_AdjustorThunk (RuntimeObject * __this, RuntimeObject * ___obj0, const RuntimeMethod* method) { uint32_t* _thisAdjusted = reinterpret_cast<uint32_t*>(__this + 1); return UInt32_Equals_m351935437(_thisAdjusted, ___obj0, method); } // System.Boolean System.UInt32::Equals(System.UInt32) extern "C" bool UInt32_Equals_m4250336581 (uint32_t* __this, uint32_t ___obj0, const RuntimeMethod* method) { { uint32_t L_0 = ___obj0; return (bool)((((int32_t)(*((uint32_t*)__this))) == ((int32_t)L_0))? 1 : 0); } } extern "C" bool UInt32_Equals_m4250336581_AdjustorThunk (RuntimeObject * __this, uint32_t ___obj0, const RuntimeMethod* method) { uint32_t* _thisAdjusted = reinterpret_cast<uint32_t*>(__this + 1); return UInt32_Equals_m4250336581(_thisAdjusted, ___obj0, method); } // System.Int32 System.UInt32::GetHashCode() extern "C" int32_t UInt32_GetHashCode_m3722548385 (uint32_t* __this, const RuntimeMethod* method) { { return (*((uint32_t*)__this)); } } extern "C" int32_t UInt32_GetHashCode_m3722548385_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method) { uint32_t* _thisAdjusted = reinterpret_cast<uint32_t*>(__this + 1); return UInt32_GetHashCode_m3722548385(_thisAdjusted, method); } // System.String System.UInt32::ToString() extern "C" String_t* UInt32_ToString_m2574561716 (uint32_t* __this, const RuntimeMethod* method) { { NumberFormatInfo_t435877138 * L_0 = NumberFormatInfo_get_CurrentInfo_m2605582008(NULL /*static, unused*/, /*hidden argument*/NULL); String_t* L_1 = Number_FormatUInt32_m2486347252(NULL /*static, unused*/, (*((uint32_t*)__this)), (String_t*)NULL, L_0, /*hidden argument*/NULL); return L_1; } } extern "C" String_t* UInt32_ToString_m2574561716_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method) { uint32_t* _thisAdjusted = reinterpret_cast<uint32_t*>(__this + 1); return UInt32_ToString_m2574561716(_thisAdjusted, method); } // System.String System.UInt32::ToString(System.IFormatProvider) extern "C" String_t* UInt32_ToString_m4293943134 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { { RuntimeObject* L_0 = ___provider0; NumberFormatInfo_t435877138 * L_1 = NumberFormatInfo_GetInstance_m2833078205(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); String_t* L_2 = Number_FormatUInt32_m2486347252(NULL /*static, unused*/, (*((uint32_t*)__this)), (String_t*)NULL, L_1, /*hidden argument*/NULL); return L_2; } } extern "C" String_t* UInt32_ToString_m4293943134_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint32_t* _thisAdjusted = reinterpret_cast<uint32_t*>(__this + 1); return UInt32_ToString_m4293943134(_thisAdjusted, ___provider0, method); } // System.String System.UInt32::ToString(System.String,System.IFormatProvider) extern "C" String_t* UInt32_ToString_m2420423038 (uint32_t* __this, String_t* ___format0, RuntimeObject* ___provider1, const RuntimeMethod* method) { { String_t* L_0 = ___format0; RuntimeObject* L_1 = ___provider1; NumberFormatInfo_t435877138 * L_2 = NumberFormatInfo_GetInstance_m2833078205(NULL /*static, unused*/, L_1, /*hidden argument*/NULL); String_t* L_3 = Number_FormatUInt32_m2486347252(NULL /*static, unused*/, (*((uint32_t*)__this)), L_0, L_2, /*hidden argument*/NULL); return L_3; } } extern "C" String_t* UInt32_ToString_m2420423038_AdjustorThunk (RuntimeObject * __this, String_t* ___format0, RuntimeObject* ___provider1, const RuntimeMethod* method) { uint32_t* _thisAdjusted = reinterpret_cast<uint32_t*>(__this + 1); return UInt32_ToString_m2420423038(_thisAdjusted, ___format0, ___provider1, method); } // System.UInt32 System.UInt32::Parse(System.String) extern "C" uint32_t UInt32_Parse_m3270868885 (RuntimeObject * __this /* static, unused */, String_t* ___s0, const RuntimeMethod* method) { { String_t* L_0 = ___s0; NumberFormatInfo_t435877138 * L_1 = NumberFormatInfo_get_CurrentInfo_m2605582008(NULL /*static, unused*/, /*hidden argument*/NULL); uint32_t L_2 = Number_ParseUInt32_m4237573864(NULL /*static, unused*/, L_0, 7, L_1, /*hidden argument*/NULL); return L_2; } } // System.UInt32 System.UInt32::Parse(System.String,System.IFormatProvider) extern "C" uint32_t UInt32_Parse_m1373460382 (RuntimeObject * __this /* static, unused */, String_t* ___s0, RuntimeObject* ___provider1, const RuntimeMethod* method) { { String_t* L_0 = ___s0; RuntimeObject* L_1 = ___provider1; NumberFormatInfo_t435877138 * L_2 = NumberFormatInfo_GetInstance_m2833078205(NULL /*static, unused*/, L_1, /*hidden argument*/NULL); uint32_t L_3 = Number_ParseUInt32_m4237573864(NULL /*static, unused*/, L_0, 7, L_2, /*hidden argument*/NULL); return L_3; } } // System.UInt32 System.UInt32::Parse(System.String,System.Globalization.NumberStyles,System.IFormatProvider) extern "C" uint32_t UInt32_Parse_m3755665066 (RuntimeObject * __this /* static, unused */, String_t* ___s0, int32_t ___style1, RuntimeObject* ___provider2, const RuntimeMethod* method) { { int32_t L_0 = ___style1; NumberFormatInfo_ValidateParseStyleInteger_m957858295(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); String_t* L_1 = ___s0; int32_t L_2 = ___style1; RuntimeObject* L_3 = ___provider2; NumberFormatInfo_t435877138 * L_4 = NumberFormatInfo_GetInstance_m2833078205(NULL /*static, unused*/, L_3, /*hidden argument*/NULL); uint32_t L_5 = Number_ParseUInt32_m4237573864(NULL /*static, unused*/, L_1, L_2, L_4, /*hidden argument*/NULL); return L_5; } } // System.Boolean System.UInt32::TryParse(System.String,System.Globalization.NumberStyles,System.IFormatProvider,System.UInt32&) extern "C" bool UInt32_TryParse_m535404612 (RuntimeObject * __this /* static, unused */, String_t* ___s0, int32_t ___style1, RuntimeObject* ___provider2, uint32_t* ___result3, const RuntimeMethod* method) { { int32_t L_0 = ___style1; NumberFormatInfo_ValidateParseStyleInteger_m957858295(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); String_t* L_1 = ___s0; int32_t L_2 = ___style1; RuntimeObject* L_3 = ___provider2; NumberFormatInfo_t435877138 * L_4 = NumberFormatInfo_GetInstance_m2833078205(NULL /*static, unused*/, L_3, /*hidden argument*/NULL); uint32_t* L_5 = ___result3; bool L_6 = Number_TryParseUInt32_m2802499845(NULL /*static, unused*/, L_1, L_2, L_4, (uint32_t*)L_5, /*hidden argument*/NULL); return L_6; } } // System.TypeCode System.UInt32::GetTypeCode() extern "C" int32_t UInt32_GetTypeCode_m88917904 (uint32_t* __this, const RuntimeMethod* method) { { return (int32_t)(((int32_t)10)); } } extern "C" int32_t UInt32_GetTypeCode_m88917904_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method) { uint32_t* _thisAdjusted = reinterpret_cast<uint32_t*>(__this + 1); return UInt32_GetTypeCode_m88917904(_thisAdjusted, method); } // System.Boolean System.UInt32::System.IConvertible.ToBoolean(System.IFormatProvider) extern "C" bool UInt32_System_IConvertible_ToBoolean_m1763673183 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt32_System_IConvertible_ToBoolean_m1763673183_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Convert_t2465617642_il2cpp_TypeInfo_var); bool L_0 = Convert_ToBoolean_m2807110707(NULL /*static, unused*/, (*((uint32_t*)__this)), /*hidden argument*/NULL); return L_0; } } extern "C" bool UInt32_System_IConvertible_ToBoolean_m1763673183_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint32_t* _thisAdjusted = reinterpret_cast<uint32_t*>(__this + 1); return UInt32_System_IConvertible_ToBoolean_m1763673183(_thisAdjusted, ___provider0, method); } // System.Char System.UInt32::System.IConvertible.ToChar(System.IFormatProvider) extern "C" Il2CppChar UInt32_System_IConvertible_ToChar_m1873050533 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt32_System_IConvertible_ToChar_m1873050533_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Convert_t2465617642_il2cpp_TypeInfo_var); Il2CppChar L_0 = Convert_ToChar_m2796006345(NULL /*static, unused*/, (*((uint32_t*)__this)), /*hidden argument*/NULL); return L_0; } } extern "C" Il2CppChar UInt32_System_IConvertible_ToChar_m1873050533_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint32_t* _thisAdjusted = reinterpret_cast<uint32_t*>(__this + 1); return UInt32_System_IConvertible_ToChar_m1873050533(_thisAdjusted, ___provider0, method); } // System.SByte System.UInt32::System.IConvertible.ToSByte(System.IFormatProvider) extern "C" int8_t UInt32_System_IConvertible_ToSByte_m1061556466 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt32_System_IConvertible_ToSByte_m1061556466_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Convert_t2465617642_il2cpp_TypeInfo_var); int8_t L_0 = Convert_ToSByte_m2486156346(NULL /*static, unused*/, (*((uint32_t*)__this)), /*hidden argument*/NULL); return L_0; } } extern "C" int8_t UInt32_System_IConvertible_ToSByte_m1061556466_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint32_t* _thisAdjusted = reinterpret_cast<uint32_t*>(__this + 1); return UInt32_System_IConvertible_ToSByte_m1061556466(_thisAdjusted, ___provider0, method); } // System.Byte System.UInt32::System.IConvertible.ToByte(System.IFormatProvider) extern "C" uint8_t UInt32_System_IConvertible_ToByte_m4072781199 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt32_System_IConvertible_ToByte_m4072781199_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Convert_t2465617642_il2cpp_TypeInfo_var); uint8_t L_0 = Convert_ToByte_m1993550870(NULL /*static, unused*/, (*((uint32_t*)__this)), /*hidden argument*/NULL); return L_0; } } extern "C" uint8_t UInt32_System_IConvertible_ToByte_m4072781199_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint32_t* _thisAdjusted = reinterpret_cast<uint32_t*>(__this + 1); return UInt32_System_IConvertible_ToByte_m4072781199(_thisAdjusted, ___provider0, method); } // System.Int16 System.UInt32::System.IConvertible.ToInt16(System.IFormatProvider) extern "C" int16_t UInt32_System_IConvertible_ToInt16_m1659441601 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt32_System_IConvertible_ToInt16_m1659441601_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Convert_t2465617642_il2cpp_TypeInfo_var); int16_t L_0 = Convert_ToInt16_m571189957(NULL /*static, unused*/, (*((uint32_t*)__this)), /*hidden argument*/NULL); return L_0; } } extern "C" int16_t UInt32_System_IConvertible_ToInt16_m1659441601_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint32_t* _thisAdjusted = reinterpret_cast<uint32_t*>(__this + 1); return UInt32_System_IConvertible_ToInt16_m1659441601(_thisAdjusted, ___provider0, method); } // System.UInt16 System.UInt32::System.IConvertible.ToUInt16(System.IFormatProvider) extern "C" uint16_t UInt32_System_IConvertible_ToUInt16_m3125657960 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt32_System_IConvertible_ToUInt16_m3125657960_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Convert_t2465617642_il2cpp_TypeInfo_var); uint16_t L_0 = Convert_ToUInt16_m1480956416(NULL /*static, unused*/, (*((uint32_t*)__this)), /*hidden argument*/NULL); return L_0; } } extern "C" uint16_t UInt32_System_IConvertible_ToUInt16_m3125657960_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint32_t* _thisAdjusted = reinterpret_cast<uint32_t*>(__this + 1); return UInt32_System_IConvertible_ToUInt16_m3125657960(_thisAdjusted, ___provider0, method); } // System.Int32 System.UInt32::System.IConvertible.ToInt32(System.IFormatProvider) extern "C" int32_t UInt32_System_IConvertible_ToInt32_m220754611 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt32_System_IConvertible_ToInt32_m220754611_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Convert_t2465617642_il2cpp_TypeInfo_var); int32_t L_0 = Convert_ToInt32_m3956995719(NULL /*static, unused*/, (*((uint32_t*)__this)), /*hidden argument*/NULL); return L_0; } } extern "C" int32_t UInt32_System_IConvertible_ToInt32_m220754611_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint32_t* _thisAdjusted = reinterpret_cast<uint32_t*>(__this + 1); return UInt32_System_IConvertible_ToInt32_m220754611(_thisAdjusted, ___provider0, method); } // System.UInt32 System.UInt32::System.IConvertible.ToUInt32(System.IFormatProvider) extern "C" uint32_t UInt32_System_IConvertible_ToUInt32_m1744564280 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { { return (*((uint32_t*)__this)); } } extern "C" uint32_t UInt32_System_IConvertible_ToUInt32_m1744564280_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint32_t* _thisAdjusted = reinterpret_cast<uint32_t*>(__this + 1); return UInt32_System_IConvertible_ToUInt32_m1744564280(_thisAdjusted, ___provider0, method); } // System.Int64 System.UInt32::System.IConvertible.ToInt64(System.IFormatProvider) extern "C" int64_t UInt32_System_IConvertible_ToInt64_m2261037378 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt32_System_IConvertible_ToInt64_m2261037378_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Convert_t2465617642_il2cpp_TypeInfo_var); int64_t L_0 = Convert_ToInt64_m3392013556(NULL /*static, unused*/, (*((uint32_t*)__this)), /*hidden argument*/NULL); return L_0; } } extern "C" int64_t UInt32_System_IConvertible_ToInt64_m2261037378_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint32_t* _thisAdjusted = reinterpret_cast<uint32_t*>(__this + 1); return UInt32_System_IConvertible_ToInt64_m2261037378(_thisAdjusted, ___provider0, method); } // System.UInt64 System.UInt32::System.IConvertible.ToUInt64(System.IFormatProvider) extern "C" uint64_t UInt32_System_IConvertible_ToUInt64_m1094958903 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt32_System_IConvertible_ToUInt64_m1094958903_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Convert_t2465617642_il2cpp_TypeInfo_var); uint64_t L_0 = Convert_ToUInt64_m1745056470(NULL /*static, unused*/, (*((uint32_t*)__this)), /*hidden argument*/NULL); return L_0; } } extern "C" uint64_t UInt32_System_IConvertible_ToUInt64_m1094958903_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint32_t* _thisAdjusted = reinterpret_cast<uint32_t*>(__this + 1); return UInt32_System_IConvertible_ToUInt64_m1094958903(_thisAdjusted, ___provider0, method); } // System.Single System.UInt32::System.IConvertible.ToSingle(System.IFormatProvider) extern "C" float UInt32_System_IConvertible_ToSingle_m1272823424 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt32_System_IConvertible_ToSingle_m1272823424_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Convert_t2465617642_il2cpp_TypeInfo_var); float L_0 = Convert_ToSingle_m3983149863(NULL /*static, unused*/, (*((uint32_t*)__this)), /*hidden argument*/NULL); return L_0; } } extern "C" float UInt32_System_IConvertible_ToSingle_m1272823424_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint32_t* _thisAdjusted = reinterpret_cast<uint32_t*>(__this + 1); return UInt32_System_IConvertible_ToSingle_m1272823424(_thisAdjusted, ___provider0, method); } // System.Double System.UInt32::System.IConvertible.ToDouble(System.IFormatProvider) extern "C" double UInt32_System_IConvertible_ToDouble_m940039456 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt32_System_IConvertible_ToDouble_m940039456_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Convert_t2465617642_il2cpp_TypeInfo_var); double L_0 = Convert_ToDouble_m2222536920(NULL /*static, unused*/, (*((uint32_t*)__this)), /*hidden argument*/NULL); return L_0; } } extern "C" double UInt32_System_IConvertible_ToDouble_m940039456_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint32_t* _thisAdjusted = reinterpret_cast<uint32_t*>(__this + 1); return UInt32_System_IConvertible_ToDouble_m940039456(_thisAdjusted, ___provider0, method); } // System.Decimal System.UInt32::System.IConvertible.ToDecimal(System.IFormatProvider) extern "C" Decimal_t2948259380 UInt32_System_IConvertible_ToDecimal_m675004071 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt32_System_IConvertible_ToDecimal_m675004071_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Convert_t2465617642_il2cpp_TypeInfo_var); Decimal_t2948259380 L_0 = Convert_ToDecimal_m889385228(NULL /*static, unused*/, (*((uint32_t*)__this)), /*hidden argument*/NULL); return L_0; } } extern "C" Decimal_t2948259380 UInt32_System_IConvertible_ToDecimal_m675004071_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint32_t* _thisAdjusted = reinterpret_cast<uint32_t*>(__this + 1); return UInt32_System_IConvertible_ToDecimal_m675004071(_thisAdjusted, ___provider0, method); } // System.DateTime System.UInt32::System.IConvertible.ToDateTime(System.IFormatProvider) extern "C" DateTime_t3738529785 UInt32_System_IConvertible_ToDateTime_m2767723441 (uint32_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt32_System_IConvertible_ToDateTime_m2767723441_MetadataUsageId); s_Il2CppMethodInitialized = true; } { ObjectU5BU5D_t2843939325* L_0 = (ObjectU5BU5D_t2843939325*)SZArrayNew(ObjectU5BU5D_t2843939325_il2cpp_TypeInfo_var, (uint32_t)2); ObjectU5BU5D_t2843939325* L_1 = L_0; NullCheck(L_1); ArrayElementTypeCheck (L_1, _stringLiteral2789887848); (L_1)->SetAt(static_cast<il2cpp_array_size_t>(0), (RuntimeObject *)_stringLiteral2789887848); ObjectU5BU5D_t2843939325* L_2 = L_1; NullCheck(L_2); ArrayElementTypeCheck (L_2, _stringLiteral3798051137); (L_2)->SetAt(static_cast<il2cpp_array_size_t>(1), (RuntimeObject *)_stringLiteral3798051137); String_t* L_3 = Environment_GetResourceString_m479507158(NULL /*static, unused*/, _stringLiteral4287968739, L_2, /*hidden argument*/NULL); InvalidCastException_t3927145244 * L_4 = (InvalidCastException_t3927145244 *)il2cpp_codegen_object_new(InvalidCastException_t3927145244_il2cpp_TypeInfo_var); InvalidCastException__ctor_m318645277(L_4, L_3, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_4, NULL, UInt32_System_IConvertible_ToDateTime_m2767723441_RuntimeMethod_var); } } extern "C" DateTime_t3738529785 UInt32_System_IConvertible_ToDateTime_m2767723441_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint32_t* _thisAdjusted = reinterpret_cast<uint32_t*>(__this + 1); return UInt32_System_IConvertible_ToDateTime_m2767723441(_thisAdjusted, ___provider0, method); } // System.Object System.UInt32::System.IConvertible.ToType(System.Type,System.IFormatProvider) extern "C" RuntimeObject * UInt32_System_IConvertible_ToType_m922356584 (uint32_t* __this, Type_t * ___type0, RuntimeObject* ___provider1, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt32_System_IConvertible_ToType_m922356584_MetadataUsageId); s_Il2CppMethodInitialized = true; } { uint32_t L_0 = ((uint32_t)(*((uint32_t*)__this))); RuntimeObject * L_1 = Box(UInt32_t2560061978_il2cpp_TypeInfo_var, &L_0); Type_t * L_2 = ___type0; RuntimeObject* L_3 = ___provider1; IL2CPP_RUNTIME_CLASS_INIT(Convert_t2465617642_il2cpp_TypeInfo_var); RuntimeObject * L_4 = Convert_DefaultToType_m1860037989(NULL /*static, unused*/, (RuntimeObject*)L_1, L_2, L_3, /*hidden argument*/NULL); return L_4; } } extern "C" RuntimeObject * UInt32_System_IConvertible_ToType_m922356584_AdjustorThunk (RuntimeObject * __this, Type_t * ___type0, RuntimeObject* ___provider1, const RuntimeMethod* method) { uint32_t* _thisAdjusted = reinterpret_cast<uint32_t*>(__this + 1); return UInt32_System_IConvertible_ToType_m922356584(_thisAdjusted, ___type0, ___provider1, method); } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Int32 System.UInt64::CompareTo(System.Object) extern "C" int32_t UInt64_CompareTo_m3619843473 (uint64_t* __this, RuntimeObject * ___value0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt64_CompareTo_m3619843473_MetadataUsageId); s_Il2CppMethodInitialized = true; } uint64_t V_0 = 0; { RuntimeObject * L_0 = ___value0; if (L_0) { goto IL_0005; } } { return 1; } IL_0005: { RuntimeObject * L_1 = ___value0; if (!((RuntimeObject *)IsInstSealed((RuntimeObject*)L_1, UInt64_t4134040092_il2cpp_TypeInfo_var))) { goto IL_0024; } } { RuntimeObject * L_2 = ___value0; V_0 = ((*(uint64_t*)((uint64_t*)UnBox(L_2, UInt64_t4134040092_il2cpp_TypeInfo_var)))); uint64_t L_3 = V_0; if ((!(((uint64_t)(*((int64_t*)__this))) < ((uint64_t)L_3)))) { goto IL_001b; } } { return (-1); } IL_001b: { uint64_t L_4 = V_0; if ((!(((uint64_t)(*((int64_t*)__this))) > ((uint64_t)L_4)))) { goto IL_0022; } } { return 1; } IL_0022: { return 0; } IL_0024: { String_t* L_5 = Environment_GetResourceString_m2063689938(NULL /*static, unused*/, _stringLiteral2814066682, /*hidden argument*/NULL); ArgumentException_t132251570 * L_6 = (ArgumentException_t132251570 *)il2cpp_codegen_object_new(ArgumentException_t132251570_il2cpp_TypeInfo_var); ArgumentException__ctor_m1312628991(L_6, L_5, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_6, NULL, UInt64_CompareTo_m3619843473_RuntimeMethod_var); } } extern "C" int32_t UInt64_CompareTo_m3619843473_AdjustorThunk (RuntimeObject * __this, RuntimeObject * ___value0, const RuntimeMethod* method) { uint64_t* _thisAdjusted = reinterpret_cast<uint64_t*>(__this + 1); return UInt64_CompareTo_m3619843473(_thisAdjusted, ___value0, method); } // System.Int32 System.UInt64::CompareTo(System.UInt64) extern "C" int32_t UInt64_CompareTo_m1614517204 (uint64_t* __this, uint64_t ___value0, const RuntimeMethod* method) { { uint64_t L_0 = ___value0; if ((!(((uint64_t)(*((int64_t*)__this))) < ((uint64_t)L_0)))) { goto IL_0007; } } { return (-1); } IL_0007: { uint64_t L_1 = ___value0; if ((!(((uint64_t)(*((int64_t*)__this))) > ((uint64_t)L_1)))) { goto IL_000e; } } { return 1; } IL_000e: { return 0; } } extern "C" int32_t UInt64_CompareTo_m1614517204_AdjustorThunk (RuntimeObject * __this, uint64_t ___value0, const RuntimeMethod* method) { uint64_t* _thisAdjusted = reinterpret_cast<uint64_t*>(__this + 1); return UInt64_CompareTo_m1614517204(_thisAdjusted, ___value0, method); } // System.Boolean System.UInt64::Equals(System.Object) extern "C" bool UInt64_Equals_m1879425698 (uint64_t* __this, RuntimeObject * ___obj0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt64_Equals_m1879425698_MetadataUsageId); s_Il2CppMethodInitialized = true; } { RuntimeObject * L_0 = ___obj0; if (((RuntimeObject *)IsInstSealed((RuntimeObject*)L_0, UInt64_t4134040092_il2cpp_TypeInfo_var))) { goto IL_000a; } } { return (bool)0; } IL_000a: { RuntimeObject * L_1 = ___obj0; return (bool)((((int64_t)(*((int64_t*)__this))) == ((int64_t)((*(uint64_t*)((uint64_t*)UnBox(L_1, UInt64_t4134040092_il2cpp_TypeInfo_var))))))? 1 : 0); } } extern "C" bool UInt64_Equals_m1879425698_AdjustorThunk (RuntimeObject * __this, RuntimeObject * ___obj0, const RuntimeMethod* method) { uint64_t* _thisAdjusted = reinterpret_cast<uint64_t*>(__this + 1); return UInt64_Equals_m1879425698(_thisAdjusted, ___obj0, method); } // System.Boolean System.UInt64::Equals(System.UInt64) extern "C" bool UInt64_Equals_m367573732 (uint64_t* __this, uint64_t ___obj0, const RuntimeMethod* method) { { uint64_t L_0 = ___obj0; return (bool)((((int64_t)(*((int64_t*)__this))) == ((int64_t)L_0))? 1 : 0); } } extern "C" bool UInt64_Equals_m367573732_AdjustorThunk (RuntimeObject * __this, uint64_t ___obj0, const RuntimeMethod* method) { uint64_t* _thisAdjusted = reinterpret_cast<uint64_t*>(__this + 1); return UInt64_Equals_m367573732(_thisAdjusted, ___obj0, method); } // System.Int32 System.UInt64::GetHashCode() extern "C" int32_t UInt64_GetHashCode_m4209760355 (uint64_t* __this, const RuntimeMethod* method) { { return ((int32_t)((int32_t)(((int32_t)((int32_t)(*((int64_t*)__this)))))^(int32_t)(((int32_t)((int32_t)((int64_t)((uint64_t)(*((int64_t*)__this))>>((int32_t)32)))))))); } } extern "C" int32_t UInt64_GetHashCode_m4209760355_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method) { uint64_t* _thisAdjusted = reinterpret_cast<uint64_t*>(__this + 1); return UInt64_GetHashCode_m4209760355(_thisAdjusted, method); } // System.String System.UInt64::ToString() extern "C" String_t* UInt64_ToString_m1529093114 (uint64_t* __this, const RuntimeMethod* method) { { NumberFormatInfo_t435877138 * L_0 = NumberFormatInfo_get_CurrentInfo_m2605582008(NULL /*static, unused*/, /*hidden argument*/NULL); String_t* L_1 = Number_FormatUInt64_m792080283(NULL /*static, unused*/, (*((int64_t*)__this)), (String_t*)NULL, L_0, /*hidden argument*/NULL); return L_1; } } extern "C" String_t* UInt64_ToString_m1529093114_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method) { uint64_t* _thisAdjusted = reinterpret_cast<uint64_t*>(__this + 1); return UInt64_ToString_m1529093114(_thisAdjusted, method); } // System.String System.UInt64::ToString(System.IFormatProvider) extern "C" String_t* UInt64_ToString_m2623377370 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { { RuntimeObject* L_0 = ___provider0; NumberFormatInfo_t435877138 * L_1 = NumberFormatInfo_GetInstance_m2833078205(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); String_t* L_2 = Number_FormatUInt64_m792080283(NULL /*static, unused*/, (*((int64_t*)__this)), (String_t*)NULL, L_1, /*hidden argument*/NULL); return L_2; } } extern "C" String_t* UInt64_ToString_m2623377370_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint64_t* _thisAdjusted = reinterpret_cast<uint64_t*>(__this + 1); return UInt64_ToString_m2623377370(_thisAdjusted, ___provider0, method); } // System.String System.UInt64::ToString(System.String) extern "C" String_t* UInt64_ToString_m2177233542 (uint64_t* __this, String_t* ___format0, const RuntimeMethod* method) { { String_t* L_0 = ___format0; NumberFormatInfo_t435877138 * L_1 = NumberFormatInfo_get_CurrentInfo_m2605582008(NULL /*static, unused*/, /*hidden argument*/NULL); String_t* L_2 = Number_FormatUInt64_m792080283(NULL /*static, unused*/, (*((int64_t*)__this)), L_0, L_1, /*hidden argument*/NULL); return L_2; } } extern "C" String_t* UInt64_ToString_m2177233542_AdjustorThunk (RuntimeObject * __this, String_t* ___format0, const RuntimeMethod* method) { uint64_t* _thisAdjusted = reinterpret_cast<uint64_t*>(__this + 1); return UInt64_ToString_m2177233542(_thisAdjusted, ___format0, method); } // System.String System.UInt64::ToString(System.String,System.IFormatProvider) extern "C" String_t* UInt64_ToString_m1695188334 (uint64_t* __this, String_t* ___format0, RuntimeObject* ___provider1, const RuntimeMethod* method) { { String_t* L_0 = ___format0; RuntimeObject* L_1 = ___provider1; NumberFormatInfo_t435877138 * L_2 = NumberFormatInfo_GetInstance_m2833078205(NULL /*static, unused*/, L_1, /*hidden argument*/NULL); String_t* L_3 = Number_FormatUInt64_m792080283(NULL /*static, unused*/, (*((int64_t*)__this)), L_0, L_2, /*hidden argument*/NULL); return L_3; } } extern "C" String_t* UInt64_ToString_m1695188334_AdjustorThunk (RuntimeObject * __this, String_t* ___format0, RuntimeObject* ___provider1, const RuntimeMethod* method) { uint64_t* _thisAdjusted = reinterpret_cast<uint64_t*>(__this + 1); return UInt64_ToString_m1695188334(_thisAdjusted, ___format0, ___provider1, method); } // System.UInt64 System.UInt64::Parse(System.String,System.IFormatProvider) extern "C" uint64_t UInt64_Parse_m819899889 (RuntimeObject * __this /* static, unused */, String_t* ___s0, RuntimeObject* ___provider1, const RuntimeMethod* method) { { String_t* L_0 = ___s0; RuntimeObject* L_1 = ___provider1; NumberFormatInfo_t435877138 * L_2 = NumberFormatInfo_GetInstance_m2833078205(NULL /*static, unused*/, L_1, /*hidden argument*/NULL); uint64_t L_3 = Number_ParseUInt64_m2694014565(NULL /*static, unused*/, L_0, 7, L_2, /*hidden argument*/NULL); return L_3; } } // System.UInt64 System.UInt64::Parse(System.String,System.Globalization.NumberStyles,System.IFormatProvider) extern "C" uint64_t UInt64_Parse_m1485858293 (RuntimeObject * __this /* static, unused */, String_t* ___s0, int32_t ___style1, RuntimeObject* ___provider2, const RuntimeMethod* method) { { int32_t L_0 = ___style1; NumberFormatInfo_ValidateParseStyleInteger_m957858295(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); String_t* L_1 = ___s0; int32_t L_2 = ___style1; RuntimeObject* L_3 = ___provider2; NumberFormatInfo_t435877138 * L_4 = NumberFormatInfo_GetInstance_m2833078205(NULL /*static, unused*/, L_3, /*hidden argument*/NULL); uint64_t L_5 = Number_ParseUInt64_m2694014565(NULL /*static, unused*/, L_1, L_2, L_4, /*hidden argument*/NULL); return L_5; } } // System.Boolean System.UInt64::TryParse(System.String,System.Globalization.NumberStyles,System.IFormatProvider,System.UInt64&) extern "C" bool UInt64_TryParse_m3060369906 (RuntimeObject * __this /* static, unused */, String_t* ___s0, int32_t ___style1, RuntimeObject* ___provider2, uint64_t* ___result3, const RuntimeMethod* method) { { int32_t L_0 = ___style1; NumberFormatInfo_ValidateParseStyleInteger_m957858295(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); String_t* L_1 = ___s0; int32_t L_2 = ___style1; RuntimeObject* L_3 = ___provider2; NumberFormatInfo_t435877138 * L_4 = NumberFormatInfo_GetInstance_m2833078205(NULL /*static, unused*/, L_3, /*hidden argument*/NULL); uint64_t* L_5 = ___result3; bool L_6 = Number_TryParseUInt64_m782753458(NULL /*static, unused*/, L_1, L_2, L_4, (uint64_t*)L_5, /*hidden argument*/NULL); return L_6; } } // System.TypeCode System.UInt64::GetTypeCode() extern "C" int32_t UInt64_GetTypeCode_m844217172 (uint64_t* __this, const RuntimeMethod* method) { { return (int32_t)(((int32_t)12)); } } extern "C" int32_t UInt64_GetTypeCode_m844217172_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method) { uint64_t* _thisAdjusted = reinterpret_cast<uint64_t*>(__this + 1); return UInt64_GetTypeCode_m844217172(_thisAdjusted, method); } // System.Boolean System.UInt64::System.IConvertible.ToBoolean(System.IFormatProvider) extern "C" bool UInt64_System_IConvertible_ToBoolean_m3071416000 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt64_System_IConvertible_ToBoolean_m3071416000_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Convert_t2465617642_il2cpp_TypeInfo_var); bool L_0 = Convert_ToBoolean_m3613483153(NULL /*static, unused*/, (*((int64_t*)__this)), /*hidden argument*/NULL); return L_0; } } extern "C" bool UInt64_System_IConvertible_ToBoolean_m3071416000_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint64_t* _thisAdjusted = reinterpret_cast<uint64_t*>(__this + 1); return UInt64_System_IConvertible_ToBoolean_m3071416000(_thisAdjusted, ___provider0, method); } // System.Char System.UInt64::System.IConvertible.ToChar(System.IFormatProvider) extern "C" Il2CppChar UInt64_System_IConvertible_ToChar_m2074245892 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt64_System_IConvertible_ToChar_m2074245892_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Convert_t2465617642_il2cpp_TypeInfo_var); Il2CppChar L_0 = Convert_ToChar_m1604365259(NULL /*static, unused*/, (*((int64_t*)__this)), /*hidden argument*/NULL); return L_0; } } extern "C" Il2CppChar UInt64_System_IConvertible_ToChar_m2074245892_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint64_t* _thisAdjusted = reinterpret_cast<uint64_t*>(__this + 1); return UInt64_System_IConvertible_ToChar_m2074245892(_thisAdjusted, ___provider0, method); } // System.SByte System.UInt64::System.IConvertible.ToSByte(System.IFormatProvider) extern "C" int8_t UInt64_System_IConvertible_ToSByte_m30962591 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt64_System_IConvertible_ToSByte_m30962591_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Convert_t2465617642_il2cpp_TypeInfo_var); int8_t L_0 = Convert_ToSByte_m1679390684(NULL /*static, unused*/, (*((int64_t*)__this)), /*hidden argument*/NULL); return L_0; } } extern "C" int8_t UInt64_System_IConvertible_ToSByte_m30962591_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint64_t* _thisAdjusted = reinterpret_cast<uint64_t*>(__this + 1); return UInt64_System_IConvertible_ToSByte_m30962591(_thisAdjusted, ___provider0, method); } // System.Byte System.UInt64::System.IConvertible.ToByte(System.IFormatProvider) extern "C" uint8_t UInt64_System_IConvertible_ToByte_m1501504925 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt64_System_IConvertible_ToByte_m1501504925_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Convert_t2465617642_il2cpp_TypeInfo_var); uint8_t L_0 = Convert_ToByte_m3567528984(NULL /*static, unused*/, (*((int64_t*)__this)), /*hidden argument*/NULL); return L_0; } } extern "C" uint8_t UInt64_System_IConvertible_ToByte_m1501504925_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint64_t* _thisAdjusted = reinterpret_cast<uint64_t*>(__this + 1); return UInt64_System_IConvertible_ToByte_m1501504925(_thisAdjusted, ___provider0, method); } // System.Int16 System.UInt64::System.IConvertible.ToInt16(System.IFormatProvider) extern "C" int16_t UInt64_System_IConvertible_ToInt16_m3895479143 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt64_System_IConvertible_ToInt16_m3895479143_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Convert_t2465617642_il2cpp_TypeInfo_var); int16_t L_0 = Convert_ToInt16_m1733792763(NULL /*static, unused*/, (*((int64_t*)__this)), /*hidden argument*/NULL); return L_0; } } extern "C" int16_t UInt64_System_IConvertible_ToInt16_m3895479143_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint64_t* _thisAdjusted = reinterpret_cast<uint64_t*>(__this + 1); return UInt64_System_IConvertible_ToInt16_m3895479143(_thisAdjusted, ___provider0, method); } // System.UInt16 System.UInt64::System.IConvertible.ToUInt16(System.IFormatProvider) extern "C" uint16_t UInt64_System_IConvertible_ToUInt16_m4165747038 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt64_System_IConvertible_ToUInt16_m4165747038_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Convert_t2465617642_il2cpp_TypeInfo_var); uint16_t L_0 = Convert_ToUInt16_m2672597498(NULL /*static, unused*/, (*((int64_t*)__this)), /*hidden argument*/NULL); return L_0; } } extern "C" uint16_t UInt64_System_IConvertible_ToUInt16_m4165747038_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint64_t* _thisAdjusted = reinterpret_cast<uint64_t*>(__this + 1); return UInt64_System_IConvertible_ToUInt16_m4165747038(_thisAdjusted, ___provider0, method); } // System.Int32 System.UInt64::System.IConvertible.ToInt32(System.IFormatProvider) extern "C" int32_t UInt64_System_IConvertible_ToInt32_m949522652 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt64_System_IConvertible_ToInt32_m949522652_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Convert_t2465617642_il2cpp_TypeInfo_var); int32_t L_0 = Convert_ToInt32_m825155517(NULL /*static, unused*/, (*((int64_t*)__this)), /*hidden argument*/NULL); return L_0; } } extern "C" int32_t UInt64_System_IConvertible_ToInt32_m949522652_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint64_t* _thisAdjusted = reinterpret_cast<uint64_t*>(__this + 1); return UInt64_System_IConvertible_ToInt32_m949522652(_thisAdjusted, ___provider0, method); } // System.UInt32 System.UInt64::System.IConvertible.ToUInt32(System.IFormatProvider) extern "C" uint32_t UInt64_System_IConvertible_ToUInt32_m2784653358 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt64_System_IConvertible_ToUInt32_m2784653358_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Convert_t2465617642_il2cpp_TypeInfo_var); uint32_t L_0 = Convert_ToUInt32_m1767593911(NULL /*static, unused*/, (*((int64_t*)__this)), /*hidden argument*/NULL); return L_0; } } extern "C" uint32_t UInt64_System_IConvertible_ToUInt32_m2784653358_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint64_t* _thisAdjusted = reinterpret_cast<uint64_t*>(__this + 1); return UInt64_System_IConvertible_ToUInt32_m2784653358(_thisAdjusted, ___provider0, method); } // System.Int64 System.UInt64::System.IConvertible.ToInt64(System.IFormatProvider) extern "C" int64_t UInt64_System_IConvertible_ToInt64_m4241475606 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt64_System_IConvertible_ToInt64_m4241475606_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Convert_t2465617642_il2cpp_TypeInfo_var); int64_t L_0 = Convert_ToInt64_m260173354(NULL /*static, unused*/, (*((int64_t*)__this)), /*hidden argument*/NULL); return L_0; } } extern "C" int64_t UInt64_System_IConvertible_ToInt64_m4241475606_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint64_t* _thisAdjusted = reinterpret_cast<uint64_t*>(__this + 1); return UInt64_System_IConvertible_ToInt64_m4241475606(_thisAdjusted, ___provider0, method); } // System.UInt64 System.UInt64::System.IConvertible.ToUInt64(System.IFormatProvider) extern "C" uint64_t UInt64_System_IConvertible_ToUInt64_m2135047981 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { { return (*((int64_t*)__this)); } } extern "C" uint64_t UInt64_System_IConvertible_ToUInt64_m2135047981_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint64_t* _thisAdjusted = reinterpret_cast<uint64_t*>(__this + 1); return UInt64_System_IConvertible_ToUInt64_m2135047981(_thisAdjusted, ___provider0, method); } // System.Single System.UInt64::System.IConvertible.ToSingle(System.IFormatProvider) extern "C" float UInt64_System_IConvertible_ToSingle_m925613075 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt64_System_IConvertible_ToSingle_m925613075_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Convert_t2465617642_il2cpp_TypeInfo_var); float L_0 = Convert_ToSingle_m2791508777(NULL /*static, unused*/, (*((int64_t*)__this)), /*hidden argument*/NULL); return L_0; } } extern "C" float UInt64_System_IConvertible_ToSingle_m925613075_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint64_t* _thisAdjusted = reinterpret_cast<uint64_t*>(__this + 1); return UInt64_System_IConvertible_ToSingle_m925613075(_thisAdjusted, ___provider0, method); } // System.Double System.UInt64::System.IConvertible.ToDouble(System.IFormatProvider) extern "C" double UInt64_System_IConvertible_ToDouble_m602078108 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt64_System_IConvertible_ToDouble_m602078108_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Convert_t2465617642_il2cpp_TypeInfo_var); double L_0 = Convert_ToDouble_m1030895834(NULL /*static, unused*/, (*((int64_t*)__this)), /*hidden argument*/NULL); return L_0; } } extern "C" double UInt64_System_IConvertible_ToDouble_m602078108_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint64_t* _thisAdjusted = reinterpret_cast<uint64_t*>(__this + 1); return UInt64_System_IConvertible_ToDouble_m602078108(_thisAdjusted, ___provider0, method); } // System.Decimal System.UInt64::System.IConvertible.ToDecimal(System.IFormatProvider) extern "C" Decimal_t2948259380 UInt64_System_IConvertible_ToDecimal_m806594027 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt64_System_IConvertible_ToDecimal_m806594027_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(Convert_t2465617642_il2cpp_TypeInfo_var); Decimal_t2948259380 L_0 = Convert_ToDecimal_m1695757674(NULL /*static, unused*/, (*((int64_t*)__this)), /*hidden argument*/NULL); return L_0; } } extern "C" Decimal_t2948259380 UInt64_System_IConvertible_ToDecimal_m806594027_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint64_t* _thisAdjusted = reinterpret_cast<uint64_t*>(__this + 1); return UInt64_System_IConvertible_ToDecimal_m806594027(_thisAdjusted, ___provider0, method); } // System.DateTime System.UInt64::System.IConvertible.ToDateTime(System.IFormatProvider) extern "C" DateTime_t3738529785 UInt64_System_IConvertible_ToDateTime_m3434604642 (uint64_t* __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt64_System_IConvertible_ToDateTime_m3434604642_MetadataUsageId); s_Il2CppMethodInitialized = true; } { ObjectU5BU5D_t2843939325* L_0 = (ObjectU5BU5D_t2843939325*)SZArrayNew(ObjectU5BU5D_t2843939325_il2cpp_TypeInfo_var, (uint32_t)2); ObjectU5BU5D_t2843939325* L_1 = L_0; NullCheck(L_1); ArrayElementTypeCheck (L_1, _stringLiteral2789494635); (L_1)->SetAt(static_cast<il2cpp_array_size_t>(0), (RuntimeObject *)_stringLiteral2789494635); ObjectU5BU5D_t2843939325* L_2 = L_1; NullCheck(L_2); ArrayElementTypeCheck (L_2, _stringLiteral3798051137); (L_2)->SetAt(static_cast<il2cpp_array_size_t>(1), (RuntimeObject *)_stringLiteral3798051137); String_t* L_3 = Environment_GetResourceString_m479507158(NULL /*static, unused*/, _stringLiteral4287968739, L_2, /*hidden argument*/NULL); InvalidCastException_t3927145244 * L_4 = (InvalidCastException_t3927145244 *)il2cpp_codegen_object_new(InvalidCastException_t3927145244_il2cpp_TypeInfo_var); InvalidCastException__ctor_m318645277(L_4, L_3, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_4, NULL, UInt64_System_IConvertible_ToDateTime_m3434604642_RuntimeMethod_var); } } extern "C" DateTime_t3738529785 UInt64_System_IConvertible_ToDateTime_m3434604642_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___provider0, const RuntimeMethod* method) { uint64_t* _thisAdjusted = reinterpret_cast<uint64_t*>(__this + 1); return UInt64_System_IConvertible_ToDateTime_m3434604642(_thisAdjusted, ___provider0, method); } // System.Object System.UInt64::System.IConvertible.ToType(System.Type,System.IFormatProvider) extern "C" RuntimeObject * UInt64_System_IConvertible_ToType_m4049257834 (uint64_t* __this, Type_t * ___type0, RuntimeObject* ___provider1, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UInt64_System_IConvertible_ToType_m4049257834_MetadataUsageId); s_Il2CppMethodInitialized = true; } { uint64_t L_0 = ((uint64_t)(*((int64_t*)__this))); RuntimeObject * L_1 = Box(UInt64_t4134040092_il2cpp_TypeInfo_var, &L_0); Type_t * L_2 = ___type0; RuntimeObject* L_3 = ___provider1; IL2CPP_RUNTIME_CLASS_INIT(Convert_t2465617642_il2cpp_TypeInfo_var); RuntimeObject * L_4 = Convert_DefaultToType_m1860037989(NULL /*static, unused*/, (RuntimeObject*)L_1, L_2, L_3, /*hidden argument*/NULL); return L_4; } } extern "C" RuntimeObject * UInt64_System_IConvertible_ToType_m4049257834_AdjustorThunk (RuntimeObject * __this, Type_t * ___type0, RuntimeObject* ___provider1, const RuntimeMethod* method) { uint64_t* _thisAdjusted = reinterpret_cast<uint64_t*>(__this + 1); return UInt64_System_IConvertible_ToType_m4049257834(_thisAdjusted, ___type0, ___provider1, method); } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Void System.UIntPtr::.ctor(System.UInt32) extern "C" void UIntPtr__ctor_m4250165422 (uintptr_t* __this, uint32_t ___value0, const RuntimeMethod* method) { { uint32_t L_0 = ___value0; *__this = ((((uintptr_t)L_0))); return; } } extern "C" void UIntPtr__ctor_m4250165422_AdjustorThunk (RuntimeObject * __this, uint32_t ___value0, const RuntimeMethod* method) { uintptr_t* _thisAdjusted = reinterpret_cast<uintptr_t*>(__this + 1); UIntPtr__ctor_m4250165422(_thisAdjusted, ___value0, method); } // System.Boolean System.UIntPtr::Equals(System.Object) extern "C" bool UIntPtr_Equals_m1316671746 (uintptr_t* __this, RuntimeObject * ___obj0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UIntPtr_Equals_m1316671746_MetadataUsageId); s_Il2CppMethodInitialized = true; } uintptr_t V_0; memset(&V_0, 0, sizeof(V_0)); { RuntimeObject * L_0 = ___obj0; if (!((RuntimeObject *)IsInstSealed((RuntimeObject*)L_0, UIntPtr_t_il2cpp_TypeInfo_var))) { goto IL_001f; } } { RuntimeObject * L_1 = ___obj0; V_0 = ((*(uintptr_t*)((uintptr_t*)UnBox(L_1, UIntPtr_t_il2cpp_TypeInfo_var)))); uintptr_t L_2 = *__this; uintptr_t L_3 = V_0; return (bool)((((intptr_t)L_2) == ((intptr_t)L_3))? 1 : 0); } IL_001f: { return (bool)0; } } extern "C" bool UIntPtr_Equals_m1316671746_AdjustorThunk (RuntimeObject * __this, RuntimeObject * ___obj0, const RuntimeMethod* method) { uintptr_t* _thisAdjusted = reinterpret_cast<uintptr_t*>(__this + 1); return UIntPtr_Equals_m1316671746(_thisAdjusted, ___obj0, method); } // System.Int32 System.UIntPtr::GetHashCode() extern "C" int32_t UIntPtr_GetHashCode_m3482152298 (uintptr_t* __this, const RuntimeMethod* method) { { uintptr_t L_0 = *__this; return (((int32_t)((int32_t)L_0))); } } extern "C" int32_t UIntPtr_GetHashCode_m3482152298_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method) { uintptr_t* _thisAdjusted = reinterpret_cast<uintptr_t*>(__this + 1); return UIntPtr_GetHashCode_m3482152298(_thisAdjusted, method); } // System.String System.UIntPtr::ToString() extern "C" String_t* UIntPtr_ToString_m984583492 (uintptr_t* __this, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UIntPtr_ToString_m984583492_MetadataUsageId); s_Il2CppMethodInitialized = true; } uint64_t V_0 = 0; uint32_t V_1 = 0; { IL2CPP_RUNTIME_CLASS_INIT(UIntPtr_t_il2cpp_TypeInfo_var); int32_t L_0 = UIntPtr_get_Size_m703595701(NULL /*static, unused*/, /*hidden argument*/NULL); if ((((int32_t)L_0) < ((int32_t)8))) { goto IL_0018; } } { uintptr_t L_1 = *__this; V_0 = (((int64_t)((uint64_t)L_1))); String_t* L_2 = UInt64_ToString_m1529093114((uint64_t*)(&V_0), /*hidden argument*/NULL); return L_2; } IL_0018: { uintptr_t L_3 = *__this; V_1 = (((int32_t)((uint32_t)L_3))); String_t* L_4 = UInt32_ToString_m2574561716((uint32_t*)(&V_1), /*hidden argument*/NULL); return L_4; } } extern "C" String_t* UIntPtr_ToString_m984583492_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method) { uintptr_t* _thisAdjusted = reinterpret_cast<uintptr_t*>(__this + 1); return UIntPtr_ToString_m984583492(_thisAdjusted, method); } // System.Void System.UIntPtr::System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) extern "C" void UIntPtr_System_Runtime_Serialization_ISerializable_GetObjectData_m1767630151 (uintptr_t* __this, SerializationInfo_t950877179 * ___info0, StreamingContext_t3711869237 ___context1, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UIntPtr_System_Runtime_Serialization_ISerializable_GetObjectData_m1767630151_MetadataUsageId); s_Il2CppMethodInitialized = true; } { SerializationInfo_t950877179 * L_0 = ___info0; if (L_0) { goto IL_000e; } } { ArgumentNullException_t1615371798 * L_1 = (ArgumentNullException_t1615371798 *)il2cpp_codegen_object_new(ArgumentNullException_t1615371798_il2cpp_TypeInfo_var); ArgumentNullException__ctor_m1170824041(L_1, _stringLiteral79347, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_1, NULL, UIntPtr_System_Runtime_Serialization_ISerializable_GetObjectData_m1767630151_RuntimeMethod_var); } IL_000e: { SerializationInfo_t950877179 * L_2 = ___info0; uintptr_t L_3 = *__this; NullCheck(L_2); SerializationInfo_AddValue_m2020653395(L_2, _stringLiteral1363226343, (((int64_t)((uint64_t)L_3))), /*hidden argument*/NULL); return; } } extern "C" void UIntPtr_System_Runtime_Serialization_ISerializable_GetObjectData_m1767630151_AdjustorThunk (RuntimeObject * __this, SerializationInfo_t950877179 * ___info0, StreamingContext_t3711869237 ___context1, const RuntimeMethod* method) { uintptr_t* _thisAdjusted = reinterpret_cast<uintptr_t*>(__this + 1); UIntPtr_System_Runtime_Serialization_ISerializable_GetObjectData_m1767630151(_thisAdjusted, ___info0, ___context1, method); } // System.Boolean System.UIntPtr::op_Equality(System.UIntPtr,System.UIntPtr) extern "C" bool UIntPtr_op_Equality_m2241921281 (RuntimeObject * __this /* static, unused */, uintptr_t ___value10, uintptr_t ___value21, const RuntimeMethod* method) { { uintptr_t L_0 = ___value10; uintptr_t L_1 = ___value21; return (bool)((((intptr_t)L_0) == ((intptr_t)L_1))? 1 : 0); } } // System.Int32 System.UIntPtr::get_Size() extern "C" int32_t UIntPtr_get_Size_m703595701 (RuntimeObject * __this /* static, unused */, const RuntimeMethod* method) { { uint32_t L_0 = sizeof(void*); return L_0; } } // System.Void System.UIntPtr::.cctor() extern "C" void UIntPtr__cctor_m3513964473 (RuntimeObject * __this /* static, unused */, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UIntPtr__cctor_m3513964473_MetadataUsageId); s_Il2CppMethodInitialized = true; } { uintptr_t L_0; memset(&L_0, 0, sizeof(L_0)); UIntPtr__ctor_m4250165422((&L_0), 0, /*hidden argument*/NULL); return; } } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Void System.UnauthorizedAccessException::.ctor() extern "C" void UnauthorizedAccessException__ctor_m246605039 (UnauthorizedAccessException_t490705335 * __this, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UnauthorizedAccessException__ctor_m246605039_MetadataUsageId); s_Il2CppMethodInitialized = true; } { String_t* L_0 = Environment_GetResourceString_m2063689938(NULL /*static, unused*/, _stringLiteral2994918982, /*hidden argument*/NULL); SystemException__ctor_m3298527747(__this, L_0, /*hidden argument*/NULL); Exception_SetErrorCode_m4269507377(__this, ((int32_t)-2147024891), /*hidden argument*/NULL); return; } } // System.Void System.UnauthorizedAccessException::.ctor(System.String) extern "C" void UnauthorizedAccessException__ctor_m40101894 (UnauthorizedAccessException_t490705335 * __this, String_t* ___message0, const RuntimeMethod* method) { { String_t* L_0 = ___message0; SystemException__ctor_m3298527747(__this, L_0, /*hidden argument*/NULL); Exception_SetErrorCode_m4269507377(__this, ((int32_t)-2147024891), /*hidden argument*/NULL); return; } } // System.Void System.UnauthorizedAccessException::.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) extern "C" void UnauthorizedAccessException__ctor_m1652256089 (UnauthorizedAccessException_t490705335 * __this, SerializationInfo_t950877179 * ___info0, StreamingContext_t3711869237 ___context1, const RuntimeMethod* method) { { SerializationInfo_t950877179 * L_0 = ___info0; StreamingContext_t3711869237 L_1 = ___context1; SystemException__ctor_m1515048899(__this, L_0, L_1, /*hidden argument*/NULL); return; } } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Void System.UnhandledExceptionEventArgs::.ctor(System.Object,System.Boolean) extern "C" void UnhandledExceptionEventArgs__ctor_m224348470 (UnhandledExceptionEventArgs_t2886101344 * __this, RuntimeObject * ___exception0, bool ___isTerminating1, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UnhandledExceptionEventArgs__ctor_m224348470_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(EventArgs_t3591816995_il2cpp_TypeInfo_var); EventArgs__ctor_m32674013(__this, /*hidden argument*/NULL); RuntimeObject * L_0 = ___exception0; __this->set__Exception_1(L_0); bool L_1 = ___isTerminating1; __this->set__IsTerminating_2(L_1); return; } } // System.Object System.UnhandledExceptionEventArgs::get_ExceptionObject() extern "C" RuntimeObject * UnhandledExceptionEventArgs_get_ExceptionObject_m862578480 (UnhandledExceptionEventArgs_t2886101344 * __this, const RuntimeMethod* method) { { RuntimeObject * L_0 = __this->get__Exception_1(); return L_0; } } // System.Boolean System.UnhandledExceptionEventArgs::get_IsTerminating() extern "C" bool UnhandledExceptionEventArgs_get_IsTerminating_m4073714616 (UnhandledExceptionEventArgs_t2886101344 * __this, const RuntimeMethod* method) { { bool L_0 = __this->get__IsTerminating_2(); return L_0; } } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Void System.UnhandledExceptionEventHandler::.ctor(System.Object,System.IntPtr) extern "C" void UnhandledExceptionEventHandler__ctor_m626016213 (UnhandledExceptionEventHandler_t3101989324 * __this, RuntimeObject * ___object0, intptr_t ___method1, const RuntimeMethod* method) { __this->set_method_ptr_0(il2cpp_codegen_get_method_pointer((RuntimeMethod*)___method1)); __this->set_method_3(___method1); __this->set_m_target_2(___object0); } // System.Void System.UnhandledExceptionEventHandler::Invoke(System.Object,System.UnhandledExceptionEventArgs) extern "C" void UnhandledExceptionEventHandler_Invoke_m1545705626 (UnhandledExceptionEventHandler_t3101989324 * __this, RuntimeObject * ___sender0, UnhandledExceptionEventArgs_t2886101344 * ___e1, const RuntimeMethod* method) { il2cpp_codegen_raise_execution_engine_exception_if_method_is_not_found((RuntimeMethod*)(__this->get_method_3())); DelegateU5BU5D_t1703627840* delegatesToInvoke = __this->get_delegates_11(); if (delegatesToInvoke != NULL) { il2cpp_array_size_t length = delegatesToInvoke->max_length; for (il2cpp_array_size_t i = 0; i < length; i++) { Delegate_t1188392813* currentDelegate = (delegatesToInvoke)->GetAtUnchecked(static_cast<il2cpp_array_size_t>(i)); Il2CppMethodPointer targetMethodPointer = currentDelegate->get_method_ptr_0(); RuntimeMethod* targetMethod = (RuntimeMethod*)(currentDelegate->get_method_3()); RuntimeObject* targetThis = currentDelegate->get_m_target_2(); il2cpp_codegen_raise_execution_engine_exception_if_method_is_not_found(targetMethod); bool ___methodIsStatic = MethodIsStatic(targetMethod); if (___methodIsStatic) { if (il2cpp_codegen_method_parameter_count(targetMethod) == 2) { // open { typedef void (*FunctionPointerType) (RuntimeObject *, RuntimeObject *, UnhandledExceptionEventArgs_t2886101344 *, const RuntimeMethod*); ((FunctionPointerType)targetMethodPointer)(NULL, ___sender0, ___e1, targetMethod); } } else { // closed { typedef void (*FunctionPointerType) (RuntimeObject *, void*, RuntimeObject *, UnhandledExceptionEventArgs_t2886101344 *, const RuntimeMethod*); ((FunctionPointerType)targetMethodPointer)(NULL, targetThis, ___sender0, ___e1, targetMethod); } } } else { if (il2cpp_codegen_method_parameter_count(targetMethod) == 2) { // closed if (il2cpp_codegen_method_is_virtual(targetMethod) && !il2cpp_codegen_object_is_of_sealed_type(targetThis) && il2cpp_codegen_delegate_has_invoker((Il2CppDelegate*)__this)) { if (il2cpp_codegen_method_is_generic_instance(targetMethod)) { if (il2cpp_codegen_method_is_interface_method(targetMethod)) GenericInterfaceActionInvoker2< RuntimeObject *, UnhandledExceptionEventArgs_t2886101344 * >::Invoke(targetMethod, targetThis, ___sender0, ___e1); else GenericVirtActionInvoker2< RuntimeObject *, UnhandledExceptionEventArgs_t2886101344 * >::Invoke(targetMethod, targetThis, ___sender0, ___e1); } else { if (il2cpp_codegen_method_is_interface_method(targetMethod)) InterfaceActionInvoker2< RuntimeObject *, UnhandledExceptionEventArgs_t2886101344 * >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), il2cpp_codegen_method_get_declaring_type(targetMethod), targetThis, ___sender0, ___e1); else VirtActionInvoker2< RuntimeObject *, UnhandledExceptionEventArgs_t2886101344 * >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), targetThis, ___sender0, ___e1); } } else { typedef void (*FunctionPointerType) (void*, RuntimeObject *, UnhandledExceptionEventArgs_t2886101344 *, const RuntimeMethod*); ((FunctionPointerType)targetMethodPointer)(targetThis, ___sender0, ___e1, targetMethod); } } else { // open if (il2cpp_codegen_method_is_virtual(targetMethod) && !il2cpp_codegen_object_is_of_sealed_type(targetThis) && il2cpp_codegen_delegate_has_invoker((Il2CppDelegate*)__this)) { if (il2cpp_codegen_method_is_generic_instance(targetMethod)) { if (il2cpp_codegen_method_is_interface_method(targetMethod)) GenericInterfaceActionInvoker1< UnhandledExceptionEventArgs_t2886101344 * >::Invoke(targetMethod, ___sender0, ___e1); else GenericVirtActionInvoker1< UnhandledExceptionEventArgs_t2886101344 * >::Invoke(targetMethod, ___sender0, ___e1); } else { if (il2cpp_codegen_method_is_interface_method(targetMethod)) InterfaceActionInvoker1< UnhandledExceptionEventArgs_t2886101344 * >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), il2cpp_codegen_method_get_declaring_type(targetMethod), ___sender0, ___e1); else VirtActionInvoker1< UnhandledExceptionEventArgs_t2886101344 * >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), ___sender0, ___e1); } } else { typedef void (*FunctionPointerType) (RuntimeObject *, UnhandledExceptionEventArgs_t2886101344 *, const RuntimeMethod*); ((FunctionPointerType)targetMethodPointer)(___sender0, ___e1, targetMethod); } } } } } else { Il2CppMethodPointer targetMethodPointer = __this->get_method_ptr_0(); RuntimeMethod* targetMethod = (RuntimeMethod*)(__this->get_method_3()); RuntimeObject* targetThis = __this->get_m_target_2(); il2cpp_codegen_raise_execution_engine_exception_if_method_is_not_found(targetMethod); bool ___methodIsStatic = MethodIsStatic(targetMethod); if (___methodIsStatic) { if (il2cpp_codegen_method_parameter_count(targetMethod) == 2) { // open { typedef void (*FunctionPointerType) (RuntimeObject *, RuntimeObject *, UnhandledExceptionEventArgs_t2886101344 *, const RuntimeMethod*); ((FunctionPointerType)targetMethodPointer)(NULL, ___sender0, ___e1, targetMethod); } } else { // closed { typedef void (*FunctionPointerType) (RuntimeObject *, void*, RuntimeObject *, UnhandledExceptionEventArgs_t2886101344 *, const RuntimeMethod*); ((FunctionPointerType)targetMethodPointer)(NULL, targetThis, ___sender0, ___e1, targetMethod); } } } else { if (il2cpp_codegen_method_parameter_count(targetMethod) == 2) { // closed if (il2cpp_codegen_method_is_virtual(targetMethod) && !il2cpp_codegen_object_is_of_sealed_type(targetThis) && il2cpp_codegen_delegate_has_invoker((Il2CppDelegate*)__this)) { if (il2cpp_codegen_method_is_generic_instance(targetMethod)) { if (il2cpp_codegen_method_is_interface_method(targetMethod)) GenericInterfaceActionInvoker2< RuntimeObject *, UnhandledExceptionEventArgs_t2886101344 * >::Invoke(targetMethod, targetThis, ___sender0, ___e1); else GenericVirtActionInvoker2< RuntimeObject *, UnhandledExceptionEventArgs_t2886101344 * >::Invoke(targetMethod, targetThis, ___sender0, ___e1); } else { if (il2cpp_codegen_method_is_interface_method(targetMethod)) InterfaceActionInvoker2< RuntimeObject *, UnhandledExceptionEventArgs_t2886101344 * >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), il2cpp_codegen_method_get_declaring_type(targetMethod), targetThis, ___sender0, ___e1); else VirtActionInvoker2< RuntimeObject *, UnhandledExceptionEventArgs_t2886101344 * >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), targetThis, ___sender0, ___e1); } } else { typedef void (*FunctionPointerType) (void*, RuntimeObject *, UnhandledExceptionEventArgs_t2886101344 *, const RuntimeMethod*); ((FunctionPointerType)targetMethodPointer)(targetThis, ___sender0, ___e1, targetMethod); } } else { // open if (il2cpp_codegen_method_is_virtual(targetMethod) && !il2cpp_codegen_object_is_of_sealed_type(targetThis) && il2cpp_codegen_delegate_has_invoker((Il2CppDelegate*)__this)) { if (il2cpp_codegen_method_is_generic_instance(targetMethod)) { if (il2cpp_codegen_method_is_interface_method(targetMethod)) GenericInterfaceActionInvoker1< UnhandledExceptionEventArgs_t2886101344 * >::Invoke(targetMethod, ___sender0, ___e1); else GenericVirtActionInvoker1< UnhandledExceptionEventArgs_t2886101344 * >::Invoke(targetMethod, ___sender0, ___e1); } else { if (il2cpp_codegen_method_is_interface_method(targetMethod)) InterfaceActionInvoker1< UnhandledExceptionEventArgs_t2886101344 * >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), il2cpp_codegen_method_get_declaring_type(targetMethod), ___sender0, ___e1); else VirtActionInvoker1< UnhandledExceptionEventArgs_t2886101344 * >::Invoke(il2cpp_codegen_method_get_slot(targetMethod), ___sender0, ___e1); } } else { typedef void (*FunctionPointerType) (RuntimeObject *, UnhandledExceptionEventArgs_t2886101344 *, const RuntimeMethod*); ((FunctionPointerType)targetMethodPointer)(___sender0, ___e1, targetMethod); } } } } } // System.IAsyncResult System.UnhandledExceptionEventHandler::BeginInvoke(System.Object,System.UnhandledExceptionEventArgs,System.AsyncCallback,System.Object) extern "C" RuntimeObject* UnhandledExceptionEventHandler_BeginInvoke_m1761611550 (UnhandledExceptionEventHandler_t3101989324 * __this, RuntimeObject * ___sender0, UnhandledExceptionEventArgs_t2886101344 * ___e1, AsyncCallback_t3962456242 * ___callback2, RuntimeObject * ___object3, const RuntimeMethod* method) { void *__d_args[3] = {0}; __d_args[0] = ___sender0; __d_args[1] = ___e1; return (RuntimeObject*)il2cpp_codegen_delegate_begin_invoke((RuntimeDelegate*)__this, __d_args, (RuntimeDelegate*)___callback2, (RuntimeObject*)___object3); } // System.Void System.UnhandledExceptionEventHandler::EndInvoke(System.IAsyncResult) extern "C" void UnhandledExceptionEventHandler_EndInvoke_m2316153791 (UnhandledExceptionEventHandler_t3101989324 * __this, RuntimeObject* ___result0, const RuntimeMethod* method) { il2cpp_codegen_delegate_end_invoke((Il2CppAsyncResult*) ___result0, 0); } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Void System.UnitySerializationHolder::GetUnitySerializationInfo(System.Runtime.Serialization.SerializationInfo,System.Reflection.Missing) extern "C" void UnitySerializationHolder_GetUnitySerializationInfo_m927411785 (RuntimeObject * __this /* static, unused */, SerializationInfo_t950877179 * ___info0, Missing_t508514592 * ___missing1, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UnitySerializationHolder_GetUnitySerializationInfo_m927411785_MetadataUsageId); s_Il2CppMethodInitialized = true; } { SerializationInfo_t950877179 * L_0 = ___info0; RuntimeTypeHandle_t3027515415 L_1 = { reinterpret_cast<intptr_t> (UnitySerializationHolder_t431912834_0_0_0_var) }; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_2 = Type_GetTypeFromHandle_m1620074514(NULL /*static, unused*/, L_1, /*hidden argument*/NULL); NullCheck(L_0); SerializationInfo_SetType_m3923964808(L_0, L_2, /*hidden argument*/NULL); SerializationInfo_t950877179 * L_3 = ___info0; NullCheck(L_3); SerializationInfo_AddValue_m412754688(L_3, _stringLiteral3283586028, 3, /*hidden argument*/NULL); return; } } // System.RuntimeType System.UnitySerializationHolder::AddElementTypes(System.Runtime.Serialization.SerializationInfo,System.RuntimeType) extern "C" RuntimeType_t3636489352 * UnitySerializationHolder_AddElementTypes_m2711578409 (RuntimeObject * __this /* static, unused */, SerializationInfo_t950877179 * ___info0, RuntimeType_t3636489352 * ___type1, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UnitySerializationHolder_AddElementTypes_m2711578409_MetadataUsageId); s_Il2CppMethodInitialized = true; } List_1_t128053199 * V_0 = NULL; { List_1_t128053199 * L_0 = (List_1_t128053199 *)il2cpp_codegen_object_new(List_1_t128053199_il2cpp_TypeInfo_var); List_1__ctor_m1204004817(L_0, /*hidden argument*/List_1__ctor_m1204004817_RuntimeMethod_var); V_0 = L_0; goto IL_0063; } IL_0008: { RuntimeType_t3636489352 * L_1 = ___type1; NullCheck(L_1); bool L_2 = VirtFuncInvoker0< bool >::Invoke(77 /* System.Boolean System.Type::get_IsSzArray() */, L_1); if (!L_2) { goto IL_0019; } } { List_1_t128053199 * L_3 = V_0; NullCheck(L_3); List_1_Add_m2080863212(L_3, 3, /*hidden argument*/List_1_Add_m2080863212_RuntimeMethod_var); goto IL_0056; } IL_0019: { RuntimeType_t3636489352 * L_4 = ___type1; NullCheck(L_4); bool L_5 = Type_get_IsArray_m2591212821(L_4, /*hidden argument*/NULL); if (!L_5) { goto IL_0036; } } { List_1_t128053199 * L_6 = V_0; RuntimeType_t3636489352 * L_7 = ___type1; NullCheck(L_7); int32_t L_8 = VirtFuncInvoker0< int32_t >::Invoke(29 /* System.Int32 System.Type::GetArrayRank() */, L_7); NullCheck(L_6); List_1_Add_m2080863212(L_6, L_8, /*hidden argument*/List_1_Add_m2080863212_RuntimeMethod_var); List_1_t128053199 * L_9 = V_0; NullCheck(L_9); List_1_Add_m2080863212(L_9, 2, /*hidden argument*/List_1_Add_m2080863212_RuntimeMethod_var); goto IL_0056; } IL_0036: { RuntimeType_t3636489352 * L_10 = ___type1; NullCheck(L_10); bool L_11 = Type_get_IsPointer_m4067542339(L_10, /*hidden argument*/NULL); if (!L_11) { goto IL_0047; } } { List_1_t128053199 * L_12 = V_0; NullCheck(L_12); List_1_Add_m2080863212(L_12, 1, /*hidden argument*/List_1_Add_m2080863212_RuntimeMethod_var); goto IL_0056; } IL_0047: { RuntimeType_t3636489352 * L_13 = ___type1; NullCheck(L_13); bool L_14 = Type_get_IsByRef_m1262524108(L_13, /*hidden argument*/NULL); if (!L_14) { goto IL_0056; } } { List_1_t128053199 * L_15 = V_0; NullCheck(L_15); List_1_Add_m2080863212(L_15, 4, /*hidden argument*/List_1_Add_m2080863212_RuntimeMethod_var); } IL_0056: { RuntimeType_t3636489352 * L_16 = ___type1; NullCheck(L_16); Type_t * L_17 = VirtFuncInvoker0< Type_t * >::Invoke(101 /* System.Type System.Type::GetElementType() */, L_16); ___type1 = ((RuntimeType_t3636489352 *)CastclassClass((RuntimeObject*)L_17, RuntimeType_t3636489352_il2cpp_TypeInfo_var)); } IL_0063: { RuntimeType_t3636489352 * L_18 = ___type1; NullCheck(L_18); bool L_19 = Type_get_HasElementType_m710151977(L_18, /*hidden argument*/NULL); if (L_19) { goto IL_0008; } } { SerializationInfo_t950877179 * L_20 = ___info0; List_1_t128053199 * L_21 = V_0; NullCheck(L_21); Int32U5BU5D_t385246372* L_22 = List_1_ToArray_m1469074435(L_21, /*hidden argument*/List_1_ToArray_m1469074435_RuntimeMethod_var); RuntimeTypeHandle_t3027515415 L_23 = { reinterpret_cast<intptr_t> (Int32U5BU5D_t385246372_0_0_0_var) }; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_24 = Type_GetTypeFromHandle_m1620074514(NULL /*static, unused*/, L_23, /*hidden argument*/NULL); NullCheck(L_20); SerializationInfo_AddValue_m3906743584(L_20, _stringLiteral3927933503, (RuntimeObject *)(RuntimeObject *)L_22, L_24, /*hidden argument*/NULL); RuntimeType_t3636489352 * L_25 = ___type1; return L_25; } } // System.Type System.UnitySerializationHolder::MakeElementTypes(System.Type) extern "C" Type_t * UnitySerializationHolder_MakeElementTypes_m672301684 (UnitySerializationHolder_t431912834 * __this, Type_t * ___type0, const RuntimeMethod* method) { int32_t V_0 = 0; { Int32U5BU5D_t385246372* L_0 = __this->get_m_elementTypes_1(); NullCheck(L_0); V_0 = ((int32_t)il2cpp_codegen_subtract((int32_t)(((int32_t)((int32_t)(((RuntimeArray *)L_0)->max_length)))), (int32_t)1)); goto IL_006f; } IL_000d: { Int32U5BU5D_t385246372* L_1 = __this->get_m_elementTypes_1(); int32_t L_2 = V_0; NullCheck(L_1); int32_t L_3 = L_2; int32_t L_4 = (L_1)->GetAt(static_cast<il2cpp_array_size_t>(L_3)); if ((!(((uint32_t)L_4) == ((uint32_t)3)))) { goto IL_0022; } } { Type_t * L_5 = ___type0; NullCheck(L_5); Type_t * L_6 = VirtFuncInvoker0< Type_t * >::Invoke(19 /* System.Type System.Type::MakeArrayType() */, L_5); ___type0 = L_6; goto IL_006b; } IL_0022: { Int32U5BU5D_t385246372* L_7 = __this->get_m_elementTypes_1(); int32_t L_8 = V_0; NullCheck(L_7); int32_t L_9 = L_8; int32_t L_10 = (L_7)->GetAt(static_cast<il2cpp_array_size_t>(L_9)); if ((!(((uint32_t)L_10) == ((uint32_t)2)))) { goto IL_0043; } } { Type_t * L_11 = ___type0; Int32U5BU5D_t385246372* L_12 = __this->get_m_elementTypes_1(); int32_t L_13 = V_0; int32_t L_14 = ((int32_t)il2cpp_codegen_subtract((int32_t)L_13, (int32_t)1)); V_0 = L_14; NullCheck(L_12); int32_t L_15 = L_14; int32_t L_16 = (L_12)->GetAt(static_cast<il2cpp_array_size_t>(L_15)); NullCheck(L_11); Type_t * L_17 = VirtFuncInvoker1< Type_t *, int32_t >::Invoke(20 /* System.Type System.Type::MakeArrayType(System.Int32) */, L_11, L_16); ___type0 = L_17; goto IL_006b; } IL_0043: { Int32U5BU5D_t385246372* L_18 = __this->get_m_elementTypes_1(); int32_t L_19 = V_0; NullCheck(L_18); int32_t L_20 = L_19; int32_t L_21 = (L_18)->GetAt(static_cast<il2cpp_array_size_t>(L_20)); if ((!(((uint32_t)L_21) == ((uint32_t)1)))) { goto IL_0058; } } { Type_t * L_22 = ___type0; NullCheck(L_22); Type_t * L_23 = VirtFuncInvoker0< Type_t * >::Invoke(17 /* System.Type System.Type::MakePointerType() */, L_22); ___type0 = L_23; goto IL_006b; } IL_0058: { Int32U5BU5D_t385246372* L_24 = __this->get_m_elementTypes_1(); int32_t L_25 = V_0; NullCheck(L_24); int32_t L_26 = L_25; int32_t L_27 = (L_24)->GetAt(static_cast<il2cpp_array_size_t>(L_26)); if ((!(((uint32_t)L_27) == ((uint32_t)4)))) { goto IL_006b; } } { Type_t * L_28 = ___type0; NullCheck(L_28); Type_t * L_29 = VirtFuncInvoker0< Type_t * >::Invoke(18 /* System.Type System.Type::MakeByRefType() */, L_28); ___type0 = L_29; } IL_006b: { int32_t L_30 = V_0; V_0 = ((int32_t)il2cpp_codegen_subtract((int32_t)L_30, (int32_t)1)); } IL_006f: { int32_t L_31 = V_0; if ((((int32_t)L_31) >= ((int32_t)0))) { goto IL_000d; } } { Type_t * L_32 = ___type0; return L_32; } } // System.Void System.UnitySerializationHolder::GetUnitySerializationInfo(System.Runtime.Serialization.SerializationInfo,System.RuntimeType) extern "C" void UnitySerializationHolder_GetUnitySerializationInfo_m3060468266 (RuntimeObject * __this /* static, unused */, SerializationInfo_t950877179 * ___info0, RuntimeType_t3636489352 * ___type1, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UnitySerializationHolder_GetUnitySerializationInfo_m3060468266_MetadataUsageId); s_Il2CppMethodInitialized = true; } int32_t V_0 = 0; { RuntimeType_t3636489352 * L_0 = ___type1; NullCheck(L_0); Type_t * L_1 = Type_GetRootElementType_m2028550026(L_0, /*hidden argument*/NULL); NullCheck(L_1); bool L_2 = VirtFuncInvoker0< bool >::Invoke(80 /* System.Boolean System.Type::get_IsGenericParameter() */, L_1); if (!L_2) { goto IL_007a; } } { SerializationInfo_t950877179 * L_3 = ___info0; RuntimeType_t3636489352 * L_4 = ___type1; RuntimeType_t3636489352 * L_5 = UnitySerializationHolder_AddElementTypes_m2711578409(NULL /*static, unused*/, L_3, L_4, /*hidden argument*/NULL); ___type1 = L_5; SerializationInfo_t950877179 * L_6 = ___info0; RuntimeTypeHandle_t3027515415 L_7 = { reinterpret_cast<intptr_t> (UnitySerializationHolder_t431912834_0_0_0_var) }; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_8 = Type_GetTypeFromHandle_m1620074514(NULL /*static, unused*/, L_7, /*hidden argument*/NULL); NullCheck(L_6); SerializationInfo_SetType_m3923964808(L_6, L_8, /*hidden argument*/NULL); SerializationInfo_t950877179 * L_9 = ___info0; NullCheck(L_9); SerializationInfo_AddValue_m412754688(L_9, _stringLiteral3283586028, 7, /*hidden argument*/NULL); SerializationInfo_t950877179 * L_10 = ___info0; RuntimeType_t3636489352 * L_11 = ___type1; NullCheck(L_11); int32_t L_12 = VirtFuncInvoker0< int32_t >::Invoke(81 /* System.Int32 System.Type::get_GenericParameterPosition() */, L_11); NullCheck(L_10); SerializationInfo_AddValue_m412754688(L_10, _stringLiteral3378664767, L_12, /*hidden argument*/NULL); SerializationInfo_t950877179 * L_13 = ___info0; RuntimeType_t3636489352 * L_14 = ___type1; NullCheck(L_14); MethodBase_t * L_15 = VirtFuncInvoker0< MethodBase_t * >::Invoke(16 /* System.Reflection.MethodBase System.Type::get_DeclaringMethod() */, L_14); RuntimeTypeHandle_t3027515415 L_16 = { reinterpret_cast<intptr_t> (MethodBase_t_0_0_0_var) }; Type_t * L_17 = Type_GetTypeFromHandle_m1620074514(NULL /*static, unused*/, L_16, /*hidden argument*/NULL); NullCheck(L_13); SerializationInfo_AddValue_m3906743584(L_13, _stringLiteral98117656, L_15, L_17, /*hidden argument*/NULL); SerializationInfo_t950877179 * L_18 = ___info0; RuntimeType_t3636489352 * L_19 = ___type1; NullCheck(L_19); Type_t * L_20 = VirtFuncInvoker0< Type_t * >::Invoke(8 /* System.Type System.Reflection.MemberInfo::get_DeclaringType() */, L_19); RuntimeTypeHandle_t3027515415 L_21 = { reinterpret_cast<intptr_t> (Type_t_0_0_0_var) }; Type_t * L_22 = Type_GetTypeFromHandle_m1620074514(NULL /*static, unused*/, L_21, /*hidden argument*/NULL); NullCheck(L_18); SerializationInfo_AddValue_m3906743584(L_18, _stringLiteral2725392681, L_20, L_22, /*hidden argument*/NULL); return; } IL_007a: { V_0 = 4; RuntimeType_t3636489352 * L_23 = ___type1; NullCheck(L_23); bool L_24 = VirtFuncInvoker0< bool >::Invoke(79 /* System.Boolean System.Type::get_IsGenericTypeDefinition() */, L_23); if (L_24) { goto IL_00bf; } } { RuntimeType_t3636489352 * L_25 = ___type1; NullCheck(L_25); bool L_26 = VirtFuncInvoker0< bool >::Invoke(82 /* System.Boolean System.Type::get_ContainsGenericParameters() */, L_25); if (!L_26) { goto IL_00bf; } } { V_0 = 8; SerializationInfo_t950877179 * L_27 = ___info0; RuntimeType_t3636489352 * L_28 = ___type1; RuntimeType_t3636489352 * L_29 = UnitySerializationHolder_AddElementTypes_m2711578409(NULL /*static, unused*/, L_27, L_28, /*hidden argument*/NULL); ___type1 = L_29; SerializationInfo_t950877179 * L_30 = ___info0; RuntimeType_t3636489352 * L_31 = ___type1; NullCheck(L_31); TypeU5BU5D_t3940880105* L_32 = VirtFuncInvoker0< TypeU5BU5D_t3940880105* >::Invoke(102 /* System.Type[] System.Type::GetGenericArguments() */, L_31); RuntimeTypeHandle_t3027515415 L_33 = { reinterpret_cast<intptr_t> (TypeU5BU5D_t3940880105_0_0_0_var) }; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_34 = Type_GetTypeFromHandle_m1620074514(NULL /*static, unused*/, L_33, /*hidden argument*/NULL); NullCheck(L_30); SerializationInfo_AddValue_m3906743584(L_30, _stringLiteral1245918466, (RuntimeObject *)(RuntimeObject *)L_32, L_34, /*hidden argument*/NULL); RuntimeType_t3636489352 * L_35 = ___type1; NullCheck(L_35); Type_t * L_36 = VirtFuncInvoker0< Type_t * >::Invoke(103 /* System.Type System.Type::GetGenericTypeDefinition() */, L_35); ___type1 = ((RuntimeType_t3636489352 *)CastclassClass((RuntimeObject*)L_36, RuntimeType_t3636489352_il2cpp_TypeInfo_var)); } IL_00bf: { SerializationInfo_t950877179 * L_37 = ___info0; int32_t L_38 = V_0; RuntimeType_t3636489352 * L_39 = ___type1; NullCheck(L_39); String_t* L_40 = VirtFuncInvoker0< String_t* >::Invoke(26 /* System.String System.Type::get_FullName() */, L_39); RuntimeType_t3636489352 * L_41 = ___type1; NullCheck(L_41); RuntimeAssembly_t1451753063 * L_42 = RuntimeType_GetRuntimeAssembly_m2955606119(L_41, /*hidden argument*/NULL); UnitySerializationHolder_GetUnitySerializationInfo_m3966690610(NULL /*static, unused*/, L_37, L_38, L_40, L_42, /*hidden argument*/NULL); return; } } // System.Void System.UnitySerializationHolder::GetUnitySerializationInfo(System.Runtime.Serialization.SerializationInfo,System.Int32,System.String,System.Reflection.RuntimeAssembly) extern "C" void UnitySerializationHolder_GetUnitySerializationInfo_m3966690610 (RuntimeObject * __this /* static, unused */, SerializationInfo_t950877179 * ___info0, int32_t ___unityType1, String_t* ___data2, RuntimeAssembly_t1451753063 * ___assembly3, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UnitySerializationHolder_GetUnitySerializationInfo_m3966690610_MetadataUsageId); s_Il2CppMethodInitialized = true; } String_t* V_0 = NULL; { SerializationInfo_t950877179 * L_0 = ___info0; RuntimeTypeHandle_t3027515415 L_1 = { reinterpret_cast<intptr_t> (UnitySerializationHolder_t431912834_0_0_0_var) }; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_2 = Type_GetTypeFromHandle_m1620074514(NULL /*static, unused*/, L_1, /*hidden argument*/NULL); NullCheck(L_0); SerializationInfo_SetType_m3923964808(L_0, L_2, /*hidden argument*/NULL); SerializationInfo_t950877179 * L_3 = ___info0; String_t* L_4 = ___data2; RuntimeTypeHandle_t3027515415 L_5 = { reinterpret_cast<intptr_t> (String_t_0_0_0_var) }; Type_t * L_6 = Type_GetTypeFromHandle_m1620074514(NULL /*static, unused*/, L_5, /*hidden argument*/NULL); NullCheck(L_3); SerializationInfo_AddValue_m3906743584(L_3, _stringLiteral2037252898, L_4, L_6, /*hidden argument*/NULL); SerializationInfo_t950877179 * L_7 = ___info0; int32_t L_8 = ___unityType1; NullCheck(L_7); SerializationInfo_AddValue_m412754688(L_7, _stringLiteral3283586028, L_8, /*hidden argument*/NULL); RuntimeAssembly_t1451753063 * L_9 = ___assembly3; bool L_10 = Assembly_op_Equality_m3828289814(NULL /*static, unused*/, L_9, (Assembly_t *)NULL, /*hidden argument*/NULL); if (!L_10) { goto IL_0043; } } { String_t* L_11 = ((String_t_StaticFields*)il2cpp_codegen_static_fields_for(String_t_il2cpp_TypeInfo_var))->get_Empty_5(); V_0 = L_11; goto IL_004a; } IL_0043: { RuntimeAssembly_t1451753063 * L_12 = ___assembly3; NullCheck(L_12); String_t* L_13 = VirtFuncInvoker0< String_t* >::Invoke(8 /* System.String System.Reflection.Assembly::get_FullName() */, L_12); V_0 = L_13; } IL_004a: { SerializationInfo_t950877179 * L_14 = ___info0; String_t* L_15 = V_0; NullCheck(L_14); SerializationInfo_AddValue_m2872281893(L_14, _stringLiteral209558951, L_15, /*hidden argument*/NULL); return; } } // System.Void System.UnitySerializationHolder::.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) extern "C" void UnitySerializationHolder__ctor_m3869442095 (UnitySerializationHolder_t431912834 * __this, SerializationInfo_t950877179 * ___info0, StreamingContext_t3711869237 ___context1, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UnitySerializationHolder__ctor_m3869442095_MetadataUsageId); s_Il2CppMethodInitialized = true; } { Object__ctor_m297566312(__this, /*hidden argument*/NULL); SerializationInfo_t950877179 * L_0 = ___info0; if (L_0) { goto IL_0014; } } { ArgumentNullException_t1615371798 * L_1 = (ArgumentNullException_t1615371798 *)il2cpp_codegen_object_new(ArgumentNullException_t1615371798_il2cpp_TypeInfo_var); ArgumentNullException__ctor_m1170824041(L_1, _stringLiteral79347, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_1, NULL, UnitySerializationHolder__ctor_m3869442095_RuntimeMethod_var); } IL_0014: { SerializationInfo_t950877179 * L_2 = ___info0; NullCheck(L_2); int32_t L_3 = SerializationInfo_GetInt32_m2640574809(L_2, _stringLiteral3283586028, /*hidden argument*/NULL); __this->set_m_unityType_7(L_3); int32_t L_4 = __this->get_m_unityType_7(); if ((!(((uint32_t)L_4) == ((uint32_t)3)))) { goto IL_002f; } } { return; } IL_002f: { int32_t L_5 = __this->get_m_unityType_7(); if ((!(((uint32_t)L_5) == ((uint32_t)7)))) { goto IL_00aa; } } { SerializationInfo_t950877179 * L_6 = ___info0; RuntimeTypeHandle_t3027515415 L_7 = { reinterpret_cast<intptr_t> (MethodBase_t_0_0_0_var) }; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_8 = Type_GetTypeFromHandle_m1620074514(NULL /*static, unused*/, L_7, /*hidden argument*/NULL); NullCheck(L_6); RuntimeObject * L_9 = SerializationInfo_GetValue_m42271953(L_6, _stringLiteral98117656, L_8, /*hidden argument*/NULL); __this->set_m_declaringMethod_4(((MethodBase_t *)IsInstClass((RuntimeObject*)L_9, MethodBase_t_il2cpp_TypeInfo_var))); SerializationInfo_t950877179 * L_10 = ___info0; RuntimeTypeHandle_t3027515415 L_11 = { reinterpret_cast<intptr_t> (Type_t_0_0_0_var) }; Type_t * L_12 = Type_GetTypeFromHandle_m1620074514(NULL /*static, unused*/, L_11, /*hidden argument*/NULL); NullCheck(L_10); RuntimeObject * L_13 = SerializationInfo_GetValue_m42271953(L_10, _stringLiteral2725392681, L_12, /*hidden argument*/NULL); __this->set_m_declaringType_3(((Type_t *)IsInstClass((RuntimeObject*)L_13, Type_t_il2cpp_TypeInfo_var))); SerializationInfo_t950877179 * L_14 = ___info0; NullCheck(L_14); int32_t L_15 = SerializationInfo_GetInt32_m2640574809(L_14, _stringLiteral3378664767, /*hidden argument*/NULL); __this->set_m_genericParameterPosition_2(L_15); SerializationInfo_t950877179 * L_16 = ___info0; RuntimeTypeHandle_t3027515415 L_17 = { reinterpret_cast<intptr_t> (Int32U5BU5D_t385246372_0_0_0_var) }; Type_t * L_18 = Type_GetTypeFromHandle_m1620074514(NULL /*static, unused*/, L_17, /*hidden argument*/NULL); NullCheck(L_16); RuntimeObject * L_19 = SerializationInfo_GetValue_m42271953(L_16, _stringLiteral3927933503, L_18, /*hidden argument*/NULL); __this->set_m_elementTypes_1(((Int32U5BU5D_t385246372*)IsInst((RuntimeObject*)L_19, Int32U5BU5D_t385246372_il2cpp_TypeInfo_var))); return; } IL_00aa: { int32_t L_20 = __this->get_m_unityType_7(); if ((!(((uint32_t)L_20) == ((uint32_t)8)))) { goto IL_00f3; } } { SerializationInfo_t950877179 * L_21 = ___info0; RuntimeTypeHandle_t3027515415 L_22 = { reinterpret_cast<intptr_t> (TypeU5BU5D_t3940880105_0_0_0_var) }; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_23 = Type_GetTypeFromHandle_m1620074514(NULL /*static, unused*/, L_22, /*hidden argument*/NULL); NullCheck(L_21); RuntimeObject * L_24 = SerializationInfo_GetValue_m42271953(L_21, _stringLiteral1245918466, L_23, /*hidden argument*/NULL); __this->set_m_instantiation_0(((TypeU5BU5D_t3940880105*)IsInst((RuntimeObject*)L_24, TypeU5BU5D_t3940880105_il2cpp_TypeInfo_var))); SerializationInfo_t950877179 * L_25 = ___info0; RuntimeTypeHandle_t3027515415 L_26 = { reinterpret_cast<intptr_t> (Int32U5BU5D_t385246372_0_0_0_var) }; Type_t * L_27 = Type_GetTypeFromHandle_m1620074514(NULL /*static, unused*/, L_26, /*hidden argument*/NULL); NullCheck(L_25); RuntimeObject * L_28 = SerializationInfo_GetValue_m42271953(L_25, _stringLiteral3927933503, L_27, /*hidden argument*/NULL); __this->set_m_elementTypes_1(((Int32U5BU5D_t385246372*)IsInst((RuntimeObject*)L_28, Int32U5BU5D_t385246372_il2cpp_TypeInfo_var))); } IL_00f3: { SerializationInfo_t950877179 * L_29 = ___info0; NullCheck(L_29); String_t* L_30 = SerializationInfo_GetString_m3155282843(L_29, _stringLiteral2037252898, /*hidden argument*/NULL); __this->set_m_data_5(L_30); SerializationInfo_t950877179 * L_31 = ___info0; NullCheck(L_31); String_t* L_32 = SerializationInfo_GetString_m3155282843(L_31, _stringLiteral209558951, /*hidden argument*/NULL); __this->set_m_assemblyName_6(L_32); return; } } // System.Void System.UnitySerializationHolder::ThrowInsufficientInformation(System.String) extern "C" void UnitySerializationHolder_ThrowInsufficientInformation_m1747464776 (UnitySerializationHolder_t431912834 * __this, String_t* ___field0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UnitySerializationHolder_ThrowInsufficientInformation_m1747464776_MetadataUsageId); s_Il2CppMethodInitialized = true; } { ObjectU5BU5D_t2843939325* L_0 = (ObjectU5BU5D_t2843939325*)SZArrayNew(ObjectU5BU5D_t2843939325_il2cpp_TypeInfo_var, (uint32_t)1); ObjectU5BU5D_t2843939325* L_1 = L_0; String_t* L_2 = ___field0; NullCheck(L_1); ArrayElementTypeCheck (L_1, L_2); (L_1)->SetAt(static_cast<il2cpp_array_size_t>(0), (RuntimeObject *)L_2); String_t* L_3 = Environment_GetResourceString_m479507158(NULL /*static, unused*/, _stringLiteral3245515088, L_1, /*hidden argument*/NULL); SerializationException_t3941511869 * L_4 = (SerializationException_t3941511869 *)il2cpp_codegen_object_new(SerializationException_t3941511869_il2cpp_TypeInfo_var); SerializationException__ctor_m3862484944(L_4, L_3, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_4, NULL, UnitySerializationHolder_ThrowInsufficientInformation_m1747464776_RuntimeMethod_var); } } // System.Void System.UnitySerializationHolder::GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) extern "C" void UnitySerializationHolder_GetObjectData_m3377455907 (UnitySerializationHolder_t431912834 * __this, SerializationInfo_t950877179 * ___info0, StreamingContext_t3711869237 ___context1, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UnitySerializationHolder_GetObjectData_m3377455907_MetadataUsageId); s_Il2CppMethodInitialized = true; } { String_t* L_0 = Environment_GetResourceString_m2063689938(NULL /*static, unused*/, _stringLiteral532335187, /*hidden argument*/NULL); NotSupportedException_t1314879016 * L_1 = (NotSupportedException_t1314879016 *)il2cpp_codegen_object_new(NotSupportedException_t1314879016_il2cpp_TypeInfo_var); NotSupportedException__ctor_m2494070935(L_1, L_0, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_1, NULL, UnitySerializationHolder_GetObjectData_m3377455907_RuntimeMethod_var); } } // System.Object System.UnitySerializationHolder::GetRealObject(System.Runtime.Serialization.StreamingContext) extern "C" RuntimeObject * UnitySerializationHolder_GetRealObject_m1624354633 (UnitySerializationHolder_t431912834 * __this, StreamingContext_t3711869237 ___context0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UnitySerializationHolder_GetRealObject_m1624354633_MetadataUsageId); s_Il2CppMethodInitialized = true; } int32_t V_0 = 0; Type_t * V_1 = NULL; Module_t2987026101 * V_2 = NULL; { int32_t L_0 = __this->get_m_unityType_7(); V_0 = L_0; int32_t L_1 = V_0; switch (((int32_t)il2cpp_codegen_subtract((int32_t)L_1, (int32_t)1))) { case 0: { goto IL_0034; } case 1: { goto IL_003a; } case 2: { goto IL_0040; } case 3: { goto IL_00e7; } case 4: { goto IL_014e; } case 5: { goto IL_01cb; } case 6: { goto IL_0086; } case 7: { goto IL_0046; } } } { goto IL_020a; } IL_0034: { IL2CPP_RUNTIME_CLASS_INIT(Empty_t4129602447_il2cpp_TypeInfo_var); Empty_t4129602447 * L_2 = ((Empty_t4129602447_StaticFields*)il2cpp_codegen_static_fields_for(Empty_t4129602447_il2cpp_TypeInfo_var))->get_Value_0(); return L_2; } IL_003a: { IL2CPP_RUNTIME_CLASS_INIT(DBNull_t3725197148_il2cpp_TypeInfo_var); DBNull_t3725197148 * L_3 = ((DBNull_t3725197148_StaticFields*)il2cpp_codegen_static_fields_for(DBNull_t3725197148_il2cpp_TypeInfo_var))->get_Value_0(); return L_3; } IL_0040: { IL2CPP_RUNTIME_CLASS_INIT(Missing_t508514592_il2cpp_TypeInfo_var); Missing_t508514592 * L_4 = ((Missing_t508514592_StaticFields*)il2cpp_codegen_static_fields_for(Missing_t508514592_il2cpp_TypeInfo_var))->get_Value_0(); return L_4; } IL_0046: { __this->set_m_unityType_7(4); StreamingContext_t3711869237 L_5 = ___context0; RuntimeObject * L_6 = VirtFuncInvoker1< RuntimeObject *, StreamingContext_t3711869237 >::Invoke(7 /* System.Object System.UnitySerializationHolder::GetRealObject(System.Runtime.Serialization.StreamingContext) */, __this, L_5); V_1 = ((Type_t *)IsInstClass((RuntimeObject*)L_6, Type_t_il2cpp_TypeInfo_var)); __this->set_m_unityType_7(8); TypeU5BU5D_t3940880105* L_7 = __this->get_m_instantiation_0(); NullCheck(L_7); int32_t L_8 = 0; Type_t * L_9 = (L_7)->GetAt(static_cast<il2cpp_array_size_t>(L_8)); IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); bool L_10 = Type_op_Equality_m2683486427(NULL /*static, unused*/, L_9, (Type_t *)NULL, /*hidden argument*/NULL); if (!L_10) { goto IL_0073; } } { return NULL; } IL_0073: { Type_t * L_11 = V_1; TypeU5BU5D_t3940880105* L_12 = __this->get_m_instantiation_0(); NullCheck(L_11); Type_t * L_13 = VirtFuncInvoker1< Type_t *, TypeU5BU5D_t3940880105* >::Invoke(98 /* System.Type System.Type::MakeGenericType(System.Type[]) */, L_11, L_12); Type_t * L_14 = UnitySerializationHolder_MakeElementTypes_m672301684(__this, L_13, /*hidden argument*/NULL); return L_14; } IL_0086: { MethodBase_t * L_15 = __this->get_m_declaringMethod_4(); bool L_16 = MethodBase_op_Equality_m2405991987(NULL /*static, unused*/, L_15, (MethodBase_t *)NULL, /*hidden argument*/NULL); if (!L_16) { goto IL_00ad; } } { Type_t * L_17 = __this->get_m_declaringType_3(); IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); bool L_18 = Type_op_Equality_m2683486427(NULL /*static, unused*/, L_17, (Type_t *)NULL, /*hidden argument*/NULL); if (!L_18) { goto IL_00ad; } } { UnitySerializationHolder_ThrowInsufficientInformation_m1747464776(__this, _stringLiteral1313207612, /*hidden argument*/NULL); } IL_00ad: { MethodBase_t * L_19 = __this->get_m_declaringMethod_4(); bool L_20 = MethodBase_op_Inequality_m736913402(NULL /*static, unused*/, L_19, (MethodBase_t *)NULL, /*hidden argument*/NULL); if (!L_20) { goto IL_00ce; } } { MethodBase_t * L_21 = __this->get_m_declaringMethod_4(); NullCheck(L_21); TypeU5BU5D_t3940880105* L_22 = VirtFuncInvoker0< TypeU5BU5D_t3940880105* >::Invoke(23 /* System.Type[] System.Reflection.MethodBase::GetGenericArguments() */, L_21); int32_t L_23 = __this->get_m_genericParameterPosition_2(); NullCheck(L_22); int32_t L_24 = L_23; Type_t * L_25 = (L_22)->GetAt(static_cast<il2cpp_array_size_t>(L_24)); return L_25; } IL_00ce: { Type_t * L_26 = __this->get_m_declaringType_3(); NullCheck(L_26); TypeU5BU5D_t3940880105* L_27 = VirtFuncInvoker0< TypeU5BU5D_t3940880105* >::Invoke(102 /* System.Type[] System.Type::GetGenericArguments() */, L_26); int32_t L_28 = __this->get_m_genericParameterPosition_2(); NullCheck(L_27); int32_t L_29 = L_28; Type_t * L_30 = (L_27)->GetAt(static_cast<il2cpp_array_size_t>(L_29)); Type_t * L_31 = UnitySerializationHolder_MakeElementTypes_m672301684(__this, L_30, /*hidden argument*/NULL); return L_31; } IL_00e7: { String_t* L_32 = __this->get_m_data_5(); if (!L_32) { goto IL_00fc; } } { String_t* L_33 = __this->get_m_data_5(); NullCheck(L_33); int32_t L_34 = String_get_Length_m3847582255(L_33, /*hidden argument*/NULL); if (L_34) { goto IL_0107; } } IL_00fc: { UnitySerializationHolder_ThrowInsufficientInformation_m1747464776(__this, _stringLiteral2037252898, /*hidden argument*/NULL); } IL_0107: { String_t* L_35 = __this->get_m_assemblyName_6(); if (L_35) { goto IL_011a; } } { UnitySerializationHolder_ThrowInsufficientInformation_m1747464776(__this, _stringLiteral209558951, /*hidden argument*/NULL); } IL_011a: { String_t* L_36 = __this->get_m_assemblyName_6(); NullCheck(L_36); int32_t L_37 = String_get_Length_m3847582255(L_36, /*hidden argument*/NULL); if (L_37) { goto IL_0135; } } { String_t* L_38 = __this->get_m_data_5(); IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_39 = il2cpp_codegen_get_type((Il2CppMethodPointer)&Type_GetType_m3971160356, L_38, (bool)1, (bool)0, "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"); return L_39; } IL_0135: { String_t* L_40 = __this->get_m_assemblyName_6(); Assembly_t * L_41 = Assembly_Load_m3487507613(NULL /*static, unused*/, L_40, /*hidden argument*/NULL); String_t* L_42 = __this->get_m_data_5(); NullCheck(L_41); Type_t * L_43 = VirtFuncInvoker3< Type_t *, String_t*, bool, bool >::Invoke(23 /* System.Type System.Reflection.Assembly::GetType(System.String,System.Boolean,System.Boolean) */, L_41, L_42, (bool)1, (bool)0); return L_43; } IL_014e: { String_t* L_44 = __this->get_m_data_5(); if (!L_44) { goto IL_0163; } } { String_t* L_45 = __this->get_m_data_5(); NullCheck(L_45); int32_t L_46 = String_get_Length_m3847582255(L_45, /*hidden argument*/NULL); if (L_46) { goto IL_016e; } } IL_0163: { UnitySerializationHolder_ThrowInsufficientInformation_m1747464776(__this, _stringLiteral2037252898, /*hidden argument*/NULL); } IL_016e: { String_t* L_47 = __this->get_m_assemblyName_6(); if (L_47) { goto IL_0181; } } { UnitySerializationHolder_ThrowInsufficientInformation_m1747464776(__this, _stringLiteral209558951, /*hidden argument*/NULL); } IL_0181: { String_t* L_48 = __this->get_m_assemblyName_6(); Assembly_t * L_49 = Assembly_Load_m3487507613(NULL /*static, unused*/, L_48, /*hidden argument*/NULL); String_t* L_50 = __this->get_m_data_5(); NullCheck(L_49); Module_t2987026101 * L_51 = VirtFuncInvoker1< Module_t2987026101 *, String_t* >::Invoke(24 /* System.Reflection.Module System.Reflection.Assembly::GetModule(System.String) */, L_49, L_50); V_2 = L_51; Module_t2987026101 * L_52 = V_2; IL2CPP_RUNTIME_CLASS_INIT(Module_t2987026101_il2cpp_TypeInfo_var); bool L_53 = Module_op_Equality_m1102431980(NULL /*static, unused*/, L_52, (Module_t2987026101 *)NULL, /*hidden argument*/NULL); if (!L_53) { goto IL_01c9; } } { ObjectU5BU5D_t2843939325* L_54 = (ObjectU5BU5D_t2843939325*)SZArrayNew(ObjectU5BU5D_t2843939325_il2cpp_TypeInfo_var, (uint32_t)2); ObjectU5BU5D_t2843939325* L_55 = L_54; String_t* L_56 = __this->get_m_data_5(); NullCheck(L_55); ArrayElementTypeCheck (L_55, L_56); (L_55)->SetAt(static_cast<il2cpp_array_size_t>(0), (RuntimeObject *)L_56); ObjectU5BU5D_t2843939325* L_57 = L_55; String_t* L_58 = __this->get_m_assemblyName_6(); NullCheck(L_57); ArrayElementTypeCheck (L_57, L_58); (L_57)->SetAt(static_cast<il2cpp_array_size_t>(1), (RuntimeObject *)L_58); String_t* L_59 = Environment_GetResourceString_m479507158(NULL /*static, unused*/, _stringLiteral1498318814, L_57, /*hidden argument*/NULL); SerializationException_t3941511869 * L_60 = (SerializationException_t3941511869 *)il2cpp_codegen_object_new(SerializationException_t3941511869_il2cpp_TypeInfo_var); SerializationException__ctor_m3862484944(L_60, L_59, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_60, NULL, UnitySerializationHolder_GetRealObject_m1624354633_RuntimeMethod_var); } IL_01c9: { Module_t2987026101 * L_61 = V_2; return L_61; } IL_01cb: { String_t* L_62 = __this->get_m_data_5(); if (!L_62) { goto IL_01e0; } } { String_t* L_63 = __this->get_m_data_5(); NullCheck(L_63); int32_t L_64 = String_get_Length_m3847582255(L_63, /*hidden argument*/NULL); if (L_64) { goto IL_01eb; } } IL_01e0: { UnitySerializationHolder_ThrowInsufficientInformation_m1747464776(__this, _stringLiteral2037252898, /*hidden argument*/NULL); } IL_01eb: { String_t* L_65 = __this->get_m_assemblyName_6(); if (L_65) { goto IL_01fe; } } { UnitySerializationHolder_ThrowInsufficientInformation_m1747464776(__this, _stringLiteral209558951, /*hidden argument*/NULL); } IL_01fe: { String_t* L_66 = __this->get_m_assemblyName_6(); Assembly_t * L_67 = Assembly_Load_m3487507613(NULL /*static, unused*/, L_66, /*hidden argument*/NULL); return L_67; } IL_020a: { String_t* L_68 = Environment_GetResourceString_m2063689938(NULL /*static, unused*/, _stringLiteral3407159193, /*hidden argument*/NULL); ArgumentException_t132251570 * L_69 = (ArgumentException_t132251570 *)il2cpp_codegen_object_new(ArgumentException_t132251570_il2cpp_TypeInfo_var); ArgumentException__ctor_m1312628991(L_69, L_68, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_69, NULL, UnitySerializationHolder_GetRealObject_m1624354633_RuntimeMethod_var); } } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Conversion methods for marshalling of: System.UnSafeCharBuffer extern "C" void UnSafeCharBuffer_t2176740272_marshal_pinvoke(const UnSafeCharBuffer_t2176740272& unmarshaled, UnSafeCharBuffer_t2176740272_marshaled_pinvoke& marshaled) { marshaled.___m_buffer_0 = unmarshaled.get_m_buffer_0(); marshaled.___m_totalSize_1 = unmarshaled.get_m_totalSize_1(); marshaled.___m_length_2 = unmarshaled.get_m_length_2(); } extern "C" void UnSafeCharBuffer_t2176740272_marshal_pinvoke_back(const UnSafeCharBuffer_t2176740272_marshaled_pinvoke& marshaled, UnSafeCharBuffer_t2176740272& unmarshaled) { unmarshaled.set_m_buffer_0(marshaled.___m_buffer_0); int32_t unmarshaled_m_totalSize_temp_1 = 0; unmarshaled_m_totalSize_temp_1 = marshaled.___m_totalSize_1; unmarshaled.set_m_totalSize_1(unmarshaled_m_totalSize_temp_1); int32_t unmarshaled_m_length_temp_2 = 0; unmarshaled_m_length_temp_2 = marshaled.___m_length_2; unmarshaled.set_m_length_2(unmarshaled_m_length_temp_2); } // Conversion method for clean up from marshalling of: System.UnSafeCharBuffer extern "C" void UnSafeCharBuffer_t2176740272_marshal_pinvoke_cleanup(UnSafeCharBuffer_t2176740272_marshaled_pinvoke& marshaled) { } // Conversion methods for marshalling of: System.UnSafeCharBuffer extern "C" void UnSafeCharBuffer_t2176740272_marshal_com(const UnSafeCharBuffer_t2176740272& unmarshaled, UnSafeCharBuffer_t2176740272_marshaled_com& marshaled) { marshaled.___m_buffer_0 = unmarshaled.get_m_buffer_0(); marshaled.___m_totalSize_1 = unmarshaled.get_m_totalSize_1(); marshaled.___m_length_2 = unmarshaled.get_m_length_2(); } extern "C" void UnSafeCharBuffer_t2176740272_marshal_com_back(const UnSafeCharBuffer_t2176740272_marshaled_com& marshaled, UnSafeCharBuffer_t2176740272& unmarshaled) { unmarshaled.set_m_buffer_0(marshaled.___m_buffer_0); int32_t unmarshaled_m_totalSize_temp_1 = 0; unmarshaled_m_totalSize_temp_1 = marshaled.___m_totalSize_1; unmarshaled.set_m_totalSize_1(unmarshaled_m_totalSize_temp_1); int32_t unmarshaled_m_length_temp_2 = 0; unmarshaled_m_length_temp_2 = marshaled.___m_length_2; unmarshaled.set_m_length_2(unmarshaled_m_length_temp_2); } // Conversion method for clean up from marshalling of: System.UnSafeCharBuffer extern "C" void UnSafeCharBuffer_t2176740272_marshal_com_cleanup(UnSafeCharBuffer_t2176740272_marshaled_com& marshaled) { } // System.Void System.UnSafeCharBuffer::.ctor(System.Char*,System.Int32) extern "C" void UnSafeCharBuffer__ctor_m1145239641 (UnSafeCharBuffer_t2176740272 * __this, Il2CppChar* ___buffer0, int32_t ___bufferSize1, const RuntimeMethod* method) { { Il2CppChar* L_0 = ___buffer0; __this->set_m_buffer_0((Il2CppChar*)L_0); int32_t L_1 = ___bufferSize1; __this->set_m_totalSize_1(L_1); __this->set_m_length_2(0); return; } } extern "C" void UnSafeCharBuffer__ctor_m1145239641_AdjustorThunk (RuntimeObject * __this, Il2CppChar* ___buffer0, int32_t ___bufferSize1, const RuntimeMethod* method) { UnSafeCharBuffer_t2176740272 * _thisAdjusted = reinterpret_cast<UnSafeCharBuffer_t2176740272 *>(__this + 1); UnSafeCharBuffer__ctor_m1145239641(_thisAdjusted, ___buffer0, ___bufferSize1, method); } // System.Void System.UnSafeCharBuffer::AppendString(System.String) extern "C" void UnSafeCharBuffer_AppendString_m2223303597 (UnSafeCharBuffer_t2176740272 * __this, String_t* ___stringToAppend0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (UnSafeCharBuffer_AppendString_m2223303597_MetadataUsageId); s_Il2CppMethodInitialized = true; } Il2CppChar* V_0 = NULL; String_t* V_1 = NULL; { String_t* L_0 = ___stringToAppend0; bool L_1 = String_IsNullOrEmpty_m2969720369(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); if (!L_1) { goto IL_0009; } } { return; } IL_0009: { int32_t L_2 = __this->get_m_totalSize_1(); int32_t L_3 = __this->get_m_length_2(); String_t* L_4 = ___stringToAppend0; NullCheck(L_4); int32_t L_5 = String_get_Length_m3847582255(L_4, /*hidden argument*/NULL); if ((((int32_t)((int32_t)il2cpp_codegen_subtract((int32_t)L_2, (int32_t)L_3))) >= ((int32_t)L_5))) { goto IL_0024; } } { IndexOutOfRangeException_t1578797820 * L_6 = (IndexOutOfRangeException_t1578797820 *)il2cpp_codegen_object_new(IndexOutOfRangeException_t1578797820_il2cpp_TypeInfo_var); IndexOutOfRangeException__ctor_m2441337274(L_6, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_6, NULL, UnSafeCharBuffer_AppendString_m2223303597_RuntimeMethod_var); } IL_0024: { String_t* L_7 = ___stringToAppend0; V_1 = L_7; String_t* L_8 = V_1; V_0 = (Il2CppChar*)(((uintptr_t)L_8)); Il2CppChar* L_9 = V_0; if (!L_9) { goto IL_0034; } } { Il2CppChar* L_10 = V_0; int32_t L_11 = RuntimeHelpers_get_OffsetToStringData_m2192601476(NULL /*static, unused*/, /*hidden argument*/NULL); V_0 = (Il2CppChar*)((Il2CppChar*)il2cpp_codegen_add((intptr_t)L_10, (int32_t)L_11)); } IL_0034: { Il2CppChar* L_12 = __this->get_m_buffer_0(); int32_t L_13 = __this->get_m_length_2(); Il2CppChar* L_14 = V_0; String_t* L_15 = ___stringToAppend0; NullCheck(L_15); int32_t L_16 = String_get_Length_m3847582255(L_15, /*hidden argument*/NULL); Buffer_Memcpy_m2035854300(NULL /*static, unused*/, (uint8_t*)(uint8_t*)((Il2CppChar*)il2cpp_codegen_add((intptr_t)L_12, (intptr_t)((intptr_t)il2cpp_codegen_multiply((intptr_t)(((intptr_t)L_13)), (int32_t)2)))), (uint8_t*)(uint8_t*)L_14, ((int32_t)il2cpp_codegen_multiply((int32_t)L_16, (int32_t)2)), /*hidden argument*/NULL); V_1 = (String_t*)NULL; int32_t L_17 = __this->get_m_length_2(); String_t* L_18 = ___stringToAppend0; NullCheck(L_18); int32_t L_19 = String_get_Length_m3847582255(L_18, /*hidden argument*/NULL); __this->set_m_length_2(((int32_t)il2cpp_codegen_add((int32_t)L_17, (int32_t)L_19))); return; } } extern "C" void UnSafeCharBuffer_AppendString_m2223303597_AdjustorThunk (RuntimeObject * __this, String_t* ___stringToAppend0, const RuntimeMethod* method) { UnSafeCharBuffer_t2176740272 * _thisAdjusted = reinterpret_cast<UnSafeCharBuffer_t2176740272 *>(__this + 1); UnSafeCharBuffer_AppendString_m2223303597(_thisAdjusted, ___stringToAppend0, method); } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Boolean System.ValueTuple::Equals(System.Object) extern "C" bool ValueTuple_Equals_m3777586424 (ValueTuple_t3168505507 * __this, RuntimeObject * ___obj0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (ValueTuple_Equals_m3777586424_MetadataUsageId); s_Il2CppMethodInitialized = true; } { RuntimeObject * L_0 = ___obj0; return (bool)((!(((RuntimeObject*)(RuntimeObject *)((RuntimeObject *)IsInstSealed((RuntimeObject*)L_0, ValueTuple_t3168505507_il2cpp_TypeInfo_var))) <= ((RuntimeObject*)(RuntimeObject *)NULL)))? 1 : 0); } } extern "C" bool ValueTuple_Equals_m3777586424_AdjustorThunk (RuntimeObject * __this, RuntimeObject * ___obj0, const RuntimeMethod* method) { ValueTuple_t3168505507 * _thisAdjusted = reinterpret_cast<ValueTuple_t3168505507 *>(__this + 1); return ValueTuple_Equals_m3777586424(_thisAdjusted, ___obj0, method); } // System.Boolean System.ValueTuple::Equals(System.ValueTuple) extern "C" bool ValueTuple_Equals_m3868013840 (ValueTuple_t3168505507 * __this, ValueTuple_t3168505507 ___other0, const RuntimeMethod* method) { { return (bool)1; } } extern "C" bool ValueTuple_Equals_m3868013840_AdjustorThunk (RuntimeObject * __this, ValueTuple_t3168505507 ___other0, const RuntimeMethod* method) { ValueTuple_t3168505507 * _thisAdjusted = reinterpret_cast<ValueTuple_t3168505507 *>(__this + 1); return ValueTuple_Equals_m3868013840(_thisAdjusted, ___other0, method); } // System.Boolean System.ValueTuple::System.Collections.IStructuralEquatable.Equals(System.Object,System.Collections.IEqualityComparer) extern "C" bool ValueTuple_System_Collections_IStructuralEquatable_Equals_m1158377527 (ValueTuple_t3168505507 * __this, RuntimeObject * ___other0, RuntimeObject* ___comparer1, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (ValueTuple_System_Collections_IStructuralEquatable_Equals_m1158377527_MetadataUsageId); s_Il2CppMethodInitialized = true; } { RuntimeObject * L_0 = ___other0; return (bool)((!(((RuntimeObject*)(RuntimeObject *)((RuntimeObject *)IsInstSealed((RuntimeObject*)L_0, ValueTuple_t3168505507_il2cpp_TypeInfo_var))) <= ((RuntimeObject*)(RuntimeObject *)NULL)))? 1 : 0); } } extern "C" bool ValueTuple_System_Collections_IStructuralEquatable_Equals_m1158377527_AdjustorThunk (RuntimeObject * __this, RuntimeObject * ___other0, RuntimeObject* ___comparer1, const RuntimeMethod* method) { ValueTuple_t3168505507 * _thisAdjusted = reinterpret_cast<ValueTuple_t3168505507 *>(__this + 1); return ValueTuple_System_Collections_IStructuralEquatable_Equals_m1158377527(_thisAdjusted, ___other0, ___comparer1, method); } // System.Int32 System.ValueTuple::System.IComparable.CompareTo(System.Object) extern "C" int32_t ValueTuple_System_IComparable_CompareTo_m3152321575 (ValueTuple_t3168505507 * __this, RuntimeObject * ___other0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (ValueTuple_System_IComparable_CompareTo_m3152321575_MetadataUsageId); s_Il2CppMethodInitialized = true; } { RuntimeObject * L_0 = ___other0; if (L_0) { goto IL_0005; } } { return 1; } IL_0005: { RuntimeObject * L_1 = ___other0; if (((RuntimeObject *)IsInstSealed((RuntimeObject*)L_1, ValueTuple_t3168505507_il2cpp_TypeInfo_var))) { goto IL_0037; } } { ValueTuple_t3168505507 L_2 = (*(ValueTuple_t3168505507 *)__this); RuntimeObject * L_3 = Box(ValueTuple_t3168505507_il2cpp_TypeInfo_var, &L_2); NullCheck(L_3); Type_t * L_4 = Object_GetType_m88164663(L_3, /*hidden argument*/NULL); NullCheck(L_4); String_t* L_5 = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, L_4); String_t* L_6 = SR_Format_m1749913990(NULL /*static, unused*/, _stringLiteral4055290125, L_5, /*hidden argument*/NULL); ArgumentException_t132251570 * L_7 = (ArgumentException_t132251570 *)il2cpp_codegen_object_new(ArgumentException_t132251570_il2cpp_TypeInfo_var); ArgumentException__ctor_m1216717135(L_7, L_6, _stringLiteral2432405111, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_7, NULL, ValueTuple_System_IComparable_CompareTo_m3152321575_RuntimeMethod_var); } IL_0037: { return 0; } } extern "C" int32_t ValueTuple_System_IComparable_CompareTo_m3152321575_AdjustorThunk (RuntimeObject * __this, RuntimeObject * ___other0, const RuntimeMethod* method) { ValueTuple_t3168505507 * _thisAdjusted = reinterpret_cast<ValueTuple_t3168505507 *>(__this + 1); return ValueTuple_System_IComparable_CompareTo_m3152321575(_thisAdjusted, ___other0, method); } // System.Int32 System.ValueTuple::CompareTo(System.ValueTuple) extern "C" int32_t ValueTuple_CompareTo_m2936302085 (ValueTuple_t3168505507 * __this, ValueTuple_t3168505507 ___other0, const RuntimeMethod* method) { { return 0; } } extern "C" int32_t ValueTuple_CompareTo_m2936302085_AdjustorThunk (RuntimeObject * __this, ValueTuple_t3168505507 ___other0, const RuntimeMethod* method) { ValueTuple_t3168505507 * _thisAdjusted = reinterpret_cast<ValueTuple_t3168505507 *>(__this + 1); return ValueTuple_CompareTo_m2936302085(_thisAdjusted, ___other0, method); } // System.Int32 System.ValueTuple::System.Collections.IStructuralComparable.CompareTo(System.Object,System.Collections.IComparer) extern "C" int32_t ValueTuple_System_Collections_IStructuralComparable_CompareTo_m1147772089 (ValueTuple_t3168505507 * __this, RuntimeObject * ___other0, RuntimeObject* ___comparer1, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (ValueTuple_System_Collections_IStructuralComparable_CompareTo_m1147772089_MetadataUsageId); s_Il2CppMethodInitialized = true; } { RuntimeObject * L_0 = ___other0; if (L_0) { goto IL_0005; } } { return 1; } IL_0005: { RuntimeObject * L_1 = ___other0; if (((RuntimeObject *)IsInstSealed((RuntimeObject*)L_1, ValueTuple_t3168505507_il2cpp_TypeInfo_var))) { goto IL_0037; } } { ValueTuple_t3168505507 L_2 = (*(ValueTuple_t3168505507 *)__this); RuntimeObject * L_3 = Box(ValueTuple_t3168505507_il2cpp_TypeInfo_var, &L_2); NullCheck(L_3); Type_t * L_4 = Object_GetType_m88164663(L_3, /*hidden argument*/NULL); NullCheck(L_4); String_t* L_5 = VirtFuncInvoker0< String_t* >::Invoke(3 /* System.String System.Object::ToString() */, L_4); String_t* L_6 = SR_Format_m1749913990(NULL /*static, unused*/, _stringLiteral4055290125, L_5, /*hidden argument*/NULL); ArgumentException_t132251570 * L_7 = (ArgumentException_t132251570 *)il2cpp_codegen_object_new(ArgumentException_t132251570_il2cpp_TypeInfo_var); ArgumentException__ctor_m1216717135(L_7, L_6, _stringLiteral2432405111, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_7, NULL, ValueTuple_System_Collections_IStructuralComparable_CompareTo_m1147772089_RuntimeMethod_var); } IL_0037: { return 0; } } extern "C" int32_t ValueTuple_System_Collections_IStructuralComparable_CompareTo_m1147772089_AdjustorThunk (RuntimeObject * __this, RuntimeObject * ___other0, RuntimeObject* ___comparer1, const RuntimeMethod* method) { ValueTuple_t3168505507 * _thisAdjusted = reinterpret_cast<ValueTuple_t3168505507 *>(__this + 1); return ValueTuple_System_Collections_IStructuralComparable_CompareTo_m1147772089(_thisAdjusted, ___other0, ___comparer1, method); } // System.Int32 System.ValueTuple::GetHashCode() extern "C" int32_t ValueTuple_GetHashCode_m2158739460 (ValueTuple_t3168505507 * __this, const RuntimeMethod* method) { { return 0; } } extern "C" int32_t ValueTuple_GetHashCode_m2158739460_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method) { ValueTuple_t3168505507 * _thisAdjusted = reinterpret_cast<ValueTuple_t3168505507 *>(__this + 1); return ValueTuple_GetHashCode_m2158739460(_thisAdjusted, method); } // System.Int32 System.ValueTuple::System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer) extern "C" int32_t ValueTuple_System_Collections_IStructuralEquatable_GetHashCode_m3160204034 (ValueTuple_t3168505507 * __this, RuntimeObject* ___comparer0, const RuntimeMethod* method) { { return 0; } } extern "C" int32_t ValueTuple_System_Collections_IStructuralEquatable_GetHashCode_m3160204034_AdjustorThunk (RuntimeObject * __this, RuntimeObject* ___comparer0, const RuntimeMethod* method) { ValueTuple_t3168505507 * _thisAdjusted = reinterpret_cast<ValueTuple_t3168505507 *>(__this + 1); return ValueTuple_System_Collections_IStructuralEquatable_GetHashCode_m3160204034(_thisAdjusted, ___comparer0, method); } // System.String System.ValueTuple::ToString() extern "C" String_t* ValueTuple_ToString_m2213345710 (ValueTuple_t3168505507 * __this, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (ValueTuple_ToString_m2213345710_MetadataUsageId); s_Il2CppMethodInitialized = true; } { return _stringLiteral3450976136; } } extern "C" String_t* ValueTuple_ToString_m2213345710_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method) { ValueTuple_t3168505507 * _thisAdjusted = reinterpret_cast<ValueTuple_t3168505507 *>(__this + 1); return ValueTuple_ToString_m2213345710(_thisAdjusted, method); } // System.Int32 System.ValueTuple::CombineHashCodes(System.Int32,System.Int32) extern "C" int32_t ValueTuple_CombineHashCodes_m2782652282 (RuntimeObject * __this /* static, unused */, int32_t ___h10, int32_t ___h21, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (ValueTuple_CombineHashCodes_m2782652282_MetadataUsageId); s_Il2CppMethodInitialized = true; } { IL2CPP_RUNTIME_CLASS_INIT(HashHelpers_t1653534276_il2cpp_TypeInfo_var); int32_t L_0 = ((HashHelpers_t1653534276_StaticFields*)il2cpp_codegen_static_fields_for(HashHelpers_t1653534276_il2cpp_TypeInfo_var))->get_RandomSeed_0(); int32_t L_1 = ___h10; int32_t L_2 = HashHelpers_Combine_m3459330122(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/NULL); int32_t L_3 = ___h21; int32_t L_4 = HashHelpers_Combine_m3459330122(NULL /*static, unused*/, L_2, L_3, /*hidden argument*/NULL); return L_4; } } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Conversion methods for marshalling of: System.ValueType extern "C" void ValueType_t3640485471_marshal_pinvoke(const ValueType_t3640485471& unmarshaled, ValueType_t3640485471_marshaled_pinvoke& marshaled) { } extern "C" void ValueType_t3640485471_marshal_pinvoke_back(const ValueType_t3640485471_marshaled_pinvoke& marshaled, ValueType_t3640485471& unmarshaled) { } // Conversion method for clean up from marshalling of: System.ValueType extern "C" void ValueType_t3640485471_marshal_pinvoke_cleanup(ValueType_t3640485471_marshaled_pinvoke& marshaled) { } // Conversion methods for marshalling of: System.ValueType extern "C" void ValueType_t3640485471_marshal_com(const ValueType_t3640485471& unmarshaled, ValueType_t3640485471_marshaled_com& marshaled) { } extern "C" void ValueType_t3640485471_marshal_com_back(const ValueType_t3640485471_marshaled_com& marshaled, ValueType_t3640485471& unmarshaled) { } // Conversion method for clean up from marshalling of: System.ValueType extern "C" void ValueType_t3640485471_marshal_com_cleanup(ValueType_t3640485471_marshaled_com& marshaled) { } // System.Void System.ValueType::.ctor() extern "C" void ValueType__ctor_m2036258423 (RuntimeObject * __this, const RuntimeMethod* method) { { Object__ctor_m297566312(__this, /*hidden argument*/NULL); return; } } // System.Boolean System.ValueType::InternalEquals(System.Object,System.Object,System.Object[]&) extern "C" bool ValueType_InternalEquals_m1384040357 (RuntimeObject * __this /* static, unused */, RuntimeObject * ___o10, RuntimeObject * ___o21, ObjectU5BU5D_t2843939325** ___fields2, const RuntimeMethod* method) { typedef bool (*ValueType_InternalEquals_m1384040357_ftn) (RuntimeObject *, RuntimeObject *, ObjectU5BU5D_t2843939325**); using namespace il2cpp::icalls; return ((ValueType_InternalEquals_m1384040357_ftn)mscorlib::System::ValueType::InternalEquals) (___o10, ___o21, ___fields2); } // System.Boolean System.ValueType::DefaultEquals(System.Object,System.Object) extern "C" bool ValueType_DefaultEquals_m2927252100 (RuntimeObject * __this /* static, unused */, RuntimeObject * ___o10, RuntimeObject * ___o21, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (ValueType_DefaultEquals_m2927252100_MetadataUsageId); s_Il2CppMethodInitialized = true; } RuntimeType_t3636489352 * V_0 = NULL; ObjectU5BU5D_t2843939325* V_1 = NULL; bool V_2 = false; int32_t V_3 = 0; RuntimeObject * V_4 = NULL; RuntimeObject * V_5 = NULL; { RuntimeObject * L_0 = ___o10; if (L_0) { goto IL_0008; } } { RuntimeObject * L_1 = ___o21; if (L_1) { goto IL_0008; } } { return (bool)1; } IL_0008: { RuntimeObject * L_2 = ___o10; if (!L_2) { goto IL_000e; } } { RuntimeObject * L_3 = ___o21; if (L_3) { goto IL_0010; } } IL_000e: { return (bool)0; } IL_0010: { RuntimeObject * L_4 = ___o10; NullCheck(L_4); Type_t * L_5 = Object_GetType_m88164663(L_4, /*hidden argument*/NULL); RuntimeObject * L_6 = ___o21; NullCheck(L_6); Type_t * L_7 = Object_GetType_m88164663(L_6, /*hidden argument*/NULL); V_0 = ((RuntimeType_t3636489352 *)CastclassClass((RuntimeObject*)L_7, RuntimeType_t3636489352_il2cpp_TypeInfo_var)); RuntimeType_t3636489352 * L_8 = V_0; IL2CPP_RUNTIME_CLASS_INIT(RuntimeType_t3636489352_il2cpp_TypeInfo_var); bool L_9 = RuntimeType_op_Inequality_m287584116(NULL /*static, unused*/, ((RuntimeType_t3636489352 *)CastclassClass((RuntimeObject*)L_5, RuntimeType_t3636489352_il2cpp_TypeInfo_var)), L_8, /*hidden argument*/NULL); if (!L_9) { goto IL_0031; } } { return (bool)0; } IL_0031: { RuntimeObject * L_10 = ___o10; RuntimeObject * L_11 = ___o21; bool L_12 = ValueType_InternalEquals_m1384040357(NULL /*static, unused*/, L_10, L_11, (ObjectU5BU5D_t2843939325**)(&V_1), /*hidden argument*/NULL); V_2 = L_12; ObjectU5BU5D_t2843939325* L_13 = V_1; if (L_13) { goto IL_0040; } } { bool L_14 = V_2; return L_14; } IL_0040: { V_3 = 0; goto IL_006b; } IL_0044: { ObjectU5BU5D_t2843939325* L_15 = V_1; int32_t L_16 = V_3; NullCheck(L_15); int32_t L_17 = L_16; RuntimeObject * L_18 = (L_15)->GetAt(static_cast<il2cpp_array_size_t>(L_17)); V_4 = L_18; ObjectU5BU5D_t2843939325* L_19 = V_1; int32_t L_20 = V_3; NullCheck(L_19); int32_t L_21 = ((int32_t)il2cpp_codegen_add((int32_t)L_20, (int32_t)1)); RuntimeObject * L_22 = (L_19)->GetAt(static_cast<il2cpp_array_size_t>(L_21)); V_5 = L_22; RuntimeObject * L_23 = V_4; if (L_23) { goto IL_005a; } } { RuntimeObject * L_24 = V_5; if (!L_24) { goto IL_0067; } } { return (bool)0; } IL_005a: { RuntimeObject * L_25 = V_4; RuntimeObject * L_26 = V_5; NullCheck(L_25); bool L_27 = VirtFuncInvoker1< bool, RuntimeObject * >::Invoke(0 /* System.Boolean System.Object::Equals(System.Object) */, L_25, L_26); if (L_27) { goto IL_0067; } } { return (bool)0; } IL_0067: { int32_t L_28 = V_3; V_3 = ((int32_t)il2cpp_codegen_add((int32_t)L_28, (int32_t)2)); } IL_006b: { int32_t L_29 = V_3; ObjectU5BU5D_t2843939325* L_30 = V_1; NullCheck(L_30); if ((((int32_t)L_29) < ((int32_t)(((int32_t)((int32_t)(((RuntimeArray *)L_30)->max_length))))))) { goto IL_0044; } } { return (bool)1; } } // System.Boolean System.ValueType::Equals(System.Object) extern "C" bool ValueType_Equals_m1524437845 (RuntimeObject * __this, RuntimeObject * ___obj0, const RuntimeMethod* method) { { RuntimeObject * L_0 = ___obj0; bool L_1 = ValueType_DefaultEquals_m2927252100(NULL /*static, unused*/, __this, L_0, /*hidden argument*/NULL); return L_1; } } // System.Int32 System.ValueType::InternalGetHashCode(System.Object,System.Object[]&) extern "C" int32_t ValueType_InternalGetHashCode_m58786863 (RuntimeObject * __this /* static, unused */, RuntimeObject * ___o0, ObjectU5BU5D_t2843939325** ___fields1, const RuntimeMethod* method) { typedef int32_t (*ValueType_InternalGetHashCode_m58786863_ftn) (RuntimeObject *, ObjectU5BU5D_t2843939325**); using namespace il2cpp::icalls; return ((ValueType_InternalGetHashCode_m58786863_ftn)mscorlib::System::ValueType::InternalGetHashCode) (___o0, ___fields1); } // System.Int32 System.ValueType::GetHashCode() extern "C" int32_t ValueType_GetHashCode_m715362416 (RuntimeObject * __this, const RuntimeMethod* method) { ObjectU5BU5D_t2843939325* V_0 = NULL; int32_t V_1 = 0; int32_t V_2 = 0; { int32_t L_0 = ValueType_InternalGetHashCode_m58786863(NULL /*static, unused*/, __this, (ObjectU5BU5D_t2843939325**)(&V_0), /*hidden argument*/NULL); V_1 = L_0; ObjectU5BU5D_t2843939325* L_1 = V_0; if (!L_1) { goto IL_002a; } } { V_2 = 0; goto IL_0024; } IL_0010: { ObjectU5BU5D_t2843939325* L_2 = V_0; int32_t L_3 = V_2; NullCheck(L_2); int32_t L_4 = L_3; RuntimeObject * L_5 = (L_2)->GetAt(static_cast<il2cpp_array_size_t>(L_4)); if (!L_5) { goto IL_0020; } } { int32_t L_6 = V_1; ObjectU5BU5D_t2843939325* L_7 = V_0; int32_t L_8 = V_2; NullCheck(L_7); int32_t L_9 = L_8; RuntimeObject * L_10 = (L_7)->GetAt(static_cast<il2cpp_array_size_t>(L_9)); NullCheck(L_10); int32_t L_11 = VirtFuncInvoker0< int32_t >::Invoke(2 /* System.Int32 System.Object::GetHashCode() */, L_10); V_1 = ((int32_t)((int32_t)L_6^(int32_t)L_11)); } IL_0020: { int32_t L_12 = V_2; V_2 = ((int32_t)il2cpp_codegen_add((int32_t)L_12, (int32_t)1)); } IL_0024: { int32_t L_13 = V_2; ObjectU5BU5D_t2843939325* L_14 = V_0; NullCheck(L_14); if ((((int32_t)L_13) < ((int32_t)(((int32_t)((int32_t)(((RuntimeArray *)L_14)->max_length))))))) { goto IL_0010; } } IL_002a: { int32_t L_15 = V_1; return L_15; } } // System.String System.ValueType::ToString() extern "C" String_t* ValueType_ToString_m2292123621 (RuntimeObject * __this, const RuntimeMethod* method) { { Type_t * L_0 = Object_GetType_m88164663(__this, /*hidden argument*/NULL); NullCheck(L_0); String_t* L_1 = VirtFuncInvoker0< String_t* >::Invoke(26 /* System.String System.Type::get_FullName() */, L_0); return L_1; } } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Void System.Variant::Clear() extern "C" void Variant_Clear_m3388694274 (Variant_t2753289927 * __this, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Variant_Clear_m3388694274_MetadataUsageId); s_Il2CppMethodInitialized = true; } { int16_t L_0 = __this->get_vt_0(); if ((!(((uint32_t)L_0) == ((uint32_t)8)))) { goto IL_0015; } } { intptr_t L_1 = __this->get_bstrVal_11(); IL2CPP_RUNTIME_CLASS_INIT(Marshal_t1757017490_il2cpp_TypeInfo_var); Marshal_FreeBSTR_m2788901813(NULL /*static, unused*/, L_1, /*hidden argument*/NULL); return; } IL_0015: { int16_t L_2 = __this->get_vt_0(); if ((((int32_t)L_2) == ((int32_t)((int32_t)9)))) { goto IL_0029; } } { int16_t L_3 = __this->get_vt_0(); if ((!(((uint32_t)L_3) == ((uint32_t)((int32_t)13))))) { goto IL_0047; } } IL_0029: { intptr_t L_4 = __this->get_pdispVal_18(); bool L_5 = IntPtr_op_Inequality_m3063970704(NULL /*static, unused*/, L_4, (intptr_t)(0), /*hidden argument*/NULL); if (!L_5) { goto IL_0047; } } { intptr_t L_6 = __this->get_pdispVal_18(); IL2CPP_RUNTIME_CLASS_INIT(Marshal_t1757017490_il2cpp_TypeInfo_var); Marshal_Release_m3880542832(NULL /*static, unused*/, L_6, /*hidden argument*/NULL); } IL_0047: { return; } } extern "C" void Variant_Clear_m3388694274_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method) { Variant_t2753289927 * _thisAdjusted = reinterpret_cast<Variant_t2753289927 *>(__this + 1); Variant_Clear_m3388694274(_thisAdjusted, method); } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Void System.Version::.ctor(System.Int32,System.Int32,System.Int32,System.Int32) extern "C" void Version__ctor_m417728625 (Version_t3456873960 * __this, int32_t ___major0, int32_t ___minor1, int32_t ___build2, int32_t ___revision3, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Version__ctor_m417728625_MetadataUsageId); s_Il2CppMethodInitialized = true; } { __this->set__Build_2((-1)); __this->set__Revision_3((-1)); Object__ctor_m297566312(__this, /*hidden argument*/NULL); int32_t L_0 = ___major0; if ((((int32_t)L_0) >= ((int32_t)0))) { goto IL_002d; } } { String_t* L_1 = Environment_GetResourceString_m2063689938(NULL /*static, unused*/, _stringLiteral2448690427, /*hidden argument*/NULL); ArgumentOutOfRangeException_t777629997 * L_2 = (ArgumentOutOfRangeException_t777629997 *)il2cpp_codegen_object_new(ArgumentOutOfRangeException_t777629997_il2cpp_TypeInfo_var); ArgumentOutOfRangeException__ctor_m282481429(L_2, _stringLiteral419133523, L_1, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_2, NULL, Version__ctor_m417728625_RuntimeMethod_var); } IL_002d: { int32_t L_3 = ___minor1; if ((((int32_t)L_3) >= ((int32_t)0))) { goto IL_0046; } } { String_t* L_4 = Environment_GetResourceString_m2063689938(NULL /*static, unused*/, _stringLiteral2448690427, /*hidden argument*/NULL); ArgumentOutOfRangeException_t777629997 * L_5 = (ArgumentOutOfRangeException_t777629997 *)il2cpp_codegen_object_new(ArgumentOutOfRangeException_t777629997_il2cpp_TypeInfo_var); ArgumentOutOfRangeException__ctor_m282481429(L_5, _stringLiteral2762033855, L_4, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_5, NULL, Version__ctor_m417728625_RuntimeMethod_var); } IL_0046: { int32_t L_6 = ___build2; if ((((int32_t)L_6) >= ((int32_t)0))) { goto IL_005f; } } { String_t* L_7 = Environment_GetResourceString_m2063689938(NULL /*static, unused*/, _stringLiteral2448690427, /*hidden argument*/NULL); ArgumentOutOfRangeException_t777629997 * L_8 = (ArgumentOutOfRangeException_t777629997 *)il2cpp_codegen_object_new(ArgumentOutOfRangeException_t777629997_il2cpp_TypeInfo_var); ArgumentOutOfRangeException__ctor_m282481429(L_8, _stringLiteral437191301, L_7, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_8, NULL, Version__ctor_m417728625_RuntimeMethod_var); } IL_005f: { int32_t L_9 = ___revision3; if ((((int32_t)L_9) >= ((int32_t)0))) { goto IL_0079; } } { String_t* L_10 = Environment_GetResourceString_m2063689938(NULL /*static, unused*/, _stringLiteral2448690427, /*hidden argument*/NULL); ArgumentOutOfRangeException_t777629997 * L_11 = (ArgumentOutOfRangeException_t777629997 *)il2cpp_codegen_object_new(ArgumentOutOfRangeException_t777629997_il2cpp_TypeInfo_var); ArgumentOutOfRangeException__ctor_m282481429(L_11, _stringLiteral3187820736, L_10, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_11, NULL, Version__ctor_m417728625_RuntimeMethod_var); } IL_0079: { int32_t L_12 = ___major0; __this->set__Major_0(L_12); int32_t L_13 = ___minor1; __this->set__Minor_1(L_13); int32_t L_14 = ___build2; __this->set__Build_2(L_14); int32_t L_15 = ___revision3; __this->set__Revision_3(L_15); return; } } // System.Void System.Version::.ctor(System.Int32,System.Int32) extern "C" void Version__ctor_m3537335798 (Version_t3456873960 * __this, int32_t ___major0, int32_t ___minor1, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Version__ctor_m3537335798_MetadataUsageId); s_Il2CppMethodInitialized = true; } { __this->set__Build_2((-1)); __this->set__Revision_3((-1)); Object__ctor_m297566312(__this, /*hidden argument*/NULL); int32_t L_0 = ___major0; if ((((int32_t)L_0) >= ((int32_t)0))) { goto IL_002d; } } { String_t* L_1 = Environment_GetResourceString_m2063689938(NULL /*static, unused*/, _stringLiteral2448690427, /*hidden argument*/NULL); ArgumentOutOfRangeException_t777629997 * L_2 = (ArgumentOutOfRangeException_t777629997 *)il2cpp_codegen_object_new(ArgumentOutOfRangeException_t777629997_il2cpp_TypeInfo_var); ArgumentOutOfRangeException__ctor_m282481429(L_2, _stringLiteral419133523, L_1, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_2, NULL, Version__ctor_m3537335798_RuntimeMethod_var); } IL_002d: { int32_t L_3 = ___minor1; if ((((int32_t)L_3) >= ((int32_t)0))) { goto IL_0046; } } { String_t* L_4 = Environment_GetResourceString_m2063689938(NULL /*static, unused*/, _stringLiteral2448690427, /*hidden argument*/NULL); ArgumentOutOfRangeException_t777629997 * L_5 = (ArgumentOutOfRangeException_t777629997 *)il2cpp_codegen_object_new(ArgumentOutOfRangeException_t777629997_il2cpp_TypeInfo_var); ArgumentOutOfRangeException__ctor_m282481429(L_5, _stringLiteral2762033855, L_4, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_5, NULL, Version__ctor_m3537335798_RuntimeMethod_var); } IL_0046: { int32_t L_6 = ___major0; __this->set__Major_0(L_6); int32_t L_7 = ___minor1; __this->set__Minor_1(L_7); return; } } // System.Void System.Version::.ctor() extern "C" void Version__ctor_m872301635 (Version_t3456873960 * __this, const RuntimeMethod* method) { { __this->set__Build_2((-1)); __this->set__Revision_3((-1)); Object__ctor_m297566312(__this, /*hidden argument*/NULL); __this->set__Major_0(0); __this->set__Minor_1(0); return; } } // System.Int32 System.Version::get_Major() extern "C" int32_t Version_get_Major_m2457928275 (Version_t3456873960 * __this, const RuntimeMethod* method) { { int32_t L_0 = __this->get__Major_0(); return L_0; } } // System.Int32 System.Version::get_Minor() extern "C" int32_t Version_get_Minor_m150536655 (Version_t3456873960 * __this, const RuntimeMethod* method) { { int32_t L_0 = __this->get__Minor_1(); return L_0; } } // System.Int32 System.Version::get_Build() extern "C" int32_t Version_get_Build_m3667751407 (Version_t3456873960 * __this, const RuntimeMethod* method) { { int32_t L_0 = __this->get__Build_2(); return L_0; } } // System.Int32 System.Version::get_Revision() extern "C" int32_t Version_get_Revision_m3982234017 (Version_t3456873960 * __this, const RuntimeMethod* method) { { int32_t L_0 = __this->get__Revision_3(); return L_0; } } // System.Object System.Version::Clone() extern "C" RuntimeObject * Version_Clone_m1749041863 (Version_t3456873960 * __this, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Version_Clone_m1749041863_MetadataUsageId); s_Il2CppMethodInitialized = true; } { Version_t3456873960 * L_0 = (Version_t3456873960 *)il2cpp_codegen_object_new(Version_t3456873960_il2cpp_TypeInfo_var); Version__ctor_m872301635(L_0, /*hidden argument*/NULL); Version_t3456873960 * L_1 = L_0; int32_t L_2 = __this->get__Major_0(); NullCheck(L_1); L_1->set__Major_0(L_2); Version_t3456873960 * L_3 = L_1; int32_t L_4 = __this->get__Minor_1(); NullCheck(L_3); L_3->set__Minor_1(L_4); Version_t3456873960 * L_5 = L_3; int32_t L_6 = __this->get__Build_2(); NullCheck(L_5); L_5->set__Build_2(L_6); Version_t3456873960 * L_7 = L_5; int32_t L_8 = __this->get__Revision_3(); NullCheck(L_7); L_7->set__Revision_3(L_8); return L_7; } } // System.Int32 System.Version::CompareTo(System.Object) extern "C" int32_t Version_CompareTo_m1662919407 (Version_t3456873960 * __this, RuntimeObject * ___version0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Version_CompareTo_m1662919407_MetadataUsageId); s_Il2CppMethodInitialized = true; } Version_t3456873960 * V_0 = NULL; { RuntimeObject * L_0 = ___version0; if (L_0) { goto IL_0005; } } { return 1; } IL_0005: { RuntimeObject * L_1 = ___version0; V_0 = ((Version_t3456873960 *)IsInstSealed((RuntimeObject*)L_1, Version_t3456873960_il2cpp_TypeInfo_var)); Version_t3456873960 * L_2 = V_0; IL2CPP_RUNTIME_CLASS_INIT(Version_t3456873960_il2cpp_TypeInfo_var); bool L_3 = Version_op_Equality_m3804852517(NULL /*static, unused*/, L_2, (Version_t3456873960 *)NULL, /*hidden argument*/NULL); if (!L_3) { goto IL_0025; } } { String_t* L_4 = Environment_GetResourceString_m2063689938(NULL /*static, unused*/, _stringLiteral1182144617, /*hidden argument*/NULL); ArgumentException_t132251570 * L_5 = (ArgumentException_t132251570 *)il2cpp_codegen_object_new(ArgumentException_t132251570_il2cpp_TypeInfo_var); ArgumentException__ctor_m1312628991(L_5, L_4, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_5, NULL, Version_CompareTo_m1662919407_RuntimeMethod_var); } IL_0025: { int32_t L_6 = __this->get__Major_0(); Version_t3456873960 * L_7 = V_0; NullCheck(L_7); int32_t L_8 = L_7->get__Major_0(); if ((((int32_t)L_6) == ((int32_t)L_8))) { goto IL_0045; } } { int32_t L_9 = __this->get__Major_0(); Version_t3456873960 * L_10 = V_0; NullCheck(L_10); int32_t L_11 = L_10->get__Major_0(); if ((((int32_t)L_9) <= ((int32_t)L_11))) { goto IL_0043; } } { return 1; } IL_0043: { return (-1); } IL_0045: { int32_t L_12 = __this->get__Minor_1(); Version_t3456873960 * L_13 = V_0; NullCheck(L_13); int32_t L_14 = L_13->get__Minor_1(); if ((((int32_t)L_12) == ((int32_t)L_14))) { goto IL_0065; } } { int32_t L_15 = __this->get__Minor_1(); Version_t3456873960 * L_16 = V_0; NullCheck(L_16); int32_t L_17 = L_16->get__Minor_1(); if ((((int32_t)L_15) <= ((int32_t)L_17))) { goto IL_0063; } } { return 1; } IL_0063: { return (-1); } IL_0065: { int32_t L_18 = __this->get__Build_2(); Version_t3456873960 * L_19 = V_0; NullCheck(L_19); int32_t L_20 = L_19->get__Build_2(); if ((((int32_t)L_18) == ((int32_t)L_20))) { goto IL_0085; } } { int32_t L_21 = __this->get__Build_2(); Version_t3456873960 * L_22 = V_0; NullCheck(L_22); int32_t L_23 = L_22->get__Build_2(); if ((((int32_t)L_21) <= ((int32_t)L_23))) { goto IL_0083; } } { return 1; } IL_0083: { return (-1); } IL_0085: { int32_t L_24 = __this->get__Revision_3(); Version_t3456873960 * L_25 = V_0; NullCheck(L_25); int32_t L_26 = L_25->get__Revision_3(); if ((((int32_t)L_24) == ((int32_t)L_26))) { goto IL_00a5; } } { int32_t L_27 = __this->get__Revision_3(); Version_t3456873960 * L_28 = V_0; NullCheck(L_28); int32_t L_29 = L_28->get__Revision_3(); if ((((int32_t)L_27) <= ((int32_t)L_29))) { goto IL_00a3; } } { return 1; } IL_00a3: { return (-1); } IL_00a5: { return 0; } } // System.Int32 System.Version::CompareTo(System.Version) extern "C" int32_t Version_CompareTo_m3146217210 (Version_t3456873960 * __this, Version_t3456873960 * ___value0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Version_CompareTo_m3146217210_MetadataUsageId); s_Il2CppMethodInitialized = true; } { Version_t3456873960 * L_0 = ___value0; IL2CPP_RUNTIME_CLASS_INIT(Version_t3456873960_il2cpp_TypeInfo_var); bool L_1 = Version_op_Equality_m3804852517(NULL /*static, unused*/, L_0, (Version_t3456873960 *)NULL, /*hidden argument*/NULL); if (!L_1) { goto IL_000b; } } { return 1; } IL_000b: { int32_t L_2 = __this->get__Major_0(); Version_t3456873960 * L_3 = ___value0; NullCheck(L_3); int32_t L_4 = L_3->get__Major_0(); if ((((int32_t)L_2) == ((int32_t)L_4))) { goto IL_002b; } } { int32_t L_5 = __this->get__Major_0(); Version_t3456873960 * L_6 = ___value0; NullCheck(L_6); int32_t L_7 = L_6->get__Major_0(); if ((((int32_t)L_5) <= ((int32_t)L_7))) { goto IL_0029; } } { return 1; } IL_0029: { return (-1); } IL_002b: { int32_t L_8 = __this->get__Minor_1(); Version_t3456873960 * L_9 = ___value0; NullCheck(L_9); int32_t L_10 = L_9->get__Minor_1(); if ((((int32_t)L_8) == ((int32_t)L_10))) { goto IL_004b; } } { int32_t L_11 = __this->get__Minor_1(); Version_t3456873960 * L_12 = ___value0; NullCheck(L_12); int32_t L_13 = L_12->get__Minor_1(); if ((((int32_t)L_11) <= ((int32_t)L_13))) { goto IL_0049; } } { return 1; } IL_0049: { return (-1); } IL_004b: { int32_t L_14 = __this->get__Build_2(); Version_t3456873960 * L_15 = ___value0; NullCheck(L_15); int32_t L_16 = L_15->get__Build_2(); if ((((int32_t)L_14) == ((int32_t)L_16))) { goto IL_006b; } } { int32_t L_17 = __this->get__Build_2(); Version_t3456873960 * L_18 = ___value0; NullCheck(L_18); int32_t L_19 = L_18->get__Build_2(); if ((((int32_t)L_17) <= ((int32_t)L_19))) { goto IL_0069; } } { return 1; } IL_0069: { return (-1); } IL_006b: { int32_t L_20 = __this->get__Revision_3(); Version_t3456873960 * L_21 = ___value0; NullCheck(L_21); int32_t L_22 = L_21->get__Revision_3(); if ((((int32_t)L_20) == ((int32_t)L_22))) { goto IL_008b; } } { int32_t L_23 = __this->get__Revision_3(); Version_t3456873960 * L_24 = ___value0; NullCheck(L_24); int32_t L_25 = L_24->get__Revision_3(); if ((((int32_t)L_23) <= ((int32_t)L_25))) { goto IL_0089; } } { return 1; } IL_0089: { return (-1); } IL_008b: { return 0; } } // System.Boolean System.Version::Equals(System.Object) extern "C" bool Version_Equals_m3073813696 (Version_t3456873960 * __this, RuntimeObject * ___obj0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Version_Equals_m3073813696_MetadataUsageId); s_Il2CppMethodInitialized = true; } Version_t3456873960 * V_0 = NULL; { RuntimeObject * L_0 = ___obj0; V_0 = ((Version_t3456873960 *)IsInstSealed((RuntimeObject*)L_0, Version_t3456873960_il2cpp_TypeInfo_var)); Version_t3456873960 * L_1 = V_0; IL2CPP_RUNTIME_CLASS_INIT(Version_t3456873960_il2cpp_TypeInfo_var); bool L_2 = Version_op_Equality_m3804852517(NULL /*static, unused*/, L_1, (Version_t3456873960 *)NULL, /*hidden argument*/NULL); if (!L_2) { goto IL_0012; } } { return (bool)0; } IL_0012: { int32_t L_3 = __this->get__Major_0(); Version_t3456873960 * L_4 = V_0; NullCheck(L_4); int32_t L_5 = L_4->get__Major_0(); if ((!(((uint32_t)L_3) == ((uint32_t)L_5)))) { goto IL_004a; } } { int32_t L_6 = __this->get__Minor_1(); Version_t3456873960 * L_7 = V_0; NullCheck(L_7); int32_t L_8 = L_7->get__Minor_1(); if ((!(((uint32_t)L_6) == ((uint32_t)L_8)))) { goto IL_004a; } } { int32_t L_9 = __this->get__Build_2(); Version_t3456873960 * L_10 = V_0; NullCheck(L_10); int32_t L_11 = L_10->get__Build_2(); if ((!(((uint32_t)L_9) == ((uint32_t)L_11)))) { goto IL_004a; } } { int32_t L_12 = __this->get__Revision_3(); Version_t3456873960 * L_13 = V_0; NullCheck(L_13); int32_t L_14 = L_13->get__Revision_3(); if ((((int32_t)L_12) == ((int32_t)L_14))) { goto IL_004c; } } IL_004a: { return (bool)0; } IL_004c: { return (bool)1; } } // System.Boolean System.Version::Equals(System.Version) extern "C" bool Version_Equals_m1564427710 (Version_t3456873960 * __this, Version_t3456873960 * ___obj0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Version_Equals_m1564427710_MetadataUsageId); s_Il2CppMethodInitialized = true; } { Version_t3456873960 * L_0 = ___obj0; IL2CPP_RUNTIME_CLASS_INIT(Version_t3456873960_il2cpp_TypeInfo_var); bool L_1 = Version_op_Equality_m3804852517(NULL /*static, unused*/, L_0, (Version_t3456873960 *)NULL, /*hidden argument*/NULL); if (!L_1) { goto IL_000b; } } { return (bool)0; } IL_000b: { int32_t L_2 = __this->get__Major_0(); Version_t3456873960 * L_3 = ___obj0; NullCheck(L_3); int32_t L_4 = L_3->get__Major_0(); if ((!(((uint32_t)L_2) == ((uint32_t)L_4)))) { goto IL_0043; } } { int32_t L_5 = __this->get__Minor_1(); Version_t3456873960 * L_6 = ___obj0; NullCheck(L_6); int32_t L_7 = L_6->get__Minor_1(); if ((!(((uint32_t)L_5) == ((uint32_t)L_7)))) { goto IL_0043; } } { int32_t L_8 = __this->get__Build_2(); Version_t3456873960 * L_9 = ___obj0; NullCheck(L_9); int32_t L_10 = L_9->get__Build_2(); if ((!(((uint32_t)L_8) == ((uint32_t)L_10)))) { goto IL_0043; } } { int32_t L_11 = __this->get__Revision_3(); Version_t3456873960 * L_12 = ___obj0; NullCheck(L_12); int32_t L_13 = L_12->get__Revision_3(); if ((((int32_t)L_11) == ((int32_t)L_13))) { goto IL_0045; } } IL_0043: { return (bool)0; } IL_0045: { return (bool)1; } } // System.Int32 System.Version::GetHashCode() extern "C" int32_t Version_GetHashCode_m672974201 (Version_t3456873960 * __this, const RuntimeMethod* method) { { int32_t L_0 = __this->get__Major_0(); int32_t L_1 = __this->get__Minor_1(); int32_t L_2 = __this->get__Build_2(); int32_t L_3 = __this->get__Revision_3(); return ((int32_t)((int32_t)((int32_t)((int32_t)((int32_t)((int32_t)((int32_t)((int32_t)0|(int32_t)((int32_t)((int32_t)((int32_t)((int32_t)L_0&(int32_t)((int32_t)15)))<<(int32_t)((int32_t)28)))))|(int32_t)((int32_t)((int32_t)((int32_t)((int32_t)L_1&(int32_t)((int32_t)255)))<<(int32_t)((int32_t)20)))))|(int32_t)((int32_t)((int32_t)((int32_t)((int32_t)L_2&(int32_t)((int32_t)255)))<<(int32_t)((int32_t)12)))))|(int32_t)((int32_t)((int32_t)L_3&(int32_t)((int32_t)4095))))); } } // System.String System.Version::ToString() extern "C" String_t* Version_ToString_m2279867705 (Version_t3456873960 * __this, const RuntimeMethod* method) { { int32_t L_0 = __this->get__Build_2(); if ((!(((uint32_t)L_0) == ((uint32_t)(-1))))) { goto IL_0011; } } { String_t* L_1 = Version_ToString_m3654989516(__this, 2, /*hidden argument*/NULL); return L_1; } IL_0011: { int32_t L_2 = __this->get__Revision_3(); if ((!(((uint32_t)L_2) == ((uint32_t)(-1))))) { goto IL_0022; } } { String_t* L_3 = Version_ToString_m3654989516(__this, 3, /*hidden argument*/NULL); return L_3; } IL_0022: { String_t* L_4 = Version_ToString_m3654989516(__this, 4, /*hidden argument*/NULL); return L_4; } } // System.String System.Version::ToString(System.Int32) extern "C" String_t* Version_ToString_m3654989516 (Version_t3456873960 * __this, int32_t ___fieldCount0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Version_ToString_m3654989516_MetadataUsageId); s_Il2CppMethodInitialized = true; } StringBuilder_t * V_0 = NULL; { int32_t L_0 = ___fieldCount0; switch (L_0) { case 0: { goto IL_0014; } case 1: { goto IL_001a; } case 2: { goto IL_0026; } } } { goto IL_0056; } IL_0014: { String_t* L_1 = ((String_t_StaticFields*)il2cpp_codegen_static_fields_for(String_t_il2cpp_TypeInfo_var))->get_Empty_5(); return L_1; } IL_001a: { int32_t* L_2 = __this->get_address_of__Major_0(); String_t* L_3 = Int32_ToString_m141394615((int32_t*)L_2, /*hidden argument*/NULL); return L_3; } IL_0026: { StringBuilder_t * L_4 = StringBuilderCache_Acquire_m4169564332(NULL /*static, unused*/, ((int32_t)16), /*hidden argument*/NULL); V_0 = L_4; int32_t L_5 = __this->get__Major_0(); StringBuilder_t * L_6 = V_0; IL2CPP_RUNTIME_CLASS_INIT(Version_t3456873960_il2cpp_TypeInfo_var); Version_AppendPositiveNumber_m308762805(NULL /*static, unused*/, L_5, L_6, /*hidden argument*/NULL); StringBuilder_t * L_7 = V_0; NullCheck(L_7); StringBuilder_Append_m2383614642(L_7, ((int32_t)46), /*hidden argument*/NULL); int32_t L_8 = __this->get__Minor_1(); StringBuilder_t * L_9 = V_0; Version_AppendPositiveNumber_m308762805(NULL /*static, unused*/, L_8, L_9, /*hidden argument*/NULL); StringBuilder_t * L_10 = V_0; String_t* L_11 = StringBuilderCache_GetStringAndRelease_m1110745745(NULL /*static, unused*/, L_10, /*hidden argument*/NULL); return L_11; } IL_0056: { int32_t L_12 = __this->get__Build_2(); if ((!(((uint32_t)L_12) == ((uint32_t)(-1))))) { goto IL_008a; } } { ObjectU5BU5D_t2843939325* L_13 = (ObjectU5BU5D_t2843939325*)SZArrayNew(ObjectU5BU5D_t2843939325_il2cpp_TypeInfo_var, (uint32_t)2); ObjectU5BU5D_t2843939325* L_14 = L_13; NullCheck(L_14); ArrayElementTypeCheck (L_14, _stringLiteral3452614544); (L_14)->SetAt(static_cast<il2cpp_array_size_t>(0), (RuntimeObject *)_stringLiteral3452614544); ObjectU5BU5D_t2843939325* L_15 = L_14; NullCheck(L_15); ArrayElementTypeCheck (L_15, _stringLiteral3452614542); (L_15)->SetAt(static_cast<il2cpp_array_size_t>(1), (RuntimeObject *)_stringLiteral3452614542); String_t* L_16 = Environment_GetResourceString_m479507158(NULL /*static, unused*/, _stringLiteral3104458722, L_15, /*hidden argument*/NULL); ArgumentException_t132251570 * L_17 = (ArgumentException_t132251570 *)il2cpp_codegen_object_new(ArgumentException_t132251570_il2cpp_TypeInfo_var); ArgumentException__ctor_m1216717135(L_17, L_16, _stringLiteral3976682977, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_17, NULL, Version_ToString_m3654989516_RuntimeMethod_var); } IL_008a: { int32_t L_18 = ___fieldCount0; if ((!(((uint32_t)L_18) == ((uint32_t)3)))) { goto IL_00d3; } } { StringBuilder_t * L_19 = StringBuilderCache_Acquire_m4169564332(NULL /*static, unused*/, ((int32_t)16), /*hidden argument*/NULL); V_0 = L_19; int32_t L_20 = __this->get__Major_0(); StringBuilder_t * L_21 = V_0; IL2CPP_RUNTIME_CLASS_INIT(Version_t3456873960_il2cpp_TypeInfo_var); Version_AppendPositiveNumber_m308762805(NULL /*static, unused*/, L_20, L_21, /*hidden argument*/NULL); StringBuilder_t * L_22 = V_0; NullCheck(L_22); StringBuilder_Append_m2383614642(L_22, ((int32_t)46), /*hidden argument*/NULL); int32_t L_23 = __this->get__Minor_1(); StringBuilder_t * L_24 = V_0; Version_AppendPositiveNumber_m308762805(NULL /*static, unused*/, L_23, L_24, /*hidden argument*/NULL); StringBuilder_t * L_25 = V_0; NullCheck(L_25); StringBuilder_Append_m2383614642(L_25, ((int32_t)46), /*hidden argument*/NULL); int32_t L_26 = __this->get__Build_2(); StringBuilder_t * L_27 = V_0; Version_AppendPositiveNumber_m308762805(NULL /*static, unused*/, L_26, L_27, /*hidden argument*/NULL); StringBuilder_t * L_28 = V_0; String_t* L_29 = StringBuilderCache_GetStringAndRelease_m1110745745(NULL /*static, unused*/, L_28, /*hidden argument*/NULL); return L_29; } IL_00d3: { int32_t L_30 = __this->get__Revision_3(); if ((!(((uint32_t)L_30) == ((uint32_t)(-1))))) { goto IL_0107; } } { ObjectU5BU5D_t2843939325* L_31 = (ObjectU5BU5D_t2843939325*)SZArrayNew(ObjectU5BU5D_t2843939325_il2cpp_TypeInfo_var, (uint32_t)2); ObjectU5BU5D_t2843939325* L_32 = L_31; NullCheck(L_32); ArrayElementTypeCheck (L_32, _stringLiteral3452614544); (L_32)->SetAt(static_cast<il2cpp_array_size_t>(0), (RuntimeObject *)_stringLiteral3452614544); ObjectU5BU5D_t2843939325* L_33 = L_32; NullCheck(L_33); ArrayElementTypeCheck (L_33, _stringLiteral3452614541); (L_33)->SetAt(static_cast<il2cpp_array_size_t>(1), (RuntimeObject *)_stringLiteral3452614541); String_t* L_34 = Environment_GetResourceString_m479507158(NULL /*static, unused*/, _stringLiteral3104458722, L_33, /*hidden argument*/NULL); ArgumentException_t132251570 * L_35 = (ArgumentException_t132251570 *)il2cpp_codegen_object_new(ArgumentException_t132251570_il2cpp_TypeInfo_var); ArgumentException__ctor_m1216717135(L_35, L_34, _stringLiteral3976682977, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_35, NULL, Version_ToString_m3654989516_RuntimeMethod_var); } IL_0107: { int32_t L_36 = ___fieldCount0; if ((!(((uint32_t)L_36) == ((uint32_t)4)))) { goto IL_0165; } } { StringBuilder_t * L_37 = StringBuilderCache_Acquire_m4169564332(NULL /*static, unused*/, ((int32_t)16), /*hidden argument*/NULL); V_0 = L_37; int32_t L_38 = __this->get__Major_0(); StringBuilder_t * L_39 = V_0; IL2CPP_RUNTIME_CLASS_INIT(Version_t3456873960_il2cpp_TypeInfo_var); Version_AppendPositiveNumber_m308762805(NULL /*static, unused*/, L_38, L_39, /*hidden argument*/NULL); StringBuilder_t * L_40 = V_0; NullCheck(L_40); StringBuilder_Append_m2383614642(L_40, ((int32_t)46), /*hidden argument*/NULL); int32_t L_41 = __this->get__Minor_1(); StringBuilder_t * L_42 = V_0; Version_AppendPositiveNumber_m308762805(NULL /*static, unused*/, L_41, L_42, /*hidden argument*/NULL); StringBuilder_t * L_43 = V_0; NullCheck(L_43); StringBuilder_Append_m2383614642(L_43, ((int32_t)46), /*hidden argument*/NULL); int32_t L_44 = __this->get__Build_2(); StringBuilder_t * L_45 = V_0; Version_AppendPositiveNumber_m308762805(NULL /*static, unused*/, L_44, L_45, /*hidden argument*/NULL); StringBuilder_t * L_46 = V_0; NullCheck(L_46); StringBuilder_Append_m2383614642(L_46, ((int32_t)46), /*hidden argument*/NULL); int32_t L_47 = __this->get__Revision_3(); StringBuilder_t * L_48 = V_0; Version_AppendPositiveNumber_m308762805(NULL /*static, unused*/, L_47, L_48, /*hidden argument*/NULL); StringBuilder_t * L_49 = V_0; String_t* L_50 = StringBuilderCache_GetStringAndRelease_m1110745745(NULL /*static, unused*/, L_49, /*hidden argument*/NULL); return L_50; } IL_0165: { ObjectU5BU5D_t2843939325* L_51 = (ObjectU5BU5D_t2843939325*)SZArrayNew(ObjectU5BU5D_t2843939325_il2cpp_TypeInfo_var, (uint32_t)2); ObjectU5BU5D_t2843939325* L_52 = L_51; NullCheck(L_52); ArrayElementTypeCheck (L_52, _stringLiteral3452614544); (L_52)->SetAt(static_cast<il2cpp_array_size_t>(0), (RuntimeObject *)_stringLiteral3452614544); ObjectU5BU5D_t2843939325* L_53 = L_52; NullCheck(L_53); ArrayElementTypeCheck (L_53, _stringLiteral3452614540); (L_53)->SetAt(static_cast<il2cpp_array_size_t>(1), (RuntimeObject *)_stringLiteral3452614540); String_t* L_54 = Environment_GetResourceString_m479507158(NULL /*static, unused*/, _stringLiteral3104458722, L_53, /*hidden argument*/NULL); ArgumentException_t132251570 * L_55 = (ArgumentException_t132251570 *)il2cpp_codegen_object_new(ArgumentException_t132251570_il2cpp_TypeInfo_var); ArgumentException__ctor_m1216717135(L_55, L_54, _stringLiteral3976682977, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_55, NULL, Version_ToString_m3654989516_RuntimeMethod_var); } } // System.Void System.Version::AppendPositiveNumber(System.Int32,System.Text.StringBuilder) extern "C" void Version_AppendPositiveNumber_m308762805 (RuntimeObject * __this /* static, unused */, int32_t ___num0, StringBuilder_t * ___sb1, const RuntimeMethod* method) { int32_t V_0 = 0; int32_t V_1 = 0; { StringBuilder_t * L_0 = ___sb1; NullCheck(L_0); int32_t L_1 = StringBuilder_get_Length_m3238060835(L_0, /*hidden argument*/NULL); V_0 = L_1; } IL_0007: { int32_t L_2 = ___num0; V_1 = ((int32_t)((int32_t)L_2%(int32_t)((int32_t)10))); int32_t L_3 = ___num0; ___num0 = ((int32_t)((int32_t)L_3/(int32_t)((int32_t)10))); StringBuilder_t * L_4 = ___sb1; int32_t L_5 = V_0; int32_t L_6 = V_1; NullCheck(L_4); StringBuilder_Insert_m1076119876(L_4, L_5, (((int32_t)((uint16_t)((int32_t)il2cpp_codegen_add((int32_t)((int32_t)48), (int32_t)L_6))))), /*hidden argument*/NULL); int32_t L_7 = ___num0; if ((((int32_t)L_7) > ((int32_t)0))) { goto IL_0007; } } { return; } } // System.Boolean System.Version::op_Equality(System.Version,System.Version) extern "C" bool Version_op_Equality_m3804852517 (RuntimeObject * __this /* static, unused */, Version_t3456873960 * ___v10, Version_t3456873960 * ___v21, const RuntimeMethod* method) { { Version_t3456873960 * L_0 = ___v10; if (L_0) { goto IL_0008; } } { Version_t3456873960 * L_1 = ___v21; return (bool)((((RuntimeObject*)(Version_t3456873960 *)L_1) == ((RuntimeObject*)(RuntimeObject *)NULL))? 1 : 0); } IL_0008: { Version_t3456873960 * L_2 = ___v10; Version_t3456873960 * L_3 = ___v21; NullCheck(L_2); bool L_4 = Version_Equals_m1564427710(L_2, L_3, /*hidden argument*/NULL); return L_4; } } // System.Boolean System.Version::op_Inequality(System.Version,System.Version) extern "C" bool Version_op_Inequality_m1696193441 (RuntimeObject * __this /* static, unused */, Version_t3456873960 * ___v10, Version_t3456873960 * ___v21, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Version_op_Inequality_m1696193441_MetadataUsageId); s_Il2CppMethodInitialized = true; } { Version_t3456873960 * L_0 = ___v10; Version_t3456873960 * L_1 = ___v21; IL2CPP_RUNTIME_CLASS_INIT(Version_t3456873960_il2cpp_TypeInfo_var); bool L_2 = Version_op_Equality_m3804852517(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/NULL); return (bool)((((int32_t)L_2) == ((int32_t)0))? 1 : 0); } } // System.Boolean System.Version::op_LessThan(System.Version,System.Version) extern "C" bool Version_op_LessThan_m3745610070 (RuntimeObject * __this /* static, unused */, Version_t3456873960 * ___v10, Version_t3456873960 * ___v21, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Version_op_LessThan_m3745610070_MetadataUsageId); s_Il2CppMethodInitialized = true; } { Version_t3456873960 * L_0 = ___v10; if (L_0) { goto IL_000e; } } { ArgumentNullException_t1615371798 * L_1 = (ArgumentNullException_t1615371798 *)il2cpp_codegen_object_new(ArgumentNullException_t1615371798_il2cpp_TypeInfo_var); ArgumentNullException__ctor_m1170824041(L_1, _stringLiteral3451500490, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_1, NULL, Version_op_LessThan_m3745610070_RuntimeMethod_var); } IL_000e: { Version_t3456873960 * L_2 = ___v10; Version_t3456873960 * L_3 = ___v21; NullCheck(L_2); int32_t L_4 = Version_CompareTo_m3146217210(L_2, L_3, /*hidden argument*/NULL); return (bool)((((int32_t)L_4) < ((int32_t)0))? 1 : 0); } } // System.Boolean System.Version::op_LessThanOrEqual(System.Version,System.Version) extern "C" bool Version_op_LessThanOrEqual_m666140174 (RuntimeObject * __this /* static, unused */, Version_t3456873960 * ___v10, Version_t3456873960 * ___v21, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Version_op_LessThanOrEqual_m666140174_MetadataUsageId); s_Il2CppMethodInitialized = true; } { Version_t3456873960 * L_0 = ___v10; if (L_0) { goto IL_000e; } } { ArgumentNullException_t1615371798 * L_1 = (ArgumentNullException_t1615371798 *)il2cpp_codegen_object_new(ArgumentNullException_t1615371798_il2cpp_TypeInfo_var); ArgumentNullException__ctor_m1170824041(L_1, _stringLiteral3451500490, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_1, NULL, Version_op_LessThanOrEqual_m666140174_RuntimeMethod_var); } IL_000e: { Version_t3456873960 * L_2 = ___v10; Version_t3456873960 * L_3 = ___v21; NullCheck(L_2); int32_t L_4 = Version_CompareTo_m3146217210(L_2, L_3, /*hidden argument*/NULL); return (bool)((((int32_t)((((int32_t)L_4) > ((int32_t)0))? 1 : 0)) == ((int32_t)0))? 1 : 0); } } // System.Boolean System.Version::op_GreaterThanOrEqual(System.Version,System.Version) extern "C" bool Version_op_GreaterThanOrEqual_m474945801 (RuntimeObject * __this /* static, unused */, Version_t3456873960 * ___v10, Version_t3456873960 * ___v21, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Version_op_GreaterThanOrEqual_m474945801_MetadataUsageId); s_Il2CppMethodInitialized = true; } { Version_t3456873960 * L_0 = ___v21; Version_t3456873960 * L_1 = ___v10; IL2CPP_RUNTIME_CLASS_INIT(Version_t3456873960_il2cpp_TypeInfo_var); bool L_2 = Version_op_LessThanOrEqual_m666140174(NULL /*static, unused*/, L_0, L_1, /*hidden argument*/NULL); return L_2; } } // System.Void System.Version::.cctor() extern "C" void Version__cctor_m3568671087 (RuntimeObject * __this /* static, unused */, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (Version__cctor_m3568671087_MetadataUsageId); s_Il2CppMethodInitialized = true; } { CharU5BU5D_t3528271667* L_0 = (CharU5BU5D_t3528271667*)SZArrayNew(CharU5BU5D_t3528271667_il2cpp_TypeInfo_var, (uint32_t)1); CharU5BU5D_t3528271667* L_1 = L_0; NullCheck(L_1); (L_1)->SetAt(static_cast<il2cpp_array_size_t>(0), (Il2CppChar)((int32_t)46)); ((Version_t3456873960_StaticFields*)il2cpp_codegen_static_fields_for(Version_t3456873960_il2cpp_TypeInfo_var))->set_SeparatorsArray_4(L_1); return; } } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Void System.WeakReference::AllocateHandle(System.Object) extern "C" void WeakReference_AllocateHandle_m1478975559 (WeakReference_t1334886716 * __this, RuntimeObject * ___target0, const RuntimeMethod* method) { { bool L_0 = __this->get_isLongReference_0(); if (!L_0) { goto IL_0016; } } { RuntimeObject * L_1 = ___target0; GCHandle_t3351438187 L_2 = GCHandle_Alloc_m3823409740(NULL /*static, unused*/, L_1, 1, /*hidden argument*/NULL); __this->set_gcHandle_1(L_2); return; } IL_0016: { RuntimeObject * L_3 = ___target0; GCHandle_t3351438187 L_4 = GCHandle_Alloc_m3823409740(NULL /*static, unused*/, L_3, 0, /*hidden argument*/NULL); __this->set_gcHandle_1(L_4); return; } } // System.Void System.WeakReference::.ctor(System.Object) extern "C" void WeakReference__ctor_m2401547918 (WeakReference_t1334886716 * __this, RuntimeObject * ___target0, const RuntimeMethod* method) { { RuntimeObject * L_0 = ___target0; WeakReference__ctor_m1054065938(__this, L_0, (bool)0, /*hidden argument*/NULL); return; } } // System.Void System.WeakReference::.ctor(System.Object,System.Boolean) extern "C" void WeakReference__ctor_m1054065938 (WeakReference_t1334886716 * __this, RuntimeObject * ___target0, bool ___trackResurrection1, const RuntimeMethod* method) { { Object__ctor_m297566312(__this, /*hidden argument*/NULL); bool L_0 = ___trackResurrection1; __this->set_isLongReference_0(L_0); RuntimeObject * L_1 = ___target0; WeakReference_AllocateHandle_m1478975559(__this, L_1, /*hidden argument*/NULL); return; } } // System.Void System.WeakReference::.ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) extern "C" void WeakReference__ctor_m1244067698 (WeakReference_t1334886716 * __this, SerializationInfo_t950877179 * ___info0, StreamingContext_t3711869237 ___context1, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (WeakReference__ctor_m1244067698_MetadataUsageId); s_Il2CppMethodInitialized = true; } RuntimeObject * V_0 = NULL; { Object__ctor_m297566312(__this, /*hidden argument*/NULL); SerializationInfo_t950877179 * L_0 = ___info0; if (L_0) { goto IL_0014; } } { ArgumentNullException_t1615371798 * L_1 = (ArgumentNullException_t1615371798 *)il2cpp_codegen_object_new(ArgumentNullException_t1615371798_il2cpp_TypeInfo_var); ArgumentNullException__ctor_m1170824041(L_1, _stringLiteral79347, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_1, NULL, WeakReference__ctor_m1244067698_RuntimeMethod_var); } IL_0014: { SerializationInfo_t950877179 * L_2 = ___info0; NullCheck(L_2); bool L_3 = SerializationInfo_GetBoolean_m1756153320(L_2, _stringLiteral3234942771, /*hidden argument*/NULL); __this->set_isLongReference_0(L_3); SerializationInfo_t950877179 * L_4 = ___info0; RuntimeTypeHandle_t3027515415 L_5 = { reinterpret_cast<intptr_t> (RuntimeObject_0_0_0_var) }; IL2CPP_RUNTIME_CLASS_INIT(Type_t_il2cpp_TypeInfo_var); Type_t * L_6 = Type_GetTypeFromHandle_m1620074514(NULL /*static, unused*/, L_5, /*hidden argument*/NULL); NullCheck(L_4); RuntimeObject * L_7 = SerializationInfo_GetValue_m42271953(L_4, _stringLiteral2922588279, L_6, /*hidden argument*/NULL); V_0 = L_7; RuntimeObject * L_8 = V_0; WeakReference_AllocateHandle_m1478975559(__this, L_8, /*hidden argument*/NULL); return; } } // System.Boolean System.WeakReference::get_IsAlive() extern "C" bool WeakReference_get_IsAlive_m1867740323 (WeakReference_t1334886716 * __this, const RuntimeMethod* method) { { RuntimeObject * L_0 = VirtFuncInvoker0< RuntimeObject * >::Invoke(6 /* System.Object System.WeakReference::get_Target() */, __this); return (bool)((!(((RuntimeObject*)(RuntimeObject *)L_0) <= ((RuntimeObject*)(RuntimeObject *)NULL)))? 1 : 0); } } // System.Object System.WeakReference::get_Target() extern "C" RuntimeObject * WeakReference_get_Target_m168713953 (WeakReference_t1334886716 * __this, const RuntimeMethod* method) { { GCHandle_t3351438187 * L_0 = __this->get_address_of_gcHandle_1(); bool L_1 = GCHandle_get_IsAllocated_m1058226959((GCHandle_t3351438187 *)L_0, /*hidden argument*/NULL); if (L_1) { goto IL_000f; } } { return NULL; } IL_000f: { GCHandle_t3351438187 * L_2 = __this->get_address_of_gcHandle_1(); RuntimeObject * L_3 = GCHandle_get_Target_m1824973883((GCHandle_t3351438187 *)L_2, /*hidden argument*/NULL); return L_3; } } // System.Boolean System.WeakReference::get_TrackResurrection() extern "C" bool WeakReference_get_TrackResurrection_m942701017 (WeakReference_t1334886716 * __this, const RuntimeMethod* method) { { bool L_0 = __this->get_isLongReference_0(); return L_0; } } // System.Void System.WeakReference::Finalize() extern "C" void WeakReference_Finalize_m2841826116 (WeakReference_t1334886716 * __this, const RuntimeMethod* method) { Exception_t * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); int32_t __leave_target = 0; NO_UNUSED_WARNING (__leave_target); IL_0000: try { // begin try (depth: 1) GCHandle_t3351438187 * L_0 = __this->get_address_of_gcHandle_1(); GCHandle_Free_m1457699368((GCHandle_t3351438187 *)L_0, /*hidden argument*/NULL); IL2CPP_LEAVE(0x14, FINALLY_000d); } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __last_unhandled_exception = (Exception_t *)e.ex; goto FINALLY_000d; } FINALLY_000d: { // begin finally (depth: 1) Object_Finalize_m3076187857(__this, /*hidden argument*/NULL); IL2CPP_END_FINALLY(13) } // end finally (depth: 1) IL2CPP_CLEANUP(13) { IL2CPP_JUMP_TBL(0x14, IL_0014) IL2CPP_RETHROW_IF_UNHANDLED(Exception_t *) } IL_0014: { return; } } // System.Void System.WeakReference::GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext) extern "C" void WeakReference_GetObjectData_m2192383095 (WeakReference_t1334886716 * __this, SerializationInfo_t950877179 * ___info0, StreamingContext_t3711869237 ___context1, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (WeakReference_GetObjectData_m2192383095_MetadataUsageId); s_Il2CppMethodInitialized = true; } Exception_t * __last_unhandled_exception = 0; NO_UNUSED_WARNING (__last_unhandled_exception); Exception_t * __exception_local = 0; NO_UNUSED_WARNING (__exception_local); int32_t __leave_target = 0; NO_UNUSED_WARNING (__leave_target); { SerializationInfo_t950877179 * L_0 = ___info0; if (L_0) { goto IL_000e; } } { ArgumentNullException_t1615371798 * L_1 = (ArgumentNullException_t1615371798 *)il2cpp_codegen_object_new(ArgumentNullException_t1615371798_il2cpp_TypeInfo_var); ArgumentNullException__ctor_m1170824041(L_1, _stringLiteral79347, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_1, NULL, WeakReference_GetObjectData_m2192383095_RuntimeMethod_var); } IL_000e: { SerializationInfo_t950877179 * L_2 = ___info0; bool L_3 = VirtFuncInvoker0< bool >::Invoke(7 /* System.Boolean System.WeakReference::get_TrackResurrection() */, __this); NullCheck(L_2); SerializationInfo_AddValue_m3427199315(L_2, _stringLiteral3234942771, L_3, /*hidden argument*/NULL); } IL_001f: try { // begin try (depth: 1) SerializationInfo_t950877179 * L_4 = ___info0; RuntimeObject * L_5 = VirtFuncInvoker0< RuntimeObject * >::Invoke(6 /* System.Object System.WeakReference::get_Target() */, __this); NullCheck(L_4); SerializationInfo_AddValue_m2872281893(L_4, _stringLiteral2922588279, L_5, /*hidden argument*/NULL); goto IL_0041; } // end try (depth: 1) catch(Il2CppExceptionWrapper& e) { __exception_local = (Exception_t *)e.ex; if(il2cpp_codegen_class_is_assignable_from (Exception_t_il2cpp_TypeInfo_var, il2cpp_codegen_object_class(e.ex))) goto CATCH_0032; throw e; } CATCH_0032: { // begin catch(System.Exception) SerializationInfo_t950877179 * L_6 = ___info0; NullCheck(L_6); SerializationInfo_AddValue_m2872281893(L_6, _stringLiteral2922588279, NULL, /*hidden argument*/NULL); goto IL_0041; } // end catch (depth: 1) IL_0041: { return; } } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Void System.WindowsConsoleDriver::.ctor() extern "C" void WindowsConsoleDriver__ctor_m141100690 (WindowsConsoleDriver_t3991887195 * __this, const RuntimeMethod* method) { ConsoleScreenBufferInfo_t3095351730 V_0; memset(&V_0, 0, sizeof(V_0)); { Object__ctor_m297566312(__this, /*hidden argument*/NULL); intptr_t L_0 = WindowsConsoleDriver_GetStdHandle_m23119533(NULL /*static, unused*/, ((int32_t)-11), /*hidden argument*/NULL); __this->set_outputHandle_1(L_0); intptr_t L_1 = WindowsConsoleDriver_GetStdHandle_m23119533(NULL /*static, unused*/, ((int32_t)-10), /*hidden argument*/NULL); __this->set_inputHandle_0(L_1); il2cpp_codegen_initobj((&V_0), sizeof(ConsoleScreenBufferInfo_t3095351730 )); intptr_t L_2 = __this->get_outputHandle_1(); WindowsConsoleDriver_GetConsoleScreenBufferInfo_m3609341087(NULL /*static, unused*/, L_2, (ConsoleScreenBufferInfo_t3095351730 *)(&V_0), /*hidden argument*/NULL); ConsoleScreenBufferInfo_t3095351730 L_3 = V_0; int16_t L_4 = L_3.get_Attribute_2(); __this->set_defaultAttribute_2(L_4); return; } } // System.ConsoleKeyInfo System.WindowsConsoleDriver::ReadKey(System.Boolean) extern "C" ConsoleKeyInfo_t1802691652 WindowsConsoleDriver_ReadKey_m209631140 (WindowsConsoleDriver_t3991887195 * __this, bool ___intercept0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (WindowsConsoleDriver_ReadKey_m209631140_MetadataUsageId); s_Il2CppMethodInitialized = true; } int32_t V_0 = 0; InputRecord_t2660212290 V_1; memset(&V_1, 0, sizeof(V_1)); bool V_2 = false; bool V_3 = false; bool V_4 = false; { il2cpp_codegen_initobj((&V_1), sizeof(InputRecord_t2660212290 )); } IL_0008: { intptr_t L_0 = __this->get_inputHandle_0(); bool L_1 = WindowsConsoleDriver_ReadConsoleInput_m1790694890(NULL /*static, unused*/, L_0, (InputRecord_t2660212290 *)(&V_1), 1, (int32_t*)(&V_0), /*hidden argument*/NULL); if (L_1) { goto IL_0034; } } { IL2CPP_RUNTIME_CLASS_INIT(Marshal_t1757017490_il2cpp_TypeInfo_var); int32_t L_2 = Marshal_GetLastWin32Error_m1272610344(NULL /*static, unused*/, /*hidden argument*/NULL); int32_t L_3 = L_2; RuntimeObject * L_4 = Box(Int32_t2950945753_il2cpp_TypeInfo_var, &L_3); String_t* L_5 = String_Concat_m904156431(NULL /*static, unused*/, _stringLiteral1071424308, L_4, /*hidden argument*/NULL); InvalidOperationException_t56020091 * L_6 = (InvalidOperationException_t56020091 *)il2cpp_codegen_object_new(InvalidOperationException_t56020091_il2cpp_TypeInfo_var); InvalidOperationException__ctor_m237278729(L_6, L_5, /*hidden argument*/NULL); IL2CPP_RAISE_MANAGED_EXCEPTION(L_6, NULL, WindowsConsoleDriver_ReadKey_m209631140_RuntimeMethod_var); } IL_0034: { InputRecord_t2660212290 L_7 = V_1; bool L_8 = L_7.get_KeyDown_1(); if (!L_8) { goto IL_0008; } } { InputRecord_t2660212290 L_9 = V_1; int16_t L_10 = L_9.get_EventType_0(); if ((!(((uint32_t)L_10) == ((uint32_t)1)))) { goto IL_0008; } } { InputRecord_t2660212290 L_11 = V_1; int16_t L_12 = L_11.get_VirtualKeyCode_3(); bool L_13 = WindowsConsoleDriver_IsModifierKey_m1974886538(NULL /*static, unused*/, L_12, /*hidden argument*/NULL); if (L_13) { goto IL_0008; } } { InputRecord_t2660212290 L_14 = V_1; int32_t L_15 = L_14.get_ControlKeyState_6(); V_2 = (bool)((!(((uint32_t)((int32_t)((int32_t)L_15&(int32_t)3))) <= ((uint32_t)0)))? 1 : 0); InputRecord_t2660212290 L_16 = V_1; int32_t L_17 = L_16.get_ControlKeyState_6(); V_3 = (bool)((!(((uint32_t)((int32_t)((int32_t)L_17&(int32_t)((int32_t)12)))) <= ((uint32_t)0)))? 1 : 0); InputRecord_t2660212290 L_18 = V_1; int32_t L_19 = L_18.get_ControlKeyState_6(); V_4 = (bool)((!(((uint32_t)((int32_t)((int32_t)L_19&(int32_t)((int32_t)16)))) <= ((uint32_t)0)))? 1 : 0); InputRecord_t2660212290 L_20 = V_1; Il2CppChar L_21 = L_20.get_Character_5(); InputRecord_t2660212290 L_22 = V_1; int16_t L_23 = L_22.get_VirtualKeyCode_3(); bool L_24 = V_4; bool L_25 = V_2; bool L_26 = V_3; ConsoleKeyInfo_t1802691652 L_27; memset(&L_27, 0, sizeof(L_27)); ConsoleKeyInfo__ctor_m535940175((&L_27), L_21, L_23, L_24, L_25, L_26, /*hidden argument*/NULL); return L_27; } } // System.Boolean System.WindowsConsoleDriver::IsModifierKey(System.Int16) extern "C" bool WindowsConsoleDriver_IsModifierKey_m1974886538 (RuntimeObject * __this /* static, unused */, int16_t ___virtualKeyCode0, const RuntimeMethod* method) { { int16_t L_0 = ___virtualKeyCode0; if ((!(((uint32_t)((int32_t)il2cpp_codegen_subtract((int32_t)L_0, (int32_t)((int32_t)16)))) > ((uint32_t)2)))) { goto IL_0016; } } { int16_t L_1 = ___virtualKeyCode0; if ((((int32_t)L_1) == ((int32_t)((int32_t)20)))) { goto IL_0016; } } { int16_t L_2 = ___virtualKeyCode0; if ((!(((uint32_t)((int32_t)il2cpp_codegen_subtract((int32_t)L_2, (int32_t)((int32_t)144)))) <= ((uint32_t)1)))) { goto IL_0018; } } IL_0016: { return (bool)1; } IL_0018: { return (bool)0; } } // System.IntPtr System.WindowsConsoleDriver::GetStdHandle(System.Handles) extern "C" intptr_t WindowsConsoleDriver_GetStdHandle_m23119533 (RuntimeObject * __this /* static, unused */, int32_t ___handle0, const RuntimeMethod* method) { typedef intptr_t (DEFAULT_CALL *PInvokeFunc) (int32_t); static PInvokeFunc il2cppPInvokeFunc; if (il2cppPInvokeFunc == NULL) { int parameterSize = sizeof(int32_t); il2cppPInvokeFunc = il2cpp_codegen_resolve_pinvoke<PInvokeFunc>(IL2CPP_NATIVE_STRING("kernel32.dll"), "GetStdHandle", IL2CPP_CALL_DEFAULT, CHARSET_UNICODE, parameterSize, false); if (il2cppPInvokeFunc == NULL) { IL2CPP_RAISE_MANAGED_EXCEPTION(il2cpp_codegen_get_not_supported_exception("Unable to find method for p/invoke: 'GetStdHandle'"), NULL, NULL); } } // Native function invocation intptr_t returnValue = il2cppPInvokeFunc(___handle0); il2cpp_codegen_marshal_store_last_error(); return returnValue; } // System.Boolean System.WindowsConsoleDriver::GetConsoleScreenBufferInfo(System.IntPtr,System.ConsoleScreenBufferInfo&) extern "C" bool WindowsConsoleDriver_GetConsoleScreenBufferInfo_m3609341087 (RuntimeObject * __this /* static, unused */, intptr_t ___handle0, ConsoleScreenBufferInfo_t3095351730 * ___info1, const RuntimeMethod* method) { typedef int32_t (DEFAULT_CALL *PInvokeFunc) (intptr_t, ConsoleScreenBufferInfo_t3095351730 *); static PInvokeFunc il2cppPInvokeFunc; if (il2cppPInvokeFunc == NULL) { int parameterSize = sizeof(intptr_t) + sizeof(ConsoleScreenBufferInfo_t3095351730 *); il2cppPInvokeFunc = il2cpp_codegen_resolve_pinvoke<PInvokeFunc>(IL2CPP_NATIVE_STRING("kernel32.dll"), "GetConsoleScreenBufferInfo", IL2CPP_CALL_DEFAULT, CHARSET_UNICODE, parameterSize, false); if (il2cppPInvokeFunc == NULL) { IL2CPP_RAISE_MANAGED_EXCEPTION(il2cpp_codegen_get_not_supported_exception("Unable to find method for p/invoke: 'GetConsoleScreenBufferInfo'"), NULL, NULL); } } // Marshaling of parameter '___info1' to native representation ConsoleScreenBufferInfo_t3095351730 ____info1_empty = {}; // Native function invocation int32_t returnValue = il2cppPInvokeFunc(___handle0, (&____info1_empty)); il2cpp_codegen_marshal_store_last_error(); // Marshaling of parameter '___info1' back from native representation *___info1 = ____info1_empty; return static_cast<bool>(returnValue); } // System.Boolean System.WindowsConsoleDriver::ReadConsoleInput(System.IntPtr,System.InputRecord&,System.Int32,System.Int32&) extern "C" bool WindowsConsoleDriver_ReadConsoleInput_m1790694890 (RuntimeObject * __this /* static, unused */, intptr_t ___handle0, InputRecord_t2660212290 * ___record1, int32_t ___length2, int32_t* ___nread3, const RuntimeMethod* method) { typedef int32_t (DEFAULT_CALL *PInvokeFunc) (intptr_t, InputRecord_t2660212290_marshaled_pinvoke*, int32_t, int32_t*); static PInvokeFunc il2cppPInvokeFunc; if (il2cppPInvokeFunc == NULL) { int parameterSize = sizeof(intptr_t) + sizeof(InputRecord_t2660212290_marshaled_pinvoke*) + sizeof(int32_t) + sizeof(int32_t*); il2cppPInvokeFunc = il2cpp_codegen_resolve_pinvoke<PInvokeFunc>(IL2CPP_NATIVE_STRING("kernel32.dll"), "ReadConsoleInput", IL2CPP_CALL_DEFAULT, CHARSET_UNICODE, parameterSize, false); if (il2cppPInvokeFunc == NULL) { IL2CPP_RAISE_MANAGED_EXCEPTION(il2cpp_codegen_get_not_supported_exception("Unable to find method for p/invoke: 'ReadConsoleInput'"), NULL, NULL); } } // Marshaling of parameter '___record1' to native representation InputRecord_t2660212290_marshaled_pinvoke ____record1_empty = {}; InputRecord_t2660212290_marshaled_pinvoke* ____record1_marshaled = &____record1_empty; // Marshaling of parameter '___nread3' to native representation int32_t ____nread3_empty = 0; // Native function invocation int32_t returnValue = il2cppPInvokeFunc(___handle0, ____record1_marshaled, ___length2, (&____nread3_empty)); il2cpp_codegen_marshal_store_last_error(); // Marshaling of parameter '___record1' back from native representation InputRecord_t2660212290 _____record1_marshaled_unmarshaled_dereferenced; memset(&_____record1_marshaled_unmarshaled_dereferenced, 0, sizeof(_____record1_marshaled_unmarshaled_dereferenced)); InputRecord_t2660212290_marshal_pinvoke_back(*____record1_marshaled, _____record1_marshaled_unmarshaled_dereferenced); *___record1 = _____record1_marshaled_unmarshaled_dereferenced; // Marshaling cleanup of parameter '___record1' native representation InputRecord_t2660212290_marshal_pinvoke_cleanup(*____record1_marshaled); // Marshaling of parameter '___nread3' back from native representation *___nread3 = ____nread3_empty; return static_cast<bool>(returnValue); } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Void XamMac.CoreFoundation.CFHelpers::CFRelease(System.IntPtr) extern "C" void CFHelpers_CFRelease_m3206817372 (RuntimeObject * __this /* static, unused */, intptr_t ___obj0, const RuntimeMethod* method) { typedef void (DEFAULT_CALL *PInvokeFunc) (intptr_t); static PInvokeFunc il2cppPInvokeFunc; if (il2cppPInvokeFunc == NULL) { int parameterSize = sizeof(intptr_t); il2cppPInvokeFunc = il2cpp_codegen_resolve_pinvoke<PInvokeFunc>(IL2CPP_NATIVE_STRING("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation"), "CFRelease", IL2CPP_CALL_DEFAULT, CHARSET_UNICODE, parameterSize, false); if (il2cppPInvokeFunc == NULL) { IL2CPP_RAISE_MANAGED_EXCEPTION(il2cpp_codegen_get_not_supported_exception("Unable to find method for p/invoke: 'CFRelease'"), NULL, NULL); } } // Native function invocation il2cppPInvokeFunc(___obj0); } // System.IntPtr XamMac.CoreFoundation.CFHelpers::CFRetain(System.IntPtr) extern "C" intptr_t CFHelpers_CFRetain_m47160182 (RuntimeObject * __this /* static, unused */, intptr_t ___obj0, const RuntimeMethod* method) { typedef intptr_t (DEFAULT_CALL *PInvokeFunc) (intptr_t); static PInvokeFunc il2cppPInvokeFunc; if (il2cppPInvokeFunc == NULL) { int parameterSize = sizeof(intptr_t); il2cppPInvokeFunc = il2cpp_codegen_resolve_pinvoke<PInvokeFunc>(IL2CPP_NATIVE_STRING("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation"), "CFRetain", IL2CPP_CALL_DEFAULT, CHARSET_UNICODE, parameterSize, false); if (il2cppPInvokeFunc == NULL) { IL2CPP_RAISE_MANAGED_EXCEPTION(il2cpp_codegen_get_not_supported_exception("Unable to find method for p/invoke: 'CFRetain'"), NULL, NULL); } } // Native function invocation intptr_t returnValue = il2cppPInvokeFunc(___obj0); return returnValue; } // System.IntPtr XamMac.CoreFoundation.CFHelpers::CFStringGetLength(System.IntPtr) extern "C" intptr_t CFHelpers_CFStringGetLength_m1003035781 (RuntimeObject * __this /* static, unused */, intptr_t ___handle0, const RuntimeMethod* method) { typedef intptr_t (DEFAULT_CALL *PInvokeFunc) (intptr_t); static PInvokeFunc il2cppPInvokeFunc; if (il2cppPInvokeFunc == NULL) { int parameterSize = sizeof(intptr_t); il2cppPInvokeFunc = il2cpp_codegen_resolve_pinvoke<PInvokeFunc>(IL2CPP_NATIVE_STRING("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation"), "CFStringGetLength", IL2CPP_CALL_DEFAULT, CHARSET_UNICODE, parameterSize, false); if (il2cppPInvokeFunc == NULL) { IL2CPP_RAISE_MANAGED_EXCEPTION(il2cpp_codegen_get_not_supported_exception("Unable to find method for p/invoke: 'CFStringGetLength'"), NULL, NULL); } } // Native function invocation intptr_t returnValue = il2cppPInvokeFunc(___handle0); return returnValue; } // System.IntPtr XamMac.CoreFoundation.CFHelpers::CFStringGetCharactersPtr(System.IntPtr) extern "C" intptr_t CFHelpers_CFStringGetCharactersPtr_m1790634856 (RuntimeObject * __this /* static, unused */, intptr_t ___handle0, const RuntimeMethod* method) { typedef intptr_t (DEFAULT_CALL *PInvokeFunc) (intptr_t); static PInvokeFunc il2cppPInvokeFunc; if (il2cppPInvokeFunc == NULL) { int parameterSize = sizeof(intptr_t); il2cppPInvokeFunc = il2cpp_codegen_resolve_pinvoke<PInvokeFunc>(IL2CPP_NATIVE_STRING("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation"), "CFStringGetCharactersPtr", IL2CPP_CALL_DEFAULT, CHARSET_UNICODE, parameterSize, false); if (il2cppPInvokeFunc == NULL) { IL2CPP_RAISE_MANAGED_EXCEPTION(il2cpp_codegen_get_not_supported_exception("Unable to find method for p/invoke: 'CFStringGetCharactersPtr'"), NULL, NULL); } } // Native function invocation intptr_t returnValue = il2cppPInvokeFunc(___handle0); return returnValue; } // System.IntPtr XamMac.CoreFoundation.CFHelpers::CFStringGetCharacters(System.IntPtr,XamMac.CoreFoundation.CFHelpers/CFRange,System.IntPtr) extern "C" intptr_t CFHelpers_CFStringGetCharacters_m1195295518 (RuntimeObject * __this /* static, unused */, intptr_t ___handle0, CFRange_t1233619878 ___range1, intptr_t ___buffer2, const RuntimeMethod* method) { typedef intptr_t (DEFAULT_CALL *PInvokeFunc) (intptr_t, CFRange_t1233619878 , intptr_t); static PInvokeFunc il2cppPInvokeFunc; if (il2cppPInvokeFunc == NULL) { int parameterSize = sizeof(intptr_t) + sizeof(CFRange_t1233619878 ) + sizeof(intptr_t); il2cppPInvokeFunc = il2cpp_codegen_resolve_pinvoke<PInvokeFunc>(IL2CPP_NATIVE_STRING("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation"), "CFStringGetCharacters", IL2CPP_CALL_DEFAULT, CHARSET_UNICODE, parameterSize, false); if (il2cppPInvokeFunc == NULL) { IL2CPP_RAISE_MANAGED_EXCEPTION(il2cpp_codegen_get_not_supported_exception("Unable to find method for p/invoke: 'CFStringGetCharacters'"), NULL, NULL); } } // Native function invocation intptr_t returnValue = il2cppPInvokeFunc(___handle0, ___range1, ___buffer2); return returnValue; } // System.String XamMac.CoreFoundation.CFHelpers::FetchString(System.IntPtr) extern "C" String_t* CFHelpers_FetchString_m1875874129 (RuntimeObject * __this /* static, unused */, intptr_t ___handle0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (CFHelpers_FetchString_m1875874129_MetadataUsageId); s_Il2CppMethodInitialized = true; } int32_t V_0 = 0; intptr_t V_1; memset(&V_1, 0, sizeof(V_1)); intptr_t V_2; memset(&V_2, 0, sizeof(V_2)); CFRange_t1233619878 V_3; memset(&V_3, 0, sizeof(V_3)); String_t* G_B6_0 = NULL; String_t* G_B5_0 = NULL; { intptr_t L_0 = ___handle0; bool L_1 = IntPtr_op_Equality_m408849716(NULL /*static, unused*/, L_0, (intptr_t)(0), /*hidden argument*/NULL); if (!L_1) { goto IL_000f; } } { return (String_t*)NULL; } IL_000f: { intptr_t L_2 = ___handle0; intptr_t L_3 = CFHelpers_CFStringGetLength_m1003035781(NULL /*static, unused*/, L_2, /*hidden argument*/NULL); int32_t L_4 = IntPtr_op_Explicit_m4220076518(NULL /*static, unused*/, L_3, /*hidden argument*/NULL); V_0 = L_4; intptr_t L_5 = ___handle0; intptr_t L_6 = CFHelpers_CFStringGetCharactersPtr_m1790634856(NULL /*static, unused*/, L_5, /*hidden argument*/NULL); V_1 = L_6; V_2 = (intptr_t)(0); intptr_t L_7 = V_1; bool L_8 = IntPtr_op_Equality_m408849716(NULL /*static, unused*/, L_7, (intptr_t)(0), /*hidden argument*/NULL); if (!L_8) { goto IL_0052; } } { int32_t L_9 = V_0; CFRange__ctor_m1242434219((CFRange_t1233619878 *)(&V_3), 0, L_9, /*hidden argument*/NULL); int32_t L_10 = V_0; IL2CPP_RUNTIME_CLASS_INIT(Marshal_t1757017490_il2cpp_TypeInfo_var); intptr_t L_11 = Marshal_AllocCoTaskMem_m1327939722(NULL /*static, unused*/, ((int32_t)il2cpp_codegen_multiply((int32_t)L_10, (int32_t)2)), /*hidden argument*/NULL); V_2 = L_11; intptr_t L_12 = ___handle0; CFRange_t1233619878 L_13 = V_3; intptr_t L_14 = V_2; CFHelpers_CFStringGetCharacters_m1195295518(NULL /*static, unused*/, L_12, L_13, L_14, /*hidden argument*/NULL); intptr_t L_15 = V_2; V_1 = L_15; } IL_0052: { intptr_t L_16 = V_1; void* L_17 = IntPtr_op_Explicit_m2520637223(NULL /*static, unused*/, L_16, /*hidden argument*/NULL); int32_t L_18 = V_0; String_t* L_19 = String_CreateString_m3400201881(NULL, (Il2CppChar*)(Il2CppChar*)L_17, 0, L_18, /*hidden argument*/NULL); intptr_t L_20 = V_2; bool L_21 = IntPtr_op_Inequality_m3063970704(NULL /*static, unused*/, L_20, (intptr_t)(0), /*hidden argument*/NULL); G_B5_0 = L_19; if (!L_21) { G_B6_0 = L_19; goto IL_0072; } } { intptr_t L_22 = V_2; IL2CPP_RUNTIME_CLASS_INIT(Marshal_t1757017490_il2cpp_TypeInfo_var); Marshal_FreeCoTaskMem_m3753155979(NULL /*static, unused*/, L_22, /*hidden argument*/NULL); G_B6_0 = G_B5_0; } IL_0072: { return G_B6_0; } } // System.IntPtr XamMac.CoreFoundation.CFHelpers::CFDataGetLength(System.IntPtr) extern "C" intptr_t CFHelpers_CFDataGetLength_m3730685275 (RuntimeObject * __this /* static, unused */, intptr_t ___handle0, const RuntimeMethod* method) { typedef intptr_t (DEFAULT_CALL *PInvokeFunc) (intptr_t); static PInvokeFunc il2cppPInvokeFunc; if (il2cppPInvokeFunc == NULL) { int parameterSize = sizeof(intptr_t); il2cppPInvokeFunc = il2cpp_codegen_resolve_pinvoke<PInvokeFunc>(IL2CPP_NATIVE_STRING("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation"), "CFDataGetLength", IL2CPP_CALL_DEFAULT, CHARSET_UNICODE, parameterSize, false); if (il2cppPInvokeFunc == NULL) { IL2CPP_RAISE_MANAGED_EXCEPTION(il2cpp_codegen_get_not_supported_exception("Unable to find method for p/invoke: 'CFDataGetLength'"), NULL, NULL); } } // Native function invocation intptr_t returnValue = il2cppPInvokeFunc(___handle0); return returnValue; } // System.IntPtr XamMac.CoreFoundation.CFHelpers::CFDataGetBytePtr(System.IntPtr) extern "C" intptr_t CFHelpers_CFDataGetBytePtr_m1648767664 (RuntimeObject * __this /* static, unused */, intptr_t ___handle0, const RuntimeMethod* method) { typedef intptr_t (DEFAULT_CALL *PInvokeFunc) (intptr_t); static PInvokeFunc il2cppPInvokeFunc; if (il2cppPInvokeFunc == NULL) { int parameterSize = sizeof(intptr_t); il2cppPInvokeFunc = il2cpp_codegen_resolve_pinvoke<PInvokeFunc>(IL2CPP_NATIVE_STRING("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation"), "CFDataGetBytePtr", IL2CPP_CALL_DEFAULT, CHARSET_UNICODE, parameterSize, false); if (il2cppPInvokeFunc == NULL) { IL2CPP_RAISE_MANAGED_EXCEPTION(il2cpp_codegen_get_not_supported_exception("Unable to find method for p/invoke: 'CFDataGetBytePtr'"), NULL, NULL); } } // Native function invocation intptr_t returnValue = il2cppPInvokeFunc(___handle0); return returnValue; } // System.Byte[] XamMac.CoreFoundation.CFHelpers::FetchDataBuffer(System.IntPtr) extern "C" ByteU5BU5D_t4116647657* CFHelpers_FetchDataBuffer_m2260522698 (RuntimeObject * __this /* static, unused */, intptr_t ___handle0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (CFHelpers_FetchDataBuffer_m2260522698_MetadataUsageId); s_Il2CppMethodInitialized = true; } ByteU5BU5D_t4116647657* V_0 = NULL; { intptr_t L_0 = ___handle0; intptr_t L_1 = CFHelpers_CFDataGetLength_m3730685275(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); int32_t L_2 = IntPtr_op_Explicit_m4220076518(NULL /*static, unused*/, L_1, /*hidden argument*/NULL); ByteU5BU5D_t4116647657* L_3 = (ByteU5BU5D_t4116647657*)SZArrayNew(ByteU5BU5D_t4116647657_il2cpp_TypeInfo_var, (uint32_t)L_2); V_0 = L_3; intptr_t L_4 = ___handle0; intptr_t L_5 = CFHelpers_CFDataGetBytePtr_m1648767664(NULL /*static, unused*/, L_4, /*hidden argument*/NULL); ByteU5BU5D_t4116647657* L_6 = V_0; ByteU5BU5D_t4116647657* L_7 = V_0; NullCheck(L_7); IL2CPP_RUNTIME_CLASS_INIT(Marshal_t1757017490_il2cpp_TypeInfo_var); Marshal_Copy_m1222846562(NULL /*static, unused*/, L_5, L_6, 0, (((int32_t)((int32_t)(((RuntimeArray *)L_7)->max_length)))), /*hidden argument*/NULL); ByteU5BU5D_t4116647657* L_8 = V_0; return L_8; } } // System.IntPtr XamMac.CoreFoundation.CFHelpers::CFDataCreate(System.IntPtr,System.IntPtr,System.IntPtr) extern "C" intptr_t CFHelpers_CFDataCreate_m3875740957 (RuntimeObject * __this /* static, unused */, intptr_t ___allocator0, intptr_t ___bytes1, intptr_t ___length2, const RuntimeMethod* method) { typedef intptr_t (DEFAULT_CALL *PInvokeFunc) (intptr_t, intptr_t, intptr_t); static PInvokeFunc il2cppPInvokeFunc; if (il2cppPInvokeFunc == NULL) { int parameterSize = sizeof(intptr_t) + sizeof(intptr_t) + sizeof(intptr_t); il2cppPInvokeFunc = il2cpp_codegen_resolve_pinvoke<PInvokeFunc>(IL2CPP_NATIVE_STRING("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation"), "CFDataCreate", IL2CPP_CALL_DEFAULT, CHARSET_UNICODE, parameterSize, false); if (il2cppPInvokeFunc == NULL) { IL2CPP_RAISE_MANAGED_EXCEPTION(il2cpp_codegen_get_not_supported_exception("Unable to find method for p/invoke: 'CFDataCreate'"), NULL, NULL); } } // Native function invocation intptr_t returnValue = il2cppPInvokeFunc(___allocator0, ___bytes1, ___length2); return returnValue; } // System.IntPtr XamMac.CoreFoundation.CFHelpers::SecCertificateCreateWithData(System.IntPtr,System.IntPtr) extern "C" intptr_t CFHelpers_SecCertificateCreateWithData_m1682200427 (RuntimeObject * __this /* static, unused */, intptr_t ___allocator0, intptr_t ___cfData1, const RuntimeMethod* method) { typedef intptr_t (DEFAULT_CALL *PInvokeFunc) (intptr_t, intptr_t); static PInvokeFunc il2cppPInvokeFunc; if (il2cppPInvokeFunc == NULL) { int parameterSize = sizeof(intptr_t) + sizeof(intptr_t); il2cppPInvokeFunc = il2cpp_codegen_resolve_pinvoke<PInvokeFunc>(IL2CPP_NATIVE_STRING("/System/Library/Frameworks/Security.framework/Security"), "SecCertificateCreateWithData", IL2CPP_CALL_DEFAULT, CHARSET_UNICODE, parameterSize, false); if (il2cppPInvokeFunc == NULL) { IL2CPP_RAISE_MANAGED_EXCEPTION(il2cpp_codegen_get_not_supported_exception("Unable to find method for p/invoke: 'SecCertificateCreateWithData'"), NULL, NULL); } } // Native function invocation intptr_t returnValue = il2cppPInvokeFunc(___allocator0, ___cfData1); return returnValue; } // System.IntPtr XamMac.CoreFoundation.CFHelpers::CreateCertificateFromData(System.Byte[]) extern "C" intptr_t CFHelpers_CreateCertificateFromData_m702581168 (RuntimeObject * __this /* static, unused */, ByteU5BU5D_t4116647657* ___data0, const RuntimeMethod* method) { static bool s_Il2CppMethodInitialized; if (!s_Il2CppMethodInitialized) { il2cpp_codegen_initialize_method (CFHelpers_CreateCertificateFromData_m702581168_MetadataUsageId); s_Il2CppMethodInitialized = true; } void* V_0 = NULL; ByteU5BU5D_t4116647657* V_1 = NULL; intptr_t V_2; memset(&V_2, 0, sizeof(V_2)); intptr_t G_B8_0; memset(&G_B8_0, 0, sizeof(G_B8_0)); intptr_t G_B7_0; memset(&G_B7_0, 0, sizeof(G_B7_0)); { ByteU5BU5D_t4116647657* L_0 = ___data0; ByteU5BU5D_t4116647657* L_1 = L_0; V_1 = L_1; if (!L_1) { goto IL_000a; } } { ByteU5BU5D_t4116647657* L_2 = V_1; NullCheck(L_2); if ((((int32_t)((int32_t)(((RuntimeArray *)L_2)->max_length))))) { goto IL_000f; } } IL_000a: { V_0 = (void*)(((uintptr_t)0)); goto IL_0018; } IL_000f: { ByteU5BU5D_t4116647657* L_3 = V_1; NullCheck(L_3); V_0 = (void*)(((uintptr_t)((L_3)->GetAddressAt(static_cast<il2cpp_array_size_t>(0))))); } IL_0018: { void* L_4 = V_0; intptr_t L_5 = IntPtr_op_Explicit_m536245531(NULL /*static, unused*/, (void*)(void*)L_4, /*hidden argument*/NULL); ByteU5BU5D_t4116647657* L_6 = ___data0; NullCheck(L_6); intptr_t L_7; memset(&L_7, 0, sizeof(L_7)); IntPtr__ctor_m987082960((&L_7), (((int32_t)((int32_t)(((RuntimeArray *)L_6)->max_length)))), /*hidden argument*/NULL); intptr_t L_8 = CFHelpers_CFDataCreate_m3875740957(NULL /*static, unused*/, (intptr_t)(0), L_5, L_7, /*hidden argument*/NULL); V_2 = L_8; intptr_t L_9 = V_2; bool L_10 = IntPtr_op_Equality_m408849716(NULL /*static, unused*/, L_9, (intptr_t)(0), /*hidden argument*/NULL); if (!L_10) { goto IL_0044; } } { return (intptr_t)(0); } IL_0044: { intptr_t L_11 = V_2; intptr_t L_12 = CFHelpers_SecCertificateCreateWithData_m1682200427(NULL /*static, unused*/, (intptr_t)(0), L_11, /*hidden argument*/NULL); intptr_t L_13 = V_2; bool L_14 = IntPtr_op_Inequality_m3063970704(NULL /*static, unused*/, L_13, (intptr_t)(0), /*hidden argument*/NULL); G_B7_0 = L_12; if (!L_14) { G_B8_0 = L_12; goto IL_0062; } } { intptr_t L_15 = V_2; CFHelpers_CFRelease_m3206817372(NULL /*static, unused*/, L_15, /*hidden argument*/NULL); G_B8_0 = G_B7_0; } IL_0062: { return G_B8_0; } } #ifdef __clang__ #pragma clang diagnostic pop #endif #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Void XamMac.CoreFoundation.CFHelpers/CFRange::.ctor(System.Int32,System.Int32) extern "C" void CFRange__ctor_m1242434219 (CFRange_t1233619878 * __this, int32_t ___loc0, int32_t ___len1, const RuntimeMethod* method) { { int32_t L_0 = ___loc0; int32_t L_1 = ___len1; CFRange__ctor_m3401693388((CFRange_t1233619878 *)__this, (((int64_t)((int64_t)L_0))), (((int64_t)((int64_t)L_1))), /*hidden argument*/NULL); return; } } extern "C" void CFRange__ctor_m1242434219_AdjustorThunk (RuntimeObject * __this, int32_t ___loc0, int32_t ___len1, const RuntimeMethod* method) { CFRange_t1233619878 * _thisAdjusted = reinterpret_cast<CFRange_t1233619878 *>(__this + 1); CFRange__ctor_m1242434219(_thisAdjusted, ___loc0, ___len1, method); } // System.Void XamMac.CoreFoundation.CFHelpers/CFRange::.ctor(System.Int64,System.Int64) extern "C" void CFRange__ctor_m3401693388 (CFRange_t1233619878 * __this, int64_t ___l0, int64_t ___len1, const RuntimeMethod* method) { { int64_t L_0 = ___l0; intptr_t L_1 = IntPtr_op_Explicit_m1593085246(NULL /*static, unused*/, L_0, /*hidden argument*/NULL); __this->set_loc_0(L_1); int64_t L_2 = ___len1; intptr_t L_3 = IntPtr_op_Explicit_m1593085246(NULL /*static, unused*/, L_2, /*hidden argument*/NULL); __this->set_len_1(L_3); return; } } extern "C" void CFRange__ctor_m3401693388_AdjustorThunk (RuntimeObject * __this, int64_t ___l0, int64_t ___len1, const RuntimeMethod* method) { CFRange_t1233619878 * _thisAdjusted = reinterpret_cast<CFRange_t1233619878 *>(__this + 1); CFRange__ctor_m3401693388(_thisAdjusted, ___l0, ___len1, method); } #ifdef __clang__ #pragma clang diagnostic pop #endif
40.760793
473
0.799416
09cfd0af802e077f58331b449d3787aa8dbb69a4
666
cpp
C++
lib/rpkeys/base.cpp
seanhagen/macropad
3375e427f5606bec0d1b50ca44ac9140e686a6da
[ "MIT" ]
null
null
null
lib/rpkeys/base.cpp
seanhagen/macropad
3375e427f5606bec0d1b50ca44ac9140e686a6da
[ "MIT" ]
null
null
null
lib/rpkeys/base.cpp
seanhagen/macropad
3375e427f5606bec0d1b50ca44ac9140e686a6da
[ "MIT" ]
null
null
null
#include "base.h" /* Station::Station(void) { _setup(); } Station::Station(stationConfig conf) { _config = conf; _setup(); } */ RPKeyboard::RPKeyboard() { Serial.begin(115200); // while (!Serial) { delay(10); } // wait till serial port is opened delay(100); // RP2040 delay is not a bad idea Serial.println("Adafruit Macropad with RP2040"); } void RPKeyboard::setup(void) { // setupNeopixels(); // setupDisplay(); // setupSpeaker(); // setupKeys(); setupEncoder(); // // We will use I2C for scanning the Stemma QT port // Wire.begin(); } void RPKeyboard::loop(void) { loopEncoder(); // loopNeopixels(); // loopDisplay(); }
18.5
74
0.633634
09d052200eb4a0a2e2dce198359ddb925f636a40
22
cpp
C++
Coffee/src/CoffeePCH.cpp
SentientCoffee/HazelnutEngine
b1e9e29d50119a2882d840c47078363db71b266b
[ "Apache-2.0" ]
1
2020-07-19T20:07:25.000Z
2020-07-19T20:07:25.000Z
Coffee/src/CoffeePCH.cpp
SentientCoffee/CoffeeEngine
b1e9e29d50119a2882d840c47078363db71b266b
[ "Apache-2.0" ]
null
null
null
Coffee/src/CoffeePCH.cpp
SentientCoffee/CoffeeEngine
b1e9e29d50119a2882d840c47078363db71b266b
[ "Apache-2.0" ]
null
null
null
#include "CoffeePCH.h"
22
22
0.772727
09d26388b8b89fbfaa1d1e750faa1902c5880c87
897
cpp
C++
sources/RandNano.cpp
usernameHed/Worms
35ee28362b936b46d24e7c911a46a2cfd615128b
[ "MIT" ]
null
null
null
sources/RandNano.cpp
usernameHed/Worms
35ee28362b936b46d24e7c911a46a2cfd615128b
[ "MIT" ]
null
null
null
sources/RandNano.cpp
usernameHed/Worms
35ee28362b936b46d24e7c911a46a2cfd615128b
[ "MIT" ]
null
null
null
#include "RandNano.hh" #include <cstdlib> #include <ctime> #include <stdio.h> #include <stdlib.h> #include <time.h> #ifdef _WIN32 #include <Windows.h> #endif #ifdef __MACH__ #include <mach/clock.h> #include <mach/mach.h> #endif RandNano::RandNano() { this->setRandInNano(); } RandNano::~RandNano() { } void RandNano::setRandInNano() const { #ifdef __MACH__ // OS X does not have clock_gettime, use clock_get_time struct timespec ts; clock_serv_t cclock; mach_timespec_t mts; host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock); clock_get_time(cclock, &mts); mach_port_deallocate(mach_task_self(), cclock); ts.tv_sec = mts.tv_sec; ts.tv_nsec = mts.tv_nsec; srand((time_t)ts.tv_nsec); #elif _WIN32 SYSTEMTIME st; GetSystemTime(&st); srand((time_t)st.wMilliseconds); #else struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); srand((time_t)ts.tv_nsec); #endif }
18.6875
71
0.740245
09d28960d296bbb22f4969a271c8ac4a9ca05326
3,882
hpp
C++
src/types/ds/circular_queue.hpp
iamantony/CppNotes
2707db6560ad80b0e5e286a04b2d46e5c0280b3f
[ "MIT" ]
2
2020-07-31T14:13:56.000Z
2021-02-03T09:51:43.000Z
src/types/ds/circular_queue.hpp
iamantony/CppNotes
2707db6560ad80b0e5e286a04b2d46e5c0280b3f
[ "MIT" ]
28
2015-09-22T07:38:21.000Z
2018-10-02T11:00:58.000Z
src/types/ds/circular_queue.hpp
iamantony/CppNotes
2707db6560ad80b0e5e286a04b2d46e5c0280b3f
[ "MIT" ]
2
2018-10-11T14:10:50.000Z
2021-02-27T08:53:50.000Z
#ifndef CIRCULAR_QUEUE_HPP #define CIRCULAR_QUEUE_HPP /* https://leetcode.com/problems/design-circular-queue/description/ Design your implementation of the circular queue. The circular queue is a linear data structure in which the operations are performed based on FIFO (First In First Out) principle and the last position is connected back to the first position to make a circle. It is also called "Ring Buffer". One of the benefits of the circular queue is that we can make use of the spaces in front of the queue. In a normal queue, once the queue becomes full, we cannot insert the next element even if there is a space in front of the queue. But using the circular queue, we can use the space to store new values. Your implementation should support following operations: MyCircularQueue(k): Constructor, set the size of the queue to be k. Front: Get the front item from the queue. If the queue is empty, return -1. Rear: Get the last item from the queue. If the queue is empty, return -1. enQueue(value): Insert an element into the circular queue. Return true if the operation is successful. deQueue(): Delete an element from the circular queue. Return true if the operation is successful. isEmpty(): Checks whether the circular queue is empty or not. isFull(): Checks whether the circular queue is full or not. Example: MyCircularQueue circularQueue = new MycircularQueue(3); // set the size to be 3 circularQueue.enQueue(1); // return true circularQueue.enQueue(2); // return true circularQueue.enQueue(3); // return true circularQueue.enQueue(4); // return false, the queue is full circularQueue.Rear(); // return 3 circularQueue.isFull(); // return true circularQueue.deQueue(); // return true circularQueue.enQueue(4); // return true circularQueue.Rear(); // return 4 Note: All values will be in the range of [0, 1000]. The number of operations will be in the range of [1, 1000]. Please do not use the built-in Queue library. */ #include <vector> #include <exception> namespace Types::DS { // TODO: add tests template <typename T> class CircularQueue { std::vector<T> m_data; bool m_full = false; // Position of first element size_t m_start = 0; // Position one past the last element size_t m_end = 0; public: CircularQueue(const size_t& size) { m_data.resize(size, 0); } bool push(const T& value) { if (m_data.size() == 0 || isFull()) { return false; } // Check base case - queue is empty if (m_start == m_end) { m_data[m_start] = value; m_end = 1; } else { // Otherwise insert element to the end of the queue m_data[m_end++] = value; // Check if we need to move end position to the start of the vector m_end = (m_end >= m_data.size()) ? 0 : m_end; // Check if queue become full if (m_start == m_end) { m_full = true; } } return true; } bool pop() { if (isEmpty()) { return false; } ++m_start; m_full = false; if (m_start >= m_data.size()) { m_start = 0; } if (m_start == m_end) { m_start = m_end = 0; } return true; } T front() { if (isEmpty()) { throw std::logic_error("Circular queue is empty"); } return m_data[m_start]; } T back() { if (isEmpty()) { throw std::logic_error("Circular queue is empty"); } return (m_end > 0) ? m_data[m_end - 1] : m_data[m_data.size() - 1]; } bool isEmpty() { return m_data.size() == 0 || (!isFull() && m_start == m_end); } bool isFull() { return m_data.size() == 0 || m_full; } }; } #endif // CIRCULAR_QUEUE_HPP
27.338028
79
0.627769
09d83033574328c83b5c540bf4c080b54efd4fae
16,526
cc
C++
src/mshines_render.cc
fuzziqersoftware/realmz_dasm
fbfa118de5f232fd7169fbff13d434164a67ee90
[ "MIT" ]
1
2018-03-20T13:06:16.000Z
2018-03-20T13:06:16.000Z
src/mshines_render.cc
fuzziqersoftware/realmz_dasm
fbfa118de5f232fd7169fbff13d434164a67ee90
[ "MIT" ]
null
null
null
src/mshines_render.cc
fuzziqersoftware/realmz_dasm
fbfa118de5f232fd7169fbff13d434164a67ee90
[ "MIT" ]
null
null
null
#include <inttypes.h> #include <stdlib.h> #include <phosg/Encoding.hh> #include <phosg/Filesystem.hh> #include <phosg/Image.hh> #include <phosg/Strings.hh> #include <stdexcept> #include <vector> #include "IndexFormats/Formats.hh" #include "ResourceFile.hh" using namespace std; struct MonkeyShinesRoom { struct EnemyEntry { be_uint16_t y_pixels; be_uint16_t x_pixels; be_int16_t y_min; be_int16_t x_min; be_int16_t y_max; be_int16_t x_max; be_int16_t y_speed; // in pixels per frame be_int16_t x_speed; // in pixels per frame be_int16_t type; be_uint16_t flags; // Sprite flags are: // - increasing frames or cycling frames // - slow animation // - two sets horizontal // - two sets vertical // - normal sprite, energy drainer, or door } __attribute__((packed)); struct BonusEntry { be_uint16_t y_pixels; be_uint16_t x_pixels; be_int32_t unknown[3]; // these appear to be unused be_int16_t type; be_uint16_t id; } __attribute__((packed)); be_uint16_t enemy_count; be_uint16_t bonus_count; EnemyEntry enemies[10]; BonusEntry bonuses[25]; be_uint16_t tile_ids[0x20 * 0x14]; // width=32, height=20 be_uint16_t player_start_y; // unused except in rooms 1000 and 10000 be_uint16_t player_start_x; // unused except in rooms 1000 and 10000 be_uint16_t background_ppat_id; } __attribute__((packed)); struct MonkeyShinesWorld { be_uint16_t num_exit_keys; be_uint16_t num_bonus_keys; be_uint16_t num_bonuses; be_int16_t exit_door_room; be_int16_t bonus_door_room; // Hazard types are: // 1 - burned // 2 - electrocuted // 3 - bee sting // 4 - fall // 5 - monster be_uint16_t hazard_types[16]; uint8_t hazards_explode[16]; // really just an array of bools // Hazard death sounds are: // 12 - normal // 13 - death from long fall // 14 - death from bee sting // 15 - death from bomb // 16 - death by electrocution // 20 - death by lava be_uint16_t hazard_death_sounds[16]; // Explosion sounds can be any of the above or 18 (bomb explosion) be_uint16_t hazard_explosion_sounds[16]; }; vector<unordered_map<int16_t, pair<int16_t, int16_t>>> generate_room_placement_maps( const vector<int16_t>& room_ids) { unordered_set<int16_t> remaining_room_ids(room_ids.begin(), room_ids.end()); // The basic idea is that when Bonzo moves right or left out of a room, the // room number is increased or decreased by 1; when he moves up or down out of // a room, it's increased or decreased by 100. There's no notion of rooms // linking to each other; links are stored implicitly by the room IDs // (resource IDs). To convert this format into something we can actually use, // we have to find all the connected components of this graph. // It occurs to me that this function might be a good basic algorithms // interview question. // This recursive lambda adds a single room to a placement map, then uses the // flood-fill algorithm to find all the rooms it's connected to. This // declaration looks super-gross because lambdas can't be recursive if you // declare them with auto. Sigh... function<void(unordered_map<int16_t, pair<int16_t, int16_t>>&, int16_t room_id, int16_t x_offset, int16_t y_offset)> process_room = [&]( unordered_map<int16_t, pair<int16_t, int16_t>>& ret, int16_t room_id, int16_t x_offset, int16_t y_offset) { if (!remaining_room_ids.erase(room_id)) { return; } ret.emplace(room_id, make_pair(x_offset, y_offset)); process_room(ret, room_id - 1, x_offset - 1, y_offset); process_room(ret, room_id + 1, x_offset + 1, y_offset); process_room(ret, room_id - 100, x_offset, y_offset - 1); process_room(ret, room_id + 100, x_offset, y_offset + 1); }; // This function generates a placement map with nonnegative offsets that // contains the given room vector<unordered_map<int16_t, pair<int16_t, int16_t>>> ret; auto process_component = [&](int16_t start_room_id) { ret.emplace_back(); auto& placement_map = ret.back(); process_room(placement_map, start_room_id, 0, 0); if (placement_map.empty()) { ret.pop_back(); } else { // Make all offsets nonnegative int16_t delta_x = 0, delta_y = 0; for (const auto& it : placement_map) { if (it.second.first < delta_x) { delta_x = it.second.first; } if (it.second.second < delta_y) { delta_y = it.second.second; } } for (auto& it : placement_map) { it.second.first -= delta_x; it.second.second -= delta_y; } } }; // Start at room 1000 (for main level) and 10000 (for bonus level) and go // outward. Both of these start room IDs seem to be hardcoded process_component(1000); process_component(10000); // If there are any rooms left over, process them individually while (!remaining_room_ids.empty()) { size_t starting_size = remaining_room_ids.size(); process_component(*remaining_room_ids.begin()); if (remaining_room_ids.size() >= starting_size) { throw logic_error("did not make progress generating room placement maps"); } } return ret; } int main(int argc, char** argv) { if (argc < 2) { throw invalid_argument("no filename given"); } const string filename = argv[1]; const string out_prefix = (argc < 3) ? filename : argv[2]; ResourceFile rf(parse_resource_fork(load_file(filename + "/..namedfork/rsrc"))); const uint32_t room_type = 0x506C766C; // Plvl auto room_resource_ids = rf.all_resources_of_type(room_type); auto sprites_pict = rf.decode_PICT(130); // hardcoded ID for all worlds auto& sprites = sprites_pict.image; // Assemble index for animated sprites unordered_map<int16_t, pair<shared_ptr<const Image>, size_t>> enemy_image_locations; { size_t next_type_id = 0; for (int16_t id = 1000; ; id++) { if (!rf.resource_exists(RESOURCE_TYPE_PICT, id)) { break; } auto pict = rf.decode_PICT(id); shared_ptr<const Image> img(new Image(pict.image)); for (size_t z = 0; z < img->get_height(); z += 80) { enemy_image_locations.emplace(next_type_id, make_pair(img, z)); next_type_id++; } } } // Decode the default ppat (we'll use it if a room references a missing ppat, // which apparently happens quite a lot - it looks like the ppat id field used // to be the room id field and they just never updated it after implementing // the custom backgrounds feature) unordered_map<int16_t, const Image> background_ppat_cache; const Image* default_background_ppat = &background_ppat_cache.emplace(1000, rf.decode_ppat(1000).pattern).first->second; size_t component_number = 0; auto placement_maps = generate_room_placement_maps(room_resource_ids); for (const auto& placement_map : placement_maps) { // First figure out the width and height of this component uint16_t w_rooms = 0, h_rooms = 0; bool component_contains_start = false, component_contains_bonus_start = false; for (const auto& it : placement_map) { if (it.second.first >= w_rooms) { w_rooms = it.second.first + 1; } if (it.second.second >= h_rooms) { h_rooms = it.second.second + 1; } if (it.first == 1000) { component_contains_start = true; } else if (it.first == 10000) { component_contains_bonus_start = true; } } // Then render the rooms Image result(20 * 32 * w_rooms, 20 * 20 * h_rooms); result.clear(0x202020FF); for (auto it : placement_map) { int16_t room_id = it.first; size_t room_x = it.second.first; size_t room_y = it.second.second; size_t room_px = 20 * 32 * room_x; size_t room_py = 20 * 20 * room_y; string room_data = rf.get_resource(room_type, room_id)->data; if (room_data.size() != sizeof(MonkeyShinesRoom)) { fprintf(stderr, "warning: room 0x%04hX is not the correct size (expected %zu bytes, got %zu bytes)\n", room_id, sizeof(MonkeyShinesRoom), room_data.size()); result.fill_rect(room_px, room_py, 32 * 20, 20 * 20, 0xFF00FFFF); continue; } const auto* room = reinterpret_cast<const MonkeyShinesRoom*>(room_data.data()); // Render the appropriate ppat in the background of every room. We don't // use Image::blit() here just in case the room dimensions aren't a // multiple of the ppat dimensions const Image* background_ppat = nullptr; try { background_ppat = &background_ppat_cache.at(room->background_ppat_id); } catch (const out_of_range&) { try { auto ppat_id = room->background_ppat_id; background_ppat = &background_ppat_cache.emplace(ppat_id, rf.decode_ppat(room->background_ppat_id).pattern).first->second; } catch (const exception& e) { fprintf(stderr, "warning: room %hd uses ppat %hd but it can\'t be decoded (%s)\n", room_id, room->background_ppat_id.load(), e.what()); background_ppat = default_background_ppat; } } if (background_ppat) { for (size_t y = 0; y < 400; y++) { for (size_t x = 0; x < 640; x++) { uint32_t c = background_ppat->read_pixel(x % background_ppat->get_width(), y % background_ppat->get_height()); result.write_pixel(room_px + x, room_py + y, c); } } } else { result.fill_rect(room_px, room_py, 640, 400, 0xFF00FFFF); } // Render tiles. Each tile is 20x20 for (size_t y = 0; y < 20; y++) { for (size_t x = 0; x < 32; x++) { // Looks like there are 21 rows of sprites in PICT 130, with 16 on // each row uint16_t tile_id = room->tile_ids[x * 20 + y]; if (tile_id == 0) { continue; } tile_id--; size_t tile_x = 0xFFFFFFFF; size_t tile_y = 0xFFFFFFFF; if (tile_id < 0x90) { // <0x20: walls, <0x50: jump-through platforms, <0x90: scenery tile_x = tile_id % 16; tile_y = tile_id / 16; } else if (tile_id < 0xA0) { // 2-frame animated tiles tile_x = tile_id & 0x0F; tile_y = 11; } else if (tile_id < 0xB0) { // rollers (usually) tile_x = tile_id & 0x0F; tile_y = 15; } else if (tile_id < 0xB2) { // collapsing floor tile_x = 0; tile_y = 17 + (tile_id & 1); } else if (tile_id < 0xC0) { // 2-frame animated tiles tile_x = tile_id & 0x0F; tile_y = 11; } else if (tile_id < 0xD0) { // 2-frame animated tiles tile_x = tile_id & 0x0F; tile_y = 13; } else if (tile_id < 0xF0) { // more scenery tile_x = tile_id & 0x0F; tile_y = (tile_id - 0x40) / 16; } // TODO: there may be more cases than the above; figure them out if (tile_x == 0xFFFFFFFF || tile_y == 0xFFFFFFFF) { result.fill_rect(room_px + x * 20, room_py + y * 20, 20, 20, 0xFF00FFFF); fprintf(stderr, "warning: no known tile for %02hX (room %hd, x=%zu, y=%zu)\n", tile_id, room_id, x, y); } else { for (size_t py = 0; py < 20; py++) { for (size_t px = 0; px < 20; px++) { uint64_t r, g, b; sprites.read_pixel(tile_x * 20 + px, tile_y * 40 + py + 20, &r, &g, &b); if (r && g && b) { sprites.read_pixel(tile_x * 20 + px, tile_y * 40 + py, &r, &g, &b); result.write_pixel(room_px + x * 20 + px, room_py + y * 20 + py, r, g, b, 0xFF); } } } } } } // Render enemies for (size_t z = 0; z < room->enemy_count; z++) { // It looks like the y coords are off by 80 pixels because of the HUD, // which renders at the top. High-quality engineering! size_t enemy_px = room_px + room->enemies[z].x_pixels; size_t enemy_py = room_py + room->enemies[z].y_pixels - 80; try { const auto& image_loc = enemy_image_locations.at(room->enemies[z].type); const auto& enemy_pict = image_loc.first; size_t enemy_pict_py = image_loc.second; for (size_t py = 0; py < 40; py++) { for (size_t px = 0; px < 40; px++) { uint32_t c = enemy_pict->read_pixel(px, enemy_pict_py + py); uint32_t mc = enemy_pict->read_pixel(px, enemy_pict_py + py + 40); uint32_t ec = result.read_pixel(enemy_px + px, enemy_py + py); result.write_pixel(enemy_px + px, enemy_py + py, (c & mc) | (ec & ~mc)); } } } catch (const out_of_range&) { result.fill_rect(enemy_px, enemy_px, 20, 20, 0xFF8000FF); result.draw_text(enemy_px, enemy_px, 0x000000FF, "%04hX", room->enemies[z].type.load()); } // Draw a bounding box to show where its range of motion is size_t x_min = room->enemies[z].x_speed ? room->enemies[z].x_min : room->enemies[z].x_pixels; size_t x_max = (room->enemies[z].x_speed ? room->enemies[z].x_max : room->enemies[z].x_pixels) + 39; size_t y_min = (room->enemies[z].y_speed ? room->enemies[z].y_min : room->enemies[z].y_pixels) - 80; size_t y_max = (room->enemies[z].y_speed ? room->enemies[z].y_max : room->enemies[z].y_pixels) + 39 - 80; result.draw_horizontal_line(room_px + x_min, room_px + x_max, room_py + y_min, 0, 0xFF8000FF); result.draw_horizontal_line(room_px + x_min, room_px + x_max, room_py + y_max, 0, 0xFF8000FF); result.draw_vertical_line(room_px + x_min, room_py + y_min, room_py + y_max, 0, 0xFF8000FF); result.draw_vertical_line(room_px + x_max, room_py + y_min, room_py + y_max, 0, 0xFF8000FF); // Draw its initial velocity as a line from the center if (room->enemies[z].x_speed || room->enemies[z].y_speed) { result.fill_rect(enemy_px + 19, enemy_py + 19, 3, 3, 0xFF8000FF); result.draw_line(enemy_px + 20, enemy_py + 20, enemy_px + 20 + room->enemies[z].x_speed * 10, enemy_py + 20 + room->enemies[z].y_speed * 10, 0xFF8000FF); } } // Annotate bonuses with ids for (size_t z = 0; z < room->bonus_count; z++) { const auto& bonus = room->bonuses[z]; result.draw_text(room_px + bonus.x_pixels, room_py + bonus.y_pixels - 80, 0xFFFFFFFF, "%02hX", bonus.id.load()); } // If this is a starting room, mark the player start location with an // arrow and the label "START" if (room_id == 1000 || room_id == 10000) { size_t x_min = room->player_start_x; size_t x_max = room->player_start_x + 39; size_t y_min = room->player_start_y - 80; size_t y_max = room->player_start_y + 39 - 80; result.draw_horizontal_line(room_px + x_min, room_px + x_max, room_py + y_min, 0, 0x00FF80FF); result.draw_horizontal_line(room_px + x_min, room_px + x_max, room_py + y_max, 0, 0x00FF80FF); result.draw_vertical_line(room_px + x_min, room_py + y_min, room_py + y_max, 0, 0x00FF80FF); result.draw_vertical_line(room_px + x_max, room_py + y_min, room_py + y_max, 0, 0x00FF80FF); result.draw_text(room_px + x_min + 2, room_py + y_min + 2, 0xFFFFFFFF, 0x00000080, "START"); } result.draw_text(room_px + 2, room_py + 2, 0xFFFFFFFF, 0x00000080, "Room %hd", room_id); } string result_filename; if (component_contains_start && component_contains_bonus_start) { result_filename = out_prefix + "_world_and_bonus.bmp"; } else if (component_contains_start) { result_filename = out_prefix + "_world.bmp"; } else if (component_contains_bonus_start) { result_filename = out_prefix + "_bonus.bmp"; } else { result_filename = string_printf("%s_%zu.bmp", out_prefix.c_str(), component_number); component_number++; } result.save(result_filename.c_str(), Image::Format::WINDOWS_BITMAP); fprintf(stderr, "... %s\n", result_filename.c_str()); } return 0; }
38.432558
113
0.62084
09dbed8a7f6d0555307598f6c79b491a822cbca0
396
hpp
C++
src/backgroundParticles.hpp
minhoolee/SaveTheWorld
e9d65092237db38fa475d5e32d7b71c477d303dd
[ "BSD-3-Clause" ]
null
null
null
src/backgroundParticles.hpp
minhoolee/SaveTheWorld
e9d65092237db38fa475d5e32d7b71c477d303dd
[ "BSD-3-Clause" ]
null
null
null
src/backgroundParticles.hpp
minhoolee/SaveTheWorld
e9d65092237db38fa475d5e32d7b71c477d303dd
[ "BSD-3-Clause" ]
null
null
null
#ifndef BACKGROUND_PARTICLES_HPP #define BACKGROUND_PARTICLES_HPP #include <SFML/Graphics.hpp> #include <array> class BackgroundParticles { public: BackgroundParticles(int n); void animateParticlesIdle(); void animateParticlesMovement(); std::array<sf::CircleShape, 50> backgroundParticles; private: int num_particles; }; #endif // BACKGROUND_PARTICLES_HPP
18.857143
55
0.739899
09dda72d49223f6f6f3d62cb095ff8988e65c2b8
1,489
cpp
C++
src/generated/ldb_trooppagecondition_flags.cpp
Albeleon/liblcf
d9dd24d0026b3ab36adb291d205c405122a4332c
[ "MIT" ]
null
null
null
src/generated/ldb_trooppagecondition_flags.cpp
Albeleon/liblcf
d9dd24d0026b3ab36adb291d205c405122a4332c
[ "MIT" ]
null
null
null
src/generated/ldb_trooppagecondition_flags.cpp
Albeleon/liblcf
d9dd24d0026b3ab36adb291d205c405122a4332c
[ "MIT" ]
null
null
null
/* !!!! GENERATED FILE - DO NOT EDIT !!!! * -------------------------------------- * * This file is part of liblcf. Copyright (c) 2017 liblcf authors. * https://github.com/EasyRPG/liblcf - https://easyrpg.org * * liblcf is Free/Libre Open Source Software, released under the MIT License. * For the full copyright and license information, please view the COPYING * file that was distributed with this source code. */ /* * Headers */ #include "ldb_reader.h" #include "ldb_chunks.h" #include "reader_struct.h" // Read TroopPageCondition. typedef RPG::TroopPageCondition::Flags flags_type; template <> char const* const Flags<flags_type>::name("TroopPageCondition_Flags"); template <> const Flags<flags_type>::Flag* Flags<flags_type>::flags[] = { new Flags<flags_type>::Flag(&flags_type::switch_a, "switch_a"), new Flags<flags_type>::Flag(&flags_type::switch_b, "switch_b"), new Flags<flags_type>::Flag(&flags_type::variable, "variable"), new Flags<flags_type>::Flag(&flags_type::turn, "turn"), new Flags<flags_type>::Flag(&flags_type::fatigue, "fatigue"), new Flags<flags_type>::Flag(&flags_type::enemy_hp, "enemy_hp"), new Flags<flags_type>::Flag(&flags_type::actor_hp, "actor_hp"), new Flags<flags_type>::Flag(&flags_type::turn_enemy, "turn_enemy"), new Flags<flags_type>::Flag(&flags_type::turn_actor, "turn_actor"), new Flags<flags_type>::Flag(&flags_type::command_actor, "command_actor"), NULL }; template <> const uint32_t Flags<flags_type>::max_size = 2;
33.088889
77
0.709872
09df4b2eb1349a31d6bcc3ae7c01a67b8388a4d3
6,620
cpp
C++
src/models/reviewsmodel.cpp
Maledictus/harbour-sailreads
2c58aa266ef2dacb790b857c3b6aced937da5c0e
[ "MIT" ]
3
2019-01-05T09:54:19.000Z
2019-02-26T09:20:23.000Z
src/models/reviewsmodel.cpp
Maledictus/harbour-sailreads
2c58aa266ef2dacb790b857c3b6aced937da5c0e
[ "MIT" ]
1
2019-01-03T10:02:01.000Z
2019-01-03T14:08:16.000Z
src/models/reviewsmodel.cpp
Maledictus/harbour-sailreads
2c58aa266ef2dacb790b857c3b6aced937da5c0e
[ "MIT" ]
null
null
null
/* Copyright (c) 2018-2019 Oleg Linkin <maledictusdemagog@gmail.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. */ #include "reviewsmodel.h" #include "../sailreadsmanager.h" #include "../objects/book.h" #include "../objects/review.h" namespace Sailreads { ReviewsModel::ReviewsModel(QObject *parent) : BaseModel<ReviewPtr>(parent) , m_UserId("") , m_BookShelfId(0) , m_SortOrder(Qt::DescendingOrder) , m_SortField("date_added") , m_HasMore(true) , m_CurrentPage(1) { } QString ReviewsModel::GetUserId() const { return m_UserId; } void ReviewsModel::SetUserId(const QString& id) { if (m_UserId != id) { m_UserId = id; emit userIdChanged(); } } quint64 ReviewsModel::GetBookShelfId() const { return m_BookShelfId; } void ReviewsModel::SetBookShelfId(quint64 id) { if (m_BookShelfId != id) { m_BookShelfId = id; emit bookShelfIdChanged(); } } QString ReviewsModel::GetBookShelf() const { return m_BookShelf; } void ReviewsModel::SetBookShelf(const QString& shelf) { if (m_BookShelf != shelf) { m_BookShelf = shelf; emit bookShelfChanged(); } } bool ReviewsModel::GetHasMore() const { return m_HasMore; } void ReviewsModel::SetHasMore(bool has) { if (m_HasMore != has) { m_HasMore = has; emit hasMoreChanged(); } } Qt::SortOrder ReviewsModel::GetSortOrder() const { return m_SortOrder; } void ReviewsModel::SetSortOrder(Qt::SortOrder sortOrder) { if (m_SortOrder != sortOrder) { m_SortOrder = sortOrder; emit sortOrdereChanged(); } } QString ReviewsModel::GetSortField() const { return m_SortField; } void ReviewsModel::SetSortField(const QString& sortField) { if (m_SortField != sortField) { m_SortField = sortField; emit sortFieldChanged(); } } QVariant ReviewsModel::data(const QModelIndex& index, int role) const { if (index.row() > m_Items.count() - 1 || index.row() < 0) { return QVariant(); } const auto& review = m_Items.at(index.row()); switch (role) { case Id: return review->GetId(); case Book: return QVariant::fromValue(review->GetBook()); case Rating: return review->GetRating(); case LikesCount: return review->GetLikesCount(); case Shelves: return review->GetShelvesList(); case AddedDate: return review->GetAddedDate(); case UpdatedDate: return review->GetUpdatedDate(); case ReadDate: return review->GetReadDate(); case StartedDate: return review->GetStartedDate(); case ReadCount: return review->GetReadCount(); case Body: return review->GetBody(); case CommentsCount: return review->GetCommentsCount(); case OwnedCount: return review->GetOwned(); case Url: return review->GetUrl(); case ReviewItem: return QVariant::fromValue(review.get()); default: return QVariant(); } } QHash<int, QByteArray> ReviewsModel::roleNames() const { QHash<int, QByteArray> roles; roles[Id] = "reviewId"; roles[Book] = "reviewBook"; roles[Rating] = "reviewRating"; roles[LikesCount] = "reviewLikesCount"; roles[Shelves] = "reviewShelves"; roles[AddedDate] = "reviewAddDate"; roles[UpdatedDate] = "reviewUpdateDate"; roles[ReadDate] = "reviewReadDate"; roles[StartedDate] = "reviewStartDate"; roles[ReadCount] = "reviewReadCount"; roles[Body] = "reviewBody"; roles[CommentsCount] = "reviewCommentsCount"; roles[OwnedCount] = "reviewOwnedCount"; roles[Url] = "reviewUrl"; roles[ReviewItem] = "reviewReview"; return roles; } void ReviewsModel::classBegin() { connect(SailreadsManager::Instance(), &SailreadsManager::gotReviews, this, &ReviewsModel::handleGotReviews); connect(SailreadsManager::Instance(), &SailreadsManager::gotReviewInfo, this, &ReviewsModel::handleGotReviewInfo); } void ReviewsModel::componentComplete() { } void ReviewsModel::fetchMoreContent() { if (m_BookShelf.isEmpty() || m_UserId.isEmpty()) { SetHasMore(false); return; } SailreadsManager::Instance()->loadReviews(this, m_UserId, m_BookShelf, m_CurrentPage, m_SortOrder, m_SortField); } void ReviewsModel::loadReviews() { if (m_BookShelf.isEmpty() || m_UserId.isEmpty()) { return; } SailreadsManager::Instance()->loadReviews(this, m_UserId, m_BookShelf, 1, m_SortOrder, m_SortField, false); } void ReviewsModel::handleGotReviews(quint64 booksShelfId, const CountedItems<ReviewPtr>& reviews) { if (m_BookShelfId != booksShelfId) { return; } if (!reviews.m_BeginIndex && !reviews.m_EndIndex) { Clear(); } else if (reviews.m_BeginIndex == 1) { m_CurrentPage = 1; SetItems(reviews.m_Items); } else { AddItems(reviews.m_Items); } SetHasMore(reviews.m_EndIndex != reviews.m_Count); if (m_HasMore) { ++m_CurrentPage; } } void ReviewsModel::handleGotReviewInfo(const ReviewInfo& reviewInfo) { auto it = std::find_if(m_Items.begin(), m_Items.end(), [reviewInfo](decltype(m_Items.front()) review) { return reviewInfo.m_ReviewId == review->GetId(); }); if (it == m_Items.end() || m_BookShelf == reviewInfo.m_ReadStatus) { return; } const int pos = std::distance(m_Items.begin(), it); beginRemoveRows(QModelIndex(), pos, pos); m_Items.removeAt(pos); endRemoveRows(); } }
25.960784
97
0.666465