max_stars_repo_path
stringlengths
3
199
max_stars_repo_name
stringlengths
6
90
max_stars_count
float64
0
118k
id
stringlengths
3
7
content
stringlengths
14
1,000k
score
float64
0.34
1
label
stringclasses
3 values
bootstrap/include/$LPpanda$core$Int64$Cpanda$io$File$RP.h
ethannicholas/panda-old
0
7198401
// This file was automatically generated by the Panda compiler #ifndef $LPpanda$core$Int64$Cpanda$io$File$RP_H #define $LPpanda$core$Int64$Cpanda$io$File$RP_H extern panda$core$Class $LPpanda$core$Int64$Cpanda$io$File$RP_class; #ifndef CLASS_$LPpanda$core$Int64$Cpanda$io$File$RP #define CLASS_$LPpanda$core$Int64$Cpanda$io$File$RP struct $LPpanda$core$Int64$Cpanda$io$File$RP { panda$core$Class* cl; Int64 $field0; panda$io$File* $field1; }; #define $LPpanda$core$Int64$Cpanda$io$File$RP$convert_$Rpanda$core$String_INDEX 1 typedef panda$core$String*($LPpanda$core$Int64$Cpanda$io$File$RP$convert_$Rpanda$core$String_TYPE)($LPpanda$core$Int64$Cpanda$io$File$RP* self); #define $LPpanda$core$Int64$Cpanda$io$File$RP$$EQ_panda$core$Object_$Rpanda$core$Bit_INDEX 2 typedef Bit($LPpanda$core$Int64$Cpanda$io$File$RP$$EQ_panda$core$Object_$Rpanda$core$Bit_TYPE)($LPpanda$core$Int64$Cpanda$io$File$RP* self, panda$core$Object*); #define $LPpanda$core$Int64$Cpanda$io$File$RP$get_hash_$Rpanda$core$Int64_INDEX 3 typedef Int64($LPpanda$core$Int64$Cpanda$io$File$RP$get_hash_$Rpanda$core$Int64_TYPE)($LPpanda$core$Int64$Cpanda$io$File$RP* self); #define $LPpanda$core$Int64$Cpanda$io$File$RP$$ARR_Int32_$Rpanda$core$Immutable_INDEX 4 typedef panda$core$Immutable*($LPpanda$core$Int64$Cpanda$io$File$RP$$ARR_Int32_$Rpanda$core$Immutable_TYPE)($LPpanda$core$Int64$Cpanda$io$File$RP* self, Int32); void $LPpanda$core$Int64$Cpanda$io$File$RP$init_Int64_panda$io$File($LPpanda$core$Int64$Cpanda$io$File$RP* self, Int64, panda$io$File*); $LPpanda$core$Int64$Cpanda$io$File$RP* new_$LPpanda$core$Int64$Cpanda$io$File$RP$init_Int64_panda$io$File(Int64, panda$io$File*); panda$core$String* $LPpanda$core$Int64$Cpanda$io$File$RP$convert_$Rpanda$core$String($LPpanda$core$Int64$Cpanda$io$File$RP* self); Bit $LPpanda$core$Int64$Cpanda$io$File$RP$$EQ_panda$core$Object_$Rpanda$core$Bit($LPpanda$core$Int64$Cpanda$io$File$RP* self, panda$core$Object*); Int64 $LPpanda$core$Int64$Cpanda$io$File$RP$get_hash_$Rpanda$core$Int64($LPpanda$core$Int64$Cpanda$io$File$RP* self); panda$core$Immutable* $LPpanda$core$Int64$Cpanda$io$File$RP$$ARR_Int32_$Rpanda$core$Immutable($LPpanda$core$Int64$Cpanda$io$File$RP* self, Int32); #endif #endif
0.933594
high
TP1043_01_A/Monitoring/config/crosstable.h
trigrass2/mect_apps
2
7198913
<reponame>trigrass2/mect_apps /* File automatically generated by the Crosstable compiler */ /* from the Crosstable file config/Crosstable.csv. */ /* BIT -> int */ /* BYTE_BIT -> int */ /* WORD_BIT -> int */ /* DWORD_BIT -> int */ /* BYTE -> u_int8_t */ /* UINT -> u_int16_t */ /* UINTBA -> UINTBA */ /* INT -> int16_t */ /* INTBA -> INTBA */ /* UDINT -> u_int32_t */ /* UDINTBADC -> UDINTBADC */ /* UDINTCDAB -> UDINTCDAB */ /* UDINTDCBA -> UDINTDCBA */ /* DINT -> int32_t */ /* DINTBADC -> DINTBADC */ /* DINTCDAB -> DINTCDAB */ /* DINTDCBA -> DINTDCBA */ /* REAL -> float */ /* REALBADC -> REALBADC */ /* REALCDAB -> REALCDAB */ /* REALDCBA -> REALDCBA */ #ifndef CROSSTABLE_H__ #define CROSSTABLE_H__ #ifdef __cplusplus extern "C" { #endif #include <sys/types.h> #include "cross_table_utility.h" #define ID_Pmax 1 extern u_int16_t Pmax; /* PRMS phase 1 (max) */ int doWrite_Pmax(u_int16_t value); int addWrite_Pmax(u_int16_t value); int getStatus_Pmax(void); #define ID_EM_Firmware 194 extern u_int16_t EM_Firmware; /* Firmware-Version */ int doWrite_EM_Firmware(u_int16_t value); int addWrite_EM_Firmware(u_int16_t value); int getStatus_EM_Firmware(void); #define ID_Status 196 extern u_int16_t Status; /* Status */ int doWrite_Status(u_int16_t value); int addWrite_Status(u_int16_t value); int getStatus_Status(void); #define ID_Timeout 197 extern u_int16_t Timeout; /* Timeout Modbus */ int doWrite_Timeout(u_int16_t value); int addWrite_Timeout(u_int16_t value); int getStatus_Timeout(void); #define ID_Indirizzo 198 extern u_int16_t Indirizzo; /* Indirizzo Modbus */ int doWrite_Indirizzo(u_int16_t value); int addWrite_Indirizzo(u_int16_t value); int getStatus_Indirizzo(void); #define ID_Errore 199 extern u_int16_t Errore; /* Errore Registro */ int doWrite_Errore(u_int16_t value); int addWrite_Errore(u_int16_t value); int getStatus_Errore(void); #define ID_unused_25 200 extern u_int16_t unused_25; int doWrite_unused_25(u_int16_t value); int addWrite_unused_25(u_int16_t value); int getStatus_unused_25(void); #define ID_unused_26 201 extern u_int16_t unused_26; int doWrite_unused_26(u_int16_t value); int addWrite_unused_26(u_int16_t value); int getStatus_unused_26(void); #define ID_Ttotal 202 extern u_int32_t Ttotal; /* WT1 totale Contatore energia Totale Tariffa 1 */ int doWrite_Ttotal(u_int32_t value); int addWrite_Ttotal(u_int32_t value); int getStatus_Ttotal(void); #define ID_Tpart 203 extern u_int32_t Tpart; /* WT1 parziale Contatore energia Parziale Tariffa 1 */ int doWrite_Tpart(u_int32_t value); int addWrite_Tpart(u_int32_t value); int getStatus_Tpart(void); #define ID_unused_31 204 extern u_int16_t unused_31; int doWrite_unused_31(u_int16_t value); int addWrite_unused_31(u_int16_t value); int getStatus_unused_31(void); #define ID_unused_32 205 extern u_int16_t unused_32; int doWrite_unused_32(u_int16_t value); int addWrite_unused_32(u_int16_t value); int getStatus_unused_32(void); #define ID_unused_33 206 extern u_int16_t unused_33; int doWrite_unused_33(u_int16_t value); int addWrite_unused_33(u_int16_t value); int getStatus_unused_33(void); #define ID_unused_34 207 extern u_int16_t unused_34; int doWrite_unused_34(u_int16_t value); int addWrite_unused_34(u_int16_t value); int getStatus_unused_34(void); #define ID_U 208 extern u_int16_t U; /* URMS phase 1 */ int doWrite_U(u_int16_t value); int addWrite_U(u_int16_t value); int getStatus_U(void); #define ID_I 209 extern u_int16_t I; /* IRMS phase 1 */ int doWrite_I(u_int16_t value); int addWrite_I(u_int16_t value); int getStatus_I(void); #define ID_P 210 extern u_int16_t P; /* PRMS phase 1 */ int doWrite_P(u_int16_t value); int addWrite_P(u_int16_t value); int getStatus_P(void); #define ID_Q 211 extern int16_t Q; /* QRMS phase 1 */ int doWrite_Q(int16_t value); int addWrite_Q(int16_t value); int getStatus_Q(void); #define ID_C 212 extern int16_t C; /* cos phi phase 1 */ int doWrite_C(int16_t value); int addWrite_C(int16_t value); int getStatus_C(void); #define ID_TCP_U 1001 extern u_int16_t TCP_U; /* URMS phase 1 */ int doWrite_TCP_U(u_int16_t value); int addWrite_TCP_U(u_int16_t value); int getStatus_TCP_U(void); #define ID_TCP_I 1002 extern u_int16_t TCP_I; /* IRMS phase 1 */ int doWrite_TCP_I(u_int16_t value); int addWrite_TCP_I(u_int16_t value); int getStatus_TCP_I(void); #define ID_TCP_P 1003 extern u_int16_t TCP_P; /* PRMS phase 1 */ int doWrite_TCP_P(u_int16_t value); int addWrite_TCP_P(u_int16_t value); int getStatus_TCP_P(void); #define ID_TCP_Q 1004 extern int16_t TCP_Q; /* QRMS phase 1 */ int doWrite_TCP_Q(int16_t value); int addWrite_TCP_Q(int16_t value); int getStatus_TCP_Q(void); #define ID_TCP_C 1005 extern int16_t TCP_C; /* cos phi phase 1 */ int doWrite_TCP_C(int16_t value); int addWrite_TCP_C(int16_t value); int getStatus_TCP_C(void); #define ID_TCP_Pmax 1006 extern u_int16_t TCP_Pmax; /* PRMS phase 1 (max) */ int doWrite_TCP_Pmax(u_int16_t value); int addWrite_TCP_Pmax(u_int16_t value); int getStatus_TCP_Pmax(void); #define ID_TCP_Ttotal 1007 extern u_int32_t TCP_Ttotal; /* WT1 totale Contatore energia Totale Tariffa 1 */ int doWrite_TCP_Ttotal(u_int32_t value); int addWrite_TCP_Ttotal(u_int32_t value); int getStatus_TCP_Ttotal(void); #define ID_TCP_Tpart 1008 extern u_int32_t TCP_Tpart; /* WT1 parziale Contatore energia Parziale Tariffa 1 */ int doWrite_TCP_Tpart(u_int32_t value); int addWrite_TCP_Tpart(u_int32_t value); int getStatus_TCP_Tpart(void); #define ID_TCP_UPTIME_s 1009 extern u_int32_t TCP_UPTIME_s; int doWrite_TCP_UPTIME_s(u_int32_t value); int addWrite_TCP_UPTIME_s(u_int32_t value); int getStatus_TCP_UPTIME_s(void); #define ID_TCP_HH_MM 1010 extern u_int16_t TCP_HH_MM; int doWrite_TCP_HH_MM(u_int16_t value); int addWrite_TCP_HH_MM(u_int16_t value); int getStatus_TCP_HH_MM(void); #define ID_SRV_EP_heartbeat 2000 extern u_int16_t SRV_EP_heartbeat; /* TCPS_STATUS NODE_09_STATUS */ int doWrite_SRV_EP_heartbeat(u_int16_t value); int addWrite_SRV_EP_heartbeat(u_int16_t value); int getStatus_SRV_EP_heartbeat(void); #define ID_SRV_EP_enabled_wattmeters 2001 extern u_int16_t SRV_EP_enabled_wattmeters; /* 0 .. 12 */ int doWrite_SRV_EP_enabled_wattmeters(u_int16_t value); int addWrite_SRV_EP_enabled_wattmeters(u_int16_t value); int getStatus_SRV_EP_enabled_wattmeters(void); #define ID_SRV_EP_wattmeter01_U 2002 extern int16_t SRV_EP_wattmeter01_U; /* xxx.xx V */ int doWrite_SRV_EP_wattmeter01_U(int16_t value); int addWrite_SRV_EP_wattmeter01_U(int16_t value); int getStatus_SRV_EP_wattmeter01_U(void); #define ID_SRV_EP_wattmeter01_C 2003 extern int16_t SRV_EP_wattmeter01_C; /* +/- x.xxx */ int doWrite_SRV_EP_wattmeter01_C(int16_t value); int addWrite_SRV_EP_wattmeter01_C(int16_t value); int getStatus_SRV_EP_wattmeter01_C(void); #define ID_SRV_EP_wattmeter01_Texp 2004 extern u_int32_t SRV_EP_wattmeter01_Texp; /* xxxxxxxxx.x kWh */ int doWrite_SRV_EP_wattmeter01_Texp(u_int32_t value); int addWrite_SRV_EP_wattmeter01_Texp(u_int32_t value); int getStatus_SRV_EP_wattmeter01_Texp(void); #define ID_SRV_EP_wattmeter01_P 2005 extern int16_t SRV_EP_wattmeter01_P; /* +/- xxxx W */ int doWrite_SRV_EP_wattmeter01_P(int16_t value); int addWrite_SRV_EP_wattmeter01_P(int16_t value); int getStatus_SRV_EP_wattmeter01_P(void); #define ID_SRV_EP_wattmeter01_Pmax 2006 extern int16_t SRV_EP_wattmeter01_Pmax; /* +/- xxxx W */ int doWrite_SRV_EP_wattmeter01_Pmax(int16_t value); int addWrite_SRV_EP_wattmeter01_Pmax(int16_t value); int getStatus_SRV_EP_wattmeter01_Pmax(void); #define ID_SRV_EP_wattmeter01_T 2007 extern u_int32_t SRV_EP_wattmeter01_T; /* xxxxxxxxx.x kWh */ int doWrite_SRV_EP_wattmeter01_T(u_int32_t value); int addWrite_SRV_EP_wattmeter01_T(u_int32_t value); int getStatus_SRV_EP_wattmeter01_T(void); #define ID_SRV_EP_wattmeter02_P 2008 extern int16_t SRV_EP_wattmeter02_P; /* +/- xxxx W */ int doWrite_SRV_EP_wattmeter02_P(int16_t value); int addWrite_SRV_EP_wattmeter02_P(int16_t value); int getStatus_SRV_EP_wattmeter02_P(void); #define ID_SRV_EP_wattmeter02_Pmax 2009 extern int16_t SRV_EP_wattmeter02_Pmax; /* +/- xxxx W */ int doWrite_SRV_EP_wattmeter02_Pmax(int16_t value); int addWrite_SRV_EP_wattmeter02_Pmax(int16_t value); int getStatus_SRV_EP_wattmeter02_Pmax(void); #define ID_SRV_EP_wattmeter02_T 2010 extern u_int32_t SRV_EP_wattmeter02_T; /* xxxxxxxxx.x kWh */ int doWrite_SRV_EP_wattmeter02_T(u_int32_t value); int addWrite_SRV_EP_wattmeter02_T(u_int32_t value); int getStatus_SRV_EP_wattmeter02_T(void); #define ID_SRV_EP_wattmeter03_P 2011 extern int16_t SRV_EP_wattmeter03_P; /* +/- xxxx W */ int doWrite_SRV_EP_wattmeter03_P(int16_t value); int addWrite_SRV_EP_wattmeter03_P(int16_t value); int getStatus_SRV_EP_wattmeter03_P(void); #define ID_SRV_EP_wattmeter03_Pmax 2012 extern int16_t SRV_EP_wattmeter03_Pmax; /* +/- xxxx W */ int doWrite_SRV_EP_wattmeter03_Pmax(int16_t value); int addWrite_SRV_EP_wattmeter03_Pmax(int16_t value); int getStatus_SRV_EP_wattmeter03_Pmax(void); #define ID_SRV_EP_wattmeter03_T 2013 extern u_int32_t SRV_EP_wattmeter03_T; /* xxxxxxxxx.x kWh */ int doWrite_SRV_EP_wattmeter03_T(u_int32_t value); int addWrite_SRV_EP_wattmeter03_T(u_int32_t value); int getStatus_SRV_EP_wattmeter03_T(void); #define ID_SRV_EP_wattmeter04_P 2014 extern int16_t SRV_EP_wattmeter04_P; /* +/- xxxx W */ int doWrite_SRV_EP_wattmeter04_P(int16_t value); int addWrite_SRV_EP_wattmeter04_P(int16_t value); int getStatus_SRV_EP_wattmeter04_P(void); #define ID_SRV_EP_wattmeter04_Pmax 2015 extern int16_t SRV_EP_wattmeter04_Pmax; /* +/- xxxx W */ int doWrite_SRV_EP_wattmeter04_Pmax(int16_t value); int addWrite_SRV_EP_wattmeter04_Pmax(int16_t value); int getStatus_SRV_EP_wattmeter04_Pmax(void); #define ID_SRV_EP_wattmeter04_T 2016 extern u_int32_t SRV_EP_wattmeter04_T; /* xxxxxxxxx.x kWh */ int doWrite_SRV_EP_wattmeter04_T(u_int32_t value); int addWrite_SRV_EP_wattmeter04_T(u_int32_t value); int getStatus_SRV_EP_wattmeter04_T(void); #define ID_SRV_EP_wattmeter05_P 2017 extern int16_t SRV_EP_wattmeter05_P; /* +/- xxxx W */ int doWrite_SRV_EP_wattmeter05_P(int16_t value); int addWrite_SRV_EP_wattmeter05_P(int16_t value); int getStatus_SRV_EP_wattmeter05_P(void); #define ID_SRV_EP_wattmeter05_Pmax 2018 extern int16_t SRV_EP_wattmeter05_Pmax; /* +/- xxxx W */ int doWrite_SRV_EP_wattmeter05_Pmax(int16_t value); int addWrite_SRV_EP_wattmeter05_Pmax(int16_t value); int getStatus_SRV_EP_wattmeter05_Pmax(void); #define ID_SRV_EP_wattmeter05_T 2019 extern u_int32_t SRV_EP_wattmeter05_T; /* xxxxxxxxx.x kWh */ int doWrite_SRV_EP_wattmeter05_T(u_int32_t value); int addWrite_SRV_EP_wattmeter05_T(u_int32_t value); int getStatus_SRV_EP_wattmeter05_T(void); #define ID_SRV_EP_wattmeter06_P 2020 extern int16_t SRV_EP_wattmeter06_P; /* +/- xxxx W */ int doWrite_SRV_EP_wattmeter06_P(int16_t value); int addWrite_SRV_EP_wattmeter06_P(int16_t value); int getStatus_SRV_EP_wattmeter06_P(void); #define ID_SRV_EP_wattmeter06_Pmax 2021 extern int16_t SRV_EP_wattmeter06_Pmax; /* +/- xxxx W */ int doWrite_SRV_EP_wattmeter06_Pmax(int16_t value); int addWrite_SRV_EP_wattmeter06_Pmax(int16_t value); int getStatus_SRV_EP_wattmeter06_Pmax(void); #define ID_SRV_EP_wattmeter06_T 2022 extern u_int32_t SRV_EP_wattmeter06_T; /* xxxxxxxxx.x kWh */ int doWrite_SRV_EP_wattmeter06_T(u_int32_t value); int addWrite_SRV_EP_wattmeter06_T(u_int32_t value); int getStatus_SRV_EP_wattmeter06_T(void); #define ID_SRV_EP_wattmeter07_P 2023 extern int16_t SRV_EP_wattmeter07_P; /* +/- xxxx W */ int doWrite_SRV_EP_wattmeter07_P(int16_t value); int addWrite_SRV_EP_wattmeter07_P(int16_t value); int getStatus_SRV_EP_wattmeter07_P(void); #define ID_SRV_EP_wattmeter07_Pmax 2024 extern int16_t SRV_EP_wattmeter07_Pmax; /* +/- xxxx W */ int doWrite_SRV_EP_wattmeter07_Pmax(int16_t value); int addWrite_SRV_EP_wattmeter07_Pmax(int16_t value); int getStatus_SRV_EP_wattmeter07_Pmax(void); #define ID_SRV_EP_wattmeter07_T 2025 extern u_int32_t SRV_EP_wattmeter07_T; /* xxxxxxxxx.x kWh */ int doWrite_SRV_EP_wattmeter07_T(u_int32_t value); int addWrite_SRV_EP_wattmeter07_T(u_int32_t value); int getStatus_SRV_EP_wattmeter07_T(void); #define ID_SRV_EP_wattmeter08_P 2026 extern int16_t SRV_EP_wattmeter08_P; /* +/- xxxx W */ int doWrite_SRV_EP_wattmeter08_P(int16_t value); int addWrite_SRV_EP_wattmeter08_P(int16_t value); int getStatus_SRV_EP_wattmeter08_P(void); #define ID_SRV_EP_wattmeter08_Pmax 2027 extern int16_t SRV_EP_wattmeter08_Pmax; /* +/- xxxx W */ int doWrite_SRV_EP_wattmeter08_Pmax(int16_t value); int addWrite_SRV_EP_wattmeter08_Pmax(int16_t value); int getStatus_SRV_EP_wattmeter08_Pmax(void); #define ID_SRV_EP_wattmeter08_T 2028 extern u_int32_t SRV_EP_wattmeter08_T; /* xxxxxxxxx.x kWh */ int doWrite_SRV_EP_wattmeter08_T(u_int32_t value); int addWrite_SRV_EP_wattmeter08_T(u_int32_t value); int getStatus_SRV_EP_wattmeter08_T(void); #define ID_SRV_EP_wattmeter09_P 2029 extern int16_t SRV_EP_wattmeter09_P; /* +/- xxxx W */ int doWrite_SRV_EP_wattmeter09_P(int16_t value); int addWrite_SRV_EP_wattmeter09_P(int16_t value); int getStatus_SRV_EP_wattmeter09_P(void); #define ID_SRV_EP_wattmeter09_Pmax 2030 extern int16_t SRV_EP_wattmeter09_Pmax; /* +/- xxxx W */ int doWrite_SRV_EP_wattmeter09_Pmax(int16_t value); int addWrite_SRV_EP_wattmeter09_Pmax(int16_t value); int getStatus_SRV_EP_wattmeter09_Pmax(void); #define ID_SRV_EP_wattmeter09_T 2031 extern u_int32_t SRV_EP_wattmeter09_T; /* xxxxxxxxx.x kWh */ int doWrite_SRV_EP_wattmeter09_T(u_int32_t value); int addWrite_SRV_EP_wattmeter09_T(u_int32_t value); int getStatus_SRV_EP_wattmeter09_T(void); #define ID_SRV_EP_wattmeter10_P 2032 extern int16_t SRV_EP_wattmeter10_P; /* +/- xxxx W */ int doWrite_SRV_EP_wattmeter10_P(int16_t value); int addWrite_SRV_EP_wattmeter10_P(int16_t value); int getStatus_SRV_EP_wattmeter10_P(void); #define ID_SRV_EP_wattmeter10_Pmax 2033 extern int16_t SRV_EP_wattmeter10_Pmax; /* +/- xxxx W */ int doWrite_SRV_EP_wattmeter10_Pmax(int16_t value); int addWrite_SRV_EP_wattmeter10_Pmax(int16_t value); int getStatus_SRV_EP_wattmeter10_Pmax(void); #define ID_SRV_EP_wattmeter10_T 2034 extern u_int32_t SRV_EP_wattmeter10_T; /* xxxxxxxxx.x kWh */ int doWrite_SRV_EP_wattmeter10_T(u_int32_t value); int addWrite_SRV_EP_wattmeter10_T(u_int32_t value); int getStatus_SRV_EP_wattmeter10_T(void); #define ID_SRV_EP_wattmeter11_P 2035 extern int16_t SRV_EP_wattmeter11_P; /* +/- xxxx W */ int doWrite_SRV_EP_wattmeter11_P(int16_t value); int addWrite_SRV_EP_wattmeter11_P(int16_t value); int getStatus_SRV_EP_wattmeter11_P(void); #define ID_SRV_EP_wattmeter11_Pmax 2036 extern int16_t SRV_EP_wattmeter11_Pmax; /* +/- xxxx W */ int doWrite_SRV_EP_wattmeter11_Pmax(int16_t value); int addWrite_SRV_EP_wattmeter11_Pmax(int16_t value); int getStatus_SRV_EP_wattmeter11_Pmax(void); #define ID_SRV_EP_wattmeter11_T 2037 extern u_int32_t SRV_EP_wattmeter11_T; /* xxxxxxxxx.x kWh */ int doWrite_SRV_EP_wattmeter11_T(u_int32_t value); int addWrite_SRV_EP_wattmeter11_T(u_int32_t value); int getStatus_SRV_EP_wattmeter11_T(void); #define ID_SRV_EP_wattmeter12_P 2038 extern int16_t SRV_EP_wattmeter12_P; /* +/- xxxx W */ int doWrite_SRV_EP_wattmeter12_P(int16_t value); int addWrite_SRV_EP_wattmeter12_P(int16_t value); int getStatus_SRV_EP_wattmeter12_P(void); #define ID_SRV_EP_wattmeter12_Pmax 2039 extern int16_t SRV_EP_wattmeter12_Pmax; /* +/- xxxx W */ int doWrite_SRV_EP_wattmeter12_Pmax(int16_t value); int addWrite_SRV_EP_wattmeter12_Pmax(int16_t value); int getStatus_SRV_EP_wattmeter12_Pmax(void); #define ID_SRV_EP_wattmeter12_T 2040 extern u_int32_t SRV_EP_wattmeter12_T; /* xxxxxxxxx.x kWh */ int doWrite_SRV_EP_wattmeter12_T(u_int32_t value); int addWrite_SRV_EP_wattmeter12_T(u_int32_t value); int getStatus_SRV_EP_wattmeter12_T(void); #define ID_RTU0_TYPE_PORT 5000 extern u_int32_t RTU0_TYPE_PORT; int doWrite_RTU0_TYPE_PORT(u_int32_t value); int addWrite_RTU0_TYPE_PORT(u_int32_t value); int getStatus_RTU0_TYPE_PORT(void); #define ID_RTU0_BAUDRATE 5001 extern u_int32_t RTU0_BAUDRATE; int doWrite_RTU0_BAUDRATE(u_int32_t value); int addWrite_RTU0_BAUDRATE(u_int32_t value); int getStatus_RTU0_BAUDRATE(void); #define ID_RTU0_STATUS 5002 extern u_int32_t RTU0_STATUS; int doWrite_RTU0_STATUS(u_int32_t value); int addWrite_RTU0_STATUS(u_int32_t value); int getStatus_RTU0_STATUS(void); #define ID_RTU0_READS 5003 extern u_int32_t RTU0_READS; int doWrite_RTU0_READS(u_int32_t value); int addWrite_RTU0_READS(u_int32_t value); int getStatus_RTU0_READS(void); #define ID_RTU0_WRITES 5004 extern u_int32_t RTU0_WRITES; int doWrite_RTU0_WRITES(u_int32_t value); int addWrite_RTU0_WRITES(u_int32_t value); int getStatus_RTU0_WRITES(void); #define ID_RTU0_TIMEOUTS 5005 extern u_int32_t RTU0_TIMEOUTS; int doWrite_RTU0_TIMEOUTS(u_int32_t value); int addWrite_RTU0_TIMEOUTS(u_int32_t value); int getStatus_RTU0_TIMEOUTS(void); #define ID_RTU0_COMM_ERRORS 5006 extern u_int32_t RTU0_COMM_ERRORS; int doWrite_RTU0_COMM_ERRORS(u_int32_t value); int addWrite_RTU0_COMM_ERRORS(u_int32_t value); int getStatus_RTU0_COMM_ERRORS(void); #define ID_RTU0_LAST_ERROR 5007 extern u_int32_t RTU0_LAST_ERROR; int doWrite_RTU0_LAST_ERROR(u_int32_t value); int addWrite_RTU0_LAST_ERROR(u_int32_t value); int getStatus_RTU0_LAST_ERROR(void); #define ID_RTU0_WRITE_QUEUE 5008 extern u_int32_t RTU0_WRITE_QUEUE; int doWrite_RTU0_WRITE_QUEUE(u_int32_t value); int addWrite_RTU0_WRITE_QUEUE(u_int32_t value); int getStatus_RTU0_WRITE_QUEUE(void); #define ID_RTU0_BUS_LOAD 5009 extern u_int32_t RTU0_BUS_LOAD; int doWrite_RTU0_BUS_LOAD(u_int32_t value); int addWrite_RTU0_BUS_LOAD(u_int32_t value); int getStatus_RTU0_BUS_LOAD(void); #define ID_RTU3_TYPE_PORT 5020 extern u_int32_t RTU3_TYPE_PORT; int doWrite_RTU3_TYPE_PORT(u_int32_t value); int addWrite_RTU3_TYPE_PORT(u_int32_t value); int getStatus_RTU3_TYPE_PORT(void); #define ID_RTU3_BAUDRATE 5021 extern u_int32_t RTU3_BAUDRATE; int doWrite_RTU3_BAUDRATE(u_int32_t value); int addWrite_RTU3_BAUDRATE(u_int32_t value); int getStatus_RTU3_BAUDRATE(void); #define ID_RTU3_STATUS 5022 extern u_int32_t RTU3_STATUS; int doWrite_RTU3_STATUS(u_int32_t value); int addWrite_RTU3_STATUS(u_int32_t value); int getStatus_RTU3_STATUS(void); #define ID_RTU3_READS 5023 extern u_int32_t RTU3_READS; int doWrite_RTU3_READS(u_int32_t value); int addWrite_RTU3_READS(u_int32_t value); int getStatus_RTU3_READS(void); #define ID_RTU3_WRITES 5024 extern u_int32_t RTU3_WRITES; int doWrite_RTU3_WRITES(u_int32_t value); int addWrite_RTU3_WRITES(u_int32_t value); int getStatus_RTU3_WRITES(void); #define ID_RTU3_TIMEOUTS 5025 extern u_int32_t RTU3_TIMEOUTS; int doWrite_RTU3_TIMEOUTS(u_int32_t value); int addWrite_RTU3_TIMEOUTS(u_int32_t value); int getStatus_RTU3_TIMEOUTS(void); #define ID_RTU3_COMM_ERRORS 5026 extern u_int32_t RTU3_COMM_ERRORS; int doWrite_RTU3_COMM_ERRORS(u_int32_t value); int addWrite_RTU3_COMM_ERRORS(u_int32_t value); int getStatus_RTU3_COMM_ERRORS(void); #define ID_RTU3_LAST_ERROR 5027 extern u_int32_t RTU3_LAST_ERROR; int doWrite_RTU3_LAST_ERROR(u_int32_t value); int addWrite_RTU3_LAST_ERROR(u_int32_t value); int getStatus_RTU3_LAST_ERROR(void); #define ID_RTU3_WRITE_QUEUE 5028 extern u_int32_t RTU3_WRITE_QUEUE; int doWrite_RTU3_WRITE_QUEUE(u_int32_t value); int addWrite_RTU3_WRITE_QUEUE(u_int32_t value); int getStatus_RTU3_WRITE_QUEUE(void); #define ID_RTU3_BUS_LOAD 5029 extern u_int32_t RTU3_BUS_LOAD; int doWrite_RTU3_BUS_LOAD(u_int32_t value); int addWrite_RTU3_BUS_LOAD(u_int32_t value); int getStatus_RTU3_BUS_LOAD(void); #define ID_TCPS_TYPE_PORT 5050 extern u_int32_t TCPS_TYPE_PORT; int doWrite_TCPS_TYPE_PORT(u_int32_t value); int addWrite_TCPS_TYPE_PORT(u_int32_t value); int getStatus_TCPS_TYPE_PORT(void); #define ID_TCPS_IP_ADDRESS 5051 extern u_int32_t TCPS_IP_ADDRESS; int doWrite_TCPS_IP_ADDRESS(u_int32_t value); int addWrite_TCPS_IP_ADDRESS(u_int32_t value); int getStatus_TCPS_IP_ADDRESS(void); #define ID_TCPS_STATUS 5052 extern u_int32_t TCPS_STATUS; int doWrite_TCPS_STATUS(u_int32_t value); int addWrite_TCPS_STATUS(u_int32_t value); int getStatus_TCPS_STATUS(void); #define ID_TCPS_READS 5053 extern u_int32_t TCPS_READS; int doWrite_TCPS_READS(u_int32_t value); int addWrite_TCPS_READS(u_int32_t value); int getStatus_TCPS_READS(void); #define ID_TCPS_WRITES 5054 extern u_int32_t TCPS_WRITES; int doWrite_TCPS_WRITES(u_int32_t value); int addWrite_TCPS_WRITES(u_int32_t value); int getStatus_TCPS_WRITES(void); #define ID_TCPS_TIMEOUTS 5055 extern u_int32_t TCPS_TIMEOUTS; int doWrite_TCPS_TIMEOUTS(u_int32_t value); int addWrite_TCPS_TIMEOUTS(u_int32_t value); int getStatus_TCPS_TIMEOUTS(void); #define ID_TCPS_COMM_ERRORS 5056 extern u_int32_t TCPS_COMM_ERRORS; int doWrite_TCPS_COMM_ERRORS(u_int32_t value); int addWrite_TCPS_COMM_ERRORS(u_int32_t value); int getStatus_TCPS_COMM_ERRORS(void); #define ID_TCPS_LAST_ERROR 5057 extern u_int32_t TCPS_LAST_ERROR; int doWrite_TCPS_LAST_ERROR(u_int32_t value); int addWrite_TCPS_LAST_ERROR(u_int32_t value); int getStatus_TCPS_LAST_ERROR(void); #define ID_TCPS_WRITE_QUEUE 5058 extern u_int32_t TCPS_WRITE_QUEUE; int doWrite_TCPS_WRITE_QUEUE(u_int32_t value); int addWrite_TCPS_WRITE_QUEUE(u_int32_t value); int getStatus_TCPS_WRITE_QUEUE(void); #define ID_TCPS_BUS_LOAD 5059 extern u_int32_t TCPS_BUS_LOAD; int doWrite_TCPS_BUS_LOAD(u_int32_t value); int addWrite_TCPS_BUS_LOAD(u_int32_t value); int getStatus_TCPS_BUS_LOAD(void); #define ID_TCP0_TYPE_PORT 5060 extern u_int32_t TCP0_TYPE_PORT; int doWrite_TCP0_TYPE_PORT(u_int32_t value); int addWrite_TCP0_TYPE_PORT(u_int32_t value); int getStatus_TCP0_TYPE_PORT(void); #define ID_TCP0_IP_ADDRESS 5061 extern u_int32_t TCP0_IP_ADDRESS; int doWrite_TCP0_IP_ADDRESS(u_int32_t value); int addWrite_TCP0_IP_ADDRESS(u_int32_t value); int getStatus_TCP0_IP_ADDRESS(void); #define ID_TCP0_STATUS 5062 extern u_int32_t TCP0_STATUS; int doWrite_TCP0_STATUS(u_int32_t value); int addWrite_TCP0_STATUS(u_int32_t value); int getStatus_TCP0_STATUS(void); #define ID_TCP0_READS 5063 extern u_int32_t TCP0_READS; int doWrite_TCP0_READS(u_int32_t value); int addWrite_TCP0_READS(u_int32_t value); int getStatus_TCP0_READS(void); #define ID_TCP0_WRITES 5064 extern u_int32_t TCP0_WRITES; int doWrite_TCP0_WRITES(u_int32_t value); int addWrite_TCP0_WRITES(u_int32_t value); int getStatus_TCP0_WRITES(void); #define ID_TCP0_TIMEOUTS 5065 extern u_int32_t TCP0_TIMEOUTS; int doWrite_TCP0_TIMEOUTS(u_int32_t value); int addWrite_TCP0_TIMEOUTS(u_int32_t value); int getStatus_TCP0_TIMEOUTS(void); #define ID_TCP0_COMM_ERRORS 5066 extern u_int32_t TCP0_COMM_ERRORS; int doWrite_TCP0_COMM_ERRORS(u_int32_t value); int addWrite_TCP0_COMM_ERRORS(u_int32_t value); int getStatus_TCP0_COMM_ERRORS(void); #define ID_TCP0_LAST_ERROR 5067 extern u_int32_t TCP0_LAST_ERROR; int doWrite_TCP0_LAST_ERROR(u_int32_t value); int addWrite_TCP0_LAST_ERROR(u_int32_t value); int getStatus_TCP0_LAST_ERROR(void); #define ID_TCP0_WRITE_QUEUE 5068 extern u_int32_t TCP0_WRITE_QUEUE; int doWrite_TCP0_WRITE_QUEUE(u_int32_t value); int addWrite_TCP0_WRITE_QUEUE(u_int32_t value); int getStatus_TCP0_WRITE_QUEUE(void); #define ID_TCP0_BUS_LOAD 5069 extern u_int32_t TCP0_BUS_LOAD; int doWrite_TCP0_BUS_LOAD(u_int32_t value); int addWrite_TCP0_BUS_LOAD(u_int32_t value); int getStatus_TCP0_BUS_LOAD(void); #define ID_TCP1_TYPE_PORT 5070 extern u_int32_t TCP1_TYPE_PORT; int doWrite_TCP1_TYPE_PORT(u_int32_t value); int addWrite_TCP1_TYPE_PORT(u_int32_t value); int getStatus_TCP1_TYPE_PORT(void); #define ID_TCP1_IP_ADDRESS 5071 extern u_int32_t TCP1_IP_ADDRESS; int doWrite_TCP1_IP_ADDRESS(u_int32_t value); int addWrite_TCP1_IP_ADDRESS(u_int32_t value); int getStatus_TCP1_IP_ADDRESS(void); #define ID_TCP1_STATUS 5072 extern u_int32_t TCP1_STATUS; int doWrite_TCP1_STATUS(u_int32_t value); int addWrite_TCP1_STATUS(u_int32_t value); int getStatus_TCP1_STATUS(void); #define ID_TCP1_READS 5073 extern u_int32_t TCP1_READS; int doWrite_TCP1_READS(u_int32_t value); int addWrite_TCP1_READS(u_int32_t value); int getStatus_TCP1_READS(void); #define ID_TCP1_WRITES 5074 extern u_int32_t TCP1_WRITES; int doWrite_TCP1_WRITES(u_int32_t value); int addWrite_TCP1_WRITES(u_int32_t value); int getStatus_TCP1_WRITES(void); #define ID_TCP1_TIMEOUTS 5075 extern u_int32_t TCP1_TIMEOUTS; int doWrite_TCP1_TIMEOUTS(u_int32_t value); int addWrite_TCP1_TIMEOUTS(u_int32_t value); int getStatus_TCP1_TIMEOUTS(void); #define ID_TCP1_COMM_ERRORS 5076 extern u_int32_t TCP1_COMM_ERRORS; int doWrite_TCP1_COMM_ERRORS(u_int32_t value); int addWrite_TCP1_COMM_ERRORS(u_int32_t value); int getStatus_TCP1_COMM_ERRORS(void); #define ID_TCP1_LAST_ERROR 5077 extern u_int32_t TCP1_LAST_ERROR; int doWrite_TCP1_LAST_ERROR(u_int32_t value); int addWrite_TCP1_LAST_ERROR(u_int32_t value); int getStatus_TCP1_LAST_ERROR(void); #define ID_TCP1_WRITE_QUEUE 5078 extern u_int32_t TCP1_WRITE_QUEUE; int doWrite_TCP1_WRITE_QUEUE(u_int32_t value); int addWrite_TCP1_WRITE_QUEUE(u_int32_t value); int getStatus_TCP1_WRITE_QUEUE(void); #define ID_TCP1_BUS_LOAD 5079 extern u_int32_t TCP1_BUS_LOAD; int doWrite_TCP1_BUS_LOAD(u_int32_t value); int addWrite_TCP1_BUS_LOAD(u_int32_t value); int getStatus_TCP1_BUS_LOAD(void); #define ID_TCP2_TYPE_PORT 5080 extern u_int32_t TCP2_TYPE_PORT; int doWrite_TCP2_TYPE_PORT(u_int32_t value); int addWrite_TCP2_TYPE_PORT(u_int32_t value); int getStatus_TCP2_TYPE_PORT(void); #define ID_TCP2_IP_ADDRESS 5081 extern u_int32_t TCP2_IP_ADDRESS; int doWrite_TCP2_IP_ADDRESS(u_int32_t value); int addWrite_TCP2_IP_ADDRESS(u_int32_t value); int getStatus_TCP2_IP_ADDRESS(void); #define ID_TCP2_STATUS 5082 extern u_int32_t TCP2_STATUS; int doWrite_TCP2_STATUS(u_int32_t value); int addWrite_TCP2_STATUS(u_int32_t value); int getStatus_TCP2_STATUS(void); #define ID_TCP2_READS 5083 extern u_int32_t TCP2_READS; int doWrite_TCP2_READS(u_int32_t value); int addWrite_TCP2_READS(u_int32_t value); int getStatus_TCP2_READS(void); #define ID_TCP2_WRITES 5084 extern u_int32_t TCP2_WRITES; int doWrite_TCP2_WRITES(u_int32_t value); int addWrite_TCP2_WRITES(u_int32_t value); int getStatus_TCP2_WRITES(void); #define ID_TCP2_TIMEOUTS 5085 extern u_int32_t TCP2_TIMEOUTS; int doWrite_TCP2_TIMEOUTS(u_int32_t value); int addWrite_TCP2_TIMEOUTS(u_int32_t value); int getStatus_TCP2_TIMEOUTS(void); #define ID_TCP2_COMM_ERRORS 5086 extern u_int32_t TCP2_COMM_ERRORS; int doWrite_TCP2_COMM_ERRORS(u_int32_t value); int addWrite_TCP2_COMM_ERRORS(u_int32_t value); int getStatus_TCP2_COMM_ERRORS(void); #define ID_TCP2_LAST_ERROR 5087 extern u_int32_t TCP2_LAST_ERROR; int doWrite_TCP2_LAST_ERROR(u_int32_t value); int addWrite_TCP2_LAST_ERROR(u_int32_t value); int getStatus_TCP2_LAST_ERROR(void); #define ID_TCP2_WRITE_QUEUE 5088 extern u_int32_t TCP2_WRITE_QUEUE; int doWrite_TCP2_WRITE_QUEUE(u_int32_t value); int addWrite_TCP2_WRITE_QUEUE(u_int32_t value); int getStatus_TCP2_WRITE_QUEUE(void); #define ID_TCP2_BUS_LOAD 5089 extern u_int32_t TCP2_BUS_LOAD; int doWrite_TCP2_BUS_LOAD(u_int32_t value); int addWrite_TCP2_BUS_LOAD(u_int32_t value); int getStatus_TCP2_BUS_LOAD(void); #define ID_TCP3_TYPE_PORT 5090 extern u_int32_t TCP3_TYPE_PORT; int doWrite_TCP3_TYPE_PORT(u_int32_t value); int addWrite_TCP3_TYPE_PORT(u_int32_t value); int getStatus_TCP3_TYPE_PORT(void); #define ID_TCP3_IP_ADDRESS 5091 extern u_int32_t TCP3_IP_ADDRESS; int doWrite_TCP3_IP_ADDRESS(u_int32_t value); int addWrite_TCP3_IP_ADDRESS(u_int32_t value); int getStatus_TCP3_IP_ADDRESS(void); #define ID_TCP3_STATUS 5092 extern u_int32_t TCP3_STATUS; int doWrite_TCP3_STATUS(u_int32_t value); int addWrite_TCP3_STATUS(u_int32_t value); int getStatus_TCP3_STATUS(void); #define ID_TCP3_READS 5093 extern u_int32_t TCP3_READS; int doWrite_TCP3_READS(u_int32_t value); int addWrite_TCP3_READS(u_int32_t value); int getStatus_TCP3_READS(void); #define ID_TCP3_WRITES 5094 extern u_int32_t TCP3_WRITES; int doWrite_TCP3_WRITES(u_int32_t value); int addWrite_TCP3_WRITES(u_int32_t value); int getStatus_TCP3_WRITES(void); #define ID_TCP3_TIMEOUTS 5095 extern u_int32_t TCP3_TIMEOUTS; int doWrite_TCP3_TIMEOUTS(u_int32_t value); int addWrite_TCP3_TIMEOUTS(u_int32_t value); int getStatus_TCP3_TIMEOUTS(void); #define ID_TCP3_COMM_ERRORS 5096 extern u_int32_t TCP3_COMM_ERRORS; int doWrite_TCP3_COMM_ERRORS(u_int32_t value); int addWrite_TCP3_COMM_ERRORS(u_int32_t value); int getStatus_TCP3_COMM_ERRORS(void); #define ID_TCP3_LAST_ERROR 5097 extern u_int32_t TCP3_LAST_ERROR; int doWrite_TCP3_LAST_ERROR(u_int32_t value); int addWrite_TCP3_LAST_ERROR(u_int32_t value); int getStatus_TCP3_LAST_ERROR(void); #define ID_TCP3_WRITE_QUEUE 5098 extern u_int32_t TCP3_WRITE_QUEUE; int doWrite_TCP3_WRITE_QUEUE(u_int32_t value); int addWrite_TCP3_WRITE_QUEUE(u_int32_t value); int getStatus_TCP3_WRITE_QUEUE(void); #define ID_TCP3_BUS_LOAD 5099 extern u_int32_t TCP3_BUS_LOAD; int doWrite_TCP3_BUS_LOAD(u_int32_t value); int addWrite_TCP3_BUS_LOAD(u_int32_t value); int getStatus_TCP3_BUS_LOAD(void); #define ID_TCP4_TYPE_PORT 5100 extern u_int32_t TCP4_TYPE_PORT; int doWrite_TCP4_TYPE_PORT(u_int32_t value); int addWrite_TCP4_TYPE_PORT(u_int32_t value); int getStatus_TCP4_TYPE_PORT(void); #define ID_TCP4_IP_ADDRESS 5101 extern u_int32_t TCP4_IP_ADDRESS; int doWrite_TCP4_IP_ADDRESS(u_int32_t value); int addWrite_TCP4_IP_ADDRESS(u_int32_t value); int getStatus_TCP4_IP_ADDRESS(void); #define ID_TCP4_STATUS 5102 extern u_int32_t TCP4_STATUS; int doWrite_TCP4_STATUS(u_int32_t value); int addWrite_TCP4_STATUS(u_int32_t value); int getStatus_TCP4_STATUS(void); #define ID_TCP4_READS 5103 extern u_int32_t TCP4_READS; int doWrite_TCP4_READS(u_int32_t value); int addWrite_TCP4_READS(u_int32_t value); int getStatus_TCP4_READS(void); #define ID_TCP4_WRITES 5104 extern u_int32_t TCP4_WRITES; int doWrite_TCP4_WRITES(u_int32_t value); int addWrite_TCP4_WRITES(u_int32_t value); int getStatus_TCP4_WRITES(void); #define ID_TCP4_TIMEOUTS 5105 extern u_int32_t TCP4_TIMEOUTS; int doWrite_TCP4_TIMEOUTS(u_int32_t value); int addWrite_TCP4_TIMEOUTS(u_int32_t value); int getStatus_TCP4_TIMEOUTS(void); #define ID_TCP4_COMM_ERRORS 5106 extern u_int32_t TCP4_COMM_ERRORS; int doWrite_TCP4_COMM_ERRORS(u_int32_t value); int addWrite_TCP4_COMM_ERRORS(u_int32_t value); int getStatus_TCP4_COMM_ERRORS(void); #define ID_TCP4_LAST_ERROR 5107 extern u_int32_t TCP4_LAST_ERROR; int doWrite_TCP4_LAST_ERROR(u_int32_t value); int addWrite_TCP4_LAST_ERROR(u_int32_t value); int getStatus_TCP4_LAST_ERROR(void); #define ID_TCP4_WRITE_QUEUE 5108 extern u_int32_t TCP4_WRITE_QUEUE; int doWrite_TCP4_WRITE_QUEUE(u_int32_t value); int addWrite_TCP4_WRITE_QUEUE(u_int32_t value); int getStatus_TCP4_WRITE_QUEUE(void); #define ID_TCP4_BUS_LOAD 5109 extern u_int32_t TCP4_BUS_LOAD; int doWrite_TCP4_BUS_LOAD(u_int32_t value); int addWrite_TCP4_BUS_LOAD(u_int32_t value); int getStatus_TCP4_BUS_LOAD(void); #define ID_TCP5_TYPE_PORT 5110 extern u_int32_t TCP5_TYPE_PORT; int doWrite_TCP5_TYPE_PORT(u_int32_t value); int addWrite_TCP5_TYPE_PORT(u_int32_t value); int getStatus_TCP5_TYPE_PORT(void); #define ID_TCP5_IP_ADDRESS 5111 extern u_int32_t TCP5_IP_ADDRESS; int doWrite_TCP5_IP_ADDRESS(u_int32_t value); int addWrite_TCP5_IP_ADDRESS(u_int32_t value); int getStatus_TCP5_IP_ADDRESS(void); #define ID_TCP5_STATUS 5112 extern u_int32_t TCP5_STATUS; int doWrite_TCP5_STATUS(u_int32_t value); int addWrite_TCP5_STATUS(u_int32_t value); int getStatus_TCP5_STATUS(void); #define ID_TCP5_READS 5113 extern u_int32_t TCP5_READS; int doWrite_TCP5_READS(u_int32_t value); int addWrite_TCP5_READS(u_int32_t value); int getStatus_TCP5_READS(void); #define ID_TCP5_WRITES 5114 extern u_int32_t TCP5_WRITES; int doWrite_TCP5_WRITES(u_int32_t value); int addWrite_TCP5_WRITES(u_int32_t value); int getStatus_TCP5_WRITES(void); #define ID_TCP5_TIMEOUTS 5115 extern u_int32_t TCP5_TIMEOUTS; int doWrite_TCP5_TIMEOUTS(u_int32_t value); int addWrite_TCP5_TIMEOUTS(u_int32_t value); int getStatus_TCP5_TIMEOUTS(void); #define ID_TCP5_COMM_ERRORS 5116 extern u_int32_t TCP5_COMM_ERRORS; int doWrite_TCP5_COMM_ERRORS(u_int32_t value); int addWrite_TCP5_COMM_ERRORS(u_int32_t value); int getStatus_TCP5_COMM_ERRORS(void); #define ID_TCP5_LAST_ERROR 5117 extern u_int32_t TCP5_LAST_ERROR; int doWrite_TCP5_LAST_ERROR(u_int32_t value); int addWrite_TCP5_LAST_ERROR(u_int32_t value); int getStatus_TCP5_LAST_ERROR(void); #define ID_TCP5_WRITE_QUEUE 5118 extern u_int32_t TCP5_WRITE_QUEUE; int doWrite_TCP5_WRITE_QUEUE(u_int32_t value); int addWrite_TCP5_WRITE_QUEUE(u_int32_t value); int getStatus_TCP5_WRITE_QUEUE(void); #define ID_TCP5_BUS_LOAD 5119 extern u_int32_t TCP5_BUS_LOAD; int doWrite_TCP5_BUS_LOAD(u_int32_t value); int addWrite_TCP5_BUS_LOAD(u_int32_t value); int getStatus_TCP5_BUS_LOAD(void); #define ID_TCP6_TYPE_PORT 5120 extern u_int32_t TCP6_TYPE_PORT; int doWrite_TCP6_TYPE_PORT(u_int32_t value); int addWrite_TCP6_TYPE_PORT(u_int32_t value); int getStatus_TCP6_TYPE_PORT(void); #define ID_TCP6_IP_ADDRESS 5121 extern u_int32_t TCP6_IP_ADDRESS; int doWrite_TCP6_IP_ADDRESS(u_int32_t value); int addWrite_TCP6_IP_ADDRESS(u_int32_t value); int getStatus_TCP6_IP_ADDRESS(void); #define ID_TCP6_STATUS 5122 extern u_int32_t TCP6_STATUS; int doWrite_TCP6_STATUS(u_int32_t value); int addWrite_TCP6_STATUS(u_int32_t value); int getStatus_TCP6_STATUS(void); #define ID_TCP6_READS 5123 extern u_int32_t TCP6_READS; int doWrite_TCP6_READS(u_int32_t value); int addWrite_TCP6_READS(u_int32_t value); int getStatus_TCP6_READS(void); #define ID_TCP6_WRITES 5124 extern u_int32_t TCP6_WRITES; int doWrite_TCP6_WRITES(u_int32_t value); int addWrite_TCP6_WRITES(u_int32_t value); int getStatus_TCP6_WRITES(void); #define ID_TCP6_TIMEOUTS 5125 extern u_int32_t TCP6_TIMEOUTS; int doWrite_TCP6_TIMEOUTS(u_int32_t value); int addWrite_TCP6_TIMEOUTS(u_int32_t value); int getStatus_TCP6_TIMEOUTS(void); #define ID_TCP6_COMM_ERRORS 5126 extern u_int32_t TCP6_COMM_ERRORS; int doWrite_TCP6_COMM_ERRORS(u_int32_t value); int addWrite_TCP6_COMM_ERRORS(u_int32_t value); int getStatus_TCP6_COMM_ERRORS(void); #define ID_TCP6_LAST_ERROR 5127 extern u_int32_t TCP6_LAST_ERROR; int doWrite_TCP6_LAST_ERROR(u_int32_t value); int addWrite_TCP6_LAST_ERROR(u_int32_t value); int getStatus_TCP6_LAST_ERROR(void); #define ID_TCP6_WRITE_QUEUE 5128 extern u_int32_t TCP6_WRITE_QUEUE; int doWrite_TCP6_WRITE_QUEUE(u_int32_t value); int addWrite_TCP6_WRITE_QUEUE(u_int32_t value); int getStatus_TCP6_WRITE_QUEUE(void); #define ID_TCP6_BUS_LOAD 5129 extern u_int32_t TCP6_BUS_LOAD; int doWrite_TCP6_BUS_LOAD(u_int32_t value); int addWrite_TCP6_BUS_LOAD(u_int32_t value); int getStatus_TCP6_BUS_LOAD(void); #define ID_TCP7_TYPE_PORT 5130 extern u_int32_t TCP7_TYPE_PORT; int doWrite_TCP7_TYPE_PORT(u_int32_t value); int addWrite_TCP7_TYPE_PORT(u_int32_t value); int getStatus_TCP7_TYPE_PORT(void); #define ID_TCP7_IP_ADDRESS 5131 extern u_int32_t TCP7_IP_ADDRESS; int doWrite_TCP7_IP_ADDRESS(u_int32_t value); int addWrite_TCP7_IP_ADDRESS(u_int32_t value); int getStatus_TCP7_IP_ADDRESS(void); #define ID_TCP7_STATUS 5132 extern u_int32_t TCP7_STATUS; int doWrite_TCP7_STATUS(u_int32_t value); int addWrite_TCP7_STATUS(u_int32_t value); int getStatus_TCP7_STATUS(void); #define ID_TCP7_READS 5133 extern u_int32_t TCP7_READS; int doWrite_TCP7_READS(u_int32_t value); int addWrite_TCP7_READS(u_int32_t value); int getStatus_TCP7_READS(void); #define ID_TCP7_WRITES 5134 extern u_int32_t TCP7_WRITES; int doWrite_TCP7_WRITES(u_int32_t value); int addWrite_TCP7_WRITES(u_int32_t value); int getStatus_TCP7_WRITES(void); #define ID_TCP7_TIMEOUTS 5135 extern u_int32_t TCP7_TIMEOUTS; int doWrite_TCP7_TIMEOUTS(u_int32_t value); int addWrite_TCP7_TIMEOUTS(u_int32_t value); int getStatus_TCP7_TIMEOUTS(void); #define ID_TCP7_COMM_ERRORS 5136 extern u_int32_t TCP7_COMM_ERRORS; int doWrite_TCP7_COMM_ERRORS(u_int32_t value); int addWrite_TCP7_COMM_ERRORS(u_int32_t value); int getStatus_TCP7_COMM_ERRORS(void); #define ID_TCP7_LAST_ERROR 5137 extern u_int32_t TCP7_LAST_ERROR; int doWrite_TCP7_LAST_ERROR(u_int32_t value); int addWrite_TCP7_LAST_ERROR(u_int32_t value); int getStatus_TCP7_LAST_ERROR(void); #define ID_TCP7_WRITE_QUEUE 5138 extern u_int32_t TCP7_WRITE_QUEUE; int doWrite_TCP7_WRITE_QUEUE(u_int32_t value); int addWrite_TCP7_WRITE_QUEUE(u_int32_t value); int getStatus_TCP7_WRITE_QUEUE(void); #define ID_TCP7_BUS_LOAD 5139 extern u_int32_t TCP7_BUS_LOAD; int doWrite_TCP7_BUS_LOAD(u_int32_t value); int addWrite_TCP7_BUS_LOAD(u_int32_t value); int getStatus_TCP7_BUS_LOAD(void); #define ID_TCP8_TYPE_PORT 5140 extern u_int32_t TCP8_TYPE_PORT; int doWrite_TCP8_TYPE_PORT(u_int32_t value); int addWrite_TCP8_TYPE_PORT(u_int32_t value); int getStatus_TCP8_TYPE_PORT(void); #define ID_TCP8_IP_ADDRESS 5141 extern u_int32_t TCP8_IP_ADDRESS; int doWrite_TCP8_IP_ADDRESS(u_int32_t value); int addWrite_TCP8_IP_ADDRESS(u_int32_t value); int getStatus_TCP8_IP_ADDRESS(void); #define ID_TCP8_STATUS 5142 extern u_int32_t TCP8_STATUS; int doWrite_TCP8_STATUS(u_int32_t value); int addWrite_TCP8_STATUS(u_int32_t value); int getStatus_TCP8_STATUS(void); #define ID_TCP8_READS 5143 extern u_int32_t TCP8_READS; int doWrite_TCP8_READS(u_int32_t value); int addWrite_TCP8_READS(u_int32_t value); int getStatus_TCP8_READS(void); #define ID_TCP8_WRITES 5144 extern u_int32_t TCP8_WRITES; int doWrite_TCP8_WRITES(u_int32_t value); int addWrite_TCP8_WRITES(u_int32_t value); int getStatus_TCP8_WRITES(void); #define ID_TCP8_TIMEOUTS 5145 extern u_int32_t TCP8_TIMEOUTS; int doWrite_TCP8_TIMEOUTS(u_int32_t value); int addWrite_TCP8_TIMEOUTS(u_int32_t value); int getStatus_TCP8_TIMEOUTS(void); #define ID_TCP8_COMM_ERRORS 5146 extern u_int32_t TCP8_COMM_ERRORS; int doWrite_TCP8_COMM_ERRORS(u_int32_t value); int addWrite_TCP8_COMM_ERRORS(u_int32_t value); int getStatus_TCP8_COMM_ERRORS(void); #define ID_TCP8_LAST_ERROR 5147 extern u_int32_t TCP8_LAST_ERROR; int doWrite_TCP8_LAST_ERROR(u_int32_t value); int addWrite_TCP8_LAST_ERROR(u_int32_t value); int getStatus_TCP8_LAST_ERROR(void); #define ID_TCP8_WRITE_QUEUE 5148 extern u_int32_t TCP8_WRITE_QUEUE; int doWrite_TCP8_WRITE_QUEUE(u_int32_t value); int addWrite_TCP8_WRITE_QUEUE(u_int32_t value); int getStatus_TCP8_WRITE_QUEUE(void); #define ID_TCP8_BUS_LOAD 5149 extern u_int32_t TCP8_BUS_LOAD; int doWrite_TCP8_BUS_LOAD(u_int32_t value); int addWrite_TCP8_BUS_LOAD(u_int32_t value); int getStatus_TCP8_BUS_LOAD(void); #define ID_TCP9_TYPE_PORT 5150 extern u_int32_t TCP9_TYPE_PORT; int doWrite_TCP9_TYPE_PORT(u_int32_t value); int addWrite_TCP9_TYPE_PORT(u_int32_t value); int getStatus_TCP9_TYPE_PORT(void); #define ID_TCP9_IP_ADDRESS 5151 extern u_int32_t TCP9_IP_ADDRESS; int doWrite_TCP9_IP_ADDRESS(u_int32_t value); int addWrite_TCP9_IP_ADDRESS(u_int32_t value); int getStatus_TCP9_IP_ADDRESS(void); #define ID_TCP9_STATUS 5152 extern u_int32_t TCP9_STATUS; int doWrite_TCP9_STATUS(u_int32_t value); int addWrite_TCP9_STATUS(u_int32_t value); int getStatus_TCP9_STATUS(void); #define ID_TCP9_READS 5153 extern u_int32_t TCP9_READS; int doWrite_TCP9_READS(u_int32_t value); int addWrite_TCP9_READS(u_int32_t value); int getStatus_TCP9_READS(void); #define ID_TCP9_WRITES 5154 extern u_int32_t TCP9_WRITES; int doWrite_TCP9_WRITES(u_int32_t value); int addWrite_TCP9_WRITES(u_int32_t value); int getStatus_TCP9_WRITES(void); #define ID_TCP9_TIMEOUTS 5155 extern u_int32_t TCP9_TIMEOUTS; int doWrite_TCP9_TIMEOUTS(u_int32_t value); int addWrite_TCP9_TIMEOUTS(u_int32_t value); int getStatus_TCP9_TIMEOUTS(void); #define ID_TCP9_COMM_ERRORS 5156 extern u_int32_t TCP9_COMM_ERRORS; int doWrite_TCP9_COMM_ERRORS(u_int32_t value); int addWrite_TCP9_COMM_ERRORS(u_int32_t value); int getStatus_TCP9_COMM_ERRORS(void); #define ID_TCP9_LAST_ERROR 5157 extern u_int32_t TCP9_LAST_ERROR; int doWrite_TCP9_LAST_ERROR(u_int32_t value); int addWrite_TCP9_LAST_ERROR(u_int32_t value); int getStatus_TCP9_LAST_ERROR(void); #define ID_TCP9_WRITE_QUEUE 5158 extern u_int32_t TCP9_WRITE_QUEUE; int doWrite_TCP9_WRITE_QUEUE(u_int32_t value); int addWrite_TCP9_WRITE_QUEUE(u_int32_t value); int getStatus_TCP9_WRITE_QUEUE(void); #define ID_TCP9_BUS_LOAD 5159 extern u_int32_t TCP9_BUS_LOAD; int doWrite_TCP9_BUS_LOAD(u_int32_t value); int addWrite_TCP9_BUS_LOAD(u_int32_t value); int getStatus_TCP9_BUS_LOAD(void); #define ID_NODE_01_DEV_NODE 5172 extern u_int32_t NODE_01_DEV_NODE; int doWrite_NODE_01_DEV_NODE(u_int32_t value); int addWrite_NODE_01_DEV_NODE(u_int32_t value); int getStatus_NODE_01_DEV_NODE(void); #define ID_NODE_01_STATUS 5173 extern u_int32_t NODE_01_STATUS; int doWrite_NODE_01_STATUS(u_int32_t value); int addWrite_NODE_01_STATUS(u_int32_t value); int getStatus_NODE_01_STATUS(void); #define ID_NODE_02_DEV_NODE 5174 extern u_int32_t NODE_02_DEV_NODE; int doWrite_NODE_02_DEV_NODE(u_int32_t value); int addWrite_NODE_02_DEV_NODE(u_int32_t value); int getStatus_NODE_02_DEV_NODE(void); #define ID_NODE_02_STATUS 5175 extern u_int32_t NODE_02_STATUS; int doWrite_NODE_02_STATUS(u_int32_t value); int addWrite_NODE_02_STATUS(u_int32_t value); int getStatus_NODE_02_STATUS(void); #define ID_NODE_03_DEV_NODE 5176 extern u_int32_t NODE_03_DEV_NODE; int doWrite_NODE_03_DEV_NODE(u_int32_t value); int addWrite_NODE_03_DEV_NODE(u_int32_t value); int getStatus_NODE_03_DEV_NODE(void); #define ID_NODE_03_STATUS 5177 extern u_int32_t NODE_03_STATUS; int doWrite_NODE_03_STATUS(u_int32_t value); int addWrite_NODE_03_STATUS(u_int32_t value); int getStatus_NODE_03_STATUS(void); #define ID_NODE_04_DEV_NODE 5178 extern u_int32_t NODE_04_DEV_NODE; int doWrite_NODE_04_DEV_NODE(u_int32_t value); int addWrite_NODE_04_DEV_NODE(u_int32_t value); int getStatus_NODE_04_DEV_NODE(void); #define ID_NODE_04_STATUS 5179 extern u_int32_t NODE_04_STATUS; int doWrite_NODE_04_STATUS(u_int32_t value); int addWrite_NODE_04_STATUS(u_int32_t value); int getStatus_NODE_04_STATUS(void); #define ID_NODE_05_DEV_NODE 5180 extern u_int32_t NODE_05_DEV_NODE; int doWrite_NODE_05_DEV_NODE(u_int32_t value); int addWrite_NODE_05_DEV_NODE(u_int32_t value); int getStatus_NODE_05_DEV_NODE(void); #define ID_NODE_05_STATUS 5181 extern u_int32_t NODE_05_STATUS; int doWrite_NODE_05_STATUS(u_int32_t value); int addWrite_NODE_05_STATUS(u_int32_t value); int getStatus_NODE_05_STATUS(void); #define ID_NODE_06_DEV_NODE 5182 extern u_int32_t NODE_06_DEV_NODE; int doWrite_NODE_06_DEV_NODE(u_int32_t value); int addWrite_NODE_06_DEV_NODE(u_int32_t value); int getStatus_NODE_06_DEV_NODE(void); #define ID_NODE_06_STATUS 5183 extern u_int32_t NODE_06_STATUS; int doWrite_NODE_06_STATUS(u_int32_t value); int addWrite_NODE_06_STATUS(u_int32_t value); int getStatus_NODE_06_STATUS(void); #define ID_NODE_07_DEV_NODE 5184 extern u_int32_t NODE_07_DEV_NODE; int doWrite_NODE_07_DEV_NODE(u_int32_t value); int addWrite_NODE_07_DEV_NODE(u_int32_t value); int getStatus_NODE_07_DEV_NODE(void); #define ID_NODE_07_STATUS 5185 extern u_int32_t NODE_07_STATUS; int doWrite_NODE_07_STATUS(u_int32_t value); int addWrite_NODE_07_STATUS(u_int32_t value); int getStatus_NODE_07_STATUS(void); #define ID_NODE_08_DEV_NODE 5186 extern u_int32_t NODE_08_DEV_NODE; int doWrite_NODE_08_DEV_NODE(u_int32_t value); int addWrite_NODE_08_DEV_NODE(u_int32_t value); int getStatus_NODE_08_DEV_NODE(void); #define ID_NODE_08_STATUS 5187 extern u_int32_t NODE_08_STATUS; int doWrite_NODE_08_STATUS(u_int32_t value); int addWrite_NODE_08_STATUS(u_int32_t value); int getStatus_NODE_08_STATUS(void); #define ID_NODE_09_DEV_NODE 5188 extern u_int32_t NODE_09_DEV_NODE; int doWrite_NODE_09_DEV_NODE(u_int32_t value); int addWrite_NODE_09_DEV_NODE(u_int32_t value); int getStatus_NODE_09_DEV_NODE(void); #define ID_NODE_09_STATUS 5189 extern u_int32_t NODE_09_STATUS; int doWrite_NODE_09_STATUS(u_int32_t value); int addWrite_NODE_09_STATUS(u_int32_t value); int getStatus_NODE_09_STATUS(void); #define ID_NODE_10_DEV_NODE 5190 extern u_int32_t NODE_10_DEV_NODE; int doWrite_NODE_10_DEV_NODE(u_int32_t value); int addWrite_NODE_10_DEV_NODE(u_int32_t value); int getStatus_NODE_10_DEV_NODE(void); #define ID_NODE_10_STATUS 5191 extern u_int32_t NODE_10_STATUS; int doWrite_NODE_10_STATUS(u_int32_t value); int addWrite_NODE_10_STATUS(u_int32_t value); int getStatus_NODE_10_STATUS(void); #define ID_NODE_11_DEV_NODE 5192 extern u_int32_t NODE_11_DEV_NODE; int doWrite_NODE_11_DEV_NODE(u_int32_t value); int addWrite_NODE_11_DEV_NODE(u_int32_t value); int getStatus_NODE_11_DEV_NODE(void); #define ID_NODE_11_STATUS 5193 extern u_int32_t NODE_11_STATUS; int doWrite_NODE_11_STATUS(u_int32_t value); int addWrite_NODE_11_STATUS(u_int32_t value); int getStatus_NODE_11_STATUS(void); #define ID_NODE_12_DEV_NODE 5194 extern u_int32_t NODE_12_DEV_NODE; int doWrite_NODE_12_DEV_NODE(u_int32_t value); int addWrite_NODE_12_DEV_NODE(u_int32_t value); int getStatus_NODE_12_DEV_NODE(void); #define ID_NODE_12_STATUS 5195 extern u_int32_t NODE_12_STATUS; int doWrite_NODE_12_STATUS(u_int32_t value); int addWrite_NODE_12_STATUS(u_int32_t value); int getStatus_NODE_12_STATUS(void); #define ID_NODE_13_DEV_NODE 5196 extern u_int32_t NODE_13_DEV_NODE; int doWrite_NODE_13_DEV_NODE(u_int32_t value); int addWrite_NODE_13_DEV_NODE(u_int32_t value); int getStatus_NODE_13_DEV_NODE(void); #define ID_NODE_13_STATUS 5197 extern u_int32_t NODE_13_STATUS; int doWrite_NODE_13_STATUS(u_int32_t value); int addWrite_NODE_13_STATUS(u_int32_t value); int getStatus_NODE_13_STATUS(void); #define ID_NODE_14_DEV_NODE 5198 extern u_int32_t NODE_14_DEV_NODE; int doWrite_NODE_14_DEV_NODE(u_int32_t value); int addWrite_NODE_14_DEV_NODE(u_int32_t value); int getStatus_NODE_14_DEV_NODE(void); #define ID_NODE_14_STATUS 5199 extern u_int32_t NODE_14_STATUS; int doWrite_NODE_14_STATUS(u_int32_t value); int addWrite_NODE_14_STATUS(u_int32_t value); int getStatus_NODE_14_STATUS(void); #define ID_NODE_15_DEV_NODE 5200 extern u_int32_t NODE_15_DEV_NODE; int doWrite_NODE_15_DEV_NODE(u_int32_t value); int addWrite_NODE_15_DEV_NODE(u_int32_t value); int getStatus_NODE_15_DEV_NODE(void); #define ID_NODE_15_STATUS 5201 extern u_int32_t NODE_15_STATUS; int doWrite_NODE_15_STATUS(u_int32_t value); int addWrite_NODE_15_STATUS(u_int32_t value); int getStatus_NODE_15_STATUS(void); #define ID_NODE_16_DEV_NODE 5202 extern u_int32_t NODE_16_DEV_NODE; int doWrite_NODE_16_DEV_NODE(u_int32_t value); int addWrite_NODE_16_DEV_NODE(u_int32_t value); int getStatus_NODE_16_DEV_NODE(void); #define ID_NODE_16_STATUS 5203 extern u_int32_t NODE_16_STATUS; int doWrite_NODE_16_STATUS(u_int32_t value); int addWrite_NODE_16_STATUS(u_int32_t value); int getStatus_NODE_16_STATUS(void); #define ID_PLC_time 5390 extern float PLC_time; /* Seconds since boot (reset each 24h) */ int doWrite_PLC_time(float value); int addWrite_PLC_time(float value); int getStatus_PLC_time(void); #define ID_PLC_timeMin 5391 extern float PLC_timeMin; /* 10 seconds window start */ int doWrite_PLC_timeMin(float value); int addWrite_PLC_timeMin(float value); int getStatus_PLC_timeMin(void); #define ID_PLC_timeMax 5392 extern float PLC_timeMax; /* 10 seconds window stop */ int doWrite_PLC_timeMax(float value); int addWrite_PLC_timeMax(float value); int getStatus_PLC_timeMax(void); #define ID_PLC_timeWin 5393 extern float PLC_timeWin; /* Graph display window */ int doWrite_PLC_timeWin(float value); int addWrite_PLC_timeWin(float value); int getStatus_PLC_timeWin(void); #define ID_PLC_Version 5394 extern u_int16_t PLC_Version; /* Run Time version */ int doWrite_PLC_Version(u_int16_t value); int addWrite_PLC_Version(u_int16_t value); int getStatus_PLC_Version(void); #define ID_PLC_EngineStatus 5395 extern u_int16_t PLC_EngineStatus; /* PLC status */ int doWrite_PLC_EngineStatus(u_int16_t value); int addWrite_PLC_EngineStatus(u_int16_t value); int getStatus_PLC_EngineStatus(void); #define ID_PLC_ResetValues 5396 extern int PLC_ResetValues; /* Diagnostic variables reset */ int doWrite_PLC_ResetValues(int value); int addWrite_PLC_ResetValues(int value); int getStatus_PLC_ResetValues(void); #define ID_PLC_buzzerOn 5397 extern int PLC_buzzerOn; /* Buzzer sound (enable = 1 disable = 0) */ int doWrite_PLC_buzzerOn(int value); int addWrite_PLC_buzzerOn(int value); int getStatus_PLC_buzzerOn(void); #define ID_PLC_PLC_Version 5398 extern u_int16_t PLC_PLC_Version; /* PLC application version */ int doWrite_PLC_PLC_Version(u_int16_t value); int addWrite_PLC_PLC_Version(u_int16_t value); int getStatus_PLC_PLC_Version(void); #define ID_PLC_HMI_Version 5399 extern u_int16_t PLC_HMI_Version; /* HMI application version */ int doWrite_PLC_HMI_Version(u_int16_t value); int addWrite_PLC_HMI_Version(u_int16_t value); int getStatus_PLC_HMI_Version(void); #define ID_PLC_Year 5410 extern u_int16_t PLC_Year; /* Currently year */ int doWrite_PLC_Year(u_int16_t value); int addWrite_PLC_Year(u_int16_t value); int getStatus_PLC_Year(void); #define ID_PLC_Month 5411 extern u_int16_t PLC_Month; /* Currently month */ int doWrite_PLC_Month(u_int16_t value); int addWrite_PLC_Month(u_int16_t value); int getStatus_PLC_Month(void); #define ID_PLC_Day 5412 extern u_int16_t PLC_Day; /* Currently day */ int doWrite_PLC_Day(u_int16_t value); int addWrite_PLC_Day(u_int16_t value); int getStatus_PLC_Day(void); #define ID_PLC_Hours 5413 extern u_int16_t PLC_Hours; /* Currently hour */ int doWrite_PLC_Hours(u_int16_t value); int addWrite_PLC_Hours(u_int16_t value); int getStatus_PLC_Hours(void); #define ID_PLC_Minutes 5414 extern u_int16_t PLC_Minutes; /* Currently minutes */ int doWrite_PLC_Minutes(u_int16_t value); int addWrite_PLC_Minutes(u_int16_t value); int getStatus_PLC_Minutes(void); #define ID_PLC_Seconds 5415 extern u_int16_t PLC_Seconds; /* Currently seconds */ int doWrite_PLC_Seconds(u_int16_t value); int addWrite_PLC_Seconds(u_int16_t value); int getStatus_PLC_Seconds(void); #define ID_PLC_UPTIME_s 5416 extern u_int32_t PLC_UPTIME_s; /* Uptime in seconds (wraps in 136 years) */ int doWrite_PLC_UPTIME_s(u_int32_t value); int addWrite_PLC_UPTIME_s(u_int32_t value); int getStatus_PLC_UPTIME_s(void); #define ID_PLC_UPTIME_cs 5417 extern u_int32_t PLC_UPTIME_cs; /* Uptime in centiseconds = 10 ms (wraps in 497 days) */ int doWrite_PLC_UPTIME_cs(u_int32_t value); int addWrite_PLC_UPTIME_cs(u_int32_t value); int getStatus_PLC_UPTIME_cs(void); #define ID_PLC_WATCHDOGEN 5418 extern int PLC_WATCHDOGEN; /* Enable Watchdog */ int doWrite_PLC_WATCHDOGEN(int value); int addWrite_PLC_WATCHDOGEN(int value); int getStatus_PLC_WATCHDOGEN(void); #define ID_PLC_WATCHDOG_ms 5419 extern u_int32_t PLC_WATCHDOG_ms; /* Reset Watchdog timer */ int doWrite_PLC_WATCHDOG_ms(u_int32_t value); int addWrite_PLC_WATCHDOG_ms(u_int32_t value); int getStatus_PLC_WATCHDOG_ms(void); #define ID_PLC_PRODUCT_ID 5420 extern u_int32_t PLC_PRODUCT_ID; /* TP/TPAC/TPLC Product ID (Hex) */ int doWrite_PLC_PRODUCT_ID(u_int32_t value); int addWrite_PLC_PRODUCT_ID(u_int32_t value); int getStatus_PLC_PRODUCT_ID(void); #define ID_PLC_SERIAL_NUMBER 5421 extern u_int32_t PLC_SERIAL_NUMBER; /* TP/TPAC/TPLC Serial Number */ int doWrite_PLC_SERIAL_NUMBER(u_int32_t value); int addWrite_PLC_SERIAL_NUMBER(u_int32_t value); int getStatus_PLC_SERIAL_NUMBER(void); #define ID_PLC_HMI_PAGE 5422 extern int32_t PLC_HMI_PAGE; /* HMI Page (page100=0x00000100) */ int doWrite_PLC_HMI_PAGE(int32_t value); int addWrite_PLC_HMI_PAGE(int32_t value); int getStatus_PLC_HMI_PAGE(void); #define ID_PLC_BEEP_VOLUME 5435 extern u_int8_t PLC_BEEP_VOLUME; /* Beep volume (when buzzerOn) */ int doWrite_PLC_BEEP_VOLUME(u_int8_t value); int addWrite_PLC_BEEP_VOLUME(u_int8_t value); int getStatus_PLC_BEEP_VOLUME(void); #define ID_PLC_TOUCH_VOLUME 5436 extern u_int8_t PLC_TOUCH_VOLUME; /* Touch volume */ int doWrite_PLC_TOUCH_VOLUME(u_int8_t value); int addWrite_PLC_TOUCH_VOLUME(u_int8_t value); int getStatus_PLC_TOUCH_VOLUME(void); #define ID_PLC_ALARM_VOLUME 5437 extern u_int8_t PLC_ALARM_VOLUME; /* Alarm volume (when alarm) */ int doWrite_PLC_ALARM_VOLUME(u_int8_t value); int addWrite_PLC_ALARM_VOLUME(u_int8_t value); int getStatus_PLC_ALARM_VOLUME(void); #define ID_PLC_BUZZER 5438 extern u_int32_t PLC_BUZZER; /* Enable dynamic buzzer sound (0x44332211 up=0x11(%) on=0x22(cs) off=0x33(cs) rep=0x44(times)) */ int doWrite_PLC_BUZZER(u_int32_t value); int addWrite_PLC_BUZZER(u_int32_t value); int getStatus_PLC_BUZZER(void); #ifdef __cplusplus } #endif #endif
0.535156
high
SimplePhysicsEngine/SimplePhysicsEngine/Game/Background.c
fareanor3/World-of-goo
0
7199425
#include "Background.h" #include "Scene.h" void Background_Render(Scene *scene) { Camera *camera = Scene_GetCamera(scene); Renderer *renderer = Scene_GetRenderer(scene); Textures *textures = scene->m_textures; Rect view = Camera_GetView(camera); float xShiftFactors[LAYER_COUNT] = { 0.0f, 0.05f, 0.2f, 0.4f, 0.6f }; float yShiftFactors[LAYER_COUNT] = { 0.0f, 0.05f, 0.1f, 0.2f, 0.3f }; // Couleur de remplissage (identique au ciel) Renderer_Fill(renderer, Color_Set(145, 134, 161, 255)); // Dimension du fond dans le référentiel monde float worldW = 1.3f * 16.0f; float worldH = 1.3f * 9.0f; // Dessine les diff�rents calques du fond (parallax) for (int i = 0; i < LAYER_COUNT; ++i) { Vec2 origin = Vec2_Set( view.x * (1.0f - xShiftFactors[i]), -0.2f + view.y * (1.0f - yShiftFactors[i]) ); int tileXMin = (int)floorf((view.x - origin.x) / worldW); int tileXMax = (int)ceilf((view.x + view.w - origin.x) / worldW); for (int tileXIdx = tileXMin; tileXIdx < tileXMax; ++tileXIdx) { int tileYIdx = 0; Vec2 lower = Vec2_Set(tileXIdx * worldW, (tileYIdx + 1) * worldH); Vec2 upper = Vec2_Set((tileXIdx + 1) * worldW, tileYIdx * worldH); lower = Vec2_Add(lower, origin); upper = Vec2_Add(upper, origin); float x0, x1, y0, y1; Camera_WorldToView(camera, lower, &x0, &y0); Camera_WorldToView(camera, upper, &x1, &y1); SDL_FRect dstRect = { 0 }; dstRect.x = x0; dstRect.y = y0; dstRect.w = fabsf(x1 - x0); dstRect.h = fabsf(y1 - y0); SDL_RenderCopyF(renderer->m_rendererSDL, textures->m_layers[i], NULL, &dstRect); } } } void TileMap_Render(Scene *scene) { Camera *camera = Scene_GetCamera(scene); Renderer *renderer = Scene_GetRenderer(scene); Textures *textures = scene->m_textures; Rect view = Camera_GetView(camera); // Dimension du sol dans le r�f�rentiel monde float worldW = 10.0f; float worldH = 1.0f; // Dessine le sol Vec2 origin = Vec2_Set(0.0f, -1.2f); int tileXMin = (int)floorf((view.x - origin.x) / worldW); int tileXMax = (int)ceilf((view.x + view.w - origin.x) / worldW); for (int tileXIdx = tileXMin; tileXIdx < tileXMax; ++tileXIdx) { int tileYIdx = 0; Vec2 lower = Vec2_Set(tileXIdx * worldW, (tileYIdx + 1) * worldH); Vec2 upper = Vec2_Set((tileXIdx + 1) * worldW, tileYIdx * worldH); lower = Vec2_Add(lower, origin); upper = Vec2_Add(upper, origin); float x0, x1, y0, y1; Camera_WorldToView(camera, lower, &x0, &y0); Camera_WorldToView(camera, upper, &x1, &y1); SDL_FRect dstRect = { 0 }; dstRect.x = x0; dstRect.y = y0; dstRect.w = fabsf(x1 - x0); dstRect.h = fabsf(y1 - y0); SDL_RenderCopyF(renderer->m_rendererSDL, textures->m_ground, NULL, &dstRect); } }
0.996094
high
usr/src/uts/sun4u/daktari/os/daktari.c
AsahiOS/gate
0
7199937
<filename>usr/src/uts/sun4u/daktari/os/daktari.c /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License (the "License"). * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #include <sys/cpuvar.h> #include <sys/param.h> #include <sys/systm.h> #include <sys/sunddi.h> #include <sys/ddi.h> #include <sys/esunddi.h> #include <sys/sysmacros.h> #include <sys/note.h> #include <sys/modctl.h> /* for modload() */ #include <sys/platform_module.h> #include <sys/errno.h> #include <sys/daktari.h> #include <sys/machsystm.h> #include <sys/promif.h> #include <vm/page.h> #include <sys/memnode.h> #include <vm/vm_dep.h> /* I2C Stuff */ #include <sys/i2c/clients/i2c_client.h> int (*p2get_mem_unum)(int, uint64_t, char *, int, int *); /* Daktari Keyswitch Information */ #define DAK_KEY_POLL_PORT 3 #define DAK_KEY_POLL_BIT 2 #define DAK_KEY_POLL_INTVL 10 static boolean_t key_locked_bit; static clock_t keypoll_timeout_hz; /* * Table that maps memory slices to a specific memnode. */ int slice_to_memnode[DAK_MAX_SLICE]; /* * For software memory interleaving support. */ static void update_mem_bounds(int, int, int, uint64_t, uint64_t); static uint64_t slice_table[DAK_SBD_SLOTS][DAK_CPUS_PER_BOARD][DAK_BANKS_PER_MC][2]; #define SLICE_PA 0 #define SLICE_SPAN 1 int (*daktari_ssc050_get_port_bit) (dev_info_t *, int, int, uint8_t *, int); extern void (*abort_seq_handler)(); static int daktari_dev_search(dev_info_t *, void *); static void keyswitch_poll(void *); static void daktari_abort_seq_handler(char *msg); void startup_platform(void) { /* * Disable an active h/w watchdog timer * upon exit to OBP. */ extern int disable_watchdog_on_exit; disable_watchdog_on_exit = 1; } int set_platform_tsb_spares() { return (0); } #pragma weak mmu_init_large_pages void set_platform_defaults(void) { extern void mmu_init_large_pages(size_t); if ((mmu_page_sizes == max_mmu_page_sizes) && (mmu_ism_pagesize != DEFAULT_ISM_PAGESIZE)) { if (&mmu_init_large_pages) mmu_init_large_pages(mmu_ism_pagesize); } } void load_platform_modules(void) { if (modload("misc", "pcihp") < 0) { cmn_err(CE_NOTE, "pcihp driver failed to load"); } if (modload("drv", "pmc") < 0) { cmn_err(CE_NOTE, "pmc driver failed to load"); } } void load_platform_drivers(void) { char **drv; dev_info_t *keysw_dip; static char *boot_time_drivers[] = { "hpc3130", "todds1287", "mc-us3", "ssc050", "pcisch", NULL }; for (drv = boot_time_drivers; *drv; drv++) { if (i_ddi_attach_hw_nodes(*drv) != DDI_SUCCESS) cmn_err(CE_WARN, "Failed to install \"%s\" driver.", *drv); } /* * mc-us3 & ssc050 must stay loaded for plat_get_mem_unum() * and keyswitch_poll() */ (void) ddi_hold_driver(ddi_name_to_major("mc-us3")); (void) ddi_hold_driver(ddi_name_to_major("ssc050")); /* Gain access into the ssc050_get_port function */ daktari_ssc050_get_port_bit = (int (*) (dev_info_t *, int, int, uint8_t *, int)) modgetsymvalue("ssc050_get_port_bit", 0); if (daktari_ssc050_get_port_bit == NULL) { cmn_err(CE_WARN, "cannot find ssc050_get_port_bit"); return; } ddi_walk_devs(ddi_root_node(), daktari_dev_search, (void *)&keysw_dip); ASSERT(keysw_dip != NULL); /* * prevent detach of i2c-ssc050 */ e_ddi_hold_devi(keysw_dip); keypoll_timeout_hz = drv_usectohz(10 * MICROSEC); keyswitch_poll(keysw_dip); abort_seq_handler = daktari_abort_seq_handler; } static int daktari_dev_search(dev_info_t *dip, void *arg) { char *compatible = NULL; /* Search tree for "i2c-ssc050" */ int *dev_regs; /* Info about where the device is. */ uint_t len; int err; if (ddi_prop_lookup_string(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS, "compatible", &compatible) != DDI_PROP_SUCCESS) return (DDI_WALK_CONTINUE); if (strcmp(compatible, "i2c-ssc050") == 0) { ddi_prop_free(compatible); err = ddi_prop_lookup_int_array(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS, "reg", &dev_regs, &len); if (err != DDI_PROP_SUCCESS) { return (DDI_WALK_CONTINUE); } /* * regs[0] contains the bus number and regs[1] * contains the device address of the i2c device. * 0x82 is the device address of the i2c device * from which the key switch position is read. */ if (dev_regs[0] == 0 && dev_regs[1] == 0x82) { *((dev_info_t **)arg) = dip; ddi_prop_free(dev_regs); return (DDI_WALK_TERMINATE); } ddi_prop_free(dev_regs); } else { ddi_prop_free(compatible); } return (DDI_WALK_CONTINUE); } static void keyswitch_poll(void *arg) { dev_info_t *dip = arg; uchar_t port_byte; int port = DAK_KEY_POLL_PORT; int bit = DAK_KEY_POLL_BIT; int err; err = daktari_ssc050_get_port_bit(dip, port, bit, &port_byte, I2C_NOSLEEP); if (err != 0) { cmn_err(CE_WARN, "keyswitch polling disabled: " "errno=%d while reading ssc050", err); return; } key_locked_bit = (boolean_t)((port_byte & 0x1)); (void) timeout(keyswitch_poll, (caddr_t)dip, keypoll_timeout_hz); } static void daktari_abort_seq_handler(char *msg) { if (key_locked_bit == 0) cmn_err(CE_CONT, "KEY in LOCKED position, " "ignoring debug enter sequence"); else { debug_enter(msg); } } int plat_cpu_poweron(struct cpu *cp) { _NOTE(ARGUNUSED(cp)) return (ENOTSUP); } int plat_cpu_poweroff(struct cpu *cp) { _NOTE(ARGUNUSED(cp)) return (ENOTSUP); } /* * Given a pfn, return the board and beginning/end of the page's * memory controller's address range. */ static int plat_discover_slice(pfn_t pfn, pfn_t *first, pfn_t *last) { int bd, cpu, bank; for (bd = 0; bd < DAK_SBD_SLOTS; bd++) { for (cpu = 0; cpu < DAK_CPUS_PER_BOARD; cpu++) { for (bank = 0; bank < DAK_BANKS_PER_MC; bank++) { uint64_t *slice = slice_table[bd][cpu][bank]; uint64_t base = btop(slice[SLICE_PA]); uint64_t len = btop(slice[SLICE_SPAN]); if (len && pfn >= base && pfn < (base + len)) { *first = base; *last = base + len - 1; return (bd); } } } } panic("plat_discover_slice: no slice for pfn 0x%lx\n", pfn); /* NOTREACHED */ } /*ARGSUSED*/ void plat_freelist_process(int mnode) {} /* * Called for each board/cpu/PA range detected in plat_fill_mc(). */ static void update_mem_bounds(int boardid, int cpuid, int bankid, uint64_t base, uint64_t size) { uint64_t end; int mnode; slice_table[boardid][cpuid][bankid][SLICE_PA] = base; slice_table[boardid][cpuid][bankid][SLICE_SPAN] = size; end = base + size - 1; /* * First see if this board already has a memnode associated * with it. If not, see if this slice has a memnode. This * covers the cases where a single slice covers multiple * boards (cross-board interleaving) and where a single * board has multiple slices (1+GB DIMMs). */ if ((mnode = plat_lgrphand_to_mem_node(boardid)) == -1) { if ((mnode = slice_to_memnode[PA_2_SLICE(base)]) == -1) mnode = mem_node_alloc(); ASSERT(mnode >= 0); ASSERT(mnode < MAX_MEM_NODES); plat_assign_lgrphand_to_mem_node(boardid, mnode); } base = P2ALIGN(base, (1ul << PA_SLICE_SHIFT)); while (base < end) { slice_to_memnode[PA_2_SLICE(base)] = mnode; base += (1ul << PA_SLICE_SHIFT); } } /* * Dynamically detect memory slices in the system by decoding * the cpu memory decoder registers at boot time. */ void plat_fill_mc(pnode_t nodeid) { uint64_t mc_addr, saf_addr; uint64_t mc_decode[DAK_BANKS_PER_MC]; uint64_t base, size; uint64_t saf_mask; uint64_t offset; uint32_t regs[4]; int len; int local_mc; int portid; int boardid; int cpuid; int i; if ((prom_getprop(nodeid, "portid", (caddr_t)&portid) < 0) || (portid == -1)) return; /* * Decode the board number from the MC portid. Assumes * portid == safari agentid. */ boardid = DAK_GETSLOT(portid); cpuid = DAK_GETSID(portid); /* * The "reg" property returns 4 32-bit values. The first two are * combined to form a 64-bit address. The second two are for a * 64-bit size, but we don't actually need to look at that value. */ len = prom_getproplen(nodeid, "reg"); if (len != (sizeof (uint32_t) * 4)) { prom_printf("Warning: malformed 'reg' property\n"); return; } if (prom_getprop(nodeid, "reg", (caddr_t)regs) < 0) return; mc_addr = ((uint64_t)regs[0]) << 32; mc_addr |= (uint64_t)regs[1]; /* * Figure out whether the memory controller we are examining * belongs to this CPU or a different one. */ saf_addr = lddsafaddr(8); saf_mask = (uint64_t)SAF_MASK; if ((mc_addr & saf_mask) == saf_addr) local_mc = 1; else local_mc = 0; for (i = 0; i < DAK_BANKS_PER_MC; i++) { /* * Memory decode masks are at offsets 0x10 - 0x28. */ offset = 0x10 + (i << 3); /* * If the memory controller is local to this CPU, we use * the special ASI to read the decode registers. * Otherwise, we load the values from a magic address in * I/O space. */ if (local_mc) mc_decode[i] = lddmcdecode(offset); else mc_decode[i] = lddphysio(mc_addr | offset); /* * If the upper bit is set, we have a valid mask */ if ((int64_t)mc_decode[i] < 0) { /* * The memory decode register is a bitmask field, * so we can decode that into both a base and * a span. */ base = MC_BASE(mc_decode[i]) << PHYS2UM_SHIFT; size = MC_UK2SPAN(mc_decode[i]); update_mem_bounds(boardid, cpuid, i, base, size); } } } /* * This routine is run midway through the boot process. By the time we get * here, we know about all the active CPU boards in the system, and we have * extracted information about each board's memory from the memory * controllers. We have also figured out which ranges of memory will be * assigned to which memnodes, so we walk the slice table to build the table * of memnodes. */ /* ARGSUSED */ void plat_build_mem_nodes(prom_memlist_t *list, size_t nelems) { int slice; pfn_t basepfn; pgcnt_t npgs; mem_node_pfn_shift = PFN_SLICE_SHIFT; mem_node_physalign = (1ull << PA_SLICE_SHIFT); npgs = 1ull << PFN_SLICE_SHIFT; for (slice = 0; slice < DAK_MAX_SLICE; slice++) { if (slice_to_memnode[slice] == -1) continue; basepfn = (uint64_t)slice << PFN_SLICE_SHIFT; mem_node_add_slice(basepfn, basepfn + npgs - 1); } } /* * Daktari support for lgroups. * * On Daktari, an lgroup platform handle == slot number. * * Mappings between lgroup handles and memnodes are managed * in addition to mappings between memory slices and memnodes * to support cross-board interleaving as well as multiple * slices per board (e.g. >1GB DIMMs). The initial mapping * of memnodes to lgroup handles is determined at boot time. */ int plat_pfn_to_mem_node(pfn_t pfn) { return (slice_to_memnode[PFN_2_SLICE(pfn)]); } /* * Return the platform handle for the lgroup containing the given CPU * * For Daktari, lgroup platform handle == slot number */ lgrp_handle_t plat_lgrp_cpu_to_hand(processorid_t id) { return (DAK_GETSLOT(id)); } /* * Platform specific lgroup initialization */ void plat_lgrp_init(void) { int i; /* * Initialize lookup tables to invalid values so we catch * any illegal use of them. */ for (i = 0; i < DAK_MAX_SLICE; i++) { slice_to_memnode[i] = -1; } } /* * Return latency between "from" and "to" lgroups * * This latency number can only be used for relative comparison * between lgroups on the running system, cannot be used across platforms, * and may not reflect the actual latency. It is platform and implementation * specific, so platform gets to decide its value. It would be nice if the * number was at least proportional to make comparisons more meaningful though. * NOTE: The numbers below are supposed to be load latencies for uncached * memory divided by 10. */ int plat_lgrp_latency(lgrp_handle_t from, lgrp_handle_t to) { /* * Return min remote latency when there are more than two lgroups * (root and child) and getting latency between two different lgroups * or root is involved */ if (lgrp_optimizations() && (from != to || from == LGRP_DEFAULT_HANDLE || to == LGRP_DEFAULT_HANDLE)) return (21); else return (19); } /* * No platform drivers on this platform */ char *platform_module_list[] = { (char *)0 }; /*ARGSUSED*/ void plat_tod_fault(enum tod_fault_type tod_bad) { } /*ARGSUSED*/ int plat_get_mem_unum(int synd_code, uint64_t flt_addr, int flt_bus_id, int flt_in_memory, ushort_t flt_status, char *buf, int buflen, int *lenp) { if (flt_in_memory && (p2get_mem_unum != NULL)) return (p2get_mem_unum(synd_code, P2ALIGN(flt_addr, 8), buf, buflen, lenp)); else return (ENOTSUP); } /* * This platform hook gets called from mc_add_mem_unum_label() in the mc-us3 * driver giving each platform the opportunity to add platform * specific label information to the unum for ECC error logging purposes. */ void plat_add_mem_unum_label(char *unum, int mcid, int bank, int dimm) { _NOTE(ARGUNUSED(bank, dimm)) char board = DAK_GETSLOT_LABEL(mcid); char old_unum[UNUM_NAMLEN]; (void) strcpy(old_unum, unum); (void) snprintf(unum, UNUM_NAMLEN, "Slot %c: %s", board, old_unum); } int plat_get_cpu_unum(int cpuid, char *buf, int buflen, int *lenp) { char board = DAK_GETSLOT_LABEL(cpuid); if (snprintf(buf, buflen, "Slot %c", board) >= buflen) { return (ENOSPC); } else { *lenp = strlen(buf); return (0); } } /* * The zuluvm module required a dmv interrupt for each installed * Zulu/XVR-4000 board. The following has not been updated during the * removal of zuluvm and therefore it may be suboptimal. */ void plat_dmv_params(uint_t *hwint, uint_t *swint) { *hwint = 0; *swint = DAK_SBD_SLOTS - 1; }
0.976563
high
llvm_sim/components/parser.h
the-eager-ghosts/EXEgesis
201
800449
// Copyright 2018 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // An instruction parser with a limited bandwidth. #ifndef EXEGESIS_LLVM_SIM_COMPONENTS_PARSER_H_ #define EXEGESIS_LLVM_SIM_COMPONENTS_PARSER_H_ #include "llvm_sim/components/common.h" #include "llvm_sim/framework/component.h" namespace exegesis { namespace simulator { class InstructionParser : public Component { public: struct Config { int MaxInstructionsPerCycle; }; InstructionParser(const GlobalContext* Context, const Config& Config, Source<InstructionIndex>* Source, Sink<InstructionIndex>* Sink); ~InstructionParser() override; void Tick(const BlockContext* BlockContext) override; private: const Config Config_; Source<InstructionIndex>* const Source_; Sink<InstructionIndex>* const Sink_; }; } // namespace simulator } // namespace exegesis #endif // EXEGESIS_LLVM_SIM_COMPONENTS_PARSER_H_
0.992188
high
interface/TopPairEventCandidate.h
jjacob/AnalysisSoftware
0
800961
<gh_stars>0 /* * TopPairEventCandidate.h * * Created on: 9 Jul 2010 * Author: kreczko */ #ifndef TOPPAIREVENTCANDIDATE_H_ #define TOPPAIREVENTCANDIDATE_H_ #include <boost/shared_ptr.hpp> #include "Event.h" #include "RecoObjects/Particle.h" #include "RecoObjects/Electron.h" #include "RecoObjects/Jet.h" #include "Taggers/ConversionTagger.h" #include "TtbarHypothesis.h" #include "ReconstructionModules/ReconstructionException.h" namespace BAT { namespace NeutrinoSelectionCriterion { enum value { pzClosestToLepton, mostCentral, pzClosestToLeptonOrMostcentralIfAbove300, largestValueOfCosine, chi2, TopMassDifference }; } namespace TTbarReconstructionCriterion { enum value { TopMassDifference, chi2 }; } namespace TTbarEPlusJetsSelection { //TODO: change to new counting enum Step { FilterOutScraping, HighLevelTrigger, GoodPrimaryvertex, OneIsolatedElectron, LooseMuonVeto, DileptonVeto, ConversionRejection, ConversionFinder, AtLeastOneGoodJet, AtLeastTwoGoodJets, AtLeastThreeGoodJets, AtLeastFourGoodJets, MissingTransverseEnergy, AsymmetricJetCuts, AtLeastOneBtag, AtLeastTwoBtags, NUMBER_OF_SELECTION_STEPS }; const std::string StringSteps[NUMBER_OF_SELECTION_STEPS] = { "Scraping Filter", // "High Level Trigger", // "good primary vertex", // "exactly one isolated electron", // "loose muon veto", // "di-lepton veto", // "Conversion veto (missing hits)", // "Conversion finder (partner track)", // ">= 1 jets", // ">= 2 jets", // ">= 3 jets", // ">= 4 jets", // "MET > 20GeV", // "jet pT: 1st > 70 GeV, 2nd > 50 GeV", // ">=1 SSV b-tag", // ">=2 SSV b-tag" }; } namespace TTbarMuPlusJetsSelection { enum Step { EventCleaning, HighLevelTrigger, OneIsolatedMuon, LooseMuonVeto, LooseElectronVeto, AtLeastOneGoodJets, AtLeastTwoGoodJets, AtLeastThreeGoodJets, AtLeastFourGoodJets, MissingTransverseEnergy, AsymmetricJetCuts, AtLeastOneBtag, AtLeastTwoBtags, NUMBER_OF_SELECTION_STEPS }; const std::string StringSteps[NUMBER_OF_SELECTION_STEPS] = { "Event cleaning", "High Level Trigger", "exactly one isolated muon", "loose muon veto", "electron veto", ">= 1 jets", ">= 2 jets", ">= 3 jets", ">= 4 jets", "MET > 20GeV", "jet pT: 1st > 70 GeV, 2nd > 50 GeV", ">=1 SSV b-tag", ">=2 SSV b-tag" }; } /** * @deprecated * Do not use this class any more */ class TopPairEventCandidate: public Event { protected: //// static double const matched_angle;// = 0.945666; //// static double const matched_angle_sigma;// = 0.311091; // static double const matched_leptonic_top_mass; // = 178.377; // static double const matched_leptonic_top_mass_sigma; // = 31.050; // static double const matched_hadronic_W_mass; // = 89.9153; // static double const matched_hadronic_W_mass_sigma; // = 13.8711; // static double const matched_hadronic_top_mass; // = 182.191; // static double const matched_hadronic_top_mass_sigma; // = 22.1484; //// static double const matched_ptratio;// = 0.18552; //// static double const matched_ptratio_sigma;// = 0.401973; // static double const matched_pt_ttbarSystem; // = 0.0760939; // static double const matched_pt_ttbarSystem_sigma; // = 0.0700391; // static double const matched_HTSystem; // = 1; // static double const matched_HTSystem_sigma; // = 0.1; // static double const W_mass; ElectronPointer electronFromW; JetPointer leptonicBJet, hadronicBJet, jet1FromW, jet2FromW; ParticlePointer neutrino1, neutrino2, leptonicW1, leptonicW2, hadronicW, leptonicTop1, leptonicTop2, hadronicTop, ttbarResonance; unsigned short selectedNeutrino, currentSelectedNeutrino, hadronicBIndex, leptonicBIndex, jet1FromWIndex, jet2FromWIndex; // bool doneReconstruction_; // ConversionTaggerPointer conversionTagger; // bool doneConversionTagging; std::vector<TtbarHypothesisPointer> solutions; compare_totalChi2 compareSolutions; public: // static NeutrinoSelectionCriterion::value usedNeutrinoSelection; // static TTbarReconstructionCriterion::value usedTTbarReconstruction; TopPairEventCandidate(); TopPairEventCandidate(const Event& event); virtual ~TopPairEventCandidate(); const JetPointer getLeptonicBJet() const; const JetPointer getHadronicBJet() const; const JetPointer getJet1FromHadronicW() const; const JetPointer getJet2FromHadronicW() const; const ElectronPointer getElectronFromWDecay() const; const ParticlePointer getNeutrinoFromWDecay() const; const ParticlePointer getLeptonicW() const; const ParticlePointer getHadronicW() const; const ParticlePointer getLeptonicTop() const; const ParticlePointer getHadronicTop() const; const ParticlePointer getResonance() const; double mttbar() const; double sumPt() const; double HT(unsigned short jetLimit) const; double fullHT() const; double transverseWmass(const ElectronPointer electron) const; double HTSystem() const; double PtRatio() const; double PtTtbarSystem(unsigned short neutrinoSolution) const; const boost::array<double, 2> computeNeutrinoPz(); void inspectReconstructedEvent() const; const std::vector<TtbarHypothesisPointer>& Solutions() const; }; typedef boost::shared_ptr<TopPairEventCandidate> TopPairEventCandidatePtr; //TODO: make this class simpler struct InterestingEvent { public: BAT::TopPairEventCandidatePtr candidate; // unsigned long runNumber, eventNumber; std::string fileName; InterestingEvent(unsigned long run, unsigned long event, std::string file) : candidate(), // // runNumber(run), // // eventNumber(event), // fileName(file) { } InterestingEvent(BAT::TopPairEventCandidatePtr cand, std::string file) : candidate(cand), // // runNumber(cand.runnumber()), // // eventNumber(cand.eventnumber()), // fileName(file) { } ~InterestingEvent() { } void print() { std::cout << "run " << candidate->runnumber() << ", event " << candidate->eventnumber() << " (Mttbar: " << candidate->mttbar() << ")" << std::endl; std::cout << "located in: " << fileName << std::endl << std::endl; } }; } #endif /* TOPPAIREVENTCANDIDATE_H_ */
0.988281
high
groups/btl/btls/btls_reservationguard.h
apaprocki/bde
1
801473
<reponame>apaprocki/bde // btls_reservationguard.h -*-C++-*- // ---------------------------------------------------------------------------- // NOTICE // // This component is not up to date with current BDE coding standards, and // should not be used as an example for new development. // ---------------------------------------------------------------------------- #ifndef INCLUDED_BTLS_RESERVATIONGUARD #define INCLUDED_BTLS_RESERVATIONGUARD #ifndef INCLUDED_BSLS_IDENT #include <bsls_ident.h> #endif BSLS_IDENT("$Id: $") //@PURPOSE: Provide a generic proctor for rate controlling objects. // //@CLASSES: // btls::ReservationGuard: a guard for reserving resources from rate limiters. // //@SEE_ALSO: btls_leakybucket, btls_ratelimiter // //@DESCRIPTION: This component provides generic proctor to automatically // reserve and release units from a rate controlling object. The rate // controlling object can be of any type (typically either a // 'btls::RateLimiter' or 'btls::LeakyBucket') that provides the following // methods: //.. // void reserve(bsls::Types::Uint64 numOfUnits); // void submitReserved(bsls::Types::Uint64 numOfUnits); // void cancelReserved(bsls::Types::Uint64 numOfUnits); //.. // Use 'btls::ReservationGuard' to ensure that reserved units will be correctly // returned to a rate controlling object in a programming scope. Note that // 'btls::ReservationGuard' does not assume ownership of the rate controlling // object. // ///Usage ///----- // This section illustrates the intended use of this component. // ///Example 1: Guarding units reservation in operations with btls::LeakyBucket ///-------------------------------------------------------------------------- // Suppose that we are limiting the rate of network traffic generation using a // 'btls::LeakyBucket' object. We send data buffer over a network interface // using the 'mySendData' function: //.. // static bsls::Types::Uint64 mySendData(size_t dataSize) // // Send a specified 'dataSize' amount of data over the network. Return // // the amount of data actually sent. Throw an exception if a network // // failure is detected. // { // // In our example we don`t deal with actual data sending, so we assume // // that the function has sent certain amount of data (3/4 of the // // requested amount) successfully. // return (dataSize * 3) >> 2; // } //.. // Notice that the 'mySendData' function may throw an exception; therefore, we // should wait until 'mySendData' returns before indicating the amount of data // sent to the leaky bucket. // // Further suppose that multiple threads are sending network data and sharing // the same leaky bucket. If every thread simply checks for overflowing of the // leaky bucket, send data, and then submit to the leaky bucket, then the rate // of data usage may exceed the limits imposed by the leaky bucket due to race // conditions. We can avoid this issue by reserving the amount of data // immediately after checking whether the leaky bucket has overflown and submit // the reserved amount after the data has been sent. However, this process // could lead to the loss of the reserved units (effectively decreasing the // leaky bucket's capacity) if 'mySendData' throws an exception. // 'btls::ReservationGuard' is designed to resolve this issue. // // First, we define the size of each data chunk and the total size of the data // to send: //.. // const unsigned int CHUNK_SIZE = 256; // bsls::Types::Uint64 bytesSent = 0; // bsls::Types::Uint64 totalSize = 10 * 1024; // in bytes //.. // Then, we create a 'btls::LeakyBucket' object to limit the rate of data // transmission: //.. // bsls::Types::Uint64 rate = 512; // bsls::Types::Uint64 capacity = 1536; // bsls::TimeInterval now = bdlt::CurrentTime::now(); // btls::LeakyBucket bucket(rate, capacity, now); //.. // Next, we send the chunks of data using a loop. For each iteration, we check // whether submitting another byte would cause the leaky bucket to overflow: //.. // while (bytesSent < totalSize) { // now = bdlt::CurrentTime::now(); // if (!bucket.wouldOverflow(now)) { //.. // Now, if the leaky bucket would not overflow, we create a // 'btls::ReservationGuard' object to reserve the amount of data to be sent: //.. // btls::ReservationGuard<btls::LeakyBucket> guard(&bucket, // CHUNK_SIZE); //.. // Then, we use the 'mySendData' function to send the data chunk over the // network. After the data had been sent, we submit the amount of reserved // data that was actually sent: //.. // bsls::Types::Uint64 result; // result = mySendData(CHUNK_SIZE); // bytesSent += result; // guard.submitReserved(result); //.. // Note that we do not have manually cancel any remaining units reserved by the // 'btls::ReservationGuard' object either because 'mySendData' threw an // exception, or the data was only partially sent, because when the guard // object goes out of scope, all remaining reserved units will be automatically // cancelled. //.. // } //.. // Finally, if submitting another byte will cause the leaky bucket to overflow, // then we wait until the submission will be allowed by waiting for an amount // time returned by the 'calculateTimeToSubmit' method: //.. // else { // bsls::TimeInterval timeToSubmit = // bucket.calculateTimeToSubmit(now); // bsls::Types::Uint64 uS = timeToSubmit.totalMicroseconds() + // (timeToSubmit.nanoseconds() % 1000) ? 1 : 0; // bslmt::ThreadUtil::microSleep(static_cast<int>(uS)); // } // } //.. #ifndef INCLUDED_BTLSCM_VERSION #include <btlscm_version.h> #endif #ifndef INCLUDED_BSLS_ASSERT #include <bsls_assert.h> #endif #ifndef INCLUDED_BSLS_TYPES #include <bsls_types.h> #endif namespace BloombergLP { namespace btls { // ====================== // class ReservationGuard // ====================== template<class TYPE> class ReservationGuard { // This class template implements a proctor for reserving and cancelling // units in a rate controlling object. // // This class: //: o is *exception* *neutral* (agnostic) //: o is *const* *thread-safe* // For terminology see 'bsldoc_glossary'. // DATA TYPE *d_rateController_p; // Pointer to the rate // controlling object in which // the units are reserved. bsls::Types::Uint64 d_unitsReserved; // Number of units reserved by // this object. private: // NOT IMPLEMENTED ReservationGuard(); ReservationGuard& operator =(const ReservationGuard<TYPE>&); ReservationGuard(const ReservationGuard<TYPE>&); public: // CREATORS ReservationGuard(TYPE* rateController, bsls::Types::Uint64 numUnits); // Create a 'ReservationGuard' object guarding the specified // 'rateController' and reserving the specified 'numUnits'. ~ReservationGuard(); // Destroy this object. Invoke the 'cancelReserved' method for the // remaining remaining units reserved by this proctor. // MANIPULATORS void submitReserved(bsls::Types::Uint64 numUnits); // Submit the specified 'numUnits' from the reserve units guarded by // this object. After this operation, the number of reserved units // guarded by this object will be reduced by 'numUnits'. The behavior // is undefined unless 'numUnits <= unitsReserved()'. void cancelReserved(bsls::Types::Uint64 numUnits); // Cancel the specified 'numUnits' from the reserve units guarded by // this object. Subtract the 'numUnits' from 'unitsReserved' and // invoke the 'cancelReserved' method on the guarded object for // 'numUnits'. After this operation, the number of reserved units // guarded by this object will be reduced by 'numUnits'. The behavior // is undefined unless 'numUnits <= unitsReserved()'. // ACCESSORS bsls::Types::Uint64 unitsReserved() const; // Return the number of units reserved by this object. TYPE *ptr() const; // Return a pointer to the rate controlling object used by this object. }; // ============================================================================ // INLINE DEFINITIONS // ============================================================================ // ---------------------- // class ReservationGuard // ---------------------- // CREATORS template <class TYPE> inline ReservationGuard<TYPE>::ReservationGuard(TYPE *rateController, bsls::Types::Uint64 numUnits) { BSLS_ASSERT_SAFE(0 != rateController); d_rateController_p = rateController; d_unitsReserved = numUnits; d_rateController_p->reserve(numUnits); } template <class TYPE> inline ReservationGuard<TYPE>::~ReservationGuard() { d_rateController_p->cancelReserved(d_unitsReserved); } // ACCESSORS template <class TYPE> inline bsls::Types::Uint64 ReservationGuard<TYPE>::unitsReserved() const { return d_unitsReserved; } template <class TYPE> inline TYPE *ReservationGuard<TYPE>::ptr() const { return d_rateController_p; } // MANIPULATORS template <class TYPE> inline void ReservationGuard<TYPE>::cancelReserved(bsls::Types::Uint64 numUnits) { BSLS_ASSERT_SAFE(numUnits <= d_unitsReserved); d_rateController_p->cancelReserved(numUnits); d_unitsReserved -= numUnits; } template <class TYPE> inline void ReservationGuard<TYPE>::submitReserved(bsls::Types::Uint64 numUnits) { BSLS_ASSERT_SAFE(numUnits <= d_unitsReserved); d_rateController_p->submitReserved(numUnits); d_unitsReserved -= numUnits; } } // close package namespace } // close enterprise namespace #endif // ---------------------------------------------------------------------------- // Copyright 2015 Bloomberg Finance L.P. // // 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. // ----------------------------- END-OF-FILE ----------------------------------
0.996094
high
Example/LXCProgressHUD/LXCTwoVcViewController.h
butterflyXX/LXCProgressHUD
0
801985
// // LXCTwoVcViewController.h // LXCProgressHUD_Example // // Created by 刘晓晨 on 2018/5/7. // Copyright © 2018年 butterflyXX. All rights reserved. // #import <UIKit/UIKit.h> @interface LXCTwoVcViewController : UIViewController @end
0.523438
high
osprey/libopen64rt/malloc_opt.c
sharugupta/OpenUH
0
802497
/* Copyright (C) 2009 Advanced Micro Devices, Inc. All Rights Reserved. The Open64 Runtime Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The Open64 Runtime 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 the Open64 Runtime Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include <malloc.h> #include <stdlib.h> void __pathscale_malloc_alg(int mode) { if (getenv("OPEN64_NO_MALLOC_ALG") != NULL) return; if (mode < 1) mode = 1; else if (mode > 4) { mode = 4; } switch (mode) { case 1: mallopt(M_MMAP_MAX, 0x2); mallopt(M_TRIM_THRESHOLD, 0x10000000); break; case 2: mallopt(M_MMAP_MAX, 0x2); mallopt(M_TRIM_THRESHOLD, 0x40000000); break; case 3: mallopt(M_MMAP_MAX, 0x0); mallopt(M_TRIM_THRESHOLD, 0xffffffff); break; case 4: mallopt(M_MMAP_MAX, 0x2); mallopt(M_TRIM_THRESHOLD, 0x10000000); break; } }
0.742188
high
include/MNIObjIO.h
ilwoolyu/MeshLib
31
803009
<reponame>ilwoolyu/MeshLib /************************************************* * MNIObjIO.h * * Release: March 2015 * Update: April 2015 * * University of North Carolina at Chapel Hill * Department of Computer Science * * <NAME>, <EMAIL> *************************************************/ #pragma once #include "MeshIO.h" using namespace std; class MNIObjIO: public MeshIO { public: MNIObjIO(void); MNIObjIO(const char *filename); ~MNIObjIO(void); void read(const char *filename); };
0.472656
high
SampleCode/WacomStylusDemoApp/WacomStylusDemoApp/WacomStylusDemoApp/ViewController.h
szshmri/wacom-device-kit-ios
2
803521
/////////////////////////////////////////////////////////////////////////////// // // DESCRIPTION // header for the view controller for the application. // // COPYRIGHT // Copyright (c) 2012 - 2020 Wacom Co., Ltd. // All rights reserved // /////////////////////////////////////////////////////////////////////////////// #import <UIKit/UIKit.h> #import "GLKit/GLKView.h" #import "drawingView.h" #import <WacomDevice/WacomDeviceFramework.h> @interface ViewController : UIViewController <UIPopoverPresentationControllerDelegate, WacomDiscoveryCallback, WacomStylusEventCallback> @property (strong, nonatomic) IBOutlet UISegmentedControl *toolBar; @property (strong, nonatomic) IBOutlet UILabel *versionLabel; @property (weak, nonatomic) IBOutlet drawingView *dV; - (IBAction) SegControlPerformAction:(id)sender_I; - (IBAction) showPrivacyMessage:(UIButton *)sender_I; - (IBAction) displayHandPositions:(UIButton*)sender_I; //WacomDiscoveryCallback ///notification method for when a device is connected. - (void) deviceConnected:(WacomDevice *)device_I; ///notification method for when a device is disconnected. - (void) deviceDisconnected:(WacomDevice *)device_I; ///notification method for when a device is discovered. - (void) deviceDiscovered:(WacomDevice *)device_I; ///notification method for when device discovery is not possible because bluetooth is powered off. ///this allows one to pop up a warning dialog to let the user know to turn on bluetooth. - (void) discoveryStatePoweredOff; //WacomStylusEventCallback ///notification method for when a new stylus event is ready. - (void) stylusEvent:(WacomStylusEvent *)stylusEvent_I; @end
0.65625
high
src/rrtext/io.h
StyXman/kgt
456
804033
/* * Copyright 2014-2017 <NAME> * * See LICENCE for the full copyright terms. */ #ifndef KGT_RRTEXT_IO_H #define KGT_RRTEXT_IO_H #include "../compiler_specific.h" struct ast_rule; extern int prettify; WARN_UNUSED_RESULT int rrutf8_output(const struct ast_rule *); WARN_UNUSED_RESULT int rrtext_output(const struct ast_rule *); #endif
0.847656
high
opt.h
signifi3d/fxor
0
804545
#include "fxor_types.h" #ifndef OPT_H #define OPT_H void parse_opts(const int argc, char ** argv, fxor_opts *opts, fxor_error *err_code); #endif
0.859375
low
include/owlext/pictdlg.h
pierrebestwork/owl-next
0
805057
//------------------------------------------------------------------- // OWL Extensions (OWLEXT) Class Library // Copyright(c) 1996 by <NAME>. // All rights reserved. // // TPictDialog // //------------------------------------------------------------------- #ifndef __OWLEXT_PICTDLG_H #define __OWLEXT_PICTDLG_H #ifndef __OWLEXT_CORE_H # include <owlext/core.h> // required for all OWLEXT headers #endif #include <owl/dialog.h> namespace OwlExt { // Generic definitions/compiler options (eg. alignment) preceeding the // definition of classes // #include <owl/preclass.h> //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // TPictDialog //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class OWLEXTCLASS TPictDialog : public owl::TDialog { // Object lifetime methods // public: TPictDialog(owl::TDib* dib, owl::TWindow* parent, owl::TResId resId, owl::TModule* module = 0); virtual ~TPictDialog(); // OWL overrides // protected: virtual TGetClassNameReturnType GetClassName(){ return _T("PictDlg"); } DECLARE_RESPONSE_TABLE(TPictDialog); virtual bool EvEraseBkgnd(HDC hdc); // Accessors // public: owl::TDib* GetDib() { return m_pdib; } // Mutators // public: owl::TDib* SetDib(owl::TDib* newDib); // Internal data // private: owl::TDib* m_pdib; }; // Generic definitions/compiler options (eg. alignment) following the // definition of classes #include <owl/posclass.h> } // OwlExt namespace #endif
0.988281
high
esp32/TinyZXESPectrumttgovga32/ZX-ESPectrum/dataFlash/gbsna.h
zxrepo/rpsubc8.ESP32TinyZXSpectrum
1
805569
<reponame>zxrepo/rpsubc8.ESP32TinyZXSpectrum #ifndef GB_SNA_H #define GB_SNA_H #include "sna/snaDiag48K.h" #include "sna/snaFantasy48K.h" #include "sna/snaSPpong48K.h" //#include "sna/snaManic48K.h" #include "sna/snaFire48K.h" //#include "sna/snaSilkwormKM48K.h" #include "sna/sna3Dcoolkm48K.h" #include "sna/snaAT4OPENKM48K.h" //#include "sna/snaBREDITORKM48K.h" #include "sna/snaSIPKA48K.h" #include "sna/snaMouseTestZxds48K.h" //#include "sna/snaArkanoid48K.h" #define max_list_sna_48 8 // #define max_list_sna_48 1 //sna 48K //Titulos static const char * gb_list_sna_48k_title[max_list_sna_48]={ "diag", "fantasy", "sppong", //"manic", "fire", //"Arkanoid", //"SilkWormKM", "3DcoolKm", "AT4openKM", //"BrEditorKM", "Sipka", "MouseTestZxds" //"EightOfNoise", //"WWTF" }; //Datos 48K sna static const unsigned char * gb_list_sna_48k_data[max_list_sna_48]={ gb_sna_diag_48k, gb_sna_fantasy_48k, gb_sna_sppong_48k, //gb_sna_manic_48k, gb_sna_fire_48k, //gb_sna_arkanoid_48k, //gb_sna_SILKWORMKM_48k, gb_3dcoolkm_48k, gb_sna_AT4OPENKM_48k, //gb_sna_BREDITORKM_48k, gb_sna_SIPKA_48K_H_48k, gb_sna_mouseTestZxds_48k // gb_sna_eightOfNoise_48k, // gb_sna_wwtf_48k }; #endif
0.878906
high
src/c-lib/scene_object.h
oprochazka/spiderAgonyRpg
0
806081
<gh_stars>0 // // Created by ondrej on 4.2.18. // #ifndef C_LIB_SCENE_OBJECT_H #define C_LIB_SCENE_OBJECT_H typedef struct ERPG_Scene_object { int id; const char * type; void * value; } ERPG_Scene_object; #endif //C_LIB_SCENE_OBJECT_H
0.867188
high
CI/rule/pclint/pclint_include/include_linux/c++/4.8.2/javax/swing/text/Utilities.h
chewaiwai/huaweicloud-sdk-c-obs
22
806593
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*- #ifndef __javax_swing_text_Utilities__ #define __javax_swing_text_Utilities__ #pragma interface #include <java/lang/Object.h> extern "Java" { namespace java { namespace awt { class FontMetrics; class Graphics; } } namespace javax { namespace swing { namespace text { class Element; class JTextComponent; class Segment; class TabExpander; class Utilities; } } } } class javax::swing::text::Utilities : public ::java::lang::Object { public: Utilities(); static jint drawTabbedText(::javax::swing::text::Segment *, jint, jint, ::java::awt::Graphics *, ::javax::swing::text::TabExpander *, jint); static jint getTabbedTextWidth(::javax::swing::text::Segment *, ::java::awt::FontMetrics *, jint, ::javax::swing::text::TabExpander *, jint); static jint getTabbedTextOffset(::javax::swing::text::Segment *, ::java::awt::FontMetrics *, jint, jint, ::javax::swing::text::TabExpander *, jint, jboolean); static jint getTabbedTextOffset(::javax::swing::text::Segment *, ::java::awt::FontMetrics *, jint, jint, ::javax::swing::text::TabExpander *, jint); static jint getNextWord(::javax::swing::text::JTextComponent *, jint); static jint getPreviousWord(::javax::swing::text::JTextComponent *, jint); static jint getWordStart(::javax::swing::text::JTextComponent *, jint); static jint getWordEnd(::javax::swing::text::JTextComponent *, jint); static jint getRowEnd(::javax::swing::text::JTextComponent *, jint); static jint getRowStart(::javax::swing::text::JTextComponent *, jint); static jint getBreakLocation(::javax::swing::text::Segment *, ::java::awt::FontMetrics *, jint, jint, ::javax::swing::text::TabExpander *, jint); static ::javax::swing::text::Element * getParagraphElement(::javax::swing::text::JTextComponent *, jint); static jint getPositionAbove(::javax::swing::text::JTextComponent *, jint, jint); static jint getPositionBelow(::javax::swing::text::JTextComponent *, jint, jint); public: // actually package-private static jint getNextVisualPositionFrom(::javax::swing::text::JTextComponent *, jint, jint); public: static ::java::lang::Class class$; }; #endif // __javax_swing_text_Utilities__
0.957031
high
Coda/src/nlp-stack/Dictionary/DictionaryTrieModelElement.h
Samsung/veles.nlp
8
807105
<filename>Coda/src/nlp-stack/Dictionary/DictionaryTrieModelElement.h<gh_stars>1-10 /** * DictionaryTrieModelElement.h * Class DictionaryTrieModelElement * * .. invisible: * _ _ _____ _ _____ _____ * * | | | | ___| | | ___/ ___| * * | | | | |__ | | | |__ \ `--. * * | | | | __|| | | __| `--. \ * * \ \_/ / |___| |___| |___/\__/ / * * \___/\____/\_____|____/\____/ * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License * */ //#pragma warning( disable: 4018 ) #ifndef _DICTIONARYTRIEMODELELEMENT_H_ #define _DICTIONARYTRIEMODELELEMENT_H_ #include "DictionaryDataTypes.h" /** * Class DictionaryTrieModelElement : */ class DictionaryTrieModelElement { public : DictionaryTrieModelElement(void); ~DictionaryTrieModelElement(void); /** * @brief get suffix of model element */ wstring * getSuffix() { return &suffix; } /** * @brief set suffix to model element */ void setSuffix(const wstring & _suffix) { suffix = _suffix; } /** * @brief get featureListId */ int getFeatureListId(void) { return featureListId;} /** * @brief set featureListId */ void setFeatureListId(int _featureListId) { featureListId = _featureListId;} /** * @brief true if word of model element begins with PO */ bool isBeginWithPo(void) { return beginWithPo; } /** * @brief word of model element begins with PO */ void setBeginWithPo(bool _beginWithPo) { beginWithPo = _beginWithPo; } /** * @brief a DictionaryTrieModelElement is valid if suffix is not empty or have 1 or more attributes */ bool isValid(void) { return (suffix.length() > 0 || featureListId >= 0); } private: // suffix of DictionaryTrieModelElement wstring suffix; // attributes of DictionaryTrieModelElement int featureListId; // true if word begins with prefix PO bool beginWithPo; }; #endif /* _DICTIONARYTRIEMODELELEMENT_H_ */
0.996094
high
Example/BKMVVMKit/ExTableViewController/BKRoleManagerViewController.h
isingle/BKMVVMKit
13
807617
// // BKRoleManagerViewController.h // Pods // // Created by lic on 2019/8/27. // #import <UIKit/UIKit.h> #import "BKVMTableController.h" NS_ASSUME_NONNULL_BEGIN @interface BKRoleManagerViewController : BKVMTableController @end NS_ASSUME_NONNULL_END
0.507813
high
src/utility/Parameters.h
pictools/pica-demo
0
808129
<gh_stars>0 #ifndef PICA_DEMO_UTILITY_PARAMETERS_H #define PICA_DEMO_UTILITY_PARAMETERS_H #include "pica/math/Vectors.h" #include "pica/particles/Ensemble.h" #include "pica/particles/ParticleArray.h" #include <string> using pica::Constants; using pica::FP3; using pica::Int3; namespace utility { struct DemoParameters { Int3 numCells; int numIterations; int particlesPerCell; int numParticleTypes; Int3 numCellsPerSupercell; int tileSize; int numThreads; std::string outputDir; int outputPeriod; int outputResolutionWidth; int outputResolutionHeight; FP3 minPosition; FP3 maxPosition; double dt; double A; double L; double NumPerL_Debay; int NumPerPlasmaPeriod; double NumPerCell; int MatrixSize; int NumPeriods; double SpaceStep; double L_Debay; double Temp; double Density; double w_p; double Amp; double particlesFactor; }; DemoParameters getParameters() { DemoParameters parameters; parameters.A = 0.05; parameters.L = 1.0; parameters.NumPerL_Debay = 0.5; parameters.NumPerPlasmaPeriod = 256; parameters.NumPerCell = 30; parameters.MatrixSize = 64; parameters.NumPeriods = parameters.MatrixSize / (2.0 * sqrt(2.0) * Constants<double>::pi() * parameters.NumPerL_Debay); parameters.SpaceStep = parameters.L / parameters.MatrixSize; parameters.L_Debay = parameters.SpaceStep * parameters.NumPerL_Debay; parameters.Temp = 1e-2 * Constants<double>::electronMass() * Constants<double>::c() * Constants<double>::c(); parameters.Density = parameters.Temp / (8 * Constants<double>::pi() * Constants<double>::electronCharge() * parameters.L_Debay * Constants<double>::electronCharge() * parameters.L_Debay); parameters.w_p = sqrt(4 * Constants<double>::pi() * Constants<double>::electronCharge() * Constants<double>::electronCharge() * parameters.Density / Constants<double>::electronMass()); parameters.dt = 2 * (Constants<double>::pi() / parameters.w_p) / parameters.NumPerPlasmaPeriod; parameters.Amp = 2 * parameters.L * parameters.Density * Constants<double>::electronCharge() * parameters.A; parameters.numCells = Int3(parameters.MatrixSize, parameters.MatrixSize / 8, parameters.MatrixSize / 8); parameters.numIterations = parameters.NumPerPlasmaPeriod * parameters.NumPeriods; parameters.outputPeriod = 16; parameters.outputResolutionWidth = 256; parameters.outputResolutionHeight = 256; parameters.numCellsPerSupercell = Int3(2, 2, 2); parameters.minPosition = FP3(0.0, 0.0, 0.0); parameters.maxPosition = FP3(parameters.L, parameters.L / 8.0, parameters.L / 8.0); FP3 step = (parameters.maxPosition - parameters.minPosition) / (FP3(parameters.numCells)); parameters.particlesFactor = parameters.Density * step.volume() / parameters.NumPerCell; parameters.numThreads = omp_get_max_threads(); return parameters; } } // namespace utility #endif
0.984375
high
ccontainer/cdeque.c
hmito/hmLib
0
808641
#ifndef HMLIB_CDEQUE_C_INC #define HMLIB_CDEQUE_C_INC 200 # #ifndef HMLIB_CDEQUE_INC # include <hmLib/cdeque.h> #endif #ifdef __cplusplus extern "C"{ #endif #include <stdlib.h> #ifdef __cplusplus } #endif #ifdef __cplusplus namespace hmLib{ extern "C"{ #endif void _cdeque_default_destructor(hmLib_pointer Ptr) { free(Ptr); } //メモリの初期化 void cdeque_format(hmLib_cdeque* ptr){ ptr->ElemSize=0; ptr->BufBegin=0; ptr->BufEnd=0; ptr->Begin=0; ptr->End=0; ptr->Destructor=0; } //すでに初期化されたかどうかの確認 hmLib_boolian cdeque_is_construct(hmLib_cdeque* ptr){ return ptr->BufBegin==0; } //動的確保によってバッファ確保 void cdeque_construct(hmLib_cdeque* pDque, hmLib_cdeque_size_t Size, hmLib_cdeque_size_t ElemSize) { pDque->ElemSize=ElemSize; pDque->BufBegin=malloc(ElemSize*(Size+1)); pDque->BufEnd=(hmLib_uint8*)(pDque->BufBegin)+ElemSize*(Size+1); pDque->Begin=pDque->BufBegin; pDque->End=pDque->BufBegin; pDque->Destructor=_cdeque_default_destructor; } //静的確保によってバッファ確保 void cdeque_placement_construct(hmLib_cdeque* pDque, hmLib_cdeque_size_t Size, hmLib_cdeque_size_t ElemSize, hmLib_pointer Ptr, hmLib_vFp_p Destructor) { pDque->ElemSize=ElemSize; pDque->BufBegin=Ptr; pDque->BufEnd=(hmLib_uint8*)(Ptr)+ElemSize*(Size); pDque->Begin=pDque->BufBegin; pDque->End=pDque->BufBegin; pDque->Destructor=Destructor; } //バッファ解放 void cdeque_destruct(hmLib_cdeque* pDque){ if(pDque->Destructor) { pDque->Destructor(pDque->BufBegin); } pDque->BufBegin=0; pDque->BufEnd=0; pDque->Begin=0; pDque->End=0; } //move void cdeque_move(hmLib_cdeque* from, hmLib_cdeque* to){ to->Destructor=from->Destructor; to->ElemSize=from->ElemSize; to->Begin=from->Begin; to->End=from->End; to->BufBegin=from->BufBegin; to->BufEnd=from->BufEnd; cdeque_format(from); } //copy void cdeque_swap(hmLib_cdeque* ptr1,hmLib_cdeque* ptr2){ hmLib_cdeque tmp; tmp.Destructor=ptr1->Destructor; tmp.ElemSize=ptr1->ElemSize; tmp.Begin=ptr1->Begin; tmp.End=ptr1->End; tmp.BufBegin=ptr1->BufBegin; tmp.BufEnd=ptr1->BufEnd; ptr1->Destructor=ptr2->Destructor; ptr1->ElemSize=ptr2->ElemSize; ptr1->Begin=ptr2->Begin; ptr1->End=ptr2->End; ptr1->BufBegin=ptr2->BufBegin; ptr1->BufEnd=ptr2->BufEnd; ptr2->Destructor=tmp.Destructor; ptr2->ElemSize=tmp.ElemSize; ptr2->Begin=tmp.Begin; ptr2->End=tmp.End; ptr2->BufBegin=tmp.BufBegin; ptr2->BufEnd=tmp.BufEnd; } //バッファの先頭の要素アドレスを取得 void* cdeque_frontptr(hmLib_cdeque* pDque){return pDque->Begin;} //バッファの末尾の要素アドレスを取得 void* cdeque_backptr(hmLib_cdeque* pDque){return cdeque_prev(pDque,pDque->End);} //バッファにデータを挿入 hmLib_boolian cdeque_push_front(hmLib_cdeque* pDque,const void* Ptr){ hmLib_cdeque_size_t cnt=0; if(cdeque_full(pDque))return 1; pDque->Begin=cdeque_prev(pDque,pDque->Begin); for(cnt=0;cnt<pDque->ElemSize;++cnt){ *((hmLib_uint8*)(pDque->Begin)+cnt)=*((hmLib_uint8*)(Ptr)+cnt); } return 0; } //バッファの先頭のデータ削除 hmLib_boolian cdeque_pop_front(hmLib_cdeque* pDque){ if(cdeque_empty(pDque))return 1; pDque->Begin=cdeque_next(pDque,pDque->Begin); return 0; } //バッファの末尾にデータを挿入 hmLib_boolian cdeque_push_back(hmLib_cdeque* pDque,const void* Ptr){ hmLib_cdeque_size_t cnt=0; if(cdeque_full(pDque))return 1; for(cnt=0;cnt<pDque->ElemSize;++cnt){ *((hmLib_uint8*)(pDque->End)+cnt)=*((hmLib_uint8*)(Ptr)+cnt); } pDque->End=cdeque_next(pDque,pDque->End); return 0; } //バッファの末尾のデータ削除 hmLib_boolian cdeque_pop_back(hmLib_cdeque* pDque){ if(cdeque_empty(pDque))return 1; pDque->End=cdeque_prev(pDque,pDque->End); return 0; } //バッファに入っているサイズ hmLib_cdeque_size_t cdeque_size(hmLib_cdeque* pDque){return (((hmLib_uint8*)(pDque->End)-(hmLib_uint8*)(pDque->Begin)+(hmLib_uint8*)(pDque->BufEnd)-(hmLib_uint8*)(pDque->BufBegin))%((hmLib_uint8*)(pDque->BufEnd)-(hmLib_uint8*)(pDque->BufBegin)))/pDque->ElemSize;} //バッファに入っているサイズ hmLib_cdeque_size_t cdeque_rest(hmLib_cdeque* pDque){return ((hmLib_uint8*)(pDque->BufEnd)-(hmLib_uint8*)(pDque->BufBegin))/pDque->ElemSize-cdeque_size(pDque)-1;} //バッファが空かどうか確認 hmLib_boolian cdeque_empty(hmLib_cdeque* pDque){return (pDque->Begin==pDque->End);} //バッファがいっぱいかどうか確認 hmLib_boolian cdeque_full(hmLib_cdeque* pDque){return (pDque->Begin==cdeque_next(pDque,pDque->End));} //バッファのbegin関数 hmLib_cdeque_iterator cdeque_begin(hmLib_cdeque* pDque){return pDque->Begin;} //バッファのend関数 hmLib_cdeque_iterator cdeque_end(hmLib_cdeque* pDque){return pDque->End;} //hmLib_cdeque_iteratorの次のhmLib_cdeque_iteratorを返す hmLib_cdeque_iterator cdeque_next(hmLib_cdeque* pDque,hmLib_cdeque_iterator itr){ itr=(hmLib_uint8*)(itr)+pDque->ElemSize; if(pDque->BufEnd == itr)itr=pDque->BufBegin; return itr; } //hmLib_cdeque_iteratorの前のhmLib_cdeque_iteratorを返す hmLib_cdeque_iterator cdeque_prev(hmLib_cdeque* pDque,hmLib_cdeque_iterator itr){ if(pDque->BufBegin == itr)itr=pDque->BufEnd; itr=(hmLib_uint8*)(itr)-pDque->ElemSize; return itr; } #ifdef __cplusplus } //extern "C" } //namespace hmLib #endif # #endif
0.992188
high
PYBaseViews/Classes/Views/BaseNavBar/PYBaseNavigationBarView.h
LiPengYue/PYBaseView
10
809153
// // PYBaseNavigationBarView.h // FBSnapshotTestCase // // Created by 衣二三 on 2019/8/22. // #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN typedef void(^ClickNavTitle)(UIButton *button); typedef void(^CliekNavItem)(UIButton *button,NSInteger index); @interface PYBaseNavigationBarView : UIView /** 刷新UI */ - (void) reloadView; - (void) setUpWeakSelfFunc: (void(^)(PYBaseNavigationBarView *weak))block; /** 左边的buttons */ @property (nonatomic,strong,readonly) NSArray <UIButton *>*leftItems; /** 右边的buttons */ @property (nonatomic,strong,readonly) NSArray <UIButton *>*rightItems; /** title 替换 这个view 来 自定义 titleLabel */ @property (nonatomic,strong) UIButton *titleButton; #pragma mark - 插入item - (PYBaseNavigationBarView *(^)(UIButton *button)) addLeftItem; - (PYBaseNavigationBarView *(^)(UIButton *button)) addRightItem; // MARK: 根据 str 与 image 创建Button 并添加到数组 - (PYBaseNavigationBarView *(^)(NSString *str,UIImage *image)) addLeftItemWithTitleAndImg; - (PYBaseNavigationBarView *(^)(NSString *str,UIImage *image)) addRightItemWithTitleAndImg; - (PYBaseNavigationBarView *(^)(NSString *str,UIImage *image)) addTitleItemWithTitleAndImg; // MARK: 根据 attributedStr 创建button 并添加到数组 - (PYBaseNavigationBarView *(^)(NSAttributedString *str)) addLeftItemWithAttributedStr; - (PYBaseNavigationBarView *(^)(NSAttributedString *str)) addRightItemWithAttributedStr; - (PYBaseNavigationBarView *(^)(NSAttributedString *str)) addTitleItemWithAttributedStr; - (PYBaseNavigationBarView *) insertLeftItem: (UIButton *)button andIndex: (NSInteger)index; - (PYBaseNavigationBarView *) insertRightItem: (UIButton *)button andIndex: (NSInteger)index; - (PYBaseNavigationBarView *) removeLeftItemWithIndex: (NSInteger) index; - (PYBaseNavigationBarView *) removeRightItemWithIndex: (NSInteger) index; - (PYBaseNavigationBarView *) removeLeftAll; - (PYBaseNavigationBarView *) removeRightAll; #pragma mark - 点击事件 /** 点击了左边的按钮 */ - (void) clickLeftButtonFunc: (CliekNavItem) clickLeftItem; /** 点击了右边的按钮 */ - (void) clickRightButtonFunc: (CliekNavItem) clickRightItem; /** 点击了中间title的按钮 */ - (void) clickTitleButtonFunc: (ClickNavTitle) clickTitle; #pragma layout /** 整体布局的edg */ @property (nonatomic,assign) UIEdgeInsets itemsEdge; /** item 之间最小的间距 默认为14pt */ @property (nonatomic,assign) CGFloat itemsMinMargin; /** item 的高度 默认为24pt */ @property (nonatomic,assign) CGFloat itemHeight; /**item 的最小宽度 默认为44*/ @property (nonatomic,assign) CGFloat itemMinWidth; /** titleButton 的size */ @property (nonatomic,assign)CGFloat titleButtonWidth; @property (nonatomic,assign) CGFloat titleButtonHeight; - (UIButton *) getLeftItemWithIndex: (NSInteger) index; - (UIButton *) getRightItemWithIndex: (NSInteger) index; #pragma mark - bottom line @property (nonatomic,strong) UIView *bottomLineView; @property (nonatomic,assign) BOOL isHiddenBottomLine; /// bottomLineH @property (nonatomic,assign) CGFloat bottomLineH; @property (nonatomic,assign) CGFloat bottomLineRightSpacing; @property (nonatomic,assign) CGFloat bottomLineLeftSpacing; #pragma mark - 阴影 @property (nonatomic,assign) BOOL isHiddenShadow; @property (nonatomic,strong) CALayer *shadowLayer; @property (nonatomic,strong) UIFont *titleFont; @property (nonatomic,strong) UIFont *leftItemTextFont; @property (nonatomic,strong) UIFont *rightItemTextFont; /// item 子view 的对齐方式 @property (nonatomic,assign) UIControlContentVerticalAlignment leftVericalAlignment; @property (nonatomic,assign) UIControlContentVerticalAlignment rightVericalAlignment; @property (nonatomic,assign) UIControlContentVerticalAlignment titleVericalAlignment; @property (nonatomic,assign) UIControlContentHorizontalAlignment leftHorizontalAlignment; @property (nonatomic,assign) UIControlContentHorizontalAlignment rightHorizontalAlignment; @property (nonatomic,assign) UIControlContentHorizontalAlignment titleHorizontalAlignment; @end NS_ASSUME_NONNULL_END
0.992188
high
src/list.h
claytonkb/Babel
3
809665
<filename>src/list.h // list.h // #ifndef LIST_H #define LIST_H #define _new_cons(x) (_newin(x, 2)) // _new_cons# #define _new_dcons(x) (_newin(x, 3)) // _new_dcons# #define CDR_DIRECTION 0 #define CPR_DIRECTION 1 mword *_insls(bvm_cache *this_bvm, mword *src_list, mword *dest_list); mword *_dlist_end(bvm_cache *this_bvm, mword *list); mword *_insdls_prev(bvm_cache *this_bvm, mword *src_list, mword *dest_list); mword *_insdls(bvm_cache *this_bvm, mword *src_list, mword *dest_list); mword _len_dlist(bvm_cache *this_bvm, mword *list); //mword *_reverse_dlist(bvm_cache *this_bvm, mword *list, mword *head); mword *_reverse_dlist(bvm_cache *this_bvm, mword *list, mword *head, mword direction); mword *_dlist_cut(bvm_cache *this_bvm, mword *list, mword index, mword direction); mword *_append_direct_dlist(bvm_cache *this_bvm, mword *head_list, mword *tail_list); mword *_dcons(bvm_cache *this_bvm, mword *car, mword *cdr, mword *cpr); mword *_mkdls(bvm_cache *this_bvm, mword list_size, ...); mword *_mkls(bvm_cache *this_bvm, mword list_size, ...); mword *_cons(bvm_cache *this_bvm, mword *car, mword *cdr); void _push(bvm_cache *this_bvm, mword *list, mword *bs); mword *_pop(bvm_cache *this_bvm, mword *list); mword *_shift(bvm_cache *this_bvm, mword *list); mword _len(bvm_cache *this_bvm, mword *list); mword *_bons(bvm_cache *this_bvm, mword *list); mword *_ls2lf(bvm_cache *this_bvm, mword *list); mword *_lscat8(bvm_cache *this_bvm, mword *list); mword *_cdri(bvm_cache *this_bvm, mword *list, mword i); mword *_ith(bvm_cache *this_bvm, mword *list, mword i); mword *_reverse(bvm_cache *this_bvm, mword *list, mword *new_cdr); mword *_split(bvm_cache *this_bvm, mword *list, mword *indices); mword *_rsplit(bvm_cache *this_bvm, mword *list, mword *indices, mword count); mword *_list_end(bvm_cache *this_bvm, mword *list); mword *_list_next_to_end(bvm_cache *this_bvm, mword *list); mword *_list_cut(bvm_cache *this_bvm, mword *list, mword index); mword *_append(bvm_cache *this_bvm, mword *lists); mword *_append_direct(bvm_cache *this_bvm, mword *head_list, mword *tail_list); mword *_ar2ls(bvm_cache *this_bvm, mword *arr); mword *_unshift(bvm_cache *this_bvm, mword *list, mword *bs); mword *_unshift_op(bvm_cache *this_bvm, mword *list, mword *bs); bvm_cache *ith_rd(bvm_cache *this_bvm); bvm_cache *len_d(bvm_cache *this_bvm); bvm_cache *bons_d(bvm_cache *this_bvm); bvm_cache *car_rd(bvm_cache *this_bvm); bvm_cache *cdr_rd(bvm_cache *this_bvm); bvm_cache *cons_d(bvm_cache *this_bvm); bvm_cache *uncons_d(bvm_cache *this_bvm); bvm_cache *pop_d(bvm_cache *this_bvm); bvm_cache *push_d(bvm_cache *this_bvm); bvm_cache *shift_d(bvm_cache *this_bvm); bvm_cache *unshift_d(bvm_cache *this_bvm); bvm_cache *ls2lf_d(bvm_cache *this_bvm); bvm_cache *split_d(bvm_cache *this_bvm); bvm_cache *append_d(bvm_cache *this_bvm); bvm_cache *ins_d(bvm_cache *this_bvm); bvm_cache *rev_d(bvm_cache *this_bvm); bvm_cache *ar2ls_d(bvm_cache *this_bvm); // X(rsvd, "ar2ls_d", OP_AR2LS_D, 0x192) #endif //LIST_H // <NAME> 2013
0.953125
high
software/pc-emul/iob-timer-platform.c
codingUniv/iob-timer
0
810177
<reponame>codingUniv/iob-timer #include "iob-lib.h" #include "iob_timer_swreg.h" #include <time.h> /* convert clock values from PC CLOCK FREQ to EMBEDDED FREQ */ #define PC_TO_FREQ_FACTOR ((1.0*FREQ)/CLOCKS_PER_SEC) static clock_t start, end, time_counter, counter_reg; static int timer_enable; void pc_timer_reset(int value) { // use only reg width int rst_int = (value & 0x01); if(rst_int){ start = end = 0; time_counter = 0; timer_enable = 0; } return; } void pc_timer_enable(int value){ // use only reg width int en_int = (value & 0x01); // manage transitions // 0 -> 1 if(timer_enable == 0 && en_int == 1){ // start counting time start = clock(); } else if(timer_enable == 1 && en_int == 0){ // accumulate enable interval end = clock(); timer_enable += (end - start); start = end = 0; // reset aux clock values } // store enable en_int timer_enable = en_int; return; } void pc_timer_sample(int value) { // use only reg width int sample_int = (value & 0x01); if(sample_int){ counter_reg = time_counter; if(start != 0) counter_reg += (clock() - start); } return; } int pc_timer_data_high(){ /* convert clock from PC CLOCKS_PER_CYCLE to FREQ */ double counter_freq = (1.0*counter_reg)*PC_TO_FREQ_FACTOR; return ( (int) (((unsigned long long) counter_freq) >> 32)); } int pc_timer_data_low(){ /* convert clock from PC CLOCKS_PER_CYCLE to FREQ */ double counter_freq = (1.0*counter_reg)*PC_TO_FREQ_FACTOR; return ( (int) (((unsigned long long) counter_freq) & 0xFFFFFFFF)); } void MEM_SET(int type, int location, int value){ return; } int MEM_GET(int type, int location){ return 0; } void IO_SET(int base, int location, int value){ switch(location){ case TIMER_RESET: pc_timer_reset(value); break; case TIMER_ENABLE: pc_timer_enable(value); break; case TIMER_SAMPLE: pc_timer_sample(value); break; default: // do nothing break; } return; } int IO_GET(int base, int location){ int ret_val = 0; switch(location){ case TIMER_DATA_HIGH: ret_val = pc_timer_data_high(); break; case TIMER_DATA_LOW: ret_val = pc_timer_data_low(); break; default: // do nothing break; } return ret_val; }
0.921875
high
ai/wordChain/wordChain.c
CEpBrowser/CEpBrowser--from-UCSC-CGI-BIN
0
810689
<filename>ai/wordChain/wordChain.c /* wordChain - Create Markov chain of words. */ #include "common.h" #include "linefile.h" #include "hash.h" #include "localmem.h" #include "options.h" #include "dlist.h" #include "rbTree.h" int maxChainSize = 3; int minUse = 1; boolean lower = FALSE; boolean unpunc = FALSE; boolean fullOnly = FALSE; void usage() /* Explain usage and exit. */ { errAbort( "wordChain - Create Markov chain of words\n" "usage:\n" " wordChain in.txt\n" "options:\n" " -size=N - Set max chain size, default %d\n" " -chain=fileName - Write out word chain to file\n" " -nonsense=fileName - Write out predicted nonsense to file\n" " -lower - Lowercase all words\n" " -unpunc - Strip punctuation\n" " -fullOnly - Only output chains of size\n" " -minUse=N - Set minimum use in output chain, default %d\n" , maxChainSize, minUse ); } static struct optionSpec options[] = { {"size", OPTION_INT}, {"minUse", OPTION_INT}, {"nonsense", OPTION_STRING}, {"chain", OPTION_STRING}, {"lower", OPTION_BOOLEAN}, {"unpunc", OPTION_BOOLEAN}, {"fullOnly", OPTION_BOOLEAN}, {NULL, 0}, }; struct wordTree /* A tree of words. */ { struct rbTree *following; /* Binary tree of words that follow us. */ char *word; /* The word itself including comma, period etc. */ int useCount; /* Number of times word used. */ }; struct wordTree *wordTreeNew(char *word) /* Create and return new wordTree element. */ { struct wordTree *wt; AllocVar(wt); wt->word = cloneString(word); return wt; } int wordTreeCmpWord(void *va, void *vb) /* Compare two wordTree. */ { struct wordTree *a = va, *b = vb; return strcmp(a->word, b->word); } struct wordTree *wordTreeAddFollowing(struct wordTree *wt, char *word, struct lm *lm, struct rbTreeNode **stack) /* Make word follow wt in tree. If word already exists among followers * return it and bump use count. Otherwise create new one. */ { struct wordTree *w; if (wt->following == NULL) { wt->following = rbTreeNewDetailed(wordTreeCmpWord, lm, stack); w = NULL; } else { struct wordTree key; key.word = word; w = rbTreeFind(wt->following, &key); } if (w == NULL) { w = wordTreeNew(word); rbTreeAdd(wt->following, w); } w->useCount += 1; return w; } void addChainToTree(struct wordTree *wt, struct dlList *chain, struct lm *lm, struct rbTreeNode **stack) /* Add chain of words to tree. */ { struct dlNode *node; wt->useCount += 1; for (node = chain->head; !dlEnd(node); node = node->next) { char *word = node->val; verbose(2, " %s\n", word); wt = wordTreeAddFollowing(wt, word, lm, stack); } } void wordTreeDump(int level, struct wordTree *wt, FILE *f) /* Write out wordTree to file. */ { static char *words[64]; struct slRef *list, *ref; int i; assert(level < ArraySize(words)); words[level] = wt->word; if (wt->useCount >= minUse) { if (!fullOnly || level == maxChainSize) { fprintf(f, "%d\t", wt->useCount); for (i=1; i<=level; ++i) fprintf(f, "%s ", words[i]); fprintf(f, "\n"); } } if (wt->following != NULL) { list = rbTreeItems(wt->following); for (ref = list; ref != NULL; ref = ref->next) wordTreeDump(level+1, ref->val, f); slFreeList(&list); } } int totalUses = 0; int curUses = 0; int useThreshold = 0; char *pickedWord; void addUse(void *v) /* Add up to total uses. */ { struct wordTree *wt = v; totalUses += wt->useCount; } void pickIfInThreshold(void *v) /* See if inside threshold, and if so store it in pickedWord. */ { struct wordTree *wt = v; int top = curUses + wt->useCount; if (curUses <= useThreshold && useThreshold < top) pickedWord = wt->word; curUses = top; } char *pickRandomWord(struct rbTree *rbTree) /* Pick word from list randomly, but so that words more * commonly seen are picked more often. */ { pickedWord = NULL; curUses = 0; totalUses = 0; rbTreeTraverse(rbTree, addUse); rbTreeTraverse(rbTree, pickIfInThreshold); assert(pickedWord != NULL); return pickedWord; } char *predictNext(struct wordTree *wt, struct dlList *recent) /* Predict next word given list of recent words and wordTree. */ { struct dlNode *node; for (node = recent->head; !dlEnd(node); node = node->next) { char *word = node->val; struct wordTree key; key.word = word; wt = rbTreeFind(wt->following, &key); if (wt == NULL) errAbort("%s isn't a follower of %s\n", word, wt->word); } if (wt->following == NULL) return NULL; else return pickRandomWord(wt->following); } static void wordTreeMakeNonsense(struct wordTree *wt, int maxSize, char *firstWord, int wordCount, FILE *f) /* Go spew out a bunch of words according to probabilities in tree. */ { struct dlList *ll = dlListNew(); int listSize = 0; int i; for (;;) { struct dlNode *node; char *word; /* Get next predicted word. */ if (listSize == 0) { AllocVar(node); ++listSize; word = firstWord; } else if (listSize >= maxSize) { node = dlPopHead(ll); word = predictNext(wt, ll); } else { word = predictNext(wt, ll); AllocVar(node); ++listSize; } node->val = word; dlAddTail(ll, node); if (word == NULL) break; /* Output last word in list. */ { node = ll->tail; word = node->val; fprintf(f, "%s", word); if (word[strlen(word)-1] == '.') fprintf(f, "\n"); else fprintf(f, " "); } } dlListFree(&ll); } void wordChain(char *inFile, int maxSize) /* wordChain - Create Markov chain of words. */ { struct lineFile *lf = lineFileOpen(inFile, TRUE); FILE *f; char *line, *word, *firstWord = NULL; struct dlList *ll = dlListNew(); struct dlNode *node; int llSize = 0; struct wordTree *wt = wordTreeNew(""); int wordCount = 0; struct lm *lm = lmInit(0); struct rbTreeNode **stack; stack = lmAllocArray(lm, stack, 256); while (lineFileNext(lf, &line, NULL)) { if (lower) tolowers(line); while ((word = nextWord(&line)) != NULL) { if (unpunc) { stripChar(word, ','); stripChar(word, '.'); stripChar(word, ';'); stripChar(word, '-'); stripChar(word, '"'); stripChar(word, '?'); stripChar(word, '!'); stripChar(word, '('); stripChar(word, ')'); if (word[0] == 0) continue; } verbose(2, "%s\n", word); if (wordCount == 0) firstWord = cloneString(word); if (llSize < maxSize) { dlAddValTail(ll, cloneString(word)); ++llSize; if (llSize == maxSize) addChainToTree(wt, ll, lm, stack); } else { node = dlPopHead(ll); freeMem(node->val); node->val = cloneString(word); dlAddTail(ll, node); addChainToTree(wt, ll, lm, stack); } ++wordCount; } } if (llSize < maxSize) addChainToTree(wt, ll, lm, stack); while ((node = dlPopHead(ll)) != NULL) { addChainToTree(wt, ll, lm, stack); freeMem(node->val); freeMem(node); } dlListFree(&ll); lineFileClose(&lf); if (optionExists("chain")) { char *fileName = optionVal("chain", NULL); f = mustOpen(fileName, "w"); wordTreeDump(0, wt, f); carefulClose(&f); } if (optionExists("nonsense")) { char *fileName = optionVal("nonsense", NULL); FILE *f = mustOpen(fileName, "w"); wordTreeMakeNonsense(wt, maxSize, firstWord, wordCount, f); carefulClose(&f); } } int main(int argc, char *argv[]) /* Process command line. */ { optionInit(&argc, argv, options); if (argc != 2) usage(); maxChainSize = optionInt("size", maxChainSize); minUse = optionInt("minUse", minUse); lower = optionExists("lower"); unpunc = optionExists("unpunc"); fullOnly = optionExists("fullOnly"); wordChain(argv[1], maxChainSize); return 0; }
0.992188
high
platform/simplelink/network_sl.c
swan-solutions/aws-iot-device-sdk-embedded-C
1
811201
/* * Copyright Swan Solutions Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #include <network_interface.h> #include <aws_iot_error.h> #include "simplelink.h" #define SOCKET_TIMEOUT_VAL 5000 // Timeout period while waiting for non-blocking socket APIs #define SOCKET_POLL_INTERVAL 100 // Polling interval for non-blocking socket APIs extern uint32_t NetWiFi_isConnected(void); IoT_Error_t iot_tls_init(Network *pNetwork, char *pRootCALocation, char *pDeviceCertLocation, char *pDevicePrivateKeyLocation, char *pDestinationURL, uint16_t DestinationPort, uint32_t timeout_ms, bool ServerVerificationFlag) { if (pNetwork == NULL) { return NULL_VALUE_ERROR; } // Init TLS parameters pNetwork->tlsConnectParams.DestinationPort = DestinationPort; pNetwork->tlsConnectParams.pDestinationURL = pDestinationURL; pNetwork->tlsConnectParams.pDeviceCertLocation = pDeviceCertLocation; pNetwork->tlsConnectParams.pDevicePrivateKeyLocation = pDevicePrivateKeyLocation; pNetwork->tlsConnectParams.pRootCALocation = pRootCALocation; pNetwork->tlsConnectParams.timeout_ms = timeout_ms; pNetwork->tlsConnectParams.ServerVerificationFlag = ServerVerificationFlag; pNetwork->connect = iot_tls_connect; pNetwork->read = iot_tls_read; pNetwork->write = iot_tls_write; pNetwork->disconnect = iot_tls_disconnect; pNetwork->isConnected = iot_tls_is_connected; pNetwork->destroy = iot_tls_destroy; pNetwork->tlsDataParams.ssock = NULL; return SUCCESS; } IoT_Error_t iot_tls_connect(Network *pNetwork, TLSConnectParams *TLSParams) { IoT_Error_t rc = SUCCESS; unsigned long ip; int skt = 0; SlSockAddrIn_t address; TLSConnectParams *tlsParams; long lRetVal = -1; long lNonBlocking = 1; long timeout = SOCKET_TIMEOUT_VAL; if (pNetwork == NULL) { return (NULL_VALUE_ERROR); } // Use TLS params in Network struct tlsParams = &pNetwork->tlsConnectParams; // Open a secure socket skt = sl_Socket(SL_AF_INET,SL_SOCK_STREAM, SL_SEC_SOCKET); if (skt < 0) return NETWORK_ERR_NET_SOCKET_FAILED; // Configure socket to be non-blocking lRetVal = sl_SetSockOpt(skt, SL_SOL_SOCKET, SL_SO_NONBLOCKING, &lNonBlocking, sizeof(lNonBlocking)); if(lRetVal < 0) { rc = NETWORK_SSL_INIT_ERROR; goto QUIT; } // Configure the socket with CA certificate - for server verification lRetVal = sl_SetSockOpt(skt, SL_SOL_SOCKET, SL_SO_SECURE_FILES_CA_FILE_NAME, tlsParams->pRootCALocation, strlen(tlsParams->pRootCALocation)); if(lRetVal < 0) { rc = NETWORK_SSL_INIT_ERROR; goto QUIT; } // Configure the socket with client certificate lRetVal = sl_SetSockOpt(skt, SL_SOL_SOCKET, SL_SO_SECURE_FILES_CERTIFICATE_FILE_NAME, tlsParams->pDeviceCertLocation, strlen(tlsParams->pDeviceCertLocation)); if(lRetVal < 0) { rc = NETWORK_SSL_INIT_ERROR; goto QUIT; } // Configure the socket with private key lRetVal = sl_SetSockOpt(skt, SL_SOL_SOCKET, SL_SO_SECURE_FILES_PRIVATE_KEY_FILE_NAME, tlsParams->pDevicePrivateKeyLocation, strlen(tlsParams->pDevicePrivateKeyLocation)); if(lRetVal < 0) { rc = NETWORK_SSL_INIT_ERROR; goto QUIT; } // Securely verify domain name lRetVal = sl_SetSockOpt(skt, SL_SOL_SOCKET, SO_SECURE_DOMAIN_NAME_VERIFICATION, tlsParams->pDestinationURL, strlen(tlsParams->pDestinationURL)); if(lRetVal < 0) { rc = NETWORK_ERR_NET_UNKNOWN_HOST; goto QUIT; } // Get host IP lRetVal = sl_NetAppDnsGetHostByName((signed char *)tlsParams->pDestinationURL, strlen(tlsParams->pDestinationURL), (unsigned long*)&ip, SL_AF_INET); if(lRetVal < 0) { rc = NETWORK_ERR_NET_UNKNOWN_HOST; goto QUIT; } // Configure host address address.sin_family = SL_AF_INET; address.sin_port = sl_Htons(tlsParams->DestinationPort); address.sin_addr.s_addr = sl_Htonl(ip); // Connect to server while(1) { lRetVal = sl_Connect(skt, (SlSockAddr_t *)&address, sizeof(address)); if(lRetVal != SL_EALREADY) break; // Wait a bit osi_Sleep(SOCKET_POLL_INTERVAL); // Check for timeout while sending timeout -= SOCKET_POLL_INTERVAL; if(timeout <= 0) break; } if(lRetVal < 0) { rc = NETWORK_ERR_NET_CONNECT_FAILED; goto QUIT; } QUIT: if(rc == SUCCESS) { // Store successful socket connection pNetwork->tlsDataParams.ssock = skt; } else { // Free socket memory if socket was opened if (skt >= 0) sl_Close(skt); // Clear socket handle from network parameters pNetwork->tlsDataParams.ssock = NULL; } // Return return rc; } IoT_Error_t iot_tls_is_connected(Network *pNetwork) { return ((IoT_Error_t)NetWiFi_isConnected()); } IoT_Error_t iot_tls_write(Network *pNetwork, unsigned char *pMsg, size_t len, Timer *timer, size_t *numbytes) { int ssock = NULL; int bytes = 0; if (pNetwork == NULL || pMsg == NULL || pNetwork->tlsDataParams.ssock == NULL || numbytes == NULL) { return NULL_VALUE_ERROR; } ssock = pNetwork->tlsDataParams.ssock; int timeout = SOCKET_TIMEOUT_VAL; while(1) { // Try to send data over socket bytes = sl_Send(ssock, pMsg, len, 0); if(bytes != SL_EAGAIN) break; // Wait a bit osi_Sleep(SOCKET_POLL_INTERVAL); // Check for timeout while sending timeout -= SOCKET_POLL_INTERVAL; if(timeout <= 0) { *numbytes = 0; return NETWORK_SSL_WRITE_ERROR; } } if (bytes > 0) { *numbytes = (size_t)bytes; return SUCCESS; } return NETWORK_SSL_WRITE_ERROR; } IoT_Error_t iot_tls_read(Network *pNetwork, unsigned char *pMsg, size_t len, Timer *timer, size_t *numbytes) { int bytes = 0; SlTimeval_t tv; int ssock = NULL; uint32_t timeout; if (pNetwork == NULL || pMsg == NULL || pNetwork->tlsDataParams.ssock == NULL || timer == NULL || numbytes == NULL) { return (NULL_VALUE_ERROR); } ssock = pNetwork->tlsDataParams.ssock; timeout = left_ms(timer); if (timeout == 0) { /* sock timeout of 0 == block forever; just read + return if expired */ timeout = 1; } tv.tv_sec = 0; tv.tv_usec = timeout * 1000; if (sl_SetSockOpt(ssock, SL_SOL_SOCKET, SL_SO_RCVTIMEO, (char *)&tv, sizeof(tv)) == 0) { bytes = sl_Recv(ssock, pMsg, len, 0); if (bytes > 0) { *numbytes = (size_t)bytes; return SUCCESS; } else if (bytes == SL_EAGAIN) { // nothing to read in the socket buffer return NETWORK_SSL_NOTHING_TO_READ; } } return NETWORK_SSL_READ_ERROR; } IoT_Error_t iot_tls_disconnect(Network *pNetwork) { int ssock = NULL; if (pNetwork == NULL || pNetwork->tlsDataParams.ssock == NULL) { return (NULL_VALUE_ERROR); } ssock = pNetwork->tlsDataParams.ssock; sl_Close(ssock); return SUCCESS; } IoT_Error_t iot_tls_destroy(Network *pNetwork) { if (pNetwork == NULL) { return (NULL_VALUE_ERROR); } pNetwork->connect = NULL; pNetwork->read = NULL; pNetwork->write = NULL; pNetwork->disconnect = NULL; pNetwork->isConnected = NULL; pNetwork->destroy = NULL; return SUCCESS; }
0.996094
high
main.c
wwwillian/jogo_C_adivinhacao
0
811713
#include <stdio.h> int main() { int lucky; scanf("%d", &lucky); for (int i = 0; i <= 10; i++) { printf("%d x 2 = %d \n", lucky, lucky * i); } }
0.558594
low
c-program/socket1/poll-server-multithreads.c
aiter/cs
0
812225
<gh_stars>0 #include <lib/acceptor.h> #include "lib/common.h" #include "lib/event_loop.h" #include "lib/tcp_server.h" char rot13_char(char c) { if ((c >= 'a' && c <= 'm') || (c >= 'A' && c <= 'M')) return c + 13; else if ((c >= 'n' && c <= 'z') || (c >= 'N' && c <= 'Z')) return c - 13; else return c; } int onConnectionCompleted(struct tcp_connection *tcpConnection) { printf("connnection completed\n"); return 0; } int onMessage(struct buffer *input, struct tcp_connection *tcpConnection) { printf("get message from tcp connnection %s \n", tcpConnection->name); printf("%s", input->data); struct buffer *output = buffer_new(); int size = buffer_readable_size(input); for (int i = 0; i < size; i++) { buffer_append_char(output, rot13_char(buffer_append_char(input))); } tcp_connection_send_buffer(tcpConnection, output); return 0; } int onWriteCompleted(struct tcp_connection *tcpConnection) { printf("write completed\n"); return 0; } int onConnectionClosed(struct tcp_connection *tcpConnection) { printf("close completed\n"); return 0; } int main(int c, char **v) { //主线程event_loop struct event_loop *eventLoop = event_loop_init(); //初始化acceptor struct acceptor *acceptor = acceptor_init(SERV_PORT); //初始化tcp_server // 设置线程数目为4。说明是一个主acceptor线程,4个从reactor处理I/O的线程,每一个线程都跟一个event_loop一一绑定 struct TCPserver *tcpServer = tcp_server_init(eventLoop, acceptor, onConnectionCompleted, onMessage, onWriteCompleted, onConnectionClosed, 4); tcp_server_start(tcpServer); //main thread event_loop_run(eventLoop); }
0.949219
high
compress/libdeflate/adler32.c
jcharum/base
52
812737
/* * adler32.c - Adler-32 checksum algorithm * * Copyright 2016 <NAME> * * 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 "lib_common.h" #include "libdeflate.h" /* The Adler-32 divisor, or "base", value. */ #define DIVISOR 65521 /* * MAX_CHUNK_SIZE is the most bytes that can be processed without the * possibility of s2 overflowing when it is represented as an unsigned 32-bit * integer. This value was computed using the following Python script: * * divisor = 65521 * count = 0 * s1 = divisor - 1 * s2 = divisor - 1 * while True: * s1 += 0xFF * s2 += s1 * if s2 > 0xFFFFFFFF: * break * count += 1 * print(count) * * Note that to get the correct worst-case value, we must assume that every byte * has value 0xFF and that s1 and s2 started with the highest possible values * modulo the divisor. */ #define MAX_CHUNK_SIZE 5552 typedef u32 (*adler32_func_t)(u32, const u8 *, size_t); /* Include architecture-specific implementations if available */ #undef DEFAULT_IMPL #undef DISPATCH #if defined(__arm__) || defined(__aarch64__) # include "arm/adler32_impl.h" #elif defined(__i386__) || defined(__x86_64__) # include "adler32_impl.h" #endif /* Define a generic implementation if needed */ #ifndef DEFAULT_IMPL #define DEFAULT_IMPL adler32_generic static u32 adler32_generic(u32 adler, const u8 *p, size_t size) { u32 s1 = adler & 0xFFFF; u32 s2 = adler >> 16; const u8 * const end = p + size; while (p != end) { size_t chunk_size = MIN(end - p, MAX_CHUNK_SIZE); const u8 *chunk_end = p + chunk_size; size_t num_unrolled_iterations = chunk_size / 4; while (num_unrolled_iterations--) { s1 += *p++; s2 += s1; s1 += *p++; s2 += s1; s1 += *p++; s2 += s1; s1 += *p++; s2 += s1; } while (p != chunk_end) { s1 += *p++; s2 += s1; } s1 %= DIVISOR; s2 %= DIVISOR; } return (s2 << 16) | s1; } #endif /* !DEFAULT_IMPL */ #ifdef DISPATCH static u32 dispatch(u32, const u8 *, size_t); static volatile adler32_func_t adler32_impl = dispatch; /* Choose the fastest implementation at runtime */ static u32 dispatch(u32 adler, const u8 *buffer, size_t size) { adler32_func_t f = arch_select_adler32_func(); if (f == NULL) f = DEFAULT_IMPL; adler32_impl = f; return adler32_impl(adler, buffer, size); } #else # define adler32_impl DEFAULT_IMPL /* only one implementation, use it */ #endif LIBDEFLATEAPI u32 libdeflate_adler32(u32 adler, const void *buffer, size_t size) { if (buffer == NULL) /* return initial value */ return 1; return adler32_impl(adler, buffer, size); }
0.996094
high
modules/reconstruction/include/v4r/reconstruction/ProjLKPoseTrackerRT.h
v4r-tuwien/v4r
2
813249
/**************************************************************************** ** ** Copyright (C) 2017 TU Wien, ACIN, Vision 4 Robotics (V4R) group ** Contact: v4r.acin.tuwien.ac.at ** ** This file is part of V4R ** ** V4R is distributed under dual licenses - GPLv3 or closed source. ** ** GNU General Public License Usage ** V4R is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published ** by the Free Software Foundation, either version 3 of the License, or ** (at your option) any later version. ** ** V4R is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** Please review the following information to ensure the GNU General Public ** License requirements will be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** ** Commercial License Usage ** If GPL is not suitable for your project, you must purchase a commercial ** license to use V4R. Licensees holding valid commercial V4R licenses may ** use this file in accordance with the commercial license agreement ** provided with the Software or, alternatively, in accordance with the ** terms contained in a written agreement between you and TU Wien, ACIN, V4R. ** For licensing terms and conditions please contact office<at>acin.tuwien.ac.at. ** ** ** The copyright holder additionally grants the author(s) of the file the right ** to use, copy, modify, merge, publish, distribute, sublicense, and/or ** sell copies of their contributions without any restrictions. ** ****************************************************************************/ /** * @file main.cpp * @author <NAME> (<EMAIL>) * @date 2017 * @brief * */ #ifndef KP_PROJ_LK_POSE_TRACKER_RT_HH #define KP_PROJ_LK_POSE_TRACKER_RT_HH #include <stdio.h> #include <v4r/keypoints/RigidTransformationRANSAC.h> #include <v4r/reconstruction/RefineProjectedPointLocationLK.h> #include <Eigen/Dense> #include <opencv2/calib3d/calib3d.hpp> #include <opencv2/core/core.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <stdexcept> #include <string> #include <v4r/common/impl/DataMatrix2D.hpp> #include <v4r/keypoints/impl/Object.hpp> namespace v4r { /** * ProjLKPoseTrackerRT */ class V4R_EXPORTS ProjLKPoseTrackerRT { public: class V4R_EXPORTS Parameter { public: bool compute_global_pose; RigidTransformationRANSAC::Parameter rt_param; // 0.04 (slam: 0.08) RefineProjectedPointLocationLK::Parameter plk_param; Parameter(bool _compute_global_pose = true, const RigidTransformationRANSAC::Parameter &_rt_param = RigidTransformationRANSAC::Parameter(0.04), const RefineProjectedPointLocationLK::Parameter &_plk_param = RefineProjectedPointLocationLK::Parameter()) : compute_global_pose(_compute_global_pose), rt_param(_rt_param), plk_param(_plk_param) {} }; private: Parameter param; float sqr_inl_dist; cv::Mat_<double> src_dist_coeffs, tgt_dist_coeffs; cv::Mat_<double> src_intrinsic, tgt_intrinsic; cv::Mat_<unsigned char> im_gray; std::vector<cv::Point2f> im_points; std::vector<int> inliers, converged; std::vector<Eigen::Vector3f> model_pts; std::vector<Eigen::Vector3f> query_pts; ObjectView::Ptr model; RefineProjectedPointLocationLK::Ptr plk; RigidTransformationRANSAC::Ptr rt; public: cv::Mat dbg; ProjLKPoseTrackerRT(const Parameter &p = Parameter()); ~ProjLKPoseTrackerRT(); double detect(const cv::Mat &image, const DataMatrix2D<Eigen::Vector3f> &cloud, Eigen::Matrix4f &pose); ObjectView::Ptr getModel() { return model; } void setModel(const ObjectView::Ptr &_model, const Eigen::Matrix4f &_pose); void getProjections(std::vector<std::pair<int, cv::Point2f>> &im_pts); void setSourceCameraParameter(const cv::Mat &_intrinsic, const cv::Mat &_dist_coeffs); void setTargetCameraParameter(const cv::Mat &_intrinsic, const cv::Mat &_dist_coeffs); typedef std::shared_ptr<::v4r::ProjLKPoseTrackerRT> Ptr; typedef std::shared_ptr<::v4r::ProjLKPoseTrackerRT const> ConstPtr; }; /***************************** inline methods *******************************/ } // namespace v4r #endif
0.996094
high
src/fastcd/camera.h
ICRA-2018/fast_change_detection
0
813761
// Copyright 2017 <NAME> (<EMAIL>) #pragma once #include <Eigen/Core> #include <Eigen/Dense> #include <iostream> #include <string> #include <vector> namespace fastcd { /** * @brief Class that represents a camera. It stores its calibration and * allows the projection and back-projection of points. */ class Camera { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW /** * @brief Reads the camera calibration from an XML file with Agisoft * format. * * @param[in] filename The file path. * @param[in] id The camera id in the XML file. */ void ReadCalibration(const std::string& filename, int id); /** * @brief Scales the camera calibration by the specified scaling factor. * * @param[in] scaling The scaling factor */ void ScaleCalibration(double scaling); /** * @brief Gets the calibration matrix. * * @return The calibration matrix. */ Eigen::Matrix3d GetK() const; /** * @brief Gets the inverse calibration matrix. * * @return The inverse calibration matrix. */ Eigen::Matrix3d GetInvK() const; /** * @brief Gets the pose of the camera. * * @return The pose of the camera. */ Eigen::Matrix4d GetPose() const; /** * @brief Gets the position of the camera. * * @return The position of the camera. */ Eigen::Vector3d GetPosition() const; /** * @brief Compute the OpenGL projection matrix relative to the camera. * * @return The OpenGL projection matrix. */ Eigen::Matrix4f GetGlProjection(float near, float far); /** * @brief Compute the OpenGL view matrix relative to the camera. * * @return The OpenGL view matrix. */ Eigen::Matrix4f GetGlView(); /** * @brief Return a vector of vertices for an OpenGL visualization of the * camera in the form of a line strip. * * @param[in] color The color of the line strip * @param[in] length The length of the four edges of the camera * * @return The vector of vertices. */ std::vector<float> GetGlFovVertices(float color, float length); /** * @brief Gets the width of the image plane in pixels. * * @return The width of the image plane in pixels. */ int GetWidth(); /** * @brief Gets the height of the image plane in pixels. * * @return The height of the image plane in pixels. */ int GetHeight(); /** * @brief Gets the camera projection matrix. * * @return The camera projection matrix. */ Eigen::Matrix<double, 3, 4> GetP() const; /** * @brief Projects a point on the image plane. * * @param[in] x The x coordinate * @param[in] y The y coordinate * @param[in] z The z coordinate * * @return The (u,v) coordinates of the point. */ Eigen::Vector2i Project(double x, double y, double z) const; /** * @brief Projects a point on the image plane. * * @param[in] point The 3D point * * @return The (u,v) coordinates of the point. */ Eigen::Vector2i Project(const Eigen::Vector3d& point) const; /** * @brief Back-projects a pixel. * * @param[in] u The u coordinate * @param[in] v The v coordinate * * @return The 3D coordinate of a point in the direction of the ray. */ Eigen::Vector3d BackProject(int u, int v); /** * @brief Back-projects a pixel. * * @param[in] point The 2D point * * @return The 3D coordinate of a point in the direction of the ray */ Eigen::Vector3d BackProject(const Eigen::Vector2i &point); /** * @brief Prints the camera parameters on the output stream. */ friend std::ostream& operator<<(std::ostream& os, const Camera& c); protected: /** Width of the image plane (in pixels) */ int width_ = 0; /** Height of the image plane (in pixels) */ int height_ = 0; /** Calibration matrix */ Eigen::Matrix3d calibration_ = Eigen::Matrix3d::Identity(); /** Inverse of calibration matrix */ Eigen::Matrix3d inverse_calibration_ = Eigen::Matrix3d::Identity(); /** Pose of the camera */ Eigen::Matrix4d pose_ = Eigen::Matrix4d::Identity(); }; } // namespace fastcd
0.996094
high
mame/src/emu/sound/vlm5030.c
nitrologic/emu
0
814273
<reponame>nitrologic/emu /* vlm5030.c VLM5030 emulator Written by <NAME> Based on TMS5220 simulator (tms5220.c) note: memory read cycle(==sampling rate) = 122.9u(440clock) interpolator (LC8109 = 2.5ms) = 20 * samples(125us) frame time (20ms) = 4 * interpolator 9bit DAC is composed of 5bit Physical and 3bitPWM. todo: Noise Generator circuit without 'mame_rand()' function. ----------- command format (Analytical result) ---------- 1)end of speech (8bit) :00000011: 2)silent some frame (8bit) :????SS01: SS : number of silent frames 00 = 2 frame 01 = 4 frame 10 = 6 frame 11 = 8 frame 3)-speech frame (48bit) function: 6th : 5th : 4th : 3rd : 2nd : 1st : end : --- : --- : --- : --- : --- :00000011: silent : --- : --- : --- : --- : --- :0000SS01: speech :11111122:22233334:44455566:67778889:99AAAEEE:EEPPPPP0: EEEEE : energy : volume 0=off,0x1f=max PPPPP : pitch : 0=noize , 1=fast,0x1f=slow 111111 : K1 : 48=off 22222 : K2 : 0=off,1=+min,0x0f=+max,0x10=off,0x11=+max,0x1f=-min : 16 == special function?? 3333 : K3 : 0=off,1=+min,0x07=+max,0x08=-max,0x0f=-min 4444 : K4 : 555 : K5 : 0=off,1=+min,0x03=+max,0x04=-max,0x07=-min 666 : K6 : 777 : K7 : 888 : K8 : 999 : K9 : AAA : K10 : ---------- chirp table information ---------- DAC PWM cycle == 88system clock , (11clock x 8 pattern) = 40.6KHz one chirp == 5 x PWM cycle == 440systemclock(8,136Hz) chirp 0 : volume 10- 8 : with filter chirp 1 : volume 8- 6 : with filter chirp 2 : volume 6- 4 : with filter chirp 3 : volume 4 : no filter ?? chirp 4- 5: volume 4- 2 : with filter chirp 6-11: volume 2- 0 : with filter chirp 12-..: vokume 0 : silent ---------- digial output information ---------- when ME pin = high , some status output to A0..15 pins A0..8 : DAC output value (abs) A9 : DAC sign flag , L=minus,H=Plus A10 : energy reload flag (pitch pulse) A11..15 : unknown [DAC output value(signed 6bit)] = A9 ? A0..8 : -(A0..8) */ #include "sndintrf.h" #include "streams.h" #include "vlm5030.h" /* interpolator per frame */ #define FR_SIZE 4 /* samples per interpolator */ #define IP_SIZE_SLOWER (240/FR_SIZE) #define IP_SIZE_SLOW (200/FR_SIZE) #define IP_SIZE_NORMAL (160/FR_SIZE) #define IP_SIZE_FAST (120/FR_SIZE) #define IP_SIZE_FASTER ( 80/FR_SIZE) typedef struct _vlm5030_state vlm5030_state; struct _vlm5030_state { const device_config *device; const vlm5030_interface *intf; sound_stream * channel; /* need to save state */ UINT8 *rom; int address_mask; UINT16 address; UINT8 pin_BSY; UINT8 pin_ST; UINT8 pin_VCU; UINT8 pin_RST; UINT8 latch_data; UINT16 vcu_addr_h; UINT8 parameter; UINT8 phase; /* state of option paramter */ int frame_size; int pitch_offset; UINT8 interp_step; UINT8 interp_count; /* number of interp periods */ UINT8 sample_count; /* sample number within interp */ UINT8 pitch_count; /* these contain data describing the current and previous voice frames */ UINT16 old_energy; UINT8 old_pitch; INT16 old_k[10]; UINT16 target_energy; UINT8 target_pitch; INT16 target_k[10]; UINT16 new_energy; UINT8 new_pitch; INT16 new_k[10]; /* these are all used to contain the current state of the sound generation */ unsigned int current_energy; unsigned int current_pitch; int current_k[10]; INT32 x[10]; }; /* phase value */ enum { PH_RESET, PH_IDLE, PH_SETUP, PH_WAIT, PH_RUN, PH_STOP, PH_END }; /* speed parameter SPC SPB SPA 1 0 1 more slow (05h) : 42ms (150%) : 60sample 1 1 x slow (06h,07h) : 34ms (125%) : 50sample x 0 0 normal (00h,04h) : 25.6ms (100%) : 40samplme 0 0 1 fast (01h) : 20.2ms (75%) : 30sample 0 1 x more fast (02h,03h) : 12.2ms (50%) : 20sample */ static const int vlm5030_speed_table[8] = { IP_SIZE_NORMAL, IP_SIZE_FAST, IP_SIZE_FASTER, IP_SIZE_FASTER, IP_SIZE_NORMAL, IP_SIZE_SLOWER, IP_SIZE_SLOW, IP_SIZE_SLOW }; static const char VLM_NAME[] = "VLM5030"; /* ROM Tables */ /* This is the energy lookup table */ /* sampled from real chip */ static const unsigned short energytable[0x20] = { 0, 2, 4, 6, 10, 12, 14, 18, /* 0-7 */ 22, 26, 30, 34, 38, 44, 48, 54, /* 8-15 */ 62, 68, 76, 84, 94,102,114,124, /* 16-23 */ 136,150,164,178,196,214,232,254 /* 24-31 */ }; /* This is the pitch lookup table */ static const unsigned char pitchtable [0x20]= { 1, /* 0 : random mode */ 22, /* 1 : start=22 */ 23, 24, 25, 26, 27, 28, 29, 30, /* 2- 9 : 1step */ 32, 34, 36, 38, 40, 42, 44, 46, /* 10-17 : 2step */ 50, 54, 58, 62, 66, 70, 74, 78, /* 18-25 : 4step */ 86, 94, 102,110,118,126 /* 26-31 : 8step */ }; static const INT16 K1_table[] = { -24898, -25672, -26446, -27091, -27736, -28252, -28768, -29155, -29542, -29929, -30316, -30574, -30832, -30961, -31219, -31348, -31606, -31735, -31864, -31864, -31993, -32122, -32122, -32251, -32251, -32380, -32380, -32380, -32509, -32509, -32509, -32509, 24898, 23995, 22963, 21931, 20770, 19480, 18061, 16642, 15093, 13416, 11610, 9804, 7998, 6063, 3999, 1935, 0, -1935, -3999, -6063, -7998, -9804, -11610, -13416, -15093, -16642, -18061, -19480, -20770, -21931, -22963, -23995 }; static const INT16 K2_table[] = { 0, -3096, -6321, -9417, -12513, -15351, -18061, -20770, -23092, -25285, -27220, -28897, -30187, -31348, -32122, -32638, 0, 32638, 32122, 31348, 30187, 28897, 27220, 25285, 23092, 20770, 18061, 15351, 12513, 9417, 6321, 3096 }; static const INT16 K3_table[] = { 0, -3999, -8127, -12255, -16384, -20383, -24511, -28639, 32638, 28639, 24511, 20383, 16254, 12255, 8127, 3999 }; static const INT16 K5_table[] = { 0, -8127, -16384, -24511, 32638, 24511, 16254, 8127 }; INLINE vlm5030_state *get_safe_token(const device_config *device) { assert(device != NULL); assert(device->token != NULL); assert(device->type == SOUND); assert(sound_get_type(device) == SOUND_VLM5030); return (vlm5030_state *)device->token; } static int get_bits(vlm5030_state *chip, int sbit,int bits) { int offset = chip->address + (sbit>>3); int data; data = chip->rom[offset&chip->address_mask] + (((int)chip->rom[(offset+1)&chip->address_mask])*256); data >>= (sbit&7); data &= (0xff>>(8-bits)); return data; } /* get next frame */ static int parse_frame (vlm5030_state *chip) { unsigned char cmd; int i; /* remember previous frame */ chip->old_energy = chip->new_energy; chip->old_pitch = chip->new_pitch; for(i=0;i<=9;i++) chip->old_k[i] = chip->new_k[i]; /* command byte check */ cmd = chip->rom[chip->address&chip->address_mask]; if( cmd & 0x01 ) { /* extend frame */ chip->new_energy = chip->new_pitch = 0; for(i=0;i<=9;i++) chip->new_k[i] = 0; chip->address++; if( cmd & 0x02 ) { /* end of speech */ /* logerror("VLM5030 %04X end \n",chip->address ); */ return 0; } else { /* silent frame */ int nums = ( (cmd>>2)+1 )*2; /* logerror("VLM5030 %04X silent %d frame\n",chip->address,nums ); */ return nums * FR_SIZE; } } /* pitch */ chip->new_pitch = ( pitchtable[get_bits(chip, 1,5)] + chip->pitch_offset )&0xff; /* energy */ chip->new_energy = energytable[get_bits(chip, 6,5)]; /* 10 K's */ chip->new_k[9] = K5_table[get_bits(chip,11,3)]; chip->new_k[8] = K5_table[get_bits(chip,14,3)]; chip->new_k[7] = K5_table[get_bits(chip,17,3)]; chip->new_k[6] = K5_table[get_bits(chip,20,3)]; chip->new_k[5] = K5_table[get_bits(chip,23,3)]; chip->new_k[4] = K5_table[get_bits(chip,26,3)]; chip->new_k[3] = K3_table[get_bits(chip,29,4)]; chip->new_k[2] = K3_table[get_bits(chip,33,4)]; chip->new_k[1] = K2_table[get_bits(chip,37,5)]; chip->new_k[0] = K1_table[get_bits(chip,42,6)]; chip->address+=6; logerror("VLM5030 %04X voice \n",chip->address ); return FR_SIZE; } /* decode and buffering data */ static STREAM_UPDATE( vlm5030_update_callback ) { vlm5030_state *chip = (vlm5030_state *)param; int buf_count=0; int interp_effect; int i; int u[11]; stream_sample_t *buffer = outputs[0]; /* running */ if( chip->phase == PH_RUN || chip->phase == PH_STOP ) { /* playing speech */ while (samples > 0) { int current_val; /* check new interpolator or new frame */ if( chip->sample_count == 0 ) { if( chip->phase == PH_STOP ) { chip->phase = PH_END; chip->sample_count = 1; goto phase_stop; /* continue to end phase */ } chip->sample_count = chip->frame_size; /* interpolator changes */ if ( chip->interp_count == 0 ) { /* change to new frame */ chip->interp_count = parse_frame(chip); /* with change phase */ if ( chip->interp_count == 0 ) { /* end mark found */ chip->interp_count = FR_SIZE; chip->sample_count = chip->frame_size; /* end -> stop time */ chip->phase = PH_STOP; } /* Set old target as new start of frame */ chip->current_energy = chip->old_energy; chip->current_pitch = chip->old_pitch; for(i=0;i<=9;i++) chip->current_k[i] = chip->old_k[i]; /* is this a zero energy frame? */ if (chip->current_energy == 0) { /*mame_printf_debug("processing frame: zero energy\n");*/ chip->target_energy = 0; chip->target_pitch = chip->current_pitch; for(i=0;i<=9;i++) chip->target_k[i] = chip->current_k[i]; } else { /*mame_printf_debug("processing frame: Normal\n");*/ /*mame_printf_debug("*** Energy = %d\n",chip->current_energy);*/ /*mame_printf_debug("proc: %d %d\n",last_fbuf_head,fbuf_head);*/ chip->target_energy = chip->new_energy; chip->target_pitch = chip->new_pitch; for(i=0;i<=9;i++) chip->target_k[i] = chip->new_k[i]; } } /* next interpolator */ /* Update values based on step values 25% , 50% , 75% , 100% */ chip->interp_count -= chip->interp_step; /* 3,2,1,0 -> 1,2,3,4 */ interp_effect = FR_SIZE - (chip->interp_count%FR_SIZE); chip->current_energy = chip->old_energy + (chip->target_energy - chip->old_energy) * interp_effect / FR_SIZE; if (chip->old_pitch > 1) chip->current_pitch = chip->old_pitch + (chip->target_pitch - chip->old_pitch) * interp_effect / FR_SIZE; for (i = 0; i <= 9 ; i++) chip->current_k[i] = chip->old_k[i] + (chip->target_k[i] - chip->old_k[i]) * interp_effect / FR_SIZE; } /* calcrate digital filter */ if (chip->old_energy == 0) { /* generate silent samples here */ current_val = 0x00; } else if (chip->old_pitch <= 1) { /* generate unvoiced samples here */ current_val = (mame_rand(chip->device->machine)&1) ? chip->current_energy : -chip->current_energy; } else { /* generate voiced samples here */ current_val = ( chip->pitch_count == 0) ? chip->current_energy : 0; } /* Lattice filter here */ u[10] = current_val; for (i = 9; i >= 0; i--) u[i] = u[i+1] - ((chip->current_k[i] * chip->x[i]) / 32768); for (i = 9; i >= 1; i--) chip->x[i] = chip->x[i-1] + ((chip->current_k[i-1] * u[i-1]) / 32768); chip->x[0] = u[0]; /* clipping, buffering */ if (u[0] > 511) buffer[buf_count] = 511<<6; else if (u[0] < -511) buffer[buf_count] = -511<<6; else buffer[buf_count] = (u[0] << 6); buf_count++; /* sample count */ chip->sample_count--; /* pitch */ chip->pitch_count++; if (chip->pitch_count >= chip->current_pitch ) chip->pitch_count = 0; /* size */ samples--; } /* return;*/ } /* stop phase */ phase_stop: switch( chip->phase ) { case PH_SETUP: if( chip->sample_count <= samples) { chip->sample_count = 0; /* logerror("VLM5030 BSY=H\n" ); */ /* pin_BSY = 1; */ chip->phase = PH_WAIT; } else { chip->sample_count -= samples; } break; case PH_END: if( chip->sample_count <= samples) { chip->sample_count = 0; /* logerror("VLM5030 BSY=L\n" ); */ chip->pin_BSY = 0; chip->phase = PH_IDLE; } else { chip->sample_count -= samples; } } /* silent buffering */ while (samples > 0) { buffer[buf_count++] = 0x00; samples--; } } /* realtime update */ static void vlm5030_update(vlm5030_state *chip) { stream_update(chip->channel); } /* setup parameteroption when RST=H */ static void vlm5030_setup_parameter(vlm5030_state *chip, UINT8 param) { /* latch parameter value */ chip->parameter = param; /* bit 0,1 : 4800bps / 9600bps , interporator step */ if(param&2) /* bit 1 = 1 , 9600bps */ chip->interp_step = 4; /* 9600bps : no interporator */ else if(param&1) /* bit1 = 0 & bit0 = 1 , 4800bps */ chip->interp_step = 2; /* 4800bps : 2 interporator */ else /* bit1 = bit0 = 0 : 2400bps */ chip->interp_step = 1; /* 2400bps : 4 interporator */ /* bit 3,4,5 : speed (frame size) */ chip->frame_size = vlm5030_speed_table[(param>>3) &7]; /* bit 6,7 : low / high pitch */ if(param&0x80) /* bit7=1 , high pitch */ chip->pitch_offset = -8; else if(param&0x40) /* bit6=1 , low pitch */ chip->pitch_offset = 8; else chip->pitch_offset = 0; } static STATE_POSTLOAD( vlm5030_restore_state ) { vlm5030_state *chip = (vlm5030_state *)param; int i; int interp_effect = FR_SIZE - (chip->interp_count%FR_SIZE); /* restore parameter data */ vlm5030_setup_parameter(chip, chip->parameter); /* restore current energy,pitch & filter */ chip->current_energy = chip->old_energy + (chip->target_energy - chip->old_energy) * interp_effect / FR_SIZE; if (chip->old_pitch > 1) chip->current_pitch = chip->old_pitch + (chip->target_pitch - chip->old_pitch) * interp_effect / FR_SIZE; for (i = 0; i <= 9 ; i++) chip->current_k[i] = chip->old_k[i] + (chip->target_k[i] - chip->old_k[i]) * interp_effect / FR_SIZE; } static void vlm5030_reset(vlm5030_state *chip) { chip->phase = PH_RESET; chip->address = 0; chip->vcu_addr_h = 0; chip->pin_BSY = 0; chip->old_energy = chip->old_pitch = 0; chip->new_energy = chip->new_pitch = 0; chip->current_energy = chip->current_pitch = 0; chip->target_energy = chip->target_pitch = 0; memset(chip->old_k, 0, sizeof(chip->old_k)); memset(chip->new_k, 0, sizeof(chip->new_k)); memset(chip->current_k, 0, sizeof(chip->current_k)); memset(chip->target_k, 0, sizeof(chip->target_k)); chip->interp_count = chip->sample_count = chip->pitch_count = 0; memset(chip->x, 0, sizeof(chip->x)); /* reset parameters */ vlm5030_setup_parameter(chip, 0x00); } static DEVICE_RESET( vlm5030 ) { vlm5030_reset(get_safe_token(device)); } /* set speech rom address */ void vlm5030_set_rom(const device_config *device, void *speech_rom) { vlm5030_state *chip = get_safe_token(device); chip->rom = (UINT8 *)speech_rom; } /* get BSY pin level */ int vlm5030_bsy(const device_config *device) { vlm5030_state *chip = get_safe_token(device); vlm5030_update(chip); return chip->pin_BSY; } /* latch contoll data */ WRITE8_DEVICE_HANDLER( vlm5030_data_w ) { vlm5030_state *chip = get_safe_token(device); chip->latch_data = (UINT8)data; } /* set RST pin level : reset / set table address A8-A15 */ void vlm5030_rst (const device_config *device, int pin ) { vlm5030_state *chip = get_safe_token(device); if( chip->pin_RST ) { if( !pin ) { /* H -> L : latch parameters */ chip->pin_RST = 0; vlm5030_setup_parameter(chip, chip->latch_data); } } else { if( pin ) { /* L -> H : reset chip */ chip->pin_RST = 1; if( chip->pin_BSY ) { vlm5030_reset(chip); } } } } /* set VCU pin level : ?? unknown */ void vlm5030_vcu(const device_config *device, int pin) { vlm5030_state *chip = get_safe_token(device); /* direct mode / indirect mode */ chip->pin_VCU = pin; return; } /* set ST pin level : set table address A0-A7 / start speech */ void vlm5030_st(const device_config *device, int pin ) { vlm5030_state *chip = get_safe_token(device); int table; if( chip->pin_ST != pin ) { /* pin level is change */ if( !pin ) { /* H -> L */ chip->pin_ST = 0; if( chip->pin_VCU ) { /* direct access mode & address High */ chip->vcu_addr_h = ((int)chip->latch_data<<8) + 0x01; } else { /* start speech */ /* check access mode */ if( chip->vcu_addr_h ) { /* direct access mode */ chip->address = (chip->vcu_addr_h&0xff00) + chip->latch_data; chip->vcu_addr_h = 0; } else { /* indirect accedd mode */ table = (chip->latch_data&0xfe) + (((int)chip->latch_data&1)<<8); chip->address = (((int)chip->rom[table&chip->address_mask])<<8) | chip->rom[(table+1)&chip->address_mask]; #if 0 /* show unsupported parameter message */ if( chip->interp_step != 1) popmessage("No %d %dBPS parameter",table/2,chip->interp_step*2400); #endif } vlm5030_update(chip); /* logerror("VLM5030 %02X start adr=%04X\n",table/2,chip->address ); */ /* reset process status */ chip->sample_count = chip->frame_size; chip->interp_count = FR_SIZE; /* clear filter */ /* start after 3 sampling cycle */ chip->phase = PH_RUN; } } else { /* L -> H */ chip->pin_ST = 1; /* setup speech , BSY on after 30ms? */ chip->phase = PH_SETUP; chip->sample_count = 1; /* wait time for busy on */ chip->pin_BSY = 1; /* */ } } } /* start VLM5030 with sound rom */ /* speech_rom == 0 -> use sampling data mode */ static DEVICE_START( vlm5030 ) { const vlm5030_interface defintrf = { 0 }; int emulation_rate; vlm5030_state *chip = get_safe_token(device); chip->device = device; chip->intf = (device->static_config != NULL) ? (const vlm5030_interface *)device->static_config : &defintrf; emulation_rate = device->clock / 440; /* reset input pins */ chip->pin_RST = chip->pin_ST = chip->pin_VCU= 0; chip->latch_data = 0; vlm5030_reset(chip); chip->phase = PH_IDLE; chip->rom = device->region; /* memory size */ if( chip->intf->memory_size == 0) chip->address_mask = device->regionbytes-1; else chip->address_mask = chip->intf->memory_size-1; chip->channel = stream_create(device, 0, 1, emulation_rate,chip,vlm5030_update_callback); /* don't restore "UINT8 *chip->rom" when use vlm5030_set_rom() */ state_save_register_device_item(device,0,chip->address); state_save_register_device_item(device,0,chip->pin_BSY); state_save_register_device_item(device,0,chip->pin_ST); state_save_register_device_item(device,0,chip->pin_VCU); state_save_register_device_item(device,0,chip->pin_RST); state_save_register_device_item(device,0,chip->latch_data); state_save_register_device_item(device,0,chip->vcu_addr_h); state_save_register_device_item(device,0,chip->parameter); state_save_register_device_item(device,0,chip->phase); state_save_register_device_item(device,0,chip->interp_count); state_save_register_device_item(device,0,chip->sample_count); state_save_register_device_item(device,0,chip->pitch_count); state_save_register_device_item(device,0,chip->old_energy); state_save_register_device_item(device,0,chip->old_pitch); state_save_register_device_item_array(device,0,chip->old_k); state_save_register_device_item(device,0,chip->target_energy); state_save_register_device_item(device,0,chip->target_pitch); state_save_register_device_item_array(device,0,chip->target_k); state_save_register_device_item_array(device,0,chip->x); state_save_register_postload(device->machine, vlm5030_restore_state, chip); } /************************************************************************** * Generic get_info **************************************************************************/ DEVICE_GET_INFO( vlm5030 ) { switch (state) { /* --- the following bits of info are returned as 64-bit signed integers --- */ case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(vlm5030_state); break; /* --- the following bits of info are returned as pointers to data or functions --- */ case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( vlm5030 ); break; case DEVINFO_FCT_STOP: /* Nothing */ break; case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME( vlm5030 ); break; /* --- the following bits of info are returned as NULL-terminated strings --- */ case DEVINFO_STR_NAME: strcpy(info->s, "VLM5030"); break; case DEVINFO_STR_FAMILY: strcpy(info->s, "VLM speech"); break; case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright <NAME> and the MAME Team"); break; } }
0.96875
high
README.md exists but content is empty. Use the Edit dataset card button to edit it.
Downloads last month
0
Edit dataset card