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
8d667eac33dd46baa242fc8e3f43369087ea4c09
2,216
c
C
release/src-rt-6.x.4708/linux/linux-2.6.36/sound/soc/fsl/pcm030-audio-fabric.c
afeng11/tomato-arm
1ca18a88480b34fd495e683d849f46c2d47bb572
[ "FSFAP" ]
4
2017-05-17T11:27:04.000Z
2020-05-24T07:23:26.000Z
release/src-rt-6.x.4708/linux/linux-2.6.36/sound/soc/fsl/pcm030-audio-fabric.c
afeng11/tomato-arm
1ca18a88480b34fd495e683d849f46c2d47bb572
[ "FSFAP" ]
1
2018-08-21T03:43:09.000Z
2018-08-21T03:43:09.000Z
release/src-rt-6.x.4708/linux/linux-2.6.36/sound/soc/fsl/pcm030-audio-fabric.c
afeng11/tomato-arm
1ca18a88480b34fd495e683d849f46c2d47bb572
[ "FSFAP" ]
5
2017-10-11T08:09:11.000Z
2020-10-14T04:10:13.000Z
/* * Phytec pcm030 driver for the PSC of the Freescale MPC52xx * configured as AC97 interface * * Copyright 2008 Jon Smirl, Digispeaker * Author: Jon Smirl <jonsmirl@gmail.com> * * This file is licensed under the terms of the GNU General Public License * version 2. This program is licensed "as is" without any warranty of any * kind, whether express or implied. */ #include <linux/init.h> #include <linux/module.h> #include <linux/interrupt.h> #include <linux/device.h> #include <linux/delay.h> #include <linux/of_device.h> #include <linux/of_platform.h> #include <linux/dma-mapping.h> #include <sound/core.h> #include <sound/pcm.h> #include <sound/pcm_params.h> #include <sound/initval.h> #include <sound/soc.h> #include <sound/soc-of-simple.h> #include "mpc5200_dma.h" #include "mpc5200_psc_ac97.h" #include "../codecs/wm9712.h" #define DRV_NAME "pcm030-audio-fabric" static struct snd_soc_device device; static struct snd_soc_card card; static struct snd_soc_dai_link pcm030_fabric_dai[] = { { .name = "AC97", .stream_name = "AC97 Analog", .codec_dai = &wm9712_dai[WM9712_DAI_AC97_HIFI], .cpu_dai = &psc_ac97_dai[MPC5200_AC97_NORMAL], }, { .name = "AC97", .stream_name = "AC97 IEC958", .codec_dai = &wm9712_dai[WM9712_DAI_AC97_AUX], .cpu_dai = &psc_ac97_dai[MPC5200_AC97_SPDIF], }, }; static __init int pcm030_fabric_init(void) { struct platform_device *pdev; int rc; if (!of_machine_is_compatible("phytec,pcm030")) return -ENODEV; card.platform = &mpc5200_audio_dma_platform; card.name = "pcm030"; card.dai_link = pcm030_fabric_dai; card.num_links = ARRAY_SIZE(pcm030_fabric_dai); device.card = &card; device.codec_dev = &soc_codec_dev_wm9712; pdev = platform_device_alloc("soc-audio", 1); if (!pdev) { pr_err("pcm030_fabric_init: platform_device_alloc() failed\n"); return -ENODEV; } platform_set_drvdata(pdev, &device); device.dev = &pdev->dev; rc = platform_device_add(pdev); if (rc) { pr_err("pcm030_fabric_init: platform_device_add() failed\n"); return -ENODEV; } return 0; } module_init(pcm030_fabric_init); MODULE_AUTHOR("Jon Smirl <jonsmirl@gmail.com>"); MODULE_DESCRIPTION(DRV_NAME ": mpc5200 pcm030 fabric driver"); MODULE_LICENSE("GPL");
24.086957
74
0.737816
3ecbbfdb02f6b8ae43462c4c85264cc86278d60b
3,913
c
C
container/pidns.c
masatake/kernel-essential-training
2c72f37ba6437432589638c8c22df17f182c50c6
[ "MIT" ]
1
2020-09-16T06:21:54.000Z
2020-09-16T06:21:54.000Z
container/pidns.c
masatake/kernel-essential-training
2c72f37ba6437432589638c8c22df17f182c50c6
[ "MIT" ]
null
null
null
container/pidns.c
masatake/kernel-essential-training
2c72f37ba6437432589638c8c22df17f182c50c6
[ "MIT" ]
null
null
null
/* * making pid namespace step by step */ #define _GNU_SOURCE #include <sched.h> #include <error.h> #include <errno.h> #include <stdio.h> #include <sys/types.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <linux/limits.h> #include <sys/mount.h> #include <stdint.h> #include <sys/eventfd.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> #include <sys/wait.h> static void print_pids (const char *header) { fprintf(stderr, "%s: (pid = %u, ppid = %u)\n", header, getpid(), getppid()); } static void prompt (const char *str) { fputs(str? str: "[press key] ", stderr); getchar (); } static void print_pidns (const char *header, const char *ns) { if (ns == NULL) { fprintf(stderr, "%s: (", header); print_pidns (NULL, "pid"); fputs(", ", stderr); print_pidns (NULL, "pid_for_children"); fputs(")\n", stderr); } else { char path [PATH_MAX]; sprintf(path, "/proc/%d/ns/%s", getpid(), ns); struct stat st; if (stat(path, &st) < 0) { if (errno != ENOENT) error (1, errno, "failed in stat(%s)", path); else fprintf(stderr, "ns:%s = <NOENT>", ns); } else fprintf(stderr, "ns:%s = %lu", ns, st.st_ino); } } static void remount(void) { if (unshare (CLONE_NEWNS) < 0) error (1, errno, "unshare(NEWNS)"); /* Mysterious technique found in the output of strace when * targeting unshare --pid --fork --mount-proc /bin/true */ /* Make all morunt points */ if (mount("none", "/", NULL, MS_REC|MS_PRIVATE, NULL) < 0) error (1, errno, "remount /"); /* umount /proc */ if (mount("none", "/proc", NULL, MS_REC|MS_PRIVATE, NULL) < 0) error (1, errno, "/proc"); /* mount /proc */ if (mount("proc", "/proc", "proc", MS_NOSUID|MS_NODEV|MS_NOEXEC, NULL) <0) error (1, errno, "/proc"); } int main(void) { print_pids ("initial state"); print_pidns ("initial state", NULL); fprintf(stderr, "### unshare(CLONE_NEWPID) ###\n"); if (unshare (CLONE_NEWPID) < 0) error (1, errno, "failed in unshare(CLONE_NEWPID)"); print_pids ("after unshare(CLONE_NEWPID)"); print_pidns ("after unshare(CLONE_NEWPID)", NULL); prompt (NULL); int efd = eventfd (0, 0); if (efd < 0) error (1, errno, "eventfd"); fprintf(stderr, "### fork() ###\n"); pid_t pid = fork (); uint64_t d; if (pid == 0) { if (read (efd, &d, sizeof(d)) != sizeof(d)) error (1, errno, "read(eventfd)"); print_pids ("<child>after fork"); print_pidns ("<child>after fork", NULL); if (read (efd, &d, sizeof(d)) != sizeof(d)) error (1, errno, "read(eventfd)"); fprintf(stderr, "### remount /proc ###\n"); remount (); print_pids ("<child+remounted proc>after fork"); print_pidns ("<child+remounted proc>after fork", NULL); if (read (efd, &d, sizeof(d)) != sizeof(d)) error (1, errno, "read(eventfd)"); _exit(0); } else if (pid > 0) { print_pids ("<parent>after fork"); print_pidns ("<parent>after fork", NULL); d = 1; if (write (efd, &d, sizeof(d)) != sizeof(d)) error (1, errno, "write(eventfd)"); prompt(NULL); d = 1; if (write (efd, &d, sizeof(d)) != sizeof(d)) error (1, errno, "write(eventfd)"); prompt(NULL); fprintf(stderr, "### wait for death of child###\n"); if (write (efd, &d, sizeof(d)) != sizeof(d)) error (1, errno, "write(eventfd)"); wait(NULL); print_pids ("<parent>after wait"); print_pidns ("<parent>after wait", NULL); prompt(NULL); fprintf(stderr, "### make another child###\n"); fork (); fprintf(stderr, "### %s ###\n", strerror(errno)); print_pids ("<parent>after the 2nd fork"); print_pidns ("<parent>after the 2nd fork", NULL); prompt(NULL); } else error (1, errno, "fork"); return 0; }
23.291667
76
0.575006
9958744bbe3ede86624a78cfe2d6aba6c4c6bf5e
709
h
C
include/minishell.h
minishell-jiphyeonjeon/Rank03-Minishell
f686b79334f2d1d1c096297041252dfa1d3b636d
[ "MIT" ]
null
null
null
include/minishell.h
minishell-jiphyeonjeon/Rank03-Minishell
f686b79334f2d1d1c096297041252dfa1d3b636d
[ "MIT" ]
90
2022-02-09T02:38:51.000Z
2022-03-26T14:48:27.000Z
include/minishell.h
42cursus-youkim/Rank03-Minishell
f686b79334f2d1d1c096297041252dfa1d3b636d
[ "MIT" ]
3
2022-02-07T02:33:35.000Z
2022-03-07T04:14:29.000Z
#ifndef MINISHELL_H # define MINISHELL_H # ifdef WIN32 # include <sys/dirent.h> # else # include <dirent.h> # endif # include <stdio.h> # include <stdlib.h> # include <sys/types.h> # include <sys/stat.h> # include <fcntl.h> # include <signal.h> # include <sys/wait.h> # include "libft.h" # include <readline/readline.h> # include <readline/history.h> # include "minishell_type.h" # include "ast_type.h" # include "scanner.h" # include "lexer.h" # include "parser.h" # include "shell.h" # include "prompt.h" # include "api.h" # include "open.h" # include "exec.h" # include "pipe.h" # include "builtin.h" # include "tree.h" # include "errormsg.h" # define DEBUG 0 // # include "get_next_line.h" #endif
17.292683
31
0.675599
9973477ae3731dd2c7a6011bb5edd935ba4877f0
3,310
h
C
drivers/net/wireless/ath/ath11k/hw.h
Timicapstone/minstrel-Usyd
508664dafb055add01ff8f55165f525cec1077c7
[ "MIT" ]
2
2020-09-18T07:01:49.000Z
2022-01-27T08:59:04.000Z
net-next/drivers/net/wireless/ath/ath11k/hw.h
MaoJianwei/Mao_Linux_Network_Enhance
2ba9e6278e3f405dcb9fc807d9f9a8d4ff0356dd
[ "Apache-2.0" ]
null
null
null
net-next/drivers/net/wireless/ath/ath11k/hw.h
MaoJianwei/Mao_Linux_Network_Enhance
2ba9e6278e3f405dcb9fc807d9f9a8d4ff0356dd
[ "Apache-2.0" ]
4
2020-06-29T04:09:48.000Z
2022-01-27T08:59:01.000Z
/* SPDX-License-Identifier: BSD-3-Clause-Clear */ /* * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. */ #ifndef ATH11K_HW_H #define ATH11K_HW_H /* Target configuration defines */ /* Num VDEVS per radio */ #define TARGET_NUM_VDEVS (16 + 1) #define TARGET_NUM_PEERS_PDEV (512 + TARGET_NUM_VDEVS) /* Num of peers for Single Radio mode */ #define TARGET_NUM_PEERS_SINGLE (TARGET_NUM_PEERS_PDEV) /* Num of peers for DBS */ #define TARGET_NUM_PEERS_DBS (2 * TARGET_NUM_PEERS_PDEV) /* Num of peers for DBS_SBS */ #define TARGET_NUM_PEERS_DBS_SBS (3 * TARGET_NUM_PEERS_PDEV) /* Max num of stations (per radio) */ #define TARGET_NUM_STATIONS 512 #define TARGET_NUM_PEERS(x) TARGET_NUM_PEERS_##x #define TARGET_NUM_PEER_KEYS 2 #define TARGET_NUM_TIDS(x) (2 * TARGET_NUM_PEERS(x) + \ 4 * TARGET_NUM_VDEVS + 8) #define TARGET_AST_SKID_LIMIT 16 #define TARGET_NUM_OFFLD_PEERS 4 #define TARGET_NUM_OFFLD_REORDER_BUFFS 4 #define TARGET_TX_CHAIN_MASK (BIT(0) | BIT(1) | BIT(2) | BIT(4)) #define TARGET_RX_CHAIN_MASK (BIT(0) | BIT(1) | BIT(2) | BIT(4)) #define TARGET_RX_TIMEOUT_LO_PRI 100 #define TARGET_RX_TIMEOUT_HI_PRI 40 #define TARGET_DECAP_MODE_RAW 0 #define TARGET_DECAP_MODE_NATIVE_WIFI 1 #define TARGET_DECAP_MODE_ETH 2 #define TARGET_SCAN_MAX_PENDING_REQS 4 #define TARGET_BMISS_OFFLOAD_MAX_VDEV 3 #define TARGET_ROAM_OFFLOAD_MAX_VDEV 3 #define TARGET_ROAM_OFFLOAD_MAX_AP_PROFILES 8 #define TARGET_GTK_OFFLOAD_MAX_VDEV 3 #define TARGET_NUM_MCAST_GROUPS 12 #define TARGET_NUM_MCAST_TABLE_ELEMS 64 #define TARGET_MCAST2UCAST_MODE 2 #define TARGET_TX_DBG_LOG_SIZE 1024 #define TARGET_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK 1 #define TARGET_VOW_CONFIG 0 #define TARGET_NUM_MSDU_DESC (2500) #define TARGET_MAX_FRAG_ENTRIES 6 #define TARGET_MAX_BCN_OFFLD 16 #define TARGET_NUM_WDS_ENTRIES 32 #define TARGET_DMA_BURST_SIZE 1 #define TARGET_RX_BATCHMODE 1 #define ATH11K_HW_MAX_QUEUES 4 #define ATH11K_QUEUE_LEN 4096 #define ATH11k_HW_RATECODE_CCK_SHORT_PREAM_MASK 0x4 #define ATH11K_FW_DIR "ath11k" /* IPQ8074 definitions */ #define IPQ8074_FW_DIR "IPQ8074" #define IPQ8074_MAX_BOARD_DATA_SZ (256 * 1024) #define IPQ8074_MAX_CAL_DATA_SZ IPQ8074_MAX_BOARD_DATA_SZ #define ATH11K_BOARD_MAGIC "QCA-ATH11K-BOARD" #define ATH11K_BOARD_API2_FILE "board-2.bin" #define ATH11K_DEFAULT_BOARD_FILE "bdwlan.bin" #define ATH11K_DEFAULT_CAL_FILE "caldata.bin" enum ath11k_hw_rate_cck { ATH11K_HW_RATE_CCK_LP_11M = 0, ATH11K_HW_RATE_CCK_LP_5_5M, ATH11K_HW_RATE_CCK_LP_2M, ATH11K_HW_RATE_CCK_LP_1M, ATH11K_HW_RATE_CCK_SP_11M, ATH11K_HW_RATE_CCK_SP_5_5M, ATH11K_HW_RATE_CCK_SP_2M, }; enum ath11k_hw_rate_ofdm { ATH11K_HW_RATE_OFDM_48M = 0, ATH11K_HW_RATE_OFDM_24M, ATH11K_HW_RATE_OFDM_12M, ATH11K_HW_RATE_OFDM_6M, ATH11K_HW_RATE_OFDM_54M, ATH11K_HW_RATE_OFDM_36M, ATH11K_HW_RATE_OFDM_18M, ATH11K_HW_RATE_OFDM_9M, }; struct ath11k_hw_params { const char *name; struct { const char *dir; size_t board_size; size_t cal_size; } fw; }; struct ath11k_fw_ie { __le32 id; __le32 len; u8 data[0]; }; enum ath11k_bd_ie_board_type { ATH11K_BD_IE_BOARD_NAME = 0, ATH11K_BD_IE_BOARD_DATA = 1, }; enum ath11k_bd_ie_type { /* contains sub IEs of enum ath11k_bd_ie_board_type */ ATH11K_BD_IE_BOARD = 0, ATH11K_BD_IE_BOARD_EXT = 1, }; #endif
25.658915
69
0.803625
12b2a0c82ad65af2eec4ec012ba9c7aa47dd2aab
902
h
C
ChineseSkill-Headers/TFramedTransport.h
ZaneH/ChineseSkill-Hack
65aa118153a1bc485e3f5b738f5947254ace1a86
[ "MIT" ]
null
null
null
ChineseSkill-Headers/TFramedTransport.h
ZaneH/ChineseSkill-Hack
65aa118153a1bc485e3f5b738f5947254ace1a86
[ "MIT" ]
null
null
null
ChineseSkill-Headers/TFramedTransport.h
ZaneH/ChineseSkill-Hack
65aa118153a1bc485e3f5b738f5947254ace1a86
[ "MIT" ]
null
null
null
/** * This header is generated by class-dump-z 0.2a. * class-dump-z is Copyright (C) 2009 by KennyTM~, licensed under GPLv3. * * Source: (null) */ #import <XXUnknownSuperclass.h> // Unknown library #import "TTransport.h" @class NSMutableData, NSString; @interface TFramedTransport : XXUnknownSuperclass <TTransport> { id<TTransport> mTransport; NSMutableData* writeBuffer; NSMutableData* readBuffer; unsigned readOffset; unsigned char dummy_header[4]; } @property(readonly, copy) NSString* debugDescription; @property(readonly, copy) NSString* description; @property(readonly, assign) unsigned hash; @property(readonly, assign) Class superclass; - (id)initWithTransport:(id)transport; - (void)dealloc; - (void)flush; - (int)readAll:(char*)all offset:(int)offset length:(int)length; - (void)readFrame; - (void)write:(const char*)write offset:(unsigned)offset length:(unsigned)length; @end
28.1875
81
0.751663
c443dfbfec643fd8954553e6229505a5768284bd
1,382
h
C
extsrc/mesa/src/gallium/drivers/nv50/nv50_stateobj.h
MauroArgentino/RSXGL
bd206e11894f309680f48740346c17efe49755ba
[ "BSD-2-Clause" ]
28
2015-07-11T17:11:12.000Z
2022-03-26T04:14:16.000Z
extsrc/mesa/src/gallium/drivers/nv50/nv50_stateobj.h
MauroArgentino/RSXGL
bd206e11894f309680f48740346c17efe49755ba
[ "BSD-2-Clause" ]
2
2019-05-26T19:02:24.000Z
2021-05-27T14:15:04.000Z
extsrc/mesa/src/gallium/drivers/nv50/nv50_stateobj.h
MauroArgentino/RSXGL
bd206e11894f309680f48740346c17efe49755ba
[ "BSD-2-Clause" ]
9
2019-07-04T12:54:29.000Z
2022-02-09T13:04:38.000Z
#ifndef __NV50_STATEOBJ_H__ #define __NV50_STATEOBJ_H__ #include "pipe/p_state.h" #define NV50_SCISSORS_CLIPPING #define SB_BEGIN_3D(so, m, s) \ (so)->state[(so)->size++] = \ ((s) << 18) | (NV50_SUBCH_3D << 13) | NV50_3D_##m #define SB_BEGIN_3D_(so, m, s) \ (so)->state[(so)->size++] = \ ((s) << 18) | (NV50_SUBCH_3D << 13) | m #define SB_DATA(so, u) (so)->state[(so)->size++] = (u) #include "nv50_stateobj_tex.h" struct nv50_blend_stateobj { struct pipe_blend_state pipe; int size; uint32_t state[84]; // TODO: allocate less if !independent_blend_enable }; struct nv50_rasterizer_stateobj { struct pipe_rasterizer_state pipe; int size; uint32_t state[48]; }; struct nv50_zsa_stateobj { struct pipe_depth_stencil_alpha_state pipe; int size; uint32_t state[29]; }; struct nv50_vertex_element { struct pipe_vertex_element pipe; uint32_t state; }; struct nv50_vertex_stateobj { struct translate *translate; unsigned num_elements; uint32_t instance_elts; uint32_t instance_bufs; boolean need_conversion; unsigned vertex_size; unsigned packet_vertex_limit; struct nv50_vertex_element element[0]; }; #endif
24.678571
80
0.604197
1653b974a4349d9ee2754046bd6f72a4ca3aaeeb
3,363
c
C
qemu-4.2.0/target/ppc/mfrom_table.inc.c
MisaZhu/qemu_raspi
50d71ce87bb39470e6725f7428e4b6b9e1ed0359
[ "Apache-2.0" ]
null
null
null
qemu-4.2.0/target/ppc/mfrom_table.inc.c
MisaZhu/qemu_raspi
50d71ce87bb39470e6725f7428e4b6b9e1ed0359
[ "Apache-2.0" ]
null
null
null
qemu-4.2.0/target/ppc/mfrom_table.inc.c
MisaZhu/qemu_raspi
50d71ce87bb39470e6725f7428e4b6b9e1ed0359
[ "Apache-2.0" ]
1
2020-05-25T09:49:33.000Z
2020-05-25T09:49:33.000Z
static const uint8_t mfrom_ROM_table[602] = { 77, 77, 76, 76, 75, 75, 74, 74, 73, 73, 72, 72, 71, 71, 70, 70, 69, 69, 68, 68, 68, 67, 67, 66, 66, 65, 65, 64, 64, 64, 63, 63, 62, 62, 61, 61, 61, 60, 60, 59, 59, 58, 58, 58, 57, 57, 56, 56, 56, 55, 55, 54, 54, 54, 53, 53, 53, 52, 52, 51, 51, 51, 50, 50, 50, 49, 49, 49, 48, 48, 47, 47, 47, 46, 46, 46, 45, 45, 45, 44, 44, 44, 43, 43, 43, 42, 42, 42, 42, 41, 41, 41, 40, 40, 40, 39, 39, 39, 39, 38, 38, 38, 37, 37, 37, 37, 36, 36, 36, 35, 35, 35, 35, 34, 34, 34, 34, 33, 33, 33, 33, 32, 32, 32, 32, 31, 31, 31, 31, 30, 30, 30, 30, 29, 29, 29, 29, 28, 28, 28, 28, 28, 27, 27, 27, 27, 26, 26, 26, 26, 26, 25, 25, 25, 25, 25, 24, 24, 24, 24, 24, 23, 23, 23, 23, 23, 23, 22, 22, 22, 22, 22, 21, 21, 21, 21, 21, 21, 20, 20, 20, 20, 20, 20, 19, 19, 19, 19, 19, 19, 19, 18, 18, 18, 18, 18, 18, 17, 17, 17, 17, 17, 17, 17, 16, 16, 16, 16, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, };
42.56962
45
0.2697
e98456cb626f8ee88fc13591a2302a53bb19a5b8
695
c
C
Source Codes/Strings/String to Int.c
kaazima/C
26da10360aa676c965129263a85fbf9f4d2564ea
[ "MIT" ]
null
null
null
Source Codes/Strings/String to Int.c
kaazima/C
26da10360aa676c965129263a85fbf9f4d2564ea
[ "MIT" ]
null
null
null
Source Codes/Strings/String to Int.c
kaazima/C
26da10360aa676c965129263a85fbf9f4d2564ea
[ "MIT" ]
null
null
null
// Write a C program to convert string to int #include <stdio.h> int main() { int n=0,flag=0; char s[10]; printf("Enter a number as a string\n"); scanf("%s",s); for(int i=0;s[i]!='\0';i++) { if((s[i]<'0' || s[i]>'9') && (s[0]!='-')) { printf("Can't convert it to integer\n"); flag=1; break; } else if(s[i]!='-') n=n*10 + (s[i]-'0'); } if(s[0]=='-') n=n*-1; if(flag==0) { printf("Entered string is %s\n",s); printf("Equivalent integer is %d",n); } } /*Output: Enter a number as a string -654 Entered string is -654 Equivalent integer is -654*/
20.441176
52
0.456115
acbcee2aef157a85e65dfa2cf6e9cd5ffcce7744
644
h
C
DDShare/DDShareItemCell.h
CoderThink/DDShare
88299b570d9563f43a9ca6e9ce910a99de484bf1
[ "Apache-2.0" ]
null
null
null
DDShare/DDShareItemCell.h
CoderThink/DDShare
88299b570d9563f43a9ca6e9ce910a99de484bf1
[ "Apache-2.0" ]
null
null
null
DDShare/DDShareItemCell.h
CoderThink/DDShare
88299b570d9563f43a9ca6e9ce910a99de484bf1
[ "Apache-2.0" ]
null
null
null
// // DDShareItemCell.h // DDShareDemo // // Created by Think on 2017/3/5. // Copyright © 2017年 Think. All rights reserved. // #import <UIKit/UIKit.h> #import "DDShareItem.h" @interface DDShareItemCell : UICollectionViewCell @property (nonatomic, strong) UIImageView *imageView; @property (nonatomic, strong) UILabel *titleLable; @property (nonatomic, strong) DDShareItem *shareItem; @property (nonatomic) CGSize itemImageSize; //item中image大小 @property (nonatomic) CGFloat itemImageTopSpace; //item图片距离顶部大小 @property (nonatomic) CGFloat iconAndTitleSpace; //item图片和文字距离 @property (nonatomic, assign) BOOL showBorderLine; //是否显示边界线 @end
28
63
0.767081
3a93f363f5ce0e33e185e2211231c253136787cb
3,605
c
C
netlogon/utils/lwnet-stack.c
kbore/pbis-open
a05eb9309269b6402b4d6659bc45961986ea5eab
[ "Apache-2.0" ]
372
2016-10-28T10:50:35.000Z
2022-03-18T19:54:37.000Z
netlogon/utils/lwnet-stack.c
kbore/pbis-open
a05eb9309269b6402b4d6659bc45961986ea5eab
[ "Apache-2.0" ]
317
2016-11-02T17:41:48.000Z
2021-11-08T20:28:19.000Z
netlogon/utils/lwnet-stack.c
kenferrara/pbis-open
690c325d947b2bf6fb3032f9d660e41b94aea4be
[ "Apache-2.0" ]
107
2016-11-03T19:25:16.000Z
2022-03-20T21:15:22.000Z
/* Editor Settings: expandtabs and use 4 spaces for indentation * ex: set softtabstop=4 tabstop=8 expandtab shiftwidth=4: * * -*- mode: c, c-basic-offset: 4 -*- */ /* * Copyright © BeyondTrust Software 2004 - 2019 * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * BEYONDTRUST MAKES THIS SOFTWARE AVAILABLE UNDER OTHER LICENSING TERMS AS * WELL. IF YOU HAVE ENTERED INTO A SEPARATE LICENSE AGREEMENT WITH * BEYONDTRUST, THEN YOU MAY ELECT TO USE THE SOFTWARE UNDER THE TERMS OF THAT * SOFTWARE LICENSE AGREEMENT INSTEAD OF THE TERMS OF THE APACHE LICENSE, * NOTWITHSTANDING THE ABOVE NOTICE. IF YOU HAVE QUESTIONS, OR WISH TO REQUEST * A COPY OF THE ALTERNATE LICENSING TERMS OFFERED BY BEYONDTRUST, PLEASE CONTACT * BEYONDTRUST AT beyondtrust.com/contact */ /* * Copyright (C) BeyondTrust Software. All rights reserved. * * Module Name: * * lwnet-stack.h * * Abstract: * * BeyondTrust Site Manager * * Stack * * Authors: Krishna Ganugapati (krishnag@likewisesoftware.com) * Sriram Nambakam (snambakam@likewisesoftware.com) * */ #include "includes.h" DWORD LWNetStackPush( PVOID pItem, PLWNET_STACK* ppStack ) { DWORD dwError = 0; PLWNET_STACK pStack = NULL; if (!ppStack) { dwError = ERROR_INVALID_PARAMETER; BAIL_ON_LWNET_ERROR(dwError); } dwError = LWNetAllocateMemory( sizeof(LWNET_STACK), (PVOID*)&pStack); BAIL_ON_LWNET_ERROR(dwError); pStack->pItem = pItem; pStack->pNext = *ppStack; *ppStack = pStack; cleanup: return dwError; error: if (pStack) { LWNetFreeMemory(pStack); } goto cleanup; } PVOID LWNetStackPop( PLWNET_STACK* ppStack ) { PVOID pItem = NULL; PLWNET_STACK pTop = (ppStack && *ppStack ? *ppStack : NULL); if (pTop) { *ppStack = pTop->pNext; pItem = pTop->pItem; LWNetFreeMemory(pTop); } return pItem; } PVOID LWNetStackPeek( PLWNET_STACK pStack ) { return (pStack ? pStack->pItem : NULL); } DWORD LWNetStackForeach( PLWNET_STACK pStack, PFN_LWNET_FOREACH_STACK_ITEM pfnAction, PVOID pUserData ) { DWORD dwError = 0; PLWNET_STACK pIter = pStack; if (!pfnAction) { goto cleanup; } for (; pIter; pIter = pIter->pNext) { dwError = pfnAction(pIter->pItem, pUserData); BAIL_ON_LWNET_ERROR(dwError); } cleanup: return dwError; error: goto cleanup; } PLWNET_STACK LWNetStackReverse( PLWNET_STACK pStack ) { PLWNET_STACK pP = NULL; PLWNET_STACK pQ = pStack; PLWNET_STACK pR = NULL; while( pQ ) { pR = pQ->pNext; pQ->pNext = pP; pP = pQ; pQ = pR; } return pP; } VOID LWNetStackFree( PLWNET_STACK pStack ) { while (pStack) { PLWNET_STACK pTmp = pStack; pStack = pStack->pNext; LWNetFreeMemory(pTmp); } }
20.482955
81
0.630236
6bbbd85c84ab520a6ee0d40f5ac26864aca0917b
12,060
c
C
board/servo_micro/board.c
closer2/chrome-ec
ec417556294240afcbdfa45feaed1206eb3b477b
[ "BSD-3-Clause" ]
627
2022-01-21T17:48:25.000Z
2022-03-31T21:02:21.000Z
board/servo_micro/board.c
closer2/chrome-ec
ec417556294240afcbdfa45feaed1206eb3b477b
[ "BSD-3-Clause" ]
9
2022-01-21T20:03:35.000Z
2022-03-09T01:31:49.000Z
board/servo_micro/board.c
closer2/chrome-ec
ec417556294240afcbdfa45feaed1206eb3b477b
[ "BSD-3-Clause" ]
25
2022-01-21T18:06:01.000Z
2022-03-18T22:07:29.000Z
/* Copyright 2016 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ /* Servo micro board configuration */ #include "common.h" #include "console.h" #include "ec_version.h" #include "gpio.h" #include "hooks.h" #include "i2c.h" #include "i2c_ite_flash_support.h" #include "queue_policies.h" #include "registers.h" #include "spi.h" #include "system.h" #include "task.h" #include "timer.h" #include "update_fw.h" #include "usart-stm32f0.h" #include "usart_tx_dma.h" #include "usart_rx_dma.h" #include "usb_hw.h" #include "usb_i2c.h" #include "usb_spi.h" #include "usb-stream.h" #include "util.h" #include "gpio_list.h" void board_config_pre_init(void) { /* enable SYSCFG clock */ STM32_RCC_APB2ENR |= STM32_RCC_SYSCFGEN; /* * the DMA mapping is : * Chan 3 : USART3_RX * Chan 5 : USART2_RX * Chan 6 : USART4_RX (Disable) * Chan 6 : SPI2_RX * Chan 7 : SPI2_TX * * i2c : no dma * tim16/17: no dma */ STM32_SYSCFG_CFGR1 |= BIT(26); /* Remap USART3 RX/TX DMA */ /* Remap SPI2 to DMA channels 6 and 7 */ /* STM32F072 SPI2 defaults to using DMA channels 4 and 5 */ /* but cros_ec hardcodes a 6/7 assumption in registers.h */ STM32_SYSCFG_CFGR1 |= BIT(24); } /****************************************************************************** * Forward UARTs as a USB serial interface. */ #define USB_STREAM_RX_SIZE 32 #define USB_STREAM_TX_SIZE 64 /****************************************************************************** * Forward USART2 (EC) as a simple USB serial interface. */ static struct usart_config const usart2; struct usb_stream_config const usart2_usb; static struct queue const usart2_to_usb = QUEUE_DIRECT(1024, uint8_t, usart2.producer, usart2_usb.consumer); static struct queue const usb_to_usart2 = QUEUE_DIRECT(64, uint8_t, usart2_usb.producer, usart2.consumer); static struct usart_rx_dma const usart2_rx_dma = USART_RX_DMA(STM32_DMAC_CH5, 32); static struct usart_config const usart2 = USART_CONFIG(usart2_hw, usart2_rx_dma.usart_rx, usart_tx_interrupt, 115200, 0, usart2_to_usb, usb_to_usart2); USB_STREAM_CONFIG_USART_IFACE(usart2_usb, USB_IFACE_USART2_STREAM, USB_STR_USART2_STREAM_NAME, USB_EP_USART2_STREAM, USB_STREAM_RX_SIZE, USB_STREAM_TX_SIZE, usb_to_usart2, usart2_to_usb, usart2) /****************************************************************************** * Forward USART3 (CPU) as a simple USB serial interface. */ static struct usart_config const usart3; struct usb_stream_config const usart3_usb; static struct queue const usart3_to_usb = QUEUE_DIRECT(1024, uint8_t, usart3.producer, usart3_usb.consumer); static struct queue const usb_to_usart3 = QUEUE_DIRECT(64, uint8_t, usart3_usb.producer, usart3.consumer); static struct usart_rx_dma const usart3_rx_dma = USART_RX_DMA(STM32_DMAC_CH3, 32); static struct usart_config const usart3 = USART_CONFIG(usart3_hw, usart3_rx_dma.usart_rx, usart_tx_interrupt, 115200, 0, usart3_to_usb, usb_to_usart3); USB_STREAM_CONFIG_USART_IFACE(usart3_usb, USB_IFACE_USART3_STREAM, USB_STR_USART3_STREAM_NAME, USB_EP_USART3_STREAM, USB_STREAM_RX_SIZE, USB_STREAM_TX_SIZE, usb_to_usart3, usart3_to_usb, usart3) /****************************************************************************** * Forward USART4 (cr50) as a simple USB serial interface. * We cannot enable DMA due to lack of DMA channels. */ static struct usart_config const usart4; struct usb_stream_config const usart4_usb; static struct queue const usart4_to_usb = QUEUE_DIRECT(64, uint8_t, usart4.producer, usart4_usb.consumer); static struct queue const usb_to_usart4 = QUEUE_DIRECT(64, uint8_t, usart4_usb.producer, usart4.consumer); static struct usart_config const usart4 = USART_CONFIG(usart4_hw, usart_rx_interrupt, usart_tx_interrupt, 115200, 0, usart4_to_usb, usb_to_usart4); USB_STREAM_CONFIG_USART_IFACE(usart4_usb, USB_IFACE_USART4_STREAM, USB_STR_USART4_STREAM_NAME, USB_EP_USART4_STREAM, USB_STREAM_RX_SIZE, USB_STREAM_TX_SIZE, usb_to_usart4, usart4_to_usb, usart4) /****************************************************************************** * Check parity setting on usarts. */ static int command_uart_parity(int argc, char **argv) { int parity = 0, newparity; struct usart_config const *usart; char *e; if ((argc < 2) || (argc > 3)) return EC_ERROR_PARAM_COUNT; if (!strcasecmp(argv[1], "usart2")) usart = &usart2; else if (!strcasecmp(argv[1], "usart3")) usart = &usart3; else if (!strcasecmp(argv[1], "usart4")) usart = &usart4; else return EC_ERROR_PARAM1; if (argc == 3) { parity = strtoi(argv[2], &e, 0); if (*e || (parity < 0) || (parity > 2)) return EC_ERROR_PARAM2; usart_set_parity(usart, parity); } newparity = usart_get_parity(usart); ccprintf("Parity on %s is %d.\n", argv[1], newparity); if ((argc == 3) && (newparity != parity)) return EC_ERROR_UNKNOWN; return EC_SUCCESS; } DECLARE_CONSOLE_COMMAND(parity, command_uart_parity, "usart[2|3|4] [0|1|2]", "Set parity on uart"); /****************************************************************************** * Set baud rate setting on usarts. */ static int command_uart_baud(int argc, char **argv) { int baud = 0; struct usart_config const *usart; char *e; if ((argc < 2) || (argc > 3)) return EC_ERROR_PARAM_COUNT; if (!strcasecmp(argv[1], "usart2")) usart = &usart2; else if (!strcasecmp(argv[1], "usart3")) usart = &usart3; else if (!strcasecmp(argv[1], "usart4")) usart = &usart4; else return EC_ERROR_PARAM1; baud = strtoi(argv[2], &e, 0); if (*e || baud < 0) return EC_ERROR_PARAM2; usart_set_baud(usart, baud); return EC_SUCCESS; } DECLARE_CONSOLE_COMMAND(baud, command_uart_baud, "usart[2|3|4] rate", "Set baud rate on uart"); /****************************************************************************** * Hold the usart pins low while disabling it, or return it to normal. */ static int command_hold_usart_low(int argc, char **argv) { /* Each bit represents if that port rx is being held low */ static int usart_status; int usart_mask; enum gpio_signal rx; if (argc > 3 || argc < 2) return EC_ERROR_PARAM_COUNT; if (!strcasecmp(argv[1], "usart2")) { usart_mask = 1 << 2; rx = GPIO_USART2_SERVO_RX_DUT_TX; } else if (!strcasecmp(argv[1], "usart3")) { usart_mask = 1 << 3; rx = GPIO_USART3_SERVO_RX_DUT_TX; } else if (!strcasecmp(argv[1], "usart4")) { usart_mask = 1 << 4; rx = GPIO_USART4_SERVO_RX_DUT_TX; } else { return EC_ERROR_PARAM1; } /* Updating the status of this port */ if (argc == 3) { char *e; const int hold_low = strtoi(argv[2], &e, 0); if (*e || (hold_low < 0) || (hold_low > 1)) return EC_ERROR_PARAM2; if (!!(usart_status & usart_mask) == hold_low) { /* Do nothing since there is no change */ } else if (hold_low) { /* * No need to shutdown UART, just de-mux the RX pin from * UART and change it to a GPIO temporarily. */ gpio_config_pin(MODULE_USART, rx, 0); gpio_set_flags(rx, GPIO_OUT_LOW); /* Update global uart state */ usart_status |= usart_mask; } else { /* * Mux the RX pin back to GPIO mode */ gpio_config_pin(MODULE_USART, rx, 1); /* Update global uart state */ usart_status &= ~usart_mask; } } /* Print status for get and set case. */ ccprintf("USART status: %s\n", usart_status & usart_mask ? "held low" : "normal"); return EC_SUCCESS; } DECLARE_CONSOLE_COMMAND(hold_usart_low, command_hold_usart_low, "usart[2|3|4] [0|1]?", "Get/set the hold-low state for usart port"); /****************************************************************************** * Define the strings used in our USB descriptors. */ const void *const usb_strings[] = { [USB_STR_DESC] = usb_string_desc, [USB_STR_VENDOR] = USB_STRING_DESC("Google Inc."), [USB_STR_PRODUCT] = USB_STRING_DESC("Servo Micro"), [USB_STR_SERIALNO] = 0, [USB_STR_VERSION] = USB_STRING_DESC(CROS_EC_VERSION32), [USB_STR_I2C_NAME] = USB_STRING_DESC("I2C"), [USB_STR_USART4_STREAM_NAME] = USB_STRING_DESC("UART3"), [USB_STR_CONSOLE_NAME] = USB_STRING_DESC("Servo Shell"), [USB_STR_USART3_STREAM_NAME] = USB_STRING_DESC("CPU"), [USB_STR_USART2_STREAM_NAME] = USB_STRING_DESC("EC"), [USB_STR_UPDATE_NAME] = USB_STRING_DESC("Firmware update"), }; BUILD_ASSERT(ARRAY_SIZE(usb_strings) == USB_STR_COUNT); /****************************************************************************** * Support SPI bridging over USB, this requires usb_spi_board_enable and * usb_spi_board_disable to be defined to enable and disable the SPI bridge. */ /* SPI devices */ const struct spi_device_t spi_devices[] = { { CONFIG_SPI_FLASH_PORT, 1, GPIO_SPI_CS}, }; const unsigned int spi_devices_used = ARRAY_SIZE(spi_devices); void usb_spi_board_enable(struct usb_spi_config const *config) { /* Configure SPI GPIOs */ gpio_config_module(MODULE_SPI_FLASH, 1); /* Set all four SPI pins to high speed */ STM32_GPIO_OSPEEDR(GPIO_B) |= 0xff000000; /* Enable clocks to SPI2 module */ STM32_RCC_APB1ENR |= STM32_RCC_PB1_SPI2; /* Reset SPI2 */ STM32_RCC_APB1RSTR |= STM32_RCC_PB1_SPI2; STM32_RCC_APB1RSTR &= ~STM32_RCC_PB1_SPI2; spi_enable(CONFIG_SPI_FLASH_PORT, 1); } void usb_spi_board_disable(struct usb_spi_config const *config) { spi_enable(CONFIG_SPI_FLASH_PORT, 0); /* Disable clocks to SPI2 module */ STM32_RCC_APB1ENR &= ~STM32_RCC_PB1_SPI2; /* Release SPI GPIOs */ gpio_config_module(MODULE_SPI_FLASH, 0); } USB_SPI_CONFIG(usb_spi, USB_IFACE_SPI, USB_EP_SPI, 0); /****************************************************************************** * Support I2C bridging over USB. */ /* I2C ports */ const struct i2c_port_t i2c_ports[] = { {"master", I2C_PORT_MASTER, 100, GPIO_MASTER_I2C_SCL, GPIO_MASTER_I2C_SDA}, }; const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); int usb_i2c_board_is_enabled(void) { return 1; } /* Configure ITE flash support module */ const struct ite_dfu_config_t ite_dfu_config = { .i2c_port = I2C_PORT_MASTER, .scl = GPIO_MASTER_I2C_SCL, .sda = GPIO_MASTER_I2C_SDA, }; /****************************************************************************** * Initialize board. */ static void board_init(void) { /* USB to serial queues */ queue_init(&usart2_to_usb); queue_init(&usb_to_usart2); queue_init(&usart3_to_usb); queue_init(&usb_to_usart3); queue_init(&usart4_to_usb); queue_init(&usb_to_usart4); /* UART init */ usart_init(&usart2); usart_init(&usart3); usart_init(&usart4); /* Enable GPIO expander. */ gpio_set_level(GPIO_TCA6416_RESET_L, 1); /* Structured enpoints */ usb_spi_enable(&usb_spi, 1); /* Enable UARTs by default. */ gpio_set_level(GPIO_UART1_EN_L, 0); gpio_set_level(GPIO_UART2_EN_L, 0); /* Disable power output. */ gpio_set_level(GPIO_SPI1_VREF_18, 0); gpio_set_level(GPIO_SPI1_VREF_33, 0); gpio_set_level(GPIO_SPI2_VREF_18, 0); gpio_set_level(GPIO_SPI2_VREF_33, 0); /* Enable UART3 routing. */ gpio_set_level(GPIO_SPI1_MUX_SEL, 1); gpio_set_level(GPIO_SPI1_BUF_EN_L, 1); gpio_set_level(GPIO_JTAG_BUFIN_EN_L, 0); gpio_set_level(GPIO_SERVO_JTAG_TDO_BUFFER_EN, 1); gpio_set_level(GPIO_SERVO_JTAG_TDO_SEL, 1); } DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); /****************************************************************************** * Turn down USART before jumping to RW. */ static void board_jump(void) { /* * If we don't shutdown the USARTs before jumping to RW, then when early * RW tries to set the GPIOs to input (or anything other than alternate) * the jump fail on some servo micros. * * It also make sense to shut them down since RW will reinitialize them * in board_init above. */ usart_shutdown(&usart2); usart_shutdown(&usart3); usart_shutdown(&usart4); /* Shutdown other hardware modules and let RW reinitialize them */ usb_spi_enable(&usb_spi, 0); } DECLARE_HOOK(HOOK_SYSJUMP, board_jump, HOOK_PRIO_DEFAULT);
26.740576
79
0.669818
5bd10c73770ec146b3b32a82a4dcebfc75518ffe
6,463
h
C
sdk/modules/include/sensing/logical_sensor/compass.h
zenglongGH/spresense
b17578aac9faa417b6f1a6d7ebf8f37c57c5ea68
[ "Apache-2.0" ]
110
2018-07-12T16:04:50.000Z
2022-02-26T12:27:56.000Z
sdk/modules/include/sensing/logical_sensor/compass.h
zenglongGH/spresense
b17578aac9faa417b6f1a6d7ebf8f37c57c5ea68
[ "Apache-2.0" ]
37
2018-08-10T13:05:45.000Z
2022-03-18T20:33:18.000Z
sdk/modules/include/sensing/logical_sensor/compass.h
zenglongGH/spresense
b17578aac9faa417b6f1a6d7ebf8f37c57c5ea68
[ "Apache-2.0" ]
94
2018-07-13T03:48:34.000Z
2022-03-19T07:32:08.000Z
/**************************************************************************** * modules/include/sensing/logical_sensor/compass.h * * Copyright 2018 Sony Semiconductor Solutions Corporation * * 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 Sony Semiconductor Solutions Corporation nor * the names of its contributors may be used to endorse or promote * products derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 __INCLUDE_SENSING_COMPASS_H #define __INCLUDE_SENSING_COMPASS_H /** * @defgroup logical_compass Compass API * @{ */ /**************************************************************************** * Included Files ****************************************************************************/ #include <asmp/mpmq.h> #include <asmp/mptask.h> #include "sensing/sensor_api.h" #include "sensing/sensor_id.h" #include "sensing/sensor_ecode.h" #include "sensing/logical_sensor/compass_command.h" #include "memutils/s_stl/queue.h" #include "memutils/memory_manager/MemHandle.h" /**************************************************************************** * Public Types ****************************************************************************/ /** * @struct CompassResult * @brief The structure of result on compass commands. */ typedef struct { int resultcmd; /**< * Indicates the result of any command. * The command type at transmission is set. */ int exec_result; /**< The command execution result is set. */ int errcode; /**< * A detailed code of the command execution result * is set. */ float azimuth; /**< * Indicates calculation of azimuth from * input sensor data. The unit is[rad]. * (*)No deviation correction. */ float pitch; /**< * Indicates calculation of pitch attitude from * input sensor data. The unit is[rad]. */ float roll; /**< * Indicates calculation of roll attitude from * input sensor data. The unit is[rad]. */ float decl; /**< * Argument angle. The unit is[rad]. * (*)Use Azimuth - Decl */ int acc_azimuth; /**< * Return the azimuth accuracy level. [0 - 3] */ int calib_lv; /**< * Return the calibration accuracy level. [0 - 3] */ } CompassResult; /*-------------------------------------------------------------------- * Compass Class * -------------------------------------------------------------------- */ class CompassClass { public: /* public methods */ int open(void); int close(void); int write(FAR sensor_command_data_mh_t*); int result(void); void set_callback(uint32_t); int receive(void); CompassClass(MemMgrLite::PoolId cmd_pool_id, MemMgrLite::PoolId rst_pool_id) : m_cmd_pool_id(cmd_pool_id) , m_rst_pool_id(rst_pool_id) { }; ~CompassClass(){}; private: #define MAX_EXEC_COUNT 10 struct exe_mh_s { MemMgrLite::MemHandle cmd; MemMgrLite::MemHandle data; }; s_std::Queue<struct exe_mh_s, MAX_EXEC_COUNT> m_accel_exe_que; s_std::Queue<struct exe_mh_s, MAX_EXEC_COUNT> m_mag_exe_que; /* private members */ MemMgrLite::PoolId m_cmd_pool_id; MemMgrLite::PoolId m_rst_pool_id; mptask_t m_mptask; mpmq_t m_mq; pthread_t m_thread_id; /* private methods */ int sendInit(void); int sendFlush(void); }; /*-------------------------------------------------------------------- * External Interface *-------------------------------------------------------------------- */ /** * @brief Create CompassClass instance. * @param[in] cmd_pool_id : Pool id for DSP communication data * @return Address for instance of CompassClass * */ FAR CompassClass *CompassCreate(MemMgrLite::PoolId cmd_pool_id, MemMgrLite::PoolId rst_pool_id); /** * @brief Load Compass library and boot up as worker task. * After booted up, send initialize and wait complete. * @param[in] ins : instance address of CompassClass * @return result of process. */ int CompassOpen(FAR CompassClass *ins); /** * @brief Destory Compass worker task. * @param[in] ins : instance address of CompassClass * @return result of process. */ int CompassClose(FAR CompassClass *ins); /** * @brief Send data to Compass worker task. * @param[in] ins : instance address of CompassClass * @param[in] command : command including data to send * @return result of process */ int CompassWrite(FAR CompassClass *ins, FAR sensor_command_data_mh_t *command); /** * @} */ #endif /* __INCLUDE_SENSING_COMPASS_H */
31.99505
78
0.564753
55689a74169ba7ad55e41b6f9ae9678f435dfcd5
2,546
c
C
workspace/uclibc-ng-master/libubacktrace/arm/backtrace.c
maydali28/toolchain-cross-compile
254cfed3074532ff01c63259b4ea43b1cdf8b968
[ "MIT" ]
null
null
null
workspace/uclibc-ng-master/libubacktrace/arm/backtrace.c
maydali28/toolchain-cross-compile
254cfed3074532ff01c63259b4ea43b1cdf8b968
[ "MIT" ]
null
null
null
workspace/uclibc-ng-master/libubacktrace/arm/backtrace.c
maydali28/toolchain-cross-compile
254cfed3074532ff01c63259b4ea43b1cdf8b968
[ "MIT" ]
null
null
null
/* * Perform stack unwinding by using the _Unwind_Backtrace. * * User application that wants to use backtrace needs to be * compiled with -fasynchronous-unwid-tables option and -rdynamic i * to get full symbols printed. * * Author(s): Khem Raj <raj.khem@gmail.com> * - ARM specific implementation of backtrace * * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. * */ #include <libgcc_s.h> #include <execinfo.h> #include <dlfcn.h> #include <stdlib.h> #include <unwind.h> #include <assert.h> #include <stdio.h> struct trace_arg { void **array; int cnt, size; }; #ifdef SHARED static _Unwind_Reason_Code (*unwind_backtrace) (_Unwind_Trace_Fn, void *); static _Unwind_VRS_Result (*unwind_vrs_get) (_Unwind_Context *, _Unwind_VRS_RegClass, _uw, _Unwind_VRS_DataRepresentation, void *); static void backtrace_init (void) { void *handle = dlopen (LIBGCC_S_SO, RTLD_LAZY); if (handle == NULL || ((unwind_backtrace = dlsym (handle, "_Unwind_Backtrace")) == NULL) || ((unwind_vrs_get = dlsym (handle, "_Unwind_VRS_Get")) == NULL)) { printf(LIBGCC_S_SO " must be installed for backtrace to work\n"); abort(); } } #else # define unwind_backtrace _Unwind_Backtrace # define unwind_vrs_get _Unwind_VRS_Get #endif /* This function is identical to "_Unwind_GetGR", except that it uses "unwind_vrs_get" instead of "_Unwind_VRS_Get". */ static inline _Unwind_Word unwind_getgr (_Unwind_Context *context, int regno) { _uw val; unwind_vrs_get (context, _UVRSC_CORE, regno, _UVRSD_UINT32, &val); return val; } /* This macro is identical to the _Unwind_GetIP macro, except that it uses "unwind_getgr" instead of "_Unwind_GetGR". */ #define unwind_getip(context) \ (unwind_getgr (context, 15) & ~(_Unwind_Word)1) static _Unwind_Reason_Code backtrace_helper (struct _Unwind_Context *ctx, void *a) { struct trace_arg *arg = a; assert (unwind_getip(ctx) != NULL); /* We are first called with address in the __backtrace function. Skip it. */ if (arg->cnt != -1) arg->array[arg->cnt] = (void *) unwind_getip (ctx); if (++arg->cnt == arg->size) return _URC_END_OF_STACK; return _URC_NO_REASON; } /* * Perform stack unwinding by using the _Unwind_Backtrace. * */ int backtrace (void **array, int size) { struct trace_arg arg = { .array = array, .size = size, .cnt = -1 }; #ifdef SHARED if (unwind_backtrace == NULL) backtrace_init(); #endif if (size >= 1) unwind_backtrace (backtrace_helper, &arg); return arg.cnt != -1 ? arg.cnt : 0; }
25.717172
77
0.705027
5595599fddc6054a52220903d2fbf039ca3c07eb
1,146
h
C
clients/include/near.h
aaronenyeshi/rocBLAS
90d52d221a8f0f778557317d094ae57c4fced1b6
[ "MIT" ]
null
null
null
clients/include/near.h
aaronenyeshi/rocBLAS
90d52d221a8f0f778557317d094ae57c4fced1b6
[ "MIT" ]
null
null
null
clients/include/near.h
aaronenyeshi/rocBLAS
90d52d221a8f0f778557317d094ae57c4fced1b6
[ "MIT" ]
null
null
null
/* ************************************************************************ * Copyright 2016 Advanced Micro Devices, Inc. * * ************************************************************************ */ #pragma once #ifndef _NEAR_H #define _NEAR_H #include "rocblas.h" #ifdef GOOGLE_TEST #include "gtest/gtest.h" #endif /* ===================================================================== Google Near check: ASSERT_EQ( elementof(A), elementof(B)) =================================================================== */ /*!\file * \brief compares two results (usually, CPU and GPU results); provides Google Near check. */ /* ========================================Gtest Near Check * ==================================================== */ /*! \brief Template: gtest near compare two matrices float/double/complex */ // Do not put a wrapper over ASSERT_FLOAT_EQ, sincer assert exit the current function NOT the test // case // a wrapper will cause the loop keep going template <typename T1, typename T2> void near_check_general( rocblas_int M, rocblas_int N, rocblas_int lda, T1* hCPU, T1* hGPU, T2 abs_error); #endif
30.157895
98
0.477312
df7ffef2dbd894f68d6a8f5c0b649deee0c36cde
6,636
c
C
kernel/liteos_m/targets/riscv_sifive_fe310_gcc/libc/dprintf.c
xusiwei/bearpi-hm_nano
3ee5b0f9097b19dae89713908500b8dd855c4238
[ "Apache-2.0" ]
null
null
null
kernel/liteos_m/targets/riscv_sifive_fe310_gcc/libc/dprintf.c
xusiwei/bearpi-hm_nano
3ee5b0f9097b19dae89713908500b8dd855c4238
[ "Apache-2.0" ]
null
null
null
kernel/liteos_m/targets/riscv_sifive_fe310_gcc/libc/dprintf.c
xusiwei/bearpi-hm_nano
3ee5b0f9097b19dae89713908500b8dd855c4238
[ "Apache-2.0" ]
null
null
null
/* * Copyright (c) 2013-2020, Huawei Technologies Co., Ltd. All rights reserved. * Copyright (c) 2020, Huawei Device Co., 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: * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * 3. Neither the name of the copyright holder nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "stdarg.h" #include <stdio.h> #include "los_debug.h" #include "uart.h" int putchar(int n) { return UartOut(n, NULL); } int puts(const char *string) { int count = 0; char *s = (char *)string; while (*s != '\0') { putchar(*s); s++; count++; } return count; } static int hex2asc(int n) { n &= 15; if(n > 9){ return ('a' - 10) + n; } else { return '0' + n; } } static void dputs(char const *s, int (*pFputc)(int n, void *cookie), void *cookie) { while (*s) { pFputc(*s++, cookie); } } void __dprintf(char const *fmt, va_list ap, int (*pFputc)(int n, void *cookie), void *cookie) { char scratch[256]; for(;;){ switch(*fmt){ case 0: va_end(ap); return; case '%': switch(fmt[1]) { case 'c': { unsigned n = va_arg(ap, unsigned); pFputc(n, cookie); fmt += 2; continue; } case 'h': { unsigned n = va_arg(ap, unsigned); pFputc(hex2asc(n >> 12), cookie); pFputc(hex2asc(n >> 8), cookie); pFputc(hex2asc(n >> 4), cookie); pFputc(hex2asc(n >> 0), cookie); fmt += 2; continue; } case 'b': { unsigned n = va_arg(ap, unsigned); pFputc(hex2asc(n >> 4), cookie); pFputc(hex2asc(n >> 0), cookie); fmt += 2; continue; } case 'p': case 'X': case 'x': { unsigned n = va_arg(ap, unsigned); char *p = scratch + 15; *p = 0; do { *--p = hex2asc(n); n = n >> 4; } while(n != 0); while(p > (scratch + 7)) *--p = '0'; dputs(p, pFputc, cookie); fmt += 2; continue; } case 'd': { int n = va_arg(ap, int); char *p = scratch + 15; *p = 0; if(n < 0) { pFputc('-', cookie); n = -n; } do { *--p = (n % 10) + '0'; n /= 10; } while(n != 0); dputs(p, pFputc, cookie); fmt += 2; continue; } case 'u': { unsigned int n = va_arg(ap, unsigned int); char *p = scratch + 15; *p = 0; do { *--p = (n % 10) + '0'; n /= 10; } while(n != 0); dputs(p, pFputc, cookie); fmt += 2; continue; } case 's': { char *s = va_arg(ap, char*); /*lint !e64*/ if(s == 0) s = "(null)"; dputs(s, pFputc, cookie); fmt += 2; continue; } } pFputc(*fmt++, cookie); break; case '\n': pFputc('\r', cookie); default: /*lint !e616*/ pFputc(*fmt++, cookie); } } } int printf(char const *str, ...) { va_list ap; va_start(ap, str); __dprintf(str, ap, UartPutc, 0); va_end(ap); return 0; }
37.704545
95
0.376733
8a1fabed60b63fe4b40900bc24e9a27e3fc80e67
6,870
h
C
src/Display/Fonts/RREFonts/rre_arialdig47n.h
happeneddr9/STM32F0-YM2151-VGMPlayer
202b3cc1f9b4c4c26468444710e9c4a17eb61510
[ "MIT" ]
1
2020-04-16T10:58:10.000Z
2020-04-16T10:58:10.000Z
src/Display/Fonts/RREFonts/rre_arialdig47n.h
happeneddr9/STM32F0-YM2151-VGMPlayer
202b3cc1f9b4c4c26468444710e9c4a17eb61510
[ "MIT" ]
null
null
null
src/Display/Fonts/RREFonts/rre_arialdig47n.h
happeneddr9/STM32F0-YM2151-VGMPlayer
202b3cc1f9b4c4c26468444710e9c4a17eb61510
[ "MIT" ]
null
null
null
#ifndef __font_ArialDig47n_h__ #define __font_ArialDig47n_h__ /* *** Generated by rrefontgen *** Font: [ArialDig47n] 32x47 Total chars: 27 (' ' to ':') Total rects: 374 * 3 bytes Total pixels: 8529 (2222 overlapping) Total bytes: 1176 (1122 rects + 54 offs) Bitmap size: 5184 (32x47 * 27) (+27 opt) */ const unsigned char fontArialDig47n_Rects[1122] PROGMEM = { 0x44,0x01,0x08, 0x01,0x84,0x01, 0x0e,0x84,0x01, 0x44,0x0e,0x08, 0x82,0x02,0x02, 0x8c,0x02,0x02, 0x82,0x0c,0x02, 0x8c,0x0c,0x02, 0x06,0x00,0x04, 0x00,0x46,0x00, 0x0b,0x0d,0x00, 0x06,0x10,0x04, 0x05,0x03,0x00, 0x0b,0x03,0x00, 0x03,0x05,0x00, 0x0d,0x05,0x00, 0x03,0x0b,0x00, 0x0d,0x0b,0x00, 0x05,0x0d,0x00, 0x10,0x46,0x00, 0x8d,0xc8,0x44, 0x00,0x55,0x1e, 0x01,0x2e,0x00, 0xc3,0x26,0x02, 0x42,0x2a,0x02, 0x41,0x2c,0x01, 0x03,0x2c,0x00, 0x00,0x2d,0x00, 0x40,0x60,0x05, 0x00,0x55,0x0f, 0x40,0x69,0x05, 0x01,0x8b,0x44, 0x18,0x8b,0x44, 0xc8,0x01,0x0d, 0xc8,0x2a,0x0d, 0x83,0x06,0x82, 0x98,0x06,0x82, 0xc5,0x43,0x02, 0x55,0x43,0x03, 0xc5,0x64,0x02, 0xd6,0x64,0x02, 0x12,0x29,0x00, 0x80,0xd0,0x00, 0x97,0x48,0x04, 0x0b,0x00,0x07, 0x0b,0x2e,0x07, 0x53,0x28,0x06, 0x82,0x48,0x04, 0x82,0x60,0x04, 0x97,0x60,0x04, 0x44,0x29,0x07, 0x04,0x05,0x07, 0x52,0x04,0x07, 0x86,0x66,0x02, 0x16,0x82,0x00, 0x47,0x42,0x01, 0x95,0x66,0x01, 0x09,0x06,0x00, 0x14,0x06,0x00, 0x09,0x28,0x00, 0x1d,0x0f,0x40, 0x00,0x10,0x00, 0x80,0x0b,0x06, 0x85,0x08,0x05, 0x8d,0x00,0x03, 0x89,0x05,0x01, 0x40,0x0e,0x02, 0x42,0x0a,0x06, 0x4c,0x01,0x00, 0x48,0x06,0x00, 0x03,0x0e,0x01, 0x47,0x47,0x00, 0x0a,0x04,0x00, 0x04,0x09,0x00, 0x8b,0x83,0x85, 0x04,0x23,0x00, 0xc8,0x01,0x0e, 0x98,0xc5,0x03, 0xc3,0x45,0x03, 0x8a,0x1d,0x06, 0xd4,0x14,0x04, 0xd0,0x18,0x04, 0xc7,0x20,0x04, 0xc3,0x24,0x04, 0x9c,0x49,0x01, 0x56,0x42,0x02, 0xc5,0x03,0x04, 0x8d,0x1b,0x05, 0x16,0x51,0x04, 0x0b,0x00,0x08, 0xd2,0x16,0x04, 0xc5,0x22,0x04, 0xc2,0x07,0x05, 0x88,0x1f,0x05, 0x81,0x0a,0x01, 0xdc,0x87,0x00, 0x53,0x04,0x07, 0xc0,0x2a,0x00, 0x44,0x84,0x02, 0x0e,0x1a,0x07, 0x57,0x8f,0x00, 0xc7,0x02,0x04, 0x97,0x43,0x02, 0x42,0x26,0x00, 0x8c,0x5c,0x00, 0xd3,0x55,0x00, 0xd1,0x57,0x00, 0x89,0x5e,0x01, 0x46,0x61,0x02, 0xd5,0x13,0x04, 0x15,0x06,0x00, 0x08,0x07,0x00, 0x0f,0x19,0x00, 0x0e,0x20,0x00, 0x41,0x68,0x1c, 0x18,0x18,0x43, 0xc7,0x01,0x0d, 0xc8,0x2a,0x0d, 0x96,0x86,0x04, 0xcc,0x13,0x09, 0x42,0x63,0x04, 0x83,0x44,0x03, 0x16,0x1a,0x00, 0x15,0x67,0x03, 0xd5,0x16,0x04, 0xd3,0x03,0x04, 0x05,0x67,0x03, 0x01,0x47,0x04, 0x53,0x11,0x05, 0x80,0x22,0x05, 0x0a,0x2e,0x08, 0x0a,0x00,0x07, 0x9b,0x48,0x00, 0xc4,0x03,0x04, 0x97,0x24,0x05, 0x91,0x15,0x06, 0x03,0x29,0x08, 0x12,0x29,0x08, 0x97,0x1a,0x05, 0x11,0x05,0x08, 0x95,0x42,0x01, 0x51,0x12,0x06, 0x03,0x0c,0x02, 0x03,0x21,0x02, 0x54,0x10,0x05, 0x86,0x42,0x01, 0x86,0x66,0x01, 0x09,0x05,0x01, 0x40,0x0a,0x00, 0x41,0x25,0x00, 0x96,0x66,0x00, 0x54,0x17,0x06, 0x84,0x28,0x05, 0x94,0x28,0x05, 0xd4,0x04,0x04, 0x02,0x06,0x00, 0x15,0x0f,0x00, 0xdc,0x5c,0x01, 0x94,0x83,0x85, 0x00,0x1c,0x00, 0x0f,0x49,0x04, 0x0b,0x4e,0x04, 0x07,0x53,0x04, 0x44,0x57,0x03, 0x56,0x01,0x03, 0xd2,0x05,0x01, 0xcd,0x0c,0x04, 0xc9,0x11,0x04, 0x82,0x1a,0x01, 0x06,0x55,0x03, 0x48,0x92,0x00, 0xd1,0x47,0x01, 0x41,0x1b,0x00, 0x0a,0x10,0x06, 0x0e,0x8b,0x00, 0x0c,0x8d,0x00, 0x85,0x16,0x05, 0x15,0x02,0x00, 0x13,0x04,0x00, 0x10,0x08,0x00, 0x03,0x19,0x00, 0x40,0x5d,0x1f, 0x46,0x41,0x15, 0xc4,0xc8,0x04, 0x58,0x16,0x43, 0xc7,0x2a,0x0e, 0x82,0x12,0x15, 0x41,0x62,0x04, 0x06,0x2c,0x00, 0xd5,0x27,0x04, 0x04,0x66,0x03, 0x85,0x83,0x04, 0x4d,0x10,0x06, 0x56,0x53,0x03, 0xc3,0x8d,0x04, 0x0a,0x2e,0x08, 0x97,0x23,0x05, 0x13,0x51,0x03, 0x92,0x29,0x06, 0x85,0x29,0x05, 0xc2,0x15,0x00, 0x97,0x18,0x05, 0x43,0x64,0x03, 0x09,0x15,0x02, 0x04,0x19,0x02, 0x80,0x22,0x00, 0x96,0x26,0x04, 0x4a,0x07,0x00, 0x0b,0x11,0x01, 0x41,0x17,0x00, 0x02,0x28,0x06, 0x55,0x15,0x05, 0x14,0x68,0x02, 0x09,0x16,0x00, 0x1c,0x9a,0x01, 0x42,0xc9,0x43, 0x59,0x16,0x43, 0xc9,0x2a,0x0d, 0xca,0x01,0x0c, 0xcb,0x11,0x0b, 0x80,0xd1,0x01, 0x98,0x45,0x03, 0x05,0x45,0x03, 0xd6,0x27,0x04, 0x15,0x28,0x00, 0xc5,0x27,0x03, 0x16,0x53,0x03, 0x56,0x42,0x02, 0x88,0x13,0x03, 0x08,0x42,0x02, 0x03,0x87,0x03, 0x0c,0x00,0x08, 0xc1,0x4c,0x40, 0xc6,0x15,0x01, 0x0c,0x2e,0x07, 0xc4,0x62,0x02, 0x0e,0x10,0x06, 0xc6,0x28,0x04, 0xd3,0x29,0x05, 0x9c,0x09,0x01, 0x5d,0xd8,0x00, 0x98,0x63,0x03, 0x13,0x15,0x08, 0x53,0x04,0x07, 0x07,0x83,0x00, 0x18,0x92,0x00, 0x97,0x07,0x05, 0xc7,0x14,0x01, 0x46,0x04,0x06, 0x09,0x12,0x0e, 0x83,0x25,0x04, 0xc8,0x29,0x04, 0x46,0x19,0x00, 0x44,0x06,0x05, 0x95,0x14,0x05, 0x57,0x66,0x02, 0xd5,0x03,0x04, 0x09,0x16,0x00, 0x17,0x18,0x00, 0xdd,0x5b,0x01, 0x40,0x41,0x1c, 0x49,0xe0,0x03, 0xcc,0x58,0x03, 0x8e,0x54,0x03, 0x11,0x4f,0x03, 0xd4,0x0b,0x03, 0xca,0x9d,0x03, 0xd7,0x08,0x02, 0x48,0xa4,0x00, 0x10,0x51,0x03, 0x58,0x07,0x03, 0x53,0x4c,0x02, 0x4d,0xd6,0x01, 0x0f,0x13,0x00, 0x07,0x69,0x00, 0x4b,0x1b,0x05, 0x96,0x49,0x00, 0x52,0x8e,0x00, 0x95,0x0a,0x03, 0x1c,0x07,0x00, 0x1a,0x09,0x00, 0x1d,0x41,0x00, 0x08,0x53,0x0d, 0x18,0xdb,0x04, 0xc2,0xd9,0x03, 0xc8,0x01,0x0d, 0x44,0xc5,0x03, 0x56,0xc5,0x03, 0xc8,0x2a,0x0d, 0xd6,0x18,0x04, 0xc0,0x5d,0x01, 0x56,0x66,0x02, 0xc5,0x28,0x04, 0x82,0x48,0x01, 0x04,0x57,0x03, 0x5a,0x49,0x01, 0xc5,0x03,0x04, 0x0b,0x00,0x07, 0x07,0x27,0x00, 0x0b,0x2e,0x07, 0xd4,0x03,0x03, 0xd4,0x16,0x03, 0x52,0x12,0x06, 0x88,0x8f,0x00, 0x55,0x28,0x05, 0x84,0x64,0x02, 0x9a,0x86,0x00, 0x46,0x12,0x05, 0x83,0x86,0x00, 0x55,0x4f,0x01, 0xc1,0x9b,0x00, 0x86,0x16,0x04, 0x06,0x2c,0x11, 0x17,0x59,0x04, 0x03,0x29,0x08, 0x87,0x42,0x01, 0x95,0x42,0x01, 0x52,0x04,0x06, 0x52,0x17,0x06, 0x53,0x29,0x06, 0x43,0x58,0x03, 0x17,0x64,0x04, 0x0a,0x05,0x01, 0xc7,0x11,0x02, 0x14,0x11,0x00, 0xdd,0x5d,0x00, 0x18,0x8a,0x44, 0x82,0x06,0x43, 0xc8,0x01,0x0c, 0xc7,0x2a,0x0c, 0xc7,0x1a,0x0b, 0x83,0x63,0x03, 0x58,0x06,0x82, 0x00,0x8b,0x01, 0x85,0x43,0x02, 0xd6,0x63,0x01, 0x15,0x43,0x02, 0x14,0x18,0x00, 0xc4,0x17,0x04, 0x54,0x67,0x01, 0x92,0x19,0x03, 0x05,0x67,0x03, 0x0a,0x00,0x07, 0xd6,0x16,0x01, 0x0a,0x2e,0x07, 0x0a,0x1e,0x06, 0x81,0x23,0x01, 0x03,0x05,0x08, 0x81,0xc8,0x00, 0xd7,0x44,0x01, 0x57,0x60,0x04, 0x06,0x94,0x00, 0xd2,0x02,0x04, 0x11,0x29,0x07, 0x03,0x19,0x08, 0x46,0x42,0x02, 0x82,0x25,0x05, 0x13,0x28,0x06, 0xd5,0x17,0x01, 0x44,0x29,0x06, 0xc4,0x44,0x02, 0x5b,0x08,0x00, 0x57,0x14,0x00, 0x13,0x1c,0x01, 0x54,0x05,0x05, 0x55,0x66,0x01, 0x45,0x56,0x02, 0x06,0x68,0x03, 0x09,0x06,0x00, 0x16,0x08,0x00, 0x09,0x18,0x00, 0x9d,0xcf,0x00, 0x40,0x68,0x05, 0x40,0x4c,0x05, }; const unsigned short fontArialDig47n_CharOffs[28] PROGMEM = { 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0014, 0x0014, 0x0014, 0x0014, 0x0016, 0x001d, 0x001e, 0x001f, 0x001f, 0x003d, 0x004b, 0x0073, 0x009e, 0x00b6, 0x00d7, 0x0104, 0x011a, 0x0146, 0x0174, 0x0176, }; RRE_Font rre_ArialDig47n = { RRE_24B, 32,47, 0x20, 0x3a, (const uint8_t*)fontArialDig47n_Rects, (const uint16_t*)fontArialDig47n_CharOffs }; #endif
137.4
257
0.740611
ceeb310341c1a46b818d8231006bdfbdf74bac4d
959
h
C
src/lib/player/events/Event_dsp_decl.h
cyberixae/kunquat
06ae72b2c1519686cc510ce887d9d45a5c3fa3a3
[ "CC0-1.0" ]
null
null
null
src/lib/player/events/Event_dsp_decl.h
cyberixae/kunquat
06ae72b2c1519686cc510ce887d9d45a5c3fa3a3
[ "CC0-1.0" ]
null
null
null
src/lib/player/events/Event_dsp_decl.h
cyberixae/kunquat
06ae72b2c1519686cc510ce887d9d45a5c3fa3a3
[ "CC0-1.0" ]
null
null
null
/* * Author: Tomi Jylhä-Ollila, Finland 2013-2014 * * This file is part of Kunquat. * * CC0 1.0 Universal, http://creativecommons.org/publicdomain/zero/1.0/ * * To the extent possible under law, Kunquat Affirmers have waived all * copyright and related or neighboring rights to Kunquat. */ #ifndef K_EVENT_DSP_DECL_H #define K_EVENT_DSP_DECL_H #include <stdbool.h> #include <devices/Device_impl.h> #include <player/Channel.h> #include <player/Device_state.h> #include <Value.h> // Process function declarations #define EVENT_DSP_DEF(name, type_suffix, arg_type, validator) \ bool Event_dsp_##type_suffix##_process( \ const Device_impl* dimpl, \ Device_state* dstate, \ Channel* ch, \ const Value* value); #include <player/events/Event_dsp_types.h> #endif // K_EVENT_DSP_DECL_H
23.390244
71
0.622523
69dae0fef49f122598c7d168fb05c13353a9319f
368
h
C
MainPart/Classess/Mine/Controller/MineRoomChooseController.h
visualVk/Main_Part
7705f93f2667f141a34bd8d96a8d8585b8f1e207
[ "MIT" ]
null
null
null
MainPart/Classess/Mine/Controller/MineRoomChooseController.h
visualVk/Main_Part
7705f93f2667f141a34bd8d96a8d8585b8f1e207
[ "MIT" ]
null
null
null
MainPart/Classess/Mine/Controller/MineRoomChooseController.h
visualVk/Main_Part
7705f93f2667f141a34bd8d96a8d8585b8f1e207
[ "MIT" ]
null
null
null
// // MineRoomChooseController.h // MainPart // // Created by blacksky on 2020/3/15. // Copyright © 2020 blacksky. All rights reserved. // #import "QMUICommonViewController.h" typedef void (^RoomChooseBlock)(NSString *roomAddress); @interface MineRoomChooseController : QMUICommonViewController @property (nonatomic, strong) RoomChooseBlock roomChooseBlock; @end
26.285714
62
0.777174
cdc623f12198704965d65e660fa74644b35fd9e5
1,109
h
C
Pinochle/Round.h
nparajul/Pinochle
5cf692deb21be40929dd77659e98e42a79aedbbd
[ "MIT" ]
1
2020-11-03T18:08:18.000Z
2020-11-03T18:08:18.000Z
Pinochle/Round.h
nparajul/Pinochle
5cf692deb21be40929dd77659e98e42a79aedbbd
[ "MIT" ]
null
null
null
Pinochle/Round.h
nparajul/Pinochle
5cf692deb21be40929dd77659e98e42a79aedbbd
[ "MIT" ]
null
null
null
/* ************************************************************ * Name: Nitesh Parajuli * * Project: Project 1 Pinochle C++ * * Class: CMPS366 OPL * * Date: 09/29/2020 * ************************************************************ */ #pragma once #include<iostream> #include "Game.h" #include "Player.h" #include<vector> #include "Card.h" #include"Deck.h" #include "TurnInfo.h" class Round { public: //Round class constructor Round(Player* players[], unsigned int gameRounds,int nextTurn); //Round class destructor ~Round(); //Utility functions void beginRound(); void loadRoundDetails(vector<string> savedRoundDetails); private: // member variables Player** players; Deck* tDeck; Card* trumpCard; unsigned int mGameRounds; unsigned int mRoundTurns; unsigned int leadPlayerIndex; unsigned int chasePlayerIndex; bool isNewRound; // private member functions void dealCards(Player* player, int cards); int determineTurnWinner(int leadIndex, int chaseIndex); void saveGame(); };
23.104167
64
0.582507
6de0623a7b5f6c5c813ff9143d783aebcbbed17b
1,491
c
C
Unpacker/crass/cui/ADX/vgmstream-r526/src/layout/xa_blocked.c
weimingtom/X-moe
8bcca62db18800cb5ac7ad1309535c4c95156eb6
[ "MIT" ]
6
2018-10-12T05:01:49.000Z
2020-11-01T02:47:22.000Z
src/cui/ADX/vgmstream-r526/src/layout/xa_blocked.c
MaiReo/crass
11579527090faecab27f98b1e221172822928f57
[ "BSD-3-Clause" ]
null
null
null
src/cui/ADX/vgmstream-r526/src/layout/xa_blocked.c
MaiReo/crass
11579527090faecab27f98b1e221172822928f57
[ "BSD-3-Clause" ]
3
2017-09-27T17:28:30.000Z
2019-11-21T15:13:57.000Z
#include "layout.h" #include "../coding/coding.h" #include "../vgmstream.h" /* set up for the block at the given offset */ void xa_block_update(off_t block_offset, VGMSTREAM * vgmstream) { int i; int8_t currentChannel=0; int8_t subAudio=0; init_get_high_nibble(vgmstream); if(vgmstream->samples_into_block!=0) // don't change this variable in the init process vgmstream->xa_sector_length+=128; // We get to the end of a sector ? if(vgmstream->xa_sector_length==(18*128)) { vgmstream->xa_sector_length=0; // 0x30 of unused bytes/sector :( block_offset+=0x30; begin: // Search for selected channel & valid audio currentChannel=read_8bit(block_offset-7,vgmstream->ch[0].streamfile); subAudio=read_8bit(block_offset-6,vgmstream->ch[0].streamfile); // audio is coded as 0x64 if(!((subAudio==0x64) && (currentChannel==vgmstream->xa_channel))) { // go to next sector block_offset+=2352; if(currentChannel!=-1) goto begin; } } vgmstream->current_block_offset = block_offset; // Quid : how to stop the current channel ??? // i set up 0 to current_block_size to make vgmstream not playing bad samples // another way to do it ??? // (as the number of samples can be false in cd-xa due to multi-channels) vgmstream->current_block_size = (currentChannel==-1?0:112); vgmstream->next_block_offset = vgmstream->current_block_offset+128; for (i=0;i<vgmstream->channels;i++) { vgmstream->ch[i].offset = vgmstream->current_block_offset; } }
29.82
78
0.716968
982f356b3c123bac734675632ba7f74e2d473c91
2,935
c
C
sp_parser.c
Kirari-Senpai/trustword
4e83860077088167dc733e2644cfb4db6d17dca6
[ "BSD-2-Clause" ]
null
null
null
sp_parser.c
Kirari-Senpai/trustword
4e83860077088167dc733e2644cfb4db6d17dca6
[ "BSD-2-Clause" ]
null
null
null
sp_parser.c
Kirari-Senpai/trustword
4e83860077088167dc733e2644cfb4db6d17dca6
[ "BSD-2-Clause" ]
null
null
null
#include <stdlib.h> #include <string.h> #include <ctype.h> #include <errno.h> #include "trim.h" #include "sp_parser.h" char *replace(char *s, char *a, char *b) { char *pattern = strstr(s, a); if (!pattern) return NULL; int offset = pattern-s; size_t a_length = strlen(a); size_t b_length = strlen(b); size_t length = strlen(s)-a_length; int move_to = offset+a_length; length += strlen(b); length += 1; /* Por el terminador nulo */ char *buff = (char *)malloc(length); strncpy(buff, s, offset); strcat(buff, b); s += move_to; strcat(buff, s); s -= move_to; return buff; } char *env2val(char *s) { char *aux = s; char c, l = 0; /* 'c', es el carácter actual y 'l' el anterior */ int start, end; int length; int counter; int offset; int i, j, z; char *buff = NULL, *replaced = NULL; char *env_val = NULL; char *new_s = strdup(s), *new_s_aux = NULL; counter = 0, offset = 0; while ((c = *aux++)) { if (c == '$' && l != '\\') { counter++; if ((c = *aux++) == '{') { start = ++counter; while ((c = *aux++) != '}' && c) offset++; end = start+offset; if (c != '}') /* Error de sintaxis */ continue; length = end-start+1; buff = (char *)malloc(length); for (i = start, j = end, z = 0; i < j; i++, z++) buff[z] = s[i]; buff[z] = '\0'; env_val = getenv(buff); if (env_val) { env_val = strdup(env_val); replaced = (char *)malloc(length+3); /* 3 para agregar: '$', '{' y '}' */ strcpy(replaced, "$"); strcat(replaced, "{"); strcat(replaced, buff); strcat(replaced, "}"); new_s_aux = new_s; new_s = replace(new_s, replaced, env_val); free(new_s_aux); free(replaced); } free(buff); free(env_val); counter += offset; offset = 0; } } counter++; l = c; } return new_s; } int simple_read_config(const char *fn, parser_function cll, void *config) { char *lineptr = NULL; size_t n = 0; char *key = NULL, *aux_key = NULL; char *value = NULL, *aux_value = NULL; char *new_value = NULL; char *aux_lineptr = NULL; FILE *stream; int rc = 0; int rspaces = 0; if (fn == NULL) stream = DEFAULT_STREAM; else if ((stream = fopen(fn, "rb")) == NULL) return errno; while (getline(&lineptr, &n, stream) > 0) { aux_lineptr = lineptr; if (aux_lineptr[0] == '\n') continue; lstrip(aux_lineptr, NULL); if (aux_lineptr[0] == ';') continue; if (strcmp(aux_lineptr, "") == 0) continue; aux_key = strtok(aux_lineptr, ":"); lstrip(aux_key, NULL); rstrip(aux_key, &rspaces); key = strdup(aux_key); aux_value = aux_lineptr; aux_value += strlen(key)+rspaces+1; trim(aux_value); new_value = env2val(aux_value); rc = cll(key, new_value, config); free(key); free(value); free(new_value); value = NULL; if (rc != 0) break; } free(lineptr); if (stream != DEFAULT_STREAM) fclose(stream); return rc; }
18.575949
78
0.576831
8963f4e69798b3385c4b054c3db1cd8e2ca04286
5,112
h
C
life/lifeclient/gameclientslavemanager.h
highfestiva/life
b05b592502d72980ab55e13e84330b74a966f377
[ "BSD-3-Clause" ]
9
2019-09-03T18:33:31.000Z
2022-02-04T04:00:02.000Z
life/lifeclient/gameclientslavemanager.h
highfestiva/life
b05b592502d72980ab55e13e84330b74a966f377
[ "BSD-3-Clause" ]
null
null
null
life/lifeclient/gameclientslavemanager.h
highfestiva/life
b05b592502d72980ab55e13e84330b74a966f377
[ "BSD-3-Clause" ]
null
null
null
// Author: Jonas Byström // Copyright (c) Pixel Doctrine #pragma once #include "../../cure/include/gamemanager.h" #include "../../cure/include/packet.h" #include "../../cure/include/positionaldata.h" #include "../../cure/include/useraccount.h" #include "../../lepra/include/alarm.h" #include "../../lepra/include/graphics2d.h" #include "clientoptionsmanager.h" #include "inputobserver.h" #include "screenpart.h" namespace cure { class NetworkClient; class ResourceManager; } namespace UiCure { class GameUiManager; } namespace life { class GameClientMasterTicker; class MasterServerConnection; class GameClientSlaveManager: public cure::GameManager, public InputObserver, public ScreenPart { public: typedef cure::GameManager Parent; GameClientSlaveManager(GameClientMasterTicker* pMaster, const cure::TimeManager* time, cure::RuntimeVariableScope* variable_scope, cure::ResourceManager* resource_manager, UiCure::GameUiManager* ui_manager, int slave_index, const PixelRect& render_area); virtual ~GameClientSlaveManager(); void SetMasterServerConnection(MasterServerConnection* connection); virtual void Resume(bool hard); virtual void Suspend(bool hard); virtual void LoadSettings(); virtual void SaveSettings() = 0; virtual void RefreshOptions(); virtual void SetRenderArea(const PixelRect& render_area); virtual bool Open(); virtual void Close(); bool IsQuitting() const; virtual void SetIsQuitting(); virtual void SetFade(float fade_amount) = 0; GameClientMasterTicker* GetMaster() const; virtual bool Render(); virtual bool Paint(); virtual bool IsPrimaryManager() const; virtual void PreEndTick(); virtual bool EndTick(); void TickNetworkInput(); bool TickNetworkOutput(); void TickNetworkOutputGhosts(); void ToggleConsole(); virtual void RequestLogin(const str& server_address, const cure::LoginId& login_token); virtual void OnLoginSuccess(); void Logout(); bool IsLoggingIn() const; bool IsUiMoveForbidden(cure::GameObjectId object_id) const; void AddLocalObjects(std::unordered_set<cure::GameObjectId>& local_object_set); virtual bool IsOwned(cure::GameObjectId object_id) const; virtual bool OnKeyDown(uilepra::InputManager::KeyCode key_code); virtual bool OnKeyUp(uilepra::InputManager::KeyCode key_code); virtual void OnInput(uilepra::InputElement* element); virtual void HandleUnusedRelativeAxis(); int GetSlaveIndex() const; virtual PixelRect GetRenderArea() const; virtual float UpdateFrustum(float fov); protected: typedef std::vector<cure::GameObjectId> ObjectArray; typedef std::unordered_set<uilepra::InputElement*, LEPRA_VOIDP_HASHER> InputElementSet; enum SteeringPlaybackMode { kPlaybackNone = 0, kPlaybackRecord, kPlaybackPlay, }; str GetApplicationCommandFilename() const; virtual bool Reset(); virtual bool InitializeUniverse() = 0; virtual void TickUiUpdate() = 0; virtual void SetLocalRender(bool render) = 0; virtual void ProcessNetworkInputMessage(cure::Message* message); virtual void ProcessNetworkStatusMessage(cure::MessageStatus* message); virtual void ProcessNumber(cure::MessageNumber::InfoType type, int32 integer, float32 f); cure::ContextObject* CreateObject(cure::GameObjectId instance_id, const str& class_id, cure::NetworkObjectType network_type, xform* transform = 0); void SetMovement(cure::GameObjectId instance_id, int32 frame_index, cure::ObjectPositionalData& data, float delta_threshold); virtual bool OnPhysicsSend(cure::ContextObject* object); virtual bool OnAttributeSend(cure::ContextObject* object); bool IsServer(); void SendAttach(cure::ContextObject*, unsigned, cure::ContextObject*, unsigned); void SendDetach(cure::ContextObject*, cure::ContextObject*); void OnIdOwnershipExpired(int, cure::ContextObject* object, void*); void AttachObjects(cure::GameObjectId object1_id, unsigned body1_index, cure::GameObjectId object2_id, unsigned body2_index); void DetachObjects(cure::GameObjectId object1_id, cure::GameObjectId object2_id); cure::NetworkClient* GetNetworkClient() const; virtual void UpdateCameraPosition(bool update_mic_position) = 0; virtual void DrawAsyncDebugInfo(); void DrawDebugStaple(int index, int height, const Color& color); virtual void DrawSyncDebugInfo(); typedef std::unordered_map<cure::GameObjectId, int> ObjectFrameIndexMap; typedef std::unordered_set<cure::GameObjectId> ObjectIdSet; UiCure::GameUiManager* ui_manager_; const int slave_index_; PixelRect render_area_; MasterServerConnection* master_server_connection_; ObjectFrameIndexMap object_frame_index_map_; bool is_reset_; bool is_reset_complete_; bool quit_; ObjectIdSet owned_object_list_; uint64 last_sent_byte_count_; Timer last_send_time_; int ping_attempt_count_; Timer last_unsafe_receive_time_; Alarm collision_expire_alarm_; Alarm input_expire_alarm_; Alarm send_expire_alarm_; InputElementSet relative_axis_; InputElementSet unused_relative_axis_; bool allow_movement_input_; options::ClientOptionsManager options_; str connect_user_name_; str connect_server_address_; str disconnect_reason_; logclass(); }; }
30.070588
126
0.794014
a6a8b44a35ca7410bc969bf25b9875fa103e4901
6,902
h
C
src/libYARP_OS/include/yarp/YARPRefCount.h
robotology-legacy/yarp1
21434f5b776edea201b39a9644552dca59339dbc
[ "Artistic-1.0-Perl" ]
null
null
null
src/libYARP_OS/include/yarp/YARPRefCount.h
robotology-legacy/yarp1
21434f5b776edea201b39a9644552dca59339dbc
[ "Artistic-1.0-Perl" ]
null
null
null
src/libYARP_OS/include/yarp/YARPRefCount.h
robotology-legacy/yarp1
21434f5b776edea201b39a9644552dca59339dbc
[ "Artistic-1.0-Perl" ]
null
null
null
///////////////////////////////////////////////////////////////////////// /// /// /// /// /// This Academic Free License applies to any software and associated /// /// documentation (the "Software") whose owner (the "Licensor") has /// /// placed the statement "Licensed under the Academic Free License /// /// Version 1.0" immediately after the copyright notice that applies /// /// to the Software. /// /// Permission is hereby granted, free of charge, to any person /// /// obtaining a copy of the Software (1) to use, copy, modify, merge, /// /// publish, perform, distribute, sublicense, and/or sell copies of /// /// the Software, and to permit persons to whom the Software is /// /// furnished to do so, and (2) under patent claims owned or /// /// controlled by the Licensor that are embodied in the Software as /// /// furnished by the Licensor, to make, use, sell and offer for sale /// /// the Software and derivative works thereof, subject to the /// /// following conditions: /// /// Redistributions of the Software in source code form must retain /// /// all copyright notices in the Software as furnished by the /// /// Licensor, this list of conditions, and the following disclaimers. /// /// Redistributions of the Software in executable form must reproduce /// /// all copyright notices in the Software as furnished by the /// /// Licensor, this list of conditions, and the following disclaimers /// /// in the documentation and/or other materials provided with the /// /// distribution. /// /// /// /// Neither the names of Licensor, nor the names of any contributors /// /// to the Software, nor any of their trademarks or service marks, /// /// may be used to endorse or promote products derived from this /// /// Software without express prior written permission of the Licensor./// /// /// /// DISCLAIMERS: LICENSOR WARRANTS THAT THE COPYRIGHT IN AND TO THE /// /// SOFTWARE IS OWNED BY THE LICENSOR OR THAT THE SOFTWARE IS /// /// DISTRIBUTED BY LICENSOR UNDER A VALID CURRENT LICENSE. EXCEPT AS /// /// EXPRESSLY STATED IN THE IMMEDIATELY PRECEDING SENTENCE, THE /// /// SOFTWARE IS PROVIDED BY THE LICENSOR, CONTRIBUTORS AND COPYRIGHT /// /// OWNERS "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 NON-INFRINGEMENT. IN NO /// /// EVENT SHALL THE LICENSOR, CONTRIBUTORS OR COPYRIGHT OWNERS 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. /// /// /// /// This license is Copyright (C) 2002 Lawrence E. Rosen. All rights /// /// reserved. Permission is hereby granted to copy and distribute /// /// this license without modification. This license may not be /// /// modified without the express written permission of its copyright /// /// owner. /// /// /// /// /// ///////////////////////////////////////////////////////////////////////// /// /// $Id: YARPRefCount.h,v 2.0 2005-11-06 22:21:26 gmetta Exp $ /// /// /* paulfitz Mon May 21 16:51:13 EDT 2001 */ #ifndef YARPRefCounted_INC #define YARPRefCounted_INC #include <yarp/YARPConfig.h> #include <ace/config.h> #include <ace/Synch.h> #include <ace/Log_Msg.h> #include <yarp/YARPAll.h> #ifdef YARP_HAS_PRAGMA_ONCE # pragma once #endif // All the operations in YARPRefCounted need to be mutexed. #define YARPREFCOUNT_SINGLE_MUTEX #ifndef YARPREFCOUNT_SINGLE_MUTEX #error "Code not written for per-ref mutex" #endif class YARPRefCount; typedef YARPRefCount *PYARPRefCount; PYARPRefCount AddYarpRefCount(PYARPRefCount& ref); class YARPRefCount { protected: int ref_count; public: YARPRefCount(); virtual ~YARPRefCount(); int GetReferenceCount() { return ref_count; } void AddRef(); void RemoveRef(); void ZeroRef(); virtual void Destroy() {} friend PYARPRefCount AddYarpRefCount(PYARPRefCount& ref); }; class YARPRefCounted : public YARPRefCount { public: virtual void Destroy() {} // returns NULL if only one user of object and always_clone is false, // otherwise should return a copy of the object if possible virtual void *Clone(bool always_clone) { ACE_UNUSED_ARG(always_clone); return NULL; } }; class YARPRefCountedBuffer : public YARPRefCounted { protected: char *memory; int len; int owned; public: YARPRefCountedBuffer() { memory = NULL; owned = 0; } YARPRefCountedBuffer(int nlen) { memory = new char[nlen]; ACE_ASSERT(memory!=NULL); owned = 1; len = nlen; } YARPRefCountedBuffer(char *n_memory, int n_len, int n_owned = 0) { memory = n_memory; len = n_len; owned = n_owned; } virtual ~YARPRefCountedBuffer() { if (memory!=NULL && owned) { delete[] memory; } memory = NULL; } void Set(char *n_memory, int n_len, int n_owned = 0) { ACE_ASSERT(memory==NULL); memory = n_memory; len = n_len; owned = n_owned; } virtual void *Clone(int always_clone) { ACE_UNUSED_ARG(always_clone); int is_implemented=0; ACE_ASSERT(is_implemented==1); return NULL; } char *GetRawBuffer() { return memory; } int GetLength() { return len; } void ForceLength(int n_len) { len = n_len; } int GetReferenceCount() { return ref_count; } }; // Intended to be applied to RefCounted objects only template <class T> class YARPRefCountedPtr { public: T *ptr; YARPRefCountedPtr() { ptr = NULL; } YARPRefCountedPtr(T *nptr) { ptr = NULL; Take(nptr); } virtual ~YARPRefCountedPtr() { Reset(); } T *Ptr() { return ptr; } void Set(T *nptr) { Reset(); ptr = nptr; ACE_ASSERT(ptr!=NULL); ptr->AddRef(); } void Take(T *nptr) { Reset(); ptr = nptr; } void Reset() { if (ptr!=NULL) ptr->RemoveRef(); ptr = NULL; } /* void Switch(CountedPtr<T>& peer) { T *tmp = ptr; ptr = peer.ptr; peer.ptr = tmp; } */ void MakeIndependent() { int needed; T *nptr; if (ptr!=NULL) { nptr = (T*)ptr->Clone(false); if (nptr!=NULL) { Take(nptr); } } } }; #endif
28.758333
74
0.58838
727edd25696280009b27afd87cd1235f1c03674e
757
h
C
Linux_Kernel/linux-master/sound/soc/intel/boards/hda_dsp_common.h
shmily1012/linux-zns
42468ce9bd95cf621c93ea9f74a86e66ca223ef1
[ "MIT" ]
null
null
null
Linux_Kernel/linux-master/sound/soc/intel/boards/hda_dsp_common.h
shmily1012/linux-zns
42468ce9bd95cf621c93ea9f74a86e66ca223ef1
[ "MIT" ]
null
null
null
Linux_Kernel/linux-master/sound/soc/intel/boards/hda_dsp_common.h
shmily1012/linux-zns
42468ce9bd95cf621c93ea9f74a86e66ca223ef1
[ "MIT" ]
null
null
null
/* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright(c) 2019 Intel Corporation. */ /* * This file defines helper functions used by multiple * Intel HDA based machine drivers. */ #ifndef __HDA_DSP_COMMON_H #define __HDA_DSP_COMMON_H #include <sound/hda_codec.h> #include <sound/hda_i915.h> #include "../../codecs/hdac_hda.h" struct snd_pcm *hda_dsp_hdmi_pcm_handle(struct snd_soc_card *card, int hdmi_idx); #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC) int hda_dsp_hdmi_build_controls(struct snd_soc_card *card, struct snd_soc_component *comp); #else static inline int hda_dsp_hdmi_build_controls(struct snd_soc_card *card, struct snd_soc_component *comp) { return -EINVAL; } #endif #endif /* __HDA_DSP_COMMON_H */
22.939394
72
0.756935
902ccd39cdc52d6adb24ce330ce2e2ee92fab60c
104
h
C
src/boolean_task.h
JDVDev/PebbleApplication
1b2566043acf28d7e6d841ac3819b1ce05d8185f
[ "Apache-2.0" ]
null
null
null
src/boolean_task.h
JDVDev/PebbleApplication
1b2566043acf28d7e6d841ac3819b1ce05d8185f
[ "Apache-2.0" ]
null
null
null
src/boolean_task.h
JDVDev/PebbleApplication
1b2566043acf28d7e6d841ac3819b1ce05d8185f
[ "Apache-2.0" ]
null
null
null
#pragma once void draw_boolean_menu(char *message, TextLayer *output_layer, ActionBarLayer *action_bar);
52
91
0.836538
b80d047b84b4fe811d0253fffe31ff067c49c773
2,836
c
C
src/atrshmlogfinish.c
atrsoftgmbh/atrshmlog
4ca1a2cc6ff26890a02d74db378e597353f197d3
[ "Apache-2.0" ]
null
null
null
src/atrshmlogfinish.c
atrsoftgmbh/atrshmlog
4ca1a2cc6ff26890a02d74db378e597353f197d3
[ "Apache-2.0" ]
null
null
null
src/atrshmlogfinish.c
atrsoftgmbh/atrshmlog
4ca1a2cc6ff26890a02d74db378e597353f197d3
[ "Apache-2.0" ]
null
null
null
/*********************************************************************** * This software is part of the atrshmlog package * * Copyright (c) 2016 ATRSoft GmbH * * and is licensed under the * * Apache License, Version 2.0 * * by ATRSoft GmbH * * * * A copy of the License is available at * * http://www.apache.org/licenses/LICENSE-2.0 * * * * Anton Rommerskirchen <atr@atrsoft.de> * * * ***********************************************************************/ /** \file atrshmlogfinish.c * \brief We give any resource free in the shared memory buffer. * * This is needed if we use resources that are high level constucts like * Mutexes or condition variables. */ #include "atrshmlog.h" #include "atrshmlog_internal.h" #include <stdio.h> #include <stdlib.h> /* *--------------------------------------------------- */ /** * attach and then log off from the internal locks * this means you destroy themutex / futex / semaphore / whatever * that synchronise the buffer. * you should not use it then any more. * reinit it if you want - perhaps you need to switch some flag values * so you can use defekt for this. * in practise this is only needed if your os cannot cleanup the resources * of the locks if you remove the buffer before this step. * on a normal os this should be not needed. */ int main (int argc, char*argv[]) { const char *shmid_ptr = ATRSHMLOG_GET_ENV_SHMID(); if (shmid_ptr == (void*)0) { printf("usage: %s count\n", argv[0]); printf("ENVIRONMENT VARIABLE NOT SET !!!\n"); printf("%s_ID\n",ATRSHMLOG_GET_ENV_PREFIX()); printf("logsystem version is %d.\n", ATRSHMLOGVERSION); exit(1); } if (argc != 2) { printf("usage: %s count\n", argv[0]); printf("parameter count wrong.\n"); printf("logsystem version is %d.\n", ATRSHMLOGVERSION); exit(1); } printf("shm log attach and finish mutexe.\n"); printf("logsystem version is %d.\n", ATRSHMLOGVERSION); ATRSHMLOG_ATTACH(); if (!ATRSHMLOG_LOGGING) { printf ("attach not successful.\ncheck ENVIRONMENT VARIABLE %s_ID\n" "Value seems not to fit : '%s'\n", ATRSHMLOG_GET_ENV_PREFIX(),shmid_ptr); exit(1); } fflush(stdout); volatile const void* a = ATRSHMLOG_GET_AREA(); ATRSHMLOG_CLEANUP_LOCKS(a); return 0; } /* end of file */
30.826087
83
0.500705
fc0a44d7d884cb1882f854b97a7648bbe1967b89
289
h
C
tests/unit/common/curl.h
PascalMarechal/cpphttp
7cf0a95cf46cf496b096c3c3ae6af55f66baa582
[ "MIT" ]
null
null
null
tests/unit/common/curl.h
PascalMarechal/cpphttp
7cf0a95cf46cf496b096c3c3ae6af55f66baa582
[ "MIT" ]
null
null
null
tests/unit/common/curl.h
PascalMarechal/cpphttp
7cf0a95cf46cf496b096c3c3ae6af55f66baa582
[ "MIT" ]
null
null
null
/** * Copyright (c) 2020 Pascal Marechal * * Distributed under the MIT License. (See accompanying file LICENSE) */ #pragma once #include <string> bool checkUrl(const char *url); std::string getPage(const char *url); std::string postPage(const char *postUrl, const char *postData);
22.230769
70
0.719723
f752710e66ef670ce8098d419b9e8df72f192db7
6,918
c
C
skynet-src/skynet_handle.c
djianq/Game
d34a18e0d4cf8a0fb182285520c3b91e47968ad2
[ "MIT" ]
null
null
null
skynet-src/skynet_handle.c
djianq/Game
d34a18e0d4cf8a0fb182285520c3b91e47968ad2
[ "MIT" ]
null
null
null
skynet-src/skynet_handle.c
djianq/Game
d34a18e0d4cf8a0fb182285520c3b91e47968ad2
[ "MIT" ]
null
null
null
#include "skynet.h" #include "skynet_handle.h" #include "skynet_server.h" #include "rwlock.h" #include <stdlib.h> #include <assert.h> #include <string.h> #define DEFAULT_SLOT_SIZE 4 #define MAX_SLOT_SIZE 0x40000000 // skynet 服务编号的管理和分配 // handle_name 服务 name 和 对应 handle id 的 hash表 struct handle_name { char *name; uint32_t handle; }; // 存储handle与skynet_context的对应关系,是一个哈希表 // 每个服务skynet_context都对应一个不重复的handle // 通过handle便可获取skynet_context // 保存了 handle 和 skynet_context的对应 struct handle_storage { struct rwlock lock; // 读写锁 uint32_t harbor; // 服务所属 harbor harbor 用于不同主机间通信 uint32_t handle_index; // 初始值为1,表示handle句柄起始值从1开始 int slot_size; // hash 表空间大小,初始为DEFAULT_SLOT_SIZE struct skynet_context **slot; // skynet_context 表空间 int name_cap; // handle_name容量,初始为2,这里 name_cap 与 slot_size 不一样的原因在于,不是每个 handle 都有name int name_count; // handle_name数 struct handle_name *name; // handle_name表 }; static struct handle_storage *H = NULL; // 注册ctx,将 ctx 存到 handle_storage 哈希表中,并得到一个handle uint32_t skynet_handle_register(struct skynet_context *ctx) { struct handle_storage *s = H; rwlock_wlock(&s->lock); for(;;) { int i; for(i = 0; i < s->slot_size; ++i) { uint32_t handle = (i + s->handle_index) & HANDLE_MASK; int hash = handle & (s->slot_size - 1); // 等价于 handle % s->slot_size if(s->slot[hash] == NULL) // 找到未使用的 slot 将这个 ctx 放入这个 slot 中 { s->slot[hash] = ctx; s->handle_index = handle + 1; // 移动 handle_index 方便下次使用 rwlock_wunlock(&s->lock); handle |= s->harbor; // harbor 用于不同主机间的通信 handle高8位用于harbor 低24位用于本机的 所以这里 return handle; } } assert((s->slot_size * 2 - 1) <= HANDLE_MASK); // 确保 扩大2倍空间后 总共handle即 slot的数量不超过 24位的限制 // 哈希表扩大2倍 struct skynet_context **new_slot = skynet_malloc(s->slot_size * 2 * sizeof(struct skynet_context *)); memset(new_slot, 0, s->slot_size * 2 * sizeof(struct skynet_context *)); // 将原来的数据拷贝到新的空间 for(i = 0; i < s->slot_size; ++i) { int hash = skynet_context_handle(s->slot[i]) & (s->slot_size * 2 - 1); // 映射新的 hash 值 assert(new_slot[hash] == NULL); new_slot[hash] = s->slot[i]; } skynet_free(s->slot); // free old mem s->slot = new_slot; s->slot_size *= 2; } } // 收回handle int skynet_handle_retire(uint32_t handle) { int ret = 0; struct handle_storage *s = H; rwlock_wlock(&s->lock); uint32_t hash = handle & (s->slot_size - 1); // 等价于 handle % s->slot_size struct skynet_context *ctx = s->slot[hash]; if(ctx != NULL && skynet_context_handle(ctx) == handle) { s->slot[hash] = NULL; // 置空,哈希表腾出空间 ret = 1; int i; int j = 0, n = s->name_count; for(i = 0; i < n; ++i) { if(s->name[i].handle == handle) // 在 name 表中 找到 handle 对应的 name free掉 { skynet_free(s->name[i].name); continue; } else if(i != j) // 说明free了一个name { s->name[j] = s->name[i]; // 因此需要将后续元素移到前面 } ++j; } s->name_count = j; } else { ctx = NULL; } rwlock_wunlock(&s->lock); if(ctx) { // release ctx may call skynet_handle_* , so wunlock first. skynet_context_release(ctx); // free skynet_ctx } return ret; } // 收回所有handle void skynet_handle_retireall() { struct handle_storage *s = H; for(;;) { int n = 0; int i; for(i = 0; i <s->slot_size; ++i) { rwlock_rlock(&s->lock); struct skynet_context *ctx = s->slot[i]; uint32_t handle = 0; if(ctx) handle = skynet_context_handle(ctx); rwlock_runlock(&s->lock); if(handle != 0) { if(skynet_handle_retire(handle)) { ++n; } } } if(n == 0) return; } } // 通过handle获取skynet_context, skynet_context的引用计数加1 struct skynet_context *skynet_handle_grab(uint32_t handle) { struct handle_storage *s = H; struct skynet_context *result = NULL; rwlock_rlock(&s->lock); uint32_t hash = handle & (s->slot_size - 1); struct skynet_context *ctx = s->slot[hash]; if(ctx && skynet_context_handle(ctx) == handle) { result = ctx; skynet_context_grab(result); // __sync_add_and_fetch(&ctx->ref,1); skynet_context引用计数加1 } rwlock_runlock(&s->lock); return result; } // 根据名称查找handle uint32_t skynet_handle_findname(const char *name) { struct handle_storage *s = H; rwlock_rlock(&s->lock); uint32_t handle = 0; int begin = 0; int end = s->name_count - 1; while(begin <= end) { int mid = (begin + end) / 2; // 这里用的二分查找 听说会有整形溢出 改成减法可以避免 不清楚具体怎么搞 struct handle_name *n = &s->name[mid]; int c = strcmp(n->name, name); // 一直在头部插入 实际上这样插入后 name 会按长度大小排好序 这样就能使用二分查找了 if(c == 0) { handle = n->handle; break; } if(c < 0) { begin = mid + 1; } else { end = mid - 1; } } rwlock_runlock(&s->lock); return handle; } static void _insert_name_before(struct handle_storage *s, char *name, uint32_t handle, int before) { if(s->name_count >= s->name_cap) { s->name_cap *= 2; assert(s->name_cap <= MAX_SLOT_SIZE); struct handle_name *n = skynet_malloc(s->name_cap * sizeof(struct handle_name)); int i; for(i = 0; i < before; ++i) { n[i] = s->name[i]; } for(i = before; i < s->name_count; ++i) { n[i + 1] = s->name[i]; } skynet_free(s->name); s->name = n; } else { int i; // before之后的元素后移一个位置 for(i = s->name_count; i > before; --i) { s->name[i] = s->name[i - 1]; } } s->name[before].name = name; s->name[before].handle = handle; ++s->name_count; } // 插入 name 和 handle static const char *_insert_name(struct handle_storage *s, const char *name, uint32_t handle) { int begin = 0; int end = s->name_count - 1; // 二分查找 while(begin <= end) { int mid = (begin + end) / 2; struct handle_name *n = &s->name[mid]; int c = strcmp(n->name, name); if(c == 0) { return NULL; // 名称已存在 这里名称不能重复插入 } if(c < 0) { begin = mid + 1; } else { end = mid - 1; } } char *result = skynet_strdup(name); _insert_name_before(s, result, handle, begin); // 一直在头部插入 实际上这样插入后 name 会按长度大小排好序 这样就能使用二分查找了 return result; } // name与handle绑定 // 给服务注册一个名称的时候会用到该函数 const char *skynet_handle_namehandle(uint32_t handle, const char *name) { rwlock_wlock(&H->lock); const char *ret = _insert_name(H, name, handle); rwlock_wunlock(&H->lock); return ret; } //初始化一个 handle 就是初始化 handle_storage void skynet_handle_init(int harbor) { assert(H == NULL); struct handle_storage *s = skynet_malloc(sizeof(*H)); s->slot_size = DEFAULT_SLOT_SIZE; // 表空间初始为DEFAULT_SLOT_SIZE s->slot = skynet_malloc(s->slot_size * sizeof(struct skynet_context *)); // 为 skynet_ctx 分配空间 memset(s->slot, 0, s->slot_size * sizeof(struct skynet_context *)); rwlock_init(&s->lock); // reserve 0 for system s->harbor = (uint32_t)(harbor & 0xff) << HANDLE_REMOTE_SHIFT; //高8位 s->handle_index = 1; // handle句柄从1开始,0保留 0听云大讲原来是打算将0号服务作为控制中心的 s->name_cap = 2; // 名字容量初始为2 s->name_count = 0; s->name = skynet_malloc(s->name_cap * sizeof(struct handle_name)); H = s; // Don't need to free H }
21.61875
103
0.647297
dea60aed1fc08daa5fd5027993a93b5d7c93ba92
1,156
h
C
include/grub/i386/wrmsr.h
dingjingmaster/graceful-grub
7e57edc3cbd61774bbb57119c1893c77cb547d6a
[ "MIT" ]
null
null
null
include/grub/i386/wrmsr.h
dingjingmaster/graceful-grub
7e57edc3cbd61774bbb57119c1893c77cb547d6a
[ "MIT" ]
null
null
null
include/grub/i386/wrmsr.h
dingjingmaster/graceful-grub
7e57edc3cbd61774bbb57119c1893c77cb547d6a
[ "MIT" ]
null
null
null
/* * GRUB -- GRand Unified Bootloader * Copyright (C) 2019 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * GRUB 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 GRUB. If not, see <http://www.gnu.org/licenses/>. */ #ifndef GRUB_WRMSR_H #define GRUB_WRMSR_H 1 /* * TODO: Add a general protection exception handler. * Accessing a reserved or unimplemented MSR address results in a GP#. */ static inline void grub_msr_write(grub_uint32_t msr_id, grub_uint64_t msr_value) { grub_uint32_t low = msr_value, high = msr_value >> 32; asm volatile ("wrmsr" : : "c" (msr_id), "a" (low), "d" (high)); } #endif /* GRUB_WRMSR_H */
32.111111
76
0.711938
1ca8c85905e6c49d86bbb708bb975bfb08f54d6e
375
h
C
Salmon/Services/ServiceCenter/Core/ISMServiceEntryLoader.h
zhou921803/Salmon
368018475a61d8988c3342f4898eaa96c8b36966
[ "BSD-2-Clause" ]
null
null
null
Salmon/Services/ServiceCenter/Core/ISMServiceEntryLoader.h
zhou921803/Salmon
368018475a61d8988c3342f4898eaa96c8b36966
[ "BSD-2-Clause" ]
null
null
null
Salmon/Services/ServiceCenter/Core/ISMServiceEntryLoader.h
zhou921803/Salmon
368018475a61d8988c3342f4898eaa96c8b36966
[ "BSD-2-Clause" ]
null
null
null
// // ISMServiceEntryLoader.h // Salmon // // Created by 周正炎 on 2018/12/10. // Copyright © 2018 周正炎. All rights reserved. // #import <Foundation/Foundation.h> NS_ASSUME_NONNULL_BEGIN @class SMServiceEntryConfig; /** * 服务入口加载器? */ @protocol ISMServiceEntryLoader <NSObject> @required - (SMServiceEntryConfig*)loadSMServiceEntryConfig; @end NS_ASSUME_NONNULL_END
13.888889
50
0.741333
1cc392012e35c0b8bd3e79087288b94a0d136f88
3,645
h
C
Breeder/BR_Update.h
nikolalkc/sws
08d3c6fce05191347092a55df6dd5d4764f1de9c
[ "MIT" ]
285
2016-10-16T00:35:58.000Z
2022-03-25T04:46:58.000Z
Breeder/BR_Update.h
nikolalkc/sws
08d3c6fce05191347092a55df6dd5d4764f1de9c
[ "MIT" ]
754
2016-09-23T20:32:01.000Z
2022-03-31T10:30:07.000Z
Breeder/BR_Update.h
nikolalkc/sws
08d3c6fce05191347092a55df6dd5d4764f1de9c
[ "MIT" ]
77
2017-01-16T16:55:03.000Z
2022-03-10T08:58:21.000Z
/****************************************************************************** / BR_Update.h / / Copyright (c) 2013 and later Dominik Martin Drzic / http://forum.cockos.com/member.php?u=27094 / http://github.com/reaper-oss/sws / / Permission is hereby granted, free of charge, to any person obtaining a copy / of this software and associated documentation files (the "Software"), to deal / in the Software without restriction, including without limitation the rights to / use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies / of the Software, and to permit persons to whom the Software is furnished to / do so, subject to the following conditions: / / The above copyright notice and this permission notice shall be included in all / copies or substantial portions of the Software. / / THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, / EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES / OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND / NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT / HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, / WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING / FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR / OTHER DEALINGS IN THE SOFTWARE. / ******************************************************************************/ #pragma once /****************************************************************************** * Version check init/exit * ******************************************************************************/ int VersionCheckInitExit (bool init); /****************************************************************************** * Command and preferences (used from About dialog) * ******************************************************************************/ void VersionCheckAction (COMMAND_T*); void VersionCheckDialog (HWND hwnd); void GetStartupSearchOptions (bool* official, bool* beta, unsigned int* lastTime); void SetStartupSearchOptions (bool official, bool beta, unsigned int lastTime); /****************************************************************************** * Holds version information * ******************************************************************************/ struct BR_Version { int maj; // major int min; // minor int rev; // revision int build; // build BR_Version () {maj = min = rev = build = 0;} }; /****************************************************************************** * To start search, simply create the object and use GetStatus to query * * results from the search thread. * ******************************************************************************/ class BR_SearchObject { public: explicit BR_SearchObject (bool startup = false); ~BR_SearchObject (); int GetStatus (BR_Version* official, BR_Version* beta); double GetProgress (); void RestartSearch (); private: static unsigned WINAPI StartSearch (void* searchObject); void SetStatus (BR_Version official, BR_Version beta, int status); void SetProgress (double progress); bool GetKillFlag (); void SetKillFlag (bool killFlag); HANDLE GetProcess (); void SetProcess (HANDLE process); void EndSearch (); bool IsStartup (); int CompareVersion (BR_Version one, BR_Version two); const bool m_startup; int m_status; double m_progress; BR_Version m_official; BR_Version m_beta; SWS_Mutex m_mutex; static bool m_killFlag; static HANDLE m_process; };
41.420455
82
0.55144
7c523b728fd76a788fd894dc1797b8757e64f0c6
1,922
h
C
util/thread/threadable.h
jjzhang166/balancer
84addf52873d8814b8fd30289f2fcfcec570c151
[ "Unlicense" ]
39
2015-03-12T19:49:24.000Z
2020-11-11T09:58:15.000Z
util/thread/threadable.h
jjzhang166/balancer
84addf52873d8814b8fd30289f2fcfcec570c151
[ "Unlicense" ]
null
null
null
util/thread/threadable.h
jjzhang166/balancer
84addf52873d8814b8fd30289f2fcfcec570c151
[ "Unlicense" ]
11
2016-01-14T16:42:00.000Z
2022-01-17T11:47:33.000Z
#pragma once #include <util/system/thread.h> #include <util/system/defaults.h> #include <util/generic/ptr.h> //deprecated. use future.h instead template <class T> class TThreadable: public T { public: typedef TThread::TThreadProc TThreadProc; inline TThreadable() : Arg(0) , ThreadInit(0) { } inline int Run(void* arg = 0, int stackSize = 0, TThreadProc init = DefInit) { if (!!Thread_) { return 1; } Arg = arg; ThreadInit = init; try { TThread::TParams params = { Dispatch, this, stackSize }; { THolder<TThread> thread(new TThread(params)); thread->Start(); Thread_.Swap(thread); } } catch (...) { return 1; } return 0; } inline int Join(void** result = 0) { if (!Thread_) { return 1; } try { void* ret = Thread_->Join(); if (result) { *result = ret; } Thread_.Destroy(); return 0; } catch (...) { } return 1; } protected: static TThreadable<T>* This(void* ptr) { return (TThreadable<T>*)ptr; } static void* Dispatch(void* ptr) { void* result = This(ptr)->ThreadInit(This(ptr)->Arg); return result ? result : (void*)This(ptr)->T::Run(This(ptr)->Arg); } static void* DefInit(void*) { return 0; } public: void* Arg; TThreadProc ThreadInit; private: THolder<TThread> Thread_; };
21.355556
86
0.417794
87a8db28f265483f2ad1f8d8dfe65b2390914e2c
2,881
c
C
1_First_Service/Work_base/Apps/Blinker_app/blinker.c
Luos-io/Training
f38db879e08c5969af49f3f35433795bd3a0832b
[ "MIT" ]
10
2022-02-22T09:34:07.000Z
2022-02-22T10:17:02.000Z
1_First_Service/Work_base/Apps/Blinker_app/blinker.c
Luos-io/Training
f38db879e08c5969af49f3f35433795bd3a0832b
[ "MIT" ]
null
null
null
1_First_Service/Work_base/Apps/Blinker_app/blinker.c
Luos-io/Training
f38db879e08c5969af49f3f35433795bd3a0832b
[ "MIT" ]
null
null
null
#include "blinker.h" #include "luos_engine.h" #define DEFAULTBLINKTIME_MS 500 // Create a new custom service type for this blink example typedef enum { BLINKER_APP = LUOS_LAST_TYPE } App_type_t; service_t *blinker_app; // This will be our blinker service volatile time_luos_t blinktime; unsigned long my_time; // Used to keep track of time volatile control_t control_app; static void Blinker_MsgHandler(service_t *service, msg_t *msg); void Blinker_Init(void) { revision_t revision = {.major = 1, .minor = 0, .build = 0}; blinker_app = Luos_CreateService(Blinker_MsgHandler, BLINKER_APP, "blinker", revision); // Detect all service of your network and create a routing_table Luos_Detect(blinker_app); // Set the default blink duration blinktime = TimeOD_TimeFrom_ms(DEFAULTBLINKTIME_MS); // Set our next timeout to now plus BLINKTIME milliseconds my_time = Luos_GetSystick() + (unsigned long)TimeOD_TimeTo_ms(blinktime); // Set the blinker to play control_app.flux = PLAY; } void Blinker_Loop(void) { static uint8_t led_last_state = 0; // Is the LED on or off? // Check to see if we have overshot our counter if ((my_time < Luos_GetSystick()) && (control_app.flux == PLAY)) { // Reset the counter // blinktime can be updated on Blinker_MsgHandler function. my_time = Luos_GetSystick() + (unsigned long)TimeOD_TimeTo_ms(blinktime); // Invert the LED state led_last_state = (led_last_state == 1 ? 0 : 1); // Now send a message msg_t led_msg; // Get the ID of our LED from the routing table search_result_t led_result; RTFilter_Alias(RTFilter_Reset(&led_result), "led"); if (led_result.result_nbr > 0) { led_msg.header.target = led_result.result_table[0]->id; // We are sending this to the LED led_msg.header.cmd = IO_STATE; // We are specifying an IO state (on or off) led_msg.header.target_mode = IDACK; // We are asking for an acknowledgement led_msg.header.size = sizeof(char); // Our message only contains one character, the IO state led_msg.data[0] = led_last_state; // The I/O state of the LED to be sent // (1 or 0, on or off) Luos_SendMsg(blinker_app, &led_msg); // Now that we have the elements, send the message } } } static void Blinker_MsgHandler(service_t *service, msg_t *msg) { if (msg->header.cmd == CONTROL) { ControlOD_ControlFromMsg((control_t *)&control_app, msg); return; } if (msg->header.cmd == TIME) { // Save transition time TimeOD_TimeFromMsg((time_luos_t *)&blinktime, msg); return; } }
33.5
117
0.633808
7b857ff5c548757e5d9ce4205d0645104b0db39a
5,697
h
C
chrome/browser/chromeos/dom_ui/internet_options_handler.h
Gitman1989/chromium
2b1cceae1075ef012fb225deec8b4c8bbe4bc897
[ "BSD-3-Clause" ]
2
2017-09-02T19:08:28.000Z
2021-11-15T15:15:14.000Z
chrome/browser/chromeos/dom_ui/internet_options_handler.h
Gitman1989/chromium
2b1cceae1075ef012fb225deec8b4c8bbe4bc897
[ "BSD-3-Clause" ]
null
null
null
chrome/browser/chromeos/dom_ui/internet_options_handler.h
Gitman1989/chromium
2b1cceae1075ef012fb225deec8b4c8bbe4bc897
[ "BSD-3-Clause" ]
1
2020-04-13T05:45:10.000Z
2020-04-13T05:45:10.000Z
// Copyright (c) 2010 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_CHROMEOS_DOM_UI_INTERNET_OPTIONS_HANDLER_H_ #define CHROME_BROWSER_CHROMEOS_DOM_UI_INTERNET_OPTIONS_HANDLER_H_ #include <string> #include "chrome/browser/chromeos/cros/network_library.h" #include "chrome/browser/dom_ui/options/options_ui.h" class SkBitmap; namespace views { class WindowDelegate; } // ChromeOS internet options page UI handler. class InternetOptionsHandler : public OptionsPageUIHandler, public chromeos::NetworkLibrary::NetworkManagerObserver, public chromeos::NetworkLibrary::NetworkObserver, public chromeos::NetworkLibrary::CellularDataPlanObserver { public: InternetOptionsHandler(); virtual ~InternetOptionsHandler(); // OptionsUIHandler implementation. virtual void GetLocalizedValues(DictionaryValue* localized_strings); // DOMMessageHandler implementation. virtual void RegisterMessages(); // NetworkLibrary::NetworkManagerObserver implementation. virtual void OnNetworkManagerChanged(chromeos::NetworkLibrary* network_lib); // NetworkLibrary::NetworkObserver implementation. virtual void OnNetworkChanged(chromeos::NetworkLibrary* network_lib, const chromeos::Network* network); // NetworkLibrary::CellularDataPlanObserver implementation. virtual void OnCellularDataPlanChanged(chromeos::NetworkLibrary* network_lib); private: // Opens a modal popup dialog. void CreateModalPopup(views::WindowDelegate* view); // Passes data needed to show details overlay for network. // |args| will be [ network_type, service_path, command ] // And command is one of 'options', 'connect', disconnect', 'activate' or // 'forget' // Handle{Wifi,Cellular}ButtonClick handles button click on a wireless // network item and a cellular network item respectively. void ButtonClickCallback(const ListValue* args); void HandleWifiButtonClick(const std::string& service_path, const std::string& command); void HandleCellularButtonClick(const std::string& service_path, const std::string& command); // Initiates cellular plan data refresh. The results from libcros will be // passed through CellularDataPlanChanged() callback method. // |args| will be [ service_path ] void RefreshCellularPlanCallback(const ListValue* args); void LoginCallback(const ListValue* args); void LoginCertCallback(const ListValue* args); void LoginToOtherCallback(const ListValue* args); void SetDetailsCallback(const ListValue* args); void EnableWifiCallback(const ListValue* args); void DisableWifiCallback(const ListValue* args); void EnableCellularCallback(const ListValue* args); void DisableCellularCallback(const ListValue* args); void BuyDataPlanCallback(const ListValue* args); // Parses 'path' to determine if the certificate is stored in a pkcs#11 // device. flimflam recognizes the string "SETTINGS:" to specify // authentication parameters. 'key_id=' indicates that the certificate is // stored in a pkcs#11 device. // See src/third_party/flimflam/files/doc/service-api.txt. bool IsCertificateInPkcs11(const std::string& path); // Populates the ui with the details of the given device path. This forces // an overlay to be displayed in the UI. void PopulateDictionaryDetails(const chromeos::Network* net, chromeos::NetworkLibrary* cros); void PopulateWifiDetails(DictionaryValue* dictionary, const chromeos::WifiNetwork* wifi); void PopulateCellularDetails(DictionaryValue* dictionary, const chromeos::CellularNetwork* cellular); // Converts CellularDataPlan structure into dictionary for JS. Formats plan // settings into human readable texts. DictionaryValue* CellularDataPlanToDictionary( const chromeos::CellularDataPlan* plan); // Creates the map of a network. ListValue* GetNetwork(const std::string& service_path, const SkBitmap& icon, const std::string& name, bool connecting, bool connected, bool connectable, chromeos::ConnectionType connection_type, bool remembered, chromeos::ActivationState activation_state, bool restricted_ip); // Creates the map of wired networks. ListValue* GetWiredList(); // Creates the map of wireless networks. ListValue* GetWirelessList(); // Creates the map of remembered networks. ListValue* GetRememberedList(); // Fills network information into JS dictionary for displaying network lists. void FillNetworkInfo(DictionaryValue* dictionary, chromeos::NetworkLibrary* cros); // Refreshes the display of network information. void RefreshNetworkData(chromeos::NetworkLibrary* cros); // Adds an observer for the active network, if any, so that we can dynamically // display the correct icon for that network's signal strength. void MonitorActiveNetwork(chromeos::NetworkLibrary* cros); // If any network is currently active, this is its service path. std::string active_network_; // A boolean flag of whether to use DOMUI for connect UI. True to use DOMUI // and false to use Views dialogs. bool use_settings_ui_; DISALLOW_COPY_AND_ASSIGN(InternetOptionsHandler); }; #endif // CHROME_BROWSER_CHROMEOS_DOM_UI_INTERNET_OPTIONS_HANDLER_H_
43.159091
80
0.723188
d02cc6d280d3d4de73bae90d52c80725e0f175f2
9,723
c
C
tools/dilate_pixel_qa.c
ldj01/e-l-t
eccafac88c3a604797f9d8f5f480143639316033
[ "Unlicense" ]
null
null
null
tools/dilate_pixel_qa.c
ldj01/e-l-t
eccafac88c3a604797f9d8f5f480143639316033
[ "Unlicense" ]
null
null
null
tools/dilate_pixel_qa.c
ldj01/e-l-t
eccafac88c3a604797f9d8f5f480143639316033
[ "Unlicense" ]
null
null
null
/***************************************************************************** File: dilate_pixel_qa.c Purpose: Modify in-place a bit from each value in the bit-packed QA band. Project: Land Satellites Data System Science Research and Development (LSRD) at the USGS EROS License Type: NASA Open Source Agreement Version 1.3 *****************************************************************************/ #include <getopt.h> #include "l2qa_common.h" #include "pixel_qa.h" #include "read_pixel_qa.h" #include "write_pixel_qa.h" #include "pixel_qa_dilation.h" #define PROG_NAME "dilate_pixel_qa" /***************************************************************************** Method: usage Description: Prints the usage information for this application. Return Value: None *****************************************************************************/ void usage() { printf("%s is a program that dilates the specified bit of the bit-packed" " QA band with the specified distance.\n\n", PROG_NAME); printf("usage: %s --xml=<xml_filename>" " --bit=<bit> --distance=<distance>\n\n", PROG_NAME); printf("where the following parameters are required:\n"); printf(" -xml: name of the input XML metadata file which follows" " the ESPA internal raw binary schema\n"); printf(" -bit: bit value to dilate (0=fill, 1=clear, 2=water, 3=cloud" " shadow, 4=snow, 5=cloud, 6=cloud confidence 1, 7=cloud" " confidence 2, 8=cirrus confidence 1, 9=cirrus confidence 2)," " 10=terrain occlusion\n"); printf(" -distance: search distance from current pixel\n"); printf("\nExample: %s --xml=LE07_L1TP_022033_20140228_20160905_01_T1.xml " "--bit=5 --distance=3\n", PROG_NAME); } /***************************************************************************** Method: version Description: Prints the version information and exits the application. Return Value: None *****************************************************************************/ void version() { printf("%s: %s\n", PROG_NAME, L2QA_COMMON_VERSION); exit(EXIT_SUCCESS); } /***************************************************************************** Method: get_args Description: Gets the command-line arguments and validates that the required arguments were specified. Return Value: Type = int Value Description ----- ----------- ERROR Error getting the command-line arguments or a command-line argument and associated value were not specified SUCCESS No errors encountered NOTES: 1. Memory is allocated for the input filename. The caller is responsible for freeing the allocated memory upon successful return. *****************************************************************************/ short get_args ( int argc, /* I: number of cmd-line args */ char *argv[], /* I: string of cmd-line args */ char **xml_infile, /* O: address of input XML filename */ uint8_t *bit_value, /* O: address of bit value variable */ uint8_t *distance /* O: address of distance value variable */ ) { char FUNC_NAME[] = "get_args"; int c; /* current argument index */ int option_index; /* index for the command-line option */ char msg[STR_SIZE]; /* error message */ static struct option long_options[] = { {"xml", required_argument, 0, 'i'}, {"bit", required_argument, 0, 'b'}, {"distance", required_argument, 0, 'd'}, {"version", no_argument, 0, 'v'}, {"help", no_argument, 0, 'h'}, {0, 0, 0, 0} }; /* Initialize variables so we can verify the tool's caller set them */ *bit_value = 255; *distance = 255; /* Loop through all the cmd-line options */ opterr = 0; /* turn off getopt_long error msgs as we'll print our own */ while (1) { /* optstring in call to getopt_long is empty since we will only support the long options */ c = getopt_long(argc, argv, "", long_options, &option_index); if (c == -1) { /* Out of cmd-line options */ break; } switch (c) { case 0: /* If this option set a flag, do nothing else now. */ if (long_options[option_index].flag != 0) break; case 'h': /* help */ usage(); return ERROR; break; case 'i': /* XML infile */ *xml_infile = strdup(optarg); break; case 'b': /* bit value */ *bit_value = (uint8_t) atoi(optarg); break; case 'd': /* distance value */ *distance = (uint8_t) atoi(optarg); break; case 'v': /* version */ version(); break; case '?': default: snprintf(msg, sizeof(msg), "Unknown option %s", argv[optind-1]); error_handler(true, FUNC_NAME, msg); usage(); return ERROR; break; } } /* Make sure the infiles were specified */ if (*xml_infile == NULL) { snprintf(msg, sizeof(msg), "--xml is a required argument"); error_handler(true, FUNC_NAME, msg); usage(); return ERROR; } if (*bit_value == 255) { snprintf(msg, sizeof(msg), "--bit is a required argument"); error_handler(true, FUNC_NAME, msg); usage(); return ERROR; } if (*distance == 255) { snprintf(msg, sizeof(msg), "--distance is a required argument"); error_handler(true, FUNC_NAME, msg); usage(); return ERROR; } return SUCCESS; } /***************************************************************************** Method: main Description: Reads the bit-packed QA band and updates it with a dilation of the specified bit. RETURN VALUE: Type = int Value Description ----- ----------- ERROR Error with the dilation generation SUCCESS No errors with the dilation generation *****************************************************************************/ int main(int argc, char *argv[]) { char FUNC_NAME[] = "main"; uint8_t bit_value; /* bit to dilate */ uint8_t distance; /* search distance from the current pixel */ int nlines = -1; /* number of lines in the data */ int nsamps = -1; /* number of samples in the data */ char *xml_infile = NULL; /* XML input filename */ char msg[STR_SIZE]; /* error message */ char input_qa_filename[PATH_MAX]; FILE *input_qa_fd = NULL; uint16_t *idata = NULL; /* Holds the bit-packed input data */ uint16_t *ddata = NULL; /* Holds the dilated bit-packed output data */ /* Read the command line arguments */ if (get_args(argc, argv, &xml_infile, &bit_value, &distance) != SUCCESS) { return EXIT_FAILURE; } /* Open the input band */ input_qa_fd = open_pixel_qa(xml_infile, input_qa_filename, &nlines, &nsamps); if (input_qa_fd == NULL) { snprintf(msg, sizeof(msg), "opening input band data for reading"); error_handler(true, FUNC_NAME, msg); return EXIT_FAILURE; } printf("%s, %d, %d\n", xml_infile, bit_value, distance); printf("%s, %d, %d\n", input_qa_filename, nlines, nsamps); /* Allocate memory for the input and output */ idata = calloc(nlines * nsamps, sizeof(uint16_t)); if (idata == NULL) { fclose(input_qa_fd); snprintf(msg, sizeof(msg), "allocating memory for input band data"); error_handler(true, FUNC_NAME, msg); return EXIT_FAILURE; } ddata = calloc(nlines * nsamps, sizeof(uint16_t)); if (ddata == NULL) { free(idata); fclose(input_qa_fd); snprintf(msg, sizeof(msg), "allocating memory for output band data"); error_handler(true, FUNC_NAME, msg); return EXIT_FAILURE; } /* Read the band into memory here */ if (read_pixel_qa(input_qa_fd, nlines, nsamps, idata) != SUCCESS) { free(idata); free(ddata); fclose(input_qa_fd); snprintf(msg, sizeof(msg), "reading input band data"); error_handler(true, FUNC_NAME, msg); return EXIT_FAILURE; } /* Close the READ input band file descriptor */ fclose(input_qa_fd); input_qa_fd = NULL; /* Process dilation here */ dilate_pixel_qa(idata, bit_value, distance, nlines, nsamps, ddata); /* Free the input memory */ free(idata); idata = NULL; /* Open the WRITE output band file descriptor */ input_qa_fd = create_pixel_qa(input_qa_filename); if (input_qa_fd == NULL) { free(ddata); snprintf(msg, sizeof(msg), "opening output band data for reading"); error_handler(true, FUNC_NAME, msg); return EXIT_FAILURE; } /* Write the dilated memory out to the file */ if (write_pixel_qa(input_qa_fd, nlines, nsamps, ddata) != SUCCESS) { free(ddata); sprintf (msg, "unable to write the entire bit-packed QA band"); error_handler (true, FUNC_NAME, msg); return EXIT_FAILURE; } /* Close the WRITE output band file descriptor */ fclose(input_qa_fd); input_qa_fd = NULL; /* Free the output memory */ free(ddata); ddata = NULL; return EXIT_SUCCESS; }
30.964968
78
0.536254
0b4a0b17840541b55ae194d7361b63931633f02c
787
h
C
rampgold/sim/mac_fedriver/mac_fedriver.h
aswaterman/trainwreck
c505b40a0093193fcfec58a94e9d5b094d8b23ca
[ "Unlicense" ]
27
2018-10-04T23:33:33.000Z
2022-02-09T13:08:17.000Z
rampgold/sim/mac_fedriver/mac_fedriver.h
aswaterman/trainwreck
c505b40a0093193fcfec58a94e9d5b094d8b23ca
[ "Unlicense" ]
1
2019-03-26T14:16:09.000Z
2019-05-09T00:43:18.000Z
rampgold/sim/mac_fedriver/mac_fedriver.h
aswaterman/trainwreck
c505b40a0093193fcfec58a94e9d5b094d8b23ca
[ "Unlicense" ]
13
2018-10-05T06:30:43.000Z
2022-01-11T18:48:23.000Z
/* MTI_DPI */ /* * Copyright 2002-2008 Mentor Graphics Corporation. * * Note: * This file is automatically generated. * Please do not edit this file - you will lose your edits. * * Settings when this file was generated: * PLATFORM = 'linux_x86_64' */ #ifndef INCLUDED_MAC_FEDRIVER #define INCLUDED_MAC_FEDRIVER #ifdef __cplusplus #define DPI_LINK_DECL extern "C" #else #define DPI_LINK_DECL #endif #include "svdpi.h" typedef struct { int rxdv; int rx_data; } rx_response_type; typedef struct { int tx_en; int tx_data; } tx_request_type; DPI_LINK_DECL DPI_DLLESPEC void init_driver(); DPI_LINK_DECL DPI_DLLESPEC void transfer_rx( rx_response_type* req); DPI_LINK_DECL DPI_DLLESPEC void transfer_tx( const tx_request_type* req); #endif
15.74
61
0.731893
f418530263323ee183d8b2cee1d2172714e691eb
2,875
h
C
Engine/src/Engine/Event/MouseEvent.h
wesExpress/GameEngine2D
9851968c14069f9bba5b2b14dc8d5dafe0850534
[ "Apache-2.0" ]
2
2021-05-04T13:54:47.000Z
2021-05-24T23:58:09.000Z
Engine/src/Engine/Event/MouseEvent.h
wesExpress/GameEngine2D
9851968c14069f9bba5b2b14dc8d5dafe0850534
[ "Apache-2.0" ]
null
null
null
Engine/src/Engine/Event/MouseEvent.h
wesExpress/GameEngine2D
9851968c14069f9bba5b2b14dc8d5dafe0850534
[ "Apache-2.0" ]
null
null
null
#ifndef __MOUSEEVENT_H__ #define __MOUSEEVENT_H__ #include "Event.h" namespace Engine { class MouseMovedEvent : public Event { public: MouseMovedEvent(double x, double y) : m_x(x), m_y(y) {} inline double GetMouseX() const { return m_x; } inline double GetMouseY() const { return m_y; } std::string ToString() const override { std::stringstream ss; ss << "MouseMovedEvent: (" << GetMouseX() << ", " << GetMouseY() << ")"; return ss.str(); } EVENT_TYPE(MouseMoved); EVENT_CATEGORY(EventCategory::INPUT | EventCategory::MOUSE); private: double m_x, m_y; }; class MouseScrolledEvent : public Event { public: MouseScrolledEvent(double xDiff, double yDiff) : m_xDiff(xDiff), m_yDiff(yDiff) {} inline double GetXDiff() const { return m_xDiff; } inline double GetYDiff() const { return m_yDiff; } std::string ToString() const override { std::stringstream ss; ss << "MouseScrolledEvent: (" << GetXDiff() << ", " << GetYDiff() << ")"; return ss.str(); } EVENT_TYPE(MouseScrolled); EVENT_CATEGORY(EventCategory::INPUT | EventCategory::MOUSE); private: double m_xDiff, m_yDiff; }; class MouseButtonEvent : public Event { public: MouseButtonEvent(unsigned int button) : m_button(button) {} inline unsigned int GetButton() const { return m_button; } EVENT_CATEGORY(EventCategory::INPUT | EventCategory::MOUSE); private: unsigned int m_button; }; class MouseButtonPressedEvent : public MouseButtonEvent { public: MouseButtonPressedEvent(unsigned int button) : MouseButtonEvent(button) {} std::string ToString() const override { std::stringstream ss; ss << "MouseButtonPressed: " << GetButton(); return ss.str(); } EVENT_TYPE(MouseButtonPressed); }; class MouseButtonReleasedEvent : public MouseButtonEvent { public: MouseButtonReleasedEvent(unsigned int button) : MouseButtonEvent(button) {} std::string ToString() const override { std::stringstream ss; ss << "MouseButtonReleased: " << GetButton(); return ss.str(); } EVENT_TYPE(MouseButtonReleased); }; } #endif
25.442478
89
0.505391
4893fe4e033971385f3c43ef1380d0b48de24877
1,110
h
C
Utilities/gdcm/src/gdcmValidator.h
kiranhs/ITKv4FEM-Kiran
0e4ab3b61b5fc4c736f04a73dd19e41390f20152
[ "BSD-3-Clause" ]
1
2018-04-15T13:32:43.000Z
2018-04-15T13:32:43.000Z
Utilities/gdcm/src/gdcmValidator.h
kiranhs/ITKv4FEM-Kiran
0e4ab3b61b5fc4c736f04a73dd19e41390f20152
[ "BSD-3-Clause" ]
null
null
null
Utilities/gdcm/src/gdcmValidator.h
kiranhs/ITKv4FEM-Kiran
0e4ab3b61b5fc4c736f04a73dd19e41390f20152
[ "BSD-3-Clause" ]
null
null
null
/*========================================================================= Program: gdcm Module: gdcmValidator.h Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef GDCMVALIDATOR_H #define GDCMVALIDATOR_H #include "gdcmBase.h" namespace gdcm { /** * \brief Class to perform some verifications on a gdcm::Document */ class ElementSet; class GDCM_EXPORT Validator : public Base { public: Validator(); ~Validator(); void SetInput(ElementSet *input); }; } // end namespace gdcm //----------------------------------------------------------------------------- #endif
25.227273
79
0.567568
715c7686d597b7cf12d89d4f8839af1b7962ce1b
12,767
c
C
base/boot/lib/peldr.c
npocmaka/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
17
2020-11-13T13:42:52.000Z
2021-09-16T09:13:13.000Z
base/boot/lib/peldr.c
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
2
2020-10-19T08:02:06.000Z
2020-10-19T08:23:18.000Z
base/boot/lib/peldr.c
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
14
2020-11-14T09:43:20.000Z
2021-08-28T08:59:57.000Z
/*++ Copyright (c) 1991 Microsoft Corporation Module Name: peldr.c Abstract: This module implements the code to load a PE format image into memory and relocate it if necessary. Author: David N. Cutler (davec) 10-May-1991 Environment: Kernel mode only. Revision History: --*/ #include "bldr.h" #include "string.h" #include "ntimage.h" #if defined(_GAMBIT_) #include "ssc.h" #endif // defined(_GAMBIT_) // // Define image prefetch cache structure used in BlLoadImage. Images // are read as a whole into an allocated buffer and read requests in // BlLoadImage are satisfied by copying from this buffer if the // prefetch is successful. I chose to read the whole file in at once // to simplify code but it limits [although not in practice] the size of // files that can be prefetched this way, as opposed to prefetching chunks // of the file at a time. // typedef struct _IMAGE_PREFETCH_CACHE { ULONG FileId; // FileId that has been prefetched. LARGE_INTEGER Position; // Current position in the file. ULONG ValidDataLength; // Length of data that was prefetched. PUCHAR Data; // Pointer to cached data. } IMAGE_PREFETCH_CACHE, *PIMAGE_PREFETCH_CACHE; // // The next two defines are used in allocating memory for the image // cache to direct the allocator into using memory above 1MB and to make // the allocated memory 64KB aligned. They are in terms of number of pages. // #define BL_IMAGE_ABOVE_1MB (0x200000 >> PAGE_SHIFT) #define BL_IMAGE_64KB_ALIGNED (0x10000 >> PAGE_SHIFT) // // Define forward referenced prototypes. // USHORT ChkSum( ULONG PartialSum, PUSHORT Source, ULONG Length ); ARC_STATUS BlImageInitCache( IN PIMAGE_PREFETCH_CACHE pCache, ULONG FileId ); ARC_STATUS BlImageRead( IN PIMAGE_PREFETCH_CACHE pCache, IN ULONG FileId, OUT PVOID Buffer, IN ULONG Length, OUT PULONG pCount ); ARC_STATUS BlImageSeek( IN PIMAGE_PREFETCH_CACHE pCache, IN ULONG FileId, IN PLARGE_INTEGER pOffset, IN SEEK_MODE SeekMode ); VOID BlImageFreeCache( IN PIMAGE_PREFETCH_CACHE pCache, ULONG FileId ); #if defined(_X86AMD64_) // // Build the 32-bit version of BlLoadImage // #undef IMAGE_DEFINITIONS #define IMAGE_DEFINITIONS 32 #undef BlLoadImageEx #define BlLoadImageEx BlLoadImage32Ex #include <ximagdef.h> #include "amd64\amd64prv.h" #include "peldrt.c" // // Build the 64-bit version of BlLoadImage // #undef IMAGE_DEFINITIONS #define IMAGE_DEFINITIONS 64 #undef BlLoadImageEx #define BlLoadImageEx BlLoadImage64Ex #include <ximagdef.h> #include "peldrt.c" #undef BlLoadImageEx #else // _X86AMD64_ // // Non-x86 platforms build only the native version // #define IMAGE_NT_HEADER(x) RtlImageNtHeader(x) #include "peldrt.c" #endif // _X86AMD64_ ARC_STATUS BlImageInitCache( IN PIMAGE_PREFETCH_CACHE pCache, ULONG FileId ) /*++ Routine Description: Attempt to allocate memory and prefetch a file. Setup pCache structure so it can be passed to BlImageRead/Seek to either copy from the cache if prefetch was successful or read from the disk as normal. The file must be opened read only and should not be closed or modified before calling BlImageFreeCache. The file position of FileId is reset to the beginning of the file on success, and is undefined on failure. pCache is always setup so it can be used in BlImage* I/O functions. If the file could not be prefetched, the cache's ValidDataLength will be set to 0 and the I/O functions will simply call the Bl* I/O functions [e.g. BlImageRead calls BlRead]. Note that the whole file is prefetched at once and this puts a limit on the size of files that can be prefetched via this cache since boot loader memory is limited. This limit is not hit in practice though. Arguments: pCache - Cache structure to setup. FileId - File to prefetch. Return Value: ESUCCESS if everything was successful . Appropriate ARC_STATUS if there was a problem. --*/ { ARC_STATUS Status = ESUCCESS; FILE_INFORMATION FileInfo; ULONG FileSize; ULONG ActualBase = 0; PVOID CacheBufBase = NULL; ULONG ReadCount; LARGE_INTEGER SeekPosition; // // Initialize fields of the cache structure. // pCache->Data = 0; pCache->ValidDataLength = 0; pCache->Position.QuadPart = 0; pCache->FileId = FileId; // // Get file size. // Status = BlGetFileInformation(FileId, &FileInfo); if (Status != ESUCCESS) { goto cleanup; } // // Check if file is too big. File size is at // FileInfo.EndingAddress. // if (FileInfo.EndingAddress.HighPart != 0) { Status = E2BIG; goto cleanup; } FileSize = FileInfo.EndingAddress.LowPart; // // Allocate memory for the cache. In order to avoid fragmenting memory // terribly, temporarily change the allocation policy to HighestFit. This // causes the drivers to get loaded from the bottom up, while the cache // is always at the top of free memory. // Status = BlAllocateAlignedDescriptor(LoaderFirmwareTemporary, 0, (FileSize >> PAGE_SHIFT) + 1, BL_IMAGE_64KB_ALIGNED, &ActualBase); if (Status != ESUCCESS) { Status = ENOMEM; goto cleanup; } CacheBufBase = (PVOID) (KSEG0_BASE | (ActualBase << PAGE_SHIFT)); // // Read the file into the prefetch buffer. // SeekPosition.QuadPart = 0; Status = BlSeek(FileId, &SeekPosition, SeekAbsolute); if (Status != ESUCCESS) { goto cleanup; } Status = BlRead(FileId, CacheBufBase, FileSize, &ReadCount); if (Status != ESUCCESS) { goto cleanup; } if (ReadCount != FileSize) { Status = EIO; goto cleanup; } // // Reset file position back to beginning. // SeekPosition.QuadPart = 0; Status = BlSeek(FileId, &SeekPosition, SeekAbsolute); if (Status != ESUCCESS) { goto cleanup; } // // The file was successfully prefetched. // pCache->Data = CacheBufBase; CacheBufBase = NULL; pCache->ValidDataLength = FileSize; cleanup: if ((CacheBufBase != NULL) && (ActualBase != 0)) { BlFreeDescriptor(ActualBase); } return Status; } ARC_STATUS BlImageRead( IN PIMAGE_PREFETCH_CACHE pCache, IN ULONG FileId, OUT PVOID Buffer, IN ULONG Length, OUT PULONG pCount ) /*++ Routine Description: A wrapper for BlRead. Checks to see if the request can be satisfied from pCache first. If not calls BlRead. Arguments: pCache - Prefetch Cache for FileId FileId, Buffer, Length, Count - BlRead parameters Return Value: Status that would be returned by BlRead. --*/ { LONG AdjustedLength; // // If the cache buffer does not exist or the cached size is 0, // hand over the call to BlRead. // if (!pCache->Data || !pCache->ValidDataLength) { return BlRead(FileId, Buffer, Length, pCount); } // // Clear read bytes count. // *pCount = 0; // // Determine how many bytes we can copy from our current position till // EOF, if there is not Length bytes. // AdjustedLength = (LONG)pCache->ValidDataLength - (LONG)pCache->Position.LowPart; if (AdjustedLength < 0) { AdjustedLength = 0; } AdjustedLength = ((ULONG)AdjustedLength < Length) ? AdjustedLength : Length; // // Copy AdjustedLength bytes into target buffer and advance the file position. // RtlCopyMemory(Buffer, pCache->Data + pCache->Position.LowPart, AdjustedLength); pCache->Position.LowPart += AdjustedLength; // // Update number of bytes read. // *pCount = AdjustedLength; return ESUCCESS; } ARC_STATUS BlImageSeek( IN PIMAGE_PREFETCH_CACHE pCache, IN ULONG FileId, IN PLARGE_INTEGER pOffset, IN SEEK_MODE SeekMode ) /*++ Routine Description: A wrapper for BlSeek. Calls BlSeek and if successful, updates the position in the cache structure as well. We call BlSeek to update the file position as well because at any time the cache may be freed or invalidated and we have to be able to continue calling on Bl* I/O functions transparently. Arguments: pCache - Prefetch Cache for FileId. FileId, Offset, SeekMode - BlSeek parameters. Return Value: Status that would be returned by BlSeek. --*/ { ARC_STATUS Status; // // Do not allow setting position to too big. We do not open such // files anyway and the boot loader file systems and other places // in the boot loader I/O system do not handle it. // if (pOffset->HighPart != 0) { return E2BIG; } // // Try to update file position. // Status = BlSeek(FileId, pOffset, SeekMode); if (Status != ESUCCESS) { return Status; } // // Update the position in cached buffer. We don't perform // checks since BlSeek accepted the new offset. // pCache->Position.QuadPart = pOffset->QuadPart; return Status; } VOID BlImageFreeCache( IN PIMAGE_PREFETCH_CACHE pCache, ULONG FileId ) /*++ Routine Description: Free the memory allocated for the prefetch cache for FileId in pCache. Sets ValidDataLength to 0 to stop caching. Arguments: pCache - Cache structure to setup FileId - File that was opened read-only to be cached. Return Value: None. --*/ { ULONG DescBase; UNREFERENCED_PARAMETER( FileId ); // // NOTE: ValidDataLength may be zero, but we still allocate at least // a page and we have to free that. // if (pCache->Data) { DescBase = (ULONG)((ULONG_PTR)pCache->Data & (~KSEG0_BASE)); BlFreeDescriptor(DescBase >> PAGE_SHIFT); pCache->Data = NULL; } pCache->ValidDataLength = 0; return; } #if defined(_X86AMD64_) ARC_STATUS BlLoadImageEx( IN ULONG DeviceId, IN TYPE_OF_MEMORY MemoryType, IN PCHAR LoadFile, IN USHORT ImageType, IN OPTIONAL ULONG PreferredAlignment, IN OPTIONAL ULONG PreferredBasePage, OUT PVOID *ImageBase ) /*++ Routine Description: This routine attempts to load the specified file from the specified device. Arguments: DeviceId - Supplies the file table index of the device to load the specified image file from. MemoryType - Supplies the type of memory to to be assigned to the allocated memory descriptor. BootFile - Supplies a pointer to string descriptor for the name of the file to load. ImageType - Supplies the type of image that is expected. PreferredAlignment - If present, supplies the preferred image alignment. PreferredBasePage - If present, supplies the preferred base page which will override the image base address ImageBase - Supplies a pointer to a variable that receives the address of the image base. Return Value: ESUCCESS is returned if the specified image file is loaded successfully. Otherwise, an unsuccessful status is returned that describes the reason for failure. --*/ { ARC_STATUS status; if (BlAmd64UseLongMode == FALSE) { status = BlLoadImage32Ex( DeviceId, MemoryType, LoadFile, ImageType, PreferredAlignment, PreferredBasePage, ImageBase ); } else { status = BlLoadImage64Ex( DeviceId, MemoryType, LoadFile, ImageType, PreferredAlignment, PreferredBasePage, ImageBase ); } return status; } #endif // _X86AMD64_
23.297445
85
0.618156
bc86453fb86b799a8bfe2ed223e1c458dc6d0c47
188
h
C
src/adc/adc_correction.h
Molegvas/MySERCOM
4d2538162b5e685a5a91700a531ef91642091075
[ "MIT" ]
null
null
null
src/adc/adc_correction.h
Molegvas/MySERCOM
4d2538162b5e685a5a91700a531ef91642091075
[ "MIT" ]
null
null
null
src/adc/adc_correction.h
Molegvas/MySERCOM
4d2538162b5e685a5a91700a531ef91642091075
[ "MIT" ]
null
null
null
/* */ #ifndef _ADC_CORRECTION_H_ #define _ADC_CORRECTION_H_ #include "stdint.h" uint16_t readGndLevel(); uint16_t read3V3Level(); //void doMeasure(); #endif //!_ADC_CORRECTION_H_
11.058824
29
0.734043
ad8eb400657a76a417df854b6efd23e2c6059616
1,320
h
C
libviennashe/include/output.h
FelipeSenra/viennashe-dev
1b42f01b0826322c0b49a6fcf08fc0db5946e21f
[ "MIT" ]
3
2020-05-07T14:38:52.000Z
2021-05-30T09:43:18.000Z
libviennashe/include/output.h
FelipeSenra/viennashe-dev
1b42f01b0826322c0b49a6fcf08fc0db5946e21f
[ "MIT" ]
1
2021-05-02T13:50:52.000Z
2021-05-03T03:49:51.000Z
libviennashe/include/output.h
FelipeSenra/viennashe-dev
1b42f01b0826322c0b49a6fcf08fc0db5946e21f
[ "MIT" ]
3
2020-05-07T14:39:07.000Z
2021-05-08T12:15:26.000Z
/* ============================================================================ Copyright (c) 2011-2014, Institute for Microelectronics, Institute for Analysis and Scientific Computing, TU Wien. ----------------- ViennaSHE - The Vienna Spherical Harmonics Expansion Boltzmann Solver ----------------- http://viennashe.sourceforge.net/ License: MIT (X11), see file LICENSE in the base directory =============================================================================== */ #ifndef LIBVIENNASHE_OUTPUT_H #define LIBVIENNASHE_OUTPUT_H /* C includes */ #include "libviennashe/include/sys.h" #include "libviennashe/include/device.h" #include "libviennashe/include/config.h" #include "libviennashe/include/simulator.h" #include "libviennashe/include/quantity.h" #ifdef __cplusplus extern "C" { #endif VIENNASHE_EXPORT viennasheErrorCode viennashe_write_to_gnuplot(viennashe_quan_register reg, char const * name, char const * filename); VIENNASHE_EXPORT viennasheErrorCode viennashe_write_she_results_to_gnuplot(viennashe_quan_register reg, viennashe_carrier_ids ctype, char const * filename); #ifdef __cplusplus } #endif #endif /* LIBVIENNASHE_OUTPUT_H */
32.195122
157
0.59697
216029c3dfed943a79d8647c0d38ec2aefce3894
8,258
h
C
src/cson.h
NevermindZZT/cson
56b488a7761ab558cc84c5dfc0433c988d71119f
[ "MIT" ]
52
2019-08-28T19:02:38.000Z
2022-01-14T05:53:32.000Z
src/cson.h
NevermindZZT/cson
56b488a7761ab558cc84c5dfc0433c988d71119f
[ "MIT" ]
5
2019-09-06T02:05:07.000Z
2021-11-15T09:47:46.000Z
src/cson.h
NevermindZZT/cson
56b488a7761ab558cc84c5dfc0433c988d71119f
[ "MIT" ]
26
2019-09-10T04:31:21.000Z
2022-03-23T10:32:28.000Z
/** * @file cson.h * @author Letter (NevermindZZT@gmail.com) * @brief cson * @version 0.1 * @date 2019-08-26 * * @copyright (c) 2019 Letter * */ #ifndef __CSON_H__ #define __CSON_H__ #include "stddef.h" #include "cJSON.h" #define CSON_VERSION "1.0.4" /**< CSON版本 */ /** * @defgroup CSON cson * @brief json tools for C * @addtogroup CSON * @{ */ /** * @brief CSON数据类型定义 * */ typedef enum { CSON_TYPE_OBJ = 0, CSON_TYPE_CHAR, CSON_TYPE_SHORT, CSON_TYPE_INT, CSON_TYPE_LONG, CSON_TYPE_FLOAT, CSON_TYPE_DOUBLE, CSON_TYPE_BOOL, CSON_TYPE_STRING, CSON_TYPE_STRUCT, CSON_TYPE_LIST, CSON_TYPE_ARRAY, CSON_TYPE_JSON, } CsonType; /** * @brief CSON数据模型定义 * */ typedef struct cson_model { CsonType type; /**< 数据类型 */ char *key; /**< 元素键值 */ short offset; /**< 元素偏移 */ union { struct { struct cson_model *model; /**< 子结构体模型 */ short size; /**< 子结构体模型大小 */ } sub; /**< 子结构体 */ struct { CsonType eleType; /**< 数组元素类型 */ short size; /**< 数组大小 */ } array; /**< 数组 */ int objSize; /**< 对象大小 */ CsonType basicListType; /**< 基础数据链表类型 */ } param; } CsonModel; /** * @brief Cson链表 * */ typedef struct cson_list { struct cson_list *next; /**< 下一个元素 */ void *obj; /**< 对象 */ } CsonList; extern CsonModel csonBasicListModel[]; /**< 基础类型链表数据模型 */ #define CSON_MODEL_CHAR_LIST &csonBasicListModel[0] /**< char型链表数据模型 */ #define CSON_MODEL_SHORT_LIST &csonBasicListModel[2] /**< short型链表数据模型 */ #define CSON_MODEL_INT_LIST &csonBasicListModel[4] /**< int型链表数据模型 */ #define CSON_MODEL_LONG_LIST &csonBasicListModel[6] /**< long型链表数据模型 */ #define CSON_MODEL_FLOAT_LIST &csonBasicListModel[8] /**< float型链表数据模型 */ #define CSON_MODEL_DOUBLE_LIST &csonBasicListModel[10] /**< double型链表数据模型 */ #define CSON_MODEL_STRING_LIST &csonBasicListModel[12] /**< string型链表数据模型 */ #define CSON_BASIC_LIST_MODEL_SIZE 2 /**< 基础类型链表数据模型大小 */ /** * @brief 对象数据模型 * * @param type 对象类型 */ #define CSON_MODEL_OBJ(type) \ {CSON_TYPE_OBJ, NULL, 0, .param.objSize=sizeof(type)} /** * @brief char型数据模型 * * @param type 对象模型 * @param key 数据键值 */ #define CSON_MODEL_CHAR(type, key) \ {CSON_TYPE_CHAR, #key, offsetof(type, key)} /** * @brief short型数据模型 * * @param type 对象模型 * @param key 数据键值 */ #define CSON_MODEL_SHORT(type, key) \ {CSON_TYPE_SHORT, #key, offsetof(type, key)} /** * @brief int型数据模型 * * @param type 对象模型 * @param key 数据键值 */ #define CSON_MODEL_INT(type, key) \ {CSON_TYPE_INT, #key, offsetof(type, key)} /** * @brief long型数据模型 * * @param type 对象模型 * @param key 数据键值 */ #define CSON_MODEL_LONG(type, key) \ {CSON_TYPE_LONG, #key, offsetof(type, key)} /** * @brief float型数据模型 * * @param type 对象模型 * @param key 数据键值 */ #define CSON_MODEL_FLOAT(type, key) \ {CSON_TYPE_FLOAT, #key, offsetof(type, key)} /** * @brief double型数据模型 * * @param type 对象模型 * @param key 数据键值 */ #define CSON_MODEL_DOUBLE(type, key) \ {CSON_TYPE_DOUBLE, #key, offsetof(type, key)} /** * @brief bool型数据模型 * * @param type 对象模型 * @param key 数据键值 */ #define CSON_MODEL_BOOL(type, key) \ {CSON_TYPE_CHAR, #key, offsetof(type, key)} /** * @brief 字符串型数据模型 * * @param type 对象模型 * @param key 数据键值 */ #define CSON_MODEL_STRING(type, key) \ {CSON_TYPE_STRING, #key, offsetof(type, key)} /** * @brief 结构体型数据模型 * * @param type 对象模型 * @param key 数据键值 * @param submodel 子结构体模型 * @param subsize 子结构体模型大小 */ #define CSON_MODEL_STRUCT(type, key, submodel, subsize) \ {CSON_TYPE_STRUCT, #key, offsetof(type, key), .param.sub.model=submodel, .param.sub.size=subsize} /** * @brief list型数据模型 * * @param type 对象模型 * @param key 数据键值 * @param submodel 子结构体模型 * @param subsize 子结构体模型大小 */ #define CSON_MODEL_LIST(type, key, submodel, subsize) \ {CSON_TYPE_LIST, #key, offsetof(type, key), .param.sub.model=submodel, .param.sub.size=subsize} /** * @brief list型数据模型 * * @param type 对象模型 * @param key 数据键值 * @param elementType 数组元素类型 * @param arraySize 数组大小 */ #define CSON_MODEL_ARRAY(type, key, elementType, arraySize) \ {CSON_TYPE_ARRAY, #key, offsetof(type, key), .param.array.eleType=elementType, .param.array.size=arraySize} /** * @brief 子json数据模型 * * @param type 对象模型 * @param key 数据键值 */ #define CSON_MODEL_JSON(type, key) \ {CSON_TYPE_JSON, #key, offsetof(type, key)} /** * @brief CSON断言 * * @param expr 表达式 * @param action 断言失败执行动作 */ #define CSON_ASSERT(expr, action) \ if (!(expr)) { \ printf(#expr " assert failed at file: %s, line: %d\r\n", __FILE__, __LINE__); \ action; \ } /** * @brief CSON初始化 * * @param malloc 内存分配函数 * @param free 内存释放函数 */ void csonInit(void *malloc, void *free); /** * @brief 解析JSON对象 * * @param json JSON对象 * @param model 数据模型 * @param modelSize 数据模型数量 * @return void* 解析得到的对象 */ void *csonDecodeObject(cJSON *json, CsonModel *model, int modelSize); /** * @brief 解析JSON对象 * * @param json JSON对象 * @param model 数据模型 * @return void* 解析得到的对象 */ #define csonDecodeObjectEx(json, model) \ csonDecodeObject(json, model, sizeof(model) / sizeof(CsonModel)) /** * @brief 解析JSON字符串 * * @param jsonStr json字符串 * @param model 数据模型 * @param modelSize 数据模型数量 * @return void* 解析得到的对象 */ void *csonDecode(const char *jsonStr, CsonModel *model, int modelSize); /** * @brief 解析JSON字符串 * * @param jsonStr json字符串 * @param model 数据模型 * @return void* 解析得到的对象 */ #define csonDecodeEx(jsonStr, model) \ csonDecode(jsonStr, model, sizeof(model) / sizeof(CsonModel)); /** * @brief 编码成json字符串 * * @param obj 对象 * @param model 数据模型 * @param modelSize 数据模型数量 * @return char* 编码得到的json字符串 */ cJSON* csonEncodeObject(void *obj, CsonModel *model, int modelSize); /** * @brief 编码成json字符串 * * @param obj 对象 * @param model 数据模型 * @param modelSize 数据模型数量 * @param bufferSize 分配给json字符串的空间大小 * @param fmt 是否格式化json字符串 * @return char* 编码得到的json字符串 */ char* csonEncode(void *obj, CsonModel *model, int modelSize, int bufferSize, int fmt); /** * @brief 编码成json字符串 * * @param obj 对象 * @param model 数据模型 * @param bufferSize 分配给json字符串的空间大小 * @param fmt 是否格式化json字符串 * @return char* 编码得到的json字符串 */ #define csonEncodeEx(obj, model, bufferSize, fmt) \ csonEncode(obj, model, sizeof(model)/sizeof(CsonModel), bufferSize, fmt) /** * @brief 编码成json字符串 * * @param obj 对象 * @param model 数据模型 * @param modelSize 数据模型数量 * @return char* 编码得到的json字符串 */ char* csonEncodeUnformatted(void *obj, CsonModel *model, int modelSize); /** * @brief 编码成json字符串 * * @param obj 对象 * @param model 数据模型 * @return char* 编码得到的json字符串 */ #define csonEncodeUnformattedEx(obj, model) \ csonEncodeUnformatted(obj, model, sizeof(model) / sizeof(CsonModel)) /** * @brief 释放CSON解析出的对象 * * @param obj 对象 * @param model 对象模型 * @param modelSize 对象模型数量 */ void csonFree(void *obj, CsonModel *model, int modelSize); /** * @brief 释放CSON解析出的对象 * * @param obj 对象 * @param model 对象模型 */ #define csonFreeEx(obj, model) \ csonFree(obj, model, sizeof(model) / sizeof(CsonModel)) /** * @brief 释放cson编码生成的json字符串 * * @param jsonStr json字符串 */ void csonFreeJson(const char *jsonStr); /** * @brief CSON链表添加节点 * * @param list 链表 * @param obj 节点对象 * @return CsonList 链表 */ CsonList* csonListAdd(CsonList *list, void *obj); /** * @brief CSON链表删除节点 * * @param list 链表 * @param obj 节点对象 * @param freeMem 释放内存 * @return CsonList 链表 */ CsonList *csonListDelete(CsonList *list, void *obj, char freeMem); /** * @brief CSON新字符串 * * @param src 源字符串 * @return char* 新字符串 * @note 此函数用于复制字符串,建议对结构体中字符串成员赋值时,使用此函数, * 方便使用`csonFree`进行内存释放 */ char* csonNewString(const char *src); /** * @} */ #endif
20.853535
115
0.614677
6e136ed5b616a0d125947d1581b4691672f1ee5f
582
h
C
3rdparty/pytorch/aten/src/ATen/core/Deprecated.h
WoodoLee/TorchCraft
999f68aab9e7d50ed3ae138297226dc95fefc458
[ "MIT" ]
109
2018-11-03T15:11:51.000Z
2022-01-06T05:34:35.000Z
AICamera/app/src/main/cpp/ATen/core/Deprecated.h
RusdiHaizim/deblur2
5cddea2782a304917ca7d1232690b626b42429a6
[ "MIT" ]
7
2019-01-04T01:49:09.000Z
2019-10-16T06:46:31.000Z
AICamera/app/src/main/cpp/ATen/core/Deprecated.h
RusdiHaizim/deblur2
5cddea2782a304917ca7d1232690b626b42429a6
[ "MIT" ]
33
2020-02-18T16:15:48.000Z
2022-03-24T15:12:05.000Z
#pragma once // Largely from https://stackoverflow.com/questions/295120/c-mark-as-deprecated #if defined(__cplusplus) && __cplusplus > 201402L #define AT_DEPRECATED(function) [[deprecated]] function #else #if defined(__GNUC__) #define AT_DEPRECATED(function) __attribute__((deprecated)) function #elif defined(_MSC_VER) #define AT_DEPRECATED(function) __declspec(deprecated) function #else #warning "You need to implement AT_DEPRECATED for this compiler" #define AT_DEPRECATED(function) function #endif // defined(__GNUC__) #endif // defined(__cplusplus) && __cplusplus > 201402L
34.235294
79
0.795533
34ee2d1d823529d68d6df8c3aa5d42a18f8e634b
21,585
c
C
src/loader.c
eazimi/elf
c97f46d1cc05db54856259ee9b10f60b3ade010e
[ "MIT" ]
null
null
null
src/loader.c
eazimi/elf
c97f46d1cc05db54856259ee9b10f60b3ade010e
[ "MIT" ]
null
null
null
src/loader.c
eazimi/elf
c97f46d1cc05db54856259ee9b10f60b3ade010e
[ "MIT" ]
null
null
null
#include "z_asm.h" #include "z_syscalls.h" #include "z_utils.h" #include "z_elf.h" #include <stdio.h> #include <sys/mman.h> #include <errno.h> #include <link.h> #define Z_PROG 0 #define Z_INTERP 1 #define FILENAMESIZE 1024 typedef char *VA; /* VA = virtual address */ #define _1GB 0x40000000 #define _32KB 0x8000 #define PAGE_SIZE 4096 #define ALIGN (PAGE_SIZE - 1) #define ROUND_PG(x) (((x) + (ALIGN)) & ~(ALIGN)) #define TRUNC_PG(x) ((x) & ~(ALIGN)) #define PFLAGS(x) ((((x)&PF_R) ? PROT_READ : 0) | \ (((x)&PF_W) ? PROT_WRITE : 0) | \ (((x)&PF_X) ? PROT_EXEC : 0)) #define LOAD_ERR ((unsigned long)-1) // FIXME: 0x1000 is one page; Use sysconf(PAGESIZE) instead. #define ROUND_DOWN(x) ((unsigned long long)(x) & ~(unsigned long long)(PAGE_SIZE - 1)) #define ROUND_UP(x) (((unsigned long long)(x) + PAGE_SIZE - 1) & \ ~(PAGE_SIZE - 1)) #define PAGE_OFFSET(x) ((x) & (PAGE_SIZE - 1)) // Based on the entries in /proc/<pid>/stat as described in `man 5 proc` enum Procstat_t { PID = 1, COMM, // 2 STATE, // 3 PPID, // 4 NUM_THREADS = 19, STARTSTACK = 27, }; typedef union ProcMapsArea { struct { union { VA addr; // args required for mmap to restore memory area uint64_t __addr; }; union { VA endAddr; // args required for mmap to restore memory area uint64_t __endAddr; }; union { size_t size; uint64_t __size; }; union { off_t offset; uint64_t __offset; }; union { int prot; uint64_t __prot; }; union { int flags; uint64_t __flags; }; union { unsigned int long devmajor; uint64_t __devmajor; }; union { unsigned int long devminor; uint64_t __devminor; }; union { ino_t inodenum; uint64_t __inodenum; }; uint64_t properties; char name[FILENAMESIZE]; }; char _padding[4096]; } ProcMapsArea; typedef ProcMapsArea Area; void run_child_process(unsigned long *sp) { fprintf(stdout, "child process\n"); } unsigned long *duplicate_stack(unsigned long *const sp) { unsigned long *new_sp = (unsigned long *)mmap(NULL, _32KB, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); char **p = NULL; int argc = (int)*sp; char **argv = (char **)(sp + 1); char **env = p = (char **)&argv[argc + 1]; while (*p++ != NULL) ; Elf_auxv_t *av = (Elf_auxv_t *)p; while (av->a_type != AT_NULL) ++av; size_t n = (unsigned long)av - (unsigned long)sp; unsigned char *des = (unsigned char *)new_sp; const unsigned char *src = (unsigned char *)sp, *e = src + n; while (src < e) *des++ = *src++; return new_sp; } /* Read non-null character, return null if EOF */ static char readChar(int fd) { char c; int rc; do { rc = read(fd, &c, 1); } while (rc == -1 && errno == EINTR); if (rc <= 0) return 0; return c; } /* Read decimal number, return value and terminating character */ static char readDec(int fd, VA *value) { char c; unsigned long int v = 0; while (1) { c = readChar(fd); if ((c >= '0') && (c <= '9')) c -= '0'; else break; v = v * 10 + c; } *value = (VA)v; return c; } /* Read decimal number, return value and terminating character */ static char readHex(int fd, VA *virt_mem_addr) { char c; unsigned long int v = 0; while (1) { c = readChar(fd); if ((c >= '0') && (c <= '9')) c -= '0'; else if ((c >= 'a') && (c <= 'f')) c -= 'a' - 10; else if ((c >= 'A') && (c <= 'F')) c -= 'A' - 10; else break; v = v * 16 + c; } *virt_mem_addr = (VA)v; return c; } int readMapsLine(int mapsfd, Area *area) { char c, rflag, sflag, wflag, xflag; int i; off_t offset; unsigned int long devmajor, devminor, inodenum; VA startaddr, endaddr; c = readHex(mapsfd, &startaddr); if (c != '-') { if ((c == 0) && (startaddr == 0)) return (0); goto skipeol; } c = readHex(mapsfd, &endaddr); if (c != ' ') goto skipeol; if (endaddr < startaddr) goto skipeol; rflag = c = readChar(mapsfd); if ((c != 'r') && (c != '-')) goto skipeol; wflag = c = readChar(mapsfd); if ((c != 'w') && (c != '-')) goto skipeol; xflag = c = readChar(mapsfd); if ((c != 'x') && (c != '-')) goto skipeol; sflag = c = readChar(mapsfd); if ((c != 's') && (c != 'p')) goto skipeol; c = readChar(mapsfd); if (c != ' ') goto skipeol; c = readHex(mapsfd, (VA *)&offset); if (c != ' ') goto skipeol; area->offset = offset; c = readHex(mapsfd, (VA *)&devmajor); if (c != ':') goto skipeol; c = readHex(mapsfd, (VA *)&devminor); if (c != ' ') goto skipeol; c = readDec(mapsfd, (VA *)&inodenum); area->name[0] = '\0'; while (c == ' ') c = readChar(mapsfd); if (c == '/' || c == '[') { /* absolute pathname, or [stack], [vdso], etc. */ i = 0; do { area->name[i++] = c; if (i == sizeof area->name) goto skipeol; c = readChar(mapsfd); } while (c != '\n'); area->name[i] = '\0'; } if (c != '\n') goto skipeol; area->addr = startaddr; area->endAddr = endaddr; area->size = endaddr - startaddr; area->prot = 0; if (rflag == 'r') area->prot |= PROT_READ; if (wflag == 'w') area->prot |= PROT_WRITE; if (xflag == 'x') area->prot |= PROT_EXEC; area->flags = MAP_FIXED; if (sflag == 's') area->flags |= MAP_SHARED; if (sflag == 'p') area->flags |= MAP_PRIVATE; if (area->name[0] == '\0') area->flags |= MAP_ANONYMOUS; area->devmajor = devmajor; area->devminor = devminor; area->inodenum = inodenum; return (1); skipeol: fprintf(stderr, "ERROR: readMapsLine*: bad maps line <%c", c); while ((c != '\n') && (c != '\0')) { c = readChar(mapsfd); printf("%c", c); } printf(">\n"); abort(); return 0; /* NOTREACHED : stop compiler warning */ } // Returns the [stack] area by reading the proc maps static void getStackRegion(Area *stack) // OUT { Area area; int mapsfd = open("/proc/self/maps", O_RDONLY); while (readMapsLine(mapsfd, &area)) { if (strstr(area.name, "[stack]") && area.endAddr >= (VA)&area) { *stack = area; break; } } close(mapsfd); } // Returns the /proc/self/stat entry in the out string (of length len) static void getProcStatField(enum Procstat_t type, char *out, size_t len) { const char *procPath = "/proc/self/stat"; char sbuf[1024] = {0}; int field_counter = 0; char *field_str = NULL; int fd, num_read; fd = open(procPath, O_RDONLY); if (fd < 0) { fprintf("Failed to open %s. Error: %s\n", procPath, strerror(errno)); return; } num_read = read(fd, sbuf, sizeof sbuf - 1); close(fd); if (num_read <= 0) return; sbuf[num_read] = '\0'; field_str = strtok(sbuf, " "); while (field_str && field_counter != type) { field_str = strtok(NULL, " "); field_counter++; } if (field_str) { strncpy(out, field_str, len); } else { fprintf("Failed to parse %s.\n", procPath); } } // Given a pointer to aux vector, parses the aux vector, and patches the // following three entries: AT_PHDR, AT_ENTRY, and AT_PHNUM static void patchAuxv(ElfW(auxv_t) * av, unsigned long phnum, unsigned long phdr, unsigned long entry) { for (; av->a_type != AT_NULL; ++av) { switch (av->a_type) { case AT_PHNUM: av->a_un.a_val = phnum; break; case AT_PHDR: av->a_un.a_val = phdr; break; case AT_ENTRY: av->a_un.a_val = entry; break; case AT_RANDOM: fprintf("AT_RANDOM value: 0%lx\n", av->a_un.a_val); break; default: break; } } } // Returns pointer to argc, given a pointer to end of stack static inline void * GET_ARGC_ADDR(const void *stackEnd) { return (void *)((uintptr_t)(stackEnd) + sizeof(uintptr_t)); } // Returns pointer to argv[0], given a pointer to end of stack static inline void * GET_ARGV_ADDR(const void *stackEnd) { return (void *)((unsigned long)(stackEnd) + 2 * sizeof(uintptr_t)); } // Returns pointer to env[0], given a pointer to end of stack static inline void * GET_ENV_ADDR(char **argv, int argc) { return (void *)&argv[argc + 1]; } // Returns a pointer to aux vector, given a pointer to the environ vector // on the stack static inline ElfW(auxv_t) * GET_AUXV_ADDR(const char **env) { ElfW(auxv_t) * auxvec; const char **evp = env; while (*evp++ != NULL) ; auxvec = (ElfW(auxv_t) *)evp; return auxvec; } // Creates a deep copy of the stack region pointed to be `origStack` at the // location pointed to be `newStack`. Returns the start-of-stack pointer // in the new stack region. static void * deepCopyStack(void *newStack, const void *origStack, size_t len, const void *newStackEnd, const void *origStackEnd/*, const DynObjInfo_t *info*/) { // Return early if any pointer is NULL if (!newStack || !origStack || !newStackEnd || !origStackEnd/* || !info*/) { return NULL; } // First, we do a shallow copy, which is essentially, just copying the // bits from the original stack into the new stack. memcpy(newStack, origStack, len); // Next, turn the shallow copy into a deep copy. // // The main thing we need to do is to patch the argv and env vectors in // the new stack to point to addresses in the new stack region. Note that // the argv and env are simply arrays of pointers. The pointers point to // strings in other locations in the stack. void *origArgcAddr = (void *)GET_ARGC_ADDR(origStackEnd); int origArgc = *(int *)origArgcAddr; char **origArgv = (char **)GET_ARGV_ADDR(origStackEnd); const char **origEnv = (const char **)GET_ENV_ADDR(origArgv, origArgc); void *newArgcAddr = (void *)GET_ARGC_ADDR(newStackEnd); int newArgc = *(int *)newArgcAddr; char **newArgv = (char **)GET_ARGV_ADDR(newStackEnd); const char **newEnv = (const char **)GET_ENV_ADDR(newArgv, newArgc); ElfW(auxv_t) *newAuxv = GET_AUXV_ADDR(newEnv); // Patch the argv vector in the new stack // First, set up the argv vector based on the original stack for (int i = 0; origArgv[i] != NULL; i++) { off_t argvDelta = (uintptr_t)origArgv[i] - (uintptr_t)origArgv; newArgv[i] = (char *)((uintptr_t)newArgv + (uintptr_t)argvDelta); } // Next, we patch argv[0], the first argument, on the new stack // to point to "/path/to/ld.so". // // From the point of view of ld.so, it would appear as if it was called // like this: $ /lib/ld.so /path/to/target.exe app-args ... // // NOTE: The kernel loader needs to be called with at least two arguments // to get a stack that is 16-byte aligned at the start. Since we want to // be able to jump into ld.so with at least two arguments (ld.so and the // target exe) on the new stack, we also need two arguments on the // original stack. // // If the original stack had just one argument, we would have inherited // that alignment in the new stack. Trying to push in another argument // (target exe) on the new stack would destroy the 16-byte alignment // on the new stack. This would lead to a crash later on in ld.so. // // The problem is that there are instructions (like, "movaps") in ld.so's // code that operate on the stack memory region and require their // operands to be 16-byte aligned. A non-16-byte-aligned operand (for // example, the stack base pointer) leads to a general protection // exception (#GP), which translates into a segfault for the user // process. // // The Linux kernel ensures that the start of stack is always 16-byte // aligned. It seems like this is part of the Linux kernel x86-64 ABI. // For example, see here: // // https://elixir.bootlin.com/linux/v4.18.11/source/fs/binfmt_elf.c#L150 // // https://elixir.bootlin.com/linux/v4.18.11/source/fs/binfmt_elf.c#L288 // // (The kernel uses the STACK_ROUND macro to first set up the stack base // at a 16-byte aligned address, and then pushes items on the stack.) // // We could do something similar on the new stack region. But perhaps it's // easier to just depend on the original stack having at least two args: // "/path/to/kernel-loader" and "/path/to/target.exe". // // NOTE: We don't need to patch newArgc, since the original stack, // from where we would have inherited the data in the new stack, already // had the correct value for origArgc. We just make argv[0] in the // new stack to point to "/path/to/ld.so", instead of // "/path/to/kernel-loader". /* // off_t argvDelta = (uintptr_t)getenv("TARGET_LD") - (uintptr_t)origArgv; // newArgv[0] = (char *)((uintptr_t)newArgv + (uintptr_t)argvDelta); // // Patch the env vector in the new stack // for (int i = 0; origEnv[i] != NULL; i++) // { // off_t envDelta = (uintptr_t)origEnv[i] - (uintptr_t)origEnv; // newEnv[i] = (char *)((uintptr_t)newEnv + (uintptr_t)envDelta); // } // // Change "UH_PRELOAD" to "LD_PRELOAD". This way, upper half's ld.so // // will preload the upper half wrapper library. // char **newEnvPtr = (char **)newEnv; // for (; *newEnvPtr; newEnvPtr++) // { // if (strstr(*newEnvPtr, "UH_PRELOAD")) // { // (*newEnvPtr)[0] = 'L'; // (*newEnvPtr)[1] = 'D'; // break; // } // } // // The aux vector, which we would have inherited from the original stack, // // has entries that correspond to the kernel loader binary. In particular, // // it has these entries AT_PHNUM, AT_PHDR, and AT_ENTRY that correspond // // to kernel-loader. So, we atch the aux vector in the new stack to // // correspond to the new binary: the freshly loaded ld.so. // patchAuxv(newAuxv, info->phnum, // (uintptr_t)info->phdr, // (uintptr_t)info->entryPoint); // printf("newArgv[-2]: %lu \n", (unsigned long)&newArgv[0]); // // We clear out the rest of the new stack region just in case ... // memset(newStack, 0, (size_t)((uintptr_t)&newArgv[-2] - (uintptr_t)newStack)); */ // Return the start of new stack. return (void *)newArgcAddr; } /* External fini function that the caller can provide us. */ static void (*x_fini)(void); static void z_fini(void) { z_printf("Fini at work: x_fini %p\n", x_fini); if (x_fini != NULL) x_fini(); } static int check_ehdr(Elf_Ehdr *ehdr) { unsigned char *e_ident = ehdr->e_ident; return (e_ident[EI_MAG0] != ELFMAG0 || e_ident[EI_MAG1] != ELFMAG1 || e_ident[EI_MAG2] != ELFMAG2 || e_ident[EI_MAG3] != ELFMAG3 || e_ident[EI_CLASS] != ELFCLASS || e_ident[EI_VERSION] != EV_CURRENT || (ehdr->e_type != ET_EXEC && ehdr->e_type != ET_DYN)) ? 0 : 1; } static unsigned long loadelf_anon(int fd, Elf_Ehdr *ehdr, Elf_Phdr *phdr) { unsigned long minva, maxva; Elf_Phdr *iter; ssize_t sz; int flags, dyn = ehdr->e_type == ET_DYN; unsigned char *p, *base, *hint; minva = (unsigned long)-1; maxva = 0; for (iter = phdr; iter < &phdr[ehdr->e_phnum]; iter++) { if (iter->p_type != PT_LOAD) continue; if (iter->p_vaddr < minva) minva = iter->p_vaddr; if (iter->p_vaddr + iter->p_memsz > maxva) maxva = iter->p_vaddr + iter->p_memsz; } minva = TRUNC_PG(minva); maxva = ROUND_PG(maxva); /* For dynamic ELF let the kernel chose the address. */ hint = dyn ? NULL : (void *)minva; flags = dyn ? 0 : MAP_FIXED; flags |= (MAP_PRIVATE | MAP_ANONYMOUS); /* Check that we can hold the whole image. */ base = z_mmap(hint, maxva - minva, PROT_NONE, flags, -1, 0); if (base == (void *)-1) return -1; z_munmap(base, maxva - minva); flags = MAP_FIXED | MAP_ANONYMOUS | MAP_PRIVATE; /* Now map each segment separately in precalculated address. */ for (iter = phdr; iter < &phdr[ehdr->e_phnum]; iter++) { unsigned long off, start; if (iter->p_type != PT_LOAD) continue; off = iter->p_vaddr & ALIGN; start = dyn ? (unsigned long)base : 0; start += TRUNC_PG(iter->p_vaddr); sz = ROUND_PG(iter->p_memsz + off); p = z_mmap((void *)start, sz, PROT_WRITE, flags, -1, 0); if (p == (void *)-1) goto err; if (z_lseek(fd, iter->p_offset, SEEK_SET) < 0) goto err; if (z_read(fd, p + off, iter->p_filesz) != (ssize_t)iter->p_filesz) goto err; z_mprotect(p, sz, PFLAGS(iter->p_flags)); } return (unsigned long)base; err: z_munmap(base, maxva - minva); return LOAD_ERR; } void entry(unsigned long *sp, void (*fini)(void)) { unsigned long *new_sp = duplicate_stack(sp); Area stack_; getStackRegion(&stack_); size_t length = ROUND_UP(stack_.size); void *newStack = mmap(NULL, length, PROT_READ | PROT_WRITE, MAP_GROWSDOWN | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); if (newStack == MAP_FAILED) { fprintf("Failed to mmap new stack region: %s\n", strerror(errno)); return NULL; } // 3. Get pointer to the beginning of the stack in the new stack region // The idea here is to look at the beginning of stack in the original // stack region, and use that to index into the new memory region. The // same offsets are valid in both the stack regions. char stackEndStr[20] = {0}; getProcStatField(STARTSTACK, stackEndStr, sizeof stackEndStr); // NOTE: The kernel sets up the stack in the following format. // -1(%rsp) Stack end for application // 0(%rsp) argc (Stack start for application) // LP_SIZE(%rsp) argv[0] // (2*LP_SIZE)(%rsp) argv[1] // ... // (LP_SIZE*(argc))(%rsp) NULL // (LP_SIZE*(argc+1))(%rsp) envp[0] // (LP_SIZE*(argc+2))(%rsp) envp[1] // ... // NULL // // NOTE: proc-stat returns the address of argc on the stack. // argv[0] is 1 LP_SIZE ahead of argc, i.e., startStack + sizeof(void*) // Stack End is 1 LP_SIZE behind argc, i.e., startStack - sizeof(void*) // sizeof(unsigned long) == sizeof(void*) == 8 on x86-64 unsigned long origStackEnd = atol(stackEndStr) - sizeof(unsigned long); unsigned long origStackOffset = origStackEnd - (unsigned long)stack_.addr; unsigned long newStackOffset = origStackOffset; void *newStackEnd = (void*)((unsigned long)newStack + newStackOffset); newStackEnd = deepCopyStack(newStack, stack_.addr, stack_.size, (void*)newStackEnd, (void*)origStackEnd/*, info*/); void *reserved = mmap(NULL, _1GB, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); if (reserved == MAP_FAILED) z_errx(1, "reserve failed"); pid_t pid = fork(); if (pid == 0) // child { run_child_process(sp); return; } Elf_Ehdr ehdrs[2], *ehdr = ehdrs; Elf_Phdr *phdr, *iter; Elf_auxv_t *av; char **argv, **env, **p, *elf_interp = NULL; unsigned long base[2], entry[2]; const char *file; ssize_t sz; int argc, fd, i; x_fini = fini; argc = (int)*(sp); argv = (char **)(sp + 1); env = p = (char **)&argv[argc + 1]; while (*p++ != NULL) ; av = (void *)p; (void)env; if (argc < 2) z_errx(1, "no input file"); file = argv[1]; for (i = 0;; i++, ehdr++) { /* Open file, read and than check ELF header.*/ if ((fd = z_open(file, O_RDONLY)) < 0) z_errx(1, "can't open %s", file); if (z_read(fd, ehdr, sizeof(*ehdr)) != sizeof(*ehdr)) z_errx(1, "can't read ELF header %s", file); if (!check_ehdr(ehdr)) z_errx(1, "bogus ELF header %s", file); /* Read the program header. */ sz = ehdr->e_phnum * sizeof(Elf_Phdr); phdr = z_alloca(sz); if (z_lseek(fd, ehdr->e_phoff, SEEK_SET) < 0) z_errx(1, "can't lseek to program header %s", file); if (z_read(fd, phdr, sz) != sz) z_errx(1, "can't read program header %s", file); /* Time to load ELF. */ if ((base[i] = loadelf_anon(fd, ehdr, phdr)) == LOAD_ERR) z_errx(1, "can't load ELF %s", file); /* Set the entry point, if the file is dynamic than add bias. */ entry[i] = ehdr->e_entry + (ehdr->e_type == ET_DYN ? base[i] : 0); /* The second round, we've loaded ELF interp. */ if (file == elf_interp) break; for (iter = phdr; iter < &phdr[ehdr->e_phnum]; iter++) { if (iter->p_type != PT_INTERP) continue; elf_interp = z_alloca(iter->p_filesz); if (z_lseek(fd, iter->p_offset, SEEK_SET) < 0) z_errx(1, "can't lseek interp segment"); if (z_read(fd, elf_interp, iter->p_filesz) != (ssize_t)iter->p_filesz) z_errx(1, "can't read interp segment"); if (elf_interp[iter->p_filesz - 1] != '\0') z_errx(1, "bogus interp path"); file = elf_interp; } /* Looks like the ELF is static -- leave the loop. */ if (elf_interp == NULL) break; } /* Reassign some vectors that are important for * the dynamic linker and for lib C. */ #define AVSET(t, v, expr) \ case (t): \ (v)->a_un.a_val = (expr); \ break while (av->a_type != AT_NULL) { switch (av->a_type) { AVSET(AT_PHDR, av, base[Z_PROG] + ehdrs[Z_PROG].e_phoff); AVSET(AT_PHNUM, av, ehdrs[Z_PROG].e_phnum); AVSET(AT_PHENT, av, ehdrs[Z_PROG].e_phentsize); AVSET(AT_ENTRY, av, entry[Z_PROG]); AVSET(AT_EXECFN, av, (unsigned long)argv[1]); AVSET(AT_BASE, av, elf_interp ? base[Z_INTERP] : av->a_un.a_val); } ++av; } #undef AVSET ++av; // /* SP points to argc. */ // unsigned long* reserved_argc = (unsigned long*)reserved; // *reserved_argc = --(*sp); // unsigned long* reserved_argv = reserved_argc+1; // /* Shift argv, env and av. */ // z_memcpy(reserved_argv, &argv[1], // (unsigned long)av - (unsigned long)&argv[1]); // z_trampo((void (*)(void))(elf_interp ? entry[Z_INTERP] : entry[Z_PROG]), reserved, z_fini); /* Shift argv, env and av. */ z_memcpy(&argv[0], &argv[1], (unsigned long)av - (unsigned long)&argv[1]); /* SP points to argc. */ (*sp)--; z_trampo((void (*)(void))(elf_interp ? entry[Z_INTERP] : entry[Z_PROG]), sp, z_fini); // asm volatile ( // "mov %0, %%rsp;\n\t" // "jmp *%1;\n\t" // "hlt; /* Should not reach.*/\n\t" // : // :"r" (elf_interp ? entry[Z_INTERP] : entry[Z_PROG]), "r" (sp) // ); /* Should not reach. */ z_exit(0); }
26.517199
120
0.627195
56d1c0ddcbb26004691dfecb38f94fee90ce8067
9,103
h
C
parse_lang.h
xsa/pmk
a9dd7fbf8b0a9e8923912eeffafc15d891795072
[ "BSD-3-Clause" ]
null
null
null
parse_lang.h
xsa/pmk
a9dd7fbf8b0a9e8923912eeffafc15d891795072
[ "BSD-3-Clause" ]
null
null
null
parse_lang.h
xsa/pmk
a9dd7fbf8b0a9e8923912eeffafc15d891795072
[ "BSD-3-Clause" ]
null
null
null
/* $Id$ */ /* * Copyright (c) 2005 Damien Couderc * 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 copyright holder(s) 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 HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * */ #include "prseng.h" /*#define DEBUG_PRSENG 1*/ /********** constants ***********************************************************************/ /* Preprocessor keywords */ #define RKW_PP_DEF "define" #define RKW_PP_ELIF "elif" #define RKW_PP_ELSE "else" #define RKW_PP_ENDF "endif" #define RKW_PP_ERR "error" #define RKW_PP_IF "if" #define RKW_PP_IFDF "ifdef" #define RKW_PP_IFND "ifndef" #define RKW_PP_INCL "include" #define RKW_PP_LINE "line" #define RKW_PP_PRGM "pragma" #define RKW_PP_UDEF "undef" /* assembler directives */ #define RKW_AS_TSEG "text" #define RKW_AS_DSEG "data" /* C keywords */ #define RKW_C_BOOL "_Bool" /* ISO C99 */ #define RKW_C_CMPLX "_Complex" /* ISO C?? *//* XXX */ #define RKW_C_IMGNR "_Imaginary" /* ISO C?? *//* XXX */ #define RKW_C_AUTO "auto" /* ISO C?? *//* XXX */ #define RKW_C_BREAK "break" /* ISO C90 */ #define RKW_C_CASE "case" /* ISO C90 */ #define RKW_C_CHAR "char" /* ISO C90 */ #define RKW_C_CONST "const" /* ISO C90 */ #define RKW_C_CONTN "continue" /* ISO C90 */ #define RKW_C_DFLT "default" /* ISO C90 */ #define RKW_C_DO "do" /* ISO C90 */ #define RKW_C_DBL "double" /* ISO C90 */ #define RKW_C_ELSE "else" /* ISO C90 */ #define RKW_C_ENUM "enum" /* ISO C90 */ #define RKW_C_EXTRN "extern" /* ISO C90 */ #define RKW_C_FLOAT "float" /* ISO C90 */ #define RKW_C_FOR "for" /* ISO C90 */ #define RKW_C_GOTO "goto" /* ISO C90 */ #define RKW_C_IF "if" /* ISO C90 */ #define RKW_C_INLN "inline" /* ISO C?? *//* XXX */ #define RKW_C_INT "int" /* ISO C90 */ #define RKW_C_LONG "long" /* ISO C90 */ #define RKW_C_RGSTR "register" /* ISO C90 */ #define RKW_C_RSTCT "restrict" /* ISO C99 *//* XXX */ #define RKW_C_RTRN "return" /* ISO C90 */ #define RKW_C_SHORT "short" /* ISO C90 */ #define RKW_C_SGND "signed" /* ISO C90 */ #define RKW_C_SIZOF "sizeof" /* ISO C90 */ #define RKW_C_STTC "static" /* ISO C90 */ #define RKW_C_STRCT "struct" /* ISO C90 */ #define RKW_C_SWTCH "switch" /* ISO C90 */ #define RKW_C_TPDEF "typedef" /* ISO C90 */ #define RKW_C_UNION "union" /* ISO C90 */ #define RKW_C_USGND "unsigned" /* ISO C90 */ #define RKW_C_VOID "void" /* ISO C90 */ #define RKW_C_VLTL "volatile" /* ISO C?? *//* XXX */ #define RKW_C_WHILE "while" /* ISO C90 */ /* C++ extra keywords */ #define RKW_CXX_AND "and" /* ISO C++98 */ #define RKW_CXX_ANDEQ "and_eq" /* ISO C++98 */ #define RKW_CXX_ASM "asm" /* ISO C++98 */ #define RKW_CXX_AUTO "auto" /* ISO C++98 */ #define RKW_CXX_BITAND "bitand" /* ISO C++98 */ #define RKW_CXX_BITOR "bitor" /* ISO C++98 */ #define RKW_CXX_BOOL "bool" /* ISO C++98 */ #define RKW_CXX_BREAK "break" /* ISO C++98 */ #define RKW_CXX_CASE "case" /* ISO C++98 */ #define RKW_CXX_CATCH "catch" /* ISO C++98 */ #define RKW_CXX_CHAR "char" /* ISO C++98 */ #define RKW_CXX_CLASS "class" /* ISO C++98 */ #define RKW_CXX_COMPL "compl" /* ISO C++98 */ #define RKW_CXX_CONST "const" /* ISO C++98 */ #define RKW_CXX_CNSTCST "const_cast" /* ISO C++98 */ #define RKW_CXX_CONTN "continue" /* ISO C++98 */ #define RKW_CXX_DFLT "default" /* ISO C++98 */ #define RKW_CXX_DELETE "delete" /* ISO C++98 */ #define RKW_CXX_DO "do" /* ISO C++98 */ #define RKW_CXX_DBL "double" /* ISO C++98 */ #define RKW_CXX_DYNCAST "dynamic_cast" /* ISO C++98 */ #define RKW_CXX_ELSE "else" /* ISO C++98 */ #define RKW_CXX_ENUM "enum" /* ISO C++98 */ #define RKW_CXX_EXPLI "explicit" /* ISO C++98 */ #define RKW_CXX_EXPORT "export" /* ISO C++98 */ #define RKW_CXX_EXTRN "extern" /* ISO C++98 */ #define RKW_CXX_FALSE "false" /* ISO C++98 */ #define RKW_CXX_FLOAT "float" /* ISO C++98 */ #define RKW_CXX_FOR "for" /* ISO C++98 */ #define RKW_CXX_FRIEND "friend" /* ISO C++98 */ #define RKW_CXX_GOTO "goto" /* ISO C++98 */ #define RKW_CXX_IF "if" /* ISO C++98 */ #define RKW_CXX_INLN "inline" /* ISO C++98 */ #define RKW_CXX_INT "int" /* ISO C++98 */ #define RKW_CXX_LONG "long" /* ISO C++98 */ #define RKW_CXX_MUTABL "mutable" /* ISO C++98 */ #define RKW_CXX_NSPC "namespace" /* ISO C++98 */ #define RKW_CXX_NEW "new" /* ISO C++98 */ #define RKW_CXX_NOT "not" /* ISO C++98 */ #define RKW_CXX_NOTEQ "not_eq" /* ISO C++98 */ #define RKW_CXX_OPER "operator" /* ISO C++98 */ #define RKW_CXX_OR "or" /* ISO C++98 */ #define RKW_CXX_OREQ "or_eq" /* ISO C++98 */ #define RKW_CXX_PRIV "private" /* ISO C++98 */ #define RKW_CXX_PROT "protected" /* ISO C++98 */ #define RKW_CXX_PUBLIC "public" /* ISO C++98 */ #define RKW_CXX_RGSTR "register" /* ISO C++98 */ #define RKW_CXX_RINTCST "reinterpret_cast" /* ISO C++98 */ #define RKW_CXX_RTRN "return" /* ISO C++98 */ #define RKW_CXX_SHORT "short" /* ISO C++98 */ #define RKW_CXX_SGND "signed" /* ISO C++98 */ #define RKW_CXX_SIZOF "sizeof" /* ISO C++98 */ #define RKW_CXX_STTC "static" /* ISO C++98 */ #define RKW_CXX_STCCST "static_cast" /* ISO C++98 */ #define RKW_CXX_STRCT "struct" /* ISO C++98 */ #define RKW_CXX_SWTCH "switch" /* ISO C++98 */ #define RKW_CXX_TMPLT "template" /* ISO C++98 */ #define RKW_CXX_THIS "this" /* ISO C++98 */ #define RKW_CXX_THROW "throw" /* ISO C++98 */ #define RKW_CXX_TRUE "true" /* ISO C++98 */ #define RKW_CXX_TRY "try" /* ISO C++98 */ #define RKW_CXX_TYPEDEF "typedef" /* ISO C++98 */ #define RKW_CXX_TYPEID "typeid" /* ISO C++98 */ #define RKW_CXX_TYPENAM "typename" /* ISO C++98 */ #define RKW_CXX_UNION "union" /* ISO C++98 */ #define RKW_CXX_USGND "unsigned" /* ISO C++98 */ #define RKW_CXX_USING "using" /* ISO C++98 */ #define RKW_CXX_VIRT "virtual" /* ISO C++98 */ #define RKW_CXX_VOID "void" /* ISO C++98 */ #define RKW_CXX_VLTL "volatile" /* ISO C++98 */ #define RKW_CXX_WCHART "wchar_t" /* ISO C++98 */ #define RKW_CXX_WHILE "while" /* ISO C++98 */ #define RKW_CXX_XOR "xor" /* ISO C++98 */ #define RKW_CXX_XOREQ "xor_req" /* ISO C++98 */ #define MAX_IDTF_LEN 64 /* maximum length of an identifier *//* XXX enough ??? */ enum { SEG_TYPE_UNKNW = 0, SEG_TYPE_TEXT, SEG_TYPE_DATA }; #define PRS_C_IDTF_STR "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_" #define PRS_C_IDTF_FNAME PRS_C_IDTF_STR "./" #define PRS_C_MISC_STR "]){}<>&|!?:;,=+-*/%.^~\\" /********************* types and structures ***********************************************************************/ typedef struct { bool strict, /* stop on errors when true */ (*func_ppro)(void *, char *, prseng_t *), /* function to call on preprocessor keyword */ (*func_proc)(void *, char *, prseng_t *), /* function called on procedure identifier */ (*func_decl)(void *, char *, prseng_t *), /* function called on procedure declaration */ (*func_type)(void *, char *, prseng_t *); /* function called on type identifier */ void *data; /* data structure provided to the functions */ } prs_cmn_t; /******************** function prototypes ***********************************************************************/ bool prs_asm_file(prs_cmn_t *, FILE *); bool prs_c_skip_to_char(prseng_t *, char); bool prs_c_line_skip(prseng_t *); bool prs_c_comment_skip(prseng_t *); bool prs_c_squote_skip(prseng_t *); bool prs_c_dquote_skip(prseng_t *); bool prs_c_skip(prseng_t *); bool prs_c_prepro(prs_cmn_t *, prseng_t *); bool prs_c_is_kw(char *, char **, size_t); bool prs_c_file(prs_cmn_t *, FILE *); bool prs_cxx_file(prs_cmn_t *, FILE *); bool prs_c_common(prs_cmn_t *, FILE *, char **, char **);
40.457778
92
0.643964
8682ef36a925d898eb3751c082071b868bec2d81
876
h
C
System/Library/PrivateFrameworks/RelevanceEngineUI.framework/TableCell.h
zhangkn/iOS14Header
4323e9459ed6f6f5504ecbea2710bfd6c3d7c946
[ "MIT" ]
1
2020-11-04T15:43:01.000Z
2020-11-04T15:43:01.000Z
System/Library/PrivateFrameworks/RelevanceEngineUI.framework/TableCell.h
zhangkn/iOS14Header
4323e9459ed6f6f5504ecbea2710bfd6c3d7c946
[ "MIT" ]
null
null
null
System/Library/PrivateFrameworks/RelevanceEngineUI.framework/TableCell.h
zhangkn/iOS14Header
4323e9459ed6f6f5504ecbea2710bfd6c3d7c946
[ "MIT" ]
null
null
null
/* * This header is generated by classdump-dyld 1.0 * on Sunday, September 27, 2020 at 12:26:07 PM Mountain Standard Time * Operating System: Version 14.0 (Build 18A373) * Image Source: /System/Library/PrivateFrameworks/RelevanceEngineUI.framework/RelevanceEngineUI * classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos. */ #import <UIKitCore/UITableViewCell.h> @class REUpNextBaseCell; @interface TableCell : UITableViewCell { REUpNextBaseCell* _contentCell; } @property (nonatomic,retain) REUpNextBaseCell * contentCell; //@synthesize contentCell=_contentCell - In the implementation block -(id)initWithStyle:(long long)arg1 reuseIdentifier:(id)arg2 ; -(void)prepareForReuse; -(void)layoutSubviews; -(void)configureWithContent:(id)arg1 ; -(REUpNextBaseCell *)contentCell; -(void)setContentCell:(REUpNextBaseCell *)arg1 ; @end
31.285714
142
0.773973
2287e372022bb94a10f208ff89282ca876ed2a7e
792
h
C
pgroupeA05/include/Model/TileInfo.h
Mars073/groupeA05
b3e70d07ca860affb88448e7dc84c8c1ff2805d2
[ "MIT" ]
1
2020-09-14T18:31:36.000Z
2020-09-14T18:31:36.000Z
pgroupeA05/include/Model/TileInfo.h
Mars073/groupeA05
b3e70d07ca860affb88448e7dc84c8c1ff2805d2
[ "MIT" ]
1
2020-07-17T21:43:07.000Z
2020-09-14T18:30:08.000Z
pgroupeA05/include/Model/TileInfo.h
Mars073/groupeA05
b3e70d07ca860affb88448e7dc84c8c1ff2805d2
[ "MIT" ]
null
null
null
#ifndef TILEINFO_H #define TILEINFO_H #include "SFML/Graphics.hpp" using sf::Vector2u; /* * Implement a Tile structure with different data like the object or the collision */ class TileInfo { private: public: const unsigned INDEX; //!< Index of the Tile const unsigned FLOOR_ID; //!< Floor ID on this tile const unsigned GAMEOBJECT_ID; //!< Object ID on this tile bool COLLISION; //!< Define if this tile have collision bool TOPMOST; //!< Define if the object on this tile is hover the player TileInfo(const int, long int); //!< Basic constructor Vector2u getPosition(const unsigned) const;//!< Define the position of the tile with the map size }; #endif // TILEINFO_H
33
105
0.635101
79135e84d034d8a7950d95414bff147ce838615e
9,509
h
C
components/ntp_snippets/remote/remote_suggestions_fetcher.h
google-ar/chromium
2441c86a5fd975f09a6c30cddb57dfb7fc239699
[ "Apache-2.0", "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
777
2017-08-29T15:15:32.000Z
2022-03-21T05:29:41.000Z
components/ntp_snippets/remote/remote_suggestions_fetcher.h
harrymarkovskiy/WebARonARCore
2441c86a5fd975f09a6c30cddb57dfb7fc239699
[ "Apache-2.0", "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
66
2017-08-30T18:31:18.000Z
2021-08-02T10:59:35.000Z
components/ntp_snippets/remote/remote_suggestions_fetcher.h
harrymarkovskiy/WebARonARCore
2441c86a5fd975f09a6c30cddb57dfb7fc239699
[ "Apache-2.0", "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
123
2017-08-30T01:19:34.000Z
2022-03-17T22:55:31.000Z
// Copyright 2016 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 COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_FETCHER_H_ #define COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_FETCHER_H_ #include <memory> #include <queue> #include <string> #include <utility> #include <vector> #include "base/callback.h" #include "base/memory/weak_ptr.h" #include "base/optional.h" #include "base/time/tick_clock.h" #include "components/ntp_snippets/category.h" #include "components/ntp_snippets/category_info.h" #include "components/ntp_snippets/remote/json_request.h" #include "components/ntp_snippets/remote/ntp_snippet.h" #include "components/ntp_snippets/remote/request_params.h" #include "components/ntp_snippets/remote/request_throttler.h" #include "components/ntp_snippets/status.h" #include "components/translate/core/browser/language_model.h" #include "net/url_request/url_request_context_getter.h" class PrefService; class SigninManagerBase; namespace base { class Value; } // namespace base namespace ntp_snippets { class UserClassifier; // TODO(tschumann): BuildArticleCategoryInfo() and BuildRemoteCategoryInfo() // don't really belong into this library. However, as the fetcher is // providing this data for server-defined remote sections it's a good starting // point. Candiates to add to such a library would be persisting categories // (have all category managment in one place) or turning parsed JSON into // FetchedCategory objects (all domain-specific logic in one place). // Provides the CategoryInfo data for article suggestions. If |title| is // nullopt, then the default, hard-coded title will be used. CategoryInfo BuildArticleCategoryInfo( const base::Optional<base::string16>& title); // Provides the CategoryInfo data for other remote suggestions. CategoryInfo BuildRemoteCategoryInfo(const base::string16& title, bool allow_fetching_more_results); // Fetches suggestion data for the NTP from the server. // TODO(fhorschig): Untangle cyclic dependencies by introducing a // RemoteSuggestionsFetcherInterface. (Would be good for mock implementations, // too!) class RemoteSuggestionsFetcher : public OAuth2TokenService::Consumer, public OAuth2TokenService::Observer { public: struct FetchedCategory { Category category; CategoryInfo info; NTPSnippet::PtrVector snippets; FetchedCategory(Category c, CategoryInfo&& info); FetchedCategory(FetchedCategory&&); // = default, in .cc ~FetchedCategory(); // = default, in .cc FetchedCategory& operator=(FetchedCategory&&); // = default, in .cc }; using FetchedCategoriesVector = std::vector<FetchedCategory>; using OptionalFetchedCategories = base::Optional<FetchedCategoriesVector>; // |snippets| contains parsed snippets if a fetch succeeded. If problems // occur, |snippets| contains no value (no actual vector in base::Optional). // Error details can be retrieved using last_status(). using SnippetsAvailableCallback = base::OnceCallback<void(Status status, OptionalFetchedCategories fetched_categories)>; RemoteSuggestionsFetcher( SigninManagerBase* signin_manager, OAuth2TokenService* token_service, scoped_refptr<net::URLRequestContextGetter> url_request_context_getter, PrefService* pref_service, translate::LanguageModel* language_model, const ParseJSONCallback& parse_json_callback, const std::string& api_key, const UserClassifier* user_classifier); ~RemoteSuggestionsFetcher() override; // Initiates a fetch from the server. When done (successfully or not), calls // the callback. // // If an ongoing fetch exists, both fetches won't influence each other (i.e. // every callback will be called exactly once). void FetchSnippets(const RequestParams& params, SnippetsAvailableCallback callback); std::string PersonalizationModeString() const; // Debug string representing the status/result of the last fetch attempt. const std::string& last_status() const { return last_status_; } // Returns the last JSON fetched from the server. const std::string& last_json() const { return last_fetch_json_; } // Returns the personalization setting of the fetcher as used in tests. // TODO(fhorschig): Reconsider these tests and remove this getter. Personalization personalization() const { return personalization_; } // Returns the URL endpoint used by the fetcher. const GURL& fetch_url() const { return fetch_url_; } // Overrides internal clock for testing purposes. void SetTickClockForTesting(std::unique_ptr<base::TickClock> tick_clock) { tick_clock_ = std::move(tick_clock); } private: FRIEND_TEST_ALL_PREFIXES(ChromeReaderSnippetsFetcherTest, BuildRequestAuthenticated); FRIEND_TEST_ALL_PREFIXES(ChromeReaderSnippetsFetcherTest, BuildRequestUnauthenticated); FRIEND_TEST_ALL_PREFIXES(ChromeReaderSnippetsFetcherTest, BuildRequestExcludedIds); FRIEND_TEST_ALL_PREFIXES(ChromeReaderSnippetsFetcherTest, BuildRequestNoUserClass); FRIEND_TEST_ALL_PREFIXES(ChromeReaderSnippetsFetcherTest, BuildRequestWithTwoLanguages); FRIEND_TEST_ALL_PREFIXES(ChromeReaderSnippetsFetcherTest, BuildRequestWithUILanguageOnly); FRIEND_TEST_ALL_PREFIXES(ChromeReaderSnippetsFetcherTest, BuildRequestWithOtherLanguageOnly); friend class ChromeReaderSnippetsFetcherTest; void FetchSnippetsNonAuthenticated(internal::JsonRequest::Builder builder, SnippetsAvailableCallback callback); void FetchSnippetsAuthenticated(internal::JsonRequest::Builder builder, SnippetsAvailableCallback callback, const std::string& account_id, const std::string& oauth_access_token); void StartRequest(internal::JsonRequest::Builder builder, SnippetsAvailableCallback callback); void StartTokenRequest(); // OAuth2TokenService::Consumer overrides: void OnGetTokenSuccess(const OAuth2TokenService::Request* request, const std::string& access_token, const base::Time& expiration_time) override; void OnGetTokenFailure(const OAuth2TokenService::Request* request, const GoogleServiceAuthError& error) override; // OAuth2TokenService::Observer overrides: void OnRefreshTokenAvailable(const std::string& account_id) override; void JsonRequestDone(std::unique_ptr<internal::JsonRequest> request, SnippetsAvailableCallback callback, std::unique_ptr<base::Value> result, internal::FetchResult status_code, const std::string& error_details); void FetchFinished(OptionalFetchedCategories categories, SnippetsAvailableCallback callback, internal::FetchResult status_code, const std::string& error_details); bool JsonToSnippets(const base::Value& parsed, FetchedCategoriesVector* categories); bool DemandQuotaForRequest(bool interactive_request); // Does the fetcher use authentication to get personalized results? bool NeedsAuthentication() const; // Authentication for signed-in users. SigninManagerBase* signin_manager_; OAuth2TokenService* token_service_; std::unique_ptr<OAuth2TokenService::Request> oauth_request_; bool waiting_for_refresh_token_ = false; // When a token request gets canceled, we want to retry once. bool oauth_token_retried_ = false; // Holds the URL request context. scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; // Stores requests that wait for an access token. std::queue< std::pair<internal::JsonRequest::Builder, SnippetsAvailableCallback>> pending_requests_; // Weak reference, not owned. translate::LanguageModel* const language_model_; const ParseJSONCallback parse_json_callback_; // API endpoint for fetching snippets. const GURL fetch_url_; // Which API to use const internal::FetchAPI fetch_api_; // API key to use for non-authenticated requests. const std::string api_key_; // The variant of the fetching to use, loaded from variation parameters. Personalization personalization_; // Allow for an injectable tick clock for testing. std::unique_ptr<base::TickClock> tick_clock_; // Classifier that tells us how active the user is. Not owned. const UserClassifier* user_classifier_; // Request throttlers for limiting requests for different classes of users. RequestThrottler request_throttler_rare_ntp_user_; RequestThrottler request_throttler_active_ntp_user_; RequestThrottler request_throttler_active_suggestions_consumer_; // Info on the last finished fetch. std::string last_status_; std::string last_fetch_json_; base::WeakPtrFactory<RemoteSuggestionsFetcher> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(RemoteSuggestionsFetcher); }; } // namespace ntp_snippets #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_REMOTE_SUGGESTIONS_FETCHER_H_
40.811159
78
0.732359
791c6e147c3c31c3621c7415c13d15e5aa0a345a
759
h
C
include/pwm_software.h
FreeRTOSHAL/driver
7aeafca1aa7370e4d521ca76a2cd8f71f70fa51e
[ "MIT" ]
7
2018-10-27T17:02:17.000Z
2022-03-02T00:48:50.000Z
include/pwm_software.h
FreeRTOSHAL/driver
7aeafca1aa7370e4d521ca76a2cd8f71f70fa51e
[ "MIT" ]
null
null
null
include/pwm_software.h
FreeRTOSHAL/driver
7aeafca1aa7370e4d521ca76a2cd8f71f70fa51e
[ "MIT" ]
6
2016-11-09T16:22:54.000Z
2020-12-24T17:28:09.000Z
#ifndef PWM_SOFTWARE_H_ #define PWM_SOFTWARE_H_ /**\cond INTERNAL*/ #include <pwm.h> #define PWM_PRV #include <pwm_prv.h> #include <gpio.h> extern const struct pwm_ops software_pwm_ops; struct pwm_software { struct pwm_generic gen; struct timer *timer; struct gpio_pin *pin; uint64_t period; uint64_t duty_cycle; uint64_t duty_cycleNew; bool updated; bool running; bool oldvalue; }; /**\endcond*/ int32_t pwm_software_connect(struct pwm *pwm, struct timer *timer, struct gpio_pin *pin); #define ADD_PWM_SOFTWARE(id) \ struct pwm_software pwm_software_##id = { \ PWM_INIT_DEV(software) \ HAL_NAME("Software PWM " #id) \ };\ PWM_ADDDEV(software, pwm_software_##id) #define PWM_SOFTWARE_ID(id) HAL_GET_ID(pwm, software, pwm_software_##id) #endif
25.3
89
0.760211
792798e739a0fb90f893f10be1af8660d3b1faa1
375
h
C
src/EE895.h
towaho/EE895
79d5b3a3e98f729837e7ce8ed49872bca21edb92
[ "MIT" ]
null
null
null
src/EE895.h
towaho/EE895
79d5b3a3e98f729837e7ce8ed49872bca21edb92
[ "MIT" ]
null
null
null
src/EE895.h
towaho/EE895
79d5b3a3e98f729837e7ce8ed49872bca21edb92
[ "MIT" ]
null
null
null
#ifndef __EE895_ARDUINO_LIBARARY_H__ #define __EE895_ARDUINO_LIBARARY_H__ #include "Arduino.h" #include <Wire.h> #define EE895_ADDRESS_MODBUS 0x5F class EE895 { public: EE895(void); uint16_t updateCRC(uint8_t data, uint16_t crc = 0xFFFF); uint16_t updateCRC(uint16_t data, uint16_t crc = 0xFFFF); private: }; #endif /* !__EE895_ARDUINO_LIBARARY_H__ */
17.857143
61
0.749333
b2d70e3fc7fd0fa720a8d981d3f0e66453e15cfc
5,327
h
C
ContextNetwork/inc/sms.h
crutchwalkfactory/jaikuengine-mobile-client
c47100ec009d47a4045b3d98addc9b8ad887b132
[ "MIT" ]
null
null
null
ContextNetwork/inc/sms.h
crutchwalkfactory/jaikuengine-mobile-client
c47100ec009d47a4045b3d98addc9b8ad887b132
[ "MIT" ]
null
null
null
ContextNetwork/inc/sms.h
crutchwalkfactory/jaikuengine-mobile-client
c47100ec009d47a4045b3d98addc9b8ad887b132
[ "MIT" ]
null
null
null
// Copyright (c) 2007-2009 Google Inc. // Copyright (c) 2006-2007 Jaiku Ltd. // Copyright (c) 2002-2006 Mika Raento and Renaud Petit // // This software is licensed at your choice under either 1 or 2 below. // // 1. MIT License // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // // 2. Gnu General Public license 2.0 // // 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. // // // This file is part of the JaikuEngine mobile client. #ifndef CL_SMS_H_INCLUDED #define CL_SMS_H_INCLUDED #include <mtclbase.h> #include <msvapi.h> #include <mtclreg.h> #include <f32file.h> #include "file_output_base.h" #include "app_context.h" #include "list.h" #include "symbian_tree.h" /* * now for handling both SMS and MMS * but compatible with old code that only handles SMS * */ class i_handle_received_sms { public: virtual bool handle_reception(const TMsvId& entry_id, const TMsvId& folder_id, const TDesC& sender, const TDesC& body) = 0; // return true if message is to be deleted IMPORT_C virtual bool handle_reception(const TMsvId& entry_id, const TMsvId& folder_id, TUid aMtmUid, CBaseMtm* aMtm); // default implementation calls above handle_reception for sms, returns false for MMS virtual void handle_change(const TMsvId& msg_id, const TDesC& sender) = 0; virtual void handle_delete(const TMsvId& msg_id, const TMsvId& parent_folder, const TDesC& sender) = 0; virtual void handle_move(const TMsvId& msg_id, const TMsvId& from_folder, const TMsvId& to_folder, const TDesC& sender) = 0; virtual void handle_error(const TDesC& descr) = 0; virtual void handle_sending(const TMsvId& entry_id, const TDesC& sender, const TDesC& body) =0; IMPORT_C virtual void handle_sending(const TMsvId& entry_id, TUid aMtmUid, CBaseMtm* aMtm); // default implementation calls above handle_sending for sms, does nothing for MMS virtual void handle_read(const TMsvId& msg_id, const TDesC& sender, TUid aMtmUid, CBaseMtm* aMtm) = 0; }; class dummyhandler; class sms : public CCheckedActive, MMsvSessionObserver, public MTimeOut { public: IMPORT_C sms(); IMPORT_C ~sms(); IMPORT_C void ConstructL(); void CheckedRunL() { } void DoCancel() { } IMPORT_C TInt send_message(const TDesC& recipient, const TDesC& body, bool keep_sent=true); //void set_reception_handler(i_handle_received_sms* handler); IMPORT_C void AddHandler(i_handle_received_sms* handler); protected: virtual void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3); void handle_received(const TMsvId& entry_id, const TMsvId& folder_id); void handle_moved(const TMsvId& entry_id,const TMsvId& from_entry_id,const TMsvId& to_entry_id); void handle_changed(const TMsvId& entry_id); void handle_deleted(const TMsvId& entry_id, const TMsvId& parent_id); void handle_error(const TDesC& descr); void handle_sent(const TMsvId& entry_id); void handle_read(const TMsvId& msg_id); private: void send_messageL(const TDesC& recipient, const TDesC& body, bool keep_sent=true); TUid loadmessageL(const TMsvId& entry_id, TMsvEntry& entry); TBool DeleteSentEntry(TMsvId aEntryId); CMsvSession* iSession; CMsvSession* iReceiveSession; CClientMtmRegistry* iMtmReg; CClientMtmRegistry* iReceiveMtmReg; CBaseMtm* iMtm; CBaseMtm *iReceiveMtm, *iMMSMtm; //i_handle_received_sms* reception_handler; class CSmsSettings* sendOptions; TBuf<50> state; CMsvOperation* op; TRequestStatus copy_rs; dummyhandler* dummy; CList<i_handle_received_sms*>* iHandlers; #ifdef __WINS__ CTimeOut* iTimer; int iCount; #endif void expired(CBase*); CTimeOut* iChangedTimer; CList<TMsvId> *iChangedList; }; #endif
37.251748
98
0.763657
bf4aae6d069c38cbd028b4cedf104b48798bb630
153
h
C
CJFCore/Classes/Core/Settings/CJFAPPDefine.h
JinfeiChen/CJFCore
bc37baf2f4ece5e50b1aeb30c1b144f9330a3a74
[ "MIT" ]
null
null
null
CJFCore/Classes/Core/Settings/CJFAPPDefine.h
JinfeiChen/CJFCore
bc37baf2f4ece5e50b1aeb30c1b144f9330a3a74
[ "MIT" ]
null
null
null
CJFCore/Classes/Core/Settings/CJFAPPDefine.h
JinfeiChen/CJFCore
bc37baf2f4ece5e50b1aeb30c1b144f9330a3a74
[ "MIT" ]
null
null
null
// // CJFAPPDefine.h // caricature // // Created by cjf on 2019/8/21. // #ifndef CJFAPPDefine_h #define CJFAPPDefine_h #endif /* CJFAPPDefine_h */
11.769231
32
0.673203
844ccf12e52d038b4f35eea23278bce7ebf11162
7,794
h
C
workers/snodb/snodb.h
seerline/sisdb
9fc4172ebc8fd0a58c27ef0e0b3cbfa5f65f64f9
[ "MIT" ]
13
2018-12-14T01:30:25.000Z
2022-02-18T06:36:36.000Z
workers/snodb/snodb.h
seerline/sisdb
9fc4172ebc8fd0a58c27ef0e0b3cbfa5f65f64f9
[ "MIT" ]
2
2021-01-13T06:12:31.000Z
2022-03-15T08:57:14.000Z
workers/snodb/snodb.h
seerline/sisdb
9fc4172ebc8fd0a58c27ef0e0b3cbfa5f65f64f9
[ "MIT" ]
2
2021-02-04T03:04:29.000Z
2022-02-28T13:20:29.000Z
 //****************************************************** // Copyright (C) 2018, Coollyer <48707400@qq.com> //******************************************************* // struct diffrent compress #ifndef _SNODB_H #define _SNODB_H #include "sis_core.h" #include "sis_math.h" #include "sis_malloc.h" #include "sis_list.lock.h" #include "sis_json.h" #include "sis_dynamic.h" #include "sis_obj.h" #include "sis_disk.h" #include "sis_net.msg.h" #include "sis_db.h" #include "sisdb_sub.h" #include "sisdb_incr.h" #include "worker.h" // *** 到这里不适合做顶级 顶级只传输最新的数据 *** // 如果订阅是当天日期 如果是全量就直接传递最新数据 从指定位置 启动一个读者线程 // 如果不是全量就 启动一个读者线程 不断解压再压缩 然后传输 // 不是当天日期 或当天已经处理了收盘 那么就直接从磁盘读取数据 启动一个线程 调用rsno收到回调后传输数据 // 收到最新数据 实时写入 net 文件中,等待收盘后转为 sno 文件 #define SNODB_STATUS_NONE 0 #define SNODB_STATUS_INIT 1 #define SNODB_STATUS_WORK 2 #define SNODB_STATUS_EXIT 3 #pragma pack(push,1) typedef struct s_snodb_reader { int cid; s_sis_sds serial; // 以下两个回调互斥 void *father; // 来源对象 s_snodb_cxt int rfmt; // 返回数据的格式 int status; // 0 未初始化 1 初始化 2 正常工作 3 停止工作 bool iszip; // 是否返回压缩格式 bool ishead; // 是否从头发送 bool isinit; // 0 刚刚订阅 1 正常订阅 bool isstop; // 用户中断 什么也不能干 bool sub_whole; // 是否返回所有的数据 ///////以下为定制数据处理/////// // 这里先处理实时的 历史的以后再说 bool sub_disk; // 是否从磁盘中获取数据 s_sis_worker *sub_disker; // 从从盘读取数据的对象 sisdb_rsno int sub_date; // 订阅日期 如果为历史就启动一个线程专门处理 历史默认为从头发送 s_sis_sds sub_keys; // 订阅股票 可能为 * s_sis_sds sub_sdbs; // 订阅数据 可能为 * // 当读者需要特定的数据 先对收到的数据进行解压 再根据指定的代码和表压缩 然后再传递出去 // 为简便处理 即便传入的数据为原始数据 也从压缩数据解压后获取 // 传入的数据如果是压缩的就解压,然后过滤后压缩 如果是原始数据就直接过滤后压缩 s_sisdb_incr *sub_ziper; // 用于压缩的操作类 s_sisdb_incr *sub_unziper; // 用于解压的操作类 ///////以上为定制数据处理/////// s_sis_lock_reader *reader; // 每个读者一个订阅者 // 返回数据 s_sis_db_chars sis_method_define *cb_sub_chars; // 返回压缩的数据 sis_method_define *cb_sub_inctzip; // s_sis_db_incrzip sis_method_define *cb_sub_start; // char * sis_method_define *cb_sub_realtime; // char * sis_method_define *cb_sub_stop; // char * sis_method_define *cb_dict_keys; // char * sis_method_define *cb_dict_sdbs; // char * } s_snodb_reader; // 来源数据只管写盘 只有key, sdb有的才会保存数据 // 读取数据的人会接收到压缩的 out_bitzips 如果接收者订阅了全部就直接发送数据出去 // 否则就把数据解压,然后写入自己的 s_snodb_cxt 再通过读者回调发送数据 typedef struct s_snodb_cxt { int stoping; // 当前工作状态 int status; // 0 1 2 3 int work_date; // 工作日期 s_sis_sds work_path; s_sis_sds work_name; s_sisdb_incr *work_ziper; s_sis_sds work_keys; // 工作 keys s_sis_sds work_sdbs; // 工作 sdbs s_sis_map_list *map_keys; // key 的结构字典表 s_sis_sds s_sis_map_list *map_sdbs; // sdb 的结构字典表 s_sis_dynamic_db 包括 int wait_msec; // 超过多长时间生成新的块 毫秒 uint64 catch_size; // 缓存数据保留最大的尺寸 int wlog_date; // wlog int wlog_init; // 是否发送了 keys 和 sdbs s_sis_worker *wlog_worker; // 当前使用的写log类 s_sis_method *wlog_method; s_snodb_reader *wlog_reader; // 写wlog的读者 int save_time; // 自动存盘时间 int wfile_save; sis_method_define *wfile_cb_sub_start; sis_method_define *wfile_cb_sub_stop ; sis_method_define *wfile_cb_dict_keys; sis_method_define *wfile_cb_dict_sdbs; sis_method_define *wfile_cb_sub_inctzip; s_sis_worker *wfile_worker; // 当前使用的写文件类 s_sis_json_node *rfile_config; s_sis_fast_queue *inputs; // 传入的数据链 s_sis_object *near_object; // 最近一个其实数据包的指针 // 这个outputs需要设置为无限容量 s_sis_lock_list *outputs; // 输出的数据链 memory 每10分钟一个新的压缩数据块 s_sis_map_kint *ago_reader_map; // 读者列表 s_snodb_reader int cur_readers; // 现有工作人数 s_sis_map_kint *cur_reader_map; // 读者列表 s_snodb_reader // 直接回调组装好的 s_sis_net_message void *cb_source; // sis_method_define *cb_net_message; // s_sis_net_message } s_snodb_cxt; #pragma pack(pop) bool snodb_init(void *, void *); void snodb_uninit(void *); void snodb_working(void *); // *** 数据流操作 ***// // 数据采用结构化数据压缩方式,实时压缩,放入无锁发送队列中 // 每10ms打一个包或者数据量超过16K(减少拆包和拼包的动作)一个包, // 为相关压缩必须保证包的顺序 当时间为整10分钟时重新压缩 保证最差能取到最近 10 分钟数据 // snodb 仅仅作为一个数据组件使用 和网络无关 // *****************// // 初始化 需要传入 workdate,keys,sdbs int cmd_snodb_init(void *worker_, void *argv_); int cmd_snodb_set(void *worker_, void *argv_); // 数据流开始写入 int cmd_snodb_start(void *worker_, void *argv_); // 数据流写入完成 设置标记 方便发送订阅完成信号 int cmd_snodb_stop(void *worker_, void *argv_); // 需要传入 kidx sidx val 收到数据后压缩存储 int cmd_snodb_ipub(void *worker_, void *argv_); // s_snodb_bytes // 需要传入 key sdb val 收到数据后压缩存储 int cmd_snodb_pub(void *worker_, void *argv_); // s_sis_db_chars // 需要传入 zipval 直接是压缩数据块 直接放入队列中 int cmd_snodb_zpub(void *worker_, void *argv_); // s_sis_db_incrzip // 对指定的无锁队列增加订阅者 // 默认从最新的具备完备数据的数据包开始订阅 seat : 0 // seat : 1 从最开始订阅 // 订阅后首先收到 订阅start 然后收到 key sdb 然后开始持续收到压缩的数据 最后收到 stop // int cmd_snodb_zsub(void *worker_, void *argv_); // 订阅其他格式数据 int cmd_snodb_sub(void *worker_, void *argv_); // 取消订阅 int cmd_snodb_unsub(void *worker_, void *argv_); // 取消订阅 int cmd_snodb_get(void *worker_, void *argv_); // 默认仅仅做数据清理 data 清理数据 client 客户端订阅清理 all 全部清理(默认) int cmd_snodb_clear(void *worker_, void *argv_); int cmd_snodb_wlog(void *worker_, void *argv_); int cmd_snodb_rlog(void *worker_, void *argv_); ////////////////////////////////////////////////////////////////// //------------------------snodb function -----------------------// ////////////////////////////////////////////////////////////////// // 初始化一个读者 并启动 int snodb_register_reader(s_snodb_cxt *context_, s_sis_net_message *netmsg); // 清理指定的 reader int snodb_remove_reader(s_snodb_cxt *context_, int cid_); // 直接读取单键值数据 int snodb_read(s_snodb_cxt *context_, s_sis_net_message *netmsg); ////////////////////////////////////////////////////////////////// //------------------------s_snodb_reader -----------------------// ////////////////////////////////////////////////////////////////// s_snodb_reader *snodb_reader_create(); void snodb_reader_destroy(void *); int snodb_reader_new_realtime(s_snodb_reader *reader_); int snodb_reader_realtime_start(s_snodb_reader *reader); int snodb_reader_realtime_stop(s_snodb_reader *reader); int snodb_reader_new_history(s_snodb_reader *reader_); int snodb_reader_history_start(s_snodb_reader *reader); int snodb_reader_history_stop(s_snodb_reader *reader); ////////////////////////////////////////////////////////////////// //------------------------snodb disk function -----------------------// ////////////////////////////////////////////////////////////////// // 从磁盘中获取数据 0 没有wlog文件 ** 文件有错误直接删除 并返回0 // 1 有文件 正在读 需要设置状态 并等待数据读完 #define SICDB_FILE_SIGN_ZPUB 0 // zpub ... #define SICDB_FILE_SIGN_KEYS 1 // zset _sdbs_ ... #define SICDB_FILE_SIGN_SDBS 2 // zset _keys_ ... int snodb_wlog_load(s_snodb_cxt *); // 停止wlog文件 int snodb_wlog_start(s_snodb_cxt *); // 把数据写入到wlog中 int snodb_wlog_save(s_snodb_cxt *, int , char *imem_, size_t isize_); // 停止wlog文件 int snodb_wlog_stop(s_snodb_cxt *); // 清除wlog文件 int snodb_wlog_remove(s_snodb_cxt *); // 把wlog转为snos格式 int snodb_wlog_to_snos(s_snodb_cxt *); #endif /* _SISDB_SNO_H */
32.747899
77
0.598281
80816afacaf9957f8820a3db3345b0fc7a3a876e
8,192
c
C
kernels/c/dft9c_b.c
spiral-software/spiral-package-ffte
19f751776c117e28bdbcc3d2530c895ad554d855
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
kernels/c/dft9c_b.c
spiral-software/spiral-package-ffte
19f751776c117e28bdbcc3d2530c895ad554d855
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
kernels/c/dft9c_b.c
spiral-software/spiral-package-ffte
19f751776c117e28bdbcc3d2530c895ad554d855
[ "BSD-2-Clause-FreeBSD" ]
1
2021-06-15T12:41:51.000Z
2021-06-15T12:41:51.000Z
/* FFTE: A FAST FOURIER TRANSFORM PACKAGE (C) COPYRIGHT SOFTWARE, 2000-2004, 2008-2014, ALL RIGHTS RESERVED BY DAISUKE TAKAHASHI FACULTY OF ENGINEERING, INFORMATION AND SYSTEMS UNIVERSITY OF TSUKUBA 1-1-1 TENNODAI, TSUKUBA, IBARAKI 305-8573, JAPAN E-MAIL: daisuke@cs.tsukuba.ac.jp WRITTEN BY DAISUKE TAKAHASHI THIS KERNEL WAS GENERATED BY SPIRAL 8.2.0a03 */ void dft9b_(double *Y, double *X, double *TW1, int *lp1, int *mp1) { double a1050, a1051, a1052, a1053, a1054, a1055, a1056, a1057, a1058, a1059, a1060, a1061, a1062, a1063, a1064, a1065, s359, s360, s361, s362, s363, s364, s365, s366, s367, s368, s369, s370, s371, s372, s373, s374, s375, s376, s377, s378, s379, s380, s381, s382, s383, s384, s385, s387, s388, s389, s390, s391, s392, s393, s394, s395, s396, s397, s398, s399, s400, s401, s402, s403, s404, s405, s406, s407, s408, s409, s410, s411, s412, s413, t680, t681, t682, t683, t684, t685, t686, t687, t688, t689, t690, t691, t692, t693, t694, t695, t696, t697, t698, t699, t700, t701, t702, t703, t704, t705, t706, t707, t708, t709, t710, t711, t712, t713, t714, t715, t716, t717, t718, t719, t720, t721; int a1038, a1039, a1040, a1041, a1042, a1043, a1044, a1045, a1046, a1047, a1048, a1049, a1066, a1067, a1068, a1069, a1070, a1071, a1072, a1073, a1074, a1075, b135, j1, l1, m1; l1 = *(lp1); m1 = *(mp1); for(int j2 = 0; j2 < (l1 - 1); j2++) { j1 = (j2 + 1); for(int k1 = 0; k1 < m1; k1++) { a1038 = (2*k1); a1039 = (j1*m1); a1040 = (a1038 + (2*a1039)); s359 = X[a1040]; s360 = X[(a1040 + 1)]; b135 = (l1*m1); a1041 = (a1040 + (2*b135)); s361 = X[a1041]; s362 = X[(a1041 + 1)]; a1042 = (a1040 + (4*b135)); s363 = X[a1042]; s364 = X[(a1042 + 1)]; a1043 = (a1040 + (6*b135)); s365 = X[a1043]; s366 = X[(a1043 + 1)]; a1044 = (a1040 + (8*b135)); s367 = X[a1044]; s368 = X[(a1044 + 1)]; a1045 = (a1040 + (10*b135)); s369 = X[a1045]; s370 = X[(a1045 + 1)]; a1046 = (a1040 + (12*b135)); s371 = X[a1046]; s372 = X[(a1046 + 1)]; a1047 = (a1040 + (14*b135)); s373 = X[a1047]; s374 = X[(a1047 + 1)]; a1048 = (a1040 + (16*b135)); s375 = X[a1048]; s376 = X[(a1048 + 1)]; t680 = (s365 + s371); t681 = (s366 + s372); t682 = (s359 + t680); t683 = (s360 + t681); t684 = (s359 - (0.5*t680)); t685 = (s360 - (0.5*t681)); s377 = (0.8660254037844386*(s366 - s372)); s378 = (0.8660254037844386*(s365 - s371)); t686 = (t684 + s377); t687 = (t685 - s378); t688 = (t684 - s377); t689 = (t685 + s378); t690 = (s367 + s373); t691 = (s368 + s374); t692 = (s361 + t690); t693 = (s362 + t691); t694 = (s361 - (0.5*t690)); t695 = (s362 - (0.5*t691)); s379 = (0.8660254037844386*(s368 - s374)); s380 = (0.8660254037844386*(s367 - s373)); t696 = (t694 + s379); t697 = (t695 - s380); t698 = (t694 - s379); t699 = (t695 + s380); s381 = ((0.76604444311897812*t696) + (0.64278760968653925*t697)); s382 = ((0.76604444311897812*t697) - (0.64278760968653925*t696)); s383 = ((0.17364817766693033*t698) + (0.98480775301220802*t699)); s384 = ((0.17364817766693033*t699) - (0.98480775301220802*t698)); t700 = (s369 + s375); t701 = (s370 + s376); t702 = (s363 + t700); t703 = (s364 + t701); t704 = (s363 - (0.5*t700)); t705 = (s364 - (0.5*t701)); s385 = (0.8660254037844386*(s370 - s376)); s387 = (0.8660254037844386*(s369 - s375)); t706 = (t704 + s385); t707 = (t705 - s387); t708 = (t704 - s385); t709 = (t705 + s387); s388 = ((0.17364817766693033*t706) + (0.98480775301220802*t707)); s389 = ((0.17364817766693033*t707) - (0.98480775301220802*t706)); s390 = ((0.34202014332566871*t709) - (0.93969262078590843*t708)); s391 = ((0.34202014332566871*t708) + (0.93969262078590843*t709)); t710 = (t692 + t702); t711 = (t693 + t703); t712 = (t682 - (0.5*t710)); t713 = (t683 - (0.5*t711)); s392 = (0.8660254037844386*(t693 - t703)); s393 = (0.8660254037844386*(t692 - t702)); s394 = (t712 + s392); s395 = (t713 - s393); s396 = (t712 - s392); s397 = (t713 + s393); t714 = (s381 + s388); t715 = (s382 + s389); t716 = (t686 - (0.5*t714)); t717 = (t687 - (0.5*t715)); s398 = (0.8660254037844386*(s382 - s389)); s399 = (0.8660254037844386*(s381 - s388)); s400 = (t686 + t714); s401 = (t687 + t715); s402 = (t716 + s398); s403 = (t717 - s399); s404 = (t716 - s398); s405 = (t717 + s399); t718 = (s383 + s390); t719 = (s384 - s391); t720 = (t688 - (0.5*t718)); t721 = (t689 - (0.5*t719)); s406 = (0.8660254037844386*(s384 + s391)); s407 = (0.8660254037844386*(s383 - s390)); s408 = (t688 + t718); s409 = (t689 + t719); s410 = (t720 + s406); s411 = (t721 - s407); s412 = (t720 - s406); s413 = (t721 + s407); a1049 = (16*j1); a1050 = TW1[a1049]; a1051 = TW1[(a1049 + 1)]; a1052 = TW1[(a1049 + 2)]; a1053 = TW1[(a1049 + 3)]; a1054 = TW1[(a1049 + 4)]; a1055 = TW1[(a1049 + 5)]; a1056 = TW1[(a1049 + 6)]; a1057 = TW1[(a1049 + 7)]; a1058 = TW1[(a1049 + 8)]; a1059 = TW1[(a1049 + 9)]; a1060 = TW1[(a1049 + 10)]; a1061 = TW1[(a1049 + 11)]; a1062 = TW1[(a1049 + 12)]; a1063 = TW1[(a1049 + 13)]; a1064 = TW1[(a1049 + 14)]; a1065 = TW1[(a1049 + 15)]; a1066 = (18*a1039); a1067 = (a1038 + a1066); Y[a1067] = (t682 + t710); Y[(a1067 + 1)] = (t683 + t711); a1068 = (a1038 + (2*m1) + a1066); Y[a1068] = ((a1050*s400) - (a1051*s401)); Y[(a1068 + 1)] = ((a1051*s400) + (a1050*s401)); a1069 = (a1038 + (4*m1) + a1066); Y[a1069] = ((a1052*s408) - (a1053*s409)); Y[(a1069 + 1)] = ((a1053*s408) + (a1052*s409)); a1070 = (a1038 + (6*m1) + a1066); Y[a1070] = ((a1054*s394) - (a1055*s395)); Y[(a1070 + 1)] = ((a1055*s394) + (a1054*s395)); a1071 = (a1038 + (8*m1) + a1066); Y[a1071] = ((a1056*s402) - (a1057*s403)); Y[(a1071 + 1)] = ((a1057*s402) + (a1056*s403)); a1072 = (a1038 + (10*m1) + a1066); Y[a1072] = ((a1058*s410) - (a1059*s411)); Y[(a1072 + 1)] = ((a1059*s410) + (a1058*s411)); a1073 = (a1038 + (12*m1) + a1066); Y[a1073] = ((a1060*s396) - (a1061*s397)); Y[(a1073 + 1)] = ((a1061*s396) + (a1060*s397)); a1074 = (a1038 + (14*m1) + a1066); Y[a1074] = ((a1062*s404) - (a1063*s405)); Y[(a1074 + 1)] = ((a1063*s404) + (a1062*s405)); a1075 = (a1038 + (16*m1) + a1066); Y[a1075] = ((a1064*s412) - (a1065*s413)); Y[(a1075 + 1)] = ((a1065*s412) + (a1064*s413)); } } }
40.96
77
0.44043
41fb05f39f7cc12f4ed2f8483cafb737e7ea80ad
26,562
h
C
SVFEngine/SVFEngine/SoundIMMN.h
safiar/SVFEngine
5038143a0f369e88dd4fab364a0c22f7729217b3
[ "Apache-2.0" ]
1
2018-04-26T14:27:35.000Z
2018-04-26T14:27:35.000Z
SVFEngine/SVFEngine/SoundIMMN.h
safiar/SVFEngine
5038143a0f369e88dd4fab364a0c22f7729217b3
[ "Apache-2.0" ]
1
2018-04-29T14:45:47.000Z
2018-04-29T14:45:47.000Z
SVFEngine/SVFEngine/SoundIMMN.h
safiar/SVFEngine
5038143a0f369e88dd4fab364a0c22f7729217b3
[ "Apache-2.0" ]
null
null
null
// ----------------------------------------------------------------------- // // // MODULE : SoundIMMN.h // // PURPOSE : Содержит реализацию интерфейса IMMNotificationClient // // CREATED : SavF. ⚡ Savenkov Filipp A. (2018) // // ----------------------------------------------------------------------- // #ifndef _SOUNDIMMN_H #define _SOUNDIMMN_H #include "SoundDevice.h" #include <initguid.h> // Property keys init mechanism #include <MMDeviceAPI.h> // Multimedia Device (MMDevice) API API to enumerate the audio endpoint devices in the system #include <AudioClient.h> // Windows Audio Session API (WASAPI) API to create and manage audio streams to and from audio endpoint devices #include <AudioPolicy.h> // Windows Audio Session API (WASAPI) . //#include <DeviceTopology.h> // DeviceTopology API API to directly access the topological features inside hardware devices in audio adapters //#include <EndpointVolume.h> // EndpointVolume API API to directly access the volume controls on audio endpoint devices by applications //#pragma comment(lib, "uuid.lib") //#include <setupapi.h> //#include <devpkey.h> //#include <Functiondiscoverykeys_devpkey.h> // Defines property keys for the Plug and Play Device Property API. #include <Functiondiscoverykeys.h> //#include <propkey.h> //#include <mmdeviceapi.h> #include <Audioenginebaseapo.h> // некоторые доп. ключи #pragma region <devpkey.h> DEFINE_PROPERTYKEY(PKEY_Device_ProblemStatus, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 12); // DEVPROP_TYPE_NTSTATUS DEFINE_PROPERTYKEY(PKEY_Device_InLocalMachineContainer, 0x8c7ed206, 0x3f8a, 0x4827, 0xb3, 0xab, 0xae, 0x9e, 0x1f, 0xae, 0xfc, 0x6c, 4); // DEVPROP_TYPE_BOOLEAN DEFINE_PROPERTYKEY(PKEY_Device_ShowInUninstallUI, 0x80d81ea6, 0x7473, 0x4b0c, 0x82, 0x16, 0xef, 0xc1, 0x1a, 0x2c, 0x4c, 0x8b, 8); // DEVPROP_TYPE_BOOLEAN DEFINE_PROPERTYKEY(PKEY_Device_IsPresent, 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 5); // DEVPROP_TYPE_BOOL DEFINE_PROPERTYKEY(PKEY_Device_HasProblem, 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 6); // DEVPROP_TYPE_BOOL DEFINE_PROPERTYKEY(PKEY_Device_ConfigurationId, 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 7); // DEVPROP_TYPE_STRING DEFINE_PROPERTYKEY(PKEY_Device_ReportedDeviceIdsHash, 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 8); // DEVPROP_TYPE_UINT32 DEFINE_PROPERTYKEY(PKEY_Device_PhysicalDeviceLocation, 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 9); // DEVPROP_TYPE_BINARY DEFINE_PROPERTYKEY(PKEY_Device_BiosDeviceName, 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 10); // DEVPROP_TYPE_STRING DEFINE_PROPERTYKEY(PKEY_Device_DriverProblemDesc, 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 11); // DEVPROP_TYPE_STRING DEFINE_PROPERTYKEY(PKEY_Device_DebuggerSafe, 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 12); // DEVPROP_TYPE_UINT32 DEFINE_PROPERTYKEY(PKEY_Device_PostInstallInProgress, 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 13); // DEVPROP_TYPE_BOOLEAN DEFINE_PROPERTYKEY(PKEY_Device_Stack, 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 14); // DEVPROP_TYPE_STRING_LIST DEFINE_PROPERTYKEY(PKEY_Device_ExtendedConfigurationIds, 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 15); // DEVPROP_TYPE_STRING_LIST DEFINE_PROPERTYKEY(PKEY_Device_IsRebootRequired, 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 16); // DEVPROP_TYPE_BOOLEAN DEFINE_PROPERTYKEY(PKEY_Device_FirmwareDate, 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 17); // DEVPROP_TYPE_FILETIME DEFINE_PROPERTYKEY(PKEY_Device_FirmwareVersion, 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 18); // DEVPROP_TYPE_STRING DEFINE_PROPERTYKEY(PKEY_Device_FirmwareRevision, 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 19); // DEVPROP_TYPE_STRING DEFINE_PROPERTYKEY(PKEY_Device_SessionId, 0x83da6326, 0x97a6, 0x4088, 0x94, 0x53, 0xa1, 0x92, 0x3f, 0x57, 0x3b, 0x29, 6); // DEVPROP_TYPE_UINT32 DEFINE_PROPERTYKEY(PKEY_Device_InstallDate, 0x83da6326, 0x97a6, 0x4088, 0x94, 0x53, 0xa1, 0x92, 0x3f, 0x57, 0x3b, 0x29, 100); // DEVPROP_TYPE_FILETIME DEFINE_PROPERTYKEY(PKEY_Device_FirstInstallDate, 0x83da6326, 0x97a6, 0x4088, 0x94, 0x53, 0xa1, 0x92, 0x3f, 0x57, 0x3b, 0x29, 101); // DEVPROP_TYPE_FILETIME DEFINE_PROPERTYKEY(PKEY_Device_LastArrivalDate, 0x83da6326, 0x97a6, 0x4088, 0x94, 0x53, 0xa1, 0x92, 0x3f, 0x57, 0x3b, 0x29, 102); // DEVPROP_TYPE_FILETIME DEFINE_PROPERTYKEY(PKEY_Device_LastRemovalDate, 0x83da6326, 0x97a6, 0x4088, 0x94, 0x53, 0xa1, 0x92, 0x3f, 0x57, 0x3b, 0x29, 103); // DEVPROP_TYPE_FILETIME DEFINE_PROPERTYKEY(PKEY_DeviceClass_DHPRebalanceOptOut, 0xd14d3ef3, 0x66cf, 0x4ba2, 0x9d, 0x38, 0x0d, 0xdb, 0x37, 0xab, 0x47, 0x01, 2); // DEVPROP_TYPE_BOOLEAN DEFINE_PROPERTYKEY(PKEY_DeviceInterface_ReferenceString, 0x026e516e, 0xb814, 0x414b, 0x83, 0xcd, 0x85, 0x6d, 0x6f, 0xef, 0x48, 0x22, 5); // DEVPROP_TYPE_STRING DEFINE_PROPERTYKEY(PKEY_DeviceInterface_Restricted, 0x026e516e, 0xb814, 0x414b, 0x83, 0xcd, 0x85, 0x6d, 0x6f, 0xef, 0x48, 0x22, 6); // DEVPROP_TYPE_BOOLEAN DEFINE_PROPERTYKEY(PKEY_DeviceInterfaceClass_Name, 0x14c83a99, 0x0b3f, 0x44b7, 0xbe, 0x4c, 0xa1, 0x78, 0xd3, 0x99, 0x05, 0x64, 3); // DEVPROP_TYPE_STRING DEFINE_PROPERTYKEY(PKEY_DeviceContainer_Address, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 51); // DEVPROP_TYPE_STRING | DEVPROP_TYPE_STRING_LIST DEFINE_PROPERTYKEY(PKEY_DeviceContainer_DiscoveryMethod, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 52); // DEVPROP_TYPE_STRING_LIST DEFINE_PROPERTYKEY(PKEY_DeviceContainer_IsEncrypted, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 53); // DEVPROP_TYPE_BOOLEAN DEFINE_PROPERTYKEY(PKEY_DeviceContainer_IsAuthenticated, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 54); // DEVPROP_TYPE_BOOLEAN DEFINE_PROPERTYKEY(PKEY_DeviceContainer_IsConnected, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 55); // DEVPROP_TYPE_BOOLEAN DEFINE_PROPERTYKEY(PKEY_DeviceContainer_IsPaired, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 56); // DEVPROP_TYPE_BOOLEAN DEFINE_PROPERTYKEY(PKEY_DeviceContainer_Icon, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 57); // DEVPROP_TYPE_STRING DEFINE_PROPERTYKEY(PKEY_DeviceContainer_Version, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 65); // DEVPROP_TYPE_STRING DEFINE_PROPERTYKEY(PKEY_DeviceContainer_Last_Seen, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 66); // DEVPROP_TYPE_FILETIME DEFINE_PROPERTYKEY(PKEY_DeviceContainer_Last_Connected, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 67); // DEVPROP_TYPE_FILETIME DEFINE_PROPERTYKEY(PKEY_DeviceContainer_IsShowInDisconnectedState, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 68); // DEVPROP_TYPE_BOOLEAN DEFINE_PROPERTYKEY(PKEY_DeviceContainer_IsLocalMachine, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 70); // DEVPROP_TYPE_BOOLEAN DEFINE_PROPERTYKEY(PKEY_DeviceContainer_MetadataPath, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 71); // DEVPROP_TYPE_STRING DEFINE_PROPERTYKEY(PKEY_DeviceContainer_IsMetadataSearchInProgress, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 72); // DEVPROP_TYPE_BOOLEAN DEFINE_PROPERTYKEY(PKEY_DeviceContainer_MetadataChecksum, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 73); // DEVPROP_TYPE_BINARY DEFINE_PROPERTYKEY(PKEY_DeviceContainer_IsNotInterestingForDisplay, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 74); // DEVPROP_TYPE_BOOLEAN DEFINE_PROPERTYKEY(PKEY_DeviceContainer_LaunchDeviceStageOnDeviceConnect, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 76); // DEVPROP_TYPE_BOOLEAN DEFINE_PROPERTYKEY(PKEY_DeviceContainer_LaunchDeviceStageFromExplorer, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 77); // DEVPROP_TYPE_BOOLEAN DEFINE_PROPERTYKEY(PKEY_DeviceContainer_BaselineExperienceId, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 78); // DEVPROP_TYPE_GUID DEFINE_PROPERTYKEY(PKEY_DeviceContainer_IsDeviceUniquelyIdentifiable, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 79); // DEVPROP_TYPE_BOOLEAN DEFINE_PROPERTYKEY(PKEY_DeviceContainer_AssociationArray, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 80); // DEVPROP_TYPE_STRING_LIST DEFINE_PROPERTYKEY(PKEY_DeviceContainer_DeviceDescription1, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 81); // DEVPROP_TYPE_STRING DEFINE_PROPERTYKEY(PKEY_DeviceContainer_DeviceDescription2, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 82); // DEVPROP_TYPE_STRING DEFINE_PROPERTYKEY(PKEY_DeviceContainer_HasProblem, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 83); // DEVPROP_TYPE_BOOLEAN DEFINE_PROPERTYKEY(PKEY_DeviceContainer_IsSharedDevice, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 84); // DEVPROP_TYPE_BOOLEAN DEFINE_PROPERTYKEY(PKEY_DeviceContainer_IsNetworkDevice, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 85); // DEVPROP_TYPE_BOOLEAN DEFINE_PROPERTYKEY(PKEY_DeviceContainer_IsDefaultDevice, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 86); // DEVPROP_TYPE_BOOLEAN DEFINE_PROPERTYKEY(PKEY_DeviceContainer_MetadataCabinet, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 87); // DEVPROP_TYPE_STRING DEFINE_PROPERTYKEY(PKEY_DeviceContainer_RequiresPairingElevation, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 88); // DEVPROP_TYPE_BOOLEAN DEFINE_PROPERTYKEY(PKEY_DeviceContainer_ExperienceId, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 89); // DEVPROP_TYPE_GUID DEFINE_PROPERTYKEY(PKEY_DeviceContainer_Category, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 90); // DEVPROP_TYPE_STRING_LIST DEFINE_PROPERTYKEY(PKEY_DeviceContainer_Category_Desc_Singular, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 91); // DEVPROP_TYPE_STRING_LIST DEFINE_PROPERTYKEY(PKEY_DeviceContainer_Category_Desc_Plural, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 92); // DEVPROP_TYPE_STRING_LIST DEFINE_PROPERTYKEY(PKEY_DeviceContainer_Category_Icon, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 93); // DEVPROP_TYPE_STRING DEFINE_PROPERTYKEY(PKEY_DeviceContainer_CategoryGroup_Desc, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 94); // DEVPROP_TYPE_STRING_LIST DEFINE_PROPERTYKEY(PKEY_DeviceContainer_CategoryGroup_Icon, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 95); // DEVPROP_TYPE_STRING DEFINE_PROPERTYKEY(PKEY_DeviceContainer_PrimaryCategory, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 97); // DEVPROP_TYPE_STRING DEFINE_PROPERTYKEY(PKEY_DeviceContainer_UnpairUninstall, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 98); // DEVPROP_TYPE_BOOLEAN DEFINE_PROPERTYKEY(PKEY_DeviceContainer_RequiresUninstallElevation, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 99); // DEVPROP_TYPE_BOOLEAN DEFINE_PROPERTYKEY(PKEY_DeviceContainer_DeviceFunctionSubRank, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 100); // DEVPROP_TYPE_UINT32 DEFINE_PROPERTYKEY(PKEY_DeviceContainer_AlwaysShowDeviceAsConnected, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 101); // DEVPROP_TYPE_BOOLEAN DEFINE_PROPERTYKEY(PKEY_DeviceContainer_ConfigFlags, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 105); // DEVPROP_TYPE_UINT32 DEFINE_PROPERTYKEY(PKEY_DeviceContainer_PrivilegedPackageFamilyNames, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 106); // DEVPROP_TYPE_STRING_LIST DEFINE_PROPERTYKEY(PKEY_DeviceContainer_CustomPrivilegedPackageFamilyNames, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 107); // DEVPROP_TYPE_STRING_LIST DEFINE_PROPERTYKEY(PKEY_DeviceContainer_IsRebootRequired, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 108); // DEVPROP_TYPE_BOOLEAN DEFINE_PROPERTYKEY(PKEY_DeviceContainer_FriendlyName, 0x656A3BB3, 0xECC0, 0x43FD, 0x84, 0x77, 0x4A, 0xE0, 0x40, 0x4A, 0x96, 0xCD, 12288); // DEVPROP_TYPE_STRING DEFINE_PROPERTYKEY(PKEY_DeviceContainer_Manufacturer, 0x656A3BB3, 0xECC0, 0x43FD, 0x84, 0x77, 0x4A, 0xE0, 0x40, 0x4A, 0x96, 0xCD, 8192); // DEVPROP_TYPE_STRING DEFINE_PROPERTYKEY(PKEY_DeviceContainer_ModelName, 0x656A3BB3, 0xECC0, 0x43FD, 0x84, 0x77, 0x4A, 0xE0, 0x40, 0x4A, 0x96, 0xCD, 8194); // DEVPROP_TYPE_STRING (localizable) DEFINE_PROPERTYKEY(PKEY_DeviceContainer_ModelNumber, 0x656A3BB3, 0xECC0, 0x43FD, 0x84, 0x77, 0x4A, 0xE0, 0x40, 0x4A, 0x96, 0xCD, 8195); // DEVPROP_TYPE_STRING DEFINE_PROPERTYKEY(PKEY_DeviceContainer_InstallInProgress, 0x83da6326, 0x97a6, 0x4088, 0x94, 0x53, 0xa1, 0x92, 0x3f, 0x57, 0x3b, 0x29, 9); // DEVPROP_TYPE_BOOLEAN #pragma endregion #pragma region EXTRA_AUDIO_KEYS_(debug) // fmtid B3F8FA53 - 0004 - 438E-9003 - 51 A4 6E 13 9B FC pid 15 VT_BLOB DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_BlobMain_1, 0xB3F8FA53, 0x0004, 0x438E, 0x90, 0x03, 0x51, 0xA4, 0x6E, 0x13, 0x9B, 0xFC, 15); // VT_BLOB // fmtid B3F8FA53 - 0004 - 438E-9003 - 51 A4 6E 13 9B FC pid 6 VT_LPWSTR DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_DeviceDesc, 0xB3F8FA53, 0x0004, 0x438E, 0x90, 0x03, 0x51, 0xA4, 0x6E, 0x13, 0x9B, 0xFC, 6); // VT_LPWSTR // fmtid B3F8FA53 - 0004 - 438E-9003 - 51 A4 6E 13 9B FC pid 2 VT_LPWSTR DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_FuncSubSys, 0xB3F8FA53, 0x0004, 0x438E, 0x90, 0x03, 0x51, 0xA4, 0x6E, 0x13, 0x9B, 0xFC, 2); // VT_LPWSTR // fmtid B3F8FA53 - 0004 - 438E-9003 - 51 A4 6E 13 9B FC pid 11 VT_LPWSTR DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_FuncSubSys_2, 0xB3F8FA53, 0x0004, 0x438E, 0x90, 0x03, 0x51, 0xA4, 0x6E, 0x13, 0x9B, 0xFC, 11); // VT_LPWSTR // fmtid B3F8FA53 - 0004 - 438E-9003 - 51 A4 6E 13 9B FC pid 0 VT_UI4 DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_IntA_1, 0xB3F8FA53, 0x0004, 0x438E, 0x90, 0x03, 0x51, 0xA4, 0x6E, 0x13, 0x9B, 0xFC, 0); // VT_UI4 // fmtid B3F8FA53 - 0004 - 438E-9003 - 51 A4 6E 13 9B FC pid 12 VT_UI4 DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_IntA_2, 0xB3F8FA53, 0x0004, 0x438E, 0x90, 0x03, 0x51, 0xA4, 0x6E, 0x13, 0x9B, 0xFC, 12); // VT_UI4 // fmtid B3F8FA53 - 0004 - 438E-9003 - 51 A4 6E 13 9B FC pid 10 VT_UI4 DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_IntA_3, 0xB3F8FA53, 0x0004, 0x438E, 0x90, 0x03, 0x51, 0xA4, 0x6E, 0x13, 0x9B, 0xFC, 10); // VT_UI4 // fmtid B3F8FA53 - 0004 - 438E-9003 - 51 A4 6E 13 9B FC pid 5 VT_BLOB DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_BlobMain_2, 0xB3F8FA53, 0x0004, 0x438E, 0x90, 0x03, 0x51, 0xA4, 0x6E, 0x13, 0x9B, 0xFC, 5); // VT_BLOB // fmtid B3F8FA53 - 0004 - 438E-9003 - 51 A4 6E 13 9B FC pid 1 VT_BLOB DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_BlobMain_3, 0xB3F8FA53, 0x0004, 0x438E, 0x90, 0x03, 0x51, 0xA4, 0x6E, 0x13, 0x9B, 0xFC, 1); // VT_BLOB // fmtid 83DA6326 - 97A6 - 4088-9453 - A1 92 3F 57 3B 29 pid 3 VT_LPWSTR DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_Manufacturer, 0x83DA6326, 0x97A6, 0x4088, 0x94, 0x53, 0xA1, 0x92, 0x3F, 0x57, 0x3B, 0x29, 3); // VT_LPWSTR // fmtid 840B8171 - B0AD - 410F-8581 - CC CC 03 82 CF EF pid 0 VT_BLOB DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_BlobSub, 0x840B8171, 0xB0AD, 0x410F, 0x85, 0x81, 0xCC, 0xCC, 0x03, 0x82, 0xCF, 0xEF, 0); // VT_BLOB // fmtid F1056047 - B091 - 4D85-A5C0 - B1 3D 4D 8B AC 57 pid 0 VT_LPWSTR DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_ExtraGUID, 0xF1056047, 0xB091, 0x4D85, 0xA5, 0xC0, 0xB1, 0x3D, 0x4D, 0x8B, 0xAC, 0x57, 0); // VT_LPWSTR // fmtid 9A82A7DB - 3EBB - 41B4-83BA - 18 B7 31 17 18 FC pid 1 VT_UI4 DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_IntB_1, 0x9A82A7DB, 0x3EBB, 0x41B4, 0x83, 0xBA, 0x18, 0xB7, 0x31, 0x17, 0x18, 0xFC, 1); // VT_UI4 // fmtid 9A82A7DB - 3EBB - 41B4-83BA - 18 B7 31 17 18 FC pid 146 VT_UI4 DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_IntB_2, 0x9A82A7DB, 0x3EBB, 0x41B4, 0x83, 0xBA, 0x18, 0xB7, 0x31, 0x17, 0x18, 0xFC, 146); // VT_UI4 // fmtid 9A82A7DB - 3EBB - 41B4 83BA - 18 B7 31 17 18 FC pid 356 VT_UI4 DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_IntB_3, 0x9A82A7DB, 0x3EBB, 0x41B4, 0x83, 0xBA, 0x18, 0xB7, 0x31, 0x17, 0x18, 0xFC, 356); // VT_UI4 // fmtid 233164C8 - 1B2C - 4C7D-BC68 - B6 71 68 7A 25 67 pid 1 VT_LPWSTR DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_FuncCodec_1, 0x233164C8, 0x1B2C, 0x4C7D, 0xBC, 0x68, 0xB6, 0x71, 0x68, 0x7A, 0x25, 0x67, 1); // VT_LPWSTR // fmtid 233164C8 - 1B2C - 4C7D-BC68 - B6 71 68 7A 25 67 pid 146 VT_LPWSTR DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_FuncCodec_2, 0x233164C8, 0x1B2C, 0x4C7D, 0xBC, 0x68, 0xB6, 0x71, 0x68, 0x7A, 0x25, 0x67, 146); // VT_LPWSTR // fmtid 233164C8 - 1B2C - 4C7D-BC68 - B6 71 68 7A 25 67 pid 356 VT_LPWSTR DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_FuncCodec_3, 0x233164C8, 0x1B2C, 0x4C7D, 0xBC, 0x68, 0xB6, 0x71, 0x68, 0x7A, 0x25, 0x67, 356); // VT_LPWSTR // fmtid 5A9125B7 - F367 - 4924-ACE2 - 08 03 A4 A3 A4 71 pid 0 VT_UI4 DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_IntC_1, 0x5A9125B7, 0xF367, 0x4924, 0xAC, 0xE2, 0x08, 0x03, 0xA4, 0xA3, 0xA4, 0x71, 0); // VT_UI4 // fmtid 5A9125B7 - F367 - 4924-ACE2 - 08 03 A4 A3 A4 71 pid 2 VT_UI4 DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_IntC_2, 0x5A9125B7, 0xF367, 0x4924, 0xAC, 0xE2, 0x08, 0x03, 0xA4, 0xA3, 0xA4, 0x71, 2); // VT_UI4 // fmtid 9D631510 - 92A8 - 4A79-A79E - A8 38 12 C9 C1 19 pid 0 VT_LPWSTR DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_ExtraGUIDx_1, 0x9D631510, 0x92A8, 0x4A79, 0xA7, 0x9E, 0xA8, 0x38, 0x12, 0xC9, 0xC1, 0x19, 0); // VT_LPWSTR // fmtid 9D631510 - 92A8 - 4A79-A79E - A8 38 12 C9 C1 19 pid 1 VT_LPWSTR DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_ExtraGUIDx_2, 0x9D631510, 0x92A8, 0x4A79, 0xA7, 0x9E, 0xA8, 0x38, 0x12, 0xC9, 0xC1, 0x19, 1); // VT_LPWSTR // fmtid 9D631510 - 92A8 - 4A79-A79E - A8 38 12 C9 C1 19 pid 2 VT_LPWSTR DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_ExtraGUIDx_3, 0x9D631510, 0x92A8, 0x4A79, 0xA7, 0x9E, 0xA8, 0x38, 0x12, 0xC9, 0xC1, 0x19, 2); // VT_LPWSTR // fmtid 9D631510 - 92A8 - 4A79-A79E - A8 38 12 C9 C1 19 pid 3 VT_UI4 DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_IntD_1, 0x9D631510, 0x92A8, 0x4A79, 0xA7, 0x9E, 0xA8, 0x38, 0x12, 0xC9, 0xC1, 0x19, 3); // VT_UI4 // fmtid 9D631510 - 92A8 - 4A79-A79E - A8 38 12 C9 C1 19 pid 4 VT_UI4 DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_IntD_2, 0x9D631510, 0x92A8, 0x4A79, 0xA7, 0x9E, 0xA8, 0x38, 0x12, 0xC9, 0xC1, 0x19, 4); // VT_UI4 // fmtid 9D631510 - 92A8 - 4A79-A79E - A8 38 12 C9 C1 19 pid 5 VT_BLOB or VT_VECTOR | VT_ARRAY | VT_BYREF | VT_RESERVED DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_Reserved_1, 0x9D631510, 0x92A8, 0x4A79, 0xA7, 0x9E, 0xA8, 0x38, 0x12, 0xC9, 0xC1, 0x19, 5); // VT_BLOB or VT_VECTOR | VT_ARRAY | VT_BYREF | VT_RESERVED // fmtid 9D631510 - 92A8 - 4A79-A79E - A8 38 12 C9 C1 19 pid 6 VT_BLOB or VT_VECTOR | VT_ARRAY | VT_BYREF | VT_RESERVED DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_Reserved_2, 0x9D631510, 0x92A8, 0x4A79, 0xA7, 0x9E, 0xA8, 0x38, 0x12, 0xC9, 0xC1, 0x19, 6); // VT_BLOB or VT_VECTOR | VT_ARRAY | VT_BYREF | VT_RESERVED // fmtid E4870E26 - 3CC5 - 4CD2-BA46 - CA 0A 9A 70 ED 04 pid 0 VT_BLOB DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_BlobS_1, 0xE4870E26, 0x3CC5, 0x4CD2, 0xBA, 0x46, 0xCA, 0x0A, 0x9A, 0x70, 0xED, 0x04, 0); // VT_BLOB // fmtid E4870E26 - 3CC5 - 4CD2-BA46 - CA 0A 9A 70 ED 04 pid 1 VT_BLOB DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_BlobS_2, 0xE4870E26, 0x3CC5, 0x4CD2, 0xBA, 0x46, 0xCA, 0x0A, 0x9A, 0x70, 0xED, 0x04, 1); // VT_BLOB // fmtid 7A8B74C8 - FA66 - 4460-8542 - D6 11 9C 59 E9 D4 pid 4 VT_UI4 DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_IntE_1, 0x7A8B74C8, 0xFA66, 0x4460, 0x85, 0x42, 0xD6, 0x11, 0x9C, 0x59, 0xE9, 0xD4, 4); // VT_UI4 // fmtid 6CA6A085 - 3041 - 482B-9113 - C6 1E 7F 25 03 56 pid 0 VT_LPWSTR DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_Version, 0x6CA6A085, 0x3041, 0x482B, 0x91, 0x13, 0xC6, 0x1E, 0x7F, 0x25, 0x03, 0x56, 0); // VT_LPWSTR // fmtid 9855C4CD - DF8C - 449C-A181 - 81 91 B6 8B D0 6C pid 0 VT_BLOB DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_BlobEx, 0x9855C4CD, 0xDF8C, 0x449C, 0xA1, 0x81, 0x81, 0x91, 0xB6, 0x8B, 0xD0, 0x6C, 0); // VT_BLOB // fmtid 24DBB0FC - 9311 - 4B3D-9CF0 - 18 FF 15 56 39 D4 pid 3 VT_BOOL DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_PropBool_1, 0x24DBB0FC, 0x9311, 0x4B3D, 0x9C, 0xF0, 0x18, 0xFF, 0x15, 0x56, 0x39, 0xD4, 3); // VT_BOOL // fmtid 24DBB0FC - 9311 - 4B3D-9CF0 - 18 FF 15 56 39 D4 pid 4 VT_BOOL DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_PropBool_2, 0x24DBB0FC, 0x9311, 0x4B3D, 0x9C, 0xF0, 0x18, 0xFF, 0x15, 0x56, 0x39, 0xD4, 4); // VT_BOOL // fmtid 3BA0CD54 - 830F - 4551-A6EB - F3 EA B6 8E 37 00 pid 17 VT_UI4 DEFINE_PROPERTYKEY(PKEY_Device_EXTRA_IntF_1, 0x3BA0CD54, 0x830F, 0x4551, 0xA6, 0xEB, 0xF3, 0xEA, 0xB6, 0x8E, 0x37, 0x00, 17); // VT_UI4 #pragma endregion namespace SAVFGAME { struct NotificationData { wstring devID; uint32 newState; PROPERTYKEY propKey; EDataFlow flow; ERole role; }; class CMMNotificationClient : public IMMNotificationClient { LONG _cRef; CSoundDevice * pManager; public: CMMNotificationClient(CSoundDevice * pDeviceManager) : _cRef(1) { pManager = pDeviceManager; }; ~CMMNotificationClient() { }; //>> IUnknown method ULONG STDMETHODCALLTYPE AddRef() override final { return InterlockedIncrement(&_cRef); } //>> IUnknown method ULONG STDMETHODCALLTYPE Release() override final { ULONG ulRef = InterlockedDecrement(&_cRef); if (0 == ulRef) { delete this; } return ulRef; } //>> IUnknown method HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, VOID **ppvInterface) override final { if (IID_IUnknown == riid) { AddRef(); *ppvInterface = (IUnknown*)this; } else if (__uuidof(IMMNotificationClient) == riid) { AddRef(); *ppvInterface = (IMMNotificationClient*)this; } else { *ppvInterface = NULL; return E_NOINTERFACE; } return S_OK; } //>> Уведомляет, когда изменилось состояние устройства <eSoundDevState> HRESULT STDMETHODCALLTYPE OnDeviceStateChanged ( LPCWSTR pwstrDeviceId, DWORD dwNewState ) override final { //wprintf(L"\n[IMMNotify] Device state has been changed"); if (pManager == nullptr) { _MBM(ERROR_PointerNone); return S_FALSE; } NotificationData pData; pData.devID = pwstrDeviceId; pData.newState = dwNewState; pManager->IncomingNotification(eSDNotifyDeviceStateChanged, &pData); return S_OK; }; //>> Уведомляет о появлении нового устройства в системе HRESULT STDMETHODCALLTYPE OnDeviceAdded ( LPCWSTR pwstrDeviceId ) override final { //wprintf(L"\n[IMMNotify] Added new audio endpoint device"); if (pManager == nullptr) { _MBM(ERROR_PointerNone); return S_FALSE; } NotificationData pData; pData.devID = pwstrDeviceId; pManager->IncomingNotification(eSDNotifyDeviceAdded, &pData); return S_OK; }; //>> Уведомляет об удалении существующего устройства из системы HRESULT STDMETHODCALLTYPE OnDeviceRemoved ( LPCWSTR pwstrDeviceId ) override final { //wprintf(L"\n[IMMNotify] User removed audio endpoint device"); if (pManager == nullptr) { _MBM(ERROR_PointerNone); return S_FALSE; } NotificationData pData; pData.devID = pwstrDeviceId; pManager->IncomingNotification(eSDNotifyDeviceRemoved, &pData); return S_OK; }; //>> Уведомляет, что сменилось устройство по умолчанию для определённой роли (eConsole / eMultimedia / eCommunications) HRESULT STDMETHODCALLTYPE OnDefaultDeviceChanged( EDataFlow flow, ERole role, LPCWSTR pwstrDefaultDeviceId) override final { //wprintf(L"\n[IMMNotify] User changes role of an default audio endpoint device"); if (pManager == nullptr) { _MBM(ERROR_PointerNone); return S_FALSE; } NotificationData pData; pData.devID = pwstrDefaultDeviceId; pData.flow = flow; pData.role = role; pManager->IncomingNotification(eSDNotifyDefaultDeviceChanged, &pData); return S_OK; }; //>> Уведомляет, что изменилось некоторое свойство устройства HRESULT STDMETHODCALLTYPE OnPropertyValueChanged( LPCWSTR pwstrDeviceId, const PROPERTYKEY key) override final { //wprintf(L"\n[IMMNotify] User changes value of a property of an audio endpoint device"); if (pManager == nullptr) { _MBM(ERROR_PointerNone); return S_FALSE; } NotificationData pData; pData.devID = pwstrDeviceId; pData.propKey = key; pManager->IncomingNotification(eSDNotifyPropertyValueChanged, &pData); return S_OK; }; }; } #endif // _SOUNDIMMN_H
72.179348
200
0.723854
cb563dfd91814e904304d14bcc2de2c33bad70e0
2,933
h
C
php_dotnet_ffi.h
pg-ito/dotnet_ffi
c40a0cf04623a8ef0c0cd036d88ff26e60882d26
[ "MIT" ]
2
2021-01-03T12:26:55.000Z
2021-01-26T15:05:19.000Z
php_dotnet_ffi.h
pg-ito/dotnet_ffi
c40a0cf04623a8ef0c0cd036d88ff26e60882d26
[ "MIT" ]
24
2020-12-20T16:31:19.000Z
2021-01-28T20:54:22.000Z
php_dotnet_ffi.h
pg-ito/dotnet_ffi
c40a0cf04623a8ef0c0cd036d88ff26e60882d26
[ "MIT" ]
null
null
null
/* +----------------------------------------------------------------------+ | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2018 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: | +----------------------------------------------------------------------+ */ /* $Id$ */ #ifndef PHP_DOTNET_FFI_H #define PHP_DOTNET_FFI_H extern zend_module_entry dotnet_ffi_module_entry; #define phpext_dotnet_ffi_ptr &dotnet_ffi_module_entry #define PHP_DOTNET_FFI_VERSION "0.1.0" /* Replace with version number for your extension */ # if defined(ZTS) && defined(COMPILE_DL_DOTNET_FFI) ZEND_TSRMLS_CACHE_EXTERN() # endif #ifdef PHP_WIN32 # define PHP_DOTNET_FFI_API __declspec(dllexport) #elif defined(__GNUC__) && __GNUC__ >= 4 # define PHP_DOTNET_FFI_API __attribute__ ((visibility("default"))) #else # define PHP_DOTNET_FFI_API #endif #ifdef ZTS #include "TSRM.h" #endif /* Declare any global variables you may need between the BEGIN and END macros here: */ ZEND_BEGIN_MODULE_GLOBALS(dotnet_ffi) char *libcoreclr_file_path; char *target_project_name; char *target_class_name; char *target_method_invoke_ret_str_arg_str; char *target_method_invoke_ret_s64_arg_s64; char *target_method_invoke_ret_s64_arg_s64_s64; char *target_method_invoke_ret_s64_arg_s64_s64_s64; char *target_method_invoke_ret_dbl_arg_dbl; char *target_method_invoke_ret_s64_arg_str; ZEND_END_MODULE_GLOBALS(dotnet_ffi) /* PHP_METHOD(DotnetFFI, __construct); PHP_METHOD(DotnetFFI, ret_s64_arg_s64); */ int php_dotnet_ffi_core_clr_initialize(); /* Always refer to the globals in your function as DOTNET_FFI_G(variable). You are encouraged to rename these macros something shorter, see examples in any other php module directory. */ #define DOTNET_FFI_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(dotnet_ffi, v) #if defined(ZTS) && defined(COMPILE_DL_DOTNET_FFI) ZEND_TSRMLS_CACHE_EXTERN() #endif #endif /* PHP_DOTNET_FFI_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: noet sw=4 ts=4 fdm=marker * vim<600: noet sw=4 ts=4 */
28.201923
91
0.604501
b98540206ccf205e3cd30961c0d0808c0bca9227
315
h
C
YYUIKit/Base/UIKit/UIApplication+YYUIAdd.h
liuxc123/YYUIKit
185bdf9ca7bb02b7e04a431b06780c18228b5dd0
[ "MIT" ]
1
2021-12-15T01:19:44.000Z
2021-12-15T01:19:44.000Z
YYUIKit/Base/UIKit/UIApplication+YYUIAdd.h
liuxc123/YYUIKit
185bdf9ca7bb02b7e04a431b06780c18228b5dd0
[ "MIT" ]
null
null
null
YYUIKit/Base/UIKit/UIApplication+YYUIAdd.h
liuxc123/YYUIKit
185bdf9ca7bb02b7e04a431b06780c18228b5dd0
[ "MIT" ]
null
null
null
// // UIApplication+YYUIAdd.h // YYUIKit // // Created by liuxc on 2021/11/29. // #import <UIKit/UIKit.h> #import "UIApplication+YYAdd.h" NS_ASSUME_NONNULL_BEGIN /** Provides extensions for `UIApplication`. */ @interface UIApplication (YYUIAdd) + (UIEdgeInsets)safeAreaInsets; @end NS_ASSUME_NONNULL_END
13.695652
41
0.730159
f347bfb7705296ed1f2d998c0bfc3d9b722e2e9b
5,119
h
C
src/taurus/silo_taurus_private.h
EMinsight/Silo
a1e27d34e8b52196be2de3d4aae2d0cae21b3f36
[ "Apache-2.0" ]
8
2021-10-08T00:22:19.000Z
2022-03-21T02:17:31.000Z
src/taurus/silo_taurus_private.h
EMinsight/Silo
a1e27d34e8b52196be2de3d4aae2d0cae21b3f36
[ "Apache-2.0" ]
184
2019-03-20T03:02:33.000Z
2019-03-24T18:08:08.000Z
src/taurus/silo_taurus_private.h
EMinsight/Silo
a1e27d34e8b52196be2de3d4aae2d0cae21b3f36
[ "Apache-2.0" ]
4
2021-12-28T11:40:36.000Z
2022-03-30T08:51:51.000Z
/* Copyright (C) 1994-2016 Lawrence Livermore National Security, LLC. LLNL-CODE-425250. All rights reserved. This file is part of Silo. For details, see silo.llnl.gov. 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 disclaimer below. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the disclaimer (as noted below) in the documentation and/or other materials provided with the distribution. * Neither the name of the LLNS/LLNL 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 LAWRENCE LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY 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. This work was produced at Lawrence Livermore National Laboratory under Contract No. DE-AC52-07NA27344 with the DOE. Neither the United States Government nor Lawrence Livermore National Security, LLC nor any of their employees, makes any warranty, express or implied, or assumes any liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately-owned rights. Any reference herein to any specific commercial products, process, or services by trade name, trademark, manufacturer or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or Lawrence Livermore National Security, LLC. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or Lawrence Livermore National Security, LLC, and shall not be used for advertising or product endorsement purposes. */ #ifndef SILO_TAURUS_PRIVATE_H #define SILO_TAURUS_PRIVATE_H /* * SILO Taurus Private header file. * * This header file is included by all SILO-Taurus source files and * contains constants and prototypes that should be visible to * the SILO-Taurus source files, but not to the application. */ #include "silo_private.h" #include "taurus.h" /* * The private version of the DBfile structure is defined here. */ typedef struct DBfile_taur { DBfile_pub pub; TAURUSfile *taurus; } DBfile_taur; #ifndef SILO_NO_CALLBACKS SILO_CALLBACK int db_taur_Close(DBfile *); SILO_CALLBACK int db_taur_GetDir(DBfile *, char *); SILO_CALLBACK int db_taur_SetDir(DBfile *, char const *); SILO_CALLBACK void *db_taur_GetComponent(DBfile *, char const *, char const *); SILO_CALLBACK int db_taur_InqMeshname(DBfile *, char const *, char *); SILO_CALLBACK int db_taur_InqVarExists(DBfile *, char const *); SILO_CALLBACK int db_taur_InqMeshtype(DBfile *, char const *); SILO_CALLBACK DBObjectType db_taur_InqVartype(DBfile *, char const *); SILO_CALLBACK int db_taur_ReadVar(DBfile *, char const *, void *); SILO_CALLBACK DBmaterial *db_taur_GetMaterial(DBfile *, char const *); SILO_CALLBACK DBucdmesh *db_taur_GetUcdmesh(DBfile *, char const *); SILO_CALLBACK DBucdvar *db_taur_GetUcdvar(DBfile *, char const *); SILO_CALLBACK void *db_taur_GetVar(DBfile *, char const *); SILO_CALLBACK int db_taur_GetVarByteLength(DBfile *, char const *); SILO_CALLBACK int db_taur_GetVarLength(DBfile *, char const *); SILO_CALLBACK int db_taur_Filters(DBfile *, FILE *); SILO_CALLBACK int db_taur_NewToc(DBfile *); #endif /* !SILO_NO_CALLBACKS */ /*------------------------------------------------------------------------- * Private or Internal functions. These functions should only be called * by the Taurus device driver. *------------------------------------------------------------------------- */ extern TAURUSfile *db_taur_open(char const *); extern int db_taur_close(TAURUSfile *); extern void init_coord_info(TAURUSfile *); extern void init_mesh_info(TAURUSfile *); extern void init_zone_info(TAURUSfile *); extern int taurus_readvar(TAURUSfile *, char const *, float **, int *, int *, char *); extern void db_taur_extface(int *, int, int, int *, int **, int *, int **); #endif /* !SILO_TAURUS_PRIVATE_H */
45.705357
79
0.747412
f34a3ebf024f4710b6b7ee7f73dc9b0247c83104
354
h
C
TestCppLib/FileManager.h
JavierMendozaPaitan/TestCppApp
aa2f4932a51c5419aede730f7826d0abd5b3b8a6
[ "MIT" ]
null
null
null
TestCppLib/FileManager.h
JavierMendozaPaitan/TestCppApp
aa2f4932a51c5419aede730f7826d0abd5b3b8a6
[ "MIT" ]
null
null
null
TestCppLib/FileManager.h
JavierMendozaPaitan/TestCppApp
aa2f4932a51c5419aede730f7826d0abd5b3b8a6
[ "MIT" ]
null
null
null
#pragma once #include "pch.h" #include "FilterConvolute.h" using namespace std; using namespace cv; class FileManager { public: FileManager(string name); ~FileManager(); string Filename; Mat SrcImage; Mat DstImage; void ShowSrcImage(); void ShowDstImage(); void ApplySobel(); private: FilterConvolute* Filter; string DstFileName(); };
12.206897
28
0.728814
b4033b2d52ef03787e4fd3b185d6e5c1803b180c
1,406
h
C
Game/BattleLogic/TW_ChainEffectData.h
TaoReiches/Tao
bf54cdf5284d3a6fd7b2e8aec0bc26fa96442a01
[ "Apache-2.0" ]
2
2020-09-30T15:17:32.000Z
2021-02-22T14:19:54.000Z
Game/BattleLogic/TW_ChainEffectData.h
TaoReiches/Tao
bf54cdf5284d3a6fd7b2e8aec0bc26fa96442a01
[ "Apache-2.0" ]
null
null
null
Game/BattleLogic/TW_ChainEffectData.h
TaoReiches/Tao
bf54cdf5284d3a6fd7b2e8aec0bc26fa96442a01
[ "Apache-2.0" ]
null
null
null
#pragma once /********************************************** * Author: Tao Wang Copyright reserved * Contact: tao.reiches@gmail.com **********************************************/ enum class BeChainEffectType { BCET_LIGHTNING = 0, BCET_LIGHTNING_RED, BCET_LIGHTNING_FORKED, BCET_DRAIN_LIFE, BCET_DRAIN_MANA, BCET_BURN_MANA, BCET_LINK_SPIRIT, BCET_LARIAT_CAUGHT, BCET_HEAL_BEAM, BCET_LASER_LIGHT, BCET_FLY_HOOK, BCET_FLY_HOOK2, BCET_FLY_HOOK3, BCET_FLY_HOOK4, }; enum class BeChainTargetType { BCTF_UNIT, BCTF_EFFECT, BCTF_DOODAD, }; class BeChainEffectData { public: BeChainEffectData() { eChainType = BeChainEffectType::BCET_LIGHTNING; eTargetType = BeChainTargetType::BCTF_UNIT; iSourceID = 0; iTargetID = 0; iAllLiveTime = 1000; kPicture = 0; dwColor = 0xFFFFFFFF; iWidth = -1; iConnectBufferID = 0; iUnitID = 0; iShowPlayer = -1; iData = 0; kSourceAttach = 0; uiCreateTime = 0; } BeChainEffectType eChainType; BeChainTargetType eTargetType; int iSourceID; int iTargetID; int iAllLiveTime; int kPicture; unsigned int dwColor; int iWidth; int iConnectBufferID; int iUnitID; int iShowPlayer; int iData; int kSourceAttach; unsigned int uiCreateTime; };
20.676471
55
0.603841
a4b514fc0cbb759a212b856c3dfb9b34ab9447d7
156,085
c
C
cpp/at/cppConsoleApplicationSOAP/wsdl/fiskaltrust.ifPOS.xml.c
FlorianStadlberger/demo
f520c428527d5ddb71a30896e14da6855268378d
[ "MIT" ]
4
2019-01-16T20:12:35.000Z
2020-01-26T23:38:56.000Z
cpp/at/cppConsoleApplicationSOAP/wsdl/fiskaltrust.ifPOS.xml.c
FlorianStadlberger/demo
f520c428527d5ddb71a30896e14da6855268378d
[ "MIT" ]
4
2019-11-27T06:24:58.000Z
2020-03-04T09:04:01.000Z
cpp/at/cppConsoleApplicationSOAP/wsdl/fiskaltrust.ifPOS.xml.c
FlorianStadlberger/demo
f520c428527d5ddb71a30896e14da6855268378d
[ "MIT" ]
9
2019-05-31T10:52:35.000Z
2020-01-23T16:03:45.000Z
 // File generated by Wsutil Compiler version 1.0095 #include <WebServices.h> #include "fiskaltrust.ifPOS.xml.h" typedef struct _fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions { struct // global types { char unused; struct // ReceiptRequest { WS_FIELD_DESCRIPTION ftCashBoxID; WS_FIELD_DESCRIPTION ftQueueID; WS_FIELD_DESCRIPTION ftPosSystemId; WS_FIELD_DESCRIPTION cbTerminalID; WS_FIELD_DESCRIPTION cbReceiptReference; WS_FIELD_DESCRIPTION cbReceiptMoment; struct // ChargeItem { WS_FIELD_DESCRIPTION Position; WS_FIELD_DESCRIPTION Quantity; WS_FIELD_DESCRIPTION Description; WS_FIELD_DESCRIPTION Amount; WS_FIELD_DESCRIPTION VATRate; WS_FIELD_DESCRIPTION ftChargeItemCase; WS_FIELD_DESCRIPTION ftChargeItemCaseData; WS_FIELD_DESCRIPTION VATAmount; WS_FIELD_DESCRIPTION AccountNumber; WS_FIELD_DESCRIPTION CostCenter; WS_FIELD_DESCRIPTION ProductGroup; WS_FIELD_DESCRIPTION ProductNumber; WS_FIELD_DESCRIPTION ProductBarcode; WS_FIELD_DESCRIPTION Unit; WS_FIELD_DESCRIPTION UnitQuantity; WS_FIELD_DESCRIPTION UnitPrice; WS_FIELD_DESCRIPTION Moment; WS_FIELD_DESCRIPTION* ChargeItemFields [17]; } ChargeItemdescs; // end of ChargeItem WS_FIELD_DESCRIPTION cbChargeItems; struct // PayItem { WS_FIELD_DESCRIPTION Position; WS_FIELD_DESCRIPTION Quantity; WS_FIELD_DESCRIPTION Description; WS_FIELD_DESCRIPTION Amount; WS_FIELD_DESCRIPTION ftPayItemCase; WS_FIELD_DESCRIPTION ftPayItemCaseData; WS_FIELD_DESCRIPTION AccountNumber; WS_FIELD_DESCRIPTION CostCenter; WS_FIELD_DESCRIPTION MoneyGroup; WS_FIELD_DESCRIPTION MoneyNumber; WS_FIELD_DESCRIPTION Moment; WS_FIELD_DESCRIPTION* PayItemFields [11]; } PayItemdescs; // end of PayItem WS_FIELD_DESCRIPTION cbPayItems; WS_FIELD_DESCRIPTION ftReceiptCase; WS_FIELD_DESCRIPTION ftReceiptCaseData; WS_FIELD_DESCRIPTION cbReceiptAmount; WS_FIELD_DESCRIPTION cbUser; WS_FIELD_DESCRIPTION cbArea; WS_FIELD_DESCRIPTION cbCustomer; WS_FIELD_DESCRIPTION cbSettlement; WS_FIELD_DESCRIPTION cbPreviousReceiptReference; WS_FIELD_DESCRIPTION* ReceiptRequestFields [16]; } ReceiptRequestdescs; // end of ReceiptRequest struct // ArrayOfChargeItem { WS_FIELD_DESCRIPTION ChargeItem; WS_FIELD_DESCRIPTION* ArrayOfChargeItemFields [1]; } ArrayOfChargeItemdescs; // end of ArrayOfChargeItem struct // ArrayOfPayItem { WS_FIELD_DESCRIPTION PayItem; WS_FIELD_DESCRIPTION* ArrayOfPayItemFields [1]; } ArrayOfPayItemdescs; // end of ArrayOfPayItem struct // ReceiptResponse { WS_FIELD_DESCRIPTION ftCashBoxID; WS_FIELD_DESCRIPTION ftQueueID; WS_FIELD_DESCRIPTION ftQueueItemID; WS_FIELD_DESCRIPTION ftQueueRow; WS_FIELD_DESCRIPTION cbTerminalID; WS_FIELD_DESCRIPTION cbReceiptReference; WS_FIELD_DESCRIPTION ftCashBoxIdentification; WS_FIELD_DESCRIPTION ftReceiptIdentification; WS_FIELD_DESCRIPTION ftReceiptMoment; WS_FIELD_DESCRIPTION ftReceiptHeader; WS_FIELD_DESCRIPTION ftChargeItems; WS_FIELD_DESCRIPTION ftChargeLines; WS_FIELD_DESCRIPTION ftPayItems; WS_FIELD_DESCRIPTION ftPayLines; struct // SignaturItem { WS_FIELD_DESCRIPTION ftSignatureFormat; WS_FIELD_DESCRIPTION ftSignatureType; WS_FIELD_DESCRIPTION Caption; WS_FIELD_DESCRIPTION Data; WS_FIELD_DESCRIPTION* SignaturItemFields [4]; } SignaturItemdescs; // end of SignaturItem WS_FIELD_DESCRIPTION ftSignatures; WS_FIELD_DESCRIPTION ftReceiptFooter; WS_FIELD_DESCRIPTION ftState; WS_FIELD_DESCRIPTION ftStateData; WS_FIELD_DESCRIPTION* ReceiptResponseFields [18]; } ReceiptResponsedescs; // end of ReceiptResponse struct // ArrayOfSignaturItem { WS_FIELD_DESCRIPTION SignaturItem; WS_FIELD_DESCRIPTION* ArrayOfSignaturItemFields [1]; } ArrayOfSignaturItemdescs; // end of ArrayOfSignaturItem struct // ArrayOfstring { WS_FIELD_DESCRIPTION String; WS_FIELD_DESCRIPTION* ArrayOfstringFields [1]; } ArrayOfstringdescs; // end of ArrayOfstring } globalTypes; // end of global types struct // global elements { char unused; struct // _Sign { WS_FIELD_DESCRIPTION data; WS_FIELD_DESCRIPTION* _SignFields [1]; } _Signdescs; // end of _Sign struct // _SignResponse { WS_FIELD_DESCRIPTION SignResult; WS_FIELD_DESCRIPTION* _SignResponseFields [1]; } _SignResponsedescs; // end of _SignResponse struct // _Journal { WS_FIELD_DESCRIPTION ftJournalType; WS_FIELD_DESCRIPTION from; WS_FIELD_DESCRIPTION to; WS_FIELD_DESCRIPTION* _JournalFields [3]; } _Journaldescs; // end of _Journal struct // _JournalResponse { WS_FIELD_DESCRIPTION JournalResult; WS_FIELD_DESCRIPTION* _JournalResponseFields [1]; } _JournalResponsedescs; // end of _JournalResponse struct // _Echo { WS_FIELD_DESCRIPTION message; WS_FIELD_DESCRIPTION* _EchoFields [1]; } _Echodescs; // end of _Echo struct // _EchoResponse { WS_FIELD_DESCRIPTION EchoResult; WS_FIELD_DESCRIPTION* _EchoResponseFields [1]; } _EchoResponsedescs; // end of _EchoResponse } globalElements; // end of global elements struct // messages { WS_MESSAGE_DESCRIPTION IPOS_Sign_InputMessage; WS_MESSAGE_DESCRIPTION IPOS_Sign_OutputMessage; WS_MESSAGE_DESCRIPTION IPOS_Journal_InputMessage; WS_MESSAGE_DESCRIPTION IPOS_Journal_OutputMessage; WS_MESSAGE_DESCRIPTION IPOS_Echo_InputMessage; WS_MESSAGE_DESCRIPTION IPOS_Echo_OutputMessage; } messages; // end of messages struct // contracts { struct // BasicHttpBinding_IPOS { struct // BasicHttpBinding_IPOS_Sign { WS_PARAMETER_DESCRIPTION params[2]; WS_OPERATION_DESCRIPTION BasicHttpBinding_IPOS_Sign; } BasicHttpBinding_IPOS_Sign; struct // BasicHttpBinding_IPOS_Journal { WS_PARAMETER_DESCRIPTION params[4]; WS_OPERATION_DESCRIPTION BasicHttpBinding_IPOS_Journal; } BasicHttpBinding_IPOS_Journal; struct // BasicHttpBinding_IPOS_Echo { WS_PARAMETER_DESCRIPTION params[2]; WS_OPERATION_DESCRIPTION BasicHttpBinding_IPOS_Echo; } BasicHttpBinding_IPOS_Echo; WS_OPERATION_DESCRIPTION* operations[3]; WS_CONTRACT_DESCRIPTION contractDesc; } BasicHttpBinding_IPOS; } contracts; // endof contracts struct // policies { struct // BasicHttpBinding_IPOS { WS_ENCODING encoding; WS_ADDRESSING_VERSION addressingVersion; WS_ENVELOPE_VERSION envelopeVersion; WS_CHANNEL_PROPERTY channelPropertiesArray[3]; } BasicHttpBinding_IPOS; } policies; struct // XML dictionary { struct // XML string list { WS_XML_STRING FactoryTypeTypeName; // FactoryType WS_XML_STRING FactoryTypeTypeNamespace; // http://schemas.microsoft.com/2003/10/Serialization/ WS_XML_STRING IdTypeName; // Id WS_XML_STRING RefTypeName; // Ref WS_XML_STRING ReceiptRequestTypeName; // ReceiptRequest WS_XML_STRING ReceiptRequestTypeNamespace; // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_XML_STRING ReceiptRequestftCashBoxIDLocalName; // ftCashBoxID WS_XML_STRING ReceiptRequestftQueueIDLocalName; // ftQueueID WS_XML_STRING ReceiptRequestftPosSystemIdLocalName; // ftPosSystemId WS_XML_STRING ReceiptRequestcbTerminalIDLocalName; // cbTerminalID WS_XML_STRING ReceiptRequestcbReceiptReferenceLocalName; // cbReceiptReference WS_XML_STRING ReceiptRequestcbReceiptMomentLocalName; // cbReceiptMoment WS_XML_STRING ChargeItemTypeName; // ChargeItem WS_XML_STRING ChargeItemPositionLocalName; // Position WS_XML_STRING ChargeItemQuantityLocalName; // Quantity WS_XML_STRING ChargeItemDescriptionLocalName; // Description WS_XML_STRING ChargeItemAmountLocalName; // Amount WS_XML_STRING ChargeItemVATRateLocalName; // VATRate WS_XML_STRING ChargeItemftChargeItemCaseLocalName; // ftChargeItemCase WS_XML_STRING ChargeItemftChargeItemCaseDataLocalName; // ftChargeItemCaseData WS_XML_STRING ChargeItemVATAmountLocalName; // VATAmount WS_XML_STRING ChargeItemAccountNumberLocalName; // AccountNumber WS_XML_STRING ChargeItemCostCenterLocalName; // CostCenter WS_XML_STRING ChargeItemProductGroupLocalName; // ProductGroup WS_XML_STRING ChargeItemProductNumberLocalName; // ProductNumber WS_XML_STRING ChargeItemProductBarcodeLocalName; // ProductBarcode WS_XML_STRING ChargeItemUnitLocalName; // Unit WS_XML_STRING ChargeItemUnitQuantityLocalName; // UnitQuantity WS_XML_STRING ChargeItemUnitPriceLocalName; // UnitPrice WS_XML_STRING ChargeItemMomentLocalName; // Moment WS_XML_STRING ReceiptRequestcbChargeItemsWrapperName; // cbChargeItems WS_XML_STRING PayItemTypeName; // PayItem WS_XML_STRING PayItemftPayItemCaseLocalName; // ftPayItemCase WS_XML_STRING PayItemftPayItemCaseDataLocalName; // ftPayItemCaseData WS_XML_STRING PayItemMoneyGroupLocalName; // MoneyGroup WS_XML_STRING PayItemMoneyNumberLocalName; // MoneyNumber WS_XML_STRING ReceiptRequestcbPayItemsWrapperName; // cbPayItems WS_XML_STRING ReceiptRequestftReceiptCaseLocalName; // ftReceiptCase WS_XML_STRING ReceiptRequestftReceiptCaseDataLocalName; // ftReceiptCaseData WS_XML_STRING ReceiptRequestcbReceiptAmountLocalName; // cbReceiptAmount WS_XML_STRING ReceiptRequestcbUserLocalName; // cbUser WS_XML_STRING ReceiptRequestcbAreaLocalName; // cbArea WS_XML_STRING ReceiptRequestcbCustomerLocalName; // cbCustomer WS_XML_STRING ReceiptRequestcbSettlementLocalName; // cbSettlement WS_XML_STRING ReceiptRequestcbPreviousReceiptReferenceLocalName; // cbPreviousReceiptReference WS_XML_STRING ArrayOfChargeItemTypeName; // ArrayOfChargeItem WS_XML_STRING ArrayOfPayItemTypeName; // ArrayOfPayItem WS_XML_STRING ReceiptResponseTypeName; // ReceiptResponse WS_XML_STRING ReceiptResponseftQueueItemIDLocalName; // ftQueueItemID WS_XML_STRING ReceiptResponseftQueueRowLocalName; // ftQueueRow WS_XML_STRING ReceiptResponseftCashBoxIdentificationLocalName; // ftCashBoxIdentification WS_XML_STRING ReceiptResponseftReceiptIdentificationLocalName; // ftReceiptIdentification WS_XML_STRING ReceiptResponseftReceiptMomentLocalName; // ftReceiptMoment WS_XML_STRING ReceiptResponseftReceiptHeaderLocalName; // string WS_XML_STRING ReceiptResponseftReceiptHeaderNamespace; // http://schemas.microsoft.com/2003/10/Serialization/Arrays WS_XML_STRING ReceiptResponseftReceiptHeaderWrapperName; // ftReceiptHeader WS_XML_STRING ReceiptResponseftChargeItemsWrapperName; // ftChargeItems WS_XML_STRING ReceiptResponseftChargeLinesWrapperName; // ftChargeLines WS_XML_STRING ReceiptResponseftPayItemsWrapperName; // ftPayItems WS_XML_STRING ReceiptResponseftPayLinesWrapperName; // ftPayLines WS_XML_STRING SignaturItemTypeName; // SignaturItem WS_XML_STRING SignaturItemftSignatureFormatLocalName; // ftSignatureFormat WS_XML_STRING SignaturItemftSignatureTypeLocalName; // ftSignatureType WS_XML_STRING SignaturItemCaptionLocalName; // Caption WS_XML_STRING SignaturItemDataLocalName; // Data WS_XML_STRING ReceiptResponseftSignaturesWrapperName; // ftSignatures WS_XML_STRING ReceiptResponseftReceiptFooterWrapperName; // ftReceiptFooter WS_XML_STRING ReceiptResponseftStateLocalName; // ftState WS_XML_STRING ReceiptResponseftStateDataLocalName; // ftStateData WS_XML_STRING ArrayOfSignaturItemTypeName; // ArrayOfSignaturItem WS_XML_STRING ArrayOfstringTypeName; // ArrayOfstring WS_XML_STRING _SignTypeName; // Sign WS_XML_STRING _SignTypeNamespace; // http://tempuri.org/ WS_XML_STRING _SigndataLocalName; // data WS_XML_STRING _SignResponseTypeName; // SignResponse WS_XML_STRING _SignResponseSignResultLocalName; // SignResult WS_XML_STRING _JournalTypeName; // Journal WS_XML_STRING _JournalftJournalTypeLocalName; // ftJournalType WS_XML_STRING _JournalfromLocalName; // from WS_XML_STRING _JournaltoLocalName; // to WS_XML_STRING _JournalResponseTypeName; // JournalResponse WS_XML_STRING _JournalResponseJournalResultLocalName; // JournalResult WS_XML_STRING _EchoTypeName; // Echo WS_XML_STRING _EchomessageLocalName; // message WS_XML_STRING _EchoResponseTypeName; // EchoResponse WS_XML_STRING _EchoResponseEchoResultLocalName; // EchoResult WS_XML_STRING anyTypeTypeName; // anyType WS_XML_STRING anyURITypeName; // anyURI WS_XML_STRING base64BinaryTypeName; // base64Binary WS_XML_STRING BooleanTypeName; // boolean WS_XML_STRING ByteTypeName; // byte WS_XML_STRING dateTimeTypeName; // dateTime WS_XML_STRING DecimalTypeName; // decimal WS_XML_STRING DoubleTypeName; // double WS_XML_STRING FloatTypeName; // float WS_XML_STRING IntTypeName; // int WS_XML_STRING LongTypeName; // long WS_XML_STRING QNameTypeName; // QName WS_XML_STRING ShortTypeName; // short WS_XML_STRING unsignedByteTypeName; // unsignedByte WS_XML_STRING unsignedIntTypeName; // unsignedInt WS_XML_STRING unsignedLongTypeName; // unsignedLong WS_XML_STRING unsignedShortTypeName; // unsignedShort WS_XML_STRING CharTypeName; // char WS_XML_STRING durationTypeName; // duration WS_XML_STRING guidTypeName; // guid WS_XML_STRING IPOS_Sign_InputMessageactionName; // http://tempuri.org/IPOS/Sign WS_XML_STRING IPOS_Sign_OutputMessageactionName; // http://tempuri.org/IPOS/SignResponse WS_XML_STRING IPOS_Journal_InputMessageactionName; // http://tempuri.org/IPOS/Journal WS_XML_STRING IPOS_Journal_OutputMessageactionName; // http://tempuri.org/IPOS/JournalResponse WS_XML_STRING IPOS_Echo_InputMessageactionName; // http://tempuri.org/IPOS/Echo WS_XML_STRING IPOS_Echo_OutputMessageactionName; // http://tempuri.org/IPOS/EchoResponse } xmlStrings; // end of XML string list WS_XML_DICTIONARY dict; } dictionary; // end of XML dictionary } _fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions; typedef struct BasicHttpBinding_IPOS_SignParamStruct { ReceiptRequest** data; ReceiptResponse** SignResult; } BasicHttpBinding_IPOS_SignParamStruct; #if (_MSC_VER >=1400) #pragma warning(push) #endif #pragma warning(disable: 4055) // conversion from data pointer to function pointer HRESULT CALLBACK BasicHttpBinding_IPOS_SignOperationStub( _In_ const WS_OPERATION_CONTEXT* _context, _In_ void* _stackStruct, _In_ const void* _callback, _In_ const WS_ASYNC_CONTEXT* _asyncContext, _In_ WS_ERROR* _error) { BasicHttpBinding_IPOS_SignCallback _operation = (BasicHttpBinding_IPOS_SignCallback)_callback; BasicHttpBinding_IPOS_SignParamStruct *_stack =(BasicHttpBinding_IPOS_SignParamStruct*)_stackStruct; return _operation( _context, *(_stack->data), (_stack->SignResult), (WS_ASYNC_CONTEXT*)_asyncContext, _error); } #pragma warning(default: 4055) // conversion from data pointer to function pointer #if (_MSC_VER >=1400) #pragma warning(pop) #endif typedef struct BasicHttpBinding_IPOS_JournalParamStruct { __int64* ftJournalType; __int64* from; __int64* to; WS_BYTES* JournalResult; } BasicHttpBinding_IPOS_JournalParamStruct; #if (_MSC_VER >=1400) #pragma warning(push) #endif #pragma warning(disable: 4055) // conversion from data pointer to function pointer HRESULT CALLBACK BasicHttpBinding_IPOS_JournalOperationStub( _In_ const WS_OPERATION_CONTEXT* _context, _In_ void* _stackStruct, _In_ const void* _callback, _In_ const WS_ASYNC_CONTEXT* _asyncContext, _In_ WS_ERROR* _error) { BasicHttpBinding_IPOS_JournalCallback _operation = (BasicHttpBinding_IPOS_JournalCallback)_callback; BasicHttpBinding_IPOS_JournalParamStruct *_stack =(BasicHttpBinding_IPOS_JournalParamStruct*)_stackStruct; return _operation( _context, *(_stack->ftJournalType), *(_stack->from), *(_stack->to), (_stack->JournalResult), (WS_ASYNC_CONTEXT*)_asyncContext, _error); } #pragma warning(default: 4055) // conversion from data pointer to function pointer #if (_MSC_VER >=1400) #pragma warning(pop) #endif typedef struct BasicHttpBinding_IPOS_EchoParamStruct { WCHAR** message; WCHAR** EchoResult; } BasicHttpBinding_IPOS_EchoParamStruct; #if (_MSC_VER >=1400) #pragma warning(push) #endif #pragma warning(disable: 4055) // conversion from data pointer to function pointer HRESULT CALLBACK BasicHttpBinding_IPOS_EchoOperationStub( _In_ const WS_OPERATION_CONTEXT* _context, _In_ void* _stackStruct, _In_ const void* _callback, _In_ const WS_ASYNC_CONTEXT* _asyncContext, _In_ WS_ERROR* _error) { BasicHttpBinding_IPOS_EchoCallback _operation = (BasicHttpBinding_IPOS_EchoCallback)_callback; BasicHttpBinding_IPOS_EchoParamStruct *_stack =(BasicHttpBinding_IPOS_EchoParamStruct*)_stackStruct; return _operation( _context, *(_stack->message), (_stack->EchoResult), (WS_ASYNC_CONTEXT*)_asyncContext, _error); } #pragma warning(default: 4055) // conversion from data pointer to function pointer #if (_MSC_VER >=1400) #pragma warning(pop) #endif const static _fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions = { { // global types 0, { // ReceiptRequest { // field description for ftCashBoxID WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestftCashBoxIDLocalName, // ftCashBoxID (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ReceiptRequest, ftCashBoxID), WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for ftCashBoxID { // field description for ftQueueID WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestftQueueIDLocalName, // ftQueueID (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ReceiptRequest, ftQueueID), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for ftQueueID { // field description for ftPosSystemId WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestftPosSystemIdLocalName, // ftPosSystemId (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ReceiptRequest, ftPosSystemId), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for ftPosSystemId { // field description for cbTerminalID WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestcbTerminalIDLocalName, // cbTerminalID (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ReceiptRequest, cbTerminalID), WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for cbTerminalID { // field description for cbReceiptReference WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestcbReceiptReferenceLocalName, // cbReceiptReference (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ReceiptRequest, cbReceiptReference), WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for cbReceiptReference { // field description for cbReceiptMoment WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestcbReceiptMomentLocalName, // cbReceiptMoment (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_DATETIME_TYPE, 0, WsOffsetOf(ReceiptRequest, cbReceiptMoment), 0, 0, 0xffffffff }, // end of field description for cbReceiptMoment { // ChargeItem { // field description for Position WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemPositionLocalName, // Position (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_INT64_TYPE, 0, WsOffsetOf(ChargeItem, Position), WS_FIELD_OPTIONAL, 0, 0xffffffff }, // end of field description for Position { // field description for Quantity WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemQuantityLocalName, // Quantity (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_DECIMAL_TYPE, 0, WsOffsetOf(ChargeItem, Quantity), 0, 0, 0xffffffff }, // end of field description for Quantity { // field description for Description WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemDescriptionLocalName, // Description (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ChargeItem, Description), WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for Description { // field description for Amount WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemAmountLocalName, // Amount (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_DECIMAL_TYPE, 0, WsOffsetOf(ChargeItem, Amount), 0, 0, 0xffffffff }, // end of field description for Amount { // field description for VATRate WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemVATRateLocalName, // VATRate (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_DECIMAL_TYPE, 0, WsOffsetOf(ChargeItem, VATRate), 0, 0, 0xffffffff }, // end of field description for VATRate { // field description for ftChargeItemCase WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemftChargeItemCaseLocalName, // ftChargeItemCase (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_INT64_TYPE, 0, WsOffsetOf(ChargeItem, ftChargeItemCase), 0, 0, 0xffffffff }, // end of field description for ftChargeItemCase { // field description for ftChargeItemCaseData WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemftChargeItemCaseDataLocalName, // ftChargeItemCaseData (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ChargeItem, ftChargeItemCaseData), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for ftChargeItemCaseData { // field description for VATAmount WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemVATAmountLocalName, // VATAmount (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_DECIMAL_TYPE, 0, WsOffsetOf(ChargeItem, VATAmount), WS_FIELD_POINTER| WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for VATAmount { // field description for AccountNumber WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemAccountNumberLocalName, // AccountNumber (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ChargeItem, AccountNumber), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for AccountNumber { // field description for CostCenter WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemCostCenterLocalName, // CostCenter (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ChargeItem, CostCenter), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for CostCenter { // field description for ProductGroup WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemProductGroupLocalName, // ProductGroup (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ChargeItem, ProductGroup), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for ProductGroup { // field description for ProductNumber WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemProductNumberLocalName, // ProductNumber (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ChargeItem, ProductNumber), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for ProductNumber { // field description for ProductBarcode WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemProductBarcodeLocalName, // ProductBarcode (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ChargeItem, ProductBarcode), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for ProductBarcode { // field description for Unit WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemUnitLocalName, // Unit (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ChargeItem, Unit), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for Unit { // field description for UnitQuantity WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemUnitQuantityLocalName, // UnitQuantity (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_DECIMAL_TYPE, 0, WsOffsetOf(ChargeItem, UnitQuantity), WS_FIELD_POINTER| WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for UnitQuantity { // field description for UnitPrice WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemUnitPriceLocalName, // UnitPrice (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_DECIMAL_TYPE, 0, WsOffsetOf(ChargeItem, UnitPrice), WS_FIELD_POINTER| WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for UnitPrice { // field description for Moment WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemMomentLocalName, // Moment (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_DATETIME_TYPE, 0, WsOffsetOf(ChargeItem, Moment), WS_FIELD_POINTER| WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for Moment { // fields description for ChargeItem (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.ChargeItemdescs.Position, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.ChargeItemdescs.Quantity, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.ChargeItemdescs.Description, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.ChargeItemdescs.Amount, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.ChargeItemdescs.VATRate, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.ChargeItemdescs.ftChargeItemCase, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.ChargeItemdescs.ftChargeItemCaseData, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.ChargeItemdescs.VATAmount, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.ChargeItemdescs.AccountNumber, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.ChargeItemdescs.CostCenter, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.ChargeItemdescs.ProductGroup, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.ChargeItemdescs.ProductNumber, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.ChargeItemdescs.ProductBarcode, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.ChargeItemdescs.Unit, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.ChargeItemdescs.UnitQuantity, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.ChargeItemdescs.UnitPrice, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.ChargeItemdescs.Moment, }, }, // ChargeItem { // field description for cbChargeItems WS_REPEATING_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestcbChargeItemsWrapperName, // cbChargeItems (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_STRUCT_TYPE, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalTypes.ChargeItem, WsOffsetOf(ReceiptRequest, cbChargeItems), WS_FIELD_POINTER| WS_FIELD_NILLABLE| WS_FIELD_NILLABLE_ITEM, 0, WsOffsetOf(ReceiptRequest, cbChargeItemsCount), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemTypeName, // ChargeItem (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 0, }, // end of field description for cbChargeItems { // PayItem { // field description for Position WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemPositionLocalName, // Position (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_INT64_TYPE, 0, WsOffsetOf(PayItem, Position), WS_FIELD_OPTIONAL, 0, 0xffffffff }, // end of field description for Position { // field description for Quantity WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemQuantityLocalName, // Quantity (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_DECIMAL_TYPE, 0, WsOffsetOf(PayItem, Quantity), 0, 0, 0xffffffff }, // end of field description for Quantity { // field description for Description WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemDescriptionLocalName, // Description (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(PayItem, Description), WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for Description { // field description for Amount WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemAmountLocalName, // Amount (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_DECIMAL_TYPE, 0, WsOffsetOf(PayItem, Amount), 0, 0, 0xffffffff }, // end of field description for Amount { // field description for ftPayItemCase WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.PayItemftPayItemCaseLocalName, // ftPayItemCase (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_INT64_TYPE, 0, WsOffsetOf(PayItem, ftPayItemCase), 0, 0, 0xffffffff }, // end of field description for ftPayItemCase { // field description for ftPayItemCaseData WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.PayItemftPayItemCaseDataLocalName, // ftPayItemCaseData (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(PayItem, ftPayItemCaseData), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for ftPayItemCaseData { // field description for AccountNumber WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemAccountNumberLocalName, // AccountNumber (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(PayItem, AccountNumber), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for AccountNumber { // field description for CostCenter WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemCostCenterLocalName, // CostCenter (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(PayItem, CostCenter), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for CostCenter { // field description for MoneyGroup WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.PayItemMoneyGroupLocalName, // MoneyGroup (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(PayItem, MoneyGroup), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for MoneyGroup { // field description for MoneyNumber WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.PayItemMoneyNumberLocalName, // MoneyNumber (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(PayItem, MoneyNumber), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for MoneyNumber { // field description for Moment WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemMomentLocalName, // Moment (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_DATETIME_TYPE, 0, WsOffsetOf(PayItem, Moment), WS_FIELD_POINTER| WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for Moment { // fields description for PayItem (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.PayItemdescs.Position, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.PayItemdescs.Quantity, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.PayItemdescs.Description, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.PayItemdescs.Amount, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.PayItemdescs.ftPayItemCase, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.PayItemdescs.ftPayItemCaseData, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.PayItemdescs.AccountNumber, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.PayItemdescs.CostCenter, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.PayItemdescs.MoneyGroup, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.PayItemdescs.MoneyNumber, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.PayItemdescs.Moment, }, }, // PayItem { // field description for cbPayItems WS_REPEATING_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestcbPayItemsWrapperName, // cbPayItems (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_STRUCT_TYPE, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalTypes.PayItem, WsOffsetOf(ReceiptRequest, cbPayItems), WS_FIELD_POINTER| WS_FIELD_NILLABLE| WS_FIELD_NILLABLE_ITEM, 0, WsOffsetOf(ReceiptRequest, cbPayItemsCount), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.PayItemTypeName, // PayItem (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 0, }, // end of field description for cbPayItems { // field description for ftReceiptCase WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestftReceiptCaseLocalName, // ftReceiptCase (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_INT64_TYPE, 0, WsOffsetOf(ReceiptRequest, ftReceiptCase), 0, 0, 0xffffffff }, // end of field description for ftReceiptCase { // field description for ftReceiptCaseData WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestftReceiptCaseDataLocalName, // ftReceiptCaseData (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ReceiptRequest, ftReceiptCaseData), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for ftReceiptCaseData { // field description for cbReceiptAmount WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestcbReceiptAmountLocalName, // cbReceiptAmount (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_DECIMAL_TYPE, 0, WsOffsetOf(ReceiptRequest, cbReceiptAmount), WS_FIELD_POINTER| WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for cbReceiptAmount { // field description for cbUser WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestcbUserLocalName, // cbUser (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ReceiptRequest, cbUser), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for cbUser { // field description for cbArea WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestcbAreaLocalName, // cbArea (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ReceiptRequest, cbArea), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for cbArea { // field description for cbCustomer WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestcbCustomerLocalName, // cbCustomer (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ReceiptRequest, cbCustomer), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for cbCustomer { // field description for cbSettlement WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestcbSettlementLocalName, // cbSettlement (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ReceiptRequest, cbSettlement), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for cbSettlement { // field description for cbPreviousReceiptReference WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestcbPreviousReceiptReferenceLocalName, // cbPreviousReceiptReference (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ReceiptRequest, cbPreviousReceiptReference), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for cbPreviousReceiptReference { // fields description for ReceiptRequest (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.ftCashBoxID, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.ftQueueID, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.ftPosSystemId, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.cbTerminalID, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.cbReceiptReference, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.cbReceiptMoment, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.cbChargeItems, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.cbPayItems, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.ftReceiptCase, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.ftReceiptCaseData, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.cbReceiptAmount, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.cbUser, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.cbArea, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.cbCustomer, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.cbSettlement, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.cbPreviousReceiptReference, }, }, // ReceiptRequest { // ArrayOfChargeItem { // field description for ChargeItem WS_REPEATING_ELEMENT_FIELD_MAPPING, 0, 0, WS_STRUCT_TYPE, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalTypes.ChargeItem, WsOffsetOf(ArrayOfChargeItem, ChargeItem), WS_FIELD_POINTER| WS_FIELD_NILLABLE_ITEM, 0, WsOffsetOf(ArrayOfChargeItem, ChargeItemCount), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemTypeName, // ChargeItem (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 0, }, // end of field description for ChargeItem { // fields description for ArrayOfChargeItem (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ArrayOfChargeItemdescs.ChargeItem, }, }, // ArrayOfChargeItem { // ArrayOfPayItem { // field description for PayItem WS_REPEATING_ELEMENT_FIELD_MAPPING, 0, 0, WS_STRUCT_TYPE, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalTypes.PayItem, WsOffsetOf(ArrayOfPayItem, PayItem), WS_FIELD_POINTER| WS_FIELD_NILLABLE_ITEM, 0, WsOffsetOf(ArrayOfPayItem, PayItemCount), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.PayItemTypeName, // PayItem (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 0, }, // end of field description for PayItem { // fields description for ArrayOfPayItem (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ArrayOfPayItemdescs.PayItem, }, }, // ArrayOfPayItem { // ReceiptResponse { // field description for ftCashBoxID WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestftCashBoxIDLocalName, // ftCashBoxID (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ReceiptResponse, ftCashBoxID), WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for ftCashBoxID { // field description for ftQueueID WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestftQueueIDLocalName, // ftQueueID (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ReceiptResponse, ftQueueID), WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for ftQueueID { // field description for ftQueueItemID WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseftQueueItemIDLocalName, // ftQueueItemID (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ReceiptResponse, ftQueueItemID), WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for ftQueueItemID { // field description for ftQueueRow WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseftQueueRowLocalName, // ftQueueRow (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_INT64_TYPE, 0, WsOffsetOf(ReceiptResponse, ftQueueRow), 0, 0, 0xffffffff }, // end of field description for ftQueueRow { // field description for cbTerminalID WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestcbTerminalIDLocalName, // cbTerminalID (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ReceiptResponse, cbTerminalID), WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for cbTerminalID { // field description for cbReceiptReference WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestcbReceiptReferenceLocalName, // cbReceiptReference (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ReceiptResponse, cbReceiptReference), WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for cbReceiptReference { // field description for ftCashBoxIdentification WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseftCashBoxIdentificationLocalName, // ftCashBoxIdentification (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ReceiptResponse, ftCashBoxIdentification), WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for ftCashBoxIdentification { // field description for ftReceiptIdentification WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseftReceiptIdentificationLocalName, // ftReceiptIdentification (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ReceiptResponse, ftReceiptIdentification), WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for ftReceiptIdentification { // field description for ftReceiptMoment WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseftReceiptMomentLocalName, // ftReceiptMoment (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_DATETIME_TYPE, 0, WsOffsetOf(ReceiptResponse, ftReceiptMoment), 0, 0, 0xffffffff }, // end of field description for ftReceiptMoment { // field description for ftReceiptHeader WS_REPEATING_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseftReceiptHeaderWrapperName, // ftReceiptHeader (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ReceiptResponse, ftReceiptHeader), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE| WS_FIELD_NILLABLE_ITEM, 0, WsOffsetOf(ReceiptResponse, ftReceiptHeaderCount), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseftReceiptHeaderLocalName, // string (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseftReceiptHeaderNamespace, // http://schemas.microsoft.com/2003/10/Serialization/Arrays 0, }, // end of field description for ftReceiptHeader { // field description for ftChargeItems WS_REPEATING_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseftChargeItemsWrapperName, // ftChargeItems (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_STRUCT_TYPE, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalTypes.ChargeItem, WsOffsetOf(ReceiptResponse, ftChargeItems), WS_FIELD_POINTER| WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE| WS_FIELD_NILLABLE_ITEM, 0, WsOffsetOf(ReceiptResponse, ftChargeItemsCount), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemTypeName, // ChargeItem (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 0, }, // end of field description for ftChargeItems { // field description for ftChargeLines WS_REPEATING_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseftChargeLinesWrapperName, // ftChargeLines (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ReceiptResponse, ftChargeLines), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE| WS_FIELD_NILLABLE_ITEM, 0, WsOffsetOf(ReceiptResponse, ftChargeLinesCount), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseftReceiptHeaderLocalName, // string (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseftReceiptHeaderNamespace, // http://schemas.microsoft.com/2003/10/Serialization/Arrays 0, }, // end of field description for ftChargeLines { // field description for ftPayItems WS_REPEATING_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseftPayItemsWrapperName, // ftPayItems (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_STRUCT_TYPE, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalTypes.PayItem, WsOffsetOf(ReceiptResponse, ftPayItems), WS_FIELD_POINTER| WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE| WS_FIELD_NILLABLE_ITEM, 0, WsOffsetOf(ReceiptResponse, ftPayItemsCount), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.PayItemTypeName, // PayItem (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 0, }, // end of field description for ftPayItems { // field description for ftPayLines WS_REPEATING_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseftPayLinesWrapperName, // ftPayLines (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ReceiptResponse, ftPayLines), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE| WS_FIELD_NILLABLE_ITEM, 0, WsOffsetOf(ReceiptResponse, ftPayLinesCount), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseftReceiptHeaderLocalName, // string (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseftReceiptHeaderNamespace, // http://schemas.microsoft.com/2003/10/Serialization/Arrays 0, }, // end of field description for ftPayLines { // SignaturItem { // field description for ftSignatureFormat WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.SignaturItemftSignatureFormatLocalName, // ftSignatureFormat (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_INT64_TYPE, 0, WsOffsetOf(SignaturItem, ftSignatureFormat), 0, 0, 0xffffffff }, // end of field description for ftSignatureFormat { // field description for ftSignatureType WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.SignaturItemftSignatureTypeLocalName, // ftSignatureType (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_INT64_TYPE, 0, WsOffsetOf(SignaturItem, ftSignatureType), 0, 0, 0xffffffff }, // end of field description for ftSignatureType { // field description for Caption WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.SignaturItemCaptionLocalName, // Caption (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(SignaturItem, Caption), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for Caption { // field description for Data WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.SignaturItemDataLocalName, // Data (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(SignaturItem, Data), WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for Data { // fields description for SignaturItem (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptResponsedescs.SignaturItemdescs.ftSignatureFormat, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptResponsedescs.SignaturItemdescs.ftSignatureType, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptResponsedescs.SignaturItemdescs.Caption, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptResponsedescs.SignaturItemdescs.Data, }, }, // SignaturItem { // field description for ftSignatures WS_REPEATING_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseftSignaturesWrapperName, // ftSignatures (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_STRUCT_TYPE, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalTypes.SignaturItem, WsOffsetOf(ReceiptResponse, ftSignatures), WS_FIELD_POINTER| WS_FIELD_NILLABLE| WS_FIELD_NILLABLE_ITEM, 0, WsOffsetOf(ReceiptResponse, ftSignaturesCount), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.SignaturItemTypeName, // SignaturItem (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 0, }, // end of field description for ftSignatures { // field description for ftReceiptFooter WS_REPEATING_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseftReceiptFooterWrapperName, // ftReceiptFooter (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ReceiptResponse, ftReceiptFooter), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE| WS_FIELD_NILLABLE_ITEM, 0, WsOffsetOf(ReceiptResponse, ftReceiptFooterCount), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseftReceiptHeaderLocalName, // string (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseftReceiptHeaderNamespace, // http://schemas.microsoft.com/2003/10/Serialization/Arrays 0, }, // end of field description for ftReceiptFooter { // field description for ftState WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseftStateLocalName, // ftState (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_INT64_TYPE, 0, WsOffsetOf(ReceiptResponse, ftState), 0, 0, 0xffffffff }, // end of field description for ftState { // field description for ftStateData WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseftStateDataLocalName, // ftStateData (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_WSZ_TYPE, 0, WsOffsetOf(ReceiptResponse, ftStateData), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for ftStateData { // fields description for ReceiptResponse (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptResponsedescs.ftCashBoxID, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptResponsedescs.ftQueueID, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptResponsedescs.ftQueueItemID, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptResponsedescs.ftQueueRow, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptResponsedescs.cbTerminalID, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptResponsedescs.cbReceiptReference, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptResponsedescs.ftCashBoxIdentification, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptResponsedescs.ftReceiptIdentification, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptResponsedescs.ftReceiptMoment, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptResponsedescs.ftReceiptHeader, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptResponsedescs.ftChargeItems, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptResponsedescs.ftChargeLines, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptResponsedescs.ftPayItems, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptResponsedescs.ftPayLines, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptResponsedescs.ftSignatures, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptResponsedescs.ftReceiptFooter, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptResponsedescs.ftState, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptResponsedescs.ftStateData, }, }, // ReceiptResponse { // ArrayOfSignaturItem { // field description for SignaturItem WS_REPEATING_ELEMENT_FIELD_MAPPING, 0, 0, WS_STRUCT_TYPE, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalTypes.SignaturItem, WsOffsetOf(ArrayOfSignaturItem, SignaturItem), WS_FIELD_POINTER| WS_FIELD_NILLABLE_ITEM, 0, WsOffsetOf(ArrayOfSignaturItem, SignaturItemCount), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.SignaturItemTypeName, // SignaturItem (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 0, }, // end of field description for SignaturItem { // fields description for ArrayOfSignaturItem (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ArrayOfSignaturItemdescs.SignaturItem, }, }, // ArrayOfSignaturItem { // ArrayOfstring { // field description for String WS_REPEATING_ELEMENT_FIELD_MAPPING, 0, 0, WS_WSZ_TYPE, 0, WsOffsetOf(ArrayOfstring, String), WS_FIELD_NILLABLE_ITEM, 0, WsOffsetOf(ArrayOfstring, StringCount), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseftReceiptHeaderLocalName, // string (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseftReceiptHeaderNamespace, // http://schemas.microsoft.com/2003/10/Serialization/Arrays 0, }, // end of field description for String { // fields description for ArrayOfstring (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ArrayOfstringdescs.String, }, }, // ArrayOfstring }, // end of global types { // global elements 0, { // _Sign { // field description for data WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._SigndataLocalName, // data (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._SignTypeNamespace, // http://tempuri.org/ WS_STRUCT_TYPE, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalTypes.ReceiptRequest, WsOffsetOf(_Sign, data), WS_FIELD_POINTER| WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for data { // fields description for _Sign (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalElements._Signdescs.data, }, }, // _Sign { // _SignResponse { // field description for SignResult WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._SignResponseSignResultLocalName, // SignResult (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._SignTypeNamespace, // http://tempuri.org/ WS_STRUCT_TYPE, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalTypes.ReceiptResponse, WsOffsetOf(_SignResponse, SignResult), WS_FIELD_POINTER| WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for SignResult { // fields description for _SignResponse (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalElements._SignResponsedescs.SignResult, }, }, // _SignResponse { // _Journal { // field description for ftJournalType WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._JournalftJournalTypeLocalName, // ftJournalType (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._SignTypeNamespace, // http://tempuri.org/ WS_INT64_TYPE, 0, WsOffsetOf(_Journal, ftJournalType), WS_FIELD_OPTIONAL, 0, 0xffffffff }, // end of field description for ftJournalType { // field description for from WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._JournalfromLocalName, // from (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._SignTypeNamespace, // http://tempuri.org/ WS_INT64_TYPE, 0, WsOffsetOf(_Journal, from), WS_FIELD_OPTIONAL, 0, 0xffffffff }, // end of field description for from { // field description for to WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._JournaltoLocalName, // to (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._SignTypeNamespace, // http://tempuri.org/ WS_INT64_TYPE, 0, WsOffsetOf(_Journal, to), WS_FIELD_OPTIONAL, 0, 0xffffffff }, // end of field description for to { // fields description for _Journal (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalElements._Journaldescs.ftJournalType, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalElements._Journaldescs.from, (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalElements._Journaldescs.to, }, }, // _Journal { // _JournalResponse { // field description for JournalResult WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._JournalResponseJournalResultLocalName, // JournalResult (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._SignTypeNamespace, // http://tempuri.org/ WS_BYTES_TYPE, 0, WsOffsetOf(_JournalResponse, JournalResult), 0, 0, 0xffffffff }, // end of field description for JournalResult { // fields description for _JournalResponse (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalElements._JournalResponsedescs.JournalResult, }, }, // _JournalResponse { // _Echo { // field description for message WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._EchomessageLocalName, // message (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._SignTypeNamespace, // http://tempuri.org/ WS_WSZ_TYPE, 0, WsOffsetOf(_Echo, message), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for message { // fields description for _Echo (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalElements._Echodescs.message, }, }, // _Echo { // _EchoResponse { // field description for EchoResult WS_ELEMENT_FIELD_MAPPING, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._EchoResponseEchoResultLocalName, // EchoResult (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._SignTypeNamespace, // http://tempuri.org/ WS_WSZ_TYPE, 0, WsOffsetOf(_EchoResponse, EchoResult), WS_FIELD_OPTIONAL| WS_FIELD_NILLABLE, 0, 0xffffffff }, // end of field description for EchoResult { // fields description for _EchoResponse (WS_FIELD_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalElements._EchoResponsedescs.EchoResult, }, }, // _EchoResponse }, // end of global elements { // messages { // message description for IPOS_Sign_InputMessage (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.IPOS_Sign_InputMessageactionName, // http://tempuri.org/IPOS/Sign (WS_ELEMENT_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalElements.Sign, }, // message description for IPOS_Sign_InputMessage { // message description for IPOS_Sign_OutputMessage (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.IPOS_Sign_OutputMessageactionName, // http://tempuri.org/IPOS/SignResponse (WS_ELEMENT_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalElements.SignResponse, }, // message description for IPOS_Sign_OutputMessage { // message description for IPOS_Journal_InputMessage (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.IPOS_Journal_InputMessageactionName, // http://tempuri.org/IPOS/Journal (WS_ELEMENT_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalElements.Journal, }, // message description for IPOS_Journal_InputMessage { // message description for IPOS_Journal_OutputMessage (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.IPOS_Journal_OutputMessageactionName, // http://tempuri.org/IPOS/JournalResponse (WS_ELEMENT_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalElements.JournalResponse, }, // message description for IPOS_Journal_OutputMessage { // message description for IPOS_Echo_InputMessage (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.IPOS_Echo_InputMessageactionName, // http://tempuri.org/IPOS/Echo (WS_ELEMENT_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalElements.Echo, }, // message description for IPOS_Echo_InputMessage { // message description for IPOS_Echo_OutputMessage (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.IPOS_Echo_OutputMessageactionName, // http://tempuri.org/IPOS/EchoResponse (WS_ELEMENT_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalElements.EchoResponse, }, // message description for IPOS_Echo_OutputMessage }, // end of messages { // contracts { // BasicHttpBinding_IPOS, { // BasicHttpBinding_IPOS_Sign { // parameter descriptions for BasicHttpBinding_IPOS_Sign {WS_PARAMETER_TYPE_NORMAL, (USHORT)0, (USHORT)-1}, {WS_PARAMETER_TYPE_NORMAL, (USHORT)-1, (USHORT)0}, }, // parameter descriptions for BasicHttpBinding_IPOS_Sign { // operation description for BasicHttpBinding_IPOS_Sign 1, (WS_MESSAGE_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.messages.IPOS_Sign_InputMessage, (WS_MESSAGE_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.messages.IPOS_Sign_OutputMessage, 0, 0, 2, (WS_PARAMETER_DESCRIPTION*)fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.contracts.BasicHttpBinding_IPOS.BasicHttpBinding_IPOS_Sign.params, BasicHttpBinding_IPOS_SignOperationStub, WS_NON_RPC_LITERAL_OPERATION }, //operation description for BasicHttpBinding_IPOS_Sign }, // BasicHttpBinding_IPOS_Sign { // BasicHttpBinding_IPOS_Journal { // parameter descriptions for BasicHttpBinding_IPOS_Journal {WS_PARAMETER_TYPE_NORMAL, (USHORT)0, (USHORT)-1}, {WS_PARAMETER_TYPE_NORMAL, (USHORT)1, (USHORT)-1}, {WS_PARAMETER_TYPE_NORMAL, (USHORT)2, (USHORT)-1}, {WS_PARAMETER_TYPE_NORMAL, (USHORT)-1, (USHORT)0}, }, // parameter descriptions for BasicHttpBinding_IPOS_Journal { // operation description for BasicHttpBinding_IPOS_Journal 1, (WS_MESSAGE_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.messages.IPOS_Journal_InputMessage, (WS_MESSAGE_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.messages.IPOS_Journal_OutputMessage, 0, 0, 4, (WS_PARAMETER_DESCRIPTION*)fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.contracts.BasicHttpBinding_IPOS.BasicHttpBinding_IPOS_Journal.params, BasicHttpBinding_IPOS_JournalOperationStub, WS_NON_RPC_LITERAL_OPERATION }, //operation description for BasicHttpBinding_IPOS_Journal }, // BasicHttpBinding_IPOS_Journal { // BasicHttpBinding_IPOS_Echo { // parameter descriptions for BasicHttpBinding_IPOS_Echo {WS_PARAMETER_TYPE_NORMAL, (USHORT)0, (USHORT)-1}, {WS_PARAMETER_TYPE_NORMAL, (USHORT)-1, (USHORT)0}, }, // parameter descriptions for BasicHttpBinding_IPOS_Echo { // operation description for BasicHttpBinding_IPOS_Echo 1, (WS_MESSAGE_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.messages.IPOS_Echo_InputMessage, (WS_MESSAGE_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.messages.IPOS_Echo_OutputMessage, 0, 0, 2, (WS_PARAMETER_DESCRIPTION*)fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.contracts.BasicHttpBinding_IPOS.BasicHttpBinding_IPOS_Echo.params, BasicHttpBinding_IPOS_EchoOperationStub, WS_NON_RPC_LITERAL_OPERATION }, //operation description for BasicHttpBinding_IPOS_Echo }, // BasicHttpBinding_IPOS_Echo { // array of operations for BasicHttpBinding_IPOS (WS_OPERATION_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.contracts.BasicHttpBinding_IPOS.BasicHttpBinding_IPOS_Sign.BasicHttpBinding_IPOS_Sign, (WS_OPERATION_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.contracts.BasicHttpBinding_IPOS.BasicHttpBinding_IPOS_Journal.BasicHttpBinding_IPOS_Journal, (WS_OPERATION_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.contracts.BasicHttpBinding_IPOS.BasicHttpBinding_IPOS_Echo.BasicHttpBinding_IPOS_Echo, }, // array of operations for BasicHttpBinding_IPOS { // contract description for BasicHttpBinding_IPOS 3, (WS_OPERATION_DESCRIPTION**)fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.contracts.BasicHttpBinding_IPOS.operations, }, // end of contract description for BasicHttpBinding_IPOS }, // BasicHttpBinding_IPOS }, // end of contracts { // policies { WS_ENCODING_XML_UTF8, WS_ADDRESSING_VERSION_TRANSPORT, WS_ENVELOPE_VERSION_SOAP_1_1, { // channelPropertiesArray { WS_CHANNEL_PROPERTY_ENCODING, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.policies.BasicHttpBinding_IPOS.encoding, sizeof(fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.policies.BasicHttpBinding_IPOS.encoding), }, { WS_CHANNEL_PROPERTY_ADDRESSING_VERSION, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.policies.BasicHttpBinding_IPOS.addressingVersion, sizeof(fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.policies.BasicHttpBinding_IPOS.addressingVersion), }, { WS_CHANNEL_PROPERTY_ENVELOPE_VERSION, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.policies.BasicHttpBinding_IPOS.envelopeVersion, sizeof(fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.policies.BasicHttpBinding_IPOS.envelopeVersion), }, }, }, // end of BasicHttpBinding_IPOS, }, // policies { // dictionary { // xmlStrings WS_XML_STRING_DICTIONARY_VALUE("FactoryType",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 0), WS_XML_STRING_DICTIONARY_VALUE("http://schemas.microsoft.com/2003/10/Serialization/",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 1), WS_XML_STRING_DICTIONARY_VALUE("Id",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 2), WS_XML_STRING_DICTIONARY_VALUE("Ref",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 3), WS_XML_STRING_DICTIONARY_VALUE("ReceiptRequest",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 4), WS_XML_STRING_DICTIONARY_VALUE("http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 5), WS_XML_STRING_DICTIONARY_VALUE("ftCashBoxID",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 6), WS_XML_STRING_DICTIONARY_VALUE("ftQueueID",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 7), WS_XML_STRING_DICTIONARY_VALUE("ftPosSystemId",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 8), WS_XML_STRING_DICTIONARY_VALUE("cbTerminalID",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 9), WS_XML_STRING_DICTIONARY_VALUE("cbReceiptReference",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 10), WS_XML_STRING_DICTIONARY_VALUE("cbReceiptMoment",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 11), WS_XML_STRING_DICTIONARY_VALUE("ChargeItem",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 12), WS_XML_STRING_DICTIONARY_VALUE("Position",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 13), WS_XML_STRING_DICTIONARY_VALUE("Quantity",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 14), WS_XML_STRING_DICTIONARY_VALUE("Description",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 15), WS_XML_STRING_DICTIONARY_VALUE("Amount",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 16), WS_XML_STRING_DICTIONARY_VALUE("VATRate",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 17), WS_XML_STRING_DICTIONARY_VALUE("ftChargeItemCase",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 18), WS_XML_STRING_DICTIONARY_VALUE("ftChargeItemCaseData",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 19), WS_XML_STRING_DICTIONARY_VALUE("VATAmount",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 20), WS_XML_STRING_DICTIONARY_VALUE("AccountNumber",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 21), WS_XML_STRING_DICTIONARY_VALUE("CostCenter",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 22), WS_XML_STRING_DICTIONARY_VALUE("ProductGroup",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 23), WS_XML_STRING_DICTIONARY_VALUE("ProductNumber",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 24), WS_XML_STRING_DICTIONARY_VALUE("ProductBarcode",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 25), WS_XML_STRING_DICTIONARY_VALUE("Unit",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 26), WS_XML_STRING_DICTIONARY_VALUE("UnitQuantity",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 27), WS_XML_STRING_DICTIONARY_VALUE("UnitPrice",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 28), WS_XML_STRING_DICTIONARY_VALUE("Moment",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 29), WS_XML_STRING_DICTIONARY_VALUE("cbChargeItems",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 30), WS_XML_STRING_DICTIONARY_VALUE("PayItem",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 31), WS_XML_STRING_DICTIONARY_VALUE("ftPayItemCase",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 32), WS_XML_STRING_DICTIONARY_VALUE("ftPayItemCaseData",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 33), WS_XML_STRING_DICTIONARY_VALUE("MoneyGroup",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 34), WS_XML_STRING_DICTIONARY_VALUE("MoneyNumber",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 35), WS_XML_STRING_DICTIONARY_VALUE("cbPayItems",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 36), WS_XML_STRING_DICTIONARY_VALUE("ftReceiptCase",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 37), WS_XML_STRING_DICTIONARY_VALUE("ftReceiptCaseData",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 38), WS_XML_STRING_DICTIONARY_VALUE("cbReceiptAmount",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 39), WS_XML_STRING_DICTIONARY_VALUE("cbUser",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 40), WS_XML_STRING_DICTIONARY_VALUE("cbArea",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 41), WS_XML_STRING_DICTIONARY_VALUE("cbCustomer",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 42), WS_XML_STRING_DICTIONARY_VALUE("cbSettlement",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 43), WS_XML_STRING_DICTIONARY_VALUE("cbPreviousReceiptReference",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 44), WS_XML_STRING_DICTIONARY_VALUE("ArrayOfChargeItem",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 45), WS_XML_STRING_DICTIONARY_VALUE("ArrayOfPayItem",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 46), WS_XML_STRING_DICTIONARY_VALUE("ReceiptResponse",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 47), WS_XML_STRING_DICTIONARY_VALUE("ftQueueItemID",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 48), WS_XML_STRING_DICTIONARY_VALUE("ftQueueRow",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 49), WS_XML_STRING_DICTIONARY_VALUE("ftCashBoxIdentification",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 50), WS_XML_STRING_DICTIONARY_VALUE("ftReceiptIdentification",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 51), WS_XML_STRING_DICTIONARY_VALUE("ftReceiptMoment",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 52), WS_XML_STRING_DICTIONARY_VALUE("string",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 53), WS_XML_STRING_DICTIONARY_VALUE("http://schemas.microsoft.com/2003/10/Serialization/Arrays",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 54), WS_XML_STRING_DICTIONARY_VALUE("ftReceiptHeader",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 55), WS_XML_STRING_DICTIONARY_VALUE("ftChargeItems",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 56), WS_XML_STRING_DICTIONARY_VALUE("ftChargeLines",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 57), WS_XML_STRING_DICTIONARY_VALUE("ftPayItems",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 58), WS_XML_STRING_DICTIONARY_VALUE("ftPayLines",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 59), WS_XML_STRING_DICTIONARY_VALUE("SignaturItem",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 60), WS_XML_STRING_DICTIONARY_VALUE("ftSignatureFormat",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 61), WS_XML_STRING_DICTIONARY_VALUE("ftSignatureType",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 62), WS_XML_STRING_DICTIONARY_VALUE("Caption",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 63), WS_XML_STRING_DICTIONARY_VALUE("Data",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 64), WS_XML_STRING_DICTIONARY_VALUE("ftSignatures",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 65), WS_XML_STRING_DICTIONARY_VALUE("ftReceiptFooter",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 66), WS_XML_STRING_DICTIONARY_VALUE("ftState",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 67), WS_XML_STRING_DICTIONARY_VALUE("ftStateData",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 68), WS_XML_STRING_DICTIONARY_VALUE("ArrayOfSignaturItem",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 69), WS_XML_STRING_DICTIONARY_VALUE("ArrayOfstring",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 70), WS_XML_STRING_DICTIONARY_VALUE("Sign",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 71), WS_XML_STRING_DICTIONARY_VALUE("http://tempuri.org/",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 72), WS_XML_STRING_DICTIONARY_VALUE("data",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 73), WS_XML_STRING_DICTIONARY_VALUE("SignResponse",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 74), WS_XML_STRING_DICTIONARY_VALUE("SignResult",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 75), WS_XML_STRING_DICTIONARY_VALUE("Journal",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 76), WS_XML_STRING_DICTIONARY_VALUE("ftJournalType",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 77), WS_XML_STRING_DICTIONARY_VALUE("from",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 78), WS_XML_STRING_DICTIONARY_VALUE("to",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 79), WS_XML_STRING_DICTIONARY_VALUE("JournalResponse",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 80), WS_XML_STRING_DICTIONARY_VALUE("JournalResult",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 81), WS_XML_STRING_DICTIONARY_VALUE("Echo",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 82), WS_XML_STRING_DICTIONARY_VALUE("message",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 83), WS_XML_STRING_DICTIONARY_VALUE("EchoResponse",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 84), WS_XML_STRING_DICTIONARY_VALUE("EchoResult",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 85), WS_XML_STRING_DICTIONARY_VALUE("anyType",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 86), WS_XML_STRING_DICTIONARY_VALUE("anyURI",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 87), WS_XML_STRING_DICTIONARY_VALUE("base64Binary",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 88), WS_XML_STRING_DICTIONARY_VALUE("boolean",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 89), WS_XML_STRING_DICTIONARY_VALUE("byte",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 90), WS_XML_STRING_DICTIONARY_VALUE("dateTime",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 91), WS_XML_STRING_DICTIONARY_VALUE("decimal",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 92), WS_XML_STRING_DICTIONARY_VALUE("double",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 93), WS_XML_STRING_DICTIONARY_VALUE("float",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 94), WS_XML_STRING_DICTIONARY_VALUE("int",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 95), WS_XML_STRING_DICTIONARY_VALUE("long",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 96), WS_XML_STRING_DICTIONARY_VALUE("QName",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 97), WS_XML_STRING_DICTIONARY_VALUE("short",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 98), WS_XML_STRING_DICTIONARY_VALUE("unsignedByte",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 99), WS_XML_STRING_DICTIONARY_VALUE("unsignedInt",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 100), WS_XML_STRING_DICTIONARY_VALUE("unsignedLong",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 101), WS_XML_STRING_DICTIONARY_VALUE("unsignedShort",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 102), WS_XML_STRING_DICTIONARY_VALUE("char",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 103), WS_XML_STRING_DICTIONARY_VALUE("duration",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 104), WS_XML_STRING_DICTIONARY_VALUE("guid",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 105), WS_XML_STRING_DICTIONARY_VALUE("http://tempuri.org/IPOS/Sign",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 106), WS_XML_STRING_DICTIONARY_VALUE("http://tempuri.org/IPOS/SignResponse",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 107), WS_XML_STRING_DICTIONARY_VALUE("http://tempuri.org/IPOS/Journal",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 108), WS_XML_STRING_DICTIONARY_VALUE("http://tempuri.org/IPOS/JournalResponse",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 109), WS_XML_STRING_DICTIONARY_VALUE("http://tempuri.org/IPOS/Echo",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 110), WS_XML_STRING_DICTIONARY_VALUE("http://tempuri.org/IPOS/EchoResponse",&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.dict, 111), }, // end of xmlStrings { // fiskaltrust_interface_1_0_16298_1022_rc_wsdldictionary // 01866e95-f3aa-44a3-a639-e5f6595ee2ae { 0x01866e95, 0xf3aa, 0x44a3, { 0xa6, 0x39, 0xe5,0xf6, 0x59, 0x5e, 0xe2, 0xae } }, (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings, 112, TRUE, }, }, // end of dictionary }; // end of fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions // Disable prefast warnings for the output parameters as their contract cannot be expressed in SAL. #if (_MSC_VER >= 1400) #pragma warning(push) #endif #pragma warning(disable: 6101 6054) // operation: BasicHttpBinding_IPOS_Sign HRESULT WINAPI BasicHttpBinding_IPOS_Sign( _In_ WS_SERVICE_PROXY* _serviceProxy, _In_opt_ ReceiptRequest* data, _Outptr_opt_ ReceiptResponse** SignResult, _In_ WS_HEAP* _heap, _In_reads_opt_(_callPropertyCount) const WS_CALL_PROPERTY* _callProperties, _In_ const ULONG _callPropertyCount, _In_opt_ const WS_ASYNC_CONTEXT* _asyncContext, _In_opt_ WS_ERROR* _error) { void* _argList[2]; _argList[0] = &data; _argList[1] = &SignResult; return WsCall(_serviceProxy, (WS_OPERATION_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.contracts.BasicHttpBinding_IPOS.BasicHttpBinding_IPOS_Sign.BasicHttpBinding_IPOS_Sign, (const void **)&_argList, _heap, _callProperties, _callPropertyCount, _asyncContext, _error); } // operation: BasicHttpBinding_IPOS_Journal HRESULT WINAPI BasicHttpBinding_IPOS_Journal( _In_ WS_SERVICE_PROXY* _serviceProxy, _In_ __int64 ftJournalType, _In_ __int64 from, _In_ __int64 to, _Out_ WS_BYTES* JournalResult, _In_ WS_HEAP* _heap, _In_reads_opt_(_callPropertyCount) const WS_CALL_PROPERTY* _callProperties, _In_ const ULONG _callPropertyCount, _In_opt_ const WS_ASYNC_CONTEXT* _asyncContext, _In_opt_ WS_ERROR* _error) { void* _argList[4]; _argList[0] = &ftJournalType; _argList[1] = &from; _argList[2] = &to; _argList[3] = &JournalResult; return WsCall(_serviceProxy, (WS_OPERATION_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.contracts.BasicHttpBinding_IPOS.BasicHttpBinding_IPOS_Journal.BasicHttpBinding_IPOS_Journal, (const void **)&_argList, _heap, _callProperties, _callPropertyCount, _asyncContext, _error); } // operation: BasicHttpBinding_IPOS_Echo HRESULT WINAPI BasicHttpBinding_IPOS_Echo( _In_ WS_SERVICE_PROXY* _serviceProxy, _In_opt_z_ WCHAR* message, _Outptr_opt_result_z_ WCHAR** EchoResult, _In_ WS_HEAP* _heap, _In_reads_opt_(_callPropertyCount) const WS_CALL_PROPERTY* _callProperties, _In_ const ULONG _callPropertyCount, _In_opt_ const WS_ASYNC_CONTEXT* _asyncContext, _In_opt_ WS_ERROR* _error) { void* _argList[2]; _argList[0] = &message; _argList[1] = &EchoResult; return WsCall(_serviceProxy, (WS_OPERATION_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.contracts.BasicHttpBinding_IPOS.BasicHttpBinding_IPOS_Echo.BasicHttpBinding_IPOS_Echo, (const void **)&_argList, _heap, _callProperties, _callPropertyCount, _asyncContext, _error); } #if (_MSC_VER >= 1400) #pragma warning(pop) #endif const _fiskaltrust_interface_1_0_16298_1022_rc_wsdl fiskaltrust_interface_1_0_16298_1022_rc_wsdl = { { // globalAttributes { // FactoryType (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.FactoryTypeTypeName, // FactoryType (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.FactoryTypeTypeNamespace, // http://schemas.microsoft.com/2003/10/Serialization/ WS_XML_QNAME_TYPE, }, // end of FactoryType { // Id (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.IdTypeName, // Id (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.FactoryTypeTypeNamespace, // http://schemas.microsoft.com/2003/10/Serialization/ WS_WSZ_TYPE, }, // end of Id { // Ref (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.RefTypeName, // Ref (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.FactoryTypeTypeNamespace, // http://schemas.microsoft.com/2003/10/Serialization/ WS_WSZ_TYPE, }, // end of Ref }, // globalAttributes { // globalTypes { sizeof(ReceiptRequest), __alignof(ReceiptRequest), (WS_FIELD_DESCRIPTION**)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.ReceiptRequestFields, WsCountOf(fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.ReceiptRequestFields), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeName, // ReceiptRequest (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 0, 0, 0, }, // end of struct description for ReceiptRequest { sizeof(ArrayOfChargeItem), __alignof(ArrayOfChargeItem), (WS_FIELD_DESCRIPTION**)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ArrayOfChargeItemdescs.ArrayOfChargeItemFields, WsCountOf(fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ArrayOfChargeItemdescs.ArrayOfChargeItemFields), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ArrayOfChargeItemTypeName, // ArrayOfChargeItem (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 0, 0, 0, }, // end of struct description for ArrayOfChargeItem { sizeof(ChargeItem), __alignof(ChargeItem), (WS_FIELD_DESCRIPTION**)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.ChargeItemdescs.ChargeItemFields, WsCountOf(fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.ChargeItemdescs.ChargeItemFields), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemTypeName, // ChargeItem (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 0, 0, 0, }, // end of struct description for ChargeItem { sizeof(ArrayOfPayItem), __alignof(ArrayOfPayItem), (WS_FIELD_DESCRIPTION**)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ArrayOfPayItemdescs.ArrayOfPayItemFields, WsCountOf(fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ArrayOfPayItemdescs.ArrayOfPayItemFields), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ArrayOfPayItemTypeName, // ArrayOfPayItem (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 0, 0, 0, }, // end of struct description for ArrayOfPayItem { sizeof(PayItem), __alignof(PayItem), (WS_FIELD_DESCRIPTION**)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.PayItemdescs.PayItemFields, WsCountOf(fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptRequestdescs.PayItemdescs.PayItemFields), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.PayItemTypeName, // PayItem (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 0, 0, 0, }, // end of struct description for PayItem { sizeof(ReceiptResponse), __alignof(ReceiptResponse), (WS_FIELD_DESCRIPTION**)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptResponsedescs.ReceiptResponseFields, WsCountOf(fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptResponsedescs.ReceiptResponseFields), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseTypeName, // ReceiptResponse (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 0, 0, 0, }, // end of struct description for ReceiptResponse { sizeof(ArrayOfSignaturItem), __alignof(ArrayOfSignaturItem), (WS_FIELD_DESCRIPTION**)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ArrayOfSignaturItemdescs.ArrayOfSignaturItemFields, WsCountOf(fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ArrayOfSignaturItemdescs.ArrayOfSignaturItemFields), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ArrayOfSignaturItemTypeName, // ArrayOfSignaturItem (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 0, 0, 0, }, // end of struct description for ArrayOfSignaturItem { sizeof(SignaturItem), __alignof(SignaturItem), (WS_FIELD_DESCRIPTION**)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptResponsedescs.SignaturItemdescs.SignaturItemFields, WsCountOf(fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ReceiptResponsedescs.SignaturItemdescs.SignaturItemFields), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.SignaturItemTypeName, // SignaturItem (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 0, 0, 0, }, // end of struct description for SignaturItem { sizeof(ArrayOfstring), __alignof(ArrayOfstring), (WS_FIELD_DESCRIPTION**)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ArrayOfstringdescs.ArrayOfstringFields, WsCountOf(fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalTypes.ArrayOfstringdescs.ArrayOfstringFields), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ArrayOfstringTypeName, // ArrayOfstring (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseftReceiptHeaderNamespace, // http://schemas.microsoft.com/2003/10/Serialization/Arrays 0, 0, 0, }, // end of struct description for ArrayOfstring }, // globalTypes { // globalElements { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._SignTypeName, // Sign (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._SignTypeNamespace, // http://tempuri.org/ WS_STRUCT_TYPE, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.externallyReferencedTypes.Sign, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._SignResponseTypeName, // SignResponse (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._SignTypeNamespace, // http://tempuri.org/ WS_STRUCT_TYPE, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.externallyReferencedTypes.SignResponse, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._JournalTypeName, // Journal (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._SignTypeNamespace, // http://tempuri.org/ WS_STRUCT_TYPE, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.externallyReferencedTypes.Journal, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._JournalResponseTypeName, // JournalResponse (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._SignTypeNamespace, // http://tempuri.org/ WS_STRUCT_TYPE, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.externallyReferencedTypes.JournalResponse, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._EchoTypeName, // Echo (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._SignTypeNamespace, // http://tempuri.org/ WS_STRUCT_TYPE, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.externallyReferencedTypes.Echo, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._EchoResponseTypeName, // EchoResponse (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._SignTypeNamespace, // http://tempuri.org/ WS_STRUCT_TYPE, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.externallyReferencedTypes.EchoResponse, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.anyTypeTypeName, // anyType (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.FactoryTypeTypeNamespace, // http://schemas.microsoft.com/2003/10/Serialization/ WS_XML_BUFFER_TYPE, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.anyURITypeName, // anyURI (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.FactoryTypeTypeNamespace, // http://schemas.microsoft.com/2003/10/Serialization/ WS_WSZ_TYPE, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.base64BinaryTypeName, // base64Binary (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.FactoryTypeTypeNamespace, // http://schemas.microsoft.com/2003/10/Serialization/ WS_BYTES_TYPE, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.BooleanTypeName, // boolean (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.FactoryTypeTypeNamespace, // http://schemas.microsoft.com/2003/10/Serialization/ WS_BOOL_TYPE, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ByteTypeName, // byte (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.FactoryTypeTypeNamespace, // http://schemas.microsoft.com/2003/10/Serialization/ WS_INT8_TYPE, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.dateTimeTypeName, // dateTime (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.FactoryTypeTypeNamespace, // http://schemas.microsoft.com/2003/10/Serialization/ WS_DATETIME_TYPE, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.DecimalTypeName, // decimal (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.FactoryTypeTypeNamespace, // http://schemas.microsoft.com/2003/10/Serialization/ WS_DECIMAL_TYPE, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.DoubleTypeName, // double (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.FactoryTypeTypeNamespace, // http://schemas.microsoft.com/2003/10/Serialization/ WS_DOUBLE_TYPE, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.FloatTypeName, // float (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.FactoryTypeTypeNamespace, // http://schemas.microsoft.com/2003/10/Serialization/ WS_FLOAT_TYPE, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.IntTypeName, // int (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.FactoryTypeTypeNamespace, // http://schemas.microsoft.com/2003/10/Serialization/ WS_INT32_TYPE, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.LongTypeName, // long (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.FactoryTypeTypeNamespace, // http://schemas.microsoft.com/2003/10/Serialization/ WS_INT64_TYPE, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.QNameTypeName, // QName (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.FactoryTypeTypeNamespace, // http://schemas.microsoft.com/2003/10/Serialization/ WS_XML_QNAME_TYPE, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ShortTypeName, // short (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.FactoryTypeTypeNamespace, // http://schemas.microsoft.com/2003/10/Serialization/ WS_INT16_TYPE, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseftReceiptHeaderLocalName, // string (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.FactoryTypeTypeNamespace, // http://schemas.microsoft.com/2003/10/Serialization/ WS_WSZ_TYPE, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.unsignedByteTypeName, // unsignedByte (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.FactoryTypeTypeNamespace, // http://schemas.microsoft.com/2003/10/Serialization/ WS_UINT8_TYPE, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.unsignedIntTypeName, // unsignedInt (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.FactoryTypeTypeNamespace, // http://schemas.microsoft.com/2003/10/Serialization/ WS_UINT32_TYPE, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.unsignedLongTypeName, // unsignedLong (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.FactoryTypeTypeNamespace, // http://schemas.microsoft.com/2003/10/Serialization/ WS_UINT64_TYPE, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.unsignedShortTypeName, // unsignedShort (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.FactoryTypeTypeNamespace, // http://schemas.microsoft.com/2003/10/Serialization/ WS_UINT16_TYPE, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.CharTypeName, // char (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.FactoryTypeTypeNamespace, // http://schemas.microsoft.com/2003/10/Serialization/ WS_INT32_TYPE, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.durationTypeName, // duration (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.FactoryTypeTypeNamespace, // http://schemas.microsoft.com/2003/10/Serialization/ WS_DURATION_TYPE, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.guidTypeName, // guid (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.FactoryTypeTypeNamespace, // http://schemas.microsoft.com/2003/10/Serialization/ WS_GUID_TYPE, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeName, // ReceiptRequest (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_STRUCT_TYPE, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalTypes.ReceiptRequest, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ArrayOfChargeItemTypeName, // ArrayOfChargeItem (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_STRUCT_TYPE, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalTypes.ArrayOfChargeItem, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ChargeItemTypeName, // ChargeItem (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_STRUCT_TYPE, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalTypes.ChargeItem, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ArrayOfPayItemTypeName, // ArrayOfPayItem (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_STRUCT_TYPE, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalTypes.ArrayOfPayItem, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.PayItemTypeName, // PayItem (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_STRUCT_TYPE, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalTypes.PayItem, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseTypeName, // ReceiptResponse (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_STRUCT_TYPE, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalTypes.ReceiptResponse, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ArrayOfSignaturItemTypeName, // ArrayOfSignaturItem (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_STRUCT_TYPE, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalTypes.ArrayOfSignaturItem, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.SignaturItemTypeName, // SignaturItem (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptRequestTypeNamespace, // http://schemas.datacontract.org/2004/07/fiskaltrust.ifPOS.v0 WS_STRUCT_TYPE, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalTypes.SignaturItem, }, { (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ArrayOfstringTypeName, // ArrayOfstring (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.ReceiptResponseftReceiptHeaderNamespace, // http://schemas.microsoft.com/2003/10/Serialization/Arrays WS_STRUCT_TYPE, (void*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalTypes.ArrayOfstring, }, }, // globalElements { // begin of externallyReferencedTypes { sizeof(_Sign), __alignof(_Sign), (WS_FIELD_DESCRIPTION**)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalElements._Signdescs._SignFields, WsCountOf(fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalElements._Signdescs._SignFields), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._SignTypeName, // Sign (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._SignTypeNamespace, // http://tempuri.org/ 0, 0, 0, }, // end of struct description for _Sign { sizeof(_SignResponse), __alignof(_SignResponse), (WS_FIELD_DESCRIPTION**)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalElements._SignResponsedescs._SignResponseFields, WsCountOf(fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalElements._SignResponsedescs._SignResponseFields), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._SignResponseTypeName, // SignResponse (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._SignTypeNamespace, // http://tempuri.org/ 0, 0, 0, }, // end of struct description for _SignResponse { sizeof(_Journal), __alignof(_Journal), (WS_FIELD_DESCRIPTION**)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalElements._Journaldescs._JournalFields, WsCountOf(fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalElements._Journaldescs._JournalFields), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._JournalTypeName, // Journal (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._SignTypeNamespace, // http://tempuri.org/ 0, 0, 0, }, // end of struct description for _Journal { sizeof(_JournalResponse), __alignof(_JournalResponse), (WS_FIELD_DESCRIPTION**)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalElements._JournalResponsedescs._JournalResponseFields, WsCountOf(fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalElements._JournalResponsedescs._JournalResponseFields), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._JournalResponseTypeName, // JournalResponse (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._SignTypeNamespace, // http://tempuri.org/ 0, 0, 0, }, // end of struct description for _JournalResponse { sizeof(_Echo), __alignof(_Echo), (WS_FIELD_DESCRIPTION**)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalElements._Echodescs._EchoFields, WsCountOf(fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalElements._Echodescs._EchoFields), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._EchoTypeName, // Echo (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._SignTypeNamespace, // http://tempuri.org/ 0, 0, 0, }, // end of struct description for _Echo { sizeof(_EchoResponse), __alignof(_EchoResponse), (WS_FIELD_DESCRIPTION**)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalElements._EchoResponsedescs._EchoResponseFields, WsCountOf(fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.globalElements._EchoResponsedescs._EchoResponseFields), (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._EchoResponseTypeName, // EchoResponse (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings._SignTypeNamespace, // http://tempuri.org/ 0, 0, 0, }, // end of struct description for _EchoResponse }, // end of externallyReferencedTypes; { // messages { // message description for IPOS_Sign_InputMessage (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.IPOS_Sign_InputMessageactionName, // http://tempuri.org/IPOS/Sign (WS_ELEMENT_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalElements.Sign, }, // message description for IPOS_Sign_InputMessage { // message description for IPOS_Sign_OutputMessage (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.IPOS_Sign_OutputMessageactionName, // http://tempuri.org/IPOS/SignResponse (WS_ELEMENT_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalElements.SignResponse, }, // message description for IPOS_Sign_OutputMessage { // message description for IPOS_Journal_InputMessage (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.IPOS_Journal_InputMessageactionName, // http://tempuri.org/IPOS/Journal (WS_ELEMENT_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalElements.Journal, }, // message description for IPOS_Journal_InputMessage { // message description for IPOS_Journal_OutputMessage (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.IPOS_Journal_OutputMessageactionName, // http://tempuri.org/IPOS/JournalResponse (WS_ELEMENT_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalElements.JournalResponse, }, // message description for IPOS_Journal_OutputMessage { // message description for IPOS_Echo_InputMessage (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.IPOS_Echo_InputMessageactionName, // http://tempuri.org/IPOS/Echo (WS_ELEMENT_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalElements.Echo, }, // message description for IPOS_Echo_InputMessage { // message description for IPOS_Echo_OutputMessage (WS_XML_STRING*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.dictionary.xmlStrings.IPOS_Echo_OutputMessageactionName, // http://tempuri.org/IPOS/EchoResponse (WS_ELEMENT_DESCRIPTION*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdl.globalElements.EchoResponse, }, // message description for IPOS_Echo_OutputMessage }, // messages { // contracts { // BasicHttpBinding_IPOS 3, (WS_OPERATION_DESCRIPTION**)fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.contracts.BasicHttpBinding_IPOS.operations, }, // end of BasicHttpBinding_IPOS }, // contracts { // policies { // template description for BasicHttpBinding_IPOS { // channel properties (WS_CHANNEL_PROPERTY*)&fiskaltrust_interface_1_0_16298_1022_rc_wsdlLocalDefinitions.policies.BasicHttpBinding_IPOS.channelPropertiesArray, 3, }, }, // end of template description }, // policies }; // end of _fiskaltrust_interface_1_0_16298_1022_rc_wsdl HRESULT BasicHttpBinding_IPOS_CreateServiceProxy( _In_opt_ WS_HTTP_BINDING_TEMPLATE* templateValue, _In_reads_opt_(proxyPropertyCount) const WS_PROXY_PROPERTY* proxyProperties, _In_ const ULONG proxyPropertyCount, _Outptr_ WS_SERVICE_PROXY** _serviceProxy, _In_opt_ WS_ERROR* error) { return WsCreateServiceProxyFromTemplate( WS_CHANNEL_TYPE_REQUEST, proxyProperties, proxyPropertyCount, WS_HTTP_BINDING_TEMPLATE_TYPE, templateValue, templateValue == NULL ? 0 : sizeof(WS_HTTP_BINDING_TEMPLATE), &fiskaltrust_interface_1_0_16298_1022_rc_wsdl.policies.BasicHttpBinding_IPOS, sizeof(fiskaltrust_interface_1_0_16298_1022_rc_wsdl.policies.BasicHttpBinding_IPOS), _serviceProxy, error); } HRESULT BasicHttpBinding_IPOS_CreateServiceEndpoint( _In_opt_ WS_HTTP_BINDING_TEMPLATE* templateValue, _In_opt_ CONST WS_STRING* address, _In_opt_ struct BasicHttpBinding_IPOSFunctionTable* functionTable, _In_opt_ WS_SERVICE_SECURITY_CALLBACK authorizationCallback, _In_reads_opt_(endpointPropertyCount) WS_SERVICE_ENDPOINT_PROPERTY* endpointProperties, _In_ const ULONG endpointPropertyCount, _In_ WS_HEAP* heap, _Outptr_ WS_SERVICE_ENDPOINT** serviceEndpoint, _In_opt_ WS_ERROR* error) { WS_SERVICE_CONTRACT serviceContract; serviceContract.contractDescription = &fiskaltrust_interface_1_0_16298_1022_rc_wsdl.contracts.BasicHttpBinding_IPOS; serviceContract.defaultMessageHandlerCallback = 0; serviceContract.methodTable = (const void*)functionTable; return WsCreateServiceEndpointFromTemplate( WS_CHANNEL_TYPE_REPLY, endpointProperties, endpointPropertyCount, address, &serviceContract, authorizationCallback, heap, WS_HTTP_BINDING_TEMPLATE_TYPE, templateValue, templateValue == NULL ? 0 : sizeof(WS_HTTP_BINDING_TEMPLATE), &fiskaltrust_interface_1_0_16298_1022_rc_wsdl.policies.BasicHttpBinding_IPOS, sizeof(fiskaltrust_interface_1_0_16298_1022_rc_wsdl.policies.BasicHttpBinding_IPOS), serviceEndpoint, error); }
68.972603
213
0.72877
78ad2cf375a704c970b6d7b477616a59a07f590e
1,092
h
C
examples/grover.h
sebastiaanbrand/q-sylvan
3fb2eb4fb8a4ba891eba75e6527bc178e92ce653
[ "Apache-2.0" ]
1
2021-12-06T17:06:47.000Z
2021-12-06T17:06:47.000Z
examples/grover.h
sebastiaanbrand/q-sylvan
3fb2eb4fb8a4ba891eba75e6527bc178e92ce653
[ "Apache-2.0" ]
null
null
null
examples/grover.h
sebastiaanbrand/q-sylvan
3fb2eb4fb8a4ba891eba75e6527bc178e92ce653
[ "Apache-2.0" ]
null
null
null
#include <qsylvan.h> /* default = false */ void qdd_grover_set_verbose(bool v); /* Approximate number of gates for 'nbits'-bit Grover */ uint64_t qdd_grover_approx_number_of_gates(BDDVAR nbits); /* Random bit array of lenght 'nbits' */ bool *qdd_grover_random_flag(BDDVAR nbits); /** * Implementation of Grover where the gates are seen as functions applied to * the QDD. */ QDD qdd_grover(BDDVAR n, bool* flag); #define qdd_grover_iteration(qdd,n,oracle) (CALL(qdd_grover_iteration,qdd,n,oracle)) TASK_DECL_3(QDD, qdd_grover_iteration, QDD, BDDVAR, bool*); /** * Implementation of Grover where both the state vector and the gates are * represented as QDDs, and matrix-vector / matrix-matrix multiplication is * used to compute the result. */ QDD qdd_grover_matrix(BDDVAR n, bool *flag); /** * Instead of applying iteration matrix G, R times, applies G^t, R/t times. * For t=1 this function acts as the "normal" matrix implementation of Grover. * (matrix is returned as arg for nodecount purposes) */ QDD qdd_grover_matrix_multi_its(BDDVAR n, bool *flag, int t, QDD *matrix);
33.090909
84
0.749084
d116256a4d3fc902100c46cf35c130d031903d0e
566
h
C
org/chartacaeli/gpu/c3p/Plane.h
otabuzzman/chartacaeli
86202be186dd71a760aa51731e73cd9f274f4f16
[ "MIT" ]
null
null
null
org/chartacaeli/gpu/c3p/Plane.h
otabuzzman/chartacaeli
86202be186dd71a760aa51731e73cd9f274f4f16
[ "MIT" ]
68
2016-02-10T18:36:54.000Z
2019-05-07T12:18:54.000Z
org/chartacaeli/gpu/c3p/Plane.h
otabuzzman/chartacaeli
86202be186dd71a760aa51731e73cd9f274f4f16
[ "MIT" ]
null
null
null
#ifndef __PLANE_H__ #define __PLANE_H__ #include "Vector3D.h" class Plane { public: Plane( const Vector3D& p1, const Vector3D& p2, const Vector3D& p3 ) ; Vector3D* intersection( const Vector3D& l1, const Vector3D& l2 ) ; // CXXWRAP/ JUnit Plane( double p1[3], double p2[3], double p3[3] ) ; void intersection( /* arg(s) */ double l1[3], double l2[3], /* return */ double x[3] ) ; private: Vector3D p1 ; Vector3D p2 ; Vector3D p3 ; Vector3D normal ; void set( const Vector3D& p1, const Vector3D& p2, const Vector3D& p3 ) ; } ; #endif // __PLANE_H__
20.962963
89
0.673145
431a04cdf7832dad5a65998da426992a6c36b572
179,044
h
C
extensions/third_party/perfetto/protos/perfetto/config/trace_config.pb.h
blockspacer/chromium_base_conan
b4749433cf34f54d2edff52e2f0465fec8cb9bad
[ "Apache-2.0", "BSD-3-Clause" ]
6
2020-12-22T05:48:31.000Z
2022-02-08T19:49:49.000Z
extensions/third_party/perfetto/protos/perfetto/config/trace_config.pb.h
blockspacer/chromium_base_conan
b4749433cf34f54d2edff52e2f0465fec8cb9bad
[ "Apache-2.0", "BSD-3-Clause" ]
4
2020-05-22T18:36:43.000Z
2021-05-19T10:20:23.000Z
extensions/third_party/perfetto/protos/perfetto/config/trace_config.pb.h
blockspacer/chromium_base_conan
b4749433cf34f54d2edff52e2f0465fec8cb9bad
[ "Apache-2.0", "BSD-3-Clause" ]
2
2019-12-06T11:48:16.000Z
2021-09-16T04:44:47.000Z
// Generated by the protocol buffer compiler. DO NOT EDIT! // source: protos/perfetto/config/trace_config.proto #ifndef GOOGLE_PROTOBUF_INCLUDED_protos_2fperfetto_2fconfig_2ftrace_5fconfig_2eproto #define GOOGLE_PROTOBUF_INCLUDED_protos_2fperfetto_2fconfig_2ftrace_5fconfig_2eproto #include <limits> #include <string> #include <google/protobuf/port_def.inc> #if PROTOBUF_VERSION < 3009000 #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 3009000 < 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/port_undef.inc> #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/inlined_string_field.h> #include <google/protobuf/metadata_lite.h> #include <google/protobuf/message_lite.h> #include <google/protobuf/repeated_field.h> // IWYU pragma: export #include <google/protobuf/extension_set.h> // IWYU pragma: export #include <google/protobuf/generated_enum_util.h> #include "protos/perfetto/config/data_source_config.pb.h" #include "protos/perfetto/common/builtin_clock.pb.h" // @@protoc_insertion_point(includes) #include <google/protobuf/port_def.inc> #define PROTOBUF_INTERNAL_EXPORT_protos_2fperfetto_2fconfig_2ftrace_5fconfig_2eproto PROTOBUF_NAMESPACE_OPEN namespace internal { class AnyMetadata; } // namespace internal PROTOBUF_NAMESPACE_CLOSE // Internal implementation detail -- do not use these members. struct TableStruct_protos_2fperfetto_2fconfig_2ftrace_5fconfig_2eproto { static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] PROTOBUF_SECTION_VARIABLE(protodesc_cold); static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[] PROTOBUF_SECTION_VARIABLE(protodesc_cold); static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[11] PROTOBUF_SECTION_VARIABLE(protodesc_cold); static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]; }; namespace perfetto { namespace protos { class TraceConfig; class TraceConfigDefaultTypeInternal; extern TraceConfigDefaultTypeInternal _TraceConfig_default_instance_; class TraceConfig_BufferConfig; class TraceConfig_BufferConfigDefaultTypeInternal; extern TraceConfig_BufferConfigDefaultTypeInternal _TraceConfig_BufferConfig_default_instance_; class TraceConfig_BuiltinDataSource; class TraceConfig_BuiltinDataSourceDefaultTypeInternal; extern TraceConfig_BuiltinDataSourceDefaultTypeInternal _TraceConfig_BuiltinDataSource_default_instance_; class TraceConfig_DataSource; class TraceConfig_DataSourceDefaultTypeInternal; extern TraceConfig_DataSourceDefaultTypeInternal _TraceConfig_DataSource_default_instance_; class TraceConfig_GuardrailOverrides; class TraceConfig_GuardrailOverridesDefaultTypeInternal; extern TraceConfig_GuardrailOverridesDefaultTypeInternal _TraceConfig_GuardrailOverrides_default_instance_; class TraceConfig_IncidentReportConfig; class TraceConfig_IncidentReportConfigDefaultTypeInternal; extern TraceConfig_IncidentReportConfigDefaultTypeInternal _TraceConfig_IncidentReportConfig_default_instance_; class TraceConfig_IncrementalStateConfig; class TraceConfig_IncrementalStateConfigDefaultTypeInternal; extern TraceConfig_IncrementalStateConfigDefaultTypeInternal _TraceConfig_IncrementalStateConfig_default_instance_; class TraceConfig_ProducerConfig; class TraceConfig_ProducerConfigDefaultTypeInternal; extern TraceConfig_ProducerConfigDefaultTypeInternal _TraceConfig_ProducerConfig_default_instance_; class TraceConfig_StatsdMetadata; class TraceConfig_StatsdMetadataDefaultTypeInternal; extern TraceConfig_StatsdMetadataDefaultTypeInternal _TraceConfig_StatsdMetadata_default_instance_; class TraceConfig_TriggerConfig; class TraceConfig_TriggerConfigDefaultTypeInternal; extern TraceConfig_TriggerConfigDefaultTypeInternal _TraceConfig_TriggerConfig_default_instance_; class TraceConfig_TriggerConfig_Trigger; class TraceConfig_TriggerConfig_TriggerDefaultTypeInternal; extern TraceConfig_TriggerConfig_TriggerDefaultTypeInternal _TraceConfig_TriggerConfig_Trigger_default_instance_; } // namespace protos } // namespace perfetto PROTOBUF_NAMESPACE_OPEN template<> ::perfetto::protos::TraceConfig* Arena::CreateMaybeMessage<::perfetto::protos::TraceConfig>(Arena*); template<> ::perfetto::protos::TraceConfig_BufferConfig* Arena::CreateMaybeMessage<::perfetto::protos::TraceConfig_BufferConfig>(Arena*); template<> ::perfetto::protos::TraceConfig_BuiltinDataSource* Arena::CreateMaybeMessage<::perfetto::protos::TraceConfig_BuiltinDataSource>(Arena*); template<> ::perfetto::protos::TraceConfig_DataSource* Arena::CreateMaybeMessage<::perfetto::protos::TraceConfig_DataSource>(Arena*); template<> ::perfetto::protos::TraceConfig_GuardrailOverrides* Arena::CreateMaybeMessage<::perfetto::protos::TraceConfig_GuardrailOverrides>(Arena*); template<> ::perfetto::protos::TraceConfig_IncidentReportConfig* Arena::CreateMaybeMessage<::perfetto::protos::TraceConfig_IncidentReportConfig>(Arena*); template<> ::perfetto::protos::TraceConfig_IncrementalStateConfig* Arena::CreateMaybeMessage<::perfetto::protos::TraceConfig_IncrementalStateConfig>(Arena*); template<> ::perfetto::protos::TraceConfig_ProducerConfig* Arena::CreateMaybeMessage<::perfetto::protos::TraceConfig_ProducerConfig>(Arena*); template<> ::perfetto::protos::TraceConfig_StatsdMetadata* Arena::CreateMaybeMessage<::perfetto::protos::TraceConfig_StatsdMetadata>(Arena*); template<> ::perfetto::protos::TraceConfig_TriggerConfig* Arena::CreateMaybeMessage<::perfetto::protos::TraceConfig_TriggerConfig>(Arena*); template<> ::perfetto::protos::TraceConfig_TriggerConfig_Trigger* Arena::CreateMaybeMessage<::perfetto::protos::TraceConfig_TriggerConfig_Trigger>(Arena*); PROTOBUF_NAMESPACE_CLOSE namespace perfetto { namespace protos { enum TraceConfig_BufferConfig_FillPolicy : int { TraceConfig_BufferConfig_FillPolicy_UNSPECIFIED = 0, TraceConfig_BufferConfig_FillPolicy_RING_BUFFER = 1, TraceConfig_BufferConfig_FillPolicy_DISCARD = 2 }; bool TraceConfig_BufferConfig_FillPolicy_IsValid(int value); constexpr TraceConfig_BufferConfig_FillPolicy TraceConfig_BufferConfig_FillPolicy_FillPolicy_MIN = TraceConfig_BufferConfig_FillPolicy_UNSPECIFIED; constexpr TraceConfig_BufferConfig_FillPolicy TraceConfig_BufferConfig_FillPolicy_FillPolicy_MAX = TraceConfig_BufferConfig_FillPolicy_DISCARD; constexpr int TraceConfig_BufferConfig_FillPolicy_FillPolicy_ARRAYSIZE = TraceConfig_BufferConfig_FillPolicy_FillPolicy_MAX + 1; const std::string& TraceConfig_BufferConfig_FillPolicy_Name(TraceConfig_BufferConfig_FillPolicy value); template<typename T> inline const std::string& TraceConfig_BufferConfig_FillPolicy_Name(T enum_t_value) { static_assert(::std::is_same<T, TraceConfig_BufferConfig_FillPolicy>::value || ::std::is_integral<T>::value, "Incorrect type passed to function TraceConfig_BufferConfig_FillPolicy_Name."); return TraceConfig_BufferConfig_FillPolicy_Name(static_cast<TraceConfig_BufferConfig_FillPolicy>(enum_t_value)); } bool TraceConfig_BufferConfig_FillPolicy_Parse( const std::string& name, TraceConfig_BufferConfig_FillPolicy* value); enum TraceConfig_TriggerConfig_TriggerMode : int { TraceConfig_TriggerConfig_TriggerMode_UNSPECIFIED = 0, TraceConfig_TriggerConfig_TriggerMode_START_TRACING = 1, TraceConfig_TriggerConfig_TriggerMode_STOP_TRACING = 2 }; bool TraceConfig_TriggerConfig_TriggerMode_IsValid(int value); constexpr TraceConfig_TriggerConfig_TriggerMode TraceConfig_TriggerConfig_TriggerMode_TriggerMode_MIN = TraceConfig_TriggerConfig_TriggerMode_UNSPECIFIED; constexpr TraceConfig_TriggerConfig_TriggerMode TraceConfig_TriggerConfig_TriggerMode_TriggerMode_MAX = TraceConfig_TriggerConfig_TriggerMode_STOP_TRACING; constexpr int TraceConfig_TriggerConfig_TriggerMode_TriggerMode_ARRAYSIZE = TraceConfig_TriggerConfig_TriggerMode_TriggerMode_MAX + 1; const std::string& TraceConfig_TriggerConfig_TriggerMode_Name(TraceConfig_TriggerConfig_TriggerMode value); template<typename T> inline const std::string& TraceConfig_TriggerConfig_TriggerMode_Name(T enum_t_value) { static_assert(::std::is_same<T, TraceConfig_TriggerConfig_TriggerMode>::value || ::std::is_integral<T>::value, "Incorrect type passed to function TraceConfig_TriggerConfig_TriggerMode_Name."); return TraceConfig_TriggerConfig_TriggerMode_Name(static_cast<TraceConfig_TriggerConfig_TriggerMode>(enum_t_value)); } bool TraceConfig_TriggerConfig_TriggerMode_Parse( const std::string& name, TraceConfig_TriggerConfig_TriggerMode* value); enum TraceConfig_LockdownModeOperation : int { TraceConfig_LockdownModeOperation_LOCKDOWN_UNCHANGED = 0, TraceConfig_LockdownModeOperation_LOCKDOWN_CLEAR = 1, TraceConfig_LockdownModeOperation_LOCKDOWN_SET = 2 }; bool TraceConfig_LockdownModeOperation_IsValid(int value); constexpr TraceConfig_LockdownModeOperation TraceConfig_LockdownModeOperation_LockdownModeOperation_MIN = TraceConfig_LockdownModeOperation_LOCKDOWN_UNCHANGED; constexpr TraceConfig_LockdownModeOperation TraceConfig_LockdownModeOperation_LockdownModeOperation_MAX = TraceConfig_LockdownModeOperation_LOCKDOWN_SET; constexpr int TraceConfig_LockdownModeOperation_LockdownModeOperation_ARRAYSIZE = TraceConfig_LockdownModeOperation_LockdownModeOperation_MAX + 1; const std::string& TraceConfig_LockdownModeOperation_Name(TraceConfig_LockdownModeOperation value); template<typename T> inline const std::string& TraceConfig_LockdownModeOperation_Name(T enum_t_value) { static_assert(::std::is_same<T, TraceConfig_LockdownModeOperation>::value || ::std::is_integral<T>::value, "Incorrect type passed to function TraceConfig_LockdownModeOperation_Name."); return TraceConfig_LockdownModeOperation_Name(static_cast<TraceConfig_LockdownModeOperation>(enum_t_value)); } bool TraceConfig_LockdownModeOperation_Parse( const std::string& name, TraceConfig_LockdownModeOperation* value); enum TraceConfig_CompressionType : int { TraceConfig_CompressionType_COMPRESSION_TYPE_UNSPECIFIED = 0, TraceConfig_CompressionType_COMPRESSION_TYPE_DEFLATE = 1 }; bool TraceConfig_CompressionType_IsValid(int value); constexpr TraceConfig_CompressionType TraceConfig_CompressionType_CompressionType_MIN = TraceConfig_CompressionType_COMPRESSION_TYPE_UNSPECIFIED; constexpr TraceConfig_CompressionType TraceConfig_CompressionType_CompressionType_MAX = TraceConfig_CompressionType_COMPRESSION_TYPE_DEFLATE; constexpr int TraceConfig_CompressionType_CompressionType_ARRAYSIZE = TraceConfig_CompressionType_CompressionType_MAX + 1; const std::string& TraceConfig_CompressionType_Name(TraceConfig_CompressionType value); template<typename T> inline const std::string& TraceConfig_CompressionType_Name(T enum_t_value) { static_assert(::std::is_same<T, TraceConfig_CompressionType>::value || ::std::is_integral<T>::value, "Incorrect type passed to function TraceConfig_CompressionType_Name."); return TraceConfig_CompressionType_Name(static_cast<TraceConfig_CompressionType>(enum_t_value)); } bool TraceConfig_CompressionType_Parse( const std::string& name, TraceConfig_CompressionType* value); // =================================================================== class TraceConfig_BufferConfig : public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:perfetto.protos.TraceConfig.BufferConfig) */ { public: TraceConfig_BufferConfig(); virtual ~TraceConfig_BufferConfig(); TraceConfig_BufferConfig(const TraceConfig_BufferConfig& from); TraceConfig_BufferConfig(TraceConfig_BufferConfig&& from) noexcept : TraceConfig_BufferConfig() { *this = ::std::move(from); } inline TraceConfig_BufferConfig& operator=(const TraceConfig_BufferConfig& from) { CopyFrom(from); return *this; } inline TraceConfig_BufferConfig& operator=(TraceConfig_BufferConfig&& from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } return *this; } inline const std::string& unknown_fields() const { return _internal_metadata_.unknown_fields(); } inline std::string* mutable_unknown_fields() { return _internal_metadata_.mutable_unknown_fields(); } static const TraceConfig_BufferConfig& default_instance(); static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const TraceConfig_BufferConfig* internal_default_instance() { return reinterpret_cast<const TraceConfig_BufferConfig*>( &_TraceConfig_BufferConfig_default_instance_); } static constexpr int kIndexInFileMessages = 0; friend void swap(TraceConfig_BufferConfig& a, TraceConfig_BufferConfig& b) { a.Swap(&b); } inline void Swap(TraceConfig_BufferConfig* other) { if (other == this) return; InternalSwap(other); } // implements Message ---------------------------------------------- inline TraceConfig_BufferConfig* New() const final { return CreateMaybeMessage<TraceConfig_BufferConfig>(nullptr); } TraceConfig_BufferConfig* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage<TraceConfig_BufferConfig>(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const TraceConfig_BufferConfig& from); void MergeFrom(const TraceConfig_BufferConfig& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; #else bool MergePartialFromCodedStream( ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER void SerializeWithCachedSizes( ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; void DiscardUnknownFields(); int GetCachedSize() const final { return _cached_size_.Get(); } private: inline void SharedCtor(); inline void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(TraceConfig_BufferConfig* other); friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "perfetto.protos.TraceConfig.BufferConfig"; } private: inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { return nullptr; } inline void* MaybeArenaPtr() const { return nullptr; } public: std::string GetTypeName() const final; // nested types ---------------------------------------------------- typedef TraceConfig_BufferConfig_FillPolicy FillPolicy; static constexpr FillPolicy UNSPECIFIED = TraceConfig_BufferConfig_FillPolicy_UNSPECIFIED; static constexpr FillPolicy RING_BUFFER = TraceConfig_BufferConfig_FillPolicy_RING_BUFFER; static constexpr FillPolicy DISCARD = TraceConfig_BufferConfig_FillPolicy_DISCARD; static inline bool FillPolicy_IsValid(int value) { return TraceConfig_BufferConfig_FillPolicy_IsValid(value); } static constexpr FillPolicy FillPolicy_MIN = TraceConfig_BufferConfig_FillPolicy_FillPolicy_MIN; static constexpr FillPolicy FillPolicy_MAX = TraceConfig_BufferConfig_FillPolicy_FillPolicy_MAX; static constexpr int FillPolicy_ARRAYSIZE = TraceConfig_BufferConfig_FillPolicy_FillPolicy_ARRAYSIZE; template<typename T> static inline const std::string& FillPolicy_Name(T enum_t_value) { static_assert(::std::is_same<T, FillPolicy>::value || ::std::is_integral<T>::value, "Incorrect type passed to function FillPolicy_Name."); return TraceConfig_BufferConfig_FillPolicy_Name(enum_t_value); } static inline bool FillPolicy_Parse(const std::string& name, FillPolicy* value) { return TraceConfig_BufferConfig_FillPolicy_Parse(name, value); } // accessors ------------------------------------------------------- enum : int { kSizeKbFieldNumber = 1, kFillPolicyFieldNumber = 4, }; // optional uint32 size_kb = 1; bool has_size_kb() const; void clear_size_kb(); ::PROTOBUF_NAMESPACE_ID::uint32 size_kb() const; void set_size_kb(::PROTOBUF_NAMESPACE_ID::uint32 value); // optional .perfetto.protos.TraceConfig.BufferConfig.FillPolicy fill_policy = 4; bool has_fill_policy() const; void clear_fill_policy(); ::perfetto::protos::TraceConfig_BufferConfig_FillPolicy fill_policy() const; void set_fill_policy(::perfetto::protos::TraceConfig_BufferConfig_FillPolicy value); // @@protoc_insertion_point(class_scope:perfetto.protos.TraceConfig.BufferConfig) private: class _Internal; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArenaLite _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; ::PROTOBUF_NAMESPACE_ID::uint32 size_kb_; int fill_policy_; friend struct ::TableStruct_protos_2fperfetto_2fconfig_2ftrace_5fconfig_2eproto; }; // ------------------------------------------------------------------- class TraceConfig_DataSource : public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:perfetto.protos.TraceConfig.DataSource) */ { public: TraceConfig_DataSource(); virtual ~TraceConfig_DataSource(); TraceConfig_DataSource(const TraceConfig_DataSource& from); TraceConfig_DataSource(TraceConfig_DataSource&& from) noexcept : TraceConfig_DataSource() { *this = ::std::move(from); } inline TraceConfig_DataSource& operator=(const TraceConfig_DataSource& from) { CopyFrom(from); return *this; } inline TraceConfig_DataSource& operator=(TraceConfig_DataSource&& from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } return *this; } inline const std::string& unknown_fields() const { return _internal_metadata_.unknown_fields(); } inline std::string* mutable_unknown_fields() { return _internal_metadata_.mutable_unknown_fields(); } static const TraceConfig_DataSource& default_instance(); static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const TraceConfig_DataSource* internal_default_instance() { return reinterpret_cast<const TraceConfig_DataSource*>( &_TraceConfig_DataSource_default_instance_); } static constexpr int kIndexInFileMessages = 1; friend void swap(TraceConfig_DataSource& a, TraceConfig_DataSource& b) { a.Swap(&b); } inline void Swap(TraceConfig_DataSource* other) { if (other == this) return; InternalSwap(other); } // implements Message ---------------------------------------------- inline TraceConfig_DataSource* New() const final { return CreateMaybeMessage<TraceConfig_DataSource>(nullptr); } TraceConfig_DataSource* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage<TraceConfig_DataSource>(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const TraceConfig_DataSource& from); void MergeFrom(const TraceConfig_DataSource& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; #else bool MergePartialFromCodedStream( ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER void SerializeWithCachedSizes( ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; void DiscardUnknownFields(); int GetCachedSize() const final { return _cached_size_.Get(); } private: inline void SharedCtor(); inline void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(TraceConfig_DataSource* other); friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "perfetto.protos.TraceConfig.DataSource"; } private: inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { return nullptr; } inline void* MaybeArenaPtr() const { return nullptr; } public: std::string GetTypeName() const final; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- enum : int { kProducerNameFilterFieldNumber = 2, kProducerNameRegexFilterFieldNumber = 3, kConfigFieldNumber = 1, }; // repeated string producer_name_filter = 2; int producer_name_filter_size() const; void clear_producer_name_filter(); const std::string& producer_name_filter(int index) const; std::string* mutable_producer_name_filter(int index); void set_producer_name_filter(int index, const std::string& value); void set_producer_name_filter(int index, std::string&& value); void set_producer_name_filter(int index, const char* value); void set_producer_name_filter(int index, const char* value, size_t size); std::string* add_producer_name_filter(); void add_producer_name_filter(const std::string& value); void add_producer_name_filter(std::string&& value); void add_producer_name_filter(const char* value); void add_producer_name_filter(const char* value, size_t size); const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& producer_name_filter() const; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_producer_name_filter(); // repeated string producer_name_regex_filter = 3; int producer_name_regex_filter_size() const; void clear_producer_name_regex_filter(); const std::string& producer_name_regex_filter(int index) const; std::string* mutable_producer_name_regex_filter(int index); void set_producer_name_regex_filter(int index, const std::string& value); void set_producer_name_regex_filter(int index, std::string&& value); void set_producer_name_regex_filter(int index, const char* value); void set_producer_name_regex_filter(int index, const char* value, size_t size); std::string* add_producer_name_regex_filter(); void add_producer_name_regex_filter(const std::string& value); void add_producer_name_regex_filter(std::string&& value); void add_producer_name_regex_filter(const char* value); void add_producer_name_regex_filter(const char* value, size_t size); const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& producer_name_regex_filter() const; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_producer_name_regex_filter(); // optional .perfetto.protos.DataSourceConfig config = 1; bool has_config() const; void clear_config(); const ::perfetto::protos::DataSourceConfig& config() const; ::perfetto::protos::DataSourceConfig* release_config(); ::perfetto::protos::DataSourceConfig* mutable_config(); void set_allocated_config(::perfetto::protos::DataSourceConfig* config); // @@protoc_insertion_point(class_scope:perfetto.protos.TraceConfig.DataSource) private: class _Internal; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArenaLite _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> producer_name_filter_; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> producer_name_regex_filter_; ::perfetto::protos::DataSourceConfig* config_; friend struct ::TableStruct_protos_2fperfetto_2fconfig_2ftrace_5fconfig_2eproto; }; // ------------------------------------------------------------------- class TraceConfig_BuiltinDataSource : public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:perfetto.protos.TraceConfig.BuiltinDataSource) */ { public: TraceConfig_BuiltinDataSource(); virtual ~TraceConfig_BuiltinDataSource(); TraceConfig_BuiltinDataSource(const TraceConfig_BuiltinDataSource& from); TraceConfig_BuiltinDataSource(TraceConfig_BuiltinDataSource&& from) noexcept : TraceConfig_BuiltinDataSource() { *this = ::std::move(from); } inline TraceConfig_BuiltinDataSource& operator=(const TraceConfig_BuiltinDataSource& from) { CopyFrom(from); return *this; } inline TraceConfig_BuiltinDataSource& operator=(TraceConfig_BuiltinDataSource&& from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } return *this; } inline const std::string& unknown_fields() const { return _internal_metadata_.unknown_fields(); } inline std::string* mutable_unknown_fields() { return _internal_metadata_.mutable_unknown_fields(); } static const TraceConfig_BuiltinDataSource& default_instance(); static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const TraceConfig_BuiltinDataSource* internal_default_instance() { return reinterpret_cast<const TraceConfig_BuiltinDataSource*>( &_TraceConfig_BuiltinDataSource_default_instance_); } static constexpr int kIndexInFileMessages = 2; friend void swap(TraceConfig_BuiltinDataSource& a, TraceConfig_BuiltinDataSource& b) { a.Swap(&b); } inline void Swap(TraceConfig_BuiltinDataSource* other) { if (other == this) return; InternalSwap(other); } // implements Message ---------------------------------------------- inline TraceConfig_BuiltinDataSource* New() const final { return CreateMaybeMessage<TraceConfig_BuiltinDataSource>(nullptr); } TraceConfig_BuiltinDataSource* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage<TraceConfig_BuiltinDataSource>(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const TraceConfig_BuiltinDataSource& from); void MergeFrom(const TraceConfig_BuiltinDataSource& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; #else bool MergePartialFromCodedStream( ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER void SerializeWithCachedSizes( ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; void DiscardUnknownFields(); int GetCachedSize() const final { return _cached_size_.Get(); } private: inline void SharedCtor(); inline void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(TraceConfig_BuiltinDataSource* other); friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "perfetto.protos.TraceConfig.BuiltinDataSource"; } private: inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { return nullptr; } inline void* MaybeArenaPtr() const { return nullptr; } public: std::string GetTypeName() const final; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- enum : int { kDisableClockSnapshottingFieldNumber = 1, kDisableTraceConfigFieldNumber = 2, kDisableSystemInfoFieldNumber = 3, kDisableServiceEventsFieldNumber = 4, kPrimaryTraceClockFieldNumber = 5, kSnapshotIntervalMsFieldNumber = 6, }; // optional bool disable_clock_snapshotting = 1; bool has_disable_clock_snapshotting() const; void clear_disable_clock_snapshotting(); bool disable_clock_snapshotting() const; void set_disable_clock_snapshotting(bool value); // optional bool disable_trace_config = 2; bool has_disable_trace_config() const; void clear_disable_trace_config(); bool disable_trace_config() const; void set_disable_trace_config(bool value); // optional bool disable_system_info = 3; bool has_disable_system_info() const; void clear_disable_system_info(); bool disable_system_info() const; void set_disable_system_info(bool value); // optional bool disable_service_events = 4; bool has_disable_service_events() const; void clear_disable_service_events(); bool disable_service_events() const; void set_disable_service_events(bool value); // optional .perfetto.protos.BuiltinClock primary_trace_clock = 5; bool has_primary_trace_clock() const; void clear_primary_trace_clock(); ::perfetto::protos::BuiltinClock primary_trace_clock() const; void set_primary_trace_clock(::perfetto::protos::BuiltinClock value); // optional uint32 snapshot_interval_ms = 6; bool has_snapshot_interval_ms() const; void clear_snapshot_interval_ms(); ::PROTOBUF_NAMESPACE_ID::uint32 snapshot_interval_ms() const; void set_snapshot_interval_ms(::PROTOBUF_NAMESPACE_ID::uint32 value); // @@protoc_insertion_point(class_scope:perfetto.protos.TraceConfig.BuiltinDataSource) private: class _Internal; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArenaLite _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; bool disable_clock_snapshotting_; bool disable_trace_config_; bool disable_system_info_; bool disable_service_events_; int primary_trace_clock_; ::PROTOBUF_NAMESPACE_ID::uint32 snapshot_interval_ms_; friend struct ::TableStruct_protos_2fperfetto_2fconfig_2ftrace_5fconfig_2eproto; }; // ------------------------------------------------------------------- class TraceConfig_ProducerConfig : public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:perfetto.protos.TraceConfig.ProducerConfig) */ { public: TraceConfig_ProducerConfig(); virtual ~TraceConfig_ProducerConfig(); TraceConfig_ProducerConfig(const TraceConfig_ProducerConfig& from); TraceConfig_ProducerConfig(TraceConfig_ProducerConfig&& from) noexcept : TraceConfig_ProducerConfig() { *this = ::std::move(from); } inline TraceConfig_ProducerConfig& operator=(const TraceConfig_ProducerConfig& from) { CopyFrom(from); return *this; } inline TraceConfig_ProducerConfig& operator=(TraceConfig_ProducerConfig&& from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } return *this; } inline const std::string& unknown_fields() const { return _internal_metadata_.unknown_fields(); } inline std::string* mutable_unknown_fields() { return _internal_metadata_.mutable_unknown_fields(); } static const TraceConfig_ProducerConfig& default_instance(); static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const TraceConfig_ProducerConfig* internal_default_instance() { return reinterpret_cast<const TraceConfig_ProducerConfig*>( &_TraceConfig_ProducerConfig_default_instance_); } static constexpr int kIndexInFileMessages = 3; friend void swap(TraceConfig_ProducerConfig& a, TraceConfig_ProducerConfig& b) { a.Swap(&b); } inline void Swap(TraceConfig_ProducerConfig* other) { if (other == this) return; InternalSwap(other); } // implements Message ---------------------------------------------- inline TraceConfig_ProducerConfig* New() const final { return CreateMaybeMessage<TraceConfig_ProducerConfig>(nullptr); } TraceConfig_ProducerConfig* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage<TraceConfig_ProducerConfig>(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const TraceConfig_ProducerConfig& from); void MergeFrom(const TraceConfig_ProducerConfig& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; #else bool MergePartialFromCodedStream( ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER void SerializeWithCachedSizes( ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; void DiscardUnknownFields(); int GetCachedSize() const final { return _cached_size_.Get(); } private: inline void SharedCtor(); inline void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(TraceConfig_ProducerConfig* other); friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "perfetto.protos.TraceConfig.ProducerConfig"; } private: inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { return nullptr; } inline void* MaybeArenaPtr() const { return nullptr; } public: std::string GetTypeName() const final; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- enum : int { kProducerNameFieldNumber = 1, kShmSizeKbFieldNumber = 2, kPageSizeKbFieldNumber = 3, }; // optional string producer_name = 1; bool has_producer_name() const; void clear_producer_name(); const std::string& producer_name() const; void set_producer_name(const std::string& value); void set_producer_name(std::string&& value); void set_producer_name(const char* value); void set_producer_name(const char* value, size_t size); std::string* mutable_producer_name(); std::string* release_producer_name(); void set_allocated_producer_name(std::string* producer_name); // optional uint32 shm_size_kb = 2; bool has_shm_size_kb() const; void clear_shm_size_kb(); ::PROTOBUF_NAMESPACE_ID::uint32 shm_size_kb() const; void set_shm_size_kb(::PROTOBUF_NAMESPACE_ID::uint32 value); // optional uint32 page_size_kb = 3; bool has_page_size_kb() const; void clear_page_size_kb(); ::PROTOBUF_NAMESPACE_ID::uint32 page_size_kb() const; void set_page_size_kb(::PROTOBUF_NAMESPACE_ID::uint32 value); // @@protoc_insertion_point(class_scope:perfetto.protos.TraceConfig.ProducerConfig) private: class _Internal; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArenaLite _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr producer_name_; ::PROTOBUF_NAMESPACE_ID::uint32 shm_size_kb_; ::PROTOBUF_NAMESPACE_ID::uint32 page_size_kb_; friend struct ::TableStruct_protos_2fperfetto_2fconfig_2ftrace_5fconfig_2eproto; }; // ------------------------------------------------------------------- class TraceConfig_StatsdMetadata : public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:perfetto.protos.TraceConfig.StatsdMetadata) */ { public: TraceConfig_StatsdMetadata(); virtual ~TraceConfig_StatsdMetadata(); TraceConfig_StatsdMetadata(const TraceConfig_StatsdMetadata& from); TraceConfig_StatsdMetadata(TraceConfig_StatsdMetadata&& from) noexcept : TraceConfig_StatsdMetadata() { *this = ::std::move(from); } inline TraceConfig_StatsdMetadata& operator=(const TraceConfig_StatsdMetadata& from) { CopyFrom(from); return *this; } inline TraceConfig_StatsdMetadata& operator=(TraceConfig_StatsdMetadata&& from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } return *this; } inline const std::string& unknown_fields() const { return _internal_metadata_.unknown_fields(); } inline std::string* mutable_unknown_fields() { return _internal_metadata_.mutable_unknown_fields(); } static const TraceConfig_StatsdMetadata& default_instance(); static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const TraceConfig_StatsdMetadata* internal_default_instance() { return reinterpret_cast<const TraceConfig_StatsdMetadata*>( &_TraceConfig_StatsdMetadata_default_instance_); } static constexpr int kIndexInFileMessages = 4; friend void swap(TraceConfig_StatsdMetadata& a, TraceConfig_StatsdMetadata& b) { a.Swap(&b); } inline void Swap(TraceConfig_StatsdMetadata* other) { if (other == this) return; InternalSwap(other); } // implements Message ---------------------------------------------- inline TraceConfig_StatsdMetadata* New() const final { return CreateMaybeMessage<TraceConfig_StatsdMetadata>(nullptr); } TraceConfig_StatsdMetadata* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage<TraceConfig_StatsdMetadata>(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const TraceConfig_StatsdMetadata& from); void MergeFrom(const TraceConfig_StatsdMetadata& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; #else bool MergePartialFromCodedStream( ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER void SerializeWithCachedSizes( ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; void DiscardUnknownFields(); int GetCachedSize() const final { return _cached_size_.Get(); } private: inline void SharedCtor(); inline void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(TraceConfig_StatsdMetadata* other); friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "perfetto.protos.TraceConfig.StatsdMetadata"; } private: inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { return nullptr; } inline void* MaybeArenaPtr() const { return nullptr; } public: std::string GetTypeName() const final; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- enum : int { kTriggeringAlertIdFieldNumber = 1, kTriggeringConfigIdFieldNumber = 3, kTriggeringSubscriptionIdFieldNumber = 4, kTriggeringConfigUidFieldNumber = 2, }; // optional int64 triggering_alert_id = 1; bool has_triggering_alert_id() const; void clear_triggering_alert_id(); ::PROTOBUF_NAMESPACE_ID::int64 triggering_alert_id() const; void set_triggering_alert_id(::PROTOBUF_NAMESPACE_ID::int64 value); // optional int64 triggering_config_id = 3; bool has_triggering_config_id() const; void clear_triggering_config_id(); ::PROTOBUF_NAMESPACE_ID::int64 triggering_config_id() const; void set_triggering_config_id(::PROTOBUF_NAMESPACE_ID::int64 value); // optional int64 triggering_subscription_id = 4; bool has_triggering_subscription_id() const; void clear_triggering_subscription_id(); ::PROTOBUF_NAMESPACE_ID::int64 triggering_subscription_id() const; void set_triggering_subscription_id(::PROTOBUF_NAMESPACE_ID::int64 value); // optional int32 triggering_config_uid = 2; bool has_triggering_config_uid() const; void clear_triggering_config_uid(); ::PROTOBUF_NAMESPACE_ID::int32 triggering_config_uid() const; void set_triggering_config_uid(::PROTOBUF_NAMESPACE_ID::int32 value); // @@protoc_insertion_point(class_scope:perfetto.protos.TraceConfig.StatsdMetadata) private: class _Internal; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArenaLite _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; ::PROTOBUF_NAMESPACE_ID::int64 triggering_alert_id_; ::PROTOBUF_NAMESPACE_ID::int64 triggering_config_id_; ::PROTOBUF_NAMESPACE_ID::int64 triggering_subscription_id_; ::PROTOBUF_NAMESPACE_ID::int32 triggering_config_uid_; friend struct ::TableStruct_protos_2fperfetto_2fconfig_2ftrace_5fconfig_2eproto; }; // ------------------------------------------------------------------- class TraceConfig_GuardrailOverrides : public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:perfetto.protos.TraceConfig.GuardrailOverrides) */ { public: TraceConfig_GuardrailOverrides(); virtual ~TraceConfig_GuardrailOverrides(); TraceConfig_GuardrailOverrides(const TraceConfig_GuardrailOverrides& from); TraceConfig_GuardrailOverrides(TraceConfig_GuardrailOverrides&& from) noexcept : TraceConfig_GuardrailOverrides() { *this = ::std::move(from); } inline TraceConfig_GuardrailOverrides& operator=(const TraceConfig_GuardrailOverrides& from) { CopyFrom(from); return *this; } inline TraceConfig_GuardrailOverrides& operator=(TraceConfig_GuardrailOverrides&& from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } return *this; } inline const std::string& unknown_fields() const { return _internal_metadata_.unknown_fields(); } inline std::string* mutable_unknown_fields() { return _internal_metadata_.mutable_unknown_fields(); } static const TraceConfig_GuardrailOverrides& default_instance(); static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const TraceConfig_GuardrailOverrides* internal_default_instance() { return reinterpret_cast<const TraceConfig_GuardrailOverrides*>( &_TraceConfig_GuardrailOverrides_default_instance_); } static constexpr int kIndexInFileMessages = 5; friend void swap(TraceConfig_GuardrailOverrides& a, TraceConfig_GuardrailOverrides& b) { a.Swap(&b); } inline void Swap(TraceConfig_GuardrailOverrides* other) { if (other == this) return; InternalSwap(other); } // implements Message ---------------------------------------------- inline TraceConfig_GuardrailOverrides* New() const final { return CreateMaybeMessage<TraceConfig_GuardrailOverrides>(nullptr); } TraceConfig_GuardrailOverrides* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage<TraceConfig_GuardrailOverrides>(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const TraceConfig_GuardrailOverrides& from); void MergeFrom(const TraceConfig_GuardrailOverrides& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; #else bool MergePartialFromCodedStream( ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER void SerializeWithCachedSizes( ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; void DiscardUnknownFields(); int GetCachedSize() const final { return _cached_size_.Get(); } private: inline void SharedCtor(); inline void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(TraceConfig_GuardrailOverrides* other); friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "perfetto.protos.TraceConfig.GuardrailOverrides"; } private: inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { return nullptr; } inline void* MaybeArenaPtr() const { return nullptr; } public: std::string GetTypeName() const final; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- enum : int { kMaxUploadPerDayBytesFieldNumber = 1, }; // optional uint64 max_upload_per_day_bytes = 1; bool has_max_upload_per_day_bytes() const; void clear_max_upload_per_day_bytes(); ::PROTOBUF_NAMESPACE_ID::uint64 max_upload_per_day_bytes() const; void set_max_upload_per_day_bytes(::PROTOBUF_NAMESPACE_ID::uint64 value); // @@protoc_insertion_point(class_scope:perfetto.protos.TraceConfig.GuardrailOverrides) private: class _Internal; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArenaLite _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; ::PROTOBUF_NAMESPACE_ID::uint64 max_upload_per_day_bytes_; friend struct ::TableStruct_protos_2fperfetto_2fconfig_2ftrace_5fconfig_2eproto; }; // ------------------------------------------------------------------- class TraceConfig_TriggerConfig_Trigger : public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:perfetto.protos.TraceConfig.TriggerConfig.Trigger) */ { public: TraceConfig_TriggerConfig_Trigger(); virtual ~TraceConfig_TriggerConfig_Trigger(); TraceConfig_TriggerConfig_Trigger(const TraceConfig_TriggerConfig_Trigger& from); TraceConfig_TriggerConfig_Trigger(TraceConfig_TriggerConfig_Trigger&& from) noexcept : TraceConfig_TriggerConfig_Trigger() { *this = ::std::move(from); } inline TraceConfig_TriggerConfig_Trigger& operator=(const TraceConfig_TriggerConfig_Trigger& from) { CopyFrom(from); return *this; } inline TraceConfig_TriggerConfig_Trigger& operator=(TraceConfig_TriggerConfig_Trigger&& from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } return *this; } inline const std::string& unknown_fields() const { return _internal_metadata_.unknown_fields(); } inline std::string* mutable_unknown_fields() { return _internal_metadata_.mutable_unknown_fields(); } static const TraceConfig_TriggerConfig_Trigger& default_instance(); static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const TraceConfig_TriggerConfig_Trigger* internal_default_instance() { return reinterpret_cast<const TraceConfig_TriggerConfig_Trigger*>( &_TraceConfig_TriggerConfig_Trigger_default_instance_); } static constexpr int kIndexInFileMessages = 6; friend void swap(TraceConfig_TriggerConfig_Trigger& a, TraceConfig_TriggerConfig_Trigger& b) { a.Swap(&b); } inline void Swap(TraceConfig_TriggerConfig_Trigger* other) { if (other == this) return; InternalSwap(other); } // implements Message ---------------------------------------------- inline TraceConfig_TriggerConfig_Trigger* New() const final { return CreateMaybeMessage<TraceConfig_TriggerConfig_Trigger>(nullptr); } TraceConfig_TriggerConfig_Trigger* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage<TraceConfig_TriggerConfig_Trigger>(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const TraceConfig_TriggerConfig_Trigger& from); void MergeFrom(const TraceConfig_TriggerConfig_Trigger& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; #else bool MergePartialFromCodedStream( ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER void SerializeWithCachedSizes( ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; void DiscardUnknownFields(); int GetCachedSize() const final { return _cached_size_.Get(); } private: inline void SharedCtor(); inline void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(TraceConfig_TriggerConfig_Trigger* other); friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "perfetto.protos.TraceConfig.TriggerConfig.Trigger"; } private: inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { return nullptr; } inline void* MaybeArenaPtr() const { return nullptr; } public: std::string GetTypeName() const final; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- enum : int { kNameFieldNumber = 1, kProducerNameRegexFieldNumber = 2, kStopDelayMsFieldNumber = 3, kMaxPer24HFieldNumber = 4, kSkipProbabilityFieldNumber = 5, }; // optional string name = 1; bool has_name() const; void clear_name(); const std::string& name() const; void set_name(const std::string& value); void set_name(std::string&& value); 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); // optional string producer_name_regex = 2; bool has_producer_name_regex() const; void clear_producer_name_regex(); const std::string& producer_name_regex() const; void set_producer_name_regex(const std::string& value); void set_producer_name_regex(std::string&& value); void set_producer_name_regex(const char* value); void set_producer_name_regex(const char* value, size_t size); std::string* mutable_producer_name_regex(); std::string* release_producer_name_regex(); void set_allocated_producer_name_regex(std::string* producer_name_regex); // optional uint32 stop_delay_ms = 3; bool has_stop_delay_ms() const; void clear_stop_delay_ms(); ::PROTOBUF_NAMESPACE_ID::uint32 stop_delay_ms() const; void set_stop_delay_ms(::PROTOBUF_NAMESPACE_ID::uint32 value); // optional uint32 max_per_24_h = 4; bool has_max_per_24_h() const; void clear_max_per_24_h(); ::PROTOBUF_NAMESPACE_ID::uint32 max_per_24_h() const; void set_max_per_24_h(::PROTOBUF_NAMESPACE_ID::uint32 value); // optional double skip_probability = 5; bool has_skip_probability() const; void clear_skip_probability(); double skip_probability() const; void set_skip_probability(double value); // @@protoc_insertion_point(class_scope:perfetto.protos.TraceConfig.TriggerConfig.Trigger) private: class _Internal; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArenaLite _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr producer_name_regex_; ::PROTOBUF_NAMESPACE_ID::uint32 stop_delay_ms_; ::PROTOBUF_NAMESPACE_ID::uint32 max_per_24_h_; double skip_probability_; friend struct ::TableStruct_protos_2fperfetto_2fconfig_2ftrace_5fconfig_2eproto; }; // ------------------------------------------------------------------- class TraceConfig_TriggerConfig : public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:perfetto.protos.TraceConfig.TriggerConfig) */ { public: TraceConfig_TriggerConfig(); virtual ~TraceConfig_TriggerConfig(); TraceConfig_TriggerConfig(const TraceConfig_TriggerConfig& from); TraceConfig_TriggerConfig(TraceConfig_TriggerConfig&& from) noexcept : TraceConfig_TriggerConfig() { *this = ::std::move(from); } inline TraceConfig_TriggerConfig& operator=(const TraceConfig_TriggerConfig& from) { CopyFrom(from); return *this; } inline TraceConfig_TriggerConfig& operator=(TraceConfig_TriggerConfig&& from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } return *this; } inline const std::string& unknown_fields() const { return _internal_metadata_.unknown_fields(); } inline std::string* mutable_unknown_fields() { return _internal_metadata_.mutable_unknown_fields(); } static const TraceConfig_TriggerConfig& default_instance(); static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const TraceConfig_TriggerConfig* internal_default_instance() { return reinterpret_cast<const TraceConfig_TriggerConfig*>( &_TraceConfig_TriggerConfig_default_instance_); } static constexpr int kIndexInFileMessages = 7; friend void swap(TraceConfig_TriggerConfig& a, TraceConfig_TriggerConfig& b) { a.Swap(&b); } inline void Swap(TraceConfig_TriggerConfig* other) { if (other == this) return; InternalSwap(other); } // implements Message ---------------------------------------------- inline TraceConfig_TriggerConfig* New() const final { return CreateMaybeMessage<TraceConfig_TriggerConfig>(nullptr); } TraceConfig_TriggerConfig* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage<TraceConfig_TriggerConfig>(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const TraceConfig_TriggerConfig& from); void MergeFrom(const TraceConfig_TriggerConfig& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; #else bool MergePartialFromCodedStream( ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER void SerializeWithCachedSizes( ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; void DiscardUnknownFields(); int GetCachedSize() const final { return _cached_size_.Get(); } private: inline void SharedCtor(); inline void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(TraceConfig_TriggerConfig* other); friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "perfetto.protos.TraceConfig.TriggerConfig"; } private: inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { return nullptr; } inline void* MaybeArenaPtr() const { return nullptr; } public: std::string GetTypeName() const final; // nested types ---------------------------------------------------- typedef TraceConfig_TriggerConfig_Trigger Trigger; typedef TraceConfig_TriggerConfig_TriggerMode TriggerMode; static constexpr TriggerMode UNSPECIFIED = TraceConfig_TriggerConfig_TriggerMode_UNSPECIFIED; static constexpr TriggerMode START_TRACING = TraceConfig_TriggerConfig_TriggerMode_START_TRACING; static constexpr TriggerMode STOP_TRACING = TraceConfig_TriggerConfig_TriggerMode_STOP_TRACING; static inline bool TriggerMode_IsValid(int value) { return TraceConfig_TriggerConfig_TriggerMode_IsValid(value); } static constexpr TriggerMode TriggerMode_MIN = TraceConfig_TriggerConfig_TriggerMode_TriggerMode_MIN; static constexpr TriggerMode TriggerMode_MAX = TraceConfig_TriggerConfig_TriggerMode_TriggerMode_MAX; static constexpr int TriggerMode_ARRAYSIZE = TraceConfig_TriggerConfig_TriggerMode_TriggerMode_ARRAYSIZE; template<typename T> static inline const std::string& TriggerMode_Name(T enum_t_value) { static_assert(::std::is_same<T, TriggerMode>::value || ::std::is_integral<T>::value, "Incorrect type passed to function TriggerMode_Name."); return TraceConfig_TriggerConfig_TriggerMode_Name(enum_t_value); } static inline bool TriggerMode_Parse(const std::string& name, TriggerMode* value) { return TraceConfig_TriggerConfig_TriggerMode_Parse(name, value); } // accessors ------------------------------------------------------- enum : int { kTriggersFieldNumber = 2, kTriggerModeFieldNumber = 1, kTriggerTimeoutMsFieldNumber = 3, }; // repeated .perfetto.protos.TraceConfig.TriggerConfig.Trigger triggers = 2; int triggers_size() const; void clear_triggers(); ::perfetto::protos::TraceConfig_TriggerConfig_Trigger* mutable_triggers(int index); ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::perfetto::protos::TraceConfig_TriggerConfig_Trigger >* mutable_triggers(); const ::perfetto::protos::TraceConfig_TriggerConfig_Trigger& triggers(int index) const; ::perfetto::protos::TraceConfig_TriggerConfig_Trigger* add_triggers(); const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::perfetto::protos::TraceConfig_TriggerConfig_Trigger >& triggers() const; // optional .perfetto.protos.TraceConfig.TriggerConfig.TriggerMode trigger_mode = 1; bool has_trigger_mode() const; void clear_trigger_mode(); ::perfetto::protos::TraceConfig_TriggerConfig_TriggerMode trigger_mode() const; void set_trigger_mode(::perfetto::protos::TraceConfig_TriggerConfig_TriggerMode value); // optional uint32 trigger_timeout_ms = 3; bool has_trigger_timeout_ms() const; void clear_trigger_timeout_ms(); ::PROTOBUF_NAMESPACE_ID::uint32 trigger_timeout_ms() const; void set_trigger_timeout_ms(::PROTOBUF_NAMESPACE_ID::uint32 value); // @@protoc_insertion_point(class_scope:perfetto.protos.TraceConfig.TriggerConfig) private: class _Internal; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArenaLite _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::perfetto::protos::TraceConfig_TriggerConfig_Trigger > triggers_; int trigger_mode_; ::PROTOBUF_NAMESPACE_ID::uint32 trigger_timeout_ms_; friend struct ::TableStruct_protos_2fperfetto_2fconfig_2ftrace_5fconfig_2eproto; }; // ------------------------------------------------------------------- class TraceConfig_IncrementalStateConfig : public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:perfetto.protos.TraceConfig.IncrementalStateConfig) */ { public: TraceConfig_IncrementalStateConfig(); virtual ~TraceConfig_IncrementalStateConfig(); TraceConfig_IncrementalStateConfig(const TraceConfig_IncrementalStateConfig& from); TraceConfig_IncrementalStateConfig(TraceConfig_IncrementalStateConfig&& from) noexcept : TraceConfig_IncrementalStateConfig() { *this = ::std::move(from); } inline TraceConfig_IncrementalStateConfig& operator=(const TraceConfig_IncrementalStateConfig& from) { CopyFrom(from); return *this; } inline TraceConfig_IncrementalStateConfig& operator=(TraceConfig_IncrementalStateConfig&& from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } return *this; } inline const std::string& unknown_fields() const { return _internal_metadata_.unknown_fields(); } inline std::string* mutable_unknown_fields() { return _internal_metadata_.mutable_unknown_fields(); } static const TraceConfig_IncrementalStateConfig& default_instance(); static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const TraceConfig_IncrementalStateConfig* internal_default_instance() { return reinterpret_cast<const TraceConfig_IncrementalStateConfig*>( &_TraceConfig_IncrementalStateConfig_default_instance_); } static constexpr int kIndexInFileMessages = 8; friend void swap(TraceConfig_IncrementalStateConfig& a, TraceConfig_IncrementalStateConfig& b) { a.Swap(&b); } inline void Swap(TraceConfig_IncrementalStateConfig* other) { if (other == this) return; InternalSwap(other); } // implements Message ---------------------------------------------- inline TraceConfig_IncrementalStateConfig* New() const final { return CreateMaybeMessage<TraceConfig_IncrementalStateConfig>(nullptr); } TraceConfig_IncrementalStateConfig* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage<TraceConfig_IncrementalStateConfig>(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const TraceConfig_IncrementalStateConfig& from); void MergeFrom(const TraceConfig_IncrementalStateConfig& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; #else bool MergePartialFromCodedStream( ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER void SerializeWithCachedSizes( ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; void DiscardUnknownFields(); int GetCachedSize() const final { return _cached_size_.Get(); } private: inline void SharedCtor(); inline void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(TraceConfig_IncrementalStateConfig* other); friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "perfetto.protos.TraceConfig.IncrementalStateConfig"; } private: inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { return nullptr; } inline void* MaybeArenaPtr() const { return nullptr; } public: std::string GetTypeName() const final; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- enum : int { kClearPeriodMsFieldNumber = 1, }; // optional uint32 clear_period_ms = 1; bool has_clear_period_ms() const; void clear_clear_period_ms(); ::PROTOBUF_NAMESPACE_ID::uint32 clear_period_ms() const; void set_clear_period_ms(::PROTOBUF_NAMESPACE_ID::uint32 value); // @@protoc_insertion_point(class_scope:perfetto.protos.TraceConfig.IncrementalStateConfig) private: class _Internal; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArenaLite _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; ::PROTOBUF_NAMESPACE_ID::uint32 clear_period_ms_; friend struct ::TableStruct_protos_2fperfetto_2fconfig_2ftrace_5fconfig_2eproto; }; // ------------------------------------------------------------------- class TraceConfig_IncidentReportConfig : public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:perfetto.protos.TraceConfig.IncidentReportConfig) */ { public: TraceConfig_IncidentReportConfig(); virtual ~TraceConfig_IncidentReportConfig(); TraceConfig_IncidentReportConfig(const TraceConfig_IncidentReportConfig& from); TraceConfig_IncidentReportConfig(TraceConfig_IncidentReportConfig&& from) noexcept : TraceConfig_IncidentReportConfig() { *this = ::std::move(from); } inline TraceConfig_IncidentReportConfig& operator=(const TraceConfig_IncidentReportConfig& from) { CopyFrom(from); return *this; } inline TraceConfig_IncidentReportConfig& operator=(TraceConfig_IncidentReportConfig&& from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } return *this; } inline const std::string& unknown_fields() const { return _internal_metadata_.unknown_fields(); } inline std::string* mutable_unknown_fields() { return _internal_metadata_.mutable_unknown_fields(); } static const TraceConfig_IncidentReportConfig& default_instance(); static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const TraceConfig_IncidentReportConfig* internal_default_instance() { return reinterpret_cast<const TraceConfig_IncidentReportConfig*>( &_TraceConfig_IncidentReportConfig_default_instance_); } static constexpr int kIndexInFileMessages = 9; friend void swap(TraceConfig_IncidentReportConfig& a, TraceConfig_IncidentReportConfig& b) { a.Swap(&b); } inline void Swap(TraceConfig_IncidentReportConfig* other) { if (other == this) return; InternalSwap(other); } // implements Message ---------------------------------------------- inline TraceConfig_IncidentReportConfig* New() const final { return CreateMaybeMessage<TraceConfig_IncidentReportConfig>(nullptr); } TraceConfig_IncidentReportConfig* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage<TraceConfig_IncidentReportConfig>(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const TraceConfig_IncidentReportConfig& from); void MergeFrom(const TraceConfig_IncidentReportConfig& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; #else bool MergePartialFromCodedStream( ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER void SerializeWithCachedSizes( ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; void DiscardUnknownFields(); int GetCachedSize() const final { return _cached_size_.Get(); } private: inline void SharedCtor(); inline void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(TraceConfig_IncidentReportConfig* other); friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "perfetto.protos.TraceConfig.IncidentReportConfig"; } private: inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { return nullptr; } inline void* MaybeArenaPtr() const { return nullptr; } public: std::string GetTypeName() const final; // nested types ---------------------------------------------------- // accessors ------------------------------------------------------- enum : int { kDestinationPackageFieldNumber = 1, kDestinationClassFieldNumber = 2, kPrivacyLevelFieldNumber = 3, kSkipDropboxFieldNumber = 4, }; // optional string destination_package = 1; bool has_destination_package() const; void clear_destination_package(); const std::string& destination_package() const; void set_destination_package(const std::string& value); void set_destination_package(std::string&& value); void set_destination_package(const char* value); void set_destination_package(const char* value, size_t size); std::string* mutable_destination_package(); std::string* release_destination_package(); void set_allocated_destination_package(std::string* destination_package); // optional string destination_class = 2; bool has_destination_class() const; void clear_destination_class(); const std::string& destination_class() const; void set_destination_class(const std::string& value); void set_destination_class(std::string&& value); void set_destination_class(const char* value); void set_destination_class(const char* value, size_t size); std::string* mutable_destination_class(); std::string* release_destination_class(); void set_allocated_destination_class(std::string* destination_class); // optional int32 privacy_level = 3; bool has_privacy_level() const; void clear_privacy_level(); ::PROTOBUF_NAMESPACE_ID::int32 privacy_level() const; void set_privacy_level(::PROTOBUF_NAMESPACE_ID::int32 value); // optional bool skip_dropbox = 4; bool has_skip_dropbox() const; void clear_skip_dropbox(); bool skip_dropbox() const; void set_skip_dropbox(bool value); // @@protoc_insertion_point(class_scope:perfetto.protos.TraceConfig.IncidentReportConfig) private: class _Internal; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArenaLite _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr destination_package_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr destination_class_; ::PROTOBUF_NAMESPACE_ID::int32 privacy_level_; bool skip_dropbox_; friend struct ::TableStruct_protos_2fperfetto_2fconfig_2ftrace_5fconfig_2eproto; }; // ------------------------------------------------------------------- class TraceConfig : public ::PROTOBUF_NAMESPACE_ID::MessageLite /* @@protoc_insertion_point(class_definition:perfetto.protos.TraceConfig) */ { public: TraceConfig(); virtual ~TraceConfig(); TraceConfig(const TraceConfig& from); TraceConfig(TraceConfig&& from) noexcept : TraceConfig() { *this = ::std::move(from); } inline TraceConfig& operator=(const TraceConfig& from) { CopyFrom(from); return *this; } inline TraceConfig& operator=(TraceConfig&& from) noexcept { if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) { if (this != &from) InternalSwap(&from); } else { CopyFrom(from); } return *this; } inline const std::string& unknown_fields() const { return _internal_metadata_.unknown_fields(); } inline std::string* mutable_unknown_fields() { return _internal_metadata_.mutable_unknown_fields(); } static const TraceConfig& default_instance(); static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY static inline const TraceConfig* internal_default_instance() { return reinterpret_cast<const TraceConfig*>( &_TraceConfig_default_instance_); } static constexpr int kIndexInFileMessages = 10; friend void swap(TraceConfig& a, TraceConfig& b) { a.Swap(&b); } inline void Swap(TraceConfig* other) { if (other == this) return; InternalSwap(other); } // implements Message ---------------------------------------------- inline TraceConfig* New() const final { return CreateMaybeMessage<TraceConfig>(nullptr); } TraceConfig* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { return CreateMaybeMessage<TraceConfig>(arena); } void CheckTypeAndMergeFrom(const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) final; void CopyFrom(const TraceConfig& from); void MergeFrom(const TraceConfig& from); PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; bool IsInitialized() const final; size_t ByteSizeLong() const final; #if GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; #else bool MergePartialFromCodedStream( ::PROTOBUF_NAMESPACE_ID::io::CodedInputStream* input) final; #endif // GOOGLE_PROTOBUF_ENABLE_EXPERIMENTAL_PARSER void SerializeWithCachedSizes( ::PROTOBUF_NAMESPACE_ID::io::CodedOutputStream* output) const final; void DiscardUnknownFields(); int GetCachedSize() const final { return _cached_size_.Get(); } private: inline void SharedCtor(); inline void SharedDtor(); void SetCachedSize(int size) const; void InternalSwap(TraceConfig* other); friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { return "perfetto.protos.TraceConfig"; } private: inline ::PROTOBUF_NAMESPACE_ID::Arena* GetArenaNoVirtual() const { return nullptr; } inline void* MaybeArenaPtr() const { return nullptr; } public: std::string GetTypeName() const final; // nested types ---------------------------------------------------- typedef TraceConfig_BufferConfig BufferConfig; typedef TraceConfig_DataSource DataSource; typedef TraceConfig_BuiltinDataSource BuiltinDataSource; typedef TraceConfig_ProducerConfig ProducerConfig; typedef TraceConfig_StatsdMetadata StatsdMetadata; typedef TraceConfig_GuardrailOverrides GuardrailOverrides; typedef TraceConfig_TriggerConfig TriggerConfig; typedef TraceConfig_IncrementalStateConfig IncrementalStateConfig; typedef TraceConfig_IncidentReportConfig IncidentReportConfig; typedef TraceConfig_LockdownModeOperation LockdownModeOperation; static constexpr LockdownModeOperation LOCKDOWN_UNCHANGED = TraceConfig_LockdownModeOperation_LOCKDOWN_UNCHANGED; static constexpr LockdownModeOperation LOCKDOWN_CLEAR = TraceConfig_LockdownModeOperation_LOCKDOWN_CLEAR; static constexpr LockdownModeOperation LOCKDOWN_SET = TraceConfig_LockdownModeOperation_LOCKDOWN_SET; static inline bool LockdownModeOperation_IsValid(int value) { return TraceConfig_LockdownModeOperation_IsValid(value); } static constexpr LockdownModeOperation LockdownModeOperation_MIN = TraceConfig_LockdownModeOperation_LockdownModeOperation_MIN; static constexpr LockdownModeOperation LockdownModeOperation_MAX = TraceConfig_LockdownModeOperation_LockdownModeOperation_MAX; static constexpr int LockdownModeOperation_ARRAYSIZE = TraceConfig_LockdownModeOperation_LockdownModeOperation_ARRAYSIZE; template<typename T> static inline const std::string& LockdownModeOperation_Name(T enum_t_value) { static_assert(::std::is_same<T, LockdownModeOperation>::value || ::std::is_integral<T>::value, "Incorrect type passed to function LockdownModeOperation_Name."); return TraceConfig_LockdownModeOperation_Name(enum_t_value); } static inline bool LockdownModeOperation_Parse(const std::string& name, LockdownModeOperation* value) { return TraceConfig_LockdownModeOperation_Parse(name, value); } typedef TraceConfig_CompressionType CompressionType; static constexpr CompressionType COMPRESSION_TYPE_UNSPECIFIED = TraceConfig_CompressionType_COMPRESSION_TYPE_UNSPECIFIED; static constexpr CompressionType COMPRESSION_TYPE_DEFLATE = TraceConfig_CompressionType_COMPRESSION_TYPE_DEFLATE; static inline bool CompressionType_IsValid(int value) { return TraceConfig_CompressionType_IsValid(value); } static constexpr CompressionType CompressionType_MIN = TraceConfig_CompressionType_CompressionType_MIN; static constexpr CompressionType CompressionType_MAX = TraceConfig_CompressionType_CompressionType_MAX; static constexpr int CompressionType_ARRAYSIZE = TraceConfig_CompressionType_CompressionType_ARRAYSIZE; template<typename T> static inline const std::string& CompressionType_Name(T enum_t_value) { static_assert(::std::is_same<T, CompressionType>::value || ::std::is_integral<T>::value, "Incorrect type passed to function CompressionType_Name."); return TraceConfig_CompressionType_Name(enum_t_value); } static inline bool CompressionType_Parse(const std::string& name, CompressionType* value) { return TraceConfig_CompressionType_Parse(name, value); } // accessors ------------------------------------------------------- enum : int { kBuffersFieldNumber = 1, kDataSourcesFieldNumber = 2, kProducersFieldNumber = 6, kActivateTriggersFieldNumber = 18, kUniqueSessionNameFieldNumber = 22, kOutputPathFieldNumber = 29, kStatsdMetadataFieldNumber = 7, kGuardrailOverridesFieldNumber = 11, kTriggerConfigFieldNumber = 17, kBuiltinDataSourcesFieldNumber = 20, kIncrementalStateConfigFieldNumber = 21, kIncidentReportConfigFieldNumber = 25, kDurationMsFieldNumber = 3, kLockdownModeFieldNumber = 5, kFileWritePeriodMsFieldNumber = 9, kEnableExtraGuardrailsFieldNumber = 4, kWriteIntoFileFieldNumber = 8, kDeferredStartFieldNumber = 12, kNotifyTraceurFieldNumber = 16, kMaxFileSizeBytesFieldNumber = 10, kFlushPeriodMsFieldNumber = 13, kFlushTimeoutMsFieldNumber = 14, kAllowUserBuildTracingFieldNumber = 19, kDataSourceStopTimeoutMsFieldNumber = 23, kTraceUuidMsbFieldNumber = 27, kCompressionTypeFieldNumber = 24, kBugreportScoreFieldNumber = 30, kTraceUuidLsbFieldNumber = 28, }; // repeated .perfetto.protos.TraceConfig.BufferConfig buffers = 1; int buffers_size() const; void clear_buffers(); ::perfetto::protos::TraceConfig_BufferConfig* mutable_buffers(int index); ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::perfetto::protos::TraceConfig_BufferConfig >* mutable_buffers(); const ::perfetto::protos::TraceConfig_BufferConfig& buffers(int index) const; ::perfetto::protos::TraceConfig_BufferConfig* add_buffers(); const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::perfetto::protos::TraceConfig_BufferConfig >& buffers() const; // repeated .perfetto.protos.TraceConfig.DataSource data_sources = 2; int data_sources_size() const; void clear_data_sources(); ::perfetto::protos::TraceConfig_DataSource* mutable_data_sources(int index); ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::perfetto::protos::TraceConfig_DataSource >* mutable_data_sources(); const ::perfetto::protos::TraceConfig_DataSource& data_sources(int index) const; ::perfetto::protos::TraceConfig_DataSource* add_data_sources(); const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::perfetto::protos::TraceConfig_DataSource >& data_sources() const; // repeated .perfetto.protos.TraceConfig.ProducerConfig producers = 6; int producers_size() const; void clear_producers(); ::perfetto::protos::TraceConfig_ProducerConfig* mutable_producers(int index); ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::perfetto::protos::TraceConfig_ProducerConfig >* mutable_producers(); const ::perfetto::protos::TraceConfig_ProducerConfig& producers(int index) const; ::perfetto::protos::TraceConfig_ProducerConfig* add_producers(); const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::perfetto::protos::TraceConfig_ProducerConfig >& producers() const; // repeated string activate_triggers = 18; int activate_triggers_size() const; void clear_activate_triggers(); const std::string& activate_triggers(int index) const; std::string* mutable_activate_triggers(int index); void set_activate_triggers(int index, const std::string& value); void set_activate_triggers(int index, std::string&& value); void set_activate_triggers(int index, const char* value); void set_activate_triggers(int index, const char* value, size_t size); std::string* add_activate_triggers(); void add_activate_triggers(const std::string& value); void add_activate_triggers(std::string&& value); void add_activate_triggers(const char* value); void add_activate_triggers(const char* value, size_t size); const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& activate_triggers() const; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* mutable_activate_triggers(); // optional string unique_session_name = 22; bool has_unique_session_name() const; void clear_unique_session_name(); const std::string& unique_session_name() const; void set_unique_session_name(const std::string& value); void set_unique_session_name(std::string&& value); void set_unique_session_name(const char* value); void set_unique_session_name(const char* value, size_t size); std::string* mutable_unique_session_name(); std::string* release_unique_session_name(); void set_allocated_unique_session_name(std::string* unique_session_name); // optional string output_path = 29; bool has_output_path() const; void clear_output_path(); const std::string& output_path() const; void set_output_path(const std::string& value); void set_output_path(std::string&& value); void set_output_path(const char* value); void set_output_path(const char* value, size_t size); std::string* mutable_output_path(); std::string* release_output_path(); void set_allocated_output_path(std::string* output_path); // optional .perfetto.protos.TraceConfig.StatsdMetadata statsd_metadata = 7; bool has_statsd_metadata() const; void clear_statsd_metadata(); const ::perfetto::protos::TraceConfig_StatsdMetadata& statsd_metadata() const; ::perfetto::protos::TraceConfig_StatsdMetadata* release_statsd_metadata(); ::perfetto::protos::TraceConfig_StatsdMetadata* mutable_statsd_metadata(); void set_allocated_statsd_metadata(::perfetto::protos::TraceConfig_StatsdMetadata* statsd_metadata); // optional .perfetto.protos.TraceConfig.GuardrailOverrides guardrail_overrides = 11; bool has_guardrail_overrides() const; void clear_guardrail_overrides(); const ::perfetto::protos::TraceConfig_GuardrailOverrides& guardrail_overrides() const; ::perfetto::protos::TraceConfig_GuardrailOverrides* release_guardrail_overrides(); ::perfetto::protos::TraceConfig_GuardrailOverrides* mutable_guardrail_overrides(); void set_allocated_guardrail_overrides(::perfetto::protos::TraceConfig_GuardrailOverrides* guardrail_overrides); // optional .perfetto.protos.TraceConfig.TriggerConfig trigger_config = 17; bool has_trigger_config() const; void clear_trigger_config(); const ::perfetto::protos::TraceConfig_TriggerConfig& trigger_config() const; ::perfetto::protos::TraceConfig_TriggerConfig* release_trigger_config(); ::perfetto::protos::TraceConfig_TriggerConfig* mutable_trigger_config(); void set_allocated_trigger_config(::perfetto::protos::TraceConfig_TriggerConfig* trigger_config); // optional .perfetto.protos.TraceConfig.BuiltinDataSource builtin_data_sources = 20; bool has_builtin_data_sources() const; void clear_builtin_data_sources(); const ::perfetto::protos::TraceConfig_BuiltinDataSource& builtin_data_sources() const; ::perfetto::protos::TraceConfig_BuiltinDataSource* release_builtin_data_sources(); ::perfetto::protos::TraceConfig_BuiltinDataSource* mutable_builtin_data_sources(); void set_allocated_builtin_data_sources(::perfetto::protos::TraceConfig_BuiltinDataSource* builtin_data_sources); // optional .perfetto.protos.TraceConfig.IncrementalStateConfig incremental_state_config = 21; bool has_incremental_state_config() const; void clear_incremental_state_config(); const ::perfetto::protos::TraceConfig_IncrementalStateConfig& incremental_state_config() const; ::perfetto::protos::TraceConfig_IncrementalStateConfig* release_incremental_state_config(); ::perfetto::protos::TraceConfig_IncrementalStateConfig* mutable_incremental_state_config(); void set_allocated_incremental_state_config(::perfetto::protos::TraceConfig_IncrementalStateConfig* incremental_state_config); // optional .perfetto.protos.TraceConfig.IncidentReportConfig incident_report_config = 25; bool has_incident_report_config() const; void clear_incident_report_config(); const ::perfetto::protos::TraceConfig_IncidentReportConfig& incident_report_config() const; ::perfetto::protos::TraceConfig_IncidentReportConfig* release_incident_report_config(); ::perfetto::protos::TraceConfig_IncidentReportConfig* mutable_incident_report_config(); void set_allocated_incident_report_config(::perfetto::protos::TraceConfig_IncidentReportConfig* incident_report_config); // optional uint32 duration_ms = 3; bool has_duration_ms() const; void clear_duration_ms(); ::PROTOBUF_NAMESPACE_ID::uint32 duration_ms() const; void set_duration_ms(::PROTOBUF_NAMESPACE_ID::uint32 value); // optional .perfetto.protos.TraceConfig.LockdownModeOperation lockdown_mode = 5; bool has_lockdown_mode() const; void clear_lockdown_mode(); ::perfetto::protos::TraceConfig_LockdownModeOperation lockdown_mode() const; void set_lockdown_mode(::perfetto::protos::TraceConfig_LockdownModeOperation value); // optional uint32 file_write_period_ms = 9; bool has_file_write_period_ms() const; void clear_file_write_period_ms(); ::PROTOBUF_NAMESPACE_ID::uint32 file_write_period_ms() const; void set_file_write_period_ms(::PROTOBUF_NAMESPACE_ID::uint32 value); // optional bool enable_extra_guardrails = 4; bool has_enable_extra_guardrails() const; void clear_enable_extra_guardrails(); bool enable_extra_guardrails() const; void set_enable_extra_guardrails(bool value); // optional bool write_into_file = 8; bool has_write_into_file() const; void clear_write_into_file(); bool write_into_file() const; void set_write_into_file(bool value); // optional bool deferred_start = 12; bool has_deferred_start() const; void clear_deferred_start(); bool deferred_start() const; void set_deferred_start(bool value); // optional bool notify_traceur = 16; bool has_notify_traceur() const; void clear_notify_traceur(); bool notify_traceur() const; void set_notify_traceur(bool value); // optional uint64 max_file_size_bytes = 10; bool has_max_file_size_bytes() const; void clear_max_file_size_bytes(); ::PROTOBUF_NAMESPACE_ID::uint64 max_file_size_bytes() const; void set_max_file_size_bytes(::PROTOBUF_NAMESPACE_ID::uint64 value); // optional uint32 flush_period_ms = 13; bool has_flush_period_ms() const; void clear_flush_period_ms(); ::PROTOBUF_NAMESPACE_ID::uint32 flush_period_ms() const; void set_flush_period_ms(::PROTOBUF_NAMESPACE_ID::uint32 value); // optional uint32 flush_timeout_ms = 14; bool has_flush_timeout_ms() const; void clear_flush_timeout_ms(); ::PROTOBUF_NAMESPACE_ID::uint32 flush_timeout_ms() const; void set_flush_timeout_ms(::PROTOBUF_NAMESPACE_ID::uint32 value); // optional bool allow_user_build_tracing = 19; bool has_allow_user_build_tracing() const; void clear_allow_user_build_tracing(); bool allow_user_build_tracing() const; void set_allow_user_build_tracing(bool value); // optional uint32 data_source_stop_timeout_ms = 23; bool has_data_source_stop_timeout_ms() const; void clear_data_source_stop_timeout_ms(); ::PROTOBUF_NAMESPACE_ID::uint32 data_source_stop_timeout_ms() const; void set_data_source_stop_timeout_ms(::PROTOBUF_NAMESPACE_ID::uint32 value); // optional int64 trace_uuid_msb = 27; bool has_trace_uuid_msb() const; void clear_trace_uuid_msb(); ::PROTOBUF_NAMESPACE_ID::int64 trace_uuid_msb() const; void set_trace_uuid_msb(::PROTOBUF_NAMESPACE_ID::int64 value); // optional .perfetto.protos.TraceConfig.CompressionType compression_type = 24; bool has_compression_type() const; void clear_compression_type(); ::perfetto::protos::TraceConfig_CompressionType compression_type() const; void set_compression_type(::perfetto::protos::TraceConfig_CompressionType value); // optional int32 bugreport_score = 30; bool has_bugreport_score() const; void clear_bugreport_score(); ::PROTOBUF_NAMESPACE_ID::int32 bugreport_score() const; void set_bugreport_score(::PROTOBUF_NAMESPACE_ID::int32 value); // optional int64 trace_uuid_lsb = 28; bool has_trace_uuid_lsb() const; void clear_trace_uuid_lsb(); ::PROTOBUF_NAMESPACE_ID::int64 trace_uuid_lsb() const; void set_trace_uuid_lsb(::PROTOBUF_NAMESPACE_ID::int64 value); // @@protoc_insertion_point(class_scope:perfetto.protos.TraceConfig) private: class _Internal; ::PROTOBUF_NAMESPACE_ID::internal::InternalMetadataWithArenaLite _internal_metadata_; ::PROTOBUF_NAMESPACE_ID::internal::HasBits<1> _has_bits_; mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::perfetto::protos::TraceConfig_BufferConfig > buffers_; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::perfetto::protos::TraceConfig_DataSource > data_sources_; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::perfetto::protos::TraceConfig_ProducerConfig > producers_; ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string> activate_triggers_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr unique_session_name_; ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr output_path_; ::perfetto::protos::TraceConfig_StatsdMetadata* statsd_metadata_; ::perfetto::protos::TraceConfig_GuardrailOverrides* guardrail_overrides_; ::perfetto::protos::TraceConfig_TriggerConfig* trigger_config_; ::perfetto::protos::TraceConfig_BuiltinDataSource* builtin_data_sources_; ::perfetto::protos::TraceConfig_IncrementalStateConfig* incremental_state_config_; ::perfetto::protos::TraceConfig_IncidentReportConfig* incident_report_config_; ::PROTOBUF_NAMESPACE_ID::uint32 duration_ms_; int lockdown_mode_; ::PROTOBUF_NAMESPACE_ID::uint32 file_write_period_ms_; bool enable_extra_guardrails_; bool write_into_file_; bool deferred_start_; bool notify_traceur_; ::PROTOBUF_NAMESPACE_ID::uint64 max_file_size_bytes_; ::PROTOBUF_NAMESPACE_ID::uint32 flush_period_ms_; ::PROTOBUF_NAMESPACE_ID::uint32 flush_timeout_ms_; bool allow_user_build_tracing_; ::PROTOBUF_NAMESPACE_ID::uint32 data_source_stop_timeout_ms_; ::PROTOBUF_NAMESPACE_ID::int64 trace_uuid_msb_; int compression_type_; ::PROTOBUF_NAMESPACE_ID::int32 bugreport_score_; ::PROTOBUF_NAMESPACE_ID::int64 trace_uuid_lsb_; friend struct ::TableStruct_protos_2fperfetto_2fconfig_2ftrace_5fconfig_2eproto; }; // =================================================================== // =================================================================== #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstrict-aliasing" #endif // __GNUC__ // TraceConfig_BufferConfig // optional uint32 size_kb = 1; inline bool TraceConfig_BufferConfig::has_size_kb() const { return (_has_bits_[0] & 0x00000001u) != 0; } inline void TraceConfig_BufferConfig::clear_size_kb() { size_kb_ = 0u; _has_bits_[0] &= ~0x00000001u; } inline ::PROTOBUF_NAMESPACE_ID::uint32 TraceConfig_BufferConfig::size_kb() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.BufferConfig.size_kb) return size_kb_; } inline void TraceConfig_BufferConfig::set_size_kb(::PROTOBUF_NAMESPACE_ID::uint32 value) { _has_bits_[0] |= 0x00000001u; size_kb_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.BufferConfig.size_kb) } // optional .perfetto.protos.TraceConfig.BufferConfig.FillPolicy fill_policy = 4; inline bool TraceConfig_BufferConfig::has_fill_policy() const { return (_has_bits_[0] & 0x00000002u) != 0; } inline void TraceConfig_BufferConfig::clear_fill_policy() { fill_policy_ = 0; _has_bits_[0] &= ~0x00000002u; } inline ::perfetto::protos::TraceConfig_BufferConfig_FillPolicy TraceConfig_BufferConfig::fill_policy() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.BufferConfig.fill_policy) return static_cast< ::perfetto::protos::TraceConfig_BufferConfig_FillPolicy >(fill_policy_); } inline void TraceConfig_BufferConfig::set_fill_policy(::perfetto::protos::TraceConfig_BufferConfig_FillPolicy value) { assert(::perfetto::protos::TraceConfig_BufferConfig_FillPolicy_IsValid(value)); _has_bits_[0] |= 0x00000002u; fill_policy_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.BufferConfig.fill_policy) } // ------------------------------------------------------------------- // TraceConfig_DataSource // optional .perfetto.protos.DataSourceConfig config = 1; inline bool TraceConfig_DataSource::has_config() const { return (_has_bits_[0] & 0x00000001u) != 0; } inline const ::perfetto::protos::DataSourceConfig& TraceConfig_DataSource::config() const { const ::perfetto::protos::DataSourceConfig* p = config_; // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.DataSource.config) return p != nullptr ? *p : *reinterpret_cast<const ::perfetto::protos::DataSourceConfig*>( &::perfetto::protos::_DataSourceConfig_default_instance_); } inline ::perfetto::protos::DataSourceConfig* TraceConfig_DataSource::release_config() { // @@protoc_insertion_point(field_release:perfetto.protos.TraceConfig.DataSource.config) _has_bits_[0] &= ~0x00000001u; ::perfetto::protos::DataSourceConfig* temp = config_; config_ = nullptr; return temp; } inline ::perfetto::protos::DataSourceConfig* TraceConfig_DataSource::mutable_config() { _has_bits_[0] |= 0x00000001u; if (config_ == nullptr) { auto* p = CreateMaybeMessage<::perfetto::protos::DataSourceConfig>(GetArenaNoVirtual()); config_ = p; } // @@protoc_insertion_point(field_mutable:perfetto.protos.TraceConfig.DataSource.config) return config_; } inline void TraceConfig_DataSource::set_allocated_config(::perfetto::protos::DataSourceConfig* config) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); if (message_arena == nullptr) { delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(config_); } if (config) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; if (message_arena != submessage_arena) { config = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, config, submessage_arena); } _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; } config_ = config; // @@protoc_insertion_point(field_set_allocated:perfetto.protos.TraceConfig.DataSource.config) } // repeated string producer_name_filter = 2; inline int TraceConfig_DataSource::producer_name_filter_size() const { return producer_name_filter_.size(); } inline void TraceConfig_DataSource::clear_producer_name_filter() { producer_name_filter_.Clear(); } inline const std::string& TraceConfig_DataSource::producer_name_filter(int index) const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.DataSource.producer_name_filter) return producer_name_filter_.Get(index); } inline std::string* TraceConfig_DataSource::mutable_producer_name_filter(int index) { // @@protoc_insertion_point(field_mutable:perfetto.protos.TraceConfig.DataSource.producer_name_filter) return producer_name_filter_.Mutable(index); } inline void TraceConfig_DataSource::set_producer_name_filter(int index, const std::string& value) { // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.DataSource.producer_name_filter) producer_name_filter_.Mutable(index)->assign(value); } inline void TraceConfig_DataSource::set_producer_name_filter(int index, std::string&& value) { // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.DataSource.producer_name_filter) producer_name_filter_.Mutable(index)->assign(std::move(value)); } inline void TraceConfig_DataSource::set_producer_name_filter(int index, const char* value) { GOOGLE_DCHECK(value != nullptr); producer_name_filter_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:perfetto.protos.TraceConfig.DataSource.producer_name_filter) } inline void TraceConfig_DataSource::set_producer_name_filter(int index, const char* value, size_t size) { producer_name_filter_.Mutable(index)->assign( reinterpret_cast<const char*>(value), size); // @@protoc_insertion_point(field_set_pointer:perfetto.protos.TraceConfig.DataSource.producer_name_filter) } inline std::string* TraceConfig_DataSource::add_producer_name_filter() { // @@protoc_insertion_point(field_add_mutable:perfetto.protos.TraceConfig.DataSource.producer_name_filter) return producer_name_filter_.Add(); } inline void TraceConfig_DataSource::add_producer_name_filter(const std::string& value) { producer_name_filter_.Add()->assign(value); // @@protoc_insertion_point(field_add:perfetto.protos.TraceConfig.DataSource.producer_name_filter) } inline void TraceConfig_DataSource::add_producer_name_filter(std::string&& value) { producer_name_filter_.Add(std::move(value)); // @@protoc_insertion_point(field_add:perfetto.protos.TraceConfig.DataSource.producer_name_filter) } inline void TraceConfig_DataSource::add_producer_name_filter(const char* value) { GOOGLE_DCHECK(value != nullptr); producer_name_filter_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:perfetto.protos.TraceConfig.DataSource.producer_name_filter) } inline void TraceConfig_DataSource::add_producer_name_filter(const char* value, size_t size) { producer_name_filter_.Add()->assign(reinterpret_cast<const char*>(value), size); // @@protoc_insertion_point(field_add_pointer:perfetto.protos.TraceConfig.DataSource.producer_name_filter) } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& TraceConfig_DataSource::producer_name_filter() const { // @@protoc_insertion_point(field_list:perfetto.protos.TraceConfig.DataSource.producer_name_filter) return producer_name_filter_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* TraceConfig_DataSource::mutable_producer_name_filter() { // @@protoc_insertion_point(field_mutable_list:perfetto.protos.TraceConfig.DataSource.producer_name_filter) return &producer_name_filter_; } // repeated string producer_name_regex_filter = 3; inline int TraceConfig_DataSource::producer_name_regex_filter_size() const { return producer_name_regex_filter_.size(); } inline void TraceConfig_DataSource::clear_producer_name_regex_filter() { producer_name_regex_filter_.Clear(); } inline const std::string& TraceConfig_DataSource::producer_name_regex_filter(int index) const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.DataSource.producer_name_regex_filter) return producer_name_regex_filter_.Get(index); } inline std::string* TraceConfig_DataSource::mutable_producer_name_regex_filter(int index) { // @@protoc_insertion_point(field_mutable:perfetto.protos.TraceConfig.DataSource.producer_name_regex_filter) return producer_name_regex_filter_.Mutable(index); } inline void TraceConfig_DataSource::set_producer_name_regex_filter(int index, const std::string& value) { // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.DataSource.producer_name_regex_filter) producer_name_regex_filter_.Mutable(index)->assign(value); } inline void TraceConfig_DataSource::set_producer_name_regex_filter(int index, std::string&& value) { // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.DataSource.producer_name_regex_filter) producer_name_regex_filter_.Mutable(index)->assign(std::move(value)); } inline void TraceConfig_DataSource::set_producer_name_regex_filter(int index, const char* value) { GOOGLE_DCHECK(value != nullptr); producer_name_regex_filter_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:perfetto.protos.TraceConfig.DataSource.producer_name_regex_filter) } inline void TraceConfig_DataSource::set_producer_name_regex_filter(int index, const char* value, size_t size) { producer_name_regex_filter_.Mutable(index)->assign( reinterpret_cast<const char*>(value), size); // @@protoc_insertion_point(field_set_pointer:perfetto.protos.TraceConfig.DataSource.producer_name_regex_filter) } inline std::string* TraceConfig_DataSource::add_producer_name_regex_filter() { // @@protoc_insertion_point(field_add_mutable:perfetto.protos.TraceConfig.DataSource.producer_name_regex_filter) return producer_name_regex_filter_.Add(); } inline void TraceConfig_DataSource::add_producer_name_regex_filter(const std::string& value) { producer_name_regex_filter_.Add()->assign(value); // @@protoc_insertion_point(field_add:perfetto.protos.TraceConfig.DataSource.producer_name_regex_filter) } inline void TraceConfig_DataSource::add_producer_name_regex_filter(std::string&& value) { producer_name_regex_filter_.Add(std::move(value)); // @@protoc_insertion_point(field_add:perfetto.protos.TraceConfig.DataSource.producer_name_regex_filter) } inline void TraceConfig_DataSource::add_producer_name_regex_filter(const char* value) { GOOGLE_DCHECK(value != nullptr); producer_name_regex_filter_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:perfetto.protos.TraceConfig.DataSource.producer_name_regex_filter) } inline void TraceConfig_DataSource::add_producer_name_regex_filter(const char* value, size_t size) { producer_name_regex_filter_.Add()->assign(reinterpret_cast<const char*>(value), size); // @@protoc_insertion_point(field_add_pointer:perfetto.protos.TraceConfig.DataSource.producer_name_regex_filter) } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& TraceConfig_DataSource::producer_name_regex_filter() const { // @@protoc_insertion_point(field_list:perfetto.protos.TraceConfig.DataSource.producer_name_regex_filter) return producer_name_regex_filter_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* TraceConfig_DataSource::mutable_producer_name_regex_filter() { // @@protoc_insertion_point(field_mutable_list:perfetto.protos.TraceConfig.DataSource.producer_name_regex_filter) return &producer_name_regex_filter_; } // ------------------------------------------------------------------- // TraceConfig_BuiltinDataSource // optional bool disable_clock_snapshotting = 1; inline bool TraceConfig_BuiltinDataSource::has_disable_clock_snapshotting() const { return (_has_bits_[0] & 0x00000001u) != 0; } inline void TraceConfig_BuiltinDataSource::clear_disable_clock_snapshotting() { disable_clock_snapshotting_ = false; _has_bits_[0] &= ~0x00000001u; } inline bool TraceConfig_BuiltinDataSource::disable_clock_snapshotting() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.BuiltinDataSource.disable_clock_snapshotting) return disable_clock_snapshotting_; } inline void TraceConfig_BuiltinDataSource::set_disable_clock_snapshotting(bool value) { _has_bits_[0] |= 0x00000001u; disable_clock_snapshotting_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.BuiltinDataSource.disable_clock_snapshotting) } // optional bool disable_trace_config = 2; inline bool TraceConfig_BuiltinDataSource::has_disable_trace_config() const { return (_has_bits_[0] & 0x00000002u) != 0; } inline void TraceConfig_BuiltinDataSource::clear_disable_trace_config() { disable_trace_config_ = false; _has_bits_[0] &= ~0x00000002u; } inline bool TraceConfig_BuiltinDataSource::disable_trace_config() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.BuiltinDataSource.disable_trace_config) return disable_trace_config_; } inline void TraceConfig_BuiltinDataSource::set_disable_trace_config(bool value) { _has_bits_[0] |= 0x00000002u; disable_trace_config_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.BuiltinDataSource.disable_trace_config) } // optional bool disable_system_info = 3; inline bool TraceConfig_BuiltinDataSource::has_disable_system_info() const { return (_has_bits_[0] & 0x00000004u) != 0; } inline void TraceConfig_BuiltinDataSource::clear_disable_system_info() { disable_system_info_ = false; _has_bits_[0] &= ~0x00000004u; } inline bool TraceConfig_BuiltinDataSource::disable_system_info() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.BuiltinDataSource.disable_system_info) return disable_system_info_; } inline void TraceConfig_BuiltinDataSource::set_disable_system_info(bool value) { _has_bits_[0] |= 0x00000004u; disable_system_info_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.BuiltinDataSource.disable_system_info) } // optional bool disable_service_events = 4; inline bool TraceConfig_BuiltinDataSource::has_disable_service_events() const { return (_has_bits_[0] & 0x00000008u) != 0; } inline void TraceConfig_BuiltinDataSource::clear_disable_service_events() { disable_service_events_ = false; _has_bits_[0] &= ~0x00000008u; } inline bool TraceConfig_BuiltinDataSource::disable_service_events() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.BuiltinDataSource.disable_service_events) return disable_service_events_; } inline void TraceConfig_BuiltinDataSource::set_disable_service_events(bool value) { _has_bits_[0] |= 0x00000008u; disable_service_events_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.BuiltinDataSource.disable_service_events) } // optional .perfetto.protos.BuiltinClock primary_trace_clock = 5; inline bool TraceConfig_BuiltinDataSource::has_primary_trace_clock() const { return (_has_bits_[0] & 0x00000010u) != 0; } inline void TraceConfig_BuiltinDataSource::clear_primary_trace_clock() { primary_trace_clock_ = 0; _has_bits_[0] &= ~0x00000010u; } inline ::perfetto::protos::BuiltinClock TraceConfig_BuiltinDataSource::primary_trace_clock() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.BuiltinDataSource.primary_trace_clock) return static_cast< ::perfetto::protos::BuiltinClock >(primary_trace_clock_); } inline void TraceConfig_BuiltinDataSource::set_primary_trace_clock(::perfetto::protos::BuiltinClock value) { assert(::perfetto::protos::BuiltinClock_IsValid(value)); _has_bits_[0] |= 0x00000010u; primary_trace_clock_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.BuiltinDataSource.primary_trace_clock) } // optional uint32 snapshot_interval_ms = 6; inline bool TraceConfig_BuiltinDataSource::has_snapshot_interval_ms() const { return (_has_bits_[0] & 0x00000020u) != 0; } inline void TraceConfig_BuiltinDataSource::clear_snapshot_interval_ms() { snapshot_interval_ms_ = 0u; _has_bits_[0] &= ~0x00000020u; } inline ::PROTOBUF_NAMESPACE_ID::uint32 TraceConfig_BuiltinDataSource::snapshot_interval_ms() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.BuiltinDataSource.snapshot_interval_ms) return snapshot_interval_ms_; } inline void TraceConfig_BuiltinDataSource::set_snapshot_interval_ms(::PROTOBUF_NAMESPACE_ID::uint32 value) { _has_bits_[0] |= 0x00000020u; snapshot_interval_ms_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.BuiltinDataSource.snapshot_interval_ms) } // ------------------------------------------------------------------- // TraceConfig_ProducerConfig // optional string producer_name = 1; inline bool TraceConfig_ProducerConfig::has_producer_name() const { return (_has_bits_[0] & 0x00000001u) != 0; } inline void TraceConfig_ProducerConfig::clear_producer_name() { producer_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); _has_bits_[0] &= ~0x00000001u; } inline const std::string& TraceConfig_ProducerConfig::producer_name() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.ProducerConfig.producer_name) return producer_name_.GetNoArena(); } inline void TraceConfig_ProducerConfig::set_producer_name(const std::string& value) { _has_bits_[0] |= 0x00000001u; producer_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.ProducerConfig.producer_name) } inline void TraceConfig_ProducerConfig::set_producer_name(std::string&& value) { _has_bits_[0] |= 0x00000001u; producer_name_.SetNoArena( &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); // @@protoc_insertion_point(field_set_rvalue:perfetto.protos.TraceConfig.ProducerConfig.producer_name) } inline void TraceConfig_ProducerConfig::set_producer_name(const char* value) { GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000001u; producer_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:perfetto.protos.TraceConfig.ProducerConfig.producer_name) } inline void TraceConfig_ProducerConfig::set_producer_name(const char* value, size_t size) { _has_bits_[0] |= 0x00000001u; producer_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(reinterpret_cast<const char*>(value), size)); // @@protoc_insertion_point(field_set_pointer:perfetto.protos.TraceConfig.ProducerConfig.producer_name) } inline std::string* TraceConfig_ProducerConfig::mutable_producer_name() { _has_bits_[0] |= 0x00000001u; // @@protoc_insertion_point(field_mutable:perfetto.protos.TraceConfig.ProducerConfig.producer_name) return producer_name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } inline std::string* TraceConfig_ProducerConfig::release_producer_name() { // @@protoc_insertion_point(field_release:perfetto.protos.TraceConfig.ProducerConfig.producer_name) if (!has_producer_name()) { return nullptr; } _has_bits_[0] &= ~0x00000001u; return producer_name_.ReleaseNonDefaultNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } inline void TraceConfig_ProducerConfig::set_allocated_producer_name(std::string* producer_name) { if (producer_name != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; } producer_name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), producer_name); // @@protoc_insertion_point(field_set_allocated:perfetto.protos.TraceConfig.ProducerConfig.producer_name) } // optional uint32 shm_size_kb = 2; inline bool TraceConfig_ProducerConfig::has_shm_size_kb() const { return (_has_bits_[0] & 0x00000002u) != 0; } inline void TraceConfig_ProducerConfig::clear_shm_size_kb() { shm_size_kb_ = 0u; _has_bits_[0] &= ~0x00000002u; } inline ::PROTOBUF_NAMESPACE_ID::uint32 TraceConfig_ProducerConfig::shm_size_kb() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.ProducerConfig.shm_size_kb) return shm_size_kb_; } inline void TraceConfig_ProducerConfig::set_shm_size_kb(::PROTOBUF_NAMESPACE_ID::uint32 value) { _has_bits_[0] |= 0x00000002u; shm_size_kb_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.ProducerConfig.shm_size_kb) } // optional uint32 page_size_kb = 3; inline bool TraceConfig_ProducerConfig::has_page_size_kb() const { return (_has_bits_[0] & 0x00000004u) != 0; } inline void TraceConfig_ProducerConfig::clear_page_size_kb() { page_size_kb_ = 0u; _has_bits_[0] &= ~0x00000004u; } inline ::PROTOBUF_NAMESPACE_ID::uint32 TraceConfig_ProducerConfig::page_size_kb() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.ProducerConfig.page_size_kb) return page_size_kb_; } inline void TraceConfig_ProducerConfig::set_page_size_kb(::PROTOBUF_NAMESPACE_ID::uint32 value) { _has_bits_[0] |= 0x00000004u; page_size_kb_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.ProducerConfig.page_size_kb) } // ------------------------------------------------------------------- // TraceConfig_StatsdMetadata // optional int64 triggering_alert_id = 1; inline bool TraceConfig_StatsdMetadata::has_triggering_alert_id() const { return (_has_bits_[0] & 0x00000001u) != 0; } inline void TraceConfig_StatsdMetadata::clear_triggering_alert_id() { triggering_alert_id_ = PROTOBUF_LONGLONG(0); _has_bits_[0] &= ~0x00000001u; } inline ::PROTOBUF_NAMESPACE_ID::int64 TraceConfig_StatsdMetadata::triggering_alert_id() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.StatsdMetadata.triggering_alert_id) return triggering_alert_id_; } inline void TraceConfig_StatsdMetadata::set_triggering_alert_id(::PROTOBUF_NAMESPACE_ID::int64 value) { _has_bits_[0] |= 0x00000001u; triggering_alert_id_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.StatsdMetadata.triggering_alert_id) } // optional int32 triggering_config_uid = 2; inline bool TraceConfig_StatsdMetadata::has_triggering_config_uid() const { return (_has_bits_[0] & 0x00000008u) != 0; } inline void TraceConfig_StatsdMetadata::clear_triggering_config_uid() { triggering_config_uid_ = 0; _has_bits_[0] &= ~0x00000008u; } inline ::PROTOBUF_NAMESPACE_ID::int32 TraceConfig_StatsdMetadata::triggering_config_uid() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.StatsdMetadata.triggering_config_uid) return triggering_config_uid_; } inline void TraceConfig_StatsdMetadata::set_triggering_config_uid(::PROTOBUF_NAMESPACE_ID::int32 value) { _has_bits_[0] |= 0x00000008u; triggering_config_uid_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.StatsdMetadata.triggering_config_uid) } // optional int64 triggering_config_id = 3; inline bool TraceConfig_StatsdMetadata::has_triggering_config_id() const { return (_has_bits_[0] & 0x00000002u) != 0; } inline void TraceConfig_StatsdMetadata::clear_triggering_config_id() { triggering_config_id_ = PROTOBUF_LONGLONG(0); _has_bits_[0] &= ~0x00000002u; } inline ::PROTOBUF_NAMESPACE_ID::int64 TraceConfig_StatsdMetadata::triggering_config_id() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.StatsdMetadata.triggering_config_id) return triggering_config_id_; } inline void TraceConfig_StatsdMetadata::set_triggering_config_id(::PROTOBUF_NAMESPACE_ID::int64 value) { _has_bits_[0] |= 0x00000002u; triggering_config_id_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.StatsdMetadata.triggering_config_id) } // optional int64 triggering_subscription_id = 4; inline bool TraceConfig_StatsdMetadata::has_triggering_subscription_id() const { return (_has_bits_[0] & 0x00000004u) != 0; } inline void TraceConfig_StatsdMetadata::clear_triggering_subscription_id() { triggering_subscription_id_ = PROTOBUF_LONGLONG(0); _has_bits_[0] &= ~0x00000004u; } inline ::PROTOBUF_NAMESPACE_ID::int64 TraceConfig_StatsdMetadata::triggering_subscription_id() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.StatsdMetadata.triggering_subscription_id) return triggering_subscription_id_; } inline void TraceConfig_StatsdMetadata::set_triggering_subscription_id(::PROTOBUF_NAMESPACE_ID::int64 value) { _has_bits_[0] |= 0x00000004u; triggering_subscription_id_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.StatsdMetadata.triggering_subscription_id) } // ------------------------------------------------------------------- // TraceConfig_GuardrailOverrides // optional uint64 max_upload_per_day_bytes = 1; inline bool TraceConfig_GuardrailOverrides::has_max_upload_per_day_bytes() const { return (_has_bits_[0] & 0x00000001u) != 0; } inline void TraceConfig_GuardrailOverrides::clear_max_upload_per_day_bytes() { max_upload_per_day_bytes_ = PROTOBUF_ULONGLONG(0); _has_bits_[0] &= ~0x00000001u; } inline ::PROTOBUF_NAMESPACE_ID::uint64 TraceConfig_GuardrailOverrides::max_upload_per_day_bytes() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.GuardrailOverrides.max_upload_per_day_bytes) return max_upload_per_day_bytes_; } inline void TraceConfig_GuardrailOverrides::set_max_upload_per_day_bytes(::PROTOBUF_NAMESPACE_ID::uint64 value) { _has_bits_[0] |= 0x00000001u; max_upload_per_day_bytes_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.GuardrailOverrides.max_upload_per_day_bytes) } // ------------------------------------------------------------------- // TraceConfig_TriggerConfig_Trigger // optional string name = 1; inline bool TraceConfig_TriggerConfig_Trigger::has_name() const { return (_has_bits_[0] & 0x00000001u) != 0; } inline void TraceConfig_TriggerConfig_Trigger::clear_name() { name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); _has_bits_[0] &= ~0x00000001u; } inline const std::string& TraceConfig_TriggerConfig_Trigger::name() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.TriggerConfig.Trigger.name) return name_.GetNoArena(); } inline void TraceConfig_TriggerConfig_Trigger::set_name(const std::string& value) { _has_bits_[0] |= 0x00000001u; name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.TriggerConfig.Trigger.name) } inline void TraceConfig_TriggerConfig_Trigger::set_name(std::string&& value) { _has_bits_[0] |= 0x00000001u; name_.SetNoArena( &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); // @@protoc_insertion_point(field_set_rvalue:perfetto.protos.TraceConfig.TriggerConfig.Trigger.name) } inline void TraceConfig_TriggerConfig_Trigger::set_name(const char* value) { GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000001u; name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:perfetto.protos.TraceConfig.TriggerConfig.Trigger.name) } inline void TraceConfig_TriggerConfig_Trigger::set_name(const char* value, size_t size) { _has_bits_[0] |= 0x00000001u; name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(reinterpret_cast<const char*>(value), size)); // @@protoc_insertion_point(field_set_pointer:perfetto.protos.TraceConfig.TriggerConfig.Trigger.name) } inline std::string* TraceConfig_TriggerConfig_Trigger::mutable_name() { _has_bits_[0] |= 0x00000001u; // @@protoc_insertion_point(field_mutable:perfetto.protos.TraceConfig.TriggerConfig.Trigger.name) return name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } inline std::string* TraceConfig_TriggerConfig_Trigger::release_name() { // @@protoc_insertion_point(field_release:perfetto.protos.TraceConfig.TriggerConfig.Trigger.name) if (!has_name()) { return nullptr; } _has_bits_[0] &= ~0x00000001u; return name_.ReleaseNonDefaultNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } inline void TraceConfig_TriggerConfig_Trigger::set_allocated_name(std::string* name) { if (name != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; } name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name); // @@protoc_insertion_point(field_set_allocated:perfetto.protos.TraceConfig.TriggerConfig.Trigger.name) } // optional string producer_name_regex = 2; inline bool TraceConfig_TriggerConfig_Trigger::has_producer_name_regex() const { return (_has_bits_[0] & 0x00000002u) != 0; } inline void TraceConfig_TriggerConfig_Trigger::clear_producer_name_regex() { producer_name_regex_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); _has_bits_[0] &= ~0x00000002u; } inline const std::string& TraceConfig_TriggerConfig_Trigger::producer_name_regex() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.TriggerConfig.Trigger.producer_name_regex) return producer_name_regex_.GetNoArena(); } inline void TraceConfig_TriggerConfig_Trigger::set_producer_name_regex(const std::string& value) { _has_bits_[0] |= 0x00000002u; producer_name_regex_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.TriggerConfig.Trigger.producer_name_regex) } inline void TraceConfig_TriggerConfig_Trigger::set_producer_name_regex(std::string&& value) { _has_bits_[0] |= 0x00000002u; producer_name_regex_.SetNoArena( &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); // @@protoc_insertion_point(field_set_rvalue:perfetto.protos.TraceConfig.TriggerConfig.Trigger.producer_name_regex) } inline void TraceConfig_TriggerConfig_Trigger::set_producer_name_regex(const char* value) { GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000002u; producer_name_regex_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:perfetto.protos.TraceConfig.TriggerConfig.Trigger.producer_name_regex) } inline void TraceConfig_TriggerConfig_Trigger::set_producer_name_regex(const char* value, size_t size) { _has_bits_[0] |= 0x00000002u; producer_name_regex_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(reinterpret_cast<const char*>(value), size)); // @@protoc_insertion_point(field_set_pointer:perfetto.protos.TraceConfig.TriggerConfig.Trigger.producer_name_regex) } inline std::string* TraceConfig_TriggerConfig_Trigger::mutable_producer_name_regex() { _has_bits_[0] |= 0x00000002u; // @@protoc_insertion_point(field_mutable:perfetto.protos.TraceConfig.TriggerConfig.Trigger.producer_name_regex) return producer_name_regex_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } inline std::string* TraceConfig_TriggerConfig_Trigger::release_producer_name_regex() { // @@protoc_insertion_point(field_release:perfetto.protos.TraceConfig.TriggerConfig.Trigger.producer_name_regex) if (!has_producer_name_regex()) { return nullptr; } _has_bits_[0] &= ~0x00000002u; return producer_name_regex_.ReleaseNonDefaultNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } inline void TraceConfig_TriggerConfig_Trigger::set_allocated_producer_name_regex(std::string* producer_name_regex) { if (producer_name_regex != nullptr) { _has_bits_[0] |= 0x00000002u; } else { _has_bits_[0] &= ~0x00000002u; } producer_name_regex_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), producer_name_regex); // @@protoc_insertion_point(field_set_allocated:perfetto.protos.TraceConfig.TriggerConfig.Trigger.producer_name_regex) } // optional uint32 stop_delay_ms = 3; inline bool TraceConfig_TriggerConfig_Trigger::has_stop_delay_ms() const { return (_has_bits_[0] & 0x00000004u) != 0; } inline void TraceConfig_TriggerConfig_Trigger::clear_stop_delay_ms() { stop_delay_ms_ = 0u; _has_bits_[0] &= ~0x00000004u; } inline ::PROTOBUF_NAMESPACE_ID::uint32 TraceConfig_TriggerConfig_Trigger::stop_delay_ms() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.TriggerConfig.Trigger.stop_delay_ms) return stop_delay_ms_; } inline void TraceConfig_TriggerConfig_Trigger::set_stop_delay_ms(::PROTOBUF_NAMESPACE_ID::uint32 value) { _has_bits_[0] |= 0x00000004u; stop_delay_ms_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.TriggerConfig.Trigger.stop_delay_ms) } // optional uint32 max_per_24_h = 4; inline bool TraceConfig_TriggerConfig_Trigger::has_max_per_24_h() const { return (_has_bits_[0] & 0x00000008u) != 0; } inline void TraceConfig_TriggerConfig_Trigger::clear_max_per_24_h() { max_per_24_h_ = 0u; _has_bits_[0] &= ~0x00000008u; } inline ::PROTOBUF_NAMESPACE_ID::uint32 TraceConfig_TriggerConfig_Trigger::max_per_24_h() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.TriggerConfig.Trigger.max_per_24_h) return max_per_24_h_; } inline void TraceConfig_TriggerConfig_Trigger::set_max_per_24_h(::PROTOBUF_NAMESPACE_ID::uint32 value) { _has_bits_[0] |= 0x00000008u; max_per_24_h_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.TriggerConfig.Trigger.max_per_24_h) } // optional double skip_probability = 5; inline bool TraceConfig_TriggerConfig_Trigger::has_skip_probability() const { return (_has_bits_[0] & 0x00000010u) != 0; } inline void TraceConfig_TriggerConfig_Trigger::clear_skip_probability() { skip_probability_ = 0; _has_bits_[0] &= ~0x00000010u; } inline double TraceConfig_TriggerConfig_Trigger::skip_probability() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.TriggerConfig.Trigger.skip_probability) return skip_probability_; } inline void TraceConfig_TriggerConfig_Trigger::set_skip_probability(double value) { _has_bits_[0] |= 0x00000010u; skip_probability_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.TriggerConfig.Trigger.skip_probability) } // ------------------------------------------------------------------- // TraceConfig_TriggerConfig // optional .perfetto.protos.TraceConfig.TriggerConfig.TriggerMode trigger_mode = 1; inline bool TraceConfig_TriggerConfig::has_trigger_mode() const { return (_has_bits_[0] & 0x00000001u) != 0; } inline void TraceConfig_TriggerConfig::clear_trigger_mode() { trigger_mode_ = 0; _has_bits_[0] &= ~0x00000001u; } inline ::perfetto::protos::TraceConfig_TriggerConfig_TriggerMode TraceConfig_TriggerConfig::trigger_mode() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.TriggerConfig.trigger_mode) return static_cast< ::perfetto::protos::TraceConfig_TriggerConfig_TriggerMode >(trigger_mode_); } inline void TraceConfig_TriggerConfig::set_trigger_mode(::perfetto::protos::TraceConfig_TriggerConfig_TriggerMode value) { assert(::perfetto::protos::TraceConfig_TriggerConfig_TriggerMode_IsValid(value)); _has_bits_[0] |= 0x00000001u; trigger_mode_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.TriggerConfig.trigger_mode) } // repeated .perfetto.protos.TraceConfig.TriggerConfig.Trigger triggers = 2; inline int TraceConfig_TriggerConfig::triggers_size() const { return triggers_.size(); } inline void TraceConfig_TriggerConfig::clear_triggers() { triggers_.Clear(); } inline ::perfetto::protos::TraceConfig_TriggerConfig_Trigger* TraceConfig_TriggerConfig::mutable_triggers(int index) { // @@protoc_insertion_point(field_mutable:perfetto.protos.TraceConfig.TriggerConfig.triggers) return triggers_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::perfetto::protos::TraceConfig_TriggerConfig_Trigger >* TraceConfig_TriggerConfig::mutable_triggers() { // @@protoc_insertion_point(field_mutable_list:perfetto.protos.TraceConfig.TriggerConfig.triggers) return &triggers_; } inline const ::perfetto::protos::TraceConfig_TriggerConfig_Trigger& TraceConfig_TriggerConfig::triggers(int index) const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.TriggerConfig.triggers) return triggers_.Get(index); } inline ::perfetto::protos::TraceConfig_TriggerConfig_Trigger* TraceConfig_TriggerConfig::add_triggers() { // @@protoc_insertion_point(field_add:perfetto.protos.TraceConfig.TriggerConfig.triggers) return triggers_.Add(); } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::perfetto::protos::TraceConfig_TriggerConfig_Trigger >& TraceConfig_TriggerConfig::triggers() const { // @@protoc_insertion_point(field_list:perfetto.protos.TraceConfig.TriggerConfig.triggers) return triggers_; } // optional uint32 trigger_timeout_ms = 3; inline bool TraceConfig_TriggerConfig::has_trigger_timeout_ms() const { return (_has_bits_[0] & 0x00000002u) != 0; } inline void TraceConfig_TriggerConfig::clear_trigger_timeout_ms() { trigger_timeout_ms_ = 0u; _has_bits_[0] &= ~0x00000002u; } inline ::PROTOBUF_NAMESPACE_ID::uint32 TraceConfig_TriggerConfig::trigger_timeout_ms() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.TriggerConfig.trigger_timeout_ms) return trigger_timeout_ms_; } inline void TraceConfig_TriggerConfig::set_trigger_timeout_ms(::PROTOBUF_NAMESPACE_ID::uint32 value) { _has_bits_[0] |= 0x00000002u; trigger_timeout_ms_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.TriggerConfig.trigger_timeout_ms) } // ------------------------------------------------------------------- // TraceConfig_IncrementalStateConfig // optional uint32 clear_period_ms = 1; inline bool TraceConfig_IncrementalStateConfig::has_clear_period_ms() const { return (_has_bits_[0] & 0x00000001u) != 0; } inline void TraceConfig_IncrementalStateConfig::clear_clear_period_ms() { clear_period_ms_ = 0u; _has_bits_[0] &= ~0x00000001u; } inline ::PROTOBUF_NAMESPACE_ID::uint32 TraceConfig_IncrementalStateConfig::clear_period_ms() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.IncrementalStateConfig.clear_period_ms) return clear_period_ms_; } inline void TraceConfig_IncrementalStateConfig::set_clear_period_ms(::PROTOBUF_NAMESPACE_ID::uint32 value) { _has_bits_[0] |= 0x00000001u; clear_period_ms_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.IncrementalStateConfig.clear_period_ms) } // ------------------------------------------------------------------- // TraceConfig_IncidentReportConfig // optional string destination_package = 1; inline bool TraceConfig_IncidentReportConfig::has_destination_package() const { return (_has_bits_[0] & 0x00000001u) != 0; } inline void TraceConfig_IncidentReportConfig::clear_destination_package() { destination_package_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); _has_bits_[0] &= ~0x00000001u; } inline const std::string& TraceConfig_IncidentReportConfig::destination_package() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.IncidentReportConfig.destination_package) return destination_package_.GetNoArena(); } inline void TraceConfig_IncidentReportConfig::set_destination_package(const std::string& value) { _has_bits_[0] |= 0x00000001u; destination_package_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.IncidentReportConfig.destination_package) } inline void TraceConfig_IncidentReportConfig::set_destination_package(std::string&& value) { _has_bits_[0] |= 0x00000001u; destination_package_.SetNoArena( &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); // @@protoc_insertion_point(field_set_rvalue:perfetto.protos.TraceConfig.IncidentReportConfig.destination_package) } inline void TraceConfig_IncidentReportConfig::set_destination_package(const char* value) { GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000001u; destination_package_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:perfetto.protos.TraceConfig.IncidentReportConfig.destination_package) } inline void TraceConfig_IncidentReportConfig::set_destination_package(const char* value, size_t size) { _has_bits_[0] |= 0x00000001u; destination_package_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(reinterpret_cast<const char*>(value), size)); // @@protoc_insertion_point(field_set_pointer:perfetto.protos.TraceConfig.IncidentReportConfig.destination_package) } inline std::string* TraceConfig_IncidentReportConfig::mutable_destination_package() { _has_bits_[0] |= 0x00000001u; // @@protoc_insertion_point(field_mutable:perfetto.protos.TraceConfig.IncidentReportConfig.destination_package) return destination_package_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } inline std::string* TraceConfig_IncidentReportConfig::release_destination_package() { // @@protoc_insertion_point(field_release:perfetto.protos.TraceConfig.IncidentReportConfig.destination_package) if (!has_destination_package()) { return nullptr; } _has_bits_[0] &= ~0x00000001u; return destination_package_.ReleaseNonDefaultNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } inline void TraceConfig_IncidentReportConfig::set_allocated_destination_package(std::string* destination_package) { if (destination_package != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; } destination_package_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), destination_package); // @@protoc_insertion_point(field_set_allocated:perfetto.protos.TraceConfig.IncidentReportConfig.destination_package) } // optional string destination_class = 2; inline bool TraceConfig_IncidentReportConfig::has_destination_class() const { return (_has_bits_[0] & 0x00000002u) != 0; } inline void TraceConfig_IncidentReportConfig::clear_destination_class() { destination_class_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); _has_bits_[0] &= ~0x00000002u; } inline const std::string& TraceConfig_IncidentReportConfig::destination_class() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.IncidentReportConfig.destination_class) return destination_class_.GetNoArena(); } inline void TraceConfig_IncidentReportConfig::set_destination_class(const std::string& value) { _has_bits_[0] |= 0x00000002u; destination_class_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.IncidentReportConfig.destination_class) } inline void TraceConfig_IncidentReportConfig::set_destination_class(std::string&& value) { _has_bits_[0] |= 0x00000002u; destination_class_.SetNoArena( &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); // @@protoc_insertion_point(field_set_rvalue:perfetto.protos.TraceConfig.IncidentReportConfig.destination_class) } inline void TraceConfig_IncidentReportConfig::set_destination_class(const char* value) { GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000002u; destination_class_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:perfetto.protos.TraceConfig.IncidentReportConfig.destination_class) } inline void TraceConfig_IncidentReportConfig::set_destination_class(const char* value, size_t size) { _has_bits_[0] |= 0x00000002u; destination_class_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(reinterpret_cast<const char*>(value), size)); // @@protoc_insertion_point(field_set_pointer:perfetto.protos.TraceConfig.IncidentReportConfig.destination_class) } inline std::string* TraceConfig_IncidentReportConfig::mutable_destination_class() { _has_bits_[0] |= 0x00000002u; // @@protoc_insertion_point(field_mutable:perfetto.protos.TraceConfig.IncidentReportConfig.destination_class) return destination_class_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } inline std::string* TraceConfig_IncidentReportConfig::release_destination_class() { // @@protoc_insertion_point(field_release:perfetto.protos.TraceConfig.IncidentReportConfig.destination_class) if (!has_destination_class()) { return nullptr; } _has_bits_[0] &= ~0x00000002u; return destination_class_.ReleaseNonDefaultNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } inline void TraceConfig_IncidentReportConfig::set_allocated_destination_class(std::string* destination_class) { if (destination_class != nullptr) { _has_bits_[0] |= 0x00000002u; } else { _has_bits_[0] &= ~0x00000002u; } destination_class_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), destination_class); // @@protoc_insertion_point(field_set_allocated:perfetto.protos.TraceConfig.IncidentReportConfig.destination_class) } // optional int32 privacy_level = 3; inline bool TraceConfig_IncidentReportConfig::has_privacy_level() const { return (_has_bits_[0] & 0x00000004u) != 0; } inline void TraceConfig_IncidentReportConfig::clear_privacy_level() { privacy_level_ = 0; _has_bits_[0] &= ~0x00000004u; } inline ::PROTOBUF_NAMESPACE_ID::int32 TraceConfig_IncidentReportConfig::privacy_level() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.IncidentReportConfig.privacy_level) return privacy_level_; } inline void TraceConfig_IncidentReportConfig::set_privacy_level(::PROTOBUF_NAMESPACE_ID::int32 value) { _has_bits_[0] |= 0x00000004u; privacy_level_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.IncidentReportConfig.privacy_level) } // optional bool skip_dropbox = 4; inline bool TraceConfig_IncidentReportConfig::has_skip_dropbox() const { return (_has_bits_[0] & 0x00000008u) != 0; } inline void TraceConfig_IncidentReportConfig::clear_skip_dropbox() { skip_dropbox_ = false; _has_bits_[0] &= ~0x00000008u; } inline bool TraceConfig_IncidentReportConfig::skip_dropbox() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.IncidentReportConfig.skip_dropbox) return skip_dropbox_; } inline void TraceConfig_IncidentReportConfig::set_skip_dropbox(bool value) { _has_bits_[0] |= 0x00000008u; skip_dropbox_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.IncidentReportConfig.skip_dropbox) } // ------------------------------------------------------------------- // TraceConfig // repeated .perfetto.protos.TraceConfig.BufferConfig buffers = 1; inline int TraceConfig::buffers_size() const { return buffers_.size(); } inline void TraceConfig::clear_buffers() { buffers_.Clear(); } inline ::perfetto::protos::TraceConfig_BufferConfig* TraceConfig::mutable_buffers(int index) { // @@protoc_insertion_point(field_mutable:perfetto.protos.TraceConfig.buffers) return buffers_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::perfetto::protos::TraceConfig_BufferConfig >* TraceConfig::mutable_buffers() { // @@protoc_insertion_point(field_mutable_list:perfetto.protos.TraceConfig.buffers) return &buffers_; } inline const ::perfetto::protos::TraceConfig_BufferConfig& TraceConfig::buffers(int index) const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.buffers) return buffers_.Get(index); } inline ::perfetto::protos::TraceConfig_BufferConfig* TraceConfig::add_buffers() { // @@protoc_insertion_point(field_add:perfetto.protos.TraceConfig.buffers) return buffers_.Add(); } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::perfetto::protos::TraceConfig_BufferConfig >& TraceConfig::buffers() const { // @@protoc_insertion_point(field_list:perfetto.protos.TraceConfig.buffers) return buffers_; } // repeated .perfetto.protos.TraceConfig.DataSource data_sources = 2; inline int TraceConfig::data_sources_size() const { return data_sources_.size(); } inline void TraceConfig::clear_data_sources() { data_sources_.Clear(); } inline ::perfetto::protos::TraceConfig_DataSource* TraceConfig::mutable_data_sources(int index) { // @@protoc_insertion_point(field_mutable:perfetto.protos.TraceConfig.data_sources) return data_sources_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::perfetto::protos::TraceConfig_DataSource >* TraceConfig::mutable_data_sources() { // @@protoc_insertion_point(field_mutable_list:perfetto.protos.TraceConfig.data_sources) return &data_sources_; } inline const ::perfetto::protos::TraceConfig_DataSource& TraceConfig::data_sources(int index) const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.data_sources) return data_sources_.Get(index); } inline ::perfetto::protos::TraceConfig_DataSource* TraceConfig::add_data_sources() { // @@protoc_insertion_point(field_add:perfetto.protos.TraceConfig.data_sources) return data_sources_.Add(); } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::perfetto::protos::TraceConfig_DataSource >& TraceConfig::data_sources() const { // @@protoc_insertion_point(field_list:perfetto.protos.TraceConfig.data_sources) return data_sources_; } // optional .perfetto.protos.TraceConfig.BuiltinDataSource builtin_data_sources = 20; inline bool TraceConfig::has_builtin_data_sources() const { return (_has_bits_[0] & 0x00000020u) != 0; } inline void TraceConfig::clear_builtin_data_sources() { if (builtin_data_sources_ != nullptr) builtin_data_sources_->Clear(); _has_bits_[0] &= ~0x00000020u; } inline const ::perfetto::protos::TraceConfig_BuiltinDataSource& TraceConfig::builtin_data_sources() const { const ::perfetto::protos::TraceConfig_BuiltinDataSource* p = builtin_data_sources_; // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.builtin_data_sources) return p != nullptr ? *p : *reinterpret_cast<const ::perfetto::protos::TraceConfig_BuiltinDataSource*>( &::perfetto::protos::_TraceConfig_BuiltinDataSource_default_instance_); } inline ::perfetto::protos::TraceConfig_BuiltinDataSource* TraceConfig::release_builtin_data_sources() { // @@protoc_insertion_point(field_release:perfetto.protos.TraceConfig.builtin_data_sources) _has_bits_[0] &= ~0x00000020u; ::perfetto::protos::TraceConfig_BuiltinDataSource* temp = builtin_data_sources_; builtin_data_sources_ = nullptr; return temp; } inline ::perfetto::protos::TraceConfig_BuiltinDataSource* TraceConfig::mutable_builtin_data_sources() { _has_bits_[0] |= 0x00000020u; if (builtin_data_sources_ == nullptr) { auto* p = CreateMaybeMessage<::perfetto::protos::TraceConfig_BuiltinDataSource>(GetArenaNoVirtual()); builtin_data_sources_ = p; } // @@protoc_insertion_point(field_mutable:perfetto.protos.TraceConfig.builtin_data_sources) return builtin_data_sources_; } inline void TraceConfig::set_allocated_builtin_data_sources(::perfetto::protos::TraceConfig_BuiltinDataSource* builtin_data_sources) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); if (message_arena == nullptr) { delete builtin_data_sources_; } if (builtin_data_sources) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; if (message_arena != submessage_arena) { builtin_data_sources = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, builtin_data_sources, submessage_arena); } _has_bits_[0] |= 0x00000020u; } else { _has_bits_[0] &= ~0x00000020u; } builtin_data_sources_ = builtin_data_sources; // @@protoc_insertion_point(field_set_allocated:perfetto.protos.TraceConfig.builtin_data_sources) } // optional uint32 duration_ms = 3; inline bool TraceConfig::has_duration_ms() const { return (_has_bits_[0] & 0x00000100u) != 0; } inline void TraceConfig::clear_duration_ms() { duration_ms_ = 0u; _has_bits_[0] &= ~0x00000100u; } inline ::PROTOBUF_NAMESPACE_ID::uint32 TraceConfig::duration_ms() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.duration_ms) return duration_ms_; } inline void TraceConfig::set_duration_ms(::PROTOBUF_NAMESPACE_ID::uint32 value) { _has_bits_[0] |= 0x00000100u; duration_ms_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.duration_ms) } // optional bool enable_extra_guardrails = 4; inline bool TraceConfig::has_enable_extra_guardrails() const { return (_has_bits_[0] & 0x00000800u) != 0; } inline void TraceConfig::clear_enable_extra_guardrails() { enable_extra_guardrails_ = false; _has_bits_[0] &= ~0x00000800u; } inline bool TraceConfig::enable_extra_guardrails() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.enable_extra_guardrails) return enable_extra_guardrails_; } inline void TraceConfig::set_enable_extra_guardrails(bool value) { _has_bits_[0] |= 0x00000800u; enable_extra_guardrails_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.enable_extra_guardrails) } // optional .perfetto.protos.TraceConfig.LockdownModeOperation lockdown_mode = 5; inline bool TraceConfig::has_lockdown_mode() const { return (_has_bits_[0] & 0x00000200u) != 0; } inline void TraceConfig::clear_lockdown_mode() { lockdown_mode_ = 0; _has_bits_[0] &= ~0x00000200u; } inline ::perfetto::protos::TraceConfig_LockdownModeOperation TraceConfig::lockdown_mode() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.lockdown_mode) return static_cast< ::perfetto::protos::TraceConfig_LockdownModeOperation >(lockdown_mode_); } inline void TraceConfig::set_lockdown_mode(::perfetto::protos::TraceConfig_LockdownModeOperation value) { assert(::perfetto::protos::TraceConfig_LockdownModeOperation_IsValid(value)); _has_bits_[0] |= 0x00000200u; lockdown_mode_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.lockdown_mode) } // repeated .perfetto.protos.TraceConfig.ProducerConfig producers = 6; inline int TraceConfig::producers_size() const { return producers_.size(); } inline void TraceConfig::clear_producers() { producers_.Clear(); } inline ::perfetto::protos::TraceConfig_ProducerConfig* TraceConfig::mutable_producers(int index) { // @@protoc_insertion_point(field_mutable:perfetto.protos.TraceConfig.producers) return producers_.Mutable(index); } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::perfetto::protos::TraceConfig_ProducerConfig >* TraceConfig::mutable_producers() { // @@protoc_insertion_point(field_mutable_list:perfetto.protos.TraceConfig.producers) return &producers_; } inline const ::perfetto::protos::TraceConfig_ProducerConfig& TraceConfig::producers(int index) const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.producers) return producers_.Get(index); } inline ::perfetto::protos::TraceConfig_ProducerConfig* TraceConfig::add_producers() { // @@protoc_insertion_point(field_add:perfetto.protos.TraceConfig.producers) return producers_.Add(); } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::perfetto::protos::TraceConfig_ProducerConfig >& TraceConfig::producers() const { // @@protoc_insertion_point(field_list:perfetto.protos.TraceConfig.producers) return producers_; } // optional .perfetto.protos.TraceConfig.StatsdMetadata statsd_metadata = 7; inline bool TraceConfig::has_statsd_metadata() const { return (_has_bits_[0] & 0x00000004u) != 0; } inline void TraceConfig::clear_statsd_metadata() { if (statsd_metadata_ != nullptr) statsd_metadata_->Clear(); _has_bits_[0] &= ~0x00000004u; } inline const ::perfetto::protos::TraceConfig_StatsdMetadata& TraceConfig::statsd_metadata() const { const ::perfetto::protos::TraceConfig_StatsdMetadata* p = statsd_metadata_; // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.statsd_metadata) return p != nullptr ? *p : *reinterpret_cast<const ::perfetto::protos::TraceConfig_StatsdMetadata*>( &::perfetto::protos::_TraceConfig_StatsdMetadata_default_instance_); } inline ::perfetto::protos::TraceConfig_StatsdMetadata* TraceConfig::release_statsd_metadata() { // @@protoc_insertion_point(field_release:perfetto.protos.TraceConfig.statsd_metadata) _has_bits_[0] &= ~0x00000004u; ::perfetto::protos::TraceConfig_StatsdMetadata* temp = statsd_metadata_; statsd_metadata_ = nullptr; return temp; } inline ::perfetto::protos::TraceConfig_StatsdMetadata* TraceConfig::mutable_statsd_metadata() { _has_bits_[0] |= 0x00000004u; if (statsd_metadata_ == nullptr) { auto* p = CreateMaybeMessage<::perfetto::protos::TraceConfig_StatsdMetadata>(GetArenaNoVirtual()); statsd_metadata_ = p; } // @@protoc_insertion_point(field_mutable:perfetto.protos.TraceConfig.statsd_metadata) return statsd_metadata_; } inline void TraceConfig::set_allocated_statsd_metadata(::perfetto::protos::TraceConfig_StatsdMetadata* statsd_metadata) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); if (message_arena == nullptr) { delete statsd_metadata_; } if (statsd_metadata) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; if (message_arena != submessage_arena) { statsd_metadata = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, statsd_metadata, submessage_arena); } _has_bits_[0] |= 0x00000004u; } else { _has_bits_[0] &= ~0x00000004u; } statsd_metadata_ = statsd_metadata; // @@protoc_insertion_point(field_set_allocated:perfetto.protos.TraceConfig.statsd_metadata) } // optional bool write_into_file = 8; inline bool TraceConfig::has_write_into_file() const { return (_has_bits_[0] & 0x00001000u) != 0; } inline void TraceConfig::clear_write_into_file() { write_into_file_ = false; _has_bits_[0] &= ~0x00001000u; } inline bool TraceConfig::write_into_file() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.write_into_file) return write_into_file_; } inline void TraceConfig::set_write_into_file(bool value) { _has_bits_[0] |= 0x00001000u; write_into_file_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.write_into_file) } // optional string output_path = 29; inline bool TraceConfig::has_output_path() const { return (_has_bits_[0] & 0x00000002u) != 0; } inline void TraceConfig::clear_output_path() { output_path_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); _has_bits_[0] &= ~0x00000002u; } inline const std::string& TraceConfig::output_path() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.output_path) return output_path_.GetNoArena(); } inline void TraceConfig::set_output_path(const std::string& value) { _has_bits_[0] |= 0x00000002u; output_path_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.output_path) } inline void TraceConfig::set_output_path(std::string&& value) { _has_bits_[0] |= 0x00000002u; output_path_.SetNoArena( &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); // @@protoc_insertion_point(field_set_rvalue:perfetto.protos.TraceConfig.output_path) } inline void TraceConfig::set_output_path(const char* value) { GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000002u; output_path_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:perfetto.protos.TraceConfig.output_path) } inline void TraceConfig::set_output_path(const char* value, size_t size) { _has_bits_[0] |= 0x00000002u; output_path_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(reinterpret_cast<const char*>(value), size)); // @@protoc_insertion_point(field_set_pointer:perfetto.protos.TraceConfig.output_path) } inline std::string* TraceConfig::mutable_output_path() { _has_bits_[0] |= 0x00000002u; // @@protoc_insertion_point(field_mutable:perfetto.protos.TraceConfig.output_path) return output_path_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } inline std::string* TraceConfig::release_output_path() { // @@protoc_insertion_point(field_release:perfetto.protos.TraceConfig.output_path) if (!has_output_path()) { return nullptr; } _has_bits_[0] &= ~0x00000002u; return output_path_.ReleaseNonDefaultNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } inline void TraceConfig::set_allocated_output_path(std::string* output_path) { if (output_path != nullptr) { _has_bits_[0] |= 0x00000002u; } else { _has_bits_[0] &= ~0x00000002u; } output_path_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), output_path); // @@protoc_insertion_point(field_set_allocated:perfetto.protos.TraceConfig.output_path) } // optional uint32 file_write_period_ms = 9; inline bool TraceConfig::has_file_write_period_ms() const { return (_has_bits_[0] & 0x00000400u) != 0; } inline void TraceConfig::clear_file_write_period_ms() { file_write_period_ms_ = 0u; _has_bits_[0] &= ~0x00000400u; } inline ::PROTOBUF_NAMESPACE_ID::uint32 TraceConfig::file_write_period_ms() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.file_write_period_ms) return file_write_period_ms_; } inline void TraceConfig::set_file_write_period_ms(::PROTOBUF_NAMESPACE_ID::uint32 value) { _has_bits_[0] |= 0x00000400u; file_write_period_ms_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.file_write_period_ms) } // optional uint64 max_file_size_bytes = 10; inline bool TraceConfig::has_max_file_size_bytes() const { return (_has_bits_[0] & 0x00008000u) != 0; } inline void TraceConfig::clear_max_file_size_bytes() { max_file_size_bytes_ = PROTOBUF_ULONGLONG(0); _has_bits_[0] &= ~0x00008000u; } inline ::PROTOBUF_NAMESPACE_ID::uint64 TraceConfig::max_file_size_bytes() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.max_file_size_bytes) return max_file_size_bytes_; } inline void TraceConfig::set_max_file_size_bytes(::PROTOBUF_NAMESPACE_ID::uint64 value) { _has_bits_[0] |= 0x00008000u; max_file_size_bytes_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.max_file_size_bytes) } // optional .perfetto.protos.TraceConfig.GuardrailOverrides guardrail_overrides = 11; inline bool TraceConfig::has_guardrail_overrides() const { return (_has_bits_[0] & 0x00000008u) != 0; } inline void TraceConfig::clear_guardrail_overrides() { if (guardrail_overrides_ != nullptr) guardrail_overrides_->Clear(); _has_bits_[0] &= ~0x00000008u; } inline const ::perfetto::protos::TraceConfig_GuardrailOverrides& TraceConfig::guardrail_overrides() const { const ::perfetto::protos::TraceConfig_GuardrailOverrides* p = guardrail_overrides_; // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.guardrail_overrides) return p != nullptr ? *p : *reinterpret_cast<const ::perfetto::protos::TraceConfig_GuardrailOverrides*>( &::perfetto::protos::_TraceConfig_GuardrailOverrides_default_instance_); } inline ::perfetto::protos::TraceConfig_GuardrailOverrides* TraceConfig::release_guardrail_overrides() { // @@protoc_insertion_point(field_release:perfetto.protos.TraceConfig.guardrail_overrides) _has_bits_[0] &= ~0x00000008u; ::perfetto::protos::TraceConfig_GuardrailOverrides* temp = guardrail_overrides_; guardrail_overrides_ = nullptr; return temp; } inline ::perfetto::protos::TraceConfig_GuardrailOverrides* TraceConfig::mutable_guardrail_overrides() { _has_bits_[0] |= 0x00000008u; if (guardrail_overrides_ == nullptr) { auto* p = CreateMaybeMessage<::perfetto::protos::TraceConfig_GuardrailOverrides>(GetArenaNoVirtual()); guardrail_overrides_ = p; } // @@protoc_insertion_point(field_mutable:perfetto.protos.TraceConfig.guardrail_overrides) return guardrail_overrides_; } inline void TraceConfig::set_allocated_guardrail_overrides(::perfetto::protos::TraceConfig_GuardrailOverrides* guardrail_overrides) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); if (message_arena == nullptr) { delete guardrail_overrides_; } if (guardrail_overrides) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; if (message_arena != submessage_arena) { guardrail_overrides = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, guardrail_overrides, submessage_arena); } _has_bits_[0] |= 0x00000008u; } else { _has_bits_[0] &= ~0x00000008u; } guardrail_overrides_ = guardrail_overrides; // @@protoc_insertion_point(field_set_allocated:perfetto.protos.TraceConfig.guardrail_overrides) } // optional bool deferred_start = 12; inline bool TraceConfig::has_deferred_start() const { return (_has_bits_[0] & 0x00002000u) != 0; } inline void TraceConfig::clear_deferred_start() { deferred_start_ = false; _has_bits_[0] &= ~0x00002000u; } inline bool TraceConfig::deferred_start() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.deferred_start) return deferred_start_; } inline void TraceConfig::set_deferred_start(bool value) { _has_bits_[0] |= 0x00002000u; deferred_start_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.deferred_start) } // optional uint32 flush_period_ms = 13; inline bool TraceConfig::has_flush_period_ms() const { return (_has_bits_[0] & 0x00010000u) != 0; } inline void TraceConfig::clear_flush_period_ms() { flush_period_ms_ = 0u; _has_bits_[0] &= ~0x00010000u; } inline ::PROTOBUF_NAMESPACE_ID::uint32 TraceConfig::flush_period_ms() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.flush_period_ms) return flush_period_ms_; } inline void TraceConfig::set_flush_period_ms(::PROTOBUF_NAMESPACE_ID::uint32 value) { _has_bits_[0] |= 0x00010000u; flush_period_ms_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.flush_period_ms) } // optional uint32 flush_timeout_ms = 14; inline bool TraceConfig::has_flush_timeout_ms() const { return (_has_bits_[0] & 0x00020000u) != 0; } inline void TraceConfig::clear_flush_timeout_ms() { flush_timeout_ms_ = 0u; _has_bits_[0] &= ~0x00020000u; } inline ::PROTOBUF_NAMESPACE_ID::uint32 TraceConfig::flush_timeout_ms() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.flush_timeout_ms) return flush_timeout_ms_; } inline void TraceConfig::set_flush_timeout_ms(::PROTOBUF_NAMESPACE_ID::uint32 value) { _has_bits_[0] |= 0x00020000u; flush_timeout_ms_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.flush_timeout_ms) } // optional uint32 data_source_stop_timeout_ms = 23; inline bool TraceConfig::has_data_source_stop_timeout_ms() const { return (_has_bits_[0] & 0x00080000u) != 0; } inline void TraceConfig::clear_data_source_stop_timeout_ms() { data_source_stop_timeout_ms_ = 0u; _has_bits_[0] &= ~0x00080000u; } inline ::PROTOBUF_NAMESPACE_ID::uint32 TraceConfig::data_source_stop_timeout_ms() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.data_source_stop_timeout_ms) return data_source_stop_timeout_ms_; } inline void TraceConfig::set_data_source_stop_timeout_ms(::PROTOBUF_NAMESPACE_ID::uint32 value) { _has_bits_[0] |= 0x00080000u; data_source_stop_timeout_ms_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.data_source_stop_timeout_ms) } // optional bool notify_traceur = 16; inline bool TraceConfig::has_notify_traceur() const { return (_has_bits_[0] & 0x00004000u) != 0; } inline void TraceConfig::clear_notify_traceur() { notify_traceur_ = false; _has_bits_[0] &= ~0x00004000u; } inline bool TraceConfig::notify_traceur() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.notify_traceur) return notify_traceur_; } inline void TraceConfig::set_notify_traceur(bool value) { _has_bits_[0] |= 0x00004000u; notify_traceur_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.notify_traceur) } // optional int32 bugreport_score = 30; inline bool TraceConfig::has_bugreport_score() const { return (_has_bits_[0] & 0x00400000u) != 0; } inline void TraceConfig::clear_bugreport_score() { bugreport_score_ = 0; _has_bits_[0] &= ~0x00400000u; } inline ::PROTOBUF_NAMESPACE_ID::int32 TraceConfig::bugreport_score() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.bugreport_score) return bugreport_score_; } inline void TraceConfig::set_bugreport_score(::PROTOBUF_NAMESPACE_ID::int32 value) { _has_bits_[0] |= 0x00400000u; bugreport_score_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.bugreport_score) } // optional .perfetto.protos.TraceConfig.TriggerConfig trigger_config = 17; inline bool TraceConfig::has_trigger_config() const { return (_has_bits_[0] & 0x00000010u) != 0; } inline void TraceConfig::clear_trigger_config() { if (trigger_config_ != nullptr) trigger_config_->Clear(); _has_bits_[0] &= ~0x00000010u; } inline const ::perfetto::protos::TraceConfig_TriggerConfig& TraceConfig::trigger_config() const { const ::perfetto::protos::TraceConfig_TriggerConfig* p = trigger_config_; // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.trigger_config) return p != nullptr ? *p : *reinterpret_cast<const ::perfetto::protos::TraceConfig_TriggerConfig*>( &::perfetto::protos::_TraceConfig_TriggerConfig_default_instance_); } inline ::perfetto::protos::TraceConfig_TriggerConfig* TraceConfig::release_trigger_config() { // @@protoc_insertion_point(field_release:perfetto.protos.TraceConfig.trigger_config) _has_bits_[0] &= ~0x00000010u; ::perfetto::protos::TraceConfig_TriggerConfig* temp = trigger_config_; trigger_config_ = nullptr; return temp; } inline ::perfetto::protos::TraceConfig_TriggerConfig* TraceConfig::mutable_trigger_config() { _has_bits_[0] |= 0x00000010u; if (trigger_config_ == nullptr) { auto* p = CreateMaybeMessage<::perfetto::protos::TraceConfig_TriggerConfig>(GetArenaNoVirtual()); trigger_config_ = p; } // @@protoc_insertion_point(field_mutable:perfetto.protos.TraceConfig.trigger_config) return trigger_config_; } inline void TraceConfig::set_allocated_trigger_config(::perfetto::protos::TraceConfig_TriggerConfig* trigger_config) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); if (message_arena == nullptr) { delete trigger_config_; } if (trigger_config) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; if (message_arena != submessage_arena) { trigger_config = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, trigger_config, submessage_arena); } _has_bits_[0] |= 0x00000010u; } else { _has_bits_[0] &= ~0x00000010u; } trigger_config_ = trigger_config; // @@protoc_insertion_point(field_set_allocated:perfetto.protos.TraceConfig.trigger_config) } // repeated string activate_triggers = 18; inline int TraceConfig::activate_triggers_size() const { return activate_triggers_.size(); } inline void TraceConfig::clear_activate_triggers() { activate_triggers_.Clear(); } inline const std::string& TraceConfig::activate_triggers(int index) const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.activate_triggers) return activate_triggers_.Get(index); } inline std::string* TraceConfig::mutable_activate_triggers(int index) { // @@protoc_insertion_point(field_mutable:perfetto.protos.TraceConfig.activate_triggers) return activate_triggers_.Mutable(index); } inline void TraceConfig::set_activate_triggers(int index, const std::string& value) { // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.activate_triggers) activate_triggers_.Mutable(index)->assign(value); } inline void TraceConfig::set_activate_triggers(int index, std::string&& value) { // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.activate_triggers) activate_triggers_.Mutable(index)->assign(std::move(value)); } inline void TraceConfig::set_activate_triggers(int index, const char* value) { GOOGLE_DCHECK(value != nullptr); activate_triggers_.Mutable(index)->assign(value); // @@protoc_insertion_point(field_set_char:perfetto.protos.TraceConfig.activate_triggers) } inline void TraceConfig::set_activate_triggers(int index, const char* value, size_t size) { activate_triggers_.Mutable(index)->assign( reinterpret_cast<const char*>(value), size); // @@protoc_insertion_point(field_set_pointer:perfetto.protos.TraceConfig.activate_triggers) } inline std::string* TraceConfig::add_activate_triggers() { // @@protoc_insertion_point(field_add_mutable:perfetto.protos.TraceConfig.activate_triggers) return activate_triggers_.Add(); } inline void TraceConfig::add_activate_triggers(const std::string& value) { activate_triggers_.Add()->assign(value); // @@protoc_insertion_point(field_add:perfetto.protos.TraceConfig.activate_triggers) } inline void TraceConfig::add_activate_triggers(std::string&& value) { activate_triggers_.Add(std::move(value)); // @@protoc_insertion_point(field_add:perfetto.protos.TraceConfig.activate_triggers) } inline void TraceConfig::add_activate_triggers(const char* value) { GOOGLE_DCHECK(value != nullptr); activate_triggers_.Add()->assign(value); // @@protoc_insertion_point(field_add_char:perfetto.protos.TraceConfig.activate_triggers) } inline void TraceConfig::add_activate_triggers(const char* value, size_t size) { activate_triggers_.Add()->assign(reinterpret_cast<const char*>(value), size); // @@protoc_insertion_point(field_add_pointer:perfetto.protos.TraceConfig.activate_triggers) } inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>& TraceConfig::activate_triggers() const { // @@protoc_insertion_point(field_list:perfetto.protos.TraceConfig.activate_triggers) return activate_triggers_; } inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField<std::string>* TraceConfig::mutable_activate_triggers() { // @@protoc_insertion_point(field_mutable_list:perfetto.protos.TraceConfig.activate_triggers) return &activate_triggers_; } // optional .perfetto.protos.TraceConfig.IncrementalStateConfig incremental_state_config = 21; inline bool TraceConfig::has_incremental_state_config() const { return (_has_bits_[0] & 0x00000040u) != 0; } inline void TraceConfig::clear_incremental_state_config() { if (incremental_state_config_ != nullptr) incremental_state_config_->Clear(); _has_bits_[0] &= ~0x00000040u; } inline const ::perfetto::protos::TraceConfig_IncrementalStateConfig& TraceConfig::incremental_state_config() const { const ::perfetto::protos::TraceConfig_IncrementalStateConfig* p = incremental_state_config_; // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.incremental_state_config) return p != nullptr ? *p : *reinterpret_cast<const ::perfetto::protos::TraceConfig_IncrementalStateConfig*>( &::perfetto::protos::_TraceConfig_IncrementalStateConfig_default_instance_); } inline ::perfetto::protos::TraceConfig_IncrementalStateConfig* TraceConfig::release_incremental_state_config() { // @@protoc_insertion_point(field_release:perfetto.protos.TraceConfig.incremental_state_config) _has_bits_[0] &= ~0x00000040u; ::perfetto::protos::TraceConfig_IncrementalStateConfig* temp = incremental_state_config_; incremental_state_config_ = nullptr; return temp; } inline ::perfetto::protos::TraceConfig_IncrementalStateConfig* TraceConfig::mutable_incremental_state_config() { _has_bits_[0] |= 0x00000040u; if (incremental_state_config_ == nullptr) { auto* p = CreateMaybeMessage<::perfetto::protos::TraceConfig_IncrementalStateConfig>(GetArenaNoVirtual()); incremental_state_config_ = p; } // @@protoc_insertion_point(field_mutable:perfetto.protos.TraceConfig.incremental_state_config) return incremental_state_config_; } inline void TraceConfig::set_allocated_incremental_state_config(::perfetto::protos::TraceConfig_IncrementalStateConfig* incremental_state_config) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); if (message_arena == nullptr) { delete incremental_state_config_; } if (incremental_state_config) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; if (message_arena != submessage_arena) { incremental_state_config = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, incremental_state_config, submessage_arena); } _has_bits_[0] |= 0x00000040u; } else { _has_bits_[0] &= ~0x00000040u; } incremental_state_config_ = incremental_state_config; // @@protoc_insertion_point(field_set_allocated:perfetto.protos.TraceConfig.incremental_state_config) } // optional bool allow_user_build_tracing = 19; inline bool TraceConfig::has_allow_user_build_tracing() const { return (_has_bits_[0] & 0x00040000u) != 0; } inline void TraceConfig::clear_allow_user_build_tracing() { allow_user_build_tracing_ = false; _has_bits_[0] &= ~0x00040000u; } inline bool TraceConfig::allow_user_build_tracing() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.allow_user_build_tracing) return allow_user_build_tracing_; } inline void TraceConfig::set_allow_user_build_tracing(bool value) { _has_bits_[0] |= 0x00040000u; allow_user_build_tracing_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.allow_user_build_tracing) } // optional string unique_session_name = 22; inline bool TraceConfig::has_unique_session_name() const { return (_has_bits_[0] & 0x00000001u) != 0; } inline void TraceConfig::clear_unique_session_name() { unique_session_name_.ClearToEmptyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); _has_bits_[0] &= ~0x00000001u; } inline const std::string& TraceConfig::unique_session_name() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.unique_session_name) return unique_session_name_.GetNoArena(); } inline void TraceConfig::set_unique_session_name(const std::string& value) { _has_bits_[0] |= 0x00000001u; unique_session_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value); // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.unique_session_name) } inline void TraceConfig::set_unique_session_name(std::string&& value) { _has_bits_[0] |= 0x00000001u; unique_session_name_.SetNoArena( &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value)); // @@protoc_insertion_point(field_set_rvalue:perfetto.protos.TraceConfig.unique_session_name) } inline void TraceConfig::set_unique_session_name(const char* value) { GOOGLE_DCHECK(value != nullptr); _has_bits_[0] |= 0x00000001u; unique_session_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value)); // @@protoc_insertion_point(field_set_char:perfetto.protos.TraceConfig.unique_session_name) } inline void TraceConfig::set_unique_session_name(const char* value, size_t size) { _has_bits_[0] |= 0x00000001u; unique_session_name_.SetNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(reinterpret_cast<const char*>(value), size)); // @@protoc_insertion_point(field_set_pointer:perfetto.protos.TraceConfig.unique_session_name) } inline std::string* TraceConfig::mutable_unique_session_name() { _has_bits_[0] |= 0x00000001u; // @@protoc_insertion_point(field_mutable:perfetto.protos.TraceConfig.unique_session_name) return unique_session_name_.MutableNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } inline std::string* TraceConfig::release_unique_session_name() { // @@protoc_insertion_point(field_release:perfetto.protos.TraceConfig.unique_session_name) if (!has_unique_session_name()) { return nullptr; } _has_bits_[0] &= ~0x00000001u; return unique_session_name_.ReleaseNonDefaultNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); } inline void TraceConfig::set_allocated_unique_session_name(std::string* unique_session_name) { if (unique_session_name != nullptr) { _has_bits_[0] |= 0x00000001u; } else { _has_bits_[0] &= ~0x00000001u; } unique_session_name_.SetAllocatedNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), unique_session_name); // @@protoc_insertion_point(field_set_allocated:perfetto.protos.TraceConfig.unique_session_name) } // optional .perfetto.protos.TraceConfig.CompressionType compression_type = 24; inline bool TraceConfig::has_compression_type() const { return (_has_bits_[0] & 0x00200000u) != 0; } inline void TraceConfig::clear_compression_type() { compression_type_ = 0; _has_bits_[0] &= ~0x00200000u; } inline ::perfetto::protos::TraceConfig_CompressionType TraceConfig::compression_type() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.compression_type) return static_cast< ::perfetto::protos::TraceConfig_CompressionType >(compression_type_); } inline void TraceConfig::set_compression_type(::perfetto::protos::TraceConfig_CompressionType value) { assert(::perfetto::protos::TraceConfig_CompressionType_IsValid(value)); _has_bits_[0] |= 0x00200000u; compression_type_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.compression_type) } // optional .perfetto.protos.TraceConfig.IncidentReportConfig incident_report_config = 25; inline bool TraceConfig::has_incident_report_config() const { return (_has_bits_[0] & 0x00000080u) != 0; } inline void TraceConfig::clear_incident_report_config() { if (incident_report_config_ != nullptr) incident_report_config_->Clear(); _has_bits_[0] &= ~0x00000080u; } inline const ::perfetto::protos::TraceConfig_IncidentReportConfig& TraceConfig::incident_report_config() const { const ::perfetto::protos::TraceConfig_IncidentReportConfig* p = incident_report_config_; // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.incident_report_config) return p != nullptr ? *p : *reinterpret_cast<const ::perfetto::protos::TraceConfig_IncidentReportConfig*>( &::perfetto::protos::_TraceConfig_IncidentReportConfig_default_instance_); } inline ::perfetto::protos::TraceConfig_IncidentReportConfig* TraceConfig::release_incident_report_config() { // @@protoc_insertion_point(field_release:perfetto.protos.TraceConfig.incident_report_config) _has_bits_[0] &= ~0x00000080u; ::perfetto::protos::TraceConfig_IncidentReportConfig* temp = incident_report_config_; incident_report_config_ = nullptr; return temp; } inline ::perfetto::protos::TraceConfig_IncidentReportConfig* TraceConfig::mutable_incident_report_config() { _has_bits_[0] |= 0x00000080u; if (incident_report_config_ == nullptr) { auto* p = CreateMaybeMessage<::perfetto::protos::TraceConfig_IncidentReportConfig>(GetArenaNoVirtual()); incident_report_config_ = p; } // @@protoc_insertion_point(field_mutable:perfetto.protos.TraceConfig.incident_report_config) return incident_report_config_; } inline void TraceConfig::set_allocated_incident_report_config(::perfetto::protos::TraceConfig_IncidentReportConfig* incident_report_config) { ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaNoVirtual(); if (message_arena == nullptr) { delete incident_report_config_; } if (incident_report_config) { ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = nullptr; if (message_arena != submessage_arena) { incident_report_config = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( message_arena, incident_report_config, submessage_arena); } _has_bits_[0] |= 0x00000080u; } else { _has_bits_[0] &= ~0x00000080u; } incident_report_config_ = incident_report_config; // @@protoc_insertion_point(field_set_allocated:perfetto.protos.TraceConfig.incident_report_config) } // optional int64 trace_uuid_msb = 27; inline bool TraceConfig::has_trace_uuid_msb() const { return (_has_bits_[0] & 0x00100000u) != 0; } inline void TraceConfig::clear_trace_uuid_msb() { trace_uuid_msb_ = PROTOBUF_LONGLONG(0); _has_bits_[0] &= ~0x00100000u; } inline ::PROTOBUF_NAMESPACE_ID::int64 TraceConfig::trace_uuid_msb() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.trace_uuid_msb) return trace_uuid_msb_; } inline void TraceConfig::set_trace_uuid_msb(::PROTOBUF_NAMESPACE_ID::int64 value) { _has_bits_[0] |= 0x00100000u; trace_uuid_msb_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.trace_uuid_msb) } // optional int64 trace_uuid_lsb = 28; inline bool TraceConfig::has_trace_uuid_lsb() const { return (_has_bits_[0] & 0x00800000u) != 0; } inline void TraceConfig::clear_trace_uuid_lsb() { trace_uuid_lsb_ = PROTOBUF_LONGLONG(0); _has_bits_[0] &= ~0x00800000u; } inline ::PROTOBUF_NAMESPACE_ID::int64 TraceConfig::trace_uuid_lsb() const { // @@protoc_insertion_point(field_get:perfetto.protos.TraceConfig.trace_uuid_lsb) return trace_uuid_lsb_; } inline void TraceConfig::set_trace_uuid_lsb(::PROTOBUF_NAMESPACE_ID::int64 value) { _has_bits_[0] |= 0x00800000u; trace_uuid_lsb_ = value; // @@protoc_insertion_point(field_set:perfetto.protos.TraceConfig.trace_uuid_lsb) } #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // __GNUC__ // ------------------------------------------------------------------- // ------------------------------------------------------------------- // ------------------------------------------------------------------- // ------------------------------------------------------------------- // ------------------------------------------------------------------- // ------------------------------------------------------------------- // ------------------------------------------------------------------- // ------------------------------------------------------------------- // ------------------------------------------------------------------- // ------------------------------------------------------------------- // @@protoc_insertion_point(namespace_scope) } // namespace protos } // namespace perfetto PROTOBUF_NAMESPACE_OPEN template <> struct is_proto_enum< ::perfetto::protos::TraceConfig_BufferConfig_FillPolicy> : ::std::true_type {}; template <> struct is_proto_enum< ::perfetto::protos::TraceConfig_TriggerConfig_TriggerMode> : ::std::true_type {}; template <> struct is_proto_enum< ::perfetto::protos::TraceConfig_LockdownModeOperation> : ::std::true_type {}; template <> struct is_proto_enum< ::perfetto::protos::TraceConfig_CompressionType> : ::std::true_type {}; PROTOBUF_NAMESPACE_CLOSE // @@protoc_insertion_point(global_scope) #include <google/protobuf/port_undef.inc> #endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_protos_2fperfetto_2fconfig_2ftrace_5fconfig_2eproto
44.482981
159
0.777222
153db9426c0306a857e4118d13f4b1ff61922e97
633
h
C
released_plugins/v3d_plugins/neurontracing_neutube/src_neutube/neurolabi/gui/z3dcanvaseventlistener.h
zzhmark/vaa3d_tools
3ca418add85a59ac7e805d55a600b78330d7e53d
[ "MIT" ]
1
2021-12-27T19:14:03.000Z
2021-12-27T19:14:03.000Z
released_plugins/v3d_plugins/neurontracing_neutube/src_neutube/neurolabi/gui/z3dcanvaseventlistener.h
zzhmark/vaa3d_tools
3ca418add85a59ac7e805d55a600b78330d7e53d
[ "MIT" ]
1
2016-12-03T05:33:13.000Z
2016-12-03T05:33:13.000Z
released_plugins/v3d_plugins/neurontracing_neutube/src_neutube/neurolabi/gui/z3dcanvaseventlistener.h
zzhmark/vaa3d_tools
3ca418add85a59ac7e805d55a600b78330d7e53d
[ "MIT" ]
null
null
null
#ifndef Z3DCANVASEVENTLISTENER_H #define Z3DCANVASEVENTLISTENER_H #include <QEvent> // interface for all class that can receive z3dcanvas (QGLWidget) event // listener can be registed with the addEventListener(tofront or toback) function of Z3DCanvas // note: the listeners are called from front to back until event is accepted, so the order does matter. // If you want other listeners to receive the event too, don't accept it (set the sharing of ZEventListenerParameter // to true). // class Z3DCanvasEventListener { public: virtual void onEvent(QEvent *e, int w, int h) = 0; }; #endif // Z3DCANVASEVENTLISTENER_H
33.315789
122
0.763033
d178ad84086c22be6c195b4b5179419507e5b051
2,084
c
C
src/level.c
Lattay/FleeTheDungeon
411c92ef15d037b8ac586eee8f0aebc141f5e19a
[ "MIT" ]
null
null
null
src/level.c
Lattay/FleeTheDungeon
411c92ef15d037b8ac586eee8f0aebc141f5e19a
[ "MIT" ]
null
null
null
src/level.c
Lattay/FleeTheDungeon
411c92ef15d037b8ac586eee8f0aebc141f5e19a
[ "MIT" ]
null
null
null
#include <stdio.h> #include "level.h" #include <raylib.h> const char* level_msg_error(int code) { switch (code) { case 1: return "File not found."; case 2: return "Syntax error."; default: return ""; } } static void eat_spaces(FILE* f) { int c; do { c = fgetc(f); } while (c == ' ' || c == '\n' || c == '\r' || c == '\t'); if (c != EOF) { ungetc(c, f); } } int level_load(const char* filename, Level* data, Enemy** enemies, int* length, int* px, int* py) { int res; FILE* f = fopen(filename, "r"); if (!f) { return 1; } res = fscanf(f, "PLAYER %d %d", px, py); if (res <= 0) { fclose(f); return 2; } TraceLog(LOG_DEBUG, TextFormat("Player at (%d, %d)", *px, *py)); eat_spaces(f); res = fscanf(f, "ENEMIES %d", length); if (res <= 0) { fclose(f); return 2; } TraceLog(LOG_DEBUG, TextFormat("There are %d enemies", *length)); eat_spaces(f); *enemies = malloc(sizeof(Enemy) * *length); for (int i = 0; i < *length; ++i) { Enemy* e = &((*enemies)[i]); res = fscanf(f, "ENEMY %d (%d, %d)>(%d, %d)", &e->type, &e->x, &e->y, &e->dir_x, &e->dir_y); if (res <= 0) { fclose(f); free(*enemies); return 2; } TraceLog(LOG_DEBUG, TextFormat("Enemy at (%d, %d)", e->x, e->y)); e->nx = e->x; e->ny = e->y; eat_spaces(f); } res = fscanf(f, "MAP %d %d", &data->w, &data->h); if (res <= 0) { fclose(f); free(*enemies); return 2; } eat_spaces(f); Tile* map = malloc(sizeof(Tile) * data->w * data->h); for (int y = 0; y < data->h; ++y) { for (int x = 0; x < data->w; ++x) { int d; res = fscanf(f, "%d", &d); if (res <= 0) { fclose(f); free(*enemies); free(map); return 2; } eat_spaces(f); if (d <= NOT_A_TILE || d >= TILE_NUM) { map[x + data->w * y] = WALL; } else { map[x + data->w * y] = d; } } } data->map = map; res = fclose(f); return res == 0 ? 0 : 3; }
19.847619
71
0.46881
ff4cd218b1818f7ee67cfa25972bdc9e6f4761e1
2,855
h
C
src/tools/tools/0001.library/MdAggrCube.h
OpenCMISS-Dependencies/cube
bb425e6f75ee5dbdf665fa94b241b48deee11505
[ "Cube" ]
null
null
null
src/tools/tools/0001.library/MdAggrCube.h
OpenCMISS-Dependencies/cube
bb425e6f75ee5dbdf665fa94b241b48deee11505
[ "Cube" ]
null
null
null
src/tools/tools/0001.library/MdAggrCube.h
OpenCMISS-Dependencies/cube
bb425e6f75ee5dbdf665fa94b241b48deee11505
[ "Cube" ]
2
2016-09-19T00:16:05.000Z
2021-03-29T22:06:45.000Z
/**************************************************************************** ** CUBE http://www.scalasca.org/ ** ***************************************************************************** ** Copyright (c) 1998-2016 ** ** Forschungszentrum Juelich GmbH, Juelich Supercomputing Centre ** ** ** ** Copyright (c) 2009-2015 ** ** German Research School for Simulation Sciences GmbH, ** ** Laboratory for Parallel Programming ** ** ** ** This software may be modified and distributed under the terms of ** ** a BSD-style license. See the COPYING file in the package base ** ** directory for details. ** ****************************************************************************/ #ifndef MDAGGRCUBE_H_GUARD_ #define MDAGGRCUBE_H_GUARD_ #include <string> #include "Cube.h" #include "AggrCube.h" #include "algebra4.h" namespace cube { class Cube; class AggrCube; class CnodeMetric; class CnodeSubForest; class PrintableCCnode; class Region; class CRegion; class MdAggrCube : public AggrCube { friend class Cube; friend class AggrCube; public: MdAggrCube(); MdAggrCube( Cube& copy, int cache_size = 1 ); virtual ~MdAggrCube(); CnodeMetric* add_cnode_metric( CnodeMetric* metric ); CnodeMetric* get_cnode_metric( std::string stringified ); CnodeSubForest* get_forest(); virtual CubeMapping* get_cube_mapping( unsigned int id ) const; virtual unsigned int get_number_of_cubes() const; private: /** * Actual method to create a region. */ Region* def_region( const std::string& name, const std::string& mangled_name, const std::string& paradigm, const std::string& role, long begln, long endln, const std::string& url, const std::string& descr, const std::string& mod, uint32_t id, int cache_size ); /** * Actual method to create a cnode. */ Cnode* def_cnode( Region* callee, const std::string& mod, int line, Cnode* parent, uint32_t id, int cache_size ); std::map< std::string, CnodeMetric* > cnode_metrics; Cube* original_address; }; } #endif
30.698925
77
0.445184
7f520ad4d8329f4c4a6df2403b29e1a7eb1bf63e
13,669
c
C
pthreads/quadtree_solver.c
SienaCSISParallelProcessing/quadtree-jacobi
0db33ffd87816cd5a4757d438f2c506a745b5dd3
[ "MIT" ]
null
null
null
pthreads/quadtree_solver.c
SienaCSISParallelProcessing/quadtree-jacobi
0db33ffd87816cd5a4757d438f2c506a745b5dd3
[ "MIT" ]
null
null
null
pthreads/quadtree_solver.c
SienaCSISParallelProcessing/quadtree-jacobi
0db33ffd87816cd5a4757d438f2c506a745b5dd3
[ "MIT" ]
null
null
null
/* Jacobi solver on quadtree, pthreads version Jim Teresco, CSIS-335, Siena College, Fall 2021 */ #include <stdio.h> #include <stdlib.h> #include <math.h> #include <pthread.h> #include "quadtree.h" #include "macros.h" /* forward declaration for the thread function */ void *qsworker(void *); /* a few globals related to pthreads */ pthread_barrier_t barrier; pthread_mutex_t mutex; int num_threads; /* some other items are now global to simplify threading */ struct quadtree *root; int output_level; double jac_tol; int jac_maxiter; double ref_tol; int ref_maxiter; char filename[256]; /* a struct to pass to each of our threads that has the info about the simulation and its own variables it can use to */ typedef struct qsthread { int thread_num; pthread_t thread_id; } qsthread; /********************************/ /* problem definition functions */ /********************************/ static double initial_cond(double x, double y) { return 0; } /* the y=1 boundary condition */ static double bc_top(double x) { if (x < 0.5) return 1-2*x; return 0; } /* the y=0 boundary condition */ static double bc_bottom(double x) { return 0; } /* the x=0 boundary condition */ static double bc_left(double y) { if (y < 0.5) return 0; return 2*(y-0.5); } /* the x=1 boundary condition */ static double bc_right(double y) { return 0; } /* use this to apply special conditions like a point heat source in the interior of the domain. Return 1 if the leaf quadrant gets its values modified (modify both value and previous for simplicity), 0 otherwise. */ static int apply_other_bc(struct quadtree *leaf) { if (quadrant_contains(leaf, 0.8, 0.2)) { quadrant_set_value(leaf, 3); quadrant_set_previous(leaf, 3); return 1; } return 0; } /* function to set initial conditions on a given quadrant (callback) */ static void set_init_cond(void *data, struct quadtree *leaf) { quadrant_set_value(leaf, initial_cond(quadrant_centroid_x(leaf), quadrant_centroid_y(leaf))); } /* function to refine all quadrants in the form of a visitor callback */ static void do_refine(void *data, struct quadtree *leaf) { refine_leaf_quadrant(leaf); } /* structure used by the functions below to build and traverse a list of leaf quadrants that need to be refined */ struct ref_info_struct { double tol; struct quadtree_list *list; }; /* function to mark leaf quadrants if they have neighbors whose values differ by more than the refinement tolerance - form of a visitor callback */ static void check_if_refinement_needed(void *data, struct quadtree *leaf) { struct quadtree *nbr; struct ref_info_struct *info = (struct ref_info_struct *)data; int level = quadrant_level(leaf); char *dirs = "nsew"; int dir; /* check each neighbor */ for (dir = 0; dir < 4; dir++) { nbr = neighbor_quadrant(leaf, dirs[dir]); /* only compare neighbor values if the neighbor is at least as refined */ if (nbr && level <= quadrant_level(nbr) && fabs(quadrant_value(leaf) - quadrant_value(nbr)) > info->tol) { //mark_quadrant_for_refinement(leaf); /* add to the list */ struct quadtree_list *newnode = (struct quadtree_list *)malloc(sizeof(struct quadtree_list)); newnode->node = leaf; newnode->next = info->list; info->list = newnode; return; } } } /* function to do a refinement on any quadrant that has been marked for refinement */ static void refine_if_marked(void *data, struct quadtree *leaf) { int *any_ref = (int *)data; if (is_quadrant_marked_for_refinement(leaf)) { refine_leaf_quadrant(leaf); *any_ref += 1; } } /* check error and refine if necessary, return 0 if no refinement was needed, number of refinements done otherwise */ int calc_error_and_refine(struct quadtree *root, int start_lq, int end_lq, double tol) { int any_refs = 0; /* this structure encapsulates the tolerance we need to pass to the check_if_refinement_needed function, and the list that will be populated by that function of leaf quadrants to be refined. */ struct ref_info_struct data; data.tol = tol; data.list = NULL; /* find quadrants for refinement in this thread's range */ visit_leaf_quadrant_range(root, start_lq, end_lq, check_if_refinement_needed, &data); /* before anyone can start modifying the tree, let's make sure everyone's done traversing it */ pthread_barrier_wait(&barrier); /* traverse the list and do the actual refinements, free the nodes as we go */ struct quadtree_list *finger = data.list; while (finger != NULL) { refine_leaf_quadrant(finger->node); struct quadtree_list *deleteme = finger; finger = finger->next; free(deleteme); any_refs++; } return any_refs; } /* do a Jacobi iteration on one cell computing "previous" from "value" */ void do_jacobi_iter_phase1(void *data, struct quadtree *leaf) { /* data is NULL for this one */ double north, south, east, west; struct quadtree *nbr; /* apply special boundary conditions if necessary */ if (apply_other_bc(leaf)) return; /* look north */ nbr = neighbor_quadrant(leaf, 'n'); if (nbr) { north = quadrant_side_value(nbr, 's'); } else { north = bc_top(quadrant_centroid_x(leaf)); } /* look south */ nbr = neighbor_quadrant(leaf, 's'); if (nbr) { south = quadrant_side_value(nbr, 'n'); } else { south = bc_bottom(quadrant_centroid_x(leaf)); } /* look west */ nbr = neighbor_quadrant(leaf, 'w'); if (nbr) { west = quadrant_side_value(nbr, 'e'); } else { west = bc_left(quadrant_centroid_y(leaf)); } /* look east */ nbr = neighbor_quadrant(leaf, 'e'); if (nbr) { east = quadrant_side_value(nbr, 'w'); } else { east = bc_right(quadrant_centroid_y(leaf)); } quadrant_set_previous(leaf,(north + east + south + west)*0.25); } /* do a Jacobi iteration on one cell computing "value" from "previous" */ void do_jacobi_iter_phase2(void *data, struct quadtree *leaf) { /* data is a pointer to the max error (abs(previous-value)) for this iteration so far */ double *maxerr = (double *)data; double north, south, east, west; struct quadtree *nbr; /* apply special boundary conditions if necessary */ if (apply_other_bc(leaf)) return; /* look north */ nbr = neighbor_quadrant(leaf, 'n'); if (nbr) { north = quadrant_side_previous(nbr, 's'); } else { north = bc_top(quadrant_centroid_x(leaf)); } /* look south */ nbr = neighbor_quadrant(leaf, 's'); if (nbr) { south = quadrant_side_previous(nbr, 'n'); } else { south = bc_bottom(quadrant_centroid_x(leaf)); } /* look west */ nbr = neighbor_quadrant(leaf, 'w'); if (nbr) { west = quadrant_side_previous(nbr, 'e'); } else { west = bc_left(quadrant_centroid_y(leaf)); } /* look east */ nbr = neighbor_quadrant(leaf, 'e'); if (nbr) { east = quadrant_side_previous(nbr, 'w'); } else { east = bc_right(quadrant_centroid_y(leaf)); } quadrant_set_value(leaf, (north + east + south + west)*0.25); if (*maxerr < fabs(quadrant_value(leaf) - quadrant_previous(leaf))) { *maxerr = fabs(quadrant_value(leaf) - quadrant_previous(leaf)); } } /* main driver program */ int main(int argc, char *argv[]) { int i; int init_ref; FILE *fp; qsthread *thread_info; int rc; /* parse command-line parameters */ if (argc != 7) { fprintf(stderr, "Usage: %s: init_ref jac_tol jac_maxiter ref_tol ref_maxiteriter output_level\n", argv[0]); return 1; } /* first parameter is number of initial refinement levels */ init_ref = atoi(argv[1]); /* second parameter is Jacobi iteration tolerance */ jac_tol = atof(argv[2]); /* third parameter is maximum number of Jacobi iterations */ jac_maxiter = atoi(argv[3]); /* fourth parameter is refinement tolerance */ ref_tol = atof(argv[4]); /* fifth parameter is maximum number of refinements */ ref_maxiter = atoi(argv[5]); /* sixth parameter is an output level */ /* 0 = no solution output */ /* 1 = final solution only */ /* 2 = solution after each jacobi convergence */ /* 3 = solution after each iteration */ output_level = atoi(argv[6]); /* check for the number of threads to use from the NUM_THREADS environment variable */ num_threads = 1; char *thread_env = getenv("NUM_THREADS"); if (thread_env) { num_threads = atoi(thread_env); } // initialize our barrier pthread_barrier_init(&barrier, NULL, num_threads); // initialize our mutex pthread_mutex_init(&mutex, NULL); printf("Starting with parameters\n"); printf("Initial number of refinement levels: %d\n", init_ref); printf("Jacobi tolerance: %10.8f\n", jac_tol); printf("Maximum number of Jacobi iterations: %d\n", jac_maxiter); printf("Refinement tolerance: %10.8f\n", ref_tol); printf("Maximum number of refinements: %d\n", ref_maxiter); printf("Output level: %d\n", output_level); printf("Number of threads: %d\n", num_threads); /* create the root quadtree */ root = new_quadtree(1,0,0,1,0,NULL); /* refine down the requested number of levels globally to start up */ for (i=0; i<init_ref; i++) { visit_all_leaf_quadrants(root, do_refine, NULL); } /* insert initial conditions */ visit_all_leaf_quadrants(root, set_init_cond, NULL); /* print the initial solution */ if (output_level >= 3) { GRACEFULLY_OPEN(fp, "solution.0.0.dat", "w"); print_leaf_quadrants(fp, root); GRACEFULLY_CLOSE(fp, "solution.0.0.dat"); } /* allocate the info for threads and start them up */ thread_info = (qsthread *)malloc(num_threads*sizeof(qsthread)); for (int thread = 0; thread < num_threads; thread++) { thread_info[thread].thread_num = thread; rc = pthread_create(&(thread_info[thread].thread_id), NULL, qsworker, &(thread_info[thread])); if (rc != 0) { fprintf(stderr, "Could not create thread %d\n", thread); exit(1); } } /* do the threaded computation */ /* wait for the threads to finish */ for (int thread = 0; thread < num_threads; thread++) { pthread_join(thread_info[thread].thread_id, NULL); } /* are we printing the solution at the end only? */ if (output_level == 1) { GRACEFULLY_OPEN(fp, "solution.dat", "w"); print_leaf_quadrants(fp, root); GRACEFULLY_CLOSE(fp, "solution.dat"); } /* clean up */ free_quadtree(root); // clean up our thread barrier and mutex pthread_barrier_destroy(&barrier); pthread_mutex_destroy(&mutex); return 0; } /* The function to do the actual computation on each thread */ void *qsworker(void *arg) { int ref_count; int jac_iter_num; double local_max_jac_diff; double global_max_jac_diff; FILE *fp; int global_refs; qsthread *me = (qsthread *)arg; /* outer loop controls the adaptive refinement -- keep going until we compute a solution to acceptable accuracy. */ ref_count = -1; do { if (me->thread_num == 0) { printf("Compute on quadtree with %d leaves...\n", num_leaf_quadrants(root)); } ref_count++; /* Jacobi iteration until the solution settles down or we hit the max number of iterations */ jac_iter_num = 0; global_max_jac_diff = 0; // figure out what this thread is computing int start_lq = me->thread_num * num_leaf_quadrants(root) / num_threads; int end_lq = start_lq + num_leaf_quadrants(root) / num_threads - 1; do { visit_leaf_quadrant_range(root, start_lq, end_lq, do_jacobi_iter_phase1, NULL); /* are we printing every iteration? */ if (me->thread_num == 0 && output_level >= 3) { sprintf(filename, "solution.%d.%d.dat", ref_count, jac_iter_num+1); GRACEFULLY_OPEN(fp, filename, "w"); print_leaf_quadrants(fp, root); GRACEFULLY_CLOSE(fp, filename); } local_max_jac_diff = 0; visit_leaf_quadrant_range(root, start_lq, end_lq, do_jacobi_iter_phase2, &local_max_jac_diff); jac_iter_num += 2; /* we always do 2 iters */ // get the global max_diff before we make any decisions pthread_mutex_lock(&mutex); if (local_max_jac_diff > global_max_jac_diff) { global_max_jac_diff = local_max_jac_diff; } pthread_mutex_unlock(&mutex); // barrier here so we know everyone has contributed their max_diff pthread_barrier_wait(&barrier); /* are we printing every iteration? */ if (me->thread_num == 0 && output_level >= 3) { sprintf(filename, "solution.%d.%d.dat", ref_count, jac_iter_num); GRACEFULLY_OPEN(fp, filename, "w"); print_leaf_quadrants(fp, root); GRACEFULLY_CLOSE(fp, filename); } if (me->thread_num == 0) { printf("Completed Jacobi iteration %d, max_jac_diff=%f\n", jac_iter_num, global_max_jac_diff); } } while ((jac_iter_num < jac_maxiter) && (global_max_jac_diff > jac_tol)); /* are we printing every solution on each grid only? */ if (me->thread_num == 0 && output_level == 2) { sprintf(filename, "solution.%d.%d.dat", ref_count, jac_iter_num); GRACEFULLY_OPEN(fp, filename, "w"); print_leaf_quadrants(fp, root); GRACEFULLY_CLOSE(fp, filename); } /* only check for possible refinment if we haven't hit the refinement count limit */ global_refs = 0; if (ref_count <= ref_maxiter) { int local_refs = calc_error_and_refine(root, start_lq, end_lq, ref_tol); if (local_refs > 0) global_refs = 1; } pthread_barrier_wait(&barrier); } while ((ref_count <= ref_maxiter) && global_refs); return NULL; }
27.558468
111
0.670568
36b21ed6986288174c8f3984ae80fd275e514e2c
1,008
h
C
Sources/WFOAuth2/include/WFOAuth2/NSMutableURLRequest+WFOAuth2.h
danielmartinprieto/WFOAuth2
c06e57eeeeed9b13f672dc5867462414d8557e60
[ "MIT" ]
98
2016-06-15T23:11:11.000Z
2021-06-05T10:39:05.000Z
Sources/WFOAuth2/include/WFOAuth2/NSMutableURLRequest+WFOAuth2.h
danielmartinprieto/WFOAuth2
c06e57eeeeed9b13f672dc5867462414d8557e60
[ "MIT" ]
9
2016-06-16T17:22:24.000Z
2017-03-13T05:02:22.000Z
Sources/WFOAuth2/include/WFOAuth2/NSMutableURLRequest+WFOAuth2.h
danielmartinprieto/WFOAuth2
c06e57eeeeed9b13f672dc5867462414d8557e60
[ "MIT" ]
10
2016-06-17T03:32:48.000Z
2017-01-24T17:45:29.000Z
// // NSMutableURLRequest+WFOAuth2.h // WFOAuth2 // // Created by Conrad Kramer on 3/24/16. // Copyright © 2016 DeskConnect, Inc. All rights reserved. // #import <WFOAuth2/WFOAuth2Credential.h> NS_ASSUME_NONNULL_BEGIN @interface NSMutableURLRequest (WFOAuth2) /** Sets the authorization header of the request with the access token of the provided credential. @param credential The credential configure on the request. The token must be a bearer token. */ - (void)wfo_setAuthorizationWithCredential:(nullable WFOAuth2Credential *)credential; /** Sets the body of the request with the provided query items using form encoding. This method also sets the Content-Type header to @"application/x-www-form-urlencoded" @param queryItems The query items to set in the body of the request. */ - (void)wfo_setBodyWithQueryItems:(nullable NSArray<NSURLQueryItem *> *)queryItems; @end NS_ASSUME_NONNULL_END
30.545455
95
0.702381
d6327504f7a0f8813f11a19f69e27de8112fd1a3
9,001
h
C
tough_control/tough_controller_interface/include/tough_controller_interface/arm_control_interface.h
dcat52/wpi-humanoid-tough
22d7fa2eebff68ba3ca6bd2ec673ff22ce2a03da
[ "MIT" ]
null
null
null
tough_control/tough_controller_interface/include/tough_controller_interface/arm_control_interface.h
dcat52/wpi-humanoid-tough
22d7fa2eebff68ba3ca6bd2ec673ff22ce2a03da
[ "MIT" ]
null
null
null
tough_control/tough_controller_interface/include/tough_controller_interface/arm_control_interface.h
dcat52/wpi-humanoid-tough
22d7fa2eebff68ba3ca6bd2ec673ff22ce2a03da
[ "MIT" ]
null
null
null
#ifndef ARM_CONTROL_INTERFACE_H #define ARM_CONTROL_INTERFACE_H #include <ros/ros.h> #include <ihmc_msgs/ArmTrajectoryRosMessage.h> #include <ihmc_msgs/OneDoFJointTrajectoryRosMessage.h> #include <ihmc_msgs/TrajectoryPoint1DRosMessage.h> #include <ihmc_msgs/HandDesiredConfigurationRosMessage.h> #include <ihmc_msgs/HandTrajectoryRosMessage.h> #include <ihmc_msgs/SE3TrajectoryPointRosMessage.h> #include <ihmc_msgs/GoHomeRosMessage.h> #include <geometry_msgs/Pose.h> #include <trajectory_msgs/JointTrajectory.h> #include <tf/transform_listener.h> #include <tf/tf.h> #include "tough_common/robot_state.h" #include "tough_common/robot_description.h" #include "tough_controller_interface/tough_controller_interface.h" /** * @brief The ArmControlInterface class provides ability to move arms of humanoid robots supported by open-humanoids-software. */ class ArmControlInterface: public ToughControllerInterface { public: /** * @brief ArmControlInterface class provides ability to move arms of humanoid robots supported by open-humanoids-software. * @param nh nodehandle to which subscribers and publishers are attached. */ ArmControlInterface(ros::NodeHandle nh); ~ArmControlInterface(); /** * @brief The armJointData struct is a structure that can store details required to generate a ros message for controlling arm. RobotSide can be * either RIGHT or LEFT. arm_pose is a vector of float of size 7 that stores joint angels of all 7 joints in the arm. Time is the relative * time for executing the trajectory but it increments for every additional trajectory point. For example: if a trajectory needs to be in * pose 1 at 2sec, pose 2 at 5sec, then create 2 objects of this struct one for pose 1 and other for pose 2. pose1 object will have time=2 * and pose2 will have time=5. */ struct ArmJointData { RobotSide side; std::vector<double> arm_pose; float time; }; /** * @brief The armTaskSpaceData struct is a structure that can store details required to generate a ros message for controlling the hand trajectory in task space. * side can be either RIGHT or LEFT. pose is a Pose in task space (world frame) that the hand should move to. time is the total execution time of the trajectory. */ struct ArmTaskSpaceData { RobotSide side; geometry_msgs::Pose pose; float time; }; /** * @brief moveToDefaultPose Moves the robot arm to default position * @param side Side of the robot. It can be RIGHT or LEFT. */ void moveToDefaultPose(RobotSide side, float time=2.0f); /** * @brief moveToZeroPose Moves the robot arm to zero position. * @param side Side of the robot. It can be RIGHT or LEFT. */ void moveToZeroPose(RobotSide side, float time=2.0f); /** * @brief moveArmJoints Moves arm joints to given joint angles. All angles in radians. * @param side Side of the robot. It can be RIGHT or LEFT. * @param arm_pose A vector that stores a vector with 7 values one for each joint. Number of values in the vector are the number of trajectory points. * @param time Total time to execute the trajectory. each trajectory point is equally spaced in time. */ bool moveArmJoints(const RobotSide side, const std::vector<std::vector<double> > &arm_pose, const float time); /** * @brief generateArmMessage Generates ros message to be sent to the arm, but does not publish anything. * @param side Side of the robot. It can be RIGHT or LEFT. * @param arm_pose A vector that stores a vector with 7 values one for each joint. Number of values in the vector are the number of trajectory points. * @param time Total time to execute the trajectory. each trajectory point is equally spaced in time. * @param msg The message is generated in this reference. * @return */ bool generateArmMessage(const RobotSide side, const std::vector<std::vector<double> > &arm_pose, const float time, ihmc_msgs::ArmTrajectoryRosMessage &msg); /** * @brief moveArmJoints Moves arm joints to given joint angles. All angles in radians. * @param arm_data A vector of armJointData struct. This allows customization of individual trajectory points. For example, * each point can have different execution times. */ bool moveArmJoints(std::vector<ArmJointData> &arm_data); /** * @brief moveArmMessage Publishes a given ros message of ihmc_msgs::ArmTrajectoryRosMessage format to the robot. * @param msg message to be sent to the robot. */ void moveArmMessage(const ihmc_msgs::ArmTrajectoryRosMessage &msg); /** * @brief getnumArmJoints Gives back the number of arm joints for Valkyrie R5 * @return */ int getnumArmJoints() const; /** * @brief closeHand Closed the hand on the give side of Valkyrie R5. * @param side Side of the robot. It can be RIGHT or LEFT. */ void closeHand(const RobotSide side); /** * @brief moveArmInTaskSpaceMessage Moves the arm to a given point in task space (world frame) * @parm side Side of the robot. It can be RIGHT or LEFT. * @param point The point in task space to move the arm to. */ // void moveArmInTaskSpaceMessage(const RobotSide side, const ihmc_msgs::SE3TrajectoryPointRosMessage &point, int baseForControl=ihmc_msgs::FrameInformationRosMessage::CHEST_FRAME); void moveArmInTaskSpaceMessage(const RobotSide side, const ihmc_msgs::SE3TrajectoryPointRosMessage &point, int baseForControl=0); /** * @brief moveArmInTaskSpace Moves the arm to a give pose in task space (world frame) * @param side Side of the robot. It can be RIGHT or LEFT. * @param pose The pose in task space to move the arm to. * @param time Total time to execute the trajectory. */ void moveArmInTaskSpace(const RobotSide side, const geometry_msgs::Pose &pose, const float time); /** * @brief moveArmInTaskSpace Moves the arm(s) to the given position in task space (world frame). * @param arm_data A vector of armTaskSpaceData struct. */ // void moveArmInTaskSpace(std::vector<armTaskSpaceData> &arm_data, int baseForControl=ihmc_msgs::FrameInformationRosMessage::CHEST_FRAME); void moveArmInTaskSpace(std::vector<ArmTaskSpaceData> &arm_data, int baseForControl=-102); /** * @brief moveArmTrajectory Moves the arm to follow a particular trajectory plan * @param side Side of the robot. It can be RIGHT or LEFT. * @param traj Trajectory in the form of trajectory_msgs::JointTrajectory */ void moveArmTrajectory(const RobotSide side, const trajectory_msgs::JointTrajectory &traj); void testPrint(); /** * @brief nudgeArm Nudges the Arm in the desired direction by a given nudge step * @param side Side of the Robot. it can be LEFT or RIGHT * @param drct Which side we want to nudge. UP, DOWN, LEFT, RIGHT, FRONT or BACK * @param nudgeStep The step length to nudge. Default is 5cm (~6/32") * @return */ bool nudgeArm(const RobotSide side, const direction drct, float nudgeStep = 0.05); bool nudgeArmLocal(const RobotSide side, const direction drct, float nudgeStep = 0.05); bool generate_task_space_data(const std::vector<geometry_msgs::PoseStamped>& input_poses,const RobotSide input_side,const float desired_time, std::vector<ArmControlInterface::ArmTaskSpaceData> &arm_data_vector); bool moveArmJoint(const RobotSide side, int jointNumber, const float targetAngle, float time=2.0f); bool nudgeArmLocal(const RobotSide side, float x, float y, float z,geometry_msgs::Pose &pose); bool nudgeArmPelvis(const RobotSide side, float x, float y, float z,geometry_msgs::Pose &pose); virtual bool getJointSpaceState(std::vector<double> &joints, RobotSide side) override; virtual bool getTaskSpaceState(geometry_msgs::Pose &pose, RobotSide side, std::string fixedFrame = TOUGH_COMMON_NAMES::WORLD_TF) override; private: const std::vector<double> ZERO_POSE; int NUM_ARM_JOINTS; std::vector<std::pair<double, double> > joint_limits_left_; std::vector<std::pair<double, double> > joint_limits_right_; ros::Publisher armTrajectoryPublisher; ros::Publisher handTrajectoryPublisher; ros::Publisher taskSpaceTrajectoryPublisher; ros::Publisher homePositionPublisher; ros::Publisher markerPub_; ros::Subscriber armTrajectorySubscriber; void poseToSE3TrajectoryPoint(const geometry_msgs::Pose &pose, ihmc_msgs::SE3TrajectoryPointRosMessage &point); void appendTrajectoryPoint(ihmc_msgs::ArmTrajectoryRosMessage &msg, float time, std::vector<double> pos); void appendTrajectoryPoint(ihmc_msgs::ArmTrajectoryRosMessage &msg, trajectory_msgs::JointTrajectoryPoint point); }; #endif // ARM_CONTROL_INTERFACE_H
47.87766
215
0.723808
963fa8c1b8f1d936aa456b73b575b859b1871c5f
678
c
C
nacl/crypto_stream/aes128ctr/portable/stream.c
bAndie91/curvedns
f6dc1e7f07b8b0826cc2ac1ed52ce194f4a26efd
[ "BSD-2-Clause-FreeBSD" ]
51
2015-02-26T23:24:30.000Z
2022-03-12T15:05:46.000Z
node_modules/js-nacl/nacl-20110221+Ed25519-20130419/crypto_stream/aes128ctr/portable/stream.c
openilabs/crypto
4c053a7c932f4afb5ec09b468496e861b5fc5ef1
[ "MIT" ]
7
2017-04-23T21:11:55.000Z
2020-12-17T20:19:56.000Z
node_modules/js-nacl/nacl-20110221+Ed25519-20130419/crypto_stream/aes128ctr/portable/stream.c
openilabs/crypto
4c053a7c932f4afb5ec09b468496e861b5fc5ef1
[ "MIT" ]
15
2015-10-29T14:21:58.000Z
2022-01-19T07:33:14.000Z
#include "crypto_stream.h" int crypto_stream( unsigned char *out, unsigned long long outlen, const unsigned char *n, const unsigned char *k ) { unsigned char d[crypto_stream_BEFORENMBYTES]; crypto_stream_beforenm(d, k); crypto_stream_afternm(out, outlen, n, d); return 0; } int crypto_stream_xor( unsigned char *out, const unsigned char *in, unsigned long long inlen, const unsigned char *n, const unsigned char *k ) { unsigned char d[crypto_stream_BEFORENMBYTES]; crypto_stream_beforenm(d, k); crypto_stream_xor_afternm(out, in, inlen, n, d); return 0; }
23.37931
52
0.637168
d0ea24affa0b815c7d69ac4f9207d22b790af5c9
2,024
c
C
kubernetes/unit-test/test_v1beta1_role_binding.c
minerba/c
8eb6593e55d0e5d57a2dd3153c15c9645de677bc
[ "Apache-2.0" ]
69
2020-03-17T13:47:05.000Z
2022-03-30T08:25:05.000Z
kubernetes/unit-test/test_v1beta1_role_binding.c
minerba/c
8eb6593e55d0e5d57a2dd3153c15c9645de677bc
[ "Apache-2.0" ]
115
2020-03-17T14:53:19.000Z
2022-03-31T11:31:30.000Z
kubernetes/unit-test/test_v1beta1_role_binding.c
minerba/c
8eb6593e55d0e5d57a2dd3153c15c9645de677bc
[ "Apache-2.0" ]
28
2020-03-17T13:42:21.000Z
2022-03-19T23:37:16.000Z
#ifndef v1beta1_role_binding_TEST #define v1beta1_role_binding_TEST // the following is to include only the main from the first c file #ifndef TEST_MAIN #define TEST_MAIN #define v1beta1_role_binding_MAIN #endif // TEST_MAIN #include <stdlib.h> #include <string.h> #include <stdio.h> #include <stdbool.h> #include "../external/cJSON.h" #include "../model/v1beta1_role_binding.h" v1beta1_role_binding_t* instantiate_v1beta1_role_binding(int include_optional); #include "test_v1_object_meta.c" #include "test_v1beta1_role_ref.c" v1beta1_role_binding_t* instantiate_v1beta1_role_binding(int include_optional) { v1beta1_role_binding_t* v1beta1_role_binding = NULL; if (include_optional) { v1beta1_role_binding = v1beta1_role_binding_create( "0", "0", // false, not to have infinite recursion instantiate_v1_object_meta(0), // false, not to have infinite recursion instantiate_v1beta1_role_ref(0), list_create() ); } else { v1beta1_role_binding = v1beta1_role_binding_create( "0", "0", NULL, NULL, list_create() ); } return v1beta1_role_binding; } #ifdef v1beta1_role_binding_MAIN void test_v1beta1_role_binding(int include_optional) { v1beta1_role_binding_t* v1beta1_role_binding_1 = instantiate_v1beta1_role_binding(include_optional); cJSON* jsonv1beta1_role_binding_1 = v1beta1_role_binding_convertToJSON(v1beta1_role_binding_1); printf("v1beta1_role_binding :\n%s\n", cJSON_Print(jsonv1beta1_role_binding_1)); v1beta1_role_binding_t* v1beta1_role_binding_2 = v1beta1_role_binding_parseFromJSON(jsonv1beta1_role_binding_1); cJSON* jsonv1beta1_role_binding_2 = v1beta1_role_binding_convertToJSON(v1beta1_role_binding_2); printf("repeating v1beta1_role_binding:\n%s\n", cJSON_Print(jsonv1beta1_role_binding_2)); } int main() { test_v1beta1_role_binding(1); test_v1beta1_role_binding(0); printf("Hello world \n"); return 0; } #endif // v1beta1_role_binding_MAIN #endif // v1beta1_role_binding_TEST
28.507042
113
0.77668
5cbf75f6187e5b49a022f35bbb8e641d9b97b107
36,827
c
C
src/vnet/devices/virtio/pci.c
adwait1-G/vpp
5f9f3c8de8d5d9f83a437661a98e5cc2453705f9
[ "Apache-2.0" ]
null
null
null
src/vnet/devices/virtio/pci.c
adwait1-G/vpp
5f9f3c8de8d5d9f83a437661a98e5cc2453705f9
[ "Apache-2.0" ]
null
null
null
src/vnet/devices/virtio/pci.c
adwait1-G/vpp
5f9f3c8de8d5d9f83a437661a98e5cc2453705f9
[ "Apache-2.0" ]
null
null
null
/* * Copyright (c) 2018 Cisco and/or its affiliates. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <fcntl.h> #include <sys/ioctl.h> #include <vppinfra/types.h> #include <vlib/vlib.h> #include <vlib/pci/pci.h> #include <vnet/ethernet/ethernet.h> #include <vnet/ip/ip4_packet.h> #include <vnet/ip/ip6_packet.h> #include <vnet/devices/virtio/virtio.h> #include <vnet/devices/virtio/pci.h> #define PCI_VENDOR_ID_VIRTIO 0x1af4 #define PCI_DEVICE_ID_VIRTIO_NIC 0x1000 /* Doesn't support modern device */ #define PCI_DEVICE_ID_VIRTIO_NIC_MODERN 0x1041 #define PCI_CAPABILITY_LIST 0x34 #define PCI_CAP_ID_VNDR 0x09 #define PCI_CAP_ID_MSIX 0x11 #define PCI_MSIX_ENABLE 0x8000 #define PCI_CONFIG_SIZE(vif) ((vif->msix_enabled == VIRTIO_MSIX_ENABLED) ? \ 24 : 20) static pci_device_id_t virtio_pci_device_ids[] = { { .vendor_id = PCI_VENDOR_ID_VIRTIO, .device_id = PCI_DEVICE_ID_VIRTIO_NIC}, { .vendor_id = PCI_VENDOR_ID_VIRTIO, .device_id = PCI_DEVICE_ID_VIRTIO_NIC_MODERN}, {0}, }; static void virtio_pci_legacy_read_config (vlib_main_t * vm, virtio_if_t * vif, void *dst, int len, u32 addr) { u32 size = 0; vlib_pci_dev_handle_t h = vif->pci_dev_handle; while (len > 0) { if (len >= 4) { size = 4; vlib_pci_read_io_u32 (vm, h, PCI_CONFIG_SIZE (vif) + addr, dst); } else if (len >= 2) { size = 2; vlib_pci_read_io_u16 (vm, h, PCI_CONFIG_SIZE (vif) + addr, dst); } else { size = 1; vlib_pci_read_io_u8 (vm, h, PCI_CONFIG_SIZE (vif) + addr, dst); } dst = (u8 *) dst + size; addr += size; len -= size; } } static void virtio_pci_legacy_write_config (vlib_main_t * vm, virtio_if_t * vif, void *src, int len, u32 addr) { u32 size = 0; vlib_pci_dev_handle_t h = vif->pci_dev_handle; while (len > 0) { if (len >= 4) { size = 4; vlib_pci_write_io_u32 (vm, h, PCI_CONFIG_SIZE (vif) + addr, src); } else if (len >= 2) { size = 2; vlib_pci_write_io_u16 (vm, h, PCI_CONFIG_SIZE (vif) + addr, src); } else { size = 1; vlib_pci_write_io_u8 (vm, h, PCI_CONFIG_SIZE (vif) + addr, src); } src = (u8 *) src + size; addr += size; len -= size; } } static u64 virtio_pci_legacy_get_features (vlib_main_t * vm, virtio_if_t * vif) { u32 features; vlib_pci_read_io_u32 (vm, vif->pci_dev_handle, VIRTIO_PCI_HOST_FEATURES, &features); return features; } static u32 virtio_pci_legacy_set_features (vlib_main_t * vm, virtio_if_t * vif, u64 features) { if ((features >> 32) != 0) { clib_warning ("only 32 bit features are allowed for legacy virtio!"); } u32 feature = 0, guest_features = (u32) features; vlib_pci_write_io_u32 (vm, vif->pci_dev_handle, VIRTIO_PCI_GUEST_FEATURES, &guest_features); vlib_pci_read_io_u32 (vm, vif->pci_dev_handle, VIRTIO_PCI_GUEST_FEATURES, &feature); return feature; } static u8 virtio_pci_legacy_get_status (vlib_main_t * vm, virtio_if_t * vif) { u8 status = 0; vlib_pci_read_io_u8 (vm, vif->pci_dev_handle, VIRTIO_PCI_STATUS, &status); return status; } static void virtio_pci_legacy_set_status (vlib_main_t * vm, virtio_if_t * vif, u8 status) { if (status != VIRTIO_CONFIG_STATUS_RESET) status |= virtio_pci_legacy_get_status (vm, vif); vlib_pci_write_io_u8 (vm, vif->pci_dev_handle, VIRTIO_PCI_STATUS, &status); } static u8 virtio_pci_legacy_reset (vlib_main_t * vm, virtio_if_t * vif) { virtio_pci_legacy_set_status (vm, vif, VIRTIO_CONFIG_STATUS_RESET); return virtio_pci_legacy_get_status (vm, vif); } static u8 virtio_pci_legacy_get_isr (vlib_main_t * vm, virtio_if_t * vif) { u8 isr = 0; vlib_pci_read_io_u8 (vm, vif->pci_dev_handle, VIRTIO_PCI_ISR, &isr); return isr; } static u16 virtio_pci_legacy_get_queue_num (vlib_main_t * vm, virtio_if_t * vif, u16 queue_id) { u16 queue_num = 0; vlib_pci_write_io_u16 (vm, vif->pci_dev_handle, VIRTIO_PCI_QUEUE_SEL, &queue_id); vlib_pci_read_io_u16 (vm, vif->pci_dev_handle, VIRTIO_PCI_QUEUE_NUM, &queue_num); return queue_num; } static int virtio_pci_legacy_setup_queue (vlib_main_t * vm, virtio_if_t * vif, u16 queue_id, void *p) { u64 addr = vlib_physmem_get_pa (vm, p) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT; u32 addr2 = 0; vlib_pci_write_io_u16 (vm, vif->pci_dev_handle, VIRTIO_PCI_QUEUE_SEL, &queue_id); vlib_pci_write_io_u32 (vm, vif->pci_dev_handle, VIRTIO_PCI_QUEUE_PFN, (u32 *) & addr); vlib_pci_read_io_u32 (vm, vif->pci_dev_handle, VIRTIO_PCI_QUEUE_PFN, &addr2); if ((u32) addr == addr2) return 0; return 1; } static void virtio_pci_legacy_del_queue (vlib_main_t * vm, virtio_if_t * vif, u16 queue_id) { u32 src = 0; vlib_pci_write_io_u16 (vm, vif->pci_dev_handle, VIRTIO_PCI_QUEUE_SEL, &queue_id); vlib_pci_write_io_u32 (vm, vif->pci_dev_handle, VIRTIO_PCI_QUEUE_PFN, &src); } inline void virtio_pci_legacy_notify_queue (vlib_main_t * vm, virtio_if_t * vif, u16 queue_id) { vlib_pci_write_io_u16 (vm, vif->pci_dev_handle, VIRTIO_PCI_QUEUE_NOTIFY, &queue_id); } /* Enable one vector (0) for Link State Intrerrupt */ static u16 virtio_pci_legacy_set_config_irq (vlib_main_t * vm, virtio_if_t * vif, u16 vec) { vlib_pci_write_io_u16 (vm, vif->pci_dev_handle, VIRTIO_MSI_CONFIG_VECTOR, &vec); vlib_pci_read_io_u16 (vm, vif->pci_dev_handle, VIRTIO_MSI_CONFIG_VECTOR, &vec); return vec; } static u16 virtio_pci_legacy_set_queue_irq (vlib_main_t * vm, virtio_if_t * vif, u16 vec, u16 queue_id) { vlib_pci_write_io_u16 (vm, vif->pci_dev_handle, VIRTIO_PCI_QUEUE_SEL, &queue_id); vlib_pci_write_io_u16 (vm, vif->pci_dev_handle, VIRTIO_MSI_QUEUE_VECTOR, &vec); vlib_pci_read_io_u16 (vm, vif->pci_dev_handle, VIRTIO_MSI_QUEUE_VECTOR, &vec); return vec; } static u32 virtio_pci_flag_change (vnet_main_t * vnm, vnet_hw_interface_t * hw, u32 flags) { return 0; } static clib_error_t * virtio_pci_get_max_virtqueue_pairs (vlib_main_t * vm, virtio_if_t * vif) { virtio_net_config_t config; clib_error_t *error = 0; u16 max_queue_pairs = 1; if (vif->features & VIRTIO_FEATURE (VIRTIO_NET_F_MQ)) { virtio_pci_legacy_read_config (vm, vif, &config.max_virtqueue_pairs, sizeof (config.max_virtqueue_pairs), STRUCT_OFFSET_OF (virtio_net_config_t, max_virtqueue_pairs)); max_queue_pairs = config.max_virtqueue_pairs; } virtio_log_debug (vif, "max queue pair is %x", max_queue_pairs); if (max_queue_pairs < 1 || max_queue_pairs > 0x8000) return clib_error_return (error, "max queue pair is %x", max_queue_pairs); vif->max_queue_pairs = max_queue_pairs; return error; } static void virtio_pci_set_mac (vlib_main_t * vm, virtio_if_t * vif) { virtio_pci_legacy_write_config (vm, vif, vif->mac_addr, sizeof (vif->mac_addr), 0); } static u32 virtio_pci_get_mac (vlib_main_t * vm, virtio_if_t * vif) { if (vif->features & VIRTIO_FEATURE (VIRTIO_NET_F_MAC)) { virtio_pci_legacy_read_config (vm, vif, vif->mac_addr, sizeof (vif->mac_addr), 0); return 0; } return 1; } static u16 virtio_pci_is_link_up (vlib_main_t * vm, virtio_if_t * vif) { /* * Minimal driver: assumes link is up */ u16 status = 1; if (vif->features & VIRTIO_FEATURE (VIRTIO_NET_F_STATUS)) virtio_pci_legacy_read_config (vm, vif, &status, sizeof (status), /* mac */ STRUCT_OFFSET_OF (virtio_net_config_t, status)); return status; } static void virtio_pci_irq_0_handler (vlib_main_t * vm, vlib_pci_dev_handle_t h, u16 line) { vnet_main_t *vnm = vnet_get_main (); virtio_main_t *vim = &virtio_main; uword pd = vlib_pci_get_private_data (vm, h); virtio_if_t *vif = pool_elt_at_index (vim->interfaces, pd); u16 qid = line; vnet_device_input_set_interrupt_pending (vnm, vif->hw_if_index, qid); } static void virtio_pci_irq_1_handler (vlib_main_t * vm, vlib_pci_dev_handle_t h, u16 line) { vnet_main_t *vnm = vnet_get_main (); virtio_main_t *vim = &virtio_main; uword pd = vlib_pci_get_private_data (vm, h); virtio_if_t *vif = pool_elt_at_index (vim->interfaces, pd); if (virtio_pci_is_link_up (vm, vif) & VIRTIO_NET_S_LINK_UP) { vif->flags |= VIRTIO_IF_FLAG_ADMIN_UP; vnet_hw_interface_set_flags (vnm, vif->hw_if_index, VNET_HW_INTERFACE_FLAG_LINK_UP); } else { vif->flags &= ~VIRTIO_IF_FLAG_ADMIN_UP; vnet_hw_interface_set_flags (vnm, vif->hw_if_index, 0); } } static void virtio_pci_irq_handler (vlib_main_t * vm, vlib_pci_dev_handle_t h) { virtio_main_t *vim = &virtio_main; uword pd = vlib_pci_get_private_data (vm, h); virtio_if_t *vif = pool_elt_at_index (vim->interfaces, pd); u8 isr = 0; u16 line = 0; isr = virtio_pci_legacy_get_isr (vm, vif); /* * If the lower bit is set: look through the used rings of * all virtqueues for the device, to see if any progress has * been made by the device which requires servicing. */ if (isr & VIRTIO_PCI_ISR_INTR) virtio_pci_irq_0_handler (vm, h, line); if (isr & VIRTIO_PCI_ISR_CONFIG) virtio_pci_irq_1_handler (vm, h, line); } inline void device_status (vlib_main_t * vm, virtio_if_t * vif) { struct status_struct { u8 bit; char *str; }; struct status_struct *status_entry; static struct status_struct status_array[] = { #define _(s,b) { .str = #s, .bit = b, }, foreach_virtio_config_status_flags #undef _ {.str = NULL} }; vlib_cli_output (vm, " status 0x%x", vif->status); status_entry = (struct status_struct *) &status_array; while (status_entry->str) { if (vif->status & status_entry->bit) vlib_cli_output (vm, " %s (%x)", status_entry->str, status_entry->bit); status_entry++; } } inline void debug_device_config_space (vlib_main_t * vm, virtio_if_t * vif) { u32 data_u32; u16 data_u16; u8 data_u8; vlib_pci_read_io_u32 (vm, vif->pci_dev_handle, VIRTIO_PCI_HOST_FEATURES, &data_u32); vlib_cli_output (vm, "remote features 0x%lx", data_u32); vlib_pci_read_io_u32 (vm, vif->pci_dev_handle, VIRTIO_PCI_GUEST_FEATURES, &data_u32); vlib_cli_output (vm, "guest features 0x%lx", data_u32); vlib_pci_read_io_u32 (vm, vif->pci_dev_handle, VIRTIO_PCI_QUEUE_PFN, &data_u32); vlib_cli_output (vm, "queue address 0x%lx", data_u32); vlib_pci_read_io_u16 (vm, vif->pci_dev_handle, VIRTIO_PCI_QUEUE_NUM, &data_u16); vlib_cli_output (vm, "queue size 0x%x", data_u16); vlib_pci_read_io_u16 (vm, vif->pci_dev_handle, VIRTIO_PCI_QUEUE_SEL, &data_u16); vlib_cli_output (vm, "queue select 0x%x", data_u16); vlib_pci_read_io_u16 (vm, vif->pci_dev_handle, VIRTIO_PCI_QUEUE_NOTIFY, &data_u16); vlib_cli_output (vm, "queue notify 0x%x", data_u16); vlib_pci_read_io_u8 (vm, vif->pci_dev_handle, VIRTIO_PCI_STATUS, &data_u8); vlib_cli_output (vm, "status 0x%x", data_u8); vlib_pci_read_io_u8 (vm, vif->pci_dev_handle, VIRTIO_PCI_ISR, &data_u8); vlib_cli_output (vm, "isr 0x%x", data_u8); if (vif->msix_enabled == VIRTIO_MSIX_ENABLED) { vlib_pci_read_io_u16 (vm, vif->pci_dev_handle, VIRTIO_MSI_CONFIG_VECTOR, &data_u16); vlib_cli_output (vm, "config vector 0x%x", data_u16); u16 queue_id = 0; vlib_pci_write_io_u16 (vm, vif->pci_dev_handle, VIRTIO_PCI_QUEUE_SEL, &queue_id); vlib_pci_read_io_u16 (vm, vif->pci_dev_handle, VIRTIO_MSI_QUEUE_VECTOR, &data_u16); vlib_cli_output (vm, "queue vector for queue (0) 0x%x", data_u16); } u8 mac[6]; virtio_pci_legacy_read_config (vm, vif, mac, sizeof (mac), 0); vlib_cli_output (vm, "mac %U", format_ethernet_address, mac); virtio_pci_legacy_read_config (vm, vif, &data_u16, sizeof (u16), /* offset to status */ 6); vlib_cli_output (vm, "link up/down status 0x%x", data_u16); virtio_pci_legacy_read_config (vm, vif, &data_u16, sizeof (u16), /* offset to max_virtqueue */ 8); vlib_cli_output (vm, "num of virtqueue 0x%x", data_u16); virtio_pci_legacy_read_config (vm, vif, &data_u16, sizeof (u16), /* offset to mtu */ 10); vlib_cli_output (vm, "mtu 0x%x", data_u16); u32 i = PCI_CONFIG_SIZE (vif) + 12, a = 4; i += a; i &= ~a; for (; i < 64; i += 4) { u32 data = 0; vlib_pci_read_io_u32 (vm, vif->pci_dev_handle, i, &data); vlib_cli_output (vm, "0x%lx", data); } } struct virtio_ctrl_msg { struct virtio_net_ctrl_hdr ctrl; virtio_net_ctrl_ack status; u8 data[1024]; }; static int virtio_pci_send_ctrl_msg (vlib_main_t * vm, virtio_if_t * vif, struct virtio_ctrl_msg *data, u32 len) { virtio_vring_t *vring = vif->cxq_vring; virtio_net_ctrl_ack status = VIRTIO_NET_ERR; struct virtio_ctrl_msg result; u32 buffer_index; vlib_buffer_t *b; u16 used, next, avail; u16 sz = vring->size; u16 mask = sz - 1; used = vring->desc_in_use; next = vring->desc_next; avail = vring->avail->idx; struct vring_desc *d = &vring->desc[next]; if (vlib_buffer_alloc (vm, &buffer_index, 1)) b = vlib_get_buffer (vm, buffer_index); else return VIRTIO_NET_ERR; /* * current_data may not be initialized with 0 and may contain * previous offset. */ b->current_data = 0; clib_memcpy (vlib_buffer_get_current (b), data, sizeof (struct virtio_ctrl_msg)); d->flags = VRING_DESC_F_NEXT; d->addr = vlib_buffer_get_current_pa (vm, b); d->len = sizeof (struct virtio_net_ctrl_hdr); vring->avail->ring[avail & mask] = next; avail++; next = (next + 1) & mask; d->next = next; used++; d = &vring->desc[next]; d->flags = VRING_DESC_F_NEXT; d->addr = vlib_buffer_get_current_pa (vm, b) + STRUCT_OFFSET_OF (struct virtio_ctrl_msg, data); d->len = len; next = (next + 1) & mask; d->next = next; used++; d = &vring->desc[next]; d->flags = VRING_DESC_F_WRITE; d->addr = vlib_buffer_get_current_pa (vm, b) + STRUCT_OFFSET_OF (struct virtio_ctrl_msg, status); d->len = sizeof (data->status); next = (next + 1) & mask; used++; CLIB_MEMORY_STORE_BARRIER (); vring->avail->idx = avail; vring->desc_next = next; vring->desc_in_use = used; if ((vring->used->flags & VIRTIO_RING_FLAG_MASK_INT) == 0) { virtio_kick (vm, vring, vif); } u16 last = vring->last_used_idx, n_left = 0; n_left = vring->used->idx - last; while (n_left) { struct vring_used_elem *e = &vring->used->ring[last & mask]; u16 slot = e->id; d = &vring->desc[slot]; while (d->flags & VRING_DESC_F_NEXT) { used--; slot = d->next; d = &vring->desc[slot]; } used--; last++; n_left--; } vring->desc_in_use = used; vring->last_used_idx = last; CLIB_MEMORY_BARRIER (); clib_memcpy (&result, vlib_buffer_get_current (b), sizeof (struct virtio_ctrl_msg)); virtio_log_debug (vif, "ctrl-queue: status %u", result.status); status = result.status; vlib_buffer_free (vm, &buffer_index, 1); return status; } static int virtio_pci_enable_gso (vlib_main_t * vm, virtio_if_t * vif) { struct virtio_ctrl_msg gso_hdr; virtio_net_ctrl_ack status = VIRTIO_NET_ERR; gso_hdr.ctrl.class = VIRTIO_NET_CTRL_GUEST_OFFLOADS; gso_hdr.ctrl.cmd = VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET; gso_hdr.status = VIRTIO_NET_ERR; u64 offloads = VIRTIO_FEATURE (VIRTIO_NET_F_GUEST_CSUM) | VIRTIO_FEATURE (VIRTIO_NET_F_GUEST_TSO4) | VIRTIO_FEATURE (VIRTIO_NET_F_GUEST_TSO6) | VIRTIO_FEATURE (VIRTIO_NET_F_GUEST_UFO); clib_memcpy (gso_hdr.data, &offloads, sizeof (offloads)); status = virtio_pci_send_ctrl_msg (vm, vif, &gso_hdr, sizeof (offloads)); virtio_log_debug (vif, "enable gso"); return status; } static int virtio_pci_enable_multiqueue (vlib_main_t * vm, virtio_if_t * vif, u16 num_queues) { struct virtio_ctrl_msg mq_hdr; virtio_net_ctrl_ack status = VIRTIO_NET_ERR; mq_hdr.ctrl.class = VIRTIO_NET_CTRL_MQ; mq_hdr.ctrl.cmd = VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET; mq_hdr.status = VIRTIO_NET_ERR; clib_memcpy (mq_hdr.data, &num_queues, sizeof (num_queues)); status = virtio_pci_send_ctrl_msg (vm, vif, &mq_hdr, sizeof (num_queues)); virtio_log_debug (vif, "multi-queue enable %u queues", num_queues); return status; } static u8 virtio_pci_queue_size_valid (u16 qsz) { if (qsz < 64 || qsz > 4096) return 0; if ((qsz % 64) != 0) return 0; return 1; } clib_error_t * virtio_pci_control_vring_init (vlib_main_t * vm, virtio_if_t * vif, u16 queue_num) { clib_error_t *error = 0; u16 queue_size = 0; virtio_vring_t *vring; struct vring vr; u32 i = 0; void *ptr = NULL; queue_size = virtio_pci_legacy_get_queue_num (vm, vif, queue_num); if (!virtio_pci_queue_size_valid (queue_size)) clib_warning ("queue size is not valid"); if (!is_pow2 (queue_size)) return clib_error_return (0, "ring size must be power of 2"); if (queue_size > 32768) return clib_error_return (0, "ring size must be 32768 or lower"); if (queue_size == 0) queue_size = 256; vec_validate_aligned (vif->cxq_vring, 0, CLIB_CACHE_LINE_BYTES); vring = vec_elt_at_index (vif->cxq_vring, 0); i = vring_size (queue_size, VIRTIO_PCI_VRING_ALIGN); i = round_pow2 (i, VIRTIO_PCI_VRING_ALIGN); ptr = vlib_physmem_alloc_aligned_on_numa (vm, i, VIRTIO_PCI_VRING_ALIGN, vif->numa_node); if (!ptr) return vlib_physmem_last_error (vm); clib_memset (ptr, 0, i); vring_init (&vr, queue_size, ptr, VIRTIO_PCI_VRING_ALIGN); vring->desc = vr.desc; vring->avail = vr.avail; vring->used = vr.used; vring->queue_id = queue_num; vring->avail->flags = VIRTIO_RING_FLAG_MASK_INT; ASSERT (vring->buffers == 0); vring->size = queue_size; virtio_log_debug (vif, "control-queue: number %u, size %u", queue_num, queue_size); virtio_pci_legacy_setup_queue (vm, vif, queue_num, ptr); vring->kick_fd = -1; return error; } clib_error_t * virtio_pci_vring_init (vlib_main_t * vm, virtio_if_t * vif, u16 queue_num) { clib_error_t *error = 0; vlib_thread_main_t *vtm = vlib_get_thread_main (); u16 queue_size = 0; virtio_vring_t *vring; struct vring vr; u32 i = 0; void *ptr = NULL; queue_size = virtio_pci_legacy_get_queue_num (vm, vif, queue_num); if (!virtio_pci_queue_size_valid (queue_size)) clib_warning ("queue size is not valid"); if (!is_pow2 (queue_size)) return clib_error_return (0, "ring size must be power of 2"); if (queue_size > 32768) return clib_error_return (0, "ring size must be 32768 or lower"); if (queue_size == 0) queue_size = 256; if (queue_num % 2) { if (TX_QUEUE_ACCESS (queue_num) > vtm->n_vlib_mains) return error; vec_validate_aligned (vif->txq_vrings, TX_QUEUE_ACCESS (queue_num), CLIB_CACHE_LINE_BYTES); vring = vec_elt_at_index (vif->txq_vrings, TX_QUEUE_ACCESS (queue_num)); clib_spinlock_init (&vring->lockp); } else { vec_validate_aligned (vif->rxq_vrings, RX_QUEUE_ACCESS (queue_num), CLIB_CACHE_LINE_BYTES); vring = vec_elt_at_index (vif->rxq_vrings, RX_QUEUE_ACCESS (queue_num)); } i = vring_size (queue_size, VIRTIO_PCI_VRING_ALIGN); i = round_pow2 (i, VIRTIO_PCI_VRING_ALIGN); ptr = vlib_physmem_alloc_aligned_on_numa (vm, i, VIRTIO_PCI_VRING_ALIGN, vif->numa_node); if (!ptr) return vlib_physmem_last_error (vm); clib_memset (ptr, 0, i); vring_init (&vr, queue_size, ptr, VIRTIO_PCI_VRING_ALIGN); vring->desc = vr.desc; vring->avail = vr.avail; vring->used = vr.used; vring->queue_id = queue_num; vring->avail->flags = VIRTIO_RING_FLAG_MASK_INT; ASSERT (vring->buffers == 0); vec_validate_aligned (vring->buffers, queue_size, CLIB_CACHE_LINE_BYTES); if (queue_num % 2) { virtio_log_debug (vif, "tx-queue: number %u, size %u", queue_num, queue_size); } else { virtio_log_debug (vif, "rx-queue: number %u, size %u", queue_num, queue_size); } vring->size = queue_size; if (virtio_pci_legacy_setup_queue (vm, vif, queue_num, ptr)) return clib_error_return (0, "error in queue address setup"); vring->kick_fd = -1; return error; } static void virtio_negotiate_features (vlib_main_t * vm, virtio_if_t * vif, u64 req_features) { /* * if features are not requested * default: all supported features */ u64 supported_features = VIRTIO_FEATURE (VIRTIO_NET_F_CSUM) | VIRTIO_FEATURE (VIRTIO_NET_F_GUEST_CSUM) | VIRTIO_FEATURE (VIRTIO_NET_F_CTRL_GUEST_OFFLOADS) | VIRTIO_FEATURE (VIRTIO_NET_F_MTU) | VIRTIO_FEATURE (VIRTIO_NET_F_MAC) | VIRTIO_FEATURE (VIRTIO_NET_F_GSO) | VIRTIO_FEATURE (VIRTIO_NET_F_GUEST_TSO4) | VIRTIO_FEATURE (VIRTIO_NET_F_GUEST_TSO6) | VIRTIO_FEATURE (VIRTIO_NET_F_GUEST_UFO) | VIRTIO_FEATURE (VIRTIO_NET_F_HOST_TSO4) | VIRTIO_FEATURE (VIRTIO_NET_F_HOST_TSO6) | VIRTIO_FEATURE (VIRTIO_NET_F_HOST_UFO) | VIRTIO_FEATURE (VIRTIO_NET_F_MRG_RXBUF) | VIRTIO_FEATURE (VIRTIO_NET_F_STATUS) | VIRTIO_FEATURE (VIRTIO_NET_F_CTRL_VQ) | VIRTIO_FEATURE (VIRTIO_NET_F_MQ) | VIRTIO_FEATURE (VIRTIO_F_NOTIFY_ON_EMPTY) | VIRTIO_FEATURE (VIRTIO_F_ANY_LAYOUT) | VIRTIO_FEATURE (VIRTIO_RING_F_INDIRECT_DESC); if (req_features == 0) { req_features = supported_features; } vif->features = req_features & vif->remote_features & supported_features; if (vif->features & VIRTIO_FEATURE (VIRTIO_NET_F_MTU)) { virtio_net_config_t config; virtio_pci_legacy_read_config (vm, vif, &config.mtu, sizeof (config.mtu), STRUCT_OFFSET_OF (virtio_net_config_t, mtu)); if (config.mtu < 64) vif->features &= ~VIRTIO_FEATURE (VIRTIO_NET_F_MTU); } vif->features = virtio_pci_legacy_set_features (vm, vif, vif->features); } void virtio_pci_read_device_feature (vlib_main_t * vm, virtio_if_t * vif) { vif->remote_features = virtio_pci_legacy_get_features (vm, vif); } int virtio_pci_reset_device (vlib_main_t * vm, virtio_if_t * vif) { u8 status = 0; /* * Reset the device */ status = virtio_pci_legacy_reset (vm, vif); /* * Set the Acknowledge status bit */ virtio_pci_legacy_set_status (vm, vif, VIRTIO_CONFIG_STATUS_ACK); /* * Set the Driver status bit */ virtio_pci_legacy_set_status (vm, vif, VIRTIO_CONFIG_STATUS_DRIVER); /* * Read the status and verify it */ status = virtio_pci_legacy_get_status (vm, vif); if (! ((status & VIRTIO_CONFIG_STATUS_ACK) && (status & VIRTIO_CONFIG_STATUS_DRIVER))) return -1; vif->status = status; return 0; } clib_error_t * virtio_pci_read_caps (vlib_main_t * vm, virtio_if_t * vif) { clib_error_t *error = 0; struct virtio_pci_cap cap; u8 pos, common_cfg = 0, notify_base = 0, dev_cfg = 0, isr = 0, pci_cfg = 0; vlib_pci_dev_handle_t h = vif->pci_dev_handle; if ((error = vlib_pci_read_config_u8 (vm, h, PCI_CAPABILITY_LIST, &pos))) { virtio_log_error (vif, "error in reading capabilty list position"); clib_error_return (error, "error in reading capabilty list position"); } while (pos) { if ((error = vlib_pci_read_write_config (vm, h, VLIB_READ, pos, &cap, sizeof (cap)))) { virtio_log_error (vif, "%s [%2x]", "error in reading the capability at", pos); clib_error_return (error, "error in reading the capability at [%2x]", pos); } if (cap.cap_vndr == PCI_CAP_ID_MSIX) { u16 flags, table_size, table_size_mask = 0x07FF; if ((error = vlib_pci_read_write_config (vm, h, VLIB_READ, pos + 2, &flags, sizeof (flags)))) clib_error_return (error, "error in reading the capability at [%2x]", pos + 2); table_size = flags & table_size_mask; virtio_log_debug (vif, "flags:0x%x %s 0x%x", flags, "msix interrupt vector table-size", table_size); if (flags & PCI_MSIX_ENABLE) { virtio_log_debug (vif, "msix interrupt enabled"); vif->msix_enabled = VIRTIO_MSIX_ENABLED; } else { virtio_log_debug (vif, "msix interrupt disabled"); vif->msix_enabled = VIRTIO_MSIX_DISABLED; } } if (cap.cap_vndr != PCI_CAP_ID_VNDR) { virtio_log_debug (vif, "[%2x] %s %2x ", pos, "skipping non VNDR cap id:", cap.cap_vndr); goto next; } virtio_log_debug (vif, "[%4x] cfg type: %u, bar: %u, offset: %04x, len: %u", pos, cap.cfg_type, cap.bar, cap.offset, cap.length); switch (cap.cfg_type) { case VIRTIO_PCI_CAP_COMMON_CFG: common_cfg = 1; break; case VIRTIO_PCI_CAP_NOTIFY_CFG: notify_base = 1; break; case VIRTIO_PCI_CAP_DEVICE_CFG: dev_cfg = 1; break; case VIRTIO_PCI_CAP_ISR_CFG: isr = 1; break; case VIRTIO_PCI_CAP_PCI_CFG: if (cap.bar == 0) pci_cfg = 1; break; } next: pos = cap.cap_next; } if (common_cfg == 0 || notify_base == 0 || dev_cfg == 0 || isr == 0) { virtio_log_debug (vif, "legacy virtio pci device found"); return error; } if (!pci_cfg) clib_error_return (error, "modern virtio pci device found"); virtio_log_debug (vif, "transitional virtio pci device found"); return error; } static clib_error_t * virtio_pci_device_init (vlib_main_t * vm, virtio_if_t * vif, virtio_pci_create_if_args_t * args) { clib_error_t *error = 0; u8 status = 0; if ((error = virtio_pci_read_caps (vm, vif))) clib_error_return (error, "Device is not supported"); if (virtio_pci_reset_device (vm, vif) < 0) { virtio_log_error (vif, "Failed to reset the device"); clib_error_return (error, "Failed to reset the device"); } /* * read device features and negotiate (user) requested features */ virtio_pci_read_device_feature (vm, vif); virtio_negotiate_features (vm, vif, args->features); /* * After FEATURE_OK, driver should not accept new feature bits */ virtio_pci_legacy_set_status (vm, vif, VIRTIO_CONFIG_STATUS_FEATURES_OK); status = virtio_pci_legacy_get_status (vm, vif); if (!(status & VIRTIO_CONFIG_STATUS_FEATURES_OK)) { virtio_log_error (vif, "error encountered: Device doesn't support requested features"); clib_error_return (error, "Device doesn't support requested features"); } vif->status = status; /* * get or set the mac address */ if (virtio_pci_get_mac (vm, vif)) { f64 now = vlib_time_now (vm); u32 rnd; rnd = (u32) (now * 1e6); rnd = random_u32 (&rnd); memcpy (vif->mac_addr + 2, &rnd, sizeof (rnd)); vif->mac_addr[0] = 2; vif->mac_addr[1] = 0xfe; virtio_pci_set_mac (vm, vif); } virtio_set_net_hdr_size (vif); /* * Initialize the virtqueues */ if ((error = virtio_pci_get_max_virtqueue_pairs (vm, vif))) goto err; for (int i = 0; i < vif->max_queue_pairs; i++) { if ((error = virtio_pci_vring_init (vm, vif, RX_QUEUE (i)))) { virtio_log_warning (vif, "%s (%u) %s", "error in rxq-queue", RX_QUEUE (i), "initialization"); } else { vif->num_rxqs++; } if ((error = virtio_pci_vring_init (vm, vif, TX_QUEUE (i)))) { virtio_log_warning (vif, "%s (%u) %s", "error in txq-queue", TX_QUEUE (i), "initialization"); } else { vif->num_txqs++; } } if (vif->features & VIRTIO_FEATURE (VIRTIO_NET_F_CTRL_VQ)) { if ((error = virtio_pci_control_vring_init (vm, vif, vif->max_queue_pairs * 2))) { virtio_log_warning (vif, "%s (%u) %s", "error in control-queue", vif->max_queue_pairs * 2, "initialization"); if (vif->features & VIRTIO_FEATURE (VIRTIO_NET_F_MQ)) vif->features &= ~VIRTIO_FEATURE (VIRTIO_NET_F_MQ); } } else { virtio_log_debug (vif, "control queue is not available"); vif->cxq_vring = NULL; } /* * set the msix interrupts */ if (vif->msix_enabled == VIRTIO_MSIX_ENABLED) { if (virtio_pci_legacy_set_config_irq (vm, vif, 1) == VIRTIO_MSI_NO_VECTOR) virtio_log_warning (vif, "config vector 1 is not set"); if (virtio_pci_legacy_set_queue_irq (vm, vif, 0, 0) == VIRTIO_MSI_NO_VECTOR) virtio_log_warning (vif, "queue vector 0 is not set"); } /* * set the driver status OK */ virtio_pci_legacy_set_status (vm, vif, VIRTIO_CONFIG_STATUS_DRIVER_OK); vif->status = virtio_pci_legacy_get_status (vm, vif); err: return error; } void virtio_pci_create_if (vlib_main_t * vm, virtio_pci_create_if_args_t * args) { vnet_main_t *vnm = vnet_get_main (); virtio_main_t *vim = &virtio_main; virtio_if_t *vif; vlib_pci_dev_handle_t h; clib_error_t *error = 0; /* *INDENT-OFF* */ pool_foreach (vif, vim->interfaces, ({ if (vif->pci_addr.as_u32 == args->addr) { args->rv = VNET_API_ERROR_INVALID_VALUE; args->error = clib_error_return (error, "PCI address in use"); vlib_log (VLIB_LOG_LEVEL_ERR, vim->log_default, "%U: %s", format_vlib_pci_addr, &args->addr, " PCI address in use"); return; } })); /* *INDENT-ON* */ pool_get (vim->interfaces, vif); vif->dev_instance = vif - vim->interfaces; vif->per_interface_next_index = ~0; vif->pci_addr.as_u32 = args->addr; if ((error = vlib_pci_device_open (vm, (vlib_pci_addr_t *) & vif->pci_addr, virtio_pci_device_ids, &h))) { args->rv = VNET_API_ERROR_INVALID_INTERFACE; args->error = clib_error_return (error, "pci-addr %U", format_vlib_pci_addr, &vif->pci_addr); vlib_log (VLIB_LOG_LEVEL_ERR, vim->log_default, "%U: %s", format_vlib_pci_addr, &vif->pci_addr, "error encountered on pci device open"); pool_put (vim->interfaces, vif); return; } vif->pci_dev_handle = h; vlib_pci_set_private_data (vm, h, vif->dev_instance); vif->numa_node = vlib_pci_get_numa_node (vm, h); vif->type = VIRTIO_IF_TYPE_PCI; if ((error = vlib_pci_bus_master_enable (vm, h))) { virtio_log_error (vif, "error encountered on pci bus master enable"); goto error; } if ((error = vlib_pci_io_region (vm, h, 0))) { virtio_log_error (vif, "error encountered on pci io region"); goto error; } if (vlib_pci_get_num_msix_interrupts (vm, h) > 1) { if ((error = vlib_pci_register_msix_handler (vm, h, 0, 1, &virtio_pci_irq_0_handler))) { virtio_log_error (vif, "error encountered on pci register msix handler 0"); goto error; } if ((error = vlib_pci_register_msix_handler (vm, h, 1, 1, &virtio_pci_irq_1_handler))) { virtio_log_error (vif, "error encountered on pci register msix handler 1"); goto error; } if ((error = vlib_pci_enable_msix_irq (vm, h, 0, 2))) { virtio_log_error (vif, "error encountered on pci enable msix irq"); goto error; } vif->support_int_mode = 1; virtio_log_debug (vif, "device supports msix interrupts"); } else if (vlib_pci_get_num_msix_interrupts (vm, h) == 1) { /* * if msix table-size is 1, fall back to intX. */ if ((error = vlib_pci_register_intx_handler (vm, h, &virtio_pci_irq_handler))) { virtio_log_error (vif, "error encountered on pci register interrupt handler"); goto error; } vif->support_int_mode = 1; virtio_log_debug (vif, "pci register interrupt handler"); } else { /* * WARN: intX is showing some weird behaviour. * Please don't use interrupt mode with UIO driver. */ vif->support_int_mode = 0; virtio_log_debug (vif, "driver is configured in poll mode only"); } if ((error = vlib_pci_intr_enable (vm, h))) { virtio_log_error (vif, "error encountered on pci interrupt enable"); goto error; } if ((error = virtio_pci_device_init (vm, vif, args))) { virtio_log_error (vif, "error encountered on device init"); goto error; } /* create interface */ error = ethernet_register_interface (vnm, virtio_device_class.index, vif->dev_instance, vif->mac_addr, &vif->hw_if_index, virtio_pci_flag_change); if (error) { virtio_log_error (vif, "error encountered on ethernet register interface"); goto error; } vnet_sw_interface_t *sw = vnet_get_hw_sw_interface (vnm, vif->hw_if_index); vif->sw_if_index = sw->sw_if_index; args->sw_if_index = sw->sw_if_index; vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, vif->hw_if_index); hw->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_INT_MODE; vnet_hw_interface_set_input_node (vnm, vif->hw_if_index, virtio_input_node.index); u32 i = 0; vec_foreach_index (i, vif->rxq_vrings) { vnet_hw_interface_assign_rx_thread (vnm, vif->hw_if_index, i, ~0); virtio_vring_set_numa_node (vm, vif, RX_QUEUE (i)); /* Set default rx mode to POLLING */ vnet_hw_interface_set_rx_mode (vnm, vif->hw_if_index, i, VNET_HW_INTERFACE_RX_MODE_POLLING); } if (virtio_pci_is_link_up (vm, vif) & VIRTIO_NET_S_LINK_UP) { vif->flags |= VIRTIO_IF_FLAG_ADMIN_UP; vnet_hw_interface_set_flags (vnm, vif->hw_if_index, VNET_HW_INTERFACE_FLAG_LINK_UP); } else vnet_hw_interface_set_flags (vnm, vif->hw_if_index, 0); if (vif->features & VIRTIO_FEATURE (VIRTIO_NET_F_CTRL_VQ)) { if (vif->features & VIRTIO_FEATURE (VIRTIO_NET_F_CTRL_GUEST_OFFLOADS) && args->gso_enabled) { if (virtio_pci_enable_gso (vm, vif)) { virtio_log_warning (vif, "gso is not enabled"); } else { vif->gso_enabled = 1; hw->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO; vnm->interface_main.gso_interface_count++; } } if (vif->features & VIRTIO_FEATURE (VIRTIO_NET_F_MQ)) { if (virtio_pci_enable_multiqueue (vm, vif, vif->max_queue_pairs)) virtio_log_warning (vif, "multiqueue is not set"); } } return; error: virtio_pci_delete_if (vm, vif); args->rv = VNET_API_ERROR_INVALID_INTERFACE; args->error = error; } int virtio_pci_delete_if (vlib_main_t * vm, virtio_if_t * vif) { vnet_main_t *vnm = vnet_get_main (); virtio_main_t *vim = &virtio_main; u32 i = 0; if (vif->type != VIRTIO_IF_TYPE_PCI) return VNET_API_ERROR_INVALID_INTERFACE; vlib_pci_intr_disable (vm, vif->pci_dev_handle); for (i = 0; i < vif->max_queue_pairs; i++) { virtio_pci_legacy_del_queue (vm, vif, RX_QUEUE (i)); virtio_pci_legacy_del_queue (vm, vif, TX_QUEUE (i)); } if (vif->features & VIRTIO_FEATURE (VIRTIO_NET_F_CTRL_VQ)) virtio_pci_legacy_del_queue (vm, vif, vif->max_queue_pairs * 2); virtio_pci_legacy_reset (vm, vif); if (vif->gso_enabled) vnm->interface_main.gso_interface_count--; if (vif->hw_if_index) { vnet_hw_interface_set_flags (vnm, vif->hw_if_index, 0); vec_foreach_index (i, vif->rxq_vrings) { vnet_hw_interface_unassign_rx_thread (vnm, vif->hw_if_index, i); } ethernet_delete_interface (vnm, vif->hw_if_index); } vlib_pci_device_close (vm, vif->pci_dev_handle); vec_foreach_index (i, vif->rxq_vrings) { virtio_vring_t *vring = vec_elt_at_index (vif->rxq_vrings, i); if (vring->kick_fd != -1) close (vring->kick_fd); if (vring->used) { virtio_free_rx_buffers (vm, vring); } vec_free (vring->buffers); vlib_physmem_free (vm, vring->desc); } vec_foreach_index (i, vif->txq_vrings) { virtio_vring_t *vring = vec_elt_at_index (vif->txq_vrings, i); if (vring->kick_fd != -1) close (vring->kick_fd); if (vring->used) { virtio_free_used_desc (vm, vring); } vec_free (vring->buffers); clib_spinlock_free (&vring->lockp); vlib_physmem_free (vm, vring->desc); } if (vif->cxq_vring != NULL) { u16 last = vif->cxq_vring->last_used_idx; u16 n_left = vif->cxq_vring->used->idx - last; while (n_left) { last++; n_left--; } vif->cxq_vring->last_used_idx = last; vlib_physmem_free (vm, vif->cxq_vring->desc); } vec_free (vif->rxq_vrings); vec_free (vif->txq_vrings); vec_free (vif->cxq_vring); clib_error_free (vif->error); memset (vif, 0, sizeof (*vif)); pool_put (vim->interfaces, vif); return 0; } /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */
27.793962
89
0.681158
65c86732ff7400adb47ccef8d9a689e03ecf4203
899
c
C
Code_C/Exercicio-14/test_7.Q.c
gabrielf7/code-exercises
b3a8661fadc133395f3c6fb7e926317acf7fa539
[ "MIT" ]
1
2020-07-19T16:35:51.000Z
2020-07-19T16:35:51.000Z
Code_C/Exercicio-14/test_7.Q.c
gabrielf7/codigos-em-C-uteis
b155d2771291a14e8b112a0f1aa32c58254e406e
[ "MIT" ]
null
null
null
Code_C/Exercicio-14/test_7.Q.c
gabrielf7/codigos-em-C-uteis
b155d2771291a14e8b112a0f1aa32c58254e406e
[ "MIT" ]
null
null
null
// Usando uma struct dentro de uma biblioteca .h, crie um algoritmo // de Tabuada pedindo ao usuário a operação e os número 1 e número 2. // Enviar o arquivo compactado ".zip" com o arquivo .c e .h. * //Por João Gabriel. #include <stdio.h> #include <stdlib.h> #include "test_7Q_tabuadadoaprenda.h" void pausar() { printf("\n Pressione alguma tecla para continuar..."); getch(); } int main(){ int cont, escolha; cont=1; float numero1, numero2, resultado; printf("\n Escolha uma operacao:" "\n [1] Adicao | [2] Subtracao" "\n [3] Divisao | [4] Multiplicacao \n" ); printf("\n Escolha: "); scanf("%d", &escolha); printf("\n [1] Numero: ", cont); scanf("%f", &numero1); printf("\n [2] Numero: ", cont); scanf("%f", &numero2); resultado = calcTabu(&escolha, &numero1, &numero2); if(numero2==0){}else{printf("\n Resultado da operacao: %f", resultado);} pausar(); return(0); }
25.685714
73
0.649611
456061470f6472c81af8bae5192b7a8f1ecd8bfb
3,780
h
C
ash/system/bluetooth/tray_bluetooth_helper.h
metux/chromium-deb
3c08e9b89a1b6f95f103a61ff4f528dbcd57fc42
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
ash/system/bluetooth/tray_bluetooth_helper.h
metux/chromium-deb
3c08e9b89a1b6f95f103a61ff4f528dbcd57fc42
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
ash/system/bluetooth/tray_bluetooth_helper.h
metux/chromium-deb
3c08e9b89a1b6f95f103a61ff4f528dbcd57fc42
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
// Copyright 2017 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 ASH_SYSTEM_BLUETOOTH_TRAY_BLUETOOTH_HELPER_H_ #define ASH_SYSTEM_BLUETOOTH_TRAY_BLUETOOTH_HELPER_H_ #include <memory> #include <vector> #include "ash/ash_export.h" #include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "device/bluetooth/bluetooth_adapter.h" namespace device { class BluetoothDiscoverySession; } namespace ash { // Cached info from device::BluetoothDevice used for display in the UI. // Exists because it is not safe to cache pointers to device::BluetoothDevice // instances. struct ASH_EXPORT BluetoothDeviceInfo { BluetoothDeviceInfo(); BluetoothDeviceInfo(const BluetoothDeviceInfo& other); ~BluetoothDeviceInfo(); std::string address; base::string16 display_name; bool connected; bool connecting; bool paired; device::BluetoothDeviceType device_type; }; using BluetoothDeviceList = std::vector<BluetoothDeviceInfo>; // Maps UI concepts from the Bluetooth system tray (e.g. "Bluetooth is on") into // device concepts ("Bluetooth adapter enabled"). Note that most Bluetooth // device operations are asynchronous, hence the two step initialization. // Exported for test. class ASH_EXPORT TrayBluetoothHelper : public device::BluetoothAdapter::Observer { public: TrayBluetoothHelper(); ~TrayBluetoothHelper() override; // Initializes and gets the adapter asynchronously. void Initialize(); // Completes initialization after the Bluetooth adapter is ready. void InitializeOnAdapterReady( scoped_refptr<device::BluetoothAdapter> adapter); // Returns a list of available bluetooth devices. BluetoothDeviceList GetAvailableBluetoothDevices() const; // Requests bluetooth start discovering devices, which happens asynchronously. void StartBluetoothDiscovering(); // Requests bluetooth stop discovering devices. void StopBluetoothDiscovering(); // Connect to a specific bluetooth device. void ConnectToBluetoothDevice(const std::string& address); // Returns whether bluetooth capability is available (e.g. the device has // hardware support). bool GetBluetoothAvailable(); // Returns whether bluetooth is enabled. bool GetBluetoothEnabled(); // Returns whether the delegate has initiated a bluetooth discovery session. bool HasBluetoothDiscoverySession(); // BluetoothAdapter::Observer: void AdapterPresentChanged(device::BluetoothAdapter* adapter, bool present) override; void AdapterPoweredChanged(device::BluetoothAdapter* adapter, bool powered) override; void AdapterDiscoveringChanged(device::BluetoothAdapter* adapter, bool discovering) override; void DeviceAdded(device::BluetoothAdapter* adapter, device::BluetoothDevice* device) override; void DeviceChanged(device::BluetoothAdapter* adapter, device::BluetoothDevice* device) override; void DeviceRemoved(device::BluetoothAdapter* adapter, device::BluetoothDevice* device) override; private: void OnStartDiscoverySession( std::unique_ptr<device::BluetoothDiscoverySession> discovery_session); bool should_run_discovery_ = false; scoped_refptr<device::BluetoothAdapter> adapter_; std::unique_ptr<device::BluetoothDiscoverySession> discovery_session_; // Object could be deleted during a prolonged Bluetooth operation. base::WeakPtrFactory<TrayBluetoothHelper> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(TrayBluetoothHelper); }; } // namespace ash #endif // ASH_SYSTEM_BLUETOOTH_TRAY_BLUETOOTH_HELPER_H_
34.054054
80
0.758995
458962326d6126fb4b07550cda7b41c34d46196e
2,386
h
C
libraries/pubsub/include/pubsub/publisherregistry.h
trailofbits/osquery-extensions
8a1a24a1142757579e001e4fa710e144169ab257
[ "Apache-2.0" ]
194
2017-12-14T14:00:34.000Z
2022-03-21T23:56:06.000Z
libraries/pubsub/include/pubsub/publisherregistry.h
trailofbits/osquery-extensions
8a1a24a1142757579e001e4fa710e144169ab257
[ "Apache-2.0" ]
49
2017-12-09T16:32:37.000Z
2021-12-14T22:15:06.000Z
libraries/pubsub/include/pubsub/publisherregistry.h
trailofbits/osquery-extensions
8a1a24a1142757579e001e4fa710e144169ab257
[ "Apache-2.0" ]
27
2017-12-14T23:48:39.000Z
2022-02-25T01:54:45.000Z
/* * Copyright (c) 2018 Trail of Bits, 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. */ #pragma once #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wsign-conversion" #include "baseeventpublisher.h" #pragma clang diagnostic pop #include <memory> #include <unordered_map> #include <vector> namespace trailofbits { /// This is the type of the factory function that event publishers should /// implement as a static method using EventPublisherFactoryFunction = osquery::Status (*)(IEventPublisherRef& publisher); /// The publisher registry, used to keep track all the event publishers that /// have been declared class PublisherRegistry final { struct PrivateData; /// Private class data std::unique_ptr<PrivateData> d; /// Private constructpr; use get() instead PublisherRegistry(); public: /// Returns the name for the specified publisher std::string publisherName(IEventPublisherRef publisher); /// Destructor ~PublisherRegistry(); /// Registers the given factory function for the specified publisher static osquery::Status declare( const std::string& name, EventPublisherFactoryFunction factory_function); /// Returns an instance of the PublisherRegistry static PublisherRegistry& instance(); /// Returns the specified event publisher osquery::Status get(IEventPublisherRef& publisher, const std::string& name); // Releases the specified event publisher osquery::Status release(const std::string& name); /// Returns a list of active publishers std::vector<IEventPublisherRef> activePublishers(); }; // clang-format off #define TOB_DECLARE_PUBLISHER(publisher_class) \ namespace { \ static auto publisher_manager_helper_ ## publisher_class = \ PublisherRegistry::declare(publisher_class::name(), publisher_class::create); \ } // clang-format on } // namespace trailofbits
30.987013
85
0.74979
e70231c438e5dfb133afd56a3bf7ad9166d1b585
22,999
h
C
xnu-4903.241.1/osfmk/vm/pmap.h
DogeCoding/iOSCompiledRuntime
81bada7472a3470d3424f2d0bbcc414d755c3620
[ "MIT" ]
672
2019-10-09T11:15:13.000Z
2021-09-21T10:02:33.000Z
xnu-4903.221.2/osfmk/vm/pmap.h
KaiserFeng/KFAppleOpenSource
7ea6ab19f1492a2da262d3554f90882393f975a4
[ "MIT" ]
19
2019-11-05T03:32:31.000Z
2021-07-15T11:16:25.000Z
xnu-4903.221.2/osfmk/vm/pmap.h
KaiserFeng/KFAppleOpenSource
7ea6ab19f1492a2da262d3554f90882393f975a4
[ "MIT" ]
216
2019-10-10T01:47:36.000Z
2021-09-23T07:56:54.000Z
/* * Copyright (c) 2000-2012 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. The rights granted to you under the License * may not be used to create, or enable the creation or redistribution of, * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ /* * Mach Operating System * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University * All Rights Reserved. * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ /* */ /* * File: vm/pmap.h * Author: Avadis Tevanian, Jr. * Date: 1985 * * Machine address mapping definitions -- machine-independent * section. [For machine-dependent section, see "machine/pmap.h".] */ #ifndef _VM_PMAP_H_ #define _VM_PMAP_H_ #include <mach/kern_return.h> #include <mach/vm_param.h> #include <mach/vm_types.h> #include <mach/vm_attributes.h> #include <mach/boolean.h> #include <mach/vm_prot.h> #include <kern/trustcache.h> #ifdef KERNEL_PRIVATE /* * The following is a description of the interface to the * machine-dependent "physical map" data structure. The module * must provide a "pmap_t" data type that represents the * set of valid virtual-to-physical addresses for one user * address space. [The kernel address space is represented * by a distinguished "pmap_t".] The routines described manage * this type, install and update virtual-to-physical mappings, * and perform operations on physical addresses common to * many address spaces. */ /* Copy between a physical page and a virtual address */ /* LP64todo - switch to vm_map_offset_t when it grows */ extern kern_return_t copypv( addr64_t source, addr64_t sink, unsigned int size, int which); #define cppvPsnk 1 #define cppvPsnkb 31 #define cppvPsrc 2 #define cppvPsrcb 30 #define cppvFsnk 4 #define cppvFsnkb 29 #define cppvFsrc 8 #define cppvFsrcb 28 #define cppvNoModSnk 16 #define cppvNoModSnkb 27 #define cppvNoRefSrc 32 #define cppvNoRefSrcb 26 #define cppvKmap 64 /* Use the kernel's vm_map */ #define cppvKmapb 25 extern boolean_t pmap_has_managed_page(ppnum_t first, ppnum_t last); #ifdef MACH_KERNEL_PRIVATE #include <mach_assert.h> #include <machine/pmap.h> /* * Routines used for initialization. * There is traditionally also a pmap_bootstrap, * used very early by machine-dependent code, * but it is not part of the interface. * * LP64todo - * These interfaces are tied to the size of the * kernel pmap - and therefore use the "local" * vm_offset_t, etc... types. */ extern void *pmap_steal_memory(vm_size_t size); /* During VM initialization, * steal a chunk of memory. */ extern unsigned int pmap_free_pages(void); /* During VM initialization, * report remaining unused * physical pages. */ extern void pmap_startup( vm_offset_t *startp, vm_offset_t *endp); /* During VM initialization, * use remaining physical pages * to allocate page frames. */ extern void pmap_init(void); /* Initialization, * after kernel runs * in virtual memory. */ extern void mapping_adjust(void); /* Adjust free mapping count */ extern void mapping_free_prime(void); /* Primes the mapping block release list */ #ifndef MACHINE_PAGES /* * If machine/pmap.h defines MACHINE_PAGES, it must implement * the above functions. The pmap module has complete control. * Otherwise, it must implement * pmap_free_pages * pmap_virtual_space * pmap_next_page * pmap_init * and vm/vm_resident.c implements pmap_steal_memory and pmap_startup * using pmap_free_pages, pmap_next_page, pmap_virtual_space, * and pmap_enter. pmap_free_pages may over-estimate the number * of unused physical pages, and pmap_next_page may return FALSE * to indicate that there are no more unused pages to return. * However, for best performance pmap_free_pages should be accurate. */ extern boolean_t pmap_next_page(ppnum_t *pnum); extern boolean_t pmap_next_page_hi(ppnum_t *pnum); /* During VM initialization, * return the next unused * physical page. */ extern void pmap_virtual_space( vm_offset_t *virtual_start, vm_offset_t *virtual_end); /* During VM initialization, * report virtual space * available for the kernel. */ #endif /* MACHINE_PAGES */ /* * Routines to manage the physical map data structure. */ extern pmap_t pmap_create( /* Create a pmap_t. */ ledger_t ledger, vm_map_size_t size, boolean_t is_64bit); #if __x86_64__ extern pmap_t pmap_create_options( ledger_t ledger, vm_map_size_t size, int flags); #endif extern pmap_t (pmap_kernel)(void); /* Return the kernel's pmap */ extern void pmap_reference(pmap_t pmap); /* Gain a reference. */ extern void pmap_destroy(pmap_t pmap); /* Release a reference. */ extern void pmap_switch(pmap_t); #if MACH_ASSERT extern void pmap_set_process(pmap_t pmap, int pid, char *procname); #endif /* MACH_ASSERT */ extern kern_return_t pmap_enter( /* Enter a mapping */ pmap_t pmap, vm_map_offset_t v, ppnum_t pn, vm_prot_t prot, vm_prot_t fault_type, unsigned int flags, boolean_t wired); extern kern_return_t pmap_enter_options( pmap_t pmap, vm_map_offset_t v, ppnum_t pn, vm_prot_t prot, vm_prot_t fault_type, unsigned int flags, boolean_t wired, unsigned int options, void *arg); extern void pmap_remove_some_phys( pmap_t pmap, ppnum_t pn); extern void pmap_lock_phys_page( ppnum_t pn); extern void pmap_unlock_phys_page( ppnum_t pn); /* * Routines that operate on physical addresses. */ extern void pmap_page_protect( /* Restrict access to page. */ ppnum_t phys, vm_prot_t prot); extern void pmap_page_protect_options( /* Restrict access to page. */ ppnum_t phys, vm_prot_t prot, unsigned int options, void *arg); extern void (pmap_zero_page)( ppnum_t pn); extern void (pmap_zero_part_page)( ppnum_t pn, vm_offset_t offset, vm_size_t len); extern void (pmap_copy_page)( ppnum_t src, ppnum_t dest); extern void (pmap_copy_part_page)( ppnum_t src, vm_offset_t src_offset, ppnum_t dst, vm_offset_t dst_offset, vm_size_t len); extern void (pmap_copy_part_lpage)( vm_offset_t src, ppnum_t dst, vm_offset_t dst_offset, vm_size_t len); extern void (pmap_copy_part_rpage)( ppnum_t src, vm_offset_t src_offset, vm_offset_t dst, vm_size_t len); extern unsigned int (pmap_disconnect)( /* disconnect mappings and return reference and change */ ppnum_t phys); extern unsigned int (pmap_disconnect_options)( /* disconnect mappings and return reference and change */ ppnum_t phys, unsigned int options, void *arg); extern kern_return_t (pmap_attribute_cache_sync)( /* Flush appropriate * cache based on * page number sent */ ppnum_t pn, vm_size_t size, vm_machine_attribute_t attribute, vm_machine_attribute_val_t* value); extern unsigned int (pmap_cache_attributes)( ppnum_t pn); /* * Set (override) cache attributes for the specified physical page */ extern void pmap_set_cache_attributes( ppnum_t, unsigned int); #if defined(__arm__) || defined(__arm64__) /* ARM64_TODO */ extern boolean_t pmap_batch_set_cache_attributes( ppnum_t, unsigned int, unsigned int, unsigned int, boolean_t, unsigned int*); #endif extern void pmap_sync_page_data_phys(ppnum_t pa); extern void pmap_sync_page_attributes_phys(ppnum_t pa); /* * debug/assertions. pmap_verify_free returns true iff * the given physical page is mapped into no pmap. */ extern boolean_t pmap_verify_free(ppnum_t pn); /* * Statistics routines */ extern int (pmap_compressed)(pmap_t pmap); extern int (pmap_resident_count)(pmap_t pmap); extern int (pmap_resident_max)(pmap_t pmap); /* * Sundry required (internal) routines */ #ifdef CURRENTLY_UNUSED_AND_UNTESTED extern void pmap_collect(pmap_t pmap);/* Perform garbage * collection, if any */ #endif /* * Optional routines */ extern void (pmap_copy)( /* Copy range of mappings, * if desired. */ pmap_t dest, pmap_t source, vm_map_offset_t dest_va, vm_map_size_t size, vm_map_offset_t source_va); extern kern_return_t (pmap_attribute)( /* Get/Set special memory * attributes */ pmap_t pmap, vm_map_offset_t va, vm_map_size_t size, vm_machine_attribute_t attribute, vm_machine_attribute_val_t* value); /* * Routines defined as macros. */ #ifndef PMAP_ACTIVATE_USER #ifndef PMAP_ACTIVATE #define PMAP_ACTIVATE_USER(thr, cpu) #else /* PMAP_ACTIVATE */ #define PMAP_ACTIVATE_USER(thr, cpu) { \ pmap_t pmap; \ \ pmap = (thr)->map->pmap; \ if (pmap != pmap_kernel()) \ PMAP_ACTIVATE(pmap, (thr), (cpu)); \ } #endif /* PMAP_ACTIVATE */ #endif /* PMAP_ACTIVATE_USER */ #ifndef PMAP_DEACTIVATE_USER #ifndef PMAP_DEACTIVATE #define PMAP_DEACTIVATE_USER(thr, cpu) #else /* PMAP_DEACTIVATE */ #define PMAP_DEACTIVATE_USER(thr, cpu) { \ pmap_t pmap; \ \ pmap = (thr)->map->pmap; \ if ((pmap) != pmap_kernel()) \ PMAP_DEACTIVATE(pmap, (thr), (cpu)); \ } #endif /* PMAP_DEACTIVATE */ #endif /* PMAP_DEACTIVATE_USER */ #ifndef PMAP_ACTIVATE_KERNEL #ifndef PMAP_ACTIVATE #define PMAP_ACTIVATE_KERNEL(cpu) #else /* PMAP_ACTIVATE */ #define PMAP_ACTIVATE_KERNEL(cpu) \ PMAP_ACTIVATE(pmap_kernel(), THREAD_NULL, cpu) #endif /* PMAP_ACTIVATE */ #endif /* PMAP_ACTIVATE_KERNEL */ #ifndef PMAP_DEACTIVATE_KERNEL #ifndef PMAP_DEACTIVATE #define PMAP_DEACTIVATE_KERNEL(cpu) #else /* PMAP_DEACTIVATE */ #define PMAP_DEACTIVATE_KERNEL(cpu) \ PMAP_DEACTIVATE(pmap_kernel(), THREAD_NULL, cpu) #endif /* PMAP_DEACTIVATE */ #endif /* PMAP_DEACTIVATE_KERNEL */ #ifndef PMAP_ENTER /* * Macro to be used in place of pmap_enter() */ #define PMAP_ENTER(pmap, virtual_address, page, protection, fault_type, \ flags, wired, result) \ MACRO_BEGIN \ pmap_t __pmap = (pmap); \ vm_page_t __page = (page); \ int __options = 0; \ vm_object_t __obj; \ \ PMAP_ENTER_CHECK(__pmap, __page) \ __obj = VM_PAGE_OBJECT(__page); \ if (__obj->internal) { \ __options |= PMAP_OPTIONS_INTERNAL; \ } \ if (__page->vmp_reusable || __obj->all_reusable) { \ __options |= PMAP_OPTIONS_REUSABLE; \ } \ result = pmap_enter_options(__pmap, \ (virtual_address), \ VM_PAGE_GET_PHYS_PAGE(__page), \ (protection), \ (fault_type), \ (flags), \ (wired), \ __options, \ NULL); \ MACRO_END #endif /* !PMAP_ENTER */ #ifndef PMAP_ENTER_OPTIONS #define PMAP_ENTER_OPTIONS(pmap, virtual_address, page, protection, \ fault_type, flags, wired, options, result) \ MACRO_BEGIN \ pmap_t __pmap = (pmap); \ vm_page_t __page = (page); \ int __extra_options = 0; \ vm_object_t __obj; \ \ PMAP_ENTER_CHECK(__pmap, __page) \ __obj = VM_PAGE_OBJECT(__page); \ if (__obj->internal) { \ __extra_options |= PMAP_OPTIONS_INTERNAL; \ } \ if (__page->vmp_reusable || __obj->all_reusable) { \ __extra_options |= PMAP_OPTIONS_REUSABLE; \ } \ result = pmap_enter_options(__pmap, \ (virtual_address), \ VM_PAGE_GET_PHYS_PAGE(__page), \ (protection), \ (fault_type), \ (flags), \ (wired), \ (options) | __extra_options, \ NULL); \ MACRO_END #endif /* !PMAP_ENTER_OPTIONS */ #ifndef PMAP_SET_CACHE_ATTR #define PMAP_SET_CACHE_ATTR(mem, object, cache_attr, batch_pmap_op) \ MACRO_BEGIN \ if (!batch_pmap_op) { \ pmap_set_cache_attributes(VM_PAGE_GET_PHYS_PAGE(mem), cache_attr); \ object->set_cache_attr = TRUE; \ } \ MACRO_END #endif /* PMAP_SET_CACHE_ATTR */ #ifndef PMAP_BATCH_SET_CACHE_ATTR #if defined(__arm__) || defined(__arm64__) #define PMAP_BATCH_SET_CACHE_ATTR(object, user_page_list, \ cache_attr, num_pages, batch_pmap_op) \ MACRO_BEGIN \ if ((batch_pmap_op)) { \ unsigned int __page_idx=0; \ unsigned int res=0; \ boolean_t batch=TRUE; \ while (__page_idx < (num_pages)) { \ if (!pmap_batch_set_cache_attributes( \ user_page_list[__page_idx].phys_addr, \ (cache_attr), \ (num_pages), \ (__page_idx), \ FALSE, \ (&res))) { \ batch = FALSE; \ break; \ } \ __page_idx++; \ } \ __page_idx=0; \ res=0; \ while (__page_idx < (num_pages)) { \ if (batch) \ (void)pmap_batch_set_cache_attributes( \ user_page_list[__page_idx].phys_addr, \ (cache_attr), \ (num_pages), \ (__page_idx), \ TRUE, \ (&res)); \ else \ pmap_set_cache_attributes( \ user_page_list[__page_idx].phys_addr, \ (cache_attr)); \ __page_idx++; \ } \ (object)->set_cache_attr = TRUE; \ } \ MACRO_END #else #define PMAP_BATCH_SET_CACHE_ATTR(object, user_page_list, \ cache_attr, num_pages, batch_pmap_op) \ MACRO_BEGIN \ if ((batch_pmap_op)) { \ unsigned int __page_idx=0; \ while (__page_idx < (num_pages)) { \ pmap_set_cache_attributes( \ user_page_list[__page_idx].phys_addr, \ (cache_attr)); \ __page_idx++; \ } \ (object)->set_cache_attr = TRUE; \ } \ MACRO_END #endif #endif /* PMAP_BATCH_SET_CACHE_ATTR */ #define PMAP_ENTER_CHECK(pmap, page) \ { \ if ((page)->vmp_error) { \ panic("VM page %p should not have an error\n", \ (page)); \ } \ } /* * Routines to manage reference/modify bits based on * physical addresses, simulating them if not provided * by the hardware. */ struct pfc { long pfc_cpus; long pfc_invalid_global; }; typedef struct pfc pmap_flush_context; /* Clear reference bit */ extern void pmap_clear_reference(ppnum_t pn); /* Return reference bit */ extern boolean_t (pmap_is_referenced)(ppnum_t pn); /* Set modify bit */ extern void pmap_set_modify(ppnum_t pn); /* Clear modify bit */ extern void pmap_clear_modify(ppnum_t pn); /* Return modify bit */ extern boolean_t pmap_is_modified(ppnum_t pn); /* Return modified and referenced bits */ extern unsigned int pmap_get_refmod(ppnum_t pn); /* Clear modified and referenced bits */ extern void pmap_clear_refmod(ppnum_t pn, unsigned int mask); #define VM_MEM_MODIFIED 0x01 /* Modified bit */ #define VM_MEM_REFERENCED 0x02 /* Referenced bit */ extern void pmap_clear_refmod_options(ppnum_t pn, unsigned int mask, unsigned int options, void *); extern void pmap_flush_context_init(pmap_flush_context *); extern void pmap_flush(pmap_flush_context *); /* * Routines that operate on ranges of virtual addresses. */ extern void pmap_protect( /* Change protections. */ pmap_t map, vm_map_offset_t s, vm_map_offset_t e, vm_prot_t prot); extern void pmap_protect_options( /* Change protections. */ pmap_t map, vm_map_offset_t s, vm_map_offset_t e, vm_prot_t prot, unsigned int options, void *arg); extern void (pmap_pageable)( pmap_t pmap, vm_map_offset_t start, vm_map_offset_t end, boolean_t pageable); extern uint64_t pmap_nesting_size_min; extern uint64_t pmap_nesting_size_max; extern kern_return_t pmap_nest(pmap_t, pmap_t, addr64_t, addr64_t, uint64_t); extern kern_return_t pmap_unnest(pmap_t, addr64_t, uint64_t); #define PMAP_UNNEST_CLEAN 1 extern kern_return_t pmap_unnest_options(pmap_t, addr64_t, uint64_t, unsigned int); extern boolean_t pmap_adjust_unnest_parameters(pmap_t, vm_map_offset_t *, vm_map_offset_t *); extern void pmap_advise_pagezero_range(pmap_t, uint64_t); #endif /* MACH_KERNEL_PRIVATE */ extern boolean_t pmap_is_noencrypt(ppnum_t); extern void pmap_set_noencrypt(ppnum_t pn); extern void pmap_clear_noencrypt(ppnum_t pn); /* * JMM - This portion is exported to other kernel components right now, * but will be pulled back in the future when the needed functionality * is provided in a cleaner manner. */ extern pmap_t kernel_pmap; /* The kernel's map */ #define pmap_kernel() (kernel_pmap) /* machine independent WIMG bits */ #define VM_MEM_GUARDED 0x1 /* (G) Guarded Storage */ #define VM_MEM_COHERENT 0x2 /* (M) Memory Coherency */ #define VM_MEM_NOT_CACHEABLE 0x4 /* (I) Cache Inhibit */ #define VM_MEM_WRITE_THROUGH 0x8 /* (W) Write-Through */ #define VM_WIMG_USE_DEFAULT 0x80 #define VM_WIMG_MASK 0xFF #define VM_MEM_SUPERPAGE 0x100 /* map a superpage instead of a base page */ #define VM_MEM_STACK 0x200 #if __x86_64__ /* N.B. These use the same numerical space as the PMAP_EXPAND_OPTIONS * definitions in i386/pmap_internal.h */ #define PMAP_CREATE_64BIT 0x1 #define PMAP_CREATE_EPT 0x2 #define PMAP_CREATE_KNOWN_FLAGS (PMAP_CREATE_64BIT | PMAP_CREATE_EPT) #endif #define PMAP_OPTIONS_NOWAIT 0x1 /* don't block, return * KERN_RESOURCE_SHORTAGE * instead */ #define PMAP_OPTIONS_NOENTER 0x2 /* expand pmap if needed * but don't enter mapping */ #define PMAP_OPTIONS_COMPRESSOR 0x4 /* credit the compressor for * this operation */ #define PMAP_OPTIONS_INTERNAL 0x8 /* page from internal object */ #define PMAP_OPTIONS_REUSABLE 0x10 /* page is "reusable" */ #define PMAP_OPTIONS_NOFLUSH 0x20 /* delay flushing of pmap */ #define PMAP_OPTIONS_NOREFMOD 0x40 /* don't need ref/mod on disconnect */ #define PMAP_OPTIONS_ALT_ACCT 0x80 /* use alternate accounting scheme for page */ #define PMAP_OPTIONS_REMOVE 0x100 /* removing a mapping */ #define PMAP_OPTIONS_SET_REUSABLE 0x200 /* page is now "reusable" */ #define PMAP_OPTIONS_CLEAR_REUSABLE 0x400 /* page no longer "reusable" */ #define PMAP_OPTIONS_COMPRESSOR_IFF_MODIFIED 0x800 /* credit the compressor * iff page was modified */ #define PMAP_OPTIONS_PROTECT_IMMEDIATE 0x1000 /* allow protections to be * be upgraded */ #define PMAP_OPTIONS_CLEAR_WRITE 0x2000 #if !defined(__LP64__) extern vm_offset_t pmap_extract(pmap_t pmap, vm_map_offset_t va); #endif extern void pmap_change_wiring( /* Specify pageability */ pmap_t pmap, vm_map_offset_t va, boolean_t wired); /* LP64todo - switch to vm_map_offset_t when it grows */ extern void pmap_remove( /* Remove mappings. */ pmap_t map, vm_map_offset_t s, vm_map_offset_t e); extern void pmap_remove_options( /* Remove mappings. */ pmap_t map, vm_map_offset_t s, vm_map_offset_t e, int options); extern void fillPage(ppnum_t pa, unsigned int fill); #if defined(__LP64__) void pmap_pre_expand(pmap_t pmap, vm_map_offset_t vaddr); #endif mach_vm_size_t pmap_query_resident(pmap_t pmap, vm_map_offset_t s, vm_map_offset_t e, mach_vm_size_t *compressed_bytes_p); /* Inform the pmap layer that there is a JIT entry in this map. */ extern void pmap_set_jit_entitled(pmap_t pmap); /* * Tell the pmap layer what range within the nested region the VM intends to * use. */ extern void pmap_trim(pmap_t grand, pmap_t subord, addr64_t vstart, addr64_t nstart, uint64_t size); /* * Dump page table contents into the specified buffer. Returns the number of * bytes copied, 0 if insufficient space, (size_t)-1 if unsupported. * This is expected to only be called from kernel debugger context, * so synchronization is not required. */ extern size_t pmap_dump_page_tables(pmap_t pmap, void *bufp, void *buf_end); /* * Indicates if any special policy is applied to this protection by the pmap * layer. */ bool pmap_has_prot_policy(vm_prot_t prot); /* * Causes the pmap to return any available pages that it can return cheaply to * the VM. */ uint64_t pmap_release_pages_fast(void); #define PMAP_QUERY_PAGE_PRESENT 0x01 #define PMAP_QUERY_PAGE_REUSABLE 0x02 #define PMAP_QUERY_PAGE_INTERNAL 0x04 #define PMAP_QUERY_PAGE_ALTACCT 0x08 #define PMAP_QUERY_PAGE_COMPRESSED 0x10 #define PMAP_QUERY_PAGE_COMPRESSED_ALTACCT 0x20 extern kern_return_t pmap_query_page_info( pmap_t pmap, vm_map_offset_t va, int *disp); #if CONFIG_PGTRACE int pmap_pgtrace_add_page(pmap_t pmap, vm_map_offset_t start, vm_map_offset_t end); int pmap_pgtrace_delete_page(pmap_t pmap, vm_map_offset_t start, vm_map_offset_t end); kern_return_t pmap_pgtrace_fault(pmap_t pmap, vm_map_offset_t va, arm_saved_state_t *ss); #endif extern void pmap_ledger_alloc_init(size_t); extern ledger_t pmap_ledger_alloc(void); extern void pmap_ledger_free(ledger_t); #endif /* KERNEL_PRIVATE */ #endif /* _VM_PMAP_H_ */
29.372925
104
0.69877
10be7cb124eb521c9eb980e3352452922e8df2cd
783
h
C
include/net.h
matleg/prelimi_nn
58a6ccaafdd0c94c8a2d6c7753607271a68190cd
[ "Unlicense" ]
null
null
null
include/net.h
matleg/prelimi_nn
58a6ccaafdd0c94c8a2d6c7753607271a68190cd
[ "Unlicense" ]
null
null
null
include/net.h
matleg/prelimi_nn
58a6ccaafdd0c94c8a2d6c7753607271a68190cd
[ "Unlicense" ]
null
null
null
#ifndef NET_H #define NET_H #include <vector> #include <iostream> #include "neuron.h" class Net { public: Net(const vector<unsigned> &topology); ~Net(); void feedForward(const vector<double> &inputVals); void backProp(const vector<double> &targetVals); void getResults(vector<double> &resultVals); double getRecentAverageError(void) const { return mRecentAverageError; } void randomizeConnectionsWeight(void); // not used void setBiaisOutputVal(void); // not used void startTraining(); private: vector<Layer> mLayers; double mError; double mRecentAverageError; static double mRecentAverageSmoothingFactor; vector<vector<double>> mInputs; vector<vector<double>> mOutputs; int mTrainingIndex; }; #endif // NET_H
21.162162
76
0.713921
10c0fb88b244619fc4bde44328d04ac752fe94ad
1,097
h
C
src/utils.h
nariaki3551/master_mind_cpp
d0006a6bac079f8e063c05cd6bde986d0055393b
[ "MIT" ]
null
null
null
src/utils.h
nariaki3551/master_mind_cpp
d0006a6bac079f8e063c05cd6bde986d0055393b
[ "MIT" ]
null
null
null
src/utils.h
nariaki3551/master_mind_cpp
d0006a6bac079f8e063c05cd6bde986d0055393b
[ "MIT" ]
null
null
null
#ifndef __UTILS_H__ #define __UTILS_H__ #include <sstream> #include <memory> #include <vector> #include "def.h" #include "config.h" namespace MasterMind { /** * @fn std::string showCode(Code code) * @brief コードを表示する * @param[in] code コード * @return コードのstring */ std::string strCode( Code &code ) noexcept; /** * @fn std::string showCode(Code code) * @brief コードを表示する * @param[in] code コード * @return コードのstring */ std::string strCode( CodePtr code ) noexcept; extern thread_local std::vector<int> x; extern thread_local std::vector<int> y; /** * @fn Hint countHitBlow(Code &code, Code &guess) * @brief コード2つから, hit, blowを計算する * @param[in] code コード * @param[in] guess コード * @param[in] config パラメタ * @return (hit, blow) */ Hint countHitBlow( Code &code, Code &guess, Config &config ) noexcept; /** * @fn CodePtrList code(CodePtrList &codePtrList) * @brief copi CodePtrList * @param[in] codePtrList * @return copied codePtrList */ CodePtrList copy( CodePtrList &codePtrList ) noexcept; }; // MasterMind #endif // __UTILS_H__
15.671429
48
0.66454
31631f6db5c1f27627a6d7f59e8dcf400383a5ad
1,178
c
C
libsodium/sodium/core.c
jabez1314/myShadowsocks
97ca7051e42ec4f091cbe8b1c3c68666a56efce2
[ "Apache-2.0" ]
null
null
null
libsodium/sodium/core.c
jabez1314/myShadowsocks
97ca7051e42ec4f091cbe8b1c3c68666a56efce2
[ "Apache-2.0" ]
null
null
null
libsodium/sodium/core.c
jabez1314/myShadowsocks
97ca7051e42ec4f091cbe8b1c3c68666a56efce2
[ "Apache-2.0" ]
null
null
null
#include "core.h" #include "crypto_generichash.h" #include "crypto_onetimeauth.h" #include "crypto_pwhash_argon2i.h" #include "crypto_scalarmult.h" #include "crypto_stream_chacha20.h" #include "randombytes.h" #include "runtime.h" #include "utils.h" #if !defined(_MSC_VER) && 1 # warning This is unstable, untested, development code. # warning It might not compile. It might not work as expected. # warning It might be totally insecure. # warning Do not use this in production. # warning Use releases available at https://download.libsodium.org/libsodium/releases/ instead. # warning Alternatively, use the "stable" branch in the git repository. #endif static int initialized; int sodium_init(void) { if (initialized != 0) { return 1; } _sodium_runtime_get_cpu_features(); randombytes_stir(); _sodium_alloc_init(); _crypto_pwhash_argon2i_pick_best_implementation(); _crypto_generichash_blake2b_pick_best_implementation(); _crypto_onetimeauth_poly1305_pick_best_implementation(); _crypto_scalarmult_curve25519_pick_best_implementation(); _crypto_stream_chacha20_pick_best_implementation(); initialized = 1; return 0; }
28.731707
95
0.767402
3187923950e21080330fee056d8da8beb1212147
2,193
c
C
qemu/pc-bios/s390-ccw/libc.c
hyunjoy/scripts
01114d3627730d695b5ebe61093c719744432ffa
[ "Apache-2.0" ]
44
2022-03-16T08:32:31.000Z
2022-03-31T16:02:35.000Z
qemu/pc-bios/s390-ccw/libc.c
hyunjoy/scripts
01114d3627730d695b5ebe61093c719744432ffa
[ "Apache-2.0" ]
1
2022-03-29T02:30:28.000Z
2022-03-30T03:40:46.000Z
qemu/pc-bios/s390-ccw/libc.c
hyunjoy/scripts
01114d3627730d695b5ebe61093c719744432ffa
[ "Apache-2.0" ]
18
2022-03-19T04:41:04.000Z
2022-03-31T03:32:12.000Z
/* * libc-style definitions and functions * * Copyright 2018 IBM Corp. * Author(s): Collin L. Walling <walling@linux.vnet.ibm.com> * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. */ #include "libc.h" #include "s390-ccw.h" /** * atoui: * @str: the string to be converted. * * Given a string @str, convert it to an integer. Leading spaces are * ignored. Any other non-numerical value will terminate the conversion * and return 0. This function only handles numbers between 0 and * UINT64_MAX inclusive. * * Returns: an integer converted from the string @str, or the number 0 * if an error occurred. */ uint64_t atoui(const char *str) { int val = 0; if (!str || !str[0]) { return 0; } while (*str == ' ') { str++; } while (*str) { if (!isdigit(*(unsigned char *)str)) { break; } val = val * 10 + *str - '0'; str++; } return val; } /** * uitoa: * @num: an integer (base 10) to be converted. * @str: a pointer to a string to store the conversion. * @len: the length of the passed string. * * Given an integer @num, convert it to a string. The string @str must be * allocated beforehand. The resulting string will be null terminated and * returned. This function only handles numbers between 0 and UINT64_MAX * inclusive. * * Returns: the string @str of the converted integer @num */ char *uitoa(uint64_t num, char *str, size_t len) { long num_idx = 1; /* account for NUL */ uint64_t tmp = num; IPL_assert(str != NULL, "uitoa: no space allocated to store string"); /* Count indices of num */ while ((tmp /= 10) != 0) { num_idx++; } /* Check if we have enough space for num and NUL */ IPL_assert(len > num_idx, "uitoa: array too small for conversion"); str[num_idx--] = '\0'; /* Convert int to string */ while (num_idx >= 0) { str[num_idx--] = num % 10 + '0'; num /= 10; } return str; }
24.640449
73
0.619699
fffc9b5bd0c8d9315025b7a645dc618ba51881db
20,903
c
C
external/wpa_supplicant/src/utils/edit.c
SenthilKumarGS/TizenRT
691639aa9667de5d966f040f0291a402727ab6ae
[ "Apache-2.0" ]
511
2017-03-29T09:14:09.000Z
2022-03-30T23:10:29.000Z
external/wpa_supplicant/src/utils/edit.c
SenthilKumarGS/TizenRT
691639aa9667de5d966f040f0291a402727ab6ae
[ "Apache-2.0" ]
4,673
2017-03-29T10:43:43.000Z
2022-03-31T08:33:44.000Z
external/wpa_supplicant/src/utils/edit.c
SenthilKumarGS/TizenRT
691639aa9667de5d966f040f0291a402727ab6ae
[ "Apache-2.0" ]
642
2017-03-30T20:45:33.000Z
2022-03-24T17:07:33.000Z
/* * Command line editing and history * Copyright (c) 2010-2011, Jouni Malinen <j@w1.fi> * * This software may be distributed under the terms of the BSD license. * See README for more details. */ #include "includes.h" #include <termios.h> #include "common.h" #include "eloop.h" #include "list.h" #include "edit.h" #define CMD_BUF_LEN 4096 static char cmdbuf[CMD_BUF_LEN]; static int cmdbuf_pos = 0; static int cmdbuf_len = 0; static char currbuf[CMD_BUF_LEN]; static int currbuf_valid = 0; static const char *ps2 = NULL; #define HISTORY_MAX 100 #ifndef STDIN_FILENO #define STDIN_FILENO 0 #endif struct edit_history { struct dl_list list; char str[1]; }; static struct dl_list history_list; static struct edit_history *history_curr; static void *edit_cb_ctx; static void (*edit_cmd_cb)(void *ctx, char *cmd); static void (*edit_eof_cb)(void *ctx); static char **(*edit_completion_cb)(void *ctx, const char *cmd, int pos) = NULL; static struct termios prevt, newt; #define CLEAR_END_LINE "\e[K" void edit_clear_line(void) { int i; putchar('\r'); for (i = 0; i < cmdbuf_len + 2 + (ps2 ? (int)os_strlen(ps2) : 0); i++) { putchar(' '); } } static void move_start(void) { cmdbuf_pos = 0; edit_redraw(); } static void move_end(void) { cmdbuf_pos = cmdbuf_len; edit_redraw(); } static void move_left(void) { if (cmdbuf_pos > 0) { cmdbuf_pos--; edit_redraw(); } } static void move_right(void) { if (cmdbuf_pos < cmdbuf_len) { cmdbuf_pos++; edit_redraw(); } } static void move_word_left(void) { while (cmdbuf_pos > 0 && cmdbuf[cmdbuf_pos - 1] == ' ') { cmdbuf_pos--; } while (cmdbuf_pos > 0 && cmdbuf[cmdbuf_pos - 1] != ' ') { cmdbuf_pos--; } edit_redraw(); } static void move_word_right(void) { while (cmdbuf_pos < cmdbuf_len && cmdbuf[cmdbuf_pos] == ' ') { cmdbuf_pos++; } while (cmdbuf_pos < cmdbuf_len && cmdbuf[cmdbuf_pos] != ' ') { cmdbuf_pos++; } edit_redraw(); } static void delete_left(void) { if (cmdbuf_pos == 0) { return; } edit_clear_line(); os_memmove(cmdbuf + cmdbuf_pos - 1, cmdbuf + cmdbuf_pos, cmdbuf_len - cmdbuf_pos); cmdbuf_pos--; cmdbuf_len--; edit_redraw(); } static void delete_current(void) { if (cmdbuf_pos == cmdbuf_len) { return; } edit_clear_line(); os_memmove(cmdbuf + cmdbuf_pos, cmdbuf + cmdbuf_pos + 1, cmdbuf_len - cmdbuf_pos); cmdbuf_len--; edit_redraw(); } static void delete_word(void) { int pos; edit_clear_line(); pos = cmdbuf_pos; while (pos > 0 && cmdbuf[pos - 1] == ' ') { pos--; } while (pos > 0 && cmdbuf[pos - 1] != ' ') { pos--; } os_memmove(cmdbuf + pos, cmdbuf + cmdbuf_pos, cmdbuf_len - cmdbuf_pos); cmdbuf_len -= cmdbuf_pos - pos; cmdbuf_pos = pos; edit_redraw(); } static void clear_left(void) { if (cmdbuf_pos == 0) { return; } edit_clear_line(); os_memmove(cmdbuf, cmdbuf + cmdbuf_pos, cmdbuf_len - cmdbuf_pos); cmdbuf_len -= cmdbuf_pos; cmdbuf_pos = 0; edit_redraw(); } static void clear_right(void) { if (cmdbuf_pos == cmdbuf_len) { return; } edit_clear_line(); cmdbuf_len = cmdbuf_pos; edit_redraw(); } static void history_add(const char *str) { struct edit_history *h, *match = NULL, *last = NULL; size_t len, count = 0; if (str[0] == '\0') { return; } dl_list_for_each(h, &history_list, struct edit_history, list) { if (os_strcmp(str, h->str) == 0) { match = h; break; } last = h; count++; } if (match) { dl_list_del(&h->list); dl_list_add(&history_list, &h->list); history_curr = h; return; } if (count >= HISTORY_MAX && last) { dl_list_del(&last->list); os_free(last); } len = os_strlen(str); h = os_zalloc(sizeof(*h) + len); if (h == NULL) { return; } dl_list_add(&history_list, &h->list); os_strlcpy(h->str, str, len + 1); history_curr = h; } static void history_use(void) { edit_clear_line(); cmdbuf_len = cmdbuf_pos = os_strlen(history_curr->str); os_memcpy(cmdbuf, history_curr->str, cmdbuf_len); edit_redraw(); } static void history_prev(void) { if (history_curr == NULL) { return; } if (history_curr == dl_list_first(&history_list, struct edit_history, list)) { if (!currbuf_valid) { cmdbuf[cmdbuf_len] = '\0'; os_memcpy(currbuf, cmdbuf, cmdbuf_len + 1); currbuf_valid = 1; history_use(); return; } } if (history_curr == dl_list_last(&history_list, struct edit_history, list)) { return; } history_curr = dl_list_entry(history_curr->list.next, struct edit_history, list); history_use(); } static void history_next(void) { if (history_curr == NULL || history_curr == dl_list_first(&history_list, struct edit_history, list)) { if (currbuf_valid) { currbuf_valid = 0; edit_clear_line(); cmdbuf_len = cmdbuf_pos = os_strlen(currbuf); os_memcpy(cmdbuf, currbuf, cmdbuf_len); edit_redraw(); } return; } history_curr = dl_list_entry(history_curr->list.prev, struct edit_history, list); history_use(); } static void history_read(const char *fname) { FILE *f; char buf[CMD_BUF_LEN], *pos; f = fopen(fname, "r"); if (f == NULL) { return; } while (fgets(buf, CMD_BUF_LEN, f)) { for (pos = buf; *pos; pos++) { if (*pos == '\r' || *pos == '\n') { *pos = '\0'; break; } } history_add(buf); } fclose(f); } static void history_write(const char *fname, int (*filter_cb)(void *ctx, const char *cmd)) { FILE *f; struct edit_history *h; f = fopen(fname, "w"); if (f == NULL) { return; } dl_list_for_each_reverse(h, &history_list, struct edit_history, list) { if (filter_cb && filter_cb(edit_cb_ctx, h->str)) { continue; } fprintf(f, "%s\n", h->str); } fclose(f); } static void history_debug_dump(void) { struct edit_history *h; edit_clear_line(); printf("\r"); dl_list_for_each_reverse(h, &history_list, struct edit_history, list) printf("%s%s\n", h == history_curr ? "[C]" : "", h->str); if (currbuf_valid) { printf("{%s}\n", currbuf); } edit_redraw(); } static void insert_char(int c) { if (cmdbuf_len >= (int)sizeof(cmdbuf) - 1) { return; } if (cmdbuf_len == cmdbuf_pos) { cmdbuf[cmdbuf_pos++] = c; cmdbuf_len++; putchar(c); fflush(stdout); } else { os_memmove(cmdbuf + cmdbuf_pos + 1, cmdbuf + cmdbuf_pos, cmdbuf_len - cmdbuf_pos); cmdbuf[cmdbuf_pos++] = c; cmdbuf_len++; edit_redraw(); } } static void process_cmd(void) { currbuf_valid = 0; if (cmdbuf_len == 0) { printf("\n%s> ", ps2 ? ps2 : ""); fflush(stdout); return; } printf("\n"); cmdbuf[cmdbuf_len] = '\0'; history_add(cmdbuf); cmdbuf_pos = 0; cmdbuf_len = 0; edit_cmd_cb(edit_cb_ctx, cmdbuf); printf("%s> ", ps2 ? ps2 : ""); fflush(stdout); } static void free_completions(char **c) { int i; if (c == NULL) { return; } for (i = 0; c[i]; i++) { os_free(c[i]); } os_free(c); } static int filter_strings(char **c, char *str, size_t len) { int i, j; for (i = 0, j = 0; c[j]; j++) { if (os_strncasecmp(c[j], str, len) == 0) { if (i != j) { c[i] = c[j]; c[j] = NULL; } i++; } else { os_free(c[j]); c[j] = NULL; } } c[i] = NULL; return i; } static int common_len(const char *a, const char *b) { int len = 0; while (a[len] && a[len] == b[len]) { len++; } return len; } static int max_common_length(char **c) { int len, i; len = os_strlen(c[0]); for (i = 1; c[i]; i++) { int same = common_len(c[0], c[i]); if (same < len) { len = same; } } return len; } static int cmp_str(const void *a, const void *b) { return os_strcmp(*(const char **)a, *(const char **)b); } static void complete(int list) { char **c; int i, len, count; int start, end; int room, plen, add_space; if (edit_completion_cb == NULL) { return; } cmdbuf[cmdbuf_len] = '\0'; c = edit_completion_cb(edit_cb_ctx, cmdbuf, cmdbuf_pos); if (c == NULL) { return; } end = cmdbuf_pos; start = end; while (start > 0 && cmdbuf[start - 1] != ' ') { start--; } plen = end - start; count = filter_strings(c, &cmdbuf[start], plen); if (count == 0) { free_completions(c); return; } len = max_common_length(c); if (len <= plen && count > 1) { if (list) { qsort(c, count, sizeof(char *), cmp_str); edit_clear_line(); printf("\r"); for (i = 0; c[i]; i++) { printf("%s%s", i > 0 ? " " : "", c[i]); } printf("\n"); edit_redraw(); } free_completions(c); return; } len -= plen; room = sizeof(cmdbuf) - 1 - cmdbuf_len; if (room < len) { len = room; } add_space = count == 1 && len < room; os_memmove(cmdbuf + cmdbuf_pos + len + add_space, cmdbuf + cmdbuf_pos, cmdbuf_len - cmdbuf_pos); os_memcpy(&cmdbuf[cmdbuf_pos - plen], c[0], plen + len); if (add_space) { cmdbuf[cmdbuf_pos + len] = ' '; } cmdbuf_pos += len + add_space; cmdbuf_len += len + add_space; edit_redraw(); free_completions(c); } enum edit_key_code { EDIT_KEY_NONE = 256, EDIT_KEY_TAB, EDIT_KEY_UP, EDIT_KEY_DOWN, EDIT_KEY_RIGHT, EDIT_KEY_LEFT, EDIT_KEY_ENTER, EDIT_KEY_BACKSPACE, EDIT_KEY_INSERT, EDIT_KEY_DELETE, EDIT_KEY_HOME, EDIT_KEY_END, EDIT_KEY_PAGE_UP, EDIT_KEY_PAGE_DOWN, EDIT_KEY_F1, EDIT_KEY_F2, EDIT_KEY_F3, EDIT_KEY_F4, EDIT_KEY_F5, EDIT_KEY_F6, EDIT_KEY_F7, EDIT_KEY_F8, EDIT_KEY_F9, EDIT_KEY_F10, EDIT_KEY_F11, EDIT_KEY_F12, EDIT_KEY_CTRL_UP, EDIT_KEY_CTRL_DOWN, EDIT_KEY_CTRL_RIGHT, EDIT_KEY_CTRL_LEFT, EDIT_KEY_CTRL_A, EDIT_KEY_CTRL_B, EDIT_KEY_CTRL_D, EDIT_KEY_CTRL_E, EDIT_KEY_CTRL_F, EDIT_KEY_CTRL_G, EDIT_KEY_CTRL_H, EDIT_KEY_CTRL_J, EDIT_KEY_CTRL_K, EDIT_KEY_CTRL_L, EDIT_KEY_CTRL_N, EDIT_KEY_CTRL_O, EDIT_KEY_CTRL_P, EDIT_KEY_CTRL_R, EDIT_KEY_CTRL_T, EDIT_KEY_CTRL_U, EDIT_KEY_CTRL_V, EDIT_KEY_CTRL_W, EDIT_KEY_ALT_UP, EDIT_KEY_ALT_DOWN, EDIT_KEY_ALT_RIGHT, EDIT_KEY_ALT_LEFT, EDIT_KEY_SHIFT_UP, EDIT_KEY_SHIFT_DOWN, EDIT_KEY_SHIFT_RIGHT, EDIT_KEY_SHIFT_LEFT, EDIT_KEY_ALT_SHIFT_UP, EDIT_KEY_ALT_SHIFT_DOWN, EDIT_KEY_ALT_SHIFT_RIGHT, EDIT_KEY_ALT_SHIFT_LEFT, EDIT_KEY_EOF }; static void show_esc_buf(const char *esc_buf, char c, int i) { edit_clear_line(); printf("\rESC buffer '%s' c='%c' [%d]\n", esc_buf, c, i); edit_redraw(); } static enum edit_key_code esc_seq_to_key1_no(char last) { switch (last) { case 'A': return EDIT_KEY_UP; case 'B': return EDIT_KEY_DOWN; case 'C': return EDIT_KEY_RIGHT; case 'D': return EDIT_KEY_LEFT; default: return EDIT_KEY_NONE; } } static enum edit_key_code esc_seq_to_key1_shift(char last) { switch (last) { case 'A': return EDIT_KEY_SHIFT_UP; case 'B': return EDIT_KEY_SHIFT_DOWN; case 'C': return EDIT_KEY_SHIFT_RIGHT; case 'D': return EDIT_KEY_SHIFT_LEFT; default: return EDIT_KEY_NONE; } } static enum edit_key_code esc_seq_to_key1_alt(char last) { switch (last) { case 'A': return EDIT_KEY_ALT_UP; case 'B': return EDIT_KEY_ALT_DOWN; case 'C': return EDIT_KEY_ALT_RIGHT; case 'D': return EDIT_KEY_ALT_LEFT; default: return EDIT_KEY_NONE; } } static enum edit_key_code esc_seq_to_key1_alt_shift(char last) { switch (last) { case 'A': return EDIT_KEY_ALT_SHIFT_UP; case 'B': return EDIT_KEY_ALT_SHIFT_DOWN; case 'C': return EDIT_KEY_ALT_SHIFT_RIGHT; case 'D': return EDIT_KEY_ALT_SHIFT_LEFT; default: return EDIT_KEY_NONE; } } static enum edit_key_code esc_seq_to_key1_ctrl(char last) { switch (last) { case 'A': return EDIT_KEY_CTRL_UP; case 'B': return EDIT_KEY_CTRL_DOWN; case 'C': return EDIT_KEY_CTRL_RIGHT; case 'D': return EDIT_KEY_CTRL_LEFT; default: return EDIT_KEY_NONE; } } static enum edit_key_code esc_seq_to_key1(int param1, int param2, char last) { /* ESC-[<param1>;<param2><last> */ if (param1 < 0 && param2 < 0) { return esc_seq_to_key1_no(last); } if (param1 == 1 && param2 == 2) { return esc_seq_to_key1_shift(last); } if (param1 == 1 && param2 == 3) { return esc_seq_to_key1_alt(last); } if (param1 == 1 && param2 == 4) { return esc_seq_to_key1_alt_shift(last); } if (param1 == 1 && param2 == 5) { return esc_seq_to_key1_ctrl(last); } if (param2 < 0) { if (last != '~') { return EDIT_KEY_NONE; } switch (param1) { case 2: return EDIT_KEY_INSERT; case 3: return EDIT_KEY_DELETE; case 5: return EDIT_KEY_PAGE_UP; case 6: return EDIT_KEY_PAGE_DOWN; case 15: return EDIT_KEY_F5; case 17: return EDIT_KEY_F6; case 18: return EDIT_KEY_F7; case 19: return EDIT_KEY_F8; case 20: return EDIT_KEY_F9; case 21: return EDIT_KEY_F10; case 23: return EDIT_KEY_F11; case 24: return EDIT_KEY_F12; } } return EDIT_KEY_NONE; } static enum edit_key_code esc_seq_to_key2(int param1, int param2, char last) { /* ESC-O<param1>;<param2><last> */ if (param1 >= 0 || param2 >= 0) { return EDIT_KEY_NONE; } switch (last) { case 'F': return EDIT_KEY_END; case 'H': return EDIT_KEY_HOME; case 'P': return EDIT_KEY_F1; case 'Q': return EDIT_KEY_F2; case 'R': return EDIT_KEY_F3; case 'S': return EDIT_KEY_F4; default: return EDIT_KEY_NONE; } } static enum edit_key_code esc_seq_to_key(char *seq) { char last, *pos; int param1 = -1, param2 = -1; enum edit_key_code ret = EDIT_KEY_NONE; last = '\0'; for (pos = seq; *pos; pos++) { last = *pos; } if (seq[1] >= '0' && seq[1] <= '9') { param1 = atoi(&seq[1]); pos = os_strchr(seq, ';'); if (pos) { param2 = atoi(pos + 1); } } if (seq[0] == '[') { ret = esc_seq_to_key1(param1, param2, last); } else if (seq[0] == 'O') { ret = esc_seq_to_key2(param1, param2, last); } if (ret != EDIT_KEY_NONE) { return ret; } edit_clear_line(); printf("\rUnknown escape sequence '%s'\n", seq); edit_redraw(); return EDIT_KEY_NONE; } static enum edit_key_code edit_read_key(int sock) { int c; unsigned char buf[1]; int res; static int esc = -1; static char esc_buf[7]; res = read(sock, buf, 1); if (res < 0) { perror("read"); } if (res <= 0) { return EDIT_KEY_EOF; } c = buf[0]; if (esc >= 0) { if (c == 27 /* ESC */) { esc = 0; return EDIT_KEY_NONE; } if (esc == 6) { show_esc_buf(esc_buf, c, 0); esc = -1; } else { esc_buf[esc++] = c; esc_buf[esc] = '\0'; } } if (esc == 1) { if (esc_buf[0] != '[' && esc_buf[0] != 'O') { show_esc_buf(esc_buf, c, 1); esc = -1; return EDIT_KEY_NONE; } else { return EDIT_KEY_NONE; /* Escape sequence continues */ } } if (esc > 1) { if ((c >= '0' && c <= '9') || c == ';') { return EDIT_KEY_NONE; /* Escape sequence continues */ } if (c == '~' || (c >= 'A' && c <= 'Z')) { esc = -1; return esc_seq_to_key(esc_buf); } show_esc_buf(esc_buf, c, 2); esc = -1; return EDIT_KEY_NONE; } switch (c) { case 1: return EDIT_KEY_CTRL_A; case 2: return EDIT_KEY_CTRL_B; case 4: return EDIT_KEY_CTRL_D; case 5: return EDIT_KEY_CTRL_E; case 6: return EDIT_KEY_CTRL_F; case 7: return EDIT_KEY_CTRL_G; case 8: return EDIT_KEY_CTRL_H; case 9: return EDIT_KEY_TAB; case 10: return EDIT_KEY_CTRL_J; case 13: /* CR */ return EDIT_KEY_ENTER; case 11: return EDIT_KEY_CTRL_K; case 12: return EDIT_KEY_CTRL_L; case 14: return EDIT_KEY_CTRL_N; case 15: return EDIT_KEY_CTRL_O; case 16: return EDIT_KEY_CTRL_P; case 18: return EDIT_KEY_CTRL_R; case 20: return EDIT_KEY_CTRL_T; case 21: return EDIT_KEY_CTRL_U; case 22: return EDIT_KEY_CTRL_V; case 23: return EDIT_KEY_CTRL_W; case 27: /* ESC */ esc = 0; return EDIT_KEY_NONE; case 127: return EDIT_KEY_BACKSPACE; default: return c; } } static char search_buf[21]; static int search_skip; static char *search_find(void) { struct edit_history *h; size_t len = os_strlen(search_buf); int skip = search_skip; if (len == 0) { return NULL; } dl_list_for_each(h, &history_list, struct edit_history, list) { if (os_strstr(h->str, search_buf)) { if (skip == 0) { return h->str; } skip--; } } search_skip = 0; return NULL; } static void search_redraw(void) { char *match = search_find(); printf("\rsearch '%s': %s" CLEAR_END_LINE, search_buf, match ? match : ""); printf("\rsearch '%s", search_buf); fflush(stdout); } static void search_start(void) { edit_clear_line(); search_buf[0] = '\0'; search_skip = 0; search_redraw(); } static void search_clear(void) { search_redraw(); printf("\r" CLEAR_END_LINE); } static void search_stop(void) { char *match = search_find(); search_buf[0] = '\0'; search_clear(); if (match) { os_strlcpy(cmdbuf, match, CMD_BUF_LEN); cmdbuf_len = os_strlen(cmdbuf); cmdbuf_pos = cmdbuf_len; } edit_redraw(); } static void search_cancel(void) { search_buf[0] = '\0'; search_clear(); edit_redraw(); } static void search_backspace(void) { size_t len; len = os_strlen(search_buf); if (len == 0) { return; } search_buf[len - 1] = '\0'; search_skip = 0; search_redraw(); } static void search_next(void) { search_skip++; search_find(); search_redraw(); } static void search_char(char c) { size_t len; len = os_strlen(search_buf); if (len == sizeof(search_buf) - 1) { return; } search_buf[len] = c; search_buf[len + 1] = '\0'; search_skip = 0; search_redraw(); } static enum edit_key_code search_key(enum edit_key_code c) { switch (c) { case EDIT_KEY_ENTER: case EDIT_KEY_CTRL_J: case EDIT_KEY_LEFT: case EDIT_KEY_RIGHT: case EDIT_KEY_HOME: case EDIT_KEY_END: case EDIT_KEY_CTRL_A: case EDIT_KEY_CTRL_E: search_stop(); return c; case EDIT_KEY_DOWN: case EDIT_KEY_UP: search_cancel(); return EDIT_KEY_EOF; case EDIT_KEY_CTRL_H: case EDIT_KEY_BACKSPACE: search_backspace(); break; case EDIT_KEY_CTRL_R: search_next(); break; default: if (c >= 32 && c <= 255) { search_char(c); } break; } return EDIT_KEY_NONE; } static void edit_read_char(int sock, void *eloop_ctx, void *sock_ctx) { static int last_tab = 0; static int search = 0; enum edit_key_code c; c = edit_read_key(sock); if (search) { c = search_key(c); if (c == EDIT_KEY_NONE) { return; } search = 0; if (c == EDIT_KEY_EOF) { return; } } if (c != EDIT_KEY_TAB && c != EDIT_KEY_NONE) { last_tab = 0; } switch (c) { case EDIT_KEY_NONE: break; case EDIT_KEY_EOF: edit_eof_cb(edit_cb_ctx); break; case EDIT_KEY_TAB: complete(last_tab); last_tab = 1; break; case EDIT_KEY_UP: case EDIT_KEY_CTRL_P: history_prev(); break; case EDIT_KEY_DOWN: case EDIT_KEY_CTRL_N: history_next(); break; case EDIT_KEY_RIGHT: case EDIT_KEY_CTRL_F: move_right(); break; case EDIT_KEY_LEFT: case EDIT_KEY_CTRL_B: move_left(); break; case EDIT_KEY_CTRL_RIGHT: move_word_right(); break; case EDIT_KEY_CTRL_LEFT: move_word_left(); break; case EDIT_KEY_DELETE: delete_current(); break; case EDIT_KEY_END: move_end(); break; case EDIT_KEY_HOME: case EDIT_KEY_CTRL_A: move_start(); break; case EDIT_KEY_F2: history_debug_dump(); break; case EDIT_KEY_CTRL_D: if (cmdbuf_len > 0) { delete_current(); return; } printf("\n"); edit_eof_cb(edit_cb_ctx); break; case EDIT_KEY_CTRL_E: move_end(); break; case EDIT_KEY_CTRL_H: case EDIT_KEY_BACKSPACE: delete_left(); break; case EDIT_KEY_ENTER: case EDIT_KEY_CTRL_J: process_cmd(); break; case EDIT_KEY_CTRL_K: clear_right(); break; case EDIT_KEY_CTRL_L: edit_clear_line(); edit_redraw(); break; case EDIT_KEY_CTRL_R: search = 1; search_start(); break; case EDIT_KEY_CTRL_U: clear_left(); break; case EDIT_KEY_CTRL_W: delete_word(); break; default: if (c >= 32 && c <= 255) { insert_char(c); } break; } } int edit_init(void (*cmd_cb)(void *ctx, char *cmd), void (*eof_cb)(void *ctx), char **(*completion_cb)(void *ctx, const char *cmd, int pos), void *ctx, const char *history_file, const char *ps) { currbuf[0] = '\0'; dl_list_init(&history_list); history_curr = NULL; if (history_file) { history_read(history_file); } edit_cb_ctx = ctx; edit_cmd_cb = cmd_cb; edit_eof_cb = eof_cb; edit_completion_cb = completion_cb; tcgetattr(STDIN_FILENO, &prevt); newt = prevt; newt.c_lflag &= ~(ICANON | ECHO); tcsetattr(STDIN_FILENO, TCSANOW, &newt); eloop_register_read_sock(STDIN_FILENO, edit_read_char, NULL, NULL); ps2 = ps; printf("%s> ", ps2 ? ps2 : ""); fflush(stdout); return 0; } void edit_deinit(const char *history_file, int (*filter_cb)(void *ctx, const char *cmd)) { struct edit_history *h; if (history_file) { history_write(history_file, filter_cb); } while ((h = dl_list_first(&history_list, struct edit_history, list))) { dl_list_del(&h->list); os_free(h); } edit_clear_line(); putchar('\r'); fflush(stdout); eloop_unregister_read_sock(STDIN_FILENO); tcsetattr(STDIN_FILENO, TCSANOW, &prevt); } void edit_redraw(void) { char tmp; cmdbuf[cmdbuf_len] = '\0'; printf("\r%s> %s", ps2 ? ps2 : "", cmdbuf); if (cmdbuf_pos != cmdbuf_len) { tmp = cmdbuf[cmdbuf_pos]; cmdbuf[cmdbuf_pos] = '\0'; printf("\r%s> %s", ps2 ? ps2 : "", cmdbuf); cmdbuf[cmdbuf_pos] = tmp; } fflush(stdout); }
17.927101
193
0.660001
bd17375926c92393b502ca7dc4b56ad84de0ec55
3,728
h
C
src/include/statistics/latency_metric.h
aaron-tian/peloton
2406b763b91d9cee2a5d9f4dee01c761b476cef6
[ "Apache-2.0" ]
3
2018-01-08T01:06:17.000Z
2019-06-17T23:14:36.000Z
src/include/statistics/latency_metric.h
aaron-tian/peloton
2406b763b91d9cee2a5d9f4dee01c761b476cef6
[ "Apache-2.0" ]
1
2017-04-04T17:03:59.000Z
2017-04-04T17:03:59.000Z
src/include/statistics/latency_metric.h
aaron-tian/peloton
2406b763b91d9cee2a5d9f4dee01c761b476cef6
[ "Apache-2.0" ]
2
2017-03-23T18:59:38.000Z
2017-03-25T19:15:08.000Z
//===----------------------------------------------------------------------===// // // Peloton // // latency_metric.h // // Identification: src/statistics/latency_metric.h // // Copyright (c) 2015-16, Carnegie Mellon University Database Group // //===----------------------------------------------------------------------===// #pragma once #include <string> #include <sstream> #include "common/timer.h" #include "common/macros.h" #include "common/internal_types.h" #include "common/exception.h" #include "common/container/circular_buffer.h" #include "statistics/abstract_metric.h" #include <mutex> namespace peloton { namespace stats { // Container for different latency measurements struct LatencyMeasurements { double average_ = 0.0; double min_ = 0.0; double max_ = 0.0; double median_ = 0.0; double perc_25th_ = 0.0; double perc_75th_ = 0.0; double perc_99th_ = 0.0; }; /** * Metric for storing raw latency values and computing * latency measurements. */ class LatencyMetric : public AbstractMetric { public: LatencyMetric(MetricType type, size_t max_history); //===--------------------------------------------------------------------===// // HELPER METHODS //===--------------------------------------------------------------------===// inline void Reset() { latencies_.Clear(); timer_ms_.Reset(); } // Starts the timer for the next latency measurement inline void StartTimer() { timer_ms_.Reset(); timer_ms_.Start(); } // Stops the latency timer and records the total time elapsed inline void RecordLatency() { timer_ms_.Stop(); double latency_value = timer_ms_.GetDuration(); // Record this latency only if we can do so without blocking. // Occasionally losing single latency measurements is fine. { std::unique_lock<std::mutex> lock(latency_mutex_, std::defer_lock); if (lock.try_lock()) { latencies_.PushBack(latency_value); } } } // Stops the latency timer and records the total time elapsed inline void RecordLatency(const double &latency_value) { // Record this latency only if we can do so without blocking. // Occasionally losing single latency measurements is fine. std::unique_lock<std::mutex> lock(latency_mutex_, std::defer_lock); if (lock.try_lock()) { latencies_.PushBack(latency_value); } } // Returns the first latency value recorded inline double GetFirstLatencyValue() { PELOTON_ASSERT(latencies_.begin() != latencies_.end()); return *(latencies_.begin()); } // Computes the latency measurements using the latencies // collected so far. void ComputeLatencies(); // Combines the source latency metric with this latency metric void Aggregate(AbstractMetric &source); // Returns a string representation of this latency metric const std::string GetInfo() const; // Returns a copy of the latencies collected CircularBuffer<double> Copy(); private: //===--------------------------------------------------------------------===// // MEMBERS //===--------------------------------------------------------------------===// // Circular buffer with capacity N that stores the <= N // most recent latencies collected CircularBuffer<double> latencies_; // Timer for timing individual latencies Timer<std::ratio<1, 1000>> timer_ms_; // Stores result of last call to ComputeLatencies() LatencyMeasurements latency_measurements_; // The maximum number of latencies that can be stored // (the capacity size N of the circular buffer) size_t max_history_; // Protects accesses to the circular buffer std::mutex latency_mutex_; }; } // namespace stats } // namespace peloton
28.458015
80
0.616685
bd401eb8c10540fa81d5050a5600038b277cc3a3
1,144
h
C
include/Engine.h
alogfans/pumper
218ef37722f5ba0c4c26378f87f870a62d5e3c90
[ "Unlicense" ]
null
null
null
include/Engine.h
alogfans/pumper
218ef37722f5ba0c4c26378f87f870a62d5e3c90
[ "Unlicense" ]
null
null
null
include/Engine.h
alogfans/pumper
218ef37722f5ba0c4c26378f87f870a62d5e3c90
[ "Unlicense" ]
null
null
null
// Engine.h // Part of PUMPER, copyright (C) 2015 Alogfans. // // Container of all keys and values in one file *.INDEX // Which could also support random lookup. #ifndef __ENGINE_H__ #define __ENGINE_H__ #include "Types.h" #include "Status.h" #include "Lock.h" #include "DataFile.h" #include "IndexFile.h" #include <vector> namespace Pumper { class Engine : public noncopyable { public: Engine(); ~Engine(); static Status CreateDb(const String& file); static Status UnlinkDb(const String& file); Status OpenDb(const String& file); Status CloseDb(); Status UpdateChanges(); Status Put(const String& key, const String& value); Status Get(const String& key, String& value); Status Remove(const String& key); bool Contains(const String& key); std::vector<String> ListKeys(); bool IsOpened(); String OpenDbName(); private: DataFile * data_file; IndexFile * index_file; PagedFile data_paged_file, index_paged_file; String db_name; }; } // namespace Pumper #endif // __ENGINE_H__
22
59
0.638112
aec9951ae9a37eadd3b1e0d76b4759e0a15b60d8
2,330
c
C
tests/system_tests/test_cases/test_user-defined-type3.c
naoyam/physis
39ee5250a2d5baa545ca03e7c5c9aa9c81f1ab19
[ "BSD-3-Clause" ]
30
2015-01-27T02:45:34.000Z
2022-02-17T03:50:49.000Z
tests/system_tests/test_cases/test_user-defined-type3.c
naoyam/physis
39ee5250a2d5baa545ca03e7c5c9aa9c81f1ab19
[ "BSD-3-Clause" ]
8
2015-01-02T02:10:04.000Z
2015-04-21T08:42:12.000Z
tests/system_tests/test_cases/test_user-defined-type3.c
naoyam/physis
39ee5250a2d5baa545ca03e7c5c9aa9c81f1ab19
[ "BSD-3-Clause" ]
4
2015-12-16T10:18:31.000Z
2021-12-28T22:43:56.000Z
/* * TEST: Run stencil on a user-defined type * DIM: 3 * PRIORITY: 1 */ #include <stdio.h> #include "physis/physis.h" #define N 32 #define ITER 10 struct Point { float p; float q; float r; }; DeclareGrid3D(Point, struct Point); void kernel1(const int x, const int y, const int z, PSGrid3DPoint g) { float v = (PSGridGet(g, x, y, z).p + PSGridGet(g, x+1, y, z).p + PSGridGet(g, x-1, y, z).p + PSGridGet(g, x, y+1, z).p + PSGridGet(g, x, y-1, z).p + PSGridGet(g, x, y, z+1).p + PSGridGet(g, x, y, z-1).p + PSGridGet(g, x, y, z).q + PSGridGet(g, x+1, y, z).q + PSGridGet(g, x-1, y, z).q + PSGridGet(g, x, y+1, z).q + PSGridGet(g, x, y-1, z).q + PSGridGet(g, x, y, z+1).q + PSGridGet(g, x, y, z-1).q) / 14.3; PSGridEmitUtype(g.r, v); return; } void kernel2(const int x, const int y, const int z, PSGrid3DPoint g) { PSGridEmitUtype(g.p, (PSGridGet(g, x, y, z).p + PSGridGet(g, x, y, z).r) * 0.5); PSGridEmitUtype(g.q, (PSGridGet(g, x, y, z).q + PSGridGet(g, x, y, z).r) * 0.5); return; } #define halo_width (1) void dump(struct Point *input) { int i; for (i = 0; i < N*N*N; ++i) { printf("%f %f %f\n", input[i].p, input[i].q, input[i].r); } } int main(int argc, char *argv[]) { PSInit(&argc, &argv, 3, N, N, N); PSGrid3DPoint g = PSGrid3DPointNew(N, N, N); PSDomain3D d = PSDomain3DNew(0+halo_width, N-halo_width, 0+halo_width, N-halo_width, 0+halo_width, N-halo_width); size_t nelms = N*N*N; struct Point *indata = (struct Point *)malloc( sizeof(struct Point) * nelms); int i; for (i = 0; i < nelms; i++) { indata[i].p = i; indata[i].q = i+1; indata[i].r = 0; } struct Point *outdata_ps = (struct Point *)malloc( sizeof(struct Point) * nelms); PSGridCopyin(g, indata); PSStencilRun(PSStencilMap(kernel1, d, g), PSStencilMap(kernel2, d, g), ITER); PSGridCopyout(g, outdata_ps); dump(outdata_ps); PSGridFree(g); PSFinalize(); free(indata); free(outdata_ps); return 0; }
23.77551
61
0.511588
260273db57c7a3999710a1e879d8cf9bda0fd552
184
h
C
src/heapsorts/heapsort.h
primary157/AedsTP3
116e28c5fb8a445ea14aac542205d6c60456eac4
[ "MIT" ]
null
null
null
src/heapsorts/heapsort.h
primary157/AedsTP3
116e28c5fb8a445ea14aac542205d6c60456eac4
[ "MIT" ]
null
null
null
src/heapsorts/heapsort.h
primary157/AedsTP3
116e28c5fb8a445ea14aac542205d6c60456eac4
[ "MIT" ]
null
null
null
#ifndef HEAPSORT_H_INCLUDED #define HEAPSORT_H_INCLUDED #include "../quicksorts/lista.h" void heapSort(TLista *lista); void refaz(TLista *lista); void constroi(TLista *lista); #endif
20.444444
32
0.782609
ebfdd31a00b3722caa7b8fc037930752603923ba
1,484
h
C
Example/Pods/Headers/Public/WDZSDK/GlobalUserDataCaches.h
DanielOYC/WDZSDK
6ef97eabfd0e9094b857a87a563b8029db04b0e5
[ "MIT" ]
null
null
null
Example/Pods/Headers/Public/WDZSDK/GlobalUserDataCaches.h
DanielOYC/WDZSDK
6ef97eabfd0e9094b857a87a563b8029db04b0e5
[ "MIT" ]
null
null
null
Example/Pods/Headers/Public/WDZSDK/GlobalUserDataCaches.h
DanielOYC/WDZSDK
6ef97eabfd0e9094b857a87a563b8029db04b0e5
[ "MIT" ]
null
null
null
// // GlobalUserDataCaches.h // WanDianZhang // // Created by ovopark_iOS on 16/4/13. // Copyright © 2016年 JaryPan. All rights reserved. // #import <Foundation/Foundation.h> @interface GlobalUserDataCaches : NSObject // 写入当前用户的行政区域缓存 + (void)writeAdministrationArrayForCurrentUser:(NSArray *)administrationArray; // 获取当前用户的行政区域缓存 + (NSArray *)administrationArrayForCurrentUser; // 写入当前用户的门店类型缓存 + (void)writeShopTypeArrayForCurrentUser:(NSArray *)shopTypeArray; // 获取当前用户的门店类型缓存 + (NSArray *)shopTypeArrayForCurrentUser; // 写入当前用户的所有门店model列表缓存(包括设备信息) + (void)writeAllShopListModelDictionaryForCurrentUser:(NSDictionary *)allShopListModelDictionary; // 获取当前用户的所有门店model列表缓存(包括设备信息) + (NSDictionary *)allShopListModelDictionaryForCurrentUser; // 写入当前用户最后一次请求的门店列表数据 + (void)writeLastShopListModelDictionaryForCurrentUser:(NSDictionary *)lastShopListModelDictionary; // 获取当前用户最后一次请求的门店列表数据 + (NSDictionary *)lastShopListModelDictionaryForCurrentUser; // 写入当前用户的门店列表缓存(不包括设备信息、非model) + (void)writeAllShopDicsArrayForCurrentUser:(NSArray *)allShopDicsArray; // 获取当前用户的门店列表缓存(不包括设备信息、非model) + (NSArray *)allShopDicsArrayForCurrentUser; // 写入当前用户的联系人 + (void)writeContactPersonsArrayForCurrentUser:(NSArray *)contactPersonsArray; // 获取当前用户的联系人 + (NSArray *)contactPersonsArrayForCurrentUser; // 写入当前用户常用门店列表 + (void)writeCommonlyUsedShopsArrayForCurrentUser:(NSArray *)commonlyUsedShopsArray; // 获取当前用户常用门店列表 + (NSArray *)commonlyUsedShopsArrayForCurrentUser; @end
26.035088
99
0.812668
eaa4f2fe6a667ab3b9ade31ca74597bacd7c60a6
757
h
C
Headers/Frameworks/Flexo/FFMonthSidebarProvider.h
CommandPost/FinalCutProFrameworks
d98b00ff0c84af80942d71514e9238d624aca50a
[ "MIT" ]
3
2020-11-19T10:04:02.000Z
2021-10-02T17:25:21.000Z
Headers/Frameworks/Flexo/FFMonthSidebarProvider.h
CommandPost/FinalCutProFrameworks
d98b00ff0c84af80942d71514e9238d624aca50a
[ "MIT" ]
null
null
null
Headers/Frameworks/Flexo/FFMonthSidebarProvider.h
CommandPost/FinalCutProFrameworks
d98b00ff0c84af80942d71514e9238d624aca50a
[ "MIT" ]
null
null
null
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Mar 11 2021 20:53:35). // // Copyright (C) 1997-2019 Steve Nygard. // #import <Flexo/FFBaseSidebarProvider.h> @class NSString; __attribute__((visibility("hidden"))) @interface FFMonthSidebarProvider : FFBaseSidebarProvider { long long _month; long long _year; NSString *_itemDisplayName; NSString *_persistentIdentifier; } @property(readonly, nonatomic) long long year; // @synthesize year=_year; @property(readonly, nonatomic) long long month; // @synthesize month=_month; - (void)dealloc; - (id)itemIcon; - (id)itemPersistentIdentifier; - (id)itemDisplayName; - (id)initWithMonth:(unsigned long long)arg1 year:(unsigned long long)arg2 parentItem:(id)arg3; @end
25.233333
95
0.733157
d98097c65f45a6f405fe50d2b1fc04335df6c0e5
738
h
C
src/SDLSerialHandler.h
David-Parker/GBSdl
ea963aa1e56c97823b07176fc57aa448123fe02e
[ "MIT" ]
4
2022-01-12T20:23:32.000Z
2022-01-26T11:24:43.000Z
src/SDLSerialHandler.h
David-Parker/GBSdl
ea963aa1e56c97823b07176fc57aa448123fe02e
[ "MIT" ]
null
null
null
src/SDLSerialHandler.h
David-Parker/GBSdl
ea963aa1e56c97823b07176fc57aa448123fe02e
[ "MIT" ]
null
null
null
#pragma once #include "ISerialHandler.h" #include "SDL.h" #include "SDL_net.h" #include <thread> class SDLSerialHandler : public ISerialHandler { private: TCPsocket listeningSocket; TCPsocket clientSocket; const char* clientIpAddress; int clientPort; bool recieveConnected = false; bool sendConnected = false; bool byteRecieved = false; Byte recievedByte; std::thread* recieveThread; std::thread* sendThread; void handleRecieve(); void handleSend(); public: SDLSerialHandler(int listeningPort, int clientPort, const char* clientIpAddress); ~SDLSerialHandler(); bool IsSerialConnected(); void SendByte(Byte byte); bool ByteRecieved(); Byte RecieveByte(); };
21.085714
85
0.704607
fcfc3b7995a2d35be9b2ee9350bf10b3ce9e0917
808
h
C
include/core/Array.type.h
likebot0/core.h
a9afaa09966c027098160b807666b78af9123644
[ "Unlicense" ]
null
null
null
include/core/Array.type.h
likebot0/core.h
a9afaa09966c027098160b807666b78af9123644
[ "Unlicense" ]
null
null
null
include/core/Array.type.h
likebot0/core.h
a9afaa09966c027098160b807666b78af9123644
[ "Unlicense" ]
null
null
null
#ifndef _core_Array #define _core_Array ::core_Array #include <core/Size.type.h> template<typename Address, typename Size = _core_Size> struct core_Array; #include <core/Pointer.type.h> #include <core/Product.type.h> template<typename Address, typename Size> struct core_Array : _core_Product<Address, Size> { using Base_object = _core_Product<Address, Size>; using Base_object::Base_object; }; template<typename Address, typename Size> core_Array(Address, Size) -> core_Array<Address, Size>; template <typename Element, _core_Size n> struct core_Array3 { Element elements[n]; constexpr core_Array3( const Element (& array)[n] ) : elements {} { } }; template <typename Element, _core_Size n> core_Array3(const Element (&array)[n]) -> core_Array3<Element, n>; #endif
22.444444
66
0.730198
fcfffeaec3516179bbab723de0cbb41bf1a33874
224
h
C
SQLite3Demo/SQLite3Demo/ViewController/TestFMDBViewController.h
BigRhino/MyRhino
661043d07226f7ede716c7983ad99daec1dd246c
[ "MIT" ]
1
2018-12-25T07:18:08.000Z
2018-12-25T07:18:08.000Z
SQLite3Demo/SQLite3Demo/ViewController/TestFMDBViewController.h
liuyu310/MyRhino
f2aea139c045a9b709071bfba1f6aeca7d921f45
[ "MIT" ]
null
null
null
SQLite3Demo/SQLite3Demo/ViewController/TestFMDBViewController.h
liuyu310/MyRhino
f2aea139c045a9b709071bfba1f6aeca7d921f45
[ "MIT" ]
1
2018-12-18T06:46:31.000Z
2018-12-18T06:46:31.000Z
// // TestFMDBViewController.h // SQLite3Demo // // Created by Rhino on 2017/7/16. // Copyright © 2017年 Rhino. All rights reserved. // #import <UIKit/UIKit.h> @interface TestFMDBViewController : UIViewController @end
16
52
0.714286
aff03899bbcd8bb8ae7bebb7a1024c566c2419d8
52,602
c
C
mi8/drivers/soc/qcom/rpm-smd.c
wqk317/mi8_kernel_source
e3482d1a7ea6021de2fc8f3178496b4b043bb727
[ "MIT" ]
null
null
null
mi8/drivers/soc/qcom/rpm-smd.c
wqk317/mi8_kernel_source
e3482d1a7ea6021de2fc8f3178496b4b043bb727
[ "MIT" ]
null
null
null
mi8/drivers/soc/qcom/rpm-smd.c
wqk317/mi8_kernel_source
e3482d1a7ea6021de2fc8f3178496b4b043bb727
[ "MIT" ]
1
2020-03-28T11:26:15.000Z
2020-03-28T11:26:15.000Z
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #define pr_fmt(fmt) "%s: " fmt, __func__ #include <linux/module.h> #include <linux/kernel.h> #include <linux/types.h> #include <linux/bug.h> #include <linux/completion.h> #include <linux/delay.h> #include <linux/init.h> #include <linux/interrupt.h> #include <linux/io.h> #include <linux/irq.h> #include <linux/list.h> #include <linux/mutex.h> #include <linux/of_address.h> #include <linux/spinlock.h> #include <linux/string.h> #include <linux/device.h> #include <linux/notifier.h> #include <linux/slab.h> #include <linux/platform_device.h> #include <linux/of.h> #include <linux/of_platform.h> #include <linux/rbtree.h> #include <soc/qcom/rpm-notifier.h> #include <soc/qcom/rpm-smd.h> #include <soc/qcom/smd.h> #include <soc/qcom/glink_rpm_xprt.h> #include <soc/qcom/glink.h> #define CREATE_TRACE_POINTS #include <trace/events/trace_rpm_smd.h> /* Debug Definitions */ enum { MSM_RPM_LOG_REQUEST_PRETTY = BIT(0), MSM_RPM_LOG_REQUEST_RAW = BIT(1), MSM_RPM_LOG_REQUEST_SHOW_MSG_ID = BIT(2), }; static int msm_rpm_debug_mask; module_param_named( debug_mask, msm_rpm_debug_mask, int, 0644 ); struct msm_rpm_driver_data { const char *ch_name; uint32_t ch_type; smd_channel_t *ch_info; struct work_struct work; spinlock_t smd_lock_write; spinlock_t smd_lock_read; struct completion smd_open; }; struct glink_apps_rpm_data { const char *name; const char *edge; const char *xprt; void *glink_handle; struct glink_link_info *link_info; struct glink_open_config *open_cfg; struct work_struct work; }; static bool glink_enabled; static struct glink_apps_rpm_data *glink_data; #define DEFAULT_BUFFER_SIZE 256 #define DEBUG_PRINT_BUFFER_SIZE 512 #define MAX_SLEEP_BUFFER 128 #define GFP_FLAG(noirq) (noirq ? GFP_ATOMIC : GFP_NOIO) #define INV_RSC "resource does not exist" #define ERR "err\0" #define MAX_ERR_BUFFER_SIZE 128 #define MAX_WAIT_ON_ACK 24 #define INIT_ERROR 1 #define V1_PROTOCOL_VERSION 0x31726576 /* rev1 */ #define V0_PROTOCOL_VERSION 0 /* rev0 */ #define RPM_MSG_TYPE_OFFSET 16 #define RPM_MSG_TYPE_SIZE 8 #define RPM_SET_TYPE_OFFSET 28 #define RPM_SET_TYPE_SIZE 4 #define RPM_REQ_LEN_OFFSET 0 #define RPM_REQ_LEN_SIZE 16 #define RPM_MSG_VERSION_OFFSET 24 #define RPM_MSG_VERSION_SIZE 8 #define RPM_MSG_VERSION 1 #define RPM_MSG_SET_OFFSET 28 #define RPM_MSG_SET_SIZE 4 #define RPM_RSC_ID_OFFSET 16 #define RPM_RSC_ID_SIZE 12 #define RPM_DATA_LEN_OFFSET 0 #define RPM_DATA_LEN_SIZE 16 #define RPM_HDR_SIZE ((rpm_msg_fmt_ver == RPM_MSG_V0_FMT) ?\ sizeof(struct rpm_v0_hdr) : sizeof(struct rpm_v1_hdr)) #define CLEAR_FIELD(offset, size) (~GENMASK(offset + size - 1, offset)) static ATOMIC_NOTIFIER_HEAD(msm_rpm_sleep_notifier); static bool standalone; static int probe_status = -EPROBE_DEFER; static int msm_rpm_read_smd_data(char *buf); static void msm_rpm_process_ack(uint32_t msg_id, int errno); int msm_rpm_register_notifier(struct notifier_block *nb) { return atomic_notifier_chain_register(&msm_rpm_sleep_notifier, nb); } int msm_rpm_unregister_notifier(struct notifier_block *nb) { return atomic_notifier_chain_unregister(&msm_rpm_sleep_notifier, nb); } enum { MSM_RPM_MSG_REQUEST_TYPE = 0, MSM_RPM_MSG_TYPE_NR, }; static const uint32_t msm_rpm_request_service_v1[MSM_RPM_MSG_TYPE_NR] = { 0x716572, /* 'req\0' */ }; enum { RPM_V1_REQUEST_SERVICE, RPM_V1_SYSTEMDB_SERVICE, RPM_V1_COMMAND_SERVICE, RPM_V1_ACK_SERVICE, RPM_V1_NACK_SERVICE, } msm_rpm_request_service_v2; struct rpm_v0_hdr { uint32_t service_type; uint32_t request_len; }; struct rpm_v1_hdr { uint32_t request_hdr; }; struct rpm_message_header_v0 { struct rpm_v0_hdr hdr; uint32_t msg_id; enum msm_rpm_set set; uint32_t resource_type; uint32_t resource_id; uint32_t data_len; }; struct rpm_message_header_v1 { struct rpm_v1_hdr hdr; uint32_t msg_id; uint32_t resource_type; uint32_t request_details; }; struct msm_rpm_ack_msg_v0 { uint32_t req; uint32_t req_len; uint32_t rsc_id; uint32_t msg_len; uint32_t id_ack; }; struct msm_rpm_ack_msg_v1 { uint32_t request_hdr; uint32_t id_ack; }; struct kvp { unsigned int k; unsigned int s; }; struct msm_rpm_kvp_data { uint32_t key; uint32_t nbytes; /* number of bytes */ uint8_t *value; bool valid; }; struct slp_buf { struct rb_node node; char ubuf[MAX_SLEEP_BUFFER]; char *buf; bool valid; }; enum rpm_msg_fmts { RPM_MSG_V0_FMT, RPM_MSG_V1_FMT }; static uint32_t rpm_msg_fmt_ver; module_param_named( rpm_msg_fmt_ver, rpm_msg_fmt_ver, uint, 0444 ); static struct rb_root tr_root = RB_ROOT; static int (*msm_rpm_send_buffer)(char *buf, uint32_t size, bool noirq); static int msm_rpm_send_smd_buffer(char *buf, uint32_t size, bool noirq); static int msm_rpm_glink_send_buffer(char *buf, uint32_t size, bool noirq); static uint32_t msm_rpm_get_next_msg_id(void); static inline uint32_t get_offset_value(uint32_t val, uint32_t offset, uint32_t size) { return (((val) & GENMASK(offset + size - 1, offset)) >> offset); } static inline void change_offset_value(uint32_t *val, uint32_t offset, uint32_t size, int32_t val1) { uint32_t member = *val; uint32_t offset_val = get_offset_value(member, offset, size); uint32_t mask = (1 << size) - 1; offset_val += val1; *val &= CLEAR_FIELD(offset, size); *val |= ((offset_val & mask) << offset); } static inline void set_offset_value(uint32_t *val, uint32_t offset, uint32_t size, uint32_t val1) { uint32_t mask = (1 << size) - 1; *val &= CLEAR_FIELD(offset, size); *val |= ((val1 & mask) << offset); } static uint32_t get_msg_id(char *buf) { if (rpm_msg_fmt_ver == RPM_MSG_V0_FMT) return ((struct rpm_message_header_v0 *)buf)->msg_id; return ((struct rpm_message_header_v1 *)buf)->msg_id; } static uint32_t get_ack_msg_id(char *buf) { if (rpm_msg_fmt_ver == RPM_MSG_V0_FMT) return ((struct msm_rpm_ack_msg_v0 *)buf)->id_ack; return ((struct msm_rpm_ack_msg_v1 *)buf)->id_ack; } static uint32_t get_rsc_type(char *buf) { if (rpm_msg_fmt_ver == RPM_MSG_V0_FMT) return ((struct rpm_message_header_v0 *)buf)->resource_type; return ((struct rpm_message_header_v1 *)buf)->resource_type; } static uint32_t get_set_type(char *buf) { if (rpm_msg_fmt_ver == RPM_MSG_V0_FMT) return ((struct rpm_message_header_v0 *)buf)->set; return get_offset_value(((struct rpm_message_header_v1 *)buf)-> request_details, RPM_SET_TYPE_OFFSET, RPM_SET_TYPE_SIZE); } static uint32_t get_data_len(char *buf) { if (rpm_msg_fmt_ver == RPM_MSG_V0_FMT) return ((struct rpm_message_header_v0 *)buf)->data_len; return get_offset_value(((struct rpm_message_header_v1 *)buf)-> request_details, RPM_DATA_LEN_OFFSET, RPM_DATA_LEN_SIZE); } static uint32_t get_rsc_id(char *buf) { if (rpm_msg_fmt_ver == RPM_MSG_V0_FMT) return ((struct rpm_message_header_v0 *)buf)->resource_id; return get_offset_value(((struct rpm_message_header_v1 *)buf)-> request_details, RPM_RSC_ID_OFFSET, RPM_RSC_ID_SIZE); } static uint32_t get_ack_req_len(char *buf) { if (rpm_msg_fmt_ver == RPM_MSG_V0_FMT) return ((struct msm_rpm_ack_msg_v0 *)buf)->req_len; return get_offset_value(((struct msm_rpm_ack_msg_v1 *)buf)-> request_hdr, RPM_REQ_LEN_OFFSET, RPM_REQ_LEN_SIZE); } static uint32_t get_ack_msg_type(char *buf) { if (rpm_msg_fmt_ver == RPM_MSG_V0_FMT) return ((struct msm_rpm_ack_msg_v0 *)buf)->req; return get_offset_value(((struct msm_rpm_ack_msg_v1 *)buf)-> request_hdr, RPM_MSG_TYPE_OFFSET, RPM_MSG_TYPE_SIZE); } static uint32_t get_req_len(char *buf) { if (rpm_msg_fmt_ver == RPM_MSG_V0_FMT) return ((struct rpm_message_header_v0 *)buf)->hdr.request_len; return get_offset_value(((struct rpm_message_header_v1 *)buf)-> hdr.request_hdr, RPM_REQ_LEN_OFFSET, RPM_REQ_LEN_SIZE); } static void set_msg_ver(char *buf, uint32_t val) { if (rpm_msg_fmt_ver) { set_offset_value(&((struct rpm_message_header_v1 *)buf)-> hdr.request_hdr, RPM_MSG_VERSION_OFFSET, RPM_MSG_VERSION_SIZE, val); } else { set_offset_value(&((struct rpm_message_header_v1 *)buf)-> hdr.request_hdr, RPM_MSG_VERSION_OFFSET, RPM_MSG_VERSION_SIZE, 0); } } static void set_req_len(char *buf, uint32_t val) { if (rpm_msg_fmt_ver == RPM_MSG_V0_FMT) { ((struct rpm_message_header_v0 *)buf)->hdr.request_len = val; } else { set_offset_value(&((struct rpm_message_header_v1 *)buf)-> hdr.request_hdr, RPM_REQ_LEN_OFFSET, RPM_REQ_LEN_SIZE, val); } } static void change_req_len(char *buf, int32_t val) { if (rpm_msg_fmt_ver == RPM_MSG_V0_FMT) { ((struct rpm_message_header_v0 *)buf)->hdr.request_len += val; } else { change_offset_value(&((struct rpm_message_header_v1 *)buf)-> hdr.request_hdr, RPM_REQ_LEN_OFFSET, RPM_REQ_LEN_SIZE, val); } } static void set_msg_type(char *buf, uint32_t val) { if (rpm_msg_fmt_ver == RPM_MSG_V0_FMT) { ((struct rpm_message_header_v0 *)buf)->hdr.service_type = msm_rpm_request_service_v1[val]; } else { set_offset_value(&((struct rpm_message_header_v1 *)buf)-> hdr.request_hdr, RPM_MSG_TYPE_OFFSET, RPM_MSG_TYPE_SIZE, RPM_V1_REQUEST_SERVICE); } } static void set_rsc_id(char *buf, uint32_t val) { if (rpm_msg_fmt_ver == RPM_MSG_V0_FMT) ((struct rpm_message_header_v0 *)buf)->resource_id = val; else set_offset_value(&((struct rpm_message_header_v1 *)buf)-> request_details, RPM_RSC_ID_OFFSET, RPM_RSC_ID_SIZE, val); } static void set_data_len(char *buf, uint32_t val) { if (rpm_msg_fmt_ver == RPM_MSG_V0_FMT) ((struct rpm_message_header_v0 *)buf)->data_len = val; else set_offset_value(&((struct rpm_message_header_v1 *)buf)-> request_details, RPM_DATA_LEN_OFFSET, RPM_DATA_LEN_SIZE, val); } static void change_data_len(char *buf, int32_t val) { if (rpm_msg_fmt_ver == RPM_MSG_V0_FMT) ((struct rpm_message_header_v0 *)buf)->data_len += val; else change_offset_value(&((struct rpm_message_header_v1 *)buf)-> request_details, RPM_DATA_LEN_OFFSET, RPM_DATA_LEN_SIZE, val); } static void set_set_type(char *buf, uint32_t val) { if (rpm_msg_fmt_ver == RPM_MSG_V0_FMT) ((struct rpm_message_header_v0 *)buf)->set = val; else set_offset_value(&((struct rpm_message_header_v1 *)buf)-> request_details, RPM_SET_TYPE_OFFSET, RPM_SET_TYPE_SIZE, val); } static void set_msg_id(char *buf, uint32_t val) { if (rpm_msg_fmt_ver == RPM_MSG_V0_FMT) ((struct rpm_message_header_v0 *)buf)->msg_id = val; else ((struct rpm_message_header_v1 *)buf)->msg_id = val; } static void set_rsc_type(char *buf, uint32_t val) { if (rpm_msg_fmt_ver == RPM_MSG_V0_FMT) ((struct rpm_message_header_v0 *)buf)->resource_type = val; else ((struct rpm_message_header_v1 *)buf)->resource_type = val; } static inline int get_buf_len(char *buf) { return get_req_len(buf) + RPM_HDR_SIZE; } static inline struct kvp *get_first_kvp(char *buf) { if (rpm_msg_fmt_ver == RPM_MSG_V0_FMT) return (struct kvp *)(buf + sizeof(struct rpm_message_header_v0)); else return (struct kvp *)(buf + sizeof(struct rpm_message_header_v1)); } static inline struct kvp *get_next_kvp(struct kvp *k) { return (struct kvp *)((void *)k + sizeof(*k) + k->s); } static inline void *get_data(struct kvp *k) { return (void *)k + sizeof(*k); } static void delete_kvp(char *buf, struct kvp *d) { struct kvp *n; int dec; uint32_t size; n = get_next_kvp(d); dec = (void *)n - (void *)d; size = get_data_len(buf) - ((void *)n - (void *)get_first_kvp(buf)); memcpy((void *)d, (void *)n, size); change_data_len(buf, -dec); change_req_len(buf, -dec); } static inline void update_kvp_data(struct kvp *dest, struct kvp *src) { memcpy(get_data(dest), get_data(src), src->s); } static void add_kvp(char *buf, struct kvp *n) { int32_t inc = sizeof(*n) + n->s; if (get_req_len(buf) + inc > MAX_SLEEP_BUFFER) { WARN_ON(get_req_len(buf) + inc > MAX_SLEEP_BUFFER); return; } memcpy(buf + get_buf_len(buf), n, inc); change_data_len(buf, inc); change_req_len(buf, inc); } static struct slp_buf *tr_search(struct rb_root *root, char *slp) { unsigned int type = get_rsc_type(slp); unsigned int id = get_rsc_id(slp); struct rb_node *node = root->rb_node; while (node) { struct slp_buf *cur = rb_entry(node, struct slp_buf, node); unsigned int ctype = get_rsc_type(cur->buf); unsigned int cid = get_rsc_id(cur->buf); if (type < ctype) node = node->rb_left; else if (type > ctype) node = node->rb_right; else if (id < cid) node = node->rb_left; else if (id > cid) node = node->rb_right; else return cur; } return NULL; } static int tr_insert(struct rb_root *root, struct slp_buf *slp) { unsigned int type = get_rsc_type(slp->buf); unsigned int id = get_rsc_id(slp->buf); struct rb_node **node = &(root->rb_node), *parent = NULL; while (*node) { struct slp_buf *curr = rb_entry(*node, struct slp_buf, node); unsigned int ctype = get_rsc_type(curr->buf); unsigned int cid = get_rsc_id(curr->buf); parent = *node; if (type < ctype) node = &((*node)->rb_left); else if (type > ctype) node = &((*node)->rb_right); else if (id < cid) node = &((*node)->rb_left); else if (id > cid) node = &((*node)->rb_right); else return -EINVAL; } rb_link_node(&slp->node, parent, node); rb_insert_color(&slp->node, root); slp->valid = true; return 0; } #define for_each_kvp(buf, k) \ for (k = (struct kvp *)get_first_kvp(buf); \ ((void *)k - (void *)get_first_kvp(buf)) < \ get_data_len(buf);\ k = get_next_kvp(k)) static void tr_update(struct slp_buf *s, char *buf) { struct kvp *e, *n; for_each_kvp(buf, n) { bool found = false; for_each_kvp(s->buf, e) { if (n->k == e->k) { found = true; if (n->s == e->s) { void *e_data = get_data(e); void *n_data = get_data(n); if (memcmp(e_data, n_data, n->s)) { update_kvp_data(e, n); s->valid = true; } } else { delete_kvp(s->buf, e); add_kvp(s->buf, n); s->valid = true; } break; } } if (!found) { add_kvp(s->buf, n); s->valid = true; } } } static atomic_t msm_rpm_msg_id = ATOMIC_INIT(0); struct msm_rpm_request { uint8_t *client_buf; struct msm_rpm_kvp_data *kvp; uint32_t num_elements; uint32_t write_idx; uint8_t *buf; uint32_t numbytes; }; /* * Data related to message acknowledgment */ LIST_HEAD(msm_rpm_wait_list); struct msm_rpm_wait_data { struct list_head list; uint32_t msg_id; bool ack_recd; int errno; struct completion ack; bool delete_on_ack; }; DEFINE_SPINLOCK(msm_rpm_list_lock); LIST_HEAD(msm_rpm_ack_list); static struct tasklet_struct data_tasklet; static inline uint32_t msm_rpm_get_msg_id_from_ack(uint8_t *buf) { return get_ack_msg_id(buf); } static inline int msm_rpm_get_error_from_ack(uint8_t *buf) { uint8_t *tmp; uint32_t req_len = get_ack_req_len(buf); uint32_t msg_type = get_ack_msg_type(buf); int rc = -ENODEV; uint32_t err; uint32_t ack_msg_size = rpm_msg_fmt_ver ? sizeof(struct msm_rpm_ack_msg_v1) : sizeof(struct msm_rpm_ack_msg_v0); if (rpm_msg_fmt_ver == RPM_MSG_V0_FMT && msg_type == RPM_V1_ACK_SERVICE) { return 0; } else if (rpm_msg_fmt_ver && msg_type == RPM_V1_NACK_SERVICE) { err = *(uint32_t *)(buf + sizeof(struct msm_rpm_ack_msg_v1)); return err; } req_len -= ack_msg_size; req_len += 2 * sizeof(uint32_t); if (!req_len) return 0; pr_err("%s:rpm returned error or nack req_len: %d id_ack: %d\n", __func__, req_len, get_ack_msg_id(buf)); tmp = buf + ack_msg_size; if (memcmp(tmp, ERR, sizeof(uint32_t))) { pr_err("%s rpm returned error\n", __func__); WARN_ON(1); } tmp += 2 * sizeof(uint32_t); if (!(memcmp(tmp, INV_RSC, min_t(uint32_t, req_len, sizeof(INV_RSC))-1))) { pr_err("%s(): RPM NACK Unsupported resource\n", __func__); rc = -EINVAL; } else { pr_err("%s(): RPM NACK Invalid header\n", __func__); } return rc; } int msm_rpm_smd_buffer_request(struct msm_rpm_request *cdata, uint32_t size, gfp_t flag) { struct slp_buf *slp; static DEFINE_SPINLOCK(slp_buffer_lock); unsigned long flags; char *buf; buf = cdata->buf; if (size > MAX_SLEEP_BUFFER) return -ENOMEM; spin_lock_irqsave(&slp_buffer_lock, flags); slp = tr_search(&tr_root, buf); if (!slp) { slp = kzalloc(sizeof(struct slp_buf), GFP_ATOMIC); if (!slp) { spin_unlock_irqrestore(&slp_buffer_lock, flags); return -ENOMEM; } slp->buf = PTR_ALIGN(&slp->ubuf[0], sizeof(u32)); memcpy(slp->buf, buf, size); if (tr_insert(&tr_root, slp)) pr_err("Error updating sleep request\n"); } else { /* handle unsent requests */ tr_update(slp, buf); } trace_rpm_smd_sleep_set(get_msg_id(cdata->client_buf), get_rsc_type(cdata->client_buf), get_req_len(cdata->client_buf)); spin_unlock_irqrestore(&slp_buffer_lock, flags); return 0; } static struct msm_rpm_driver_data msm_rpm_data = { .smd_open = COMPLETION_INITIALIZER(msm_rpm_data.smd_open), }; static int msm_rpm_glink_rx_poll(void *glink_handle) { int ret; ret = glink_rpm_rx_poll(glink_handle); if (ret >= 0) /* * Sleep for 50us at a time before checking * for packet availability. The 50us is based * on the the time rpm could take to process * and send an ack for the sleep set request. */ udelay(50); else pr_err("Not receieve an ACK from RPM. ret = %d\n", ret); return ret; } /* * Returns * = 0 on successful reads * > 0 on successful reads with no further data * standard Linux error codes on failure. */ static int msm_rpm_read_sleep_ack(void) { int ret; char buf[MAX_ERR_BUFFER_SIZE] = {0}; uint32_t msg_id; if (glink_enabled) ret = msm_rpm_glink_rx_poll(glink_data->glink_handle); else { int timeout = 10; while (timeout) { if (smd_is_pkt_avail(msm_rpm_data.ch_info)) break; /* * Sleep for 50us at a time before checking * for packet availability. The 50us is based * on the the max time rpm could take to process * and send an ack for sleep set request. */ udelay(50); timeout--; } /* * On timeout return an error and exit the spinlock * control on this cpu. This will allow any other * core that has wokenup and trying to acquire the * spinlock from being locked out. */ if (!timeout) return -EAGAIN; ret = msm_rpm_read_smd_data(buf); if (!ret) { /* Mimic Glink behavior to ensure that the * data is read and the msg is removed from * the wait list. We should have gotten here * only when there are no drivers waiting on * ACKs. msm_rpm_get_entry_from_msg_id() * return non-NULL only then. */ msg_id = msm_rpm_get_msg_id_from_ack(buf); msm_rpm_process_ack(msg_id, 0); ret = smd_is_pkt_avail(msm_rpm_data.ch_info); } } return ret; } static void msm_rpm_flush_noack_messages(void) { while (!list_empty(&msm_rpm_wait_list)) { if (!msm_rpm_read_sleep_ack()) break; } } static int msm_rpm_flush_requests(bool print) { struct rb_node *t; int ret; int count = 0; msm_rpm_flush_noack_messages(); for (t = rb_first(&tr_root); t; t = rb_next(t)) { struct slp_buf *s = rb_entry(t, struct slp_buf, node); unsigned int type = get_rsc_type(s->buf); unsigned int id = get_rsc_id(s->buf); if (!s->valid) continue; set_msg_id(s->buf, msm_rpm_get_next_msg_id()); if (!glink_enabled) ret = msm_rpm_send_smd_buffer(s->buf, get_buf_len(s->buf), true); else ret = msm_rpm_glink_send_buffer(s->buf, get_buf_len(s->buf), true); WARN_ON(ret != get_buf_len(s->buf)); trace_rpm_smd_send_sleep_set(get_msg_id(s->buf), type, id); s->valid = false; count++; /* * RPM acks need to be handled here if we have sent 24 * messages such that we do not overrun SMD buffer. Since * we expect only sleep sets at this point (RPM PC would be * disallowed if we had pending active requests), we need not * process these sleep set acks. */ if (count >= MAX_WAIT_ON_ACK) { int ret = msm_rpm_read_sleep_ack(); if (ret >= 0) count--; else { pr_err("Timed out waiting for RPM ACK\n"); return ret; } } } return 0; } static void msm_rpm_notify_sleep_chain(char *buf, struct msm_rpm_kvp_data *kvp) { struct msm_rpm_notifier_data notif; notif.rsc_type = get_rsc_type(buf); notif.rsc_id = get_req_len(buf); notif.key = kvp->key; notif.size = kvp->nbytes; notif.value = kvp->value; atomic_notifier_call_chain(&msm_rpm_sleep_notifier, 0, &notif); } static int msm_rpm_add_kvp_data_common(struct msm_rpm_request *handle, uint32_t key, const uint8_t *data, int size, bool noirq) { uint32_t i; uint32_t data_size, msg_size; if (probe_status) return probe_status; if (!handle || !data) { pr_err("%s(): Invalid handle/data\n", __func__); return -EINVAL; } if (size < 0) return -EINVAL; data_size = ALIGN(size, SZ_4); msg_size = data_size + 8; for (i = 0; i < handle->write_idx; i++) { if (handle->kvp[i].key != key) continue; if (handle->kvp[i].nbytes != data_size) { kfree(handle->kvp[i].value); handle->kvp[i].value = NULL; } else { if (!memcmp(handle->kvp[i].value, data, data_size)) return 0; } break; } if (i >= handle->num_elements) { pr_err("Number of resources exceeds max allocated\n"); return -ENOMEM; } if (i == handle->write_idx) handle->write_idx++; if (!handle->kvp[i].value) { handle->kvp[i].value = kzalloc(data_size, GFP_FLAG(noirq)); if (!handle->kvp[i].value) return -ENOMEM; } else { /* We enter the else case, if a key already exists but the * data doesn't match. In which case, we should zero the data * out. */ memset(handle->kvp[i].value, 0, data_size); } if (!handle->kvp[i].valid) change_data_len(handle->client_buf, msg_size); else change_data_len(handle->client_buf, (data_size - handle->kvp[i].nbytes)); handle->kvp[i].nbytes = data_size; handle->kvp[i].key = key; memcpy(handle->kvp[i].value, data, size); handle->kvp[i].valid = true; return 0; } static struct msm_rpm_request *msm_rpm_create_request_common( enum msm_rpm_set set, uint32_t rsc_type, uint32_t rsc_id, int num_elements, bool noirq) { struct msm_rpm_request *cdata; uint32_t buf_size; if (probe_status) return ERR_PTR(probe_status); cdata = kzalloc(sizeof(struct msm_rpm_request), GFP_FLAG(noirq)); if (!cdata) { pr_err("Cannot allocate memory for client data\n"); goto cdata_alloc_fail; } if (rpm_msg_fmt_ver == RPM_MSG_V0_FMT) buf_size = sizeof(struct rpm_message_header_v0); else buf_size = sizeof(struct rpm_message_header_v1); cdata->client_buf = kzalloc(buf_size, GFP_FLAG(noirq)); if (!cdata->client_buf) goto client_buf_alloc_fail; set_set_type(cdata->client_buf, set); set_rsc_type(cdata->client_buf, rsc_type); set_rsc_id(cdata->client_buf, rsc_id); cdata->num_elements = num_elements; cdata->write_idx = 0; cdata->kvp = kcalloc(num_elements, sizeof(struct msm_rpm_kvp_data), GFP_FLAG(noirq)); if (!cdata->kvp) { pr_warn("%s(): Cannot allocate memory for key value data\n", __func__); goto kvp_alloc_fail; } cdata->buf = kzalloc(DEFAULT_BUFFER_SIZE, GFP_FLAG(noirq)); if (!cdata->buf) goto buf_alloc_fail; cdata->numbytes = DEFAULT_BUFFER_SIZE; return cdata; buf_alloc_fail: kfree(cdata->kvp); kvp_alloc_fail: kfree(cdata->client_buf); client_buf_alloc_fail: kfree(cdata); cdata_alloc_fail: return NULL; } void msm_rpm_free_request(struct msm_rpm_request *handle) { int i; if (!handle) return; for (i = 0; i < handle->num_elements; i++) kfree(handle->kvp[i].value); kfree(handle->kvp); kfree(handle->client_buf); kfree(handle->buf); kfree(handle); } EXPORT_SYMBOL(msm_rpm_free_request); struct msm_rpm_request *msm_rpm_create_request( enum msm_rpm_set set, uint32_t rsc_type, uint32_t rsc_id, int num_elements) { return msm_rpm_create_request_common(set, rsc_type, rsc_id, num_elements, false); } EXPORT_SYMBOL(msm_rpm_create_request); struct msm_rpm_request *msm_rpm_create_request_noirq( enum msm_rpm_set set, uint32_t rsc_type, uint32_t rsc_id, int num_elements) { return msm_rpm_create_request_common(set, rsc_type, rsc_id, num_elements, true); } EXPORT_SYMBOL(msm_rpm_create_request_noirq); int msm_rpm_add_kvp_data(struct msm_rpm_request *handle, uint32_t key, const uint8_t *data, int size) { return msm_rpm_add_kvp_data_common(handle, key, data, size, false); } EXPORT_SYMBOL(msm_rpm_add_kvp_data); int msm_rpm_add_kvp_data_noirq(struct msm_rpm_request *handle, uint32_t key, const uint8_t *data, int size) { return msm_rpm_add_kvp_data_common(handle, key, data, size, true); } EXPORT_SYMBOL(msm_rpm_add_kvp_data_noirq); /* Runs in interrupt context */ static void msm_rpm_notify(void *data, unsigned int event) { struct msm_rpm_driver_data *pdata = (struct msm_rpm_driver_data *)data; WARN_ON(!pdata); if (!(pdata->ch_info)) return; switch (event) { case SMD_EVENT_DATA: tasklet_schedule(&data_tasklet); trace_rpm_smd_interrupt_notify("interrupt notification"); break; case SMD_EVENT_OPEN: complete(&pdata->smd_open); break; case SMD_EVENT_CLOSE: case SMD_EVENT_STATUS: case SMD_EVENT_REOPEN_READY: break; default: pr_info("Unknown SMD event\n"); } } bool msm_rpm_waiting_for_ack(void) { bool ret = false; unsigned long flags; struct msm_rpm_wait_data *elem = NULL; spin_lock_irqsave(&msm_rpm_list_lock, flags); elem = list_first_entry_or_null(&msm_rpm_wait_list, struct msm_rpm_wait_data, list); if (elem) ret = !elem->delete_on_ack; spin_unlock_irqrestore(&msm_rpm_list_lock, flags); return ret; } static struct msm_rpm_wait_data *msm_rpm_get_entry_from_msg_id(uint32_t msg_id) { struct list_head *ptr; struct msm_rpm_wait_data *elem = NULL; unsigned long flags; spin_lock_irqsave(&msm_rpm_list_lock, flags); list_for_each(ptr, &msm_rpm_wait_list) { elem = list_entry(ptr, struct msm_rpm_wait_data, list); if (elem && (elem->msg_id == msg_id)) break; elem = NULL; } spin_unlock_irqrestore(&msm_rpm_list_lock, flags); return elem; } static uint32_t msm_rpm_get_next_msg_id(void) { uint32_t id; /* * A message id of 0 is used by the driver to indicate a error * condition. The RPM driver uses a id of 1 to indicate unsent data * when the data sent over hasn't been modified. This isn't a error * scenario and wait for ack returns a success when the message id is 1. */ do { id = atomic_inc_return(&msm_rpm_msg_id); } while ((id == 0) || (id == 1) || msm_rpm_get_entry_from_msg_id(id)); return id; } static int msm_rpm_add_wait_list(uint32_t msg_id, bool delete_on_ack) { unsigned long flags; struct msm_rpm_wait_data *data = kzalloc(sizeof(struct msm_rpm_wait_data), GFP_ATOMIC); if (!data) return -ENOMEM; init_completion(&data->ack); data->ack_recd = false; data->msg_id = msg_id; data->errno = INIT_ERROR; data->delete_on_ack = delete_on_ack; spin_lock_irqsave(&msm_rpm_list_lock, flags); if (delete_on_ack) list_add_tail(&data->list, &msm_rpm_wait_list); else list_add(&data->list, &msm_rpm_wait_list); spin_unlock_irqrestore(&msm_rpm_list_lock, flags); return 0; } static void msm_rpm_free_list_entry(struct msm_rpm_wait_data *elem) { unsigned long flags; spin_lock_irqsave(&msm_rpm_list_lock, flags); list_del(&elem->list); spin_unlock_irqrestore(&msm_rpm_list_lock, flags); kfree(elem); } static void msm_rpm_process_ack(uint32_t msg_id, int errno) { struct list_head *ptr, *next; struct msm_rpm_wait_data *elem = NULL; unsigned long flags; spin_lock_irqsave(&msm_rpm_list_lock, flags); list_for_each_safe(ptr, next, &msm_rpm_wait_list) { elem = list_entry(ptr, struct msm_rpm_wait_data, list); if (elem->msg_id == msg_id) { elem->errno = errno; elem->ack_recd = true; complete(&elem->ack); if (elem->delete_on_ack) { list_del(&elem->list); kfree(elem); } break; } } /* Special case where the sleep driver doesn't * wait for ACKs. This would decrease the latency involved with * entering RPM assisted power collapse. */ if (!elem) trace_rpm_smd_ack_recvd(0, msg_id, 0xDEADBEEF); spin_unlock_irqrestore(&msm_rpm_list_lock, flags); } struct msm_rpm_kvp_packet { uint32_t id; uint32_t len; uint32_t val; }; static int msm_rpm_read_smd_data(char *buf) { int pkt_sz; int bytes_read = 0; pkt_sz = smd_cur_packet_size(msm_rpm_data.ch_info); if (!pkt_sz) return -EAGAIN; if (pkt_sz > MAX_ERR_BUFFER_SIZE) { pr_err("rpm_smd pkt_sz is greater than max size\n"); goto error; } if (pkt_sz != smd_read_avail(msm_rpm_data.ch_info)) return -EAGAIN; do { int len; len = smd_read(msm_rpm_data.ch_info, buf + bytes_read, pkt_sz); pkt_sz -= len; bytes_read += len; } while (pkt_sz > 0); if (pkt_sz < 0) { pr_err("rpm_smd pkt_sz is less than zero\n"); goto error; } return 0; error: WARN_ON(1); return 0; } static void data_fn_tasklet(unsigned long data) { uint32_t msg_id; int errno; char buf[MAX_ERR_BUFFER_SIZE] = {0}; spin_lock(&msm_rpm_data.smd_lock_read); while (smd_is_pkt_avail(msm_rpm_data.ch_info)) { if (msm_rpm_read_smd_data(buf)) break; msg_id = msm_rpm_get_msg_id_from_ack(buf); errno = msm_rpm_get_error_from_ack(buf); trace_rpm_smd_ack_recvd(0, msg_id, errno); msm_rpm_process_ack(msg_id, errno); } spin_unlock(&msm_rpm_data.smd_lock_read); } static void msm_rpm_log_request(struct msm_rpm_request *cdata) { char buf[DEBUG_PRINT_BUFFER_SIZE]; size_t buflen = DEBUG_PRINT_BUFFER_SIZE; char name[5]; u32 value; uint32_t i; int j, prev_valid; int valid_count = 0; int pos = 0; uint32_t res_type, rsc_id; name[4] = 0; for (i = 0; i < cdata->write_idx; i++) if (cdata->kvp[i].valid) valid_count++; pos += scnprintf(buf + pos, buflen - pos, "%sRPM req: ", KERN_INFO); if (msm_rpm_debug_mask & MSM_RPM_LOG_REQUEST_SHOW_MSG_ID) pos += scnprintf(buf + pos, buflen - pos, "msg_id=%u, ", get_msg_id(cdata->client_buf)); pos += scnprintf(buf + pos, buflen - pos, "s=%s", (get_set_type(cdata->client_buf) == MSM_RPM_CTX_ACTIVE_SET ? "act" : "slp")); res_type = get_rsc_type(cdata->client_buf); rsc_id = get_rsc_id(cdata->client_buf); if ((msm_rpm_debug_mask & MSM_RPM_LOG_REQUEST_PRETTY) && (msm_rpm_debug_mask & MSM_RPM_LOG_REQUEST_RAW)) { /* Both pretty and raw formatting */ memcpy(name, &res_type, sizeof(uint32_t)); pos += scnprintf(buf + pos, buflen - pos, ", rsc_type=0x%08X (%s), rsc_id=%u; ", res_type, name, rsc_id); for (i = 0, prev_valid = 0; i < cdata->write_idx; i++) { if (!cdata->kvp[i].valid) continue; memcpy(name, &cdata->kvp[i].key, sizeof(uint32_t)); pos += scnprintf(buf + pos, buflen - pos, "[key=0x%08X (%s), value=%s", cdata->kvp[i].key, name, (cdata->kvp[i].nbytes ? "0x" : "null")); for (j = 0; j < cdata->kvp[i].nbytes; j++) pos += scnprintf(buf + pos, buflen - pos, "%02X ", cdata->kvp[i].value[j]); if (cdata->kvp[i].nbytes) pos += scnprintf(buf + pos, buflen - pos, "("); for (j = 0; j < cdata->kvp[i].nbytes; j += 4) { value = 0; memcpy(&value, &cdata->kvp[i].value[j], min_t(uint32_t, sizeof(uint32_t), cdata->kvp[i].nbytes - j)); pos += scnprintf(buf + pos, buflen - pos, "%u", value); if (j + 4 < cdata->kvp[i].nbytes) pos += scnprintf(buf + pos, buflen - pos, " "); } if (cdata->kvp[i].nbytes) pos += scnprintf(buf + pos, buflen - pos, ")"); pos += scnprintf(buf + pos, buflen - pos, "]"); if (prev_valid + 1 < valid_count) pos += scnprintf(buf + pos, buflen - pos, ", "); prev_valid++; } } else if (msm_rpm_debug_mask & MSM_RPM_LOG_REQUEST_PRETTY) { /* Pretty formatting only */ memcpy(name, &res_type, sizeof(uint32_t)); pos += scnprintf(buf + pos, buflen - pos, " %s %u; ", name, rsc_id); for (i = 0, prev_valid = 0; i < cdata->write_idx; i++) { if (!cdata->kvp[i].valid) continue; memcpy(name, &cdata->kvp[i].key, sizeof(uint32_t)); pos += scnprintf(buf + pos, buflen - pos, "%s=%s", name, (cdata->kvp[i].nbytes ? "" : "null")); for (j = 0; j < cdata->kvp[i].nbytes; j += 4) { value = 0; memcpy(&value, &cdata->kvp[i].value[j], min_t(uint32_t, sizeof(uint32_t), cdata->kvp[i].nbytes - j)); pos += scnprintf(buf + pos, buflen - pos, "%u", value); if (j + 4 < cdata->kvp[i].nbytes) pos += scnprintf(buf + pos, buflen - pos, " "); } if (prev_valid + 1 < valid_count) pos += scnprintf(buf + pos, buflen - pos, ", "); prev_valid++; } } else { /* Raw formatting only */ pos += scnprintf(buf + pos, buflen - pos, ", rsc_type=0x%08X, rsc_id=%u; ", res_type, rsc_id); for (i = 0, prev_valid = 0; i < cdata->write_idx; i++) { if (!cdata->kvp[i].valid) continue; pos += scnprintf(buf + pos, buflen - pos, "[key=0x%08X, value=%s", cdata->kvp[i].key, (cdata->kvp[i].nbytes ? "0x" : "null")); for (j = 0; j < cdata->kvp[i].nbytes; j++) { pos += scnprintf(buf + pos, buflen - pos, "%02X", cdata->kvp[i].value[j]); if (j + 1 < cdata->kvp[i].nbytes) pos += scnprintf(buf + pos, buflen - pos, " "); } pos += scnprintf(buf + pos, buflen - pos, "]"); if (prev_valid + 1 < valid_count) pos += scnprintf(buf + pos, buflen - pos, ", "); prev_valid++; } } pos += scnprintf(buf + pos, buflen - pos, "\n"); printk(buf); } static int msm_rpm_send_smd_buffer(char *buf, uint32_t size, bool noirq) { unsigned long flags; int ret; spin_lock_irqsave(&msm_rpm_data.smd_lock_write, flags); ret = smd_write_avail(msm_rpm_data.ch_info); while ((ret = smd_write_avail(msm_rpm_data.ch_info)) < size) { if (ret < 0) break; if (!noirq) { spin_unlock_irqrestore( &msm_rpm_data.smd_lock_write, flags); cpu_relax(); spin_lock_irqsave( &msm_rpm_data.smd_lock_write, flags); } else udelay(5); } if (ret < 0) { pr_err("SMD not initialized\n"); spin_unlock_irqrestore( &msm_rpm_data.smd_lock_write, flags); return ret; } ret = smd_write(msm_rpm_data.ch_info, buf, size); spin_unlock_irqrestore(&msm_rpm_data.smd_lock_write, flags); return ret; } static int msm_rpm_glink_send_buffer(char *buf, uint32_t size, bool noirq) { int ret; unsigned long flags; int timeout = 50; spin_lock_irqsave(&msm_rpm_data.smd_lock_write, flags); do { ret = glink_tx(glink_data->glink_handle, buf, buf, size, GLINK_TX_SINGLE_THREADED); if (ret == -EBUSY || ret == -ENOSPC) { if (!noirq) { spin_unlock_irqrestore( &msm_rpm_data.smd_lock_write, flags); cpu_relax(); spin_lock_irqsave( &msm_rpm_data.smd_lock_write, flags); } else { udelay(5); } timeout--; } else { ret = 0; } } while (ret && timeout); spin_unlock_irqrestore(&msm_rpm_data.smd_lock_write, flags); if (!timeout) return 0; else return size; } static int msm_rpm_send_data(struct msm_rpm_request *cdata, int msg_type, bool noirq, bool noack) { uint8_t *tmpbuff; int ret; uint32_t i; uint32_t msg_size; int msg_hdr_sz, req_hdr_sz; uint32_t data_len = get_data_len(cdata->client_buf); uint32_t set = get_set_type(cdata->client_buf); uint32_t msg_id; if (probe_status) return probe_status; if (!data_len) return 1; msg_hdr_sz = rpm_msg_fmt_ver ? sizeof(struct rpm_message_header_v1) : sizeof(struct rpm_message_header_v0); req_hdr_sz = RPM_HDR_SIZE; set_msg_type(cdata->client_buf, msg_type); set_req_len(cdata->client_buf, data_len + msg_hdr_sz - req_hdr_sz); msg_size = get_req_len(cdata->client_buf) + req_hdr_sz; /* populate data_len */ if (msg_size > cdata->numbytes) { kfree(cdata->buf); cdata->numbytes = msg_size; cdata->buf = kzalloc(msg_size, GFP_FLAG(noirq)); } if (!cdata->buf) { pr_err("Failed malloc\n"); return 0; } tmpbuff = cdata->buf; tmpbuff += msg_hdr_sz; for (i = 0; (i < cdata->write_idx); i++) { /* Sanity check */ WARN_ON((tmpbuff - cdata->buf) > cdata->numbytes); if (!cdata->kvp[i].valid) continue; memcpy(tmpbuff, &cdata->kvp[i].key, sizeof(uint32_t)); tmpbuff += sizeof(uint32_t); memcpy(tmpbuff, &cdata->kvp[i].nbytes, sizeof(uint32_t)); tmpbuff += sizeof(uint32_t); memcpy(tmpbuff, cdata->kvp[i].value, cdata->kvp[i].nbytes); tmpbuff += cdata->kvp[i].nbytes; if (set == MSM_RPM_CTX_SLEEP_SET) msm_rpm_notify_sleep_chain(cdata->client_buf, &cdata->kvp[i]); } memcpy(cdata->buf, cdata->client_buf, msg_hdr_sz); if ((set == MSM_RPM_CTX_SLEEP_SET) && !msm_rpm_smd_buffer_request(cdata, msg_size, GFP_FLAG(noirq))) return 1; msg_id = msm_rpm_get_next_msg_id(); /* Set the version bit for new protocol */ set_msg_ver(cdata->buf, rpm_msg_fmt_ver); set_msg_id(cdata->buf, msg_id); set_msg_id(cdata->client_buf, msg_id); if (msm_rpm_debug_mask & (MSM_RPM_LOG_REQUEST_PRETTY | MSM_RPM_LOG_REQUEST_RAW)) msm_rpm_log_request(cdata); if (standalone) { for (i = 0; (i < cdata->write_idx); i++) cdata->kvp[i].valid = false; set_data_len(cdata->client_buf, 0); ret = msg_id; return ret; } msm_rpm_add_wait_list(msg_id, noack); ret = msm_rpm_send_buffer(&cdata->buf[0], msg_size, noirq); if (ret == msg_size) { for (i = 0; (i < cdata->write_idx); i++) cdata->kvp[i].valid = false; set_data_len(cdata->client_buf, 0); ret = msg_id; trace_rpm_smd_send_active_set(msg_id, get_rsc_type(cdata->client_buf), get_rsc_id(cdata->client_buf)); } else if (ret < msg_size) { struct msm_rpm_wait_data *rc; ret = 0; pr_err("Failed to write data msg_size:%d ret:%d msg_id:%d\n", msg_size, ret, msg_id); rc = msm_rpm_get_entry_from_msg_id(msg_id); if (rc) msm_rpm_free_list_entry(rc); } return ret; } static int _msm_rpm_send_request(struct msm_rpm_request *handle, bool noack) { int ret; static DEFINE_MUTEX(send_mtx); mutex_lock(&send_mtx); ret = msm_rpm_send_data(handle, MSM_RPM_MSG_REQUEST_TYPE, false, noack); mutex_unlock(&send_mtx); return ret; } int msm_rpm_send_request(struct msm_rpm_request *handle) { return _msm_rpm_send_request(handle, false); } EXPORT_SYMBOL(msm_rpm_send_request); int msm_rpm_send_request_noirq(struct msm_rpm_request *handle) { return msm_rpm_send_data(handle, MSM_RPM_MSG_REQUEST_TYPE, true, false); } EXPORT_SYMBOL(msm_rpm_send_request_noirq); void *msm_rpm_send_request_noack(struct msm_rpm_request *handle) { int ret; ret = _msm_rpm_send_request(handle, true); return ret < 0 ? ERR_PTR(ret) : NULL; } EXPORT_SYMBOL(msm_rpm_send_request_noack); int msm_rpm_wait_for_ack(uint32_t msg_id) { struct msm_rpm_wait_data *elem; int rc = 0; if (!msg_id) { pr_err("Invalid msg id\n"); return -ENOMEM; } if (msg_id == 1) return rc; if (standalone) return rc; elem = msm_rpm_get_entry_from_msg_id(msg_id); if (!elem) return rc; wait_for_completion(&elem->ack); trace_rpm_smd_ack_recvd(0, msg_id, 0xDEADFEED); rc = elem->errno; msm_rpm_free_list_entry(elem); return rc; } EXPORT_SYMBOL(msm_rpm_wait_for_ack); static void msm_rpm_smd_read_data_noirq(uint32_t msg_id) { uint32_t id = 0; while (id != msg_id) { if (smd_is_pkt_avail(msm_rpm_data.ch_info)) { int errno; char buf[MAX_ERR_BUFFER_SIZE] = {}; msm_rpm_read_smd_data(buf); id = msm_rpm_get_msg_id_from_ack(buf); errno = msm_rpm_get_error_from_ack(buf); trace_rpm_smd_ack_recvd(1, msg_id, errno); msm_rpm_process_ack(id, errno); } } } static void msm_rpm_glink_read_data_noirq(struct msm_rpm_wait_data *elem) { int ret; /* Use rx_poll method to read the message from RPM */ while (elem->errno) { ret = glink_rpm_rx_poll(glink_data->glink_handle); if (ret >= 0) { /* * We might have receieve the notification. * Now we have to check whether the notification * received is what we are interested? * Wait for few usec to get the notification * before re-trying the poll again. */ udelay(50); } else { pr_err("rx poll return error = %d\n", ret); } } } int msm_rpm_wait_for_ack_noirq(uint32_t msg_id) { struct msm_rpm_wait_data *elem; unsigned long flags; int rc = 0; if (!msg_id) { pr_err("Invalid msg id\n"); return -ENOMEM; } if (msg_id == 1) return 0; if (standalone) return 0; spin_lock_irqsave(&msm_rpm_data.smd_lock_read, flags); elem = msm_rpm_get_entry_from_msg_id(msg_id); if (!elem) /* Should this be a bug * Is it ok for another thread to read the msg? */ goto wait_ack_cleanup; if (elem->errno != INIT_ERROR) { rc = elem->errno; msm_rpm_free_list_entry(elem); goto wait_ack_cleanup; } if (!glink_enabled) msm_rpm_smd_read_data_noirq(msg_id); else msm_rpm_glink_read_data_noirq(elem); rc = elem->errno; msm_rpm_free_list_entry(elem); wait_ack_cleanup: spin_unlock_irqrestore(&msm_rpm_data.smd_lock_read, flags); if (!glink_enabled) if (smd_is_pkt_avail(msm_rpm_data.ch_info)) tasklet_schedule(&data_tasklet); return rc; } EXPORT_SYMBOL(msm_rpm_wait_for_ack_noirq); void *msm_rpm_send_message_noack(enum msm_rpm_set set, uint32_t rsc_type, uint32_t rsc_id, struct msm_rpm_kvp *kvp, int nelems) { int i, rc; struct msm_rpm_request *req = msm_rpm_create_request_common(set, rsc_type, rsc_id, nelems, false); if (IS_ERR(req)) return req; if (!req) return ERR_PTR(ENOMEM); for (i = 0; i < nelems; i++) { rc = msm_rpm_add_kvp_data(req, kvp[i].key, kvp[i].data, kvp[i].length); if (rc) goto bail; } rc = PTR_ERR(msm_rpm_send_request_noack(req)); bail: msm_rpm_free_request(req); return rc < 0 ? ERR_PTR(rc) : NULL; } EXPORT_SYMBOL(msm_rpm_send_message_noack); int msm_rpm_send_message(enum msm_rpm_set set, uint32_t rsc_type, uint32_t rsc_id, struct msm_rpm_kvp *kvp, int nelems) { int i, rc; struct msm_rpm_request *req = msm_rpm_create_request(set, rsc_type, rsc_id, nelems); if (IS_ERR(req)) return PTR_ERR(req); if (!req) return -ENOMEM; for (i = 0; i < nelems; i++) { rc = msm_rpm_add_kvp_data(req, kvp[i].key, kvp[i].data, kvp[i].length); if (rc) goto bail; } rc = msm_rpm_wait_for_ack(msm_rpm_send_request(req)); bail: msm_rpm_free_request(req); return rc; } EXPORT_SYMBOL(msm_rpm_send_message); int msm_rpm_send_message_noirq(enum msm_rpm_set set, uint32_t rsc_type, uint32_t rsc_id, struct msm_rpm_kvp *kvp, int nelems) { int i, rc; struct msm_rpm_request *req = msm_rpm_create_request_noirq(set, rsc_type, rsc_id, nelems); if (IS_ERR(req)) return PTR_ERR(req); if (!req) return -ENOMEM; for (i = 0; i < nelems; i++) { rc = msm_rpm_add_kvp_data_noirq(req, kvp[i].key, kvp[i].data, kvp[i].length); if (rc) goto bail; } rc = msm_rpm_wait_for_ack_noirq(msm_rpm_send_request_noirq(req)); bail: msm_rpm_free_request(req); return rc; } EXPORT_SYMBOL(msm_rpm_send_message_noirq); /** * During power collapse, the rpm driver disables the SMD interrupts to make * sure that the interrupt doesn't wakes us from sleep. */ int msm_rpm_enter_sleep(bool print, const struct cpumask *cpumask) { int ret = 0; if (standalone) return 0; if (!glink_enabled) ret = smd_mask_receive_interrupt(msm_rpm_data.ch_info, true, cpumask); else ret = glink_rpm_mask_rx_interrupt(glink_data->glink_handle, true, (void *)cpumask); if (!ret) { ret = msm_rpm_flush_requests(print); if (ret) { if (!glink_enabled) smd_mask_receive_interrupt( msm_rpm_data.ch_info, false, NULL); else glink_rpm_mask_rx_interrupt( glink_data->glink_handle, false, NULL); } } return ret; } EXPORT_SYMBOL(msm_rpm_enter_sleep); /** * When the system resumes from power collapse, the SMD interrupt disabled by * enter function has to reenabled to continue processing SMD message. */ void msm_rpm_exit_sleep(void) { int ret; if (standalone) return; do { ret = msm_rpm_read_sleep_ack(); } while (ret > 0); if (!glink_enabled) smd_mask_receive_interrupt(msm_rpm_data.ch_info, false, NULL); else glink_rpm_mask_rx_interrupt(glink_data->glink_handle, false, NULL); } EXPORT_SYMBOL(msm_rpm_exit_sleep); /* * Whenever there is a data from RPM, notify_rx will be called. * This function is invoked either interrupt OR polling context. */ static void msm_rpm_trans_notify_rx(void *handle, const void *priv, const void *pkt_priv, const void *ptr, size_t size) { uint32_t msg_id; int errno; char buf[MAX_ERR_BUFFER_SIZE] = {0}; struct msm_rpm_wait_data *elem; static DEFINE_SPINLOCK(rx_notify_lock); unsigned long flags; if (!size) return; WARN_ON(size > MAX_ERR_BUFFER_SIZE); spin_lock_irqsave(&rx_notify_lock, flags); memcpy(buf, ptr, size); msg_id = msm_rpm_get_msg_id_from_ack(buf); errno = msm_rpm_get_error_from_ack(buf); elem = msm_rpm_get_entry_from_msg_id(msg_id); /* * It is applicable for sleep set requests * Sleep set requests are not added to the * wait queue list. Without this check we * run into NULL pointer deferrence issue. */ if (!elem) { spin_unlock_irqrestore(&rx_notify_lock, flags); glink_rx_done(handle, ptr, 0); return; } msm_rpm_process_ack(msg_id, errno); spin_unlock_irqrestore(&rx_notify_lock, flags); glink_rx_done(handle, ptr, 0); } static void msm_rpm_trans_notify_state(void *handle, const void *priv, unsigned int event) { switch (event) { case GLINK_CONNECTED: glink_data->glink_handle = handle; if (IS_ERR_OR_NULL(glink_data->glink_handle)) { pr_err("glink_handle %d\n", (int)PTR_ERR(glink_data->glink_handle)); WARN_ON(1); } /* * Do not allow clients to send data to RPM until glink * is fully open. */ probe_status = 0; pr_info("glink config params: transport=%s, edge=%s, name=%s\n", glink_data->xprt, glink_data->edge, glink_data->name); break; default: pr_err("Unrecognized event %d\n", event); break; }; } static void msm_rpm_trans_notify_tx_done(void *handle, const void *priv, const void *pkt_priv, const void *ptr) { } static void msm_rpm_glink_open_work(struct work_struct *work) { pr_debug("Opening glink channel\n"); glink_data->glink_handle = glink_open(glink_data->open_cfg); if (IS_ERR_OR_NULL(glink_data->glink_handle)) { pr_err("Error: glink_open failed %d\n", (int)PTR_ERR(glink_data->glink_handle)); WARN_ON(1); } } static void msm_rpm_glink_notifier_cb(struct glink_link_state_cb_info *cb_info, void *priv) { struct glink_open_config *open_config; static bool first = true; if (!cb_info) { pr_err("Missing callback data\n"); return; } switch (cb_info->link_state) { case GLINK_LINK_STATE_UP: if (first) first = false; else break; open_config = kzalloc(sizeof(*open_config), GFP_KERNEL); if (!open_config) { pr_err("Could not allocate memory\n"); break; } glink_data->open_cfg = open_config; pr_debug("glink link state up cb receieved\n"); INIT_WORK(&glink_data->work, msm_rpm_glink_open_work); open_config->priv = glink_data; open_config->name = glink_data->name; open_config->edge = glink_data->edge; open_config->notify_rx = msm_rpm_trans_notify_rx; open_config->notify_tx_done = msm_rpm_trans_notify_tx_done; open_config->notify_state = msm_rpm_trans_notify_state; schedule_work(&glink_data->work); break; default: pr_err("Unrecognised state = %d\n", cb_info->link_state); break; }; } static int msm_rpm_glink_dt_parse(struct platform_device *pdev, struct glink_apps_rpm_data *glink_data) { char *key = NULL; int ret; if (of_device_is_compatible(pdev->dev.of_node, "qcom,rpm-glink")) { glink_enabled = true; } else { pr_warn("qcom,rpm-glink compatible not matches\n"); ret = -EINVAL; return ret; } key = "qcom,glink-edge"; ret = of_property_read_string(pdev->dev.of_node, key, &glink_data->edge); if (ret) { pr_err("Failed to read node: %s, key=%s\n", pdev->dev.of_node->full_name, key); return ret; } key = "rpm-channel-name"; ret = of_property_read_string(pdev->dev.of_node, key, &glink_data->name); if (ret) pr_err("%s(): Failed to read node: %s, key=%s\n", __func__, pdev->dev.of_node->full_name, key); return ret; } static int msm_rpm_glink_link_setup(struct glink_apps_rpm_data *glink_data, struct platform_device *pdev) { struct glink_link_info *link_info; void *link_state_cb_handle; struct device *dev = &pdev->dev; int ret = 0; link_info = devm_kzalloc(dev, sizeof(struct glink_link_info), GFP_KERNEL); if (!link_info) { ret = -ENOMEM; return ret; } glink_data->link_info = link_info; /* * Setup link info parameters */ link_info->edge = glink_data->edge; link_info->glink_link_state_notif_cb = msm_rpm_glink_notifier_cb; link_state_cb_handle = glink_register_link_state_cb(link_info, NULL); if (IS_ERR_OR_NULL(link_state_cb_handle)) { pr_err("Could not register cb\n"); ret = PTR_ERR(link_state_cb_handle); return ret; } spin_lock_init(&msm_rpm_data.smd_lock_read); spin_lock_init(&msm_rpm_data.smd_lock_write); return ret; } static int msm_rpm_dev_glink_probe(struct platform_device *pdev) { int ret = -ENOMEM; struct device *dev = &pdev->dev; glink_data = devm_kzalloc(dev, sizeof(*glink_data), GFP_KERNEL); if (!glink_data) return ret; ret = msm_rpm_glink_dt_parse(pdev, glink_data); if (ret < 0) { devm_kfree(dev, glink_data); return ret; } ret = msm_rpm_glink_link_setup(glink_data, pdev); if (ret < 0) { /* * If the glink setup fails there is no * fall back mechanism to SMD. */ pr_err("GLINK setup fail ret = %d\n", ret); WARN_ON(1); } return ret; } static int msm_rpm_dev_probe(struct platform_device *pdev) { char *key = NULL; int ret = 0; void __iomem *reg_base; uint32_t version = V0_PROTOCOL_VERSION; /* set to default v0 format */ /* * Check for standalone support */ key = "rpm-standalone"; standalone = of_property_read_bool(pdev->dev.of_node, key); if (standalone) { probe_status = ret; goto skip_init; } reg_base = of_iomap(pdev->dev.of_node, 0); if (reg_base) { version = readq_relaxed(reg_base); iounmap(reg_base); } if (version == V1_PROTOCOL_VERSION) rpm_msg_fmt_ver = RPM_MSG_V1_FMT; pr_debug("RPM-SMD running version %d/n", rpm_msg_fmt_ver); ret = msm_rpm_dev_glink_probe(pdev); if (!ret) { pr_info("APSS-RPM communication over GLINK\n"); msm_rpm_send_buffer = msm_rpm_glink_send_buffer; of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev); return ret; } msm_rpm_send_buffer = msm_rpm_send_smd_buffer; key = "rpm-channel-name"; ret = of_property_read_string(pdev->dev.of_node, key, &msm_rpm_data.ch_name); if (ret) { pr_err("%s(): Failed to read node: %s, key=%s\n", __func__, pdev->dev.of_node->full_name, key); goto fail; } key = "rpm-channel-type"; ret = of_property_read_u32(pdev->dev.of_node, key, &msm_rpm_data.ch_type); if (ret) { pr_err("%s(): Failed to read node: %s, key=%s\n", __func__, pdev->dev.of_node->full_name, key); goto fail; } ret = smd_named_open_on_edge(msm_rpm_data.ch_name, msm_rpm_data.ch_type, &msm_rpm_data.ch_info, &msm_rpm_data, msm_rpm_notify); if (ret) { if (ret != -EPROBE_DEFER) { pr_err("%s: Cannot open RPM channel %s %d\n", __func__, msm_rpm_data.ch_name, msm_rpm_data.ch_type); } goto fail; } spin_lock_init(&msm_rpm_data.smd_lock_write); spin_lock_init(&msm_rpm_data.smd_lock_read); tasklet_init(&data_tasklet, data_fn_tasklet, 0); wait_for_completion(&msm_rpm_data.smd_open); smd_disable_read_intr(msm_rpm_data.ch_info); probe_status = ret; skip_init: of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev); if (standalone) pr_info("RPM running in standalone mode\n"); fail: return probe_status; } static const struct of_device_id msm_rpm_match_table[] = { {.compatible = "qcom,rpm-smd"}, {.compatible = "qcom,rpm-glink"}, {}, }; static struct platform_driver msm_rpm_device_driver = { .probe = msm_rpm_dev_probe, .driver = { .name = "rpm-smd", .owner = THIS_MODULE, .suppress_bind_attrs = true, .of_match_table = msm_rpm_match_table, }, }; int __init msm_rpm_driver_init(void) { static bool registered; if (registered) return 0; registered = true; return platform_driver_register(&msm_rpm_device_driver); } EXPORT_SYMBOL(msm_rpm_driver_init); arch_initcall(msm_rpm_driver_init);
23.80181
79
0.70906
6c57e7b16ac5140a7cde8601b964c6db8aff1bb0
435
h
C
ColorExpert/Classes/General/InputAccessoryView/TranslateInputAccessoryView.h
JC-Hu/ColorExpert
f6435fa5b90fc9798f5dca00c24c975c1742ff93
[ "MIT" ]
null
null
null
ColorExpert/Classes/General/InputAccessoryView/TranslateInputAccessoryView.h
JC-Hu/ColorExpert
f6435fa5b90fc9798f5dca00c24c975c1742ff93
[ "MIT" ]
1
2016-10-27T02:14:34.000Z
2016-10-28T03:50:21.000Z
ColorExpert/Classes/General/InputAccessoryView/TranslateInputAccessoryView.h
JC-Hu/ColorExpert
f6435fa5b90fc9798f5dca00c24c975c1742ff93
[ "MIT" ]
null
null
null
// // TranslateInputAccessoryView.h // DishDict // // Created by JC_Hu on 15/12/8. // Copyright © 2015年 Tubban. All rights reserved. // #import <UIKit/UIKit.h> typedef void(^InputBlock)(NSString *text); @interface TranslateInputAccessoryView : UIView @property (weak, nonatomic) IBOutlet UICollectionView *collectionView; @property (nonatomic, copy) InputBlock inputBlock; - (void)setInputBlock:(InputBlock)inputBlock; @end
19.772727
70
0.749425
cacd6b7be91366f3e4c9d65742b1d7081dacabe3
2,139
h
C
include/UIKit/UIDynamicItemBehavior.h
crossmob/WinObjC
7bec24671c4c18b81aaf85eff2887438f18a697c
[ "MIT" ]
6,717
2015-08-06T18:04:37.000Z
2019-05-04T12:38:51.000Z
include/UIKit/UIDynamicItemBehavior.h
Michael-Young48/WinObjC
7bec24671c4c18b81aaf85eff2887438f18a697c
[ "MIT" ]
2,711
2015-08-06T18:41:09.000Z
2019-04-29T12:14:23.000Z
include/UIKit/UIDynamicItemBehavior.h
Michael-Young48/WinObjC
7bec24671c4c18b81aaf85eff2887438f18a697c
[ "MIT" ]
1,021
2015-08-06T18:08:56.000Z
2019-04-14T06:50:57.000Z
//****************************************************************************** // // Copyright (c) 2016 Microsoft Corporation. All rights reserved. // // This code is licensed under the MIT License (MIT). // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // //****************************************************************************** #pragma once #import <UIKit/UIKitExport.h> #import <Foundation/NSObject.h> #import <CoreGraphics/CGGeometry.h> #import <UIKit/UIDynamicBehavior.h> @protocol UIDynamicItem; @class NSArray; UIKIT_EXPORT_CLASS @interface UIDynamicItemBehavior : UIDynamicBehavior - (void)addItem:(id<UIDynamicItem>)item STUB_METHOD; - (instancetype)initWithItems:(NSArray*)items STUB_METHOD; - (void)removeItem:(id<UIDynamicItem>)item STUB_METHOD; @property (readonly, copy, nonatomic) NSArray* items STUB_PROPERTY; - (void)addAngularVelocity:(CGFloat)velocity forItem:(id<UIDynamicItem>)item STUB_METHOD; - (void)addLinearVelocity:(CGPoint)velocity forItem:(id<UIDynamicItem>)item STUB_METHOD; @property (readwrite, nonatomic) BOOL allowsRotation STUB_PROPERTY; @property (readwrite, nonatomic) CGFloat angularResistance STUB_PROPERTY; - (CGFloat)angularVelocityForItem:(id<UIDynamicItem>)item STUB_METHOD; - (CGPoint)linearVelocityForItem:(id<UIDynamicItem>)item STUB_METHOD; @property (readwrite, nonatomic) CGFloat density STUB_PROPERTY; @property (readwrite, nonatomic) CGFloat elasticity STUB_PROPERTY; @property (readwrite, nonatomic) CGFloat friction STUB_PROPERTY; @property (readwrite, nonatomic) CGFloat resistance STUB_PROPERTY; @property (readwrite, nonatomic) CGFloat charge STUB_PROPERTY; @property (getter=isAnchored, nonatomic) BOOL anchored STUB_PROPERTY; @end
46.5
89
0.738195
6cdcf7458039fc57fb7aa1309e0348da10cb8695
1,093
c
C
softfloat/f32_to_ui64.c
mbhaskaran/proxykernel-nbld
47f9e06fc2c696dfb1054d730cde888f1ac75d07
[ "BSD-3-Clause" ]
159
2015-02-12T03:28:25.000Z
2022-02-24T22:40:35.000Z
softfloat/f32_to_ui64.c
mbhaskaran/proxykernel-nbld
47f9e06fc2c696dfb1054d730cde888f1ac75d07
[ "BSD-3-Clause" ]
21
2015-01-31T23:47:26.000Z
2020-12-21T12:41:08.000Z
softfloat/f32_to_ui64.c
mbhaskaran/proxykernel-nbld
47f9e06fc2c696dfb1054d730cde888f1ac75d07
[ "BSD-3-Clause" ]
40
2015-01-28T21:31:30.000Z
2022-01-25T12:50:23.000Z
#include <stdbool.h> #include <stdint.h> #include "platform.h" #include "primitives.h" #include "internals.h" #include "softfloat.h" uint_fast64_t f32_to_ui64( float32_t a, int_fast8_t roundingMode, bool exact ) { union ui32_f32 uA; uint_fast32_t uiA; bool sign; int_fast16_t exp; uint_fast32_t sig; int_fast16_t shiftCount; uint_fast64_t sig64, extra; struct uint64_extra sig64Extra; uA.f = a; uiA = uA.ui; sign = signF32UI( uiA ); exp = expF32UI( uiA ); sig = fracF32UI( uiA ); shiftCount = 0xBE - exp; if ( shiftCount < 0 ) { softfloat_raiseFlags( softfloat_flag_invalid ); return UINT64_C( 0xFFFFFFFFFFFFFFFF ); } if ( exp ) sig |= 0x00800000; sig64 = (uint_fast64_t) sig<<40; extra = 0; if ( shiftCount ) { sig64Extra = softfloat_shift64ExtraRightJam( sig64, 0, shiftCount ); sig64 = sig64Extra.v; extra = sig64Extra.extra; } return softfloat_roundPackToUI64( sign, sig64, extra, roundingMode, exact ); }
25.418605
79
0.621226
889ec88b1ef0f81e9b95f1f0a691396ff6f35772
3,524
h
C
src/nn_lvq.h
eddelbuettel/nnlib2Rcpp
c2a3716b9dcfe4c84b2331d3eac7f28f4efcc02e
[ "MIT" ]
10
2020-03-19T00:45:02.000Z
2021-10-31T09:39:53.000Z
src/nn_lvq.h
eddelbuettel/nnlib2Rcpp
c2a3716b9dcfe4c84b2331d3eac7f28f4efcc02e
[ "MIT" ]
5
2020-12-30T13:22:38.000Z
2021-05-05T10:05:49.000Z
src/nn_lvq.h
eddelbuettel/nnlib2Rcpp
c2a3716b9dcfe4c84b2331d3eac7f28f4efcc02e
[ "MIT" ]
3
2021-03-05T14:27:59.000Z
2021-05-23T08:36:35.000Z
// ---------------------------------------------------------- // (c)2019 Vasilis.N.Nikolaidis All rights reserved. // ----------------------------------------------------------- // nn_lvq.h Version 0.1 // ----------------------------------------------------------- // Definition - implementation of kohonen clustering nets // (lvq_nn) SOM and LVQ functionality. // SOM implementation is described as Unsupervised Learning LVQ // in P.K.Simpson's Artificial Neural Systems (1990)"; // m_neighborhood_size=1 => Single Winner Unsupervised. // m_neighborhood_size>1 => Multiple Winner Unsupervised. // LVQ:implementation is described as Supervised Learning LVQ // in P.K.Simpson's Artificial Neural Systems (1990)"; // ----------------------------------------------------------- // NOTE: this NN was implemented with a much earlier version of the library // and does not take full advantage of its current features and syntax. // I plan to rewrite this with newer (clearer) code if I get the time. // ----------------------------------------------------------- #ifndef NN_LVQ_H #define NN_LVQ_H #include <cmath> #include "nn.h" #define LVQ_MAXITERATION (10000) namespace nnlib2 { namespace lvq { /*-----------------------------------------------------------------------*/ /* Kohonen LVQ ANS (Supervised LVQ) */ /*-----------------------------------------------------------------------*/ class lvq_nn : public NN_PARENT_CLASS { protected: int m_output_neighborhood_size; public: lvq_nn(); ~lvq_nn(); bool setup(int input_dimension,int output_dimension, DATA ** initial_cluster_centers_matrix = NULL); // optional matrix initializes weights; must be sized output_dimension X input_dimension DATA encode_s(DATA PTR input, int input_dim, DATA PTR desired_output, int output_dim, int iteration); DATA encode_s(DATA PTR input, int input_dim, int desired_winner, int iteration); void from_stream ( std::istream REF s ); }; /*-----------------------------------------------------------------------*/ /* Kohonen Self-Organized Map (SOM) ANS (Unsupervised LVQ NN) */ /*-----------------------------------------------------------------------*/ class som_nn : public lvq_nn { public: som_nn(int neighborhood_size); DATA encode_u(DATA PTR input, int input_dim, int iteration); }; /*-----------------------------------------------------------------------*/ class lvq_input_layer : public pe_layer { public: void recall(); }; /*-----------------------------------------------------------------------*/ class lvq_output_layer : public pe_layer { private: int m_neighborhood_size; // must be 1 in Single Winner Unsupervised, 3,5,7... in Multiple Winner Unsupervised. public: void setup(string name, int size, int neighborhood); void recall(); }; /*-----------------------------------------------------------------------*/ class lvq_connection_set : public generic_connection_set { private: int m_iteration; public: lvq_connection_set(); void set_iteration_number(int iteration); void recall(); // virtual, defined in component void encode(); // virtual, defined in component void encode(int iteration); // a variation of above, imposes iteration }; /*-----------------------------------------------------------------------*/ } // namespace lvq } // namespace nnlib2 #else #error Header file included twice : NN_LVQ_H #endif // NN_LVQ_H
30.912281
195
0.522985
f09408c9109faf09a17feaf15915bbb84b4e8789
2,924
h
C
Tools/VisualStudioSDK/2013.RTM/VisualStudioIntegration/Common/Source/CPP/VSL/MockInterfaces/VSLMockIVsRegisterProjectTypes.h
sarvex/StyleCop
5fc066910d1c648b35d5b10484666c6a42249f29
[ "MS-PL" ]
null
null
null
Tools/VisualStudioSDK/2013.RTM/VisualStudioIntegration/Common/Source/CPP/VSL/MockInterfaces/VSLMockIVsRegisterProjectTypes.h
sarvex/StyleCop
5fc066910d1c648b35d5b10484666c6a42249f29
[ "MS-PL" ]
null
null
null
Tools/VisualStudioSDK/2013.RTM/VisualStudioIntegration/Common/Source/CPP/VSL/MockInterfaces/VSLMockIVsRegisterProjectTypes.h
sarvex/StyleCop
5fc066910d1c648b35d5b10484666c6a42249f29
[ "MS-PL" ]
null
null
null
/*************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. This code is licensed under the Visual Studio SDK license terms. THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. This code is a part of the Visual Studio Library. ***************************************************************************/ #ifndef IVSREGISTERPROJECTTYPES_H_10C49CA1_2F46_11D3_A504_00C04F5E0BA5 #define IVSREGISTERPROJECTTYPES_H_10C49CA1_2F46_11D3_A504_00C04F5E0BA5 #if _MSC_VER > 1000 #pragma once #endif #include "vsshell.h" #pragma warning(push) #pragma warning(disable : 4510) // default constructor could not be generated #pragma warning(disable : 4610) // can never be instantiated - user defined constructor required #pragma warning(disable : 4512) // assignment operator could not be generated #pragma warning(disable : 6011) // Dereferencing NULL pointer (a NULL derference is just another kind of failure for a unit test namespace VSL { class IVsRegisterProjectTypesNotImpl : public IVsRegisterProjectTypes { VSL_DECLARE_NONINSTANTIABLE_BASE_CLASS(IVsRegisterProjectTypesNotImpl) public: typedef IVsRegisterProjectTypes Interface; STDMETHOD(RegisterProjectType)( /*[in]*/ REFGUID /*rguidProjType*/, /*[in]*/ IVsProjectFactory* /*pVsPF*/, /*[out]*/ VSCOOKIE* /*pdwCookie*/)VSL_STDMETHOD_NOTIMPL STDMETHOD(UnregisterProjectType)( /*[in]*/ VSCOOKIE /*dwCookie*/)VSL_STDMETHOD_NOTIMPL }; class IVsRegisterProjectTypesMockImpl : public IVsRegisterProjectTypes, public MockBase { VSL_DECLARE_NONINSTANTIABLE_BASE_CLASS(IVsRegisterProjectTypesMockImpl) public: VSL_DEFINE_MOCK_CLASS_TYPDEFS(IVsRegisterProjectTypesMockImpl) typedef IVsRegisterProjectTypes Interface; struct RegisterProjectTypeValidValues { /*[in]*/ REFGUID rguidProjType; /*[in]*/ IVsProjectFactory* pVsPF; /*[out]*/ VSCOOKIE* pdwCookie; HRESULT retValue; }; STDMETHOD(RegisterProjectType)( /*[in]*/ REFGUID rguidProjType, /*[in]*/ IVsProjectFactory* pVsPF, /*[out]*/ VSCOOKIE* pdwCookie) { VSL_DEFINE_MOCK_METHOD(RegisterProjectType) VSL_CHECK_VALIDVALUE(rguidProjType); VSL_CHECK_VALIDVALUE_INTERFACEPOINTER(pVsPF); VSL_SET_VALIDVALUE(pdwCookie); VSL_RETURN_VALIDVALUES(); } struct UnregisterProjectTypeValidValues { /*[in]*/ VSCOOKIE dwCookie; HRESULT retValue; }; STDMETHOD(UnregisterProjectType)( /*[in]*/ VSCOOKIE dwCookie) { VSL_DEFINE_MOCK_METHOD(UnregisterProjectType) VSL_CHECK_VALIDVALUE(dwCookie); VSL_RETURN_VALIDVALUES(); } }; } // namespace VSL #pragma warning(pop) #endif // IVSREGISTERPROJECTTYPES_H_10C49CA1_2F46_11D3_A504_00C04F5E0BA5
26.825688
129
0.71922
5341b1203f0a87d0552c34e166355fdc768997e6
16,804
h
C
include/litehtml/api_node.h
smorey2/litehtml
9400244dba01f7239e40d3468b020f2c4a1acca2
[ "BSD-3-Clause" ]
null
null
null
include/litehtml/api_node.h
smorey2/litehtml
9400244dba01f7239e40d3468b020f2c4a1acca2
[ "BSD-3-Clause" ]
null
null
null
include/litehtml/api_node.h
smorey2/litehtml
9400244dba01f7239e40d3468b020f2c4a1acca2
[ "BSD-3-Clause" ]
null
null
null
#ifndef LH_API_NODE_H #define LH_API_NODE_H #include <string> namespace litehtml { class Document; class Attr; template<class TNode> class NodeList; class NamedNodeMap; class element; class html_tag; typedef std::map<litehtml::tstring, litehtml::tstring> string_map; typedef std::vector<std::shared_ptr<litehtml::element>> elements_vector; /// <summary> /// Node /// </summary> class Node { public: Node(); /// <summary> /// Adds a new child node, to an element, as the last child node /// </summary> /// <param name="node">The node.</param> /// <returns></returns> virtual Node* appendChild(Node* node) = 0; /// <summary> /// Returns a NamedNodeMap of an element's attributes /// </summary> /// <value> /// The attributes. /// </value> virtual NamedNodeMap attributes() = 0; /// <summary> /// Returns the absolute base URI of a node /// </summary> /// <value> /// The base URI. /// </value> virtual tstring baseURI() = 0; /// <summary> /// Returns a collection of an element's child nodes (including text and comment nodes) /// </summary> virtual NodeList<Node> childNodes() = 0; /// <summary> /// Clones an element /// </summary> /// <param name="deep">if set to <c>true</c> [deep].</param> /// <returns></returns> virtual Node* cloneNode(bool deep = false) = 0; /// <summary> /// Compares the document position of two elements /// </summary> /// <param name="node">The node.</param> /// <returns></returns> virtual int compareDocumentPosition(Node* node) = 0; /// <summary> /// Returns the first child node of an element /// </summary> /// <value> /// The first child. /// </value> virtual Node* firstChild() = 0; /// <summary> /// Returns true if the specified node has any attributes, otherwise false /// </summary> /// <returns> /// <c>true</c> if this instance has attributes; otherwise, <c>false</c>. /// </returns> virtual bool hasAttributes() = 0; /// <summary> /// Returns true if an element has any child nodes, otherwise false /// </summary> /// <returns> /// <c>true</c> if [has child nodes]; otherwise, <c>false</c>. /// </returns> virtual bool hasChildNodes() = 0; /// <summary> /// Returns true if a specified namespaceURI is the default, otherwise false /// </summary> /// <param name="namespaceURI">The namespace URI.</param> /// <returns> /// <c>true</c> if [is default namespace] [the specified namespace URI]; otherwise, <c>false</c>. /// </returns> virtual bool isDefaultNamespace(tstring namespaceURI) = 0; /// <summary> /// Checks if two elements are equal /// </summary> /// <param name="node">The node.</param> /// <returns> /// <c>true</c> if [is equal node] [the specified node]; otherwise, <c>false</c>. /// </returns> virtual bool isEqualNode(Node* node) = 0; /// <summary> /// Checks if two elements are the same node /// </summary> /// <param name="node">The node.</param> /// <returns> /// <c>true</c> if [is same node] [the specified node]; otherwise, <c>false</c>. /// </returns> virtual bool isSameNode(Node* node) = 0; /// <summary> /// Returns the last child node of an element /// </summary> /// <value> /// The last child. /// </value> virtual Node* lastChild() = 0; /// <summary> /// Returns the namespace URI associated with a given prefix /// </summary> /// <param name="prefix">The prefix.</param> /// <returns></returns> tstring lookupNamespaceURI(tstring prefix); //: Base /// <summary> /// Returns the prefix associated with a given namespace URI /// </summary> /// <param name="namespaceURI">The namespace URI.</param> /// <returns></returns> tstring lookupPrefix(tstring namespaceURI); //: Base /// <summary> /// Returns the next node at the same node tree level /// </summary> /// <value> /// The next sibling. /// </value> virtual Node* nextSibling() = 0; /// <summary> /// Returns the name of a node /// </summary> /// <value> /// The name of the node. /// </value> virtual tstring nodeName() = 0; /// <summary> /// Returns the node type of a node /// </summary> /// <value> /// The type of the node. /// </value> virtual int nodeType() = 0; /// <summary> /// Sets or returns the value of a node /// </summary> /// <value> /// The node value. /// </value> virtual tstring nodeValue() = 0; virtual void nodeValue(tstring value) = 0; /// <summary> /// Joins adjacent text nodes and removes empty text nodes in an element /// </summary> virtual void normalize() = 0; /// <summary> /// Returns the root element (document object) for an element /// </summary> /// <value> /// The owner document. /// </value> virtual Document* ownerDocument() = 0; /// <summary> /// Returns the parent node of an element /// </summary> /// <value> /// The parent node. /// </value> virtual Node* parentNode() = 0; /// <summary> /// Sets or returns the namespace prefix of a node /// </summary> /// <value> /// The prefix. /// </value> tstring prefix(); //: Base void prefix(tstring value); //: Base /// <summary> /// Returns the previous node at the same node tree level /// </summary> /// <value> /// The previous sibling. /// </value> virtual Node* previousSibling() = 0; /// <summary> /// Removes a child node from an element /// </summary> /// <param name="node">The node.</param> /// <returns></returns> virtual Node* removeChild(Node* node) = 0; /// <summary> /// Replaces a child node in an element /// </summary> /// <param name="newnode">The newnode.</param> /// <param name="oldnode">The oldnode.</param> /// <returns></returns> virtual Node* replaceChild(Node* newnode, Node* oldnode) = 0; /// <summary> /// Sets or returns the textual content of a node and its descendants /// </summary> /// <value> /// The content of the text. /// </value> virtual tstring textContent() = 0; virtual void textContent(tstring value) = 0; }; /// <summary> /// Attr /// https://www.w3schools.com/jsref/dom_obj_attributes.asp /// </summary> class Attr : public Node { string_map* _attrs; tstring _name; public: typedef std::shared_ptr<Attr> ptr; public: Attr(string_map* attrs, tstring name); /// <summary> /// Adds a new child node, to an element, as the last child node /// </summary> /// <param name="node">The node.</param> /// <returns></returns> virtual Node* appendChild(Node* node) override; //: Node /// <summary> /// Returns a NamedNodeMap of an element's attributes /// </summary> /// <value> /// The attributes. /// </value> virtual NamedNodeMap attributes() override; //: Node /// <summary> /// Returns the absolute base URI of a node /// </summary> /// <value> /// The base URI. /// </value> virtual tstring baseURI() override; //: Node /// <summary> /// Returns a collection of an element's child nodes (including text and comment nodes) /// </summary> virtual NodeList<Node> childNodes() override; //: Node /// <summary> /// Clones an element /// </summary> /// <param name="deep">if set to <c>true</c> [deep].</param> /// <returns></returns> virtual Node* cloneNode(bool deep) override; //: Node /// <summary> /// Compares the document position of two elements /// </summary> /// <param name="node">The node.</param> /// <returns></returns> virtual int compareDocumentPosition(Node* node) override; //: Node /// <summary> /// Returns the first child node of an element /// </summary> /// <value> /// The first child. /// </value> virtual Node* firstChild() override; //: Node /// <summary> /// Not Supported - Returns true if the specified node has any attributes, otherwise false /// </summary> /// <returns> /// <c>true</c> if this instance has attributes; otherwise, <c>false</c>. /// </returns> virtual bool hasAttributes() override; //: Node /// <summary> /// Returns true if an element has any child nodes, otherwise false /// </summary> /// <returns> /// <c>true</c> if [has child nodes]; otherwise, <c>false</c>. /// </returns> virtual bool hasChildNodes() override; //: Node /// <summary> /// Returns true if a specified namespaceURI is the default, otherwise false /// </summary> /// <param name="namespaceURI">The namespace URI.</param> /// <returns> /// <c>true</c> if [is default namespace] [the specified namespace URI]; otherwise, <c>false</c>. /// </returns> virtual bool isDefaultNamespace(tstring namespaceURI) override; //: Node /// <summary> /// Checks if two elements are equal /// </summary> /// <param name="node">The node.</param> /// <returns> /// <c>true</c> if [is equal node] [the specified node]; otherwise, <c>false</c>. /// </returns> virtual bool isEqualNode(Node* node) override; //: Node /// <summary> /// Checks if two elements are the same node /// </summary> /// <param name="node">The node.</param> /// <returns> /// <c>true</c> if [is same node] [the specified node]; otherwise, <c>false</c>. /// </returns> virtual bool isSameNode(Node* node) override; //: Node /// <summary> /// Returns the last child node of an element /// </summary> /// <value> /// The last child. /// </value> virtual Node* lastChild() override; //: Node ///// <summary> ///// Returns the namespace URI associated with a given prefix ///// </summary> ///// <param name="prefix">The prefix.</param> ///// <returns></returns> //virtual tstring lookupNamespaceURI(tstring prefix) override; //: Node ///// <summary> ///// Returns the prefix associated with a given namespace URI ///// </summary> ///// <param name="namespaceURI">The namespace URI.</param> ///// <returns></returns> //virtual tstring lookupPrefix(tstring namespaceURI) override; //: Node /// <summary> /// Returns the next node at the same node tree level /// </summary> /// <value> /// The next sibling. /// </value> virtual Node* nextSibling() override; //: Node /// <summary> /// Returns the name of a node /// </summary> /// <value> /// The name of the node. /// </value> virtual tstring nodeName() override; //: Node /// <summary> /// Returns the node type of a node /// </summary> /// <value> /// The type of the node. /// </value> virtual int nodeType() override; //: Node /// <summary> /// Sets or returns the value of a node /// </summary> /// <value> /// The node value. /// </value> virtual tstring nodeValue() override; //: Node virtual void nodeValue(tstring value) override; //: Node /// <summary> /// Joins adjacent text nodes and removes empty text nodes in an element /// </summary> virtual void normalize() override; //: Node /// <summary> /// Returns the root element (document object) for an element /// </summary> /// <value> /// The owner document. /// </value> virtual Document* ownerDocument() override; //: Node /// <summary> /// Returns the parent node of an element /// </summary> /// <value> /// The parent node. /// </value> virtual Node* parentNode() override; //: Node ///// <summary> ///// Sets or returns the namespace prefix of a node ///// </summary> ///// <value> ///// The prefix. ///// </value> //virtual tstring prefix() override; //: Node //virtual void prefix(tstring value) override; //: Node /// <summary> /// Returns the previous node at the same node tree level /// </summary> /// <value> /// The previous sibling. /// </value> virtual Node* previousSibling() override; //: Node /// <summary> /// Removes a child node from an element /// </summary> /// <param name="node">The node.</param> /// <returns></returns> virtual Node* removeChild(Node* node) override; //: Node /// <summary> /// Replaces a child node in an element /// </summary> /// <param name="newnode">The newnode.</param> /// <param name="oldnode">The oldnode.</param> /// <returns></returns> virtual Node* replaceChild(Node* newnode, Node* oldnode) override; //: Node /// <summary> /// Sets or returns the textual content of a node and its descendants /// </summary> /// <value> /// The content of the text. /// </value> virtual tstring textContent() override; //: Node virtual void textContent(tstring value) override; //: Node /// <summary> /// Returns the name of an attribute /// </summary> /// <value> /// The name. /// </value> tstring name(); /// <summary> /// Sets or returns the value of the attribute /// </summary> /// <value> /// The value. /// </value> tstring value(); void value(tstring value); /// <summary> /// Returns true if the attribute has been specified, otherwise it returns false /// </summary> /// <value> /// <c>true</c> if specified; otherwise, <c>false</c>. /// </value> bool specified(); }; /// <summary> /// NodeList /// </summary> template<class TNode> class NodeList { elements_vector list; public: NodeList(); NodeList(elements_vector& elements); ~NodeList(); TNode* operator[](int index); TNode* item(int index); int length(); }; /// <summary> /// NamedNodeMap /// </summary> class NamedNodeMap { string_map m_attrs; public: static NamedNodeMap Empty; NamedNodeMap(string_map& attrs); /// <summary> /// Returns a specified attribute node from a NamedNodeMap /// </summary> Attr::ptr getNamedItem(tstring nodename); /// <summary> /// Gets the <see cref="Node"/> with the specified index. /// </summary> /// <value> /// The <see cref="Node"/>. /// </value> /// <param name="index">The index.</param> /// <returns></returns> // Overloading [] operator to access elements in array style Attr::ptr operator[](int index); /// <summary> /// Returns the attribute node at a specified index in a NamedNodeMap /// </summary> /// <param name="index">The index.</param> /// <returns></returns> Attr::ptr item(int index); /// <summary> /// Returns the number of attribute nodes in a NamedNodeMap /// </summary> /// <value> /// The length. /// </value> int length(); /// <summary> /// Removes a specified attribute node /// </summary> /// <param name="nodename">The nodename.</param> /// <returns></returns> /// <exception cref="NotImplementedException"></exception> Attr::ptr removeNamedItem(tstring nodename); /// <summary> /// Sets the specified attribute node (by name) /// </summary> /// <param name="node">The node.</param> /// <returns></returns> /// <exception cref="NotImplementedException"></exception> Attr::ptr setNamedItem(Attr::ptr node); }; /// <summary> /// DOMTokenList /// </summary> class DOMTokenList { public: /// <summary> /// Returns the number of classes in the list. /// </summary> /// <value> /// The length. /// </value> int length(); /// <summary> /// Returns a collection of an element's child nodes (including text and comment nodes) /// </summary> /// <param name="classes">The classes.</param> void add(...); /// <summary> /// Returns a Boolean value, indicating whether an element has the specified class name. /// </summary> /// <param name="class">The class.</param> /// <returns> /// <c>true</c> if [contains] [the specified class]; otherwise, <c>false</c>. /// </returns> bool contains(tstring class_); /// <summary> /// Returns the class name with a specified index number from an element /// </summary> /// <param name="index">The index.</param> /// <returns></returns> tstring item(int index); /// <summary> /// Removes one or more class names from an element. /// </summary> /// <param name="classes">The classes.</param> void remove(...); /// <summary> /// Toggles between a class name for an element. /// </summary> /// <param name="class">The class.</param> /// <param name="value">if set to <c>true</c> [value].</param> void toggle(tstring class_, bool value); }; } #endif // LH_API_NODE_H
27.502455
102
0.590098
180df74a5d00c9362d9323c4372ce1119e51470d
1,405
h
C
pgadmin/include/hotdraw/utilities/hdGeometry.h
jinfroster/pgadmin3
8d573a7f13a8b4161225363f1972d75004589275
[ "PostgreSQL" ]
null
null
null
pgadmin/include/hotdraw/utilities/hdGeometry.h
jinfroster/pgadmin3
8d573a7f13a8b4161225363f1972d75004589275
[ "PostgreSQL" ]
null
null
null
pgadmin/include/hotdraw/utilities/hdGeometry.h
jinfroster/pgadmin3
8d573a7f13a8b4161225363f1972d75004589275
[ "PostgreSQL" ]
null
null
null
////////////////////////////////////////////////////////////////////////// // // pgAdmin III - PostgreSQL Tools // // Copyright (C) 2002 - 2014, The pgAdmin Development Team // This software is released under the PostgreSQL Licence // // hdGeometry.h - Utility Geometric Functions Shared between classes // ////////////////////////////////////////////////////////////////////////// #ifndef HDGEOMETRY_H #define HDGEOMETRY_H #include "hotdraw/main/hdObject.h" #include "hotdraw/utilities/hdPoint.h" #include "hotdraw/utilities/hdRect.h" #include "hotdraw/utilities/hdMultiPosRect.h" class hdGeometry : public hdObject { public: static bool lineContainsPoint(double x1, double y1, double x2, double y2, double px, double py); static int min(int a, int b); static int max(int a, int b); static int min(double a, double b); static int max(double a, double b); static double angleFromPoint(hdRect r, hdPoint point); static double angleFromPoint(int posIdx, hdMultiPosRect r, hdPoint point); static hdPoint edgePointFromAngle(hdRect r, double angle); static hdPoint edgePointFromAngle(int posIdx, hdMultiPosRect r, double angle); static double range(double min, double max, double num); static double lineSize (hdPoint p1, hdPoint p2); static bool intersection(hdPoint p1, hdPoint p2, hdPoint p3, hdPoint p4); static double ddabs(double value); static int ddabs(int value); private: }; #endif
34.268293
97
0.682562
1819cca5ad25c0c87db7094070ac8feb81d51b20
2,964
c
C
test/cellular.c
AntohiRobert/SDL_bgi-2.4.2
754fe311eea8295b70d693374077c91ba74967ee
[ "Zlib" ]
16
2019-02-12T01:24:38.000Z
2021-12-24T16:20:51.000Z
test/cellular.c
JulStrat/SDL_bgi
759d7c936e1ef99fb3e5d8eafeaa773d845077ed
[ "Zlib" ]
21
2018-10-19T18:07:36.000Z
2019-06-24T02:34:19.000Z
test/cellular.c
JulStrat/SDL_bgi
759d7c936e1ef99fb3e5d8eafeaa773d845077ed
[ "Zlib" ]
3
2019-07-03T06:22:43.000Z
2022-01-17T20:38:19.000Z
/* cellular.c -*- C -*- * * To compile: * gcc -o cellular cellular.c -lSDL_bgi -lSDL2 * * Simple cellular automata, as described at * http://mathworld.wolfram.com/ElementaryCellularAutomaton.html * * Run this program as: * * ./cellular [rule] * * where [rule] is a cellular automaton rule (1..255). * * By Guido Gonzato, May 2015. * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #include <stdio.h> #include <math.h> #include <time.h> #include <graphics.h> // ----- void run_rule (int rule) { int maxx, pixel; maxx = getmaxx (); // for an explanation about rules, please see // http://mathworld.wolfram.com/CellularAutomaton.html // loop: for every pixel, run the rule for (int y = 20; y < 20 + maxx / 2; y++) for (int x = 1; x < maxx - 1; x++) { pixel = 0; // check the neighbour pixels on the line above // and take note of the ones that are RED if (RED == getpixel (x - 1, y - 1)) pixel |= 4; // same as pixel += 4; if (RED == getpixel (x, y - 1)) pixel |= 2; if (RED == getpixel (x + 1, y - 1)) pixel |= 1; // for every possible state (3 bits: 0-7), if the // corresponding bit in the rule is 1, then // plot the pixel at (x, y) for (int i = 0; i < 8; i++) if ((rule << i) & 0x80) // the bit in the rule is set to 1 if (pixel == 7 - i) // 'pixel' matches the rule putpixel (x, y, RED); } // for x } // ----- int main (int argc, char *argv[]) { int rule, ev, stop = NOPE; char s[50]; // set window title and position setwinoptions ("Cellular Automata", 100, 100, -1); initwindow (1024, 1024 / 2 + 40); setbkcolor (WHITE); setcolor (RED); cleardevice (); if (2 == argc) rule = atoi (argv [1]); else { srand (time(NULL)); rule = random (255); } while (! stop) { sprintf (s, "Click to continue - Rule: %d", rule); outtextxy (0, 0, s); putpixel (getmaxx () / 2, 20, RED); // set initial pixel run_rule (rule); refresh (); // srand (time(NULL)); rule = random (255); ev = getevent(); if (KEY_ESC == ev || WM_RBUTTONDOWN == ev || QUIT == ev) stop = YEAH; cleardevice (); } closegraph (); return 0; } // ----- end of file cellular.c
24.495868
71
0.593117