hexsha
stringlengths
40
40
size
int64
5
1.05M
ext
stringclasses
588 values
lang
stringclasses
305 values
max_stars_repo_path
stringlengths
3
363
max_stars_repo_name
stringlengths
5
118
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
10
max_stars_count
float64
1
191k
max_stars_repo_stars_event_min_datetime
stringdate
2015-01-01 00:00:35
2022-03-31 23:43:49
max_stars_repo_stars_event_max_datetime
stringdate
2015-01-01 12:37:38
2022-03-31 23:59:52
max_issues_repo_path
stringlengths
3
363
max_issues_repo_name
stringlengths
5
118
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
10
max_issues_count
float64
1
134k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
363
max_forks_repo_name
stringlengths
5
135
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
10
max_forks_count
float64
1
105k
max_forks_repo_forks_event_min_datetime
stringdate
2015-01-01 00:01:02
2022-03-31 23:27:27
max_forks_repo_forks_event_max_datetime
stringdate
2015-01-03 08:55:07
2022-03-31 23:59:24
content
stringlengths
5
1.05M
avg_line_length
float64
1.13
1.04M
max_line_length
int64
1
1.05M
alphanum_fraction
float64
0
1
14244e2ee8624dea6334dd6578a11ed9d4753250
669
c
C
Assignment2/assigment2.c
osbaldomartinez20/CSC615
dc3836464c6a7ced540481a827b16460cd3ad5c9
[ "MIT" ]
null
null
null
Assignment2/assigment2.c
osbaldomartinez20/CSC615
dc3836464c6a7ced540481a827b16460cd3ad5c9
[ "MIT" ]
null
null
null
Assignment2/assigment2.c
osbaldomartinez20/CSC615
dc3836464c6a7ced540481a827b16460cd3ad5c9
[ "MIT" ]
null
null
null
/************************************************************** * Class: CSC-615-01 Spring 2020 * Name: Osbaldo Martinez * Student ID: 916754207 * Project: <Assignment 2 - Tapeless Ruler> * * File: <assigment2.c> * * Description: The main function helps in making an infinite loop * to have the sensor constantly measure a distance. **************************************************************/ #include <stdio.h> #include "echoSensor.h" //The main function is used to make an infinite loop that constantly measures the distance //that the echo traveled. int main(void) { pinSet(); for (; ;) { displayDistance(); } return 0; }
26.76
91
0.547085
caedef371dbab84ca65beba93b7751253460a0a2
673
h
C
BucketEngine/BucketSource/Bucket/BucketCore.h
Wyxaldir/Bucket
2135e2bd921d5c44b3726d21c344970e7b9fb81a
[ "Apache-2.0" ]
1
2019-10-25T03:17:13.000Z
2019-10-25T03:17:13.000Z
BucketEngine/BucketSource/Bucket/BucketCore.h
Wyxaldir/Bucket
2135e2bd921d5c44b3726d21c344970e7b9fb81a
[ "Apache-2.0" ]
null
null
null
BucketEngine/BucketSource/Bucket/BucketCore.h
Wyxaldir/Bucket
2135e2bd921d5c44b3726d21c344970e7b9fb81a
[ "Apache-2.0" ]
null
null
null
#pragma once #ifdef BUCKET_PLATFORM_WINDOWS #ifdef BUCKET_BUILD_DLL #define BUCKET_DLL __declspec(dllexport) #else #define BUCKET_DLL __declspec(dllimport) #endif #else #error Bucket is windows only. #endif #define BIT(x) (1 << x) #ifdef BUCKET_ENABLE_ASSERTS #define BUCKET_ASSERT(x, ...) {if(!(x)) { BUCKET_ERROR("Assertion failed. {0}", __VA_ARGS__); __debugbreak(); }} #define BUCKET_CORE_ASSERT(x, ...) {if(!(x)) { BUCKET_CORE_ERROR("Assertion failed. {0}", __VA_ARGS__); __debugbreak(); }} #else #define BUCKET_ASSERT(x, ...) #define BUCKET_CORE_ASSERT(x, ...) #endif #define BUCKET_BIND_FUNCTION(func) std::bind(&##func, this, std::placeholders::_1)
28.041667
123
0.717682
1b56fdfd1d73126c5ed5419b6672a05bc51854ab
241
h
C
Source/GameService/GameFlow/Stage/GsStageMode.h
BaekTaehyun/T1Project
d7d98c7cfc88e57513631124c32dfee8794307db
[ "MIT" ]
3
2019-06-25T05:09:47.000Z
2020-09-30T18:06:17.000Z
Source/GameService/GameFlow/Stage/GsStageMode.h
BaekTaehyun/T1Project
d7d98c7cfc88e57513631124c32dfee8794307db
[ "MIT" ]
null
null
null
Source/GameService/GameFlow/Stage/GsStageMode.h
BaekTaehyun/T1Project
d7d98c7cfc88e57513631124c32dfee8794307db
[ "MIT" ]
2
2018-10-15T08:09:16.000Z
2020-04-07T05:25:52.000Z
#pragma once class FGsStageMode { public: enum Lobby { INTRO, ASSET_DOWNLOAD, SERVER_SELECT, CAHRACTER_SELECT, CHARACTER_CREATE, CHARACTER_PREVIEW, LOBBY_MAX, }; enum Game { TOWN, FIELD, DUNGEON, GAME_MAX, }; };
10.041667
20
0.680498
8883888bfadbf982672d1e4f49faf473e9566294
10,506
c
C
brutus_system/ISE/fsl_test/isim/tb_fsl_test_isim_beh.exe.sim/work/a_1103126521_0908556911.c
Noxet/embedded_bruteforce
8a7f25874c2cd275dd530625ee768338e0bdf2fe
[ "MIT" ]
2
2019-07-30T14:54:28.000Z
2020-10-25T21:35:17.000Z
brutus_system/ISE/fsl_test/isim/tb_fsl_test_isim_beh.exe.sim/work/a_1103126521_0908556911.c
Noxet/embedded_bruteforce
8a7f25874c2cd275dd530625ee768338e0bdf2fe
[ "MIT" ]
1
2019-07-30T14:54:53.000Z
2019-08-15T15:37:10.000Z
brutus_system/ISE/fsl_test/isim/tb_fsl_test_isim_beh.exe.sim/work/a_1103126521_0908556911.c
Noxet/embedded_bruteforce
8a7f25874c2cd275dd530625ee768338e0bdf2fe
[ "MIT" ]
null
null
null
/**********************************************************************/ /* ____ ____ */ /* / /\/ / */ /* /___/ \ / */ /* \ \ \/ */ /* \ \ Copyright (c) 2003-2009 Xilinx, Inc. */ /* / / All Right Reserved. */ /* /---/ /\ */ /* \ \ / \ */ /* \___\/\___\ */ /***********************************************************************/ /* This file is designed for use with ISim build 0xa0883be4 */ #define XSI_HIDE_SYMBOL_SPEC true #include "xsi.h" #include <memory.h> #ifdef __GNUC__ #include <stdlib.h> #else #include <malloc.h> #define alloca _alloca #endif static const char *ng0 = "C:/Users/ael10jso/Xilinx/embedded_bruteforce/brutus_system/pcores/test_v1_00_a/hdl/vhdl/test.vhd"; extern char *IEEE_P_2592010699; extern char *IEEE_P_1242562249; char *ieee_p_1242562249_sub_1547198987_1035706684(char *, char *, char *, char *, char *, char *); unsigned char ieee_p_2592010699_sub_1690584930_503743352(char *, unsigned char ); static void work_a_1103126521_0908556911_p_0(char *t0) { char *t1; char *t2; unsigned char t3; unsigned char t4; char *t5; unsigned char t6; char *t7; char *t8; char *t9; char *t10; char *t11; char *t12; char *t13; char *t14; char *t15; char *t16; LAB0: xsi_set_current_line(141, ng0); t1 = (t0 + 2952U); t2 = *((char **)t1); t3 = *((unsigned char *)t2); t4 = (t3 == (unsigned char)1); if (t4 != 0) goto LAB3; LAB4: LAB5: t11 = (t0 + 6288); t12 = (t11 + 56U); t13 = *((char **)t12); t14 = (t13 + 56U); t15 = *((char **)t14); *((unsigned char *)t15) = (unsigned char)2; xsi_driver_first_trans_fast_port(t11); LAB2: t16 = (t0 + 6144); *((int *)t16) = 1; LAB1: return; LAB3: t1 = (t0 + 1992U); t5 = *((char **)t1); t6 = *((unsigned char *)t5); t1 = (t0 + 6288); t7 = (t1 + 56U); t8 = *((char **)t7); t9 = (t8 + 56U); t10 = *((char **)t9); *((unsigned char *)t10) = t6; xsi_driver_first_trans_fast_port(t1); goto LAB2; LAB6: goto LAB2; } static void work_a_1103126521_0908556911_p_1(char *t0) { char *t1; char *t2; unsigned char t3; unsigned char t4; char *t5; unsigned char t6; unsigned char t7; char *t8; char *t9; char *t10; char *t11; char *t12; char *t13; char *t14; char *t15; char *t16; char *t17; LAB0: xsi_set_current_line(142, ng0); t1 = (t0 + 2952U); t2 = *((char **)t1); t3 = *((unsigned char *)t2); t4 = (t3 == (unsigned char)2); if (t4 != 0) goto LAB3; LAB4: LAB5: t12 = (t0 + 6352); t13 = (t12 + 56U); t14 = *((char **)t13); t15 = (t14 + 56U); t16 = *((char **)t15); *((unsigned char *)t16) = (unsigned char)2; xsi_driver_first_trans_fast_port(t12); LAB2: t17 = (t0 + 6160); *((int *)t17) = 1; LAB1: return; LAB3: t1 = (t0 + 2792U); t5 = *((char **)t1); t6 = *((unsigned char *)t5); t7 = ieee_p_2592010699_sub_1690584930_503743352(IEEE_P_2592010699, t6); t1 = (t0 + 6352); t8 = (t1 + 56U); t9 = *((char **)t8); t10 = (t9 + 56U); t11 = *((char **)t10); *((unsigned char *)t11) = t7; xsi_driver_first_trans_fast_port(t1); goto LAB2; LAB6: goto LAB2; } static void work_a_1103126521_0908556911_p_2(char *t0) { char *t1; char *t2; char *t3; char *t4; char *t5; char *t6; char *t7; LAB0: xsi_set_current_line(144, ng0); LAB3: t1 = (t0 + 3112U); t2 = *((char **)t1); t1 = (t0 + 6416); t3 = (t1 + 56U); t4 = *((char **)t3); t5 = (t4 + 56U); t6 = *((char **)t5); memcpy(t6, t2, 32U); xsi_driver_first_trans_fast_port(t1); LAB2: t7 = (t0 + 6176); *((int *)t7) = 1; LAB1: return; LAB4: goto LAB2; } static void work_a_1103126521_0908556911_p_3(char *t0) { char t1[16]; char *t2; char *t3; char *t4; char *t5; char *t6; char *t7; char *t8; char *t9; char *t10; char *t11; char *t12; LAB0: xsi_set_current_line(146, ng0); LAB3: t2 = (t0 + 3112U); t3 = *((char **)t2); t2 = (t0 + 11048U); t4 = (t0 + 1672U); t5 = *((char **)t4); t4 = (t0 + 11016U); t6 = ieee_p_1242562249_sub_1547198987_1035706684(IEEE_P_1242562249, t1, t3, t2, t5, t4); t7 = (t0 + 6480); t8 = (t7 + 56U); t9 = *((char **)t8); t10 = (t9 + 56U); t11 = *((char **)t10); memcpy(t11, t6, 32U); xsi_driver_first_trans_fast(t7); LAB2: t12 = (t0 + 6192); *((int *)t12) = 1; LAB1: return; LAB4: goto LAB2; } static void work_a_1103126521_0908556911_p_4(char *t0) { unsigned char t1; char *t2; unsigned char t3; char *t4; char *t5; unsigned char t6; unsigned char t7; char *t8; unsigned char t9; unsigned char t10; char *t11; char *t12; char *t13; char *t14; int t15; int t16; static char *nl0[] = {&&LAB12, &&LAB13, &&LAB14}; LAB0: xsi_set_current_line(150, ng0); t2 = (t0 + 992U); t3 = xsi_signal_has_event(t2); if (t3 == 1) goto LAB5; LAB6: t1 = (unsigned char)0; LAB7: if (t1 != 0) goto LAB2; LAB4: LAB3: t2 = (t0 + 6208); *((int *)t2) = 1; LAB1: return; LAB2: xsi_set_current_line(151, ng0); t4 = (t0 + 1192U); t8 = *((char **)t4); t9 = *((unsigned char *)t8); t10 = (t9 == (unsigned char)3); if (t10 != 0) goto LAB8; LAB10: xsi_set_current_line(159, ng0); t2 = (t0 + 2952U); t4 = *((char **)t2); t1 = *((unsigned char *)t4); t2 = (char *)((nl0) + t1); goto **((char **)t2); LAB5: t4 = (t0 + 1032U); t5 = *((char **)t4); t6 = *((unsigned char *)t5); t7 = (t6 == (unsigned char)3); t1 = t7; goto LAB7; LAB8: xsi_set_current_line(154, ng0); t4 = (t0 + 6544); t11 = (t4 + 56U); t12 = *((char **)t11); t13 = (t12 + 56U); t14 = *((char **)t13); *((unsigned char *)t14) = (unsigned char)0; xsi_driver_first_trans_fast(t4); xsi_set_current_line(155, ng0); t2 = (t0 + 6608); t4 = (t2 + 56U); t5 = *((char **)t4); t8 = (t5 + 56U); t11 = *((char **)t8); *((int *)t11) = 0; xsi_driver_first_trans_fast(t2); xsi_set_current_line(156, ng0); t2 = (t0 + 6672); t4 = (t2 + 56U); t5 = *((char **)t4); t8 = (t5 + 56U); t11 = *((char **)t8); *((int *)t11) = 0; xsi_driver_first_trans_fast(t2); LAB9: goto LAB3; LAB11: goto LAB9; LAB12: xsi_set_current_line(161, ng0); t5 = (t0 + 1992U); t8 = *((char **)t5); t3 = *((unsigned char *)t8); t6 = (t3 == (unsigned char)3); if (t6 != 0) goto LAB15; LAB17: LAB16: goto LAB11; LAB13: xsi_set_current_line(168, ng0); t2 = (t0 + 1992U); t4 = *((char **)t2); t1 = *((unsigned char *)t4); t3 = (t1 == (unsigned char)3); if (t3 != 0) goto LAB18; LAB20: LAB19: goto LAB11; LAB14: xsi_set_current_line(180, ng0); t2 = (t0 + 3432U); t4 = *((char **)t2); t15 = *((int *)t4); t1 = (t15 == 0); if (t1 != 0) goto LAB24; LAB26: xsi_set_current_line(183, ng0); t2 = (t0 + 2792U); t4 = *((char **)t2); t1 = *((unsigned char *)t4); t3 = (t1 == (unsigned char)2); if (t3 != 0) goto LAB27; LAB29: LAB28: LAB25: goto LAB11; LAB15: xsi_set_current_line(162, ng0); t5 = (t0 + 6544); t11 = (t5 + 56U); t12 = *((char **)t11); t13 = (t12 + 56U); t14 = *((char **)t13); *((unsigned char *)t14) = (unsigned char)1; xsi_driver_first_trans_fast(t5); xsi_set_current_line(163, ng0); t2 = (t0 + 3728U); t4 = *((char **)t2); t15 = *((int *)t4); t16 = (t15 - 1); t2 = (t0 + 6608); t5 = (t2 + 56U); t8 = *((char **)t5); t11 = (t8 + 56U); t12 = *((char **)t11); *((int *)t12) = t16; xsi_driver_first_trans_fast(t2); goto LAB16; LAB18: xsi_set_current_line(171, ng0); t2 = (t0 + 3272U); t5 = *((char **)t2); t15 = *((int *)t5); t6 = (t15 == 0); if (t6 != 0) goto LAB21; LAB23: xsi_set_current_line(175, ng0); t2 = (t0 + 3272U); t4 = *((char **)t2); t15 = *((int *)t4); t16 = (t15 - 1); t2 = (t0 + 6608); t5 = (t2 + 56U); t8 = *((char **)t5); t11 = (t8 + 56U); t12 = *((char **)t11); *((int *)t12) = t16; xsi_driver_first_trans_fast(t2); LAB22: goto LAB19; LAB21: xsi_set_current_line(172, ng0); t2 = (t0 + 6544); t8 = (t2 + 56U); t11 = *((char **)t8); t12 = (t11 + 56U); t13 = *((char **)t12); *((unsigned char *)t13) = (unsigned char)2; xsi_driver_first_trans_fast(t2); xsi_set_current_line(173, ng0); t2 = (t0 + 3848U); t4 = *((char **)t2); t15 = *((int *)t4); t16 = (t15 - 1); t2 = (t0 + 6672); t5 = (t2 + 56U); t8 = *((char **)t5); t11 = (t8 + 56U); t12 = *((char **)t11); *((int *)t12) = t16; xsi_driver_first_trans_fast(t2); goto LAB22; LAB24: xsi_set_current_line(181, ng0); t2 = (t0 + 6544); t5 = (t2 + 56U); t8 = *((char **)t5); t11 = (t8 + 56U); t12 = *((char **)t11); *((unsigned char *)t12) = (unsigned char)0; xsi_driver_first_trans_fast(t2); goto LAB25; LAB27: xsi_set_current_line(184, ng0); t2 = (t0 + 3432U); t5 = *((char **)t2); t15 = *((int *)t5); t16 = (t15 - 1); t2 = (t0 + 6672); t8 = (t2 + 56U); t11 = *((char **)t8); t12 = (t11 + 56U); t13 = *((char **)t12); *((int *)t13) = t16; xsi_driver_first_trans_fast(t2); goto LAB28; } extern void work_a_1103126521_0908556911_init() { static char *pe[] = {(void *)work_a_1103126521_0908556911_p_0,(void *)work_a_1103126521_0908556911_p_1,(void *)work_a_1103126521_0908556911_p_2,(void *)work_a_1103126521_0908556911_p_3,(void *)work_a_1103126521_0908556911_p_4}; xsi_register_didat("work_a_1103126521_0908556911", "isim/tb_fsl_test_isim_beh.exe.sim/work/a_1103126521_0908556911.didat"); xsi_register_executes(pe); }
23.608989
228
0.499905
bb1bc17a88d6ce1e3d24f6356f114a93cc69aaf0
29,926
h
C
include/bsp430/clock.h
pabigot/bsp430
44ef3c7c0afb333076e0603aab3d2c0f839b0c7d
[ "BSD-3-Clause" ]
18
2015-01-15T20:39:05.000Z
2021-07-25T17:21:43.000Z
include/bsp430/clock.h
pabigot/bsp430
44ef3c7c0afb333076e0603aab3d2c0f839b0c7d
[ "BSD-3-Clause" ]
1
2018-09-03T12:05:31.000Z
2018-09-03T12:05:31.000Z
include/bsp430/clock.h
pabigot/bsp430
44ef3c7c0afb333076e0603aab3d2c0f839b0c7d
[ "BSD-3-Clause" ]
6
2015-02-08T08:21:41.000Z
2021-03-23T17:46:34.000Z
/* Copyright 2012-2014, Peter A. Bigot * * 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 software 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. */ /** @file * * @brief Clock-related functions implemented on all MSP430 MCUs. * * This module declares functions and macros of general use in * managing MSP430 clocks. The interface here is independent of the * underlying clock peripheral, but in some cases behavior is refined * or clarified in the peripheral-specific header. * * This module will include the peripheral-specific header if a * functional presence preprocessor symbol is available that is * recognized as a supported clock peripheral. Recognized peripherals * and the corresponding BSP430 header are: * <ul> * <li> <bsp430/periph/bc2.h> for BC2 (Basic Clock Module+) * <li> <bsp430/periph/fllplus.h> for FLLPLUS and FLLPLUS_SMALL (FLL Plus) * <li> <bsp430/periph/ucs.h> for UCS and UCS_RF (Unified Clock System) * <li> <bsp430/periph/cs.h> for CS and CS_A (Clock System) on FR5xx devices * <li> <bsp430/periph/cs4.h> for CS (Clock System) on FR4xx/2xx devices * </ul> * * @note Some modules (such as BC2) use LFXT1 to denote the source for * ACLK regardless of whether that is the external crystal or VLOCLK. * Throughout BSP430 the term LFXT1 is exclusively used to denote an * external low-frequency crystal. * * @note The CS_A module uses HFXT to refer to XT2. BSP430 uniformly * uses XT2. * * @homepage http://github.com/pabigot/bsp430 * @copyright Copyright 2012-2014, Peter A. Bigot. Licensed under <a href="http://www.opensource.org/licenses/BSD-3-Clause">BSD-3-Clause</a> */ #ifndef BSP430_CLOCK_H #define BSP430_CLOCK_H #include <bsp430/core.h> /** Identify use of the CS peripheral on FR58xx devices. * * TI fails to distinguish the three types of CS module in the three * FRAM families. The original one on the FR57xx is slightly * different from the one on the FR58xx family (which was originally * identified by TI as CS_A). Empirically CS_A can be distinguished * by more bits in the DCOFSEL field. * * @defaulted * @cppflag */ #define BSP430_PERIPH_CS_IS_CSA (defined(__MSP430_HAS_CS_A__) || (defined(__MSP430_HAS_CS__) && defined(DCOFSEL2))) /** Identify use of the CS peripheral on FR4xx/2xx devices. * * TI fails to distinguish the three types of CS module in the three * FRAM families. The one on the FR4xx/2xx is so different it shares * nothing but the module name. Empirically they can be distinguished * because the FR4xx/2xx version has a single-bit SELA field. * * @defaulted * @cppflag */ #define BSP430_PERIPH_CS_IS_CS4 (defined(__MSP430_HAS_CS__) && defined(SELA)) /** A constant representing the desired clock speed of the master * clock. * * If #BSP430_PLATFORM_BOOT_CONFIGURE_CLOCKS is true, * vBSP430platformInitialize_ni() will use this value to initialize * the system clocks. The value should not be used after this point, * as ulBSP430clockMCLK_Hz_ni() is more likely to reflect the actual * MCLK rate. * * @note The default value is calculated from * 3*3*5*5*512*69=115200*69, and is the value nearest 8MHz which is * also compatible with as many serial baud rates as possible. * * @note Applications may wish to provide an alternative value suited * to specific needs. It is suggested that the value include the * suffix L in case the compiler does not automatically promote * constants as necessary. * * @defaulted */ #ifndef BSP430_CLOCK_NOMINAL_MCLK_HZ #define BSP430_CLOCK_NOMINAL_MCLK_HZ 7948800UL #endif /* BSP430_CLOCK_NOMINAL_MCLK_HZ */ /** A function macro that converts a value specified in microseconds * to an approximate duration counted in MCLK cycles. * * This is primarily used to provide the parameter to * #BSP430_CORE_DELAY_CYCLES when the desired delay is specified by * time rather than cycles. * * @param delay_us_ the delay in microseconds. Expected, but not * required, to be a compile-time integer constant compatible with * unsigned long. * * @warning If #BSP430_CLOCK_NOMINAL_MCLK_HZ or @p delay_us_ is large, * it may be necessary to cast the @p delay_us_ to <tt>unsigned long * long</tt> to avoid integer overflow. */ #define BSP430_CLOCK_US_TO_NOMINAL_MCLK(delay_us_) BSP430_CORE_US_TO_TICKS((delay_us_), BSP430_CLOCK_NOMINAL_MCLK_HZ) /** Oscillator capacitor setting for use by * #iBSP430clockConfigureLFXT1_ni. * * Most MSP430 clock systems allow control of internal capacitors for * the low-frequency crystal. The specific setting is * platform-dependent; the value for the setting is * peripheral-dependent. A default value is provided in each * peripheral header. * * The value of this macro should be the bits that need to be set in * the peripheral-specific register to control capacitance, normally * in the form of a header constant such as #XCAP_1 or #XCAP10PF. * * @defaulted * @platformvalue */ #if defined(BSP430_DOXYGEN) #define BSP430_CLOCK_LFXT1_XCAP include <bsp430/platform.h> #endif /* BSP430_DOXYGEN */ /** Check whether any clock has a fault condition. * * This checks all available clocks on the system. Use * peripheral-specific checks for specific clocks. * * @see #BSP430_CLOCK_CLEAR_FAULTS_NI() * * @defaulted * @platformdep */ #if defined(BSP430_DOXYGEN) #define BSP430_CLOCK_IS_FAULTED_NI() peripheral specific #endif /* BSP430_DOXYGEN */ /** The delay after clearing clock faults before recurrent faults are expected. * * When a clock fault is cleared, the clock peripheral will * automatically set the fault indicator again if the clock is still * faulted. However there is no evidence in the documentation that * this is done instantly. BSP430 infrastructure code will delay this * many microseconds after clearing faults before checking to see * whether they are still present. * * Delay suggested by SLAU144I "2xx Family Users Guide" section * 5.2.7.1 "Sourcing MCLK from a Crystal". This applies to using XT2 * and for a specific MCU family, but we're guessing it's a sufficient * delay to detect faults in other configurations. For DCO faults * it's probably too long. * * @defaulted */ #ifndef BSP430_CLOCK_FAULT_RECHECK_DELAY_US #define BSP430_CLOCK_FAULT_RECHECK_DELAY_US 50 #endif /* BSP430_CLOCK_FAULT_RECHECK_DELAY_US */ /** Clear faults associated with clocks * * This clears the state bits associated with fault in all clock * systems supported by the peripheral. If a clock still exhibits a * fault condition, the bits will be set again automatically, though * perhaps not immediately. * * @note Faults are cleared on peripheral-specific registers as well * as the system oscillator fault flag. * * @warning If the underlying peripheral requires that its register * bank be unlocked for modification, this macro will do so then * re-lock them. This will result in unexpected behavior if the macro * is invoked in a context where the registers are already unlocked. * * @see #BSP430_CLOCK_IS_FAULTED_NI(), * #BSP430_CLOCK_FAULT_RECHECK_DELAY_US * * @defaulted * @platformdep */ #if defined(BSP430_DOXYGEN) #define BSP430_CLOCK_CLEAR_FAULTS_NI() peripheral specific #endif /* BSP430_DOXYGEN */ /** Check whether the system oscillator fault flag is set. * * This checks the special function register which reflects roll-up * oscillator faults throughout the system. * * @platformdep */ #if defined(__MSP430_HAS_MSP430XV2_CPU__) #define BSP430_CLOCK_OSC_IS_FAULTED_NI() (SFRIFG1 & OFIFG) #else /* 5xx */ #define BSP430_CLOCK_OSC_IS_FAULTED_NI() (IFG1 & OFIFG) #endif /* 5xx */ /** Clear the system oscillator fault flag. * * This clears the bit the special function register which reflects * roll-up oscillator faults throughout the system. * * @platformdep */ #if defined(__MSP430_HAS_MSP430XV2_CPU__) #define BSP430_CLOCK_OSC_CLEAR_FAULT_NI() do { SFRIFG1 &= ~OFIFG; } while (0) #else /* 5xx */ #define BSP430_CLOCK_OSC_CLEAR_FAULT_NI() do { IFG1 &= ~OFIFG; } while (0) #endif /* 5xx */ /** Check whether the LFXT1 crystal has a fault condition. * * The implementation of this is specific to the clock peripheral. * * @defaulted * @platformdep */ #if defined(BSP430_DOXYGEN) #define BSP430_CLOCK_LFXT1_IS_FAULTED_NI() peripheral specific #endif /* BSP430_DOXYGEN */ /** Same as #BSP430_CLOCK_LFXT1_IS_FAULTED_NI() but checks XT2. * * XT2 is considered to be permanently faulted for clock peripherals * and MCUs on which XT2 is not supported. */ #ifndef BSP430_CLOCK_XT2_IS_FAULTED_NI #define BSP430_CLOCK_XT2_IS_FAULTED_NI() (1) #endif /* BSP430_CLOCK_XT2_IS_FAULTED_NI */ /** Define this to the number of MCLK cycles that * #iBSP430clockConfigureLFXT1_ni should delay, after clearing * oscillator faults, before checking for oscillator stability. This * must be a compile-time constant integer compatible with * <tt>unsigned long</tt>. * * Crystal stabilization can take hundreds of milliseconds. If this * value is too short, #iBSP430clockConfigureLFXT1_ni may prematurely * decide that the crystal is working; if it is too long, the return * from #iBSP430clockConfigureLFXT1_ni is delayed. * * The default value is chosen to reflect a 50msec delay at the PUC * MCLK frequency of roughly 1MHz. This allows * #BSP430_CORE_WATCHDOG_CLEAR() to be invoked within the loop to * prevent a watchdog reset while waiting for stabilization. It does * assume that an unstable crystal will indicate a fault within this * period, which may not be true. * * @defaulted * @platformdep */ #ifndef BSP430_CLOCK_LFXT1_STABILIZATION_DELAY_CYCLES #define BSP430_CLOCK_LFXT1_STABILIZATION_DELAY_CYCLES BSP430_CORE_MS_TO_TICKS(50, BSP430_CLOCK_PUC_MCLK_HZ) #endif /* BSP430_CLOCK_LFXT1_STABILIZATION_DELAY_CYCLES */ /** Same as #BSP430_CLOCK_LFXT1_STABILIZATION_DELAY_CYCLES except applies to XT2. * * @defaulted */ #ifndef BSP430_CLOCK_XT2_STABILIZATION_DELAY_CYCLES #define BSP430_CLOCK_XT2_STABILIZATION_DELAY_CYCLES (20000UL) #endif /* BSP430_CLOCK_XT2_STABILIZATION_DELAY_CYCLES */ /** Check whether the XT2 crystal has a fault condition. * * The implementation of this is specific to the clock peripheral. * * @defaulted * @platformdep */ #if defined(BSP430_DOXYGEN) #define BSP430_CLOCK_XT2_IS_FAULTED_NI() peripheral specific #endif /* BSP430_DOXYGEN */ /** Nominal rate of the external low-frequency crystal. * * This is expected to be a 32 KiHz watch crystal, so that's what the * default is. * * @defaulted */ #ifndef BSP430_CLOCK_NOMINAL_XT1CLK_HZ #define BSP430_CLOCK_NOMINAL_XT1CLK_HZ 32768U #endif /* BSP430_CLOCK_NOMINAL_XT1CLK_HZ */ /** Nominal rate of MODCLK. * * MODCLK is an internally-generated high frequency clock source * available with certain clock systems (UCS, CS_A, and CS4). The * supporting peripheral header will define this if the feature is * available, and leave it undefined otherwise. * * @defaulted * @platformdep */ #if defined(BSP430_DOXYGEN) #define BSP430_CLOCK_NOMINAL_MODCLK_HZ peripheral specific #endif /* BSP430_DOXYGEN */ /** Nominal rate of a secondary external clock (or crystal), in Hz. * * This must be defined externally if #eBSP430clockSRC_XT2CLK is to be * used. Normally this would be done in the platform-specified header * obtained through <bsp430/platform.h>. * * If the platform does not support a secondary external clock, or it * is normally left unpopulated, this macro will be undefined. * * @defaulted * @platformvalue */ #if defined(BSP430_DOXYGEN) #define BSP430_CLOCK_NOMINAL_XT2CLK_HZ include <bsp430/platform.h> #endif /* BSP430_DOXYGEN */ /** Nominal frequency of VLOCLK, in Hz. * * The value is constant for all platforms using a specific clock * peripheral, and is defined in the peripheral header. It is usually * in the range of 10-12 kHz, but is highly sensitive to temperature * and voltage. The actual value may be off by as much as 20%, making * the clock relatively useless for anything that requires accuracy * (such as serial baud rates). * * @defaulted */ #if defined(BSP430_DOXYGEN) #define BSP430_CLOCK_NOMINAL_VLOCLK_HZ platform specific around 10-12 kHz #endif /* BSP430_DOXYGEN */ /** Nominal frequency of MCLK at power-up, in Hz. * * The value is constant for all platforms using a specific clock * peripheral, and is defined in the peripheral header. It is usually * around 1 MHz. */ #if defined(BSP430_DOXYGEN) #define BSP430_CLOCK_PUC_MCLK_HZ platform specific around 1 MHz #endif /* BSP430_DOXYGEN */ /** Constants used for MCU-independent specification of clocks. * * Use these instead of peripheral-specific values like #SELA_1 or * #LFXT1S_2 to identify clock sources by their function. This also * permits finer control within iBSP430clockConfigureACLK_ni(), * allowing that to select a secondary source given oscillator faults * in the primary source. */ typedef enum eBSP430clockSource { /** A marker value indicating that no clock is selected. Generally * this is not an appropriate value to use as a parameter. */ eBSP430clockSRC_NONE, /** XT1 is the primary external clock. It is generally a * low-frequency watch crystal running at 32 KiHz. The nominal * speed for this clock is #BSP430_CLOCK_NOMINAL_XT1CLK_HZ. */ eBSP430clockSRC_XT1CLK, /** VLOCLK is a low-speed internal clock, normally around 10-12 kHz. * It is relatively imprecise. The nominal speed for this clock is * #BSP430_CLOCK_NOMINAL_VLOCLK_HZ. */ eBSP430clockSRC_VLOCLK, /** REFOCLK is an internally low power trimmed 32 KiHz oscillator * supported in the UCS peripheral */ eBSP430clockSRC_REFOCLK, /** DCOCLK is whatever the DCO clock frequency is. It's probably * related to #BSP430_CLOCK_NOMINAL_MCLK_HZ, but may be a multiple * of that. */ eBSP430clockSRC_DCOCLK, /** DCOCLKDIV is a divided DCO clock. It's probably * #BSP430_CLOCK_NOMINAL_MCLK_HZ, but may be a multiple of that. */ eBSP430clockSRC_DCOCLKDIV, /** The default clock source for SMCLK. The selected clock is * peripheral-dependent and likely to be one of * #eBSP430clockSRC_DCOCLK or #eBSP430clockSRC_DCOCLKDIV. */ eBSP430clockSRC_SMCLK_PU_DEFAULT, /** A secondary external clock. This is only recognized if * #BSP430_CLOCK_NOMINAL_XT2CLK_HZ has been provided. */ eBSP430clockSRC_XT2CLK, /** Convenience alias for CS_A peripherals which renamed this * clock. */ eBSP430clockSRC_HFXTCLK = eBSP430clockSRC_XT2CLK, /** Internal low-power oscillator that exists only on CS_A and CS4 * peripherals. */ eBSP430clockSRC_MODCLK, /** Internal low-power oscillator that exists only on CS_A and CS4 * peripherals. */ eBSP430clockSRC_LFMODCLK, /** Fallback: use XT1CLK if #BSP430_CLOCK_LFXT1_IS_FAULTED_NI() is * false, otherwise use VLOCLK. * * The main value of this is in BC2-based clocks, where selecting * XT1CLK as the source for ACLK will cause ACLK to fall back to * VLOCLK if the crystal is faulted, but using the resulting ACLK as * a timer source will not work. */ eBSP430clockSRC_XT1CLK_OR_VLOCLK, /** Fallback: use XT1CLK if #BSP430_CLOCK_LFXT1_IS_FAULTED_NI() is * false, otherwise use REFOCLK. * * Similar to #eBSP430clockSRC_XT1CLK_OR_VLOCLK for UCS-based * systems. */ eBSP430clockSRC_XT1CLK_OR_REFOCLK, /** Fallback: use XT1CLK if #BSP430_CLOCK_LFXT1_IS_FAULTED_NI() is * false, otherwise use the most precise available internal * reference clock. * * Generally this will be equivalent to * #eBSP430clockSRC_XT1CLK_OR_VLOCLK or * #eBSP430clockSRC_XT1CLK_OR_REFOCLK, depending on what clock * peripheral is available. Use ulBSP430clockACLK_Hz_ni() to * determine what the actual (nominal) speed is. */ eBSP430clockSRC_XT1CLK_FALLBACK, /** A unique unrecognized value. Not a valid source for clock * configuration. */ eBSP430clockSRC_UNKNOWN_1, /** A unique unrecognized value. Not a valid source for clock * configuration. */ eBSP430clockSRC_UNKNOWN_4, /** A unique unrecognized value. Not a valid source for clock * configuration. */ eBSP430clockSRC_UNKNOWN_5, /** A unique unrecognized value. Not a valid source for clock * configuration. */ eBSP430clockSRC_UNKNOWN_6, /** A unique unrecognized value. Not a valid source for clock * configuration. */ eBSP430clockSRC_UNKNOWN_7, /** A value representing an external clock, potentially used as a * timer source. Not a valid source for clock configuration, and * will never compare equal to a clock source value. Only returned * from xBSP430timerClockSource(). */ eBSP430clockSRC_TCLK, /** A value representing an inverted external clock, potentially * used as a timer source. Not a valid source for clock * configuration, and will never compare equal to a clock source * value. Only returned from xBSP430timerClockSource(). */ eBSP430clockSRC_ITCLK, } eBSP430clockSource; /** True iff the two clock sources are synchronous. */ static BSP430_CORE_INLINE int iBSP430clockSourceSynchronous (eBSP430clockSource s1, eBSP430clockSource s2) { return ((s1 == s2) || ((eBSP430clockSRC_DCOCLK == s1) && (eBSP430clockSRC_DCOCLKDIV == s2)) || ((eBSP430clockSRC_DCOCLK == s2) && (eBSP430clockSRC_DCOCLKDIV == s1))); } /** Return a reconstructed source for ACLK. * * @note This may not be the same value as was used for the * configuration. It will not take into account resolved fallbacks or * faulted crystals. It will be one that uniquely identifies the * source for the purposes of source comparison. */ eBSP430clockSource xBSP430clockACLKSource (); /** Return a reconstructed source for SMCLK. * * @note This may not be the same value as was used for the * configuration. It will not take into account resolved fallbacks or * faulted crystals. It will be one that uniquely identifies the * source for the purposes of source comparison. */ eBSP430clockSource xBSP430clockSMCLKSource (); /** Return a reconstructed source for MCLK. * * @note This may not be the same value as was used for the * configuration. It will not take into account resolved fallbacks or * faulted crystals. It will be one that uniquely identifies the * source for the purposes of source comparison. */ eBSP430clockSource xBSP430clockMCLKSource (); /** Configure MCLK to a desired frequency. * * The peripheral-specific implementation will configure MCLK to a * frequency as close as possible to the requested frequency. The * actual frequency may be higher or lower than the requested one. * * Peripheral-specific notes: * <ul> * <li>The <bsp430/periph/bc2.h> implementation (2xx family) is * normally limited to the calibrated DCO values recorded within the * MCU, which are a subset of 1 MHz, 8 MHz, 12 MHz, and 16 MHz. The * peripheral will initially be configured to the closest available * calibrated frequency. Where a crystal is available * #configBSP430_BC2_TRIM_TO_MCLK may be used to allow this routine to * adjust the DCO to match the specific frequency as closely as * possible. The invocation of iBSP430bc2TrimToMCLK_ni() that is used * to do this is inhibited if ACLK appears to derive from VLOCLK. * * <li>The <bsp430/periph/fllplus.h> implementation (4xx family) * relies on presence of a stable LFXT1, and configures to the * requested frequency. * * <li>The <bsp430/periph/ucs.h> implementation (5xx/6xx family) will * set the configuration to the power-up defaults unless * #BSP430_UCS_TRIM_DCOCLKDIV is available. If it is, then any * frequency supported by the MCU may be configured. * * <li>The <bsp430/periph/cs.h> implementation (FR5xx family) will * select the closest calibrated frequency supported by the MCU. * There is no facility for adjusting this to an arbitrary frequency. * * <li>The <bsp430/periph/cs4.h> implementation (FR4xx/2xx family) * relies on presence of a stable LFXT1 or REFO, and configures to the * requested frequency. * </ul> * * @note Although passing @p mclk_Hz zero is a short-hand for using * #BSP430_CLOCK_PUC_MCLK_HZ, the result may not be to restore the * clock to its power-up configuration. To avoid manipulating the * clocks during platform initialization, see * #BSP430_PLATFORM_BOOT_CONFIGURE_CLOCKS. * * @warning On some MCUs with the @link bsp430/periph/pmm.h * PMM@endlink module certain MCLK rates require adjusting the MCU * core voltage. See #BSP430_PMM_COREV_FOR_MCLK. Platform * initialization will do this based on #BSP430_CLOCK_NOMINAL_MCLK_HZ. * * @param mclk_Hz Desired frequency for the master clock, in Hz. If * zero, #BSP430_CLOCK_PUC_MCLK_HZ is used. * * @return Configured frequency in Hz. This may be higher or lower * than the requested frequency. */ unsigned long ulBSP430clockConfigureMCLK_ni (unsigned long mclk_Hz); /** Return the best available estimate of MCLK frequency. * * Depending on clock capabilities, this may simply return * #BSP430_CLOCK_NOMINAL_MCLK_HZ, or it may return a value calculated * from observations. * * @note This function will hang until any oscillator fault associated * with the DCO or its peripheral-specific analogue has been cleared. * If the clock configuration is not stable, this function may not * return. * * @return an estimate of the MCLK frequency, in Hz */ unsigned long ulBSP430clockMCLK_Hz_ni (void); /** Interruptible-preserving wrapper for #ulBSP430clockMCLK_Hz_ni */ static BSP430_CORE_INLINE unsigned long ulBSP430clockMCLK_Hz (void) { BSP430_CORE_SAVED_INTERRUPT_STATE(istate); unsigned long rv; BSP430_CORE_DISABLE_INTERRUPT(); rv = ulBSP430clockMCLK_Hz_ni(); BSP430_CORE_RESTORE_INTERRUPT_STATE(istate); return rv; } /** Configure SMCLK to a source clock. * * The peripheral-specific implementation will configure SMCLK to * source from the requested clock. * * @param sel the source from which the clock should be selected. * Note that the values permit an internal decision, e.g. to prefer * LFXT1 but to use an alternative if that is faulted. Configuration * is rejected if the requested clock source does not exist on the * platform. * * @param dividing_shift exponent of a divider used to reduce jitter * and/or clock rate. Not all peripherals support this; a value of * zero is implicitly used in that situation. * * @return 0 if the configuration was accepted, a negative error if it * was rejected. * * @see #BSP430_PLATFORM_BOOT_SMCLK_SOURCE, #BSP430_PLATFORM_BOOT_SMCLK_DIVIDING_SHIFT */ int iBSP430clockConfigureSMCLK_ni (eBSP430clockSource sel, unsigned int dividing_shift); /** Return the best available estimate of SMCLK frequency. * * @return an estimate of the SMCLK frequency, in Hz */ unsigned long ulBSP430clockSMCLK_Hz_ni (void); /** Interruptible-preserving wrapper for #ulBSP430clockSMCLK_Hz_ni */ static BSP430_CORE_INLINE unsigned long ulBSP430clockSMCLK_Hz (void) { BSP430_CORE_SAVED_INTERRUPT_STATE(istate); unsigned long rv; BSP430_CORE_DISABLE_INTERRUPT(); rv = ulBSP430clockSMCLK_Hz_ni(); BSP430_CORE_RESTORE_INTERRUPT_STATE(istate); return rv; } /** Configure (or deconfigure) XT1 as a clock source. * * The peripheral-specific implementation will use * #iBSP430platformConfigurePeripheralPins_ni with #BSP430_PERIPH_LFXT1 to * configure the crystal. If crystal functionality has been * requested, it then clears oscillator faults, delays * #BSP430_CLOCK_LFXT1_STABILIZATION_DELAY_CYCLES, then detects * whether the crystal is functioning. It terminates with success * once the oscillator remains unfaulted after the delay, and * otherwise repeats the clear/delay/check process as specified by @p * loop_limit. * * @param enablep Pass a nonzero value to configure XIN/XOUT for * crystal functionality and to loop until the crystal is stabilized * or has failed to stabilize. Pass a zero value to turn off the * crystal function: this reconfigures pins to their digital port * function, disables the crystal, and clears any crystal capacitance * setting. * * @param loop_limit The number of times the stabilization check * should be repeated. If stabilization has not been achieved after * this many loops, assume the crystal is absent and configure for * VLOCLK. A negative value indicates the process should loop until * stabilization is detected. A zero value is equivalent to passing a * zero value as @p enablep. * * @return Zero if XT1 was disabled by the call, and a positive value * if XT1 is stable on completion of the call (available as a clock * source). A negative value indicates an error, such as inability to * configure XIN/XOUT pins. Thus, the crystal is available and stable * only if a positive value is returned. */ int iBSP430clockConfigureLFXT1_ni (int enablep, int loop_limit); /** Same as iBSP430clockConfigureLFXT1_ni() but for XT2. * * The function is not implemented if XT2CLK is not supported on the * platform. * * @dependency #BSP430_CLOCK_NOMINAL_XT2CLK_HZ */ int iBSP430clockConfigureXT2_ni (int enablep, int loop_limit); /** Configure ACLK to a source clock. * * The peripheral-specific implementation will configure ACLK to * source from the requested clock. * * @param sel the source from which the clock should be selected. * Note that the values permit an internal decision, e.g. to prefer * LFXT1 but to use an alternative if that is faulted. Configuration * is rejected if the requested clock source does not exist on the * platform. * * @param dividing_shift exponent of a divider used to reduce jitter * and/or clock rate. Not all peripherals support this; a value of * zero is implicitly used in that situation. * * @return 0 if the configuration was accepted, a negative error if it * was rejected. * * @see #BSP430_PLATFORM_BOOT_ACLK_SOURCE, #BSP430_PLATFORM_BOOT_ACLK_DIVIDING_SHIFT */ int iBSP430clockConfigureACLK_ni (eBSP430clockSource sel, unsigned int dividing_shift); /** Return the best available estimate of ACLK frequency. * * Depending on clock configuration, this will return one of * #BSP430_CLOCK_NOMINAL_XT1CLK_HZ, #BSP430_CLOCK_NOMINAL_VLOCLK_HZ, or * another constant or possibly measured value. * * A value of 0 may be returned if the clock is configured for an * unidentified external source. * * @note If the ACLK is configured to source from LFXT1 but * #BSP430_CLOCK_LFXT1_IS_FAULTED_NI() is true this will return * #BSP430_CLOCK_NOMINAL_VLOCLK_HZ instead of * #BSP430_CLOCK_NOMINAL_XT1CLK_HZ. * * @return an estimate of the ACLK frequency, in Hz */ unsigned long ulBSP430clockACLK_Hz_ni (void); /** Interruptible-preserving wrapper for ulBSP430clockACLK_Hz_ni() */ static BSP430_CORE_INLINE unsigned long ulBSP430clockACLK_Hz (void) { BSP430_CORE_SAVED_INTERRUPT_STATE(istate); unsigned long rv; BSP430_CORE_DISABLE_INTERRUPT(); rv = ulBSP430clockACLK_Hz_ni(); BSP430_CORE_RESTORE_INTERRUPT_STATE(istate); return rv; } /** Return the best available estimate of slow ACLK frequency. * * Same as ulBSP430clockACLK_Hz_ni() but for use where ACLK is a * low-frequency clock. * * @deprecated: Use ulBSP430clockACLK_Hz_ni() */ static BSP430_CORE_INLINE unsigned int uiBSP430clockACLK_Hz_ni (void) { return ulBSP430clockACLK_Hz_ni(); } /** Interruptible-preserving wrapper for uiBSP430clockACLK_Hz_ni() * @deprecated: Use ulBSP430clockACLK_Hz() */ static BSP430_CORE_INLINE unsigned int uiBSP430clockACLK_Hz (void) { BSP430_CORE_SAVED_INTERRUPT_STATE(istate); unsigned int rv; BSP430_CORE_DISABLE_INTERRUPT(); rv = uiBSP430clockACLK_Hz_ni(); BSP430_CORE_RESTORE_INTERRUPT_STATE(istate); return rv; } /* Include peripheral-specific header where recognized */ #if defined(__MSP430_HAS_BC2__) #include <bsp430/periph/bc2.h> #endif /* __MSP430_HAS_BC2__ */ #if defined(__MSP430_HAS_FLLPLUS__) || defined(__MSP430_HAS_FLLPLUS_SMALL__) #include <bsp430/periph/fllplus.h> #endif /* __MSP430_HAS_FLLPLUS__ */ #if defined(__MSP430_HAS_UCS__) || defined(__MSP430_HAS_UCS_RF__) #include <bsp430/periph/ucs.h> #endif /* __MSP430_HAS_UCS__ */ #if defined(__MSP430_HAS_CS__) || defined(__MSP430_HAS_CS_A__) #if (BSP430_PERIPH_CS_IS_CS4 - 0) #include <bsp430/periph/cs4.h> #else /* BSP430_PERIPH_CS_IS_CS4 */ #include <bsp430/periph/cs.h> #endif /* BSP430_PERIPH_CS_IS_CS4 */ #endif /* __MSP430_HAS_CS__ */ #endif /* BSP430_CLOCK_H */
38.415918
141
0.757936
bb9e509ca1c793b71c1c3d44ece4f3b6ac929345
213
h
C
ZP_Base/XiangQi/XiangQi/ViewController.h
zhangpoor/MyExercise
3b610eeb0fa95a684d273d0bb6f252c5c6d13e4b
[ "MIT" ]
null
null
null
ZP_Base/XiangQi/XiangQi/ViewController.h
zhangpoor/MyExercise
3b610eeb0fa95a684d273d0bb6f252c5c6d13e4b
[ "MIT" ]
null
null
null
ZP_Base/XiangQi/XiangQi/ViewController.h
zhangpoor/MyExercise
3b610eeb0fa95a684d273d0bb6f252c5c6d13e4b
[ "MIT" ]
null
null
null
// // ViewController.h // XiangQi // // Created by zhangpoor on 15/12/31. // Copyright © 2015年 zhangpoor. All rights reserved. // #import <Cocoa/Cocoa.h> @interface ViewController : NSViewController @end
13.3125
53
0.690141
eb7bc665fd8cfd1fe5e154e8c6f43b2dea1718ae
17,654
c
C
sha256.c
SchwarzeFalke/api_votoBlock
63a039e163e69a7e2680e51460e64fe5f818efb1
[ "MIT" ]
null
null
null
sha256.c
SchwarzeFalke/api_votoBlock
63a039e163e69a7e2680e51460e64fe5f818efb1
[ "MIT" ]
null
null
null
sha256.c
SchwarzeFalke/api_votoBlock
63a039e163e69a7e2680e51460e64fe5f818efb1
[ "MIT" ]
null
null
null
#include "Python.h" #include "structmember.h" #include "hashlib.h" #include "pystrhex.h" typedef unsigned char SHA_BYTE; #if SIZEOF_INT == 4 typedef unsigned int SHA_INT32; #else #endif #define SHA_BLOCKSIZE 64 #define SHA_DIGESTSIZE 32 typedef struct { PyObject_HEAD SHA_INT32 digest[8]; /* Message digest */ SHA_INT32 count_lo, count_hi; /* 64-bit bit count */ SHA_BYTE data[SHA_BLOCKSIZE]; /* SHA data buffer */ int local; /* unprocessed amount in data */ int digestsize; } SHAobject; #include "clinic/sha256module.c.h" #define ROR(x, y) \ (((((unsigned long)(x)&0xFFFFFFFFUL) >> (unsigned long)((y)&31)) | \ ((unsigned long)(x) << (unsigned long)(32 - ((y)&31)))) & \ 0xFFFFFFFFUL) #define Ch(x, y, z) (z ^ (x & (y ^ z))) #define Maj(x, y, z) (((x | y) & z) | (x & y)) #define S(x, n) ROR((x), (n)) #define R(x, n) (((x)&0xFFFFFFFFUL) >> (n)) #define Sigma0(x) (S(x, 2) ^ S(x, 13) ^ S(x, 22)) #define Sigma1(x) (S(x, 6) ^ S(x, 11) ^ S(x, 25)) #define Gamma0(x) (S(x, 7) ^ S(x, 18) ^ R(x, 3)) #define Gamma1(x) (S(x, 17) ^ S(x, 19) ^ R(x, 10)) static void sha_transform(SHAobject *sha_info) { int i; SHA_INT32 S[8], W[64], t0, t1; memcpy(W, sha_info->data, sizeof(sha_info->data)); #if PY_LITTLE_ENDIAN longReverse(W, (int)sizeof(sha_info->data)); #endif for (i = 16; i < 64; ++i) { W[i] = Gamma1(W[i - 2]) + W[i - 7] + Gamma0(W[i - 15]) + W[i - 16]; } for (i = 0; i < 8; ++i) { S[i] = sha_info->digest[i]; } /* Compress */ #define RND(a, b, c, d, e, f, g, h, i, ki) \ t0 = h + Sigma1(e) + Ch(e, f, g) + ki + W[i]; \ t1 = Sigma0(a) + Maj(a, b, c); \ d += t0; \ h = t0 + t1; RND(S[0], S[1], S[2], S[3], S[4], S[5], S[6], S[7], 0, 0x428a2f98); RND(S[7], S[0], S[1], S[2], S[3], S[4], S[5], S[6], 1, 0x71374491); RND(S[6], S[7], S[0], S[1], S[2], S[3], S[4], S[5], 2, 0xb5c0fbcf); RND(S[5], S[6], S[7], S[0], S[1], S[2], S[3], S[4], 3, 0xe9b5dba5); RND(S[4], S[5], S[6], S[7], S[0], S[1], S[2], S[3], 4, 0x3956c25b); RND(S[3], S[4], S[5], S[6], S[7], S[0], S[1], S[2], 5, 0x59f111f1); RND(S[2], S[3], S[4], S[5], S[6], S[7], S[0], S[1], 6, 0x923f82a4); RND(S[1], S[2], S[3], S[4], S[5], S[6], S[7], S[0], 7, 0xab1c5ed5); RND(S[0], S[1], S[2], S[3], S[4], S[5], S[6], S[7], 8, 0xd807aa98); RND(S[7], S[0], S[1], S[2], S[3], S[4], S[5], S[6], 9, 0x12835b01); RND(S[6], S[7], S[0], S[1], S[2], S[3], S[4], S[5], 10, 0x243185be); RND(S[5], S[6], S[7], S[0], S[1], S[2], S[3], S[4], 11, 0x550c7dc3); RND(S[4], S[5], S[6], S[7], S[0], S[1], S[2], S[3], 12, 0x72be5d74); RND(S[3], S[4], S[5], S[6], S[7], S[0], S[1], S[2], 13, 0x80deb1fe); RND(S[2], S[3], S[4], S[5], S[6], S[7], S[0], S[1], 14, 0x9bdc06a7); RND(S[1], S[2], S[3], S[4], S[5], S[6], S[7], S[0], 15, 0xc19bf174); RND(S[0], S[1], S[2], S[3], S[4], S[5], S[6], S[7], 16, 0xe49b69c1); RND(S[7], S[0], S[1], S[2], S[3], S[4], S[5], S[6], 17, 0xefbe4786); RND(S[6], S[7], S[0], S[1], S[2], S[3], S[4], S[5], 18, 0x0fc19dc6); RND(S[5], S[6], S[7], S[0], S[1], S[2], S[3], S[4], 19, 0x240ca1cc); RND(S[4], S[5], S[6], S[7], S[0], S[1], S[2], S[3], 20, 0x2de92c6f); RND(S[3], S[4], S[5], S[6], S[7], S[0], S[1], S[2], 21, 0x4a7484aa); RND(S[2], S[3], S[4], S[5], S[6], S[7], S[0], S[1], 22, 0x5cb0a9dc); RND(S[1], S[2], S[3], S[4], S[5], S[6], S[7], S[0], 23, 0x76f988da); RND(S[0], S[1], S[2], S[3], S[4], S[5], S[6], S[7], 24, 0x983e5152); RND(S[7], S[0], S[1], S[2], S[3], S[4], S[5], S[6], 25, 0xa831c66d); RND(S[6], S[7], S[0], S[1], S[2], S[3], S[4], S[5], 26, 0xb00327c8); RND(S[5], S[6], S[7], S[0], S[1], S[2], S[3], S[4], 27, 0xbf597fc7); RND(S[4], S[5], S[6], S[7], S[0], S[1], S[2], S[3], 28, 0xc6e00bf3); RND(S[3], S[4], S[5], S[6], S[7], S[0], S[1], S[2], 29, 0xd5a79147); RND(S[2], S[3], S[4], S[5], S[6], S[7], S[0], S[1], 30, 0x06ca6351); RND(S[1], S[2], S[3], S[4], S[5], S[6], S[7], S[0], 31, 0x14292967); RND(S[0], S[1], S[2], S[3], S[4], S[5], S[6], S[7], 32, 0x27b70a85); RND(S[7], S[0], S[1], S[2], S[3], S[4], S[5], S[6], 33, 0x2e1b2138); RND(S[6], S[7], S[0], S[1], S[2], S[3], S[4], S[5], 34, 0x4d2c6dfc); RND(S[5], S[6], S[7], S[0], S[1], S[2], S[3], S[4], 35, 0x53380d13); RND(S[4], S[5], S[6], S[7], S[0], S[1], S[2], S[3], 36, 0x650a7354); RND(S[3], S[4], S[5], S[6], S[7], S[0], S[1], S[2], 37, 0x766a0abb); RND(S[2], S[3], S[4], S[5], S[6], S[7], S[0], S[1], 38, 0x81c2c92e); RND(S[1], S[2], S[3], S[4], S[5], S[6], S[7], S[0], 39, 0x92722c85); RND(S[0], S[1], S[2], S[3], S[4], S[5], S[6], S[7], 40, 0xa2bfe8a1); RND(S[7], S[0], S[1], S[2], S[3], S[4], S[5], S[6], 41, 0xa81a664b); RND(S[6], S[7], S[0], S[1], S[2], S[3], S[4], S[5], 42, 0xc24b8b70); RND(S[5], S[6], S[7], S[0], S[1], S[2], S[3], S[4], 43, 0xc76c51a3); RND(S[4], S[5], S[6], S[7], S[0], S[1], S[2], S[3], 44, 0xd192e819); RND(S[3], S[4], S[5], S[6], S[7], S[0], S[1], S[2], 45, 0xd6990624); RND(S[2], S[3], S[4], S[5], S[6], S[7], S[0], S[1], 46, 0xf40e3585); RND(S[1], S[2], S[3], S[4], S[5], S[6], S[7], S[0], 47, 0x106aa070); RND(S[0], S[1], S[2], S[3], S[4], S[5], S[6], S[7], 48, 0x19a4c116); RND(S[7], S[0], S[1], S[2], S[3], S[4], S[5], S[6], 49, 0x1e376c08); RND(S[6], S[7], S[0], S[1], S[2], S[3], S[4], S[5], 50, 0x2748774c); RND(S[5], S[6], S[7], S[0], S[1], S[2], S[3], S[4], 51, 0x34b0bcb5); RND(S[4], S[5], S[6], S[7], S[0], S[1], S[2], S[3], 52, 0x391c0cb3); RND(S[3], S[4], S[5], S[6], S[7], S[0], S[1], S[2], 53, 0x4ed8aa4a); RND(S[2], S[3], S[4], S[5], S[6], S[7], S[0], S[1], 54, 0x5b9cca4f); RND(S[1], S[2], S[3], S[4], S[5], S[6], S[7], S[0], 55, 0x682e6ff3); RND(S[0], S[1], S[2], S[3], S[4], S[5], S[6], S[7], 56, 0x748f82ee); RND(S[7], S[0], S[1], S[2], S[3], S[4], S[5], S[6], 57, 0x78a5636f); RND(S[6], S[7], S[0], S[1], S[2], S[3], S[4], S[5], 58, 0x84c87814); RND(S[5], S[6], S[7], S[0], S[1], S[2], S[3], S[4], 59, 0x8cc70208); RND(S[4], S[5], S[6], S[7], S[0], S[1], S[2], S[3], 60, 0x90befffa); RND(S[3], S[4], S[5], S[6], S[7], S[0], S[1], S[2], 61, 0xa4506ceb); RND(S[2], S[3], S[4], S[5], S[6], S[7], S[0], S[1], 62, 0xbef9a3f7); RND(S[1], S[2], S[3], S[4], S[5], S[6], S[7], S[0], 63, 0xc67178f2); #undef RND /* feedback */ for (i = 0; i < 8; i++) { sha_info->digest[i] = sha_info->digest[i] + S[i]; } } /* initialize the SHA digest */ static void sha_init(SHAobject *sha_info) { sha_info->digest[0] = 0x6A09E667L; sha_info->digest[1] = 0xBB67AE85L; sha_info->digest[2] = 0x3C6EF372L; sha_info->digest[3] = 0xA54FF53AL; sha_info->digest[4] = 0x510E527FL; sha_info->digest[5] = 0x9B05688CL; sha_info->digest[6] = 0x1F83D9ABL; sha_info->digest[7] = 0x5BE0CD19L; sha_info->count_lo = 0L; sha_info->count_hi = 0L; sha_info->local = 0; sha_info->digestsize = 32; } static void sha224_init(SHAobject *sha_info) { sha_info->digest[0] = 0xc1059ed8L; sha_info->digest[1] = 0x367cd507L; sha_info->digest[2] = 0x3070dd17L; sha_info->digest[3] = 0xf70e5939L; sha_info->digest[4] = 0xffc00b31L; sha_info->digest[5] = 0x68581511L; sha_info->digest[6] = 0x64f98fa7L; sha_info->digest[7] = 0xbefa4fa4L; sha_info->count_lo = 0L; sha_info->count_hi = 0L; sha_info->local = 0; sha_info->digestsize = 28; } /* update the SHA digest */ static void sha_update(SHAobject *sha_info, SHA_BYTE *buffer, Py_ssize_t count) { Py_ssize_t i; SHA_INT32 clo; clo = sha_info->count_lo + ((SHA_INT32)count << 3); if (clo < sha_info->count_lo) { ++sha_info->count_hi; } sha_info->count_lo = clo; sha_info->count_hi += (SHA_INT32)count >> 29; if (sha_info->local) { i = SHA_BLOCKSIZE - sha_info->local; if (i > count) { i = count; } memcpy(((SHA_BYTE *)sha_info->data) + sha_info->local, buffer, i); count -= i; buffer += i; sha_info->local += (int)i; if (sha_info->local == SHA_BLOCKSIZE) { sha_transform(sha_info); } else { return; } } while (count >= SHA_BLOCKSIZE) { memcpy(sha_info->data, buffer, SHA_BLOCKSIZE); buffer += SHA_BLOCKSIZE; count -= SHA_BLOCKSIZE; sha_transform(sha_info); } memcpy(sha_info->data, buffer, count); sha_info->local = (int)count; } /* finish computing the SHA digest */ static void sha_final(unsigned char digest[SHA_DIGESTSIZE], SHAobject *sha_info) { int count; SHA_INT32 lo_bit_count, hi_bit_count; lo_bit_count = sha_info->count_lo; hi_bit_count = sha_info->count_hi; count = (int)((lo_bit_count >> 3) & 0x3f); ((SHA_BYTE *)sha_info->data)[count++] = 0x80; if (count > SHA_BLOCKSIZE - 8) { memset(((SHA_BYTE *)sha_info->data) + count, 0, SHA_BLOCKSIZE - count); sha_transform(sha_info); memset((SHA_BYTE *)sha_info->data, 0, SHA_BLOCKSIZE - 8); } else { memset(((SHA_BYTE *)sha_info->data) + count, 0, SHA_BLOCKSIZE - 8 - count); } /* GJS: note that we add the hi/lo in big-endian. sha_transform will swap these values into host-order. */ sha_info->data[56] = (hi_bit_count >> 24) & 0xff; sha_info->data[57] = (hi_bit_count >> 16) & 0xff; sha_info->data[58] = (hi_bit_count >> 8) & 0xff; sha_info->data[59] = (hi_bit_count >> 0) & 0xff; sha_info->data[60] = (lo_bit_count >> 24) & 0xff; sha_info->data[61] = (lo_bit_count >> 16) & 0xff; sha_info->data[62] = (lo_bit_count >> 8) & 0xff; sha_info->data[63] = (lo_bit_count >> 0) & 0xff; sha_transform(sha_info); digest[0] = (unsigned char)((sha_info->digest[0] >> 24) & 0xff); digest[1] = (unsigned char)((sha_info->digest[0] >> 16) & 0xff); digest[2] = (unsigned char)((sha_info->digest[0] >> 8) & 0xff); digest[3] = (unsigned char)((sha_info->digest[0]) & 0xff); digest[4] = (unsigned char)((sha_info->digest[1] >> 24) & 0xff); digest[5] = (unsigned char)((sha_info->digest[1] >> 16) & 0xff); digest[6] = (unsigned char)((sha_info->digest[1] >> 8) & 0xff); digest[7] = (unsigned char)((sha_info->digest[1]) & 0xff); digest[8] = (unsigned char)((sha_info->digest[2] >> 24) & 0xff); digest[9] = (unsigned char)((sha_info->digest[2] >> 16) & 0xff); digest[10] = (unsigned char)((sha_info->digest[2] >> 8) & 0xff); digest[11] = (unsigned char)((sha_info->digest[2]) & 0xff); digest[12] = (unsigned char)((sha_info->digest[3] >> 24) & 0xff); digest[13] = (unsigned char)((sha_info->digest[3] >> 16) & 0xff); digest[14] = (unsigned char)((sha_info->digest[3] >> 8) & 0xff); digest[15] = (unsigned char)((sha_info->digest[3]) & 0xff); digest[16] = (unsigned char)((sha_info->digest[4] >> 24) & 0xff); digest[17] = (unsigned char)((sha_info->digest[4] >> 16) & 0xff); digest[18] = (unsigned char)((sha_info->digest[4] >> 8) & 0xff); digest[19] = (unsigned char)((sha_info->digest[4]) & 0xff); digest[20] = (unsigned char)((sha_info->digest[5] >> 24) & 0xff); digest[21] = (unsigned char)((sha_info->digest[5] >> 16) & 0xff); digest[22] = (unsigned char)((sha_info->digest[5] >> 8) & 0xff); digest[23] = (unsigned char)((sha_info->digest[5]) & 0xff); digest[24] = (unsigned char)((sha_info->digest[6] >> 24) & 0xff); digest[25] = (unsigned char)((sha_info->digest[6] >> 16) & 0xff); digest[26] = (unsigned char)((sha_info->digest[6] >> 8) & 0xff); digest[27] = (unsigned char)((sha_info->digest[6]) & 0xff); digest[28] = (unsigned char)((sha_info->digest[7] >> 24) & 0xff); digest[29] = (unsigned char)((sha_info->digest[7] >> 16) & 0xff); digest[30] = (unsigned char)((sha_info->digest[7] >> 8) & 0xff); digest[31] = (unsigned char)((sha_info->digest[7]) & 0xff); } static PyTypeObject SHA224type; static PyTypeObject SHA256type; static SHAobject * newSHA224object(void) { return (SHAobject *)PyObject_New(SHAobject, &SHA224type); } static SHAobject * newSHA256object(void) { return (SHAobject *)PyObject_New(SHAobject, &SHA256type); } /* Internal methods for a hash object */ static void SHA_dealloc(PyObject *ptr) { PyObject_Del(ptr); } static PyObject * SHA256Type_copy_impl(SHAobject *self) /*[clinic end generated code: output=1a8bbd66a0c9c168 input=f58840a618d4f2a7]*/ { SHAobject *newobj; if (Py_TYPE(self) == &SHA256type) { if ((newobj = newSHA256object()) == NULL) return NULL; } else { if ((newobj = newSHA224object()) == NULL) return NULL; } SHAcopy(self, newobj); return (PyObject *)newobj; } static PyObject * SHA256Type_digest_impl(SHAobject *self) /*[clinic end generated code: output=46616a5e909fbc3d input=f1f4cfea5cbde35c]*/ { unsigned char digest[SHA_DIGESTSIZE]; SHAobject temp; SHAcopy(self, &temp); sha_final(digest, &temp); return PyBytes_FromStringAndSize((const char *)digest, self->digestsize); } static PyObject * SHA256Type_hexdigest_impl(SHAobject *self) /*[clinic end generated code: output=725f8a7041ae97f3 input=0cc4c714693010d1]*/ { unsigned char digest[SHA_DIGESTSIZE]; SHAobject temp; /* Get the raw (binary) digest value */ SHAcopy(self, &temp); sha_final(digest, &temp); return _Py_strhex((const char *)digest, self->digestsize); } static PyObject * SHA256Type_update(SHAobject *self, PyObject *obj) /*[clinic end generated code: output=0967fb2860c66af7 input=b2d449d5b30f0f5a]*/ { Py_buffer buf; GET_BUFFER_VIEW_OR_ERROUT(obj, &buf); sha_update(self, buf.buf, buf.len); PyBuffer_Release(&buf); Py_RETURN_NONE; } static PyMethodDef SHA_methods[] = { SHA256TYPE_COPY_METHODDEF SHA256TYPE_DIGEST_METHODDEF SHA256TYPE_HEXDIGEST_METHODDEF SHA256TYPE_UPDATE_METHODDEF{NULL, NULL} /* sentinel */ }; static PyObject * SHA256_get_block_size(PyObject *self, void *closure) { return PyLong_FromLong(SHA_BLOCKSIZE); } static PyObject * SHA256_get_name(PyObject *self, void *closure) { if (((SHAobject *)self)->digestsize == 32) return PyUnicode_FromStringAndSize("sha256", 6); else return PyUnicode_FromStringAndSize("sha224", 6); } static PyGetSetDef SHA_getseters[] = { {"block_size", (getter)SHA256_get_block_size, NULL, NULL, NULL}, {"name", (getter)SHA256_get_name, NULL, NULL, NULL}, {NULL} /* Sentinel */ }; static PyMemberDef SHA_members[] = { {"digest_size", T_INT, offsetof(SHAobject, digestsize), READONLY, NULL}, {NULL} /* Sentinel */ }; static PyTypeObject SHA256type = { PyVarObject_HEAD_INIT(NULL, 0) "_sha256.sha256", /*tp_name*/ sizeof(SHAobject), /*tp_basicsize*/ 0, /*tp_itemsize*/ /* methods */ SHA_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_reserved*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ SHA_methods, /* tp_methods */ SHA_members, /* tp_members */ SHA_getseters, /* tp_getset */ }; static PyObject * _sha256_sha256_impl(PyObject *module, PyObject *string) /*[clinic end generated code: output=fa644436dcea5c31 input=09cce3fb855056b2]*/ { SHAobject *new; Py_buffer buf; if (string) GET_BUFFER_VIEW_OR_ERROUT(string, &buf); if ((new = newSHA256object()) == NULL) { if (string) PyBuffer_Release(&buf); return NULL; } sha_init(new); if (PyErr_Occurred()) { Py_DECREF(new); if (string) PyBuffer_Release(&buf); return NULL; } if (string) { sha_update(new, buf.buf, buf.len); PyBuffer_Release(&buf); } return (PyObject *)new; } static PyObject * _sha256_sha224_impl(PyObject *module, PyObject *string) /*[clinic end generated code: output=21e3ba22c3404f93 input=27a04ba24c353a73]*/ { SHAobject *new; Py_buffer buf; if (string) GET_BUFFER_VIEW_OR_ERROUT(string, &buf); if ((new = newSHA224object()) == NULL) { if (string) PyBuffer_Release(&buf); return NULL; } sha224_init(new); if (PyErr_Occurred()) { Py_DECREF(new); if (string) PyBuffer_Release(&buf); return NULL; } if (string) { sha_update(new, buf.buf, buf.len); PyBuffer_Release(&buf); } return (PyObject *)new; }
34.081081
79
0.536309
8d27f54d96ae5bfd15ca0714978625870b0718c7
4,021
h
C
chromium/chrome/browser/ui/views/frame/browser_header_painter_ash.h
wedataintelligence/vivaldi-source
22a46f2c969f6a0b7ca239a05575d1ea2738768c
[ "BSD-3-Clause" ]
null
null
null
chromium/chrome/browser/ui/views/frame/browser_header_painter_ash.h
wedataintelligence/vivaldi-source
22a46f2c969f6a0b7ca239a05575d1ea2738768c
[ "BSD-3-Clause" ]
null
null
null
chromium/chrome/browser/ui/views/frame/browser_header_painter_ash.h
wedataintelligence/vivaldi-source
22a46f2c969f6a0b7ca239a05575d1ea2738768c
[ "BSD-3-Clause" ]
null
null
null
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_HEADER_PAINTER_ASH_H_ #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_HEADER_PAINTER_ASH_H_ #include "ash/frame/header_painter.h" #include "base/compiler_specific.h" // override #include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "ui/gfx/animation/animation_delegate.h" class BrowserView; namespace ash { class FrameCaptionButtonContainerView; } namespace gfx { class ImageSkia; class Rect; class SlideAnimation; } namespace views { class View; class Widget; } // Helper class for painting the browser window header. class BrowserHeaderPainterAsh : public ash::HeaderPainter, public gfx::AnimationDelegate { public: BrowserHeaderPainterAsh(); ~BrowserHeaderPainterAsh() override; // BrowserHeaderPainterAsh does not take ownership of any of the parameters. void Init( views::Widget* frame, BrowserView* browser_view, views::View* header_view, views::View* window_icon, ash::FrameCaptionButtonContainerView* caption_button_container); // ash::HeaderPainter overrides: int GetMinimumHeaderWidth() const override; void PaintHeader(gfx::Canvas* canvas, Mode mode) override; void LayoutHeader() override; int GetHeaderHeight() const override; int GetHeaderHeightForPainting() const override; void SetHeaderHeightForPainting(int height) override; void SchedulePaintForTitle() override; void UpdateLeftViewXInset(int left_view_x_inset) override; private: // gfx::AnimationDelegate override: void AnimationProgressed(const gfx::Animation* animation) override; // Paints highlight around the edge of the header for restored windows. void PaintHighlightForRestoredWindow(gfx::Canvas* canvas); // Paints the title bar, primarily the title string. void PaintTitleBar(gfx::Canvas* canvas); // Sets |frame_image| and |frame_overlay_image| to the frame image and the // frame overlay image respectivately which should be used to paint the // header. void GetFrameImages(Mode mode, gfx::ImageSkia* frame_image, gfx::ImageSkia* frame_overlay_image) const; // Sets |frame_image| and |frame_overlay_image| to the frame image and the // frame overlay image respectively that should be used to paint the header // for tabbed browser windows. void GetFrameImagesForTabbedBrowser( Mode mode, gfx::ImageSkia* frame_image, gfx::ImageSkia* frame_overlay_image) const; // Returns the frame image which should be used to paint the header for popup // browser windows and for hosted app windows which show the toolbar. gfx::ImageSkia GetFrameImageForNonTabbedBrowser(Mode mode) const; // Updates the size and icons used for the minimize, restore, and close // buttons. void UpdateCaptionButtons(); // Returns bounds of the region in |view_| which is painted with the header // images. The region is assumed to start at the top left corner of |view_| // and to have the same width as |view_|. gfx::Rect GetPaintedBounds() const; // Returns the bounds for the title. gfx::Rect GetTitleBounds() const; views::Widget* frame_; // Whether the header is for a tabbed browser window. bool is_tabbed_; // Whether the header is for an incognito browser window. bool is_incognito_; // The header view. views::View* view_; views::View* window_icon_; int window_icon_x_inset_; ash::FrameCaptionButtonContainerView* caption_button_container_; int painted_height_; // Whether the header is painted for the first time. bool initial_paint_; // Whether the header should be painted as active. Mode mode_; scoped_ptr<gfx::SlideAnimation> activation_animation_; DISALLOW_COPY_AND_ASSIGN(BrowserHeaderPainterAsh); }; #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_HEADER_PAINTER_ASH_H_
32.427419
79
0.754787
c4ee9db6b4701f06ea7f825bc1413702aa55f357
2,191
h
C
drivers/scsi/bfa/bfa_port.h
tuxafgmur/OLD_Dhollmen_Kernel
90ed4e2e3e6321de246fa193705ae40ede4e2d8e
[ "BSD-Source-Code" ]
4
2016-07-01T04:50:02.000Z
2021-11-14T21:29:42.000Z
drivers/scsi/bfa/bfa_port.h
tuxafgmur/OLD_Dhollmen_Kernel
90ed4e2e3e6321de246fa193705ae40ede4e2d8e
[ "BSD-Source-Code" ]
null
null
null
drivers/scsi/bfa/bfa_port.h
tuxafgmur/OLD_Dhollmen_Kernel
90ed4e2e3e6321de246fa193705ae40ede4e2d8e
[ "BSD-Source-Code" ]
1
2020-04-03T14:00:39.000Z
2020-04-03T14:00:39.000Z
/* * Copyright (c) 2005-2010 Brocade Communications Systems, Inc. * All rights reserved * www.brocade.com * * Linux driver for Brocade Fibre Channel Host Bus Adapter. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License (GPL) Version 2 as * published by the Free Software Foundation * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. */ #ifndef __BFA_PORT_H__ #define __BFA_PORT_H__ #include "bfa_defs_svc.h" #include "bfa_ioc.h" #include "bfa_cs.h" typedef void (*bfa_port_stats_cbfn_t) (void *dev, bfa_status_t status); typedef void (*bfa_port_endis_cbfn_t) (void *dev, bfa_status_t status); struct bfa_port_s { void *dev; struct bfa_ioc_s *ioc; struct bfa_trc_mod_s *trcmod; u32 msgtag; bfa_boolean_t stats_busy; struct bfa_mbox_cmd_s stats_mb; bfa_port_stats_cbfn_t stats_cbfn; void *stats_cbarg; bfa_status_t stats_status; u32 stats_reset_time; union bfa_port_stats_u *stats; struct bfa_dma_s stats_dma; bfa_boolean_t endis_pending; struct bfa_mbox_cmd_s endis_mb; bfa_port_endis_cbfn_t endis_cbfn; void *endis_cbarg; bfa_status_t endis_status; struct bfa_ioc_hbfail_notify_s hbfail; }; void bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc, void *dev, struct bfa_trc_mod_s *trcmod); void bfa_port_hbfail(void *arg); bfa_status_t bfa_port_get_stats(struct bfa_port_s *port, union bfa_port_stats_u *stats, bfa_port_stats_cbfn_t cbfn, void *cbarg); bfa_status_t bfa_port_clear_stats(struct bfa_port_s *port, bfa_port_stats_cbfn_t cbfn, void *cbarg); bfa_status_t bfa_port_enable(struct bfa_port_s *port, bfa_port_endis_cbfn_t cbfn, void *cbarg); bfa_status_t bfa_port_disable(struct bfa_port_s *port, bfa_port_endis_cbfn_t cbfn, void *cbarg); u32 bfa_port_meminfo(void); void bfa_port_mem_claim(struct bfa_port_s *port, u8 *dma_kva, u64 dma_pa); #endif /* __BFA_PORT_H__ */
33.19697
74
0.761296
a010fadff50f3ae9ddfe8e53bd0ff29746eb47da
5,841
c
C
bundles/deployment_admin/src/log_sync.c
reiform/celix
c1e900ea53d6ac65388bcbfc70e06d132d1df7c0
[ "Apache-2.0" ]
113
2015-03-12T12:47:40.000Z
2022-03-28T08:47:11.000Z
bundles/deployment_admin/src/log_sync.c
reiform/celix
c1e900ea53d6ac65388bcbfc70e06d132d1df7c0
[ "Apache-2.0" ]
295
2015-10-16T12:32:07.000Z
2022-03-26T14:48:11.000Z
bundles/deployment_admin/src/log_sync.c
reiform/celix
c1e900ea53d6ac65388bcbfc70e06d132d1df7c0
[ "Apache-2.0" ]
93
2015-09-13T14:02:04.000Z
2022-02-14T02:19:56.000Z
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /** * log_sync.c * * \date Apr 19, 2012 * \author <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a> * \copyright Apache License, Version 2.0 */ #include <stdlib.h> #include <stdio.h> #include <string.h> #include <unistd.h> #include <curl/curl.h> #include <curl/easy.h> #include "celix_errno.h" #include "celix_log.h" #include "celixbool.h" #include "celix_threads.h" #include "log_sync.h" #include "log_event.h" struct log_sync { log_store_pt logStore; char *targetId; bool running; celix_thread_t syncTask; }; struct log_descriptor { char *targetId; unsigned long logId; unsigned long low; unsigned long high; }; typedef struct log_descriptor *log_descriptor_pt; celix_status_t logSync_queryLog(log_sync_pt logSync, char *targetId, long logId, char **queryReply); static size_t logSync_readQuery(void *contents, size_t size, size_t nmemb, void *userp); static void *logSync_synchronize(void *logSyncP); celix_status_t logSync_create(char *targetId, log_store_pt store, log_sync_pt *logSync) { celix_status_t status = CELIX_SUCCESS; *logSync = calloc(1, sizeof(**logSync)); if (!*logSync) { status = CELIX_ENOMEM; } else { (*logSync)->logStore = store; (*logSync)->targetId = targetId; (*logSync)->syncTask = celix_thread_default; (*logSync)->running = true; celixThread_create(&(*logSync)->syncTask, NULL, logSync_synchronize, *logSync); } return status; } celix_status_t logSync_parseLogDescriptor(log_sync_pt logSync, char *descriptorString, log_descriptor_pt *descriptor) { celix_status_t status = CELIX_SUCCESS; fw_log(celix_frameworkLogger_globalLogger(), CELIX_LOG_LEVEL_DEBUG, "Descriptor: %s", descriptorString); char *last = NULL; char *targetId = strtok_r(descriptorString, ",", &last); char *logIdStr = strtok_r(NULL, ",", &last); long logId = 0; if (logIdStr != NULL) { logId = atol(logIdStr); } char *range = strtok_r(NULL, ",", &last); fw_log(celix_frameworkLogger_globalLogger(), CELIX_LOG_LEVEL_DEBUG, "Range: %s", range); long low = 0; long high = 0; if (range != NULL) { char *rangeToken = NULL; low = atol(strtok_r(range, "-", &rangeToken)); high = atol(strtok_r(NULL, "-", &rangeToken)); } *descriptor = calloc(1, sizeof(**descriptor)); if (!*descriptor) { status = CELIX_ENOMEM; } else { (*descriptor)->targetId = targetId; (*descriptor)->logId = logId; (*descriptor)->low = low; (*descriptor)->high = high; } return status; } static void *logSync_synchronize(void *logSyncP) { log_sync_pt logSync = logSyncP; while (logSync->running) { //query current log // http://localhost:8080/auditlog/query?tid=targetid&logid=logid char *logDescriptorString = NULL; unsigned long id = 0; logStore_getLogId(logSync->logStore, &id); logSync_queryLog(logSync, logSync->targetId, id, &logDescriptorString); log_descriptor_pt descriptor = NULL; logSync_parseLogDescriptor(logSync, logDescriptorString, &descriptor); long highest = 0; logStore_getHighestId(logSync->logStore, &highest); if (highest >= 0) { int i; for (i = descriptor->high + 1; i <= highest; i++) { array_list_pt events = NULL; logStore_getEvents(logSync->logStore, &events); } } if(descriptor!=NULL){ free(descriptor); } sleep(10); } celixThread_exit(NULL); return NULL; } struct MemoryStruct { char *memory; size_t size; }; celix_status_t logSync_queryLog(log_sync_pt logSync, char *targetId, long logId, char **queryReply) { // http://localhost:8080/auditlog/query?tid=targetid&logid=logid celix_status_t status = CELIX_SUCCESS; int length = strlen(targetId) + 60; char query[length]; snprintf(query, length, "http://localhost:8080/auditlog/query?tid=%s&logid=1", targetId); CURL *curl; CURLcode res; curl = curl_easy_init(); struct MemoryStruct chunk; chunk.memory = calloc(1, sizeof(char)); chunk.size = 0; if (curl) { curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); curl_easy_setopt(curl, CURLOPT_URL, query); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, logSync_readQuery); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &chunk); curl_easy_setopt(curl, CURLOPT_FAILONERROR, true); res = curl_easy_perform(curl); if (res != CURLE_OK) { status = CELIX_BUNDLE_EXCEPTION; } fw_log(celix_frameworkLogger_globalLogger(), CELIX_LOG_LEVEL_ERROR, "Error: %d", res); /* always cleanup */ curl_easy_cleanup(curl); *queryReply = strdup(chunk.memory); } return status; } static size_t logSync_readQuery(void *contents, size_t size, size_t nmemb, void *userp) { size_t realsize = size * nmemb; struct MemoryStruct *mem = (struct MemoryStruct *)userp; mem->memory = realloc(mem->memory, mem->size + realsize + 1); if (mem->memory == NULL) { /* out of memory! */ fw_log(celix_frameworkLogger_globalLogger(), CELIX_LOG_LEVEL_ERROR, "not enough memory (realloc returned NULL)"); exit(EXIT_FAILURE); } memcpy(&(mem->memory[mem->size]), contents, realsize); mem->size += realsize; mem->memory[mem->size] = 0; return realsize; }
27.682464
119
0.719226
12338bb88915e6b99f70223c6a04ee48452c3ac9
508
h
C
Custom/Custom/Commons/Categories/NSNumber+Extension.h
ShuailongWang/MyCustom
53cd186aaeb69b500a56c90c2d38eaf007f95e21
[ "MIT" ]
null
null
null
Custom/Custom/Commons/Categories/NSNumber+Extension.h
ShuailongWang/MyCustom
53cd186aaeb69b500a56c90c2d38eaf007f95e21
[ "MIT" ]
null
null
null
Custom/Custom/Commons/Categories/NSNumber+Extension.h
ShuailongWang/MyCustom
53cd186aaeb69b500a56c90c2d38eaf007f95e21
[ "MIT" ]
null
null
null
// // NSNumber+Extension.h // RGfzzd // // Created by admin on 16/12/19. // Copyright © 2016年 北京奥泰瑞格科技有限公司. All rights reserved. // #import <Foundation/Foundation.h> @interface NSNumber (Extension) //年月日 - (NSString *)ReturnDateWithFormatter:(NSString*)format; /** 根据秒返回年月日时分 @return NSString */ - (NSString *)ReturnDateAndTiem; /** 根据秒返回年月日 @return NSString */ - (NSString *)ReturnDate; /** 年/月/日 */ - (NSString *)ReturnSymbolDate; /** 年-月 */ - (NSString *)ReturnYearOrMonth; @end
12.390244
56
0.661417
161df359bb069b560432a7b64d692913fbaf4271
1,406
h
C
prom/src/prom_process_limits_t.h
edgego/prometheus-client-c
8c22746668b7d0bf930f4bb58d52e0490713c2c8
[ "Apache-2.0" ]
98
2019-10-23T19:01:46.000Z
2022-03-30T08:35:59.000Z
prom/src/prom_process_limits_t.h
edgego/prometheus-client-c
8c22746668b7d0bf930f4bb58d52e0490713c2c8
[ "Apache-2.0" ]
41
2019-10-24T18:10:38.000Z
2022-02-23T13:20:26.000Z
prom/src/prom_process_limits_t.h
edgego/prometheus-client-c
8c22746668b7d0bf930f4bb58d52e0490713c2c8
[ "Apache-2.0" ]
32
2019-10-23T19:11:29.000Z
2022-03-16T09:33:44.000Z
/** * Copyright 2019-2020 DigitalOcean Inc. * * 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. */ #ifndef PROM_PROCESS_T_H #define PROM_PROCESS_T_H #include "prom_gauge.h" #include "prom_procfs_t.h" extern prom_gauge_t *prom_process_open_fds; extern prom_gauge_t *prom_process_max_fds; extern prom_gauge_t *prom_process_virtual_memory_max_bytes; typedef struct prom_process_limits_row { const char *limit; /**< Pointer to a string */ int soft; /**< Soft value */ int hard; /**< Hard value */ const char *units; /**< Units */ } prom_process_limits_row_t; typedef struct prom_process_limits_current_row { char *limit; /**< Pointer to a string */ int soft; /**< Soft value */ int hard; /**< Hard value */ char *units; /**< Units */ } prom_process_limits_current_row_t; typedef prom_procfs_buf_t prom_process_limits_file_t; #endif // PROM_PROCESS_T_H
31.954545
75
0.728307
e942e93a451d470393c2ecbd7355b78fd490ff87
2,200
h
C
AmberFoundation/NSData+Additions.h
PedroTrujilloV/amber-framework
80748ed5ffea564bfb59505cdaca9b366caa99b2
[ "BSD-3-Clause" ]
1
2019-01-14T03:12:01.000Z
2019-01-14T03:12:01.000Z
AmberFoundation/NSData+Additions.h
PedroTrujilloV/amber-framework
80748ed5ffea564bfb59505cdaca9b366caa99b2
[ "BSD-3-Clause" ]
null
null
null
AmberFoundation/NSData+Additions.h
PedroTrujilloV/amber-framework
80748ed5ffea564bfb59505cdaca9b366caa99b2
[ "BSD-3-Clause" ]
null
null
null
// // NSData+Additions.h // Amber // // Created by Keith Duncan on 04/01/2007. // Copyright 2007. All rights reserved. // #import <Foundation/Foundation.h> /*! \brief Wrapper around the CommonCrypto hashing functions. These data objects are unlikely to be used raw, there are a number of base conversion methods in the <tt>NSData (AFBaseConversion)</tt> category. */ @interface NSData (AFHashing) - (NSData *)MD5Hash; - (NSData *)SHA1Hash; - (NSData *)HMACUsingSHA1_withSecretKey:(NSData *)secretKey; @end /*! \brief Allow a caller to convert a binary NSData to an NSString of required base. The methods are defined in pairs, allowing for the string to be reinterpreted as binary data again. \details These encodings are detailed in IETF-RFC-4648 http://tools.ietf.org/html/rfc4648 */ @interface NSData (AFBaseConversion) /*! \brief Decode a base64 string, this encoding is defined in IETF-RFC-4648 §4 http://tools.ietf.org/html/rfc4648#section-4 \return nil if the <tt>base64String</tt> parameter is not a valid base64 encoding. */ + (id)dataWithBase64String:(NSString *)base64String; /*! \brief Encode the receiver into a base64 string, this encoding is defined in IETF-RFC-4648 §4 http://tools.ietf.org/html/rfc4648#section-4 */ - (NSString *)base64String; /*! \brief Decode a base32 string, this encoding is defined in IETF-RFC-4648 §6 http://tools.ietf.org/html/rfc4648#section-6 \return nil if the <tt>base32String</tt> parameter is not a valid base32 encoding. */ + (id)dataWithBase32String:(NSString *)base32String; /*! \brief Encode the receiver into a base32 string, this encoding is defined in IETF-RFC-4648 §6 http://tools.ietf.org/html/rfc4648#section-8 */ - (NSString *)base32String; /*! \brief Decode a base16 string, this encoding is defined in IETF-RFC-4648 §8 http://tools.ietf.org/html/rfc4648#section-8 \return nil if the <tt>base16String</tt> parameter is not a valid base16 encoding. */ + (id)dataWithBase16String:(NSString *)base16String; /*! \brief Encode the receiver into a base16 string, this encoding is defined in IETF-RFC-4648 §8 http://tools.ietf.org/html/rfc4648#section-8 */ - (NSString *)base16String; @end
27.160494
146
0.733182
eb2e8a959556c73a1876ee92a1e1f8b7b8285884
5,542
h
C
bsp/at91sam9260/platform/gpio.h
Davidfind/rt-thread
56f1a8af4f9e8bad0a0fdc5cea7112767267b243
[ "Apache-2.0" ]
10
2019-12-23T07:18:27.000Z
2020-12-19T04:35:43.000Z
bsp/at91sam9260/platform/gpio.h
zlzerg/rt-thread
c0a400ccbee720fc0e9ee904298f09bd07a21382
[ "Apache-2.0" ]
5
2019-02-28T10:07:03.000Z
2019-03-11T10:40:20.000Z
bsp/at91sam9260/platform/gpio.h
zlzerg/rt-thread
c0a400ccbee720fc0e9ee904298f09bd07a21382
[ "Apache-2.0" ]
7
2019-07-01T02:50:47.000Z
2020-12-11T10:01:07.000Z
/* * File : gpio.h * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006, RT-Thread Development Team * * 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. * * Change Logs: * Date Author Notes * 2011-01-13 weety first version */ #ifndef __GPIO_H__ #define __GPIO_H__ #include <rtthread.h> #include <at91_aic.h> #define PIN_BASE AIC_IRQS #define MAX_GPIO_BANKS 3 #define PIN_IRQS (MAX_GPIO_BANKS*32) /* these pin numbers double as IRQ numbers, like AT91xxx_ID_* values */ #define AT91_PIN_PA0 (PIN_BASE + 0x00 + 0) #define AT91_PIN_PA1 (PIN_BASE + 0x00 + 1) #define AT91_PIN_PA2 (PIN_BASE + 0x00 + 2) #define AT91_PIN_PA3 (PIN_BASE + 0x00 + 3) #define AT91_PIN_PA4 (PIN_BASE + 0x00 + 4) #define AT91_PIN_PA5 (PIN_BASE + 0x00 + 5) #define AT91_PIN_PA6 (PIN_BASE + 0x00 + 6) #define AT91_PIN_PA7 (PIN_BASE + 0x00 + 7) #define AT91_PIN_PA8 (PIN_BASE + 0x00 + 8) #define AT91_PIN_PA9 (PIN_BASE + 0x00 + 9) #define AT91_PIN_PA10 (PIN_BASE + 0x00 + 10) #define AT91_PIN_PA11 (PIN_BASE + 0x00 + 11) #define AT91_PIN_PA12 (PIN_BASE + 0x00 + 12) #define AT91_PIN_PA13 (PIN_BASE + 0x00 + 13) #define AT91_PIN_PA14 (PIN_BASE + 0x00 + 14) #define AT91_PIN_PA15 (PIN_BASE + 0x00 + 15) #define AT91_PIN_PA16 (PIN_BASE + 0x00 + 16) #define AT91_PIN_PA17 (PIN_BASE + 0x00 + 17) #define AT91_PIN_PA18 (PIN_BASE + 0x00 + 18) #define AT91_PIN_PA19 (PIN_BASE + 0x00 + 19) #define AT91_PIN_PA20 (PIN_BASE + 0x00 + 20) #define AT91_PIN_PA21 (PIN_BASE + 0x00 + 21) #define AT91_PIN_PA22 (PIN_BASE + 0x00 + 22) #define AT91_PIN_PA23 (PIN_BASE + 0x00 + 23) #define AT91_PIN_PA24 (PIN_BASE + 0x00 + 24) #define AT91_PIN_PA25 (PIN_BASE + 0x00 + 25) #define AT91_PIN_PA26 (PIN_BASE + 0x00 + 26) #define AT91_PIN_PA27 (PIN_BASE + 0x00 + 27) #define AT91_PIN_PA28 (PIN_BASE + 0x00 + 28) #define AT91_PIN_PA29 (PIN_BASE + 0x00 + 29) #define AT91_PIN_PA30 (PIN_BASE + 0x00 + 30) #define AT91_PIN_PA31 (PIN_BASE + 0x00 + 31) #define AT91_PIN_PB0 (PIN_BASE + 0x20 + 0) #define AT91_PIN_PB1 (PIN_BASE + 0x20 + 1) #define AT91_PIN_PB2 (PIN_BASE + 0x20 + 2) #define AT91_PIN_PB3 (PIN_BASE + 0x20 + 3) #define AT91_PIN_PB4 (PIN_BASE + 0x20 + 4) #define AT91_PIN_PB5 (PIN_BASE + 0x20 + 5) #define AT91_PIN_PB6 (PIN_BASE + 0x20 + 6) #define AT91_PIN_PB7 (PIN_BASE + 0x20 + 7) #define AT91_PIN_PB8 (PIN_BASE + 0x20 + 8) #define AT91_PIN_PB9 (PIN_BASE + 0x20 + 9) #define AT91_PIN_PB10 (PIN_BASE + 0x20 + 10) #define AT91_PIN_PB11 (PIN_BASE + 0x20 + 11) #define AT91_PIN_PB12 (PIN_BASE + 0x20 + 12) #define AT91_PIN_PB13 (PIN_BASE + 0x20 + 13) #define AT91_PIN_PB14 (PIN_BASE + 0x20 + 14) #define AT91_PIN_PB15 (PIN_BASE + 0x20 + 15) #define AT91_PIN_PB16 (PIN_BASE + 0x20 + 16) #define AT91_PIN_PB17 (PIN_BASE + 0x20 + 17) #define AT91_PIN_PB18 (PIN_BASE + 0x20 + 18) #define AT91_PIN_PB19 (PIN_BASE + 0x20 + 19) #define AT91_PIN_PB20 (PIN_BASE + 0x20 + 20) #define AT91_PIN_PB21 (PIN_BASE + 0x20 + 21) #define AT91_PIN_PB22 (PIN_BASE + 0x20 + 22) #define AT91_PIN_PB23 (PIN_BASE + 0x20 + 23) #define AT91_PIN_PB24 (PIN_BASE + 0x20 + 24) #define AT91_PIN_PB25 (PIN_BASE + 0x20 + 25) #define AT91_PIN_PB26 (PIN_BASE + 0x20 + 26) #define AT91_PIN_PB27 (PIN_BASE + 0x20 + 27) #define AT91_PIN_PB28 (PIN_BASE + 0x20 + 28) #define AT91_PIN_PB29 (PIN_BASE + 0x20 + 29) #define AT91_PIN_PB30 (PIN_BASE + 0x20 + 30) #define AT91_PIN_PB31 (PIN_BASE + 0x20 + 31) #define AT91_PIN_PC0 (PIN_BASE + 0x40 + 0) #define AT91_PIN_PC1 (PIN_BASE + 0x40 + 1) #define AT91_PIN_PC2 (PIN_BASE + 0x40 + 2) #define AT91_PIN_PC3 (PIN_BASE + 0x40 + 3) #define AT91_PIN_PC4 (PIN_BASE + 0x40 + 4) #define AT91_PIN_PC5 (PIN_BASE + 0x40 + 5) #define AT91_PIN_PC6 (PIN_BASE + 0x40 + 6) #define AT91_PIN_PC7 (PIN_BASE + 0x40 + 7) #define AT91_PIN_PC8 (PIN_BASE + 0x40 + 8) #define AT91_PIN_PC9 (PIN_BASE + 0x40 + 9) #define AT91_PIN_PC10 (PIN_BASE + 0x40 + 10) #define AT91_PIN_PC11 (PIN_BASE + 0x40 + 11) #define AT91_PIN_PC12 (PIN_BASE + 0x40 + 12) #define AT91_PIN_PC13 (PIN_BASE + 0x40 + 13) #define AT91_PIN_PC14 (PIN_BASE + 0x40 + 14) #define AT91_PIN_PC15 (PIN_BASE + 0x40 + 15) #define AT91_PIN_PC16 (PIN_BASE + 0x40 + 16) #define AT91_PIN_PC17 (PIN_BASE + 0x40 + 17) #define AT91_PIN_PC18 (PIN_BASE + 0x40 + 18) #define AT91_PIN_PC19 (PIN_BASE + 0x40 + 19) #define AT91_PIN_PC20 (PIN_BASE + 0x40 + 20) #define AT91_PIN_PC21 (PIN_BASE + 0x40 + 21) #define AT91_PIN_PC22 (PIN_BASE + 0x40 + 22) #define AT91_PIN_PC23 (PIN_BASE + 0x40 + 23) #define AT91_PIN_PC24 (PIN_BASE + 0x40 + 24) #define AT91_PIN_PC25 (PIN_BASE + 0x40 + 25) #define AT91_PIN_PC26 (PIN_BASE + 0x40 + 26) #define AT91_PIN_PC27 (PIN_BASE + 0x40 + 27) #define AT91_PIN_PC28 (PIN_BASE + 0x40 + 28) #define AT91_PIN_PC29 (PIN_BASE + 0x40 + 29) #define AT91_PIN_PC30 (PIN_BASE + 0x40 + 30) #define AT91_PIN_PC31 (PIN_BASE + 0x40 + 31) rt_inline rt_uint32_t gpio_to_irq(rt_uint32_t gpio) { return gpio; } #endif
38.22069
75
0.726633
eb32a8f19e3c44cd91b9a6fb708bf0c4fa85b539
11,517
h
C
src/proc-db/tea.h
behollis/brlcad-svn-rev65072-gsoc2015
c2e49d80e0776ea6da4358a345a04f56e0088b90
[ "BSD-4-Clause", "BSD-3-Clause" ]
35
2015-03-11T11:51:48.000Z
2021-07-25T16:04:49.000Z
src/proc-db/tea.h
CloudComputer/brlcad
05952aafa27ee9df17cd900f5d8f8217ed2194af
[ "BSD-4-Clause", "BSD-3-Clause" ]
null
null
null
src/proc-db/tea.h
CloudComputer/brlcad
05952aafa27ee9df17cd900f5d8f8217ed2194af
[ "BSD-4-Clause", "BSD-3-Clause" ]
19
2016-05-04T08:39:37.000Z
2021-12-07T12:45:54.000Z
/* T E A . H * BRL-CAD * * Copyright (c) 2004-2014 United States Government as represented by * the U.S. Army Research Laboratory. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this file; see the file named COPYING for more * information. */ /** @file proc-db/tea.h * * Utah Teapot vertex data (ducks) and patch data * */ #ifndef PROC_DB_TEA_H #define PROC_DB_TEA_H #define DEGREE 4 #define DUCK_COUNT 306 #define PATCH_COUNT 32 typedef struct { double x, y, z; } dt; typedef int pt[DEGREE][DEGREE]; dt ducks[DUCK_COUNT] = { {1.4, 0.0, 2.4}, {1.4, -0.784, 2.4}, {0.784, -1.4, 2.4}, {0.0, -1.4, 2.4}, {1.3375, 0.0, 2.53125}, {1.3375, -0.749, 2.53125}, {0.749, -1.3375, 2.53125}, {0.0, -1.3375, 2.53125}, {1.4375, 0.0, 2.53125}, {1.4375, -0.805, 2.53125}, {0.805, -1.4375, 2.53125}, {0.0, -1.4375, 2.53125}, {1.5, 0.0, 2.4}, {1.5, -0.84, 2.4}, {0.84, -1.5, 2.4}, {0.0, -1.5, 2.4}, {-0.784, -1.4, 2.4}, {-1.4, -0.784, 2.4}, {-1.4, 0.0, 2.4}, {-0.749, -1.3375, 2.53125}, {-1.3375, -0.749, 2.53125}, {-1.3375, 0.0, 2.53125}, {-0.805, -1.4375, 2.53125}, {-1.4375, -0.805, 2.53125}, {-1.4375, 0.0, 2.53125}, {-0.84, -1.5, 2.4}, {-1.5, -0.84, 2.4}, {-1.5, 0.0, 2.4}, {-1.4, 0.784, 2.4}, {-0.784, 1.4, 2.4}, {0.0, 1.4, 2.4}, {-1.3375, 0.749, 2.53125}, {-0.749, 1.3375, 2.53125}, {0.0, 1.3375, 2.53125}, {-1.4375, 0.805, 2.53125}, {-0.805, 1.4375, 2.53125}, {0.0, 1.4375, 2.53125}, {-1.5, 0.84, 2.4}, {-0.84, 1.5, 2.4}, {0.0, 1.5, 2.4}, {0.784, 1.4, 2.4}, {1.4, 0.784, 2.4}, {0.749, 1.3375, 2.53125}, {1.3375, 0.749, 2.53125}, {0.805, 1.4375, 2.53125}, {1.4375, 0.805, 2.53125}, {0.84, 1.5, 2.4}, {1.5, 0.84, 2.4}, {1.75, 0.0, 1.875}, {1.75, -0.98, 1.875}, {0.98, -1.75, 1.875}, {0.0, -1.75, 1.875}, {2.0, 0.0, 1.35}, {2.0, -1.12, 1.35}, {1.12, -2.0, 1.35}, {0.0, -2.0, 1.35}, {2.0, 0.0, 0.9}, {2.0, -1.12, 0.9}, {1.12, -2.0, 0.9}, {0.0, -2.0, 0.9}, {-0.98, -1.75, 1.875}, {-1.75, -0.98, 1.875}, {-1.75, 0.0, 1.875}, {-1.12, -2.0, 1.35}, {-2.0, -1.12, 1.35}, {-2.0, 0.0, 1.35}, {-1.12, -2.0, 0.9}, {-2.0, -1.12, 0.9}, {-2.0, 0.0, 0.9}, {-1.75, 0.98, 1.875}, {-0.98, 1.75, 1.875}, {0.0, 1.75, 1.875}, {-2.0, 1.12, 1.35}, {-1.12, 2.0, 1.35}, {0.0, 2.0, 1.35}, {-2.0, 1.12, 0.9}, {-1.12, 2.0, 0.9}, {0.0, 2.0, 0.9}, {0.98, 1.75, 1.875}, {1.75, 0.98, 1.875}, {1.12, 2.0, 1.35}, {2.0, 1.12, 1.35}, {1.12, 2.0, 0.9}, {2.0, 1.12, 0.9}, {2.0, 0.0, 0.45}, {2.0, -1.12, 0.45}, {1.12, -2.0, 0.45}, {0.0, -2.0, 0.45}, {1.5, 0.0, 0.225}, {1.5, -0.84, 0.225}, {0.84, -1.5, 0.225}, {0.0, -1.5, 0.225}, {1.5, 0.0, 0.15}, {1.5, -0.84, 0.15}, {0.84, -1.5, 0.15}, {0.0, -1.5, 0.15}, {-1.12, -2.0, 0.45}, {-2.0, -1.12, 0.45}, {-2.0, 0.0, 0.45}, {-0.84, -1.5, 0.225}, {-1.5, -0.84, 0.225}, {-1.5, 0.0, 0.225}, {-0.84, -1.5, 0.15}, {-1.5, -0.84, 0.15}, {-1.5, 0.0, 0.15}, {-2.0, 1.12, 0.45}, {-1.12, 2.0, 0.45}, {0.0, 2.0, 0.45}, {-1.5, 0.84, 0.225}, {-0.84, 1.5, 0.225}, {0.0, 1.5, 0.225}, {-1.5, 0.84, 0.15}, {-0.84, 1.5, 0.15}, {0.0, 1.5, 0.15}, {1.12, 2.0, 0.45}, {2.0, 1.12, 0.45}, {0.84, 1.5, 0.225}, {1.5, 0.84, 0.225}, {0.84, 1.5, 0.15}, {1.5, 0.84, 0.15}, {-1.6, 0.0, 2.025}, {-1.6, -0.3, 2.025}, {-1.5, -0.3, 2.25}, {-1.5, 0.0, 2.25}, {-2.3, 0.0, 2.025}, {-2.3, -0.3, 2.025}, {-2.5, -0.3, 2.25}, {-2.5, 0.0, 2.25}, {-2.7, 0.0, 2.025}, {-2.7, -0.3, 2.025}, {-3.0, -0.3, 2.25}, {-3.0, 0.0, 2.25}, {-2.7, 0.0, 1.8}, {-2.7, -0.3, 1.8}, {-3.0, -0.3, 1.8}, {-3.0, 0.0, 1.8}, {-1.5, 0.3, 2.25}, {-1.6, 0.3, 2.025}, {-2.5, 0.3, 2.25}, {-2.3, 0.3, 2.025}, {-3.0, 0.3, 2.25}, {-2.7, 0.3, 2.025}, {-3.0, 0.3, 1.8}, {-2.7, 0.3, 1.8}, {-2.7, 0.0, 1.575}, {-2.7, -0.3, 1.575}, {-3.0, -0.3, 1.35}, {-3.0, 0.0, 1.35}, {-2.5, 0.0, 1.125}, {-2.5, -0.3, 1.125}, {-2.65, -0.3, 0.9375}, {-2.65, 0.0, 0.9375}, {-2.0, -0.3, 0.9}, {-1.9, -0.3, 0.6}, {-1.9, 0.0, 0.6}, {-3.0, 0.3, 1.35}, {-2.7, 0.3, 1.575}, {-2.65, 0.3, 0.9375}, {-2.5, 0.3, 1.125}, {-1.9, 0.3, 0.6}, {-2.0, 0.3, 0.9}, {1.7, 0.0, 1.425}, {1.7, -0.66, 1.425}, {1.7, -0.66, 0.6}, {1.7, 0.0, 0.6}, {2.6, 0.0, 1.425}, {2.6, -0.66, 1.425}, {3.1, -0.66, 0.825}, {3.1, 0.0, 0.825}, {2.3, 0.0, 2.1}, {2.3, -0.25, 2.1}, {2.4, -0.25, 2.025}, {2.4, 0.0, 2.025}, {2.7, 0.0, 2.4}, {2.7, -0.25, 2.4}, {3.3, -0.25, 2.4}, {3.3, 0.0, 2.4}, {1.7, 0.66, 0.6}, {1.7, 0.66, 1.425}, {3.1, 0.66, 0.825}, {2.6, 0.66, 1.425}, {2.4, 0.25, 2.025}, {2.3, 0.25, 2.1}, {3.3, 0.25, 2.4}, {2.7, 0.25, 2.4}, {2.8, 0.0, 2.475}, {2.8, -0.25, 2.475}, {3.525, -0.25, 2.49375}, {3.525, 0.0, 2.49375}, {2.9, 0.0, 2.475}, {2.9, -0.15, 2.475}, {3.45, -0.15, 2.5125}, {3.45, 0.0, 2.5125}, {2.8, 0.0, 2.4}, {2.8, -0.15, 2.4}, {3.2, -0.15, 2.4}, {3.2, 0.0, 2.4}, {3.525, 0.25, 2.49375}, {2.8, 0.25, 2.475}, {3.45, 0.15, 2.5125}, {2.9, 0.15, 2.475}, {3.2, 0.15, 2.4}, {2.8, 0.15, 2.4}, {0.0, 0.0, 3.15}, {0.0, -0.002, 3.15}, {0.002, 0.0, 3.15}, {0.8, 0.0, 3.15}, {0.8, -0.45, 3.15}, {0.45, -0.8, 3.15}, {0.0, -0.8, 3.15}, {0.0, 0.0, 2.85}, {0.2, 0.0, 2.7}, {0.2, -0.112, 2.7}, {0.112, -0.2, 2.7}, {0.0, -0.2, 2.7}, {-0.002, 0.0, 3.15}, {-0.45, -0.8, 3.15}, {-0.8, -0.45, 3.15}, {-0.8, 0.0, 3.15}, {-0.112, -0.2, 2.7}, {-0.2, -0.112, 2.7}, {-0.2, 0.0, 2.7}, {0.0, 0.002, 3.15}, {-0.8, 0.45, 3.15}, {-0.45, 0.8, 3.15}, {0.0, 0.8, 3.15}, {-0.2, 0.112, 2.7}, {-0.112, 0.2, 2.7}, {0.0, 0.2, 2.7}, {0.45, 0.8, 3.15}, {0.8, 0.45, 3.15}, {0.112, 0.2, 2.7}, {0.2, 0.112, 2.7}, {0.4, 0.0, 2.55}, {0.4, -0.224, 2.55}, {0.224, -0.4, 2.55}, {0.0, -0.4, 2.55}, {1.3, 0.0, 2.55}, {1.3, -0.728, 2.55}, {0.728, -1.3, 2.55}, {0.0, -1.3, 2.55}, {1.3, 0.0, 2.4}, {1.3, -0.728, 2.4}, {0.728, -1.3, 2.4}, {0.0, -1.3, 2.4}, {-0.224, -0.4, 2.55}, {-0.4, -0.224, 2.55}, {-0.4, 0.0, 2.55}, {-0.728, -1.3, 2.55}, {-1.3, -0.728, 2.55}, {-1.3, 0.0, 2.55}, {-0.728, -1.3, 2.4}, {-1.3, -0.728, 2.4}, {-1.3, 0.0, 2.4}, {-0.4, 0.224, 2.55}, {-0.224, 0.4, 2.55}, {0.0, 0.4, 2.55}, {-1.3, 0.728, 2.55}, {-0.728, 1.3, 2.55}, {0.0, 1.3, 2.55}, {-1.3, 0.728, 2.4}, {-0.728, 1.3, 2.4}, {0.0, 1.3, 2.4}, {0.224, 0.4, 2.55}, {0.4, 0.224, 2.55}, {0.728, 1.3, 2.55}, {1.3, 0.728, 2.55}, {0.728, 1.3, 2.4}, {1.3, 0.728, 2.4}, {0.0, 0.0, 0.0}, {1.5, 0.0, 0.15}, {1.5, 0.84, 0.15}, {0.84, 1.5, 0.15}, {0.0, 1.5, 0.15}, {1.5, 0.0, 0.075}, {1.5, 0.84, 0.075}, {0.84, 1.5, 0.075}, {0.0, 1.5, 0.075}, {1.425, 0.0, 0.0}, {1.425, 0.798, 0.0}, {0.798, 1.425, 0.0}, {0.0, 1.425, 0.0}, {-0.84, 1.5, 0.15}, {-1.5, 0.84, 0.15}, {-1.5, 0.0, 0.15}, {-0.84, 1.5, 0.075}, {-1.5, 0.84, 0.075}, {-1.5, 0.0, 0.075}, {-0.798, 1.425, 0.0}, {-1.425, 0.798, 0.0}, {-1.425, 0.0, 0.0}, {-1.5, -0.84, 0.15}, {-0.84, -1.5, 0.15}, {0.0, -1.5, 0.15}, {-1.5, -0.84, 0.075}, {-0.84, -1.5, 0.075}, {0.0, -1.5, 0.075}, {-1.425, -0.798, 0.0}, {-0.798, -1.425, 0.0}, {0.0, -1.425, 0.0}, {0.84, -1.5, 0.15}, {1.5, -0.84, 0.15}, {0.84, -1.5, 0.075}, {1.5, -0.84, 0.075}, {0.798, -1.425, 0.0}, {1.425, -0.798, 0.0}, }; pt patches[PATCH_COUNT] = { {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}, {13, 14, 15, 16}}, {{4, 17, 18, 19}, {8, 20, 21, 22}, {12, 23, 24, 25}, {16, 26, 27, 28}}, {{19, 29, 30, 31}, {22, 32, 33, 34}, {25, 35, 36, 37}, {28, 38, 39, 40}}, {{31, 41, 42, 1}, {34, 43, 44, 5}, {37, 45, 46, 9}, {40, 47, 48, 13}}, {{13, 14, 15, 16}, {49, 50, 51, 52}, {53, 54, 55, 56}, {57, 58, 59, 60}}, {{16, 26, 27, 28}, {52, 61, 62, 63}, {56, 64, 65, 66}, {60, 67, 68, 69}}, {{28, 38, 39, 40}, {63, 70, 71, 72}, {66, 73, 74, 75}, {69, 76, 77, 78}}, {{40, 47, 48, 13}, {72, 79, 80, 49}, {75, 81, 82, 53}, {78, 83, 84, 57}}, {{57, 58, 59, 60}, {85, 86, 87, 88}, {89, 90, 91, 92}, {93, 94, 95, 96}}, {{60, 67, 68, 69}, {88, 97, 98, 99}, {92, 100, 101, 102}, {96, 103, 104, 105}}, {{69, 76, 77, 78}, {99, 106, 107, 108}, {102, 109, 110, 111}, {105, 112, 113, 114}}, {{78, 83, 84, 57}, {108, 115, 116, 85}, {111, 117, 118, 89}, {114, 119, 120, 93}}, {{121, 122, 123, 124}, {125, 126, 127, 128}, {129, 130, 131, 132}, {133, 134, 135, 136}}, {{124, 137, 138, 121}, {128, 139, 140, 125}, {132, 141, 142, 129}, {136, 143, 144, 133}}, {{133, 134, 135, 136}, {145, 146, 147, 148}, {149, 150, 151, 152}, {69, 153, 154, 155}}, {{136, 143, 144, 133}, {148, 156, 157, 145}, {152, 158, 159, 149}, {155, 160, 161, 69}}, {{162, 163, 164, 165}, {166, 167, 168, 169}, {170, 171, 172, 173}, {174, 175, 176, 177}}, {{165, 178, 179, 162}, {169, 180, 181, 166}, {173, 182, 183, 170}, {177, 184, 185, 174}}, {{174, 175, 176, 177}, {186, 187, 188, 189}, {190, 191, 192, 193}, {194, 195, 196, 197}}, {{177, 184, 185, 174}, {189, 198, 199, 186}, {193, 200, 201, 190}, {197, 202, 203, 194}}, {{204, 204, 204, 204}, {207, 208, 209, 210}, {211, 211, 211, 211}, {212, 213, 214, 215}}, {{204, 204, 204, 204}, {210, 217, 218, 219}, {211, 211, 211, 211}, {215, 220, 221, 222}}, {{204, 204, 204, 204}, {219, 224, 225, 226}, {211, 211, 211, 211}, {222, 227, 228, 229}}, {{204, 204, 204, 204}, {226, 230, 231, 207}, {211, 211, 211, 211}, {229, 232, 233, 212}}, {{212, 213, 214, 215}, {234, 235, 236, 237}, {238, 239, 240, 241}, {242, 243, 244, 245}}, {{215, 220, 221, 222}, {237, 246, 247, 248}, {241, 249, 250, 251}, {245, 252, 253, 254}}, {{222, 227, 228, 229}, {248, 255, 256, 257}, {251, 258, 259, 260}, {254, 261, 262, 263}}, {{229, 232, 233, 212}, {257, 264, 265, 234}, {260, 266, 267, 238}, {263, 268, 269, 242}}, {{270, 270, 270, 270}, {279, 280, 281, 282}, {275, 276, 277, 278}, {271, 272, 273, 274}}, {{270, 270, 270, 270}, {282, 289, 290, 291}, {278, 286, 287, 288}, {274, 283, 284, 285}}, {{270, 270, 270, 270}, {291, 298, 299, 300}, {288, 295, 296, 297}, {285, 292, 293, 294}}, {{270, 270, 270, 270}, {300, 305, 306, 279}, {297, 303, 304, 275}, {294, 301, 302, 271}} }; #endif /* PROC_DB_TEA_H */ /* * Local Variables: * mode: C * tab-width: 8 * indent-tabs-mode: t * c-file-style: "stroustrup" * End: * ex: shiftwidth=4 tabstop=8 */
28.937186
93
0.41747
3a72ccb22f09fcb8233130fbd3b141d547dd6b11
213
h
C
Example/IndoorLocation/IndoorLocation/ViewController.h
Ubudu/IOS-IndoorLocation-SDK
11ac0233a0f4ce28baa74bbfd1b85ce0c2ccd830
[ "BSD-2-Clause" ]
4
2015-06-23T12:47:41.000Z
2018-05-25T22:11:23.000Z
Example/IndoorLocation/IndoorLocation/ViewController.h
Ubudu/IOS-IndoorLocation-SDK
11ac0233a0f4ce28baa74bbfd1b85ce0c2ccd830
[ "BSD-2-Clause" ]
3
2015-08-24T08:20:21.000Z
2018-06-20T08:53:11.000Z
Example/IndoorLocation/IndoorLocation/ViewController.h
Ubudu/IOS-IndoorLocation-SDK
11ac0233a0f4ce28baa74bbfd1b85ce0c2ccd830
[ "BSD-2-Clause" ]
null
null
null
// // ViewController.h // IndoorLocation // // Created by zioolek on 07/09/16. // Copyright © 2016 ubudu. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
13.3125
48
0.690141
5fc74f93f32ee244d308c7781d42c683b437abd3
3,505
h
C
src/framework/Navi/Navi/Lib/SketchHeaders/Frame/MSMainSplitViewController.h
design-to-release/sketch-navi
a29006b37fa6b3a313041b0adc7ccb35e0cd71a8
[ "MIT" ]
1
2020-06-18T08:58:45.000Z
2020-06-18T08:58:45.000Z
src/framework/Navi/Navi/Lib/SketchHeaders/Frame/MSMainSplitViewController.h
design-to-release/sketch-navi
a29006b37fa6b3a313041b0adc7ccb35e0cd71a8
[ "MIT" ]
3
2020-11-04T09:24:49.000Z
2021-08-31T19:48:22.000Z
src/framework/Navi/Navi/Lib/SketchHeaders/Frame/MSMainSplitViewController.h
design-to-release/sketch-navi
a29006b37fa6b3a313041b0adc7ccb35e0cd71a8
[ "MIT" ]
2
2020-08-17T14:38:24.000Z
2020-11-24T11:33:11.000Z
@interface MSMainSplitViewController : NSSplitViewController <NSSplitViewDelegate> { BOOL _inspectorVisible; BOOL _isInVersionBrowser; BOOL _shouldEncodeCurrentSidebarWidth; NSWindow *_window; // MSDocument *_document; // BCSideBarViewController *_sidebarController; // MSCanvasViewController *_canvasController; // MSInspectorController *_inspectorController; NSLayoutConstraint *_sidebarWidthConstraint; long long _leftSide; long long _rightSide; NSView *_savedInspectorView; double _restorableSidebarWidth; } @property(nonatomic) double restorableSidebarWidth; // @synthesize restorableSidebarWidth=_restorableSidebarWidth; @property(nonatomic) BOOL shouldEncodeCurrentSidebarWidth; // @synthesize shouldEncodeCurrentSidebarWidth=_shouldEncodeCurrentSidebarWidth; @property(retain, nonatomic) NSView *savedInspectorView; // @synthesize savedInspectorView=_savedInspectorView; @property(nonatomic) BOOL isInVersionBrowser; // @synthesize isInVersionBrowser=_isInVersionBrowser; @property(nonatomic) long long rightSide; // @synthesize rightSide=_rightSide; @property(nonatomic) long long leftSide; // @synthesize leftSide=_leftSide; @property(retain, nonatomic) NSLayoutConstraint *sidebarWidthConstraint; // @synthesize sidebarWidthConstraint=_sidebarWidthConstraint; @property(nonatomic, getter=isInspectorVisible) BOOL inspectorVisible; // @synthesize inspectorVisible=_inspectorVisible; //@property(retain, nonatomic) MSInspectorController *inspectorController; // @synthesize inspectorController=_inspectorController; //@property(retain, nonatomic) MSCanvasViewController *canvasController; // @synthesize canvasController=_canvasController; //@property(retain, nonatomic) BCSideBarViewController *sidebarController; // @synthesize sidebarController=_sidebarController; //@property(nonatomic) __weak MSDocument *document; // @synthesize document=_document; @property(retain, nonatomic) NSWindow *window; // @synthesize window=_window; - (void)dealloc; - (void)didExitVersionBrowser; - (void)didEnterVersionBrowser; - (void)tearDown; - (void)setUp; - (struct CGRect)splitView:(id)arg1 effectiveRect:(struct CGRect)arg2 forDrawnRect:(struct CGRect)arg3 ofDividerAtIndex:(long long)arg4; - (void)hideInspector; @property(readonly, nonatomic) NSView *inspectorView; - (id)showInspector; - (void)hideComponents; //@property(readonly, nonatomic) MSComponentGridController *componentsController; - (id)showComponentsView; @property(readonly, nonatomic) long long contentModeSplitViewItemIndex; - (void)hideCanvas; @property(readonly, nonatomic) NSView *canvasView; - (id)showCanvas; - (void)restoreStateWithCoder:(id)arg1; - (void)encodeRestorableStateWithCoder:(id)arg1; - (void)splitViewDidResizeSubviews:(id)arg1; @property(readonly, nonatomic) BOOL isSidebarVisible; @property(readonly, nonatomic) NSView *sidebarView; - (void)hideSidebar; - (id)showSidebar; - (void)alignWithWindowContentLayoutGuide; - (unsigned long long)indexOfSplitViewItemForViewController:(id)arg1; - (BOOL)removeAccessoryViewBeneathCanvas:(id)arg1; - (BOOL)insertAccessoryViewBeneathCanvas:(id)arg1 constrainingHeight:(double)arg2; - (BOOL)removeAccessoryViewAtopCanvas:(id)arg1; - (BOOL)insertAccessoryViewAtopCanvas:(id)arg1 constrainingHeight:(double)arg2; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end
50.797101
139
0.815121
5550cf78b96dc591153f19bdf721abc6dab7725a
1,745
h
C
gloox-1.0.22/src/dataformitem.h
zhichao281/SuperWisdom
e3bd1608a7aaf9b36dc274138081cf427ba4bbfc
[ "Apache-2.0" ]
9
2019-04-13T03:15:32.000Z
2021-06-22T09:57:19.000Z
gloox-1.0.22/src/dataformitem.h
zhichao281/SuperWisdom
e3bd1608a7aaf9b36dc274138081cf427ba4bbfc
[ "Apache-2.0" ]
null
null
null
gloox-1.0.22/src/dataformitem.h
zhichao281/SuperWisdom
e3bd1608a7aaf9b36dc274138081cf427ba4bbfc
[ "Apache-2.0" ]
8
2019-09-12T03:18:05.000Z
2021-06-22T09:57:22.000Z
/* Copyright (c) 2005-2017 by Jakob Schröter <js@camaya.net> This file is part of the gloox library. http://camaya.net/gloox This software is distributed under a license. The full license agreement can be found in the file LICENSE in this distribution. This software may not be copied, modified, sold or distributed other than expressed in the named license agreement. This software is distributed without any warranty. */ #ifndef DATAFORMITEM_H__ #define DATAFORMITEM_H__ #include "dataformfieldcontainer.h" namespace gloox { /** * @brief An abstraction of an &lt;item&gt; element in a @xep{0004} Data Form of type result. * * There are some constraints regarding usage of this element you should be aware of. Check @xep{0004} * section 3.4. This class does not enforce correct usage at this point. * * @author Jakob Schröter <js@camaya.net> * @since 0.7 */ class GLOOX_API DataFormItem : public DataFormFieldContainer { public: /** * Creates an empty 'item' element you can add fields to. */ DataFormItem(); /** * Creates a 'item' element and fills it with the 'field' elements contained in the given Tag. * The Tag's root element must be a 'item' element. Its child element should be 'field' elements. * @param tag The tag to read the 'field' elements from. * @since 0.8.5 */ DataFormItem( const Tag* tag ); /** * Virtual destructor. */ virtual ~DataFormItem(); /** * Creates and returns a Tag representation of the current object. * @return A Tag representation of the current object. */ virtual Tag* tag() const; }; } #endif // DATAFORMITEM_H__
27.698413
104
0.66533
1de0c25933342e9619fdb0d2024a905b999b1596
5,641
h
C
Misc/UnusedCode/RSLibAndTests/RSLib/Code/Math/Geometry/Polygon2D.h
RobinSchmidt/RS-MET-Preliminary
6c01cbaad7cce3daa3293c444dd9e4b74e5ebfbe
[ "FTL" ]
34
2017-04-19T18:26:02.000Z
2022-02-15T17:47:26.000Z
Misc/UnusedCode/RSLibAndTests/RSLib/Code/Math/Geometry/Polygon2D.h
RobinSchmidt/RS-MET-Preliminary
6c01cbaad7cce3daa3293c444dd9e4b74e5ebfbe
[ "FTL" ]
307
2017-05-04T21:45:01.000Z
2022-02-03T00:59:01.000Z
Misc/UnusedCode/RSLibAndTests/RSLib/Code/Math/Geometry/Polygon2D.h
RobinSchmidt/RS-MET-Preliminary
6c01cbaad7cce3daa3293c444dd9e4b74e5ebfbe
[ "FTL" ]
4
2017-09-05T17:04:31.000Z
2021-12-15T21:24:28.000Z
#ifndef RS_POLYGON2D_H #define RS_POLYGON2D_H namespace RSLib { /** This is a class for representing 2-dimensional polygons in the plane. \todo: de-templatize, make this an actual RSLib_API class with vertices of type double */ template<class RealType> class rsPolygon2D { public: //friend class rsAffineTransform2D<RealType>; // why? /** \name Construction/Destruction */ /** Constructor. Creates an empty polygon (i.e. it does not yet have any vertices). You can add vertices using addVertex */ rsPolygon2D() { } /** Creates a regular polygon with the given number of vertices. \todo comment the other parameters, remove the rotation parameter (it is redundant with the intial angle?) */ rsPolygon2D(int numVertices, rsPoint2D<RealType> center = rsPoint2D<RealType>(0, 0), RealType horizontalRadius = 1, RealType verticalRadius = 1, RealType initialAngle = 0, RealType rotation = 0) { vertices.ensureAllocatedSize(numVertices); int i; rsPoint2D<RealType> v; double scaler = 2.0*PI / numVertices; for(i = 0; i < numVertices; i++) { double a = initialAngle + scaler * i; // angle v.x = horizontalRadius * cos(a); v.y = verticalRadius * sin(a); addVertex(v); } // \todo: optimize this using sinCos and/or trigonometric recursion // apply rotation, if necessary if( rotation != 0 ) { // \todo create an rsAffineTransform2D implementing the desired rotation and apply it to // all vertices } // translate all vertices by the desired center: for(i = 0; i < numVertices; i++) vertices[i] += center; } /** Constructor that creates a regular polygon with the given number of vertices, given radius (defined as distance of the vertices from the center) that is centered at the given center. The first vertex will be at a point that is a distance of "radius" away from the center at an angle of "rotation" (given in radians). For example, to create unit square, you would call it like .... \todo: compare this to the more general constructor above - actually this one here is redundant -> get rid of it */ rsPolygon2D(int numVertices, RealType radius = 1, rsPoint2D<RealType> center = rsPoint2D<RealType>(0, 0), RealType rotation = 0) { vertices.ensureAllocatedSize(numVertices); int i; rsPoint2D<RealType> v; // create vertices at equally spaced angles around the origin, beginning with (radius, 0): v.x = radius; v.y = 0; addVertex(v); for(i = 1; i < numVertices; i++) { double a = 2.0 * i * PI / numVertices; // angle v.x = radius * cos(a); v.y = radius * sin(a); addVertex(v); } // \todo: optimize this using sinCos and/or trigonometric recursion // apply rotation, if necessary if( rotation != 0 ) { // \todo create an rsAffineTransform2D implementing the deired rotation and apply it to all // vertices } // translate all vertices by the desired center: for(i = 0; i < numVertices; i++) vertices[i] += center; } /** \name Setup */ /** Clears all the vertices such that the polygon is "empty" again. */ void clearVertices() { vertices.clear(); } /** Allocates memory large enough to hold at least "numVerticesToReserve" vertices. You can call this function before successive calls to addVertex when you know the number of vertices to be added in advance. This optimizes memory allocation (i.e. avoid re-allocations when the vertex array grows). */ void reserveVertexMemory(int numVerticesToReserve) { vertices.ensureAllocatedSize(numVerticesToReserve); } /** Adds a vertex to the polygon. */ void addVertex(rsPoint2D<RealType> vertexToAdd) { vertices.appendElement(vertexToAdd); } //void reserveMemoryForMoreVertices(int numberToReserve) // ...to accelerate performance of addVertex /** \name Inquiry */ /** Returns one of the vertices. The caller must be sure that the index is in the valid range. */ inline rsPoint2D<RealType> getVertex(int index) const { return vertices.getElement(index); } /** Returns the number of vertices in the polygon. */ inline int getNumVertices() const { return vertices.getNumElements(); } /** Returns true when this polygon contains the given point, false otherwise. */ //bool containsPoint(const rsPoint2D<RealType> &p) const //{ // return isPointInsideTriangle(p, *this); //} //rsDblRectangle getBoundingBox(); /** \name Operators */ /** Compares two polygons for equality. */ bool operator==(const rsPolygon2D& p) const { return vertices == p.vertices; } /** Compares two polygons for inequality. */ bool operator!=(const rsPolygon2D& p) const { return !(*this == p); } // intersectWith(const rsPolygon2D& p); // returns a polygon that represents the intersection of "this" and "p" // makeRegularPolygon(rsPoint2D<RealType> center, RealType radius, int numVertices); // -> factory function to create a regular polygon protected: /** \name Data */ rsArray<rsPoint2D<RealType> > vertices; }; // a typedef'd explicit instantiation for coordinates of type double: typedef rsPolygon2D<double> rsDblPolygon2D; } #endif
28.634518
99
0.639426
3da7f1cedd0b94676938ddded3c066e9c6b4a0fa
404
c
C
code/src/netsys/configtests/posix_shm.c
UnixJunkie/ocamlnet
81282279d073a85e3ed6e8b7030710ed9b7b2d02
[ "BSD-3-Clause" ]
null
null
null
code/src/netsys/configtests/posix_shm.c
UnixJunkie/ocamlnet
81282279d073a85e3ed6e8b7030710ed9b7b2d02
[ "BSD-3-Clause" ]
null
null
null
code/src/netsys/configtests/posix_shm.c
UnixJunkie/ocamlnet
81282279d073a85e3ed6e8b7030710ed9b7b2d02
[ "BSD-3-Clause" ]
null
null
null
#include <fcntl.h> #include <sys/types.h> #include <sys/mman.h> #include <errno.h> #include "caml/mlvalues.h" #include "caml/alloc.h" /* reminder: we return the exit code, and 0 means success */ value check(value dummy) { int ret; ret = shm_open("/thisFileDoesNotExist", O_RDONLY, 0); if (ret == -1 && errno == ENOENT) { return Val_int(0); /* success */ }; return Val_int(1); }
20.2
60
0.631188
3863d6b3a7dfefc0eaeec0b47852aebbf05f4bb5
530
c
C
src/init/init_button.c
simlf/my_rpg
2a5e3f36392a38d9c1e6fb12d9de9cdd770139f9
[ "MIT" ]
1
2021-05-28T12:11:31.000Z
2021-05-28T12:11:31.000Z
src/init/init_button.c
VictorHarri-Chal/my_rpg
6496e286e1e9713562c9d0c4d1c6bd9928ddbb11
[ "MIT" ]
null
null
null
src/init/init_button.c
VictorHarri-Chal/my_rpg
6496e286e1e9713562c9d0c4d1c6bd9928ddbb11
[ "MIT" ]
null
null
null
/* ** EPITECH PROJECT, 2020 ** B-MUL-200-NAN-2-1-myrpg-simon.le-fourn ** File description: ** init_button.c */ #include "my.h" #include "my_rpg.h" #include "my_struct.h" button_t *init_button(int x, int y, int width, int height) { button_t *button = malloc(sizeof(*button)); if (!button) return (NULL); button->rect = sfRectangleShape_create(); sfRectangleShape_setPosition(button->rect, init_vector(x, y)); sfRectangleShape_setSize(button->rect, init_vector(width, height)); return (button); }
23.043478
71
0.681132
c020d25ee6eb5922cf0d81857425443af3f8edb5
1,367
h
C
util/url.h
gozfree/aquila
23c47040d586fa2829eb0cc71f5938acc703cc47
[ "MIT" ]
199
2017-12-06T09:23:51.000Z
2022-03-28T08:46:37.000Z
util/url.h
gozfree/aquila
23c47040d586fa2829eb0cc71f5938acc703cc47
[ "MIT" ]
4
2019-07-24T12:33:32.000Z
2021-12-07T11:13:39.000Z
util/url.h
gozfree/aquila
23c47040d586fa2829eb0cc71f5938acc703cc47
[ "MIT" ]
65
2018-12-04T08:07:07.000Z
2022-03-28T08:47:40.000Z
/****************************************************************************** * Copyright (C) 2014-2018 Zhifeng Gong <gozfree@163.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with libraries; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ******************************************************************************/ #ifndef _URL_H_ #define _URL_H_ #include <stdint.h> #include <stdlib.h> #ifdef __cplusplus extern "C" { #endif /* *TODO: * authorization (user[:pass]@hostname) * * * */ // url = rtsp://192.168.1.1:8554/1.264 // head = rtsp // body = 192.168.1.1:8554/1.264 struct url { char head[32]; char body[512]; }; int url_parse(struct url *u, const char *input); #ifdef __cplusplus } #endif #endif
26.288462
80
0.629115
c03acf5e16fe560a15c2d8058614643b1dd0e877
5,079
c
C
.vim/sourceCode/glibc-2.16.0/posix/tst-mmap.c
lakehui/Vim_config
6cab80dc1209b34bf6379f42b1a92790bd0c146b
[ "MIT" ]
47
2015-03-10T23:21:52.000Z
2022-02-17T01:04:14.000Z
.vim/sourceCode/glibc-2.16.0/posix/tst-mmap.c
lakehui/Vim_config
6cab80dc1209b34bf6379f42b1a92790bd0c146b
[ "MIT" ]
1
2020-06-30T18:01:37.000Z
2020-06-30T18:01:37.000Z
.vim/sourceCode/glibc-2.16.0/posix/tst-mmap.c
lakehui/Vim_config
6cab80dc1209b34bf6379f42b1a92790bd0c146b
[ "MIT" ]
19
2015-02-25T19:50:05.000Z
2021-10-05T14:35:54.000Z
#include <assert.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/mman.h> int main (void) { int result = 0; FILE *fp; size_t c; char buf[1000]; int fd; unsigned char *ptr; size_t ps = sysconf (_SC_PAGESIZE); void *mem; /* Create a file and put some data in it. */ fp = tmpfile (); if (fp == NULL) { printf ("Cannot create temporary file: %m\n"); return 1; } fd = fileno (fp); for (c = 0; c < sizeof (buf); ++c) buf[c] = '0' + (c % 10); for (c = 0; c < (ps * 4) / sizeof (buf); ++c) if (fwrite (buf, 1, sizeof (buf), fp) != sizeof (buf)) { printf ("`fwrite' failed: %m\n"); return 1; } fflush (fp); assert (ps + 1000 < c * sizeof (buf)); /* First try something which is not allowed: map at an offset which is not modulo the pagesize. */ ptr = mmap (NULL, 1000, PROT_READ, MAP_SHARED, fd, ps - 1); if (ptr != MAP_FAILED) { puts ("mapping at offset with mod pagesize != 0 succeeded!"); result = 1; } else if (errno != EINVAL && errno != ENOSYS) { puts ("wrong error value for mapping at offset with mod pagesize != 0: %m (should be EINVAL)"); result = 1; } /* Try the same for mmap64. */ ptr = mmap64 (NULL, 1000, PROT_READ, MAP_SHARED, fd, ps - 1); if (ptr != MAP_FAILED) { puts ("mapping at offset with mod pagesize != 0 succeeded!"); result = 1; } else if (errno != EINVAL && errno != ENOSYS) { puts ("wrong error value for mapping at offset with mod pagesize != 0: %m (should be EINVAL)"); result = 1; } /* And the same for private mapping. */ ptr = mmap (NULL, 1000, PROT_READ, MAP_PRIVATE, fd, ps - 1); if (ptr != MAP_FAILED) { puts ("mapping at offset with mod pagesize != 0 succeeded!"); result = 1; } else if (errno != EINVAL && errno != ENOSYS) { puts ("wrong error value for mapping at offset with mod pagesize != 0: %m (should be EINVAL)"); result = 1; } /* Try the same for mmap64. */ ptr = mmap64 (NULL, 1000, PROT_READ, MAP_PRIVATE, fd, ps - 1); if (ptr != MAP_FAILED) { puts ("mapping at offset with mod pagesize != 0 succeeded!"); result = 1; } else if (errno != EINVAL && errno != ENOSYS) { puts ("wrong error value for mapping at offset with mod pagesize != 0: %m (should be EINVAL)"); result = 1; } /* Get a valid address. */ mem = malloc (2 * ps); if (mem != NULL) { /* Now we map at an address which is not mod pagesize. */ ptr = mmap (mem + 1, 1000, PROT_READ, MAP_SHARED | MAP_FIXED, fd, ps); if (ptr != MAP_FAILED) { puts ("mapping at address with mod pagesize != 0 succeeded!"); result = 1; } else if (errno != EINVAL && errno != ENOSYS) { puts ("wrong error value for mapping at address with mod pagesize != 0: %m (should be EINVAL)"); result = 1; } /* Try the same for mmap64. */ ptr = mmap64 (mem + 1, 1000, PROT_READ, MAP_SHARED | MAP_FIXED, fd, ps); if (ptr != MAP_FAILED) { puts ("mapping at address with mod pagesize != 0 succeeded!"); result = 1; } else if (errno != EINVAL && errno != ENOSYS) { puts ("wrong error value for mapping at address with mod pagesize != 0: %m (should be EINVAL)"); result = 1; } /* And again for MAP_PRIVATE. */ ptr = mmap (mem + 1, 1000, PROT_READ, MAP_PRIVATE | MAP_FIXED, fd, ps); if (ptr != MAP_FAILED) { puts ("mapping at address with mod pagesize != 0 succeeded!"); result = 1; } else if (errno != EINVAL && errno != ENOSYS) { puts ("wrong error value for mapping at address with mod pagesize != 0: %m (should be EINVAL)"); result = 1; } /* Try the same for mmap64. */ ptr = mmap64 (mem + 1, 1000, PROT_READ, MAP_PRIVATE | MAP_FIXED, fd, ps); if (ptr != MAP_FAILED) { puts ("mapping at address with mod pagesize != 0 succeeded!"); result = 1; } else if (errno != EINVAL && errno != ENOSYS) { puts ("wrong error value for mapping at address with mod pagesize != 0: %m (should be EINVAL)"); result = 1; } free (mem); } /* Now map the memory and see whether the content of the mapped area is correct. */ ptr = mmap (NULL, 1000, PROT_READ, MAP_SHARED, fd, ps); if (ptr == MAP_FAILED) { if (errno != ENOSYS) { printf ("cannot mmap file: %m\n"); result = 1; } } else { for (c = ps; c < ps + 1000; ++c) if (ptr[c - ps] != '0' + (c % 10)) { printf ("wrong data mapped at offset %zd\n", c); result = 1; } } /* And for mmap64. */ ptr = mmap64 (NULL, 1000, PROT_READ, MAP_SHARED, fd, ps); if (ptr == MAP_FAILED) { if (errno != ENOSYS) { printf ("cannot mmap file: %m\n"); result = 1; } } else { for (c = ps; c < ps + 1000; ++c) if (ptr[c - ps] != '0' + (c % 10)) { printf ("wrong data mapped at offset %zd\n", c); result = 1; } } /* That's it. */ return result; }
25.651515
101
0.557984
b896b19b943942d5780e990ae6fb9d6348833f95
393
c
C
Sprint10/t05/src/mx_strstr.c
LoveNek0/UCode-Connect-Marathone
d80e0c1e6719dd5069d2a065fe529fd09a1dad40
[ "MIT" ]
null
null
null
Sprint10/t05/src/mx_strstr.c
LoveNek0/UCode-Connect-Marathone
d80e0c1e6719dd5069d2a065fe529fd09a1dad40
[ "MIT" ]
null
null
null
Sprint10/t05/src/mx_strstr.c
LoveNek0/UCode-Connect-Marathone
d80e0c1e6719dd5069d2a065fe529fd09a1dad40
[ "MIT" ]
null
null
null
int mx_strncmp(const char *s1, const char *s2, int n); char *mx_strchr(const char *str, int c); int mx_strlen(const char *s); char *mx_strstr(const char *s1, const char *s2) { int offset = 0; while (offset + mx_strlen(s2) <= mx_strlen(s1)) { if (!mx_strncmp(s1+offset, s2, mx_strlen(s2))) return (char *)s1 + offset; offset++; } return 0; }
23.117647
54
0.590331
ef90b005a16f810aa44d482f7266abf3057f1a85
14,474
c
C
source/COSMOS-Fine/OM/OM_WriteObject.c
odysseus-oosql/ODYSSEUS-OOSQL
49a5e32b6f73cea611dafdcc0e6767f80d4450ae
[ "BSD-3-Clause" ]
6
2016-08-29T08:03:21.000Z
2022-03-25T09:56:23.000Z
source/COSMOS-Fine/OM/OM_WriteObject.c
odysseus-oosql/ODYSSEUS-OOSQL
49a5e32b6f73cea611dafdcc0e6767f80d4450ae
[ "BSD-3-Clause" ]
null
null
null
source/COSMOS-Fine/OM/OM_WriteObject.c
odysseus-oosql/ODYSSEUS-OOSQL
49a5e32b6f73cea611dafdcc0e6767f80d4450ae
[ "BSD-3-Clause" ]
null
null
null
/******************************************************************************/ /* */ /* Copyright (c) 1990-2016, KAIST */ /* All rights reserved. */ /* */ /* Redistribution and use in source and binary forms, with or without */ /* modification, are permitted provided that the following conditions */ /* are met: */ /* */ /* 1. Redistributions of source code must retain the above copyright */ /* notice, this list of conditions and the following disclaimer. */ /* */ /* 2. Redistributions in binary form must reproduce the above copyright */ /* notice, this list of conditions and the following disclaimer in */ /* the documentation and/or other materials provided with the */ /* distribution. */ /* */ /* 3. Neither the name of the copyright holder nor the names of its */ /* contributors may be used to endorse or promote products derived */ /* from this software without specific prior written permission. */ /* */ /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */ /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */ /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */ /* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE */ /* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */ /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, */ /* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */ /* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER */ /* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT */ /* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN */ /* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */ /* POSSIBILITY OF SUCH DAMAGE. */ /* */ /******************************************************************************/ /******************************************************************************/ /* */ /* ODYSSEUS/COSMOS General-Purpose Large-Scale Object Storage System -- */ /* Fine-Granule Locking Version */ /* Version 3.0 */ /* */ /* Developed by Professor Kyu-Young Whang et al. */ /* */ /* Advanced Information Technology Research Center (AITrc) */ /* Korea Advanced Institute of Science and Technology (KAIST) */ /* */ /* e-mail: odysseus.oosql@gmail.com */ /* */ /* Bibliography: */ /* [1] Whang, K., Lee, J., Lee, M., Han, W., Kim, M., and Kim, J., "DB-IR */ /* Integration Using Tight-Coupling in the Odysseus DBMS," World Wide */ /* Web, Vol. 18, No. 3, pp. 491-520, May 2015. */ /* [2] Whang, K., Lee, M., Lee, J., Kim, M., and Han, W., "Odysseus: a */ /* High-Performance ORDBMS Tightly-Coupled with IR Features," In Proc. */ /* IEEE 21st Int'l Conf. on Data Engineering (ICDE), pp. 1104-1105 */ /* (demo), Tokyo, Japan, April 5-8, 2005. This paper received the Best */ /* Demonstration Award. */ /* [3] Whang, K., Park, B., Han, W., and Lee, Y., "An Inverted Index */ /* Storage Structure Using Subindexes and Large Objects for Tight */ /* Coupling of Information Retrieval with Database Management */ /* Systems," U.S. Patent No.6,349,308 (2002) (Appl. No. 09/250,487 */ /* (1999)). */ /* [4] Whang, K., Lee, J., Kim, M., Lee, M., Lee, K., Han, W., and Kim, */ /* J., "Tightly-Coupled Spatial Database Features in the */ /* Odysseus/OpenGIS DBMS for High-Performance," GeoInformatica, */ /* Vol. 14, No. 4, pp. 425-446, Oct. 2010. */ /* [5] Whang, K., Lee, J., Kim, M., Lee, M., and Lee, K., "Odysseus: a */ /* High-Performance ORDBMS Tightly-Coupled with Spatial Database */ /* Features," In Proc. 23rd IEEE Int'l Conf. on Data Engineering */ /* (ICDE), pp. 1493-1494 (demo), Istanbul, Turkey, Apr. 16-20, 2007. */ /* */ /******************************************************************************/ /* * Module : OM_WriteObject.c * * Description : * OM_WriteObject() causes the region of bytes from 'start' to * 'start'+'length' to be overwritten with the data pointed to by * the parameter 'data'. If 'length' is REMAINDER, the data from 'start' * to end of the object are overwritten. * This routine returns the number of bytes actually overwritten. * * Exports: * Four OM_WriteObject(Four, DataFileInfo*, ObjectID*, Four, Four, char*, LockParameter*) * * Return value: * 1) number of bytes actually overwritten (value greater than or equal to 0) * 2) Error Code (negative value) * eBADOBJECTID_OM * eBADLENGTH_OM * eBADUSERBUF_OM * eBADSTART_OM * eLOCKREQUESTFAIL_OM */ #include <string.h> #include "common.h" #include "error.h" #include "trace.h" /* for tracing : TR_PRINT(handle, ) macro */ #include "latch.h" #include "TM.h" #include "LM.h" #include "LOG.h" #include "BfM.h" /* for the buffer manager call */ #include "LOT.h" #include "OM.h" #include "perProcessDS.h" #include "perThreadDS.h" Four OM_WriteObject( Four handle, XactTableEntry_T *xactEntry, /* IN transaction table entry */ DataFileInfo *finfo, /* IN file information */ ObjectID *oid, /* IN object to read */ Four start, /* IN starting offset of write */ Four length, /* IN amount of data to write */ char *buf, /* IN user buffer holding data to write */ LockParameter *lockup, /* IN request lock or not */ LogParameter_T *logParam) /* IN log parameter */ { Four e; /* error code */ PageID pid; /* page containing object specified by 'oid' */ SlottedPage *apage; /* pointer to the buffer of the page */ Buffer_ACC_CB *aPage_BCBP; /* buffer access control block holding data */ Object *obj; /* pointer to the object in the slotted page */ LockReply lockReply; /* lock reply */ LockMode oldMode; Lsn_T lsn; /* lsn of the newly written log record */ Four logRecLen; /* log record length */ LOG_LogRecInfo_T logRecInfo; /* log record information */ LOG_Image_OM_ObjDataInPage_T objDataInfo; /* write position information */ /* pointer for COMMON Data Structure of perThreadTable */ COMMON_PerThreadDS_T *common_perThreadDSptr = COMMON_PER_THREAD_DS_PTR(handle); TR_PRINT(handle, TR_OM, TR1, ("OM_WriteObject(handle, finfo=%P, oid=%P, start=%ld, length=%ld, buf=%P, lockup=%P)", finfo, oid, start, length, buf, lockup)); /* check parameters */ if (finfo == NULL) ERR(handle, eBADCATOBJ); if (oid == NULL) ERR(handle, eBADOBJECTID_OM); if (length < 0 && length != REMAINDER) ERR(handle, eBADLENGTH_OM); if (buf == NULL) ERR(handle, eBADUSERBUF_OM); /* Get the PageID from the ObjectID */ MAKE_PAGEID(pid, oid->volNo, oid->pageNo); #ifdef CCPL if(lockup){ /* lock the slotted page */ e = LM_getPageLock(handle, &xactEntry->xactId, &pid, &finfo->fid, lockup->mode, lockup->duration, L_UNCONDITIONAL, &lockReply, &oldMode); if (e < eNOERROR) ERR(handle, e); if(lockReply == LR_DEADLOCK){ ERR(handle, eDEADLOCK); /* deadlock */ } } #endif /* CCPL */ #ifdef CCPL /* read the slotted page into the system buffer */ e = BfM_getAndFixBuffer(handle, &pid, M_FREE, &aPage_BCBP, PAGE_BUF); if (e < eNOERROR) ERR(handle, e); #endif /* CCPL */ #ifdef CCRL /* read the slotted page into the system buffer */ e = BfM_getAndFixBuffer(handle, &pid, M_EXCLUSIVE, &aPage_BCBP, PAGE_BUF); if (e < eNOERROR) ERR(handle, e); #endif /* CCRL */ apage = (SlottedPage *)aPage_BCBP->bufPagePtr; /* check the 'oid' is valid. */ if (!IS_VALID_OBJECTID(oid, apage)) { #ifdef CCPL ERRB1(handle, eBADOBJECTID_OM, aPage_BCBP, PAGE_BUF); #endif /* CCPL */ #ifdef CCRL ERRBL1(handle, eBADOBJECTID_OM, aPage_BCBP, PAGE_BUF); #endif /* CCRL */ } #ifdef CCRL if (lockup) { e = LM_getObjectLock(handle, &xactEntry->xactId, oid, &apage->header.fid, lockup->mode, lockup->duration, L_CONDITIONAL, &lockReply, &oldMode); if ( e < eNOERROR ) ERRBL1(handle, e, aPage_BCBP, PAGE_BUF); if ( lockReply == LR_NOTOK ) { /* release latch to avoid deadlock situation */ e = SHM_releaseLatch(handle, aPage_BCBP->latchPtr, procIndex); if ( e < eNOERROR) ERRB1(handle, e, aPage_BCBP, PAGE_BUF); e = LM_getObjectLock(handle, &xactEntry->xactId, oid, &apage->header.fid, lockup->mode, lockup->duration, L_UNCONDITIONAL, &lockReply, &oldMode); if (e < eNOERROR) ERRB1(handle, e, aPage_BCBP, PAGE_BUF); if ( lockReply == LR_DEADLOCK ) ERRB1(handle, eDEADLOCK, aPage_BCBP, PAGE_BUF); /* relatch the page */ e = SHM_getLatch(handle, aPage_BCBP->latchPtr, procIndex, M_EXCLUSIVE, M_UNCONDITIONAL, NULL); if ( e < eNOERROR ) ERRB1(handle, e, aPage_BCBP, PAGE_BUF); /* check the 'oid' is valid. */ if (!IS_VALID_OBJECTID(oid, apage)) ERRBL1(handle, eBADOBJECTID_OM, aPage_BCBP, PAGE_BUF); } } #endif /* CCRL */ /* Get the object from the 'oid' */ obj = (Object *)&apage->data[apage->slot[-(oid->slotNo)].offset]; if (start < 0 || start >= obj->header.length) { #ifdef CCPL ERRB1(handle, eBADSTART_OM, aPage_BCBP, PAGE_BUF); #endif /* CCPL */ #ifdef CCRL ERRBL1(handle, eBADSTART_OM, aPage_BCBP, PAGE_BUF); #endif /* CCRL */ } /* Read all the remained data if the 'length' is REMAINDER. */ if (length == REMAINDER) length = obj->header.length - start; /* if 'length' exceeds object boundary, reduce 'length' upto boundary */ if (start + length > obj->header.length) length = obj->header.length - start; TR_PRINT(handle, TR_OM, TR2, ("start=%ld, length=%ld\n", start, length)); /* * Copy the data into the user specified buffer. */ if (obj->header.properties & P_LRGOBJ) { /* This is the large object. */ TR_PRINT(handle, TR_OM, TR2, ("This is the large object.\n")); e = LOT_WriteObject(handle, xactEntry, finfo, obj->data, IS_LRGOBJ_ROOTWITHHDR(obj->header.properties), start, length, buf, logParam); if (e < 0) { #ifdef CCPL ERRB1(handle, e, aPage_BCBP, PAGE_BUF); #endif /* CCPL */ #ifdef CCRL ERRBL1(handle, e, aPage_BCBP, PAGE_BUF); #endif /* CCRL */ } } else if (obj->header.properties & P_MOVED) { /* This is the moved object : recursively call OM_WriteObject() */ TR_PRINT(handle, TR_OM, TR2, ("This is the moved object\n")); #ifdef CCPL e = OM_WriteObject(handle, xactEntry, finfo, (ObjectID *)obj->data, start, length, buf, lockup, logParam); if (e < eNOERROR) ERRB1(handle, e, aPage_BCBP, PAGE_BUF); #endif /* CCPL */ #ifdef CCRL /* lockup == NULL :: no lock on forwarded object */ e = OM_WriteObject(handle, xactEntry, finfo, (ObjectID *)obj->data, start, length, buf, lockup, logParam); if (e < eNOERROR) ERRBL1(handle, e, aPage_BCBP, PAGE_BUF); #endif /* CCRL */ } else { /* the unmoved object : normal case */ TR_PRINT(handle, TR_OM, TR2, ("This is the normal small object.\n")); /* * Write log record. */ if (logParam->logFlag & LOG_FLAG_DATA_LOGGING) { objDataInfo.slotNo = oid->slotNo; objDataInfo.start = start; objDataInfo.length = length; LOG_FILL_LOGRECINFO_3(logRecInfo, xactEntry->xactId, LOG_TYPE_UPDATE, LOG_ACTION_OM_WRITE_SMALL_OBJECT, LOG_REDO_UNDO, pid, xactEntry->lastLsn, common_perThreadDSptr->nilLsn, sizeof(LOG_Image_OM_ObjDataInPage_T), &objDataInfo, length, buf, length, &(obj->data[start])); e = LOG_WriteLogRecord(handle, xactEntry, &logRecInfo, &lsn, &logRecLen); if (e < eNOERROR) { #ifdef CCPL ERRB1(handle, e, aPage_BCBP, PAGE_BUF); #endif /* CCPL */ #ifdef CCRL ERRBL1(handle, e, aPage_BCBP, PAGE_BUF); #endif /* CCRL */ } /* mark the lsn in the page */ apage->header.lsn = lsn; apage->header.logRecLen = logRecLen; } memcpy(&(obj->data[start]), buf, length); /* set dirty flag */ aPage_BCBP->dirtyFlag = 1; } #ifdef CCRL e = SHM_releaseLatch(handle, aPage_BCBP->latchPtr, procIndex); if (e < eNOERROR) ERRB1(handle, e, aPage_BCBP, PAGE_BUF); #endif /* CCRL */ /* unfix the buffer page */ e = BfM_unfixBuffer(handle, aPage_BCBP, PAGE_BUF); if (e < eNOERROR) ERR(handle, e); return(length); } /* OM_WriteObject( ) */
43.335329
107
0.537516
370ddf470bdaf697a9d19fbb38a4a13acd8a1349
828
h
C
Aplicacion Movil/generated/bundles/login-transition/build/Android/Preview/app/src/main/include/Uno.ArgumentNullException.h
marferfer/SpinOff-LoL
a9dba8ac9dd476ec1ef94712d9a8e76d3b45aca8
[ "Apache-2.0" ]
null
null
null
Aplicacion Movil/generated/bundles/login-transition/build/Android/Preview/app/src/main/include/Uno.ArgumentNullException.h
marferfer/SpinOff-LoL
a9dba8ac9dd476ec1ef94712d9a8e76d3b45aca8
[ "Apache-2.0" ]
null
null
null
Aplicacion Movil/generated/bundles/login-transition/build/Android/Preview/app/src/main/include/Uno.ArgumentNullException.h
marferfer/SpinOff-LoL
a9dba8ac9dd476ec1ef94712d9a8e76d3b45aca8
[ "Apache-2.0" ]
null
null
null
// This file was generated based on C:/Users/JuanJose/AppData/Local/Fusetools/Packages/UnoCore/1.9.0/Source/Uno/Exceptions/ArgumentNullException.uno. // WARNING: Changes might be lost if you edit this file directly. #pragma once #include <Uno.ArgumentException.h> namespace g{namespace Uno{struct ArgumentNullException;}} namespace g{ namespace Uno{ // public sealed class ArgumentNullException :6 // { ::g::Uno::Exception_type* ArgumentNullException_typeof(); void ArgumentNullException__ctor_5_fn(ArgumentNullException* __this, uString* paramName); void ArgumentNullException__New6_fn(uString* paramName, ArgumentNullException** __retval); struct ArgumentNullException : ::g::Uno::ArgumentException { void ctor_5(uString* paramName); static ArgumentNullException* New6(uString* paramName); }; // } }} // ::g::Uno
33.12
149
0.785024
89a4941673d26336228d7bde0a6bfed623fcbc7c
3,039
h
C
sdk-6.5.20/libs/sdklt/bcmlta/include/bcmlta/bcm56990_a0/bcm56990_a0_lta_bcmcfg.h
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
sdk-6.5.20/libs/sdklt/bcmlta/include/bcmlta/bcm56990_a0/bcm56990_a0_lta_bcmcfg.h
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
sdk-6.5.20/libs/sdklt/bcmlta/include/bcmlta/bcm56990_a0/bcm56990_a0_lta_bcmcfg.h
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
/* Handlers for Device bcm56990_a0 Component bcmcfg */ /******************************************************************************* * * DO NOT EDIT THIS FILE! * This file is auto-generated by fltg from Logical Table mapping files. * * Tool: $SDK/INTERNAL/fltg/bin/fltg * * Edits to this file will be lost when it is regenerated. * * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. * * Copyright 2007-2020 Broadcom Inc. All rights reserved. */ #ifndef BCM56990_A0_LTA_BCMCFG_H #define BCM56990_A0_LTA_BCMCFG_H #ifndef DOXYGEN_IGNORE_AUTOGEN #include <bcmltd/bcmltd_handler.h> extern const bcmltd_generic_arg_t bcm56990_a0_lta_bcmcfg_ctr_eflex_config_cth_handler_arg; extern const bcmltd_table_handler_t bcm56990_a0_lta_bcmcfg_ctr_eflex_config_cth_handler; extern const bcmltd_generic_arg_t bcm56990_a0_lta_bcmcfg_device_config_cth_handler_arg; extern const bcmltd_table_handler_t bcm56990_a0_lta_bcmcfg_device_config_cth_handler; extern const bcmltd_generic_arg_t bcm56990_a0_lta_bcmcfg_device_wal_config_cth_handler_arg; extern const bcmltd_table_handler_t bcm56990_a0_lta_bcmcfg_device_wal_config_cth_handler; extern const bcmltd_generic_arg_t bcm56990_a0_lta_bcmcfg_fp_config_cth_handler_arg; extern const bcmltd_table_handler_t bcm56990_a0_lta_bcmcfg_fp_config_cth_handler; extern const bcmltd_generic_arg_t bcm56990_a0_lta_bcmcfg_meter_fp_config_cth_handler_arg; extern const bcmltd_table_handler_t bcm56990_a0_lta_bcmcfg_meter_fp_config_cth_handler; extern const bcmltd_generic_arg_t bcm56990_a0_lta_bcmcfg_pc_serdes_config_cth_handler_arg; extern const bcmltd_table_handler_t bcm56990_a0_lta_bcmcfg_pc_serdes_config_cth_handler; extern const bcmltd_generic_arg_t bcm56990_a0_lta_bcmcfg_port_config_cth_handler_arg; extern const bcmltd_table_handler_t bcm56990_a0_lta_bcmcfg_port_config_cth_handler; extern const bcmltd_generic_arg_t bcm56990_a0_lta_bcmcfg_ser_config_cth_handler_arg; extern const bcmltd_table_handler_t bcm56990_a0_lta_bcmcfg_ser_config_cth_handler; extern const bcmltd_generic_arg_t bcm56990_a0_lta_bcmcfg_tm_pm_flex_config_cth_handler_arg; extern const bcmltd_table_handler_t bcm56990_a0_lta_bcmcfg_tm_pm_flex_config_cth_handler; extern const bcmltd_generic_arg_t bcm56990_a0_lta_bcmcfg_tm_scheduler_config_cth_handler_arg; extern const bcmltd_table_handler_t bcm56990_a0_lta_bcmcfg_tm_scheduler_config_cth_handler; extern const bcmltd_generic_arg_t bcm56990_a0_lta_bcmcfg_tm_shaper_config_cth_handler_arg; extern const bcmltd_table_handler_t bcm56990_a0_lta_bcmcfg_tm_shaper_config_cth_handler; extern const bcmltd_generic_arg_t bcm56990_a0_lta_bcmcfg_tm_thd_config_cth_handler_arg; extern const bcmltd_table_handler_t bcm56990_a0_lta_bcmcfg_tm_thd_config_cth_handler; extern const bcmltd_generic_arg_t bcm56990_a0_lta_bcmcfg_udf_config_cth_handler_arg; extern const bcmltd_table_handler_t bcm56990_a0_lta_bcmcfg_udf_config_cth_handler; #endif /* DOXYGEN_IGNORE_AUTOGEN */ #endif /* BCM56990_A0_LTA_BCMCFG_H */
63.3125
134
0.879237
8151d950189d260b002df81eea0f825e6a1a8b30
8,446
h
C
ios/app/Erigo/com/google/common/collect/FluentIterable.h
kebernet/erigo
476af345aa412909286cafb1eea508e33f4363c1
[ "Apache-2.0" ]
2
2017-07-08T16:24:03.000Z
2017-07-08T16:56:39.000Z
ios/app/Erigo/com/google/common/collect/FluentIterable.h
kebernet/erigo
476af345aa412909286cafb1eea508e33f4363c1
[ "Apache-2.0" ]
null
null
null
ios/app/Erigo/com/google/common/collect/FluentIterable.h
kebernet/erigo
476af345aa412909286cafb1eea508e33f4363c1
[ "Apache-2.0" ]
null
null
null
// // Generated by the J2ObjC translator. DO NOT EDIT! // source: /Volumes/Personal/Documents/raspi-config/client-framework/build/j2oSources/com/google/common/collect/FluentIterable.java // #include "J2ObjC_header.h" #pragma push_macro("INCLUDE_ALL_ComGoogleCommonCollectFluentIterable") #ifdef RESTRICT_ComGoogleCommonCollectFluentIterable #define INCLUDE_ALL_ComGoogleCommonCollectFluentIterable 0 #else #define INCLUDE_ALL_ComGoogleCommonCollectFluentIterable 1 #endif #undef RESTRICT_ComGoogleCommonCollectFluentIterable #if __has_feature(nullability) #pragma clang diagnostic push #pragma GCC diagnostic ignored "-Wnullability-completeness" #endif #if !defined (ComGoogleCommonCollectFluentIterable_) && (INCLUDE_ALL_ComGoogleCommonCollectFluentIterable || defined(INCLUDE_ComGoogleCommonCollectFluentIterable)) #define ComGoogleCommonCollectFluentIterable_ #define RESTRICT_JavaLangIterable 1 #define INCLUDE_JavaLangIterable 1 #include "java/lang/Iterable.h" @class ComGoogleCommonBaseJoiner; @class ComGoogleCommonBaseOptional; @class ComGoogleCommonCollectImmutableList; @class ComGoogleCommonCollectImmutableListMultimap; @class ComGoogleCommonCollectImmutableMap; @class ComGoogleCommonCollectImmutableMultiset; @class ComGoogleCommonCollectImmutableSet; @class ComGoogleCommonCollectImmutableSortedSet; @class IOSClass; @class IOSObjectArray; @protocol ComGoogleCommonBaseFunction; @protocol ComGoogleCommonBasePredicate; @protocol JavaUtilCollection; @protocol JavaUtilComparator; @protocol JavaUtilFunctionConsumer; @protocol JavaUtilSpliterator; @protocol JavaUtilStreamStream; @interface ComGoogleCommonCollectFluentIterable : NSObject < JavaLangIterable > #pragma mark Public - (jboolean)allMatchWithComGoogleCommonBasePredicate:(id<ComGoogleCommonBasePredicate>)predicate; - (jboolean)anyMatchWithComGoogleCommonBasePredicate:(id<ComGoogleCommonBasePredicate>)predicate; - (ComGoogleCommonCollectFluentIterable *)appendWithNSObjectArray:(IOSObjectArray *)elements; - (ComGoogleCommonCollectFluentIterable *)appendWithJavaLangIterable:(id<JavaLangIterable>)other; + (ComGoogleCommonCollectFluentIterable *)concatWithJavaLangIterableArray:(IOSObjectArray *)inputs; + (ComGoogleCommonCollectFluentIterable *)concatWithJavaLangIterable:(id<JavaLangIterable>)inputs; + (ComGoogleCommonCollectFluentIterable *)concatWithJavaLangIterable:(id<JavaLangIterable>)a withJavaLangIterable:(id<JavaLangIterable>)b; + (ComGoogleCommonCollectFluentIterable *)concatWithJavaLangIterable:(id<JavaLangIterable>)a withJavaLangIterable:(id<JavaLangIterable>)b withJavaLangIterable:(id<JavaLangIterable>)c; + (ComGoogleCommonCollectFluentIterable *)concatWithJavaLangIterable:(id<JavaLangIterable>)a withJavaLangIterable:(id<JavaLangIterable>)b withJavaLangIterable:(id<JavaLangIterable>)c withJavaLangIterable:(id<JavaLangIterable>)d; - (jboolean)containsWithId:(id)target; - (id<JavaUtilCollection>)copyIntoWithJavaUtilCollection:(id<JavaUtilCollection>)collection OBJC_METHOD_FAMILY_NONE; - (ComGoogleCommonCollectFluentIterable *)cycle; - (ComGoogleCommonCollectFluentIterable *)filterWithIOSClass:(IOSClass *)type; - (ComGoogleCommonCollectFluentIterable *)filterWithComGoogleCommonBasePredicate:(id<ComGoogleCommonBasePredicate>)predicate; - (ComGoogleCommonBaseOptional *)first; - (ComGoogleCommonBaseOptional *)firstMatchWithComGoogleCommonBasePredicate:(id<ComGoogleCommonBasePredicate>)predicate; + (ComGoogleCommonCollectFluentIterable *)fromWithNSObjectArray:(IOSObjectArray *)elements; + (ComGoogleCommonCollectFluentIterable *)fromWithComGoogleCommonCollectFluentIterable:(ComGoogleCommonCollectFluentIterable *)iterable; + (ComGoogleCommonCollectFluentIterable *)fromWithJavaLangIterable:(id<JavaLangIterable>)iterable; - (id)getWithInt:(jint)position; - (ComGoogleCommonCollectImmutableListMultimap *)indexWithComGoogleCommonBaseFunction:(id<ComGoogleCommonBaseFunction>)keyFunction; - (jboolean)isEmpty; - (NSString *)joinWithComGoogleCommonBaseJoiner:(ComGoogleCommonBaseJoiner *)joiner; - (ComGoogleCommonBaseOptional *)last; - (ComGoogleCommonCollectFluentIterable *)limitWithInt:(jint)maxSize; + (ComGoogleCommonCollectFluentIterable *)of; + (ComGoogleCommonCollectFluentIterable *)ofWithId:(id)element withNSObjectArray:(IOSObjectArray *)elements; + (ComGoogleCommonCollectFluentIterable *)ofWithNSObjectArray:(IOSObjectArray *)elements; - (jint)size; - (ComGoogleCommonCollectFluentIterable *)skipWithInt:(jint)numberToSkip; - (id<JavaUtilStreamStream>)stream; - (IOSObjectArray *)toArrayWithIOSClass:(IOSClass *)type; - (ComGoogleCommonCollectImmutableList *)toList; - (ComGoogleCommonCollectImmutableMap *)toMapWithComGoogleCommonBaseFunction:(id<ComGoogleCommonBaseFunction>)valueFunction; - (ComGoogleCommonCollectImmutableMultiset *)toMultiset; - (ComGoogleCommonCollectImmutableSet *)toSet; - (ComGoogleCommonCollectImmutableList *)toSortedListWithJavaUtilComparator:(id<JavaUtilComparator>)comparator; - (ComGoogleCommonCollectImmutableSortedSet *)toSortedSetWithJavaUtilComparator:(id<JavaUtilComparator>)comparator; - (NSString *)description; - (ComGoogleCommonCollectFluentIterable *)transformWithComGoogleCommonBaseFunction:(id<ComGoogleCommonBaseFunction>)function; - (ComGoogleCommonCollectFluentIterable *)transformAndConcatWithComGoogleCommonBaseFunction:(id<ComGoogleCommonBaseFunction>)function; - (ComGoogleCommonCollectImmutableMap *)uniqueIndexWithComGoogleCommonBaseFunction:(id<ComGoogleCommonBaseFunction>)keyFunction; #pragma mark Protected - (instancetype)init; #pragma mark Package-Private - (instancetype)initWithJavaLangIterable:(id<JavaLangIterable>)iterable; @end J2OBJC_EMPTY_STATIC_INIT(ComGoogleCommonCollectFluentIterable) FOUNDATION_EXPORT void ComGoogleCommonCollectFluentIterable_init(ComGoogleCommonCollectFluentIterable *self); FOUNDATION_EXPORT void ComGoogleCommonCollectFluentIterable_initWithJavaLangIterable_(ComGoogleCommonCollectFluentIterable *self, id<JavaLangIterable> iterable); FOUNDATION_EXPORT ComGoogleCommonCollectFluentIterable *ComGoogleCommonCollectFluentIterable_fromWithJavaLangIterable_(id<JavaLangIterable> iterable); FOUNDATION_EXPORT ComGoogleCommonCollectFluentIterable *ComGoogleCommonCollectFluentIterable_fromWithNSObjectArray_(IOSObjectArray *elements); FOUNDATION_EXPORT ComGoogleCommonCollectFluentIterable *ComGoogleCommonCollectFluentIterable_fromWithComGoogleCommonCollectFluentIterable_(ComGoogleCommonCollectFluentIterable *iterable); FOUNDATION_EXPORT ComGoogleCommonCollectFluentIterable *ComGoogleCommonCollectFluentIterable_concatWithJavaLangIterable_withJavaLangIterable_(id<JavaLangIterable> a, id<JavaLangIterable> b); FOUNDATION_EXPORT ComGoogleCommonCollectFluentIterable *ComGoogleCommonCollectFluentIterable_concatWithJavaLangIterable_withJavaLangIterable_withJavaLangIterable_(id<JavaLangIterable> a, id<JavaLangIterable> b, id<JavaLangIterable> c); FOUNDATION_EXPORT ComGoogleCommonCollectFluentIterable *ComGoogleCommonCollectFluentIterable_concatWithJavaLangIterable_withJavaLangIterable_withJavaLangIterable_withJavaLangIterable_(id<JavaLangIterable> a, id<JavaLangIterable> b, id<JavaLangIterable> c, id<JavaLangIterable> d); FOUNDATION_EXPORT ComGoogleCommonCollectFluentIterable *ComGoogleCommonCollectFluentIterable_concatWithJavaLangIterableArray_(IOSObjectArray *inputs); FOUNDATION_EXPORT ComGoogleCommonCollectFluentIterable *ComGoogleCommonCollectFluentIterable_concatWithJavaLangIterable_(id<JavaLangIterable> inputs); FOUNDATION_EXPORT ComGoogleCommonCollectFluentIterable *ComGoogleCommonCollectFluentIterable_of(); FOUNDATION_EXPORT ComGoogleCommonCollectFluentIterable *ComGoogleCommonCollectFluentIterable_ofWithNSObjectArray_(IOSObjectArray *elements); FOUNDATION_EXPORT ComGoogleCommonCollectFluentIterable *ComGoogleCommonCollectFluentIterable_ofWithId_withNSObjectArray_(id element, IOSObjectArray *elements); J2OBJC_TYPE_LITERAL_HEADER(ComGoogleCommonCollectFluentIterable) #endif #if __has_feature(nullability) #pragma clang diagnostic pop #endif #pragma pop_macro("INCLUDE_ALL_ComGoogleCommonCollectFluentIterable")
44.925532
280
0.842055
8187624e9b6573cbf652cb542f8675d75940261d
727
h
C
Card.h
ejderuby/Terminal_Klindike
d25d6469bb7dd9c9700bdcc71a16518969608939
[ "MIT" ]
null
null
null
Card.h
ejderuby/Terminal_Klindike
d25d6469bb7dd9c9700bdcc71a16518969608939
[ "MIT" ]
null
null
null
Card.h
ejderuby/Terminal_Klindike
d25d6469bb7dd9c9700bdcc71a16518969608939
[ "MIT" ]
null
null
null
// Card Header File #ifndef CARD_H #define CARD_H class Card{ private: char suit; int value; char color; int conceal; Card* next; Card* prev; public: Card(); // Default Constructor ~Card(); // Destructor // Methods void displayCard(); void assignCardFace(int index); void flipOver(); char toCharValue(); // Getters char getSuit(); int getValue(); char getColor(); int getConceal(); Card* getNext(); Card* getPrev(); // Setters void setSuit(char suit); void setValue(int value); void setColor(char color); void setConceal(int conceal); void setNext(Card* card); void setPrev(Card* card); }; #endif // CARD_H
18.175
35
0.602476
fcbbcb5c8e1d3dd29bce4ace43fc5de425193328
424
h
C
62. Unique Paths.h
Mids/LeetCode
589b9e40acfde6e2dde37916fc1c69a3ac481070
[ "MIT" ]
1
2021-01-05T07:54:10.000Z
2021-01-05T07:54:10.000Z
62. Unique Paths.h
Mids/LeetCode
589b9e40acfde6e2dde37916fc1c69a3ac481070
[ "MIT" ]
null
null
null
62. Unique Paths.h
Mids/LeetCode
589b9e40acfde6e2dde37916fc1c69a3ac481070
[ "MIT" ]
null
null
null
// // Created by Jin on 5/5/2021. // #ifndef LEETCODE_62_UNIQUE_PATHS_H #define LEETCODE_62_UNIQUE_PATHS_H using namespace std; class Solution { public: int uniquePaths(int m, int n) { int i = 1, j; if (m == 1 || n == 1) return 1; vector<int> row(n, 1); for (; i < m; ++i) { for (j = 1; j < n; ++j) { row[j] += row[j - 1]; } } return row[n - 1]; } }; #endif //LEETCODE_62_UNIQUE_PATHS_H
12.848485
35
0.566038
509ac10c4b3830f0452d382b893817a452e839f2
202
h
C
WTableView/ViewController.h
Heshuwang/WTableView
aa0f9ac6c21211eeb7270846959bef860939a266
[ "MIT" ]
null
null
null
WTableView/ViewController.h
Heshuwang/WTableView
aa0f9ac6c21211eeb7270846959bef860939a266
[ "MIT" ]
null
null
null
WTableView/ViewController.h
Heshuwang/WTableView
aa0f9ac6c21211eeb7270846959bef860939a266
[ "MIT" ]
null
null
null
// // ViewController.h // WTableView // // Created by hs on 2019/10/9. // Copyright © 2019 hs. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
12.625
45
0.673267
f712d47a80f90522f38fdf113ee4e8f055d79615
546
h
C
Plugins/InputBuffer/Source/InputBufferEditor/Private/InputCommandAssetTypeActions.h
iliags/LittleFighter
a7043cc1b136477f8eaa5583bdadd2cc9edbcbac
[ "MIT" ]
null
null
null
Plugins/InputBuffer/Source/InputBufferEditor/Private/InputCommandAssetTypeActions.h
iliags/LittleFighter
a7043cc1b136477f8eaa5583bdadd2cc9edbcbac
[ "MIT" ]
null
null
null
Plugins/InputBuffer/Source/InputBufferEditor/Private/InputCommandAssetTypeActions.h
iliags/LittleFighter
a7043cc1b136477f8eaa5583bdadd2cc9edbcbac
[ "MIT" ]
1
2021-10-21T11:34:22.000Z
2021-10-21T11:34:22.000Z
// Copyright 2018 Isaac Hsu. #pragma once #include "AssetTypeActions_Base.h" class FInputCommandAssetTypeActions : public FAssetTypeActions_Base { public: FInputCommandAssetTypeActions(EAssetTypeCategories::Type InAssetCategory); // IAssetTypeActions interface virtual FText GetName() const override; virtual FColor GetTypeColor() const override; virtual UClass* GetSupportedClass() const override; virtual uint32 GetCategories() override; // End of IAssetTypeActions interface private: EAssetTypeCategories::Type MyAssetCategory; };
26
75
0.81685
fb60fdaf8fa325f6e9806be824c3d9b6b4f4b672
773
h
C
src/nes/memory/memory.h
mukerjee/nes-2a03
6cfd8d6b7ae4b437e6bc5bc4bb612fd9ce7fd2d3
[ "MIT" ]
2
2018-02-01T11:58:06.000Z
2020-03-13T16:38:28.000Z
src/nes/memory/memory.h
mukerjee/nes-2a03
6cfd8d6b7ae4b437e6bc5bc4bb612fd9ce7fd2d3
[ "MIT" ]
null
null
null
src/nes/memory/memory.h
mukerjee/nes-2a03
6cfd8d6b7ae4b437e6bc5bc4bb612fd9ce7fd2d3
[ "MIT" ]
null
null
null
#ifndef NES_MEMORY_MEMORY_H_ #define NES_MEMORY_MEMORY_H_ #include <stdint.h> #include <stdlib.h> #include <string.h> #include <stdio.h> #define MEM_SIZE 1<<16 class Memory { public: Memory(); ~Memory(); void LoadCart(const uint8_t* cart, const uint16_t start_address, const size_t length); void LoadBank(const uint8_t* bank, const uint8_t bank_number, const size_t length); void BankSwitch(const uint8_t bank_spot, const uint8_t bank_number); void SetByte(const uint16_t addr, const uint8_t byte); uint8_t GetByte(const uint16_t addr); uint16_t GetWord(const uint16_t addr); void PrintMemoryContents(); private: uint8_t *memory_; uint8_t **banks_; }; #endif // NES_MEMORY_MEMORY_H_
24.15625
72
0.697283
d3386e553188a343cb7ba84f42841bda34b3e6e1
471
h
C
MLN-iOS/Example/Pods/Headers/Public/MLN/MLNKitBridgesManager.h
jackwiy/MLN
0b4dd2438cb2f0c87a18a8e4766f996e728ac1d8
[ "MIT" ]
1,615
2019-09-19T09:36:39.000Z
2022-03-31T13:05:47.000Z
MLN-iOS/Example/Pods/Headers/Public/MLN/MLNKitBridgesManager.h
jackwiy/MLN
0b4dd2438cb2f0c87a18a8e4766f996e728ac1d8
[ "MIT" ]
193
2019-09-19T09:10:03.000Z
2022-02-23T02:48:02.000Z
MLN-iOS/Example/Pods/Headers/Public/MLN/MLNKitBridgesManager.h
jackwiy/MLN
0b4dd2438cb2f0c87a18a8e4766f996e728ac1d8
[ "MIT" ]
203
2019-09-19T09:39:22.000Z
2022-03-27T12:18:44.000Z
// // MLNKitBridgesManager.h // MLN // // Created by MoMo on 2019/8/29. // #import <Foundation/Foundation.h> #import "MLNExportProtocol.h" NS_ASSUME_NONNULL_BEGIN @class MLNLuaCore; @interface MLNKitBridgesManager : NSObject - (void)registerKitForLuaCore:(MLNLuaCore *)luaCore; @end @class MLNKitInstance; @interface MLNKitBridgesManager (Deprecated) - (instancetype)initWithUIInstance:(MLNKitInstance *)instance; - (void)registerKit; @end NS_ASSUME_NONNULL_END
18.115385
62
0.77707
ee639e58d6bf272ec4c4cb3df842724ecb806c19
273
h
C
src/gryphon/tc_manager.h
wslfa/gryphon
f3708a7c33c7aa41ae89b4223cfcbf896142a9a0
[ "BSD-2-Clause" ]
21
2017-06-03T12:45:23.000Z
2020-11-16T02:02:50.000Z
src/gryphon/tc_manager.h
qz267/gryphon
74377d40e90193b60d01037db6ea2c462175022f
[ "BSD-2-Clause" ]
null
null
null
src/gryphon/tc_manager.h
qz267/gryphon
74377d40e90193b60d01037db6ea2c462175022f
[ "BSD-2-Clause" ]
4
2017-07-27T07:34:03.000Z
2021-07-16T11:50:29.000Z
#ifndef TC_MANAGER_INCLUDED #define TC_MANAGER_INCLUDED #include <xcopy.h> #include <gryphon.h> int gryphon_init(tc_event_loop_t *event_loop); void gryphon_over(const int sig); void gryphon_release_resources(); #endif /* ----- #ifndef TC_MANAGER_INCLUDED ----- */
21
54
0.747253
2064dc56a2ac3c7484b43b0da9ab3a01287ac78a
21,001
h
C
src/libxsmm/src/generator_x86_instructions.h
IntelLabs/SkimCaffe
27df6a8796a012da722c3e2673739350133c1779
[ "BSD-2-Clause" ]
255
2016-09-14T03:34:18.000Z
2022-02-03T17:09:24.000Z
src/libxsmm/src/generator_x86_instructions.h
IntelLabs/SkimCaffe
27df6a8796a012da722c3e2673739350133c1779
[ "BSD-2-Clause" ]
22
2017-05-08T11:13:52.000Z
2019-11-06T02:53:10.000Z
src/libxsmm/src/generator_x86_instructions.h
IntelLabs/SkimCaffe
27df6a8796a012da722c3e2673739350133c1779
[ "BSD-2-Clause" ]
83
2016-09-18T19:33:15.000Z
2021-08-29T07:35:32.000Z
/****************************************************************************** ** Copyright (c) 2015-2017, Intel 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: ** ** 1. Redistributions of source code must retain the above copyright ** ** notice, this list of conditions and the following disclaimer. ** ** 2. Redistributions in binary form must reproduce the above copyright ** ** notice, this list of conditions and the following disclaimer in the ** ** documentation and/or other materials provided with the distribution. ** ** 3. Neither the name of the copyright holder nor the names of its ** ** contributors may be used to endorse or promote products derived ** ** from this software without specific prior written permission. ** ** ** ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ** ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ** ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ** ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ** ** HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ** ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED ** ** TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR ** ** PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF ** ** LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING ** ** NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ** ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ** ******************************************************************************/ /* Alexander Heinecke (Intel Corp.) ******************************************************************************/ #ifndef GENERATOR_X86_INSTRUCTIONS_H #define GENERATOR_X86_INSTRUCTIONS_H #include "generator_common.h" /** * Opens the inline assembly section / jit stream * * @param io_generated_code pointer to the pointer of the generated code structure * @param i_gp_reg_mapping gp register mapping for initialization * @param i_arch architecture code was generated for (needed to build clobber) * @param i_prefetch prefetch mode which may result in additional gp reg inits */ LIBXSMM_INTERNAL_API void libxsmm_x86_instruction_open_stream( libxsmm_generated_code* io_generated_code, const libxsmm_gp_reg_mapping* i_gp_reg_mapping, const char* i_arch, unsigned int i_prefetch ); /** * Closes the inline assembly section / jit stream * * @param io_generated_code pointer to the pointer of the generated code structure * @param i_gp_reg_mapping gp register mapping for clobbering * @param i_arch architecture code was generated for (needed to build clobber) * @param i_prefetch prefetch mode which may result in additional gp reg clobbers */ LIBXSMM_INTERNAL_API void libxsmm_x86_instruction_close_stream( libxsmm_generated_code* io_generated_code, const libxsmm_gp_reg_mapping* i_gp_reg_mapping, const char* i_arch, unsigned int i_prefetch ); /** * Generates vmovapd/vmovupd/vmovaps/vmovups/vmovsd/vmovss/vbroadcastsd/vbroastcastss/vmovddup instructions with displacements, explicit SIB addressing is not * supported by this function * * @param io_generated_code pointer to the pointer of the generated code structure * @param i_instruction_set requested instruction set to encode * @param i_vmove_instr actual vmov variant * @param i_gp_reg_number the register number (rax=0,rcx=1,rdx=2,rbx=3,rsp=4,rbp=5,rsi=6,rdi=7,r8=8,r9=9,r10=10,r11=11,r12=12,r13=13,r14=14,r15=15) of the base address register * @param i_displacement the offset to the base address * @param i_vector_name the vector register name prefix (x, y or z) * @param i_vec_reg_number_0 the vector register number (xmm/ymm: 0-15, zmm: 0-31) * @param i_mask_reg_number the mask register to be used * @param i_is_store 0: load semantic, other: store semantic */ LIBXSMM_INTERNAL_API void libxsmm_x86_instruction_vec_move( libxsmm_generated_code* io_generated_code, const unsigned int i_instruction_set, const unsigned int i_vmove_instr, const unsigned int i_gp_reg_base, const unsigned int i_gp_reg_idx, const unsigned int i_scale, const int i_displacement, const char i_vector_name, const unsigned int i_vec_reg_number_0, const unsigned int i_use_masking, const unsigned int i_is_store ); /** * Generates (v)XYZpd/(v)XYZps/(v)XYZsd/(v)XYZss instructions with 2 or 3 vector registers, memory operands are not supported as first operand * * @param io_generated_code pointer to the pointer of the generated code structure * @param i_instruction_set requested instruction set to encode * @param i_vec_instr actual operation variant * @param i_vector_name the vector register name prefix (x,y or z) * @param i_vec_reg_number_0 the first vector register number (xmm/ymm: 0-15, zmm: 0-31) * @param i_vec_reg_number_1 the second vector register number (xmm/ymm: 0-15, zmm: 0-31) * @param i_vec_reg_number_2 the third vector register number (xmm/ymm: 0-15, zmm: 0-31), if this operand equals LIBXSMM_X86_VEC_REG_UNDEF -> SSE3 code generation */ LIBXSMM_INTERNAL_API void libxsmm_x86_instruction_vec_compute_reg( libxsmm_generated_code* io_generated_code, const unsigned int i_instruction_set, const unsigned int i_vec_instr, const char i_vector_name, const unsigned int i_vec_reg_number_0, const unsigned int i_vec_reg_number_1, const unsigned int i_vec_reg_number_2 ); /** * Generates (v)XYZpd/(v)XYZps/(v)XYZsd/(v)XYZss instructions with 2 vector registers, memory operand as first operand * * @param io_generated_code pointer to the pointer of the generated code structure * @param i_instruction_set requested instruction set to encode * @param i_vec_instr actual operation variant * @param i_use_broadcast if != 0 memory operand is interpreted as a scalar and broadcasted in fused fashion, only supported on AVX512 and IMCI * @param i_gp_reg_base base address register for memory broadcast * @param i_gp_reg_idx index register for memory broadcast, can be LIBXSMM_X86_GP_REG_UNDEF -> then regular displacement version is generated * @param i_scale scale of index register, ignored if i_gp_reg_idx is LIBXSMM_X86_GP_REG_UNDEF * @param i_displacement displacement to SIB address * @param i_vector_name the vector register name prefix (z) * @param i_vec_reg_number_0 the first vector register number (zmm: 0-31) * @param i_vec_reg_number_1 the second vector register number (zmm: 0-31) */ LIBXSMM_INTERNAL_API void libxsmm_x86_instruction_vec_compute_mem( libxsmm_generated_code* io_generated_code, const unsigned int i_instruction_set, const unsigned int i_vec_instr, const unsigned int i_use_broadcast, const unsigned int i_gp_reg_base, const unsigned int i_gp_reg_idx, const unsigned int i_scale, const int i_displacement, const char i_vector_name, const unsigned int i_vec_reg_number_0, const unsigned int i_vec_reg_number_1 ); /** * Generates shuffle instructions with 2 or 3 vector registers, memory operands are not supported as first operand * * @param io_generated_code pointer to the pointer of the generated code structure * @param i_instruction_set requested instruction set to encode * @param i_vec_instr actual operation variant * @param i_vector_name the vector register name prefix (x,y or z) * @param i_vec_reg_number_0 the first vector register number (xmm/ymm: 0-15, zmm: 0-31) * @param i_vec_reg_number_1 the second vector register number (xmm/ymm: 0-15, zmm: 0-31) * @param i_vec_reg_number_2 the third vector register number (xmm/ymm: 0-15, zmm: 0-31), if this operand equals LIBXSMM_X86_VEC_REG_UNDEF -> SSE3 code generation */ LIBXSMM_INTERNAL_API void libxsmm_x86_instruction_vec_shuffle_reg( libxsmm_generated_code* io_generated_code, const unsigned int i_instruction_set, const unsigned int i_vec_instr, const char i_vector_name, const unsigned int i_vec_reg_number_0, const unsigned int i_vec_reg_number_1, const unsigned int i_vec_reg_number_2, const unsigned int i_shuffle_operand ); /** * Generates shuffle instructions with 2 or 3 vector registers, memory operands are not supported as first operand * * @param io_generated_code pointer to the pointer of the generated code structure * @param i_instruction_set requested instruction set to encode * @param i_vmove_instr actual operation variant (gather/scatter and single/double) * @param i_vector_name the vector register name prefix (x,y or z) * @param i_gp_reg_number the register number (rax=0,rcx=1,rdx=2,rbx=3,rsp=4,rbp=5,rsi=6,rdi=7,r8=8,r9=9,r10=10,r11=11,r12=12,r13=13,r14=14,r15=15) of the base address register * @param i_vec_reg_idx the index vector registers (ymm0-15 AVX2) (zmm0-zmm32 AVX512) * @param i_scale the scaling of the indexes in i_vec_reg_idx * @param i_displacement the offset to the base address * @param i_vec_reg_number the destination(gather)/source(scatter) vec register (xmm/ymm: 0-15, zmm: 0-31) * @param i_mask_reg_number the mask register (xmm/ymm: 0-15 when using AVX2), (k1-k7 when using AVX512) * @param i_is_gather "true" generate a gather instruction, "false" generator a scatter instruction */ LIBXSMM_INTERNAL_API void libxsmm_x86_instruction_vec_move_gathscat( libxsmm_generated_code* io_generated_code, const unsigned int i_instruction_set, const unsigned int i_vmove_instr, const char i_vector_name, const unsigned int i_gp_reg_base, const unsigned int i_vec_reg_idx, const unsigned int i_scale, const int i_displacement, const unsigned int i_vec_reg_number, const unsigned int i_mask_reg_number, const unsigned int i_is_gather ); /* @TODO check if we can merge this alu_imm */ /** * Generates prefetch instructions with displacements, SIB addressing is not * supported by this function * * @param io_generated_code pointer to the pointer of the generated code structure * @param i_prefetch_instr actual prefetch variant * @param i_gp_reg_number the register number (rax=0,rcx=1,rdx=2,rbx=3,rsp=4,rbp=5,rsi=6,rdi=7,r8=8,r9=9,r10=10,r11=11,r12=12,r13=13,r14=14,r15=15) of the base address register * @param i_displacement the offset to the base address */ LIBXSMM_INTERNAL_API void libxsmm_x86_instruction_prefetch( libxsmm_generated_code* io_generated_code, const unsigned int i_prefetch_instr, const unsigned int i_gp_reg_base, const unsigned int i_gp_reg_idx, const unsigned int i_scale, const int i_displacement ); /** * Generates regular all instructions with immediates * * @param io_generated_code pointer to the pointer of the generated code structure * @param i_alu_instr actual alu gpr instruction * @param i_gp_reg_number the register number (rax=0,rcx=1,rdx=2,rbx=3,rsp=4,rbp=5,rsi=6,rdi=7,r8=8,r9=9,r10=10,r11=11,r12=12,r13=13,r14=14,r15=15) of the base address register * @param i_immediate the immediate operand */ LIBXSMM_INTERNAL_API void libxsmm_x86_instruction_alu_imm( libxsmm_generated_code* io_generated_code, const unsigned int i_alu_instr, const unsigned int i_gp_reg_number, const int i_immediate ); /** * Generates regular all instructions with immediates * * @param io_generated_code pointer to the pointer of the generated code structure * @param i_alu_instr actual alu gpr instruction * @param i_gp_reg_number_src the source register number (rax=0,rcx=1,rdx=2,rbx=3,rsp=4,rbp=5,rsi=6,rdi=7,r8=8,r9=9,r10=10,r11=11,r12=12,r13=13,r14=14,r15=15) of the base address register * @param i_gp_reg_number_dest the destination register number (rax=0,rcx=1,rdx=2,rbx=3,rsp=4,rbp=5,rsi=6,rdi=7,r8=8,r9=9,r10=10,r11=11,r12=12,r13=13,r14=14,r15=15) of the base address register */ LIBXSMM_INTERNAL_API void libxsmm_x86_instruction_alu_reg( libxsmm_generated_code* io_generated_code, const unsigned int i_alu_instr, const unsigned int i_gp_reg_number_src, const unsigned int i_gp_reg_number_dest); /** * Generates push to the stack for a GPR * * @param io_generated_code pointer to the pointer of the generated code structure * @param i_gp_reg_number the source register number (rax=0,rcx=1,rdx=2,rbx=3,rsp=4,rbp=5,rsi=6,rdi=7,r8=8,r9=9,r10=10,r11=11,r12=12,r13=13,r14=14,r15=15) */ LIBXSMM_INTERNAL_API void libxsmm_x86_instruction_push_reg( libxsmm_generated_code* io_generated_code, const unsigned int i_gp_reg_number ); /** * Generates pop from the stack for a GPR * * @param io_generated_code pointer to the pointer of the generated code structure * @param i_gp_reg_number the source register number (rax=0,rcx=1,rdx=2,rbx=3,rsp=4,rbp=5,rsi=6,rdi=7,r8=8,r9=9,r10=10,r11=11,r12=12,r13=13,r14=14,r15=15) */ LIBXSMM_INTERNAL_API void libxsmm_x86_instruction_pop_reg( libxsmm_generated_code* io_generated_code, const unsigned int i_gp_reg_number ); /** * Allows for mask move instructions in AVX512 * * @param io_generated_code pointer to the pointer of the generated code structure * @param i_mask_instr actual mask move instruction * @param i_gp_reg_number the register number (rax=0,rcx=1,rdx=2,rbx=3,rsp=4,rbp=5,rsi=6,rdi=7,r8=8,r9=9,r10=10,r11=11,r12=12,r13=13,r14=14,r15=15) of the base address register * @param i_mask_reg_number the register number (k1=1...k7=7) */ LIBXSMM_INTERNAL_API void libxsmm_x86_instruction_mask_move( libxsmm_generated_code* io_generated_code, const unsigned int i_mask_instr, const unsigned int i_gp_reg_number, const unsigned int i_mask_reg_number ); /** * Allows for mask move instructions in AVX512 * * @param io_generated_code pointer to the pointer of the generated code structure * @param i_mask_instr actual mask compute instruction instruction * @param i_mask_reg_number_src_0 the first operand register number (att syntax) (k1=1...k7=7) * @param i_mask_reg_number_src_1 the second operand register number (att syntax) (k1=1...k7=7) * @param i_mask_reg_number_dest the third operand register number (att syntax) (k1=1...k7=7) */ LIBXSMM_INTERNAL_API void libxsmm_x86_instruction_mask_compute_reg( libxsmm_generated_code* io_generated_code, const unsigned int i_mask_instr, const unsigned int i_mask_reg_number_src_0, const unsigned int i_mask_reg_number_src_1, const unsigned int i_mask_reg_number_dest ); /** * Generates regular all instructions with immediates * * @param io_generated_code pointer to the pointer of the generated code structure * @param io_loop_label_tracker data structure to handle loop labels, nested loops are supported, but not overlapping loops */ LIBXSMM_INTERNAL_API void libxsmm_x86_instruction_register_jump_label( libxsmm_generated_code* io_generated_code, libxsmm_loop_label_tracker* io_loop_label_tracker ); /** * Generates regular all instructions with immediates * * @param io_generated_code pointer to the pointer of the generated code structure * @param i_jmp_instr the particular jump instruction used * @param io_loop_label_tracker data structure to handle loop labels will jump to latest registered label */ LIBXSMM_INTERNAL_API void libxsmm_x86_instruction_jump_back_to_label( libxsmm_generated_code* io_generated_code, const unsigned int i_jmp_instr, libxsmm_loop_label_tracker* io_loop_label_tracker ); /** * @TODO: clean-up * Opens the inline assembly section / jit stream for convolutions, this is hacked and should be cleaned up * * @param io_generated_code pointer to the pointer of the generated code structure * @param i_arch architecture code was generated for (needed to build clobber) */ LIBXSMM_INTERNAL_API void libxsmm_x86_instruction_open_stream_convolution( libxsmm_generated_code* io_generated_code, const unsigned int i_gp_reg_input, const unsigned int i_gp_reg_weight, const unsigned int i_gp_reg_output, const unsigned int i_gp_reg_input_pf, const unsigned int i_gp_reg_weight_pf, const unsigned int i_gp_reg_output_pf, const char* i_arch ); /** * @TODO: clean-up * Closes the inline assembly section / jit stream for convolutions, this is hacked and should be cleaned up * * @param io_generated_code pointer to the pointer of the generated code structure * @param i_arch architecture code was generated for (needed to build clobber) */ LIBXSMM_INTERNAL_API void libxsmm_x86_instruction_close_stream_convolution( libxsmm_generated_code* io_generated_code, const char* i_arch ); #endif /* GENERATOR_X86_INSTRUCTIONS_H */
62.317507
193
0.609447
54526526b1cc59fad298061b4d9a361353665724
2,827
h
C
GroundControlStation_V3.1/GroundControlStation_V3.1/DialogWP/waypointTabWidget.h
FlyTheThings/QtProject
02c5f6659e71d05aa89aa320f70c880ae329aa00
[ "Apache-2.0" ]
1
2019-01-07T14:37:25.000Z
2019-01-07T14:37:25.000Z
GroundControlStation_V3.1/GroundControlStation_V3.1/DialogWP/waypointTabWidget.h
FlyTheThings/QtProject
02c5f6659e71d05aa89aa320f70c880ae329aa00
[ "Apache-2.0" ]
null
null
null
GroundControlStation_V3.1/GroundControlStation_V3.1/DialogWP/waypointTabWidget.h
FlyTheThings/QtProject
02c5f6659e71d05aa89aa320f70c880ae329aa00
[ "Apache-2.0" ]
1
2019-01-07T14:37:27.000Z
2019-01-07T14:37:27.000Z
#ifndef WAYPOINTTABWIDGET_H #define WAYPOINTTABWIDGET_H #include <QTabWidget> #include <QMessageBox> #include <QFileDialog> #include <QFile> #include <QTextStream> #include <QTableWidgetItem> #include <QStringList> #include <QPointF> #include <QMap> #include <QTimer> #include <QtMath> #include <QString> #include <QMenu> #include <QAction> #include <QList> #include <QVector> #include "Shared/dataStructureDefine.H" #include "Shared/buff.h" namespace Ui { class QWaypointTabWidget; } class QWaypointTabWidget : public QTabWidget { Q_OBJECT public: explicit QWaypointTabWidget(QWidget *parent = 0); ~QWaypointTabWidget(); QPointF mDataPF[256]; int numDot_tab1; signals: void signal_cmdOutput(quint8 sysid,quint8 compid, quint8 msgid, const quint8 *packet, quint8 length); void signal_cmdOnDrawWP(); void signal_cmdOnDelWP(); void signal_clearscreen(); void signal_picklonlat(); public: void setline_lonlat(QString lng,QString lat); private slots: void slot_openFile(); //Tab1 void slot_deleteFile(); void slot_saveFile(); void slot_OnDrawWP(); void slot_cmdCheckFCCWP(); void slot_cmdUploadFCCWP(); void slot_cmdDeleteFCCWP(); void slot_waypointCmdEchoOK(quint8 idx, WayPoint_Struc_t dataWP); void slot_waypointcmdEchoOverTimer(); void slot_addDotWaypoint(); //Tab2 void slot_modifyDotWaypoint(); void slot_delDotWaypoint(); void slot_refreshWaypoint(); void slot_deleteWaypoint(); void slot_saveWaypoint(); void slot_customContextMenuRequested(const QPoint &pos); void slot_newAirline(); void slot_newWaypoint(); void slot_deleAirline(); void slot_editWaypoint(); void slot_deletePoint(); void slot_showcurrentpoint(QTableWidgetItem * item); void slot_deletePoint_table1(); void slot_findpostion(); private: Ui::QWaypointTabWidget *ui; QString curFileName; //Tab1-variable int curDot_tab1; QTimer *cmdTimer; //定时器变量 quint8 cmdID; //Tab2 double ref_lon, ref_lat; void getVxdFromInut(int sp1, QString sp1_Str, int sp2, QString sp2_Str, quint8* vxd); void addDotWaypoint_table_1(int row); QMap<int, waypoint_struc_t> designWp; QMenu *popMenu; //右键菜单 QAction *newAirline; QMenu *waypointPopMenu; QAction *newWaypoint; QAction *deleteAirline; QMenu *waypointCfgPopMenu; QAction *editWaypoint; QAction *deleteWaypoint; int row_current; void initTableWidget1(); void processWaypointData(QString dotData, int num); void initTableWidget2(); void initTableWidget3(); }; #endif // WAYPOINTTABWIDGET_H
25.241071
109
0.678811
2d27344796583457e6a7cb070798e5fc1ad74ebd
3,868
h
C
System/Library/PrivateFrameworks/ActivityAchievementsUI.framework/AAUIAchievementLocalizationProvider.h
lechium/iOS1351Headers
6bed3dada5ffc20366b27f7f2300a24a48a6284e
[ "MIT" ]
2
2021-11-02T09:23:27.000Z
2022-03-28T08:21:57.000Z
System/Library/PrivateFrameworks/ActivityAchievementsUI.framework/AAUIAchievementLocalizationProvider.h
lechium/iOS1351Headers
6bed3dada5ffc20366b27f7f2300a24a48a6284e
[ "MIT" ]
null
null
null
System/Library/PrivateFrameworks/ActivityAchievementsUI.framework/AAUIAchievementLocalizationProvider.h
lechium/iOS1351Headers
6bed3dada5ffc20366b27f7f2300a24a48a6284e
[ "MIT" ]
1
2022-03-28T08:21:59.000Z
2022-03-28T08:21:59.000Z
/* * This header is generated by classdump-dyld 1.5 * on Wednesday, October 27, 2021 at 3:18:34 PM Mountain Standard Time * Operating System: Version 13.5.1 (Build 17F80) * Image Source: /System/Library/PrivateFrameworks/ActivityAchievementsUI.framework/ActivityAchievementsUI * classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos. Updated by Kevin Bradley. */ @class NSString, FIUIUnitManager, NSDate, NSCalendar; @interface AAUIAchievementLocalizationProvider : NSObject { BOOL _wheelchairUser; NSString* _name; FIUIUnitManager* _unitManager; NSDate* _currentDateOverride; NSCalendar* _gregorianCalendar; } @property (nonatomic,retain) NSDate * currentDateOverride; //@synthesize currentDateOverride=_currentDateOverride - In the implementation block @property (nonatomic,retain) NSCalendar * gregorianCalendar; //@synthesize gregorianCalendar=_gregorianCalendar - In the implementation block @property (nonatomic,retain) NSString * name; //@synthesize name=_name - In the implementation block @property (assign,nonatomic) BOOL wheelchairUser; //@synthesize wheelchairUser=_wheelchairUser - In the implementation block @property (nonatomic,retain) FIUIUnitManager * unitManager; //@synthesize unitManager=_unitManager - In the implementation block -(id)init; -(NSString *)name; -(void)setName:(NSString *)arg1 ; -(id)currentDate; -(NSCalendar *)gregorianCalendar; -(NSDate *)currentDateOverride; -(void)setCurrentDateOverride:(NSDate *)arg1 ; -(void)setGregorianCalendar:(NSCalendar *)arg1 ; -(id)localizedStringForKey:(id)arg1 withAchievement:(id)arg2 ; -(id)titleForAchievement:(id)arg1 ; -(id)unachievedAlertBackDescriptionForAchievement:(id)arg1 ; -(id)_backDateStringForDate:(id)arg1 achievement:(id)arg2 dateStyle:(unsigned long long)arg3 ; -(id)_localizedStringWithKey:(id)arg1 withAchievement:(id)arg2 ; -(id)_localizedStringWithKey:(id)arg1 withAchievement:(id)arg2 localizationBundleURL:(id)arg3 ; -(id)_suffixesForLocalizedStringLookup; -(id)_allStringCombinationsWithPrefix:(id)arg1 andSuffixes:(id)arg2 ; -(id)_pluralizeLocalizedString:(id)arg1 withAchievement:(id)arg2 ; -(id)_replacePlaceholdersInString:(id)arg1 withAchievement:(id)arg2 ; -(id)_buildKeyWithKeyBaseString:(id)arg1 andSuffixes:(id)arg2 ; -(id)_valueFromPlaceholder:(id)arg1 withAchievement:(id)arg2 ; -(id)_stringByTrimmingPlaceholderMarkersFromString:(id)arg1 ; -(id)_formatValue:(id)arg1 usingFormatterNamed:(id)arg2 template:(id)arg3 ; -(id)_progressValueWithAchievement:(id)arg1 ; -(id)_achievementValueWithAchievement:(id)arg1 ; -(id)_goalValueWithAchievement:(id)arg1 ; -(id)_quantityToGoalValueWithAchievement:(id)arg1 ; -(id)_formattedEnergyValue:(id)arg1 template:(id)arg2 ; -(FIUIUnitManager *)unitManager; -(id)_userEnergyUnitSuffix; -(id)_calculateSuffixCombinations:(id)arg1 ; -(id)_remainingProgressValueWithUnit:(id)arg1 achievement:(id)arg2 ; -(id)unachievedDescriptionForAchievement:(id)arg1 ; -(id)unachievedShortDescriptionForAchievement:(id)arg1 ; -(id)achievedDescriptionForAchievement:(id)arg1 ; -(id)achievedShortDescriptionForAchievement:(id)arg1 ; -(id)friendAchievedTitleForAchievement:(id)arg1 ; -(id)friendAchievedDescriptionForAchievement:(id)arg1 ; -(id)achievedAlertDescriptionForAchievement:(id)arg1 ; -(id)achievedAlertBackDescriptionForAchievement:(id)arg1 sizeVariant:(long long)arg2 dateSizeVariant:(long long)arg3 ; -(id)unachievedAlertDescriptionForAchievement:(id)arg1 ; -(id)shareDescriptionForAchievement:(id)arg1 ; -(id)_buildKeyWithKeyBaseString:(id)arg1 ; -(BOOL)wheelchairUser; -(void)setWheelchairUser:(BOOL)arg1 ; -(void)setUnitManager:(FIUIUnitManager *)arg1 ; @end
52.27027
158
0.757756
052753181258699bd95e68f748dea91dd69d4902
4,240
h
C
src/events_generated.h
norse/aestream
c2e48b9f9adb53d645830716db241333781e3b4c
[ "MIT" ]
5
2022-01-30T13:54:42.000Z
2022-03-29T02:45:51.000Z
src/events_generated.h
norse/aestream
c2e48b9f9adb53d645830716db241333781e3b4c
[ "MIT" ]
4
2022-01-30T13:57:04.000Z
2022-03-03T22:12:47.000Z
src/events_generated.h
norse/aestream
c2e48b9f9adb53d645830716db241333781e3b4c
[ "MIT" ]
null
null
null
// automatically generated by the FlatBuffers compiler, do not modify #ifndef FLATBUFFERS_GENERATED_EVENTS_H_ #define FLATBUFFERS_GENERATED_EVENTS_H_ #include "flatbuffers/flatbuffers.h" // Ensure the included flatbuffers.h is the same version as when this file was // generated, otherwise it may not be compatible. static_assert(FLATBUFFERS_VERSION_MAJOR == 2 && FLATBUFFERS_VERSION_MINOR == 0 && FLATBUFFERS_VERSION_REVISION == 6, "Non-compatible flatbuffers version included"); struct Event; struct EventPacket; struct EventPacketBuilder; FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) Event FLATBUFFERS_FINAL_CLASS { private: int64_t t_; int16_t x_; int16_t y_; uint8_t on_; int8_t padding0__; int16_t padding1__; public: Event() : t_(0), x_(0), y_(0), on_(0), padding0__(0), padding1__(0) { (void)padding0__; (void)padding1__; } Event(int64_t _t, int16_t _x, int16_t _y, bool _on) : t_(flatbuffers::EndianScalar(_t)), x_(flatbuffers::EndianScalar(_x)), y_(flatbuffers::EndianScalar(_y)), on_(flatbuffers::EndianScalar(static_cast<uint8_t>(_on))), padding0__(0), padding1__(0) { (void)padding0__; (void)padding1__; } int64_t t() const { return flatbuffers::EndianScalar(t_); } int16_t x() const { return flatbuffers::EndianScalar(x_); } int16_t y() const { return flatbuffers::EndianScalar(y_); } bool on() const { return flatbuffers::EndianScalar(on_) != 0; } }; FLATBUFFERS_STRUCT_END(Event, 16); struct EventPacket FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { typedef EventPacketBuilder Builder; enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { VT_ELEMENTS = 4 }; const flatbuffers::Vector<const Event *> *elements() const { return GetPointer<const flatbuffers::Vector<const Event *> *>(VT_ELEMENTS); } bool Verify(flatbuffers::Verifier &verifier) const { return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_ELEMENTS) && verifier.VerifyVector(elements()) && verifier.EndTable(); } }; struct EventPacketBuilder { typedef EventPacket Table; flatbuffers::FlatBufferBuilder &fbb_; flatbuffers::uoffset_t start_; void add_elements(flatbuffers::Offset<flatbuffers::Vector<const Event *>> elements) { fbb_.AddOffset(EventPacket::VT_ELEMENTS, elements); } explicit EventPacketBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); } flatbuffers::Offset<EventPacket> Finish() { const auto end = fbb_.EndTable(start_); auto o = flatbuffers::Offset<EventPacket>(end); return o; } }; inline flatbuffers::Offset<EventPacket> CreateEventPacket( flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset<flatbuffers::Vector<const Event *>> elements = 0) { EventPacketBuilder builder_(_fbb); builder_.add_elements(elements); return builder_.Finish(); } inline flatbuffers::Offset<EventPacket> CreateEventPacketDirect( flatbuffers::FlatBufferBuilder &_fbb, const std::vector<Event> *elements = nullptr) { auto elements__ = elements ? _fbb.CreateVectorOfStructs<Event>(*elements) : 0; return CreateEventPacket( _fbb, elements__); } inline const EventPacket *GetEventPacket(const void *buf) { return flatbuffers::GetRoot<EventPacket>(buf); } inline const EventPacket *GetSizePrefixedEventPacket(const void *buf) { return flatbuffers::GetSizePrefixedRoot<EventPacket>(buf); } inline bool VerifyEventPacketBuffer( flatbuffers::Verifier &verifier) { return verifier.VerifyBuffer<EventPacket>(nullptr); } inline bool VerifySizePrefixedEventPacketBuffer( flatbuffers::Verifier &verifier) { return verifier.VerifySizePrefixedBuffer<EventPacket>(nullptr); } inline void FinishEventPacketBuffer( flatbuffers::FlatBufferBuilder &fbb, flatbuffers::Offset<EventPacket> root) { fbb.Finish(root); } inline void FinishSizePrefixedEventPacketBuffer( flatbuffers::FlatBufferBuilder &fbb, flatbuffers::Offset<EventPacket> root) { fbb.FinishSizePrefixed(root); } #endif // FLATBUFFERS_GENERATED_EVENTS_H_
28.843537
87
0.719811
e5ae7a0fad219f06b871091fc864ee9efc792edd
282
h
C
include/script_def.h
GithubPrankster/mirv-web
54e1950ea36e168a2cebeb6e17c5f5659e853e6e
[ "MIT" ]
null
null
null
include/script_def.h
GithubPrankster/mirv-web
54e1950ea36e168a2cebeb6e17c5f5659e853e6e
[ "MIT" ]
null
null
null
include/script_def.h
GithubPrankster/mirv-web
54e1950ea36e168a2cebeb6e17c5f5659e853e6e
[ "MIT" ]
null
null
null
#pragma once #include "script.h" int lua_scr_clean(lua_State *L); #define MRV_LUAFS 1 const mrv_fpair lua_funcs[MRV_LUAFS] = { {"scr_clean", lua_scr_clean} }; #define reg_cfunc(L, func, name){ \ lua_pushcfunction(L, func); \ lua_setglobal(L, name); \ }
18.8
39
0.652482
ea04c0ee20ef32733ccc4f4bdd0fb65910d8e380
16,273
c
C
snake.X/main.c
yetkinakyz/PIC18F46K22-SnakeGame
779cfbd1453c39af7dd0cff8de2ca33548a48d9e
[ "MIT" ]
null
null
null
snake.X/main.c
yetkinakyz/PIC18F46K22-SnakeGame
779cfbd1453c39af7dd0cff8de2ca33548a48d9e
[ "MIT" ]
null
null
null
snake.X/main.c
yetkinakyz/PIC18F46K22-SnakeGame
779cfbd1453c39af7dd0cff8de2ca33548a48d9e
[ "MIT" ]
null
null
null
/* * Project Name: Snake Game Project with PIC18F46K22 * * Authors: Yetkin AKYUZ (yetkin.akyuz@outlook.com) * * Created on December 29, 2020, 5:35 PM */ #include <stdio.h> #include <stdlib.h> #include <xc.h> // *************** CONFIGURATIONS *************** // CONFIG1H #pragma config FOSC = INTIO67 // Oscillator Selection bits (Internal oscillator block) #pragma config PLLCFG = OFF // 4X PLL Enable (Oscillator used directly) #pragma config PRICLKEN = ON // Primary clock enable bit (Primary clock is always enabled) #pragma config FCMEN = OFF // Fail-Safe Clock Monitor Enable bit (Fail-Safe Clock Monitor disabled) #pragma config IESO = OFF // Internal/External Oscillator Switchover bit (Oscillator Switchover mode disabled) // CONFIG2L #pragma config PWRTEN = OFF // Power-up Timer Enable bit (Power up timer disabled) #pragma config BOREN = SBORDIS // Brown-out Reset Enable bits (Brown-out Reset enabled in hardware only (SBOREN is disabled)) #pragma config BORV = 190 // Brown Out Reset Voltage bits (VBOR set to 1.90 V nominal) // CONFIG2H #pragma config WDTEN = OFF // Watchdog Timer Enable bits (Watch dog timer is always disabled. SWDTEN has no effect.) #pragma config WDTPS = 32768 // Watchdog Timer Postscale Select bits (1:32768) // CONFIG3H #pragma config CCP2MX = PORTC1 // CCP2 MUX bit (CCP2 input/output is multiplexed with RC1) #pragma config PBADEN = ON // PORTB A/D Enable bit (PORTB<5:0> pins are configured as analog input channels on Reset) #pragma config CCP3MX = PORTB5 // P3A/CCP3 Mux bit (P3A/CCP3 input/output is multiplexed with RB5) #pragma config HFOFST = ON // HFINTOSC Fast Start-up (HFINTOSC output and ready status are not delayed by the oscillator stable status) #pragma config T3CMX = PORTC0 // Timer3 Clock input mux bit (T3CKI is on RC0) #pragma config P2BMX = PORTD2 // ECCP2 B output mux bit (P2B is on RD2) #pragma config MCLRE = EXTMCLR // MCLR Pin Enable bit (MCLR pin enabled, RE3 input pin disabled) // CONFIG4L #pragma config STVREN = ON // Stack Full/Underflow Reset Enable bit (Stack full/underflow will cause Reset) #pragma config LVP = ON // Single-Supply ICSP Enable bit (Single-Supply ICSP enabled if MCLRE is also 1) #pragma config XINST = OFF // Extended Instruction Set Enable bit (Instruction set extension and Indexed Addressing mode disabled (Legacy mode)) // CONFIG5L #pragma config CP0 = OFF // Code Protection Block 0 (Block 0 (000800-003FFFh) not code-protected) #pragma config CP1 = OFF // Code Protection Block 1 (Block 1 (004000-007FFFh) not code-protected) #pragma config CP2 = OFF // Code Protection Block 2 (Block 2 (008000-00BFFFh) not code-protected) #pragma config CP3 = OFF // Code Protection Block 3 (Block 3 (00C000-00FFFFh) not code-protected) // CONFIG5H #pragma config CPB = OFF // Boot Block Code Protection bit (Boot block (000000-0007FFh) not code-protected) #pragma config CPD = OFF // Data EEPROM Code Protection bit (Data EEPROM not code-protected) // CONFIG6L #pragma config WRT0 = OFF // Write Protection Block 0 (Block 0 (000800-003FFFh) not write-protected) #pragma config WRT1 = OFF // Write Protection Block 1 (Block 1 (004000-007FFFh) not write-protected) #pragma config WRT2 = OFF // Write Protection Block 2 (Block 2 (008000-00BFFFh) not write-protected) #pragma config WRT3 = OFF // Write Protection Block 3 (Block 3 (00C000-00FFFFh) not write-protected) // CONFIG6H #pragma config WRTC = OFF // Configuration Register Write Protection bit (Configuration registers (300000-3000FFh) not write-protected) #pragma config WRTB = OFF // Boot Block Write Protection bit (Boot Block (000000-0007FFh) not write-protected) #pragma config WRTD = OFF // Data EEPROM Write Protection bit (Data EEPROM not write-protected) // CONFIG7L #pragma config EBTR0 = OFF // Table Read Protection Block 0 (Block 0 (000800-003FFFh) not protected from table reads executed in other blocks) #pragma config EBTR1 = OFF // Table Read Protection Block 1 (Block 1 (004000-007FFFh) not protected from table reads executed in other blocks) #pragma config EBTR2 = OFF // Table Read Protection Block 2 (Block 2 (008000-00BFFFh) not protected from table reads executed in other blocks) #pragma config EBTR3 = OFF // Table Read Protection Block 3 (Block 3 (00C000-00FFFFh) not protected from table reads executed in other blocks) // CONFIG7H #pragma config EBTRB = OFF // Boot Block Table Read Protection bit (Boot Block (000000-0007FFh) not protected from table reads executed in other blocks) #define _XTAL_FREQ 64000000 // **************** PIN DEFINITIONS **************** // BUTTONS #define buttonRight PORTBbits.RB0 #define buttonLeft PORTBbits.RB1 #define buttonUp PORTBbits.RB2 #define buttonDown PORTBbits.RB3 // COLUMNS #define PORTROW0 LATAbits.LATA1 #define PORTROW1 LATAbits.LATA2 #define PORTROW2 LATAbits.LATA3 #define PORTROW3 LATDbits.LATD3 #define PORTROW4 LATDbits.LATD4 #define PORTROW5 LATDbits.LATD5 #define PORTROW6 LATDbits.LATD6 #define PORTROW7 LATDbits.LATD7 // ROWS #define PORTCOL0 LATEbits.LATE1 #define PORTCOL1 LATEbits.LATE2 #define PORTCOL2 LATCbits.LATC2 #define PORTCOL3 LATCbits.LATC3 #define PORTCOL4 LATCbits.LATC4 #define PORTCOL5 LATCbits.LATC5 #define PORTCOL6 LATCbits.LATC6 #define PORTCOL7 LATCbits.LATC7 // Column status lists const unsigned char Col0[] = {1, 0, 0, 0, 0, 0, 0, 0}; const unsigned char Col1[] = {0, 1, 0, 0, 0, 0, 0, 0}; const unsigned char Col2[] = {0, 0, 1, 0, 0, 0, 0, 0}; const unsigned char Col3[] = {0, 0, 0, 1, 0, 0, 0, 0}; const unsigned char Col4[] = {0, 0, 0, 0, 1, 0, 0, 0}; const unsigned char Col5[] = {0, 0, 0, 0, 0, 1, 0, 0}; const unsigned char Col6[] = {0, 0, 0, 0, 0, 0, 1, 0}; const unsigned char Col7[] = {0, 0, 0, 0, 0, 0, 0, 1}; // Row status lists const unsigned char Row0[] = {0, 1, 1, 1, 1, 1, 1, 1}; const unsigned char Row1[] = {1, 0, 1, 1, 1, 1, 1, 1}; const unsigned char Row2[] = {1, 1, 0, 1, 1, 1, 1, 1}; const unsigned char Row3[] = {1, 1, 1, 0, 1, 1, 1, 1}; const unsigned char Row4[] = {1, 1, 1, 1, 0, 1, 1, 1}; const unsigned char Row5[] = {1, 1, 1, 1, 1, 0, 1, 1}; const unsigned char Row6[] = {1, 1, 1, 1, 1, 1, 0, 1}; const unsigned char Row7[] = {1, 1, 1, 1, 1, 1, 1, 0}; // OSCILLATOR INITIALIZER FUNCTION void OSCILLATOR(void) { OSCCONbits.IRCF = 0x7; // INTERNAL OSCILLATOR OSCTUNEbits.PLLEN = 1; // PLL is ON } // PIN MANAGER FUNCTION void PIN_MANAGER(void) { /** TRISx registers */ TRISB = 0; //INPUT TRISA = 1; //OUTPUT TRISC = 1; //OUTPUT TRISD = 1; //OUTPUT TRISE = 1; //OUTPUT /** ANSELx registers */ ANSELA = 0; //DIGITAL IO ANSELB = 0; //DIGITAL IO ANSELC = 0; //DIGITAL IO ANSELD = 0; //DIGITAL IO ANSELE = 0; //DIGITAL IO /** WPUx registers */ WPUBbits.WPUB0 = 0; WPUBbits.WPUB1 = 0; WPUBbits.WPUB2 = 0; WPUBbits.WPUB3 = 0; } // CLEAN THE BOARD FUNCTION void BOARD_CLEAN(void) { PORTCOL0 = 0; PORTCOL1 = 0; PORTCOL2 = 0; PORTCOL3 = 0; PORTCOL4 = 0; PORTCOL5 = 0; PORTCOL6 = 0; PORTCOL7 = 0; PORTROW0 = 1; PORTROW1 = 1; PORTROW2 = 1; PORTROW3 = 1; PORTROW4 = 1; PORTROW5 = 1; PORTROW6 = 1; PORTROW7 = 1; } // LIGHT ALL OF THE LEDS FUNCTION void BOARD_FULL(void) { PORTCOL0 = 1; PORTCOL1 = 1; PORTCOL2 = 1; PORTCOL3 = 1; PORTCOL4 = 1; PORTCOL5 = 1; PORTCOL6 = 1; PORTCOL7 = 1; PORTROW0 = 0; PORTROW1 = 0; PORTROW2 = 0; PORTROW3 = 0; PORTROW4 = 0; PORTROW5 = 0; PORTROW6 = 0; PORTROW7 = 0; } // LIGHT THE LEDS FUNCTION void BOARD_LIGHT(unsigned char X, unsigned char Y) { PORTCOL0 = Col0[X]; PORTCOL1 = Col1[X]; PORTCOL2 = Col2[X]; PORTCOL3 = Col3[X]; PORTCOL4 = Col4[X]; PORTCOL5 = Col5[X]; PORTCOL6 = Col6[X]; PORTCOL7 = Col7[X]; PORTROW0 = Row0[Y]; PORTROW1 = Row1[Y]; PORTROW2 = Row2[Y]; PORTROW3 = Row3[Y]; PORTROW4 = Row4[Y]; PORTROW5 = Row5[Y]; PORTROW6 = Row6[Y]; PORTROW7 = Row7[Y]; } char BUTTON_CONTROL(char Direction) { // *************** BUTTONS **************** // The snake cannot go in the opposite direction on the same axis. if (buttonRight && Direction != 'L'){ Direction = 'R'; } else if (buttonLeft && Direction != 'R') { Direction = 'L'; } else if (buttonUp && Direction != 'D') { Direction = 'U'; } else if (buttonDown && Direction != 'U') { Direction = 'D'; } else { //Nothing } __delay_ms(0.005); return Direction; } void PRINT_SNAKE(double Cycle, int SnakeLength, unsigned char SnakeX[], unsigned char SnakeY[], int FoodX, int FoodY, char Direction) { // *************** SNAKE DELAY CONTROL *************** while(256 - ((0.1 * SnakeLength + 0.6) * Cycle) > 26) { Cycle--; } for (int j = 0; j < Cycle; j = j++) { Direction = BUTTON_CONTROL(Direction); // *************** PRINT SNAKE **************** for (int i = 0 ; i < SnakeLength; i++) { Direction = BUTTON_CONTROL(Direction); // Light the LEDs BOARD_LIGHT(SnakeX[i], SnakeY[i]); // Wait for 0.1 milliseconds __delay_ms(0.1); } // Clean the board BOARD_CLEAN(); // Wait for 0.5 milliseconds __delay_ms(0.5); // *************** PRINT FOOD **************** // Light the LEDs BOARD_LIGHT(FoodX, FoodY); // Wait for 0.1 milliseconds __delay_ms(0.1); // Clean the board BOARD_CLEAN(); } } // MAIN FUNCTION int main(void) { // System setup OSCILLATOR(); PIN_MANAGER(); // Light all of the LEDs BOARD_FULL(); // Wait for a second __delay_ms(1000); // Clean the board BOARD_CLEAN(); // **************** GAME SETUP **************** // Snake's coordinates. Maximum length of snake is 8 units. unsigned char SnakeX[64] = {2,1,0}; unsigned char SnakeY[64] = {2,2,2}; // Snake's length (Begins with 3 units) int SnakeLength = 3; // Level variable int level = 0; int Lost = 0; // Food Coordinates for each level int FoodXList[64] = {6, 3, 5, 3, 7, 2, 5, 1, 4, 2, 4, 2, 6, 3, 4, 1, 2, 6, 3, 3, 1, 5, 6, 4, 3, 5, 4, 2, 5, 4, 2, 4, 6, 3, 5, 3, 7, 2, 5, 1, 4, 2, 4, 2, 6, 3, 4, 1, 2, 6, 3, 3, 1, 5, 6, 4, 3, 5, 4, 2, 5, 4, 2, 4}; int FoodYList[64] = {2, 6, 3, 3, 1, 5, 6, 4, 3, 5, 4, 2, 5, 4, 2, 4, 6, 3, 5, 3, 7, 2, 5, 1, 4, 2, 4, 2, 6, 3, 4, 1, 2, 6, 3, 3, 1, 5, 6, 4, 3, 5, 4, 2, 5, 4, 2, 4, 6, 3, 5, 3, 7, 2, 5, 1, 4, 2, 4, 2, 6, 3, 4, 1}; // Present food coordinates int FoodX = FoodXList[level]; int FoodY = FoodYList[level]; // Directions (Begins with RIGHT) char Direction = 'R'; // Delay parameters for PRINT_SNAKE() double Cycle = 256; // Clean the board BOARD_CLEAN(); // Wait until any button is pressed while (!buttonRight && !buttonLeft && !buttonUp && !buttonDown) { PRINT_SNAKE(Cycle, SnakeLength, SnakeX, SnakeY, FoodX, FoodY, Direction); } while (buttonRight || buttonLeft || buttonUp || buttonDown); __delay_ms(150); // **************** GAME HAS STARTED **************** while (1) { // *************** EATING SELF **************** // If head's and any part of tail have same coordinates, game is over. Snake ate itself, you lost. for (int i = 1; i < SnakeLength - 1; i++) { if (SnakeX[i] == SnakeX[0] && SnakeY[i] == SnakeY[0]) { // Light all of the LEDs BOARD_FULL(); // Wait for a second __delay_ms(1000); Lost = 1; } } // *************** TAIL MOVEMENT CONTROL **************** // Each part of tail gets the value of the part which is in front of it. for (int i = SnakeLength - 1; i > 0; i--) { Direction = BUTTON_CONTROL(Direction); SnakeX[i] = SnakeX[i - 1]; SnakeY[i] = SnakeY[i - 1]; } // *************** HEAD MOVEMENT CONTROL **************** Direction = BUTTON_CONTROL(Direction); switch(Direction) { // Right case 'R': if (SnakeX[0] >= 7) { //Lost = 1; SnakeX[0] = 0; } else { SnakeX[0] = SnakeX[0] + 1; } break; // Left case 'L': if (SnakeX[0] < 1) { //Lost = 1; SnakeX[0] = 7; } else { SnakeX[0] = SnakeX[0] - 1; } break; // Up case 'U': if (SnakeY[0] >= 7) { //Lost = 1; SnakeY[0] = 0; } else { SnakeY[0] = SnakeY[0] + 1; } break; // Down case 'D': if (SnakeY[0] < 1) { //Lost = 1; SnakeY[0] = 7; } else { SnakeY[0] = SnakeY[0] - 1; } break; } // *************** PRINT SNAKE AND FOOD *************** PRINT_SNAKE(Cycle, SnakeLength, SnakeX, SnakeY, FoodX, FoodY, Direction); // *************** EATING FOOD **************** if ((FoodX == SnakeX[0]) && (FoodY == SnakeY[0])) { // If snake and food have the same coordinates, increase the length of sneak. // If the length is more than 7, game is over. You won. if (++SnakeLength < 10000) { // Level up level++; // New level food coordinates FoodX = FoodXList[level]; FoodY = FoodYList[level]; // Add new part to snake SnakeX[SnakeLength - 1] = 0; SnakeY[SnakeLength - 1] = 0; } } // Stop the game if we lost if (Lost == 1) { //Light all of the LEDs BOARD_FULL(); __delay_ms(1000); while (!buttonRight && !buttonLeft && !buttonUp && !buttonDown) { PRINT_SNAKE(Cycle, SnakeLength, SnakeX, SnakeY, SnakeX[0], SnakeY[0], Direction); } __delay_ms(50); while (buttonRight || buttonLeft || buttonUp || buttonDown); __delay_ms(50); //Clean the board BOARD_CLEAN(); //Stop the game break; } } // Wait until any button is pressed while (!buttonRight && !buttonLeft && !buttonUp && !buttonDown); __delay_ms(150); return 0; }
31.055344
217
0.520556
86d9d37143af5d82fb8360882e1299174b8e777f
63,671
h
C
externals/include/SDL_gpu.h
lordmu/scml-pp
7d7f25f87ed64b172eb33367c6cc27e11d5e062e
[ "MIT" ]
2
2018-02-12T21:33:09.000Z
2020-06-15T16:41:05.000Z
externals/include/SDL_gpu.h
lordmu/scml-pp
7d7f25f87ed64b172eb33367c6cc27e11d5e062e
[ "MIT" ]
null
null
null
externals/include/SDL_gpu.h
lordmu/scml-pp
7d7f25f87ed64b172eb33367c6cc27e11d5e062e
[ "MIT" ]
1
2017-01-01T00:06:33.000Z
2017-01-01T00:06:33.000Z
#ifndef _SDL_GPU_H__ #define _SDL_GPU_H__ #include "SDL.h" #include <stdio.h> #include <stdarg.h> #ifdef __cplusplus extern "C" { #endif // Compile-time versions #define SDL_GPU_VERSION_MAJOR 0 #define SDL_GPU_VERSION_MINOR 8 #define SDL_GPU_VERSION_PATCH 0 /* Auto-detect if we're using the SDL2 API by the headers available. */ #if SDL_VERSION_ATLEAST(2,0,0) #define SDL_GPU_USE_SDL2 #endif typedef struct GPU_Renderer GPU_Renderer; typedef struct GPU_Target GPU_Target; /*! A struct representing a rectangular area with floating point precision. * \see GPU_MakeRect() */ typedef struct GPU_Rect { float x, y; float w, h; } GPU_Rect; #define GPU_RENDERER_ORDER_MAX 10 typedef Uint32 GPU_RendererEnum; static const GPU_RendererEnum GPU_RENDERER_UNKNOWN = 0x0; // invalid value static const GPU_RendererEnum GPU_RENDERER_OPENGL_1_BASE = 0x1; static const GPU_RendererEnum GPU_RENDERER_OPENGL_1 = 0x2; static const GPU_RendererEnum GPU_RENDERER_OPENGL_2 = 0x4; static const GPU_RendererEnum GPU_RENDERER_OPENGL_3 = 0x8; static const GPU_RendererEnum GPU_RENDERER_OPENGL_4 = 0x10; static const GPU_RendererEnum GPU_RENDERER_GLES_1 = 0x100; static const GPU_RendererEnum GPU_RENDERER_GLES_2 = 0x200; static const GPU_RendererEnum GPU_RENDERER_GLES_3 = 0x400; static const GPU_RendererEnum GPU_RENDERER_D3D9 = 0x10000; static const GPU_RendererEnum GPU_RENDERER_D3D10 = 0x20000; static const GPU_RendererEnum GPU_RENDERER_D3D11 = 0x40000; /*! Renderer ID object for identifying a specific renderer. * \see GPU_MakeRendererID() * \see GPU_InitRendererByID() */ typedef struct GPU_RendererID { GPU_RendererEnum id; int major_version; int minor_version; int index; } GPU_RendererID; /*! Blending options * \see GPU_SetBlendMode() */ typedef enum { GPU_BLEND_NORMAL = 0, GPU_BLEND_PREMULTIPLIED_ALPHA = 1, GPU_BLEND_MULTIPLY = 2, GPU_BLEND_ADD = 3, GPU_BLEND_SUBTRACT = 4, GPU_BLEND_ADD_COLOR = 5, GPU_BLEND_SUBTRACT_COLOR = 6, GPU_BLEND_DARKEN = 7, GPU_BLEND_LIGHTEN = 8, GPU_BLEND_DIFFERENCE = 9, GPU_BLEND_PUNCHOUT = 10, GPU_BLEND_CUTOUT = 11, GPU_BLEND_MOD_ALPHA = 12, GPU_BLEND_SET_ALPHA = 13, GPU_BLEND_SET = 14, GPU_BLEND_NORMAL_KEEP_ALPHA = 15, GPU_BLEND_NORMAL_ADD_ALPHA = 16, GPU_BLEND_SUBTRACT_ALPHA = 17, GPU_BLEND_OVERRIDE = 100 // Lets you specify direct GL calls before blitting. Note: You should call GPU_FlushBlitBuffer() before you change blend modes via OpenGL so the new blend mode doesn't affect SDL_gpu's previously buffered blits. } GPU_BlendEnum; /*! Image filtering options. These affect the quality/interpolation of colors when images are scaled. * \see GPU_SetImageFilter() */ typedef enum { GPU_FILTER_NEAREST = 0, GPU_FILTER_LINEAR = 1, GPU_FILTER_LINEAR_MIPMAP = 2 } GPU_FilterEnum; /*! Snap modes. Blitting with these modes will align the sprite with the target's pixel grid. * \see GPU_SetSnapMode() * \see GPU_GetSnapMode() */ typedef enum { GPU_SNAP_NONE = 0, GPU_SNAP_POSITION = 1, GPU_SNAP_DIMENSIONS = 2, GPU_SNAP_POSITION_AND_DIMENSIONS = 3 } GPU_SnapEnum; /*! Image wrapping options. These affect how images handle src_rect coordinates beyond their dimensions when blitted. * \see GPU_SetWrapMode() */ typedef enum { GPU_WRAP_NONE = 0, GPU_WRAP_REPEAT = 1, GPU_WRAP_MIRRORED = 2 } GPU_WrapEnum; /*! Image format enum * \see GPU_CreateImage() */ typedef enum { GPU_FORMAT_LUMINANCE = 1, GPU_FORMAT_LUMINANCE_ALPHA = 2, GPU_FORMAT_RGB = 3, GPU_FORMAT_RGBA = 4, GPU_FORMAT_ALPHA = 5, GPU_FORMAT_RG = 6, GPU_FORMAT_YCbCr422 = 7, GPU_FORMAT_YCbCr420P = 8 } GPU_FormatEnum; /*! Image object for containing pixel/texture data. * A GPU_Image can be created with GPU_CreateImage(), GPU_LoadImage(), GPU_CopyImage(), or GPU_CopyImageFromSurface(). * Free the memory with GPU_FreeImage() when you're done. * \see GPU_CreateImage() * \see GPU_LoadImage() * \see GPU_CopyImage() * \see GPU_CopyImageFromSurface() * \see GPU_Target */ typedef struct GPU_Image { struct GPU_Renderer* renderer; GPU_Target* target; Uint16 w, h; GPU_FormatEnum format; int channels; Uint32 texture_w, texture_h; // Underlying texture dimensions Uint8 has_mipmaps; SDL_Color color; Uint8 use_blending; GPU_BlendEnum blend_mode; GPU_FilterEnum filter_mode; GPU_SnapEnum snap_mode; GPU_WrapEnum wrap_mode_x; GPU_WrapEnum wrap_mode_y; void* data; int refcount; Uint8 is_alias; } GPU_Image; /*! Camera object that determines viewing transform. * \see GPU_SetCamera() * \see GPU_GetDefaultCamera() * \see GPU_GetCamera() */ typedef struct GPU_Camera { float x, y, z; float angle; float zoom; } GPU_Camera; /*! Container for the built-in shader attribute and uniform locations (indices). * \see GPU_LoadShaderBlock() * \see GPU_SetShaderBlock() */ typedef struct GPU_ShaderBlock { // Attributes int position_loc; int texcoord_loc; int color_loc; // Uniforms int modelViewProjection_loc; } GPU_ShaderBlock; #ifndef GPU_MATRIX_STACK_MAX #define GPU_MATRIX_STACK_MAX 5 #endif /*! Matrix stack data structure for replacing the old OpenGL matrix stack. */ typedef struct GPU_MatrixStack { unsigned int size; float matrix[GPU_MATRIX_STACK_MAX][16]; } GPU_MatrixStack; /*! Rendering context data. Only GPU_Targets which represent windows will store this. */ typedef struct GPU_Context { /*! SDL_GLContext */ void* context; /*! SDL window ID */ Uint32 windowID; /*! Actual window dimensions */ int window_w; int window_h; /*! Window dimensions for restoring windowed mode after GPU_ToggleFullscreen(1). */ int stored_window_w; int stored_window_h; /*! Internal state */ Uint32 current_shader_program; Uint32 default_textured_shader_program; Uint32 default_untextured_shader_program; Uint8 shapes_use_blending; GPU_BlendEnum shapes_blend_mode; float line_thickness; Uint8 use_texturing; int matrix_mode; GPU_MatrixStack projection_matrix; GPU_MatrixStack modelview_matrix; void* data; } GPU_Context; /*! Render target object for use as a blitting destination. * A GPU_Target can be created from a GPU_Image with GPU_LoadTarget(). * A GPU_Target can also represent a separate window with GPU_CreateTargetFromWindow(). In that case, 'context' is allocated and filled in. * Note: You must have passed the SDL_WINDOW_OPENGL flag to SDL_CreateWindow() for OpenGL renderers to work with new windows. * Free the memory with GPU_FreeTarget() when you're done. * \see GPU_LoadTarget() * \see GPU_CreateTargetFromWindow() * \see GPU_FreeTarget() */ struct GPU_Target { struct GPU_Renderer* renderer; GPU_Image* image; void* data; Uint16 w, h; Uint8 use_clip_rect; GPU_Rect clip_rect; Uint8 use_color; SDL_Color color; GPU_Rect viewport; /*! Perspective and object viewing transforms. */ GPU_Camera camera; /*! Renderer context data. NULL if the target does not represent a window or rendering context. */ GPU_Context* context; int refcount; Uint8 is_alias; }; /*! Important GPU features which may not be supported depending on a device's extension support. Can be OR'd together. * \see GPU_IsFeatureEnabled() * \see GPU_SetPreInitFlags() * \see GPU_GetPreInitFlags() */ typedef Uint32 GPU_FeatureEnum; static const GPU_FeatureEnum GPU_FEATURE_NON_POWER_OF_TWO = 0x1; static const GPU_FeatureEnum GPU_FEATURE_RENDER_TARGETS = 0x2; static const GPU_FeatureEnum GPU_FEATURE_BLEND_EQUATIONS = 0x4; static const GPU_FeatureEnum GPU_FEATURE_BLEND_FUNC_SEPARATE = 0x8; static const GPU_FeatureEnum GPU_FEATURE_GL_BGR = 0x10; static const GPU_FeatureEnum GPU_FEATURE_GL_BGRA = 0x20; static const GPU_FeatureEnum GPU_FEATURE_GL_ABGR = 0x40; static const GPU_FeatureEnum GPU_FEATURE_VERTEX_SHADER = 0x100; static const GPU_FeatureEnum GPU_FEATURE_FRAGMENT_SHADER = 0x200; static const GPU_FeatureEnum GPU_FEATURE_PIXEL_SHADER = 0x200; static const GPU_FeatureEnum GPU_FEATURE_GEOMETRY_SHADER = 0x400; static const GPU_FeatureEnum GPU_FEATURE_WRAP_REPEAT_MIRRORED = 0x800; /*! Combined feature flags */ #define GPU_FEATURE_ALL_BASE GPU_FEATURE_RENDER_TARGETS #define GPU_FEATURE_ALL_BLEND_MODES (GPU_FEATURE_BLEND_EQUATIONS | GPU_FEATURE_BLEND_FUNC_SEPARATE) #define GPU_FEATURE_ALL_GL_FORMATS (GPU_FEATURE_GL_BGR | GPU_FEATURE_GL_BGRA | GPU_FEATURE_GL_ABGR) #define GPU_FEATURE_BASIC_SHADERS (GPU_FEATURE_FRAGMENT_SHADER | GPU_FEATURE_PIXEL_SHADER) #define GPU_FEATURE_ALL_SHADERS (GPU_FEATURE_FRAGMENT_SHADER | GPU_FEATURE_PIXEL_SHADER | GPU_FEATURE_GEOMETRY_SHADER) /*! For separating combined feature flags from init flags. */ #define GPU_FEATURE_MASK 0x00FFFF #define GPU_INIT_MASK 0xFF0000 typedef Uint32 GPU_WindowFlagEnum; /*! Initialization flags for changing default init parameters. Can be bitwise OR'ed together with GPU_FeatureEnums. * Default (0) is to use late swap vsync and double buffering. * \see GPU_SetPreInitFlags() * \see GPU_GetPreInitFlags() */ typedef Uint32 GPU_InitFlagEnum; static const GPU_InitFlagEnum GPU_INIT_ENABLE_VSYNC = 0x10000; static const GPU_InitFlagEnum GPU_INIT_DISABLE_VSYNC = 0x20000; static const GPU_InitFlagEnum GPU_INIT_DISABLE_DOUBLE_BUFFER = 0x40000; #define GPU_DEFAULT_INIT_FLAGS 0 static const Uint32 GPU_NONE = 0x0; /*! Bit flags for the blit batch functions. * \see GPU_BlitBatch() * \see GPU_BlitBatchSeparate() */ typedef Uint32 GPU_BlitFlagEnum; static const GPU_BlitFlagEnum GPU_PASSTHROUGH_VERTICES = 0x1; static const GPU_BlitFlagEnum GPU_PASSTHROUGH_TEXCOORDS = 0x2; static const GPU_BlitFlagEnum GPU_PASSTHROUGH_COLORS = 0x4; static const GPU_BlitFlagEnum GPU_USE_DEFAULT_POSITIONS = 0x8; static const GPU_BlitFlagEnum GPU_USE_DEFAULT_SRC_RECTS = 0x10; static const GPU_BlitFlagEnum GPU_USE_DEFAULT_COLORS = 0x20; #define GPU_PASSTHROUGH_ALL (GPU_PASSTHROUGH_VERTICES | GPU_PASSTHROUGH_TEXCOORDS | GPU_PASSTHROUGH_COLORS) /*! Type enumeration for GPU_AttributeFormat specifications. */ typedef Uint32 GPU_TypeEnum; // Use OpenGL's values for simpler translation static const GPU_TypeEnum GPU_TYPE_BYTE = 0x1400; static const GPU_TypeEnum GPU_TYPE_UNSIGNED_BYTE = 0x1401; static const GPU_TypeEnum GPU_TYPE_SHORT = 0x1402; static const GPU_TypeEnum GPU_TYPE_UNSIGNED_SHORT = 0x1403; static const GPU_TypeEnum GPU_TYPE_INT = 0x1404; static const GPU_TypeEnum GPU_TYPE_UNSIGNED_INT = 0x1405; static const GPU_TypeEnum GPU_TYPE_FLOAT = 0x1406; static const GPU_TypeEnum GPU_TYPE_DOUBLE = 0x140A; /*! Shader type enum. * \see GPU_LoadShader() * \see GPU_CompileShader() * \see GPU_CompileShader_RW() */ typedef enum { GPU_VERTEX_SHADER = 0, GPU_FRAGMENT_SHADER = 1, GPU_PIXEL_SHADER = 1, GPU_GEOMETRY_SHADER = 2 } GPU_ShaderEnum; /*! Type enumeration for the shader language used by the renderer. */ typedef enum { GPU_LANGUAGE_NONE = 0, GPU_LANGUAGE_ARB_ASSEMBLY = 1, GPU_LANGUAGE_GLSL = 2, GPU_LANGUAGE_GLSLES = 3, GPU_LANGUAGE_HLSL = 4, GPU_LANGUAGE_CG = 5 } GPU_ShaderLanguageEnum; typedef struct GPU_AttributeFormat { Uint8 is_per_sprite; // Per-sprite values are expanded to 4 vertices int num_elems_per_value; GPU_TypeEnum type; // GPU_TYPE_FLOAT, GPU_TYPE_INT, GPU_TYPE_UNSIGNED_INT, etc. Uint8 normalize; int stride_bytes; // Number of bytes between two vertex specifications int offset_bytes; // Number of bytes to skip at the beginning of 'values' } GPU_AttributeFormat; typedef struct GPU_Attribute { int location; void* values; // Expect 4 values for each sprite GPU_AttributeFormat format; } GPU_Attribute; typedef struct GPU_AttributeSource { Uint8 enabled; int num_values; void* next_value; // Automatic storage format int per_vertex_storage_stride_bytes; int per_vertex_storage_offset_bytes; int per_vertex_storage_size; // Over 0 means that the per-vertex storage has been automatically allocated void* per_vertex_storage; // Could point to the attribute's values or to allocated storage GPU_Attribute attribute; } GPU_AttributeSource; /*! Type enumeration for error codes. * \see GPU_PushErrorCode() * \see GPU_PopErrorCode() */ typedef enum { GPU_ERROR_NONE = 0, GPU_ERROR_BACKEND_ERROR = 1, GPU_ERROR_DATA_ERROR = 2, GPU_ERROR_USER_ERROR = 3, GPU_ERROR_UNSUPPORTED_FUNCTION = 4, GPU_ERROR_NULL_ARGUMENT = 5, GPU_ERROR_FILE_NOT_FOUND = 6 } GPU_ErrorEnum; typedef struct GPU_ErrorObject { char* function; GPU_ErrorEnum error; char* details; } GPU_ErrorObject; /*! Type enumeration for debug levels. * \see GPU_SetDebugLevel() * \see GPU_GetDebugLevel() */ typedef enum { GPU_DEBUG_LEVEL_0 = 0, GPU_DEBUG_LEVEL_1 = 1, GPU_DEBUG_LEVEL_2 = 2, GPU_DEBUG_LEVEL_3 = 3, GPU_DEBUG_LEVEL_MAX = 3 } GPU_DebugLevelEnum; /*! Renderer object which specializes the API to a particular backend. */ struct GPU_Renderer { /*! Struct identifier of the renderer. */ GPU_RendererID id; GPU_RendererID requested_id; GPU_WindowFlagEnum SDL_init_flags; GPU_InitFlagEnum GPU_init_flags; GPU_ShaderLanguageEnum shader_language; int shader_version; GPU_FeatureEnum enabled_features; /*! Current display target */ GPU_Target* current_context_target; /*! \see GPU_Init() * \see GPU_InitRenderer() * \see GPU_InitRendererByID() */ GPU_Target* (*Init)(GPU_Renderer* renderer, GPU_RendererID renderer_request, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags); /*! \see GPU_IsFeatureEnabled() */ Uint8 (*IsFeatureEnabled)(GPU_Renderer* renderer, GPU_FeatureEnum feature); /*! \see GPU_CreateTargetFromWindow * The extra parameter is used internally to reuse/reinit a target. */ GPU_Target* (*CreateTargetFromWindow)(GPU_Renderer* renderer, Uint32 windowID, GPU_Target* target); /*! \see GPU_CreateAliasTarget() */ GPU_Target* (*CreateAliasTarget)(GPU_Renderer* renderer, GPU_Target* target); /*! \see GPU_MakeCurrent */ void (*MakeCurrent)(GPU_Renderer* renderer, GPU_Target* target, Uint32 windowID); /*! Sets up this renderer to act as the current renderer. Called automatically by GPU_SetCurrentRenderer(). */ void (*SetAsCurrent)(GPU_Renderer* renderer); /*! \see GPU_SetWindowResolution() */ Uint8 (*SetWindowResolution)(GPU_Renderer* renderer, Uint16 w, Uint16 h); /*! \see GPU_SetVirtualResolution() */ void (*SetVirtualResolution)(GPU_Renderer* renderer, GPU_Target* target, Uint16 w, Uint16 h); /*! \see GPU_UnsetVirtualResolution() */ void (*UnsetVirtualResolution)(GPU_Renderer* renderer, GPU_Target* target); /*! Clean up the renderer state. */ void (*Quit)(GPU_Renderer* renderer); /*! \see GPU_ToggleFullscreen() */ Uint8 (*ToggleFullscreen)(GPU_Renderer* renderer, Uint8 use_desktop_resolution); /*! \see GPU_SetCamera() */ GPU_Camera (*SetCamera)(GPU_Renderer* renderer, GPU_Target* target, GPU_Camera* cam); /*! \see GPU_CreateImage() */ GPU_Image* (*CreateImage)(GPU_Renderer* renderer, Uint16 w, Uint16 h, GPU_FormatEnum format); /*! \see GPU_LoadImage() */ GPU_Image* (*LoadImage)(GPU_Renderer* renderer, const char* filename); /*! \see GPU_CreateAliasImage() */ GPU_Image* (*CreateAliasImage)(GPU_Renderer* renderer, GPU_Image* image); /*! \see GPU_SaveImage() */ Uint8 (*SaveImage)(GPU_Renderer* renderer, GPU_Image* image, const char* filename); /*! \see GPU_CopyImage() */ GPU_Image* (*CopyImage)(GPU_Renderer* renderer, GPU_Image* image); /*! \see GPU_UpdateImage */ void (*UpdateImage)(GPU_Renderer* renderer, GPU_Image* image, SDL_Surface* surface, const GPU_Rect* surface_rect); /*! \see GPU_UpdateSubImage */ void (*UpdateSubImage)(GPU_Renderer* renderer, GPU_Image* image, const GPU_Rect* image_rect, SDL_Surface* surface, const GPU_Rect* surface_rect); /*! \see GPU_UpdateImageBytes */ void (*UpdateImageBytes)(GPU_Renderer* renderer, GPU_Image* image, const GPU_Rect* image_rect, const unsigned char* bytes, int bytes_per_row); /*! \see GPU_CopyImageFromSurface() */ GPU_Image* (*CopyImageFromSurface)(GPU_Renderer* renderer, SDL_Surface* surface); /*! \see GPU_CopyImageFromTarget() */ GPU_Image* (*CopyImageFromTarget)(GPU_Renderer* renderer, GPU_Target* target); /*! \see GPU_CopySurfaceFromTarget() */ SDL_Surface* (*CopySurfaceFromTarget)(GPU_Renderer* renderer, GPU_Target* target); /*! \see GPU_CopySurfaceFromImage() */ SDL_Surface* (*CopySurfaceFromImage)(GPU_Renderer* renderer, GPU_Image* image); /*! \see GPU_FreeImage() */ void (*FreeImage)(GPU_Renderer* renderer, GPU_Image* image); /*! \see GPU_LoadTarget() */ GPU_Target* (*LoadTarget)(GPU_Renderer* renderer, GPU_Image* image); /*! \see GPU_FreeTarget() */ void (*FreeTarget)(GPU_Renderer* renderer, GPU_Target* target); /*! \see GPU_Blit() */ void (*Blit)(GPU_Renderer* renderer, GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y); /*! \see GPU_BlitRotate() */ void (*BlitRotate)(GPU_Renderer* renderer, GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float degrees); /*! \see GPU_BlitScale() */ void (*BlitScale)(GPU_Renderer* renderer, GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float scaleX, float scaleY); /*! \see GPU_BlitTransform */ void (*BlitTransform)(GPU_Renderer* renderer, GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float degrees, float scaleX, float scaleY); /*! \see GPU_BlitTransformX() */ void (*BlitTransformX)(GPU_Renderer* renderer, GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float pivot_x, float pivot_y, float degrees, float scaleX, float scaleY); /*! \see GPU_BlitTransformMatrix() */ void (*BlitTransformMatrix)(GPU_Renderer* renderer, GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float* matrix3x3); /*! \see GPU_BlitBatch() */ void (*BlitBatch)(GPU_Renderer* renderer, GPU_Image* image, GPU_Target* target, unsigned int num_sprites, float* values, GPU_BlitFlagEnum flags); /*! \see GPU_TriangleBatch() */ void (*TriangleBatch)(GPU_Renderer* renderer, GPU_Image* image, GPU_Target* target, unsigned short num_vertices, float* values, unsigned int num_indices, unsigned short* indices, GPU_BlitFlagEnum flags); /*! \see GPU_GenerateMipmaps() */ void (*GenerateMipmaps)(GPU_Renderer* renderer, GPU_Image* image); /*! \see GPU_SetClip() */ GPU_Rect (*SetClip)(GPU_Renderer* renderer, GPU_Target* target, Sint16 x, Sint16 y, Uint16 w, Uint16 h); /*! \see GPU_UnsetClip() */ void (*UnsetClip)(GPU_Renderer* renderer, GPU_Target* target); /*! \see GPU_GetPixel() */ SDL_Color (*GetPixel)(GPU_Renderer* renderer, GPU_Target* target, Sint16 x, Sint16 y); /*! \see GPU_SetImageFilter() */ void (*SetImageFilter)(GPU_Renderer* renderer, GPU_Image* image, GPU_FilterEnum filter); /*! \see GPU_SetWrapMode() */ void (*SetWrapMode)(GPU_Renderer* renderer, GPU_Image* image, GPU_WrapEnum wrap_mode_x, GPU_WrapEnum wrap_mode_y); /*! \see GPU_Clear() */ void (*Clear)(GPU_Renderer* renderer, GPU_Target* target); /*! \see GPU_ClearRGBA() */ void (*ClearRGBA)(GPU_Renderer* renderer, GPU_Target* target, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /*! \see GPU_FlushBlitBuffer() */ void (*FlushBlitBuffer)(GPU_Renderer* renderer); /*! \see GPU_Flip() */ void (*Flip)(GPU_Renderer* renderer, GPU_Target* target); /*! \see GPU_CompileShader_RW() */ Uint32 (*CompileShader_RW)(GPU_Renderer* renderer, GPU_ShaderEnum shader_type, SDL_RWops* shader_source); /*! \see GPU_CompileShader() */ Uint32 (*CompileShader)(GPU_Renderer* renderer, GPU_ShaderEnum shader_type, const char* shader_source); /*! \see GPU_LinkShaderProgram() */ Uint32 (*LinkShaderProgram)(GPU_Renderer* renderer, Uint32 program_object); /*! \see GPU_LinkShaders() */ Uint32 (*LinkShaders)(GPU_Renderer* renderer, Uint32 shader_object1, Uint32 shader_object2); /*! \see GPU_FreeShader() */ void (*FreeShader)(GPU_Renderer* renderer, Uint32 shader_object); /*! \see GPU_FreeShaderProgram() */ void (*FreeShaderProgram)(GPU_Renderer* renderer, Uint32 program_object); /*! \see GPU_AttachShader() */ void (*AttachShader)(GPU_Renderer* renderer, Uint32 program_object, Uint32 shader_object); /*! \see GPU_DetachShader() */ void (*DetachShader)(GPU_Renderer* renderer, Uint32 program_object, Uint32 shader_object); /*! \see GPU_IsDefaultShaderProgram() */ Uint8 (*IsDefaultShaderProgram)(GPU_Renderer* renderer, Uint32 program_object); /*! \see GPU_ActivateShaderProgram() */ void (*ActivateShaderProgram)(GPU_Renderer* renderer, Uint32 program_object, GPU_ShaderBlock* block); /*! \see GPU_DeactivateShaderProgram() */ void (*DeactivateShaderProgram)(GPU_Renderer* renderer); /*! \see GPU_GetShaderMessage() */ const char* (*GetShaderMessage)(GPU_Renderer* renderer); /*! \see GPU_GetAttribLocation() */ int (*GetAttributeLocation)(GPU_Renderer* renderer, Uint32 program_object, const char* attrib_name); /*! \see GPU_GetUniformLocation() */ int (*GetUniformLocation)(GPU_Renderer* renderer, Uint32 program_object, const char* uniform_name); /*! \see GPU_LoadShaderBlock() */ GPU_ShaderBlock (*LoadShaderBlock)(GPU_Renderer* renderer, Uint32 program_object, const char* position_name, const char* texcoord_name, const char* color_name, const char* modelViewMatrix_name); /*! \see GPU_SetShaderBlock() */ void (*SetShaderBlock)(GPU_Renderer* renderer, GPU_ShaderBlock block); /*! \see GPU_SetShaderImage() */ void (*SetShaderImage)(GPU_Renderer* renderer, GPU_Image* image, int location, int image_unit); /*! \see GPU_GetUniformiv() */ void (*GetUniformiv)(GPU_Renderer* renderer, Uint32 program_object, int location, int* values); /*! \see GPU_SetUniformi() */ void (*SetUniformi)(GPU_Renderer* renderer, int location, int value); /*! \see GPU_SetUniformiv() */ void (*SetUniformiv)(GPU_Renderer* renderer, int location, int num_elements_per_value, int num_values, int* values); /*! \see GPU_GetUniformuiv() */ void (*GetUniformuiv)(GPU_Renderer* renderer, Uint32 program_object, int location, unsigned int* values); /*! \see GPU_SetUniformui() */ void (*SetUniformui)(GPU_Renderer* renderer, int location, unsigned int value); /*! \see GPU_SetUniformuiv() */ void (*SetUniformuiv)(GPU_Renderer* renderer, int location, int num_elements_per_value, int num_values, unsigned int* values); /*! \see GPU_GetUniformfv() */ void (*GetUniformfv)(GPU_Renderer* renderer, Uint32 program_object, int location, float* values); /*! \see GPU_SetUniformf() */ void (*SetUniformf)(GPU_Renderer* renderer, int location, float value); /*! \see GPU_SetUniformfv() */ void (*SetUniformfv)(GPU_Renderer* renderer, int location, int num_elements_per_value, int num_values, float* values); /*! \see GPU_SetUniformMatrixfv() */ void (*SetUniformMatrixfv)(GPU_Renderer* renderer, int location, int num_matrices, int num_rows, int num_columns, Uint8 transpose, float* values); /*! \see GPU_SetAttributef() */ void (*SetAttributef)(GPU_Renderer* renderer, int location, float value); /*! \see GPU_SetAttributei() */ void (*SetAttributei)(GPU_Renderer* renderer, int location, int value); /*! \see GPU_SetAttributeui() */ void (*SetAttributeui)(GPU_Renderer* renderer, int location, unsigned int value); /*! \see GPU_SetAttributefv() */ void (*SetAttributefv)(GPU_Renderer* renderer, int location, int num_elements, float* value); /*! \see GPU_SetAttributeiv() */ void (*SetAttributeiv)(GPU_Renderer* renderer, int location, int num_elements, int* value); /*! \see GPU_SetAttributeuiv() */ void (*SetAttributeuiv)(GPU_Renderer* renderer, int location, int num_elements, unsigned int* value); /*! \see GPU_SetAttributeSource() */ void (*SetAttributeSource)(GPU_Renderer* renderer, int num_values, GPU_Attribute source); // Shapes /*! \see GPU_SetLineThickness() */ float (*SetLineThickness)(GPU_Renderer* renderer, float thickness); /*! \see GPU_GetLineThickness() */ float (*GetLineThickness)(GPU_Renderer* renderer); /*! \see GPU_Pixel() */ void (*Pixel)(GPU_Renderer* renderer, GPU_Target* target, float x, float y, SDL_Color color); /*! \see GPU_Line() */ void (*Line)(GPU_Renderer* renderer, GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color); /*! \see GPU_Arc() */ void (*Arc)(GPU_Renderer* renderer, GPU_Target* target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color); /*! \see GPU_ArcFilled() */ void (*ArcFilled)(GPU_Renderer* renderer, GPU_Target* target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color); /*! \see GPU_Circle() */ void (*Circle)(GPU_Renderer* renderer, GPU_Target* target, float x, float y, float radius, SDL_Color color); /*! \see GPU_CircleFilled() */ void (*CircleFilled)(GPU_Renderer* renderer, GPU_Target* target, float x, float y, float radius, SDL_Color color); /*! \see GPU_Sector() */ void (*Sector)(GPU_Renderer* renderer, GPU_Target* target, float x, float y, float inner_radius, float outer_radius, float start_angle, float end_angle, SDL_Color color); /*! \see GPU_SectorFilled() */ void (*SectorFilled)(GPU_Renderer* renderer, GPU_Target* target, float x, float y, float inner_radius, float outer_radius, float start_angle, float end_angle, SDL_Color color); /*! \see GPU_Tri() */ void (*Tri)(GPU_Renderer* renderer, GPU_Target* target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color); /*! \see GPU_TriFilled() */ void (*TriFilled)(GPU_Renderer* renderer, GPU_Target* target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color); /*! \see GPU_Rectangle() */ void (*Rectangle)(GPU_Renderer* renderer, GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color); /*! \see GPU_RectangleFilled() */ void (*RectangleFilled)(GPU_Renderer* renderer, GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color); /*! \see GPU_RectangleRound() */ void (*RectangleRound)(GPU_Renderer* renderer, GPU_Target* target, float x1, float y1, float x2, float y2, float radius, SDL_Color color); /*! \see GPU_RectangleRoundFilled() */ void (*RectangleRoundFilled)(GPU_Renderer* renderer, GPU_Target* target, float x1, float y1, float x2, float y2, float radius, SDL_Color color); /*! \see GPU_Polygon() */ void (*Polygon)(GPU_Renderer* renderer, GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color); /*! \see GPU_PolygonFilled() */ void (*PolygonFilled)(GPU_Renderer* renderer, GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color); }; // Setup calls // Visual C does not support static inline #ifdef _MSC_VER static SDL_version GPU_GetCompiledVersion(void) #else static inline SDL_version GPU_GetCompiledVersion(void) #endif { SDL_version v = {SDL_GPU_VERSION_MAJOR, SDL_GPU_VERSION_MINOR, SDL_GPU_VERSION_PATCH}; return v; } SDL_version GPU_GetLinkedVersion(void); /*! The window corresponding to 'windowID' will be used to create the rendering context instead of creating a new window. */ void GPU_SetInitWindow(Uint32 windowID); /*! Returns the window ID that has been set via GPU_SetInitWindow(). */ Uint32 GPU_GetInitWindow(void); /*! Set special flags to use for initialization. Set these before calling GPU_Init(). * \param GPU_flags An OR'ed combination of GPU_InitFlagEnum flags and GPU_FeatureEnum flags. GPU_FeatureEnum flags will force GPU_Init() to create a renderer that supports all of the given flags or else fail. Default flags (0) enable late swap vsync and double buffering. */ void GPU_SetPreInitFlags(GPU_InitFlagEnum GPU_flags); /*! Returns the current special flags to use for initialization. */ GPU_InitFlagEnum GPU_GetPreInitFlags(void); /*! Gets the default initialization renderer IDs for the current platform copied into the 'order' array and the number of renderer IDs into 'order_size'. Pass NULL for 'order' to just get the size of the renderer order array. Will return at most GPU_RENDERER_ORDER_MAX renderers. */ void GPU_GetDefaultRendererOrder(int* order_size, GPU_RendererID* order); /*! Gets the current renderer ID order for initialization copied into the 'order' array and the number of renderer IDs into 'order_size'. Pass NULL for 'order' to just get the size of the renderer order array. */ void GPU_GetRendererOrder(int* order_size, GPU_RendererID* order); /*! Sets the renderer ID order to use for initialization. If 'order' is NULL, it will restore the default order. */ void GPU_SetRendererOrder(int order_size, GPU_RendererID* order); /*! Initializes SDL and SDL_gpu. Creates a window and goes through the renderer order to create a renderer context. * \see GPU_SetRendererOrder() */ GPU_Target* GPU_Init(Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags); /*! Initializes SDL and SDL_gpu. Creates a window and the requested renderer context. */ GPU_Target* GPU_InitRenderer(GPU_RendererEnum renderer_enum, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags); /*! Initializes SDL and SDL_gpu. Creates a window and the requested renderer context. * By requesting a renderer via ID, you can specify the major and minor versions of an individual renderer backend. * \see GPU_MakeRendererID */ GPU_Target* GPU_InitRendererByID(GPU_RendererID renderer_request, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags); /*! Checks for important GPU features which may not be supported depending on a device's extension support. Feature flags (GPU_FEATURE_*) can be bitwise OR'd together. * \return 1 if all of the passed features are enabled/supported * \return 0 if any of the passed features are disabled/unsupported */ Uint8 GPU_IsFeatureEnabled(GPU_FeatureEnum feature); /*! Clean up the renderer state. */ void GPU_CloseCurrentRenderer(void); /*! Clean up the renderer state and shut down SDL_gpu. */ void GPU_Quit(void); // Debugging, logging, and error handling /*! Sets the global debug level. * GPU_DEBUG_LEVEL_0: Normal * GPU_DEBUG_LEVEL_1: Prints messages when errors are pushed via GPU_PushErrorCode() * GPU_DEBUG_LEVEL_2: Elevates warning logs to error priority * GPU_DEBUG_LEVEL_3: Elevates info logs to error priority */ void GPU_SetDebugLevel(GPU_DebugLevelEnum level); /*! Returns the current global debug level. */ GPU_DebugLevelEnum GPU_GetDebugLevel(void); /*! Prints an informational log message. */ void GPU_LogInfo(const char* format, ...); /*! Prints a warning log message. */ void GPU_LogWarning(const char* format, ...); /*! Prints an error log message. */ void GPU_LogError(const char* format, ...); #define GPU_Log GPU_LogInfo /*! Pushes a new error code onto the error stack. If the stack is full, this function does nothing. * \param function The name of the function that pushed the error * \param error The error code to push on the error stack * \param details Additional information string, can be NULL. */ void GPU_PushErrorCode(const char* function, GPU_ErrorEnum error, const char* details, ...); /*! Pops an error object from the error stack and returns it. If the error stack is empty, it returns an error object with NULL function, GPU_ERROR_NONE error, and NULL details. */ GPU_ErrorObject GPU_PopErrorCode(void); /*! Gets the string representation of an error code. */ const char* GPU_GetErrorString(GPU_ErrorEnum error); // Renderer setup controls /*! Translates a GPU_RendererEnum into a string. */ const char* GPU_GetRendererEnumString(GPU_RendererEnum id); /*! Returns an initialized GPU_RendererID. */ GPU_RendererID GPU_MakeRendererID(GPU_RendererEnum id, int major_version, int minor_version); /*! Gets the renderer identifier for the given registration index. */ GPU_RendererID GPU_GetRendererID(unsigned int index); /*! Gets the number of registered (available) renderers. */ int GPU_GetNumRegisteredRenderers(void); /*! Gets an array of identifiers for the registered (available) renderers. */ void GPU_GetRegisteredRendererList(GPU_RendererID* renderers_array); /*! Creates a new renderer matching the given identifier. */ GPU_Renderer* GPU_AddRenderer(GPU_RendererID id); /*! Deletes the renderer matching the given identifier. */ void GPU_RemoveRenderer(GPU_RendererID id); // Renderer controls /*! Gets the number of active (created) renderers. */ int GPU_GetNumActiveRenderers(void); /*! Gets an array of identifiers for the active renderers. */ void GPU_GetActiveRendererList(GPU_RendererID* renderers_array); /*! Gets the renderer for the given renderer index. */ GPU_Renderer* GPU_GetRenderer(unsigned int index); /*! \return The renderer matching the given identifier. */ GPU_Renderer* GPU_GetRendererByID(GPU_RendererID id); /*! \return The current renderer */ GPU_Renderer* GPU_GetCurrentRenderer(void); /*! Switches the current renderer to the renderer matching the given identifier. */ void GPU_SetCurrentRenderer(GPU_RendererID id); // Context / window controls /*! \return The renderer's current context target. */ GPU_Target* GPU_GetContextTarget(void); /*! \return The target that is associated with the given windowID. */ GPU_Target* GPU_GetWindowTarget(Uint32 windowID); /*! Creates a separate context for the given window using the current renderer and returns a GPU_Target that represents it. */ GPU_Target* GPU_CreateTargetFromWindow(Uint32 windowID); /*! Makes the given window the current rendering destination for the given context target. * This also makes the target the current context for image loading and window operations. * If the target does not represent a window, this does nothing. */ void GPU_MakeCurrent(GPU_Target* target, Uint32 windowID); /*! Change the actual size of the current context target's window. This resets the virtual resolution and viewport of the context target. * Aside from direct resolution changes, this should also be called in response to SDL_WINDOWEVENT_RESIZED window events for resizable windows. */ Uint8 GPU_SetWindowResolution(Uint16 w, Uint16 h); /*! Enable/disable fullscreen mode for the current context target's window. * On some platforms, this may destroy the renderer context and require that textures be reloaded. Unfortunately, SDL does not provide a notification mechanism for this. * \param use_desktop_resolution If true, lets the window change its resolution when it enters fullscreen mode (via SDL_WINDOW_FULLSCREEN_DESKTOP). * \return 0 if the new mode is windowed, 1 if the new mode is fullscreen. */ Uint8 GPU_ToggleFullscreen(Uint8 use_desktop_resolution); /*! Enables/disables alpha blending for shape rendering on the current window. */ void GPU_SetShapeBlending(Uint8 enable); /*! Sets the blending mode for shape rendering on the current window, if supported by the renderer. */ void GPU_SetShapeBlendMode(GPU_BlendEnum mode); /*! Sets the thickness of lines for the current context. * \param thickness New line thickness in pixels measured across the line. Default is 1.0f. * \return The old thickness value */ float GPU_SetLineThickness(float thickness); /*! Returns the current line thickness value. */ float GPU_GetLineThickness(void); // Target controls /*! Creates a target that aliases the given target. Aliases can be used to store target settings (e.g. viewports) for easy switching. * GPU_FreeTarget() frees the alias's memory, but does not affect the original. */ GPU_Target* GPU_CreateAliasTarget(GPU_Target* target); /*! Creates a new render target from the given image. It can then be accessed from image->target. */ GPU_Target* GPU_LoadTarget(GPU_Image* image); /*! Deletes a render target in the proper way for this renderer. */ void GPU_FreeTarget(GPU_Target* target); /*! Change the logical size of the given target. Rendering to this target will be scaled as if the dimensions were actually the ones given. */ void GPU_SetVirtualResolution(GPU_Target* target, Uint16 w, Uint16 h); /*! Converts screen space coordinates (such as from mouse input) to logical drawing coordinates. */ void GPU_GetVirtualCoords(GPU_Target* target, float* x, float* y, float displayX, float displayY); /*! Reset the logical size of the given target to its original value. */ void GPU_UnsetVirtualResolution(GPU_Target* target); /*! \return A GPU_Rect with the given values. */ GPU_Rect GPU_MakeRect(float x, float y, float w, float h); /*! \return An SDL_Color with the given values. */ SDL_Color GPU_MakeColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a); /*! Sets the given target's viewport. */ void GPU_SetViewport(GPU_Target* target, GPU_Rect viewport); /*! \return A GPU_Camera with position (0, 0, -10), angle of 0, and zoom of 1. */ GPU_Camera GPU_GetDefaultCamera(void); /*! \return The camera of the given render target. If target is NULL, returns the default camera. */ GPU_Camera GPU_GetCamera(GPU_Target* target); /*! Sets the current render target's current camera. * \param target A pointer to the target that will copy this camera. * \param cam A pointer to the camera data to use or NULL to use the default camera. * \return The old camera. */ GPU_Camera GPU_SetCamera(GPU_Target* target, GPU_Camera* cam); /*! \return The RGBA color of a pixel. */ SDL_Color GPU_GetPixel(GPU_Target* target, Sint16 x, Sint16 y); /*! Sets the clipping rect for the given render target. */ GPU_Rect GPU_SetClipRect(GPU_Target* target, GPU_Rect rect); /*! Sets the clipping rect for the given render target. */ GPU_Rect GPU_SetClip(GPU_Target* target, Sint16 x, Sint16 y, Uint16 w, Uint16 h); /*! Turns off clipping for the given target. */ void GPU_UnsetClip(GPU_Target* target); /*! Sets the modulation color for subsequent drawing of images and shapes on the given target. * This has a cumulative effect with the image coloring functions. * e.g. GPU_SetRGB(image, 255, 128, 0); GPU_SetTargetRGB(target, 128, 128, 128); * Would make the image draw with color of roughly (128, 64, 0). */ void GPU_SetTargetColor(GPU_Target* target, SDL_Color* color); /*! Sets the modulation color for subsequent drawing of images and shapes on the given target. * This has a cumulative effect with the image coloring functions. * e.g. GPU_SetRGB(image, 255, 128, 0); GPU_SetTargetRGB(target, 128, 128, 128); * Would make the image draw with color of roughly (128, 64, 0). */ void GPU_SetTargetRGB(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b); /*! Sets the modulation color for subsequent drawing of images and shapes on the given target. * This has a cumulative effect with the image coloring functions. * e.g. GPU_SetRGB(image, 255, 128, 0); GPU_SetTargetRGB(target, 128, 128, 128); * Would make the image draw with color of roughly (128, 64, 0). */ void GPU_SetTargetRGBA(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b, Uint8 a); // Surface controls /*! Load surface from an image file that is supported by this renderer. Don't forget to SDL_FreeSurface() it. */ SDL_Surface* GPU_LoadSurface(const char* filename); /*! Save surface to a file. The file type is deduced from the extension. Supported formats are: png, bmp, tga. Returns 0 on failure. */ Uint8 GPU_SaveSurface(SDL_Surface* surface, const char* filename); // Image controls /*! Create a new, blank image with the given format. Don't forget to GPU_FreeImage() it. * \param w Image width in pixels * \param h Image height in pixels * \param format Format of color channels. */ GPU_Image* GPU_CreateImage(Uint16 w, Uint16 h, GPU_FormatEnum format); /*! Load image from an image file that is supported by this renderer. Don't forget to GPU_FreeImage() it. */ GPU_Image* GPU_LoadImage(const char* filename); /*! Creates an image that aliases the given image. Aliases can be used to store image settings (e.g. modulation color) for easy switching. * GPU_FreeImage() frees the alias's memory, but does not affect the original. */ GPU_Image* GPU_CreateAliasImage(GPU_Image* image); /*! Copy an image to a new image. Don't forget to GPU_FreeImage() both. */ GPU_Image* GPU_CopyImage(GPU_Image* image); /*! Deletes an image in the proper way for this renderer. Also deletes the corresponding GPU_Target if applicable. Be careful not to use that target afterward! */ void GPU_FreeImage(GPU_Image* image); /*! Update an image from surface data. */ void GPU_UpdateImage(GPU_Image* image, SDL_Surface* surface, const GPU_Rect* surface_rect); /*! Update an image from surface data. */ void GPU_UpdateSubImage(GPU_Image* image, const GPU_Rect* image_rect, SDL_Surface* surface, const GPU_Rect* surface_rect); /*! Update an image from an array of pixel data. */ void GPU_UpdateImageBytes(GPU_Image* image, const GPU_Rect* image_rect, const unsigned char* bytes, int bytes_per_row); /*! Save image to a file. The file type is deduced from the extension. Supported formats are: png, bmp, tga. Returns 0 on failure. */ Uint8 GPU_SaveImage(GPU_Image* image, const char* filename); /*! Loads mipmaps for the given image, if supported by the renderer. */ void GPU_GenerateMipmaps(GPU_Image* image); /*! Sets the modulation color for subsequent drawing of the given image. */ void GPU_SetColor(GPU_Image* image, SDL_Color* color); /*! Sets the modulation color for subsequent drawing of the given image. */ void GPU_SetRGB(GPU_Image* image, Uint8 r, Uint8 g, Uint8 b); /*! Sets the modulation color for subsequent drawing of the given image. */ void GPU_SetRGBA(GPU_Image* image, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /*! Gets the current alpha blending setting. */ Uint8 GPU_GetBlending(GPU_Image* image); /*! Enables/disables alpha blending for the given image. */ void GPU_SetBlending(GPU_Image* image, Uint8 enable); /*! Sets the blending mode, if supported by the renderer. */ void GPU_SetBlendMode(GPU_Image* image, GPU_BlendEnum mode); /*! Sets the image filtering mode, if supported by the renderer. */ void GPU_SetImageFilter(GPU_Image* image, GPU_FilterEnum filter); /*! Gets the current pixel snap setting. The default value is GPU_SNAP_POSITION_AND_DIMENSIONS. */ GPU_SnapEnum GPU_GetSnapMode(GPU_Image* image); /*! Sets the pixel grid snapping mode for the given image. */ void GPU_SetSnapMode(GPU_Image* image, GPU_SnapEnum mode); /*! Sets the image wrapping mode, if supported by the renderer. */ void GPU_SetWrapMode(GPU_Image* image, GPU_WrapEnum wrap_mode_x, GPU_WrapEnum wrap_mode_y); // Surface / Image / Target conversions /*! Copy SDL_Surface data into a new GPU_Image. Don't forget to SDL_FreeSurface() the surface and GPU_FreeImage() the image.*/ GPU_Image* GPU_CopyImageFromSurface(SDL_Surface* surface); /*! Copy GPU_Target data into a new GPU_Image. Don't forget to GPU_FreeImage() the image.*/ GPU_Image* GPU_CopyImageFromTarget(GPU_Target* target); /*! Copy GPU_Target data into a new SDL_Surface. Don't forget to SDL_FreeSurface() the surface.*/ SDL_Surface* GPU_CopySurfaceFromTarget(GPU_Target* target); /*! Copy GPU_Image data into a new SDL_Surface. Don't forget to SDL_FreeSurface() the surface and GPU_FreeImage() the image.*/ SDL_Surface* GPU_CopySurfaceFromImage(GPU_Image* image); // Rendering /*! Clears the contents of the given render target. Fills the target with color {0, 0, 0, 0}. */ void GPU_Clear(GPU_Target* target); /*! Fills the given render target with a color. If 'color' is NULL, {0, 0, 0, 0} is used. */ void GPU_ClearColor(GPU_Target* target, SDL_Color* color); /*! Fills the given render target with a color. */ void GPU_ClearRGBA(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /*! Draws the given image to the given render target. * \param src_rect The region of the source image to use. * \param x Destination x-position * \param y Destination y-position */ void GPU_Blit(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y); /*! Rotates and draws the given image to the given render target. * \param src_rect The region of the source image to use. * \param x Destination x-position * \param y Destination y-position * \param degrees Rotation angle (in degrees) */ void GPU_BlitRotate(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float degrees); /*! Scales and draws the given image to the given render target. * \param src_rect The region of the source image to use. * \param x Destination x-position * \param y Destination y-position * \param scaleX Horizontal stretch factor * \param scaleY Vertical stretch factor */ void GPU_BlitScale(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float scaleX, float scaleY); /*! Scales, rotates, and draws the given image to the given render target. * \param src_rect The region of the source image to use. * \param x Destination x-position * \param y Destination y-position * \param degrees Rotation angle (in degrees) * \param scaleX Horizontal stretch factor * \param scaleY Vertical stretch factor */ void GPU_BlitTransform(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float degrees, float scaleX, float scaleY); /*! Scales, rotates around a pivot point, and draws the given image to the given render target. The drawing point (x, y) coincides with the pivot point on the src image (pivot_x, pivot_y). * \param src_rect The region of the source image to use. * \param x Destination x-position * \param y Destination y-position * \param pivot_x Pivot x-position (in image coordinates) * \param pivot_y Pivot y-position (in image coordinates) * \param degrees Rotation angle (in degrees) * \param scaleX Horizontal stretch factor * \param scaleY Vertical stretch factor */ void GPU_BlitTransformX(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float pivot_x, float pivot_y, float degrees, float scaleX, float scaleY); /*! Transforms and draws the given image to the given render target. * \param src_rect The region of the source image to use. * \param x Destination x-position * \param y Destination y-position * \param matrix3x3 3x3 matrix in column-major order (index = row + column*numColumns) */ void GPU_BlitTransformMatrix(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float* matrix3x3); /*! Performs 'num_sprites' blits of the given image to the given target. * Note: GPU_BlitBatch() cannot interpret a mix of normal values and "passthrough" values due to format ambiguity. * \param values A tightly-packed array of position (x,y), src_rect (x,y,w,h) values in image coordinates, and color (r,g,b,a) values with a range from 0-255. Pass NULL to render with only custom shader attributes. * \param flags Bit flags to control the interpretation of the array parameters. The only passthrough option accepted is GPU_PASSTHROUGH_ALL. */ void GPU_BlitBatch(GPU_Image* image, GPU_Target* target, unsigned int num_sprites, float* values, GPU_BlitFlagEnum flags); /*! Performs 'num_sprites' blits of the given image to the given target. * \param positions A tightly-packed array of (x,y) values * \param src_rects A tightly-packed array of (x,y,w,h) values in image coordinates * \param colors A tightly-packed array of (r,g,b,a) values with a range from 0-255 * \param flags Bit flags to control the interpretation of the array parameters */ void GPU_BlitBatchSeparate(GPU_Image* image, GPU_Target* target, unsigned int num_sprites, float* positions, float* src_rects, float* colors, GPU_BlitFlagEnum flags); /*! Renders triangles from the given set of vertices. This lets you render arbitrary 2D geometry. * \param values A tightly-packed array of vertex position (x,y), image coordinates (s,t), and color (r,g,b,a) values with a range from 0-255. Pass NULL to render with only custom shader attributes. * \param indices If not NULL, this is used to specify which vertices to use and in what order (i.e. it indexes the vertices in the 'values' array). * \param flags Bit flags to control the interpretation of the array parameters. Since 'values' contains per-vertex data, GPU_PASSTHROUGH_VERTICES is ignored. Texture coordinates are scaled down using the image dimensions and color components are normalized to [0.0, 1.0]. */ void GPU_TriangleBatch(GPU_Image* image, GPU_Target* target, unsigned short num_vertices, float* values, unsigned int num_indices, unsigned short* indices, GPU_BlitFlagEnum flags); /*! Send all buffered blitting data to the current context target. */ void GPU_FlushBlitBuffer(void); /*! Updates the given target's associated window. */ void GPU_Flip(GPU_Target* target); // Shapes /*! Renders a colored point. * \param target The destination render target * \param x x-coord of the point * \param y y-coord of the point * \param color The color of the shape to render */ void GPU_Pixel(GPU_Target* target, float x, float y, SDL_Color color); /*! Renders a colored line. * \param target The destination render target * \param x1 x-coord of starting point * \param y1 y-coord of starting point * \param x2 x-coord of ending point * \param y2 y-coord of ending point * \param color The color of the shape to render */ void GPU_Line(GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color); /*! Renders a colored arc curve (circle segment). * \param target The destination render target * \param x x-coord of center point * \param y y-coord of center point * \param radius The radius of the circle / distance from the center point that rendering will occur * \param start_angle The angle to start from, in degrees. Measured clockwise from the positive x-axis. * \param end_angle The angle to end at, in degrees. Measured clockwise from the positive x-axis. * \param color The color of the shape to render */ void GPU_Arc(GPU_Target* target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color); /*! Renders a colored filled arc (circle segment / pie piece). * \param target The destination render target * \param x x-coord of center point * \param y y-coord of center point * \param radius The radius of the circle / distance from the center point that rendering will occur * \param start_angle The angle to start from, in degrees. Measured clockwise from the positive x-axis. * \param end_angle The angle to end at, in degrees. Measured clockwise from the positive x-axis. * \param color The color of the shape to render */ void GPU_ArcFilled(GPU_Target* target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color); /*! Renders a colored circle outline. * \param target The destination render target * \param x x-coord of center point * \param y y-coord of center point * \param radius The radius of the circle / distance from the center point that rendering will occur * \param color The color of the shape to render */ void GPU_Circle(GPU_Target* target, float x, float y, float radius, SDL_Color color); /*! Renders a colored filled circle. * \param target The destination render target * \param x x-coord of center point * \param y y-coord of center point * \param radius The radius of the circle / distance from the center point that rendering will occur * \param color The color of the shape to render */ void GPU_CircleFilled(GPU_Target* target, float x, float y, float radius, SDL_Color color); /*! Renders a colored annular sector outline (ring segment). * \param target The destination render target * \param x x-coord of center point * \param y y-coord of center point * \param inner_radius The inner radius of the ring * \param outer_radius The outer radius of the ring * \param start_angle The angle to start from, in degrees. Measured clockwise from the positive x-axis. * \param end_angle The angle to end at, in degrees. Measured clockwise from the positive x-axis. * \param color The color of the shape to render */ void GPU_Sector(GPU_Target* target, float x, float y, float inner_radius, float outer_radius, float start_angle, float end_angle, SDL_Color color); /*! Renders a colored filled annular sector (ring segment). * \param target The destination render target * \param x x-coord of center point * \param y y-coord of center point * \param inner_radius The inner radius of the ring * \param outer_radius The outer radius of the ring * \param start_angle The angle to start from, in degrees. Measured clockwise from the positive x-axis. * \param end_angle The angle to end at, in degrees. Measured clockwise from the positive x-axis. * \param color The color of the shape to render */ void GPU_SectorFilled(GPU_Target* target, float x, float y, float inner_radius, float outer_radius, float start_angle, float end_angle, SDL_Color color); /*! Renders a colored triangle outline. * \param target The destination render target * \param x1 x-coord of first point * \param y1 y-coord of first point * \param x2 x-coord of second point * \param y2 y-coord of second point * \param x3 x-coord of third point * \param y3 y-coord of third point * \param color The color of the shape to render */ void GPU_Tri(GPU_Target* target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color); /*! Renders a colored filled triangle. * \param target The destination render target * \param x1 x-coord of first point * \param y1 y-coord of first point * \param x2 x-coord of second point * \param y2 y-coord of second point * \param x3 x-coord of third point * \param y3 y-coord of third point * \param color The color of the shape to render */ void GPU_TriFilled(GPU_Target* target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color); /*! Renders a colored rectangle outline. * \param target The destination render target * \param x1 x-coord of top-left corner * \param y1 y-coord of top-left corner * \param x2 x-coord of bottom-right corner * \param y2 y-coord of bottom-right corner * \param color The color of the shape to render */ void GPU_Rectangle(GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color); /*! Renders a colored filled rectangle. * \param target The destination render target * \param x1 x-coord of top-left corner * \param y1 y-coord of top-left corner * \param x2 x-coord of bottom-right corner * \param y2 y-coord of bottom-right corner * \param color The color of the shape to render */ void GPU_RectangleFilled(GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color); /*! Renders a colored rounded (filleted) rectangle outline. * \param target The destination render target * \param x1 x-coord of top-left corner * \param y1 y-coord of top-left corner * \param x2 x-coord of bottom-right corner * \param y2 y-coord of bottom-right corner * \param radius The radius of the corners * \param color The color of the shape to render */ void GPU_RectangleRound(GPU_Target* target, float x1, float y1, float x2, float y2, float radius, SDL_Color color); /*! Renders a colored filled rounded (filleted) rectangle. * \param target The destination render target * \param x1 x-coord of top-left corner * \param y1 y-coord of top-left corner * \param x2 x-coord of bottom-right corner * \param y2 y-coord of bottom-right corner * \param radius The radius of the corners * \param color The color of the shape to render */ void GPU_RectangleRoundFilled(GPU_Target* target, float x1, float y1, float x2, float y2, float radius, SDL_Color color); /*! Renders a colored polygon outline. The vertices are expected to define a convex polygon. * \param target The destination render target * \param num_vertices Number of vertices (x and y pairs) * \param vertices An array of vertex positions stored as interlaced x and y coords, e.g. {x1, y1, x2, y2, ...} * \param color The color of the shape to render */ void GPU_Polygon(GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color); /*! Renders a colored filled polygon. The vertices are expected to define a convex polygon. * \param target The destination render target * \param num_vertices Number of vertices (x and y pairs) * \param vertices An array of vertex positions stored as interlaced x and y coords, e.g. {x1, y1, x2, y2, ...} * \param color The color of the shape to render */ void GPU_PolygonFilled(GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color); // Shaders /*! Loads shader source from an SDL_RWops, compiles it, and returns the new shader object. */ Uint32 GPU_CompileShader_RW(GPU_ShaderEnum shader_type, SDL_RWops* shader_source); /*! Loads shader source from a file, compiles it, and returns the new shader object. */ Uint32 GPU_LoadShader(GPU_ShaderEnum shader_type, const char* filename); /*! Compiles shader source and returns the new shader object. */ Uint32 GPU_CompileShader(GPU_ShaderEnum shader_type, const char* shader_source); /*! Links a shader program with any attached shader objects. */ Uint32 GPU_LinkShaderProgram(Uint32 program_object); /*! Creates and links a shader program with the given shader objects. */ Uint32 GPU_LinkShaders(Uint32 shader_object1, Uint32 shader_object2); /*! Deletes a shader object. */ void GPU_FreeShader(Uint32 shader_object); /*! Deletes a shader program. */ void GPU_FreeShaderProgram(Uint32 program_object); /*! Attaches a shader object to a shader program for future linking. */ void GPU_AttachShader(Uint32 program_object, Uint32 shader_object); /*! Detaches a shader object from a shader program. */ void GPU_DetachShader(Uint32 program_object, Uint32 shader_object); /*! \return The current shader program */ Uint32 GPU_GetCurrentShaderProgram(void); /*! Returns 1 if the given shader program is a default shader for the current context, 0 otherwise. */ Uint8 GPU_IsDefaultShaderProgram(Uint32 program_object); /*! Activates the given shader program. Passing NULL for 'block' will disable the built-in shader variables for custom shaders until a GPU_ShaderBlock is set again. */ void GPU_ActivateShaderProgram(Uint32 program_object, GPU_ShaderBlock* block); /*! Deactivates the current shader program (activates program 0). */ void GPU_DeactivateShaderProgram(void); /*! Returns the last shader log message. */ const char* GPU_GetShaderMessage(void); /*! Returns an integer representing the location of the specified attribute shader variable. */ int GPU_GetAttributeLocation(Uint32 program_object, const char* attrib_name); /*! Returns a filled GPU_AttributeFormat object. */ GPU_AttributeFormat GPU_MakeAttributeFormat(int num_elems_per_vertex, GPU_TypeEnum type, Uint8 normalize, int stride_bytes, int offset_bytes); /*! Returns a filled GPU_Attribute object. */ GPU_Attribute GPU_MakeAttribute(int location, void* values, GPU_AttributeFormat format); /*! Returns an integer representing the location of the specified uniform shader variable. */ int GPU_GetUniformLocation(Uint32 program_object, const char* uniform_name); /*! Loads the given shader program's built-in attribute and uniform locations. */ GPU_ShaderBlock GPU_LoadShaderBlock(Uint32 program_object, const char* position_name, const char* texcoord_name, const char* color_name, const char* modelViewMatrix_name); /*! Sets the current shader block to use the given attribute and uniform locations. */ void GPU_SetShaderBlock(GPU_ShaderBlock block); /*! Sets the given image unit to the given image so that a custom shader can sample multiple textures. \param image The source image/texture. Pass NULL to disable the image unit. \param location The uniform location of a texture sampler \param image_unit The index of the texture unit to set. 0 is the first unit, which is used by SDL_gpu's blitting functions. 1 would be the second unit. */ void GPU_SetShaderImage(GPU_Image* image, int location, int image_unit); /*! Fills "values" with the value of the uniform shader variable at the given location. */ void GPU_GetUniformiv(Uint32 program_object, int location, int* values); /*! Sets the value of the integer uniform shader variable at the given location. This is equivalent to calling GPU_SetUniformiv(location, 1, 1, &value). */ void GPU_SetUniformi(int location, int value); /*! Sets the value of the integer uniform shader variable at the given location. */ void GPU_SetUniformiv(int location, int num_elements_per_value, int num_values, int* values); /*! Fills "values" with the value of the uniform shader variable at the given location. */ void GPU_GetUniformuiv(Uint32 program_object, int location, unsigned int* values); /*! Sets the value of the unsigned integer uniform shader variable at the given location. This is equivalent to calling GPU_SetUniformuiv(location, 1, 1, &value). */ void GPU_SetUniformui(int location, unsigned int value); /*! Sets the value of the unsigned integer uniform shader variable at the given location. */ void GPU_SetUniformuiv(int location, int num_elements_per_value, int num_values, unsigned int* values); /*! Fills "values" with the value of the uniform shader variable at the given location. */ void GPU_GetUniformfv(Uint32 program_object, int location, float* values); /*! Sets the value of the floating point uniform shader variable at the given location. This is equivalent to calling GPU_SetUniformfv(location, 1, 1, &value). */ void GPU_SetUniformf(int location, float value); /*! Sets the value of the floating point uniform shader variable at the given location. */ void GPU_SetUniformfv(int location, int num_elements_per_value, int num_values, float* values); /*! Fills "values" with the value of the uniform shader variable at the given location. The results are identical to calling GPU_GetUniformfv(). Matrices are gotten in column-major order. */ void GPU_GetUniformMatrixfv(Uint32 program_object, int location, float* values); /*! Sets the value of the matrix uniform shader variable at the given location. The size of the matrices sent is specified by num_rows and num_columns. Rows and columns must be between 2 and 4. */ void GPU_SetUniformMatrixfv(int location, int num_matrices, int num_rows, int num_columns, Uint8 transpose, float* values); /*! Sets a constant-value shader attribute that will be used for each rendered vertex. */ void GPU_SetAttributef(int location, float value); /*! Sets a constant-value shader attribute that will be used for each rendered vertex. */ void GPU_SetAttributei(int location, int value); /*! Sets a constant-value shader attribute that will be used for each rendered vertex. */ void GPU_SetAttributeui(int location, unsigned int value); /*! Sets a constant-value shader attribute that will be used for each rendered vertex. */ void GPU_SetAttributefv(int location, int num_elements, float* value); /*! Sets a constant-value shader attribute that will be used for each rendered vertex. */ void GPU_SetAttributeiv(int location, int num_elements, int* value); /*! Sets a constant-value shader attribute that will be used for each rendered vertex. */ void GPU_SetAttributeuiv(int location, int num_elements, unsigned int* value); /*! Enables a shader attribute and sets its source data. */ void GPU_SetAttributeSource(int num_values, GPU_Attribute source); #ifdef __cplusplus } #endif #endif
41.184347
284
0.754362
86e1d3145d65723fe881643d9f46007ccad1817e
358
h
C
ObserverPattern/Example/Observer/ObserverInterface.h
liuyongjiesail/DesignPatterns
e48ca585c8c992cf8f10b880ce5c787bd8c42d96
[ "Apache-2.0" ]
null
null
null
ObserverPattern/Example/Observer/ObserverInterface.h
liuyongjiesail/DesignPatterns
e48ca585c8c992cf8f10b880ce5c787bd8c42d96
[ "Apache-2.0" ]
null
null
null
ObserverPattern/Example/Observer/ObserverInterface.h
liuyongjiesail/DesignPatterns
e48ca585c8c992cf8f10b880ce5c787bd8c42d96
[ "Apache-2.0" ]
null
null
null
// // ObserverInterface.h // DesignPatterns // // Created by 刘永杰 on 2018/12/4. // Copyright © 2018 刘永杰. All rights reserved. // #import <Foundation/Foundation.h> NS_ASSUME_NONNULL_BEGIN @protocol ObserverInterface <NSObject> - (void)updateTemperature:(float)temperature humidity:(float)humidity pressure:(float)pressure; @end NS_ASSUME_NONNULL_END
17.9
95
0.759777
efb95d67c5248a43e6a175dacd46fd3c5096d594
1,589
h
C
genetics/shared/symbols/ParameterDescriptor.h
crest01/ShapeGenetics
7321f6484be668317ad763c0ca5e4d6cbfef8cd1
[ "MIT" ]
18
2017-04-26T13:53:43.000Z
2021-05-29T03:55:27.000Z
genetics/shared/symbols/ParameterDescriptor.h
crest01/ShapeGenetics
7321f6484be668317ad763c0ca5e4d6cbfef8cd1
[ "MIT" ]
null
null
null
genetics/shared/symbols/ParameterDescriptor.h
crest01/ShapeGenetics
7321f6484be668317ad763c0ca5e4d6cbfef8cd1
[ "MIT" ]
2
2017-10-17T10:32:01.000Z
2019-11-11T07:23:54.000Z
/* * ParamterDescriptor.h * * Created on: Nov 6, 2015 * Author: Karl Haubenwallner */ #ifndef GPUPROCGENETICS_SRC_PARAMETER_PARAMETERDESCRIPTOR_H_ #define GPUPROCGENETICS_SRC_PARAMETER_PARAMETERDESCRIPTOR_H_ #include <vector> #include <cstring> #include "Parameter.h" #include "RandomValues.h" namespace PGA { class ParameterDescriptor_IF { private: virtual void generateRandomValue_impl(Parameter* ) = 0; std::string _name; public: ParameterDescriptor_IF(const std::string& name): _name(name) {}; virtual ~ParameterDescriptor_IF() {} void generateRandomValue(Parameter* param) { generateRandomValue_impl(param); } virtual unsigned int typeSize() = 0; virtual float probability() = 0; }; template <typename T> class ParameterDescriptor : public ParameterDescriptor_IF { private: T _min; T _max; virtual void generateRandomValue_impl(Parameter* param) { if (param->size == sizeof(T)) { T val = getRandomValue(_min, _max); void *pv = static_cast<void* >(&val); memcpy(param->data, pv, sizeof(T)); } else { throw std::invalid_argument("incorrect type for getRandomVal"); } } public: ParameterDescriptor(const std::string& name, const T& min, const T& max): ParameterDescriptor_IF(name), _min(min), _max(max) { } unsigned int typeSize() { return sizeof(T); } // returns the likelihood of the last selected parameter. For U[0, 1] = 1 float probability() { return 1; } }; } // namespace PGA #endif /* GPUPROCGENETICS_SRC_PARAMETER_PARAMETERDESCRIPTOR_H_ */
22.7
78
0.696035
f407eb454e6f30d87cc070b4ad518333f71ef50b
330
h
C
Editor/DataImporter.h
jowie94/EquinoxEngine
45f5efaa00e35a264bf3537ec3bdfe8b221325bf
[ "MIT" ]
null
null
null
Editor/DataImporter.h
jowie94/EquinoxEngine
45f5efaa00e35a264bf3537ec3bdfe8b221325bf
[ "MIT" ]
null
null
null
Editor/DataImporter.h
jowie94/EquinoxEngine
45f5efaa00e35a264bf3537ec3bdfe8b221325bf
[ "MIT" ]
1
2018-10-16T20:12:59.000Z
2018-10-16T20:12:59.000Z
#pragma once #include "ModuleAnimation.h" #include <memory> class Level; class DataImporter { public: DataImporter() = default; ~DataImporter() = default; std::shared_ptr<Level> ImportLevel(const char* path, const char* file) const; std::shared_ptr<Animation> ImportAnimation(const char* path, const char* file) const; };
19.411765
86
0.742424
4cc8bbce59a52ab55b39ac317f2e20cbbf262aa5
1,305
h
C
GFX_Linux_SDK/OGLES2/SDKPackage/Shell/OS/LinuxEWS/PVRShellOS.h
andreimironenko/graphics-sdk
a00f508acfd016ae8412529d60d015446c3a1ff9
[ "Fair", "Unlicense" ]
1
2022-03-21T15:39:01.000Z
2022-03-21T15:39:01.000Z
GFX_Linux_SDK/OGLES2/SDKPackage/Shell/OS/LinuxEWS/PVRShellOS.h
jhofstee/Graphics_SDK
805bd44f347ed40699a84979bc9f3e8eb085fd9e
[ "Fair", "Unlicense" ]
null
null
null
GFX_Linux_SDK/OGLES2/SDKPackage/Shell/OS/LinuxEWS/PVRShellOS.h
jhofstee/Graphics_SDK
805bd44f347ed40699a84979bc9f3e8eb085fd9e
[ "Fair", "Unlicense" ]
null
null
null
/****************************************************************************** @File PVRShellOS.h @Title LinuxEWS/PVRShellOS @Version @Version @Copyright Copyright (c) Imagination Technologies Limited. @Platform Example Window System support for Linux @Description Makes programming for 3D APIs easier by wrapping surface initialization, Texture allocation and other functions for use by a demo. ******************************************************************************/ #ifndef _PVRSHELLOS_ #define _PVRSHELLOS_ #include <termios.h> #include <unistd.h> #include <EWS/ews.h> #define PVRSHELL_DIR_SYM '/' #define _stricmp strcasecmp /*!*************************************************************************** PVRShellInitOS @Brief Class. Interface with specific Operative System. *****************************************************************************/ class PVRShellInitOS { public: EWS_DISPLAY m_EWSDisplay; EWS_WINDOW m_EWSWindow; timeval m_StartTime; }; #endif /* _PVRSHELLOS_ */ /***************************************************************************** End of file (PVRShellOS.h) *****************************************************************************/
29
89
0.438314
71506793bd812e74435f6510fea5712a630955ba
10,923
h
C
CppCollection/ConverterV2.42.inline.h
huoyongkai/Wireless360
20b458809b16aa05316cbbe98d2aebc10b4ba19f
[ "MIT" ]
1
2020-06-25T05:36:23.000Z
2020-06-25T05:36:23.000Z
CppCollection/ConverterV2.42.inline.h
huoyongkai/Wireless360
20b458809b16aa05316cbbe98d2aebc10b4ba19f
[ "MIT" ]
null
null
null
CppCollection/ConverterV2.42.inline.h
huoyongkai/Wireless360
20b458809b16aa05316cbbe98d2aebc10b4ba19f
[ "MIT" ]
null
null
null
/** * @file * @brief Convertors * @version 2.34 * @author Yongkai HUO, yh3g09 (forevervhuo@gmail.com, yh3g09@ecs.soton.ac.uk) * @date Jun 8, 2010-Nov 11, 2011 * @copyright None. */ #ifndef _CONVERTER_INLINE_H #define _CONVERTER_INLINE_H #include "Headers.h" #include Converter_DEF #include Assert_H template<class T> Vec<T> Converter::vector2Vec(const vector<T>& _input) { Vec<T> ret; vector2Vec<T>(_input,ret); return ret; } template<class T> void Converter::vector2Vec(const vector<T>& _input,Vec<T>& _output) { _output.set_size(_input.size()); for(int i=0;i<_output.size();i++) { _output[i]=_input[i]; } } template<class T> vector<T> Converter::Vec2vector(const Vec<T>& _input) { vector<T> ret; Vec2vector<T>(_input,ret); return ret; } template<class T> void Converter::Vec2vector(const Vec<T>& _input,vector<T>& _output) { _output.resize(_input.size()); for(int i=0;i<_output.size();i++) { _output[i]=_input[i]; } } template<class T> void Converter::Mat2Vec_rowise(const Mat< T >& _input, Vec< T >& _output) { _output.set_size(_input.size()); int ind=0; for (int r=0;r<_input.rows();r++) { for (int c=0;c<_input.cols();c++) _output[ind++]=_input(r,c); } } template<class T> Vec< T > Converter::Mat2Vec_rowise(const Mat< T >& _input) { Vec<T> result; Mat2Vec_rowise(_input,result); return result; } template<class T> void Converter::Vec2Mat_rowise(const itpp::Vec<T>& _input, Mat< T >& _output, int _rows, int _cols) { _output.set_size(_rows,_cols); int ind=0; for (int r=0;r<_rows;r++) { for (int c=0;c<_cols;c++) _output(r,c)=_input[ind++]; } } template<class T> Mat<T> Converter::Vec2Mat_rowise(const Vec<T>& _input,int _rows,int _cols) { Mat<T> result; Vec2Mat_rowise(_input,result,_rows,_cols); return result; } template<class T> void Converter::Mat2bvec_rowise(const Mat< T >& _input, bvec& _output, int _symbolbitslen) { _output.set_size(_input.size()*_symbolbitslen); int index=0; for ( int r=0;r<_input.rows();r++ ) { for (int c=0;c<_input.cols();c++) { uint64_t temp=(uint64_t)_input(r,c); for ( int j=0;j< _symbolbitslen;j++ ) { _output[index++]=temp%2; temp>>=1; } } } } template<class T> bvec Converter::Mat2bvec_rowise(const Mat< T >& _input, int _symbolbitslen) { bvec bins; Mat2bvec_rowise(_input,bins,_symbolbitslen); return bins; } template<class T> void Converter::bvec2Mat_rowise(const itpp::bvec& _input, Mat< T >& _output, int _rows, int _cols, int _symbolbitslen) { _output.set_size(_rows,_cols); Assert_Dbg(_input.length()==_symbolbitslen*_rows*_cols,"Converter::bvec2Mat_rowise:length of bits donot match size of matrix!"); int index=_symbolbitslen-1; for ( int r=0;r<_rows;r++ ) { for (int c=0;c<_cols;c++) { uint64_t temp=0; for ( int j=0;j<_symbolbitslen;j++ ) { temp<<=1; temp+= ( int ) _input[index--]; } _output(r,c)=(T)temp; index+=_symbolbitslen*2; } } } template<class T> Mat< T > Converter::bvec2Mat_rowise(const itpp::bvec& _input, int _rows, int _cols, int _symbolbitslen) { Mat<T> temp; bvec2Mat_rowise(_input,temp,_rows,_cols,_symbolbitslen); return temp; } template<class T> Vec< T > Converter::bvec2Vec(const itpp::bvec& _input, int _symbolbitslen) { Vec<T> output; bvec2Vec(_input,output,_symbolbitslen); return output; } template<class T> void Converter::bvec2Vec(const bvec& _input,Vec<T>& _output,int _symbolbitslen) { Assert_Dbg(_input.length()%_symbolbitslen==0,"Converter::bvec2Vec:length of bits is not times of symbol bits len!"); int count= _input.length() / _symbolbitslen ; _output.set_size(count); for ( int i=0;i<count;i++ ) { int index= ( i+1 ) *_symbolbitslen-1; uint64_t temp=0; for ( int j=0;j<_symbolbitslen;j++ ) { temp<<=1; temp+= ( int ) _input[index--]; } _output[i]=(T)temp; } } template<class T> vector< T > Converter::bvec2vector(const itpp::bvec& _input, int _symbolbitslen) { vector<T> output; bvec2vector(_input,output,_symbolbitslen); return output; } template<class T> void Converter::bvec2vector(const bvec& _input,vector<T>& _output,int _symbolbitslen) { Assert_Dbg(_input.length()%_symbolbitslen==0,"Converter::bvec2vector:length of bits is not times of symbol bits len!"); int count= _input.length() / _symbolbitslen ; _output.resize(count); for ( int i=0;i<count;i++ ) { int index= ( i+1 ) *_symbolbitslen-1; uint64_t temp=0; for ( int j=0;j<_symbolbitslen;j++ ) { temp<<=1; temp+= ( int ) _input[index--]; } _output[i]=(T)temp; } } template<class T> bvec Converter::Vec2bvec(const Vec< T >& _input, int _symbolbitslen) { bvec output; Vec2bvec(_input,output,_symbolbitslen); return output; } template<class T> void Converter::Vec2bvec(const Vec<T>& _input,bvec& _output,int _symbolbitslen) { _output.set_size(_input.length()*_symbolbitslen); int index=0; for ( int i=0;i<_input.length();i++ ) { uint64_t temp=(uint64_t)_input[i]; for ( int j=0;j< _symbolbitslen;j++ ) { _output[index++]=temp%2; temp>>=1; } } } //! convert a oct form number to dec value inline int Converter::oct2dec(const int& _oct) { int tmp=_oct; int lvl=1; int decvalue=0; while (tmp!=0) { //decvalue*=8; decvalue+=lvl*(tmp%10); lvl*=8; tmp/=10; } return decvalue; } //! convert a oct form number to dec value inline const ivec& Converter::oct2dec(const ivec& _oct) { static ivec result; result.set_size(_oct.length()); for (int i=0;i<_oct.length();i++) { result[i]=oct2dec(_oct[i]); } return result; } inline void Converter::ulong2bvec(const unsigned long& _input, bvec& _output, int _symbolbitslen) { _output.set_size(_symbolbitslen); unsigned long temp=_input; for ( int j=0;j< _symbolbitslen;j++ ) { _output[j]=temp%2; temp>>=1; } } inline long unsigned int Converter::bvec2ulong(const bvec& _input) { Assert_Dbg(_input.length()<=64,"Converter::bvec2ulong:maximum length of bits could be 64 (exceeded)!"); uint64_t temp=0; for ( int j=_input.length()-1;j>=0;j-- ) { temp<<=1; temp+= ( int ) _input[j]; } return temp; } template<class T1,class T2> void Converter::Vec2Vec(const Vec< T1 >& _input, Vec< T2 >& _output) { _output.set_size(_input.length()); for (int i=0;i<_input.length();i++) _output[i]=T2(_input[i]); } template<class T1,class T2> Vec< T2 > Converter::Vec2Vec(const Vec< T1 >& _input) { Vec< T2 > out; Vec2Vec(_input,out); return out; } template<class T1,class T2> void Converter::Mat2Mat(const Mat< T1 >& _input, Mat< T2 >& _output) { _output.set_size(_input.rows(),_input.cols()); for (int i=0;i<_input.size();i++) _output(i)=T2(_input(i)); } template<class T1,class T2> Mat<T2> Converter::VecVec2Mat(const Vec< Vec<T1> >& _src,bool _1stDimTo1st) { Mat<T2> ret; VecVec2Mat<T1,T2>(_src,ret,_1stDimTo1st); return ret; } template<class T1,class T2> void Converter::VecVec2Mat(const Vec< Vec< T1 > >& _src, Mat< T2 >& _dest, bool _1stDimTo1st) { Assert_Dbg (_src.length()!=0&&_src[0].length()!=0,"Converter::VecVec2Mat:currently donot support null vector!"); if (_1stDimTo1st) { int rows=_src.length(); int cols=_src[0].length(); _dest.set_size(rows,cols); for (int i=0;i<rows;i++) { for (int j=0;j<cols;j++) _dest(i,j)=T2(_src[i][j]); } } else { int rows=_src[0].length(); int cols=_src.length(); _dest.set_size(rows,cols); for (int j=0;j<cols;j++) { for (int i=0;i<rows;i++) _dest(i,j)=T2(_src[j][i]); } } } template<class T> string Converter::To_Str(const T& _para) { return to_str<T>(_para); } template<class T> void Converter::Inverse(Vec< T >& _data, int _period) { if (_period<=0) _period=_data.length(); else Assert_Dbg(_data.length()%_period==0,"Converter::Inverse: input donot contain integer number of perdiods!"); for (int i=0;i<_data.length();i+=_period) { int srcInd=i; int destInd=i+_period-1; while (srcInd<destInd) swap(_data[srcInd++],_data[destInd--]); } } template<class T> void Converter::SybbySyb2BitbyBit(const Vec< T >& _SbS, Vec< T >& _BbB, int _symbolbitslen) { Assert_Dbg(_SbS.length()%_symbolbitslen==0,"Converter::SybbySyb2BitbyBit: input donot contain integer number of symbols!"); int ind=0; _BbB.set_size(_SbS.length()); for (int addr=0;addr<_symbolbitslen;addr++) { for (int i=addr;i<_SbS.length();i+=_symbolbitslen) { _BbB[ind++]=_SbS[i]; } } } template<class T> void Converter::BitbyBit2SybbySyb(const Vec<T>& _BbB,Vec<T>& _SbS,int _symbolbitslen) { Assert_Dbg(_BbB.length()%_symbolbitslen==0,"Converter::BitbyBit2SybbySyb: input donot contain integer number of symbols!"); int ind=0; _SbS.set_size(_BbB.length()); for (int addr=0;addr<_symbolbitslen;addr++) { for (int i=addr;i<_SbS.length();i+=_symbolbitslen) { _SbS[i]=_BbB[ind++]; } } } template<class T> void Converter::Split_nBitPlanes(const Vec<T>& _source,Vec< Vec<T> >& _bitplanes,int _symbolbitslen) { Assert(_source.length()%_symbolbitslen==0,"Converter::Split_nBitPlanes: length of input not valid!"); _bitplanes.set_size(_symbolbitslen); int ind=0; int bitplane_len=_source.length()/_symbolbitslen; for (int ind_msb=0;ind_msb<_symbolbitslen;ind_msb++) { _bitplanes[ind_msb].set_size(bitplane_len); } for (int i=0;i<bitplane_len;i++) { for (int ind_msb=0;ind_msb<_symbolbitslen;ind_msb++) { _bitplanes[ind_msb][i]=_source[ind++]; } } } template<class T> void Converter::Combine_nBitPlanes(const Vec< Vec<T> >& _bitplanes,Vec<T>& _source,int _symbolbitslen) { if (_bitplanes.length()==0) { _source.set_size(0); return; } int bitplane_len=_bitplanes[0].length(); _source.set_size(_symbolbitslen*bitplane_len); int ind=0; for (int i=0;i<bitplane_len;i++) { for (int ind_msb=0;ind_msb<_symbolbitslen;ind_msb++) { _source[ind++]=_bitplanes[ind_msb][i]; } } } #endif
25.052752
132
0.610272
90ff17b116a1506438133b321cfd6062436059e1
2,352
h
C
thread_pool.h
BrandonKi/thread_pool
06454ff1d98cb8cd6e1902e853f53486a1829206
[ "MIT" ]
null
null
null
thread_pool.h
BrandonKi/thread_pool
06454ff1d98cb8cd6e1902e853f53486a1829206
[ "MIT" ]
null
null
null
thread_pool.h
BrandonKi/thread_pool
06454ff1d98cb8cd6e1902e853f53486a1829206
[ "MIT" ]
null
null
null
/** * @file thread_pool.h * @author Brandon Kirincich */ #ifndef THREAD_POOL_H #define THREAD_POOL_H #include <concepts> #include <condition_variable> #include <functional> #include <future> #include <memory> #include <mutex> #include <queue> #include <thread> #include <vector> class ThreadPool { public: ThreadPool(size_t num_threads = std::thread::hardware_concurrency()): pool{}, task_queue{}, queue_mutex{}, manager{}, exit{false} { auto worker = [this] { while (true) { std::function<void(void)> task; { std::unique_lock<std::mutex> lock(this->queue_mutex); this->manager.wait(lock, [this] { return this->exit || !this->task_queue.empty(); }); if (this->exit && this->task_queue.empty()) return; task = std::move(this->task_queue.front()); this->task_queue.pop(); } task(); } }; for (size_t i = 0; i < num_threads; ++i) pool.emplace_back(worker); } ~ThreadPool() { exit = true; manager.notify_all(); for (auto& thread : pool) thread.join(); } template <std::invocable F, typename... Args> void push_work(F&& f, Args&&... args) { { std::unique_lock<std::mutex> lock(queue_mutex); task_queue.push([f]() { f(args...); }); } manager.notify_one(); } template <std::invocable F, typename... Args> [[nodiscard]] auto push_task(F&& f, Args&&... args) -> std::future<std::invoke_result_t<F, Args...>> { using return_type = std::invoke_result_t<F, Args...>; auto task = std::make_shared<std::packaged_task<return_type()>>(std::bind(std::forward<F>(f), std::forward<Args>(args)...)); std::future<return_type> result = task->get_future(); { std::unique_lock<std::mutex> lock(queue_mutex); task_queue.push([task]() { (*task)(); }); } manager.notify_one(); return result; } private: std::vector<std::thread> pool; std::queue<std::function<void(void)>> task_queue; std::mutex queue_mutex; std::condition_variable manager; bool exit; }; #endif // THREAD_POOL_H
28.682927
132
0.545493
ad41ca44cf18bb87de4ead810efcc03d3257311f
367
h
C
examples/demo/OLCategoryHelperDemo/OLMasterViewController.h
payliu/OLCategoryHelper
3576f31b08533bebd03e699fcd0af0ad5524cc39
[ "MIT" ]
null
null
null
examples/demo/OLCategoryHelperDemo/OLMasterViewController.h
payliu/OLCategoryHelper
3576f31b08533bebd03e699fcd0af0ad5524cc39
[ "MIT" ]
null
null
null
examples/demo/OLCategoryHelperDemo/OLMasterViewController.h
payliu/OLCategoryHelper
3576f31b08533bebd03e699fcd0af0ad5524cc39
[ "MIT" ]
null
null
null
// // OLMasterViewController.h // OLCategoryHelperDemo // // Created by Pay Liu on 13/9/5. // Copyright (c) 2013年 Octalord Information Inc. All rights reserved. // #import <UIKit/UIKit.h> @class OLDetailViewController; @interface OLMasterViewController : UITableViewController @property (strong, nonatomic) OLDetailViewController *detailViewController; @end
20.388889
75
0.768392
0971220b37347649bf05e2ca21ce31e96df7d1cf
791
h
C
src/layers/route_layer.h
zozoiiiiii/jenny
21a157e00b2a2ba6a6b1dd7c36768a38a235e897
[ "MIT" ]
null
null
null
src/layers/route_layer.h
zozoiiiiii/jenny
21a157e00b2a2ba6a6b1dd7c36768a38a235e897
[ "MIT" ]
null
null
null
src/layers/route_layer.h
zozoiiiiii/jenny
21a157e00b2a2ba6a6b1dd7c36768a38a235e897
[ "MIT" ]
null
null
null
/************************************************************************/ /* @author: junliang @brief: convolution LayerData @time: 2019/02/22 */ /************************************************************************/ #pragma once #include <string> #include <vector> #include <map> #include "layer.h" #include "network.h" NS_JJ_BEGIN class RouteLayer : public ILayer { public: virtual bool load(const IniParser* pParser, int section, size_params params); virtual void forward_layer_cpu(JJ::network* pNet, float *input, int train); private: LayerData make_route_layer(int batch, int n, std::vector<int> input_layers, std::vector<int> input_sizes); private: std::vector<int> m_input_layers; // route std::vector<int> m_input_sizes; // route }; NS_JJ_END
23.264706
110
0.580278
865a6376cb4eab0e9246a29500b94683aac69f64
466
h
C
Source/OEXHelperUnitCompletionTracker.h
wajeeha-khalid/McKA-iOS
eed58c62352b2c2dde14e13d7d89171862a3f46a
[ "Apache-2.0" ]
1
2017-11-07T18:25:44.000Z
2017-11-07T18:25:44.000Z
Source/OEXHelperUnitCompletionTracker.h
wajeeha-khalid/McKA-iOS
eed58c62352b2c2dde14e13d7d89171862a3f46a
[ "Apache-2.0" ]
null
null
null
Source/OEXHelperUnitCompletionTracker.h
wajeeha-khalid/McKA-iOS
eed58c62352b2c2dde14e13d7d89171862a3f46a
[ "Apache-2.0" ]
null
null
null
// // OEXHelperUnitCompletionTracker.h // edX // // Created by Naveen Katari on 18/02/17. // Copyright © 2017 edX. All rights reserved. // #import <Foundation/Foundation.h> @interface OEXHelperUnitCompletionTracker : NSObject @property (nonatomic, strong, nullable) NSString *unitID; @property (nonatomic, strong, nullable) NSString *courseID; @property (nonatomic, strong, nullable) NSString *chapterID; @property (nonatomic, assign) BOOL isCompleted; @end
24.526316
60
0.753219
af392d9abcbfab698e822302f609c72a1e900bae
2,312
h
C
src-native/BCIDynamic/JClass/JMemStream.h
lta-disco-unimib-it/BCT
1c7fcb52f42bae9f5169c94032ded919cb1c42c4
[ "Apache-2.0" ]
null
null
null
src-native/BCIDynamic/JClass/JMemStream.h
lta-disco-unimib-it/BCT
1c7fcb52f42bae9f5169c94032ded919cb1c42c4
[ "Apache-2.0" ]
null
null
null
src-native/BCIDynamic/JClass/JMemStream.h
lta-disco-unimib-it/BCT
1c7fcb52f42bae9f5169c94032ded919cb1c42c4
[ "Apache-2.0" ]
null
null
null
/********************************************************************** * Copyright (c) 2005, 2006 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * $Id: JMemStream.h,v 1.1.2.1 2006-12-02 12:41:42 pastore Exp $ * * Contributors: * IBM - Initial API and implementation **********************************************************************/ //* //* JMemStream.h //* //============================================================================== // Copyright ..... // //------------------------------------------------------------------------------ // JMemStream.h // // Java Memory Bsed Stream. // Implementation of abstract class CJBaseStream // This implementation uses a preallocated memory buffer for input/output // //============================================================================== #ifndef _JMEMSTREAM_H #define _JMEMSTREAM_H #ifndef _COMMONDEF_H # include "CommonDef.h" #endif #ifndef _JAVADEF_H # include "JavaDef.h" #endif #ifndef _JBASESTREAM_H # include "JBaseStream.h" #endif class _EXT_REF CJMemStream; class _EXT_REF CJMemStreamException; class _EXT_REF CJMemStream : public CJBaseStream { public: CJMemStream(); virtual ~CJMemStream(); virtual long GetPos(); virtual void Read(void* i_pBuffer, long i_Size); virtual void Write(void* i_pData, long i_Size); void Open(void* i_pMem, long i_lSize, bool i_fFreeMem = false); void Close(); bool IsOpen() const; protected: private: bool m_fIsOpen; bool m_fFreeMem; long m_lPos; void* m_pMem; long m_lSize; }; //------------------------------------------------------------------------------ // CJFileStreamException // class _EXT_REF CJMemStreamException { public: typedef enum { X_UNKNOWN, X_NOT_OPENED, X_ALREADY_OPENED, X_OPEN_ERROR, X_DATA_OVERRUN, X_LAST } Reason_t; public: CJMemStreamException(Reason_t i_Reason = X_UNKNOWN) { m_Reason = i_Reason; } unsigned GetReason()const {return m_Reason;} private: Reason_t m_Reason; }; #endif // _JMEMSTREAM_H //==============================================================================
24.083333
80
0.558824
797963ce8551e3bcad1e5d0fc5223696e0974f1c
1,742
h
C
inetsrv/iis/admin/certmap/edwldrul.h
npocmaka/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
17
2020-11-13T13:42:52.000Z
2021-09-16T09:13:13.000Z
inetsrv/iis/admin/certmap/edwldrul.h
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
2
2020-10-19T08:02:06.000Z
2020-10-19T08:23:18.000Z
inetsrv/iis/admin/certmap/edwldrul.h
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
14
2020-11-14T09:43:20.000Z
2021-08-28T08:59:57.000Z
// EdWldRul.h : header file // ///////////////////////////////////////////////////////////////////////////// // CEditWildcardRule dialog class CEditWildcardRule : public CNTBrowsingDialog { // Construction public: CEditWildcardRule(IMSAdminBase* pMB, CWnd* pParent = NULL); // standard constructor virtual void OnOK(); virtual BOOL OnInitDialog(); // the only public member CCertMapRule* m_pRule; // base path to the metabase CString m_szMBPath; // Dialog Data //{{AFX_DATA(CEditWildcardRule) enum { IDD = IDD_WILDCARDS_2 }; CListSelRowCtrl m_clistctrl_list; CButton m_cbutton_edit; CButton m_cbutton_delete; CButton m_cbutton_new; CString m_sz_description; BOOL m_bool_enable; int m_int_MatchAllIssuers; int m_int_DenyAccess; //}}AFX_DATA // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CEditWildcardRule) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: // Generated message map functions //{{AFX_MSG(CEditWildcardRule) afx_msg void OnDblclkList(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnItemchangedList(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnEdit(); afx_msg void OnNew(); afx_msg void OnDelete(); afx_msg void OnSelectIssuer(); //}}AFX_MSG DECLARE_MESSAGE_MAP() // more initialization methods BOOL FInitRulesList(); BOOL FillRulesList(); // editing and updating void EnableDependantButtons(); BOOL EditRule( DWORD iList ); IMSAdminBase* m_pMB; };
25.246377
90
0.634328
05c1a0448ea1a93a98d7cddceaf760da64f4f12a
635
h
C
exp2/2_4/pluginController.h
Zerdd/OS-Coding-EXP
b46d92fa40d9383838443629b05dd80c4f87f5e1
[ "Apache-2.0" ]
null
null
null
exp2/2_4/pluginController.h
Zerdd/OS-Coding-EXP
b46d92fa40d9383838443629b05dd80c4f87f5e1
[ "Apache-2.0" ]
null
null
null
exp2/2_4/pluginController.h
Zerdd/OS-Coding-EXP
b46d92fa40d9383838443629b05dd80c4f87f5e1
[ "Apache-2.0" ]
null
null
null
// @brief 插件控制器,用于访问所有外部插件 #ifndef PLUGINCONTROLLER_H #define PLUGINCONTROLLER_H #include <vector> using namespace std; class IPrintPlugin; class pluginController { private: vector<void *> v_pluginHandle; // 用于存放所有的句柄 vector<IPrintPlugin*> v_plugin; // 用于存放所有的插件 public: pluginController(/* args */); // 构造函数 ~pluginController(); // 虚构函数 bool InitController(void); // 初始化控制器,获取所有的插件句柄及其函数 bool UninitController(void); // 关闭所有动态库 bool ProcessHelp(void); // 执行help() bool ProcessPrint(int Func_ID); // 根据Func_ID执行printSC() }; typedef pluginController pct_t; #endif
19.84375
59
0.685039
e5e8537c36de6eac84669463cc2dd936b876081d
1,159
h
C
admin/cmdline/eventcreate/pch.h
npocmaka/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
17
2020-11-13T13:42:52.000Z
2021-09-16T09:13:13.000Z
admin/cmdline/eventcreate/pch.h
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
2
2020-10-19T08:02:06.000Z
2020-10-19T08:23:18.000Z
admin/cmdline/eventcreate/pch.h
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
14
2020-11-14T09:43:20.000Z
2021-08-28T08:59:57.000Z
// ********************************************************************************* // // Copyright (c) Microsoft Corporation. All rights reserved. // // Module Name: // // pch.h // // Abstract: // // pre-compiled header declaration // files that has to be pre-compiled into .pch file // // Author: // // Sunil G.V.N. Murali (murali.sunil@wipro.com) 24-Sep-2000 // // Revision History: // // Sunil G.V.N. Murali (murali.sunil@wipro.com) 24-Sep-2000 : Created It. // // ********************************************************************************* #ifndef __PCH_H #define __PCH_H #define CMDLINE_VERSION 200 #ifdef __cplusplus extern "C" { #endif #pragma once // include header file only once // // public Windows header files // #include <windows.h> #include "winerror.h" // // public C header files // #include <stdio.h> #include <stdlib.h> #include <string.h> #include <tchar.h> #include <wchar.h> #include <crtdbg.h> // // private Common header files // #include "cmdline.h" #include "cmdlineres.h" #ifdef __cplusplus } #endif #endif // __PCH_H
19
85
0.522865
c3ebdc056c467e94e59220093f92dc2cc6cf8471
1,281
h
C
ptShared/ptInclude/ptbuild.h
bbelson2/k64f_coro
a280252a53aca2c8f6a35008b17b2653b4dc71dd
[ "MIT" ]
11
2020-08-09T16:20:55.000Z
2021-05-05T15:10:25.000Z
ptShared/ptInclude/ptbuild.h
bbelson2/coro-mc-wwl-code
3112bb72f59f2374fba3b39a79a120866f32c0da
[ "MIT" ]
null
null
null
ptShared/ptInclude/ptbuild.h
bbelson2/coro-mc-wwl-code
3112bb72f59f2374fba3b39a79a120866f32c0da
[ "MIT" ]
null
null
null
/* * ptbuild.h * * Created on: 1 Apr 2019 * Author: Bruce Belson * * This file is subject to the terms and conditions defined in * file 'LICENSE.txt', which is part of this source code package. * */ #ifndef SOURCES_PTINCLUDE_PTBUILD_H_ #define SOURCES_PTINCLUDE_PTBUILD_H_ #if defined(PTBUILD_EXTERNAL_TIMER) #define PRINT_NUMBER(x) #define PRINT_STRING(x) #define PTBUILD_EXTERNAL_TIMER_DESCRIPTION "ExtTimer=true" #else #define INCLUDE_TERM #define PRINT_NUMBER(x) print_number(x) #define PRINT_STRING(x) print_string(x) #define PTBUILD_EXTERNAL_TIMER_DESCRIPTION "ExtTimer=false" #endif #if defined(PTBUILD_NO_SCHEDULER) #define PTBUILD_NO_SCHEDULER_DESCRIPTION "NoScheduler=true" #else #define PTBUILD_NO_SCHEDULER_DESCRIPTION "NoScheduler=false" #endif #if defined(PTBUILD_MINIMAL) #define PTBUILD_MINIMAL_DESCRIPTION "Minimal=true" #ifdef INCLUDE_IDLE_TASK #undef INCLUDE_IDLE_TASK #endif #define INCLUDE_TEST_TASK #else #define PTBUILD_MINIMAL_DESCRIPTION "Minimal=false" #ifdef INCLUDE_TEST_TASK #undef INCLUDE_TEST_TASK #endif #define INCLUDE_IDLE_TASK #endif #define PTBUILD_DESCRIPTION PTBUILD_EXTERNAL_TIMER_DESCRIPTION " " PTBUILD_NO_SCHEDULER_DESCRIPTION " " PTBUILD_MINIMAL_DESCRIPTION #endif /* SOURCES_PTINCLUDE_PTBUILD_H_ */
20.333333
131
0.807182
c3588b5ca18ae7b4bd4b3e3002f6bbd6ec1c0afc
460
c
C
latex/src/av8/z6.c
kikojumkd/SP
217cf66bdce28342b211198bac28d4571311265c
[ "MIT" ]
2
2019-05-23T20:41:05.000Z
2019-05-24T13:51:28.000Z
latex/src/av8/z6.c
kikojumkd/SP
217cf66bdce28342b211198bac28d4571311265c
[ "MIT" ]
null
null
null
latex/src/av8/z6.c
kikojumkd/SP
217cf66bdce28342b211198bac28d4571311265c
[ "MIT" ]
null
null
null
#include <stdio.h> #define MAX 100 int nzd(int m, int n) { if (!n) return m; return nzd(n, m % n); } int main() { int i, n, a[MAX]; printf("Vnesi ja goleminata na nizata:"); scanf("%d", &n); printf("Vnesi gi elementite na nizata: \n"); for (i = 0; i < n; i++) scanf("%d", &a[i]); int NZD = nzd(a[0], a[1]); for (i = 2; i < n; i++) NZD = nzd(NZD, a[i]); printf("NZD na elementite na ovaa niza e %d", NZD); return 0; }
19.166667
53
0.517391
bf4883168e7392efc49e81eb3a78a9c59e16d53e
3,545
c
C
src/sp1.c
batousik/2002wBeforeLast
d319e2788fbf7ce95d0d426d075bd6f2af4153f0
[ "MIT" ]
null
null
null
src/sp1.c
batousik/2002wBeforeLast
d319e2788fbf7ce95d0d426d075bd6f2af4153f0
[ "MIT" ]
null
null
null
src/sp1.c
batousik/2002wBeforeLast
d319e2788fbf7ce95d0d426d075bd6f2af4153f0
[ "MIT" ]
null
null
null
#include "sp1.h" int main(int argc, char *argv[]) { char *phrase = malloc(1024 * sizeof(char)); memset(phrase, '\0', 1024); for (int i = 1; i < argc; ++i) { strcat(phrase, argv[i]); strcat(phrase, " "); } return do_filtering(190, phrase); } int do_filtering(int repeat_times, char *whisper){ pid_t pid; int my_pid; int parent_pid = getpid(); int whisper_pipe[2]; /* Create the pipe. */ if (pipe (whisper_pipe)) { fprintf (stderr, "Pipe failed.\n"); return EXIT_FAILURE; } /* Create the child process. */ pid = fork (); if (pid == (pid_t) 0) { // Child my_pid = getpid(); printf("New process %i, parent %i\n", my_pid, parent_pid); // close unused write end close (whisper_pipe[1]); // read from pipe char* recieved_whisper = get_next_line(whisper_pipe[0]); printf("pid:%i received string[%s]\n", my_pid, recieved_whisper); // close read end close(whisper_pipe[0]); if (repeat_times > 0){ return do_filtering(--repeat_times, recieved_whisper); } return EXIT_SUCCESS; } else if (pid > (pid_t) 0) { // Parent int *a, *b; a = malloc(sizeof(int)); b = malloc(sizeof(int)); // alter whisper swap_chars_in_string(a, b, whisper); printf("pid:%i Swapped indeces %i, %i\n", parent_pid, *a, *b); free(a); free(b); // close unused read end close (whisper_pipe[0]); // pipe a whisper write_line_to_pipe(whisper_pipe[1], whisper); // close write end close(whisper_pipe[1]); // wait for child wait(NULL); return EXIT_SUCCESS; } else { /* The fork failed. */ fprintf (stderr, "Fork failed.\n"); return EXIT_FAILURE; } } /* Read and return text from pipe. */ char*get_next_line(int file) { char *whisper = malloc(0); char *buffer; size_t len; FILE *stream; int c; stream = fdopen (file, "r"); for (int j = 0; (c = fgetc (stream)) != EOF; ++j) { // allocate space for current string + char buffer = malloc((j+2) * sizeof(char)); // set all chars to \0 memset(buffer, '\0', (j+2) * sizeof(char)); // copy existing whisper to a buffer memcpy(buffer, whisper, j * sizeof(char)); // add new read character to the end len = strlen(buffer); buffer[len] = c; // reset whisper to the buffer free(whisper); whisper = malloc((j+2) * sizeof(char)); memcpy(whisper, buffer, (j+2) * sizeof(char)); // free buffer free(buffer); } fclose (stream); return whisper; } /* Write whisper to the pipe. */ void write_line_to_pipe(int file, char *whisper) { FILE *stream; stream = fdopen (file, "w"); // printf("Got a whisper to write to pipe: %s\n", whisper); fprintf (stream, "%s", whisper); fclose (stream); } void swap_chars_in_string(int *a, int *b, char *string){ // printf("swapping: %i\n", strlen(string)); // initialise random generator with seed derived from current time srand(getpid()); // get random indeces *a = rand() % strlen(string); *b = rand() % strlen(string); // makesure a and b are not the same index while(*a == *b) *b = rand() % strlen(string); // swap indeces char temp = string[*a]; string[*a] = string[*b]; string[*b] = temp; }
29.057377
73
0.553173
4405a416ff44010db8723ca115f9de06c81650de
5,495
c
C
platforms/unix/vm/dlfcn-dyld.c
bavison/opensmalltalk-vm
d494240736f7c0309e3e819784feb1d53ed0985a
[ "MIT" ]
445
2016-06-30T08:19:11.000Z
2022-03-28T06:09:49.000Z
platforms/unix/vm/dlfcn-dyld.c
bavison/opensmalltalk-vm
d494240736f7c0309e3e819784feb1d53ed0985a
[ "MIT" ]
439
2016-06-29T20:14:36.000Z
2022-03-17T19:59:58.000Z
platforms/unix/vm/dlfcn-dyld.c
bavison/opensmalltalk-vm
d494240736f7c0309e3e819784feb1d53ed0985a
[ "MIT" ]
137
2016-07-02T17:32:07.000Z
2022-03-20T11:17:25.000Z
/* dlfcn-dyld.c -- provides dlopen() and friends as wrappers around Mach dyld * * Author: Ian.Piumarta@INRIA.Fr * * Copyright (C) 1996-2006 by Ian Piumarta and other authors/contributors * listed elsewhere in this file. * All rights reserved. * * This file is part of Unix Squeak. * * 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 <stdio.h> #include <stdarg.h> #include <mach-o/dyld.h> #define RTLD_NOW 0 #define RTLD_GLOBAL 0 #define DL_APP_CONTEXT ((void *)-1) static char dlErrorString[256]; static int dlErrorSet= 0; static void dlSetError(const char *fmt, ...) { va_list ap; va_start(ap, fmt); vsnprintf(dlErrorString, sizeof(dlErrorString), fmt, ap); va_end(ap); dlErrorSet= 1; } static const char *dlerror(void) { if (dlErrorSet) { dlErrorSet= 0; return (const char *)dlErrorString; } return 0; } static void dlUndefined(const char *symbol) { fprintf(stderr, "dyld: undefined symbol: %s\n", symbol); } static NSModule dlMultiple(NSSymbol s, NSModule oldModule, NSModule newModule) { DPRINTF((stderr, "dyld: %s: %s previously defined in %s, new definition in %s\n", NSNameOfSymbol(s), NSNameOfModule(oldModule), NSNameOfModule(newModule))); return newModule; } static void dlLinkEdit(NSLinkEditErrors errorClass, int errorNumber, const char *fileName, const char *errorString) { fprintf(stderr, "dyld: %s: %s\n", fileName, errorString); } static NSLinkEditErrorHandlers errorHandlers= { dlUndefined, dlMultiple, dlLinkEdit }; static void dlinit(void) { NSInstallLinkEditErrorHandlers(&errorHandlers); } static int dlInitialised= 0; static void *dlopen(const char *path, int mode) { void *handle= 0; NSObjectFileImage ofi= 0; if (!dlInitialised) { dlinit(); dlInitialised= 1; } if (!path) return DL_APP_CONTEXT; switch (NSCreateObjectFileImageFromFile(path, &ofi)) { case NSObjectFileImageSuccess: handle= NSLinkModule(ofi, path, NSLINKMODULE_OPTION_RETURN_ON_ERROR); NSDestroyObjectFileImage(ofi); break; case NSObjectFileImageInappropriateFile: handle= (void *)NSAddImage(path, NSADDIMAGE_OPTION_RETURN_ON_ERROR); break; default: handle= 0; break; } if (!handle) dlSetError("could not load shared object: %s", path); DPRINTF((stderr, "dlopen: %s => %d\n", path, (int)handle)); return handle; } static void *dlsym(void *handle, const char *symbol) { char _symbol[256]; NSSymbol *nsSymbol= 0; snprintf(_symbol, sizeof(_symbol), "_%s", symbol); DPRINTF((stderr, "dlsym: looking for %s (%s) in %d\n", symbol, _symbol, (int)handle)); if (!handle) { DPRINTF((stderr, "dlsym: setting app context for this handle\n")); handle= DL_APP_CONTEXT; } if (DL_APP_CONTEXT == handle) { DPRINTF((stderr, "dlsym: looking in app context\n")); if (NSIsSymbolNameDefined(_symbol)) nsSymbol= NSLookupAndBindSymbol(_symbol); } else { if (( (MH_MAGIC == ((struct mach_header *)handle)->magic)) /* ppc */ || (MH_CIGAM == ((struct mach_header *)handle)->magic)) /* 386 */ { if (NSIsSymbolNameDefinedInImage((struct mach_header *)handle, _symbol)) { nsSymbol= NSLookupSymbolInImage ((struct mach_header *)handle, _symbol, NSLOOKUPSYMBOLINIMAGE_OPTION_BIND /*| NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR*/); DPRINTF((stderr, "dlsym: bundle (image) lookup returned %p\n", nsSymbol)); } else DPRINTF((stderr, "dlsym: bundle (image) symbol not defined\n")); } else { nsSymbol= NSLookupSymbolInModule(handle, _symbol); DPRINTF((stderr, "dlsym: dylib (module) lookup returned %p\n", nsSymbol)); } } if (!nsSymbol) { dlSetError("symbol not found: %s", _symbol); return 0; } return NSAddressOfSymbol(nsSymbol); } static int dlclose(void *handle) { if (( (MH_MAGIC == ((struct mach_header *)handle)->magic)) /* ppc */ || (MH_CIGAM == ((struct mach_header *)handle)->magic)) /* 386 */ return 0; /* can't unlink, but pretend we did */ if (!NSUnLinkModule(handle, 0)) { dlSetError("could not unlink shared object: %s", NSNameOfModule(handle)); return -1; } return 0; } /* autoconf has bugs */ #ifdef HAVE_DLFCN_H # undef HAVE_DLFCN_H #endif #ifndef HAVE_LIBDL # define HAVE_LIBDL #endif
25.55814
88
0.675705
68b23f038e003ce8b8ef221bc2bfd2bf0cfd8f4e
1,182
h
C
Amber/src/Amber/Core/Assert.h
muthubro/Amber
076db07de87d9231c59416114ac40ab9712aa697
[ "Apache-2.0" ]
null
null
null
Amber/src/Amber/Core/Assert.h
muthubro/Amber
076db07de87d9231c59416114ac40ab9712aa697
[ "Apache-2.0" ]
null
null
null
Amber/src/Amber/Core/Assert.h
muthubro/Amber
076db07de87d9231c59416114ac40ab9712aa697
[ "Apache-2.0" ]
null
null
null
#pragma once #ifdef AB_ENABLE_ASSERTS #define AB_ASSERT_NO_MESSAGE(condition) { if(!(condition)) { AB_ERROR("Assertion Failed"); AB_DEBUGBREAK(); } } #define AB_ASSERT_MESSAGE(condition, ...) { if(!(condition)) { AB_ERROR("Assertion Failed: {0}", __VA_ARGS__); AB_DEBUGBREAK(); } } #define AB_CORE_ASSERT_NO_MESSAGE(condition) { if(!(condition)) { AB_CORE_ERROR("Assertion Failed"); AB_DEBUGBREAK(); } } #define AB_CORE_ASSERT_MESSAGE(condition, ...) { if(!(condition)) { AB_CORE_ERROR("Assertion Failed: {0}", __VA_ARGS__); AB_DEBUGBREAK(); } } #define AB_ASSERT_RESOLVE(arg1, arg2, macro, ...) macro #define AB_GET_ASSERT_MACRO(...) AB_EXPAND_VARGS(AB_ASSERT_RESOLVE(__VA_ARGS__, AB_ASSERT_MESSAGE, AB_ASSERT_NO_MESSAGE)) #define AB_GET_CORE_ASSERT_MACRO(...) AB_EXPAND_VARGS(AB_ASSERT_RESOLVE(__VA_ARGS__, AB_CORE_ASSERT_MESSAGE, AB_CORE_ASSERT_NO_MESSAGE)) #define AB_ASSERT(...) AB_EXPAND_VARGS(AB_GET_ASSERT_MACRO(__VA_ARGS__)(__VA_ARGS__)) #define AB_CORE_ASSERT(...) AB_EXPAND_VARGS(AB_GET_CORE_ASSERT_MACRO(__VA_ARGS__)(__VA_ARGS__)) #else #define AB_ASSERT(x, ...) #define AB_CORE_ASSERT(x, ...) #endif
56.285714
146
0.729272
db3277202f4852e460899eba20d66cc3a92374f6
1,071
h
C
base/sdk/interfaces/iglobalvarsbase.h
ChoZenTime/qo0-base
be524136a6fc20daf71553a6ca7dc833358b4e40
[ "MIT" ]
1
2020-05-25T09:04:36.000Z
2020-05-25T09:04:36.000Z
base/sdk/interfaces/iglobalvarsbase.h
ChoZenTime/qo0-base
be524136a6fc20daf71553a6ca7dc833358b4e40
[ "MIT" ]
null
null
null
base/sdk/interfaces/iglobalvarsbase.h
ChoZenTime/qo0-base
be524136a6fc20daf71553a6ca7dc833358b4e40
[ "MIT" ]
1
2020-06-26T18:32:51.000Z
2020-06-26T18:32:51.000Z
#pragma once class IGlobalVarsBase { public: float flRealTime; //0x0000 std::uint32_t iFrameCount; //0x0004 float flAbsoluteFrameTime; //0x0008 float flFrameStartTime; //0x000C float flCurrentTime; //0x0010 float flFrameTime; //0x0014 std::uint32_t nMaxClients; //0x0018 std::uint32_t iTickCount; //0x001C float flIntervalPerTick; //0x0020 float flInterpolationAmount; //0x0024 std::uint32_t nSimTicksThisFrame; //0x0028 std::uint32_t iNetworkProtocol; //0x002C void* pSaveData; //0x0030 std::byte pad0[0x4]; //0x0034 std::uint32_t iTimestampNetworkingBase; //0x0038 std::uint32_t iTimestampRandomizeWindow; //0x003C char* szMapName; //0x0040 std::uint32_t iMapVersion; //0x0044 char* szStartSpot; //0x0048 std::uint32_t uLoadType; //0x004C bool bMapLoadFailed; //0x0050 bool bDeathmatch; //0x0051 bool bCooperative; //0x0052 bool bTeamplay; //0x0053 std::uint32_t nMaxEntities; //0x0054 std::uint32_t iServerCount; //0x0058 }; //Size: 0x005C
32.454545
50
0.691877
c52dbc04036546873d104b8de7de6c19ebf8bed4
3,191
h
C
blades/xbmc/xbmc/input/touch/generic/IGenericTouchGestureDetector.h
krattai/AEBL
a7b12c97479e1236d5370166b15ca9f29d7d4265
[ "BSD-2-Clause" ]
4
2016-04-26T03:43:54.000Z
2016-11-17T08:09:04.000Z
blades/xbmc/xbmc/input/touch/generic/IGenericTouchGestureDetector.h
krattai/AEBL
a7b12c97479e1236d5370166b15ca9f29d7d4265
[ "BSD-2-Clause" ]
17
2015-01-05T21:06:22.000Z
2015-12-07T20:45:44.000Z
blades/xbmc/xbmc/input/touch/generic/IGenericTouchGestureDetector.h
krattai/AEBL
a7b12c97479e1236d5370166b15ca9f29d7d4265
[ "BSD-2-Clause" ]
3
2016-04-26T03:43:55.000Z
2020-11-06T11:02:08.000Z
#pragma once /* * Copyright (C) 2013 Team XBMC * http://xbmc.org * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, 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 XBMC; see the file COPYING. If not, see * <http://www.gnu.org/licenses/>. * */ #include "input/touch/ITouchInputHandling.h" #include "input/touch/TouchTypes.h" #define TOUCH_MAX_POINTERS 2 /*! * \ingroup touch_generic * \brief Interface defining methods to perform gesture recognition */ class IGenericTouchGestureDetector : public ITouchInputHandling { public: IGenericTouchGestureDetector(ITouchActionHandler *handler, float dpi) : m_done(false), m_dpi(dpi) { RegisterHandler(handler); } virtual ~IGenericTouchGestureDetector() { } /*! * \brief Check whether the gesture recognition is finished or not * * \return True if the gesture recognition is finished otherwise false */ bool IsDone() { return m_done; } /*! * \brief A new touch pointer has been recognised. * * \param index Index of the given touch pointer * \param pointer Touch pointer that has changed * * \return True if the event was handled otherwise false */ virtual bool OnTouchDown(unsigned int index, const Pointer &pointer) = 0; /*! * \brief An active touch pointer has vanished. * * If the first touch pointer is lifted and there are more active touch * pointers, the remaining pointers change their index. * * \param index Index of the given touch pointer * \param pointer Touch pointer that has changed * * \return True if the event was handled otherwise false */ virtual bool OnTouchUp(unsigned int index, const Pointer &pointer) { return false; } /*! * \brief An active touch pointer has moved. * * \param index Index of the given touch pointer * \param pointer Touch pointer that has changed * * \return True if the event was handled otherwise false */ virtual bool OnTouchMove(unsigned int index, const Pointer &pointer) { return false; } /*! * \brief An active touch pointer's values have been updated but no event has * occured. * * \param index Index of the given touch pointer * \param pointer Touch pointer that has changed * * \return True if the event was handled otherwise false */ virtual bool OnTouchUpdate(unsigned int index, const Pointer &pointer) { return false; } protected: /*! * \brief Whether the gesture recognition is finished or not */ bool m_done; /*! * \brief DPI value of the touch screen */ float m_dpi; /*! * \brief Local list of all known touch pointers */ Pointer m_pointers[TOUCH_MAX_POINTERS]; };
30.682692
90
0.694767
cb1a318dadde2a502b2ad1e826d5aa2efdd5770c
4,862
c
C
Etape 5/Etape5/section.c
PsykoPatato/Projet-PROG5-2018-2019
c46f24460eb052d71ee7bd64b0ea56aa150d14b2
[ "Apache-2.0" ]
null
null
null
Etape 5/Etape5/section.c
PsykoPatato/Projet-PROG5-2018-2019
c46f24460eb052d71ee7bd64b0ea56aa150d14b2
[ "Apache-2.0" ]
null
null
null
Etape 5/Etape5/section.c
PsykoPatato/Projet-PROG5-2018-2019
c46f24460eb052d71ee7bd64b0ea56aa150d14b2
[ "Apache-2.0" ]
2
2018-12-20T13:56:20.000Z
2018-12-20T14:00:39.000Z
#include <stdlib.h> #include <stdio.h> #include <assert.h> #include <string.h> #include <unistd.h> #include <fcntl.h> #include <elf.h> #include "section.h" char *type(int val){ switch(val){ case 1: return "PROGBITS"; case 2: return "SYMTAB "; case 3: return "STRTAB "; case 4: return "RELA "; case 5: return "HASH "; case 6: return "DYNAMIC"; case 7: return "NOTE "; case 8: return "NOBITS"; case 9: return "REL "; case 10: return "SHLIB"; case 11: return "DYNSYM"; case 0x70000000: return "LOPROC"; case 0x7fffffff: return "HIPROC"; case 0x80000000: return "LOUSER"; case 0xffffffff: return "HIUSER"; case 0x70000003: return "ARM_ATTRIBUTES"; default: return "NULL "; } } void inverse(FILE *f, void *t, int k){ int i, c; char s[k]; for(i=0; i<k; i++){ c = fgetc(f); s[i] = c; } for(i=k-1; i>=0; i--){ *((char *)t++) = s[i]; } } void readSection(FILE *f, Elf32_Ehdr *ehdr, Elf32_Shdr *shdr){ int i; fseek(f, ehdr->e_shoff, SEEK_SET); //On se place au début de section header table for(i=0; i<ehdr->e_shnum; i++){ inverse(f, &shdr[i].sh_name, sizeof(shdr[i].sh_name)); inverse(f, &shdr[i].sh_type, sizeof(shdr[i].sh_type)); inverse(f, &shdr[i].sh_flags, sizeof(shdr[i].sh_flags)); inverse(f, &shdr[i].sh_addr, sizeof(shdr[i].sh_addr)); inverse(f, &shdr[i].sh_offset, sizeof(shdr[i].sh_offset)); inverse(f, &shdr[i].sh_size, sizeof(shdr[i].sh_size)); inverse(f, &shdr[i].sh_link, sizeof(shdr[i].sh_link)); inverse(f, &shdr[i].sh_info, sizeof(shdr[i].sh_info)); inverse(f, &shdr[i].sh_addralign, sizeof(shdr[i].sh_addralign)); inverse(f, &shdr[i].sh_entsize, sizeof(shdr[i].sh_entsize)); } } void printSection(FILE *f, Elf32_Ehdr *ehdr, Elf32_Shdr *shdr, char *nom ){ printf("Il y'a %u en-tetes de section debutant a l'adresse de decalage 0x%x:\n", (unsigned)ehdr->e_shnum, ehdr->e_shoff); printf("en-tetes de section:\n"); printf(" %4.4s " ,"[Nr]"); printf("%20.20s \t ","Nom "); printf("%15.15s \t "," Type"); printf("%8.8s \t", "Adr "); printf("%6.6s \t","Decala."); printf("%6.6s \t","Taille"); printf("%2.2s \t","ES"); printf("%3.3s \t","Fan"); printf("%2.2s \t","LN"); printf("%3.3s \t","Inf"); printf("%2.2s \n","Al"); for(int i = 0 ; i < ehdr->e_shnum; i++){ char flags[4] = ""; // On récupères les flags (se fait bit à bit et non pour le mot entier) strcpy(flags, ""); if(shdr[i].sh_flags & SHF_WRITE) strcat(flags, "W"); if(shdr[i].sh_flags & SHF_ALLOC) strcat(flags, "A"); if(shdr[i].sh_flags & SHF_EXECINSTR) strcat(flags, "X"); if(shdr[i].sh_flags & SHF_MERGE) strcat(flags, "M"); if(shdr[i].sh_flags & SHF_STRINGS) strcat(flags, "S"); if(shdr[i].sh_flags & SHF_INFO_LINK) strcat(flags, "I"); if(shdr[i].sh_flags & SHF_LINK_ORDER) strcat(flags, "L"); if(shdr[i].sh_flags & SHF_OS_NONCONFORMING) strcat(flags, "O"); if(shdr[i].sh_flags & SHF_GROUP) strcat(flags, "G"); if(shdr[i].sh_flags & SHF_TLS) strcat(flags, "T"); if(shdr[i].sh_flags & SHF_MASKOS) strcat(flags, "o"); if(shdr[i].sh_flags & SHF_ORDERED) strcat(flags, "x"); if(shdr[i].sh_flags & SHF_EXCLUDE) strcat(flags, "E"); if(shdr[i].sh_flags & SHF_MASKPROC) strcat(flags, "p"); //On affiche les valeurs demandées printf(" [%2.2d] ", i); printf("%20.20s\t ",(char *)nom+shdr[i].sh_name ); printf("%15.15s \t", type((int)shdr[i].sh_type)); printf("%8.8x \t", shdr[i].sh_addr); printf("%6.6x \t", shdr[i].sh_offset); printf("%6.6x \t", shdr[i].sh_size); printf("%2.2x \t", shdr[i].sh_entsize); printf("%2.2s \t ", flags); printf("%2.2d \t ", shdr[i].sh_link); printf("%2.2d \t", shdr[i].sh_info); printf("%2.2d \n", shdr[i].sh_addralign); } printf("Clé des fanions :\n W (écriture), A (allocation), X (exécution), M (fusion), S (chaînes)\n I (info), L (ordre des liens), G (groupe), T (TLS), E (exclu), x (inconnu)\n O (traitement additionnel requis pour l'OS) o (spécifique à l'OS), p (spécifique au processeur)"); }
31.166667
279
0.510078
3b51b72b556bda5e02a22a0dccae4b2507198b78
13,109
h
C
qqtw/qqheaders7.2/QSContactsEngine.h
onezens/QQTweak
04b9efd1d93eba8ef8fec5cf9a20276637765777
[ "MIT" ]
5
2018-02-20T14:24:17.000Z
2020-08-06T09:31:21.000Z
qqtw/qqheaders7.2/QSContactsEngine.h
onezens/QQTweak
04b9efd1d93eba8ef8fec5cf9a20276637765777
[ "MIT" ]
1
2020-06-10T07:49:16.000Z
2020-06-12T02:08:35.000Z
qqtw/qqheaders7.2/QSContactsEngine.h
onezens/SmartQQ
04b9efd1d93eba8ef8fec5cf9a20276637765777
[ "MIT" ]
null
null
null
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "QSContactsEngineBase.h" #import "IEngineDispatchDelegate.h" #import "IQSContactsEngine.h" @class NSData, NSMutableArray, NSMutableDictionary, NSMutableSet, NSString; @interface QSContactsEngine : QSContactsEngineBase <IQSContactsEngine, IEngineDispatchDelegate> { void *_addressBook; NSMutableArray *_serverContacts; NSMutableDictionary *_lastLoginContacts; _Bool _bNeedSyncContacts; _Bool _bIsAnsyFetchingForUploadContacts; _Bool _bIsAnsyFetchingForSyncContacts; _Bool _isNeedUpdateBindingInfo; _Bool _isUploadingAndUpdating; unsigned int _syncContactsLoadFailCount; int _lastUsedFlag; NSMutableSet *_checkUpdateObservers; _Bool _bUploadContactResult; NSData *_uploadContactSessionSid; NSMutableDictionary *_serverContactsDic; NSMutableArray *_newAllContactsArray; NSMutableArray *_newMatchContactsArray; int _numberOfDuplicate; _Bool _needSyncOnLoginSuccess; NSMutableArray *_sortedContacts; _Bool _shouldUpdateCursor; int _tempShowedCursor; struct _opaque_pthread_rwlock_t _lock_server_contacts; struct _opaque_pthread_rwlock_t _lock_binding_info_lock; _Bool _isRequestingBindingInfo; _Bool _isInBindingAndQueryProcess; _Bool _shouldSaveQQContactsWhenUpload; int _lastProgress; NSMutableDictionary *_bindingInfo; struct dispatch_queue_s *_concurrentQueue; } - (void)LogoutNotification; - (void)QsortContactOnSameFriend:(id)arg1 low:(int)arg2 high:(int)arg3; - (void)addMobilePhoneToBlackList:(id)arg1; - (void)addNewMatchContacts:(id)arg1; - (_Bool)bindPhoneCode:(id)arg1 countryCode:(id)arg2 bindType:(int)arg3 uniFlag:(_Bool)arg4 changeFlag:(_Bool)arg5; - (_Bool)bindWithPhone:(id)arg1 countryCode:(id)arg2 rebind:(_Bool)arg3 bindType:(int)arg4 uniFlag:(_Bool)arg5 changeFlag:(_Bool)arg6; - (id)bindedContacts; - (_Bool)cancelBindingWithUniFlag:(_Bool)arg1 andChangeFlag:(_Bool)arg2; - (void)checkAndUpdateRemarkSetting; - (_Bool)checkQQContactsStatAndUpdate; - (_Bool)checkQQContactsStatAndUpdate:(_Bool)arg1; - (_Bool)checkSafeBindingObjectExistForKey:(id)arg1; - (void)clearBindingInfo; - (void)clearNewAllContacts; - (void)clearNewAllContactsUnread:(id)arg1; - (void)clearNewMatchContacts; - (void)clearNewMatchContactsUnread:(id)arg1; - (void)clearQQContacts; - (void)commitUpdateShowedCursor; @property(nonatomic) struct dispatch_queue_s *concurrentQueue; // @synthesize concurrentQueue=_concurrentQueue; - (void)configPimEngine; - (void)contactsEngineOnLoginSuccess; - (void)dealloc; - (void)deleteOneNewAllContacts:(id)arg1; - (void)deleteOneNewMatchContacts:(id)arg1; - (void)didAddressBookChanged; - (void)didAddressBookChangedDelay; - (void)didReceivedAddFriendResponse:(id)arg1; - (void)didRecievedMsg:(CDStruct_7895f40e)arg1; - (void)didRespBindMobile:(struct ResponeBindMobileV2 *)arg1 result:(int)arg2; - (void)didRespCancelBindMobileWithResult:(int)arg1; - (void)didRespDisableMobileBindWithResult:(int)arg1; - (void)didRespHideContactsWithResult:(int)arg1; - (void)didRespNotifyFroRecommendUpdateWithResult:(int)arg1; - (void)didRespQueryLastLoginState:(struct ResponeQueryLastLoginState *)arg1 result:(int)arg2; - (void)didRespQueryQQMobileContacts:(struct ResponeQueryQQMobileContactsV3 *)arg1 result:(int)arg2; - (void)didRespQueryQQMobileContactsNotBind:(struct ResponeQueryQQMobileContactsNotBind *)arg1 result:(int)arg2; - (void)didRespRebindMobile:(struct ResponeReBindMobile *)arg1 result:(int)arg2; - (void)didRespResendSmscode:(struct ResponeResendSmscode *)arg1 result:(int)arg2; - (void)didRespUpdateAddressBook:(struct ResponeUpdateAddressBook *)arg1 result:(int)arg2; - (void)didRespUpdateAddressBookNotBind:(struct ResponeUpdateAddressBookNotBind *)arg1 result:(int)arg2; - (void)didRespUploadAddressBookNotBind:(struct ResponeUploadAddressBookNotBind *)arg1 result:(int)arg2; - (void)didRespUploadAddressBookV2:(struct ResponeUploadAddressBookV2 *)arg1 result:(int)arg2 requestItem:(id)arg3; - (void)didRespVerifySmscode:(struct ResponeVerifySmscode *)arg1 result:(int)arg2; - (_Bool)disableContactsFeature; - (void)doPimEngineLogin; - (void)doPimEngineWeakLogin:(id)arg1; - (void)doSaveQQContacts; - (_Bool)doUpdateContactsOfflineStat; - (_Bool)doUpdateContactsStat; - (id)getAllQQContacts; - (id)getAllQQContactsIncludingNotMatch; - (id)getAllQQContactsWithoutMerge; - (id)getBindingCountryCode; @property(retain, nonatomic, getter=getBindingInfo) NSMutableDictionary *bindingInfo; // @synthesize bindingInfo=_bindingInfo; - (id)getBindingPhoneCode; - (id)getBindingQQContacts; - (id)getBindingQQContacts:(_Bool)arg1; - (id)getBindingQQContacts:(id)arg1 isFriend:(_Bool)arg2; - (id)getBindingQQContacts:(id)arg1 isFriend:(_Bool)arg2 isHide:(_Bool)arg3; - (long long)getChatUINWithMobilePhoneStr:(id)arg1; - (int)getContactBinderFromWithMobilePhoneStr:(id)arg1; - (id)getContactErrorCodeTips:(int)arg1; - (id)getContactLocalPhoneCodesWithPhoneCodes:(id)arg1; - (id)getContactMobilePhoneWithUIN:(long long)arg1; - (id)getContactModelWithMd5:(id)arg1; - (id)getContactModelWithMobilePhoneStr:(id)arg1; - (id)getContactNameWithMobilePhoneStr:(id)arg1; - (id)getContactNameWithUIN:(long long)arg1; - (id)getContactNickNameWithMobilePhoneStr:(id)arg1; - (id)getContactPhoneLabelsWithPhoneCodes:(id)arg1; - (long long)getContactUINWithMobilePhoneStr:(id)arg1; - (int)getContactsErrorCode:(int)arg1; - (id)getCountryAndPhoneCodeStrWithMobilePhoneStr:(id)arg1; - (unsigned long long)getHideBindingQQContactsCount; - (id)getLocalContactModelWithMd5:(id)arg1; - (id)getLocalContactWithPhone:(id)arg1; - (id)getLocalContactsDicWithMobliePhoneStr:(id)arg1 source:(id)arg2; - (id)getLocalQQContacts; - (id)getMaskedBindingPhoneCode; - (id)getMobilePhoneWithChatUIN:(long long)arg1; - (id)getMobilePhoneWithTemporaryUIN:(long long)arg1; - (id)getMyselfMobilePhone; - (id)getMyselfMobilePhoneWithoutCountry; - (id)getNewAllContacts; - (id)getNewMatchContacts; - (id)getNoCountryPhoneWithMobilePhone:(id)arg1; - (id)getOriContactNameWithMobilePhoneStr:(id)arg1; - (int)getRecommendContactsShowedCursor; - (id)getSafeBindingObjectForKey:(id)arg1; - (unsigned long long)getSafeContactsRecommendTime; - (long long)getTemporaryUINWithMobilePhoneStr:(id)arg1 makeIfNotExist:(_Bool)arg2; - (id)getUnbindingPhoneCode; - (id)getunbindingCountryCode; - (_Bool)hasBindingInfo; - (_Bool)hasChangeDevInfo; - (_Bool)hideContacts:(id)arg1 name:(id)arg2 hide:(_Bool)arg3; - (id)init; - (_Bool)isBinding; - (_Bool)isChangeDev; - (_Bool)isContactsMatched; - (_Bool)isDisableToChat:(id)arg1; - (_Bool)isEnableNoBindMatch; @property(nonatomic) _Bool isInBindingAndQueryProcess; // @synthesize isInBindingAndQueryProcess=_isInBindingAndQueryProcess; - (_Bool)isInactive; - (_Bool)isMobilePhoneAtBindContacts:(id)arg1; - (_Bool)isMobilePhoneAtBlackList:(id)arg1; - (_Bool)isMobilePhoneAtContacts:(id)arg1; - (_Bool)isMobilePhoneAtUnbindContacts:(id)arg1; @property(nonatomic) _Bool isRequestingBindingInfo; // @synthesize isRequestingBindingInfo=_isRequestingBindingInfo; - (_Bool)isShowLocalContactWhenRecommendContact; - (_Bool)isUploadedContactsNotBind; - (_Bool)isUploadingAndUpdatingContacts; - (_Bool)isUploadingAndUpdatingContactsByAutoMatch; - (_Bool)isUserAllowToAccessData; - (_Bool)isUserDenyToAccessData; - (_Bool)isUserNeedUploadContacts; @property int lastProgress; // @synthesize lastProgress=_lastProgress; - (id)loadApplyBindingInfo; - (void)loadBindingInfo; - (id)loadChatUINList; - (id)loadInvitedList; - (id)loadLastLoginContacts; - (id)loadMobilePhoneConfig; - (id)loadMobilePhoneNoCList; - (void)loadNewAllContacts; - (void)loadNewMatchContacts; - (id)loadQQContacts; - (id)loadTemporaryUINList; - (id)loadUploadContacts; - (void)notifyError:(id)arg1; - (void)notifyErrorWithRequestType:(id)arg1 errorCode:(int)arg2; - (void)onBindSuccess; - (_Bool)processBindingInfo:(struct ResponeQueryQQMobileContactsV3 *)arg1; - (_Bool)processNotBindingInfo:(struct ResponeQueryQQMobileContactsNotBind *)arg1; - (void)processQueryQQMobileContactsFinished:(struct ResponeQueryQQMobileContactsV3 *)arg1; - (void)processQueryQQMobileContactsNotBindFinished:(struct ResponeQueryQQMobileContactsNotBind *)arg1; - (_Bool)rebindPhoneCode:(id)arg1 countryCode:(id)arg2 bindType:(int)arg3 uniFlag:(_Bool)arg4 changeFlag:(_Bool)arg5; - (void)refreshContactAddState:(id)arg1; - (void)refreshNewMatchContacts:(id)arg1; - (void)registerAddressBookChanged; - (void)registerCheckUpdateObserver:(id)arg1; - (void)reload; - (void)removeMobilePhoneAtBlackList:(id)arg1; - (void)removeSafeBindingObject; - (void)replaceBlackList:(id)arg1; - (id)requestBindMobile:(id)arg1 countryCode:(id)arg2 rebind:(_Bool)arg3 bindType:(int)arg4 uniFlag:(_Bool)arg5 changeFlag:(_Bool)arg6; - (id)requestCancelBindMobile:(id)arg1 countryCode:(id)arg2 uniFlag:(_Bool)arg3 changeFlag:(_Bool)arg4; - (id)requestDisableMobileBind:(id)arg1 countryCode:(id)arg2; - (id)requestHideContacts:(id)arg1 name:(id)arg2 hide:(_Bool)arg3; - (void)requestNewUserRecommendListWithCount:(unsigned long long)arg1 success:(CDUnknownBlockType)arg2 failed:(CDUnknownBlockType)arg3; - (id)requestQueryLastLoginState:(unsigned int)arg1 nextFlag:(unsigned int)arg2 retryCount:(int)arg3 retryPara:(id)arg4; - (id)requestQueryQQMobileContactsNotBind:(unsigned int)arg1 nextFlag:(unsigned int)arg2 sessionSidData:(id)arg3 queryFlag:(unsigned int)arg4 retryCount:(int)arg5 retryPara:(id)arg6; - (id)requestQueryQQMobileContactsV3:(unsigned int)arg1 nextFlag:(unsigned int)arg2 sessionSidData:(id)arg3 queryFlag:(unsigned int)arg4 maxSignTimeStamp:(unsigned int)arg5 retryCount:(int)arg6 retryPara:(id)arg7; - (_Bool)requestResendSMSCode; - (void)requestTimeout:(id)arg1; - (id)requestUpdateAddressBookWithContactsToAdd:(id)arg1 contactsToDel:(id)arg2 nextFlag:(unsigned int)arg3 sessionSidData:(id)arg4; - (id)requestUpdateAddressBookWithContactsToAddNotBind:(id)arg1 contactsToDel:(id)arg2 nextFlag:(unsigned int)arg3 sessionSidData:(id)arg4; - (id)requestUploadAddressBookWithContactsNotBind:(id)arg1 nextFlag:(unsigned int)arg2 sessionSidData:(id)arg3 retryCount:(int)arg4 retryPara:(id)arg5; - (id)requestUploadAddressBookWithContactsV2:(id)arg1 nextFlag:(unsigned int)arg2 sessionSidData:(id)arg3 retryCount:(int)arg4 retryPara:(id)arg5; - (id)requestVerifySmscode:(id)arg1 sessionSidData:(id)arg2 bindType:(int)arg3 uniFlag:(_Bool)arg4 changeFlag:(_Bool)arg5; - (void)resendContactsRequest:(id)arg1; - (void)reset; - (void)resetData; - (_Bool)resumeUploadContacts; - (void)saveApplyBindingInfo:(id)arg1; - (void)saveBindingInfo; - (void)saveChatUINList:(id)arg1; - (void)saveContactListWhenFailed:(id)arg1; - (void)saveContactListWhenUploaded:(id)arg1 resp:(struct ResponeUploadAddressBookV2 *)arg2; - (void)saveContactListWhenUploadedNotBind:(id)arg1 resp:(struct ResponeUploadAddressBookNotBind *)arg2; - (void)saveInvitedList:(id)arg1; - (void)saveLastLoginContacts:(id)arg1; - (void)saveMobilePhoneConfig:(id)arg1; - (void)saveMobilePhoneNoCList:(id)arg1; - (void)saveNewAllContactsArray; - (void)saveNewAllContactsArrayDelay; - (void)saveNewMatchContactsArray; - (void)saveNewMatchContactsArrayDelay; - (void)saveQQContacts:(id)arg1; - (void)saveTemporaryUINList:(id)arg1; - (void)saveUploadContacts:(id)arg1; - (_Bool)sendServerContacts; - (_Bool)sendServerContactsForNewUserGuideWithBindPhone:(id)arg1; - (_Bool)sendServerContactsNotBind; - (void)setChatUIN:(long long)arg1 withMobilePhoneStr:(id)arg2; - (void)setContactUIN:(long long)arg1 withMobilePhoneStr:(id)arg2; - (void)setContactsRecommendTime:(int)arg1; - (void)setNoCountryPhone:(id)arg1 withMobilePhoneStr:(id)arg2; - (_Bool)setRecommendContactShowedCursor:(int)arg1; - (void)setSafeBindingInfo:(id)arg1; - (void)setSafeBindingObject:(id)arg1 forKey:(id)arg2; @property _Bool shouldSaveQQContactsWhenUpload; // @synthesize shouldSaveQQContactsWhenUpload=_shouldSaveQQContactsWhenUpload; - (void)setShouldUpdateRecommendCursor:(_Bool)arg1; - (void)setTempRecContactShowedCursor:(int)arg1; @property(nonatomic) unsigned long long timeStamp; - (_Bool)setUserNeedUploadContacts:(_Bool)arg1; - (_Bool)shouldUpdateRecommendCursor; - (_Bool)syncContacts; - (_Bool)syncContactsNotBind; - (void)syncContactsWhenDidAnsyFetchContacts:(id)arg1; - (void)syncContactsWhenDidAnsyFetchContactsNotBind:(id)arg1; - (void)unregisterAddressBookChanged; - (void)unregisterCheckUpdateObserver:(id)arg1; - (void)updateBindPhoneCode; - (_Bool)updateContactHideTag:(_Bool)arg1 mobilePhoneStr:(id)arg2; - (_Bool)updateContactNickName:(id)arg1 withMobilePhoneStr:(id)arg2; - (_Bool)updateContactsStat; - (void)uploadContactsWhenDidAnsyFetchContactsNotBind:(id)arg1; - (void)uploadContactsWhenDidAnsyFetchContactsV2:(id)arg1; - (_Bool)verifyBindingSMSCode:(id)arg1 bindType:(int)arg2 uniFlag:(_Bool)arg3 changeFlag:(_Bool)arg4; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end
49.097378
213
0.809215
734b5079f763bbc8acf070cf60df2485d004b494
1,365
h
C
include/mlio/byte.h
aws-patlin/ml-io
047e7d40609ced6f839d0b08d1917e9742a785af
[ "Apache-2.0" ]
null
null
null
include/mlio/byte.h
aws-patlin/ml-io
047e7d40609ced6f839d0b08d1917e9742a785af
[ "Apache-2.0" ]
null
null
null
include/mlio/byte.h
aws-patlin/ml-io
047e7d40609ced6f839d0b08d1917e9742a785af
[ "Apache-2.0" ]
null
null
null
/* * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You * may not use this file except in compliance with the License. A copy of * the License is located at * * http://aws.amazon.com/apache2.0/ * * or in the "license" file accompanying this file. This file is * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF * ANY KIND, either express or implied. See the License for the specific * language governing permissions and limitations under the License. */ #pragma once #if __cplusplus >= 201703L #include <cstddef> namespace mlio { inline namespace v1 { namespace stdx { using std::byte; using std::to_integer; } // namespace stdx } // namespace v1 } // namespace mlio #else #include <type_traits> #include "mlio/config.h" #if defined __GNUC__ || defined __clang__ #define MLIO_MAY_ALIAS __attribute__((__may_alias__)) #else #define MLIO_MAY_ALIAS #endif namespace mlio { inline namespace v1 { namespace stdx { enum class MLIO_MAY_ALIAS byte : unsigned char {}; template<class T> MLIO_API inline constexpr T to_integer(byte b) noexcept { static_assert(std::is_integral<T>::value, "T must be an integral type."); return static_cast<T>(b); } } // namespace stdx } // namespace v1 } // namespace mlio #endif
20.073529
77
0.721612
1ef327d8dbbc194dbf66bd578aabb084c23faabb
6,993
h
C
src/FSDoAction.h
pperehozhih/transform-cxx
f630079779e9e3cf6d06dcfc04b3ad0bd99d7e48
[ "BSD-3-Clause" ]
4
2018-09-16T09:55:22.000Z
2020-12-19T02:02:40.000Z
src/FSDoAction.h
pperehozhih/transform-cxx
f630079779e9e3cf6d06dcfc04b3ad0bd99d7e48
[ "BSD-3-Clause" ]
null
null
null
src/FSDoAction.h
pperehozhih/transform-cxx
f630079779e9e3cf6d06dcfc04b3ad0bd99d7e48
[ "BSD-3-Clause" ]
2
2015-11-24T20:27:35.000Z
2019-06-04T15:23:30.000Z
/* * FSDoAction.h * Transform SWF * * Copyright (c) 2001-2004 Flagstone Software Ltd.. 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 Flagstone Software Ltd. 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 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. */ #ifndef __FSDoAction_h__ #define __FSDoAction_h__ 1 #include "FSMovieObject.h" #include "FSVector.h" #include "FSActionObject.h" #ifdef WIN32 #ifdef _WINDLL DLL_TEMPLATE template class DLL_DECL transform::FSVector<transform::FSActionObject*>; #endif // _WINDLL #endif // WIN32 namespace transform { /** * %FSDoAction is used to specify a sequence of actions that are executed when a frame is displayed. * <table class="datasheet"> <tr><th align="left" colspan="2">Attributes</th></tr> <tr><td><a name="FSDoAction_0">type</a></td> <td>Identifies the data structure when it is encoded. Read-only.</td> </tr> <tr><td><a name="FSDoAction_1">actions</a></td> <td>An array of FSActionObjects which are executed by the Flash Player when the current frame is displayed. The actions are executed in the order they appear in the array.</td> </tr> <tr><td><a name="FSDoAction_2">encodedActions</a></td> <td>An array of bytes containing encoded actions can also be set. The encoded actions are typically generated by the parser in the Translate framework. The actions array and encodedActions cannot both be valid at the same time. Accessor methods used to set either of the attributes will set the other to null.</td> </tr> </table> <p>To define the actions for a given frame the FSDoAction object should be added to a movie after the previous frame is displayed but before the FSShowFrame object that displays the 'current' frame and triggers the actions to be executed.</p> <p>Only one FSDoAction object can be used to specify the actions for a given frame. If more than one FSDoAction object is added in a single frame only the actions contained in the last FSDoAction object (before the FSShowFrame object) will be executed when the frame is displayed. The other FSDoAction objects will be ignored.</p> <h1 class="datasheet">Examples</h1> <pre> FSVector&gt;FSActionObject*&gt; actions; actions.push_back(new FSPush("_root")); actions.push_back(new FSAction(FSAction::GetVariable)); ... movie.push_back(new FSShowFrame()); // previous frame ... movie.push_back(new FSDoAction(actions)); movie.push_back(new FSShowFrame()); // frame where actions will be executed </pre> <h1 class="datasheet">History</h1> <p>The FSDoAction class represents the DoAction tag from the Macromedia Flash (SWF) File Format Specification. It was introduced in Flash 1.</p> */ class DLL_DECL FSDoAction : public FSMovieObject { public: FSDoAction(FSInputStream* aStream); /** Constructs an FSDoAction object with an array actions. The FSDoAction object assumes ownership of all the action objects in the array. @param anArray the array of action objects. */ FSDoAction(const FSVector<FSActionObject*>& anArray) : FSMovieObject(DoAction), actions(anArray), encodedActions(0), encodedLength(0) {} /** * Constructs an FSDoAction object with an array of encoded actions * generated by the classes in Translate. * * @param bytes an array of encoded action objects. * @param size the number of bytes in the encoded data. */ FSDoAction(byte* bytes, size_t size); FSDoAction(const FSDoAction& rhs); ~FSDoAction(); FSDoAction& operator= (const FSDoAction& rhs); FSDoAction* clone() const; const char* className() const; /** Adds an action to the array of actions. The FSDoAction object assumes ownership of the action object. @param anAction a pointer to an action object. */ void add(FSActionObject* anAction) { actions.push_back(anAction); } /** Adds all the actions in an array to the array of actions. The FSDoAction object assumes ownership of all the action objects in the array. @param anArray an array of pointers to action objects. */ void add(const FSVector<FSActionObject*>& anArray); /** Get the array of actions that are executed when the frame is displayed. @return the array of action objects. */ FSVector<FSActionObject*>& getActions() { return actions; } /** Set the array of actions that will be executed when the next ShowFrame tag is executed by the Flash Player. The FSDoAction object assumes ownership of all the action objects in the array. @param anArray the array of action objects. */ void setActions(const FSVector<FSActionObject*>& anArray); /** * Set the array of encoded actions generated by the classes in the Translate * framework. If the object already contains an array of actions then they * will be deleted. * * @param bytes the array of encoded actions. * @param size the number of bytes in the encoded data. */ void setEncodedActions(byte* bytes, size_t size); int lengthInStream(FSOutputStream* aStream); void encodeToStream(FSOutputStream* aStream); void decodeFromStream(FSInputStream* aStream); private: FSVector<FSActionObject*> actions; byte* encodedActions; size_t encodedLength; }; } #endif
41.378698
331
0.697412
71650a47133ae9b8ac1e72c02094aafba87ab1eb
2,750
h
C
lib/DRV8301/DRV8301.h
swansk/avatar-fw
48bb98285ca1d5a102d17bc4df8bd77593c37dd4
[ "MIT" ]
null
null
null
lib/DRV8301/DRV8301.h
swansk/avatar-fw
48bb98285ca1d5a102d17bc4df8bd77593c37dd4
[ "MIT" ]
null
null
null
lib/DRV8301/DRV8301.h
swansk/avatar-fw
48bb98285ca1d5a102d17bc4df8bd77593c37dd4
[ "MIT" ]
null
null
null
#ifndef DRV_H #define DRV_H /// Registers /// #define SR1 0x0 /// Status Register 1 #define SR2 0x1 /// Status Register 2 #define CTR1 0x2 /// Control Register 1 #define CTR2 0x3 /// Control Register 2 /// Register maps, ordered from low bits to high bits /// /// Control Register 1 (Gate Driver Control) Fields /// #define GATE_CURR_PEAK_1700MA 0x0 #define GATE_CURR_PEAK_700MA 0x1 #define GATE_CURR_PEAK_250MA 0x2 #define GATE_NORMAL 0x0 #define GATE_RESET_FAULTS 0x1 /// reset gate driver latched faults (reverts to 0) #define PWM_MODE_6X 0x0 #define PWM_MODE_3X 0x1 #define OCP_LIMIT 0x0 #define OCP_LATCH 0x1 #define OCP_REPORT 0x2 #define OCP_NONE 0x3 #define VDS_LVL_0_06 0x0 #define VDS_LVL_0_068 0x1 #define VDS_LVL_0_076 0x2 #define VDS_LVL_0_086 0x3 #define VDS_LVL_0_097 0x4 #define VDS_LVL_0_109 0x5 #define VDS_LVL_0_123 0x6 #define VDS_LVL_0_138 0x7 #define VDS_LVL_0_155 0x8 #define VDS_LVL_0_175 0x9 #define VDS_LVL_0_197 0xA #define VDS_LVL_0_222 0xB #define VDS_LVL_0_250 0xC #define VDS_LVL_0_282 0xD #define VDS_LVL_0_317 0xE #define VDS_LVL_0_358 0xF #define VDS_LVL_0_403 0x10 #define VDS_LVL_0_454 0x11 #define VDS_LVL_0_511 0x12 #define VDS_LVL_0_576 0x13 #define VDS_LVL_0_648 0x14 #define VDS_LVL_0_730 0x15 #define VDS_LVL_0_822 0x16 #define VDS_LVL_0_926 0x17 #define VDS_LVL_1_043 0x18 #define VDS_LVL_1_175 0x19 #define VDS_LVL_1_324 0x1A #define VDS_LVL_1_491 0x1B #define VDS_LVL_1_679 0x1C #define VDS_LVL_1_892 0x1D #define VDS_LVL_2_131 0x1E #define VDS_LVL_2_400 0x1F /// Control Register 2 (Current Shunt Amplifiers and Misc Control) /// #define REPORT_BOTH 0x0 /// both OT and OC at nOCTW pin #define REPORT_OT 0x1 #define REPORT_OC 0x2 #define CSA_GAIN_10 0x0 #define CSA_GAIN_20 0x1 #define CSA_GAIN_40 0x2 #define CSA_GAIN_80 0x3 #define CSA1_CONNECT 0x0 /// shunt amplifier connects to load through input pins #define CSA1_DISCONNECT 0x1 /// shunt amplifier shorts input pins and disconnects from load for extern calibration #define CSA2_CONNECT 0x0 #define CSA2_DISCONNECT 0x1 #define OC_TOFF_CYCLE 0x0 /// cycle by cycle #define OC_TOFF_OFF_TIME 0x1 /// off time control class DRV8301 { public: DRV8301(SPI *spi, DigitalOut *cs, DigitalOut *en_gate); int read_SR1(); int read_SR2(); int read_register(int reg); int write_register(int reg, int val); int write_CTR1(int OC_ADJ_SET, int OCP_MODE, int PWM_MODE, int GATE_RESET, int GATE_CURRENT); int write_CTR2(int OC_TOFF, int DC_CAL_CH2, int DC_CAL_CH1, int GAIN, int OCTW_MODE); void enable_gd(void); void disable_gd(void); void calibrate(void); void print_faults(); private: SPI *_spi; DigitalOut *_cs; DigitalOut *_en_gate; uint16_t spi_write(uint16_t val); }; #endif // DRV8301_H
29.255319
114
0.779636
7167f82b4814d07f95a4829445cf9d64729df614
812
c
C
u-boot-2019.01+gitAUTOINC+333c3e72d3-g333c3e72d3/drivers/usb/host/ehci-vct.c
rlourette/TI_SDK_u-boot-2019.01
3000a07c021e84d717e6792a74efcf895a7d7188
[ "MIT" ]
1,144
2018-12-18T09:46:47.000Z
2022-03-07T14:51:46.000Z
u-boot-2019.01+gitAUTOINC+333c3e72d3-g333c3e72d3/drivers/usb/host/ehci-vct.c
rlourette/TI_SDK_u-boot-2019.01
3000a07c021e84d717e6792a74efcf895a7d7188
[ "MIT" ]
16
2019-01-28T06:08:40.000Z
2019-12-04T10:26:41.000Z
u-boot-2019.01+gitAUTOINC+333c3e72d3-g333c3e72d3/drivers/usb/host/ehci-vct.c
rlourette/TI_SDK_u-boot-2019.01
3000a07c021e84d717e6792a74efcf895a7d7188
[ "MIT" ]
129
2018-12-18T09:46:50.000Z
2022-03-30T07:30:13.000Z
// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2009 Stefan Roese <sr@denx.de>, DENX Software Engineering */ #include <common.h> #include <usb.h> #include "ehci.h" int vct_ehci_hcd_init(u32 *hccr, u32 *hcor); /* * Create the appropriate control structures to manage * a new EHCI host controller. */ int ehci_hcd_init(int index, enum usb_init_type init, struct ehci_hccr **hccr, struct ehci_hcor **hcor) { int ret; u32 vct_hccr; u32 vct_hcor; /* * Init VCT specific stuff */ ret = vct_ehci_hcd_init(&vct_hccr, &vct_hcor); if (ret) return ret; *hccr = (struct ehci_hccr *)vct_hccr; *hcor = (struct ehci_hcor *)vct_hcor; return 0; } /* * Destroy the appropriate control structures corresponding * the the EHCI host controller. */ int ehci_hcd_stop(int index) { return 0; }
18.044444
74
0.699507
bc336102b0a4c33a6ee08cb914f63da6c51a67d1
555
c
C
tests/test_break.c
JC-LL/crokus
a5c8c188af983ef481c90307a252a44aeecf978e
[ "MIT" ]
15
2020-03-30T15:46:26.000Z
2022-03-18T21:59:55.000Z
tests/test_break.c
JC-LL/crokus
a5c8c188af983ef481c90307a252a44aeecf978e
[ "MIT" ]
null
null
null
tests/test_break.c
JC-LL/crokus
a5c8c188af983ef481c90307a252a44aeecf978e
[ "MIT" ]
2
2021-11-16T07:43:55.000Z
2022-01-07T07:35:41.000Z
// Program to calculate the sum of maximum of 10 numbers // If negative number is entered, loop terminates and sum is displayed #include <stdio.h> int main() { int i; double number, sum = 0.0; for(i=1; i <= 10; ++i) { printf("Enter a n%d: ",i); scanf("%lf",&number); // If user enters negative number, loop is terminated if(number < 0.0) { printf("!"); break; } sum += number; // sum = sum + number; } printf("Sum = %.2lf",sum); return 0; }
19.137931
70
0.511712
90c25f3595a40eb2d726a77faca5d504ce8416fc
3,727
h
C
closed/PengChengLaboratory/code/vww/riscv_baremetal/include/cmsis/driver_i2c.h
AidanYok/tiny_results_v0.5
3ec2c4a4fb5c7261876bb3e468b34d4e0e2ab4b2
[ "Apache-2.0" ]
5
2021-06-22T15:34:37.000Z
2022-03-29T06:12:03.000Z
closed/PengChengLaboratory/code/vww/riscv_baremetal/include/cmsis/driver_i2c.h
AidanYok/tiny_results_v0.5
3ec2c4a4fb5c7261876bb3e468b34d4e0e2ab4b2
[ "Apache-2.0" ]
null
null
null
closed/PengChengLaboratory/code/vww/riscv_baremetal/include/cmsis/driver_i2c.h
AidanYok/tiny_results_v0.5
3ec2c4a4fb5c7261876bb3e468b34d4e0e2ab4b2
[ "Apache-2.0" ]
5
2021-08-02T16:39:02.000Z
2022-03-29T06:12:04.000Z
#ifndef DRIVER_I2C_H_ #define DRIVER_I2C_H_ #include "driver_common.h" #define I2C_API_VERSION DRIVER_VERSION_MAJOR_MINOR(1,0) /* API version */ /****** I2C Control Codes *****/ #define I2C_OWN_ADDRESS (0x01) // Set Own Slave Address; arg = address #define I2C_BUS_SPEED (0x02) // Set Bus Speed; arg = speed #define I2C_BUS_CLEAR (0x03) // Execute Bus clear: send nine clock pulses #define I2C_ABORT_TRANSFER (0x04) // Abort Master/Slave Transmit/Receive /*----- I2C Bus Speed -----*/ #define I2C_BUS_SPEED_STANDARD (0x01) // Standard Speed (100kHz) #define I2C_BUS_SPEED_FAST (0x02) // Fast Speed (400kHz) #define I2C_BUS_SPEED_FAST_PLUS (0x03) // Fast+ Speed ( 1MHz) #define I2C_BUS_SPEED_HIGH (0x04) // High Speed (3.4MHz) /****** I2C Address Flags *****/ #define I2C_ADDRESS_10BIT (0x0400) // 10-bit address flag #define I2C_ADDRESS_GC (0x8000) // General Call flag /* I2C Status */ typedef volatile struct _I2C_STATUS { uint32_t busy : 1; // Busy flag uint32_t mode : 1; // Mode: 0=Slave, 1=Master uint32_t direction : 1; // Direction: 0=Transmitter, 1=Receiver uint32_t general_call : 1; // General Call indication (cleared on start of next Slave operation) uint32_t arbitration_lost : 1; // Master lost arbitration (cleared on start of next Master operation) uint32_t bus_error : 1; // Bus error detected (cleared on start of next Master/Slave operation) uint32_t reserved : 26; } I2C_STATUS; /****** I2C Event *****/ #define I2C_EVENT_TRANSFER_DONE (1UL << 0) // Master/Slave Transmit/Receive finished #define I2C_EVENT_TRANSFER_INCOMPLETE (1UL << 1) // Master/Slave Transmit/Receive incomplete transfer #define I2C_EVENT_SLAVE_TRANSMIT (1UL << 2) // Addressed as Slave Transmitter but transmit operation is not set. #define I2C_EVENT_SLAVE_RECEIVE (1UL << 3) // Addressed as Slave Receiver but receive operation is not set. #define I2C_EVENT_ADDRESS_NACK (1UL << 4) // Address not acknowledged from Slave #define I2C_EVENT_GENERAL_CALL (1UL << 5) // Slave addressed with general call address #define I2C_EVENT_ARBITRATION_LOST (1UL << 6) // Master lost arbitration #define I2C_EVENT_BUS_ERROR (1UL << 7) // Bus error detected (START/STOP at illegal position) #define I2C_EVENT_BUS_CLEAR (1UL << 8) // Bus clear finished typedef void (*I2C_SignalEvent_t) (uint32_t event); // Pointer to \ref I2C_SignalEvent : Signal I2C Event. /* I2C Driver Capabilities. */ typedef struct _I2C_CAPABILITIES { uint32_t address_10_bit : 1; // supports 10-bit addressing uint32_t reserved : 31; // Reserved (must be zero) } I2C_CAPABILITIES; /* Access structure of the I2C Driver. */ typedef struct _DRIVER_I2C { DRIVER_VERSION (*GetVersion) (void); I2C_CAPABILITIES (*GetCapabilities)(void); int32_t (*Initialize) (I2C_SignalEvent_t cb_event); int32_t (*Uninitialize) (void); int32_t (*PowerControl) (POWER_STATE state); int32_t (*MasterTransmit) (uint32_t addr, const uint8_t *data, uint32_t num, bool xfer_pending); int32_t (*MasterReceive) (uint32_t addr, uint8_t *data, uint32_t num, bool xfer_pending); int32_t (*SlaveTransmit) (const uint8_t *data, uint32_t num); int32_t (*SlaveReceive) (uint8_t *data, uint32_t num); int32_t (*GetDataCount) (void); int32_t (*Control) (uint32_t control, uint32_t arg); I2C_STATUS (*GetStatus) (void); } const DRIVER_I2C; #ifdef __cplusplus } #endif #endif /* DRIVER_I2C_H_ */
44.369048
118
0.668903
90fd58f9878652240be15480f3efb5dcf8b29cd1
1,151
h
C
Pods/Headers/Public/CrutchKit/CDProxy/Proxy/CDObserversProxy.h
rambler-digital-solutions/RamblerConferences
533a76d8dd8e6d77585087dba72b0683e6211f30
[ "MIT" ]
264
2016-10-06T07:28:14.000Z
2022-03-03T02:10:22.000Z
Pods/Headers/Public/CrutchKit/CDProxy/Proxy/CDObserversProxy.h
rambler-digital-solutions/RamblerConferences
533a76d8dd8e6d77585087dba72b0683e6211f30
[ "MIT" ]
121
2015-11-17T20:35:39.000Z
2016-09-29T05:44:41.000Z
Pods/Headers/Public/CrutchKit/CDProxy/Proxy/CDObserversProxy.h
rambler-digital-solutions/RamblerConferences
533a76d8dd8e6d77585087dba72b0683e6211f30
[ "MIT" ]
73
2016-10-06T13:12:28.000Z
2022-02-11T16:12:08.000Z
// // CDObserversProxy.h // CrutchKitExample // // Created by Smal Vadim on 07/06/15. // Copyright (c) 2015 cognitivedisson. All rights reserved. // #import <UIKit/UIKit.h> #import "CDProxy.h" @protocol CDObserver; @class CDProxyDefinition; @interface CDObserversProxy : UIResponder <CDProxy> - (instancetype)initWithDefinition:(CDProxyDefinition *)definition; + (instancetype)observersProxyWithDefinition:(CDProxyDefinition *)definition; - (instancetype)initWithProtocol:(Protocol *)protocol observers:(NSArray *)observers; + (instancetype)observersProxyWithProtocol:(Protocol *)protocol observers:(NSArray *)observers; - (instancetype)initWithProtocols:(NSArray *)protocols observers:(NSArray *)observers; + (instancetype)observersProxyWithProtocols:(NSArray *)protocols observers:(NSArray *)observers; + (instancetype)observersProxyForSender:(UIResponder *)sender protocol:(Protocol *)protocol; - (void)addObserver:(id<CDObserver>)observer; - (void)removeObserver:(id<CDObserver>)observer; @end
27.404762
77
0.688966
a415fa5f58e47bae942ec27eadc772eac8afd183
8,183
h
C
include/MOSEKSolver.h
samuelgerber/ITKOptimalTransport
99f34d8003062d99ac2be8f2fce4705df5ccd994
[ "Apache-2.0" ]
1
2020-12-24T05:50:58.000Z
2020-12-24T05:50:58.000Z
include/MOSEKSolver.h
samuelgerber/ITKOptimalTransport
99f34d8003062d99ac2be8f2fce4705df5ccd994
[ "Apache-2.0" ]
null
null
null
include/MOSEKSolver.h
samuelgerber/ITKOptimalTransport
99f34d8003062d99ac2be8f2fce4705df5ccd994
[ "Apache-2.0" ]
1
2021-06-04T02:17:08.000Z
2021-06-04T02:17:08.000Z
#ifndef MOSEKSOLVER_H #define MOSEKSOLVER_H #include "mosek.h" #include "LPSolver.h" #include <vector> #include <iostream> static void MSKAPI printstr(void *handle, MSKCONST char str[]) { printf("%s",str); } /* printstr */ class MOSEKSolver : public LPSolver{ private: typedef LPSolver::Status Status; MSKenv_t env; MSKtask_t task; double *primal; double *dual; MSKint32t optimType; std::vector< MSKstakeye > colStatus; std::vector< MSKstakeye > rowStatus; MSKrescodee res; public: MOSEKSolver( MSKint32t optimizer = MSK_OPTIMIZER_NETWORK_PRIMAL_SIMPLEX ) { MSK_makeenv(&env,NULL); task = NULL; primal = NULL; dual=NULL; optimType=optimizer; }; ~MOSEKSolver(){ deleteLP(); MSK_deleteenv(&env); }; virtual void solveLP(){ if(primal != NULL){ delete[] primal; } if(dual != NULL){ delete[] dual; } primal = new double[ getNumberOfColumns() ]; dual = new double[ getNumberOfRows() ]; MSK_putskx ( task, MSK_SOL_BAS, colStatus.data() ); MSK_putskc ( task, MSK_SOL_BAS, rowStatus.data() ); res = MSK_optimize(task); std::cout << "MSK result code: " << res << std::endl; MSK_getxx(task, MSK_SOL_BAS, /* Request the basic solution. */ primal); MSK_gety(task, MSK_SOL_BAS, /* Request the basic solution. */ dual); MSK_getskx(task, MSK_SOL_BAS, colStatus.data() ); MSK_getskc(task, MSK_SOL_BAS, rowStatus.data() ); }; virtual double getObjectiveValue(){ double obj; MSK_getprimalobj(task, MSK_SOL_BAS, &obj); return obj; }; virtual long getIterationCount(){ static long n=16; static MSKiinfiteme iters[]= { MSK_IINF_INTPNT_ITER, MSK_IINF_SIM_DUAL_DEG_ITER, MSK_IINF_SIM_DUAL_INF_ITER, MSK_IINF_SIM_DUAL_ITER, MSK_IINF_SIM_NETWORK_DUAL_DEG_ITER, MSK_IINF_SIM_NETWORK_DUAL_INF_ITER, MSK_IINF_SIM_NETWORK_DUAL_ITER, MSK_IINF_SIM_NETWORK_PRIMAL_DEG_ITER, MSK_IINF_SIM_NETWORK_PRIMAL_INF_ITER, MSK_IINF_SIM_NETWORK_PRIMAL_ITER, MSK_IINF_SIM_PRIMAL_DEG_ITER, MSK_IINF_SIM_PRIMAL_DUAL_DEG_ITER, MSK_IINF_SIM_PRIMAL_DUAL_INF_ITER, MSK_IINF_SIM_PRIMAL_DUAL_ITER, MSK_IINF_SIM_PRIMAL_INF_ITER, MSK_IINF_SIM_PRIMAL_ITER }; long nIter = 0; for(long i=0; i<n; i++){ MSKint32t count; MSK_getintinf ( task, iters[i], &count ); nIter += count; } return nIter; }; virtual long getNumberOfRows(){ MSKint32t numcon; MSK_getnumcon ( task, &numcon); return numcon; }; virtual long getNumberOfColumns(){ MSKint32t numvar; MSK_getnumvar ( task, &numvar); return numvar; }; virtual void setupStandardBasis(){ for(long i= 0; i< getNumberOfColumns(); i++){ colStatus[i] = MSK_SK_LOW; } for(long i= 0; i< getNumberOfRows(); i++){ rowStatus[i] = MSK_SK_BAS; } }; virtual void createLP(long nSource, long nTarget){ deleteLP(); MSK_maketask(env, 0, 0,&task); MSK_putobjsense(task, MSK_OBJECTIVE_SENSE_MINIMIZE); MSK_putintparam(task, MSK_IPAR_OPTIMIZER, // MSK_OPTIMIZER_FREE_SIMPLEX); optimType); MSK_putintparam(task, MSK_IPAR_SIM_HOTSTART, MSK_SIM_HOTSTART_STATUS_KEYS); MSK_putintparam(task, MSK_IPAR_PRESOLVE_USE, MSK_PRESOLVE_MODE_OFF); //MSK_putintparam(task, MSK_IPAR_PRESOLVE_ELIMINATOR_USE, MSK_PRESOLVE_MODE_OFF); MSK_linkfunctotaskstream(task,MSK_STREAM_LOG,NULL, printstr); }; virtual void addColumns(long n){ MSK_appendvars(task,n); for(long i=0; i<n; i++){ colStatus.push_back( MSK_SK_LOW ); } }; virtual void addRows(long n){ MSK_appendcons(task, n); for(long i=0; i<n; i++){ rowStatus.push_back( MSK_SK_LOW ); } }; virtual double getRowDual(long row){ return dual[row]; }; virtual double getColumnPrimal(long col){ return primal[col]; }; virtual void setRowBounds(long i, double mass){ MSK_putconbound(task, i, /* Index of constraint.*/ MSK_BK_FX, /* Bound key.*/ mass, /* Numerical value of lower bound.*/ mass); /* Numerical value of upper bound.*/ }; virtual double getRowBounds(long i){ MSKboundkeye bk; MSKrealt bl; MSKrealt bu; MSK_getbound ( task, MSK_ACC_CON, i, &bk, &bl, &bu); return bu; }; virtual void setColumnBounds(long i, double lb, double ub){ MSK_putvarbound(task, i, /* Index of variable.*/ MSK_BK_RA, /* Bound key.*/ lb, /* Numerical value of lower bound.*/ ub); /* Numerical value of upper bound.*/ }; virtual void setColumnBoundsLower(long i, double lb){ MSK_putvarbound(task, i, /* Index of variable.*/ MSK_BK_LO, /* Bound key.*/ lb, /* Numerical value of lower bound.*/ MSK_SK_INF); /* Numerical value of upper bound.*/ }; virtual void setColumnObjective(long i, double cost){ MSK_putcj(task, i, cost); }; virtual void setColumnCoefficients( long col, long s, long t){ MSKint32t ind[2] = {(int)s,(int)t}; double val[2] = {1,-1}; MSK_putacol(task, col, /* Variable (column) index.*/ 2, /* Number of non-zeros in column j.*/ ind, /* Pointer to row indexes of column j.*/ val); /* Pointer to Values of column j.*/ }; virtual long getColumn(long col, long *ind, double *val){ MSKint32t colid = (int) col; MSKint32t n = 0; MSKint32t indi[2]; MSK_getacol(task, colid, &n, indi, val); ind[0] = indi[0]; ind[1] = indi[1]; return n; }; virtual Status getColumnStatus(long col){ return convertFromMOSEK( colStatus[col] ); }; virtual Status getRowStatus(long row){ return convertFromMOSEK( rowStatus[row] ); }; virtual void setColumnStatus(long col, Status s){ colStatus[col] = convertToMOSEK(s); }; virtual void setRowStatus(long row, Status s){ rowStatus[row] = convertToMOSEK(s); }; virtual bool isOptimal(){ return res == MSK_RES_OK; }; private: virtual void deleteLP(){ if(task != NULL){ MSK_deletetask(&task); task = NULL; delete[] primal; delete[] dual; colStatus.clear(); rowStatus.clear(); dual = NULL; primal = NULL; } }; Status convertFromMOSEK(MSKstakeye s){ switch(s){ case MSK_SK_BAS: return LPSolver::BASIC; case MSK_SK_UPR: return LPSolver::UPPER; case MSK_SK_LOW: return LPSolver::LOWER; case MSK_SK_UNK: return LPSolver::UNKNOWN; case MSK_SK_SUPBAS: return LPSolver::SUPERBASIC; case MSK_SK_FIX: return LPSolver::FIXED; case MSK_SK_INF: return LPSolver::INF; case MSK_SK_END: return LPSolver::END; } return LPSolver::END; }; MSKstakeye convertToMOSEK(Status s){ switch(s){ case LPSolver::BASIC: return MSK_SK_BAS; case LPSolver::UPPER: return MSK_SK_UPR; case LPSolver::LOWER: return MSK_SK_LOW; case LPSolver::UNKNOWN: case LPSolver::FREE: return MSK_SK_UNK; case LPSolver::SUPERBASIC: return MSK_SK_SUPBAS; case LPSolver::FIXED: return MSK_SK_FIX; case LPSolver::INF: return MSK_SK_INF; case LPSolver::END: return MSK_SK_END; } return MSK_SK_END; }; }; #endif
22.419178
86
0.577539
e543e5ee1ef1018bfb5c9807f4084c498836ea9d
293
h
C
roi1d_pooling_avg/src/roi1d_pooling_cuda.h
happygds/two_level
6ab47951f929d5403745cf0d3d60f63b2f9a0117
[ "BSD-3-Clause" ]
null
null
null
roi1d_pooling_avg/src/roi1d_pooling_cuda.h
happygds/two_level
6ab47951f929d5403745cf0d3d60f63b2f9a0117
[ "BSD-3-Clause" ]
null
null
null
roi1d_pooling_avg/src/roi1d_pooling_cuda.h
happygds/two_level
6ab47951f929d5403745cf0d3d60f63b2f9a0117
[ "BSD-3-Clause" ]
null
null
null
int roi1d_pooling_forward_cuda(int pooled_depth, float temporal_scale, THCudaTensor * features, THCudaTensor * rois, THCudaTensor * output); int roi1d_pooling_backward_cuda(int pooled_depth, float temporal_scale, THCudaTensor * top_grad, THCudaTensor * rois, THCudaTensor * bottom_grad);
48.833333
75
0.819113
ab83e01b8d2bd1655dbe2faa25d79a893563b48a
767
h
C
src/plugins/bittorrent/movetorrentfiles.h
Maledictus/leechcraft
79ec64824de11780b8e8bdfd5d8a2f3514158b12
[ "BSL-1.0" ]
120
2015-01-22T14:10:39.000Z
2021-11-25T12:57:16.000Z
src/plugins/bittorrent/movetorrentfiles.h
Maledictus/leechcraft
79ec64824de11780b8e8bdfd5d8a2f3514158b12
[ "BSL-1.0" ]
8
2015-02-07T19:38:19.000Z
2017-11-30T20:18:28.000Z
src/plugins/bittorrent/movetorrentfiles.h
Maledictus/leechcraft
79ec64824de11780b8e8bdfd5d8a2f3514158b12
[ "BSL-1.0" ]
33
2015-02-07T16:59:55.000Z
2021-10-12T00:36:40.000Z
/********************************************************************** * LeechCraft - modular cross-platform feature rich internet client. * Copyright (C) 2006-2015 Georg Rudoy * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt) **********************************************************************/ #pragma once #include <QDialog> #include "ui_movetorrentfiles.h" namespace LC::BitTorrent { class MoveTorrentFiles : public QDialog { Q_DECLARE_TR_FUNCTIONS (LC::BitTorrent::MoveTorrentFiles) Ui::MoveTorrentFiles Ui_; public: explicit MoveTorrentFiles (QStringList oldDirectories, QWidget *parent = nullptr); QString GetNewLocation () const; }; }
28.407407
84
0.616688
2239d13facac9568b5f47129f37ad0cce3e580b9
3,048
c
C
c2000/C2000Ware_1_00_06_00/libraries/dsp/VCU/c28/source/common/c/crc/crc_32_alt.c
ramok/Themis_ForHPSDR
d0f323a843ac0a488ef816ccb7c828032855a40a
[ "Unlicense" ]
null
null
null
c2000/C2000Ware_1_00_06_00/libraries/dsp/VCU/c28/source/common/c/crc/crc_32_alt.c
ramok/Themis_ForHPSDR
d0f323a843ac0a488ef816ccb7c828032855a40a
[ "Unlicense" ]
null
null
null
c2000/C2000Ware_1_00_06_00/libraries/dsp/VCU/c28/source/common/c/crc/crc_32_alt.c
ramok/Themis_ForHPSDR
d0f323a843ac0a488ef816ccb7c828032855a40a
[ "Unlicense" ]
1
2021-07-21T08:10:37.000Z
2021-07-21T08:10:37.000Z
//############################################################################# //! \file source/common/C/crc/crc_32_alt.c //! //! \brief 32-bit CRC // \author Vishal Coelho // \date Apr 7, 2011 // // o CRC implementation is based on tables. If the tables // are calculated on the fly, the macro GEN_CRC_TABLES shall be defined // and genCRC32Tables() shall be called during // initialization. If the macro is not defined, pre-calculated tables will // will be used. Using the latter option can put the tables to flash. // // Group: C2000 // Target Family: F2837x // //############################################################################# // $TI Release: C28x VCU Library V2.10.00.00 $ // $Release Date: Oct 18, 2018 $ // $Copyright: Copyright (C) 2018 Texas Instruments Incorporated - // http://www.ti.com/ ALL RIGHTS RESERVED $ //############################################################################# //***************************************************************************** // includes //***************************************************************************** #include "VCU0_CRC.h" // Generate the CRC lookup table using the polynomial 0x04c11db7 // // \param none // // This function is to generate the CRC32 table for every possible byte // i.e. 2^8 = 256 table values, using the CRC32_PRIME polynomial 0x04c11db7. // It expects a global array, crc32_table, to be defined in the application // code // // \return none // void genCRC32Table() /* generate the table of CRC remainders for all possible bytes */ { register uint16 i, j; register uint32 crc32_accum; for ( i = 0; i < 256; i++ ) { // myindex = i; crc32_accum = ( (uint32) i << 24 ); for ( j = 0; j < 8; j++ ) { if ( crc32_accum & 0x80000000L ) crc32_accum = ( crc32_accum << 1 ) ^ POLYNOMIAL32; else crc32_accum = ( crc32_accum << 1 ); } crc32_table[i] = crc32_accum; } } // C- function to get the 32-bit CRC // // \param The initial value of crc, in case the message has been // chopped into several parts, you can use the crc32 of the previous // segment as the init value for the current segment crc32 calculation // until the final crc is derived. // \param Address of the message buffer // \param Parity of the first message byte, i.e. whether its on an even // or odd address // \param Length of the message in bytes // // Calculate the 32-bit CRC of a message buffer by using the lookup table, // crc32_table based on the polynomial 0x04c11db7 // // \return CRC result // uint32 getCRC32_cpu (uint32 input_crc32_accum, uint16 * msg, CRC_parity_e parity, uint16 rxLen) { register uint16 i; register uint16 j; uint32 crc32_accum; SINT16 *pdata; crc32_accum = input_crc32_accum; pdata = (SINT16 *) msg; for (j = 0; j < rxLen; j++, parity++) { i = ( crc32_accum >> 24 ) ^ (__byte(pdata, parity)); crc32_accum = ( crc32_accum << 8 ) ^ crc32_table[i]; } return crc32_accum; } // End of file
31.42268
81
0.574475
66b00e65a1e28ccebfc4cecb46af8d676415247a
377
c
C
C_tutorial/conditional/01_if_else.c
rohitaswchoudhary/C
cdac597acd9df25de628bac65f4840e6d1b4e3b5
[ "MIT" ]
4
2021-04-02T16:03:54.000Z
2021-06-10T10:31:25.000Z
C_tutorial/conditional/01_if_else.c
rohitaswchoudhary/C
cdac597acd9df25de628bac65f4840e6d1b4e3b5
[ "MIT" ]
null
null
null
C_tutorial/conditional/01_if_else.c
rohitaswchoudhary/C
cdac597acd9df25de628bac65f4840e6d1b4e3b5
[ "MIT" ]
null
null
null
// a example of conditional if else statements. // write a program in C to check whether the number is positive or not. #include <stdio.h> void main() { int num; printf("Enter a number: "); scanf("%d", &num); if (num > 0) { printf("This is a positive number. "); } else { printf("This is a not a positive number. "); } }
17.136364
71
0.564987
c92d9a299d28b1b1522f2c3731437048b7aaa168
1,700
h
C
src/ui/ItemSelector.h
wayrunner/uic-number-detector
e41140be9f6ec0a85843afa4a9160014738e6ba2
[ "MIT" ]
null
null
null
src/ui/ItemSelector.h
wayrunner/uic-number-detector
e41140be9f6ec0a85843afa4a9160014738e6ba2
[ "MIT" ]
null
null
null
src/ui/ItemSelector.h
wayrunner/uic-number-detector
e41140be9f6ec0a85843afa4a9160014738e6ba2
[ "MIT" ]
null
null
null
// // Created by fab on 11.01.17. // #ifndef UIC_ITEMSELECTOR_H #define UIC_ITEMSELECTOR_H #include <vector> using namespace std; template<class Item> class ItemSelector { private: int currentIndex = 0; vector<Item> items; protected: virtual void onSelect(int index, Item item); public: inline ItemSelector(vector<Item> items): items(items) { } void next(); void previous(); Item getCurrent(); vector<Item> getItems(); int size(); int getCurrentIndex(); void setIndex(int index); void setItems(vector<Item> &items); }; template<class Item> void ItemSelector<Item>::next() { currentIndex = (currentIndex + 1) % (int) items.size(); onSelect(currentIndex, getCurrent()); } template<class Item> void ItemSelector<Item>::previous() { currentIndex = (currentIndex + (int) items.size() - 1) % (int) items.size(); onSelect(currentIndex, getCurrent()); } template<class Item> Item ItemSelector<Item>::getCurrent() { return items[currentIndex]; } template<class Item> vector<Item> ItemSelector<Item>::getItems() { return items; } template<class Item> int ItemSelector<Item>::getCurrentIndex() { return currentIndex; } template<class Item> int ItemSelector<Item>::size() { return (int) items.size(); } template<class Item> void ItemSelector<Item>::onSelect(int index, Item item) { } template<class Item> void ItemSelector<Item>::setIndex(int index) { // assert(shift > 0 && shift < items.size()); currentIndex = index; onSelect(currentIndex, getCurrent()); } template<class Item> void ItemSelector<Item>::setItems(vector<Item> &items) { this->items = items; } #endif //UIC_ITEMSELECTOR_H
18.681319
80
0.683529
a750e38883bbe08e2d7f6d940292b979fc18629e
396
h
C
Archived/v1/WCDistractionFreeXcodePlugin/Headers/PlugIns/DebuggerUI/DBGRectInspectorPropertyView.h
wokalski/Distraction-Free-Xcode-plugin
54ab4b9d9825e8370855b7985d6ff39d64c19f25
[ "MIT" ]
25
2016-03-03T07:43:56.000Z
2021-09-05T08:47:40.000Z
PlugIns/DebuggerUI/DBGRectInspectorPropertyView.h
cameroncooke/XcodeHeaders
be955d30b5fc62c4312b354045b4561d164ebd9c
[ "MIT" ]
8
2016-02-23T18:40:20.000Z
2016-08-18T13:21:05.000Z
PlugIns/DebuggerUI/DBGRectInspectorPropertyView.h
cameroncooke/XcodeHeaders
be955d30b5fc62c4312b354045b4561d164ebd9c
[ "MIT" ]
4
2016-02-24T13:24:27.000Z
2016-06-28T12:50:36.000Z
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "NSView.h" @interface DBGRectInspectorPropertyView : NSView { struct CGRect _rect; } @property struct CGRect rect; // @synthesize rect=_rect; - (struct CGRect)scaledRectForRect:(struct CGRect)arg1; - (void)drawRect:(struct CGRect)arg1; @end
19.8
83
0.699495
9c7efa5aa8f6db30e3af966e19c36d6f00e109c9
12,974
h
C
usr/sbin/WirelessRadioManagerd/WRM_HandoverManager.h
zhangkn/iOS14Header
4323e9459ed6f6f5504ecbea2710bfd6c3d7c946
[ "MIT" ]
1
2020-11-04T15:43:01.000Z
2020-11-04T15:43:01.000Z
usr/sbin/WirelessRadioManagerd/WRM_HandoverManager.h
zhangkn/iOS14Header
4323e9459ed6f6f5504ecbea2710bfd6c3d7c946
[ "MIT" ]
null
null
null
usr/sbin/WirelessRadioManagerd/WRM_HandoverManager.h
zhangkn/iOS14Header
4323e9459ed6f6f5504ecbea2710bfd6c3d7c946
[ "MIT" ]
null
null
null
// // Generated by classdumpios 1.0.1 (64 bit) (iOS port by DreamDevLost)(Debug version compiled Sep 26 2020 13:48:20). // // Copyright (C) 1997-2019 Steve Nygard. // #import <objc/NSObject.h> #import "CXCallObserverDelegate-Protocol.h" @class CXCallObserver, NSDate, NSMutableArray, NSString, WCM_WiFiController, WRM_CTService, WRM_IDSP2PController, WRM_IPTelephonyController, WRM_MetricsService, WRM_MotionController, WRM_QMIClient, WRM_SCService, WRM_SymptomsService, WRM_WiFiCallingController, WRM_iRATConfig; @protocol OS_dispatch_queue; @interface WRM_HandoverManager : NSObject <CXCallObserverDelegate> { NSObject<OS_dispatch_queue> *mQueue; // 8 = 0x8 WRM_CTService *mCTService; // 16 = 0x10 WRM_SCService *mSCService; // 24 = 0x18 WRM_IDSP2PController *mIDSP2PController; // 32 = 0x20 WCM_WiFiController *mWiFi; // 40 = 0x28 WRM_WiFiCallingController *mWiFiCalling; // 48 = 0x30 WRM_SymptomsService *mSymtomsService; // 56 = 0x38 WRM_iRATConfig *miRATConfig; // 64 = 0x40 WRM_MotionController *mMotionController; // 72 = 0x48 WRM_QMIClient *mQMIClient; // 80 = 0x50 WRM_IPTelephonyController *mIPTelephonyController; // 88 = 0x58 WRM_MetricsService *mMetrics; // 96 = 0x60 int mReasons; // 104 = 0x68 struct WRMWiFiCallingEnd *wrmWifiCallingEnd; // 112 = 0x70 struct WRMMetricsiRATDataRecommendation *mDataLinkPrefMetrics; // 120 = 0x78 _Bool deviceAttachedWithCellularNetwork; // 128 = 0x80 _Bool deviceRegisteredWithCellularNetwork; // 129 = 0x81 NSMutableArray *miRATClientContexts; // 136 = 0x88 unsigned long long mActivePolicies; // 144 = 0x90 _Bool mWiFiSwitchedOn; // 152 = 0x98 NSDate *mStartTime; // 160 = 0xa0 double prevTimeSinceStart; // 168 = 0xa8 NSDate *mAudioEvaluationTimer; // 176 = 0xb0 double mTimeSinceAudioEvaluationStarted; // 184 = 0xb8 NSDate *mLatteContextStartedTimer; // 192 = 0xc0 double mTimeSinceLatteContextStarted; // 200 = 0xc8 CXCallObserver *mCallObserver; // 208 = 0xd0 } + (id)allocWithZone:(struct _NSZone *)arg1; // IMP=0x0000000100093b6c + (id)WRM_HandoverManagerSingleton; // IMP=0x0000000100093a1c - (void)notifyBBVoIPState:(unsigned char)arg1:(unsigned char)arg2:(unsigned char)arg3:(unsigned char)arg4; // IMP=0x000000010009d814 - (void)createQMIClient; // IMP=0x000000010009d750 - (void)createSymptomsService; // IMP=0x000000010009d6a0 - (void)monitorTransportMetrics; // IMP=0x000000010009d664 - (void)feedAWDCallEndStats; // IMP=0x000000010009d1b4 - (void)submitCallEndMetics; // IMP=0x000000010009d158 - (void)submitDataLinkPreferenceMetrics:(int)arg1; // IMP=0x000000010009d05c - (void)feedAWDDataLinkPreferenceChange:(int)arg1; // IMP=0x000000010009ca1c - (void)feedAWDDataStatus:(int)arg1; // IMP=0x000000010009c958 - (void)setIWLANServiceType:(int)arg1; // IMP=0x000000010009c880 - (int)getIWLANServiceType; // IMP=0x000000010009c848 - (void)resetActiveCallTimer; // IMP=0x000000010009c808 - (void)setPingPongTimerMultipler:(unsigned long long)arg1:(int)arg2:(unsigned long long)arg3; // IMP=0x000000010009c78c - (void)resetActiveCallEvaluationMetrics; // IMP=0x000000010009c64c - (void)setHOAlertUI:(_Bool)arg1; // IMP=0x000000010009c618 - (void)updateHandoverReasonCode:(int)arg1; // IMP=0x000000010009c5e8 - (void)initHandoverReasonCode; // IMP=0x000000010009c5cc - (void)sendMessage:(int)arg1 withMsg:(id)arg2; // IMP=0x000000010009c558 - (void)setWiFiLinkDown:(_Bool)arg1; // IMP=0x000000010009c524 - (_Bool)needWiFiLQM; // IMP=0x000000010009c480 - (void)registerForSCNotifications; // IMP=0x000000010009c404 - (void)registerForCTNotifications; // IMP=0x000000010009c30c - (long long)getRSSIHysteresis; // IMP=0x000000010009c10c - (long long)getSNRHysteresis; // IMP=0x000000010009bf0c - (_Bool)isWiFiLinkActive; // IMP=0x000000010009bee4 - (void)handlePeriodicRTPMetrics:(id)arg1; // IMP=0x000000010009bc18 - (void)handleIPTelephonyMetrics:(id)arg1; // IMP=0x000000010009b9b8 - (void)handleIWLANMetrics:(id)arg1; // IMP=0x000000010009b7d8 - (void)handleSIPMetricsRecevied:(id)arg1; // IMP=0x000000010009b634 - (void)configureRTPMetricsReporting; // IMP=0x000000010009b5d8 - (void)handleSubscribeStatusUpdate:(id)arg1:(_Bool)arg2; // IMP=0x000000010009aac8 - (void)handleLinkPrefSubscribe:(id)arg1; // IMP=0x000000010009a0e0 - (void)handleCellularLinkQualityUpdate:(id)arg1; // IMP=0x000000010009a064 - (void)handleWiFiStateChaneEvents:(id)arg1; // IMP=0x0000000100099c80 - (void)handleWiFiLinkQualityUpdate:(id)arg1; // IMP=0x0000000100099b64 - (void)updateCellularMetricsMovAverage; // IMP=0x0000000100099b10 - (id)getiRATConfigController; // IMP=0x0000000100099af4 - (id)getSymptomsService; // IMP=0x0000000100099ad8 - (id)getWiFiCallingController; // IMP=0x0000000100099abc - (void)setSCService:(id)arg1; // IMP=0x0000000100099a98 - (void)setCTService:(id)arg1; // IMP=0x0000000100099a74 - (id)getSCService; // IMP=0x0000000100099a58 - (id)getCTService; // IMP=0x0000000100099a3c - (id)getMotionController; // IMP=0x0000000100099a20 - (void)showHOAlertUI:(_Bool)arg1; // IMP=0x00000001000993a8 - (void)evaluateHandover; // IMP=0x00000001000975ac - (id)getWiFiService; // IMP=0x0000000100097574 - (id)getWiFiController; // IMP=0x0000000100097558 - (_Bool)doesIRATClientSubscriptionContextExist; // IMP=0x00000001000971d4 - (int)evaluateLinkNonWiFiPreferred:(unsigned long long)arg1:(unsigned long long)arg2:(_Bool)arg3:(int)arg4:(int)arg5; // IMP=0x0000000100096ef8 - (int)evaluateLinkWiFiPreferred:(unsigned long long)arg1:(unsigned long long)arg2:(_Bool)arg3:(int)arg4; // IMP=0x0000000100096c78 - (int)evaluateLink:(unsigned long long)arg1:(unsigned long long)arg2:(_Bool)arg3:(int)arg4:(int)arg5:(int)arg6; // IMP=0x0000000100096880 - (_Bool)isWiFiLinkEvaluationDesired; // IMP=0x0000000100096720 - (_Bool)handoverEvaluationRequired; // IMP=0x0000000100096328 - (void)handleWiFiConfig; // IMP=0x0000000100096298 - (void)handleNetworkdConfig; // IMP=0x0000000100096250 - (void)handleCTConfig; // IMP=0x0000000100096208 - (void)handleCallKitConfig; // IMP=0x00000001000961c0 - (void)handleControllerAvailability:(unsigned long long)arg1; // IMP=0x00000001000960d4 - (void)updateActiveHandoverStatus; // IMP=0x0000000100095bd4 - (_Bool)disableQMIClient; // IMP=0x0000000100095b08 - (_Bool)isRecentDevice; // IMP=0x0000000100095a00 - (_Bool)isEnhancedCTServiceNeeded; // IMP=0x00000001000959e0 - (_Bool)isActiveHandoverSupported; // IMP=0x00000001000959b8 - (_Bool)enableiRATManager; // IMP=0x0000000100095998 - (void)handleSessionNotification:(id)arg1; // IMP=0x00000001000956c8 - (void)handleCommCenterManagerNotification:(id)arg1; // IMP=0x00000001000956b0 - (void)updateProximityState:(id)arg1; // IMP=0x0000000100095698 - (void)handleBBAssertionBGAppActiveRequest:(id)arg1; // IMP=0x0000000100095680 - (void)handleDisconnection:(id)arg1 pid:(int)arg2; // IMP=0x0000000100095664 - (void)updateControllerState:(id)arg1; // IMP=0x00000001000955b0 - (void)updateControllerSession:(id)arg1 ofId:(unsigned long long)arg2; // IMP=0x0000000100094e20 - (void)callObserver:(id)arg1 callChanged:(id)arg2; // IMP=0x00000001000949d8 - (_Bool)isDeviceConnectedOverNonLTERadio; // IMP=0x0000000100094928 - (void)notifyAVStatus:(unsigned char)arg1:(unsigned short)arg2; // IMP=0x00000001000948a8 - (void)postBBNotification:(unsigned char)arg1:(unsigned char)arg2; // IMP=0x0000000100094828 - (id)getQueue; // IMP=0x000000010009480c - (void)dealloc; // IMP=0x0000000100094578 - (id)init; // IMP=0x000000010009415c - (id)autorelease; // IMP=0x0000000100094110 - (oneway void)release; // IMP=0x00000001000940fc - (unsigned long long)retainCount; // IMP=0x00000001000940a0 - (void)existingContexts; // IMP=0x0000000100094020 - (id)getiRATClientFromList:(int)arg1; // IMP=0x0000000100093e14 - (void)deleteiRATClient:(int)arg1; // IMP=0x0000000100093d1c - (void)removeiRatClient:(id)arg1; // IMP=0x0000000100093c70 - (void)addiRatClient:(id)arg1; // IMP=0x0000000100093bdc - (id)retain; // IMP=0x0000000100093bc4 - (id)copyWithZone:(struct _NSZone *)arg1; // IMP=0x0000000100093ba8 - (void)evaluateWiFiVersusCell; // IMP=0x0000000100028500 - (void)submitWiFiVersusCellAWDMetrics; // IMP=0x00000001000284ec - (void)initWiFiCellDataEval; // IMP=0x000000010002848c - (_Bool)canCellularMeetApplicationRequirement:(unsigned long long)arg1:(unsigned long long)arg2:(_Bool)arg3:(int)arg4:(int)arg5; // IMP=0x0000000100030c90 - (_Bool)isCellularExitCriteriaMetForIMSThumpCallCurrentLinkCellular; // IMP=0x00000001000315b0 - (_Bool)isCellularEntryCriteriaMetForIMSThumpCallCurrentLinkWiFi; // IMP=0x0000000100031208 - (_Bool)canCellularMeetApplicationRequirementsAppTypeThumper:(_Bool)arg1:(int)arg2:(int)arg3; // IMP=0x0000000100030de4 - (_Bool)canCellularMeetApplicationRequirementsAppTypeData; // IMP=0x0000000100031948 - (_Bool)isCellularExitCriteriaMetForVoiceCallCallCurrentLinkUMTS; // IMP=0x000000010003477c - (_Bool)isCellularExitCriteriaMetForIMSVoiceCallCurrentLinkNR:(_Bool)arg1; // IMP=0x0000000100034470 - (_Bool)isCellularExitCriteriaMetForIMSVoiceCallCurrentLinkLTE:(_Bool)arg1; // IMP=0x0000000100033f50 - (_Bool)isCellularEntryCriteriaMetForIMSVoiceCallCurrentLinkWiFi:(_Bool)arg1; // IMP=0x0000000100033acc - (_Bool)isLteEntryCriteriaMetCurrentLinkWiFi:(long long)arg1; // IMP=0x0000000100033780 - (_Bool)isNrEntryCriteriaMetCurrentLinkWiFi:(long long)arg1; // IMP=0x0000000100033518 - (_Bool)isCellularEntryCriteriaMetForVoiceCallCurrentLinkNone; // IMP=0x0000000100033240 - (_Bool)isLteEntryCriteriaMetCurrentLinkNone; // IMP=0x0000000100033008 - (_Bool)isNrEntryCriteriaMetCurrentLinkNone; // IMP=0x0000000100032dd0 - (_Bool)canCellularMeetApplicationRequirementsAppTypeWiFiCallingCallActive:(int)arg1; // IMP=0x0000000100032b78 - (_Bool)canCellularMeetApplicationRequirementsAppTypeWiFiCallingCallIdle:(int)arg1; // IMP=0x00000001000324ac - (_Bool)can4G5GMeetApplicationRequirementsAppTypeWiFiCallingCallIdle:(int)arg1; // IMP=0x0000000100032190 - (_Bool)evaluateCellularLinkForWiFiCallingIMSPreferredPolicy:(int)arg1:(_Bool)arg2; // IMP=0x0000000100032058 - (_Bool)evaluateCellularLinkForWiFiCallingCellPreferredPolicy:(int)arg1:(_Bool)arg2; // IMP=0x0000000100031fc8 - (_Bool)evaluateCellularLinkForWiFiCallingWiFiPreferredPolicy:(int)arg1:(_Bool)arg2; // IMP=0x0000000100031db4 - (_Bool)canCellularMeetApplicationRequirementsAppTypeWiFiCalling:(_Bool)arg1:(int)arg2:(int)arg3; // IMP=0x0000000100031af0 - (_Bool)isUplinkAudioQualityOfCurrentCallGood:(int)arg1; // IMP=0x0000000100038054 - (_Bool)isIMSTransportQualityGood; // IMP=0x0000000100037ef0 - (_Bool)isMovingAverageAudioQualityOfCurrentCallGood:(int)arg1; // IMP=0x000000010003786c - (_Bool)isWiFiVoIPQualityGoodEnough; // IMP=0x000000010003716c - (void)evaluateActiveCallQuality; // IMP=0x0000000100036d60 - (_Bool)canWiFiMeetIdleApplicationRequirements:(unsigned long long)arg1:(unsigned long long)arg2:(int)arg3; // IMP=0x0000000100036c0c - (_Bool)canWiFiMeetActiveApplicationRequirements:(unsigned long long)arg1:(unsigned long long)arg2:(int)arg3:(int)arg4; // IMP=0x0000000100036a1c - (_Bool)canWiFiTransportMeetActiveApplicationRequirements:(unsigned long long)arg1:(unsigned long long)arg2:(int)arg3; // IMP=0x0000000100036864 - (_Bool)isWiFiSymtompsIndicatorGoodEnoughForActiveApplication:(unsigned long long)arg1:(int)arg2; // IMP=0x000000010003659c - (_Bool)isWiFiSymtompsIndicatorGoodEnoughForIdleApplication:(unsigned long long)arg1:(int)arg2; // IMP=0x00000001000362f0 - (_Bool)canWiFiRadioMeetActiveApplicationRequirements:(unsigned long long)arg1:(unsigned long long)arg2:(int)arg3; // IMP=0x0000000100035da8 - (_Bool)canWiFiTransportMeetIdleApplicationRequirements:(unsigned long long)arg1:(unsigned long long)arg2:(int)arg3; // IMP=0x0000000100035cfc - (_Bool)canWiFiRadioMeetIdleApplicationRequirements:(unsigned long long)arg1:(unsigned long long)arg2:(int)arg3; // IMP=0x00000001000357a0 - (_Bool)isWiFiArqQualityIndicatorGood:(unsigned long long)arg1:(unsigned long long)arg2:(int)arg3:(_Bool)arg4; // IMP=0x0000000100035670 - (_Bool)isWiFiArqQualityIndicatorGoodControlFW:(unsigned long long)arg1:(unsigned long long)arg2:(int)arg3:(_Bool)arg4; // IMP=0x0000000100035250 - (_Bool)isWiFiArqQualityIndicatorGoodUserData:(unsigned long long)arg1:(unsigned long long)arg2:(int)arg3:(_Bool)arg4; // IMP=0x0000000100034d84 - (_Bool)isWiFiLoadQualityIndicatorGood:(unsigned long long)arg1:(unsigned long long)arg2:(_Bool)arg3:(int)arg4; // IMP=0x0000000100034b70 - (_Bool)isWiFiBeaconLossQualityIndicatorGood:(unsigned long long)arg1:(unsigned long long)arg2:(int)arg3; // IMP=0x00000001000349b4 - (void)handleMotionUpdate:(id)arg1; // IMP=0x0000000100038818 - (void)monitorNetworkSymptoms:(int)arg1; // IMP=0x00000001000385f8 - (void)handleInternalMessage:(id)arg1; // IMP=0x0000000100038514 // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end
68.284211
276
0.801141
d59a1069782d848b2a08685a0bbc815ab479b307
263
h
C
09.30.2018/Quaternion/Vector.h
HuiloIvanovich/HomeworkSPBU
5db9bd19d7e4cfe1e080526a9d5bb78f423510a8
[ "Apache-2.0" ]
null
null
null
09.30.2018/Quaternion/Vector.h
HuiloIvanovich/HomeworkSPBU
5db9bd19d7e4cfe1e080526a9d5bb78f423510a8
[ "Apache-2.0" ]
null
null
null
09.30.2018/Quaternion/Vector.h
HuiloIvanovich/HomeworkSPBU
5db9bd19d7e4cfe1e080526a9d5bb78f423510a8
[ "Apache-2.0" ]
null
null
null
class Vector{ public: Vector(float, float, float); float x; float y; float z; float Lenght; Vector operator* (Vector&); Vector operator* (float); Vector operator+ (Vector&); float ScalarMult (Vector&); void PrintVec(); };
17.533333
32
0.604563
cb5b384c61fc97c0779387547e4730bca1b02fc7
313
c
C
lib/libc/arch/hppa/gen/fpgetsticky.c
ArrogantWombatics/openbsd-src
75721e1d44322953075b7c4b89337b163a395291
[ "BSD-3-Clause" ]
1
2019-02-16T13:29:23.000Z
2019-02-16T13:29:23.000Z
lib/libc/arch/hppa/gen/fpgetsticky.c
ArrogantWombatics/openbsd-src
75721e1d44322953075b7c4b89337b163a395291
[ "BSD-3-Clause" ]
1
2018-08-21T03:56:33.000Z
2018-08-21T03:56:33.000Z
lib/libc/arch/hppa/gen/fpgetsticky.c
ArrogantWombatics/openbsd-src
75721e1d44322953075b7c4b89337b163a395291
[ "BSD-3-Clause" ]
null
null
null
/* $OpenBSD: fpgetsticky.c,v 1.4 2014/04/18 15:09:52 guenther Exp $ */ /* * Written by Miodrag Vallat. Public domain */ #include <sys/types.h> #include <ieeefp.h> fp_except fpgetsticky() { u_int64_t fpsr; __asm__ volatile("fstd %%fr0,0(%1)" : "=m" (fpsr) : "r" (&fpsr)); return ((fpsr >> 59) & 0x1f); }
17.388889
70
0.619808
02876d57e3ae218013173607b4fc2b4428a02f34
625
h
C
src/error.h
sundogu/GM-Bark
d44d7dc2cd02077a0d8eda2391ea6e07a56a0726
[ "MIT" ]
null
null
null
src/error.h
sundogu/GM-Bark
d44d7dc2cd02077a0d8eda2391ea6e07a56a0726
[ "MIT" ]
null
null
null
src/error.h
sundogu/GM-Bark
d44d7dc2cd02077a0d8eda2391ea6e07a56a0726
[ "MIT" ]
null
null
null
// // Created by Daddy on 3/08/2019. // #ifndef BARKPROJECT_ERROR_H #define BARKPROJECT_ERROR_H typedef enum { OK // 0 , NUM_ARGS // 1 , ARG_TYPE // 2 , DECK_FILE // 3 , SAVE_FILE // 4 , SHORT_DECK // 5 , BOARD_FULL // 6 , EOI // 7 } ErrorCode; // Function Prototypes // /** * Checks the err enum and prints the relevant error message if required to * stderr. * @param err the ErrorCode enum * @return the enum value of err */ ErrorCode process_error_code(ErrorCode err); #endif //BARKPROJECT_ERROR_H
18.939394
76
0.5664
7ed4157ebd8a6a7ea9ee0012e7bd20c800f56952
826
c
C
m3-libs/libm3/src/os/POSIX/OSConfigPosixC.c
jaykrell/cm3
2aae7d9342b8e26680f6419f9296450fae8cbd4b
[ "BSD-4-Clause-UC", "BSD-4-Clause", "BSD-3-Clause" ]
105
2015-03-02T16:58:34.000Z
2022-03-28T07:17:49.000Z
m3-libs/libm3/src/os/POSIX/OSConfigPosixC.c
jaykrell/cm3
2aae7d9342b8e26680f6419f9296450fae8cbd4b
[ "BSD-4-Clause-UC", "BSD-4-Clause", "BSD-3-Clause" ]
145
2015-03-18T10:08:17.000Z
2022-03-31T01:27:08.000Z
m3-libs/libm3/src/os/POSIX/OSConfigPosixC.c
jaykrell/cm3
2aae7d9342b8e26680f6419f9296450fae8cbd4b
[ "BSD-4-Clause-UC", "BSD-4-Clause", "BSD-3-Clause" ]
26
2015-10-10T09:37:44.000Z
2022-02-23T02:02:05.000Z
/* Copyright 1996-2000, Critical Mass, Inc. All rights reserved. */ /* See file COPYRIGHT-CMASS for details. */ #ifndef INCLUDED_M3CORE_H #include "m3core.h" #endif #include <sys/utsname.h> #ifdef __cplusplus extern "C" { #endif // Callback from C to Modula3 so that C does not traffic in traced references. void __cdecl OSConfigPosixC__InitFromC( const char* host_name, const char* host_arch, const char* os_name, const char* os_version); void __cdecl OSConfigPosixC__InitC(void) { struct utsname uts; // Workaround: Some builds of WSL1 do not nul terminate. ZeroMemory(&uts, sizeof(uts)); int result = uname(&uts); assert(result == 0); OSConfigPosixC__InitFromC(uts.nodename, uts.machine, uts.sysname, uts.release); } #ifdef __cplusplus } /* extern "C" */ #endif
19.666667
83
0.698547
463d17d8d8d927c860435c0637308965a446f1d6
1,007
h
C
ui/visitor/ivisitor.h
aconstlink/snakeoil
3c6e02655e1134f8422f01073090efdde80fc109
[ "MIT" ]
1
2017-08-11T19:12:24.000Z
2017-08-11T19:12:24.000Z
ui/visitor/ivisitor.h
aconstlink/snakeoil
3c6e02655e1134f8422f01073090efdde80fc109
[ "MIT" ]
11
2018-07-07T20:09:44.000Z
2020-02-16T22:45:09.000Z
ui/visitor/ivisitor.h
aconstlink/snakeoil
3c6e02655e1134f8422f01073090efdde80fc109
[ "MIT" ]
null
null
null
//------------------------------------------------------------ // snakeoil (c) Alexis Constantin Link // Distributed under the MIT license //------------------------------------------------------------ #pragma once #include "../result.h" #include "../protos.h" #include "../typedefs.h" #include "../api.h" namespace so_ui { namespace so_visitor { class SNAKEOIL_UI_API ivisitor { public: // group / decorator virtual so_ui::result visit( so_ui::so_node::node_ptr_t ) = 0 ; virtual so_ui::result post_visit( so_ui::so_node::node_ptr_t ) = 0 ; virtual so_ui::result visit( so_ui::so_node::group_ptr_t ) = 0 ; virtual so_ui::result post_visit( so_ui::so_node::group_ptr_t ) = 0 ; virtual so_ui::result visit( so_ui::so_node::leaf_ptr_t ) = 0 ; virtual so_ui::result post_visit( so_ui::so_node::leaf_ptr_t ) = 0 ; public: virtual void_t destroy( void_t ) = 0 ; }; } }
28.771429
81
0.526316
70546bb092dd9ef21d2ad8180fede525ac513348
90
c
C
gcc-gcc-7_3_0-release/gcc/testsuite/gcc.dg/pch/macro-1.c
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
llvm-gcc-4.2-2.9/gcc/testsuite/gcc.dg/pch/macro-1.c
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
null
null
null
llvm-gcc-4.2-2.9/gcc/testsuite/gcc.dg/pch/macro-1.c
vidkidz/crossbridge
ba0bf94aee0ce6cf7eb5be882382e52bc57ba396
[ "MIT" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
#include "macro-1.h" int main(void) { return DEFINED_VALUE + 1 - DEFINED_PARAM (3); }
12.857143
47
0.655556
4661c71a0ce6db823d9c23a390227067e77c2f0d
391
h
C
WindowArea.h
twtyypmb/DawnOfTheCircle
d56c314c916b8b8e500566c67c24f1b264515fa3
[ "libtiff", "BSD-3-Clause" ]
null
null
null
WindowArea.h
twtyypmb/DawnOfTheCircle
d56c314c916b8b8e500566c67c24f1b264515fa3
[ "libtiff", "BSD-3-Clause" ]
null
null
null
WindowArea.h
twtyypmb/DawnOfTheCircle
d56c314c916b8b8e500566c67c24f1b264515fa3
[ "libtiff", "BSD-3-Clause" ]
null
null
null
#ifndef WINDOW_AREA_H #define WINDOW_AREA_H #include <SDL_image.h> typedef void (* ClearFun)(void* _this); typedef struct { SDL_Surface* area; int window_number; int position[2]; int width_height[2]; ClearFun Clear; }WindowArea; typedef WindowArea* PWindowArea; PWindowArea NewWindowArea(); void FreeWindowArea(PWindowArea window_area); #endif // WINDOW_AREA_H
14.481481
45
0.736573
d7ecba37eb18e32bd3d0c20872237b0020f264c9
3,264
c
C
src/input.c
MartinezTorres/Edelweiss
ef7eeaa1b8262e85f708c672fbb3310a6912be0c
[ "MIT" ]
2
2021-01-20T13:12:31.000Z
2021-02-24T17:00:36.000Z
src/input.c
MartinezTorres/Edelweiss
ef7eeaa1b8262e85f708c672fbb3310a6912be0c
[ "MIT" ]
1
2021-04-07T20:19:37.000Z
2021-04-07T20:19:37.000Z
src/input.c
MartinezTorres/Edelweiss
ef7eeaa1b8262e85f708c672fbb3310a6912be0c
[ "MIT" ]
1
2021-02-24T17:00:43.000Z
2021-02-24T17:00:43.000Z
#include <common.h> uint8_t keyboard[16]; uint8_t keyboard_prev[16]; uint8_t keyboard_click[16]; #ifdef MSX void update_keyboard_and_joystick_placeholder() { __asm _update_keyboard_and_joystick:: ; Read keyboard lines 4 and 8 ld a, #0x04 call #0x0141 ; SNSMAT ld (_keyboard+0x04), a ; keyboard[4]; ld a, #0x08 call #0x0141 ; SNSMAT ld (_keyboard+0x08), a ; keyboard[8]; ; Read joystick status ld a,#15 ; read the joystick 1 status: call #0x0096; RDPSG and #0xbf ld e,a ld a,#15 call #0x0093; WRTPSG dec a call #0x0096; RDPSG ; a = -, -, B, A, right, left, down, up ; convert the joystick input to keyboard input ld c,a ; arrows/space: ld a, (_keyboard+0x08) ; keyboard[8]; di rr c jr c,read_joystick_noUp and #0xdf read_joystick_noUp: rr c jr c,read_joystick_noDown and #0xbf read_joystick_noDown: rr c jr c,read_joystick_noLeft and #0xef read_joystick_noLeft: rr c jr c,read_joystick_noRight and #0x7f read_joystick_noRight: rr c jr c,read_joystick_noA and #0xfe read_joystick_noA: ld (_keyboard+0x08),a ; we add the joystick input to the keyboard input ; m (button 2): ld a, (_keyboard+0x04) ; keyboard[4]; rr c jr c,read_joystick_noB and #0xfb read_joystick_noB: ld (_keyboard+0x04),a ; we add the joystick input to the keyboard input ; Calculate clicks; ld de, #_keyboard+0x04 ; keyboard[4]; ld a, (de) ld hl, #_keyboard_prev+0x04 ; keyboard_prev[4]; xor (hl) ; did it change? and (hl) ; was unpressed? ld (_keyboard_click+0x04), a ; keyboard_click[4]; ld a, (de) ld (hl), a ld de, #_keyboard+0x08 ; keyboard[8]; ld a, (de) ld hl, #_keyboard_prev+0x08 ; keyboard_prev[8]; xor (hl) ; did it change? and (hl) ; was unpressed? ld (_keyboard_click+0x08), a ; keyboard_click[8]; ld a, (de) ld (hl), a ret __endasm; } #else #include <SDL2/SDL.h> #define N_KEYS 8831 extern bool keys[N_KEYS]; void update_keyboard_and_joystick() { // 4; R, Q, P, O, N, M, L, K // 8; RIGHT, DOWN, UP, LEFT, DEL, INS, HOME, SPACE keyboard_prev[8] = keyboard[8]; keyboard[8] = 255; if (keys[SDLK_RIGHT % N_KEYS]) keyboard[8] -= K_RIGHT; if (keys[SDLK_DOWN % N_KEYS]) keyboard[8] -= K_DOWN; if (keys[SDLK_UP % N_KEYS]) keyboard[8] -= K_UP; if (keys[SDLK_LEFT % N_KEYS]) keyboard[8] -= K_LEFT; if (keys[SDLK_DELETE% N_KEYS]) keyboard[8] -= K_DEL; if (keys[SDLK_INSERT% N_KEYS]) keyboard[8] -= K_INS; if (keys[SDLK_HOME % N_KEYS]) keyboard[8] -= K_HOME; if (keys[SDLK_SPACE % N_KEYS]) keyboard[8] -= K_SPACE; keyboard_click[8] = (keyboard[8] ^ keyboard_prev[8]) & keyboard_prev[8]; keyboard_prev[4] = keyboard[4]; keyboard[4] = 255; if (keys[SDLK_r % N_KEYS]) keyboard[4] -= K_R; if (keys[SDLK_q % N_KEYS]) keyboard[4] -= K_Q; if (keys[SDLK_p % N_KEYS]) keyboard[4] -= K_P; if (keys[SDLK_o % N_KEYS]) keyboard[4] -= K_O; if (keys[SDLK_n % N_KEYS]) keyboard[4] -= K_N; if (keys[SDLK_m % N_KEYS]) keyboard[4] -= K_M; if (keys[SDLK_l % N_KEYS]) keyboard[4] -= K_L; if (keys[SDLK_k % N_KEYS]) keyboard[4] -= K_K; keyboard_click[4] = (keyboard[4] ^ keyboard_prev[4]) & keyboard_prev[4]; } #endif
21.615894
75
0.640931
6284f57be6e7410ccac273c6ba65a5d3af6feaf9
673
h
C
devrandom/queue.h
corytodd/devrandom
a5f19ea2f67ebd8d7813ec7de7082df7e95a4ad5
[ "MIT" ]
null
null
null
devrandom/queue.h
corytodd/devrandom
a5f19ea2f67ebd8d7813ec7de7082df7e95a4ad5
[ "MIT" ]
null
null
null
devrandom/queue.h
corytodd/devrandom
a5f19ea2f67ebd8d7813ec7de7082df7e95a4ad5
[ "MIT" ]
null
null
null
// // This is the context that can be placed per queue // and would contain per queue information. // typedef struct _QUEUE_CONTEXT { // Here we allocate a buffer from a test write so it can be read back PVOID Buffer; ULONG Length; // Virtual I/O WDFREQUEST CurrentRequest; NTSTATUS CurrentStatus; } QUEUE_CONTEXT, *PQUEUE_CONTEXT; WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(QUEUE_CONTEXT, QueueGetContext) NTSTATUS DevRandomQueueInitialize( WDFDEVICE hDevice ); EVT_WDF_IO_QUEUE_CONTEXT_DESTROY_CALLBACK DevRandomEvtIoQueueContextDestroy; // // Events from the IoQueue object // EVT_WDF_IO_QUEUE_IO_READ DevRandomEvtIoRead;
21.709677
76
0.753343
d12f225e1a5ec8ad82571f3c7c7b5b1795903b59
810
h
C
Mattwitter/Tweet.h
marenas/Mattwitter
8c7727659508192b85b892756f72d63e0343ca6a
[ "Apache-2.0" ]
null
null
null
Mattwitter/Tweet.h
marenas/Mattwitter
8c7727659508192b85b892756f72d63e0343ca6a
[ "Apache-2.0" ]
2
2015-11-10T04:23:01.000Z
2017-04-19T00:54:18.000Z
Mattwitter/Tweet.h
marenas/Mattwitter
8c7727659508192b85b892756f72d63e0343ca6a
[ "Apache-2.0" ]
null
null
null
// // Tweet.h // Mattwitter // // Created by Matias Arenas Sepulveda on 11/3/15. // Copyright © 2015 Matias Arenas Sepulveda. All rights reserved. // #import <Foundation/Foundation.h> #import "User.h" @interface Tweet : NSObject @property (nonatomic, strong) NSString *text; @property (nonatomic, strong) NSDate *createdAt; @property (nonatomic, strong) User *user; @property (nonatomic, strong) Tweet *retweetedTweet; @property (nonatomic) NSInteger retweetCount; @property (nonatomic) NSInteger favoriteCount; @property (nonatomic, strong) NSString *tweetId; @property (nonatomic, strong) NSNumber *favorited; @property (nonatomic, strong) NSNumber *retweeted; - (id)initWithDictionary:(NSDictionary *)dictionary; - (NSString *)hoursSinceTweet; + (NSArray *)tweetsWithArray:(NSArray *) array; @end
27
66
0.749383
2fb17d2a83c78113f6f4ed7966b1ac14695a2e7a
2,732
h
C
primitives/mq_time.h
douzzer/megaqueue
d22c9a02e300bbcc048396efbed7869805e4bc0d
[ "MIT" ]
2
2015-07-24T02:06:54.000Z
2015-08-05T01:02:45.000Z
primitives/mq_time.h
douzzer/megaqueue
d22c9a02e300bbcc048396efbed7869805e4bc0d
[ "MIT" ]
null
null
null
primitives/mq_time.h
douzzer/megaqueue
d22c9a02e300bbcc048396efbed7869805e4bc0d
[ "MIT" ]
null
null
null
/* MegaQueue * * Copyright 2015 Daniel Pouzzner * * mq_time.h 2015mar20 daniel.pouzzner@megaqueue.com * * time processing routines */ #ifndef MQ_TIME_H #define MQ_TIME_H #include <sys/time.h> #include <time.h> typedef int64_t MQ_Time_t; #define MQ_ONE_SECOND 1000000000L #define MQ_ONE_MINUTE 60000000000L #define MQ_NOWAITING 0L #define MQ_DEFAULTTIME 0x7fffffffffffffffL #define MQ_FOREVER 0x7ffffffffffffffeL extern __wur int64_t MQ_Time_Now(void); static __wur __always_inline int64_t MQ_Time_Now_inline(void) { struct timespec ts; if (clock_gettime(CLOCK_REALTIME,&ts)<0) { struct timeval tv; gettimeofday(&tv,0); return (int64_t)tv.tv_sec * 1000000000L + (int64_t)tv.tv_usec * 1000L; } else return (int64_t)ts.tv_sec * 1000000000L + (int64_t)ts.tv_nsec; } extern __wur int64_t MQ_Time_Now_Monotonic(void); static __wur __always_inline int64_t MQ_Time_Now_Monotonic_inline(void) { struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC,&ts)<0) { struct timeval tv; gettimeofday(&tv,0); return (int64_t)tv.tv_sec * 1000000000L + (int64_t)tv.tv_usec * 1000L; } else return (int64_t)ts.tv_sec * 1000000000L + (int64_t)ts.tv_nsec; } #if 0 /* glibc-2.21/nptl/pthread_cond_timedwait.c */ # ifdef __NR_clock_gettime INTERNAL_SYSCALL_DECL (err); (void) INTERNAL_VSYSCALL (clock_gettime, err, 2, (cond->__data.__nwaiters & ((1 << COND_NWAITERS_SHIFT) - 1)), &rt); /* Convert the absolute timeout value to a relative timeout. */ rt.tv_sec = abstime->tv_sec - rt.tv_sec; rt.tv_nsec = abstime->tv_nsec - rt.tv_nsec; # else /* Get the current time. So far we support only one clock. */ struct timeval tv; (void) __gettimeofday (&tv, NULL); /* Convert the absolute timeout value to a relative timeout. */ rt.tv_sec = abstime->tv_sec - tv.tv_sec; rt.tv_nsec = abstime->tv_nsec - tv.tv_usec * 1000; # endif #include <bits/libc-vdso.h> static __always_inline MQ_clock_gettime( INTERNAL_SYSCALL_DECL (err); (void) INTERNAL_VSYSCALL (clock_gettime, err, 2, (cond->__data.__nwaiters & ((1 << COND_NWAITERS_SHIFT) - 1)), &rt); static __wur __always_inline int64_t MQ_Time_Now() { struct timespec ts; if (clock_gettime(CLOCK_REALTIME,&ts)<0) { struct timeval tv; gettimeofday(&tv,0); return (int64_t)tv.tv_sec * 1000000000L + (int64_t)tv.tv_usec * 1000L; } else return (int64_t)ts.tv_sec * 1000000000L + (int64_t)ts.tv_nsec; } #endif #endif
28.757895
74
0.650439
0080bc28173e2d56c0e8b5b6a558ce8845494316
2,741
h
C
uC/Pinball_Controller_V0/Core/Inc/main.h
4lc0n/PinToWin
2340f6710558ff82d130679e885fdab28af93bb0
[ "MIT" ]
null
null
null
uC/Pinball_Controller_V0/Core/Inc/main.h
4lc0n/PinToWin
2340f6710558ff82d130679e885fdab28af93bb0
[ "MIT" ]
null
null
null
uC/Pinball_Controller_V0/Core/Inc/main.h
4lc0n/PinToWin
2340f6710558ff82d130679e885fdab28af93bb0
[ "MIT" ]
null
null
null
/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.h * @brief : Header for main.c file. * This file contains the common defines of the application. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2021 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ /* USER CODE END Header */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __MAIN_H #define __MAIN_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_hal.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ /* Exported types ------------------------------------------------------------*/ /* USER CODE BEGIN ET */ /* USER CODE END ET */ /* Exported constants --------------------------------------------------------*/ /* USER CODE BEGIN EC */ /* USER CODE END EC */ /* Exported macro ------------------------------------------------------------*/ /* USER CODE BEGIN EM */ /* USER CODE END EM */ void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim); /* Exported functions prototypes ---------------------------------------------*/ void Error_Handler(void); /* USER CODE BEGIN EFP */ /* USER CODE END EFP */ /* Private defines -----------------------------------------------------------*/ #define USER_LED_Pin GPIO_PIN_13 #define USER_LED_GPIO_Port GPIOC #define USER_BUTTON_Pin GPIO_PIN_0 #define USER_BUTTON_GPIO_Port GPIOA #define USER_BUTTON_EXTI_IRQn EXTI0_IRQn /* USER CODE BEGIN Private defines */ // ======= Defines for solenoid - task ======= #define MAX_PWM 19200 #define MAX_DUTY_CYCLE ((uint16_t)(MAX_PWM * 0.25)) typedef struct Solenoid_task_arguments{ TIM_HandleTypeDef *htimX; TIM_TypeDef *TIMX; unsigned timer_channel; volatile uint16_t *status_button; } Solenoid_task_argument; /* USER CODE END Private defines */ #ifdef __cplusplus } #endif #endif /* __MAIN_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
27.969388
81
0.479752
18fe43830984ea4e7d59954487a07fe664cc86c4
262
h
C
Cyano/Cyano/class/controller/identity/CTIdentityViewController.h
ontio-cyano/cyano-ios-oc-sdk
7cf25d0ccf7cb2754ef9ae9f976f092e5ae75347
[ "MIT" ]
null
null
null
Cyano/Cyano/class/controller/identity/CTIdentityViewController.h
ontio-cyano/cyano-ios-oc-sdk
7cf25d0ccf7cb2754ef9ae9f976f092e5ae75347
[ "MIT" ]
1
2019-02-22T02:57:21.000Z
2019-02-22T02:57:21.000Z
Cyano/Cyano/class/controller/identity/CTIdentityViewController.h
ontio-cyano/cyano-ios-oc-sdk
7cf25d0ccf7cb2754ef9ae9f976f092e5ae75347
[ "MIT" ]
1
2019-01-14T06:18:02.000Z
2019-01-14T06:18:02.000Z
// // CTIdentityViewController.h // Cyano // // Created by Yuanhai on 26/12/18. // Copyright © 2018年 Yuanhai. All rights reserved. // #import "CTParentNavigationViewController.h" @interface CTIdentityViewController : CTParentNavigationViewController @end
18.714286
70
0.759542
2882419a998bb9fea97da3a881326bba0c7481bf
555
c
C
gcc-gcc-7_3_0-release/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-27.c
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
7
2020-05-02T17:34:05.000Z
2021-10-17T10:15:18.000Z
gcc-gcc-7_3_0-release/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-27.c
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
null
null
null
gcc-gcc-7_3_0-release/gcc/testsuite/gcc.dg/tree-ssa/ssa-pre-27.c
best08618/asylo
5a520a9f5c461ede0f32acc284017b737a43898c
[ "Apache-2.0" ]
2
2020-07-27T00:22:36.000Z
2021-04-01T09:41:02.000Z
/* { dg-do compile } */ /* { dg-options "-O2 -fdump-tree-pre -fno-code-hoisting" } */ int foo (int i, int j, int b) { int res = 0; if (b) res = i/j; /* We should insert the possibly trapping i/j. */ res += i/j; return res; } extern void bar (void); int foo2 (int i, int j, int b) { int res = 0; if (b) res = i/j; /* And here, the possibly not returning call in the same basic-block comes after the trapping i/j. */ res += i/j; bar (); return res; } /* { dg-final { scan-tree-dump-times "# prephitmp" 2 "pre" } } */
19.821429
70
0.562162
930ce2130565652b13a29faaebbc8e273f324f59
950
h
C
src/quick_sort.h
skeid21/sorting
2dee1926e25d37e03acfcba147ba1d9c92458de0
[ "MIT" ]
null
null
null
src/quick_sort.h
skeid21/sorting
2dee1926e25d37e03acfcba147ba1d9c92458de0
[ "MIT" ]
null
null
null
src/quick_sort.h
skeid21/sorting
2dee1926e25d37e03acfcba147ba1d9c92458de0
[ "MIT" ]
null
null
null
template <typename RANDOM_ACCESS_ITR> RANDOM_ACCESS_ITR partition(RANDOM_ACCESS_ITR _first, RANDOM_ACCESS_ITR _last) { auto pivot = _last; auto low = _first; for (auto current = _first; current != _last; ++current) { if (*current < *pivot) { if (current != low) { std::swap(*current, *low); } low++; } } if (low != _last) { std::swap(*low,*_last); } return low; } template <typename RANDOM_ACCESS_ITR> void _quickSort(RANDOM_ACCESS_ITR _first, RANDOM_ACCESS_ITR _last) { if (_first >= _last) { return; } auto itr = partition(_first, _last); _quickSort(_first, itr-1); _quickSort(itr+1, _last); } template <typename RANDOM_ACCESS_ITR> void quickSort(RANDOM_ACCESS_ITR _first, RANDOM_ACCESS_ITR _last){ if (_first == _last){ return; } _quickSort(_first, _last-1); }
22.093023
78
0.588421
d25fd80f74c660cb6e9f125aa76605f01c32e3b8
2,705
h
C
C/AT-wifi/inc/hal_wifi.h
huyht1205/coding
6f046587faba107e99b007466fd6140c0de59574
[ "MIT" ]
null
null
null
C/AT-wifi/inc/hal_wifi.h
huyht1205/coding
6f046587faba107e99b007466fd6140c0de59574
[ "MIT" ]
null
null
null
C/AT-wifi/inc/hal_wifi.h
huyht1205/coding
6f046587faba107e99b007466fd6140c0de59574
[ "MIT" ]
null
null
null
#ifndef HAL_WIFI_H #define HAL_WIFI_H #ifdef __cplusplus extern "C" { #endif #include <stdint.h> #ifdef __arm__ #include "wifi_at_cmd.h" #else #include "wifi_posix_socket.h" #endif // __arm typedef enum { WIFI_OK = 0, WIFI_ERROR, WIFI_BUSY, } HAL_WifiStatus; #define MAX_CLIENT_NUM 9 /** * @brief Init a singleton server * * Execute all commands related to initializing a server instance. * * @param addr IN IP address or hostname, port number * @return HAL_WifiStatus */ HAL_WifiStatus HAL_WIFI_Server_init(const HAL_wifi_addr_t *const addr); /** * @brief Accept incoming connection * * Accept incoming connection and put new connection ID into an empty slot in a ring buffer. * This can be run forever to wait for new connections. * Ring buffer of connection ID is static allocation inside WiFi library. * * @param clientNum IN The maximum number of client can be accepted. * @return HAL_WifiStatus */ HAL_WifiStatus HAL_WIFI_Server_accept(const uint32_t clientNum); /** * @brief Create a client * * Execute all commands related to initializing a server instance. * Multi client can be created. * Since there most likely no way for user to perform disconnect except turn off the mic, * there is no need for a disconnect API. As a result, connect() is mixed into init(). * * @param serverAddr IN IP Address/hostname and port of server * @return HAL_WifiStatus */ HAL_WifiStatus HAL_WIFI_Client_init(const HAL_wifi_addr_t *const serverAddr); /** * @brief Logically transparent blocking send * * Although it's possible to use APIs from HAL_UART but to be more flexible, * it's better to have send() API in HAL_WIFI. * If buffer is bigger than 1 block that the WiFi module can handle, * this API will internally break it into blocks. * API user should not concern about block size limitation of the WiFi module. * * @param buf IN Sending buffer * @param bufSz IN Sending buffer size * @return HAL_WifiStatus */ HAL_WifiStatus HAL_WIFI_Send(uint8_t *const buf, const uint32_t bufSz); /** * @brief Logically transparent receive * * Although it's possible to use APIs from HAL_UART but to be more flexible, * it's better to have recv() API in HAL_WIFI. * TODO: * 1. Have an API to connect to UART interrupt. * 2. How to let the user know the ID of receiving connection for request-reply protocol. * * @param buf IN Receive buffer * @param bufSz IN Receive buffer size * @param recvSz OUT Number of received bytes * @return HAL_WifiStatus */ HAL_WifiStatus HAL_WIFI_Receive(uint8_t *const buf, const uint32_t bufSz, uint32_t *const recvSz); #ifdef __cplusplus } #endif #endif // HAL_WIFI_H
29.086022
98
0.733457
9a6e72a9b21ebfcb768bbbb0242fa65a0734d907
100,298
h
C
ev/external/googleapis/home/ubuntu/saaras-io/falcon/build/external/googleapis/google/storagetransfer/v1/transfer.pb.h
sergiorr/yastack
17cdc12a52ea5869f429aa8ec421c3d1d25b32e7
[ "Apache-2.0" ]
91
2018-11-24T05:33:58.000Z
2022-03-16T05:58:05.000Z
ev/external/googleapis/home/ubuntu/saaras-io/falcon/build/external/googleapis/google/storagetransfer/v1/transfer.pb.h
sergiorr/yastack
17cdc12a52ea5869f429aa8ec421c3d1d25b32e7
[ "Apache-2.0" ]
11
2019-06-02T23:50:17.000Z
2022-02-04T23:58:56.000Z
ev/external/googleapis/home/ubuntu/saaras-io/falcon/build/external/googleapis/google/storagetransfer/v1/transfer.pb.h
sergiorr/yastack
17cdc12a52ea5869f429aa8ec421c3d1d25b32e7
[ "Apache-2.0" ]
18
2018-11-24T10:35:29.000Z
2021-04-22T07:22:10.000Z
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/storagetransfer/v1/transfer.proto #ifndef PROTOBUF_google_2fstoragetransfer_2fv1_2ftransfer_2eproto__INCLUDED #define PROTOBUF_google_2fstoragetransfer_2fv1_2ftransfer_2eproto__INCLUDED #include <string> #include <google/protobuf/stubs/common.h> #if GOOGLE_PROTOBUF_VERSION < 3005000 #error This file was generated by a newer version of protoc which is #error incompatible with your Protocol Buffer headers. Please update #error your headers. #endif #if 3005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION #error This file was generated by an older version of protoc which is #error incompatible with your Protocol Buffer headers. Please #error regenerate this file with a newer version of protoc. #endif #include <google/protobuf/io/coded_stream.h> #include <google/protobuf/arena.h> #include <google/protobuf/arenastring.h> #include <google/protobuf/generated_message_table_driven.h> #include <google/protobuf/generated_message_util.h> #include <google/protobuf/metadata.h> #include <google/protobuf/message.h> #include <google/protobuf/repeated_field.h> // IWYU pragma: export #include <google/protobuf/extension_set.h> // IWYU pragma: export #include <google/protobuf/unknown_field_set.h> #include "google/api/annotations.pb.h" #include <google/protobuf/empty.pb.h> #include <google/protobuf/field_mask.pb.h> #include "google/storagetransfer/v1/transfer_types.pb.h" // @@protoc_insertion_point(includes) namespace protobuf_google_2fstoragetransfer_2fv1_2ftransfer_2eproto { // Internal implementation detail -- do not use these members. struct TableStruct { static const ::google::protobuf::internal::ParseTableField entries[]; static const ::google::protobuf::internal::AuxillaryParseTableField aux[]; static const ::google::protobuf::internal::ParseTable schema[8]; static const ::google::protobuf::internal::FieldMetadata field_metadata[]; static const ::google::protobuf::internal::SerializationTable serialization_table[]; static const ::google::protobuf::uint32 offsets[]; }; void AddDescriptors(); void InitDefaultsGetGoogleServiceAccountRequestImpl(); void InitDefaultsGetGoogleServiceAccountRequest(); void InitDefaultsCreateTransferJobRequestImpl(); void InitDefaultsCreateTransferJobRequest(); void InitDefaultsUpdateTransferJobRequestImpl(); void InitDefaultsUpdateTransferJobRequest(); void InitDefaultsGetTransferJobRequestImpl(); void InitDefaultsGetTransferJobRequest(); void InitDefaultsListTransferJobsRequestImpl(); void InitDefaultsListTransferJobsRequest(); void InitDefaultsListTransferJobsResponseImpl(); void InitDefaultsListTransferJobsResponse(); void InitDefaultsPauseTransferOperationRequestImpl(); void InitDefaultsPauseTransferOperationRequest(); void InitDefaultsResumeTransferOperationRequestImpl(); void InitDefaultsResumeTransferOperationRequest(); inline void InitDefaults() { InitDefaultsGetGoogleServiceAccountRequest(); InitDefaultsCreateTransferJobRequest(); InitDefaultsUpdateTransferJobRequest(); InitDefaultsGetTransferJobRequest(); InitDefaultsListTransferJobsRequest(); InitDefaultsListTransferJobsResponse(); InitDefaultsPauseTransferOperationRequest(); InitDefaultsResumeTransferOperationRequest(); } } // namespace protobuf_google_2fstoragetransfer_2fv1_2ftransfer_2eproto namespace google { namespace storagetransfer { namespace v1 { class CreateTransferJobRequest; class CreateTransferJobRequestDefaultTypeInternal; extern CreateTransferJobRequestDefaultTypeInternal _CreateTransferJobRequest_default_instance_; class GetGoogleServiceAccountRequest; class GetGoogleServiceAccountRequestDefaultTypeInternal; extern GetGoogleServiceAccountRequestDefaultTypeInternal _GetGoogleServiceAccountRequest_default_instance_; class GetTransferJobRequest; class GetTransferJobRequestDefaultTypeInternal; extern GetTransferJobRequestDefaultTypeInternal _GetTransferJobRequest_default_instance_; class ListTransferJobsRequest; class ListTransferJobsRequestDefaultTypeInternal; extern ListTransferJobsRequestDefaultTypeInternal _ListTransferJobsRequest_default_instance_; class ListTransferJobsResponse; class ListTransferJobsResponseDefaultTypeInternal; extern ListTransferJobsResponseDefaultTypeInternal _ListTransferJobsResponse_default_instance_; class PauseTransferOperationRequest; class PauseTransferOperationRequestDefaultTypeInternal; extern PauseTransferOperationRequestDefaultTypeInternal _PauseTransferOperationRequest_default_instance_; class ResumeTransferOperationRequest; class ResumeTransferOperationRequestDefaultTypeInternal; extern ResumeTransferOperationRequestDefaultTypeInternal _ResumeTransferOperationRequest_default_instance_; class UpdateTransferJobRequest; class UpdateTransferJobRequestDefaultTypeInternal; extern UpdateTransferJobRequestDefaultTypeInternal _UpdateTransferJobRequest_default_instance_; } // namespace v1 } // namespace storagetransfer } // namespace google namespace google { namespace storagetransfer { namespace v1 { // =================================================================== class GetGoogleServiceAccountRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.storagetransfer.v1.GetGoogleServiceAccountRequest) */ { public: GetGoogleServiceAccountRequest(); virtual ~GetGoogleServiceAccountRequest(); GetGoogleServiceAccountRequest(const GetGoogleServiceAccountRequest& from); inline GetGoogleServiceAccountRequest& operator=(const GetGoogleServiceAccountRequest& from) { CopyFrom(from); return *this; } #if LANG_CXX11 GetGoogleServiceAccountRequest(GetGoogleServiceAccountRequest&& from) noexcept : GetGoogleServiceAccountRequest() { *this = ::std::move(from); } inline GetGoogleServiceAccountRequest& operator=(GetGoogleServiceAccountRequest&& from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } return *this; } #endif inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { return GetArenaNoVirtual(); } inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { return MaybeArenaPtr(); } static const ::google::protobuf::Descriptor* descriptor(); static const GetGoogleServiceAccountRequest& default_instance(); static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const GetGoogleServiceAccountRequest* internal_default_instance() { return reinterpret_cast<const GetGoogleServiceAccountRequest*>( &_GetGoogleServiceAccountRequest_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 0; void UnsafeArenaSwap(GetGoogleServiceAccountRequest* other); void Swap(GetGoogleServiceAccountRequest* other); friend void swap(GetGoogleServiceAccountRequest& a, GetGoogleServiceAccountRequest& b) { a.Swap(&b); } // implements Message ---------------------------------------------- inline GetGoogleServiceAccountRequest* New() const PROTOBUF_FINAL { return New(NULL); } GetGoogleServiceAccountRequest* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL; void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; void CopyFrom(const GetGoogleServiceAccountRequest& from); void MergeFrom(const GetGoogleServiceAccountRequest& from); void Clear() PROTOBUF_FINAL; bool IsInitialized() const PROTOBUF_FINAL; size_t ByteSizeLong() const PROTOBUF_FINAL; bool MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL; void SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL; ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(GetGoogleServiceAccountRequest* other); protected: explicit GetGoogleServiceAccountRequest(::google::protobuf::Arena* arena); private: static void ArenaDtor(void* object); inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { return _internal_metadata_.raw_arena_ptr(); } public: ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // string project_id = 1; void clear_project_id(); static const int kProjectIdFieldNumber = 1; const ::std::string& project_id() const; void set_project_id(const ::std::string& value); #if LANG_CXX11 void set_project_id(::std::string&& value); #endif void set_project_id(const char* value); void set_project_id(const char* value, size_t size); ::std::string* mutable_project_id(); ::std::string* release_project_id(); void set_allocated_project_id(::std::string* project_id); PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" " string fields are deprecated and will be removed in a" " future release.") ::std::string* unsafe_arena_release_project_id(); PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" " string fields are deprecated and will be removed in a" " future release.") void unsafe_arena_set_allocated_project_id( ::std::string* project_id); // @@protoc_insertion_point(class_scope:google.storagetransfer.v1.GetGoogleServiceAccountRequest) private: ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; template <typename T> friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; ::google::protobuf::internal::ArenaStringPtr project_id_; mutable int _cached_size_; friend struct ::protobuf_google_2fstoragetransfer_2fv1_2ftransfer_2eproto::TableStruct; friend void ::protobuf_google_2fstoragetransfer_2fv1_2ftransfer_2eproto::InitDefaultsGetGoogleServiceAccountRequestImpl(); }; // ------------------------------------------------------------------- class CreateTransferJobRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.storagetransfer.v1.CreateTransferJobRequest) */ { public: CreateTransferJobRequest(); virtual ~CreateTransferJobRequest(); CreateTransferJobRequest(const CreateTransferJobRequest& from); inline CreateTransferJobRequest& operator=(const CreateTransferJobRequest& from) { CopyFrom(from); return *this; } #if LANG_CXX11 CreateTransferJobRequest(CreateTransferJobRequest&& from) noexcept : CreateTransferJobRequest() { *this = ::std::move(from); } inline CreateTransferJobRequest& operator=(CreateTransferJobRequest&& from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } return *this; } #endif inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { return GetArenaNoVirtual(); } inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { return MaybeArenaPtr(); } static const ::google::protobuf::Descriptor* descriptor(); static const CreateTransferJobRequest& default_instance(); static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const CreateTransferJobRequest* internal_default_instance() { return reinterpret_cast<const CreateTransferJobRequest*>( &_CreateTransferJobRequest_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 1; void UnsafeArenaSwap(CreateTransferJobRequest* other); void Swap(CreateTransferJobRequest* other); friend void swap(CreateTransferJobRequest& a, CreateTransferJobRequest& b) { a.Swap(&b); } // implements Message ---------------------------------------------- inline CreateTransferJobRequest* New() const PROTOBUF_FINAL { return New(NULL); } CreateTransferJobRequest* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL; void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; void CopyFrom(const CreateTransferJobRequest& from); void MergeFrom(const CreateTransferJobRequest& from); void Clear() PROTOBUF_FINAL; bool IsInitialized() const PROTOBUF_FINAL; size_t ByteSizeLong() const PROTOBUF_FINAL; bool MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL; void SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL; ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(CreateTransferJobRequest* other); protected: explicit CreateTransferJobRequest(::google::protobuf::Arena* arena); private: static void ArenaDtor(void* object); inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { return _internal_metadata_.raw_arena_ptr(); } public: ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // .google.storagetransfer.v1.TransferJob transfer_job = 1; bool has_transfer_job() const; void clear_transfer_job(); static const int kTransferJobFieldNumber = 1; private: void _slow_mutable_transfer_job(); public: const ::google::storagetransfer::v1::TransferJob& transfer_job() const; ::google::storagetransfer::v1::TransferJob* release_transfer_job(); ::google::storagetransfer::v1::TransferJob* mutable_transfer_job(); void set_allocated_transfer_job(::google::storagetransfer::v1::TransferJob* transfer_job); void unsafe_arena_set_allocated_transfer_job( ::google::storagetransfer::v1::TransferJob* transfer_job); ::google::storagetransfer::v1::TransferJob* unsafe_arena_release_transfer_job(); // @@protoc_insertion_point(class_scope:google.storagetransfer.v1.CreateTransferJobRequest) private: ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; template <typename T> friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; ::google::storagetransfer::v1::TransferJob* transfer_job_; mutable int _cached_size_; friend struct ::protobuf_google_2fstoragetransfer_2fv1_2ftransfer_2eproto::TableStruct; friend void ::protobuf_google_2fstoragetransfer_2fv1_2ftransfer_2eproto::InitDefaultsCreateTransferJobRequestImpl(); }; // ------------------------------------------------------------------- class UpdateTransferJobRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.storagetransfer.v1.UpdateTransferJobRequest) */ { public: UpdateTransferJobRequest(); virtual ~UpdateTransferJobRequest(); UpdateTransferJobRequest(const UpdateTransferJobRequest& from); inline UpdateTransferJobRequest& operator=(const UpdateTransferJobRequest& from) { CopyFrom(from); return *this; } #if LANG_CXX11 UpdateTransferJobRequest(UpdateTransferJobRequest&& from) noexcept : UpdateTransferJobRequest() { *this = ::std::move(from); } inline UpdateTransferJobRequest& operator=(UpdateTransferJobRequest&& from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } return *this; } #endif inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { return GetArenaNoVirtual(); } inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { return MaybeArenaPtr(); } static const ::google::protobuf::Descriptor* descriptor(); static const UpdateTransferJobRequest& default_instance(); static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const UpdateTransferJobRequest* internal_default_instance() { return reinterpret_cast<const UpdateTransferJobRequest*>( &_UpdateTransferJobRequest_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 2; void UnsafeArenaSwap(UpdateTransferJobRequest* other); void Swap(UpdateTransferJobRequest* other); friend void swap(UpdateTransferJobRequest& a, UpdateTransferJobRequest& b) { a.Swap(&b); } // implements Message ---------------------------------------------- inline UpdateTransferJobRequest* New() const PROTOBUF_FINAL { return New(NULL); } UpdateTransferJobRequest* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL; void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; void CopyFrom(const UpdateTransferJobRequest& from); void MergeFrom(const UpdateTransferJobRequest& from); void Clear() PROTOBUF_FINAL; bool IsInitialized() const PROTOBUF_FINAL; size_t ByteSizeLong() const PROTOBUF_FINAL; bool MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL; void SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL; ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(UpdateTransferJobRequest* other); protected: explicit UpdateTransferJobRequest(::google::protobuf::Arena* arena); private: static void ArenaDtor(void* object); inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { return _internal_metadata_.raw_arena_ptr(); } public: ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // string job_name = 1; void clear_job_name(); static const int kJobNameFieldNumber = 1; const ::std::string& job_name() const; void set_job_name(const ::std::string& value); #if LANG_CXX11 void set_job_name(::std::string&& value); #endif void set_job_name(const char* value); void set_job_name(const char* value, size_t size); ::std::string* mutable_job_name(); ::std::string* release_job_name(); void set_allocated_job_name(::std::string* job_name); PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" " string fields are deprecated and will be removed in a" " future release.") ::std::string* unsafe_arena_release_job_name(); PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" " string fields are deprecated and will be removed in a" " future release.") void unsafe_arena_set_allocated_job_name( ::std::string* job_name); // string project_id = 2; void clear_project_id(); static const int kProjectIdFieldNumber = 2; const ::std::string& project_id() const; void set_project_id(const ::std::string& value); #if LANG_CXX11 void set_project_id(::std::string&& value); #endif void set_project_id(const char* value); void set_project_id(const char* value, size_t size); ::std::string* mutable_project_id(); ::std::string* release_project_id(); void set_allocated_project_id(::std::string* project_id); PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" " string fields are deprecated and will be removed in a" " future release.") ::std::string* unsafe_arena_release_project_id(); PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" " string fields are deprecated and will be removed in a" " future release.") void unsafe_arena_set_allocated_project_id( ::std::string* project_id); // .google.storagetransfer.v1.TransferJob transfer_job = 3; bool has_transfer_job() const; void clear_transfer_job(); static const int kTransferJobFieldNumber = 3; private: void _slow_mutable_transfer_job(); public: const ::google::storagetransfer::v1::TransferJob& transfer_job() const; ::google::storagetransfer::v1::TransferJob* release_transfer_job(); ::google::storagetransfer::v1::TransferJob* mutable_transfer_job(); void set_allocated_transfer_job(::google::storagetransfer::v1::TransferJob* transfer_job); void unsafe_arena_set_allocated_transfer_job( ::google::storagetransfer::v1::TransferJob* transfer_job); ::google::storagetransfer::v1::TransferJob* unsafe_arena_release_transfer_job(); // .google.protobuf.FieldMask update_transfer_job_field_mask = 4; bool has_update_transfer_job_field_mask() const; void clear_update_transfer_job_field_mask(); static const int kUpdateTransferJobFieldMaskFieldNumber = 4; private: void _slow_mutable_update_transfer_job_field_mask(); public: const ::google::protobuf::FieldMask& update_transfer_job_field_mask() const; ::google::protobuf::FieldMask* release_update_transfer_job_field_mask(); ::google::protobuf::FieldMask* mutable_update_transfer_job_field_mask(); void set_allocated_update_transfer_job_field_mask(::google::protobuf::FieldMask* update_transfer_job_field_mask); void unsafe_arena_set_allocated_update_transfer_job_field_mask( ::google::protobuf::FieldMask* update_transfer_job_field_mask); ::google::protobuf::FieldMask* unsafe_arena_release_update_transfer_job_field_mask(); // @@protoc_insertion_point(class_scope:google.storagetransfer.v1.UpdateTransferJobRequest) private: ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; template <typename T> friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; ::google::protobuf::internal::ArenaStringPtr job_name_; ::google::protobuf::internal::ArenaStringPtr project_id_; ::google::storagetransfer::v1::TransferJob* transfer_job_; ::google::protobuf::FieldMask* update_transfer_job_field_mask_; mutable int _cached_size_; friend struct ::protobuf_google_2fstoragetransfer_2fv1_2ftransfer_2eproto::TableStruct; friend void ::protobuf_google_2fstoragetransfer_2fv1_2ftransfer_2eproto::InitDefaultsUpdateTransferJobRequestImpl(); }; // ------------------------------------------------------------------- class GetTransferJobRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.storagetransfer.v1.GetTransferJobRequest) */ { public: GetTransferJobRequest(); virtual ~GetTransferJobRequest(); GetTransferJobRequest(const GetTransferJobRequest& from); inline GetTransferJobRequest& operator=(const GetTransferJobRequest& from) { CopyFrom(from); return *this; } #if LANG_CXX11 GetTransferJobRequest(GetTransferJobRequest&& from) noexcept : GetTransferJobRequest() { *this = ::std::move(from); } inline GetTransferJobRequest& operator=(GetTransferJobRequest&& from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } return *this; } #endif inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { return GetArenaNoVirtual(); } inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { return MaybeArenaPtr(); } static const ::google::protobuf::Descriptor* descriptor(); static const GetTransferJobRequest& default_instance(); static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const GetTransferJobRequest* internal_default_instance() { return reinterpret_cast<const GetTransferJobRequest*>( &_GetTransferJobRequest_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 3; void UnsafeArenaSwap(GetTransferJobRequest* other); void Swap(GetTransferJobRequest* other); friend void swap(GetTransferJobRequest& a, GetTransferJobRequest& b) { a.Swap(&b); } // implements Message ---------------------------------------------- inline GetTransferJobRequest* New() const PROTOBUF_FINAL { return New(NULL); } GetTransferJobRequest* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL; void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; void CopyFrom(const GetTransferJobRequest& from); void MergeFrom(const GetTransferJobRequest& from); void Clear() PROTOBUF_FINAL; bool IsInitialized() const PROTOBUF_FINAL; size_t ByteSizeLong() const PROTOBUF_FINAL; bool MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL; void SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL; ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(GetTransferJobRequest* other); protected: explicit GetTransferJobRequest(::google::protobuf::Arena* arena); private: static void ArenaDtor(void* object); inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { return _internal_metadata_.raw_arena_ptr(); } public: ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // string job_name = 1; void clear_job_name(); static const int kJobNameFieldNumber = 1; const ::std::string& job_name() const; void set_job_name(const ::std::string& value); #if LANG_CXX11 void set_job_name(::std::string&& value); #endif void set_job_name(const char* value); void set_job_name(const char* value, size_t size); ::std::string* mutable_job_name(); ::std::string* release_job_name(); void set_allocated_job_name(::std::string* job_name); PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" " string fields are deprecated and will be removed in a" " future release.") ::std::string* unsafe_arena_release_job_name(); PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" " string fields are deprecated and will be removed in a" " future release.") void unsafe_arena_set_allocated_job_name( ::std::string* job_name); // string project_id = 2; void clear_project_id(); static const int kProjectIdFieldNumber = 2; const ::std::string& project_id() const; void set_project_id(const ::std::string& value); #if LANG_CXX11 void set_project_id(::std::string&& value); #endif void set_project_id(const char* value); void set_project_id(const char* value, size_t size); ::std::string* mutable_project_id(); ::std::string* release_project_id(); void set_allocated_project_id(::std::string* project_id); PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" " string fields are deprecated and will be removed in a" " future release.") ::std::string* unsafe_arena_release_project_id(); PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" " string fields are deprecated and will be removed in a" " future release.") void unsafe_arena_set_allocated_project_id( ::std::string* project_id); // @@protoc_insertion_point(class_scope:google.storagetransfer.v1.GetTransferJobRequest) private: ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; template <typename T> friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; ::google::protobuf::internal::ArenaStringPtr job_name_; ::google::protobuf::internal::ArenaStringPtr project_id_; mutable int _cached_size_; friend struct ::protobuf_google_2fstoragetransfer_2fv1_2ftransfer_2eproto::TableStruct; friend void ::protobuf_google_2fstoragetransfer_2fv1_2ftransfer_2eproto::InitDefaultsGetTransferJobRequestImpl(); }; // ------------------------------------------------------------------- class ListTransferJobsRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.storagetransfer.v1.ListTransferJobsRequest) */ { public: ListTransferJobsRequest(); virtual ~ListTransferJobsRequest(); ListTransferJobsRequest(const ListTransferJobsRequest& from); inline ListTransferJobsRequest& operator=(const ListTransferJobsRequest& from) { CopyFrom(from); return *this; } #if LANG_CXX11 ListTransferJobsRequest(ListTransferJobsRequest&& from) noexcept : ListTransferJobsRequest() { *this = ::std::move(from); } inline ListTransferJobsRequest& operator=(ListTransferJobsRequest&& from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } return *this; } #endif inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { return GetArenaNoVirtual(); } inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { return MaybeArenaPtr(); } static const ::google::protobuf::Descriptor* descriptor(); static const ListTransferJobsRequest& default_instance(); static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const ListTransferJobsRequest* internal_default_instance() { return reinterpret_cast<const ListTransferJobsRequest*>( &_ListTransferJobsRequest_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 4; void UnsafeArenaSwap(ListTransferJobsRequest* other); void Swap(ListTransferJobsRequest* other); friend void swap(ListTransferJobsRequest& a, ListTransferJobsRequest& b) { a.Swap(&b); } // implements Message ---------------------------------------------- inline ListTransferJobsRequest* New() const PROTOBUF_FINAL { return New(NULL); } ListTransferJobsRequest* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL; void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; void CopyFrom(const ListTransferJobsRequest& from); void MergeFrom(const ListTransferJobsRequest& from); void Clear() PROTOBUF_FINAL; bool IsInitialized() const PROTOBUF_FINAL; size_t ByteSizeLong() const PROTOBUF_FINAL; bool MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL; void SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL; ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(ListTransferJobsRequest* other); protected: explicit ListTransferJobsRequest(::google::protobuf::Arena* arena); private: static void ArenaDtor(void* object); inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { return _internal_metadata_.raw_arena_ptr(); } public: ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // string filter = 1; void clear_filter(); static const int kFilterFieldNumber = 1; const ::std::string& filter() const; void set_filter(const ::std::string& value); #if LANG_CXX11 void set_filter(::std::string&& value); #endif void set_filter(const char* value); void set_filter(const char* value, size_t size); ::std::string* mutable_filter(); ::std::string* release_filter(); void set_allocated_filter(::std::string* filter); PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" " string fields are deprecated and will be removed in a" " future release.") ::std::string* unsafe_arena_release_filter(); PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" " string fields are deprecated and will be removed in a" " future release.") void unsafe_arena_set_allocated_filter( ::std::string* filter); // string page_token = 5; void clear_page_token(); static const int kPageTokenFieldNumber = 5; const ::std::string& page_token() const; void set_page_token(const ::std::string& value); #if LANG_CXX11 void set_page_token(::std::string&& value); #endif void set_page_token(const char* value); void set_page_token(const char* value, size_t size); ::std::string* mutable_page_token(); ::std::string* release_page_token(); void set_allocated_page_token(::std::string* page_token); PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" " string fields are deprecated and will be removed in a" " future release.") ::std::string* unsafe_arena_release_page_token(); PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" " string fields are deprecated and will be removed in a" " future release.") void unsafe_arena_set_allocated_page_token( ::std::string* page_token); // int32 page_size = 4; void clear_page_size(); static const int kPageSizeFieldNumber = 4; ::google::protobuf::int32 page_size() const; void set_page_size(::google::protobuf::int32 value); // @@protoc_insertion_point(class_scope:google.storagetransfer.v1.ListTransferJobsRequest) private: ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; template <typename T> friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; ::google::protobuf::internal::ArenaStringPtr filter_; ::google::protobuf::internal::ArenaStringPtr page_token_; ::google::protobuf::int32 page_size_; mutable int _cached_size_; friend struct ::protobuf_google_2fstoragetransfer_2fv1_2ftransfer_2eproto::TableStruct; friend void ::protobuf_google_2fstoragetransfer_2fv1_2ftransfer_2eproto::InitDefaultsListTransferJobsRequestImpl(); }; // ------------------------------------------------------------------- class ListTransferJobsResponse : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.storagetransfer.v1.ListTransferJobsResponse) */ { public: ListTransferJobsResponse(); virtual ~ListTransferJobsResponse(); ListTransferJobsResponse(const ListTransferJobsResponse& from); inline ListTransferJobsResponse& operator=(const ListTransferJobsResponse& from) { CopyFrom(from); return *this; } #if LANG_CXX11 ListTransferJobsResponse(ListTransferJobsResponse&& from) noexcept : ListTransferJobsResponse() { *this = ::std::move(from); } inline ListTransferJobsResponse& operator=(ListTransferJobsResponse&& from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } return *this; } #endif inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { return GetArenaNoVirtual(); } inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { return MaybeArenaPtr(); } static const ::google::protobuf::Descriptor* descriptor(); static const ListTransferJobsResponse& default_instance(); static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const ListTransferJobsResponse* internal_default_instance() { return reinterpret_cast<const ListTransferJobsResponse*>( &_ListTransferJobsResponse_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 5; void UnsafeArenaSwap(ListTransferJobsResponse* other); void Swap(ListTransferJobsResponse* other); friend void swap(ListTransferJobsResponse& a, ListTransferJobsResponse& b) { a.Swap(&b); } // implements Message ---------------------------------------------- inline ListTransferJobsResponse* New() const PROTOBUF_FINAL { return New(NULL); } ListTransferJobsResponse* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL; void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; void CopyFrom(const ListTransferJobsResponse& from); void MergeFrom(const ListTransferJobsResponse& from); void Clear() PROTOBUF_FINAL; bool IsInitialized() const PROTOBUF_FINAL; size_t ByteSizeLong() const PROTOBUF_FINAL; bool MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL; void SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL; ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(ListTransferJobsResponse* other); protected: explicit ListTransferJobsResponse(::google::protobuf::Arena* arena); private: static void ArenaDtor(void* object); inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { return _internal_metadata_.raw_arena_ptr(); } public: ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // repeated .google.storagetransfer.v1.TransferJob transfer_jobs = 1; int transfer_jobs_size() const; void clear_transfer_jobs(); static const int kTransferJobsFieldNumber = 1; const ::google::storagetransfer::v1::TransferJob& transfer_jobs(int index) const; ::google::storagetransfer::v1::TransferJob* mutable_transfer_jobs(int index); ::google::storagetransfer::v1::TransferJob* add_transfer_jobs(); ::google::protobuf::RepeatedPtrField< ::google::storagetransfer::v1::TransferJob >* mutable_transfer_jobs(); const ::google::protobuf::RepeatedPtrField< ::google::storagetransfer::v1::TransferJob >& transfer_jobs() const; // string next_page_token = 2; void clear_next_page_token(); static const int kNextPageTokenFieldNumber = 2; const ::std::string& next_page_token() const; void set_next_page_token(const ::std::string& value); #if LANG_CXX11 void set_next_page_token(::std::string&& value); #endif void set_next_page_token(const char* value); void set_next_page_token(const char* value, size_t size); ::std::string* mutable_next_page_token(); ::std::string* release_next_page_token(); void set_allocated_next_page_token(::std::string* next_page_token); PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" " string fields are deprecated and will be removed in a" " future release.") ::std::string* unsafe_arena_release_next_page_token(); PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" " string fields are deprecated and will be removed in a" " future release.") void unsafe_arena_set_allocated_next_page_token( ::std::string* next_page_token); // @@protoc_insertion_point(class_scope:google.storagetransfer.v1.ListTransferJobsResponse) private: ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; template <typename T> friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; ::google::protobuf::RepeatedPtrField< ::google::storagetransfer::v1::TransferJob > transfer_jobs_; ::google::protobuf::internal::ArenaStringPtr next_page_token_; mutable int _cached_size_; friend struct ::protobuf_google_2fstoragetransfer_2fv1_2ftransfer_2eproto::TableStruct; friend void ::protobuf_google_2fstoragetransfer_2fv1_2ftransfer_2eproto::InitDefaultsListTransferJobsResponseImpl(); }; // ------------------------------------------------------------------- class PauseTransferOperationRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.storagetransfer.v1.PauseTransferOperationRequest) */ { public: PauseTransferOperationRequest(); virtual ~PauseTransferOperationRequest(); PauseTransferOperationRequest(const PauseTransferOperationRequest& from); inline PauseTransferOperationRequest& operator=(const PauseTransferOperationRequest& from) { CopyFrom(from); return *this; } #if LANG_CXX11 PauseTransferOperationRequest(PauseTransferOperationRequest&& from) noexcept : PauseTransferOperationRequest() { *this = ::std::move(from); } inline PauseTransferOperationRequest& operator=(PauseTransferOperationRequest&& from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } return *this; } #endif inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { return GetArenaNoVirtual(); } inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { return MaybeArenaPtr(); } static const ::google::protobuf::Descriptor* descriptor(); static const PauseTransferOperationRequest& default_instance(); static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const PauseTransferOperationRequest* internal_default_instance() { return reinterpret_cast<const PauseTransferOperationRequest*>( &_PauseTransferOperationRequest_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 6; void UnsafeArenaSwap(PauseTransferOperationRequest* other); void Swap(PauseTransferOperationRequest* other); friend void swap(PauseTransferOperationRequest& a, PauseTransferOperationRequest& b) { a.Swap(&b); } // implements Message ---------------------------------------------- inline PauseTransferOperationRequest* New() const PROTOBUF_FINAL { return New(NULL); } PauseTransferOperationRequest* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL; void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; void CopyFrom(const PauseTransferOperationRequest& from); void MergeFrom(const PauseTransferOperationRequest& from); void Clear() PROTOBUF_FINAL; bool IsInitialized() const PROTOBUF_FINAL; size_t ByteSizeLong() const PROTOBUF_FINAL; bool MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL; void SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL; ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(PauseTransferOperationRequest* other); protected: explicit PauseTransferOperationRequest(::google::protobuf::Arena* arena); private: static void ArenaDtor(void* object); inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { return _internal_metadata_.raw_arena_ptr(); } public: ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // string name = 1; void clear_name(); static const int kNameFieldNumber = 1; const ::std::string& name() const; void set_name(const ::std::string& value); #if LANG_CXX11 void set_name(::std::string&& value); #endif void set_name(const char* value); void set_name(const char* value, size_t size); ::std::string* mutable_name(); ::std::string* release_name(); void set_allocated_name(::std::string* name); PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" " string fields are deprecated and will be removed in a" " future release.") ::std::string* unsafe_arena_release_name(); PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" " string fields are deprecated and will be removed in a" " future release.") void unsafe_arena_set_allocated_name( ::std::string* name); // @@protoc_insertion_point(class_scope:google.storagetransfer.v1.PauseTransferOperationRequest) private: ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; template <typename T> friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; ::google::protobuf::internal::ArenaStringPtr name_; mutable int _cached_size_; friend struct ::protobuf_google_2fstoragetransfer_2fv1_2ftransfer_2eproto::TableStruct; friend void ::protobuf_google_2fstoragetransfer_2fv1_2ftransfer_2eproto::InitDefaultsPauseTransferOperationRequestImpl(); }; // ------------------------------------------------------------------- class ResumeTransferOperationRequest : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:google.storagetransfer.v1.ResumeTransferOperationRequest) */ { public: ResumeTransferOperationRequest(); virtual ~ResumeTransferOperationRequest(); ResumeTransferOperationRequest(const ResumeTransferOperationRequest& from); inline ResumeTransferOperationRequest& operator=(const ResumeTransferOperationRequest& from) { CopyFrom(from); return *this; } #if LANG_CXX11 ResumeTransferOperationRequest(ResumeTransferOperationRequest&& from) noexcept : ResumeTransferOperationRequest() { *this = ::std::move(from); } inline ResumeTransferOperationRequest& operator=(ResumeTransferOperationRequest&& from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } return *this; } #endif inline ::google::protobuf::Arena* GetArena() const PROTOBUF_FINAL { return GetArenaNoVirtual(); } inline void* GetMaybeArenaPointer() const PROTOBUF_FINAL { return MaybeArenaPtr(); } static const ::google::protobuf::Descriptor* descriptor(); static const ResumeTransferOperationRequest& default_instance(); static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const ResumeTransferOperationRequest* internal_default_instance() { return reinterpret_cast<const ResumeTransferOperationRequest*>( &_ResumeTransferOperationRequest_default_instance_); } static PROTOBUF_CONSTEXPR int const kIndexInFileMessages = 7; void UnsafeArenaSwap(ResumeTransferOperationRequest* other); void Swap(ResumeTransferOperationRequest* other); friend void swap(ResumeTransferOperationRequest& a, ResumeTransferOperationRequest& b) { a.Swap(&b); } // implements Message ---------------------------------------------- inline ResumeTransferOperationRequest* New() const PROTOBUF_FINAL { return New(NULL); } ResumeTransferOperationRequest* New(::google::protobuf::Arena* arena) const PROTOBUF_FINAL; void CopyFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; void MergeFrom(const ::google::protobuf::Message& from) PROTOBUF_FINAL; void CopyFrom(const ResumeTransferOperationRequest& from); void MergeFrom(const ResumeTransferOperationRequest& from); void Clear() PROTOBUF_FINAL; bool IsInitialized() const PROTOBUF_FINAL; size_t ByteSizeLong() const PROTOBUF_FINAL; bool MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) PROTOBUF_FINAL; void SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const PROTOBUF_FINAL; ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray( bool deterministic, ::google::protobuf::uint8* target) const PROTOBUF_FINAL; int GetCachedSize() const PROTOBUF_FINAL { return _cached_size_; } private: void SharedCtor(); void SharedDtor(); void SetCachedSize(int size) const PROTOBUF_FINAL; void InternalSwap(ResumeTransferOperationRequest* other); protected: explicit ResumeTransferOperationRequest(::google::protobuf::Arena* arena); private: static void ArenaDtor(void* object); inline void RegisterArenaDtor(::google::protobuf::Arena* arena); private: inline ::google::protobuf::Arena* GetArenaNoVirtual() const { return _internal_metadata_.arena(); } inline void* MaybeArenaPtr() const { return _internal_metadata_.raw_arena_ptr(); } public: ::google::protobuf::Metadata GetMetadata() const PROTOBUF_FINAL; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- // string name = 1; void clear_name(); static const int kNameFieldNumber = 1; const ::std::string& name() const; void set_name(const ::std::string& value); #if LANG_CXX11 void set_name(::std::string&& value); #endif void set_name(const char* value); void set_name(const char* value, size_t size); ::std::string* mutable_name(); ::std::string* release_name(); void set_allocated_name(::std::string* name); PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" " string fields are deprecated and will be removed in a" " future release.") ::std::string* unsafe_arena_release_name(); PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" " string fields are deprecated and will be removed in a" " future release.") void unsafe_arena_set_allocated_name( ::std::string* name); // @@protoc_insertion_point(class_scope:google.storagetransfer.v1.ResumeTransferOperationRequest) private: ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_; template <typename T> friend class ::google::protobuf::Arena::InternalHelper; typedef void InternalArenaConstructable_; typedef void DestructorSkippable_; ::google::protobuf::internal::ArenaStringPtr name_; mutable int _cached_size_; friend struct ::protobuf_google_2fstoragetransfer_2fv1_2ftransfer_2eproto::TableStruct; friend void ::protobuf_google_2fstoragetransfer_2fv1_2ftransfer_2eproto::InitDefaultsResumeTransferOperationRequestImpl(); }; // =================================================================== // =================================================================== #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" #endif // __GNUC__ // GetGoogleServiceAccountRequest // string project_id = 1; inline void GetGoogleServiceAccountRequest::clear_project_id() { project_id_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline const ::std::string& GetGoogleServiceAccountRequest::project_id() const { // @@protoc_insertion_point(field_get:google.storagetransfer.v1.GetGoogleServiceAccountRequest.project_id) return project_id_.Get(); } inline void GetGoogleServiceAccountRequest::set_project_id(const ::std::string& value) { project_id_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.storagetransfer.v1.GetGoogleServiceAccountRequest.project_id) } #if LANG_CXX11 inline void GetGoogleServiceAccountRequest::set_project_id(::std::string&& value) { project_id_.Set( &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.storagetransfer.v1.GetGoogleServiceAccountRequest.project_id) } #endif inline void GetGoogleServiceAccountRequest::set_project_id(const char* value) { GOOGLE_DCHECK(value != NULL); project_id_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.storagetransfer.v1.GetGoogleServiceAccountRequest.project_id) } inline void GetGoogleServiceAccountRequest::set_project_id(const char* value, size_t size) { project_id_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( reinterpret_cast<const char*>(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.storagetransfer.v1.GetGoogleServiceAccountRequest.project_id) } inline ::std::string* GetGoogleServiceAccountRequest::mutable_project_id() { // @@protoc_insertion_point(field_mutable:google.storagetransfer.v1.GetGoogleServiceAccountRequest.project_id) return project_id_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* GetGoogleServiceAccountRequest::release_project_id() { // @@protoc_insertion_point(field_release:google.storagetransfer.v1.GetGoogleServiceAccountRequest.project_id) return project_id_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void GetGoogleServiceAccountRequest::set_allocated_project_id(::std::string* project_id) { if (project_id != NULL) { } else { } project_id_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), project_id, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.storagetransfer.v1.GetGoogleServiceAccountRequest.project_id) } inline ::std::string* GetGoogleServiceAccountRequest::unsafe_arena_release_project_id() { // @@protoc_insertion_point(field_unsafe_arena_release:google.storagetransfer.v1.GetGoogleServiceAccountRequest.project_id) GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); return project_id_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void GetGoogleServiceAccountRequest::unsafe_arena_set_allocated_project_id( ::std::string* project_id) { GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); if (project_id != NULL) { } else { } project_id_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), project_id, GetArenaNoVirtual()); // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.storagetransfer.v1.GetGoogleServiceAccountRequest.project_id) } // ------------------------------------------------------------------- // CreateTransferJobRequest // .google.storagetransfer.v1.TransferJob transfer_job = 1; inline bool CreateTransferJobRequest::has_transfer_job() const { return this != internal_default_instance() && transfer_job_ != NULL; } inline const ::google::storagetransfer::v1::TransferJob& CreateTransferJobRequest::transfer_job() const { const ::google::storagetransfer::v1::TransferJob* p = transfer_job_; // @@protoc_insertion_point(field_get:google.storagetransfer.v1.CreateTransferJobRequest.transfer_job) return p != NULL ? *p : *reinterpret_cast<const ::google::storagetransfer::v1::TransferJob*>( &::google::storagetransfer::v1::_TransferJob_default_instance_); } inline ::google::storagetransfer::v1::TransferJob* CreateTransferJobRequest::release_transfer_job() { // @@protoc_insertion_point(field_release:google.storagetransfer.v1.CreateTransferJobRequest.transfer_job) ::google::storagetransfer::v1::TransferJob* temp = transfer_job_; if (GetArenaNoVirtual() != NULL) { temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL); } transfer_job_ = NULL; return temp; } inline ::google::storagetransfer::v1::TransferJob* CreateTransferJobRequest::unsafe_arena_release_transfer_job() { // @@protoc_insertion_point(field_unsafe_arena_release:google.storagetransfer.v1.CreateTransferJobRequest.transfer_job) ::google::storagetransfer::v1::TransferJob* temp = transfer_job_; transfer_job_ = NULL; return temp; } inline ::google::storagetransfer::v1::TransferJob* CreateTransferJobRequest::mutable_transfer_job() { if (transfer_job_ == NULL) { _slow_mutable_transfer_job(); } // @@protoc_insertion_point(field_mutable:google.storagetransfer.v1.CreateTransferJobRequest.transfer_job) return transfer_job_; } inline void CreateTransferJobRequest::set_allocated_transfer_job(::google::storagetransfer::v1::TransferJob* transfer_job) { ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); if (message_arena == NULL) { delete reinterpret_cast< ::google::protobuf::MessageLite*>(transfer_job_); } if (transfer_job) { ::google::protobuf::Arena* submessage_arena = reinterpret_cast< ::google::protobuf::MessageLite*>(transfer_job)->GetArena(); if (message_arena != submessage_arena) { transfer_job = ::google::protobuf::internal::GetOwnedMessage( message_arena, transfer_job, submessage_arena); } } else { } transfer_job_ = transfer_job; // @@protoc_insertion_point(field_set_allocated:google.storagetransfer.v1.CreateTransferJobRequest.transfer_job) } // ------------------------------------------------------------------- // UpdateTransferJobRequest // string job_name = 1; inline void UpdateTransferJobRequest::clear_job_name() { job_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline const ::std::string& UpdateTransferJobRequest::job_name() const { // @@protoc_insertion_point(field_get:google.storagetransfer.v1.UpdateTransferJobRequest.job_name) return job_name_.Get(); } inline void UpdateTransferJobRequest::set_job_name(const ::std::string& value) { job_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.storagetransfer.v1.UpdateTransferJobRequest.job_name) } #if LANG_CXX11 inline void UpdateTransferJobRequest::set_job_name(::std::string&& value) { job_name_.Set( &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.storagetransfer.v1.UpdateTransferJobRequest.job_name) } #endif inline void UpdateTransferJobRequest::set_job_name(const char* value) { GOOGLE_DCHECK(value != NULL); job_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.storagetransfer.v1.UpdateTransferJobRequest.job_name) } inline void UpdateTransferJobRequest::set_job_name(const char* value, size_t size) { job_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( reinterpret_cast<const char*>(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.storagetransfer.v1.UpdateTransferJobRequest.job_name) } inline ::std::string* UpdateTransferJobRequest::mutable_job_name() { // @@protoc_insertion_point(field_mutable:google.storagetransfer.v1.UpdateTransferJobRequest.job_name) return job_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* UpdateTransferJobRequest::release_job_name() { // @@protoc_insertion_point(field_release:google.storagetransfer.v1.UpdateTransferJobRequest.job_name) return job_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void UpdateTransferJobRequest::set_allocated_job_name(::std::string* job_name) { if (job_name != NULL) { } else { } job_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), job_name, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.storagetransfer.v1.UpdateTransferJobRequest.job_name) } inline ::std::string* UpdateTransferJobRequest::unsafe_arena_release_job_name() { // @@protoc_insertion_point(field_unsafe_arena_release:google.storagetransfer.v1.UpdateTransferJobRequest.job_name) GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); return job_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void UpdateTransferJobRequest::unsafe_arena_set_allocated_job_name( ::std::string* job_name) { GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); if (job_name != NULL) { } else { } job_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), job_name, GetArenaNoVirtual()); // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.storagetransfer.v1.UpdateTransferJobRequest.job_name) } // string project_id = 2; inline void UpdateTransferJobRequest::clear_project_id() { project_id_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline const ::std::string& UpdateTransferJobRequest::project_id() const { // @@protoc_insertion_point(field_get:google.storagetransfer.v1.UpdateTransferJobRequest.project_id) return project_id_.Get(); } inline void UpdateTransferJobRequest::set_project_id(const ::std::string& value) { project_id_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.storagetransfer.v1.UpdateTransferJobRequest.project_id) } #if LANG_CXX11 inline void UpdateTransferJobRequest::set_project_id(::std::string&& value) { project_id_.Set( &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.storagetransfer.v1.UpdateTransferJobRequest.project_id) } #endif inline void UpdateTransferJobRequest::set_project_id(const char* value) { GOOGLE_DCHECK(value != NULL); project_id_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.storagetransfer.v1.UpdateTransferJobRequest.project_id) } inline void UpdateTransferJobRequest::set_project_id(const char* value, size_t size) { project_id_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( reinterpret_cast<const char*>(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.storagetransfer.v1.UpdateTransferJobRequest.project_id) } inline ::std::string* UpdateTransferJobRequest::mutable_project_id() { // @@protoc_insertion_point(field_mutable:google.storagetransfer.v1.UpdateTransferJobRequest.project_id) return project_id_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* UpdateTransferJobRequest::release_project_id() { // @@protoc_insertion_point(field_release:google.storagetransfer.v1.UpdateTransferJobRequest.project_id) return project_id_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void UpdateTransferJobRequest::set_allocated_project_id(::std::string* project_id) { if (project_id != NULL) { } else { } project_id_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), project_id, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.storagetransfer.v1.UpdateTransferJobRequest.project_id) } inline ::std::string* UpdateTransferJobRequest::unsafe_arena_release_project_id() { // @@protoc_insertion_point(field_unsafe_arena_release:google.storagetransfer.v1.UpdateTransferJobRequest.project_id) GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); return project_id_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void UpdateTransferJobRequest::unsafe_arena_set_allocated_project_id( ::std::string* project_id) { GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); if (project_id != NULL) { } else { } project_id_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), project_id, GetArenaNoVirtual()); // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.storagetransfer.v1.UpdateTransferJobRequest.project_id) } // .google.storagetransfer.v1.TransferJob transfer_job = 3; inline bool UpdateTransferJobRequest::has_transfer_job() const { return this != internal_default_instance() && transfer_job_ != NULL; } inline const ::google::storagetransfer::v1::TransferJob& UpdateTransferJobRequest::transfer_job() const { const ::google::storagetransfer::v1::TransferJob* p = transfer_job_; // @@protoc_insertion_point(field_get:google.storagetransfer.v1.UpdateTransferJobRequest.transfer_job) return p != NULL ? *p : *reinterpret_cast<const ::google::storagetransfer::v1::TransferJob*>( &::google::storagetransfer::v1::_TransferJob_default_instance_); } inline ::google::storagetransfer::v1::TransferJob* UpdateTransferJobRequest::release_transfer_job() { // @@protoc_insertion_point(field_release:google.storagetransfer.v1.UpdateTransferJobRequest.transfer_job) ::google::storagetransfer::v1::TransferJob* temp = transfer_job_; if (GetArenaNoVirtual() != NULL) { temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL); } transfer_job_ = NULL; return temp; } inline ::google::storagetransfer::v1::TransferJob* UpdateTransferJobRequest::unsafe_arena_release_transfer_job() { // @@protoc_insertion_point(field_unsafe_arena_release:google.storagetransfer.v1.UpdateTransferJobRequest.transfer_job) ::google::storagetransfer::v1::TransferJob* temp = transfer_job_; transfer_job_ = NULL; return temp; } inline ::google::storagetransfer::v1::TransferJob* UpdateTransferJobRequest::mutable_transfer_job() { if (transfer_job_ == NULL) { _slow_mutable_transfer_job(); } // @@protoc_insertion_point(field_mutable:google.storagetransfer.v1.UpdateTransferJobRequest.transfer_job) return transfer_job_; } inline void UpdateTransferJobRequest::set_allocated_transfer_job(::google::storagetransfer::v1::TransferJob* transfer_job) { ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); if (message_arena == NULL) { delete reinterpret_cast< ::google::protobuf::MessageLite*>(transfer_job_); } if (transfer_job) { ::google::protobuf::Arena* submessage_arena = reinterpret_cast< ::google::protobuf::MessageLite*>(transfer_job)->GetArena(); if (message_arena != submessage_arena) { transfer_job = ::google::protobuf::internal::GetOwnedMessage( message_arena, transfer_job, submessage_arena); } } else { } transfer_job_ = transfer_job; // @@protoc_insertion_point(field_set_allocated:google.storagetransfer.v1.UpdateTransferJobRequest.transfer_job) } // .google.protobuf.FieldMask update_transfer_job_field_mask = 4; inline bool UpdateTransferJobRequest::has_update_transfer_job_field_mask() const { return this != internal_default_instance() && update_transfer_job_field_mask_ != NULL; } inline const ::google::protobuf::FieldMask& UpdateTransferJobRequest::update_transfer_job_field_mask() const { const ::google::protobuf::FieldMask* p = update_transfer_job_field_mask_; // @@protoc_insertion_point(field_get:google.storagetransfer.v1.UpdateTransferJobRequest.update_transfer_job_field_mask) return p != NULL ? *p : *reinterpret_cast<const ::google::protobuf::FieldMask*>( &::google::protobuf::_FieldMask_default_instance_); } inline ::google::protobuf::FieldMask* UpdateTransferJobRequest::release_update_transfer_job_field_mask() { // @@protoc_insertion_point(field_release:google.storagetransfer.v1.UpdateTransferJobRequest.update_transfer_job_field_mask) ::google::protobuf::FieldMask* temp = update_transfer_job_field_mask_; if (GetArenaNoVirtual() != NULL) { temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL); } update_transfer_job_field_mask_ = NULL; return temp; } inline ::google::protobuf::FieldMask* UpdateTransferJobRequest::unsafe_arena_release_update_transfer_job_field_mask() { // @@protoc_insertion_point(field_unsafe_arena_release:google.storagetransfer.v1.UpdateTransferJobRequest.update_transfer_job_field_mask) ::google::protobuf::FieldMask* temp = update_transfer_job_field_mask_; update_transfer_job_field_mask_ = NULL; return temp; } inline ::google::protobuf::FieldMask* UpdateTransferJobRequest::mutable_update_transfer_job_field_mask() { if (update_transfer_job_field_mask_ == NULL) { _slow_mutable_update_transfer_job_field_mask(); } // @@protoc_insertion_point(field_mutable:google.storagetransfer.v1.UpdateTransferJobRequest.update_transfer_job_field_mask) return update_transfer_job_field_mask_; } inline void UpdateTransferJobRequest::set_allocated_update_transfer_job_field_mask(::google::protobuf::FieldMask* update_transfer_job_field_mask) { ::google::protobuf::Arena* message_arena = GetArenaNoVirtual(); if (message_arena == NULL) { delete reinterpret_cast< ::google::protobuf::MessageLite*>(update_transfer_job_field_mask_); } if (update_transfer_job_field_mask) { ::google::protobuf::Arena* submessage_arena = NULL; if (message_arena != submessage_arena) { update_transfer_job_field_mask = ::google::protobuf::internal::GetOwnedMessage( message_arena, update_transfer_job_field_mask, submessage_arena); } } else { } update_transfer_job_field_mask_ = update_transfer_job_field_mask; // @@protoc_insertion_point(field_set_allocated:google.storagetransfer.v1.UpdateTransferJobRequest.update_transfer_job_field_mask) } // ------------------------------------------------------------------- // GetTransferJobRequest // string job_name = 1; inline void GetTransferJobRequest::clear_job_name() { job_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline const ::std::string& GetTransferJobRequest::job_name() const { // @@protoc_insertion_point(field_get:google.storagetransfer.v1.GetTransferJobRequest.job_name) return job_name_.Get(); } inline void GetTransferJobRequest::set_job_name(const ::std::string& value) { job_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.storagetransfer.v1.GetTransferJobRequest.job_name) } #if LANG_CXX11 inline void GetTransferJobRequest::set_job_name(::std::string&& value) { job_name_.Set( &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.storagetransfer.v1.GetTransferJobRequest.job_name) } #endif inline void GetTransferJobRequest::set_job_name(const char* value) { GOOGLE_DCHECK(value != NULL); job_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.storagetransfer.v1.GetTransferJobRequest.job_name) } inline void GetTransferJobRequest::set_job_name(const char* value, size_t size) { job_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( reinterpret_cast<const char*>(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.storagetransfer.v1.GetTransferJobRequest.job_name) } inline ::std::string* GetTransferJobRequest::mutable_job_name() { // @@protoc_insertion_point(field_mutable:google.storagetransfer.v1.GetTransferJobRequest.job_name) return job_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* GetTransferJobRequest::release_job_name() { // @@protoc_insertion_point(field_release:google.storagetransfer.v1.GetTransferJobRequest.job_name) return job_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void GetTransferJobRequest::set_allocated_job_name(::std::string* job_name) { if (job_name != NULL) { } else { } job_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), job_name, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.storagetransfer.v1.GetTransferJobRequest.job_name) } inline ::std::string* GetTransferJobRequest::unsafe_arena_release_job_name() { // @@protoc_insertion_point(field_unsafe_arena_release:google.storagetransfer.v1.GetTransferJobRequest.job_name) GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); return job_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void GetTransferJobRequest::unsafe_arena_set_allocated_job_name( ::std::string* job_name) { GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); if (job_name != NULL) { } else { } job_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), job_name, GetArenaNoVirtual()); // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.storagetransfer.v1.GetTransferJobRequest.job_name) } // string project_id = 2; inline void GetTransferJobRequest::clear_project_id() { project_id_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline const ::std::string& GetTransferJobRequest::project_id() const { // @@protoc_insertion_point(field_get:google.storagetransfer.v1.GetTransferJobRequest.project_id) return project_id_.Get(); } inline void GetTransferJobRequest::set_project_id(const ::std::string& value) { project_id_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.storagetransfer.v1.GetTransferJobRequest.project_id) } #if LANG_CXX11 inline void GetTransferJobRequest::set_project_id(::std::string&& value) { project_id_.Set( &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.storagetransfer.v1.GetTransferJobRequest.project_id) } #endif inline void GetTransferJobRequest::set_project_id(const char* value) { GOOGLE_DCHECK(value != NULL); project_id_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.storagetransfer.v1.GetTransferJobRequest.project_id) } inline void GetTransferJobRequest::set_project_id(const char* value, size_t size) { project_id_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( reinterpret_cast<const char*>(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.storagetransfer.v1.GetTransferJobRequest.project_id) } inline ::std::string* GetTransferJobRequest::mutable_project_id() { // @@protoc_insertion_point(field_mutable:google.storagetransfer.v1.GetTransferJobRequest.project_id) return project_id_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* GetTransferJobRequest::release_project_id() { // @@protoc_insertion_point(field_release:google.storagetransfer.v1.GetTransferJobRequest.project_id) return project_id_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void GetTransferJobRequest::set_allocated_project_id(::std::string* project_id) { if (project_id != NULL) { } else { } project_id_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), project_id, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.storagetransfer.v1.GetTransferJobRequest.project_id) } inline ::std::string* GetTransferJobRequest::unsafe_arena_release_project_id() { // @@protoc_insertion_point(field_unsafe_arena_release:google.storagetransfer.v1.GetTransferJobRequest.project_id) GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); return project_id_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void GetTransferJobRequest::unsafe_arena_set_allocated_project_id( ::std::string* project_id) { GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); if (project_id != NULL) { } else { } project_id_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), project_id, GetArenaNoVirtual()); // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.storagetransfer.v1.GetTransferJobRequest.project_id) } // ------------------------------------------------------------------- // ListTransferJobsRequest // string filter = 1; inline void ListTransferJobsRequest::clear_filter() { filter_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline const ::std::string& ListTransferJobsRequest::filter() const { // @@protoc_insertion_point(field_get:google.storagetransfer.v1.ListTransferJobsRequest.filter) return filter_.Get(); } inline void ListTransferJobsRequest::set_filter(const ::std::string& value) { filter_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.storagetransfer.v1.ListTransferJobsRequest.filter) } #if LANG_CXX11 inline void ListTransferJobsRequest::set_filter(::std::string&& value) { filter_.Set( &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.storagetransfer.v1.ListTransferJobsRequest.filter) } #endif inline void ListTransferJobsRequest::set_filter(const char* value) { GOOGLE_DCHECK(value != NULL); filter_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.storagetransfer.v1.ListTransferJobsRequest.filter) } inline void ListTransferJobsRequest::set_filter(const char* value, size_t size) { filter_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( reinterpret_cast<const char*>(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.storagetransfer.v1.ListTransferJobsRequest.filter) } inline ::std::string* ListTransferJobsRequest::mutable_filter() { // @@protoc_insertion_point(field_mutable:google.storagetransfer.v1.ListTransferJobsRequest.filter) return filter_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* ListTransferJobsRequest::release_filter() { // @@protoc_insertion_point(field_release:google.storagetransfer.v1.ListTransferJobsRequest.filter) return filter_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void ListTransferJobsRequest::set_allocated_filter(::std::string* filter) { if (filter != NULL) { } else { } filter_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), filter, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.storagetransfer.v1.ListTransferJobsRequest.filter) } inline ::std::string* ListTransferJobsRequest::unsafe_arena_release_filter() { // @@protoc_insertion_point(field_unsafe_arena_release:google.storagetransfer.v1.ListTransferJobsRequest.filter) GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); return filter_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void ListTransferJobsRequest::unsafe_arena_set_allocated_filter( ::std::string* filter) { GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); if (filter != NULL) { } else { } filter_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), filter, GetArenaNoVirtual()); // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.storagetransfer.v1.ListTransferJobsRequest.filter) } // int32 page_size = 4; inline void ListTransferJobsRequest::clear_page_size() { page_size_ = 0; } inline ::google::protobuf::int32 ListTransferJobsRequest::page_size() const { // @@protoc_insertion_point(field_get:google.storagetransfer.v1.ListTransferJobsRequest.page_size) return page_size_; } inline void ListTransferJobsRequest::set_page_size(::google::protobuf::int32 value) { page_size_ = value; // @@protoc_insertion_point(field_set:google.storagetransfer.v1.ListTransferJobsRequest.page_size) } // string page_token = 5; inline void ListTransferJobsRequest::clear_page_token() { page_token_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline const ::std::string& ListTransferJobsRequest::page_token() const { // @@protoc_insertion_point(field_get:google.storagetransfer.v1.ListTransferJobsRequest.page_token) return page_token_.Get(); } inline void ListTransferJobsRequest::set_page_token(const ::std::string& value) { page_token_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.storagetransfer.v1.ListTransferJobsRequest.page_token) } #if LANG_CXX11 inline void ListTransferJobsRequest::set_page_token(::std::string&& value) { page_token_.Set( &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.storagetransfer.v1.ListTransferJobsRequest.page_token) } #endif inline void ListTransferJobsRequest::set_page_token(const char* value) { GOOGLE_DCHECK(value != NULL); page_token_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.storagetransfer.v1.ListTransferJobsRequest.page_token) } inline void ListTransferJobsRequest::set_page_token(const char* value, size_t size) { page_token_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( reinterpret_cast<const char*>(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.storagetransfer.v1.ListTransferJobsRequest.page_token) } inline ::std::string* ListTransferJobsRequest::mutable_page_token() { // @@protoc_insertion_point(field_mutable:google.storagetransfer.v1.ListTransferJobsRequest.page_token) return page_token_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* ListTransferJobsRequest::release_page_token() { // @@protoc_insertion_point(field_release:google.storagetransfer.v1.ListTransferJobsRequest.page_token) return page_token_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void ListTransferJobsRequest::set_allocated_page_token(::std::string* page_token) { if (page_token != NULL) { } else { } page_token_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), page_token, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.storagetransfer.v1.ListTransferJobsRequest.page_token) } inline ::std::string* ListTransferJobsRequest::unsafe_arena_release_page_token() { // @@protoc_insertion_point(field_unsafe_arena_release:google.storagetransfer.v1.ListTransferJobsRequest.page_token) GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); return page_token_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void ListTransferJobsRequest::unsafe_arena_set_allocated_page_token( ::std::string* page_token) { GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); if (page_token != NULL) { } else { } page_token_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), page_token, GetArenaNoVirtual()); // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.storagetransfer.v1.ListTransferJobsRequest.page_token) } // ------------------------------------------------------------------- // ListTransferJobsResponse // repeated .google.storagetransfer.v1.TransferJob transfer_jobs = 1; inline int ListTransferJobsResponse::transfer_jobs_size() const { return transfer_jobs_.size(); } inline const ::google::storagetransfer::v1::TransferJob& ListTransferJobsResponse::transfer_jobs(int index) const { // @@protoc_insertion_point(field_get:google.storagetransfer.v1.ListTransferJobsResponse.transfer_jobs) return transfer_jobs_.Get(index); } inline ::google::storagetransfer::v1::TransferJob* ListTransferJobsResponse::mutable_transfer_jobs(int index) { // @@protoc_insertion_point(field_mutable:google.storagetransfer.v1.ListTransferJobsResponse.transfer_jobs) return transfer_jobs_.Mutable(index); } inline ::google::storagetransfer::v1::TransferJob* ListTransferJobsResponse::add_transfer_jobs() { // @@protoc_insertion_point(field_add:google.storagetransfer.v1.ListTransferJobsResponse.transfer_jobs) return transfer_jobs_.Add(); } inline ::google::protobuf::RepeatedPtrField< ::google::storagetransfer::v1::TransferJob >* ListTransferJobsResponse::mutable_transfer_jobs() { // @@protoc_insertion_point(field_mutable_list:google.storagetransfer.v1.ListTransferJobsResponse.transfer_jobs) return &transfer_jobs_; } inline const ::google::protobuf::RepeatedPtrField< ::google::storagetransfer::v1::TransferJob >& ListTransferJobsResponse::transfer_jobs() const { // @@protoc_insertion_point(field_list:google.storagetransfer.v1.ListTransferJobsResponse.transfer_jobs) return transfer_jobs_; } // string next_page_token = 2; inline void ListTransferJobsResponse::clear_next_page_token() { next_page_token_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline const ::std::string& ListTransferJobsResponse::next_page_token() const { // @@protoc_insertion_point(field_get:google.storagetransfer.v1.ListTransferJobsResponse.next_page_token) return next_page_token_.Get(); } inline void ListTransferJobsResponse::set_next_page_token(const ::std::string& value) { next_page_token_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.storagetransfer.v1.ListTransferJobsResponse.next_page_token) } #if LANG_CXX11 inline void ListTransferJobsResponse::set_next_page_token(::std::string&& value) { next_page_token_.Set( &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.storagetransfer.v1.ListTransferJobsResponse.next_page_token) } #endif inline void ListTransferJobsResponse::set_next_page_token(const char* value) { GOOGLE_DCHECK(value != NULL); next_page_token_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.storagetransfer.v1.ListTransferJobsResponse.next_page_token) } inline void ListTransferJobsResponse::set_next_page_token(const char* value, size_t size) { next_page_token_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( reinterpret_cast<const char*>(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.storagetransfer.v1.ListTransferJobsResponse.next_page_token) } inline ::std::string* ListTransferJobsResponse::mutable_next_page_token() { // @@protoc_insertion_point(field_mutable:google.storagetransfer.v1.ListTransferJobsResponse.next_page_token) return next_page_token_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* ListTransferJobsResponse::release_next_page_token() { // @@protoc_insertion_point(field_release:google.storagetransfer.v1.ListTransferJobsResponse.next_page_token) return next_page_token_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void ListTransferJobsResponse::set_allocated_next_page_token(::std::string* next_page_token) { if (next_page_token != NULL) { } else { } next_page_token_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), next_page_token, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.storagetransfer.v1.ListTransferJobsResponse.next_page_token) } inline ::std::string* ListTransferJobsResponse::unsafe_arena_release_next_page_token() { // @@protoc_insertion_point(field_unsafe_arena_release:google.storagetransfer.v1.ListTransferJobsResponse.next_page_token) GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); return next_page_token_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void ListTransferJobsResponse::unsafe_arena_set_allocated_next_page_token( ::std::string* next_page_token) { GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); if (next_page_token != NULL) { } else { } next_page_token_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), next_page_token, GetArenaNoVirtual()); // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.storagetransfer.v1.ListTransferJobsResponse.next_page_token) } // ------------------------------------------------------------------- // PauseTransferOperationRequest // string name = 1; inline void PauseTransferOperationRequest::clear_name() { name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline const ::std::string& PauseTransferOperationRequest::name() const { // @@protoc_insertion_point(field_get:google.storagetransfer.v1.PauseTransferOperationRequest.name) return name_.Get(); } inline void PauseTransferOperationRequest::set_name(const ::std::string& value) { name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.storagetransfer.v1.PauseTransferOperationRequest.name) } #if LANG_CXX11 inline void PauseTransferOperationRequest::set_name(::std::string&& value) { name_.Set( &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.storagetransfer.v1.PauseTransferOperationRequest.name) } #endif inline void PauseTransferOperationRequest::set_name(const char* value) { GOOGLE_DCHECK(value != NULL); name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.storagetransfer.v1.PauseTransferOperationRequest.name) } inline void PauseTransferOperationRequest::set_name(const char* value, size_t size) { name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( reinterpret_cast<const char*>(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.storagetransfer.v1.PauseTransferOperationRequest.name) } inline ::std::string* PauseTransferOperationRequest::mutable_name() { // @@protoc_insertion_point(field_mutable:google.storagetransfer.v1.PauseTransferOperationRequest.name) return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* PauseTransferOperationRequest::release_name() { // @@protoc_insertion_point(field_release:google.storagetransfer.v1.PauseTransferOperationRequest.name) return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void PauseTransferOperationRequest::set_allocated_name(::std::string* name) { if (name != NULL) { } else { } name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.storagetransfer.v1.PauseTransferOperationRequest.name) } inline ::std::string* PauseTransferOperationRequest::unsafe_arena_release_name() { // @@protoc_insertion_point(field_unsafe_arena_release:google.storagetransfer.v1.PauseTransferOperationRequest.name) GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void PauseTransferOperationRequest::unsafe_arena_set_allocated_name( ::std::string* name) { GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); if (name != NULL) { } else { } name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, GetArenaNoVirtual()); // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.storagetransfer.v1.PauseTransferOperationRequest.name) } // ------------------------------------------------------------------- // ResumeTransferOperationRequest // string name = 1; inline void ResumeTransferOperationRequest::clear_name() { name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline const ::std::string& ResumeTransferOperationRequest::name() const { // @@protoc_insertion_point(field_get:google.storagetransfer.v1.ResumeTransferOperationRequest.name) return name_.Get(); } inline void ResumeTransferOperationRequest::set_name(const ::std::string& value) { name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set:google.storagetransfer.v1.ResumeTransferOperationRequest.name) } #if LANG_CXX11 inline void ResumeTransferOperationRequest::set_name(::std::string&& value) { name_.Set( &::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_rvalue:google.storagetransfer.v1.ResumeTransferOperationRequest.name) } #endif inline void ResumeTransferOperationRequest::set_name(const char* value) { GOOGLE_DCHECK(value != NULL); name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_char:google.storagetransfer.v1.ResumeTransferOperationRequest.name) } inline void ResumeTransferOperationRequest::set_name(const char* value, size_t size) { name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string( reinterpret_cast<const char*>(value), size), GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_pointer:google.storagetransfer.v1.ResumeTransferOperationRequest.name) } inline ::std::string* ResumeTransferOperationRequest::mutable_name() { // @@protoc_insertion_point(field_mutable:google.storagetransfer.v1.ResumeTransferOperationRequest.name) return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline ::std::string* ResumeTransferOperationRequest::release_name() { // @@protoc_insertion_point(field_release:google.storagetransfer.v1.ResumeTransferOperationRequest.name) return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void ResumeTransferOperationRequest::set_allocated_name(::std::string* name) { if (name != NULL) { } else { } name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, GetArenaNoVirtual()); // @@protoc_insertion_point(field_set_allocated:google.storagetransfer.v1.ResumeTransferOperationRequest.name) } inline ::std::string* ResumeTransferOperationRequest::unsafe_arena_release_name() { // @@protoc_insertion_point(field_unsafe_arena_release:google.storagetransfer.v1.ResumeTransferOperationRequest.name) GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual()); } inline void ResumeTransferOperationRequest::unsafe_arena_set_allocated_name( ::std::string* name) { GOOGLE_DCHECK(GetArenaNoVirtual() != NULL); if (name != NULL) { } else { } name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name, GetArenaNoVirtual()); // @@protoc_insertion_point(field_unsafe_arena_set_allocated:google.storagetransfer.v1.ResumeTransferOperationRequest.name) } #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ // ------------------------------------------------------------------- // ------------------------------------------------------------------- // ------------------------------------------------------------------- // ------------------------------------------------------------------- // ------------------------------------------------------------------- // ------------------------------------------------------------------- // ------------------------------------------------------------------- // @@protoc_insertion_point(namespace_scope) } // namespace v1 } // namespace storagetransfer } // namespace google // @@protoc_insertion_point(global_scope) #endif // PROTOBUF_google_2fstoragetransfer_2fv1_2ftransfer_2eproto__INCLUDED
43.702832
181
0.753215
82a98ddc5b99a2ae7a882dac39cf95a6404d557b
6,678
h
C
Office-ProPlus-Deployment/Microsoft.ProPlus.InstallGenerator/Microsoft.OfficeProPlus.MSIGenerator/Wix_bin/SDK/inc/IBootstrapperEngine.h
cvvamsi/Office-IT-Pro-Deployment-Scripts
e0283abbde0f5d322403acc4868c3d3c57b50c8e
[ "MIT" ]
9
2016-01-27T14:46:09.000Z
2020-03-10T21:00:20.000Z
Office-ProPlus-Deployment/Microsoft.ProPlus.InstallGenerator/Microsoft.OfficeProPlus.MSIGenerator/Wix_bin/SDK/inc/IBootstrapperEngine.h
golfkinguk/Office-IT-Pro-Deployment-Scripts
e0283abbde0f5d322403acc4868c3d3c57b50c8e
[ "MIT" ]
1
2020-12-22T08:11:32.000Z
2020-12-22T08:11:32.000Z
Office-ProPlus-Deployment/Microsoft.ProPlus.InstallGenerator/Microsoft.OfficeProPlus.MSIGenerator/Wix_bin/SDK/inc/IBootstrapperEngine.h
golfkinguk/Office-IT-Pro-Deployment-Scripts
e0283abbde0f5d322403acc4868c3d3c57b50c8e
[ "MIT" ]
6
2019-11-03T11:56:46.000Z
2020-08-05T15:03:28.000Z
//------------------------------------------------------------------------------------------------- // <copyright file="IBootstrapperEngine.h" company="Outercurve Foundation"> // Copyright (c) 2004, Outercurve Foundation. // This software is released under Microsoft Reciprocal License (MS-RL). // The license and further copyright text can be found in the file // LICENSE.TXT at the root directory of the distribution. // </copyright> // // <summary> // IBoostrapperEngine implemented by engine and used by bootstrapper application. // </summary> //------------------------------------------------------------------------------------------------- #pragma once #define IDERROR -1 #define IDNOACTION 0 #define IDDOWNLOAD 101 // Only valid as a return code from OnResolveSource() to instruct the engine to use the download source. #define IDRESTART 102 #define IDSUSPEND 103 #define IDRELOAD_BOOTSTRAPPER 104 // Note that ordering of the enumeration values is important. // Some code paths use < or > comparisions and simply reording values will break those comparisons. enum BOOTSTRAPPER_ACTION { BOOTSTRAPPER_ACTION_UNKNOWN, BOOTSTRAPPER_ACTION_HELP, BOOTSTRAPPER_ACTION_LAYOUT, BOOTSTRAPPER_ACTION_UNINSTALL, BOOTSTRAPPER_ACTION_CACHE, BOOTSTRAPPER_ACTION_INSTALL, BOOTSTRAPPER_ACTION_MODIFY, BOOTSTRAPPER_ACTION_REPAIR, BOOTSTRAPPER_ACTION_UPDATE_REPLACE, BOOTSTRAPPER_ACTION_UPDATE_REPLACE_EMBEDDED, }; enum BOOTSTRAPPER_ACTION_STATE { BOOTSTRAPPER_ACTION_STATE_NONE, BOOTSTRAPPER_ACTION_STATE_UNINSTALL, BOOTSTRAPPER_ACTION_STATE_INSTALL, BOOTSTRAPPER_ACTION_STATE_ADMIN_INSTALL, BOOTSTRAPPER_ACTION_STATE_MODIFY, BOOTSTRAPPER_ACTION_STATE_REPAIR, BOOTSTRAPPER_ACTION_STATE_MINOR_UPGRADE, BOOTSTRAPPER_ACTION_STATE_MAJOR_UPGRADE, BOOTSTRAPPER_ACTION_STATE_PATCH, }; enum BOOTSTRAPPER_PACKAGE_STATE { BOOTSTRAPPER_PACKAGE_STATE_UNKNOWN, BOOTSTRAPPER_PACKAGE_STATE_OBSOLETE, BOOTSTRAPPER_PACKAGE_STATE_ABSENT, BOOTSTRAPPER_PACKAGE_STATE_CACHED, BOOTSTRAPPER_PACKAGE_STATE_PRESENT, BOOTSTRAPPER_PACKAGE_STATE_SUPERSEDED, }; enum BOOTSTRAPPER_REQUEST_STATE { BOOTSTRAPPER_REQUEST_STATE_NONE, BOOTSTRAPPER_REQUEST_STATE_FORCE_ABSENT, BOOTSTRAPPER_REQUEST_STATE_ABSENT, BOOTSTRAPPER_REQUEST_STATE_CACHE, BOOTSTRAPPER_REQUEST_STATE_PRESENT, BOOTSTRAPPER_REQUEST_STATE_REPAIR, }; enum BOOTSTRAPPER_FEATURE_STATE { BOOTSTRAPPER_FEATURE_STATE_UNKNOWN, BOOTSTRAPPER_FEATURE_STATE_ABSENT, BOOTSTRAPPER_FEATURE_STATE_ADVERTISED, BOOTSTRAPPER_FEATURE_STATE_LOCAL, BOOTSTRAPPER_FEATURE_STATE_SOURCE, }; enum BOOTSTRAPPER_FEATURE_ACTION { BOOTSTRAPPER_FEATURE_ACTION_NONE, BOOTSTRAPPER_FEATURE_ACTION_ADDLOCAL, BOOTSTRAPPER_FEATURE_ACTION_ADDSOURCE, BOOTSTRAPPER_FEATURE_ACTION_ADDDEFAULT, BOOTSTRAPPER_FEATURE_ACTION_REINSTALL, BOOTSTRAPPER_FEATURE_ACTION_ADVERTISE, BOOTSTRAPPER_FEATURE_ACTION_REMOVE, }; enum BOOTSTRAPPER_LOG_LEVEL { BOOTSTRAPPER_LOG_LEVEL_NONE, // turns off report (only valid for XXXSetLevel()) BOOTSTRAPPER_LOG_LEVEL_STANDARD, // written if reporting is on BOOTSTRAPPER_LOG_LEVEL_VERBOSE, // written only if verbose reporting is on BOOTSTRAPPER_LOG_LEVEL_DEBUG, // reporting useful when debugging code BOOTSTRAPPER_LOG_LEVEL_ERROR, // always gets reported, but can never be specified }; enum BOOTSTRAPPER_UPDATE_HASH_TYPE { BOOTSTRAPPER_UPDATE_HASH_TYPE_NONE, BOOTSTRAPPER_UPDATE_HASH_TYPE_SHA1, }; DECLARE_INTERFACE_IID_(IBootstrapperEngine, IUnknown, "6480D616-27A0-44D7-905B-81512C29C2FB") { STDMETHOD(GetPackageCount)( __out DWORD* pcPackages ) = 0; STDMETHOD(GetVariableNumeric)( __in_z LPCWSTR wzVariable, __out LONGLONG* pllValue ) = 0; STDMETHOD(GetVariableString)( __in_z LPCWSTR wzVariable, __out_ecount_opt(*pcchValue) LPWSTR wzValue, __inout DWORD* pcchValue ) = 0; STDMETHOD(GetVariableVersion)( __in_z LPCWSTR wzVariable, __out DWORD64* pqwValue ) = 0; STDMETHOD(FormatString)( __in_z LPCWSTR wzIn, __out_ecount_opt(*pcchOut) LPWSTR wzOut, __inout DWORD* pcchOut ) = 0; STDMETHOD(EscapeString)( __in_z LPCWSTR wzIn, __out_ecount_opt(*pcchOut) LPWSTR wzOut, __inout DWORD* pcchOut ) = 0; STDMETHOD(EvaluateCondition)( __in_z LPCWSTR wzCondition, __out BOOL* pf ) = 0; STDMETHOD(Log)( __in BOOTSTRAPPER_LOG_LEVEL level, __in_z LPCWSTR wzMessage ) = 0; STDMETHOD(SendEmbeddedError)( __in DWORD dwErrorCode, __in_z_opt LPCWSTR wzMessage, __in DWORD dwUIHint, __out int* pnResult ) = 0; STDMETHOD(SendEmbeddedProgress)( __in DWORD dwProgressPercentage, __in DWORD dwOverallProgressPercentage, __out int* pnResult ) = 0; STDMETHOD(SetUpdate)( __in_z_opt LPCWSTR wzLocalSource, __in_z_opt LPCWSTR wzDownloadSource, __in DWORD64 qwSize, __in BOOTSTRAPPER_UPDATE_HASH_TYPE hashType, __in_bcount_opt(cbHash) BYTE* rgbHash, __in DWORD cbHash ) = 0; STDMETHOD(SetLocalSource)( __in_z LPCWSTR wzPackageOrContainerId, __in_z_opt LPCWSTR wzPayloadId, __in_z LPCWSTR wzPath ) = 0; STDMETHOD(SetDownloadSource)( __in_z LPCWSTR wzPackageOrContainerId, __in_z_opt LPCWSTR wzPayloadId, __in_z LPCWSTR wzUrl, __in_z_opt LPWSTR wzUser, __in_z_opt LPWSTR wzPassword ) = 0; STDMETHOD(SetVariableNumeric)( __in_z LPCWSTR wzVariable, __in LONGLONG llValue ) = 0; STDMETHOD(SetVariableString)( __in_z LPCWSTR wzVariable, __in_z_opt LPCWSTR wzValue ) = 0; STDMETHOD(SetVariableVersion)( __in_z LPCWSTR wzVariable, __in DWORD64 qwValue ) = 0; STDMETHOD(CloseSplashScreen)() = 0; STDMETHOD(Detect)( __in_opt HWND hwndParent = NULL ) = 0; STDMETHOD(Plan)( __in BOOTSTRAPPER_ACTION action ) = 0; STDMETHOD(Elevate)( __in_opt HWND hwndParent ) = 0; STDMETHOD(Apply)( __in_opt HWND hwndParent ) = 0; STDMETHOD(Quit)( __in DWORD dwExitCode ) = 0; STDMETHOD(LaunchApprovedExe)( __in_opt HWND hwndParent, __in_z LPCWSTR wzApprovedExeForElevationId, __in_z_opt LPCWSTR wzArguments, __in DWORD dwWaitForInputIdleTimeout ) = 0; };
28.660944
127
0.696167
191d6e118c716bd6ba567a34cf10450ac14b4bb3
309
h
C
Dev/Cpp/Effekseer/Effekseer/Culling/Culling3D.ReferenceObject.h
emadurandal/Effekseer
c5cb963c9a8483258a9f972bd681b0c08b2ceef3
[ "Apache-2.0", "BSD-3-Clause" ]
957
2015-01-03T11:44:51.000Z
2022-03-29T06:50:43.000Z
Dev/Cpp/Effekseer/Effekseer/Culling/Culling3D.ReferenceObject.h
emadurandal/Effekseer
c5cb963c9a8483258a9f972bd681b0c08b2ceef3
[ "Apache-2.0", "BSD-3-Clause" ]
305
2015-01-03T04:04:43.000Z
2022-03-28T13:29:11.000Z
Dev/Cpp/Effekseer/Effekseer/Culling/Culling3D.ReferenceObject.h
emadurandal/Effekseer
c5cb963c9a8483258a9f972bd681b0c08b2ceef3
[ "Apache-2.0", "BSD-3-Clause" ]
175
2015-01-22T11:58:49.000Z
2022-03-28T07:41:56.000Z
 #pragma once #include "Culling3D.h" namespace Culling3D { class ReferenceObject : public IReference { private: int32_t m_reference; public: ReferenceObject(); virtual ~ReferenceObject(); virtual int32_t AddRef(); virtual int32_t GetRef(); virtual int32_t Release(); }; } // namespace Culling3D
12.36
41
0.737864
aae13343bcec92582e8e5de70a3395b7cdc29de9
7,760
h
C
release/src-ra-4300/linux/linux-2.6.36.x/drivers/gpu/drm/nouveau/nv50_evo.h
zhoutao0712/rtn11pb1
09e6b6c7ef4b91be0a9374daeacc3ac9f2fa3a05
[ "Apache-2.0" ]
129
2015-02-20T16:33:33.000Z
2022-03-24T20:17:26.000Z
release/src-ra-4300/linux/linux-2.6.36.x/drivers/gpu/drm/nouveau/nv50_evo.h
zhoutao0712/rtn11pb1
09e6b6c7ef4b91be0a9374daeacc3ac9f2fa3a05
[ "Apache-2.0" ]
11
2015-07-27T07:47:02.000Z
2022-01-15T16:39:39.000Z
release/src-ra-4300/linux/linux-2.6.36.x/drivers/gpu/drm/nouveau/nv50_evo.h
zhoutao0712/rtn11pb1
09e6b6c7ef4b91be0a9374daeacc3ac9f2fa3a05
[ "Apache-2.0" ]
46
2015-01-07T03:42:21.000Z
2022-03-24T20:17:52.000Z
/* * Copyright (C) 2008 Maarten Maathuis. * All Rights Reserved. * * 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 (including the * next paragraph) 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 COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS 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. * */ #define NV50_EVO_UPDATE 0x00000080 #define NV50_EVO_UNK84 0x00000084 #define NV50_EVO_UNK84_NOTIFY 0x40000000 #define NV50_EVO_UNK84_NOTIFY_DISABLED 0x00000000 #define NV50_EVO_UNK84_NOTIFY_ENABLED 0x40000000 #define NV50_EVO_DMA_NOTIFY 0x00000088 #define NV50_EVO_DMA_NOTIFY_HANDLE 0xffffffff #define NV50_EVO_DMA_NOTIFY_HANDLE_NONE 0x00000000 #define NV50_EVO_UNK8C 0x0000008C #define NV50_EVO_DAC(n, r) ((n) * 0x80 + NV50_EVO_DAC_##r) #define NV50_EVO_DAC_MODE_CTRL 0x00000400 #define NV50_EVO_DAC_MODE_CTRL_CRTC0 0x00000001 #define NV50_EVO_DAC_MODE_CTRL_CRTC1 0x00000002 #define NV50_EVO_DAC_MODE_CTRL2 0x00000404 #define NV50_EVO_DAC_MODE_CTRL2_NHSYNC 0x00000001 #define NV50_EVO_DAC_MODE_CTRL2_NVSYNC 0x00000002 #define NV50_EVO_SOR(n, r) ((n) * 0x40 + NV50_EVO_SOR_##r) #define NV50_EVO_SOR_MODE_CTRL 0x00000600 #define NV50_EVO_SOR_MODE_CTRL_CRTC0 0x00000001 #define NV50_EVO_SOR_MODE_CTRL_CRTC1 0x00000002 #define NV50_EVO_SOR_MODE_CTRL_TMDS 0x00000100 #define NV50_EVO_SOR_MODE_CTRL_TMDS_DUAL_LINK 0x00000400 #define NV50_EVO_SOR_MODE_CTRL_NHSYNC 0x00001000 #define NV50_EVO_SOR_MODE_CTRL_NVSYNC 0x00002000 #define NV50_EVO_CRTC(n, r) ((n) * 0x400 + NV50_EVO_CRTC_##r) #define NV84_EVO_CRTC(n, r) ((n) * 0x400 + NV84_EVO_CRTC_##r) #define NV50_EVO_CRTC_UNK0800 0x00000800 #define NV50_EVO_CRTC_CLOCK 0x00000804 #define NV50_EVO_CRTC_INTERLACE 0x00000808 #define NV50_EVO_CRTC_DISPLAY_START 0x00000810 #define NV50_EVO_CRTC_DISPLAY_TOTAL 0x00000814 #define NV50_EVO_CRTC_SYNC_DURATION 0x00000818 #define NV50_EVO_CRTC_SYNC_START_TO_BLANK_END 0x0000081c #define NV50_EVO_CRTC_UNK0820 0x00000820 #define NV50_EVO_CRTC_UNK0824 0x00000824 #define NV50_EVO_CRTC_UNK082C 0x0000082c #define NV50_EVO_CRTC_CLUT_MODE 0x00000840 /* You can't have a palette in 8 bit mode (=OFF) */ #define NV50_EVO_CRTC_CLUT_MODE_BLANK 0x00000000 #define NV50_EVO_CRTC_CLUT_MODE_OFF 0x80000000 #define NV50_EVO_CRTC_CLUT_MODE_ON 0xC0000000 #define NV50_EVO_CRTC_CLUT_OFFSET 0x00000844 #define NV84_EVO_CRTC_CLUT_DMA 0x0000085C #define NV84_EVO_CRTC_CLUT_DMA_HANDLE 0xffffffff #define NV84_EVO_CRTC_CLUT_DMA_HANDLE_NONE 0x00000000 #define NV50_EVO_CRTC_FB_OFFSET 0x00000860 #define NV50_EVO_CRTC_FB_SIZE 0x00000868 #define NV50_EVO_CRTC_FB_CONFIG 0x0000086c #define NV50_EVO_CRTC_FB_CONFIG_MODE 0x00100000 #define NV50_EVO_CRTC_FB_CONFIG_MODE_TILE 0x00000000 #define NV50_EVO_CRTC_FB_CONFIG_MODE_PITCH 0x00100000 #define NV50_EVO_CRTC_FB_DEPTH 0x00000870 #define NV50_EVO_CRTC_FB_DEPTH_8 0x00001e00 #define NV50_EVO_CRTC_FB_DEPTH_15 0x0000e900 #define NV50_EVO_CRTC_FB_DEPTH_16 0x0000e800 #define NV50_EVO_CRTC_FB_DEPTH_24 0x0000cf00 #define NV50_EVO_CRTC_FB_DEPTH_30 0x0000d100 #define NV50_EVO_CRTC_FB_DMA 0x00000874 #define NV50_EVO_CRTC_FB_DMA_HANDLE 0xffffffff #define NV50_EVO_CRTC_FB_DMA_HANDLE_NONE 0x00000000 #define NV50_EVO_CRTC_CURSOR_CTRL 0x00000880 #define NV50_EVO_CRTC_CURSOR_CTRL_HIDE 0x05000000 #define NV50_EVO_CRTC_CURSOR_CTRL_SHOW 0x85000000 #define NV50_EVO_CRTC_CURSOR_OFFSET 0x00000884 #define NV84_EVO_CRTC_CURSOR_DMA 0x0000089c #define NV84_EVO_CRTC_CURSOR_DMA_HANDLE 0xffffffff #define NV84_EVO_CRTC_CURSOR_DMA_HANDLE_NONE 0x00000000 #define NV50_EVO_CRTC_DITHER_CTRL 0x000008a0 #define NV50_EVO_CRTC_DITHER_CTRL_OFF 0x00000000 #define NV50_EVO_CRTC_DITHER_CTRL_ON 0x00000011 #define NV50_EVO_CRTC_SCALE_CTRL 0x000008a4 #define NV50_EVO_CRTC_SCALE_CTRL_INACTIVE 0x00000000 #define NV50_EVO_CRTC_SCALE_CTRL_ACTIVE 0x00000009 #define NV50_EVO_CRTC_COLOR_CTRL 0x000008a8 #define NV50_EVO_CRTC_COLOR_CTRL_COLOR 0x00040000 #define NV50_EVO_CRTC_FB_POS 0x000008c0 #define NV50_EVO_CRTC_REAL_RES 0x000008c8 #define NV50_EVO_CRTC_SCALE_CENTER_OFFSET 0x000008d4 #define NV50_EVO_CRTC_SCALE_CENTER_OFFSET_VAL(x, y) \ ((((unsigned)y << 16) & 0xFFFF0000) | (((unsigned)x) & 0x0000FFFF)) /* Both of these are needed, otherwise nothing happens. */ #define NV50_EVO_CRTC_SCALE_RES1 0x000008d8 #define NV50_EVO_CRTC_SCALE_RES2 0x000008dc
68.070175
80
0.564691
c559bcafcf49393fcf1782c6cf1bd86ef5e89320
14,685
h
C
pxr/usd/lib/usdLux/listAPI.h
octarrow/USD
1845291a9701ab0a3a7d591bc243a1a80fdcba8a
[ "Unlicense" ]
3
2019-02-20T07:34:17.000Z
2019-08-13T08:17:04.000Z
pxr/usd/lib/usdLux/listAPI.h
octarrow/USD
1845291a9701ab0a3a7d591bc243a1a80fdcba8a
[ "Unlicense" ]
null
null
null
pxr/usd/lib/usdLux/listAPI.h
octarrow/USD
1845291a9701ab0a3a7d591bc243a1a80fdcba8a
[ "Unlicense" ]
1
2019-10-04T21:57:06.000Z
2019-10-04T21:57:06.000Z
// // Copyright 2016 Pixar // // Licensed under the Apache License, Version 2.0 (the "Apache License") // with the following modification; you may not use this file except in // compliance with the Apache License and the following modification to it: // Section 6. Trademarks. is deleted and replaced with: // // 6. Trademarks. This License does not grant permission to use the trade // names, trademarks, service marks, or product names of the Licensor // and its affiliates, except as required to comply with Section 4(c) of // the License and to reproduce the content of the NOTICE file. // // You may obtain a copy of the Apache License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the Apache License with the above modification is // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the Apache License for the specific // language governing permissions and limitations under the Apache License. // #ifndef USDLUX_GENERATED_LISTAPI_H #define USDLUX_GENERATED_LISTAPI_H /// \file usdLux/listAPI.h #include "pxr/pxr.h" #include "pxr/usd/usdLux/api.h" #include "pxr/usd/usd/apiSchemaBase.h" #include "pxr/usd/usd/prim.h" #include "pxr/usd/usd/stage.h" #include "pxr/usd/usdLux/tokens.h" #include "pxr/base/vt/value.h" #include "pxr/base/gf/vec3d.h" #include "pxr/base/gf/vec3f.h" #include "pxr/base/gf/matrix4d.h" #include "pxr/base/tf/token.h" #include "pxr/base/tf/type.h" PXR_NAMESPACE_OPEN_SCOPE class SdfAssetPath; // -------------------------------------------------------------------------- // // LISTAPI // // -------------------------------------------------------------------------- // /// \class UsdLuxListAPI /// /// API schema to support discovery and publishing of lights in a scene. /// /// \section UsdLuxListAPI_Discovery Discovering Lights via Traversal /// /// To motivate this API, consider what is required to discover all /// lights in a scene. We must load all payloads and traverse all prims: /// /// \code /// 01 // Load everything on the stage so we can find all lights, /// 02 // including those inside payloads /// 03 stage->Load(); /// 04 /// 05 // Traverse all prims, checking if they are of type UsdLuxLight /// 06 // (Note: ignoring instancing and a few other things for simplicity) /// 07 SdfPathVector lights; /// 08 for (UsdPrim prim: stage->Traverse()) { /// 09 if (prim.IsA<UsdLuxLight>()) { /// 10 lights.push_back(i->GetPath()); /// 11 } /// 12 } /// \endcode /// /// This traversal -- suitably elaborated to handle certain details -- /// is the first and simplest thing UsdLuxListAPI provides. /// UsdLuxListAPI::ComputeLightList() performs this traversal and returns /// all lights in the scene: /// /// \code /// 01 UsdLuxListAPI listAPI(stage->GetPseudoRoot()); /// 02 SdfPathVector lights = listAPI.ComputeLightList(); /// \endcode /// /// \section UsdLuxListAPI_LightList Publishing a Cached Light List /// /// Consider a USD client that needs to quickly discover lights but /// wants to defer loading payloads and traversing the entire scene /// where possible, and is willing to do up-front computation and /// caching to achieve that. /// /// UsdLuxListAPI provides a way to cache the computed light list, /// by publishing the list of lights onto prims in the model /// hierarchy. Consider a big set that contains lights: /// /// \code /// 01 def Xform "BigSetWithLights" ( /// 02 kind = "assembly" /// 03 payload = @BigSetWithLights.usd@ // Heavy payload /// 04 ) { /// 05 // Pre-computed, cached list of lights inside payload /// 06 rel lightList = [ /// 07 <./Lights/light_1>, /// 08 <./Lights/light_2>, /// 09 ... /// 10 ] /// 11 token lightList:cacheBehavior = "consumeAndContinue"; /// 12 } /// \endcode /// /// The lightList relationship encodes a set of lights, and the /// lightList:cacheBehavior property provides fine-grained /// control over how to use that cache. (See details below.) /// /// The cache can be created by first invoking /// ComputeLightList(ComputeModeIgnoreCache) to pre-compute the list /// and then storing the result with UsdLuxListAPI::StoreLightList(). /// /// To enable efficient retrieval of the cache, it should be stored /// on a model hierarchy prim. Furthermore, note that while you can /// use a UsdLuxListAPI bound to the pseudo-root prim to query the /// lights (as in the example above) because it will perform a /// traversal over descendants, you cannot store the cache back to the /// pseduo-root prim. /// /// To consult the cached list, we invoke /// ComputeLightList(ComputeModeConsultModelHierarchyCache): /// /// \code /// 01 // Find and load all lights, using lightList cache where available /// 02 UsdLuxListAPI list(stage->GetPseudoRoot()); /// 03 SdfPathSet lights = list.ComputeLightList( /// 04 UsdLuxListAPI::ComputeModeConsultModelHierarchyCache); /// 05 stage.LoadAndUnload(lights, SdfPathSet()); /// \endcode /// /// In this mode, ComputeLightList() will traverse the model /// hierarchy, accumulating cached light lists. /// /// \section UsdLuxListAPI_CacheBehavior Controlling Cache Behavior /// /// The lightList:cacheBehavior property gives additional fine-grained /// control over cache behavior: /// /// \li The fallback value, "ignore", indicates that the lightList should /// be disregarded. This provides a way to invalidate cache entries. /// Note that unless "ignore" is specified, a lightList with an empty /// list of targets is considered a cache indicating that no lights /// are present. /// /// \li The value "consumeAndContinue" indicates that the cache should /// be consulted to contribute lights to the scene, and that recursion /// should continue down the model hierarchy in case additional lights /// are added as descedants. This is the default value established when /// StoreLightList() is invoked. This behavior allows the lights within /// a large model, such as the BigSetWithLights example above, to be /// published outside the payload, while also allowing referencing and /// layering to add additional lights over that set. /// /// \li The value "consumeAndHalt" provides a way to terminate recursive /// traversal of the scene for light discovery. The cache will be /// consulted but no descendant prims will be examined. /// /// \section UsdLuxListAPI_Instancing Instancing /// /// Where instances are present, UsdLuxListAPI::ComputeLightList() will /// return the instance-unique paths to any lights discovered within /// those instances. Lights within a UsdGeomPointInstancer will /// not be returned, however, since they cannot be referred to /// solely via paths. /// /// /// For any described attribute \em Fallback \em Value or \em Allowed \em Values below /// that are text/tokens, the actual token is published and defined in \ref UsdLuxTokens. /// So to set an attribute to the value "rightHanded", use UsdLuxTokens->rightHanded /// as the value. /// class UsdLuxListAPI : public UsdAPISchemaBase { public: /// Compile time constant representing what kind of schema this class is. /// /// \sa UsdSchemaType static const UsdSchemaType schemaType = UsdSchemaType::SingleApplyAPI; /// Construct a UsdLuxListAPI on UsdPrim \p prim . /// Equivalent to UsdLuxListAPI::Get(prim.GetStage(), prim.GetPath()) /// for a \em valid \p prim, but will not immediately throw an error for /// an invalid \p prim explicit UsdLuxListAPI(const UsdPrim& prim=UsdPrim()) : UsdAPISchemaBase(prim) { } /// Construct a UsdLuxListAPI on the prim held by \p schemaObj . /// Should be preferred over UsdLuxListAPI(schemaObj.GetPrim()), /// as it preserves SchemaBase state. explicit UsdLuxListAPI(const UsdSchemaBase& schemaObj) : UsdAPISchemaBase(schemaObj) { } /// Destructor. USDLUX_API virtual ~UsdLuxListAPI(); /// Return a vector of names of all pre-declared attributes for this schema /// class and all its ancestor classes. Does not include attributes that /// may be authored by custom/extended methods of the schemas involved. USDLUX_API static const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true); /// Return a UsdLuxListAPI holding the prim adhering to this /// schema at \p path on \p stage. If no prim exists at \p path on /// \p stage, or if the prim at that path does not adhere to this schema, /// return an invalid schema object. This is shorthand for the following: /// /// \code /// UsdLuxListAPI(stage->GetPrimAtPath(path)); /// \endcode /// USDLUX_API static UsdLuxListAPI Get(const UsdStagePtr &stage, const SdfPath &path); /// Applies this <b>single-apply</b> API schema to the given \p prim. /// This information is stored by adding "ListAPI" to the /// token-valued, listOp metadata \em apiSchemas on the prim. /// /// \return A valid UsdLuxListAPI object is returned upon success. /// An invalid (or empty) UsdLuxListAPI object is returned upon /// failure. See \ref UsdAPISchemaBase::_ApplyAPISchema() for conditions /// resulting in failure. /// /// \sa UsdPrim::GetAppliedSchemas() /// \sa UsdPrim::HasAPI() /// USDLUX_API static UsdLuxListAPI Apply(const UsdPrim &prim); protected: /// Returns the type of schema this class belongs to. /// /// \sa UsdSchemaType USDLUX_API virtual UsdSchemaType _GetSchemaType() const; private: // needs to invoke _GetStaticTfType. friend class UsdSchemaRegistry; USDLUX_API static const TfType &_GetStaticTfType(); static bool _IsTypedSchema(); // override SchemaBase virtuals. USDLUX_API virtual const TfType &_GetTfType() const; public: // --------------------------------------------------------------------- // // LIGHTLISTCACHEBEHAVIOR // --------------------------------------------------------------------- // /// Controls how the lightList should be interpreted. /// Valid values are: /// - consumeAndHalt: The lightList should be consulted, /// and if it exists, treated as a final authoritative statement /// of any lights that exist at or below this prim, halting /// recursive discovery of lights. /// - consumeAndContinue: The lightList should be consulted, /// but recursive traversal over nameChildren should continue /// in case additional lights are added by descendants. /// - ignore: The lightList should be entirely ignored. This /// provides a simple way to temporarily invalidate an existing /// cache. This is the fallback behavior. /// /// /// \n C++ Type: TfToken /// \n Usd Type: SdfValueTypeNames->Token /// \n Variability: SdfVariabilityVarying /// \n Fallback Value: No Fallback /// \n \ref UsdLuxTokens "Allowed Values": [consumeAndHalt, consumeAndContinue, ignore] USDLUX_API UsdAttribute GetLightListCacheBehaviorAttr() const; /// See GetLightListCacheBehaviorAttr(), and also /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create. /// If specified, author \p defaultValue as the attribute's default, /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true - /// the default for \p writeSparsely is \c false. USDLUX_API UsdAttribute CreateLightListCacheBehaviorAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const; public: // --------------------------------------------------------------------- // // LIGHTLIST // --------------------------------------------------------------------- // /// Relationship to lights in the scene. /// USDLUX_API UsdRelationship GetLightListRel() const; /// See GetLightListRel(), and also /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create USDLUX_API UsdRelationship CreateLightListRel() const; public: // ===================================================================== // // Feel free to add custom code below this line, it will be preserved by // the code generator. // // Just remember to: // - Close the class declaration with }; // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE // - Close the include guard with #endif // ===================================================================== // // --(BEGIN CUSTOM CODE)-- /// Runtime control over whether to consult stored lightList caches. enum ComputeMode { /// Consult any caches found on the model hierarchy. /// Do not traverse beneath the model hierarchy. ComputeModeConsultModelHierarchyCache, /// Ignore any caches found, and do a full prim traversal. ComputeModeIgnoreCache, }; /// Computes and returns the list of lights and light filters in /// the stage, optionally consulting a cached result. /// /// In ComputeModeIgnoreCache mode, caching is ignored, and this /// does a prim traversal looking for prims of type UsdLuxLight /// or UsdLuxLightFilter. /// /// In ComputeModeConsultModelHierarchyCache, this does a traversal /// only of the model hierarchy. In this traversal, any lights that /// live as model hierarchy prims are accumulated, as well as any /// paths stored in lightList caches. The lightList:cacheBehavior /// attribute gives further control over the cache behavior; see the /// class overview for details. /// /// When instances are present, ComputeLightList(ComputeModeIgnoreCache) /// will return the instance-uniqiue paths to any lights discovered /// within those instances. Lights within a UsdGeomPointInstancer /// will not be returned, however, since they cannot be referred to /// solely via paths. USDLUX_API SdfPathSet ComputeLightList(ComputeMode mode) const; /// Store the given paths as the lightlist for this prim. /// Paths that do not have this prim's path as a prefix /// will be silently ignored. /// This will set the listList:cacheBehavior to "consumeAndContinue". USDLUX_API void StoreLightList(const SdfPathSet &) const; /// Mark any stored lightlist as invalid, by setting the /// lightList:cacheBehavior attribute to ignore. USDLUX_API void InvalidateLightList() const; }; PXR_NAMESPACE_CLOSE_SCOPE #endif
39.475806
123
0.669186