hexsha
stringlengths
40
40
size
int64
5
1.05M
ext
stringclasses
588 values
lang
stringclasses
305 values
max_stars_repo_path
stringlengths
3
363
max_stars_repo_name
stringlengths
5
118
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
10
max_stars_count
float64
1
191k
max_stars_repo_stars_event_min_datetime
stringdate
2015-01-01 00:00:35
2022-03-31 23:43:49
max_stars_repo_stars_event_max_datetime
stringdate
2015-01-01 12:37:38
2022-03-31 23:59:52
max_issues_repo_path
stringlengths
3
363
max_issues_repo_name
stringlengths
5
118
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
10
max_issues_count
float64
1
134k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
363
max_forks_repo_name
stringlengths
5
135
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
10
max_forks_count
float64
1
105k
max_forks_repo_forks_event_min_datetime
stringdate
2015-01-01 00:01:02
2022-03-31 23:27:27
max_forks_repo_forks_event_max_datetime
stringdate
2015-01-03 08:55:07
2022-03-31 23:59:24
content
stringlengths
5
1.05M
avg_line_length
float64
1.13
1.04M
max_line_length
int64
1
1.05M
alphanum_fraction
float64
0
1
30acda07b33141d9356566666731f4274c99674b
554
h
C
ds/BinarySearchTreeNode.h
jumbuna/data-structures-algorithms
e6f9ecca13cc77ddf11fc645fc9e362b80862674
[ "MIT" ]
1
2020-07-11T09:06:52.000Z
2020-07-11T09:06:52.000Z
ds/BinarySearchTreeNode.h
jumbuna/data-structures-algorithms
e6f9ecca13cc77ddf11fc645fc9e362b80862674
[ "MIT" ]
null
null
null
ds/BinarySearchTreeNode.h
jumbuna/data-structures-algorithms
e6f9ecca13cc77ddf11fc645fc9e362b80862674
[ "MIT" ]
null
null
null
#pragma once //base class for all nodes of a binary tree namespace jumbuna { template<class T> struct BstNode { BstNode(); BstNode(T, BstNode<T> *, BstNode<T> * = nullptr); T element; BstNode *leftChild; BstNode *rightChild; BstNode *parent; }; } using namespace jumbuna; template<class T> BstNode<T>::BstNode() { parent = rightChild = leftChild = nullptr; } template<class T> BstNode<T>::BstNode(T element, BstNode<T> *parent, BstNode<T> *leafSentinel) :element(element), parent(parent), rightChild(leafSentinel), leftChild(leafSentinel) {}
19.103448
84
0.722022
30e10f0ec9595a787448dac1e60923b9dc428d5d
122
h
C
sourcecode/nsbase/dependency/libiconv/inc/canonical_local.h
nosngame/nosn
76dc0525aa9a5baf6aca7d2c18c75b79a1d31e28
[ "Unlicense" ]
4
2019-12-04T13:06:52.000Z
2021-09-24T04:45:53.000Z
sourcecode/nsbase/dependency/libiconv/inc/canonical_local.h
nosngame/nosn
76dc0525aa9a5baf6aca7d2c18c75b79a1d31e28
[ "Unlicense" ]
null
null
null
sourcecode/nsbase/dependency/libiconv/inc/canonical_local.h
nosngame/nosn
76dc0525aa9a5baf6aca7d2c18c75b79a1d31e28
[ "Unlicense" ]
null
null
null
(long long)&((struct stringpool_t *)0)->stringpool_str193, (long long)&((struct stringpool_t *)0)->stringpool_str496,
40.666667
60
0.721311
801cc9c332561123b4bddd1aef0f169d1e249dda
9,050
c
C
channels/drdynvc/client/drdynvc_main.c
awakecoding/WinPR-msasn1
288a7d343bbcfb0484400a79a90b8f9ab1ecbe2f
[ "Apache-2.0" ]
4
2015-10-29T08:37:40.000Z
2017-08-08T13:51:29.000Z
channels/drdynvc/client/drdynvc_main.c
awakecoding/WinPR-msasn1
288a7d343bbcfb0484400a79a90b8f9ab1ecbe2f
[ "Apache-2.0" ]
null
null
null
channels/drdynvc/client/drdynvc_main.c
awakecoding/WinPR-msasn1
288a7d343bbcfb0484400a79a90b8f9ab1ecbe2f
[ "Apache-2.0" ]
1
2022-01-24T08:24:24.000Z
2022-01-24T08:24:24.000Z
/** * FreeRDP: A Remote Desktop Protocol client. * Dynamic Virtual Channel * * Copyright 2010-2011 Vic Lee * * 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. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <stdio.h> #include <stdlib.h> #include <string.h> #include <freerdp/constants.h> #include <freerdp/utils/memory.h> #include <freerdp/utils/stream.h> #include <freerdp/utils/svc_plugin.h> #include <freerdp/utils/wait_obj.h> #include "dvcman.h" #include "drdynvc_types.h" #include "drdynvc_main.h" #define CREATE_REQUEST_PDU 0x01 #define DATA_FIRST_PDU 0x02 #define DATA_PDU 0x03 #define CLOSE_REQUEST_PDU 0x04 #define CAPABILITY_REQUEST_PDU 0x05 struct drdynvc_plugin { rdpSvcPlugin plugin; int version; int PriorityCharge0; int PriorityCharge1; int PriorityCharge2; int PriorityCharge3; int channel_error; IWTSVirtualChannelManager* channel_mgr; }; static int drdynvc_write_variable_uint(STREAM* stream, uint32 val) { int cb; if (val <= 0xFF) { cb = 0; stream_write_uint8(stream, val); } else if (val <= 0xFFFF) { cb = 1; stream_write_uint16(stream, val); } else { cb = 2; stream_write_uint32(stream, val); } return cb; } int drdynvc_write_data(drdynvcPlugin* drdynvc, uint32 ChannelId, uint8* data, uint32 data_size) { STREAM* data_out; uint32 pos = 0; uint32 cbChId; uint32 cbLen; uint32 chunk_len; int error; DEBUG_DVC("ChannelId=%d size=%d", ChannelId, data_size); if (drdynvc->channel_error != CHANNEL_RC_OK) return 1; data_out = stream_new(CHANNEL_CHUNK_LENGTH); stream_set_pos(data_out, 1); cbChId = drdynvc_write_variable_uint(data_out, ChannelId); if(data_size == 0) { pos = stream_get_pos(data_out); stream_set_pos(data_out, 0); stream_write_uint8(data_out, 0x40 | cbChId); stream_set_pos(data_out, pos); error = svc_plugin_send((rdpSvcPlugin*)drdynvc, data_out); } else if (data_size <= CHANNEL_CHUNK_LENGTH - pos) { pos = stream_get_pos(data_out); stream_set_pos(data_out, 0); stream_write_uint8(data_out, 0x30 | cbChId); stream_set_pos(data_out, pos); stream_write(data_out, data, data_size); error = svc_plugin_send((rdpSvcPlugin*)drdynvc, data_out); } else { /* Fragment the data */ cbLen = drdynvc_write_variable_uint(data_out, data_size); pos = stream_get_pos(data_out); stream_set_pos(data_out, 0); stream_write_uint8(data_out, 0x20 | cbChId | (cbLen << 2)); stream_set_pos(data_out, pos); chunk_len = CHANNEL_CHUNK_LENGTH - pos; stream_write(data_out, data, chunk_len); data += chunk_len; data_size -= chunk_len; error = svc_plugin_send((rdpSvcPlugin*)drdynvc, data_out); while (error == CHANNEL_RC_OK && data_size > 0) { data_out = stream_new(CHANNEL_CHUNK_LENGTH); stream_set_pos(data_out, 1); cbChId = drdynvc_write_variable_uint(data_out, ChannelId); pos = stream_get_pos(data_out); stream_set_pos(data_out, 0); stream_write_uint8(data_out, 0x30 | cbChId); stream_set_pos(data_out, pos); chunk_len = data_size; if (chunk_len > CHANNEL_CHUNK_LENGTH - pos) chunk_len = CHANNEL_CHUNK_LENGTH - pos; stream_write(data_out, data, chunk_len); data += chunk_len; data_size -= chunk_len; error = svc_plugin_send((rdpSvcPlugin*)drdynvc, data_out); } } if (error != CHANNEL_RC_OK) { drdynvc->channel_error = error; DEBUG_WARN("VirtualChannelWrite failed %d", error); return 1; } return 0; } int drdynvc_push_event(drdynvcPlugin* drdynvc, RDP_EVENT* event) { int error; error = svc_plugin_send_event((rdpSvcPlugin*)drdynvc, event); if (error != CHANNEL_RC_OK) { DEBUG_WARN("pVirtualChannelEventPush failed %d", error); return 1; } return 0; } static int drdynvc_process_capability_request(drdynvcPlugin* drdynvc, int Sp, int cbChId, STREAM* s) { STREAM* data_out; int error; DEBUG_DVC("Sp=%d cbChId=%d", Sp, cbChId); stream_seek(s, 1); /* pad */ stream_read_uint16(s, drdynvc->version); if (drdynvc->version == 2) { stream_read_uint16(s, drdynvc->PriorityCharge0); stream_read_uint16(s, drdynvc->PriorityCharge1); stream_read_uint16(s, drdynvc->PriorityCharge2); stream_read_uint16(s, drdynvc->PriorityCharge3); } data_out = stream_new(4); stream_write_uint16(data_out, 0x0050); /* Cmd+Sp+cbChId+Pad. Note: MSTSC sends 0x005c */ stream_write_uint16(data_out, drdynvc->version); error = svc_plugin_send((rdpSvcPlugin*)drdynvc, data_out); if (error != CHANNEL_RC_OK) { DEBUG_WARN("VirtualChannelWrite failed %d", error); return 1; } drdynvc->channel_error = error; return 0; } static uint32 drdynvc_read_variable_uint(STREAM* stream, int cbLen) { uint32 val; switch (cbLen) { case 0: stream_read_uint8(stream, val); break; case 1: stream_read_uint16(stream, val); break; default: stream_read_uint32(stream, val); break; } return val; } static int drdynvc_process_create_request(drdynvcPlugin* drdynvc, int Sp, int cbChId, STREAM* s) { STREAM* data_out; int pos; int error; uint32 ChannelId; ChannelId = drdynvc_read_variable_uint(s, cbChId); pos = stream_get_pos(s); DEBUG_DVC("ChannelId=%d ChannelName=%s", ChannelId, stream_get_tail(s)); error = dvcman_create_channel(drdynvc->channel_mgr, ChannelId, (char*)stream_get_tail(s)); data_out = stream_new(pos + 4); stream_write_uint8(data_out, 0x10 | cbChId); stream_set_pos(s, 1); stream_copy(data_out, s, pos - 1); if (error == 0) { DEBUG_DVC("channel created"); stream_write_uint32(data_out, 0); } else { DEBUG_DVC("no listener"); stream_write_uint32(data_out, (uint32)(-1)); } error = svc_plugin_send((rdpSvcPlugin*)drdynvc, data_out); if (error != CHANNEL_RC_OK) { DEBUG_WARN("VirtualChannelWrite failed %d", error); return 1; } return 0; } static int drdynvc_process_data_first(drdynvcPlugin* drdynvc, int Sp, int cbChId, STREAM* s) { uint32 ChannelId; uint32 Length; int error; ChannelId = drdynvc_read_variable_uint(s, cbChId); Length = drdynvc_read_variable_uint(s, Sp); DEBUG_DVC("ChannelId=%d Length=%d", ChannelId, Length); error = dvcman_receive_channel_data_first(drdynvc->channel_mgr, ChannelId, Length); if (error) return error; return dvcman_receive_channel_data(drdynvc->channel_mgr, ChannelId, stream_get_tail(s), stream_get_left(s)); } static int drdynvc_process_data(drdynvcPlugin* drdynvc, int Sp, int cbChId, STREAM* s) { uint32 ChannelId; ChannelId = drdynvc_read_variable_uint(s, cbChId); DEBUG_DVC("ChannelId=%d", ChannelId); return dvcman_receive_channel_data(drdynvc->channel_mgr, ChannelId, stream_get_tail(s), stream_get_left(s)); } static int drdynvc_process_close_request(drdynvcPlugin* drdynvc, int Sp, int cbChId, STREAM* s) { uint32 ChannelId; ChannelId = drdynvc_read_variable_uint(s, cbChId); DEBUG_DVC("ChannelId=%d", ChannelId); dvcman_close_channel(drdynvc->channel_mgr, ChannelId); return 0; } static void drdynvc_process_receive(rdpSvcPlugin* plugin, STREAM* s) { drdynvcPlugin* drdynvc = (drdynvcPlugin*)plugin; int value; int Cmd; int Sp; int cbChId; stream_read_uint8(s, value); Cmd = (value & 0xf0) >> 4; Sp = (value & 0x0c) >> 2; cbChId = (value & 0x03) >> 0; DEBUG_DVC("Cmd=0x%x", Cmd); switch (Cmd) { case CAPABILITY_REQUEST_PDU: drdynvc_process_capability_request(drdynvc, Sp, cbChId, s); break; case CREATE_REQUEST_PDU: drdynvc_process_create_request(drdynvc, Sp, cbChId, s); break; case DATA_FIRST_PDU: drdynvc_process_data_first(drdynvc, Sp, cbChId, s); break; case DATA_PDU: drdynvc_process_data(drdynvc, Sp, cbChId, s); break; case CLOSE_REQUEST_PDU: drdynvc_process_close_request(drdynvc, Sp, cbChId, s); break; default: DEBUG_WARN("unknown drdynvc cmd 0x%x", Cmd); break; } stream_free(s); } static void drdynvc_process_connect(rdpSvcPlugin* plugin) { drdynvcPlugin* drdynvc = (drdynvcPlugin*)plugin; DEBUG_DVC("connecting"); drdynvc->channel_mgr = dvcman_new(drdynvc); drdynvc->channel_error = 0; dvcman_load_plugin(drdynvc->channel_mgr, svc_plugin_get_data(plugin)); dvcman_init(drdynvc->channel_mgr); } static void drdynvc_process_event(rdpSvcPlugin* plugin, RDP_EVENT* event) { freerdp_event_free(event); } static void drdynvc_process_terminate(rdpSvcPlugin* plugin) { drdynvcPlugin* drdynvc = (drdynvcPlugin*)plugin; DEBUG_DVC("terminating"); if (drdynvc->channel_mgr != NULL) dvcman_free(drdynvc->channel_mgr); xfree(drdynvc); } DEFINE_SVC_PLUGIN(drdynvc, "drdynvc", CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP | CHANNEL_OPTION_COMPRESS_RDP)
24.592391
100
0.736243
802d8ca885fda8a684611a4692207fd30f28fe32
2,536
h
C
mem-axc-64/apps/macsim.r.d.b.s/macsim-mem-axc-64/gems-lib-ooo/ruby_clean/system/MemoryNode.h
vnaveen0/nachos
99933b0da5474bf43bd167d2540438375237b2d9
[ "MIT" ]
1
2018-02-28T10:00:00.000Z
2018-02-28T10:00:00.000Z
mem-axc-64/apps/macsim.r.d.b.s/macsim-mem-axc-64/gems-lib-ooo/ruby_clean/system/MemoryNode.h
vnaveen0/nachos
99933b0da5474bf43bd167d2540438375237b2d9
[ "MIT" ]
1
2020-04-06T22:30:00.000Z
2020-04-06T22:30:00.000Z
mem-axc-64/apps/macsim.r.d.b.s/macsim-mem-axc-64/gems-lib-ooo/ruby_clean/system/MemoryNode.h
vnaveen0/nachos
99933b0da5474bf43bd167d2540438375237b2d9
[ "MIT" ]
null
null
null
/* * Copyright (c) 1999 by Mark Hill and David Wood for the Wisconsin * Multifacet Project. ALL RIGHTS RESERVED. * * ##HEADER## * * This software is furnished under a license and may be used and * copied only in accordance with the terms of such license and the * inclusion of the above copyright notice. This software or any * other copies thereof or any derivative works may not be provided or * otherwise made available to any other persons. Title to and * ownership of the software is retained by Mark Hill and David Wood. * Any use of this software must include the above copyright notice. * * THIS SOFTWARE IS PROVIDED "AS IS". THE LICENSOR MAKES NO * WARRANTIES ABOUT ITS CORRECTNESS OR PERFORMANCE. * */ /* * EventQueueNode.h * * Description: * This structure records everything known about a single * memory request that is queued in the memory controller. * It is created when the memory request first arrives * at a memory controller and is deleted when the underlying * message is enqueued to be sent back to the directory. * * $Id: MemoryNode.h,v 3.3 2003/12/04 15:01:34 xu Exp $ * */ #ifndef MEMORYNODE_H #define MEMORYNODE_H #include "Global.h" #include "Message.h" #include "MemoryRequestType.h" class MemoryNode { public: // Constructors // old one: MemoryNode(const Time& time, int counter, const MsgPtr& msgptr, const physical_address_t addr, const bool is_mem_read) { m_time = time; m_msg_counter = counter; m_msgptr = msgptr; m_addr = addr; m_is_mem_read = is_mem_read; m_is_dirty_wb = !is_mem_read; } // new one: MemoryNode(const Time& time, const MsgPtr& msgptr, const physical_address_t addr, const bool is_mem_read, const bool is_dirty_wb) { m_time = time; m_msg_counter = 0; m_msgptr = msgptr; m_addr = addr; m_is_mem_read = is_mem_read; m_is_dirty_wb = is_dirty_wb; } // Destructor ~MemoryNode() {}; // Public Methods void print(ostream& out) const; // Data Members (m_ prefix) (all public -- this is really more a struct) Time m_time; int m_msg_counter; MsgPtr m_msgptr; physical_address_t m_addr; bool m_is_mem_read; bool m_is_dirty_wb; }; // Output operator declaration ostream& operator<<(ostream& out, const MemoryNode& obj); // ******************* Definitions ******************* // Output operator definition extern inline ostream& operator<<(ostream& out, const MemoryNode& obj) { obj.print(out); out << flush; return out; } #endif //MEMORYNODE_H
26.416667
134
0.701498
2ea8686e032531d970ccb61688cf3ecf7eff5cd6
3,680
h
C
sdk/js/include/nsIXULBuilderListener.h
qianxj/XExplorer
00e326da03ffcaa21115a2345275452607c6bab5
[ "MIT" ]
null
null
null
sdk/js/include/nsIXULBuilderListener.h
qianxj/XExplorer
00e326da03ffcaa21115a2345275452607c6bab5
[ "MIT" ]
null
null
null
sdk/js/include/nsIXULBuilderListener.h
qianxj/XExplorer
00e326da03ffcaa21115a2345275452607c6bab5
[ "MIT" ]
null
null
null
/* * DO NOT EDIT. THIS FILE IS GENERATED FROM d:/firefox-5.0.1/mozilla-release/content/xul/templates/public/nsIXULBuilderListener.idl */ #ifndef __gen_nsIXULBuilderListener_h__ #define __gen_nsIXULBuilderListener_h__ #ifndef __gen_nsISupports_h__ #include "nsISupports.h" #endif /* For IDL files that don't want to include root IDL files. */ #ifndef NS_NO_VTABLE #define NS_NO_VTABLE #endif class nsIXULTemplateBuilder; /* forward declaration */ /* starting interface: nsIXULBuilderListener */ #define NS_IXULBUILDERLISTENER_IID_STR "ac46be8f-c863-4c23-84a2-d0fcc8dfa9f4" #define NS_IXULBUILDERLISTENER_IID \ {0xac46be8f, 0xc863, 0x4c23, \ { 0x84, 0xa2, 0xd0, 0xfc, 0xc8, 0xdf, 0xa9, 0xf4 }} class NS_NO_VTABLE NS_SCRIPTABLE nsIXULBuilderListener : public nsISupports { public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_IXULBUILDERLISTENER_IID) /** * Called before a template builder rebuilds its content. * @param aBuilder the template builder that rebuilds the content. */ /* void willRebuild (in nsIXULTemplateBuilder aBuilder); */ NS_SCRIPTABLE NS_IMETHOD WillRebuild(nsIXULTemplateBuilder *aBuilder) = 0; /** * Called after a template builder has rebuilt its content. * @param aBuilder the template builder that has rebuilt the content. */ /* void didRebuild (in nsIXULTemplateBuilder aBuilder); */ NS_SCRIPTABLE NS_IMETHOD DidRebuild(nsIXULTemplateBuilder *aBuilder) = 0; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsIXULBuilderListener, NS_IXULBUILDERLISTENER_IID) /* Use this macro when declaring classes that implement this interface. */ #define NS_DECL_NSIXULBUILDERLISTENER \ NS_SCRIPTABLE NS_IMETHOD WillRebuild(nsIXULTemplateBuilder *aBuilder); \ NS_SCRIPTABLE NS_IMETHOD DidRebuild(nsIXULTemplateBuilder *aBuilder); /* Use this macro to declare functions that forward the behavior of this interface to another object. */ #define NS_FORWARD_NSIXULBUILDERLISTENER(_to) \ NS_SCRIPTABLE NS_IMETHOD WillRebuild(nsIXULTemplateBuilder *aBuilder) { return _to WillRebuild(aBuilder); } \ NS_SCRIPTABLE NS_IMETHOD DidRebuild(nsIXULTemplateBuilder *aBuilder) { return _to DidRebuild(aBuilder); } /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ #define NS_FORWARD_SAFE_NSIXULBUILDERLISTENER(_to) \ NS_SCRIPTABLE NS_IMETHOD WillRebuild(nsIXULTemplateBuilder *aBuilder) { return !_to ? NS_ERROR_NULL_POINTER : _to->WillRebuild(aBuilder); } \ NS_SCRIPTABLE NS_IMETHOD DidRebuild(nsIXULTemplateBuilder *aBuilder) { return !_to ? NS_ERROR_NULL_POINTER : _to->DidRebuild(aBuilder); } #if 0 /* Use the code below as a template for the implementation class for this interface. */ /* Header file */ class nsXULBuilderListener : public nsIXULBuilderListener { public: NS_DECL_ISUPPORTS NS_DECL_NSIXULBUILDERLISTENER nsXULBuilderListener(); private: ~nsXULBuilderListener(); protected: /* additional members */ }; /* Implementation file */ NS_IMPL_ISUPPORTS1(nsXULBuilderListener, nsIXULBuilderListener) nsXULBuilderListener::nsXULBuilderListener() { /* member initializers and constructor code */ } nsXULBuilderListener::~nsXULBuilderListener() { /* destructor code */ } /* void willRebuild (in nsIXULTemplateBuilder aBuilder); */ NS_IMETHODIMP nsXULBuilderListener::WillRebuild(nsIXULTemplateBuilder *aBuilder) { return NS_ERROR_NOT_IMPLEMENTED; } /* void didRebuild (in nsIXULTemplateBuilder aBuilder); */ NS_IMETHODIMP nsXULBuilderListener::DidRebuild(nsIXULTemplateBuilder *aBuilder) { return NS_ERROR_NOT_IMPLEMENTED; } /* End of implementation class template. */ #endif #endif /* __gen_nsIXULBuilderListener_h__ */
32.280702
143
0.787228
8374a4f538b8f6a47f217223aec2741b70d7257f
93
c
C
get_next_line/get-next-line-testing/moulitest_files/testframework/fake_rendu/libft_part2/ft_strrchr.c
dnl007/curso-42
f1a1fab9ff3fdc0962069f802c6c9205650aa20b
[ "MIT" ]
null
null
null
get_next_line/get-next-line-testing/moulitest_files/testframework/fake_rendu/libft_part2/ft_strrchr.c
dnl007/curso-42
f1a1fab9ff3fdc0962069f802c6c9205650aa20b
[ "MIT" ]
null
null
null
get_next_line/get-next-line-testing/moulitest_files/testframework/fake_rendu/libft_part2/ft_strrchr.c
dnl007/curso-42
f1a1fab9ff3fdc0962069f802c6c9205650aa20b
[ "MIT" ]
null
null
null
#include <libft.h> char *ft_strrchr(const char *s, int c) { (void)c; return ((char *)s); }
13.285714
38
0.612903
648950c2afe62e831436cb5f015ed870eb859d58
1,043
h
C
hlogistic_generator.h
Hramchenko/attacking_one_chaotic_cipher
5994238ffdbcec42b5e127d54e992307d27fd481
[ "MIT" ]
null
null
null
hlogistic_generator.h
Hramchenko/attacking_one_chaotic_cipher
5994238ffdbcec42b5e127d54e992307d27fd481
[ "MIT" ]
null
null
null
hlogistic_generator.h
Hramchenko/attacking_one_chaotic_cipher
5994238ffdbcec42b5e127d54e992307d27fd481
[ "MIT" ]
null
null
null
#ifndef __hlogistic_generator_H__ #define __hlogistic_generator_H__ #include "hopencl_program.h" struct _hlogistic_generator{ hopencl_program_t* opencl_program; float x_0; unsigned char* key; unsigned char* generators; unsigned int key_length; int values_count; float* x_values; unsigned char* gamma_values; cl_mem mem_key_input; cl_mem mem_generators_input; cl_mem mem_gamma_output; cl_mem mem_x_output; cl_int error; }; typedef struct _hlogistic_generator hlogistic_generator_t; hlogistic_generator_t* hlogistic_generator_create(float x_0, unsigned char* key, unsigned char* generators, unsigned int key_length, float* x_values, unsigned char* gamma_values, int values_count); void hlogistic_generator_init(hlogistic_generator_t* logistic); void hlogistic_generator_process(hlogistic_generator_t* logistic); void hlogistic_generator_print_result(hlogistic_generator_t* logistic); void hlogistic_generator_free(hlogistic_generator_t* logistic); void hlogistic_generator_exec(char* input, char* output); #endif
32.59375
198
0.830297
86086d0ca819959965285afc0d61affcf4a53b22
330
h
C
BlurView/blurviewlib/src/main/cpp/blur.h
JessonYue/OpenGLES2ForAndroid
dd5c786c93b75f3879553bd823722afa712f869a
[ "Apache-2.0" ]
null
null
null
BlurView/blurviewlib/src/main/cpp/blur.h
JessonYue/OpenGLES2ForAndroid
dd5c786c93b75f3879553bd823722afa712f869a
[ "Apache-2.0" ]
null
null
null
BlurView/blurviewlib/src/main/cpp/blur.h
JessonYue/OpenGLES2ForAndroid
dd5c786c93b75f3879553bd823722afa712f869a
[ "Apache-2.0" ]
null
null
null
// // Created by 吴跃 on 2019/1/25. // #ifndef BLURVIEW_BLUR_H #define BLURVIEW_BLUR_H #include <malloc.h> #define ABS(a) ((a)<(0)?(-a):(a)) #define MAX(a, b) ((a)>(b)?(a):(b)) #define MIN(a, b) ((a)<(b)?(a):(b)) int *blur_ARGB_8888(int *, int, int, int); short *blur_RGB_565(short *, int, int, int); #endif //BLURVIEW_BLUR_H
17.368421
44
0.606061
ea9b4e8dd53078057ee15d810754710b7fee885f
601
h
C
lcof_061/cpp_061/Solution1.h
ooooo-youwillsee/leetcode
07b273f133c8cf755ea40b3ae9df242ce044823c
[ "MIT" ]
12
2020-03-18T14:36:23.000Z
2021-12-19T02:24:33.000Z
lcof_061/cpp_061/Solution1.h
ooooo-youwillsee/leetcode
07b273f133c8cf755ea40b3ae9df242ce044823c
[ "MIT" ]
null
null
null
lcof_061/cpp_061/Solution1.h
ooooo-youwillsee/leetcode
07b273f133c8cf755ea40b3ae9df242ce044823c
[ "MIT" ]
null
null
null
// // Created by ooooo on 2020/4/21. // #ifndef CPP_061__SOLUTION1_H_ #define CPP_061__SOLUTION1_H_ #include <iostream> #include <vector> using namespace std; class Solution { public: bool isStraight(vector<int> &nums) { sort(nums.begin(), nums.end()); int count_0 = 0, len = nums.size(); for (int i = 0; i < len && nums[i] == 0; ++i) { count_0++; } int gap = 0; for (int j = count_0 + 1; j < len; ++j) { if (nums[j] == nums[j - 1]) return false; gap += nums[j] - nums[j - 1] - 1; } return gap <= count_0; } }; #endif //CPP_061__SOLUTION1_H_
20.033333
51
0.572379
c129c8a5b3b294b59409f0d4c150aa794f01aa88
51,916
c
C
testsuite/EXP_5/test1800.c
ishiura-compiler/CF3
0718aa176d0303a4ea8a46bd6c794997cbb8fabb
[ "MIT" ]
34
2017-07-04T14:16:12.000Z
2021-04-22T21:04:43.000Z
testsuite/EXP_5/test1800.c
ishiura-compiler/CF3
0718aa176d0303a4ea8a46bd6c794997cbb8fabb
[ "MIT" ]
1
2017-07-06T03:43:44.000Z
2017-07-06T03:43:44.000Z
testsuite/EXP_5/test1800.c
ishiura-compiler/CF3
0718aa176d0303a4ea8a46bd6c794997cbb8fabb
[ "MIT" ]
6
2017-07-04T16:30:42.000Z
2019-10-16T05:37:29.000Z
/* CF3 Copyright (c) 2015 ishiura-lab. Released under the MIT license. https://github.com/ishiura-compiler/CF3/MIT-LICENSE.md */ #include<stdio.h> #include<stdint.h> #include<stdlib.h> #include"test1.h" uint32_t x7 = 98U; volatile uint8_t x8 = 56U; static int64_t x16 = INT64_MIN; volatile int8_t x28 = -12; volatile int32_t x35 = -1; int32_t x36 = INT32_MAX; volatile int32_t t8 = -20719; uint16_t x37 = 3851U; static int32_t x44 = INT32_MIN; int32_t t10 = -29; static int32_t t11 = 199399615; int8_t x52 = INT8_MAX; volatile uint16_t x53 = UINT16_MAX; int64_t x55 = INT64_MIN; int8_t x58 = INT8_MAX; volatile int32_t t14 = 28; int32_t x68 = 144992; volatile uint16_t x76 = UINT16_MAX; static int16_t x92 = INT16_MIN; int8_t x103 = INT8_MIN; int32_t x104 = INT32_MAX; int8_t x105 = 28; volatile uint64_t x112 = 5092157853735061LLU; volatile uint64_t x126 = 7670914795264LLU; static int8_t x129 = INT8_MIN; int32_t t32 = 41; volatile int64_t x134 = INT64_MIN; volatile int32_t t33 = -59804618; int64_t x137 = INT64_MIN; int16_t x139 = INT16_MIN; uint64_t x143 = 3812399168199LLU; int16_t x150 = INT16_MIN; int16_t x152 = 40; static int64_t x161 = 115LL; int16_t x164 = -1; uint8_t x166 = UINT8_MAX; int64_t x170 = INT64_MIN; uint16_t x180 = 6U; volatile uint8_t x181 = UINT8_MAX; static int16_t x183 = -1; uint8_t x185 = 1U; int32_t x191 = INT32_MIN; int8_t x193 = -3; volatile int32_t t48 = -12407; uint32_t x198 = 255069217U; int16_t x206 = 27; volatile int8_t x210 = 20; int64_t x211 = 10257LL; volatile int32_t x219 = -1; int64_t x220 = 63105LL; volatile int32_t t54 = 135681; uint16_t x222 = 3U; static uint8_t x223 = 2U; volatile int32_t t56 = 4881; int32_t x231 = -1; int16_t x236 = INT16_MAX; int32_t t59 = 3; uint64_t x241 = 427114041LLU; int64_t x243 = INT64_MIN; uint64_t x248 = 15013974LLU; int32_t t61 = -1639; int8_t x250 = -56; static int16_t x255 = INT16_MIN; uint8_t x256 = UINT8_MAX; uint64_t x260 = UINT64_MAX; static int64_t x269 = INT64_MIN; uint64_t x270 = 0LLU; volatile int32_t t67 = 63656; volatile int8_t x273 = INT8_MIN; int64_t x275 = INT64_MAX; int64_t x277 = -2882985LL; static int64_t x279 = INT64_MIN; static int32_t x282 = -1; int32_t t73 = -18; int64_t x300 = INT64_MIN; static volatile int32_t t74 = 102619846; static int64_t x309 = INT64_MIN; static volatile uint32_t x311 = UINT32_MAX; int8_t x318 = INT8_MIN; static uint16_t x320 = UINT16_MAX; int32_t x322 = 17892163; static int8_t x324 = -1; static volatile int16_t x328 = INT16_MIN; volatile int32_t t81 = 1095; int32_t t83 = 28291213; int32_t x339 = INT32_MAX; int32_t t84 = -288; int16_t x341 = 817; uint16_t x342 = UINT16_MAX; int32_t x343 = INT32_MIN; static uint32_t x351 = UINT32_MAX; uint64_t x353 = 1067730LLU; uint64_t x363 = UINT64_MAX; uint64_t x365 = 12LLU; int32_t x377 = INT32_MIN; volatile int32_t x378 = INT32_MIN; static volatile int32_t t94 = -1; int64_t x382 = -2992LL; int32_t t99 = 85797473; int8_t x405 = -27; int8_t x406 = INT8_MIN; int16_t x408 = INT16_MIN; int8_t x411 = 3; static int16_t x415 = -1; static volatile uint32_t x420 = 967U; int32_t t104 = 221963; int8_t x421 = INT8_MIN; static int8_t x425 = -1; static int64_t x427 = 775558252LL; int64_t x428 = -1LL; static volatile int32_t t109 = -843712801; uint64_t x450 = 494418445509LLU; int32_t t113 = 7; int64_t x466 = -2LL; static volatile uint16_t x474 = 11U; int64_t x475 = -1955LL; int32_t t118 = 511; static volatile int32_t t120 = 1; volatile int64_t x486 = 461741783137218LL; volatile int32_t t121 = 871635028; volatile int8_t x508 = INT8_MIN; int32_t t126 = 710701; uint16_t x511 = UINT16_MAX; volatile uint16_t x516 = UINT16_MAX; uint8_t x523 = 4U; uint8_t x528 = 5U; int16_t x529 = -1; uint16_t x534 = 3831U; uint32_t x540 = 519U; volatile int32_t x542 = -12017170; int16_t x545 = -1; volatile int8_t x546 = 1; int16_t x547 = 15; int64_t x549 = INT64_MIN; volatile int32_t t137 = -417613; uint64_t x558 = 1014496931LLU; uint8_t x559 = 0U; int16_t x562 = INT16_MIN; uint32_t x570 = 831166969U; int64_t x572 = INT64_MIN; int32_t t142 = 5; int8_t x575 = INT8_MAX; volatile int32_t t143 = 7669; int64_t x584 = INT64_MIN; int32_t t145 = 1; int32_t x588 = INT32_MIN; int32_t t146 = 1267; int8_t x589 = -1; int32_t x590 = INT32_MAX; int8_t x604 = -1; volatile int32_t t151 = -202798; int32_t t152 = 30; int8_t x616 = -1; int32_t t153 = 26681; int16_t x624 = INT16_MIN; int32_t t155 = -16; static int64_t x625 = -1LL; uint32_t x627 = UINT32_MAX; volatile int8_t x632 = -1; int32_t t157 = 36189; uint64_t x641 = UINT64_MAX; static int32_t t161 = -124689187; static volatile uint32_t x652 = 806U; int8_t x655 = 6; uint64_t x662 = 4812LLU; int32_t x665 = INT32_MIN; int8_t x669 = INT8_MAX; static int16_t x674 = -217; int16_t x676 = INT16_MIN; int64_t x678 = INT64_MAX; int64_t x686 = INT64_MAX; static int64_t x691 = -1LL; uint16_t x694 = 0U; int8_t x704 = -1; int64_t x705 = -1LL; static int64_t x707 = INT64_MAX; int16_t x708 = -1; int16_t x709 = -1; int16_t x717 = INT16_MAX; int8_t x722 = -3; int8_t x724 = INT8_MAX; uint32_t x725 = UINT32_MAX; uint32_t x726 = 0U; static volatile int8_t x727 = INT8_MAX; int32_t t181 = -9; int32_t x730 = INT32_MIN; volatile int8_t x731 = INT8_MAX; int32_t t182 = -65355516; int64_t x733 = -1LL; int64_t x734 = INT64_MAX; int32_t t184 = 395641; static int64_t x750 = 2520LL; uint32_t x752 = UINT32_MAX; int8_t x756 = INT8_MIN; int32_t t188 = -9; uint32_t x766 = 8158897U; uint8_t x768 = 7U; int32_t x774 = INT32_MAX; static int32_t t194 = -70062591; int8_t x786 = -1; int16_t x792 = 3862; static uint64_t x796 = UINT64_MAX; volatile int32_t t198 = -572; static int64_t x798 = -1LL; void f0(void) { int16_t x1 = -484; static int16_t x2 = INT16_MIN; int64_t x3 = -1LL; uint16_t x4 = 38U; static volatile int32_t t0 = -11; t0 = (x1==((x2<=x3)*x4)); if (t0 != 0) { NG(); } else { ; } } void f1(void) { int16_t x5 = INT16_MIN; int32_t x6 = INT32_MIN; volatile int32_t t1 = -1197630; t1 = (x5==((x6<=x7)*x8)); if (t1 != 0) { NG(); } else { ; } } void f2(void) { int16_t x9 = -11; int64_t x10 = -1LL; int16_t x11 = 10417; uint16_t x12 = UINT16_MAX; static int32_t t2 = -927519629; t2 = (x9==((x10<=x11)*x12)); if (t2 != 0) { NG(); } else { ; } } void f3(void) { volatile int64_t x13 = -1LL; int16_t x14 = INT16_MIN; volatile int32_t x15 = 100; volatile int32_t t3 = 584; t3 = (x13==((x14<=x15)*x16)); if (t3 != 0) { NG(); } else { ; } } void f4(void) { int64_t x17 = 119231LL; int64_t x18 = 3210366715975LL; int32_t x19 = -1; volatile int8_t x20 = INT8_MAX; static volatile int32_t t4 = 0; t4 = (x17==((x18<=x19)*x20)); if (t4 != 0) { NG(); } else { ; } } void f5(void) { int16_t x21 = INT16_MIN; int16_t x22 = 0; uint8_t x23 = 1U; int16_t x24 = -11; int32_t t5 = 2; t5 = (x21==((x22<=x23)*x24)); if (t5 != 0) { NG(); } else { ; } } void f6(void) { int32_t x25 = INT32_MIN; int16_t x26 = -11; int64_t x27 = INT64_MIN; int32_t t6 = -198; t6 = (x25==((x26<=x27)*x28)); if (t6 != 0) { NG(); } else { ; } } void f7(void) { int8_t x29 = INT8_MAX; int64_t x30 = INT64_MIN; static int8_t x31 = 0; uint64_t x32 = UINT64_MAX; volatile int32_t t7 = 23; t7 = (x29==((x30<=x31)*x32)); if (t7 != 0) { NG(); } else { ; } } void f8(void) { volatile int32_t x33 = -187; static volatile int64_t x34 = INT64_MAX; t8 = (x33==((x34<=x35)*x36)); if (t8 != 0) { NG(); } else { ; } } void f9(void) { int64_t x38 = INT64_MIN; int32_t x39 = -3; static uint8_t x40 = 15U; int32_t t9 = -1393205; t9 = (x37==((x38<=x39)*x40)); if (t9 != 0) { NG(); } else { ; } } void f10(void) { static int32_t x41 = -1; int16_t x42 = -1; volatile uint64_t x43 = 136LLU; t10 = (x41==((x42<=x43)*x44)); if (t10 != 0) { NG(); } else { ; } } void f11(void) { uint8_t x45 = UINT8_MAX; volatile int8_t x46 = -10; int64_t x47 = INT64_MIN; int8_t x48 = INT8_MIN; t11 = (x45==((x46<=x47)*x48)); if (t11 != 0) { NG(); } else { ; } } void f12(void) { uint16_t x49 = 3351U; volatile uint64_t x50 = 1125LLU; volatile int64_t x51 = -1LL; static int32_t t12 = -2258467; t12 = (x49==((x50<=x51)*x52)); if (t12 != 0) { NG(); } else { ; } } void f13(void) { int16_t x54 = -1; int16_t x56 = INT16_MAX; volatile int32_t t13 = 9; t13 = (x53==((x54<=x55)*x56)); if (t13 != 0) { NG(); } else { ; } } void f14(void) { static volatile int16_t x57 = -5; volatile uint8_t x59 = 1U; static volatile int16_t x60 = -9657; t14 = (x57==((x58<=x59)*x60)); if (t14 != 0) { NG(); } else { ; } } void f15(void) { static int32_t x61 = 875; static uint32_t x62 = 860680U; int16_t x63 = INT16_MIN; int16_t x64 = -1; int32_t t15 = 18505258; t15 = (x61==((x62<=x63)*x64)); if (t15 != 0) { NG(); } else { ; } } void f16(void) { int16_t x65 = INT16_MIN; static int64_t x66 = -2850474490390LL; static uint32_t x67 = UINT32_MAX; volatile int32_t t16 = 121878; t16 = (x65==((x66<=x67)*x68)); if (t16 != 0) { NG(); } else { ; } } void f17(void) { static uint16_t x69 = 6U; int8_t x70 = -1; int16_t x71 = INT16_MAX; int8_t x72 = -36; volatile int32_t t17 = -3; t17 = (x69==((x70<=x71)*x72)); if (t17 != 0) { NG(); } else { ; } } void f18(void) { uint16_t x73 = 16281U; volatile uint32_t x74 = 503U; int8_t x75 = INT8_MAX; volatile int32_t t18 = -3; t18 = (x73==((x74<=x75)*x76)); if (t18 != 0) { NG(); } else { ; } } void f19(void) { volatile int8_t x77 = INT8_MIN; int64_t x78 = 20709850LL; int8_t x79 = INT8_MAX; int16_t x80 = INT16_MIN; int32_t t19 = -1; t19 = (x77==((x78<=x79)*x80)); if (t19 != 0) { NG(); } else { ; } } void f20(void) { int16_t x81 = INT16_MIN; uint64_t x82 = UINT64_MAX; int8_t x83 = INT8_MAX; static uint32_t x84 = 145716384U; volatile int32_t t20 = -78040; t20 = (x81==((x82<=x83)*x84)); if (t20 != 0) { NG(); } else { ; } } void f21(void) { volatile int64_t x85 = -719739582275791580LL; static int64_t x86 = INT64_MIN; int32_t x87 = INT32_MIN; int64_t x88 = -1LL; int32_t t21 = -94418242; t21 = (x85==((x86<=x87)*x88)); if (t21 != 0) { NG(); } else { ; } } void f22(void) { int8_t x89 = -1; int16_t x90 = INT16_MAX; int16_t x91 = -1; int32_t t22 = -1605608; t22 = (x89==((x90<=x91)*x92)); if (t22 != 0) { NG(); } else { ; } } void f23(void) { static volatile int16_t x93 = -1; int64_t x94 = -3494875776200LL; uint16_t x95 = 6U; int8_t x96 = 1; static int32_t t23 = -5; t23 = (x93==((x94<=x95)*x96)); if (t23 != 0) { NG(); } else { ; } } void f24(void) { volatile int32_t x97 = 79; int64_t x98 = -7829407407LL; int8_t x99 = INT8_MAX; int64_t x100 = INT64_MAX; static volatile int32_t t24 = 49; t24 = (x97==((x98<=x99)*x100)); if (t24 != 0) { NG(); } else { ; } } void f25(void) { static volatile int8_t x101 = -58; int64_t x102 = -470525LL; int32_t t25 = 112575316; t25 = (x101==((x102<=x103)*x104)); if (t25 != 0) { NG(); } else { ; } } void f26(void) { int64_t x106 = 95289LL; volatile uint64_t x107 = UINT64_MAX; uint64_t x108 = UINT64_MAX; volatile int32_t t26 = -2; t26 = (x105==((x106<=x107)*x108)); if (t26 != 0) { NG(); } else { ; } } void f27(void) { volatile int64_t x109 = INT64_MAX; int16_t x110 = -1; int16_t x111 = -1; int32_t t27 = 125; t27 = (x109==((x110<=x111)*x112)); if (t27 != 0) { NG(); } else { ; } } void f28(void) { volatile uint8_t x113 = UINT8_MAX; static int64_t x114 = INT64_MIN; volatile uint8_t x115 = 20U; int32_t x116 = -10275; static int32_t t28 = 5587; t28 = (x113==((x114<=x115)*x116)); if (t28 != 0) { NG(); } else { ; } } void f29(void) { int8_t x117 = 42; static volatile int64_t x118 = 76091742LL; static int8_t x119 = INT8_MIN; uint64_t x120 = UINT64_MAX; volatile int32_t t29 = 955763445; t29 = (x117==((x118<=x119)*x120)); if (t29 != 0) { NG(); } else { ; } } void f30(void) { int64_t x121 = 554203247946181LL; int32_t x122 = INT32_MIN; int16_t x123 = -1; static int8_t x124 = -1; volatile int32_t t30 = 52411; t30 = (x121==((x122<=x123)*x124)); if (t30 != 0) { NG(); } else { ; } } void f31(void) { volatile uint8_t x125 = UINT8_MAX; int32_t x127 = 176; int32_t x128 = INT32_MAX; int32_t t31 = -38303; t31 = (x125==((x126<=x127)*x128)); if (t31 != 0) { NG(); } else { ; } } void f32(void) { uint32_t x130 = 2U; uint8_t x131 = 44U; uint32_t x132 = UINT32_MAX; t32 = (x129==((x130<=x131)*x132)); if (t32 != 0) { NG(); } else { ; } } void f33(void) { int8_t x133 = INT8_MIN; static int8_t x135 = 25; int32_t x136 = INT32_MIN; t33 = (x133==((x134<=x135)*x136)); if (t33 != 0) { NG(); } else { ; } } void f34(void) { volatile int64_t x138 = INT64_MIN; uint64_t x140 = UINT64_MAX; int32_t t34 = 1901397; t34 = (x137==((x138<=x139)*x140)); if (t34 != 0) { NG(); } else { ; } } void f35(void) { int8_t x141 = INT8_MIN; static int16_t x142 = -809; static uint64_t x144 = 87875LLU; int32_t t35 = -1680; t35 = (x141==((x142<=x143)*x144)); if (t35 != 0) { NG(); } else { ; } } void f36(void) { int64_t x145 = -1LL; static volatile int16_t x146 = INT16_MIN; uint64_t x147 = 2224151038LLU; volatile uint64_t x148 = 2148331864041425LLU; int32_t t36 = -16043521; t36 = (x145==((x146<=x147)*x148)); if (t36 != 0) { NG(); } else { ; } } void f37(void) { int8_t x149 = INT8_MAX; uint64_t x151 = 3LLU; volatile int32_t t37 = 8382071; t37 = (x149==((x150<=x151)*x152)); if (t37 != 0) { NG(); } else { ; } } void f38(void) { static volatile int64_t x153 = INT64_MIN; int32_t x154 = INT32_MAX; volatile uint64_t x155 = 56250253768768540LLU; int32_t x156 = INT32_MIN; volatile int32_t t38 = -86; t38 = (x153==((x154<=x155)*x156)); if (t38 != 0) { NG(); } else { ; } } void f39(void) { uint32_t x157 = 1271985895U; int16_t x158 = INT16_MIN; int16_t x159 = -6; volatile int8_t x160 = INT8_MAX; volatile int32_t t39 = -123052; t39 = (x157==((x158<=x159)*x160)); if (t39 != 0) { NG(); } else { ; } } void f40(void) { static volatile int64_t x162 = 79LL; volatile uint8_t x163 = 55U; int32_t t40 = -33009009; t40 = (x161==((x162<=x163)*x164)); if (t40 != 0) { NG(); } else { ; } } void f41(void) { int64_t x165 = INT64_MAX; volatile int32_t x167 = -1; volatile uint8_t x168 = 1U; volatile int32_t t41 = -1; t41 = (x165==((x166<=x167)*x168)); if (t41 != 0) { NG(); } else { ; } } void f42(void) { int16_t x169 = -1; int32_t x171 = 141926; int8_t x172 = INT8_MIN; int32_t t42 = 53613; t42 = (x169==((x170<=x171)*x172)); if (t42 != 0) { NG(); } else { ; } } void f43(void) { uint32_t x173 = UINT32_MAX; uint8_t x174 = UINT8_MAX; int8_t x175 = -1; static volatile int64_t x176 = INT64_MAX; static volatile int32_t t43 = -138241254; t43 = (x173==((x174<=x175)*x176)); if (t43 != 0) { NG(); } else { ; } } void f44(void) { volatile int8_t x177 = 2; int32_t x178 = INT32_MIN; uint64_t x179 = 104693764672179LLU; volatile int32_t t44 = -2707145; t44 = (x177==((x178<=x179)*x180)); if (t44 != 0) { NG(); } else { ; } } void f45(void) { volatile int64_t x182 = INT64_MIN; volatile int64_t x184 = 135271389268LL; static volatile int32_t t45 = 2268; t45 = (x181==((x182<=x183)*x184)); if (t45 != 0) { NG(); } else { ; } } void f46(void) { int8_t x186 = -1; int32_t x187 = 0; static int32_t x188 = INT32_MAX; static volatile int32_t t46 = -126330929; t46 = (x185==((x186<=x187)*x188)); if (t46 != 0) { NG(); } else { ; } } void f47(void) { volatile int16_t x189 = -1; static int64_t x190 = 2555806320701LL; int16_t x192 = -1; int32_t t47 = 52085; t47 = (x189==((x190<=x191)*x192)); if (t47 != 0) { NG(); } else { ; } } void f48(void) { uint64_t x194 = 7412903086909067376LLU; static int64_t x195 = -1LL; uint32_t x196 = UINT32_MAX; t48 = (x193==((x194<=x195)*x196)); if (t48 != 0) { NG(); } else { ; } } void f49(void) { uint32_t x197 = 68U; volatile int64_t x199 = 8232974014369606LL; int16_t x200 = -1; volatile int32_t t49 = 0; t49 = (x197==((x198<=x199)*x200)); if (t49 != 0) { NG(); } else { ; } } void f50(void) { uint64_t x201 = UINT64_MAX; static volatile uint16_t x202 = UINT16_MAX; volatile int32_t x203 = 714547759; uint8_t x204 = UINT8_MAX; int32_t t50 = 6555; t50 = (x201==((x202<=x203)*x204)); if (t50 != 0) { NG(); } else { ; } } void f51(void) { static int32_t x205 = -88758; static volatile int16_t x207 = INT16_MAX; int32_t x208 = INT32_MIN; static volatile int32_t t51 = -43421; t51 = (x205==((x206<=x207)*x208)); if (t51 != 0) { NG(); } else { ; } } void f52(void) { static uint64_t x209 = 4193789LLU; int64_t x212 = INT64_MIN; int32_t t52 = 30080187; t52 = (x209==((x210<=x211)*x212)); if (t52 != 0) { NG(); } else { ; } } void f53(void) { int8_t x213 = -1; static uint8_t x214 = 10U; int8_t x215 = -1; int8_t x216 = 21; volatile int32_t t53 = -109; t53 = (x213==((x214<=x215)*x216)); if (t53 != 0) { NG(); } else { ; } } void f54(void) { uint32_t x217 = 232205200U; uint16_t x218 = UINT16_MAX; t54 = (x217==((x218<=x219)*x220)); if (t54 != 0) { NG(); } else { ; } } void f55(void) { static volatile int8_t x221 = 0; int32_t x224 = 52; volatile int32_t t55 = 3778240; t55 = (x221==((x222<=x223)*x224)); if (t55 != 1) { NG(); } else { ; } } void f56(void) { volatile uint32_t x225 = 20U; int8_t x226 = -1; uint32_t x227 = UINT32_MAX; int64_t x228 = INT64_MIN; t56 = (x225==((x226<=x227)*x228)); if (t56 != 0) { NG(); } else { ; } } void f57(void) { static uint8_t x229 = UINT8_MAX; uint8_t x230 = 2U; volatile int16_t x232 = 27; volatile int32_t t57 = -242; t57 = (x229==((x230<=x231)*x232)); if (t57 != 0) { NG(); } else { ; } } void f58(void) { uint32_t x233 = 10226676U; uint32_t x234 = UINT32_MAX; int64_t x235 = INT64_MIN; volatile int32_t t58 = 0; t58 = (x233==((x234<=x235)*x236)); if (t58 != 0) { NG(); } else { ; } } void f59(void) { uint16_t x237 = UINT16_MAX; int64_t x238 = INT64_MAX; int64_t x239 = INT64_MAX; volatile uint64_t x240 = UINT64_MAX; t59 = (x237==((x238<=x239)*x240)); if (t59 != 0) { NG(); } else { ; } } void f60(void) { int64_t x242 = -1LL; uint32_t x244 = UINT32_MAX; volatile int32_t t60 = -247321782; t60 = (x241==((x242<=x243)*x244)); if (t60 != 0) { NG(); } else { ; } } void f61(void) { int64_t x245 = -104389062494LL; int32_t x246 = 49; uint32_t x247 = 84U; t61 = (x245==((x246<=x247)*x248)); if (t61 != 0) { NG(); } else { ; } } void f62(void) { volatile uint64_t x249 = UINT64_MAX; uint8_t x251 = 0U; static uint64_t x252 = 45045554930437LLU; volatile int32_t t62 = 524408454; t62 = (x249==((x250<=x251)*x252)); if (t62 != 0) { NG(); } else { ; } } void f63(void) { static volatile int64_t x253 = -9202928047LL; int8_t x254 = INT8_MAX; int32_t t63 = -1682; t63 = (x253==((x254<=x255)*x256)); if (t63 != 0) { NG(); } else { ; } } void f64(void) { static volatile int32_t x257 = 2063585; int64_t x258 = INT64_MIN; uint16_t x259 = UINT16_MAX; int32_t t64 = -45848; t64 = (x257==((x258<=x259)*x260)); if (t64 != 0) { NG(); } else { ; } } void f65(void) { static int16_t x261 = -1889; static uint8_t x262 = 30U; int16_t x263 = -1; int16_t x264 = INT16_MAX; static volatile int32_t t65 = -1; t65 = (x261==((x262<=x263)*x264)); if (t65 != 0) { NG(); } else { ; } } void f66(void) { uint16_t x265 = 6330U; int16_t x266 = -1; int32_t x267 = 532947153; volatile int8_t x268 = INT8_MAX; volatile int32_t t66 = -49492658; t66 = (x265==((x266<=x267)*x268)); if (t66 != 0) { NG(); } else { ; } } void f67(void) { static int8_t x271 = -1; int32_t x272 = INT32_MIN; t67 = (x269==((x270<=x271)*x272)); if (t67 != 0) { NG(); } else { ; } } void f68(void) { int16_t x274 = INT16_MIN; uint8_t x276 = 2U; volatile int32_t t68 = -7; t68 = (x273==((x274<=x275)*x276)); if (t68 != 0) { NG(); } else { ; } } void f69(void) { uint16_t x278 = UINT16_MAX; int8_t x280 = -16; volatile int32_t t69 = -446912027; t69 = (x277==((x278<=x279)*x280)); if (t69 != 0) { NG(); } else { ; } } void f70(void) { volatile uint32_t x281 = 17115382U; int16_t x283 = INT16_MIN; uint32_t x284 = 36U; int32_t t70 = 112022; t70 = (x281==((x282<=x283)*x284)); if (t70 != 0) { NG(); } else { ; } } void f71(void) { int16_t x285 = -1; uint8_t x286 = 4U; volatile uint32_t x287 = 77696579U; uint32_t x288 = 59U; int32_t t71 = -114246806; t71 = (x285==((x286<=x287)*x288)); if (t71 != 0) { NG(); } else { ; } } void f72(void) { static int8_t x289 = -1; uint8_t x290 = 1U; static int16_t x291 = INT16_MIN; int16_t x292 = -1; static volatile int32_t t72 = -492928; t72 = (x289==((x290<=x291)*x292)); if (t72 != 0) { NG(); } else { ; } } void f73(void) { int64_t x293 = -1LL; int16_t x294 = -24; int8_t x295 = -1; int32_t x296 = INT32_MAX; t73 = (x293==((x294<=x295)*x296)); if (t73 != 0) { NG(); } else { ; } } void f74(void) { uint32_t x297 = 2900261U; uint64_t x298 = 70412029105828LLU; volatile int32_t x299 = INT32_MAX; t74 = (x297==((x298<=x299)*x300)); if (t74 != 0) { NG(); } else { ; } } void f75(void) { static int16_t x301 = INT16_MIN; static int64_t x302 = 73711891982125070LL; uint32_t x303 = 189446U; volatile int32_t x304 = INT32_MIN; int32_t t75 = -630; t75 = (x301==((x302<=x303)*x304)); if (t75 != 0) { NG(); } else { ; } } void f76(void) { static uint32_t x305 = 133444397U; uint64_t x306 = 505166715346334813LLU; uint8_t x307 = UINT8_MAX; int16_t x308 = 6; static volatile int32_t t76 = 2; t76 = (x305==((x306<=x307)*x308)); if (t76 != 0) { NG(); } else { ; } } void f77(void) { int16_t x310 = -1; int8_t x312 = INT8_MAX; volatile int32_t t77 = 168; t77 = (x309==((x310<=x311)*x312)); if (t77 != 0) { NG(); } else { ; } } void f78(void) { static uint8_t x313 = 1U; static int16_t x314 = -1; static uint64_t x315 = 155905231LLU; volatile int64_t x316 = INT64_MIN; volatile int32_t t78 = -981684; t78 = (x313==((x314<=x315)*x316)); if (t78 != 0) { NG(); } else { ; } } void f79(void) { int32_t x317 = INT32_MIN; static int8_t x319 = 0; int32_t t79 = -669; t79 = (x317==((x318<=x319)*x320)); if (t79 != 0) { NG(); } else { ; } } void f80(void) { volatile int32_t x321 = -1; volatile int64_t x323 = 314LL; int32_t t80 = -19514; t80 = (x321==((x322<=x323)*x324)); if (t80 != 0) { NG(); } else { ; } } void f81(void) { int64_t x325 = -1022898378173LL; uint32_t x326 = 2U; uint32_t x327 = 222822U; t81 = (x325==((x326<=x327)*x328)); if (t81 != 0) { NG(); } else { ; } } void f82(void) { volatile int64_t x329 = INT64_MIN; int16_t x330 = 838; static int16_t x331 = INT16_MAX; int32_t x332 = INT32_MIN; int32_t t82 = 247146; t82 = (x329==((x330<=x331)*x332)); if (t82 != 0) { NG(); } else { ; } } void f83(void) { int8_t x333 = -1; uint8_t x334 = 4U; static uint16_t x335 = 10U; int32_t x336 = INT32_MAX; t83 = (x333==((x334<=x335)*x336)); if (t83 != 0) { NG(); } else { ; } } void f84(void) { static int8_t x337 = INT8_MAX; int16_t x338 = INT16_MIN; int8_t x340 = INT8_MIN; t84 = (x337==((x338<=x339)*x340)); if (t84 != 0) { NG(); } else { ; } } void f85(void) { static int64_t x344 = 259160LL; int32_t t85 = -436956; t85 = (x341==((x342<=x343)*x344)); if (t85 != 0) { NG(); } else { ; } } void f86(void) { int16_t x345 = INT16_MIN; static volatile uint32_t x346 = UINT32_MAX; uint64_t x347 = UINT64_MAX; static volatile int64_t x348 = INT64_MAX; volatile int32_t t86 = -2767591; t86 = (x345==((x346<=x347)*x348)); if (t86 != 0) { NG(); } else { ; } } void f87(void) { int8_t x349 = INT8_MAX; int16_t x350 = INT16_MIN; static uint64_t x352 = 1012125615LLU; volatile int32_t t87 = 455; t87 = (x349==((x350<=x351)*x352)); if (t87 != 0) { NG(); } else { ; } } void f88(void) { uint16_t x354 = UINT16_MAX; int8_t x355 = 2; static int32_t x356 = 7565; int32_t t88 = 282571022; t88 = (x353==((x354<=x355)*x356)); if (t88 != 0) { NG(); } else { ; } } void f89(void) { int8_t x357 = -2; static int64_t x358 = -1LL; volatile int32_t x359 = INT32_MIN; int32_t x360 = 23132347; int32_t t89 = 186293809; t89 = (x357==((x358<=x359)*x360)); if (t89 != 0) { NG(); } else { ; } } void f90(void) { uint8_t x361 = 11U; int64_t x362 = 5533699808622LL; int8_t x364 = INT8_MIN; int32_t t90 = 0; t90 = (x361==((x362<=x363)*x364)); if (t90 != 0) { NG(); } else { ; } } void f91(void) { uint8_t x366 = 0U; static uint64_t x367 = 8609829170LLU; int16_t x368 = -1; volatile int32_t t91 = -2490; t91 = (x365==((x366<=x367)*x368)); if (t91 != 0) { NG(); } else { ; } } void f92(void) { uint8_t x369 = 1U; static int16_t x370 = INT16_MIN; int8_t x371 = INT8_MIN; volatile int16_t x372 = INT16_MIN; int32_t t92 = -103434418; t92 = (x369==((x370<=x371)*x372)); if (t92 != 0) { NG(); } else { ; } } void f93(void) { static int8_t x373 = INT8_MIN; uint8_t x374 = 0U; int32_t x375 = -29166976; int8_t x376 = 10; static volatile int32_t t93 = -23815; t93 = (x373==((x374<=x375)*x376)); if (t93 != 0) { NG(); } else { ; } } void f94(void) { uint64_t x379 = 96830LLU; volatile int64_t x380 = INT64_MIN; t94 = (x377==((x378<=x379)*x380)); if (t94 != 0) { NG(); } else { ; } } void f95(void) { int8_t x381 = 0; volatile int64_t x383 = INT64_MIN; int32_t x384 = INT32_MIN; int32_t t95 = -385851; t95 = (x381==((x382<=x383)*x384)); if (t95 != 1) { NG(); } else { ; } } void f96(void) { volatile int16_t x385 = INT16_MIN; int64_t x386 = 1763258831LL; int64_t x387 = INT64_MAX; int16_t x388 = INT16_MAX; volatile int32_t t96 = -22; t96 = (x385==((x386<=x387)*x388)); if (t96 != 0) { NG(); } else { ; } } void f97(void) { uint64_t x389 = 1979472764746LLU; uint8_t x390 = 30U; static volatile int8_t x391 = INT8_MIN; int32_t x392 = -6; int32_t t97 = 1; t97 = (x389==((x390<=x391)*x392)); if (t97 != 0) { NG(); } else { ; } } void f98(void) { uint32_t x393 = 1968524469U; volatile int16_t x394 = INT16_MIN; int64_t x395 = INT64_MAX; static uint8_t x396 = 1U; volatile int32_t t98 = -3; t98 = (x393==((x394<=x395)*x396)); if (t98 != 0) { NG(); } else { ; } } void f99(void) { int64_t x397 = INT64_MIN; int32_t x398 = INT32_MIN; uint64_t x399 = 36353812979LLU; int64_t x400 = -704LL; t99 = (x397==((x398<=x399)*x400)); if (t99 != 0) { NG(); } else { ; } } void f100(void) { uint64_t x401 = UINT64_MAX; volatile int16_t x402 = -1; static int64_t x403 = INT64_MIN; volatile int64_t x404 = INT64_MIN; static int32_t t100 = -47374059; t100 = (x401==((x402<=x403)*x404)); if (t100 != 0) { NG(); } else { ; } } void f101(void) { uint64_t x407 = 14699959288LLU; volatile int32_t t101 = -316; t101 = (x405==((x406<=x407)*x408)); if (t101 != 0) { NG(); } else { ; } } void f102(void) { volatile int32_t x409 = -12866145; int8_t x410 = INT8_MIN; int64_t x412 = INT64_MIN; volatile int32_t t102 = 0; t102 = (x409==((x410<=x411)*x412)); if (t102 != 0) { NG(); } else { ; } } void f103(void) { uint64_t x413 = 8247730247816149LLU; static int64_t x414 = -1LL; volatile uint16_t x416 = 76U; static volatile int32_t t103 = -13314619; t103 = (x413==((x414<=x415)*x416)); if (t103 != 0) { NG(); } else { ; } } void f104(void) { volatile int32_t x417 = INT32_MIN; int32_t x418 = INT32_MIN; static int16_t x419 = INT16_MIN; t104 = (x417==((x418<=x419)*x420)); if (t104 != 0) { NG(); } else { ; } } void f105(void) { int8_t x422 = -1; static uint8_t x423 = UINT8_MAX; int32_t x424 = 1184762; static int32_t t105 = 3639; t105 = (x421==((x422<=x423)*x424)); if (t105 != 0) { NG(); } else { ; } } void f106(void) { static int16_t x426 = -50; int32_t t106 = -197816; t106 = (x425==((x426<=x427)*x428)); if (t106 != 1) { NG(); } else { ; } } void f107(void) { int32_t x429 = INT32_MIN; uint64_t x430 = UINT64_MAX; uint64_t x431 = 2490635418836209676LLU; static int8_t x432 = -39; volatile int32_t t107 = 32861974; t107 = (x429==((x430<=x431)*x432)); if (t107 != 0) { NG(); } else { ; } } void f108(void) { int32_t x433 = INT32_MIN; uint64_t x434 = 1578470LLU; int8_t x435 = INT8_MIN; int32_t x436 = INT32_MIN; volatile int32_t t108 = 990738; t108 = (x433==((x434<=x435)*x436)); if (t108 != 1) { NG(); } else { ; } } void f109(void) { uint8_t x437 = 2U; uint32_t x438 = 4U; static uint8_t x439 = UINT8_MAX; volatile int32_t x440 = 1040; t109 = (x437==((x438<=x439)*x440)); if (t109 != 0) { NG(); } else { ; } } void f110(void) { static uint16_t x441 = UINT16_MAX; int8_t x442 = -1; static volatile int64_t x443 = INT64_MIN; int64_t x444 = INT64_MAX; int32_t t110 = -533340755; t110 = (x441==((x442<=x443)*x444)); if (t110 != 0) { NG(); } else { ; } } void f111(void) { uint64_t x445 = 10832738805213LLU; int8_t x446 = -1; uint8_t x447 = 1U; static int64_t x448 = 103LL; volatile int32_t t111 = -244; t111 = (x445==((x446<=x447)*x448)); if (t111 != 0) { NG(); } else { ; } } void f112(void) { static int32_t x449 = 780; int8_t x451 = INT8_MIN; static int32_t x452 = INT32_MIN; int32_t t112 = 1; t112 = (x449==((x450<=x451)*x452)); if (t112 != 0) { NG(); } else { ; } } void f113(void) { volatile int16_t x453 = INT16_MAX; static int32_t x454 = -49153736; int16_t x455 = -1; int16_t x456 = 39; t113 = (x453==((x454<=x455)*x456)); if (t113 != 0) { NG(); } else { ; } } void f114(void) { uint32_t x457 = UINT32_MAX; uint32_t x458 = 16943195U; int8_t x459 = INT8_MAX; int8_t x460 = -10; volatile int32_t t114 = -904; t114 = (x457==((x458<=x459)*x460)); if (t114 != 0) { NG(); } else { ; } } void f115(void) { int32_t x461 = INT32_MAX; static int32_t x462 = INT32_MAX; int8_t x463 = -1; uint32_t x464 = 37349U; static int32_t t115 = -8696018; t115 = (x461==((x462<=x463)*x464)); if (t115 != 0) { NG(); } else { ; } } void f116(void) { volatile int16_t x465 = -1; uint16_t x467 = 1U; int64_t x468 = INT64_MIN; int32_t t116 = -1524; t116 = (x465==((x466<=x467)*x468)); if (t116 != 0) { NG(); } else { ; } } void f117(void) { uint16_t x469 = 31U; static uint32_t x470 = 172U; int8_t x471 = -1; int8_t x472 = INT8_MIN; static volatile int32_t t117 = 1115; t117 = (x469==((x470<=x471)*x472)); if (t117 != 0) { NG(); } else { ; } } void f118(void) { int32_t x473 = -72656; int32_t x476 = INT32_MIN; t118 = (x473==((x474<=x475)*x476)); if (t118 != 0) { NG(); } else { ; } } void f119(void) { uint64_t x477 = 37596253523079LLU; volatile int32_t x478 = INT32_MIN; static uint16_t x479 = UINT16_MAX; static uint8_t x480 = 0U; int32_t t119 = -470120130; t119 = (x477==((x478<=x479)*x480)); if (t119 != 0) { NG(); } else { ; } } void f120(void) { volatile int8_t x481 = 13; volatile int32_t x482 = INT32_MAX; volatile uint64_t x483 = 3389809551LLU; static int16_t x484 = 93; t120 = (x481==((x482<=x483)*x484)); if (t120 != 0) { NG(); } else { ; } } void f121(void) { int16_t x485 = INT16_MIN; uint16_t x487 = UINT16_MAX; static int16_t x488 = INT16_MIN; t121 = (x485==((x486<=x487)*x488)); if (t121 != 0) { NG(); } else { ; } } void f122(void) { int16_t x489 = -1; int16_t x490 = -6; int16_t x491 = INT16_MIN; static uint64_t x492 = 424756975LLU; int32_t t122 = 3820488; t122 = (x489==((x490<=x491)*x492)); if (t122 != 0) { NG(); } else { ; } } void f123(void) { static volatile int32_t x493 = -1; static uint8_t x494 = 0U; static int32_t x495 = -1; volatile int8_t x496 = -41; int32_t t123 = -1125112; t123 = (x493==((x494<=x495)*x496)); if (t123 != 0) { NG(); } else { ; } } void f124(void) { static int8_t x497 = 3; volatile uint32_t x498 = 109005968U; volatile int32_t x499 = 76700191; uint8_t x500 = 2U; volatile int32_t t124 = 26; t124 = (x497==((x498<=x499)*x500)); if (t124 != 0) { NG(); } else { ; } } void f125(void) { int8_t x501 = INT8_MAX; int64_t x502 = INT64_MIN; int8_t x503 = -35; int64_t x504 = -1136452972304078LL; static volatile int32_t t125 = -96575; t125 = (x501==((x502<=x503)*x504)); if (t125 != 0) { NG(); } else { ; } } void f126(void) { int64_t x505 = -255196949343381LL; static volatile uint16_t x506 = 3342U; int16_t x507 = INT16_MIN; t126 = (x505==((x506<=x507)*x508)); if (t126 != 0) { NG(); } else { ; } } void f127(void) { int64_t x509 = INT64_MIN; uint16_t x510 = UINT16_MAX; static int8_t x512 = INT8_MIN; int32_t t127 = -1; t127 = (x509==((x510<=x511)*x512)); if (t127 != 0) { NG(); } else { ; } } void f128(void) { uint16_t x513 = 6U; int32_t x514 = -1; int32_t x515 = INT32_MAX; int32_t t128 = -2; t128 = (x513==((x514<=x515)*x516)); if (t128 != 0) { NG(); } else { ; } } void f129(void) { uint16_t x517 = UINT16_MAX; int8_t x518 = INT8_MIN; int32_t x519 = 1; volatile uint64_t x520 = UINT64_MAX; volatile int32_t t129 = 12951792; t129 = (x517==((x518<=x519)*x520)); if (t129 != 0) { NG(); } else { ; } } void f130(void) { int32_t x521 = INT32_MAX; int32_t x522 = -2; int8_t x524 = INT8_MIN; volatile int32_t t130 = -26927226; t130 = (x521==((x522<=x523)*x524)); if (t130 != 0) { NG(); } else { ; } } void f131(void) { static volatile int8_t x525 = -1; int64_t x526 = 18617569233748LL; static volatile int64_t x527 = -1LL; int32_t t131 = -5066; t131 = (x525==((x526<=x527)*x528)); if (t131 != 0) { NG(); } else { ; } } void f132(void) { int16_t x530 = INT16_MIN; static int64_t x531 = 2542034935LL; volatile int8_t x532 = INT8_MAX; volatile int32_t t132 = -26815605; t132 = (x529==((x530<=x531)*x532)); if (t132 != 0) { NG(); } else { ; } } void f133(void) { static int16_t x533 = INT16_MIN; int64_t x535 = INT64_MAX; volatile int64_t x536 = INT64_MIN; volatile int32_t t133 = -1; t133 = (x533==((x534<=x535)*x536)); if (t133 != 0) { NG(); } else { ; } } void f134(void) { int32_t x537 = 39490; int8_t x538 = -5; int8_t x539 = INT8_MAX; static volatile int32_t t134 = -3; t134 = (x537==((x538<=x539)*x540)); if (t134 != 0) { NG(); } else { ; } } void f135(void) { uint16_t x541 = 168U; int64_t x543 = -301563341698924LL; int16_t x544 = -1; volatile int32_t t135 = -306387786; t135 = (x541==((x542<=x543)*x544)); if (t135 != 0) { NG(); } else { ; } } void f136(void) { volatile int32_t x548 = 26966; int32_t t136 = -54; t136 = (x545==((x546<=x547)*x548)); if (t136 != 0) { NG(); } else { ; } } void f137(void) { volatile uint8_t x550 = 31U; uint64_t x551 = UINT64_MAX; volatile uint32_t x552 = UINT32_MAX; t137 = (x549==((x550<=x551)*x552)); if (t137 != 0) { NG(); } else { ; } } void f138(void) { uint32_t x553 = UINT32_MAX; int32_t x554 = INT32_MAX; int8_t x555 = 57; int64_t x556 = INT64_MAX; int32_t t138 = -12; t138 = (x553==((x554<=x555)*x556)); if (t138 != 0) { NG(); } else { ; } } void f139(void) { volatile uint8_t x557 = 14U; int64_t x560 = INT64_MIN; static volatile int32_t t139 = 39433; t139 = (x557==((x558<=x559)*x560)); if (t139 != 0) { NG(); } else { ; } } void f140(void) { volatile uint8_t x561 = UINT8_MAX; int64_t x563 = INT64_MIN; static int8_t x564 = -1; volatile int32_t t140 = -1046856004; t140 = (x561==((x562<=x563)*x564)); if (t140 != 0) { NG(); } else { ; } } void f141(void) { static volatile int16_t x565 = 0; uint64_t x566 = UINT64_MAX; int64_t x567 = INT64_MIN; int64_t x568 = INT64_MAX; int32_t t141 = 98303789; t141 = (x565==((x566<=x567)*x568)); if (t141 != 1) { NG(); } else { ; } } void f142(void) { int8_t x569 = 1; volatile int16_t x571 = 0; t142 = (x569==((x570<=x571)*x572)); if (t142 != 0) { NG(); } else { ; } } void f143(void) { int8_t x573 = -10; uint32_t x574 = UINT32_MAX; int8_t x576 = INT8_MIN; t143 = (x573==((x574<=x575)*x576)); if (t143 != 0) { NG(); } else { ; } } void f144(void) { int64_t x577 = INT64_MIN; volatile int64_t x578 = INT64_MIN; uint16_t x579 = UINT16_MAX; int8_t x580 = INT8_MAX; int32_t t144 = 323379795; t144 = (x577==((x578<=x579)*x580)); if (t144 != 0) { NG(); } else { ; } } void f145(void) { int16_t x581 = -23; int16_t x582 = INT16_MIN; uint8_t x583 = 10U; t145 = (x581==((x582<=x583)*x584)); if (t145 != 0) { NG(); } else { ; } } void f146(void) { int16_t x585 = INT16_MAX; int32_t x586 = -1; int16_t x587 = -2; t146 = (x585==((x586<=x587)*x588)); if (t146 != 0) { NG(); } else { ; } } void f147(void) { volatile int16_t x591 = 15547; volatile int32_t x592 = 156; static volatile int32_t t147 = 92465; t147 = (x589==((x590<=x591)*x592)); if (t147 != 0) { NG(); } else { ; } } void f148(void) { volatile uint16_t x593 = UINT16_MAX; volatile int16_t x594 = 3350; volatile uint16_t x595 = 84U; static int8_t x596 = INT8_MIN; static int32_t t148 = 174; t148 = (x593==((x594<=x595)*x596)); if (t148 != 0) { NG(); } else { ; } } void f149(void) { uint16_t x597 = 2094U; volatile int64_t x598 = INT64_MIN; static uint16_t x599 = 354U; volatile uint32_t x600 = 38879U; static int32_t t149 = 0; t149 = (x597==((x598<=x599)*x600)); if (t149 != 0) { NG(); } else { ; } } void f150(void) { int32_t x601 = INT32_MIN; int16_t x602 = 1; uint32_t x603 = 46359U; volatile int32_t t150 = 3694962; t150 = (x601==((x602<=x603)*x604)); if (t150 != 0) { NG(); } else { ; } } void f151(void) { uint32_t x605 = 8U; static int32_t x606 = INT32_MAX; static int64_t x607 = INT64_MIN; int32_t x608 = INT32_MIN; t151 = (x605==((x606<=x607)*x608)); if (t151 != 0) { NG(); } else { ; } } void f152(void) { uint16_t x609 = UINT16_MAX; int8_t x610 = INT8_MIN; int32_t x611 = -1; int64_t x612 = INT64_MIN; t152 = (x609==((x610<=x611)*x612)); if (t152 != 0) { NG(); } else { ; } } void f153(void) { int64_t x613 = 11LL; static uint8_t x614 = 1U; static uint16_t x615 = 15U; t153 = (x613==((x614<=x615)*x616)); if (t153 != 0) { NG(); } else { ; } } void f154(void) { int64_t x617 = 28817302004462264LL; int32_t x618 = 754680; int64_t x619 = INT64_MAX; uint16_t x620 = 1142U; int32_t t154 = -497401885; t154 = (x617==((x618<=x619)*x620)); if (t154 != 0) { NG(); } else { ; } } void f155(void) { uint64_t x621 = UINT64_MAX; uint64_t x622 = UINT64_MAX; uint8_t x623 = UINT8_MAX; t155 = (x621==((x622<=x623)*x624)); if (t155 != 0) { NG(); } else { ; } } void f156(void) { uint32_t x626 = 1400U; int16_t x628 = -122; volatile int32_t t156 = 4190357; t156 = (x625==((x626<=x627)*x628)); if (t156 != 0) { NG(); } else { ; } } void f157(void) { volatile int16_t x629 = -1918; volatile int16_t x630 = INT16_MIN; static int32_t x631 = 10; t157 = (x629==((x630<=x631)*x632)); if (t157 != 0) { NG(); } else { ; } } void f158(void) { int64_t x633 = INT64_MAX; int8_t x634 = -33; uint8_t x635 = UINT8_MAX; int32_t x636 = -1; volatile int32_t t158 = 1728458; t158 = (x633==((x634<=x635)*x636)); if (t158 != 0) { NG(); } else { ; } } void f159(void) { static int8_t x637 = -1; static uint8_t x638 = 5U; static uint64_t x639 = 1188031604152497LLU; int64_t x640 = INT64_MIN; volatile int32_t t159 = 671; t159 = (x637==((x638<=x639)*x640)); if (t159 != 0) { NG(); } else { ; } } void f160(void) { uint32_t x642 = 31U; int32_t x643 = INT32_MIN; static int8_t x644 = -1; volatile int32_t t160 = 15065; t160 = (x641==((x642<=x643)*x644)); if (t160 != 1) { NG(); } else { ; } } void f161(void) { uint32_t x645 = UINT32_MAX; uint8_t x646 = UINT8_MAX; volatile int64_t x647 = INT64_MAX; volatile int64_t x648 = -256500650LL; t161 = (x645==((x646<=x647)*x648)); if (t161 != 0) { NG(); } else { ; } } void f162(void) { static int64_t x649 = -13891550142765LL; int32_t x650 = INT32_MAX; int8_t x651 = 7; int32_t t162 = 0; t162 = (x649==((x650<=x651)*x652)); if (t162 != 0) { NG(); } else { ; } } void f163(void) { volatile uint64_t x653 = UINT64_MAX; int32_t x654 = INT32_MAX; static int8_t x656 = INT8_MAX; volatile int32_t t163 = -102287098; t163 = (x653==((x654<=x655)*x656)); if (t163 != 0) { NG(); } else { ; } } void f164(void) { volatile uint8_t x657 = 15U; int32_t x658 = INT32_MAX; uint8_t x659 = 42U; static int16_t x660 = 0; int32_t t164 = -702528101; t164 = (x657==((x658<=x659)*x660)); if (t164 != 0) { NG(); } else { ; } } void f165(void) { int32_t x661 = -12103704; volatile int8_t x663 = -1; static uint16_t x664 = UINT16_MAX; static int32_t t165 = -117882; t165 = (x661==((x662<=x663)*x664)); if (t165 != 0) { NG(); } else { ; } } void f166(void) { int32_t x666 = -1; int32_t x667 = -3392; int16_t x668 = -244; volatile int32_t t166 = -158681524; t166 = (x665==((x666<=x667)*x668)); if (t166 != 0) { NG(); } else { ; } } void f167(void) { uint8_t x670 = UINT8_MAX; static volatile int64_t x671 = INT64_MAX; uint64_t x672 = 159652929576LLU; int32_t t167 = -1018821037; t167 = (x669==((x670<=x671)*x672)); if (t167 != 0) { NG(); } else { ; } } void f168(void) { volatile int8_t x673 = INT8_MIN; static int32_t x675 = 37976287; volatile int32_t t168 = -2; t168 = (x673==((x674<=x675)*x676)); if (t168 != 0) { NG(); } else { ; } } void f169(void) { uint32_t x677 = 79840U; int16_t x679 = INT16_MAX; uint64_t x680 = 4465751LLU; int32_t t169 = -3; t169 = (x677==((x678<=x679)*x680)); if (t169 != 0) { NG(); } else { ; } } void f170(void) { uint16_t x681 = UINT16_MAX; volatile int16_t x682 = INT16_MAX; uint8_t x683 = 6U; static int64_t x684 = INT64_MIN; int32_t t170 = -4810294; t170 = (x681==((x682<=x683)*x684)); if (t170 != 0) { NG(); } else { ; } } void f171(void) { volatile int16_t x685 = -1; int64_t x687 = INT64_MAX; int8_t x688 = INT8_MAX; static volatile int32_t t171 = -21592715; t171 = (x685==((x686<=x687)*x688)); if (t171 != 0) { NG(); } else { ; } } void f172(void) { uint16_t x689 = UINT16_MAX; int64_t x690 = INT64_MAX; int32_t x692 = INT32_MIN; volatile int32_t t172 = 84179676; t172 = (x689==((x690<=x691)*x692)); if (t172 != 0) { NG(); } else { ; } } void f173(void) { volatile int16_t x693 = -1; int32_t x695 = -1; volatile int64_t x696 = INT64_MIN; volatile int32_t t173 = 0; t173 = (x693==((x694<=x695)*x696)); if (t173 != 0) { NG(); } else { ; } } void f174(void) { int8_t x697 = INT8_MAX; static volatile int64_t x698 = INT64_MAX; int8_t x699 = INT8_MIN; int16_t x700 = INT16_MIN; volatile int32_t t174 = 0; t174 = (x697==((x698<=x699)*x700)); if (t174 != 0) { NG(); } else { ; } } void f175(void) { uint64_t x701 = UINT64_MAX; int8_t x702 = INT8_MAX; int8_t x703 = INT8_MAX; volatile int32_t t175 = -49947534; t175 = (x701==((x702<=x703)*x704)); if (t175 != 1) { NG(); } else { ; } } void f176(void) { int64_t x706 = INT64_MIN; int32_t t176 = -10; t176 = (x705==((x706<=x707)*x708)); if (t176 != 1) { NG(); } else { ; } } void f177(void) { uint16_t x710 = 232U; int32_t x711 = -1; int32_t x712 = -96233293; int32_t t177 = 154; t177 = (x709==((x710<=x711)*x712)); if (t177 != 0) { NG(); } else { ; } } void f178(void) { uint16_t x713 = 26U; static volatile uint32_t x714 = 19U; int16_t x715 = -10131; static int16_t x716 = -1; int32_t t178 = -20; t178 = (x713==((x714<=x715)*x716)); if (t178 != 0) { NG(); } else { ; } } void f179(void) { static volatile uint64_t x718 = UINT64_MAX; int32_t x719 = INT32_MIN; int8_t x720 = -1; int32_t t179 = -817; t179 = (x717==((x718<=x719)*x720)); if (t179 != 0) { NG(); } else { ; } } void f180(void) { static int16_t x721 = -85; static uint16_t x723 = 50U; volatile int32_t t180 = 1745783; t180 = (x721==((x722<=x723)*x724)); if (t180 != 0) { NG(); } else { ; } } void f181(void) { static volatile int64_t x728 = INT64_MIN; t181 = (x725==((x726<=x727)*x728)); if (t181 != 0) { NG(); } else { ; } } void f182(void) { volatile int64_t x729 = INT64_MIN; int64_t x732 = -1LL; t182 = (x729==((x730<=x731)*x732)); if (t182 != 0) { NG(); } else { ; } } void f183(void) { int16_t x735 = -4; uint32_t x736 = 31U; static int32_t t183 = -3; t183 = (x733==((x734<=x735)*x736)); if (t183 != 0) { NG(); } else { ; } } void f184(void) { static uint16_t x737 = UINT16_MAX; volatile int8_t x738 = 56; int32_t x739 = -1; int64_t x740 = INT64_MIN; t184 = (x737==((x738<=x739)*x740)); if (t184 != 0) { NG(); } else { ; } } void f185(void) { int16_t x741 = -1; int8_t x742 = 1; int32_t x743 = 1107276; int8_t x744 = INT8_MAX; volatile int32_t t185 = 73620; t185 = (x741==((x742<=x743)*x744)); if (t185 != 0) { NG(); } else { ; } } void f186(void) { static volatile uint16_t x745 = UINT16_MAX; volatile uint16_t x746 = 4318U; volatile int8_t x747 = INT8_MIN; volatile int32_t x748 = -9; int32_t t186 = -88272; t186 = (x745==((x746<=x747)*x748)); if (t186 != 0) { NG(); } else { ; } } void f187(void) { static uint32_t x749 = 962382497U; uint32_t x751 = UINT32_MAX; volatile int32_t t187 = -2339; t187 = (x749==((x750<=x751)*x752)); if (t187 != 0) { NG(); } else { ; } } void f188(void) { int32_t x753 = INT32_MIN; static int32_t x754 = INT32_MIN; static int64_t x755 = -1LL; t188 = (x753==((x754<=x755)*x756)); if (t188 != 0) { NG(); } else { ; } } void f189(void) { static int8_t x757 = 27; int8_t x758 = INT8_MIN; volatile int16_t x759 = 1; static volatile int16_t x760 = -1; volatile int32_t t189 = 1; t189 = (x757==((x758<=x759)*x760)); if (t189 != 0) { NG(); } else { ; } } void f190(void) { int32_t x761 = -1; volatile uint16_t x762 = 7U; int32_t x763 = 20427; static int8_t x764 = INT8_MIN; volatile int32_t t190 = -344319; t190 = (x761==((x762<=x763)*x764)); if (t190 != 0) { NG(); } else { ; } } void f191(void) { static int32_t x765 = -16693; uint16_t x767 = 2U; volatile int32_t t191 = 1; t191 = (x765==((x766<=x767)*x768)); if (t191 != 0) { NG(); } else { ; } } void f192(void) { uint64_t x769 = 1121114LLU; volatile int8_t x770 = -17; static volatile int16_t x771 = INT16_MIN; static int64_t x772 = INT64_MAX; static int32_t t192 = 104; t192 = (x769==((x770<=x771)*x772)); if (t192 != 0) { NG(); } else { ; } } void f193(void) { uint8_t x773 = UINT8_MAX; volatile uint32_t x775 = UINT32_MAX; int16_t x776 = -381; volatile int32_t t193 = 0; t193 = (x773==((x774<=x775)*x776)); if (t193 != 0) { NG(); } else { ; } } void f194(void) { static int16_t x777 = -1; int64_t x778 = INT64_MIN; volatile uint8_t x779 = 0U; int16_t x780 = INT16_MIN; t194 = (x777==((x778<=x779)*x780)); if (t194 != 0) { NG(); } else { ; } } void f195(void) { volatile int16_t x781 = 5; uint32_t x782 = UINT32_MAX; int32_t x783 = -1; int32_t x784 = INT32_MIN; volatile int32_t t195 = 10933984; t195 = (x781==((x782<=x783)*x784)); if (t195 != 0) { NG(); } else { ; } } void f196(void) { int16_t x785 = INT16_MIN; uint16_t x787 = UINT16_MAX; static volatile int8_t x788 = INT8_MIN; int32_t t196 = -111727993; t196 = (x785==((x786<=x787)*x788)); if (t196 != 0) { NG(); } else { ; } } void f197(void) { int32_t x789 = -1681909; int64_t x790 = -1LL; int16_t x791 = INT16_MIN; volatile int32_t t197 = 822444; t197 = (x789==((x790<=x791)*x792)); if (t197 != 0) { NG(); } else { ; } } void f198(void) { int16_t x793 = 29; int16_t x794 = INT16_MIN; uint16_t x795 = 690U; t198 = (x793==((x794<=x795)*x796)); if (t198 != 0) { NG(); } else { ; } } void f199(void) { uint16_t x797 = UINT16_MAX; uint64_t x799 = UINT64_MAX; int8_t x800 = INT8_MIN; int32_t t199 = 399142; t199 = (x797==((x798<=x799)*x800)); if (t199 != 0) { NG(); } else { ; } } int main(void) { f0(); f1(); f2(); f3(); f4(); f5(); f6(); f7(); f8(); f9(); f10(); f11(); f12(); f13(); f14(); f15(); f16(); f17(); f18(); f19(); f20(); f21(); f22(); f23(); f24(); f25(); f26(); f27(); f28(); f29(); f30(); f31(); f32(); f33(); f34(); f35(); f36(); f37(); f38(); f39(); f40(); f41(); f42(); f43(); f44(); f45(); f46(); f47(); f48(); f49(); f50(); f51(); f52(); f53(); f54(); f55(); f56(); f57(); f58(); f59(); f60(); f61(); f62(); f63(); f64(); f65(); f66(); f67(); f68(); f69(); f70(); f71(); f72(); f73(); f74(); f75(); f76(); f77(); f78(); f79(); f80(); f81(); f82(); f83(); f84(); f85(); f86(); f87(); f88(); f89(); f90(); f91(); f92(); f93(); f94(); f95(); f96(); f97(); f98(); f99(); f100(); f101(); f102(); f103(); f104(); f105(); f106(); f107(); f108(); f109(); f110(); f111(); f112(); f113(); f114(); f115(); f116(); f117(); f118(); f119(); f120(); f121(); f122(); f123(); f124(); f125(); f126(); f127(); f128(); f129(); f130(); f131(); f132(); f133(); f134(); f135(); f136(); f137(); f138(); f139(); f140(); f141(); f142(); f143(); f144(); f145(); f146(); f147(); f148(); f149(); f150(); f151(); f152(); f153(); f154(); f155(); f156(); f157(); f158(); f159(); f160(); f161(); f162(); f163(); f164(); f165(); f166(); f167(); f168(); f169(); f170(); f171(); f172(); f173(); f174(); f175(); f176(); f177(); f178(); f179(); f180(); f181(); f182(); f183(); f184(); f185(); f186(); f187(); f188(); f189(); f190(); f191(); f192(); f193(); f194(); f195(); f196(); f197(); f198(); f199(); return 0; }
18.383853
54
0.575449
9ce13dc81038ceaf8a948c28f2b2cc27494a396c
4,497
h
C
NBG_Common.h
akhenakh/NBGCommon
805dbd47a4560535403bd0cf2a5b4f46252ac385
[ "MIT" ]
3
2015-03-22T17:32:18.000Z
2015-04-15T20:47:54.000Z
NBG_Common.h
akhenakh/NBGCommon
805dbd47a4560535403bd0cf2a5b4f46252ac385
[ "MIT" ]
null
null
null
NBG_Common.h
akhenakh/NBGCommon
805dbd47a4560535403bd0cf2a5b4f46252ac385
[ "MIT" ]
null
null
null
#pragma once //RGB color macro #define UIColorFromRGB(rgbValue) [UIColor \ colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \ green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \ blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] //RGB color macro with alpha #define UIColorFromRGBWithAlpha(rgbValue,a) [UIColor \ colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \ green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \ blue:((float)(rgbValue & 0xFF))/255.0 alpha:a] /// BOX(expr) /// /// Macro. Box simple things like `CGPoint` or `CGRect` into an `NSValue`. /// /// (Compare with the use of `@` in `@YES`, @123, @"abc" or `@(1 + 2)`.) #define BOX(expr) ({ __typeof__(expr) _box_expr = (expr); \ [NSValue valueWithBytes:&_box_expr objCType:@encode(__typeof__(expr))]; }) //based off of http://www.dribin.org/dave/blog/archives/2008/09/22/convert_to_nsstring/ NSString * VTPG_DDToStringFromTypeAndValue(const char * typeCode, void * value); #ifdef DEBUG #import "LoggerClient.h" #import "LoggerCommon.h" #if !defined(NDEBUG) #undef assert #if __DARWIN_UNIX03 #define assert(e) \ (__builtin_expect(!(e), 0) ? (CFShow(CFSTR("assert going to fail, connect NSLogger NOW\n")), LoggerFlush(NULL,YES), __assert_rtn(__func__, __FILE__, __LINE__, #e)) : (void)0) #else #define assert(e) \ (__builtin_expect(!(e), 0) ? (CFShow(CFSTR("assert going to fail, connect NSLogger NOW\n")), LoggerFlush(NULL,YES), __assert(#e, __FILE__, __LINE__)) : (void)0) #endif #endif #include <libgen.h> // LEVEL // use 0 for close to production so only very important message or error should be there // use 1 // use 2 warning // use 3 info // use 4 for everything = full debug // use 5 for in progress debug, you should never commit a 1 in git (my ass) ! #define DLOG_DATA(level, tag, data) LogDataF(__FILE__,__LINE__,__FUNCTION__, @#tag, level, data); #define DLOG_IMAGE(level, tag, imagedata, width, height) LogImageDataF(__FILE__,__LINE__,__FUNCTION__, @#tag, level, width, height, imagedata); #define DLOG(level, tag, fmt, ...) do{\ LogMessageF(__FILE__,__LINE__,__FUNCTION__,@#tag ,level,fmt, __VA_ARGS__);\ NSLog((@"<%@> %@ " fmt), @#tag, [NSString stringWithFormat:@"[%s:%d %@]",basename(__FILE__),__LINE__,NSStringFromSelector(_cmd)], ##__VA_ARGS__);\ } while(0) #define DLOGM(level, tag) do{\ LogMessageF(__FILE__,__LINE__,__FUNCTION__,@#tag ,level ,@"%s",__FUNCTION__ );\ NSLog(@"<%@> %@", @#tag, [NSString stringWithFormat:@"[%s:%d %@]",basename(__FILE__),__LINE__,NSStringFromSelector(_cmd)]);\ } while(0) #define DLOGV(level, tag, _X_) do{\ __typeof__(_X_) _Y_ = (_X_);\ const char * _TYPE_CODE_ = @encode(__typeof__(_X_));\ NSString *_STR_ = VTPG_DDToStringFromTypeAndValue(_TYPE_CODE_, &_Y_);\ if(_STR_) {\ LogMessageF(__FILE__,__LINE__,__FUNCTION__,@#tag,level,@"%s = %@", #_X_, _STR_);\ NSLog(@"<%@> %@", @#tag, [NSString stringWithFormat:@"[%s:%d %@] %s = %@",basename(__FILE__),__LINE__,NSStringFromSelector(_cmd), #_X_, _STR_]);\ }else\ LogMessageCompat(@"DLogv HELPER Unknown _TYPE_CODE_: %s for expression %s in function %s, file %s, line %d", _TYPE_CODE_, #_X_, __func__, __FILE__, __LINE__);\ }while(0) #define DLOGM_VERBOSE(tag) DLOGM(3, tag); #define DLOGM_INFO(tag) DLOGM(2, tag); #define DLOGM_WARN(tag) DLOGM(1, tag); #define DLOGM_ERROR(tag) DLOGM(0, tag); #define DLOGV_VERBOSE(tag, data) DLOGV(3, tag, data); #define DLOGV_INFO(tag, data) DLOGV(2, tag, data); #define DLOGV_WARN(tag, data) DLOGV(1, tag, data); #define DLOGV_ERROR(tag, data) DLOGV(0, tag, data); #define DLOG_VERBOSE(tag, fmt, ...) DLOG(3, tag, fmt, __VA_ARGS__); #define DLOG_INFO(tag, fmt, ...) DLOG(2, tag, fmt, __VA_ARGS__); #define DLOG_WARN(tag, fmt, ...) DLOG(1, tag, fmt, __VA_ARGS__); #define DLOG_ERROR(tag, fmt, ...) DLOG(0, tag, fmt, __VA_ARGS__); #else /* NO DEBUG */ #define DLOGV(level, tag, ...) do { (void)(__VA_ARGS__); } while (0) #define DLOG(level, tag, fmt, ...) /* */ #define DLOG_DATA(level, tag, ...) do { (void)(__VA_ARGS__); } while (0) #define DLOG_IMAGE(level, tag, ...) do { (void)(__VA_ARGS__); } while (0) #define DLOGM(level, tag) /* */ #define DLOGM_VERBOSE(tag) #define DLOGM_INFO(tag) #define DLOGM_WARN(tag) #define DLOGM_ERROR(tag) #define DLOGV_VERBOSE(tag, data) #define DLOGV_INFO(tag, data) #define DLOGV_WARN(tag, data) #define DLOGV_ERROR(tag, data) #define DLOG_VERBOSE(tag, fmt, ...) #define DLOG_INFO(tag, fmt, ...) #define DLOG_WARN(tag, fmt, ...) #define DLOG_ERROR(tag, fmt, ...) #endif /* NO DEBUG */
39.104348
174
0.684456
1b0b5a5e8dfed8ed7de712f01e7fc7ca1146d771
71,964
h
C
Sat842/Pytorch-iOS-Device/libs-no-caffe-ios/include/ATen/CUDAType.h
xta0/Pytorch-iOS-Demos
635c1bb469ef8f71d0a66bc7b11f19ba4c6ac45c
[ "MIT" ]
1
2019-08-15T17:11:58.000Z
2019-08-15T17:11:58.000Z
Sat842/Pytorch-iOS-Device/libs-no-caffe-ios/include/ATen/CUDAType.h
xta0/Pytorch-iOS-Demos
635c1bb469ef8f71d0a66bc7b11f19ba4c6ac45c
[ "MIT" ]
null
null
null
Sat842/Pytorch-iOS-Device/libs-no-caffe-ios/include/ATen/CUDAType.h
xta0/Pytorch-iOS-Demos
635c1bb469ef8f71d0a66bc7b11f19ba4c6ac45c
[ "MIT" ]
null
null
null
#pragma once // @generated by aten/src/ATen/gen.py #include <ATen/Context.h> #include <ATen/Utils.h> #include <ATen/DeviceGuard.h> #include <ATen/cuda/ATenCUDAGeneral.h> #include <ATen/cuda/CUDADevice.h> #include <ATen/cuda/CUDAContext.h> namespace at { struct CUDAType final { static std::tuple<Tensor,Tensor> _cudnn_ctc_loss(const Tensor & log_probs, const Tensor & targets, IntArrayRef input_lengths, IntArrayRef target_lengths, int64_t blank, bool deterministic, bool zero_infinity); static Tensor _cudnn_rnn_flatten_weight(TensorList weight_arr, int64_t weight_stride0, int64_t input_size, int64_t mode, int64_t hidden_size, int64_t num_layers, bool batch_first, bool bidirectional); static std::tuple<Tensor,Tensor,Tensor,Tensor,Tensor> _cudnn_rnn(const Tensor & input, TensorList weight, int64_t weight_stride0, const Tensor & weight_buf, const Tensor & hx, const Tensor & cx, int64_t mode, int64_t hidden_size, int64_t num_layers, bool batch_first, double dropout, bool train, bool bidirectional, IntArrayRef batch_sizes, const Tensor & dropout_state); static std::tuple<Tensor,Tensor,Tensor,std::vector<Tensor>> _cudnn_rnn_backward(const Tensor & input, TensorList weight, int64_t weight_stride0, const Tensor & weight_buf, const Tensor & hx, const Tensor & cx, const Tensor & output, const Tensor & grad_output, const Tensor & grad_hy, const Tensor & grad_cy, int64_t mode, int64_t hidden_size, int64_t num_layers, bool batch_first, double dropout, bool train, bool bidirectional, IntArrayRef batch_sizes, const Tensor & dropout_state, const Tensor & reserve, std::array<bool,4> output_mask); static Tensor _cudnn_init_dropout_state(double dropout, bool train, int64_t dropout_seed, const TensorOptions & options); static std::tuple<Tensor,Tensor> _fused_dropout(const Tensor & self, double p, Generator * generator); static Tensor _masked_scale(const Tensor & self, const Tensor & mask, double scale); static Tensor & abs_(Tensor & self); static Tensor & abs_out(Tensor & out, const Tensor & self); static Tensor & acos_(Tensor & self); static Tensor & acos_out(Tensor & out, const Tensor & self); static Tensor add(const Tensor & self, const Tensor & other, Scalar alpha); static Tensor & add_(Tensor & self, const Tensor & other, Scalar alpha); static Tensor & add_out(Tensor & out, const Tensor & self, const Tensor & other, Scalar alpha); static Tensor addmv(const Tensor & self, const Tensor & mat, const Tensor & vec, Scalar beta, Scalar alpha); static Tensor & addmv_(Tensor & self, const Tensor & mat, const Tensor & vec, Scalar beta, Scalar alpha); static Tensor & addmv_out(Tensor & out, const Tensor & self, const Tensor & mat, const Tensor & vec, Scalar beta, Scalar alpha); static Tensor & arange_out(Tensor & out, Scalar start, Scalar end, Scalar step); static Tensor as_strided(const Tensor & self, IntArrayRef size, IntArrayRef stride, c10::optional<int64_t> storage_offset); static Tensor & asin_(Tensor & self); static Tensor & asin_out(Tensor & out, const Tensor & self); static Tensor & atan_(Tensor & self); static Tensor & atan_out(Tensor & out, const Tensor & self); static Tensor baddbmm(const Tensor & self, const Tensor & batch1, const Tensor & batch2, Scalar beta, Scalar alpha); static Tensor & baddbmm_(Tensor & self, const Tensor & batch1, const Tensor & batch2, Scalar beta, Scalar alpha); static Tensor & baddbmm_out(Tensor & out, const Tensor & self, const Tensor & batch1, const Tensor & batch2, Scalar beta, Scalar alpha); static Tensor & bernoulli_(Tensor & self, const Tensor & p, Generator * generator); static Tensor & bernoulli_(Tensor & self, double p, Generator * generator); static Tensor bincount(const Tensor & self, const Tensor & weights, int64_t minlength); static Tensor & bitwise_not_out(Tensor & out, const Tensor & self); static Tensor bmm(const Tensor & self, const Tensor & mat2); static Tensor & bmm_out(Tensor & out, const Tensor & self, const Tensor & mat2); static Tensor & ceil_(Tensor & self); static Tensor & ceil_out(Tensor & out, const Tensor & self); static Tensor & clamp_(Tensor & self, c10::optional<Scalar> min, c10::optional<Scalar> max); static Tensor & clamp_out(Tensor & out, const Tensor & self, c10::optional<Scalar> min, c10::optional<Scalar> max); static Tensor & clamp_max_(Tensor & self, Scalar max); static Tensor & clamp_max_out(Tensor & out, const Tensor & self, Scalar max); static Tensor & clamp_min_(Tensor & self, Scalar min); static Tensor & clamp_min_out(Tensor & out, const Tensor & self, Scalar min); static Tensor & cos_(Tensor & self); static Tensor & cos_out(Tensor & out, const Tensor & self); static Tensor & cosh_(Tensor & self); static Tensor & cosh_out(Tensor & out, const Tensor & self); static Tensor cudnn_affine_grid_generator(const Tensor & theta, int64_t N, int64_t C, int64_t H, int64_t W); static Tensor cudnn_affine_grid_generator_backward(const Tensor & grad, int64_t N, int64_t C, int64_t H, int64_t W); static std::tuple<Tensor,Tensor,Tensor> cudnn_batch_norm(const Tensor & input, const Tensor & weight, const Tensor & bias, const Tensor & running_mean, const Tensor & running_var, bool training, double exponential_average_factor, double epsilon); static std::tuple<Tensor,Tensor,Tensor> cudnn_batch_norm_backward(const Tensor & input, const Tensor & grad_output, const Tensor & weight, const Tensor & running_mean, const Tensor & running_var, const Tensor & save_mean, const Tensor & save_var, double epsilon); static Tensor cudnn_convolution(const Tensor & self, const Tensor & weight, const Tensor & bias, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic); static Tensor cudnn_convolution_backward_input(IntArrayRef self_size, const Tensor & grad_output, const Tensor & weight, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic); static std::tuple<Tensor,Tensor,Tensor> cudnn_convolution_backward(const Tensor & self, const Tensor & grad_output, const Tensor & weight, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic, std::array<bool,3> output_mask); static Tensor cudnn_convolution_backward_bias(const Tensor & grad_output); static Tensor cudnn_convolution_backward_weight(IntArrayRef weight_size, const Tensor & grad_output, const Tensor & self, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic); static Tensor cudnn_convolution_transpose(const Tensor & self, const Tensor & weight, const Tensor & bias, IntArrayRef padding, IntArrayRef output_padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic); static std::tuple<Tensor,Tensor,Tensor> cudnn_convolution_transpose_backward(const Tensor & self, const Tensor & grad_output, const Tensor & weight, IntArrayRef padding, IntArrayRef output_padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic, std::array<bool,3> output_mask); static Tensor cudnn_convolution_transpose_backward_bias(const Tensor & grad_output); static Tensor cudnn_convolution_transpose_backward_input(const Tensor & grad_output, const Tensor & weight, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic); static Tensor cudnn_convolution_transpose_backward_weight(IntArrayRef weight_size, const Tensor & grad_output, const Tensor & self, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic); static Tensor cudnn_grid_sampler(const Tensor & self, const Tensor & grid); static std::tuple<Tensor,Tensor> cudnn_grid_sampler_backward(const Tensor & self, const Tensor & grid, const Tensor & grad_output); static std::tuple<Tensor,Tensor> _ctc_loss(const Tensor & log_probs, const Tensor & targets, IntArrayRef input_lengths, IntArrayRef target_lengths, int64_t blank, bool zero_infinity); static Tensor _ctc_loss_backward(const Tensor & grad, const Tensor & log_probs, const Tensor & targets, IntArrayRef input_lengths, IntArrayRef target_lengths, const Tensor & neg_log_likelihood, const Tensor & log_alpha, int64_t blank, bool zero_infinity); static Tensor dot(const Tensor & self, const Tensor & tensor); static Tensor embedding_dense_backward(const Tensor & grad_output, const Tensor & indices, int64_t num_weights, int64_t padding_idx, bool scale_grad_by_freq); static Tensor & embedding_renorm_(Tensor & self, const Tensor & indices, double max_norm, double norm_type); static std::tuple<Tensor,Tensor,Tensor,Tensor> _embedding_bag(const Tensor & weight, const Tensor & indices, const Tensor & offsets, bool scale_grad_by_freq, int64_t mode, bool sparse, const Tensor & per_sample_weights); static Tensor _embedding_bag_dense_backward(const Tensor & grad, const Tensor & indices, const Tensor & offsets, const Tensor & offset2bag, const Tensor & bag_size, const Tensor & maximum_indices, int64_t num_weights, bool scale_grad_by_freq, int64_t mode, const Tensor & per_sample_weights); static Tensor _embedding_bag_per_sample_weights_backward(const Tensor & grad, const Tensor & weight, const Tensor & indices, const Tensor & offsets, const Tensor & offset2bag, int64_t mode); static Tensor empty(IntArrayRef size, const TensorOptions & options, c10::optional<MemoryFormat> memory_format); static Tensor & resize_(Tensor & self, IntArrayRef size); static Tensor empty_strided(IntArrayRef size, IntArrayRef stride, const TensorOptions & options); static Tensor & erf_(Tensor & self); static Tensor & erf_out(Tensor & out, const Tensor & self); static Tensor & erfc_(Tensor & self); static Tensor & erfc_out(Tensor & out, const Tensor & self); static Tensor & exp_(Tensor & self); static Tensor & exp_out(Tensor & out, const Tensor & self); static Tensor & expm1_(Tensor & self); static Tensor & expm1_out(Tensor & out, const Tensor & self); static Tensor & eye_out(Tensor & out, int64_t n); static Tensor & eye_out(Tensor & out, int64_t n, int64_t m); static Tensor & floor_(Tensor & self); static Tensor & floor_out(Tensor & out, const Tensor & self); static Tensor & frac_(Tensor & self); static Tensor & frac_out(Tensor & out, const Tensor & self); static Tensor grid_sampler_2d(const Tensor & input, const Tensor & grid, int64_t interpolation_mode, int64_t padding_mode); static std::tuple<Tensor,Tensor> grid_sampler_2d_backward(const Tensor & grad_output, const Tensor & input, const Tensor & grid, int64_t interpolation_mode, int64_t padding_mode); static Tensor grid_sampler_3d(const Tensor & input, const Tensor & grid, int64_t interpolation_mode, int64_t padding_mode); static std::tuple<Tensor,Tensor> grid_sampler_3d_backward(const Tensor & grad_output, const Tensor & input, const Tensor & grid, int64_t interpolation_mode, int64_t padding_mode); static Tensor ger(const Tensor & self, const Tensor & vec2); static Tensor & ger_out(Tensor & out, const Tensor & self, const Tensor & vec2); static Tensor _fft_with_size(const Tensor & self, int64_t signal_ndim, bool complex_input, bool complex_output, bool inverse, IntArrayRef checked_signal_sizes, bool normalized, bool onesided, IntArrayRef output_sizes); static Tensor _inverse_helper(const Tensor & self); static Tensor kl_div_backward(const Tensor & grad_output, const Tensor & self, const Tensor & target, int64_t reduction); static std::tuple<Tensor &,Tensor &> kthvalue_out(Tensor & values, Tensor & indices, const Tensor & self, int64_t k, int64_t dim, bool keepdim); static Tensor & linspace_out(Tensor & out, Scalar start, Scalar end, int64_t steps); static Tensor & log_(Tensor & self); static Tensor & log_out(Tensor & out, const Tensor & self); static Tensor & log10_(Tensor & self); static Tensor & log10_out(Tensor & out, const Tensor & self); static Tensor & log1p_(Tensor & self); static Tensor & log1p_out(Tensor & out, const Tensor & self); static Tensor & log2_(Tensor & self); static Tensor & log2_out(Tensor & out, const Tensor & self); static Tensor & logspace_out(Tensor & out, Scalar start, Scalar end, int64_t steps, double base); static Tensor _log_softmax(const Tensor & self, int64_t dim, bool half_to_float); static Tensor _log_softmax_backward_data(const Tensor & grad_output, const Tensor & output, int64_t dim, const Tensor & self); static std::tuple<Tensor,Tensor,Tensor> miopen_batch_norm(const Tensor & input, const Tensor & weight, const Tensor & bias, const Tensor & running_mean, const Tensor & running_var, bool training, double exponential_average_factor, double epsilon); static std::tuple<Tensor,Tensor,Tensor> miopen_batch_norm_backward(const Tensor & input, const Tensor & grad_output, const Tensor & weight, const Tensor & running_mean, const Tensor & running_var, const Tensor & save_mean, const Tensor & save_var, double epsilon); static Tensor miopen_convolution(const Tensor & self, const Tensor & weight, const Tensor & bias, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic); static Tensor miopen_convolution_backward_input(IntArrayRef self_size, const Tensor & grad_output, const Tensor & weight, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic); static std::tuple<Tensor,Tensor,Tensor> miopen_convolution_backward(const Tensor & self, const Tensor & grad_output, const Tensor & weight, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic, std::array<bool,3> output_mask); static Tensor miopen_convolution_backward_bias(const Tensor & grad_output); static Tensor miopen_convolution_backward_weight(IntArrayRef weight_size, const Tensor & grad_output, const Tensor & self, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic); static Tensor miopen_convolution_transpose(const Tensor & self, const Tensor & weight, const Tensor & bias, IntArrayRef padding, IntArrayRef output_padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic); static std::tuple<Tensor,Tensor,Tensor> miopen_convolution_transpose_backward(const Tensor & self, const Tensor & grad_output, const Tensor & weight, IntArrayRef padding, IntArrayRef output_padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic, std::array<bool,3> output_mask); static Tensor miopen_convolution_transpose_backward_input(const Tensor & grad_output, const Tensor & weight, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic); static Tensor miopen_convolution_transpose_backward_weight(IntArrayRef weight_size, const Tensor & grad_output, const Tensor & self, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic); static Tensor miopen_depthwise_convolution(const Tensor & self, const Tensor & weight, const Tensor & bias, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic); static Tensor miopen_depthwise_convolution_backward_input(IntArrayRef self_size, const Tensor & grad_output, const Tensor & weight, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic); static std::tuple<Tensor,Tensor,Tensor> miopen_depthwise_convolution_backward(const Tensor & self, const Tensor & grad_output, const Tensor & weight, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic, std::array<bool,3> output_mask); static Tensor miopen_depthwise_convolution_backward_weight(IntArrayRef weight_size, const Tensor & grad_output, const Tensor & self, IntArrayRef padding, IntArrayRef stride, IntArrayRef dilation, int64_t groups, bool benchmark, bool deterministic); static std::tuple<Tensor,Tensor,Tensor,Tensor,Tensor> miopen_rnn(const Tensor & input, TensorList weight, int64_t weight_stride0, const Tensor & hx, const Tensor & cx, int64_t mode, int64_t hidden_size, int64_t num_layers, bool batch_first, double dropout, bool train, bool bidirectional, IntArrayRef batch_sizes, const Tensor & dropout_state); static std::tuple<Tensor,Tensor,Tensor,std::vector<Tensor>> miopen_rnn_backward(const Tensor & input, TensorList weight, int64_t weight_stride0, const Tensor & weight_buf, const Tensor & hx, const Tensor & cx, const Tensor & output, const Tensor & grad_output, const Tensor & grad_hy, const Tensor & grad_cy, int64_t mode, int64_t hidden_size, int64_t num_layers, bool batch_first, double dropout, bool train, bool bidirectional, IntArrayRef batch_sizes, const Tensor & dropout_state, const Tensor & reserve, std::array<bool,4> output_mask); static Tensor mm(const Tensor & self, const Tensor & mat2); static Tensor & mm_out(Tensor & out, const Tensor & self, const Tensor & mat2); static Tensor mul(const Tensor & self, const Tensor & other); static Tensor & mul_(Tensor & self, const Tensor & other); static Tensor & mul_out(Tensor & out, const Tensor & self, const Tensor & other); static Tensor mv(const Tensor & self, const Tensor & vec); static Tensor & mv_out(Tensor & out, const Tensor & self, const Tensor & vec); static Tensor narrow_copy(const Tensor & self, int64_t dim, int64_t start, int64_t length); static std::tuple<Tensor,Tensor,Tensor> native_batch_norm(const Tensor & input, const Tensor & weight, const Tensor & bias, const Tensor & running_mean, const Tensor & running_var, bool training, double momentum, double eps); static std::tuple<Tensor,Tensor> batch_norm_stats(const Tensor & input, double eps); static Tensor batch_norm_elemt(const Tensor & input, const Tensor & weight, const Tensor & bias, const Tensor & mean, const Tensor & invstd, double eps); static std::tuple<Tensor,Tensor> batch_norm_gather_stats(const Tensor & input, const Tensor & mean, const Tensor & invstd, const Tensor & running_mean, const Tensor & running_var, double momentum, double eps, int64_t count); static std::tuple<Tensor,Tensor> batch_norm_gather_stats_with_counts(const Tensor & input, const Tensor & mean, const Tensor & invstd, const Tensor & running_mean, const Tensor & running_var, double momentum, double eps, IntArrayRef counts); static std::tuple<Tensor,Tensor,Tensor> native_batch_norm_backward(const Tensor & grad_out, const Tensor & input, const Tensor & weight, const Tensor & running_mean, const Tensor & running_var, const Tensor & save_mean, const Tensor & save_invstd, bool train, double eps, std::array<bool,3> output_mask); static std::tuple<Tensor,Tensor,Tensor,Tensor> batch_norm_backward_reduce(const Tensor & grad_out, const Tensor & input, const Tensor & mean, const Tensor & invstd, bool input_g, bool weight_g, bool bias_g); static Tensor batch_norm_backward_elemt(const Tensor & grad_out, const Tensor & input, const Tensor & mean, const Tensor & invstd, const Tensor & weight, const Tensor & mean_dy, const Tensor & mean_dy_xmu); static std::tuple<Tensor,Tensor> batch_norm_update_stats(const Tensor & input, const Tensor & running_mean, const Tensor & running_var, double momentum); static Tensor & randperm_out(Tensor & out, int64_t n, Generator * generator); static Tensor & range_out(Tensor & out, Scalar start, Scalar end, Scalar step); static Tensor & reciprocal_(Tensor & self); static Tensor & reciprocal_out(Tensor & out, const Tensor & self); static Tensor & neg_out(Tensor & out, const Tensor & self); static Tensor repeat_interleave(const Tensor & repeats); static Tensor & round_(Tensor & self); static Tensor & round_out(Tensor & out, const Tensor & self); static Tensor relu(const Tensor & self); static Tensor & relu_(Tensor & self); static Tensor prelu(const Tensor & self, const Tensor & weight); static std::tuple<Tensor,Tensor> prelu_backward(const Tensor & grad_output, const Tensor & self, const Tensor & weight); static Tensor gelu(const Tensor & self); static Tensor gelu_backward(const Tensor & grad, const Tensor & self); static Tensor hardshrink(const Tensor & self, Scalar lambd); static Tensor hardshrink_backward(const Tensor & grad_out, const Tensor & self, Scalar lambd); static Tensor & rsqrt_(Tensor & self); static Tensor & rsqrt_out(Tensor & out, const Tensor & self); static Tensor sigmoid(const Tensor & self); static Tensor & sigmoid_(Tensor & self); static Tensor & sigmoid_out(Tensor & out, const Tensor & self); static Tensor & sin_(Tensor & self); static Tensor & sin_out(Tensor & out, const Tensor & self); static Tensor & sinh_(Tensor & self); static Tensor & sinh_out(Tensor & out, const Tensor & self); static Tensor _softmax(const Tensor & self, int64_t dim, bool half_to_float); static Tensor _softmax_backward_data(const Tensor & grad_output, const Tensor & output, int64_t dim, const Tensor & self); static Tensor & _sparse_dense_add_out(Tensor & out, const Tensor & self, const Tensor & other, Scalar alpha); static Tensor & sspaddmm_out(Tensor & out, const Tensor & self, const Tensor & mat1, const Tensor & mat2, Scalar beta, Scalar alpha); static Tensor & sqrt_(Tensor & self); static Tensor & sqrt_out(Tensor & out, const Tensor & self); static Tensor & tan_(Tensor & self); static Tensor & tan_out(Tensor & out, const Tensor & self); static Tensor & tanh_(Tensor & self); static Tensor & tanh_out(Tensor & out, const Tensor & self); static Tensor flip(const Tensor & self, IntArrayRef dims); static Tensor roll(const Tensor & self, IntArrayRef shifts, IntArrayRef dims); static Tensor & trunc_(Tensor & self); static Tensor & trunc_out(Tensor & out, const Tensor & self); static std::tuple<Tensor,Tensor> _unique(const Tensor & self, bool sorted, bool return_inverse); static std::tuple<Tensor,Tensor,Tensor> unique_dim(const Tensor & self, int64_t dim, bool sorted, bool return_inverse, bool return_counts); static std::tuple<Tensor,Tensor,Tensor> unique_consecutive(const Tensor & self, bool return_inverse, bool return_counts, c10::optional<int64_t> dim); static std::tuple<Tensor,Tensor,Tensor> unique_dim_consecutive(const Tensor & self, int64_t dim, bool return_inverse, bool return_counts); static std::tuple<Tensor,Tensor,Tensor> _unique2(const Tensor & self, bool sorted, bool return_inverse, bool return_counts); static Tensor _s_where(const Tensor & condition, const Tensor & self, const Tensor & other); static std::tuple<Tensor,Tensor> _weight_norm_cuda_interface(const Tensor & v, const Tensor & g, int64_t dim); static std::tuple<Tensor,Tensor> _weight_norm_cuda_interface_backward(const Tensor & grad_w, const Tensor & saved_v, const Tensor & saved_g, const Tensor & saved_norms, int64_t dim); static Tensor _standard_gamma_grad(const Tensor & self, const Tensor & output); static Tensor _standard_gamma(const Tensor & self, Generator * generator); static Tensor _dirichlet_grad(const Tensor & x, const Tensor & alpha, const Tensor & total); static Tensor _sample_dirichlet(const Tensor & self, Generator * generator); static Tensor poisson(const Tensor & self, Generator * generator); static Tensor clone(const Tensor & self); static Tensor & resize_as_(Tensor & self, const Tensor & the_template); static Tensor & pow_out(Tensor & out, const Tensor & self, Scalar exponent); static Tensor pow(const Tensor & self, Scalar exponent); static Tensor & zero_(Tensor & self); static Tensor & s_native_addmm_out(Tensor & out, const Tensor & self, const Tensor & mat1, const Tensor & mat2, Scalar beta, Scalar alpha); static Tensor s_native_addmm(const Tensor & self, const Tensor & mat1, const Tensor & mat2, Scalar beta, Scalar alpha); static Tensor & s_native_addmm_(Tensor & self, const Tensor & mat1, const Tensor & mat2, Scalar beta, Scalar alpha); static Tensor sparse_mask(const Tensor & self, const Tensor & mask); static Tensor to_sparse(const Tensor & self, int64_t sparse_dim); static Tensor to_sparse(const Tensor & self); static Tensor fake_quantize_per_tensor_affine(const Tensor & self, double scale, int64_t zero_point, int64_t quant_min, int64_t quant_max); static Tensor fake_quantize_per_tensor_affine_backward(const Tensor & grad, const Tensor & self, double scale, int64_t zero_point, int64_t quant_min, int64_t quant_max); static Scalar _local_scalar_dense(const Tensor & self); static std::tuple<Tensor,Tensor,Tensor> _thnn_fused_lstm_cell(const Tensor & input_gates, const Tensor & hidden_gates, const Tensor & cx, const Tensor & input_bias, const Tensor & hidden_bias); static std::tuple<Tensor,Tensor,Tensor,Tensor,Tensor> _thnn_fused_lstm_cell_backward(const Tensor & grad_hy, const Tensor & grad_cy, const Tensor & cx, const Tensor & cy, const Tensor & workspace, bool has_bias); static std::tuple<Tensor,Tensor> _thnn_fused_gru_cell(const Tensor & input_gates, const Tensor & hidden_gates, const Tensor & hx, const Tensor & input_bias, const Tensor & hidden_bias); static std::tuple<Tensor,Tensor,Tensor,Tensor,Tensor> _thnn_fused_gru_cell_backward(const Tensor & grad_hy, const Tensor & workspace, bool has_bias); static Tensor & set_(Tensor & self, Storage source); static Tensor & set_(Tensor & self, Storage source, int64_t storage_offset, IntArrayRef size, IntArrayRef stride); static Tensor & set_(Tensor & self, const Tensor & source); static Tensor & set_(Tensor & self); static bool is_set_to(const Tensor & self, const Tensor & tensor); static Tensor & masked_fill_(Tensor & self, const Tensor & mask, Scalar value); static Tensor & masked_fill_(Tensor & self, const Tensor & mask, const Tensor & value); static Tensor & masked_scatter_(Tensor & self, const Tensor & mask, const Tensor & source); static Tensor view(const Tensor & self, IntArrayRef size); static Tensor & put_(Tensor & self, const Tensor & index, const Tensor & source, bool accumulate); static Tensor & index_add_(Tensor & self, int64_t dim, const Tensor & index, const Tensor & source); static Tensor & index_fill_(Tensor & self, int64_t dim, const Tensor & index, Scalar value); static Tensor & index_fill_(Tensor & self, int64_t dim, const Tensor & index, const Tensor & value); static Tensor & scatter_(Tensor & self, int64_t dim, const Tensor & index, const Tensor & src); static Tensor & scatter_(Tensor & self, int64_t dim, const Tensor & index, Scalar value); static Tensor & scatter_add_(Tensor & self, int64_t dim, const Tensor & index, const Tensor & src); static Tensor & lt_(Tensor & self, Scalar other); static Tensor & lt_(Tensor & self, const Tensor & other); static Tensor & gt_(Tensor & self, Scalar other); static Tensor & gt_(Tensor & self, const Tensor & other); static Tensor & le_(Tensor & self, Scalar other); static Tensor & le_(Tensor & self, const Tensor & other); static Tensor & ge_(Tensor & self, Scalar other); static Tensor & ge_(Tensor & self, const Tensor & other); static Tensor & eq_(Tensor & self, Scalar other); static Tensor & eq_(Tensor & self, const Tensor & other); static Tensor & ne_(Tensor & self, Scalar other); static Tensor & ne_(Tensor & self, const Tensor & other); static Tensor __and__(const Tensor & self, Scalar other); static Tensor __and__(const Tensor & self, const Tensor & other); static Tensor & __iand__(Tensor & self, Scalar other); static Tensor & __iand__(Tensor & self, const Tensor & other); static Tensor __or__(const Tensor & self, Scalar other); static Tensor __or__(const Tensor & self, const Tensor & other); static Tensor & __ior__(Tensor & self, Scalar other); static Tensor & __ior__(Tensor & self, const Tensor & other); static Tensor __xor__(const Tensor & self, Scalar other); static Tensor __xor__(const Tensor & self, const Tensor & other); static Tensor & __ixor__(Tensor & self, Scalar other); static Tensor & __ixor__(Tensor & self, const Tensor & other); static Tensor __lshift__(const Tensor & self, Scalar other); static Tensor __lshift__(const Tensor & self, const Tensor & other); static Tensor & __ilshift__(Tensor & self, Scalar other); static Tensor & __ilshift__(Tensor & self, const Tensor & other); static Tensor __rshift__(const Tensor & self, Scalar other); static Tensor __rshift__(const Tensor & self, const Tensor & other); static Tensor & __irshift__(Tensor & self, Scalar other); static Tensor & __irshift__(Tensor & self, const Tensor & other); static Tensor & lgamma_(Tensor & self); static Tensor & tril_(Tensor & self, int64_t diagonal); static Tensor & triu_(Tensor & self, int64_t diagonal); static Tensor & digamma_(Tensor & self); static Tensor & polygamma_(Tensor & self, int64_t n); static Tensor & erfinv_(Tensor & self); static Tensor & renorm_(Tensor & self, Scalar p, int64_t dim, Scalar maxnorm); static Tensor & pow_(Tensor & self, Scalar exponent); static Tensor & pow_(Tensor & self, const Tensor & exponent); static Tensor & lerp_(Tensor & self, const Tensor & end, Scalar weight); static Tensor & lerp_(Tensor & self, const Tensor & end, const Tensor & weight); static Tensor & sign_(Tensor & self); static Tensor & fmod_(Tensor & self, Scalar other); static Tensor & fmod_(Tensor & self, const Tensor & other); static Tensor & remainder_(Tensor & self, Scalar other); static Tensor & remainder_(Tensor & self, const Tensor & other); static Tensor & addbmm_(Tensor & self, const Tensor & batch1, const Tensor & batch2, Scalar beta, Scalar alpha); static Tensor & addbmm_out(Tensor & out, const Tensor & self, const Tensor & batch1, const Tensor & batch2, Scalar beta, Scalar alpha); static Tensor addbmm(const Tensor & self, const Tensor & batch1, const Tensor & batch2, Scalar beta, Scalar alpha); static Tensor & random_(Tensor & self, int64_t from, int64_t to, Generator * generator); static Tensor & random_(Tensor & self, int64_t to, Generator * generator); static Tensor & random_(Tensor & self, Generator * generator); static Tensor & uniform_(Tensor & self, double from, double to, Generator * generator); static Tensor & normal_(Tensor & self, double mean, double std, Generator * generator); static Tensor & cauchy_(Tensor & self, double median, double sigma, Generator * generator); static Tensor & log_normal_(Tensor & self, double mean, double std, Generator * generator); static Tensor & exponential_(Tensor & self, double lambd, Generator * generator); static Tensor & geometric_(Tensor & self, double p, Generator * generator); static Tensor & diag_out(Tensor & out, const Tensor & self, int64_t diagonal); static Tensor diag(const Tensor & self, int64_t diagonal); static Tensor & triu_out(Tensor & out, const Tensor & self, int64_t diagonal); static Tensor & tril_out(Tensor & out, const Tensor & self, int64_t diagonal); static Tensor tril_indices(int64_t row, int64_t col, int64_t offset, const TensorOptions & options); static Tensor triu_indices(int64_t row, int64_t col, int64_t offset, const TensorOptions & options); static Tensor trace(const Tensor & self); static Tensor & ne_out(Tensor & out, const Tensor & self, Scalar other); static Tensor ne(const Tensor & self, Scalar other); static Tensor & ne_out(Tensor & out, const Tensor & self, const Tensor & other); static Tensor ne(const Tensor & self, const Tensor & other); static Tensor & eq_out(Tensor & out, const Tensor & self, Scalar other); static Tensor eq(const Tensor & self, Scalar other); static Tensor & eq_out(Tensor & out, const Tensor & self, const Tensor & other); static Tensor eq(const Tensor & self, const Tensor & other); static Tensor & ge_out(Tensor & out, const Tensor & self, Scalar other); static Tensor ge(const Tensor & self, Scalar other); static Tensor & ge_out(Tensor & out, const Tensor & self, const Tensor & other); static Tensor ge(const Tensor & self, const Tensor & other); static Tensor & le_out(Tensor & out, const Tensor & self, Scalar other); static Tensor le(const Tensor & self, Scalar other); static Tensor & le_out(Tensor & out, const Tensor & self, const Tensor & other); static Tensor le(const Tensor & self, const Tensor & other); static Tensor & gt_out(Tensor & out, const Tensor & self, Scalar other); static Tensor gt(const Tensor & self, Scalar other); static Tensor & gt_out(Tensor & out, const Tensor & self, const Tensor & other); static Tensor gt(const Tensor & self, const Tensor & other); static Tensor & lt_out(Tensor & out, const Tensor & self, Scalar other); static Tensor lt(const Tensor & self, Scalar other); static Tensor & lt_out(Tensor & out, const Tensor & self, const Tensor & other); static Tensor lt(const Tensor & self, const Tensor & other); static Tensor & take_out(Tensor & out, const Tensor & self, const Tensor & index); static Tensor take(const Tensor & self, const Tensor & index); static Tensor & index_select_out(Tensor & out, const Tensor & self, int64_t dim, const Tensor & index); static Tensor index_select(const Tensor & self, int64_t dim, const Tensor & index); static Tensor & masked_select_out(Tensor & out, const Tensor & self, const Tensor & mask); static Tensor masked_select(const Tensor & self, const Tensor & mask); static Tensor & nonzero_out(Tensor & out, const Tensor & self); static Tensor nonzero(const Tensor & self); static Tensor & gather_out(Tensor & out, const Tensor & self, int64_t dim, const Tensor & index, bool sparse_grad); static Tensor gather(const Tensor & self, int64_t dim, const Tensor & index, bool sparse_grad); static std::tuple<Tensor &,Tensor &> lstsq_out(Tensor & X, Tensor & qr, const Tensor & self, const Tensor & A); static std::tuple<Tensor,Tensor> lstsq(const Tensor & self, const Tensor & A); static std::tuple<Tensor,Tensor> _triangular_solve_helper(const Tensor & self, const Tensor & A, bool upper, bool transpose, bool unitriangular); static std::tuple<Tensor,Tensor> _symeig_helper(const Tensor & self, bool eigenvectors, bool upper); static std::tuple<Tensor &,Tensor &> eig_out(Tensor & e, Tensor & v, const Tensor & self, bool eigenvectors); static std::tuple<Tensor,Tensor> eig(const Tensor & self, bool eigenvectors); static std::tuple<Tensor,Tensor,Tensor> _svd_helper(const Tensor & self, bool some, bool compute_uv); static Tensor _cholesky_helper(const Tensor & self, bool upper); static Tensor _cholesky_solve_helper(const Tensor & self, const Tensor & A, bool upper); static std::tuple<Tensor,Tensor> _solve_helper(const Tensor & self, const Tensor & A); static Tensor & cholesky_inverse_out(Tensor & out, const Tensor & self, bool upper); static Tensor cholesky_inverse(const Tensor & self, bool upper); static std::tuple<Tensor,Tensor> _qr_helper(const Tensor & self, bool some); static std::tuple<Tensor &,Tensor &> geqrf_out(Tensor & a, Tensor & tau, const Tensor & self); static std::tuple<Tensor,Tensor> geqrf(const Tensor & self); static std::tuple<Tensor,Tensor,Tensor> _lu_with_info(const Tensor & self, bool pivot, bool check_errors); static Tensor _lu_solve_helper(const Tensor & self, const Tensor & LU_data, const Tensor & LU_pivots); static Tensor & multinomial_out(Tensor & out, const Tensor & self, int64_t num_samples, bool replacement, Generator * generator); static Tensor multinomial(const Tensor & self, int64_t num_samples, bool replacement, Generator * generator); static std::tuple<Tensor,Tensor> _multinomial_alias_setup(const Tensor & probs); static Tensor _multinomial_alias_draw(const Tensor & J, const Tensor & q, int64_t num_samples, Generator * generator); static Tensor & lgamma_out(Tensor & out, const Tensor & self); static Tensor lgamma(const Tensor & self); static Tensor & digamma_out(Tensor & out, const Tensor & self); static Tensor digamma(const Tensor & self); static Tensor & polygamma_out(Tensor & out, int64_t n, const Tensor & self); static Tensor polygamma(int64_t n, const Tensor & self); static Tensor & erfinv_out(Tensor & out, const Tensor & self); static Tensor erfinv(const Tensor & self); static Tensor dist(const Tensor & self, const Tensor & other, Scalar p); static Tensor & lerp_out(Tensor & out, const Tensor & self, const Tensor & end, Scalar weight); static Tensor & lerp_out(Tensor & out, const Tensor & self, const Tensor & end, const Tensor & weight); static Tensor lerp(const Tensor & self, const Tensor & end, Scalar weight); static Tensor lerp(const Tensor & self, const Tensor & end, const Tensor & weight); static Tensor & histc_out(Tensor & out, const Tensor & self, int64_t bins, Scalar min, Scalar max); static Tensor histc(const Tensor & self, int64_t bins, Scalar min, Scalar max); static Tensor & sign_out(Tensor & out, const Tensor & self); static Tensor sign(const Tensor & self); static Tensor & fmod_out(Tensor & out, const Tensor & self, Scalar other); static Tensor fmod(const Tensor & self, Scalar other); static Tensor & fmod_out(Tensor & out, const Tensor & self, const Tensor & other); static Tensor fmod(const Tensor & self, const Tensor & other); static Tensor & remainder_out(Tensor & out, const Tensor & self, Scalar other); static Tensor remainder(const Tensor & self, Scalar other); static Tensor & remainder_out(Tensor & out, const Tensor & self, const Tensor & other); static Tensor remainder(const Tensor & self, const Tensor & other); static Tensor & min_out(Tensor & out, const Tensor & self, const Tensor & other); static Tensor min(const Tensor & self, const Tensor & other); static Tensor min(const Tensor & self); static Tensor & max_out(Tensor & out, const Tensor & self, const Tensor & other); static Tensor max(const Tensor & self, const Tensor & other); static Tensor max(const Tensor & self); static Tensor median(const Tensor & self); static std::tuple<Tensor &,Tensor &> sort_out(Tensor & values, Tensor & indices, const Tensor & self, int64_t dim, bool descending); static std::tuple<Tensor,Tensor> sort(const Tensor & self, int64_t dim, bool descending); static std::tuple<Tensor &,Tensor &> topk_out(Tensor & values, Tensor & indices, const Tensor & self, int64_t k, int64_t dim, bool largest, bool sorted); static Tensor & renorm_out(Tensor & out, const Tensor & self, Scalar p, int64_t dim, Scalar maxnorm); static Tensor renorm(const Tensor & self, Scalar p, int64_t dim, Scalar maxnorm); static Tensor unfold(const Tensor & self, int64_t dimension, int64_t size, int64_t step); static bool equal(const Tensor & self, const Tensor & other); static Tensor & pow_out(Tensor & out, const Tensor & self, const Tensor & exponent); static Tensor pow(const Tensor & self, const Tensor & exponent); static Tensor & pow_out(Tensor & out, Scalar self, const Tensor & exponent); static Tensor pow(Scalar self, const Tensor & exponent); static Tensor & normal_out(Tensor & out, const Tensor & mean, double std, Generator * generator); static Tensor normal(const Tensor & mean, double std, Generator * generator); static Tensor & normal_out(Tensor & out, double mean, const Tensor & std, Generator * generator); static Tensor normal(double mean, const Tensor & std, Generator * generator); static Tensor & normal_out(Tensor & out, const Tensor & mean, const Tensor & std, Generator * generator); static Tensor normal(const Tensor & mean, const Tensor & std, Generator * generator); static Tensor _addr(const Tensor & self, const Tensor & vec1, const Tensor & vec2, Scalar beta, Scalar alpha); static Tensor & _addr_(Tensor & self, const Tensor & vec1, const Tensor & vec2, Scalar beta, Scalar alpha); static Tensor & _addr_out(Tensor & out, const Tensor & self, const Tensor & vec1, const Tensor & vec2, Scalar beta, Scalar alpha); static Tensor & _index_copy_(Tensor & self, int64_t dim, const Tensor & index, const Tensor & source); static Tensor _cumsum(const Tensor & self, int64_t dim); static Tensor & _cumsum_out(Tensor & out, const Tensor & self, int64_t dim); static Tensor _cumprod(const Tensor & self, int64_t dim); static Tensor & _cumprod_out(Tensor & out, const Tensor & self, int64_t dim); static Tensor _var(const Tensor & self, bool unbiased); static Tensor _std(const Tensor & self, bool unbiased); static Tensor & _addmm_out(Tensor & out, const Tensor & self, const Tensor & mat1, const Tensor & mat2, Scalar beta, Scalar alpha); static Tensor _addmm(const Tensor & self, const Tensor & mat1, const Tensor & mat2, Scalar beta, Scalar alpha); static Tensor & _addmm_(Tensor & self, const Tensor & mat1, const Tensor & mat2, Scalar beta, Scalar alpha); static Tensor _cat(TensorList tensors, int64_t dim); static Tensor & _cat_out(Tensor & out, TensorList tensors, int64_t dim); static std::tuple<Tensor,Tensor> _mode(const Tensor & self, int64_t dim, bool keepdim); static std::tuple<Tensor &,Tensor &> _mode_out(Tensor & values, Tensor & indices, const Tensor & self, int64_t dim, bool keepdim); static std::tuple<Tensor,Tensor> _max(const Tensor & self, int64_t dim, bool keepdim); static std::tuple<Tensor &,Tensor &> _max_out(Tensor & max, Tensor & max_indices, const Tensor & self, int64_t dim, bool keepdim); static std::tuple<Tensor,Tensor> _min(const Tensor & self, int64_t dim, bool keepdim); static std::tuple<Tensor &,Tensor &> _min_out(Tensor & min, Tensor & min_indices, const Tensor & self, int64_t dim, bool keepdim); static Tensor & binary_cross_entropy_out(Tensor & out, const Tensor & self, const Tensor & target, const Tensor & weight, int64_t reduction); static Tensor binary_cross_entropy(const Tensor & self, const Tensor & target, const Tensor & weight, int64_t reduction); static Tensor & binary_cross_entropy_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, const Tensor & target, const Tensor & weight, int64_t reduction); static Tensor binary_cross_entropy_backward(const Tensor & grad_output, const Tensor & self, const Tensor & target, const Tensor & weight, int64_t reduction); static Tensor & mse_loss_out(Tensor & out, const Tensor & self, const Tensor & target, int64_t reduction); static Tensor mse_loss(const Tensor & self, const Tensor & target, int64_t reduction); static Tensor & mse_loss_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, const Tensor & target, int64_t reduction); static Tensor mse_loss_backward(const Tensor & grad_output, const Tensor & self, const Tensor & target, int64_t reduction); static Tensor & l1_loss_out(Tensor & out, const Tensor & self, const Tensor & target, int64_t reduction); static Tensor l1_loss(const Tensor & self, const Tensor & target, int64_t reduction); static Tensor & l1_loss_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, const Tensor & target, int64_t reduction); static Tensor l1_loss_backward(const Tensor & grad_output, const Tensor & self, const Tensor & target, int64_t reduction); static Tensor & multi_margin_loss_out(Tensor & out, const Tensor & self, const Tensor & target, Scalar p, Scalar margin, const Tensor & weight, int64_t reduction); static Tensor multi_margin_loss(const Tensor & self, const Tensor & target, Scalar p, Scalar margin, const Tensor & weight, int64_t reduction); static Tensor & multi_margin_loss_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, const Tensor & target, Scalar p, Scalar margin, const Tensor & weight, int64_t reduction); static Tensor multi_margin_loss_backward(const Tensor & grad_output, const Tensor & self, const Tensor & target, Scalar p, Scalar margin, const Tensor & weight, int64_t reduction); static std::tuple<Tensor &,Tensor &> multilabel_margin_loss_forward_out(Tensor & output, Tensor & is_target, const Tensor & self, const Tensor & target, int64_t reduction); static std::tuple<Tensor,Tensor> multilabel_margin_loss_forward(const Tensor & self, const Tensor & target, int64_t reduction); static Tensor & multilabel_margin_loss_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, const Tensor & target, int64_t reduction, const Tensor & is_target); static Tensor multilabel_margin_loss_backward(const Tensor & grad_output, const Tensor & self, const Tensor & target, int64_t reduction, const Tensor & is_target); static std::tuple<Tensor &,Tensor &> nll_loss_forward_out(Tensor & output, Tensor & total_weight, const Tensor & self, const Tensor & target, const Tensor & weight, int64_t reduction, int64_t ignore_index); static std::tuple<Tensor,Tensor> nll_loss_forward(const Tensor & self, const Tensor & target, const Tensor & weight, int64_t reduction, int64_t ignore_index); static Tensor & nll_loss_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, const Tensor & target, const Tensor & weight, int64_t reduction, int64_t ignore_index, const Tensor & total_weight); static Tensor nll_loss_backward(const Tensor & grad_output, const Tensor & self, const Tensor & target, const Tensor & weight, int64_t reduction, int64_t ignore_index, const Tensor & total_weight); static std::tuple<Tensor &,Tensor &> nll_loss2d_forward_out(Tensor & output, Tensor & total_weight, const Tensor & self, const Tensor & target, const Tensor & weight, int64_t reduction, int64_t ignore_index); static std::tuple<Tensor,Tensor> nll_loss2d_forward(const Tensor & self, const Tensor & target, const Tensor & weight, int64_t reduction, int64_t ignore_index); static Tensor & nll_loss2d_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, const Tensor & target, const Tensor & weight, int64_t reduction, int64_t ignore_index, const Tensor & total_weight); static Tensor nll_loss2d_backward(const Tensor & grad_output, const Tensor & self, const Tensor & target, const Tensor & weight, int64_t reduction, int64_t ignore_index, const Tensor & total_weight); static Tensor & smooth_l1_loss_out(Tensor & out, const Tensor & self, const Tensor & target, int64_t reduction); static Tensor smooth_l1_loss(const Tensor & self, const Tensor & target, int64_t reduction); static Tensor & smooth_l1_loss_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, const Tensor & target, int64_t reduction); static Tensor smooth_l1_loss_backward(const Tensor & grad_output, const Tensor & self, const Tensor & target, int64_t reduction); static Tensor & soft_margin_loss_out(Tensor & out, const Tensor & self, const Tensor & target, int64_t reduction); static Tensor soft_margin_loss(const Tensor & self, const Tensor & target, int64_t reduction); static Tensor & soft_margin_loss_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, const Tensor & target, int64_t reduction); static Tensor soft_margin_loss_backward(const Tensor & grad_output, const Tensor & self, const Tensor & target, int64_t reduction); static Tensor & elu_out(Tensor & out, const Tensor & self, Scalar alpha, Scalar scale, Scalar input_scale); static Tensor elu(const Tensor & self, Scalar alpha, Scalar scale, Scalar input_scale); static Tensor & elu_backward_out(Tensor & grad_input, const Tensor & grad_output, Scalar alpha, Scalar scale, Scalar input_scale, const Tensor & output); static Tensor elu_backward(const Tensor & grad_output, Scalar alpha, Scalar scale, Scalar input_scale, const Tensor & output); static Tensor & elu_(Tensor & self, Scalar alpha, Scalar scale, Scalar input_scale); static Tensor & glu_out(Tensor & out, const Tensor & self, int64_t dim); static Tensor glu(const Tensor & self, int64_t dim); static Tensor & glu_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, int64_t dim); static Tensor glu_backward(const Tensor & grad_output, const Tensor & self, int64_t dim); static Tensor & hardtanh_out(Tensor & out, const Tensor & self, Scalar min_val, Scalar max_val); static Tensor hardtanh(const Tensor & self, Scalar min_val, Scalar max_val); static Tensor & hardtanh_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, Scalar min_val, Scalar max_val); static Tensor hardtanh_backward(const Tensor & grad_output, const Tensor & self, Scalar min_val, Scalar max_val); static Tensor & hardtanh_(Tensor & self, Scalar min_val, Scalar max_val); static Tensor & leaky_relu_out(Tensor & out, const Tensor & self, Scalar negative_slope); static Tensor leaky_relu(const Tensor & self, Scalar negative_slope); static Tensor & leaky_relu_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, Scalar negative_slope); static Tensor leaky_relu_backward(const Tensor & grad_output, const Tensor & self, Scalar negative_slope); static Tensor & leaky_relu_(Tensor & self, Scalar negative_slope); static std::tuple<Tensor &,Tensor &> log_sigmoid_forward_out(Tensor & output, Tensor & buffer, const Tensor & self); static std::tuple<Tensor,Tensor> log_sigmoid_forward(const Tensor & self); static Tensor & log_sigmoid_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, const Tensor & buffer); static Tensor log_sigmoid_backward(const Tensor & grad_output, const Tensor & self, const Tensor & buffer); static Tensor & rrelu_with_noise_out(Tensor & out, const Tensor & self, const Tensor & noise, Scalar lower, Scalar upper, bool training, Generator * generator); static Tensor rrelu_with_noise(const Tensor & self, const Tensor & noise, Scalar lower, Scalar upper, bool training, Generator * generator); static Tensor & rrelu_with_noise_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, const Tensor & noise, Scalar lower, Scalar upper, bool training); static Tensor rrelu_with_noise_backward(const Tensor & grad_output, const Tensor & self, const Tensor & noise, Scalar lower, Scalar upper, bool training); static Tensor & rrelu_with_noise_(Tensor & self, const Tensor & noise, Scalar lower, Scalar upper, bool training, Generator * generator); static Tensor & softplus_out(Tensor & out, const Tensor & self, Scalar beta, Scalar threshold); static Tensor softplus(const Tensor & self, Scalar beta, Scalar threshold); static Tensor & softplus_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, Scalar beta, Scalar threshold, const Tensor & output); static Tensor softplus_backward(const Tensor & grad_output, const Tensor & self, Scalar beta, Scalar threshold, const Tensor & output); static Tensor & softshrink_out(Tensor & out, const Tensor & self, Scalar lambd); static Tensor softshrink(const Tensor & self, Scalar lambd); static Tensor & softshrink_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, Scalar lambd); static Tensor softshrink_backward(const Tensor & grad_output, const Tensor & self, Scalar lambd); static Tensor & adaptive_avg_pool2d_out(Tensor & out, const Tensor & self, IntArrayRef output_size); static Tensor _adaptive_avg_pool2d(const Tensor & self, IntArrayRef output_size); static Tensor _adaptive_avg_pool2d_backward(const Tensor & grad_output, const Tensor & self); static Tensor & adaptive_avg_pool3d_out(Tensor & out, const Tensor & self, IntArrayRef output_size); static Tensor adaptive_avg_pool3d(const Tensor & self, IntArrayRef output_size); static Tensor & adaptive_avg_pool3d_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self); static Tensor adaptive_avg_pool3d_backward(const Tensor & grad_output, const Tensor & self); static std::tuple<Tensor &,Tensor &> adaptive_max_pool2d_out(Tensor & out, Tensor & indices, const Tensor & self, IntArrayRef output_size); static std::tuple<Tensor,Tensor> adaptive_max_pool2d(const Tensor & self, IntArrayRef output_size); static Tensor & adaptive_max_pool2d_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, const Tensor & indices); static Tensor adaptive_max_pool2d_backward(const Tensor & grad_output, const Tensor & self, const Tensor & indices); static std::tuple<Tensor &,Tensor &> adaptive_max_pool3d_out(Tensor & out, Tensor & indices, const Tensor & self, IntArrayRef output_size); static std::tuple<Tensor,Tensor> adaptive_max_pool3d(const Tensor & self, IntArrayRef output_size); static Tensor & adaptive_max_pool3d_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, const Tensor & indices); static Tensor adaptive_max_pool3d_backward(const Tensor & grad_output, const Tensor & self, const Tensor & indices); static Tensor & avg_pool2d_out(Tensor & out, const Tensor & self, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, bool ceil_mode, bool count_include_pad, c10::optional<int64_t> divisor_override); static Tensor avg_pool2d(const Tensor & self, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, bool ceil_mode, bool count_include_pad, c10::optional<int64_t> divisor_override); static Tensor & avg_pool2d_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, bool ceil_mode, bool count_include_pad, c10::optional<int64_t> divisor_override); static Tensor avg_pool2d_backward(const Tensor & grad_output, const Tensor & self, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, bool ceil_mode, bool count_include_pad, c10::optional<int64_t> divisor_override); static Tensor & avg_pool3d_out(Tensor & out, const Tensor & self, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, bool ceil_mode, bool count_include_pad, c10::optional<int64_t> divisor_override); static Tensor avg_pool3d(const Tensor & self, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, bool ceil_mode, bool count_include_pad, c10::optional<int64_t> divisor_override); static Tensor & avg_pool3d_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, bool ceil_mode, bool count_include_pad, c10::optional<int64_t> divisor_override); static Tensor avg_pool3d_backward(const Tensor & grad_output, const Tensor & self, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, bool ceil_mode, bool count_include_pad, c10::optional<int64_t> divisor_override); static std::tuple<Tensor &,Tensor &> fractional_max_pool2d_out(Tensor & output, Tensor & indices, const Tensor & self, IntArrayRef kernel_size, IntArrayRef output_size, const Tensor & random_samples); static std::tuple<Tensor,Tensor> fractional_max_pool2d(const Tensor & self, IntArrayRef kernel_size, IntArrayRef output_size, const Tensor & random_samples); static Tensor & fractional_max_pool2d_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, IntArrayRef kernel_size, IntArrayRef output_size, const Tensor & indices); static Tensor fractional_max_pool2d_backward(const Tensor & grad_output, const Tensor & self, IntArrayRef kernel_size, IntArrayRef output_size, const Tensor & indices); static std::tuple<Tensor &,Tensor &> fractional_max_pool3d_out(Tensor & output, Tensor & indices, const Tensor & self, IntArrayRef kernel_size, IntArrayRef output_size, const Tensor & random_samples); static std::tuple<Tensor,Tensor> fractional_max_pool3d(const Tensor & self, IntArrayRef kernel_size, IntArrayRef output_size, const Tensor & random_samples); static Tensor & fractional_max_pool3d_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, IntArrayRef kernel_size, IntArrayRef output_size, const Tensor & indices); static Tensor fractional_max_pool3d_backward(const Tensor & grad_output, const Tensor & self, IntArrayRef kernel_size, IntArrayRef output_size, const Tensor & indices); static std::tuple<Tensor &,Tensor &> max_pool2d_with_indices_out(Tensor & out, Tensor & indices, const Tensor & self, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, bool ceil_mode); static std::tuple<Tensor,Tensor> max_pool2d_with_indices(const Tensor & self, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, bool ceil_mode); static Tensor & max_pool2d_with_indices_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, bool ceil_mode, const Tensor & indices); static Tensor max_pool2d_with_indices_backward(const Tensor & grad_output, const Tensor & self, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, bool ceil_mode, const Tensor & indices); static std::tuple<Tensor &,Tensor &> max_pool3d_with_indices_out(Tensor & out, Tensor & indices, const Tensor & self, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, bool ceil_mode); static std::tuple<Tensor,Tensor> max_pool3d_with_indices(const Tensor & self, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, bool ceil_mode); static Tensor & max_pool3d_with_indices_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, bool ceil_mode, const Tensor & indices); static Tensor max_pool3d_with_indices_backward(const Tensor & grad_output, const Tensor & self, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, bool ceil_mode, const Tensor & indices); static Tensor & max_unpool2d_out(Tensor & out, const Tensor & self, const Tensor & indices, IntArrayRef output_size); static Tensor max_unpool2d(const Tensor & self, const Tensor & indices, IntArrayRef output_size); static Tensor & max_unpool2d_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, const Tensor & indices, IntArrayRef output_size); static Tensor max_unpool2d_backward(const Tensor & grad_output, const Tensor & self, const Tensor & indices, IntArrayRef output_size); static Tensor & max_unpool3d_out(Tensor & out, const Tensor & self, const Tensor & indices, IntArrayRef output_size, IntArrayRef stride, IntArrayRef padding); static Tensor max_unpool3d(const Tensor & self, const Tensor & indices, IntArrayRef output_size, IntArrayRef stride, IntArrayRef padding); static Tensor & max_unpool3d_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, const Tensor & indices, IntArrayRef output_size, IntArrayRef stride, IntArrayRef padding); static Tensor max_unpool3d_backward(const Tensor & grad_output, const Tensor & self, const Tensor & indices, IntArrayRef output_size, IntArrayRef stride, IntArrayRef padding); static Tensor & reflection_pad1d_out(Tensor & out, const Tensor & self, IntArrayRef padding); static Tensor reflection_pad1d(const Tensor & self, IntArrayRef padding); static Tensor & reflection_pad1d_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, IntArrayRef padding); static Tensor reflection_pad1d_backward(const Tensor & grad_output, const Tensor & self, IntArrayRef padding); static Tensor & reflection_pad2d_out(Tensor & out, const Tensor & self, IntArrayRef padding); static Tensor reflection_pad2d(const Tensor & self, IntArrayRef padding); static Tensor & reflection_pad2d_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, IntArrayRef padding); static Tensor reflection_pad2d_backward(const Tensor & grad_output, const Tensor & self, IntArrayRef padding); static Tensor & replication_pad1d_out(Tensor & out, const Tensor & self, IntArrayRef padding); static Tensor replication_pad1d(const Tensor & self, IntArrayRef padding); static Tensor & replication_pad1d_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, IntArrayRef padding); static Tensor replication_pad1d_backward(const Tensor & grad_output, const Tensor & self, IntArrayRef padding); static Tensor & replication_pad2d_out(Tensor & out, const Tensor & self, IntArrayRef padding); static Tensor replication_pad2d(const Tensor & self, IntArrayRef padding); static Tensor & replication_pad2d_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, IntArrayRef padding); static Tensor replication_pad2d_backward(const Tensor & grad_output, const Tensor & self, IntArrayRef padding); static Tensor & replication_pad3d_out(Tensor & out, const Tensor & self, IntArrayRef padding); static Tensor replication_pad3d(const Tensor & self, IntArrayRef padding); static Tensor & replication_pad3d_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & self, IntArrayRef padding); static Tensor replication_pad3d_backward(const Tensor & grad_output, const Tensor & self, IntArrayRef padding); static Tensor & upsample_linear1d_out(Tensor & out, const Tensor & self, IntArrayRef output_size, bool align_corners); static Tensor upsample_linear1d(const Tensor & self, IntArrayRef output_size, bool align_corners); static Tensor & upsample_linear1d_backward_out(Tensor & grad_input, const Tensor & grad_output, IntArrayRef output_size, IntArrayRef input_size, bool align_corners); static Tensor upsample_linear1d_backward(const Tensor & grad_output, IntArrayRef output_size, IntArrayRef input_size, bool align_corners); static Tensor & upsample_bilinear2d_out(Tensor & out, const Tensor & self, IntArrayRef output_size, bool align_corners); static Tensor upsample_bilinear2d(const Tensor & self, IntArrayRef output_size, bool align_corners); static Tensor & upsample_bilinear2d_backward_out(Tensor & grad_input, const Tensor & grad_output, IntArrayRef output_size, IntArrayRef input_size, bool align_corners); static Tensor upsample_bilinear2d_backward(const Tensor & grad_output, IntArrayRef output_size, IntArrayRef input_size, bool align_corners); static Tensor & upsample_bicubic2d_out(Tensor & out, const Tensor & self, IntArrayRef output_size, bool align_corners); static Tensor upsample_bicubic2d(const Tensor & self, IntArrayRef output_size, bool align_corners); static Tensor & upsample_bicubic2d_backward_out(Tensor & grad_input, const Tensor & grad_output, IntArrayRef output_size, IntArrayRef input_size, bool align_corners); static Tensor upsample_bicubic2d_backward(const Tensor & grad_output, IntArrayRef output_size, IntArrayRef input_size, bool align_corners); static Tensor & upsample_trilinear3d_out(Tensor & out, const Tensor & self, IntArrayRef output_size, bool align_corners); static Tensor upsample_trilinear3d(const Tensor & self, IntArrayRef output_size, bool align_corners); static Tensor & upsample_trilinear3d_backward_out(Tensor & grad_input, const Tensor & grad_output, IntArrayRef output_size, IntArrayRef input_size, bool align_corners); static Tensor upsample_trilinear3d_backward(const Tensor & grad_output, IntArrayRef output_size, IntArrayRef input_size, bool align_corners); static Tensor & upsample_nearest1d_out(Tensor & out, const Tensor & self, IntArrayRef output_size); static Tensor upsample_nearest1d(const Tensor & self, IntArrayRef output_size); static Tensor & upsample_nearest1d_backward_out(Tensor & grad_input, const Tensor & grad_output, IntArrayRef output_size, IntArrayRef input_size); static Tensor upsample_nearest1d_backward(const Tensor & grad_output, IntArrayRef output_size, IntArrayRef input_size); static Tensor & upsample_nearest2d_out(Tensor & out, const Tensor & self, IntArrayRef output_size); static Tensor upsample_nearest2d(const Tensor & self, IntArrayRef output_size); static Tensor & upsample_nearest2d_backward_out(Tensor & grad_input, const Tensor & grad_output, IntArrayRef output_size, IntArrayRef input_size); static Tensor upsample_nearest2d_backward(const Tensor & grad_output, IntArrayRef output_size, IntArrayRef input_size); static Tensor & upsample_nearest3d_out(Tensor & out, const Tensor & self, IntArrayRef output_size); static Tensor upsample_nearest3d(const Tensor & self, IntArrayRef output_size); static Tensor & upsample_nearest3d_backward_out(Tensor & grad_input, const Tensor & grad_output, IntArrayRef output_size, IntArrayRef input_size); static Tensor upsample_nearest3d_backward(const Tensor & grad_output, IntArrayRef output_size, IntArrayRef input_size); static Tensor & sigmoid_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & output); static Tensor sigmoid_backward(const Tensor & grad_output, const Tensor & output); static Tensor & tanh_backward_out(Tensor & grad_input, const Tensor & grad_output, const Tensor & output); static Tensor tanh_backward(const Tensor & grad_output, const Tensor & output); static Tensor & slow_conv_transpose2d_out(Tensor & out, const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, const Tensor & bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef output_padding, IntArrayRef dilation); static Tensor slow_conv_transpose2d(const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, const Tensor & bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef output_padding, IntArrayRef dilation); static std::tuple<Tensor &,Tensor &,Tensor &> slow_conv_transpose2d_backward_out(Tensor & grad_input, Tensor & grad_weight, Tensor & grad_bias, const Tensor & grad_output, const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, IntArrayRef output_padding, IntArrayRef dilation, const Tensor & columns, const Tensor & ones); static std::tuple<Tensor,Tensor,Tensor> slow_conv_transpose2d_backward(const Tensor & grad_output, const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, IntArrayRef output_padding, IntArrayRef dilation, const Tensor & columns, const Tensor & ones, std::array<bool,3> output_mask); static Tensor & slow_conv_transpose3d_out(Tensor & out, const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, const Tensor & bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef output_padding, IntArrayRef dilation); static Tensor slow_conv_transpose3d(const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, const Tensor & bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef output_padding, IntArrayRef dilation); static std::tuple<Tensor &,Tensor &,Tensor &> slow_conv_transpose3d_backward_out(Tensor & grad_input, Tensor & grad_weight, Tensor & grad_bias, const Tensor & grad_output, const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, IntArrayRef output_padding, IntArrayRef dilation, const Tensor & finput, const Tensor & fgrad_input); static std::tuple<Tensor,Tensor,Tensor> slow_conv_transpose3d_backward(const Tensor & grad_output, const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, IntArrayRef output_padding, IntArrayRef dilation, const Tensor & finput, const Tensor & fgrad_input, std::array<bool,3> output_mask); static std::tuple<Tensor &,Tensor &,Tensor &> thnn_conv2d_forward_out(Tensor & output, Tensor & finput, Tensor & fgrad_input, const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, const Tensor & bias, IntArrayRef stride, IntArrayRef padding); static std::tuple<Tensor,Tensor,Tensor> thnn_conv2d_forward(const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, const Tensor & bias, IntArrayRef stride, IntArrayRef padding); static std::tuple<Tensor &,Tensor &,Tensor &> thnn_conv2d_backward_out(Tensor & grad_input, Tensor & grad_weight, Tensor & grad_bias, const Tensor & grad_output, const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, const Tensor & finput, const Tensor & fgrad_input); static std::tuple<Tensor,Tensor,Tensor> thnn_conv2d_backward(const Tensor & grad_output, const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, const Tensor & finput, const Tensor & fgrad_input, std::array<bool,3> output_mask); static Tensor & thnn_conv_depthwise2d_forward_out(Tensor & out, const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, const Tensor & bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation); static Tensor thnn_conv_depthwise2d_forward(const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, const Tensor & bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation); static std::tuple<Tensor &,Tensor &> thnn_conv_depthwise2d_backward_out(Tensor & grad_input, Tensor & grad_weight, const Tensor & grad_output, const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation); static std::tuple<Tensor,Tensor> thnn_conv_depthwise2d_backward(const Tensor & grad_output, const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, std::array<bool,2> output_mask); static Tensor slow_conv_dilated2d(const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, const Tensor & bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation); static std::tuple<Tensor,Tensor,Tensor> slow_conv_dilated2d_backward(const Tensor & grad_output, const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, std::array<bool,3> output_mask); static Tensor slow_conv_dilated3d(const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, const Tensor & bias, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation); static std::tuple<Tensor,Tensor,Tensor> slow_conv_dilated3d_backward(const Tensor & grad_output, const Tensor & self, const Tensor & weight, IntArrayRef kernel_size, IntArrayRef stride, IntArrayRef padding, IntArrayRef dilation, std::array<bool,3> output_mask); static Tensor & col2im_out(Tensor & out, const Tensor & self, IntArrayRef output_size, IntArrayRef kernel_size, IntArrayRef dilation, IntArrayRef padding, IntArrayRef stride); static Tensor col2im(const Tensor & self, IntArrayRef output_size, IntArrayRef kernel_size, IntArrayRef dilation, IntArrayRef padding, IntArrayRef stride); static Tensor & col2im_backward_out(Tensor & grad_input, const Tensor & grad_output, IntArrayRef kernel_size, IntArrayRef dilation, IntArrayRef padding, IntArrayRef stride); static Tensor col2im_backward(const Tensor & grad_output, IntArrayRef kernel_size, IntArrayRef dilation, IntArrayRef padding, IntArrayRef stride); static Tensor & im2col_out(Tensor & out, const Tensor & self, IntArrayRef kernel_size, IntArrayRef dilation, IntArrayRef padding, IntArrayRef stride); static Tensor im2col(const Tensor & self, IntArrayRef kernel_size, IntArrayRef dilation, IntArrayRef padding, IntArrayRef stride); static Tensor & im2col_backward_out(Tensor & grad_input, const Tensor & grad_output, IntArrayRef input_size, IntArrayRef kernel_size, IntArrayRef dilation, IntArrayRef padding, IntArrayRef stride); static Tensor im2col_backward(const Tensor & grad_output, IntArrayRef input_size, IntArrayRef kernel_size, IntArrayRef dilation, IntArrayRef padding, IntArrayRef stride); }; } // namespace at
112.973312
543
0.775082
1ea895c8dec4ca3909c07918d804eb1eb337f3b2
1,835
c
C
kernel/proc/exec.c
Marvenlee/kielder
f0d5832da0afe420b7b98a32cec6293f2c3c1399
[ "Apache-2.0" ]
null
null
null
kernel/proc/exec.c
Marvenlee/kielder
f0d5832da0afe420b7b98a32cec6293f2c3c1399
[ "Apache-2.0" ]
null
null
null
kernel/proc/exec.c
Marvenlee/kielder
f0d5832da0afe420b7b98a32cec6293f2c3c1399
[ "Apache-2.0" ]
null
null
null
#include <kernel/types.h> #include <kernel/proc.h> #include <kernel/dbg.h> #include <kernel/fs.h> #include <kernel/vm.h> #include <kernel/kmalloc.h> #include <kernel/error.h> #include <kernel/utility.h> /* * */ int Exec (char *filename, char **argv, char **env) { int fd; vm_addr entry_point; vm_addr stack_pointer; struct ArgInfo ai; bool non_returnable = FALSE; bool not_exec = FALSE; KPRINTF ("Exec()"); if ((fd = Open (filename, O_RDONLY, 0)) != -1) { if (CheckELFHeaders(fd) == 0) { if (CreateArgEnv (&ai, argv, env) == 0) { SetProcessName (current_process, filename); KASSERT (*current_process->exe_name != '\0'); SwitchAddressSpace (&kernel_as); FreeAddressSpace (&current_process->as); non_returnable = TRUE; if (CreateAddressSpace (&current_process->as) == 0) { SwitchAddressSpace (&current_process->as); if (PopulateAddressSpace (current_process, fd, &entry_point, &stack_pointer) == 0) { Close (fd); if (CopyArgEnvToUserSpace (&ai, current_process->user_as) == 0) { FreeArgEnv(&ai); current_process->error = 0; FSCloseOnExec (current_process); USigExec (current_process); ArchInitExec (current_process, entry_point, stack_pointer, (vm_addr)ai.uargv, ai.argc, (vm_addr)ai.uenv, ai.envc); return 0; } } FreeAddressSpace (&current_process->as); } FreeArgEnv (&ai); } } else { not_exec = TRUE; } Close (fd); } if (non_returnable == TRUE) { USigExit (SIGSEGV); } else { if (not_exec == TRUE) SetError(ENOEXEC); } return -1; }
18.35
88
0.556948
1b6bdcb853fc89e71d23c84b4cc8a4aa3139e6af
2,190
h
C
private/net/snmp/subagent/hostmib/mib_xtrn.h
King0987654/windows2000
01f9c2e62c4289194e33244aade34b7d19e7c9b8
[ "MIT" ]
17
2020-11-13T13:42:52.000Z
2021-09-16T09:13:13.000Z
net/snmp/subagent/hostmib/mib_xtrn.h
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
2
2020-10-19T08:02:06.000Z
2020-10-19T08:23:18.000Z
net/snmp/subagent/hostmib/mib_xtrn.h
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
14
2020-11-14T09:43:20.000Z
2021-08-28T08:59:57.000Z
/* * mib_xtrn.h v0.10 * Generated in conjunction with Management Factory scripts: * script version: SNMPv1, 0.16, Apr 25, 1996 * project: D:\TEMP\EXAMPLE\HOSTMIB * **************************************************************************** * * * (C) Copyright 1994 DIGITAL EQUIPMENT CORPORATION * * * * This software is an unpublished work protected under the * * the copyright laws of the United States of America, all * * rights reserved. * * * * In the event this software is licensed for use by the United * * States Government, all use, duplication or disclosure by the * * United States Government is subject to restrictions as set * * forth in either subparagraph (c)(1)(ii) of the Rights in * * Technical Data And Computer Software Clause at DFARS * * 252.227-7013, or the Commercial Computer Software Restricted * * Rights Clause at FAR 52.221-19, whichever is applicable. * * * **************************************************************************** * * Facility: * * Windows NT SNMP Extension Agent * * Abstract: * * This module contains the external declarations for the MIB. * * Author: * * David Burns @ Webenable Inc * * Date: * * Thu Nov 07 16:38:28 1996 * * Revision History: * */ #ifndef mib_xtrn_h #define mib_xtrn_h // Necessary includes. #include <snmp.h> #include "gennt.h" #include "hostmsmi.h" // // External declarations for the table // //extern table declarations extern class_t class_info[] ; extern trap_t trap_info[] ; extern UINT number_of_traps ; extern char *EventLogString ; #endif /* mib_xtrn_h */
33.692308
78
0.461187
9b5137846227d804545f918841d2d8b2fae1c06a
648
c
C
test/match_test.c
jeremycw/mmkr
7f9e07ea72ce286ffc894993fb4a387fd8fce250
[ "MIT" ]
null
null
null
test/match_test.c
jeremycw/mmkr
7f9e07ea72ce286ffc894993fb4a387fd8fce250
[ "MIT" ]
null
null
null
test/match_test.c
jeremycw/mmkr
7f9e07ea72ce286ffc894993fb4a387fd8fce250
[ "MIT" ]
null
null
null
#include <assert.h> #include <string.h> #include "../src/core.h" void test_match() { join_t buffer[8]; array(join_t) joins; joins.buf = buffer; joins.n = 8; for (int i = 0; i < joins.n; i++) { joins.buf[i].lobby_id = 1; joins.buf[i].score = 1000 + i*100; joins.buf[i].user_id = i + 1; joins.buf[i].timeout = 15.f; } match_t matches[8]; int min = 2; int max = 3; match(joins, matches, max, min); assert(matches[0].user_id == 1); char uuid1[37]; char uuid2[37]; uuid_unparse(matches[0].uuid, uuid1); uuid_unparse(matches[1].uuid, uuid2); assert(uuid_compare(matches[0].uuid, matches[1].uuid) == 0); }
24
62
0.612654
15635950636274de5c3e07b5ba433a778eaca482
1,782
h
C
src/include/perspective/defaults.h
nmichaud/perspective-X
d57e80f537d766eca5df6787fb26dfd584c4c8f0
[ "Apache-2.0" ]
null
null
null
src/include/perspective/defaults.h
nmichaud/perspective-X
d57e80f537d766eca5df6787fb26dfd584c4c8f0
[ "Apache-2.0" ]
null
null
null
src/include/perspective/defaults.h
nmichaud/perspective-X
d57e80f537d766eca5df6787fb26dfd584c4c8f0
[ "Apache-2.0" ]
null
null
null
/****************************************************************************** * * Copyright (c) 2017, the Perspective Authors. * * This file is part of the Perspective library, distributed under the terms of * the Apache License 2.0. The full license can be found in the LICENSE file. * */ #pragma once #include <perspective/first.h> #include <perspective/base.h> #include <perspective/raw_types.h> #ifndef WIN32 #include <sys/mman.h> #include <fcntl.h> #endif namespace perspective { #ifdef WIN32 const t_fflag PSP_DEFAULT_FFLAGS = GENERIC_READ | GENERIC_WRITE; const t_fflag PSP_DEFAULT_FMODE = FILE_SHARE_READ; const t_fflag PSP_DEFAULT_CREATION_DISPOSITION = CREATE_ALWAYS; const t_fflag PSP_DEFAULT_MPROT = PAGE_READWRITE; const t_fflag PSP_DEFAULT_MFLAGS = FILE_MAP_READ | FILE_MAP_WRITE; const t_fflag PSP_DEFAULT_SHARED_RO_FFLAGS = GENERIC_READ; const t_fflag PSP_DEFAULT_SHARED_RO_FMODE = FILE_SHARE_READ | FILE_SHARE_WRITE; const t_fflag PSP_DEFAULT_SHARED_RO_CREATION_DISPOSITION = OPEN_ALWAYS; const t_fflag PSP_DEFAULT_SHARED_RO_MPROT = PAGE_READONLY; const t_fflag PSP_DEFAULT_SHARED_RO_MFLAGS = FILE_MAP_READ; #else const t_fflag PSP_DEFAULT_FFLAGS = O_RDWR | O_TRUNC | O_CREAT; const t_fflag PSP_DEFAULT_FMODE = S_IRUSR | S_IWUSR | S_IROTH | S_IRGRP | S_IWGRP; const t_fflag PSP_DEFAULT_CREATION_DISPOSITION = 0; const t_fflag PSP_DEFAULT_MPROT = PROT_WRITE | PROT_READ; const t_fflag PSP_DEFAULT_MFLAGS = MAP_SHARED; const t_fflag PSP_DEFAULT_SHARED_RO_FFLAGS = O_RDONLY | O_CREAT; const t_fflag PSP_DEFAULT_SHARED_RO_FMODE = S_IRUSR; const t_fflag PSP_DEFAULT_SHARED_RO_CREATION_DISPOSITION = 0; const t_fflag PSP_DEFAULT_SHARED_RO_MPROT = PROT_READ; const t_fflag PSP_DEFAULT_SHARED_RO_MFLAGS = MAP_SHARED; #endif } // end namespace perspective
37.125
79
0.783389
6388ad9f5c41c604e00c7c0cbf711baea5b9f8e6
12,691
c
C
example/arm_abi_example/printf.c
fugiefire/pongoOS
7557c3da6126e61b0808d89ccb5fa3bb0a88fcb9
[ "MIT" ]
null
null
null
example/arm_abi_example/printf.c
fugiefire/pongoOS
7557c3da6126e61b0808d89ccb5fa3bb0a88fcb9
[ "MIT" ]
null
null
null
example/arm_abi_example/printf.c
fugiefire/pongoOS
7557c3da6126e61b0808d89ccb5fa3bb0a88fcb9
[ "MIT" ]
null
null
null
/* * 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. * * Copyright fugiefire 2020 * This file is part of pongoOS. */ #include "printf.h" #include <pongo.h> #ifdef vsprintf #undef vsprintf #endif #define LEAD_ZERO 0x1 #define LONG_NUM 0x2 #define HALF_NUM 0x4 #define SIZE_T_NUM 0x8 #define LONG_LONG_NUM 0x10 #define HALF_HALF_NUM 0x20 #define ALT_FLAG 0x40 #ifdef printf #undef printf #endif void arm_abi_example_putc(char c){ char *str = "x"; str[0] = c; puts(str); } void arm_abi_example_memswp(const char *m1, const char *m2, size_t size) { char tmp; for (size_t i = 0; i < size; i++) { tmp = *((char *)((size_t)m1 + i)); *((char *)((size_t)m1 + i)) = *((char *)((size_t)m2 + i)); *((char *)((size_t)m2 + i)) = tmp; } } void arm_abi_example_reverse(char *str, size_t len) { size_t start = 0; size_t end = len - 1; while (start < end) arm_abi_example_memswp((char *)((size_t)str + (start++)), (char *)((size_t)str + (end--)), 1); } void arm_abi_example_do_itoa(size_t n, char *str, uint8_t base, uint8_t signed_int) { if (n == 0) { str[0] = '0'; str[0] = '\0'; return; } long long int i, sign; if (signed_int) if ((sign = n) < 0 && base == 10) n = -n; i = 0; size_t rem; do { rem = n % base; str[i++] = (rem > 9) ? (rem - 10) + 'a' : rem + '0'; n /= base; } while (n); if (signed_int) if (sign < 0 && base == 10) str[i++] = '-'; str[i] = '\0'; arm_abi_example_reverse(str, i); } void arm_abi_example_printf(const char *str, ...){ va_list(ap); va_start(ap, str); arm_abi_example_vsprintf(NULL, command_putc, str, ap); va_end(ap); } void arm_abi_example_vsprintf(__attribute__((unused)) char *str, void (*putchar)(char), const char *fmt, va_list ap) { size_t i; size_t n; char nbuf[32]; char c; unsigned char uc; const char *s; int flags = 0; size_t npad_bytes = 0; for (;;) { while ((c = *fmt++) != 0) { /* Break on format character*/ if (c == '%') break; /* If not a format character, just print it */ if (c == '\t') { /* Treat tabs as 4 spaces */ putchar(' '); putchar(' '); putchar(' '); putchar(' '); } else { putchar(c); } } if (c == 0) break; next_format_char: i = 0; /* Ensure that nbuf is zeroed */ while (i++ < 31) nbuf[i] = 0; /* Sanity check that the character after the '%' exists */ if ((c = *fmt++) == 0) break; switch (c) { /* %0 - %9 are treated as amount of padding 0's */ case '0': /* Enable leading zero padding */ flags |= LEAD_ZERO; goto next_format_char; case '1': /* fall through */ case '2': /* fall through */ case '3': /* fall through */ case '4': /* fall through */ case '5': /* fall through */ case '6': /* fall through */ case '7': /* fall through */ case '8': /* fall through */ case '9': /* If a 0 came before this, this number is how many 0's to pad if no 0 came before, this number is how many ' 's to pad */ npad_bytes = (c - '0'); goto next_format_char; case '*': /* Treat the next va arg as the amount of padding bytes */ npad_bytes = va_arg(ap, int); goto next_format_char; case '.': /* Not implemented properly yet */ goto next_format_char; case '%': /* "%%", print a physical "%" */ putchar(c); break; case '#': /* Enable ALT_FLAG, for hex this adds the 0x prefix, for octal 0 prefix, etc. */ flags |= ALT_FLAG; goto next_format_char; case 'c': /* Print a single character */ uc = (unsigned char)va_arg(ap, int); putchar(uc); break; case 's': /* Print a null terminated string */ s = va_arg(ap, const char *); /* Avoid printing from null */ if (s == 0) s = "<null>"; for (i = 0; s[i] != 0; i++) putchar(s[i]); break; case 'l': /* Long int modifier, if it was already enabled, long long modifier */ if (flags & LONG_NUM) flags |= LONG_LONG_NUM; flags |= LONG_NUM; goto next_format_char; case 'h': /* Half int modifier, if it was already enabled, half half modifier */ if (flags & HALF_NUM) flags |= HALF_HALF_NUM; flags |= HALF_NUM; goto next_format_char; case 'z': /* size_t modifier */ flags |= SIZE_T_NUM; goto next_format_char; case 'i': /* fall through */ case 'd': /* Ensure iterator is 0 */ i = 0; /* Check ll before l, before hh, before h, before size_t modifiers, else normal int */ /* The (size_t)(type) casting prevents compiler warnings */ n = (flags & LONG_LONG_NUM) ? (size_t)va_arg(ap, long long) : (flags & LONG_NUM) ? (size_t)va_arg(ap, long) : (flags & HALF_HALF_NUM) ? (size_t)(signed char)va_arg(ap, int) : (flags & HALF_NUM) ? (size_t)(short)va_arg(ap, int) : (flags & SIZE_T_NUM) ? va_arg(ap, size_t) : (size_t)va_arg(ap, int); /* Convert to string with signing enabled */ arm_abi_example_do_itoa(n, (char *)&nbuf, 10, 1); /* Handle padding bytes when padding amount is greater than current length */ if (npad_bytes > strlen((char *)&nbuf)) { /* Only pad so that the string is of length npad_bytes */ npad_bytes -= strlen((char *)&nbuf); /* Print leading zeroes if set, else leading spaces */ if (flags & LEAD_ZERO) for (; npad_bytes > 0; npad_bytes--) putchar('0'); else for (; npad_bytes > 0; npad_bytes--) putchar(' '); } /* Write out the value using provided char printing handler */ for (i = 0; nbuf[i] != 0; i++) putchar(nbuf[i]); /* Reset flags and npad_bytes */ flags = 0; npad_bytes = 0; break; case 'u': /* same as case 'd' unless otherwise specified */ i = 0; /* Reading vaargs as unsigned values causes casts to zero extend */ n = (flags & LONG_LONG_NUM) ? (size_t)va_arg(ap, unsigned long long) : (flags & LONG_NUM) ? (size_t)va_arg(ap, unsigned long) : (flags & HALF_HALF_NUM) ? (size_t)(signed char)va_arg(ap, unsigned int) : (flags & HALF_NUM) ? (size_t)(short)va_arg(ap, unsigned int) : (flags & SIZE_T_NUM) ? va_arg(ap, size_t) : (size_t)va_arg(ap, int); /* Convert to string with signing disabled */ arm_abi_example_do_itoa(n, (char *)&nbuf, 10, 0); if (npad_bytes > strlen((char *)&nbuf)) { npad_bytes -= strlen((char *)&nbuf); if (flags & LEAD_ZERO) for (; npad_bytes > 0; npad_bytes--) putchar('0'); else for (; npad_bytes > 0; npad_bytes--) putchar(' '); } for (i = 0; nbuf[i] != 0; i++) putchar(nbuf[i]); flags = 0; npad_bytes = 0; break; case 'p': /* Always have 0x prefix for pointers */ flags |= LONG_NUM | ALT_FLAG; goto hex; case 'X': /* Not implemented */ /* fall through */ hex: case 'x': /* Same logic as case 'u', unless otherwise specified */ n = (flags & LONG_LONG_NUM) ? (size_t)va_arg(ap, unsigned long long) : (flags & LONG_NUM) ? (size_t)va_arg(ap, unsigned long) : (flags & HALF_HALF_NUM) ? (size_t)(signed char)va_arg(ap, unsigned int) : (flags & HALF_NUM) ? (size_t)(short)va_arg(ap, unsigned int) : (flags & SIZE_T_NUM) ? va_arg(ap, size_t) : (size_t)va_arg(ap, unsigned int); arm_abi_example_do_itoa(n, (char *)&nbuf, 16, 0); /* Print prefix if ALT_FLAG is set */ if (flags & ALT_FLAG) { putchar('0'); putchar('x'); } if (npad_bytes > strlen((char *)&nbuf)) { npad_bytes -= strlen((char *)&nbuf); if (flags & LEAD_ZERO) for (; npad_bytes > 0; npad_bytes--) putchar('0'); else for (; npad_bytes > 0; npad_bytes--) putchar(' '); } for (i = 0; nbuf[i] != 0; i++) putchar(nbuf[i]); flags = 0; npad_bytes = 0; break; case 'I': /* IP Addresses */ /* Not implemented */ /* fall through */ case 'M': /* Ethernet MAC addresses */ /* Not implemented */ /* fall through */ case 'n': /* Not implemented */ break; default: putchar('%'); putchar(c); break; } } }
38.574468
87
0.428965
0af294a2be61d9e1206a5b779eb559122f8f517d
390
h
C
JLRubyChina/RCAppDelegate.h
bbs7txt/JLRubyChina-iPhone
53ff03e15ca3f2bcd69c4718a5d161f60f5534ed
[ "MIT" ]
1
2017-11-27T03:44:07.000Z
2017-11-27T03:44:07.000Z
JLRubyChina/RCAppDelegate.h
bbs7txt/JLRubyChina-iPhone
53ff03e15ca3f2bcd69c4718a5d161f60f5534ed
[ "MIT" ]
null
null
null
JLRubyChina/RCAppDelegate.h
bbs7txt/JLRubyChina-iPhone
53ff03e15ca3f2bcd69c4718a5d161f60f5534ed
[ "MIT" ]
null
null
null
// // JLAppDelegate.h // JLRubyChina // // Created by jimneylee on 13-12-10. // Copyright (c) 2013年 jimneylee. All rights reserved. // #import <UIKit/UIKit.h> #import "JASidePanelController.h" @interface RCAppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @property (strong, nonatomic) JASidePanelController *sidePanelController; @end
22.941176
73
0.753846
ebc0b3931495c1a33826f57e41ea1d0965d2e707
2,325
h
C
PhotosUICore.framework/PXActionPerformer.h
reels-research/iOS-Private-Frameworks
9a4f4534939310a51fdbf5a439dd22487efb0f01
[ "MIT" ]
4
2021-10-06T12:15:26.000Z
2022-02-21T02:26:00.000Z
PhotosUICore.framework/PXActionPerformer.h
reels-research/iOS-Private-Frameworks
9a4f4534939310a51fdbf5a439dd22487efb0f01
[ "MIT" ]
null
null
null
PhotosUICore.framework/PXActionPerformer.h
reels-research/iOS-Private-Frameworks
9a4f4534939310a51fdbf5a439dd22487efb0f01
[ "MIT" ]
1
2021-10-08T07:40:53.000Z
2021-10-08T07:40:53.000Z
/* Generated by RuntimeBrowser Image: /System/Library/PrivateFrameworks/PhotosUICore.framework/PhotosUICore */ @interface PXActionPerformer : NSObject { NSString * _actionType; bool _cancellable; id /* block */ _completionHandler; <PXActionPerformerDelegate> * _delegate; UIViewController * _presentedViewController; unsigned long long _state; bool _success; id /* block */ _viewControllerDismisser; id /* block */ _viewControllerPresenter; } @property (nonatomic, readonly) NSString *actionType; @property (getter=isCancellable, nonatomic, readonly) bool cancellable; @property (nonatomic) <PXActionPerformerDelegate> *delegate; @property (nonatomic, readonly) UIViewController *presentedViewController; @property (nonatomic, readonly) unsigned long long state; @property (nonatomic, readonly) bool success; @property (nonatomic, copy) id /* block */ viewControllerDismisser; @property (nonatomic, copy) id /* block */ viewControllerPresenter; + (bool)canPerformBlacklistingOnAssetCollection:(id)arg1; - (void).cxx_destruct; - (void)_completeStateWithSuccess:(bool)arg1 error:(id)arg2; - (void)_completeUnlockTaskWithSuccess:(bool)arg1 error:(id)arg2; - (void)_handleStepFinished:(unsigned long long)arg1 withSuccess:(bool)arg2 error:(id)arg3; - (void)_performUnlockIfNeeded; - (void)_transitionToState:(unsigned long long)arg1 withSuccess:(bool)arg2 error:(id)arg3; - (id)actionType; - (void)cancelActionWithCompletionHandler:(id /* block */)arg1; - (void)completeBackgroundTaskWithSuccess:(bool)arg1 error:(id)arg2; - (void)completeUserInteractionTaskWithSuccess:(bool)arg1 error:(id)arg2; - (id)delegate; - (bool)dismissViewController:(id)arg1 completionHandler:(id /* block */)arg2; - (id)init; - (id)initWithActionType:(id)arg1; - (bool)isCancellable; - (void)performActionWithCompletionHandler:(id /* block */)arg1; - (void)performBackgroundTask; - (void)performUserInteractionTask; - (bool)presentViewController:(id)arg1; - (id)presentedViewController; - (bool)requiresUnlockedDevice; - (void)setDelegate:(id)arg1; - (void)setViewControllerDismisser:(id /* block */)arg1; - (void)setViewControllerPresenter:(id /* block */)arg1; - (unsigned long long)state; - (bool)success; - (id /* block */)viewControllerDismisser; - (id /* block */)viewControllerPresenter; @end
40.086207
91
0.762581
a0b082f294b11830e54f31e2c54b090ba61eda97
1,160
h
C
pulse/pulsecore-12.0/play-memchunk.h
VanirLab/vanir-gui-agent-linux
f70f82378eb7c8ce2ce305359e7bc2f89683b9c9
[ "MIT" ]
null
null
null
pulse/pulsecore-12.0/play-memchunk.h
VanirLab/vanir-gui-agent-linux
f70f82378eb7c8ce2ce305359e7bc2f89683b9c9
[ "MIT" ]
null
null
null
pulse/pulsecore-12.0/play-memchunk.h
VanirLab/vanir-gui-agent-linux
f70f82378eb7c8ce2ce305359e7bc2f89683b9c9
[ "MIT" ]
null
null
null
#ifndef fooplaychunkhfoo #define fooplaychunkhfoo /*** This file is part of PulseAudio. Copyright 2004-2006 Lennart Poettering PulseAudio 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. PulseAudio is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with PulseAudio; if not, see <http://www.gnu.org/licenses/>. ***/ #include <pulsecore/sink.h> #include <pulsecore/memchunk.h> int pa_play_memchunk( pa_sink *sink, const pa_sample_spec *ss, const pa_channel_map *map, const pa_memchunk *chunk, pa_cvolume *cvolume, pa_proplist *p, pa_sink_input_flags_t flags, uint32_t *sink_input_index); #endif
31.351351
75
0.710345
9dd526472cb1b52229d43be8e4735e9ca0e6cac6
263
h
C
Eleusis_sln/Eleusis/01_os_backend/01_Win32/WindowOSBundle_Win32.h
bognikol/Eleusis
ee518ede31893689eb6d3c5539e0bd757aeb0294
[ "MIT" ]
4
2019-05-31T19:55:23.000Z
2020-10-27T10:00:32.000Z
Eleusis_sln/Eleusis/01_os_backend/01_Win32/WindowOSBundle_Win32.h
bognikol/Eleusis
ee518ede31893689eb6d3c5539e0bd757aeb0294
[ "MIT" ]
null
null
null
Eleusis_sln/Eleusis/01_os_backend/01_Win32/WindowOSBundle_Win32.h
bognikol/Eleusis
ee518ede31893689eb6d3c5539e0bd757aeb0294
[ "MIT" ]
3
2019-04-29T14:09:38.000Z
2020-10-27T10:00:33.000Z
#ifdef _WIN32 #pragma once #include <Windows.h> namespace Eleusis { struct WindowOSBundle { HWND _hwnd; PAINTSTRUCT _ps; HDC _hdc; HBITMAP _backgroundBuffer; HANDLE _hOld; }; } #endif
13.842105
38
0.539924
6f34f0c5fa5ac2219d375363db87f679cd565856
373
h
C
Pod/Classes/list/XLEBlankView.h
randyeasy/XLEasyKit
f5a1581ed9dce4eb45b71f9432cd170630686619
[ "MIT" ]
1
2020-06-11T15:55:02.000Z
2020-06-11T15:55:02.000Z
Pod/Classes/list/XLEBlankView.h
randyeasy/XLEasyKit
f5a1581ed9dce4eb45b71f9432cd170630686619
[ "MIT" ]
null
null
null
Pod/Classes/list/XLEBlankView.h
randyeasy/XLEasyKit
f5a1581ed9dce4eb45b71f9432cd170630686619
[ "MIT" ]
null
null
null
// // XLEBlankView.h // Pods // // Created by Randy on 16/02/29. // #import <UIKit/UIKit.h> /** * 列表无数据时的空白视图 * 使用方法:如果上层需要定制具体的空白页面,请继承该View */ @interface XLEBlankView : UIView @property (strong, readonly, nonatomic) UIImageView *imageView; @property (strong, readonly, nonatomic) UILabel *label; @property (strong, readonly, nonatomic) UIButton *button; @end
17.761905
63
0.705094
6f6534f497b43a84a98974cf07b0f846c791b97a
2,975
c
C
code/numpy/fft/fft.c
fjteam/micropython-ulab
91c01ef5fe46a570e5e3720adf49c77374fcde3c
[ "MIT" ]
232
2019-10-30T02:47:59.000Z
2022-03-29T13:35:42.000Z
code/numpy/fft/fft.c
fjteam/micropython-ulab
91c01ef5fe46a570e5e3720adf49c77374fcde3c
[ "MIT" ]
325
2019-10-25T00:27:29.000Z
2022-03-16T19:47:45.000Z
code/numpy/fft/fft.c
fjteam/micropython-ulab
91c01ef5fe46a570e5e3720adf49c77374fcde3c
[ "MIT" ]
73
2019-11-04T19:31:22.000Z
2022-03-10T03:11:41.000Z
/* * This file is part of the micropython-ulab project, * * https://github.com/v923z/micropython-ulab * * The MIT License (MIT) * * Copyright (c) 2019-2021 Zoltán Vörös * 2020 Scott Shawcroft for Adafruit Industries * 2020 Taku Fukada */ #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "py/runtime.h" #include "py/builtin.h" #include "py/binary.h" #include "py/obj.h" #include "py/objarray.h" #include "fft.h" //| """Frequency-domain functions""" //| //| import ulab.numpy //| def fft(r: ulab.numpy.ndarray, c: Optional[ulab.numpy.ndarray] = None) -> Tuple[ulab.numpy.ndarray, ulab.numpy.ndarray]: //| """ //| :param ulab.numpy.ndarray r: A 1-dimension array of values whose size is a power of 2 //| :param ulab.numpy.ndarray c: An optional 1-dimension array of values whose size is a power of 2, giving the complex part of the value //| :return tuple (r, c): The real and complex parts of the FFT //| //| Perform a Fast Fourier Transform from the time domain into the frequency domain //| //| See also ~ulab.extras.spectrum, which computes the magnitude of the fft, //| rather than separately returning its real and imaginary parts.""" //| ... //| static mp_obj_t fft_fft(size_t n_args, const mp_obj_t *args) { if(n_args == 2) { return fft_fft_ifft_spectrogram(n_args, args[0], args[1], FFT_FFT); } else { return fft_fft_ifft_spectrogram(n_args, args[0], mp_const_none, FFT_FFT); } } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(fft_fft_obj, 1, 2, fft_fft); //| def ifft(r: ulab.numpy.ndarray, c: Optional[ulab.numpy.ndarray] = None) -> Tuple[ulab.numpy.ndarray, ulab.numpy.ndarray]: //| """ //| :param ulab.numpy.ndarray r: A 1-dimension array of values whose size is a power of 2 //| :param ulab.numpy.ndarray c: An optional 1-dimension array of values whose size is a power of 2, giving the complex part of the value //| :return tuple (r, c): The real and complex parts of the inverse FFT //| //| Perform an Inverse Fast Fourier Transform from the frequeny domain into the time domain""" //| ... //| static mp_obj_t fft_ifft(size_t n_args, const mp_obj_t *args) { if(n_args == 2) { return fft_fft_ifft_spectrogram(n_args, args[0], args[1], FFT_IFFT); } else { return fft_fft_ifft_spectrogram(n_args, args[0], mp_const_none, FFT_IFFT); } } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(fft_ifft_obj, 1, 2, fft_ifft); STATIC const mp_rom_map_elem_t ulab_fft_globals_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_fft) }, { MP_OBJ_NEW_QSTR(MP_QSTR_fft), (mp_obj_t)&fft_fft_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_ifft), (mp_obj_t)&fft_ifft_obj }, }; STATIC MP_DEFINE_CONST_DICT(mp_module_ulab_fft_globals, ulab_fft_globals_table); mp_obj_module_t ulab_fft_module = { .base = { &mp_type_module }, .globals = (mp_obj_dict_t*)&mp_module_ulab_fft_globals, };
35.416667
141
0.692101
3ef325e85f1a9644560f8e62bfef2081951e3cae
6,508
c
C
sm64ex-nightly/levels/bits/areas/1/15/model.inc.c
alex-free/sm64ex-creator
e7089df69fb43f266b2165078d94245b33b8e72a
[ "Intel", "X11", "Unlicense" ]
2
2022-03-12T08:27:53.000Z
2022-03-12T18:26:06.000Z
levels/bits/areas/1/15/model.inc.c
Daviz00/sm64
fd2ed5e0e72d04732034919f8442f8d2cc40fd67
[ "Unlicense" ]
null
null
null
levels/bits/areas/1/15/model.inc.c
Daviz00/sm64
fd2ed5e0e72d04732034919f8442f8d2cc40fd67
[ "Unlicense" ]
null
null
null
// 0x0700CE50 - 0x0700CF50 static const Vtx bits_seg7_vertex_0700CE50[] = { {{{ -2047, 205, 307}, 0, { 480, 478}, {0x7d, 0x7d, 0x9b, 0xff}}}, {{{ -2047, 205, -306}, 0, { 2012, 2010}, {0x7d, 0x7d, 0x9b, 0xff}}}, {{{ -2047, 0, -306}, 0, { 1502, 2522}, {0x7d, 0x7d, 0x9b, 0xff}}}, {{{ -2047, 0, 307}, 0, { 0, 990}, {0x7d, 0x7d, 0x9b, 0xff}}}, {{{ 102, 1741, -306}, 0, { 6866, -2842}, {0xc8, 0xc8, 0xc8, 0xff}}}, {{{ 102, 1741, 307}, 0, { 5334, -4376}, {0xc8, 0xc8, 0xc8, 0xff}}}, {{{ 1331, 1741, 307}, 0, { 8400, -7442}, {0xc8, 0xc8, 0xc8, 0xff}}}, {{{ 1331, 1741, -306}, 0, { 9932, -5908}, {0xc8, 0xc8, 0xc8, 0xff}}}, {{{ 102, 1741, 307}, 0, { 9678, 2010}, {0x6f, 0x6b, 0x89, 0xff}}}, {{{ 1331, 1536, 307}, 0, { 12232, 5588}, {0x6f, 0x6b, 0x89, 0xff}}}, {{{ 1331, 1741, 307}, 0, { 12744, 5076}, {0x6f, 0x6b, 0x89, 0xff}}}, {{{ 307, 1536, 307}, 0, { 9678, 3032}, {0x6f, 0x6b, 0x89, 0xff}}}, {{{ -1740, 205, 307}, 0, { 1246, 1244}, {0x6f, 0x6b, 0x89, 0xff}}}, {{{ -1525, 7, 307}, 0, { 1288, 2272}, {0x6f, 0x6b, 0x89, 0xff}}}, {{{ -2047, 205, 307}, 0, { 480, 478}, {0x6f, 0x6b, 0x89, 0xff}}}, {{{ -2047, 0, 307}, 0, { 0, 990}, {0x6f, 0x6b, 0x89, 0xff}}}, }; // 0x0700CF50 - 0x0700D040 static const Vtx bits_seg7_vertex_0700CF50[] = { {{{ 102, 1741, -306}, 0, { 9678, 2010}, {0x6f, 0x6b, 0x89, 0xff}}}, {{{ 307, 1536, -306}, 0, { 9678, 3032}, {0x6f, 0x6b, 0x89, 0xff}}}, {{{ -1525, 7, -306}, 0, { 1288, 2272}, {0x6f, 0x6b, 0x89, 0xff}}}, {{{ -1740, 205, -306}, 0, { 1246, 1244}, {0x6f, 0x6b, 0x89, 0xff}}}, {{{ -2047, 205, -306}, 0, { 480, 478}, {0x6f, 0x6b, 0x89, 0xff}}}, {{{ -2047, 0, -306}, 0, { 0, 990}, {0x6f, 0x6b, 0x89, 0xff}}}, {{{ 1331, 1741, -306}, 0, { 12744, 5076}, {0x6f, 0x6b, 0x89, 0xff}}}, {{{ 102, 1741, 307}, 0, { 9678, 2010}, {0x6f, 0x6b, 0x89, 0xff}}}, {{{ 307, 1536, 307}, 0, { 9678, 3032}, {0x6f, 0x6b, 0x89, 0xff}}}, {{{ 1331, 1536, 307}, 0, { 12232, 5588}, {0x6f, 0x6b, 0x89, 0xff}}}, {{{ 1331, 1536, -306}, 0, { 12232, 5588}, {0x6f, 0x6b, 0x89, 0xff}}}, {{{ -1525, 7, 307}, 0, { 2802, 758}, {0x54, 0x47, 0x61, 0xff}}}, {{{ 307, 1536, -306}, 0, { 5844, 6864}, {0x54, 0x47, 0x61, 0xff}}}, {{{ 307, 1536, 307}, 0, { 7378, 5332}, {0x54, 0x47, 0x61, 0xff}}}, {{{ -1525, 7, -306}, 0, { 1270, 2290}, {0x54, 0x47, 0x61, 0xff}}}, }; // 0x0700D040 - 0x0700D0C0 static const Vtx bits_seg7_vertex_0700D040[] = { {{{ -2047, 0, 307}, 0, { 1502, -544}, {0x43, 0x3b, 0x58, 0xff}}}, {{{ -2047, 0, -306}, 0, { 0, 990}, {0x43, 0x3b, 0x58, 0xff}}}, {{{ -1525, 7, -306}, 0, { 1270, 2290}, {0x43, 0x3b, 0x58, 0xff}}}, {{{ -1525, 7, 307}, 0, { 2802, 758}, {0x43, 0x3b, 0x58, 0xff}}}, {{{ 307, 1536, -306}, 0, { 5844, 6864}, {0x43, 0x3b, 0x58, 0xff}}}, {{{ 1331, 1536, -306}, 0, { 8400, 9420}, {0x43, 0x3b, 0x58, 0xff}}}, {{{ 1331, 1536, 307}, 0, { 9932, 7886}, {0x43, 0x3b, 0x58, 0xff}}}, {{{ 307, 1536, 307}, 0, { 7378, 5332}, {0x43, 0x3b, 0x58, 0xff}}}, }; // 0x0700D0C0 - 0x0700D140 static const Vtx bits_seg7_vertex_0700D0C0[] = { {{{ 1280, 1587, -281}, 0, { 0, 0}, {0x43, 0x3b, 0x58, 0xff}}}, {{{ 1382, 1587, 282}, 0, { 0, 0}, {0x43, 0x3b, 0x58, 0xff}}}, {{{ 1280, 1587, 282}, 0, { 0, 0}, {0x43, 0x3b, 0x58, 0xff}}}, {{{ 1382, 1715, 282}, 0, { 0, 0}, {0x43, 0x3b, 0x58, 0xff}}}, {{{ 1280, 1715, 282}, 0, { 0, 0}, {0x43, 0x3b, 0x58, 0xff}}}, {{{ 1382, 1587, -281}, 0, { 0, 0}, {0x43, 0x3b, 0x58, 0xff}}}, {{{ 1382, 1715, -281}, 0, { 0, 0}, {0x43, 0x3b, 0x58, 0xff}}}, {{{ 1280, 1715, -281}, 0, { 0, 0}, {0x43, 0x3b, 0x58, 0xff}}}, }; // 0x0700D140 - 0x0700D228 static const Gfx bits_seg7_dl_0700D140[] = { gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, sky_09007000), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)), gsSPVertex(bits_seg7_vertex_0700CE50, 16, 0), gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), gsSP2Triangles( 4, 5, 6, 0x0, 7, 4, 6, 0x0), gsSP2Triangles( 8, 9, 10, 0x0, 11, 8, 12, 0x0), gsSP2Triangles(12, 13, 11, 0x0, 12, 14, 13, 0x0), gsSP1Triangle(14, 15, 13, 0x0), gsSPVertex(bits_seg7_vertex_0700CF50, 15, 0), gsSP2Triangles( 0, 1, 2, 0x0, 2, 3, 0, 0x0), gsSP2Triangles( 2, 4, 3, 0x0, 2, 5, 4, 0x0), gsSP2Triangles( 6, 1, 0, 0x0, 7, 8, 9, 0x0), gsSP2Triangles( 6, 10, 1, 0x0, 11, 12, 13, 0x0), gsSP1Triangle(11, 14, 12, 0x0), gsSPVertex(bits_seg7_vertex_0700D040, 8, 0), gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), gsSP2Triangles( 4, 5, 6, 0x0, 4, 6, 7, 0x0), gsSPEndDisplayList(), }; // 0x0700D228 - 0x0700D278 static const Gfx bits_seg7_dl_0700D228[] = { gsSPVertex(bits_seg7_vertex_0700D0C0, 8, 0), gsSP2Triangles( 0, 1, 2, 0x0, 2, 1, 3, 0x0), gsSP2Triangles( 2, 3, 4, 0x0, 0, 5, 1, 0x0), gsSP2Triangles( 4, 3, 6, 0x0, 4, 6, 7, 0x0), gsSP2Triangles( 7, 5, 0, 0x0, 7, 6, 5, 0x0), gsSPEndDisplayList(), }; // 0x0700D278 - 0x0700D2F0 const Gfx bits_seg7_dl_0700D278[] = { gsDPPipeSync(), gsDPSetCombineMode(G_CC_MODULATERGB, G_CC_MODULATERGB), gsSPClearGeometryMode(G_LIGHTING), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), gsDPTileSync(), gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, 5, G_TX_NOLOD), gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC), gsSPDisplayList(bits_seg7_dl_0700D140), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF), gsDPPipeSync(), gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), gsSPDisplayList(bits_seg7_dl_0700D228), gsSPSetGeometryMode(G_LIGHTING), gsSPEndDisplayList(), };
56.591304
173
0.520129
0ee8debf2f8ad838288b93e08d26499e417ce092
787
h
C
src/bin/ast/simplifier/fpa_simplifier_plugin.h
iaakhter/MYZ3
3b95aa583a37fb3a5df6451f9d76ef04b27040dc
[ "MIT" ]
1
2021-09-07T03:24:22.000Z
2021-09-07T03:24:22.000Z
src/ast/simplifier/fpa_simplifier_plugin.h
abarth/z3
c8931a7bba6e9250e5c92d4c520ecfcf6a51f5d3
[ "MIT" ]
null
null
null
src/ast/simplifier/fpa_simplifier_plugin.h
abarth/z3
c8931a7bba6e9250e5c92d4c520ecfcf6a51f5d3
[ "MIT" ]
null
null
null
/*++ Copyright (c) 2015 Microsoft Corporation Module Name: fpa_simplifier_plugin.h Abstract: Simplifier for the floating-point theory Author: Christoph (cwinter) 2015-01-14 --*/ #ifndef FPA_SIMPLIFIER_PLUGIN_H_ #define FPA_SIMPLIFIER_PLUGIN_H_ #include"basic_simplifier_plugin.h" #include"fpa_decl_plugin.h" #include"fpa_rewriter.h" class fpa_simplifier_plugin : public simplifier_plugin { fpa_util m_util; fpa_rewriter m_rw; public: fpa_simplifier_plugin(ast_manager & m, basic_simplifier_plugin & b); ~fpa_simplifier_plugin(); virtual bool reduce(func_decl * f, unsigned num_args, expr * const * args, expr_ref & result); virtual bool reduce_eq(expr * lhs, expr * rhs, expr_ref & result); }; #endif /* FPA_SIMPLIFIER_PLUGIN_H_ */
19.675
98
0.740788
0efd3883a99f58e259b05436a9cbf0cb2628396d
1,489
h
C
include/gamemenu.h
aobolensk/fishing-time
a56970eb026e8e86d16e9a7444ef892996d74546
[ "MIT" ]
1
2019-07-08T09:47:06.000Z
2019-07-08T09:47:06.000Z
include/gamemenu.h
gooddoog/fishing-time
a56970eb026e8e86d16e9a7444ef892996d74546
[ "MIT" ]
278
2019-07-01T19:11:13.000Z
2020-01-12T08:42:53.000Z
include/gamemenu.h
aobolensk/fishing-time
a56970eb026e8e86d16e9a7444ef892996d74546
[ "MIT" ]
null
null
null
#ifndef INCLUDE_GAMEMENU_H_ #define INCLUDE_GAMEMENU_H_ #include <QLabel> #include <QPushButton> #include <QTableWidget> #include "menu.h" #include "inventorymenu.h" class GameMenu : public Menu { private: Q_OBJECT private: QPushButton clickButton, profileButton, logOutButton, backButton, inventoryButton, netsButton, marketButton, storeButton, statisticsButton, usersettingsButton, locationButton; QLabel infoLabel, fishLabel; InventoryMenu *popUpInventoryTable; QTableWidgetItem nameHeader, quantityHeader; protected: bool eventFilter(QObject *obj, QEvent *event) override; public slots: void logOutFunction(); void clickFunction(); private slots: void profileFunction(); void backFunction() override; void inventoryFunction(); void marketFunction(); void storeFunction(); void netsFunction(); void statisticsFunction(); void usersettingsFunction(); void locationFunction(); private: bool displayedButtons = true; void displayButtons(); void hideButtons(); public: void updateInfo(); InventoryMenu &getPopUpInventoryTable(); public: GameMenu(Game *game, QGridLayout *grid, InventoryMenu *inv); ~GameMenu(); void display() override; void hide() override; }; #endif // INCLUDE_GAMEMENU_H_
25.237288
64
0.643385
162e0c755d9cfc9034c1b3df5c6690e79ba9ebd1
3,687
h
C
modules/perception/lidar/lib/detector/cnn_segmentation/spp_engine/spp_cluster_list.h
jzjonah/apollo
bc534789dc0548bf2d27f8d72fe255d5c5e4f951
[ "Apache-2.0" ]
22,688
2017-07-04T23:17:19.000Z
2022-03-31T18:56:48.000Z
modules/perception/lidar/lib/detector/cnn_segmentation/spp_engine/spp_cluster_list.h
WJY-Mark/apollo
463fb82f9e979d02dcb25044e60931293ab2dba0
[ "Apache-2.0" ]
4,804
2017-07-04T22:30:12.000Z
2022-03-31T12:58:21.000Z
modules/perception/lidar/lib/detector/cnn_segmentation/spp_engine/spp_cluster_list.h
WJY-Mark/apollo
463fb82f9e979d02dcb25044e60931293ab2dba0
[ "Apache-2.0" ]
9,985
2017-07-04T22:01:17.000Z
2022-03-31T14:18:16.000Z
/****************************************************************************** * Copyright 2018 The Apollo Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *****************************************************************************/ #pragma once #include <string> #include <vector> #include "cyber/common/macros.h" #include "modules/perception/lidar/lib/detector/cnn_segmentation/spp_engine/spp_cluster.h" #include "modules/perception/lidar/lib/detector/cnn_segmentation/spp_engine/spp_label_image.h" namespace apollo { namespace perception { namespace lidar { class SppClusterList { public: SppClusterList() { clusters_.reserve(kDefaultReserveSize); } // @brief: initialize cluster list // @param [in]: size // @param [in]: sensor_name void Init(size_t size, const std::string& sensor_name = "velodyne64"); // @brief: reset cluster list inline void Reset() { clusters_.clear(); } // @brief: resize cluster list // @param [in]: size void resize(size_t size); // @brief: add an 3d point sample // @param [in]: cluster id // @param [in]: 3d point // @param [in]: point height above ground // @param [in]: point id void AddPointSample(size_t cluster_id, const base::PointF& point, float height, uint32_t point_id); // @brief: get clusters data // @return: clusters inline std::vector<SppClusterPtr>& clusters() { return clusters_; } // @brief: get clusters data, const version // @return: clusters inline const std::vector<SppClusterPtr>& clusters() const { return clusters_; } // @brief: get clusters size // @return: cluster size inline size_t size() const { return clusters_.size(); } // @brief: get cluster pointer // @return: cluster pointer inline SppClusterPtr& operator[](int id) { return clusters_[id]; } // @brief: get cluster pointer, const version // @return: cluster pointer inline const SppClusterPtr& operator[](int id) const { return clusters_[id]; } // @brief: merge elements from another cluster list and clear it // @param [in]: another cluster list void Merge(SppClusterList* rhs); // @brief: cut along height axis to split cluster // @param [in]: max gap value in two connected component // @param [in]: start cluster id // @return: cut number in all clusters size_t HeightCut(float max_gap, size_t start_id = 0); // @brief: compute height and split clusters // @param [in]: cluster id // @param [in]: max gap value in two connected component // @return: true if successfully split bool ComputeHeightAndSplitCluster(size_t id, float max_gap); // @brief: remove empty cluster from clusters void RemoveEmptyClusters(); // @brief: remove cluster given id void EraseCluster(size_t id); // @brief: assign clusters from label image SppClusterList& operator=(const SppLabelImage& rhs) { clusters_ = rhs.GetClusters(); return *this; } private: static const size_t kDefaultReserveSize = 500; private: std::vector<SppClusterPtr> clusters_; std::string sensor_name_; DISALLOW_COPY_AND_ASSIGN(SppClusterList); }; } // namespace lidar } // namespace perception } // namespace apollo
36.87
94
0.682126
8b84ef802a26a622daa7941e9623f8a0e0afd5cd
182
h
C
cbits/libpng-safe.h
chpatrick/libpng-safe
01be8a0fe074b0ec28330ad0aa5e9de412dfdd06
[ "Zlib" ]
1
2019-11-30T01:35:35.000Z
2019-11-30T01:35:35.000Z
cbits/libpng-safe.h
chpatrick/libpng-safe
01be8a0fe074b0ec28330ad0aa5e9de412dfdd06
[ "Zlib" ]
null
null
null
cbits/libpng-safe.h
chpatrick/libpng-safe
01be8a0fe074b0ec28330ad0aa5e9de412dfdd06
[ "Zlib" ]
null
null
null
#pragma once #include "png.h" void safe_error_shim(png_structp png_struct, png_const_charp message); void safe_create_read_struct(png_error_ptr error_fn, png_error_ptr warn_fn);
20.222222
76
0.82967
fee6ff2d27d4e1263691169734982d457e73da72
1,099
c
C
lib/prot/di/msg12.c
dmareddx/client-sdk
774a99f117838b73102b134c4fc2a5013eb20317
[ "Apache-2.0" ]
5
2020-08-16T12:11:23.000Z
2020-11-17T08:27:19.000Z
lib/prot/di/msg12.c
dmareddx/client-sdk
774a99f117838b73102b134c4fc2a5013eb20317
[ "Apache-2.0" ]
23
2020-06-26T10:38:49.000Z
2021-08-04T12:18:31.000Z
lib/prot/di/msg12.c
dmareddx/client-sdk
774a99f117838b73102b134c4fc2a5013eb20317
[ "Apache-2.0" ]
20
2020-03-30T06:55:27.000Z
2021-08-17T06:09:23.000Z
/* * Copyright 2020 Intel Corporation * SPDX-License-Identifier: Apache 2.0 */ /*! * \file * \brief Implementation of msg number 12. The device ingested msg 11 contents * and prepares msg 12 */ #include "util.h" #include "sdoprot.h" /** * msg12() - DI.SetHMAC * * The device has already calculated HMAC over the Ownership Header * received in msg11, so, fill in that information send it back to * manfacturer. Manufacturer uses this information to prepare the * fist empty Ownership Voucher * * { * "hmac": Hash * } */ int32_t msg12(sdo_prot_t *ps) { int ret = -1; /* Prepare the block for msg12 */ sdow_next_block(&ps->sdow, SDO_DI_SET_HMAC); sdow_begin_object(&ps->sdow); sdo_write_tag(&ps->sdow, "hmac"); if (!ps->new_ov_hdr_hmac) { LOG(LOG_ERROR, "OVHdrHMAC is NULL MSG#12\n"); goto err; } /* Write the HMAC and send it to manufacturer */ sdo_hash_write(&ps->sdow, ps->new_ov_hdr_hmac); sdo_hash_free(ps->new_ov_hdr_hmac); sdow_end_object(&ps->sdow); /* Mark as success and goto msg13 */ ps->state = SDO_STATE_DI_DONE; ret = 0; err: return ret; }
20.735849
78
0.687898
6b8fe4676df77afc362566c34273140f738a0dd6
8,795
c
C
src/cmd/gc/pgen.c
mhennings/marcohennings-go
4979c38b1056a0a818535695ee381d0df736cd93
[ "BSD-3-Clause" ]
null
null
null
src/cmd/gc/pgen.c
mhennings/marcohennings-go
4979c38b1056a0a818535695ee381d0df736cd93
[ "BSD-3-Clause" ]
null
null
null
src/cmd/gc/pgen.c
mhennings/marcohennings-go
4979c38b1056a0a818535695ee381d0df736cd93
[ "BSD-3-Clause" ]
null
null
null
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. #include <u.h> #include <libc.h> #include "gg.h" #include "opt.h" #include "../../pkg/runtime/funcdata.h" static void allocauto(Prog* p); static int pointermap(Sym*, int, Node*); static void gcsymbol(Sym*, Node*); void compile(Node *fn) { Plist *pl; Node nod1, *n, *gcnod; Prog *ptxt, *p, *p1; int32 lno; Type *t; Iter save; vlong oldstksize; NodeList *l; Sym *gcsym; static int ngcsym; if(newproc == N) { newproc = sysfunc("newproc"); deferproc = sysfunc("deferproc"); deferreturn = sysfunc("deferreturn"); panicindex = sysfunc("panicindex"); panicslice = sysfunc("panicslice"); throwreturn = sysfunc("throwreturn"); } lno = setlineno(fn); if(fn->nbody == nil) { if(pure_go || memcmp(fn->nname->sym->name, "init·", 6) == 0) yyerror("missing function body", fn); goto ret; } saveerrors(); // set up domain for labels clearlabels(); curfn = fn; dowidth(curfn->type); if(curfn->type->outnamed) { // add clearing of the output parameters t = structfirst(&save, getoutarg(curfn->type)); while(t != T) { if(t->nname != N) { n = nod(OAS, t->nname, N); typecheck(&n, Etop); curfn->nbody = concat(list1(n), curfn->nbody); } t = structnext(&save); } } order(curfn); if(nerrors != 0) goto ret; hasdefer = 0; walk(curfn); if(nerrors != 0) goto ret; if(flag_race) racewalk(curfn); if(nerrors != 0) goto ret; continpc = P; breakpc = P; pl = newplist(); pl->name = curfn->nname; setlineno(curfn); nodconst(&nod1, types[TINT32], 0); ptxt = gins(ATEXT, isblank(curfn->nname) ? N : curfn->nname, &nod1); if(fn->dupok) ptxt->TEXTFLAG = DUPOK; afunclit(&ptxt->from, curfn->nname); ginit(); snprint(namebuf, sizeof namebuf, "gc·%d", ngcsym++); gcsym = lookup(namebuf); gcnod = newname(gcsym); gcnod->class = PEXTERN; nodconst(&nod1, types[TINT32], FUNCDATA_GC); gins(AFUNCDATA, &nod1, gcnod); for(t=curfn->paramfld; t; t=t->down) gtrack(tracksym(t->type)); for(l=fn->dcl; l; l=l->next) { n = l->n; if(n->op != ONAME) // might be OTYPE or OLITERAL continue; switch(n->class) { case PAUTO: case PPARAM: case PPARAMOUT: nodconst(&nod1, types[TUINTPTR], l->n->type->width); p = gins(ATYPE, l->n, &nod1); p->from.gotype = ngotype(l->n); break; } } genlist(curfn->enter); retpc = nil; if(hasdefer || curfn->exit) { p1 = gjmp(nil); retpc = gjmp(nil); patch(p1, pc); } genlist(curfn->nbody); gclean(); checklabels(); if(nerrors != 0) goto ret; if(curfn->endlineno) lineno = curfn->endlineno; if(curfn->type->outtuple != 0) ginscall(throwreturn, 0); if(retpc) patch(retpc, pc); ginit(); if(hasdefer) ginscall(deferreturn, 0); if(curfn->exit) genlist(curfn->exit); gclean(); if(nerrors != 0) goto ret; pc->as = ARET; // overwrite AEND pc->lineno = lineno; if(!debug['N'] || debug['R'] || debug['P']) { regopt(ptxt); } oldstksize = stksize; allocauto(ptxt); // Emit garbage collection symbol. gcsymbol(gcsym, fn); if(0) print("allocauto: %lld to %lld\n", oldstksize, (vlong)stksize); setlineno(curfn); if((int64)stksize+maxarg > (1ULL<<31)) yyerror("stack frame too large (>2GB)"); defframe(ptxt); if(0) frame(0); ret: lineno = lno; } static void gcsymbol(Sym *gcsym, Node *fn) { int off; off = 0; off = duint32(gcsym, off, stksize); // size of local block off = pointermap(gcsym, off, fn); // pointer bitmap for args (must be last) ggloblsym(gcsym, off, 0, 1); } static void walktype1(Type *t, vlong *xoffset, Bvec *bv) { vlong fieldoffset, i, o; Type *t1; if(t->align > 0 && (*xoffset % t->align) != 0) fatal("walktype1: invalid initial alignment, %T", t); switch(t->etype) { case TINT8: case TUINT8: case TINT16: case TUINT16: case TINT32: case TUINT32: case TINT64: case TUINT64: case TINT: case TUINT: case TUINTPTR: case TBOOL: case TFLOAT32: case TFLOAT64: case TCOMPLEX64: case TCOMPLEX128: *xoffset += t->width; break; case TPTR32: case TPTR64: case TUNSAFEPTR: case TFUNC: case TCHAN: case TMAP: if(*xoffset % widthptr != 0) fatal("walktype1: invalid alignment, %T", t); bvset(bv, *xoffset / widthptr); *xoffset += t->width; break; case TSTRING: // struct { byte *str; intgo len; } if(*xoffset % widthptr != 0) fatal("walktype1: invalid alignment, %T", t); bvset(bv, *xoffset / widthptr); *xoffset += t->width; break; case TINTER: // struct { Itab* tab; union { void* ptr, uintptr val } data; } // or, when isnilinter(t)==true: // struct { Type* type; union { void* ptr, uintptr val } data; } if(*xoffset % widthptr != 0) fatal("walktype1: invalid alignment, %T", t); bvset(bv, *xoffset / widthptr); bvset(bv, (*xoffset + widthptr) / widthptr); *xoffset += t->width; break; case TARRAY: // The value of t->bound is -1 for slices types and >0 for // for fixed array types. All other values are invalid. if(t->bound < -1) fatal("walktype1: invalid bound, %T", t); if(isslice(t)) { // struct { byte* array; uintgo len; uintgo cap; } if(*xoffset % widthptr != 0) fatal("walktype1: invalid TARRAY alignment, %T", t); bvset(bv, *xoffset / widthptr); *xoffset += t->width; } else if(!haspointers(t->type)) *xoffset += t->width; else for(i = 0; i < t->bound; ++i) walktype1(t->type, xoffset, bv); break; case TSTRUCT: o = 0; for(t1 = t->type; t1 != T; t1 = t1->down) { fieldoffset = t1->width; *xoffset += fieldoffset - o; walktype1(t1->type, xoffset, bv); o = fieldoffset + t1->type->width; } *xoffset += t->width - o; break; default: fatal("walktype1: unexpected type, %T", t); } } static void walktype(Type *type, Bvec *bv) { vlong xoffset; // Start the walk at offset 0. The correct offset will be // filled in by the first type encountered during the walk. xoffset = 0; walktype1(type, &xoffset, bv); } // Compute a bit vector to describes the pointer containing locations // in the argument list. static int pointermap(Sym *gcsym, int off, Node *fn) { Type *thistype, *inargtype, *outargtype; Bvec *bv; int32 i; thistype = getthisx(fn->type); inargtype = getinargx(fn->type); outargtype = getoutargx(fn->type); bv = bvalloc(fn->type->argwid / widthptr); if(thistype != nil) walktype(thistype, bv); if(inargtype != nil) walktype(inargtype, bv); if(outargtype != nil) walktype(outargtype, bv); off = duint32(gcsym, off, bv->n); for(i = 0; i < bv->n; i += 32) off = duint32(gcsym, off, bv->b[i/32]); free(bv); return off; } // Sort the list of stack variables. autos after anything else, // within autos, unused after used, and within used on reverse alignment. // non-autos sort on offset. static int cmpstackvar(Node *a, Node *b) { if (a->class != b->class) return (a->class == PAUTO) ? 1 : -1; if (a->class != PAUTO) { if (a->xoffset < b->xoffset) return -1; if (a->xoffset > b->xoffset) return 1; return 0; } if ((a->used == 0) != (b->used == 0)) return b->used - a->used; return b->type->align - a->type->align; } // TODO(lvd) find out where the PAUTO/OLITERAL nodes come from. static void allocauto(Prog* ptxt) { NodeList *ll; Node* n; vlong w; if(curfn->dcl == nil) return; // Mark the PAUTO's unused. for(ll=curfn->dcl; ll != nil; ll=ll->next) if (ll->n->class == PAUTO) ll->n->used = 0; markautoused(ptxt); listsort(&curfn->dcl, cmpstackvar); // Unused autos are at the end, chop 'em off. ll = curfn->dcl; n = ll->n; if (n->class == PAUTO && n->op == ONAME && !n->used) { // No locals used at all curfn->dcl = nil; stksize = 0; fixautoused(ptxt); return; } for(ll = curfn->dcl; ll->next != nil; ll=ll->next) { n = ll->next->n; if (n->class == PAUTO && n->op == ONAME && !n->used) { ll->next = nil; curfn->dcl->end = ll; break; } } // Reassign stack offsets of the locals that are still there. stksize = 0; for(ll = curfn->dcl; ll != nil; ll=ll->next) { n = ll->n; if (n->class != PAUTO || n->op != ONAME) continue; dowidth(n->type); w = n->type->width; if(w >= MAXWIDTH || w < 0) fatal("bad width"); stksize += w; stksize = rnd(stksize, n->type->align); if(thechar == '5') stksize = rnd(stksize, widthptr); if(stksize >= (1ULL<<31)) { setlineno(curfn); yyerror("stack frame too large (>2GB)"); } n->stkdelta = -stksize - n->xoffset; } fixautoused(ptxt); // The debug information needs accurate offsets on the symbols. for(ll = curfn->dcl ;ll != nil; ll=ll->next) { if (ll->n->class != PAUTO || ll->n->op != ONAME) continue; ll->n->xoffset += ll->n->stkdelta; ll->n->stkdelta = 0; } }
21.091127
76
0.620694
b1cf2d56e733fe03834deacd1a7a391521c545a1
76,179
c
C
src/hwmon.c
sthagen/hashcat-hashcat
713824678cf4ec12fce2398bb37ce4a9b3b09a47
[ "MIT" ]
null
null
null
src/hwmon.c
sthagen/hashcat-hashcat
713824678cf4ec12fce2398bb37ce4a9b3b09a47
[ "MIT" ]
null
null
null
src/hwmon.c
sthagen/hashcat-hashcat
713824678cf4ec12fce2398bb37ce4a9b3b09a47
[ "MIT" ]
null
null
null
/** * Author......: See docs/credits.txt * License.....: MIT */ #include "common.h" #include "types.h" #include "memory.h" #include "event.h" #include "dynloader.h" #include "shared.h" #include "folder.h" #include "hwmon.h" // general functions static int get_adapters_num_adl (hashcat_ctx_t *hashcat_ctx, int *iNumberAdapters) { if (hm_ADL_Adapter_NumberOfAdapters_Get (hashcat_ctx, iNumberAdapters) == -1) return -1; if (iNumberAdapters == NULL) { event_log_error (hashcat_ctx, "No ADL adapters found."); return -1; } return 0; } static int hm_get_adapter_index_nvapi (hashcat_ctx_t *hashcat_ctx, HM_ADAPTER_NVAPI *nvapiGPUHandle) { NvU32 pGpuCount; if (hm_NvAPI_EnumPhysicalGPUs (hashcat_ctx, nvapiGPUHandle, &pGpuCount) == -1) return 0; if (pGpuCount == 0) { event_log_error (hashcat_ctx, "No NvAPI adapters found."); return 0; } return (pGpuCount); } static int hm_get_adapter_index_nvml (hashcat_ctx_t *hashcat_ctx, HM_ADAPTER_NVML *nvmlGPUHandle) { unsigned int deviceCount = 0; hm_NVML_nvmlDeviceGetCount (hashcat_ctx, &deviceCount); if (deviceCount == 0) { event_log_error (hashcat_ctx, "No NVML adapters found."); return 0; } for (u32 i = 0; i < deviceCount; i++) { if (hm_NVML_nvmlDeviceGetHandleByIndex (hashcat_ctx, i, &nvmlGPUHandle[i]) == -1) break; // can be used to determine if the device by index matches the cuda device by index // char name[100]; memset (name, 0, sizeof (name)); // hm_NVML_nvmlDeviceGetName (hashcat_ctx, nvGPUHandle[i], name, sizeof (name) - 1); } return (deviceCount); } int hm_get_threshold_slowdown_with_devices_idx (hashcat_ctx_t *hashcat_ctx, const int backend_device_idx) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; if (hwmon_ctx->enabled == false) return -1; if (hwmon_ctx->hm_device[backend_device_idx].threshold_slowdown_get_supported == false) return -1; if (backend_ctx->devices_param[backend_device_idx].is_cuda == true) { if (hwmon_ctx->hm_nvml) { int target = 0; if (hm_NVML_nvmlDeviceGetTemperatureThreshold (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].nvml, NVML_TEMPERATURE_THRESHOLD_SLOWDOWN, (unsigned int *) &target) == -1) { hwmon_ctx->hm_device[backend_device_idx].threshold_slowdown_get_supported = false; return -1; } return target; } } if ((backend_ctx->devices_param[backend_device_idx].is_opencl == true) || (backend_ctx->devices_param[backend_device_idx].is_hip == true)) { if (backend_ctx->devices_param[backend_device_idx].opencl_device_type & CL_DEVICE_TYPE_GPU) { if ((backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD) || (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)) { if (hwmon_ctx->hm_adl) { if (hwmon_ctx->hm_device[backend_device_idx].od_version == 5) { } else if (hwmon_ctx->hm_device[backend_device_idx].od_version == 6) { } } } if (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_NV) { if (hwmon_ctx->hm_nvml) { int target = 0; if (hm_NVML_nvmlDeviceGetTemperatureThreshold (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].nvml, NVML_TEMPERATURE_THRESHOLD_SLOWDOWN, (unsigned int *) &target) == -1) { hwmon_ctx->hm_device[backend_device_idx].threshold_slowdown_get_supported = false; return -1; } return target; } } } } hwmon_ctx->hm_device[backend_device_idx].threshold_slowdown_get_supported = false; return -1; } int hm_get_threshold_shutdown_with_devices_idx (hashcat_ctx_t *hashcat_ctx, const int backend_device_idx) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; if (hwmon_ctx->enabled == false) return -1; if (hwmon_ctx->hm_device[backend_device_idx].threshold_shutdown_get_supported == false) return -1; if (backend_ctx->devices_param[backend_device_idx].is_cuda == true) { if (hwmon_ctx->hm_nvml) { int target = 0; if (hm_NVML_nvmlDeviceGetTemperatureThreshold (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].nvml, NVML_TEMPERATURE_THRESHOLD_SHUTDOWN, (unsigned int *) &target) == -1) { hwmon_ctx->hm_device[backend_device_idx].threshold_shutdown_get_supported = false; return -1; } return target; } } if ((backend_ctx->devices_param[backend_device_idx].is_opencl == true) || (backend_ctx->devices_param[backend_device_idx].is_hip == true)) { if (backend_ctx->devices_param[backend_device_idx].opencl_device_type & CL_DEVICE_TYPE_GPU) { if ((backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD) || (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)) { if (hwmon_ctx->hm_adl) { if (hwmon_ctx->hm_device[backend_device_idx].od_version == 5) { } else if (hwmon_ctx->hm_device[backend_device_idx].od_version == 6) { } } } if (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_NV) { if (hwmon_ctx->hm_nvml) { int target = 0; if (hm_NVML_nvmlDeviceGetTemperatureThreshold (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].nvml, NVML_TEMPERATURE_THRESHOLD_SHUTDOWN, (unsigned int *) &target) == -1) { hwmon_ctx->hm_device[backend_device_idx].threshold_shutdown_get_supported = false; return -1; } return target; } } } } hwmon_ctx->hm_device[backend_device_idx].threshold_shutdown_get_supported = false; return -1; } int hm_get_temperature_with_devices_idx (hashcat_ctx_t *hashcat_ctx, const int backend_device_idx) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; if (hwmon_ctx->enabled == false) return -1; if (hwmon_ctx->hm_device[backend_device_idx].temperature_get_supported == false) return -1; if (backend_ctx->devices_param[backend_device_idx].is_cuda == true) { if (hwmon_ctx->hm_nvml) { int temperature = 0; if (hm_NVML_nvmlDeviceGetTemperature (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].nvml, NVML_TEMPERATURE_GPU, (u32 *) &temperature) == -1) { hwmon_ctx->hm_device[backend_device_idx].temperature_get_supported = false; return -1; } return temperature; } } if ((backend_ctx->devices_param[backend_device_idx].is_opencl == true) || (backend_ctx->devices_param[backend_device_idx].is_hip == true)) { if (backend_ctx->devices_param[backend_device_idx].opencl_device_type & CL_DEVICE_TYPE_CPU) { #if defined (__APPLE__) if (backend_ctx->devices_param[backend_device_idx].opencl_platform_vendor_id == VENDOR_ID_APPLE) { if (hwmon_ctx->hm_iokit) { double temperature = 0.0; char *key = HM_IOKIT_SMC_CPU_PROXIMITY; if (hm_IOKIT_SMCGetTemperature (hashcat_ctx, key, &temperature) == -1) { hwmon_ctx->hm_device[backend_device_idx].temperature_get_supported = false; return -1; } return (int) temperature; } } #endif if (hwmon_ctx->hm_sysfs_cpu) { int temperature = 0; if (hm_SYSFS_CPU_get_temperature_current (hashcat_ctx, &temperature) == -1) { hwmon_ctx->hm_device[backend_device_idx].temperature_get_supported = false; return -1; } return temperature; } } if (backend_ctx->devices_param[backend_device_idx].opencl_device_type & CL_DEVICE_TYPE_GPU) { #if defined (__APPLE__) if (backend_ctx->devices_param[backend_device_idx].opencl_platform_vendor_id == VENDOR_ID_APPLE) { if (hwmon_ctx->hm_iokit) { double temperature = 0.0; char *key = HM_IOKIT_SMC_GPU_PROXIMITY; if (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_INTEL_BEIGNET) { key = HM_IOKIT_SMC_PECI_GPU; } if (hm_IOKIT_SMCGetTemperature (hashcat_ctx, key, &temperature) == -1) { hwmon_ctx->hm_device[backend_device_idx].temperature_get_supported = false; return -1; } return (int) temperature; } } #endif if ((backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD) || (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)) { if (hwmon_ctx->hm_adl) { if (hwmon_ctx->hm_device[backend_device_idx].od_version == 5) { ADLTemperature Temperature; Temperature.iSize = sizeof (ADLTemperature); if (hm_ADL_Overdrive5_Temperature_Get (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].adl, 0, &Temperature) == -1) { hwmon_ctx->hm_device[backend_device_idx].temperature_get_supported = false; return -1; } return Temperature.iTemperature / 1000; } if (hwmon_ctx->hm_device[backend_device_idx].od_version == 6) { int Temperature = 0; if (hm_ADL_Overdrive6_Temperature_Get (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].adl, &Temperature) == -1) { hwmon_ctx->hm_device[backend_device_idx].temperature_get_supported = false; return -1; } return Temperature / 1000; } if (hwmon_ctx->hm_device[backend_device_idx].od_version == 8) { ADLPMLogDataOutput odlpDataOutput; memset (&odlpDataOutput, 0, sizeof (ADLPMLogDataOutput)); if (hm_ADL2_New_QueryPMLogData_Get (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].adl, &odlpDataOutput) == -1) { hwmon_ctx->hm_device[backend_device_idx].temperature_get_supported = false; return -1; } return odlpDataOutput.sensors[PMLOG_TEMPERATURE_EDGE].value; } } if (hwmon_ctx->hm_sysfs_amdgpu) { int temperature = 0; if (hm_SYSFS_AMDGPU_get_temperature_current (hashcat_ctx, backend_device_idx, &temperature) == -1) { hwmon_ctx->hm_device[backend_device_idx].temperature_get_supported = false; return -1; } return temperature; } } if (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_NV) { if (hwmon_ctx->hm_nvml) { int temperature = 0; if (hm_NVML_nvmlDeviceGetTemperature (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].nvml, NVML_TEMPERATURE_GPU, (u32 *) &temperature) == -1) { hwmon_ctx->hm_device[backend_device_idx].temperature_get_supported = false; return -1; } return temperature; } } } } hwmon_ctx->hm_device[backend_device_idx].temperature_get_supported = false; return -1; } int hm_get_fanpolicy_with_devices_idx (hashcat_ctx_t *hashcat_ctx, const int backend_device_idx) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; if (hwmon_ctx->enabled == false) return -1; if (hwmon_ctx->hm_device[backend_device_idx].fanpolicy_get_supported == false) return -1; if (backend_ctx->devices_param[backend_device_idx].is_cuda == true) { return 1; } if ((backend_ctx->devices_param[backend_device_idx].is_opencl == true) || (backend_ctx->devices_param[backend_device_idx].is_hip == true)) { if (backend_ctx->devices_param[backend_device_idx].opencl_device_type & CL_DEVICE_TYPE_GPU) { if ((backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD) || (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)) { if (hwmon_ctx->hm_adl) { if (hwmon_ctx->hm_device[backend_device_idx].od_version == 5) { ADLFanSpeedValue lpFanSpeedValue; memset (&lpFanSpeedValue, 0, sizeof (lpFanSpeedValue)); lpFanSpeedValue.iSize = sizeof (lpFanSpeedValue); lpFanSpeedValue.iSpeedType = ADL_DL_FANCTRL_SPEED_TYPE_PERCENT; if (hm_ADL_Overdrive5_FanSpeed_Get (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].adl, 0, &lpFanSpeedValue) == -1) { hwmon_ctx->hm_device[backend_device_idx].fanpolicy_get_supported = false; hwmon_ctx->hm_device[backend_device_idx].fanspeed_get_supported = false; return -1; } return (lpFanSpeedValue.iFanSpeed & ADL_DL_FANCTRL_FLAG_USER_DEFINED_SPEED) ? 0 : 1; } if (hwmon_ctx->hm_device[backend_device_idx].od_version == 6) { ADLOD6FanSpeedInfo lpFanSpeedInfo; memset (&lpFanSpeedInfo, 0, sizeof (lpFanSpeedInfo)); if (hm_ADL_Overdrive6_FanSpeed_Get (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].adl, &lpFanSpeedInfo) == -1) { hwmon_ctx->hm_device[backend_device_idx].fanpolicy_get_supported = false; hwmon_ctx->hm_device[backend_device_idx].fanspeed_get_supported = false; return -1; } return 1; } if (hwmon_ctx->hm_device[backend_device_idx].od_version == 8) { ADLPMLogDataOutput odlpDataOutput; memset (&odlpDataOutput, 0, sizeof (ADLPMLogDataOutput)); if (hm_ADL2_New_QueryPMLogData_Get (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].adl, &odlpDataOutput) == -1) { hwmon_ctx->hm_device[backend_device_idx].fanpolicy_get_supported = false; hwmon_ctx->hm_device[backend_device_idx].fanspeed_get_supported = false; return -1; } return odlpDataOutput.sensors[PMLOG_FAN_PERCENTAGE].supported; } } if (hwmon_ctx->hm_sysfs_amdgpu) { return 1; } } if (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_NV) { return 1; } } } hwmon_ctx->hm_device[backend_device_idx].fanpolicy_get_supported = false; hwmon_ctx->hm_device[backend_device_idx].fanspeed_get_supported = false; return -1; } #if defined(__APPLE__) int hm_get_fanspeed_apple (hashcat_ctx_t *hashcat_ctx, char *fan_speed_buf) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; if (hwmon_ctx->enabled == false) return -1; if (hwmon_ctx->hm_iokit) { if (hm_IOKIT_get_fan_speed_current (hashcat_ctx, fan_speed_buf) == 0) { return 1; } } return -1; } #endif int hm_get_fanspeed_with_devices_idx (hashcat_ctx_t *hashcat_ctx, const int backend_device_idx) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; if (hwmon_ctx->enabled == false) return -1; if (hwmon_ctx->hm_device[backend_device_idx].fanspeed_get_supported == false) return -1; if (backend_ctx->devices_param[backend_device_idx].is_cuda == true) { if (hwmon_ctx->hm_nvml) { int speed = 0; if (hm_NVML_nvmlDeviceGetFanSpeed (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].nvml, (u32 *) &speed) == -1) { hwmon_ctx->hm_device[backend_device_idx].fanspeed_get_supported = false; return -1; } return speed; } } if ((backend_ctx->devices_param[backend_device_idx].is_opencl == true) || (backend_ctx->devices_param[backend_device_idx].is_hip == true)) { if (backend_ctx->devices_param[backend_device_idx].opencl_device_type & CL_DEVICE_TYPE_GPU) { if ((backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD) || (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)) { if (hwmon_ctx->hm_adl) { if (hwmon_ctx->hm_device[backend_device_idx].od_version == 5) { ADLFanSpeedValue lpFanSpeedValue; memset (&lpFanSpeedValue, 0, sizeof (lpFanSpeedValue)); lpFanSpeedValue.iSize = sizeof (lpFanSpeedValue); lpFanSpeedValue.iSpeedType = ADL_DL_FANCTRL_SPEED_TYPE_PERCENT; lpFanSpeedValue.iFlags = ADL_DL_FANCTRL_FLAG_USER_DEFINED_SPEED; if (hm_ADL_Overdrive5_FanSpeed_Get (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].adl, 0, &lpFanSpeedValue) == -1) { hwmon_ctx->hm_device[backend_device_idx].fanspeed_get_supported = false; return -1; } return lpFanSpeedValue.iFanSpeed; } if (hwmon_ctx->hm_device[backend_device_idx].od_version == 6) { ADLOD6FanSpeedInfo faninfo; memset (&faninfo, 0, sizeof (faninfo)); if (hm_ADL_Overdrive6_FanSpeed_Get (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].adl, &faninfo) == -1) { hwmon_ctx->hm_device[backend_device_idx].fanspeed_get_supported = false; return -1; } return faninfo.iFanSpeedPercent; } if (hwmon_ctx->hm_device[backend_device_idx].od_version == 8) { ADLPMLogDataOutput odlpDataOutput; memset (&odlpDataOutput, 0, sizeof (ADLPMLogDataOutput)); if (hm_ADL2_New_QueryPMLogData_Get (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].adl, &odlpDataOutput) == -1) { hwmon_ctx->hm_device[backend_device_idx].fanspeed_get_supported = false; return -1; } return odlpDataOutput.sensors[PMLOG_FAN_PERCENTAGE].value; } } if (hwmon_ctx->hm_sysfs_amdgpu) { int speed = 0; if (hm_SYSFS_AMDGPU_get_fan_speed_current (hashcat_ctx, backend_device_idx, &speed) == -1) { hwmon_ctx->hm_device[backend_device_idx].fanspeed_get_supported = false; return -1; } return speed; } } if (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_NV) { if (hwmon_ctx->hm_nvml) { int speed = 0; if (hm_NVML_nvmlDeviceGetFanSpeed (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].nvml, (u32 *) &speed) == -1) { hwmon_ctx->hm_device[backend_device_idx].fanspeed_get_supported = false; return -1; } return speed; } } } } hwmon_ctx->hm_device[backend_device_idx].fanspeed_get_supported = false; return -1; } int hm_get_buslanes_with_devices_idx (hashcat_ctx_t *hashcat_ctx, const int backend_device_idx) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; if (hwmon_ctx->enabled == false) return -1; if (hwmon_ctx->hm_device[backend_device_idx].buslanes_get_supported == false) return -1; if (backend_ctx->devices_param[backend_device_idx].is_cuda == true) { if (hwmon_ctx->hm_nvml) { unsigned int currLinkWidth; if (hm_NVML_nvmlDeviceGetCurrPcieLinkWidth (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].nvml, &currLinkWidth) == -1) { hwmon_ctx->hm_device[backend_device_idx].buslanes_get_supported = false; return -1; } return currLinkWidth; } } if ((backend_ctx->devices_param[backend_device_idx].is_opencl == true) || (backend_ctx->devices_param[backend_device_idx].is_hip == true)) { if (backend_ctx->devices_param[backend_device_idx].opencl_device_type & CL_DEVICE_TYPE_GPU) { if ((backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD) || (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)) { if (hwmon_ctx->hm_adl) { if (hwmon_ctx->hm_device[backend_device_idx].od_version == 5) { ADLPMActivity PMActivity; PMActivity.iSize = sizeof (ADLPMActivity); if (hm_ADL_Overdrive_CurrentActivity_Get (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].adl, &PMActivity) == -1) { hwmon_ctx->hm_device[backend_device_idx].buslanes_get_supported = false; return -1; } return PMActivity.iCurrentBusLanes; } if (hwmon_ctx->hm_device[backend_device_idx].od_version == 8) { ADLPMLogDataOutput odlpDataOutput; memset (&odlpDataOutput, 0, sizeof (ADLPMLogDataOutput)); if (hm_ADL2_New_QueryPMLogData_Get (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].adl, &odlpDataOutput) == -1) { hwmon_ctx->hm_device[backend_device_idx].buslanes_get_supported = false; return -1; } return odlpDataOutput.sensors[PMLOG_BUS_LANES].value; } } if (hwmon_ctx->hm_sysfs_amdgpu) { int lanes; if (hm_SYSFS_AMDGPU_get_pp_dpm_pcie (hashcat_ctx, backend_device_idx, &lanes) == -1) { hwmon_ctx->hm_device[backend_device_idx].buslanes_get_supported = false; return -1; } return lanes; } } if (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_NV) { if (hwmon_ctx->hm_nvml) { unsigned int currLinkWidth; if (hm_NVML_nvmlDeviceGetCurrPcieLinkWidth (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].nvml, &currLinkWidth) == -1) { hwmon_ctx->hm_device[backend_device_idx].buslanes_get_supported = false; return -1; } return currLinkWidth; } } } } hwmon_ctx->hm_device[backend_device_idx].buslanes_get_supported = false; return -1; } int hm_get_utilization_with_devices_idx (hashcat_ctx_t *hashcat_ctx, const int backend_device_idx) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; if (hwmon_ctx->enabled == false) return -1; if (hwmon_ctx->hm_device[backend_device_idx].utilization_get_supported == false) return -1; if (backend_ctx->devices_param[backend_device_idx].is_cuda == true) { if (hwmon_ctx->hm_nvml) { nvmlUtilization_t utilization; if (hm_NVML_nvmlDeviceGetUtilizationRates (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].nvml, &utilization) == -1) { hwmon_ctx->hm_device[backend_device_idx].utilization_get_supported = false; return -1; } return utilization.gpu; } } #if defined(__APPLE__) if (backend_ctx->devices_param[backend_device_idx].is_metal == true || backend_ctx->devices_param[backend_device_idx].is_opencl == true) { if (backend_ctx->devices_param[backend_device_idx].opencl_platform_vendor_id == VENDOR_ID_APPLE) { if (backend_ctx->devices_param[backend_device_idx].opencl_device_type & CL_DEVICE_TYPE_GPU) { if (hwmon_ctx->hm_iokit) { int utilization = 0; if (hm_IOKIT_get_utilization_current (hashcat_ctx, &utilization) == -1) { hwmon_ctx->hm_device[backend_device_idx].utilization_get_supported = false; return -1; } return utilization; } } } } #endif if ((backend_ctx->devices_param[backend_device_idx].is_opencl == true) || (backend_ctx->devices_param[backend_device_idx].is_hip == true)) { if (backend_ctx->devices_param[backend_device_idx].opencl_device_type & CL_DEVICE_TYPE_GPU) { if ((backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD) || (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)) { if (hwmon_ctx->hm_adl) { if (hwmon_ctx->hm_device[backend_device_idx].od_version == 5) { ADLPMActivity PMActivity; PMActivity.iSize = sizeof (ADLPMActivity); if (hm_ADL_Overdrive_CurrentActivity_Get (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].adl, &PMActivity) == -1) { hwmon_ctx->hm_device[backend_device_idx].utilization_get_supported = false; return -1; } return PMActivity.iActivityPercent; } if (hwmon_ctx->hm_device[backend_device_idx].od_version == 8) { ADLPMLogDataOutput odlpDataOutput; memset (&odlpDataOutput, 0, sizeof (ADLPMLogDataOutput)); if (hm_ADL2_New_QueryPMLogData_Get (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].adl, &odlpDataOutput) == -1) { hwmon_ctx->hm_device[backend_device_idx].utilization_get_supported = false; return -1; } return odlpDataOutput.sensors[PMLOG_INFO_ACTIVITY_GFX].value; } } if (hwmon_ctx->hm_sysfs_amdgpu) { int util; if (hm_SYSFS_AMDGPU_get_gpu_busy_percent (hashcat_ctx, backend_device_idx, &util) == -1) { hwmon_ctx->hm_device[backend_device_idx].utilization_get_supported = false; return -1; } return util; } } if (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_NV) { if (hwmon_ctx->hm_nvml) { nvmlUtilization_t utilization; if (hm_NVML_nvmlDeviceGetUtilizationRates (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].nvml, &utilization) == -1) { hwmon_ctx->hm_device[backend_device_idx].utilization_get_supported = false; return -1; } return utilization.gpu; } } } if (backend_ctx->devices_param[backend_device_idx].opencl_device_type & CL_DEVICE_TYPE_CPU) { if (hwmon_ctx->hm_sysfs_cpu) { int utilization = 0; if (hm_SYSFS_CPU_get_utilization_current (hashcat_ctx, &utilization) == -1) { hwmon_ctx->hm_device[backend_device_idx].utilization_get_supported = false; return -1; } return utilization; } } } hwmon_ctx->hm_device[backend_device_idx].utilization_get_supported = false; return -1; } int hm_get_memoryspeed_with_devices_idx (hashcat_ctx_t *hashcat_ctx, const int backend_device_idx) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; if (hwmon_ctx->enabled == false) return -1; if (hwmon_ctx->hm_device[backend_device_idx].memoryspeed_get_supported == false) return -1; if (backend_ctx->devices_param[backend_device_idx].is_cuda == true) { if (hwmon_ctx->hm_nvml) { unsigned int clockfreq; if (hm_NVML_nvmlDeviceGetClockInfo (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].nvml, NVML_CLOCK_MEM, &clockfreq) == -1) { hwmon_ctx->hm_device[backend_device_idx].memoryspeed_get_supported = false; return -1; } return clockfreq; } } if ((backend_ctx->devices_param[backend_device_idx].is_opencl == true) || (backend_ctx->devices_param[backend_device_idx].is_hip == true)) { if (backend_ctx->devices_param[backend_device_idx].opencl_device_type & CL_DEVICE_TYPE_GPU) { if ((backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD) || (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)) { if (hwmon_ctx->hm_adl) { if (hwmon_ctx->hm_device[backend_device_idx].od_version == 5) { ADLPMActivity PMActivity; PMActivity.iSize = sizeof (ADLPMActivity); if (hm_ADL_Overdrive_CurrentActivity_Get (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].adl, &PMActivity) == -1) { hwmon_ctx->hm_device[backend_device_idx].memoryspeed_get_supported = false; return -1; } return PMActivity.iMemoryClock / 100; } if (hwmon_ctx->hm_device[backend_device_idx].od_version == 8) { ADLPMLogDataOutput odlpDataOutput; memset (&odlpDataOutput, 0, sizeof (ADLPMLogDataOutput)); if (hm_ADL2_New_QueryPMLogData_Get (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].adl, &odlpDataOutput) == -1) { hwmon_ctx->hm_device[backend_device_idx].memoryspeed_get_supported = false; return -1; } return odlpDataOutput.sensors[PMLOG_CLK_MEMCLK].value; } } if (hwmon_ctx->hm_sysfs_amdgpu) { int clockfreq; if (hm_SYSFS_AMDGPU_get_pp_dpm_mclk (hashcat_ctx, backend_device_idx, &clockfreq) == -1) { hwmon_ctx->hm_device[backend_device_idx].memoryspeed_get_supported = false; return -1; } return clockfreq; } } if (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_NV) { if (hwmon_ctx->hm_nvml) { unsigned int clockfreq; if (hm_NVML_nvmlDeviceGetClockInfo (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].nvml, NVML_CLOCK_MEM, &clockfreq) == -1) { hwmon_ctx->hm_device[backend_device_idx].memoryspeed_get_supported = false; return -1; } return clockfreq; } } } } hwmon_ctx->hm_device[backend_device_idx].memoryspeed_get_supported = false; return -1; } int hm_get_corespeed_with_devices_idx (hashcat_ctx_t *hashcat_ctx, const int backend_device_idx) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; if (hwmon_ctx->enabled == false) return -1; if (hwmon_ctx->hm_device[backend_device_idx].corespeed_get_supported == false) return -1; if (backend_ctx->devices_param[backend_device_idx].is_cuda == true) { if (hwmon_ctx->hm_nvml) { unsigned int clockfreq; if (hm_NVML_nvmlDeviceGetClockInfo (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].nvml, NVML_CLOCK_SM, &clockfreq) == -1) { hwmon_ctx->hm_device[backend_device_idx].corespeed_get_supported = false; return -1; } return clockfreq; } } if ((backend_ctx->devices_param[backend_device_idx].is_opencl == true) || (backend_ctx->devices_param[backend_device_idx].is_hip == true)) { if (backend_ctx->devices_param[backend_device_idx].opencl_device_type & CL_DEVICE_TYPE_GPU) { if ((backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD) || (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)) { if (hwmon_ctx->hm_adl) { if (hwmon_ctx->hm_device[backend_device_idx].od_version == 5) { ADLPMActivity PMActivity; PMActivity.iSize = sizeof (ADLPMActivity); if (hm_ADL_Overdrive_CurrentActivity_Get (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].adl, &PMActivity) == -1) { hwmon_ctx->hm_device[backend_device_idx].corespeed_get_supported = false; return -1; } return PMActivity.iEngineClock / 100; } if (hwmon_ctx->hm_device[backend_device_idx].od_version == 8) { ADLPMLogDataOutput odlpDataOutput; memset (&odlpDataOutput, 0, sizeof (ADLPMLogDataOutput)); if (hm_ADL2_New_QueryPMLogData_Get (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].adl, &odlpDataOutput) == -1) { hwmon_ctx->hm_device[backend_device_idx].corespeed_get_supported = false; return -1; } return odlpDataOutput.sensors[PMLOG_CLK_GFXCLK].value; } } if (hwmon_ctx->hm_sysfs_amdgpu) { int clockfreq; if (hm_SYSFS_AMDGPU_get_pp_dpm_sclk (hashcat_ctx, backend_device_idx, &clockfreq) == -1) { hwmon_ctx->hm_device[backend_device_idx].corespeed_get_supported = false; return -1; } return clockfreq; } } if (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_NV) { if (hwmon_ctx->hm_nvml) { unsigned int clockfreq; if (hm_NVML_nvmlDeviceGetClockInfo (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].nvml, NVML_CLOCK_SM, &clockfreq) == -1) { hwmon_ctx->hm_device[backend_device_idx].corespeed_get_supported = false; return -1; } return clockfreq; } } } } hwmon_ctx->hm_device[backend_device_idx].corespeed_get_supported = false; return -1; } int hm_get_throttle_with_devices_idx (hashcat_ctx_t *hashcat_ctx, const int backend_device_idx) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; if (hwmon_ctx->enabled == false) return -1; if (hwmon_ctx->hm_device[backend_device_idx].throttle_get_supported == false) return -1; if (backend_ctx->devices_param[backend_device_idx].is_cuda == true) { if (hwmon_ctx->hm_nvml) { /* this is triggered by mask generator, too. therefore useless unsigned long long clocksThrottleReasons = 0; unsigned long long supportedThrottleReasons = 0; if (hm_NVML_nvmlDeviceGetCurrentClocksThrottleReasons (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].nvml, &clocksThrottleReasons) == -1) return -1; if (hm_NVML_nvmlDeviceGetSupportedClocksThrottleReasons (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].nvml, &supportedThrottleReasons) == -1) return -1; clocksThrottleReasons &= supportedThrottleReasons; clocksThrottleReasons &= ~nvmlClocksThrottleReasonGpuIdle; clocksThrottleReasons &= ~nvmlClocksThrottleReasonApplicationsClocksSetting; clocksThrottleReasons &= ~nvmlClocksThrottleReasonUnknown; if (backend_ctx->kernel_power_final) { clocksThrottleReasons &= ~nvmlClocksThrottleReasonHwSlowdown; } return (clocksThrottleReasons != nvmlClocksThrottleReasonNone); */ } if (hwmon_ctx->hm_nvapi) { NV_GPU_PERF_POLICIES_INFO_PARAMS_V1 perfPolicies_info; NV_GPU_PERF_POLICIES_STATUS_PARAMS_V1 perfPolicies_status; memset (&perfPolicies_info, 0, sizeof (NV_GPU_PERF_POLICIES_INFO_PARAMS_V1)); memset (&perfPolicies_status, 0, sizeof (NV_GPU_PERF_POLICIES_STATUS_PARAMS_V1)); perfPolicies_info.version = MAKE_NVAPI_VERSION (NV_GPU_PERF_POLICIES_INFO_PARAMS_V1, 1); perfPolicies_status.version = MAKE_NVAPI_VERSION (NV_GPU_PERF_POLICIES_STATUS_PARAMS_V1, 1); hm_NvAPI_GPU_GetPerfPoliciesInfo (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].nvapi, &perfPolicies_info); perfPolicies_status.info_value = perfPolicies_info.info_value; hm_NvAPI_GPU_GetPerfPoliciesStatus (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].nvapi, &perfPolicies_status); return perfPolicies_status.throttle & 2; } } if ((backend_ctx->devices_param[backend_device_idx].is_opencl == true) || (backend_ctx->devices_param[backend_device_idx].is_hip == true)) { if (backend_ctx->devices_param[backend_device_idx].opencl_device_type & CL_DEVICE_TYPE_GPU) { if ((backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD) || (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)) { } if (backend_ctx->devices_param[backend_device_idx].opencl_device_vendor_id == VENDOR_ID_NV) { if (hwmon_ctx->hm_nvml) { /* this is triggered by mask generator, too. therefore useless unsigned long long clocksThrottleReasons = 0; unsigned long long supportedThrottleReasons = 0; if (hm_NVML_nvmlDeviceGetCurrentClocksThrottleReasons (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].nvml, &clocksThrottleReasons) == -1) return -1; if (hm_NVML_nvmlDeviceGetSupportedClocksThrottleReasons (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].nvml, &supportedThrottleReasons) == -1) return -1; clocksThrottleReasons &= supportedThrottleReasons; clocksThrottleReasons &= ~nvmlClocksThrottleReasonGpuIdle; clocksThrottleReasons &= ~nvmlClocksThrottleReasonApplicationsClocksSetting; clocksThrottleReasons &= ~nvmlClocksThrottleReasonUnknown; if (backend_ctx->kernel_power_final) { clocksThrottleReasons &= ~nvmlClocksThrottleReasonHwSlowdown; } return (clocksThrottleReasons != nvmlClocksThrottleReasonNone); */ } if (hwmon_ctx->hm_nvapi) { NV_GPU_PERF_POLICIES_INFO_PARAMS_V1 perfPolicies_info; NV_GPU_PERF_POLICIES_STATUS_PARAMS_V1 perfPolicies_status; memset (&perfPolicies_info, 0, sizeof (NV_GPU_PERF_POLICIES_INFO_PARAMS_V1)); memset (&perfPolicies_status, 0, sizeof (NV_GPU_PERF_POLICIES_STATUS_PARAMS_V1)); perfPolicies_info.version = MAKE_NVAPI_VERSION (NV_GPU_PERF_POLICIES_INFO_PARAMS_V1, 1); perfPolicies_status.version = MAKE_NVAPI_VERSION (NV_GPU_PERF_POLICIES_STATUS_PARAMS_V1, 1); hm_NvAPI_GPU_GetPerfPoliciesInfo (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].nvapi, &perfPolicies_info); perfPolicies_status.info_value = perfPolicies_info.info_value; hm_NvAPI_GPU_GetPerfPoliciesStatus (hashcat_ctx, hwmon_ctx->hm_device[backend_device_idx].nvapi, &perfPolicies_status); return perfPolicies_status.throttle & 2; } } } } hwmon_ctx->hm_device[backend_device_idx].throttle_get_supported = false; return -1; } int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx; user_options_t *user_options = hashcat_ctx->user_options; hwmon_ctx->enabled = false; #if !defined (WITH_HWMON) return 0; #endif // WITH_HWMON if (user_options->hash_info == true) return 0; if (user_options->keyspace == true) return 0; if (user_options->left == true) return 0; if (user_options->show == true) return 0; if (user_options->stdout_flag == true) return 0; if (user_options->usage == true) return 0; if (user_options->version == true) return 0; if (user_options->identify == true) return 0; if (user_options->hwmon_disable == true) return 0; if (user_options->backend_info > 0) return 0; hwmon_ctx->hm_device = (hm_attrs_t *) hccalloc (DEVICES_MAX, sizeof (hm_attrs_t)); /** * Initialize shared libraries */ hm_attrs_t *hm_adapters_adl = (hm_attrs_t *) hccalloc (DEVICES_MAX, sizeof (hm_attrs_t)); hm_attrs_t *hm_adapters_nvapi = (hm_attrs_t *) hccalloc (DEVICES_MAX, sizeof (hm_attrs_t)); hm_attrs_t *hm_adapters_nvml = (hm_attrs_t *) hccalloc (DEVICES_MAX, sizeof (hm_attrs_t)); hm_attrs_t *hm_adapters_sysfs_amdgpu = (hm_attrs_t *) hccalloc (DEVICES_MAX, sizeof (hm_attrs_t)); hm_attrs_t *hm_adapters_sysfs_cpu = (hm_attrs_t *) hccalloc (DEVICES_MAX, sizeof (hm_attrs_t)); hm_attrs_t *hm_adapters_iokit = (hm_attrs_t *) hccalloc (DEVICES_MAX, sizeof (hm_attrs_t)); #define FREE_ADAPTERS \ do { \ hcfree (hm_adapters_adl); \ hcfree (hm_adapters_nvapi); \ hcfree (hm_adapters_nvml); \ hcfree (hm_adapters_sysfs_amdgpu); \ hcfree (hm_adapters_sysfs_cpu); \ hcfree (hm_adapters_iokit); \ } while (0) if (backend_ctx->need_nvml == true) { hwmon_ctx->hm_nvml = (NVML_PTR *) hcmalloc (sizeof (NVML_PTR)); if (nvml_init (hashcat_ctx) == -1) { hcfree (hwmon_ctx->hm_nvml); hwmon_ctx->hm_nvml = NULL; } } if ((backend_ctx->need_nvapi == true) && (hwmon_ctx->hm_nvml)) // nvapi can't work alone, we need nvml, too { hwmon_ctx->hm_nvapi = (NVAPI_PTR *) hcmalloc (sizeof (NVAPI_PTR)); if (nvapi_init (hashcat_ctx) == -1) { hcfree (hwmon_ctx->hm_nvapi); hwmon_ctx->hm_nvapi = NULL; } } if (backend_ctx->need_adl == true) { hwmon_ctx->hm_adl = (ADL_PTR *) hcmalloc (sizeof (ADL_PTR)); if (adl_init (hashcat_ctx) == -1) { hcfree (hwmon_ctx->hm_adl); hwmon_ctx->hm_adl = NULL; } } if (backend_ctx->need_sysfs_amdgpu == true) { hwmon_ctx->hm_sysfs_amdgpu = (SYSFS_AMDGPU_PTR *) hcmalloc (sizeof (SYSFS_AMDGPU_PTR)); if (sysfs_amdgpu_init (hashcat_ctx) == false) { hcfree (hwmon_ctx->hm_sysfs_amdgpu); hwmon_ctx->hm_sysfs_amdgpu = NULL; } // also if there's ADL, we don't need sysfs_amdgpu if (hwmon_ctx->hm_adl) { hcfree (hwmon_ctx->hm_sysfs_amdgpu); hwmon_ctx->hm_sysfs_amdgpu = NULL; } } if (backend_ctx->need_sysfs_cpu == true) { hwmon_ctx->hm_sysfs_cpu = (SYSFS_CPU_PTR *) hcmalloc (sizeof (SYSFS_CPU_PTR)); if (sysfs_cpu_init (hashcat_ctx) == false) { hcfree (hwmon_ctx->hm_sysfs_cpu); hwmon_ctx->hm_sysfs_cpu = NULL; } } #if defined(__APPLE__) if (backend_ctx->need_iokit == true) { hwmon_ctx->hm_iokit = (IOKIT_PTR *) hcmalloc (sizeof (IOKIT_PTR)); if (iokit_init (hashcat_ctx) == false) { hcfree (hwmon_ctx->hm_iokit); hwmon_ctx->hm_iokit = NULL; } } #endif if (hwmon_ctx->hm_nvml) { if (hm_NVML_nvmlInit (hashcat_ctx) == 0) { HM_ADAPTER_NVML *nvmlGPUHandle = (HM_ADAPTER_NVML *) hccalloc (DEVICES_MAX, sizeof (HM_ADAPTER_NVML)); int tmp_in = hm_get_adapter_index_nvml (hashcat_ctx, nvmlGPUHandle); for (int backend_devices_idx = 0; backend_devices_idx < backend_ctx->backend_devices_cnt; backend_devices_idx++) { hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_idx]; if (device_param->skipped == true) continue; if (device_param->is_cuda == true) { for (int i = 0; i < tmp_in; i++) { nvmlPciInfo_t pci; if (hm_NVML_nvmlDeviceGetPciInfo (hashcat_ctx, nvmlGPUHandle[i], &pci) == -1) continue; if ((device_param->pcie_bus == pci.bus) && (device_param->pcie_device == (pci.device >> 3)) && (device_param->pcie_function == (pci.device & 7))) { const u32 device_id = device_param->device_id; hm_adapters_nvml[device_id].nvml = nvmlGPUHandle[i]; hm_adapters_nvml[device_id].buslanes_get_supported = true; hm_adapters_nvml[device_id].corespeed_get_supported = true; hm_adapters_nvml[device_id].fanspeed_get_supported = true; hm_adapters_nvml[device_id].memoryspeed_get_supported = true; hm_adapters_nvml[device_id].temperature_get_supported = true; hm_adapters_nvml[device_id].threshold_shutdown_get_supported = true; hm_adapters_nvml[device_id].threshold_slowdown_get_supported = true; hm_adapters_nvml[device_id].utilization_get_supported = true; } } } if (device_param->is_opencl == true) { if ((device_param->opencl_device_type & CL_DEVICE_TYPE_GPU) == 0) continue; if (device_param->opencl_device_vendor_id != VENDOR_ID_NV) continue; for (int i = 0; i < tmp_in; i++) { nvmlPciInfo_t pci; if (hm_NVML_nvmlDeviceGetPciInfo (hashcat_ctx, nvmlGPUHandle[i], &pci) == -1) continue; if ((device_param->pcie_bus == pci.bus) && (device_param->pcie_device == (pci.device >> 3)) && (device_param->pcie_function == (pci.device & 7))) { const u32 device_id = device_param->device_id; hm_adapters_nvml[device_id].nvml = nvmlGPUHandle[i]; hm_adapters_nvml[device_id].buslanes_get_supported = true; hm_adapters_nvml[device_id].corespeed_get_supported = true; hm_adapters_nvml[device_id].fanspeed_get_supported = true; hm_adapters_nvml[device_id].memoryspeed_get_supported = true; hm_adapters_nvml[device_id].temperature_get_supported = true; hm_adapters_nvml[device_id].threshold_shutdown_get_supported = true; hm_adapters_nvml[device_id].threshold_slowdown_get_supported = true; hm_adapters_nvml[device_id].utilization_get_supported = true; } } } } hcfree (nvmlGPUHandle); } } if (hwmon_ctx->hm_nvapi) { if (hm_NvAPI_Initialize (hashcat_ctx) == 0) { HM_ADAPTER_NVAPI *nvGPUHandle = (HM_ADAPTER_NVAPI *) hccalloc (NVAPI_MAX_PHYSICAL_GPUS, sizeof (HM_ADAPTER_NVAPI)); int tmp_in = hm_get_adapter_index_nvapi (hashcat_ctx, nvGPUHandle); for (int backend_devices_idx = 0; backend_devices_idx < backend_ctx->backend_devices_cnt; backend_devices_idx++) { hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_idx]; if (device_param->skipped == true) continue; if (device_param->is_cuda == true) { for (int i = 0; i < tmp_in; i++) { NvU32 BusId = 0; NvU32 BusSlotId = 0; if (hm_NvAPI_GPU_GetBusId (hashcat_ctx, nvGPUHandle[i], &BusId) == -1) continue; if (hm_NvAPI_GPU_GetBusSlotId (hashcat_ctx, nvGPUHandle[i], &BusSlotId) == -1) continue; if ((device_param->pcie_bus == BusId) && (device_param->pcie_device == (BusSlotId >> 3)) && (device_param->pcie_function == (BusSlotId & 7))) { const u32 device_id = device_param->device_id; hm_adapters_nvapi[device_id].nvapi = nvGPUHandle[i]; hm_adapters_nvapi[device_id].fanpolicy_get_supported = true; hm_adapters_nvapi[device_id].throttle_get_supported = true; } } } if (device_param->is_opencl == true) { if ((device_param->opencl_device_type & CL_DEVICE_TYPE_GPU) == 0) continue; if (device_param->opencl_device_vendor_id != VENDOR_ID_NV) continue; for (int i = 0; i < tmp_in; i++) { NvU32 BusId = 0; NvU32 BusSlotId = 0; if (hm_NvAPI_GPU_GetBusId (hashcat_ctx, nvGPUHandle[i], &BusId) == -1) continue; if (hm_NvAPI_GPU_GetBusSlotId (hashcat_ctx, nvGPUHandle[i], &BusSlotId) == -1) continue; if ((device_param->pcie_bus == BusId) && (device_param->pcie_device == (BusSlotId >> 3)) && (device_param->pcie_function == (BusSlotId & 7))) { const u32 device_id = device_param->device_id; hm_adapters_nvapi[device_id].nvapi = nvGPUHandle[i]; hm_adapters_nvapi[device_id].fanpolicy_get_supported = true; hm_adapters_nvapi[device_id].throttle_get_supported = true; } } } } hcfree (nvGPUHandle); } } if (hwmon_ctx->hm_adl) { if (hm_ADL_Main_Control_Create (hashcat_ctx, ADL_Main_Memory_Alloc, 0) == 0) { // total number of adapters int tmp_in; if (get_adapters_num_adl (hashcat_ctx, &tmp_in) == -1) { FREE_ADAPTERS; return -1; } // adapter info LPAdapterInfo lpAdapterInfo = (LPAdapterInfo) hccalloc (tmp_in, sizeof (AdapterInfo)); if (hm_ADL_Adapter_AdapterInfo_Get (hashcat_ctx, lpAdapterInfo, tmp_in * sizeof (AdapterInfo)) == -1) { FREE_ADAPTERS; return -1; } for (int backend_devices_idx = 0; backend_devices_idx < backend_ctx->backend_devices_cnt; backend_devices_idx++) { hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_idx]; if (device_param->skipped == true) continue; if (device_param->is_cuda == true) { // nothing to do } if ((device_param->is_opencl == true) || (device_param->is_hip == true)) { if ((device_param->opencl_device_type & CL_DEVICE_TYPE_GPU) == 0) continue; if ((device_param->opencl_device_vendor_id != VENDOR_ID_AMD) && (device_param->opencl_device_vendor_id != VENDOR_ID_AMD_USE_HIP)) continue; for (int i = 0; i < tmp_in; i++) { if ((device_param->pcie_bus == lpAdapterInfo[i].iBusNumber) && (device_param->pcie_device == (lpAdapterInfo[i].iDeviceNumber >> 3)) && (device_param->pcie_function == (lpAdapterInfo[i].iDeviceNumber & 7))) { const u32 device_id = device_param->device_id; int od_supported = 0; int od_enabled = 0; int od_version = 0; hm_ADL2_Overdrive_Caps (hashcat_ctx, lpAdapterInfo[i].iAdapterIndex, &od_supported, &od_enabled, &od_version); if (od_version < 8) od_version = 5; hm_adapters_adl[device_id].od_version = od_version; hm_adapters_adl[device_id].adl = lpAdapterInfo[i].iAdapterIndex; hm_adapters_adl[device_id].buslanes_get_supported = true; hm_adapters_adl[device_id].corespeed_get_supported = true; hm_adapters_adl[device_id].fanspeed_get_supported = true; hm_adapters_adl[device_id].fanpolicy_get_supported = true; hm_adapters_adl[device_id].memoryspeed_get_supported = true; hm_adapters_adl[device_id].temperature_get_supported = true; hm_adapters_adl[device_id].threshold_slowdown_get_supported = true; hm_adapters_adl[device_id].utilization_get_supported = true; } } } } hcfree (lpAdapterInfo); } } if (hwmon_ctx->hm_sysfs_amdgpu || hwmon_ctx->hm_iokit) { if (true) { for (int backend_devices_idx = 0; backend_devices_idx < backend_ctx->backend_devices_cnt; backend_devices_idx++) { hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_idx]; if (device_param->skipped == true) continue; if (device_param->is_cuda == true) { // nothing to do } #if defined (__APPLE__) if (device_param->is_metal == true) { const u32 device_id = device_param->device_id; if ((device_param->opencl_platform_vendor_id == VENDOR_ID_APPLE) && (hwmon_ctx->hm_iokit)) { hm_adapters_iokit[device_id].buslanes_get_supported = false; hm_adapters_iokit[device_id].corespeed_get_supported = false; hm_adapters_iokit[device_id].fanspeed_get_supported = true; hm_adapters_iokit[device_id].fanpolicy_get_supported = false; hm_adapters_iokit[device_id].memoryspeed_get_supported = false; hm_adapters_iokit[device_id].temperature_get_supported = true; hm_adapters_iokit[device_id].utilization_get_supported = true; } } #endif if ((device_param->is_opencl == true) || (device_param->is_hip == true)) { const u32 device_id = device_param->device_id; if ((device_param->opencl_platform_vendor_id == VENDOR_ID_APPLE) && (hwmon_ctx->hm_iokit)) { hm_adapters_iokit[device_id].buslanes_get_supported = false; hm_adapters_iokit[device_id].corespeed_get_supported = false; hm_adapters_iokit[device_id].fanspeed_get_supported = true; hm_adapters_iokit[device_id].fanpolicy_get_supported = false; hm_adapters_iokit[device_id].memoryspeed_get_supported = false; hm_adapters_iokit[device_id].temperature_get_supported = true; hm_adapters_iokit[device_id].utilization_get_supported = true; } if ((device_param->opencl_device_type & CL_DEVICE_TYPE_GPU) == 0) continue; if (hwmon_ctx->hm_sysfs_amdgpu) { hm_adapters_sysfs_amdgpu[device_id].buslanes_get_supported = true; hm_adapters_sysfs_amdgpu[device_id].corespeed_get_supported = true; hm_adapters_sysfs_amdgpu[device_id].fanspeed_get_supported = true; hm_adapters_sysfs_amdgpu[device_id].fanpolicy_get_supported = true; hm_adapters_sysfs_amdgpu[device_id].memoryspeed_get_supported = true; hm_adapters_sysfs_amdgpu[device_id].temperature_get_supported = true; hm_adapters_sysfs_amdgpu[device_id].utilization_get_supported = true; } } } } } if (hwmon_ctx->hm_sysfs_cpu) { if (true) { for (int backend_devices_idx = 0; backend_devices_idx < backend_ctx->backend_devices_cnt; backend_devices_idx++) { hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_idx]; if (device_param->skipped == true) continue; if (device_param->is_cuda == true) { // nothing to do } if ((device_param->is_opencl == true) || (device_param->is_hip == true)) { const u32 device_id = device_param->device_id; if ((device_param->opencl_device_type & CL_DEVICE_TYPE_CPU) == 0) continue; if (hwmon_ctx->hm_sysfs_cpu) { hm_adapters_sysfs_cpu[device_id].buslanes_get_supported = false; hm_adapters_sysfs_cpu[device_id].corespeed_get_supported = false; hm_adapters_sysfs_cpu[device_id].fanspeed_get_supported = false; hm_adapters_sysfs_cpu[device_id].fanpolicy_get_supported = false; hm_adapters_sysfs_cpu[device_id].memoryspeed_get_supported = false; hm_adapters_sysfs_cpu[device_id].temperature_get_supported = true; hm_adapters_sysfs_cpu[device_id].utilization_get_supported = true; } } } } } #if defined(__APPLE__) if (backend_ctx->need_iokit == true) { hwmon_ctx->hm_iokit = (IOKIT_PTR *) hcmalloc (sizeof (IOKIT_PTR)); if (iokit_init (hashcat_ctx) == false) { hcfree (hwmon_ctx->hm_iokit); hwmon_ctx->hm_iokit = NULL; } } #endif if (hwmon_ctx->hm_adl == NULL && hwmon_ctx->hm_nvml == NULL && hwmon_ctx->hm_sysfs_amdgpu == NULL && hwmon_ctx->hm_sysfs_cpu == NULL && hwmon_ctx->hm_iokit == NULL) { FREE_ADAPTERS; return 0; } /** * looks like we have some manageable device */ hwmon_ctx->enabled = true; /** * HM devices: copy */ for (int backend_devices_idx = 0; backend_devices_idx < backend_ctx->backend_devices_cnt; backend_devices_idx++) { hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_idx]; if (device_param->skipped == true) continue; const u32 device_id = device_param->device_id; hwmon_ctx->hm_device[backend_devices_idx].adl = 0; hwmon_ctx->hm_device[backend_devices_idx].sysfs_amdgpu = 0; hwmon_ctx->hm_device[backend_devices_idx].sysfs_cpu = 0; hwmon_ctx->hm_device[backend_devices_idx].iokit = 0; hwmon_ctx->hm_device[backend_devices_idx].nvapi = 0; hwmon_ctx->hm_device[backend_devices_idx].nvml = 0; hwmon_ctx->hm_device[backend_devices_idx].od_version = 0; if (device_param->is_cuda == true) { hwmon_ctx->hm_device[backend_devices_idx].nvapi = hm_adapters_nvapi[device_id].nvapi; hwmon_ctx->hm_device[backend_devices_idx].nvml = hm_adapters_nvml[device_id].nvml; if (hwmon_ctx->hm_nvml) { hwmon_ctx->hm_device[backend_devices_idx].buslanes_get_supported |= hm_adapters_nvml[device_id].buslanes_get_supported; hwmon_ctx->hm_device[backend_devices_idx].corespeed_get_supported |= hm_adapters_nvml[device_id].corespeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].fanspeed_get_supported |= hm_adapters_nvml[device_id].fanspeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].fanpolicy_get_supported |= hm_adapters_nvml[device_id].fanpolicy_get_supported; hwmon_ctx->hm_device[backend_devices_idx].memoryspeed_get_supported |= hm_adapters_nvml[device_id].memoryspeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].temperature_get_supported |= hm_adapters_nvml[device_id].temperature_get_supported; hwmon_ctx->hm_device[backend_devices_idx].threshold_shutdown_get_supported |= hm_adapters_nvml[device_id].threshold_shutdown_get_supported; hwmon_ctx->hm_device[backend_devices_idx].threshold_slowdown_get_supported |= hm_adapters_nvml[device_id].threshold_slowdown_get_supported; hwmon_ctx->hm_device[backend_devices_idx].throttle_get_supported |= hm_adapters_nvml[device_id].throttle_get_supported; hwmon_ctx->hm_device[backend_devices_idx].utilization_get_supported |= hm_adapters_nvml[device_id].utilization_get_supported; } if (hwmon_ctx->hm_nvapi) { hwmon_ctx->hm_device[backend_devices_idx].buslanes_get_supported |= hm_adapters_nvapi[device_id].buslanes_get_supported; hwmon_ctx->hm_device[backend_devices_idx].corespeed_get_supported |= hm_adapters_nvapi[device_id].corespeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].fanspeed_get_supported |= hm_adapters_nvapi[device_id].fanspeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].fanpolicy_get_supported |= hm_adapters_nvapi[device_id].fanpolicy_get_supported; hwmon_ctx->hm_device[backend_devices_idx].memoryspeed_get_supported |= hm_adapters_nvapi[device_id].memoryspeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].temperature_get_supported |= hm_adapters_nvapi[device_id].temperature_get_supported; hwmon_ctx->hm_device[backend_devices_idx].threshold_shutdown_get_supported |= hm_adapters_nvapi[device_id].threshold_shutdown_get_supported; hwmon_ctx->hm_device[backend_devices_idx].threshold_slowdown_get_supported |= hm_adapters_nvapi[device_id].threshold_slowdown_get_supported; hwmon_ctx->hm_device[backend_devices_idx].throttle_get_supported |= hm_adapters_nvapi[device_id].throttle_get_supported; hwmon_ctx->hm_device[backend_devices_idx].utilization_get_supported |= hm_adapters_nvapi[device_id].utilization_get_supported; } } if (device_param->is_metal == true) { if (hwmon_ctx->hm_iokit) { hwmon_ctx->hm_device[backend_devices_idx].iokit = hm_adapters_iokit[device_id].iokit; hwmon_ctx->hm_device[backend_devices_idx].buslanes_get_supported |= hm_adapters_iokit[device_id].buslanes_get_supported; hwmon_ctx->hm_device[backend_devices_idx].corespeed_get_supported |= hm_adapters_iokit[device_id].corespeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].fanspeed_get_supported |= hm_adapters_iokit[device_id].fanspeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].fanpolicy_get_supported |= hm_adapters_iokit[device_id].fanpolicy_get_supported; hwmon_ctx->hm_device[backend_devices_idx].memoryspeed_get_supported |= hm_adapters_iokit[device_id].memoryspeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].temperature_get_supported |= hm_adapters_iokit[device_id].temperature_get_supported; hwmon_ctx->hm_device[backend_devices_idx].threshold_shutdown_get_supported |= hm_adapters_iokit[device_id].threshold_shutdown_get_supported; hwmon_ctx->hm_device[backend_devices_idx].threshold_slowdown_get_supported |= hm_adapters_iokit[device_id].threshold_slowdown_get_supported; hwmon_ctx->hm_device[backend_devices_idx].throttle_get_supported |= hm_adapters_iokit[device_id].throttle_get_supported; hwmon_ctx->hm_device[backend_devices_idx].utilization_get_supported |= hm_adapters_iokit[device_id].utilization_get_supported; } } if ((device_param->is_opencl == true) || (device_param->is_hip == true)) { if (device_param->opencl_device_type & CL_DEVICE_TYPE_CPU) { #if defined(__APPLE__) if (device_param->opencl_platform_vendor_id == VENDOR_ID_APPLE) { if (hwmon_ctx->hm_iokit) { hwmon_ctx->hm_device[backend_devices_idx].iokit = hm_adapters_iokit[device_id].iokit; hwmon_ctx->hm_device[backend_devices_idx].buslanes_get_supported |= hm_adapters_iokit[device_id].buslanes_get_supported; hwmon_ctx->hm_device[backend_devices_idx].corespeed_get_supported |= hm_adapters_iokit[device_id].corespeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].fanspeed_get_supported |= hm_adapters_iokit[device_id].fanspeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].fanpolicy_get_supported |= hm_adapters_iokit[device_id].fanpolicy_get_supported; hwmon_ctx->hm_device[backend_devices_idx].memoryspeed_get_supported |= hm_adapters_iokit[device_id].memoryspeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].temperature_get_supported |= hm_adapters_iokit[device_id].temperature_get_supported; hwmon_ctx->hm_device[backend_devices_idx].threshold_shutdown_get_supported |= hm_adapters_iokit[device_id].threshold_shutdown_get_supported; hwmon_ctx->hm_device[backend_devices_idx].threshold_slowdown_get_supported |= hm_adapters_iokit[device_id].threshold_slowdown_get_supported; hwmon_ctx->hm_device[backend_devices_idx].throttle_get_supported |= hm_adapters_iokit[device_id].throttle_get_supported; hwmon_ctx->hm_device[backend_devices_idx].utilization_get_supported |= hm_adapters_iokit[device_id].utilization_get_supported; } } #endif if (hwmon_ctx->hm_sysfs_cpu) { hwmon_ctx->hm_device[backend_devices_idx].buslanes_get_supported |= hm_adapters_sysfs_cpu[device_id].buslanes_get_supported; hwmon_ctx->hm_device[backend_devices_idx].corespeed_get_supported |= hm_adapters_sysfs_cpu[device_id].corespeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].fanspeed_get_supported |= hm_adapters_sysfs_cpu[device_id].fanspeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].fanpolicy_get_supported |= hm_adapters_sysfs_cpu[device_id].fanpolicy_get_supported; hwmon_ctx->hm_device[backend_devices_idx].memoryspeed_get_supported |= hm_adapters_sysfs_cpu[device_id].memoryspeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].temperature_get_supported |= hm_adapters_sysfs_cpu[device_id].temperature_get_supported; hwmon_ctx->hm_device[backend_devices_idx].threshold_shutdown_get_supported |= hm_adapters_sysfs_cpu[device_id].threshold_shutdown_get_supported; hwmon_ctx->hm_device[backend_devices_idx].threshold_slowdown_get_supported |= hm_adapters_sysfs_cpu[device_id].threshold_slowdown_get_supported; hwmon_ctx->hm_device[backend_devices_idx].throttle_get_supported |= hm_adapters_sysfs_cpu[device_id].throttle_get_supported; hwmon_ctx->hm_device[backend_devices_idx].utilization_get_supported |= hm_adapters_sysfs_cpu[device_id].utilization_get_supported; } } if (device_param->opencl_device_type & CL_DEVICE_TYPE_GPU) { #if defined(__APPLE__) if (device_param->opencl_platform_vendor_id == VENDOR_ID_APPLE) { if (hwmon_ctx->hm_iokit) { hwmon_ctx->hm_device[backend_devices_idx].iokit = hm_adapters_iokit[device_id].iokit; hwmon_ctx->hm_device[backend_devices_idx].buslanes_get_supported |= hm_adapters_iokit[device_id].buslanes_get_supported; hwmon_ctx->hm_device[backend_devices_idx].corespeed_get_supported |= hm_adapters_iokit[device_id].corespeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].fanspeed_get_supported |= hm_adapters_iokit[device_id].fanspeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].fanpolicy_get_supported |= hm_adapters_iokit[device_id].fanpolicy_get_supported; hwmon_ctx->hm_device[backend_devices_idx].memoryspeed_get_supported |= hm_adapters_iokit[device_id].memoryspeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].temperature_get_supported |= hm_adapters_iokit[device_id].temperature_get_supported; hwmon_ctx->hm_device[backend_devices_idx].threshold_shutdown_get_supported |= hm_adapters_iokit[device_id].threshold_shutdown_get_supported; hwmon_ctx->hm_device[backend_devices_idx].threshold_slowdown_get_supported |= hm_adapters_iokit[device_id].threshold_slowdown_get_supported; hwmon_ctx->hm_device[backend_devices_idx].throttle_get_supported |= hm_adapters_iokit[device_id].throttle_get_supported; hwmon_ctx->hm_device[backend_devices_idx].utilization_get_supported |= hm_adapters_iokit[device_id].utilization_get_supported; } } #endif if ((device_param->opencl_device_vendor_id == VENDOR_ID_AMD) || (device_param->opencl_device_vendor_id == VENDOR_ID_AMD_USE_HIP)) { hwmon_ctx->hm_device[backend_devices_idx].adl = hm_adapters_adl[device_id].adl; hwmon_ctx->hm_device[backend_devices_idx].sysfs_amdgpu = hm_adapters_sysfs_amdgpu[device_id].sysfs_amdgpu; if (hwmon_ctx->hm_adl) { hwmon_ctx->hm_device[backend_devices_idx].od_version = hm_adapters_adl[device_id].od_version; hwmon_ctx->hm_device[backend_devices_idx].buslanes_get_supported |= hm_adapters_adl[device_id].buslanes_get_supported; hwmon_ctx->hm_device[backend_devices_idx].corespeed_get_supported |= hm_adapters_adl[device_id].corespeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].fanspeed_get_supported |= hm_adapters_adl[device_id].fanspeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].fanpolicy_get_supported |= hm_adapters_adl[device_id].fanpolicy_get_supported; hwmon_ctx->hm_device[backend_devices_idx].memoryspeed_get_supported |= hm_adapters_adl[device_id].memoryspeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].temperature_get_supported |= hm_adapters_adl[device_id].temperature_get_supported; hwmon_ctx->hm_device[backend_devices_idx].threshold_shutdown_get_supported |= hm_adapters_adl[device_id].threshold_shutdown_get_supported; hwmon_ctx->hm_device[backend_devices_idx].threshold_slowdown_get_supported |= hm_adapters_adl[device_id].threshold_slowdown_get_supported; hwmon_ctx->hm_device[backend_devices_idx].throttle_get_supported |= hm_adapters_adl[device_id].throttle_get_supported; hwmon_ctx->hm_device[backend_devices_idx].utilization_get_supported |= hm_adapters_adl[device_id].utilization_get_supported; } if (hwmon_ctx->hm_sysfs_amdgpu) { hwmon_ctx->hm_device[backend_devices_idx].buslanes_get_supported |= hm_adapters_sysfs_amdgpu[device_id].buslanes_get_supported; hwmon_ctx->hm_device[backend_devices_idx].corespeed_get_supported |= hm_adapters_sysfs_amdgpu[device_id].corespeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].fanspeed_get_supported |= hm_adapters_sysfs_amdgpu[device_id].fanspeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].fanpolicy_get_supported |= hm_adapters_sysfs_amdgpu[device_id].fanpolicy_get_supported; hwmon_ctx->hm_device[backend_devices_idx].memoryspeed_get_supported |= hm_adapters_sysfs_amdgpu[device_id].memoryspeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].temperature_get_supported |= hm_adapters_sysfs_amdgpu[device_id].temperature_get_supported; hwmon_ctx->hm_device[backend_devices_idx].threshold_shutdown_get_supported |= hm_adapters_sysfs_amdgpu[device_id].threshold_shutdown_get_supported; hwmon_ctx->hm_device[backend_devices_idx].threshold_slowdown_get_supported |= hm_adapters_sysfs_amdgpu[device_id].threshold_slowdown_get_supported; hwmon_ctx->hm_device[backend_devices_idx].throttle_get_supported |= hm_adapters_sysfs_amdgpu[device_id].throttle_get_supported; hwmon_ctx->hm_device[backend_devices_idx].utilization_get_supported |= hm_adapters_sysfs_amdgpu[device_id].utilization_get_supported; } } if (device_param->opencl_device_vendor_id == VENDOR_ID_NV) { hwmon_ctx->hm_device[backend_devices_idx].nvapi = hm_adapters_nvapi[device_id].nvapi; hwmon_ctx->hm_device[backend_devices_idx].nvml = hm_adapters_nvml[device_id].nvml; if (hwmon_ctx->hm_nvml) { hwmon_ctx->hm_device[backend_devices_idx].buslanes_get_supported |= hm_adapters_nvml[device_id].buslanes_get_supported; hwmon_ctx->hm_device[backend_devices_idx].corespeed_get_supported |= hm_adapters_nvml[device_id].corespeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].fanspeed_get_supported |= hm_adapters_nvml[device_id].fanspeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].fanpolicy_get_supported |= hm_adapters_nvml[device_id].fanpolicy_get_supported; hwmon_ctx->hm_device[backend_devices_idx].memoryspeed_get_supported |= hm_adapters_nvml[device_id].memoryspeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].temperature_get_supported |= hm_adapters_nvml[device_id].temperature_get_supported; hwmon_ctx->hm_device[backend_devices_idx].threshold_shutdown_get_supported |= hm_adapters_nvml[device_id].threshold_shutdown_get_supported; hwmon_ctx->hm_device[backend_devices_idx].threshold_slowdown_get_supported |= hm_adapters_nvml[device_id].threshold_slowdown_get_supported; hwmon_ctx->hm_device[backend_devices_idx].throttle_get_supported |= hm_adapters_nvml[device_id].throttle_get_supported; hwmon_ctx->hm_device[backend_devices_idx].utilization_get_supported |= hm_adapters_nvml[device_id].utilization_get_supported; } if (hwmon_ctx->hm_nvapi) { hwmon_ctx->hm_device[backend_devices_idx].buslanes_get_supported |= hm_adapters_nvapi[device_id].buslanes_get_supported; hwmon_ctx->hm_device[backend_devices_idx].corespeed_get_supported |= hm_adapters_nvapi[device_id].corespeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].fanspeed_get_supported |= hm_adapters_nvapi[device_id].fanspeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].fanpolicy_get_supported |= hm_adapters_nvapi[device_id].fanpolicy_get_supported; hwmon_ctx->hm_device[backend_devices_idx].memoryspeed_get_supported |= hm_adapters_nvapi[device_id].memoryspeed_get_supported; hwmon_ctx->hm_device[backend_devices_idx].temperature_get_supported |= hm_adapters_nvapi[device_id].temperature_get_supported; hwmon_ctx->hm_device[backend_devices_idx].threshold_shutdown_get_supported |= hm_adapters_nvapi[device_id].threshold_shutdown_get_supported; hwmon_ctx->hm_device[backend_devices_idx].threshold_slowdown_get_supported |= hm_adapters_nvapi[device_id].threshold_slowdown_get_supported; hwmon_ctx->hm_device[backend_devices_idx].throttle_get_supported |= hm_adapters_nvapi[device_id].throttle_get_supported; hwmon_ctx->hm_device[backend_devices_idx].utilization_get_supported |= hm_adapters_nvapi[device_id].utilization_get_supported; } } } } // by calling the different functions here this will disable them in case they will error out // this will also reduce the error itself printed to the user to a single print on startup hm_get_buslanes_with_devices_idx (hashcat_ctx, backend_devices_idx); hm_get_corespeed_with_devices_idx (hashcat_ctx, backend_devices_idx); hm_get_fanpolicy_with_devices_idx (hashcat_ctx, backend_devices_idx); hm_get_fanspeed_with_devices_idx (hashcat_ctx, backend_devices_idx); hm_get_memoryspeed_with_devices_idx (hashcat_ctx, backend_devices_idx); hm_get_temperature_with_devices_idx (hashcat_ctx, backend_devices_idx); hm_get_threshold_shutdown_with_devices_idx (hashcat_ctx, backend_devices_idx); hm_get_threshold_slowdown_with_devices_idx (hashcat_ctx, backend_devices_idx); hm_get_throttle_with_devices_idx (hashcat_ctx, backend_devices_idx); hm_get_utilization_with_devices_idx (hashcat_ctx, backend_devices_idx); } FREE_ADAPTERS; return 0; } void hwmon_ctx_destroy (hashcat_ctx_t *hashcat_ctx) { hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx; if (hwmon_ctx->enabled == false) return; // unload shared libraries if (hwmon_ctx->hm_nvml) { hm_NVML_nvmlShutdown (hashcat_ctx); nvml_close (hashcat_ctx); } if (hwmon_ctx->hm_nvapi) { hm_NvAPI_Unload (hashcat_ctx); nvapi_close (hashcat_ctx); } if (hwmon_ctx->hm_adl) { hm_ADL_Main_Control_Destroy (hashcat_ctx); adl_close (hashcat_ctx); } if (hwmon_ctx->hm_sysfs_amdgpu) { sysfs_amdgpu_close (hashcat_ctx); } if (hwmon_ctx->hm_sysfs_cpu) { sysfs_cpu_close (hashcat_ctx); } #if defined (__APPLE__) if (hwmon_ctx->hm_iokit) { iokit_close (hashcat_ctx); } #endif // free memory hcfree (hwmon_ctx->hm_device); memset (hwmon_ctx, 0, sizeof (hwmon_ctx_t)); }
38.416036
201
0.674897
8a9f207e9af2965a2670cda951fb1c8d8da8d3ff
7,351
c
C
src/calc_mgx_no_pi_delay.c
chronopoulos/prometheus-node
477d040f83e0ac149701b843d77880d869dcd26f
[ "MIT" ]
null
null
null
src/calc_mgx_no_pi_delay.c
chronopoulos/prometheus-node
477d040f83e0ac149701b843d77880d869dcd26f
[ "MIT" ]
null
null
null
src/calc_mgx_no_pi_delay.c
chronopoulos/prometheus-node
477d040f83e0ac149701b843d77880d869dcd26f
[ "MIT" ]
null
null
null
#include "calc_mgx_no_pi_delay.h" #include "calculation.h" #include "pru.h" #include "fp_atan2.h" #include "calibration.h" #include "hysteresis.h" #include "calculator.h" #include <math.h> #include "evalkit_constants.h" // ckc static uint16_t pixelData[328 * 252 * 2]; int32_t arg1; int32_t arg2; int32_t pixelDCS0; int32_t pixelDCS1; int16_t amplitude; int32_t distance; int i, r, c, result; int calcMGXNoPiDelayGetDist(uint16_t **data) { int offset = calibrationGetOffsetPhase(); int size = pruGetImage(data); uint16_t *pMem = *data; int nCols = pruGetNCols(); int nRowsPerHalf = pruGetNRowsPerHalf(); uint16_t pixelMask = calculatorGetPixelMask(); uint16_t nHalves = pruGetNumberOfHalves(); int minAmplitude = pruGetMinAmplitude(); if (minAmplitude > 0) { for (r = 0; r < nRowsPerHalf - 1; r += 2) { for (c = 0; c < nCols; c++) { //top pixelfield row pixelDCS0 = pMem[r * nCols * nHalves + c]; pixelDCS1 = pMem[r * nCols * nHalves + nCols + c]; arg2 = (pixelDCS0 & pixelMask); arg1 = (pixelDCS1 & pixelMask); if (configGetPartType() == EPC635 || configGetPartType() == EPC503) { arg1 = arg1 >> 4; arg2 = arg2 >> 4; } arg2 = 2048 - arg2; arg1 = 2048 - arg1; amplitude = sqrt((arg1 * arg1) + (arg2 * arg2)); if (hysteresisUpdate(r * nCols + c, amplitude)) { distance = fp_atan2(arg1, arg2); distance = ((distance * MAX_DIST_VALUE) / FP_M_2_PI) + offset + 0.5; distance = (distance + MODULO_SHIFT) % MAX_DIST_VALUE; pixelData[(r*nHalves/2) * nCols + c] = (int16_t) distance; } else { pixelData[(r*nHalves/2) * nCols + c] = LOW_AMPLITUDE; } if (!(configGetPartType() == EPC635 || configGetPartType() == EPC503)){ //bottom pixelfield row (arg1 and arg2 are swapped due to swapped DCS0 and DCS1) pixelDCS0 = pMem[r * nCols * nHalves + 2 * nCols + c]; pixelDCS1 = pMem[r * nCols * nHalves + 3 * nCols + c]; arg2 = 2048 - (pixelDCS0 & pixelMask); arg1 = 2048 - (pixelDCS1 & pixelMask); amplitude = sqrt((arg1 * arg1) + (arg2 * arg2)); if (hysteresisUpdate(r * nCols + nCols + c, amplitude)) { distance = fp_atan2(arg1, arg2); distance = ((distance * MAX_DIST_VALUE) / FP_M_2_PI) + offset + 0.5; distance = (distance + MODULO_SHIFT) % MAX_DIST_VALUE; } else { distance = LOW_AMPLITUDE; } pixelData[r * nCols + nCols + c] = (int16_t)distance; } } } } else { for (r = 0; r < nRowsPerHalf - 1; r += 2) { for (c = 0; c < nCols; c++) { //top pixelfield row pixelDCS0 = pMem[r * nCols * nHalves + c]; pixelDCS1 = pMem[r * nCols * nHalves + nCols + c]; arg2 = (pixelDCS0 & pixelMask); arg1 = (pixelDCS1 & pixelMask); if (configGetPartType() == EPC635 || configGetPartType() == EPC503) { arg1 = arg1 >> 4; arg2 = arg2 >> 4; } arg2 = 2048 - arg2; arg1 = 2048 - arg1; distance = fp_atan2(arg1, arg2); distance = ((distance * MAX_DIST_VALUE) / FP_M_2_PI) + offset + 0.5; distance = (distance + MODULO_SHIFT) % MAX_DIST_VALUE; pixelData[(r*nHalves/2) * nCols + c] = (int16_t) distance; if (!(configGetPartType() == EPC635 || configGetPartType() == EPC503)){ //bottom pixelfield row (arg1 and arg2 are swapped due to swapped DCS0 and DCS1) pixelDCS0 = pMem[r * nCols * nHalves + 2 * nCols + c]; pixelDCS1 = pMem[r * nCols * nHalves + 3 * nCols + c]; arg2 = 2048 - (pixelDCS0 & pixelMask); arg1 = 2048 - (pixelDCS1 & pixelMask); distance = fp_atan2(arg1, arg2); distance = ((distance * MAX_DIST_VALUE) / FP_M_2_PI) + offset + 0.5; distance = (distance + MODULO_SHIFT) % MAX_DIST_VALUE; pixelData[r * nCols + nCols + c] = (int16_t) distance; } } } } *data = pixelData; return size / 2; } int calcMGXNoPiDelayGetAmp(uint16_t **data) { int size = pruGetImage(data); uint16_t *pMem = *data; int nCols = pruGetNCols(); int nRowsPerHalf = pruGetNRowsPerHalf(); uint16_t nHalves = pruGetNumberOfHalves(); uint16_t pixelMask = calculatorGetPixelMask(); for (r = 0; r < nRowsPerHalf - 1; r += 2) { for (c = 0; c < nCols; c++) { //top pixelfield row arg2 = (pMem[r * nCols * nHalves + c] & pixelMask); arg1 = (pMem[r * nCols * nHalves + nCols + c] & pixelMask); if (configGetPartType() == EPC635 || configGetPartType() == EPC503) { arg1 = arg1 >> 4; arg2 = arg2 >> 4; } arg1 = 2048 - arg1; arg2 = 2048 - arg2; result = sqrt((arg1 * arg1) + (arg2 * arg2)); pixelData[(r*nHalves/2) * nCols + c] = result; if (!(configGetPartType() == EPC635 || configGetPartType() == EPC503)){ //bottom pixelfield row (arg1 and arg2 are swapped due to swapped DCS0 and DCS1) arg1 = 2048 - (pMem[r * nCols * nHalves + 2 * nCols + c] & pixelMask); arg2 = 2048 - (pMem[r * nCols * nHalves + 3 * nCols + c] & pixelMask); result = sqrt((arg1 * arg1) + (arg2 * arg2)); pixelData[r * nCols + nCols + c] = result; } } } *data = pixelData; return size / 2; } int calcMGXNoPiDelayGetInfo(uint16_t **data) { int offset = calibrationGetOffsetPhase(); int size = pruGetImage(data); uint16_t *pMem = *data; int nPixelPerDCS = size; int nCols = pruGetNCols(); int nRowsPerHalf = pruGetNRowsPerHalf(); uint16_t nHalves = pruGetNumberOfHalves(); uint16_t pixelMask = calculatorGetPixelMask(); for (r = 0; r < nRowsPerHalf - 1; r += 2) { for (c = 0; c < nCols; c++) { //top pixelfield row pixelDCS0 = pMem[r * nCols * nHalves + c]; pixelDCS1 = pMem[r * nCols * nHalves + nCols + c]; arg2 = (pixelDCS0 & pixelMask); arg1 = (pixelDCS1 & pixelMask); if (configGetPartType() == EPC635 || configGetPartType() == EPC503) { arg1 = arg1 >> 4; arg2 = arg2 >> 4; } arg1 = 2048 - arg1; arg2 = 2048 - arg2; amplitude = sqrt((arg1 * arg1) + (arg2 * arg2)); if (hysteresisUpdate(r * nCols + c, amplitude)) { distance = fp_atan2(arg1, arg2); distance = ((distance * MAX_DIST_VALUE) / FP_M_2_PI) + offset + 0.5; distance = (distance + MODULO_SHIFT) % MAX_DIST_VALUE; pixelData[(r*nHalves/2) * nCols + c] = (int16_t) distance; } else { pixelData[(r*nHalves/2) * nCols + c] = LOW_AMPLITUDE; } pixelData[(r*nHalves/2) * nCols + c + nPixelPerDCS / 2] = amplitude; if (!(configGetPartType() == EPC635 || configGetPartType() == EPC503)){ //bottom pixelfield row (arg1 and arg2 are swapped due to swapped DCS0 and DCS1) pixelDCS0 = pMem[r * nCols * nHalves + 2 * nCols + c]; pixelDCS1 = pMem[r * nCols * nHalves + 3 * nCols + c]; arg1 = 2048 - (pixelDCS0 & pixelMask); arg2 = 2048 - (pixelDCS1 & pixelMask); amplitude = sqrt((arg1 * arg1 / 4) + (arg2 * arg2 / 4)); if (hysteresisUpdate(r * nCols + nCols + c, amplitude)) { distance = fp_atan2(arg1, arg2); distance = ((distance * MAX_DIST_VALUE) / FP_M_2_PI) + offset + 0.5; distance = (distance + MODULO_SHIFT) % MAX_DIST_VALUE; } else { amplitude = LOW_AMPLITUDE; } pixelData[r * nCols + nCols + c] = (int16_t)(distance); pixelData[r * nCols + nCols + c + nPixelPerDCS / 2] = amplitude; } } } *data = pixelData; return size; }
36.391089
86
0.601415
5c23bc888bfa54400cd443a4a1f204dede3f7370
1,035
c
C
get_next_line/libft/ft_strchr.c
SebastianKunz/fdf
0f2bca6e01b9d8595fb0a3e37b5b1e0fad96b92d
[ "Unlicense" ]
2
2018-12-27T06:49:20.000Z
2020-01-18T22:15:46.000Z
get_next_line/libft/ft_strchr.c
SebastianKunz/fdf
0f2bca6e01b9d8595fb0a3e37b5b1e0fad96b92d
[ "Unlicense" ]
1
2018-12-27T04:06:33.000Z
2018-12-27T04:09:25.000Z
get_next_line/libft/ft_strchr.c
SebastianKunz/fdf
0f2bca6e01b9d8595fb0a3e37b5b1e0fad96b92d
[ "Unlicense" ]
1
2019-02-27T00:56:47.000Z
2019-02-27T00:56:47.000Z
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strchr.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: skunz <skunz@student.42.us.org> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2018/09/19 18:07:32 by skunz #+# #+# */ /* Updated: 2018/09/19 18:07:33 by skunz ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" char *ft_strchr(const char *s, int c) { while (*s && *s != c) s++; if (*s == c) return ((char*)s); return (NULL); }
45
80
0.162319
b8b629cb1b6f73fed572066ab983e9b8a8f575fb
176
h
C
src/clock.h
rrebello/gusgb
358874acbcc85423a0920ca7d181bbddb515d197
[ "MIT" ]
null
null
null
src/clock.h
rrebello/gusgb
358874acbcc85423a0920ca7d181bbddb515d197
[ "MIT" ]
null
null
null
src/clock.h
rrebello/gusgb
358874acbcc85423a0920ca7d181bbddb515d197
[ "MIT" ]
null
null
null
#ifndef CLOCK_H #define CLOCK_H void clock_reset(void); void clock_step(unsigned int cycles); unsigned int clock_get_step(void); void clock_clear(void); #endif /* CLOCK_H */
17.6
37
0.772727
ef9d5ec6638e2ae564a32463369502b0da81ccf5
281
h
C
Classes/PopoverBorderView.h
iDalink/PopoverView
2b421d1ff29832a0137f54374ba935edb9488c64
[ "0BSD" ]
1
2016-01-05T09:13:36.000Z
2016-01-05T09:13:36.000Z
Classes/PopoverBorderView.h
iDalink/PopoverView
2b421d1ff29832a0137f54374ba935edb9488c64
[ "0BSD" ]
null
null
null
Classes/PopoverBorderView.h
iDalink/PopoverView
2b421d1ff29832a0137f54374ba935edb9488c64
[ "0BSD" ]
null
null
null
// // PopoverBorderView.h // ChiDeKai // // Created by liuyu on 14-11-7. // Copyright (c) 2014年 liuyu. All rights reserved. // #import <UIKit/UIKit.h> @class PopoverViewController; @interface PopoverBorderView : UIView @property PopoverViewController *myViewController; @end
18.733333
51
0.736655
d4815183427d4e060a633c61e8e86f44aafa63be
9,803
h
C
ThreeDScanner-iOS/Libraries/PCL/include/pcl-1.8/pcl/keypoints/narf_keypoint.h
anwholesquare/3DScanr
335b6fa47a86b7c121e26ad2cbde342340ec855b
[ "MIT" ]
96
2018-09-22T11:13:49.000Z
2022-01-26T19:23:42.000Z
ThreeDScanner-iOS/Libraries/PCL/include/pcl-1.8/pcl/keypoints/narf_keypoint.h
anwholesquare/3DScanr
335b6fa47a86b7c121e26ad2cbde342340ec855b
[ "MIT" ]
7
2018-09-06T06:32:40.000Z
2021-05-07T04:32:35.000Z
ThreeDScanner-iOS/Libraries/PCL/include/pcl-1.8/pcl/keypoints/narf_keypoint.h
anwholesquare/3DScanr
335b6fa47a86b7c121e26ad2cbde342340ec855b
[ "MIT" ]
27
2018-01-03T22:49:14.000Z
2022-01-24T15:41:23.000Z
/* * Software License Agreement (BSD License) * * Copyright (c) 2010, Willow Garage, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of Willow Garage, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * */ /* \author Bastian Steder */ #ifndef PCL_NARF_KEYPOINT_H_ #define PCL_NARF_KEYPOINT_H_ #include <pcl/pcl_macros.h> #include <pcl/point_cloud.h> #include <pcl/point_types.h> #include <pcl/keypoints/keypoint.h> namespace pcl { // Forward declarations class RangeImage; class RangeImageBorderExtractor; /** \brief @b NARF (Normal Aligned Radial Feature) keypoints. Input is a range image, * output the indices of the keypoints * See B. Steder, R. B. Rusu, K. Konolige, and W. Burgard * Point Feature Extraction on 3D Range Scans Taking into Account Object Boundaries * In Proc. of the IEEE Int. Conf. on Robotics &Automation (ICRA). 2011. * \author Bastian Steder * \ingroup keypoints */ class PCL_EXPORTS NarfKeypoint : public Keypoint<PointWithRange, int> { public: typedef boost::shared_ptr<NarfKeypoint> Ptr; typedef boost::shared_ptr<const NarfKeypoint> ConstPtr; // =====TYPEDEFS===== typedef Keypoint<PointWithRange, int> BaseClass; typedef Keypoint<PointWithRange, int>::PointCloudOut PointCloudOut; // =====PUBLIC STRUCTS===== //! Parameters used in this class struct Parameters { Parameters() : support_size(-1.0f), max_no_of_interest_points(-1), min_distance_between_interest_points(0.25f), optimal_distance_to_high_surface_change(0.25), min_interest_value(0.45f), min_surface_change_score(0.2f), optimal_range_image_patch_size(10), distance_for_additional_points(0.0f), add_points_on_straight_edges(false), do_non_maximum_suppression(true), no_of_polynomial_approximations_per_point(0), max_no_of_threads(1), use_recursive_scale_reduction(false), calculate_sparse_interest_image(true) {} float support_size; //!< This defines the area 'covered' by an interest point (in meters) int max_no_of_interest_points; //!< The maximum number of interest points that will be returned float min_distance_between_interest_points; /**< Minimum distance between maximas * (this is a factor for support_size, i.e. the distance is * min_distance_between_interest_points*support_size) */ float optimal_distance_to_high_surface_change; /**< The distance we want keep between keypoints and areas * of high surface change * (this is a factor for support_size, i.e., the distance is * optimal_distance_to_high_surface_change*support_size) */ float min_interest_value; //!< The minimum value to consider a point as an interest point float min_surface_change_score; //!< The minimum value of the surface change score to consider a point int optimal_range_image_patch_size; /**< The size (in pixels) of the image patches from which the interest value * should be computed. This influences, which range image is selected from * the scale space to compute the interest value of a pixel at a certain * distance. */ // TODO: float distance_for_additional_points; /**< All points in this distance to a found maximum, that * are above min_interest_value are also added as interest points * (this is a factor for support_size, i.e. the distance is * distance_for_additional_points*support_size) */ bool add_points_on_straight_edges; /**< If this is set to true, there will also be interest points on * straight edges, e.g., just indicating an area of high surface change */ bool do_non_maximum_suppression; /**< If this is set to false there will be much more points * (can be used to spread points over the whole scene * (combined with a low min_interest_value)) */ bool no_of_polynomial_approximations_per_point; /**< If this is >0, the exact position of the interest point is determined using bivariate polynomial approximations of the interest values of the area. */ int max_no_of_threads; //!< The maximum number of threads this code is allowed to use with OPNEMP bool use_recursive_scale_reduction; /**< Try to decrease runtime by extracting interest points at lower reolution * in areas that contain enough points, i.e., have lower range. */ bool calculate_sparse_interest_image; /**< Use some heuristics to decide which areas of the interest image can be left out to improve the runtime. */ }; // =====CONSTRUCTOR & DESTRUCTOR===== NarfKeypoint (RangeImageBorderExtractor* range_image_border_extractor=NULL, float support_size=-1.0f); virtual ~NarfKeypoint (); // =====PUBLIC METHODS===== //! Erase all data calculated for the current range image void clearData (); //! Set the RangeImageBorderExtractor member (required) void setRangeImageBorderExtractor (RangeImageBorderExtractor* range_image_border_extractor); //! Get the RangeImageBorderExtractor member RangeImageBorderExtractor* getRangeImageBorderExtractor () { return range_image_border_extractor_; } //! Set the RangeImage member of the RangeImageBorderExtractor void setRangeImage (const RangeImage* range_image); /** Extract interest value per image point */ float* getInterestImage () { calculateInterestImage(); return interest_image_;} //! Extract maxima from an interest image const ::pcl::PointCloud<InterestPoint>& getInterestPoints () { calculateInterestPoints(); return *interest_points_;} //! Set all points in the image that are interest points to true, the rest to false const std::vector<bool>& getIsInterestPointImage () { calculateInterestPoints(); return is_interest_point_image_;} //! Getter for the parameter struct Parameters& getParameters () { return parameters_;} //! Getter for the range image of range_image_border_extractor_ const RangeImage& getRangeImage (); //! Overwrite the compute function of the base class void compute (PointCloudOut& output); protected: // =====PROTECTED METHODS===== void calculateScaleSpace (); void calculateInterestImage (); void calculateCompleteInterestImage (); void calculateSparseInterestImage (); void calculateInterestPoints (); //void //blurInterestImage (); //! Detect key points virtual void detectKeypoints (PointCloudOut& output); // =====PROTECTED MEMBER VARIABLES===== using BaseClass::name_; RangeImageBorderExtractor* range_image_border_extractor_; Parameters parameters_; float* interest_image_; ::pcl::PointCloud<InterestPoint>* interest_points_; std::vector<bool> is_interest_point_image_; std::vector<RangeImage*> range_image_scale_space_; std::vector<RangeImageBorderExtractor*> border_extractor_scale_space_; std::vector<float*> interest_image_scale_space_; }; /** * \ingroup keypoints */ inline std::ostream& operator << (std::ostream& os, const NarfKeypoint::Parameters& p) { os << PVARC(p.support_size) << PVARC(p.min_distance_between_interest_points) << PVARC(p.min_interest_value) << PVARN(p.distance_for_additional_points); return (os); } } // end namespace pcl #endif //#ifndef PCL_NARF_KEYPOINT_H_
47.357488
120
0.653881
336a087edccf5cdcceb5c0227b6d109ca0370e03
39,559
h
C
examples/basic_drawing/source/gfx/BMfont5.h
HTV04/GRRLIB
7840bd4e1e23faf52015e8ef3d3fd55a2539dca4
[ "MIT" ]
72
2015-04-05T00:03:18.000Z
2022-03-27T19:43:59.000Z
examples/basic_drawing/source/gfx/BMfont5.h
HTV04/GRRLIB
7840bd4e1e23faf52015e8ef3d3fd55a2539dca4
[ "MIT" ]
10
2015-11-17T05:25:31.000Z
2022-03-03T20:57:42.000Z
examples/basic_drawing/source/gfx/BMfont5.h
HTV04/GRRLIB
7840bd4e1e23faf52015e8ef3d3fd55a2539dca4
[ "MIT" ]
18
2015-07-07T03:53:23.000Z
2022-03-27T19:44:00.000Z
/* This file was autogenerated from BMfont5.png */ //--------------------------------------------------------------------------------- #ifndef _BMfont5_h_ #define _BMfont5_h_ //--------------------------------------------------------------------------------- const unsigned char BMfont5[] = { 0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x88, 0x84, 0x0D, 0x0B, 0x00, 0x00, 0x18, 0xAD, 0x49, 0x44, 0x41, 0x54, 0x78, 0xDA, 0xED, 0x5D, 0x5F, 0xE8, 0x65, 0x57, 0x75, 0x5E, 0xF3, 0x34, 0x13, 0xC5, 0xCE, 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x08, 0x1B, 0x87, 0xEE, 0x07, 0x63, 0x7D, 0x49, 0x27, 0x0E, 0x0D, 0x44, 0x78, 0x67, 0x5B, 0xB6, 0x6D, 0x1D, 0x34, 0x4C, 0x75, 0x6C, 0x81, 0xCC, 0x02, 0xD9, 0xB1, 0xDF, 0x0E, 0xC7, 0x5D, 0x61, 0xEE, 0xD9, 0x57, 0x07, 0x1E, 0x9D, 0x00, 0xE8, 0xE8, 0xE8, 0xE8, 0xE8, 0xE8, 0xE8, 0xE8, 0xE8, 0xE8, 0xE8, 0xE8, 0xE8, 0xE8, 0x78, 0x1E, 0xA0, 0x13, 0x00, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0x1D, 0xCF, 0x03, 0x74, 0x02, 0xA0, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xE3, 0x79, 0x80, 0x9F, 0x03, 0xC4, 0x02, 0xCE, 0x68, 0x03, 0x29, 0x30, 0xDF, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82 }; const int BMfont5_size = 6374; //--------------------------------------------------------------------------------- #endif //_BMfont5_h_ //---------------------------------------------------------------------------------
95.55314
97
0.647944
32d499d0fe5ecf195a679d1015a5c42b3020ce86
2,696
h
C
B2G/gecko/modules/libmar/src/mar_private.h
wilebeast/FireFox-OS
43067f28711d78c429a1d6d58c77130f6899135f
[ "Apache-2.0" ]
3
2015-08-31T15:24:31.000Z
2020-04-24T20:31:29.000Z
B2G/gecko/modules/libmar/src/mar_private.h
wilebeast/FireFox-OS
43067f28711d78c429a1d6d58c77130f6899135f
[ "Apache-2.0" ]
null
null
null
B2G/gecko/modules/libmar/src/mar_private.h
wilebeast/FireFox-OS
43067f28711d78c429a1d6d58c77130f6899135f
[ "Apache-2.0" ]
3
2015-07-29T07:17:15.000Z
2020-11-04T06:55:37.000Z
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim:set ts=2 sw=2 sts=2 et cindent: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef MAR_PRIVATE_H__ #define MAR_PRIVATE_H__ #include "prtypes.h" #include "limits.h" #include "mozilla/StandardInteger.h" /* Code in this module requires a guarantee that the size of uint32_t and uint64_t are 4 and 8 bytes respectively. */ PR_STATIC_ASSERT(sizeof(uint32_t) == 4); PR_STATIC_ASSERT(sizeof(uint64_t) == 8); #define BLOCKSIZE 4096 #define ROUND_UP(n, incr) (((n) / (incr) + 1) * (incr)) #define MAR_ID "MAR1" #define MAR_ID_SIZE 4 /* The signature block comes directly after the header block which is 16 bytes */ #define SIGNATURE_BLOCK_OFFSET 16 /* Make sure the file is less than 500MB. We do this to protect against invalid MAR files. */ #define MAX_SIZE_OF_MAR_FILE ((int64_t)524288000) /* Existing code makes assumptions that the file size is smaller than LONG_MAX. */ PR_STATIC_ASSERT(MAX_SIZE_OF_MAR_FILE < ((int64_t)LONG_MAX)); /* We store at most the size up to the signature block + 4 bytes per BLOCKSIZE bytes */ PR_STATIC_ASSERT(sizeof(BLOCKSIZE) < \ (SIGNATURE_BLOCK_OFFSET + sizeof(uint32_t))); /* The maximum size of any signature supported by current and future implementations of the signmar program. */ #define MAX_SIGNATURE_LENGTH 2048 /* Each additional block has a unique ID. The product information block has an ID of 1. */ #define PRODUCT_INFO_BLOCK_ID 1 #define MAR_ITEM_SIZE(namelen) (3*sizeof(uint32_t) + (namelen) + 1) /* Product Information Block (PIB) constants */ #define PIB_MAX_MAR_CHANNEL_ID_SIZE 63 #define PIB_MAX_PRODUCT_VERSION_SIZE 31 /* The mar program is compiled as a host bin so we don't have access to NSPR at runtime. For that reason we use ntohl, htonl, and define HOST_TO_NETWORK64 instead of the NSPR equivalents. */ #ifdef XP_WIN #include <winsock2.h> #define ftello _ftelli64 #define fseeko _fseeki64 #else #define _FILE_OFFSET_BITS 64 #include <netinet/in.h> #include <unistd.h> #endif #include <stdio.h> #define HOST_TO_NETWORK64(x) ( \ ((((uint64_t) x) & 0xFF) << 56) | \ ((((uint64_t) x) >> 8) & 0xFF) << 48) | \ (((((uint64_t) x) >> 16) & 0xFF) << 40) | \ (((((uint64_t) x) >> 24) & 0xFF) << 32) | \ (((((uint64_t) x) >> 32) & 0xFF) << 24) | \ (((((uint64_t) x) >> 40) & 0xFF) << 16) | \ (((((uint64_t) x) >> 48) & 0xFF) << 8) | \ (((uint64_t) x) >> 56) #define NETWORK_TO_HOST64 HOST_TO_NETWORK64 #endif /* MAR_PRIVATE_H__ */
32.481928
79
0.694733
61efade695b49f35ad7ad5657a653d2f5c5c41a5
285
h
C
OPGSDK Demo App/SDKDemo/APIControllers/GetPanelsViewController.h
OnePointGlobal/OnePoint-Global-Mobile-App-SDK-iOS
3df71487e38ce8a90699d4facfad1389b7805843
[ "MIT" ]
1
2017-09-06T06:24:02.000Z
2017-09-06T06:24:02.000Z
OPGSDK Demo App/SDKDemo/APIControllers/GetPanelsViewController.h
OnePointGlobal/OnePoint-Global-Mobile-App-SDK-iOS
3df71487e38ce8a90699d4facfad1389b7805843
[ "MIT" ]
5
2017-09-05T07:20:54.000Z
2019-11-04T10:33:10.000Z
OPGSDK Demo App/SDKDemo/APIControllers/GetPanelsViewController.h
OnePointGlobal/OnePoint-Global-Mobile-App-SDK-iOS
3df71487e38ce8a90699d4facfad1389b7805843
[ "MIT" ]
2
2017-09-07T10:05:49.000Z
2022-03-17T08:46:28.000Z
// // GetPanelsViewController.h // SDKDemo // // Created by OnePoint Global on 04/10/16. // Copyright © 2016 opg. All rights reserved. // #import <UIKit/UIKit.h> @interface GetPanelsViewController : UITableViewController @property(strong, nonatomic) NSArray* panelsArray; @end
17.8125
58
0.733333
522ec2b37e0f6ad08533ca7c3ad7f4479dc60990
9,925
h
C
mindspore/ccsrc/kernel/gpu/math/binary_op_gpu_kernel.h
TommyLike/mindspore
401dabb786a9097d6dd84f391657d266b04e9a37
[ "Apache-2.0" ]
1
2020-06-05T03:15:18.000Z
2020-06-05T03:15:18.000Z
mindspore/ccsrc/kernel/gpu/math/binary_op_gpu_kernel.h
liyong126/mindspore
930a1fb0a8fa9432025442c4f4732058bb7af592
[ "Apache-2.0" ]
7
2020-03-30T08:31:56.000Z
2020-04-01T09:54:39.000Z
mindspore/ccsrc/kernel/gpu/math/binary_op_gpu_kernel.h
liyong126/mindspore
930a1fb0a8fa9432025442c4f4732058bb7af592
[ "Apache-2.0" ]
1
2020-03-30T17:07:43.000Z
2020-03-30T17:07:43.000Z
/** * Copyright 2019 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef MINDSPORE_CCSRC_KERNEL_GPU_BINARYOP_GPU_KERNEL_H_ #define MINDSPORE_CCSRC_KERNEL_GPU_BINARYOP_GPU_KERNEL_H_ #include <cuda_runtime_api.h> #include <vector> #include <string> #include <map> #include "kernel/gpu/gpu_kernel.h" #include "kernel/gpu/gpu_kernel_factory.h" #include "kernel/gpu/cuda_impl/unary_op_impl.cuh" #include "kernel/gpu/kernel_constants.h" namespace mindspore { namespace kernel { enum BinaryOpType { BINARY_OP_ADD = 0, BINARY_OP_SUB, BINARY_OP_MUL, BINARY_OP_DIV, BINARY_OP_INVALID_TYPE = 255 }; const std::map<std::string, BinaryOpType> kBinaryOpTypeMap = { {"Sub", BINARY_OP_SUB}, {"Mul", BINARY_OP_MUL}, {"RealDiv", BINARY_OP_DIV}, }; template <typename T> class BinaryOpGpuKernel : public GpuKernel { public: BinaryOpGpuKernel() : cudnn_handle_(nullptr), binary_op_type_(BINARY_OP_INVALID_TYPE), tensor_op_(CUDNN_OP_TENSOR_MUL), inputA_descriptor_(nullptr), inputB_descriptor_(nullptr), opTensor_descriptor_(nullptr), cudnn_data_type_(CUDNN_DATA_FLOAT), is_null_input_(false), input_size_(0), output_size_(0), workspace_size_(0) {} ~BinaryOpGpuKernel() override { DestroyResource(); } const std::vector<size_t> &GetInputSizeList() const override { return input_size_list_; } const std::vector<size_t> &GetOutputSizeList() const override { return output_size_list_; } const std::vector<size_t> &GetWorkspaceSizeList() const override { return workspace_size_list_; } bool Launch(const std::vector<AddressPtr> &inputs, const std::vector<AddressPtr> &workspace, const std::vector<AddressPtr> &outputs, uintptr_t stream_ptr) override { if (is_null_input_) { return true; } T *input_addr = GetDeviceAddress<T>(inputs, 0); T *input_addr2 = GetDeviceAddress<T>(inputs, 1); T *output_addr = GetDeviceAddress<T>(outputs, 0); const float alpha = 1; const float beta = 0; T *inputB_addr = nullptr; switch (binary_op_type_) { case BINARY_OP_SUB: { T *workspace_addr = GetDeviceAddress<T>(workspace, 0); Negative(input_addr2, workspace_addr, inputs[1]->size / sizeof(T), reinterpret_cast<cudaStream_t>(stream_ptr)); inputB_addr = workspace_addr; break; } case BINARY_OP_MUL: { inputB_addr = input_addr2; break; } case BINARY_OP_DIV: { T *workspace_addr = GetDeviceAddress<T>(workspace, 0); Reciprocal(input_addr2, workspace_addr, inputs[1]->size / sizeof(T), reinterpret_cast<cudaStream_t>(stream_ptr)); inputB_addr = workspace_addr; break; } default: { MS_LOG(EXCEPTION) << "Binary operation " << binary_op_type_ << " is not supported."; } } if (inputs[0]->size > inputs[1]->size) { CHECK_CUDNN_RET_WITH_EXCEPT( cudnnOpTensor(cudnn_handle_, opTensor_descriptor_, &alpha, inputA_descriptor_, input_addr, &alpha, inputB_descriptor_, inputB_addr, &beta, inputA_descriptor_, output_addr), "cudnnOpTensor failed"); } else { CHECK_CUDNN_RET_WITH_EXCEPT( cudnnOpTensor(cudnn_handle_, opTensor_descriptor_, &alpha, inputB_descriptor_, inputB_addr, &alpha, inputA_descriptor_, input_addr, &beta, inputB_descriptor_, output_addr), "cudnnOpTensor failed"); } return true; } bool Init(const CNodePtr &kernel_node) override { InitResource(); cudnn_data_type_ = kCudnnDtypeMap[TypeIdLabel(AnfAlgo::GetInputDeviceDataType(kernel_node, 0))]; size_t input_num = AnfAlgo::GetInputTensorNum(kernel_node); if (input_num != 2) { MS_LOG(ERROR) << "Input number is " << input_num << ", but binary operation needs 2 inputs."; return false; } size_t output_num = AnfAlgo::GetOutputTensorNum(kernel_node); if (output_num != 1) { MS_LOG(ERROR) << "Output number is " << output_num << ", but binary operation needs 1 output."; return false; } InferBinaryType(kernel_node); auto input_shape = AnfAlgo::GetPrevNodeOutputInferShape(kernel_node, 0); auto input_shapeB = AnfAlgo::GetPrevNodeOutputInferShape(kernel_node, 1); is_null_input_ = CHECK_NULL_INPUT(input_shape) || CHECK_NULL_INPUT(input_shapeB); if (is_null_input_) { MS_LOG(WARNING) << "BinaryOpGpuKernel input is null"; InitSizeLists(); return true; } int shape_n = input_shape.size() < 4 ? 1 : SizeToInt(input_shape[input_shape.size() - 4]); int shape_c = input_shape.size() < 3 ? 1 : SizeToInt(input_shape[input_shape.size() - 3]); int shape_h = input_shape.size() < 2 ? 1 : SizeToInt(input_shape[input_shape.size() - 2]); int shape_w = input_shape.size() == 0 ? 1 : SizeToInt(input_shape[input_shape.size() - 1]); CHECK_CUDNN_RET_WITH_EXCEPT(cudnnSetTensor4dDescriptor(inputA_descriptor_, CUDNN_TENSOR_NCHW, cudnn_data_type_, shape_n, shape_c, shape_h, shape_w), "cudnnSetTensor4dDescriptor failed"); int shapeB_n = input_shapeB.size() < 4 ? 1 : SizeToInt(input_shapeB[input_shapeB.size() - 4]); int shapeB_c = input_shapeB.size() < 3 ? 1 : SizeToInt(input_shapeB[input_shapeB.size() - 3]); int shapeB_h = input_shapeB.size() < 2 ? 1 : SizeToInt(input_shapeB[input_shapeB.size() - 2]); int shapeB_w = input_shapeB.size() == 0 ? 1 : SizeToInt(input_shapeB[input_shapeB.size() - 1]); CHECK_CUDNN_RET_WITH_EXCEPT(cudnnSetTensor4dDescriptor(inputB_descriptor_, CUDNN_TENSOR_NCHW, cudnn_data_type_, shapeB_n, shapeB_c, shapeB_h, shapeB_w), "cudnnSetTensor4dDescriptor failed"); InitSizeLists(); return true; } protected: void InitResource() override { cudnn_handle_ = device::gpu::GPUDeviceManager::GetInstance().GetCudnnHandle(); CHECK_CUDNN_RET_WITH_EXCEPT(cudnnCreateTensorDescriptor(&inputA_descriptor_), "cudnnCreateTensorDescriptor failed."); CHECK_CUDNN_RET_WITH_EXCEPT(cudnnCreateTensorDescriptor(&inputB_descriptor_), "cudnnCreateTensorDescriptor failed."); CHECK_CUDNN_RET_WITH_EXCEPT(cudnnCreateOpTensorDescriptor(&opTensor_descriptor_), "cudnnCreateOpTensorDescriptor failed."); } void InitSizeLists() override { if (!is_null_input_) { CHECK_CUDNN_RET_WITH_EXCEPT(cudnnGetTensorSizeInBytes(inputA_descriptor_, &input_size_), "cudnnGetTensorSizeInBytes failed."); input_size_list_.push_back(input_size_); CHECK_CUDNN_RET_WITH_EXCEPT(cudnnGetTensorSizeInBytes(inputB_descriptor_, &output_size_), "cudnnGetTensorSizeInBytes failed."); } input_size_list_.push_back(output_size_); if (binary_op_type_ == BINARY_OP_DIV || binary_op_type_ == BINARY_OP_SUB) { workspace_size_ = output_size_; } workspace_size_list_.push_back(workspace_size_); if (output_size_ > input_size_) { output_size_list_.push_back(output_size_); } else { output_size_list_.push_back(input_size_); } return; } private: void DestroyResource() noexcept { CHECK_CUDNN_RET_WITH_ERROR(cudnnDestroyTensorDescriptor(inputA_descriptor_), "cudnnDestroyTensorDescriptor failed."); CHECK_CUDNN_RET_WITH_ERROR(cudnnDestroyTensorDescriptor(inputB_descriptor_), "cudnnDestroyTensorDescriptor failed."); CHECK_CUDNN_RET_WITH_ERROR(cudnnDestroyOpTensorDescriptor(opTensor_descriptor_), "cudnnDestroyOpTensorDescriptor failed."); } void InferBinaryType(const CNodePtr &kernel_node) { std::string kernel_name = AnfAlgo::GetCNodeName(kernel_node); auto iter = kBinaryOpTypeMap.find(kernel_name); if (iter == kBinaryOpTypeMap.end()) { MS_LOG(EXCEPTION) << "Binary operation " << kernel_name << " is not supported."; } else { binary_op_type_ = iter->second; } switch (binary_op_type_) { case BINARY_OP_DIV: case BINARY_OP_MUL: { tensor_op_ = CUDNN_OP_TENSOR_MUL; break; } case BINARY_OP_SUB: { tensor_op_ = CUDNN_OP_TENSOR_ADD; break; } default: { MS_LOG(EXCEPTION) << "Binary operation " << binary_op_type_ << " is not supported."; } } CHECK_CUDNN_RET_WITH_EXCEPT( cudnnSetOpTensorDescriptor(opTensor_descriptor_, tensor_op_, cudnn_data_type_, CUDNN_NOT_PROPAGATE_NAN), "cudnnSetOpTensorDescriptor failed"); return; } cudnnHandle_t cudnn_handle_; BinaryOpType binary_op_type_; cudnnOpTensorOp_t tensor_op_; cudnnTensorDescriptor_t inputA_descriptor_; cudnnTensorDescriptor_t inputB_descriptor_; cudnnOpTensorDescriptor_t opTensor_descriptor_; cudnnDataType_t cudnn_data_type_; bool is_null_input_; size_t input_size_; size_t output_size_; size_t workspace_size_; std::vector<size_t> input_size_list_; std::vector<size_t> output_size_list_; std::vector<size_t> workspace_size_list_; }; } // namespace kernel } // namespace mindspore #endif // MINDSPORE_CCSRC_KERNEL_GPU_BINARYOP_GPU_KERNEL_H_
42.596567
119
0.689874
50735a5d1320b08f94d7db77aa549783d0db6c37
7,997
h
C
src/g729a_decoder.h
AlexIII/g729a-python
d0a2e137137bb982bbf18683facea50faa2d6918
[ "BSD-2-Clause" ]
8
2020-03-19T12:20:46.000Z
2021-11-28T19:43:27.000Z
src/g729a_decoder.h
AlexIII/g729a-python
d0a2e137137bb982bbf18683facea50faa2d6918
[ "BSD-2-Clause" ]
null
null
null
src/g729a_decoder.h
AlexIII/g729a-python
d0a2e137137bb982bbf18683facea50faa2d6918
[ "BSD-2-Clause" ]
1
2020-05-20T12:13:20.000Z
2020-05-20T12:13:20.000Z
/** * Copyright (c) 2015, Russell * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * Portions of this file are derived from the following ITU notice: * * ITU-T G.729 Software Package Release 2 (November 2006) * * ITU-T G.729A Speech Coder ANSI-C Source Code * Version 1.1 Last modified: September 1996 * * Copyright (c) 1996, * AT&T, France Telecom, NTT, Universite de Sherbrooke * All rights reserved. */ #ifndef __G729_DECODER_H__ #define __G729_DECODER_H__ #include "g729a_typedef.h" #include "g729a_defines.h" typedef struct _g729a_lspdec_state { /*--------------------------------------------------------------------------* * lspdec.c *--------------------------------------------------------------------------*/ G729_Word16 freq_prev[MA_NP][M]; /* Q13 */ G729_Word16 prev_ma; /* previous MA prediction coef.*/ G729_Word16 prev_lsp[M]; /* previous LSP vector */ } g729a_lspdec_state; typedef struct _g729a_post_filter_state { /*--------------------------------------------------------------------------* * postfilt.c *--------------------------------------------------------------------------*/ /* inverse filtered synthesis (with A(z/GAMMA2_PST)) */ G729_Word16 res2_buf[PIT_MAX + L_SUBFR]; G729_Word16 *res2; G729_Word16 scal_res2_buf[PIT_MAX + L_SUBFR]; G729_Word16 *scal_res2; /* memory of filter 1/A(z/GAMMA1_PST) */ G729_Word16 mem_syn_pst[M]; G729_Word16 mem_pre; G729_Word16 past_gain; } g729a_post_filter_state; typedef struct _g729a_post_process_state { /*--------------------------------------------------------------------------* * post_pro.c *--------------------------------------------------------------------------*/ G729_Word16 y2_hi; G729_Word16 y2_lo; G729_Word16 y1_hi; G729_Word16 y1_lo; G729_Word16 x0; G729_Word16 x1; } g729a_post_process_state; typedef struct _g729a_decoder_state { G729_Word32 error; /* TODO */ /*--------------------------------------------------------------------------* * dec_ld8a.c *--------------------------------------------------------------------------*/ /* Excitation vector */ G729_Word16 old_exc[L_FRAME+PIT_MAX+L_INTERPOL]; G729_Word16 *exc; /* Lsp (Line spectral pairs) */ G729_Word16 lsp_old[M]; /* Filter's memory */ G729_Word16 mem_syn[M]; G729_Word16 sharp; /* pitch sharpening of previous frame */ G729_Word16 old_T0; /* integer delay of previous frame */ G729_Word16 gain_code; /* Code gain */ G729_Word16 gain_pitch; /* Pitch gain */ G729_Word16 synth_buf[L_FRAME + M]; G729_Word16 *synth; /*--------------------------------------------------------------------------* * dec_gain.c *--------------------------------------------------------------------------*/ /* Gain predictor, Past quantized energies = -14.0 in Q10 */ G729_Word16 past_qua_en[4]; /*--------------------------------------------------------------------------* *--------------------------------------------------------------------------*/ g729a_lspdec_state lspdec_state; g729a_post_filter_state post_filter_state; g729a_post_process_state post_process_state; } g729a_decoder_state; #ifdef __cplusplus extern "C" { #endif /*--------------------------------------------------------------------------* * cod_ld8a.c * * Main decoder functions * *--------------------------------------------------------------------------*/ void g729_Init_Decod_ld8a(g729a_decoder_state * state); void g729_Decod_ld8a( g729a_decoder_state * state, G729_Word16 parm[], /* (i) : vector of synthesis parameters parm[0] = bad frame indicator (bfi) */ G729_Word16 synth[], /* (o) : synthesis speech */ G729_Word16 A_t[], /* (o) : decoded LP filter in 2 subframes */ G729_Word16 *T2, /* (o) : decoded pitch lag in 2 subframes */ G729_Word16 bad_lsf /* (i) : bad LSF indicator */ ); /*-------------------------------* * Post filter * *-------------------------------*/ void g729_Init_Post_Filter(g729a_post_filter_state * state); void g729_Post_Filter( g729a_post_filter_state * state, G729_Word16 *syn, /* in/out: synthesis speech (postfiltered is output) */ G729_Word16 *Az_4, /* input : interpolated LPC parameters in all subframes */ G729_Word16 *T /* input : decoded pitch lags in all subframes */ ); /*-------------------------------* * Post-process * *-------------------------------*/ void g729_Init_Post_Process(g729a_post_process_state * state); void g729_Post_Process( g729a_post_process_state * state, G729_Word16 signal_in[], /* Input signal */ G729_Word16 signal_out[], /* Output signal */ G729_Word16 lg /* Length of signal */ ); /*-------------------------------* * lspdec * *-------------------------------*/ void g729_Lsp_decw_reset(g729a_lspdec_state * state); void g729_D_lsp( g729a_lspdec_state * state, G729_Word16 prm[], /* (i) : indexes of the selected LSP */ G729_Word16 lsp_q[], /* (o) Q15 : Quantized LSP parameters */ G729_Word16 erase /* (i) : frame erase information */ ); /*--------------------------------------------------------------------------* * gain VQ functions. * *--------------------------------------------------------------------------*/ void g729_Dec_gain( g729a_decoder_state * state, G729_Word16 index, /* (i) : Index of quantization. */ G729_Word16 code[], /* (i) Q13 : Innovative vector. */ G729_Word16 L_subfr, /* (i) : Subframe length. */ G729_Word16 bfi, /* (i) : Bad frame indicator */ G729_Word16 *gain_pit, /* (o) Q14 : Pitch gain. */ G729_Word16 *gain_cod /* (o) Q1 : Code gain. */ ); #ifdef __cplusplus } #endif #endif /* __G729_DECODER_H__ */ /* end of file */
37.900474
87
0.495561
97589385916ff6dfb5f0b844aedd6e66cc4415e5
1,322
h
C
src/Contraction/include/gudhi/Contraction/policies/Edge_length_cost.h
jmarino/gudhi-devel
b1824e4de6fd1d037af3c1341c3065731472ffc8
[ "MIT" ]
146
2019-03-15T14:10:31.000Z
2022-03-23T21:14:52.000Z
src/Contraction/include/gudhi/Contraction/policies/Edge_length_cost.h
jmarino/gudhi-devel
b1824e4de6fd1d037af3c1341c3065731472ffc8
[ "MIT" ]
398
2019-03-07T14:55:22.000Z
2022-03-31T14:50:40.000Z
src/Contraction/include/gudhi/Contraction/policies/Edge_length_cost.h
jmarino/gudhi-devel
b1824e4de6fd1d037af3c1341c3065731472ffc8
[ "MIT" ]
51
2019-03-08T15:58:48.000Z
2022-03-14T10:23:23.000Z
/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT. * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details. * Author(s): David Salinas * * Copyright (C) 2014 Inria * * Modification(s): * - YYYY/MM Author: Description of the modification */ #ifndef CONTRACTION_POLICIES_EDGE_LENGTH_COST_H_ #define CONTRACTION_POLICIES_EDGE_LENGTH_COST_H_ #include <gudhi/Contraction/policies/Cost_policy.h> namespace Gudhi { namespace contraction { /** * @brief return a cost corresponding to the squared length of the edge */ template< typename EdgeProfile> class Edge_length_cost : public Cost_policy<EdgeProfile> { public: typedef typename Cost_policy<EdgeProfile>::Cost_type Cost_type; typedef typename EdgeProfile::Point Point; Cost_type operator()(const EdgeProfile& profile, const boost::optional<Point>& placement) const override { double res = 0; auto p0_coord = profile.p0().begin(); auto p1_coord = profile.p1().begin(); for (; p0_coord != profile.p0().end(); p0_coord++, p1_coord++) { res += (*p0_coord - *p1_coord) * (*p0_coord - *p1_coord); } return res; } }; } // namespace contraction } // namespace Gudhi #endif // CONTRACTION_POLICIES_EDGE_LENGTH_COST_H_
29.377778
108
0.708018
46adb778a1543806f38b50dd2b6346bbf836d5d9
524
h
C
SGPlayer/Classes/Core/SGAsset/SGURLSegment.h
chaocharleswang/SGPlayer
3e07a0712fdb54c208970fd8758cd8c5d8b51306
[ "MIT" ]
5
2019-11-27T10:20:00.000Z
2021-06-09T18:25:47.000Z
SGPlayer/Classes/Core/SGAsset/SGURLSegment.h
chaocharleswang/SGPlayer
3e07a0712fdb54c208970fd8758cd8c5d8b51306
[ "MIT" ]
null
null
null
SGPlayer/Classes/Core/SGAsset/SGURLSegment.h
chaocharleswang/SGPlayer
3e07a0712fdb54c208970fd8758cd8c5d8b51306
[ "MIT" ]
null
null
null
// // SGURLSegment.h // SGPlayer // // Created by Single on 2018/11/14. // Copyright © 2018 single. All rights reserved. // #import "SGSegment.h" @interface SGURLSegment : SGSegment /** * */ - (instancetype)initWithURL:(NSURL *)URL index:(NSInteger)index; /** * */ - (instancetype)initWithURL:(NSURL *)URL index:(NSInteger)index timeRange:(CMTimeRange)timeRange scale:(CMTime)scale; /** * */ @property (nonatomic, copy, readonly) NSURL *URL; /** * */ @property (nonatomic, readonly) NSInteger index; @end
15.411765
117
0.671756
942b61f283157be029b2b0c5bc1c5b54fee1ae1f
65
h
C
LogScreenDemo/LogScreen/UIWindow+LogScreen.h
creastall/LogScreen
2b04c8a4cf2dcb92ea7ffc8f1dfd793b1cdf5b60
[ "Apache-2.0" ]
2
2018-04-01T14:18:48.000Z
2018-04-03T08:34:27.000Z
LogScreenDemo/LogScreen/UIWindow+LogScreen.h
creastall/LogScreen
2b04c8a4cf2dcb92ea7ffc8f1dfd793b1cdf5b60
[ "Apache-2.0" ]
1
2018-04-02T01:33:02.000Z
2018-04-02T01:33:16.000Z
LogScreenDemo/LogScreen/UIWindow+LogScreen.h
creastall/LogScreen
2b04c8a4cf2dcb92ea7ffc8f1dfd793b1cdf5b60
[ "Apache-2.0" ]
null
null
null
#import <UIKit/UIKit.h> @interface UIWindow (LogScreen) @end
8.125
31
0.707692
f6f1f4f69b82895d3816c37f1432f0bf787abf0a
229
h
C
mountinfo.h
probonopd/qsshfs
47ff48c0a177a36540b06a1af5b9cd3571f3b292
[ "BSD-3-Clause" ]
10
2017-08-23T20:39:49.000Z
2022-03-05T22:44:25.000Z
mountinfo.h
probonopd/qsshfs
47ff48c0a177a36540b06a1af5b9cd3571f3b292
[ "BSD-3-Clause" ]
1
2017-10-19T13:01:03.000Z
2019-09-25T10:25:01.000Z
mountinfo.h
probonopd/qsshfs
47ff48c0a177a36540b06a1af5b9cd3571f3b292
[ "BSD-3-Clause" ]
4
2019-01-31T09:08:55.000Z
2020-09-14T11:53:41.000Z
#ifndef MOUNTINFO_H #define MOUNTINFO_H #include <QString> struct MountInfo { QString name; QString hostName; QString userOverwrite; QString remotePath; QString localPath; bool isValid() const; }; #endif // MOUNTINFO_H
12.722222
23
0.759825
f58f1ab95571811d8da9eeb0733d010a8385086f
418
h
C
include/lns_paint.h
echo-Mike/lnanosvg
79fe5f5f224a01e36fdeeed9120b3772b61422f3
[ "Zlib" ]
null
null
null
include/lns_paint.h
echo-Mike/lnanosvg
79fe5f5f224a01e36fdeeed9120b3772b61422f3
[ "Zlib" ]
null
null
null
include/lns_paint.h
echo-Mike/lnanosvg
79fe5f5f224a01e36fdeeed9120b3772b61422f3
[ "Zlib" ]
null
null
null
#ifndef LNS_PAINT_H__ #define LNS_PAINT_H__ /// LNS #include "lns_includes.h" #include "lns_macro.h" // Member functions LNS_LUA_MEMBER_FUNCTION(paint, toColor); LNS_LUA_MEMBER_FUNCTION(paint, toGradient); LNS_LUA_MEMBER_FUNCTION(paint, getCDecl); // Meta functions LNS_LUA_MEMBER_FUNCTION(paint, _tostring); LNS_LUA_MEMBER_FUNCTION(paint, _index); LNS_LUA_MEMBER_FUNCTION(paint, _newindex); #endif // LNS_PAINT_H__
24.588235
43
0.815789
86c06eb659a2ede680591b9e45ea4c4b22a976cb
908
h
C
sourceCode/application/ui/stackedProfilBox/dialog_addboxesautomaticdistribution_selectmethod.h
lp-rep/stackprof-1
62d9cb96ad7dcdaa26b6383559f542cadc1c7af2
[ "CECILL-B" ]
2
2022-02-27T20:08:04.000Z
2022-03-03T13:45:40.000Z
sourceCode/application/ui/stackedProfilBox/dialog_addboxesautomaticdistribution_selectmethod.h
lp-rep/stackprof-1
62d9cb96ad7dcdaa26b6383559f542cadc1c7af2
[ "CECILL-B" ]
1
2021-06-07T17:09:04.000Z
2021-06-11T11:48:23.000Z
sourceCode/application/ui/stackedProfilBox/dialog_addboxesautomaticdistribution_selectmethod.h
lp-rep/stackprof-1
62d9cb96ad7dcdaa26b6383559f542cadc1c7af2
[ "CECILL-B" ]
1
2021-06-03T21:06:55.000Z
2021-06-03T21:06:55.000Z
#ifndef DIALOG_ADDBOXESAUTOMATICDISTRIBUTION_SELECTMETHOD_H #define DIALOG_ADDBOXESAUTOMATICDISTRIBUTION_SELECTMETHOD_H #include <QDialog> namespace Ui { class Dialog_addBoxesAutomaticDistribution_selectMethod; } #include "../../logic/model/core/enum_automaticDistributionMethod.h" class Dialog_addBoxesAutomaticDistribution_selectMethod : public QDialog { Q_OBJECT public: explicit Dialog_addBoxesAutomaticDistribution_selectMethod(QWidget *parent = nullptr); ~Dialog_addBoxesAutomaticDistribution_selectMethod(); e_AutomaticDistributionMethod get_selectedMethod(); public slots: void slot_closeAsPossible_clicked(); void slot_selectDistanceBetweenBoxesCenter_clicked(); private: Ui::Dialog_addBoxesAutomaticDistribution_selectMethod *ui; e_AutomaticDistributionMethod _eAutomaticDistributionMethod; }; #endif // DIALOG_ADDBOXESAUTOMATICDISTRIBUTION_SELECTMETHOD_H
27.515152
90
0.844714
8787a5c7fddd9a0fa696fb8adf60134f564aa35b
261
c
C
code/3010.c
Tarpelite/OJ_research
5c23591a50e755dac800dfaedb561290ce35fc5b
[ "MIT" ]
null
null
null
code/3010.c
Tarpelite/OJ_research
5c23591a50e755dac800dfaedb561290ce35fc5b
[ "MIT" ]
null
null
null
code/3010.c
Tarpelite/OJ_research
5c23591a50e755dac800dfaedb561290ce35fc5b
[ "MIT" ]
null
null
null
#include<stdio.h> #include <string.h> int judge(int a) { for(int i=2;i<a;i++) { if(a%i==0) { return 1; } } return 0; } int main() { int a; scanf("%d",&a); while(1) { a++; if(judge(a)==0) { printf("%d",a); return 0; } } }
7.909091
21
0.452107
48ad5cb1f5f690723a28c0a199a161d2796907dd
2,232
h
C
curv/location.h
iplayfast/curv
e14ff67ba269c630b78be4708454fefcdbfc4378
[ "Apache-2.0" ]
null
null
null
curv/location.h
iplayfast/curv
e14ff67ba269c630b78be4708454fefcdbfc4378
[ "Apache-2.0" ]
null
null
null
curv/location.h
iplayfast/curv
e14ff67ba269c630b78be4708454fefcdbfc4378
[ "Apache-2.0" ]
null
null
null
// Copyright 2016-2018 Doug Moen // Licensed under the Apache License, version 2.0 // See accompanying file LICENSE or https://www.apache.org/licenses/LICENSE-2.0 #ifndef CURV_LOCATION_H #define CURV_LOCATION_H #include <curv/script.h> #include <curv/token.h> #include <curv/range.h> #include <curv/shared.h> #include <ostream> namespace curv { /// The place where an error occurred: the source file name, /// and a character range within that source file, spanning either a /// single token, or a parse tree node. /// /// Using this interface, a CLI tool can report an error by printing /// the filename, line/column numbers, the line of text containing the /// error with a ^ under the first character of the text range, /// and an IDE can highlight the text range containing the error. struct Location { private: Shared<const Script> script_; Token token_; public: Location(const Script& script, Token token) : script_(share(script)), token_(std::move(token)) {} /// Modify location to start at 'tok' Location starting_at(Token tok) const; /// Modify location to end at 'tok' Location ending_at(Token tok) const; /// Script where error occurred. const Script& script() const { return *script_; } /// Index of text range where error occurred. Token token() const { return token_; } /// Name of script where error occurred. const String& scriptname() const { return *script_->name_; } /// Range of characters within script where error occurred. Range<const char*> range() const; /// output the location part of an exception message (no final newline) void write(std::ostream&) const; /// Line and column information for a Location /// /// Line and column numbers begin at 0. /// [start_column_num,end_column_num) is a half-open range. /// start_line_begin is the 0 based byte index into the script of the /// start line. struct Line_Info { unsigned start_line_num; unsigned start_column_num; unsigned end_line_num; unsigned end_column_num; unsigned start_line_begin; }; Line_Info line_info() const; }; } // namespace curv #endif // header guard
28.987013
79
0.68638
ad8174b890086ab1562c3b3a967ce8b50cb3cf0d
1,042
h
C
QuickStartApp_iOS/HueSDK_iOS.framework/Versions/A/Headers/PHSoftwareUpdateStatusDeviceTypes.h
sodastsai/PhilipsHueSDK-iOS-OSX
b1d9b237e508e7e3d6396a0391a2149aa28bef3a
[ "BSD-3-Clause" ]
2
2015-01-21T08:18:45.000Z
2015-01-28T07:40:02.000Z
CTF/CTF/HueSDK_iOS.framework/Versions/A/Headers/PHSoftwareUpdateStatusDeviceTypes.h
lkuczborski/HomeKit_Workshop
566fa0b0e5acb9b05c09decf583f21cc2fa0aa66
[ "MIT" ]
null
null
null
CTF/CTF/HueSDK_iOS.framework/Versions/A/Headers/PHSoftwareUpdateStatusDeviceTypes.h
lkuczborski/HomeKit_Workshop
566fa0b0e5acb9b05c09decf583f21cc2fa0aa66
[ "MIT" ]
null
null
null
/******************************************************************************* Copyright (c) 2013-2014 Koninklijke Philips N.V. All Rights Reserved. ********************************************************************************/ #import <Foundation/Foundation.h> @interface PHSoftwareUpdateStatusDeviceTypes : NSObject <NSCopying,NSCoding> /** Flag for when bridge update is avaliable */ @property (nonatomic, strong) NSNumber *bridge; /** List of IDs of mains powered lights to be updated. */ @property (nonatomic, strong) NSArray *mainsLights; /** List of IDs of battery powered lights to be updated */ @property (nonatomic, strong) NSArray *batteryLights; /** List of IDs of mains powered sensors to be updated */ @property (nonatomic, strong) NSArray *mainsSensors; /** List of IDs of battery powered sensors to be updated */ @property (nonatomic, strong) NSArray *batterySensors; /** List of IDs of deep-sleep battery powered sensors to be updated. */ @property (nonatomic, strong) NSArray *slowSensors; @end
25.414634
82
0.62572
3944f566ade7f2467ed121888b7e76c4fe8c60c6
5,759
c
C
src/main.c
Sunnny-3n/rw-header
fe9db61ca648a9c6ebbb6f0912ccbfb337f8138d
[ "MIT" ]
3
2019-10-22T05:04:20.000Z
2020-07-25T14:50:58.000Z
src/main.c
niuyuling/rw-header
fe9db61ca648a9c6ebbb6f0912ccbfb337f8138d
[ "MIT" ]
null
null
null
src/main.c
niuyuling/rw-header
fe9db61ca648a9c6ebbb6f0912ccbfb337f8138d
[ "MIT" ]
2
2019-10-22T05:03:47.000Z
2020-04-16T14:20:33.000Z
#include "tool.h" static int offset = 0; struct map maps[mapsize]; struct args Parse_args(int argc,char * argv[]); enum tag gettag(int fd); bool isconnfd(int fd); bool isproxyfd(int fd); int another_fd(int fd); void settag(int fd,enum tag tag); void close_link(int epfd,int fd); void Deal_error_fd(int epfd,int fd); void Accepf_all_and_init_link(int epfd,int listenfd,char * paddr,int pport); int main(int argc,char * argv[]) { argc = 4; //argv[1] = "9998",argv[2] = "192.168.1.1",argv[3] = "8888"; struct args args = Parse_args(argc,argv); struct epoll_event evs[evsize]; int listenfd = Open_listenfd(args.lport), epfd = Init_epfd(); offset = listenfd; //防止管道破裂,进程被杀死 signal(SIGPIPE,SIG_IGN); Set_nonblocking(listenfd); Add_epoll_fd(epfd,listenfd,EPOLLIN | EPOLLOUT | EPOLLET); for(int epfs = 0;;){ epfs = epoll_wait(epfd,evs,evsize,-1); for(int i = 0,fd = evs[i].data.fd,ev = evs[i].events;i < epfs;i++){ if((ev & (EPOLLERR | EPOLLHUP | EPOLLRDHUP)) && (fd != listenfd)){ Deal_error_fd(epfd,fd); continue; } if((ev & (EPOLLERR | EPOLLHUP | EPOLLRDHUP)) && (fd == listenfd)) log_error_exit("listenfd:%d error",fd); if(fd == listenfd){ Accepf_all_and_init_link(epfd,fd,args.paddr,args.pport); continue; } if(isconnfd(fd) && (gettag(fd) == Connect) && (ev & EPOLLIN)){ if(isHTTP(fd)){ settag(fd,HTTP); goto HTTP; } if(isHTTPS(fd)){ settag(fd,HTTPS); goto HTTPS; } log_error("the connection isn't HTTP or HTTPS,will close " "connection"); close_link(epfd,fd); } switch(gettag(fd)){ case HTTP: HTTP: if(isconnfd(fd) && (ev & EPOLLIN)) rewrite_HTTP_header_and_send(fd,another_fd(fd)); if(isproxyfd(fd)) goto Forward; continue; case HTTPS: HTTPS: if(isconnfd(fd) && (ev & EPOLLIN)) rewrite_HTTPS_header_and_send(fd,another_fd(fd)); if(isproxyfd(fd)){ settag(fd,Forward); goto Forward; } continue; case Forward: Forward: if(ev & EPOLLIN){ int bsize = 4096 * 256; char buf[bsize]; for(int n = read(fd,buf,bsize);n > 0;n = read(fd,buf,bsize)) write(another_fd(fd),buf,n); } continue; default: continue; } } } } struct args Parse_args(int argc,char * argv[]) { struct args args; //./rw-header 9999 127.0.0.1 8888 if(argc != 4) log_error_exit("missing args.\n\ args listen_port proxy_addr proxy_port"); args.lport = atoi(argv[1]); args.paddr = argv[2]; args.pport = atoi(argv[3]); return args; } static int pos(int fd) { return fd - offset; } bool isconnfd(int fd) { if(maps[pos(fd)].connfd == fd) return true; else return false; } bool isproxyfd(int fd) { if(maps[pos(fd)].proxyfd == fd) return true; else return false; } int another_fd(int fd) { if(isconnfd(fd)) return maps[pos(fd)].proxyfd; if(isproxyfd(fd)) return maps[pos(fd)].connfd; return -1; } enum tag gettag(int fd) { return maps[pos(fd)].tag; } void Deal_error_fd(int epfd,int fd) { if(isconnfd(fd)) log_warn("localfd:%d is closed and will close proxyfd:%d", fd, another_fd(fd)); if(isproxyfd(fd)) log_warn("proxyfd:%d is closed and will close localfd:%d", fd, another_fd(fd)); Del_epoll_fd(epfd,fd); Close(fd); Del_epoll_fd(epfd,another_fd(fd)); Close(another_fd(fd)); } void print_fd_host_addr(int fd,struct sockaddr_in addr) { char hbuf[INET_ADDRSTRLEN]; inet_ntop(AF_INET, &addr.sin_addr, hbuf, sizeof(hbuf)); log_info("accept fd %d %s:%d",fd,hbuf,addr.sin_port); } void settag(int fd,enum tag tag) { maps[pos(fd)].tag = tag; maps[pos(another_fd(fd))].tag = tag; } static void setlink(int connfd,int proxyfd) { maps[pos(connfd)].connfd = connfd; maps[pos(connfd)].proxyfd = proxyfd; maps[pos(proxyfd)].connfd = connfd; maps[pos(proxyfd)].proxyfd = proxyfd; } void Init_link(int connfd,char * paddr,int pport) { int proxyfd = Open_clientfd(paddr,pport); Set_nonblocking(connfd); Set_nonblocking(proxyfd); setlink(connfd,proxyfd); settag(connfd,Connect); } void Accepf_all_and_init_link(int epfd,int listenfd,char * paddr,int pport) { struct sockaddr_in addr; socklen_t len = sizeof(addr); for(;;){ int connfd = accept(listenfd,(SA *)&addr,&len); if(connfd == -1){ if((errno == EAGAIN) || (errno == EWOULDBLOCK)) break; else log_strerror(); } print_fd_host_addr(connfd,addr); Init_link(connfd,paddr,pport); Add_epoll_fd(epfd,connfd,EPOLLIN | EPOLLET); Add_epoll_fd(epfd,another_fd(connfd),EPOLLIN | EPOLLET); } } void close_link(int epfd,int fd) { int anotherfd = another_fd(fd); Del_epoll_fd(epfd,fd); Del_epoll_fd(epfd,anotherfd); Close(fd); Close(anotherfd); log_info("close link fd:%d fd:%d",fd,anotherfd); }
26.539171
80
0.542976
fbd154e928ec5f5c0ceb38cc44a440f34e2f645b
896
c
C
src/axl_glibc/axl_memcpy.c
vovkos/axl
5969bfda2fdfbb04a081dde16dcde0c5ddef0654
[ "MIT" ]
2
2021-03-19T09:32:02.000Z
2021-12-30T11:22:56.000Z
src/axl_glibc/axl_memcpy.c
vovkos/axl
5969bfda2fdfbb04a081dde16dcde0c5ddef0654
[ "MIT" ]
3
2019-04-19T19:20:59.000Z
2021-07-16T10:08:05.000Z
src/axl_glibc/axl_memcpy.c
vovkos/axl
5969bfda2fdfbb04a081dde16dcde0c5ddef0654
[ "MIT" ]
3
2019-04-19T18:19:52.000Z
2021-06-15T00:31:36.000Z
//.............................................................................. // // This file is part of the AXL library. // // AXL is distributed under the MIT license. // For details see accompanying license.txt file, // the public copy of which is also available at: // http://tibbo.com/downloads/archive/axl/license.txt // //.............................................................................. #include <string.h> #if (defined __amd64__) __asm__(".symver memcpy, memcpy@GLIBC_2.2.5"); #elif (defined __i386__) __asm__(".symver memcpy, memcpy@GLIBC_2.0"); #else # error unsupported CPU architecture #endif //.............................................................................. void* __wrap_memcpy( void* dst, const void *src, size_t size ) { return memcpy(dst, src, size); } //..............................................................................
26.352941
80
0.453125
0671a996ad3abfb5a6633b7e1fbf897bad294639
1,289
h
C
baseVideo/avd_sdk.framework/Headers/AVDFakeAudioCapturer.h
ZhangQiJin/videoChat
a930f1ca7114b4c23c7359ea5e99732ad5113646
[ "MIT" ]
1
2020-12-25T03:30:47.000Z
2020-12-25T03:30:47.000Z
baseVideo/avd_sdk.framework/Headers/AVDFakeAudioCapturer.h
ZhangQiJin/videoChat
a930f1ca7114b4c23c7359ea5e99732ad5113646
[ "MIT" ]
1
2020-07-05T14:45:17.000Z
2021-01-24T04:39:06.000Z
baseVideo/avd_sdk.framework/Headers/AVDFakeAudioCapturer.h
ZhangQiJin/videoChat
a930f1ca7114b4c23c7359ea5e99732ad5113646
[ "MIT" ]
null
null
null
// // AVDFakeAudioCapturer.h // avd_sdk // // Created by skin on 15-7-21. // Copyright (c) 2015年 t3ee. All rights reserved. // #ifndef avd_sdk_AVDFakeAudioCapturer_h #define avd_sdk_AVDFakeAudioCapturer_h #import "AVDCommon.h" /** * 音频流导入接口. * * 音频导入相关功能接口。 */ @interface AVDFakeAudioCapturer : NSObject /** 获取一个音频采集器对象 * @return 音频采集器对象指针。 * @note 音频采集器整个引擎对象只有一个,为所有房间共用; */ + (AVDFakeAudioCapturer*) instance; /** 释放音频采集器对象, 空操作,此对象的生命期管理转到内部控制 */ + (AVDResult) destory; /** 判断Capturer是否正在运行 * @return 是否在运行。 */ - (BOOL) isRunning; /** 当前AVD引擎使用音频导入作为缺省音频源 * @return 返回错误代码: * AVD_OK 成功 */ - (AVDResult) enable:(BOOL)isEnable; /** 给Capturer输入PCM原始数据 * * @param[in] pts 时间戳, nanos second。 * @param[in] sampleRate 音频采样率 * @param[in] channels 音频采集通道数 * @param[in] sample 音频内容数据指针 * @return 返回错误代码: * AVD_OK 成功 * Err_Invalid_Arg 参数不合法,可忽略 * Err_Wrong_Status 状态不对,可忽略 */ - (AVDResult) inputCapturedFrame:(NSData*)sample sampleRate:(NSInteger)sampleRate channels:(NSInteger)channels pts:(NSInteger)pts; #ifndef DOXYGEN_SHOULD_SKIP_THIS // Disallow init and don't add to documentation - (id)init __attribute__(( unavailable("init is not a supported initializer for this class."))); #endif /* DOXYGEN_SHOULD_SKIP_THIS */ @end #endif
19.830769
130
0.708301
06b3fa9990f371e333bc40987d0f0df548b25b46
2,419
h
C
include/il2cpp/Dpr/Contest/ResultSection.h
martmists-gh/BDSP
d6326c5d3ad9697ea65269ed47aa0b63abac2a0a
[ "MIT" ]
1
2022-01-15T20:20:27.000Z
2022-01-15T20:20:27.000Z
include/il2cpp/Dpr/Contest/ResultSection.h
martmists-gh/BDSP
d6326c5d3ad9697ea65269ed47aa0b63abac2a0a
[ "MIT" ]
null
null
null
include/il2cpp/Dpr/Contest/ResultSection.h
martmists-gh/BDSP
d6326c5d3ad9697ea65269ed47aa0b63abac2a0a
[ "MIT" ]
null
null
null
#pragma once #include "il2cpp.h" void Dpr_Contest_ResultSection__SetScriptableObject (Dpr_Contest_ResultSection_o* __this, Dpr_Contest_ResultSettings_o* resultSettings, const MethodInfo* method_info); void Dpr_Contest_ResultSection__Initialize (Dpr_Contest_ResultSection_o* __this, const MethodInfo* method_info); void Dpr_Contest_ResultSection__ResetParam (Dpr_Contest_ResultSection_o* __this, const MethodInfo* method_info); void Dpr_Contest_ResultSection__OnFinalize (Dpr_Contest_ResultSection_o* __this, const MethodInfo* method_info); bool Dpr_Contest_ResultSection__get_IsRestart (Dpr_Contest_ResultSection_o* __this, const MethodInfo* method_info); bool Dpr_Contest_ResultSection__get_IsReady (Dpr_Contest_ResultSection_o* __this, const MethodInfo* method_info); void Dpr_Contest_ResultSection__Setup (Dpr_Contest_ResultSection_o* __this, bool isTutorial, const MethodInfo* method_info); void Dpr_Contest_ResultSection__LoadResource (Dpr_Contest_ResultSection_o* __this, int32_t resultID, const MethodInfo* method_info); void Dpr_Contest_ResultSection__StartSection (Dpr_Contest_ResultSection_o* __this, Dpr_Contest_ResultDataModel_o* resultDataModel, const MethodInfo* method_info); System_Collections_IEnumerator_o* Dpr_Contest_ResultSection__IE_StartSection (Dpr_Contest_ResultSection_o* __this, int32_t firstState, const MethodInfo* method_info); bool Dpr_Contest_ResultSection__UpdateSection (Dpr_Contest_ResultSection_o* __this, float deltaTime, const MethodInfo* method_info); void Dpr_Contest_ResultSection__UpdateAnnouncement (Dpr_Contest_ResultSection_o* __this, float deltaTime, const MethodInfo* method_info); void Dpr_Contest_ResultSection__UpdateTotalScores (Dpr_Contest_ResultSection_o* __this, float deltaTime, const MethodInfo* method_info); void Dpr_Contest_ResultSection__UpdatePersonalPerformance (Dpr_Contest_ResultSection_o* __this, const MethodInfo* method_info); void Dpr_Contest_ResultSection__UpdateTutorialMode (Dpr_Contest_ResultSection_o* __this, float deltaTime, const MethodInfo* method_info); void Dpr_Contest_ResultSection__ChangeState (Dpr_Contest_ResultSection_o* __this, int32_t stateID, const MethodInfo* method_info); Dpr_Contest_RankGaugeData_o* Dpr_Contest_ResultSection__CreateRankGaugeData (Dpr_Contest_ResultSection_o* __this, const MethodInfo* method_info); void Dpr_Contest_ResultSection___ctor (Dpr_Contest_ResultSection_o* __this, const MethodInfo* method_info);
105.173913
167
0.884663
19e4ae739b8efadae0242fdca16c437b64141f73
170
h
C
ToasterFramework/game.h
metalhead1998/ToasterFramework
1045301b8e7e8b355d5751c75f3a00853e929ef6
[ "Unlicense" ]
null
null
null
ToasterFramework/game.h
metalhead1998/ToasterFramework
1045301b8e7e8b355d5751c75f3a00853e929ef6
[ "Unlicense" ]
null
null
null
ToasterFramework/game.h
metalhead1998/ToasterFramework
1045301b8e7e8b355d5751c75f3a00853e929ef6
[ "Unlicense" ]
null
null
null
#ifdef GAME_H #define GAME_H //SDL headers #include <SDL2/SDL.h> //Custom headers #include "gamestates.h" class Game { public: Game (); int Run (); }; #endif
9.444444
23
0.641176
e87c9e73425792f4fefe1e508dd1a89c6b031b4e
2,867
c
C
src/c2p.c
flynn-nrg/tornado-amiga
bb973063b44ee217b7c9b6f9afcdf4bd1e0beee9
[ "BSD-2-Clause" ]
31
2019-06-23T15:16:45.000Z
2022-02-18T16:45:42.000Z
src/c2p.c
flynn-nrg/tornado-amiga
bb973063b44ee217b7c9b6f9afcdf4bd1e0beee9
[ "BSD-2-Clause" ]
1
2019-10-26T18:11:37.000Z
2019-10-26T18:11:37.000Z
src/c2p.c
flynn-nrg/tornado-amiga
bb973063b44ee217b7c9b6f9afcdf4bd1e0beee9
[ "BSD-2-Clause" ]
5
2019-10-26T12:48:39.000Z
2021-12-01T20:16:07.000Z
#include <assert.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include "c2p.h" #include "ptr_bridges.h" #define c2p_merge_one(x, y, t, s, m) \ t = y; \ t >>= s; \ t ^= x; \ t &= m; \ x ^= t; \ t <<= s; \ y ^= t; #define c2p_merge_one_16(x,y,t) c2p_merge_one(x, y, t, 16, 0x0000ffff) #define c2p_merge_one_8(x,y,t) c2p_merge_one(x, y, t, 8, 0x00ff00ff) #define c2p_merge_one_4(x,y,t) c2p_merge_one(x, y, t, 4, 0x0f0f0f0f) #define c2p_merge_one_2(x,y,t) c2p_merge_one(x, y, t, 2, 0x33333333) #define c2p_merge_one_1(x,y,t) c2p_merge_one(x, y, t, 1, 0x55555555) void c2p_8bpl_scanline( __ASMPARM("d0", int pixels), __ASMPARM("a0", uint32_t *chunky), __ASMPARM("a1", uint32_t *planar), __ASMPARM("d1", uint32_t planar_planemod), // bytes between each plane __ASMPARM("d2", uint32_t planar_wordmod) // bytes between each 32pixel word ) { assert((pixels % 32) == 0); assert((planar_planemod % 4) == 0); assert((planar_wordmod % 4) == 0); uint32_t *chunky_end = chunky + pixels / 4; planar_planemod /= 4; planar_wordmod /= 4; uint32_t d0,d1,d2,d3,d4,d5,d6,d7; uint32_t tmp1; while (chunky < chunky_end) { { uint32_t t = *chunky++; d0 = ENDI4(t); } { uint32_t t = *chunky++; d1 = ENDI4(t); } { uint32_t t = *chunky++; d2 = ENDI4(t); } { uint32_t t = *chunky++; d3 = ENDI4(t); } { uint32_t t = *chunky++; d4 = ENDI4(t); } { uint32_t t = *chunky++; d5 = ENDI4(t); } { uint32_t t = *chunky++; d6 = ENDI4(t); } { uint32_t t = *chunky++; d7 = ENDI4(t); } c2p_merge_one_4(d0, d1, tmp1); c2p_merge_one_4(d2, d3, tmp1); c2p_merge_one_4(d4, d5, tmp1); c2p_merge_one_4(d6, d7, tmp1); c2p_merge_one_16(d0, d4, tmp1); c2p_merge_one_16(d1, d5, tmp1); c2p_merge_one_16(d2, d6, tmp1); c2p_merge_one_16(d3, d7, tmp1); c2p_merge_one_2(d0, d4, tmp1); c2p_merge_one_2(d1, d5, tmp1); c2p_merge_one_2(d2, d6, tmp1); c2p_merge_one_2(d3, d7, tmp1); c2p_merge_one_8(d0, d2, tmp1); c2p_merge_one_8(d1, d3, tmp1); c2p_merge_one_8(d4, d6, tmp1); c2p_merge_one_8(d5, d7, tmp1); c2p_merge_one_1(d0, d2, tmp1); c2p_merge_one_1(d1, d3, tmp1); c2p_merge_one_1(d4, d6, tmp1); c2p_merge_one_1(d5, d7, tmp1); planar[0 * planar_planemod] = ENDI4(d7); planar[1 * planar_planemod] = ENDI4(d5); planar[2 * planar_planemod] = ENDI4(d3); planar[3 * planar_planemod] = ENDI4(d1); planar[4 * planar_planemod] = ENDI4(d6); planar[5 * planar_planemod] = ENDI4(d4); planar[6 * planar_planemod] = ENDI4(d2); planar[7 * planar_planemod] = ENDI4(d0); planar += planar_wordmod; } }
31.855556
82
0.580746
e5ed8dc43ae182c235012c01af31300a1343a44f
523
h
C
CustomAlertViewDemo/CustomAlertViewDemo/CustomButtonDemo/CustomButton/CustomButton.h
PengSiSi/CustomDemo
9077e03d7e2df165a484ba27f033b8c1c93082ab
[ "MIT" ]
null
null
null
CustomAlertViewDemo/CustomAlertViewDemo/CustomButtonDemo/CustomButton/CustomButton.h
PengSiSi/CustomDemo
9077e03d7e2df165a484ba27f033b8c1c93082ab
[ "MIT" ]
null
null
null
CustomAlertViewDemo/CustomAlertViewDemo/CustomButtonDemo/CustomButton/CustomButton.h
PengSiSi/CustomDemo
9077e03d7e2df165a484ba27f033b8c1c93082ab
[ "MIT" ]
null
null
null
// // CustomButton.h // WisdomClass_teacher // // Created by 思 彭 on 2017/9/18. // Copyright © 2017年 思 彭. All rights reserved. // 自定义左边文字,右边图片的Button // 会随着文字多少变化图片跟着变化,需要注意的是:在设置完 Button 的文字之后,要重新设置Button 的中心点位置。 #import <UIKit/UIKit.h> typedef NS_ENUM(NSInteger, ButtonType) { LeftTextRightImage = 0, // 左边文字,右边图片 LeftImageRightText, // 左图片,右文字 TopTextBottomImage, // 上文字,下图片 TopImageBottomText // 上图片,下文字 }; @interface CustomButton : UIButton @property (nonatomic, assign) ButtonType type; @end
20.92
63
0.715105
b28aa19a91603329d01d7a8776044819fecf60fb
1,481
h
C
lib/include/filesystem/fat/DirectoryEntry.h
bli19/stm32plus
fdf0b74bd8df95c4b0085e1e03b461ea5ca48d86
[ "BSD-3-Clause" ]
1
2015-10-31T09:01:16.000Z
2015-10-31T09:01:16.000Z
lib/include/filesystem/fat/DirectoryEntry.h
bli19/stm32plus
fdf0b74bd8df95c4b0085e1e03b461ea5ca48d86
[ "BSD-3-Clause" ]
null
null
null
lib/include/filesystem/fat/DirectoryEntry.h
bli19/stm32plus
fdf0b74bd8df95c4b0085e1e03b461ea5ca48d86
[ "BSD-3-Clause" ]
null
null
null
/* * This file is a part of the open source stm32plus library. * Copyright (c) 2011,2012,2013 Andy Brown <www.andybrown.me.uk> * Please see website for licensing terms. */ #pragma once namespace stm32plus { namespace fat { /** * FAT directory entry. There are no data members here, just the union of the short and long directory entry * implementations. */ struct DirectoryEntry { /** * Attributes in a directory entry */ enum { /// Entry is read only ATTR_READ_ONLY = 0x1, /// Entry is hidden ATTR_HIDDEN = 0x2, /// Entry is a system file ATTR_SYSTEM = 0x4, /// Entry is the volume label ATTR_VOLUME_ID = 0x8, /// Entry is a directory ATTR_DIRECTORY = 0x10, /// Entry has been archived ATTR_ARCHIVE = 0x20, /// The special combination that indicates a long name entry ATTR_LONG_NAME = ATTR_READ_ONLY | ATTR_HIDDEN | ATTR_SYSTEM | ATTR_VOLUME_ID, /// The long name mask ATTR_LONG_NAME_MASK = ATTR_READ_ONLY | ATTR_HIDDEN | ATTR_SYSTEM | ATTR_VOLUME_ID | ATTR_DIRECTORY | ATTR_ARCHIVE, /// The special bit that is set to indicate the last ordinal in a long name sequence LAST_LONG_ENTRY = 0x40 }; /** * The 32 byte structure itself */ union { ShortDirectoryEntry sdir; LongDirectoryEntry ldir; }; }; } }
23.140625
122
0.605672
c7efb0f95a416ceb6dcdcc867701cd7f82567462
1,817
c
C
gui/xdraw.d.c
voutilad/oxbar
37fbca62e83cb4bfd4450d40ba18da97969d8c80
[ "0BSD" ]
41
2018-11-14T18:00:47.000Z
2022-01-02T13:03:06.000Z
gui/xdraw.d.c
voutilad/oxbar
37fbca62e83cb4bfd4450d40ba18da97969d8c80
[ "0BSD" ]
4
2018-12-13T09:37:23.000Z
2020-03-23T14:14:53.000Z
gui/xdraw.d.c
voutilad/oxbar
37fbca62e83cb4bfd4450d40ba18da97969d8c80
[ "0BSD" ]
2
2020-06-17T19:55:00.000Z
2021-03-08T08:31:14.000Z
/* * Copyright (c) 2018 Ryan Flannery <ryan.flannery@gmail.com> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include <stdio.h> #include "xdraw.h" void pause() { printf("press ENTER to continue"); getchar(); } int main() { struct xdisp *x = xdisp_init(); struct xfont *f; printf("display: %x x %x (pixels)\n", x->display_width, x->display_height); struct xfont_settings fonts = { .desc = "serif italic 20", .fgcolor = "ff0000" }; f = xfont_init(&fonts); struct xwin_settings wins = { .bgcolor = "#ff0000", .wname = "xcore.d :: xwin test", .x = 500, .y = 500, .w = 500, .h = 500 }; struct padding padding = { .top = 10, .right = 10, .bottom = 10, .left = 10 }; struct xwin *w = xwin_init(x, &wins); struct xctx *root = xctx_init_root(f, w, L2R, &padding); xwin_push(w); xdraw_colorfill(root, "#ffffff"); xdraw_printf(root, "#ff0000", "Hello world!"); xwin_pop(w); pause(); xwin_push(w); xdraw_colorfill(root, "#ffffff"); xdraw_printf(root, "#00ff00", "Hello world!"); xwin_pop(w); pause(); printf("bye\n"); xctx_free(root); xwin_free(w); xdisp_free(x); return 0; }
22.7125
76
0.681893
2431b276f225693e01a314d472905e60a6554e50
1,634
h
C
code_reading/oceanbase-master/src/sql/rewrite/ob_query_range_provider.h
wangcy6/weekly_read
3a8837ee9cd957787ee1785e4066dd623e02e13a
[ "Apache-2.0" ]
null
null
null
code_reading/oceanbase-master/src/sql/rewrite/ob_query_range_provider.h
wangcy6/weekly_read
3a8837ee9cd957787ee1785e4066dd623e02e13a
[ "Apache-2.0" ]
null
null
null
code_reading/oceanbase-master/src/sql/rewrite/ob_query_range_provider.h
wangcy6/weekly_read
3a8837ee9cd957787ee1785e4066dd623e02e13a
[ "Apache-2.0" ]
1
2020-10-18T12:59:31.000Z
2020-10-18T12:59:31.000Z
/** * Copyright (c) 2021 OceanBase * OceanBase CE is licensed under Mulan PubL v2. * You can use this software according to the terms and conditions of the Mulan PubL v2. * You may obtain a copy of Mulan PubL v2 at: * http://license.coscl.org.cn/MulanPubL-2.0 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. * See the Mulan PubL v2 for more details. */ #ifndef OCEANBASE_SQL_REWRITE_QUERY_RANGE_PROVIDER_ #define OCEANBASE_SQL_REWRITE_QUERY_RANGE_PROVIDER_ #include "lib/container/ob_array.h" #include "lib/container/ob_se_array.h" #include "common/ob_range.h" namespace oceanbase { namespace common { class ObDataTypeCastParams; } namespace sql { class ColumnItem; typedef common::ObSEArray<common::ObNewRange*, 1, common::ModulePageAllocator, true> ObQueryRangeArray; typedef common::ObSEArray<common::ObNewRange, 4, common::ModulePageAllocator, true> ObRangesArray; typedef common::ObSEArray<bool, 2, common::ModulePageAllocator, true> ObGetMethodArray; typedef common::ObSEArray<ColumnItem, 16, common::ModulePageAllocator, true> ColumnArray; class ObQueryRangeProvider { public: virtual int get_tablet_ranges( ObQueryRangeArray& ranges, ObGetMethodArray& get_methods, const common::ObDataTypeCastParams& dtc_params) = 0; // to string virtual int64_t to_string(char* buf, const int64_t buf_len) const = 0; }; } // namespace sql } // namespace oceanbase #endif // OCEANBASE_SQL_REWRITE_QUERY_RANGE_PROVIDER_ //// end of header file
38
116
0.776622
b5cb2937f6fdcd072c3db05291eea5176b6ba1d5
482
c
C
Week 5/5_9.c
Bharat123rox/DataStructures-Algorithms-Assignments
4936f377337400e2653bde2d415c443e579ef738
[ "MIT" ]
1
2020-02-22T04:36:10.000Z
2020-02-22T04:36:10.000Z
Week 5/5_9.c
Bharat123rox/DataStructures-Algorithms-Assignments
4936f377337400e2653bde2d415c443e579ef738
[ "MIT" ]
null
null
null
Week 5/5_9.c
Bharat123rox/DataStructures-Algorithms-Assignments
4936f377337400e2653bde2d415c443e579ef738
[ "MIT" ]
null
null
null
#include <stdio.h> #include <stdlib.h> #define ll long long #define f(i,a,b) for(i=a;i<b;i++) #define fd(i,b,a) for(i=b;i>=a;i--) #define nl '\n' int main() { int n,i; scanf("%d",&n); int a[n]; int max=-99; f(i,0,n) { scanf("%d",&a[i]); if(max<a[i]) { max=a[i]; } } int fre[max+1]; f(i,0,max+1) fre[i]=0; f(i,0,n) fre[a[i]]++; int fl=0; f(i,0,n) { if(fre[a[i]]&1) { fl=1; break; } } if(fl) printf("Vishal\n"); else printf("Tanmay\n"); return 0; }
14.176471
35
0.504149
ec18960d573cc756e9f4730cac1f4566f5612507
903
h
C
src/bucket/BucketOutputIterator.h
viichain/vii-core
2e5b794fb71e1385a2b5bc96920b5a69d4d8560f
[ "Apache-2.0", "BSD-2-Clause", "MIT", "ECL-2.0", "BSL-1.0", "BSD-3-Clause" ]
null
null
null
src/bucket/BucketOutputIterator.h
viichain/vii-core
2e5b794fb71e1385a2b5bc96920b5a69d4d8560f
[ "Apache-2.0", "BSD-2-Clause", "MIT", "ECL-2.0", "BSL-1.0", "BSD-3-Clause" ]
null
null
null
src/bucket/BucketOutputIterator.h
viichain/vii-core
2e5b794fb71e1385a2b5bc96920b5a69d4d8560f
[ "Apache-2.0", "BSD-2-Clause", "MIT", "ECL-2.0", "BSL-1.0", "BSD-3-Clause" ]
null
null
null
#pragma once #include "bucket/BucketManager.h" #include "bucket/LedgerCmp.h" #include "util/XDRStream.h" #include "xdr/vii-ledger.h" #include <memory> #include <string> namespace viichain { class Bucket; class BucketManager; class BucketOutputIterator { protected: std::string mFilename; XDROutputFileStream mOut; BucketEntryIdCmp mCmp; std::unique_ptr<BucketEntry> mBuf; std::unique_ptr<SHA256> mHasher; size_t mBytesPut{0}; size_t mObjectsPut{0}; bool mKeepDeadEntries{true}; BucketMetadata mMeta; bool mPutMeta{false}; MergeCounters& mMergeCounters; public: BucketOutputIterator(std::string const& tmpDir, bool keepDeadEntries, BucketMetadata const& meta, MergeCounters& mc); void put(BucketEntry const& e); std::shared_ptr<Bucket> getBucket(BucketManager& bucketManager); }; }
21.5
101
0.69103
5775091f5b8e69baaa3217a13c07c655808db627
9,701
h
C
src/torch/lib/include/torch/csrc/jit/tracer.h
warcraft12321/Hyperfoods
b995cd7afe10fcbd338158c80f53ce637bfffc0c
[ "MIT" ]
51
2020-01-26T23:32:57.000Z
2022-03-20T14:49:57.000Z
src/torch/lib/include/torch/csrc/jit/tracer.h
warcraft12321/Hyperfoods
b995cd7afe10fcbd338158c80f53ce637bfffc0c
[ "MIT" ]
2
2020-12-19T20:00:28.000Z
2021-03-03T20:22:45.000Z
src/torch/lib/include/torch/csrc/jit/tracer.h
warcraft12321/Hyperfoods
b995cd7afe10fcbd338158c80f53ce637bfffc0c
[ "MIT" ]
33
2020-02-18T16:15:48.000Z
2022-03-24T15:12:05.000Z
#pragma once #include "torch/csrc/jit/ir.h" #include "torch/csrc/jit/tracer_state.h" #include "torch/csrc/assertions.h" #include "torch/csrc/utils/functional.h" #include "torch/csrc/utils/variadic.h" #include "torch/csrc/autograd/function_hook.h" #include "torch/csrc/autograd/variable.h" #include "torch/csrc/utils/auto_unique_ptr.h" #include <memory> #include <mutex> #include <vector> #include <iostream> #include <cstdint> #include <unordered_map> namespace torch { namespace jit { namespace tracer { using torch::autograd::Variable; using variable_list = std::vector<Variable>; namespace detail { inline ValueTracingStateElem* getValueState(const std::shared_ptr<TracingState>& state, const Variable& var, bool alloc = true) { auto& tracing_state = var.tracing_state(); for (auto it = tracing_state.begin(); it != tracing_state.end();) { auto ts = it->state.lock(); // GC of invalidated tracing states if (!ts) { auto current_it = it++; tracing_state.erase(current_it); continue; } else if (ts == state) { return &(*it); } ++it; } if (alloc) { tracing_state.emplace_front(); auto & vts = tracing_state.front(); vts.state = state; return &vts; } else { return nullptr; } } inline bool isElemActive(const ValueTracingStateElem& vts) { auto state = vts.state.lock(); return state && state->active; } } // namespace detail // This is meant to be used as a thread local place, where we can store extra // info that gets lost when we call into ATen from Python bindings. One example // for when this happens is when we get an IntList argument with e.g. sizes for // view. When tracing, those might be tensors, which let us encode extra data // dependencies, but once they get to the ATen call where we actually have the // tracing logic, they get converted into a raw IntList, and we loose all // information. To prevent this, we temporarily stash it in here. struct ArgumentStash { struct IntListTrace : std::vector<Value*> { IntListTrace(int size) : std::vector<Value*>(size, nullptr) {} }; static bool empty() { return stash.intlists.empty(); } static void stashIntListElem(const std::string& arg_name, size_t size, size_t idx, const Variable& var); static bool hasIntList(const std::string& arg_name) { return stash.intlists.count(arg_name) > 0; } static IntListTrace popIntList(const std::string& arg_name) { auto info = std::move(stash.intlists.at(arg_name)); stash.intlists.erase(arg_name); return info; } private: static thread_local ArgumentStash stash; std::unordered_map<std::string, IntListTrace> intlists; }; // Should a function which takes 'vars' as inputs be traced? // It suffices for ONE variable to be tracing: any "untraced" variables // are treated as constants. // // NB: This code lives in the hotpath; make sure it is fast // // NB: Variable overload is not variadic because we don't actually // need it (in most cases if we have a variable_list it is already // flattened). inline bool isTracingVar(const Variable& var) { if (!var.defined() || !var.has_tracing_state()) return false; return std::any_of(var.tracing_state().begin(), var.tracing_state().end(), detail::isElemActive); } inline bool isTracingVar(at::ArrayRef<Variable> vars) { // Reference to avoid refcount bump for (const Variable& var : vars) { if (isTracingVar(var)) return true; } return false; } struct IsTracing : IterArgs<IsTracing> { bool out = false; using IterArgs<IsTracing>::operator(); void operator()(const at::Tensor& var) { out = out || isTracingVar(var); } bool short_circuit() { return out; } }; // To be called with Tensor arguments from generated code template<typename... Args> inline bool isTracing(Args&&... args) { return IsTracing().apply(std::forward<Args>(args)...).out; } // Retrieve the tracing state which a function applied with 'vars' should // be recorded to. Precondition: isTracing(vars) == true. At the moment, // we don't support mixing up variables from different traces; this code // will need to be revisited if that ever becomes supported. inline std::shared_ptr<TracingState> getTracingState(const variable_list& vars) { std::shared_ptr<TracingState> state; for (auto& var : vars) { if (!var.defined() || !var.has_tracing_state()) continue; for (auto & vts : var.tracing_state()) { auto var_state = vts.state.lock(); if (!var_state || !var_state->active) continue; if (!state) state = var_state; JIT_ASSERT(var_state == state); } } JIT_ASSERT(state); return state; } // Having finished adding a new 'node' to the graph IR owned by TracingState 'state', // 'setValueTrace' associates this node with an output variable, so that further operations // involving this variable know which node in the IR to reference. inline void setValueTrace(const std::shared_ptr<TracingState>& state, const Variable& var, Value *value) { JIT_ASSERT(var.defined()); auto vts = detail::getValueState(state, var); vts->trace = value; } // Given a variable 'var', return the 'node' which represents the instruction // which computes the value of this variable in the IR. When 'mustExist' is // false, we interpret untraced variables as constants that are just embedded // in the graph. This is useful to handle code which does things like this // (from torch.autograd.variable): // // def mm(self, matrix): // output = Variable(self.data.new(self.data.size(0), matrix.data.size(1))) // return Addmm.apply(output, self, matrix, 0, 1, True) // // Here, mm fakes up a dummy variable with uninitialized data to do an inplace // update on, but subsequently ignores it because the alpha scaling factor is zero. // This is one of the cases where a Variable can be created inside of a trace, and // if we treat it as a constant, everything will work out. inline Value* getValueTrace(const std::shared_ptr<TracingState>& state, const Variable& var) { if (!var.defined()) { Node *n = state->graph->createUndefined(); return state->graph->appendNode(n)->output(); } auto vts = detail::getValueState(state, var, true); if (vts->trace) return vts->trace; Value *constant = state->graph->appendNode(state->graph->createConstant(var.data()))->output(); constant->inferTypeFrom(var.data()); setValueTrace(state, var, constant); return constant; } inline Value* getOutputTrace(const std::shared_ptr<TracingState>& state, const Variable& var, size_t output_no) { if (!var.defined()) { Node *n = state->graph->createUndefined(); return state->graph->appendNode(n)->output(); } auto vts = detail::getValueState(state, var, false); if (!vts) { std::ostringstream os; os << "output " << output_no << " of traced region did not have observable " << "data dependence with trace inputs; this probably indicates your program " << "cannot be understood by the tracer."; throw std::runtime_error(os.str()); } return vts->trace; } // Start tracing, treating 'inputs' as inputs to the trace, which can be // varied on subsequent invocations of the trace. Any other variables // will be treated as constants. // // NB: Why does this take an rvalue reference? We need to get a non-const // reference to at::Tensor buffer to call unsafeGetTH, but you can't get this // out of a const vector (silly std::vector...) inline std::pair<std::shared_ptr<TracingState>, variable_list> enter( variable_list inputs) { auto state = std::make_shared<TracingState>(); for (auto& input : inputs) { auto * value_state = detail::getValueState(state, input, false); if (value_state) { // See Note [Repeated inputs] in tracer.cpp input = input.view(input.sizes()); } auto input_node = state->graph->addInput(input.name()); setValueTrace(state, input, input_node); input_node->inferTypeFrom(input.data()); } return std::make_pair(state, inputs); } // Exit a trace, treating 'outputs' as the outputs of the trace. These // are the variables whose values will be computed upon subsequent // invocations of the trace. inline void exit(const variable_list& outputs) { auto state = getTracingState(outputs); size_t i = 0; for (auto& output : outputs) { state->graph->registerOutput(getOutputTrace(state, output, i)); i++; } state->active = false; } // Pre-recorded information about the trace before we actually carry // out the trace struct PreTraceInfo { std::shared_ptr<TracingState> state; Node *n; }; PreTraceInfo preRecordTrace(Symbol op, at::ArrayRef<Variable> inputs); void postRecordTrace(const PreTraceInfo& info, at::ArrayRef<Variable> outputs); autograd::Variable getSizeOf(const autograd::Variable& var, int64_t dim); void recordSourceLocation(Node* n); void setRecordSourceLocation(void (*v)(Node*)); // We must record the nodes of inputs before we actually carry out // the operation, because an inplace operation may destroy the information // we're interested in. See #4480. template<typename F> PreTraceInfo makePreTraceInfo(at::ArrayRef<Variable> inputs, F ctor) { PreTraceInfo info; info.state = getTracingState(inputs); auto& graph = info.state->graph; auto state_lock = info.state->lock(); Node *n = ctor(info.state, *graph); recordSourceLocation(n); for (Variable input : inputs) { n->addInput(getValueTrace(info.state, input)); } // NB: Order matters. This must append after inputs but before outputs. graph->appendNode(n); info.n = n; return info; } }}} // namespace torch::jit::tracer
34.400709
129
0.700134
f1d4c55adee0bb2ce5a2b943344095c88cb121e4
9,524
h
C
src/cnn_bn.h
jamesljlster/cnn
8ba35edd4516f6b46a17a1bad672e38667600630
[ "MIT" ]
1
2020-06-15T07:47:10.000Z
2020-06-15T07:47:10.000Z
src/cnn_bn.h
jamesljlster/cnn
8ba35edd4516f6b46a17a1bad672e38667600630
[ "MIT" ]
null
null
null
src/cnn_bn.h
jamesljlster/cnn
8ba35edd4516f6b46a17a1bad672e38667600630
[ "MIT" ]
null
null
null
#ifndef __CNN_BN_H__ #define __CNN_BN_H__ #include <math.h> #include "cnn_macro.h" #include "cnn_types.h" #ifdef CNN_WITH_CUDA #include <cublas_v2.h> #include <cuda_runtime.h> #include "cnn_builtin_math_cu.h" #include "cnn_init.h" #endif #define CNN_BN_EPS 1e-4 static inline void cnn_recall_bn(union CNN_LAYER* layerRef, struct CNN_CONFIG* cfgRef, int layerIndex) { struct CNN_LAYER_BN* layerPtr = &layerRef[layerIndex].bn; struct CNN_MAT* outData = &layerPtr->outMat.data; struct CNN_MAT* preOutData = &layerRef[layerIndex - 1].outMat.data; #ifdef CNN_WITH_CUDA float alpha = 1.0; float beta = 0.0; cnn_assert_cudnn(cudnnBatchNormalizationForwardInference( cnnInit.cudnnHandle, CUDNN_BATCHNORM_SPATIAL, // &alpha, &beta, // layerPtr->srcTen, preOutData->mat, // layerPtr->srcTen, outData->mat, // layerPtr->bnTen, // layerPtr->bnScale.mat, layerPtr->bnBias.mat, // layerPtr->runMean.mat, layerPtr->runVar.mat, // CNN_BN_EPS)); #else // Cache int channels = layerPtr->outMat.channel; int chSize = layerPtr->outMat.width * layerPtr->outMat.height; int batch = cfgRef->batch; // Batch normalization forward for (int ch = 0; ch < channels; ch++) { float mean = layerPtr->runMean.mat[ch]; float var = layerPtr->runVar.mat[ch]; float gamma = layerPtr->bnScale.mat[ch]; float beta = layerPtr->bnBias.mat[ch]; float stddev = sqrt(var + CNN_BN_EPS); // Process batch normalization for (int b = 0; b < batch; b++) { float* preImPtr = preOutData->mat + b * preOutData->cols + ch * chSize; float* imPtr = outData->mat + b * outData->cols + ch * chSize; for (int e = 0; e < chSize; e++) { float src = preImPtr[e]; float out = (src - mean) / stddev; imPtr[e] = out * gamma + beta; } } } #endif } static inline void cnn_forward_bn(union CNN_LAYER* layerRef, struct CNN_CONFIG* cfgRef, int layerIndex) { struct CNN_LAYER_BN* layerPtr = &layerRef[layerIndex].bn; struct CNN_MAT* outData = &layerPtr->outMat.data; struct CNN_MAT* preOutData = &layerRef[layerIndex - 1].outMat.data; #ifdef CNN_WITH_CUDA float alpha = 1.0; float beta = 0.0; cnn_assert_cudnn(cudnnBatchNormalizationForwardTraining( cnnInit.cudnnHandle, CUDNN_BATCHNORM_SPATIAL, // &alpha, &beta, // layerPtr->srcTen, preOutData->mat, // layerPtr->srcTen, outData->mat, // layerPtr->bnTen, layerPtr->bnScale.mat, layerPtr->bnBias.mat, // cfgRef->layerCfg[layerIndex].bn.expAvgFactor, // layerPtr->runMean.mat, layerPtr->runVar.mat, // CNN_BN_EPS, // layerPtr->saveMean.mat, layerPtr->saveVar.mat)); #else // Cache int channels = layerPtr->outMat.channel; int chSize = layerPtr->outMat.width * layerPtr->outMat.height; int batch = cfgRef->batch; float sampleSize = batch * chSize; float expAvgFactor = cfgRef->layerCfg[layerIndex].bn.expAvgFactor; // Batch normalization forward for (int ch = 0; ch < channels; ch++) { float mean = 0; float var = 0; float gamma = layerPtr->bnScale.mat[ch]; float beta = layerPtr->bnBias.mat[ch]; float stddev; // Find mean for (int b = 0; b < batch; b++) { float* preImPtr = preOutData->mat + b * preOutData->cols + ch * chSize; for (int e = 0; e < chSize; e++) { mean += preImPtr[e]; } } mean /= sampleSize; // Find variance for (int b = 0; b < batch; b++) { float* preImPtr = preOutData->mat + b * preOutData->cols + ch * chSize; for (int e = 0; e < chSize; e++) { float tmp = preImPtr[e] - mean; var += tmp * tmp; } } var /= sampleSize; stddev = sqrt(var + CNN_BN_EPS); // Process batch normalization for (int b = 0; b < batch; b++) { float* preImPtr = preOutData->mat + b * preOutData->cols + ch * chSize; float* imPtr = outData->mat + b * outData->cols + ch * chSize; for (int e = 0; e < chSize; e++) { float src = preImPtr[e]; float out = (src - mean) / stddev; imPtr[e] = out * gamma + beta; } } // Assign values layerPtr->saveMean.mat[ch] = mean; layerPtr->saveVar.mat[ch] = var; layerPtr->runMean.mat[ch] = layerPtr->runMean.mat[ch] * (1.0 - expAvgFactor) + mean * expAvgFactor; layerPtr->runVar.mat[ch] = layerPtr->runVar.mat[ch] * (1.0 - expAvgFactor) + var * expAvgFactor; } #endif } static inline void cnn_backward_bn(union CNN_LAYER* layerRef, struct CNN_CONFIG* cfgRef, int layerIndex) { struct CNN_LAYER_BN* layerPtr = &layerRef[layerIndex].bn; struct CNN_MAT* outData = &layerPtr->outMat.data; struct CNN_MAT* preOutData = &layerRef[layerIndex - 1].outMat.data; #ifdef CNN_WITH_CUDA float alpha = 1.0; float betaParam = 1.0; float betaGrad = 0.0; cnn_assert_cudnn(cudnnBatchNormalizationBackward( cnnInit.cudnnHandle, CUDNN_BATCHNORM_SPATIAL, // &alpha, &betaGrad, &alpha, &betaParam, // layerPtr->srcTen, preOutData->mat, // layerPtr->srcTen, outData->grad, // layerPtr->srcTen, preOutData->grad, // layerPtr->bnTen, layerPtr->bnScale.mat, layerPtr->bnScale.grad, layerPtr->bnBias.grad, // CNN_BN_EPS, // layerPtr->saveMean.mat, layerPtr->saveVar.mat)); #else // Cache int channels = layerPtr->outMat.channel; int chSize = layerPtr->outMat.width * layerPtr->outMat.height; int batch = cfgRef->batch; float sampleSize = batch * chSize; for (int ch = 0; ch < channels; ch++) { float tmp; float rGrad = 0; float bGrad = 0; float varGrad = 0; float meanGrad = 0; float mean = layerPtr->saveMean.mat[ch]; float var = layerPtr->saveVar.mat[ch]; float stddev = sqrt(var + CNN_BN_EPS); float gamma = layerPtr->bnScale.mat[ch]; // Find gamma, beta gradient for (int b = 0; b < batch; b++) { float* preImPtr = preOutData->mat + b * preOutData->cols + ch * chSize; float* gradPtr = outData->grad + b * outData->cols + ch * chSize; for (int e = 0; e < chSize; e++) { float srcNorm = (preImPtr[e] - mean) / stddev; float gradIn = gradPtr[e]; rGrad += srcNorm * gradIn; bGrad += gradIn; } } layerPtr->bnScale.grad[ch] += rGrad; layerPtr->bnBias.grad[ch] += bGrad; // Find layer gradient if (layerIndex > 1) { // Find mean, variance gradient for (int b = 0; b < batch; b++) { float* preImPtr = preOutData->mat + b * preOutData->cols + ch * chSize; float* gradPtr = outData->grad + b * outData->cols + ch * chSize; for (int e = 0; e < chSize; e++) { varGrad += gradPtr[e] * gamma * (preImPtr[e] - mean); } } varGrad = varGrad * -0.5 * pow(stddev, -3); // Find mean gradient tmp = 0; for (int b = 0; b < batch; b++) { float* preImPtr = preOutData->mat + b * preOutData->cols + ch * chSize; float* gradPtr = outData->grad + b * outData->cols + ch * chSize; for (int e = 0; e < chSize; e++) { meanGrad += gradPtr[e] * gamma * -1.0 / stddev; tmp += varGrad * -2.0 * (preImPtr[e] - mean); } } meanGrad += tmp / sampleSize; // Find layer gradient for (int b = 0; b < batch; b++) { float* preImPtr = preOutData->mat + b * preOutData->cols + ch * chSize; float* preGradPtr = preOutData->grad + b * preOutData->cols + ch * chSize; float* gradPtr = outData->grad + b * outData->cols + ch * chSize; for (int e = 0; e < chSize; e++) { preGradPtr[e] = gradPtr[e] * gamma / stddev + (varGrad * 2.0 * (preImPtr[e] - mean) + meanGrad) / sampleSize; } } } } #endif } #endif
30.623794
77
0.496325
f138ae47fa0eb6987112df0bfec605d6bdb29792
1,890
c
C
src/jaegertracingc/token_bucket_test.c
isaachier/c-client
56fd9754e5f60374bd1341d84c0238c6651281a6
[ "Apache-2.0" ]
null
null
null
src/jaegertracingc/token_bucket_test.c
isaachier/c-client
56fd9754e5f60374bd1341d84c0238c6651281a6
[ "Apache-2.0" ]
null
null
null
src/jaegertracingc/token_bucket_test.c
isaachier/c-client
56fd9754e5f60374bd1341d84c0238c6651281a6
[ "Apache-2.0" ]
null
null
null
/* * Copyright (c) 2018 The Jaeger Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <time.h> #include "jaegertracingc/alloc.h" #include "jaegertracingc/clock.h" #include "jaegertracingc/token_bucket.h" #include "unity.h" #define NS_PER_S JAEGERTRACINGC_NANOSECONDS_PER_SECOND void test_token_bucket() { const double credits_per_second = 10; const double max_balance = 3; jaeger_token_bucket tok; jaeger_token_bucket_init(&tok, credits_per_second, max_balance); bool result = jaeger_token_bucket_check_credit(&tok, max_balance); TEST_ASSERT_TRUE(result); struct timespec sleep_time = {.tv_sec = 0, .tv_nsec = NS_PER_S * 0.01}; struct timespec rem_time = {.tv_sec = 0, .tv_nsec = 0}; nanosleep(&sleep_time, &rem_time); opentracing_time_value interval; result = jaeger_time_subtract( JAEGERTRACINGC_TIME_CAST(sleep_time, opentracing_time_value), JAEGERTRACINGC_TIME_CAST(rem_time, opentracing_time_value), &interval); TEST_ASSERT_TRUE(result); const double expected_credits = credits_per_second * interval.tv_sec + credits_per_second * interval.tv_nsec / NS_PER_S; result = jaeger_token_bucket_check_credit(&tok, expected_credits); TEST_ASSERT_TRUE(result); result = jaeger_token_bucket_check_credit(&tok, expected_credits); TEST_ASSERT_FALSE(result); }
37.8
75
0.745503
d16572a9238167e8653e0433d8641037cfc7acd1
330
h
C
helpers/tail.h
ideeinc/Deepagent
5d37ecf8e196d54d3914edc0c7b309377f772c1f
[ "BSD-3-Clause" ]
null
null
null
helpers/tail.h
ideeinc/Deepagent
5d37ecf8e196d54d3914edc0c7b309377f772c1f
[ "BSD-3-Clause" ]
null
null
null
helpers/tail.h
ideeinc/Deepagent
5d37ecf8e196d54d3914edc0c7b309377f772c1f
[ "BSD-3-Clause" ]
null
null
null
#ifndef TAIL_H #define TAIL_H #include <TGlobal> #include <QByteArray> #include <QString> #include "applicationhelper.h" class T_HELPER_EXPORT Tail : public ApplicationHelper { public: Tail(const QString &filePath); QByteArray tail(int maxlen, qint64 offset = 0) const; private: QString path; }; #endif // TAIL_H
15.714286
57
0.730303
2b951f54ce7b52733e8ac9ad11c9fcd3425f309f
3,388
h
C
vfs.h
lordgnu/wxPHP
368a75c893039e5eaa31bc1ee38e341991039f3f
[ "PHP-3.01" ]
1
2019-02-07T23:18:31.000Z
2019-02-07T23:18:31.000Z
vfs.h
lordgnu/wxPHP
368a75c893039e5eaa31bc1ee38e341991039f3f
[ "PHP-3.01" ]
null
null
null
vfs.h
lordgnu/wxPHP
368a75c893039e5eaa31bc1ee38e341991039f3f
[ "PHP-3.01" ]
null
null
null
/* * @author Mário Soares * @contributors Jefferson González * * @license * This file is part of wxPHP check the LICENSE file for information. * * @note * This file was auto-generated by the wxPHP source maker */ #ifndef WXPHP_VFS_H_GUARD #define WXPHP_VFS_H_GUARD #include "references.h" ZEND_BEGIN_ARG_INFO_EX(wxphp_vfs_get_args, 0, 0, 1) ZEND_ARG_INFO(0, name) ZEND_END_ARG_INFO() extern int le_wxFileSystem; extern zend_class_entry *php_wxFileSystem_entry; void php_wxFileSystem_destruction_handler(zend_rsrc_list_entry * TSRMLS_DC); class wxFileSystem_php: public wxFileSystem{ public: wxFileSystem_php():wxFileSystem(){} void InitProperties(){ } zval *evnArray; void onEvent(wxEvent& evnt); void ***tsrm_ls; zval* phpObj; void** properties; wxPHPObjectReferences references; }; #ifdef WXPHP_INCLUDE_METHOD_TABLES static zend_function_entry php_wxFileSystem_functions[] = { PHP_ME(php_wxObject, UnShare, NULL, ZEND_ACC_PUBLIC) PHP_ME(php_wxObject, UnRef, NULL, ZEND_ACC_PUBLIC) PHP_ME(php_wxObject, IsSameAs, NULL, ZEND_ACC_PUBLIC) PHP_ME(php_wxObject, Ref, NULL, ZEND_ACC_PUBLIC) PHP_ME(php_wxObject, GetClassInfo, NULL, ZEND_ACC_PUBLIC) PHP_ME(php_wxObject, IsKindOf, NULL, ZEND_ACC_PUBLIC) PHP_ME(php_wxFileSystem, __construct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_ME(php_wxFileSystem, URLToFileName, NULL, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) PHP_ME(php_wxFileSystem, OpenFile, NULL, ZEND_ACC_PUBLIC) PHP_ME(php_wxFileSystem, HasHandlerForPath, NULL, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) PHP_ME(php_wxFileSystem, GetPath, NULL, ZEND_ACC_PUBLIC) PHP_ME(php_wxFileSystem, FindNext, NULL, ZEND_ACC_PUBLIC) PHP_ME(php_wxFileSystem, FindFirst, NULL, ZEND_ACC_PUBLIC) PHP_ME(php_wxFileSystem, FindFileInPath, NULL, ZEND_ACC_PUBLIC) PHP_ME(php_wxFileSystem, FileNameToURL, NULL, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) PHP_ME(php_wxFileSystem, ChangePathTo, NULL, ZEND_ACC_PUBLIC) PHP_ME(php_wxFileSystem, AddHandler, NULL, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) PHP_FE_END }; #endif extern int le_wxFileSystemHandler; extern zend_class_entry *php_wxFileSystemHandler_entry; void php_wxFileSystemHandler_destruction_handler(zend_rsrc_list_entry * TSRMLS_DC); class wxFileSystemHandler_php: public wxFileSystemHandler{ public: wxFileSystemHandler_php():wxFileSystemHandler(){} bool CanOpen(const wxString& location); wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location); void InitProperties(){ } zval *evnArray; void onEvent(wxEvent& evnt); void ***tsrm_ls; zval* phpObj; void** properties; wxPHPObjectReferences references; }; #ifdef WXPHP_INCLUDE_METHOD_TABLES static zend_function_entry php_wxFileSystemHandler_functions[] = { PHP_ME(php_wxObject, UnShare, NULL, ZEND_ACC_PUBLIC) PHP_ME(php_wxObject, UnRef, NULL, ZEND_ACC_PUBLIC) PHP_ME(php_wxObject, IsSameAs, NULL, ZEND_ACC_PUBLIC) PHP_ME(php_wxObject, Ref, NULL, ZEND_ACC_PUBLIC) PHP_ME(php_wxObject, GetClassInfo, NULL, ZEND_ACC_PUBLIC) PHP_ME(php_wxObject, IsKindOf, NULL, ZEND_ACC_PUBLIC) PHP_ME(php_wxFileSystemHandler, FindFirst, NULL, ZEND_ACC_PUBLIC) PHP_ME(php_wxFileSystemHandler, FindNext, NULL, ZEND_ACC_PUBLIC) PHP_ME(php_wxFileSystemHandler, GetMimeTypeFromExt, NULL, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) PHP_ME(php_wxFileSystemHandler, __construct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_FE_END }; #endif #endif //WXPHP_VFS_H_GUARD
32.266667
91
0.812574
139aa1e4124b0a4f07283c390a8e875950164e65
441
h
C
Pod/Classes/ENGPhotoSubmitterSettings.h
kent013/PhotoSubmitter
717ab74545b71dbb2c900df2a73d24e1a2650a89
[ "BSD-3-Clause" ]
3
2016-01-22T05:02:41.000Z
2016-05-29T05:42:11.000Z
Pod/Classes/ENGPhotoSubmitterSettings.h
kent013/PhotoSubmitter
717ab74545b71dbb2c900df2a73d24e1a2650a89
[ "BSD-3-Clause" ]
null
null
null
Pod/Classes/ENGPhotoSubmitterSettings.h
kent013/PhotoSubmitter
717ab74545b71dbb2c900df2a73d24e1a2650a89
[ "BSD-3-Clause" ]
2
2016-01-22T05:04:24.000Z
2019-04-09T07:52:13.000Z
// // ENGPhotoSubmitterSettings.h // // Created by ISHITOYA Kentaro on 11/12/21. // #import <Foundation/Foundation.h> @interface ENGPhotoSubmitterSettings : NSObject{ } @property (nonatomic, assign) BOOL commentPostEnabled; @property (nonatomic, assign) BOOL gpsEnabled; @property (nonatomic, assign) BOOL autoEnhance; @property (nonatomic, assign) NSDictionary *submitterEnabledDates; + (ENGPhotoSubmitterSettings *)getInstance; @end
23.210526
66
0.77551
78597777c75396468b74f0472caddd3ba962536b
3,600
h
C
src/server/plugins/fastcgi/errortypes.h
jvirkki/heliod
efdf2d105e342317bd092bab2d727713da546174
[ "BSD-3-Clause" ]
13
2015-10-09T05:59:20.000Z
2021-11-12T10:38:51.000Z
src/server/plugins/fastcgi/errortypes.h
JamesLinus/heliod
efdf2d105e342317bd092bab2d727713da546174
[ "BSD-3-Clause" ]
null
null
null
src/server/plugins/fastcgi/errortypes.h
JamesLinus/heliod
efdf2d105e342317bd092bab2d727713da546174
[ "BSD-3-Clause" ]
6
2016-05-23T10:53:29.000Z
2019-12-13T17:57:32.000Z
/* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * * THE BSD LICENSE * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of the nor the names of its contributors may be * used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef FCGIERRORTYPES_H #define FCGIERRORTYPES_H #define MAX_STRING_LEN 256 typedef enum { NO_FCGI_ERROR = 0, //config related errors NO_APP_BIND_PATH, NO_BIND_PATH, INVALID_BIND_PATH, //Stub related errors SEMAPHORE_OPEN_ERROR, STUB_PID_FILE_CREATE_FAILURE, STUB_NOT_RESPONDING, STUB_START_FAILURE, STUB_BIND_ERROR, STUB_LISTEN_ERROR, STUB_ACCEPT_ERROR, STUB_SOCKET_CREATION_FAILURE, STUB_CONNECT_FAILURE, STUB_STAT_FAILURE, STUB_NO_PERM, PIPE_CREATE_FAILURE, STUB_FORK_ERROR, STUB_EXEC_FAILURE, REQUEST_SEND_FAILURE, REQUEST_MEMORY_ALLOCATION_FAILURE, BUILD_REQ_ERROR, ERROR_RESPONSE, UNKNOWN_STUB_REQ_TYPE, STUB_SERVER_START_REQ_FAILURE, STUB_OVER_LOAD_REQ_FAILURE, STUB_POLL_ERROR, //stub request related errors REQUEST_THREAD_CREATE_FAILURE, REQUEST_READ_ERROR, INCOMPLETE_HEADER, INVALID_REQUEST_TYPE, REQUEST_MISSING_OR_INVALID_PARAM, PROC_EXISTS, SERVER_SOCKET_CREATION_FAILURE, SET_RLIMIT_FAILURE, SET_NICE_FAILURE, INVALID_PARAM_VALUE, INVALID_USER, INVALID_GROUP, SET_GROUP_FAILURE, SET_USER_FAILURE, SET_CHDIR_FAILURE, NO_PERMISSION, STAT_FAILURE, NOT_EXEC_OWNER, NO_EXEC_PERMISSION, WRITE_OTHER_PERMISSION, CHILD_EXEC_FAILURE, SET_CHROOT_FAILURE, CHILD_FORK_FAILURE, PROC_DOES_NOT_EXIST, SERVER_BIND_ERROR, SERVER_LISTEN_ERROR, REQUEST_INCOMPLETE_HEADER, //parser related errors INVALID_VERSION, INVALID_TYPE, INVALID_RECORD, INVALID_HTTP_HEADER, CANT_MPX, OVER_LOADED, UNKNOWN_ROLE, //protocol related errors FCGI_INVALID_SERVER, FCGI_INVALID_RESPONSE, FCGI_NO_BUFFER_SPACE, FCGI_FILTER_FILE_OPEN_ERROR, FCGI_NO_AUTHORIZATION } PluginError; const char *getErrorString(PluginError error); PRBool shouldRetry(PluginError error); #endif // FCGIERRORTYPES_H
29.268293
79
0.758611
18eed88904e94dac63412e7e52e288030638f6a9
3,684
h
C
src/utils/aseglist.h
cmrschwarz/tau
10a0303709d2235d6087109aba6799fe0412fad2
[ "MIT" ]
2
2020-01-08T18:22:04.000Z
2021-01-18T22:15:31.000Z
src/utils/aseglist.h
cmrschwarz/tau
10a0303709d2235d6087109aba6799fe0412fad2
[ "MIT" ]
null
null
null
src/utils/aseglist.h
cmrschwarz/tau
10a0303709d2235d6087109aba6799fe0412fad2
[ "MIT" ]
null
null
null
#pragma once #include "atomic_pool.h" #include "error.h" #include "math_utils.h" #include "threading.h" typedef atomic_ptr aseglist; typedef struct aseglist_node_s { struct aseglist_node_s* prev; atomic_sreg space; } aseglist_node; #define ASEGLIST_CAPACITY_CONSUMPTION \ ((sizeof(aseglist_node) + sizeof(void*) - 1) / sizeof(void*)) #define ASEGLIST_ELEM_OFFSET (ASEGLIST_CAPACITY_CONSUMPTION * sizeof(void*)) // must be larger than ASEGLIST_ELEM_OFFSET #define ASEGLIST_INITIAL_SIZE (8 * sizeof(void*)) typedef struct aseglist_iterator_s { void** pos; void** end; aseglist_node* node; } aseglist_iterator; static inline void aseglist_iterator_begin(aseglist_iterator* it, aseglist* l) { aseglist_node* n; do { n = (aseglist_node*)atomic_ptr_load(l); } while (!n); ureg space = atomic_sreg_load(&n->space) * sizeof(void*); ureg size = *(ureg*)ptradd(n, ASEGLIST_ELEM_OFFSET); it->pos = (void**)ptradd(n, ASEGLIST_ELEM_OFFSET + space); it->end = (void**)ptradd(n, size); it->node = n; } static inline ureg aseglist_iterator_get_remaining_count(aseglist_iterator* it) { ureg curr_node_size = ptrdiff(it->end, it->node); ureg node_count = ulog2(curr_node_size) - ulog2(ASEGLIST_INITIAL_SIZE / 2); ureg tot_size = 2 * curr_node_size - ASEGLIST_INITIAL_SIZE; ureg curr_node_unused = curr_node_size - ASEGLIST_ELEM_OFFSET - ptrdiff(it->end, it->pos); return (tot_size - curr_node_unused) / sizeof(void*) - (node_count * ASEGLIST_CAPACITY_CONSUMPTION); } static inline void* aseglist_iterator_next(aseglist_iterator* it) { if (it->pos == it->end) { aseglist_node* prev = it->node->prev; if (prev == NULL) return NULL; ureg size_old = ptrdiff(it->end, it->node) / 2; it->pos = (void**)ptradd(prev, sizeof(aseglist_node)); it->end = (void**)ptradd(prev, size_old); it->node = prev; }; return *it->pos++; } static inline aseglist_node* aseglist_node_new(ureg size) { aseglist_node* n = (aseglist_node*)tmalloc(size); if (!n) return NULL; atomic_sreg_init(&n->space, (size - sizeof(aseglist_node)) / sizeof(void*)); *(ureg*)ptradd(n, ASEGLIST_ELEM_OFFSET) = size; return n; } static inline void aseglist_node_free(aseglist_node* n) { tfree(n); } static inline int aseglist_init(aseglist* l) { aseglist_node* n = aseglist_node_new(ASEGLIST_INITIAL_SIZE); if (!n) return ERR; atomic_ptr_init(l, n); n->prev = NULL; return OK; } static inline void aseglist_fin(aseglist* l) { aseglist_node* n = (aseglist_node*)atomic_ptr_load(l); aseglist_node* ntemp; do { ntemp = n; n = n->prev; aseglist_node_free(ntemp); } while (n != NULL); } static inline int aseglist_add(aseglist* l, void* data) { while (true) { aseglist_node* node = (aseglist_node*)atomic_ptr_load(l); if (!node) continue; sreg space = atomic_sreg_dec(&node->space) - 1; if (space > 0) { ((void**)ptradd(node, ASEGLIST_ELEM_OFFSET))[space] = data; return OK; } if (space == 0) { atomic_ptr_store(l, NULL); ureg size_new = (*(ureg*)ptradd(node, ASEGLIST_ELEM_OFFSET)) * 2; aseglist_node* node_new = aseglist_node_new(size_new); if (!node_new) { atomic_ptr_store(l, node); return ERR; } atomic_ptr_store(l, node_new); *(void**)ptradd(node, ASEGLIST_ELEM_OFFSET) = data; node_new->prev = node; return OK; } } }
30.446281
80
0.632736
2856b2a22c5d35542791c2a339d9f336eff0f4ec
96
h
C
include/asciitof.h
jtkiesel/jankyBoi
f6bc25530d7ce551c043b10a16335dbf57ac3ab5
[ "MIT" ]
6
2018-06-14T06:15:53.000Z
2022-01-16T21:24:34.000Z
include/asciitof.h
jtkiesel/jankyBoi
f6bc25530d7ce551c043b10a16335dbf57ac3ab5
[ "MIT" ]
null
null
null
include/asciitof.h
jtkiesel/jankyBoi
f6bc25530d7ce551c043b10a16335dbf57ac3ab5
[ "MIT" ]
1
2021-07-18T04:02:33.000Z
2021-07-18T04:02:33.000Z
#ifndef ASCIITOF_H_ #define ASCIITOF_H_ double asciitof(char *string); #endif // ASCIITOF_H_
13.714286
30
0.770833
9328cc904931a58e2bafc33202a383b4f0d97788
11,156
c
C
modules/librender/g_object.c
segafan/BennuGD-GPU-cloned-from-Bitbucket-
c97f8e4d3b7d08bb36c8e22a051bee02bfb9e833
[ "Zlib" ]
null
null
null
modules/librender/g_object.c
segafan/BennuGD-GPU-cloned-from-Bitbucket-
c97f8e4d3b7d08bb36c8e22a051bee02bfb9e833
[ "Zlib" ]
null
null
null
modules/librender/g_object.c
segafan/BennuGD-GPU-cloned-from-Bitbucket-
c97f8e4d3b7d08bb36c8e22a051bee02bfb9e833
[ "Zlib" ]
null
null
null
/* * Copyright (C) 2014-2015 Joseba García Etxebarria <joseba.gar@gmail.com> * Copyright (C) 2006-2012 SplinterGU (Fenix/Bennugd) * * This file is part of PixTudio * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be * appreciated but is not required. * * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * * 3. This notice may not be removed or altered from any source * distribution. * */ #include <stdlib.h> #include <string.h> #define __LIB_RENDER #include "librender.h" /* --------------------------------------------------------------------------- */ static int sequencer = 0; CONTAINER * sorted_object_list = NULL; /* --------------------------------------------------------------------------- */ CONTAINER * search_container( int key ) { CONTAINER * ctr = NULL; if ( !sorted_object_list ) return NULL; for ( ctr = sorted_object_list; ctr && ctr->key > key; ctr = ctr->next ); if ( ctr && ctr->key == key ) return ctr; return NULL; } /* --------------------------------------------------------------------------- */ CONTAINER * get_container( int key ) { CONTAINER * ctr = NULL, * prev_ctr = NULL, * new_ctr = NULL; if ( sorted_object_list ) { for ( ctr = sorted_object_list; ctr && ctr->key > key; ctr = ctr->next ) { prev_ctr = ctr; } if ( ctr && ctr->key == key ) return ctr; } new_ctr = ( CONTAINER * ) malloc( sizeof( CONTAINER ) ); if ( !new_ctr ) return NULL; new_ctr->key = key; new_ctr->first_in_key = NULL; if ( ctr == sorted_object_list ) { if ( !sorted_object_list ) { /* Only happen "!sorted_object_list" when "ctr == sorted_object_list" (NULL) */ sorted_object_list = new_ctr; new_ctr->next = NULL; new_ctr->prev = NULL; return new_ctr; } sorted_object_list = new_ctr; } if ( ctr ) { new_ctr->next = ctr; new_ctr->prev = ctr->prev; if ( ctr->prev ) ctr->prev->next = new_ctr; ctr->prev = new_ctr; } else { // prev_ctr implicit exist new_ctr->next = NULL; new_ctr->prev = prev_ctr; prev_ctr->next = new_ctr; } return new_ctr; } /* --------------------------------------------------------------------------- */ void destroy_container( CONTAINER * ctr ) { if ( ctr->next ) ctr->next->prev = ctr->prev; if ( ctr->prev ) ctr->prev->next = ctr->next; if ( ctr == sorted_object_list ) sorted_object_list = ctr->next ; free( ctr ); } /* --------------------------------------------------------------------------- */ /* * FUNCTION : gr_new_object * * Register a visible object with a Z coordinate to be drawn * by an user-defined function. * * If your DLL does some screen operations, you should register * a draw-type hook or an object. Any access to the screen * surface outside those are invalid. * * PARAMS : * z Z value of the object to be drawn * info Pointer to the object information function * (fills bounding box, returns 1 if changed since last frame) * draw Pointer to the object drawing function * what User-defined parameter that will be passed to "draw" * * RETURN VALUE : * An integer ID that uniquely identifies the object, * or 0 if not enough memory */ int gr_new_object( int z, OBJ_INFO * info, OBJ_DRAW * draw, void * what ) { CONTAINER * ctr ; OBJECT * object = ( OBJECT * ) malloc( sizeof( OBJECT ) ); if ( !object ) return 0; ctr = get_container( z ); if ( !ctr ) { free( object ); return 0; } object->z = z; object->info = info; object->draw = draw; object->what = what; object->ready = 0; object->bbox.x = -2; object->bbox.y = -2; object->bbox.x2 = -2; object->bbox.y2 = -2; object->bbox_saved.x = -2; object->bbox_saved.y = -2; object->bbox_saved.x2 = -2; object->bbox_saved.y2 = -2; object->seq = 0; object->prev = NULL; if ( ctr->first_in_key ) { ctr->first_in_key->prev = object; object->next = ctr->first_in_key; } else { object->next = NULL; } ctr->first_in_key = object; return ( int ) object; } /* --------------------------------------------------------------------------- */ /* * FUNCTION : gr_destroy_object * * Unregister and remove a given object created by gr_new_object from memory * * PARAMS : * id ID returned by gr_new_object * * RETURN VALUE : * None */ void gr_destroy_object( int id ) { CONTAINER * ctr ; OBJECT * object = ( OBJECT * ) id ; if ( !object ) return ; ctr = search_container( object->z ); if ( !ctr ) return; if ( object->next ) object->next->prev = object->prev; if ( object->prev ) object->prev->next = object->next; if ( object == ctr->first_in_key ) ctr->first_in_key = object->next; if ( !ctr->first_in_key ) destroy_container( ctr ); /* Rects */ if ( object->bbox.x >= 0 || object->bbox.y >= 0 || object->bbox.x2 >= 0 || object->bbox.y2 >= 0 ) gr_mark_rect( object->bbox.x, object->bbox.y, object->bbox.x2 - object->bbox.x + 1, object->bbox.y2 - object->bbox.y + 1 ); free( object ); } /* --------------------------------------------------------------------------- */ void gr_update_objects_mark_rects( int restore, int dump ) { CONTAINER * ctr = NULL, * next_ctr, * fix_ctr; OBJECT * object, * next_object ; int ready, key; if ( !sorted_object_list ) return ; sequencer++; next_ctr = sorted_object_list; while (( ctr = next_ctr ) ) { /* Get Next Container */ next_ctr = ctr->next ; key = ctr->key; next_object = ctr->first_in_key; while (( object = next_object ) ) { next_object = object->next ; if ( object->seq != sequencer ) { /* Mark object as already proceed */ object->seq = sequencer; /* Update key & get_info */ ready = object->ready; /* NOTE: Returned bbox must be ordered !!! */ object->changed = ( *object->info )( object->what, &object->bbox, &object->z, &object->ready ); /* Move to correct container */ if ( object->z != key ) { /* Remove from list */ if ( object->next ) object->next->prev = object->prev; if ( object->prev ) object->prev->next = object->next; if ( object == ctr->first_in_key ) ctr->first_in_key = object->next; if ( !ctr->first_in_key ) destroy_container( ctr ); /* Get new or exist container */ fix_ctr = get_container( object->z ); if ( !fix_ctr ) continue; /* Error */ /* Put new object first */ if ( fix_ctr->first_in_key ) fix_ctr->first_in_key->prev = object; object->prev = NULL; object->next = fix_ctr->first_in_key; fix_ctr->first_in_key = object; } if ( ( object->z != key ) || ( object->ready ^ ready ) || object->changed || object->bbox.x2 != object->bbox_saved.x2 || object->bbox.x != object->bbox_saved.x || object->bbox.y2 != object->bbox_saved.y2 || object->bbox.y != object->bbox_saved.y ) { if ( restore == 0 ) gr_mark_rect( object->bbox_saved.x, object->bbox_saved.y, object->bbox_saved.x2 - object->bbox_saved.x + 1, object->bbox_saved.y2 - object->bbox_saved.y + 1 ); object->bbox_saved = object->bbox ; } if ( !object->ready || object->bbox.x2 < 0 || object->bbox.x > scr_width - 1 || object->bbox.y2 < 0 || object->bbox.y > scr_height - 1 ) continue; if ( dump == 0 && object->changed && ( object->bbox.x >= 0 || object->bbox.y >= 0 || object->bbox.x2 >= 0 || object->bbox.y2 >= 0 ) ) { gr_mark_rect( object->bbox.x, object->bbox.y, object->bbox.x2 - object->bbox.x + 1, object->bbox.y2 - object->bbox.y + 1 ); } } } } } /* --------------------------------------------------------------------------- */ void gr_draw_objects( REGION * updaterects, int count ) { CONTAINER * ctr = NULL; OBJECT * object; REGION * prect; int n; ctr = sorted_object_list; while ( ctr ) { object = ctr->first_in_key; while ( object ) { if ( object->ready ) { prect = updaterects; for ( n = count; n--; prect++ ) { if ( object->bbox.x2 < prect->x || object->bbox.x > prect->x2 || object->bbox.y2 < prect->y || object->bbox.y > prect->y2 ) continue; ( *object->draw )( object->what, prect ) ; } } object = object->next ; } ctr = ctr->next ; } } /* --------------------------------------------------------------------------- */ void gr_draw_objects_complete( void ) { CONTAINER * ctr = NULL; OBJECT * object; ctr = sorted_object_list; while ( ctr ) { object = ctr->first_in_key; while ( object ) { if ( object->ready ) ( *object->draw )( object->what, NULL ) ; object = object->next ; } ctr = ctr->next ; } } /* --------------------------------------------------------------------------- */
30.480874
184
0.474274
4f48331fcdf81cb459ba71dfacb62331449dca0b
6,459
c
C
libraries/community/p1/All/1-wire routines in C/ReadTemp_multiple_cog.c
deets/propeller
1468c8b334266f899882f404903b2dd833168799
[ "MIT" ]
82
2018-11-29T19:02:44.000Z
2022-03-11T18:50:24.000Z
libraries/community/p1/All/1-wire routines in C/ReadTemp_multiple_cog.c
pik33/propeller
861213b91d4e6bd4e724a21389a5311d452f369d
[ "MIT" ]
30
2019-01-31T02:20:23.000Z
2022-01-26T17:50:25.000Z
libraries/community/p1/All/1-wire routines in C/ReadTemp_multiple_cog.c
pik33/propeller
861213b91d4e6bd4e724a21389a5311d452f369d
[ "MIT" ]
73
2018-11-28T15:10:12.000Z
2022-03-22T21:00:25.000Z
/* ReadTemp_multiple_cog.c Read temperature from DS18B20 sensors using mutiple 1-wire ports and cogs */ #include "simpletools.h" // Include simple tools #include "limits.h" //#define STACKTEST #ifdef STACKTEST #include "stacktest.h" #endif #include "ownet.h" #define MAXDEVICES 20 //the maximum number of devices we expect to see on a 1-wire bus #define ONE_WIRE_BUSES 3 //the number of 1-wire buses we are using struct { uchar SerialNum[MAXDEVICES][8]; //the compiler puts up a warning that it discards the volatile qualifier (why?) short int temperature[MAXDEVICES]; //temperature reading from the sensors int NoDevices; //the number of temperature sensors found on the 1-wire bus int port; //the I/O number used for one wire communication int cognum; //the cog number that this index of the structure matches } volatile tSense[ONE_WIRE_BUSES]; void ReadTemp(); //runs in other cogs int main() { // Main function int *cog[ONE_WIRE_BUSES]; // Cog process ID variable int portnum[ONE_WIRE_BUSES]={22,23,24}; //the I/O ports used for 1-wire communication int port; int devNum; unsigned char byte; #ifdef STACKTEST while (1){ cog[0] = cog_runStackTest(ReadTemp, 512); // Run the cog test tSense[0].cognum=cog_num(cog[0]); tSense[0].port=portnum[0]; print("Please wait 5 seconds...\n"); // User prompt sleep(5); // Give time to put cog to work int stacksize = cog_endStackTest(cog[0]); // Get the result print("Stack int usage = %d.\n", // Display result stacksize); sleep(5); } #endif putChar(0); //clear SimpleIDE terminal window for (port=0;port<ONE_WIRE_BUSES;port++){ cog[port] = cog_run(ReadTemp, 33); // Start reading the temperature in another cog tSense[port].cognum=cog_num(cog[port]); tSense[port].port=portnum[port]; print("1-wire bus I/O port %d controlled by cog %d\n", tSense[port].port, tSense[port].cognum); } print("Looking for temperature sensors\n"); //display the serial numbers while (1) { putChar(2); //position cursor. x and y coordinates follow putChar(0); //far left putChar(ONE_WIRE_BUSES+2); //line number for (port=0;port<ONE_WIRE_BUSES;port++){ for (devNum=0;devNum<tSense[port].NoDevices;devNum++){ print("Port %2d Sensor %02d S/N ", tSense[port].port, devNum+1); for (byte=0;byte<sizeof(tSense[port].SerialNum[0]);byte++) print("%02x", tSense[port].SerialNum[devNum][byte]); print("\n"); } } for (port=0;port<ONE_WIRE_BUSES;port++){ for (devNum=0;devNum<tSense[port].NoDevices;devNum++){ //use putchar calls to control the SimpleIDE terminal if (tSense[port].temperature[devNum]!=SHRT_MAX){ print("Port %2d-%02d %9.4fC %9.4fF", tSense[port].port, devNum+1, tSense[port].temperature[devNum]/16.0, 32+(9*tSense[port].temperature[devNum])/80.0); } else { print("Port %2d-%02d Error", tSense[port].port, devNum+1); } putChar(11); //clear to end of line print("\n"); } } putChar(12); //clear lines below cursor pause(750); } } void startConversion(uchar exPower, int portnum){ owTouchReset(portnum); //may not be necessary, but doesn't hurt owWriteByte(portnum,0xcc); //address all one-wire devices if (exPower){ //all devices are externally powered owWriteByte(portnum,0x44); //restart the temperature measurement }else{ //at least one device is parasite powered owWriteBytePower(portnum,0x44); //restart the temperature measurement sleep(1); //wait for temperature conversion to complete } } void ReadTemp() //function runs in other cog { unsigned short int counter; short int temp; int devNum=0; unsigned char byte, tSensor[MAXDEVICES]={0}; uchar utilcrc8, tdata, exPower; int NumDevices; int portnum; int index; //the index of the structure array this function is using //find out which I/O port and which index of the structure we are to use do{ usleep(100); for (index=0;(index<ONE_WIRE_BUSES) && (cogid()!=tSense[index].cognum);index++); }while (cogid()!=tSense[index].cognum); portnum=tSense[index].port; //no changes to port number after this function starts for (devNum=0;devNum<MAXDEVICES;devNum++){ tSense[index].temperature[devNum]=SHRT_MAX; //initialize temperature to error value } do{ // Find the temperature sensor(s). Only look for family 0x28 (DS18B20 temperature sensors) NumDevices = FindDevices(portnum, tSense[index].SerialNum, 0x28, MAXDEVICES); }while (NumDevices==0); tSense[index].NoDevices=NumDevices; //see if any devices are using parasite power owTouchReset(portnum); owWriteByte(portnum,0xcc); //address all one-wire devices owWriteByte(portnum,0xb4); //read power supply command exPower=owTouchBit(portnum, 1); //if any devices are parasite powered the line will be pulled low // if (exPower) print("All devices are externally powered\n"); // else print("Parasite power is in use\n"); startConversion(exPower, portnum); //start the temperature measurement while(1){ if (owTouchBit(portnum, 1)) { //the devices are all done converting the temperature for (devNum=0;devNum<NumDevices;devNum++){ owSerialNum(portnum, tSense[index].SerialNum[devNum], 0); //put in the serial number of the sensor we want to read tSensor[devNum] = owAccess(portnum); //address the temperature sensor owWriteByte(portnum,0xbe); //tell sensor to send the temperature setcrc8(portnum, 0); //initialize the CRC to 0 //read the scratchpad except for CRC for (byte=0; byte<8; byte++) { tdata=owReadByte(portnum); if (byte==0) temp=tdata; //read temperature LSB if (byte==1) temp|=(tdata<<8); //read temperature MSB utilcrc8=docrc8(portnum, tdata); //calculate CRC } tdata=owReadByte(portnum); //read the CRC from the scratchpad if (utilcrc8==tdata) { tSense[index].temperature[devNum]=temp; } else { tSense[index].temperature[devNum]=SHRT_MAX; //CRC doesn't match. Indicates an error } } startConversion(exPower, portnum); //restart the temperature measurement } } return; }
41.403846
122
0.65908
4d73a016ef546d4550fb3211e07c2ae3257929d4
553
h
C
tests/structures_tests.h
Ezibenroc/satsolver
5f58b8f9502090f05cbc2351304a289530b74f63
[ "MIT" ]
1
2017-11-29T00:46:23.000Z
2017-11-29T00:46:23.000Z
tests/structures_tests.h
Ezibenroc/satsolver
5f58b8f9502090f05cbc2351304a289530b74f63
[ "MIT" ]
null
null
null
tests/structures_tests.h
Ezibenroc/satsolver
5f58b8f9502090f05cbc2351304a289530b74f63
[ "MIT" ]
null
null
null
#ifndef STRUCTURES_TESTS_H #define STRUCTURES_TESTS_H #include <cppunit/TestFixture.h> class StructuresTests : public CppUnit::TestFixture { private: void testClauseCreation(); void testBasicUsage(); void testAffectationCreationUsage(); void testSetTrueClause() ; void testFormula() ; void testAdjGraph(); void testExtendedFormula(); void testExtendedFormulaComparison(); void testExtendedFormulaSimplification(); public: static CppUnit::Test* suite(); }; #endif
26.333333
53
0.678119
065ba2d91d38779bfa7a6fcb7dbf06bde182f08a
3,049
c
C
mqtttest/user/mqttecho.c
weipengyiyu/ESP8266_RTOS_SDK-2.0.0
1674f556189e38f54a1ee8126b639e4b469b41c5
[ "BSD-3-Clause" ]
1
2022-03-26T03:19:02.000Z
2022-03-26T03:19:02.000Z
mqtttest/user/mqttecho.c
weipengyiyu/ESP8266_RTOS_SDK-2.0.0
1674f556189e38f54a1ee8126b639e4b469b41c5
[ "BSD-3-Clause" ]
1
2021-06-03T03:12:52.000Z
2021-06-03T03:12:52.000Z
mqtttest/user/mqttecho.c
weipengyiyu/ESP8266_RTOS_SDK-2.0.0
1674f556189e38f54a1ee8126b639e4b469b41c5
[ "BSD-3-Clause" ]
null
null
null
#include <stddef.h> #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "mqtt/MQTTClient.h" #include "user_config.h" #define MQTT_CLIENT_THREAD_NAME "mqtt_client_thread" #define MQTT_CLIENT_THREAD_STACK_WORDS 2048 #define MQTT_CLIENT_THREAD_PRIO 8 LOCAL xTaskHandle mqttc_client_handle; static void messageArrived(MessageData* data) { printf("Message arrived: %s\n", data->message->payload); } static void mqtt_client_thread(void* pvParameters) { printf("mqtt client thread starts\n"); MQTTClient client; Network network; unsigned char sendbuf[80], readbuf[80] = {0}; int rc = 0, count = 0; MQTTPacket_connectData connectData = MQTTPacket_connectData_initializer; pvParameters = 0; NetworkInit(&network); MQTTClientInit(&client, &network, 30000, sendbuf, sizeof(sendbuf), readbuf, sizeof(readbuf)); char* address = "150.109.62.103"; if ((rc = NetworkConnect(&network, address, 10168)) != 0) { printf("Return code from network connect is %d\n", rc); } printf("connectData1\n"); #if defined(MQTT_TASK) if ((rc = MQTTStartTask(&client)) != pdPASS) { printf("Return code from start tasks is %d\n", rc); } else { printf("Use MQTTStartTask\n"); } #endif printf("connectData2\n"); connectData.MQTTVersion = 3; connectData.clientID.cstring = "ESP8266_sample"; if ((rc = MQTTConnect(&client, &connectData)) != 0) { printf("Return code from MQTT connect is %d\n", rc); } else { printf("MQTT Connected\n"); } printf("connectData3\n"); if ((rc = MQTTSubscribe(&client, "ESP8266/sample/sub", 2, messageArrived)) != 0) { printf("Return code from MQTT subscribe is %d\n", rc); } else { printf("MQTT subscribe to topic \"ESP8266/sample/sub\"\n"); } printf("connectData4\n"); while (++count) { printf("connectData2\n"); MQTTMessage message; char payload[30]; message.qos = QOS2; message.retained = 0; message.payload = payload; sprintf(payload, "message number %d", count); message.payloadlen = strlen(payload); if ((rc = MQTTPublish(&client, "ESP8266/sample/pub", &message)) != 0) { printf("Return code from MQTT publish is %d\n", rc); } else { printf("MQTT publish topic \"ESP8266/sample/pub\", message number is %d\n", count); } vTaskDelay(1000 / portTICK_RATE_MS); //send every 1 seconds } printf("connectData5\n"); printf("mqtt_client_thread going to be deleted\n"); vTaskDelete(NULL); return; } void user_conn_init(void) { int ret; ret = xTaskCreate(mqtt_client_thread, MQTT_CLIENT_THREAD_NAME, MQTT_CLIENT_THREAD_STACK_WORDS, NULL, MQTT_CLIENT_THREAD_PRIO, &mqttc_client_handle); if (ret != pdPASS) { printf("mqtt create client thread %s failed\n", MQTT_CLIENT_THREAD_NAME); } }
28.495327
97
0.627091
9e60f3d2bc6fbe296a9c8ef125b248e5988c8d07
489
h
C
ShreddedBread/Scenes/JJStatistics/ViewController/LXViewSelectorController.h
YunZhiJunXiPeng/ShreddedBread
ebec6812da385cf0608a4796db80e96c67ef34f0
[ "MIT" ]
3
2016-10-05T04:49:11.000Z
2016-10-07T06:00:53.000Z
ShreddedBread/Scenes/JJStatistics/ViewController/LXViewSelectorController.h
YunZhiJunXiPeng/ShreddedBread
ebec6812da385cf0608a4796db80e96c67ef34f0
[ "MIT" ]
null
null
null
ShreddedBread/Scenes/JJStatistics/ViewController/LXViewSelectorController.h
YunZhiJunXiPeng/ShreddedBread
ebec6812da385cf0608a4796db80e96c67ef34f0
[ "MIT" ]
null
null
null
// // LXViewSelectorController.h // ViewSelector // // Created by XiaoleiLi on 16/8/8. // Copyright © 2016年 leehyoley. All rights reserved. // #import <UIKit/UIKit.h> @interface LXViewSelectorController : UIViewController //标题字体大小(默认14) @property (nonatomic,assign)CGFloat fontSize; //提示条大小(默认为40,2) @property (nonatomic,assign)CGSize tipSize; //选中颜色(默认为红色) @property (nonatomic,strong)UIColor *selectedColor; //未选中颜色(默认为黑色) @property (nonatomic,assign)UIColor *normalColor; @end
20.375
54
0.752556
b124390dad47308aa863f8236581f98c6f5a278c
2,014
h
C
Code/Ports/DNP3Port/DNP3Port.h
cpp-rakesh/opendatacon
0fabe335ab5d358c1c6ea3c5b09437c0b059c38f
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
Code/Ports/DNP3Port/DNP3Port.h
cpp-rakesh/opendatacon
0fabe335ab5d358c1c6ea3c5b09437c0b059c38f
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
Code/Ports/DNP3Port/DNP3Port.h
cpp-rakesh/opendatacon
0fabe335ab5d358c1c6ea3c5b09437c0b059c38f
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
/* opendatacon * * Copyright (c) 2014: * * DCrip3fJguWgVCLrZFfA7sIGgvx1Ou3fHfCxnrz4svAi * yxeOtDhDCXf1Z4ApgXvX5ahqQmzRfJ2DoX8S05SqHA== * * 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. */ /* * DNP3Port.h * * Created on: 18/07/2014 * Author: Neil Stephens <dearknarl@gmail.com> */ #ifndef DNP3PORT_H_ #define DNP3PORT_H_ #include "DNP3PortConf.h" #include "DNP3Log2spdlog.h" #include "ChannelHandler.h" #include <unordered_map> #include <opendatacon/DataPort.h> #include <opendnp3/DNP3Manager.h> using namespace odc; class DNP3Port: public DataPort { friend class ChannelHandler; friend class ChannelLinksWatchdog; public: DNP3Port(const std::string& aName, const std::string& aConfFilename, const Json::Value& aConfOverrides); ~DNP3Port() override; void Enable() override =0; void Disable() override =0; void Build() override =0; //Override DataPort for UI const Json::Value GetStatus() const override; void Event(std::shared_ptr<const EventInfo> event, const std::string& SenderName, SharedStatusCallback_t pStatusCallback) override = 0; void ProcessElements(const Json::Value& JSONRoot) override; protected: inline std::weak_ptr<DataPort> ptr() { return weak_from_this(); } std::unique_ptr<ChannelHandler> pChanH; std::shared_ptr<opendnp3::DNP3Manager> IOMgr; virtual void LinkDeadnessChange(LinkDeadness from, LinkDeadness to) = 0; virtual void ChannelWatchdogTrigger(bool on) = 0; virtual TCPClientServer ClientOrServer() = 0; }; #endif /* DNP3PORT_H_ */
28.366197
136
0.753724
7f791c7b653bfab9489d5ef2f02414757e513328
1,410
c
C
sdk-6.5.16/src/bcm/common/ipfix.c
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
sdk-6.5.16/src/bcm/common/ipfix.c
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
sdk-6.5.16/src/bcm/common/ipfix.c
copslock/broadcom_cpri
8e2767676e26faae270cf485591902a4c50cf0c5
[ "Spencer-94" ]
null
null
null
/* * * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. * * Copyright 2007-2019 Broadcom Inc. All rights reserved. * * File: ipfix.c * Purpose: IPFIX common APIs */ #include <soc/drv.h> #include <bcm/ipfix.h> /* * Function: * bcm_ipfix_config_t_init * Description: * Initialize an IPFIX config structure * Parameters: * config pointer to IPFIX config structure * Return: none */ void bcm_ipfix_config_t_init(bcm_ipfix_config_t *config) { if (NULL != config) { sal_memset(config, 0, sizeof(bcm_ipfix_config_t)); } return; } /* * Function: * bcm_ipfix_rate_t_init * Description: * Initialize an IPFIX rate structure * Parameters: * rate pointer to IPFIX rate structure * Return: none */ void bcm_ipfix_rate_t_init(bcm_ipfix_rate_t *rate) { if (NULL != rate) { sal_memset(rate, 0, sizeof(bcm_ipfix_rate_t)); } return; } /* * Function: * bcm_ipfix_mirror_config_t_init * Description: * Initialize an IPFIX mirror config structure * Parameters: * config pointer to IPFIX mirror config structure * Return: none */ void bcm_ipfix_mirror_config_t_init(bcm_ipfix_mirror_config_t *config) { if (NULL != config) { sal_memset(config, 0, sizeof(bcm_ipfix_mirror_config_t)); } return; }
21.044776
134
0.676596
7fd30b575048b5843b137052c059729d4ffaa6d4
7,011
h
C
components/arc/intent_helper/arc_intent_helper_bridge.h
mghgroup/Glide-Browser
6a4c1eaa6632ec55014fee87781c6bbbb92a2af5
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
components/arc/intent_helper/arc_intent_helper_bridge.h
mghgroup/Glide-Browser
6a4c1eaa6632ec55014fee87781c6bbbb92a2af5
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
null
null
null
components/arc/intent_helper/arc_intent_helper_bridge.h
mghgroup/Glide-Browser
6a4c1eaa6632ec55014fee87781c6bbbb92a2af5
[ "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
2
2021-01-05T23:43:46.000Z
2021-01-07T23:36:34.000Z
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_ARC_INTENT_HELPER_ARC_INTENT_HELPER_BRIDGE_H_ #define COMPONENTS_ARC_INTENT_HELPER_ARC_INTENT_HELPER_BRIDGE_H_ #include <map> #include <memory> #include <set> #include <string> #include <vector> #include "base/containers/flat_set.h" #include "base/macros.h" #include "base/observer_list.h" #include "base/threading/thread_checker.h" #include "components/arc/intent_helper/activity_icon_loader.h" #include "components/arc/intent_helper/arc_intent_helper_observer.h" #include "components/arc/mojom/intent_helper.mojom.h" #include "components/keyed_service/core/keyed_service.h" #include "url/gurl.h" class KeyedServiceBaseFactory; namespace content { class BrowserContext; } // namespace content namespace arc { class AdaptiveIconDelegate; class ArcBridgeService; class ControlCameraAppDelegate; class FactoryResetDelegate; class IntentFilter; class OpenUrlDelegate; // Receives intents from ARC. class ArcIntentHelperBridge : public KeyedService, public mojom::IntentHelperHost { public: // Returns singleton instance for the given BrowserContext, // or nullptr if the browser |context| is not allowed to use ARC. static ArcIntentHelperBridge* GetForBrowserContext( content::BrowserContext* context); // Returns factory for the ArcIntentHelperBridge. static KeyedServiceBaseFactory* GetFactory(); // Appends '.' + |to_append| to the intent helper package name. static std::string AppendStringToIntentHelperPackageName( const std::string& to_append); static void SetOpenUrlDelegate(OpenUrlDelegate* delegate); static void SetControlCameraAppDelegate(ControlCameraAppDelegate* delegate); static void SetFactoryResetDelegate(FactoryResetDelegate* delegate); ArcIntentHelperBridge(content::BrowserContext* context, ArcBridgeService* bridge_service); ~ArcIntentHelperBridge() override; void SetAdaptiveIconDelegate(AdaptiveIconDelegate* delegate); void AddObserver(ArcIntentHelperObserver* observer); void RemoveObserver(ArcIntentHelperObserver* observer); bool HasObserver(ArcIntentHelperObserver* observer) const; void HandleCameraResult( uint32_t intent_id, arc::mojom::CameraIntentAction action, const std::vector<uint8_t>& data, arc::mojom::IntentHelperInstance::HandleCameraResultCallback callback); // mojom::IntentHelperHost void OnIconInvalidated(const std::string& package_name) override; void OnIntentFiltersUpdated( std::vector<IntentFilter> intent_filters) override; void OnOpenDownloads() override; void OnOpenUrl(const std::string& url) override; void OnOpenCustomTab(const std::string& url, int32_t task_id, int32_t surface_id, int32_t top_margin, OnOpenCustomTabCallback callback) override; void OnOpenChromePage(mojom::ChromePage page) override; void OpenWallpaperPicker() override; void SetWallpaperDeprecated(const std::vector<uint8_t>& jpeg_data) override; void OpenVolumeControl() override; void FactoryResetArc() override; void OnOpenWebApp(const std::string& url) override; void RecordShareFilesMetrics(mojom::ShareFiles flag) override; void LaunchCameraApp(uint32_t intent_id, arc::mojom::CameraIntentMode mode, bool should_handle_result, bool should_down_scale, bool is_secure, int32_t task_id) override; void OnIntentFiltersUpdatedForPackage( const std::string& package_name, std::vector<IntentFilter> intent_filters) override; void CloseCameraApp() override; void IsChromeAppEnabled(arc::mojom::ChromeApp app, IsChromeAppEnabledCallback callback) override; void OnPreferredAppsChanged(std::vector<IntentFilter> added, std::vector<IntentFilter> deleted) override; // Retrieves icons for the |activities| and calls |callback|. // See ActivityIconLoader::GetActivityIcons() for more details. using ActivityName = internal::ActivityIconLoader::ActivityName; // A part of OnIconsReadyCallback signature. using ActivityToIconsMap = internal::ActivityIconLoader::ActivityToIconsMap; using OnIconsReadyCallback = internal::ActivityIconLoader::OnIconsReadyCallback; using GetResult = internal::ActivityIconLoader::GetResult; GetResult GetActivityIcons(const std::vector<ActivityName>& activities, OnIconsReadyCallback callback); // Returns true when |url| can only be handled by Chrome. Otherwise, which is // when there might be one or more ARC apps that can handle |url|, returns // false. This function synchronously checks the |url| without making any IPC // to ARC side. Note that this function only supports http and https. If url's // scheme is neither http nor https, the function immediately returns true // without checking the filters. bool ShouldChromeHandleUrl(const GURL& url); // Returns false if |package_name| is for the intent_helper apk. static bool IsIntentHelperPackage(const std::string& package_name); // Filters out handlers that belong to the intent_helper apk and returns // a new array. static std::vector<mojom::IntentHandlerInfoPtr> FilterOutIntentHelper( std::vector<mojom::IntentHandlerInfoPtr> handlers); static const char kArcIntentHelperPackageName[]; const std::vector<IntentFilter>& GetIntentFilterForPackage( const std::string& package_name); const std::vector<IntentFilter>& GetAddedPreferredApps(); const std::vector<IntentFilter>& GetDeletedPreferredApps(); private: THREAD_CHECKER(thread_checker_); content::BrowserContext* const context_; ArcBridgeService* const arc_bridge_service_; // Owned by ArcServiceManager. internal::ActivityIconLoader icon_loader_; // A map of each package name to the intent filters for that package. // Used to determine if Chrome should handle a URL without handing off to // Android. // TODO(crbug.com/853604): Now the package name exists in the map key as well // as the IntentFilter struct, it is a duplication. Should update the ARC // mojom type to optimise the structure. std::map<std::string, std::vector<IntentFilter>> intent_filters_; base::ObserverList<ArcIntentHelperObserver>::Unchecked observer_list_; // Schemes that ARC is known to send via OnOpenUrl. const std::set<std::string> allowed_arc_schemes_; // The preferred app added in ARC. std::vector<IntentFilter> added_preferred_apps_; // The preferred app deleted in ARC. std::vector<IntentFilter> deleted_preferred_apps_; DISALLOW_COPY_AND_ASSIGN(ArcIntentHelperBridge); }; } // namespace arc #endif // COMPONENTS_ARC_INTENT_HELPER_ARC_INTENT_HELPER_BRIDGE_H_
39.38764
80
0.749109
36dcb38510d8d64bc8293489ff9b962b6797d956
2,548
h
C
clients/cpp-ue4/generated/Public/OpenAPIMoveCategoryApi.h
cliffano/pokeapi-clients
92af296c68c3e94afac52642ae22057faaf071ee
[ "MIT" ]
null
null
null
clients/cpp-ue4/generated/Public/OpenAPIMoveCategoryApi.h
cliffano/pokeapi-clients
92af296c68c3e94afac52642ae22057faaf071ee
[ "MIT" ]
null
null
null
clients/cpp-ue4/generated/Public/OpenAPIMoveCategoryApi.h
cliffano/pokeapi-clients
92af296c68c3e94afac52642ae22057faaf071ee
[ "MIT" ]
null
null
null
/** * * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * OpenAPI spec version: 20220523 * * * NOTE: This class is auto generated by OpenAPI Generator * https://github.com/OpenAPITools/openapi-generator * Do not edit the class manually. */ #pragma once #include "CoreMinimal.h" #include "OpenAPIBaseModel.h" namespace OpenAPI { class OPENAPI_API OpenAPIMoveCategoryApi { public: OpenAPIMoveCategoryApi(); ~OpenAPIMoveCategoryApi(); /* Sets the URL Endpoint. * Note: several fallback endpoints can be configured in request retry policies, see Request::SetShouldRetry */ void SetURL(const FString& Url); /* Adds global header params to all requests */ void AddHeaderParam(const FString& Key, const FString& Value); void ClearHeaderParams(); /* Sets the retry manager to the user-defined retry manager. User must manage the lifetime of the retry manager. * If no retry manager is specified and a request needs retries, a default retry manager will be used. * See also: Request::SetShouldRetry */ void SetHttpRetryManager(FHttpRetrySystem::FManager& RetryManager); FHttpRetrySystem::FManager& GetHttpRetryManager(); class MoveCategoryListRequest; class MoveCategoryListResponse; class MoveCategoryReadRequest; class MoveCategoryReadResponse; DECLARE_DELEGATE_OneParam(FMoveCategoryListDelegate, const MoveCategoryListResponse&); DECLARE_DELEGATE_OneParam(FMoveCategoryReadDelegate, const MoveCategoryReadResponse&); FHttpRequestPtr MoveCategoryList(const MoveCategoryListRequest& Request, const FMoveCategoryListDelegate& Delegate = FMoveCategoryListDelegate()) const; FHttpRequestPtr MoveCategoryRead(const MoveCategoryReadRequest& Request, const FMoveCategoryReadDelegate& Delegate = FMoveCategoryReadDelegate()) const; private: void OnMoveCategoryListResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FMoveCategoryListDelegate Delegate) const; void OnMoveCategoryReadResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FMoveCategoryReadDelegate Delegate) const; FHttpRequestRef CreateHttpRequest(const Request& Request) const; bool IsValid() const; void HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const; FString Url; TMap<FString,FString> AdditionalHeaderParams; mutable FHttpRetrySystem::FManager* RetryManager = nullptr; mutable TUniquePtr<HttpRetryManager> DefaultRetryManager; }; }
38.029851
156
0.805338
d24165203b8ae26e7f7a38275e2b3a8dcec43773
3,069
h
C
components/rtgui/include/rtgui/font.h
Liufeilong66/Loongson-Smartloong-V3.0-RTT
d9e0f3a40b8adbeac04f99927619f5febb4f96eb
[ "Apache-2.0" ]
15
2018-11-12T04:29:53.000Z
2022-01-04T12:02:24.000Z
components/rtgui/include/rtgui/font.h
Liufeilong66/Loongson-Smartloong-V3.0-RTT
d9e0f3a40b8adbeac04f99927619f5febb4f96eb
[ "Apache-2.0" ]
1
2020-08-28T06:51:36.000Z
2020-08-28T06:51:36.000Z
components/rtgui/include/rtgui/font.h
Liufeilong66/Loongson-Smartloong-V3.0-RTT
d9e0f3a40b8adbeac04f99927619f5febb4f96eb
[ "Apache-2.0" ]
13
2018-06-02T21:01:58.000Z
2022-01-04T12:00:11.000Z
/* * File : font.h * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2006 - 2009, RT-Thread Development Team * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rt-thread.org/license/LICENSE * * Change Logs: * Date Author Notes * 2009-10-16 Bernard first version */ #ifndef __RTGUI_FONT_H__ #define __RTGUI_FONT_H__ #include <rtgui/rtgui.h> #include <rtgui/list.h> struct rtgui_font; struct rtgui_dc; struct rtgui_rect; struct rtgui_font_engine { /* font engine function */ void (*font_init)(struct rtgui_font *font); void (*font_load)(struct rtgui_font *font); void (*font_draw_text)(struct rtgui_font *font, struct rtgui_dc *dc, const char *text, rt_ubase_t len, struct rtgui_rect *rect); void (*font_get_metrics)(struct rtgui_font *font, const char *text, struct rtgui_rect *rect); }; /* * bitmap font engine */ struct rtgui_font_bitmap { const rt_uint8_t *bmp; /* bitmap font data */ const rt_uint8_t *char_width; /* each character width, NULL for fixed font */ const rt_uint32_t *offset; /* offset for each character */ rt_uint16_t width; /* font width */ rt_uint16_t height; /* font height */ rt_uint8_t first_char; rt_uint8_t last_char; }; extern const struct rtgui_font_engine bmp_font_engine; #include <rtgui/tree.h> SPLAY_HEAD(cache_tree, hz_cache); struct hz_cache { SPLAY_ENTRY(hz_cache) hz_node; rt_uint16_t hz_id; }; struct rtgui_hz_file_font { struct cache_tree cache_root; rt_uint16_t cache_size; /* font size */ rt_uint16_t font_size; rt_uint16_t font_data_size; /* file descriptor */ int fd; /* font file name */ const char *font_fn; }; extern const struct rtgui_font_engine rtgui_hz_file_font_engine; struct rtgui_font { /* font name */ char *family; /* font height */ rt_uint16_t height; /* refer count */ rt_uint32_t refer_count; /* font engine */ const struct rtgui_font_engine *engine; /* font private data */ void *data; /* the font list */ rtgui_list_t list; }; typedef struct rtgui_font rtgui_font_t; void rtgui_font_system_init(void); void rtgui_font_system_add_font(struct rtgui_font *font); void rtgui_font_system_remove_font(struct rtgui_font *font); struct rtgui_font *rtgui_font_default(void); void rtgui_font_set_defaut(struct rtgui_font *font); struct rtgui_font *rtgui_font_refer(const char *family, rt_uint16_t height); void rtgui_font_derefer(struct rtgui_font *font); /* draw a text */ void rtgui_font_draw(struct rtgui_font *font, struct rtgui_dc *dc, const char *text, rt_ubase_t len, struct rtgui_rect *rect); int rtgui_font_get_string_width(struct rtgui_font *font, const char *text); void rtgui_font_get_metrics(struct rtgui_font *font, const char *text, struct rtgui_rect *rect); /* used by stract font */ #define FONT_BMP_DATA_BEGIN #define FONT_BMP_DATA_END #endif
25.789916
126
0.705767
d27270fc1340af1fa65c68286bd488240fdd80e7
1,606
h
C
Classes/Native/UnityEngine_UnityEngine_AudioSettings3144015719.h
AkishinoShiame/Virtual-Elderly-Chatbot-IOS-Project-IOS-12
a834966bdb705a2e71db67f9d6db55e7e60065aa
[ "Apache-2.0" ]
null
null
null
Classes/Native/UnityEngine_UnityEngine_AudioSettings3144015719.h
AkishinoShiame/Virtual-Elderly-Chatbot-IOS-Project-IOS-12
a834966bdb705a2e71db67f9d6db55e7e60065aa
[ "Apache-2.0" ]
null
null
null
Classes/Native/UnityEngine_UnityEngine_AudioSettings3144015719.h
AkishinoShiame/Virtual-Elderly-Chatbot-IOS-Project-IOS-12
a834966bdb705a2e71db67f9d6db55e7e60065aa
[ "Apache-2.0" ]
null
null
null
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> #include "mscorlib_System_Object2689449295.h" // UnityEngine.AudioSettings/AudioConfigurationChangeHandler struct AudioConfigurationChangeHandler_t3743753033; #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // UnityEngine.AudioSettings struct AudioSettings_t3144015719 : public Il2CppObject { public: public: }; struct AudioSettings_t3144015719_StaticFields { public: // UnityEngine.AudioSettings/AudioConfigurationChangeHandler UnityEngine.AudioSettings::OnAudioConfigurationChanged AudioConfigurationChangeHandler_t3743753033 * ___OnAudioConfigurationChanged_0; public: inline static int32_t get_offset_of_OnAudioConfigurationChanged_0() { return static_cast<int32_t>(offsetof(AudioSettings_t3144015719_StaticFields, ___OnAudioConfigurationChanged_0)); } inline AudioConfigurationChangeHandler_t3743753033 * get_OnAudioConfigurationChanged_0() const { return ___OnAudioConfigurationChanged_0; } inline AudioConfigurationChangeHandler_t3743753033 ** get_address_of_OnAudioConfigurationChanged_0() { return &___OnAudioConfigurationChanged_0; } inline void set_OnAudioConfigurationChanged_0(AudioConfigurationChangeHandler_t3743753033 * value) { ___OnAudioConfigurationChanged_0 = value; Il2CppCodeGenWriteBarrier(&___OnAudioConfigurationChanged_0, value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif
29.2
185
0.837484
9a8aab3549b992ec2008ae0579b426c135bb195e
1,212
h
C
Plugins/UnrealCV/Source/UnrealCV/Public/Sensor/BoneSensor.h
cypypccpy/UnrealRL
b0e7c8ea734ea17b38d18b9e5ea891b271ab03a7
[ "Apache-2.0" ]
2
2021-11-15T14:45:54.000Z
2021-12-06T10:39:42.000Z
Plugins/UnrealCV/Source/UnrealCV/Public/Sensor/BoneSensor.h
cypypccpy/UnrealRL
b0e7c8ea734ea17b38d18b9e5ea891b271ab03a7
[ "Apache-2.0" ]
null
null
null
Plugins/UnrealCV/Source/UnrealCV/Public/Sensor/BoneSensor.h
cypypccpy/UnrealRL
b0e7c8ea734ea17b38d18b9e5ea891b271ab03a7
[ "Apache-2.0" ]
1
2022-03-25T01:26:10.000Z
2022-03-25T01:26:10.000Z
// Weichao Qiu @ 2017 #pragma once #include "Runtime/Engine/Classes/Components/PoseableMeshComponent.h" #include "CoreMinimal.h" /** * Information to describe a bone in a SkeletalMesh */ struct FBoneInfo { FString BoneName; FTransform BoneTM; FTransform ComponentTM; FTransform WorldTM; FString ToString() { return FString::Printf(TEXT("Bone: %s, %s"), *BoneName, *ComponentTM.ToHumanReadableString()); } }; /** * A native BoneSensor, use VisionBPLib to involve in blueprint */ class UNREALCV_API FBoneSensor { public: /** Construct a BoneSensor to extract data from a SkeletalMeshComponent */ FBoneSensor(const class USkeletalMeshComponent* InSkeletalMeshComponent); FBoneSensor(const class UPoseableMeshComponent* InPoseableMeshComponent); /** The bone names this BoneSensor should extract */ void SetBones(const TArray<FString>& InIncludedBoneNames); /** Read information and return as an array */ TArray<FBoneInfo> GetBonesInfo(); TArray<FBoneInfo> GetPoseableBonesInfo(); /** Only track the bone information specified in this list */ TArray<FString> IncludedBoneNames; private: const USkeletalMeshComponent* Component; const UPoseableMeshComponent* PoseableComponent; };
25.787234
96
0.769802
3c280b5831f36efcf20c45c01aca2052fe66f2ab
9,946
h
C
tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/joint_waypoint.h
johnwason/tesseract
186a34f77af4bbc2a9d6e571e5345f9209f26872
[ "BSD-2-Clause", "Apache-2.0" ]
1
2020-09-30T19:08:54.000Z
2020-09-30T19:08:54.000Z
tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/joint_waypoint.h
johnwason/tesseract
186a34f77af4bbc2a9d6e571e5345f9209f26872
[ "BSD-2-Clause", "Apache-2.0" ]
null
null
null
tesseract/tesseract_planning/tesseract_command_language/include/tesseract_command_language/joint_waypoint.h
johnwason/tesseract
186a34f77af4bbc2a9d6e571e5345f9209f26872
[ "BSD-2-Clause", "Apache-2.0" ]
1
2019-03-07T18:11:36.000Z
2019-03-07T18:11:36.000Z
/** * @file joint_waypoint.h * @brief * * @author Levi Armstrong * @date June 15, 2020 * @version TODO * @bug No known bugs * * @copyright Copyright (c) 2020, Southwest Research Institute * * @par License * Software License Agreement (Apache License) * @par * 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 * @par * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef TESSERACT_COMMAND_LANGUAGE_JOINT_WAYPOINT_H #define TESSERACT_COMMAND_LANGUAGE_JOINT_WAYPOINT_H #include <tesseract_common/macros.h> TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include <Eigen/Core> #include <memory> #include <vector> #include <tinyxml2.h> #include <boost/algorithm/string.hpp> TESSERACT_COMMON_IGNORE_WARNINGS_POP #include <tesseract_command_language/waypoint_type.h> #include <tesseract_common/utils.h> namespace tesseract_planning { class JointWaypoint { public: EIGEN_MAKE_ALIGNED_OPERATOR_NEW JointWaypoint() = default; // This constructs a Joint Waypoint from xml element JointWaypoint(const tinyxml2::XMLElement& xml_element) { const tinyxml2::XMLElement* names_element = xml_element.FirstChildElement("Names"); const tinyxml2::XMLElement* position_element = xml_element.FirstChildElement("Position"); if (!names_element) throw std::runtime_error("JointWaypoint: Must have Names element."); if (!position_element) throw std::runtime_error("JointWaypoint: Must have Position element."); std::vector<std::string> names_tokens, position_tokens; std::string names_string; tinyxml2::XMLError status = tesseract_common::QueryStringText(names_element, names_string); if (status != tinyxml2::XML_NO_ATTRIBUTE && status != tinyxml2::XML_SUCCESS) throw std::runtime_error("JointWaypoint: Error parsing Names string"); std::string position_string; status = tesseract_common::QueryStringText(position_element, position_string); if (status != tinyxml2::XML_NO_ATTRIBUTE && status != tinyxml2::XML_SUCCESS) throw std::runtime_error("JointWaypoint: Error parsing Position string"); boost::split(names_tokens, names_string, boost::is_any_of(" "), boost::token_compress_on); boost::split(position_tokens, position_string, boost::is_any_of(" "), boost::token_compress_on); if (names_tokens.empty() || position_tokens.empty()) throw std::runtime_error("JointWaypoint: Names or Position elements are empty."); if (names_tokens.size() != position_tokens.size()) throw std::runtime_error("JointWaypoint: Names and Position are not the same size."); if (!tesseract_common::isNumeric(position_tokens)) throw std::runtime_error("JointWaypoint: Positions are not all numeric values."); joint_names = names_tokens; waypoint.resize(static_cast<long>(names_tokens.size())); for (long i = 0; i < static_cast<long>(position_tokens.size()); ++i) tesseract_common::toNumeric<double>(position_tokens[static_cast<std::size_t>(i)], waypoint[i]); } int getType() const { return static_cast<int>(WaypointType::JOINT_WAYPOINT); } void print(const std::string& prefix = "") const { std::cout << prefix << "Joint WP: " << this->transpose() << std::endl; }; tinyxml2::XMLElement* toXML(tinyxml2::XMLDocument& doc) const { Eigen::IOFormat eigen_format(Eigen::StreamPrecision, Eigen::DontAlignCols, " ", " "); tinyxml2::XMLElement* xml_waypoint = doc.NewElement("Waypoint"); xml_waypoint->SetAttribute("type", std::to_string(getType()).c_str()); tinyxml2::XMLElement* xml_joint_waypoint = doc.NewElement("JointWaypoint"); tinyxml2::XMLElement* xml_joint_names = doc.NewElement("Names"); if (!joint_names.empty()) { std::string jn = joint_names[0]; for (std::size_t i = 1; i < joint_names.size(); ++i) jn += " " + joint_names[i]; xml_joint_names->SetText(jn.c_str()); } xml_joint_waypoint->InsertEndChild(xml_joint_names); std::stringstream position_string; position_string << waypoint.format(eigen_format); tinyxml2::XMLElement* xml_joint_position = doc.NewElement("Position"); xml_joint_position->SetText(position_string.str().c_str()); xml_joint_waypoint->InsertEndChild(xml_joint_position); xml_waypoint->InsertEndChild(xml_joint_waypoint); return xml_waypoint; } #ifndef SWIG ///////////////////// // Eigen Container // ///////////////////// using ConstTransposeReturnType = Eigen::VectorXd::ConstTransposeReturnType; //////////////////////// // Eigen Constructors // //////////////////////// // This constructor allows you to construct MyVectorType from Eigen expressions template <typename OtherDerived> JointWaypoint(std::vector<std::string> joint_names, const Eigen::MatrixBase<OtherDerived>& other) : waypoint(other), joint_names(std::move(joint_names)) { if (static_cast<Eigen::Index>(this->joint_names.size()) != this->waypoint.rows()) throw std::runtime_error("JointWaypoint: joint_names is not the same size as position!"); } JointWaypoint(std::vector<std::string> joint_names, std::initializer_list<double> l) : joint_names(std::move(joint_names)) { waypoint.resize(static_cast<Eigen::Index>(l.size())); Eigen::Index i = 0; for (auto& v : l) waypoint(i++) = v; if (static_cast<Eigen::Index>(this->joint_names.size()) != this->waypoint.rows()) throw std::runtime_error("JointWaypoint: joint_names is not the same size as position!"); } /////////////////// // Eigen Methods // /////////////////// /** @returns true if two are approximate */ inline Eigen::Index size() const { return waypoint.size(); } /** @returns norm of vector */ inline double norm() const { return waypoint.norm(); } /** @returns true if two are approximate */ inline bool isApprox(const Eigen::VectorXd& other, double prec = 1e-12) { return waypoint.isApprox(other, prec); } /** @returns the transpose of the joint positions */ inline ConstTransposeReturnType transpose() const { return waypoint.transpose(); } ///////////////////// // Eigen Operators // ///////////////////// // This method allows you to assign Eigen expressions to MyVectorType template <typename OtherDerived> inline JointWaypoint& operator=(const Eigen::MatrixBase<OtherDerived>& other) { waypoint = other; return *this; } template <typename OtherDerived> inline JointWaypoint& operator*=(const Eigen::MatrixBase<OtherDerived>& other) { waypoint = waypoint * other; return *this; } inline JointWaypoint& operator=(std::initializer_list<double> l) { waypoint.resize(static_cast<Eigen::Index>(l.size())); Eigen::Index i = 0; for (auto& v : l) waypoint(i++) = v; return *this; } template <typename OtherDerived> inline JointWaypoint operator*(const Eigen::MatrixBase<OtherDerived>& other) const { JointWaypoint jwp = *this; jwp.waypoint = jwp.waypoint * other; return jwp; } template <typename OtherDerived> inline JointWaypoint operator-(const Eigen::MatrixBase<OtherDerived>& other) const { JointWaypoint jwp = *this; jwp.waypoint = jwp.waypoint - other; return jwp; } template <typename OtherDerived> inline JointWaypoint operator+(const Eigen::MatrixBase<OtherDerived>& other) const { JointWaypoint jwp = *this; jwp.waypoint = jwp.waypoint + other; return jwp; } inline JointWaypoint operator-(const JointWaypoint& other) const { JointWaypoint jwp = *this; jwp.waypoint = jwp.waypoint - other.waypoint; return jwp; } template <typename OtherDerived> inline JointWaypoint operator+(const JointWaypoint& other) const { JointWaypoint jwp = *this; jwp.waypoint = jwp.waypoint + other.waypoint; return jwp; } inline Eigen::CommaInitializer<Eigen::VectorXd> operator<<(const double& s) { return Eigen::CommaInitializer<Eigen::VectorXd>(waypoint, s); } inline double& operator[](Eigen::Index i) { return waypoint[i]; } inline double operator[](Eigen::Index i) const { return waypoint[i]; } inline double& operator()(Eigen::Index i) { return waypoint(i); } inline double operator()(Eigen::Index i) const { return waypoint(i); } ////////////////////////// // Implicit Conversions // ////////////////////////// /** @return Implicit Conversions to read-only Eigen::VectorXd */ inline operator const Eigen::VectorXd&() const { return waypoint; } /** @return Implicit Conversions to writable Eigen::VectorXd */ inline operator Eigen::VectorXd&() { return waypoint; } /** @return Implicit Conversions to read-only Eigen::VectorXd */ inline operator Eigen::Ref<const Eigen::VectorXd>() const { return Eigen::Ref<const Eigen::VectorXd>(waypoint); } /** @return Implicit Conversions to writable Eigen::VectorXd */ inline operator Eigen::Ref<Eigen::VectorXd>() { return Eigen::Ref<Eigen::VectorXd>(waypoint); } ////////////////////////////////// // Cartesian Waypoint Container // ////////////////////////////////// #endif // SWIG Eigen::VectorXd waypoint; std::vector<std::string> joint_names; }; } // namespace tesseract_planning #ifdef SWIG %extend tesseract_planning::JointWaypoint { JointWaypoint(std::vector<std::string> joint_names, const Eigen::VectorXd& other) { return new tesseract_planning::JointWaypoint(joint_names, other); } } %tesseract_command_language_add_waypoint_type(JointWaypoint) #endif // SWIG #endif // TESSERACT_COMMAND_LANGUAGE_JOINT_WAYPOINT_H
34.296552
116
0.694752
82bacfc624c59c94785ab31175fc3cc5042a2ef2
10,135
h
C
linsched-linsched-alpha/drivers/staging/mei/mei_dev.h
usenixatc2021/SoftRefresh_Scheduling
589ba06c8ae59538973c22edf28f74a59d63aa14
[ "MIT" ]
null
null
null
linsched-linsched-alpha/drivers/staging/mei/mei_dev.h
usenixatc2021/SoftRefresh_Scheduling
589ba06c8ae59538973c22edf28f74a59d63aa14
[ "MIT" ]
null
null
null
linsched-linsched-alpha/drivers/staging/mei/mei_dev.h
usenixatc2021/SoftRefresh_Scheduling
589ba06c8ae59538973c22edf28f74a59d63aa14
[ "MIT" ]
null
null
null
/* * * Intel Management Engine Interface (Intel MEI) Linux driver * Copyright (c) 2003-2011, Intel Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * */ #ifndef _MEI_DEV_H_ #define _MEI_DEV_H_ #include <linux/types.h> #include <linux/watchdog.h> #include "mei.h" #include "hw.h" /* * watch dog definition */ #define MEI_WATCHDOG_DATA_SIZE 16 #define MEI_START_WD_DATA_SIZE 20 #define MEI_WD_PARAMS_SIZE 4 #define MEI_WD_STATE_INDEPENDENCE_MSG_SENT (1 << 0) /* * MEI PCI Device object */ extern struct pci_dev *mei_device; /* * AMTHI Client UUID */ extern const uuid_le mei_amthi_guid; /* * Watchdog Client UUID */ extern const uuid_le mei_wd_guid; /* * Watchdog independence state message */ extern const u8 mei_wd_state_independence_msg[3][4]; /* * Number of File descriptors/handles * that can be opened to the driver. * * Limit to 253: 255 Total Clients * minus internal client for AMTHI * minus internal client for Watchdog */ #define MEI_MAX_OPEN_HANDLE_COUNT 253 /* * Number of Maximum MEI Clients */ #define MEI_CLIENTS_MAX 255 /* File state */ enum file_state { MEI_FILE_INITIALIZING = 0, MEI_FILE_CONNECTING, MEI_FILE_CONNECTED, MEI_FILE_DISCONNECTING, MEI_FILE_DISCONNECTED }; /* MEI device states */ enum mei_states { MEI_INITIALIZING = 0, MEI_INIT_CLIENTS, MEI_ENABLED, MEI_RESETING, MEI_DISABLED, MEI_RECOVERING_FROM_RESET, MEI_POWER_DOWN, MEI_POWER_UP }; /* init clients states*/ enum mei_init_clients_states { MEI_START_MESSAGE = 0, MEI_ENUM_CLIENTS_MESSAGE, MEI_CLIENT_PROPERTIES_MESSAGE }; enum iamthif_states { MEI_IAMTHIF_IDLE, MEI_IAMTHIF_WRITING, MEI_IAMTHIF_FLOW_CONTROL, MEI_IAMTHIF_READING, MEI_IAMTHIF_READ_COMPLETE }; enum mei_file_transaction_states { MEI_IDLE, MEI_WRITING, MEI_WRITE_COMPLETE, MEI_FLOW_CONTROL, MEI_READING, MEI_READ_COMPLETE }; /* MEI CB */ enum mei_cb_major_types { MEI_READ = 0, MEI_WRITE, MEI_IOCTL, MEI_OPEN, MEI_CLOSE }; /* * Intel MEI message data struct */ struct mei_message_data { u32 size; char *data; } __packed; struct mei_cl_cb { struct list_head cb_list; enum mei_cb_major_types major_file_operations; void *file_private; struct mei_message_data request_buffer; struct mei_message_data response_buffer; unsigned long information; unsigned long read_time; struct file *file_object; }; /* MEI client instance carried as file->pirvate_data*/ struct mei_cl { struct list_head link; struct mei_device *dev; enum file_state state; wait_queue_head_t tx_wait; wait_queue_head_t rx_wait; wait_queue_head_t wait; int read_pending; int status; /* ID of client connected */ u8 host_client_id; u8 me_client_id; u8 mei_flow_ctrl_creds; u8 timer_count; enum mei_file_transaction_states reading_state; enum mei_file_transaction_states writing_state; int sm_state; struct mei_cl_cb *read_cb; }; struct mei_io_list { struct mei_cl_cb mei_cb; }; /* MEI private device struct */ struct mei_device { struct pci_dev *pdev; /* pointer to pci device struct */ /* * lists of queues */ /* array of pointers to aio lists */ struct mei_io_list read_list; /* driver read queue */ struct mei_io_list write_list; /* driver write queue */ struct mei_io_list write_waiting_list; /* write waiting queue */ struct mei_io_list ctrl_wr_list; /* managed write IOCTL list */ struct mei_io_list ctrl_rd_list; /* managed read IOCTL list */ struct mei_io_list amthi_cmd_list; /* amthi list for cmd waiting */ /* driver managed amthi list for reading completed amthi cmd data */ struct mei_io_list amthi_read_complete_list; /* * list of files */ struct list_head file_list; long open_handle_count; /* * memory of device */ unsigned int mem_base; unsigned int mem_length; void __iomem *mem_addr; /* * lock for the device */ struct mutex device_lock; /* device lock */ struct delayed_work timer_work; /* MEI timer delayed work (timeouts) */ bool recvd_msg; /* * hw states of host and fw(ME) */ u32 host_hw_state; u32 me_hw_state; /* * waiting queue for receive message from FW */ wait_queue_head_t wait_recvd_msg; wait_queue_head_t wait_stop_wd; /* * mei device states */ enum mei_states mei_state; enum mei_init_clients_states init_clients_state; u16 init_clients_timer; bool stop; bool need_reset; u32 extra_write_index; u32 rd_msg_buf[128]; /* used for control messages */ u32 wr_msg_buf[128]; /* used for control messages */ u32 ext_msg_buf[8]; /* for control responses */ u32 rd_msg_hdr; struct hbm_version version; struct mei_me_client *me_clients; /* Note: memory has to be allocated */ DECLARE_BITMAP(me_clients_map, MEI_CLIENTS_MAX); DECLARE_BITMAP(host_clients_map, MEI_CLIENTS_MAX); u8 me_clients_num; u8 me_client_presentation_num; u8 me_client_index; bool mei_host_buffer_is_empty; struct mei_cl wd_cl; bool wd_pending; bool wd_stopped; bool wd_bypass; /* if false, don't refresh watchdog ME client */ u16 wd_timeout; /* seconds ((wd_data[1] << 8) + wd_data[0]) */ u16 wd_due_counter; unsigned char wd_data[MEI_START_WD_DATA_SIZE]; struct file *iamthif_file_object; struct mei_cl iamthif_cl; struct mei_cl_cb *iamthif_current_cb; int iamthif_mtu; unsigned long iamthif_timer; u32 iamthif_stall_timer; unsigned char *iamthif_msg_buf; /* Note: memory has to be allocated */ u32 iamthif_msg_buf_size; u32 iamthif_msg_buf_index; enum iamthif_states iamthif_state; bool iamthif_flow_control_pending; bool iamthif_ioctl; bool iamthif_canceled; bool wd_interface_reg; }; /* * mei init function prototypes */ struct mei_device *mei_device_init(struct pci_dev *pdev); void mei_reset(struct mei_device *dev, int interrupts); int mei_hw_init(struct mei_device *dev); int mei_task_initialize_clients(void *data); int mei_initialize_clients(struct mei_device *dev); int mei_disconnect_host_client(struct mei_device *dev, struct mei_cl *cl); void mei_remove_client_from_file_list(struct mei_device *dev, u8 host_client_id); void mei_host_init_iamthif(struct mei_device *dev); void mei_allocate_me_clients_storage(struct mei_device *dev); u8 mei_find_me_client_update_filext(struct mei_device *dev, struct mei_cl *priv, const uuid_le *cguid, u8 client_id); /* * MEI IO List Functions */ void mei_io_list_init(struct mei_io_list *list); void mei_io_list_flush(struct mei_io_list *list, struct mei_cl *cl); /* * MEI ME Client Functions */ struct mei_cl *mei_cl_allocate(struct mei_device *dev); void mei_cl_init(struct mei_cl *cl, struct mei_device *dev); int mei_cl_flush_queues(struct mei_cl *cl); /** * mei_cl_cmp_id - tells if file private data have same id * * @fe1: private data of 1. file object * @fe2: private data of 2. file object * * returns true - if ids are the same and not NULL */ static inline bool mei_cl_cmp_id(const struct mei_cl *cl1, const struct mei_cl *cl2) { return cl1 && cl2 && (cl1->host_client_id == cl2->host_client_id) && (cl1->me_client_id == cl2->me_client_id); } /* * MEI Host Client Functions */ void mei_host_start_message(struct mei_device *dev); void mei_host_enum_clients_message(struct mei_device *dev); int mei_host_client_properties(struct mei_device *dev); /* * MEI interrupt functions prototype */ irqreturn_t mei_interrupt_quick_handler(int irq, void *dev_id); irqreturn_t mei_interrupt_thread_handler(int irq, void *dev_id); void mei_timer(struct work_struct *work); /* * MEI input output function prototype */ int mei_ioctl_connect_client(struct file *file, struct mei_connect_client_data *data); int mei_start_read(struct mei_device *dev, struct mei_cl *cl); int amthi_write(struct mei_device *dev, struct mei_cl_cb *priv_cb); int amthi_read(struct mei_device *dev, struct file *file, char __user *ubuf, size_t length, loff_t *offset); struct mei_cl_cb *find_amthi_read_list_entry(struct mei_device *dev, struct file *file); void mei_run_next_iamthif_cmd(struct mei_device *dev); void mei_free_cb_private(struct mei_cl_cb *priv_cb); int mei_find_me_client_index(const struct mei_device *dev, uuid_le cuuid); /* * Register Access Function */ /** * mei_reg_read - Reads 32bit data from the mei device * * @dev: the device structure * @offset: offset from which to read the data * * returns register value (u32) */ static inline u32 mei_reg_read(struct mei_device *dev, unsigned long offset) { return ioread32(dev->mem_addr + offset); } /** * mei_reg_write - Writes 32bit data to the mei device * * @dev: the device structure * @offset: offset from which to write the data * @value: register value to write (u32) */ static inline void mei_reg_write(struct mei_device *dev, unsigned long offset, u32 value) { iowrite32(value, dev->mem_addr + offset); } /** * mei_hcsr_read - Reads 32bit data from the host CSR * * @dev: the device structure * * returns the byte read. */ static inline u32 mei_hcsr_read(struct mei_device *dev) { return mei_reg_read(dev, H_CSR); } /** * mei_mecsr_read - Reads 32bit data from the ME CSR * * @dev: the device structure * * returns ME_CSR_HA register value (u32) */ static inline u32 mei_mecsr_read(struct mei_device *dev) { return mei_reg_read(dev, ME_CSR_HA); } /** * get_me_cb_rw - Reads 32bit data from the mei ME_CB_RW register * * @dev: the device structure * * returns ME_CB_RW register value (u32) */ static inline u32 mei_mecbrw_read(struct mei_device *dev) { return mei_reg_read(dev, ME_CB_RW); } /* * mei interface function prototypes */ void mei_hcsr_set(struct mei_device *dev); void mei_csr_clear_his(struct mei_device *dev); void mei_enable_interrupts(struct mei_device *dev); void mei_disable_interrupts(struct mei_device *dev); #endif
23.735363
81
0.755402
962f990defaebf8f13e09bd13c446dbcee67cadd
7,811
h
C
include/mcl/she.h
prprhyt/mcl
c0a8ceb8b9699c64732fa7d86f124d7abcb1ab56
[ "BSD-3-Clause" ]
null
null
null
include/mcl/she.h
prprhyt/mcl
c0a8ceb8b9699c64732fa7d86f124d7abcb1ab56
[ "BSD-3-Clause" ]
null
null
null
include/mcl/she.h
prprhyt/mcl
c0a8ceb8b9699c64732fa7d86f124d7abcb1ab56
[ "BSD-3-Clause" ]
null
null
null
#pragma once /** @file @brief C api of somewhat homomorphic encryption with one-time multiplication, based on prime-order pairings @author MITSUNARI Shigeo(@herumi) @license modified new BSD license http://opensource.org/licenses/BSD-3-Clause */ #include <mcl/bn.h> #ifdef _MSC_VER #ifdef MCLSHE_DLL_EXPORT #define MCLSHE_DLL_API __declspec(dllexport) #else #define MCLSHE_DLL_API __declspec(dllimport) #ifndef MCLSHE_NO_AUTOLINK #if MCLBN_FP_UNIT_SIZE == 4 #pragma comment(lib, "mclshe256.lib") #elif MCLBN_FP_UNIT_SIZE == 6 #pragma comment(lib, "mclshe384.lib") #else #pragma comment(lib, "mclshe512.lib") #endif #endif #endif #else #ifdef __EMSCRIPTEN__ #define MCLSHE_DLL_API __attribute__((used)) #else #define MCLSHE_DLL_API #endif #endif #ifdef __cplusplus extern "C" { #endif typedef struct { mclBnFr x; mclBnFr y; } sheSecretKey; typedef struct { mclBnG1 xP; mclBnG2 yQ; } shePublicKey; typedef struct { mclBnG1 S; mclBnG1 T; } sheCipherTextG1; typedef struct { mclBnG2 S; mclBnG2 T; } sheCipherTextG2; typedef struct { mclBnGT g[4]; } sheCipherTextGT; /* initialize this library call this once before using the other functions @param curve [in] enum value defined in mcl/bn.h @param maxUnitSize [in] MCLBN_FP_UNIT_SIZE (fixed) return 0 if success @note sheInit() is thread safe and serialized if it is called simultaneously but don't call it while using other functions. */ MCLSHE_DLL_API int sheInit(int curve, int maxUnitSize); // return written byte size if success else 0 MCLSHE_DLL_API mclSize sheSecretKeySerialize(void *buf, mclSize maxBufSize, const sheSecretKey *sec); MCLSHE_DLL_API mclSize shePublicKeySerialize(void *buf, mclSize maxBufSize, const shePublicKey *pub); MCLSHE_DLL_API mclSize sheCipherTextG1Serialize(void *buf, mclSize maxBufSize, const sheCipherTextG1 *c); MCLSHE_DLL_API mclSize sheCipherTextG2Serialize(void *buf, mclSize maxBufSize, const sheCipherTextG2 *c); MCLSHE_DLL_API mclSize sheCipherTextGTSerialize(void *buf, mclSize maxBufSize, const sheCipherTextGT *c); // return read byte size if sucess else 0 MCLSHE_DLL_API mclSize sheSecretKeyDeserialize(sheSecretKey* sec, const void *buf, mclSize bufSize); MCLSHE_DLL_API mclSize shePublicKeyDeserialize(shePublicKey* pub, const void *buf, mclSize bufSize); MCLSHE_DLL_API mclSize sheCipherTextG1Deserialize(sheCipherTextG1* c, const void *buf, mclSize bufSize); MCLSHE_DLL_API mclSize sheCipherTextG2Deserialize(sheCipherTextG2* c, const void *buf, mclSize bufSize); MCLSHE_DLL_API mclSize sheCipherTextGTDeserialize(sheCipherTextGT* c, const void *buf, mclSize bufSize); /* set secretKey if system has /dev/urandom or CryptGenRandom return 0 if success */ MCLSHE_DLL_API int sheSecretKeySetByCSPRNG(sheSecretKey *sec); MCLSHE_DLL_API void sheGetPublicKey(shePublicKey *pub, const sheSecretKey *sec); /* make table to decode DLP return 0 if success */ MCLSHE_DLL_API int sheSetRangeForDLP(mclSize hashSize); MCLSHE_DLL_API int sheSetRangeForG1DLP(mclSize hashSize); MCLSHE_DLL_API int sheSetRangeForG2DLP(mclSize hashSize); MCLSHE_DLL_API int sheSetRangeForGTDLP(mclSize hashSize); /* set tryNum to decode DLP */ MCLSHE_DLL_API void sheSetTryNum(mclSize tryNum); /* decode G1 via GT if use != 0 @note faster if tryNum >= 300 */ MCLSHE_DLL_API void sheUseDecG1ViaGT(int use); /* decode G2 via GT if use != 0 @note faster if tryNum >= 100 */ MCLSHE_DLL_API void sheUseDecG2ViaGT(int use); /* load table for DLP return read size if success else 0 */ MCLSHE_DLL_API mclSize sheLoadTableForG1DLP(const void *buf, mclSize bufSize); MCLSHE_DLL_API mclSize sheLoadTableForG2DLP(const void *buf, mclSize bufSize); MCLSHE_DLL_API mclSize sheLoadTableForGTDLP(const void *buf, mclSize bufSize); /* save table for DLP return written size if success else 0 */ MCLSHE_DLL_API mclSize sheSaveTableForG1DLP(void *buf, mclSize maxBufSize); MCLSHE_DLL_API mclSize sheSaveTableForG2DLP(void *buf, mclSize maxBufSize); MCLSHE_DLL_API mclSize sheSaveTableForGTDLP(void *buf, mclSize maxBufSize); // return 0 if success MCLSHE_DLL_API int sheEncG1(sheCipherTextG1 *c, const shePublicKey *pub, mclInt m); MCLSHE_DLL_API int sheEncG2(sheCipherTextG2 *c, const shePublicKey *pub, mclInt m); MCLSHE_DLL_API int sheEncGT(sheCipherTextGT *c, const shePublicKey *pub, mclInt m); /* decode c and set m return 0 if success */ MCLSHE_DLL_API int sheDecG1(mclInt *m, const sheSecretKey *sec, const sheCipherTextG1 *c); MCLSHE_DLL_API int sheDecG2(mclInt *m, const sheSecretKey *sec, const sheCipherTextG2 *c); MCLSHE_DLL_API int sheDecGT(mclInt *m, const sheSecretKey *sec, const sheCipherTextGT *c); /* decode c via GT and set m return 0 if success */ MCLSHE_DLL_API int sheDecG1ViaGT(mclInt *m, const sheSecretKey *sec, const sheCipherTextG1 *c); MCLSHE_DLL_API int sheDecG2ViaGT(mclInt *m, const sheSecretKey *sec, const sheCipherTextG2 *c); /* return 1 if dec(c) == 0 */ MCLSHE_DLL_API int sheIsZeroG1(const sheSecretKey *sec, const sheCipherTextG1 *c); MCLSHE_DLL_API int sheIsZeroG2(const sheSecretKey *sec, const sheCipherTextG2 *c); MCLSHE_DLL_API int sheIsZeroGT(const sheSecretKey *sec, const sheCipherTextGT *c); // return 0 if success // z = x + y MCLSHE_DLL_API int sheAddG1(sheCipherTextG1 *z, const sheCipherTextG1 *x, const sheCipherTextG1 *y); MCLSHE_DLL_API int sheAddG2(sheCipherTextG2 *z, const sheCipherTextG2 *x, const sheCipherTextG2 *y); MCLSHE_DLL_API int sheAddGT(sheCipherTextGT *z, const sheCipherTextGT *x, const sheCipherTextGT *y); // return 0 if success // z = x - y MCLSHE_DLL_API int sheSubG1(sheCipherTextG1 *z, const sheCipherTextG1 *x, const sheCipherTextG1 *y); MCLSHE_DLL_API int sheSubG2(sheCipherTextG2 *z, const sheCipherTextG2 *x, const sheCipherTextG2 *y); MCLSHE_DLL_API int sheSubGT(sheCipherTextGT *z, const sheCipherTextGT *x, const sheCipherTextGT *y); // return 0 if success // z = x * y MCLSHE_DLL_API int sheMulG1(sheCipherTextG1 *z, const sheCipherTextG1 *x, mclInt y); MCLSHE_DLL_API int sheMulG2(sheCipherTextG2 *z, const sheCipherTextG2 *x, mclInt y); MCLSHE_DLL_API int sheMulGT(sheCipherTextGT *z, const sheCipherTextGT *x, mclInt y); // return 0 if success // z = x * y MCLSHE_DLL_API int sheMul(sheCipherTextGT *z, const sheCipherTextG1 *x, const sheCipherTextG2 *y); /* sheMul(z, x, y) = sheMulML(z, x, y) + sheFinalExpGT(z) @note Mul(x1, y1) + ... + Mul(xn, yn) = finalExp(MulML(x1, y1) + ... + MulML(xn, yn)) */ MCLSHE_DLL_API int sheMulML(sheCipherTextGT *z, const sheCipherTextG1 *x, const sheCipherTextG2 *y); MCLSHE_DLL_API int sheFinalExpGT(sheCipherTextGT *y, const sheCipherTextGT *x); // return 0 if success // rerandomize(c) MCLSHE_DLL_API int sheReRandG1(sheCipherTextG1 *c, const shePublicKey *pub); MCLSHE_DLL_API int sheReRandG2(sheCipherTextG2 *c, const shePublicKey *pub); MCLSHE_DLL_API int sheReRandGT(sheCipherTextGT *c, const shePublicKey *pub); // return 0 if success // y = convert(x) MCLSHE_DLL_API int sheConvertG1(sheCipherTextGT *y, const shePublicKey *pub, const sheCipherTextG1 *x); MCLSHE_DLL_API int sheConvertG2(sheCipherTextGT *y, const shePublicKey *pub, const sheCipherTextG2 *x); struct shePrecomputedPublicKey; MCLSHE_DLL_API shePrecomputedPublicKey *shePrecomputedPublicKeyCreate(); MCLSHE_DLL_API void shePrecomputedPublicKeyDestroy(shePrecomputedPublicKey *ppub); // return 0 if success MCLSHE_DLL_API int shePrecomputedPublicKeyInit(shePrecomputedPublicKey *ppub, const shePublicKey *pub); MCLSHE_DLL_API int shePrecomputedPublicKeyEncG1(sheCipherTextG1 *c, const shePrecomputedPublicKey *ppub, mclInt m); MCLSHE_DLL_API int shePrecomputedPublicKeyEncG2(sheCipherTextG2 *c, const shePrecomputedPublicKey *ppub, mclInt m); MCLSHE_DLL_API int shePrecomputedPublicKeyEncGT(sheCipherTextGT *c, const shePrecomputedPublicKey *ppub, mclInt m); #ifdef __cplusplus } #endif
36.671362
115
0.792472
d0ec83fd457b8b314e96f6d85019fa867ff117fd
8,428
h
C
usr/src/lib/libcpc/common/libcpc_impl.h
AsahiOS/gate
283d47da4e17a5871d9d575e7ffb81e8f6c52e51
[ "MIT" ]
null
null
null
usr/src/lib/libcpc/common/libcpc_impl.h
AsahiOS/gate
283d47da4e17a5871d9d575e7ffb81e8f6c52e51
[ "MIT" ]
null
null
null
usr/src/lib/libcpc/common/libcpc_impl.h
AsahiOS/gate
283d47da4e17a5871d9d575e7ffb81e8f6c52e51
[ "MIT" ]
1
2020-12-30T00:04:16.000Z
2020-12-30T00:04:16.000Z
/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (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 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _LIBCPC_IMPL_H #define _LIBCPC_IMPL_H #pragma ident "%Z%%M% %I% %E% SMI" #include <libcpc.h> #include <inttypes.h> #include <thread.h> #include <synch.h> #include <sys/types.h> #include <sys/cpc_impl.h> #ifdef __cplusplus extern "C" { #endif #define CPC_VER_1 1 #define CPC1_BUFSIZE (2 * sizeof (uint64_t)) struct _cpc_attr { char ca_name[CPC_MAX_ATTR_LEN]; uint64_t ca_val; }; typedef struct __cpc_request cpc_request_t; struct __cpc_request { char cr_event[CPC_MAX_EVENT_LEN]; uint64_t cr_preset; /* Initial value */ uint16_t cr_index; /* Index of request in data */ uint_t cr_flags; uint_t cr_nattrs; /* # CPU-specific attrs */ kcpc_attr_t *cr_attr; cpc_request_t *cr_next; /* next request in set */ }; struct __cpc_buf { uint64_t *cb_data; /* Pointer to data store */ hrtime_t cb_hrtime; /* hrtime at last sample */ uint64_t cb_tick; /* virtualized tsc/tick */ size_t cb_size; /* Size of data store, bytes */ cpc_buf_t *cb_next; /* List of all bufs */ }; /* * Possible cpc_set_t states: */ typedef enum { CS_UNBOUND, /* Set is not currently bound */ CS_BOUND_CURLWP, /* Set has been bound to curlwp */ CS_BOUND_PCTX, /* Set has been bound via libpctx */ CS_BOUND_CPU /* Set has been bound to a CPU */ } __cpc_state_t; struct __cpc_set { cpc_request_t *cs_request; /* linked list of requests */ __cpc_state_t cs_state; /* State of this set */ int cs_nreqs; /* Number of requests in set */ int cs_fd; /* file descriptor of cpc dev */ processorid_t cs_obind; /* previous proc binding */ pctx_t *cs_pctx; /* pctx of process bound to */ id_t cs_id; /* lwp ID of pctx binding */ thread_t cs_thr; /* thread ID which bound set */ cpc_set_t *cs_next; /* Linked list of all sets */ }; struct __cpc { cpc_set_t *cpc_sets; /* List of existing sets */ cpc_buf_t *cpc_bufs; /* List of existing bufs */ cpc_errhndlr_t *cpc_errfn; /* Handles library errors */ mutex_t cpc_lock; /* Protect various ops */ char *cpc_attrlist; /* List of supported attrs */ char **cpc_evlist; /* List of events per pic */ char cpc_cpuref[CPC_MAX_CPUREF]; char cpc_cciname[CPC_MAX_IMPL_NAME]; uint_t cpc_caps; uint_t cpc_npic; }; /* * cpc_t handle for CPCv1 clients. */ extern cpc_t *__cpc; /*PRINTFLIKE2*/ extern void __cpc_error(const char *fn, const char *fmt, ...); extern const char *__cpc_reg_to_name(int cpuver, int regno, uint8_t bits); extern int __cpc_name_to_reg(int cpuver, int regno, const char *name, uint8_t *bits); extern uint_t __cpc_workver; extern int __cpc_v1_cpuver; #ifdef __sparc extern uint64_t __cpc_v1_pcr; #else extern uint32_t __cpc_v1_pes[2]; #endif /* __sparc */ extern char *__cpc_pack_set(cpc_set_t *set, uint_t flags, size_t *buflen); typedef struct __cpc_strhash cpc_strhash_t; struct __cpc_strhash { char *str; struct __cpc_strhash *cur; struct __cpc_strhash *next; }; extern cpc_strhash_t *__cpc_strhash_alloc(void); extern void __cpc_strhash_free(cpc_strhash_t *hash); extern int __cpc_strhash_add(cpc_strhash_t *hash, char *key); extern char *__cpc_strhash_next(cpc_strhash_t *hash); /* * Implementation-private system call used by libcpc */ struct __cpc; extern int __pctx_cpc(pctx_t *pctx, struct __cpc *cpc, int cmd, id_t lwpid, void *data1, void *data2, void *data3, int bufsize); #define CPUDRV "/devices/pseudo/cpc@0" #define CPUDRV_SHARED CPUDRV":shared" #if defined(__sparc) || defined(__i386) /* * These two are only used for backwards compatibility to the Obsolete CPCv1. */ extern int __cpc_init(void); extern cpc_set_t *__cpc_eventtoset(cpc_t *cpc, cpc_event_t *event, int flags); /* * ce_cpuver values */ #define CPC_ULTRA1 1000 #define CPC_ULTRA2 1001 /* same as ultra1 for these purposes */ #define CPC_ULTRA3 1002 #define CPC_ULTRA3_PLUS 1003 #define CPC_ULTRA3_I 1004 #define CPC_ULTRA4_PLUS 1005 #define CPC_PENTIUM 2000 #define CPC_PENTIUM_MMX 2001 #define CPC_PENTIUM_PRO 2002 #define CPC_PENTIUM_PRO_MMX 2003 #define CPC_SPARC64_III 3000 #define CPC_SPARC64_V 3002 #endif /* __sparc || __i386 */ #if defined(__i386) || defined(__amd64) /* * This is common between i386 and amd64, because amd64 implements %tick. * Currently only used by the cpc tools to print the label atop the CPU ticks * column on amd64. */ #define CPC_TICKREG_NAME "tsc" #endif /* __i386 || __amd64 */ #if defined(__sparc) /* * UltraSPARC I, II, III and IV processors * * The performance counters on these processors allow up to two 32-bit * performance events to be captured simultaneously from a selection * of metrics. The metrics are selected by writing to the performance * control register, and subsequent values collected by reading from the * performance instrumentation counter registers. Both registers are * priviliged by default, and implemented as ASRs. */ struct _cpc_event { int ce_cpuver; hrtime_t ce_hrt; /* gethrtime() */ uint64_t ce_tick; /* virtualized %tick */ uint64_t ce_pic[2]; /* virtualized %pic */ uint64_t ce_pcr; /* %pcr */ }; #define CPC_TICKREG(ev) ((ev)->ce_tick) #define CPC_TICKREG_NAME "%tick" /* * "Well known" bitfields in the UltraSPARC %pcr register * The interfaces in libcpc should make these #defines uninteresting. */ #define CPC_ULTRA_PCR_USR 2 #define CPC_ULTRA_PCR_SYS 1 #define CPC_ULTRA_PCR_PRIVPIC 0 #define CPC_ULTRA_PCR_PIC0_SHIFT 4 #define CPC_ULTRA2_PCR_PIC0_MASK UINT64_C(0xf) #define CPC_ULTRA3_PCR_PIC0_MASK UINT64_C(0x3f) #define CPC_ULTRA_PCR_PIC1_SHIFT 11 #define CPC_ULTRA2_PCR_PIC1_MASK UINT64_C(0xf) #define CPC_ULTRA3_PCR_PIC1_MASK UINT64_C(0x3f) #elif defined(__i386) /* * Pentium I, II and III processors * * These CPUs allow pairs of events to captured. * The hardware counters count up to 40-bits of significance, but * only allow 32 (signed) bits to be programmed into them. * Pentium I and Pentium II processors are programmed differently, but * the resulting counters and timestamps can be handled portably. */ struct _cpc_event { int ce_cpuver; hrtime_t ce_hrt; /* gethrtime() */ uint64_t ce_tsc; /* virtualized rdtsc value */ uint64_t ce_pic[2]; /* virtualized PerfCtr[01] */ uint32_t ce_pes[2]; /* Pentium II */ #define ce_cesr ce_pes[0] /* Pentium I */ }; #define CPC_TICKREG(ev) ((ev)->ce_tsc) /* * "Well known" bit fields in the Pentium CES register * The interfaces in libcpc should make these #defines uninteresting. */ #define CPC_P5_CESR_ES0_SHIFT 0 #define CPC_P5_CESR_ES0_MASK 0x3f #define CPC_P5_CESR_ES1_SHIFT 16 #define CPC_P5_CESR_ES1_MASK 0x3f #define CPC_P5_CESR_OS0 6 #define CPC_P5_CESR_USR0 7 #define CPC_P5_CESR_CLK0 8 #define CPC_P5_CESR_PC0 9 #define CPC_P5_CESR_OS1 (CPC_P5_CESR_OS0 + 16) #define CPC_P5_CESR_USR1 (CPC_P5_CESR_USR0 + 16) #define CPC_P5_CESR_CLK1 (CPC_P5_CESR_CLK0 + 16) #define CPC_P5_CESR_PC1 (CPC_P5_CESR_PC0 + 16) /* * "Well known" bit fields in the Pentium Pro PerfEvtSel registers * The interfaces in libcpc should make these #defines uninteresting. */ #define CPC_P6_PES_INV 23 #define CPC_P6_PES_EN 22 #define CPC_P6_PES_INT 20 #define CPC_P6_PES_PC 19 #define CPC_P6_PES_E 18 #define CPC_P6_PES_OS 17 #define CPC_P6_PES_USR 16 #define CPC_P6_PES_UMASK_SHIFT 8 #define CPC_P6_PES_UMASK_MASK (0xffu) #define CPC_P6_PES_CMASK_SHIFT 24 #define CPC_P6_PES_CMASK_MASK (0xffu) #define CPC_P6_PES_PIC0_MASK (0xffu) #define CPC_P6_PES_PIC1_MASK (0xffu) #endif /* __i386 */ #ifdef __cplusplus } #endif #endif /* _LIBCPC_IMPL_H */
28.569492
78
0.743593
19018f98705030a42b349b6207141cadb71a03b7
28,011
c
C
FreeBSD/sys/cddl/dev/fbt/fbt.c
TigerBSD/FreeBSD-Custom-ThinkPad
3d092f261b362f73170871403397fc5d6b89d1dc
[ "0BSD" ]
4
2016-08-22T22:02:55.000Z
2017-03-04T22:56:44.000Z
FreeBSD/sys/cddl/dev/fbt/fbt.c
TigerBSD/FreeBSD-Custom-ThinkPad
3d092f261b362f73170871403397fc5d6b89d1dc
[ "0BSD" ]
21
2016-08-11T09:43:43.000Z
2017-01-29T12:52:56.000Z
FreeBSD/sys/cddl/dev/fbt/fbt.c
TigerBSD/TigerBSD
3d092f261b362f73170871403397fc5d6b89d1dc
[ "0BSD" ]
null
null
null
/* * 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 * * Portions Copyright 2006-2008 John Birrell jb@freebsd.org * * $FreeBSD$ * */ /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #include <sys/cdefs.h> #include <sys/param.h> #include <sys/systm.h> #include <sys/conf.h> #include <sys/cpuvar.h> #include <sys/fcntl.h> #include <sys/filio.h> #include <sys/kdb.h> #include <sys/kernel.h> #include <sys/kmem.h> #include <sys/kthread.h> #include <sys/limits.h> #include <sys/linker.h> #include <sys/lock.h> #include <sys/malloc.h> #include <sys/module.h> #include <sys/mutex.h> #include <sys/pcpu.h> #include <sys/poll.h> #include <sys/proc.h> #include <sys/selinfo.h> #include <sys/smp.h> #include <sys/syscall.h> #include <sys/sysent.h> #include <sys/sysproto.h> #include <sys/uio.h> #include <sys/unistd.h> #include <machine/stdarg.h> #include <sys/dtrace.h> #include <sys/dtrace_bsd.h> #include "fbt.h" MALLOC_DEFINE(M_FBT, "fbt", "Function Boundary Tracing"); dtrace_provider_id_t fbt_id; fbt_probe_t **fbt_probetab; int fbt_probetab_mask; static d_open_t fbt_open; static int fbt_unload(void); static void fbt_getargdesc(void *, dtrace_id_t, void *, dtrace_argdesc_t *); static void fbt_provide_module(void *, modctl_t *); static void fbt_destroy(void *, dtrace_id_t, void *); static void fbt_enable(void *, dtrace_id_t, void *); static void fbt_disable(void *, dtrace_id_t, void *); static void fbt_load(void *); static void fbt_suspend(void *, dtrace_id_t, void *); static void fbt_resume(void *, dtrace_id_t, void *); static struct cdevsw fbt_cdevsw = { .d_version = D_VERSION, .d_open = fbt_open, .d_name = "fbt", }; static dtrace_pattr_t fbt_attr = { { DTRACE_STABILITY_EVOLVING, DTRACE_STABILITY_EVOLVING, DTRACE_CLASS_COMMON }, { DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN }, { DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_ISA }, { DTRACE_STABILITY_EVOLVING, DTRACE_STABILITY_EVOLVING, DTRACE_CLASS_COMMON }, { DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_ISA }, }; static dtrace_pops_t fbt_pops = { NULL, fbt_provide_module, fbt_enable, fbt_disable, fbt_suspend, fbt_resume, fbt_getargdesc, NULL, NULL, fbt_destroy }; static struct cdev *fbt_cdev; static int fbt_probetab_size; static int fbt_verbose = 0; int fbt_excluded(const char *name) { if (strncmp(name, "dtrace_", 7) == 0 && strncmp(name, "dtrace_safe_", 12) != 0) { /* * Anything beginning with "dtrace_" may be called * from probe context unless it explicitly indicates * that it won't be called from probe context by * using the prefix "dtrace_safe_". */ return (1); } /* Exclude some internal functions */ if (name[0] == '_' && name[1] == '_') return (1); /* * When DTrace is built into the kernel we need to exclude * the FBT functions from instrumentation. */ #ifndef _KLD_MODULE if (strncmp(name, "fbt_", 4) == 0) return (1); #endif return (0); } static void fbt_doubletrap(void) { fbt_probe_t *fbt; int i; for (i = 0; i < fbt_probetab_size; i++) { fbt = fbt_probetab[i]; for (; fbt != NULL; fbt = fbt->fbtp_next) fbt_patch_tracepoint(fbt, fbt->fbtp_savedval); } } static void fbt_provide_module(void *arg, modctl_t *lf) { char modname[MAXPATHLEN]; int i; size_t len; strlcpy(modname, lf->filename, sizeof(modname)); len = strlen(modname); if (len > 3 && strcmp(modname + len - 3, ".ko") == 0) modname[len - 3] = '\0'; /* * Employees of dtrace and their families are ineligible. Void * where prohibited. */ if (strcmp(modname, "dtrace") == 0) return; /* * To register with DTrace, a module must list 'dtrace' as a * dependency in order for the kernel linker to resolve * symbols like dtrace_register(). All modules with such a * dependency are ineligible for FBT tracing. */ for (i = 0; i < lf->ndeps; i++) if (strncmp(lf->deps[i]->filename, "dtrace", 6) == 0) return; if (lf->fbt_nentries) { /* * This module has some FBT entries allocated; we're afraid * to screw with it. */ return; } /* * List the functions in the module and the symbol values. */ (void) linker_file_function_listall(lf, fbt_provide_module_function, modname); } static void fbt_destroy(void *arg, dtrace_id_t id, void *parg) { fbt_probe_t *fbt = parg, *next, *hash, *last; modctl_t *ctl; int ndx; do { ctl = fbt->fbtp_ctl; ctl->fbt_nentries--; /* * Now we need to remove this probe from the fbt_probetab. */ ndx = FBT_ADDR2NDX(fbt->fbtp_patchpoint); last = NULL; hash = fbt_probetab[ndx]; while (hash != fbt) { ASSERT(hash != NULL); last = hash; hash = hash->fbtp_hashnext; } if (last != NULL) { last->fbtp_hashnext = fbt->fbtp_hashnext; } else { fbt_probetab[ndx] = fbt->fbtp_hashnext; } next = fbt->fbtp_next; free(fbt, M_FBT); fbt = next; } while (fbt != NULL); } static void fbt_enable(void *arg, dtrace_id_t id, void *parg) { fbt_probe_t *fbt = parg; modctl_t *ctl = fbt->fbtp_ctl; ctl->nenabled++; /* * Now check that our modctl has the expected load count. If it * doesn't, this module must have been unloaded and reloaded -- and * we're not going to touch it. */ if (ctl->loadcnt != fbt->fbtp_loadcnt) { if (fbt_verbose) { printf("fbt is failing for probe %s " "(module %s reloaded)", fbt->fbtp_name, ctl->filename); } return; } for (; fbt != NULL; fbt = fbt->fbtp_next) fbt_patch_tracepoint(fbt, fbt->fbtp_patchval); } static void fbt_disable(void *arg, dtrace_id_t id, void *parg) { fbt_probe_t *fbt = parg; modctl_t *ctl = fbt->fbtp_ctl; ASSERT(ctl->nenabled > 0); ctl->nenabled--; if ((ctl->loadcnt != fbt->fbtp_loadcnt)) return; for (; fbt != NULL; fbt = fbt->fbtp_next) fbt_patch_tracepoint(fbt, fbt->fbtp_savedval); } static void fbt_suspend(void *arg, dtrace_id_t id, void *parg) { fbt_probe_t *fbt = parg; modctl_t *ctl = fbt->fbtp_ctl; ASSERT(ctl->nenabled > 0); if ((ctl->loadcnt != fbt->fbtp_loadcnt)) return; for (; fbt != NULL; fbt = fbt->fbtp_next) fbt_patch_tracepoint(fbt, fbt->fbtp_savedval); } static void fbt_resume(void *arg, dtrace_id_t id, void *parg) { fbt_probe_t *fbt = parg; modctl_t *ctl = fbt->fbtp_ctl; ASSERT(ctl->nenabled > 0); if ((ctl->loadcnt != fbt->fbtp_loadcnt)) return; for (; fbt != NULL; fbt = fbt->fbtp_next) fbt_patch_tracepoint(fbt, fbt->fbtp_patchval); } static int fbt_ctfoff_init(modctl_t *lf, linker_ctf_t *lc) { const Elf_Sym *symp = lc->symtab;; const ctf_header_t *hp = (const ctf_header_t *) lc->ctftab; const uint8_t *ctfdata = lc->ctftab + sizeof(ctf_header_t); int i; uint32_t *ctfoff; uint32_t objtoff = hp->cth_objtoff; uint32_t funcoff = hp->cth_funcoff; ushort_t info; ushort_t vlen; /* Sanity check. */ if (hp->cth_magic != CTF_MAGIC) { printf("Bad magic value in CTF data of '%s'\n",lf->pathname); return (EINVAL); } if (lc->symtab == NULL) { printf("No symbol table in '%s'\n",lf->pathname); return (EINVAL); } ctfoff = malloc(sizeof(uint32_t) * lc->nsym, M_LINKER, M_WAITOK); *lc->ctfoffp = ctfoff; for (i = 0; i < lc->nsym; i++, ctfoff++, symp++) { if (symp->st_name == 0 || symp->st_shndx == SHN_UNDEF) { *ctfoff = 0xffffffff; continue; } switch (ELF_ST_TYPE(symp->st_info)) { case STT_OBJECT: if (objtoff >= hp->cth_funcoff || (symp->st_shndx == SHN_ABS && symp->st_value == 0)) { *ctfoff = 0xffffffff; break; } *ctfoff = objtoff; objtoff += sizeof (ushort_t); break; case STT_FUNC: if (funcoff >= hp->cth_typeoff) { *ctfoff = 0xffffffff; break; } *ctfoff = funcoff; info = *((const ushort_t *)(ctfdata + funcoff)); vlen = CTF_INFO_VLEN(info); /* * If we encounter a zero pad at the end, just skip it. * Otherwise skip over the function and its return type * (+2) and the argument list (vlen). */ if (CTF_INFO_KIND(info) == CTF_K_UNKNOWN && vlen == 0) funcoff += sizeof (ushort_t); /* skip pad */ else funcoff += sizeof (ushort_t) * (vlen + 2); break; default: *ctfoff = 0xffffffff; break; } } return (0); } static ssize_t fbt_get_ctt_size(uint8_t version, const ctf_type_t *tp, ssize_t *sizep, ssize_t *incrementp) { ssize_t size, increment; if (version > CTF_VERSION_1 && tp->ctt_size == CTF_LSIZE_SENT) { size = CTF_TYPE_LSIZE(tp); increment = sizeof (ctf_type_t); } else { size = tp->ctt_size; increment = sizeof (ctf_stype_t); } if (sizep) *sizep = size; if (incrementp) *incrementp = increment; return (size); } static int fbt_typoff_init(linker_ctf_t *lc) { const ctf_header_t *hp = (const ctf_header_t *) lc->ctftab; const ctf_type_t *tbuf; const ctf_type_t *tend; const ctf_type_t *tp; const uint8_t *ctfdata = lc->ctftab + sizeof(ctf_header_t); int ctf_typemax = 0; uint32_t *xp; ulong_t pop[CTF_K_MAX + 1] = { 0 }; /* Sanity check. */ if (hp->cth_magic != CTF_MAGIC) return (EINVAL); tbuf = (const ctf_type_t *) (ctfdata + hp->cth_typeoff); tend = (const ctf_type_t *) (ctfdata + hp->cth_stroff); int child = hp->cth_parname != 0; /* * We make two passes through the entire type section. In this first * pass, we count the number of each type and the total number of types. */ for (tp = tbuf; tp < tend; ctf_typemax++) { ushort_t kind = CTF_INFO_KIND(tp->ctt_info); ulong_t vlen = CTF_INFO_VLEN(tp->ctt_info); ssize_t size, increment; size_t vbytes; uint_t n; (void) fbt_get_ctt_size(hp->cth_version, tp, &size, &increment); switch (kind) { case CTF_K_INTEGER: case CTF_K_FLOAT: vbytes = sizeof (uint_t); break; case CTF_K_ARRAY: vbytes = sizeof (ctf_array_t); break; case CTF_K_FUNCTION: vbytes = sizeof (ushort_t) * (vlen + (vlen & 1)); break; case CTF_K_STRUCT: case CTF_K_UNION: if (size < CTF_LSTRUCT_THRESH) { ctf_member_t *mp = (ctf_member_t *) ((uintptr_t)tp + increment); vbytes = sizeof (ctf_member_t) * vlen; for (n = vlen; n != 0; n--, mp++) child |= CTF_TYPE_ISCHILD(mp->ctm_type); } else { ctf_lmember_t *lmp = (ctf_lmember_t *) ((uintptr_t)tp + increment); vbytes = sizeof (ctf_lmember_t) * vlen; for (n = vlen; n != 0; n--, lmp++) child |= CTF_TYPE_ISCHILD(lmp->ctlm_type); } break; case CTF_K_ENUM: vbytes = sizeof (ctf_enum_t) * vlen; break; case CTF_K_FORWARD: /* * For forward declarations, ctt_type is the CTF_K_* * kind for the tag, so bump that population count too. * If ctt_type is unknown, treat the tag as a struct. */ if (tp->ctt_type == CTF_K_UNKNOWN || tp->ctt_type >= CTF_K_MAX) pop[CTF_K_STRUCT]++; else pop[tp->ctt_type]++; /*FALLTHRU*/ case CTF_K_UNKNOWN: vbytes = 0; break; case CTF_K_POINTER: case CTF_K_TYPEDEF: case CTF_K_VOLATILE: case CTF_K_CONST: case CTF_K_RESTRICT: child |= CTF_TYPE_ISCHILD(tp->ctt_type); vbytes = 0; break; default: printf("%s(%d): detected invalid CTF kind -- %u\n", __func__, __LINE__, kind); return (EIO); } tp = (ctf_type_t *)((uintptr_t)tp + increment + vbytes); pop[kind]++; } /* account for a sentinel value below */ ctf_typemax++; *lc->typlenp = ctf_typemax; xp = malloc(sizeof(uint32_t) * ctf_typemax, M_LINKER, M_ZERO | M_WAITOK); *lc->typoffp = xp; /* type id 0 is used as a sentinel value */ *xp++ = 0; /* * In the second pass, fill in the type offset. */ for (tp = tbuf; tp < tend; xp++) { ushort_t kind = CTF_INFO_KIND(tp->ctt_info); ulong_t vlen = CTF_INFO_VLEN(tp->ctt_info); ssize_t size, increment; size_t vbytes; uint_t n; (void) fbt_get_ctt_size(hp->cth_version, tp, &size, &increment); switch (kind) { case CTF_K_INTEGER: case CTF_K_FLOAT: vbytes = sizeof (uint_t); break; case CTF_K_ARRAY: vbytes = sizeof (ctf_array_t); break; case CTF_K_FUNCTION: vbytes = sizeof (ushort_t) * (vlen + (vlen & 1)); break; case CTF_K_STRUCT: case CTF_K_UNION: if (size < CTF_LSTRUCT_THRESH) { ctf_member_t *mp = (ctf_member_t *) ((uintptr_t)tp + increment); vbytes = sizeof (ctf_member_t) * vlen; for (n = vlen; n != 0; n--, mp++) child |= CTF_TYPE_ISCHILD(mp->ctm_type); } else { ctf_lmember_t *lmp = (ctf_lmember_t *) ((uintptr_t)tp + increment); vbytes = sizeof (ctf_lmember_t) * vlen; for (n = vlen; n != 0; n--, lmp++) child |= CTF_TYPE_ISCHILD(lmp->ctlm_type); } break; case CTF_K_ENUM: vbytes = sizeof (ctf_enum_t) * vlen; break; case CTF_K_FORWARD: case CTF_K_UNKNOWN: vbytes = 0; break; case CTF_K_POINTER: case CTF_K_TYPEDEF: case CTF_K_VOLATILE: case CTF_K_CONST: case CTF_K_RESTRICT: vbytes = 0; break; default: printf("%s(%d): detected invalid CTF kind -- %u\n", __func__, __LINE__, kind); return (EIO); } *xp = (uint32_t)((uintptr_t) tp - (uintptr_t) ctfdata); tp = (ctf_type_t *)((uintptr_t)tp + increment + vbytes); } return (0); } /* * CTF Declaration Stack * * In order to implement ctf_type_name(), we must convert a type graph back * into a C type declaration. Unfortunately, a type graph represents a storage * class ordering of the type whereas a type declaration must obey the C rules * for operator precedence, and the two orderings are frequently in conflict. * For example, consider these CTF type graphs and their C declarations: * * CTF_K_POINTER -> CTF_K_FUNCTION -> CTF_K_INTEGER : int (*)() * CTF_K_POINTER -> CTF_K_ARRAY -> CTF_K_INTEGER : int (*)[] * * In each case, parentheses are used to raise operator * to higher lexical * precedence, so the string form of the C declaration cannot be constructed by * walking the type graph links and forming the string from left to right. * * The functions in this file build a set of stacks from the type graph nodes * corresponding to the C operator precedence levels in the appropriate order. * The code in ctf_type_name() can then iterate over the levels and nodes in * lexical precedence order and construct the final C declaration string. */ typedef struct ctf_list { struct ctf_list *l_prev; /* previous pointer or tail pointer */ struct ctf_list *l_next; /* next pointer or head pointer */ } ctf_list_t; #define ctf_list_prev(elem) ((void *)(((ctf_list_t *)(elem))->l_prev)) #define ctf_list_next(elem) ((void *)(((ctf_list_t *)(elem))->l_next)) typedef enum { CTF_PREC_BASE, CTF_PREC_POINTER, CTF_PREC_ARRAY, CTF_PREC_FUNCTION, CTF_PREC_MAX } ctf_decl_prec_t; typedef struct ctf_decl_node { ctf_list_t cd_list; /* linked list pointers */ ctf_id_t cd_type; /* type identifier */ uint_t cd_kind; /* type kind */ uint_t cd_n; /* type dimension if array */ } ctf_decl_node_t; typedef struct ctf_decl { ctf_list_t cd_nodes[CTF_PREC_MAX]; /* declaration node stacks */ int cd_order[CTF_PREC_MAX]; /* storage order of decls */ ctf_decl_prec_t cd_qualp; /* qualifier precision */ ctf_decl_prec_t cd_ordp; /* ordered precision */ char *cd_buf; /* buffer for output */ char *cd_ptr; /* buffer location */ char *cd_end; /* buffer limit */ size_t cd_len; /* buffer space required */ int cd_err; /* saved error value */ } ctf_decl_t; /* * Simple doubly-linked list append routine. This implementation assumes that * each list element contains an embedded ctf_list_t as the first member. * An additional ctf_list_t is used to store the head (l_next) and tail * (l_prev) pointers. The current head and tail list elements have their * previous and next pointers set to NULL, respectively. */ static void ctf_list_append(ctf_list_t *lp, void *new) { ctf_list_t *p = lp->l_prev; /* p = tail list element */ ctf_list_t *q = new; /* q = new list element */ lp->l_prev = q; q->l_prev = p; q->l_next = NULL; if (p != NULL) p->l_next = q; else lp->l_next = q; } /* * Prepend the specified existing element to the given ctf_list_t. The * existing pointer should be pointing at a struct with embedded ctf_list_t. */ static void ctf_list_prepend(ctf_list_t *lp, void *new) { ctf_list_t *p = new; /* p = new list element */ ctf_list_t *q = lp->l_next; /* q = head list element */ lp->l_next = p; p->l_prev = NULL; p->l_next = q; if (q != NULL) q->l_prev = p; else lp->l_prev = p; } static void ctf_decl_init(ctf_decl_t *cd, char *buf, size_t len) { int i; bzero(cd, sizeof (ctf_decl_t)); for (i = CTF_PREC_BASE; i < CTF_PREC_MAX; i++) cd->cd_order[i] = CTF_PREC_BASE - 1; cd->cd_qualp = CTF_PREC_BASE; cd->cd_ordp = CTF_PREC_BASE; cd->cd_buf = buf; cd->cd_ptr = buf; cd->cd_end = buf + len; } static void ctf_decl_fini(ctf_decl_t *cd) { ctf_decl_node_t *cdp, *ndp; int i; for (i = CTF_PREC_BASE; i < CTF_PREC_MAX; i++) { for (cdp = ctf_list_next(&cd->cd_nodes[i]); cdp != NULL; cdp = ndp) { ndp = ctf_list_next(cdp); free(cdp, M_FBT); } } } static const ctf_type_t * ctf_lookup_by_id(linker_ctf_t *lc, ctf_id_t type) { const ctf_type_t *tp; uint32_t offset; uint32_t *typoff = *lc->typoffp; if (type >= *lc->typlenp) { printf("%s(%d): type %d exceeds max %ld\n",__func__,__LINE__,(int) type,*lc->typlenp); return(NULL); } /* Check if the type isn't cross-referenced. */ if ((offset = typoff[type]) == 0) { printf("%s(%d): type %d isn't cross referenced\n",__func__,__LINE__, (int) type); return(NULL); } tp = (const ctf_type_t *)(lc->ctftab + offset + sizeof(ctf_header_t)); return (tp); } static void fbt_array_info(linker_ctf_t *lc, ctf_id_t type, ctf_arinfo_t *arp) { const ctf_header_t *hp = (const ctf_header_t *) lc->ctftab; const ctf_type_t *tp; const ctf_array_t *ap; ssize_t increment; bzero(arp, sizeof(*arp)); if ((tp = ctf_lookup_by_id(lc, type)) == NULL) return; if (CTF_INFO_KIND(tp->ctt_info) != CTF_K_ARRAY) return; (void) fbt_get_ctt_size(hp->cth_version, tp, NULL, &increment); ap = (const ctf_array_t *)((uintptr_t)tp + increment); arp->ctr_contents = ap->cta_contents; arp->ctr_index = ap->cta_index; arp->ctr_nelems = ap->cta_nelems; } static const char * ctf_strptr(linker_ctf_t *lc, int name) { const ctf_header_t *hp = (const ctf_header_t *) lc->ctftab;; const char *strp = ""; if (name < 0 || name >= hp->cth_strlen) return(strp); strp = (const char *)(lc->ctftab + hp->cth_stroff + name + sizeof(ctf_header_t)); return (strp); } static void ctf_decl_push(ctf_decl_t *cd, linker_ctf_t *lc, ctf_id_t type) { ctf_decl_node_t *cdp; ctf_decl_prec_t prec; uint_t kind, n = 1; int is_qual = 0; const ctf_type_t *tp; ctf_arinfo_t ar; if ((tp = ctf_lookup_by_id(lc, type)) == NULL) { cd->cd_err = ENOENT; return; } switch (kind = CTF_INFO_KIND(tp->ctt_info)) { case CTF_K_ARRAY: fbt_array_info(lc, type, &ar); ctf_decl_push(cd, lc, ar.ctr_contents); n = ar.ctr_nelems; prec = CTF_PREC_ARRAY; break; case CTF_K_TYPEDEF: if (ctf_strptr(lc, tp->ctt_name)[0] == '\0') { ctf_decl_push(cd, lc, tp->ctt_type); return; } prec = CTF_PREC_BASE; break; case CTF_K_FUNCTION: ctf_decl_push(cd, lc, tp->ctt_type); prec = CTF_PREC_FUNCTION; break; case CTF_K_POINTER: ctf_decl_push(cd, lc, tp->ctt_type); prec = CTF_PREC_POINTER; break; case CTF_K_VOLATILE: case CTF_K_CONST: case CTF_K_RESTRICT: ctf_decl_push(cd, lc, tp->ctt_type); prec = cd->cd_qualp; is_qual++; break; default: prec = CTF_PREC_BASE; } cdp = malloc(sizeof(*cdp), M_FBT, M_WAITOK); cdp->cd_type = type; cdp->cd_kind = kind; cdp->cd_n = n; if (ctf_list_next(&cd->cd_nodes[prec]) == NULL) cd->cd_order[prec] = cd->cd_ordp++; /* * Reset cd_qualp to the highest precedence level that we've seen so * far that can be qualified (CTF_PREC_BASE or CTF_PREC_POINTER). */ if (prec > cd->cd_qualp && prec < CTF_PREC_ARRAY) cd->cd_qualp = prec; /* * C array declarators are ordered inside out so prepend them. Also by * convention qualifiers of base types precede the type specifier (e.g. * const int vs. int const) even though the two forms are equivalent. */ if (kind == CTF_K_ARRAY || (is_qual && prec == CTF_PREC_BASE)) ctf_list_prepend(&cd->cd_nodes[prec], cdp); else ctf_list_append(&cd->cd_nodes[prec], cdp); } static void ctf_decl_sprintf(ctf_decl_t *cd, const char *format, ...) { size_t len = (size_t)(cd->cd_end - cd->cd_ptr); va_list ap; size_t n; va_start(ap, format); n = vsnprintf(cd->cd_ptr, len, format, ap); va_end(ap); cd->cd_ptr += MIN(n, len); cd->cd_len += n; } static ssize_t fbt_type_name(linker_ctf_t *lc, ctf_id_t type, char *buf, size_t len) { ctf_decl_t cd; ctf_decl_node_t *cdp; ctf_decl_prec_t prec, lp, rp; int ptr, arr; uint_t k; if (lc == NULL && type == CTF_ERR) return (-1); /* simplify caller code by permitting CTF_ERR */ ctf_decl_init(&cd, buf, len); ctf_decl_push(&cd, lc, type); if (cd.cd_err != 0) { ctf_decl_fini(&cd); return (-1); } /* * If the type graph's order conflicts with lexical precedence order * for pointers or arrays, then we need to surround the declarations at * the corresponding lexical precedence with parentheses. This can * result in either a parenthesized pointer (*) as in int (*)() or * int (*)[], or in a parenthesized pointer and array as in int (*[])(). */ ptr = cd.cd_order[CTF_PREC_POINTER] > CTF_PREC_POINTER; arr = cd.cd_order[CTF_PREC_ARRAY] > CTF_PREC_ARRAY; rp = arr ? CTF_PREC_ARRAY : ptr ? CTF_PREC_POINTER : -1; lp = ptr ? CTF_PREC_POINTER : arr ? CTF_PREC_ARRAY : -1; k = CTF_K_POINTER; /* avoid leading whitespace (see below) */ for (prec = CTF_PREC_BASE; prec < CTF_PREC_MAX; prec++) { for (cdp = ctf_list_next(&cd.cd_nodes[prec]); cdp != NULL; cdp = ctf_list_next(cdp)) { const ctf_type_t *tp = ctf_lookup_by_id(lc, cdp->cd_type); const char *name = ctf_strptr(lc, tp->ctt_name); if (k != CTF_K_POINTER && k != CTF_K_ARRAY) ctf_decl_sprintf(&cd, " "); if (lp == prec) { ctf_decl_sprintf(&cd, "("); lp = -1; } switch (cdp->cd_kind) { case CTF_K_INTEGER: case CTF_K_FLOAT: case CTF_K_TYPEDEF: ctf_decl_sprintf(&cd, "%s", name); break; case CTF_K_POINTER: ctf_decl_sprintf(&cd, "*"); break; case CTF_K_ARRAY: ctf_decl_sprintf(&cd, "[%u]", cdp->cd_n); break; case CTF_K_FUNCTION: ctf_decl_sprintf(&cd, "()"); break; case CTF_K_STRUCT: case CTF_K_FORWARD: ctf_decl_sprintf(&cd, "struct %s", name); break; case CTF_K_UNION: ctf_decl_sprintf(&cd, "union %s", name); break; case CTF_K_ENUM: ctf_decl_sprintf(&cd, "enum %s", name); break; case CTF_K_VOLATILE: ctf_decl_sprintf(&cd, "volatile"); break; case CTF_K_CONST: ctf_decl_sprintf(&cd, "const"); break; case CTF_K_RESTRICT: ctf_decl_sprintf(&cd, "restrict"); break; } k = cdp->cd_kind; } if (rp == prec) ctf_decl_sprintf(&cd, ")"); } ctf_decl_fini(&cd); return (cd.cd_len); } static void fbt_getargdesc(void *arg __unused, dtrace_id_t id __unused, void *parg, dtrace_argdesc_t *desc) { const ushort_t *dp; fbt_probe_t *fbt = parg; linker_ctf_t lc; modctl_t *ctl = fbt->fbtp_ctl; int ndx = desc->dtargd_ndx; int symindx = fbt->fbtp_symindx; uint32_t *ctfoff; uint32_t offset; ushort_t info, kind, n; if (fbt->fbtp_roffset != 0 && desc->dtargd_ndx == 0) { (void) strcpy(desc->dtargd_native, "int"); return; } desc->dtargd_ndx = DTRACE_ARGNONE; /* Get a pointer to the CTF data and it's length. */ if (linker_ctf_get(ctl, &lc) != 0) /* No CTF data? Something wrong? *shrug* */ return; /* Check if this module hasn't been initialised yet. */ if (*lc.ctfoffp == NULL) { /* * Initialise the CTF object and function symindx to * byte offset array. */ if (fbt_ctfoff_init(ctl, &lc) != 0) return; /* Initialise the CTF type to byte offset array. */ if (fbt_typoff_init(&lc) != 0) return; } ctfoff = *lc.ctfoffp; if (ctfoff == NULL || *lc.typoffp == NULL) return; /* Check if the symbol index is out of range. */ if (symindx >= lc.nsym) return; /* Check if the symbol isn't cross-referenced. */ if ((offset = ctfoff[symindx]) == 0xffffffff) return; dp = (const ushort_t *)(lc.ctftab + offset + sizeof(ctf_header_t)); info = *dp++; kind = CTF_INFO_KIND(info); n = CTF_INFO_VLEN(info); if (kind == CTF_K_UNKNOWN && n == 0) { printf("%s(%d): Unknown function!\n",__func__,__LINE__); return; } if (kind != CTF_K_FUNCTION) { printf("%s(%d): Expected a function!\n",__func__,__LINE__); return; } if (fbt->fbtp_roffset != 0) { /* Only return type is available for args[1] in return probe. */ if (ndx > 1) return; ASSERT(ndx == 1); } else { /* Check if the requested argument doesn't exist. */ if (ndx >= n) return; /* Skip the return type and arguments up to the one requested. */ dp += ndx + 1; } if (fbt_type_name(&lc, *dp, desc->dtargd_native, sizeof(desc->dtargd_native)) > 0) desc->dtargd_ndx = ndx; return; } static int fbt_linker_file_cb(linker_file_t lf, void *arg) { fbt_provide_module(arg, lf); return (0); } static void fbt_load(void *dummy) { /* Create the /dev/dtrace/fbt entry. */ fbt_cdev = make_dev(&fbt_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "dtrace/fbt"); /* Default the probe table size if not specified. */ if (fbt_probetab_size == 0) fbt_probetab_size = FBT_PROBETAB_SIZE; /* Choose the hash mask for the probe table. */ fbt_probetab_mask = fbt_probetab_size - 1; /* Allocate memory for the probe table. */ fbt_probetab = malloc(fbt_probetab_size * sizeof (fbt_probe_t *), M_FBT, M_WAITOK | M_ZERO); dtrace_doubletrap_func = fbt_doubletrap; dtrace_invop_add(fbt_invop); if (dtrace_register("fbt", &fbt_attr, DTRACE_PRIV_USER, NULL, &fbt_pops, NULL, &fbt_id) != 0) return; /* Create probes for the kernel and already-loaded modules. */ linker_file_foreach(fbt_linker_file_cb, NULL); } static int fbt_unload() { int error = 0; /* De-register the invalid opcode handler. */ dtrace_invop_remove(fbt_invop); dtrace_doubletrap_func = NULL; /* De-register this DTrace provider. */ if ((error = dtrace_unregister(fbt_id)) != 0) return (error); /* Free the probe table. */ free(fbt_probetab, M_FBT); fbt_probetab = NULL; fbt_probetab_mask = 0; destroy_dev(fbt_cdev); return (error); } static int fbt_modevent(module_t mod __unused, int type, void *data __unused) { int error = 0; switch (type) { case MOD_LOAD: break; case MOD_UNLOAD: break; case MOD_SHUTDOWN: break; default: error = EOPNOTSUPP; break; } return (error); } static int fbt_open(struct cdev *dev __unused, int oflags __unused, int devtype __unused, struct thread *td __unused) { return (0); } SYSINIT(fbt_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, fbt_load, NULL); SYSUNINIT(fbt_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, fbt_unload, NULL); DEV_MODULE(fbt, fbt_modevent, NULL); MODULE_VERSION(fbt, 1); MODULE_DEPEND(fbt, dtrace, 1, 1, 1); MODULE_DEPEND(fbt, opensolaris, 1, 1, 1);
24.043777
106
0.668987
19125e80248b17c0c1f6d66a0255e23af538e3c8
1,083
h
C
ext/stub/constantsinterfacea.zep.h
fagai/zephir
dbc394279e2119cd65489c481581dfd644d24501
[ "MIT" ]
null
null
null
ext/stub/constantsinterfacea.zep.h
fagai/zephir
dbc394279e2119cd65489c481581dfd644d24501
[ "MIT" ]
null
null
null
ext/stub/constantsinterfacea.zep.h
fagai/zephir
dbc394279e2119cd65489c481581dfd644d24501
[ "MIT" ]
null
null
null
extern zend_class_entry *stub_constantsinterfacea_ce; ZEPHIR_INIT_CLASS(Stub_ConstantsInterfaceA); PHP_METHOD(Stub_ConstantsInterfaceA, testReadInterfaceConstant1); PHP_METHOD(Stub_ConstantsInterfaceA, testReadInterfaceConstant2); PHP_METHOD(Stub_ConstantsInterfaceA, testReadInterfaceConstant3); PHP_METHOD(Stub_ConstantsInterfaceA, testReadInterfaceConstant4); PHP_METHOD(Stub_ConstantsInterfaceA, testReadInterfaceConstant5); PHP_METHOD(Stub_ConstantsInterfaceA, testReadInterfaceConstant6); ZEPHIR_INIT_FUNCS(stub_constantsinterfacea_method_entry) { PHP_ME(Stub_ConstantsInterfaceA, testReadInterfaceConstant1, NULL, ZEND_ACC_PUBLIC) PHP_ME(Stub_ConstantsInterfaceA, testReadInterfaceConstant2, NULL, ZEND_ACC_PUBLIC) PHP_ME(Stub_ConstantsInterfaceA, testReadInterfaceConstant3, NULL, ZEND_ACC_PUBLIC) PHP_ME(Stub_ConstantsInterfaceA, testReadInterfaceConstant4, NULL, ZEND_ACC_PUBLIC) PHP_ME(Stub_ConstantsInterfaceA, testReadInterfaceConstant5, NULL, ZEND_ACC_PUBLIC) PHP_ME(Stub_ConstantsInterfaceA, testReadInterfaceConstant6, NULL, ZEND_ACC_PUBLIC) PHP_FE_END };
49.227273
84
0.89012
d286cc75989a8f1f9096ce821b524fa50c53a365
1,232
c
C
workfiles/multiple led using decoder/multipleLEDwithDecoder/multipleLEDwithDecoder/main.c
asifajrof/CSE316_Term_Project_Tetris
a7a42c195fbbf7d2aac05cdee066180e5a412308
[ "MIT" ]
null
null
null
workfiles/multiple led using decoder/multipleLEDwithDecoder/multipleLEDwithDecoder/main.c
asifajrof/CSE316_Term_Project_Tetris
a7a42c195fbbf7d2aac05cdee066180e5a412308
[ "MIT" ]
null
null
null
workfiles/multiple led using decoder/multipleLEDwithDecoder/multipleLEDwithDecoder/main.c
asifajrof/CSE316_Term_Project_Tetris
a7a42c195fbbf7d2aac05cdee066180e5a412308
[ "MIT" ]
null
null
null
#define F_CPU 1000000 #include <avr/io.h> #include <util/delay.h> //char row[] = {1, 2, 4, 8, 16, 32, 64, 128}; char column1[8][8] = {{0, 0, 1, 1, 1, 0 , 0 , 0}, {0, 0 , 0, 0, 0, 1, 1, 1}, {0, 0, 1, 1, 1, 0 , 0 , 0}, {0, 0 , 0, 0, 0, 1, 1, 1}, {0, 0, 1, 1, 1, 0 , 0 , 0}, {0, 0 , 0, 0, 0, 1, 1, 1}, {0, 0, 1, 1, 1, 0 , 0 , 0}, {0, 0 , 0, 0, 0, 1, 1, 1}} ; int main(void) { int delay_D1 = 5000; int delay_D2 = 1000; int delay_C = 1000; //int delay__ = 100; DDRB = 0xFF; DDRD = 0xFF; DDRC = 0xFF; while (1) { for(int i = 0 ; i < 8; i++ ){ PORTB &= 0b11111000; PORTB |= (i & 0b00000111); for(int j = 0; j < 8; j++){ if(column1[i][j] == 1){ PORTD &= 0b11100000; PORTD |= (j & 0b00000111); _delay_us(delay_D1); } else{ PORTD |= 1 << PD4; } } for(int j = 8; j < 16; j++){ if(column1[i][j-8] == 1){ PORTD &= 0b11100000; PORTD |= (j & 0b00001111); _delay_us(delay_D2); } else{ PORTD |= 1 << PD4; } } for(int j = 0; j < 8; j++){ if(column1[i][j] == 1){ PORTC &= 0b11110000; PORTC |= (j & 0b00000111); _delay_us(delay_C); } else{ PORTC |= 1 << PC3; } } //_delay_us(delay__); } } }
18.666667
49
0.449675
c5b95c1b7a995e1f0a220a49f1326d940cbb031a
7,281
c
C
dependencies/Nuklear/demo/sdl_opengl3/main.c
ranoke/gl_snake
77dee3e06ada641613ad34c58d2d72347f2274b5
[ "MIT" ]
5,774
2019-11-26T09:40:16.000Z
2022-03-31T19:12:18.000Z
dependencies/Nuklear/demo/sdl_opengl3/main.c
ranoke/gl_snake
77dee3e06ada641613ad34c58d2d72347f2274b5
[ "MIT" ]
415
2019-11-26T16:14:12.000Z
2022-03-31T13:49:03.000Z
dependencies/Nuklear/demo/sdl_opengl3/main.c
ranoke/gl_snake
77dee3e06ada641613ad34c58d2d72347f2274b5
[ "MIT" ]
441
2019-11-27T13:54:37.000Z
2022-03-29T19:23:39.000Z
/* nuklear - 1.32.0 - public domain */ #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <stdarg.h> #include <string.h> #include <math.h> #include <assert.h> #include <limits.h> #include <time.h> #include <GL/glew.h> #include <SDL2/SDL.h> #include <SDL2/SDL_opengl.h> #define NK_INCLUDE_FIXED_TYPES #define NK_INCLUDE_STANDARD_IO #define NK_INCLUDE_STANDARD_VARARGS #define NK_INCLUDE_DEFAULT_ALLOCATOR #define NK_INCLUDE_VERTEX_BUFFER_OUTPUT #define NK_INCLUDE_FONT_BAKING #define NK_INCLUDE_DEFAULT_FONT #define NK_IMPLEMENTATION #define NK_SDL_GL3_IMPLEMENTATION #include "../../nuklear.h" #include "nuklear_sdl_gl3.h" #define WINDOW_WIDTH 1200 #define WINDOW_HEIGHT 800 #define MAX_VERTEX_MEMORY 512 * 1024 #define MAX_ELEMENT_MEMORY 128 * 1024 /* =============================================================== * * EXAMPLE * * ===============================================================*/ /* This are some code examples to provide a small overview of what can be * done with this library. To try out an example uncomment the defines */ /*#define INCLUDE_ALL */ /*#define INCLUDE_STYLE */ /*#define INCLUDE_CALCULATOR */ /*#define INCLUDE_OVERVIEW */ /*#define INCLUDE_NODE_EDITOR */ #ifdef INCLUDE_ALL #define INCLUDE_STYLE #define INCLUDE_CALCULATOR #define INCLUDE_OVERVIEW #define INCLUDE_NODE_EDITOR #endif #ifdef INCLUDE_STYLE #include "../style.c" #endif #ifdef INCLUDE_CALCULATOR #include "../calculator.c" #endif #ifdef INCLUDE_OVERVIEW #include "../overview.c" #endif #ifdef INCLUDE_NODE_EDITOR #include "../node_editor.c" #endif /* =============================================================== * * DEMO * * ===============================================================*/ int main(int argc, char *argv[]) { /* Platform */ SDL_Window *win; SDL_GLContext glContext; int win_width, win_height; int running = 1; /* GUI */ struct nk_context *ctx; struct nk_colorf bg; /* SDL setup */ SDL_SetHint(SDL_HINT_VIDEO_HIGHDPI_DISABLED, "0"); SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_EVENTS); SDL_GL_SetAttribute (SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG); SDL_GL_SetAttribute (SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); win = SDL_CreateWindow("Demo", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, WINDOW_WIDTH, WINDOW_HEIGHT, SDL_WINDOW_OPENGL|SDL_WINDOW_SHOWN|SDL_WINDOW_ALLOW_HIGHDPI); glContext = SDL_GL_CreateContext(win); SDL_GetWindowSize(win, &win_width, &win_height); /* OpenGL setup */ glViewport(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT); glewExperimental = 1; if (glewInit() != GLEW_OK) { fprintf(stderr, "Failed to setup GLEW\n"); exit(1); } ctx = nk_sdl_init(win); /* Load Fonts: if none of these are loaded a default font will be used */ /* Load Cursor: if you uncomment cursor loading please hide the cursor */ {struct nk_font_atlas *atlas; nk_sdl_font_stash_begin(&atlas); /*struct nk_font *droid = nk_font_atlas_add_from_file(atlas, "../../../extra_font/DroidSans.ttf", 14, 0);*/ /*struct nk_font *roboto = nk_font_atlas_add_from_file(atlas, "../../../extra_font/Roboto-Regular.ttf", 16, 0);*/ /*struct nk_font *future = nk_font_atlas_add_from_file(atlas, "../../../extra_font/kenvector_future_thin.ttf", 13, 0);*/ /*struct nk_font *clean = nk_font_atlas_add_from_file(atlas, "../../../extra_font/ProggyClean.ttf", 12, 0);*/ /*struct nk_font *tiny = nk_font_atlas_add_from_file(atlas, "../../../extra_font/ProggyTiny.ttf", 10, 0);*/ /*struct nk_font *cousine = nk_font_atlas_add_from_file(atlas, "../../../extra_font/Cousine-Regular.ttf", 13, 0);*/ nk_sdl_font_stash_end(); /*nk_style_load_all_cursors(ctx, atlas->cursors);*/ /*nk_style_set_font(ctx, &roboto->handle);*/} /* style.c */ #ifdef INCLUDE_STYLE /*set_style(ctx, THEME_WHITE);*/ /*set_style(ctx, THEME_RED);*/ /*set_style(ctx, THEME_BLUE);*/ /*set_style(ctx, THEME_DARK);*/ #endif bg.r = 0.10f, bg.g = 0.18f, bg.b = 0.24f, bg.a = 1.0f; while (running) { /* Input */ SDL_Event evt; nk_input_begin(ctx); while (SDL_PollEvent(&evt)) { if (evt.type == SDL_QUIT) goto cleanup; nk_sdl_handle_event(&evt); } nk_input_end(ctx); /* GUI */ if (nk_begin(ctx, "Demo", nk_rect(50, 50, 230, 250), NK_WINDOW_BORDER|NK_WINDOW_MOVABLE|NK_WINDOW_SCALABLE| NK_WINDOW_MINIMIZABLE|NK_WINDOW_TITLE)) { enum {EASY, HARD}; static int op = EASY; static int property = 20; nk_layout_row_static(ctx, 30, 80, 1); if (nk_button_label(ctx, "button")) printf("button pressed!\n"); nk_layout_row_dynamic(ctx, 30, 2); if (nk_option_label(ctx, "easy", op == EASY)) op = EASY; if (nk_option_label(ctx, "hard", op == HARD)) op = HARD; nk_layout_row_dynamic(ctx, 22, 1); nk_property_int(ctx, "Compression:", 0, &property, 100, 10, 1); nk_layout_row_dynamic(ctx, 20, 1); nk_label(ctx, "background:", NK_TEXT_LEFT); nk_layout_row_dynamic(ctx, 25, 1); if (nk_combo_begin_color(ctx, nk_rgb_cf(bg), nk_vec2(nk_widget_width(ctx),400))) { nk_layout_row_dynamic(ctx, 120, 1); bg = nk_color_picker(ctx, bg, NK_RGBA); nk_layout_row_dynamic(ctx, 25, 1); bg.r = nk_propertyf(ctx, "#R:", 0, bg.r, 1.0f, 0.01f,0.005f); bg.g = nk_propertyf(ctx, "#G:", 0, bg.g, 1.0f, 0.01f,0.005f); bg.b = nk_propertyf(ctx, "#B:", 0, bg.b, 1.0f, 0.01f,0.005f); bg.a = nk_propertyf(ctx, "#A:", 0, bg.a, 1.0f, 0.01f,0.005f); nk_combo_end(ctx); } } nk_end(ctx); /* -------------- EXAMPLES ---------------- */ #ifdef INCLUDE_CALCULATOR calculator(ctx); #endif #ifdef INCLUDE_OVERVIEW overview(ctx); #endif #ifdef INCLUDE_NODE_EDITOR node_editor(ctx); #endif /* ----------------------------------------- */ /* Draw */ SDL_GetWindowSize(win, &win_width, &win_height); glViewport(0, 0, win_width, win_height); glClear(GL_COLOR_BUFFER_BIT); glClearColor(bg.r, bg.g, bg.b, bg.a); /* IMPORTANT: `nk_sdl_render` modifies some global OpenGL state * with blending, scissor, face culling, depth test and viewport and * defaults everything back into a default state. * Make sure to either a.) save and restore or b.) reset your own state after * rendering the UI. */ nk_sdl_render(NK_ANTI_ALIASING_ON, MAX_VERTEX_MEMORY, MAX_ELEMENT_MEMORY); SDL_GL_SwapWindow(win); } cleanup: nk_sdl_shutdown(); SDL_GL_DeleteContext(glContext); SDL_DestroyWindow(win); SDL_Quit(); return 0; }
35.004808
124
0.612553
cf6687f6c27118c157ae686c87b204f4d09f406e
1,139
h
C
samples/client/petstore/c/include/apiClient.h
onze/openapi-generator
96038addd3613a9a25ff102969468a9a456822ab
[ "Apache-2.0" ]
4
2020-07-24T07:02:57.000Z
2022-01-08T17:37:38.000Z
samples/client/petstore/c/include/apiClient.h
onze/openapi-generator
96038addd3613a9a25ff102969468a9a456822ab
[ "Apache-2.0" ]
null
null
null
samples/client/petstore/c/include/apiClient.h
onze/openapi-generator
96038addd3613a9a25ff102969468a9a456822ab
[ "Apache-2.0" ]
1
2020-03-06T13:46:10.000Z
2020-03-06T13:46:10.000Z
#ifndef INCLUDE_API_CLIENT_H #define INCLUDE_API_CLIENT_H #include <string.h> #include <stdlib.h> #include <stdio.h> #include <stdbool.h> #include <stdint.h> #include "../include/list.h" #include "../include/keyValuePair.h" typedef struct apiClient_t { char *basePath; char *caPath; void *dataReceived; long response_code; list_t *apiKeys; char *accessToken; } apiClient_t; typedef struct binary_t { uint8_t* data; unsigned int len; } binary_t; apiClient_t* apiClient_create(); apiClient_t* apiClient_create_with_base_path(const char *basePath , const char *caPath , list_t *apiKeys ); void apiClient_free(apiClient_t *apiClient); void apiClient_invoke(apiClient_t *apiClient,char* operationParameter, list_t *queryParameters, list_t *headerParameters, list_t *formParameters,list_t *headerType,list_t *contentType, char *bodyParameters, char *requestType); char *strReplace(char *orig, char *rep, char *with); char *base64encode(const void *b64_encode_this, int encode_this_many_bytes); char *base64decode(const void *b64_decode_this, int decode_this_many_bytes); #endif // INCLUDE_API_CLIENT_H
25.311111
226
0.768218
cf7f59c675cc7790664700b77f4b4772f6bb6f46
712
h
C
Tools/class-dump/Test/Header/UIImageView-Letters.h
silence0201/iOS-Reverse
2a0587e89324d077715c16e636a5fd05dfe30a73
[ "MIT" ]
15
2019-08-05T01:24:20.000Z
2022-01-12T08:19:55.000Z
Tools/class-dump/Test/Header/UIImageView-Letters.h
silence0201/iOS-Reverse
2a0587e89324d077715c16e636a5fd05dfe30a73
[ "MIT" ]
null
null
null
Tools/class-dump/Test/Header/UIImageView-Letters.h
silence0201/iOS-Reverse
2a0587e89324d077715c16e636a5fd05dfe30a73
[ "MIT" ]
9
2019-09-24T06:26:58.000Z
2021-11-22T08:54:00.000Z
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "UIImageView.h" @interface UIImageView (Letters) - (id)imageSnapshotFromText:(id)arg1 backgroundColor:(id)arg2 circular:(_Bool)arg3 textAttributes:(id)arg4; - (id)randomColor; - (id)fontForFontName:(id)arg1; - (void)setImageWithString:(id)arg1 color:(id)arg2 circular:(_Bool)arg3 textAttributes:(id)arg4; - (void)setImageWithString:(id)arg1 color:(id)arg2 circular:(_Bool)arg3 fontName:(id)arg4; - (void)setImageWithString:(id)arg1 color:(id)arg2 circular:(_Bool)arg3; - (void)setImageWithString:(id)arg1 color:(id)arg2; - (void)setImageWithString:(id)arg1; @end
35.6
107
0.73736
65c340a1ce90a6daabaa3b69cd1a2d2aeb65e264
6,218
c
C
components/bt/bluedroid/external/sbc/decoder/srce/dequant.c
Mixerito/esp-idf
20a662936483f44ee9c8d16f3251a5a1191ca6e5
[ "Apache-2.0" ]
104
2017-05-04T09:55:08.000Z
2022-03-22T11:29:05.000Z
components/bt/bluedroid/external/sbc/decoder/srce/dequant.c
Mixerito/esp-idf
20a662936483f44ee9c8d16f3251a5a1191ca6e5
[ "Apache-2.0" ]
28
2017-08-01T09:19:23.000Z
2017-12-26T13:41:14.000Z
components/bt/bluedroid/external/sbc/decoder/srce/dequant.c
Mixerito/esp-idf
20a662936483f44ee9c8d16f3251a5a1191ca6e5
[ "Apache-2.0" ]
59
2016-11-15T06:07:56.000Z
2022-02-05T17:03:32.000Z
/****************************************************************************** * * Copyright (C) 2014 The Android Open Source Project * Copyright 2003 - 2004 Open Interface North America, Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ******************************************************************************/ /********************************************************************************** $Revision: #1 $ ***********************************************************************************/ /** @file Dequantizer for SBC decoder; reconstructs quantized representation of subband samples. @ingroup codec_internal */ /** @addtogroup codec_internal @{ */ /** This function is a fixed-point approximation of a modification of the following dequantization operation defined in the spec, as inferred from section 12.6.4: @code dequant = 2^(scale_factor+1) * ((raw * 2.0 + 1.0) / ((2^bits) - 1) - 1) 2 <= bits <= 16 0 <= raw < (2^bits)-1 (the -1 is because quantized values with all 1's are forbidden) -65535 < dequant < 65535 @endcode The code below computes the dequantized value divided by a scaling constant equal to about 1.38. This constant is chosen to ensure that the entry in the dequant_long_scaled table for 16 bits is as accurate as possible, since it has the least relative precision available to it due to its small magnitude. This routine outputs in Q16.15 format. The helper array dequant_long is defined as follows: @code dequant_long_long[bits] = round(2^31 * 1/((2^bits - 1) / 1.38...) for 2 <= bits <= 16 @endcode Additionally, the table entries have the following property: @code dequant_long_scaled[bits] <= 2^31 / ((2^bits - 1)) for 2 <= bits <= 16 @endcode Therefore @code d = 2 * raw + 1 1 <= d <= 2^bits - 2 d' = d * dequant_long[bits] d * dequant_long_scaled[bits] <= (2^bits - 2) * (2^31 / (2^bits - 1)) d * dequant_long_scaled[bits] <= 2^31 * (2^bits - 2)/(2^bits - 1) < 2^31 @endcode Therefore, d' doesn't overflow a signed 32-bit value. @code d' =~ 2^31 * (raw * 2.0 + 1.0) / (2^bits - 1) / 1.38... result = d' - 2^31/1.38... =~ 2^31 * ((raw * 2.0 + 1.0) / (2^bits - 1) - 1) / 1.38... result is therefore a scaled approximation to dequant. It remains only to turn 2^31 into 2^(scale_factor+1). Since we're aiming for Q16.15 format, this is achieved by shifting right by (15-scale_factor): (2^31 * x) >> (15-scale_factor) =~ 2^(31-15+scale_factor) * x = 2^15 * 2^(1+scale_factor) * x @endcode */ #include "bt_target.h" #include <oi_codec_sbc_private.h> #if (defined(SBC_DEC_INCLUDED) && SBC_DEC_INCLUDED == TRUE) #ifndef SBC_DEQUANT_LONG_SCALED_OFFSET #define SBC_DEQUANT_LONG_SCALED_OFFSET 1555931970 #endif #ifndef SBC_DEQUANT_LONG_UNSCALED_OFFSET #define SBC_DEQUANT_LONG_UNSCALED_OFFSET 2147483648 #endif #ifndef SBC_DEQUANT_SCALING_FACTOR #define SBC_DEQUANT_SCALING_FACTOR 1.38019122262781f #endif const OI_UINT32 dequant_long_scaled[17]; const OI_UINT32 dequant_long_unscaled[17]; /** Scales x by y bits to the right, adding a rounding factor. */ #ifndef SCALE #define SCALE(x, y) (((x) + (1 <<((y)-1))) >> (y)) #endif #ifdef DEBUG_DEQUANTIZATION #include <math.h> INLINE float dequant_float(OI_UINT32 raw, OI_UINT scale_factor, OI_UINT bits) { float result = (1 << (scale_factor + 1)) * ((raw * 2.0f + 1.0f) / ((1 << bits) - 1.0f) - 1.0f); result /= SBC_DEQUANT_SCALING_FACTOR; /* Unless the encoder screwed up, all correct dequantized values should * satisfy this inequality. Non-compliant encoders which generate quantized * values with all 1-bits set can, theoretically, trigger this assert. This * is unlikely, however, and only an issue in debug mode. */ OI_ASSERT(fabs(result) < 32768 * 1.6); return result; } #endif INLINE OI_INT32 OI_SBC_Dequant(OI_UINT32 raw, OI_UINT scale_factor, OI_UINT bits) { OI_UINT32 d; OI_INT32 result; OI_ASSERT(scale_factor <= 15); OI_ASSERT(bits <= 16); if (bits <= 1) { return 0; } d = (raw * 2) + 1; d *= dequant_long_scaled[bits]; result = d - SBC_DEQUANT_LONG_SCALED_OFFSET; #ifdef DEBUG_DEQUANTIZATION { OI_INT32 integerized_float_result; float float_result; float_result = dequant_float(raw, scale_factor, bits); integerized_float_result = (OI_INT32)floor(0.5f + float_result * (1 << 15)); /* This detects overflow */ OI_ASSERT(((result >= 0) && (integerized_float_result >= 0)) || ((result <= 0) && (integerized_float_result <= 0))); } #endif return result >> (15 - scale_factor); } /* This version of Dequant does not incorporate the scaling factor of 1.38. It * is intended for use with implementations of the filterbank which are * hard-coded into a DSP. Output is Q16.4 format, so that after joint stereo * processing (which leaves the most significant bit equal to the sign bit if * the encoder is conformant) the result will fit a 24 bit fixed point signed * value.*/ INLINE OI_INT32 OI_SBC_Dequant_Unscaled(OI_UINT32 raw, OI_UINT scale_factor, OI_UINT bits) { OI_UINT32 d; OI_INT32 result; OI_ASSERT(scale_factor <= 15); OI_ASSERT(bits <= 16); if (bits <= 1) { return 0; } if (bits == 16) { result = (raw << 16) + raw - 0x7fff7fff; return SCALE(result, 24 - scale_factor); } d = (raw * 2) + 1; d *= dequant_long_unscaled[bits]; result = d - 0x80000000; return SCALE(result, 24 - scale_factor); } /** @} */ #endif /* #if (defined(SBC_DEC_INCLUDED) && SBC_DEC_INCLUDED == TRUE) */
28.787037
99
0.6367
d0c58ed618c624f25f70ec2fefddb82beb092da9
1,228
h
C
src/core/XML/MSXML/MFilterXMLProcessor.h
bbr1870/pwsafe
1b4ea343303ee19ee40d8cd4a35498a9b8b57cee
[ "Artistic-2.0" ]
null
null
null
src/core/XML/MSXML/MFilterXMLProcessor.h
bbr1870/pwsafe
1b4ea343303ee19ee40d8cd4a35498a9b8b57cee
[ "Artistic-2.0" ]
1
2019-12-21T16:39:09.000Z
2019-12-21T16:39:09.000Z
src/core/XML/MSXML/MFilterXMLProcessor.h
akossomfai/pwsafe
c627f72d19d16745c6b6e616021cf61e2b8d40ba
[ "Artistic-2.0" ]
null
null
null
/* * Copyright (c) 2003-2022 Rony Shapiro <ronys@pwsafe.org>. * All rights reserved. Use of the code is allowed under the * Artistic License 2.0 terms, as specified in the LICENSE file * distributed with this code, or available from * http://www.opensource.org/licenses/artistic-license-2.0.php */ // PWSXMLFilters.h : header file // #ifndef __MFILTERXMLPROCESSOR_H #define __MFILTERXMLPROCESSOR_H #include "../../PWSFilters.h" #include "../../StringX.h" #include <vector> class MFilterXMLProcessor { public: MFilterXMLProcessor(PWSFilters &mapfilters, const FilterPool fpool, Asker *pAsker); ~MFilterXMLProcessor(); bool Process(const bool &bvalidation, const StringX &strXMLData, const stringT &strXMLFileName, const stringT &strXSDFileName); stringT getXMLErrors() {return m_strXMLErrors;} stringT getPWHErrorList() {return m_strPWHErrorList;} stringT getRenameList() {return m_strRenameList;} private: Asker *m_pAsker; PWSFilters &m_MapXMLFilters; // So as not to confuse with UI & core FilterPool m_FPool; stringT m_strXMLErrors; stringT m_strRenameList; stringT m_strPWHErrorList; bool m_bValidation; }; #endif /* __MFILTERXMLPROCESSOR_H */
27.288889
85
0.733713
d0c9f2fd1894ffedf7e08a6d3a007010891cdf9c
6,886
h
C
underworld/libUnderworld/gLucifer/Base/src/Database.h
longgangfan/underworld2
5c8acc17fa4d97e86a62b13b8bfb2af6e81a8ee4
[ "CC-BY-4.0" ]
116
2015-09-28T10:30:55.000Z
2022-03-22T04:12:38.000Z
underworld/libUnderworld/gLucifer/Base/src/Database.h
longgangfan/underworld2
5c8acc17fa4d97e86a62b13b8bfb2af6e81a8ee4
[ "CC-BY-4.0" ]
561
2015-09-29T06:05:50.000Z
2022-03-22T23:37:29.000Z
underworld/libUnderworld/gLucifer/Base/src/Database.h
longgangfan/underworld2
5c8acc17fa4d97e86a62b13b8bfb2af6e81a8ee4
[ "CC-BY-4.0" ]
68
2015-12-14T21:57:46.000Z
2021-08-25T04:54:26.000Z
/*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~* ** ** ** This file forms part of the Underworld geophysics modelling application. ** ** ** ** For full license and copyright information, please refer to the LICENSE.md file ** ** located at the project root, or contact the authors. ** ** ** **~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*/ #ifndef __lucDatabase_h__ #define __lucDatabase_h__ #include "ViewerTypes.h" #include "sqlite3.h" struct lucColourMap; struct lucDrawingObject; #include "types.h" #define MAX_PATH 1024 /* For collating Geometry Data before writing to database */ typedef struct { float* data; int size; int count; int allocated; int width; int height; float minimum; float maximum; float min[3]; float max[3]; char* labels; /* Label strings */ } lucGeometryData; extern const Type lucDatabase_Type; /** Class contents - this is defined as a macro so that sub-classes of this class can use this macro at the start of the definition of their struct */ #define __lucDatabase \ /* Macro defining parent goes here - This means you can cast this class as its parent */ \ __Stg_Component \ /* Other Info */ \ DomainContext* context; \ /* Internal */ \ NamedObject_Register* drawingObjects; \ char* labels[lucMaxType]; \ unsigned int label_lengths[lucMaxType]; \ lucGeometryData* data[lucMaxType][lucMaxDataType]; \ char bin_path[MAX_PATH]; \ /* Database */ \ sqlite3* db; \ sqlite3* db2; \ sqlite3* memdb; \ char path[MAX_PATH]; \ /* Params */ \ char* filename; \ char* vfs; \ Bool compressed; \ Bool singleFile; \ Bool splitTransactions; \ int deleteAfter; \ Bool viewonly; \ int rank; \ int nproc; \ MPI_Comm communicator; \ int timeStep; struct lucDatabase { __lucDatabase }; #ifndef ZERO #define ZERO 0 #endif #define LUCDATABASE_DEFARGS \ STG_COMPONENT_DEFARGS #define LUCDATABASE_PASSARGS \ STG_COMPONENT_PASSARGS lucDatabase* _lucDatabase_New( LUCDATABASE_DEFARGS ); /* A public constructor for use in Window when creating default database */ lucDatabase* lucDatabase_New( AbstractContext* context, int deleteAfter, Bool splitTransactions, Bool compressed, Bool singleFile, char* filename, char* vfs); void _lucDatabase_Delete( void* database ) ; void* _lucDatabase_DefaultNew( Name name ) ; void _lucDatabase_AssignFromXML( void* database, Stg_ComponentFactory* cf, void* data ) ; void _lucDatabase_Build( void* database, void* data ); void _lucDatabase_Initialise( void* database, void* data ); void _lucDatabase_Execute( void* database, void* data ); void _lucDatabase_Destroy( void* database, void* data ); void lucDatabase_Dump(void* database); void lucDatabase_OutputDrawingObject(lucDatabase* self, lucDrawingObject* object); void lucDatabase_OutputColourMap(lucDatabase* self, lucColourMap* colourMap, lucDrawingObject* object, lucGeometryDataType type); void lucDatabase_ClearGeometry(lucDatabase* self); void lucDatabase_OutputGeometry(lucDatabase* self, int object_id); int lucDatabase_GatherCounts(lucDatabase* self, int count, int* counts, int* offsets); void lucDatabase_GatherGeometry(lucDatabase* self, lucGeometryType type, lucGeometryDataType data_type); void lucDatabase_GatherLabels(lucDatabase* self, lucGeometryType type); struct lucIsosurface; void lucDatabase_AddGridVertices(lucDatabase* self, int n, int width, float* data); void lucDatabase_AddGridVertex(lucDatabase* self, int width, int height, float* data); void lucDatabase_AddVertices(lucDatabase* self, int n, lucGeometryType type, float* data); void lucDatabase_AddVerticesWidth(lucDatabase* self, int n, lucGeometryType type, int width, float* data); void lucDatabase_AddNormals(lucDatabase* self, int n, lucGeometryType type, float* data); void lucDatabase_AddNormal(lucDatabase* self, lucGeometryType type, XYZ norm); void lucDatabase_AddVectors(lucDatabase* self, int n, lucGeometryType type, float min, float max, float* data); void lucDatabase_AddValues(lucDatabase* self, int n, lucGeometryType type, lucGeometryDataType data_type, lucColourMap* colourMap, float* data); void lucDatabase_AddIndex(lucDatabase* self, lucGeometryType type, unsigned int index); void lucDatabase_AddRGBA(lucDatabase* self, lucGeometryType type, float opacity, lucColour* colour); void lucDatabase_AddTexCoord(lucDatabase* self, lucGeometryType type, float x, float y); void lucDatabase_AddLabel(lucDatabase* self, lucGeometryType type, char* label); void lucDatabase_AddVolumeSlice(lucDatabase* self, int width, int height, float* corners, lucColourMap* colourMap, float* data); lucGeometryData* lucGeometryData_New(lucGeometryDataType data_type); void lucGeometryData_Clear(lucGeometryData* self); void lucGeometryData_Delete(lucGeometryData* self); void lucGeometryData_Read(lucGeometryData* self, int items, float* data); //, int width, int height) void lucGeometryData_Setup(lucGeometryData* self, float min, float max); void lucDatabase_OpenDatabase(lucDatabase* self); void lucDatabase_CreateDatabase(lucDatabase* self); Bool lucDatabase_IssueSQL(sqlite3* db, const char* SQL); Bool lucDatabase_BeginTransaction(lucDatabase* self); void lucDatabase_Commit(lucDatabase* self); void lucDatabase_AttachDatabase(lucDatabase* self); void lucDatabase_DeleteGeometry(lucDatabase* self, int start_timestep, int end_timestep); int lucDatabase_WriteGeometry(lucDatabase* self, int index, lucGeometryType type, lucGeometryDataType data_type, int object_id, lucGeometryData* block); void lucDatabase_BackupDb(sqlite3 *fromDb, sqlite3* toDb); void lucDatabase_BackupDbFile(lucDatabase* self, char* filename); void lucDatabase_WriteState(lucDatabase* self, const char* name, const char* properties); #endif
43.859873
152
0.638542
ca2070ee15b87c9b0a341e34c2fa3f1249d104e4
27,440
c
C
generic/tkMenubutton.c
uclmediatools/tk-8.0
c85a6e2feda2c6e9f83ebe338c5e0efac2301db6
[ "TCL" ]
5
2019-06-22T08:11:47.000Z
2022-03-10T13:11:07.000Z
tk/generic/tkMenubutton.c
crazy-max/expect-nt
63986978ccd301f996bf0bbab4ae4e1e372e7a62
[ "TCL" ]
null
null
null
tk/generic/tkMenubutton.c
crazy-max/expect-nt
63986978ccd301f996bf0bbab4ae4e1e372e7a62
[ "TCL" ]
3
2019-06-22T08:11:48.000Z
2022-03-10T13:11:08.000Z
/* * tkMenubutton.c -- * * This module implements button-like widgets that are used * to invoke pull-down menus. * * Copyright (c) 1990-1994 The Regents of the University of California. * Copyright (c) 1994-1997 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * SCCS: @(#) tkMenubutton.c 1.94 97/07/31 09:10:37 */ #include "tkMenubutton.h" #include "tkPort.h" #include "default.h" /* * Uids internal to menubuttons. */ static Tk_Uid aboveUid = NULL; static Tk_Uid belowUid = NULL; static Tk_Uid leftUid = NULL; static Tk_Uid rightUid = NULL; static Tk_Uid flushUid = NULL; /* * Information used for parsing configuration specs: */ static Tk_ConfigSpec configSpecs[] = { {TK_CONFIG_BORDER, "-activebackground", "activeBackground", "Foreground", DEF_MENUBUTTON_ACTIVE_BG_COLOR, Tk_Offset(TkMenuButton, activeBorder), TK_CONFIG_COLOR_ONLY}, {TK_CONFIG_BORDER, "-activebackground", "activeBackground", "Foreground", DEF_MENUBUTTON_ACTIVE_BG_MONO, Tk_Offset(TkMenuButton, activeBorder), TK_CONFIG_MONO_ONLY}, {TK_CONFIG_COLOR, "-activeforeground", "activeForeground", "Background", DEF_MENUBUTTON_ACTIVE_FG_COLOR, Tk_Offset(TkMenuButton, activeFg), TK_CONFIG_COLOR_ONLY}, {TK_CONFIG_COLOR, "-activeforeground", "activeForeground", "Background", DEF_MENUBUTTON_ACTIVE_FG_MONO, Tk_Offset(TkMenuButton, activeFg), TK_CONFIG_MONO_ONLY}, {TK_CONFIG_ANCHOR, "-anchor", "anchor", "Anchor", DEF_MENUBUTTON_ANCHOR, Tk_Offset(TkMenuButton, anchor), 0}, {TK_CONFIG_BORDER, "-background", "background", "Background", DEF_MENUBUTTON_BG_COLOR, Tk_Offset(TkMenuButton, normalBorder), TK_CONFIG_COLOR_ONLY}, {TK_CONFIG_BORDER, "-background", "background", "Background", DEF_MENUBUTTON_BG_MONO, Tk_Offset(TkMenuButton, normalBorder), TK_CONFIG_MONO_ONLY}, {TK_CONFIG_SYNONYM, "-bd", "borderWidth", (char *) NULL, (char *) NULL, 0, 0}, {TK_CONFIG_SYNONYM, "-bg", "background", (char *) NULL, (char *) NULL, 0, 0}, {TK_CONFIG_BITMAP, "-bitmap", "bitmap", "Bitmap", DEF_MENUBUTTON_BITMAP, Tk_Offset(TkMenuButton, bitmap), TK_CONFIG_NULL_OK}, {TK_CONFIG_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", DEF_MENUBUTTON_BORDER_WIDTH, Tk_Offset(TkMenuButton, borderWidth), 0}, {TK_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor", DEF_MENUBUTTON_CURSOR, Tk_Offset(TkMenuButton, cursor), TK_CONFIG_NULL_OK}, {TK_CONFIG_UID, "-direction", "direction", "Direction", DEF_MENUBUTTON_DIRECTION, Tk_Offset(TkMenuButton, direction), 0}, {TK_CONFIG_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_MENUBUTTON_DISABLED_FG_COLOR, Tk_Offset(TkMenuButton, disabledFg), TK_CONFIG_COLOR_ONLY|TK_CONFIG_NULL_OK}, {TK_CONFIG_COLOR, "-disabledforeground", "disabledForeground", "DisabledForeground", DEF_MENUBUTTON_DISABLED_FG_MONO, Tk_Offset(TkMenuButton, disabledFg), TK_CONFIG_MONO_ONLY|TK_CONFIG_NULL_OK}, {TK_CONFIG_SYNONYM, "-fg", "foreground", (char *) NULL, (char *) NULL, 0, 0}, {TK_CONFIG_FONT, "-font", "font", "Font", DEF_MENUBUTTON_FONT, Tk_Offset(TkMenuButton, tkfont), 0}, {TK_CONFIG_COLOR, "-foreground", "foreground", "Foreground", DEF_MENUBUTTON_FG, Tk_Offset(TkMenuButton, normalFg), 0}, {TK_CONFIG_STRING, "-height", "height", "Height", DEF_MENUBUTTON_HEIGHT, Tk_Offset(TkMenuButton, heightString), 0}, {TK_CONFIG_COLOR, "-highlightbackground", "highlightBackground", "HighlightBackground", DEF_MENUBUTTON_HIGHLIGHT_BG, Tk_Offset(TkMenuButton, highlightBgColorPtr), 0}, {TK_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", DEF_MENUBUTTON_HIGHLIGHT, Tk_Offset(TkMenuButton, highlightColorPtr), 0}, {TK_CONFIG_PIXELS, "-highlightthickness", "highlightThickness", "HighlightThickness", DEF_MENUBUTTON_HIGHLIGHT_WIDTH, Tk_Offset(TkMenuButton, highlightWidth), 0}, {TK_CONFIG_STRING, "-image", "image", "Image", DEF_MENUBUTTON_IMAGE, Tk_Offset(TkMenuButton, imageString), TK_CONFIG_NULL_OK}, {TK_CONFIG_BOOLEAN, "-indicatoron", "indicatorOn", "IndicatorOn", DEF_MENUBUTTON_INDICATOR, Tk_Offset(TkMenuButton, indicatorOn), 0}, {TK_CONFIG_JUSTIFY, "-justify", "justify", "Justify", DEF_MENUBUTTON_JUSTIFY, Tk_Offset(TkMenuButton, justify), 0}, {TK_CONFIG_STRING, "-menu", "menu", "Menu", DEF_MENUBUTTON_MENU, Tk_Offset(TkMenuButton, menuName), TK_CONFIG_NULL_OK}, {TK_CONFIG_PIXELS, "-padx", "padX", "Pad", DEF_MENUBUTTON_PADX, Tk_Offset(TkMenuButton, padX), 0}, {TK_CONFIG_PIXELS, "-pady", "padY", "Pad", DEF_MENUBUTTON_PADY, Tk_Offset(TkMenuButton, padY), 0}, {TK_CONFIG_RELIEF, "-relief", "relief", "Relief", DEF_MENUBUTTON_RELIEF, Tk_Offset(TkMenuButton, relief), 0}, {TK_CONFIG_UID, "-state", "state", "State", DEF_MENUBUTTON_STATE, Tk_Offset(TkMenuButton, state), 0}, {TK_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus", DEF_MENUBUTTON_TAKE_FOCUS, Tk_Offset(TkMenuButton, takeFocus), TK_CONFIG_NULL_OK}, {TK_CONFIG_STRING, "-text", "text", "Text", DEF_MENUBUTTON_TEXT, Tk_Offset(TkMenuButton, text), 0}, {TK_CONFIG_STRING, "-textvariable", "textVariable", "Variable", DEF_MENUBUTTON_TEXT_VARIABLE, Tk_Offset(TkMenuButton, textVarName), TK_CONFIG_NULL_OK}, {TK_CONFIG_INT, "-underline", "underline", "Underline", DEF_MENUBUTTON_UNDERLINE, Tk_Offset(TkMenuButton, underline), 0}, {TK_CONFIG_STRING, "-width", "width", "Width", DEF_MENUBUTTON_WIDTH, Tk_Offset(TkMenuButton, widthString), 0}, {TK_CONFIG_PIXELS, "-wraplength", "wrapLength", "WrapLength", DEF_MENUBUTTON_WRAP_LENGTH, Tk_Offset(TkMenuButton, wrapLength), 0}, {TK_CONFIG_END, (char *) NULL, (char *) NULL, (char *) NULL, (char *) NULL, 0, 0} }; /* * Forward declarations for procedures defined later in this file: */ static void MenuButtonCmdDeletedProc _ANSI_ARGS_(( ClientData clientData)); static void MenuButtonEventProc _ANSI_ARGS_((ClientData clientData, XEvent *eventPtr)); static void MenuButtonImageProc _ANSI_ARGS_((ClientData clientData, int x, int y, int width, int height, int imgWidth, int imgHeight)); static char * MenuButtonTextVarProc _ANSI_ARGS_(( ClientData clientData, Tcl_Interp *interp, char *name1, char *name2, int flags)); static int MenuButtonWidgetCmd _ANSI_ARGS_((ClientData clientData, Tcl_Interp *interp, int argc, char **argv)); static int ConfigureMenuButton _ANSI_ARGS_((Tcl_Interp *interp, TkMenuButton *mbPtr, int argc, char **argv, int flags)); static void DestroyMenuButton _ANSI_ARGS_((char *memPtr)); /* *-------------------------------------------------------------- * * Tk_MenubuttonCmd -- * * This procedure is invoked to process the "button", "label", * "radiobutton", and "checkbutton" Tcl commands. See the * user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *-------------------------------------------------------------- */ int Tk_MenubuttonCmd(clientData, interp, argc, argv) ClientData clientData; /* Main window associated with * interpreter. */ Tcl_Interp *interp; /* Current interpreter. */ int argc; /* Number of arguments. */ char **argv; /* Argument strings. */ { register TkMenuButton *mbPtr; Tk_Window tkwin = (Tk_Window) clientData; Tk_Window new; if (argc < 2) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " pathName ?options?\"", (char *) NULL); return TCL_ERROR; } /* * Create the new window. */ new = Tk_CreateWindowFromPath(interp, tkwin, argv[1], (char *) NULL); if (new == NULL) { return TCL_ERROR; } Tk_SetClass(new, "Menubutton"); mbPtr = TkpCreateMenuButton(new); TkSetClassProcs(new, &tkpMenubuttonClass, (ClientData) mbPtr); /* * Initialize the data structure for the button. */ mbPtr->tkwin = new; mbPtr->display = Tk_Display (new); mbPtr->interp = interp; mbPtr->widgetCmd = Tcl_CreateCommand(interp, Tk_PathName(mbPtr->tkwin), MenuButtonWidgetCmd, (ClientData) mbPtr, MenuButtonCmdDeletedProc); mbPtr->menuName = NULL; mbPtr->text = NULL; mbPtr->underline = -1; mbPtr->textVarName = NULL; mbPtr->bitmap = None; mbPtr->imageString = NULL; mbPtr->image = NULL; mbPtr->state = tkNormalUid; mbPtr->normalBorder = NULL; mbPtr->activeBorder = NULL; mbPtr->borderWidth = 0; mbPtr->relief = TK_RELIEF_FLAT; mbPtr->highlightWidth = 0; mbPtr->highlightBgColorPtr = NULL; mbPtr->highlightColorPtr = NULL; mbPtr->inset = 0; mbPtr->tkfont = NULL; mbPtr->normalFg = NULL; mbPtr->activeFg = NULL; mbPtr->disabledFg = NULL; mbPtr->normalTextGC = None; mbPtr->activeTextGC = None; mbPtr->gray = None; mbPtr->disabledGC = None; mbPtr->leftBearing = 0; mbPtr->rightBearing = 0; mbPtr->widthString = NULL; mbPtr->heightString = NULL; mbPtr->width = 0; mbPtr->width = 0; mbPtr->wrapLength = 0; mbPtr->padX = 0; mbPtr->padY = 0; mbPtr->anchor = TK_ANCHOR_CENTER; mbPtr->justify = TK_JUSTIFY_CENTER; mbPtr->textLayout = NULL; mbPtr->indicatorOn = 0; mbPtr->indicatorWidth = 0; mbPtr->indicatorHeight = 0; mbPtr->cursor = None; mbPtr->takeFocus = NULL; mbPtr->flags = 0; if (aboveUid == NULL) { aboveUid = Tk_GetUid("above"); belowUid = Tk_GetUid("below"); leftUid = Tk_GetUid("left"); rightUid = Tk_GetUid("right"); flushUid = Tk_GetUid("flush"); } mbPtr->direction = flushUid; Tk_CreateEventHandler(mbPtr->tkwin, ExposureMask|StructureNotifyMask|FocusChangeMask, MenuButtonEventProc, (ClientData) mbPtr); if (ConfigureMenuButton(interp, mbPtr, argc-2, argv+2, 0) != TCL_OK) { Tk_DestroyWindow(mbPtr->tkwin); return TCL_ERROR; } interp->result = Tk_PathName(mbPtr->tkwin); return TCL_OK; } /* *-------------------------------------------------------------- * * MenuButtonWidgetCmd -- * * This procedure is invoked to process the Tcl command * that corresponds to a widget managed by this module. * See the user documentation for details on what it does. * * Results: * A standard Tcl result. * * Side effects: * See the user documentation. * *-------------------------------------------------------------- */ static int MenuButtonWidgetCmd(clientData, interp, argc, argv) ClientData clientData; /* Information about button widget. */ Tcl_Interp *interp; /* Current interpreter. */ int argc; /* Number of arguments. */ char **argv; /* Argument strings. */ { register TkMenuButton *mbPtr = (TkMenuButton *) clientData; int result; size_t length; int c; if (argc < 2) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " option ?arg arg ...?\"", (char *) NULL); return TCL_ERROR; } Tcl_Preserve((ClientData) mbPtr); c = argv[1][0]; length = strlen(argv[1]); if ((c == 'c') && (strncmp(argv[1], "cget", length) == 0) && (length >= 2)) { if (argc != 3) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " cget option\"", (char *) NULL); result = TCL_ERROR; } else { result = Tk_ConfigureValue(interp, mbPtr->tkwin, configSpecs, (char *) mbPtr, argv[2], 0); } } else if ((c == 'c') && (strncmp(argv[1], "configure", length) == 0) && (length >= 2)) { if (argc == 2) { result = Tk_ConfigureInfo(interp, mbPtr->tkwin, configSpecs, (char *) mbPtr, (char *) NULL, 0); } else if (argc == 3) { result = Tk_ConfigureInfo(interp, mbPtr->tkwin, configSpecs, (char *) mbPtr, argv[2], 0); } else { result = ConfigureMenuButton(interp, mbPtr, argc-2, argv+2, TK_CONFIG_ARGV_ONLY); } } else { Tcl_AppendResult(interp, "bad option \"", argv[1], "\": must be cget or configure", (char *) NULL); result = TCL_ERROR; } Tcl_Release((ClientData) mbPtr); return result; } /* *---------------------------------------------------------------------- * * DestroyMenuButton -- * * This procedure is invoked to recycle all of the resources * associated with a button widget. It is invoked as a * when-idle handler in order to make sure that there is no * other use of the button pending at the time of the deletion. * * Results: * None. * * Side effects: * Everything associated with the widget is freed up. * *---------------------------------------------------------------------- */ static void DestroyMenuButton(memPtr) char *memPtr; /* Info about button widget. */ { register TkMenuButton *mbPtr = (TkMenuButton *) memPtr; /* * Free up all the stuff that requires special handling, then * let Tk_FreeOptions handle all the standard option-related * stuff. */ if (mbPtr->textVarName != NULL) { Tcl_UntraceVar(mbPtr->interp, mbPtr->textVarName, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, MenuButtonTextVarProc, (ClientData) mbPtr); } if (mbPtr->image != NULL) { Tk_FreeImage(mbPtr->image); } if (mbPtr->normalTextGC != None) { Tk_FreeGC(mbPtr->display, mbPtr->normalTextGC); } if (mbPtr->activeTextGC != None) { Tk_FreeGC(mbPtr->display, mbPtr->activeTextGC); } if (mbPtr->gray != None) { Tk_FreeBitmap(mbPtr->display, mbPtr->gray); } if (mbPtr->disabledGC != None) { Tk_FreeGC(mbPtr->display, mbPtr->disabledGC); } Tk_FreeTextLayout(mbPtr->textLayout); Tk_FreeOptions(configSpecs, (char *) mbPtr, mbPtr->display, 0); ckfree((char *) mbPtr); } /* *---------------------------------------------------------------------- * * ConfigureMenuButton -- * * This procedure is called to process an argv/argc list, plus * the Tk option database, in order to configure (or * reconfigure) a menubutton widget. * * Results: * The return value is a standard Tcl result. If TCL_ERROR is * returned, then interp->result contains an error message. * * Side effects: * Configuration information, such as text string, colors, font, * etc. get set for mbPtr; old resources get freed, if there * were any. The menubutton is redisplayed. * *---------------------------------------------------------------------- */ static int ConfigureMenuButton(interp, mbPtr, argc, argv, flags) Tcl_Interp *interp; /* Used for error reporting. */ register TkMenuButton *mbPtr; /* Information about widget; may or may * not already have values for some fields. */ int argc; /* Number of valid entries in argv. */ char **argv; /* Arguments. */ int flags; /* Flags to pass to Tk_ConfigureWidget. */ { int result; Tk_Image image; /* * Eliminate any existing trace on variables monitored by the menubutton. */ if (mbPtr->textVarName != NULL) { Tcl_UntraceVar(interp, mbPtr->textVarName, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, MenuButtonTextVarProc, (ClientData) mbPtr); } result = Tk_ConfigureWidget(interp, mbPtr->tkwin, configSpecs, argc, argv, (char *) mbPtr, flags); if (result != TCL_OK) { return TCL_ERROR; } /* * A few options need special processing, such as setting the * background from a 3-D border, or filling in complicated * defaults that couldn't be specified to Tk_ConfigureWidget. */ if ((mbPtr->state == tkActiveUid) && !Tk_StrictMotif(mbPtr->tkwin)) { Tk_SetBackgroundFromBorder(mbPtr->tkwin, mbPtr->activeBorder); } else { Tk_SetBackgroundFromBorder(mbPtr->tkwin, mbPtr->normalBorder); if ((mbPtr->state != tkNormalUid) && (mbPtr->state != tkActiveUid) && (mbPtr->state != tkDisabledUid)) { Tcl_AppendResult(interp, "bad state value \"", mbPtr->state, "\": must be normal, active, or disabled", (char *) NULL); mbPtr->state = tkNormalUid; return TCL_ERROR; } } if ((mbPtr->direction != aboveUid) && (mbPtr->direction != belowUid) && (mbPtr->direction != leftUid) && (mbPtr->direction != rightUid) && (mbPtr->direction != flushUid)) { Tcl_AppendResult(interp, "bad direction value \"", mbPtr->direction, "\": must be above, below, left, right, or flush", (char *) NULL); mbPtr->direction = belowUid; return TCL_ERROR; } if (mbPtr->highlightWidth < 0) { mbPtr->highlightWidth = 0; } if (mbPtr->padX < 0) { mbPtr->padX = 0; } if (mbPtr->padY < 0) { mbPtr->padY = 0; } /* * Get the image for the widget, if there is one. Allocate the * new image before freeing the old one, so that the reference * count doesn't go to zero and cause image data to be discarded. */ if (mbPtr->imageString != NULL) { image = Tk_GetImage(mbPtr->interp, mbPtr->tkwin, mbPtr->imageString, MenuButtonImageProc, (ClientData) mbPtr); if (image == NULL) { return TCL_ERROR; } } else { image = NULL; } if (mbPtr->image != NULL) { Tk_FreeImage(mbPtr->image); } mbPtr->image = image; if ((mbPtr->image == NULL) && (mbPtr->bitmap == None) && (mbPtr->textVarName != NULL)) { /* * The menubutton displays a variable. Set up a trace to watch * for any changes in it. */ char *value; value = Tcl_GetVar(interp, mbPtr->textVarName, TCL_GLOBAL_ONLY); if (value == NULL) { Tcl_SetVar(interp, mbPtr->textVarName, mbPtr->text, TCL_GLOBAL_ONLY); } else { if (mbPtr->text != NULL) { ckfree(mbPtr->text); } mbPtr->text = (char *) ckalloc((unsigned) (strlen(value) + 1)); strcpy(mbPtr->text, value); } Tcl_TraceVar(interp, mbPtr->textVarName, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, MenuButtonTextVarProc, (ClientData) mbPtr); } /* * Recompute the geometry for the button. */ if ((mbPtr->bitmap != None) || (mbPtr->image != NULL)) { if (Tk_GetPixels(interp, mbPtr->tkwin, mbPtr->widthString, &mbPtr->width) != TCL_OK) { widthError: Tcl_AddErrorInfo(interp, "\n (processing -width option)"); return TCL_ERROR; } if (Tk_GetPixels(interp, mbPtr->tkwin, mbPtr->heightString, &mbPtr->height) != TCL_OK) { heightError: Tcl_AddErrorInfo(interp, "\n (processing -height option)"); return TCL_ERROR; } } else { if (Tcl_GetInt(interp, mbPtr->widthString, &mbPtr->width) != TCL_OK) { goto widthError; } if (Tcl_GetInt(interp, mbPtr->heightString, &mbPtr->height) != TCL_OK) { goto heightError; } } TkMenuButtonWorldChanged((ClientData) mbPtr); return TCL_OK; } /* *--------------------------------------------------------------------------- * * TkMenuButtonWorldChanged -- * * This procedure is called when the world has changed in some * way and the widget needs to recompute all its graphics contexts * and determine its new geometry. * * Results: * None. * * Side effects: * TkMenuButton will be relayed out and redisplayed. * *--------------------------------------------------------------------------- */ void TkMenuButtonWorldChanged(instanceData) ClientData instanceData; /* Information about widget. */ { XGCValues gcValues; GC gc; unsigned long mask; TkMenuButton *mbPtr; mbPtr = (TkMenuButton *) instanceData; gcValues.font = Tk_FontId(mbPtr->tkfont); gcValues.foreground = mbPtr->normalFg->pixel; gcValues.background = Tk_3DBorderColor(mbPtr->normalBorder)->pixel; /* * Note: GraphicsExpose events are disabled in GC's because they're * used to copy stuff from an off-screen pixmap onto the screen (we know * that there's no problem with obscured areas). */ gcValues.graphics_exposures = False; mask = GCForeground | GCBackground | GCFont | GCGraphicsExposures; gc = Tk_GetGC(mbPtr->tkwin, mask, &gcValues); if (mbPtr->normalTextGC != None) { Tk_FreeGC(mbPtr->display, mbPtr->normalTextGC); } mbPtr->normalTextGC = gc; gcValues.font = Tk_FontId(mbPtr->tkfont); gcValues.foreground = mbPtr->activeFg->pixel; gcValues.background = Tk_3DBorderColor(mbPtr->activeBorder)->pixel; mask = GCForeground | GCBackground | GCFont; gc = Tk_GetGC(mbPtr->tkwin, mask, &gcValues); if (mbPtr->activeTextGC != None) { Tk_FreeGC(mbPtr->display, mbPtr->activeTextGC); } mbPtr->activeTextGC = gc; gcValues.font = Tk_FontId(mbPtr->tkfont); gcValues.background = Tk_3DBorderColor(mbPtr->normalBorder)->pixel; if ((mbPtr->disabledFg != NULL) && (mbPtr->imageString == NULL)) { gcValues.foreground = mbPtr->disabledFg->pixel; mask = GCForeground | GCBackground | GCFont; } else { gcValues.foreground = gcValues.background; mask = GCForeground; if (mbPtr->gray == None) { mbPtr->gray = Tk_GetBitmap(NULL, mbPtr->tkwin, Tk_GetUid("gray50")); } if (mbPtr->gray != None) { gcValues.fill_style = FillStippled; gcValues.stipple = mbPtr->gray; mask |= GCFillStyle | GCStipple; } } gc = Tk_GetGC(mbPtr->tkwin, mask, &gcValues); if (mbPtr->disabledGC != None) { Tk_FreeGC(mbPtr->display, mbPtr->disabledGC); } mbPtr->disabledGC = gc; TkpComputeMenuButtonGeometry(mbPtr); /* * Lastly, arrange for the button to be redisplayed. */ if (Tk_IsMapped(mbPtr->tkwin) && !(mbPtr->flags & REDRAW_PENDING)) { Tcl_DoWhenIdle(TkpDisplayMenuButton, (ClientData) mbPtr); mbPtr->flags |= REDRAW_PENDING; } } /* *-------------------------------------------------------------- * * MenuButtonEventProc -- * * This procedure is invoked by the Tk dispatcher for various * events on buttons. * * Results: * None. * * Side effects: * When the window gets deleted, internal structures get * cleaned up. When it gets exposed, it is redisplayed. * *-------------------------------------------------------------- */ static void MenuButtonEventProc(clientData, eventPtr) ClientData clientData; /* Information about window. */ XEvent *eventPtr; /* Information about event. */ { TkMenuButton *mbPtr = (TkMenuButton *) clientData; if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) { goto redraw; } else if (eventPtr->type == ConfigureNotify) { /* * Must redraw after size changes, since layout could have changed * and borders will need to be redrawn. */ goto redraw; } else if (eventPtr->type == DestroyNotify) { TkpDestroyMenuButton(mbPtr); if (mbPtr->tkwin != NULL) { mbPtr->tkwin = NULL; Tcl_DeleteCommandFromToken(mbPtr->interp, mbPtr->widgetCmd); } if (mbPtr->flags & REDRAW_PENDING) { Tcl_CancelIdleCall(TkpDisplayMenuButton, (ClientData) mbPtr); } Tcl_EventuallyFree((ClientData) mbPtr, DestroyMenuButton); } else if (eventPtr->type == FocusIn) { if (eventPtr->xfocus.detail != NotifyInferior) { mbPtr->flags |= GOT_FOCUS; if (mbPtr->highlightWidth > 0) { goto redraw; } } } else if (eventPtr->type == FocusOut) { if (eventPtr->xfocus.detail != NotifyInferior) { mbPtr->flags &= ~GOT_FOCUS; if (mbPtr->highlightWidth > 0) { goto redraw; } } } return; redraw: if ((mbPtr->tkwin != NULL) && !(mbPtr->flags & REDRAW_PENDING)) { Tcl_DoWhenIdle(TkpDisplayMenuButton, (ClientData) mbPtr); mbPtr->flags |= REDRAW_PENDING; } } /* *---------------------------------------------------------------------- * * MenuButtonCmdDeletedProc -- * * This procedure is invoked when a widget command is deleted. If * the widget isn't already in the process of being destroyed, * this command destroys it. * * Results: * None. * * Side effects: * The widget is destroyed. * *---------------------------------------------------------------------- */ static void MenuButtonCmdDeletedProc(clientData) ClientData clientData; /* Pointer to widget record for widget. */ { TkMenuButton *mbPtr = (TkMenuButton *) clientData; Tk_Window tkwin = mbPtr->tkwin; /* * This procedure could be invoked either because the window was * destroyed and the command was then deleted (in which case tkwin * is NULL) or because the command was deleted, and then this procedure * destroys the widget. */ if (tkwin != NULL) { mbPtr->tkwin = NULL; Tk_DestroyWindow(tkwin); } } /* *-------------------------------------------------------------- * * MenuButtonTextVarProc -- * * This procedure is invoked when someone changes the variable * whose contents are to be displayed in a menu button. * * Results: * NULL is always returned. * * Side effects: * The text displayed in the menu button will change to match the * variable. * *-------------------------------------------------------------- */ /* ARGSUSED */ static char * MenuButtonTextVarProc(clientData, interp, name1, name2, flags) ClientData clientData; /* Information about button. */ Tcl_Interp *interp; /* Interpreter containing variable. */ char *name1; /* Name of variable. */ char *name2; /* Second part of variable name. */ int flags; /* Information about what happened. */ { register TkMenuButton *mbPtr = (TkMenuButton *) clientData; char *value; /* * If the variable is unset, then immediately recreate it unless * the whole interpreter is going away. */ if (flags & TCL_TRACE_UNSETS) { if ((flags & TCL_TRACE_DESTROYED) && !(flags & TCL_INTERP_DESTROYED)) { Tcl_SetVar(interp, mbPtr->textVarName, mbPtr->text, TCL_GLOBAL_ONLY); Tcl_TraceVar(interp, mbPtr->textVarName, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, MenuButtonTextVarProc, clientData); } return (char *) NULL; } value = Tcl_GetVar(interp, mbPtr->textVarName, TCL_GLOBAL_ONLY); if (value == NULL) { value = ""; } if (mbPtr->text != NULL) { ckfree(mbPtr->text); } mbPtr->text = (char *) ckalloc((unsigned) (strlen(value) + 1)); strcpy(mbPtr->text, value); TkpComputeMenuButtonGeometry(mbPtr); if ((mbPtr->tkwin != NULL) && Tk_IsMapped(mbPtr->tkwin) && !(mbPtr->flags & REDRAW_PENDING)) { Tcl_DoWhenIdle(TkpDisplayMenuButton, (ClientData) mbPtr); mbPtr->flags |= REDRAW_PENDING; } return (char *) NULL; } /* *---------------------------------------------------------------------- * * MenuButtonImageProc -- * * This procedure is invoked by the image code whenever the manager * for an image does something that affects the size of contents * of an image displayed in a button. * * Results: * None. * * Side effects: * Arranges for the button to get redisplayed. * *---------------------------------------------------------------------- */ static void MenuButtonImageProc(clientData, x, y, width, height, imgWidth, imgHeight) ClientData clientData; /* Pointer to widget record. */ int x, y; /* Upper left pixel (within image) * that must be redisplayed. */ int width, height; /* Dimensions of area to redisplay * (may be <= 0). */ int imgWidth, imgHeight; /* New dimensions of image. */ { register TkMenuButton *mbPtr = (TkMenuButton *) clientData; if (mbPtr->tkwin != NULL) { TkpComputeMenuButtonGeometry(mbPtr); if (Tk_IsMapped(mbPtr->tkwin) && !(mbPtr->flags & REDRAW_PENDING)) { Tcl_DoWhenIdle(TkpDisplayMenuButton, (ClientData) mbPtr); mbPtr->flags |= REDRAW_PENDING; } } }
31.685912
77
0.644679
30fdcc90ef6e4e753aeab8b5e2f8fa839a34cb01
1,366
h
C
engine/resource/provider/internetResourceProvider.h
Trico-Everfire/ChiraEngine
49dc2d8bb3aa515825ac94474a27f2ce2edf8070
[ "MIT" ]
5
2021-09-13T17:37:06.000Z
2022-02-28T20:19:41.000Z
engine/resource/provider/internetResourceProvider.h
Trico-Everfire/ChiraEngine
49dc2d8bb3aa515825ac94474a27f2ce2edf8070
[ "MIT" ]
5
2021-08-19T18:54:49.000Z
2022-03-01T14:07:37.000Z
engine/resource/provider/internetResourceProvider.h
Trico-Everfire/ChiraEngine
49dc2d8bb3aa515825ac94474a27f2ce2edf8070
[ "MIT" ]
3
2021-08-19T09:41:45.000Z
2022-02-17T22:14:15.000Z
#pragma once #include "abstractResourceProvider.h" namespace chira { /// Note: this provider must only be registered once under one name / protocol! /// It always returns true when asked if it holds a resource, this may not actually be true however. /// Additionally, the "name" passed to it is the protocol it uses (e.g. http, https, ftp, etc.) class InternetResourceProvider : public AbstractResourceProvider { public: explicit InternetResourceProvider(const std::string& name_, unsigned short port_) : AbstractResourceProvider(name_) , port(port_) {} /// Redefines this function to always return true. /// This is better than sending a request to the URI and seeing if it's valid, because that will take a lot of time. /// It lets us request the resource immediately, but you must know beforehand that it's a valid URI. [[nodiscard]] bool hasResource(const std::string& name) const override { return true; } void compileResource(const std::string& name, Resource* resource) const override; [[nodiscard]] const std::string& getProtocol() const { return this->providerName; } [[nodiscard]] unsigned short getPort() const { return this->port; } private: unsigned short port; }; }
44.064516
124
0.656662
aa581ba11e661b7980414d08af048a3a239c683e
551
h
C
SF-MicroSD/src/ir_10-150cm.h
padlewski/DLP_COMP444
7635517b50f2c806856fc748db6f6f6c5bc26d34
[ "MIT" ]
null
null
null
SF-MicroSD/src/ir_10-150cm.h
padlewski/DLP_COMP444
7635517b50f2c806856fc748db6f6f6c5bc26d34
[ "MIT" ]
null
null
null
SF-MicroSD/src/ir_10-150cm.h
padlewski/DLP_COMP444
7635517b50f2c806856fc748db6f6f6c5bc26d34
[ "MIT" ]
null
null
null
#ifndef IR_10_150CM.H #define IR_10_150CM.H #include <Arduino.h> struct IR { const byte pin; const byte vcc; double volts; double cm; }; const double const_5v = 64.106; const double pow_5v = -1.603; IR init(byte pin, byte vcc) { return (IR) {pin, vcc, 0, 0 }; } void read(IR *ir) { ir->volts = 0; for(int i = 0 ; i < 10 ; ++i){ ir->volts += analogRead(ir->pin); } ir->volts /= 10.0; ir->volts = ir->volts * (5.0f / 1023.0); ir->cm = const_5v * pow(ir->volts, pow_5v); } #endif // IR_10_150CM.H
18.366667
47
0.569873
b74e9b95a9e245b9452193c55aae6b7382c7ff17
15,122
c
C
sdk/JN-SW-4170/Components/ZCIF/Source/zcl_discoverAttributesRequestHandle.c
freechw/JN5169-for-xiaomi-wireless-switch
d2b605d4727e61108e9a91d97e7993fc950b3973
[ "BSD-3-Clause" ]
71
2019-01-17T02:22:09.000Z
2022-03-17T02:18:35.000Z
sdk/JN-SW-4170/Components/ZCIF/Source/zcl_discoverAttributesRequestHandle.c
freechw/JN5169-for-xiaomi-wireless-switch
d2b605d4727e61108e9a91d97e7993fc950b3973
[ "BSD-3-Clause" ]
2
2019-02-15T05:01:30.000Z
2019-07-09T02:27:41.000Z
sdk/JN-SW-4170/Components/ZCIF/Source/zcl_discoverAttributesRequestHandle.c
freechw/JN5169-for-xiaomi-wireless-switch
d2b605d4727e61108e9a91d97e7993fc950b3973
[ "BSD-3-Clause" ]
19
2019-01-21T06:15:35.000Z
2021-08-06T02:16:05.000Z
/***************************************************************************** * * MODULE: Smart Energy * * COMPONENT: ZCL * * AUTHOR: we1 * * DESCRIPTION: Attribute Discovery * * $ $ * * $Revision: $ * * $LastChangedBy: we1 $ * * $LastChangedDate: $ * * $Id: $ * **************************************************************************** * * This software is owned by NXP B.V. and/or its supplier and is protected * under applicable copyright laws. All rights are reserved. We grant You, * and any third parties, a license to use this software solely and * exclusively on NXP products [NXP Microcontrollers such as JN5168, JN5179]. * You, and any third parties must reproduce the copyright and warranty notice * and any other legend of ownership on each copy or partial copy of the * software. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * Copyright NXP B.V. 2016. All rights reserved ****************************************************************************/ /****************************************************************************/ /*** Include files ***/ /****************************************************************************/ #include <jendefs.h> #include "zcl.h" #include "zcl_customcommand.h" #include "zcl_common.h" #include "zcl_internal.h" #include "pdum_apl.h" #include "zps_apl.h" #include "zps_apl_af.h" /****************************************************************************/ /*** Macro Definitions ***/ /****************************************************************************/ /****************************************************************************/ /*** Type Definitions ***/ /****************************************************************************/ /****************************************************************************/ /*** Local Function Prototypes ***/ /****************************************************************************/ PRIVATE teZCL_Status eZCL_SearchForClosestAttributeEntry( uint16 u16AttributeEnum, bool_t bManufacturerSpecific, tsZCL_ClusterInstance *psClusterInstance, uint16 *pu16FirstAttributeId, uint16 *pu16attributeIndex); /****************************************************************************/ /*** Exported Variables ***/ /****************************************************************************/ /****************************************************************************/ /*** Local Variables ***/ /****************************************************************************/ /****************************************************************************/ /*** Public Functions ***/ /****************************************************************************/ /**************************************************************************** ** ** NAME: vZCL_HandleAttributesDiscoverRequest ** ** DESCRIPTION: ** Handles an attribute discovery request ** ** PARAMETERS: Name Usage ** ZPS_tsAfEvent *pZPSevent Zigbee Stack Event ** tsZCL_EndPointDefinition *psZCL_EndPointDefinition EP structure ** tsZCL_ClusterInstance *psClusterInstance Cluster structure ** ** RETURN: ** None ** ****************************************************************************/ PUBLIC void vZCL_HandleAttributesDiscoverRequest( ZPS_tsAfEvent *pZPSevent, tsZCL_EndPointDefinition *psZCL_EndPointDefinition, tsZCL_ClusterInstance *psClusterInstance) { uint16 i, j; uint16 u16inputOffset, u16outputOffset, u16BufferOverflowFlagOffset, u16Index = 0; tsZCL_HeaderParams sZCL_HeaderParams; bool_t bDiscoveryComplete; uint16 u16AttributeId, u16FirstAttributeId, u16TempAttrId; tsZCL_Address sZCL_Address; uint8 u8MaximumNumberOfIdentifiers; uint16 u16payloadSize; uint16 u16responseBufferSize; PDUM_thAPduInstance myPDUM_thAPduInstance; uint16 u16FirstAttributeIndex=0; bool_t bFoundAttribute; // build command packet for response // read incoming request u16inputOffset = u16ZCL_ReadCommandHeader(pZPSevent->uEvent.sApsDataIndEvent.hAPduInst, &sZCL_HeaderParams); // payload investigation u16payloadSize = PDUM_u16APduInstanceGetPayloadSize(pZPSevent->uEvent.sApsDataIndEvent.hAPduInst); // size of outgoing buffer u16responseBufferSize = u16ZCL_GetTxPayloadSize(pZPSevent->uEvent.sApsDataIndEvent.uSrcAddress.u16Addr); // size sanity checks if((u16payloadSize < u16inputOffset) || ((u16payloadSize - u16inputOffset)!=3)) { // send response if possible eZCL_SendDefaultResponse(pZPSevent, E_ZCL_CMDS_MALFORMED_COMMAND); return; } // get buffer to write the response in myPDUM_thAPduInstance = hZCL_AllocateAPduInstance(); // no buffers - return. we can make this descision a bit more exotic using the incoming buffer to store the // outgoing command but for the moment we are implementing the KISS principle. if(myPDUM_thAPduInstance == PDUM_INVALID_HANDLE) { return; } if(u16responseBufferSize < (u16inputOffset+3)) { // send response if possible eZCL_SendDefaultResponse(pZPSevent, E_ZCL_CMDS_SOFTWARE_FAILURE); // free buffer and return PDUM_eAPduFreeAPduInstance(myPDUM_thAPduInstance); return; } // modify and write back u16outputOffset = u16ZCL_WriteCommandHeader(myPDUM_thAPduInstance, sZCL_HeaderParams.eFrameType, sZCL_HeaderParams.bManufacturerSpecific, sZCL_HeaderParams.u16ManufacturerCode, !sZCL_HeaderParams.bDirection, psZCL_EndPointDefinition->bDisableDefaultResponse, sZCL_HeaderParams.u8TransactionSequenceNumber, E_ZCL_DISCOVER_ATTRIBUTES_RESPONSE); // read input attribute Id u16inputOffset += u16ZCL_APduInstanceReadNBO( pZPSevent->uEvent.sApsDataIndEvent.hAPduInst, u16inputOffset, E_ZCL_ATTRIBUTE_ID, &u16AttributeId); u16inputOffset += u16ZCL_APduInstanceReadNBO( pZPSevent->uEvent.sApsDataIndEvent.hAPduInst, u16inputOffset, E_ZCL_UINT8, &u8MaximumNumberOfIdentifiers); u16BufferOverflowFlagOffset = u16outputOffset; // parse the cluster, read each attribute from the device and write into the outgoing buffer i=0; j=0; // step over discovery complete flag slot u16outputOffset++; bFoundAttribute = FALSE; if(eZCL_SearchForClosestAttributeEntry(u16AttributeId, sZCL_HeaderParams.bManufacturerSpecific, psClusterInstance, &u16FirstAttributeId, &u16FirstAttributeIndex) == E_ZCL_SUCCESS) { bFoundAttribute = TRUE; j = u16FirstAttributeIndex; u16Index = u16FirstAttributeIndex; u16TempAttrId = u16FirstAttributeId; while((j < psClusterInstance->psClusterDefinition->u16NumberOfAttributes) && (i < u8MaximumNumberOfIdentifiers) && (u16responseBufferSize >= (u16outputOffset +3)) ) { // check attribute flag matches if( (bZCL_CheckManufacturerSpecificAttributeFlagMatch(&psClusterInstance->psClusterDefinition->psAttributeDefinition[u16Index], sZCL_HeaderParams.bManufacturerSpecific)) && (bZCL_CheckAttributeDirectionFlagMatch(&psClusterInstance->psClusterDefinition->psAttributeDefinition[u16Index],!(sZCL_HeaderParams.bDirection))) ) { // write Attribute Id and type into outgoing buffer u16outputOffset += u16ZCL_APduInstanceWriteNBO(myPDUM_thAPduInstance, u16outputOffset, E_ZCL_ATTRIBUTE_ID, &u16TempAttrId); u16outputOffset += u16ZCL_APduInstanceWriteNBO(myPDUM_thAPduInstance, u16outputOffset, E_ZCL_UINT8, &psClusterInstance->psClusterDefinition->psAttributeDefinition[u16Index].eAttributeDataType); // increment attribute count i++; } // increment loop count j++; if((psClusterInstance->psClusterDefinition->psAttributeDefinition[u16Index].u16AttributeArrayLength != 0)&& ((u16TempAttrId - psClusterInstance->psClusterDefinition->psAttributeDefinition[u16Index].u16AttributeEnum) < psClusterInstance->psClusterDefinition->psAttributeDefinition[u16Index].u16AttributeArrayLength)) { u16TempAttrId++; } else { u16Index++; u16TempAttrId = psClusterInstance->psClusterDefinition->psAttributeDefinition[u16Index].u16AttributeEnum; } } } // we need to check if there are any valid attributes left to discover, this must take into account the MS flag bDiscoveryComplete = TRUE; while(bFoundAttribute && (j < psClusterInstance->psClusterDefinition->u16NumberOfAttributes) && (bDiscoveryComplete != FALSE)) { // check attribute flag matches if(bZCL_CheckManufacturerSpecificAttributeFlagMatch(&psClusterInstance->psClusterDefinition->psAttributeDefinition[u16Index], sZCL_HeaderParams.bManufacturerSpecific)) { bDiscoveryComplete = FALSE; } // increment loop count j++; if((psClusterInstance->psClusterDefinition->psAttributeDefinition[u16Index].u16AttributeArrayLength != 0)&& ((u16TempAttrId - psClusterInstance->psClusterDefinition->psAttributeDefinition[u16Index].u16AttributeEnum) < psClusterInstance->psClusterDefinition->psAttributeDefinition[u16Index].u16AttributeArrayLength)) { u16TempAttrId++; } else { u16Index++; u16TempAttrId = psClusterInstance->psClusterDefinition->psAttributeDefinition[u16Index].u16AttributeEnum; } } // write discovery result in first byte u16ZCL_APduInstanceWriteNBO(myPDUM_thAPduInstance, u16BufferOverflowFlagOffset, E_ZCL_BOOL, &bDiscoveryComplete); // transmit // NTS testing Nov 09. Don't send a good default response here as we have a unicast response that is valid. // build address structure eZCL_BuildTransmitAddressStructure(pZPSevent, &sZCL_Address); // transmit request eZCL_TransmitDataRequest(myPDUM_thAPduInstance, u16outputOffset, pZPSevent->uEvent.sApsDataIndEvent.u8DstEndpoint, pZPSevent->uEvent.sApsDataIndEvent.u8SrcEndpoint, pZPSevent->uEvent.sApsDataIndEvent.u16ClusterId, &sZCL_Address); } /**************************************************************************** ** ** NAME: eZCL_SearchForClosestAttributeEntry ** ** DESCRIPTION: ** Searches For An Attribute Definition In The Endpoint ** assumes EP has already been validiated ** ** PARAMETERS: Name Usage ** uint16 u16AttributeEnum Attribute Id ** bool_t bIsManufacturerSpecific Attribute manufacturer specific ** tsZCL_ClusterInstance *psClusterInstance Cluster Structure ** tsZCL_AttributeDefinition **ppsAttributeDefinition Attribute Structure ** uint16 *pu16attributeIndex Index of attribute definition ** ** RETURN: ** teZCL_Status ** ****************************************************************************/ PRIVATE teZCL_Status eZCL_SearchForClosestAttributeEntry( uint16 u16AttributeEnum, bool_t bManufacturerSpecific, tsZCL_ClusterInstance *psClusterInstance, uint16 *pu16FirstAttributeId, uint16 *pu16attributeIndex) { tsZCL_AttributeDefinition *psAttributeDefinition; uint16 u16TempAttrId; if (psClusterInstance == NULL) { return(E_ZCL_ERR_ATTRIBUTE_NOT_FOUND); } psAttributeDefinition = psClusterInstance->psClusterDefinition->psAttributeDefinition; u16TempAttrId = psAttributeDefinition->u16AttributeEnum; // not found for(*pu16attributeIndex=0; *pu16attributeIndex < psClusterInstance->psClusterDefinition->u16NumberOfAttributes; (*pu16attributeIndex)++) { if((u16TempAttrId >= u16AttributeEnum) && bZCL_CheckManufacturerSpecificAttributeFlagMatch(psAttributeDefinition, bManufacturerSpecific)) { *pu16FirstAttributeId = u16TempAttrId; return(E_ZCL_SUCCESS); } if((psAttributeDefinition->u16AttributeArrayLength != 0)&&((u16TempAttrId - psAttributeDefinition->u16AttributeEnum) < psAttributeDefinition->u16AttributeArrayLength)) { u16TempAttrId++; } else { psAttributeDefinition++; u16TempAttrId = psAttributeDefinition->u16AttributeEnum; } } return(E_ZCL_ERR_ATTRIBUTE_NOT_FOUND); } /****************************************************************************/ /*** END OF FILE ***/ /****************************************************************************/
44.087464
219
0.553961