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
92593953d17efa36e70a7a9f12ea0ab4772ba989
1,710
c
C
tests/test_basic.c
etc0de/teenycss
11b7613f4335b9e0a35fdbb4df61c5df7b742290
[ "CC0-1.0" ]
1
2022-01-17T02:36:53.000Z
2022-01-17T02:36:53.000Z
tests/test_basic.c
etc0de/teenycss
11b7613f4335b9e0a35fdbb4df61c5df7b742290
[ "CC0-1.0" ]
null
null
null
tests/test_basic.c
etc0de/teenycss
11b7613f4335b9e0a35fdbb4df61c5df7b742290
[ "CC0-1.0" ]
null
null
null
#define TEENYCSS_IMPLEMENTATION #include "teenycss.h" #include "testmain.h" START_TEST(basic) { teenycss_ruleset *ruleset = teenycss_Parse( "widget1, abc.widget2 {width:50px;}" ); ck_assert(ruleset != NULL); ck_assert(ruleset->rules_count == 2); char *s = teenycss_Dump(ruleset); ck_assert(s != NULL); teenycss_rule **rules = ruleset->rules; ck_assert(rules[0]->filters_count == 1); ck_assert(rules[0]->filters[0]->attribute_selectors_count == 1); ck_assert( rules[0]->filters[0]->attribute_selectors[0].filtertype == TEENYCSS_ATTRIBUTEFILTERTYPE_MATCHFULL ); ck_assert(strcmp( rules[0]->filters[0]->attribute_selectors[0].name, "tag" ) == 0); ck_assert(strcmp( rules[0]->filters[0]->attribute_selectors[0].value, "widget1" ) == 0); ck_assert(rules[1]->filters_count == 1); ck_assert(rules[1]->filters[0]->attribute_selectors_count == 2); ck_assert( rules[1]->filters[0]->attribute_selectors[0].filtertype == TEENYCSS_ATTRIBUTEFILTERTYPE_MATCHFULL ); ck_assert(strcmp( rules[1]->filters[0]->attribute_selectors[0].name, "tag" ) == 0); ck_assert(strcmp( rules[1]->filters[0]->attribute_selectors[0].value, "abc" ) == 0); ck_assert( rules[1]->filters[0]->attribute_selectors[1].filtertype == TEENYCSS_ATTRIBUTEFILTERTYPE_MATCHFULL ); ck_assert(strcmp( rules[1]->filters[0]->attribute_selectors[1].name, "class" ) == 0); ck_assert(strcmp( rules[1]->filters[0]->attribute_selectors[1].value, "widget2" ) == 0); } END_TEST TESTS_MAIN(basic)
27.142857
68
0.621637
28158ca19a5f483caacf702296dcc4cffe26d317
286
h
C
formation.h
yating1901/Collective-motion-control-algorithm-on-swarm-of-e-Pucks-using-elastic-model
6deb217da6c960ba04fdc8aa0df108df64f08ca1
[ "MIT" ]
null
null
null
formation.h
yating1901/Collective-motion-control-algorithm-on-swarm-of-e-Pucks-using-elastic-model
6deb217da6c960ba04fdc8aa0df108df64f08ca1
[ "MIT" ]
null
null
null
formation.h
yating1901/Collective-motion-control-algorithm-on-swarm-of-e-Pucks-using-elastic-model
6deb217da6c960ba04fdc8aa0df108df64f08ca1
[ "MIT" ]
null
null
null
#ifndef _FORMATION_H #define _FORMATION_H #define PI 3.14159265358979 #define car_num 8 #define Ka 2000 #define Kb 1000 #define Kc 2000 #define Komega 800 #define d0 0.3 typedef struct Vector { double x; double y; double theta; double val; }Vector; #endif
13
28
0.692308
1a96414ffc1f2aee9bedf14e77b6870110ef253a
9,780
h
C
netbsd/sys/dev/pci/if_dgereg.h
MarginC/kame
2ef74fe29e4cca9b4a87a1d5041191a9e2e8be30
[ "BSD-3-Clause" ]
91
2015-01-05T15:18:31.000Z
2022-03-11T16:43:28.000Z
netbsd/sys/dev/pci/if_dgereg.h
MarginC/kame
2ef74fe29e4cca9b4a87a1d5041191a9e2e8be30
[ "BSD-3-Clause" ]
1
2016-02-25T15:57:55.000Z
2016-02-25T16:01:02.000Z
netbsd/sys/dev/pci/if_dgereg.h
MarginC/kame
2ef74fe29e4cca9b4a87a1d5041191a9e2e8be30
[ "BSD-3-Clause" ]
21
2015-02-07T08:23:07.000Z
2021-12-14T06:01:49.000Z
/* $NetBSD: if_dgereg.h,v 1.1 2004/03/12 13:46:52 ragge Exp $ */ /* * Copyright (c) 2004, SUNET, Swedish University Computer Network. * All rights reserved. * * Written by Anders Magnusson for SUNET, Swedish University Computer Network. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed for the NetBSD Project by * SUNET, Swedish University Computer Network. * 4. The name of SUNET may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY SUNET ``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 WASABI SYSTEMS, INC * 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. */ /* PCI registers */ #define DGE_PCI_BAR 0x10 #define DGE_PCIX_CMD 0xe4 /* PCIX CMD bits */ #define PCIX_MMRBC_MSK 0x000c0000 #define PCIX_MMRBC_512 0x00000000 #define PCIX_MMRBC_1024 0x00040000 #define PCIX_MMRBC_2048 0x00080000 #define PCIX_MMRBC_4096 0x000c0000 /* General registers */ #define DGE_CTRL0 0x000 #define DGE_CTRL1 0x008 #define DGE_STATUS 0x010 #define DGE_EECD 0x018 #define DGE_MFS 0x020 /* Interrupt control registers */ #define DGE_ICR 0x080 #define DGE_ICS 0x088 #define DGE_IMS 0x090 #define DGE_IMC 0x098 /* Receiver control registers */ #define DGE_RCTL 0x0100 #define DGE_FCRTL 0x0108 #define DGE_FCRTH 0x0110 #define DGE_RDBAL 0x0118 #define DGE_RDBAH 0x011c #define DGE_RDLEN 0x0120 #define DGE_RDH 0x0128 #define DGE_RDT 0x0130 #define DGE_RDTR 0x0138 #define DGE_RXDCTL 0x0140 #define DGE_RAIDC 0x0148 #define DGE_RXCSUM 0x0158 #define DGE_RAL 0x0180 #define DGE_RAH 0x0184 #define DGE_MTA 0x0200 /* Transmit control registers */ #define DGE_TCTL 0x0600 #define DGE_TDBAL 0x0608 #define DGE_TDBAH 0x060c #define DGE_TDLEN 0x0610 #define DGE_TDH 0x0618 #define DGE_TDT 0x0620 #define DGE_TIDV 0x0628 #define DGE_TXDCTL 0x0630 #define DGE_TSPMT 0x0638 #define DGE_PAP 0x0640 /* PHY communications */ #define DGE_MDIO 0x0758 #define DGE_MDIRW 0x0760 /* Statistics */ #define DGE_TPRL 0x2000 #define DGE_TPRH 0x2004 /* * CTRL0 bit definitions. */ #define CTRL0_LRST 0x00000008 #define CTRL0_JFE 0x00000010 #define CTRL0_XLE 0x00000020 #define CTRL0_MDCS 0x00000040 #define CTRL0_CMDC 0x00000080 #define CTRL0_SDP0 0x00040000 #define CTRL0_SDP1 0x00080000 #define CTRL0_SDP2 0x00100000 #define CTRL0_SDP3 0x00200000 #define CTRL0_SDP0_DIR 0x00400000 #define CTRL0_SDP1_DIR 0x00800000 #define CTRL0_SDP2_DIR 0x01000000 #define CTRL0_SDP3_DIR 0x02000000 #define CTRL0_RST 0x04000000 #define CTRL0_RPE 0x08000000 #define CTRL0_TPE 0x10000000 #define CTRL0_VME 0x40000000 /* * CTRL1 bit definitions. */ #define CTRL1_EE_RST 0x00002000 /* * STATUS bit definitions. */ #define STATUS_LINKUP 0x00000002 #define STATUS_BUS64 0x00001000 #define STATUS_PCIX 0x00002000 #define STATUS_PCIX_MSK 0x0000C000 #define STATUS_PCIX_66 0x00000000 #define STATUS_PCIX_100 0x00004000 #define STATUS_PCIX_133 0x00008000 /* * Interrupt control registers bit definitions. */ #define ICR_TXDW 0x00000001 #define ICR_TXQE 0x00000002 #define ICR_LSC 0x00000004 #define ICR_RXSEQ 0x00000008 #define ICR_RXDMT0 0x00000010 #define ICR_RXO 0x00000040 #define ICR_RXT0 0x00000080 #define ICR_GPI0 0x00000800 #define ICR_GPI1 0x00001000 #define ICR_GPI2 0x00002000 #define ICR_GPI3 0x00004000 /* * RCTL bit definitions. */ #define RCTL_RXEN 0x00000002 #define RCTL_SBP 0x00000004 #define RCTL_UPE 0x00000008 #define RCTL_MPE 0x00000010 #define RCTL_RDMTS_12 0x00000000 #define RCTL_RDMTS_14 0x00000100 #define RCTL_RDMTS_18 0x00000200 #define RCTL_BAM 0x00008000 #define RCTL_BSIZE_2k 0x00000000 #define RCTL_BSIZE_4k 0x00010000 #define RCTL_BSIZE_8k 0x00020000 #define RCTL_BSIZE_16k 0x00030000 #define RCTL_VFE 0x00040000 #define RCTL_CFIEN 0x00080000 #define RCTL_CFI 0x00100000 #define RCTL_RPDA_MC 0x00400000 #define RCTL_CFF 0x00800000 #define RCTL_SECRC 0x04000000 #define RCTL_MO(x) ((x) << 12) #define FCRTL_XONE 0x80000000 /* * RXDCTL macros. */ #define RXDCTL_PTHRESH(x) (x) #define RXDCTL_HTHRESH(x) ((x) << 9) #define RXDCTL_WTHRESH(x) ((x) << 18) /* * RXCSUM bit definitions. */ #define RXCSUM_IPOFL 0x00000100 #define RXCSUM_TUOFL 0x00000200 /* * RAH/RAL macros. */ #define RAH_AV 0x80000000 #define RA_TABSIZE 16 /* # of direct-filtered addresses */ #define RA_ADDR(reg, idx) ((reg) + (idx) * 8) /* * MTA macros. */ #define MC_TABSIZE 128 /* Size of multicast array table */ /* * TCTL bit definitions. */ #define TCTL_TCE 0x00000001 #define TCTL_TXEN 0x00000002 #define TCTL_TPDE 0x00000004 /* * TXDCTL macros. */ #define TXDCTL_PTHRESH(x) (x) #define TXDCTL_HTHRESH(x) ((x) << 8) #define TXDCTL_WTHRESH(x) ((x) << 16) /* * MDIO communication bits. * This is for "New Protocol". */ #define MDIO_REG(x) ((x) & 0xffff) #define MDIO_DEV(x) ((x) << 16) #define MDIO_PHY(x) ((x) << 21) #define MDIO_ADDR 0 #define MDIO_WRITE (1 << 26) #define MDIO_READ (1 << 27) #define MDIO_OLD_P (1 << 28) #define MDIO_CMD (1 << 30) /* * EEPROM stuff. * The 10GbE card uses an ATMEL AT93C46 in 64x16 mode, * see http://www.atmel.com/dyn/resources/prod_documents/doc0172.pdf */ /* EEPROM bit masks in the EECD register */ #define EECD_SK 0x01 #define EECD_CS 0x02 #define EECD_DI 0x04 #define EECD_DO 0x08 #define EEPROM_SIZE 64 /* 64 word in length */ #define EEPROM_CKSUM 0xbaba #define EE_ADDR01 0 /* Offset in EEPROM for MAC address 0-1 */ #define EE_ADDR23 1 /* Offset in EEPROM for MAC address 2-3 */ #define EE_ADDR45 2 /* Offset in EEPROM for MAC address 4-5 */ /* * Transmit descriptor definitions. */ struct dge_tdes { uint32_t dt_baddrl; /* Lower 32 bits of buffer address */ uint32_t dt_baddrh; /* Upper 32 bits of buffer address */ uint32_t dt_ctl; /* Command/Type/Length */ uint8_t dt_status; /* Transmitted data status info */ uint8_t dt_popts; /* Packet options */ uint16_t dt_vlan; /* VLAN information */ } __attribute__((__packed__)); /* * Context transmit descriptor, "overlayed" on the above struct. */ struct dge_ctdes { #if 0 uint8_t dc_ipcss; /* IP checksum start */ uint8_t dc_ipcso; /* IP checksum offset */ uint16_t dc_ipcse; /* IP checksum ending */ uint8_t dc_tucss; /* TCP/UDP checksum start */ uint8_t dc_tucso; /* TCP/UDP checksum offset */ uint16_t dc_tucse; /* TCP/UDP checksum ending */ uint32_t dc_ctl; /* Command/Type/Length (as above) */ uint8_t dc_status; /* Status info (as above) */ uint8_t dc_hdrlen; /* Header length */ uint16_t dc_mss; /* Maximum segment size */ #else uint32_t dc_tcpip_ipcs; /* IP checksum context */ uint32_t dc_tcpip_tucs; /* TCP/UDP checksum context */ uint32_t dc_tcpip_cmdlen; uint32_t dc_tcpip_seg; /* TCP segmentation context */ #endif } __attribute__((__packed__)); #define TDESC_DTYP_CTD 0x00000000 #define TDESC_DTYP_DATA 0x00100000 #define TDESC_DCMD_IDE 0x80000000 #define TDESC_DCMD_VLE 0x40000000 #define TDESC_DCMD_RS 0x08000000 #define TDESC_DCMD_TSE 0x04000000 #define TDESC_DCMD_EOP 0x01000000 #define TDESC_TUCMD_IDE 0x80000000 #define TDESC_TUCMD_RS 0x08000000 #define TDESC_TUCMD_TSE 0x04000000 #define TDESC_TUCMD_IP 0x02000000 #define TDESC_TUCMD_TCP 0x01000000 #define DGE_TCPIP_IPCSS(x) (x) #define DGE_TCPIP_IPCSO(x) ((x) << 8) #define DGE_TCPIP_IPCSE(x) ((x) << 16) #define DGE_TCPIP_TUCSS(x) (x) #define DGE_TCPIP_TUCSO(x) ((x) << 8) #define DGE_TCPIP_TUCSE(x) ((x) << 16) #define TDESC_STA_DD 0x01 #define TDESC_POPTS_TXSM 0x02 #define TDESC_POPTS_IXSM 0x01 /* * Receive descriptor definitions. */ struct dge_rdes { uint32_t dr_baddrl; /* Lower 32 bits of buffer address */ uint32_t dr_baddrh; /* Upper 32 bits of buffer address */ uint16_t dr_len; /* Length of receive packet */ uint16_t dr_cksum; /* Packet checksum */ uint8_t dr_status; /* Received data status info */ uint8_t dr_errors; /* Receive errors */ uint16_t dr_special; /* VLAN (802.1q) information */ } __attribute__((__packed__)); #define RDESC_STS_PIF 0x80 /* Exact filter match */ #define RDESC_STS_IPCS 0x40 /* IP Checksum calculated */ #define RDESC_STS_TCPCS 0x20 /* TCP checksum calculated */ #define RDESC_STS_VP 0x08 /* Packet is 802.1q */ #define RDESC_STS_IXSM 0x04 /* Ignore checksum */ #define RDESC_STS_EOP 0x02 /* End of packet */ #define RDESC_STS_DD 0x01 /* Descriptor done */ #define RDESC_ERR_RXE 0x80 /* RX data error */ #define RDESC_ERR_IPE 0x40 /* IP checksum error */ #define RDESC_ERR_TCPE 0x20 /* TCP/UDP checksum error */ #define RDESC_ERR_P 0x08 /* Parity error */ #define RDESC_ERR_SE 0x02 /* Symbol error */ #define RDESC_ERR_CE 0x01 /* CRC/Alignment error */
29.457831
78
0.761452
1ae4570cfd3c048c81affc1fbe638bda26d3f4d7
21,941
h
C
private/shell/shell32/docfind.h
King0987654/windows2000
01f9c2e62c4289194e33244aade34b7d19e7c9b8
[ "MIT" ]
11
2017-09-02T11:27:08.000Z
2022-01-02T15:25:24.000Z
private/shell/shell32/docfind.h
King0987654/windows2000
01f9c2e62c4289194e33244aade34b7d19e7c9b8
[ "MIT" ]
null
null
null
private/shell/shell32/docfind.h
King0987654/windows2000
01f9c2e62c4289194e33244aade34b7d19e7c9b8
[ "MIT" ]
14
2019-01-16T01:01:23.000Z
2022-02-20T15:54:27.000Z
#ifndef _INC_DOCFIND #define _INC_DOCFIND // for the OLEDB query stuff #define OLEDBVER 0x0250 // enable ICommandTree interface #include <oledberr.h> #include <oledb.h> #include <cmdtree.h> #include <oledbdep.h> #include <query.h> #include <stgprop.h> #include <ntquery.h> #include <idhidden.h> // Forward references typedef struct _DOCFIND DOCFIND; typedef DOCFIND * LPDOCFIND; typedef struct _dfHeader DFHEADER; typedef struct _DFFolderListItem DFFolderListItem; // Define some options that are used between filter and search code #define DFOO_INCLUDESUBDIRS 0x0001 // Include sub directories. #define DFOO_REGULAR 0x0004 // #define DFOO_CASESEN 0x0008 // #define DFOO_USEOLEDB 0x0010 // Search path(s) support OLEDB query. #define DFOO_SAVERESULTS 0x0100 // Save results in save file #define DFOO_SHOWALLOBJECTS 0x1000 // Show all files #define DFOO_SHOWEXTENSIONS 0x2000 // Should we show extensions. // BUGBUG:: Keep from reworking old find code... #define DFOO_OLDFINDCODE 0x8000 // Are we using the old find code? // Some error happended on the get next file... #define GNF_ERROR -1 #define GNF_DONE 0 #define GNF_MATCH 1 #define GNF_NOMATCH 2 #define GNF_ASYNC 3 // Define a FACILITY That we can check errors for... #define FACILITY_SEARCHCOMMAND 99 // reg location where we store bad paths that ci should not have indexed #define CI_SPECIAL_FOLDERS TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Search\\SpecialFolders") //=========================================================================== // IDFEnum: Interface definition //=========================================================================== // Declare Shell Docfind Enumeration interface. #undef INTERFACE #define INTERFACE IDFEnum DECLARE_INTERFACE_(IDFEnum, IUnknown) //IDFENUM { // *** IUnknown methods *** STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE; STDMETHOD_(ULONG,AddRef) (THIS) PURE; STDMETHOD_(ULONG,Release) (THIS) PURE; // *** IDFEnum methods (sortof standerd iterator methos *** // Which are extended to handle async query case. STDMETHOD(Next)(THIS_ LPITEMIDLIST *ppidl, int *pcObjectSearched, int *pcFoldersSearched, BOOL *pfContinue, int *pState, HWND hwnd) PURE; STDMETHOD (Skip)(THIS_ int celt) PURE; STDMETHOD (Reset)(THIS) PURE; STDMETHOD (StopSearch)(THIS) PURE; STDMETHOD_(BOOL,FQueryIsAsync)(THIS) PURE; STDMETHOD (GetAsyncCount)(THIS_ DBCOUNTITEM *pdwTotalAsync, int *pnPercentComplete, BOOL *pfQueryDone) PURE; STDMETHOD (GetItemIDList)(THIS_ UINT iItem, LPITEMIDLIST *ppidl) PURE; STDMETHOD (GetExtendedDetailsOf)(THIS_ LPCITEMIDLIST pidl, UINT iCol, LPSHELLDETAILS pdi) PURE; STDMETHOD (GetExtendedDetailsULong)(THIS_ LPCITEMIDLIST pidl, UINT iCol, ULONG *pul) PURE; STDMETHOD (GetItemID)(THIS_ UINT iItem, DWORD *puWorkID) PURE; STDMETHOD (SortOnColumn)(THIS_ UINT iCol, BOOL fAscending) PURE; }; // We overloaded Async case when we are in mixed (some async some sync mode) #define DF_QUERYISMIXED ((BOOL)42) //=========================================================================== // IDocFindBrowser: Interface definition //=========================================================================== DECLARE_INTERFACE_(IDocFindBrowser, IUnknown) { // *** IUnknown methods *** STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; STDMETHOD_(ULONG,AddRef) (THIS) PURE; STDMETHOD_(ULONG,Release) (THIS) PURE; // *** IDocFindBrowser methods *** STDMETHOD(DeferProcessUpdateDir)() PURE; STDMETHOD(EndDeferProcessUpdateDir)() PURE; #if 0 // Not currently used // *** IDocFindBrowser methods *** STDMETHOD(DFBSave)(THIS) PURE; #endif }; //=========================================================================== // IDocFindFileFilter: Interface definition //=========================================================================== // Declare Shell Docfind Filter interface. typedef interface IDocFindFolder IDocFindFolder; #undef INTERFACE #define INTERFACE IDocFindFileFilter DECLARE_INTERFACE_(IDocFindFileFilter, IUnknown) { // *** IUnknown methods *** STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE; STDMETHOD_(ULONG,AddRef) (THIS) PURE; STDMETHOD_(ULONG,Release) (THIS) PURE; // *** IDocFindFileFilter methods *** STDMETHOD(GetIconsAndMenu)(THIS_ HWND hwndDlg, HICON *phiconSmall, HICON *phiconLarge, HMENU *phmenu) PURE; STDMETHOD(GetStatusMessageIndex)(THIS_ UINT uContext, UINT *puMsgIndex) PURE; STDMETHOD(GetFolderMergeMenuIndex)(THIS_ UINT *puBGMainMergeMenu, UINT *puBGPopupMergeMenu) PURE; STDMETHOD(FFilterChanged)(THIS) PURE; STDMETHOD(GenerateTitle)(THIS_ LPTSTR *ppszTile, BOOL fFileName) PURE; STDMETHOD(PrepareToEnumObjects)(THIS_ DWORD * pdwFlags) PURE; STDMETHOD(ClearSearchCriteria)(THIS) PURE; STDMETHOD(EnumObjects)(THIS_ IShellFolder *psf, LPITEMIDLIST pidlStart, DWORD grfFlags, int iColSort, LPTSTR pszProgressText, IRowsetWatchNotify *prwn, IDFEnum **ppdfenum) PURE; STDMETHOD(GetDetailsOf)(THIS_ HDPA hdpaPidf, LPCITEMIDLIST pidl, UINT *piColumn, LPSHELLDETAILS pdi) PURE; STDMETHOD(FDoesItemMatchFilter)(THIS_ LPTSTR pszFolder, WIN32_FIND_DATA *pfinddata, IShellFolder *psf, LPITEMIDLIST pidl) PURE; STDMETHOD(SaveCriteria)(THIS_ IStream * pstm, WORD fCharType) PURE; // BUGBUG:: Should convert to stream STDMETHOD(RestoreCriteria)(THIS_ IStream * pstm, int cCriteria, WORD fCharType) PURE; STDMETHOD(DeclareFSNotifyInterest)(THIS_ HWND hwndDlg, UINT uMsg) PURE; STDMETHOD(GetColSaveStream)(THIS_ WPARAM wParam, LPSTREAM *ppstm) PURE; STDMETHOD(GenerateQueryRestrictions)(THIS_ LPWSTR *ppwszQuery, DWORD *pdwGQRFlags) PURE; STDMETHOD(ReleaseQuery)(THIS) PURE; STDMETHOD(UpdateField)(THIS_ BSTR szField, VARIANT vValue) PURE; STDMETHOD(ResetFieldsToDefaults)(THIS) PURE; STDMETHOD(GetItemContextMenu)(THIS_ HWND hwndOwner, IDocFindFolder* pdfFolder, IContextMenu** ppcm) PURE; STDMETHOD(GetDefaultSearchGUID)(THIS_ IShellFolder2 *psf2, LPGUID lpGuid) PURE; STDMETHOD(EnumSearches)(THIS_ IShellFolder2 *psf2, LPENUMEXTRASEARCH *ppenum) PURE; STDMETHOD(GetSearchFolderClassId)(THIS_ LPGUID lpGuid) PURE; STDMETHOD(GetNextConstraint)(THIS_ VARIANT_BOOL fReset, BSTR *pName, VARIANT *pValue, VARIANT_BOOL *pfFound) PURE; STDMETHOD(GetQueryLanguageDialect)(THIS_ ULONG * pulDialect); STDMETHOD(GetWarningFlags)(THIS_ DWORD *pdwWarningFlags); }; // Define the flags that GenerateQueryRestrictions may return typedef enum { GQR_MAKES_USE_OF_CI = 0x0001, // some constraint makes resonable use of Content index GQR_REQUIRES_CI = 0x0002, // The query requires the CI to work GQR_BYBASS_CI = 0x0004, // The query should bybass CI. } GQR_FLAGS; // Docfind UI warning bits. #define DFW_DEFAULT 0x00000000 #define DFW_IGNORE_CISCOPEMISMATCH 0x00000001 // CI query requested search scopes beyond indexed scopes #define DFW_IGNORE_INDEXNOTCOMPLETE 0x00000002 // ci not done indexing // try to share code for converting fields between docfind2 and netfind.c typedef struct _cdffuf { LPCWSTR pwszField; VARTYPE vt; int cdffufe; } CDFFUF; int CDFFilter_UpdateFieldChangeType(BSTR szField, VARIANT vValue, const CDFFUF *pcdffuf, VARIANT *pvConvertedValue, LPTSTR *ppszValue); // need this in docfind2 and docfindx.cpp so put into header. enum { IDFCOL_NAME = 0, IDFCOL_PATH, IDFCOL_RANK, IDFCOL_SIZE, IDFCOL_TYPE, IDFCOL_MODIFIED, } ; #ifdef IF_ADD_MORE_COLS // #define IDFCOL_FIRST_QUERY IDFCOL_RANK // The columns after this point are only valid for querys... #endif #define ESFITEM_ICONOVERLAYSET 0x00000001 typedef struct _ESFItem { DWORD dwMask; DWORD dwState; // State of the item; int iIcon; // Allocate the pidl at end as variable length ITEMIDLIST idl; // the pidl } ESFItem; typedef struct _ESFSaveStateItem { DWORD dwState; // State of the item; DWORD dwItemID; // Only used for Async support... } ESFSaveStateItem; typedef ESFItem CDFItem; // TODO: kill this eventually // Currently the state above is LVIS_SELECTED and LVIS_FOCUSED (low two bits) // Add a bit to use in the processing of updatedir #define CDFITEM_STATE_MAYBEDELETE 0x80000000L #define CDFITEM_STATE_MASK (LVIS_SELECTED) // Which states we will hav LV have us track int DFSortIDToICol(int uCmd); // Helper function to get the width of a char, in the font in the given hwnd. UINT GetControlCharWidth(HWND hwnd); // Definition of the data items that we cache per directory. typedef struct _DFFolderListItem // DFFLI { IShellFolder * psf; // Cache of MRU items int cbPidl; // The length of the pidl... int iImage; // Image to show item with... BOOL fUpdateDir:1; // Was this node touched by an updatedir... BOOL fDeleteDir:1; // Was this directory removed from the list? // Allocate the pidl at end as variable length ITEMIDLIST idl; // the pidl } DFFolderListItem; typedef struct _HIDDENDOCFINDDATA // hdfd { WORD cb; IDLHID id; WORD iFolder; // index to the folder DPA WORD wFlags; // UINT uRow; // Which row in the CI; DWORD dwItemID; // Only used for Async support... ULONG ulRank; // The rank returned by CI... } HIDDENDOCFINDDATA; #define DFDF_NONE 0x0000 #define DFDF_EXTRADATA 0x0001 typedef UNALIGNED HIDDENDOCFINDDATA * PHIDDENDOCFINDDATA; typedef const UNALIGNED HIDDENDOCFINDDATA * PCHIDDENDOCFINDDATA; #define DF_IFOLDER(pidl) (((PCHIDDENDOCFINDDATA) ILFindHiddenID((pidl), IDLHID_DOCFINDDATA))->iFolder) STDAPI_(LPITEMIDLIST) DocFind_AppendDocFindData(LPITEMIDLIST pidl, int iFolder, WORD wFlags, UINT uRow, DWORD dwItemID, ULONG ulRank); STDAPI DocFind_CreateIDList(IShellFolder *psf, WIN32_FIND_DATA *pfd, int iFolder, WORD wFlags, UINT uRow, DWORD dwItemID, ULONG ulRank, LPITEMIDLIST *ppidl); #define DocFind_AppendIFolder(pidl, iFolder) DocFind_AppendDocFindData((pidl), (iFolder), DFDF_NONE, 0, 0, 0) typedef struct _dfpagelist { int id; // Id of template in resource file. DLGPROC pfn; // pointer to dialog proc } DFPAGELIST; typedef struct { TC_ITEMHEADER tci; HWND hwndPage; UINT state; } TC_DFITEMEXTRA; #define CB_DFITEMEXTRA (SIZEOF(TC_DFITEMEXTRA)-SIZEOF(TC_ITEMHEADER)) // FILEFILTER flags values /* ;Internal */ #define FFLT_INCLUDESUBDIRS 0x0001 // Include subdirectories in search /* ;Internal */ #define FFLT_SAVEPATH 0x0002 // Save path in FILEINFOs /* ;Internal */ // unused! #define FFLT_REGULAR 0x0004 // Use Regular expressions /* ;Internal */ #define FFLT_CASESEN 0x0008 // Do case sensitive search /* ;Internal */ #define FFLT_EXCSYSFILES 0x0010 // Should exclude system files /* ;Internal */ // unused! // // Define structure that will be saved out to disk. // #define DOCFIND_SIG (TEXT('D') | (TEXT('F') << 8)) typedef struct _dfHeaderWin95 { WORD wSig; // Signature WORD wVer; // Version DWORD dwFlags; // Flags that controls the sort WORD wSortOrder; // Current sort order WORD wcbItem; // Size of the fixed portion of each item. DWORD oCriteria; // Offset to criterias in list long cCriteria; // Count of Criteria DWORD oResults; // Starting location of results in file long cResults; // Count of items that have been saved to file UINT ViewMode; // The view mode of the file... } DFHEADER_WIN95; typedef struct _dfHeader { WORD wSig; // Signature WORD wVer; // Version DWORD dwFlags; // Flags that controls the sort WORD wSortOrder; // Current sort order WORD wcbItem; // Size of the fixed portion of each item. DWORD oCriteria; // Offset to criterias in list long cCriteria; // Count of Criteria DWORD oResults; // Starting location of results in file long cResults; // Count of items that have been saved to file UINT ViewMode; // The view mode of the file... DWORD oHistory; // IPersistHistory::Save offset } DFHEADER; // The check in Win95/NT4 would fail to read the DFHEADER structure if // the wVer field was > 3. This is lame since the DFHEADER struct is // backwards compiatible (that's why it uses offsets). So we either // go through the pain of revving the stream format in a backwards // compatible way (not impossible, just a pain in the brain), or simply // rev the version and add our new fields and call the Win95/NT4 problem // a bug and punt. I'm leaning towards "bug" as this is a rarely used feature. #define DF_CURFILEVER_WIN95 3 #define DF_CURFILEVER 4 // define the format of the column information. typedef struct _dfCriteria { WORD wNum; // Criteria number (cooresponds to dlg item id) WORD cbText; // size of text including null char (DavePl: code using this now assumes byte count) } DFCRITERIA; // Formats for saving find criteria. #define DFC_FMT_UNICODE 1 #define DFC_FMT_ANSI 2 // This is a subset of fileinfo structure typedef struct _dfItem { WORD flags; // FIF_ bits WORD timeLastWrite; WORD dateLastWrite; WORD dummy; // 16/32 bit compat. //the compiler adds this padding // remove and use if needed DWORD dwSize; // size of the file WORD cbPath; // size of the text (0 implies use previous files) WORD cbName; // Size of name including NULL. } DFITEM; EXTERN_C TCHAR const s_szDocPathMRU[]; EXTERN_C TCHAR const s_szDocSpecMRU[]; EXTERN_C TCHAR const s_szDocContainsMRU[]; EXTERN_C const UINT s_auMapDFColToFSCol[]; BOOL_PTR CALLBACK DocFind_DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); // Message handlers HANDLE DocFind_UpdateMRUItem(HANDLE hMRU, HWND hwndDlg, int iDlgItem, LPCTSTR szSection, LPTSTR pszInitString, LPCTSTR pszAddIfEmpty); EXTERN_C void DocFind_EnableMonitoringNewItems(HWND hwndDlg, BOOL fEnable); // functions in docfind2.c #ifdef __cplusplus extern "C" { #endif VOID DocFind_AddDefPages(DOCFIND *pdf); IDocFindFileFilter * CreateDefaultDocFindFilter(void); void DocFind_SizeControl(HWND hwndDlg, int id, int cx, BOOL fCombo); void DocFind_ReportItemValueError(HWND hwndDlg, int idCtl, int iMsg, LPTSTR pszValue); BOOL DocFind_SetupWildCardingOnFileSpec(LPTSTR pszSpecIn, LPTSTR * pszSpecOut); int Docfind_SaveCriteriaItem(IStream * pstm, WORD wNum, LPTSTR psz, WORD fCharType); WORD DocFind_GetTodaysDosDateMinusNDays(int nDays); VOID DocFind_DosDateToSystemtime(WORD wFatDate, LPSYSTEMTIME pst); // Define some psuedo property sheet messages... // Sent to pages to tell the page if it should allow the user to make // changes or not wParam is a BOOL (TRUE implies yes changes enabled) #define DFM_ENABLECHANGES (WM_USER+242) // Sent to the "Name & Location" prop page to tell it to save the "look in" // combo box value off when the dialog is being destroyed #define DFM_SAVELOOKIN (WM_USER+243) // functions in netfind.c IDocFindFileFilter * CreateDefaultComputerFindFilter(); STDAPI_(BOOL) NextIDL(IEnumIDList *penum, LPITEMIDLIST *ppidl); LPITEMIDLIST DocFind_ConvertPathToIDL(LPTSTR pszFullPath); int DocFind_LocCBFindPidl(HWND hwnd, LPITEMIDLIST pidl); int DocFind_LocCBAddItem(HWND hwnd, LPCITEMIDLIST pidlAbs, int iIndex, int iIndent, int iImage, LPTSTR lpszText); int DocFind_LocCBAddPidl(HWND hwnd, IShellFolder *psf, LPCITEMIDLIST pidlParent, LPCITEMIDLIST pidl, LPITEMIDLIST *ppidlAbs, BOOL fFullName, UINT iIndent); BOOL DocFind_LocCBMeasureItem(HWND hwnd, MEASUREITEMSTRUCT FAR* lpMeasureItem); BOOL DocFind_LocCBDrawItem(HWND hwnd, const DRAWITEMSTRUCT FAR* lpdi); // Helper function such that I can get my hand on the thread handle. HANDLE DocFind_GetSearchThreadHandle(HWND hwndDlg); // Helper functions to use automation to open folders and select items... HRESULT OpenContainingFolderAndGetShellFolderView(LPCITEMIDLIST pidlFolder, IShellFolderViewDual **ppsfv); HRESULT SelectPidlInSFV(IShellFolderViewDual *psfv, LPCITEMIDLIST pidl, DWORD dwOpts); // Helper function to get the IShellFolder for the folder. // Note: It is safe to pass NULL for pdff and pidl if a valid pdffli is passed in. IShellFolder *DocFind_GetObjectsIFolder(IDocFindFolder *pdff, DFFolderListItem *pdffli, LPCITEMIDLIST pidl); #ifdef __cplusplus } #endif // // Used to implement a stack of sets of subdirectory names... // typedef struct _DIRBUF { TCHAR FAR* ach; int ichPathEnd; UINT cb; UINT cbAlloc; UINT ichDirNext; LPTSTR psz; struct _DIRBUF FAR* pdbNext; } DIRBUF; //=========================================================================== // OLEDB search //=========================================================================== EXTERN_C HRESULT DocFind_CreateOleDBEnum( IDocFindFileFilter * pdfff, IShellFolder *psf, LPWSTR *apwszPaths, UINT *pcPaths, DWORD grfFlags, int iColSort, LPTSTR pszProgressText, IRowsetWatchNotify *prwn, IDFEnum **ppdfenum); STDAPI SHFlushClipboard(void); // In ole2def.c #undef INTERFACE #define INTERFACE IDocFindControllerNotify // This interface is used to let the callback class talk to the class that is actually controlling // the queries and the like. DECLARE_INTERFACE_(IDocFindControllerNotify, IUnknown) { // *** IUnknown methods *** STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; STDMETHOD_(ULONG,AddRef) (THIS) PURE; STDMETHOD_(ULONG,Release) (THIS) PURE; // *** IDocFindControllerNotify methods *** STDMETHOD(DoSortOnColumn)(THIS_ UINT iCol, BOOL fSameCol) PURE; STDMETHOD(SaveSearch)(THIS) PURE; STDMETHOD(RestoreSearch)(THIS) PURE; STDMETHOD(StopSearch)(THIS) PURE; STDMETHOD(GetItemCount)(THIS_ UINT *pcItems) PURE; STDMETHOD(SetItemCount)(THIS_ UINT cItems) PURE; STDMETHOD(ViewDestroyed)(THIS) PURE; }; #undef INTERFACE #define INTERFACE IDocFindFolder DECLARE_INTERFACE_(IDocFindFolder, IUnknown) { // *** IUnknown methods *** STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE; STDMETHOD_(ULONG,AddRef) (THIS) PURE; STDMETHOD_(ULONG,Release) (THIS) PURE; // *** IDocFindFolder methods *** STDMETHOD(SetDocFindFilter)(THIS_ IDocFindFileFilter *pdfff) PURE; STDMETHOD(GetDocFindFilter)(THIS_ IDocFindFileFilter **pdfff) PURE; STDMETHOD(AddPidl)(THIS_ int i, LPITEMIDLIST pidl, DWORD dwItemID, ESFItem **ppItem) PURE; STDMETHOD(GetItem)(THIS_ int iItem, ESFItem **ppItem) PURE; STDMETHOD(DeleteItem)(THIS_ int iItem) PURE; STDMETHOD(GetItemCount)(THIS_ INT *pcItems) PURE; STDMETHOD(ValidateItems)(THIS_ int iItemFirst, int cItems, BOOL bSearchComplete) PURE; STDMETHOD(GetFolderListItemCount)(THIS_ INT *pcCount) PURE; STDMETHOD(GetFolderListItem)(THIS_ int iItem, DFFolderListItem **ppItem) PURE; STDMETHOD(SetItemsChangedSinceSort)(THIS) PURE; STDMETHOD(ClearItemList)(THIS) PURE; STDMETHOD(ClearFolderList)(THIS) PURE; STDMETHOD(AddFolderToFolderList)(THIS_ LPITEMIDLIST pidl, BOOL fCheckForDup, int * piFolder) PURE; STDMETHOD(SetAsyncEnum)(THIS_ IDFEnum *pdfEnumAsync) PURE; STDMETHOD(GetAsyncEnum)(THIS_ IDFEnum **ppdfEnumAsync) PURE; STDMETHOD(SetAsyncCount)(THIS_ DBCOUNTITEM cCount) PURE; STDMETHOD(CacheAllAsyncItems)(THIS) PURE; STDMETHOD_(BOOL,AllAsyncItemsCached)(THIS) PURE; STDMETHOD(ClearSaveStateList)(THIS) PURE; STDMETHOD(GetStateFromSaveStateList)(THIS_ DWORD dwItemID, DWORD *pdwState) PURE; STDMETHOD(MapFSPidlToDFPidl)(LPITEMIDLIST pidl, BOOL fMapToReal, LPITEMIDLIST *ppidl) PURE; STDMETHOD(GetParentsPIDL)(LPCITEMIDLIST pidl, LPITEMIDLIST *ppidlParent) PURE; STDMETHOD(RememberSelectedItems)(THIS) PURE; STDMETHOD(SetControllerNotifyObject)(IDocFindControllerNotify *pdfcn) PURE; STDMETHOD(GetControllerNotifyObject)(IDocFindControllerNotify **ppdfcn) PURE; STDMETHOD(SaveFolderList)(THIS_ IStream *pstm) PURE; STDMETHOD(RestoreFolderList)(THIS_ IStream *pstm) PURE; STDMETHOD(SaveItemList)(THIS_ IStream *pstm) PURE; STDMETHOD(RestoreItemList)(THIS_ IStream *pstm, int *pcItems) PURE; STDMETHOD(RestoreSearchFromSaveFile)(LPITEMIDLIST pidlSaveFile, IShellFolderView *psfv) PURE; STDMETHOD(SetEmptyText)(THIS_ LPCTSTR pszText) PURE; STDMETHOD_(BOOL,IsSlow)(THIS) PURE; }; #ifdef __cplusplus extern "C" { #endif IContextMenu* CDFFolderContextMenuItem_Create(HWND hwndOwner, IDocFindFolder *pdfFolder); #ifdef __cplusplus } #endif #endif // !_INC_DOCFIND
39.820327
158
0.680461
ffcd15831c67b9565b39aea010868e1c0371da08
239
c
C
week 2/exercise 1.c
psychonnam/carltonCSC205
e3c3f71b1ed3c6e72cf575ebb2fa94769e1f9bff
[ "MIT" ]
null
null
null
week 2/exercise 1.c
psychonnam/carltonCSC205
e3c3f71b1ed3c6e72cf575ebb2fa94769e1f9bff
[ "MIT" ]
null
null
null
week 2/exercise 1.c
psychonnam/carltonCSC205
e3c3f71b1ed3c6e72cf575ebb2fa94769e1f9bff
[ "MIT" ]
null
null
null
#include <stdio.h> int main() { // Display the string inside quotation printf("C programming is a power genral-purpose langue. \n"); printf("It is an execellent language to learn to program.\n"); return 0; }
19.916667
66
0.631799
062bad35fb06221d201f12e61c508bd1df089cb4
2,491
c
C
src/drivers/sensors/adxl345/adxl345.c
nikitavlaev/embox
7ab7a5b649d8a408ecbdaafee8318b1c3dc9cf62
[ "BSD-2-Clause" ]
809
2015-04-12T00:57:55.000Z
2022-03-18T13:39:59.000Z
src/drivers/sensors/adxl345/adxl345.c
nikitavlaev/embox
7ab7a5b649d8a408ecbdaafee8318b1c3dc9cf62
[ "BSD-2-Clause" ]
819
2015-04-14T17:54:29.000Z
2022-03-26T08:52:12.000Z
src/drivers/sensors/adxl345/adxl345.c
nikitavlaev/embox
7ab7a5b649d8a408ecbdaafee8318b1c3dc9cf62
[ "BSD-2-Clause" ]
274
2015-04-15T16:11:52.000Z
2022-03-25T10:24:43.000Z
/** * @file adxl345.c * @brief G-Sensor * @author Denis Deryugin <deryugin.denis@gmail.com> * @version * @date 17.12.2019 */ #include <stdint.h> #include <drivers/i2c/i2c.h> #include <drivers/sensors/adxl345.h> #include <framework/mod/options.h> #include <util/log.h> #define ADXL345_DEVID 0x00 #define ADXL345_OFSX 0x1E #define ADXL345_OFSY 0x1F #define ADXL345_OFSZ 0x20 #define ADXL345_OFS_AXIS(index) (ADXL345_REG_OFSX + (index)) #define ADXL345_BW_RATE 0x2C #define ADXL345_POWER_CTL 0x2D # define ADXL345_POWER_CTL_MSR (1 << 3) #define ADXL345_DATA_FORMAT 0x31 #define ADXL345_DATAX0 0x32 #define ADXL345_DATAY0 0x34 #define ADXL345_DATAZ0 0x36 #define ADXL345_DATA_AXIS(n) (ADXL345_DATAX0 + (n)) #define ADXL345_DEVID_VALUE 0xE5 #define ADXL345_BUS OPTION_GET(NUMBER, bus) #define ADXL345_ADDR OPTION_GET(NUMBER, addr) struct adxl345_dev { int i2c_bus; int i2c_addr; }; /* Note: ADXL345 supports i2c and spi read/write ops, * but for now we use only i2c bus */ static uint8_t adxl345_readb(struct adxl345_dev *dev, int offset) { uint8_t ret = offset; i2c_bus_write(dev->i2c_bus, dev->i2c_addr, &ret, sizeof(ret)); i2c_bus_read(dev->i2c_bus, dev->i2c_addr, &ret, sizeof(ret)); return ret; } static void adxl345_writeb(struct adxl345_dev *dev, int offset, uint8_t val) { uint16_t tmp = (offset & 0xFF) | (val << 8); i2c_bus_write(dev->i2c_bus, dev->i2c_addr, (void *) &tmp, sizeof(tmp)); } static struct adxl345_dev adxl345_dev = { .i2c_bus = ADXL345_BUS, .i2c_addr = ADXL345_ADDR }; int16_t adxl345_get_x(void) { struct adxl345_dev *dev = &adxl345_dev; return (int16_t) (adxl345_readb(dev, ADXL345_DATA_AXIS(0)) + (adxl345_readb(dev, ADXL345_DATA_AXIS(1)) << 8)); } int16_t adxl345_get_y(void) { struct adxl345_dev *dev = &adxl345_dev; return (int16_t) (adxl345_readb(dev, ADXL345_DATA_AXIS(2)) + (adxl345_readb(dev, ADXL345_DATA_AXIS(3)) << 8)); } int16_t adxl345_get_z(void) { struct adxl345_dev *dev = &adxl345_dev; return (int16_t) (adxl345_readb(dev, ADXL345_DATA_AXIS(4)) + (adxl345_readb(dev, ADXL345_DATA_AXIS(5)) << 8)); } int adxl345_init(void) { uint8_t tmp; struct adxl345_dev *dev = &adxl345_dev; tmp = adxl345_readb(dev, ADXL345_DEVID); if (tmp != ADXL345_DEVID_VALUE) { log_error("ADXL345 Device ID mismatch! %2x", tmp); return -1; } adxl345_writeb(dev, ADXL345_POWER_CTL, ADXL345_POWER_CTL_MSR); return 0; }
27.076087
78
0.708952
9e47547e0ce0e9ea5d107711c01ff87373f2b838
6,561
h
C
drivers/hal/mm32/sdk/MM32SPIN0XX_HAL/MM32SPIN0x/HAL_lib/inc/HAL_uart.h
yorange1/OneOS-Lite
4f713c7fdcd1e47547773351337b2309f61b34bd
[ "Apache-2.0" ]
2
2018-11-09T13:34:24.000Z
2020-11-18T21:17:17.000Z
drivers/hal/mm32/sdk/MM32SPIN0XX_HAL/MM32SPIN0x/HAL_lib/inc/HAL_uart.h
yorange1/OneOS-Lite
4f713c7fdcd1e47547773351337b2309f61b34bd
[ "Apache-2.0" ]
1
2021-06-07T01:09:45.000Z
2021-06-07T01:09:45.000Z
mm32_m0_iap_uart-master/3_Device/MM32F031xx_n/HAL_lib/inc/HAL_uart.h
Samplecode-MM32/MM32_IAP_Tool
f34aff12a94198cb4c839a419350d25ebf3c1f0e
[ "Apache-2.0" ]
3
2018-11-25T14:44:57.000Z
2021-12-19T14:37:39.000Z
/** ****************************************************************************** * @file HAL_uart.h * @author AE Team * @version V1.5.1 * @date 01/08/2017 * @brief This file contains all the functions prototypes for the UART * firmware library. ****************************************************************************** * @copy * * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE * TIME. AS A RESULT, MindMotion SHALL NOT BE HELD LIABLE FOR ANY * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. * * <h2><center>&copy; COPYRIGHT 2017 MindMotion</center></h2> */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __HAL_UART_H #define __HAL_UART_H /* Includes ------------------------------------------------------------------*/ #include "HAL_device.h" /** @addtogroup StdPeriph_Driver * @{ */ /** @addtogroup UART * @{ */ /** @defgroup UART_Exported_Types * @{ */ /** * @brief UART Init Structure definition */ typedef struct { uint32_t UART_BaudRate; uint16_t UART_WordLength; uint16_t UART_StopBits; uint16_t UART_Parity; uint16_t UART_Mode; uint16_t UART_HardwareFlowControl; } UART_InitTypeDef; /** * @} */ /** @defgroup UART_Exported_Constants * @{ */ #define IS_UART_ALL_PERIPH(PERIPH) (((*(uint32_t*)&(PERIPH)) == UART1_BASE) || \ ((*(uint32_t*)&(PERIPH)) == UART2_BASE) || \ ((*(uint32_t*)&(PERIPH)) == UART3_BASE)) #define IS_UART_123_PERIPH(PERIPH) (((*(uint32_t*)&(PERIPH)) == UART1_BASE) || \ ((*(uint32_t*)&(PERIPH)) == UART2_BASE) || \ ((*(uint32_t*)&(PERIPH)) == UART3_BASE)) /** @defgroup UART_Word_Length * @{ */ #define UART_WordLength_5b ((uint16_t)0x0000) #define UART_WordLength_6b ((uint16_t)0x0010) #define UART_WordLength_7b ((uint16_t)0x0020) #define UART_WordLength_8b ((uint16_t)0x0030) #define IS_UART_WORD_LENGTH(LENGTH) (((LENGTH) == UART_WordLength_5b) || \ ((LENGTH) == UART_WordLength_6b) || \ ((LENGTH) == UART_WordLength_7b) || \ ((LENGTH) == UART_WordLength_8b)) /** * @} */ /** @defgroup UART_Stop_Bits * @{ */ #define UART_StopBits_1 ((uint16_t)0x0000) #define UART_StopBits_2 ((uint16_t)0x0004) #define IS_UART_STOPBITS(STOPBITS) (((STOPBITS) == UART_StopBits_1) || \ ((STOPBITS) == UART_StopBits_2)) /** * @} */ /** @defgroup UART_Parity * @{ */ #define UART_Parity_No ((uint16_t)0x0000) #define UART_Parity_Even ((uint16_t)0x0003) #define UART_Parity_Odd ((uint16_t)0x0001) #define IS_UART_PARITY(PARITY) (((PARITY) == UART_Parity_No) || \ ((PARITY) == UART_Parity_Even) || \ ((PARITY) == UART_Parity_Odd)) /** * @} */ /** @defgroup UART_Mode * @{ */ #define UART_Mode_Rx ((uint16_t)0x0008) #define UART_Mode_Tx ((uint16_t)0x0010) #define IS_UART_MODE(MODE) ((((MODE) & (uint16_t)0xFFE7) == 0x00) && ((MODE) != (uint16_t)0x00)) #define UART_EN ((uint16_t)0x0001) /** * @} */ /** @defgroup UART_Hardware_Flow_Control * @{ */ #define UART_HardwareFlowControl_None ((uint16_t)0x0000) #define IS_UART_HARDWARE_FLOW_CONTROL(CONTROL)\ (((CONTROL) == UART_HardwareFlowControl_None) || \ ((CONTROL) == UART_HardwareFlowControl_RTS) || \ ((CONTROL) == UART_HardwareFlowControl_CTS) || \ ((CONTROL) == UART_HardwareFlowControl_RTS_CTS)) /** @defgroup UART_Interrupt_definition * @{ */ #define UART_IT_ERR ((uint16_t)0x0020) #define UART_IT_PE ((uint16_t)0x0010) #define UART_OVER_ERR ((uint16_t)0x0008) #define UART_TIMEOUT_ERR ((uint16_t)0x0004) #define UART_IT_RXIEN ((uint16_t)0x0002) #define UART_IT_TXIEN ((uint16_t)0x0001) #define IS_UART_CONFIG_IT(IT) (((IT) == UART_IT_PE) || ((IT) == UART_IT_TXIEN) || \ ((IT) == UART_IT_RXIEN) || ((IT) == UART_IT_ERR)) #define IS_UART_GET_IT(IT) (((IT) == UART_IT_PE) || ((IT) == UART_IT_TXIEN) || \ ((IT) == UART_IT_ERR) || ((IT) == UART_IT_RXIEN) || \ ((IT) == UART_OVER_ERR) || ((IT) == UART_TIMEOUT_ERR)) #define IS_UART_CLEAR_IT(IT) ((IT) == UART_IT_RXIEN) /** * @} */ /** @defgroup UART_DMA_Requests * @{ */ #define UART_DMAReq_EN ((uint16_t)0x0002) #define IS_UART_DMAREQ(DMAREQ) ((((DMAREQ) & (uint16_t)0xFFFD) == 0x00) && ((DMAREQ) != (uint16_t)0x00)) /** * @} */ /** @defgroup UART_Flags * @{ */ #define UART_FLAG_TXEMPTY ((uint16_t)0x0008) #define UART_FLAG_TXFULL ((uint16_t)0x0004) #define UART_FLAG_RXAVL ((uint16_t)0x0002) #define UART_FLAG_TXEPT ((uint16_t)0x0001) #define IS_UART_FLAG(FLAG) (((FLAG) == UART_FLAG_TXEMPTY) || ((FLAG) == UART_FLAG_TXFULL) || \ ((FLAG) == UART_FLAG_RXAVL) || ((FLAG) == UART_FLAG_TXEPT)) #define IS_UART_CLEAR_FLAG(FLAG) ((((FLAG) & (uint16_t)0x00FF) == 0x00) && ((FLAG) != (uint16_t)0x00)) #define IS_UART_BAUDRATE(BAUDRATE) (((BAUDRATE) > 0) && ((BAUDRATE) < 0x0044AA21)) #define IS_UART_ADDRESS(ADDRESS) ((ADDRESS) <= 0xF) #define IS_UART_DATA(DATA) ((DATA) <= 0x1FF) /** * @} */ /** * @} */ /** @defgroup UART_Exported_Macros * @{ */ /** * @} */ /** @defgroup UART_Exported_Functions * @{ */ void UART_DeInit(UART_TypeDef* UARTx); void UART_Init(UART_TypeDef* UARTx, UART_InitTypeDef* UART_InitStruct); void UART_StructInit(UART_InitTypeDef* UART_InitStruct); void UART_Cmd(UART_TypeDef* UARTx, FunctionalState NewState); void UART_ITConfig(UART_TypeDef* UARTx, uint16_t UART_IT, FunctionalState NewState); void UART_DMACmd(UART_TypeDef* UARTx, uint16_t UART_DMAReq, FunctionalState NewState); void UART_SendData(UART_TypeDef* UARTx, uint16_t Data); uint16_t UART_ReceiveData(UART_TypeDef* UARTx); FlagStatus UART_GetFlagStatus(UART_TypeDef* UARTx, uint16_t UART_FLAG); void UART_ClearFlag(UART_TypeDef* UARTx, uint16_t UART_FLAG); ITStatus UART_GetITStatus(UART_TypeDef* UARTx, uint16_t UART_IT); void UART_ClearITPendingBit(UART_TypeDef* UARTx, uint16_t UART_IT); #endif /* __HAL_UART_H */ /** * @} */ /** * @} */ /** * @} */ /*-------------------------(C) COPYRIGHT 2017 MindMotion ----------------------*/
26.455645
104
0.614998
9eb6a2867bb4d98ab9c88331f806979e4c249a18
1,618
h
C
src/smcp/smcp-plat-uip.h
Tanganelli/smcp
b253d15dcaceec77ff1b9d3641106286eb3b519e
[ "MIT" ]
1
2019-12-17T09:27:25.000Z
2019-12-17T09:27:25.000Z
src/smcp/smcp-plat-uip.h
Tanganelli/smcp
b253d15dcaceec77ff1b9d3641106286eb3b519e
[ "MIT" ]
null
null
null
src/smcp/smcp-plat-uip.h
Tanganelli/smcp
b253d15dcaceec77ff1b9d3641106286eb3b519e
[ "MIT" ]
2
2019-12-17T09:27:29.000Z
2021-08-03T21:11:32.000Z
/* @file smcp-plat-uip.h ** @author Robert Quattlebaum <darco@deepdarc.com> ** ** Copyright (C) 2014 Robert Quattlebaum ** ** Permission is hereby granted, free of charge, to any person ** obtaining a copy of this software and associated ** documentation files (the "Software"), to deal in the ** Software without restriction, including without limitation ** the rights to use, copy, modify, merge, publish, distribute, ** sublicense, and/or sell copies of the Software, and to ** permit persons to whom the Software is furnished to do so, ** subject to the following conditions: ** ** The above copyright notice and this permission notice shall ** be included in all copies or substantial portions of the ** Software. ** ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY ** KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE ** WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR ** PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS ** OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR ** OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR ** OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef SMCP_smcp_plat_uip_h #define SMCP_smcp_plat_uip_h #if !SMCP_USE_UIP #error SMCP_USE_UIP not defined #endif #include "net/ip/uip.h" #if UIP_CONF_IPV6 typedef uip_ip6addr_t smcp_addr_t; #else typedef uip_ipaddr_t smcp_addr_t; #endif typedef struct { smcp_addr_t smcp_addr; uint16_t smcp_port; } smcp_sockaddr_t; SMCP_API_EXTERN struct uip_udp_conn* smcp_plat_get_udp_conn(smcp_t self); #endif
31.115385
73
0.770087
7f621803e7db552772ae79a19fec8626a5c49956
24,143
c
C
zoo-project/zoo-kernel/caching.c
kalxas/ZOO-Project
e683d4997d28f0189e96b21960c9a801c13f3131
[ "MIT" ]
9
2015-08-23T22:41:07.000Z
2021-05-25T13:10:05.000Z
zoo-project/zoo-kernel/caching.c
kalxas/ZOO-Project
e683d4997d28f0189e96b21960c9a801c13f3131
[ "MIT" ]
null
null
null
zoo-project/zoo-kernel/caching.c
kalxas/ZOO-Project
e683d4997d28f0189e96b21960c9a801c13f3131
[ "MIT" ]
2
2015-11-24T05:50:51.000Z
2017-01-09T22:39:49.000Z
/* * Author : Gérald Fenoy * * Copyright 2008-2015 GeoLabs SARL. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include <openssl/md5.h> #include <openssl/evp.h> #include "service.h" #include "service_internal.h" #include "response_print.h" #include "caching.h" #ifdef MS_FORCE_LOCAL_FILE_USE #include "ogr_api.h" #include "mapserver.h" #endif /** * Compute md5 * * @param url the char* * @return a char* representing the md5 of the url * @warning make sure to free resources returned by this function */ char* getMd5(char* url){ EVP_MD_CTX *md5ctx=EVP_MD_CTX_create(); char* fresult=(char*)malloc((EVP_MAX_MD_SIZE+1)*sizeof(char)); unsigned char result[EVP_MAX_MD_SIZE]; unsigned int len; EVP_DigestInit(md5ctx, EVP_md5()); EVP_DigestUpdate(md5ctx, url, strlen(url)); EVP_DigestFinal_ex(md5ctx,result,&len); EVP_MD_CTX_destroy(md5ctx); int i; for(i = 0; i < len; i++){ if(i>0){ char *tmp=zStrdup(fresult); sprintf(fresult,"%s%02x", tmp,result[i]); free(tmp); } else sprintf(fresult,"%02x",result[i]); } return fresult; } /** * Compute md5 of a file * * @param file the char* * @return a char* representing the md5 of the url * @warning make sure to free resources returned by this function */ char* getMd5f(char* file){ EVP_MD_CTX *md5ctx=EVP_MD_CTX_create(); char* fresult=(char*)malloc((EVP_MAX_MD_SIZE+1)*sizeof(char)); unsigned char result[EVP_MAX_MD_SIZE]; unsigned int len; int bytes; int dlen=65536; unsigned char data[65537]; FILE *inFile = fopen (file, "rb"); EVP_DigestInit(md5ctx, EVP_md5()); while ((bytes = fread (data, sizeof(unsigned char), dlen, inFile)) != 0) EVP_DigestUpdate(md5ctx, data, bytes); EVP_DigestFinal_ex(md5ctx,result,&len); EVP_MD_CTX_destroy(md5ctx); int i; for(i = 0; i < len; i++){ if(i>0){ char *tmp=zStrdup(fresult); sprintf(fresult,"%s%02x", tmp,result[i]); free(tmp); } else sprintf(fresult,"%02x",result[i]); } fclose (inFile); return fresult; } /** * Create a URL by appending every request header listed in the security * section.This imply that the URL will contain any authentication * informations that should be fowarded to the server from which de input * was download. * @param conf the main configuration maps * @param request the URL to transform. * @return a char* that contain the original URL plus potential header (only for * hosts that are not shared). * @warning Be sure to free the memory returned by this function. */ char* getFilenameForRequest(maps* conf, const char* request){ map* passThrough=getMapFromMaps(conf,"security","attributes"); map* targetHosts=getMapFromMaps(conf,"security","hosts"); char* passedHeader[10]; int cnt=0; char *res=zStrdup(request); char *toAppend=NULL; if(passThrough!=NULL && targetHosts!=NULL){ char *tmp=zStrdup(passThrough->value); char *token, *saveptr; token = strtok_r (tmp, ",", &saveptr); int i; if((strstr(targetHosts->value,"*")!=NULL || isProtectedHost(targetHosts->value,request)==1) && strncasecmp(getProvenance(conf,request),"SHARED",6)!=0){ while (token != NULL){ int length=strlen(token)+6; char* tmp1=(char*)malloc(length*sizeof(char)); map* tmpMap; snprintf(tmp1,6,"HTTP_"); int j; for(j=0;token[j]!='\0';j++){ if(token[j]!='-') tmp1[5+j]=toupper(token[j]); else tmp1[5+j]='_'; tmp1[5+j+1]='\0'; } tmpMap = getMapFromMaps(conf,"renv",tmp1); if(tmpMap!=NULL){ if(toAppend==NULL){ toAppend=(char*)malloc((strlen(tmpMap->value)+1)*sizeof(char)); sprintf(toAppend,"%s",tmpMap->value); }else{ char *tmp3=zStrdup(toAppend); toAppend=(char*)realloc(toAppend,(strlen(tmpMap->value)+strlen(tmp3)+2)*sizeof(char)); sprintf(toAppend,"%s,%s",tmp3,tmpMap->value); free(tmp3); } } free(tmp1); cnt+=1; token = strtok_r (NULL, ",", &saveptr); } } free(tmp); } if(toAppend!=NULL){ char *tmp3=zStrdup(res); res=(char*)realloc(res,(strlen(tmp3)+strlen(toAppend)+1)*sizeof(char)); sprintf(res,"%s%s",tmp3,toAppend); free(tmp3); free(toAppend); } return res; } /** * Store MD5 of the content of a file * @file char* the full path of the file */ int storeMd5(char* file){ char* storage=zStrdup(file); char* md5fstr=getMd5f(file); storage[strlen(storage)-2]='m'; storage[strlen(storage)-1]='d'; FILE* fo=fopen(storage,"w+"); if(fo==NULL) return 1; fwrite(md5fstr,sizeof(char),strlen(md5fstr),fo); free(md5fstr); free(storage); fclose(fo); return 0; } /** * Cache a file for a given request. * For each cached file, the are two files stored, a .zca and a .zcm containing * the downloaded content and the mimeType respectively. * * @param conf the maps containing the settings of the main.cfg file * @param request the url used too fetch the content * @param content the downloaded content * @param mimeType the content mimeType * @param length the content size * @param filepath a buffer for storing the path of the cached file; may be NULL * @param max_path the size of the allocated filepath buffer */ void cacheFile(maps* conf,char* request,char* mimeType,int length,char* filename){ map* tmp=getMapFromMaps(conf,"main","cacheDir"); char contentr[4096]; int cred=0; if(tmp!=NULL){ char* myRequest=getFilenameForRequest(conf,request); char* md5str=getMd5(myRequest); free(myRequest); char* fname=(char*)malloc(sizeof(char)*(strlen(tmp->value)+strlen(md5str)+6)); // Store md5 char* md5fstr=getMd5f(filename); sprintf(fname,"%s/%s.zmd",tmp->value,md5str); FILE* fo=fopen(fname,"w+"); #ifdef DEBUG fprintf(stderr,"filename: %s\n",filename); fprintf(stderr,"MD5: %s\n",md5fstr); #endif fwrite(md5fstr,sizeof(char),strlen(md5fstr),fo); free(md5fstr); fclose(fo); sprintf(fname,"%s/%s.zca",tmp->value,md5str); zooLock* lck=lockFile(conf,fname,'w'); if(lck!=NULL){ #ifdef DEBUG fprintf(stderr,"Cache list : %s\n",fname); fflush(stderr); #endif FILE* fi=fopen(filename,"rb"); sprintf(fname,"%s/%s.zca",tmp->value,md5str); fo=fopen(fname,"w+"); if(fo==NULL){ #ifdef DEBUG fprintf (stderr, "Failed to open %s for writing: %s\n",fname, strerror(errno)); #endif unlockFile(conf,lck); return; } if(fi==NULL){ #ifdef DEBUG fprintf (stderr, "Failed to open %s for reading: %s\n",filename, strerror(errno)); #endif unlockFile(conf,lck); return; } memset(contentr,0,4096); while((cred=fread(contentr,sizeof(char),4096,fi))>0){ fwrite(contentr,sizeof(char),cred,fo); fflush(fo); memset(contentr,0,4096); } unlockFile(conf,lck); fclose(fo); fclose(fi); // Store mimeType sprintf(fname,"%s/%s.zcm",tmp->value,md5str); fo=fopen(fname,"w+"); #ifdef DEBUG fprintf(stderr,"MIMETYPE: %s\n",mimeType); #endif fwrite(mimeType,sizeof(char),strlen(mimeType),fo); fclose(fo); // Store provenance sprintf(fname,"%s/%s.zcp",tmp->value,md5str); fo=fopen(fname,"w+"); char* origin=getProvenance(conf,request); #ifdef DEBUG fprintf(stderr,"ORIGIN: %s\n",mimeType); #endif fwrite(origin,sizeof(char),strlen(origin),fo); fclose(fo); free(md5str); } free(fname); } } /** * Cache a file for a given request. * For each cached file, the are two files stored, a .zca and a .zcm containing * the downloaded content and the mimeType respectively. * * @param conf the maps containing the settings of the main.cfg file * @param request the url used too fetch the content * @param content the downloaded content * @param mimeType the content mimeType * @param length the content size * @param filepath a buffer for storing the path of the cached file; may be NULL * @param max_path the size of the allocated filepath buffer */ void addToCache(maps* conf,char* request,char* content,char* mimeType,int length, char* filepath, size_t max_path){ map* tmp=getMapFromMaps(conf,"main","cacheDir"); if(tmp!=NULL){ char* myRequest=getFilenameForRequest(conf,request); char* md5str=getMd5(myRequest); free(myRequest); char* fname=(char*)malloc(sizeof(char)*(strlen(tmp->value)+strlen(md5str)+6)); sprintf(fname,"%s/%s.zca",tmp->value,md5str); zooLock* lck=lockFile(conf,fname,'w'); if(lck!=NULL){ #ifdef DEBUG fprintf(stderr,"Cache list : %s\n",fname); fflush(stderr); #endif FILE* fo=fopen(fname,"w+"); if(fo==NULL){ #ifdef DEBUG fprintf (stderr, "Failed to open %s for writing: %s\n",fname, strerror(errno)); #endif filepath = NULL; unlockFile(conf,lck); return; } fwrite(content,sizeof(char),length,fo); unlockFile(conf,lck); fclose(fo); if (filepath != NULL) { strncpy(filepath, fname, max_path); } sprintf(fname,"%s/%s.zcm",tmp->value,md5str); fo=fopen(fname,"w+"); #ifdef DEBUG fprintf(stderr,"MIMETYPE: %s\n",mimeType); #endif fwrite(mimeType,sizeof(char),strlen(mimeType),fo); fclose(fo); sprintf(fname,"%s/%s.zcp",tmp->value,md5str); fo=fopen(fname,"w+"); char* origin=getProvenance(conf,request); #ifdef DEBUG fprintf(stderr,"ORIGIN: %s\n",mimeType); #endif fwrite(origin,sizeof(char),strlen(origin),fo); fclose(fo); free(md5str); free(fname); } } else { filepath = NULL; } } /** * Verify if a url is available in the cache * * @param conf the maps containing the settings of the main.cfg file * @param request the url * @return the full name of the cached file if any, NULL in other case * @warning make sure to free resources returned by this function (if not NULL) */ char* isInCache(maps* conf,char* request){ map* tmpUrl=getMapFromMaps(conf,"main","tmpUrl"); map* tmpM=getMapFromMaps(conf,"main","cacheDir"); if(tmpM==NULL) tmpM=getMapFromMaps(conf,"main","tmpPath"); if(strstr(request,tmpUrl->value)!=NULL){ map* tmpPath=getMapFromMaps(conf,"main","tmpPath"); char* tmpStr=strstr(request,tmpUrl->value); char* tmpStr1=zStrdup(tmpStr+strlen(tmpUrl->value)); char* res=(char*) malloc((strlen(tmpPath->value)+strlen(tmpStr1)+2)*sizeof(char)); sprintf(res,"%s/%s",tmpPath->value,tmpStr1); free(tmpStr1); return res; } #ifdef MS_FORCE_LOCAL_FILE_USE map* msUrl=getMapFromMaps(conf,"main","mapserverAddress"); if(msUrl!=NULL && strstr(request,msUrl->value)!=NULL){ char *tmpStr=strstr(request,"?"); char *cursor=zStrdup(tmpStr+1); char *token, *saveptr; token = strtok_r (cursor, "&", &saveptr); while(token!=NULL){ char *token1, *saveptr1; token1 = strtok_r (token, "=", &saveptr1); char *name=NULL; while(token1!=NULL){ if(name==NULL) name=zStrdup(token1); else if(strcasecmp(name,"map")==0){ mapObj *myMap=msLoadMap(token1,NULL); char * res=zStrdup(myMap->layers[0]->data); free(name); free(cursor); msFreeMap(myMap); return res; } token1 = strtok_r (NULL, "=", &saveptr1); } token = strtok_r (NULL, "&", &saveptr); } free(cursor); } #endif if(strncasecmp(request,"file://",7)==0){ char* tmpStr=zStrdup(request+7); setMapInMaps(conf,"lenv",tmpStr,"local"); return tmpStr; } else{ char* myRequest=getFilenameForRequest(conf,request); char* md5str=getMd5(myRequest); free(myRequest); #ifdef DEBUG fprintf(stderr,"MD5STR : (%s)\n\n",md5str); #endif char* fname=(char*)malloc(sizeof(char)*(strlen(tmpM->value)+strlen(md5str)+6)); sprintf(fname,"%s/%s.zca",tmpM->value,md5str); zStatStruct f_status; int s=zStat(fname, &f_status); if(s==0 && f_status.st_size>0){ free(md5str); return fname; } free(md5str); free(fname); } return NULL; } /** * Read the downloaded file for a specific input * * @param m the maps containing the settings of the main.cfg file * @param in the input * @param index the input index * @param hInternet the internet connection * @param error the error map pointer * @return 0 in case of success, -1 in case of failure */ int readCurrentInput(maps** m,maps** in,int* index,HINTERNET* hInternet,map** error){ int shouldClean=-1; map* tmp1; char sindex[5]; maps* content=*in; map* length=getMap(content->content,"length"); map* memUse=getMapFromMaps(*m,"main","memory"); if(length==NULL){ length=createMap("length","1"); shouldClean=1; } for(int i=0;i<atoi(length->value);i++){ char* fcontent; char *mimeType=NULL; int fsize=0; char oriname[12]; char cname[15]; char vname[11]; char vname1[11]; char sname[9]; char mname[15]; char icname[14]; char xname[16]; char bname[8]; char hname[11]; char oname[12]; char ufile[12]; if(*index>0) sprintf(vname1,"value_%d",*index); else sprintf(vname1,"value"); if(i>0){ sprintf(cname,"cache_file_%d",i); tmp1=getMap(content->content,cname); sprintf(oriname,"origin_%d",i); sprintf(vname,"value_%d",i); sprintf(sname,"size_%d",i); sprintf(mname,"mimeType_%d",i); sprintf(icname,"isCached_%d",i); sprintf(xname,"Reference_%d",i); sprintf(bname,"body_%d",i); sprintf(hname,"headers_%d",i); sprintf(oname,"Order_%d",i); sprintf(ufile,"use_file_%d",i); }else{ sprintf(cname,"cache_file"); sprintf(oriname,"origin"); sprintf(vname,"value"); sprintf(sname,"size"); sprintf(mname,"mimeType"); sprintf(icname,"isCached"); sprintf(xname,"Reference"); sprintf(bname,"body"); sprintf(hname,"headers"); sprintf(oname,"Order"); sprintf(ufile,"use_file"); } map* tmap=getMap(content->content,oname); sprintf(sindex,"%d",*index+1); if((tmp1=getMap(content->content,xname))!=NULL && tmap!=NULL && strcasecmp(tmap->value,sindex)==0){ if(getMap(content->content,icname)==NULL) { if(memUse==NULL || strcasecmp(memUse->value,"load")==0){ fcontent=(char*)malloc((hInternet->ihandle[*index].nDataLen+1)*sizeof(char)); if(fcontent == NULL){ errorException(*m, _("Unable to allocate memory"), "InternalError",NULL); return -1; } size_t dwRead; InternetReadFile(hInternet->ihandle[*index], (LPVOID)fcontent, hInternet->ihandle[*index].nDataLen, &dwRead); fcontent[hInternet->ihandle[*index].nDataLen]=0; } fsize=hInternet->ihandle[*index].nDataLen; if(hInternet->ihandle[*index].mimeType==NULL) mimeType=zStrdup("none"); else mimeType=zStrdup(hInternet->ihandle[*index].mimeType); map* tmpMap=getMapOrFill(&(*in)->content,vname,""); if(memUse==NULL || strcasecmp(memUse->value,"load")==0){ free(tmpMap->value); tmpMap->value=(char*)malloc((fsize+1)*sizeof(char)); if(tmpMap->value==NULL){ return errorException(*m, _("Unable to allocate memory"), "InternalError",NULL); } memcpy(tmpMap->value,fcontent,(fsize+1)*sizeof(char)); }else addToMap((*in)->content,ufile,"true"); if(hInternet->ihandle[*index].code!=200){ const char *error_rep_str=_("Unable to download the file for the input <%s>, response code was : %d."); char *error_msg=(char*)malloc((strlen(error_rep_str)+strlen(content->name)+4)*sizeof(char)); sprintf(error_msg,error_rep_str,content->name,hInternet->ihandle[*index].code); if(*error==NULL){ *error=createMap("text",error_msg); addToMap(*error,"locator",content->name); addToMap(*error,"code","InvalidParameterValue"); }else{ int nb=1; map* tmpMap=getMap(*error,"length"); if(tmpMap!=NULL) nb=atoi(tmpMap->value); setMapArray(*error,"text",nb,error_msg); setMapArray(*error,"locator",nb,content->name); setMapArray(*error,"code",nb,"InvalidParameterValue"); } return -1; } char ltmp1[256]; sprintf(ltmp1,"%d",fsize); map* tmp=getMapFromMaps(*m,"main","cacheDir"); char *request=NULL; if(tmp!=NULL){ map* tmp2; char* md5str=NULL; if((tmp2=getMap(content->content,bname))!=NULL){ char *tmpStr=(char*)malloc((strlen(tmp1->value)+strlen(tmp2->value)+1)*sizeof(char)); sprintf(tmpStr,"%s%s",tmp1->value,tmp2->value); if((tmp2=getMap(content->content,"headers"))!=NULL){ char *tmpStr2=zStrdup(tmpStr); free(tmpStr); tmpStr=(char*)malloc((strlen(tmpStr2)+strlen(tmp2->value)+1)*sizeof(char)); sprintf(tmpStr,"%s%s",tmpStr2,tmp2->value); free(tmpStr2); } md5str=getMd5(tmpStr); request=zStrdup(tmpStr); free(tmpStr); }else{ char *myRequest=getFilenameForRequest(*m,tmp1->value); md5str=getMd5(myRequest); request=zStrdup(tmp1->value); free(myRequest); } char* fname=(char*)malloc(sizeof(char)*(strlen(tmp->value)+strlen(md5str)+6)); sprintf(fname,"%s/%s.zca",tmp->value,md5str); addToMap((*in)->content,cname,fname); free(fname); } addToMap((*in)->content,sname,ltmp1); addToMap((*in)->content,mname,mimeType); char* origin=getProvenance(*m,request); addToMap((*in)->content,oriname,origin); if(memUse==NULL || strcasecmp(memUse->value,"load")==0){ addToCache(*m,request,fcontent,mimeType,fsize, NULL, 0); free(fcontent); }else{ addToMap((*in)->content,ufile,"true"); cacheFile(*m,request,mimeType,fsize,hInternet->ihandle[*index].filename); } free(mimeType); free(request); (*index)++; } } } if(shouldClean>0){ freeMap(&length); free(length); } return 0; } /** * Effectively run all the HTTP requests in the queue * * @param m the maps containing the settings of the main.cfg file * @param inputs the maps containing the inputs (defined in the requests+added * per default based on the zcfg file) * @param hInternet the HINTERNET pointer * @param error the error map pointer * @return 0 on success, -1 on failure */ int runHttpRequests(maps** m,maps** inputs,HINTERNET* hInternet,map** error){ int hasAFailure=0; if(hInternet!=NULL && hInternet->nb>0){ AddHeaderEntries(hInternet,*m); processDownloads(hInternet); maps* content=*inputs; int index=0; while(content!=NULL){ if(content->child!=NULL){ maps* cursor=content->child; while(cursor!=NULL){ int red=readCurrentInput(m,&cursor,&index,hInternet,error); if(red<0) hasAFailure=red; cursor=cursor->next; } } else{ int red=readCurrentInput(m,&content,&index,hInternet,error); if(red<0) hasAFailure=red; } content=content->next; } } return hasAFailure; } /** * Add a request in the download queue * * @param m the maps containing the settings of the main.cfg file * @param url the url to add to the queue */ void addRequestToQueue(maps** m,HINTERNET* hInternet,const char* url,bool req){ hInternet->waitingRequests[hInternet->nb]=zStrdup(url); if(req) InternetOpenUrl(hInternet,hInternet->waitingRequests[hInternet->nb],NULL,0,INTERNET_FLAG_NO_CACHE_WRITE,0,*m); maps *oreq=getMaps(*m,"orequests"); if(oreq==NULL){ oreq=createMaps("orequests"); oreq->content=createMap("value",url); addMapsToMaps(m,oreq); freeMaps(&oreq); free(oreq); }else{ setMapArray(oreq->content,"value",hInternet->nb,url); } } /** * Try to load file from cache or download a remote file if not in cache * * @param m the maps containing the settings of the main.cfg file * @param content the map to update * @param hInternet the HINTERNET pointer * @param url the url to fetch * @return 0 */ int loadRemoteFile(maps** m,map** content,HINTERNET* hInternet,char *url){ char* fcontent = NULL; char* cached=isInCache(*m,url); char *mimeType=NULL; char *origin=NULL; long long fsize=0; map* memUse=getMapFromMaps(*m,"main","memory"); map* t=getMap(*content,"xlink:href"); if(t==NULL){ t=getMap((*content),"href"); addToMap(*content,"xlink:href",url); } if(cached!=NULL){ zStatStruct f_status; int s=zStat(cached, &f_status); if(s==0){ zooLock* lck=lockFile(*m,cached,'r'); if(lck==NULL) return -1; fsize=f_status.st_size; if(memUse==NULL || strcasecmp(memUse->value,"load")==0){ fcontent=(char*)malloc(sizeof(char)*(f_status.st_size+1)); FILE* f=fopen(cached,"rb"); if(f!=NULL){ fread(fcontent,f_status.st_size,1,f); fcontent[fsize]=0; fclose(f); } } addToMap(*content,"cache_file",cached); unlockFile(*m,lck); } map* isLocalFile=getMapFromMaps(*m,"lenv",cached); if(isLocalFile==NULL){ cached[strlen(cached)-1]='m'; s=zStat(cached, &f_status); if(s==0){ zooLock* lck=lockFile(*m,cached,'r'); if(lck==NULL) return -1; mimeType=(char*)malloc(sizeof(char)*(f_status.st_size+1)); FILE* f=fopen(cached,"rb"); fread(mimeType,f_status.st_size,1,f); mimeType[f_status.st_size]=0; fclose(f); unlockFile(*m,lck); } cached[strlen(cached)-1]='p'; s=zStat(cached, &f_status); if(s==0){ zooLock* lck=lockFile(*m,cached,'r'); if(lck==NULL) return -1; origin=(char*)malloc(sizeof(char)*(f_status.st_size+1)); FILE* f=fopen(cached,"rb"); fread(origin,f_status.st_size,1,f); mimeType[f_status.st_size]=0; fclose(f); unlockFile(*m,lck); } } }else{ addRequestToQueue(m,hInternet,url,true); return 0; } if(fsize==0){ return errorException(*m, _("Unable to download the file."), "InternalError",NULL); } if(mimeType!=NULL){ addToMap(*content,"fmimeType",mimeType); } if(origin!=NULL){ addToMap(*content,"origin",origin); } map* tmpMap=getMapOrFill(content,"value",""); if(memUse==NULL || strcasecmp(memUse->value,"load")==0){ free(tmpMap->value); tmpMap->value=(char*)malloc((fsize+1)*sizeof(char)); if(tmpMap->value==NULL || fcontent == NULL) return errorException(*m, _("Unable to allocate memory"), "InternalError",NULL); memcpy(tmpMap->value,fcontent,(fsize+1)*sizeof(char)); } char ltmp1[256]; sprintf(ltmp1,"%lld",fsize); addToMap(*content,"size",ltmp1); if(cached==NULL){ if(memUse==NULL || strcasecmp(memUse->value,"load")==0) addToCache(*m,url,fcontent,mimeType,fsize, NULL, 0); else cacheFile(*m,url,mimeType,fsize,hInternet->ihandle[hInternet->nb-1].filename); } else{ addToMap(*content,"isCached","true"); map* tmp=getMapFromMaps(*m,"main","cacheDir"); map* tmp1=getMap((*content),"cache_file"); if(tmp!=NULL && tmp1==NULL){ map *c=getMap((*content),"xlink:href"); if(strncasecmp(c->value,"file://",7)!=0){ char *myRequest=getFilenameForRequest(*m,c->value); char* md5str=getMd5(myRequest); free(myRequest); char* fname=(char*)malloc(sizeof(char)*(strlen(tmp->value)+strlen(md5str)+6)); sprintf(fname,"%s/%s.zca",tmp->value,md5str); addToMap(*content,"cache_file",fname); free(fname); free(md5str); } } } if(fcontent!=NULL) free(fcontent); if(mimeType!=NULL) free(mimeType); if(cached!=NULL) free(cached); return 0; }
30.254386
155
0.654724
36a3bf69e6483adb68c8116862148db60049a4c8
199
c
C
user/infiniwriter.c
stefank-29/OS-MainProject
559da82e254a84c785743712bffeb23c5f95aae2
[ "MIT-0" ]
null
null
null
user/infiniwriter.c
stefank-29/OS-MainProject
559da82e254a84c785743712bffeb23c5f95aae2
[ "MIT-0" ]
null
null
null
user/infiniwriter.c
stefank-29/OS-MainProject
559da82e254a84c785743712bffeb23c5f95aae2
[ "MIT-0" ]
null
null
null
#include "kernel/types.h" #include "kernel/stat.h" #include "user.h" int main(int argc, char *argv[]) { int i = 0; for(;;) { printf("Infiniwriter, tick: %d\n", i++); sleep(100); } exit(); }
13.266667
42
0.582915
36b0ae18332c5c5e131f6b3c4d38ae1ca30fb8be
2,926
c
C
tests/unit-core/test-exec-stop.c
nszetei/jerryscript
264bb210c19fcb3b8b7fc2ce1da579e4842c2715
[ "Apache-2.0" ]
2
2020-10-24T08:18:38.000Z
2020-12-29T14:48:11.000Z
tests/unit-core/test-exec-stop.c
nszetei/jerryscript
264bb210c19fcb3b8b7fc2ce1da579e4842c2715
[ "Apache-2.0" ]
1
2019-01-30T08:42:50.000Z
2019-01-30T08:42:50.000Z
tests/unit-core/test-exec-stop.c
nszetei/jerryscript
264bb210c19fcb3b8b7fc2ce1da579e4842c2715
[ "Apache-2.0" ]
2
2016-12-30T16:21:59.000Z
2018-03-24T00:53:50.000Z
/* Copyright JS Foundation and other contributors, http://js.foundation * * 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 "config.h" #include "jerryscript.h" #include "test-common.h" static jerry_value_t vm_exec_stop_callback (void *user_p) { int *int_p = (int *) user_p; if (*int_p > 0) { (*int_p)--; return jerry_create_undefined (); } return jerry_create_string ((const jerry_char_t *) "Abort script"); } /* vm_exec_stop_callback */ int main (void) { TEST_INIT (); /* Test stopping an infinite loop. */ if (!jerry_is_feature_enabled (JERRY_FEATURE_VM_EXEC_STOP)) { return 0; } jerry_init (JERRY_INIT_EMPTY); int countdown = 6; jerry_set_vm_exec_stop_callback (vm_exec_stop_callback, &countdown, 16); const jerry_char_t inf_loop_code_src1[] = "while(true) {}"; jerry_value_t parsed_code_val = jerry_parse (NULL, 0, inf_loop_code_src1, sizeof (inf_loop_code_src1) - 1, JERRY_PARSE_NO_OPTS); TEST_ASSERT (!jerry_value_is_error (parsed_code_val)); jerry_value_t res = jerry_run (parsed_code_val); TEST_ASSERT (countdown == 0); TEST_ASSERT (jerry_value_is_error (res)); jerry_release_value (res); jerry_release_value (parsed_code_val); /* A more complex example. Although the callback error is captured * by the catch block, it is automatically thrown again. */ /* We keep the callback function, only the countdown is reset. */ countdown = 6; const jerry_char_t inf_loop_code_src2[] = TEST_STRING_LITERAL ( "function f() { while (true) ; }\n" "try { f(); } catch(e) {}" ); parsed_code_val = jerry_parse (NULL, 0, inf_loop_code_src2, sizeof (inf_loop_code_src2) - 1, JERRY_PARSE_NO_OPTS); TEST_ASSERT (!jerry_value_is_error (parsed_code_val)); res = jerry_run (parsed_code_val); TEST_ASSERT (countdown == 0); /* The result must have an error flag which proves that * the error is thrown again inside the catch block. */ TEST_ASSERT (jerry_value_is_error (res)); jerry_release_value (res); jerry_release_value (parsed_code_val); jerry_cleanup (); return 0; } /* main */
29.555556
79
0.642857
d22f01c87b9765bc5e5c092ca7aef8795a4fdad3
222
h
C
Example/XLPagerTabStripObjcContinue/FPViewController.h
FPJack/XLPagerTabStripObjcContinue
e16d929974ea294206eddb2a1b0692c7ceccccd1
[ "MIT" ]
null
null
null
Example/XLPagerTabStripObjcContinue/FPViewController.h
FPJack/XLPagerTabStripObjcContinue
e16d929974ea294206eddb2a1b0692c7ceccccd1
[ "MIT" ]
null
null
null
Example/XLPagerTabStripObjcContinue/FPViewController.h
FPJack/XLPagerTabStripObjcContinue
e16d929974ea294206eddb2a1b0692c7ceccccd1
[ "MIT" ]
null
null
null
// // FPViewController.h // XLPagerTabStripObjcContinue // // Created by FPJack on 01/03/2020. // Copyright (c) 2020 FPJack. All rights reserved. // @import UIKit; @interface FPViewController : UIViewController @end
17.076923
51
0.725225
82d7c60d32629a7b23e6be6c21a86ff1cc8667db
72
h
C
depends/work/build/i686-w64-mingw32/qt/5.9.7-f2560c1efa6/qttools/include/QtHelp/5.9.7/QtHelp/private/qhelpsearchindexreader_p.h
GrinCash/Grinc-core
1377979453ba84082f70f9c128be38e57b65a909
[ "MIT" ]
1
2020-04-30T15:47:35.000Z
2020-04-30T15:47:35.000Z
depends/work/build/i686-w64-mingw32/qt/5.9.7-f2560c1efa6/qttools/include/QtHelp/5.9.7/QtHelp/private/qhelpsearchindexreader_p.h
GrinCash/Grinc-core
1377979453ba84082f70f9c128be38e57b65a909
[ "MIT" ]
null
null
null
depends/work/build/i686-w64-mingw32/qt/5.9.7-f2560c1efa6/qttools/include/QtHelp/5.9.7/QtHelp/private/qhelpsearchindexreader_p.h
GrinCash/Grinc-core
1377979453ba84082f70f9c128be38e57b65a909
[ "MIT" ]
null
null
null
#include "../../../../../src/assistant/help/qhelpsearchindexreader_p.h"
36
71
0.666667
96535a0c85b270cfb7990f87c95590435734c914
31,996
c
C
src/emu/x86run_private.c
raetro-deps/box86
9190a20ca16da8b90f671285dbbff2964ba688fd
[ "MIT" ]
2,059
2019-03-03T22:16:11.000Z
2022-03-31T21:53:33.000Z
src/emu/x86run_private.c
raetro-deps/box86
9190a20ca16da8b90f671285dbbff2964ba688fd
[ "MIT" ]
428
2019-03-04T15:19:01.000Z
2022-03-31T23:46:30.000Z
src/emu/x86run_private.c
raetro-deps/box86
9190a20ca16da8b90f671285dbbff2964ba688fd
[ "MIT" ]
207
2019-03-14T18:19:18.000Z
2022-03-30T08:52:41.000Z
#define _GNU_SOURCE /* See feature_test_macros(7) */ #include <dlfcn.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #ifdef HAVE_TRACE #include <unistd.h> #include <sys/syscall.h> #endif #include "debug.h" #include "box86stack.h" #include "x86emu.h" #include "x86run.h" #include "x86run_private.h" #include "x86emu_private.h" #include "box86context.h" #include "x86run.h" #include "librarian.h" #include "elfloader.h" #ifdef HAVE_TRACE #include "x86trace.h" #endif #include "x86tls.h" #define PARITY(x) (((emu->x86emu_parity_tab[(x) / 32] >> ((x) % 32)) & 1) == 0) #define XOR2(x) (((x) ^ ((x)>>1)) & 0x1) #ifdef ANDROID void EXPORT my___libc_init(x86emu_t* emu, void* raw_args __unused, void (*onexit)(void) __unused, int (*main)(int, char**, char**), void const * const structors __unused) { //TODO: register fini // let's cheat and set all args... Push(emu, (uint32_t)my_context->envv); Push(emu, (uint32_t)my_context->argv); Push(emu, (uint32_t)my_context->argc); printf_log(LOG_DEBUG, "Transfert to main(%d, %p, %p)=>%p from __libc_init\n", my_context->argc, my_context->argv, my_context->envv, main); // call main and finish PushExit(emu); R_EIP=(uint32_t)main; DynaRun(emu); emu->quit = 1; // finished! } #else int32_t EXPORT my___libc_start_main(x86emu_t* emu, int *(main) (int, char * *, char * *), int argc, char * * ubp_av, void (*init) (void), void (*fini) (void), void (*rtld_fini) (void), void (* stack_end)) { // let's cheat and set all args... Push(emu, (uint32_t)my_context->envv); Push(emu, (uint32_t)my_context->argv); Push(emu, (uint32_t)my_context->argc); if(init) { PushExit(emu); R_EIP=(uint32_t)*init; printf_log(LOG_DEBUG, "Calling init(%p) from __libc_start_main\n", *init); DynaRun(emu); if(emu->error) // any error, don't bother with more return 0; emu->quit = 0; } printf_log(LOG_DEBUG, "Transfert to main(%d, %p, %p)=>%p from __libc_start_main\n", my_context->argc, my_context->argv, my_context->envv, main); // call main and finish PushExit(emu); R_EIP=(uint32_t)main; DynaRun(emu); emu->quit = 1; // finished! return 0; } #endif const char* GetNativeName(void* p) { static char buff[500] = {0}; Dl_info info; if(dladdr(p, &info)==0) { const char *ret = GetNameOffset(my_context->maplib, p); if(ret) return ret; sprintf(buff, "%s(%p)", "???", p); return buff; } else { if(info.dli_sname) { strcpy(buff, info.dli_sname); if(info.dli_fname) { strcat(buff, " ("); strcat(buff, info.dli_fname); strcat(buff, ")"); } } else { sprintf(buff, "%s(%s/%p)", "???", info.dli_fname, p); return buff; } } return buff; } void UpdateFlags(x86emu_t *emu) { uint32_t cc; uint32_t lo, hi; uint32_t bc; uint32_t cnt; switch(emu->df) { case d_none: return; case d_add8: CONDITIONAL_SET_FLAG(emu->res & 0x100, F_CF); CONDITIONAL_SET_FLAG((emu->res & 0xff) == 0, F_ZF); CONDITIONAL_SET_FLAG(emu->res & 0x80, F_SF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); cc = (emu->op1 & emu->op2) | ((~emu->res) & (emu->op1 | emu->op2)); CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF); CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); break; case d_add16: CONDITIONAL_SET_FLAG(emu->res & 0x10000, F_CF); CONDITIONAL_SET_FLAG((emu->res & 0xffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(emu->res & 0x8000, F_SF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); cc = (emu->op1 & emu->op2) | ((~emu->res) & (emu->op1 | emu->op2)); CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF); CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); break; case d_add32: lo = (emu->op2 & 0xFFFF) + (emu->op1 & 0xFFFF); hi = (lo >> 16) + (emu->op2 >> 16) + (emu->op1 >> 16); CONDITIONAL_SET_FLAG(hi & 0x10000, F_CF); CONDITIONAL_SET_FLAG(!emu->res, F_ZF); CONDITIONAL_SET_FLAG(emu->res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); cc = (emu->op1 & emu->op2) | ((~emu->res) & (emu->op1 | emu->op2)); CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF); CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); break; case d_and8: CLEAR_FLAG(F_OF); CLEAR_FLAG(F_CF); CLEAR_FLAG(F_AF); CONDITIONAL_SET_FLAG(emu->res & 0x80, F_SF); CONDITIONAL_SET_FLAG(emu->res == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); break; case d_and16: CLEAR_FLAG(F_OF); CLEAR_FLAG(F_CF); CLEAR_FLAG(F_AF); CONDITIONAL_SET_FLAG(emu->res & 0x8000, F_SF); CONDITIONAL_SET_FLAG(emu->res == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); break; case d_and32: CLEAR_FLAG(F_OF); CLEAR_FLAG(F_CF); CLEAR_FLAG(F_AF); CONDITIONAL_SET_FLAG(emu->res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(emu->res == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); break; case d_dec8: CONDITIONAL_SET_FLAG(emu->res & 0x80, F_SF); CONDITIONAL_SET_FLAG((emu->res & 0xff) == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); bc = (emu->res & (~emu->op1 | 1)) | (~emu->op1 & 1); CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); break; case d_dec16: CONDITIONAL_SET_FLAG(emu->res & 0x8000, F_SF); CONDITIONAL_SET_FLAG((emu->res & 0xffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); bc = (emu->res & (~emu->op1 | 1)) | (~emu->op1 & 1); CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); break; case d_dec32: CONDITIONAL_SET_FLAG(emu->res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(!emu->res, F_ZF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); bc = (emu->res & (~emu->op1 | 1)) | (~emu->op1 & 1); CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); break; case d_inc8: CONDITIONAL_SET_FLAG((emu->res & 0xff) == 0, F_ZF); CONDITIONAL_SET_FLAG(emu->res & 0x80, F_SF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); cc = ((1 & emu->op1) | (~emu->res)) & (1 | emu->op1); CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF); CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); break; case d_inc16: CONDITIONAL_SET_FLAG((emu->res & 0xffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(emu->res & 0x8000, F_SF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); cc = (1 & emu->op1) | ((~emu->res) & (1 | emu->op1)); CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF); CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); break; case d_inc32: CONDITIONAL_SET_FLAG(!emu->res, F_ZF); CONDITIONAL_SET_FLAG(emu->res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); cc = (1 & emu->op1) | ((~emu->res) & (1 | emu->op1)); CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF); CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); break; case d_imul8: lo = emu->res & 0xff; hi = (emu->res>>8)&0xff; if (((lo & 0x80) == 0 && hi == 0x00) || ((lo & 0x80) != 0 && hi == 0xFF)) { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } else { SET_FLAG(F_CF); SET_FLAG(F_OF); } CONDITIONAL_SET_FLAG(PARITY(lo & 0xff), F_PF); break; case d_imul16: lo = (uint16_t)emu->res; hi = (uint16_t)(emu->res >> 16); if (((lo & 0x8000) == 0 && hi == 0x00) || ((lo & 0x8000) != 0 && hi == 0xFFFF)) { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } else { SET_FLAG(F_CF); SET_FLAG(F_OF); } CONDITIONAL_SET_FLAG(PARITY(lo & 0xff), F_PF); break; case d_imul32: if (((emu->res & 0x80000000) == 0 && emu->op1 == 0x00) || ((emu->res & 0x80000000) != 0 && emu->op1 == 0xFFFFFFFF)) { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } else { SET_FLAG(F_CF); SET_FLAG(F_OF); } CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); break; case d_mul8: lo = emu->res & 0xff; hi = (emu->res>>8)&0xff; if (hi == 0) { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } else { SET_FLAG(F_CF); SET_FLAG(F_OF); } CONDITIONAL_SET_FLAG(PARITY(lo & 0xff), F_PF); break; case d_mul16: lo = (uint16_t)emu->res; hi = (uint16_t)(emu->res >> 16); if (hi == 0) { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } else { SET_FLAG(F_CF); SET_FLAG(F_OF); } CONDITIONAL_SET_FLAG(PARITY(lo & 0xff), F_PF); break; case d_mul32: if (emu->op1 == 0) { CLEAR_FLAG(F_CF); CLEAR_FLAG(F_OF); } else { SET_FLAG(F_CF); SET_FLAG(F_OF); } CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); break; case d_or8: CLEAR_FLAG(F_OF); CLEAR_FLAG(F_CF); CLEAR_FLAG(F_AF); CONDITIONAL_SET_FLAG(emu->res & 0x80, F_SF); CONDITIONAL_SET_FLAG(emu->res == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); break; case d_or16: CLEAR_FLAG(F_OF); CLEAR_FLAG(F_CF); CLEAR_FLAG(F_AF); CONDITIONAL_SET_FLAG(emu->res & 0x8000, F_SF); CONDITIONAL_SET_FLAG(emu->res == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); break; case d_or32: CLEAR_FLAG(F_OF); CLEAR_FLAG(F_CF); CLEAR_FLAG(F_AF); CONDITIONAL_SET_FLAG(emu->res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(emu->res == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); break; case d_neg8: CONDITIONAL_SET_FLAG(emu->op1 != 0, F_CF); CONDITIONAL_SET_FLAG((emu->res & 0xff) == 0, F_ZF); CONDITIONAL_SET_FLAG(emu->res & 0x80, F_SF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); bc = emu->res | emu->op1; CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); break; case d_neg16: CONDITIONAL_SET_FLAG(emu->op1 != 0, F_CF); CONDITIONAL_SET_FLAG((emu->res & 0xffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(emu->res & 0x8000, F_SF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); bc = emu->res | emu->op1; CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); break; case d_neg32: CONDITIONAL_SET_FLAG(emu->op1 != 0, F_CF); CONDITIONAL_SET_FLAG(!emu->res, F_ZF); CONDITIONAL_SET_FLAG(emu->res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); bc = emu->res | emu->op1; CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); break; case d_shl8: if (emu->op2 < 8) { cnt = emu->op2 % 8; if (cnt > 0) { cc = emu->op1 & (1 << (8 - cnt)); CONDITIONAL_SET_FLAG(cc, F_CF); CONDITIONAL_SET_FLAG((emu->res & 0xff) == 0, F_ZF); CONDITIONAL_SET_FLAG(emu->res & 0x80, F_SF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); } if (cnt == 1) { CONDITIONAL_SET_FLAG((((emu->res & 0x80) == 0x80) ^(ACCESS_FLAG(F_CF) != 0)), F_OF); } else { CLEAR_FLAG(F_OF); } } else { CONDITIONAL_SET_FLAG((emu->op1 << (emu->op2-1)) & 0x80, F_CF); CLEAR_FLAG(F_OF); CLEAR_FLAG(F_SF); SET_FLAG(F_PF); SET_FLAG(F_ZF); } break; case d_shl16: if (emu->op2 < 16) { cnt = emu->op2 % 16; if (cnt > 0) { cc = emu->op1 & (1 << (16 - cnt)); CONDITIONAL_SET_FLAG(cc, F_CF); CONDITIONAL_SET_FLAG((emu->res & 0xffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(emu->res & 0x8000, F_SF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); } if (cnt == 1) { CONDITIONAL_SET_FLAG(((!!(emu->res & 0x8000)) ^(ACCESS_FLAG(F_CF) != 0)), F_OF); } else { CLEAR_FLAG(F_OF); } } else { CONDITIONAL_SET_FLAG((emu->op1 << (emu->op2-1)) & 0x8000, F_CF); CLEAR_FLAG(F_OF); CLEAR_FLAG(F_SF); SET_FLAG(F_PF); SET_FLAG(F_ZF); } break; case d_shl32: if (emu->op2 > 0) { cc = emu->op1 & (1 << (32 - emu->op2)); CONDITIONAL_SET_FLAG(cc, F_CF); CONDITIONAL_SET_FLAG(!emu->res, F_ZF); CONDITIONAL_SET_FLAG(emu->res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); } if (emu->op2 == 1) { CONDITIONAL_SET_FLAG(((!!(emu->res & 0x80000000)) ^ (ACCESS_FLAG(F_CF) != 0)), F_OF); } else { CLEAR_FLAG(F_OF); } break; case d_sar8: if (emu->op2 < 8) { if(emu->op2) { cc = emu->op1 & (1 << (emu->op2 - 1)); CONDITIONAL_SET_FLAG(cc, F_CF); CONDITIONAL_SET_FLAG((emu->res & 0xff) == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); CONDITIONAL_SET_FLAG(emu->res & 0x80, F_SF); } } else { if (emu->op1&0x80) { SET_FLAG(F_CF); CLEAR_FLAG(F_ZF); SET_FLAG(F_SF); SET_FLAG(F_PF); } else { CLEAR_FLAG(F_CF); SET_FLAG(F_ZF); CLEAR_FLAG(F_SF); SET_FLAG(F_PF); } } break; case d_sar16: if (emu->op2 < 16) { if(emu->op2) { cc = emu->op1 & (1 << (emu->op2 - 1)); CONDITIONAL_SET_FLAG(cc, F_CF); CONDITIONAL_SET_FLAG((emu->res & 0xffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(emu->res & 0x8000, F_SF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); } } else { if (emu->op1&0x8000) { SET_FLAG(F_CF); CLEAR_FLAG(F_ZF); SET_FLAG(F_SF); SET_FLAG(F_PF); } else { CLEAR_FLAG(F_CF); SET_FLAG(F_ZF); CLEAR_FLAG(F_SF); SET_FLAG(F_PF); } } break; case d_sar32: if(emu->op2) { cc = emu->op1 & (1 << (emu->op2 - 1)); CONDITIONAL_SET_FLAG(cc, F_CF); CONDITIONAL_SET_FLAG(emu->res == 0, F_ZF); CONDITIONAL_SET_FLAG(emu->res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); } break; case d_shr8: if (emu->op2 < 8) { cnt = emu->op2 % 8; if (cnt > 0) { cc = emu->op1 & (1 << (cnt - 1)); CONDITIONAL_SET_FLAG(cc, F_CF); CONDITIONAL_SET_FLAG((emu->res & 0xff) == 0, F_ZF); CONDITIONAL_SET_FLAG(emu->res & 0x80, F_SF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); } if (cnt == 1) { CONDITIONAL_SET_FLAG(XOR2(emu->res >> 6), F_OF); } } else { CONDITIONAL_SET_FLAG((emu->op1 >> (emu->op2-1)) & 0x1, F_CF); CLEAR_FLAG(F_SF); SET_FLAG(F_PF); SET_FLAG(F_ZF); } break; case d_shr16: if (emu->op2 < 16) { cnt = emu->op2 % 16; if (cnt > 0) { cc = emu->op1 & (1 << (cnt - 1)); CONDITIONAL_SET_FLAG(cc, F_CF); CONDITIONAL_SET_FLAG((emu->res & 0xffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(emu->res & 0x8000, F_SF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); } if (cnt == 1) { CONDITIONAL_SET_FLAG(XOR2(emu->res >> 14), F_OF); } } else { CLEAR_FLAG(F_CF); SET_FLAG(F_ZF); CLEAR_FLAG(F_SF); SET_FLAG(F_PF); } break; case d_shr32: cnt = emu->op2; if (cnt > 0) { cc = emu->op1 & (1 << (cnt - 1)); CONDITIONAL_SET_FLAG(cc, F_CF); CONDITIONAL_SET_FLAG(!emu->res, F_ZF); CONDITIONAL_SET_FLAG(emu->res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); } if (cnt == 1) { CONDITIONAL_SET_FLAG(XOR2(emu->res >> 30), F_OF); } break; case d_sub8: CONDITIONAL_SET_FLAG(emu->res & 0x80, F_SF); CONDITIONAL_SET_FLAG((emu->res & 0xff) == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); bc = (emu->res & (~emu->op1 | emu->op2)) | (~emu->op1 & emu->op2); CONDITIONAL_SET_FLAG(bc & 0x80, F_CF); CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); break; case d_sub16: CONDITIONAL_SET_FLAG(emu->res & 0x8000, F_SF); CONDITIONAL_SET_FLAG((emu->res & 0xffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); bc = (emu->res & (~emu->op1 | emu->op2)) | (~emu->op1 & emu->op2); CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF); CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); break; case d_sub32: CONDITIONAL_SET_FLAG(emu->res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(!emu->res, F_ZF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); bc = (emu->res & (~emu->op1 | emu->op2)) | (~emu->op1 & emu->op2); CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF); CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); break; case d_xor8: CLEAR_FLAG(F_OF); CONDITIONAL_SET_FLAG(emu->res & 0x80, F_SF); CONDITIONAL_SET_FLAG(emu->res == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); CLEAR_FLAG(F_CF); CLEAR_FLAG(F_AF); break; case d_xor16: CLEAR_FLAG(F_OF); CONDITIONAL_SET_FLAG(emu->res & 0x8000, F_SF); CONDITIONAL_SET_FLAG(emu->res == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); CLEAR_FLAG(F_CF); CLEAR_FLAG(F_AF); break; case d_xor32: CLEAR_FLAG(F_OF); CONDITIONAL_SET_FLAG(emu->res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(emu->res == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); CLEAR_FLAG(F_CF); CLEAR_FLAG(F_AF); break; case d_cmp8: CLEAR_FLAG(F_CF); CONDITIONAL_SET_FLAG(emu->res & 0x80, F_SF); CONDITIONAL_SET_FLAG((emu->res & 0xff) == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); bc = (emu->res & (~emu->op1 | emu->op2)) | (~emu->op1 & emu->op2); CONDITIONAL_SET_FLAG(bc & 0x80, F_CF); CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); break; case d_cmp16: CONDITIONAL_SET_FLAG(emu->res & 0x8000, F_SF); CONDITIONAL_SET_FLAG((emu->res & 0xffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); bc = (emu->res & (~emu->op1 | emu->op2)) | (~emu->op1 & emu->op2); CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF); CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); break; case d_cmp32: CONDITIONAL_SET_FLAG(emu->res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(!emu->res, F_ZF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); bc = (emu->res & (~emu->op1 | emu->op2)) | (~emu->op1 & emu->op2); CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF); CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); break; case d_tst8: CLEAR_FLAG(F_OF); CONDITIONAL_SET_FLAG(emu->res & 0x80, F_SF); CONDITIONAL_SET_FLAG(emu->res == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); CLEAR_FLAG(F_CF); break; case d_tst16: CLEAR_FLAG(F_OF); CONDITIONAL_SET_FLAG(emu->res & 0x8000, F_SF); CONDITIONAL_SET_FLAG(emu->res == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); CLEAR_FLAG(F_CF); break; case d_tst32: CLEAR_FLAG(F_OF); CONDITIONAL_SET_FLAG(emu->res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(emu->res == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); CLEAR_FLAG(F_CF); break; case d_adc8: CONDITIONAL_SET_FLAG(emu->res & 0x100, F_CF); CONDITIONAL_SET_FLAG((emu->res & 0xff) == 0, F_ZF); CONDITIONAL_SET_FLAG(emu->res & 0x80, F_SF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); cc = (emu->op1 & emu->op2) | ((~emu->res) & (emu->op1 | emu->op2)); CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF); CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); break; case d_adc16: CONDITIONAL_SET_FLAG(emu->res & 0x10000, F_CF); CONDITIONAL_SET_FLAG((emu->res & 0xffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(emu->res & 0x8000, F_SF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); cc = (emu->op1 & emu->op2) | ((~emu->res) & (emu->op1 | emu->op2)); CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF); CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); break; case d_adc32: if(emu->res == (emu->op1+emu->op2)) { lo = (emu->op1 & 0xFFFF) + (emu->op2 & 0xFFFF); } else { lo = 1 + (emu->op1 & 0xFFFF) + (emu->op2 & 0xFFFF); } hi = (lo >> 16) + (emu->op1 >> 16) + (emu->op2 >> 16); CONDITIONAL_SET_FLAG(hi & 0x10000, F_CF); CONDITIONAL_SET_FLAG(!emu->res, F_ZF); CONDITIONAL_SET_FLAG(emu->res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); cc = (emu->op2 & emu->op1) | ((~emu->res) & (emu->op2 | emu->op1)); CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF); CONDITIONAL_SET_FLAG(cc & 0x8, F_AF); break; case d_sbb8: CONDITIONAL_SET_FLAG(emu->res & 0x80, F_SF); CONDITIONAL_SET_FLAG((emu->res & 0xff) == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); bc = (emu->res & (~emu->op1 | emu->op2)) | (~emu->op1 & emu->op2); CONDITIONAL_SET_FLAG(bc & 0x80, F_CF); CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); break; case d_sbb16: CONDITIONAL_SET_FLAG(emu->res & 0x8000, F_SF); CONDITIONAL_SET_FLAG((emu->res & 0xffff) == 0, F_ZF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); bc = (emu->res & (~emu->op1 | emu->op2)) | (~emu->op1 & emu->op2); CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF); CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); break; case d_sbb32: CONDITIONAL_SET_FLAG(emu->res & 0x80000000, F_SF); CONDITIONAL_SET_FLAG(!emu->res, F_ZF); CONDITIONAL_SET_FLAG(PARITY(emu->res & 0xff), F_PF); bc = (emu->res & (~emu->op1 | emu->op2)) | (~emu->op1 & emu->op2); CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF); CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF); CONDITIONAL_SET_FLAG(bc & 0x8, F_AF); break; case d_rol8: if(emu->op2 == 1) { CONDITIONAL_SET_FLAG((emu->res + (emu->res >> 7)) & 1, F_OF); } CONDITIONAL_SET_FLAG(emu->res & 0x1, F_CF); break; case d_rol16: if(emu->op2 == 1) { CONDITIONAL_SET_FLAG((emu->res + (emu->res >> 15)) & 1, F_OF); } CONDITIONAL_SET_FLAG(emu->res & 0x1, F_CF); break; case d_rol32: if(emu->op2 == 1) { CONDITIONAL_SET_FLAG((emu->res + (emu->res >> 31)) & 1, F_OF); } CONDITIONAL_SET_FLAG(emu->res & 0x1, F_CF); break; case d_ror8: if(emu->op2 == 1) { CONDITIONAL_SET_FLAG(XOR2(emu->res >> 6), F_OF); } CONDITIONAL_SET_FLAG(emu->res & (1 << 7), F_CF); break; case d_ror16: if(emu->op2 == 1) { CONDITIONAL_SET_FLAG(XOR2(emu->res >> 14), F_OF); } CONDITIONAL_SET_FLAG(emu->res & (1 << 15), F_CF); break; case d_ror32: if(emu->op2 == 1) { CONDITIONAL_SET_FLAG(XOR2(emu->res >> 30), F_OF); } CONDITIONAL_SET_FLAG(emu->res & (1 << 31), F_CF); break; case d_unknown: printf_log(LOG_NONE, "Box86: %p trying to evaluate Unknown defered Flags\n", (void*)R_EIP); break; } RESET_FLAGS(emu); } uintptr_t GetSegmentBaseEmu(x86emu_t* emu, int seg) { if(emu->segs_serial[seg] != emu->context->sel_serial) { emu->segs_offs[seg] = (uintptr_t)GetSegmentBase(emu->segs[seg]); emu->segs_serial[seg] = emu->context->sel_serial; } return emu->segs_offs[seg]; } const char* getAddrFunctionName(uintptr_t addr) { static char ret[1000]; uint32_t sz = 0; uintptr_t start = 0; const char* symbname = FindNearestSymbolName(FindElfAddress(my_context, addr), (void*)addr, &start, &sz); if(symbname && addr>=start && (addr<(start+sz) || !sz)) { if(addr==start) sprintf(ret, "%s/%s", ElfName(FindElfAddress(my_context, addr)), symbname); else sprintf(ret, "%s/%s + %d", ElfName(FindElfAddress(my_context, addr)), symbname, addr - start); } else sprintf(ret, "???"); return ret; } void printFunctionAddr(uintptr_t nextaddr, const char* text) { uint32_t sz = 0; uintptr_t start = 0; const char* symbname = FindNearestSymbolName(FindElfAddress(my_context, nextaddr), (void*)nextaddr, &start, &sz); if(symbname && nextaddr>=start && (nextaddr<(start+sz) || !sz)) { if(nextaddr==start) printf_log(LOG_NONE, " (%s%s/%s)", text, ElfName(FindElfAddress(my_context, nextaddr)), symbname); else printf_log(LOG_NONE, " (%s%s/%s + %d)", text, ElfName(FindElfAddress(my_context, nextaddr)), symbname, nextaddr - start); } } #ifdef HAVE_TRACE extern uint64_t start_cnt; #define PK(a) (*(uint8_t*)(ip+a)) #define PK32(a) (*(int32_t*)((uint8_t*)(ip+a))) void PrintTrace(x86emu_t* emu, uintptr_t ip, int dynarec) { if(start_cnt) --start_cnt; if(!start_cnt && my_context->dec && ( (trace_end == 0) || ((ip >= trace_start) && (ip < trace_end))) ) { int tid = syscall(SYS_gettid); pthread_mutex_lock(&my_context->mutex_trace); #ifdef DYNAREC if((my_context->trace_tid != tid) || (my_context->trace_dynarec!=dynarec)) { printf_log(LOG_NONE, "Thread %04d| (%s) |\n", tid, dynarec?"dyn":"int"); my_context->trace_tid = tid; my_context->trace_dynarec = dynarec; } #else if(my_context->trace_tid != tid) { printf_log(LOG_NONE, "Thread %04d|\n", tid); my_context->trace_tid = tid; } #endif printf_log(LOG_NONE, "%s", DumpCPURegs(emu, ip)); if(PK(0)==0xcc && PK(1)=='S' && PK(2)=='C') { uint32_t a = *(uint32_t*)(ip+3); if(a==0) { printf_log(LOG_NONE, "%p: Exit x86emu\n", (void*)ip); } else { printf_log(LOG_NONE, "%p: Native call to %p => %s\n", (void*)ip, (void*)a, GetNativeName(*(void**)(ip+7))); } } else { printf_log(LOG_NONE, "%s", DecodeX86Trace(my_context->dec, ip)); uint8_t peek = PK(0); if(peek==0xC3 || peek==0xC2) { printf_log(LOG_NONE, " => %p", *(void**)(R_ESP)); printFunctionAddr(*(uintptr_t*)(R_ESP), "=> "); } else if(peek==0x55) { printf_log(LOG_NONE, " => STACK_TOP: %p", *(void**)(R_ESP)); printFunctionAddr(ip, "here: "); } else if(peek==0xE8) { // Call uintptr_t nextaddr = ip + 5 + PK32(1); printFunctionAddr(nextaddr, "=> "); } else if(peek==0xFF) { if(PK(1)==0x25) { uintptr_t nextaddr = ip + 6 + PK32(2); printFunctionAddr(nextaddr, "=> "); } } printf_log(LOG_NONE, "\n"); } pthread_mutex_unlock(&my_context->mutex_trace); } } #endif
39.79602
204
0.4985
190504bab829ac979339b9c043cdafc1cd3e2b44
1,467
h
C
msvc/Interaction/Style/vtkInteractionStyleObjectFactory.h
gajgeospatial/VTK-9.0.1
8ab2c0f8852f26598d950c9c7e514947b6855a41
[ "BSD-3-Clause" ]
null
null
null
msvc/Interaction/Style/vtkInteractionStyleObjectFactory.h
gajgeospatial/VTK-9.0.1
8ab2c0f8852f26598d950c9c7e514947b6855a41
[ "BSD-3-Clause" ]
null
null
null
msvc/Interaction/Style/vtkInteractionStyleObjectFactory.h
gajgeospatial/VTK-9.0.1
8ab2c0f8852f26598d950c9c7e514947b6855a41
[ "BSD-3-Clause" ]
null
null
null
/*========================================================================= Program: Visualization Toolkit Module: vtkInteractionStyleObjectFactory.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm 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 notice for more information. =========================================================================*/ #ifndef vtkInteractionStyleObjectFactory_h #define vtkInteractionStyleObjectFactory_h #include "vtkInteractionStyleModule.h" // For export macro #include "vtkObjectFactory.h" class VTKINTERACTIONSTYLE_EXPORT vtkInteractionStyleObjectFactory : public vtkObjectFactory { public: static vtkInteractionStyleObjectFactory * New(); vtkTypeMacro(vtkInteractionStyleObjectFactory, vtkObjectFactory); const char * GetDescription() override { return "vtkInteractionStyle factory overrides."; } const char * GetVTKSourceVersion() override; void PrintSelf(ostream &os, vtkIndent indent) override; protected: vtkInteractionStyleObjectFactory(); private: vtkInteractionStyleObjectFactory(const vtkInteractionStyleObjectFactory&) = delete; void operator=(const vtkInteractionStyleObjectFactory&) = delete; }; #endif // vtkInteractionStyleObjectFactory_h
34.116279
93
0.721881
d6bbb2050c7e5a2b9ad201708481c46a80bd5594
2,468
c
C
main/main.c
Light411/esp32-edge-firmware
610f44a030f04878ab23458de56dbbd6451434f3
[ "Apache-2.0" ]
9
2021-03-18T11:01:21.000Z
2022-03-29T10:59:30.000Z
main/main.c
Light411/esp32-edge-firmware
610f44a030f04878ab23458de56dbbd6451434f3
[ "Apache-2.0" ]
12
2020-12-04T19:28:14.000Z
2021-09-02T13:47:07.000Z
main/main.c
Light411/esp32-edge-firmware
610f44a030f04878ab23458de56dbbd6451434f3
[ "Apache-2.0" ]
8
2021-02-07T11:41:39.000Z
2022-03-19T15:20:01.000Z
/* * Copyright (c) The Libre Solar Project Contributors * * SPDX-License-Identifier: Apache-2.0 */ #ifndef UNIT_TEST #include <stdio.h> #include <stdlib.h> #include <string.h> #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "freertos/event_groups.h" #include "esp_system.h" #include "esp_wifi.h" #include "esp_event.h" #include "esp_err.h" #include "esp_log.h" #include "esp_netif.h" #include "driver/gpio.h" #include "nvs_flash.h" #include "sdkconfig.h" #include "lwip/err.h" #include "lwip/sockets.h" #include "lwip/sys.h" #include "lwip/netdb.h" #include "lwip/dns.h" #include "ts_serial.h" #include "ts_client.h" #include "ts_mqtt.h" #include "can.h" #include "emoncms.h" #include "wifi.h" #include "web_fs.h" #include "web_server.h" #include "provisioning.h" #include "data_nodes.h" #include "ota.h" #define RX_TASK_PRIO 9 // receiving task priority extern EmoncmsConfig emon_config; extern MqttConfig mqtt_config; extern GeneralConfig general_config; void app_main(void) { esp_ota_check_image(); ESP_ERROR_CHECK(nvs_flash_init()); ESP_ERROR_CHECK(esp_netif_init()); ESP_ERROR_CHECK(esp_event_loop_create_default()); data_nodes_init(); // configure the LED pad as GPIO and set direction gpio_pad_select_gpio(CONFIG_GPIO_LED); gpio_set_direction(CONFIG_GPIO_LED, GPIO_MODE_OUTPUT); gpio_set_level(CONFIG_GPIO_LED, 1); // wait 3s to open serial terminal after flashing finished vTaskDelay(3000 / portTICK_PERIOD_MS); printf("Booting Libre Solar ESP32 Edge...\n"); init_fs(); ts_devices_init(); if (general_config.ts_can_active) { can_setup(); xTaskCreatePinnedToCore(can_receive_task, "CAN_rx", 4096, NULL, RX_TASK_PRIO, NULL, 1); } if (general_config.ts_serial_active) { ts_serial_setup(); xTaskCreatePinnedToCore(ts_serial_rx_task, "ts_serial_rx", 4096, NULL, RX_TASK_PRIO, NULL, 1); ts_devices_scan_serial(); } if (strlen(general_config.wifi_ssid) > 0) { wifi_connect(); } else { // no hard-coded WiFi credentials --> start provisioning via BLE provision(); } start_web_server("/www"); if (emon_config.active) { xTaskCreate(&emoncms_post_task, "emoncms_post_task", 4096, NULL, 5, NULL); } if (mqtt_config.active) { xTaskCreate(&ts_mqtt_pub_task, "mqtt_pub", 4096, NULL, 5, NULL); } } #endif //unit tests
23.961165
82
0.690438
683ef2807f731c014b7242508f785f760c6ccbb5
1,523
h
C
HomeKitDaemon.framework/HMDCompanionManager.h
reels-research/iOS-Private-Frameworks
9a4f4534939310a51fdbf5a439dd22487efb0f01
[ "MIT" ]
4
2021-10-06T12:15:26.000Z
2022-02-21T02:26:00.000Z
HomeKitDaemon.framework/HMDCompanionManager.h
reels-research/iOS-Private-Frameworks
9a4f4534939310a51fdbf5a439dd22487efb0f01
[ "MIT" ]
null
null
null
HomeKitDaemon.framework/HMDCompanionManager.h
reels-research/iOS-Private-Frameworks
9a4f4534939310a51fdbf5a439dd22487efb0f01
[ "MIT" ]
1
2021-10-08T07:40:53.000Z
2021-10-08T07:40:53.000Z
/* Generated by RuntimeBrowser Image: /System/Library/PrivateFrameworks/HomeKitDaemon.framework/HomeKitDaemon */ @interface HMDCompanionManager : HMFObject <HMFLogging, IDSServiceDelegate> { NSObject<OS_dispatch_queue> * _clientQueue; HMDDevice * _companion; <HMDCompanionManagerDelegate> * _delegate; NSObject<OS_dispatch_queue> * _propertyQueue; IDSService * _service; } @property (nonatomic, readonly) NSObject<OS_dispatch_queue> *clientQueue; @property (nonatomic, retain) HMDDevice *companion; @property (readonly, copy) NSString *debugDescription; @property <HMDCompanionManagerDelegate> *delegate; @property (readonly, copy) NSString *description; @property (readonly) unsigned long long hash; @property (nonatomic, readonly) NSObject<OS_dispatch_queue> *propertyQueue; @property (nonatomic, readonly) IDSService *service; @property (readonly) Class superclass; + (bool)isCompatibleCompanionDevice:(id)arg1; + (id)logCategory; + (id)shortDescription; - (void).cxx_destruct; - (void)__initializeConnectedDevices; - (void)_updateConnectedDevices:(id)arg1; - (id)clientQueue; - (id)companion; - (id)debugDescription; - (id)delegate; - (id)description; - (id)descriptionWithPointer:(bool)arg1; - (id)init; - (void)notifyDelegateOfCompanionChange:(id)arg1; - (id)propertyQueue; - (id)service; - (void)service:(id)arg1 connectedDevicesChanged:(id)arg2; - (void)service:(id)arg1 devicesChanged:(id)arg2; - (void)setCompanion:(id)arg1; - (void)setDelegate:(id)arg1; - (id)shortDescription; @end
32.404255
81
0.77019
ca27680181232a0a27c9c6b5373f382baae928b4
90,317
h
C
uC-LIB/Source/lib_mem.h
xiangxud/Micrium
47dcb42045461fc16cc10785bb8aa4a1af8e9629
[ "MIT" ]
null
null
null
uC-LIB/Source/lib_mem.h
xiangxud/Micrium
47dcb42045461fc16cc10785bb8aa4a1af8e9629
[ "MIT" ]
null
null
null
uC-LIB/Source/lib_mem.h
xiangxud/Micrium
47dcb42045461fc16cc10785bb8aa4a1af8e9629
[ "MIT" ]
1
2021-12-20T18:28:34.000Z
2021-12-20T18:28:34.000Z
/* ********************************************************************************************************* * uC/LIB * Custom Library Modules * * (c) Copyright 2004-2019; Silicon Laboratories Inc., * 400 W. Cesar Chavez, Austin, TX 78701 * * All rights reserved. Protected by international copyright laws. * * Your use of this software is subject to your acceptance of the terms * of a Silicon Labs Micrium software license, which can be obtained by * contacting info@micrium.com. If you do not agree to the terms of this * license, you may not use this software. * * Please help us continue to provide the Embedded community with the finest * software available. Your honesty is greatly appreciated. * * You can find our product's documentation at: doc.micrium.com * * For more information visit us at: www.micrium.com ********************************************************************************************************* */ /* ********************************************************************************************************* * * STANDARD MEMORY OPERATIONS * * Filename : lib_mem.h * Version : V1.38.03 ********************************************************************************************************* * Note(s) : (1) NO compiler-supplied standard library functions are used in library or product software. * * (a) ALL standard library functions are implemented in the custom library modules : * * (1) \<Custom Library Directory>\lib_*.* * * (2) \<Custom Library Directory>\Ports\<cpu>\<compiler>\lib*_a.* * * where * <Custom Library Directory> directory path for custom library software * <cpu> directory name for specific processor (CPU) * <compiler> directory name for specific compiler * * (b) Product-specific library functions are implemented in individual products. * * (2) Assumes the following versions (or more recent) of software modules are included in * the project build : * * (a) uC/CPU V1.27 ********************************************************************************************************* */ /* ********************************************************************************************************* * MODULE * * Note(s) : (1) This memory library header file is protected from multiple pre-processor inclusion through * use of the memory library module present pre-processor macro definition. ********************************************************************************************************* */ #ifndef LIB_MEM_MODULE_PRESENT /* See Note #1. */ #define LIB_MEM_MODULE_PRESENT /* ********************************************************************************************************* * INCLUDE FILES * * Note(s) : (1) The custom library software files are located in the following directories : * * (a) \<Your Product Application>\lib_cfg.h * * (b) \<Custom Library Directory>\lib_*.* * * where * <Your Product Application> directory path for Your Product's Application * <Custom Library Directory> directory path for custom library software * * (2) CPU-configuration software files are located in the following directories : * * (a) \<CPU-Compiler Directory>\cpu_*.* * (b) \<CPU-Compiler Directory>\<cpu>\<compiler>\cpu*.* * * where * <CPU-Compiler Directory> directory path for common CPU-compiler software * <cpu> directory name for specific processor (CPU) * <compiler> directory name for specific compiler * * (3) Compiler MUST be configured to include as additional include path directories : * * (a) '\<Your Product Application>\' directory See Note #1a * * (b) '\<Custom Library Directory>\' directory See Note #1b * * (c) (1) '\<CPU-Compiler Directory>\' directory See Note #2a * (2) '\<CPU-Compiler Directory>\<cpu>\<compiler>\' directory See Note #2b * * (4) NO compiler-supplied standard library functions SHOULD be used. ********************************************************************************************************* */ #include <lib_def.h> #include <lib_cfg.h> /* ********************************************************************************************************* * EXTERNS ********************************************************************************************************* */ #ifdef LIB_MEM_MODULE #define LIB_MEM_EXT #else #define LIB_MEM_EXT extern #endif /* ********************************************************************************************************* * DEFINES ********************************************************************************************************* */ #define LIB_MEM_PADDING_ALIGN_NONE 1u #define LIB_MEM_BLK_QTY_UNLIMITED 0u /* ********************************************************************************************************* * DEFAULT CONFIGURATION ********************************************************************************************************* */ /* ********************************************************************************************************* * MEMORY LIBRARY ARGUMENT CHECK CONFIGURATION * * Note(s) : (1) Configure LIB_MEM_CFG_ARG_CHK_EXT_EN to enable/disable the memory library suite external * argument check feature : * * (a) When ENABLED, arguments received from any port interface provided by the developer * or application are checked/validated. * * (b) When DISABLED, NO arguments received from any port interface provided by the developer * or application are checked/validated. ********************************************************************************************************* */ /* Cfg external argument check feature (see Note #1) : */ #ifndef LIB_MEM_CFG_ARG_CHK_EXT_EN #define LIB_MEM_CFG_ARG_CHK_EXT_EN DEF_DISABLED /* DEF_DISABLED Argument check DISABLED */ /* DEF_ENABLED Argument check ENABLED */ #endif /* ********************************************************************************************************* * MEMORY LIBRARY ASSEMBLY OPTIMIZATION CONFIGURATION * * Note(s) : (1) Configure LIB_MEM_CFG_OPTIMIZE_ASM_EN to enable/disable assembly-optimized memory * functions. ********************************************************************************************************* */ /* Cfg assembly-optimized function(s) [see Note #1] : */ #ifndef LIB_MEM_CFG_OPTIMIZE_ASM_EN #define LIB_MEM_CFG_OPTIMIZE_ASM_EN DEF_DISABLED /* DEF_DISABLED Assembly-optimized fnct(s) DISABLED */ /* DEF_ENABLED Assembly-optimized fnct(s) ENABLED */ #endif /* ********************************************************************************************************* * MEMORY ALLOCATION DEBUG INFORMATION CONFIGURATION * * Note(s) : (1) Configure LIB_MEM_CFG_DBG_INFO_EN to enable/disable debug information associated to each * segment allocation. ********************************************************************************************************* */ #ifndef LIB_MEM_CFG_DBG_INFO_EN #define LIB_MEM_CFG_DBG_INFO_EN DEF_DISABLED #endif /* ********************************************************************************************************* * HEAP PADDING ALIGN CONFIGURATION * * Note(s) : (1) Configure LIB_MEM_CFG_HEAP_PADDING_ALIGN to set the padding alignment of any buffer * allocated from the heap. ********************************************************************************************************* */ #ifndef LIB_MEM_CFG_HEAP_PADDING_ALIGN #define LIB_MEM_CFG_HEAP_PADDING_ALIGN LIB_MEM_PADDING_ALIGN_NONE #endif /* ********************************************************************************************************* * DATA TYPES ********************************************************************************************************* */ /* ********************************************************************************************************* * LIB MEM TYPE * * Note(s) : (1) 'LIB_MEM_TYPE' declared as 'CPU_INT32U' & all 'LIB_MEM_TYPE's #define'd with large, non-trivial * values to trap & discard invalid/corrupted library memory objects based on 'LIB_MEM_TYPE'. ********************************************************************************************************* */ typedef CPU_INT32U LIB_MEM_TYPE; /* ********************************************************************************************************* * MEMORY POOL BLOCK QUANTITY DATA TYPE ********************************************************************************************************* */ typedef CPU_SIZE_T MEM_POOL_BLK_QTY; /* ********************************************************************************************************* * MEMORY POOL TABLE IX TYPE ********************************************************************************************************* */ typedef MEM_POOL_BLK_QTY MEM_POOL_IX; /* ********************************************************************************************************* * MEMORY ALLOCATION TRACKING INFO DATA TYPE ********************************************************************************************************* */ #if (LIB_MEM_CFG_DBG_INFO_EN == DEF_ENABLED) typedef struct mem_alloc_info MEM_ALLOC_INFO; struct mem_alloc_info { /* ------------------ MEM ALLOC INFO ------------------ */ const CPU_CHAR *NamePtr; /* Ptr to name. */ CPU_SIZE_T Size; /* Total alloc'd size, in bytes. */ MEM_ALLOC_INFO *NextPtr; /* Ptr to next alloc info in list. */ }; #endif /* ********************************************************************************************************* * MEMORY SEGMENTS DATA TYPES ********************************************************************************************************* */ typedef struct mem_seg MEM_SEG; /* --------------------- SEG DATA --------------------- */ struct mem_seg { CPU_ADDR AddrBase; /* Seg start addr. */ CPU_ADDR AddrEnd; /* Seg end addr (last addr). */ CPU_ADDR AddrNext; /* Next free addr. */ MEM_SEG *NextPtr; /* Ptr to next seg. */ CPU_SIZE_T PaddingAlign; /* Padding alignment in byte. */ #if (LIB_MEM_CFG_DBG_INFO_EN == DEF_ENABLED) const CPU_CHAR *NamePtr; /* Ptr to seg name. */ MEM_ALLOC_INFO *AllocInfoHeadPtr; /* Ptr to head of alloc info struct list. */ #endif }; typedef struct mem_seg_info { /* --------------------- SEG INFO --------------------- */ CPU_SIZE_T UsedSize; /* Used size, independently of alignment. */ CPU_SIZE_T TotalSize; /* Total seg capacity, in octets. */ CPU_ADDR AddrBase; CPU_ADDR AddrNextAlloc; /* Next aligned address, 0 if none available. */ } MEM_SEG_INFO; /* ********************************************************************************************************* * (STATIC) MEMORY POOL DATA TYPES * * Note(s) : (1) Free static memory pool blocks are indexed in the 'BlkFreeTbl' table. Newly freed blocks * are added at the first available position in the table and blocks are retrieved from the * last occupied position, in a LIFO fashion. * * /-------------------------------\ * |/------------\ | * BlkFreeTbl || Start v v End * /--------\ || /--------------------------------------------\ * |p_free_1|---/| | | | | | | * |--------| | \--------------------------------------------/ * |p_free_2|----/ ^ | | * |--------| | |__Blk___| * |p_free_3|--------/ (Next block to be retrieved.) Size * |--------| * | |<-------- (Next block to be freed.) * \--------/ * ********************************************************************************************************* */ /* --------------------- MEM POOL --------------------- */ typedef struct mem_pool { void *PoolAddrStart; /* Ptr to start of mem seg for mem pool blks. */ void *PoolAddrEnd; /* Ptr to end of mem seg for mem pool blks. */ MEM_POOL_BLK_QTY BlkNbr; /* Nbr of mem pool blks. */ CPU_SIZE_T BlkSize; /* Size of mem pool blks (in octets). */ void **BlkFreeTbl; /* Tbl of free mem pool blks. */ CPU_SIZE_T BlkFreeTblIx; /* Ix of next free blk free tbl entry. */ } MEM_POOL; /* ********************************************************************************************************* * DYNAMIC MEMORY POOL DATA TYPE * * Note(s) : (1) Dynamic memory pool blocks are not indexed in a table. Only freed blocks are linked using * a singly linked list, in a LIFO fashion; newly freed blocks are inserted at the head of the * list and blocks are also retrieved from the head of the list. * * (2) Pointers to the next block are only present when a block is free, using the first location * in the allocated memory block. The user of dynamic memory pool must not assume his data * will not be overwritten when a block is freed. * * /----------------\ * /----------\ | /----------\ | /----------\ /----------\ * BlkFreePtr-->|(NextPtr) |---/ | | \--->|(NextPtr) |-->|(NextPtr) |--> DEF_NULL * |----------| | Blk in | |----------| |----------| * | | | use | | | | | * | | | | | | | | * \----------/ \----------/ \----------/ \----------/ * ********************************************************************************************************* */ typedef struct mem_dyn_pool { /* ---------------- DYN MEM POOL DATA ----------------- */ MEM_SEG *PoolSegPtr; /* Mem pool from which blks are alloc'd. */ CPU_SIZE_T BlkSize; /* Size of pool blks, in octets. */ CPU_SIZE_T BlkAlign; /* Align req'd for blks, in octets. */ CPU_SIZE_T BlkPaddingAlign; /* Padding alignment in bytes for this mem seg. */ void *BlkFreePtr; /* Ptr to first free blk. */ CPU_SIZE_T BlkQtyMax; /* Max qty of blk in dyn mem pool. 0 = unlimited. */ CPU_SIZE_T BlkAllocCnt; /* Cnt of alloc blk. */ #if (LIB_MEM_CFG_DBG_INFO_EN == DEF_ENABLED) const CPU_CHAR *NamePtr; /* Ptr to mem pool name. */ #endif } MEM_DYN_POOL; /* ********************************************************************************************************* * GLOBAL VARIABLES ********************************************************************************************************* */ /* ********************************************************************************************************* * MACRO'S ********************************************************************************************************* */ /* ********************************************************************************************************* * MEMORY DATA VALUE MACRO'S * * Note(s) : (1) (a) Some variables & variable buffers to pass & receive data values MUST start on appropriate * CPU word-aligned addresses. This is required because most word-aligned processors are more * efficient & may even REQUIRE that multi-octet words start on CPU word-aligned addresses. * * (1) For 16-bit word-aligned processors, this means that * * all 16- & 32-bit words MUST start on addresses that are multiples of 2 octets * * (2) For 32-bit word-aligned processors, this means that * * all 16-bit words MUST start on addresses that are multiples of 2 octets * all 32-bit words MUST start on addresses that are multiples of 4 octets * * (b) However, some data values macro's appropriately access data values from any CPU addresses, * word-aligned or not. Thus for processors that require data word alignment, data words can * be accessed to/from any CPU address, word-aligned or not, without generating data-word- * alignment exceptions/faults. ********************************************************************************************************* */ /* ********************************************************************************************************* * ENDIAN WORD ORDER MACRO'S * * Description : Convert data values to & from big-, little, or host-endian CPU word order. * * Argument(s) : val Data value to convert (see Notes #1 & #2). * * Return(s) : Converted data value (see Notes #1 & #2). * * Caller(s) : Application. * * Note(s) : (1) Convert data values to the desired data-word order : * * MEM_VAL_BIG_TO_LITTLE_xx() Convert big- endian data values * to little- endian data values * MEM_VAL_LITTLE_TO_BIG_xx() Convert little- endian data values * to big- endian data values * MEM_VAL_xxx_TO_HOST_xx() Convert big-/little-endian data values * to host- endian data values * MEM_VAL_HOST_TO_xxx_xx() Convert host- endian data values * to big-/little-endian data values * * See also 'cpu.h CPU WORD CONFIGURATION Note #2'. * * (2) 'val' data value to convert & any variable to receive the returned conversion MUST * start on appropriate CPU word-aligned addresses. * * See also 'MEMORY DATA VALUE MACRO'S Note #1a'. * * (3) MEM_VAL_COPY_xxx() macro's are more efficient than generic endian word order macro's & * are also independent of CPU data-word-alignment & SHOULD be used whenever possible. * * See also 'MEM_VAL_COPY_GET_xxx() Note #4' * & 'MEM_VAL_COPY_SET_xxx() Note #4'. * * (4) Generic endian word order macro's are NOT atomic operations & MUST NOT be used on any * non-static (i.e. volatile) variables, registers, hardware, etc.; without the caller of * the macro's providing some form of additional protection (e.g. mutual exclusion). * * (5) The 'CPU_CFG_ENDIAN_TYPE' pre-processor 'else'-conditional code SHOULD never be compiled/ * linked since each 'cpu.h' SHOULD ensure that the CPU data-word-memory order configuration * constant (CPU_CFG_ENDIAN_TYPE) is configured with an appropriate data-word-memory order * value (see 'cpu.h CPU WORD CONFIGURATION Note #2'). The 'else'-conditional code is * included as an extra precaution in case 'cpu.h' is incorrectly configured. ********************************************************************************************************* */ #if ((CPU_CFG_DATA_SIZE == CPU_WORD_SIZE_64) || \ (CPU_CFG_DATA_SIZE == CPU_WORD_SIZE_32)) #define MEM_VAL_BIG_TO_LITTLE_16(val) ((CPU_INT16U)(((CPU_INT16U)((((CPU_INT16U)(val)) & (CPU_INT16U) 0xFF00u) >> (1u * DEF_OCTET_NBR_BITS))) | \ ((CPU_INT16U)((((CPU_INT16U)(val)) & (CPU_INT16U) 0x00FFu) << (1u * DEF_OCTET_NBR_BITS))))) #define MEM_VAL_BIG_TO_LITTLE_32(val) ((CPU_INT32U)(((CPU_INT32U)((((CPU_INT32U)(val)) & (CPU_INT32U)0xFF000000u) >> (3u * DEF_OCTET_NBR_BITS))) | \ ((CPU_INT32U)((((CPU_INT32U)(val)) & (CPU_INT32U)0x00FF0000u) >> (1u * DEF_OCTET_NBR_BITS))) | \ ((CPU_INT32U)((((CPU_INT32U)(val)) & (CPU_INT32U)0x0000FF00u) << (1u * DEF_OCTET_NBR_BITS))) | \ ((CPU_INT32U)((((CPU_INT32U)(val)) & (CPU_INT32U)0x000000FFu) << (3u * DEF_OCTET_NBR_BITS))))) #elif (CPU_CFG_DATA_SIZE == CPU_WORD_SIZE_16) #define MEM_VAL_BIG_TO_LITTLE_16(val) ((CPU_INT16U)(((CPU_INT16U)((((CPU_INT16U)(val)) & (CPU_INT16U) 0xFF00u) >> (1u * DEF_OCTET_NBR_BITS))) | \ ((CPU_INT16U)((((CPU_INT16U)(val)) & (CPU_INT16U) 0x00FFu) << (1u * DEF_OCTET_NBR_BITS))))) #define MEM_VAL_BIG_TO_LITTLE_32(val) ((CPU_INT32U)(((CPU_INT32U)((((CPU_INT32U)(val)) & (CPU_INT32U)0xFF000000u) >> (1u * DEF_OCTET_NBR_BITS))) | \ ((CPU_INT32U)((((CPU_INT32U)(val)) & (CPU_INT32U)0x00FF0000u) << (1u * DEF_OCTET_NBR_BITS))) | \ ((CPU_INT32U)((((CPU_INT32U)(val)) & (CPU_INT32U)0x0000FF00u) >> (1u * DEF_OCTET_NBR_BITS))) | \ ((CPU_INT32U)((((CPU_INT32U)(val)) & (CPU_INT32U)0x000000FFu) << (1u * DEF_OCTET_NBR_BITS))))) #else #define MEM_VAL_BIG_TO_LITTLE_16(val) (val) #define MEM_VAL_BIG_TO_LITTLE_32(val) (val) #endif #define MEM_VAL_LITTLE_TO_BIG_16(val) MEM_VAL_BIG_TO_LITTLE_16(val) #define MEM_VAL_LITTLE_TO_BIG_32(val) MEM_VAL_BIG_TO_LITTLE_32(val) #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG) #define MEM_VAL_BIG_TO_HOST_16(val) (val) #define MEM_VAL_BIG_TO_HOST_32(val) (val) #define MEM_VAL_LITTLE_TO_HOST_16(val) MEM_VAL_LITTLE_TO_BIG_16(val) #define MEM_VAL_LITTLE_TO_HOST_32(val) MEM_VAL_LITTLE_TO_BIG_32(val) #elif (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_LITTLE) #define MEM_VAL_BIG_TO_HOST_16(val) MEM_VAL_BIG_TO_LITTLE_16(val) #define MEM_VAL_BIG_TO_HOST_32(val) MEM_VAL_BIG_TO_LITTLE_32(val) #define MEM_VAL_LITTLE_TO_HOST_16(val) (val) #define MEM_VAL_LITTLE_TO_HOST_32(val) (val) #else /* See Note #5. */ #error "CPU_CFG_ENDIAN_TYPE illegally #defined in 'cpu.h' " #error " [See 'cpu.h CONFIGURATION ERRORS']" #endif #define MEM_VAL_HOST_TO_BIG_16(val) MEM_VAL_BIG_TO_HOST_16(val) #define MEM_VAL_HOST_TO_BIG_32(val) MEM_VAL_BIG_TO_HOST_32(val) #define MEM_VAL_HOST_TO_LITTLE_16(val) MEM_VAL_LITTLE_TO_HOST_16(val) #define MEM_VAL_HOST_TO_LITTLE_32(val) MEM_VAL_LITTLE_TO_HOST_32(val) /* ********************************************************************************************************* * MEM_VAL_GET_xxx() * * Description : Decode data values from any CPU memory address. * * Argument(s) : addr Lowest CPU memory address of data value to decode (see Notes #2 & #3a). * * Return(s) : Decoded data value from CPU memory address (see Notes #1 & #3b). * * Caller(s) : Application. * * Note(s) : (1) Decode data values based on the values' data-word order in CPU memory : * * MEM_VAL_GET_xxx_BIG() Decode big- endian data values -- data words' most * significant octet @ lowest memory address * MEM_VAL_GET_xxx_LITTLE() Decode little-endian data values -- data words' least * significant octet @ lowest memory address * MEM_VAL_GET_xxx() Decode data values using CPU's native or configured * data-word order * * See also 'cpu.h CPU WORD CONFIGURATION Note #2'. * * (2) CPU memory addresses/pointers NOT checked for NULL. * * (3) (a) MEM_VAL_GET_xxx() macro's decode data values without regard to CPU word-aligned addresses. * Thus for processors that require data word alignment, data words can be decoded from any * CPU address, word-aligned or not, without generating data-word-alignment exceptions/faults. * * (b) However, any variable to receive the returned data value MUST start on an appropriate CPU * word-aligned address. * * See also 'MEMORY DATA VALUE MACRO'S Note #1'. * * (4) MEM_VAL_COPY_GET_xxx() macro's are more efficient than MEM_VAL_GET_xxx() macro's & are * also independent of CPU data-word-alignment & SHOULD be used whenever possible. * * See also 'MEM_VAL_COPY_GET_xxx() Note #4'. * * (5) MEM_VAL_GET_xxx() macro's are NOT atomic operations & MUST NOT be used on any non-static * (i.e. volatile) variables, registers, hardware, etc.; without the caller of the macro's * providing some form of additional protection (e.g. mutual exclusion). * * (6) The 'CPU_CFG_ENDIAN_TYPE' pre-processor 'else'-conditional code SHOULD never be compiled/ * linked since each 'cpu.h' SHOULD ensure that the CPU data-word-memory order configuration * constant (CPU_CFG_ENDIAN_TYPE) is configured with an appropriate data-word-memory order * value (see 'cpu.h CPU WORD CONFIGURATION Note #2'). The 'else'-conditional code is * included as an extra precaution in case 'cpu.h' is incorrectly configured. ********************************************************************************************************* */ #define MEM_VAL_GET_INT08U_BIG(addr) ((CPU_INT08U) ((CPU_INT08U)(((CPU_INT08U)(*(((CPU_INT08U *)(addr)) + 0))) << (0u * DEF_OCTET_NBR_BITS)))) #define MEM_VAL_GET_INT16U_BIG(addr) ((CPU_INT16U)(((CPU_INT16U)(((CPU_INT16U)(*(((CPU_INT08U *)(addr)) + 0))) << (1u * DEF_OCTET_NBR_BITS))) + \ ((CPU_INT16U)(((CPU_INT16U)(*(((CPU_INT08U *)(addr)) + 1))) << (0u * DEF_OCTET_NBR_BITS))))) #define MEM_VAL_GET_INT24U_BIG(addr) ((CPU_INT32U)(((CPU_INT32U)(((CPU_INT32U)(*(((CPU_INT08U *)(addr)) + 0))) << (2u * DEF_OCTET_NBR_BITS))) + \ ((CPU_INT32U)(((CPU_INT32U)(*(((CPU_INT08U *)(addr)) + 1))) << (1u * DEF_OCTET_NBR_BITS))) + \ ((CPU_INT32U)(((CPU_INT32U)(*(((CPU_INT08U *)(addr)) + 2))) << (0u * DEF_OCTET_NBR_BITS))))) #define MEM_VAL_GET_INT32U_BIG(addr) ((CPU_INT32U)(((CPU_INT32U)(((CPU_INT32U)(*(((CPU_INT08U *)(addr)) + 0))) << (3u * DEF_OCTET_NBR_BITS))) + \ ((CPU_INT32U)(((CPU_INT32U)(*(((CPU_INT08U *)(addr)) + 1))) << (2u * DEF_OCTET_NBR_BITS))) + \ ((CPU_INT32U)(((CPU_INT32U)(*(((CPU_INT08U *)(addr)) + 2))) << (1u * DEF_OCTET_NBR_BITS))) + \ ((CPU_INT32U)(((CPU_INT32U)(*(((CPU_INT08U *)(addr)) + 3))) << (0u * DEF_OCTET_NBR_BITS))))) #define MEM_VAL_GET_INT08U_LITTLE(addr) ((CPU_INT08U) ((CPU_INT08U)(((CPU_INT08U)(*(((CPU_INT08U *)(addr)) + 0))) << (0u * DEF_OCTET_NBR_BITS)))) #define MEM_VAL_GET_INT16U_LITTLE(addr) ((CPU_INT16U)(((CPU_INT16U)(((CPU_INT16U)(*(((CPU_INT08U *)(addr)) + 0))) << (0u * DEF_OCTET_NBR_BITS))) + \ ((CPU_INT16U)(((CPU_INT16U)(*(((CPU_INT08U *)(addr)) + 1))) << (1u * DEF_OCTET_NBR_BITS))))) #define MEM_VAL_GET_INT24U_LITTLE(addr) ((CPU_INT32U)(((CPU_INT32U)(((CPU_INT32U)(*(((CPU_INT08U *)(addr)) + 0))) << (0u * DEF_OCTET_NBR_BITS))) + \ ((CPU_INT32U)(((CPU_INT32U)(*(((CPU_INT08U *)(addr)) + 1))) << (1u * DEF_OCTET_NBR_BITS))) + \ ((CPU_INT32U)(((CPU_INT32U)(*(((CPU_INT08U *)(addr)) + 2))) << (2u * DEF_OCTET_NBR_BITS))))) #define MEM_VAL_GET_INT32U_LITTLE(addr) ((CPU_INT32U)(((CPU_INT32U)(((CPU_INT32U)(*(((CPU_INT08U *)(addr)) + 0))) << (0u * DEF_OCTET_NBR_BITS))) + \ ((CPU_INT32U)(((CPU_INT32U)(*(((CPU_INT08U *)(addr)) + 1))) << (1u * DEF_OCTET_NBR_BITS))) + \ ((CPU_INT32U)(((CPU_INT32U)(*(((CPU_INT08U *)(addr)) + 2))) << (2u * DEF_OCTET_NBR_BITS))) + \ ((CPU_INT32U)(((CPU_INT32U)(*(((CPU_INT08U *)(addr)) + 3))) << (3u * DEF_OCTET_NBR_BITS))))) #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG) #define MEM_VAL_GET_INT08U(addr) MEM_VAL_GET_INT08U_BIG(addr) #define MEM_VAL_GET_INT16U(addr) MEM_VAL_GET_INT16U_BIG(addr) #define MEM_VAL_GET_INT24U(addr) MEM_VAL_GET_INT24U_BIG(addr) #define MEM_VAL_GET_INT32U(addr) MEM_VAL_GET_INT32U_BIG(addr) #elif (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_LITTLE) #define MEM_VAL_GET_INT08U(addr) MEM_VAL_GET_INT08U_LITTLE(addr) #define MEM_VAL_GET_INT16U(addr) MEM_VAL_GET_INT16U_LITTLE(addr) #define MEM_VAL_GET_INT24U(addr) MEM_VAL_GET_INT24U_LITTLE(addr) #define MEM_VAL_GET_INT32U(addr) MEM_VAL_GET_INT32U_LITTLE(addr) #else /* See Note #6. */ #error "CPU_CFG_ENDIAN_TYPE illegally #defined in 'cpu.h' " #error " [See 'cpu.h CONFIGURATION ERRORS']" #endif /* ********************************************************************************************************* * MEM_VAL_SET_xxx() * * Description : Encode data values to any CPU memory address. * * Argument(s) : addr Lowest CPU memory address to encode data value (see Notes #2 & #3a). * * val Data value to encode (see Notes #1 & #3b). * * Return(s) : none. * * Caller(s) : Application. * * Note(s) : (1) Encode data values into CPU memory based on the values' data-word order : * * MEM_VAL_SET_xxx_BIG() Encode big- endian data values -- data words' most * significant octet @ lowest memory address * MEM_VAL_SET_xxx_LITTLE() Encode little-endian data values -- data words' least * significant octet @ lowest memory address * MEM_VAL_SET_xxx() Encode data values using CPU's native or configured * data-word order * * See also 'cpu.h CPU WORD CONFIGURATION Note #2'. * * (2) CPU memory addresses/pointers NOT checked for NULL. * * (3) (a) MEM_VAL_SET_xxx() macro's encode data values without regard to CPU word-aligned addresses. * Thus for processors that require data word alignment, data words can be encoded to any * CPU address, word-aligned or not, without generating data-word-alignment exceptions/faults. * * (b) However, 'val' data value to encode MUST start on an appropriate CPU word-aligned address. * * See also 'MEMORY DATA VALUE MACRO'S Note #1'. * * (4) MEM_VAL_COPY_SET_xxx() macro's are more efficient than MEM_VAL_SET_xxx() macro's & are * also independent of CPU data-word-alignment & SHOULD be used whenever possible. * * See also 'MEM_VAL_COPY_SET_xxx() Note #4'. * * (5) MEM_VAL_SET_xxx() macro's are NOT atomic operations & MUST NOT be used on any non-static * (i.e. volatile) variables, registers, hardware, etc.; without the caller of the macro's * providing some form of additional protection (e.g. mutual exclusion). * * (6) The 'CPU_CFG_ENDIAN_TYPE' pre-processor 'else'-conditional code SHOULD never be compiled/ * linked since each 'cpu.h' SHOULD ensure that the CPU data-word-memory order configuration * constant (CPU_CFG_ENDIAN_TYPE) is configured with an appropriate data-word-memory order * value (see 'cpu.h CPU WORD CONFIGURATION Note #2'). The 'else'-conditional code is * included as an extra precaution in case 'cpu.h' is incorrectly configured. ********************************************************************************************************* */ #define MEM_VAL_SET_INT08U_BIG(addr, val) do { (*(((CPU_INT08U *)(addr)) + 0)) = ((CPU_INT08U)((((CPU_INT08U)(val)) & (CPU_INT08U) 0xFFu) >> (0u * DEF_OCTET_NBR_BITS))); } while (0) #define MEM_VAL_SET_INT16U_BIG(addr, val) do { (*(((CPU_INT08U *)(addr)) + 0)) = ((CPU_INT08U)((((CPU_INT16U)(val)) & (CPU_INT16U) 0xFF00u) >> (1u * DEF_OCTET_NBR_BITS))); \ (*(((CPU_INT08U *)(addr)) + 1)) = ((CPU_INT08U)((((CPU_INT16U)(val)) & (CPU_INT16U) 0x00FFu) >> (0u * DEF_OCTET_NBR_BITS))); } while (0) #define MEM_VAL_SET_INT24U_BIG(addr, val) do { (*(((CPU_INT08U *)(addr)) + 0)) = ((CPU_INT08U)((((CPU_INT32U)(val)) & (CPU_INT32U) 0xFF0000u) >> (2u * DEF_OCTET_NBR_BITS))); \ (*(((CPU_INT08U *)(addr)) + 1)) = ((CPU_INT08U)((((CPU_INT32U)(val)) & (CPU_INT32U) 0x00FF00u) >> (1u * DEF_OCTET_NBR_BITS))); \ (*(((CPU_INT08U *)(addr)) + 2)) = ((CPU_INT08U)((((CPU_INT32U)(val)) & (CPU_INT32U) 0x0000FFu) >> (0u * DEF_OCTET_NBR_BITS))); } while (0) #define MEM_VAL_SET_INT32U_BIG(addr, val) do { (*(((CPU_INT08U *)(addr)) + 0)) = ((CPU_INT08U)((((CPU_INT32U)(val)) & (CPU_INT32U)0xFF000000u) >> (3u * DEF_OCTET_NBR_BITS))); \ (*(((CPU_INT08U *)(addr)) + 1)) = ((CPU_INT08U)((((CPU_INT32U)(val)) & (CPU_INT32U)0x00FF0000u) >> (2u * DEF_OCTET_NBR_BITS))); \ (*(((CPU_INT08U *)(addr)) + 2)) = ((CPU_INT08U)((((CPU_INT32U)(val)) & (CPU_INT32U)0x0000FF00u) >> (1u * DEF_OCTET_NBR_BITS))); \ (*(((CPU_INT08U *)(addr)) + 3)) = ((CPU_INT08U)((((CPU_INT32U)(val)) & (CPU_INT32U)0x000000FFu) >> (0u * DEF_OCTET_NBR_BITS))); } while (0) #define MEM_VAL_SET_INT08U_LITTLE(addr, val) do { (*(((CPU_INT08U *)(addr)) + 0)) = ((CPU_INT08U)((((CPU_INT08U)(val)) & (CPU_INT08U) 0xFFu) >> (0u * DEF_OCTET_NBR_BITS))); } while (0) #define MEM_VAL_SET_INT16U_LITTLE(addr, val) do { (*(((CPU_INT08U *)(addr)) + 0)) = ((CPU_INT08U)((((CPU_INT16U)(val)) & (CPU_INT16U) 0x00FFu) >> (0u * DEF_OCTET_NBR_BITS))); \ (*(((CPU_INT08U *)(addr)) + 1)) = ((CPU_INT08U)((((CPU_INT16U)(val)) & (CPU_INT16U) 0xFF00u) >> (1u * DEF_OCTET_NBR_BITS))); } while (0) #define MEM_VAL_SET_INT24U_LITTLE(addr, val) do { (*(((CPU_INT08U *)(addr)) + 0)) = ((CPU_INT08U)((((CPU_INT32U)(val)) & (CPU_INT32U) 0x0000FFu) >> (0u * DEF_OCTET_NBR_BITS))); \ (*(((CPU_INT08U *)(addr)) + 1)) = ((CPU_INT08U)((((CPU_INT32U)(val)) & (CPU_INT32U) 0x00FF00u) >> (1u * DEF_OCTET_NBR_BITS))); \ (*(((CPU_INT08U *)(addr)) + 2)) = ((CPU_INT08U)((((CPU_INT32U)(val)) & (CPU_INT32U) 0xFF0000u) >> (2u * DEF_OCTET_NBR_BITS))); } while (0) #define MEM_VAL_SET_INT32U_LITTLE(addr, val) do { (*(((CPU_INT08U *)(addr)) + 0)) = ((CPU_INT08U)((((CPU_INT32U)(val)) & (CPU_INT32U)0x000000FFu) >> (0u * DEF_OCTET_NBR_BITS))); \ (*(((CPU_INT08U *)(addr)) + 1)) = ((CPU_INT08U)((((CPU_INT32U)(val)) & (CPU_INT32U)0x0000FF00u) >> (1u * DEF_OCTET_NBR_BITS))); \ (*(((CPU_INT08U *)(addr)) + 2)) = ((CPU_INT08U)((((CPU_INT32U)(val)) & (CPU_INT32U)0x00FF0000u) >> (2u * DEF_OCTET_NBR_BITS))); \ (*(((CPU_INT08U *)(addr)) + 3)) = ((CPU_INT08U)((((CPU_INT32U)(val)) & (CPU_INT32U)0xFF000000u) >> (3u * DEF_OCTET_NBR_BITS))); } while (0) #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG) #define MEM_VAL_SET_INT08U(addr, val) MEM_VAL_SET_INT08U_BIG(addr, val) #define MEM_VAL_SET_INT16U(addr, val) MEM_VAL_SET_INT16U_BIG(addr, val) #define MEM_VAL_SET_INT24U(addr, val) MEM_VAL_SET_INT24U_BIG(addr, val) #define MEM_VAL_SET_INT32U(addr, val) MEM_VAL_SET_INT32U_BIG(addr, val) #elif (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_LITTLE) #define MEM_VAL_SET_INT08U(addr, val) MEM_VAL_SET_INT08U_LITTLE(addr, val) #define MEM_VAL_SET_INT16U(addr, val) MEM_VAL_SET_INT16U_LITTLE(addr, val) #define MEM_VAL_SET_INT24U(addr, val) MEM_VAL_SET_INT24U_LITTLE(addr, val) #define MEM_VAL_SET_INT32U(addr, val) MEM_VAL_SET_INT32U_LITTLE(addr, val) #else /* See Note #6. */ #error "CPU_CFG_ENDIAN_TYPE illegally #defined in 'cpu.h' " #error " [See 'cpu.h CONFIGURATION ERRORS']" #endif /* ********************************************************************************************************* * MEM_VAL_COPY_GET_xxx() * * Description : Copy & decode data values from any CPU memory address to any CPU memory address. * * Argument(s) : addr_dest Lowest CPU memory address to copy/decode source address's data value * (see Notes #2 & #3). * * addr_src Lowest CPU memory address of data value to copy/decode * (see Notes #2 & #3). * * Return(s) : none. * * Caller(s) : Application. * * Note(s) : (1) Copy/decode data values based on the values' data-word order : * * MEM_VAL_COPY_GET_xxx_BIG() Decode big- endian data values -- data words' most * significant octet @ lowest memory address * MEM_VAL_COPY_GET_xxx_LITTLE() Decode little-endian data values -- data words' least * significant octet @ lowest memory address * MEM_VAL_COPY_GET_xxx() Decode data values using CPU's native or configured * data-word order * * See also 'cpu.h CPU WORD CONFIGURATION Note #2'. * * (2) (a) CPU memory addresses/pointers NOT checked for NULL. * * (b) CPU memory addresses/buffers NOT checked for overlapping. * * (1) IEEE Std 1003.1, 2004 Edition, Section 'memcpy() : DESCRIPTION' states that * "copying ... between objects that overlap ... is undefined". * * (3) MEM_VAL_COPY_GET_xxx() macro's copy/decode data values without regard to CPU word-aligned * addresses. Thus for processors that require data word alignment, data words can be copied/ * decoded to/from any CPU address, word-aligned or not, without generating data-word-alignment * exceptions/faults. * * (4) MEM_VAL_COPY_GET_xxx() macro's are more efficient than MEM_VAL_GET_xxx() macro's & are * also independent of CPU data-word-alignment & SHOULD be used whenever possible. * * See also 'MEM_VAL_GET_xxx() Note #4'. * * (5) Since octet-order copy/conversion are inverse operations, MEM_VAL_COPY_GET_xxx() & * MEM_VAL_COPY_SET_xxx() macros are inverse, but identical, operations & are provided * in both forms for semantics & consistency. * * See also 'MEM_VAL_COPY_SET_xxx() Note #5'. * * (6) MEM_VAL_COPY_GET_xxx() macro's are NOT atomic operations & MUST NOT be used on any non- * static (i.e. volatile) variables, registers, hardware, etc.; without the caller of the * macro's providing some form of additional protection (e.g. mutual exclusion). * * (7) The 'CPU_CFG_ENDIAN_TYPE' pre-processor 'else'-conditional code SHOULD never be compiled/ * linked since each 'cpu.h' SHOULD ensure that the CPU data-word-memory order configuration * constant (CPU_CFG_ENDIAN_TYPE) is configured with an appropriate data-word-memory order * value (see 'cpu.h CPU WORD CONFIGURATION Note #2'). The 'else'-conditional code is * included as an extra precaution in case 'cpu.h' is incorrectly configured. ********************************************************************************************************* */ #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG) #define MEM_VAL_COPY_GET_INT08U_BIG(addr_dest, addr_src) do { (*(((CPU_INT08U *)(addr_dest)) + 0)) = (*(((CPU_INT08U *)(addr_src)) + 0)); } while (0) #define MEM_VAL_COPY_GET_INT16U_BIG(addr_dest, addr_src) do { (*(((CPU_INT08U *)(addr_dest)) + 0)) = (*(((CPU_INT08U *)(addr_src)) + 0)); \ (*(((CPU_INT08U *)(addr_dest)) + 1)) = (*(((CPU_INT08U *)(addr_src)) + 1)); } while (0) #define MEM_VAL_COPY_GET_INT24U_BIG(addr_dest, addr_src) do { (*(((CPU_INT08U *)(addr_dest)) + 0)) = (*(((CPU_INT08U *)(addr_src)) + 0)); \ (*(((CPU_INT08U *)(addr_dest)) + 1)) = (*(((CPU_INT08U *)(addr_src)) + 1)); \ (*(((CPU_INT08U *)(addr_dest)) + 2)) = (*(((CPU_INT08U *)(addr_src)) + 2)); } while (0) #define MEM_VAL_COPY_GET_INT32U_BIG(addr_dest, addr_src) do { (*(((CPU_INT08U *)(addr_dest)) + 0)) = (*(((CPU_INT08U *)(addr_src)) + 0)); \ (*(((CPU_INT08U *)(addr_dest)) + 1)) = (*(((CPU_INT08U *)(addr_src)) + 1)); \ (*(((CPU_INT08U *)(addr_dest)) + 2)) = (*(((CPU_INT08U *)(addr_src)) + 2)); \ (*(((CPU_INT08U *)(addr_dest)) + 3)) = (*(((CPU_INT08U *)(addr_src)) + 3)); } while (0) #define MEM_VAL_COPY_GET_INT08U_LITTLE(addr_dest, addr_src) do { (*(((CPU_INT08U *)(addr_dest)) + 0)) = (*(((CPU_INT08U *)(addr_src)) + 0)); } while (0) #define MEM_VAL_COPY_GET_INT16U_LITTLE(addr_dest, addr_src) do { (*(((CPU_INT08U *)(addr_dest)) + 0)) = (*(((CPU_INT08U *)(addr_src)) + 1)); \ (*(((CPU_INT08U *)(addr_dest)) + 1)) = (*(((CPU_INT08U *)(addr_src)) + 0)); } while (0) #define MEM_VAL_COPY_GET_INT24U_LITTLE(addr_dest, addr_src) do { (*(((CPU_INT08U *)(addr_dest)) + 0)) = (*(((CPU_INT08U *)(addr_src)) + 2)); \ (*(((CPU_INT08U *)(addr_dest)) + 1)) = (*(((CPU_INT08U *)(addr_src)) + 1)); \ (*(((CPU_INT08U *)(addr_dest)) + 2)) = (*(((CPU_INT08U *)(addr_src)) + 0)); } while (0) #define MEM_VAL_COPY_GET_INT32U_LITTLE(addr_dest, addr_src) do { (*(((CPU_INT08U *)(addr_dest)) + 0)) = (*(((CPU_INT08U *)(addr_src)) + 3)); \ (*(((CPU_INT08U *)(addr_dest)) + 1)) = (*(((CPU_INT08U *)(addr_src)) + 2)); \ (*(((CPU_INT08U *)(addr_dest)) + 2)) = (*(((CPU_INT08U *)(addr_src)) + 1)); \ (*(((CPU_INT08U *)(addr_dest)) + 3)) = (*(((CPU_INT08U *)(addr_src)) + 0)); } while (0) #define MEM_VAL_COPY_GET_INT08U(addr_dest, addr_src) MEM_VAL_COPY_GET_INT08U_BIG(addr_dest, addr_src) #define MEM_VAL_COPY_GET_INT16U(addr_dest, addr_src) MEM_VAL_COPY_GET_INT16U_BIG(addr_dest, addr_src) #define MEM_VAL_COPY_GET_INT24U(addr_dest, addr_src) MEM_VAL_COPY_GET_INT24U_BIG(addr_dest, addr_src) #define MEM_VAL_COPY_GET_INT32U(addr_dest, addr_src) MEM_VAL_COPY_GET_INT32U_BIG(addr_dest, addr_src) #elif (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_LITTLE) #define MEM_VAL_COPY_GET_INT08U_BIG(addr_dest, addr_src) do { (*(((CPU_INT08U *)(addr_dest)) + 0)) = (*(((CPU_INT08U *)(addr_src)) + 0)); } while (0) #define MEM_VAL_COPY_GET_INT16U_BIG(addr_dest, addr_src) do { (*(((CPU_INT08U *)(addr_dest)) + 0)) = (*(((CPU_INT08U *)(addr_src)) + 1)); \ (*(((CPU_INT08U *)(addr_dest)) + 1)) = (*(((CPU_INT08U *)(addr_src)) + 0)); } while (0) #define MEM_VAL_COPY_GET_INT24U_BIG(addr_dest, addr_src) do { (*(((CPU_INT08U *)(addr_dest)) + 0)) = (*(((CPU_INT08U *)(addr_src)) + 2)); \ (*(((CPU_INT08U *)(addr_dest)) + 1)) = (*(((CPU_INT08U *)(addr_src)) + 1)); \ (*(((CPU_INT08U *)(addr_dest)) + 2)) = (*(((CPU_INT08U *)(addr_src)) + 0)); } while (0) #define MEM_VAL_COPY_GET_INT32U_BIG(addr_dest, addr_src) do { (*(((CPU_INT08U *)(addr_dest)) + 0)) = (*(((CPU_INT08U *)(addr_src)) + 3)); \ (*(((CPU_INT08U *)(addr_dest)) + 1)) = (*(((CPU_INT08U *)(addr_src)) + 2)); \ (*(((CPU_INT08U *)(addr_dest)) + 2)) = (*(((CPU_INT08U *)(addr_src)) + 1)); \ (*(((CPU_INT08U *)(addr_dest)) + 3)) = (*(((CPU_INT08U *)(addr_src)) + 0)); } while (0) #define MEM_VAL_COPY_GET_INT08U_LITTLE(addr_dest, addr_src) do { (*(((CPU_INT08U *)(addr_dest)) + 0)) = (*(((CPU_INT08U *)(addr_src)) + 0)); } while (0) #define MEM_VAL_COPY_GET_INT16U_LITTLE(addr_dest, addr_src) do { (*(((CPU_INT08U *)(addr_dest)) + 0)) = (*(((CPU_INT08U *)(addr_src)) + 0)); \ (*(((CPU_INT08U *)(addr_dest)) + 1)) = (*(((CPU_INT08U *)(addr_src)) + 1)); } while (0) #define MEM_VAL_COPY_GET_INT24U_LITTLE(addr_dest, addr_src) do { (*(((CPU_INT08U *)(addr_dest)) + 0)) = (*(((CPU_INT08U *)(addr_src)) + 0)); \ (*(((CPU_INT08U *)(addr_dest)) + 1)) = (*(((CPU_INT08U *)(addr_src)) + 1)); \ (*(((CPU_INT08U *)(addr_dest)) + 2)) = (*(((CPU_INT08U *)(addr_src)) + 2)); } while (0) #define MEM_VAL_COPY_GET_INT32U_LITTLE(addr_dest, addr_src) do { (*(((CPU_INT08U *)(addr_dest)) + 0)) = (*(((CPU_INT08U *)(addr_src)) + 0)); \ (*(((CPU_INT08U *)(addr_dest)) + 1)) = (*(((CPU_INT08U *)(addr_src)) + 1)); \ (*(((CPU_INT08U *)(addr_dest)) + 2)) = (*(((CPU_INT08U *)(addr_src)) + 2)); \ (*(((CPU_INT08U *)(addr_dest)) + 3)) = (*(((CPU_INT08U *)(addr_src)) + 3)); } while (0) #define MEM_VAL_COPY_GET_INT08U(addr_dest, addr_src) MEM_VAL_COPY_GET_INT08U_LITTLE(addr_dest, addr_src) #define MEM_VAL_COPY_GET_INT16U(addr_dest, addr_src) MEM_VAL_COPY_GET_INT16U_LITTLE(addr_dest, addr_src) #define MEM_VAL_COPY_GET_INT24U(addr_dest, addr_src) MEM_VAL_COPY_GET_INT24U_LITTLE(addr_dest, addr_src) #define MEM_VAL_COPY_GET_INT32U(addr_dest, addr_src) MEM_VAL_COPY_GET_INT32U_LITTLE(addr_dest, addr_src) #else /* See Note #7. */ #error "CPU_CFG_ENDIAN_TYPE illegally #defined in 'cpu.h' " #error " [See 'cpu.h CONFIGURATION ERRORS']" #endif /* ********************************************************************************************************* * MEM_VAL_COPY_GET_INTU_xxx() * * Description : Copy & decode data values from any CPU memory address to any CPU memory address for * any sized data values. * * Argument(s) : addr_dest Lowest CPU memory address to copy/decode source address's data value * (see Notes #2 & #3). * * addr_src Lowest CPU memory address of data value to copy/decode * (see Notes #2 & #3). * * val_size Number of data value octets to copy/decode. * * Return(s) : none. * * Caller(s) : Application. * * Note(s) : (1) Copy/decode data values based on the values' data-word order : * * MEM_VAL_COPY_GET_INTU_BIG() Decode big- endian data values -- data words' most * significant octet @ lowest memory address * MEM_VAL_COPY_GET_INTU_LITTLE() Decode little-endian data values -- data words' least * significant octet @ lowest memory address * MEM_VAL_COPY_GET_INTU() Decode data values using CPU's native or configured * data-word order * * See also 'cpu.h CPU WORD CONFIGURATION Note #2'. * * (2) (a) CPU memory addresses/pointers NOT checked for NULL. * * (b) CPU memory addresses/buffers NOT checked for overlapping. * * (1) IEEE Std 1003.1, 2004 Edition, Section 'memcpy() : DESCRIPTION' states that * "copying ... between objects that overlap ... is undefined". * * (3) MEM_VAL_COPY_GET_INTU_xxx() macro's copy/decode data values without regard to CPU word- * aligned addresses. Thus for processors that require data word alignment, data words * can be copied/decoded to/from any CPU address, word-aligned or not, without generating * data-word-alignment exceptions/faults. * * (4) MEM_VAL_COPY_GET_xxx() macro's are more efficient than MEM_VAL_COPY_GET_INTU_xxx() * macro's & SHOULD be used whenever possible. * * See also 'MEM_VAL_COPY_GET_xxx() Note #4'. * * (5) Since octet-order copy/conversion are inverse operations, MEM_VAL_COPY_GET_INTU_xxx() & * MEM_VAL_COPY_SET_INTU_xxx() macros are inverse, but identical, operations & are provided * in both forms for semantics & consistency. * * See also 'MEM_VAL_COPY_SET_INTU_xxx() Note #5'. * * (6) MEM_VAL_COPY_GET_INTU_xxx() macro's are NOT atomic operations & MUST NOT be used on any * non-static (i.e. volatile) variables, registers, hardware, etc.; without the caller of * the macro's providing some form of additional protection (e.g. mutual exclusion). * * (7) MISRA-C 2004 Rule 5.2 states that "identifiers in an inner scope shall not use the same * name as an indentifier in an outer scope, and therefore hide that identifier". * * Therefore, to avoid possible redeclaration of commonly-used loop counter identifier names, * 'i' & 'j', MEM_VAL_COPY_GET_INTU_xxx() loop counter identifier names are prefixed with a * single underscore. * * (8) The 'CPU_CFG_ENDIAN_TYPE' pre-processor 'else'-conditional code SHOULD never be compiled/ * linked since each 'cpu.h' SHOULD ensure that the CPU data-word-memory order configuration * constant (CPU_CFG_ENDIAN_TYPE) is configured with an appropriate data-word-memory order * value (see 'cpu.h CPU WORD CONFIGURATION Note #2'). The 'else'-conditional code is * included as an extra precaution in case 'cpu.h' is incorrectly configured. ********************************************************************************************************* */ #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG) #define MEM_VAL_COPY_GET_INTU_BIG(addr_dest, addr_src, val_size) do { \ CPU_SIZE_T _i; \ \ for (_i = 0; _i < (val_size); _i++) { \ (*(((CPU_INT08U *)(addr_dest)) + _i)) = (*(((CPU_INT08U *)(addr_src)) + _i)); \ } \ } while (0) #define MEM_VAL_COPY_GET_INTU_LITTLE(addr_dest, addr_src, val_size) do { \ CPU_SIZE_T _i; \ CPU_SIZE_T _j; \ \ \ _j = (val_size) - 1; \ \ for (_i = 0; _i < (val_size); _i++) { \ (*(((CPU_INT08U *)(addr_dest)) + _i)) = (*(((CPU_INT08U *)(addr_src)) + _j)); \ _j--; \ } \ } while (0) #define MEM_VAL_COPY_GET_INTU(addr_dest, addr_src, val_size) MEM_VAL_COPY_GET_INTU_BIG(addr_dest, addr_src, val_size) #elif (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_LITTLE) #define MEM_VAL_COPY_GET_INTU_BIG(addr_dest, addr_src, val_size) do { \ CPU_SIZE_T _i; \ CPU_SIZE_T _j; \ \ \ _j = (val_size) - 1; \ \ for (_i = 0; _i < (val_size); _i++) { \ (*(((CPU_INT08U *)(addr_dest)) + _i)) = (*(((CPU_INT08U *)(addr_src)) + _j)); \ _j--; \ } \ } while (0) #define MEM_VAL_COPY_GET_INTU_LITTLE(addr_dest, addr_src, val_size) do { \ CPU_SIZE_T _i; \ \ for (_i = 0; _i < (val_size); _i++) { \ (*(((CPU_INT08U *)(addr_dest)) + _i)) = (*(((CPU_INT08U *)(addr_src)) + _i)); \ } \ } while (0) #define MEM_VAL_COPY_GET_INTU(addr_dest, addr_src, val_size) MEM_VAL_COPY_GET_INTU_LITTLE(addr_dest, addr_src, val_size) #else /* See Note #8. */ #error "CPU_CFG_ENDIAN_TYPE illegally #defined in 'cpu.h' " #error " [See 'cpu.h CONFIGURATION ERRORS']" #endif /* ********************************************************************************************************* * MEM_VAL_COPY_SET_xxx() * * Description : Copy & encode data values from any CPU memory address to any CPU memory address. * * Argument(s) : addr_dest Lowest CPU memory address to copy/encode source address's data value * (see Notes #2 & #3). * * addr_src Lowest CPU memory address of data value to copy/encode * (see Notes #2 & #3). * * Return(s) : none. * * Caller(s) : Application. * * Note(s) : (1) Copy/encode data values based on the values' data-word order : * * MEM_VAL_COPY_SET_xxx_BIG() Encode big- endian data values -- data words' most * significant octet @ lowest memory address * MEM_VAL_COPY_SET_xxx_LITTLE() Encode little-endian data values -- data words' least * significant octet @ lowest memory address * MEM_VAL_COPY_SET_xxx() Encode data values using CPU's native or configured * data-word order * * See also 'cpu.h CPU WORD CONFIGURATION Note #2'. * * (2) (a) CPU memory addresses/pointers NOT checked for NULL. * * (b) CPU memory addresses/buffers NOT checked for overlapping. * * (1) IEEE Std 1003.1, 2004 Edition, Section 'memcpy() : DESCRIPTION' states that * "copying ... between objects that overlap ... is undefined". * * (3) MEM_VAL_COPY_SET_xxx() macro's copy/encode data values without regard to CPU word-aligned * addresses. Thus for processors that require data word alignment, data words can be copied/ * encoded to/from any CPU address, word-aligned or not, without generating data-word-alignment * exceptions/faults. * * (4) MEM_VAL_COPY_SET_xxx() macro's are more efficient than MEM_VAL_SET_xxx() macro's & are * also independent of CPU data-word-alignment & SHOULD be used whenever possible. * * See also 'MEM_VAL_SET_xxx() Note #4'. * * (5) Since octet-order copy/conversion are inverse operations, MEM_VAL_COPY_GET_xxx() & * MEM_VAL_COPY_SET_xxx() macros are inverse, but identical, operations & are provided * in both forms for semantics & consistency. * * See also 'MEM_VAL_COPY_GET_xxx() Note #5'. * * (6) MEM_VAL_COPY_SET_xxx() macro's are NOT atomic operations & MUST NOT be used on any * non-static (i.e. volatile) variables, registers, hardware, etc.; without the caller * of the macro's providing some form of additional protection (e.g. mutual exclusion). ********************************************************************************************************* */ /* See Note #5. */ #define MEM_VAL_COPY_SET_INT08U_BIG(addr_dest, addr_src) MEM_VAL_COPY_GET_INT08U_BIG(addr_dest, addr_src) #define MEM_VAL_COPY_SET_INT16U_BIG(addr_dest, addr_src) MEM_VAL_COPY_GET_INT16U_BIG(addr_dest, addr_src) #define MEM_VAL_COPY_SET_INT24U_BIG(addr_dest, addr_src) MEM_VAL_COPY_GET_INT24U_BIG(addr_dest, addr_src) #define MEM_VAL_COPY_SET_INT32U_BIG(addr_dest, addr_src) MEM_VAL_COPY_GET_INT32U_BIG(addr_dest, addr_src) #define MEM_VAL_COPY_SET_INT08U_LITTLE(addr_dest, addr_src) MEM_VAL_COPY_GET_INT08U_LITTLE(addr_dest, addr_src) #define MEM_VAL_COPY_SET_INT16U_LITTLE(addr_dest, addr_src) MEM_VAL_COPY_GET_INT16U_LITTLE(addr_dest, addr_src) #define MEM_VAL_COPY_SET_INT24U_LITTLE(addr_dest, addr_src) MEM_VAL_COPY_GET_INT24U_LITTLE(addr_dest, addr_src) #define MEM_VAL_COPY_SET_INT32U_LITTLE(addr_dest, addr_src) MEM_VAL_COPY_GET_INT32U_LITTLE(addr_dest, addr_src) #define MEM_VAL_COPY_SET_INT08U(addr_dest, addr_src) MEM_VAL_COPY_GET_INT08U(addr_dest, addr_src) #define MEM_VAL_COPY_SET_INT16U(addr_dest, addr_src) MEM_VAL_COPY_GET_INT16U(addr_dest, addr_src) #define MEM_VAL_COPY_SET_INT24U(addr_dest, addr_src) MEM_VAL_COPY_GET_INT24U(addr_dest, addr_src) #define MEM_VAL_COPY_SET_INT32U(addr_dest, addr_src) MEM_VAL_COPY_GET_INT32U(addr_dest, addr_src) /* ********************************************************************************************************* * MEM_VAL_COPY_SET_INTU_xxx() * * Description : Copy & encode data values from any CPU memory address to any CPU memory address for * any sized data values. * * Argument(s) : addr_dest Lowest CPU memory address to copy/encode source address's data value * (see Notes #2 & #3). * * addr_src Lowest CPU memory address of data value to copy/encode * (see Notes #2 & #3). * * val_size Number of data value octets to copy/encode. * * Return(s) : none. * * Caller(s) : Application. * * Note(s) : (1) Copy/encode data values based on the values' data-word order : * * MEM_VAL_COPY_SET_INTU_BIG() Encode big- endian data values -- data words' most * significant octet @ lowest memory address * MEM_VAL_COPY_SET_INTU_LITTLE() Encode little-endian data values -- data words' least * significant octet @ lowest memory address * MEM_VAL_COPY_SET_INTU() Encode data values using CPU's native or configured * data-word order * * See also 'cpu.h CPU WORD CONFIGURATION Note #2'. * * (2) (a) CPU memory addresses/pointers NOT checked for NULL. * * (b) CPU memory addresses/buffers NOT checked for overlapping. * * (1) IEEE Std 1003.1, 2004 Edition, Section 'memcpy() : DESCRIPTION' states that * "copying ... between objects that overlap ... is undefined". * * (3) MEM_VAL_COPY_SET_INTU_xxx() macro's copy/encode data values without regard to CPU word- * aligned addresses. Thus for processors that require data word alignment, data words * can be copied/encoded to/from any CPU address, word-aligned or not, without generating * data-word-alignment exceptions/faults. * * (4) MEM_VAL_COPY_SET_xxx() macro's are more efficient than MEM_VAL_COPY_SET_INTU_xxx() * macro's & SHOULD be used whenever possible. * * See also 'MEM_VAL_COPY_SET_xxx() Note #4'. * * (5) Since octet-order copy/conversion are inverse operations, MEM_VAL_COPY_GET_INTU_xxx() & * MEM_VAL_COPY_SET_INTU_xxx() macros are inverse, but identical, operations & are provided * in both forms for semantics & consistency. * * See also 'MEM_VAL_COPY_GET_INTU_xxx() Note #5'. * * (6) MEM_VAL_COPY_SET_INTU_xxx() macro's are NOT atomic operations & MUST NOT be used on any * non-static (i.e. volatile) variables, registers, hardware, etc.; without the caller of * the macro's providing some form of additional protection (e.g. mutual exclusion). ********************************************************************************************************* */ /* See Note #5. */ #define MEM_VAL_COPY_SET_INTU_BIG(addr_dest, addr_src, val_size) MEM_VAL_COPY_GET_INTU_BIG(addr_dest, addr_src, val_size) #define MEM_VAL_COPY_SET_INTU_LITTLE(addr_dest, addr_src, val_size) MEM_VAL_COPY_GET_INTU_LITTLE(addr_dest, addr_src, val_size) #define MEM_VAL_COPY_SET_INTU(addr_dest, addr_src, val_size) MEM_VAL_COPY_GET_INTU(addr_dest, addr_src, val_size) /* ********************************************************************************************************* * MEM_VAL_COPY_xxx() * * Description : Copy data values from any CPU memory address to any CPU memory address. * * Argument(s) : addr_dest Lowest CPU memory address to copy source address's data value * (see Notes #2 & #3). * * addr_src Lowest CPU memory address of data value to copy * (see Notes #2 & #3). * * val_size Number of data value octets to copy. * * Return(s) : none. * * Caller(s) : Application. * * Note(s) : (1) MEM_VAL_COPY_xxx() macro's copy data values based on CPU's native data-word order. * * See also 'cpu.h CPU WORD CONFIGURATION Note #2'. * * (2) (a) CPU memory addresses/pointers NOT checked for NULL. * * (b) CPU memory addresses/buffers NOT checked for overlapping. * * (1) IEEE Std 1003.1, 2004 Edition, Section 'memcpy() : DESCRIPTION' states that * "copying ... between objects that overlap ... is undefined". * * (3) MEM_VAL_COPY_xxx() macro's copy data values without regard to CPU word-aligned addresses. * Thus for processors that require data word alignment, data words can be copied to/from any * CPU address, word-aligned or not, without generating data-word-alignment exceptions/faults. * * (4) MEM_VAL_COPY_xxx() macro's are more efficient than MEM_VAL_COPY() macro & SHOULD be * used whenever possible. * * (5) MEM_VAL_COPY_xxx() macro's are NOT atomic operations & MUST NOT be used on any non-static * (i.e. volatile) variables, registers, hardware, etc.; without the caller of the macro's * providing some form of additional protection (e.g. mutual exclusion). * * (6) MISRA-C 2004 Rule 5.2 states that "identifiers in an inner scope shall not use the same * name as an indentifier in an outer scope, and therefore hide that identifier". * * Therefore, to avoid possible redeclaration of commonly-used loop counter identifier name, * 'i', MEM_VAL_COPY() loop counter identifier name is prefixed with a single underscore. ********************************************************************************************************* */ #define MEM_VAL_COPY_08(addr_dest, addr_src) do { (*(((CPU_INT08U *)(addr_dest)) + 0)) = (*(((CPU_INT08U *)(addr_src)) + 0)); } while (0) #define MEM_VAL_COPY_16(addr_dest, addr_src) do { (*(((CPU_INT08U *)(addr_dest)) + 0)) = (*(((CPU_INT08U *)(addr_src)) + 0)); \ (*(((CPU_INT08U *)(addr_dest)) + 1)) = (*(((CPU_INT08U *)(addr_src)) + 1)); } while (0) #define MEM_VAL_COPY_24(addr_dest, addr_src) do { (*(((CPU_INT08U *)(addr_dest)) + 0)) = (*(((CPU_INT08U *)(addr_src)) + 0)); \ (*(((CPU_INT08U *)(addr_dest)) + 1)) = (*(((CPU_INT08U *)(addr_src)) + 1)); \ (*(((CPU_INT08U *)(addr_dest)) + 2)) = (*(((CPU_INT08U *)(addr_src)) + 2)); } while (0) #define MEM_VAL_COPY_32(addr_dest, addr_src) do { (*(((CPU_INT08U *)(addr_dest)) + 0)) = (*(((CPU_INT08U *)(addr_src)) + 0)); \ (*(((CPU_INT08U *)(addr_dest)) + 1)) = (*(((CPU_INT08U *)(addr_src)) + 1)); \ (*(((CPU_INT08U *)(addr_dest)) + 2)) = (*(((CPU_INT08U *)(addr_src)) + 2)); \ (*(((CPU_INT08U *)(addr_dest)) + 3)) = (*(((CPU_INT08U *)(addr_src)) + 3)); } while (0) #define MEM_VAL_COPY(addr_dest, addr_src, val_size) do { \ CPU_SIZE_T _i; \ \ for (_i = 0; _i < (val_size); _i++) { \ (*(((CPU_INT08U *)(addr_dest)) +_i)) = (*(((CPU_INT08U *)(addr_src)) +_i)); \ } \ } while (0) /* ********************************************************************************************************* * FUNCTION PROTOTYPES ********************************************************************************************************* */ void Mem_Init ( void); /* ------------------ MEM API FNCTS ------------------ */ void Mem_Clr ( void *pmem, CPU_SIZE_T size); void Mem_Set ( void *pmem, CPU_INT08U data_val, CPU_SIZE_T size); void Mem_Copy ( void *pdest, const void *psrc, CPU_SIZE_T size); void Mem_Move ( void *pdest, const void *psrc, CPU_SIZE_T size); CPU_BOOLEAN Mem_Cmp (const void *p1_mem, const void *p2_mem, CPU_SIZE_T size); /* ----------- MEM HEAP FNCTS (DEPRECATED) ------------ */ #if (LIB_MEM_CFG_HEAP_SIZE > 0u) void *Mem_HeapAlloc ( CPU_SIZE_T size, CPU_SIZE_T align, CPU_SIZE_T *p_bytes_reqd, LIB_ERR *p_err); CPU_SIZE_T Mem_HeapGetSizeRem ( CPU_SIZE_T align, LIB_ERR *p_err); #endif /* ------------------ MEM SEG FNCTS ------------------- */ void Mem_SegCreate (const CPU_CHAR *p_name, MEM_SEG *p_seg, CPU_ADDR seg_base_addr, CPU_SIZE_T size, CPU_SIZE_T padding_align, LIB_ERR *p_err); void Mem_SegClr ( MEM_SEG *p_seg, LIB_ERR *p_err); void *Mem_SegAlloc (const CPU_CHAR *p_name, MEM_SEG *p_seg, CPU_SIZE_T size, LIB_ERR *p_err); void *Mem_SegAllocExt (const CPU_CHAR *p_name, MEM_SEG *p_seg, CPU_SIZE_T size, CPU_SIZE_T align, CPU_SIZE_T *p_bytes_reqd, LIB_ERR *p_err); void *Mem_SegAllocHW (const CPU_CHAR *p_name, MEM_SEG *p_seg, CPU_SIZE_T size, CPU_SIZE_T align, CPU_SIZE_T *p_bytes_reqd, LIB_ERR *p_err); CPU_SIZE_T Mem_SegRemSizeGet ( MEM_SEG *p_seg, CPU_SIZE_T align, MEM_SEG_INFO *p_seg_info, LIB_ERR *p_err); #if (LIB_MEM_CFG_DBG_INFO_EN == DEF_ENABLED) void Mem_OutputUsage ( void (*out_fnct) (CPU_CHAR *), LIB_ERR *p_err); #endif /* -------- STATIC MEM POOL FNCTS (DEPRECATED) -------- */ void Mem_PoolCreate ( MEM_POOL *p_pool, void *p_mem_base, CPU_SIZE_T mem_size, MEM_POOL_BLK_QTY blk_nbr, CPU_SIZE_T blk_size, CPU_SIZE_T blk_align, CPU_SIZE_T *p_bytes_reqd, LIB_ERR *p_err); void Mem_PoolClr ( MEM_POOL *p_pool, LIB_ERR *p_err); void *Mem_PoolBlkGet ( MEM_POOL *p_pool, CPU_SIZE_T size, LIB_ERR *p_err); void Mem_PoolBlkFree ( MEM_POOL *p_pool, void *p_blk, LIB_ERR *p_err); MEM_POOL_BLK_QTY Mem_PoolBlkGetNbrAvail ( MEM_POOL *p_pool, LIB_ERR *p_err); /* -------------- DYNAMIC MEM POOL FNCTS -------------- */ void Mem_DynPoolCreate (const CPU_CHAR *p_name, MEM_DYN_POOL *p_pool, MEM_SEG *p_seg, CPU_SIZE_T blk_size, CPU_SIZE_T blk_align, CPU_SIZE_T blk_qty_init, CPU_SIZE_T blk_qty_max, LIB_ERR *p_err); void Mem_DynPoolCreateHW (const CPU_CHAR *p_name, MEM_DYN_POOL *p_pool, MEM_SEG *p_seg, CPU_SIZE_T blk_size, CPU_SIZE_T blk_align, CPU_SIZE_T blk_qty_init, CPU_SIZE_T blk_qty_max, LIB_ERR *p_err); void *Mem_DynPoolBlkGet ( MEM_DYN_POOL *p_pool, LIB_ERR *p_err); void Mem_DynPoolBlkFree ( MEM_DYN_POOL *p_pool, void *p_blk, LIB_ERR *p_err); CPU_SIZE_T Mem_DynPoolBlkNbrAvailGet( MEM_DYN_POOL *p_pool, LIB_ERR *p_err); /* ********************************************************************************************************* * CONFIGURATION ERRORS ********************************************************************************************************* */ #ifndef LIB_MEM_CFG_ARG_CHK_EXT_EN #error "LIB_MEM_CFG_ARG_CHK_EXT_EN not #define'd in 'lib_cfg.h'" #error " [MUST be DEF_DISABLED] " #error " [ || DEF_ENABLED ] " #elif ((LIB_MEM_CFG_ARG_CHK_EXT_EN != DEF_DISABLED) && \ (LIB_MEM_CFG_ARG_CHK_EXT_EN != DEF_ENABLED )) #error "LIB_MEM_CFG_ARG_CHK_EXT_EN illegally #define'd in 'lib_cfg.h'" #error " [MUST be DEF_DISABLED] " #error " [ || DEF_ENABLED ] " #endif #ifndef LIB_MEM_CFG_OPTIMIZE_ASM_EN #error "LIB_MEM_CFG_OPTIMIZE_ASM_EN not #define'd in 'lib_cfg.h'" #error " [MUST be DEF_DISABLED] " #error " [ || DEF_ENABLED ] " #elif ((LIB_MEM_CFG_OPTIMIZE_ASM_EN != DEF_DISABLED) && \ (LIB_MEM_CFG_OPTIMIZE_ASM_EN != DEF_ENABLED )) #error "LIB_MEM_CFG_OPTIMIZE_ASM_EN illegally #define'd in 'lib_cfg.h'" #error " [MUST be DEF_DISABLED] " #error " [ || DEF_ENABLED ] " #endif #ifndef LIB_MEM_CFG_HEAP_SIZE #error "LIB_MEM_CFG_HEAP_SIZE not #define'd in 'lib_cfg.h'" #error " [MUST be >= 0] " #endif #ifdef LIB_MEM_CFG_HEAP_BASE_ADDR #if (LIB_MEM_CFG_HEAP_BASE_ADDR == 0x0) #error "LIB_MEM_CFG_HEAP_BASE_ADDR illegally #define'd in 'lib_cfg.h'" #error " [MUST be > 0x0] " #endif #endif #if ((LIB_MEM_CFG_DBG_INFO_EN != DEF_DISABLED) && \ (LIB_MEM_CFG_DBG_INFO_EN != DEF_ENABLED )) #error "LIB_MEM_CFG_DBG_INFO_EN illegally defined in 'lib_cfg.h'" #error " [MUST be DEF_DISABLED] " #error " [ || DEF_ENABLED ] " #elif ((LIB_MEM_CFG_HEAP_SIZE == 0u) && \ (LIB_MEM_CFG_DBG_INFO_EN == DEF_ENABLED)) #error "LIB_MEM_CFG_HEAP_SIZE illegally defined in 'lib_cfg.h' " #error " [MUST be > 0 when LIB_MEM_CFG_DBG_INFO_EN == DEF_ENABLED]" #endif /* ********************************************************************************************************* * LIBRARY CONFIGURATION ERRORS ********************************************************************************************************* */ /* See 'lib_mem.h Note #2a'. */ #if (CPU_CORE_VERSION < 127u) #error "CPU_CORE_VERSION [SHOULD be >= V1.27]" #endif /* ********************************************************************************************************* * MODULE END * * Note(s) : (1) See 'lib_mem.h MODULE'. ********************************************************************************************************* */ #endif /* End of lib mem module include. */
62.503114
207
0.415625
a9ac53f36b90732a047fbdf144c473659bbf2e7e
15,918
h
C
src/smartpeak/include/SmartPeak/ml/ModelKernal.h
dmccloskey/EvoNet
8d7fafe1069593024e5b63fd6b81a341a3bf33b5
[ "MIT" ]
3
2020-12-28T11:07:26.000Z
2021-12-30T11:38:13.000Z
src/smartpeak/include/SmartPeak/ml/ModelKernal.h
dmccloskey/EvoNet
8d7fafe1069593024e5b63fd6b81a341a3bf33b5
[ "MIT" ]
20
2018-10-03T11:35:23.000Z
2019-10-14T09:17:07.000Z
src/smartpeak/include/SmartPeak/ml/ModelKernal.h
dmccloskey/EvoNet
8d7fafe1069593024e5b63fd6b81a341a3bf33b5
[ "MIT" ]
null
null
null
#ifndef SMARTPEAK_MODELKERNAL_H #define SMARTPEAK_MODELKERNAL_H #define EIGEN_USE_THREADS #include <unsupported/Eigen/CXX11/Tensor> #include <SmartPeak/ml/ActivationFunctionTensor.h> #include <SmartPeak/ml/IntegrationFunctionTensor.h> #include <SmartPeak/ml/LossFunctionTensor.h> #include <SmartPeak/ml/SolverTensor.h> #include <SmartPeak/ml/MetricFunctionTensor.h> namespace SmartPeak { /* @brief Class for all main Model kernals. A single kernal is generated per method (i.e., the device is called only once per kernal method). The only except is executeModelErrors where a kernal is generated for both the calculation of the model error and node errors in order to use only a host to device memcopy of the predicted node values. */ template <typename TensorT, typename DeviceT> class ModelKernal { public: ModelKernal() = default; ~ModelKernal() = default; virtual bool executeNodeActivation( TensorT* h_node_inputs, TensorT* d_node_inputs, TensorT* h_node_outputs, TensorT* d_node_outputs, TensorT* h_sink_dt, TensorT* d_sink_dt, std::shared_ptr<ActivationTensorOp<TensorT,DeviceT>>& activation_function, const int& batch_size, const int& memory_size, const int& layer_size, const int& time_step, DeviceT& device, bool copyHostToDevice = false, bool copyDeviceToHost = false) = 0; virtual bool executeNodeDerivative( TensorT* h_node_outputs, TensorT* d_node_outputs, TensorT* h_node_derivative, TensorT* d_node_derivative, std::shared_ptr<ActivationTensorOp<TensorT,DeviceT>>& activation_grad_function, const int& batch_size, const int& memory_size, const int& layer_size, const int& time_step, DeviceT& device, bool copyHostToDevice = false, bool copyDeviceToHost = false) = 0; virtual bool executeForwardPropogation( TensorT* h_source_outputs, TensorT* d_source_outputs, TensorT* h_weights, TensorT* d_weights, TensorT* h_sink_inputs, TensorT* d_sink_inputs, std::shared_ptr<IntegrationTensorOp<TensorT, DeviceT>>& sink_integration_function, const int& batch_size, const int& memory_size, const int& source_layer_size, const int& sink_layer_size, const int& source_time_step, const int& sink_time_step, DeviceT& device, bool copyHostToDevice = false, bool copyDeviceToHost = false) = 0; virtual bool executeBackwardPropogation( TensorT* h_source_errors, TensorT* d_source_errors, TensorT* h_source_inputs, TensorT* d_source_inputs, TensorT* h_sink_output, TensorT* d_sink_output, TensorT* h_weights, TensorT* d_weights, TensorT* h_sink_error, TensorT* d_sink_error, TensorT* h_sink_derivative, TensorT* d_sink_derivative, const int& n_input_nodes, std::shared_ptr<IntegrationErrorTensorOp<TensorT, DeviceT>>& source_integration_functions, const int& batch_size, const int& memory_size, const int& source_layer_size, const int& sink_layer_size, const int& source_time_step, const int& sink_time_step, DeviceT& device, bool copyHostToDevice = false, bool copyDeviceToHost = false) = 0; virtual bool executeModelErrors( Eigen::Tensor<TensorT, 2>& expected, TensorT* h_node_output, TensorT* d_node_output, TensorT* h_model_error, TensorT* d_model_error, TensorT* h_node_errors, TensorT* d_node_errors, std::shared_ptr<LossFunctionTensorOp<TensorT, DeviceT>>& loss_function, std::shared_ptr < LossFunctionGradTensorOp<TensorT, DeviceT>>& loss_grad_function, const int& batch_size, const int& memory_size, const int& layer_size, const int& time_step, DeviceT& device, bool copyHostToDevice = false, bool copyDeviceToHost = false) = 0; virtual bool executeModelMetric( Eigen::Tensor<TensorT, 2>& expected, TensorT* h_node_output, TensorT* d_node_output, TensorT* h_model_metric, TensorT* d_model_metric, std::shared_ptr<MetricFunctionTensorOp<TensorT, DeviceT>>& metric_function, const int& batch_size, const int& memory_size, const int& layer_size, const int& n_metrics, const int& time_step, const int& metric_index, DeviceT& device, bool copyHostToDevice = false, bool copyDeviceToHost = false) = 0; virtual bool executeWeightErrors( TensorT* h_sink_errors, TensorT* d_sink_errors, TensorT* h_source_outputs, TensorT* d_source_outputs, TensorT* h_source_inputs, TensorT* d_source_inputs, const int& n_input_nodes, std::shared_ptr<IntegrationWeightGradTensorOp<TensorT, DeviceT>>& sink_integration_function, TensorT* h_weight, TensorT* d_weight, TensorT* h_weight_error, TensorT* d_weight_error, const int& batch_size, const int& memory_size, const int& source_layer_size, const int& sink_layer_size, DeviceT& device, bool copyHostToDevice = false, bool copyDeviceToHost = false) = 0; virtual bool executeSharedWeightErrors( TensorT* h_weight_error, TensorT* d_weight_error, TensorT* h_shared_weights, TensorT* d_shared_weights, const int& source_layer_size, const int& sink_layer_size, const int& n_shared_layers, DeviceT& device, bool copyHostToDevice = false, bool copyDeviceToHost = false) = 0; virtual bool executeWeightUpdate( TensorT* h_weight, TensorT* d_weight, TensorT* h_solver_params, TensorT* d_solver_params, TensorT* h_weight_error, TensorT* d_weight_error, std::shared_ptr<SolverTensorOp<TensorT, DeviceT>>& solver_function, const int& source_layer_size, const int& sink_layer_size, const int& iter, DeviceT& device, bool copyHostToDevice = false, bool copyDeviceToHost = false) = 0; void combineSharedWeightErrors( TensorT* weight_error, TensorT* shared_weights, const int& source_layer_size, const int& sink_layer_size, const int& n_shared_layers, DeviceT& device) { // TODO: this hangs on both the CPU and GPU with tensors of any appreciable size Eigen::TensorMap<Eigen::Tensor<TensorT, 5>> weight_error_tensor(weight_error, 1, 1, source_layer_size, sink_layer_size, 1); Eigen::TensorMap<Eigen::Tensor<TensorT, 5>> shared_weight_tensor(shared_weights, 1, 1, source_layer_size, sink_layer_size, n_shared_layers); // Step 1: multiply the weight tensor by the shared weight tensor mask; sum all shared weights auto weight_error_sum = (weight_error_tensor.broadcast(Eigen::array<int, 5>({ 1,1,1,1,n_shared_layers })) * shared_weight_tensor ).sum(Eigen::array<int, 2>({ 2, 3 })).eval().broadcast(Eigen::array<int, 3>({ source_layer_size, sink_layer_size, 1 })).eval(); // dims 3 // Step 2: multiply the weight error sum tensor by the shared weight tensor mask and subtract out the error tensor // TensorT* tmp_data; // if (typeid(device).name() == typeid(Eigen::DefaultDevice).name()) { // tmp_data = new TensorT[source_layer_size * sink_layer_size]; // } //#if COMPILE_WITH_CUDA // else if (typeid(device).name() == typeid(Eigen::GpuDevice).name()) { // size_t bytes = source_layer_size * sink_layer_size * sizeof(TensorT); // assert(cudaMalloc((void**)(&tmp_data), bytes) == cudaSuccess); // } //#endif // Eigen::Tensor<TensorT, 2> weight_error_diff(source_layer_size, sink_layer_size); auto weight_error_diff/*.device(device)*/ = (weight_error_sum * shared_weight_tensor.chip(0, 1).chip(0, 0) - weight_error_tensor.chip(0, 1).chip(0, 0).broadcast(Eigen::array<int, 3>({ 1,1,n_shared_layers })) * shared_weight_tensor.chip(0, 1).chip(0, 0) ).eval().sum(Eigen::array<int, 1>({ 2 })).eval(); //dims 2 // Step 3: add the weight_error_diff weight_error_tensor.chip(0, 4).chip(0, 1).chip(0, 0).device(device) += weight_error_diff; //weight_error_tensor.chip(0, 4).chip(0, 1).chip(0, 0).device(device) += (weight_error_diff == weight_error_diff).select(weight_error_diff.clip(TensorT(-1e24), TensorT(1e24)), weight_error_diff.constant(TensorT(0))); // // Deallocate temporary memory // if (typeid(device).name() == typeid(Eigen::DefaultDevice).name()) { // delete[] tmp_data; // } //#if COMPILE_WITH_CUDA // else if (typeid(device).name() == typeid(Eigen::GpuDevice).name()) { // assert(cudaFree(tmp_data) == cudaSuccess); // } //#endif } }; template <typename TensorT> class ModelKernalDefaultDevice : ModelKernal<TensorT, Eigen::DefaultDevice> { public: using ModelKernal<TensorT, Eigen::DefaultDevice>::ModelKernal; bool executeNodeActivation( TensorT* h_node_inputs, TensorT* d_node_inputs, TensorT* h_node_outputs, TensorT* d_node_outputs, TensorT* h_sink_dt, TensorT* d_sink_dt, std::shared_ptr<ActivationTensorOp<TensorT, Eigen::DefaultDevice>>& activation_function, const int& batch_size, const int& memory_size, const int& layer_size, const int& time_step, Eigen::DefaultDevice& device, bool copyHostToDevice = false, bool copyDeviceToHost = false) override { // Activate the node net input activation_function->operator()(h_node_inputs, h_node_outputs, batch_size, memory_size, layer_size, time_step, device); return true; } bool executeNodeDerivative( TensorT* h_node_outputs, TensorT* d_node_outputs, TensorT* h_node_derivative, TensorT* d_node_derivative, std::shared_ptr<ActivationTensorOp<TensorT, Eigen::DefaultDevice>>& activation_grad_function, const int& batch_size, const int& memory_size, const int& layer_size, const int& time_step, Eigen::DefaultDevice& device, bool copyHostToDevice = false, bool copyDeviceToHost = false) override { // Calculate the derivative of the sink node activation activation_grad_function->operator()(h_node_outputs, h_node_derivative, batch_size, memory_size, layer_size, time_step, device); return true; } bool executeForwardPropogation( TensorT* h_source_outputs, TensorT* d_source_outputs, TensorT* h_weights, TensorT* d_weights, TensorT* h_sink_inputs, TensorT* d_sink_inputs, std::shared_ptr<IntegrationTensorOp<TensorT, Eigen::DefaultDevice>>& sink_integration_function, const int& batch_size, const int& memory_size, const int& source_layer_size, const int& sink_layer_size, const int& source_time_step, const int& sink_time_step, Eigen::DefaultDevice& device, bool copyHostToDevice = false, bool copyDeviceToHost = false) override { // Integrate sink node input sink_integration_function->operator()(h_source_outputs, h_weights, h_sink_inputs, batch_size, memory_size, source_layer_size, sink_layer_size, source_time_step, sink_time_step, device); return true; }; bool executeBackwardPropogation( TensorT* h_source_errors, TensorT* d_source_errors, TensorT* h_source_inputs, TensorT* d_source_inputs, TensorT* h_sink_output, TensorT* d_sink_output, TensorT* h_weights, TensorT* d_weights, TensorT* h_sink_error, TensorT* d_sink_error, TensorT* h_sink_derivative, TensorT* d_sink_derivative, const int& n_input_nodes, std::shared_ptr<IntegrationErrorTensorOp<TensorT, Eigen::DefaultDevice>>& source_integration_functions, const int& batch_size, const int& memory_size, const int& source_layer_size, const int& sink_layer_size, const int& source_time_step, const int& sink_time_step, Eigen::DefaultDevice& device, bool copyHostToDevice = false, bool copyDeviceToHost = false) override { // Integrate sink node error source_integration_functions->operator()( h_source_errors, h_source_inputs, h_weights, h_sink_output, h_sink_error, h_sink_derivative, n_input_nodes, batch_size, memory_size, source_layer_size, sink_layer_size, source_time_step, sink_time_step, device); return true; }; bool executeModelErrors( Eigen::Tensor<TensorT, 2>& expected, TensorT* h_node_outputs, TensorT* d_node_outputs, TensorT* h_model_error, TensorT* d_model_error, TensorT* h_node_errors, TensorT* d_node_errors, std::shared_ptr<LossFunctionTensorOp<TensorT, Eigen::DefaultDevice>>& loss_function, std::shared_ptr<LossFunctionGradTensorOp<TensorT, Eigen::DefaultDevice>>& loss_grad_function, const int& batch_size, const int& memory_size, const int& layer_size, const int& time_step, Eigen::DefaultDevice& device, bool copyHostToDevice = false, bool copyDeviceToHost = false) override { // Calculate the model error loss_function->operator()(h_node_outputs, expected.data(), h_model_error, batch_size, memory_size, layer_size, time_step, device); // Calculate the node errors loss_grad_function->operator()(h_node_outputs, expected.data(), h_node_errors, batch_size, memory_size, layer_size, time_step, device); return true; }; bool executeModelMetric( Eigen::Tensor<TensorT, 2>& expected, TensorT* h_node_output, TensorT* d_node_output, TensorT* h_model_metric, TensorT* d_model_metric, std::shared_ptr<MetricFunctionTensorOp<TensorT, Eigen::DefaultDevice>>& metric_function, const int& batch_size, const int& memory_size, const int& layer_size, const int& n_metrics, const int& time_step, const int& metric_index, Eigen::DefaultDevice& device, bool copyHostToDevice = false, bool copyDeviceToHost = false) override { // Calculate the model metric metric_function->operator()(h_node_output, expected.data(), h_model_metric, batch_size, memory_size, layer_size, n_metrics, time_step, metric_index, device); return true; }; bool executeWeightErrors( TensorT* h_sink_errors, TensorT* d_sink_errors, TensorT* h_source_outputs, TensorT* d_source_outputs, TensorT* h_source_inputs, TensorT* d_source_inputs, const int& n_input_nodes, std::shared_ptr<IntegrationWeightGradTensorOp<TensorT, Eigen::DefaultDevice>>& sink_integration_function, TensorT* h_weight, TensorT* d_weight, TensorT* h_weight_error, TensorT* d_weight_error, const int& batch_size, const int& memory_size, const int& source_layer_size, const int& sink_layer_size, Eigen::DefaultDevice& device, bool copyHostToDevice = false, bool copyDeviceToHost = false) override { // Accumulate the error for all links involving the same weight sink_integration_function->operator()(h_sink_errors, h_source_outputs, h_weight, h_source_inputs, h_weight_error, n_input_nodes, batch_size, memory_size, source_layer_size, sink_layer_size, device); return true; }; bool executeSharedWeightErrors( TensorT* h_weight_error, TensorT* d_weight_error, TensorT* h_shared_weights, TensorT* d_shared_weights, const int& source_layer_size, const int& sink_layer_size, const int& n_shared_layers, Eigen::DefaultDevice& device, bool copyHostToDevice = false, bool copyDeviceToHost = false) override { if (n_shared_layers == 0) return true; // Pool the shared weights erros this->combineSharedWeightErrors(h_weight_error, h_shared_weights, source_layer_size, sink_layer_size, n_shared_layers, device); return true; }; virtual bool executeWeightUpdate( TensorT* h_weight, TensorT* d_weight, TensorT* h_solver_params, TensorT* d_solver_params, TensorT* h_weight_error, TensorT* d_weight_error, std::shared_ptr<SolverTensorOp<TensorT, Eigen::DefaultDevice>>& solver_function, const int& source_layer_size, const int& sink_layer_size, const int& iter, Eigen::DefaultDevice& device, bool copyHostToDevice = false, bool copyDeviceToHost = false) override { // Update the weights solver_function->operator()(h_weight, h_weight_error, h_solver_params, source_layer_size, sink_layer_size, iter, device);//getDrop()*error); return true; } }; } #endif //SMARTPEAK_MODELKERNAL_H
37.018605
222
0.73508
aa9faaa9134847dd2f7c942e1d76f50b8f9baa71
1,427
c
C
src/midend/KLT/lib/rtl/context.c
ouankou/rose
76f2a004bd6d8036bc24be2c566a14e33ba4f825
[ "BSD-3-Clause" ]
488
2015-01-09T08:54:48.000Z
2022-03-30T07:15:46.000Z
src/midend/KLT/lib/rtl/context.c
sujankh/rose-matlab
7435d4fa1941826c784ba97296c0ec55fa7d7c7e
[ "BSD-3-Clause" ]
174
2015-01-28T18:41:32.000Z
2022-03-31T16:51:05.000Z
src/midend/KLT/lib/rtl/context.c
sujankh/rose-matlab
7435d4fa1941826c784ba97296c0ec55fa7d7c7e
[ "BSD-3-Clause" ]
146
2015-04-27T02:48:34.000Z
2022-03-04T07:32:53.000Z
#include "KLT/RTL/context.h" DEVICE_FUNCTION_MODIFIER int klt_get_loop_lower(STORAGE_MODIFIER struct klt_loop_context_t * ctx, int idx) { return ctx->data[3 * idx]; } DEVICE_FUNCTION_MODIFIER int klt_get_loop_upper(STORAGE_MODIFIER struct klt_loop_context_t * ctx, int idx) { return ctx->data[3 * idx + 1]; } DEVICE_FUNCTION_MODIFIER int klt_get_loop_stride(STORAGE_MODIFIER struct klt_loop_context_t * ctx, int idx) { return ctx->data[3 * idx + 2]; } DEVICE_FUNCTION_MODIFIER int klt_get_tile_length(STORAGE_MODIFIER struct klt_loop_context_t * ctx, int idx) { return ctx->data[3 * ctx->num_loops + 2 * idx]; } DEVICE_FUNCTION_MODIFIER int klt_get_tile_stride(STORAGE_MODIFIER struct klt_loop_context_t * ctx, int idx) { return ctx->data[3 * ctx->num_loops + 2 * idx + 1]; } #if COMPILE_FOR_KERNEL == 0 void klt_set_loop_lower(struct klt_loop_context_t * ctx, int idx, int val) { ctx->data[3 * idx] = val; } void klt_set_loop_upper(struct klt_loop_context_t * ctx, int idx, int val) { ctx->data[3 * idx + 1] = val; } void klt_set_loop_stride(struct klt_loop_context_t * ctx, int idx, int val) { ctx->data[3 * idx + 2] = val; } void klt_set_tile_length(struct klt_loop_context_t * ctx, int idx, int val) { ctx->data[3 * ctx->num_loops + 2 * idx] = val; } void klt_set_tile_stride(struct klt_loop_context_t * ctx, int idx, int val) { ctx->data[3 * ctx->num_loops + 2 * idx + 1] = val; } #endif
29.729167
109
0.729502
45ed325f61fd640bc9cc6f43d019c4119d76a558
2,590
h
C
src/data_file.h
dasfaha/sky
4f2696e9abe54f4818f94337ed3bceae798e5a6d
[ "MIT" ]
2
2018-01-16T07:26:53.000Z
2021-12-08T03:12:40.000Z
src/data_file.h
dasfaha/sky
4f2696e9abe54f4818f94337ed3bceae798e5a6d
[ "MIT" ]
null
null
null
src/data_file.h
dasfaha/sky
4f2696e9abe54f4818f94337ed3bceae798e5a6d
[ "MIT" ]
null
null
null
#ifndef _data_file_h #define _data_file_h #include <inttypes.h> #include <stdbool.h> typedef struct sky_data_file sky_data_file; #include "bstring.h" #include "file.h" #include "types.h" #include "block.h" #include "event.h" //============================================================================== // // Overview // //============================================================================== // The header file stores information about how the table's data file is // structured. The beginning of the file lists the database format version // (4-bytes), block size (4-bytes) and block count (4-bytes). From there the // blocks are listed out in //============================================================================== // // Typedefs // //============================================================================== #define SKY_DEFAULT_BLOCK_SIZE 0x10000 #define SKY_DATA_FILE_VERSION 1 #define SKY_HEADER_FILE_HDR_SIZE sizeof(uint32_t) + sizeof(uint32_t) struct sky_data_file { bstring path; bstring header_path; uint32_t block_size; sky_block **blocks; uint32_t block_count; int data_fd; void *data; size_t data_length; }; //============================================================================== // // Functions // //============================================================================== //-------------------------------------- // Lifecycle //-------------------------------------- sky_data_file *sky_data_file_create(); void sky_data_file_free(sky_data_file *data_file); //-------------------------------------- // Paths //-------------------------------------- int sky_data_file_set_path(sky_data_file *data_file, bstring path); int sky_data_file_set_header_path(sky_data_file *data_file, bstring path); //-------------------------------------- // Persistence //-------------------------------------- int sky_data_file_load(sky_data_file *data_file); int sky_data_file_unload(sky_data_file *data_file); //-------------------------------------- // Block Management //-------------------------------------- int sky_data_file_create_block(sky_data_file *data_file, sky_block **ret); int sky_data_file_find_insertion_block(sky_data_file *data_file, sky_event *event, sky_block **ret); int sky_data_file_move_to_new_block(sky_data_file *data_file, void **ptr, size_t sz, sky_block **new_block); //-------------------------------------- // Event Management //-------------------------------------- int sky_data_file_add_event(sky_data_file *data_file, sky_event *event); #endif
24.903846
80
0.497683
b7b9ed2c541f6a5d14941200deddc824d822366c
709
c
C
Faculdade/2009-1_-_V/Sistemas_Operacionais_-_CMP1160/souce_extra/Tudo_Site_professor/ctrlc.c
mtulio/kb
1bc355d1750664cfea10dbb5a3f60549a1668971
[ "Apache-2.0" ]
3
2016-09-21T18:37:49.000Z
2018-02-24T05:27:30.000Z
Faculdade/2009-1_-_V/Sistemas_Operacionais_-_CMP1160/souce_extra/Tudo_Site_professor/ctrlc.c
mtulio/kb
1bc355d1750664cfea10dbb5a3f60549a1668971
[ "Apache-2.0" ]
null
null
null
Faculdade/2009-1_-_V/Sistemas_Operacionais_-_CMP1160/souce_extra/Tudo_Site_professor/ctrlc.c
mtulio/kb
1bc355d1750664cfea10dbb5a3f60549a1668971
[ "Apache-2.0" ]
null
null
null
#include <stdio.h> #include <signal.h> void sigproc(void); void quitproc(void); main() { signal(SIGINT, sigproc);//ctrL+C aciona o SIGINT signal(SIGQUIT, quitproc); //CTRl + \ aciona o SIGQUIT //executa o quitproc qdo recebe o sigquit printf("ctrl-c disabled use ctrl- to quit \n"); for(;;); /* infinite loop */ } void sigproc() { signal(SIGINT, sigproc); /* */ /* NOTE some versions of UNIX will reset signal to default after each call. So for portability reset signal each time */ printf("you have pressed ctrl-c \n"); } void quitproc() { printf("ctrl-\\ pressed to quit \n"); exit(0); /* normal exit status */ }
29.541667
71
0.600846
4e5a45ea5310ea0d71c9225cf24d4357e1ce1fda
1,850
h
C
tmc/generate.h
nilqed/xsiTM
ee84d89e95023a600fab19ce149578dd67d1a7f5
[ "MIT" ]
1
2019-09-10T16:39:07.000Z
2019-09-10T16:39:07.000Z
tmc/generate.h
nilqed/xsiTM
ee84d89e95023a600fab19ce149578dd67d1a7f5
[ "MIT" ]
null
null
null
tmc/generate.h
nilqed/xsiTM
ee84d89e95023a600fab19ce149578dd67d1a7f5
[ "MIT" ]
null
null
null
/*******************************************************/ /* "C" Language Integrated Production System */ /* */ /* CLIPS Version 6.20 01/31/02 */ /* */ /* GENERATE HEADER FILE */ /*******************************************************/ /*************************************************************/ /* Purpose: Provides routines for converting field */ /* constraints to expressions which can be used */ /* in the pattern and join networks. */ /* */ /* Principal Programmer(s): */ /* Gary D. Riley */ /* */ /* Contributing Programmer(s): */ /* */ /* Revision History: */ /* */ /*************************************************************/ #ifndef _H_generate #define _H_generate #ifndef _H_expressn #include "expressn.h" #endif #ifndef _H_reorder #include "reorder.h" #endif #ifdef LOCALE #undef LOCALE #endif #ifdef _GENERATE_SOURCE_ #define LOCALE #else #define LOCALE extern #endif LOCALE void FieldConversion(void *,struct lhsParseNode *,struct lhsParseNode *); LOCALE struct expr *GetvarReplace(void *,struct lhsParseNode *,int); LOCALE intBool IsNandTest(struct lhsParseNode *); #endif
35.576923
110
0.329189
bd0c0b5de976774bacf44dd31433854154f6d6bd
1,288
h
C
include/redopera/rsc/RFont.h
chilingg/redopera
c76d6e88c1f7bb0c048191c0c7eca41ed38754af
[ "MIT" ]
null
null
null
include/redopera/rsc/RFont.h
chilingg/redopera
c76d6e88c1f7bb0c048191c0c7eca41ed38754af
[ "MIT" ]
null
null
null
include/redopera/rsc/RFont.h
chilingg/redopera
c76d6e88c1f7bb0c048191c0c7eca41ed38754af
[ "MIT" ]
null
null
null
#ifndef RFONT_H #define RFONT_H #include "RResource.h" #include "../RDefine.h" class stbtt_fontinfo; namespace Redopera { class RFont { public: struct Glyph { int width = 0; int height = 0; int xoff = 0; int yoff = 0; int advence = 0; std::unique_ptr<const RData[]> data; }; // sourceCodePro()定义在字体资源文件中 (SourceCodePro.cpp) static RFont sourceCodePro(); static const void* sourceCodeProFileData(); static size_t sourceCodeProFileSize(); static RFont& defaultFont(); RFont(); explicit RFont(const std::string &path, unsigned fsize = 14); RFont(const RData* data, const size_t size, unsigned fsize = 14); RFont(const RFont &font); RFont(const RFont &&font); RFont& operator=(RFont font); void swap(RFont &font); ~RFont() = default; bool isValid() const; unsigned size() const; Glyph getGlyph(RChar c) const; void setSize(unsigned size); bool load(const std::string &path); bool load(const RData *data, size_t size); void free(); private: unsigned fsize_ = 14; std::shared_ptr<stbtt_fontinfo> info_; std::shared_ptr<RData[]> file_; }; } // Redopera void swap(Redopera::RFont &font1, Redopera::RFont &font2); #endif // RFONT_H
21.466667
69
0.640528
ff7b1a1858a040e80d0f1c461b465b2989d64a50
6,218
c
C
hips/sources/convolve.c
mikelandy/HIPS
fb5440573848cd22d55771484e3c036b6007f780
[ "MIT" ]
null
null
null
hips/sources/convolve.c
mikelandy/HIPS
fb5440573848cd22d55771484e3c036b6007f780
[ "MIT" ]
null
null
null
hips/sources/convolve.c
mikelandy/HIPS
fb5440573848cd22d55771484e3c036b6007f780
[ "MIT" ]
null
null
null
/* * Copyright (c) 1991 Michael Landy * * Disclaimer: No guarantees of performance accompany this software, * nor is any responsibility assumed on the part of the authors. All the * software has been tested extensively and every effort has been made to * insure its reliability. */ /* * convolve.c - 3D convolution * * usage: convolve kernel < iseq > oseq * * The output is a full spatio-temporal convolution of the two input * sequences, and hence has a size which is the sum of the two input sizes * minus 1. For large sequences it can run into space problems. It does its * best by only allocating enough space for the entirety of the smaller of the * two input sequences (two copies). * * To load: cc -o convolve convolve.c -lhipsh -lhips -lm * * HIPS 2 - msl - 8/10/91 */ #include <stdio.h> #include <hipl_format.h> static Flag_Format flagfmt[] = {LASTFLAG}; int types[] = {PFINT,PFFLOAT,LASTTYPE}; int main(argc,argv) int argc; char **argv; { struct header hd,hdp,hdf,hdfp,hdo; int method1,method2,f,ofmt,savesize,*pi; int nri,nci,nfi,nrk,nck,nfk,nfo,currfr,firstk,firsti,numf,minf,maxf; char *savehist,*savedesc; Filename filename1,filename2; FILE *fp1,*fp2; h_boolean bigkernel; float *pf; Progname = strsave(*argv); parseargs(argc,argv,flagfmt,FFTWO,&filename1,&filename2); fp1 = hfopenr(filename1); fp2 = hfopenr(filename2); fread_header(fp2,&hd,filename2); fread_header(fp1,&hdf,filename1); clearroi(&hd); clearroi(&hdf); ofmt = maxformat(hd.pixel_format,hdf.pixel_format,types, filename2,filename1); method2 = pset_conversion(&hd,&hdp,ofmt,filename2); method1 = pset_conversion(&hdf,&hdfp,ofmt,filename1); if (hdp.numcolor > 1 || hdfp.numcolor > 1) perr(HE_MSG,"number of color planes must be 1"); nri = hd.rows; nci = hd.cols; nfi = hdp.num_frame; nrk = hdf.rows; nck = hdf.cols; nfk = hdfp.num_frame; nfo = nfi + nfk - 1; minf = (nfk < nfi) ? nfk : nfi; maxf = (nfk < nfi) ? nfi : nfk; bigkernel = nfk > nfi; if (bigkernel) { setsize(&hdp,nri*nfi,nci); /* fake the image allocation */ alloc_image(&hdp); setsize(&hdp,nri,nci); if (method2 == METH_IDENT) hd.image = hd.firstpix = hdp.image; else alloc_image(&hd); setsize(&hdfp,nrk*nfi,nck); /* fake the image allocation */ alloc_image(&hdfp); setsize(&hdfp,nrk,nck); if (method1 == METH_IDENT) hdf.image = hdf.firstpix = hdfp.image; else alloc_image(&hdf); } else { setsize(&hdfp,nrk*nfk,nck); /* fake the image allocation */ alloc_image(&hdfp); setsize(&hdfp,nrk,nck); if (method1 == METH_IDENT) hdf.image = hdf.firstpix = hdfp.image; else alloc_image(&hdf); setsize(&hdp,nri*nfk,nci); /* fake the image allocation */ alloc_image(&hdp); setsize(&hdp,nri,nci); if (method2 == METH_IDENT) hd.image = hd.firstpix = hdp.image; else alloc_image(&hd); } dup_headern(&hdp,&hdo); setsize(&hdo,hd.rows+hdf.rows-1,hd.cols+hdf.cols-1); hdo.num_frame = nfo; alloc_image(&hdo); if (hips_fullxpar) mergeparam(&hdo,&hdfp); if (hips_fulldesc) { savedesc = hdp.seq_desc; savesize = hdp.sizedesc; if (hdfp.sizedesc > 1) { desc_set2(&hdo,HEP_SS, "****%s: kernel sequence, file: %s****\n", Progname,filename1); desc_indentadd(&hdo,hdfp.seq_desc); if (savesize > 1) { desc_append2(&hdo,HEP_SS, "****%s: input sequence, file: %s****\n", Progname,filename2); desc_indentadd(&hdo,savedesc); } } else if (hdp.sizedesc > 1) { desc_set2(&hdo,HEP_SS, "****%s: input sequence, file: %s****\n", Progname,filename2); desc_indentadd(&hdo,savedesc); } } if (hips_fullhist) { savehist = hdp.seq_history; history_set(&hdo,HEP_SS, "****%s: kernel sequence, file: %s****\n",Progname, filename1); history_indentadd(&hdo,hdfp.seq_history); history_append(&hdo,HEP_SS, "****%s: input sequence, file: %s****\n",Progname, filename2); history_indentadd(&hdo,savehist); write_headerun(&hdo,argc,argv); } else write_headeru(&hdo,argc,argv); if (bigkernel) { if (ofmt == PFINT) { pi = (int *) hdp.image; for (f=0;f<nfi;f++) { hdp.image = (byte *) (pi + f*nri*nci); fread_imagec(fp2,&hd,&hdp,method2,f,filename2); } hdp.image = (byte *) pi; } else { pf = (float *) hdp.image; for (f=0;f<nfi;f++) { hdp.image = (byte *) (pf + f*nri*nci); fread_imagec(fp2,&hd,&hdp,method2,f,filename2); } hdp.image = (byte *) pf; } } else { if (ofmt == PFINT) { pi = (int *) hdfp.image; for (f=0;f<nfk;f++) { hdfp.image = (byte *) (pi + f*nrk*nck); fread_imagec(fp1,&hdf,&hdfp,method1,f, filename1); } hdfp.image = (byte *) pi; } else { pf = (float *) hdfp.image; for (f=0;f<nfk;f++) { hdfp.image = (byte *) (pf + f*nrk*nck); fread_imagec(fp1,&hdf,&hdfp,method1,f, filename1); } hdfp.image = (byte *) pf; } } currfr = 0; for (f=0;f<nfo;f++) { if (bigkernel) { if (ofmt == PFINT) { pi = (int *) hdfp.image; hdfp.image = (byte *) (pi + currfr*nrk*nck); if (f < nfk) fread_imagec(fp1,&hdf,&hdfp,method1,f, filename1); hdfp.image = (byte *) pi; } else { pf = (float *) hdfp.image; hdfp.image = (byte *) (pf + currfr*nrk*nck); if (f < nfk) fread_imagec(fp1,&hdf,&hdfp,method1,f, filename1); hdfp.image = (byte *) pf; } currfr = (currfr + 1) % nfi; } else { if (ofmt == PFINT) { pi = (int *) hdp.image; hdp.image = (byte *) (pi + currfr*nri*nci); if (f < nfi) fread_imagec(fp2,&hd,&hdp,method2,f, filename2); hdp.image = (byte *) pi; } else { pf = (float *) hdp.image; hdp.image = (byte *) (pf + currfr*nri*nci); if (f < nfi) fread_imagec(fp2,&hd,&hdp,method2,f, filename2); hdp.image = (byte *) pf; } currfr = (currfr + 1) % nfk; } numf = (f < minf) ? (f + 1) : ((f < maxf) ? minf : (nfo - f)); firstk = (nfk + f - nfo > 0) ? (nfk + f - nfo) : 0; firsti = (nfi + f - nfo > 0) ? (nfi + f - nfo) : 0; if (bigkernel) { firstk %= nfi; h_convolve(&hdfp,&hdp,&hdo,firstk,firsti,numf); } else { firsti %= nfk; h_convolve(&hdp,&hdfp,&hdo,firsti,firstk,numf); } write_image(&hdo,f); } return(0); }
26.016736
78
0.614024
7fb1f61915895005a75a3b30f8f36c1f9de4dd50
11,006
h
C
profiler/targets/conf/exceptions_def.h
franzfranchetti/spiral-software
5ad717954b8a14e82277c4bd82c7518d9e6c0a10
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
profiler/targets/conf/exceptions_def.h
franzfranchetti/spiral-software
5ad717954b8a14e82277c4bd82c7518d9e6c0a10
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
profiler/targets/conf/exceptions_def.h
franzfranchetti/spiral-software
5ad717954b8a14e82277c4bd82c7518d9e6c0a10
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
/* * Copyright (c) 2018-2020, Carnegie Mellon University * See LICENSE for details */ #ifndef EXCEPTIONS_H #error "Do NOT include this file directly. Include 'exceptions.h' instead." #endif /* The remaining portion of this file is patched cexcept.h by Adam M. Costello and Cosmin Truta. The file was modified to add __FILE__, __LINE__, and __func__, to the exception context. Additions are in define_exceotion_context and in Throw. They are delimited with comments. Yevgen S. Voronenko (yevgen@drexel.edu). */ /* --cut--*/ /*=== cexcept.h 2.0.0 (2001-Jul-12-Thu) Adam M. Costello <amc@cs.berkeley.edu> An interface for exception-handling in ANSI C (C89 and subsequent ISO standards), developed jointly with Cosmin Truta <cosmin@cs.toronto.edu>. Copyright (c) 2001 Adam M. Costello and Cosmin Truta. Everyone is hereby granted permission to do whatever they like with this file, provided that if they modify it they take reasonable steps to avoid confusing or misleading people about the authors, version, and terms of use of the derived file. The copyright holders make no guarantees regarding this file, and are not responsible for any damage resulting from its use. Only user-defined exceptions are supported, not "real" exceptions like division by zero or memory segmentation violations. If this interface is used by multiple .c files, they shouldn't include this header file directly. Instead, create a wrapper header file that includes this header file and then invokes the define_exception_type macro (see below), and let your .c files include that header file. The interface consists of one type, one well-known name, and six macros. define_exception_type(type_name); This macro is used like an external declaration. It specifies the type of object that gets copied from the exception thrower to the exception catcher. The type_name can be any type that can be assigned to, that is, a non-constant arithmetic type, struct, union, or pointer. Examples: define_exception_type(int); enum exception { out_of_memory, bad_arguments, disk_full }; define_exception_type(enum exception); struct exception { int code; const char *msg; }; define_exception_type(struct exception); Because throwing an exception causes the object to be copied (not just once, but twice), programmers may wish to consider size when choosing the exception type. struct exception_context; This type may be used after the define_exception_type() macro has been invoked. A struct exception_context must be known to both the thrower and the catcher. It is expected that there be one context for each thread that uses exceptions. It would certainly be dangerous for multiple threads to access the same context. One thread can use multiple contexts, but that is likely to be confusing and not typically useful. The application can allocate this structure in any way it pleases--automatic, static, or dynamic. The application programmer should pretend not to know the structure members, which are subject to change. struct exception_context *the_exception_context; The Try/Catch and Throw statements (described below) implicitly refer to a context, using the name the_exception_context. It is the application's responsibility to make sure that this name yields the address of a mutable (non-constant) struct exception_context wherever those statements are used. Subject to that constraint, the application may declare a variable of this name anywhere it likes (inside a function, in a parameter list, or externally), and may use whatever storage class specifiers (static, extern, etc) or type qualifiers (const, volatile, etc) it likes. Examples: static struct exception_context * const the_exception_context = &foo; { struct exception_context *the_exception_context = bar; ... } int blah(struct exception_context *the_exception_context, ...); extern struct exception_context the_exception_context[1]; The last example illustrates a trick that avoids creating a pointer object separate from the structure object. The name could even be a macro, for example: struct exception_context ec_array[numthreads]; #define the_exception_context (ec_array + thread_id) Be aware that the_exception_context is used several times by the Try/Catch/Throw macros, so it shouldn't be expensive or have side effects. The expansion must be a drop-in replacement for an identifier, so it's safest to put parentheses around it. void init_exception_context(struct exception_context *ec); For context structures allocated statically (by an external definition or using the "static" keyword), the implicit initialization to all zeros is sufficient, but contexts allocated by other means must be initialized using this macro before they are used by a Try/Catch statement. It does no harm to initialize a context more than once (by using this macro on a statically allocated context, or using this macro twice on the same context), but a context must not be re-initialized after it has been used by a Try/Catch statement. Try statement Catch (expression) statement The Try/Catch/Throw macros are capitalized in order to avoid confusion with the C++ keywords, which have subtly different semantics. A Try/Catch statement has a syntax similar to an if/else statement, except that the parenthesized expression goes after the second keyword rather than the first. As with if/else, there are two clauses, each of which may be a simple statement ending with a semicolon or a brace-enclosed compound statement. But whereas the else clause is optional, the Catch clause is required. The expression must be a modifiable lvalue (something capable of being assigned to) of the same type (disregarding type qualifiers) that was passed to define_exception_type(). If a Throw that uses the same exception context as the Try/Catch is executed within the Try clause (typically within a function called by the Try clause), and the exception is not caught by a nested Try/Catch statement, then a copy of the exception will be assigned to the expression, and control will jump to the Catch clause. If no such Throw is executed, then the assignment is not performed, and the Catch clause is not executed. The expression is not evaluated unless and until the exception is caught, which is significant if it has side effects, for example: Try foo(); Catch (p[++i].e) { ... } IMPORTANT: Jumping into or out of a Try clause (for example via return, break, continue, goto, longjmp) is forbidden--the compiler will not complain, but bad things will happen at run-time. Jumping into or out of a Catch clause is okay, and so is jumping around inside a Try clause. In many cases where one is tempted to return from a Try clause, it will suffice to use Throw, and then return from the Catch clause. Another option is to set a flag variable and use goto to jump to the end of the Try clause, then check the flag after the Try/Catch statement. IMPORTANT: The values of any non-volatile automatic variables changed within the Try clause are undefined after an exception is caught. Therefore, variables modified inside the Try block whose values are needed later outside the Try block must either use static storage or be declared with the "volatile" type qualifier. Throw expression; A Throw statement is very much like a return statement, except that the expression is required. Whereas return jumps back to the place where the current function was called, Throw jumps back to the Catch clause of the innermost enclosing Try clause. The expression must be compatible with the type passed to define_exception_type(). The exception must be caught, otherwise the program may crash. Slight limitation: If the expression is a comma-expression it must be enclosed in parentheses. Try statement Catch_anonymous statement When the value of the exception is not needed, a Try/Catch statement can use Catch_anonymous instead of Catch (expression). Everything below this point is for the benefit of the compiler. The application programmer should pretend not to know any of it, because it is subject to change. ===*/ #ifndef CEXCEPT_H #define CEXCEPT_H #include <setjmp.h> #define define_exception_type(etype) \ struct exception_context { \ jmp_buf *penv; \ int caught; \ /* start patch */ \ const char * file; \ const char * func; \ int line; \ /* end patchk */ \ volatile struct { etype etmp; } v; \ } /* etmp must be volatile because the application might use automatic */ /* storage for the_exception_context, and etmp is modified between */ /* the calls to setjmp() and longjmp(). A wrapper struct is used to */ /* avoid warnings about a duplicate volatile qualifier in case etype */ /* already includes it. */ #define init_exception_context(ec) ((void)((ec)->penv = 0)) #define Try \ { \ jmp_buf *exception__prev, exception__env; \ exception__prev = the_exception_context->penv; \ the_exception_context->penv = &exception__env; \ if (setjmp(exception__env) == 0) { \ if (&exception__prev) #define exception__catch(action) \ else { } \ the_exception_context->caught = 0; \ } \ else { \ the_exception_context->caught = 1; \ } \ the_exception_context->penv = exception__prev; \ } \ if (!the_exception_context->caught || action) { } \ else #define Catch(e) exception__catch(((e) = the_exception_context->v.etmp, 0)) #define Catch_anonymous exception__catch(0) /* Try ends with if(), and Catch begins and ends with else. This */ /* ensures that the Try/Catch syntax is really the same as the */ /* if/else syntax. */ /* */ /* We use &exception__prev instead of 1 to appease compilers that */ /* warn about constant expressions inside if(). Most compilers */ /* should still recognize that &exception__prev is never zero and */ /* avoid generating test code. */ #ifndef __func__ #ifdef __FUNCTION__ #define __func__ __FUNCTION__ #else #define __func__ "unsupported" #endif #endif #define Throw \ for ( /*start patch*/ the_exception_context->func = __func__, \ the_exception_context->file = __FILE__, \ the_exception_context->line = __LINE__ /* end patch */\ ; ; longjmp(*the_exception_context->penv, 1)) \ the_exception_context->v.etmp = #endif /* CEXCEPT_H */
39.307143
75
0.719789
fa1f3585189385d321ced97a381b05032d79a8a4
3,725
h
C
src/heap.h
MacroPower/mprofile
be59539858efb66d2b746a402d4b2c4a90f1e567
[ "MIT" ]
1
2021-06-05T20:45:16.000Z
2021-06-05T20:45:16.000Z
src/heap.h
MacroPower/mprofile
be59539858efb66d2b746a402d4b2c4a90f1e567
[ "MIT" ]
null
null
null
src/heap.h
MacroPower/mprofile
be59539858efb66d2b746a402d4b2c4a90f1e567
[ "MIT" ]
null
null
null
// Copyright 2019 Timothy Palpant // Adapted from heapprof, Copyright 2019 Humu, Inc. #ifndef MPROFILE_SRC_HEAP_H_ #define MPROFILE_SRC_HEAP_H_ #include <stdlib.h> #include <mutex> #include <vector> #include "third_party/google/tcmalloc/addressmap.h" #include "third_party/google/tcmalloc/sampler.h" #include "third_party/greg7mdp/parallel-hashmap/phmap.h" #include "spinlock.h" #include "stacktraces.h" class HeapProfiler { public: HeapProfiler() : HeapProfiler(kMaxFramesToCapture) {} explicit HeapProfiler(int max_frames) : max_frames_(max_frames), live_set_(malloc, free), total_mem_traced_(0), peak_mem_traced_(0) {} // Not copyable or assignable. HeapProfiler(const HeapProfiler &) = delete; HeapProfiler &operator=(const HeapProfiler &) = delete; // These each require that ptr (newptr) not be nullptr. void HandleMalloc(void *ptr, std::size_t size, bool is_raw); void HandleRealloc(void *oldptr, void *newptr, std::size_t size, bool is_raw); void HandleFree(void *ptr); std::vector<const void *> GetSnapshot(); int GetMaxFrames() const { return max_frames_; } std::vector<FuncLoc> GetTrace(const void *ptr); std::size_t GetSize(const void *ptr); std::size_t TotalMemoryTraced(); std::size_t PeakMemoryTraced(); void Reset(); private: void RecordMalloc(void *ptr, size_t size); // The information we store for a live pointer. struct LivePointer { // The trace at which it was allocated. // This is a reference to an element in traces_. CallTraceSet::TraceHandle trace_handle; // The size of the memory allocated. std::size_t size; }; int max_frames_; // Guards access to live_set_. SpinLock mu_; // Map of live pointer -> trace + size of that pointer (if it was sampled). // Protected by mu_. AddressMap<LivePointer> live_set_; std::size_t total_mem_traced_; std::size_t peak_mem_traced_; // Interned set of referenced stack traces. // Protected by the GIL. CallTraceSet traces_; }; inline void HeapProfiler::HandleMalloc(void *ptr, std::size_t size, bool is_raw) { // NOTE: Only constant expressions are safe to use as thread_local // initializers in a dynamic library. This is why the sample rate is // set as a static variable on the Sampler class. thread_local Sampler sampler; if (LIKELY(sampler.RecordAllocation(size))) { return; } if (ptr == nullptr) { return; } // The RAW allocator may be called without the GIL held. // We may increase references to the filename fields in the // code object when we save the trace, so we need to first ensure that // the GIL is held. PyGILState_STATE gil_state; if (is_raw) { gil_state = PyGILState_Ensure(); } RecordMalloc(ptr, size); if (is_raw) { PyGILState_Release(gil_state); } } inline void HeapProfiler::HandleRealloc(void *oldptr, void *newptr, std::size_t size, bool is_raw) { assert(newptr != nullptr); if (oldptr != nullptr) { HandleFree(oldptr); } HandleMalloc(newptr, size, is_raw); } inline void HeapProfiler::HandleFree(void *ptr) { // We could use a reader-writer lock and only take the write lock // if the pointer is found in the live set. In practice this is a little // bit slower and likely not beneficial since Python is mostly // single-threaded anyway. The GIL cannot be held in HandleFree because // it would introduce a deadlock in PyThreadState_DeleteCurrent(). std::lock_guard<SpinLock> lock(mu_); LivePointer removed; if (UNLIKELY(live_set_.FindAndRemove(ptr, &removed))) { total_mem_traced_ -= removed.size; } } #endif // MPROFILE_SRC_HEAP_H_
30.040323
80
0.701745
d22614c1a9b1c15c8b4dc008d5a1362c31393beb
10,815
h
C
src-plugins/libs/vtkInria/vtkRenderingAddOn/vtkViewImage3D.h
ocommowi/medInria-public
9074e40c886881666e7a52c53309d8d28e35c0e6
[ "BSD-4-Clause" ]
null
null
null
src-plugins/libs/vtkInria/vtkRenderingAddOn/vtkViewImage3D.h
ocommowi/medInria-public
9074e40c886881666e7a52c53309d8d28e35c0e6
[ "BSD-4-Clause" ]
null
null
null
src-plugins/libs/vtkInria/vtkRenderingAddOn/vtkViewImage3D.h
ocommowi/medInria-public
9074e40c886881666e7a52c53309d8d28e35c0e6
[ "BSD-4-Clause" ]
null
null
null
/*========================================================================= medInria Copyright (c) INRIA 2013. All rights reserved. See LICENSE.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. =========================================================================*/ #pragma once #include "vtkRenderingAddOnExport.h" #include <vector> #include <vtkRenderingAddOn/vtkViewImage.h> #include <vtkObjectFactory.h> class vtkImageData; class vtkVolumeTextureMapper3D; class vtkVolumeTextureMapper2D; class vtkGPUVolumeRayCastMapper; class vtkVolumeMapper; class vtkPiecewiseFunction; class vtkColorTransferFunction; class vtkVolume; class vtkImageActor; class vtkAxes; class vtkDataSet3DCroppingPlaneCallback; class vtkTubeFilter; class vtkAnnotatedCubeActor; class vtkOrientationMarkerWidget; class vtkAxesActor; class vtkImageBlend; class vtkViewImage2D; class vtkScalarsToColors; class vtkColorTransferFunction; class vtkDataSet; class vtkProperty; class vtkOrientedBoxWidget; class vtkPlaneWidget; class vtkVolumeProperty; class vtkImageMapToColors; class vtkImageMapToWindowLevelColors; class vtkImage3DCroppingBoxCallback; /** \class vtkViewImage3D vtkViewImage3D.h "vtkViewImage3D.h" \brief 3D image 3D rendering viewer \author Pierre Fillard & Marc Traina & Nicolas Toussaint This class allows to view 3D images. Images have to be vtkImageData. It also handles an overlapping image. volume rendering and mulptiplane reconstructions are provided remote plan can also be used, so can be an orientation cube, ... */ class VTK_RENDERINGADDON_EXPORT vtkViewImage3D : public vtkViewImage { public: static vtkViewImage3D* New(); vtkTypeRevisionMacro(vtkViewImage3D, vtkViewImage); // 2 rendering modes are possible //BTX enum RenderingModeIds { VOLUME_RENDERING, PLANAR_RENDERING }; //ETX // 2 possible mappers for volume rendering enum VRMapperTypeIds { TextureMapper3D, GPUMapper3D }; /** In some cases, we would like to call some cleaning functions before going into the unregister vtk stuff. */ virtual void PrepareForDelete(); virtual void PrintSelf(ostream& os, vtkIndent indent); /** Set the current image. */ virtual void SetImage(vtkImageData* image); /** Set/Get window/level for mapping pixels to colors. */ virtual void SetWindow (double w); virtual void StartWindowing(); virtual void EndWindowing(); /** Set/Get window/level for mapping pixels to colors. */ virtual void SetLevel (double l); /** Set the rendering mode to volume rendering (VR). */ virtual void SetRenderingModeToVR() { this->SetRenderingMode (VOLUME_RENDERING); this->Modified(); }; /** Set the rendering mode to planar views. */ virtual void SetRenderingModeToPlanar() { this->SetRenderingMode (PLANAR_RENDERING); this->Modified(); }; /** Set/Get the rendering mode. */ virtual void SetRenderingMode (int mode); vtkGetMacro (RenderingMode, int); /** * Set/Get rendering mapper type to texture */ virtual void SetVRMapperTypeToTexture() { this->SetVRMapperType(TextureMapper3D); this->Modified(); }; /** * Set/Get rendering mapper type to GPU */ virtual void SetVRMapperTypeToGPU() { this->SetVRMapperType(GPUMapper3D); this->Modified(); }; /** * Set/Get rendering mapper type */ virtual void SetVRMapperType(VRMapperTypeIds type); vtkGetMacro (VRMapperType, VRMapperTypeIds); /** Center the view and reset the camera clipping range. */ VTK_LEGACY (virtual void Center()); /** Turn on/off the visibility of the image. */ virtual void SetVisibility (int); /** Set the box widget visibility. */ virtual void SetBoxWidgetVisibility (int a); vtkBooleanMacro (BoxWidgetVisibility, int); vtkGetMacro (BoxWidgetVisibility, bool); /** Activate / Deactivate the cropping box. */ virtual void SetCropping (int value); vtkBooleanMacro (Cropping, int); vtkGetMacro (Cropping, int); /** Set the plane widget On/Off. */ virtual void SetPlaneWidgetVisibility (int a); vtkBooleanMacro (PlaneWidgetVisibility, int); vtkGetMacro (PlaneWidgetVisibility, int); /** Get the dataset callback. */ vtkGetObjectMacro (DataSetCallback, vtkDataSet3DCroppingPlaneCallback); /** Set the visibility of the 3D cursor. */ virtual void SetAxisVisibility (int a); vtkBooleanMacro (AxisVisibility, int); vtkGetMacro (AxisVisibility, int); /** Set the orientation cube visibility. */ virtual void SetCubeVisibility (int a); vtkBooleanMacro (CubeVisibility, int); vtkGetMacro (CubeVisibility, int); /** Change the Ray Cast function to composite (default). */ virtual void SetVolumeRayCastFunctionToComposite(); /** Change the Ray Cast function to MIP. */ virtual void SetVolumeRayCastFunctionToMIP(); /** Swith On/Off shading when VR is On. */ virtual void SetShade (int); vtkBooleanMacro (Shade, int); vtkGetMacro (Shade, int); /** Presets for VR quality. */ virtual void SetVRQualityToLow(); virtual void SetVRQualityToMed(); virtual void SetVRQualityToHigh(); virtual void SetVRQuality (int); vtkGetMacro (VRQuality, int); /** Set an overlapping image */ virtual void SetOverlappingImage (vtkImageData*); /** Remove the overlapping image */ virtual void RemoveOverlappingImage(); /** Set a user-defined lookup table. */ virtual void SetLookupTable (vtkScalarsToColors* lut); /** Returns the Color transfer function object. */ vtkScalarsToColors* GetColorFunction() const; /** Get the volume actor object. */ vtkGetObjectMacro (VolumeActor, vtkVolume); /** Get each plane's actor object. */ vtkGetObjectMacro (ActorAxial, vtkImageActor); vtkGetObjectMacro (ActorSagittal, vtkImageActor); vtkGetObjectMacro (ActorCoronal, vtkImageActor); /** Get the plane widget object. */ vtkGetObjectMacro (PlaneWidget, vtkPlaneWidget); /** Get the volume property object. */ vtkGetObjectMacro (VolumeProperty, vtkVolumeProperty); /** Get the box widget object. */ vtkGetObjectMacro (BoxWidget, vtkOrientedBoxWidget); virtual void UpdatePosition(); /** Set/Get each plane visibility flag. */ void SetShowAxial (int val); vtkGetMacro (ShowAxial, int); vtkBooleanMacro (ShowAxial, int); /** Set/Get each plane visibility flag */ void SetShowCoronal (int val); vtkGetMacro (ShowCoronal, int); vtkBooleanMacro (ShowCoronal, int); /** Set/Get each plane visibility flag */ void SetShowSagittal (int val); vtkGetMacro (ShowSagittal, int); vtkBooleanMacro (ShowSagittal, int); /** Add a dataset to the view (polydata or grid) the dataset will be display as its intersection with the displayed image slice i.e. tetrahedron will be displayed as triangles, triangles as lines, lines as points you can associate a property to be plugged into the dataset actor */ virtual vtkActor* AddDataSet (vtkDataSet* dataset, vtkProperty* property = NULL); /** This method colorizes a given dataset (previously added with AddDataSet()) by one of its arrays It doesn't handle a specific component colorization yet. If the array contains multi component scalars, It takes the norm of the vector. */ virtual void ColorDataSetByArray(vtkDataSet* dataset, const char* arrayname, vtkColorTransferFunction* transfer); virtual void SetDirectionMatrix (vtkMatrix4x4*); virtual void Initialize(); virtual void Uninitialize(); virtual void InitializeInteractor(); virtual void UninitializeInteractor(); protected: vtkViewImage3D(); ~vtkViewImage3D(); virtual void UpdateDataSetPipeline (vtkDataSet* dataset); private: /// overlap image vtkImageData* OverlappingImage; // texture mapper in 3D vtkVolumeMapper* VolumeMapper3D; // Default mapper in 3D (slow) vtkVolumeTextureMapper3D* VolumeTextureMapper3D; vtkVolumeTextureMapper2D* VolumeTextureMapper2D; // GPU mapper in 3D (fast) vtkGPUVolumeRayCastMapper* VolumeGPUMapper3D; // volume property vtkVolumeProperty* VolumeProperty; // volume actor vtkVolume* VolumeActor; // opacity transfer function vtkPiecewiseFunction* OpacityFunction; // color transfer function vtkColorTransferFunction* ColorFunction; // axes vtkAxes* Axes; int AxisVisibility; // turn axes into tubes vtkTubeFilter* TubeFilter; // axes actor vtkActor* AxesActor; // box widget vtkOrientedBoxWidget* BoxWidget; int BoxWidgetVisibility; int PlaneWidgetVisibility; int CubeVisibility; // vtkImagePlane widget vtkPlaneWidget* PlaneWidget; // image 3D cropping box callback vtkImage3DCroppingBoxCallback* Callback; vtkDataSet3DCroppingPlaneCallback* DataSetCallback; //vtkImage3DImagePlaneCallback* PlaneCallback; // 4 image blenders vtkImageBlend* AxialBlender; vtkImageBlend* SagittalBlender; vtkImageBlend* CoronalBlender; vtkImageBlend* Blender; // Image color mapper vtkImageMapToColors* AxialColorMapper; vtkImageMapToColors* SagittalColorMapper; vtkImageMapToColors* CoronalColorMapper; // actors vtkImageActor* ActorSagittal; vtkImageActor* ActorCoronal; vtkImageActor* ActorAxial; // rendering mode RenderingModeIds RenderingMode; // mapper type VRMapperTypeIds VRMapperType; // annotated cube actor vtkAnnotatedCubeActor* Cube; vtkAxesActor* CubeAxes; vtkOrientationMarkerWidget* Marker; // Flags for showing the planes int ShowAxial; int ShowCoronal; int ShowSagittal; int Cropping; int Shade; int VRQuality; /* //BTX */ /* std::vector<vtkDataSet*> DataSetList; */ /* std::vector<vtkActor*> DataSetActorList; */ /* //ETX */ };
22.720588
117
0.661951
d24417b31c025465903322a84e53c7cb5e21f9e6
8,216
h
C
ui/chromeos/search_box/search_box_view_base.h
sarang-apps/darshan_browser
173649bb8a7c656dc60784d19e7bb73e07c20daa
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
ui/chromeos/search_box/search_box_view_base.h
sarang-apps/darshan_browser
173649bb8a7c656dc60784d19e7bb73e07c20daa
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
ui/chromeos/search_box/search_box_view_base.h
sarang-apps/darshan_browser
173649bb8a7c656dc60784d19e7bb73e07c20daa
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_CHROMEOS_SEARCH_BOX_SEARCH_BOX_VIEW_BASE_H_ #define UI_CHROMEOS_SEARCH_BOX_SEARCH_BOX_VIEW_BASE_H_ #include <vector> #include "base/bind.h" #include "base/macros.h" #include "base/strings/string16.h" #include "ui/chromeos/search_box/search_box_constants.h" #include "ui/chromeos/search_box/search_box_export.h" #include "ui/events/types/event_type.h" #include "ui/views/background.h" #include "ui/views/controls/button/image_button.h" #include "ui/views/controls/textfield/textfield_controller.h" #include "ui/views/widget/widget_delegate.h" namespace gfx { class ImageSkia; } // namespace gfx namespace views { class BoxLayout; class ImageView; class Textfield; class View; } // namespace views namespace search_box { class SearchBoxViewDelegate; class SearchBoxImageButton; // These are used in histograms, do not remove/renumber entries. If you're // adding to this enum with the intention that it will be logged, update the // SearchBoxActivationSource enum listing in tools/metrics/histograms/enums.xml. enum class ActivationSource { kMousePress = 0, kKeyPress = 1, kGestureTap = 2, kMaxValue = kGestureTap, }; // TODO(wutao): WidgetDelegateView owns itself and cannot be deleted from the // views hierarchy automatically. Make SearchBoxViewBase a subclass of View // instead of WidgetDelegateView. // SearchBoxViewBase consists of icons and a Textfield. The Textfiled is for // inputting queries and triggering callbacks. The icons include a search icon, // a close icon and a back icon for different functionalities. This class // provides common functions for the search box view across Chrome OS. class SEARCH_BOX_EXPORT SearchBoxViewBase : public views::WidgetDelegateView, public views::TextfieldController, public views::ButtonListener { public: explicit SearchBoxViewBase(SearchBoxViewDelegate* delegate); ~SearchBoxViewBase() override; void Init(); bool HasSearch() const; // Returns the bounds to use for the view (including the shadow) given the // desired bounds of the search box contents. gfx::Rect GetViewBoundsForSearchBoxContentsBounds( const gfx::Rect& rect) const; views::ImageButton* assistant_button(); views::ImageButton* back_button(); views::ImageButton* close_button(); views::Textfield* search_box() { return search_box_; } // Swaps the google icon with the back button. void ShowBackOrGoogleIcon(bool show_back_button); // Setting the search box active left aligns the placeholder text, changes // the color of the placeholder text, and enables cursor blink. Setting the // search box inactive center aligns the placeholder text, sets the color, and // disables cursor blink. void SetSearchBoxActive(bool active, ui::EventType event_type); // Handles Gesture and Mouse Events sent from |search_box_|. bool OnTextfieldEvent(ui::EventType type); // Overridden from views::View: gfx::Size CalculatePreferredSize() const override; const char* GetClassName() const override; void OnGestureEvent(ui::GestureEvent* event) override; void OnMouseEvent(ui::MouseEvent* event) override; // Allows for search box to be notified of gestures occurring outside, without // deactivating the searchbox. void NotifyGestureEvent(); // Overridden from views::WidgetDelegate: ax::mojom::Role GetAccessibleWindowRole() override; bool ShouldAdvanceFocusToTopLevelWidget() const override; // Overridden from views::ButtonListener: void ButtonPressed(views::Button* sender, const ui::Event& event) override; // Called when tablet mode starts and ends. void OnTabletModeChanged(bool started); // Used only in the tests to get the current search icon. views::ImageView* get_search_icon_for_test() { return search_icon_; } // Whether the search box is active. bool is_search_box_active() const { return is_search_box_active_; } void set_show_close_button_when_active(bool show_button) { show_close_button_when_active_ = show_button; } bool show_assistant_button() { return show_assistant_button_; } void OnSearchBoxFocusedChanged(); // Whether the trimmed query in the search box is empty. bool IsSearchBoxTrimmedQueryEmpty() const; virtual void ClearSearch(); // Returns selected view in contents view. virtual views::View* GetSelectedViewInContentsView(); protected: // Fires query change notification. void NotifyQueryChanged(); // Nofifies the active status change. void NotifyActiveChanged(); // Sets the search box color. void SetSearchBoxColor(SkColor color); SkColor search_box_color() const { return search_box_color_; } // Updates the visibility of close button. void UpdateButtonsVisisbility(); // Overridden from views::TextfieldController: void ContentsChanged(views::Textfield* sender, const base::string16& new_contents) override; bool HandleMouseEvent(views::Textfield* sender, const ui::MouseEvent& mouse_event) override; bool HandleGestureEvent(views::Textfield* sender, const ui::GestureEvent& gesture_event) override; views::BoxLayout* box_layout() { return box_layout_; } void set_is_tablet_mode(bool is_tablet_mode) { is_tablet_mode_ = is_tablet_mode; } bool is_tablet_mode() const { return is_tablet_mode_; } void SetSearchBoxBackgroundCornerRadius(int corner_radius); void SetSearchIconImage(gfx::ImageSkia image); void SetShowAssistantButton(bool show); // Detects |ET_MOUSE_PRESSED| and |ET_GESTURE_TAP| events on the white // background of the search box. virtual void HandleSearchBoxEvent(ui::LocatedEvent* located_event); // Updates the search box's background color. virtual void UpdateBackgroundColor(SkColor color); // Gets the search box background. views::Background* GetSearchBoxBackground(); private: virtual void ModelChanged() {} // Shows/hides the virtual keyboard if the search box is active. virtual void UpdateKeyboardVisibility() {} // Updates model text and selection model with current Textfield info. virtual void UpdateModel(bool initiated_by_user) {} // Updates the search icon. virtual void UpdateSearchIcon() {} // Update search box border based on whether the search box is activated. virtual void UpdateSearchBoxBorder() {} // Setup button's image, accessible name, and tooltip text etc. virtual void SetupAssistantButton() {} virtual void SetupCloseButton() {} virtual void SetupBackButton() {} // Records in histograms the activation of the searchbox. virtual void RecordSearchBoxActivationHistogram(ui::EventType event_type) {} void OnEnabledChanged(); SearchBoxViewDelegate* delegate_; // Not owned. // Owned by views hierarchy. views::View* content_container_; views::ImageView* search_icon_ = nullptr; SearchBoxImageButton* assistant_button_ = nullptr; SearchBoxImageButton* back_button_ = nullptr; SearchBoxImageButton* close_button_ = nullptr; views::Textfield* search_box_; views::View* search_box_right_space_ = nullptr; // Owned by |content_container_|. It is deleted when the view is deleted. views::BoxLayout* box_layout_ = nullptr; // Whether the search box is active. bool is_search_box_active_ = false; // Whether to show close button if the search box is active. bool show_close_button_when_active_ = false; // Whether to show assistant button. bool show_assistant_button_ = false; // Whether tablet mode is active. bool is_tablet_mode_ = false; // The current search box color. SkColor search_box_color_ = kDefaultSearchboxColor; views::PropertyChangedSubscription enabled_changed_subscription_ = AddEnabledChangedCallback( base::BindRepeating(&SearchBoxViewBase::OnEnabledChanged, base::Unretained(this))); DISALLOW_COPY_AND_ASSIGN(SearchBoxViewBase); }; } // namespace search_box #endif // UI_CHROMEOS_SEARCH_BOX_SEARCH_BOX_VIEW_BASE_H_
34.961702
80
0.752191
cfc20a130ef88cd96248847037c13d4fb9524464
179
h
C
docs/vendor/bundle/ruby/3.1.0/gems/commonmarker-0.23.4/ext/commonmarker/cmark-gfm_version.h
GeoMOER/moer-bsc-project-seminar-upscaling
e732c590e5679dda854dfd5dc2036505f8149370
[ "MIT" ]
7
2018-03-18T09:07:52.000Z
2018-04-17T21:14:20.000Z
docs/vendor/bundle/ruby/3.1.0/gems/commonmarker-0.23.4/ext/commonmarker/cmark-gfm_version.h
GeoMOER/moer-bsc-project-seminar-upscaling
e732c590e5679dda854dfd5dc2036505f8149370
[ "MIT" ]
7
2018-03-31T07:26:31.000Z
2018-04-26T04:40:15.000Z
docs/vendor/bundle/ruby/3.1.0/gems/commonmarker-0.23.4/ext/commonmarker/cmark-gfm_version.h
GeoMOER/moer-bsc-project-seminar-upscaling
e732c590e5679dda854dfd5dc2036505f8149370
[ "MIT" ]
3
2018-03-31T07:13:23.000Z
2018-04-25T12:50:06.000Z
#ifndef CMARK_GFM_VERSION_H #define CMARK_GFM_VERSION_H #define CMARK_GFM_VERSION ((0 << 24) | (29 << 16) | (0 << 8) | 3) #define CMARK_GFM_VERSION_STRING "0.29.0.gfm.3" #endif
22.375
65
0.703911
9aa026b7b04e911b3987d602200086a1e1c97a82
1,824
h
C
release/src/router/tor/src/or/hibernate.h
ghsecuritylab/bcwifi
4cd7a6989921930f39816583014728b9f07a09a3
[ "FSFAP" ]
null
null
null
release/src/router/tor/src/or/hibernate.h
ghsecuritylab/bcwifi
4cd7a6989921930f39816583014728b9f07a09a3
[ "FSFAP" ]
null
null
null
release/src/router/tor/src/or/hibernate.h
ghsecuritylab/bcwifi
4cd7a6989921930f39816583014728b9f07a09a3
[ "FSFAP" ]
2
2017-08-10T23:52:49.000Z
2020-03-08T02:39:40.000Z
/* Copyright (c) 2001 Matej Pfajfar. * Copyright (c) 2001-2004, Roger Dingledine. * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson. * Copyright (c) 2007-2012, The Tor Project, Inc. */ /* See LICENSE for licensing information */ /** * \file hibernate.h * \brief Header file for hibernate.c. **/ #ifndef _TOR_HIBERNATE_H #define _TOR_HIBERNATE_H int accounting_parse_options(const or_options_t *options, int validate_only); int accounting_is_enabled(const or_options_t *options); int accounting_get_interval_length(void); void configure_accounting(time_t now); void accounting_run_housekeeping(time_t now); void accounting_add_bytes(size_t n_read, size_t n_written, int seconds); int accounting_record_bandwidth_usage(time_t now, or_state_t *state); void hibernate_begin_shutdown(void); int we_are_hibernating(void); void consider_hibernation(time_t now); int getinfo_helper_accounting(control_connection_t *conn, const char *question, char **answer, const char **errmsg); #ifdef HIBERNATE_PRIVATE /** Possible values of hibernate_state */ typedef enum { /** We are running normally. */ HIBERNATE_STATE_LIVE=1, /** We're trying to shut down cleanly, and we'll kill all active connections * at shutdown_time. */ HIBERNATE_STATE_EXITING=2, /** We're running low on allocated bandwidth for this period, so we won't * accept any new connections. */ HIBERNATE_STATE_LOWBANDWIDTH=3, /** We are hibernating, and we won't wake up till there's more bandwidth to * use. */ HIBERNATE_STATE_DORMANT=4, /** We start out in state default, which means we havent decided which state * we're in. */ HIBERNATE_STATE_INITIAL=5 } hibernate_state_t; void hibernate_set_state_for_testing_(hibernate_state_t newstate); #endif #endif
34.415094
78
0.743969
2ce1821598b3113a32ed24ef554fadf21a9f8186
48,568
c
C
mplayer/libvo/vo_dfbmga.c
qinjidong/EasyMPlayer
76a8d052dd7a2d5f1916fdc32b07088d127ee5da
[ "Apache-2.0" ]
null
null
null
mplayer/libvo/vo_dfbmga.c
qinjidong/EasyMPlayer
76a8d052dd7a2d5f1916fdc32b07088d127ee5da
[ "Apache-2.0" ]
null
null
null
mplayer/libvo/vo_dfbmga.c
qinjidong/EasyMPlayer
76a8d052dd7a2d5f1916fdc32b07088d127ee5da
[ "Apache-2.0" ]
1
2021-04-15T18:27:37.000Z
2021-04-15T18:27:37.000Z
/* * MPlayer video driver for DirectFB / Matrox G200/G400/G450/G550 * * copyright (C) 2002-2008 Ville Syrjala <syrjala@sci.fi> * Originally based on vo_directfb.c by Jiri Svoboda <Jiri.Svoboda@seznam.cz>. * * This file is part of MPlayer. * * MPlayer is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * MPlayer is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with MPlayer; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include <directfb.h> #include <directfb_version.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <strings.h> #include "config.h" #include "video_out.h" #define NO_DRAW_FRAME #include "video_out_internal.h" #include "libmpcodecs/vf.h" #include "fastmemcpy.h" #include "sub/sub.h" #include "mp_msg.h" #include "aspect.h" #include "mp_fifo.h" static const vo_info_t info = { "DirectFB / Matrox G200/G400/G450/G550", "dfbmga", "Ville Syrjala <syrjala@sci.fi>", "" }; const LIBVO_EXTERN(dfbmga) static IDirectFB *dfb; static IDirectFBDisplayLayer *crtc1; static IDirectFBDisplayLayer *bes; static IDirectFBDisplayLayer *crtc2; static IDirectFBDisplayLayer *spic; static int num_bufs; static int current_buf; static int current_ip_buf; static IDirectFBSurface *bufs[3]; static IDirectFBSurface *frame; static IDirectFBSurface *subframe; static IDirectFBSurface *besframe; static IDirectFBSurface *c1frame; static IDirectFBSurface *c2frame; static IDirectFBSurface *spicframe; static DFBSurfacePixelFormat frame_format; static DFBSurfacePixelFormat subframe_format; static DFBRectangle besrect; static DFBRectangle c1rect; static DFBRectangle c2rect; static DFBRectangle *subrect; static IDirectFBInputDevice *keyboard; static IDirectFBInputDevice *remote; static IDirectFBEventBuffer *buffer; static int blit_done; static int c1stretch; static int c2stretch; static int use_bes; static int use_crtc1; static int use_crtc2; static int use_spic; static int use_input; static int use_remote; static int field_parity; static int flipping; static DFBDisplayLayerBufferMode buffermode; static int tvnorm; static int osd_changed; static int osd_dirty; static int osd_current; static int osd_max; static int is_g200; static uint32_t in_width; static uint32_t in_height; static uint32_t buf_height; static uint32_t screen_width; static uint32_t screen_height; static uint32_t sub_width; static uint32_t sub_height; static char * pixelformat_name( DFBSurfacePixelFormat format ) { switch(format) { case DSPF_ARGB: return "ARGB"; case DSPF_RGB32: return "RGB32"; case DSPF_RGB16: return "RGB16"; case DSPF_ARGB1555: return "ARGB1555"; case DSPF_YUY2: return "YUY2"; case DSPF_UYVY: return "UYVY"; case DSPF_YV12: return "YV12"; case DSPF_I420: return "I420"; case DSPF_ALUT44: return "ALUT44"; case DSPF_NV12: return "NV12"; case DSPF_NV21: return "NV21"; default: return "Unknown pixel format"; } } static DFBSurfacePixelFormat imgfmt_to_pixelformat( uint32_t format ) { switch (format) { case IMGFMT_BGR32: return DSPF_RGB32; case IMGFMT_BGR16: return DSPF_RGB16; case IMGFMT_BGR15: return DSPF_ARGB1555; case IMGFMT_YUY2: return DSPF_YUY2; case IMGFMT_UYVY: return DSPF_UYVY; case IMGFMT_YV12: return DSPF_YV12; case IMGFMT_I420: case IMGFMT_IYUV: return DSPF_I420; case IMGFMT_NV12: return DSPF_NV12; case IMGFMT_NV21: return DSPF_NV21; default: return DSPF_UNKNOWN; } } struct layer_enum { const char *name; IDirectFBDisplayLayer **layer; DFBResult res; }; static DFBEnumerationResult get_layer_by_name( DFBDisplayLayerID id, DFBDisplayLayerDescription desc, void *data ) { struct layer_enum *l = (struct layer_enum *) data; if (!strcmp( l->name, desc.name )) if ((l->res = dfb->GetDisplayLayer( dfb, id, l->layer )) == DFB_OK) return DFENUM_CANCEL; return DFENUM_OK; } static int preinit( const char *arg ) { DFBResult res; int force_input = -1; /* Some defaults */ use_bes = 0; use_crtc1 = 0; use_crtc2 = 1; use_spic = 1; field_parity = -1; buffermode = DLBM_TRIPLE; osd_max = 4; flipping = 1; tvnorm = -1; use_input = !getenv( "DISPLAY" ); if (vo_subdevice) { int show_help = 0; int opt_no = 0; while (*vo_subdevice != '\0') { if (!strncmp(vo_subdevice, "bes", 3)) { use_bes = !opt_no; vo_subdevice += 3; opt_no = 0; } else if (!strncmp(vo_subdevice, "crtc1", 5)) { use_crtc1 = !opt_no; vo_subdevice += 5; opt_no = 0; } else if (!strncmp(vo_subdevice, "crtc2", 5)) { use_crtc2 = !opt_no; vo_subdevice += 5; opt_no = 0; } else if (!strncmp(vo_subdevice, "spic", 4)) { use_spic = !opt_no; vo_subdevice += 4; opt_no = 0; } else if (!strncmp(vo_subdevice, "input", 5)) { force_input = !opt_no; vo_subdevice += 5; opt_no = 0; } else if (!strncmp(vo_subdevice, "remote", 6)) { use_remote = !opt_no; vo_subdevice += 6; opt_no = 0; } else if (!strncmp(vo_subdevice, "buffermode=", 11)) { if (opt_no) { show_help = 1; break; } vo_subdevice += 11; if (!strncmp(vo_subdevice, "single", 6)) { buffermode = DLBM_FRONTONLY; osd_max = 1; flipping = 0; vo_subdevice += 6; } else if (!strncmp(vo_subdevice, "double", 6)) { buffermode = DLBM_BACKVIDEO; osd_max = 2; flipping = 1; vo_subdevice += 6; } else if (!strncmp(vo_subdevice, "triple", 6)) { buffermode = DLBM_TRIPLE; osd_max = 4; flipping = 1; vo_subdevice += 6; } else { show_help = 1; break; } opt_no = 0; } else if (!strncmp(vo_subdevice, "fieldparity=", 12)) { if (opt_no) { show_help = 1; break; } vo_subdevice += 12; if (!strncmp(vo_subdevice, "top", 3)) { field_parity = 0; vo_subdevice += 3; } else if (!strncmp(vo_subdevice, "bottom", 6)) { field_parity = 1; vo_subdevice += 6; } else { show_help = 1; break; } opt_no = 0; } else if (!strncmp(vo_subdevice, "tvnorm=", 7)) { if (opt_no) { show_help = 1; break; } vo_subdevice += 7; if (!strncmp(vo_subdevice, "pal", 3)) { tvnorm = 0; vo_subdevice += 3; } else if (!strncmp(vo_subdevice, "ntsc" , 4)) { tvnorm = 1; vo_subdevice += 4; } else if (!strncmp(vo_subdevice, "auto" , 4)) { tvnorm = 2; vo_subdevice += 4; } else { show_help = 1; break; } opt_no = 0; } else if (!strncmp(vo_subdevice, "no", 2)) { if (opt_no) { show_help = 1; break; } vo_subdevice += 2; opt_no = 1; } else if (*vo_subdevice == ':') { if (opt_no) { show_help = 1; break; } vo_subdevice++; opt_no = 0; } else { show_help = 1; break; } } if (show_help) { mp_msg( MSGT_VO, MSGL_ERR, "\nvo_dfbmga command line help:\n" "Example: mplayer -vo dfbmga:nocrtc2:bes:buffermode=single\n" "\nOptions (use 'no' prefix to disable):\n" " bes Use Backend Scaler\n" " crtc1 Use CRTC1\n" " crtc2 Use CRTC2\n" " spic Use hardware sub-picture for OSD\n" " input Use DirectFB for keyboard input\n" " remote Use DirectFB for remote control input\n" "\nOther options:\n" " buffermode=(single|double|triple)\n" " single Use single buffering\n" " double Use double buffering\n" " triple Use triple buffering\n" " fieldparity=(top|bottom)\n" " top Top field first\n" " bottom Bottom field first\n" " tvnorm=(pal|ntsc|auto)\n" " pal Force PAL\n" " ntsc Force NTSC\n" " auto Select according to FPS\n" "\n" ); return -1; } } if (!use_bes && !use_crtc1 && !use_crtc2) { mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: No output selected\n" ); return -1; } if (use_bes && use_crtc1) { mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Both BES and CRTC1 outputs selected\n" ); return -1; } if ((res = DirectFBInit( NULL, NULL )) != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: DirectFBInit() failed - %s\n", DirectFBErrorString( res ) ); return -1; } switch (tvnorm) { case 0: DirectFBSetOption( "matrox-tv-standard", "pal" ); mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: Forced TV standard to PAL\n" ); break; case 1: DirectFBSetOption( "matrox-tv-standard", "ntsc" ); mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: Forced TV standard to NTSC\n" ); break; case 2: if (vo_fps > 27) { DirectFBSetOption( "matrox-tv-standard", "ntsc" ); mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: Selected TV standard based upon FPS: NTSC\n" ); } else { DirectFBSetOption( "matrox-tv-standard", "pal" ); mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: Selected TV standard based upon FPS: PAL\n" ); } break; } if ((res = DirectFBCreate( &dfb )) != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: DirectFBCreate() failed - %s\n", DirectFBErrorString( res ) ); return -1; } if (use_crtc1 || use_bes) { struct layer_enum l = { "FBDev Primary Layer", &crtc1, DFB_UNSUPPORTED }; dfb->EnumDisplayLayers( dfb, get_layer_by_name, &l ); if (l.res != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Can't get CRTC1 layer - %s\n", DirectFBErrorString( l.res ) ); uninit(); return -1; } if ((res = crtc1->SetCooperativeLevel( crtc1, DLSCL_EXCLUSIVE )) != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, "Can't get exclusive access to CRTC1 layer - %s\n", DirectFBErrorString( res ) ); uninit(); return -1; } use_input = 1; } if (force_input != -1) use_input = force_input; if (use_bes) { DFBDisplayLayerConfig dlc; DFBDisplayLayerConfigFlags failed; struct layer_enum l = { "Matrox Backend Scaler", &bes, DFB_UNSUPPORTED }; dfb->EnumDisplayLayers( dfb, get_layer_by_name, &l ); if (l.res != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, "Can't get BES layer - %s\n", DirectFBErrorString( l.res ) ); uninit(); return -1; } if ((res = bes->SetCooperativeLevel( bes, DLSCL_EXCLUSIVE )) != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, "Can't get exclusive access to BES - %s\n", DirectFBErrorString( res ) ); uninit(); return -1; } dlc.flags = DLCONF_PIXELFORMAT; dlc.pixelformat = DSPF_RGB16; if (bes->TestConfiguration( bes, &dlc, &failed ) != DFB_OK) { is_g200 = 1; use_crtc2 = 0; } } if (use_crtc2) { struct layer_enum l = { "Matrox CRTC2 Layer", &crtc2, DFB_UNSUPPORTED }; dfb->EnumDisplayLayers( dfb, get_layer_by_name, &l ); if (l.res != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, "Can't get CRTC2 layer - %s\n", DirectFBErrorString( l.res ) ); uninit(); return -1; } if ((res = crtc2->SetCooperativeLevel( crtc2, DLSCL_EXCLUSIVE )) != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, "Can't get exclusive access to CRTC2 - %s\n", DirectFBErrorString( res ) ); uninit(); return -1; } } if (use_input || use_remote) { if ((res = dfb->CreateEventBuffer( dfb, &buffer )) != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Can't create event buffer - %s\n", DirectFBErrorString( res ) ); uninit(); return -1; } } if (use_input) { if ((res = dfb->GetInputDevice( dfb, DIDID_KEYBOARD, &keyboard )) != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Can't get keyboard - %s\n", DirectFBErrorString( res ) ); uninit(); return -1; } if ((res = keyboard->AttachEventBuffer( keyboard, buffer )) != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Can't attach event buffer to keyboard - %s\n", DirectFBErrorString( res ) ); uninit(); return -1; } } if (use_remote) { if ((res = dfb->GetInputDevice( dfb, DIDID_REMOTE, &remote )) != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Can't get remote control - %s\n", DirectFBErrorString( res ) ); uninit(); return -1; } if ((res = remote->AttachEventBuffer( remote, buffer )) != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Can't attach event buffer to remote control - %s\n", DirectFBErrorString( res ) ); uninit(); return -1; } } return 0; } static void release_config( void ) { if (spicframe) spicframe->Release( spicframe ); if (spic) spic->Release( spic ); if (c2frame) c2frame->Release( c2frame ); if (c1frame) c1frame->Release( c1frame ); if (besframe) besframe->Release( besframe ); if (bufs[0]) bufs[0]->Release( bufs[0] ); if (bufs[1]) bufs[1]->Release( bufs[1] ); if (bufs[2]) bufs[2]->Release( bufs[2] ); spicframe = NULL; spic = NULL; c2frame = NULL; c1frame = NULL; besframe = NULL; bufs[0] = NULL; bufs[1] = NULL; bufs[2] = NULL; } static int config( uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format ) { DFBResult res; DFBDisplayLayerConfig dlc; DFBDisplayLayerConfigFlags failed; uint32_t out_width; uint32_t out_height; release_config(); in_width = width; in_height = height; aspect_save_orig(width, height); aspect_save_prescale(d_width, d_height); dlc.pixelformat = imgfmt_to_pixelformat( format ); { /* Draw to a temporary surface */ DFBSurfaceDescription dsc; dsc.flags = DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT; dsc.width = (in_width + 15) & ~15; dsc.height = (in_height + 15) & ~15; dsc.pixelformat = dlc.pixelformat; /* Don't waste video memory since we don't need direct stretchblit */ if (use_bes) { dsc.flags |= DSDESC_CAPS; dsc.caps = DSCAPS_SYSTEMONLY; } for (num_bufs = 0; num_bufs < 3; num_bufs++) { if ((res = dfb->CreateSurface( dfb, &dsc, &bufs[num_bufs] )) != DFB_OK) { if (num_bufs == 0) { mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Can't create surfaces - %s!\n", DirectFBErrorString( res ) ); return -1; } break; } } frame = bufs[0]; current_buf = 0; current_ip_buf = 0; buf_height = dsc.height; } frame->GetPixelFormat( frame, &frame_format ); mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: Video surface %dx%d %s\n", in_width, in_height, pixelformat_name( frame_format ) ); /* * BES */ if (use_bes) { aspect_save_screenres( 0x10000, 0x10000 ); aspect( &out_width, &out_height, A_ZOOM ); besrect.x = (0x10000 - out_width) * in_width / out_width / 2; besrect.y = (0x10000 - out_height) * in_height / out_height / 2; besrect.w = in_width; besrect.h = in_height; dlc.flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE; dlc.width = besrect.w + besrect.x * 2; dlc.height = besrect.h + besrect.y * 2; dlc.buffermode = buffermode; if ((res = bes->TestConfiguration( bes, &dlc, &failed )) != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Invalid BES configuration - %s!\n", DirectFBErrorString( res ) ); return -1; } if ((res = bes->SetConfiguration( bes, &dlc )) != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: BES configuration failed - %s!\n", DirectFBErrorString( res ) ); return -1; } bes->GetSurface( bes, &besframe ); besframe->SetBlittingFlags( besframe, DSBLIT_NOFX ); bes->SetScreenLocation( bes, 0.0, 0.0, 1.0, 1.0 ); besframe->Clear( besframe, 0, 0, 0, 0xff ); besframe->Flip( besframe, NULL, 0 ); besframe->Clear( besframe, 0, 0, 0, 0xff ); besframe->Flip( besframe, NULL, 0 ); besframe->Clear( besframe, 0, 0, 0, 0xff ); mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: BES using %s buffering\n", dlc.buffermode == DLBM_TRIPLE ? "triple" : dlc.buffermode == DLBM_BACKVIDEO ? "double" : "single" ); mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: BES surface %dx%d %s\n", dlc.width, dlc.height, pixelformat_name( dlc.pixelformat ) ); } /* * CRTC1 */ if (use_crtc1) { dlc.flags = DLCONF_BUFFERMODE; dlc.buffermode = buffermode; if ((res = crtc1->TestConfiguration( crtc1, &dlc, &failed )) != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Invalid CRTC1 configuration - %s!\n", DirectFBErrorString( res ) ); return -1; } if ((res = crtc1->SetConfiguration( crtc1, &dlc )) != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: CRTC1 configuration failed - %s!\n", DirectFBErrorString( res ) ); return -1; } if ((res = crtc1->GetConfiguration( crtc1, &dlc )) != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Getting CRTC1 configuration failed - %s!\n", DirectFBErrorString( res ) ); return -1; } crtc1->GetSurface( crtc1, &c1frame ); c1frame->SetBlittingFlags( c1frame, DSBLIT_NOFX ); c1frame->SetColor( c1frame, 0, 0, 0, 0xff ); c1frame->GetSize( c1frame, &screen_width, &screen_height ); aspect_save_screenres( screen_width, screen_height ); aspect( &out_width, &out_height, (flags & VOFLAG_FULLSCREEN) ? A_ZOOM : A_NOZOOM ); if (in_width != out_width || in_height != out_height) c1stretch = 1; else c1stretch = 0; c1rect.x = (screen_width - out_width) / 2; c1rect.y = (screen_height - out_height) / 2; c1rect.w = out_width; c1rect.h = out_height; c1frame->Clear( c1frame, 0, 0, 0, 0xff ); c1frame->Flip( c1frame, NULL, 0 ); c1frame->Clear( c1frame, 0, 0, 0, 0xff ); c1frame->Flip( c1frame, NULL, 0 ); c1frame->Clear( c1frame, 0, 0, 0, 0xff ); mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: CRTC1 using %s buffering\n", dlc.buffermode == DLBM_TRIPLE ? "triple" : dlc.buffermode == DLBM_BACKVIDEO ? "double" : "single" ); mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: CRTC1 surface %dx%d %s\n", screen_width, screen_height, pixelformat_name( dlc.pixelformat ) ); } /* * CRTC2 */ if (use_crtc2) { dlc.flags = DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE | DLCONF_OPTIONS; dlc.buffermode = buffermode; dlc.options = DLOP_NONE; if (field_parity != -1) { dlc.options |= DLOP_FIELD_PARITY; } mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: Field parity set to: "); switch (field_parity) { case -1: mp_msg( MSGT_VO, MSGL_INFO, "Don't care\n"); break; case 0: mp_msg( MSGT_VO, MSGL_INFO, "Top field first\n"); break; case 1: mp_msg( MSGT_VO, MSGL_INFO, "Bottom field first\n"); break; } switch (dlc.pixelformat) { case DSPF_I420: case DSPF_YV12: /* sub-picture supported */ break; case DSPF_YUY2: case DSPF_UYVY: /* Blit to YUY2/UYVY not supported */ dlc.pixelformat = DSPF_ARGB; /* fall through */ default: /* sub-picture not supported */ use_spic = 0; } if ((res = crtc2->TestConfiguration( crtc2, &dlc, &failed )) != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Invalid CRTC2 configuration - %s!\n", DirectFBErrorString( res ) ); return -1; } if ((res = crtc2->SetConfiguration( crtc2, &dlc )) != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: CRTC2 configuration failed - %s!\n", DirectFBErrorString( res ) ); return -1; } if (field_parity != -1) crtc2->SetFieldParity( crtc2, field_parity ); crtc2->GetSurface( crtc2, &c2frame ); c2frame->SetBlittingFlags( c2frame, DSBLIT_NOFX ); c2frame->SetColor( c2frame, 0, 0, 0, 0xff ); c2frame->GetSize( c2frame, &screen_width, &screen_height ); /* Don't stretch only slightly smaller videos */ if ((in_width > (0.95 * screen_width)) && (in_width < screen_width)) out_width = in_width; else out_width = screen_width; if ((in_height > (0.95 * screen_height)) && (in_height < screen_height)) out_height = in_height; else out_height = screen_height; aspect_save_screenres( out_width, out_height ); aspect( &out_width, &out_height, (flags & VOFLAG_FULLSCREEN) ? A_ZOOM : A_NOZOOM ); if (in_width != out_width || in_height != out_height) c2stretch = 1; else c2stretch = 0; c2rect.x = (screen_width - out_width) / 2; c2rect.y = (screen_height - out_height) / 2; c2rect.w = out_width; c2rect.h = out_height; c2frame->Clear( c2frame, 0, 0, 0, 0xff ); c2frame->Flip( c2frame, NULL, 0 ); c2frame->Clear( c2frame, 0, 0, 0, 0xff ); c2frame->Flip( c2frame, NULL, 0 ); c2frame->Clear( c2frame, 0, 0, 0, 0xff ); mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: CRTC2 using %s buffering\n", dlc.buffermode == DLBM_TRIPLE ? "triple" : dlc.buffermode == DLBM_BACKVIDEO ? "double" : "single" ); mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: CRTC2 surface %dx%d %s\n", screen_width, screen_height, pixelformat_name( dlc.pixelformat ) ); } else { use_spic = 0; } /* * Sub-picture */ if (use_spic) { /* Draw OSD to sub-picture surface */ IDirectFBPalette *palette; DFBColor color; int i; struct layer_enum l = { "Matrox CRTC2 Sub-Picture", &spic, DFB_UNSUPPORTED }; dfb->EnumDisplayLayers( dfb, get_layer_by_name, &l ); if (l.res != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Can't get sub-picture layer - %s\n", DirectFBErrorString( l.res ) ); return -1; } if ((res = spic->SetCooperativeLevel( spic, DLSCL_EXCLUSIVE )) != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, "Can't get exclusive access to sub-picture - %s\n", DirectFBErrorString( res ) ); return -1; } dlc.flags = DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE; dlc.pixelformat = DSPF_ALUT44; dlc.buffermode = buffermode; dlc.flags |= DLCONF_OPTIONS; dlc.options = DLOP_ALPHACHANNEL; if ((res = spic->TestConfiguration( spic, &dlc, &failed )) != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Invalid sub-picture configuration - %s!\n", DirectFBErrorString( res ) ); return -1; } if ((res = spic->SetConfiguration( spic, &dlc )) != DFB_OK) { mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Sub-picture configuration failed - %s!\n", DirectFBErrorString( res ) ); return -1; } spic->GetSurface( spic, &spicframe ); spicframe->GetPalette( spicframe, &palette ); color.a = 0xff; for (i = 0; i < 16; i++) { color.r = i * 17; color.g = i * 17; color.b = i * 17; palette->SetEntries( palette, &color, 1, i ); } palette->Release( palette ); spicframe->Clear( spicframe, 0, 0, 0, 0 ); spicframe->Flip( spicframe, NULL, 0 ); spicframe->Clear( spicframe, 0, 0, 0, 0 ); spicframe->Flip( spicframe, NULL, 0 ); spicframe->Clear( spicframe, 0, 0, 0, 0 ); mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: Sub-picture layer using %s buffering\n", dlc.buffermode == DLBM_TRIPLE ? "triple" : dlc.buffermode == DLBM_BACKVIDEO ? "double" : "single" ); subframe = spicframe; subrect = NULL; } else if (use_crtc2) { /* Draw OSD to CRTC2 surface */ subframe = c2frame; subrect = &c2rect; } else if (use_crtc1) { /* Draw OSD to CRTC1 surface */ subframe = c1frame; subrect = &c1rect; } else { /* Draw OSD to BES surface */ subframe = besframe; subrect = &besrect; } subframe->GetSize( subframe, &sub_width, &sub_height ); subframe->GetPixelFormat( subframe, &subframe_format ); mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: Sub-picture surface %dx%d %s (%s)\n", sub_width, sub_height, pixelformat_name( subframe_format ), use_crtc2 ? (use_spic ? "Sub-picture layer" : "CRTC2") : use_crtc1 ? "CRTC1" : "BES" ); osd_dirty = 0; osd_current = 1; blit_done = 0; return 0; } static int query_format( uint32_t format ) { switch (format) { case IMGFMT_YV12: case IMGFMT_I420: case IMGFMT_IYUV: if (is_g200 || use_crtc1) return 0; break; case IMGFMT_BGR32: case IMGFMT_BGR16: case IMGFMT_BGR15: if (is_g200 && use_bes) return 0; break; case IMGFMT_UYVY: if (is_g200) return 0; break; case IMGFMT_YUY2: break; case IMGFMT_NV12: case IMGFMT_NV21: if (use_crtc1 || use_crtc2) return 0; break; default: return 0; } return VFCAP_HWSCALE_UP | VFCAP_HWSCALE_DOWN | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_CSP_SUPPORTED | VFCAP_OSD; } static void vo_draw_alpha_alut44( int w, int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dst, int dststride ) { int x; while (h--) { for (x = 0; x < w; x++) { if (srca[x]) dst[x] = ((255 - srca[x]) & 0xF0) | (src[x] >> 4); } src += srcstride; srca += srcstride; dst += dststride; } } static void clear_alpha( int x0, int y0, int w, int h ) { if (use_spic && !flipping && vo_osd_changed_flag) subframe->FillRectangle( subframe, x0, y0, w, h ); } static void draw_alpha( int x0, int y0, int w, int h, unsigned char *src, unsigned char *srca, int stride ) { uint8_t *dst; void *ptr; int pitch; if (use_spic) { if (!osd_changed || (!flipping && !vo_osd_changed_flag)) return; osd_dirty |= osd_current; } else { if (x0 < subrect->x || y0 < subrect->y || x0 + w > subrect->x + subrect->w || y0 + h > subrect->y + subrect->h) osd_dirty |= osd_current; } if (subframe->Lock( subframe, DSLF_READ | DSLF_WRITE, &ptr, &pitch ) != DFB_OK) return; dst = ptr; switch (subframe_format) { case DSPF_ALUT44: vo_draw_alpha_alut44( w, h, src, srca, stride, dst + pitch * y0 + x0, pitch ); break; case DSPF_RGB32: case DSPF_ARGB: vo_draw_alpha_rgb32( w, h, src, srca, stride, dst + pitch * y0 + 4 * x0, pitch ); break; case DSPF_RGB16: vo_draw_alpha_rgb16( w, h, src, srca, stride, dst + pitch * y0 + 2 * x0, pitch ); break; case DSPF_ARGB1555: vo_draw_alpha_rgb15( w, h, src, srca, stride, dst + pitch * y0 + 2 * x0, pitch ); break; case DSPF_YUY2: vo_draw_alpha_yuy2( w, h, src, srca, stride, dst + pitch * y0 + 2 * x0, pitch ); break; case DSPF_UYVY: vo_draw_alpha_yuy2( w, h, src, srca, stride, dst + pitch * y0 + 2 * x0 + 1, pitch ); break; case DSPF_NV12: case DSPF_NV21: case DSPF_I420: case DSPF_YV12: vo_draw_alpha_yv12( w, h, src, srca, stride, dst + pitch * y0 + x0, pitch ); break; } subframe->Unlock( subframe ); } static int draw_slice( uint8_t * src[], int stride[], int w, int h, int x, int y ) { uint8_t *dst; void *ptr; int pitch; if (frame->Lock( frame, DSLF_WRITE, &ptr, &pitch ) != DFB_OK) return VO_FALSE; dst = ptr; memcpy_pic( dst + pitch * y + x, src[0], w, h, pitch, stride[0] ); dst += pitch * buf_height; y /= 2; h /= 2; if (frame_format == DSPF_NV12 || frame_format == DSPF_NV21) { memcpy_pic( dst + pitch * y + x, src[1], w, h, pitch, stride[1] ); } else { x /= 2; w /= 2; pitch /= 2; if (frame_format == DSPF_I420 ) memcpy_pic( dst + pitch * y + x, src[1], w, h, pitch, stride[1] ); else memcpy_pic( dst + pitch * y + x, src[2], w, h, pitch, stride[2] ); dst += pitch * buf_height / 2; if (frame_format == DSPF_I420 ) memcpy_pic( dst + pitch * y + x, src[2], w, h, pitch, stride[2] ); else memcpy_pic( dst + pitch * y + x, src[1], w, h, pitch, stride[1] ); } frame->Unlock( frame ); return VO_TRUE; } static void blit_to_screen( void ) { IDirectFBSurface *blitsrc = frame; DFBRectangle *srect = NULL; if (use_bes) { if (vo_vsync && !flipping) bes->WaitForSync( bes ); besframe->Blit( besframe, blitsrc, NULL, besrect.x, besrect.y ); blitsrc = besframe; srect = &besrect; } if (use_crtc1) { if (vo_vsync && !flipping) crtc1->WaitForSync( crtc1 ); if (c1stretch) c1frame->StretchBlit( c1frame, blitsrc, srect, &c1rect ); else c1frame->Blit( c1frame, blitsrc, srect, c1rect.x, c1rect.y ); } if (use_crtc2) { if (vo_vsync && !flipping) crtc2->WaitForSync( crtc2 ); if (c2stretch) c2frame->StretchBlit( c2frame, blitsrc, srect, &c2rect ); else c2frame->Blit( c2frame, blitsrc, srect, c2rect.x, c2rect.y ); } } static void draw_osd( void ) { frame = bufs[current_buf]; frame->Unlock( frame ); osd_changed = vo_osd_changed( 0 ); if (osd_dirty & osd_current) { if (use_spic) { if (flipping) subframe->Clear( subframe, 0, 0, 0, 0 ); } else { /* Clear black bars around the picture */ subframe->FillRectangle( subframe, 0, 0, sub_width, subrect->y ); subframe->FillRectangle( subframe, 0, subrect->y + subrect->h, sub_width, subrect->y ); subframe->FillRectangle( subframe, 0, subrect->y, subrect->x, subrect->h ); subframe->FillRectangle( subframe, subrect->x + subrect->w, subrect->y, subrect->x, subrect->h ); } osd_dirty &= ~osd_current; } blit_to_screen(); blit_done = 1; vo_remove_text( sub_width, sub_height, clear_alpha ); vo_draw_text( sub_width, sub_height, draw_alpha ); if (use_spic && flipping && osd_changed) { subframe->Flip( subframe, NULL, 0 ); osd_current <<= 1; if (osd_current > osd_max) osd_current = 1; } } static void flip_page( void ) { if (!blit_done) blit_to_screen(); if (flipping) { if (use_crtc2) c2frame->Flip( c2frame, NULL, vo_vsync ? DSFLIP_WAITFORSYNC : DSFLIP_ONSYNC ); if (use_crtc1) c1frame->Flip( c1frame, NULL, vo_vsync ? DSFLIP_WAITFORSYNC : DSFLIP_ONSYNC ); if (use_bes) besframe->Flip( besframe, NULL, vo_vsync ? DSFLIP_WAITFORSYNC : DSFLIP_ONSYNC ); if (!use_spic) { osd_current <<= 1; if (osd_current > osd_max) osd_current = 1; } } blit_done = 0; current_buf = 0; } static void uninit( void ) { release_config(); if (buffer) buffer->Release( buffer ); if (remote) remote->Release( remote ); if (keyboard) keyboard->Release( keyboard ); if (crtc2) crtc2->Release( crtc2 ); if (bes) bes->Release( bes ); if (crtc1) crtc1->Release( crtc1 ); if (dfb) dfb->Release( dfb ); buffer = NULL; remote = NULL; keyboard = NULL; crtc2 = NULL; bes = NULL; crtc1 = NULL; dfb = NULL; } static uint32_t get_image( mp_image_t *mpi ) { int buf = current_buf; uint8_t *dst; void *ptr; int pitch; if (mpi->flags & MP_IMGFLAG_READABLE && (mpi->type == MP_IMGTYPE_IPB || mpi->type == MP_IMGTYPE_IP)) { if (num_bufs < 2) return VO_FALSE; current_ip_buf ^= 1; if (mpi->type == MP_IMGTYPE_IPB && num_bufs < 3 && current_ip_buf) return VO_FALSE; buf = current_ip_buf; if (mpi->type == MP_IMGTYPE_IPB) buf++; } frame = bufs[buf]; frame->Unlock( frame ); /* Always use DSLF_READ to preserve system memory copy */ if (frame->Lock( frame, DSLF_WRITE | DSLF_READ, &ptr, &pitch ) != DFB_OK) return VO_FALSE; dst = ptr; if ((mpi->width == pitch) || (mpi->flags & (MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_ACCEPT_WIDTH))) { mpi->planes[0] = dst; mpi->width = in_width; mpi->stride[0] = pitch; if (mpi->flags & MP_IMGFLAG_PLANAR) { if (mpi->num_planes > 2) { mpi->stride[1] = mpi->stride[2] = pitch / 2; if (mpi->flags & MP_IMGFLAG_SWAPPED) { /* I420 */ mpi->planes[1] = dst + buf_height * pitch; mpi->planes[2] = mpi->planes[1] + buf_height * pitch / 4; } else { /* YV12 */ mpi->planes[2] = dst + buf_height * pitch; mpi->planes[1] = mpi->planes[2] + buf_height * pitch / 4; } } else { /* NV12/NV21 */ mpi->stride[1] = pitch; mpi->planes[1] = dst + buf_height * pitch; } } mpi->flags |= MP_IMGFLAG_DIRECT; mpi->priv = (void *)(intptr_t)buf; current_buf = buf; return VO_TRUE; } frame->Unlock( frame ); return VO_FALSE; } static uint32_t draw_image( mp_image_t *mpi ) { if (mpi->flags & MP_IMGFLAG_DIRECT) { current_buf = (intptr_t)mpi->priv; return VO_TRUE; } if (mpi->flags & MP_IMGFLAG_DRAW_CALLBACK) return VO_TRUE; if (mpi->flags & MP_IMGFLAG_PLANAR) return draw_slice( mpi->planes, mpi->stride, mpi->w, mpi->h, 0, 0 ); else { void *dst; int pitch; if (frame->Lock( frame, DSLF_WRITE, &dst, &pitch ) != DFB_OK) return VO_FALSE; memcpy_pic( dst, mpi->planes[0], mpi->w * (mpi->bpp / 8), mpi->h, pitch, mpi->stride[0] ); frame->Unlock( frame ); return VO_TRUE; } } static int set_equalizer( const char *data, int value ) { DFBResult res; DFBColorAdjustment ca; float factor = (float) 0xffff / 200.0; ca.flags = DCAF_NONE; if (!strcasecmp( data, "brightness" )) { ca.flags |= DCAF_BRIGHTNESS; ca.brightness = value * factor + 0x8000; } if (!strcasecmp( data, "contrast" )) { ca.flags |= DCAF_CONTRAST; ca.contrast = value * factor + 0x8000; } if (!strcasecmp( data, "hue" )) { ca.flags |= DCAF_HUE; ca.hue = value * factor + 0x8000; } if (!strcasecmp( data, "saturation" )) { ca.flags |= DCAF_SATURATION; ca.saturation = value * factor + 0x8000; } /* Prefer CRTC2 over BES */ if (use_crtc2) res = crtc2->SetColorAdjustment( crtc2, &ca ); else if (use_crtc1) res = crtc1->SetColorAdjustment( crtc1, &ca ); else res = bes->SetColorAdjustment( bes, &ca ); if (res != DFB_OK) return VO_FALSE; return VO_TRUE; } static int get_equalizer( const char *data, int *value ) { DFBResult res; DFBColorAdjustment ca; float factor = 200.0 / (float) 0xffff; /* Prefer CRTC2 over BES */ if (use_crtc2) res = crtc2->GetColorAdjustment( crtc2, &ca ); else if (use_crtc1) res = crtc1->GetColorAdjustment( crtc1, &ca ); else res = bes->GetColorAdjustment( bes, &ca ); if (res != DFB_OK) return VO_FALSE; if (!strcasecmp( data, "brightness" ) && (ca.flags & DCAF_BRIGHTNESS)) *value = (ca.brightness - 0x8000) * factor; if (!strcasecmp( data, "contrast" ) && (ca.flags & DCAF_CONTRAST)) *value = (ca.contrast - 0x8000) * factor; if (!strcasecmp( data, "hue" ) && (ca.flags & DCAF_HUE)) *value = (ca.hue - 0x8000) * factor; if (!strcasecmp( data, "saturation" ) && (ca.flags & DCAF_SATURATION)) *value = (ca.saturation - 0x8000) * factor; return VO_TRUE; } static int control( uint32_t request, void *data ) { switch (request) { case VOCTRL_QUERY_FORMAT: return query_format( *((uint32_t *) data) ); case VOCTRL_GET_IMAGE: return get_image( data ); case VOCTRL_DRAW_IMAGE: return draw_image( data ); case VOCTRL_SET_EQUALIZER: { vf_equalizer_t *eq=data; return set_equalizer( eq->item, eq->value ); } case VOCTRL_GET_EQUALIZER: { vf_equalizer_t *eq=data; return get_equalizer( eq->item, &eq->value ); } } return VO_NOTIMPL; } #include "osdep/keycodes.h" static void check_events( void ) { DFBInputEvent event; if (!buffer) return; if (buffer->GetEvent( buffer, DFB_EVENT( &event )) == DFB_OK) { if (event.type == DIET_KEYPRESS) { switch (event.key_symbol) { case DIKS_ESCAPE: mplayer_put_key( KEY_ESC ); break; case DIKS_PAGE_UP: mplayer_put_key( KEY_PAGE_UP ); break; case DIKS_PAGE_DOWN: mplayer_put_key( KEY_PAGE_DOWN ); break; case DIKS_CURSOR_UP: mplayer_put_key( KEY_UP ); break; case DIKS_CURSOR_DOWN: mplayer_put_key( KEY_DOWN ); break; case DIKS_CURSOR_LEFT: mplayer_put_key( KEY_LEFT ); break; case DIKS_CURSOR_RIGHT: mplayer_put_key( KEY_RIGHT ); break; case DIKS_INSERT: mplayer_put_key( KEY_INSERT ); break; case DIKS_DELETE: mplayer_put_key( KEY_DELETE ); break; case DIKS_HOME: mplayer_put_key( KEY_HOME ); break; case DIKS_END: mplayer_put_key( KEY_END ); break; case DIKS_POWER: mplayer_put_key( KEY_POWER ); break; case DIKS_MENU: mplayer_put_key( KEY_MENU ); break; case DIKS_PLAY: mplayer_put_key( KEY_PLAY ); break; case DIKS_STOP: mplayer_put_key( KEY_STOP ); break; case DIKS_PAUSE: mplayer_put_key( KEY_PAUSE ); break; case DIKS_PLAYPAUSE: mplayer_put_key( KEY_PLAYPAUSE ); break; case DIKS_FORWARD: mplayer_put_key( KEY_FORWARD ); break; case DIKS_NEXT: mplayer_put_key( KEY_NEXT ); break; case DIKS_REWIND: mplayer_put_key( KEY_REWIND ); break; case DIKS_PREVIOUS: mplayer_put_key( KEY_PREV ); break; case DIKS_VOLUME_UP: mplayer_put_key( KEY_VOLUME_UP ); break; case DIKS_VOLUME_DOWN: mplayer_put_key( KEY_VOLUME_DOWN ); break; case DIKS_MUTE: mplayer_put_key( KEY_MUTE ); break; default: mplayer_put_key( event.key_symbol ); } } } /* * empty buffer, because of repeating * keyboard repeat is faster than key handling and this causes problems during seek * temporary workabout. should be solved in the future */ buffer->Reset( buffer ); }
31.640391
144
0.486473
962da10d8a60ea32916ee1193baee8da89351d86
3,428
h
C
legacy/TelegraphKit/TGCommon.h
miladajilian/MimMessenger
72aca46135eed311f5f2fd3b711446a61b526548
[ "MIT" ]
1
2018-08-30T08:02:12.000Z
2018-08-30T08:02:12.000Z
legacy/TelegraphKit/TGCommon.h
miladajilian/MimMessenger
72aca46135eed311f5f2fd3b711446a61b526548
[ "MIT" ]
null
null
null
legacy/TelegraphKit/TGCommon.h
miladajilian/MimMessenger
72aca46135eed311f5f2fd3b711446a61b526548
[ "MIT" ]
2
2018-08-30T08:04:17.000Z
2020-10-15T06:52:06.000Z
#ifndef Telegraph_TGCommon_h #define Telegraph_TGCommon_h #import <UIKit/UIKit.h> #import <inttypes.h> #define TGUseSocial true #define TG_ENABLE_AUDIO_NOTES true #define TGAssert(expr) assert(expr) #define UIColorRGB(rgb) ([[UIColor alloc] initWithRed:(((rgb >> 16) & 0xff) / 255.0f) green:(((rgb >> 8) & 0xff) / 255.0f) blue:(((rgb) & 0xff) / 255.0f) alpha:1.0f]) #define UIColorRGBA(rgb,a) ([[UIColor alloc] initWithRed:(((rgb >> 16) & 0xff) / 255.0f) green:(((rgb >> 8) & 0xff) / 255.0f) blue:(((rgb) & 0xff) / 255.0f) alpha:a]) #define TGRestrictedToMainThread {if(![[NSThread currentThread] isMainThread]) TGLog(@"***** Warning: main thread-bound operation is running in background! *****");} extern int TGLocalizedStaticVersion; #define TG_TIMESTAMP_DEFINE(s) CFAbsoluteTime tg_timestamp_##s = CFAbsoluteTimeGetCurrent(); int tg_timestamp_line_##s = __LINE__; #define TG_TIMESTAMP_MEASURE(s) { CFAbsoluteTime tg_timestamp_current_time = CFAbsoluteTimeGetCurrent(); TGLog(@"%s %d-%d: %f ms", #s, tg_timestamp_line_##s, __LINE__, (tg_timestamp_current_time - tg_timestamp_##s) * 1000.0); tg_timestamp_##s = tg_timestamp_current_time; tg_timestamp_line_##s = __LINE__; } #ifdef __cplusplus extern "C" { #endif int cpuCoreCount(); bool hasModernCpu(); int deviceMemorySize(); void TGSetLocalizationFromFile(NSString *filePath); NSString *TGLocalized(NSString *s); @class TGLocalization; TGLocalization *effectiveLocalization(); NSString *currentLocalizationEnglishLanguageName(); TGLocalization *nativeEnglishLocalization(); TGLocalization *currentNativeLocalization(); TGLocalization *currentCustomLocalization(); void setCurrentNativeLocalization(TGLocalization *localization, bool switchIfCustom); void setCurrentCustomLocalization(TGLocalization *localization); bool TGObjectCompare(id obj1, id obj2); bool TGStringCompare(NSString *s1, NSString *s2); NSTimeInterval TGCurrentSystemTime(); NSString *TGStringMD5(NSString *string); int iosMajorVersion(); int iosMinorVersion(); void printMemoryUsage(NSString *tag); void TGDumpViews(UIView *view, NSString *indent); NSString *TGEncodeText(NSString *string, int key); inline void TGDispatchOnMainThread(dispatch_block_t block) { if ([NSThread isMainThread]) block(); else dispatch_async(dispatch_get_main_queue(), block); } inline void TGDispatchAfter(double delay, dispatch_queue_t queue, dispatch_block_t block) { dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)((delay) * NSEC_PER_SEC)), queue, block); } void TGLogSetEnabled(bool enabled); bool TGLogEnabled(); void TGLog(NSString *format, ...); void TGLogv(NSString *format, va_list args); void TGLogSynchronize(); NSArray *TGGetLogFilePaths(int count); NSArray *TGGetPackedLogs(); #ifdef __cplusplus } #endif @interface NSNumber (IntegerTypes) - (int32_t)int32Value; - (int64_t)int64Value; @end #ifdef __LP64__ # define CGFloor floor #else # define CGFloor floorf #endif #ifdef __LP64__ # define CGRound round # define CGCeil ceil # define CGPow pow # define CGSin sin # define CGCos cos # define CGSqrt sqrt #else # define CGRound roundf # define CGCeil ceilf # define CGPow powf # define CGSin sinf # define CGCos cosf # define CGSqrt sqrtf #endif #define CGEven(x) ((((int)x) & 1) ? (x + 1) : x) #define CGOdd(x) ((((int)x) & 1) ? x : (x + 1)) #import "TGTColor.h" #endif
28.330579
307
0.736581
681b740911613877457dc56506a1018b284dff69
286
h
C
DDMyFramework/DDMyFramework/Audio/Tool/FCCycleView.h
AppleP1999/DDMyFramework
be1d3025d0772776190ac27e0a466bd7cdad41a4
[ "MIT" ]
null
null
null
DDMyFramework/DDMyFramework/Audio/Tool/FCCycleView.h
AppleP1999/DDMyFramework
be1d3025d0772776190ac27e0a466bd7cdad41a4
[ "MIT" ]
null
null
null
DDMyFramework/DDMyFramework/Audio/Tool/FCCycleView.h
AppleP1999/DDMyFramework
be1d3025d0772776190ac27e0a466bd7cdad41a4
[ "MIT" ]
null
null
null
// // FCCycleView.h // TBCycleProgress // // Created by qianjianeng on 16/2/22. // Copyright © 2019年 SF. All rights reserved. // #import <UIKit/UIKit.h> @interface FCCycleView : UIView @property (nonatomic, strong) UILabel *label; - (void)drawProgress:(CGFloat )progress; @end
15.888889
46
0.695804
aec5f99087ba3b64d30904cc85984cf45034b278
2,319
h
C
tools/clang/include/clang/Basic/Version.h
GoSSIP-SJTU/TripleDoggy
03648d6b19c812504b14e8b98c8c7b3f443f4e54
[ "Apache-2.0" ]
171
2018-09-17T13:15:12.000Z
2022-03-18T03:47:04.000Z
tools/clang/include/clang/Basic/Version.h
Ewenwan/TripleDoggy
01db804b6570b1e25e29a387aa2addb68b48335f
[ "Apache-2.0" ]
7
2018-10-05T04:54:18.000Z
2020-10-02T07:58:13.000Z
tools/clang/include/clang/Basic/Version.h
Ewenwan/TripleDoggy
01db804b6570b1e25e29a387aa2addb68b48335f
[ "Apache-2.0" ]
35
2018-09-18T07:46:53.000Z
2022-03-27T07:59:48.000Z
//===- Version.h - Clang Version Number -------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// /// /// \file /// \brief Defines version macros and version-related utility functions /// for Clang. /// //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_BASIC_VERSION_H #define LLVM_CLANG_BASIC_VERSION_H #include "clang/Basic/Version.inc" #include "llvm/ADT/StringRef.h" namespace clang { /// \brief Retrieves the repository path (e.g., Subversion path) that /// identifies the particular Clang branch, tag, or trunk from which this /// Clang was built. std::string getClangRepositoryPath(); /// \brief Retrieves the repository path from which LLVM was built. /// /// This supports LLVM residing in a separate repository from clang. std::string getLLVMRepositoryPath(); /// \brief Retrieves the repository revision number (or identifier) from which /// this Clang was built. std::string getClangRevision(); /// \brief Retrieves the repository revision number (or identifier) from which /// LLVM was built. /// /// If Clang and LLVM are in the same repository, this returns the same /// string as getClangRevision. std::string getLLVMRevision(); /// \brief Retrieves the full repository version that is an amalgamation of /// the information in getClangRepositoryPath() and getClangRevision(). std::string getClangFullRepositoryVersion(); /// \brief Retrieves a string representing the complete clang version, /// which includes the clang version number, the repository version, /// and the vendor tag. std::string getClangFullVersion(); /// \brief Like getClangFullVersion(), but with a custom tool name. std::string getClangToolFullVersion(llvm::StringRef ToolName); /// \brief Retrieves a string representing the complete clang version suitable /// for use in the CPP __VERSION__ macro, which includes the clang version /// number, the repository version, and the vendor tag. std::string getClangFullCPPVersion(); } #endif // LLVM_CLANG_BASIC_VERSION_H
36.809524
80
0.667529
4d2867193b1c50f128e0c2527e128ce78f36f2b9
6,035
h
C
Userland/Libraries/LibArchive/Tar.h
holdengreen/serenity
0fccada6e9f714f76b2fbe0d189dcf4f26de38d4
[ "BSD-2-Clause" ]
1
2021-10-05T14:07:23.000Z
2021-10-05T14:07:23.000Z
Userland/Libraries/LibArchive/Tar.h
holdengreen/serenity
0fccada6e9f714f76b2fbe0d189dcf4f26de38d4
[ "BSD-2-Clause" ]
null
null
null
Userland/Libraries/LibArchive/Tar.h
holdengreen/serenity
0fccada6e9f714f76b2fbe0d189dcf4f26de38d4
[ "BSD-2-Clause" ]
null
null
null
/* * Copyright (c) 2020, Peter Elliott <pelliott@ualberta.ca> * Copyright (c) 2021, Idan Horowitz <idan.horowitz@serenityos.org> * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include <AK/String.h> #include <AK/StringView.h> #include <string.h> #include <sys/types.h> namespace Archive { enum class TarFileType : char { NormalFile = '0', AlternateNormalFile = '\0', HardLink = '1', SymLink = '2', CharacterSpecialFile = '3', BlockSpecialFile = '4', Directory = '5', FIFO = '6', ContiguousFile = '7', GlobalExtendedHeader = 'g', ExtendedHeader = 'x' }; constexpr size_t block_size = 512; constexpr const char* gnu_magic = "ustar "; // gnu format magic constexpr const char* gnu_version = " "; // gnu format version constexpr const char* ustar_magic = "ustar"; // ustar format magic constexpr const char* ustar_version = "00"; // ustar format version constexpr const char* posix1_tar_magic = ""; // POSIX.1-1988 format magic constexpr const char* posix1_tar_version = ""; // POSIX.1-1988 format version class [[gnu::packed]] TarFileHeader { public: const StringView file_name() const { return m_file_name; } mode_t mode() const { return get_tar_field(m_mode); } uid_t uid() const { return get_tar_field(m_uid); } gid_t gid() const { return get_tar_field(m_gid); } // FIXME: support 2001-star size encoding size_t size() const { return get_tar_field(m_size); } time_t timestamp() const { return get_tar_field(m_timestamp); } unsigned checksum() const { return get_tar_field(m_checksum); } TarFileType type_flag() const { return TarFileType(m_type_flag); } const StringView link_name() const { return m_link_name; } const StringView magic() const { return StringView(m_magic, min(__builtin_strlen(m_magic), sizeof(m_magic))); } // in some cases this is a null terminated string, in others its not const StringView version() const { return StringView(m_version, min(__builtin_strlen(m_version), sizeof(m_version))); } // in some cases this is a null terminated string, in others its not const StringView owner_name() const { return m_owner_name; } const StringView group_name() const { return m_group_name; } int major() const { return get_tar_field(m_major); } int minor() const { return get_tar_field(m_minor); } // FIXME: support ustar filename prefix const StringView prefix() const { return m_prefix; } void set_file_name(const String& file_name) { VERIFY(file_name.copy_characters_to_buffer(m_file_name, sizeof(m_file_name))); } void set_mode(mode_t mode) { VERIFY(String::formatted("{:o}", mode).copy_characters_to_buffer(m_mode, sizeof(m_mode))); } void set_uid(uid_t uid) { VERIFY(String::formatted("{:o}", uid).copy_characters_to_buffer(m_uid, sizeof(m_uid))); } void set_gid(gid_t gid) { VERIFY(String::formatted("{:o}", gid).copy_characters_to_buffer(m_gid, sizeof(m_gid))); } void set_size(size_t size) { VERIFY(String::formatted("{:o}", size).copy_characters_to_buffer(m_size, sizeof(m_size))); } void set_timestamp(time_t timestamp) { VERIFY(String::formatted("{:o}", timestamp).copy_characters_to_buffer(m_timestamp, sizeof(m_timestamp))); } void set_type_flag(TarFileType type) { m_type_flag = static_cast<char>(type); } void set_link_name(const String& link_name) { VERIFY(link_name.copy_characters_to_buffer(m_link_name, sizeof(m_link_name))); } void set_magic(const char* magic) { memcpy(m_magic, magic, sizeof(m_magic)); } // magic doesn't necessarily include a null byte void set_version(const char* version) { memcpy(m_version, version, sizeof(m_version)); } // version doesn't necessarily include a null byte void set_owner_name(const String& owner_name) { VERIFY(owner_name.copy_characters_to_buffer(m_owner_name, sizeof(m_owner_name))); } void set_group_name(const String& group_name) { VERIFY(group_name.copy_characters_to_buffer(m_group_name, sizeof(m_group_name))); } void set_major(int major) { VERIFY(String::formatted("{:o}", major).copy_characters_to_buffer(m_major, sizeof(m_major))); } void set_minor(int minor) { VERIFY(String::formatted("{:o}", minor).copy_characters_to_buffer(m_minor, sizeof(m_minor))); } void set_prefix(const String& prefix) { VERIFY(prefix.copy_characters_to_buffer(m_prefix, sizeof(m_prefix))); } unsigned expected_checksum() const; void calculate_checksum(); private: char m_file_name[100]; char m_mode[8]; char m_uid[8]; char m_gid[8]; char m_size[12]; char m_timestamp[12]; char m_checksum[8]; // an uninitialized header's checksum is filled with spaces char m_type_flag; char m_link_name[100]; char m_magic[6]; char m_version[2]; char m_owner_name[32]; char m_group_name[32]; char m_major[8]; char m_minor[8]; char m_prefix[155]; // zero out the prefix for archiving template<size_t N> static size_t get_tar_field(const char (&field)[N]); }; template<size_t N> size_t TarFileHeader::get_tar_field(const char (&field)[N]) { size_t value = 0; for (size_t i = 0; i < N; ++i) { if (field[i] == 0) break; VERIFY(field[i] >= '0' && field[i] <= '7'); value *= 8; value += field[i] - '0'; } return value; } unsigned TarFileHeader::expected_checksum() const { auto checksum = 0u; const u8* u8_this = reinterpret_cast<const u8*>(this); const u8* u8_m_checksum = reinterpret_cast<const u8*>(&m_checksum); for (auto i = 0u; i < sizeof(TarFileHeader); ++i) { if (u8_this + i >= u8_m_checksum && u8_this + i < u8_m_checksum + sizeof(m_checksum)) { checksum += ' '; } else { checksum += u8_this[i]; } } return checksum; } void TarFileHeader::calculate_checksum() { memset(m_checksum, ' ', sizeof(m_checksum)); VERIFY(String::formatted("{:06o}", expected_checksum()).copy_characters_to_buffer(m_checksum, sizeof(m_checksum))); } }
44.051095
192
0.691632
2322aa04991118012b6ec27e90e15325ea22c37a
3,944
c
C
src/PJ_urmfps.c
imagico/proj.4
2dfe8232df7acf9391e7dae96a2f2edea8de6dcf
[ "MIT" ]
3
2016-07-08T10:29:47.000Z
2019-12-30T17:23:53.000Z
src/PJ_urmfps.c
imagico/proj.4
2dfe8232df7acf9391e7dae96a2f2edea8de6dcf
[ "MIT" ]
null
null
null
src/PJ_urmfps.c
imagico/proj.4
2dfe8232df7acf9391e7dae96a2f2edea8de6dcf
[ "MIT" ]
2
2019-09-25T08:41:27.000Z
2021-05-02T09:25:14.000Z
#define PJ_LIB__ #include <projects.h> PROJ_HEAD(urmfps, "Urmaev Flat-Polar Sinusoidal") "\n\tPCyl, Sph.\n\tn="; PROJ_HEAD(wag1, "Wagner I (Kavraisky VI)") "\n\tPCyl, Sph."; struct pj_opaque { double n, C_y; }; #define C_x 0.8773826753 #define Cy 1.139753528477 static XY s_forward (LP lp, PJ *P) { /* Spheroidal, forward */ XY xy = {0.0, 0.0}; lp.phi = aasin (P->ctx,P->opaque->n * sin (lp.phi)); xy.x = C_x * lp.lam * cos (lp.phi); xy.y = P->opaque->C_y * lp.phi; return xy; } static LP s_inverse (XY xy, PJ *P) { /* Spheroidal, inverse */ LP lp = {0.0, 0.0}; xy.y /= P->opaque->C_y; lp.phi = aasin(P->ctx, sin (xy.y) / P->opaque->n); lp.lam = xy.x / (C_x * cos (xy.y)); return lp; } static void *freeup_new (PJ *P) { /* Destructor */ if (0==P) return 0; if (0==P->opaque) return pj_dealloc (P); pj_dealloc (P->opaque); return pj_dealloc(P); } static void freeup (PJ *P) { freeup_new (P); return; } static PJ *setup(PJ *P) { P->opaque->C_y = Cy / P->opaque->n; P->es = 0.; P->inv = s_inverse; P->fwd = s_forward; return P; } PJ *PROJECTION(urmfps) { struct pj_opaque *Q = pj_calloc (1, sizeof (struct pj_opaque)); if (0==Q) return freeup_new (P); P->opaque = Q; if (pj_param(P->ctx, P->params, "tn").i) { P->opaque->n = pj_param(P->ctx, P->params, "dn").f; if (P->opaque->n <= 0. || P->opaque->n > 1.) E_ERROR(-40) } else E_ERROR(-40) return setup(P); } PJ *PROJECTION(wag1) { struct pj_opaque *Q = pj_calloc (1, sizeof (struct pj_opaque)); if (0==Q) return freeup_new (P); P->opaque = Q; P->opaque->n = 0.8660254037844386467637231707; return setup(P); } #ifdef PJ_OMIT_SELFTEST int pj_urmfps_selftest (void) {return 0;} #else int pj_urmfps_selftest (void) { double tolerance_lp = 1e-10; double tolerance_xy = 1e-7; char s_args[] = {"+proj=urmfps +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5"}; LP fwd_in[] = { { 2, 1}, { 2,-1}, {-2, 1}, {-2,-1} }; XY s_fwd_expect[] = { { 196001.70813419219, 127306.84332999329}, { 196001.70813419219, -127306.84332999329}, {-196001.70813419219, 127306.84332999329}, {-196001.70813419219, -127306.84332999329}, }; XY inv_in[] = { { 200, 100}, { 200,-100}, {-200, 100}, {-200,-100} }; LP s_inv_expect[] = { { 0.002040720839642371, 0.00078547381740438178}, { 0.002040720839642371, -0.00078547381740438178}, {-0.002040720839642371, 0.00078547381740438178}, {-0.002040720839642371, -0.00078547381740438178}, }; return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect); } #endif #ifdef PJ_OMIT_SELFTEST int pj_wag1_selftest (void) {return 0;} #else int pj_wag1_selftest (void) { double tolerance_lp = 1e-10; double tolerance_xy = 1e-7; char s_args[] = {"+proj=wag1 +a=6400000 +lat_1=0.5 +lat_2=2 +n=0.5"}; LP fwd_in[] = { { 2, 1}, { 2,-1}, {-2, 1}, {-2,-1} }; XY s_fwd_expect[] = { { 195986.78156115755, 127310.07506065986}, { 195986.78156115755, -127310.07506065986}, {-195986.78156115755, 127310.07506065986}, {-195986.78156115755, -127310.07506065986}, }; XY inv_in[] = { { 200, 100}, { 200,-100}, {-200, 100}, {-200,-100} }; LP s_inv_expect[] = { { 0.002040720839738254, 0.00078547381739207999}, { 0.002040720839738254, -0.00078547381739207999}, {-0.002040720839738254, 0.00078547381739207999}, {-0.002040720839738254, -0.00078547381739207999}, }; return pj_generic_selftest (0, s_args, tolerance_xy, tolerance_lp, 4, 4, fwd_in, 0, s_fwd_expect, inv_in, 0, s_inv_expect); } #endif
23.616766
127
0.573529
d6d6b1951b7a8695c613a071b929edbc66d16414
1,361
h
C
isis/src/base/objs/ForstnerOperator/ForstnerOperator.h
kdl222/ISIS3
aab0e63088046690e6c031881825596c1c2cc380
[ "CC0-1.0" ]
134
2018-01-18T00:16:24.000Z
2022-03-24T03:53:33.000Z
isis/src/base/objs/ForstnerOperator/ForstnerOperator.h
kdl222/ISIS3
aab0e63088046690e6c031881825596c1c2cc380
[ "CC0-1.0" ]
3,825
2017-12-11T21:27:34.000Z
2022-03-31T21:45:20.000Z
isis/src/base/objs/ForstnerOperator/ForstnerOperator.h
jlaura/isis3
2c40e08caed09968ea01d5a767a676172ad20080
[ "CC0-1.0" ]
164
2017-11-30T21:15:44.000Z
2022-03-23T10:22:29.000Z
#ifndef ForstnerOperator_h #define ForstnerOperator_h /** This is free and unencumbered software released into the public domain. The authors of ISIS do not claim copyright on the contents of this file. For more details about the LICENSE terms and the AUTHORS, you will find files of those names at the top level of this repository. **/ /* SPDX-License-Identifier: CC0-1.0 */ #include "InterestOperator.h" namespace Isis { class Pvl; class Chip; /** * @brief Forstner interest operator * * This class is used to construct a forstner interest operator. * For this class, the interest is always positive with the worst * interest amount being 0. The higher the interest, the better. * * @see InterestOperator * * @see "A Fast Operator for Detection and Precise Location of * Distinct Points, Corners and Centres of Circular * Features" by W. Forstner and E. Gulch (Forstner.pdf) * * @author 2006-05-01 Jacob Danton * * @internal * @history 2010-11-10 Sharmila Prasad - Updated unittest for changes in the * deffile */ class ForstnerOperator : public InterestOperator { public: ForstnerOperator(Pvl &pvl) : InterestOperator(pvl) {}; virtual ~ForstnerOperator() {}; protected: virtual double Interest(Chip &chip); }; }; #endif
29.586957
80
0.684791
d9695096228628717860e10df74e086e9062c475
2,954
c
C
STM32F103ZE_PWM/App/main.c
yfsong0709/STM32-Examples
6aa89917887788f9bd19994040e2c4c8326f02ae
[ "MIT" ]
3
2019-01-14T13:39:35.000Z
2020-08-24T08:40:49.000Z
STM32F103ZE_PWM/App/main.c
yfsong0709/STM32-Examples
6aa89917887788f9bd19994040e2c4c8326f02ae
[ "MIT" ]
null
null
null
STM32F103ZE_PWM/App/main.c
yfsong0709/STM32-Examples
6aa89917887788f9bd19994040e2c4c8326f02ae
[ "MIT" ]
null
null
null
#include "stm32f10x.h" void delay(int t); void RCC_Configuration(void); void GPIO_Configuration(void); void TIM_Configuration(void); int main(void){ RCC_Configuration(); GPIO_Configuration(); TIM_Configuration(); TIM_SetCompare1(TIM4, 200); TIM_SetCompare2(TIM4, 200); TIM_SetCompare3(TIM4, 200); TIM_SetCompare4(TIM4, 200); delay(5000); TIM_SetCompare1(TIM4, 100); TIM_SetCompare2(TIM4, 100); TIM_SetCompare3(TIM4, 100); TIM_SetCompare4(TIM4, 100); delay(2000); TIM_SetCompare1(TIM4, 110); TIM_SetCompare2(TIM4, 110); TIM_SetCompare3(TIM4, 110); TIM_SetCompare4(TIM4, 110); delay(1000); TIM_SetCompare1(TIM4, 130); TIM_SetCompare2(TIM4, 130); TIM_SetCompare3(TIM4, 130); TIM_SetCompare4(TIM4, 130); delay(1000); TIM_SetCompare1(TIM4, 150); TIM_SetCompare2(TIM4, 150); TIM_SetCompare3(TIM4, 150); TIM_SetCompare4(TIM4, 150); delay(1000); TIM_SetCompare1(TIM4, 170); TIM_SetCompare2(TIM4, 170); TIM_SetCompare3(TIM4, 170); TIM_SetCompare4(TIM4, 170); delay(1000); TIM_SetCompare1(TIM4, 190); TIM_SetCompare2(TIM4, 190); TIM_SetCompare3(TIM4, 190); TIM_SetCompare4(TIM4, 190); delay(3000); TIM_SetCompare1(TIM4, 150); TIM_SetCompare2(TIM4, 150); TIM_SetCompare3(TIM4, 150); TIM_SetCompare4(TIM4, 150); delay(1000); TIM_SetCompare1(TIM4, 100); TIM_SetCompare2(TIM4, 100); TIM_SetCompare3(TIM4, 100); TIM_SetCompare4(TIM4, 100); while(1); } void RCC_Configuration(void){ SystemInit(); RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB|RCC_APB2Periph_AFIO,ENABLE); RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM4,ENABLE); } void GPIO_Configuration(void){ GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitStructure.GPIO_Pin=GPIO_Pin_6|GPIO_Pin_7|GPIO_Pin_8|GPIO_Pin_9; GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_Mode=GPIO_Mode_AF_PP; GPIO_Init(GPIOB,&GPIO_InitStructure); } void TIM_Configuration(void){ TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure; TIM_OCInitTypeDef TIM_OCInitStructure; TIM_TimeBaseStructure.TIM_Period=1999; TIM_TimeBaseStructure.TIM_Prescaler=719; TIM_TimeBaseStructure.TIM_ClockDivision=0; TIM_TimeBaseStructure.TIM_CounterMode=TIM_CounterMode_Up; TIM_TimeBaseInit(TIM4,&TIM_TimeBaseStructure); TIM_OCInitStructure.TIM_OCMode=TIM_OCMode_PWM1; TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable; TIM_OCInitStructure.TIM_OCPolarity=TIM_OCPolarity_High; TIM_OC1Init(TIM4,&TIM_OCInitStructure); TIM_OC1PreloadConfig(TIM4, TIM_OCPreload_Enable); TIM_OC2Init(TIM4,&TIM_OCInitStructure); TIM_OC2PreloadConfig(TIM4, TIM_OCPreload_Enable); TIM_OC3Init(TIM4,&TIM_OCInitStructure); TIM_OC3PreloadConfig(TIM4, TIM_OCPreload_Enable); TIM_OC4Init(TIM4,&TIM_OCInitStructure); TIM_OC4PreloadConfig(TIM4, TIM_OCPreload_Enable); TIM_Cmd(TIM4,ENABLE); } void delay(int t){ int x,temp=10000; while(temp--){ x=t; while(x--); } }
26.375
76
0.767434
6cbe54eba6755b37a925a701e02e13540e02a089
29,336
h
C
components/Adafruit-GFX/Fonts/FreeSerif18pt7b.h
markbirss/cale-idf
a2271062504907a57333ea9615c115fbda809e19
[ "Apache-2.0" ]
148
2020-05-21T23:14:27.000Z
2022-03-23T14:26:45.000Z
components/Adafruit-GFX/Fonts/FreeSerif18pt7b.h
markbirss/cale-idf
a2271062504907a57333ea9615c115fbda809e19
[ "Apache-2.0" ]
48
2020-05-19T07:23:48.000Z
2022-03-19T11:04:02.000Z
components/Adafruit-GFX/Fonts/FreeSerif18pt7b.h
markbirss/cale-idf
a2271062504907a57333ea9615c115fbda809e19
[ "Apache-2.0" ]
45
2019-12-02T15:30:41.000Z
2022-03-09T15:21:17.000Z
const uint8_t FreeSerif18pt7bBitmaps[] = { 0x6F, 0xFF, 0xFF, 0xFE, 0x66, 0x66, 0x66, 0x64, 0x40, 0x00, 0x6F, 0xF6, 0xE7, 0xE7, 0xE7, 0xE7, 0xE7, 0x46, 0x42, 0x42, 0x42, 0x03, 0x06, 0x01, 0x83, 0x00, 0xC1, 0x80, 0x61, 0xC0, 0x30, 0xC0, 0x38, 0x60, 0x18, 0x30, 0xFF, 0xFF, 0x7F, 0xFF, 0x83, 0x06, 0x01, 0x86, 0x00, 0xC3, 0x00, 0xC1, 0x87, 0xFF, 0xFF, 0xFF, 0xFE, 0x18, 0x30, 0x0C, 0x18, 0x06, 0x18, 0x06, 0x0C, 0x03, 0x06, 0x01, 0x83, 0x00, 0xC1, 0x80, 0x60, 0xC0, 0x02, 0x00, 0x10, 0x03, 0xE0, 0x64, 0xE6, 0x23, 0x61, 0x1B, 0x08, 0x58, 0x42, 0xE2, 0x03, 0x90, 0x1F, 0x80, 0x7E, 0x00, 0xFC, 0x01, 0xF0, 0x0F, 0xC0, 0x4E, 0x02, 0x38, 0x10, 0xE0, 0x87, 0x04, 0x3C, 0x21, 0xE1, 0x1B, 0xC9, 0xCF, 0xFC, 0x1F, 0x80, 0x10, 0x00, 0x80, 0x07, 0x80, 0x20, 0x0F, 0xF0, 0x70, 0x0F, 0x07, 0xD0, 0x0F, 0x02, 0x18, 0x07, 0x01, 0x18, 0x07, 0x00, 0x8C, 0x03, 0x80, 0x4C, 0x01, 0x80, 0x44, 0x00, 0xC0, 0x26, 0x00, 0x60, 0x22, 0x0F, 0x30, 0x33, 0x1F, 0xCC, 0x73, 0x1E, 0x37, 0xF1, 0x8E, 0x19, 0xE1, 0x8E, 0x04, 0x00, 0x86, 0x02, 0x00, 0xC7, 0x01, 0x00, 0xC3, 0x80, 0x80, 0x61, 0x80, 0x80, 0x60, 0xC0, 0x40, 0x30, 0x60, 0x40, 0x30, 0x38, 0xE0, 0x30, 0x0F, 0xE0, 0x18, 0x03, 0xC0, 0x00, 0x78, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x61, 0x80, 0x00, 0x60, 0x60, 0x00, 0x30, 0x30, 0x00, 0x18, 0x18, 0x00, 0x0C, 0x0C, 0x00, 0x06, 0x0C, 0x00, 0x03, 0x8E, 0x00, 0x01, 0xCE, 0x00, 0x00, 0x7C, 0x3F, 0xC0, 0x38, 0x07, 0x80, 0x3E, 0x03, 0x80, 0x77, 0x01, 0x80, 0x73, 0xC0, 0x80, 0xF0, 0xF0, 0xC0, 0x70, 0x7C, 0xC0, 0x78, 0x1E, 0x40, 0x3C, 0x07, 0xC0, 0x1E, 0x01, 0xE0, 0x0F, 0x00, 0x78, 0x0F, 0xC0, 0xFF, 0x0D, 0xF0, 0xC7, 0xFC, 0x7F, 0xC1, 0xFC, 0x1F, 0x80, 0x3C, 0x00, 0xFF, 0xFE, 0x92, 0x40, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC0, 0xC0, 0x60, 0x70, 0x30, 0x18, 0x1C, 0x0E, 0x07, 0x03, 0x81, 0xC0, 0xE0, 0x70, 0x38, 0x0C, 0x06, 0x03, 0x80, 0xC0, 0x60, 0x18, 0x0C, 0x03, 0x00, 0xC0, 0x30, 0x0C, 0x80, 0x30, 0x0C, 0x03, 0x00, 0xC0, 0x60, 0x18, 0x0C, 0x07, 0x01, 0x80, 0xC0, 0x70, 0x38, 0x1C, 0x0E, 0x07, 0x03, 0x81, 0xC0, 0xE0, 0x60, 0x30, 0x38, 0x18, 0x0C, 0x0C, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x0C, 0x00, 0xC0, 0x0C, 0x0C, 0x46, 0xE4, 0xF7, 0x5E, 0x1F, 0x00, 0xC0, 0x17, 0x8E, 0x4E, 0xE4, 0xFC, 0xC6, 0x0C, 0x00, 0xC0, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x6F, 0xFF, 0x11, 0x24, 0x80, 0xFF, 0xFF, 0x6F, 0xF6, 0x00, 0xC0, 0x60, 0x18, 0x06, 0x03, 0x80, 0xC0, 0x30, 0x1C, 0x06, 0x01, 0x80, 0xE0, 0x30, 0x0C, 0x07, 0x01, 0x80, 0x60, 0x38, 0x0C, 0x03, 0x01, 0xC0, 0x60, 0x18, 0x0E, 0x03, 0x00, 0x03, 0xE0, 0x0E, 0x70, 0x1C, 0x38, 0x38, 0x1C, 0x38, 0x1C, 0x78, 0x1E, 0x70, 0x0E, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0x70, 0x0E, 0x70, 0x0E, 0x78, 0x1E, 0x38, 0x1C, 0x38, 0x1C, 0x1C, 0x38, 0x0C, 0x30, 0x03, 0xC0, 0x06, 0x03, 0x83, 0xE3, 0x38, 0x0E, 0x03, 0x80, 0xE0, 0x38, 0x0E, 0x03, 0x80, 0xE0, 0x38, 0x0E, 0x03, 0x80, 0xE0, 0x38, 0x0E, 0x03, 0x80, 0xE0, 0x38, 0x0E, 0x03, 0x81, 0xE1, 0xFF, 0x07, 0xC0, 0x1F, 0xF0, 0x3F, 0xF8, 0x70, 0xF8, 0x60, 0x3C, 0xC0, 0x3C, 0x80, 0x1C, 0x00, 0x1C, 0x00, 0x1C, 0x00, 0x18, 0x00, 0x18, 0x00, 0x30, 0x00, 0x30, 0x00, 0x60, 0x00, 0xC0, 0x00, 0x80, 0x01, 0x00, 0x02, 0x00, 0x04, 0x00, 0x08, 0x01, 0x10, 0x02, 0x3F, 0xFE, 0x7F, 0xFC, 0xFF, 0xFC, 0x0F, 0xC0, 0xFF, 0x0C, 0x3C, 0x80, 0xE4, 0x03, 0x00, 0x18, 0x00, 0xC0, 0x04, 0x00, 0x40, 0x04, 0x00, 0xF8, 0x1F, 0xE0, 0x0F, 0x00, 0x1C, 0x00, 0xE0, 0x03, 0x00, 0x18, 0x00, 0xC0, 0x06, 0x00, 0x60, 0x03, 0x78, 0x73, 0xFF, 0x0F, 0xC0, 0x00, 0x30, 0x00, 0x30, 0x00, 0x70, 0x00, 0xF0, 0x00, 0xB0, 0x01, 0x30, 0x03, 0x30, 0x06, 0x30, 0x04, 0x30, 0x08, 0x30, 0x18, 0x30, 0x10, 0x30, 0x20, 0x30, 0x60, 0x30, 0xC0, 0x30, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x00, 0x7F, 0xC3, 0xFE, 0x1F, 0xE1, 0x80, 0x08, 0x00, 0xC0, 0x07, 0xC0, 0x7F, 0x81, 0xFF, 0x00, 0xFC, 0x01, 0xE0, 0x07, 0x80, 0x1C, 0x00, 0x60, 0x03, 0x00, 0x18, 0x00, 0xC0, 0x06, 0x00, 0x60, 0x07, 0x78, 0x73, 0xFF, 0x0F, 0xC0, 0x00, 0x0E, 0x00, 0xF8, 0x03, 0xC0, 0x07, 0x80, 0x0F, 0x00, 0x1E, 0x00, 0x3C, 0x00, 0x7C, 0x00, 0x79, 0xF0, 0x7F, 0xFC, 0xF8, 0x3C, 0xF0, 0x1E, 0xF0, 0x1F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0x70, 0x0F, 0x78, 0x0F, 0x78, 0x0E, 0x3C, 0x1E, 0x1E, 0x3C, 0x0F, 0xF8, 0x07, 0xE0, 0x3F, 0xFD, 0xFF, 0xF7, 0xFF, 0xF0, 0x06, 0x80, 0x18, 0x00, 0x60, 0x03, 0x00, 0x0C, 0x00, 0x30, 0x01, 0x80, 0x06, 0x00, 0x18, 0x00, 0xE0, 0x03, 0x00, 0x0C, 0x00, 0x70, 0x01, 0x80, 0x06, 0x00, 0x38, 0x00, 0xC0, 0x03, 0x00, 0x1C, 0x00, 0x60, 0x00, 0x0F, 0x83, 0xFC, 0x70, 0xE6, 0x07, 0xC0, 0x3C, 0x03, 0xC0, 0x3E, 0x03, 0x70, 0x67, 0x8C, 0x3D, 0x81, 0xF0, 0x0F, 0x81, 0x7C, 0x21, 0xE6, 0x0E, 0xC0, 0x7C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x36, 0x06, 0x70, 0xE3, 0xFC, 0x0F, 0x80, 0x07, 0xC0, 0x1F, 0xF0, 0x3C, 0x78, 0x38, 0x3C, 0x78, 0x1E, 0x70, 0x1E, 0xF0, 0x0E, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF8, 0x0F, 0x78, 0x0F, 0x3C, 0x3F, 0x1F, 0xEE, 0x0F, 0x9E, 0x00, 0x1E, 0x00, 0x3C, 0x00, 0x38, 0x00, 0x78, 0x00, 0xF0, 0x01, 0xE0, 0x07, 0x80, 0x1E, 0x00, 0x70, 0x00, 0x6F, 0xF6, 0x00, 0x00, 0x00, 0x00, 0x06, 0xFF, 0x60, 0x67, 0xBC, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0xEF, 0x78, 0x42, 0x22, 0x20, 0x00, 0x00, 0xC0, 0x00, 0xF0, 0x01, 0xF8, 0x01, 0xF8, 0x01, 0xF8, 0x01, 0xF0, 0x03, 0xF0, 0x03, 0xF0, 0x00, 0xF0, 0x00, 0x3E, 0x00, 0x07, 0xE0, 0x00, 0x7E, 0x00, 0x03, 0xE0, 0x00, 0x3E, 0x00, 0x03, 0xF0, 0x00, 0x3F, 0x00, 0x03, 0xC0, 0x00, 0x10, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x80, 0x00, 0x3C, 0x00, 0x0F, 0xC0, 0x00, 0xFC, 0x00, 0x07, 0xC0, 0x00, 0x7C, 0x00, 0x07, 0xE0, 0x00, 0x7E, 0x00, 0x07, 0xC0, 0x00, 0xF0, 0x00, 0xFC, 0x00, 0xFC, 0x00, 0xF8, 0x01, 0xF8, 0x01, 0xF8, 0x01, 0xF8, 0x00, 0xF0, 0x00, 0x30, 0x00, 0x00, 0x1F, 0x81, 0xFF, 0x18, 0x7D, 0x81, 0xEC, 0x07, 0xF0, 0x3F, 0x81, 0xE0, 0x0F, 0x00, 0x70, 0x03, 0x80, 0x38, 0x01, 0x80, 0x08, 0x00, 0xC0, 0x04, 0x00, 0x20, 0x02, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x00, 0x03, 0x00, 0x3C, 0x01, 0xE0, 0x07, 0x00, 0x00, 0x7F, 0x00, 0x01, 0xFF, 0xC0, 0x07, 0x80, 0xF0, 0x0F, 0x00, 0x38, 0x1C, 0x00, 0x1C, 0x38, 0x00, 0x0C, 0x38, 0x00, 0x06, 0x70, 0x1E, 0x02, 0x70, 0x3F, 0xE3, 0xF0, 0x71, 0xE1, 0xE0, 0xE0, 0xC1, 0xE0, 0xC0, 0xC1, 0xE0, 0xC1, 0xC1, 0xE1, 0x81, 0xC1, 0xE1, 0x81, 0x83, 0xE1, 0x83, 0x82, 0xE1, 0x83, 0x86, 0x71, 0xC7, 0x8C, 0x70, 0xF9, 0xF8, 0x38, 0xF0, 0xF0, 0x3C, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x07, 0x80, 0x70, 0x03, 0xFF, 0xE0, 0x00, 0x7F, 0x00, 0x00, 0x10, 0x00, 0x00, 0x38, 0x00, 0x00, 0x38, 0x00, 0x00, 0x38, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x5C, 0x00, 0x00, 0xDE, 0x00, 0x00, 0x8E, 0x00, 0x01, 0x8F, 0x00, 0x01, 0x87, 0x00, 0x03, 0x07, 0x80, 0x03, 0x03, 0x80, 0x02, 0x03, 0xC0, 0x06, 0x03, 0xC0, 0x07, 0xFF, 0xC0, 0x0F, 0xFF, 0xE0, 0x0C, 0x01, 0xE0, 0x18, 0x00, 0xF0, 0x18, 0x00, 0xF0, 0x30, 0x00, 0x78, 0x30, 0x00, 0x78, 0x70, 0x00, 0x7C, 0xFC, 0x01, 0xFF, 0xFF, 0xFC, 0x03, 0xFF, 0xF8, 0x1E, 0x0F, 0xC1, 0xE0, 0x3C, 0x1E, 0x01, 0xE1, 0xE0, 0x1E, 0x1E, 0x01, 0xE1, 0xE0, 0x1E, 0x1E, 0x03, 0xC1, 0xE0, 0x78, 0x1F, 0xFE, 0x01, 0xFF, 0xF0, 0x1E, 0x07, 0xC1, 0xE0, 0x1E, 0x1E, 0x00, 0xF1, 0xE0, 0x0F, 0x1E, 0x00, 0xF1, 0xE0, 0x0F, 0x1E, 0x00, 0xF1, 0xE0, 0x1E, 0x1E, 0x07, 0xE3, 0xFF, 0xF8, 0xFF, 0xFE, 0x00, 0x00, 0xFE, 0x08, 0x0F, 0xFF, 0x60, 0xFC, 0x1F, 0x87, 0xC0, 0x1E, 0x3C, 0x00, 0x38, 0xF0, 0x00, 0x67, 0x80, 0x01, 0x9E, 0x00, 0x02, 0xF0, 0x00, 0x03, 0xC0, 0x00, 0x0F, 0x00, 0x00, 0x3C, 0x00, 0x00, 0xF0, 0x00, 0x03, 0xC0, 0x00, 0x0F, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x78, 0x00, 0x01, 0xE0, 0x00, 0x03, 0xC0, 0x00, 0x0F, 0x00, 0x02, 0x1F, 0x00, 0x38, 0x3F, 0x03, 0x80, 0x7F, 0xFC, 0x00, 0x3F, 0x80, 0xFF, 0xFC, 0x00, 0x7F, 0xFF, 0x00, 0x78, 0x3F, 0x80, 0xF0, 0x0F, 0x81, 0xE0, 0x0F, 0x83, 0xC0, 0x0F, 0x07, 0x80, 0x0F, 0x0F, 0x00, 0x1E, 0x1E, 0x00, 0x1E, 0x3C, 0x00, 0x3C, 0x78, 0x00, 0x78, 0xF0, 0x00, 0xF1, 0xE0, 0x01, 0xE3, 0xC0, 0x03, 0xC7, 0x80, 0x07, 0x8F, 0x00, 0x1E, 0x1E, 0x00, 0x3C, 0x3C, 0x00, 0xF0, 0x78, 0x01, 0xE0, 0xF0, 0x0F, 0x81, 0xE0, 0x7E, 0x07, 0xFF, 0xF0, 0x3F, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x87, 0xFF, 0xF8, 0x3C, 0x01, 0x83, 0xC0, 0x08, 0x3C, 0x00, 0x83, 0xC0, 0x00, 0x3C, 0x00, 0x03, 0xC0, 0x00, 0x3C, 0x02, 0x03, 0xC0, 0x60, 0x3F, 0xFE, 0x03, 0xFF, 0xE0, 0x3C, 0x06, 0x03, 0xC0, 0x20, 0x3C, 0x00, 0x03, 0xC0, 0x00, 0x3C, 0x00, 0x03, 0xC0, 0x01, 0x3C, 0x00, 0x23, 0xC0, 0x06, 0x3C, 0x01, 0xE7, 0xFF, 0xFE, 0xFF, 0xFF, 0xC0, 0xFF, 0xFF, 0xBF, 0xFF, 0xCF, 0x00, 0x67, 0x80, 0x13, 0xC0, 0x09, 0xE0, 0x00, 0xF0, 0x00, 0x78, 0x00, 0x3C, 0x02, 0x1E, 0x03, 0x0F, 0xFF, 0x87, 0xFF, 0xC3, 0xC0, 0x61, 0xE0, 0x10, 0xF0, 0x00, 0x78, 0x00, 0x3C, 0x00, 0x1E, 0x00, 0x0F, 0x00, 0x07, 0x80, 0x03, 0xC0, 0x03, 0xF0, 0x03, 0xFC, 0x00, 0x00, 0xFE, 0x04, 0x07, 0xFF, 0xB8, 0x1F, 0x03, 0xF0, 0xF8, 0x01, 0xE3, 0xE0, 0x01, 0xC7, 0x80, 0x01, 0x9E, 0x00, 0x01, 0x3C, 0x00, 0x00, 0xF0, 0x00, 0x01, 0xE0, 0x00, 0x03, 0xC0, 0x00, 0x07, 0x80, 0x07, 0xFF, 0x00, 0x07, 0xDE, 0x00, 0x07, 0xBC, 0x00, 0x0F, 0x78, 0x00, 0x1E, 0x78, 0x00, 0x3C, 0xF0, 0x00, 0x78, 0xF0, 0x00, 0xF1, 0xF0, 0x01, 0xE1, 0xF0, 0x03, 0xC1, 0xF8, 0x1F, 0x00, 0xFF, 0xFC, 0x00, 0x3F, 0x80, 0xFF, 0x03, 0xFD, 0xF8, 0x07, 0xE3, 0xC0, 0x0F, 0x0F, 0x00, 0x3C, 0x3C, 0x00, 0xF0, 0xF0, 0x03, 0xC3, 0xC0, 0x0F, 0x0F, 0x00, 0x3C, 0x3C, 0x00, 0xF0, 0xF0, 0x03, 0xC3, 0xFF, 0xFF, 0x0F, 0xFF, 0xFC, 0x3C, 0x00, 0xF0, 0xF0, 0x03, 0xC3, 0xC0, 0x0F, 0x0F, 0x00, 0x3C, 0x3C, 0x00, 0xF0, 0xF0, 0x03, 0xC3, 0xC0, 0x0F, 0x0F, 0x00, 0x3C, 0x3C, 0x00, 0xF1, 0xF8, 0x07, 0xEF, 0xF0, 0x3F, 0xC0, 0xFF, 0xBF, 0x0F, 0x07, 0x83, 0xC1, 0xE0, 0xF0, 0x78, 0x3C, 0x1E, 0x0F, 0x07, 0x83, 0xC1, 0xE0, 0xF0, 0x78, 0x3C, 0x1E, 0x0F, 0x07, 0x83, 0xC3, 0xF3, 0xFE, 0x0F, 0xF0, 0x7E, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x3C, 0x03, 0xC6, 0x38, 0xF3, 0x8F, 0xF0, 0x7C, 0x00, 0xFF, 0x07, 0xFC, 0xFC, 0x03, 0xC0, 0xF0, 0x07, 0x01, 0xE0, 0x1C, 0x03, 0xC0, 0x60, 0x07, 0x81, 0x80, 0x0F, 0x06, 0x00, 0x1E, 0x18, 0x00, 0x3C, 0x60, 0x00, 0x79, 0x80, 0x00, 0xFF, 0x00, 0x01, 0xFF, 0x00, 0x03, 0xDF, 0x00, 0x07, 0x8F, 0x00, 0x0F, 0x0F, 0x00, 0x1E, 0x0F, 0x00, 0x3C, 0x0F, 0x00, 0x78, 0x0F, 0x00, 0xF0, 0x1F, 0x01, 0xE0, 0x1F, 0x03, 0xC0, 0x1F, 0x0F, 0xC0, 0x3F, 0x3F, 0xC1, 0xFF, 0x80, 0xFF, 0x00, 0x0F, 0xC0, 0x00, 0xF0, 0x00, 0x1E, 0x00, 0x03, 0xC0, 0x00, 0x78, 0x00, 0x0F, 0x00, 0x01, 0xE0, 0x00, 0x3C, 0x00, 0x07, 0x80, 0x00, 0xF0, 0x00, 0x1E, 0x00, 0x03, 0xC0, 0x00, 0x78, 0x00, 0x0F, 0x00, 0x01, 0xE0, 0x00, 0x3C, 0x00, 0x07, 0x80, 0x04, 0xF0, 0x01, 0x1E, 0x00, 0x63, 0xC0, 0x3C, 0xFF, 0xFF, 0xBF, 0xFF, 0xE0, 0xFC, 0x00, 0x03, 0xF9, 0xF0, 0x00, 0x1F, 0x87, 0x80, 0x01, 0xF8, 0x3E, 0x00, 0x0F, 0xC1, 0xF0, 0x00, 0x5E, 0x0B, 0xC0, 0x06, 0xF0, 0x5E, 0x00, 0x37, 0x82, 0x78, 0x03, 0x3C, 0x13, 0xC0, 0x19, 0xE0, 0x8F, 0x01, 0x8F, 0x04, 0x78, 0x0C, 0x78, 0x21, 0xE0, 0xC3, 0xC1, 0x0F, 0x06, 0x1E, 0x08, 0x3C, 0x60, 0xF0, 0x41, 0xE3, 0x07, 0x82, 0x07, 0xB0, 0x3C, 0x10, 0x3D, 0x81, 0xE0, 0x81, 0xF8, 0x0F, 0x04, 0x07, 0xC0, 0x78, 0x20, 0x3C, 0x03, 0xC1, 0x00, 0xE0, 0x1E, 0x1C, 0x06, 0x01, 0xFB, 0xF8, 0x10, 0x1F, 0xE0, 0xFC, 0x00, 0xFE, 0x78, 0x00, 0x70, 0x78, 0x00, 0x40, 0xF8, 0x00, 0x81, 0xF8, 0x01, 0x02, 0xF8, 0x02, 0x04, 0xF8, 0x04, 0x08, 0xF0, 0x08, 0x11, 0xF0, 0x10, 0x21, 0xF0, 0x20, 0x41, 0xF0, 0x40, 0x81, 0xF0, 0x81, 0x01, 0xF1, 0x02, 0x01, 0xE2, 0x04, 0x03, 0xE4, 0x08, 0x03, 0xE8, 0x10, 0x03, 0xF0, 0x20, 0x03, 0xE0, 0x40, 0x03, 0xC0, 0x80, 0x03, 0x81, 0x00, 0x07, 0x07, 0x00, 0x06, 0x3F, 0x80, 0x04, 0x00, 0x00, 0xFE, 0x00, 0x07, 0xFF, 0x00, 0x3E, 0x0F, 0x80, 0xF0, 0x07, 0x83, 0xC0, 0x07, 0x87, 0x80, 0x07, 0x1E, 0x00, 0x0F, 0x3C, 0x00, 0x1E, 0xF0, 0x00, 0x1F, 0xE0, 0x00, 0x3F, 0xC0, 0x00, 0x7F, 0x80, 0x00, 0xFF, 0x00, 0x01, 0xFE, 0x00, 0x03, 0xFC, 0x00, 0x07, 0xF8, 0x00, 0x0F, 0x78, 0x00, 0x3C, 0xF0, 0x00, 0x78, 0xE0, 0x01, 0xE1, 0xE0, 0x03, 0xC1, 0xE0, 0x0F, 0x01, 0xF0, 0x7C, 0x00, 0xFF, 0xE0, 0x00, 0x7F, 0x00, 0xFF, 0xF8, 0x1F, 0xFF, 0x83, 0xC1, 0xF0, 0xF0, 0x1E, 0x3C, 0x07, 0xCF, 0x00, 0xF3, 0xC0, 0x3C, 0xF0, 0x0F, 0x3C, 0x03, 0xCF, 0x01, 0xF3, 0xC0, 0x78, 0xF0, 0x7C, 0x3F, 0xFE, 0x0F, 0xFE, 0x03, 0xC0, 0x00, 0xF0, 0x00, 0x3C, 0x00, 0x0F, 0x00, 0x03, 0xC0, 0x00, 0xF0, 0x00, 0x3C, 0x00, 0x1F, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0xFE, 0x00, 0x07, 0xFF, 0x00, 0x3E, 0x0F, 0x80, 0xF0, 0x07, 0x83, 0xC0, 0x07, 0x87, 0x80, 0x0F, 0x1E, 0x00, 0x0F, 0x3C, 0x00, 0x1E, 0xF0, 0x00, 0x1D, 0xE0, 0x00, 0x3F, 0xC0, 0x00, 0x7F, 0x80, 0x00, 0xFF, 0x00, 0x01, 0xFE, 0x00, 0x03, 0xFC, 0x00, 0x07, 0xF8, 0x00, 0x0F, 0x70, 0x00, 0x1C, 0xF0, 0x00, 0x79, 0xE0, 0x00, 0xF1, 0xE0, 0x03, 0xC1, 0xC0, 0x07, 0x01, 0xC0, 0x1C, 0x01, 0xE0, 0xF0, 0x00, 0x7F, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x0F, 0xC0, 0xFF, 0xF0, 0x03, 0xFF, 0xF0, 0x0F, 0x07, 0xC0, 0x78, 0x1E, 0x03, 0xC0, 0x78, 0x1E, 0x03, 0xC0, 0xF0, 0x1E, 0x07, 0x80, 0xF0, 0x3C, 0x07, 0x81, 0xE0, 0x78, 0x0F, 0x0F, 0x80, 0x7F, 0xF8, 0x03, 0xFE, 0x00, 0x1E, 0x78, 0x00, 0xF1, 0xE0, 0x07, 0x87, 0x80, 0x3C, 0x3C, 0x01, 0xE0, 0xF0, 0x0F, 0x03, 0xC0, 0x78, 0x0F, 0x03, 0xC0, 0x7C, 0x3F, 0x01, 0xF3, 0xFC, 0x07, 0xE0, 0x07, 0x84, 0x1F, 0xFC, 0x3C, 0x3E, 0x30, 0x0E, 0x70, 0x06, 0x70, 0x06, 0x70, 0x02, 0x78, 0x00, 0x7C, 0x00, 0x3F, 0x00, 0x1F, 0xC0, 0x0F, 0xE0, 0x03, 0xF8, 0x00, 0xFC, 0x00, 0x3E, 0x00, 0x1F, 0x80, 0x0F, 0x80, 0x0F, 0xC0, 0x0F, 0xE0, 0x0F, 0x70, 0x1E, 0x78, 0x3C, 0x4F, 0xF8, 0x43, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xF0, 0x7C, 0x0F, 0x03, 0x80, 0xF0, 0x10, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x1F, 0x80, 0x03, 0xFC, 0x00, 0xFF, 0x01, 0xFD, 0xF8, 0x01, 0xC3, 0xC0, 0x02, 0x0F, 0x00, 0x08, 0x3C, 0x00, 0x20, 0xF0, 0x00, 0x83, 0xC0, 0x02, 0x0F, 0x00, 0x08, 0x3C, 0x00, 0x20, 0xF0, 0x00, 0x83, 0xC0, 0x02, 0x0F, 0x00, 0x08, 0x3C, 0x00, 0x20, 0xF0, 0x00, 0x83, 0xC0, 0x02, 0x0F, 0x00, 0x08, 0x3C, 0x00, 0x20, 0xF0, 0x00, 0x81, 0xE0, 0x04, 0x07, 0x80, 0x30, 0x0F, 0x81, 0x80, 0x1F, 0xFC, 0x00, 0x1F, 0xC0, 0x00, 0xFF, 0xC0, 0x7F, 0x3E, 0x00, 0x1E, 0x1E, 0x00, 0x0C, 0x0E, 0x00, 0x18, 0x0F, 0x00, 0x18, 0x07, 0x00, 0x10, 0x07, 0x80, 0x30, 0x07, 0x80, 0x30, 0x03, 0xC0, 0x60, 0x03, 0xC0, 0x60, 0x01, 0xE0, 0x40, 0x01, 0xE0, 0xC0, 0x00, 0xF0, 0xC0, 0x00, 0xF1, 0x80, 0x00, 0x71, 0x80, 0x00, 0x7B, 0x00, 0x00, 0x3B, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x08, 0x00, 0xFF, 0x9F, 0xF0, 0x3F, 0x9F, 0x03, 0xE0, 0x07, 0x07, 0x80, 0xF0, 0x03, 0x03, 0xC0, 0x78, 0x01, 0x80, 0xE0, 0x1E, 0x00, 0x80, 0x78, 0x0F, 0x00, 0xC0, 0x1C, 0x03, 0x80, 0x60, 0x0F, 0x01, 0xE0, 0x20, 0x07, 0x81, 0xF0, 0x30, 0x01, 0xC0, 0xBC, 0x18, 0x00, 0xF0, 0xDE, 0x08, 0x00, 0x78, 0x67, 0x0C, 0x00, 0x1E, 0x23, 0xC4, 0x00, 0x0F, 0x31, 0xE6, 0x00, 0x03, 0x90, 0x7B, 0x00, 0x01, 0xF8, 0x3D, 0x00, 0x00, 0xFC, 0x0F, 0x80, 0x00, 0x3C, 0x07, 0xC0, 0x00, 0x1E, 0x03, 0xC0, 0x00, 0x0F, 0x00, 0xE0, 0x00, 0x03, 0x00, 0x70, 0x00, 0x01, 0x80, 0x10, 0x00, 0x00, 0x80, 0x08, 0x00, 0x7F, 0xE0, 0xFF, 0x0F, 0xC0, 0x1E, 0x03, 0xE0, 0x0E, 0x00, 0xF0, 0x06, 0x00, 0x3C, 0x06, 0x00, 0x0F, 0x06, 0x00, 0x07, 0x86, 0x00, 0x01, 0xE6, 0x00, 0x00, 0x7B, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x03, 0xF0, 0x00, 0x03, 0x78, 0x00, 0x01, 0x9E, 0x00, 0x01, 0x87, 0x80, 0x01, 0x83, 0xE0, 0x01, 0x80, 0xF0, 0x01, 0x80, 0x3C, 0x01, 0x80, 0x1F, 0x01, 0xC0, 0x07, 0xC1, 0xE0, 0x03, 0xF3, 0xFE, 0x0F, 0xFE, 0xFF, 0xC0, 0xFF, 0x7E, 0x00, 0x1C, 0x1E, 0x00, 0x18, 0x1F, 0x00, 0x30, 0x0F, 0x00, 0x60, 0x07, 0x80, 0x60, 0x03, 0xC0, 0xC0, 0x03, 0xE1, 0x80, 0x01, 0xE1, 0x80, 0x00, 0xF3, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x7E, 0x00, 0x01, 0xFF, 0x80, 0x3F, 0xFF, 0xF1, 0xFF, 0xFF, 0x9C, 0x00, 0x78, 0xC0, 0x07, 0x84, 0x00, 0x38, 0x00, 0x03, 0xC0, 0x00, 0x3C, 0x00, 0x03, 0xC0, 0x00, 0x1C, 0x00, 0x01, 0xE0, 0x00, 0x1E, 0x00, 0x01, 0xE0, 0x00, 0x0E, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x07, 0x00, 0x00, 0x78, 0x00, 0x47, 0x80, 0x06, 0x78, 0x00, 0x33, 0x80, 0x07, 0x3F, 0xFF, 0xFB, 0xFF, 0xFF, 0xC0, 0xFF, 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0x83, 0x07, 0xF0, 0xC0, 0x18, 0x06, 0x01, 0x80, 0x70, 0x0C, 0x03, 0x00, 0xE0, 0x18, 0x06, 0x01, 0xC0, 0x30, 0x0C, 0x03, 0x80, 0x60, 0x18, 0x07, 0x00, 0xC0, 0x30, 0x0E, 0x01, 0x80, 0x60, 0x1C, 0x03, 0xFE, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0x83, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0x83, 0x06, 0x0C, 0x1F, 0xF0, 0x03, 0x80, 0x0F, 0x00, 0x1F, 0x00, 0x76, 0x00, 0xCE, 0x03, 0x8C, 0x06, 0x1C, 0x1C, 0x18, 0x30, 0x30, 0xE0, 0x31, 0x80, 0x67, 0x00, 0x6C, 0x00, 0xC0, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xC0, 0xE0, 0x70, 0x18, 0x0C, 0x03, 0x1F, 0x03, 0x8C, 0x38, 0x31, 0xC1, 0x8E, 0x0C, 0x00, 0x60, 0x0F, 0x01, 0x98, 0x30, 0xC3, 0x86, 0x38, 0x31, 0xC1, 0x8E, 0x0C, 0x78, 0xE5, 0xFB, 0xCF, 0x0C, 0x00, 0x00, 0x38, 0x00, 0xF8, 0x00, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0x39, 0xF0, 0x3B, 0xFC, 0x3C, 0x3E, 0x38, 0x0E, 0x38, 0x0F, 0x38, 0x07, 0x38, 0x07, 0x38, 0x07, 0x38, 0x07, 0x38, 0x07, 0x38, 0x06, 0x38, 0x0E, 0x38, 0x0C, 0x3C, 0x1C, 0x1F, 0xF0, 0x07, 0xE0, 0x07, 0xE0, 0x7F, 0xE3, 0x87, 0xD8, 0x0F, 0x60, 0x1B, 0x00, 0x0C, 0x00, 0x30, 0x00, 0xC0, 0x03, 0x00, 0x0E, 0x00, 0x3C, 0x01, 0x78, 0x19, 0xFF, 0xC3, 0xFE, 0x03, 0xE0, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x7C, 0x00, 0x1C, 0x00, 0x1C, 0x00, 0x1C, 0x00, 0x1C, 0x00, 0x1C, 0x00, 0x1C, 0x07, 0x9C, 0x1F, 0xDC, 0x38, 0x7C, 0x70, 0x3C, 0x70, 0x1C, 0x60, 0x1C, 0xE0, 0x1C, 0xE0, 0x1C, 0xE0, 0x1C, 0xE0, 0x1C, 0xE0, 0x1C, 0xF0, 0x1C, 0x70, 0x1C, 0x7C, 0x3E, 0x3F, 0xDF, 0x0F, 0x90, 0x0F, 0x81, 0xFF, 0x08, 0x3C, 0x80, 0xE7, 0xFF, 0x7F, 0xFF, 0x00, 0x18, 0x00, 0xC0, 0x07, 0x00, 0x38, 0x03, 0xE0, 0x37, 0x83, 0x3F, 0xF0, 0xFF, 0x03, 0xF0, 0x01, 0xF0, 0x3F, 0xC3, 0x8E, 0x18, 0x00, 0xC0, 0x0E, 0x00, 0x70, 0x03, 0x80, 0x1C, 0x03, 0xFE, 0x1F, 0xF0, 0x38, 0x01, 0xC0, 0x0E, 0x00, 0x70, 0x03, 0x80, 0x1C, 0x00, 0xE0, 0x07, 0x00, 0x38, 0x01, 0xC0, 0x0E, 0x00, 0x70, 0x07, 0xC0, 0xFF, 0x80, 0x0F, 0xC0, 0x1F, 0xFF, 0x38, 0xFF, 0x70, 0x70, 0x70, 0x70, 0x70, 0x30, 0x70, 0x30, 0x70, 0x30, 0x38, 0x20, 0x1C, 0x60, 0x0F, 0x80, 0x10, 0x00, 0x20, 0x00, 0x60, 0x00, 0x7F, 0xE0, 0x3F, 0xFC, 0x1F, 0xFE, 0x20, 0x06, 0x40, 0x02, 0xC0, 0x02, 0xC0, 0x04, 0xF0, 0x18, 0x7F, 0xF0, 0x1F, 0x80, 0x00, 0x00, 0x38, 0x00, 0xF8, 0x00, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0x38, 0xF0, 0x3B, 0xF8, 0x3E, 0x3C, 0x3C, 0x1C, 0x38, 0x1C, 0x38, 0x1C, 0x38, 0x1C, 0x38, 0x1C, 0x38, 0x1C, 0x38, 0x1C, 0x38, 0x1C, 0x38, 0x1C, 0x38, 0x1C, 0x38, 0x1C, 0x7C, 0x3E, 0xFE, 0x7F, 0x18, 0x3C, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x04, 0x3C, 0x7C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x3C, 0xFF, 0x03, 0x03, 0xC1, 0xE0, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0xC3, 0xE0, 0x70, 0x38, 0x1C, 0x0E, 0x07, 0x03, 0x81, 0xC0, 0xE0, 0x70, 0x38, 0x1C, 0x0E, 0x07, 0x03, 0x81, 0xC0, 0xE0, 0x70, 0x37, 0x3B, 0xF8, 0xF8, 0x00, 0x00, 0x1C, 0x00, 0x3E, 0x00, 0x07, 0x00, 0x03, 0x80, 0x01, 0xC0, 0x00, 0xE0, 0x00, 0x70, 0x00, 0x38, 0x00, 0x1C, 0x3F, 0x8E, 0x0F, 0x07, 0x06, 0x03, 0x86, 0x01, 0xC4, 0x00, 0xE4, 0x00, 0x7E, 0x00, 0x3F, 0x80, 0x1D, 0xC0, 0x0E, 0x70, 0x07, 0x1C, 0x03, 0x8F, 0x01, 0xC3, 0xC0, 0xE0, 0xF0, 0xF8, 0x3C, 0xFE, 0x7F, 0x80, 0x00, 0x1C, 0x7C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x3C, 0xFF, 0x38, 0xF0, 0x7C, 0x3E, 0xFE, 0x7F, 0x83, 0xE3, 0xF0, 0xE0, 0xE0, 0x70, 0x1C, 0x38, 0x1C, 0x07, 0x0E, 0x07, 0x01, 0xC3, 0x81, 0xC0, 0x70, 0xE0, 0x70, 0x1C, 0x38, 0x1C, 0x07, 0x0E, 0x07, 0x01, 0xC3, 0x81, 0xC0, 0x70, 0xE0, 0x70, 0x1C, 0x38, 0x1C, 0x07, 0x0E, 0x07, 0x01, 0xC3, 0x81, 0xE0, 0x73, 0xF9, 0xFC, 0x7F, 0x38, 0xF0, 0xFB, 0xF8, 0x3E, 0x3C, 0x38, 0x1C, 0x38, 0x1C, 0x38, 0x1C, 0x38, 0x1C, 0x38, 0x1C, 0x38, 0x1C, 0x38, 0x1C, 0x38, 0x1C, 0x38, 0x1C, 0x38, 0x1C, 0x38, 0x1C, 0x78, 0x3C, 0xFE, 0x7F, 0x07, 0xE0, 0x1F, 0xF8, 0x3C, 0x7C, 0x78, 0x3E, 0x70, 0x1E, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF0, 0x0F, 0xF8, 0x0F, 0x78, 0x0E, 0x7C, 0x1C, 0x3E, 0x3C, 0x0F, 0xF0, 0x07, 0xC0, 0x18, 0xF0, 0xFB, 0xFC, 0x3E, 0x1E, 0x38, 0x0E, 0x38, 0x0F, 0x38, 0x07, 0x38, 0x07, 0x38, 0x07, 0x38, 0x07, 0x38, 0x07, 0x38, 0x06, 0x38, 0x0E, 0x38, 0x0C, 0x3E, 0x1C, 0x3B, 0xF8, 0x39, 0xE0, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0x7C, 0x00, 0xFF, 0x00, 0x07, 0xC4, 0x1F, 0xEC, 0x3C, 0x3C, 0x70, 0x1C, 0x70, 0x1C, 0x60, 0x1C, 0xE0, 0x1C, 0xE0, 0x1C, 0xE0, 0x1C, 0xE0, 0x1C, 0xE0, 0x1C, 0xF0, 0x1C, 0x70, 0x1C, 0x78, 0x3C, 0x3F, 0xDC, 0x1F, 0x1C, 0x00, 0x1C, 0x00, 0x1C, 0x00, 0x1C, 0x00, 0x1C, 0x00, 0x1C, 0x00, 0x1C, 0x00, 0x3E, 0x00, 0xFF, 0x19, 0xFF, 0x7C, 0xF3, 0x9C, 0x03, 0x80, 0x70, 0x0E, 0x01, 0xC0, 0x38, 0x07, 0x00, 0xE0, 0x1C, 0x03, 0x80, 0x70, 0x1F, 0x07, 0xF0, 0x3E, 0x58, 0x7C, 0x0F, 0x03, 0xC0, 0x7C, 0x07, 0x80, 0xF8, 0x1F, 0x81, 0xF8, 0x1E, 0x03, 0xC0, 0xF0, 0x3E, 0x1A, 0x7C, 0x10, 0x30, 0x70, 0xFE, 0xFE, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x79, 0x7E, 0x3C, 0xF8, 0x7C, 0x38, 0x3C, 0x38, 0x1C, 0x38, 0x1C, 0x38, 0x1C, 0x38, 0x1C, 0x38, 0x1C, 0x38, 0x1C, 0x38, 0x1C, 0x38, 0x1C, 0x38, 0x1C, 0x38, 0x1C, 0x38, 0x1C, 0x3C, 0x7C, 0x1F, 0xDF, 0x0F, 0x18, 0xFE, 0x1F, 0x7C, 0x06, 0x38, 0x04, 0x1C, 0x04, 0x1C, 0x0C, 0x0E, 0x08, 0x0E, 0x18, 0x07, 0x10, 0x07, 0x10, 0x07, 0x20, 0x03, 0xA0, 0x03, 0xE0, 0x01, 0xC0, 0x01, 0xC0, 0x00, 0x80, 0x00, 0x80, 0xFC, 0x7F, 0x1F, 0x78, 0x3C, 0x06, 0x38, 0x1C, 0x04, 0x38, 0x1C, 0x04, 0x1C, 0x1C, 0x0C, 0x1C, 0x0E, 0x08, 0x1C, 0x1E, 0x18, 0x0E, 0x17, 0x10, 0x0E, 0x37, 0x10, 0x07, 0x23, 0x30, 0x07, 0x63, 0xA0, 0x07, 0x43, 0xE0, 0x03, 0xC1, 0xC0, 0x03, 0x81, 0xC0, 0x01, 0x80, 0x80, 0x01, 0x00, 0x80, 0x7F, 0x7E, 0x1E, 0x0C, 0x07, 0x8C, 0x01, 0xC4, 0x00, 0x76, 0x00, 0x3E, 0x00, 0x0E, 0x00, 0x03, 0x80, 0x03, 0xE0, 0x01, 0x70, 0x01, 0x1C, 0x01, 0x8F, 0x01, 0x83, 0x80, 0x80, 0xE0, 0xC0, 0x79, 0xF0, 0xFF, 0xFE, 0x0F, 0x7C, 0x06, 0x38, 0x06, 0x1C, 0x04, 0x1C, 0x0C, 0x0E, 0x0C, 0x0E, 0x08, 0x0F, 0x18, 0x07, 0x10, 0x07, 0x90, 0x03, 0xB0, 0x03, 0xA0, 0x01, 0xE0, 0x01, 0xE0, 0x00, 0xC0, 0x00, 0xC0, 0x00, 0x80, 0x00, 0x80, 0x01, 0x80, 0x01, 0x00, 0x03, 0x00, 0x7E, 0x00, 0x7C, 0x00, 0x78, 0x00, 0x7F, 0xF9, 0xFF, 0xE6, 0x07, 0x10, 0x38, 0x00, 0xE0, 0x07, 0x00, 0x38, 0x01, 0xE0, 0x07, 0x00, 0x38, 0x01, 0xE0, 0x07, 0x01, 0x38, 0x0D, 0xC0, 0x3F, 0xFF, 0xBF, 0xFE, 0x07, 0x0E, 0x1C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x30, 0x60, 0x60, 0x10, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1C, 0x0E, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x70, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x08, 0x06, 0x06, 0x08, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x38, 0x70, 0xE0, 0x3E, 0x00, 0x7F, 0x87, 0xE3, 0xFE, 0x00, 0x7C }; const GFXglyph FreeSerif18pt7bGlyphs[] = { { 0, 0, 0, 9, 0, 1 }, // 0x20 ' ' { 0, 4, 24, 12, 5, -23 }, // 0x21 '!' { 12, 8, 9, 14, 3, -23 }, // 0x22 '"' { 21, 17, 23, 17, 0, -22 }, // 0x23 '#' { 70, 13, 27, 17, 2, -24 }, // 0x24 '$' { 114, 25, 23, 29, 2, -22 }, // 0x25 '%' { 186, 25, 25, 27, 1, -24 }, // 0x26 '&' { 265, 3, 9, 7, 2, -23 }, // 0x27 ''' { 269, 9, 30, 12, 2, -23 }, // 0x28 '(' { 303, 9, 30, 12, 1, -22 }, // 0x29 ')' { 337, 12, 14, 18, 3, -23 }, // 0x2A '*' { 358, 16, 18, 20, 2, -17 }, // 0x2B '+' { 394, 4, 9, 9, 2, -3 }, // 0x2C ',' { 399, 8, 2, 12, 1, -8 }, // 0x2D '-' { 401, 4, 4, 9, 2, -3 }, // 0x2E '.' { 403, 10, 24, 10, 0, -23 }, // 0x2F '/' { 433, 16, 24, 18, 1, -23 }, // 0x30 '0' { 481, 10, 24, 18, 3, -23 }, // 0x31 '1' { 511, 16, 24, 17, 1, -23 }, // 0x32 '2' { 559, 13, 24, 17, 2, -23 }, // 0x33 '3' { 598, 16, 23, 18, 0, -22 }, // 0x34 '4' { 644, 13, 24, 17, 2, -23 }, // 0x35 '5' { 683, 16, 24, 18, 1, -23 }, // 0x36 '6' { 731, 14, 23, 18, 1, -22 }, // 0x37 '7' { 772, 12, 25, 18, 2, -24 }, // 0x38 '8' { 810, 16, 26, 17, 1, -24 }, // 0x39 '9' { 862, 4, 17, 9, 2, -16 }, // 0x3A ':' { 871, 5, 22, 9, 2, -16 }, // 0x3B ';' { 885, 18, 18, 20, 1, -17 }, // 0x3C '<' { 926, 18, 9, 20, 1, -12 }, // 0x3D '=' { 947, 18, 18, 20, 1, -17 }, // 0x3E '>' { 988, 13, 25, 16, 2, -24 }, // 0x3F '?' { 1029, 24, 25, 30, 3, -24 }, // 0x40 '@' { 1104, 24, 23, 25, 1, -22 }, // 0x41 'A' { 1173, 20, 23, 22, 1, -22 }, // 0x42 'B' { 1231, 22, 24, 23, 1, -23 }, // 0x43 'C' { 1297, 23, 23, 25, 1, -22 }, // 0x44 'D' { 1364, 20, 23, 21, 2, -22 }, // 0x45 'E' { 1422, 17, 23, 20, 2, -22 }, // 0x46 'F' { 1471, 23, 24, 25, 1, -23 }, // 0x47 'G' { 1540, 22, 23, 25, 2, -22 }, // 0x48 'H' { 1604, 9, 23, 11, 2, -22 }, // 0x49 'I' { 1630, 12, 23, 13, 0, -22 }, // 0x4A 'J' { 1665, 23, 23, 25, 2, -22 }, // 0x4B 'K' { 1732, 19, 23, 21, 2, -22 }, // 0x4C 'L' { 1787, 29, 23, 31, 1, -22 }, // 0x4D 'M' { 1871, 23, 23, 25, 1, -22 }, // 0x4E 'N' { 1938, 23, 24, 25, 1, -23 }, // 0x4F 'O' { 2007, 18, 23, 20, 1, -22 }, // 0x50 'P' { 2059, 23, 30, 25, 1, -23 }, // 0x51 'Q' { 2146, 21, 23, 23, 2, -22 }, // 0x52 'R' { 2207, 16, 24, 19, 1, -23 }, // 0x53 'S' { 2255, 20, 23, 21, 1, -22 }, // 0x54 'T' { 2313, 22, 23, 25, 2, -22 }, // 0x55 'U' { 2377, 24, 23, 25, 0, -22 }, // 0x56 'V' { 2446, 33, 23, 33, 0, -22 }, // 0x57 'W' { 2541, 25, 23, 25, 0, -22 }, // 0x58 'X' { 2613, 24, 23, 25, 1, -22 }, // 0x59 'Y' { 2682, 21, 23, 21, 0, -22 }, // 0x5A 'Z' { 2743, 7, 28, 12, 3, -22 }, // 0x5B '[' { 2768, 10, 24, 10, 0, -23 }, // 0x5C '\' { 2798, 7, 28, 12, 2, -22 }, // 0x5D ']' { 2823, 15, 13, 16, 1, -22 }, // 0x5E '^' { 2848, 18, 2, 17, 0, 3 }, // 0x5F '_' { 2853, 8, 6, 9, 1, -23 }, // 0x60 '`' { 2859, 13, 16, 15, 2, -15 }, // 0x61 'a' { 2885, 16, 25, 17, 1, -24 }, // 0x62 'b' { 2935, 14, 16, 16, 1, -15 }, // 0x63 'c' { 2963, 16, 25, 17, 1, -24 }, // 0x64 'd' { 3013, 13, 16, 16, 1, -15 }, // 0x65 'e' { 3039, 13, 25, 13, 0, -24 }, // 0x66 'f' { 3080, 16, 24, 16, 1, -15 }, // 0x67 'g' { 3128, 16, 25, 17, 1, -24 }, // 0x68 'h' { 3178, 8, 24, 10, 0, -23 }, // 0x69 'i' { 3202, 9, 32, 12, 0, -23 }, // 0x6A 'j' { 3238, 17, 25, 18, 1, -24 }, // 0x6B 'k' { 3292, 8, 25, 9, 0, -24 }, // 0x6C 'l' { 3317, 26, 16, 27, 1, -15 }, // 0x6D 'm' { 3369, 16, 16, 17, 1, -15 }, // 0x6E 'n' { 3401, 16, 16, 17, 1, -15 }, // 0x6F 'o' { 3433, 16, 24, 17, 1, -15 }, // 0x70 'p' { 3481, 16, 24, 17, 1, -15 }, // 0x71 'q' { 3529, 11, 16, 12, 1, -15 }, // 0x72 'r' { 3551, 10, 16, 13, 1, -15 }, // 0x73 's' { 3571, 8, 19, 10, 2, -18 }, // 0x74 't' { 3590, 16, 16, 17, 1, -15 }, // 0x75 'u' { 3622, 16, 16, 16, 0, -15 }, // 0x76 'v' { 3654, 24, 16, 24, 0, -15 }, // 0x77 'w' { 3702, 17, 16, 17, 0, -15 }, // 0x78 'x' { 3736, 16, 24, 16, 0, -15 }, // 0x79 'y' { 3784, 14, 16, 15, 0, -15 }, // 0x7A 'z' { 3812, 8, 30, 17, 3, -23 }, // 0x7B '{' { 3842, 2, 24, 7, 2, -23 }, // 0x7C '|' { 3848, 8, 30, 17, 6, -22 }, // 0x7D '}' { 3878, 16, 4, 17, 1, -10 } }; // 0x7E '~' const GFXfont FreeSerif18pt7b = { (uint8_t *)FreeSerif18pt7bBitmaps, (GFXglyph *)FreeSerif18pt7bGlyphs, 0x20, 0x7E, 42 }; // Approx. 4558 bytes
68.223256
73
0.59023
caa3ce3076959168ea3170b21732f5b127d89c75
8,349
c
C
lib/libufdt/ufdt_convert.c
ZVNexus/lk
2bc202595d6a2b60579153c83ac4214bf9526c99
[ "MIT" ]
1
2021-11-04T21:49:44.000Z
2021-11-04T21:49:44.000Z
lib/libufdt/ufdt_convert.c
ZVNexus/lk
2bc202595d6a2b60579153c83ac4214bf9526c99
[ "MIT" ]
null
null
null
lib/libufdt/ufdt_convert.c
ZVNexus/lk
2bc202595d6a2b60579153c83ac4214bf9526c99
[ "MIT" ]
null
null
null
#include "libufdt.h" #include "fdt_internal.h" #include "ufdt_util.h" struct ufdt *ufdt_construct(void *fdtp) { struct ufdt *res_ufdt = dto_malloc(sizeof(struct ufdt)); res_ufdt->fdtp = fdtp; res_ufdt->root = NULL; return res_ufdt; } void ufdt_destruct(struct ufdt *tree) { ufdt_node_destruct(tree->root); dto_free(tree->phandle_table.data); } static struct ufdt_node *ufdt_new_node(void *fdtp, int node_offset) { if (fdtp == NULL) { dto_error("Failed to get new_node because tree is NULL\n"); return NULL; } fdt32_t *fdt_tag_ptr = (fdt32_t *)fdt_offset_ptr(fdtp, node_offset, sizeof(fdt32_t)); struct ufdt_node *res = ufdt_node_construct(fdtp, fdt_tag_ptr); return res; } static struct ufdt_node *fdt_to_ufdt_tree(void *fdtp, int cur_fdt_tag_offset, int *next_fdt_tag_offset, int cur_tag) { if (fdtp == NULL) { return NULL; } uint32_t tag; struct ufdt_node *res, *child_node; res = NULL; child_node = NULL; tag = cur_tag; switch (tag) { case FDT_END_NODE: case FDT_NOP: case FDT_END: break; case FDT_PROP: res = ufdt_new_node(fdtp, cur_fdt_tag_offset); break; case FDT_BEGIN_NODE: res = ufdt_new_node(fdtp, cur_fdt_tag_offset); do { cur_fdt_tag_offset = *next_fdt_tag_offset; tag = fdt_next_tag(fdtp, cur_fdt_tag_offset, next_fdt_tag_offset); child_node = fdt_to_ufdt_tree(fdtp, cur_fdt_tag_offset, next_fdt_tag_offset, tag); ufdt_node_add_child(res, child_node); } while (tag != FDT_END_NODE); break; default: break; } return res; } void ufdt_print(struct ufdt *tree) { ufdt_node_print(tree->root, 0); } struct ufdt_node *ufdt_get_node_by_path_len(struct ufdt *tree, const char *path, int len) { /* * RARE: aliases * In device tree, we can assign some alias to specific nodes by defining * these relation in "/aliases" node. * The node has the form: * { * a = "/a_for_apple"; * b = "/b_for_banana"; * }; * So the path "a/subnode_1" should be expanded to "/a_for_apple/subnode_1". */ if (*path != '/') { const char *end = path + len; const char *next_slash; next_slash = dto_memchr(path, '/', end - path); if (!next_slash) next_slash = end; struct ufdt_node *aliases_node = ufdt_node_get_node_by_path(tree->root, "/aliases"); aliases_node = ufdt_node_get_property_by_name_len(aliases_node, path, next_slash - path); int path_len = 0; const char *alias_path = ufdt_node_get_fdt_prop_data(aliases_node, &path_len); if (alias_path == NULL) { dto_error("Failed to find alias %s\n", path); return NULL; } struct ufdt_node *target_node = ufdt_node_get_node_by_path_len(tree->root, alias_path, path_len); return ufdt_node_get_node_by_path_len(target_node, next_slash, end - next_slash); } return ufdt_node_get_node_by_path_len(tree->root, path, len); } struct ufdt_node *ufdt_get_node_by_path(struct ufdt *tree, const char *path) { return ufdt_get_node_by_path_len(tree, path, dto_strlen(path)); } struct ufdt_node *ufdt_get_node_by_phandle(struct ufdt *tree, uint32_t phandle) { struct ufdt_node *res = NULL; /* * Do binary search in phandle_table.data. * [s, e) means the possible range which contains target node. */ int s = 0, e = tree->phandle_table.len; while (e - s > 1) { int mid = s + ((e - s) >> 1); uint32_t mid_phandle = tree->phandle_table.data[mid].phandle; if (phandle < mid_phandle) e = mid; else s = mid; } if (e - s > 0) { res = tree->phandle_table.data[s].node; } return res; } int merge_children(struct ufdt_node *node_a, struct ufdt_node *node_b) { int err = 0; struct ufdt_node *it; for (it = ((struct fdt_node_ufdt_node *)node_b)->child; it;) { struct ufdt_node *cur_node = it; it = it->sibling; cur_node->sibling = NULL; struct ufdt_node *target_node = NULL; if (tag_of(cur_node) == FDT_BEGIN_NODE) { target_node = ufdt_node_get_subnode_by_name(node_a, name_of(cur_node)); } else { target_node = ufdt_node_get_property_by_name(node_a, name_of(cur_node)); } if (target_node == NULL) { err = ufdt_node_add_child(node_a, cur_node); } else { err = merge_ufdt_into(target_node, cur_node); } if (err < 0) return -1; } /* * The ufdt_node* in node_b will be copied to node_a. * To prevent the ufdt_node from being freed twice * (main_tree and overlay_tree) at the end of function * ufdt_apply_overlay(), set this node in node_b * (overlay_tree) to NULL. */ ((struct fdt_node_ufdt_node *)node_b)->child = NULL; return 0; } int merge_ufdt_into(struct ufdt_node *node_a, struct ufdt_node *node_b) { if (tag_of(node_a) == FDT_PROP) { node_a->fdt_tag_ptr = node_b->fdt_tag_ptr; return 0; } int err = 0; err = merge_children(node_a, node_b); if (err < 0) return -1; return 0; } void ufdt_map(struct ufdt *tree, struct ufdt_node_closure closure) { ufdt_node_map(tree->root, closure); } static int count_phandle_node(struct ufdt_node *node) { if (node == NULL) return 0; if (tag_of(node) != FDT_BEGIN_NODE) return 0; int res = 0; if (ufdt_node_get_phandle(node) > 0) res++; struct ufdt_node **it; for_each_child(it, node) { res += count_phandle_node(*it); } return res; } static void set_phandle_table_entry(struct ufdt_node *node, struct phandle_table_entry *data, int *cur) { if (node == NULL || tag_of(node) != FDT_BEGIN_NODE) return; int ph = ufdt_node_get_phandle(node); if (ph > 0) { data[*cur].phandle = ph; data[*cur].node = node; (*cur)++; } struct ufdt_node **it; for_each_node(it, node) set_phandle_table_entry(*it, data, cur); return; } int phandle_table_entry_cmp(const void *pa, const void *pb) { uint32_t ph_a = ((const struct phandle_table_entry *)pa)->phandle; uint32_t ph_b = ((const struct phandle_table_entry *)pb)->phandle; if (ph_a < ph_b) return -1; else if (ph_a == ph_b) return 0; else return 1; } struct static_phandle_table build_phandle_table(struct ufdt *tree) { struct static_phandle_table res; res.len = count_phandle_node(tree->root); res.data = dto_malloc(sizeof(struct phandle_table_entry) * res.len); int cur = 0; set_phandle_table_entry(tree->root, res.data, &cur); dto_qsort(res.data, res.len, sizeof(struct phandle_table_entry), phandle_table_entry_cmp); return res; } struct ufdt *fdt_to_ufdt(void *fdtp, size_t fdt_size) { (void)(fdt_size); // unused parameter struct ufdt *res_tree = ufdt_construct(fdtp); int start_offset = fdt_path_offset(fdtp, "/"); if (start_offset < 0) { res_tree->fdtp = NULL; return res_tree; } int end_offset; int start_tag = fdt_next_tag(fdtp, start_offset, &end_offset); res_tree->root = fdt_to_ufdt_tree(fdtp, start_offset, &end_offset, start_tag); res_tree->phandle_table = build_phandle_table(res_tree); return res_tree; } int ufdt_to_fdt(struct ufdt *tree, void *buf, int buf_size) { int err; err = fdt_create(buf, buf_size); if (err < 0) return -1; int n_mem_rsv = fdt_num_mem_rsv(tree->fdtp); for (int i = 0; i < n_mem_rsv; i++) { uint64_t addr, size; fdt_get_mem_rsv(tree->fdtp, i, &addr, &size); fdt_add_reservemap_entry(buf, addr, size); } err = fdt_finish_reservemap(buf); if (err < 0) return -1; /* * Obtains all props for later use because getting them from * FDT requires complicated manipulation. */ struct ufdt_node_dict all_props = ufdt_node_dict_construct(); err = output_ufdt_node_to_fdt(tree->root, buf, &all_props); if (err < 0) return -1; ufdt_node_dict_destruct(&all_props); err = fdt_finish(buf); if (err < 0) return -1; /* * IMPORTANT: fdt_totalsize(buf) might be less than buf_size * so this is needed to make use of remain spaces. */ return fdt_open_into(buf, buf, buf_size); }
28.301695
80
0.647982
9b85a575276ffce5d0ddf3695defc71cae133705
576
h
C
src/xrSound/stdafx.h
clayne/xray-16
32ebf81a252c7179e2824b2874f911a91e822ad1
[ "OML", "Linux-OpenIB" ]
2
2015-02-23T10:43:02.000Z
2015-06-11T14:45:08.000Z
src/xrSound/stdafx.h
clayne/xray-16
32ebf81a252c7179e2824b2874f911a91e822ad1
[ "OML", "Linux-OpenIB" ]
17
2022-01-25T08:58:23.000Z
2022-03-28T17:18:28.000Z
src/xrSound/stdafx.h
clayne/xray-16
32ebf81a252c7179e2824b2874f911a91e822ad1
[ "OML", "Linux-OpenIB" ]
1
2015-06-05T20:04:00.000Z
2015-06-05T20:04:00.000Z
#pragma once #include "Common/Common.hpp" #include "xrCore/xrCore.h" #include "xrCore/_std_extensions.h" #if defined(XR_PLATFORM_WINDOWS) // mmsystem.h #define MMNOSOUND #define MMNOMIDI #define MMNOAUX #define MMNOMIXER #define MMNOJOY #include <mmsystem.h> // mmreg.h #define NOMMIDS #define NONEWRIFF #define NOJPEGDIB #define NONEWIC #define NOBITMAP #include <mmreg.h> #endif #include <vorbis/codec.h> #include <vorbis/vorbisfile.h> #include "xrCDB/xrCDB.h" #include "Sound.h" #include "xrCore/xr_resource.h" #ifdef _EDITOR #include "utils/ETools/ETools.h" #endif
16
35
0.762153
4b030d7e2af29ff4c8d739ed2eebf9196d0457e5
2,272
h
C
Model/Partita.h
iota97/ugno
d0707cde2c11d0f60e0bd8e6cf1fb81be2a6f8d2
[ "MIT" ]
1
2021-07-02T12:17:36.000Z
2021-07-02T12:17:36.000Z
Model/Partita.h
iota97/ugno
d0707cde2c11d0f60e0bd8e6cf1fb81be2a6f8d2
[ "MIT" ]
null
null
null
Model/Partita.h
iota97/ugno
d0707cde2c11d0f60e0bd8e6cf1fb81be2a6f8d2
[ "MIT" ]
null
null
null
#ifndef PARTITA_H #define PARTITA_H #include "DeepPtr.h" #include "Giocatore.h" #include "GiocatoreCPU.h" #include <vector> // Classe partita, tutti i giocatori escluso il primo di indice 0 sono controllati dal computer class Partita { public: // Costruttore di default, da usare insieme alle funzioni per caricare una partita Partita(); // Costruttore a 2 parametri, numero di giocatori totali e carte in mano a ogni giocatore all'inizio Partita(int numGiocatori, int numCarteIniziali); // Distruttore virtual ~Partita(); // Giocata la carta di indice idCarta nella mano del giocatore umano, ritorna false se la carta non è giocabile // con quella correntemente sul tavolo virtual bool playerGiocaCarta(int idCarta); // Finisce il turno del giocatore umano, pesca automaticamente una carta se in questo turno non ha buttato alcuna carta virtual void playerFineTurno(); // Avanza di una mossa i giocatori controllati dal computer virtual void eseguiStepGiocatoreCPU(); // Getter publici virtual const Giocatore& getGiocatore(int id) const; virtual const Carta& getCartaSulTavolo() const; virtual int getNumeroGiocatori() const; virtual int getTurno() const; // Funzioni per ausiliari per carte effetto virtual void applicaCartaSulTavolo(); virtual void setTurno(int turno); virtual void pescaGiocatore(int id, int numCarte) const; virtual void aumentaTurniDaPassare(); virtual void avanzaTurni(int turni); // Funzione statica che genera una carta, al fine di pescare e per non permettere di contare le carte // si genera random una carta al posto di avere un mazzo static DeepPtr<Carta> generaCarta(); // Helper per caricare una partita e giocare le carte virtual void setCartaSulTavolo(const DeepPtr<Carta>& carta); virtual void aggiungiCartaAllaMano(const DeepPtr<Carta>& carta, int idGiocatore) const; virtual void aggiungiGiocatore(); // Eccezioni class turno_giocatore_non_controllato_dalla_cpu {}; class non_e_il_turno_del_giocatore {}; protected: // std::vector risulta piu' efficace della Lista dato che permette accesso casuale e il numero dei giocatori // rimane invariato durante la partita std::vector<Giocatore*> giocatori_; DeepPtr<Carta> cartaSulTavolo_; int turno_; int turniDaPassare_; }; #endif
33.411765
120
0.779489
188e9d82a9cabe87f9faa7db2801deb2e5432cb3
1,989
h
C
src/my402list.h
praneethys/token_bucket_emulation_in_C
5a80d306799278a12c5732f32ef21351bea855e4
[ "MIT" ]
null
null
null
src/my402list.h
praneethys/token_bucket_emulation_in_C
5a80d306799278a12c5732f32ef21351bea855e4
[ "MIT" ]
null
null
null
src/my402list.h
praneethys/token_bucket_emulation_in_C
5a80d306799278a12c5732f32ef21351bea855e4
[ "MIT" ]
null
null
null
/* * Author: William Chia-Wei Cheng (bill.cheng@acm.org) * * @(#)$Id: my402list.h,v 1.1 2012/12/24 23:18:19 william Exp $ */ #ifndef _MY402LIST_H_ #define _MY402LIST_H_ #include "cs402.h" typedef struct tagMy402ListElem { void *obj; struct tagMy402ListElem *next; struct tagMy402ListElem *prev; } My402ListElem; typedef struct tagMy402List { int num_members; My402ListElem anchor; /* You do not have to set these function pointers */ int (*Length)(struct tagMy402List *); int (*Empty)(struct tagMy402List *); int (*Append)(struct tagMy402List *, void*); int (*Prepend)(struct tagMy402List *, void*); void (*Unlink)(struct tagMy402List *, My402ListElem*); void (*UnlinkAll)(struct tagMy402List *); int (*InsertBefore)(struct tagMy402List *, void*, My402ListElem*); int (*InsertAfter)(struct tagMy402List *, void*, My402ListElem*); My402ListElem *(*First)(struct tagMy402List *); My402ListElem *(*Last)(struct tagMy402List *); My402ListElem *(*Next)(struct tagMy402List *, My402ListElem *cur); My402ListElem *(*Prev)(struct tagMy402List *, My402ListElem *cur); My402ListElem *(*Find)(struct tagMy402List *, void *obj); } My402List; extern int My402ListLength(My402List*); extern int My402ListEmpty(My402List*); extern int My402ListAppend(My402List*, void*); extern int My402ListPrepend(My402List*, void*); extern void My402ListUnlink(My402List*, My402ListElem*); extern void My402ListUnlinkAll(My402List*); extern int My402ListInsertAfter(My402List*, void*, My402ListElem*); extern int My402ListInsertBefore(My402List*, void*, My402ListElem*); extern My402ListElem *My402ListFirst(My402List*); extern My402ListElem *My402ListLast(My402List*); extern My402ListElem *My402ListNext(My402List*, My402ListElem*); extern My402ListElem *My402ListPrev(My402List*, My402ListElem*); extern My402ListElem *My402ListFind(My402List*, void*); extern int My402ListInit(My402List*); #endif /*_MY402LIST_H_*/
31.571429
70
0.733032
497c19f1ef4f49eb0aee18280e32e6601688c2bd
994
c
C
src/core/env/env_x11.c
TSAVideoGame/TSAVideoGame
022269c765f4ba991dc7ddc11f2da6be22f888be
[ "Zlib" ]
null
null
null
src/core/env/env_x11.c
TSAVideoGame/TSAVideoGame
022269c765f4ba991dc7ddc11f2da6be22f888be
[ "Zlib" ]
null
null
null
src/core/env/env_x11.c
TSAVideoGame/TSAVideoGame
022269c765f4ba991dc7ddc11f2da6be22f888be
[ "Zlib" ]
2
2021-08-20T23:04:42.000Z
2021-12-03T04:47:12.000Z
#include "env.h" #include "../logger/logger.h" int error_handler(Display *display, XErrorEvent *event) { char buff[512]; XGetErrorText(display, event->error_code, buff, 512); LOG(ERR, "GLX Error: %s\n", buff); return 0; } int JIN_env_init(struct JIN_Env *env) { XInitThreads(); if (!(env->x_display = XOpenDisplay(NULL))) { LOG(ERR, "Could not open a display (X11)\n"); return -1; } XSetErrorHandler(error_handler); env->screen_id = XDefaultScreen(env->x_display); env->gc = XDefaultGC(env->x_display, env->screen_id); env->font = XLoadQueryFont(env->x_display, "fixed"); XSetFont(env->x_display, env->gc, env->font->fid); env->border_pixel = XBlackPixel(env->x_display, env->screen_id); env->background_pixel = XWhitePixel(env->x_display, env->screen_id); env->wm_delete_window = XInternAtom(env->x_display, "WM_DELETE_WINDOW", False); return 0; } int JIN_env_quit(struct JIN_Env *env) { XCloseDisplay(env->x_display); return 0; }
23.666667
81
0.687123
9d04b39bc8e4dcead4421cdf89ec800031ec81c7
2,597
c
C
pyramid.c
haoyangw/cs1010_as01
bdbb870afcec71b351b4d6157a2a15f0717b5359
[ "CC0-1.0" ]
null
null
null
pyramid.c
haoyangw/cs1010_as01
bdbb870afcec71b351b4d6157a2a15f0717b5359
[ "CC0-1.0" ]
null
null
null
pyramid.c
haoyangw/cs1010_as01
bdbb870afcec71b351b4d6157a2a15f0717b5359
[ "CC0-1.0" ]
null
null
null
/** * CS1010 Semester 1 AY21/22 * Assignment 1: Pyramid * * Read in three positive integer corresponding to the width, * length, and height of a pyramid from the standard input, and * print the total surface area to the standard output. * * @file: pyramid.c * @author: Wang Haoyang (Group C08) */ #include "cs1010.h" #include <math.h> // Function declarations - see their definitions after main double hypotenuse_of(double leg1, double leg2); long area_of_rectangle(long width, long length); double area_of_triangle(double side1, double side2, double side3); int main() { // Obtain the width, length and height from user input long width = cs1010_read_long(); long length = cs1010_read_long(); long height = cs1010_read_long(); // Compute half of a diagonals of the rectangular base double half_diag = hypotenuse_of((double)width, (double)length) / 2; // Compute the isosceles side of the triangular faces double isosceles_side = hypotenuse_of(half_diag, (double)height); // Compute the sum of the triangular sides double sum_of_triag_sides = \ (2 * (area_of_triangle( \ (double)width, isosceles_side, isosceles_side))) + \ (2 * (area_of_triangle( \ (double)length, isosceles_side, isosceles_side))); // Compute area of rectangular base long base_area = area_of_rectangle(width, length); double surface_area = sum_of_triag_sides + base_area; cs1010_println_double(surface_area); } /** Computes the hypotenuse of a right angled triangle given * its legs * Input: leg1, leg2 are the lengths of sides adjacent to the * right angle * Output: Hypotenuse of the right angled triangle **/ double hypotenuse_of(double leg1, double leg2) { double hypotenuse_squared = (leg1 * leg1) + (leg2 * leg2); return sqrt(hypotenuse_squared); } /** Computes the area of a rectangle with given width and length * Input: width, length of said rectangle * Output: Area of said rectangle **/ long area_of_rectangle(long width, long length) { return width * length; } /** Computes the area of a triangle given the length of its 3 sides * Input: side1, side2, side3 the sides of said triangle * Output: Area of said triangle **/ double area_of_triangle(double side1, double side2, double side3) { // First we compute half of the perimeter, half_perim double half_perim = (side1 + side2 + side3) / 2.0; // Heron's formula double area = \ sqrt(half_perim * (half_perim - side1) * \ (half_perim - side2) * (half_perim - side3)); return area; }
35.094595
71
0.700424
6fc51c7570a58f38c5540e5e384c8d587103dd64
9,172
h
C
include/simd/asimd_d.h
eruffaldi/cppPos
d8e8af5215f45658bdafff385d0062ee212ecc3b
[ "BSD-3-Clause" ]
31
2018-07-04T08:45:18.000Z
2022-02-12T11:16:34.000Z
include/simd/asimd_d.h
eruffaldi/cppposit
d8e8af5215f45658bdafff385d0062ee212ecc3b
[ "BSD-3-Clause" ]
2
2018-10-28T12:00:41.000Z
2020-02-11T18:35:52.000Z
include/simd/asimd_d.h
eruffaldi/cppPosit
d8e8af5215f45658bdafff385d0062ee212ecc3b
[ "BSD-3-Clause" ]
2
2018-02-01T14:34:37.000Z
2018-06-22T18:07:11.000Z
/** * Copyright (C) 2017-2019 Emanuele Ruffaldi * Distributed under the terms of the BSD 3-Clause License. * * (See accompanying file LICENSE) * * -- */ /** * Requires: AVX2, allows for AVX512F * - missing: 64bit integer, unsigned integers except uint8 - AVX2: double 4, float/int32 8, int16 16, int8 32 * 128bit for f: 2 => int32 simd_i32_4 low => probably better using regular SSE * 256bit for f: 4 => int32 simd_i32_4 * 512bit for f: 8 => int32 simd_i32_8 */ #pragma once #include "asimd_base.h" // TODO: replace AVX2 _mm_i32gather_pd with something when AVX2 is missing #ifdef __AVX2__ class simd_d_2 { public: typedef double type; typedef __m128d simdtype; typedef simd_i32_4 indextype; typedef WithGather gathermode; typedef simd_d_2 self; typedef self cmpresult; enum { csize = 2 }; inline simd_d_2() {} inline simd_d_2(type v) : x(_mm_set1_pd(v)) {} inline simd_d_2(simdtype d) : x(d) {} inline simd_d_2(type v1, type v2) : x(_mm_setr_pd(v1,v2)) {} inline void load(const type * ptr) { x = _mm_loadu_pd((const type*)ptr); } inline void store(type * ptr) const { _mm_storeu_pd((type*)ptr,x); } inline self max(self & y) const { return self(_mm_max_pd(x,y.x)); } inline cmpresult cmplt(self & y) const { return cmpresult(_mm_cmplt_pd(x,y.x)); } inline void gather(const type * ptr, indextype idx) { x = _mm_i32gather_pd(ptr, idx.x, 1); } inline unsigned int size() const { return csize; } inline type operator[] (unsigned int idx) const { type temp[csize]; store(temp); return temp[idx]; } void initincrement(type x) { type a[csize]; for(int i = 0; i < csize; i++) a[i] = i*x; load(a); } inline void blend(self & other, self mask) { x = _mm_blendv_pd(x,other.x,mask.x); } static inline void blendindex(indextype & oindex, indextype other, self mask) { // compare generates: AABB with each letter 32bit // shuffle: AABB => ABAB // use low part as in simd_i32_4 // // mm_shuffle_epi32: (0)|(2)<<2|(0)<<4|(2)<<6 oindex.x = _mm_blendv_ps(oindex.x,other.x,_mm_shuffle_epi32(mask.x,0x44)); } simdtype x; }; #endif #ifdef __AVX2__ class simd_d_4 { public: typedef double type; typedef __m256d simdtype; typedef simd_i32_4 indextype; typedef WithGather gathermode; typedef simd_d_4 self; typedef self cmpresult; enum { csize = 4 }; inline simd_d_4() {} inline simd_d_4(type v) : x(_mm256_set1_pd(v)) {} inline simd_d_4(simdtype d) : x(d) {} inline void load(const type * ptr) { x = _mm256_loadu_pd((const type*)ptr); } inline void store(type * ptr) const { _mm256_storeu_pd((type*)ptr,x); } inline self max(self & y) const { return self(_mm256_max_pd(x,y.x)); } inline cmpresult cmplt(simd_d_4 & y) const { return cmpresult(_mm256_cmp_pd(x,y.x, 1 /* LT_OS */)); } inline void gather(const type * ptr, indextype idx) { x = _mm256_i32gather_pd(ptr, idx.x, 1); } inline unsigned int size() const { return csize; } inline void blend(self & other, self mask) { x = _mm256_blendv_pd(x,other.x,mask.x); } inline type operator[] (unsigned int idx) const { type temp[csize]; store(temp); return temp[idx]; } void initincrement(type x) { type a[csize]; for(int i = 0; i < csize; i++) a[i] = i*x; load(a); } static inline void blendindex(indextype & oindex, indextype other, self mask) { // input: AA BB CC DD with each letter 32bit as of cmp // AA BB CC DD => ABCD ABCD (0 2 4 6 0 2 4 6) work in mm128 // permute and shuffle work by 128bit lane => _mm256_permutevar8x32_epi32 is generic and uses indices as bits // then _mm256_castsi256_si128 to take lower part __m128i newmask = _mm256_castsi256_si128(_mm256_permutevar8x32_epi32(mask.x,_mm256_setr_epi32(0,2,4,6,0,2,4,6))); oindex.x = _mm_blendv_ps(oindex.x,other.x,newmask); } simdtype x; }; #endif #ifdef WITH_AVX512F class simd_d_8 { public: typedef double type; typedef __m512d simdtype; typedef simd_i32_8 indextype; typedef WithGather gathermode; typedef simd_d_8 self; typedef __mmask8 cmpresult; enum { csize = 8 }; inline simd_d_8() {} inline simd_d_8(type v) : x(_mm512_set1_pd(v)) {} inline simd_d_8(simdtype d) : x(d) {} inline void load(const type * ptr) { x = _mm512_loadu_pd((const type*)ptr); } inline void store(type * ptr) const { _mm512_storeu_pd((type*)ptr,x); } inline self max(self & y) const { return self(_mm512_max_pd(x,y.x)); } inline cmpresult cmplt(self & y) const { return _mm512_cmp_pd_mask(x,y.x, 1 /* LT_OS */); } inline void gather(const type * ptr, indextype idx) { x = _mm512_i32gather_pd(idx.x,ptr, 1); } inline unsigned int size() const { return csize; } inline void blend(self & other, cmpresult mask) { x = _mm512_mask_blend_pd(mask, x, other.x); } inline type operator[] (unsigned int idx) const { type temp[csize]; store(temp); return temp[idx]; } void initincrement(type x) { type a[csize]; for(int i = 0; i < csize; i++) a[i] = i*x; load(a); } static inline void blendindex(indextype & oindex, indextype other, cmpresult mask) { // much much easier because __mmask8 is trivial and we can work as in simd_i32_8 oindex.x = _mm256_mask_blend_epi32(mask, oindex.x,other.x); } simdtype x; }; #endif #ifdef __AVX2__ /** * Array */ template <int N> class simd_d_4_a { public: typedef double type; typedef __m256d basesimdtype; typedef __m256d simdtype[N]; typedef simd_i32_8_a<N> indextype; // could be N/2 typedef simd_d_4_a self; enum { csize = 4*N }; enum { isize = 4 }; typedef WithGather gathermode; simd_d_4_a() {} simd_d_4_a(int K) { x[0] = _mm256_set1_pd(K); for(int i = 1; i < N; i++) x[i] = x[0]; } inline void load(const type * ptr) { for(int i = 0; i < N; i++, ptr += isize) x[i] = _mm256_loadu_si256((const __m256i*)ptr); } inline void store(type * ptr) const { for(int i = 0; i < N; i++, ptr += isize) _mm256_storeu_si256((basesimdtype*)ptr,x[i]); } inline unsigned int size() const { return csize; } self & operator += (const self & o) { for(int i = 0; i < N; i++) x[i] = _mm256_add_pd(x[i],o.x[i]); return *this; } void initincrement(type x) { type a[csize]; for(int i = 0; i < csize; i++) a[i] = i*x; load(a); } inline self max(self & y) const { simd_d_4_a r; for(int i = 0; i < N; i++) r.x[i] = simd_d_4(_mm256_max_pd(x[i],y.x[i])); } inline self cmplt(self & y) const { simd_d_4_a r; for(int i = 0; i < N; i++) r.x[i] = simd_d_4(_mm256_cmp_pd(x[i],y.x[i], 1 /* LT_OS */)); } /* inline type operator[] (unsigned int idx) const { type temp[csize]; store(temp); return temp[idx]; } */ inline void blend(self & other, self mask) { for(int i = 0; i < N; i++) x[i] = _mm256_blendv_pd(x[i],other.x[i],mask.x[i]); } static void blendindex(indextype & oindex, indextype other, self mask) { __m256 mm = _mm256_setr_epi32(0,2,4,6,0,2,4,6); for(int i = 0; i < csize; i++) { __m128i newmask = _mm256_castsi256_si128(_mm256_permutevar8x32_epi32(mask.x[i],mm)); oindex.x[i] = _mm_blendv_ps(oindex.x[i],other.x[i],newmask); } } inline void gather(const type * ptr, indextype idx) { simd_d_4 tmp; for(int i = 0; i < N; i++, ptr += isize) { tmp.gather(ptr,idx.x[i]); x[i] = tmp.x; } } simdtype x; }; #endif #ifdef __AVX2__ DECLAREOSTREAM(simd_d_2,"d_2") DECLAREOSTREAM(simd_d_4,"d_4") #endif #ifdef WITH_AVX512F DECLAREOSTREAM(simd_d_8,"d_8") #endif #ifdef __AVX2__ #ifdef WITH_AVX512F template <int n> struct simdgenn<double,n> { using type = typename std::conditional<n <= 2, simd_d_2, typename std::conditional<n <= 4, simd_d_4, simd_d_8>::type >::type; typedef SimdMode simdmarker; }; template <> struct simdgen<double> { //typedef simd_d_4_a<2> type; typedef simd_d_8 type; typedef SimdMode simdmarker; }; #else // picks using n: favor larger template <int n> struct simdgenn<double,n> { using type = typename std::conditional<n <= 2, simd_d_2, simd_d_4>::type; typedef SimdMode simdmarker; }; template <> struct simdgen<double> { //typedef simd_d_4_a<2> type; typedef simd_d_4 type; typedef SimdMode simdmarker; }; #endif #endif
25.060109
129
0.592019
8d3c6b270f22e35b2e8239e5d8b069a66b42730d
3,872
c
C
usr/vmkitmon/pci.c
lambdaxymox/barrelfish
06a9f54721a8d96874a8939d8973178a562c342f
[ "MIT" ]
111
2015-02-03T02:57:27.000Z
2022-03-01T23:57:09.000Z
usr/vmkitmon/pci.c
lambdaxymox/barrelfish
06a9f54721a8d96874a8939d8973178a562c342f
[ "MIT" ]
12
2016-03-22T14:44:32.000Z
2020-03-18T13:30:29.000Z
usr/vmkitmon/pci.c
lambdaxymox/barrelfish
06a9f54721a8d96874a8939d8973178a562c342f
[ "MIT" ]
55
2015-02-03T05:28:12.000Z
2022-03-31T05:00:03.000Z
/** * \file PCI bus * * Virtual PCI bus implementation. */ /* * Copyright (c) 2009, ETH Zurich. * All rights reserved. * * This file is distributed under the terms in the attached LICENSE file. * If you do not find this file, copies can be found by writing to: * ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group. */ #include <stdlib.h> #include <stdio.h> #include "vmkitmon.h" #include "pci.h" #include "pci_devices.h" #define INVALID 0xffffffff int pci_handle_pio_write(struct pci *pci, uint16_t port, enum opsize size, uint32_t val) { assert(pci != NULL); switch(port) { case 0xcf8: // PCI config address port VMKIT_PCI_DEBUG("wrote %x to 0xcf8\n", val); if(size == OPSIZE_32) { pci->address.raw = val; } else { VMKIT_PCI_DEBUG("ignoring write (not 32bit opsize)\n"); } break; case 0xcfc: // PCI config data port case 0xcfd: case 0xcfe: case 0xcff: if(port != 0xcfc) { printf("!!!!!!!!!!!!!!!!! Unaligned write !!!!!!!!!!!!!!!\n"); } VMKIT_PCI_DEBUG("wrote 0x%x to address:0x%x (port:0x%x)\n", val, pci->address.raw, port); { int busnr = pci->address.d.bus_nr; int device = pci->address.d.dev_nr; struct pci_bus *bus = pci->bus[busnr]; if(bus == NULL) { break; } struct pci_device *dev = bus->device[device]; if(dev != NULL) { dev->confspace_write(dev, pci->address, size, val); } } break; default: VMKIT_PCI_DEBUG("write to invalid port\n"); break; } return 0; } int pci_handle_pio_read(struct pci *pci, uint16_t port, enum opsize size, uint32_t *val) { assert(pci != NULL); VMKIT_PCI_DEBUG("pio_read: port:0x%x\n", port); switch(port) { case 0xcf8: // PCI config address port *val = pci->address.raw; VMKIT_PCI_DEBUG("read from 0xcf8: %x\n", *val); break; case 0xcfc: // PCI config data port case 0xcfd: case 0xcfe: case 0xcff: { VMKIT_PCI_DEBUG("confspace read: busnr=%d, devicenum=%d\n", pci->address.d.bus_nr, pci->address.d.dev_nr); int busnr = pci->address.d.bus_nr; int device = pci->address.d.dev_nr; struct pci_bus *bus = pci->bus[busnr]; if(bus == NULL) { *val = INVALID; break; } struct pci_device *dev = bus->device[device]; if(dev != NULL) { dev->confspace_read(dev, pci->address, size, val); } else { *val = INVALID; } } // Shift on unaligned read (masking is done later) *val >>= (port - 0xcfc) * 8; VMKIT_PCI_DEBUG("read %x from 0x%x\n", *val, port); break; default: VMKIT_PCI_DEBUG("read from invalid port\n"); break; } return 0; } static struct pci_bus *pci_new_bus(void) { struct pci_bus *bus = calloc(1, sizeof(struct pci_bus)); return bus; } struct pci *pci_new(void) { struct pci *pci = calloc(1, sizeof(struct pci)); pci->bus[0] = pci_new_bus(); // Put a host-bridge on the bus (Linux expects to find one) struct pci_device *bridge = pci_hostbridge_new(); pci_attach_device(pci, 0, 0, bridge); return pci; } int pci_attach_device(struct pci *pci, uint8_t busnr, uint8_t devnr, struct pci_device *device) { struct pci_bus *bus = pci->bus[busnr]; if(bus == NULL) { return -1; } if(bus->device[devnr] != NULL) { return -2; } bus->device[devnr] = device; return 0; }
24.049689
115
0.541581
02424e74a23af8e0e0698a01e10a85c87ca01d8e
59
h
C
abscommon/abscommon/targetver.h
pablokawan/ABx
064d6df265c48c667ce81b0a83f84e5e22a7ff53
[ "MIT" ]
null
null
null
abscommon/abscommon/targetver.h
pablokawan/ABx
064d6df265c48c667ce81b0a83f84e5e22a7ff53
[ "MIT" ]
null
null
null
abscommon/abscommon/targetver.h
pablokawan/ABx
064d6df265c48c667ce81b0a83f84e5e22a7ff53
[ "MIT" ]
null
null
null
#pragma once #ifdef _MSC_VER #include <SDKDDKVer.h> #endif
11.8
22
0.762712
77e252439149507f099d4057076f92b50e2a12d1
1,375
h
C
sources/Renderer/OpenGL/Buffer/GL2XVertexArray.h
beldenfox/LLGL
3a54125ebfa79bb06fccf8c413d308ff22186b52
[ "BSD-3-Clause" ]
1,403
2016-09-28T21:48:07.000Z
2022-03-31T23:58:57.000Z
sources/Renderer/OpenGL/Buffer/GL2XVertexArray.h
beldenfox/LLGL
3a54125ebfa79bb06fccf8c413d308ff22186b52
[ "BSD-3-Clause" ]
70
2016-10-13T20:15:58.000Z
2022-01-12T23:51:12.000Z
sources/Renderer/OpenGL/Buffer/GL2XVertexArray.h
beldenfox/LLGL
3a54125ebfa79bb06fccf8c413d308ff22186b52
[ "BSD-3-Clause" ]
122
2016-10-23T15:33:44.000Z
2022-03-07T07:41:23.000Z
/* * GL2XVertexArray.h * * This file is part of the "LLGL" project (Copyright (c) 2015-2019 by Lukas Hermanns) * See "LICENSE.txt" for license information. */ #ifndef LLGL_GL2X_VERTEX_ARRAY_H #define LLGL_GL2X_VERTEX_ARRAY_H #include <LLGL/VertexAttribute.h> #include "../OpenGL.h" #include <vector> namespace LLGL { class GLStateManager; // This class emulates the Vertex-Array-Object (VAO) functionality, for GL 2.x. class GL2XVertexArray { public: // Builds the specified attribute using a 'glVertexAttrib*Pointer' function. void BuildVertexAttribute(GLuint bufferID, const VertexAttribute& attribute); // Finalizes building vertex attributes. void Finalize(); // Binds this vertex array. void Bind(GLStateManager& stateMngr) const; private: struct GL2XVertexAttrib { GLuint buffer; GLuint index; GLint size; GLenum type; GLboolean normalized; GLsizei stride; const GLvoid* pointer; }; private: std::vector<GL2XVertexAttrib> attribs_; GLuint attribIndexEnd_ = 0; }; } // /namespace LLGL #endif // ================================================================================
20.522388
86
0.564364
e29a2d990d57380800db83ae0f55987c45dc4f7e
759
h
C
src/op.h
kcomas/multarum
6f995023ac8a2482e7e5bc67776599d64e1a28f7
[ "MIT" ]
1
2018-11-27T13:37:05.000Z
2018-11-27T13:37:05.000Z
src/op.h
kcomas/multarum
6f995023ac8a2482e7e5bc67776599d64e1a28f7
[ "MIT" ]
1
2018-12-09T04:36:50.000Z
2018-12-09T21:20:19.000Z
src/op.h
kcomas/multarum
6f995023ac8a2482e7e5bc67776599d64e1a28f7
[ "MIT" ]
null
null
null
#ifndef MT_OP_H #define MT_OP_H #include "common.h" #include "mod.h" typedef enum { mt_pfx(NOP), mt_pfx(AL), mt_pfx(PUSH), mt_pfx(IBUF), mt_pfx(ISTR), mt_pfx(IHASH), mt_pfx(PHASH), mt_pfx(MUL), mt_pfx(REM), mt_pfx(DIV), mt_pfx(ADD), mt_pfx(SUB), mt_pfx(EQ), mt_pfx(OR), mt_pfx(JMP), mt_pfx(JMPF), mt_pfx(LD_SELF), mt_pfx(LD_FN), mt_pfx(LD_ARG), mt_pfx(SV_ARG), mt_pfx(LD_LOCAL), mt_pfx(SV_LOCAL), mt_pfx(CALL), mt_pfx(CALL_SELF), mt_pfx(RET), mt_pfx(WRITE), mt_pfx(HALT), } mt_op; #define mt_write_jmp(mod, type, mt_jmp) \ mt_write_byte(mod, type); \ mt_write_bytes(mod, mt_jmp, sizeof(uint32_t)) const char* mt_op_str(mt_op op); #endif
16.866667
49
0.612648
85e46c626b9539553bdad80433cd2267471123ad
3,069
h
C
play/Camera.h
tay10r/game
0d0770f406b6260298981ab46886bb3daa6af9e9
[ "MIT" ]
null
null
null
play/Camera.h
tay10r/game
0d0770f406b6260298981ab46886bb3daa6af9e9
[ "MIT" ]
19
2020-03-02T21:39:53.000Z
2020-06-03T14:12:45.000Z
play/Camera.h
tay10r/game
0d0770f406b6260298981ab46886bb3daa6af9e9
[ "MIT" ]
4
2020-03-06T04:59:44.000Z
2020-04-18T15:42:16.000Z
#pragma once #include "Constants.h" #include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> #include <chrono> #include <optional> #include <vector> template<typename Float> class Camera final { public: using mat3 = glm::tmat3x3<Float>; using mat4 = glm::tmat4x4<Float>; using vec2 = glm::tvec2<Float>; using vec3 = glm::tvec3<Float>; using vec4 = glm::tvec4<Float>; Float verticalFov() const noexcept { return m_verticalFov; } Float aspectRatio() const noexcept { return m_aspect; } Float near() const noexcept { return m_near; } Float far() const noexcept { return m_far; } void setAspectRatio(Float aspect) { m_aspect = aspect; } void setVerticalFov(Float fov) { m_verticalFov = fov; } void setNearPlane(Float near) { m_near = near; } void setFarPlane(Float far) { m_far = far; } mat4 perspective() const noexcept { return glm::perspective(m_verticalFov, m_aspect, m_near, m_far); } vec3 position() const { return m_position; } vec3 up() const; vec3 forward() const; vec3 right() const; mat4 worldToCameraMatrix() const; mat3 worldToCameraRotation() const; mat4 cameraToWorldMatrix() const; mat3 cameraToWorldRotation() const; void applyMouseMotion(vec2 motion); void applyRelativeMove(vec3 relativeMove); private: static vec3 sphericalToXYZ(Float pitch, Float yaw) { const Float x = std::cos(yaw) * std::sin(pitch); const Float y = std::sin(yaw) * std::sin(pitch); const Float z = std::cos(pitch); return vec3(y, z, -x); } private: Float m_moveSpeed = 1; vec2 m_rotationSpeed = vec2(0.01 / Pi<Float>::value(), 0.01 / Pi<Float>::value()); Float m_pitch = Pi<Float>::value() / 2; Float m_yaw = 0; vec3 m_position = vec3(0, 0, 0); Float m_aspect = Float(1); Float m_verticalFov = glm::radians(Float(45)); Float m_near = Float(0.1); Float m_far = Float(1000); }; template<typename Float> glm::tvec3<Float> Camera<Float>::forward() const { return sphericalToXYZ(m_pitch, m_yaw); } template<typename Float> glm::tvec3<Float> Camera<Float>::up() const { return sphericalToXYZ(m_pitch - (Pi<Float>::value() / 2), m_yaw); } template<typename Float> glm::tvec3<Float> Camera<Float>::right() const { return glm::normalize(glm::cross(forward(), up())); } template<typename Float> glm::tmat4x4<Float> Camera<Float>::worldToCameraMatrix() const { return glm::lookAt(m_position, m_position + forward(), vec3(0, 1, 0)); } template<typename Float> glm::tmat3x3<Float> Camera<Float>::worldToCameraRotation() const { return glm::mat3(right(), up(), forward()); } template<typename Float> void Camera<Float>::applyMouseMotion(vec2 motion) { const Float pitchDelta = motion.y * m_rotationSpeed.y; const Float yawDelta = motion.x * m_rotationSpeed.x; m_pitch += pitchDelta; m_yaw += yawDelta; const Float epsilon = 0.000001; m_pitch = std::max(std::min(m_pitch, Pi<Float>::value() - epsilon), epsilon); } template<typename Float> void Camera<Float>::applyRelativeMove(vec3 relativeMove) { m_position += relativeMove; }
20.190789
104
0.693385
3ea72a9397648ca84edfea93b174b1ec84f02d50
5,990
h
C
src/Gdv/GdvPipeline.h
mdk/diva
f58841d8b539d925a95d78d33427b61a2665ff33
[ "MIT" ]
2
2015-01-10T16:09:40.000Z
2016-05-09T01:58:17.000Z
src/Gdv/GdvPipeline.h
mdk/diva
f58841d8b539d925a95d78d33427b61a2665ff33
[ "MIT" ]
null
null
null
src/Gdv/GdvPipeline.h
mdk/diva
f58841d8b539d925a95d78d33427b61a2665ff33
[ "MIT" ]
null
null
null
//////////////////////////////////////////////////////////////////////////////// // // // MIT X11 license, Copyright (c) 2005-2006 by: // // // // Authors: // // Michael Dominic K. <michaldominik@gmail.com> // // // // Permission is hereby granted, free of charge, to any person obtaining a // // copy of this software and associated documentation files (the "Software"), // // to deal in the Software without restriction, including without limitation // // the rights to use, copy, modify, merge, publish, distribute, sublicense, // // and/or sell copies of the Software, and to permit persons to whom the // // Software is furnished to do so, subject to the following conditions: // // // // The above copyright notice and this permission notice shall be included // // in all copies or substantial portions of the Software. // // // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // // USE OR OTHER DEALINGS IN THE SOFTWARE. // // // //////////////////////////////////////////////////////////////////////////////// #ifndef __GDVPIPELINE_H__ #define __GDVPIPELINE_H__ #include <gst/gst.h> #include <gst/interfaces/xoverlay.h> #include <gtk/gtk.h> #include <gdk/gdkx.h> #include "GdvVideoCompSink.h" #include "GdvAudioCompSink.h" #include "GdvTime.h" #include "GdvTrack.h" #include "GdvConst.h" #include "GdvTypes.h" #include "GdvProjectFormat.h" #include "GdvSource.h" #include "GdvSingleViewBin.h" #include "GdvTwinViewBin.h" #include "GdvExporter.h" typedef struct _GdvPipelinePrivate GdvPipelinePrivate; struct _GdvPipeline { GstPipeline Parent; GdvPipelinePrivate *Private; }; struct _GdvPipelineClass { GstPipelineClass ParentClass; }; enum _GdvPipelineState { GDV_PIPELINE_STATE_UNKNOWN, GDV_PIPELINE_STATE_PAUSED, GDV_PIPELINE_STATE_PLAYING } typedef GdvPipelineState; enum _GdvPipelineMode { GDV_PIPELINE_MODE_NORMAL, GDV_PIPELINE_MODE_SINGLE, GDV_PIPELINE_MODE_TWIN, GDV_PIPELINE_MODE_EXPORT, } typedef GdvPipelineMode; GType gdv_pipeline_get_type (void); GdvPipeline* gdv_pipeline_new (GdvProjectFormat *format); void gdv_pipeline_set_target_window (GdvPipeline *this, GdkWindow *window); void gdv_pipeline_launch (GdvPipeline *this); void gdv_pipeline_shutdown (GdvPipeline *this); void gdv_pipeline_play (GdvPipeline *this); void gdv_pipeline_pause (GdvPipeline *this); void gdv_pipeline_playpause (GdvPipeline *this); void gdv_pipeline_force_expose (GdvPipeline *this); void gdv_pipeline_set_error_idle_func (GdvPipeline *this, gpointer func); void gdv_pipeline_set_state_idle_func (GdvPipeline *this, gpointer func); void gdv_pipeline_set_ticker_idle_func (GdvPipeline *this, gpointer func); void gdv_pipeline_remove_error_idle_func (GdvPipeline *this); void gdv_pipeline_remove_state_idle_func (GdvPipeline *this); void gdv_pipeline_remove_ticker_idle_func (GdvPipeline *this); gboolean gdv_pipeline_add_track (GdvPipeline *this, GdvTrack *track); void gdv_pipeline_remove_track (GdvPipeline *this, GdvTrack *track); void gdv_pipeline_seek (GdvPipeline *this, GdvTime seektime); void gdv_pipeline_ready (GdvPipeline *this); gboolean gdv_pipeline_start_single_view (GdvPipeline *this, GdvSource *source, GdvTime time); gboolean gdv_pipeline_seek_single_view (GdvPipeline *this, GdvTime time); gboolean gdv_pipeline_stop_single_view (GdvPipeline *this); gboolean gdv_pipeline_start_twin_view (GdvPipeline *this, GdvSource *source1, GdvSource *source2, GdvTime time1, GdvTime time2); gboolean gdv_pipeline_seek_twin_view (GdvPipeline *this, GdvTime time1, GdvTime time2); gboolean gdv_pipeline_stop_twin_view (GdvPipeline *this); gboolean gdv_pipeline_start_exporting (GdvPipeline *this, GdvExporter *exporter); gboolean gdv_pipeline_stop_exporting (GdvPipeline *this); gboolean gdv_pipeline_save_last_buffer (GdvPipeline *this, gchar *filename); #endif
44.37037
110
0.534891
e963fbc1c73bf3de0cd7e94ba3389d0e188ac953
2,720
h
C
src/solvers/refinement/refined_string_type.h
romainbrenguier/cbmc
2cd5def9ffcbb3a0be386823ad33e099a47378d4
[ "BSD-4-Clause" ]
null
null
null
src/solvers/refinement/refined_string_type.h
romainbrenguier/cbmc
2cd5def9ffcbb3a0be386823ad33e099a47378d4
[ "BSD-4-Clause" ]
6
2017-12-03T22:02:14.000Z
2018-04-10T09:42:20.000Z
src/solvers/refinement/refined_string_type.h
romainbrenguier/cbmc
2cd5def9ffcbb3a0be386823ad33e099a47378d4
[ "BSD-4-Clause" ]
null
null
null
/** -*- C++ -*- *****************************************************\ Module: Type for string expressions used by the string solver. These string expressions contains a field `length`, of type `index_type`, a field `content` of type `content_type`. This module also defines function to recognise the C and java string types. Author: Romain Brenguier, romain.brenguier@diffblue.com \*******************************************************************/ #ifndef CPROVER_SOLVERS_REFINEMENT_REFINED_STRING_TYPE_H #define CPROVER_SOLVERS_REFINEMENT_REFINED_STRING_TYPE_H #include <util/std_types.h> #include <util/std_expr.h> #include <util/arith_tools.h> #define STRING_SOLVER_INDEX_WIDTH 32 #define STRING_SOLVER_C_CHAR_WIDTH 8 #define STRING_SOLVER_JAVA_CHAR_WIDTH 16 // Internal type used for string refinement class refined_string_typet: public struct_typet { public: explicit refined_string_typet(unsignedbv_typet char_type); // Type for the content (list of characters) of a string inline array_typet get_content_type() { return to_array_type((to_struct_type(*this)).components()[1].type());} // Types used in this refinement static inline unsignedbv_typet char_type() { return unsignedbv_typet(STRING_SOLVER_C_CHAR_WIDTH); } static inline unsignedbv_typet java_char_type() { return unsignedbv_typet(STRING_SOLVER_JAVA_CHAR_WIDTH);} static inline signedbv_typet index_type() { return signedbv_typet(STRING_SOLVER_INDEX_WIDTH);} static inline exprt index_zero() { return constant_exprt(integer2binary(0, STRING_SOLVER_INDEX_WIDTH), index_type()); } // For C the unrefined string type is __CPROVER_string, for java it is a // pointer to a strict with tag java.lang.String static bool is_c_string_type(const typet & type); static bool is_java_string_pointer_type(const typet & type); static bool is_java_string_type(const typet & type); static bool is_java_string_builder_type(const typet & type); static bool is_java_char_sequence_type(const typet & type); static inline unsignedbv_typet get_char_type(const exprt & expr) { if(is_c_string_type(expr.type())) return char_type(); else return java_char_type(); } static inline bool is_unrefined_string_type(const typet & type) { return (is_c_string_type(type) || is_java_string_pointer_type(type) || is_java_string_builder_type(type) || is_java_char_sequence_type(type)); } static inline bool is_unrefined_string(const exprt & expr) { return (is_unrefined_string_type(expr.type())); } static inline constant_exprt index_of_int(int i) { return from_integer(i, index_type()); } }; #endif
30.909091
74
0.718015
6a6e63a746619dab03b9146271513629b483e78d
740
h
C
cupy_backends/hip/cupy_roctx.h
prkhrsrvstv1/cupy
ea86c8225b575af9d2855fb77a306cf86fd098ea
[ "MIT" ]
6,180
2016-11-01T14:22:30.000Z
2022-03-31T08:39:20.000Z
cupy_backends/hip/cupy_roctx.h
prkhrsrvstv1/cupy
ea86c8225b575af9d2855fb77a306cf86fd098ea
[ "MIT" ]
6,281
2016-12-22T07:42:31.000Z
2022-03-31T19:57:02.000Z
cupy_backends/hip/cupy_roctx.h
prkhrsrvstv1/cupy
ea86c8225b575af9d2855fb77a306cf86fd098ea
[ "MIT" ]
829
2017-02-23T05:46:12.000Z
2022-03-27T17:40:03.000Z
#ifndef INCLUDE_GUARD_HIP_CUPY_ROCTX_H #define INCLUDE_GUARD_HIP_CUPY_ROCTX_H #ifndef CUPY_NO_NVTX #include <roctx.h> #endif // #ifndef CUPY_NO_NVTX // this is to ensure we use non-"Ex" APIs like roctxMarkA etc #define NVTX_VERSION (100 * ROCTX_VERSION_MAJOR + 10 * ROCTX_VERSION_MINOR) extern "C" { /////////////////////////////////////////////////////////////////////////////// // roctx /////////////////////////////////////////////////////////////////////////////// void nvtxMarkA(const char* message) { roctxMarkA(message); } int nvtxRangePushA(const char* message) { return roctxRangePushA(message); } int nvtxRangePop() { return roctxRangePop(); } } // extern "C" #endif // #ifndef INCLUDE_GUARD_HIP_CUPY_ROCTX_H
23.125
79
0.585135
fed3d38357d4fab3dec3158fce19fc23e45a675a
718
h
C
Util/QtUtil.h
yoann01/FabricUI
d4d24f25245b8ccd2d206aded2b6c5f2aca09155
[ "BSD-3-Clause" ]
null
null
null
Util/QtUtil.h
yoann01/FabricUI
d4d24f25245b8ccd2d206aded2b6c5f2aca09155
[ "BSD-3-Clause" ]
null
null
null
Util/QtUtil.h
yoann01/FabricUI
d4d24f25245b8ccd2d206aded2b6c5f2aca09155
[ "BSD-3-Clause" ]
null
null
null
// // Copyright (c) 2010-2017 Fabric Software Inc. All rights reserved. // #ifndef __UI_QT_UTIL__ #define __UI_QT_UTIL__ #include <QString> #include <QGLWidget> #include <QMainWindow> #include <QDockWidget> namespace FabricUI { namespace Util { class QtUtil { /** */ public: static QMainWindow* getMainWindow(); static QGLWidget* getQGLWidget( QString widgetName = "" ); static QDockWidget* getDockWidget( QString dockName = "" ); template <class T> static T* getQWidget( QString widgetName = "") { return getMainWindow()->findChild<T*>( widgetName ); } }; } // namespace FabricUI } // namespace Util #endif // __UI_QT_UTIL__
16.318182
68
0.640669
3893fb30929324a9bdf3e063e16e35412312bbc9
475
c
C
homework/w3/3-7.c
gly11/C-Learn
26c89713890d96c7f3523440dab6368472e32096
[ "MIT" ]
null
null
null
homework/w3/3-7.c
gly11/C-Learn
26c89713890d96c7f3523440dab6368472e32096
[ "MIT" ]
null
null
null
homework/w3/3-7.c
gly11/C-Learn
26c89713890d96c7f3523440dab6368472e32096
[ "MIT" ]
null
null
null
# include <stdio.h> // # include <math.h> // 使用math.h以获得更精确的pi值 # define M_PI 3.14 // 这里的M_PI与math.h中的常量同名 int main() { double r = 1.5, h = 3.0; double c, s, S, V, v; scanf("%lf %lf", &r, &h); c = M_PI*2*r; s = M_PI*r*r; S = M_PI*4*r*r; V = M_PI*4*r*r*r/3; v = s*h; // printf("%lf\n", M_PI); // 检查使用的pi值 printf("圆周长:%.2lf\n圆面积:%.2lf\n圆球表面积:%.2lf\n圆球体积:%.2lf\n圆柱体积:%.2lf\n", c, s, S, V, v); return 0; } // 本文件已通过清览题库在线测试
23.75
89
0.509474
df01401fde7adc89b0a317f5c51e0f35be658fd9
107
h
C
wgseruntime/include/opcodes.h
Amorph/wgs
781a2ed9fe10747d9501cc18bb3319641a6d561a
[ "Unlicense" ]
null
null
null
wgseruntime/include/opcodes.h
Amorph/wgs
781a2ed9fe10747d9501cc18bb3319641a6d561a
[ "Unlicense" ]
null
null
null
wgseruntime/include/opcodes.h
Amorph/wgs
781a2ed9fe10747d9501cc18bb3319641a6d561a
[ "Unlicense" ]
null
null
null
#pragma once enum WGSEOpcode { OP_END = 0, OP_STACK_PUSH, OP_STACK_POP, OP_CALL, OP_SIZE = 0x7FFF };
9.727273
17
0.71028
d9f9948858bc646a2cf37cf3ff805060971f42c0
610
h
C
Friendly/Controllers/EntranceWorkflow/AddInterests Module/UserInterface/Wireframe/FRAddInterestsWireframe.h
zetplaner/Friendly
b5e97a17123f40b870282e5b48361aed2d3c403a
[ "MIT" ]
null
null
null
Friendly/Controllers/EntranceWorkflow/AddInterests Module/UserInterface/Wireframe/FRAddInterestsWireframe.h
zetplaner/Friendly
b5e97a17123f40b870282e5b48361aed2d3c403a
[ "MIT" ]
null
null
null
Friendly/Controllers/EntranceWorkflow/AddInterests Module/UserInterface/Wireframe/FRAddInterestsWireframe.h
zetplaner/Friendly
b5e97a17123f40b870282e5b48361aed2d3c403a
[ "MIT" ]
null
null
null
// // FRAddInterestsInteractor.h // Friendly // // Created by Sergey Borichev on 3.03.2016. // Copyright (c) 2016 TecSynt. All rights reserved. // @class FRRecomendedUserModels; @interface FRAddInterestsWireframe : NSObject - (void)presentAddInterestsControllerFromNavigationController:(UINavigationController*)nc; - (void)dismissAddInterestsController; - (void)presentRecommendedUsersControllerWithInterests:(NSArray*)interests; - (void)presentRecommendedUsersControllerUsers:(FRRecomendedUserModels*)users interests:(NSArray*)interests; - (void)presentSettingsWithInterests:(NSArray*) interests; @end
32.105263
108
0.811475
8a0095711f512a8dce9e2eab1b6f753bb6e79ce1
7,580
h
C
HTCondor/Conv.h
YAMWD/SC_CNN
182e9e7daae27db2980d0df992914c18ee33a40a
[ "MIT" ]
1
2021-05-09T12:49:10.000Z
2021-05-09T12:49:10.000Z
HTCondor/Conv.h
YAMWD/SC_CNN
182e9e7daae27db2980d0df992914c18ee33a40a
[ "MIT" ]
null
null
null
HTCondor/Conv.h
YAMWD/SC_CNN
182e9e7daae27db2980d0df992914c18ee33a40a
[ "MIT" ]
null
null
null
#ifndef _CONV_H_ #define _CONV_H_ #include "Kernel.h" #include "utils.h" #include "SC.h" class Conv2D { private: int m_output_channels; int m_stride; int m_input_size; int m_output_size; int m_kernel_width; int m_kernel_length; public: std::vector<Kernel> kernels; std::vector<double> bias; Conv2D(int output_channels, int kernel_width, int kernel_length, int stride); int get_input_size(); int get_output_size(); double calc(int coordinate_x, int coordinate_y, int kernel_num, std::vector< std::vector<double> > inputs); double SC_calc(int coordinate_x, int coordinate_y, int kernel_num, std::vector< std::vector<double> > inputs, std::string RNG_type, int data_bits, int if_revert); std::vector< std::vector< std::vector<double> > > forward(std::vector< std::vector<double> > inputs); std::vector< std::vector< std::vector<double> > > SC_forward(std::vector< std::vector<double> > inputs, std::string RNG_type, int data_bits, int if_revert); void load_weights(std::string save_path); void load_bias(std::string save_path); void show_weights(); void show_bias(); void show_weights_range(); void show_bias_range(); }; Conv2D::Conv2D(int output_channels, int kernel_width, int kernel_length, int stride) { m_output_channels = output_channels; m_stride = stride; m_kernel_width = kernel_width; m_kernel_length = kernel_length; kernels.reserve(output_channels); bias.reserve(output_channels); for(int i = 0; i < output_channels; i++) { Kernel temp(kernel_width, kernel_length); kernels.push_back(temp); bias.push_back(0); } } int Conv2D::get_input_size() { return m_input_size; } int Conv2D::get_output_size() { return m_output_size; } double Conv2D::calc(int coordinate_x, int coordinate_y, int kernel_num, std::vector< std::vector<double> > inputs) { double temp = 0; int size = kernels[kernel_num].shape().first; for(int i = coordinate_x; i < coordinate_x + size; i++) for(int j = coordinate_y; j < coordinate_y + size; j++) temp += inputs[i][j] * kernels[kernel_num].v[i - coordinate_x][j - coordinate_y]; return temp; } double Conv2D::SC_calc(int coordinate_x, int coordinate_y, int kernel_num, std::vector< std::vector<double> > inputs, std::string RNG_type, int data_bits, int if_revert) { SC sc("bipolar", RNG_type, data_bits, 3, if_revert); double temp = 0; int size = kernels[kernel_num].shape().first; for(int i = coordinate_x; i < coordinate_x + size; i++) for(int j = coordinate_y; j < coordinate_y + size; j++) { double ori = inputs[i][j] * kernels[kernel_num].v[i - coordinate_x][j - coordinate_y]; double sc_ans = sc.SC_Mul(inputs[i][j], kernels[kernel_num].v[i - coordinate_x][j - coordinate_y]); //printf("Ori: %lf, SC: %lf\n", ori, sc_ans); temp += sc_ans; } return temp; } std::vector< std::vector< std::vector<double> > > Conv2D::forward(std::vector< std::vector<double> > inputs) { //forward prop with ReLu activation function. (8, 26, 26) std::vector< std::vector< std::vector<double> > > outputs; m_input_size = inputs.size(); int n = m_input_size; int m = kernels[0].shape().first; m_output_size = n - m + 1; outputs.reserve(m_output_channels); for(int k = 0; k < m_output_channels; k++) { std::vector< std::vector<double> > temp_i; temp_i.reserve(m_output_size); for(int i = 0; i < m_output_size; i += m_stride) { std::vector<double> temp_j; temp_j.reserve(m_output_size); for(int j = 0; j < m_output_size; j += m_stride) temp_j.push_back(ReLu(calc(i, j, k, inputs) + bias[k])); temp_i.push_back(temp_j); } outputs.push_back(temp_i); } return outputs; } std::vector< std::vector< std::vector<double> > > Conv2D::SC_forward(std::vector< std::vector<double> > inputs, std::string RNG_type, int data_bits, int if_revert) { //forward prop with ReLu activation function. (8, 26, 26) std::vector< std::vector< std::vector<double> > > outputs; m_input_size = inputs.size(); int n = m_input_size; int m = kernels[0].shape().first; m_output_size = n - m + 1; outputs.reserve(m_output_channels); for(int k = 0; k < m_output_channels; k++) { std::vector< std::vector<double> > temp_i; temp_i.reserve(m_output_size); for(int i = 0; i < m_output_size; i += m_stride) { std::vector<double> temp_j; temp_j.reserve(m_output_size); for(int j = 0; j < m_output_size; j += m_stride) temp_j.push_back(ReLu(SC_calc(i, j, k, inputs, RNG_type, data_bits, if_revert) + bias[k])); temp_i.push_back(temp_j); } outputs.push_back(temp_i); } return outputs; } void Conv2D::load_weights(std::string save_path) { int kernel_height = kernels[0].shape().first; int kernel_width = kernels[0].shape().second; FILE* fp; if((fp = freopen(save_path.c_str(), "r", stdin)) == NULL) { fprintf(stderr, "error redirecting conv layer weights\n"); exit(-1); } for(int i = 0; i < m_output_channels; i++) for(int j = 0; j < kernel_height; j++) for(int k = 0; k < kernel_width; k++) { double now; std::cin >> now; kernels[i].v[j][k] = now; } fp = freopen("/dev/tty", "r", stdin); printf("conv layer weights loaded\n"); } void Conv2D::load_bias(std::string save_path) { FILE* fp; if((fp = freopen(save_path.c_str(), "r", stdin)) == NULL) { fprintf(stderr, "error redirecting conv layer bias\n"); exit(-1); } for(int i = 0; i < m_output_channels; i++) { double now; std::cin >> now; bias[i] = now; } fp = freopen("/dev/tty", "r", stdin); printf("conv layer bias loaded\n"); } void Conv2D::show_weights() { int kernel_height = kernels[0].shape().first; int kernel_width = kernels[0].shape().second; for(int i = 0; i < m_output_channels; i++) for(int j = 0; j < kernel_height; j++) for(int k = 0; k < kernel_width; k++) printf("%lf ", kernels[i].v[j][k]); } void Conv2D::show_bias() { for(int i = 0; i < m_output_channels; i++) printf("%lf ", bias[i]); } void Conv2D::show_weights_range() { int kernel_height = kernels[0].shape().first; int kernel_width = kernels[0].shape().second; double weights_min = 0x3f3f3f3f; double weights_max = -0x3f3f3f3f; for(int i = 0; i < m_output_channels; i++) for(int j = 0; j < kernel_height; j++) for(int k = 0; k < kernel_width; k++) { weights_min = std::min(weights_min, kernels[i].v[j][k]); weights_max = std::max(weights_max, kernels[i].v[j][k]); } printf("Conv layer weights min: %lf\n", weights_min); printf("Conv layer weights max: %lf\n", weights_max); } void Conv2D::show_bias_range() { double bias_min = 0x3f3f3f3f; double bias_max = -0x3f3f3f3f; for(int i = 0; i < m_output_channels; i++) { bias_min = std::min(bias_min, bias[i]); bias_max = std::max(bias_max, bias[i]); } printf("Conv layer bias min: %lf\n", bias_min); printf("Conv layer bias max: %lf\n", bias_max); } #endif
27.563636
169
0.606332
a82fffcc9ce3fa9ce5d2fbbfc56bdc795f9a65e0
2,597
h
C
include/fnmatch.h
GrieferAtWork/KOS
5376a813854b35e3a3532a6e3b8dbb168478b40f
[ "Zlib" ]
2
2017-02-24T17:14:19.000Z
2017-10-12T19:26:13.000Z
include/fnmatch.h
GrieferAtWork/KOS
5376a813854b35e3a3532a6e3b8dbb168478b40f
[ "Zlib" ]
1
2019-11-02T10:21:11.000Z
2019-11-02T10:21:11.000Z
include/fnmatch.h
GabrielRavier/KOSmk3
5376a813854b35e3a3532a6e3b8dbb168478b40f
[ "Zlib" ]
1
2019-11-02T10:20:19.000Z
2019-11-02T10:20:19.000Z
/* Copyright (c) 2018 Griefer@Work * * * * This software is provided 'as-is', without any express or implied * * warranty. In no event will the authors be held liable for any damages * * arising from the use of this software. * * * * Permission is granted to anyone to use this software for any purpose, * * including commercial applications, and to alter it and redistribute it * * freely, subject to the following restrictions: * * * * 1. The origin of this software must not be misrepresented; you must not * * claim that you wrote the original software. If you use this software * * in a product, an acknowledgement in the product documentation would be * * appreciated but is not required. * * 2. Altered source versions must be plainly marked as such, and must not be * * misrepresented as being the original software. * * 3. This notice may not be removed or altered from any source distribution. * */ #ifndef _FNMATCH_H #define _FNMATCH_H 1 #include <__stdinc.h> #include <features.h> #if !defined(__CRT_GLC) && !defined(__CRT_CYG) #error "<fnmatch.h> is not supported by the linked libc" #endif /* !__CRT_GLC && !__CRT_CYG */ __SYSDECL_BEGIN #undef FNM_PATHNAME #undef FNM_NOESCAPE #undef FNM_PERIOD #define FNM_PATHNAME (1 << 0) /* No wildcard can ever match '/'. */ #define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */ #define FNM_PERIOD (1 << 2) /* Leading '.' is matched only explicitly. */ #if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined(_GNU_SOURCE) # define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ # define FNM_LEADING_DIR (1 << 3) /* Ignore '/...' after a match. */ # define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ # define FNM_EXTMATCH (1 << 5) /* Use ksh-like extended matching. */ #endif #define FNM_NOMATCH 1 /* Value returned by 'fnmatch' if STRING does not match PATTERN. */ #ifdef _XOPEN_SOURCE # define FNM_NOSYS (-1) #endif #ifndef __KERNEL__ __LIBC int (__LIBCCALL fnmatch)(char const *__pattern, char const *__name, int __match_flags); #endif /* !__KERNEL__ */ __SYSDECL_END #endif /* !_FNMATCH_H */
46.375
94
0.589141
cdae61dbceaa6355dc1c0e7149a005a3da8697d1
228
h
C
Plugins/DialogPlugin/Source/DialogPluginEditor/Public/TPAssetEditor_DialogGraph.h
Kaninchen221/TopDownGame
d603aca124e3dfe703c0dc30265ac83247d565f4
[ "MIT" ]
null
null
null
Plugins/DialogPlugin/Source/DialogPluginEditor/Public/TPAssetEditor_DialogGraph.h
Kaninchen221/TopDownGame
d603aca124e3dfe703c0dc30265ac83247d565f4
[ "MIT" ]
null
null
null
Plugins/DialogPlugin/Source/DialogPluginEditor/Public/TPAssetEditor_DialogGraph.h
Kaninchen221/TopDownGame
d603aca124e3dfe703c0dc30265ac83247d565f4
[ "MIT" ]
null
null
null
#pragma once #include "CoreMinimal.h" #include "GenericGraphAssetEditor/AssetEditor_GenericGraph.h" class FTPAssetEditor_DialogGraph : public FAssetEditor_GenericGraph { public: virtual void SaveAsset_Execute() override; };
19
67
0.824561
a315dcd09fe2d829589883f74c925f540f1ecd69
672
h
C
APPDateCatgory/Class/ViewController/Mine/AgentCenter/View/CPOpenAccountCell.h
attackers/APPDateCatgory
044bc25d0a0e988d06157a8c57d3de79e2c93d02
[ "MIT" ]
null
null
null
APPDateCatgory/Class/ViewController/Mine/AgentCenter/View/CPOpenAccountCell.h
attackers/APPDateCatgory
044bc25d0a0e988d06157a8c57d3de79e2c93d02
[ "MIT" ]
null
null
null
APPDateCatgory/Class/ViewController/Mine/AgentCenter/View/CPOpenAccountCell.h
attackers/APPDateCatgory
044bc25d0a0e988d06157a8c57d3de79e2c93d02
[ "MIT" ]
null
null
null
// // CPOpenAccountCell.h // lottery // // Created by way on 2018/6/11. // Copyright © 2018年 way. All rights reserved. // #import <UIKit/UIKit.h> @protocol CPOpenAccountCellValueProtocol<NSObject> -(void)cpOpenAccountCellAddValue:(NSString *)value isDdting:(BOOL)edting index:(NSInteger)index textField:(UITextField *)textField; @end @interface CPOpenAccountCell : UITableViewCell -(UITextField *)addInfo:(NSDictionary *)info perValue:(NSString *)perValue delegate:(id<CPOpenAccountCellValueProtocol>)delegate index:(NSInteger)index; @end
24
68
0.629464
33a82062695932f5b287035023765625b4d4a74a
3,053
h
C
src/utils/mesos_stout_abort.h
pengdu/bubblefs
9b27e191a287b3a1d012adfd3bab6a30629a5f33
[ "BSD-3-Clause" ]
1
2021-01-11T14:19:51.000Z
2021-01-11T14:19:51.000Z
src/utils/mesos_stout_abort.h
pengdu/bubblefs
9b27e191a287b3a1d012adfd3bab6a30629a5f33
[ "BSD-3-Clause" ]
null
null
null
src/utils/mesos_stout_abort.h
pengdu/bubblefs
9b27e191a287b3a1d012adfd3bab6a30629a5f33
[ "BSD-3-Clause" ]
null
null
null
// 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. // mesos/3rdparty/stout/include/stout/abort.hpp #ifndef BUBBLEFS_UTILS_MESOS_STOUT_ABORT_H_ #define BUBBLEFS_UTILS_MESOS_STOUT_ABORT_H_ #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #ifdef __WINDOWS__ #include <stout/windows.hpp> #else #include <unistd.h> #endif // __WINDOWS__ #include <string> #include "utils/mesos_stout_attributes.h" // NOTE: These macros are already defined in Visual Studio (Windows) headers. #ifndef __WINDOWS__ #define __STRINGIZE(x) #x #define _STRINGIZE(x) __STRINGIZE(x) #endif // __WINDOWS__ // Signal safe abort which prints a message. #define _ABORT_PREFIX "ABORT: (" __FILE__ ":" _STRINGIZE(__LINE__) "): " #define ABORT(...) _Abort(_ABORT_PREFIX, __VA_ARGS__) inline NORETURN void _Abort(const char* prefix, const char* message) { // NOTE: On Windows, `_write` takes an `unsigned int`, not `size_t`. We // preform an explicit type conversion here to silence the warning. `strlen` // always returns a positive result, which means it is safe to cast it to an // unsigned value. #ifndef __WINDOWS__ const size_t prefix_len = strlen(prefix); const size_t message_len = strlen(message); #else const unsigned int prefix_len = static_cast<unsigned int>(strlen(prefix)); const unsigned int message_len = static_cast<unsigned int>(strlen(message)); #endif // !__WINDOWS__ // Write the failure message in an async-signal safe manner, // assuming strlen is async-signal safe or optimized out. // In fact, it is highly unlikely that strlen would be // implemented in an unsafe manner: // http://austingroupbugs.net/view.php?id=692 // NOTE: we can't use `signal_safe::write`, because it's defined in the header // which can't be included due to circular dependency of headers. while (::write(STDERR_FILENO, prefix, prefix_len) == -1 && errno == EINTR); while (message != nullptr && ::write(STDERR_FILENO, message, message_len) == -1 && errno == EINTR); // NOTE: Since `1` can be interpreted as either an `unsigned int` or a // `size_t`, removing the `static_cast` here makes this call ambiguous // between the `write` in windows.hpp and the (deprecated) `write` in the // Windows CRT headers. while (::write(STDERR_FILENO, "\n", static_cast<size_t>(1)) == -1 && errno == EINTR); abort(); } inline NORETURN void _Abort(const char* prefix, const std::string& message) { _Abort(prefix, message.c_str()); } #endif // BUBBLEFS_UTILS_MESOS_STOUT_ABORT_H_
34.693182
80
0.724206
ed437ebd7a6f5d00b46b6b3035aec19019fd75fa
589
h
C
src/signal.h
apenwarr/ion1
86738b1eda06f0cb1a4b3416825301a346451f67
[ "ClArtistic" ]
3
2019-02-19T08:07:07.000Z
2022-03-31T13:29:44.000Z
src/signal.h
apenwarr/ion1
86738b1eda06f0cb1a4b3416825301a346451f67
[ "ClArtistic" ]
null
null
null
src/signal.h
apenwarr/ion1
86738b1eda06f0cb1a4b3416825301a346451f67
[ "ClArtistic" ]
1
2019-12-03T11:54:38.000Z
2019-12-03T11:54:38.000Z
/* * ion/signal.h * * Copyright (c) Tuomo Valkonen 1999-2001. * See the included file LICENSE for details. */ #ifndef INCLUDED_SIGNAL_H #define INCLUDED_SIGNAL_H #include <sys/time.h> #include <time.h> #include <unistd.h> #include "common.h" INTRSTRUCT(WTimer) DECLSTRUCT(WTimer){ struct timeval when; void (*handler)(WTimer *timer); WTimer *next; }; #define INIT_TIMER(FUN) {{0, 0}, FUN, NULL} extern void check_signals(); extern void trap_signals(); extern void set_timer(WTimer *timer, uint msecs); extern void reset_timer(WTimer *timer); #endif /* INCLUDED_SIGNAL_H */
18.40625
49
0.719864
35a5311140ab3c7b0efe9aea718cbbfac01aa8a0
2,280
h
C
macOS/10.13/GeoServices.framework/GEOMapsTransitWidget.h
onmyway133/Runtime-Headers
e9b80e7ab9103f37ad421ad6b8b58ee06369d21f
[ "MIT" ]
30
2016-10-09T20:13:00.000Z
2022-01-24T04:14:57.000Z
macOS/10.13/GeoServices.framework/GEOMapsTransitWidget.h
onmyway133/Runtime-Headers
e9b80e7ab9103f37ad421ad6b8b58ee06369d21f
[ "MIT" ]
null
null
null
macOS/10.13/GeoServices.framework/GEOMapsTransitWidget.h
onmyway133/Runtime-Headers
e9b80e7ab9103f37ad421ad6b8b58ee06369d21f
[ "MIT" ]
7
2017-08-29T14:41:25.000Z
2022-01-19T17:14:54.000Z
/* Generated by RuntimeBrowser Image: /System/Library/PrivateFrameworks/GeoServices.framework/Versions/A/GeoServices */ @interface GEOMapsTransitWidget : PBCodable <NSCopying> { BOOL _everExpanded; struct { unsigned int tappedItemIndex : 1; unsigned int transitMessageType : 1; unsigned int everExpanded : 1; unsigned int initiallyExpanded : 1; } _has; BOOL _initiallyExpanded; int _tappedItemIndex; NSMutableArray * _transitIncidentItems; int _transitMessageType; } @property (nonatomic, readwrite) BOOL everExpanded; @property (nonatomic, readwrite) BOOL hasEverExpanded; @property (nonatomic, readwrite) BOOL hasInitiallyExpanded; @property (nonatomic, readwrite) BOOL hasTappedItemIndex; @property (nonatomic, readwrite) BOOL hasTransitMessageType; @property (nonatomic, readwrite) BOOL initiallyExpanded; @property (nonatomic, readwrite) int tappedItemIndex; @property (nonatomic, readwrite, retain) NSMutableArray *transitIncidentItems; @property (nonatomic, readwrite) int transitMessageType; + (Class)transitIncidentItemType; - (void).cxx_destruct; - (int)StringAsTransitMessageType:(id)arg1; - (void)addTransitIncidentItem:(id)arg1; - (void)clearTransitIncidentItems; - (void)copyTo:(id)arg1; - (id)copyWithZone:(struct _NSZone { }*)arg1; - (id)description; - (id)dictionaryRepresentation; - (BOOL)everExpanded; - (BOOL)hasEverExpanded; - (BOOL)hasInitiallyExpanded; - (BOOL)hasTappedItemIndex; - (BOOL)hasTransitMessageType; - (unsigned long long)hash; - (BOOL)initiallyExpanded; - (BOOL)isEqual:(id)arg1; - (void)mergeFrom:(id)arg1; - (BOOL)readFrom:(id)arg1; - (void)setEverExpanded:(BOOL)arg1; - (void)setHasEverExpanded:(BOOL)arg1; - (void)setHasInitiallyExpanded:(BOOL)arg1; - (void)setHasTappedItemIndex:(BOOL)arg1; - (void)setHasTransitMessageType:(BOOL)arg1; - (void)setInitiallyExpanded:(BOOL)arg1; - (void)setTappedItemIndex:(int)arg1; - (void)setTransitIncidentItems:(id)arg1; - (void)setTransitMessageType:(int)arg1; - (int)tappedItemIndex; - (id)transitIncidentItemAtIndex:(unsigned long long)arg1; - (id)transitIncidentItems; - (unsigned long long)transitIncidentItemsCount; - (int)transitMessageType; - (id)transitMessageTypeAsString:(int)arg1; - (void)writeTo:(id)arg1; @end
34.029851
88
0.763596
6c28473b7761a31f5c960d085f3c348957823518
5,289
c
C
src/game.c
as2569/pathfinding
4ddca442e632e6a67ea48fe8efe5ceaf4cc4c605
[ "MIT" ]
null
null
null
src/game.c
as2569/pathfinding
4ddca442e632e6a67ea48fe8efe5ceaf4cc4c605
[ "MIT" ]
null
null
null
src/game.c
as2569/pathfinding
4ddca442e632e6a67ea48fe8efe5ceaf4cc4c605
[ "MIT" ]
null
null
null
#include <SDL.h> #include <stdio.h> #include <string.h> #include "gf2d_graphics.h" #include "gf2d_sprite.h" #include "simple_logger.h" #include "linked_list.h" #include "tilemap.h" #include "pathfinding.h" int main(int argc, char * argv[]) { /*variable declarations*/ int done = 0; const Uint8 * keys; Sprite *sprite; /*Queues */ Node* checkList = NULL; Node* toCheckTail = NULL; Node* pathList = NULL; Node* pathListTail = NULL; /* Mouse variables*/ int mx, my; float mf = 0; Sprite *mouse; Vector4D mouseColor = { 0,0,255,200 }; TileMap *map; //map static Vector2D path[2]; //path to take char arr[642]; //map array int visited[642]; //visited array int camefrom[642]; intVec2 current = { 2, 7 }; int currentIndex = 0; Vector2D newVec = { 0, 0 }; int next = 0; int goalIndex = 0; int startIndex = 0; Node* this_node; int pathlength; Vector2D * finalpath; /*program initializtion*/ init_logger("gf2d.log"); slog("---==== BEGIN ====---"); gf2d_graphics_initialize( "gf2d", 1200, 720, 1200, 720, vector4d(0, 0, 0, 255), 0); gf2d_graphics_set_frame_delay(17); gf2d_sprite_init(1024); SDL_ShowCursor(SDL_DISABLE); /*demo setup*/ sprite = gf2d_sprite_load_image("images/backgrounds/bg_flat.png"); mouse = gf2d_sprite_load_all("images/pointer.png", 32, 32, 16); map = tilemap_load("levels/tilemap.map"); vector2d_copy(path[0], map->start); vector2d_copy(path[1], map->end); //populate array for map for (int i = 0; i <= 640; i++) { arr[i] = map->map[i]; } arr[641] = '\0'; //popular array for visited with zeros for (int i = 0; i <= 640; i++) { camefrom[i] = 0; visited[i] = 0; } //pathfinding algo next = MatrixToIndex(2, 7); checkList = push(checkList, &toCheckTail, next, 0); goalIndex = MatrixToIndex(7, 16); camefrom[71] = 999; //while(count(toCheckHead) > 0) while(checkList != NULL) { this_node = deq(&checkList); currentIndex = this_node->data; if (currentIndex == goalIndex) { printf("found goal"); } next = TileAbove(currentIndex); if(arr[next] == '0') { if (visited[next] == 0) { checkList = push(checkList, &toCheckTail, next, 0); visited[next] = 1; camefrom[next] = currentIndex; } } next = TileRight(currentIndex); if (arr[next] == '0') { if (visited[next] == 0) { checkList = push(checkList, &toCheckTail, next, 0); visited[next] = 1; camefrom[next] = currentIndex; } } next = TileDown(currentIndex); if (arr[next] == '0') { if (visited[next] == 0) { checkList = push(checkList, &toCheckTail, next, 0); visited[next] = 1; camefrom[next] = currentIndex; } } next = TileLeft(currentIndex); if (arr[next] == '0') { if (visited[next] == 0) { checkList = push(checkList, &toCheckTail, next, 0); visited[next] = 1; camefrom[next] = currentIndex; } } } //construct a path currentIndex = goalIndex; pathList = push(pathList, &pathListTail, currentIndex, 0); while(currentIndex != 999) { currentIndex = camefrom[currentIndex]; printf("\ncurrent %i camefrom %i", currentIndex, camefrom[currentIndex]); pathList = push(pathList, &pathListTail, currentIndex, 0); if (currentIndex == 71) { printf("\nat start"); break; } } pathlength = count(pathList); printf("\nlen %i", pathlength); //pathlength++; //Vector2D finalpath[pathlength]; finalpath = (Vector2D*)malloc(sizeof(Vector2D) * pathlength); memset(finalpath, 0, sizeof(Vector2D) * pathlength); for (int j = 0; j < pathlength; j++) { this_node = deq(&pathList); int row = RowFromIndex(this_node->data); int column = ColumnFromIndex(this_node->data); newVec.y = row; newVec.x = column; finalpath[j] = newVec; } /*main game loop*/ while(!done) { SDL_PumpEvents(); // update SDL's internal event structures keys = SDL_GetKeyboardState(NULL); // get the keyboard state for this frame /*update things here*/ SDL_GetMouseState(&mx,&my); mf+=0.1; if (mf >= 16.0)mf = 0; gf2d_graphics_clear_screen();// clears drawing buffers // all drawing should happen betweem clear_screen and next_frame //backgrounds drawn first gf2d_sprite_draw_image(sprite,vector2d(0,0)); tilemap_draw(map,vector2d(86,24)); //tilemap_draw_path(path, 2, map, vector2d(86,24)); tilemap_draw_path(finalpath, pathlength, map, vector2d(86, 24)); //UI elements last gf2d_sprite_draw( mouse, vector2d(mx,my), NULL, NULL, NULL, NULL, &mouseColor, (int)mf); gf2d_grahics_next_frame();// render current draw frame and skip to the next frame if (keys[SDL_SCANCODE_ESCAPE])done = 1; // exit condition //slog("Rendering at %f FPS",gf2d_graphics_get_frames_per_second()); } slog("---==== END ====---"); return 0; } /*eol@eof*/
24.150685
90
0.5865
8feda432cffe2991c6c8d7ddec89a1e0d5e4605d
591
h
C
utility/linked_list/linked_list.h
PhamPhiLong/AIMA
9dc9c9dcbe595ac771bc27d8c5b44f9be1c1aa6d
[ "MIT" ]
null
null
null
utility/linked_list/linked_list.h
PhamPhiLong/AIMA
9dc9c9dcbe595ac771bc27d8c5b44f9be1c1aa6d
[ "MIT" ]
null
null
null
utility/linked_list/linked_list.h
PhamPhiLong/AIMA
9dc9c9dcbe595ac771bc27d8c5b44f9be1c1aa6d
[ "MIT" ]
null
null
null
/** * @author Pham Phi Long * */ #ifndef LINKED_LIST #define LINKED_LIST #include "list_if.h" #include "queue_if.h" #include "stack_if.h" #include "priority_queue_if.h" /** * @brief API for List interface */ extern List linked_list_get_list_interface(void); /** * @brief API for Queue interface */ extern Queue linked_list_get_queue_interface(void); /** * @brief API for Stack interface */ extern Stack linked_list_get_stack_interface(void); /** * @brief API for Priority Queue interface */ extern Priority_Queue linked_list_get_priority_queue_interface(void); #endif
17.382353
69
0.736041
470d4bb6428f7af0f015c513fda74512112b4513
944
h
C
src/rl_resample.h
libretro/retroluxury
fdcd94fe4099735edcbea638760da3f2297bc520
[ "Zlib" ]
1
2017-02-26T17:43:05.000Z
2017-02-26T17:43:05.000Z
src/rl_resample.h
libretro/retroluxury
fdcd94fe4099735edcbea638760da3f2297bc520
[ "Zlib" ]
null
null
null
src/rl_resample.h
libretro/retroluxury
fdcd94fe4099735edcbea638760da3f2297bc520
[ "Zlib" ]
3
2019-11-26T00:54:32.000Z
2020-08-27T19:51:49.000Z
#ifndef RL_RESAMPLE_H #define RL_RESAMPLE_H #include <rl_userdata.h> #include <rl_imgdata.h> #include <stdint.h> typedef void rl_resampler_t; /* Creates a resampler. */ rl_resampler_t* rl_resampler_create( unsigned in_freq ); /* Destroys a resampler. */ void rl_resampler_destroy( rl_resampler_t* resampler ); /* Returns how much samples an output buffer must have to resample an input buffer with this number of samples. */ size_t rl_resampler_out_samples( rl_resampler_t* resampler, size_t in_samples ); /* Returns how much samples an input buffer must have to fill an output buffer with this number of samples. */ size_t rl_resampler_in_samples( rl_resampler_t* resampler, size_t out_samples ); /* Resamples the input buffer into the output buffer. */ size_t rl_resampler_resample( rl_resampler_t* resampler, const int16_t* in_buffer, size_t in_samples, int16_t* out_buffer, size_t out_samples ); #endif /* RL_RESAMPLE_H */
39.333333
144
0.78072
473f53c05e21322d64f9378a59344b737284e83a
6,180
h
C
System/Library/PrivateFrameworks/ATVSlideshow.framework/MPAuthoringUtilities.h
lechium/tvOS135Headers
46cd30d3f0f7962eaa0c3f925cd71f414c65e2ac
[ "MIT" ]
2
2020-07-26T20:30:54.000Z
2020-08-10T04:26:23.000Z
System/Library/PrivateFrameworks/ATVSlideshow.framework/MPAuthoringUtilities.h
lechium/tvOS135Headers
46cd30d3f0f7962eaa0c3f925cd71f414c65e2ac
[ "MIT" ]
1
2020-07-26T20:45:31.000Z
2020-08-09T09:30:46.000Z
System/Library/PrivateFrameworks/ATVSlideshow.framework/MPAuthoringUtilities.h
lechium/tvOS135Headers
46cd30d3f0f7962eaa0c3f925cd71f414c65e2ac
[ "MIT" ]
null
null
null
/* * This header is generated by classdump-dyld 1.0 * on Sunday, June 7, 2020 at 11:42:37 AM Mountain Standard Time * Operating System: Version 13.4.5 (Build 17L562) * Image Source: /System/Library/PrivateFrameworks/ATVSlideshow.framework/ATVSlideshow * classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos. */ #import <ATVSlideshow/ATVSlideshow-Structs.h> @interface MPAuthoringUtilities : NSObject +(unsigned long long)randomSeedFromOptions:(id)arg1 ; +(unsigned long long)presentationOrderFromOptions:(id)arg1 ; +(NSRange)videoPathsRangeFromOptions:(id)arg1 ; +(long long)minimumNumberOfDynamicSlidesToAddFromOptions:(id)arg1 ; +(BOOL)ignoreClusteringForImages:(id)arg1 withOptions:(id)arg2 ; +(BOOL)replaceAudioPlaylistFromOptions:(id)arg1 ; +(BOOL)useDefaultAudioFromOptions:(id)arg1 ; +(BOOL)alignToBeatsFromOptions:(id)arg1 ; +(BOOL)createBeatsFromOptions:(id)arg1 ; +(unsigned long long)audioScalingModeFromOptions:(id)arg1 ; +(long long)numberOfLayersFromOptions:(id)arg1 ; +(BOOL)isLayerEffectAuthoredFromOptions:(id)arg1 ; +(id)subtitlesFromOptions:(id)arg1 ; +(BOOL)collectVersionInformationFromOptions:(id)arg1 ; +(id)styleFromOptions:(id)arg1 ; +(id)colorSchemeFromOptions:(id)arg1 ; +(CGColorRef)backgroundColorFromOptions:(id)arg1 ; +(id)exportTransitionIDFromOptions:(id)arg1 ; +(double)exportTransitionDurationFromOptions:(id)arg1 ; +(BOOL)shouldComputeLoopTransitionFromOptions:(id)arg1 ; +(double)transitionDurationFromOptions:(id)arg1 ; +(BOOL)useIntroTransition:(id)arg1 ; +(id)introEffectIDFromOptions:(id)arg1 ; +(double)introDurationFromOptions:(id)arg1 ; +(id)outroEffectIDFromOptions:(id)arg1 ; +(double)outroDurationFromOptions:(id)arg1 ; +(BOOL)layerHasImagesFromOptions:(id)arg1 ; +(long long)layerIndexFromOptions:(id)arg1 ; +(id)effectListFromOptions:(id)arg1 ; +(BOOL)canRepeatEffectWithPreset:(id)arg1 ; +(BOOL)canRepeatPreset:(id)arg1 ; +(BOOL)useLargestEffectsFromOptions:(id)arg1 ; +(BOOL)matchEffectsUsingTagsFromOptions:(id)arg1 ; +(BOOL)useTitleEffectFromOptions:(id)arg1 ; +(id)titleEffectFromOptions:(id)arg1 ; +(BOOL)useImageOnlyTitleEffectFromOptions:(id)arg1 ; +(BOOL)pickEffectsEvenlyByIDWithOptions:(id)arg1 ; +(id)lastPresetFromOptions:(id)arg1 ; +(id)idFromPresetID:(id)arg1 ; +(double)aspectRatioFromOptions:(id)arg1 ; +(unsigned long long)screenSizeFromOptions:(id)arg1 ; +(BOOL)useTransitionLayoutTagsWithOptions:(id)arg1 ; +(BOOL)layerCanSkipScaleCalculation:(id)arg1 withOptions:(id)arg2 ; +(double)audioDurationFromOptions:(id)arg1 ; +(double)durationPerEffectFromOptions:(id)arg1 ; +(double)layerTimeScaleFromOptions:(id)arg1 ; +(double)minimumTransitionDurationFromOptions:(id)arg1 ; +(double)minimumEffectDurationFromOptions:(id)arg1 ; +(BOOL)matchPhasesWithTransitionFromOptions:(id)arg1 ; +(BOOL)useUniformDurations:(id)arg1 ; +(BOOL)scaleOutroEffectFromOptions:(id)arg1 ; +(BOOL)scaleEffectsForBreaksFromOptions:(id)arg1 ; +(double)breakDurationScaleFromOptions:(id)arg1 ; +(double)portraitBreakDurationScaleFromOptions:(id)arg1 ; +(double)baseBreakAspectRatioFromOptions:(id)arg1 ; +(double)basePortraitBreakAspectRatioFromOptions:(id)arg1 ; +(id)layerDescriptionForLayerWithZIndex:(long long)arg1 forStyle:(id)arg2 ; +(double)maximumTransitionDurationFromOptions:(id)arg1 ; +(BOOL)lockTransitionDurationFromOptions:(id)arg1 ; +(BOOL)canAdjustPhaseDurations:(id)arg1 ; +(NSRange)reconfigureRangeFromOptions:(id)arg1 ; +(BOOL)shouldComputeSlideFiltersFromOptions:(id)arg1 ; +(BOOL)shouldComputeTransitionsFromOptions:(id)arg1 ; +(BOOL)canHaveTransitionsFromOptions:(id)arg1 ; +(id)layerTypeFromOptions:(id)arg1 ; +(double)layerOffsetFromOptions:(id)arg1 ; +(BOOL)shouldComputeFramesFromOptions:(id)arg1 ; +(double)movieVolumeFromOptions:(id)arg1 ; +(BOOL)shouldDuckMoviesFromOptions:(id)arg1 ; +(BOOL)repeatTransitionsFromOptions:(id)arg1 ; +(BOOL)useBestAspectRatioFromOptions:(id)arg1 ; +(double)effectPadding:(id)arg1 ; +(BOOL)padTextOnlyEffects:(id)arg1 ; +(BOOL)fitMoviesWhenPossibleFromOptions:(id)arg1 ; +(BOOL)needsFitMovieAttributeFromOptions:(id)arg1 ; +(BOOL)effectNeedsPreviousAttributesFromOptions:(id)arg1 ; +(id)transitionListFromOptions:(id)arg1 ; +(BOOL)pickTransitionsEvenlyByIDWithOptions:(id)arg1 ; +(double)multilineSizeFactorFromOptions:(id)arg1 ; +(id)gapInformationFromOptions:(id)arg1 ; +(BOOL)alwaysIncludeLastTransitionFromOptions:(id)arg1 ; +(id)loopTransitionIDFromOptions:(id)arg1 ; +(id)presetIDFromPresetID:(id)arg1 ; +(BOOL)fadeOutAudioFromOptions:(id)arg1 ; +(BOOL)effectDecidesTransitionFromOptions:(id)arg1 ; +(id)ignoreTransitionListFromOptions:(id)arg1 ; +(BOOL)aspectRatioMatchesDefault:(id)arg1 withOptions:(id)arg2 ; +(unsigned long long)reorderModeFromOptions:(id)arg1 ; +(BOOL)requestGeneratedImagesFromOptions:(id)arg1 ; +(id)absolutePathForPath:(id)arg1 withOptions:(id)arg2 ; +(id)urlsFromPaths:(id)arg1 ; +(unsigned long long)croppingModeFromOptions:(id)arg1 ; +(unsigned long long)croppingModeForFitMoviesFromOptions:(id)arg1 ; +(double)kenBurnsLikelihoodFromOptions:(id)arg1 ; +(double)maxKenBurnsZoomFromOptions:(id)arg1 ; +(double)kenBurnsPanFactorFromOptions:(id)arg1 ; +(double)kenBurnsStartZoomLevelFromOptions:(id)arg1 ; +(double)kenBurnsEndZoomLevelFromOptions:(id)arg1 ; +(BOOL)kenBurnsAlwaysZoomInFromOptions:(id)arg1 ; +(BOOL)kenBurnsBreaksFromOptions:(id)arg1 ; +(BOOL)easeKenBurnsPanFromOptions:(id)arg1 ; +(long long)kenBurnsLevelFromOptions:(id)arg1 ; +(long long)kenBurnsOffsetTypeFromOptions:(id)arg1 ; +(double)beatFactorFromOptions:(id)arg1 ; +(BOOL)useROIFromOptions:(id)arg1 ; +(double)kenBurnsZoomFactorFromOptions:(id)arg1 ; +(long long)maxNumberOfSlidesToPreloadFromOptions:(id)arg1 ; +(BOOL)useROIAspectRatioFromOptions:(id)arg1 ; +(unsigned long long)regionOfInterestPickModeFromOptions:(id)arg1 ; +(BOOL)performFaceDetectionFromOptions:(id)arg1 ; +(id)absolutePathAtIndex:(long long)arg1 inPaths:(id)arg2 withOptions:(id)arg3 ; +(double)fadeOutDurationFromOptions:(id)arg1 ; +(id)absolutePathsForPaths:(id)arg1 withOptions:(id)arg2 ; +(CGRect)rectToFitIn:(CGRect)arg1 withAspectRatio:(double)arg2 ; +(CGPoint)kbCenterPointFromRect:(CGRect)arg1 ; +(double)distanceBetween:(CGPoint)arg1 andPoint:(CGPoint)arg2 ; @end
47.538462
85
0.805178
e6e152b3c4461750aad9b3de0a286102bdaf4aae
109
c
C
src/example9.2/src/example9.2.c
billsix/cprogrammingbook
80fda9675558d65f5252688b47ef3b1749c3c59f
[ "MIT" ]
null
null
null
src/example9.2/src/example9.2.c
billsix/cprogrammingbook
80fda9675558d65f5252688b47ef3b1749c3c59f
[ "MIT" ]
null
null
null
src/example9.2/src/example9.2.c
billsix/cprogrammingbook
80fda9675558d65f5252688b47ef3b1749c3c59f
[ "MIT" ]
null
null
null
#define NDEBUG #include <assert.h> void func() { int c; assert((c = getchar()) != EOF); putchar(c); }
12.111111
33
0.577982
11b6535c4c5b624ce04924c78b4ab80c31982be2
1,709
h
C
header6.6.1/MMWebViewPresetUI.h
CrackerCat/iWeChat
7b3dbc48090e2d60cb72417563c554777eded15f
[ "MIT" ]
1,694
2018-05-04T12:34:53.000Z
2022-03-23T10:33:46.000Z
header6.6.1/MMWebViewPresetUI.h
CrackerCat/iWeChat
7b3dbc48090e2d60cb72417563c554777eded15f
[ "MIT" ]
6
2018-09-22T16:32:43.000Z
2020-04-20T02:10:19.000Z
header6.6.1/MMWebViewPresetUI.h
CrackerCat/iWeChat
7b3dbc48090e2d60cb72417563c554777eded15f
[ "MIT" ]
236
2018-05-05T11:00:28.000Z
2022-03-09T03:57:28.000Z
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 17 2017 16:24:48). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import <MMCommon/MMObject.h> @class NSString, UIColor; @interface MMWebViewPresetUI : MMObject { _Bool _bUseBlurBackground; UIColor *_navigationBarColor; UIColor *_navigationBarTitleColor; UIColor *_navigationLeftItemFontColor; UIColor *_navigationRightItemColor; unsigned long long _statusBarColor; UIColor *_backgroundColor; NSString *_navigationLeftIconName; NSString *_navigationBarTitle; } @property(nonatomic) _Bool bUseBlurBackground; // @synthesize bUseBlurBackground=_bUseBlurBackground; @property(copy, nonatomic) NSString *navigationBarTitle; // @synthesize navigationBarTitle=_navigationBarTitle; @property(retain, nonatomic) NSString *navigationLeftIconName; // @synthesize navigationLeftIconName=_navigationLeftIconName; @property(retain, nonatomic) UIColor *backgroundColor; // @synthesize backgroundColor=_backgroundColor; @property(nonatomic) unsigned long long statusBarColor; // @synthesize statusBarColor=_statusBarColor; @property(retain, nonatomic) UIColor *navigationRightItemColor; // @synthesize navigationRightItemColor=_navigationRightItemColor; @property(retain, nonatomic) UIColor *navigationLeftItemFontColor; // @synthesize navigationLeftItemFontColor=_navigationLeftItemFontColor; @property(retain, nonatomic) UIColor *navigationBarTitleColor; // @synthesize navigationBarTitleColor=_navigationBarTitleColor; @property(retain, nonatomic) UIColor *navigationBarColor; // @synthesize navigationBarColor=_navigationBarColor; - (void).cxx_destruct; @end
46.189189
139
0.805734
0a6f793bbffea8edf50eef661974879578a14035
1,447
c
C
src/test/kc/examples/rom/rom.c
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
2
2022-03-01T02:21:14.000Z
2022-03-01T04:33:35.000Z
src/test/kc/examples/rom/rom.c
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
src/test/kc/examples/rom/rom.c
jbrandwood/kickc
d4b68806f84f8650d51b0e3ef254e40f38b0ffad
[ "MIT" ]
null
null
null
// Demonstrates how to code a ROM // The rom.ld linker file declares segments for RomCode and RomData. // It also declares a TestRom segment used for testing the ROM calls.This ensures that the compiler does not optimize them away. #pragma target(asm6502) #pragma link("rom.ld") #pragma extension("bin") #pragma start_address(0xf000) #pragma code_seg(RomCode) #pragma data_seg(RomData) // A stack based ROM function that will transfer all parameters and return values through the stack. __stackcall char call1(char param1, char param2) { return param1+param2; } // A memory based ROM function that will transfer all parameters and return values through zeropage. __ma char call2(__ma char param1, __ma char param2) { return param1+param2; } // A "normal" optimized ROM function that will transfer parameters and return value through registers or zeropage. char call3(char param1, char param2) { return param1+param2; } // These calls are thrown away when assembling but needed to make sure the compiler does not optimize the ROM functions away. // To make sure the functions are generated into the final code they must be calling them with different values for each parameter and the return value must used in some way. #pragma code_seg(TestRom) void main() { char* ptr = (char*)0xfe; *ptr = call1(1,2); *ptr = call1(3,4); *ptr = call2(1,2); *ptr = call2(3,4); *ptr = call3(1,2); *ptr = call3(3,4); }
37.102564
174
0.736697
0a7e5d7fdff45d24ee80f989efdcb0d84aa37fdf
128,216
h
C
InstrumentsHeader/FrameWorkHeader/InstrumentsKit.framework.part1.h
yangfu132/InstrumentsHeader
5b5d3fee55326957341a342a5d23e377a3b516fc
[ "MIT" ]
null
null
null
InstrumentsHeader/FrameWorkHeader/InstrumentsKit.framework.part1.h
yangfu132/InstrumentsHeader
5b5d3fee55326957341a342a5d23e377a3b516fc
[ "MIT" ]
null
null
null
InstrumentsHeader/FrameWorkHeader/InstrumentsKit.framework.part1.h
yangfu132/InstrumentsHeader
5b5d3fee55326957341a342a5d23e377a3b516fc
[ "MIT" ]
null
null
null
// // InstrumentsKit.framework.h // MacDemo // // Created by szzc on 2016/11/25. // Copyright © 2016年 szzc. All rights reserved. // #ifndef InstrumentsKit_framework_h #define InstrumentsKit_framework_h #import "InstrumentsKit.Protocal.h" // // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #pragma mark Blocks typedef void (^CDUnknownBlockType)(void); // return type and parameters are unknown #pragma mark Named Structures struct CGAffineTransform { double a; double b; double c; double d; double tx; double ty; }; struct CGPoint { double x; double y; }; struct CGRect { struct CGPoint origin; struct CGSize size; }; struct CGSize { double width; double height; }; struct DTRenderableContentResponse { Class _field1; }; struct NSMutableArray { Class _field1; }; struct NSMutableSet { Class _field1; }; struct NSString { Class _field1; }; struct XRGraphPoint { unsigned long long _field1; float _field2; void *_field3; }; struct XRIntKeyedDictionary { Class _field1; }; struct XRPathAttribute { id _field1; id _field2; double _field3; double *_field4; double _field5; double _field6; }; struct XRSnapToFitUndoInfo { char isValid; unsigned long long scale; unsigned long long offset; }; struct XRTimeRange { unsigned long long start; unsigned long long length; }; struct _CSTypeRef { unsigned long long _field1; unsigned long long _field2; }; struct _NSRange { unsigned long long location; unsigned long long length; }; struct __hash_node<std::__1::__hash_value_type<IconLookup_t, NSImage *>, void *>; struct __hash_node<std::__1::__hash_value_type<NSString *__unsafe_unretained, std::__1::vector<NSImage *, std::__1::allocator<NSImage *>>>, void *>; struct __hash_node<std::__1::__hash_value_type<unsigned long long, XRBookmark>, void *>; struct _opaque_pthread_mutex_t { long long __sig; char __opaque[56]; }; struct _opaque_pthread_rwlock_t { long long __sig; char __opaque[192]; }; struct set<unsigned long long, std::__1::less<unsigned long long>, std::__1::allocator<unsigned long long>> { struct __tree<unsigned long long, std::__1::less<unsigned long long>, std::__1::allocator<unsigned long long>> { struct __tree_node<unsigned long long, void *> *__begin_node_; struct __compressed_pair<std::__1::__tree_end_node<std::__1::__tree_node_base<void *>*>, std::__1::allocator<std::__1::__tree_node<unsigned long long, void *>>> { struct __tree_end_node<std::__1::__tree_node_base<void *>*> { struct __tree_node_base<void *> *__left_; } __first_; } __pair1_; struct __compressed_pair<unsigned long, std::__1::less<unsigned long long>> { unsigned long long __first_; } __pair3_; } __tree_; }; struct unique_ptr<std::__1::__hash_node<std::__1::__hash_value_type<IconLookup_t, NSImage *>, void *>*[], std::__1::__bucket_list_deallocator<std::__1::allocator<std::__1::__hash_node<std::__1::__hash_value_type<IconLookup_t, NSImage *>, void *>*>>> { struct __compressed_pair<std::__1::__hash_node<std::__1::__hash_value_type<IconLookup_t, NSImage *>, void *>**, std::__1::__bucket_list_deallocator<std::__1::allocator<std::__1::__hash_node<std::__1::__hash_value_type<IconLookup_t, NSImage *>, void *>*>>> { struct __hash_node<std::__1::__hash_value_type<IconLookup_t, NSImage *>, void *> **__first_; struct __bucket_list_deallocator<std::__1::allocator<std::__1::__hash_node<std::__1::__hash_value_type<IconLookup_t, NSImage *>, void *>*>> { struct __compressed_pair<unsigned long, std::__1::allocator<std::__1::__hash_node<std::__1::__hash_value_type<IconLookup_t, NSImage *>, void *>*>> { unsigned long long __first_; } __data_; } __second_; } __ptr_; }; struct unique_ptr<std::__1::__hash_node<std::__1::__hash_value_type<NSString *__unsafe_unretained, std::__1::vector<NSImage *, std::__1::allocator<NSImage *>>>, void *>*[], std::__1::__bucket_list_deallocator<std::__1::allocator<std::__1::__hash_node<std::__1::__hash_value_type<NSString *__unsafe_unretained, std::__1::vector<NSImage *, std::__1::allocator<NSImage *>>>, void *>*>>> { struct __compressed_pair<std::__1::__hash_node<std::__1::__hash_value_type<NSString *__unsafe_unretained, std::__1::vector<NSImage *, std::__1::allocator<NSImage *>>>, void *>**, std::__1::__bucket_list_deallocator<std::__1::allocator<std::__1::__hash_node<std::__1::__hash_value_type<NSString *__unsafe_unretained, std::__1::vector<NSImage *, std::__1::allocator<NSImage *>>>, void *>*>>> { struct __hash_node<std::__1::__hash_value_type<NSString *__unsafe_unretained, std::__1::vector<NSImage *, std::__1::allocator<NSImage *>>>, void *> **__first_; struct __bucket_list_deallocator<std::__1::allocator<std::__1::__hash_node<std::__1::__hash_value_type<NSString *__unsafe_unretained, std::__1::vector<NSImage *, std::__1::allocator<NSImage *>>>, void *>*>> { struct __compressed_pair<unsigned long, std::__1::allocator<std::__1::__hash_node<std::__1::__hash_value_type<NSString *__unsafe_unretained, std::__1::vector<NSImage *, std::__1::allocator<NSImage *>>>, void *>*>> { unsigned long long __first_; } __data_; } __second_; } __ptr_; }; struct unique_ptr<std::__1::__hash_node<std::__1::__hash_value_type<unsigned long long, XRBookmark>, void *>*[], std::__1::__bucket_list_deallocator<std::__1::allocator<std::__1::__hash_node<std::__1::__hash_value_type<unsigned long long, XRBookmark>, void *>*>>> { struct __compressed_pair<std::__1::__hash_node<std::__1::__hash_value_type<unsigned long long, XRBookmark>, void *>**, std::__1::__bucket_list_deallocator<std::__1::allocator<std::__1::__hash_node<std::__1::__hash_value_type<unsigned long long, XRBookmark>, void *>*>>> { struct __hash_node<std::__1::__hash_value_type<unsigned long long, XRBookmark>, void *> **_field1; struct __bucket_list_deallocator<std::__1::allocator<std::__1::__hash_node<std::__1::__hash_value_type<unsigned long long, XRBookmark>, void *>*>> { struct __compressed_pair<unsigned long, std::__1::allocator<std::__1::__hash_node<std::__1::__hash_value_type<unsigned long long, XRBookmark>, void *>*>> { unsigned long long _field1; } _field1; } _field2; } _field1; }; struct unordered_map<IconLookup_t, NSImage *, std::__1::hash<IconLookup_t>, std::__1::equal_to<IconLookup_t>, std::__1::allocator<std::__1::pair<const IconLookup_t, NSImage *>>> { struct __hash_table<std::__1::__hash_value_type<IconLookup_t, NSImage *>, std::__1::__unordered_map_hasher<IconLookup_t, std::__1::__hash_value_type<IconLookup_t, NSImage *>, std::__1::hash<IconLookup_t>, true>, std::__1::__unordered_map_equal<IconLookup_t, std::__1::__hash_value_type<IconLookup_t, NSImage *>, std::__1::equal_to<IconLookup_t>, true>, std::__1::allocator<std::__1::__hash_value_type<IconLookup_t, NSImage *>>> { struct unique_ptr<std::__1::__hash_node<std::__1::__hash_value_type<IconLookup_t, NSImage *>, void *>*[], std::__1::__bucket_list_deallocator<std::__1::allocator<std::__1::__hash_node<std::__1::__hash_value_type<IconLookup_t, NSImage *>, void *>*>>> __bucket_list_; struct __compressed_pair<std::__1::__hash_node_base<std::__1::__hash_node<std::__1::__hash_value_type<IconLookup_t, NSImage *>, void *>*>, std::__1::allocator<std::__1::__hash_node<std::__1::__hash_value_type<IconLookup_t, NSImage *>, void *>>> { struct __hash_node_base<std::__1::__hash_node<std::__1::__hash_value_type<IconLookup_t, NSImage *>, void *>*> { struct __hash_node<std::__1::__hash_value_type<IconLookup_t, NSImage *>, void *> *__next_; } __first_; } __p1_; struct __compressed_pair<unsigned long, std::__1::__unordered_map_hasher<IconLookup_t, std::__1::__hash_value_type<IconLookup_t, NSImage *>, std::__1::hash<IconLookup_t>, true>> { unsigned long long __first_; } __p2_; struct __compressed_pair<float, std::__1::__unordered_map_equal<IconLookup_t, std::__1::__hash_value_type<IconLookup_t, NSImage *>, std::__1::equal_to<IconLookup_t>, true>> { float __first_; } __p3_; } __table_; }; struct unordered_map<NSString *__unsafe_unretained, std::__1::vector<NSImage *, std::__1::allocator<NSImage *>>, std::__1::hash<NSString *__unsafe_unretained>, std::__1::equal_to<NSString *__unsafe_unretained>, std::__1::allocator<std::__1::pair<NSString *const __unsafe_unretained, std::__1::vector<NSImage *, std::__1::allocator<NSImage *>>>>> { struct __hash_table<std::__1::__hash_value_type<NSString *__unsafe_unretained, std::__1::vector<NSImage *, std::__1::allocator<NSImage *>>>, std::__1::__unordered_map_hasher<NSString *__unsafe_unretained, std::__1::__hash_value_type<NSString *__unsafe_unretained, std::__1::vector<NSImage *, std::__1::allocator<NSImage *>>>, std::__1::hash<NSString *__unsafe_unretained>, true>, std::__1::__unordered_map_equal<NSString *__unsafe_unretained, std::__1::__hash_value_type<NSString *__unsafe_unretained, std::__1::vector<NSImage *, std::__1::allocator<NSImage *>>>, std::__1::equal_to<NSString *__unsafe_unretained>, true>, std::__1::allocator<std::__1::__hash_value_type<NSString *__unsafe_unretained, std::__1::vector<NSImage *, std::__1::allocator<NSImage *>>>>> { struct unique_ptr<std::__1::__hash_node<std::__1::__hash_value_type<NSString *__unsafe_unretained, std::__1::vector<NSImage *, std::__1::allocator<NSImage *>>>, void *>*[], std::__1::__bucket_list_deallocator<std::__1::allocator<std::__1::__hash_node<std::__1::__hash_value_type<NSString *__unsafe_unretained, std::__1::vector<NSImage *, std::__1::allocator<NSImage *>>>, void *>*>>> __bucket_list_; struct __compressed_pair<std::__1::__hash_node_base<std::__1::__hash_node<std::__1::__hash_value_type<NSString *__unsafe_unretained, std::__1::vector<NSImage *, std::__1::allocator<NSImage *>>>, void *>*>, std::__1::allocator<std::__1::__hash_node<std::__1::__hash_value_type<NSString *__unsafe_unretained, std::__1::vector<NSImage *, std::__1::allocator<NSImage *>>>, void *>>> { struct __hash_node_base<std::__1::__hash_node<std::__1::__hash_value_type<NSString *__unsafe_unretained, std::__1::vector<NSImage *, std::__1::allocator<NSImage *>>>, void *>*> { struct __hash_node<std::__1::__hash_value_type<NSString *__unsafe_unretained, std::__1::vector<NSImage *, std::__1::allocator<NSImage *>>>, void *> *__next_; } __first_; } __p1_; struct __compressed_pair<unsigned long, std::__1::__unordered_map_hasher<NSString *__unsafe_unretained, std::__1::__hash_value_type<NSString *__unsafe_unretained, std::__1::vector<NSImage *, std::__1::allocator<NSImage *>>>, std::__1::hash<NSString *__unsafe_unretained>, true>> { unsigned long long __first_; } __p2_; struct __compressed_pair<float, std::__1::__unordered_map_equal<NSString *__unsafe_unretained, std::__1::__hash_value_type<NSString *__unsafe_unretained, std::__1::vector<NSImage *, std::__1::allocator<NSImage *>>>, std::__1::equal_to<NSString *__unsafe_unretained>, true>> { float __first_; } __p3_; } __table_; }; struct unordered_map<unsigned long long, XRBookmark, std::__1::hash<unsigned long long>, std::__1::equal_to<unsigned long long>, std::__1::allocator<std::__1::pair<const unsigned long long, XRBookmark>>> { struct __hash_table<std::__1::__hash_value_type<unsigned long long, XRBookmark>, std::__1::__unordered_map_hasher<unsigned long long, std::__1::__hash_value_type<unsigned long long, XRBookmark>, std::__1::hash<unsigned long long>, true>, std::__1::__unordered_map_equal<unsigned long long, std::__1::__hash_value_type<unsigned long long, XRBookmark>, std::__1::equal_to<unsigned long long>, true>, std::__1::allocator<std::__1::__hash_value_type<unsigned long long, XRBookmark>>> { struct unique_ptr<std::__1::__hash_node<std::__1::__hash_value_type<unsigned long long, XRBookmark>, void *>*[], std::__1::__bucket_list_deallocator<std::__1::allocator<std::__1::__hash_node<std::__1::__hash_value_type<unsigned long long, XRBookmark>, void *>*>>> _field1; struct __compressed_pair<std::__1::__hash_node_base<std::__1::__hash_node<std::__1::__hash_value_type<unsigned long long, XRBookmark>, void *>*>, std::__1::allocator<std::__1::__hash_node<std::__1::__hash_value_type<unsigned long long, XRBookmark>, void *>>> { struct __hash_node_base<std::__1::__hash_node<std::__1::__hash_value_type<unsigned long long, XRBookmark>, void *>*> { struct __hash_node<std::__1::__hash_value_type<unsigned long long, XRBookmark>, void *> *_field1; } _field1; } _field2; struct __compressed_pair<unsigned long, std::__1::__unordered_map_hasher<unsigned long long, std::__1::__hash_value_type<unsigned long long, XRBookmark>, std::__1::hash<unsigned long long>, true>> { unsigned long long _field1; } _field3; struct __compressed_pair<float, std::__1::__unordered_map_equal<unsigned long long, std::__1::__hash_value_type<unsigned long long, XRBookmark>, std::__1::equal_to<unsigned long long>, true>> { float _field1; } _field4; } _field1; }; struct vector<XRBookmark, std::__1::allocator<XRBookmark>> { union XRBookmark *__begin_; union XRBookmark *__end_; struct __compressed_pair<XRBookmark *, std::__1::allocator<XRBookmark>> { union XRBookmark *__first_; } __end_cap_; }; #pragma mark Typedef'd Structures typedef struct { int type; int subtype; } CDStruct_3570f18b; // Template types typedef struct set<unsigned long long, std::__1::less<unsigned long long>, std::__1::allocator<unsigned long long>> { struct __tree<unsigned long long, std::__1::less<unsigned long long>, std::__1::allocator<unsigned long long>> { struct __tree_node<unsigned long long, void *> *__begin_node_; struct __compressed_pair<std::__1::__tree_end_node<std::__1::__tree_node_base<void *>*>, std::__1::allocator<std::__1::__tree_node<unsigned long long, void *>>> { struct __tree_end_node<std::__1::__tree_node_base<void *>*> { struct __tree_node_base<void *> *__left_; } __first_; } __pair1_; struct __compressed_pair<unsigned long, std::__1::less<unsigned long long>> { unsigned long long __first_; } __pair3_; } __tree_; } set_96bcc9b8; typedef struct vector<XRBookmark, std::__1::allocator<XRBookmark>> { union XRBookmark *__begin_; union XRBookmark *__end_; struct __compressed_pair<XRBookmark *, std::__1::allocator<XRBookmark>> { union XRBookmark *__first_; } __end_cap_; } vector_59b01178; #pragma mark Named Unions union XRBookmark { struct { unsigned int _private:62; unsigned int userInfo:2; } content; unsigned long long opaque64BitValue; }; union _flagTableFilter_u { unsigned int _field1; struct _flagTableFilter { unsigned int :1; unsigned int :1; unsigned int :1; unsigned int :1; unsigned int :1; unsigned int :1; unsigned int :1; unsigned int :1; unsigned int :1; unsigned int :1; unsigned int :1; unsigned int :21; } _field2; }; #pragma mark - // // File: /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/Frameworks/InstrumentsKit.framework/Versions/A/InstrumentsKit // UUID: 6779816C-3312-3C8A-A1C3-66082B194CC6 // // Arch: x86_64 // Current version: 61529.0.0 // Compatibility version: 1.0.0 // Source version: 61529.0.0.0.0 // Minimum Mac OS X version: 10.10.0 // SDK version: 10.12.0 // // Objective-C Garbage Collection: Unsupported // // Run path: @loader_path/../../../ // = /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/Frameworks // Run path: @loader_path/../../../../../../../SharedFrameworks // = /Applications/Xcode.app/Contents/SharedFrameworks // @interface XRNonInteractiveModeViewController : NSViewController { NSProgress *_progress; NSTimer *_updatePollTimer; } - (void).cxx_destruct; - (void)_poll:(id)arg1; - (void)setProgress:(id)arg1; - (void)viewDidDisappear; - (void)viewWillAppear; - (void)dealloc; @end @interface XRDetailViewFatalErrorViewController : NSViewController { NSString *_reasonString; NSTextField *_reasonField; } @property __weak NSTextField *reasonField; // @synthesize reasonField=_reasonField; @property(copy, nonatomic) NSString *reasonString; // @synthesize reasonString=_reasonString; - (void).cxx_destruct; - (void)viewWillAppear; - (void)viewDidLoad; - (id)init; @end @interface XRCPUTimelineAccessibilityElement : XRAccessibilityElement <NSAccessibilityTable> { XRCPUStrategyUIController *_UIController; NSMutableArray *_rows; } - (void).cxx_destruct; - (struct CGRect)accessibilityFrame; - (id)accessibilityParent; - (id)accessibilityRows; - (id)accessibilityLabel; - (id)accessibilityChildren; - (void)rebuild; - (id)initWithCPUStrategyUIController:(id)arg1; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRTrackViewItemViewController : XRTouchBarItemViewController <DTTimelineGraphDelegate, XRSupportsPFTWindowController, XRLazyKVOResponder> { BOOL _movingLeftHandle; BOOL _movingRightHandle; BOOL _viewportHasBeenDragged; DTTimelineGraph *_graph; XRLazyKVOAdapter *_observationAdapter; NSImageView *_leftHandle; NSImageView *_rightHandle; NSImageView *_handleMiddle; DVTBorderedView *_leftOutsideViewportView; DVTBorderedView *_rightOutsideViewportView; NSLayoutConstraint *_leftHandleConstraint; NSLayoutConstraint *_rightHandleConstraint; NSPressGestureRecognizer *_pressGestureRecognizer; double _viewportCenterOffset; } @property(nonatomic) BOOL viewportHasBeenDragged; // @synthesize viewportHasBeenDragged=_viewportHasBeenDragged; @property(nonatomic) double viewportCenterOffset; // @synthesize viewportCenterOffset=_viewportCenterOffset; @property(nonatomic) BOOL movingRightHandle; // @synthesize movingRightHandle=_movingRightHandle; @property(nonatomic) BOOL movingLeftHandle; // @synthesize movingLeftHandle=_movingLeftHandle; @property(retain, nonatomic) NSPressGestureRecognizer *pressGestureRecognizer; // @synthesize pressGestureRecognizer=_pressGestureRecognizer; @property(retain, nonatomic) NSLayoutConstraint *rightHandleConstraint; // @synthesize rightHandleConstraint=_rightHandleConstraint; @property(retain, nonatomic) NSLayoutConstraint *leftHandleConstraint; // @synthesize leftHandleConstraint=_leftHandleConstraint; @property(retain, nonatomic) DVTBorderedView *rightOutsideViewportView; // @synthesize rightOutsideViewportView=_rightOutsideViewportView; @property(retain, nonatomic) DVTBorderedView *leftOutsideViewportView; // @synthesize leftOutsideViewportView=_leftOutsideViewportView; @property(retain, nonatomic) NSImageView *handleMiddle; // @synthesize handleMiddle=_handleMiddle; @property(retain, nonatomic) NSImageView *rightHandle; // @synthesize rightHandle=_rightHandle; @property(retain, nonatomic) NSImageView *leftHandle; // @synthesize leftHandle=_leftHandle; @property(retain, nonatomic) XRLazyKVOAdapter *observationAdapter; // @synthesize observationAdapter=_observationAdapter; @property(retain, nonatomic) DTTimelineGraph *graph; // @synthesize graph=_graph; - (void).cxx_destruct; - (void)_rescaleGraph; - (void)_syncTimeline; - (void)_rebuildTimeline; - (void)_addHandleToContainerView:(id)arg1; - (id)_imageViewWithImageNamed:(id)arg1 containerView:(id)arg2; - (id)_buildView; - (void)_centerViewportOnPoint:(struct CGPoint)arg1 offset:(double)arg2; - (void)_matchMainGraphToHandles; - (void)_moveLeftHandleToPoint:(struct CGPoint)arg1; - (void)_moveRightHandleToPoint:(struct CGPoint)arg1; - (double)_viewportCenter; - (BOOL)_pointHitsLeftHandle:(struct CGPoint)arg1; - (BOOL)_pointHitsRightHandle:(struct CGPoint)arg1; - (BOOL)_pointHitsWithinViewport:(struct CGPoint)arg1; - (void)handlePressGesture:(id)arg1; - (void)_coreSpaceNotification:(id)arg1; - (void)handleLazyKVOUpdate:(id)arg1; - (void)inputHandlerForGraph:(id)arg1 requestsHeight:(double)arg2 forPlane:(id)arg3; - (void)inputHandlerForGraph:(id)arg1 requestsCollapsingGroupPlane:(id)arg2; - (void)inputHandlerForGraph:(id)arg1 requestsExpandingGroupPlane:(id)arg2; - (void)inputHandlerRequestsToClearInspectionInfoForGraph:(id)arg1; - (void)inputHandlerForGraph:(id)arg1 requestsNanosecondsPerPoint:(unsigned long long)arg2; - (void)inputHandlerRequestsToClearCurrentInspectionTimeForGraph:(id)arg1; - (void)inputHandlerForGraph:(id)arg1 requestsCurrentInspectionTime:(unsigned long long)arg2; - (void)inputHandlerRequestsToClearSelectedTimeRangeForGraph:(id)arg1; - (void)inputHandlerDidFinishSelectionForGraph:(id)arg1; - (void)inputHandlerForGraph:(id)arg1 requestsSelectedTimeRange:(struct XRTimeRange)arg2; - (void)inputHandlerForGraph:(id)arg1 requestYOffset:(double)arg2; - (void)inputHandlerForGraph:(id)arg1 requestsNanosecondOffset:(long long)arg2; - (void)loadView; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly, nonatomic) PFTWindowController *pftWindowController; // @dynamic pftWindowController; @property(readonly) Class superclass; @end @interface XRTargetChooserPathControl : NSPathControl <XRAccessiblePathCellDelegate> { NSMutableDictionary *_deviceToComponentCellMap; XRDevice *_device; BOOL _allowNilDevice; } + (Class)cellClass; + (unsigned long long)defaultFocusRingType; @property(readonly, nonatomic) BOOL allowNilDevice; // @synthesize allowNilDevice=_allowNilDevice; - (void).cxx_destruct; - (id)pathCell:(id)arg1 accessibilityDescriptionForPathComponentCell:(id)arg2 atIndex:(unsigned long long)arg3; - (id)accessibilityPopUpMenuParent:(id)arg1; - (struct CGSize)sizeWanted; - (id)menuForEvent:(id)arg1; - (BOOL)isOpaque; - (void)setMenu:(id)arg1; - (void)setFont:(id)arg1; @property(nonatomic) int gradientStyle; - (void)setEnabled:(BOOL)arg1; - (void)reconfigureWithContext:(id)arg1 controlSize:(unsigned long long)arg2 allowNilDevice:(BOOL)arg3; - (BOOL)_isTargetSelectable:(id)arg1; - (BOOL)_shouldShowProcesses:(id)arg1; - (BOOL)_isDeviceSelectable:(id)arg1; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRFlagsNavigatorControl : NSSegmentedControl <NSMenuDelegate> { BOOL _isSetup; XRManagedObjectList *_flags; BOOL _observingFlags; NSMenu *_previousMenu; NSMenu *_nextMenu; } - (void).cxx_destruct; - (void)_flagChosen:(id)arg1; - (void)menuNeedsUpdate:(id)arg1; - (void)_segmentClicked:(id)arg1; - (void)viewDidMoveToWindow; - (void)observeValueForKeyPath:(id)arg1 ofObject:(id)arg2 change:(id)arg3 context:(void *)arg4; - (void)setFlags:(id)arg1; - (void)_updateControl; - (void)viewWillMoveToSuperview:(id)arg1; - (void)dealloc; - (id)initWithFrame:(struct CGRect)arg1 flags:(id)arg2; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRTimelineItemAccessibilityElement : XRAccessibilityElement <NSAccessibilityRow> { XRInstrument *_instrument; NSAccessibilityElement *_parent; XRInstrumentsStrategyUIController *_UIController; long long _index; NSAccessibilityElement *_statusMessage; XRInstrumentStrategyTopLevelItem *_topLevelItem; NSAccessibilityElement *_displayName; } + (id)elementsFromTopLevelItem:(id)arg1 instrument:(id)arg2 index:(long long)arg3 parent:(id)arg4 controller:(id)arg5; @property(readonly, nonatomic) __weak XRInstrument *instrument; // @synthesize instrument=_instrument; @property(retain, nonatomic) NSAccessibilityElement *displayName; // @synthesize displayName=_displayName; @property(readonly, nonatomic) __weak XRInstrumentStrategyTopLevelItem *topLevelItem; // @synthesize topLevelItem=_topLevelItem; - (void).cxx_destruct; - (id)accessibilityChildren; - (struct CGPoint)accessibilityActivationPoint; - (void)setAccessibilityDisclosed:(BOOL)arg1; - (BOOL)isAccessibilityDisclosed; - (id)accessibilityLabel; - (struct CGRect)accessibilityFrame; - (id)accessibilityParent; - (id)accessibilitySubrole; - (long long)accessibilityDisclosureLevel; - (long long)accessibilityIndex; - (id)initWithTopLevelItem:(id)arg1 instrument:(id)arg2 index:(long long)arg3 parent:(id)arg4 controller:(id)arg5; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRTimelineInstrumentNoRunsAccessibilityElement : XRTimelineItemAccessibilityElement { } - (id)accessibilityChildren; @end @interface XRTimelineRunAccessibilityElement : XRTimelineItemAccessibilityElement { DTTimelinePlane *_plane; BOOL _firstItem; XRTimelineRunTableAccessibilityElement *_table; } - (void).cxx_destruct; - (id)accessibilityChildren; - (id)accessibilityLabel; - (struct CGRect)accessibilityFrame; - (BOOL)isAccessibilitySelectorAllowed:(SEL)arg1; - (long long)accessibilityDisclosureLevel; - (id)initWithTopLevelItem:(id)arg1 instrument:(id)arg2 index:(long long)arg3 parent:(id)arg4 controller:(id)arg5 plane:(id)arg6 firstItem:(BOOL)arg7; @end @interface XRTimelineRunTableAccessibilityElement : XRAccessibilityElement <NSAccessibilityTable> { DTTimelineGroupPlane *_groupPlane; NSAccessibilityElement *_parent; NSMutableArray *_rows; } - (void).cxx_destruct; - (struct CGRect)accessibilityFrame; - (id)accessibilityParent; - (id)accessibilityLabel; - (id)accessibilityRows; - (id)accessibilityChildren; - (id)initWithGroupPlane:(id)arg1 parent:(id)arg2; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRTimelineRunTableRowAccessilblityElement : XRAccessibilityElement <NSAccessibilityRow> { DTTimelinePlane *_plane; long long _index; NSMutableArray *_children; NSAccessibilityElement *_parent; } - (void).cxx_destruct; - (id)accessibilityChildren; - (id)accessibilityParent; - (struct CGRect)accessibilityFrame; - (long long)accessibilityIndex; - (void)rebuild; - (id)initWithPlane:(id)arg1 index:(long long)arg2 parent:(id)arg3; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRTimelineRunLabelAccessibilityElement : XRAccessibilityElement { DTTimelinePlane *_plane; } - (void).cxx_destruct; - (struct CGRect)accessibilityFrame; - (id)initWithPlane:(id)arg1; @end @interface XRProgressView : PFTNibView { XRProgressViewIndicator *_progressIndicator; NSTextField *_title; NSButton *_cancelButton; XRWorkTracker *_workTracker; BOOL _closeAsModalWindow; BOOL _closeAsynchronously; } + (id)startProgressWithWorkTracker:(id)arg1; + (id)panelWithWorkTracker:(id)arg1; + (id)windowWithWorkTracker:(id)arg1; @property(nonatomic) BOOL closeAsynchronously; // @synthesize closeAsynchronously=_closeAsynchronously; - (void).cxx_destruct; - (BOOL)closeAsModalWindow; - (void)setCloseAsModalWindow:(BOOL)arg1; - (void)setFutureValue:(unsigned long long)arg1; - (void)cancelWork:(id)arg1; - (void)observeValueForKeyPath:(id)arg1 ofObject:(id)arg2 change:(id)arg3 context:(void *)arg4; - (void)dealloc; - (id)initWithWorkTracker:(id)arg1; @end @interface XRProgressViewIndicator : NSProgressIndicator { double _futureValue; double _futureMarkValue; NSLock *_futureValueLock; } - (void).cxx_destruct; - (void)setFutureValue:(double)arg1; - (void)_animationIdler:(id)arg1; @end @interface XRPlaceholderView : NSView { NSView *_contentView; } @property(nonatomic) __weak NSView *contentView; // @synthesize contentView=_contentView; - (void).cxx_destruct; @end @interface XRRecordingOptionsViewController : NSViewController { XRTrace *_trace; DVTBorderedView *_borderView; NSTextField *_timeLimitTextField; NSTextField *_windowLimitTextField; NSButton *_deferredModeCheckbox; NSButton *_closeButton; XRRecordingOptions *_recordingOptions; } @property(retain, nonatomic) XRRecordingOptions *recordingOptions; // @synthesize recordingOptions=_recordingOptions; @property __weak NSButton *closeButton; // @synthesize closeButton=_closeButton; @property __weak NSButton *deferredModeCheckbox; // @synthesize deferredModeCheckbox=_deferredModeCheckbox; @property __weak NSTextField *windowLimitTextField; // @synthesize windowLimitTextField=_windowLimitTextField; @property __weak NSTextField *timeLimitTextField; // @synthesize timeLimitTextField=_timeLimitTextField; @property __weak DVTBorderedView *borderView; // @synthesize borderView=_borderView; @property(nonatomic) __weak XRTrace *trace; // @synthesize trace=_trace; - (void).cxx_destruct; - (void)_dismiss; - (void)ok:(id)arg1; - (void)windowLimitChanged:(id)arg1; - (void)timeLimitChanged:(id)arg1; - (void)deferredClicked:(id)arg1; - (void)_updateUIControls; - (void)viewDidLoad; - (id)init; @end @interface XRThreadsTimelineAccessibilityElement : XRAccessibilityElement <NSAccessibilityTable> { XRThreadsStrategyUIController *_UIController; NSMutableArray *_rows; } - (void).cxx_destruct; - (struct CGRect)accessibilityFrame; - (id)accessibilityParent; - (id)accessibilityRows; - (id)accessibilityLabel; - (id)accessibilityChildren; - (void)rebuild; - (id)initWithThreadsStrategyUIController:(id)arg1; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRSourceListView : NSOutlineView { } - (id)preparedCellAtColumn:(long long)arg1 row:(long long)arg2; - (id)selectedSourceListCellAttributesWithDefaults:(id)arg1; - (id)_groupCellAttributesWithDefaults:(id)arg1 highlighted:(BOOL)arg2; - (id)_titleFont; - (struct CGRect)frameOfOutlineCellAtRow:(long long)arg1; @end @interface XRTouchBarController : NSObject <NSTouchBarDelegate> { NSWindowController *_windowController; XRInstrumentListPopoverController *_popoverController; } @property(retain, nonatomic) XRInstrumentListPopoverController *popoverController; // @synthesize popoverController=_popoverController; @property(readonly, nonatomic) __weak NSWindowController *windowController; // @synthesize windowController=_windowController; - (void).cxx_destruct; - (id)touchBar:(id)arg1 makeItemForIdentifier:(id)arg2; - (id)initWithWindowController:(id)arg1; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRAnalysisCoreBackingDetailView : NSView { NSView *_embeddedSubview; NSBitmapImageRep *_frozenOutImage; struct CGRect _frozenImageRect; CIFilter *_outFilter; BOOL _frozen; BOOL _busy; } - (void).cxx_destruct; - (void)drawRect:(struct CGRect)arg1; - (BOOL)isOpaque; - (void)setBusy:(BOOL)arg1; - (void)embedSubview:(id)arg1; - (void)freezeAndRemoveEmbeddedView; @end @interface XRDefaultHostingStrategyUIController : XRStrategyUIController <XRLazyKVOResponder> { XRLazyKVOAdapter *_defaultStratAdapter; XRInstrumentsStrategyUIController *_defaultStrategyUI; } @property(retain, nonatomic) XRInstrumentsStrategyUIController *defaultStrategyUI; // @synthesize defaultStrategyUI=_defaultStrategyUI; - (void).cxx_destruct; - (void)inspectionClickAtTime:(unsigned long long)arg1 planes:(id)arg2; - (void)_setModelSelection:(id)arg1; - (void)_selectBottomPinnedPlane; - (void)handleLazyKVOUpdate:(id)arg1; - (BOOL)_isInstrumentTrackSelected; - (void)didSetInspectionTime:(unsigned long long)arg1; - (void)didChangeUpdateFilterForRunNumber:(long long)arg1; - (id)selectionIcon; - (void)_resolutionDidChange; - (void)expireLoanedDetailArea; - (void)lendDetailAreaToView:(id)arg1 context:(id)arg2; - (void)setExtendedDetailModel:(id)arg1; - (void)setDetailHostView:(id)arg1; - (void)_handleConsolidatedModelRefresh; - (void)_rebuildInstrumentSelectionMenu; - (void)_resetBottomPlane; - (void)setModel:(id)arg1; - (id)selectionDetailsFilteredDataSource; - (id)selectionDetailContext; - (id)init; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end __attribute__((visibility("hidden"))) @interface XRAnalysisCoreConnectionIntervalDecoratorHandler : NSObject <XRAnalysisCoreQueryHandler> { struct _opaque_pthread_mutex_t _lock; struct DTTimelineDecorationContainer *_container; XRAnalysisCoreConnectionIntervalModel *_model; unsigned char _timeColumnID; unsigned char _durationColumnID; unsigned char _uuidColumnID; unsigned char _filterColumnID; XRAnalysisCoreUIPlanEngineeringTypeOverride *_engineeringTypeOverride; set_96bcc9b8 *_highlightUUIDs; } - (void).cxx_destruct; - (void)reduceFromLocalResults:(id)arg1; - (void)runWorkgroup:(unsigned short)arg1 of:(unsigned int)arg2 withLocalResults:(id)arg3 context:(id)arg4 rowIterator:(struct XRAnalysisCoreReadCursor *)arg5; - (void)dealloc; - (id)initWithContainer:(struct DTTimelineDecorationContainer *)arg1 columnMap:(id)arg2 model:(id)arg3 engineeringTypeOverride:(id)arg4 highlightUUIDs:(set_96bcc9b8 *)arg5; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end __attribute__((visibility("hidden"))) @interface XRAnalysisCoreConnectionIntervalDecorator : DTTimelineDecorator { unsigned int _tableID; unsigned char _uuidColumnID; unsigned char _sourceUUIDColumnID; unsigned char _sinkUUIDColumnID; unsigned char _metadataColumnID; unsigned char _filterColumnID; unsigned char _colorColumnID; XRTheme *_theme; set_96bcc9b8 _highlightUUIDs; struct _opaque_pthread_rwlock_t _imageRdWrLock; struct unordered_map<NSString *__unsafe_unretained, std::__1::vector<NSImage *, std::__1::allocator<NSImage *>>, std::__1::hash<NSString *__unsafe_unretained>, std::__1::equal_to<NSString *__unsafe_unretained>, std::__1::allocator<std::__1::pair<NSString *const __unsafe_unretained, std::__1::vector<NSImage *, std::__1::allocator<NSImage *>>>>> _imageCache; XRTrace *_trace; long long _runNumber; XRAnalysisCoreConnectionIntervalModel *_model; unsigned long long _filterValue; } @property(nonatomic) unsigned long long filterValue; // @synthesize filterValue=_filterValue; @property(retain, nonatomic) XRAnalysisCoreConnectionIntervalModel *model; // @synthesize model=_model; @property(nonatomic) long long runNumber; // @synthesize runNumber=_runNumber; @property(nonatomic) unsigned int tableID; // @synthesize tableID=_tableID; @property(nonatomic) __weak XRTrace *trace; // @synthesize trace=_trace; - (id).cxx_construct; - (void).cxx_destruct; - (id)decorateInspectionRanges:(id)arg1; - (void)decorateContainer:(struct DTTimelineDecorationContainer *)arg1 qualityOfService:(unsigned int)arg2 priority:(int)arg3 group:(id)arg4; - (void)clearAllHighlights; - (void)applyHighlightsForUUIDs:(const unsigned long long *)arg1 count:(unsigned int)arg2; - (void)setDefaultsForPlane:(id)arg1; - (void)_getImage:(id *)arg1 forType:(unsigned char)arg2 andImage:(id *)arg3 forType:(unsigned char)arg4 withColorNamed:(id)arg5; - (void)dealloc; - (id)initWithTableID:(unsigned int)arg1; @end @interface XRSourceListCell : NSTextFieldCell { NSImage *_image; double _imageAreaWidth; BOOL _drawImage; double _xHeight; int _background; } - (void).cxx_destruct; - (unsigned long long)hitTestForEvent:(id)arg1 inRect:(struct CGRect)arg2 ofView:(id)arg3; - (void)drawWithFrame:(struct CGRect)arg1 inView:(id)arg2; - (void)selectWithFrame:(struct CGRect)arg1 inView:(id)arg2 editor:(id)arg3 delegate:(id)arg4 start:(long long)arg5 length:(long long)arg6; - (void)editWithFrame:(struct CGRect)arg1 inView:(id)arg2 editor:(id)arg3 delegate:(id)arg4 event:(id)arg5; - (struct CGSize)cellSizeForBounds:(struct CGRect)arg1; - (struct CGRect)titleRectForBounds:(struct CGRect)arg1; - (struct CGRect)imageRectForBounds:(struct CGRect)arg1; - (int)background; - (void)setBackground:(int)arg1; - (void)setFont:(id)arg1; - (void)setImageAreaWidth:(double)arg1; - (double)imageAreaWidth; - (void)setImage:(id)arg1; - (BOOL)drawsImage; - (void)setDrawsImage:(BOOL)arg1; - (id)image; - (BOOL)isEditable; - (BOOL)isSelectable; - (BOOL)isEnabled; - (BOOL)isHighlighted; - (id)copyWithZone:(struct _NSZone *)arg1; - (id)initImageCell:(id)arg1; - (id)init; - (id)initTextCell:(id)arg1; - (void)_sharedOutlineViewCellInit; @end @interface XRFileSystemBrowserPreviewViewController : NSViewController { id <XRFileSystem> _fileSystem; } @property(retain) id <XRFileSystem> fileSystem; // @synthesize fileSystem=_fileSystem; - (void).cxx_destruct; @property(readonly) NSImage *representedItemIcon; @property(readonly) NSString *representedItemFilename; @end @interface XRActivityTextLayer : DVTTextLayer { NSDictionary *_textAttributes; } @property(copy, nonatomic) NSDictionary *textAttributes; // @synthesize textAttributes=_textAttributes; - (void).cxx_destruct; - (void)setString:(id)arg1; @property(readonly) NSDictionary *currentTextAttributes; - (id)effectiveAttributes; @end @interface XRShowHideDetailToolbarItem : XRToolbarItem { } - (void)_segmentedControlClicked:(id)arg1; - (void)disconnectFromContext; - (void)connectToContext:(id)arg1; - (id)_createSegmentedControl; - (void)observeValueForKeyPath:(id)arg1 ofObject:(id)arg2 change:(id)arg3 context:(void *)arg4; @end @interface XRLibraryPopoverViewController : DVTViewController <NSPopoverDelegate> { NSPopover *_popover; DVTReplacementView *_replacementView; NSView *_relativeView; } @property(nonatomic) __weak NSView *relativeView; // @synthesize relativeView=_relativeView; @property __weak DVTReplacementView *replacementView; // @synthesize replacementView=_replacementView; @property(retain) NSPopover *popover; // @synthesize popover=_popover; - (void).cxx_destruct; - (void)popoverDidShow:(id)arg1; - (void)togglePopover:(id)arg1; - (void)hidePopover; - (void)displayPopoverRelativeToView:(id)arg1; - (void)loadView; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRFlagDecorator : DTTimelineDecorator { XRFlagController *_controller; } - (void).cxx_destruct; - (BOOL)mustDecorateOnMainThread; - (id)decorateContainer:(struct DTTimelineDecorationContainer *)arg1; - (void)setDefaultsForPlane:(id)arg1; - (id)initWithController:(id)arg1; @end @interface XRAnalysisCoreDetailViewController : NSViewController <XRLazyKVOResponder, XRAnalysisCoreCallTreeViewControllerDelegate, XRAnalysisCoreTableViewControllerDelegate, XRAnalysisCoreViewSubcontroller> { XRAnalysisCoreDetailNode *_displayedNode; XRAnalysisCoreDetailNode *_firstNode; NSMutableDictionary *_displayedStateByNodeName; NSArray *_currentContextChangeOps; NSTimer *_animationDelayTimer; XREngineeringTypeFormatter *_myEngFormatter; BOOL _viewsInTransition; BOOL _instrumentInvalid; XRLazyKVOAdapter *_kvoAdapter; XRModalViewController *_modalController; XRDetailViewFatalErrorViewController *_fatalErrorViewController; XRAnalysisCoreTableViewController *_tabularViewController; XRAnalysisCoreProjectionViewController *_projectionViewController; XRAnalysisCoreCallTreeViewController *_callTreeViewController; id <XRAnalysisCoreDetailViewControllerDelegate> _delegate; XRAnalysisCoreUIPlan *_plan; PFTTraceDocument *_traceDocument; long long _runNumber; XRInstrument *_instrument; XRStrategyContextObject *_strategyContext; NSScrollView *_tableScrollView; } @property(retain) NSScrollView *tableScrollView; // @synthesize tableScrollView=_tableScrollView; @property(retain, nonatomic) XRStrategyContextObject *strategyContext; // @synthesize strategyContext=_strategyContext; @property(nonatomic) __weak XRInstrument *instrument; // @synthesize instrument=_instrument; @property(nonatomic) long long runNumber; // @synthesize runNumber=_runNumber; @property(nonatomic) __weak PFTTraceDocument *traceDocument; // @synthesize traceDocument=_traceDocument; @property(retain, nonatomic) XRAnalysisCoreUIPlan *plan; // @synthesize plan=_plan; @property(nonatomic) __weak id <XRAnalysisCoreDetailViewControllerDelegate> delegate; // @synthesize delegate=_delegate; - (void).cxx_destruct; - (void)filterDetailWithTokens:(id)arg1 context:(id)arg2 matchesAny:(BOOL)arg3; - (id)selectedSearchContext; - (id)searchContexts; - (void)refineQueryBasedOnUIState:(id)arg1; - (void)callTreeViewControllerDidUpdateContext:(id)arg1; - (void)callTreeViewControllerWillUpdateContext:(id)arg1; - (id)currentCallTreeFilter; - (void)restoreDisplayStateFromTemplate:(id)arg1; - (id)savedDisplayStateForTemplates; - (void)focus:(id)arg1; - (unsigned int)_tableIDForSpec:(id)arg1 runNumber:(long long)arg2; - (void)clearCurrentDataContext; - (id)currentDataContext; - (id)_currentOutlineExtendedDetailMetaUI; - (void)handleLazyKVOUpdate:(id)arg1; - (id)currentRecordSettingsDetailMetaUI; - (id)currentDisplaySettingsDetailMetaUI; - (id)currentExtendedDetailMetaUI; - (void)instrumentDidChangeTableRequirements; - (void)instrumentDidChangeSwitches; - (void)tableViewController:(id)arg1 selectedAndEventAtTime:(unsigned long long)arg2; - (void)documentSetInspectionTime:(unsigned long long)arg1; - (void)documentDidUpdateFilter; - (void)displayContext:(id)arg1; - (unsigned long long)_validateNodeForCurrentImplementation:(id)arg1; - (void)_afterRebuildingUIPerformBlock:(CDUnknownBlockType)arg1; - (id)siblingsForContext:(id)arg1; - (id)contextRepresentation; - (id)viewForContext:(id)arg1; - (id)uuid; - (void)_detailFadeOut:(id)arg1; - (void)_setCurrentViewChangeOps:(id)arg1; - (void)eventHorizonAdvancedThroughRange:(struct XRTimeRange)arg1; - (void)viewDidAppear; - (void)loadView; - (void)dealloc; - (void)instrumentWillBecomeInvalid; - (id)initWithNibName:(id)arg1 bundle:(id)arg2; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRAnalysisCoreDetailNode : NSObject <NSSecureCoding> { XRAnalysisCoreDetailNode *_firstSibling; int _viewKind; NSString *_label; XRAnalysisCoreDetailNode *_parent; XRAnalysisCoreDetailNode *_nextSibling; XRAnalysisCoreTableQuery *_focusQuery; NSString *_planTemplateName; } + (BOOL)supportsSecureCoding; @property(nonatomic) int viewKind; // @synthesize viewKind=_viewKind; @property(retain, nonatomic) NSString *planTemplateName; // @synthesize planTemplateName=_planTemplateName; @property(retain, nonatomic) XRAnalysisCoreTableQuery *focusQuery; // @synthesize focusQuery=_focusQuery; @property(readonly, nonatomic) XRAnalysisCoreDetailNode *nextSibling; // @synthesize nextSibling=_nextSibling; @property(readonly, nonatomic) XRAnalysisCoreDetailNode *parent; // @synthesize parent=_parent; @property(readonly, nonatomic) NSString *label; // @synthesize label=_label; - (void).cxx_destruct; - (void)assignNewRoot:(id)arg1; - (id)root; @property(readonly, nonatomic, getter=isSelectable) BOOL selectable; @property(readonly, nonatomic) XRAnalysisCoreDetailNode *firstSibling; - (id)insertSiblingWithLabel:(id)arg1 parent:(id)arg2; - (void)encodeWithCoder:(id)arg1; - (id)initWithCoder:(id)arg1; - (id)initWithLabel:(id)arg1 firstSibling:(id)arg2 nextSibling:(id)arg3; - (id)initWithLabel:(id)arg1 parent:(id)arg2; - (id)initWithLabel:(id)arg1 viewKind:(int)arg2; - (id)initWithLabel:(id)arg1; - (id)initWithLabel:(id)arg1 parent:(id)arg2 firstSibling:(id)arg3 nextSibling:(id)arg4 focusQuery:(id)arg5 planTemplateName:(id)arg6 viewKind:(int)arg7; @end @interface XRInstrumentMenuController : NSObject <NSMenuDelegate> { BOOL _isInvalid; NSMenu *_menu; PFTDocumentController *_controller; } @property(nonatomic) __weak PFTDocumentController *controller; // @synthesize controller=_controller; @property(nonatomic) __weak NSMenu *menu; // @synthesize menu=_menu; - (void).cxx_destruct; - (BOOL)validateMenuItem:(id)arg1; - (void)setControllerNeedsUpdate; - (void)_invokeRefreshMenuItems; - (void)_metaUIInvokeAction:(id)arg1; - (void)_handleInstrumentStateChange:(id)arg1; - (void)dealloc; - (id)init; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRTextEntryPanel : PFTNibView { NSTextField *_titleField; NSTextField *_entryField; } - (void).cxx_destruct; - (void)keyDown:(id)arg1; - (void)setTextValue:(id)arg1; - (id)textValue; - (void)cancel:(id)arg1; - (void)cancelOperation:(id)arg1; - (void)cancelAction:(id)arg1; - (void)okAction:(id)arg1; @end @interface XRSnapToFitItemViewController : XRTouchBarItemViewController <XRLazyKVOResponder, XRSupportsPFTWindowController> { XRLazyKVOAdapter *_observationAdapter; struct XRSnapToFitUndoInfo _undoInfo; } @property(nonatomic) struct XRSnapToFitUndoInfo undoInfo; // @synthesize undoInfo=_undoInfo; @property(readonly, nonatomic) XRLazyKVOAdapter *observationAdapter; // @synthesize observationAdapter=_observationAdapter; - (void).cxx_destruct; - (void)_resetUndoInfo; - (void)_snapToFit:(id)arg1; - (id)_snapToFitButton; - (id)_buildSnapToFitButton; - (void)_updateButtonAndUndoState; - (void)handleLazyKVOUpdate:(id)arg1; - (void)dealloc; - (void)loadView; - (id)initWithWindowController:(id)arg1; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly, nonatomic) PFTWindowController *pftWindowController; // @dynamic pftWindowController; @property(readonly) Class superclass; @end @interface XRAnnotationContext : DVTAnnotationContext { NSObject<XRAnnotationSource> *_annotationSource; } @property(retain, nonatomic) NSObject<XRAnnotationSource> *annotationSource; // @synthesize annotationSource=_annotationSource; - (void).cxx_destruct; - (id)initWithAnnotationSource:(id)arg1; @end @interface XRAnnotationProvider : DVTAnnotationProvider { } + (id)annotationProviderForContext:(id)arg1 error:(id *)arg2; - (void)clearAnnotations; - (void)addAnnotationAtLine:(unsigned long long)arg1 withText:(id)arg2; - (id)initWithContext:(id)arg1; @end @interface XRAnnotation : NSObject { XRSourceTabView *_accessoryView; struct CGSize _minAccessoryViewSize; NSColor *_color; NSMutableArray *_commentArray; int _type; BOOL _showInspector; NSString *_snippet; DVTTextStorage *_textStorage; struct _NSRange _paragraphRange; } @property(nonatomic) struct _NSRange paragraphRange; // @synthesize paragraphRange=_paragraphRange; @property(retain, nonatomic) DVTTextStorage *textStorage; // @synthesize textStorage=_textStorage; @property(retain, nonatomic) XRSourceTabView *accessoryView; // @synthesize accessoryView=_accessoryView; - (void).cxx_destruct; - (id)description; - (id)snippet; - (void)setSnippet:(id)arg1; - (long long)compareImportance:(id)arg1; - (double)importance; - (BOOL)showsInspector; - (void)setShowsInspector:(BOOL)arg1; @property(readonly, nonatomic) NSArray *dataItems; // @dynamic dataItems; - (void)merge:(id)arg1; - (BOOL)canMerge:(id)arg1; - (id)xxxbottomBorderColor; - (id)xxxbackgroundColor; - (id)paragraphBorderHighlightColor; - (id)paragraphHighlightColor; - (void)drawParagraphHighlightWithFrame:(struct CGRect)arg1; - (struct CGSize)calculateAnnotationViewSizeForBounds:(struct CGRect)arg1; - (id)createAnnotationViewForTextView:(id)arg1 withFrame:(struct CGRect)arg2; - (id)commentArray; @property(readonly, nonatomic) NSString *comment; - (void)refreshValueAsValue:(int)arg1; - (id)initWithComments:(id)arg1; - (id)initWithComment:(id)arg1; @end @interface XRActionContext : NSObject <NSMutableCopying, NSCopying> { PFTTraceDocument *_document; long long _runNumber; NSString *_instrumentUUID; struct XRTimeRange _timeRange; } @property(nonatomic) struct XRTimeRange timeRange; // @synthesize timeRange=_timeRange; @property(copy, nonatomic) NSString *instrumentUUID; // @synthesize instrumentUUID=_instrumentUUID; @property(nonatomic) long long runNumber; // @synthesize runNumber=_runNumber; @property(nonatomic) __weak PFTTraceDocument *document; // @synthesize document=_document; - (void).cxx_destruct; - (id)mutableCopyWithZone:(struct _NSZone *)arg1; - (id)copyWithZone:(struct _NSZone *)arg1; - (id)init; @end @interface XRTouchBarItemViewController : NSViewController { NSWindowController *_windowController; } @property(readonly, nonatomic) __weak NSWindowController *windowController; // @synthesize windowController=_windowController; - (void).cxx_destruct; - (id)initWithWindowController:(id)arg1; @property(readonly, nonatomic) PFTWindowController *pftWindowController; @property(readonly, nonatomic) XRTemplateChooserWindowController *templateChooserWindowController; @end @interface XRContextPathControl : PFTPathControl <XRAccessiblePathCellDelegate> { XRContext *_currentContext; NSMutableSet *_observedContainers; } - (void).cxx_destruct; - (id)pathCell:(id)arg1 accessibilityDescriptionForPathComponentCell:(id)arg2 atIndex:(unsigned long long)arg3; - (void)cells:(id)arg1 appendCellsForTarget:(id)arg2 fromRoot:(id)arg3; - (void)update; - (void)observeValueForKeyPath:(id)arg1 ofObject:(id)arg2 change:(id)arg3 context:(void *)arg4; - (void)_contextMenuClicked:(id)arg1; - (void)_contextClicked:(id)arg1; - (void)_contextSelectedByUser:(id)arg1 cell:(id)arg2 title:(id)arg3; - (void)_discloseDetailForContext:(id)arg1; - (void)_displayContext:(id)arg1; - (void)setContext:(id)arg1; - (void)dealloc; - (void)awakeFromNib; - (id)initWithContext:(id)arg1; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRFlagViewer : NSWindowController <NSWindowDelegate, NSOutlineViewDelegate> { XRFlagController *_flagController; NSArray *_searchMenuItemsArray; NSArray *_flagColumnArray; NSArray *_flagColumnMenuItemsArray; BOOL _flagTableDeferReload; BOOL _ignoreColumnMoves; NSMutableArray *_flagColumnsToSearch; NSMutableArray *_searchedFlags; NSOutlineView *_flagOutline; NSMenu *_tableColumnMenu; NSMenu *_displayStateMenu; DVTSearchField *_flagTableSearchField; NSMenu *_searchColumnMenu; } + (id)sharedInstance; + (union _flagTableFilter_u)defaultFlagFilter; + (union _flagTableFilter_u)flagFilterForDocument:(id)arg1 runNumber:(long long)arg2; + (void)setFlagFilter:(union _flagTableFilter_u)arg1 forDocument:(id)arg2 runNumber:(long long)arg3; @property(retain, nonatomic) NSMenu *searchColumnMenu; // @synthesize searchColumnMenu=_searchColumnMenu; @property(nonatomic) __weak DVTSearchField *flagTableSearchField; // @synthesize flagTableSearchField=_flagTableSearchField; @property(retain, nonatomic) NSMenu *displayStateMenu; // @synthesize displayStateMenu=_displayStateMenu; @property(retain, nonatomic) NSMenu *tableColumnMenu; // @synthesize tableColumnMenu=_tableColumnMenu; @property(nonatomic) __weak NSOutlineView *flagOutline; // @synthesize flagOutline=_flagOutline; - (void).cxx_destruct; - (void)flagModifiedResponse:(id)arg1; - (void)setSearchCategoryFrom:(id)arg1; - (void)searchFlagTableAction:(id)arg1; - (void)inspectFlagAction:(id)arg1; - (void)columnVisibleAction:(id)arg1; - (void)displayFilterAction:(id)arg1; - (void)flagMenuAction:(id)arg1; - (void)flagRangeAction:(id)arg1; - (void)reloadFlagTable; - (void)dealloc; - (id)windowTitleForDocumentDisplayName:(id)arg1; - (void)updateRunNumber:(id)arg1; @property(readonly, nonatomic) PFTTraceDocument *traceDocument; - (BOOL)outlineView:(id)arg1 shouldEditTableColumn:(id)arg2 item:(id)arg3; - (void)outlineView:(id)arg1 willDisplayCell:(id)arg2 forTableColumn:(id)arg3 item:(id)arg4; - (void)outlineViewSelectionDidChange:(id)arg1; - (void)setDocument:(id)arg1; - (void)close; - (BOOL)shouldCloseDocument; - (void)refreshDisplayStateFilterMenuWith:(union _flagTableFilter_u)arg1; - (void)tableViewColumnDidMove:(id)arg1; - (void)_processNewSignalFlags:(id)arg1; - (void)windowDidLoad; - (void)updateSearchCategoryMenu; - (void)updateColumnHidingMenu; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRFloatValueAnimation : NSAnimation { double _fromPosition; double _toPosition; double _position; } @property double position; // @synthesize position=_position; @property double toPosition; // @synthesize toPosition=_toPosition; @property double fromPosition; // @synthesize fromPosition=_fromPosition; - (void)setCurrentProgress:(float)arg1; @end @interface PFTPathComponentCell : NSPathComponentCell { double _fixedWidth; } @property double fixedWidth; // @synthesize fixedWidth=_fixedWidth; - (void)drawInteriorWithFrame:(struct CGRect)arg1 inView:(id)arg2; - (struct CGSize)_iconSize; - (struct CGSize)cellSizeForBounds:(struct CGRect)arg1; - (void)drawWithFrame:(struct CGRect)arg1 inView:(id)arg2; - (void)_drawNavigationBarBackgroundWithFrame:(struct CGRect)arg1 inView:(id)arg2; - (id)attributedStringValue; @end @interface PFTPathCell : NSPathCell <XRPathCellAccessible> { } + (Class)pathComponentCellClass; - (id)trackingMenu; - (void)handleClickInComponentCell:(id)arg1 atPoint:(struct CGPoint)arg2 inRect:(struct CGRect)arg3 ofView:(id)arg4 event:(id)arg5; - (BOOL)_showMenuForComponentCell:(id)arg1 inRect:(struct CGRect)arg2; - (BOOL)trackMouse:(id)arg1 inRect:(struct CGRect)arg2 ofView:(id)arg3 untilMouseUp:(BOOL)arg4; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface PFTPathControl : NSPathControl { BOOL _drawLeftFlatCap; } + (Class)cellClass; @property BOOL drawLeftFlatCap; // @synthesize drawLeftFlatCap=_drawLeftFlatCap; - (BOOL)becomeFirstResponder; - (BOOL)acceptsFirstResponder; - (void)awakeFromNib; - (BOOL)isFlipped; - (id)initWithFrame:(struct CGRect)arg1; @end @interface XRCompressedStackFrameCell : NSCell { NSColor *_color; } + (double)suggestedCellHeight; + (id)sharedInstance; @property(copy) NSColor *color; // @synthesize color=_color; - (void).cxx_destruct; - (void)drawInteriorWithFrame:(struct CGRect)arg1 inView:(id)arg2; - (id)copyWithZone:(struct _NSZone *)arg1; - (id)initWithColor:(id)arg1; @end @interface XRVerticallyCenteredTextFieldCell : NSTextFieldCell { } - (void)drawInteriorWithFrame:(struct CGRect)arg1 inView:(id)arg2; - (struct CGRect)titleRectForBounds:(struct CGRect)arg1; @end @interface XRSourceCommentAnnotationContext : DVTAnnotationContext { XRTextView *_textView; } @property(retain, nonatomic) XRTextView *textView; // @synthesize textView=_textView; - (void).cxx_destruct; - (id)initWithTextView:(id)arg1; @end @interface XRPreferences : NSPreferences { } + (void)restoreWindowWithIdentifier:(id)arg1 state:(id)arg2 completionHandler:(CDUnknownBlockType)arg3; + (void)initialize; - (BOOL)windowShouldClose:(id)arg1; - (void)applicationWillTerminate:(id)arg1; - (BOOL)usesButtons; - (void)dealloc; - (id)init; @end @interface _XRSegmentedCell : NSSegmentedCell { NSImageCell *_arrowImageCell; BOOL _useMenuDelay; BOOL _useMenuDelayForSelectedSegment; BOOL _useRadioDrawingStyle; NSPointerArray *_segmentImages; BOOL _useAnyDrawingStyle; } @property BOOL useAnyDrawingStyle; // @synthesize useAnyDrawingStyle=_useAnyDrawingStyle; @property BOOL useRadioDrawingStyle; // @synthesize useRadioDrawingStyle=_useRadioDrawingStyle; @property BOOL useMenuDelayForSelectedSegment; // @synthesize useMenuDelayForSelectedSegment=_useMenuDelayForSelectedSegment; @property BOOL useMenuDelay; // @synthesize useMenuDelay=_useMenuDelay; - (void).cxx_destruct; - (void)drawWithFrame:(struct CGRect)arg1 inView:(id)arg2; - (void)drawSegment:(long long)arg1 inFrame:(struct CGRect)arg2 withView:(id)arg3; - (void)_drawMenuIndicatorForFrame:(struct CGRect)arg1 activeStyle:(BOOL)arg2 withView:(id)arg3; - (unsigned long long)_applicableTrackingModeForSegment:(long long)arg1; - (void)setControlSize:(unsigned long long)arg1; - (void)setImage:(id)arg1 forSegment:(long long)arg2; - (id)_adjustImage:(id)arg1 forControlSize:(unsigned long long)arg2; - (void)setSegmentCount:(long long)arg1; - (id)_segmentImages; - (double)_menuDelayTimeForSegment:(long long)arg1; - (id)init; @end @interface XRToolbarSegmentedControl : DVTSegmentedControl { NSMutableArray *_disabledImages; NSMutableArray *_alternateDisabledImages; } + (id)_cachedInactiveAlternateImageFromImage:(id)arg1; + (id)_cachedInactiveImageFromImage:(id)arg1; + (id)_deriveInactiveImageFromImage:(id)arg1; + (double)borderedSegmentedControlSegmentWidth; + (id)toolbarSegmentedControlWithTrackingMode:(unsigned long long)arg1 images:(id)arg2 alternateImages:(id)arg3; - (void).cxx_destruct; - (id)alternateImageForSegment:(long long)arg1; - (id)imageForSegment:(long long)arg1; - (id)_alternateDisabledImages; - (id)_disabledImages; @end @interface XRSeparatorToolbarItem : XRToolbarItem { } - (void)connectToContext:(id)arg1; @end @interface XRColoredBackgroundTextCell : NSTextFieldCell { NSString *_defaultsIdentifier; CDUnknownBlockType _providerBlock; } + (id)cellWithDefaultsIdentifier:(id)arg1 preferenceTitle:(id)arg2; - (void).cxx_destruct; - (void)_toggleColorBackground:(id)arg1; - (void)drawInteriorWithFrame:(struct CGRect)arg1 inView:(id)arg2; - (void)setDrawsBackground:(BOOL)arg1; - (void)setBackgroundColorProviderBlock:(CDUnknownBlockType)arg1; - (id)copyWithZone:(struct _NSZone *)arg1; - (id)initWithDefaultsIdentifier:(id)arg1 preferenceTitle:(id)arg2; @end @interface XRLibraryColoredBackgroundTextCell : XRColoredBackgroundTextCell { } - (id)initWithDefaultsIdentifier:(id)arg1 preferenceTitle:(id)arg2; @end @interface XRRecordStopToolbarItem : XRToolbarItem { } - (void)disconnectFromContext; - (void)connectToContext:(id)arg1; - (id)_create1010AndLaterControl; - (void)observeValueForKeyPath:(id)arg1 ofObject:(id)arg2 change:(id)arg3 context:(void *)arg4; @end @interface XRInspectorView : NSView { BOOL _observingWindowChanges; NSLayoutConstraint *_maxHeightConstraint; } @property(retain, nonatomic) NSLayoutConstraint *maxHeightConstraint; // @synthesize maxHeightConstraint=_maxHeightConstraint; - (void).cxx_destruct; - (void)_setMaxHeightForWindow:(id)arg1; - (void)windowDidChangeScreenHandler:(id)arg1; - (void)viewWillMoveToWindow:(id)arg1; - (void)viewDidMoveToWindow; - (void)dealloc; @end @interface XRInstrumentListPopoverController : NSObject <XRLazyKVOResponder, XRInstrumentListItemViewControllerDelegate> { NSPopoverTouchBarItem *_popoverItem; NSString *_identifier; PFTWindowController *_windowController; id <NSTouchBarDelegate> _touchBarDelegate; NSButton *_popoverButton; XRLazyKVOAdapter *_observationAdapter; } @property(readonly, nonatomic) XRLazyKVOAdapter *observationAdapter; // @synthesize observationAdapter=_observationAdapter; @property(readonly, nonatomic) NSButton *popoverButton; // @synthesize popoverButton=_popoverButton; @property(readonly, nonatomic) __weak id <NSTouchBarDelegate> touchBarDelegate; // @synthesize touchBarDelegate=_touchBarDelegate; @property(readonly, nonatomic) __weak PFTWindowController *windowController; // @synthesize windowController=_windowController; @property(retain, nonatomic) NSString *identifier; // @synthesize identifier=_identifier; - (void).cxx_destruct; - (void)_updatePopoverButton; - (void)viewControllerDidChangeInstrumentSelection:(id)arg1; - (void)handleLazyKVOUpdate:(id)arg1; @property(readonly, nonatomic) NSPopoverTouchBarItem *popoverItem; // @synthesize popoverItem=_popoverItem; - (id)initWithWindowController:(id)arg1 identifier:(id)arg2 touchBarDelegate:(id)arg3; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRSummaryDetailView : NSCollectionView { PFTInstrumentList *_instrumentList; NSMutableArray *_summaries; NSArrayController *_summariesArrayController; NSView *_highlightedView; } @property(retain) NSMutableArray *summaries; // @synthesize summaries=_summaries; - (void).cxx_destruct; - (id)highlightedView; - (void)setHighlightedView:(id)arg1; - (id)description; - (id)newItemForRepresentedObject:(id)arg1; - (void)reloadData; - (id)initWithDataSource:(id)arg1 keyPath:(id)arg2; @end @interface XRTemplateChooserWindow : NSWindow { } - (void)performClose:(id)arg1; - (BOOL)validateMenuItem:(id)arg1; - (BOOL)canBecomeKeyWindow; - (BOOL)canBecomeMainWindow; @end @interface XRTemplateChooserLozengeView : NSView { } - (void)drawRect:(struct CGRect)arg1; @end @interface XRTemplateChooserCollectionView : NSCollectionView <NSAccessibilityGroup> { } - (void)setAccessibilitySelectedChildren:(id)arg1; - (id)accessibilitySelectedChildren; - (id)accessibilityChildren; - (void)deleteForward:(id)arg1; - (void)deleteBackward:(id)arg1; - (void)insertNewlineIgnoringFieldEditor:(id)arg1; - (void)insertNewline:(id)arg1; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRTemplateChooserWindowController : NSWindowController <XRDeviceObserver, NSPathControlDelegate, NSTableViewDataSource, NSTableViewDelegate, NSTextFieldDelegate, NSWindowDelegate, NSCollectionViewDelegate> { XRTemplateChooserTargetedObject *_itemContext; NSString *_filterString; NSMutableArray *_categories; NSMutableArray *_currentCategory; NSMutableArray *_currentTextFilteredCategory; id _eventMonitor; BOOL _canChangeDeviceAndProcess; BOOL _validTemplateSelection; NSString *_selectedTemplatePath; NSDictionary *_plistData; XRRecentArrayStoredPrefs *_recentTemplatesArray; long long _selectedCategory; NSView *_mainView; NSView *_targetSearchContainer; XRTargetChooserPathControl *_targetChooserPathControl; NSButton *_chooseButton; NSButton *_profileButton; NSButton *_cancelButton; NSButton *_openExistingButton; DVTScopeBarButton *_standardButton; DVTScopeBarButton *_recentButton; DVTScopeBarButton *_customButton; DVTSearchField *_searchField; NSCollectionView *_templateCollectionView; NSImageView *_selectedTemplateImage; NSTextField *_selectedTemplateName; NSTextField *_selectedTemplateDescription; DVTBorderedView *_mainBorderedView; DVTBorderedView *_scopeFilterBorderedView; DVTBorderedView *_selectedTemplateBorderedView; NSScrollView *_templateCollectionScrollView; XRTemplateCollectionViewItem *_templateCollectionViewItem; XRTemplateItemView *_templateItemView; } @property XRTemplateItemView *templateItemView; // @synthesize templateItemView=_templateItemView; @property XRTemplateCollectionViewItem *templateCollectionViewItem; // @synthesize templateCollectionViewItem=_templateCollectionViewItem; @property NSScrollView *templateCollectionScrollView; // @synthesize templateCollectionScrollView=_templateCollectionScrollView; @property DVTBorderedView *selectedTemplateBorderedView; // @synthesize selectedTemplateBorderedView=_selectedTemplateBorderedView; @property DVTBorderedView *scopeFilterBorderedView; // @synthesize scopeFilterBorderedView=_scopeFilterBorderedView; @property DVTBorderedView *mainBorderedView; // @synthesize mainBorderedView=_mainBorderedView; @property NSTextField *selectedTemplateDescription; // @synthesize selectedTemplateDescription=_selectedTemplateDescription; @property NSTextField *selectedTemplateName; // @synthesize selectedTemplateName=_selectedTemplateName; @property NSImageView *selectedTemplateImage; // @synthesize selectedTemplateImage=_selectedTemplateImage; @property NSCollectionView *templateCollectionView; // @synthesize templateCollectionView=_templateCollectionView; @property DVTSearchField *searchField; // @synthesize searchField=_searchField; @property DVTScopeBarButton *customButton; // @synthesize customButton=_customButton; @property DVTScopeBarButton *recentButton; // @synthesize recentButton=_recentButton; @property DVTScopeBarButton *standardButton; // @synthesize standardButton=_standardButton; @property NSButton *openExistingButton; // @synthesize openExistingButton=_openExistingButton; @property NSButton *cancelButton; // @synthesize cancelButton=_cancelButton; @property(retain) NSButton *profileButton; // @synthesize profileButton=_profileButton; @property(retain) NSButton *chooseButton; // @synthesize chooseButton=_chooseButton; @property XRTargetChooserPathControl *targetChooserPathControl; // @synthesize targetChooserPathControl=_targetChooserPathControl; @property NSView *targetSearchContainer; // @synthesize targetSearchContainer=_targetSearchContainer; @property NSView *mainView; // @synthesize mainView=_mainView; @property long long selectedCategory; // @synthesize selectedCategory=_selectedCategory; - (void).cxx_destruct; - (struct CGRect)window:(id)arg1 willPositionSheet:(id)arg2 usingRect:(struct CGRect)arg3; - (void)templateDoubleClicked:(id)arg1; - (BOOL)control:(id)arg1 textView:(id)arg2 doCommandBySelector:(SEL)arg3; - (void)controlTextDidChange:(id)arg1; - (void)customButtonClicked:(id)arg1; - (void)standardButtonClicked:(id)arg1; - (void)recentButtonClicked:(id)arg1; - (void)_updateFilterButtons; - (void)_filterTemplates; - (void)chooseOrProfileClicked:(id)arg1; - (void)cancelClicked:(id)arg1; - (void)deleteTemplate:(id)arg1; - (void)openExistingClicked:(id)arg1; - (void)observeValueForKeyPath:(id)arg1 ofObject:(id)arg2 change:(id)arg3 context:(void *)arg4; - (void)_updateChooseProfileButtons; - (void)_updateSelectedTemplate; - (void)_templateWasDeletedFromPathNotification:(id)arg1; - (void)_templateWasAddedToDiskPathNotification:(id)arg1; - (void)_refreshTemplates; - (void)_loadTemplates; - (void)_reconfigurePathControl; - (void)_setupPathControl; - (void)windowDidLoad; - (void)handleDeviceNotification:(id)arg1; - (long long)_defaultIntegerForKey:(id)arg1 missingValue:(long long)arg2; - (void)_configureWindow; - (void)windowWillClose:(id)arg1; - (void)close; - (id)windowNibName; - (id)initWithWindowNibName:(id)arg1 plistData:(id)arg2 device:(id)arg3 process:(id)arg4; - (id)initWithWindow:(id)arg1; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRToolbar : NSToolbar { } - (BOOL)_allowsSizeMode:(unsigned long long)arg1; - (BOOL)_allowsDisplayMode:(unsigned long long)arg1; - (BOOL)isFullScreen; - (id)_customMetrics; - (void)validateVisibleItems; @end @interface XRZoomToolbarItem : XRToolbarItem { id _trackView; } @property(retain) id trackView; // @synthesize trackView=_trackView; - (void).cxx_destruct; - (void)disconnectFromContext; - (void)connectToContext:(id)arg1; - (void)observeValueForKeyPath:(id)arg1 ofObject:(id)arg2 change:(id)arg3 context:(void *)arg4; @end @interface XRSummaryDetailItemView : NSView { DTGraph *_graph; NSTrackingArea *_trackingArea; BOOL _mouseInside; BOOL _mouseDown; } - (void).cxx_destruct; - (void)performAction; - (void)drawRect:(struct CGRect)arg1; - (void)mouseUp:(id)arg1; - (void)mouseDown:(id)arg1; - (void)mouseExited:(id)arg1; - (void)mouseEntered:(id)arg1; - (void)setHighlighted:(BOOL)arg1; - (BOOL)isHighlighted; - (void)setFrameSize:(struct CGSize)arg1; - (id)graph; - (void)dealloc; - (id)initWithFrame:(struct CGRect)arg1 graphClass:(Class)arg2; - (void)_setupBarChart:(Class)arg1; @end @interface XRAnalysisCoreTrackConfigurator : NSObject { NSMutableDictionary *_existanceProjectorsByRunNumber; XRTrace *_trace; XRInstrument *_instrument; XRIntKeyedDictionary *_plansByRunNumber; } @property(retain, nonatomic) XRIntKeyedDictionary *plansByRunNumber; // @synthesize plansByRunNumber=_plansByRunNumber; @property(retain, nonatomic) XRInstrument *instrument; // @synthesize instrument=_instrument; @property(retain, nonatomic) XRTrace *trace; // @synthesize trace=_trace; - (void).cxx_destruct; - (id)_refreshExistenceProjectorsForRunNumber:(long long)arg1; - (unsigned int)_tableIDForSpec:(id)arg1 runNumber:(long long)arg2; - (void)_configureGroupByTrack:(id)arg1 plan:(id)arg2 graphSpec:(id)arg3 treatment:(id)arg4 core:(id)arg5 graphIndex:(float *)arg6; - (BOOL)shouldUpdateBrushLayoutForRun:(long long)arg1; - (void)configureTrack:(id)arg1; - (id)init; @end @interface XRExistanceProjectorForTableColumn : NSObject { unsigned char _columnID; unsigned char _subColumnID; unsigned int _tableID; XRAnalysisCoreProjector *_projector; unsigned long long _lastCount; NSMutableDictionary *_subProjections; } @property(readonly, retain, nonatomic) NSMutableDictionary *subProjections; // @synthesize subProjections=_subProjections; @property(readonly, nonatomic) unsigned char subColumnID; // @synthesize subColumnID=_subColumnID; @property(nonatomic) unsigned long long lastCount; // @synthesize lastCount=_lastCount; @property(readonly, retain, nonatomic) XRAnalysisCoreProjector *projector; // @synthesize projector=_projector; @property(nonatomic) unsigned char columnID; // @synthesize columnID=_columnID; @property(nonatomic) unsigned int tableID; // @synthesize tableID=_tableID; - (void).cxx_destruct; - (BOOL)hasSubColumn; - (id)initWithProjector:(id)arg1 tableID:(unsigned int)arg2 columnID:(unsigned char)arg3 subColumnID:(unsigned char)arg4; - (id)initWithProjector:(id)arg1 tableID:(unsigned int)arg2 columnID:(unsigned char)arg3; @end @interface XRExistanceProjectorsForTable : NSObject { XRIntKeyedDictionary *_projectorsByTableColumn; } @property(retain, nonatomic) XRIntKeyedDictionary *projectorsByTableColumn; // @synthesize projectorsByTableColumn=_projectorsByTableColumn; - (void).cxx_destruct; - (id)init; @end @interface XRExistenceProjectorsForRun : NSObject { XRIntKeyedDictionary *_tableProjectors; } @property(retain, nonatomic) XRIntKeyedDictionary *tableProjectors; // @synthesize tableProjectors=_tableProjectors; - (void).cxx_destruct; - (id)init; @end @interface XRTableHeaderMenuView : NSTableHeaderView { } - (void)drawRect:(struct CGRect)arg1; - (void)mouseDown:(id)arg1; - (id)init; @end @interface XRStrategiesToolbarItem : XRToolbarItem { } - (void)_segmentedControlClicked:(id)arg1; - (void)disconnectFromContext; - (void)connectToContext:(id)arg1; - (id)_create1010AndLaterControl; - (void)observeValueForKeyPath:(id)arg1 ofObject:(id)arg2 change:(id)arg3 context:(void *)arg4; @end @interface XRInfiniteLineBox : NSView { NSColor *_lineColor; double _fadeLength; } @property double fadeLength; // @synthesize fadeLength=_fadeLength; @property(retain) NSColor *lineColor; // @synthesize lineColor=_lineColor; - (void).cxx_destruct; - (double)_fadeLengthAsPercentOfLength; @property(readonly) unsigned long long orientation; - (void)drawRect:(struct CGRect)arg1; - (void)_ide_infiniteLineBoxCommonInit; - (void)awakeFromNib; - (id)initWithFrame:(struct CGRect)arg1; @end @interface XRAnalysisCoreStandardController : NSObject <XRInstrumentViewController> { XRAnalysisCoreDetailViewController *_detailController; NSMutableArray *_subcontrollers; PFTTraceDocument *_document; XRAnalysisCoreTrackConfigurator *_trackConfigurator; NSOperation *_tableReqChangeOp; XRInstrument *_instrument; XRInstrumentStatus *_status; } @property(retain, nonatomic) XRInstrumentStatus *status; // @synthesize status=_status; @property(readonly, nonatomic) __weak XRInstrument *instrument; // @synthesize instrument=_instrument; - (void).cxx_destruct; - (id)detailFilteredDataSource; - (void)restoreDisplayStateFromTemplate:(id)arg1; - (id)saveDisplayStateForTemplates; - (void)refineSourceAnnotationQuery:(id)arg1; - (id)currentRecordSettingsDetailMetaUI; - (id)currentDisplaySettingsDetailMetaUI; - (id)currentExtendedDetailMetaUI; - (id)currentCallTreeFilter; - (void)instrumentDidChangeSwitches; - (void)requestDocumentInspectFlag:(id)arg1; - (BOOL)requestDocumentSetInspectionTime:(unsigned long long)arg1; - (void)documentSetInspectionTime:(unsigned long long)arg1; - (void)documentDidUpdateBaseFilterForRunNumber:(long long)arg1; - (struct XRTimeRange)documentsSelectedTimeRange; - (void)eventHorizonAdvancedThroughRange:(struct XRTimeRange)arg1; - (void)instrumentChangedTableRequirements; - (void)_refreshPlan; - (id)plan; - (void)instrumentWillBecomeInvalid; - (id)init; - (id)initWithInstrument:(id)arg1 document:(id)arg2; - (void)currentBrushBecameStale; - (void)didRecordDataInTimeRange:(struct XRTimeRange)arg1; - (BOOL)resolution:(unsigned long long)arg1 differsFrom:(unsigned long long)arg2 runNumber:(long long)arg3 strategy:(struct NSString *)arg4; - (void)configureTrack:(id)arg1; - (void)configureTrackOverlay:(id)arg1; - (id)detailContextContainer; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRSummaryViewController : NSViewController { BOOL _ui_summary_supported; BOOL _summariesAreUpToDate; BOOL _summaryModelsAreDisposed; NSMutableDictionary *_pendingSummaryUpdates; NSMutableArray *_summaryModels; NSArray *_byTopicHighlights; unsigned long long _byTopicHighlightsSelection; NSMapTable *_kvoAdapterByInstrument; PFTTraceDocument *_document; XRSummaryDetailView *_summaryView; } @property(nonatomic) __weak XRSummaryDetailView *summaryView; // @synthesize summaryView=_summaryView; @property(retain, nonatomic) PFTTraceDocument *document; // @synthesize document=_document; - (void).cxx_destruct; - (id)dataElementsForContext:(id)arg1; - (void)setSelectedByTopicHighlights:(id)arg1; - (id)selectedByTopicHighlights; - (id)byTopicHighlights; - (BOOL)needsSummaryView; - (void)setSummaryObservationEnabled:(BOOL)arg1; - (void)setSummaryObservationEnabled:(BOOL)arg1 forInstrument:(id)arg2; - (void)_abandonDocument:(id)arg1 forDocument:(id)arg2; - (id)summaryModels; - (void)refreshSummariesForInstrument:(id)arg1; - (void)refreshSummaries; - (void)_refreshSummariesForInstrumentOnTimer:(id)arg1; - (void)_invalidateSummaryModels; - (void)_disposeOfSummaries; - (void)_refreshSummariesForInstrument:(id)arg1; - (void)_clearSummaryTimerForInstrument:(id)arg1; - (void)reloadSummaryView; - (void)viewDidLoad; - (id)init; - (id)initWithNibName:(id)arg1 bundle:(id)arg2; @end @interface XREngineeringTypeFormatter : NSFormatter { NSNumberFormatter *_countFormatter; NSNumberFormatter *_intIDFormatter; NSNumberFormatter *_fpsFormatter; NSNumberFormatter *_fixedDecimalFormatter; XRThreadSet *_threadSet; XRProcessSet *_procSet; long long _runNumber; BOOL _includeProcessNameWithThread; } + (id)stringForValue:(id)arg1 threadSet:(id)arg2 processSet:(id)arg3 runNumber:(long long)arg4; @property(nonatomic) BOOL includeProcessNameWithThread; // @synthesize includeProcessNameWithThread=_includeProcessNameWithThread; - (void).cxx_destruct; - (unsigned long long)hash; - (BOOL)isEqual:(id)arg1; - (BOOL)getObjectValue:(out id *)arg1 forString:(id)arg2 errorDescription:(out id *)arg3; - (id)attributedStringForNarrativeSubvalue:(id)arg1 withDefaultAttributes:(id)arg2; - (id)attributedStringForObjectValue:(id)arg1 withDefaultAttributes:(id)arg2; - (id)stringForObjectValue:(id)arg1; - (id)init; - (id)initWithTrace:(id)arg1 runNumber:(long long)arg2; @end @interface XRWeightFormatter : XREngineeringTypeFormatter { long long _weightIdx; unsigned short _impliedType; XRAnalysisCoreValue *_resuableVal; BOOL _includePercentageOfTotal; BOOL _useSelfColumn; } @property(nonatomic) BOOL useSelfColumn; // @synthesize useSelfColumn=_useSelfColumn; @property(nonatomic) BOOL includePercentageOfTotal; // @synthesize includePercentageOfTotal=_includePercentageOfTotal; - (void).cxx_destruct; - (id)stringForObjectValue:(id)arg1; - (id)initWithTrace:(id)arg1 runNumber:(long long)arg2; - (id)initWithTrace:(id)arg1 runNumber:(long long)arg2 impliedEngineeringTypeID:(unsigned short)arg3 weightIdx:(long long)arg4; @end @interface XRDecoratorState : NSObject { NSColor *_fillColor; NSColor *_strokeColor; NSGradient *_gradient; NSImage *_gradientImageSlice; struct CGImage *_gradientCGImageSlice; double _gradientSliceHeight; double _gradientAngle; double _lineWidth; unsigned long long _hash; struct CGAffineTransform _transform; BOOL _hasTransform; } - (void).cxx_destruct; - (struct CGAffineTransform)transform; - (void)setTransform:(struct CGAffineTransform)arg1; - (void)drawGradientInRect:(struct CGRect)arg1 context:(struct CGContext *)arg2; - (id)gradient; - (id)strokeColor; - (id)fillColor; - (unsigned long long)hash; - (BOOL)isEqual:(id)arg1; - (void)setInContext:(struct CGContext *)arg1; - (void)dealloc; - (id)copyWithZone:(struct _NSZone *)arg1; - (id)initWithGradient:(id)arg1 gradientAngle:(double)arg2; - (id)initWithFillColor:(id)arg1 strokeColor:(id)arg2 lineWidth:(double)arg3; - (id)initWithFillColor:(id)arg1 strokeColor:(id)arg2 gradient:(id)arg3 gradientAngle:(double)arg4 lineWidth:(double)arg5; @end @interface XRAnalysisCoreTableViewColumnList : NSObject { NSMutableArray *_contents; NSMutableDictionary *_itemsByIdent; NSMutableArray *_narrativeColumnItems; NSTableColumn *_timeColumn; } @property(readonly, nonatomic) NSArray *narrativeColumnItems; // @synthesize narrativeColumnItems=_narrativeColumnItems; @property(readonly, nonatomic) NSTableColumn *timeColumn; // @synthesize timeColumn=_timeColumn; @property(readonly, nonatomic) NSArray *contents; // @synthesize contents=_contents; - (void).cxx_destruct; - (id)itemWithColumnIdentifier:(id)arg1; - (void)addItem:(id)arg1; - (id)init; @end @interface XRAnalysisCoreTableViewColumnListItem : NSObject { unsigned char _tableColID; unsigned char _implClassID; unsigned char _topologyFieldID; unsigned short _engineeringTypeID; NSTableColumn *_column; XRAnalysisCoreColumnSpec *_colSpec; } @property(nonatomic) unsigned char topologyFieldID; // @synthesize topologyFieldID=_topologyFieldID; @property(nonatomic) unsigned char implClassID; // @synthesize implClassID=_implClassID; @property(nonatomic) unsigned short engineeringTypeID; // @synthesize engineeringTypeID=_engineeringTypeID; @property(nonatomic) unsigned char tableColID; // @synthesize tableColID=_tableColID; @property(retain, nonatomic) XRAnalysisCoreColumnSpec *colSpec; // @synthesize colSpec=_colSpec; @property(retain, nonatomic) NSTableColumn *column; // @synthesize column=_column; - (void).cxx_destruct; @end @interface XRAnalysisCoreProjectionBasedDecorator : XRAnalysisCoreStandardDecorator { XRAnalysisCoreProjector *_projector; } - (void).cxx_destruct; - (id)decorateContainer:(struct DTTimelineDecorationContainer *)arg1; - (void)setDefaultsForPlane:(id)arg1; - (id)fillContainer:(struct DTTimelineDecorationContainer *)arg1 fromProjector:(id)arg2; - (id)initWithTrace:(id)arg1 runNumber:(long long)arg2 formatter:(id)arg3; - (id)initWithTrace:(id)arg1 runNumber:(long long)arg2 formatter:(id)arg3 projector:(id)arg4; @end @interface XRAboutWindowController : NSWindowController <NSWindowRestoration> { NSTextField *_appNameLabel; NSTextField *_copyrightMultilineLabel; NSTextField *_versionAndBuildLabel; } + (void)restoreWindowWithIdentifier:(id)arg1 state:(id)arg2 completionHandler:(CDUnknownBlockType)arg3; + (id)sharedAboutWindowController; - (void).cxx_destruct; - (void)openAboutWindow:(id)arg1; - (void)windowWillClose:(id)arg1; - (void)windowDidLoad; - (id)_versionString; - (id)_copyrightAndTrademarkString; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRAnalysisCoreStandardHistogramRollUp : NSObject <XRAnalysisCoreRollUpFunction> { unsigned char _colID; XRAnalysisCoreImplValue *_reusedImpl; unsigned long long _bucketWidth; } @property(nonatomic) unsigned long long bucketWidth; // @synthesize bucketWidth=_bucketWidth; - (void).cxx_destruct; - (void)rollUp:(const struct XRAnalysisCoreReadCursor *)arg1 to:(id *)arg2 core:(id)arg3; - (id)extendFunctionWithScope:(unsigned long long)arg1; - (unsigned short)outputEngineeringType; - (BOOL)isValidForEngineeringType:(unsigned short)arg1; - (id)displayableFunctionName; - (id)initWithBucketWidth:(unsigned long long)arg1 timeColumnID:(unsigned char)arg2; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRStrategiesToolbarViewController : NSViewController { XRStrategyUIController *_currentUIController; NSArray *_availableStrategyUIControllers; NSStackView *_stackView; NSSegmentedControl *_strategyPicker; NSView *_separatorView; } @property(retain, nonatomic) NSView *separatorView; // @synthesize separatorView=_separatorView; @property(retain, nonatomic) NSSegmentedControl *strategyPicker; // @synthesize strategyPicker=_strategyPicker; @property(nonatomic) __weak NSStackView *stackView; // @synthesize stackView=_stackView; @property(retain, nonatomic) NSArray *availableStrategyUIControllers; // @synthesize availableStrategyUIControllers=_availableStrategyUIControllers; @property(retain, nonatomic) XRStrategyUIController *currentUIController; // @synthesize currentUIController=_currentUIController; - (void).cxx_destruct; - (void)_rebuildUI; @end @interface XRSaveTemplateInfoViewController : NSViewController <XRImagePickerDelegate> { NSString *_templateIconURL; XRImagePickerView *_imagePickerView; NSTextView *_description; } - (void).cxx_destruct; - (void)imagePicker:(id)arg1 imageSelectedFromURL:(id)arg2; - (void)imagePicker:(id)arg1 selectedImageAtIndex:(long long)arg2; - (id)imagesForImagePicker:(id)arg1; - (id)templateDescription; - (void)setTemplateDescription:(id)arg1; - (id)templateIconURL; - (void)setTemplateIconURL:(id)arg1; - (void)viewDidLoad; @end @interface XRAnalysisCoreNarrativeCellView : XRAnalysisCoreValueCellView { } @end @interface XRCallTreeCompareBarViewController : NSViewController <PFTDetailViewAccessory> { NSPopUpButton *_mergeActionPopup; NSPopUpButton *_mergeTargetRunPopup; id <SymbolAwareRun> _mergeRun; XRInstrument *_instrument; XRCallTreeDetailView *_callTreeView; } - (void).cxx_destruct; - (void)saveClicked:(id)arg1; - (void)doneClicked:(id)arg1; - (void)setMainView:(id)arg1; - (int)_factor; - (void)selectedNewMergeTarget:(id)arg1; - (void)_refreshRunTargetsPopup; - (void)_enumerateValidComparisonRuns:(CDUnknownBlockType)arg1; - (void)awakeFromNib; - (id)initWithInstrument:(id)arg1; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRTargetChooserPathCell : NSPathCell <XRPathCellAccessible> { struct CGSize _cachedSizeWanted; NSMenu *_trackingMenu; NSPathComponentCell *_clickedPathComponentCell; int _gradientStyle; int _borderSides; } + (Class)pathComponentCellClass; @property int borderSides; // @synthesize borderSides=_borderSides; @property(nonatomic) int gradientStyle; // @synthesize gradientStyle=_gradientStyle; @property(retain) NSPathComponentCell *clickedPathComponentCell; // @synthesize clickedPathComponentCell=_clickedPathComponentCell; - (void).cxx_destruct; - (id)trackingMenu; - (void)handleClickInComponentCell:(id)arg1 atPoint:(struct CGPoint)arg2 inRect:(struct CGRect)arg3 ofView:(id)arg4 event:(id)arg5; - (void)drawWithFrame:(struct CGRect)arg1 inView:(id)arg2; - (struct CGSize)sizeWantedForFrame:(struct CGRect)arg1 inView:(id)arg2; - (void)cancelMenuTracking; - (BOOL)trackMouse:(id)arg1 inRect:(struct CGRect)arg2 ofView:(id)arg3 untilMouseUp:(BOOL)arg4; - (void)_handleClickInComponentCell:(id)arg1 atPoint:(struct CGPoint)arg2 inRect:(struct CGRect)arg3 ofView:(id)arg4 event:(id)arg5; - (void)_popUpMenuForComponentCell:(id)arg1 inRect:(struct CGRect)arg2 ofView:(id)arg3; - (void)setFont:(id)arg1; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRLibraryViewController : DVTLibraryController { } - (void)_syncAsset:(id)arg1 withInstrumentType:(id)arg2; - (id)_createLibraryAssetForInstrumentType:(id)arg1; - (void)_addInstrumentType:(id)arg1; - (void)_removeInstrumentType:(id)arg1; - (void)_populateLibrary; - (BOOL)removeAssets:(id)arg1 error:(id *)arg2; - (BOOL)canRemoveAsset:(id)arg1; - (void)instrumentRemoved:(id)arg1; - (void)instrumentAdded:(id)arg1; - (id)searchStringsForAsset:(id)arg1; - (BOOL)delegateFirstResponder; - (void)libraryTileView:(id)arg1 wasDoubleClicked:(id)arg2; - (BOOL)canOpenDetailPopUp; - (BOOL)depositAssets:(id)arg1; - (void)populatePasteboard:(id)arg1 withAssets:(id)arg2; - (void)libraryDidLoad; - (void)dealloc; @end @interface XRSearchBarViewController : NSViewController <NSSearchFieldDelegate, XRSearchTarget, NSTextFieldDelegate, PFTDetailViewAccessory> { DVTSearchField *_searchField; NSButton *_ignoreCaseButton; NSButton *_autoExpandButton; NSSegmentedControl *_directionalButtons; NSButton *_doneButton; NSTableView *_defaultView; id <XRSearchTarget> _searchTarget; BOOL _targetIsViewBased; BOOL _targetSupportsObjectValueForRow; BOOL _targetOutlineSupportsHighlights; BOOL _targetTableSupportsHighlights; NSString *_selectedCategory; BOOL _matchSymbols; BOOL _matchLibraries; XRInstrument *_instrument; } + (BOOL)ignoreCaseDuringFind; + (BOOL)autoExpandNodesDuringFind; + (void)initialize; @property(readonly, retain, nonatomic) XRInstrument *instrument; // @synthesize instrument=_instrument; - (void).cxx_destruct; - (BOOL)searchBackward:(id)arg1; - (BOOL)searchForward:(id)arg1 skipCurrent:(BOOL)arg2; - (BOOL)_searchBackwardOutline:(id)arg1 row:(long long)arg2 options:(unsigned long long)arg3; - (BOOL)_searchBackwardOutline:(id)arg1 item:(id)arg2 options:(unsigned long long)arg3 resultPath:(id)arg4 selectedItem:(id)arg5 stop:(char *)arg6; - (id)_pathToRootFromItem:(id)arg1; - (id)_pathFromRootToItem:(id)arg1; - (BOOL)_searchForwardOutline:(id)arg1 row:(long long)arg2 options:(unsigned long long)arg3 skipCurrent:(BOOL)arg4; - (void)_expandPath:(id)arg1 priorItem:(id)arg2 searchForward:(BOOL)arg3; - (BOOL)_forwardCheckOutlineView:(id)arg1 matchingChildForItem:(id)arg2 forString:(id)arg3 options:(unsigned long long)arg4 resultPath:(id)arg5 skipCurrent:(BOOL)arg6; - (int)_checkNodeInOutlineView:(id)arg1 matchingChildForItem:(id)arg2 forString:(id)arg3 options:(unsigned long long)arg4; - (BOOL)_isItem:(id)arg1 highlightedInOutlineView:(id)arg2; - (unsigned long long)stringArray:(id)arg1 containsPartialMatch:(id)arg2; - (BOOL)_searchBackwardTable:(id)arg1 row:(long long)arg2 options:(unsigned long long)arg3; - (BOOL)_searchForwardTable:(id)arg1 row:(long long)arg2 options:(unsigned long long)arg3 skipCurrent:(BOOL)arg4; - (void)_selectRow:(long long)arg1; - (void)_checkNeedDisplayLoopForOldRow:(long long)arg1 newRow:(long long)arg2 searchForward:(BOOL)arg3; - (BOOL)_doesRow:(long long)arg1 matchSearchTerm:(id)arg2 forColumns:(id)arg3 options:(unsigned long long)arg4 useBindings:(char *)arg5; - (id)_stringForColumn:(long long)arg1 row:(long long)arg2; - (id)searchCategories; - (id)_columnsToSearch; - (id)_searchableColumns; - (void)setMainView:(id)arg1; - (id)searchTarget; - (void)setSearchTarget:(id)arg1; - (void)viewDidLoad; - (void)viewDidAppear; - (void)awakeFromNib; - (void)_searchCategorySelected:(id)arg1; - (void)_rebuildSearchMenu; - (BOOL)control:(id)arg1 textView:(id)arg2 doCommandBySelector:(SEL)arg3; - (void)performFindPanelAction:(id)arg1; - (BOOL)_performCurrentEvent; - (void)doneClicked:(id)arg1; - (void)searchButtonsClicked:(id)arg1; - (void)searchFieldAction:(id)arg1; - (void)dealloc; - (id)initWithInstrument:(id)arg1; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRFlippedClipView : NSClipView { } - (BOOL)isFlipped; @end @interface XRAnalysisCoreHistogramDecorator : XRAnalysisCoreProjectionBasedDecorator { XRAnalysisCoreHistogramTreatment *_treatment; } - (void).cxx_destruct; - (id)decorateInspectionRanges:(id)arg1; - (void)setDefaultsForPlane:(id)arg1; - (id)fillContainer:(struct DTTimelineDecorationContainer *)arg1 fromProjector:(id)arg2; - (id)initWithTrace:(id)arg1 runNumber:(long long)arg2 formatter:(id)arg3 projector:(id)arg4; - (id)initWithTrace:(id)arg1 runNumber:(long long)arg2 formatter:(id)arg3 projector:(id)arg4 treatment:(id)arg5; @end @interface XRDataElementSummaryViewController : NSViewController { int _style; PFTDataElement *_element; NSTextField *_titleField; DVTGradientImageButton *_configurationButton; NSView *_dataView; NSLayoutConstraint *_dataTopConstraint; } @property(retain, nonatomic) NSLayoutConstraint *dataTopConstraint; // @synthesize dataTopConstraint=_dataTopConstraint; @property(nonatomic) __weak NSView *dataView; // @synthesize dataView=_dataView; @property(nonatomic) __weak DVTGradientImageButton *configurationButton; // @synthesize configurationButton=_configurationButton; @property(nonatomic) __weak NSTextField *titleField; // @synthesize titleField=_titleField; @property(readonly, nonatomic) PFTDataElement *element; // @synthesize element=_element; - (void).cxx_destruct; - (void)viewWillAppear; - (void)viewDidAppear; - (void)reloadData; - (void)awakeFromNib; - (id)initWithDataElement:(id)arg1 style:(int)arg2; @end __attribute__((visibility("hidden"))) @interface XRAnalysisCoreQueryBasedDecorator : XRAnalysisCoreStandardDecorator { XRAnalysisCoreValueTreatment *_treatment; unsigned int _tableID; unsigned char _timeColumnID; unsigned char _durationColumnID; unsigned char _valueColumnID; unsigned char _valueLabelColumnID; unsigned char _colorColumnID; unsigned char _visualConnectionUUIDLabelColumnID; unsigned char _valueColumnImpType; unsigned short _valueEngineeringType; unsigned short _valueLabelEngineeringType; unsigned char _colorColumnImpType; unsigned short _colorEngineeringType; NSArray *_selectionCriteria; NSDictionary *_selectionColumnIDs; unsigned long long _highlightType; union XRBookmark _highlightBookmark; vector_59b01178 _highlightBookmarks; NSString *_groupByValue; NSString *_groupByColumnName; NSString *_valueQualifierValue; NSString *_valueQualifierColumnName; } @property(readonly) unsigned char visualConnectionUUIDLabelColumnID; // @synthesize visualConnectionUUIDLabelColumnID=_visualConnectionUUIDLabelColumnID; @property(readonly) unsigned char valueColumnID; // @synthesize valueColumnID=_valueColumnID; @property(readonly) unsigned char durationColumnID; // @synthesize durationColumnID=_durationColumnID; @property(readonly) unsigned char timeColumnID; // @synthesize timeColumnID=_timeColumnID; @property(copy, nonatomic) NSString *valueQualifierColumnName; // @synthesize valueQualifierColumnName=_valueQualifierColumnName; @property(copy, nonatomic) NSString *valueQualifierValue; // @synthesize valueQualifierValue=_valueQualifierValue; @property(copy, nonatomic) NSString *groupByColumnName; // @synthesize groupByColumnName=_groupByColumnName; @property(copy, nonatomic) NSString *groupByValue; // @synthesize groupByValue=_groupByValue; - (id).cxx_construct; - (void).cxx_destruct; - (const vector_59b01178 *)highlightBookmarks; - (void)setHighlightBookmarks:(const vector_59b01178 *)arg1; - (union XRBookmark)highlightBookmark; - (void)setHighlightBookmark:(union XRBookmark)arg1; - (unsigned long long)highlightType; - (void)clearAllHighlights; - (unsigned long long)decoratorKind; - (void)decorateInspectionRanges:(id)arg1 qualityOfService:(unsigned int)arg2 priority:(int)arg3 group:(id)arg4; - (void)decorateContainer:(struct DTTimelineDecorationContainer *)arg1 qualityOfService:(unsigned int)arg2 priority:(int)arg3 group:(id)arg4; - (unsigned int)tableID; - (id)representativeQueryFromCore:(id)arg1; - (void)decorateInspectionRanges:(id)arg1 fromCore:(id)arg2 qualityOfService:(unsigned int)arg3 priority:(int)arg4 group:(id)arg5; - (void)fillContainer:(struct DTTimelineDecorationContainer *)arg1 fromCore:(id)arg2 qualityOfService:(unsigned int)arg3 priority:(int)arg4 group:(id)arg5; - (id)_createColumnSelectionValueSets:(id)arg1 schema:(id)arg2; - (id)initWithTrace:(id)arg1 runNumber:(long long)arg2 formatter:(id)arg3; - (id)initWithTrace:(id)arg1 runNumber:(long long)arg2 formatter:(id)arg3 treatment:(id)arg4 tableID:(unsigned int)arg5 timeColumnID:(unsigned char)arg6 durationColumnID:(unsigned char)arg7 valueColumnID:(unsigned char)arg8 valueLabelColumnID:(unsigned char)arg9 colorColumnID:(unsigned char)arg10 visualConnectionUUIDLabelColumnID:(unsigned char)arg11 selectionCriteria:(id)arg12 selectionColumnIDs:(id)arg13; @end @interface XRRecordPauseItemViewController : XRTouchBarItemViewController <XRLazyKVOResponder, XRSupportsPFTWindowController> { XRLazyKVOAdapter *_observationAdapter; } + (id)_redFunctionRowAppearance; + (id)_functionRowAppearance; + (id)_stopButtonImage; + (id)_recordButtonImage; + (id)_buttonImageNamed:(id)arg1; @property(readonly, nonatomic) XRLazyKVOAdapter *observationAdapter; // @synthesize observationAdapter=_observationAdapter; - (void).cxx_destruct; - (void)_toggleRecording:(id)arg1; - (id)_recordButton; - (id)_buildRecordButton; - (void)handleLazyKVOUpdate:(id)arg1; - (void)dealloc; - (void)loadView; - (id)initWithWindowController:(id)arg1; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly, nonatomic) PFTWindowController *pftWindowController; // @dynamic pftWindowController; @property(readonly) Class superclass; @end __attribute__((visibility("hidden"))) @interface XRStrategyUIController : NSResponder <XRAnalysisCoreDetailViewControllerDelegate, XRLazyKVOResponder, NSDraggingDestination> { PFTTraceDocument *_traceDocument; BOOL _needsRefresh; BOOL _checkedForCommonDetailView; struct XRTimeRange _lastSeenSelectedTimeRange; unsigned long long _lastSeenInspectionTime; XRStrategyUIInspector *_activeInspector; unsigned long long _inspectionType; XRLazyKVOAdapter *_kvoAdapter; XRTimeFlag *_draggingFlag; NSView *_lentView; XRContext *_lentContext; XRAnalysisCoreDetailViewController *__commonDetailViewController; XRStrategyUIHighlightingController *_highlightingController; DTTimelineGraph *_timelineGraph; PFTDetailTypeHostView *_detailHostView; PFTSelectedEventDataElementList *_extendedDetailModel; unsigned long long _resolution; XRStrategyUIControllerState *_state; } + (id)_createDetailViewController; + (id)_defaultState; @property(copy, nonatomic) XRStrategyUIControllerState *state; // @synthesize state=_state; @property(nonatomic) unsigned long long resolution; // @synthesize resolution=_resolution; @property(readonly, nonatomic) XRStrategyUIInspector *activeInspector; // @synthesize activeInspector=_activeInspector; @property(nonatomic) __weak PFTSelectedEventDataElementList *extendedDetailModel; // @synthesize extendedDetailModel=_extendedDetailModel; @property(nonatomic) __weak PFTDetailTypeHostView *detailHostView; // @synthesize detailHostView=_detailHostView; @property(nonatomic) __weak DTTimelineGraph *timelineGraph; // @synthesize timelineGraph=_timelineGraph; - (void).cxx_destruct; - (void)detailViewController:(id)arg1 didUpdateExtendedDetail:(id)arg2; - (id)_currentSelectionContext:(id)arg1 container:(id)arg2; - (void)_takeControlOfDetailView; - (id)_commonDetailViewController; - (BOOL)_wantsPeriodicDraggingUpdates; - (void)_draggingEnded:(id)arg1; - (void)_concludeDragOperation:(id)arg1; - (BOOL)_performDragOperation:(id)arg1; - (BOOL)_prepareForDragOperation:(id)arg1; - (void)_draggingExited:(id)arg1; - (unsigned long long)_draggingUpdated:(id)arg1; - (unsigned long long)_draggingEntered:(id)arg1; - (void)_setDeckUnits:(long long)arg1 forRepresentedObject:(id)arg2; - (void)_collapseRepresentedObject:(id)arg1; - (void)_expandRepresentedObject:(id)arg1; - (void)_resetBottomPlane; - (void)_replaceOldState:(id)arg1 withState:(id)arg2; - (void)_bindingProblemSolved; - (BOOL)_resolution:(unsigned long long)arg1 differsFrom:(unsigned long long)arg2; - (void)_resolutionDidChange; - (void)_populateExtendedDetailModel; - (BOOL)_supportsSelection; - (void)_addFilterToNavigator:(id)arg1 planes:(id)arg2; - (void)_selectionDetailContextChanged; - (void)_brushStylesChanged; - (id)_planeForRoute:(id)arg1 representedObject:(id)arg2; - (id)_planForRunNumber:(long long)arg1; - (void)_finalShutdownHandler; - (void)_eventHorizonAdvancedThroughRange:(struct XRTimeRange)arg1; - (void)_inspectionTimeIs:(unsigned long long)arg1; - (void)_documentUpdateFilterForRunNumber:(long long)arg1; - (id)_currentSelectionFilteredDataSource; - (id)_currentSelectionIcon; - (void)_handleConsolidatedModelRefresh; - (void)_refreshModelCB; - (void)didSetInspectionTime:(unsigned long long)arg1; - (void)didChangeUpdateFilterForRunNumber:(long long)arg1; - (id)strategyControllerIdentifierRequired; - (id)strategyRootContext; - (id)selectionIcon; - (id)selectionDetailsFilteredDataSource; - (id)selectionDetailContext; - (BOOL)wantsPeriodicDraggingUpdates; - (void)draggingEnded:(id)arg1; - (void)concludeDragOperation:(id)arg1; - (BOOL)performDragOperation:(id)arg1; - (BOOL)prepareForDragOperation:(id)arg1; - (void)draggingExited:(id)arg1; - (unsigned long long)draggingUpdated:(id)arg1; - (unsigned long long)draggingEntered:(id)arg1; - (void)selectNextEvent:(id)arg1; - (void)selectPreviousEvent:(id)arg1; - (void)selectNextInstrument:(id)arg1; - (void)selectPreviousInstrument:(id)arg1; - (void)moveLeft:(id)arg1; - (void)moveRight:(id)arg1; - (BOOL)acceptsFirstResponder; - (void)shutdown; - (id)dataElementsForModalEditor; - (void)resetDetailHostView; - (void)expireLoanedDetailArea; - (void)lendDetailAreaToView:(id)arg1 context:(id)arg2; - (void)setDeckUnits:(long long)arg1 forPlane:(id)arg2; - (void)runStarted; - (void)collapsePlane:(id)arg1; - (void)expandPlane:(id)arg1; - (void)closeActiveInspector; - (void)highlightWalkClickAtTime:(unsigned long long)arg1 planes:(id)arg2; - (void)_updateOverlayPlaneAfterModelChange; - (id)planesForOverlayToMonitor; - (void)_createConnectionsIntervalDecoratorForRunNumber:(long long)arg1; - (void)_clearConnectionsDecorator; - (void)inspectionClickAtTime:(unsigned long long)arg1 planes:(id)arg2; - (void)endFlagDragAtTime:(unsigned long long)arg1; - (void)dragFlagToTime:(unsigned long long)arg1; - (BOOL)beginFlagDragAtTime:(unsigned long long)arg1; - (void)flagInspectionStartingAtFlag:(id)arg1; - (void)flagInspectionClickAtTime:(unsigned long long)arg1; - (void)_inspectFlag:(id)arg1 time:(unsigned long long)arg2; - (void)_startNewWalkSession:(id)arg1 afterOperation:(id)arg2; - (void)_startNewNavigationSession:(id)arg1 afterOperation:(id)arg2; - (void)_placeInspector:(id)arg1 options:(unsigned long long)arg2; - (void)eventHorizonAdvancedThroughRange:(struct XRTimeRange)arg1; - (void)_scrollSelectionIntoView; - (id)selectedRunPlan; - (id)strategyControllerForRunIdentifier:(int)arg1; - (void)selectSummaryFilter:(id)arg1; - (id)legend; - (id)styleViews; - (id)filterViews; - (id)displayName; - (id)model; - (void)handleLazyKVOUpdate:(id)arg1; - (id)_planesWithValue:(id)arg1 forKey:(id)arg2; - (void)timelineGraphDidLayoutWithState:(id)arg1; - (void)_restoreHighlightState; - (BOOL)_getSelectedObject:(id *)arg1 plane:(id *)arg2; - (void)modelDidRefresh; - (void)setModel:(id)arg1; - (long long)compareStrategyName:(id)arg1; - (void)dealloc; - (id)init; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRInspectorViewController : NSViewController { PFTDataView *_dataView; id <XRInspectorSource> _dataSource; PFTDataElementList *_model; } @property(retain) PFTDataElementList *model; // @synthesize model=_model; @property __weak id <XRInspectorSource> dataSource; // @synthesize dataSource=_dataSource; @property __weak PFTDataView *dataView; // @synthesize dataView=_dataView; - (void).cxx_destruct; - (void)_updateModel; - (id)supplementalTargetForAction:(SEL)arg1 sender:(id)arg2; - (void)reload; - (void)awakeFromNib; - (id)initWithDataSource:(id)arg1; - (id)init; @end @interface XRTimelineGraph : DTTimelineGraph <NSDraggingDestination> { id <NSDraggingDestination> _draggingDestinationDelegate; } @property(nonatomic) __weak id <NSDraggingDestination> draggingDestinationDelegate; // @synthesize draggingDestinationDelegate=_draggingDestinationDelegate; - (void).cxx_destruct; - (void)moveRight:(id)arg1; - (void)moveLeft:(id)arg1; - (void)moveDown:(id)arg1; - (void)moveUp:(id)arg1; - (BOOL)wantsPeriodicDraggingUpdates; - (void)draggingEnded:(id)arg1; - (void)concludeDragOperation:(id)arg1; - (BOOL)performDragOperation:(id)arg1; - (BOOL)prepareForDragOperation:(id)arg1; - (void)draggingExited:(id)arg1; - (unsigned long long)draggingUpdated:(id)arg1; - (unsigned long long)draggingEntered:(id)arg1; - (void)viewDidMoveToWindow; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRGeneralPreferencesModule : XRPreferencesModule <NSOpenSavePanelDelegate, NSTextFieldDelegate> { } - (void)resetDontAskMeWarnings:(id)arg1; - (BOOL)isResizable; - (id)imageForPreferenceNamed:(id)arg1; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRInstrumentsStrategyUIController : XRStrategyUIController { NSMutableDictionary *_topLevelItemsByUUID; XRInstrumentStrategyTopLevelItem *_selectedInstrumentTopLevelItem; long long _lastRunNumberSelected; BOOL _instrumentListMutated; BOOL _instrumentSelectionMutated; BOOL _fullTrackRefresh; XRLazyKVOAdapter *_kvoAdapter; XRInstrumentsTimelineAccessibilityElement *_timelineAccessibilityElement; id _selectionObject; } + (id)_defaultState; + (id)_requiredStrategyControllerIdentifier; + (id)_createDetailViewController; @property(retain, nonatomic) id selectionObject; // @synthesize selectionObject=_selectionObject; - (void).cxx_destruct; - (void)handleLazyKVOUpdate:(id)arg1; - (void)deleteForward:(id)arg1; - (void)deleteBackward:(id)arg1; - (void)keyDown:(id)arg1; - (BOOL)_performDragOperation:(id)arg1; - (BOOL)_prepareForDragOperation:(id)arg1; - (unsigned long long)draggingUpdated:(id)arg1; - (unsigned long long)_draggingEntered:(id)arg1; - (void)_setDeckUnits:(long long)arg1 forRepresentedObject:(id)arg2; - (void)_collapseRepresentedObject:(id)arg1; - (void)_expandRepresentedObject:(id)arg1; - (void)_replaceOldState:(id)arg1 withState:(id)arg2; - (void)_resolutionDidChange; - (void)_populateExtendedDetailModel; - (void)_eventHorizonAdvancedThroughRange:(struct XRTimeRange)arg1; - (void)_inspectionTimeIs:(unsigned long long)arg1; - (void)_documentUpdateFilterForRunNumber:(long long)arg1; - (void)_setModelSelection:(id)arg1; - (id)_topLevelItemForInstrument:(id)arg1; - (BOOL)_resolution:(unsigned long long)arg1 differsFrom:(unsigned long long)arg2; - (void)_resetPlanesInTimeline; - (id)planesForOverlayToMonitor; - (id)_currentSelectionFilteredDataSource; - (id)_currentSelectionContext:(id)arg1 container:(id)arg2; - (id)_currentSelectionIcon; - (void)_finalShutdownHandler; - (void)_takeControlOfDetailView; - (void)_forceInstrumentSelection; - (void)_updateSelectedPlanes; - (void)_handleConsolidatedModelRefresh; - (void)_setTimelineGraph:(id)arg1; - (void)setModel:(id)arg1; - (void)selectInstrument:(id)arg1; - (id)dataElementsForModalEditor; - (id)planeForSelection:(id)arg1 embeddableInTimeline:(id)arg2; - (id)displayName; - (id)_state; - (id)init; @end @interface XRInstrumentStrategyTopLevelItem : NSObject { XRTrack *_blankTrack; DTTimelineGroupPlane *_plane; DTTimelineGroupPlane *_containerPlane; XRIntKeyedDictionary *_tracksByRunNumber; long long _maxKnownIndex; } @property(readonly, nonatomic) long long maxKnownIndex; // @synthesize maxKnownIndex=_maxKnownIndex; @property(readonly, nonatomic) XRIntKeyedDictionary *tracksByRunNumber; // @synthesize tracksByRunNumber=_tracksByRunNumber; @property(readonly, nonatomic) DTTimelineGroupPlane *containerPlane; // @synthesize containerPlane=_containerPlane; @property(readonly, nonatomic) DTTimelineGroupPlane *plane; // @synthesize plane=_plane; - (void).cxx_destruct; - (void)updateStatus:(id)arg1; - (void)handleBrushChange:(id)arg1; - (id)representativePlaneForManager:(id)arg1 instrument:(id)arg2; - (void)syncPlanesWithManager:(id)arg1 trace:(id)arg2 resolution:(unsigned long long)arg3 instrument:(id)arg4; - (void)syncPlanesWithManager:(id)arg1 trace:(id)arg2 resolution:(unsigned long long)arg3 instrument:(id)arg4 forEmbedding:(BOOL)arg5; - (void)syncPlanesWithManager:(id)arg1 trace:(id)arg2 resolution:(unsigned long long)arg3 instrument:(id)arg4 forEmbedding:(BOOL)arg5 inToolbar:(BOOL)arg6; - (id)init; @end @interface XRInstrumentsStrategyUIControllerState : XRStrategyUIControllerState { NSMutableSet *_instrumentUUIDsWithDisclosedRuns; } + (id)archivableKeys; @property(readonly, nonatomic) NSMutableSet *instrumentUUIDsWithDisclosedRuns; // @synthesize instrumentUUIDsWithDisclosedRuns=_instrumentUUIDsWithDisclosedRuns; - (void).cxx_destruct; - (id)init; @end @interface XRActivityToolbarItem : XRToolbarItem { unsigned long long _hours; unsigned long long _minutes; unsigned long long _seconds; } @property(readonly) XRActivityView *activityView; - (long long)visibilityPriority; - (struct CGSize)minSize; - (struct CGSize)maxSize; - (void)disconnectFromContext; - (void)connectToContext:(id)arg1; - (void)_runWasSelected:(id)arg1; - (void)_updateRuns:(unsigned long long)arg1 selectedRunIndex:(unsigned long long)arg2; - (void)observeValueForKeyPath:(id)arg1 ofObject:(id)arg2 change:(id)arg3 context:(void *)arg4; - (void)_inspectionHeadChanged:(id)arg1; - (void)_updateTime; @end @interface XRThreadsStrategyUIController : XRDefaultHostingStrategyUIController <NSPopoverDelegate, XRUIModelChangeObserver, XRLazyKVOResponder> { XRStrategiesToolbarButton *_processes; NSButton *_clearFilterButton; NSPopover *_popOver; XRThreadFilterViewController *_threadFilterController; XRProcessAndThreadListModel *_knownProcessesAndThreads; XRProcessAndThreadListModel *_restrictedProcessesAndThreads; XRThreadListLimiter *_limiter; XRIntKeyedDictionary *_includedThreadsByRun; XRElementSetModel *_includedThreads; long long _mySelectedRunNumber; NSOperation *_updateStrategyControllerOp; NSPopUpButton *_displayStyle; XRThreadStrategyController *_observedTSC; XRLazyKVOAdapter *_kvoAdapter; XRIntKeyedDictionary *_trackByThreadID; XRAnalysisCoreTrackConfigurator *_trackConfigurator; XRThreadsTimelineAccessibilityElement *_timelineAccessibilityElement; } + (id)_defaultState; + (id)_requiredStrategyControllerIdentifier; @property(readonly, nonatomic) XRThreadStrategyController *observedTSC; // @synthesize observedTSC=_observedTSC; - (void).cxx_destruct; - (BOOL)_supportsSelection; - (void)_finalShutdownHandler; - (void)_addFilterToNavigator:(id)arg1 planes:(id)arg2; - (id)_currentSelectionIcon; - (void)_setModelSelection:(id)arg1; - (void)_setTimelineGraph:(id)arg1; - (void)setModel:(id)arg1; - (BOOL)_resolution:(unsigned long long)arg1 differsFrom:(unsigned long long)arg2; - (void)_resolutionDidChange; - (void)_resetPlanesInTimeline; - (void)_replaceOldState:(id)arg1 withState:(id)arg2; - (void)_handleConsolidatedModelRefresh; - (void)modelDidChange:(id)arg1; - (void)_styleSelected:(id)arg1; - (void)setStyle:(id)arg1; - (void)observeValueForKeyPath:(id)arg1 ofObject:(id)arg2 change:(id)arg3 context:(void *)arg4; - (void)handleLazyKVOUpdate:(id)arg1; - (void)updateSelectedRun; - (void)updateDisplayOptions; - (void)updateThreadsAndProcesses; - (void)excludeThreads:(id)arg1; - (void)includeThreads:(id)arg1; - (void)_backupIncludedThreads; - (void)_updateStrategyControllerThreads; - (void)restrictThreadToContainString:(id)arg1; - (void)restrictThreadList:(id)arg1; - (void)_clearFilterAction:(id)arg1; - (void)_threadFilterButtonClicked:(id)arg1; @property(readonly, nonatomic) XRIntKeyedDictionary *trackByThreadID; - (id)styleViews; - (id)filterViews; - (id)displayName; - (void)dealloc; - (id)init; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRThreadsStrategyUIControllerState : XRStrategyUIControllerState { } @end @interface XRProgressIndicator : NSProgressIndicator { } - (void)drawRect:(struct CGRect)arg1; - (void)_drawBar:(BOOL)arg1; - (id)init; @end @interface XRAnalysisCoreCallTreeViewController : NSViewController <XRCallTreeDataSource, XRFilteredDataSource> { XRSlidingCapableScrollView *_callTreeScrollView; XRCallTreeDetailView *_callTreeView; XRMultiProcessBacktraceRepository *_backtraceRepository; XRIntKeyedDictionary *_wrappers; NSMutableDictionary *_aggregatorByCategory; unsigned int _backtraceAggIdx; unsigned char _backtraceDim; unsigned char _threadDim; unsigned char _categoryDim; NSString *_categoryDimName; XREngineeringTypeFormatter *_myEngFormatter; XRAnalysisCoreProjector *_projector; NSTimer *_deferredSelectionUpdateTimer; NSDictionary *_activeFocusInfo; id <XRAnalysisCoreCallTreeViewControllerDelegate> _delegate; } @property(nonatomic) __weak id <XRAnalysisCoreCallTreeViewControllerDelegate> delegate; // @synthesize delegate=_delegate; - (void).cxx_destruct; - (void)filterDetailWithTokens:(id)arg1 context:(id)arg2 matchesAny:(BOOL)arg3; - (id)searchContexts; - (id)selectedSearchContext; - (void)refineQueryBasedOnUIState:(id)arg1; - (id)contextRepresentation; - (id)currentCallTreeFilter; - (void)_stackFrameSelected:(id)arg1; - (void)_focusOnCallTreeNode:(id)arg1; - (id)dataElementForHeaviestStack; - (id)dataMiningElementsWithState; - (id)processCategoriesForPid:(int)arg1; - (id)provideCategories; - (id)backtracesForCategory:(id)arg1 timeRange:(struct XRTimeRange)arg2 savedIndex:(unsigned long long *)arg3; - (void)resetAggregatesForRepository:(id)arg1; - (void)_deferredSelectionTimeout:(id)arg1; - (void)restoreUIState:(id)arg1; - (void)saveUIState:(id)arg1; - (void)refresh; - (void)instrumentWillBecomeInvalid; - (void)_mainThreadAdaptCallTree; - (void)_mainThreadFillAggregator; - (void)_mainThreadRepoDidReset; - (void)viewWillLayout; - (void)viewWillAppear; - (void)loadView; - (void)setRepresentedObject:(id)arg1; - (void)dealloc; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRInteractiveContentController : NSViewController { } @end @interface XRCPUsPreferencesModule : XRPreferencesModule <XRCPUmanagerDelegateProtocol> { XRCPUmanager *_processorMgr; NSSlider *_activeProcessorsSlider; NSTextField *_activeProcessorsText; NSTextField *_maxProcessorsText; NSButton *_activeProcessorsHTCheck; } @property __weak NSButton *activeProcessorsHTCheck; // @synthesize activeProcessorsHTCheck=_activeProcessorsHTCheck; @property __weak NSTextField *maxProcessorsText; // @synthesize maxProcessorsText=_maxProcessorsText; @property __weak NSTextField *activeProcessorsText; // @synthesize activeProcessorsText=_activeProcessorsText; @property __weak NSSlider *activeProcessorsSlider; // @synthesize activeProcessorsSlider=_activeProcessorsSlider; - (void).cxx_destruct; - (void)updateActiveProcessorCoreCount; - (void)_updateActiveProcessorCoreCount; - (void)toggleHyperThreading:(id)arg1; - (void)changeActiveProcessorCores:(id)arg1; - (BOOL)isResizable; - (id)imageForPreferenceNamed:(id)arg1; - (void)initializeFromDefaults; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRInspectionHeadDecorator : DTTimelineDecorator { unsigned long long _inspectionTime; } @property(nonatomic) unsigned long long inspectionTime; // @synthesize inspectionTime=_inspectionTime; - (id)decorateContainer:(struct DTTimelineDecorationContainer *)arg1; - (void)setDefaultsForPlane:(id)arg1; - (id)init; @end @interface XRMainWindowUIState : NSObject <NSSecureCoding> { int _currentLayout; NSString *_selectedStrategyIdentifier; double _splitterValue; unsigned long long _inspectionTime; unsigned long long _nanosecondsPerPoint; unsigned long long _trackTimeOffset; double _trackYOffset; id <NSCoding><NSObject> _displayedDetailContextValue; XRContext *_displayedContext; NSString *_mode; struct XRTimeRange _selectedTimeRange; } + (BOOL)supportsSecureCoding; + (id)keyPathsForValuesAffectingInspectionTimeInSeconds; + (id)keyPathsForValuesAffectingLowerDisplayHidden; + (id)keyPathsForValuesAffectingEventInspectorHidden; + (id)keyPathsForValuesAffectingSelectedStrategy; + (long long)version; @property(retain, nonatomic) NSString *mode; // @synthesize mode=_mode; @property(retain, nonatomic) XRContext *displayedContext; // @synthesize displayedContext=_displayedContext; @property(retain, nonatomic) id <NSCoding><NSObject> displayedDetailContextValue; // @synthesize displayedDetailContextValue=_displayedDetailContextValue; @property(nonatomic) double trackYOffset; // @synthesize trackYOffset=_trackYOffset; @property(nonatomic) unsigned long long trackTimeOffset; // @synthesize trackTimeOffset=_trackTimeOffset; @property(nonatomic) unsigned long long nanosecondsPerPoint; // @synthesize nanosecondsPerPoint=_nanosecondsPerPoint; @property(nonatomic) struct XRTimeRange selectedTimeRange; // @synthesize selectedTimeRange=_selectedTimeRange; @property(nonatomic) unsigned long long inspectionTime; // @synthesize inspectionTime=_inspectionTime; @property(nonatomic) double splitterValue; // @synthesize splitterValue=_splitterValue; @property(retain, nonatomic) NSString *selectedStrategyIdentifier; // @synthesize selectedStrategyIdentifier=_selectedStrategyIdentifier; @property(nonatomic) int currentLayout; // @synthesize currentLayout=_currentLayout; - (void).cxx_destruct; - (void)encodeWithCoder:(id)arg1; @property(readonly, nonatomic, getter=isLowerDisplayHidden) BOOL lowerDisplayHidden; @property(readonly, nonatomic, getter=isEventInspectorHidden) BOOL eventInspectorHidden; @property(readonly, nonatomic) double inspectionTimeInSeconds; @property(readonly, nonatomic) XRStrategyInfo *selectedStrategy; - (id)initWithCoder:(id)arg1; - (id)init; @end @interface XRPreferencesModule : NSPreferencesModule <XRUIModelChangeObserver> { NSView *preferencesView; } - (void).cxx_destruct; - (void)modelDidChange:(id)arg1; - (void)dealloc; - (id)init; @end @interface XRGenericFillView : NSView { } - (void)drawRect:(struct CGRect)arg1; @end @interface XRRecordingPreferencesModule : XRPreferencesModule { NSPopUpButton *_documentLocationPopup; DVTFilePathField *_defaultDocumentLocationTextField; DVTFilePathField *_defaultDocumentLocationDisplay; NSButton *_enableSpinProfilingButton; NSTextField *_sampleDurationTextField; NSNumberFormatter *_samplingDurationFormatter; } @property __weak NSNumberFormatter *samplingDurationFormatter; // @synthesize samplingDurationFormatter=_samplingDurationFormatter; @property __weak NSTextField *sampleDurationTextField; // @synthesize sampleDurationTextField=_sampleDurationTextField; @property __weak NSButton *enableSpinProfilingButton; // @synthesize enableSpinProfilingButton=_enableSpinProfilingButton; @property __weak DVTFilePathField *defaultDocumentLocationDisplay; // @synthesize defaultDocumentLocationDisplay=_defaultDocumentLocationDisplay; @property __weak DVTFilePathField *defaultDocumentLocationTextField; // @synthesize defaultDocumentLocationTextField=_defaultDocumentLocationTextField; @property __weak NSPopUpButton *documentLocationPopup; // @synthesize documentLocationPopup=_documentLocationPopup; - (void).cxx_destruct; - (void)saveChanges; - (void)modelDidChange:(id)arg1; - (void)_updateFields; - (void)samplingDurationChange:(id)arg1; - (void)controlTextDidChange:(id)arg1; - (void)_chooseDefaultDocumentLocation:(id)arg1; - (void)_updateDefaultDocumentPopupView:(BOOL)arg1; - (void)spinProfilingPreferenceChanged:(id)arg1; - (void)openKeyboardShortcuts:(id)arg1; - (BOOL)isResizable; - (id)imageForPreferenceNamed:(id)arg1; - (void)initializeFromDefaults; @end @interface XRClearBackgroundButtonCell : NSButtonCell { } @end @interface XRClearBackgroundButton : NSButton { } + (void)initialize; - (void)awakeFromNib; - (id)init; @end @interface XRCPUmanager : NSObject { id _delegate; int _maxPhysicalCPUCount; int _maxLogicalCPUCount; int _curPhysicalCPUCount; int _curLogicalCPUCount; int _curActiveCPUCount; BOOL _supportsLogicalCPUs; BOOL _hwThreadsEnabled; int _desiredActiveCoreCount; } - (void).cxx_destruct; - (void)_activeCPUCountChanged:(id)arg1; - (void)setActiveCoreCount:(int)arg1; - (void)enableSMT:(BOOL)arg1; - (void)_updateActiveCores; - (BOOL)SMTisEnabled; - (int)activeCoreCount; - (int)physicalCoreCount; - (int)logicalCoreCount; - (BOOL)coresSupportSMT; - (int)maxPhysicalCoreCount; - (int)maxLogicalCoreCount; - (void)setDelegate:(id)arg1; - (id)delegate; - (void)dealloc; - (id)init; @end @interface XRHelpManager : NSObject { } + (id)defaultHelpManager; - (void)displayUUID:(id)arg1; - (BOOL)displayAppleRef:(id)arg1; - (id)init; @end @interface XRAnalysisCoreTableViewNarrativePersonality : XRAnalysisCoreTableViewPersonality { } - (BOOL)adjustRowHeightToFitNarratives; - (BOOL)shouldAddFocusActionToColumn:(id)arg1 abstractContent:(id)arg2; - (void)personalizeView:(id)arg1 forColumn:(id)arg2; - (void)personalizeColumnItem:(id)arg1; - (void)personalizeTableView:(id)arg1; - (void)personalizeValueFormatter:(id)arg1; @end @interface XRCSLoggerHelper : NSObject { } + (void)logDocumentName:(id)arg1 runIndex:(long long)arg2 processName:(id)arg3 pid:(int)arg4 threadName:(id)arg5 tid:(unsigned long long)arg6 instructionAddress:(unsigned long long)arg7 symbolAddress:(unsigned long long)arg8 symbolName:(id)arg9 libraryName:(id)arg10 kernel:(BOOL)arg11 machTime:(unsigned long long)arg12 symbolicator:(struct _CSTypeRef)arg13 kernelSymbolicator:(struct _CSTypeRef)arg14; + (void)logDocumentName:(id)arg1 runIndex:(long long)arg2 processRepository:(id)arg3 commonRawStack:(id)arg4 tid:(unsigned long long)arg5 machTime:(unsigned long long)arg6; + (id)menuItemForDetailViewObject:(id)arg1 withSelector:(SEL)arg2 andTarget:(id)arg3; @end @interface XRTopicBrowserOutlineView : DVTOutlineView { NSTextFieldCell *_dataCellForGroupRow; } - (void).cxx_destruct; - (id)preparedCellAtColumn:(long long)arg1 row:(long long)arg2; - (id)_dataCellForGroupRow; - (id)_groupRowFont; - (struct CGRect)frameOfCellAtColumn:(long long)arg1 row:(long long)arg2; @end @interface XRDetailViewBusyModeController : XRNonInteractiveModeViewController { NSProgressIndicator *_progressView; NSTextField *_progressText; } @property(nonatomic) __weak NSTextField *progressText; // @synthesize progressText=_progressText; @property(nonatomic) __weak NSProgressIndicator *progressView; // @synthesize progressView=_progressView; - (void).cxx_destruct; - (void)_setProgressMessage:(id)arg1 additionalMessage:(id)arg2; - (void)_setProgressCompletion:(double)arg1; - (void)viewDidLoad; - (id)init; @end @interface XRAnalysisCoreTableViewRow : NSTableRowView <XRAnalysisCoreTableViewRow> { long long _signature; unsigned long long _edgeDecoration; } + (void)copySelectionToPasteboardFromAnalysisCoreTableView:(id)arg1; @property(nonatomic) unsigned long long edgeDecoration; // @synthesize edgeDecoration=_edgeDecoration; @property(nonatomic) long long signature; // @synthesize signature=_signature; - (id)attributedStringValue; - (void)setSelected:(BOOL)arg1; - (void)setEmphasized:(BOOL)arg1; - (void)drawRect:(struct CGRect)arg1; - (void)didAddSubview:(id)arg1; - (id)initWithFrame:(struct CGRect)arg1; // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end @interface XRScopeButtonCell : DVTScopeBarButtonCell { } - (struct CGRect)drawTitle:(id)arg1 withFrame:(struct CGRect)arg2 inView:(id)arg3; @end @interface XRScopeButton : DVTScopeBarButton { } + (Class)cellClass; - (id)initWithFrame:(struct CGRect)arg1; @end @interface XRScopeBarView : DVTBorderedView { NSView *_lastElement; BOOL _lastIsSeparator; NSMutableDictionary *_buttonHandlers; CDUnknownBlockType _compositionDestructor; } + (id)scopeBarFont; - (void).cxx_destruct; - (void)_scopeButtonClicked:(id)arg1; - (void)removeAllSections; - (void)addControlsSection:(id)arg1; - (void)addScopingSection:(id)arg1 options:(int)arg2 configuration:(CDUnknownBlockType)arg3; - (void)_addSectionSeparator; - (void)_addControl:(id)arg1; - (void)_appendDestructorBlock:(CDUnknownBlockType)arg1; - (void)_registerButton:(id)arg1 inGroup:(id)arg2 options:(int)arg3 withHandler:(CDUnknownBlockType)arg4; - (void)dealloc; - (id)initWithFrame:(struct CGRect)arg1; @end @interface NSWindow (XrayPrivateAPI) - (void)centerOnScreen; @end @interface NSView (PrivateXraySortMethods) - (void)xray_unbindEnabledToObject:(id)arg1 withKeyPath:(id)arg2 options:(id)arg3; - (void)xray_bindEnabledToObject:(id)arg1 withKeyPath:(id)arg2 options:(id)arg3; - (long long)xray_horizontalCompare:(id)arg1; @end @interface XRAnalysisCoreHistogramTreatment (Decorators) - (void)setupPlane:(id)arg1; - (id)decoratorFromCore:(id)arg1 tableID:(unsigned int)arg2 trace:(id)arg3 runNumber:(long long)arg4 context:(id)arg5; @end @interface XRAnalysisCoreValueTreatment (Decorators) - (void)setupPlane:(id)arg1; - (id)decoratorFromCore:(id)arg1 tableID:(unsigned int)arg2 trace:(id)arg3 runNumber:(long long)arg4 context:(id)arg5; @end @interface NSTextView (SimpleEditing) - (void)pft_applySimpleEditorSettings; @end @interface NSPathCell (xray_Accessibility) - (id)xray_accessibilityPopUpMenuParent:(id)arg1; - (id)xray_accessibilityChildMenuForChild:(id)arg1; - (void)xray_accessibilityPerformPressForChild:(id)arg1; - (id)xray_accessibilitySizeOfChild:(id)arg1; - (id)xray_accessibilityPositionOfChild:(id)arg1; - (struct CGRect)xray_accessibilityScreenRectForPathComponent:(id)arg1; - (id)accessibilityActionNames; - (id)accessibilityHitTest:(struct CGPoint)arg1; - (id)accessibilityAttributeValue:(id)arg1; - (id)xray_accessibilityObjectForComponentCell:(id)arg1 atIndex:(unsigned long long)arg2; @end @interface XRAnalysisCoreTableQuery (UIPlanFilters) + (id)filterWithCore:(id)arg1 schema:(id)arg2 strategyContext:(id)arg3 selectionCriteria:(id)arg4; @end @interface NSImage (PrivateAPI) + (id)menuImageForApplication:(id)arg1; + (id)imageForApplication:(id)arg1; + (id)imageForFile:(id)arg1; + (id)menuImageForPid:(int)arg1; + (id)imageNamed:(id)arg1 forClass:(Class)arg2; + (id)imageNamed:(id)arg1 forBundle:(id)arg2; + (id)searchBundlesForImageNamed:(id)arg1; @end @interface NSError (InstrumentsKit) + (id)instrumentsKitEmptyBrushError:(id)arg1; + (id)instrumentsKitErrorWithCode:(unsigned long long)arg1; @end @interface XRAbstractFileSystem (NSBrowserDelegate) - (id)browser:(id)arg1 previewViewControllerForLeafItem:(id)arg2; - (BOOL)browser:(id)arg1 writeRowsWithIndexes:(id)arg2 inColumn:(long long)arg3 toPasteboard:(id)arg4; - (void)browser:(id)arg1 willDisplayCell:(id)arg2 atRow:(long long)arg3 column:(long long)arg4; - (id)browser:(id)arg1 objectValueForItem:(id)arg2; - (BOOL)browser:(id)arg1 isLeafItem:(id)arg2; - (id)browser:(id)arg1 child:(long long)arg2 ofItem:(id)arg3; - (long long)browser:(id)arg1 numberOfChildrenOfItem:(id)arg2; @end @interface NSButton (XRExtensionsForDFR) + (id)xr_dfr_buttonWithTitle:(id)arg1 image:(id)arg2 target:(id)arg3 action:(SEL)arg4; @end #endif /* InstrumentsKit_framework_h */
38.08019
769
0.781845
f879dc2dfad094563a197a6e775c52624b3f4317
897
h
C
Classes/CBExchange.h
joshbeal/coinbase-ios-sdk
153cfb2bd4fa75c8342b7c651df989fb3cc0e448
[ "MIT" ]
6
2015-01-03T20:19:26.000Z
2021-11-08T09:58:54.000Z
Classes/CBExchange.h
joshbeal/coinbase-ios-sdk
153cfb2bd4fa75c8342b7c651df989fb3cc0e448
[ "MIT" ]
3
2015-01-25T20:37:09.000Z
2017-09-20T05:41:12.000Z
Classes/CBExchange.h
joshbeal/coinbase-ios-sdk
153cfb2bd4fa75c8342b7c651df989fb3cc0e448
[ "MIT" ]
3
2017-01-02T19:33:57.000Z
2020-11-17T22:41:30.000Z
// // CBExchange.h // Handshake // // Created by Josh Beal on 12/10/13. // Copyright (c) 2013 Handshake. All rights reserved. // #import <Foundation/Foundation.h> #import "CBRequest.h" typedef void (^PriceHandler)(NSString *price, NSError *error); typedef void (^CurrenciesHandler)(NSArray* currencies, NSError *error); @interface CBExchange : NSObject + (void)getTransfers:(CBResponseHandler)handler; + (void)getBuyPrice:(NSNumber*)qty withHandler:(PriceHandler)handler; + (void)getSellPrice:(NSNumber*)qty withHandler:(PriceHandler)handler; + (void)getSpotRate:(NSString *)currency withHandler:(PriceHandler)handler; + (void)buyBitcoin:(NSNumber*)qty withHandler:(CBResponseHandler)handler; + (void)sellBitcoin:(NSNumber*)qty withHandler:(CBResponseHandler)handler; + (void)getExchangeRates:(CBResponseHandler)handler; + (void)getSupportedCurrencies:(CurrenciesHandler)handler; @end
29.9
75
0.77146
76e020bb774655b7334c1b5a10f228dce8663c37
2,905
c
C
src/parser_load.c
olesgedz/Scop_c
982f1bf414b14546904216eda610b662bd826e24
[ "Apache-2.0" ]
null
null
null
src/parser_load.c
olesgedz/Scop_c
982f1bf414b14546904216eda610b662bd826e24
[ "Apache-2.0" ]
null
null
null
src/parser_load.c
olesgedz/Scop_c
982f1bf414b14546904216eda610b662bd826e24
[ "Apache-2.0" ]
null
null
null
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* parser_load.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: jblack-b <jblack-b@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2021/01/06 14:12:14 by jblack-b #+# #+# */ /* Updated: 2021/01/06 15:42:28 by jblack-b ### ########.fr */ /* */ /* ************************************************************************** */ #include <fcntl.h> #include "ugl.h" #include "mesh.h" #include "libft.h" int array_len(void **tab) { int i; i = 0; while (tab[i] != NULL) i++; return (i); } GLuint *array_copy(GLuint *array, int length, int m) { int i; GLuint *new; i = -1; new = (GLuint*)ft_memalloc_s(sizeof(GLuint) * length); while (++i < length - m) new[i] = array[i]; free(array); array = new; return (new); } GLfloat *add_vertices(GLfloat *array, char *line, int *length) { int i; int j; char **tab; GLfloat *new; tab = ft_strsplit(&line[1], ' '); *length += 3; new = (GLfloat*)ft_memalloc(sizeof(GLfloat) * *length); i = -1; while (++i < *length - 3) new[i] = array[i]; free(array); array = new; j = -1; while (tab[++j] != NULL) { array[*length - 3 + j] = (GLfloat)ft_atof(tab[j]); ft_strdel(&tab[j]); } ft_strdel(&tab[j]); ft_memdel((void *)&tab); return (array); } GLuint *add_indices(GLuint *array, char *line, int *length) { int j; int l; char **tab; tab = ft_strsplit(&line[1], ' '); l = array_len((void**)tab) == 4 ? 6 : 3; *length += l; array = array_copy(array, *length, l); j = -1; while (++j < 3) { array[*length - l + j] = (GLuint)ft_atoi(tab[j]) - 1; if (l == 6) array[*length - l + 3 + j] = (GLuint)ft_atoi(tab[j > 0 ? j + 1 : 0]) - 1; ft_strdel(&tab[j]); } ft_strdel(&tab[j]); ft_memdel((void *)&tab); return (array); } t_vec3 center_axis(GLfloat *vertices, int num_vertices) { int i; t_vec3 max; t_vec3 min; t_vec3 center; i = 0; max = (t_vec3){0, 0, 0}; min = (t_vec3){0, 0, 0}; while (i < num_vertices - 6) { vertices[i] > max.x ? max.x = vertices[i] : 0; vertices[i] < min.x ? min.x = vertices[i] : 0; vertices[i + 1] > max.y ? max.y = vertices[i + 1] : 0; vertices[i + 1] < min.y ? min.y = vertices[i + 1] : 0; vertices[i + 2] > max.z ? max.z = vertices[i + 2] : 0; vertices[i + 2] < min.z ? min.z = vertices[i + 2] : 0; i += 6; } center = ft_vec3_scalar_multiply(ft_vec3_sum(max, min), 0.5); return (center); }
25.26087
80
0.428227
742b4e5a2cfdd911d2a02b36c95ce9aae001fe01
1,978
h
C
Source/Graphics/Resources/Texture.h
aiekick/VulkanRTSEngine
b02c0d0fa1530dc920fde2a9928bd540cfdd31e6
[ "Apache-2.0" ]
1
2021-05-11T07:52:05.000Z
2021-05-11T07:52:05.000Z
Source/Graphics/Resources/Texture.h
aiekick/VulkanRTSEngine
b02c0d0fa1530dc920fde2a9928bd540cfdd31e6
[ "Apache-2.0" ]
null
null
null
Source/Graphics/Resources/Texture.h
aiekick/VulkanRTSEngine
b02c0d0fa1530dc920fde2a9928bd540cfdd31e6
[ "Apache-2.0" ]
null
null
null
#pragma once #include <Core/Resources/Resource.h> #include "../Interfaces/ITexture.h" // Base class for creating specialized Textures class Texture : public Resource, public ITexture { public: static constexpr StaticString kDir = Resource::AssetsFolder + "textures/"; static unsigned char* LoadFromDisk(const std::string& aPath, Format aFormat, int& aWidth, int& aHeight); static unsigned short* LoadFromDisk16(const std::string& aPath, Format aFormat, int& aWidth, int& aHeight); static void FreePixels(unsigned char* aBuffer); static void FreePixels(unsigned short* aBuffer); public: Texture(); Texture(Resource::Id anId, const std::string& aPath); ~Texture(); Format GetFormat() const { return myFormat; } void SetFormat(Format aFormat) { myFormat = aFormat; } uint32_t GetWidth() const { return myWidth; } void SetWidth(uint32_t aWidth) { myWidth = aWidth; } uint32_t GetHeight() const { return myHeight; } void SetHeight(uint32_t aHeight) { myHeight = aHeight; } WrapMode GetWrapMode() const { return myWrapMode; } void SetWrapMode(WrapMode aWrapMode) { myWrapMode = aWrapMode; } Filter GetMinFilter() const { return myMinFilter; } void SetMinFilter(Filter aMinFilter) { myMinFilter = aMinFilter; } Filter GetMagFilter() const { return myMagFilter; } void SetMagFilter(Filter aMAgFilter) { myMagFilter = aMAgFilter; } bool IsUsingMipMaps() const { return myEnableMipmaps; } void EnableMipMaps(bool aEnabled) { myEnableMipmaps = aEnabled; } unsigned char* GetPixels() const { return myPixels; } void SetPixels(unsigned char* aPixels, bool aShouldOwn = true); protected: unsigned char* myPixels; uint32_t myWidth; uint32_t myHeight; Format myFormat; WrapMode myWrapMode; Filter myMinFilter; Filter myMagFilter; bool myEnableMipmaps; private: void FreePixels(); bool UsesDescriptor() const override final; void OnLoad(const File& aFile) override; void Serialize(Serializer& aSerializer) override final; bool myOwnsBuffer; };
31.396825
108
0.758342
a1f410db5477ec7d56402f16d9794eb98adfdd7d
39,618
h
C
mpfrc++/mpcomplex.h
Ndersam/mplapack
f2ef54d7ce95e4028d3f101a901c75d18d3f1327
[ "BSD-3-Clause-Open-MPI" ]
26
2019-03-20T04:06:03.000Z
2022-03-02T10:21:01.000Z
mpfrc++/mpcomplex.h
Ndersam/mplapack
f2ef54d7ce95e4028d3f101a901c75d18d3f1327
[ "BSD-3-Clause-Open-MPI" ]
5
2019-03-04T03:32:41.000Z
2021-12-01T07:47:25.000Z
mpfrc++/mpcomplex.h
Ndersam/mplapack
f2ef54d7ce95e4028d3f101a901c75d18d3f1327
[ "BSD-3-Clause-Open-MPI" ]
5
2019-03-09T17:50:26.000Z
2022-03-10T19:46:20.000Z
/* * Copyright (c) 2010-2021 * Nakata, Maho * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ /* Complex class declare for the MPFR */ #ifndef __MP_COMPLEX_H__ #define __MP_COMPLEX_H__ #include "mpreal.h" #include "mpc.h" #include <complex> #if defined ___MPLAPACK_BUILD_WITH_GMP___ #include "gmpxx.h" #include "mpc_class.h" #endif #if defined ___MPLAPACK_BUILD_WITH_QD___ #include "qd_complex.h" #endif #if defined ___MPLAPACK_BUILD_WITH_DD___ #include "dd_complex.h" #endif namespace mpfr { class mpcomplex { private: mpc_t mpc; public: static mpc_rnd_t default_rnd; static mp_prec_t default_real_prec; static mp_prec_t default_imag_prec; static int default_base; static int double_bits; // constructor & deconstructor mpcomplex(); mpcomplex(const mpc_t a); mpcomplex(const mpfr_t a, const mpfr_t b); mpcomplex(const mpf_t a, const mpf_t b); mpcomplex(const char *s, mp_prec_t pr = default_real_prec, mp_prec_t pi = default_imag_prec, mpc_rnd_t mode = default_rnd); mpcomplex(const mpcomplex &a); mpcomplex(const std::complex<double> &a, mp_prec_t pr = default_real_prec, mp_prec_t pi = default_imag_prec, mpc_rnd_t mode = default_rnd); mpcomplex(const std::complex<long double> &a, mp_prec_t pr = default_real_prec, mp_prec_t pi = default_imag_prec, mpc_rnd_t mode = default_rnd); mpcomplex(const mpreal &a, const mpreal &b); mpcomplex(const mpreal &a, const double &b); // this is required for initialization a variable with COMPLEX (a, 0.0) etc. mpcomplex(const double &a, const double &b, mp_prec_t pr = default_real_prec, mp_prec_t pi = default_imag_prec, mpc_rnd_t mode = default_rnd); mpcomplex(const char *s, const char *t, mp_prec_t pr = default_real_prec, mp_prec_t pi = default_imag_prec, mpc_rnd_t mode = default_rnd); mpcomplex(const mpreal &a); mpcomplex(const mpfr_t a); mpcomplex(const mpf_t a); mpcomplex(const double a, mp_prec_t pr = default_real_prec, mp_prec_t pi = default_imag_prec, mpc_rnd_t mode = default_rnd); // this is required for Conversion from 'double' to non-scalar type 'COMPLEX' requested. ~mpcomplex(); mpcomplex &operator=(const mpcomplex &a); mpcomplex &operator=(const mpc_t a); mpcomplex &operator=(const std::complex<double> a); mpcomplex &operator=(const std::complex<long double> a); mpcomplex &operator=(const char *s); mpcomplex &operator=(const mpreal &a); mpcomplex &operator=(const mpfr_t a); mpcomplex &operator=(const double a); //+ mpcomplex &operator+=(const mpcomplex &a); mpcomplex &operator+=(const mpc_t a); mpcomplex &operator+=(const std::complex<double> a); mpcomplex &operator+=(const std::complex<long double> a); mpcomplex &operator+=(const mpreal &a); mpcomplex &operator+=(const mpfr_t a); mpcomplex &operator+=(const double a); const mpcomplex operator+() const; mpcomplex &operator++(); const mpcomplex operator++(int); //- mpcomplex &operator-=(const mpcomplex &a); mpcomplex &operator-=(const mpc_t a); mpcomplex &operator-=(const std::complex<double> a); mpcomplex &operator-=(const std::complex<long double> a); mpcomplex &operator-=(const mpreal &a); mpcomplex &operator-=(const mpfr_t a); mpcomplex &operator-=(const double a); const mpcomplex operator-() const; mpcomplex &operator--(); const mpcomplex operator--(int); //* mpcomplex &operator*=(const mpcomplex &a); mpcomplex &operator*=(const mpc_t a); mpcomplex &operator*=(const std::complex<double> a); mpcomplex &operator*=(const std::complex<long double> a); mpcomplex &operator*=(const mpreal &a); mpcomplex &operator*=(const mpfr_t a); mpcomplex &operator*=(const double a); // / mpcomplex &operator/=(const mpcomplex &a); mpcomplex &operator/=(const mpc_t a); mpcomplex &operator/=(const std::complex<double> a); mpcomplex &operator/=(const std::complex<long double> a); mpcomplex &operator/=(const mpreal &a); mpcomplex &operator/=(const mpfr_t a); mpcomplex &operator/=(const double a); // comparison friend bool operator==(const mpcomplex &a, const mpcomplex &b); friend bool operator==(const mpcomplex &a, const mpreal &b); friend bool operator==(const mpreal &a, const mpcomplex &b); friend bool operator!=(const mpcomplex &a, const mpcomplex &b); friend bool operator!=(const mpreal &a, const mpcomplex &b); friend bool operator!=(const mpcomplex &a, const mpreal &b); // random friend const mpcomplex urandom_c(gmp_randstate_t &state); inline mpreal real() // this should not be call by reference, as mpreal is a class contains only pointers. { mpreal tmp; tmp = mpc_realref(mpc); return tmp; } inline const mpreal real() const // this should not be call by reference, as mpreal is a class contains only pointers. { mpreal tmp; tmp = mpc_realref(mpc); return tmp; } inline mpreal imag() // this should not be call by reference, as mpreal is a class contains only pointers. { mpreal tmp; tmp = mpc_imagref(mpc); return tmp; } inline const mpreal imag() const // this should not be call by reference, as mpreal is a class contains only pointers. { mpreal tmp; tmp = mpc_imagref(mpc); return tmp; } inline void real(const mpreal r) // constructor { mpreal tmp(r); // required as r is const. mpc_real(mpfr_ptr(tmp), mpc, mpreal::default_rnd); } inline void imag(const mpreal r) // constructor { mpreal tmp(r); mpc_imag(mpfr_ptr(tmp), mpc, mpreal::default_rnd); } // other functions friend const mpreal abs(const mpcomplex &a, mpfr_rnd_t mode); friend const mpreal norm(const mpcomplex &a, mpfr_rnd_t mode); friend const mpcomplex conj(const mpcomplex &a, mpc_rnd_t mode); friend const mpreal arg(const mpcomplex &a, mpfr_rnd_t mode); friend const mpcomplex proj(const mpcomplex &a, mpc_rnd_t mode); // Powerfunction and Logarithm friend const mpcomplex sqrt(const mpcomplex &a, mpc_rnd_t mode); friend const mpcomplex pow(const mpcomplex &a, const mpcomplex &b, mpc_rnd_t mode); friend const mpcomplex exp(const mpcomplex &a, mpc_rnd_t mode); friend const mpcomplex log(const mpcomplex &a, mpc_rnd_t mode); // trigonometric functions friend const mpcomplex sin(const mpcomplex &a, mpc_rnd_t mode); friend const mpcomplex cos(const mpcomplex &a, mpc_rnd_t mode); friend const mpcomplex tan(const mpcomplex &a, mpc_rnd_t mode); friend const mpcomplex sinh(const mpcomplex &a, mpc_rnd_t mode); friend const mpcomplex cosh(const mpcomplex &a, mpc_rnd_t mode); friend const mpcomplex tanh(const mpcomplex &a, mpc_rnd_t mode); friend const mpcomplex asin(const mpcomplex &a, mpc_rnd_t mode); friend const mpcomplex acos(const mpcomplex &a, mpc_rnd_t mode); friend const mpcomplex atan(const mpcomplex &a, mpc_rnd_t mode); friend const mpcomplex asinh(const mpcomplex &a, mpc_rnd_t mode); friend const mpcomplex acosh(const mpcomplex &a, mpc_rnd_t mode); friend const mpcomplex atanh(const mpcomplex &a, mpc_rnd_t mode); // Type Conversion operators operator std::complex<double>() const; operator std::complex<long double>() const; operator std::string() const; std::string to_string(size_t n = 0, int b = default_base, mpc_rnd_t mode = default_rnd) const; // Set/Get instance properties static void set_default_prec(mp_prec_t prec); mp_prec_t get_prec() const; mp_prec_t get_prec_re() const; mp_prec_t get_prec_im() const; void set_prec(mp_prec_t prec, mpc_rnd_t rnd_mode); void set_prec2(mp_prec_t pr, mp_prec_t pi, mpc_rnd_t rnd_mode); #if defined ___MPLAPACK_BUILD_WITH_GMP___ mpcomplex(const mpc_class &a, mp_prec_t pr = default_real_prec, mp_prec_t pi = default_imag_prec, mpc_rnd_t mode = default_rnd); mpcomplex &operator=(const mpc_class &a); #endif #if defined ___MPLAPACK_BUILD_WITH_QD___ mpcomplex(const qd_complex &a, mp_prec_t pr = default_real_prec, mp_prec_t pi = default_imag_prec, mpc_rnd_t mode = default_rnd); mpcomplex &operator=(const qd_complex &a); #endif #if defined ___MPLAPACK_BUILD_WITH_DD___ mpcomplex(const dd_complex &a, mp_prec_t pr = default_real_prec, mp_prec_t pi = default_imag_prec, mpc_rnd_t mode = default_rnd); mpcomplex &operator=(const dd_complex &a); #endif #if defined ___MPLAPACK_BUILD_WITH__FLOAT128___ && !defined ___MPLAPACK__FLOAT128_IS_LONGDOUBLE___ && !defined ___MPLAPACK_LONGDOUBLE_IS_BINARY128___ mpcomplex(const std::complex<_Float128> &a, mp_prec_t pr = default_real_prec, mp_prec_t pi = default_imag_prec, mpc_rnd_t mode = default_rnd); mpcomplex &operator=(const std::complex<_Float128> &a); #endif #if defined ___MPLAPACK_BUILD_WITH__FLOAT64X___ && defined ___MPLAPACK__FLOAT64X_IS_LONGDOUBLE___ // mpcomplex(const std::complex<_Float64x> &a, mp_prec_t pr = default_real_prec, mp_prec_t pi = default_imag_prec, mpc_rnd_t mode = default_rnd); // mpcomplex &operator=(const std::complex<_Float64x> &a); #endif }; #if defined ___MPLAPACK_MPLAPACK_INIT___ mpc_rnd_t mpfr::mpcomplex::default_rnd = MPFR_RNDN; //must be initialized at mpblas/reference/mplapackinit.cpp mp_prec_t mpfr::mpcomplex::default_real_prec = ___MPREAL_DEFAULT_PRECISION___; mp_prec_t mpfr::mpcomplex::default_imag_prec = ___MPREAL_DEFAULT_PRECISION___; int mpfr::mpcomplex::default_base = 2; int mpfr::mpcomplex::double_bits = -1; #endif //+ addition const mpcomplex operator+(const mpcomplex &a, const mpcomplex &b); const mpcomplex operator+(const mpcomplex &a, const std::complex<double> b); const mpcomplex operator+(const mpcomplex &a, const std::complex<long double> b); const mpcomplex operator+(const mpcomplex &a, const char *b); const mpcomplex operator+(const std::complex<double> a, const mpcomplex &b); const mpcomplex operator+(const std::complex<long double> a, const mpcomplex &b); const mpcomplex operator+(const char *a, const mpcomplex &b); const mpcomplex operator+(const mpcomplex &a, const mpreal b); const mpcomplex operator+(const mpcomplex &a, const double b); const mpcomplex operator+(const mpcomplex &a, const int b); const mpcomplex operator+(const mpreal a, const mpcomplex &b); const mpcomplex operator+(const double a, const mpcomplex &b); const mpcomplex operator+(const int a, const mpcomplex &b); //- subtraction const mpcomplex operator-(const mpcomplex &a, const mpcomplex &b); const mpcomplex operator-(const mpcomplex &a, const std::complex<double> &b); const mpcomplex operator-(const mpcomplex &a, const std::complex<long double> &b); const mpcomplex operator-(const mpcomplex &a, const char *b); const mpcomplex operator-(const std::complex<double> &a, const mpcomplex &b); const mpcomplex operator-(const std::complex<long double> &a, const mpcomplex &b); const mpcomplex operator-(const char *a, const mpcomplex &b); const mpcomplex operator-(const mpcomplex &a, const mpreal b); const mpcomplex operator-(const mpcomplex &a, const double b); const mpcomplex operator-(const mpcomplex &a, const int b); const mpcomplex operator-(const mpreal a, const mpcomplex &b); const mpcomplex operator-(const double a, const mpcomplex &b); const mpcomplex operator-(const long double a, const mpcomplex &b); const mpcomplex operator-(const int a, const mpcomplex &b); //* multiplication const mpcomplex operator*(const mpcomplex &a, const mpcomplex &b); const mpcomplex operator*(const mpcomplex &a, const mpreal &b); const mpcomplex operator*(const mpreal &a, const mpcomplex &b); /// division const mpcomplex operator/(const mpcomplex &a, const mpcomplex &b); const mpcomplex operator/(const mpcomplex &a, const mpreal &b); const mpcomplex operator/(const mpreal &a, const mpcomplex &b); inline void mpcomplex::set_default_prec(mp_prec_t prec) { default_real_prec = prec; default_imag_prec = prec; } inline mp_prec_t mpcomplex::get_prec() const { return mpc_get_prec(mpc); } inline mp_prec_t mpcomplex::get_prec_re() const { mp_prec_t pr, pi; mpc_get_prec2(&pr, &pi, mpc); return pr; } inline mp_prec_t mpcomplex::get_prec_im() const { mp_prec_t pr, pi; mpc_get_prec2(&pr, &pi, mpc); return pi; } inline void mpcomplex::set_prec(mp_prec_t prec, mpc_rnd_t rnd_mode) { mpcomplex tmp(*this); mpc_init2(mpc, prec); mpc_set(mpc, tmp.mpc, default_rnd); } inline void mpcomplex::set_prec2(mp_prec_t pr, mp_prec_t pi, mpc_rnd_t rnd_mode) { mpcomplex tmp(*this); mpc_init3(mpc, pr, pi); mpc_set(mpc, tmp.mpc, default_rnd); } // constructor and deconstructor inline mpcomplex::mpcomplex() { mpc_init3(mpc, default_real_prec, default_imag_prec); mpc_set_ui(mpc, 0UL, default_rnd); } inline mpcomplex::mpcomplex(const mpc_t a) { mp_prec_t pr, pi; mpc_get_prec2(&pr, &pi, a); mpc_init3(mpc, pr, pi); mpc_set(mpc, a, default_rnd); } inline mpcomplex::mpcomplex(const mpfr_t a, const mpfr_t b) { mp_prec_t pr, pi; pr = mpfr_get_prec(a); pi = mpfr_get_prec(b); mpc_init3(mpc, pr, pi); mpc_set_fr_fr(mpc, a, b, default_rnd); } inline mpcomplex::mpcomplex(const mpf_t a, const mpf_t b) { mp_prec_t pr, pi; pr = mpf_get_prec(a); pi = mpf_get_prec(b); mpc_init3(mpc, pr, pi); mpc_set_f_f(mpc, a, b, default_rnd); } inline mpcomplex::mpcomplex(const char *s, mp_prec_t pr, mp_prec_t pi, mpc_rnd_t mode) { mpc_init3(mpc, pr, pi); mpc_set_str(mpc, (char *)s, default_base, mode); } inline mpcomplex::mpcomplex(const mpcomplex &a) { mp_prec_t pr, pi; mpc_get_prec2(&pr, &pi, a.mpc); mpc_init3(mpc, pr, pi); mpc_set(mpc, a.mpc, default_rnd); } inline mpcomplex::mpcomplex(const std::complex<double> &a, mp_prec_t pr, mp_prec_t pi, mpc_rnd_t mode) { mpc_init3(mpc, pr, pi); mpc_set_d_d(mpc, a.real(), a.imag(), default_rnd); } inline mpcomplex::mpcomplex(const std::complex<long double> &a, mp_prec_t pr, mp_prec_t pi, mpc_rnd_t mode) { mpc_init3(mpc, pr, pi); mpc_set_ld_ld(mpc, a.real(), a.imag(), default_rnd); } inline mpcomplex::mpcomplex(const mpreal &a, const mpreal &b) { mp_prec_t pr, pi; mpreal tmp1(a), tmp2(b); pr = a.get_prec(); pi = b.get_prec(); mpc_init3(mpc, pr, pi); mpc_set_fr_fr(mpc, (mpfr_ptr)tmp1, (mpfr_ptr)tmp2, default_rnd); } inline mpcomplex::mpcomplex(const double &a, const double &b, mp_prec_t pr, mp_prec_t pi, mpc_rnd_t mode) { mpc_init3(mpc, default_real_prec, default_imag_prec); mpc_set_d_d(mpc, a, b, default_rnd); } inline mpcomplex::mpcomplex(const mpreal &a, const double &b) { mp_prec_t pr, pi; mpreal tmp1(a), tmp2(b); pr = a.get_prec(); pi = a.get_prec(); mpc_init3(mpc, pr, pi); mpc_set_fr_fr(mpc, (mpfr_ptr)tmp1, (mpfr_ptr)tmp2, default_rnd); } inline mpcomplex::mpcomplex(const char *s, const char *t, mp_prec_t pr, mp_prec_t pi, mpc_rnd_t mode) { mpfr_t a, b; mpfr_init2(a, pr); mpfr_init2(b, pi); mpfr_set_str(a, s, default_base, MPC_RND_RE(mode)); mpfr_set_str(b, t, default_base, MPC_RND_IM(mode)); mpc_init3(mpc, pr, pi); mpc_set_fr_fr(mpc, a, b, default_rnd); mpfr_clear(a); mpfr_clear(b); } inline mpcomplex::mpcomplex(const mpreal &a) { mpreal tmp(a); mp_prec_t pr = a.get_prec(); mpc_init3(mpc, pr, pr); mpc_set_fr(mpc, (mpfr_ptr)(tmp), default_rnd); } inline mpcomplex::mpcomplex(const mpfr_t a) { mp_prec_t pr; pr = mpfr_get_prec(a); mpc_init2(mpc, pr); mpc_set_fr(mpc, a, default_rnd); } inline mpcomplex::mpcomplex(const mpf_t a) { mp_prec_t pr; pr = mpf_get_prec(a); mpc_init2(mpc, pr); mpc_set_f(mpc, a, default_rnd); } inline mpcomplex::mpcomplex(const double a, mp_prec_t pr, mp_prec_t pi, mpc_rnd_t mode) { mpc_init3(mpc, pr, pi); mpc_set_d(mpc, a, default_rnd); } inline mpcomplex::~mpcomplex() { mpc_clear(mpc); } inline mpcomplex &mpcomplex::operator=(const mpcomplex &a) { if (this != &a) mpc_set(mpc, a.mpc, default_rnd); return *this; } inline mpcomplex &mpcomplex::operator=(const mpc_t a) { mpc_set(mpc, a, default_rnd); return *this; } inline mpcomplex &mpcomplex::operator=(const std::complex<double> a) { mpc_set_d_d(mpc, a.real(), a.imag(), default_rnd); return *this; } inline mpcomplex &mpcomplex::operator=(const std::complex<long double> a) { mpc_set_ld_ld(mpc, a.real(), a.imag(), default_rnd); return *this; } inline mpcomplex &mpcomplex::operator=(const char *s) { mpc_init3(mpc, default_real_prec, default_imag_prec); mpc_set_str(mpc, (char *)s, default_base, default_rnd); return *this; } inline mpcomplex &mpcomplex::operator=(const mpreal &a) { mpc_set_fr(mpc, (mpfr_ptr)(&a), default_rnd); return *this; } inline mpcomplex &mpcomplex::operator=(const mpfr_t a) { mpc_set_fr(mpc, a, default_rnd); return *this; } inline mpcomplex &mpcomplex::operator=(const double a) { mpc_set_d(mpc, a, default_rnd); return *this; } // + Addition inline mpcomplex &mpcomplex::operator+=(const mpcomplex &a) { mpc_add(mpc, mpc, a.mpc, default_rnd); return *this; } inline mpcomplex &mpcomplex::operator+=(const mpc_t a) { *this += mpcomplex(a); return *this; } inline mpcomplex &mpcomplex::operator+=(const std::complex<double> a) { return *this += mpcomplex(a); } inline mpcomplex &mpcomplex::operator+=(const std::complex<long double> a) { return *this += mpcomplex(a); } inline mpcomplex &mpcomplex::operator+=(const mpreal &a) { mpc_add_fr(mpc, mpc, (mpfr_ptr)(&a), default_rnd); return *this; } inline mpcomplex &mpcomplex::operator+=(const mpfr_t a) { mpc_add_fr(mpc, mpc, a, default_rnd); return *this; } inline mpcomplex &mpcomplex::operator+=(const double a) { mpreal p = a; mpc_add_fr(mpc, mpc, (mpfr_ptr)(&p), default_rnd); return *this; } inline const mpcomplex mpcomplex::operator+() const { return mpcomplex(*this); } inline mpcomplex &mpcomplex::operator++() { *this += 1.0; return *this; } inline const mpcomplex mpcomplex::operator++(int) { mpcomplex x(*this); *this += 1.0; return x; } // + Addition again inline const mpcomplex operator+(const mpcomplex &a, const mpcomplex &b) { mpcomplex tmp; if (!a.get_prec() == 0 && !b.get_prec() == 0) { if (a.get_prec() > b.get_prec()) { tmp = a; tmp += b; return tmp; } else { tmp = b; tmp += a; return tmp; } } else { tmp = a; tmp.set_prec2(std::max(a.get_prec_re(), b.get_prec_re()), std::max(a.get_prec_im(), b.get_prec_im()), mpcomplex::default_rnd); return tmp += b; } } inline const mpcomplex operator+(const mpcomplex &a, const std::complex<double> b) { return mpcomplex(a) += b; } inline const mpcomplex operator+(const mpcomplex &a, const std::complex<long double> b) { return mpcomplex(a) += b; } inline const mpcomplex operator+(const mpcomplex &a, const char *b) { return mpcomplex(b) += a; } inline const mpcomplex operator+(const std::complex<double> a, const mpcomplex &b) { return mpcomplex(b) += a; } inline const mpcomplex operator+(const std::complex<long double> a, const mpcomplex &b) { return mpcomplex(b) += a; } inline const mpcomplex operator+(const char *a, const mpcomplex &b) { return mpcomplex(a) += b; } inline const mpcomplex operator+(const mpcomplex &a, const mpreal b) { return mpcomplex(a) += b; /* mpcomplex tmp(a); tmp.set_prec2(std::max(a.get_prec_re(), b.get_prec()), a.get_prec_im(), mpcomplex::default_rnd); return tmp += b; */ } inline const mpcomplex operator+(const mpreal a, const mpcomplex &b) { return mpcomplex(a) += b; /* mpcomplex tmp(b); tmp.set_prec2(std::max(a.get_prec(), b.get_prec_re()), b.get_prec_im(), mpcomplex::default_rnd); return tmp += a; */ } inline const mpcomplex operator+(const double a, const mpcomplex &b) { mpcomplex tmp(b); return tmp += a; } inline const mpcomplex operator+(const int a, const mpcomplex &b) { mpcomplex tmp(b); return tmp += a; } // - Subtraction inline mpcomplex &mpcomplex::operator-=(const mpcomplex &a) { mpc_sub(mpc, mpc, a.mpc, default_rnd); return *this; } inline mpcomplex &mpcomplex::operator-=(const mpc_t a) { *this -= mpcomplex(a); return *this; } inline mpcomplex &mpcomplex::operator-=(const std::complex<double> a) { return *this -= mpcomplex(a); } inline mpcomplex &mpcomplex::operator-=(const std::complex<long double> a) { return *this -= mpcomplex(a); } inline mpcomplex &mpcomplex::operator-=(const mpreal &a) { mpc_sub_fr(mpc, mpc, (mpfr_ptr)(&a), default_rnd); return *this; } inline mpcomplex &mpcomplex::operator-=(const mpfr_t a) { mpc_sub_fr(mpc, mpc, a, default_rnd); return *this; } inline mpcomplex &mpcomplex::operator-=(const double a) { mpreal p = a; mpc_sub_fr(mpc, mpc, (mpfr_ptr)(&p), default_rnd); return *this; } inline const mpcomplex mpcomplex::operator-() const { mpcomplex u(*this); mpc_neg(u.mpc, u.mpc, default_rnd); return u; } inline mpcomplex &mpcomplex::operator--() { *this -= 1.0; return *this; } inline const mpcomplex mpcomplex::operator--(int) { mpcomplex x(*this); *this -= 1.0; return x; } inline const mpcomplex operator-(const mpcomplex &a, const mpcomplex &b) { if (!a.get_prec() == 0 && !b.get_prec() == 0) { if (a.get_prec() > b.get_prec()) return mpcomplex(a) -= b; else return -(mpcomplex(b) -= a); } else { mpcomplex tmp(a); tmp.set_prec2(std::max(a.get_prec_re(), b.get_prec_re()), std::max(a.get_prec_im(), b.get_prec_im()), mpcomplex::default_rnd); return tmp -= b; } } inline const mpcomplex operator-(const mpcomplex &a, const std::complex<double> &b) { return -(mpcomplex(b) -= a); } inline const mpcomplex operator-(const mpcomplex &a, const std::complex<long double> &b) { return -(mpcomplex(b) -= a); } inline const mpcomplex operator-(const mpcomplex &a, const char *b) { return a - mpcomplex(b); } inline const mpcomplex operator-(const std::complex<double> &a, const mpcomplex &b) { return mpcomplex(a) -= b; } inline const mpcomplex operator-(const std::complex<long double> &a, const mpcomplex &b) { return mpcomplex(a) -= b; } inline const mpcomplex operator-(const char *a, const mpcomplex &b) { return mpcomplex(a) - b; } inline const mpcomplex operator-(const mpcomplex &a, const mpreal b) { if (!a.get_prec() == 0 && !b.get_prec() == 0) { if (a.get_prec() > b.get_prec()) return mpcomplex(a) -= b; else return -(mpcomplex(b) -= a); } else { mpcomplex tmp(a); tmp.set_prec2(std::max(a.get_prec_re(), b.get_prec()), a.get_prec_im(), mpcomplex::default_rnd); return tmp -= b; } } inline const mpcomplex operator-(const mpcomplex &a, const double b) { return mpcomplex(a) - mpreal(b); } inline const mpcomplex operator-(const mpcomplex &a, const int b) { return mpcomplex(a) - mpreal(b); } inline const mpcomplex operator-(const mpreal a, const mpcomplex &b) { return mpcomplex(a) - mpcomplex(b); } inline const mpcomplex operator-(const double a, const mpcomplex &b) { return mpcomplex(a) - mpcomplex(b); } inline const mpcomplex operator-(const int a, const mpcomplex &b) { return mpcomplex(a) - mpcomplex(b); } // * multiplication inline mpcomplex &mpcomplex::operator*=(const mpcomplex &a) { mpc_mul(mpc, mpc, a.mpc, default_rnd); return *this; } inline mpcomplex &mpcomplex::operator*=(const mpc_t a) { *this *= mpcomplex(a); return *this; } inline mpcomplex &mpcomplex::operator*=(const std::complex<double> a) { return *this *= mpcomplex(a); } inline mpcomplex &mpcomplex::operator*=(const std::complex<long double> a) { return *this *= mpcomplex(a); } inline mpcomplex &mpcomplex::operator*=(const mpreal &a) { mpc_mul_fr(mpc, mpc, (mpfr_ptr)(&a), default_rnd); return *this; } inline mpcomplex &mpcomplex::operator*=(const mpfr_t a) { mpc_mul_fr(mpc, mpc, a, default_rnd); return *this; } inline mpcomplex &mpcomplex::operator*=(const double a) { mpreal p(a); mpc_add_fr(mpc, mpc, (mpfr_ptr)(&p), default_rnd); return *this; } inline const mpcomplex operator*(const mpcomplex &a, const mpcomplex &b) { return mpcomplex(a) *= b; /* if (!a.get_prec() == 0 && !b.get_prec() == 0) { if (a.get_prec() > b.get_prec()) return mpcomplex(a) *= b; else return mpcomplex(b) *= a; } else { mpcomplex tmp(a); tmp.set_prec2(std::max(a.get_prec_re(), b.get_prec_re()), std::max(a.get_prec_im(), b.get_prec_im()), mpcomplex::default_rnd); return tmp *= b; } */ } inline const mpcomplex operator*(const mpcomplex &a, const mpreal &b) { return mpcomplex(a) *= mpcomplex(b); /* mpcomplex tmp(a); tmp.set_prec2(std::max(a.get_prec_re(), b.get_prec()), a.get_prec_im(), mpcomplex::default_rnd); return tmp *= mpcomplex(b); */ } inline const mpcomplex operator*(const mpreal &a, const mpcomplex &b) { return mpcomplex(a) *= mpcomplex(b); /* mpcomplex tmp(a); tmp.set_prec2(std::max(b.get_prec_re(), a.get_prec()), b.get_prec_im(), mpcomplex::default_rnd); return tmp *= b; */ } // / division inline mpcomplex &mpcomplex::operator/=(const mpcomplex &a) { mpc_div(mpc, mpc, a.mpc, default_rnd); return *this; } inline mpcomplex &mpcomplex::operator/=(const mpc_t a) { *this /= mpcomplex(a); return *this; } inline mpcomplex &mpcomplex::operator/=(const std::complex<double> a) { return *this /= mpcomplex(a); } inline mpcomplex &mpcomplex::operator/=(const mpreal &a) { mpc_div_fr(mpc, mpc, (mpfr_ptr)(&a), default_rnd); return *this; } inline mpcomplex &mpcomplex::operator/=(const mpfr_t a) { mpc_div_fr(mpc, mpc, a, default_rnd); return *this; } inline mpcomplex &mpcomplex::operator/=(const double a) { mpreal p(a); mpc_div_fr(mpc, mpc, (mpfr_ptr)(&p), default_rnd); return *this; } inline bool operator==(const mpcomplex &a, const mpcomplex &b) { return (mpc_cmp(a.mpc, b.mpc) == 0); } inline bool operator==(const mpcomplex &a, const mpreal &b) { mpcomplex c(b); return (mpc_cmp(a.mpc, c.mpc) == 0); } inline bool operator==(const mpreal &a, const mpcomplex &b) { mpcomplex c(a); return (mpc_cmp(c.mpc, b.mpc) == 0); } inline bool operator!=(const mpcomplex &a, const mpcomplex &b) { return (!mpc_cmp(a.mpc, b.mpc) == 0); } inline bool operator!=(const mpcomplex &a, const mpreal &b) { mpcomplex c(b); return (!mpc_cmp(a.mpc, c.mpc) == 0); } inline bool operator!=(const mpreal &a, const mpcomplex &b) { mpcomplex c(a); return (!mpc_cmp(b.mpc, c.mpc) == 0); } inline mpcomplex::operator std::complex<double>() const { mpreal re, im; std::complex<double> tmp; re = (*this).real(); im = (*this).imag(); tmp.real(mpfr_get_d(re, MPC_RND_RE(default_rnd))); tmp.imag(mpfr_get_d(im, MPC_RND_IM(default_rnd))); return tmp; } inline mpcomplex::operator std::complex<long double>() const { mpreal re, im; std::complex<long double> tmp; re = (*this).real(); im = (*this).imag(); tmp.real(mpfr_get_ld(re, MPC_RND_RE(default_rnd))); tmp.imag(mpfr_get_ld(im, MPC_RND_IM(default_rnd))); return tmp; } inline const mpcomplex operator/(const mpcomplex &a, const mpcomplex &b) { return mpcomplex(a) /= b; /* mpcomplex tmp(a); tmp.set_prec2(std::max(a.get_prec_re(), b.get_prec_re()), std::max(a.get_prec_im(), b.get_prec_im()), mpcomplex::default_rnd); return tmp /= b; */ } inline const mpcomplex operator/(const mpreal &a, const mpcomplex &b) { return mpcomplex(a) /= b; /* mpcomplex tmp(a); tmp.set_prec2(std::max(a.get_prec(), b.get_prec_re()), std::max(a.get_prec(), b.get_prec_im()), mpcomplex::default_rnd); return tmp /= b; */ } inline const mpcomplex operator/(const mpcomplex &a, const mpreal &b) { return mpcomplex(a) /= b; /* mpcomplex tmp(a); tmp.set_prec2(std::max(a.get_prec_re(), b.get_prec()), std::max(a.get_prec_im(), b.get_prec()), mpcomplex::default_rnd); return tmp /= b; */ } inline const mpreal abs(const mpcomplex &a, mpfr_rnd_t rnd_mode = mpreal::default_rnd) { mpreal x; mpcomplex y(a); mpc_abs((mpfr_ptr)(&x), y.mpc, rnd_mode); return x; } inline const mpreal norm(const mpcomplex &a, mpfr_rnd_t rnd_mode = mpreal::default_rnd) { mpreal x; mpcomplex y(a); mpc_norm((mpfr_ptr)(&x), y.mpc, rnd_mode); return x; } inline const mpcomplex conj(const mpcomplex &a, mpc_rnd_t rnd_mode = mpcomplex::default_rnd) { mpcomplex y(a); mpc_conj(y.mpc, y.mpc, rnd_mode); return y; } inline const mpreal arg(const mpcomplex &a, mpfr_rnd_t rnd_mode = mpreal::default_rnd) { mpreal x(a.real()); mpcomplex y(a); mpc_arg((mpfr_ptr)(&x), y.mpc, rnd_mode); return x; } inline const mpcomplex proj(const mpcomplex &a, mpc_rnd_t rnd_mode = mpcomplex::default_rnd) { mpcomplex y(a); mpc_proj(y.mpc, y.mpc, rnd_mode); return y; } inline const mpcomplex sqrt(const mpcomplex &a, mpc_rnd_t rnd_mode = mpcomplex::default_rnd) { mpcomplex x(a); mpc_sqrt(x.mpc, x.mpc, rnd_mode); return x; } inline const mpcomplex pow(const mpcomplex &a, const mpcomplex &b, mpc_rnd_t rnd_mode = mpcomplex::default_rnd) { mpcomplex x(a); mpc_pow(x.mpc, x.mpc, b.mpc, rnd_mode); return x; } inline const mpcomplex exp(const mpcomplex &a, mpc_rnd_t rnd_mode = mpcomplex::default_rnd) { mpcomplex x(a); mpc_exp(x.mpc, a.mpc, rnd_mode); return x; } inline const mpcomplex log(const mpcomplex &a, mpc_rnd_t rnd_mode = mpcomplex::default_rnd) { mpcomplex x(a); mpc_log(x.mpc, a.mpc, rnd_mode); return x; } inline const mpcomplex sin(const mpcomplex &a, mpc_rnd_t rnd_mode = mpcomplex::default_rnd) { mpcomplex x(a); mpc_sin(x.mpc, a.mpc, rnd_mode); return x; } inline const mpcomplex cos(const mpcomplex &a, mpc_rnd_t rnd_mode = mpcomplex::default_rnd) { mpcomplex x(a); mpc_cos(x.mpc, a.mpc, rnd_mode); return x; } inline const mpcomplex tan(const mpcomplex &a, mpc_rnd_t rnd_mode = mpcomplex::default_rnd) { mpcomplex x(a); mpc_tan(x.mpc, a.mpc, rnd_mode); return x; } inline const mpcomplex sinh(const mpcomplex &a, mpc_rnd_t rnd_mode = mpcomplex::default_rnd) { mpcomplex x(a); mpc_sinh(x.mpc, a.mpc, rnd_mode); return x; } inline const mpcomplex cosh(const mpcomplex &a, mpc_rnd_t rnd_mode = mpcomplex::default_rnd) { mpcomplex x(a); mpc_cosh(x.mpc, a.mpc, rnd_mode); return x; } inline const mpcomplex tanh(const mpcomplex &a, mpc_rnd_t rnd_mode = mpcomplex::default_rnd) { mpcomplex x(a); mpc_tanh(x.mpc, a.mpc, rnd_mode); return x; } inline const mpcomplex asin(const mpcomplex &a, mpc_rnd_t rnd_mode = mpcomplex::default_rnd) { mpcomplex x(a); mpc_asin(x.mpc, a.mpc, rnd_mode); return x; } inline const mpcomplex acos(const mpcomplex &a, mpc_rnd_t rnd_mode = mpcomplex::default_rnd) { mpcomplex x(a); mpc_acos(x.mpc, a.mpc, rnd_mode); return x; } inline const mpcomplex atan(const mpcomplex &a, mpc_rnd_t rnd_mode = mpcomplex::default_rnd) { mpcomplex x(a); mpc_atan(x.mpc, a.mpc, rnd_mode); return x; } inline const mpcomplex asinh(const mpcomplex &a, mpc_rnd_t rnd_mode = mpcomplex::default_rnd) { mpcomplex x(a); mpc_asinh(x.mpc, a.mpc, rnd_mode); return x; } inline const mpcomplex acosh(const mpcomplex &a, mpc_rnd_t rnd_mode = mpcomplex::default_rnd) { mpcomplex x(a); mpc_acosh(x.mpc, a.mpc, rnd_mode); return x; } inline const mpcomplex atanh(const mpcomplex &a, mpc_rnd_t rnd_mode = mpcomplex::default_rnd) { mpcomplex x(a); mpc_atanh(x.mpc, a.mpc, rnd_mode); return x; } inline const mpcomplex urandom_c(gmp_randstate_t &state) { mpcomplex x; mpc_urandom(x.mpc, state); return x; } #if defined ___MPLAPACK_BUILD_WITH_GMP___ inline mpcomplex::mpcomplex(const mpc_class &a, mp_prec_t pr, mp_prec_t pi, mpc_rnd_t mode) { mpc_init3(mpc, pr, pi); mpc_set_f_f(mpc, a.real().get_mpf_t(), a.imag().get_mpf_t(), mode); } inline const mpcomplex operator-(const mpcomplex &a, const mpc_class &b) { return mpcomplex(b) -= a; } inline const mpcomplex operator-(const mpc_class &a, const mpcomplex &b) { return -(mpcomplex(a) -= b); } inline mpc_class cast2mpc_class(const mpcomplex &b) { // mpcomplex -> mpfr, mpfr -> mpf, mpf -> mpc_class // I have to rewrite soon. mpf_t tmpre, tmpim; mpfr_t tmpre2, tmpim2; mpcomplex a(b); mpreal are, aim; mp_prec_t pr, pi; pr = a.get_prec_re(); pi = a.get_prec_im(); are = a.real(); aim = a.imag(); mpfr_init2(tmpre2, pr); mpfr_init2(tmpim2, pi); mpfr_set(tmpre2, (mpfr_ptr)are, MPC_RND_RE(mpcomplex::default_rnd)); mpfr_set(tmpim2, (mpfr_ptr)aim, MPC_RND_IM(mpcomplex::default_rnd)); mpf_init2(tmpre, pr); mpf_init2(tmpim, pr); mpfr_get_f(tmpre, tmpre2, MPC_RND_RE(mpcomplex::default_rnd)); mpfr_get_f(tmpim, tmpim2, MPC_RND_IM(mpcomplex::default_rnd)); mpc_class tmp(tmpre, tmpim); mpf_clear(tmpre); mpf_clear(tmpim); mpfr_clear(tmpre2); mpfr_clear(tmpim2); return tmp; } inline mpcomplex &mpcomplex::operator=(const mpc_class &a) { mpcomplex tmp(a); *this = tmp; return *this; } #endif #if defined ___MPLAPACK_BUILD_WITH_QD___ inline mpcomplex::mpcomplex(const qd_complex &a, mp_prec_t pr, mp_prec_t pi, mpc_rnd_t mode) { mpfr_t mp_real, mp_imag; mpc_init3(mpc, pr, pi); mpfr_init2(mp_real, pr); mpfr_set_d(mp_real, a.real().x[0], MPC_RND_RE(default_rnd)); mpfr_add_d(mp_real, mp_real, a.real().x[1], MPC_RND_RE(default_rnd)); mpfr_add_d(mp_real, mp_real, a.real().x[2], MPC_RND_RE(default_rnd)); mpfr_add_d(mp_real, mp_real, a.real().x[3], MPC_RND_RE(default_rnd)); mpfr_init2(mp_imag, pi); mpfr_set_d(mp_imag, a.imag().x[0], MPC_RND_IM(default_rnd)); mpfr_add_d(mp_imag, mp_imag, a.imag().x[1], MPC_RND_IM(default_rnd)); mpfr_add_d(mp_imag, mp_imag, a.imag().x[2], MPC_RND_IM(default_rnd)); mpfr_add_d(mp_imag, mp_imag, a.imag().x[3], MPC_RND_IM(default_rnd)); mpc_set_fr_fr(mpc, mp_real, mp_imag, default_rnd); mpfr_clear(mp_imag); mpfr_clear(mp_real); } inline qd_complex cast2qd_complex(const mpcomplex &b) { std::complex<double> p[4]; mpcomplex c(b); qd_complex q; p[0] = c; c = c - p[0]; p[1] = c; c = c - p[1]; p[2] = c; c = c - p[2]; p[3] = c; // do not optimize q.real().x[0] = p[0].real(); q.imag().x[0] = p[0].imag(); q.real().x[1] = p[1].real(); q.imag().x[1] = p[1].imag(); q.real().x[2] = p[2].real(); q.imag().x[2] = p[2].imag(); q.real().x[3] = p[3].real(); q.imag().x[3] = p[3].imag(); return q; } inline const mpcomplex operator-(const mpcomplex &a, const qd_complex &b) { return mpcomplex(b) -= a; } inline const mpcomplex operator-(const qd_complex &a, const mpcomplex &b) { return -(mpcomplex(a) -= b); } inline mpcomplex &mpcomplex::operator=(const qd_complex &a) { mpcomplex tmp(a); *this = tmp; return *this; } #endif #if defined ___MPLAPACK_BUILD_WITH_DD___ inline mpcomplex::mpcomplex(const dd_complex &a, mp_prec_t pr, mp_prec_t pi, mpc_rnd_t mode) { mpfr_t mp_real, mp_imag; mpc_init3(mpc, pr, pi); mpfr_init2(mp_real, pr); mpfr_set_d(mp_real, a.real().x[0], MPC_RND_RE(mode)); mpfr_add_d(mp_real, mp_real, a.real().x[1], MPC_RND_RE(mode)); mpfr_init2(mp_imag, pi); mpfr_set_d(mp_imag, a.imag().x[0], MPC_RND_IM(mode)); mpfr_add_d(mp_imag, mp_imag, a.imag().x[1], MPC_RND_IM(mode)); mpc_set_fr_fr(mpc, mp_real, mp_imag, mode); mpfr_clear(mp_imag); mpfr_clear(mp_real); } inline dd_complex cast2dd_complex(const mpcomplex &b) { std::complex<double> p[2]; mpcomplex c(b); dd_complex q; p[0] = c; c = c - p[0]; p[1] = c; c = c - p[1]; q.real().x[0] = p[0].real(); q.imag().x[0] = p[0].imag(); q.real().x[1] = p[1].real(); q.imag().x[1] = p[1].imag(); return q; } inline const mpcomplex operator-(const mpcomplex &a, const dd_complex &b) { return mpcomplex(b) -= a; } inline const mpcomplex operator-(const dd_complex &a, const mpcomplex &b) { return -(mpcomplex(a) -= b); } inline mpcomplex &mpcomplex::operator=(const dd_complex &a) { mpcomplex tmp(a); *this = tmp; return *this; } #endif #if defined ___MPLAPACK_BUILD_WITH__FLOAT128___ && !defined ___MPLAPACK__FLOAT128_IS_LONGDOUBLE___ && !defined ___MPLAPACK_LONGDOUBLE_IS_BINARY128___ inline mpcomplex::mpcomplex(const std::complex<_Float128> &a, mp_prec_t pr, mp_prec_t pi, mpc_rnd_t mode) { mpfr_t mp_real, mp_imag; mpc_init3(mpc, pr, pi); mpfr_init2(mp_real, pr); mpfr_set_float128((mpfr_ptr)mp_real, a.real(), mpreal::default_rnd); mpfr_init2(mp_imag, pi); mpfr_set_float128((mpfr_ptr)mp_imag, a.imag(), mpreal::default_rnd); mpc_set_fr_fr(mpc, mp_real, mp_imag, mode); mpfr_clear(mp_imag); mpfr_clear(mp_real); } inline const mpcomplex operator-(const mpcomplex &a, const std::complex<_Float128> &b) { return mpcomplex(b) -= a; } inline const mpcomplex operator-(const std::complex<_Float128> &a, const mpcomplex &b) { return -(mpcomplex(a) -= b); } inline mpcomplex &mpcomplex::operator=(const std::complex<_Float128> &a) { mpcomplex tmp(a); *this = tmp; return *this; } #endif #if defined ___MPLAPACK_BUILD_WITH__FLOAT128___ inline std::complex<_Float128> cast2complex_Float128(const mpcomplex &b) { std::complex<_Float128> q; mpreal re_tmp, im_tmp; re_tmp = b.real(); im_tmp = b.imag(); q.real(mpfr_get_float128((mpfr_ptr)(re_tmp), mpreal::default_rnd)); q.imag(mpfr_get_float128((mpfr_ptr)(im_tmp), mpreal::default_rnd)); return q; } #endif } // namespace mpfr #endif /* __MP_COMPLEX_H__ */
33.746167
217
0.68065
d39d6c6adfcb00146c4c01f49e2541a5abd96ce3
2,912
h
C
auto-test/test.base.h
harithmanoj/Enhance
17ef318bc26850c3827efc5d219b6fa68b8dc976
[ "Apache-2.0" ]
null
null
null
auto-test/test.base.h
harithmanoj/Enhance
17ef318bc26850c3827efc5d219b6fa68b8dc976
[ "Apache-2.0" ]
5
2020-05-11T15:52:03.000Z
2020-06-05T16:14:05.000Z
auto-test/test.base.h
harithmanoj/Enhance
17ef318bc26850c3827efc5d219b6fa68b8dc976
[ "Apache-2.0" ]
1
2020-11-14T16:16:52.000Z
2020-11-14T16:16:52.000Z
/** *************************************************************************** \file test.base.h \brief The file to declare testing framework Created 05 June 2020 This file is part of project Enhance C++ Libraries. Copyright 2020 Harith Manoj <harithpub@gmail.com> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ******************************************************************************/ #ifndef TEST_BASE_ENH_H #define TEST_BASE_ENH_H test.base.h #include <vector> #include <functional> #include <string> #include <iostream> namespace testBase { std::vector<std::function<bool()>> allTestCases; bool assertTest(bool condition, std::string conditionString, std::string failMessage, std::string function, std::string file) { if (condition) std::cout << "PASS : " << file << " : " << function << "\n"; else std::cerr << "FAIL : " << file << " : " << function << " : condition " << conditionString << " : " << failMessage << "\n"; return condition; } } inline int call_main() { bool ret_val = 0; for (auto &i : testBase::allTestCases) { if (!i()) ret_val = 1; } return ret_val; } #define CONCAT(x,y) x##y #define REGISTER_TEST(function) testBase::allTestCases.push_back(function) #define REGISTER_MEM_TEST(function) testBase::allTestCases.push_back([this](){return function();}) #define ASSERT_TEST(condition, fail_message) return testBase::assertTest(condition, \ #condition, fail_message, __func__, __FILE__ ) #define ASSERT_CONTINUE(condition, fail_message) if(!(condition))\ {\ std::cerr << "FAIL : " << __FILE__ \ << " : " << __func__ << " : condition " \ << #condition << " : " << fail_message << "\n";\ return false;\ } #define ASSERT_LOG_CONTINUE(condition, fail_message, pass_message) if(!(condition))\ {\ std::cerr << "FAIL : " << __FILE__ \ << " : " << __func__ << " : condition " \ << #condition << " : " << fail_message << "\n";\ return false;\ }\ else\ std::cout << "PASS : " << __FILE__ << " : "\ << __func__ << " : Intermediate Test Passed " \ << #condition << " " << pass_message << "\n"; #endif
32
126
0.559066
dd0f322d334ac7442b063e33a2824f15770e6a31
450
h
C
Source/GASDocumentation/Public/Player/GDPlayerController.h
HollowKnight123/GASDocumentation
fe2e14321e6212db97a7eca42eb13c0e85a98a85
[ "MIT" ]
null
null
null
Source/GASDocumentation/Public/Player/GDPlayerController.h
HollowKnight123/GASDocumentation
fe2e14321e6212db97a7eca42eb13c0e85a98a85
[ "MIT" ]
null
null
null
Source/GASDocumentation/Public/Player/GDPlayerController.h
HollowKnight123/GASDocumentation
fe2e14321e6212db97a7eca42eb13c0e85a98a85
[ "MIT" ]
null
null
null
// Copyright 2020 Dan Kestranek. #pragma once #include "CoreMinimal.h" #include "GameFramework/PlayerController.h" #include "Characters/GDCharacterBase.h" #include "GDPlayerController.generated.h" /** * */ UCLASS() class GASDOCUMENTATION_API AGDPlayerController : public APlayerController { GENERATED_BODY() public: protected: // Server only virtual void OnPossess(APawn* InPawn) override; virtual void OnRep_PlayerState() override; };
17.307692
73
0.768889
dd5dc403c6238904b6a3683d3bb19d7ea311946d
2,235
h
C
examples/bluetooth/esp_ble_mesh/common_components/fast_provisioning/ble_mesh_fast_prov_operation.h
iPlon-org/esp-idf
a5227db2a75102ca1a17860188c3c352a529a01b
[ "Apache-2.0" ]
4
2022-03-15T22:43:28.000Z
2022-03-28T01:25:08.000Z
examples/bluetooth/esp_ble_mesh/common_components/fast_provisioning/ble_mesh_fast_prov_operation.h
iPlon-org/esp-idf
a5227db2a75102ca1a17860188c3c352a529a01b
[ "Apache-2.0" ]
null
null
null
examples/bluetooth/esp_ble_mesh/common_components/fast_provisioning/ble_mesh_fast_prov_operation.h
iPlon-org/esp-idf
a5227db2a75102ca1a17860188c3c352a529a01b
[ "Apache-2.0" ]
3
2021-08-07T09:17:31.000Z
2022-03-20T21:54:52.000Z
/* * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #ifndef _BLE_MESH_FAST_PROV_OPERATION_H_ #define _BLE_MESH_FAST_PROV_OPERATION_H_ #include "ble_mesh_fast_prov_common.h" esp_err_t example_store_node_info(const uint8_t uuid[16], uint16_t node_addr, uint8_t elem_num, uint16_t net_idx, uint16_t app_idx, uint8_t onoff); example_node_info_t *example_get_node_info(uint16_t node_addr); bool example_is_node_exist(const uint8_t uuid[16]); uint16_t example_get_node_address(int node_idx); esp_ble_mesh_model_t *example_find_model(uint16_t element_addr, uint16_t model_id, uint16_t company_id); esp_err_t example_handle_config_app_key_add_evt(uint16_t app_idx); esp_err_t example_add_fast_prov_group_address(uint16_t model_id, uint16_t group_addr); esp_err_t example_delete_fast_prov_group_address(uint16_t model_id, uint16_t group_addr); esp_err_t example_send_config_appkey_add(esp_ble_mesh_model_t *model, example_msg_common_info_t *info, esp_ble_mesh_cfg_app_key_add_t *add_key); esp_err_t example_send_generic_onoff_get(esp_ble_mesh_model_t *model, example_msg_common_info_t *info); esp_err_t example_send_generic_onoff_set(esp_ble_mesh_model_t *model, example_msg_common_info_t *info, uint8_t onoff, uint8_t tid, bool need_ack); esp_err_t example_send_fast_prov_info_set(esp_ble_mesh_model_t *model, example_msg_common_info_t *info, example_fast_prov_info_set_t *set); esp_err_t example_send_fast_prov_net_key_add(esp_ble_mesh_model_t *model, example_msg_common_info_t *info, uint8_t net_key[16]); esp_err_t example_send_fast_prov_self_prov_node_addr(esp_ble_mesh_model_t *model, example_msg_common_info_t *info, struct net_buf_simple *node_addr); esp_err_t example_send_fast_prov_all_node_addr_get(esp_ble_mesh_model_t *model, example_msg_common_info_t *info); esp_err_t example_send_fast_prov_status_msg(esp_ble_mesh_model_t *model, esp_ble_mesh_msg_ctx_t *ctx, uint32_t opcode, struct net_buf_simple *msg); #endif /* _BLE_MESH_FAST_PROV_OPERATION_H_ */
36.048387
89
0.790157
1ce911362a63cf78847bb564c45e869dce20cbad
9,977
c
C
src/genesis-controller.c
juanje/genesis
245c18109b5da7dddcbeeebbcfa43de35aaf04a6
[ "BSD-3-Clause" ]
1
2016-05-08T18:10:20.000Z
2016-05-08T18:10:20.000Z
src/genesis-controller.c
juanje/genesis
245c18109b5da7dddcbeeebbcfa43de35aaf04a6
[ "BSD-3-Clause" ]
null
null
null
src/genesis-controller.c
juanje/genesis
245c18109b5da7dddcbeeebbcfa43de35aaf04a6
[ "BSD-3-Clause" ]
null
null
null
/* * Copyright (C) 2008 Intel Corporation * * Author: Horace Li <horace.li@intel.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */ #include "genesis-common.h" #define GENESIS_CONTROLLER_GET_PRIVATE(object) \ (G_TYPE_INSTANCE_GET_PRIVATE ((object), GENESIS_TYPE_CONTROLLER, GenesisControllerPrivate)) G_DEFINE_TYPE (GenesisController, genesis_controller, G_TYPE_OBJECT) enum { APPLICATIONS_LIST_CHANGED, N_SIGNALS }; /** * _GenesisControllerPrivate: * @categories: Hash table of GenesisCategory elements * @applications: GList of GenesisAppEntry elements */ struct _GenesisControllerPrivate { GHashTable *categories; GList *applications; }; static GList *genesis_controller_append_applications (GenesisController *self, gchar *path) { GenesisControllerPrivate *priv = GENESIS_CONTROLLER_GET_PRIVATE (self); DIR *dir_handle = NULL; struct dirent *d = NULL; struct stat buf; gchar *desktop_path = NULL; if ((dir_handle = opendir(path)) == NULL) { g_error ("Error reading file '%s'\n", path); return priv->applications; } while ((d = readdir (dir_handle)) != NULL) { desktop_path = g_build_filename (path, d->d_name, NULL); if ((stat (desktop_path, &buf) == 0) && S_ISREG (buf.st_mode) && g_str_has_suffix (desktop_path, DESKTOP_FILE_SUFFIX)) { GenesisAppEntry *entry = g_object_new (GENESIS_TYPE_APP_ENTRY, "desktop_entry", desktop_path, NULL); if (genesis_app_entry_extract_info (entry, priv->categories)) priv->applications = g_list_append (priv->applications, entry); } } closedir (dir_handle); return priv->applications; } static void genesis_controller_finalize (GObject *object) { GenesisController *self = GENESIS_CONTROLLER (object); GenesisControllerPrivate *priv = GENESIS_CONTROLLER_GET_PRIVATE (self); if (priv->categories) g_free (priv->categories); if (priv->applications) g_free (priv->applications); } static void genesis_controller_class_init (GenesisControllerClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); g_type_class_add_private (klass, sizeof (GenesisControllerPrivate)); object_class->finalize = genesis_controller_finalize; g_signal_new ("app-entry-updated", G_OBJECT_CLASS_TYPE(object_class), G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__UINT_POINTER, G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_POINTER); } static void genesis_category_destroy(GenesisCategory *category) { GList *tmp = category->applications; g_free(category->name); while (tmp) { g_object_unref(tmp->data); tmp = tmp->next; } g_list_free(category->applications); g_free(category); } static void genesis_controller_init (GenesisController *self) { GenesisControllerPrivate *priv = GENESIS_CONTROLLER_GET_PRIVATE (self); priv->categories = g_hash_table_new_full( g_str_hash, g_str_equal, NULL, (GDestroyNotify)genesis_category_destroy); } /* Public Functions */ GenesisController *genesis_controller_get_singleton (void) { static GenesisController *controller = NULL; if (!controller) controller = g_object_new (GENESIS_TYPE_CONTROLLER, NULL); return controller; } /* this function must be called after genesis_controller_get_singleton is been called for the first time */ void genesis_controller_init_application_lists (GenesisController *controller, gchar *path) { GenesisControllerPrivate *priv = GENESIS_CONTROLLER_GET_PRIVATE (controller); priv->applications = genesis_controller_append_applications (controller, path); } gboolean genesis_controller_start_app_from_path (GenesisController *controller, gchar *path) { GenesisControllerPrivate *priv = GENESIS_CONTROLLER_GET_PRIVATE (controller); GenesisAppEntry *entry = g_object_new (GENESIS_TYPE_APP_ENTRY, NULL); genesis_app_entry_set_exec (entry, path); genesis_app_entry_set_name (entry, path); priv->applications = g_list_append (priv->applications, G_OBJECT(entry)); genesis_app_entry_start (entry); return TRUE; } gboolean genesis_controller_start_app_from_name (GenesisController *controller, gchar* name) { GenesisControllerPrivate *priv = GENESIS_CONTROLLER_GET_PRIVATE (controller); GList *tmp = priv->applications; while (tmp) { GenesisAppEntry *entry = GENESIS_APP_ENTRY(tmp->data); /* compare name passed in with app name in list */ if (!g_ascii_strcasecmp (genesis_app_entry_get_name (entry), name)) { genesis_app_entry_start(entry); return TRUE; } tmp = tmp->next; } g_warning ("Couldn't find app with name = %s\n", name); return FALSE; } GenesisAppEntry *genesis_controller_get_nth_entry (GenesisController *controller, guint n) { GenesisControllerPrivate *priv = GENESIS_CONTROLLER_GET_PRIVATE (controller); GenesisAppEntry *entry = NULL; if (priv->applications) entry = GENESIS_APP_ENTRY (g_list_nth_data (priv->applications, n)); return entry; } GenesisAppEntry *genesis_controller_get_entry_by_name (GenesisController *controller, gchar* name) { GenesisControllerPrivate *priv = GENESIS_CONTROLLER_GET_PRIVATE (controller); GList *tmp = priv->applications; while (tmp) { GenesisAppEntry *entry = GENESIS_APP_ENTRY (tmp->data); // compare name passed in with app name in list if (!g_ascii_strcasecmp (genesis_app_entry_get_name (entry), name)) return entry; tmp = tmp->next; } return NULL; } void genesis_controller_remove_entry (GenesisController *controller, GenesisAppEntry *entry) { GenesisControllerPrivate *priv = GENESIS_CONTROLLER_GET_PRIVATE (controller); if (priv->applications) priv->applications = g_list_remove (priv->applications, entry); } void genesis_controller_add_entry (GenesisController *controller, GenesisAppEntry *entry) { GenesisControllerPrivate *priv = GENESIS_CONTROLLER_GET_PRIVATE (controller); if (genesis_app_entry_extract_info (entry, priv->categories)) priv->applications = g_list_append (priv->applications, entry); } void genesis_controller_add_entry_by_path (GenesisController *controller, const gchar *path) { GenesisAppEntry *entry = NULL; gchar *desktop_entry = NULL; desktop_entry = g_strdup (path); entry = g_object_new (GENESIS_TYPE_APP_ENTRY, "desktop_entry", desktop_entry, NULL); genesis_controller_add_entry (controller, entry); } GList* genesis_controller_get_categories (GenesisController *controller) { GenesisControllerPrivate *priv = GENESIS_CONTROLLER_GET_PRIVATE (controller); GList *categories; GList *tmp; GList *results = NULL; if (!priv->categories) return NULL; categories = g_hash_table_get_values (priv->categories); tmp = categories; while (tmp) { GenesisCategory *category = tmp->data; if (category->is_primary) results = g_list_append(results, category); tmp = tmp->next; } g_list_free(categories); return results; } gchar** genesis_controller_get_category_names (GenesisController *controller) { GenesisControllerPrivate *priv = GENESIS_CONTROLLER_GET_PRIVATE (controller); GList *categories; GList *tmp; gint length; gint index = 0; gchar **strs_names; if (!priv->categories) return NULL; categories = g_hash_table_get_values (priv->categories); length = g_list_length(categories); strs_names = g_new (gchar *, (length + 1)); tmp = categories; while (tmp){ GenesisCategory *category = tmp->data; if (category->is_primary) strs_names[index++] = g_strdup(category->name); tmp = tmp->next; } strs_names[index] = NULL; g_list_free(categories); return strs_names; } gchar** genesis_controller_get_entry_names_by_category (GenesisController *controller, const gchar *category) { GenesisControllerPrivate *priv = GENESIS_CONTROLLER_GET_PRIVATE (controller); GenesisCategory *_category = g_hash_table_lookup (priv->categories, category); GenesisAppEntry *entry; GList *tmp; gint length; gint index = 0; gchar **strs_names; if ( (!_category) || (!_category->applications)) return NULL; length = g_list_length(_category->applications); strs_names = g_new (gchar *, (length + 1)); tmp = _category->applications; while (tmp){ entry = tmp->data; strs_names[index++] = g_strdup( genesis_app_entry_get_name (entry) ); tmp = tmp->next; } strs_names[index] = NULL; return strs_names; } GList* genesis_controller_get_all_categories (GenesisController *controller) { GenesisControllerPrivate *priv = GENESIS_CONTROLLER_GET_PRIVATE (controller); if (!priv->categories) return NULL; return g_hash_table_get_values (priv->categories); } GList* genesis_controller_get_applications_by_category (GenesisController *controller, const gchar *name) { GenesisControllerPrivate *priv = GENESIS_CONTROLLER_GET_PRIVATE (controller); GenesisCategory *category = g_hash_table_lookup (priv->categories, name); if (!category) return NULL; return g_list_copy(category->applications); } GList* genesis_controller_get_all_applications (GenesisController *controller) { GenesisControllerPrivate *priv = GENESIS_CONTROLLER_GET_PRIVATE (controller); return g_list_copy(priv->applications); }
28.183616
107
0.7391
8728b3546785b7b5c1b0ab9a51766002235c637a
1,651
h
C
modules/galil_gclib/d_galil_gclib_dinput.h
nbeaver/mx-trunk
8f9305f42cc5b12b77ba0354680bb317d779165d
[ "X11", "MIT" ]
null
null
null
modules/galil_gclib/d_galil_gclib_dinput.h
nbeaver/mx-trunk
8f9305f42cc5b12b77ba0354680bb317d779165d
[ "X11", "MIT" ]
null
null
null
modules/galil_gclib/d_galil_gclib_dinput.h
nbeaver/mx-trunk
8f9305f42cc5b12b77ba0354680bb317d779165d
[ "X11", "MIT" ]
2
2016-11-21T05:10:10.000Z
2019-11-14T11:35:45.000Z
/* * Name: d_galil_gclib_dinput.h * * Purpose: Header file for Galil controller uncommitted digital input devices. * * Author: William Lavender * *------------------------------------------------------------------------- * * Copyright 2020 Illinois Institute of Technology * * See the file "LICENSE" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * */ #ifndef __D_GALIL_GCLIB_DINPUT_H__ #define __D_GALIL_GCLIB_DINPUT_H__ #include "mx_digital_input.h" typedef struct { MX_RECORD *record; MX_RECORD *galil_gclib_record; unsigned long dinput_number; } MX_GALIL_GCLIB_DINPUT; /* Define all of the interface functions. */ MX_API mx_status_type mxd_galil_gclib_dinput_create_record_structures( MX_RECORD *record ); MX_API mx_status_type mxd_galil_gclib_dinput_read( MX_DIGITAL_INPUT *dinput ); extern MX_RECORD_FUNCTION_LIST mxd_galil_gclib_dinput_record_function_list; extern MX_DIGITAL_INPUT_FUNCTION_LIST mxd_galil_gclib_dinput_digital_input_function_list; extern long mxd_galil_gclib_dinput_num_record_fields; extern MX_RECORD_FIELD_DEFAULTS *mxd_galil_gclib_dinput_rfield_def_ptr; #define MXD_GALIL_GCLIB_DINPUT_STANDARD_FIELDS \ {-1, -1, "galil_gclib_record", MXFT_RECORD, NULL, 0, {0}, \ MXF_REC_TYPE_STRUCT, \ offsetof(MX_GALIL_GCLIB_DINPUT, galil_gclib_record), \ {0}, NULL, (MXFF_IN_DESCRIPTION | MXFF_IN_SUMMARY) }, \ \ {-1, -1, "dinput_number", MXFT_ULONG, NULL, 0, {0},\ MXF_REC_TYPE_STRUCT, offsetof(MX_GALIL_GCLIB_DINPUT, dinput_number), \ {0}, NULL, (MXFF_IN_DESCRIPTION | MXFF_IN_SUMMARY) } #endif /* __D_GALIL_GCLIB_DINPUT_H__ */
30.018182
79
0.754088
f686821ed9dda43cdf32a02c872de703be24c94b
9,834
c
C
contrib/collectd/plugins/test_istatd.c
yjpark/istatd
859a67c4c633a9e96f3f0b990a94afa54aa20224
[ "MIT" ]
null
null
null
contrib/collectd/plugins/test_istatd.c
yjpark/istatd
859a67c4c633a9e96f3f0b990a94afa54aa20224
[ "MIT" ]
null
null
null
contrib/collectd/plugins/test_istatd.c
yjpark/istatd
859a67c4c633a9e96f3f0b990a94afa54aa20224
[ "MIT" ]
null
null
null
#include <stdlib.h> #include "istatd.c" // mocked collectd function calls that we can't link to for testing gauge_t *uc_get_rate(const data_set_t *dset, const value_list_t *vl) { printf("uc_get_rate: calloc for %d of size %lu\n", dset->ds_num, sizeof(gauge_t)); gauge_t *rates = (gauge_t *)calloc(dset->ds_num, sizeof(gauge_t)); printf("rates addr %lx\n", (size_t)rates); INFO ("uc_get_rate: here 1"); int i; for (i=0; i < dset->ds_num; i++) { gauge_t val = -1.0; if (dset->ds[i].type == DS_TYPE_COUNTER) { INFO ("uc_get_rate: %d, counter: %llu", i, vl->values[i].counter); val = (gauge_t) vl->values[i].counter; } else if (dset->ds[i].type == DS_TYPE_DERIVE) { INFO ("uc_get_rate: here 3"); val = (gauge_t) vl->values[i].derive; } else if (dset->ds[i].type == DS_TYPE_ABSOLUTE) { INFO ("uc_get_rate: here 4"); val = (gauge_t) vl->values[i].absolute; } else { INFO ("uc_get_rate: here 5"); val = (gauge_t) vl->values[i].gauge; } if (dset->ds[i].type != DS_TYPE_GAUGE) { INFO ("uc_get_rate: %d, calc fake rate", i); rates[i] = (gauge_t)(val/10.0); } } INFO ("uc_get_rate: here 7"); return rates; } void plugin_log (int level, const char *format, ...) { char my_format[1024]; sprintf(my_format, "FAKE_LOG: (%d) - %s\n", level, format); va_list argptr; va_start(argptr,format); vprintf(my_format, argptr); va_end(argptr); } int plugin_register_config (const char *name, int (*callback) (const char *key, const char *val), const char **keys, int keys_num) { return 0;} int plugin_register_write (const char *name, plugin_write_cb callback, user_data_t *user_data) { return 0;} static int error_count = 0; static void c_assert_str_equal(const char *fname, int line, const char *s1, const char *s2) { if (strcmp(s1,s2)) { fprintf(stderr, "ERROR %s: %d - \"%s\" does not equal \"%s\"\n", fname, line, s1, s2); error_count++; } } #define assert_str_equal(s1,s2) c_assert_str_equal(__FILE__, __LINE__, (s1), (s2)) void test_make_istatd_metric_name() { char buffer[1024]; data_set_t ds; value_list_t vl; // test uninitialized value_list returns empty string memset(&ds, 0, sizeof(ds)); memset(&vl, 0, sizeof(vl)); strcpy(buffer,"bogus"); make_istatd_metric_name(buffer, sizeof(buffer), &ds, &vl); assert_str_equal("", buffer); // test plugin appears in name memset(&ds, 0, sizeof(ds)); memset(&vl, 0, sizeof(vl)); strcpy(vl.plugin, "plug"); make_istatd_metric_name(buffer, sizeof(buffer), &ds, &vl); assert_str_equal("plug", buffer); // test plugin_instance appears in name memset(&ds, 0, sizeof(ds)); memset(&vl, 0, sizeof(vl)); strcpy(vl.plugin_instance, "plug_inst"); make_istatd_metric_name(buffer, sizeof(buffer), &ds, &vl); assert_str_equal("plug_inst", buffer); // test type appears in name memset(&ds, 0, sizeof(ds)); memset(&vl, 0, sizeof(vl)); strcpy(ds.type, "type"); strcpy(vl.type, "type"); make_istatd_metric_name(buffer, sizeof(buffer), &ds, &vl); assert_str_equal("type", buffer); // test type_instance appears in name memset(&ds, 0, sizeof(ds)); memset(&vl, 0, sizeof(vl)); strcpy(vl.type_instance, "type_inst"); make_istatd_metric_name(buffer, sizeof(buffer), &ds, &vl); assert_str_equal("type_inst", buffer); // test type does not appear when equal to plugin memset(&ds, 0, sizeof(ds)); memset(&vl, 0, sizeof(vl)); strcpy(ds.type, "foo"); strcpy(vl.type, "foo"); strcpy(vl.plugin, "foo"); make_istatd_metric_name(buffer, sizeof(buffer), &ds, &vl); assert_str_equal("foo", buffer); // is foo, not foo.foo // test name ordering memset(&ds, 0, sizeof(ds)); memset(&vl, 0, sizeof(vl)); strcpy(ds.type, "type"); strcpy(vl.type, "type"); strcpy(vl.plugin, "plug"); strcpy(vl.plugin_instance, "plug_inst"); strcpy(vl.type_instance, "type_inst"); make_istatd_metric_name(buffer, sizeof(buffer), &ds, &vl); assert_str_equal("plug.plug_inst.type.type_inst", buffer); } void make_fake_data(data_set_t *dset, value_list_t *vl, const int data_source_type, const char *plugin, const char *plugin_instance, const char *type, const char *type_instance, value_t *values, int num_values) { // initialize data_set_t strcpy(dset->type, type); dset->ds_num = num_values; dset->ds = (data_source_t *)calloc(num_values, sizeof(data_source_t)); // initialize data_source_t in data_set_t int i; for (i = 0; i < num_values; i++) { strcpy(dset->ds[i].name, "fake_data_source"); dset->ds[i].type = data_source_type; dset->ds[i].min = 0.0; dset->ds[i].max = 65535.0; } vl->values = values; vl->values_len = num_values; vl->time = (cdtime_t)0; vl->interval = (cdtime_t)10; strcpy(vl->host, "localhost"); strcpy(vl->plugin, plugin); strcpy(vl->plugin_instance, plugin_instance); strcpy(vl->type, type); strcpy(vl->type_instance, type_instance); } void destroy_fake_data(data_set_t *dset, value_list_t *vl) { sfree(dset->ds); } void test_map_to_istatd() { counter_suffix = "^buildbot.linu-15-14^host.linu-15-14"; char buffer[1024]; data_set_t ds; value_list_t vl; value_t values[3]; // test default case values[0].counter = 9; make_fake_data(&ds, &vl, DS_TYPE_COUNTER, "cpu", "", "idle", "", values, 1); map_to_istatd(buffer, sizeof(buffer), &ds, &vl); assert_str_equal("cpu.idle^buildbot.linu-15-14^host.linu-15-14 0.900000\n", buffer); destroy_fake_data(&ds, &vl); // test memcache_ps_count values[0].gauge = 1.0; values[1].gauge = 9.0; make_fake_data(&ds, &vl, DS_TYPE_GAUGE, "memcached", "", "ps_count", "", values, 2); map_to_istatd(buffer, sizeof(buffer), &ds, &vl); assert_str_equal("memcached.ps_count^buildbot.linu-15-14^host.linu-15-14 9.000000\n", buffer); destroy_fake_data(&ds, &vl); // test load values[0].gauge = 1.0; values[1].gauge = 5.0; values[2].gauge = 15.0; make_fake_data(&ds, &vl, DS_TYPE_GAUGE, "load", "", "load", "", values, 3); map_to_istatd(buffer, sizeof(buffer), &ds, &vl); assert_str_equal("load.1min^buildbot.linu-15-14^host.linu-15-14 1.000000\n" "load.5min^buildbot.linu-15-14^host.linu-15-14 5.000000\n" "load.15min^buildbot.linu-15-14^host.linu-15-14 15.000000\n", buffer); destroy_fake_data(&ds, &vl); // test load values[0].gauge = 1.0; values[1].gauge = 5.0; values[2].gauge = 15.0; make_fake_data(&ds, &vl, DS_TYPE_GAUGE, "load", "", "load", "", values, 3); map_to_istatd(buffer, sizeof(buffer), &ds, &vl); assert_str_equal("load.1min^buildbot.linu-15-14^host.linu-15-14 1.000000\n" "load.5min^buildbot.linu-15-14^host.linu-15-14 5.000000\n" "load.15min^buildbot.linu-15-14^host.linu-15-14 15.000000\n", buffer); destroy_fake_data(&ds, &vl); // test network usage values[0].derive = 1.0; values[1].derive = 5.0; make_fake_data(&ds, &vl, DS_TYPE_DERIVE, "interface", "eth0", "if_packets", "", values, 2); map_to_istatd(buffer, sizeof(buffer), &ds, &vl); assert_str_equal("interface.eth0.if_packets.in^buildbot.linu-15-14^host.linu-15-14 0.100000\n" "interface.eth0.if_packets.out^buildbot.linu-15-14^host.linu-15-14 0.500000\n" , buffer); destroy_fake_data(&ds, &vl); // test collectd plugins time values[0].gauge = 1.0; make_fake_data(&ds, &vl, DS_TYPE_GAUGE, "collectd-plugins_time", "2011-11-11T11:11:11Z", "", "", values, 3); map_to_istatd(buffer, sizeof(buffer), &ds, &vl); assert_str_equal("#collectd-plugins_time 2011-11-11T11:11:11Z\n", buffer); destroy_fake_data(&ds, &vl); // test collectd plugins dpkg values[0].gauge = 1.0; make_fake_data(&ds, &vl, DS_TYPE_GAUGE, "collectd-plugins_dpkg", "0.11-1", "", "", values, 3); map_to_istatd(buffer, sizeof(buffer), &ds, &vl); assert_str_equal("#collectd-plugins_dpkg 0.11-1\n", buffer); destroy_fake_data(&ds, &vl); // test collectd dpkg values[0].gauge = 1.0; make_fake_data(&ds, &vl, DS_TYPE_GAUGE, "collectd_dpkg", "5.0.1-0imvu1", "", "", values, 3); map_to_istatd(buffer, sizeof(buffer), &ds, &vl); assert_str_equal("#collectd_dpkg 5.0.1-0imvu1\n", buffer); destroy_fake_data(&ds, &vl); // test istatd dpkg values[0].gauge = 1.0; make_fake_data(&ds, &vl, DS_TYPE_GAUGE, "istatd_dpkg", "0.11-1", "", "", values, 3); map_to_istatd(buffer, sizeof(buffer), &ds, &vl); assert_str_equal("#istatd_dpkg 0.11-1\n", buffer); destroy_fake_data(&ds, &vl); } void test_get_counter_suffix() { char buffer[256]; char *suffix; // test non-existant file suffix = get_counter_suffix(buffer, sizeof(buffer), "test_data/does_not_exist", "fakehost"); assert_str_equal("^host.fakehost", suffix); // test empty file suffix = get_counter_suffix(buffer, sizeof(buffer), "test_data/empty_istatd.categories", "fakehost"); assert_str_equal("^host.fakehost", suffix); // test sample file suffix = get_counter_suffix(buffer, sizeof(buffer), "test_data/istatd.categories", "fakehost"); assert_str_equal("^class^trailing_ws^leading_ws^surrounded_ws^clean_me_up__por_-favor5^host.fakehost", suffix); } int main(int argc, char** argv) { test_make_istatd_metric_name(); test_map_to_istatd(); test_get_counter_suffix(); return(0); }
35.501805
115
0.629957
11fb89417e7963724d2be3f72e7e652658dffcb6
2,521
h
C
src/ledger/lib/firebase_auth/testing/service_account_test_constants.h
yanyushr/fuchsia
98e70672a81a206d235503e398f37b7b65581f79
[ "BSD-3-Clause" ]
1
2019-10-09T10:50:57.000Z
2019-10-09T10:50:57.000Z
src/ledger/lib/firebase_auth/testing/service_account_test_constants.h
bootingman/fuchsia2
04012f0aa1edd1d4108a2ac647a65e59730fc4c2
[ "BSD-3-Clause" ]
null
null
null
src/ledger/lib/firebase_auth/testing/service_account_test_constants.h
bootingman/fuchsia2
04012f0aa1edd1d4108a2ac647a65e59730fc4c2
[ "BSD-3-Clause" ]
null
null
null
// Copyright 2018 The Fuchsia 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 SRC_LEDGER_LIB_FIREBASE_AUTH_TESTING_SERVICE_ACCOUNT_TEST_CONSTANTS_H_ #define SRC_LEDGER_LIB_FIREBASE_AUTH_TESTING_SERVICE_ACCOUNT_TEST_CONSTANTS_H_ #include "src/lib/fxl/strings/string_view.h" // This file contains constant strings used to test code that needs a // Credentials. namespace service_account { // Expected value for the Credentials members. constexpr fxl::StringView kTestServiceAccountProjectId = "fake_project_id"; constexpr fxl::StringView kTestServiceAccountClientEmail = "fake_email@example.com"; constexpr fxl::StringView kTestServiceAccountClientId = "fake_client_id"; // Correct test json configuration file for Credentials. constexpr fxl::StringView kTestServiceAccountConfig = "{" "\"project_id\": \"fake_project_id\"," "\"private_key\": \"" "-----BEGIN RSA PRIVATE KEY-----\\n" "MIIBOQIBAAJBALTlyNACX5j/oFWdgy/KvAZL9qj+eNuhXGBSvQM9noaPKqVhOXFH\\n" "hycW+TBzlHzj4Ga5uGtVJNzZaxdpfbqxV1cCAwEAAQJAZDJShESMRuZwHHveSf51\\n" "Hte8i+ZHcv9xdzjc0Iq037pGGmHh/TiNNZPtqgVbxQuGGdGQqJ54DMpz3Ja2ck1V\\n" "wQIhAOMyXwq0Se8+hCXFFFIo6QSVpDn5ZnXTyz+GBdiwkVXZAiEAy9TIRCCUd9j+\\n" "cy77lTCx6k6Pw5lY1LM5jTUR7dAD6K8CIBie1snUK8bvYWauartUj5vdk4Rs0Huo\\n" "Tfg+T9fhmn5RAiB5nfEL7SCIzbksgqjroE1Xjx5qR5Hf/zvki/ixmz7p0wIgdxLS\\n" "T/hN67jcu9a+/2geGTnk1ku2nhVlxS7UPCTq0os=\\n" "-----END RSA PRIVATE KEY-----" "\"," "\"client_email\": \"fake_email@example.com\"," "\"client_id\": \"fake_client_id\"" "}"; // Incorrect test json configuration file. constexpr fxl::StringView kWrongKeyTestServiceAccountConfig = "{" "\"project_id\": \"fake_project_id\"," "\"private_key\": \"" "-----BEGIN DSA PRIVATE KEY-----\\n" "MIH4AgEAAkEAteW2IBzioOu0aNGrQFv5RZ6VxS8NAyuNwvOrmjq8pxJSzTyrwD52\\n" "9XJmNVVXv/UWKvyPtr0rzrsJVpSzCEwaewIVAJT9/8i3lQrQEeACuO9bwzaG28Lh\\n" "AkAnvmU9Ogz6eTof5V58Lv1f8uKF6ZujgVb+Wc1gudx8wKIexKUBhE7rsnJUfLYw\\n" "HMXC8xZ5XJTEYog2U0vLKke7AkEApEq8XBO8qwEzP3VicpC/Huxa/zNZ2lveNgWm\\n" "tr089fvp3PSf4DwKTOKGZyg9NYsOSCfaCSvkWMeFCW4Y7XTpTAIUV9YTY3SlInIv\\n" "Ho2twE3HuzNZpLQ=\\n" "-----END DSA PRIVATE KEY-----\\n" "\"," "\"client_email\": \"fake_email@example.com\"," "\"client_id\": \"fake_id\"" "}"; } // namespace service_account #endif // SRC_LEDGER_LIB_FIREBASE_AUTH_TESTING_SERVICE_ACCOUNT_TEST_CONSTANTS_H_
42.016667
81
0.760016
104654545beead1bfa0345b77775822e79d65c93
705
h
C
BeanDogEngine/CmdFollowObject.h
RoyFilipchuk56/BeanDogEngine
189ff606b1568b8c2228602b545767bb827d3065
[ "MIT" ]
null
null
null
BeanDogEngine/CmdFollowObject.h
RoyFilipchuk56/BeanDogEngine
189ff606b1568b8c2228602b545767bb827d3065
[ "MIT" ]
null
null
null
BeanDogEngine/CmdFollowObject.h
RoyFilipchuk56/BeanDogEngine
189ff606b1568b8c2228602b545767bb827d3065
[ "MIT" ]
null
null
null
#pragma once #include "iCommand.h" #include "GameObject.h" #include <glm/vec3.hpp> class CmdFollowObject : public iCommand { public: CmdFollowObject(glm::vec3 offset, float maxSpeed, float distance, float maxTime, GameObject* followEntity); virtual ~CmdFollowObject(); virtual void Initialize(sMessage startData); virtual void Start(sMessage startData); virtual void End(sMessage endData); virtual void Update(float deltaTime); virtual bool IsDone(void); float SmoothStep(float edge0, float edge1, float x); void SetEntity(GameObject* entity); private: glm::vec3 offset; GameObject* entity; GameObject* followEntity; float speed; float distance; float timeLimit; float elapsedTime; };
23.5
108
0.771631
09e66446dbaecfa08d152aa23eb108f7a3da9058
1,313
h
C
Samples/TextRendering/cpp-win32/DWriteCoreGallery/ListWindow.h
daxianji007/WindowsAppSDK-Samples
f05f5a4e5ffb6d31e24ec9ba075f4aa5a1e637bb
[ "MIT" ]
188
2021-06-24T23:13:47.000Z
2022-03-30T11:06:07.000Z
Samples/TextRendering/cpp-win32/DWriteCoreGallery/ListWindow.h
daxianji007/WindowsAppSDK-Samples
f05f5a4e5ffb6d31e24ec9ba075f4aa5a1e637bb
[ "MIT" ]
64
2021-07-01T22:30:02.000Z
2022-03-31T21:04:48.000Z
Samples/TextRendering/cpp-win32/DWriteCoreGallery/ListWindow.h
daxianji007/WindowsAppSDK-Samples
f05f5a4e5ffb6d31e24ec9ba075f4aa5a1e637bb
[ "MIT" ]
61
2021-06-28T05:52:04.000Z
2022-03-31T15:26:59.000Z
// Copyright (c) Microsoft Corporation. // Licensed under the MIT license. #pragma once #include "ChildWindow.h" class ListWindow : public ScrollableChildWindow { public: ListWindow(HWND parentWindow, TextRenderer* textRenderer) : ScrollableChildWindow{ parentWindow, textRenderer } { } void SetSelectedIndex(int itemIndex); int GetSelectedIndex() const noexcept { return m_selectedIndex; } int GetItemCount() const noexcept { return m_itemCount; } protected: virtual void DrawItem(TextRenderer* textRenderer, int itemIndex, bool isSelected) = 0; virtual int GetItemPixelHeight(float dpiScale, int itemIndex) = 0; void SetItemCount(int itemCount); void OnPaint(HDC hdc, RECT invalidRect) override; bool OnLeftButtonDown(int x, int y) override; bool OnKeyDown(uint32_t keyCode) override; void OnFocus(bool haveFocus) override; private: RECT GetItemRect(int itemIndex); void InvalidateSelectedItem(); int ItemIndexFromY(int y, _Out_ RECT* itemRect); void SetSelectedIndex(int itemIndex, _In_opt_ RECT const* itemRect, bool ensureVisible); int ItemCountPerPage(int startIndex, int endIndex, int increment); int m_itemCount = 0; int m_selectedIndex = -1; bool m_haveFocus = false; };
32.02439
116
0.718964
1bb566a0b6b666525af89ec5e1c6297ee20c921a
4,279
h
C
include/smallc/curses.h
610t/retrobsd
a0c256c1f0129ee6eb0d00f385e98da9b28d94c1
[ "BSD-3-Clause" ]
236
2015-01-13T12:33:26.000Z
2022-03-16T07:18:49.000Z
include/smallc/curses.h
610t/retrobsd
a0c256c1f0129ee6eb0d00f385e98da9b28d94c1
[ "BSD-3-Clause" ]
21
2015-04-26T07:35:34.000Z
2020-12-18T13:31:55.000Z
include/smallc/curses.h
610t/retrobsd
a0c256c1f0129ee6eb0d00f385e98da9b28d94c1
[ "BSD-3-Clause" ]
53
2015-01-21T12:54:44.000Z
2022-01-14T07:01:39.000Z
/* * SmallC: interface to curses library. */ #define WINDOW int extern WINDOW *stdscr, *curscr; extern int LINES, COLS; /* * pseudo functions for standard screen */ #define addch(ch) waddch(stdscr, ch) #define getch() wgetch(stdscr) #define addstr(str) waddstr(stdscr, str) #define getstr(str) wgetstr(stdscr, str) #define move(y, x) wmove(stdscr, y, x) #define clear() wclear(stdscr) #define erase() werase(stdscr) #define clrtobot() wclrtobot(stdscr) #define clrtoeol() wclrtoeol(stdscr) #define insertln() winsertln(stdscr) #define deleteln() wdeleteln(stdscr) #define refresh() wrefresh(stdscr) #define inch() winch(stdscr) #define insch(c) winsch(stdscr,c) #define delch() wdelch(stdscr) #define standout() wstandout(stdscr) #define standend() wstandend(stdscr) /* * mv functions */ #define mvwaddch(win,y,x,ch) wmove(win,y,x) == 0 ? 0 : waddch(win,ch) #define mvwgetch(win,y,x) wmove(win,y,x) == 0 ? 0 : wgetch(win) #define mvwaddstr(win,y,x,str) wmove(win,y,x) == 0 ? 0 : waddstr(win,str) #define mvwgetstr(win,y,x,str) wmove(win,y,x) == 0 ? 0 : wgetstr(win,str) #define mvwinch(win,y,x) wmove(win,y,x) == 0 ? 0 : winch(win) #define mvwdelch(win,y,x) wmove(win,y,x) == 0 ? 0 : wdelch(win) #define mvwinsch(win,y,x,c) wmove(win,y,x) == 0 ? 0 : winsch(win,c) #define mvaddch(y,x,ch) mvwaddch(stdscr,y,x,ch) #define mvgetch(y,x) mvwgetch(stdscr,y,x) #define mvaddstr(y,x,str) mvwaddstr(stdscr,y,x,str) #define mvgetstr(y,x,str) mvwgetstr(stdscr,y,x,str) #define mvinch(y,x) mvwinch(stdscr,y,x) #define mvdelch(y,x) mvwdelch(stdscr,y,x) #define mvinsch(y,x,c) mvwinsch(stdscr,y,x,c) #ifdef TODO #define TRUE (1) #define FALSE (0) #define ERR (0) #define OK (1) /* * Capabilities from termcap */ extern int AM, BS, CA, DA, DB, EO, HC, HZ, IN, MI, MS, NC, NS, OS, UL, XB, XN, XT, XS, XX; extern char *AL, *BC, *BT, *CD, *CE, *CL, *CM, *CR, *CS, *DC, *DL, *DM, *DO, *ED, *EI, *K0, *K1, *K2, *K3, *K4, *K5, *K6, *K7, *K8, *K9, *HO, *IC, *IM, *IP, *KD, *KE, *KH, *KL, *KR, *KS, *KU, *LL, *MA, *ND, *NL, *RC, *SC, *SE, *SF, *SO, *SR, *TA, *TE, *TI, *UC, *UE, *UP, *US, *VB, *VS, *VE, *AL_PARM, *DL_PARM, *UP_PARM, *DOWN_PARM, *LEFT_PARM, *RIGHT_PARM; extern char PC; /* * From the tty modes... */ extern int GT, NONL, UPPERCASE, normtty, _pfast; extern int My_term, _echoit, _rawmode, _endwin; extern char *Def_term, ttytype[]; extern int _tty_ch, _res_flg; extern SGTTY _tty; /* * pseudo functions */ #define clearok(win,bf) (win->_clear = bf) #define leaveok(win,bf) (win->_leave = bf) #define scrollok(win,bf) (win->_scroll = bf) #define flushok(win,bf) (bf ? (win->_flags |= _FLUSH):(win->_flags &= ~_FLUSH)) #define getyx(win,y,x) y = win->_cury, x = win->_curx #define winch(win) (win->_y[win->_cury][win->_curx] & 0177) #define raw() (_tty.sg_flags|=RAW, _pfast=_rawmode=TRUE, ioctl(_tty_ch,TIOCSETP,&_tty)) #define noraw() (_tty.sg_flags&=~RAW,_rawmode=FALSE,_pfast=!(_tty.sg_flags&CRMOD),ioctl(_tty_ch,TIOCSETP,&_tty)) #define cbreak() (_tty.sg_flags |= CBREAK, _rawmode = TRUE, ioctl(_tty_ch,TIOCSETP,&_tty)) #define nocbreak() (_tty.sg_flags &= ~CBREAK,_rawmode=FALSE,ioctl(_tty_ch,TIOCSETP,&_tty)) #define echo() (_tty.sg_flags |= ECHO, _echoit = TRUE, ioctl(_tty_ch, TIOCSETP, &_tty)) #define noecho() (_tty.sg_flags &= ~ECHO, _echoit = FALSE, ioctl(_tty_ch, TIOCSETP, &_tty)) #define nl() (_tty.sg_flags |= CRMOD, _pfast = _rawmode,ioctl(_tty_ch, TIOCSETP, &_tty)) #define nonl() (_tty.sg_flags &= ~CRMOD,_pfast = TRUE, ioctl(_tty_ch, TIOCSETP,&_tty)) #define savetty() ((void) ioctl(_tty_ch, TIOCGETP, &_tty), _res_flg = _tty.sg_flags) #define resetty() (_tty.sg_flags = _res_flg, (void) ioctl(_tty_ch, TIOCSETP, &_tty)) #define erasechar() (_tty.sg_erase) #define killchar() (_tty.sg_kill) #define baudrate() (_tty.sg_ospeed) /* * Used to be in unctrl.h. */ #define unctrl(c) _unctrl[(c) & 0177] extern char *_unctrl[]; #endif
37.208696
113
0.609488
4813d9d253eae8b7701ed9570cb77e9d7b8c6722
1,575
c
C
nc_test4/tst_hdf5_file_compat.c
khou2020/netcdf-c
8ebb2fff8b9ff67b653833a6d03407c37bc6c6e5
[ "NetCDF" ]
1
2019-03-19T21:56:52.000Z
2019-03-19T21:56:52.000Z
nc_test4/tst_hdf5_file_compat.c
khou2020/netcdf-c
8ebb2fff8b9ff67b653833a6d03407c37bc6c6e5
[ "NetCDF" ]
1
2020-11-18T16:58:33.000Z
2020-11-23T16:07:15.000Z
nc_test4/tst_hdf5_file_compat.c
khou2020/netcdf-c
8ebb2fff8b9ff67b653833a6d03407c37bc6c6e5
[ "NetCDF" ]
null
null
null
/* This is part of the netCDF package. Copyright 2016 University Corporation for Atmospheric Research/Unidata See COPYRIGHT file for conditions of use. Tests library ability to open files generated by a netcdf instance linked against libhdf5 1.10.0. This is an issue at this point because, without specifying libver bounds, netcdf linked against libhdf5 1.8 cannot read those generated by libhdf5 1.10.0. This test will undoubtedly not age well, but right now it is fairly critical, and will help test if we've corrected the issue. Details: https://github.com/Unidata/netcdf-c/issues/250 Files testing against (copied from nc_test4): * ref_hdf5_compat1.nc <- tst_vars.nc * ref_hdf5_compat2.nc <- tst_vars4.nc * ref_hdf5_compat3.nc <- tst_compounds.nc */ #include <nc_tests.h> #include "err_macros.h" #include "netcdf.h" #define FILE_NAME1 "ref_hdf5_compat1.nc" #define FILE_NAME2 "ref_hdf5_compat2.nc" #define FILE_NAME3 "ref_hdf5_compat3.nc" int main(int argc, char **argv) { int ncid = 0; printf("\n*** Testing libhdf5 file compatibility (open files generated by hdf5 1.10).\n"); { printf("Testing %s\n",FILE_NAME1); if (nc_open(FILE_NAME1, NC_NOWRITE, &ncid)) ERR; if (nc_close(ncid)) ERR; } { printf("Testing %s\n",FILE_NAME2); if (nc_open(FILE_NAME2, NC_NOWRITE, &ncid)) ERR; if (nc_close(ncid)) ERR; } { printf("Testing %s\n",FILE_NAME3); if (nc_open(FILE_NAME3, NC_NOWRITE, &ncid)) ERR; if (nc_close(ncid)) ERR; } SUMMARIZE_ERR; FINAL_RESULTS; }
24.609375
92
0.702857
73debc9d6a4b1eae421f62c8ca567a94c6189872
39,697
c
C
3party/gtk+-3.12.1/gtk/deprecated/gtkimagemenuitem.c
kongaraju/antkorp
3453d543d659e3420d5bc4b536016bb1d097d7ec
[ "CC-BY-3.0", "Apache-2.0" ]
1
2016-01-02T14:39:07.000Z
2016-01-02T14:39:07.000Z
3party/gtk+-3.12.1/gtk/deprecated/gtkimagemenuitem.c
kongaraju/antkorp
3453d543d659e3420d5bc4b536016bb1d097d7ec
[ "CC-BY-3.0", "Apache-2.0" ]
4
2019-12-20T06:13:24.000Z
2021-07-03T16:28:18.000Z
3party/gtk+-3.12.1/gtk/deprecated/gtkimagemenuitem.c
kongaraju/antkorp
3453d543d659e3420d5bc4b536016bb1d097d7ec
[ "CC-BY-3.0", "Apache-2.0" ]
2
2015-09-17T16:40:10.000Z
2016-11-17T15:56:42.000Z
/* GTK - The GIMP Toolkit * Copyright (C) 2001 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. */ /* * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS * file for a list of people on the GTK+ Team. See the ChangeLog * files for a list of changes. These files are distributed with * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ #include "config.h" #define GDK_DISABLE_DEPRECATION_WARNINGS #include "gtkimagemenuitem.h" #include "gtkmenuitemprivate.h" #include "gtkaccellabel.h" #include "gtkstock.h" #include "gtkiconfactory.h" #include "gtkimage.h" #include "gtkmenubar.h" #include "gtkcontainer.h" #include "gtkwindow.h" #include "gtkactivatable.h" #include "gtkintl.h" #include "gtkprivate.h" /** * SECTION:gtkimagemenuitem * @Short_description: A menu item with an icon * @Title: GtkImageMenuItem * * A GtkImageMenuItem is a menu item which has an icon next to the text label. * * Note that the user can disable display of menu icons, so make sure to still * fill in the text label. */ struct _GtkImageMenuItemPrivate { GtkWidget *image; gchar *label; guint use_stock : 1; guint always_show_image : 1; }; enum { PROP_0, PROP_IMAGE, PROP_USE_STOCK, PROP_ACCEL_GROUP, PROP_ALWAYS_SHOW_IMAGE }; static GtkActivatableIface *parent_activatable_iface; static void gtk_image_menu_item_destroy (GtkWidget *widget); static void gtk_image_menu_item_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural); static void gtk_image_menu_item_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural); static void gtk_image_menu_item_get_preferred_height_for_width (GtkWidget *widget, gint width, gint *minimum, gint *natural); static void gtk_image_menu_item_size_allocate (GtkWidget *widget, GtkAllocation *allocation); static void gtk_image_menu_item_map (GtkWidget *widget); static void gtk_image_menu_item_remove (GtkContainer *container, GtkWidget *child); static void gtk_image_menu_item_toggle_size_request (GtkMenuItem *menu_item, gint *requisition); static void gtk_image_menu_item_set_label (GtkMenuItem *menu_item, const gchar *label); static const gchar * gtk_image_menu_item_get_label (GtkMenuItem *menu_item); static void gtk_image_menu_item_forall (GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data); static void gtk_image_menu_item_finalize (GObject *object); static void gtk_image_menu_item_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void gtk_image_menu_item_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); static void gtk_image_menu_item_screen_changed (GtkWidget *widget, GdkScreen *previous_screen); static void gtk_image_menu_item_recalculate (GtkImageMenuItem *image_menu_item); static void gtk_image_menu_item_activatable_interface_init (GtkActivatableIface *iface); static void gtk_image_menu_item_update (GtkActivatable *activatable, GtkAction *action, const gchar *property_name); static void gtk_image_menu_item_sync_action_properties (GtkActivatable *activatable, GtkAction *action); G_DEFINE_TYPE_WITH_CODE (GtkImageMenuItem, gtk_image_menu_item, GTK_TYPE_MENU_ITEM, G_ADD_PRIVATE (GtkImageMenuItem) G_IMPLEMENT_INTERFACE (GTK_TYPE_ACTIVATABLE, gtk_image_menu_item_activatable_interface_init)) static void gtk_image_menu_item_class_init (GtkImageMenuItemClass *klass) { GObjectClass *gobject_class = (GObjectClass*) klass; GtkWidgetClass *widget_class = (GtkWidgetClass*) klass; GtkMenuItemClass *menu_item_class = (GtkMenuItemClass*) klass; GtkContainerClass *container_class = (GtkContainerClass*) klass; widget_class->destroy = gtk_image_menu_item_destroy; widget_class->screen_changed = gtk_image_menu_item_screen_changed; widget_class->get_preferred_width = gtk_image_menu_item_get_preferred_width; widget_class->get_preferred_height = gtk_image_menu_item_get_preferred_height; widget_class->get_preferred_height_for_width = gtk_image_menu_item_get_preferred_height_for_width; widget_class->size_allocate = gtk_image_menu_item_size_allocate; widget_class->map = gtk_image_menu_item_map; container_class->forall = gtk_image_menu_item_forall; container_class->remove = gtk_image_menu_item_remove; menu_item_class->toggle_size_request = gtk_image_menu_item_toggle_size_request; menu_item_class->set_label = gtk_image_menu_item_set_label; menu_item_class->get_label = gtk_image_menu_item_get_label; gobject_class->finalize = gtk_image_menu_item_finalize; gobject_class->set_property = gtk_image_menu_item_set_property; gobject_class->get_property = gtk_image_menu_item_get_property; /** * GtkImageMenuItem:image: * * Child widget to appear next to the menu text. * * Deprecated: 3.10 */ g_object_class_install_property (gobject_class, PROP_IMAGE, g_param_spec_object ("image", P_("Image widget"), P_("Child widget to appear next to the menu text"), GTK_TYPE_WIDGET, GTK_PARAM_READWRITE | G_PARAM_DEPRECATED)); /** * GtkImageMenuItem:use-stock: * * If %TRUE, the label set in the menuitem is used as a * stock id to select the stock item for the item. * * Since: 2.16 * * Deprecated: 3.10 */ g_object_class_install_property (gobject_class, PROP_USE_STOCK, g_param_spec_boolean ("use-stock", P_("Use stock"), P_("Whether to use the label text to create a stock menu item"), FALSE, GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_DEPRECATED)); /** * GtkImageMenuItem:always-show-image: * * If %TRUE, the menu item will always show the image, if available. * * Use this property only if the menuitem would be useless or hard to use * without the image. * * Since: 2.16 * * Deprecated: 3.10 */ g_object_class_install_property (gobject_class, PROP_ALWAYS_SHOW_IMAGE, g_param_spec_boolean ("always-show-image", P_("Always show image"), P_("Whether the image will always be shown"), FALSE, GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_DEPRECATED)); /** * GtkImageMenuItem:accel-group: * * The Accel Group to use for stock accelerator keys * * Since: 2.16 * * Deprecated: 3.10 */ g_object_class_install_property (gobject_class, PROP_ACCEL_GROUP, g_param_spec_object ("accel-group", P_("Accel Group"), P_("The Accel Group to use for stock accelerator keys"), GTK_TYPE_ACCEL_GROUP, GTK_PARAM_WRITABLE | G_PARAM_DEPRECATED)); } static void gtk_image_menu_item_init (GtkImageMenuItem *image_menu_item) { GtkImageMenuItemPrivate *priv; image_menu_item->priv = gtk_image_menu_item_get_instance_private (image_menu_item); priv = image_menu_item->priv; priv->image = NULL; priv->use_stock = FALSE; priv->label = NULL; } static void gtk_image_menu_item_finalize (GObject *object) { GtkImageMenuItemPrivate *priv = GTK_IMAGE_MENU_ITEM (object)->priv; g_free (priv->label); priv->label = NULL; G_OBJECT_CLASS (gtk_image_menu_item_parent_class)->finalize (object); } static void gtk_image_menu_item_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GtkImageMenuItem *image_menu_item = GTK_IMAGE_MENU_ITEM (object); switch (prop_id) { case PROP_IMAGE: gtk_image_menu_item_set_image (image_menu_item, (GtkWidget *) g_value_get_object (value)); break; case PROP_USE_STOCK: G_GNUC_BEGIN_IGNORE_DEPRECATIONS; gtk_image_menu_item_set_use_stock (image_menu_item, g_value_get_boolean (value)); G_GNUC_END_IGNORE_DEPRECATIONS; break; case PROP_ALWAYS_SHOW_IMAGE: gtk_image_menu_item_set_always_show_image (image_menu_item, g_value_get_boolean (value)); break; case PROP_ACCEL_GROUP: G_GNUC_BEGIN_IGNORE_DEPRECATIONS; gtk_image_menu_item_set_accel_group (image_menu_item, g_value_get_object (value)); G_GNUC_END_IGNORE_DEPRECATIONS; break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void gtk_image_menu_item_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { GtkImageMenuItem *image_menu_item = GTK_IMAGE_MENU_ITEM (object); switch (prop_id) { case PROP_IMAGE: g_value_set_object (value, gtk_image_menu_item_get_image (image_menu_item)); break; case PROP_USE_STOCK: G_GNUC_BEGIN_IGNORE_DEPRECATIONS; g_value_set_boolean (value, gtk_image_menu_item_get_use_stock (image_menu_item)); G_GNUC_END_IGNORE_DEPRECATIONS; break; case PROP_ALWAYS_SHOW_IMAGE: g_value_set_boolean (value, gtk_image_menu_item_get_always_show_image (image_menu_item)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static gboolean show_image (GtkImageMenuItem *image_menu_item) { GtkImageMenuItemPrivate *priv = image_menu_item->priv; GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (image_menu_item)); gboolean show; if (priv->always_show_image) show = TRUE; else g_object_get (settings, "gtk-menu-images", &show, NULL); return show; } static void gtk_image_menu_item_map (GtkWidget *widget) { GtkImageMenuItem *image_menu_item = GTK_IMAGE_MENU_ITEM (widget); GtkImageMenuItemPrivate *priv = image_menu_item->priv; GTK_WIDGET_CLASS (gtk_image_menu_item_parent_class)->map (widget); if (priv->image) g_object_set (priv->image, "visible", show_image (image_menu_item), NULL); } static void gtk_image_menu_item_destroy (GtkWidget *widget) { GtkImageMenuItem *image_menu_item = GTK_IMAGE_MENU_ITEM (widget); GtkImageMenuItemPrivate *priv = image_menu_item->priv; if (priv->image) gtk_container_remove (GTK_CONTAINER (image_menu_item), priv->image); GTK_WIDGET_CLASS (gtk_image_menu_item_parent_class)->destroy (widget); } static void gtk_image_menu_item_toggle_size_request (GtkMenuItem *menu_item, gint *requisition) { GtkImageMenuItem *image_menu_item = GTK_IMAGE_MENU_ITEM (menu_item); GtkImageMenuItemPrivate *priv = image_menu_item->priv; GtkPackDirection pack_dir; GtkWidget *parent; GtkWidget *widget = GTK_WIDGET (menu_item); parent = gtk_widget_get_parent (widget); if (GTK_IS_MENU_BAR (parent)) pack_dir = gtk_menu_bar_get_child_pack_direction (GTK_MENU_BAR (parent)); else pack_dir = GTK_PACK_DIRECTION_LTR; *requisition = 0; if (priv->image && gtk_widget_get_visible (priv->image)) { GtkRequisition image_requisition; guint toggle_spacing; gtk_widget_get_preferred_size (priv->image, &image_requisition, NULL); gtk_widget_style_get (GTK_WIDGET (menu_item), "toggle-spacing", &toggle_spacing, NULL); if (pack_dir == GTK_PACK_DIRECTION_LTR || pack_dir == GTK_PACK_DIRECTION_RTL) { if (image_requisition.width > 0) *requisition = image_requisition.width + toggle_spacing; } else { if (image_requisition.height > 0) *requisition = image_requisition.height + toggle_spacing; } } } static void gtk_image_menu_item_recalculate (GtkImageMenuItem *image_menu_item) { GtkImageMenuItemPrivate *priv = image_menu_item->priv; GtkStockItem stock_item; GtkWidget *image; const gchar *resolved_label = priv->label; if (priv->use_stock && priv->label) { G_GNUC_BEGIN_IGNORE_DEPRECATIONS; if (!priv->image) { image = gtk_image_new_from_stock (priv->label, GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (image_menu_item, image); } if (gtk_stock_lookup (priv->label, &stock_item)) resolved_label = stock_item.label; gtk_menu_item_set_use_underline (GTK_MENU_ITEM (image_menu_item), TRUE); G_GNUC_END_IGNORE_DEPRECATIONS; } GTK_MENU_ITEM_CLASS (gtk_image_menu_item_parent_class)->set_label (GTK_MENU_ITEM (image_menu_item), resolved_label); } static void gtk_image_menu_item_set_label (GtkMenuItem *menu_item, const gchar *label) { GtkImageMenuItemPrivate *priv = GTK_IMAGE_MENU_ITEM (menu_item)->priv; if (priv->label != label) { g_free (priv->label); priv->label = g_strdup (label); gtk_image_menu_item_recalculate (GTK_IMAGE_MENU_ITEM (menu_item)); g_object_notify (G_OBJECT (menu_item), "label"); } } static const gchar * gtk_image_menu_item_get_label (GtkMenuItem *menu_item) { GtkImageMenuItemPrivate *priv = GTK_IMAGE_MENU_ITEM (menu_item)->priv; return priv->label; } static void gtk_image_menu_item_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural) { GtkImageMenuItem *image_menu_item = GTK_IMAGE_MENU_ITEM (widget); GtkImageMenuItemPrivate *priv = image_menu_item->priv; GtkPackDirection pack_dir; GtkWidget *parent; parent = gtk_widget_get_parent (widget); if (GTK_IS_MENU_BAR (parent)) pack_dir = gtk_menu_bar_get_child_pack_direction (GTK_MENU_BAR (parent)); else pack_dir = GTK_PACK_DIRECTION_LTR; GTK_WIDGET_CLASS (gtk_image_menu_item_parent_class)->get_preferred_width (widget, minimum, natural); if ((pack_dir == GTK_PACK_DIRECTION_TTB || pack_dir == GTK_PACK_DIRECTION_BTT) && priv->image && gtk_widget_get_visible (priv->image)) { gint child_minimum, child_natural; gtk_widget_get_preferred_width (priv->image, &child_minimum, &child_natural); *minimum = MAX (*minimum, child_minimum); *natural = MAX (*natural, child_natural); } } static void gtk_image_menu_item_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural) { GtkImageMenuItem *image_menu_item = GTK_IMAGE_MENU_ITEM (widget); GtkImageMenuItemPrivate *priv = image_menu_item->priv; gint child_height = 0; GtkPackDirection pack_dir; GtkWidget *parent; parent = gtk_widget_get_parent (widget); if (GTK_IS_MENU_BAR (parent)) pack_dir = gtk_menu_bar_get_child_pack_direction (GTK_MENU_BAR (parent)); else pack_dir = GTK_PACK_DIRECTION_LTR; if (priv->image && gtk_widget_get_visible (priv->image)) { GtkRequisition child_requisition; gtk_widget_get_preferred_size (priv->image, &child_requisition, NULL); child_height = child_requisition.height; } GTK_WIDGET_CLASS (gtk_image_menu_item_parent_class)->get_preferred_height (widget, minimum, natural); if (pack_dir == GTK_PACK_DIRECTION_RTL || pack_dir == GTK_PACK_DIRECTION_LTR) { *minimum = MAX (*minimum, child_height); *natural = MAX (*natural, child_height); } } static void gtk_image_menu_item_get_preferred_height_for_width (GtkWidget *widget, gint width, gint *minimum, gint *natural) { GtkImageMenuItem *image_menu_item = GTK_IMAGE_MENU_ITEM (widget); GtkImageMenuItemPrivate *priv = image_menu_item->priv; gint child_height = 0; GtkPackDirection pack_dir; GtkWidget *parent; parent = gtk_widget_get_parent (widget); if (GTK_IS_MENU_BAR (parent)) pack_dir = gtk_menu_bar_get_child_pack_direction (GTK_MENU_BAR (parent)); else pack_dir = GTK_PACK_DIRECTION_LTR; if (priv->image && gtk_widget_get_visible (priv->image)) { GtkRequisition child_requisition; gtk_widget_get_preferred_size (priv->image, &child_requisition, NULL); child_height = child_requisition.height; } GTK_WIDGET_CLASS (gtk_image_menu_item_parent_class)->get_preferred_height_for_width (widget, width, minimum, natural); if (pack_dir == GTK_PACK_DIRECTION_RTL || pack_dir == GTK_PACK_DIRECTION_LTR) { *minimum = MAX (*minimum, child_height); *natural = MAX (*natural, child_height); } } static void gtk_image_menu_item_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { GtkImageMenuItem *image_menu_item = GTK_IMAGE_MENU_ITEM (widget); GtkImageMenuItemPrivate *priv = image_menu_item->priv; GtkAllocation widget_allocation; GtkPackDirection pack_dir; GtkWidget *parent; parent = gtk_widget_get_parent (widget); if (GTK_IS_MENU_BAR (parent)) pack_dir = gtk_menu_bar_get_child_pack_direction (GTK_MENU_BAR (parent)); else pack_dir = GTK_PACK_DIRECTION_LTR; GTK_WIDGET_CLASS (gtk_image_menu_item_parent_class)->size_allocate (widget, allocation); if (priv->image && gtk_widget_get_visible (priv->image)) { gint x, y, offset; GtkStyleContext *context; GtkStateFlags state; GtkBorder padding; GtkRequisition child_requisition; GtkAllocation child_allocation; guint horizontal_padding, toggle_spacing; gint toggle_size; toggle_size = GTK_MENU_ITEM (image_menu_item)->priv->toggle_size; gtk_widget_style_get (widget, "horizontal-padding", &horizontal_padding, "toggle-spacing", &toggle_spacing, NULL); /* Man this is lame hardcoding action, but I can't * come up with a solution that's really better. */ gtk_widget_get_preferred_size (priv->image, &child_requisition, NULL); gtk_widget_get_allocation (widget, &widget_allocation); context = gtk_widget_get_style_context (widget); state = gtk_widget_get_state_flags (widget); gtk_style_context_get_padding (context, state, &padding); offset = gtk_container_get_border_width (GTK_CONTAINER (image_menu_item)); if (pack_dir == GTK_PACK_DIRECTION_LTR || pack_dir == GTK_PACK_DIRECTION_RTL) { if ((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR) == (pack_dir == GTK_PACK_DIRECTION_LTR)) x = offset + horizontal_padding + padding.left + (toggle_size - toggle_spacing - child_requisition.width) / 2; else x = widget_allocation.width - offset - horizontal_padding - padding.right - toggle_size + toggle_spacing + (toggle_size - toggle_spacing - child_requisition.width) / 2; y = (widget_allocation.height - child_requisition.height) / 2; } else { if ((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR) == (pack_dir == GTK_PACK_DIRECTION_TTB)) y = offset + horizontal_padding + padding.top + (toggle_size - toggle_spacing - child_requisition.height) / 2; else y = widget_allocation.height - offset - horizontal_padding - padding.bottom - toggle_size + toggle_spacing + (toggle_size - toggle_spacing - child_requisition.height) / 2; x = (widget_allocation.width - child_requisition.width) / 2; } child_allocation.width = child_requisition.width; child_allocation.height = child_requisition.height; child_allocation.x = widget_allocation.x + MAX (x, 0); child_allocation.y = widget_allocation.y + MAX (y, 0); gtk_widget_size_allocate (priv->image, &child_allocation); } } static void gtk_image_menu_item_forall (GtkContainer *container, gboolean include_internals, GtkCallback callback, gpointer callback_data) { GtkImageMenuItem *image_menu_item = GTK_IMAGE_MENU_ITEM (container); GtkImageMenuItemPrivate *priv = image_menu_item->priv; GTK_CONTAINER_CLASS (gtk_image_menu_item_parent_class)->forall (container, include_internals, callback, callback_data); if (include_internals && priv->image) (* callback) (priv->image, callback_data); } static void gtk_image_menu_item_activatable_interface_init (GtkActivatableIface *iface) { parent_activatable_iface = g_type_interface_peek_parent (iface); iface->update = gtk_image_menu_item_update; iface->sync_action_properties = gtk_image_menu_item_sync_action_properties; } static gboolean activatable_update_stock_id (GtkImageMenuItem *image_menu_item, GtkAction *action) { GtkWidget *image; const gchar *stock_id = gtk_action_get_stock_id (action); image = gtk_image_menu_item_get_image (image_menu_item); G_GNUC_BEGIN_IGNORE_DEPRECATIONS; if (GTK_IS_IMAGE (image) && stock_id && gtk_icon_factory_lookup_default (stock_id)) { G_GNUC_BEGIN_IGNORE_DEPRECATIONS; gtk_image_set_from_stock (GTK_IMAGE (image), stock_id, GTK_ICON_SIZE_MENU); G_GNUC_END_IGNORE_DEPRECATIONS; return TRUE; } G_GNUC_END_IGNORE_DEPRECATIONS; return FALSE; } static gboolean activatable_update_gicon (GtkImageMenuItem *image_menu_item, GtkAction *action) { GtkWidget *image; GIcon *icon = gtk_action_get_gicon (action); const gchar *stock_id; gboolean ret = FALSE; stock_id = gtk_action_get_stock_id (action); G_GNUC_BEGIN_IGNORE_DEPRECATIONS; image = gtk_image_menu_item_get_image (image_menu_item); if (icon && GTK_IS_IMAGE (image) && !(stock_id && gtk_icon_factory_lookup_default (stock_id))) { gtk_image_set_from_gicon (GTK_IMAGE (image), icon, GTK_ICON_SIZE_MENU); ret = TRUE; } G_GNUC_END_IGNORE_DEPRECATIONS; return ret; } static void activatable_update_icon_name (GtkImageMenuItem *image_menu_item, GtkAction *action) { GtkWidget *image; const gchar *icon_name = gtk_action_get_icon_name (action); image = gtk_image_menu_item_get_image (image_menu_item); if (GTK_IS_IMAGE (image) && (gtk_image_get_storage_type (GTK_IMAGE (image)) == GTK_IMAGE_EMPTY || gtk_image_get_storage_type (GTK_IMAGE (image)) == GTK_IMAGE_ICON_NAME)) { gtk_image_set_from_icon_name (GTK_IMAGE (image), icon_name, GTK_ICON_SIZE_MENU); } } static void gtk_image_menu_item_update (GtkActivatable *activatable, GtkAction *action, const gchar *property_name) { GtkImageMenuItem *image_menu_item; gboolean use_appearance; image_menu_item = GTK_IMAGE_MENU_ITEM (activatable); parent_activatable_iface->update (activatable, action, property_name); use_appearance = gtk_activatable_get_use_action_appearance (activatable); if (!use_appearance) return; if (strcmp (property_name, "stock-id") == 0) activatable_update_stock_id (image_menu_item, action); else if (strcmp (property_name, "gicon") == 0) activatable_update_gicon (image_menu_item, action); else if (strcmp (property_name, "icon-name") == 0) activatable_update_icon_name (image_menu_item, action); } static void gtk_image_menu_item_sync_action_properties (GtkActivatable *activatable, GtkAction *action) { GtkImageMenuItem *image_menu_item; GtkWidget *image; gboolean use_appearance; image_menu_item = GTK_IMAGE_MENU_ITEM (activatable); parent_activatable_iface->sync_action_properties (activatable, action); if (!action) return; use_appearance = gtk_activatable_get_use_action_appearance (activatable); if (!use_appearance) return; image = gtk_image_menu_item_get_image (image_menu_item); if (image && !GTK_IS_IMAGE (image)) { gtk_image_menu_item_set_image (image_menu_item, NULL); image = NULL; } if (!image) { image = gtk_image_new (); gtk_widget_show (image); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (activatable), image); } if (!activatable_update_stock_id (image_menu_item, action) && !activatable_update_gicon (image_menu_item, action)) activatable_update_icon_name (image_menu_item, action); gtk_image_menu_item_set_always_show_image (image_menu_item, gtk_action_get_always_show_image (action)); } /** * gtk_image_menu_item_new: * * Creates a new #GtkImageMenuItem with an empty label. * * Returns: a new #GtkImageMenuItem * * Deprecated: 3.10: Use gtk_menu_item_new() instead. */ GtkWidget* gtk_image_menu_item_new (void) { return g_object_new (GTK_TYPE_IMAGE_MENU_ITEM, NULL); } /** * gtk_image_menu_item_new_with_label: * @label: the text of the menu item. * * Creates a new #GtkImageMenuItem containing a label. * * Returns: a new #GtkImageMenuItem. * * Deprecated: 3.10: Use gtk_menu_item_new_with_label() instead. */ GtkWidget* gtk_image_menu_item_new_with_label (const gchar *label) { return g_object_new (GTK_TYPE_IMAGE_MENU_ITEM, "label", label, NULL); } /** * gtk_image_menu_item_new_with_mnemonic: * @label: the text of the menu item, with an underscore in front of the * mnemonic character * * Creates a new #GtkImageMenuItem containing a label. The label * will be created using gtk_label_new_with_mnemonic(), so underscores * in @label indicate the mnemonic for the menu item. * * Returns: a new #GtkImageMenuItem * * Deprecated: 3.10: Use gtk_menu_item_new_with_mnemonic() instead. */ GtkWidget* gtk_image_menu_item_new_with_mnemonic (const gchar *label) { return g_object_new (GTK_TYPE_IMAGE_MENU_ITEM, "use-underline", TRUE, "label", label, NULL); } /** * gtk_image_menu_item_new_from_stock: * @stock_id: the name of the stock item. * @accel_group: (allow-none): the #GtkAccelGroup to add the menu items * accelerator to, or %NULL. * * Creates a new #GtkImageMenuItem containing the image and text from a * stock item. Some stock ids have preprocessor macros like #GTK_STOCK_OK * and #GTK_STOCK_APPLY. * * If you want this menu item to have changeable accelerators, then pass in * %NULL for accel_group. Next call gtk_menu_item_set_accel_path() with an * appropriate path for the menu item, use gtk_stock_lookup() to look up the * standard accelerator for the stock item, and if one is found, call * gtk_accel_map_add_entry() to register it. * * Returns: a new #GtkImageMenuItem. * * Deprecated: 3.10: Use gtk_menu_item_new() instead. */ GtkWidget* gtk_image_menu_item_new_from_stock (const gchar *stock_id, GtkAccelGroup *accel_group) { return g_object_new (GTK_TYPE_IMAGE_MENU_ITEM, "label", stock_id, "use-stock", TRUE, "accel-group", accel_group, NULL); } /** * gtk_image_menu_item_set_use_stock: * @image_menu_item: a #GtkImageMenuItem * @use_stock: %TRUE if the menuitem should use a stock item * * If %TRUE, the label set in the menuitem is used as a * stock id to select the stock item for the item. * * Since: 2.16 * * Deprecated: 3.10 */ void gtk_image_menu_item_set_use_stock (GtkImageMenuItem *image_menu_item, gboolean use_stock) { GtkImageMenuItemPrivate *priv; g_return_if_fail (GTK_IS_IMAGE_MENU_ITEM (image_menu_item)); priv = image_menu_item->priv; if (priv->use_stock != use_stock) { priv->use_stock = use_stock; gtk_image_menu_item_recalculate (image_menu_item); g_object_notify (G_OBJECT (image_menu_item), "use-stock"); } } /** * gtk_image_menu_item_get_use_stock: * @image_menu_item: a #GtkImageMenuItem * * Checks whether the label set in the menuitem is used as a * stock id to select the stock item for the item. * * Returns: %TRUE if the label set in the menuitem is used as a * stock id to select the stock item for the item * * Since: 2.16 * * Deprecated: 3.10 */ gboolean gtk_image_menu_item_get_use_stock (GtkImageMenuItem *image_menu_item) { g_return_val_if_fail (GTK_IS_IMAGE_MENU_ITEM (image_menu_item), FALSE); return image_menu_item->priv->use_stock; } /** * gtk_image_menu_item_set_always_show_image: * @image_menu_item: a #GtkImageMenuItem * @always_show: %TRUE if the menuitem should always show the image * * If %TRUE, the menu item will ignore the #GtkSettings:gtk-menu-images * setting and always show the image, if available. * * Use this property if the menuitem would be useless or hard to use * without the image. * * Since: 2.16 * * Deprecated: 3.10 */ void gtk_image_menu_item_set_always_show_image (GtkImageMenuItem *image_menu_item, gboolean always_show) { GtkImageMenuItemPrivate *priv; g_return_if_fail (GTK_IS_IMAGE_MENU_ITEM (image_menu_item)); priv = image_menu_item->priv; if (priv->always_show_image != always_show) { priv->always_show_image = always_show; if (priv->image) { if (show_image (image_menu_item)) gtk_widget_show (priv->image); else gtk_widget_hide (priv->image); } g_object_notify (G_OBJECT (image_menu_item), "always-show-image"); } } /** * gtk_image_menu_item_get_always_show_image: * @image_menu_item: a #GtkImageMenuItem * * Returns whether the menu item will ignore the #GtkSettings:gtk-menu-images * setting and always show the image, if available. * * Returns: %TRUE if the menu item will always show the image * * Since: 2.16 * * Deprecated: 3.10 */ gboolean gtk_image_menu_item_get_always_show_image (GtkImageMenuItem *image_menu_item) { g_return_val_if_fail (GTK_IS_IMAGE_MENU_ITEM (image_menu_item), FALSE); return image_menu_item->priv->always_show_image; } /** * gtk_image_menu_item_set_accel_group: * @image_menu_item: a #GtkImageMenuItem * @accel_group: the #GtkAccelGroup * * Specifies an @accel_group to add the menu items accelerator to * (this only applies to stock items so a stock item must already * be set, make sure to call gtk_image_menu_item_set_use_stock() * and gtk_menu_item_set_label() with a valid stock item first). * * If you want this menu item to have changeable accelerators then * you shouldnt need this (see gtk_image_menu_item_new_from_stock()). * * Since: 2.16 * * Deprecated: 3.10 */ void gtk_image_menu_item_set_accel_group (GtkImageMenuItem *image_menu_item, GtkAccelGroup *accel_group) { GtkImageMenuItemPrivate *priv; GtkStockItem stock_item; /* Silent return for the constructor */ if (!accel_group) return; g_return_if_fail (GTK_IS_IMAGE_MENU_ITEM (image_menu_item)); g_return_if_fail (GTK_IS_ACCEL_GROUP (accel_group)); priv = image_menu_item->priv; G_GNUC_BEGIN_IGNORE_DEPRECATIONS; if (priv->use_stock && priv->label && gtk_stock_lookup (priv->label, &stock_item)) if (stock_item.keyval) { gtk_widget_add_accelerator (GTK_WIDGET (image_menu_item), "activate", accel_group, stock_item.keyval, stock_item.modifier, GTK_ACCEL_VISIBLE); g_object_notify (G_OBJECT (image_menu_item), "accel-group"); } G_GNUC_END_IGNORE_DEPRECATIONS; } /** * gtk_image_menu_item_set_image: * @image_menu_item: a #GtkImageMenuItem. * @image: (allow-none): a widget to set as the image for the menu item. * * Sets the image of @image_menu_item to the given widget. * Note that it depends on the show-menu-images setting whether * the image will be displayed or not. * * Deprecated: 3.10 */ void gtk_image_menu_item_set_image (GtkImageMenuItem *image_menu_item, GtkWidget *image) { GtkImageMenuItemPrivate *priv; g_return_if_fail (GTK_IS_IMAGE_MENU_ITEM (image_menu_item)); priv = image_menu_item->priv; if (image == priv->image) return; if (priv->image) gtk_container_remove (GTK_CONTAINER (image_menu_item), priv->image); priv->image = image; if (image == NULL) return; gtk_widget_set_parent (image, GTK_WIDGET (image_menu_item)); g_object_set (image, "visible", show_image (image_menu_item), "no-show-all", TRUE, NULL); g_object_notify (G_OBJECT (image_menu_item), "image"); } /** * gtk_image_menu_item_get_image: * @image_menu_item: a #GtkImageMenuItem * * Gets the widget that is currently set as the image of @image_menu_item. * See gtk_image_menu_item_set_image(). * * Returns: (transfer none): the widget set as image of @image_menu_item * * Deprecated: 3.10 **/ GtkWidget* gtk_image_menu_item_get_image (GtkImageMenuItem *image_menu_item) { g_return_val_if_fail (GTK_IS_IMAGE_MENU_ITEM (image_menu_item), NULL); return image_menu_item->priv->image; } static void gtk_image_menu_item_remove (GtkContainer *container, GtkWidget *child) { GtkImageMenuItem *image_menu_item = GTK_IMAGE_MENU_ITEM (container); GtkImageMenuItemPrivate *priv = image_menu_item->priv; if (child == priv->image) { gboolean widget_was_visible; widget_was_visible = gtk_widget_get_visible (child); gtk_widget_unparent (child); priv->image = NULL; if (widget_was_visible && gtk_widget_get_visible (GTK_WIDGET (container))) gtk_widget_queue_resize (GTK_WIDGET (container)); g_object_notify (G_OBJECT (image_menu_item), "image"); } else { GTK_CONTAINER_CLASS (gtk_image_menu_item_parent_class)->remove (container, child); } } static void show_image_change_notify (GtkImageMenuItem *image_menu_item) { GtkImageMenuItemPrivate *priv = image_menu_item->priv; if (priv->image) { if (show_image (image_menu_item)) gtk_widget_show (priv->image); else gtk_widget_hide (priv->image); } } static void traverse_container (GtkWidget *widget, gpointer data) { if (GTK_IS_IMAGE_MENU_ITEM (widget)) show_image_change_notify (GTK_IMAGE_MENU_ITEM (widget)); else if (GTK_IS_CONTAINER (widget)) gtk_container_forall (GTK_CONTAINER (widget), traverse_container, NULL); } static void gtk_image_menu_item_setting_changed (GtkSettings *settings) { GList *list, *l; list = gtk_window_list_toplevels (); for (l = list; l; l = l->next) gtk_container_forall (GTK_CONTAINER (l->data), traverse_container, NULL); g_list_free (list); } static void gtk_image_menu_item_screen_changed (GtkWidget *widget, GdkScreen *previous_screen) { GtkSettings *settings; gulong show_image_connection; if (!gtk_widget_has_screen (widget)) return; settings = gtk_widget_get_settings (widget); show_image_connection = g_signal_handler_find (settings, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, gtk_image_menu_item_setting_changed, NULL); if (show_image_connection) return; g_signal_connect (settings, "notify::gtk-menu-images", G_CALLBACK (gtk_image_menu_item_setting_changed), NULL); show_image_change_notify (GTK_IMAGE_MENU_ITEM (widget)); }
32.699341
121
0.643147
4243a9a0298b82a56bf2d52cacc30a63a8f3c735
647
h
C
trinity-plugins/kmer/libbio/alphabet.h
genome-vendor/trinity
edf531351bf5c244ae699d0ad69348a249900cce
[ "BSD-3-Clause" ]
4
2015-02-10T06:56:03.000Z
2021-06-30T23:33:07.000Z
trinity-plugins/kmer/libbio/alphabet.h
genome-vendor/trinity
edf531351bf5c244ae699d0ad69348a249900cce
[ "BSD-3-Clause" ]
null
null
null
trinity-plugins/kmer/libbio/alphabet.h
genome-vendor/trinity
edf531351bf5c244ae699d0ad69348a249900cce
[ "BSD-3-Clause" ]
7
2015-03-24T14:23:58.000Z
2020-01-15T16:54:10.000Z
// // Automagically generated -- DO NOT EDIT! // See libbri/alphabet-generate.c for details. // #ifdef __cplusplus extern "C" { #endif extern unsigned char whitespaceSymbol[256]; extern unsigned char toLower[256]; extern unsigned char toUpper[256]; extern unsigned char letterToBits[256]; extern unsigned char bitsToLetter[256]; extern unsigned char bitsToColor[256]; extern unsigned char complementSymbol[256]; extern unsigned char IUPACidentity[128][128]; extern unsigned char baseToColor[128][128]; void initCompressionTablesForACGTSpace(void); void initCompressionTablesForColorSpace(void); #ifdef __cplusplus } #endif
24.884615
47
0.771252
428b141b5f6e10835e3607acd9771bebe69b36b7
40
h
C
firmware/freertos/semaphore/lib/FreeRTOSV8.2.3/FreeRTOS-Plus/Source/WolfSSL/cyassl/test.h
NCTU-AUV/stm32_write_data_to_rpi
95ab0c653badfb635aa06e86b87055ddb7d8ce21
[ "MIT" ]
5,964
2016-09-27T03:46:29.000Z
2022-03-31T16:25:27.000Z
third_party/wolfssl/cyassl/test.h
w4454962/miniblink49
b294b6eacb3333659bf7b94d670d96edeeba14c0
[ "Apache-2.0" ]
459
2016-09-29T00:51:38.000Z
2022-03-07T14:37:46.000Z
third_party/wolfssl/cyassl/test.h
w4454962/miniblink49
b294b6eacb3333659bf7b94d670d96edeeba14c0
[ "Apache-2.0" ]
1,006
2016-09-27T05:17:27.000Z
2022-03-30T02:46:51.000Z
/* test.h */ #include <wolfssl/test.h>
10
25
0.6
f8fc58209aa99f93c9d426133bf0f097ad94588b
967
h
C
include/sk/sys/Executable.h
stemkit-collection/stemkit-cpp
dfa77d831f49916ba6d134f407a4dcd0983328f6
[ "MIT" ]
4
2019-02-19T16:48:41.000Z
2022-01-31T07:57:54.000Z
include/sk/sys/Executable.h
stemkit-collection/stemkit-cpp
dfa77d831f49916ba6d134f407a4dcd0983328f6
[ "MIT" ]
1
2019-01-30T04:48:35.000Z
2019-01-30T04:48:35.000Z
include/sk/sys/Executable.h
stemkit-collection/stemkit-cpp
dfa77d831f49916ba6d134f407a4dcd0983328f6
[ "MIT" ]
null
null
null
/* Copyright (c) 2006, Gennady Bystritsky <bystr@mac.com> * * Distributed under the MIT Licence. * This is free software. See 'LICENSE' for details. * You must read and accept the license prior to use. */ #ifndef _SK_SYS_EXECUTABLE_ #define _SK_SYS_EXECUTABLE_ #include <sk/util/Object.h> namespace sk { namespace sys { class Executable : public virtual sk::util::Object { public: virtual void stop() = 0; virtual void kill() = 0; virtual void terminate() = 0; virtual void interrupt() = 0; virtual void join() = 0; virtual void detach() = 0; virtual bool isSuccess() const = 0; virtual bool isExited() const = 0; virtual bool isKilled() const = 0; virtual bool isAlive() const = 0; virtual int exitStatus() const = 0; virtual int signal() const = 0; virtual int getPid() const = 0; }; } } #endif /* _SK_SYS_EXECUTABLE_ */
26.135135
58
0.610134
225195326bb39eda8afabf746c43fc0e2ab1a832
86,781
h
C
source/code/providers/CIM_MediaAccessDevice.h
pigera/scxcore
7cb5b2c81521d0f984b4a1c8c1f80cea5c9ca9b9
[ "MS-PL" ]
18
2016-04-25T18:24:40.000Z
2019-04-12T01:39:46.000Z
source/code/providers/CIM_MediaAccessDevice.h
pigera/scxcore
7cb5b2c81521d0f984b4a1c8c1f80cea5c9ca9b9
[ "MS-PL" ]
58
2016-03-11T20:46:18.000Z
2019-04-01T09:19:41.000Z
source/code/providers/CIM_MediaAccessDevice.h
pigera/scxcore
7cb5b2c81521d0f984b4a1c8c1f80cea5c9ca9b9
[ "MS-PL" ]
18
2019-05-07T06:41:41.000Z
2021-11-10T10:05:47.000Z
/* @migen@ */ /* **============================================================================== ** ** WARNING: THIS FILE WAS AUTOMATICALLY GENERATED. PLEASE DO NOT EDIT. ** **============================================================================== */ #ifndef _CIM_MediaAccessDevice_h #define _CIM_MediaAccessDevice_h #include <MI.h> #include "CIM_LogicalDevice.h" #include "CIM_ConcreteJob.h" /* **============================================================================== ** ** CIM_MediaAccessDevice [CIM_MediaAccessDevice] ** ** Keys: ** SystemCreationClassName ** SystemName ** CreationClassName ** DeviceID ** **============================================================================== */ typedef struct _CIM_MediaAccessDevice /* extends CIM_LogicalDevice */ { MI_Instance __instance; /* CIM_ManagedElement properties */ MI_ConstStringField InstanceID; MI_ConstStringField Caption; MI_ConstStringField Description; MI_ConstStringField ElementName; /* CIM_ManagedSystemElement properties */ MI_ConstDatetimeField InstallDate; MI_ConstStringField Name; MI_ConstUint16AField OperationalStatus; MI_ConstStringAField StatusDescriptions; MI_ConstStringField Status; MI_ConstUint16Field HealthState; MI_ConstUint16Field CommunicationStatus; MI_ConstUint16Field DetailedStatus; MI_ConstUint16Field OperatingStatus; MI_ConstUint16Field PrimaryStatus; /* CIM_LogicalElement properties */ /* CIM_EnabledLogicalElement properties */ MI_ConstUint16Field EnabledState; MI_ConstStringField OtherEnabledState; MI_ConstUint16Field RequestedState; MI_ConstUint16Field EnabledDefault; MI_ConstDatetimeField TimeOfLastStateChange; MI_ConstUint16AField AvailableRequestedStates; MI_ConstUint16Field TransitioningToState; /* CIM_LogicalDevice properties */ /*KEY*/ MI_ConstStringField SystemCreationClassName; /*KEY*/ MI_ConstStringField SystemName; /*KEY*/ MI_ConstStringField CreationClassName; /*KEY*/ MI_ConstStringField DeviceID; MI_ConstBooleanField PowerManagementSupported; MI_ConstUint16AField PowerManagementCapabilities; MI_ConstUint16Field Availability; MI_ConstUint16Field StatusInfo; MI_ConstUint32Field LastErrorCode; MI_ConstStringField ErrorDescription; MI_ConstBooleanField ErrorCleared; MI_ConstStringAField OtherIdentifyingInfo; MI_ConstUint64Field PowerOnHours; MI_ConstUint64Field TotalPowerOnHours; MI_ConstStringAField IdentifyingDescriptions; MI_ConstUint16AField AdditionalAvailability; MI_ConstUint64Field MaxQuiesceTime; /* CIM_MediaAccessDevice properties */ MI_ConstUint16AField Capabilities; MI_ConstStringAField CapabilityDescriptions; MI_ConstStringField ErrorMethodology; MI_ConstStringField CompressionMethod; MI_ConstUint32Field NumberOfMediaSupported; MI_ConstUint64Field MaxMediaSize; MI_ConstUint64Field DefaultBlockSize; MI_ConstUint64Field MaxBlockSize; MI_ConstUint64Field MinBlockSize; MI_ConstBooleanField NeedsCleaning; MI_ConstBooleanField MediaIsLocked; MI_ConstUint16Field Security; MI_ConstDatetimeField LastCleaned; MI_ConstUint64Field MaxAccessTime; MI_ConstUint32Field UncompressedDataRate; MI_ConstUint64Field LoadTime; MI_ConstUint64Field UnloadTime; MI_ConstUint64Field MountCount; MI_ConstDatetimeField TimeOfLastMount; MI_ConstUint64Field TotalMountTime; MI_ConstStringField UnitsDescription; MI_ConstUint64Field MaxUnitsBeforeCleaning; MI_ConstUint64Field UnitsUsed; } CIM_MediaAccessDevice; typedef struct _CIM_MediaAccessDevice_Ref { CIM_MediaAccessDevice* value; MI_Boolean exists; MI_Uint8 flags; } CIM_MediaAccessDevice_Ref; typedef struct _CIM_MediaAccessDevice_ConstRef { MI_CONST CIM_MediaAccessDevice* value; MI_Boolean exists; MI_Uint8 flags; } CIM_MediaAccessDevice_ConstRef; typedef struct _CIM_MediaAccessDevice_Array { struct _CIM_MediaAccessDevice** data; MI_Uint32 size; } CIM_MediaAccessDevice_Array; typedef struct _CIM_MediaAccessDevice_ConstArray { struct _CIM_MediaAccessDevice MI_CONST* MI_CONST* data; MI_Uint32 size; } CIM_MediaAccessDevice_ConstArray; typedef struct _CIM_MediaAccessDevice_ArrayRef { CIM_MediaAccessDevice_Array value; MI_Boolean exists; MI_Uint8 flags; } CIM_MediaAccessDevice_ArrayRef; typedef struct _CIM_MediaAccessDevice_ConstArrayRef { CIM_MediaAccessDevice_ConstArray value; MI_Boolean exists; MI_Uint8 flags; } CIM_MediaAccessDevice_ConstArrayRef; MI_EXTERN_C MI_CONST MI_ClassDecl CIM_MediaAccessDevice_rtti; MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Construct( CIM_MediaAccessDevice* self, MI_Context* context) { return MI_ConstructInstance(context, &CIM_MediaAccessDevice_rtti, (MI_Instance*)&self->__instance); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clone( const CIM_MediaAccessDevice* self, CIM_MediaAccessDevice** newInstance) { return MI_Instance_Clone( &self->__instance, (MI_Instance**)newInstance); } MI_INLINE MI_Boolean MI_CALL CIM_MediaAccessDevice_IsA( const MI_Instance* self) { MI_Boolean res = MI_FALSE; return MI_Instance_IsA(self, &CIM_MediaAccessDevice_rtti, &res) == MI_RESULT_OK && res; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Destruct(CIM_MediaAccessDevice* self) { return MI_Instance_Destruct(&self->__instance); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Delete(CIM_MediaAccessDevice* self) { return MI_Instance_Delete(&self->__instance); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Post( const CIM_MediaAccessDevice* self, MI_Context* context) { return MI_PostInstance(context, &self->__instance); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_InstanceID( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 0, (MI_Value*)&str, MI_STRING, 0); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPtr_InstanceID( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 0, (MI_Value*)&str, MI_STRING, MI_FLAG_BORROW); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_InstanceID( CIM_MediaAccessDevice* self) { return self->__instance.ft->ClearElementAt( (MI_Instance*)&self->__instance, 0); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_Caption( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 1, (MI_Value*)&str, MI_STRING, 0); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPtr_Caption( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 1, (MI_Value*)&str, MI_STRING, MI_FLAG_BORROW); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_Caption( CIM_MediaAccessDevice* self) { return self->__instance.ft->ClearElementAt( (MI_Instance*)&self->__instance, 1); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_Description( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 2, (MI_Value*)&str, MI_STRING, 0); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPtr_Description( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 2, (MI_Value*)&str, MI_STRING, MI_FLAG_BORROW); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_Description( CIM_MediaAccessDevice* self) { return self->__instance.ft->ClearElementAt( (MI_Instance*)&self->__instance, 2); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_ElementName( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 3, (MI_Value*)&str, MI_STRING, 0); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPtr_ElementName( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 3, (MI_Value*)&str, MI_STRING, MI_FLAG_BORROW); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_ElementName( CIM_MediaAccessDevice* self) { return self->__instance.ft->ClearElementAt( (MI_Instance*)&self->__instance, 3); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_InstallDate( CIM_MediaAccessDevice* self, MI_Datetime x) { ((MI_DatetimeField*)&self->InstallDate)->value = x; ((MI_DatetimeField*)&self->InstallDate)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_InstallDate( CIM_MediaAccessDevice* self) { memset((void*)&self->InstallDate, 0, sizeof(self->InstallDate)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_Name( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 5, (MI_Value*)&str, MI_STRING, 0); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPtr_Name( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 5, (MI_Value*)&str, MI_STRING, MI_FLAG_BORROW); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_Name( CIM_MediaAccessDevice* self) { return self->__instance.ft->ClearElementAt( (MI_Instance*)&self->__instance, 5); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_OperationalStatus( CIM_MediaAccessDevice* self, const MI_Uint16* data, MI_Uint32 size) { MI_Array arr; arr.data = (void*)data; arr.size = size; return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 6, (MI_Value*)&arr, MI_UINT16A, 0); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPtr_OperationalStatus( CIM_MediaAccessDevice* self, const MI_Uint16* data, MI_Uint32 size) { MI_Array arr; arr.data = (void*)data; arr.size = size; return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 6, (MI_Value*)&arr, MI_UINT16A, MI_FLAG_BORROW); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_OperationalStatus( CIM_MediaAccessDevice* self) { return self->__instance.ft->ClearElementAt( (MI_Instance*)&self->__instance, 6); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_StatusDescriptions( CIM_MediaAccessDevice* self, const MI_Char** data, MI_Uint32 size) { MI_Array arr; arr.data = (void*)data; arr.size = size; return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 7, (MI_Value*)&arr, MI_STRINGA, 0); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPtr_StatusDescriptions( CIM_MediaAccessDevice* self, const MI_Char** data, MI_Uint32 size) { MI_Array arr; arr.data = (void*)data; arr.size = size; return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 7, (MI_Value*)&arr, MI_STRINGA, MI_FLAG_BORROW); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_StatusDescriptions( CIM_MediaAccessDevice* self) { return self->__instance.ft->ClearElementAt( (MI_Instance*)&self->__instance, 7); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_Status( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 8, (MI_Value*)&str, MI_STRING, 0); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPtr_Status( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 8, (MI_Value*)&str, MI_STRING, MI_FLAG_BORROW); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_Status( CIM_MediaAccessDevice* self) { return self->__instance.ft->ClearElementAt( (MI_Instance*)&self->__instance, 8); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_HealthState( CIM_MediaAccessDevice* self, MI_Uint16 x) { ((MI_Uint16Field*)&self->HealthState)->value = x; ((MI_Uint16Field*)&self->HealthState)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_HealthState( CIM_MediaAccessDevice* self) { memset((void*)&self->HealthState, 0, sizeof(self->HealthState)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_CommunicationStatus( CIM_MediaAccessDevice* self, MI_Uint16 x) { ((MI_Uint16Field*)&self->CommunicationStatus)->value = x; ((MI_Uint16Field*)&self->CommunicationStatus)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_CommunicationStatus( CIM_MediaAccessDevice* self) { memset((void*)&self->CommunicationStatus, 0, sizeof(self->CommunicationStatus)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_DetailedStatus( CIM_MediaAccessDevice* self, MI_Uint16 x) { ((MI_Uint16Field*)&self->DetailedStatus)->value = x; ((MI_Uint16Field*)&self->DetailedStatus)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_DetailedStatus( CIM_MediaAccessDevice* self) { memset((void*)&self->DetailedStatus, 0, sizeof(self->DetailedStatus)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_OperatingStatus( CIM_MediaAccessDevice* self, MI_Uint16 x) { ((MI_Uint16Field*)&self->OperatingStatus)->value = x; ((MI_Uint16Field*)&self->OperatingStatus)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_OperatingStatus( CIM_MediaAccessDevice* self) { memset((void*)&self->OperatingStatus, 0, sizeof(self->OperatingStatus)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_PrimaryStatus( CIM_MediaAccessDevice* self, MI_Uint16 x) { ((MI_Uint16Field*)&self->PrimaryStatus)->value = x; ((MI_Uint16Field*)&self->PrimaryStatus)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_PrimaryStatus( CIM_MediaAccessDevice* self) { memset((void*)&self->PrimaryStatus, 0, sizeof(self->PrimaryStatus)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_EnabledState( CIM_MediaAccessDevice* self, MI_Uint16 x) { ((MI_Uint16Field*)&self->EnabledState)->value = x; ((MI_Uint16Field*)&self->EnabledState)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_EnabledState( CIM_MediaAccessDevice* self) { memset((void*)&self->EnabledState, 0, sizeof(self->EnabledState)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_OtherEnabledState( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 15, (MI_Value*)&str, MI_STRING, 0); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPtr_OtherEnabledState( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 15, (MI_Value*)&str, MI_STRING, MI_FLAG_BORROW); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_OtherEnabledState( CIM_MediaAccessDevice* self) { return self->__instance.ft->ClearElementAt( (MI_Instance*)&self->__instance, 15); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_RequestedState( CIM_MediaAccessDevice* self, MI_Uint16 x) { ((MI_Uint16Field*)&self->RequestedState)->value = x; ((MI_Uint16Field*)&self->RequestedState)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_RequestedState( CIM_MediaAccessDevice* self) { memset((void*)&self->RequestedState, 0, sizeof(self->RequestedState)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_EnabledDefault( CIM_MediaAccessDevice* self, MI_Uint16 x) { ((MI_Uint16Field*)&self->EnabledDefault)->value = x; ((MI_Uint16Field*)&self->EnabledDefault)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_EnabledDefault( CIM_MediaAccessDevice* self) { memset((void*)&self->EnabledDefault, 0, sizeof(self->EnabledDefault)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_TimeOfLastStateChange( CIM_MediaAccessDevice* self, MI_Datetime x) { ((MI_DatetimeField*)&self->TimeOfLastStateChange)->value = x; ((MI_DatetimeField*)&self->TimeOfLastStateChange)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_TimeOfLastStateChange( CIM_MediaAccessDevice* self) { memset((void*)&self->TimeOfLastStateChange, 0, sizeof(self->TimeOfLastStateChange)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_AvailableRequestedStates( CIM_MediaAccessDevice* self, const MI_Uint16* data, MI_Uint32 size) { MI_Array arr; arr.data = (void*)data; arr.size = size; return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 19, (MI_Value*)&arr, MI_UINT16A, 0); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPtr_AvailableRequestedStates( CIM_MediaAccessDevice* self, const MI_Uint16* data, MI_Uint32 size) { MI_Array arr; arr.data = (void*)data; arr.size = size; return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 19, (MI_Value*)&arr, MI_UINT16A, MI_FLAG_BORROW); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_AvailableRequestedStates( CIM_MediaAccessDevice* self) { return self->__instance.ft->ClearElementAt( (MI_Instance*)&self->__instance, 19); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_TransitioningToState( CIM_MediaAccessDevice* self, MI_Uint16 x) { ((MI_Uint16Field*)&self->TransitioningToState)->value = x; ((MI_Uint16Field*)&self->TransitioningToState)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_TransitioningToState( CIM_MediaAccessDevice* self) { memset((void*)&self->TransitioningToState, 0, sizeof(self->TransitioningToState)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_SystemCreationClassName( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 21, (MI_Value*)&str, MI_STRING, 0); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPtr_SystemCreationClassName( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 21, (MI_Value*)&str, MI_STRING, MI_FLAG_BORROW); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_SystemCreationClassName( CIM_MediaAccessDevice* self) { return self->__instance.ft->ClearElementAt( (MI_Instance*)&self->__instance, 21); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_SystemName( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 22, (MI_Value*)&str, MI_STRING, 0); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPtr_SystemName( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 22, (MI_Value*)&str, MI_STRING, MI_FLAG_BORROW); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_SystemName( CIM_MediaAccessDevice* self) { return self->__instance.ft->ClearElementAt( (MI_Instance*)&self->__instance, 22); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_CreationClassName( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 23, (MI_Value*)&str, MI_STRING, 0); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPtr_CreationClassName( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 23, (MI_Value*)&str, MI_STRING, MI_FLAG_BORROW); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_CreationClassName( CIM_MediaAccessDevice* self) { return self->__instance.ft->ClearElementAt( (MI_Instance*)&self->__instance, 23); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_DeviceID( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 24, (MI_Value*)&str, MI_STRING, 0); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPtr_DeviceID( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 24, (MI_Value*)&str, MI_STRING, MI_FLAG_BORROW); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_DeviceID( CIM_MediaAccessDevice* self) { return self->__instance.ft->ClearElementAt( (MI_Instance*)&self->__instance, 24); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_PowerManagementSupported( CIM_MediaAccessDevice* self, MI_Boolean x) { ((MI_BooleanField*)&self->PowerManagementSupported)->value = x; ((MI_BooleanField*)&self->PowerManagementSupported)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_PowerManagementSupported( CIM_MediaAccessDevice* self) { memset((void*)&self->PowerManagementSupported, 0, sizeof(self->PowerManagementSupported)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_PowerManagementCapabilities( CIM_MediaAccessDevice* self, const MI_Uint16* data, MI_Uint32 size) { MI_Array arr; arr.data = (void*)data; arr.size = size; return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 26, (MI_Value*)&arr, MI_UINT16A, 0); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPtr_PowerManagementCapabilities( CIM_MediaAccessDevice* self, const MI_Uint16* data, MI_Uint32 size) { MI_Array arr; arr.data = (void*)data; arr.size = size; return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 26, (MI_Value*)&arr, MI_UINT16A, MI_FLAG_BORROW); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_PowerManagementCapabilities( CIM_MediaAccessDevice* self) { return self->__instance.ft->ClearElementAt( (MI_Instance*)&self->__instance, 26); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_Availability( CIM_MediaAccessDevice* self, MI_Uint16 x) { ((MI_Uint16Field*)&self->Availability)->value = x; ((MI_Uint16Field*)&self->Availability)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_Availability( CIM_MediaAccessDevice* self) { memset((void*)&self->Availability, 0, sizeof(self->Availability)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_StatusInfo( CIM_MediaAccessDevice* self, MI_Uint16 x) { ((MI_Uint16Field*)&self->StatusInfo)->value = x; ((MI_Uint16Field*)&self->StatusInfo)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_StatusInfo( CIM_MediaAccessDevice* self) { memset((void*)&self->StatusInfo, 0, sizeof(self->StatusInfo)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_LastErrorCode( CIM_MediaAccessDevice* self, MI_Uint32 x) { ((MI_Uint32Field*)&self->LastErrorCode)->value = x; ((MI_Uint32Field*)&self->LastErrorCode)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_LastErrorCode( CIM_MediaAccessDevice* self) { memset((void*)&self->LastErrorCode, 0, sizeof(self->LastErrorCode)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_ErrorDescription( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 30, (MI_Value*)&str, MI_STRING, 0); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPtr_ErrorDescription( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 30, (MI_Value*)&str, MI_STRING, MI_FLAG_BORROW); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_ErrorDescription( CIM_MediaAccessDevice* self) { return self->__instance.ft->ClearElementAt( (MI_Instance*)&self->__instance, 30); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_ErrorCleared( CIM_MediaAccessDevice* self, MI_Boolean x) { ((MI_BooleanField*)&self->ErrorCleared)->value = x; ((MI_BooleanField*)&self->ErrorCleared)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_ErrorCleared( CIM_MediaAccessDevice* self) { memset((void*)&self->ErrorCleared, 0, sizeof(self->ErrorCleared)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_OtherIdentifyingInfo( CIM_MediaAccessDevice* self, const MI_Char** data, MI_Uint32 size) { MI_Array arr; arr.data = (void*)data; arr.size = size; return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 32, (MI_Value*)&arr, MI_STRINGA, 0); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPtr_OtherIdentifyingInfo( CIM_MediaAccessDevice* self, const MI_Char** data, MI_Uint32 size) { MI_Array arr; arr.data = (void*)data; arr.size = size; return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 32, (MI_Value*)&arr, MI_STRINGA, MI_FLAG_BORROW); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_OtherIdentifyingInfo( CIM_MediaAccessDevice* self) { return self->__instance.ft->ClearElementAt( (MI_Instance*)&self->__instance, 32); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_PowerOnHours( CIM_MediaAccessDevice* self, MI_Uint64 x) { ((MI_Uint64Field*)&self->PowerOnHours)->value = x; ((MI_Uint64Field*)&self->PowerOnHours)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_PowerOnHours( CIM_MediaAccessDevice* self) { memset((void*)&self->PowerOnHours, 0, sizeof(self->PowerOnHours)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_TotalPowerOnHours( CIM_MediaAccessDevice* self, MI_Uint64 x) { ((MI_Uint64Field*)&self->TotalPowerOnHours)->value = x; ((MI_Uint64Field*)&self->TotalPowerOnHours)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_TotalPowerOnHours( CIM_MediaAccessDevice* self) { memset((void*)&self->TotalPowerOnHours, 0, sizeof(self->TotalPowerOnHours)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_IdentifyingDescriptions( CIM_MediaAccessDevice* self, const MI_Char** data, MI_Uint32 size) { MI_Array arr; arr.data = (void*)data; arr.size = size; return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 35, (MI_Value*)&arr, MI_STRINGA, 0); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPtr_IdentifyingDescriptions( CIM_MediaAccessDevice* self, const MI_Char** data, MI_Uint32 size) { MI_Array arr; arr.data = (void*)data; arr.size = size; return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 35, (MI_Value*)&arr, MI_STRINGA, MI_FLAG_BORROW); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_IdentifyingDescriptions( CIM_MediaAccessDevice* self) { return self->__instance.ft->ClearElementAt( (MI_Instance*)&self->__instance, 35); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_AdditionalAvailability( CIM_MediaAccessDevice* self, const MI_Uint16* data, MI_Uint32 size) { MI_Array arr; arr.data = (void*)data; arr.size = size; return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 36, (MI_Value*)&arr, MI_UINT16A, 0); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPtr_AdditionalAvailability( CIM_MediaAccessDevice* self, const MI_Uint16* data, MI_Uint32 size) { MI_Array arr; arr.data = (void*)data; arr.size = size; return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 36, (MI_Value*)&arr, MI_UINT16A, MI_FLAG_BORROW); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_AdditionalAvailability( CIM_MediaAccessDevice* self) { return self->__instance.ft->ClearElementAt( (MI_Instance*)&self->__instance, 36); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_MaxQuiesceTime( CIM_MediaAccessDevice* self, MI_Uint64 x) { ((MI_Uint64Field*)&self->MaxQuiesceTime)->value = x; ((MI_Uint64Field*)&self->MaxQuiesceTime)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_MaxQuiesceTime( CIM_MediaAccessDevice* self) { memset((void*)&self->MaxQuiesceTime, 0, sizeof(self->MaxQuiesceTime)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_Capabilities( CIM_MediaAccessDevice* self, const MI_Uint16* data, MI_Uint32 size) { MI_Array arr; arr.data = (void*)data; arr.size = size; return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 38, (MI_Value*)&arr, MI_UINT16A, 0); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPtr_Capabilities( CIM_MediaAccessDevice* self, const MI_Uint16* data, MI_Uint32 size) { MI_Array arr; arr.data = (void*)data; arr.size = size; return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 38, (MI_Value*)&arr, MI_UINT16A, MI_FLAG_BORROW); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_Capabilities( CIM_MediaAccessDevice* self) { return self->__instance.ft->ClearElementAt( (MI_Instance*)&self->__instance, 38); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_CapabilityDescriptions( CIM_MediaAccessDevice* self, const MI_Char** data, MI_Uint32 size) { MI_Array arr; arr.data = (void*)data; arr.size = size; return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 39, (MI_Value*)&arr, MI_STRINGA, 0); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPtr_CapabilityDescriptions( CIM_MediaAccessDevice* self, const MI_Char** data, MI_Uint32 size) { MI_Array arr; arr.data = (void*)data; arr.size = size; return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 39, (MI_Value*)&arr, MI_STRINGA, MI_FLAG_BORROW); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_CapabilityDescriptions( CIM_MediaAccessDevice* self) { return self->__instance.ft->ClearElementAt( (MI_Instance*)&self->__instance, 39); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_ErrorMethodology( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 40, (MI_Value*)&str, MI_STRING, 0); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPtr_ErrorMethodology( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 40, (MI_Value*)&str, MI_STRING, MI_FLAG_BORROW); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_ErrorMethodology( CIM_MediaAccessDevice* self) { return self->__instance.ft->ClearElementAt( (MI_Instance*)&self->__instance, 40); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_CompressionMethod( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 41, (MI_Value*)&str, MI_STRING, 0); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPtr_CompressionMethod( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 41, (MI_Value*)&str, MI_STRING, MI_FLAG_BORROW); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_CompressionMethod( CIM_MediaAccessDevice* self) { return self->__instance.ft->ClearElementAt( (MI_Instance*)&self->__instance, 41); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_NumberOfMediaSupported( CIM_MediaAccessDevice* self, MI_Uint32 x) { ((MI_Uint32Field*)&self->NumberOfMediaSupported)->value = x; ((MI_Uint32Field*)&self->NumberOfMediaSupported)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_NumberOfMediaSupported( CIM_MediaAccessDevice* self) { memset((void*)&self->NumberOfMediaSupported, 0, sizeof(self->NumberOfMediaSupported)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_MaxMediaSize( CIM_MediaAccessDevice* self, MI_Uint64 x) { ((MI_Uint64Field*)&self->MaxMediaSize)->value = x; ((MI_Uint64Field*)&self->MaxMediaSize)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_MaxMediaSize( CIM_MediaAccessDevice* self) { memset((void*)&self->MaxMediaSize, 0, sizeof(self->MaxMediaSize)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_DefaultBlockSize( CIM_MediaAccessDevice* self, MI_Uint64 x) { ((MI_Uint64Field*)&self->DefaultBlockSize)->value = x; ((MI_Uint64Field*)&self->DefaultBlockSize)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_DefaultBlockSize( CIM_MediaAccessDevice* self) { memset((void*)&self->DefaultBlockSize, 0, sizeof(self->DefaultBlockSize)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_MaxBlockSize( CIM_MediaAccessDevice* self, MI_Uint64 x) { ((MI_Uint64Field*)&self->MaxBlockSize)->value = x; ((MI_Uint64Field*)&self->MaxBlockSize)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_MaxBlockSize( CIM_MediaAccessDevice* self) { memset((void*)&self->MaxBlockSize, 0, sizeof(self->MaxBlockSize)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_MinBlockSize( CIM_MediaAccessDevice* self, MI_Uint64 x) { ((MI_Uint64Field*)&self->MinBlockSize)->value = x; ((MI_Uint64Field*)&self->MinBlockSize)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_MinBlockSize( CIM_MediaAccessDevice* self) { memset((void*)&self->MinBlockSize, 0, sizeof(self->MinBlockSize)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_NeedsCleaning( CIM_MediaAccessDevice* self, MI_Boolean x) { ((MI_BooleanField*)&self->NeedsCleaning)->value = x; ((MI_BooleanField*)&self->NeedsCleaning)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_NeedsCleaning( CIM_MediaAccessDevice* self) { memset((void*)&self->NeedsCleaning, 0, sizeof(self->NeedsCleaning)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_MediaIsLocked( CIM_MediaAccessDevice* self, MI_Boolean x) { ((MI_BooleanField*)&self->MediaIsLocked)->value = x; ((MI_BooleanField*)&self->MediaIsLocked)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_MediaIsLocked( CIM_MediaAccessDevice* self) { memset((void*)&self->MediaIsLocked, 0, sizeof(self->MediaIsLocked)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_Security( CIM_MediaAccessDevice* self, MI_Uint16 x) { ((MI_Uint16Field*)&self->Security)->value = x; ((MI_Uint16Field*)&self->Security)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_Security( CIM_MediaAccessDevice* self) { memset((void*)&self->Security, 0, sizeof(self->Security)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_LastCleaned( CIM_MediaAccessDevice* self, MI_Datetime x) { ((MI_DatetimeField*)&self->LastCleaned)->value = x; ((MI_DatetimeField*)&self->LastCleaned)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_LastCleaned( CIM_MediaAccessDevice* self) { memset((void*)&self->LastCleaned, 0, sizeof(self->LastCleaned)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_MaxAccessTime( CIM_MediaAccessDevice* self, MI_Uint64 x) { ((MI_Uint64Field*)&self->MaxAccessTime)->value = x; ((MI_Uint64Field*)&self->MaxAccessTime)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_MaxAccessTime( CIM_MediaAccessDevice* self) { memset((void*)&self->MaxAccessTime, 0, sizeof(self->MaxAccessTime)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_UncompressedDataRate( CIM_MediaAccessDevice* self, MI_Uint32 x) { ((MI_Uint32Field*)&self->UncompressedDataRate)->value = x; ((MI_Uint32Field*)&self->UncompressedDataRate)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_UncompressedDataRate( CIM_MediaAccessDevice* self) { memset((void*)&self->UncompressedDataRate, 0, sizeof(self->UncompressedDataRate)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_LoadTime( CIM_MediaAccessDevice* self, MI_Uint64 x) { ((MI_Uint64Field*)&self->LoadTime)->value = x; ((MI_Uint64Field*)&self->LoadTime)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_LoadTime( CIM_MediaAccessDevice* self) { memset((void*)&self->LoadTime, 0, sizeof(self->LoadTime)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_UnloadTime( CIM_MediaAccessDevice* self, MI_Uint64 x) { ((MI_Uint64Field*)&self->UnloadTime)->value = x; ((MI_Uint64Field*)&self->UnloadTime)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_UnloadTime( CIM_MediaAccessDevice* self) { memset((void*)&self->UnloadTime, 0, sizeof(self->UnloadTime)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_MountCount( CIM_MediaAccessDevice* self, MI_Uint64 x) { ((MI_Uint64Field*)&self->MountCount)->value = x; ((MI_Uint64Field*)&self->MountCount)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_MountCount( CIM_MediaAccessDevice* self) { memset((void*)&self->MountCount, 0, sizeof(self->MountCount)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_TimeOfLastMount( CIM_MediaAccessDevice* self, MI_Datetime x) { ((MI_DatetimeField*)&self->TimeOfLastMount)->value = x; ((MI_DatetimeField*)&self->TimeOfLastMount)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_TimeOfLastMount( CIM_MediaAccessDevice* self) { memset((void*)&self->TimeOfLastMount, 0, sizeof(self->TimeOfLastMount)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_TotalMountTime( CIM_MediaAccessDevice* self, MI_Uint64 x) { ((MI_Uint64Field*)&self->TotalMountTime)->value = x; ((MI_Uint64Field*)&self->TotalMountTime)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_TotalMountTime( CIM_MediaAccessDevice* self) { memset((void*)&self->TotalMountTime, 0, sizeof(self->TotalMountTime)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_UnitsDescription( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 58, (MI_Value*)&str, MI_STRING, 0); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPtr_UnitsDescription( CIM_MediaAccessDevice* self, const MI_Char* str) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 58, (MI_Value*)&str, MI_STRING, MI_FLAG_BORROW); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_UnitsDescription( CIM_MediaAccessDevice* self) { return self->__instance.ft->ClearElementAt( (MI_Instance*)&self->__instance, 58); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_MaxUnitsBeforeCleaning( CIM_MediaAccessDevice* self, MI_Uint64 x) { ((MI_Uint64Field*)&self->MaxUnitsBeforeCleaning)->value = x; ((MI_Uint64Field*)&self->MaxUnitsBeforeCleaning)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_MaxUnitsBeforeCleaning( CIM_MediaAccessDevice* self) { memset((void*)&self->MaxUnitsBeforeCleaning, 0, sizeof(self->MaxUnitsBeforeCleaning)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Set_UnitsUsed( CIM_MediaAccessDevice* self, MI_Uint64 x) { ((MI_Uint64Field*)&self->UnitsUsed)->value = x; ((MI_Uint64Field*)&self->UnitsUsed)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Clear_UnitsUsed( CIM_MediaAccessDevice* self) { memset((void*)&self->UnitsUsed, 0, sizeof(self->UnitsUsed)); return MI_RESULT_OK; } /* **============================================================================== ** ** CIM_MediaAccessDevice.RequestStateChange() ** **============================================================================== */ typedef struct _CIM_MediaAccessDevice_RequestStateChange { MI_Instance __instance; /*OUT*/ MI_ConstUint32Field MIReturn; /*IN*/ MI_ConstUint16Field RequestedState; /*OUT*/ CIM_ConcreteJob_ConstRef Job; /*IN*/ MI_ConstDatetimeField TimeoutPeriod; } CIM_MediaAccessDevice_RequestStateChange; MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_RequestStateChange_Set_MIReturn( CIM_MediaAccessDevice_RequestStateChange* self, MI_Uint32 x) { ((MI_Uint32Field*)&self->MIReturn)->value = x; ((MI_Uint32Field*)&self->MIReturn)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_RequestStateChange_Clear_MIReturn( CIM_MediaAccessDevice_RequestStateChange* self) { memset((void*)&self->MIReturn, 0, sizeof(self->MIReturn)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_RequestStateChange_Set_RequestedState( CIM_MediaAccessDevice_RequestStateChange* self, MI_Uint16 x) { ((MI_Uint16Field*)&self->RequestedState)->value = x; ((MI_Uint16Field*)&self->RequestedState)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_RequestStateChange_Clear_RequestedState( CIM_MediaAccessDevice_RequestStateChange* self) { memset((void*)&self->RequestedState, 0, sizeof(self->RequestedState)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_RequestStateChange_Set_Job( CIM_MediaAccessDevice_RequestStateChange* self, const CIM_ConcreteJob* x) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 2, (MI_Value*)&x, MI_REFERENCE, 0); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_RequestStateChange_SetPtr_Job( CIM_MediaAccessDevice_RequestStateChange* self, const CIM_ConcreteJob* x) { return self->__instance.ft->SetElementAt( (MI_Instance*)&self->__instance, 2, (MI_Value*)&x, MI_REFERENCE, MI_FLAG_BORROW); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_RequestStateChange_Clear_Job( CIM_MediaAccessDevice_RequestStateChange* self) { return self->__instance.ft->ClearElementAt( (MI_Instance*)&self->__instance, 2); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_RequestStateChange_Set_TimeoutPeriod( CIM_MediaAccessDevice_RequestStateChange* self, MI_Datetime x) { ((MI_DatetimeField*)&self->TimeoutPeriod)->value = x; ((MI_DatetimeField*)&self->TimeoutPeriod)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_RequestStateChange_Clear_TimeoutPeriod( CIM_MediaAccessDevice_RequestStateChange* self) { memset((void*)&self->TimeoutPeriod, 0, sizeof(self->TimeoutPeriod)); return MI_RESULT_OK; } /* **============================================================================== ** ** CIM_MediaAccessDevice.SetPowerState() ** **============================================================================== */ typedef struct _CIM_MediaAccessDevice_SetPowerState { MI_Instance __instance; /*OUT*/ MI_ConstUint32Field MIReturn; /*IN*/ MI_ConstUint16Field PowerState; /*IN*/ MI_ConstDatetimeField Time; } CIM_MediaAccessDevice_SetPowerState; MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPowerState_Set_MIReturn( CIM_MediaAccessDevice_SetPowerState* self, MI_Uint32 x) { ((MI_Uint32Field*)&self->MIReturn)->value = x; ((MI_Uint32Field*)&self->MIReturn)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPowerState_Clear_MIReturn( CIM_MediaAccessDevice_SetPowerState* self) { memset((void*)&self->MIReturn, 0, sizeof(self->MIReturn)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPowerState_Set_PowerState( CIM_MediaAccessDevice_SetPowerState* self, MI_Uint16 x) { ((MI_Uint16Field*)&self->PowerState)->value = x; ((MI_Uint16Field*)&self->PowerState)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPowerState_Clear_PowerState( CIM_MediaAccessDevice_SetPowerState* self) { memset((void*)&self->PowerState, 0, sizeof(self->PowerState)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPowerState_Set_Time( CIM_MediaAccessDevice_SetPowerState* self, MI_Datetime x) { ((MI_DatetimeField*)&self->Time)->value = x; ((MI_DatetimeField*)&self->Time)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SetPowerState_Clear_Time( CIM_MediaAccessDevice_SetPowerState* self) { memset((void*)&self->Time, 0, sizeof(self->Time)); return MI_RESULT_OK; } /* **============================================================================== ** ** CIM_MediaAccessDevice.Reset() ** **============================================================================== */ typedef struct _CIM_MediaAccessDevice_Reset { MI_Instance __instance; /*OUT*/ MI_ConstUint32Field MIReturn; } CIM_MediaAccessDevice_Reset; MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Reset_Set_MIReturn( CIM_MediaAccessDevice_Reset* self, MI_Uint32 x) { ((MI_Uint32Field*)&self->MIReturn)->value = x; ((MI_Uint32Field*)&self->MIReturn)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_Reset_Clear_MIReturn( CIM_MediaAccessDevice_Reset* self) { memset((void*)&self->MIReturn, 0, sizeof(self->MIReturn)); return MI_RESULT_OK; } /* **============================================================================== ** ** CIM_MediaAccessDevice.EnableDevice() ** **============================================================================== */ typedef struct _CIM_MediaAccessDevice_EnableDevice { MI_Instance __instance; /*OUT*/ MI_ConstUint32Field MIReturn; /*IN*/ MI_ConstBooleanField Enabled; } CIM_MediaAccessDevice_EnableDevice; MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_EnableDevice_Set_MIReturn( CIM_MediaAccessDevice_EnableDevice* self, MI_Uint32 x) { ((MI_Uint32Field*)&self->MIReturn)->value = x; ((MI_Uint32Field*)&self->MIReturn)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_EnableDevice_Clear_MIReturn( CIM_MediaAccessDevice_EnableDevice* self) { memset((void*)&self->MIReturn, 0, sizeof(self->MIReturn)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_EnableDevice_Set_Enabled( CIM_MediaAccessDevice_EnableDevice* self, MI_Boolean x) { ((MI_BooleanField*)&self->Enabled)->value = x; ((MI_BooleanField*)&self->Enabled)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_EnableDevice_Clear_Enabled( CIM_MediaAccessDevice_EnableDevice* self) { memset((void*)&self->Enabled, 0, sizeof(self->Enabled)); return MI_RESULT_OK; } /* **============================================================================== ** ** CIM_MediaAccessDevice.OnlineDevice() ** **============================================================================== */ typedef struct _CIM_MediaAccessDevice_OnlineDevice { MI_Instance __instance; /*OUT*/ MI_ConstUint32Field MIReturn; /*IN*/ MI_ConstBooleanField Online; } CIM_MediaAccessDevice_OnlineDevice; MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_OnlineDevice_Set_MIReturn( CIM_MediaAccessDevice_OnlineDevice* self, MI_Uint32 x) { ((MI_Uint32Field*)&self->MIReturn)->value = x; ((MI_Uint32Field*)&self->MIReturn)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_OnlineDevice_Clear_MIReturn( CIM_MediaAccessDevice_OnlineDevice* self) { memset((void*)&self->MIReturn, 0, sizeof(self->MIReturn)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_OnlineDevice_Set_Online( CIM_MediaAccessDevice_OnlineDevice* self, MI_Boolean x) { ((MI_BooleanField*)&self->Online)->value = x; ((MI_BooleanField*)&self->Online)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_OnlineDevice_Clear_Online( CIM_MediaAccessDevice_OnlineDevice* self) { memset((void*)&self->Online, 0, sizeof(self->Online)); return MI_RESULT_OK; } /* **============================================================================== ** ** CIM_MediaAccessDevice.QuiesceDevice() ** **============================================================================== */ typedef struct _CIM_MediaAccessDevice_QuiesceDevice { MI_Instance __instance; /*OUT*/ MI_ConstUint32Field MIReturn; /*IN*/ MI_ConstBooleanField Quiesce; } CIM_MediaAccessDevice_QuiesceDevice; MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_QuiesceDevice_Set_MIReturn( CIM_MediaAccessDevice_QuiesceDevice* self, MI_Uint32 x) { ((MI_Uint32Field*)&self->MIReturn)->value = x; ((MI_Uint32Field*)&self->MIReturn)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_QuiesceDevice_Clear_MIReturn( CIM_MediaAccessDevice_QuiesceDevice* self) { memset((void*)&self->MIReturn, 0, sizeof(self->MIReturn)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_QuiesceDevice_Set_Quiesce( CIM_MediaAccessDevice_QuiesceDevice* self, MI_Boolean x) { ((MI_BooleanField*)&self->Quiesce)->value = x; ((MI_BooleanField*)&self->Quiesce)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_QuiesceDevice_Clear_Quiesce( CIM_MediaAccessDevice_QuiesceDevice* self) { memset((void*)&self->Quiesce, 0, sizeof(self->Quiesce)); return MI_RESULT_OK; } /* **============================================================================== ** ** CIM_MediaAccessDevice.SaveProperties() ** **============================================================================== */ typedef struct _CIM_MediaAccessDevice_SaveProperties { MI_Instance __instance; /*OUT*/ MI_ConstUint32Field MIReturn; } CIM_MediaAccessDevice_SaveProperties; MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SaveProperties_Set_MIReturn( CIM_MediaAccessDevice_SaveProperties* self, MI_Uint32 x) { ((MI_Uint32Field*)&self->MIReturn)->value = x; ((MI_Uint32Field*)&self->MIReturn)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_SaveProperties_Clear_MIReturn( CIM_MediaAccessDevice_SaveProperties* self) { memset((void*)&self->MIReturn, 0, sizeof(self->MIReturn)); return MI_RESULT_OK; } /* **============================================================================== ** ** CIM_MediaAccessDevice.RestoreProperties() ** **============================================================================== */ typedef struct _CIM_MediaAccessDevice_RestoreProperties { MI_Instance __instance; /*OUT*/ MI_ConstUint32Field MIReturn; } CIM_MediaAccessDevice_RestoreProperties; MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_RestoreProperties_Set_MIReturn( CIM_MediaAccessDevice_RestoreProperties* self, MI_Uint32 x) { ((MI_Uint32Field*)&self->MIReturn)->value = x; ((MI_Uint32Field*)&self->MIReturn)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_RestoreProperties_Clear_MIReturn( CIM_MediaAccessDevice_RestoreProperties* self) { memset((void*)&self->MIReturn, 0, sizeof(self->MIReturn)); return MI_RESULT_OK; } /* **============================================================================== ** ** CIM_MediaAccessDevice.LockMedia() ** **============================================================================== */ typedef struct _CIM_MediaAccessDevice_LockMedia { MI_Instance __instance; /*OUT*/ MI_ConstUint32Field MIReturn; /*IN*/ MI_ConstBooleanField Lock; } CIM_MediaAccessDevice_LockMedia; MI_EXTERN_C MI_CONST MI_MethodDecl CIM_MediaAccessDevice_LockMedia_rtti; MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_LockMedia_Construct( CIM_MediaAccessDevice_LockMedia* self, MI_Context* context) { return MI_ConstructParameters(context, &CIM_MediaAccessDevice_LockMedia_rtti, (MI_Instance*)&self->__instance); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_LockMedia_Clone( const CIM_MediaAccessDevice_LockMedia* self, CIM_MediaAccessDevice_LockMedia** newInstance) { return MI_Instance_Clone( &self->__instance, (MI_Instance**)newInstance); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_LockMedia_Destruct( CIM_MediaAccessDevice_LockMedia* self) { return MI_Instance_Destruct(&self->__instance); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_LockMedia_Delete( CIM_MediaAccessDevice_LockMedia* self) { return MI_Instance_Delete(&self->__instance); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_LockMedia_Post( const CIM_MediaAccessDevice_LockMedia* self, MI_Context* context) { return MI_PostInstance(context, &self->__instance); } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_LockMedia_Set_MIReturn( CIM_MediaAccessDevice_LockMedia* self, MI_Uint32 x) { ((MI_Uint32Field*)&self->MIReturn)->value = x; ((MI_Uint32Field*)&self->MIReturn)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_LockMedia_Clear_MIReturn( CIM_MediaAccessDevice_LockMedia* self) { memset((void*)&self->MIReturn, 0, sizeof(self->MIReturn)); return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_LockMedia_Set_Lock( CIM_MediaAccessDevice_LockMedia* self, MI_Boolean x) { ((MI_BooleanField*)&self->Lock)->value = x; ((MI_BooleanField*)&self->Lock)->exists = 1; return MI_RESULT_OK; } MI_INLINE MI_Result MI_CALL CIM_MediaAccessDevice_LockMedia_Clear_Lock( CIM_MediaAccessDevice_LockMedia* self) { memset((void*)&self->Lock, 0, sizeof(self->Lock)); return MI_RESULT_OK; } /* **============================================================================== ** ** CIM_MediaAccessDevice_Class ** **============================================================================== */ #ifdef __cplusplus # include <micxx/micxx.h> MI_BEGIN_NAMESPACE class CIM_MediaAccessDevice_Class : public CIM_LogicalDevice_Class { public: typedef CIM_MediaAccessDevice Self; CIM_MediaAccessDevice_Class() : CIM_LogicalDevice_Class(&CIM_MediaAccessDevice_rtti) { } CIM_MediaAccessDevice_Class( const CIM_MediaAccessDevice* instanceName, bool keysOnly) : CIM_LogicalDevice_Class( &CIM_MediaAccessDevice_rtti, &instanceName->__instance, keysOnly) { } CIM_MediaAccessDevice_Class( const MI_ClassDecl* clDecl, const MI_Instance* instance, bool keysOnly) : CIM_LogicalDevice_Class(clDecl, instance, keysOnly) { } CIM_MediaAccessDevice_Class( const MI_ClassDecl* clDecl) : CIM_LogicalDevice_Class(clDecl) { } CIM_MediaAccessDevice_Class& operator=( const CIM_MediaAccessDevice_Class& x) { CopyRef(x); return *this; } CIM_MediaAccessDevice_Class( const CIM_MediaAccessDevice_Class& x) : CIM_LogicalDevice_Class(x) { } static const MI_ClassDecl* GetClassDecl() { return &CIM_MediaAccessDevice_rtti; } // // CIM_MediaAccessDevice_Class.Capabilities // const Field<Uint16A>& Capabilities() const { const size_t n = offsetof(Self, Capabilities); return GetField<Uint16A>(n); } void Capabilities(const Field<Uint16A>& x) { const size_t n = offsetof(Self, Capabilities); GetField<Uint16A>(n) = x; } const Uint16A& Capabilities_value() const { const size_t n = offsetof(Self, Capabilities); return GetField<Uint16A>(n).value; } void Capabilities_value(const Uint16A& x) { const size_t n = offsetof(Self, Capabilities); GetField<Uint16A>(n).Set(x); } bool Capabilities_exists() const { const size_t n = offsetof(Self, Capabilities); return GetField<Uint16A>(n).exists ? true : false; } void Capabilities_clear() { const size_t n = offsetof(Self, Capabilities); GetField<Uint16A>(n).Clear(); } // // CIM_MediaAccessDevice_Class.CapabilityDescriptions // const Field<StringA>& CapabilityDescriptions() const { const size_t n = offsetof(Self, CapabilityDescriptions); return GetField<StringA>(n); } void CapabilityDescriptions(const Field<StringA>& x) { const size_t n = offsetof(Self, CapabilityDescriptions); GetField<StringA>(n) = x; } const StringA& CapabilityDescriptions_value() const { const size_t n = offsetof(Self, CapabilityDescriptions); return GetField<StringA>(n).value; } void CapabilityDescriptions_value(const StringA& x) { const size_t n = offsetof(Self, CapabilityDescriptions); GetField<StringA>(n).Set(x); } bool CapabilityDescriptions_exists() const { const size_t n = offsetof(Self, CapabilityDescriptions); return GetField<StringA>(n).exists ? true : false; } void CapabilityDescriptions_clear() { const size_t n = offsetof(Self, CapabilityDescriptions); GetField<StringA>(n).Clear(); } // // CIM_MediaAccessDevice_Class.ErrorMethodology // const Field<String>& ErrorMethodology() const { const size_t n = offsetof(Self, ErrorMethodology); return GetField<String>(n); } void ErrorMethodology(const Field<String>& x) { const size_t n = offsetof(Self, ErrorMethodology); GetField<String>(n) = x; } const String& ErrorMethodology_value() const { const size_t n = offsetof(Self, ErrorMethodology); return GetField<String>(n).value; } void ErrorMethodology_value(const String& x) { const size_t n = offsetof(Self, ErrorMethodology); GetField<String>(n).Set(x); } bool ErrorMethodology_exists() const { const size_t n = offsetof(Self, ErrorMethodology); return GetField<String>(n).exists ? true : false; } void ErrorMethodology_clear() { const size_t n = offsetof(Self, ErrorMethodology); GetField<String>(n).Clear(); } // // CIM_MediaAccessDevice_Class.CompressionMethod // const Field<String>& CompressionMethod() const { const size_t n = offsetof(Self, CompressionMethod); return GetField<String>(n); } void CompressionMethod(const Field<String>& x) { const size_t n = offsetof(Self, CompressionMethod); GetField<String>(n) = x; } const String& CompressionMethod_value() const { const size_t n = offsetof(Self, CompressionMethod); return GetField<String>(n).value; } void CompressionMethod_value(const String& x) { const size_t n = offsetof(Self, CompressionMethod); GetField<String>(n).Set(x); } bool CompressionMethod_exists() const { const size_t n = offsetof(Self, CompressionMethod); return GetField<String>(n).exists ? true : false; } void CompressionMethod_clear() { const size_t n = offsetof(Self, CompressionMethod); GetField<String>(n).Clear(); } // // CIM_MediaAccessDevice_Class.NumberOfMediaSupported // const Field<Uint32>& NumberOfMediaSupported() const { const size_t n = offsetof(Self, NumberOfMediaSupported); return GetField<Uint32>(n); } void NumberOfMediaSupported(const Field<Uint32>& x) { const size_t n = offsetof(Self, NumberOfMediaSupported); GetField<Uint32>(n) = x; } const Uint32& NumberOfMediaSupported_value() const { const size_t n = offsetof(Self, NumberOfMediaSupported); return GetField<Uint32>(n).value; } void NumberOfMediaSupported_value(const Uint32& x) { const size_t n = offsetof(Self, NumberOfMediaSupported); GetField<Uint32>(n).Set(x); } bool NumberOfMediaSupported_exists() const { const size_t n = offsetof(Self, NumberOfMediaSupported); return GetField<Uint32>(n).exists ? true : false; } void NumberOfMediaSupported_clear() { const size_t n = offsetof(Self, NumberOfMediaSupported); GetField<Uint32>(n).Clear(); } // // CIM_MediaAccessDevice_Class.MaxMediaSize // const Field<Uint64>& MaxMediaSize() const { const size_t n = offsetof(Self, MaxMediaSize); return GetField<Uint64>(n); } void MaxMediaSize(const Field<Uint64>& x) { const size_t n = offsetof(Self, MaxMediaSize); GetField<Uint64>(n) = x; } const Uint64& MaxMediaSize_value() const { const size_t n = offsetof(Self, MaxMediaSize); return GetField<Uint64>(n).value; } void MaxMediaSize_value(const Uint64& x) { const size_t n = offsetof(Self, MaxMediaSize); GetField<Uint64>(n).Set(x); } bool MaxMediaSize_exists() const { const size_t n = offsetof(Self, MaxMediaSize); return GetField<Uint64>(n).exists ? true : false; } void MaxMediaSize_clear() { const size_t n = offsetof(Self, MaxMediaSize); GetField<Uint64>(n).Clear(); } // // CIM_MediaAccessDevice_Class.DefaultBlockSize // const Field<Uint64>& DefaultBlockSize() const { const size_t n = offsetof(Self, DefaultBlockSize); return GetField<Uint64>(n); } void DefaultBlockSize(const Field<Uint64>& x) { const size_t n = offsetof(Self, DefaultBlockSize); GetField<Uint64>(n) = x; } const Uint64& DefaultBlockSize_value() const { const size_t n = offsetof(Self, DefaultBlockSize); return GetField<Uint64>(n).value; } void DefaultBlockSize_value(const Uint64& x) { const size_t n = offsetof(Self, DefaultBlockSize); GetField<Uint64>(n).Set(x); } bool DefaultBlockSize_exists() const { const size_t n = offsetof(Self, DefaultBlockSize); return GetField<Uint64>(n).exists ? true : false; } void DefaultBlockSize_clear() { const size_t n = offsetof(Self, DefaultBlockSize); GetField<Uint64>(n).Clear(); } // // CIM_MediaAccessDevice_Class.MaxBlockSize // const Field<Uint64>& MaxBlockSize() const { const size_t n = offsetof(Self, MaxBlockSize); return GetField<Uint64>(n); } void MaxBlockSize(const Field<Uint64>& x) { const size_t n = offsetof(Self, MaxBlockSize); GetField<Uint64>(n) = x; } const Uint64& MaxBlockSize_value() const { const size_t n = offsetof(Self, MaxBlockSize); return GetField<Uint64>(n).value; } void MaxBlockSize_value(const Uint64& x) { const size_t n = offsetof(Self, MaxBlockSize); GetField<Uint64>(n).Set(x); } bool MaxBlockSize_exists() const { const size_t n = offsetof(Self, MaxBlockSize); return GetField<Uint64>(n).exists ? true : false; } void MaxBlockSize_clear() { const size_t n = offsetof(Self, MaxBlockSize); GetField<Uint64>(n).Clear(); } // // CIM_MediaAccessDevice_Class.MinBlockSize // const Field<Uint64>& MinBlockSize() const { const size_t n = offsetof(Self, MinBlockSize); return GetField<Uint64>(n); } void MinBlockSize(const Field<Uint64>& x) { const size_t n = offsetof(Self, MinBlockSize); GetField<Uint64>(n) = x; } const Uint64& MinBlockSize_value() const { const size_t n = offsetof(Self, MinBlockSize); return GetField<Uint64>(n).value; } void MinBlockSize_value(const Uint64& x) { const size_t n = offsetof(Self, MinBlockSize); GetField<Uint64>(n).Set(x); } bool MinBlockSize_exists() const { const size_t n = offsetof(Self, MinBlockSize); return GetField<Uint64>(n).exists ? true : false; } void MinBlockSize_clear() { const size_t n = offsetof(Self, MinBlockSize); GetField<Uint64>(n).Clear(); } // // CIM_MediaAccessDevice_Class.NeedsCleaning // const Field<Boolean>& NeedsCleaning() const { const size_t n = offsetof(Self, NeedsCleaning); return GetField<Boolean>(n); } void NeedsCleaning(const Field<Boolean>& x) { const size_t n = offsetof(Self, NeedsCleaning); GetField<Boolean>(n) = x; } const Boolean& NeedsCleaning_value() const { const size_t n = offsetof(Self, NeedsCleaning); return GetField<Boolean>(n).value; } void NeedsCleaning_value(const Boolean& x) { const size_t n = offsetof(Self, NeedsCleaning); GetField<Boolean>(n).Set(x); } bool NeedsCleaning_exists() const { const size_t n = offsetof(Self, NeedsCleaning); return GetField<Boolean>(n).exists ? true : false; } void NeedsCleaning_clear() { const size_t n = offsetof(Self, NeedsCleaning); GetField<Boolean>(n).Clear(); } // // CIM_MediaAccessDevice_Class.MediaIsLocked // const Field<Boolean>& MediaIsLocked() const { const size_t n = offsetof(Self, MediaIsLocked); return GetField<Boolean>(n); } void MediaIsLocked(const Field<Boolean>& x) { const size_t n = offsetof(Self, MediaIsLocked); GetField<Boolean>(n) = x; } const Boolean& MediaIsLocked_value() const { const size_t n = offsetof(Self, MediaIsLocked); return GetField<Boolean>(n).value; } void MediaIsLocked_value(const Boolean& x) { const size_t n = offsetof(Self, MediaIsLocked); GetField<Boolean>(n).Set(x); } bool MediaIsLocked_exists() const { const size_t n = offsetof(Self, MediaIsLocked); return GetField<Boolean>(n).exists ? true : false; } void MediaIsLocked_clear() { const size_t n = offsetof(Self, MediaIsLocked); GetField<Boolean>(n).Clear(); } // // CIM_MediaAccessDevice_Class.Security // const Field<Uint16>& Security() const { const size_t n = offsetof(Self, Security); return GetField<Uint16>(n); } void Security(const Field<Uint16>& x) { const size_t n = offsetof(Self, Security); GetField<Uint16>(n) = x; } const Uint16& Security_value() const { const size_t n = offsetof(Self, Security); return GetField<Uint16>(n).value; } void Security_value(const Uint16& x) { const size_t n = offsetof(Self, Security); GetField<Uint16>(n).Set(x); } bool Security_exists() const { const size_t n = offsetof(Self, Security); return GetField<Uint16>(n).exists ? true : false; } void Security_clear() { const size_t n = offsetof(Self, Security); GetField<Uint16>(n).Clear(); } // // CIM_MediaAccessDevice_Class.LastCleaned // const Field<Datetime>& LastCleaned() const { const size_t n = offsetof(Self, LastCleaned); return GetField<Datetime>(n); } void LastCleaned(const Field<Datetime>& x) { const size_t n = offsetof(Self, LastCleaned); GetField<Datetime>(n) = x; } const Datetime& LastCleaned_value() const { const size_t n = offsetof(Self, LastCleaned); return GetField<Datetime>(n).value; } void LastCleaned_value(const Datetime& x) { const size_t n = offsetof(Self, LastCleaned); GetField<Datetime>(n).Set(x); } bool LastCleaned_exists() const { const size_t n = offsetof(Self, LastCleaned); return GetField<Datetime>(n).exists ? true : false; } void LastCleaned_clear() { const size_t n = offsetof(Self, LastCleaned); GetField<Datetime>(n).Clear(); } // // CIM_MediaAccessDevice_Class.MaxAccessTime // const Field<Uint64>& MaxAccessTime() const { const size_t n = offsetof(Self, MaxAccessTime); return GetField<Uint64>(n); } void MaxAccessTime(const Field<Uint64>& x) { const size_t n = offsetof(Self, MaxAccessTime); GetField<Uint64>(n) = x; } const Uint64& MaxAccessTime_value() const { const size_t n = offsetof(Self, MaxAccessTime); return GetField<Uint64>(n).value; } void MaxAccessTime_value(const Uint64& x) { const size_t n = offsetof(Self, MaxAccessTime); GetField<Uint64>(n).Set(x); } bool MaxAccessTime_exists() const { const size_t n = offsetof(Self, MaxAccessTime); return GetField<Uint64>(n).exists ? true : false; } void MaxAccessTime_clear() { const size_t n = offsetof(Self, MaxAccessTime); GetField<Uint64>(n).Clear(); } // // CIM_MediaAccessDevice_Class.UncompressedDataRate // const Field<Uint32>& UncompressedDataRate() const { const size_t n = offsetof(Self, UncompressedDataRate); return GetField<Uint32>(n); } void UncompressedDataRate(const Field<Uint32>& x) { const size_t n = offsetof(Self, UncompressedDataRate); GetField<Uint32>(n) = x; } const Uint32& UncompressedDataRate_value() const { const size_t n = offsetof(Self, UncompressedDataRate); return GetField<Uint32>(n).value; } void UncompressedDataRate_value(const Uint32& x) { const size_t n = offsetof(Self, UncompressedDataRate); GetField<Uint32>(n).Set(x); } bool UncompressedDataRate_exists() const { const size_t n = offsetof(Self, UncompressedDataRate); return GetField<Uint32>(n).exists ? true : false; } void UncompressedDataRate_clear() { const size_t n = offsetof(Self, UncompressedDataRate); GetField<Uint32>(n).Clear(); } // // CIM_MediaAccessDevice_Class.LoadTime // const Field<Uint64>& LoadTime() const { const size_t n = offsetof(Self, LoadTime); return GetField<Uint64>(n); } void LoadTime(const Field<Uint64>& x) { const size_t n = offsetof(Self, LoadTime); GetField<Uint64>(n) = x; } const Uint64& LoadTime_value() const { const size_t n = offsetof(Self, LoadTime); return GetField<Uint64>(n).value; } void LoadTime_value(const Uint64& x) { const size_t n = offsetof(Self, LoadTime); GetField<Uint64>(n).Set(x); } bool LoadTime_exists() const { const size_t n = offsetof(Self, LoadTime); return GetField<Uint64>(n).exists ? true : false; } void LoadTime_clear() { const size_t n = offsetof(Self, LoadTime); GetField<Uint64>(n).Clear(); } // // CIM_MediaAccessDevice_Class.UnloadTime // const Field<Uint64>& UnloadTime() const { const size_t n = offsetof(Self, UnloadTime); return GetField<Uint64>(n); } void UnloadTime(const Field<Uint64>& x) { const size_t n = offsetof(Self, UnloadTime); GetField<Uint64>(n) = x; } const Uint64& UnloadTime_value() const { const size_t n = offsetof(Self, UnloadTime); return GetField<Uint64>(n).value; } void UnloadTime_value(const Uint64& x) { const size_t n = offsetof(Self, UnloadTime); GetField<Uint64>(n).Set(x); } bool UnloadTime_exists() const { const size_t n = offsetof(Self, UnloadTime); return GetField<Uint64>(n).exists ? true : false; } void UnloadTime_clear() { const size_t n = offsetof(Self, UnloadTime); GetField<Uint64>(n).Clear(); } // // CIM_MediaAccessDevice_Class.MountCount // const Field<Uint64>& MountCount() const { const size_t n = offsetof(Self, MountCount); return GetField<Uint64>(n); } void MountCount(const Field<Uint64>& x) { const size_t n = offsetof(Self, MountCount); GetField<Uint64>(n) = x; } const Uint64& MountCount_value() const { const size_t n = offsetof(Self, MountCount); return GetField<Uint64>(n).value; } void MountCount_value(const Uint64& x) { const size_t n = offsetof(Self, MountCount); GetField<Uint64>(n).Set(x); } bool MountCount_exists() const { const size_t n = offsetof(Self, MountCount); return GetField<Uint64>(n).exists ? true : false; } void MountCount_clear() { const size_t n = offsetof(Self, MountCount); GetField<Uint64>(n).Clear(); } // // CIM_MediaAccessDevice_Class.TimeOfLastMount // const Field<Datetime>& TimeOfLastMount() const { const size_t n = offsetof(Self, TimeOfLastMount); return GetField<Datetime>(n); } void TimeOfLastMount(const Field<Datetime>& x) { const size_t n = offsetof(Self, TimeOfLastMount); GetField<Datetime>(n) = x; } const Datetime& TimeOfLastMount_value() const { const size_t n = offsetof(Self, TimeOfLastMount); return GetField<Datetime>(n).value; } void TimeOfLastMount_value(const Datetime& x) { const size_t n = offsetof(Self, TimeOfLastMount); GetField<Datetime>(n).Set(x); } bool TimeOfLastMount_exists() const { const size_t n = offsetof(Self, TimeOfLastMount); return GetField<Datetime>(n).exists ? true : false; } void TimeOfLastMount_clear() { const size_t n = offsetof(Self, TimeOfLastMount); GetField<Datetime>(n).Clear(); } // // CIM_MediaAccessDevice_Class.TotalMountTime // const Field<Uint64>& TotalMountTime() const { const size_t n = offsetof(Self, TotalMountTime); return GetField<Uint64>(n); } void TotalMountTime(const Field<Uint64>& x) { const size_t n = offsetof(Self, TotalMountTime); GetField<Uint64>(n) = x; } const Uint64& TotalMountTime_value() const { const size_t n = offsetof(Self, TotalMountTime); return GetField<Uint64>(n).value; } void TotalMountTime_value(const Uint64& x) { const size_t n = offsetof(Self, TotalMountTime); GetField<Uint64>(n).Set(x); } bool TotalMountTime_exists() const { const size_t n = offsetof(Self, TotalMountTime); return GetField<Uint64>(n).exists ? true : false; } void TotalMountTime_clear() { const size_t n = offsetof(Self, TotalMountTime); GetField<Uint64>(n).Clear(); } // // CIM_MediaAccessDevice_Class.UnitsDescription // const Field<String>& UnitsDescription() const { const size_t n = offsetof(Self, UnitsDescription); return GetField<String>(n); } void UnitsDescription(const Field<String>& x) { const size_t n = offsetof(Self, UnitsDescription); GetField<String>(n) = x; } const String& UnitsDescription_value() const { const size_t n = offsetof(Self, UnitsDescription); return GetField<String>(n).value; } void UnitsDescription_value(const String& x) { const size_t n = offsetof(Self, UnitsDescription); GetField<String>(n).Set(x); } bool UnitsDescription_exists() const { const size_t n = offsetof(Self, UnitsDescription); return GetField<String>(n).exists ? true : false; } void UnitsDescription_clear() { const size_t n = offsetof(Self, UnitsDescription); GetField<String>(n).Clear(); } // // CIM_MediaAccessDevice_Class.MaxUnitsBeforeCleaning // const Field<Uint64>& MaxUnitsBeforeCleaning() const { const size_t n = offsetof(Self, MaxUnitsBeforeCleaning); return GetField<Uint64>(n); } void MaxUnitsBeforeCleaning(const Field<Uint64>& x) { const size_t n = offsetof(Self, MaxUnitsBeforeCleaning); GetField<Uint64>(n) = x; } const Uint64& MaxUnitsBeforeCleaning_value() const { const size_t n = offsetof(Self, MaxUnitsBeforeCleaning); return GetField<Uint64>(n).value; } void MaxUnitsBeforeCleaning_value(const Uint64& x) { const size_t n = offsetof(Self, MaxUnitsBeforeCleaning); GetField<Uint64>(n).Set(x); } bool MaxUnitsBeforeCleaning_exists() const { const size_t n = offsetof(Self, MaxUnitsBeforeCleaning); return GetField<Uint64>(n).exists ? true : false; } void MaxUnitsBeforeCleaning_clear() { const size_t n = offsetof(Self, MaxUnitsBeforeCleaning); GetField<Uint64>(n).Clear(); } // // CIM_MediaAccessDevice_Class.UnitsUsed // const Field<Uint64>& UnitsUsed() const { const size_t n = offsetof(Self, UnitsUsed); return GetField<Uint64>(n); } void UnitsUsed(const Field<Uint64>& x) { const size_t n = offsetof(Self, UnitsUsed); GetField<Uint64>(n) = x; } const Uint64& UnitsUsed_value() const { const size_t n = offsetof(Self, UnitsUsed); return GetField<Uint64>(n).value; } void UnitsUsed_value(const Uint64& x) { const size_t n = offsetof(Self, UnitsUsed); GetField<Uint64>(n).Set(x); } bool UnitsUsed_exists() const { const size_t n = offsetof(Self, UnitsUsed); return GetField<Uint64>(n).exists ? true : false; } void UnitsUsed_clear() { const size_t n = offsetof(Self, UnitsUsed); GetField<Uint64>(n).Clear(); } }; typedef Array<CIM_MediaAccessDevice_Class> CIM_MediaAccessDevice_ClassA; class CIM_MediaAccessDevice_LockMedia_Class : public Instance { public: typedef CIM_MediaAccessDevice_LockMedia Self; CIM_MediaAccessDevice_LockMedia_Class() : Instance(&CIM_MediaAccessDevice_LockMedia_rtti) { } CIM_MediaAccessDevice_LockMedia_Class( const CIM_MediaAccessDevice_LockMedia* instanceName, bool keysOnly) : Instance( &CIM_MediaAccessDevice_LockMedia_rtti, &instanceName->__instance, keysOnly) { } CIM_MediaAccessDevice_LockMedia_Class( const MI_ClassDecl* clDecl, const MI_Instance* instance, bool keysOnly) : Instance(clDecl, instance, keysOnly) { } CIM_MediaAccessDevice_LockMedia_Class( const MI_ClassDecl* clDecl) : Instance(clDecl) { } CIM_MediaAccessDevice_LockMedia_Class& operator=( const CIM_MediaAccessDevice_LockMedia_Class& x) { CopyRef(x); return *this; } CIM_MediaAccessDevice_LockMedia_Class( const CIM_MediaAccessDevice_LockMedia_Class& x) : Instance(x) { } // // CIM_MediaAccessDevice_LockMedia_Class.MIReturn // const Field<Uint32>& MIReturn() const { const size_t n = offsetof(Self, MIReturn); return GetField<Uint32>(n); } void MIReturn(const Field<Uint32>& x) { const size_t n = offsetof(Self, MIReturn); GetField<Uint32>(n) = x; } const Uint32& MIReturn_value() const { const size_t n = offsetof(Self, MIReturn); return GetField<Uint32>(n).value; } void MIReturn_value(const Uint32& x) { const size_t n = offsetof(Self, MIReturn); GetField<Uint32>(n).Set(x); } bool MIReturn_exists() const { const size_t n = offsetof(Self, MIReturn); return GetField<Uint32>(n).exists ? true : false; } void MIReturn_clear() { const size_t n = offsetof(Self, MIReturn); GetField<Uint32>(n).Clear(); } // // CIM_MediaAccessDevice_LockMedia_Class.Lock // const Field<Boolean>& Lock() const { const size_t n = offsetof(Self, Lock); return GetField<Boolean>(n); } void Lock(const Field<Boolean>& x) { const size_t n = offsetof(Self, Lock); GetField<Boolean>(n) = x; } const Boolean& Lock_value() const { const size_t n = offsetof(Self, Lock); return GetField<Boolean>(n).value; } void Lock_value(const Boolean& x) { const size_t n = offsetof(Self, Lock); GetField<Boolean>(n).Set(x); } bool Lock_exists() const { const size_t n = offsetof(Self, Lock); return GetField<Boolean>(n).exists ? true : false; } void Lock_clear() { const size_t n = offsetof(Self, Lock); GetField<Boolean>(n).Clear(); } }; typedef Array<CIM_MediaAccessDevice_LockMedia_Class> CIM_MediaAccessDevice_LockMedia_ClassA; MI_END_NAMESPACE #endif /* __cplusplus */ #endif /* _CIM_MediaAccessDevice_h */
26.833952
94
0.673039
e8a7f1b4536dd32ebf1ffe39f2cd5f25059c93bb
281
h
C
plugins/src/main.h
IllidanS4/PawnPlus.IO
2f2ff8c2c606cfc235806b3a5785c5cc7135aa84
[ "MIT" ]
4
2019-06-01T23:43:49.000Z
2019-06-28T10:15:41.000Z
plugins/src/main.h
IllidanS4/PawnPlus.IO
2f2ff8c2c606cfc235806b3a5785c5cc7135aa84
[ "MIT" ]
null
null
null
plugins/src/main.h
IllidanS4/PawnPlus.IO
2f2ff8c2c606cfc235806b3a5785c5cc7135aa84
[ "MIT" ]
null
null
null
#ifndef MAIN_H_INCLUDED #define MAIN_H_INCLUDED #include "sdk/amx/amx.h" #include <utility> #define PP_IO_VERSION_STRING "v0.1" #define PP_IO_VERSION_NUMBER 0x010 typedef void(*logprintf_t)(const char* format, ...); extern logprintf_t logprintf; extern bool pp_loaded; #endif
17.5625
52
0.782918
05c5d3826d4deac5deafdbdf4a6764c8173b1289
748
h
C
src/net_ext/rtsp/rtsp_server_info.h
Heng-W/network
49e34a51b19f34b443f7a914b45f47acd146d562
[ "MIT" ]
null
null
null
src/net_ext/rtsp/rtsp_server_info.h
Heng-W/network
49e34a51b19f34b443f7a914b45f47acd146d562
[ "MIT" ]
null
null
null
src/net_ext/rtsp/rtsp_server_info.h
Heng-W/network
49e34a51b19f34b443f7a914b45f47acd146d562
[ "MIT" ]
null
null
null
#ifndef NET_RTSP_SERVER_INFO_H #define NET_RTSP_SERVER_INFO_H #include <string> #include <map> namespace net { class DeviceSource; class Socket; struct RtspServerInfo { void addDeviceSource(const std::string& session, DeviceSource* source) { sources.insert({session, source}); } DeviceSource* findSource(const std::string& session) { auto it = sources.find(session); return it != sources.end() ? it->second : nullptr; } std::map<std::string, DeviceSource*> sources; // for udp std::unique_ptr<Socket> rtpSocket; std::unique_ptr<Socket> rtcpSocket; uint16_t rtpPort; uint16_t rtcpPort; }; } // namespace net #endif // NET_RTSP_SERVER_INFO_H
19.684211
75
0.65508
9f30523854c777aa10cbd58d12ec701e46a888ba
10,987
h
C
Inc/gpio.h
nvl1109/sd-mux
d8839941d7ceabe4a44cc4caf083e2856992fb3e
[ "MIT" ]
null
null
null
Inc/gpio.h
nvl1109/sd-mux
d8839941d7ceabe4a44cc4caf083e2856992fb3e
[ "MIT" ]
null
null
null
Inc/gpio.h
nvl1109/sd-mux
d8839941d7ceabe4a44cc4caf083e2856992fb3e
[ "MIT" ]
null
null
null
/** ****************************************************************************** * File Name : gpio.h * Description : This file contains all the functions prototypes for * the gpio ****************************************************************************** * * Copyright (c) 2016 STMicroelectronics International N.V. * 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. Redistribution 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 STMicroelectronics nor the names of other * contributors to this software may be used to endorse or promote products * derived from this software without specific written permission. * 4. This software, including modifications and/or derivative works of this * software, must execute solely and exclusively on microcontroller or * microprocessor devices manufactured by or for STMicroelectronics. * 5. Redistribution and use of this software other than as permitted under * this license is void and will automatically terminate your rights under * this license. * * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT * SHALL STMICROELECTRONICS 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. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __gpio_H #define __gpio_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "stm32f1xx_hal.h" #include "main.h" /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ /* USER CODE BEGIN Private defines */ // LEDs definitions #define BOARD_LED_1_PORT GPIOA #define BOARD_LED_1_PIN GPIO_PIN_11 #define BOARD_LED_2_PORT GPIOA #define BOARD_LED_2_PIN GPIO_PIN_12 #define LED1_ON() HAL_GPIO_WritePin(BOARD_LED_1_PORT, BOARD_LED_1_PIN, GPIO_PIN_SET) #define LED1_OFF() HAL_GPIO_WritePin(BOARD_LED_1_PORT, BOARD_LED_1_PIN, GPIO_PIN_RESET) #define LED2_ON() HAL_GPIO_WritePin(BOARD_LED_2_PORT, BOARD_LED_2_PIN, GPIO_PIN_SET) #define LED2_OFF() HAL_GPIO_WritePin(BOARD_LED_2_PORT, BOARD_LED_2_PIN, GPIO_PIN_RESET) // EXT interrupt button definitions typedef enum { BTN_INT_JB_1 = GPIO_PIN_0, BTN_INT_JB_2 = GPIO_PIN_15, BTN_INT_JB_3 = GPIO_PIN_14, BTN_INT_JB_4 = GPIO_PIN_13, BTN_INT_I2C_INT = GPIO_PIN_6, BTN_INT_POW = GPIO_PIN_9, BTN_INT_SDCARD = GPIO_PIN_8, } button_int_number_t; //// Output GPIO control pins definitions // Power control pin #define BOARD_POW_CTRL_PORT GPIOA #define BOARD_POW_CTRL_PIN GPIO_PIN_8 #define POW_CTRL_OFF() HAL_GPIO_WritePin(BOARD_POW_CTRL_PORT, BOARD_POW_CTRL_PIN, GPIO_PIN_SET) #define POW_CTRL_ON() HAL_GPIO_WritePin(BOARD_POW_CTRL_PORT, BOARD_POW_CTRL_PIN, GPIO_PIN_RESET) // SD-Card switch pin #define BOARD_CARD_SWITCH_PORT GPIOB #define BOARD_CARD_SWITCH_PIN GPIO_PIN_14 #define CARD_SWITCH_ON() HAL_GPIO_WritePin(BOARD_CARD_SWITCH_PORT, BOARD_CARD_SWITCH_PIN, GPIO_PIN_SET) #define CARD_SWITCH_OFF() HAL_GPIO_WritePin(BOARD_CARD_SWITCH_PORT, BOARD_CARD_SWITCH_PIN, GPIO_PIN_RESET) // SD-Card reset pin #define BOARD_CARD_RESET_PORT GPIOB #define BOARD_CARD_RESET_PIN GPIO_PIN_15 #define CARD_RESET_ON() HAL_GPIO_WritePin(BOARD_CARD_RESET_PORT, BOARD_CARD_RESET_PIN, GPIO_PIN_SET) #define CARD_RESET_OFF() HAL_GPIO_WritePin(BOARD_CARD_RESET_PORT, BOARD_CARD_RESET_PIN, GPIO_PIN_RESET) // External control 1 pin #define BOARD_EXT_CTRL_1_PORT GPIOB #define BOARD_EXT_CTRL_1_PIN GPIO_PIN_5 #define EXT_CTRL_1_ON() HAL_GPIO_WritePin(BOARD_EXT_CTRL_1_PORT, BOARD_EXT_CTRL_1_PIN, GPIO_PIN_SET) #define EXT_CTRL_1_OFF() HAL_GPIO_WritePin(BOARD_EXT_CTRL_1_PORT, BOARD_EXT_CTRL_1_PIN, GPIO_PIN_RESET) // External control 1 pin #define BOARD_EXT_CTRL_2_PORT GPIOB #define BOARD_EXT_CTRL_2_PIN GPIO_PIN_4 #define EXT_CTRL_2_ON() HAL_GPIO_WritePin(BOARD_EXT_CTRL_2_PORT, BOARD_EXT_CTRL_2_PIN, GPIO_PIN_SET) #define EXT_CTRL_2_OFF() HAL_GPIO_WritePin(BOARD_EXT_CTRL_2_PORT, BOARD_EXT_CTRL_2_PIN, GPIO_PIN_RESET) // External control 1 pin #define BOARD_EXT_CTRL_3_PORT GPIOB #define BOARD_EXT_CTRL_3_PIN GPIO_PIN_3 #define EXT_CTRL_3_ON() HAL_GPIO_WritePin(BOARD_EXT_CTRL_3_PORT, BOARD_EXT_CTRL_3_PIN, GPIO_PIN_SET) #define EXT_CTRL_3_OFF() HAL_GPIO_WritePin(BOARD_EXT_CTRL_3_PORT, BOARD_EXT_CTRL_3_PIN, GPIO_PIN_RESET) // External control 1 pin #define BOARD_EXT_CTRL_4_PORT GPIOA #define BOARD_EXT_CTRL_4_PIN GPIO_PIN_15 #define EXT_CTRL_4_ON() HAL_GPIO_WritePin(BOARD_EXT_CTRL_4_PORT, BOARD_EXT_CTRL_4_PIN, GPIO_PIN_SET) #define EXT_CTRL_4_OFF() HAL_GPIO_WritePin(BOARD_EXT_CTRL_4_PORT, BOARD_EXT_CTRL_4_PIN, GPIO_PIN_RESET) /// Jumper switch // Jumper 1 #define BOARD_JCTRL_1_1_PORT GPIOA #define BOARD_JCTRL_1_1_PIN GPIO_PIN_7 #define JCTRL_1_1_DIS() HAL_GPIO_WritePin(BOARD_JCTRL_1_1_PORT, BOARD_JCTRL_1_1_PIN, GPIO_PIN_SET) #define JCTRL_1_1_CON() HAL_GPIO_WritePin(BOARD_JCTRL_1_1_PORT, BOARD_JCTRL_1_1_PIN, GPIO_PIN_RESET) #define BOARD_JCTRL_1_2_PORT GPIOB #define BOARD_JCTRL_1_2_PIN GPIO_PIN_0 #define JCTRL_1_2_DIS() HAL_GPIO_WritePin(BOARD_JCTRL_1_2_PORT, BOARD_JCTRL_1_2_PIN, GPIO_PIN_SET) #define JCTRL_1_2_CON() HAL_GPIO_WritePin(BOARD_JCTRL_1_2_PORT, BOARD_JCTRL_1_2_PIN, GPIO_PIN_RESET) #define JCTRL_1_TO_1() JCTRL_1_1_DIS();JCTRL_1_2_CON() #define JCTRL_1_TO_3() JCTRL_1_1_CON();JCTRL_1_2_DIS() #define JCTRL_1_TO_BOTH() JCTRL_1_1_CON();JCTRL_1_2_CON() #define JCTRL_1_TO_NONE() JCTRL_1_1_DIS();JCTRL_1_2_DIS() // Jumper 2 #define BOARD_JCTRL_2_1_PORT GPIOA #define BOARD_JCTRL_2_1_PIN GPIO_PIN_5 #define JCTRL_2_1_DIS() HAL_GPIO_WritePin(BOARD_JCTRL_2_1_PORT, BOARD_JCTRL_2_1_PIN, GPIO_PIN_SET) #define JCTRL_2_1_CON() HAL_GPIO_WritePin(BOARD_JCTRL_2_1_PORT, BOARD_JCTRL_2_1_PIN, GPIO_PIN_RESET) #define BOARD_JCTRL_2_2_PORT GPIOA #define BOARD_JCTRL_2_2_PIN GPIO_PIN_6 #define JCTRL_2_2_DIS() HAL_GPIO_WritePin(BOARD_JCTRL_2_2_PORT, BOARD_JCTRL_2_2_PIN, GPIO_PIN_SET) #define JCTRL_2_2_CON() HAL_GPIO_WritePin(BOARD_JCTRL_2_2_PORT, BOARD_JCTRL_2_2_PIN, GPIO_PIN_RESET) #define JCTRL_2_TO_1() JCTRL_2_1_DIS();JCTRL_2_2_CON() #define JCTRL_2_TO_3() JCTRL_2_1_CON();JCTRL_2_2_DIS() #define JCTRL_2_TO_BOTH() JCTRL_2_1_CON();JCTRL_2_2_CON() #define JCTRL_2_TO_NONE() JCTRL_2_1_DIS();JCTRL_2_2_DIS() // Jumper 3 #define BOARD_JCTRL_3_1_PORT GPIOA #define BOARD_JCTRL_3_1_PIN GPIO_PIN_3 #define JCTRL_3_1_DIS() HAL_GPIO_WritePin(BOARD_JCTRL_3_1_PORT, BOARD_JCTRL_3_1_PIN, GPIO_PIN_SET) #define JCTRL_3_1_CON() HAL_GPIO_WritePin(BOARD_JCTRL_3_1_PORT, BOARD_JCTRL_3_1_PIN, GPIO_PIN_RESET) #define BOARD_JCTRL_3_2_PORT GPIOA #define BOARD_JCTRL_3_2_PIN GPIO_PIN_4 #define JCTRL_3_2_DIS() HAL_GPIO_WritePin(BOARD_JCTRL_3_2_PORT, BOARD_JCTRL_3_2_PIN, GPIO_PIN_SET) #define JCTRL_3_2_CON() HAL_GPIO_WritePin(BOARD_JCTRL_3_2_PORT, BOARD_JCTRL_3_2_PIN, GPIO_PIN_RESET) #define JCTRL_3_TO_1() JCTRL_3_1_DIS();JCTRL_3_2_CON() #define JCTRL_3_TO_3() JCTRL_3_1_CON();JCTRL_3_2_DIS() #define JCTRL_3_TO_BOTH() JCTRL_3_1_CON();JCTRL_3_2_CON() #define JCTRL_3_TO_NONE() JCTRL_3_1_DIS();JCTRL_3_2_DIS() // Jumper 4 #define BOARD_JCTRL_4_1_PORT GPIOA #define BOARD_JCTRL_4_1_PIN GPIO_PIN_1 #define JCTRL_4_1_DIS() HAL_GPIO_WritePin(BOARD_JCTRL_4_1_PORT, BOARD_JCTRL_4_1_PIN, GPIO_PIN_SET) #define JCTRL_4_1_CON() HAL_GPIO_WritePin(BOARD_JCTRL_4_1_PORT, BOARD_JCTRL_4_1_PIN, GPIO_PIN_RESET) #define BOARD_JCTRL_4_2_PORT GPIOA #define BOARD_JCTRL_4_2_PIN GPIO_PIN_2 #define JCTRL_4_2_DIS() HAL_GPIO_WritePin(BOARD_JCTRL_4_2_PORT, BOARD_JCTRL_4_2_PIN, GPIO_PIN_SET) #define JCTRL_4_2_CON() HAL_GPIO_WritePin(BOARD_JCTRL_4_2_PORT, BOARD_JCTRL_4_2_PIN, GPIO_PIN_RESET) #define JCTRL_4_TO_1() JCTRL_4_1_DIS();JCTRL_4_2_CON() #define JCTRL_4_TO_3() JCTRL_4_1_CON();JCTRL_4_2_DIS() #define JCTRL_4_TO_BOTH() JCTRL_4_1_CON();JCTRL_4_2_CON() #define JCTRL_4_TO_NONE() JCTRL_4_1_DIS();JCTRL_4_2_DIS() struct jumper_setting { GPIO_TypeDef* port1; uint16_t pin1; GPIO_TypeDef* port2; uint16_t pin2; }; typedef enum { JUMPER_CHANNEL_1 = 0, JUMPER_CHANNEL_2, JUMPER_CHANNEL_3, JUMPER_CHANNEL_4, JUMPER_CHANNEL_MAX, } jumper_channel_t; #define JCTRL_ARRAY { \ {BOARD_JCTRL_1_1_PORT, BOARD_JCTRL_1_1_PIN, BOARD_JCTRL_1_2_PORT, BOARD_JCTRL_1_2_PIN}, \ {BOARD_JCTRL_2_1_PORT, BOARD_JCTRL_2_1_PIN, BOARD_JCTRL_2_2_PORT, BOARD_JCTRL_2_2_PIN}, \ {BOARD_JCTRL_3_1_PORT, BOARD_JCTRL_3_1_PIN, BOARD_JCTRL_3_2_PORT, BOARD_JCTRL_3_2_PIN}, \ {BOARD_JCTRL_4_1_PORT, BOARD_JCTRL_4_1_PIN, BOARD_JCTRL_4_2_PORT, BOARD_JCTRL_4_2_PIN}, \ } // Input jumper definitions #define BOARD_I2C_CONF_PORT GPIOB #define BOARD_I2C_CONF_PIN GPIO_PIN_7 #define GET_I2C_CONF() HAL_GPIO_ReadPin(BOARD_I2C_CONF_PORT,BOARD_I2C_CONF_PIN) /* USER CODE END Private defines */ void MX_GPIO_Init(void); /* USER CODE BEGIN Prototypes */ /* USER CODE END Prototypes */ #ifdef __cplusplus } #endif #endif /*__ pinoutConfig_H */ /** * @} */ /** * @} */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
49.269058
113
0.728588
c34566b510eb0642fc4d44305495c767091b0bfb
1,531
h
C
common/common.h
LithiumSR/so_game_multiplayer
6a7fe51d8240c0ec989f4aa760c43b3dee80236e
[ "MIT" ]
null
null
null
common/common.h
LithiumSR/so_game_multiplayer
6a7fe51d8240c0ec989f4aa760c43b3dee80236e
[ "MIT" ]
null
null
null
common/common.h
LithiumSR/so_game_multiplayer
6a7fe51d8240c0ec989f4aa760c43b3dee80236e
[ "MIT" ]
null
null
null
#ifndef COMMON_H #define COMMON_H #include <stdio.h> #include "errno.h" // macro to simplify error handling #define GENERIC_ERROR_HELPER(cond, errCode, msg) \ do { \ if (cond) { \ fprintf(stderr, "%s: %s\n", msg, strerror(errCode)); \ exit(EXIT_FAILURE); \ } \ } while (0) #define ERROR_HELPER(ret, msg) GENERIC_ERROR_HELPER((ret < 0), errno, msg) #define PTHREAD_ERROR_HELPER(ret, msg) \ GENERIC_ERROR_HELPER((ret != 0), ret, msg) /** #define debug_printf(fmt, ...) \ do { if (DEBUG) fprintf(stderr, fmt, __VA_ARGS__); } while (0) **/ #define debug_print(fmt, ...) \ do { \ if (DEBUG) fprintf(stderr, fmt, ##__VA_ARGS__); \ } while (0) /* Configuration parameters */ #define SERVER_ADDRESS "127.0.0.1" #define USE_VEHICLE_SEMAPHORE 0 // Don't tinker with that #define WORLDSIZE 512 #define USERNAME_LEN 32 #define TEXT_LEN 256 #define DEBUG 0 #define SINGLEPLAYER 0 #define BUFFERSIZE 1000000 #define CLIENT_AUDIO 1 #define BACKGROUND_TRACK 1 #define LOOP_BACKGROUND_TRACK 1 #define HIDE_RANGE 3 #define AFK_RANGE 1 #define MAX_AFK_COUNTER 20 #define CACHE_TEXTURE 1 #define SERVER_SIDE_POSITION_CHECK 1 #define COLLISION_RANGE 0.5 #define MAX_TIME_WITHOUT_VEHICLEUPDATE 10 #define MAX_TIME_WITHOUT_WORLDUPDATE 10 #endif
30.62
74
0.596995
c94d83a5778adc38609ba36ece8ac969e88ac746
986
c
C
lib/ft_printf/src/parse/print_type.c
mlantonn/malloc
1df99c79f77a3f29806e2ed62a110111ff00688c
[ "MIT" ]
null
null
null
lib/ft_printf/src/parse/print_type.c
mlantonn/malloc
1df99c79f77a3f29806e2ed62a110111ff00688c
[ "MIT" ]
null
null
null
lib/ft_printf/src/parse/print_type.c
mlantonn/malloc
1df99c79f77a3f29806e2ed62a110111ff00688c
[ "MIT" ]
null
null
null
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* print_type.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: mlantonn <mlantonn@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/05/17 11:55:58 by mlantonn #+# #+# */ /* Updated: 2019/05/17 11:58:44 by mlantonn ### ########.fr */ /* */ /* ************************************************************************** */ #include "conv.h" void print_type(t_param *param) { add_char_to_buff(param, param->type); }
51.894737
80
0.174442
c7354748bfadce1de1db5ac6104773eccfb7bf39
118
h
C
src/syslog/LOG_MAIL.h
ung-org/lib-c
55fc64c7ffd7792bc88451a736c2e94e5865282f
[ "MIT" ]
null
null
null
src/syslog/LOG_MAIL.h
ung-org/lib-c
55fc64c7ffd7792bc88451a736c2e94e5865282f
[ "MIT" ]
null
null
null
src/syslog/LOG_MAIL.h
ung-org/lib-c
55fc64c7ffd7792bc88451a736c2e94e5865282f
[ "MIT" ]
null
null
null
#include <syslog.h> #define LOG_MAIL 2 /* XOPEN(400) */
19.666667
80
0.313559